import{f as t,a as e,c as y}from"../chunks/vfPE-AD7.js";import{i as D}from"../chunks/1jpszzm8.js";import{p as E,o as G,c as H,e as g,f as x,i as v,n as $,r as m,t as J,g as K}from"../chunks/DhUiKsxN.js";import{s as O}from"../chunks/Dsv8gxIT.js";import{i as P}from"../chunks/DUil1G3I.js";import{e as Q}from"../chunks/QNXDtpsh.js";import{s as b}from"../chunks/SjYvl9yQ.js";import{p as i}from"../chunks/DEcqogKB.js";import"../chunks/CwpRVHMW.js";import{P as C,a as R}from"../chunks/D0aYus9O.js";import{B as S,C as T}from"../chunks/BWzyK28a.js";var U=t("<!> New Profile",1),V=t('<div class="text-center py-12 text-muted-foreground">Loading profiles...</div>'),W=t('<div class="text-center py-12 text-red-500"> </div>'),X=t("<!> Create Your First Profile",1),Z=t('<p class="text-muted-foreground mb-4">No profiles configured yet.</p> <!>',1),rr=t('<div class="space-y-4"></div>'),er=t('<div class="space-y-6"><div class="flex items-center justify-between"><h1 class="text-2xl font-bold">Server Profiles</h1> <!></div> <!></div>');function cr(B,I){E(I,!1),G(()=>{i.refresh(),b.refresh();const r=setInterval(()=>b.refresh(),5e3);return()=>clearInterval(r)}),D();var c=er(),_=g(c),N=x(g(_),2);S(N,{href:"/profiles/new",children:(r,l)=>{var n=U(),u=v(n);C(u,{class:"w-4 h-4 mr-2"}),$(),e(r,n)},$$slots:{default:!0}}),m(_);var j=x(_,2);{var k=r=>{var l=V();e(r,l)},F=r=>{var l=y(),n=v(l);{var u=a=>{var o=W(),h=g(o,!0);m(o),J(()=>O(h,i.error)),e(a,o)},L=a=>{var o=y(),h=v(o);{var M=s=>{T(s,{class:"p-12 text-center",children:(f,d)=>{var p=Z(),q=x(v(p),2);S(q,{href:"/profiles/new",children:(z,tr)=>{var w=X(),A=v(w);C(A,{class:"w-4 h-4 mr-2"}),$(),e(z,w)},$$slots:{default:!0}}),e(f,p)},$$slots:{default:!0}})},Y=s=>{var f=rr();Q(f,5,()=>i.profiles,d=>d.id,(d,p)=>{R(d,{get profile(){return K(p)}})}),m(f),e(s,f)};P(h,s=>{i.profiles.length===0?s(M):s(Y,!1)},!0)}e(a,o)};P(n,a=>{i.error?a(u):a(L,!1)},!0)}e(r,l)};P(j,r=>{i.loading?r(k):r(F,!1)})}m(c),e(B,c),H()}export{cr as component};
