import{C as i,H as r}from"./ebt3cj6n.js";import{p,U as b,W as u,ab as h,aA as m,u as a,X as n,A as k,a1 as f,a3 as v,Y as _,a0 as x}from"./vendor/json-editor-vue-kcahofzr.js";const V=["checked","disabled"],y=["disabled"],B={class:"n-checkbox-box n-checked:n-checkbox-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base n-transition"},A=p({__name:"NCheckbox",props:{modelValue:{type:[Boolean,null],default:!1},disabled:{type:Boolean,default:!1}},setup(t,{emit:c}){const e=i(t,"modelValue",c,{passive:!0});return(o,s)=>{const d=r;return b(),u("label",{class:"n-checkbox hover:n-checkbox-hover select-none items-center n-disabled:n-disabled",checked:a(e)||null,disabled:o.disabled||null},[h(n("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>k(e)?e.value=l:null),type:"checkbox",class:"peer absolute op0",disabled:o.disabled,onKeypress:s[1]||(s[1]=f(l=>e.value=!a(e),["enter"]))},null,40,y),[[m,a(e)]]),n("span",B,[v(d,{class:"n-checkbox-icon scale-0 transform op0 n-transition n-checked:scale-100 n-checked:op100"})]),n("span",{class:x([a(e)?"":"op50","n-transition"])},[_(o.$slots,"default")],2)],8,V)}}});export{A as _};
