import{u as _}from"./runtime-dom.esm-bundler.dc49ee3e.js";import{s as k,b as g}from"./Phone.1d5b5eb1.js";import A from"./check-7UA4j2f2.2c97fe8e.js";import{x as $,W as o,o as B,c as C,_ as i,ad as N,R as t,l as S,ae as m,a3 as w,a7 as D,$ as I,a0 as K}from"./runtime-core.esm-bundler.ce5add0b.js";import"./datetime.f197aeae.js";import"./preload-helper.5f06849a.js";import"./translations.e71e2202.js";import"./default-i18n.65d58dd6.js";import"./_plugin-vue_export-helper.eefbdd86.js";const L=["for","aria-checked"],M=["id","checked","disabled","name"],P=$({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}){_(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)=>(B(),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=k(P,[["__scopeId","data-v-85c875a9"]]);export{G as default};
