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