import{A as g,E as C,H as t,d as h,a_ as f,a1 as k,j as i,aS as w,N as b}from"./index.3bfa6a0e.js";const[S,l]=g("switch"),y={size:C,loading:Boolean,disabled:Boolean,modelValue:t,activeColor:String,inactiveColor:String,activeValue:{type:t,default:!0},inactiveValue:{type:t,default:!1}};var x=h({name:S,props:y,emits:["change","update:modelValue"],setup(e,{emit:c}){const o=()=>e.modelValue===e.activeValue,s=()=>{if(!e.disabled&&!e.loading){const a=o()?e.inactiveValue:e.activeValue;c("update:modelValue",a),c("change",a)}},u=()=>{if(e.loading){const a=o()?e.activeColor:e.inactiveColor;return i(w,{class:l("loading"),color:a},null)}};return f(()=>e.modelValue),()=>{const{size:a,loading:r,disabled:d,activeColor:v,inactiveColor:m}=e,n=o(),V={fontSize:k(a),backgroundColor:n?v:m};return i("div",{role:"switch",class:l({on:n,loading:r,disabled:d}),style:V,tabindex:d?void 0:0,"aria-checked":n,onClick:s},[i("div",{class:l("node")},[u()])])}}});const N=b(x);export{N as S};
