/* Copyright © 2024 Melbet - All Rights Reserved */ import{ref as d,unref as n,defineComponent as m,toRefs as i,computed as h,openBlock as f,createElementBlock as I,normalizeClass as v,renderSlot as w,createElementVNode as F,mergeProps as g}from"../../../../shared-assets/__shared_vue_deps_SRT2KB67.js";import{e as y}from"./78DyX9qOAGj0.js";import{u as k}from"./6GmRYzzFuB0k.js";import{defaultThemeType as S,t as B}from"./entry-Bl6dkD65.js";const C=({checked:t})=>{const e=d(!1),s=y(k);return{focus:e,setInputFocus:()=>{e.value=!0},unsetInputFocus:()=>{e.value=!1},onInput:()=>s(!n(t))}};var _=m({name:"UiSwitch_F",props:{inputType:{type:String,default:"radio"},inputName:{type:String,default:void 0},inputValue:{type:[String,Number],default:void 0},checked:{type:Boolean,default:!1},weight:{type:String,default:""},theme:{type:String,default:S}},setup(t){const{checked:e,weight:s,theme:o}=i(t),{focus:c,setInputFocus:p,unsetInputFocus:u,onInput:a}=C(i(t)),r={onChange:l=>l.stopPropagation()};return{setInputFocus:p,unsetInputFocus:u,switchClasses:h(()=>({"ui-switch--is-active":n(e),"ui-switch--is-focused":n(c),[`ui-switch--theme-${n(o)}`]:!!n(o),[`ui-switch--weight-${n(s)}`]:!!n(s)})),onInput:a,vueAttrs:r}}});const N=["type","name","value","checked"];var A=B(_,[["render",function(t,e,s,o,c,p){return f(),I("label",{class:v([t.switchClasses,"ui-switch"])},[w(t.$slots,"default",{},void 0,!0),F("input",g({onClick:e[0]||(e[0]=(...u)=>t.onInput&&t.onInput(...u)),onFocus:e[1]||(e[1]=(...u)=>t.setInputFocus&&t.setInputFocus(...u)),onBlur:e[2]||(e[2]=(...u)=>t.unsetInputFocus&&t.unsetInputFocus(...u))},t.vueAttrs,{type:t.inputType,name:t.inputName,value:t.inputValue,checked:t.checked,class:"ui-switch__input"}),null,16,N)],2)}],["__scopeId","data-v-0bfc02c1"]]);export{A as l};