import{u as k}from"./_plugin-vue_export-helper.BLXtEB-G.js";import{s as _,b as g}from"./Phone.C3KaOZCO.js";import A from"./check-7UA4j2f2.DGBFBPNu.js";import{e as B,f as o,o as C,c as $,a as i,A as N,u as t,B as S,aa as m,m as w,C as D,t as I,j as K}from"./runtime-core.esm-bundler.DMBo7TXk.js";import"./links.C572zDFG.js";import"./default-i18n.Bd0Z306Z.js";import"./helpers.D5tYIqKS.js";import"./preload-helper.M0ZNWaht.js";const L=["for","aria-checked"],M=["id","checked","disabled","name"],P=B({inheritAttrs:!1,__name:"MazCheckbox",props:{style:{default:void 0},class:{default:void 0},modelValue:{type:[Boolean,Array],default:void 0},id:{default:void 0},color:{default:"primary"},value:{type:[String,Number,Boolean],default:void 0},name:{default:"m-checkbox"},size:{default:"md"},label:{default:void 0},disabled:{type:Boolean,default:!1}},emits:["update:model-value","change"],setup(p,{emit:f}){k(a=>({"30ad0e00":y.value,"46bd1cbc":v.value,"7c7c6907":x.value,"47a52c6c":h.value}));const e=p,r=f,n=g({componentName:"MazCheckbox",providedId:e.id}),s=o(()=>typeof e.value!="boolean"&&Array.isArray(e.modelValue)?e.modelValue.includes(e.value):typeof e.modelValue=="boolean"?e.modelValue:!1),v=o(()=>{switch(e.size){case"xl":return"2.25rem";case"lg":return"2rem";case"sm":return"1.425rem";case"xs":return"1.325rem";case"mini":return"1.2rem";default:return"1.625rem"}}),b=o(()=>{switch(e.size){case"xl":return"maz-text-2xl";case"lg":return"maz-text-xl";case"sm":return"maz-text-base";case"xs":return"maz-text-sm";case"mini":return"maz-text-xs";default:return"maz-text-lg"}}),y=o(()=>`var(--maz-color-${e.color}-contrast)`),x=o(()=>`var(--maz-color-${e.color})`),h=o(()=>["black","transparent"].includes(e.color)?"var(--maz-color-muted)":`var(--maz-color-${e.color}-alpha)`);function V(a){["Space"].includes(a.code)&&(a.preventDefault(),u(e.value??!e.modelValue))}function z(a){return typeof a=="boolean"&&(typeof e.modelValue=="boolean"||e.modelValue===void 0||e.modelValue===null)?!e.modelValue:Array.isArray(e.modelValue)&&typeof a!="boolean"?e.modelValue.includes(a)?e.modelValue.filter(l=>l!==a):[...e.modelValue,a]:[a]}function u(a){const l=z(a);r("update:model-value",l),r("change",l)}return(a,l)=>(C(),$("label",{for:t(n),class:m(["m-checkbox",[{"--disabled":a.disabled},e.class]]),tabindex:"0",style:K(a.style),role:"checkbox","aria-checked":s.value,onKeydown:V},[i("input",N({id:t(n),checked:s.value},a.$attrs,{tabindex:"-1",disabled:a.disabled,name:a.name,type:"checkbox",onChange:l[0]||(l[0]=c=>{var d;return u(a.value??((d=c==null?void 0:c.target)==null?void 0:d.checked))})}),null,16,M),i("span",null,[S(t(A),{class:m(["check-icon",b.value])},null,8,["class"])]),w(a.$slots,"default",{},()=>[D(I(a.label),1)],!0)],46,L))}}),G=_(P,[["__scopeId","data-v-85c875a9"]]);export{G as default};
