import{C as S,D as c,f as w,E as g,i as m,N as B,O as V,o as n,c as s,a as u,L as q,au as $,K as A,x as t,H as N,d as I,t as b,k as d}from"./entry.2xM5grDS.js";import{u as O}from"./selectMenu.72ERhOvP.js";import{u as j}from"./useFormGroup.ppIt-kam.js";import{_ as D}from"./_plugin-vue_export-helper.x3n3nnut.js";import"./uid.KLLbMoZc.js";import"./index.OjlVAl1H.js";const E={wrapper:"relative flex items-start",container:"flex items-center h-5",base:"h-4 w-4 dark:checked:bg-current dark:checked:border-transparent dark:indeterminate:bg-current dark:indeterminate:border-transparent disabled:opacity-50 disabled:cursor-not-allowed focus:ring-0 focus:ring-transparent focus:ring-offset-transparent",form:"form-checkbox",rounded:"rounded",color:"text-{color}-500 dark:text-{color}-400",background:"bg-white dark:bg-gray-900",border:"border border-gray-300 dark:border-gray-700",ring:"focus-visible:ring-2 focus-visible:ring-{color}-500 dark:focus-visible:ring-{color}-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900",inner:"ms-3 flex flex-col",label:"text-sm font-medium text-gray-700 dark:text-gray-200",required:"text-sm text-red-500 dark:text-red-400",help:"text-sm text-gray-500 dark:text-gray-400",default:{color:"primary"}},k=S(c.ui.strategy,c.ui.checkbox,E),F=w({inheritAttrs:!1,props:{id:{type:String,default:()=>null},value:{type:[String,Number,Boolean,Object],default:null},modelValue:{type:[Boolean,Array],default:null},name:{type:String,default:null},disabled:{type:Boolean,default:!1},checked:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},help:{type:String,default:null},label:{type:String,default:null},required:{type:Boolean,default:!1},color:{type:String,default:()=>k.default.color,validator(e){return c.ui.colors.includes(e)}},inputClass:{type:String,default:""},class:{type:[String,Object,Array],default:()=>""},ui:{type:Object,default:()=>({})}},emits:["update:modelValue","change"],setup(e,{emit:a}){const{ui:r,attrs:f}=O("checkbox",g(e,"ui"),k,g(e,"class")),{emitFormChange:p,color:l,name:o,inputId:y}=j(e),h=m({get(){return e.modelValue},set(i){a("update:modelValue",i)}}),v=i=>{a("change",i),p()},C=m(()=>B(V(r.value.base,r.value.form,r.value.rounded,r.value.background,r.value.border,l.value&&r.value.ring.replaceAll("{color}",l.value),l.value&&r.value.color.replaceAll("{color}",l.value)),e.inputClass));return{ui:r,attrs:f,toggle:h,inputId:y,name:o,inputClass:C,onChange:v}}}),M=["id","name","required","value","disabled","checked","indeterminate"],U=["for"];function z(e,a,r,f,p,l){return n(),s("div",{class:t(e.ui.wrapper)},[u("div",{class:t(e.ui.container)},[q(u("input",A({id:e.inputId,"onUpdate:modelValue":a[0]||(a[0]=o=>e.toggle=o),name:e.name,required:e.required,value:e.value,disabled:e.disabled,checked:e.checked,indeterminate:e.indeterminate,type:"checkbox",class:e.inputClass},e.attrs,{onChange:a[1]||(a[1]=(...o)=>e.onChange&&e.onChange(...o))}),null,16,M),[[$,e.toggle]])],2),e.label||e.$slots.label?(n(),s("div",{key:0,class:t(e.ui.inner)},[u("label",{for:e.inputId,class:t(e.ui.label)},[N(e.$slots,"label",{},()=>[I(b(e.label),1)]),e.required?(n(),s("span",{key:0,class:t(e.ui.required)},"*",2)):d("",!0)],10,U),e.help?(n(),s("p",{key:0,class:t(e.ui.help)},b(e.help),3)):d("",!0)],2)):d("",!0)],2)}const R=D(F,[["render",z]]);export{R as default};
