import{M as f,aL as P,S as h,O as G,Q as p,R as S,$ as k,ax as b,al as g,f as V,X as x,W as _,V as O,l as $,aA as y,p as A,N as B}from"./index-BV0H45HW.js";import{s as E,c as N}from"./index-mmkJMJwV.js";const[v,K]=p("checkbox-group"),R={max:h,shape:G("round"),disabled:Boolean,iconSize:h,direction:String,modelValue:P(),checkedColor:String},C=Symbol(v);var X=f({name:v,props:R,emits:["change","update:modelValue"],setup(a,{emit:c,slots:u}){const{children:l,linkChildren:i}=S(C),o=e=>c("update:modelValue",e),s=(e={})=>{typeof e=="boolean"&&(e={checked:e});const{checked:d,skipDisabled:r}=e,t=l.filter(n=>n.props.bindGroup?n.props.disabled&&r?n.checked.value:d??!n.checked.value:!1).map(n=>n.name);o(t)};return k(()=>a.modelValue,e=>c("change",e)),b({toggleAll:s}),g(()=>a.modelValue),i({props:a,updateValue:o}),()=>{var e;return V("div",{class:K([a.direction])},[(e=u.default)==null?void 0:e.call(u)])}}});const M=x(X),[z,D]=p("checkbox"),F=_({},N,{shape:String,bindGroup:B,indeterminate:{type:Boolean,default:null}});var H=f({name:z,props:F,emits:["change","update:modelValue"],setup(a,{emit:c,slots:u}){const{parent:l}=O(C),i=e=>{const{name:d}=a,{max:r,modelValue:m}=l.props,t=m.slice();if(e)!(r&&t.length>=+r)&&!t.includes(d)&&(t.push(d),a.bindGroup&&l.updateValue(t));else{const n=t.indexOf(d);n!==-1&&(t.splice(n,1),a.bindGroup&&l.updateValue(t))}},o=$(()=>l&&a.bindGroup?l.props.modelValue.indexOf(a.name)!==-1:!!a.modelValue),s=(e=!o.value)=>{l&&a.bindGroup?i(e):c("update:modelValue",e),a.indeterminate!==null&&c("change",e)};return k(()=>a.modelValue,e=>{a.indeterminate===null&&c("change",e)}),b({toggle:s,props:a,checked:o}),g(()=>a.modelValue),()=>V(E,A({bem:D,role:"checkbox",parent:l,checked:o.value,onToggle:s},a),y(u,["default","icon"]))}});const Q=x(H);export{M as C,Q as a};
