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