import{_ as i}from"./BYYLVaSZ.js";import{d as r,ag as p,i as b,o as u,u as o,j as h,f as n,ah as m,ai as k,y as f,aj as v,n as _,b as x}from"./Dih1Xbo1.js";const y=["checked","disabled"],V=["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"},w=r({__name:"NCheckbox",props:{modelValue:{type:[Boolean,null],default:!1},disabled:{type:Boolean,default:!1}},setup(t,{emit:c}){const e=p(t,"modelValue",c,{passive:!0});return(a,s)=>{const d=i;return u(),b("label",{class:"n-checkbox hover:n-checkbox-hover select-none items-center n-disabled:n-disabled",checked:o(e)||null,disabled:a.disabled||null},[h(n("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>f(e)?e.value=l:null),type:"checkbox",class:"peer absolute op0",disabled:a.disabled,onKeypress:s[1]||(s[1]=k(l=>e.value=!o(e),["enter"]))},null,40,V),[[m,o(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:_([o(e)?"":"op50","n-transition"])},[x(a.$slots,"default")],2)],8,y)}}});export{w as _};
