import{p as d,s as C,d as V,b as X,a as Y,f as q,g as A,i as D,r as F}from"./i18n-Dnhn5Rxr.js";import{aj as H,R as j,aa as J,x as c,w as a,y as K,V as k,X as z,Y as B,t as N,a as E,T as G,u as g,a5 as P,W as T,S as R,a6 as O}from"./index-DWyDLubb.js";import{G as U}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 $}from"./Index.svelte_svelte_type_style_lang-BKODC18H.js";import"./clone-BkeCM4Nl.js";import"./ScrollFade.svelte_svelte_type_style_lang-DPHOQHBm.js";import"./snippet-BWgYNF9D.js";import"./Clear-BF6j078A.js";import"./html-Ih_5QVTo.js";import"./index-B_pwUImq.js";var ee=T('<div><button class="toggle-button svelte-1uruprb" aria-label="Toggle Sidebar"><div class="chevron svelte-1uruprb"><span class="chevron-left svelte-1uruprb"></span></div></button> <div class="sidebar-content svelte-1uruprb"><!></div></div>');function te(b,t){j(t,!0);let m=d(t,"open",15,!0),e=d(t,"position",11,"left"),v=d(t,"elem_classes",19,()=>[]),_=d(t,"elem_id",3,""),w=d(t,"onexpand",3,()=>{}),x=d(t,"oncollapse",3,()=>{}),n=g(!1),s=g(!1),r,f=g(0),y=P(()=>typeof t.width=="number"?`${t.width}px`:t.width),i=g(!1);function p(){if(!r.closest(".wrap"))return;const l=r.closest(".wrap")?.getBoundingClientRect();if(!l)return;const u=r.getBoundingClientRect(),h=e()==="left"?l.left:window.innerWidth-l.right;c(f,Math.max(0,u.width-h+30),!0)}J(()=>{r.closest(".wrap")?.classList.add("sidebar-parent"),p(),window.addEventListener("resize",p),document.documentElement.style.setProperty("--overlap-amount",`${a(f)}px`),c(n,!0);const u=window.matchMedia("(prefers-reduced-motion: reduce)");c(i,u.matches,!0);const h=Q=>{c(i,Q.matches,!0)};return u.addEventListener("change",h),()=>{window.removeEventListener("resize",p),u.removeEventListener("change",h)}}),K(()=>{a(n)&&c(s,m(),!0)});let W=P(()=>v()?.join(" ")||"");var o=ee();let L;var M=k(o);M.__click=()=>{c(s,!a(s)),m(a(s)),a(s)?w()?.():x()?.()};var S=z(M,2),I=k(S);C(I,t,"default",{}),B(S),B(o),V(o,l=>r=l,()=>r),N(()=>{L=X(o,1,`sidebar ${a(W)??""}`,"svelte-1uruprb",L,{open:a(s),right:e()==="right","reduce-motion":a(i)}),Y(o,"id",_()),q(o,`width: ${a(y)??""}; ${e()??""}: calc(${a(y)??""} * -1)`)}),E(b,o),G()}H(["click"]);var se=T("<!> <!>",1);function _e(b,t){j(t,!0);const m=F(t,["$$slots","$$events","$$legacy"]),e=new U(m);var v=se(),_=R(v);Z(_,A({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status));var w=z(_,2);{var x=n=>{te(n,{get width(){return e.props.width},onexpand:()=>e.dispatch("expand"),oncollapse:()=>e.dispatch("collapse"),get elem_classes(){return e.shared.elem_classes},get elem_id(){return e.shared.elem_id},get open(){return e.props.open},set open(s){e.props.open=s},get position(){return e.props.position},set position(s){e.props.position=s},children:(s,r)=>{$(s,{children:(f,y)=>{var i=O(),p=R(i);C(p,t,"default",{}),E(f,i)},$$slots:{default:!0}})},$$slots:{default:!0}})};D(w,n=>{e.shared.visible&&n(x)})}E(b,v),G()}export{_e as default};
