import { h as head } from './index2-BuOY2QE4.js';
import { p as page, g as goto } from './index3-DeV2OWZf.js';
import { g as getAgentsContext } from './agents-context-BrlIlkOW.js';
import './trpc-client-Bucti7HD.js';
import { A as AgentSidebar } from './AgentSidebar-BB_yQ9s0.js';
import { T as Tabs, a as Tab } from './Tab-ClYAMM-e.js';
import './context-zH5kvtGY.js';
import './state.svelte-DtOGaiYC.js';
import './utils-KcIDVAAe.js';
import './index-DxaLoiKh.js';
import '@trpc/client';
import './Icon-BgknHaZs.js';
import './index-server-CefdgakO.js';

function _page($$renderer, $$props) {
  $$renderer.component(($$renderer2) => {
    const { onAgentSelect, onError } = getAgentsContext();
    let agents = [];
    const activeTopTab = (() => page.url.pathname.split("/")[1])();
    function handleTopTabChange({ value }) {
      if (value === activeTopTab) return;
      if (value === "edit") return goto();
      if (value === "view") return goto();
      goto();
    }
    function handleAgentClick(agentId) {
      onAgentSelect(agentId);
    }
    head($$renderer2, ($$renderer3) => {
      $$renderer3.title(($$renderer4) => {
        $$renderer4.push(`<title>Bosun: Edit</title>`);
      });
    });
    $$renderer2.push(`<div class="flex h-screen">`);
    AgentSidebar($$renderer2, {
      className: "flex-none",
      agents,
      currentAgent: "",
      onAgentClick: handleAgentClick
    });
    $$renderer2.push(`<!----> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 pb-3 pr-4 pt-2"><nav class="flex flex-none items-center justify-center bg-rc-gray-980">`);
    Tabs($$renderer2, {
      value: activeTopTab,
      ariaLabel: "Top tabs",
      onChange: handleTopTabChange,
      children: ($$renderer3) => {
        Tab($$renderer3, {
          value: "edit",
          children: ($$renderer4) => {
            $$renderer4.push(`<!---->Edit`);
          }
        });
        $$renderer3.push(`<!----> `);
        Tab($$renderer3, {
          value: "view",
          children: ($$renderer4) => {
            $$renderer4.push(`<!---->View`);
          }
        });
        $$renderer3.push(`<!---->`);
      },
      $$slots: { default: true }
    });
    $$renderer2.push(`<!----></nav> <main class="flex-1 pr-80 pt-40"><div class="flex h-full items-start justify-center text-rc-gray-200">Select an agent on the left panel to start editing</div></main></div></div>`);
  });
}

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