import { m as head, n as ensure_array_like } from './index-Cnl871UW.js';
import { g as goto } from './client2-BjxIYuno.js';
import { E as EmptyState } from './EmptyState-Ci4pSpmY.js';
import { I as Icon } from './Icon-DyrkHVnV.js';
import './markdown-W_mTBct0.js';
import { o as onDestroy } from './index-server-CUC9Jt7r.js';
import { B as Button } from './Button-C7D5W6wV.js';
import { S as Shimmer } from './Shimmer-BITK6wrm.js';
import './root-DhswcH6o.js';
import './index2-HA3VTH7y.js';
import './state.svelte-2Lellg7t.js';
import 'dompurify';
import 'marked';

function _page($$renderer, $$props) {
  $$renderer.component(($$renderer2) => {
    const CACHE_KEY = "shooter_terminals";
    let terminals = [];
    let loading = false;
    onDestroy(() => {
    });
    async function fetchTerminals() {
      {
        return;
      }
    }
    async function forceRefresh() {
      loading = true;
      sessionStorage.removeItem(CACHE_KEY);
      await fetchTerminals();
    }
    function navigateToConfig() {
      void goto();
    }
    function handleNewTerminal() {
    }
    head("1ewpmn2", $$renderer2, ($$renderer3) => {
      $$renderer3.title(($$renderer4) => {
        $$renderer4.push(`<title>Terminals - Shooter</title>`);
      });
      $$renderer3.push(`<meta name="description" content="Active terminal sessions on this machine" class="svelte-1ewpmn2"/>`);
    });
    $$renderer2.push(`<main class="main svelte-1ewpmn2"><div class="page-header svelte-1ewpmn2"><div class="page-header-content svelte-1ewpmn2"><div class="svelte-1ewpmn2"><h1 class="page-title svelte-1ewpmn2">Terminals</h1> <p class="page-description svelte-1ewpmn2">Active terminal sessions on this machine</p></div> <div class="page-actions svelte-1ewpmn2">`);
    Button($$renderer2, {
      classes: "btn-secondary",
      onclick: forceRefresh,
      disabled: loading,
      children: ($$renderer3) => {
        Icon($$renderer3, { name: "refresh", size: 14 });
        $$renderer3.push(`<!----> Refresh`);
      },
      $$slots: { default: true }
    });
    $$renderer2.push(`<!----> `);
    Button($$renderer2, {
      classes: "btn-primary",
      onclick: handleNewTerminal,
      children: ($$renderer3) => {
        $$renderer3.push(`<span class="plus-icon svelte-1ewpmn2">+</span> New Terminal`);
      },
      $$slots: { default: true }
    });
    $$renderer2.push(`<!----></div></div></div> `);
    if (loading && terminals.length === 0) {
      $$renderer2.push("<!--[0-->");
      $$renderer2.push(`<div class="loading-container svelte-1ewpmn2"><!--[-->`);
      const each_array = ensure_array_like(Array(4));
      for (let i = 0, $$length = each_array.length; i < $$length; i++) {
        each_array[i];
        Shimmer($$renderer2, { classes: "shimmer-card" });
      }
      $$renderer2.push(`<!--]--></div>`);
    } else {
      $$renderer2.push("<!--[1-->");
      EmptyState($$renderer2, {
        icon: "settings",
        title: "Configuration Required",
        description: "Set up your API credentials to view terminal sessions",
        children: ($$renderer3) => {
          Button($$renderer3, {
            classes: "btn-primary",
            onclick: navigateToConfig,
            text: "Configure Settings"
          });
        }
      });
    }
    $$renderer2.push(`<!--]--></main> `);
    {
      $$renderer2.push("<!--[-1-->");
    }
    $$renderer2.push(`<!--]-->`);
  });
}

export { _page as default };
//# sourceMappingURL=_page.svelte-CFCONiDK.js.map
