import{_}from"./GroupBadge.vue_vue_type_script_setup_true_lang-C5ARZGJV.js";import{u as g}from"./vendor-i18n-DnQQ95F5.js";import{r as y,j as n,g as r,o as k,Y as s,a1 as l,F as x,Q as b,i as v,e as V,M as i,p as C}from"./vendor-vue-gvI8EVHg.js";const w={class:"input-label"},B={class:"font-normal text-gray-400"},N={class:"grid max-h-32 grid-cols-2 gap-1 overflow-y-auto rounded-lg border border-gray-200 bg-gray-50 p-2 dark:border-dark-600 dark:bg-dark-800"},S=["title"],A=["value","checked","onChange"],G={class:"shrink-0 text-xs text-gray-400"},F={key:0,class:"col-span-2 py-2 text-center text-sm text-gray-500 dark:text-gray-400"},L=y({__name:"GroupSelector",props:{modelValue:{},groups:{},platform:{},mixedScheduling:{type:Boolean}},emits:["update:modelValue"],setup(c,{emit:p}){const{t:o}=g(),t=c,f=p,m=V(()=>t.platform?t.platform==="antigravity"&&t.mixedScheduling?t.groups.filter(a=>a.platform==="antigravity"||a.platform==="anthropic"||a.platform==="gemini"):t.groups.filter(a=>a.platform===t.platform):t.groups),h=(a,u)=>{const e=u?[...t.modelValue,a]:t.modelValue.filter(d=>d!==a);f("update:modelValue",e)};return(a,u)=>(i(),n("div",null,[r("label",w,[k(s(l(o)("admin.users.groups"))+" ",1),r("span",B,s(l(o)("common.selectedCount",{count:c.modelValue.length})),1)]),r("div",N,[(i(!0),n(x,null,b(m.value,e=>(i(),n("label",{key:e.id,class:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 transition-colors hover:bg-white dark:hover:bg-dark-700",title:l(o)("admin.groups.rateAndAccounts",{rate:e.rate_multiplier,count:e.account_count||0})},[r("input",{type:"checkbox",value:e.id,checked:c.modelValue.includes(e.id),onChange:d=>h(e.id,d.target.checked),class:"h-3.5 w-3.5 shrink-0 rounded border-gray-300 text-primary-500 focus:ring-primary-500 dark:border-dark-500"},null,40,A),C(_,{name:e.name,platform:e.platform,"subscription-type":e.subscription_type,"rate-multiplier":e.rate_multiplier,class:"min-w-0 flex-1"},null,8,["name","platform","subscription-type","rate-multiplier"]),r("span",G,s(e.account_count||0),1)],8,S))),128)),m.value.length===0?(i(),n("div",F,s(l(o)("common.noGroupsAvailable")),1)):v("",!0)])]))}});export{L as _};
