import{bk as i,b7 as f,am as h,cx as x,Q as g,bH as p,bu as k,N as V,cI as P,cA as v,c as C,dn as G,dp as O,by as _,aq as y}from"./index-xnhGKCfe.js";const[E,S]=i("checkbox-group"),N=Symbol(E),[$,B]=i("checkbox"),H=h({},O,{shape:String,bindGroup:_,indeterminate:{type:Boolean,default:null}});var I=f({name:$,props:H,emits:["change","update:modelValue"],setup(e,{emit:c,slots:m}){const{parent:a}=x(N),r=n=>{const{name:l}=e,{max:d,modelValue:b}=a.props,t=b.slice();if(n)!(d&&t.length>=+d)&&!t.includes(l)&&(t.push(l),e.bindGroup&&a.updateValue(t));else{const s=t.indexOf(l);s!==-1&&(t.splice(s,1),e.bindGroup&&a.updateValue(t))}},o=C(()=>a&&e.bindGroup?a.props.modelValue.indexOf(e.name)!==-1:!!e.modelValue),u=(n=!o.value)=>{a&&e.bindGroup?r(n):c("update:modelValue",n),e.indeterminate!==null&&c("change",n)};return g(()=>e.modelValue,n=>{e.indeterminate===null&&c("change",n)}),p({toggle:u,props:e,checked:o}),k(()=>e.modelValue),()=>V(G,v({bem:B,role:"checkbox",parent:a,checked:o.value,onToggle:u},e),P(m,["default","icon"]))}});const q=y(I);export{q as C};
