import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{J as t}from"./vendor-primevue-CIZeDNer.js";import{D as n,F as r,G as i,Ht as a,I as o,K as s,Lt as c,R as l,_t as u,et as d,j as f,k as p,ut as m,zt as h}from"./vendor-vue-core-IZuWV8u3.js";import"./vendor-other-DOjudfJ1.js";import{n as g}from"./vendor-i18n-CpHGo1Sd.js";import"./vendor-reka-ui-NsM8zEZd.js";import{t as _}from"./src-B6n4nS3q.js";import{r as v}from"./widgetTypes-C7uVk06B.js";import{n as y,t as b}from"./toggle-group-D8sab1fo.js";import{a as x,o as S}from"./widgetPropFilter-Dy-SfJ-m.js";import{t as C}from"./layout-D00FkF_k.js";import{t as w}from"./WidgetLayoutField-BkyPHU3x.js";var T=l({__name:`WidgetToggleSwitch`,props:i({widget:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let i=m(e,`modelValue`),l=v(),{t:T}=g(),E=n(()=>S(e.widget.options,x)),D=n(()=>e.widget.options?.on!=null||e.widget.options?.off!=null);function handleOptionChange(e){e&&(i.value=e===`on`)}return(e,n)=>(d(),p(w,{widget:e.widget},{default:u(()=>[D.value?(d(),p(c(y),{key:0,type:`single`,"model-value":i.value?`on`:`off`,disabled:!!e.widget.options?.read_only,class:h(c(_)(c(C),`flex w-full min-w-0 items-center justify-center gap-1 p-1`)),"onUpdate:modelValue":n[0]||=e=>handleOptionChange(e)},{default:u(()=>[o(c(b),{value:`off`,size:`sm`},{default:u(()=>[r(a(e.widget.options?.off??c(T)(`widgets.boolean.false`)),1)]),_:1}),o(c(b),{value:`on`,size:`sm`},{default:u(()=>[r(a(e.widget.options?.on??c(T)(`widgets.boolean.true`)),1)]),_:1})]),_:1},8,[`model-value`,`disabled`,`class`])):(d(),f(`div`,{key:1,class:h(c(_)(`flex w-fit items-center gap-2`,c(l)||`ml-auto`))},[o(c(t),s({modelValue:i.value,"onUpdate:modelValue":n[1]||=e=>i.value=e},E.value,{"aria-label":e.widget.name}),null,16,[`modelValue`,`aria-label`])],2))]),_:1},8,[`widget`]))}});export{T as default};
//# sourceMappingURL=WidgetToggleSwitch-BEgtxK20.js.map