import{S,i as q,s as w,k as j,b as g,j as y,M as A,e as m,m as k,a as h,g as b,O as B,P as D,Q as E,x as I,y as L,o as M,L as N,C as O,T as P,w as Q,U,f as C,c as z,q as F}from"./index.65fb5956.js";function v(i,e,r){const a=i.slice();return a[9]=e[r],a[11]=r,a}function G(i){let e,r=i[9].name+"",a,l,o;function f(){return i[7](i[9])}return{c(){e=m("button"),a=C(r),h(e,"class","px-4 py-2 border-b-2 border-gray-200")},m(d,s){g(d,e,s),b(e,a),l||(o=z(e,"click",f),l=!0)},p(d,s){i=d},d(d){d&&y(e),l=!1,o()}}}function H(i){let e,r=i[9].name+"",a;return{c(){e=m("button"),a=C(r),h(e,"class","px-4 py-2 font-semibold border-2 border-b-0 rounded-t border-gray-200")},m(l,o){g(l,e,o),b(e,a)},p:F,d(l){l&&y(e)}}}function T(i){let e;function r(o,f){return o[9].id===o[0]?H:G}let a=r(i),l=a(i);return{c(){l.c(),e=j()},m(o,f){l.m(o,f),g(o,e,f)},p(o,f){a===(a=r(o))&&l?l.p(o,f):(l.d(1),l=a(o),l&&(l.c(),l.m(e.parentNode,e)))},d(o){l.d(o),o&&y(e)}}}function J(i){let e,r,a,l,o,f,d=i[1],s=[];for(let t=0;t<d.length;t+=1)s[t]=T(v(i,d,t));const p=i[6].default,u=A(p,i,i[5],null);return{c(){e=m("div"),r=m("div");for(let t=0;t<s.length;t+=1)s[t].c();a=k(),l=m("div"),o=k(),u&&u.c(),h(l,"class","flex-1 border-b-2 border-gray-200"),h(r,"class","flex"),h(e,"class","flex flex-col my-4")},m(t,n){g(t,e,n),b(e,r);for(let c=0;c<s.length;c+=1)s[c].m(r,null);b(r,a),b(r,l),b(e,o),u&&u.m(e,null),f=!0},p(t,[n]){if(n&11){d=t[1];let c;for(c=0;c<d.length;c+=1){const _=v(t,d,c);s[c]?s[c].p(_,n):(s[c]=T(_),s[c].c(),s[c].m(r,a))}for(;c<s.length;c+=1)s[c].d(1);s.length=d.length}u&&u.p&&(!f||n&32)&&B(u,p,t,t[5],f?E(p,t[5],n,null):D(t[5]),null)},i(t){f||(I(u,t),f=!0)},o(t){L(u,t),f=!1},d(t){t&&y(e),M(s,t),u&&u.d(t)}}}const K={};function R(i,e,r){let a,{$$slots:l={},$$scope:o}=e,{style:f=""}=e;const d=[],s=Q(!1);N(i,s,n=>r(0,a=n));const p=O();P(K,{register_tab:n=>{d.push({name:n.name,id:n.id}),s.update(c=>c||n.id)},unregister_tab:n=>{const c=d.findIndex(_=>_.id===n.id);d.splice(c,1),s.update(_=>_===n.id?d[c].id||d[d.length-1].id:_)},selected_tab:s});function u(n){U(s,a=n,a),p("change")}const t=n=>u(n.id);return i.$$set=n=>{"style"in n&&r(4,f=n.style),"$$scope"in n&&r(5,o=n.$$scope)},[a,d,s,u,f,o,l,t]}class W extends S{constructor(e){super(),q(this,e,R,J,w,{style:4})}}export{W as T,K as a};
