import{_ as v,u as b,a as r,H as C,S as k}from"./StreamlitVue.BzF8oK6q.js";import{D as T}from"./DsfrButton.DpDkSSeL.js";/* empty css                                       */import{d as g,r as y,e as E,f as B,o as d,c as m,a as f,w as h,m as _,h as D,F as S,i as x,b as V}from"./runtime-dom.esm-bundler.CZSh2bQH.js";/* empty css                               *//* empty css                                */const w=g({__name:"DsfrButtonGroup",props:{args:{},width:{},disabled:{type:Boolean},theme:{}},setup(l,{expose:i}){i(),b();const t=l,e=y(Array(t.args.buttons?.length??0).fill(!1));let n,o;function s(a){e.value.some(c=>c)&&(e.value=Array(t.args.buttons?.length??0).fill(!1),r.setComponentValue([...e.value]))}E(()=>{r.events.addEventListener(r.RENDER_EVENT,s)}),B(()=>{r.events.removeEventListener(r.RENDER_EVENT,s)});async function u(a){e.value.some(c=>c)&&(e.value=Array(t.args.buttons?.length??0).fill(!1),r.setComponentValue([...e.value]),await new Promise(c=>setTimeout(c,50))),e.value[a]=!0,r.setComponentValue([...e.value]),n&&clearTimeout(n),o&&clearTimeout(o),o=-1,n=setTimeout(()=>{e.value=Array(t.args.buttons?.length??0).fill(!1),r.setComponentValue([...e.value]),o=setTimeout(()=>{o=void 0},50),n=void 0},50)}const p={props:t,clicked:e,get toggleOffTimeout(){return n},set toggleOffTimeout(a){n=a},get lockTimeout(){return o},set lockTimeout(a){o=a},onRenderEvent:s,onClickIndex:u,get DsfrButtonGroup(){return C},DsfrButton:T};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}});function G(l,i,t,e,n,o){return d(),m("div",{class:"component",style:D(l.style)},[f(e.DsfrButtonGroup,_(e.props.args,{buttons:void 0,disabled:e.props.disabled}),{default:h(()=>[(d(!0),m(S,null,x(e.props.args.buttons||[],(s,u)=>(d(),m("li",{key:u},[f(e.DsfrButton,_(s,{disabled:e.clicked[u]||e.props.disabled||s.disabled,onClick:()=>e.onClickIndex(u)}),null,16,["disabled","onClick"])]))),128))]),_:1},16,["disabled"])],4)}const N=v(w,[["render",G],["__scopeId","data-v-d88c1344"]]),O=g({__name:"DsfrButtonGroup",setup(l,{expose:i}){i();const t={StreamlitComponent:k,Component:N};return Object.defineProperty(t,"__isScriptSetup",{enumerable:!1,value:!0}),t}});function R(l,i,t,e,n,o){return d(),V(e.StreamlitComponent,{component:e.Component,"client:load":""})}const H=v(O,[["render",R]]);export{H as default};
