"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),g=require("lodash-unified");require("../hooks/index.js");const m=require("./context.js"),y=require("../hooks/useControllableValue.js"),b=i.defineComponent({name:"CheckCardGroup",__name:"group",props:{bordered:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},size:{default:void 0},stopPropagation:{type:[Boolean,Function],default:void 0},indicatorSize:{default:void 0},style:{default:void 0},multiple:{type:Boolean,default:!1},defaultValue:{type:[String,Number,Boolean,Array],default:void 0},value:{type:[String,Number,Boolean,Array],default:void 0},"onUpdate:value":{}},emits:["update:value"],setup(u,{emit:d}){const t=u,s=d,{value:a,updateValue:n}=y.useControllableValue(t,s),r=new Map;function p(e){if(!t.multiple){if(i.unref(a)===e)return;n(e);return}let o=[...i.unref(a)||[]];const v=o.find(l=>l===e);g.isUndefined(v)?o.push(e):o=o.filter(l=>l!==e).filter(l=>r.has(l)),n(o)}function f(e){r.set(e,!0)}function c(e){r.delete(e)}return m.useProvideCheckCard(i.computed(()=>({toggleOption:p,registerValue:f,cancelValue:c,disabled:t.disabled,size:t.size,bordered:t.bordered,loading:t.loading,value:i.unref(a),multiple:t.multiple,stopPropagation:t.stopPropagation,style:t.style,indicatorSize:t.indicatorSize}))),(e,o)=>i.renderSlot(e.$slots,"default")}});exports.default=b;
