import{a as $,c as F,f as K,e as M}from"../chunks/3MMtouT7.js";import{p as U,F as V,q as z,t as G,v as H,b as m,c as a,d as i,g as l,r as s,A as w,s as J,w as _}from"../chunks/Ce0VRwE1.js";import{P as Q,B as X,a as Y,c as h,s as y}from"../chunks/BTu-2gkj.js";import{g as Z}from"../chunks/Bkcn25gz.js";import{p as tt}from"../chunks/D347PuJK.js";import{B as et}from"../chunks/Bn-6X1BO.js";import{S as at}from"../chunks/CG453M9q.js";import{T as st}from"../chunks/CSjf4fBs.js";const rt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
  <rect x="3" y="3" width="7" height="7"/>
  <rect x="14" y="3" width="7" height="7"/>
  <rect x="3" y="14" width="7" height="7"/>
  <rect x="14" y="14" width="7" height="7"/>
</svg>
`;var nt=K('<div class="app"><header class="header"><div class="header-content"><a href="/" class="logo"><img src="/app-icon.png" alt="Shooter" class="logo-icon" width="24" height="24"/> <span class="logo-text">Shooter</span></a> <div class="nav-right svelte-12qhfyh"><!> <!></div></div></header> <div class="content-area svelte-12qhfyh"><!></div> <nav class="bottom-tabs svelte-12qhfyh"><div class="bottom-tabs-inner svelte-12qhfyh"><a href="/"><!> <span>Dashboard</span></a> <a href="/activity"><!> <span>Activity</span></a> <a href="/terminals"><!> <span>Terminals</span></a></div></nav></div>');function gt(D,r){U(r,!0);const n=()=>M(tt,"$page",O),[O,W]=F();V(()=>{if(r.data?.aiProviders&&(window.__aiProviders=r.data.aiProviders,r.data.neurolinkProvider)){const t=window.process;t?.env&&(t.env.NEUROLINK_PROVIDER=r.data.neurolinkProvider)}});let o=J("unknown");const j={degraded:"Degraded",error:"Offline",healthy:"Online",unknown:"Checking"},L={degraded:"pill-status-degraded",error:"pill-status-offline",healthy:"pill-status-online",unknown:"pill-status-unknown"};z(()=>{k();const t=setInterval(()=>{k()},3e4);return()=>{clearInterval(t)}});async function k(){try{const t=await fetch("/api/health");if(!t.ok){m(o,"error");return}const e=await t.json();m(o,e.status==="healthy"||e.status==="degraded"||e.status==="error"?e.status:"unknown",!0)}catch{m(o,"error")}}var d=nt(),u=a(d),b=a(u),S=i(a(b),2),x=a(S);{let t=_(()=>j[l(o)]||"Checking"),e=_(()=>L[l(o)]||"pill-status-unknown");Q(x,{get text(){return l(t)},get classes(){return l(e)}})}var R=i(x,2);{const t=f=>{h(f,{get svg(){return at},classes:"icon-18"})};let e=_(()=>n().url.pathname==="/config"?"btn-gear-active":"");X(R,{get classes(){return`btn-gear ${l(e)??""}`},onclick:()=>{Z("/config")},ariaLabel:"Settings",icon:t,$$slots:{icon:!0}})}s(S),s(b),s(u);var g=i(u,2),T=a(g);Y(T,()=>r.children),s(g);var q=i(g,2),P=a(q),c=a(P);let B;var A=a(c);h(A,{get svg(){return rt},classes:"icon-26"}),w(2),s(c);var v=i(c,2);let I;var E=a(v);h(E,{get svg(){return et},classes:"icon-26"}),w(2),s(v);var p=i(v,2);let C;var N=a(p);h(N,{get svg(){return st},classes:"icon-26"}),w(2),s(p),s(P),s(q),s(d),G((t,e,f)=>{B=y(c,1,"tab-item svelte-12qhfyh",null,B,t),I=y(v,1,"tab-item svelte-12qhfyh",null,I,e),C=y(p,1,"tab-item svelte-12qhfyh",null,C,f)},[()=>({active:n().url.pathname==="/"||n().url.pathname.startsWith("/project")||n().url.pathname.startsWith("/session")}),()=>({active:n().url.pathname.startsWith("/activity")}),()=>({active:n().url.pathname.startsWith("/terminals")})]),$(D,d),H(),W()}export{gt as component};
