import{p as x,s as $,b as A,f as y,i as j,r as C,g as I}from"./i18n-Dnhn5Rxr.js";import{R as q,S as f,t as R,a as h,T as w,X as g,V as _,W as G,aj as T,a0 as V,Y as v,a6 as W,w as k,a5 as B}from"./index-DWyDLubb.js";import{B as X}from"./Block-J4oodUWp.js";import"./ScrollFade.svelte_svelte_type_style_lang-DPHOQHBm.js";import{G as Y}from"./utils.svelte-CCyS_0CY.js";import{S as z}from"./index-CglBvmLb.js";import"./StreamingBar.svelte_svelte_type_style_lang-Y9omZ2gK.js";import{B as D}from"./Index.svelte_svelte_type_style_lang-BKODC18H.js";import"./snippet-BWgYNF9D.js";import"./clone-BkeCM4Nl.js";import"./Clear-BF6j078A.js";import"./html-Ih_5QVTo.js";import"./index-B_pwUImq.js";var E=G('<button><span class="svelte-e5lyqv"> </span> <span class="icon svelte-e5lyqv">▼</span></button> <div data-testid="accordion-content"><!></div>',1);function F(u,t){q(t,!0);let s=x(t,"open",15,!0),m=x(t,"label",3,"");var e=E(),a=f(e);a.__click=()=>{s(!s()),s()?t.onexpand?.():t.oncollapse?.()};let d;var o=_(a),r=_(o,!0);v(o);var p=g(o,2);let i;v(a);var n=g(a,2);let c;var l=_(n);$(l,t,"default",{}),v(n),R(()=>{d=A(a,1,"label-wrap svelte-e5lyqv",null,d,{open:s()}),V(r,m()),i=y(p,"",i,{transform:s()?"rotate(0)":"rotate(90deg)"}),c=y(n,"",c,{display:s()?"block":"none"})}),h(u,e),w()}T(["click"]);var H=G("<!> <!>",1);function oe(u,t){q(t,!0);let s=C(t,["$$slots","$$events","$$legacy"]);class m extends Y{set_data(r){"open"in r&&r.open!==this.props.open&&(r.open?(this.dispatch("expand"),this.dispatch("gradio_expand")):this.dispatch("collapse")),super.set_data(r),this.shared.loading_status.status="complete"}}const e=new m(s);let a=B(()=>e.shared.label||""),d=B(()=>e.shared.visible===!0?!0:"hidden");X(u,{get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get visible(){return k(d)},children:(o,r)=>{var p=H(),i=f(p);{var n=l=>{z(l,I({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status))};j(i,l=>{e.shared.loading_status&&l(n)})}var c=g(i,2);F(c,{get label(){return k(a)},get open(){return e.props.open},onexpand:()=>{e.dispatch("expand"),e.dispatch("gradio_expand")},oncollapse:()=>e.dispatch("collapse"),children:(l,J)=>{D(l,{children:(P,K)=>{var b=W(),S=f(b);$(S,t,"default",{}),h(P,b)},$$slots:{default:!0}})},$$slots:{default:!0}}),h(o,p)},$$slots:{default:!0}}),w()}export{oe as default};
