import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{k as t}from"./vendor-primevue-DyvCA8Nd.js";import{D as n,F as r,G as i,Ht as a,I as o,K as s,Lt as c,M as l,Nt as u,Ot as d,R as f,U as p,_t as m,et as h,j as g,k as _,rt as v,tt as y,ut as b,zt as x}from"./vendor-vue-core-IZuWV8u3.js";import{D as S}from"./vendor-other-Q0G0D0d6.js";import{n as C}from"./vendor-i18n-NwyZMF0q.js";import{a as w,i as T,nt as E,rt as D}from"./vendor-reka-ui-Dfvl2gA8.js";import{t as O}from"./src-B0kocU_l.js";import{r as k}from"./widgetTypes-C7uVk06B.js";import{a as A,o as j}from"./widgetPropFilter-BW8CLrhL.js";import{t as M}from"./layout--1YiVcXi.js";import{t as N}from"./WidgetLayoutField-RcWi6XR8.js";const P=Symbol(`toggleGroupVariant`),F=S({base:`flex items-center justify-center gap-1`,variants:{variant:{default:`bg-transparent`,outline:`bg-transparent`}},defaultVariants:{variant:`default`}}),I=S({base:[`inline-flex items-center justify-center rounded`,`border-none cursor-pointer appearance-none`,`text-center font-normal`,`transition-all duration-150 ease-in-out`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed`,`data-[state=on]:bg-interface-menu-component-surface-selected data-[state=on]:text-text-primary`],variants:{variant:{default:`bg-transparent hover:bg-interface-menu-component-surface-selected/50 text-text-secondary`,outline:`border border-border-default bg-transparent hover:bg-secondary-background text-text-secondary`},size:{default:`h-7 px-3 text-sm`,sm:`h-6 px-5 py-[5px] text-xs`,lg:`h-9 px-4 text-sm`}},defaultVariants:{variant:`default`,size:`default`}});var L=f({__name:`ToggleGroup`,props:{class:{},variant:{default:`default`},rovingFocus:{type:Boolean},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},type:{},modelValue:{},defaultValue:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=E(l(e,[`class`,`variant`]),t);return y(P,u(()=>e.variant)),(t,r)=>(h(),_(c(w),s(c(n),{class:c(O)(c(F)({variant:t.variant}),e.class)}),{default:m(()=>[v(t.$slots,`default`)]),_:3},16,[`class`]))}}),R=f({__name:`ToggleGroupItem`,props:{class:{},variant:{},size:{default:`default`},value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=l(e,[`class`,`variant`,`size`]),r=p(P,d(`default`)),i=D(t),a=n(()=>e.variant??r.value??`default`);return(t,n)=>(h(),_(c(T),s(c(i),{class:c(O)(c(I)({variant:a.value,size:t.size}),`flex-1 min-w-0 truncate`,e.class)}),{default:m(()=>[v(t.$slots,`default`)]),_:3},16,[`class`]))}}),z=f({__name:`WidgetToggleSwitch`,props:i({widget:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let i=b(e,`modelValue`),l=k(),{t:u}=C(),d=n(()=>j(e.widget.options,A)),f=n(()=>e.widget.options?.on!=null||e.widget.options?.off!=null);function handleOptionChange(e){e&&(i.value=e===`on`)}return(e,n)=>(h(),_(N,{widget:e.widget},{default:m(()=>[f.value?(h(),_(c(L),{key:0,type:`single`,"model-value":i.value?`on`:`off`,disabled:!!e.widget.options?.read_only,class:x(c(O)(c(M),`w-full min-w-0 p-1 flex items-center justify-center gap-1`)),"onUpdate:modelValue":n[0]||=e=>handleOptionChange(e)},{default:m(()=>[o(c(R),{value:`off`,size:`sm`},{default:m(()=>[r(a(e.widget.options?.off??c(u)(`widgets.boolean.false`)),1)]),_:1}),o(c(R),{value:`on`,size:`sm`},{default:m(()=>[r(a(e.widget.options?.on??c(u)(`widgets.boolean.true`)),1)]),_:1})]),_:1},8,[`model-value`,`disabled`,`class`])):(h(),g(`div`,{key:1,class:x(c(O)(`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},d.value,{"aria-label":e.widget.name}),null,16,[`modelValue`,`aria-label`])],2))]),_:1},8,[`widget`]))}});export{z as default};
//# sourceMappingURL=WidgetToggleSwitch-BzkuXylw.js.map