meshy-node 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dashboard/assets/DashboardPage-BSAt8kN_.js +129 -0
- package/dashboard/assets/{DashboardShared-D0YdYzol.js → DashboardShared-DMrNrARk.js} +1 -1
- package/dashboard/assets/{DiffTab-CHipGLdS.js → DiffTab-CPgg5BgU.js} +1 -1
- package/dashboard/assets/{FilesTab-BoZkVvyw.js → FilesTab-Bd6A8nUE.js} +1 -1
- package/dashboard/assets/{PreviewTab-DelBRthN.js → PreviewTab-kljCXeWP.js} +1 -1
- package/dashboard/assets/{SharedConversationPage-Braz3WkI.js → SharedConversationPage-DmcJdyZj.js} +3 -3
- package/dashboard/assets/{file-BTBfmF3y.js → file-CPaJOnu-.js} +1 -1
- package/dashboard/assets/{folder-CV_Sf612.js → folder-DgOi0nrN.js} +1 -1
- package/dashboard/assets/{index-CZEzLKKD.js → index-nG4cAWuh.js} +2 -2
- package/dashboard/assets/{play-iLsMcgDx.js → play-DQGsm6yq.js} +1 -1
- package/dashboard/index.html +1 -1
- package/main.cjs +10241 -10585
- package/package.json +1 -1
- package/runtime-metadata.json +5 -5
- package/dashboard/assets/DashboardPage-CT2ZnUEE.js +0 -129
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Ze,ba as Dt,j as y,r as re,bb as Ar,bc as Pr,bd as zr,J as rn,B as Me,i as jr,b as Te}from"./index-
|
|
1
|
+
import{c as Ze,ba as Dt,j as y,r as re,bb as Ar,bc as Pr,bd as zr,J as rn,B as Me,i as jr,b as Te}from"./index-nG4cAWuh.js";import{F as Lr}from"./folder-DgOi0nrN.js";import{F as Fr}from"./file-CPaJOnu-.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as O,j as e,I as W,B as u,be as T,ag as B,r as a,bf as X,bd as Y,x as Z,y as ee,z as se,bg as re,J as _}from"./index-
|
|
1
|
+
import{c as O,j as e,I as W,B as u,be as T,ag as B,r as a,bf as X,bd as Y,x as Z,y as ee,z as se,bg as re,J as _}from"./index-nG4cAWuh.js";import{P as te}from"./play-DQGsm6yq.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/dashboard/assets/{SharedConversationPage-Braz3WkI.js → SharedConversationPage-DmcJdyZj.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilesTab-
|
|
2
|
-
import{c as N,aI as k,r as s,j as e,K as S,P as T,N as C,a4 as P,b3 as M,b4 as _,b5 as j,b6 as E,b7 as I,$ as w,b8 as L}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilesTab-Bd6A8nUE.js","assets/index-nG4cAWuh.js","assets/index-DgDWjVGo.css","assets/folder-DgOi0nrN.js","assets/file-CPaJOnu-.js","assets/PreviewTab-kljCXeWP.js","assets/play-DQGsm6yq.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as N,aI as k,r as s,j as e,K as S,P as T,N as C,a4 as P,b3 as M,b4 as _,b5 as j,b6 as E,b7 as I,$ as w,b8 as L}from"./index-nG4cAWuh.js";import{n as A,j as O,i as F,L as R,C as z,T as v,m as D}from"./DashboardShared-DMrNrARk.js";/**
|
|
3
3
|
* @license lucide-react v1.7.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const V=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],q=N("message-square-text",V),B=s.lazy(async()=>({default:(await w(()=>import("./FilesTab-
|
|
7
|
+
*/const V=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],q=N("message-square-text",V),B=s.lazy(async()=>({default:(await w(()=>import("./FilesTab-Bd6A8nUE.js"),__vite__mapDeps([0,1,2,3,4]))).FilesTab})),G=s.lazy(async()=>({default:(await w(()=>import("./PreviewTab-kljCXeWP.js"),__vite__mapDeps([5,1,2,6]))).PreviewTab})),H={getOutput:j,getOutputTree:_,getOutputContent:M},U={getOutput:j,createPreviewSession:(t,r)=>L(t,typeof r=="string"?r:r==null?void 0:r.path)};function J(){const{shareId:t}=k(),[r,n]=s.useState(null),[c,a]=s.useState([]),[x,u]=s.useState(!0),[p,d]=s.useState(null),l=s.useRef(null);return s.useEffect(()=>{if(!t){n(null),a([]),d("Shared conversation not found"),u(!1);return}let o=!1;l.current=t,u(!0),d(null);const m=async h=>{try{const[f,g]=await Promise.all([E(t),I(t)]);if(o||l.current!==t)return;n(f),a(y=>h?g.logs:D(y,g.logs)),d(null)}catch(f){if(o||l.current!==t)return;h&&(n(null),a([]),d(f instanceof Error?f.message:"Failed to load shared conversation"))}finally{!o&&l.current===t&&h&&u(!1)}};m(!0);const i=window.setInterval(()=>{m(!1)},2500);return()=>{o=!0,window.clearInterval(i)}},[t]),e.jsx(W,{conversation:r,logs:c,loading:x,error:p})}function W({conversation:t,logs:r,loading:n,error:c}){const[a,x]=s.useState("transcript"),[u,p]=s.useState(!1),d=s.useMemo(()=>{if(!t)return null;const i=A(t.payload.initialMessage);return i.length>0?O(i,new Date(t.createdAt).toISOString()):null},[t]),l=s.useMemo(()=>F([...d?[d]:[],...r]),[d,r]),o=(t==null?void 0:t.scope)==="filesPreview",m=e.jsx("section",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain scroll-pb-16 px-4 py-5 sm:px-6",children:e.jsxs("div",{className:"mx-auto flex max-w-[72rem] flex-col gap-5 pb-16",children:[n&&e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border/60 bg-background/60 px-4 py-3 text-sm text-muted-foreground",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"}),"Loading shared conversation..."]}),!n&&c&&e.jsxs("div",{className:"rounded-lg border border-destructive/20 bg-destructive/10 px-5 py-8 text-center text-destructive",children:[e.jsx("div",{className:"text-base font-semibold",children:"Shared conversation unavailable"}),e.jsx("div",{className:"mt-2 text-sm",children:c})]}),!n&&!c&&l.length===0&&e.jsxs("div",{className:"rounded-lg border border-dashed border-border/70 bg-background/35 px-5 py-8 text-center",children:[e.jsx(q,{className:"mx-auto h-6 w-6 text-muted-foreground"}),e.jsx("div",{className:"mt-3 text-sm font-medium text-foreground",children:"No transcript output yet"})]}),!n&&!c&&l.map((i,h)=>e.jsx(z,{event:i,questionResponseDisabled:!0},`shared-${h}`))]})});return e.jsxs("div",{className:"relative flex h-full min-h-0 overflow-hidden bg-background text-foreground",children:[e.jsxs("aside",{className:"hidden w-64 shrink-0 flex-col border-r border-border/60 bg-muted/20 px-4 py-5 lg:flex xl:w-72",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-border/70 bg-foreground text-xs font-semibold tracking-[0.24em] text-background shadow-sm",children:"M"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:"Meshy Workspace"}),e.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.24em] text-muted-foreground",children:"Shared view"})]})]}),e.jsx("div",{className:"mt-7 text-[11px] font-medium uppercase tracking-[0.28em] text-muted-foreground",children:"Shared conversation"}),t&&e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsx("h1",{className:"max-h-28 overflow-hidden break-words text-base font-semibold leading-5 text-foreground [overflow-wrap:anywhere]",title:t.title,children:t.title}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(S,{status:t.status}),e.jsx(T,{priority:t.priority})]}),e.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[e.jsxs("div",{children:["updated ",C(t.updatedAt)]}),e.jsx("div",{className:"font-mono",children:t.id.slice(0,8)})]})]}),e.jsxs("div",{className:"mt-auto space-y-2 pt-6",children:[u&&e.jsx("div",{className:"rounded-xl border border-border/70 bg-background/80 p-3 font-mono text-[11px] text-foreground shadow-sm",children:"npx -y meshy-node@latest start"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:"https://github.com/ai-microsoft/meshy",target:"_blank",rel:"noreferrer","aria-label":"Open Meshy on GitHub",className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-border/70 bg-background/70 text-muted-foreground transition-colors hover:text-foreground",children:e.jsx($,{className:"h-4 w-4"})}),e.jsxs("button",{type:"button",onClick:()=>p(i=>!i),"aria-expanded":u,className:"inline-flex h-9 items-center gap-2 rounded-full border border-border/70 bg-background/70 px-3 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx(P,{className:"h-4 w-4"}),"Try it"]})]})]})]}),e.jsxs("main",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e.jsxs("header",{className:"shrink-0 border-b border-border/60 bg-background/85 px-4 py-3 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-border/70 bg-foreground text-xs font-semibold tracking-[0.24em] text-background lg:hidden",children:"M"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.28em] text-muted-foreground",children:"Meshy Workspace"}),e.jsx("div",{className:"truncate text-base font-semibold text-foreground",children:(t==null?void 0:t.title)??"Shared conversation"})]})]}),o&&e.jsxs("div",{className:"mt-3 inline-flex h-auto rounded-full bg-muted/70 p-1 text-muted-foreground",children:[e.jsx("button",{type:"button",onClick:()=>x("transcript"),className:b(a==="transcript"),children:"Transcript"}),e.jsx("button",{type:"button",onClick:()=>x("files"),className:b(a==="files"),children:"Files"}),e.jsx("button",{type:"button",onClick:()=>x("preview"),className:b(a==="preview"),children:"Preview"})]})]}),o&&t?e.jsxs(e.Fragment,{children:[a==="transcript"&&m,a==="files"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(s.Suspense,{fallback:e.jsx(v,{label:"Loading files..."}),children:e.jsx(B,{taskId:t.shareId,api:H})})}),a==="preview"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(s.Suspense,{fallback:e.jsx(v,{label:"Loading preview..."}),children:e.jsx(G,{taskId:t.shareId,api:U,allowPortPreview:!1})})})]}):m]})]})}function b(t){return t?"inline-flex items-center justify-center whitespace-nowrap rounded-full bg-background px-3 py-1.5 text-sm font-medium text-foreground shadow-sm":"inline-flex items-center justify-center whitespace-nowrap rounded-full px-3 py-1.5 text-sm font-medium transition-colors hover:text-foreground"}function $({className:t}){return e.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.58 2 12.23c0 4.51 2.87 8.34 6.84 9.7.5.1.68-.22.68-.49 0-.24-.01-.88-.01-1.73-2.78.62-3.37-1.37-3.37-1.37-.45-1.18-1.11-1.49-1.11-1.49-.91-.64.07-.63.07-.63 1 .07 1.53 1.06 1.53 1.06.89 1.56 2.34 1.11 2.91.85.09-.66.35-1.11.63-1.37-2.22-.26-4.55-1.14-4.55-5.05 0-1.12.39-2.03 1.03-2.75-.1-.26-.45-1.31.1-2.71 0 0 .84-.27 2.75 1.05A9.3 9.3 0 0 1 12 6.96c.85 0 1.71.12 2.51.34 1.91-1.32 2.75-1.05 2.75-1.05.55 1.4.2 2.45.1 2.71.64.72 1.03 1.63 1.03 2.75 0 3.92-2.34 4.79-4.57 5.05.36.32.68.94.68 1.9 0 1.37-.01 2.47-.01 2.81 0 .27.18.59.69.49A10.05 10.05 0 0 0 22 12.23C22 6.58 17.52 2 12 2Z"})})}export{J as SharedConversationPage,W as SharedConversationView};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-BSAt8kN_.js","assets/DashboardShared-DMrNrARk.js","assets/folder-DgOi0nrN.js","assets/play-DQGsm6yq.js","assets/SharedConversationPage-DmcJdyZj.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function XS(n,l){for(var o=0;o<l.length;o++){const i=l[o];if(typeof i!="string"&&!Array.isArray(i)){for(const u in i)if(u!=="default"&&!(u in n)){const d=Object.getOwnPropertyDescriptor(i,u);d&&Object.defineProperty(n,u,d.get?d:{enumerable:!0,get:()=>i[u]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function o(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(u){if(u.ep)return;u.ep=!0;const d=o(u);fetch(u.href,d)}})();function Bv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var pd={exports:{}},jo={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -298,4 +298,4 @@ You can add a description to the \`${Ar}\` by passing a \`${sx}\` component as a
|
|
|
298
298
|
|
|
299
299
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ar}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
300
300
|
|
|
301
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{var i;document.getElementById((i=n.current)==null?void 0:i.getAttribute("aria-describedby"))||console.warn(l)},[l,n]),null},UA=tx,BA=nx,HA=ax,mx=lx,hx=rx,px=ux,gx=fx,vx=ix,yx=cx;const Wd=UA,ef=BA,VA=HA,bx=v.forwardRef(({className:n,...l},o)=>m.jsx(mx,{className:fe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...l,ref:o}));bx.displayName=mx.displayName;const zs=v.forwardRef(({className:n,...l},o)=>m.jsxs(VA,{children:[m.jsx(bx,{}),m.jsx(hx,{ref:o,className:fe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-[22px] border bg-background p-6 shadow-[0_34px_110px_-54px_rgba(0,0,0,0.55)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",n),...l})]}));zs.displayName=hx.displayName;const Ls=({className:n,...l})=>m.jsx("div",{className:fe("flex flex-col space-y-2 text-center sm:text-left",n),...l});Ls.displayName="AlertDialogHeader";const Us=({className:n,...l})=>m.jsx("div",{className:fe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...l});Us.displayName="AlertDialogFooter";const Bs=v.forwardRef(({className:n,...l},o)=>m.jsx(vx,{ref:o,className:fe("text-lg font-semibold",n),...l}));Bs.displayName=vx.displayName;const Hs=v.forwardRef(({className:n,...l},o)=>m.jsx(yx,{ref:o,className:fe("text-sm text-muted-foreground",n),...l}));Hs.displayName=yx.displayName;const Vs=v.forwardRef(({className:n,...l},o)=>m.jsx(px,{ref:o,className:fe(hf(),n),...l}));Vs.displayName=px.displayName;const qs=v.forwardRef(({className:n,...l},o)=>m.jsx(gx,{ref:o,className:fe(hf({variant:"outline"}),"mt-2 sm:mt-0",n),...l}));qs.displayName=gx.displayName;var ac="Checkbox",[qA]=tl(ac),[YA,Hf]=qA(ac);function $A(n){const{__scopeCheckbox:l,checked:o,children:i,defaultChecked:u,disabled:d,form:f,name:h,onCheckedChange:y,required:g,value:x="on",internal_do_not_use_render:p}=n,[w,C]=_r({prop:o,defaultProp:u??!1,onChange:y,caller:ac}),[N,E]=v.useState(null),[R,T]=v.useState(null),j=v.useRef(!1),O=N?!!f||!!N.closest("form"):!0,k={checked:w,disabled:d,setChecked:C,control:N,setControl:E,name:h,form:f,value:x,hasConsumerStoppedPropagationRef:j,required:g,defaultChecked:Ia(u)?!1:u,isFormControl:O,bubbleInput:R,setBubbleInput:T};return m.jsx(YA,{scope:l,...k,children:GA(p)?p(k):i})}var xx="CheckboxTrigger",Sx=v.forwardRef(({__scopeCheckbox:n,onKeyDown:l,onClick:o,...i},u)=>{const{control:d,value:f,disabled:h,checked:y,required:g,setControl:x,setChecked:p,hasConsumerStoppedPropagationRef:w,isFormControl:C,bubbleInput:N}=Hf(xx,n),E=Fe(u,x),R=v.useRef(y);return v.useEffect(()=>{const T=d==null?void 0:d.form;if(T){const j=()=>p(R.current);return T.addEventListener("reset",j),()=>T.removeEventListener("reset",j)}},[d,p]),m.jsx(Ue.button,{type:"button",role:"checkbox","aria-checked":Ia(y)?"mixed":y,"aria-required":g,"data-state":Tx(y),"data-disabled":h?"":void 0,disabled:h,value:f,...i,ref:E,onKeyDown:Me(l,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:Me(o,T=>{p(j=>Ia(j)?!0:!j),N&&C&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})});Sx.displayName=xx;var Vf=v.forwardRef((n,l)=>{const{__scopeCheckbox:o,name:i,checked:u,defaultChecked:d,required:f,disabled:h,value:y,onCheckedChange:g,form:x,...p}=n;return m.jsx($A,{__scopeCheckbox:o,checked:u,defaultChecked:d,disabled:h,required:f,onCheckedChange:g,name:i,form:x,value:y,internal_do_not_use_render:({isFormControl:w})=>m.jsxs(m.Fragment,{children:[m.jsx(Sx,{...p,ref:l,__scopeCheckbox:o}),w&&m.jsx(Cx,{__scopeCheckbox:o})]})})});Vf.displayName=ac;var wx="CheckboxIndicator",Ex=v.forwardRef((n,l)=>{const{__scopeCheckbox:o,forceMount:i,...u}=n,d=Hf(wx,o);return m.jsx(kr,{present:i||Ia(d.checked)||d.checked===!0,children:m.jsx(Ue.span,{"data-state":Tx(d.checked),"data-disabled":d.disabled?"":void 0,...u,ref:l,style:{pointerEvents:"none",...n.style}})})});Ex.displayName=wx;var Nx="CheckboxBubbleInput",Cx=v.forwardRef(({__scopeCheckbox:n,...l},o)=>{const{control:i,hasConsumerStoppedPropagationRef:u,checked:d,defaultChecked:f,required:h,disabled:y,name:g,value:x,form:p,bubbleInput:w,setBubbleInput:C}=Hf(Nx,n),N=Fe(o,C),E=Ky(d),R=Ly(i);v.useEffect(()=>{const j=w;if(!j)return;const O=window.HTMLInputElement.prototype,q=Object.getOwnPropertyDescriptor(O,"checked").set,$=!u.current;if(E!==d&&q){const B=new Event("click",{bubbles:$});j.indeterminate=Ia(d),q.call(j,Ia(d)?!1:d),j.dispatchEvent(B)}},[w,E,d,u]);const T=v.useRef(Ia(d)?!1:d);return m.jsx(Ue.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??T.current,required:h,disabled:y,name:g,value:x,form:p,...l,tabIndex:-1,ref:N,style:{...l.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Cx.displayName=Nx;function GA(n){return typeof n=="function"}function Ia(n){return n==="indeterminate"}function Tx(n){return Ia(n)?"indeterminate":n?"checked":"unchecked"}const Rx=v.forwardRef(({className:n,...l},o)=>m.jsx(Vf,{ref:o,className:fe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n),...l,children:m.jsx(Ex,{className:fe("flex items-center justify-center text-current"),children:m.jsx(uf,{className:"h-3.5 w-3.5"})})}));Rx.displayName=Vf.displayName;const Ax=v.forwardRef(({className:n,type:l,...o},i)=>m.jsx("input",{type:l,className:fe("flex h-10 w-full rounded-[16px] border border-input/85 bg-background/72 px-3 py-2 text-sm shadow-sm ring-offset-background transition-all duration-200 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground/75 focus-visible:border-primary/45 focus-visible:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/45 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),ref:i,...o}));Ax.displayName="Input";const kv=["queued","running"];function XA(n){return n.map(l=>`${l.id}:${l.name}`).join("\0")}function QA(n){return n==="claude"||n==="codex"}function _x(n){var o;if(n.kind!=="agent.upgrade")return null;const l=(o=n.payload)==null?void 0:o.agent;return QA(l)?`${n.nodeId}:${l}`:null}function KA(n){return n.status==="succeeded"||n.status==="failed"}async function jx(n,l={}){const o=l.getOperation??Vw,i=l.pollIntervalMs??2e3,u=l.timeoutMs??24e4,d=Date.now()+u;let f=n;for(;!KA(f)&&Date.now()<d;)await PA(i),f=await o(n.id);return f}async function ZA(n,l=qw){const o=new Set(n),i=await Promise.all(kv.map(d=>l({kind:"agent.upgrade",status:d}))),u=new Map;for(const d of i.flat()){if(!kv.includes(d.status)||o.size>0&&!o.has(d.nodeId))continue;const f=_x(d);if(!f)continue;const h=u.get(f);(!h||d.updatedAt>h.updatedAt)&&u.set(f,d)}return u}function PA(n){return new Promise(l=>setTimeout(l,n))}function IA(n,l=!0){return l?(n==null?void 0:n.restartMode)==="development"?"Restart dev runtime":n!=null&&n.updateAvailable?"Update & restart":"Restart runtime":n!=null&&n.updateAvailable?"Update & restart follower":"Restart follower"}function FA({checkedLabel:n,disableAuthDefault:l,endpoint:o,isLiveLocalNode:i,nodeId:u,nodeName:d,pid:f,transportType:h,update:y,workDir:g}){const x=IA(y,i),[p,w]=v.useState(null),[C,N]=v.useState(()=>zv({disableAuthDefault:l,endpoint:o,nodeName:d,transportType:h,workDir:g})),[E,R]=v.useState(!1),[T,j]=v.useState(!1),[O,k]=v.useState(!1);v.useEffect(()=>{N(zv({disableAuthDefault:l,endpoint:o,nodeName:d,transportType:h,workDir:g}))},[l,o,d,h,g]);async function q(){if(!u||E||T)return;const te=y.updateAvailable?"update":"restart",le=e_(C);if(C.port.trim()&&(le==null?void 0:le.port)===void 0){wt.error("Runtime restart port must be a positive integer");return}const ve=le?{reason:te,startArgs:le}:{reason:te};R(!0);try{if(i){const ue=await Uw(ve);w({...ue,pid:ue.pid??f,status:"accepted"}),wt.info(`Restarting ${d} from a detached helper. PID ${ue.pid??f??"unknown"} will not stay attached to the original terminal window; follow ${ue.logPath} for launch output.`);return}const ie=await $w(u,ve);w({operationId:ie.id,pid:f,status:ie.status}),wt.info(`Restart requested on ${d}. Operation ${Ud(ie.id)} will hand off to a detached process, so the new runtime will not stay attached to the original terminal window.`);const ce=await jx(ie,{timeoutMs:6e4}),re=WA(ce);w({command:re==null?void 0:re.command,logPath:re==null?void 0:re.logPath,mode:re==null?void 0:re.mode,operationId:ce.id,pid:(re==null?void 0:re.pid)??f,status:ce.status}),ce.status==="succeeded"?wt.success(`Restart handoff accepted on ${d}. Follow ${(re==null?void 0:re.logPath)??"the node restart log"} for launch output.`):ce.status==="failed"?wt.error(ce.error??`Restart failed on ${d}`):wt.info(`Restart operation ${Ud(ce.id)} is still ${ce.status}. More details will update after the node reports back.`),R(!1)}catch(ie){R(!1),wt.error(ie instanceof Error?ie.message:"Runtime restart failed")}}async function $(){if(!(!i||E||T)){j(!0);try{const te=await Bw();wt.info(`Stopping Meshy process ${te.pid}`)}catch(te){j(!1),wt.error(te instanceof Error?te.message:"Runtime stop failed")}}}const B=E?"restarting":T?"stopping":(p==null?void 0:p.status)??"idle",V=y.restartMode==="development";return m.jsxs("div",{className:"rounded-xl border border-border/70 bg-background/70 overflow-hidden",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border/50",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Ts,{className:"h-3.5 w-3.5 text-primary shrink-0"}),m.jsxs("div",{children:[m.jsx("div",{className:"text-[11px] font-semibold text-foreground leading-tight",children:"Runtime"}),m.jsx("div",{className:"text-[10px] text-muted-foreground leading-tight",children:V?"Development launcher":`Latest ${y.latestVersion??"—"}`})]})]}),m.jsx("div",{className:"flex items-center gap-1.5",children:m.jsx(yt,{variant:y.updateAvailable?"default":"outline",className:"rounded-full border-border/70 bg-background/60 font-mono text-[10px] px-2 py-0.5",children:V?"dev":y.updateAvailable?`→ ${y.latestVersion}`:"current"})})]}),m.jsxs("div",{className:"grid grid-cols-2 divide-x divide-border/50 border-b border-border/50",children:[m.jsxs("div",{className:"px-3 py-1.5",children:[m.jsx("div",{className:"text-[9px] uppercase tracking-[0.16em] text-muted-foreground",children:"PID"}),m.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-foreground",children:f??"—"})]}),m.jsxs("div",{className:"px-3 py-1.5",children:[m.jsx("div",{className:"text-[9px] uppercase tracking-[0.16em] text-muted-foreground",children:"Status"}),m.jsx("div",{className:"mt-0.5 text-[11px] text-foreground capitalize",children:B})]})]}),m.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2",children:[m.jsxs("div",{className:"text-[10px] text-muted-foreground",children:["Checked ",n]}),m.jsxs("div",{className:"flex items-center gap-1.5",children:[i&&m.jsxs(Wd,{children:[m.jsx(ef,{asChild:!0,children:m.jsxs(Qn,{type:"button",size:"sm",variant:"ghost",disabled:E||T,className:"h-7 rounded-lg px-2 text-[11px] text-muted-foreground hover:text-destructive hover:bg-destructive/10",children:[m.jsx(GE,{className:fe("mr-1 h-3.5 w-3.5",T&&"animate-pulse")}),T?"Stopping":"Stop"]})}),m.jsxs(zs,{className:"max-w-[22rem] rounded-xl gap-2 p-4",children:[m.jsxs(Ls,{className:"space-y-1",children:[m.jsx(Bs,{className:"text-sm",children:"Stop runtime?"}),m.jsx(Hs,{className:"text-[11px] leading-4",children:"Gracefully stops the current Meshy process without launching a replacement. The dashboard will disconnect until the node is started again."})]}),m.jsxs(Us,{className:"gap-1 pt-0 sm:space-x-1",children:[m.jsx(qs,{className:"h-7 rounded-lg px-2 text-[11px]",children:"Cancel"}),m.jsx(Vs,{className:"h-7 rounded-lg px-2 text-[11px] bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>void $(),children:"Stop runtime"})]})]})]}),m.jsxs(Wd,{children:[m.jsx(ef,{asChild:!0,children:m.jsxs(Qn,{type:"button",size:"sm",variant:y.updateAvailable?"default":"outline",disabled:!u||E||T,className:"h-7 rounded-lg px-2 text-[11px]",children:[m.jsx(KE,{className:fe("mr-1 h-3.5 w-3.5",E&&"animate-spin")}),E?"Restarting…":x]})}),m.jsxs(zs,{className:"max-w-[28rem] gap-3 rounded-xl p-4",children:[m.jsxs(Ls,{className:"space-y-1",children:[m.jsxs(Bs,{className:"text-sm",children:[x,"?"]}),m.jsxs(Hs,{className:"text-[11px] leading-4",children:["Starts a detached restart helper, shuts down ",i?"the current node":d,", and brings it back with the configured launcher. The new process will not stay attached to the original terminal window."]})]}),m.jsx(JA,{value:C,onChange:N}),m.jsxs(Us,{className:"gap-1 pt-0 sm:space-x-1",children:[m.jsx(qs,{className:"h-7 rounded-lg px-2 text-[11px]",children:"Cancel"}),m.jsx(Vs,{className:"h-7 rounded-lg px-2 text-[11px]",onClick:()=>void q(),children:x})]})]})]})]})]}),m.jsxs("div",{className:"border-t border-border/50",children:[m.jsxs("button",{type:"button",onClick:()=>k(te=>!te),className:"flex w-full items-center justify-between px-3 py-1.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors",children:[m.jsxs("span",{className:"flex items-center gap-1.5",children:[m.jsx(v0,{className:"h-3 w-3"}),"Restart details"]}),m.jsx(Xs,{className:fe("h-3 w-3 transition-transform duration-150",O&&"rotate-180")})]}),O&&m.jsxs("div",{className:"border-t border-border/50 bg-muted/20 px-3 py-2 space-y-1",children:[m.jsx(Rl,{label:"Current PID",value:f===void 0?"—":String(f),mono:f!==void 0}),m.jsx(Rl,{label:"Restart PID",value:(p==null?void 0:p.pid)===void 0?"Pending":String(p.pid),mono:(p==null?void 0:p.pid)!==void 0}),m.jsx(Rl,{label:"Operation",value:p!=null&&p.operationId?Ud(p.operationId):"Local direct request",mono:!!(p!=null&&p.operationId)}),m.jsx(Rl,{label:"Status",value:(p==null?void 0:p.status)??(E?"requested":"idle")}),m.jsx(Rl,{label:"Launcher",value:(p==null?void 0:p.command)??"Available after restart",mono:!!(p!=null&&p.command)}),m.jsx(Rl,{label:"Log",value:(p==null?void 0:p.logPath)??"Available after restart",mono:!!(p!=null&&p.logPath)}),m.jsx(Rl,{label:"Terminal",value:"New process is detached from original terminal"})]})]}),y.detail&&m.jsx("div",{className:"border-t border-border/50 px-3 py-1.5 text-[10px] text-muted-foreground bg-muted/20",children:y.detail})]})}function JA({onChange:n,value:l}){const o=(i,u)=>{n({...l,[i]:u})};return m.jsxs("div",{className:"rounded-lg border border-border/70 bg-muted/30 p-3 space-y-3",children:[m.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:"Startup arguments"}),m.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[m.jsx(ko,{label:"HTTP port",value:l.port,onChange:i=>o("port",i),inputMode:"numeric"}),m.jsx(ko,{label:"Node name",value:l.name,onChange:i=>o("name",i)}),m.jsx(ko,{label:"Join endpoint",value:l.join,onChange:i=>o("join",i),className:"sm:col-span-2"}),m.jsxs("div",{className:"space-y-1",children:[m.jsx("label",{className:"text-[9px] uppercase tracking-[0.14em] text-muted-foreground",children:"Transport"}),m.jsxs(jb,{value:l.transport,onValueChange:i=>o("transport",Ox(i)),children:[m.jsx(Lf,{className:"h-7 rounded-md border-border/70 bg-background/70 px-2 text-[10px]",children:m.jsx(Ob,{placeholder:"Transport"})}),m.jsxs(Uf,{children:[m.jsx(Cr,{className:"py-1 text-[11px]",value:"inherit",children:"current / default"}),m.jsx(Cr,{className:"py-1 text-[11px]",value:"direct",children:"direct"}),m.jsx(Cr,{className:"py-1 text-[11px]",value:"devtunnel",children:"devtunnel"}),m.jsx(Cr,{className:"py-1 text-[11px]",value:"tailscale",children:"tailscale"})]})]})]}),m.jsx(ko,{label:"Working directory",value:l.workDir,onChange:i=>o("workDir",i)}),m.jsx(ko,{label:"Config path",value:l.config,onChange:i=>o("config",i),className:"sm:col-span-2"}),m.jsxs("label",{className:"flex items-center gap-2 rounded-md border border-border/60 bg-background/60 px-2 py-1.5 text-[10px] text-foreground sm:col-span-2 cursor-pointer hover:bg-muted/40 transition-colors",children:[m.jsx(Rx,{className:"h-3.5 w-3.5",checked:l.disableAuth,onCheckedChange:i=>n({...l,disableAuth:i===!0,disableAuthKnown:!0})}),"Disable auth"]})]})]})}function ko({className:n,inputMode:l,label:o,onChange:i,value:u}){return m.jsxs("label",{className:fe("space-y-1",n),children:[m.jsx("span",{className:"text-[9px] uppercase tracking-[0.14em] text-muted-foreground",children:o}),m.jsx(Ax,{className:"h-7 rounded-md px-2 text-[10px]",inputMode:l,value:u,onChange:d=>i(d.target.value)})]})}function Rl({label:n,value:l,mono:o=!1}){return m.jsxs("div",{className:"flex items-start justify-between gap-3 text-[10px]",children:[m.jsx("span",{className:"shrink-0 uppercase tracking-[0.14em] text-muted-foreground",children:n}),m.jsx("span",{className:fe("break-all text-right text-foreground",o&&"font-mono"),children:l})]})}function WA(n){const l=n.result;if(!l||typeof l!="object")return null;const o=l;return o.ok!==!0||typeof o.command!="string"||typeof o.logPath!="string"?null:{ok:!0,mode:o.mode==="package"?"package":"development",command:o.command,logPath:o.logPath,pid:typeof o.pid=="number"?o.pid:void 0}}function zv(n){return{port:t_(n.endpoint),name:n.nodeName,join:"",transport:Ox(n.transportType),workDir:n.workDir??"",config:"",disableAuth:n.disableAuthDefault===!0,disableAuthKnown:n.disableAuthDefault!==void 0}}function e_(n){const l={},o=Number(n.port.trim());return n.port.trim()&&Number.isInteger(o)&&o>0&&(l.port=o),n.name.trim()&&(l.name=n.name.trim()),n.join.trim()&&(l.join=n.join.trim()),n.transport!=="inherit"&&(l.transport=n.transport),n.workDir.trim()&&(l.workDir=n.workDir.trim()),n.config.trim()&&(l.config=n.config.trim()),n.disableAuthKnown&&(l.disableAuth=n.disableAuth),Object.keys(l).length>0?l:void 0}function Ox(n){return n==="direct"||n==="devtunnel"||n==="tailscale"?n:"inherit"}function t_(n){if(!n)return"";try{return new URL(n).port||""}catch{return""}}function Ud(n){return n.length<=8?n:n.slice(0,8)}function vs({formatDateTime:n,name:l,status:o,statusVariant:i}){return m.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-border/60 bg-background/70 px-2.5 py-1.5",children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-[11px] font-medium text-foreground",children:l}),m.jsx("div",{className:"text-[10px] text-muted-foreground",children:n(o==null?void 0:o.checkedAt)})]}),m.jsxs("div",{className:"flex items-center gap-1.5",children:[typeof(o==null?void 0:o.authenticated)=="boolean"&&m.jsx(yt,{variant:o.authenticated?"default":"outline",className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:o.authenticated?"auth ok":"auth required"}),m.jsx(yt,{variant:i(o==null?void 0:o.status),className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:(o==null?void 0:o.status)??"unknown"})]})]})}function vn(n){if(n==null||n==="")return"Unavailable";const l=new Date(n);return Number.isNaN(l.getTime())?"Unavailable":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(l)}function n_(n){const l=Math.max(0,Math.floor(n)),o=Math.floor(l/86400),i=Math.floor(l%86400/3600),u=Math.floor(l%3600/60);return o>0?`${o}d ${i}h`:i>0?`${i}h ${u}m`:`${u}m`}function Lv(n){if(n==null||Number.isNaN(n))return"Unavailable";const l=["B","KB","MB","GB","TB"];let o=n,i=0;for(;o>=1024&&i<l.length-1;)o/=1024,i+=1;return`${o.toFixed(o>=10||i===0?0:1)} ${l[i]}`}function Uo(n){return n==="ok"?"default":n==="missing"||n==="install-failed"||n==="login-failed"?"destructive":n==="not-authenticated"||n==="unsupported-platform"?"outline":"secondary"}function a_(n){return n.available?m.jsxs(yt,{className:"gap-1 rounded-full px-2 py-0.5 text-[10px]",children:[m.jsx(zo,{className:"h-3 w-3"}),"Available"]}):m.jsxs(yt,{variant:"destructive",className:"gap-1 rounded-full px-2 py-0.5 text-[10px]",children:[m.jsx(AE,{className:"h-3 w-3"}),"Unavailable"]})}function l_(n){return n.update?n.update.updateAvailable?m.jsxs(yt,{variant:"outline",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.14em]",children:["Update ",n.update.latestVersion]}):m.jsx(yt,{variant:"secondary",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.14em]",children:"Up to date"}):null}function r_(n){var o;const l=`npm install -g ${(o=n.update)==null?void 0:o.packageName}@latest`;return n.id==="claude"?`${l} --include=optional --ignore-scripts=false`:l}function o_(n){if(n.error)return n.error;const l=n.result;return(l==null?void 0:l.detail)??null}function Le({label:n,value:l,mono:o=!1}){return m.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border/50 py-1 last:border-b-0 last:pb-0 first:pt-0",children:[m.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:n}),m.jsx("span",{className:fe("break-all text-right text-[11px] text-foreground",o&&"font-mono text-[11px]"),children:l})]})}function i_({agent:n,nodeName:l,activeOperation:o,onUpgrade:i}){var h,y;const u=((h=n.update)==null?void 0:h.updateAvailable)===!0,d=l_(n),f=!!o;return m.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/70 p-2.5 shadow-sm",children:[m.jsxs("div",{className:"flex items-start justify-between gap-2",children:[m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-semibold text-foreground",children:[m.jsx(f0,{className:"h-3.5 w-3.5 text-primary"}),n.label]}),m.jsxs("div",{className:"mt-0.5 text-[10px] text-muted-foreground",children:["Command: ",m.jsx("span",{className:"font-mono text-[10px]",children:n.command})]})]}),m.jsxs("div",{className:"flex flex-col items-end gap-1",children:[a_(n),o?m.jsxs(yt,{variant:"outline",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.14em]",children:["Upgrade ",o.status]}):u?m.jsxs(Wd,{children:[m.jsx(ef,{asChild:!0,children:m.jsx("button",{type:"button",disabled:f,className:"rounded-full transition duration-150 hover:-translate-y-0.5 hover:scale-[1.03] hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/45 focus-visible:ring-offset-2 active:translate-y-0 active:scale-95 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:scale-100 disabled:hover:shadow-none",children:d})}),m.jsxs(zs,{children:[m.jsxs(Ls,{children:[m.jsxs(Bs,{children:["Upgrade ",n.label,"?"]}),m.jsxs(Hs,{children:["This runs ",r_(n)," on ",l,". Remote nodes execute the command on the remote machine."]})]}),m.jsxs(Us,{children:[m.jsx(qs,{children:"Cancel"}),m.jsx(Vs,{onClick:()=>i(n),children:"Upgrade"})]})]})]}):d]})]}),m.jsxs("div",{className:"mt-2 space-y-1 text-[11px]",children:[m.jsx(Le,{label:"Version",value:n.version??"Unavailable",mono:!!n.version}),n.update&&m.jsx(Le,{label:"Latest",value:n.update.latestVersion??"Unavailable",mono:!!n.update.latestVersion}),m.jsx(Le,{label:"Path",value:n.path??"Not on PATH",mono:!!n.path}),m.jsx(Le,{label:"Checked",value:vn(n.checkedAt)}),n.update&&m.jsx(Le,{label:"Update check",value:vn(n.update.checkedAt)})]}),((y=n.update)==null?void 0:y.detail)&&m.jsx("div",{className:"mt-1.5 rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[10px] text-muted-foreground",children:n.update.detail}),n.metadataStatus&&m.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[m.jsx(yt,{variant:Uo(n.metadataStatus),className:"rounded-full px-2 py-0 text-[10px] uppercase tracking-[0.14em]",children:n.metadataStatus}),m.jsx("span",{children:"Startup preflight"})]}),n.detail&&m.jsx("div",{className:"mt-1.5 rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[10px] text-muted-foreground",children:n.detail})]})}function s_(n){return[{key:"workspace",label:"Workspace",value:n==null?void 0:n.workspace},{key:"node",label:"Node app",value:n==null?void 0:n.node},{key:"core",label:"Core",value:n==null?void 0:n.core},{key:"dashboard",label:"Dashboard",value:n==null?void 0:n.dashboard},{key:"api",label:"API",value:n==null?void 0:n.api}].filter(o=>o.value)}function c_(n,l){var o;return(o=n==null?void 0:n.nodes)!=null&&o.length?n.nodes:l?[l]:[]}function u_(n,l){var i;if(l&&n.id===l.nodeId)return l;const o=n.settingsSnapshot;return{...n,nodeId:n.id,version:(o==null?void 0:o.version)??"Unavailable",packageName:o==null?void 0:o.packageName,uptime:(o==null?void 0:o.uptime)??0,localDashboardOrigin:((i=o==null?void 0:o.runtime)==null?void 0:i.localDashboardOrigin)??void 0,auth:o==null?void 0:o.auth,os:o==null?void 0:o.os,runtime:o==null?void 0:o.runtime,runtimeUpdate:o==null?void 0:o.runtimeUpdate,agents:o==null?void 0:o.agents,startupRequirements:o==null?void 0:o.startupRequirements,components:o==null?void 0:o.components,repository:o==null?void 0:o.repository,packages:o==null?void 0:o.packages}}function d_(n,l){return n.id===l?`${n.name} (this node)`:`${n.name} (${n.role})`}function f_(n){return n==="claude"?"Claude Code":"Codex"}function m_(n){var o;const l=(o=n.payload)==null?void 0:o.agent;return l==="claude"||l==="codex"?l:null}function h_({cluster:n,systemInfo:l,sseConnected:o,initialSelectedNodeId:i,onRefresh:u}){var le,ve,ie,ce,re,ue,M,G,I,se,F,_,X,K,J,W,ae,ee,oe,de,Te,Ee,we,Je,$e,zt,Mt;const d=v.useMemo(()=>c_(n,l),[n,l]),[f,h]=v.useState(()=>{var ye;return i??(l==null?void 0:l.nodeId)??((ye=n==null?void 0:n.self)==null?void 0:ye.id)??""}),[y,g]=v.useState(()=>new Map),x=v.useRef(new Set),p=v.useRef(new Set),w=(n==null?void 0:n.self)??l??d[0]??null,C=d.find(ye=>ye.id===f)??w,N=C?u_(C,l):null,E=!!(l&&C&&C.id===l.nodeId),R=E||!!(C!=null&&C.settingsSnapshot),T=v.useMemo(()=>s_(N==null?void 0:N.packages),[N==null?void 0:N.packages]),j=N==null?void 0:N.runtimeUpdate,O=((le=N==null?void 0:N.startupRequirements)==null?void 0:le.components)??(N==null?void 0:N.components)??{},k=v.useMemo(()=>d.map(ye=>ye.id),[d]),q=k.join("\0"),$=XA(d),B=v.useMemo(()=>new Map(d.map(ye=>[ye.id,ye.name])),[$]);v.useEffect(()=>{i&&k.includes(i)&&h(i)},[i,q]);const V=v.useCallback(async(ye,tt)=>{const Be=_x(ye);if(!Be||x.current.has(ye.id))return;const rn=m_(ye),Kt=(tt==null?void 0:tt.agentLabel)??(rn?f_(rn):"Agent"),dt=(tt==null?void 0:tt.nodeName)??B.get(ye.nodeId)??ye.nodeId;x.current.add(ye.id),g(Ie=>new Map(Ie).set(Be,ye));try{const Ie=await jx(ye);if(Ie.status==="succeeded")await(u==null?void 0:u()),p.current.has(Ie.id)||(wt.success(`${Kt} upgrade finished on ${dt}`),p.current.add(Ie.id));else if(Ie.status==="failed")p.current.has(Ie.id)||(wt.error(o_(Ie)??`${Kt} upgrade failed`),p.current.add(Ie.id));else{g(st=>new Map(st).set(Be,Ie)),wt.info(`${Kt} upgrade is still ${Ie.status} on ${dt}`);return}g(st=>{const bn=new Map(st),Zt=bn.get(Be);return(!Zt||Zt.id===Ie.id)&&bn.delete(Be),bn})}catch(Ie){g(st=>{const bn=new Map(st),Zt=bn.get(Be);return(!Zt||Zt.id===ye.id)&&bn.delete(Be),bn}),wt.error(Ie instanceof Error?Ie.message:`${Kt} upgrade failed`)}finally{x.current.delete(ye.id)}},[u,B]);v.useEffect(()=>{if(k.length===0)return;let ye=!1;async function tt(){let Be;try{Be=await ZA(k)}catch{return}if(!ye){g(rn=>{const Kt=new Map(rn);for(const[dt,Ie]of Be)Kt.set(dt,Ie);return Kt});for(const rn of Be.values())V(rn)}}return tt(),()=>{ye=!0}},[V,q]);async function te(ye){if(C)try{const tt=await Yw(C.id,ye.id);wt.info(`${ye.label} upgrade started on ${C.name}`),await V(tt,{agentLabel:ye.label,nodeName:C.name})}catch(tt){wt.error(tt instanceof Error?tt.message:`${ye.label} upgrade failed`)}}return!C||!N?m.jsx("div",{className:"rounded-2xl border border-dashed border-border/70 bg-muted/20 px-4 py-8 text-center text-[12px] text-muted-foreground",children:"Loading session metadata..."}):m.jsxs("div",{className:"space-y-3",children:[m.jsxs("section",{className:"relative mt-2 rounded-2xl border border-border/70 bg-[radial-gradient(circle_at_top_left,rgba(59,130,246,0.18),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(16,185,129,0.12),transparent_32%),rgba(255,255,255,0.72)] p-3 shadow-[0_24px_90px_-54px_rgba(15,23,42,0.55)] dark:bg-[radial-gradient(circle_at_top_left,rgba(59,130,246,0.18),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(16,185,129,0.12),transparent_32%),rgba(10,15,23,0.78)]",children:[!E&&m.jsxs(yt,{variant:"outline",className:"absolute right-3 top-2.5 rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em] whitespace-nowrap",children:["Updated ",vn((ve=C.settingsSnapshot)==null?void 0:ve.collectedAt)]}),m.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end md:justify-between",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsxs("span",{className:"flex items-center gap-1.5 rounded-full border border-border/70 bg-background/75 px-2 py-0.5 text-[10px] text-muted-foreground backdrop-blur",children:[m.jsx(L0,{status:C.status}),m.jsx("span",{className:"font-medium text-foreground",children:C.name})]}),m.jsx(JN,{role:C.role}),m.jsx(yt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:C.transportType??N.transportType??"direct"}),m.jsx(yt,{variant:E?"default":"outline",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:E?"Live local session":"Leader-synced snapshot"})]}),m.jsxs("div",{children:[m.jsx("div",{className:"text-[10px] uppercase tracking-[0.34em] text-muted-foreground",children:"Session"}),m.jsx("h3",{className:"mt-0.5 text-sm font-semibold tracking-tight text-foreground",children:"Node runtime"}),m.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:"Runtime environment, connectivity, and build metadata."})]}),d.length>1&&m.jsxs("div",{className:"w-48 space-y-1.5",children:[m.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Inspect node"}),m.jsxs(jb,{value:C.id,onValueChange:h,children:[m.jsx(Lf,{className:"h-7 rounded-lg border-border/70 bg-background/70 text-[11px]",children:m.jsx(Ob,{placeholder:"Choose a node"})}),m.jsx(Uf,{children:d.map(ye=>m.jsx(Cr,{value:ye.id,children:d_(ye,l==null?void 0:l.nodeId)},ye.id))})]})]})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsxs(yt,{variant:o?"default":"outline",className:"gap-1 rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:[m.jsx(p0,{className:"h-3 w-3"}),o?"Live link":"Reconnecting"]}),m.jsxs(yt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Uptime ",n_(N.uptime)]})]})]})]}),!R&&m.jsx("div",{className:"rounded-xl border border-dashed border-border/70 bg-muted/20 px-3 py-2 text-[11px] text-muted-foreground",children:"This node has not synced its settings snapshot to the leader yet. Wait for the next keepalive and reopen the dialog if needed."}),m.jsxs(RA,{defaultValue:"session",className:"space-y-2",children:[m.jsxs(Wb,{className:"h-auto flex-wrap rounded-xl border border-border/60 bg-muted/40 p-0.5",children:[m.jsx(Es,{value:"session",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"Session"}),m.jsx(Es,{value:"access",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"Access"}),m.jsx(Es,{value:"about",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"About"})]}),m.jsxs(Ns,{value:"session",className:"mt-0 grid gap-2 xl:grid-cols-[1.15fr_0.85fr]",children:[m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(PE,{className:"h-3.5 w-3.5 text-primary"}),"Selected node"]}),m.jsx(Vn,{className:"text-[10px]",children:"Cluster role, identity, and node-scoped runtime state."})]}),m.jsxs(qn,{className:"space-y-0 px-3 pb-2.5",children:[m.jsx(Le,{label:"Node ID",value:N.nodeId,mono:!0}),m.jsx(Le,{label:"Status",value:C.status}),m.jsx(Le,{label:"Role",value:C.role}),m.jsx(Le,{label:"Endpoint",value:C.endpoint,mono:!0}),m.jsx(Le,{label:"Joined",value:vn(C.joinedAt)}),m.jsx(Le,{label:"Heartbeat",value:vn(C.lastHeartbeat)}),m.jsx(Le,{label:"Capabilities",value:C.capabilities.length>0?C.capabilities.join(", "):"None"})]})]}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(ME,{className:"h-3.5 w-3.5 text-primary"}),"OS info"]}),m.jsx(Vn,{className:"text-[10px]",children:"Host and resource details reported by the current process."})]}),m.jsxs(qn,{className:"space-y-0 px-3 pb-2.5",children:[m.jsx(Le,{label:"Host",value:((ie=N.os)==null?void 0:ie.hostname)??"Unavailable"}),m.jsx(Le,{label:"Platform",value:N.os?`${N.os.platform} ${N.os.release}`:"Unavailable"}),m.jsx(Le,{label:"Arch",value:((ce=N.os)==null?void 0:ce.arch)??"Unavailable"}),m.jsx(Le,{label:"CPU",value:((re=N.os)==null?void 0:re.cpuModel)??"Unavailable"}),m.jsx(Le,{label:"Cores",value:String(((ue=N.os)==null?void 0:ue.cpuCount)??"Unavailable")}),m.jsx(Le,{label:"Memory",value:N.os?`${Lv(N.os.freeMemoryBytes)} free / ${Lv(N.os.totalMemoryBytes)} total`:"Unavailable"})]})]}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)] xl:col-span-2",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(f0,{className:"h-3.5 w-3.5 text-primary"}),"Available agents"]}),m.jsx(Vn,{className:"text-[10px]",children:E?"Live command availability for Codex and Claude Code on this node.":"Most recent agent availability snapshot synced from this node."})]}),m.jsx(qn,{className:"grid gap-2 px-3 pb-2.5 md:grid-cols-2",children:(N.agents??[]).map(ye=>m.jsx(i_,{agent:ye,nodeName:C.name,activeOperation:y.get(`${C.id}:${ye.id}`),onUpgrade:te},ye.id))})]})]}),m.jsxs(Ns,{value:"access",className:"mt-0 grid gap-2 xl:grid-cols-2",children:[m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(vE,{className:"h-3.5 w-3.5 text-primary"}),"Access surface"]}),m.jsx(Vn,{className:"text-[10px]",children:"How this node is exposed to the dashboard and other peers."})]}),m.jsxs(qn,{className:"space-y-0 px-3 pb-2.5",children:[m.jsx(Le,{label:"Transport",value:C.transportType??N.transportType??"direct"}),m.jsx(Le,{label:"Node URL",value:C.endpoint,mono:!0}),m.jsx(Le,{label:"Node tunnel",value:C.devtunnelEndpoint??"Disabled",mono:!!C.devtunnelEndpoint}),m.jsx(Le,{label:"Dashboard URL",value:C.dashboardOrigin??N.localDashboardOrigin??"Unavailable",mono:!!(C.dashboardOrigin||N.localDashboardOrigin)}),m.jsx(Le,{label:"Local dashboard",value:N.localDashboardOrigin??"Unavailable",mono:!!N.localDashboardOrigin})]})]}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(WE,{className:"h-3.5 w-3.5 text-primary"}),"Auth"]}),m.jsx(Vn,{className:"text-[10px]",children:"Current bearer-auth and trusted access posture."})]}),m.jsxs(qn,{className:"space-y-0 px-3 pb-2.5",children:[m.jsx(Le,{label:"Enabled",value:(M=N.auth)!=null&&M.enabled?"Yes":"No"}),m.jsx(Le,{label:"Same tenant",value:(G=N.auth)!=null&&G.allowSameTenant?"Allowed":"Off"}),m.jsx(Le,{label:"Allowed users",value:(I=N.auth)!=null&&I.allowedUsers.length?N.auth.allowedUsers.join(", "):"None"})]})]}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(LE,{className:"h-3.5 w-3.5 text-primary"}),"Paths"]}),m.jsx(Vn,{className:"text-[10px]",children:"Workspace and runtime paths currently used by this node."})]}),m.jsxs(qn,{className:"space-y-0 px-3 pb-2.5",children:[m.jsx(Le,{label:"Work dir",value:((se=N.runtime)==null?void 0:se.workDir)??N.workDir??"Unavailable",mono:!!(((F=N.runtime)==null?void 0:F.workDir)??N.workDir)}),m.jsx(Le,{label:"Storage",value:((_=N.runtime)==null?void 0:_.storagePath)??"Unavailable",mono:!!((X=N.runtime)!=null&&X.storagePath)}),m.jsx(Le,{label:"Process cwd",value:((K=N.runtime)==null?void 0:K.cwd)??"Unavailable",mono:!!((J=N.runtime)!=null&&J.cwd)}),m.jsx(Le,{label:"Started",value:vn((W=N.runtime)==null?void 0:W.startedAt)}),m.jsx(Le,{label:"PID",value:N.runtime?String(N.runtime.pid):"Unavailable",mono:!!N.runtime})]})]}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(Ts,{className:"h-3.5 w-3.5 text-primary"}),"Startup checks"]}),m.jsx(Vn,{className:"text-[10px]",children:"Dependency preflight snapshot persisted during node startup."})]}),m.jsxs(qn,{className:"space-y-3 px-3 pb-2.5",children:[m.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/70 px-3 py-2",children:[m.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Last checked"}),m.jsx("div",{className:"mt-0.5 text-[11px] text-foreground",children:vn((ae=N.startupRequirements)==null?void 0:ae.lastCheckedAt)})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(vs,{formatDateTime:vn,name:"Azure CLI",status:O.az,statusVariant:Uo}),m.jsx(vs,{formatDateTime:vn,name:"DevTunnel",status:O.devtunnel,statusVariant:Uo}),m.jsx(vs,{formatDateTime:vn,name:"Claude Code",status:O.claude,statusVariant:Uo}),m.jsx(vs,{formatDateTime:vn,name:"Codex",status:O.codex,statusVariant:Uo})]})]})]})]}),m.jsxs(Ns,{value:"about",className:"mt-0 grid gap-2 xl:grid-cols-[0.92fr_1.08fr]",children:[m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(hE,{className:"h-3.5 w-3.5 text-primary"}),"Repository"]}),m.jsx(Vn,{className:"text-[10px]",children:"Source-of-truth repository metadata for this running node."})]}),m.jsxs(qn,{className:"space-y-3 px-3 pb-2.5",children:[(ee=N.repository)!=null&&ee.url?m.jsxs("a",{href:N.repository.url,target:"_blank",rel:"noreferrer",className:"group flex items-center justify-between rounded-lg border border-border/70 bg-background/70 px-2.5 py-1.5 text-[11px] text-foreground transition-colors hover:border-primary/40 hover:bg-primary/5",children:[m.jsx("span",{className:"font-mono text-[10px]",children:N.repository.url}),m.jsx(kE,{className:"h-3.5 w-3.5 text-muted-foreground transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5"})]}):m.jsx("div",{className:"rounded-lg border border-dashed border-border/70 bg-muted/20 px-2.5 py-1.5 text-[11px] text-muted-foreground",children:"Repository URL is unavailable in this runtime."}),m.jsxs("div",{className:"space-y-0",children:[m.jsx(Le,{label:"Branch",value:((oe=N.repository)==null?void 0:oe.branch)??"Unavailable",mono:!!((de=N.repository)!=null&&de.branch)}),m.jsx(Le,{label:"Commit",value:((Te=N.repository)==null?void 0:Te.commit)??"Unavailable",mono:!!((Ee=N.repository)!=null&&Ee.commit)}),m.jsx(Le,{label:"Runtime",value:`${N.packageName??"meshy"} ${N.version}`,mono:!0}),m.jsx(Le,{label:"Node.js",value:((we=N.runtime)==null?void 0:we.nodeVersion)??"Unavailable",mono:!!((Je=N.runtime)!=null&&Je.nodeVersion)})]})]})]}),m.jsxs("div",{className:"space-y-2",children:[j&&m.jsx(FA,{checkedLabel:vn(j.checkedAt),disableAuthDefault:(($e=N.auth)==null?void 0:$e.enabled)===void 0?void 0:N.auth.enabled===!1,endpoint:C.endpoint,isLiveLocalNode:E,nodeId:C.id,nodeName:C.name,pid:(zt=N.runtime)==null?void 0:zt.pid,transportType:C.transportType,update:j,workDir:((Mt=N.runtime)==null?void 0:Mt.workDir)??C.workDir}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(BE,{className:"h-3.5 w-3.5 text-primary"}),"Package versions"]}),m.jsx(Vn,{className:"text-[10px]",children:"Version snapshot for the packages most relevant to this dashboard session."})]}),m.jsx(qn,{className:"space-y-1.5 px-3 pb-2.5",children:T.map(ye=>{var tt,Be;return m.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-background/70 px-2.5 py-1.5",children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-[11px] font-medium text-foreground",children:ye.label}),m.jsx("div",{className:"text-[10px] text-muted-foreground",children:(tt=ye.value)==null?void 0:tt.name})]}),m.jsx(yt,{variant:"outline",className:"rounded-[11px] border-border/70 bg-background/60 font-mono text-[10px]",children:(Be=ye.value)==null?void 0:Be.version})]},ye.key)})})]})]})]})]})]})}function p_({initialSelectedNodeId:n,open:l,onOpenChange:o,showTrigger:i=!0}={}){const{cluster:u,systemInfo:d,sseConnected:f,refresh:h}=u0();return m.jsx(g5,{open:l,onOpenChange:o,showTrigger:i,children:m.jsx(h_,{cluster:u,systemInfo:d,sseConnected:f,initialSelectedNodeId:n,onRefresh:h})})}const $3="bypass",g_=[{value:"claudecode",label:"claudecode",supportsFollowUp:!0},{value:"codex",label:"codex",supportsFollowUp:!0},{value:"mars",label:"mars",disabled:!0,description:"coming soon"},{value:"eureka",label:"eureka",disabled:!0,description:"coming soon"}],G3=[{value:"bypass",label:"Bypass"},{value:"plan",label:"Plan"},{value:"edit",label:"Edit"},{value:"dangerous",label:"Dangerous"}],X3=new Set(g_.filter(n=>n.supportsFollowUp).map(n=>n.value)),Q3=[{value:"active",label:"Active"},{value:"running",label:"Running"},{value:"waiting",label:"Waiting"},{value:"closed",label:"Closed"},{value:"shared",label:"Shared"},{value:"archived",label:"Archived"}],K3=[{value:"all",label:"All task types"},{value:"native",label:"Native sessions"},{value:"meshy",label:"Meshy chats"}],v_=new Set(["pending","assigned"]),y_=new Set(["running"]),b_=new Set(["completed","failed","cancelled"]);function Z3(n,l){switch(l){case"running":return y_.has(n.status);case"waiting":return v_.has(n.status);case"closed":return b_.has(n.status);case"shared":return!!n.activeShare;case"archived":return n.status==="archived";case"active":default:return n.status!=="archived"}}function P3(n,l){if(l==="all")return!0;const o=n.conversationKind==="nativeSession";return l==="native"?o:!o}function I3(n,l){const o=l.trim().toLowerCase();return o?[n.title,n.description,n.id,n.agent,n.assignedTo??"",n.assignedNodeName??"",n.project??"",n.effectiveProjectPath??"",n.conversationKind==="nativeSession"?"native session":"meshy chat",n.activeShare?"shared conversation":""].some(i=>i.toLowerCase().includes(o)):!0}function x_(n,l,o){if(!n)return"unassigned";const i=l==null?void 0:l.find(u=>u.id===n);return(i==null?void 0:i.name)??o??n.slice(0,8)}function F3(n,l,o){return x_(n,l,o).toLowerCase()}function J3(n,l,o){return!n.assignedTo||(o==null?void 0:o.id)===n.assignedTo?!0:(l==null?void 0:l.some(i=>i.id===n.assignedTo))??!1}function W3(n,l){return[...n].sort((o,i)=>o.id===l?-1:i.id===l?1:o.name.localeCompare(i.name))}function ej(n){if(!n||typeof n!="object")return null;const l=n,o=l.createMode,i=o==="chat"||o==="native"?o:void 0;return{draftNewTask:l.draftNewTask===!0,returnRoute:typeof l.returnRoute=="string"?l.returnRoute:void 0,returnTaskId:typeof l.returnTaskId=="string"||l.returnTaskId===null?l.returnTaskId:void 0,createMode:i}}function tj(n){switch(n){case"running":return"bg-amber-500";case"completed":return"bg-emerald-500";case"failed":return"bg-destructive";case"cancelled":case"archived":return"bg-slate-400";case"assigned":return"bg-teal-500";case"pending":default:return"bg-muted-foreground"}}function nj(n){return n==="default workspace"?n:n.replace(/\\/g,"/").split("/").filter(Boolean).at(-1)??n}function aj(n){const l=Date.now()-n;return l<6e4?"just now":l<36e5?`${Math.floor(l/6e4)}m`:l<864e5?`${Math.floor(l/36e5)}h`:`${Math.floor(l/864e5)}d`}function lj(n){return new Date(n).toLocaleString()}function rj(n){const l=Math.floor(n/1e3),o=Math.floor(l/3600),i=Math.floor(l%3600/60),u=l%60;return`${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}:${String(u).padStart(2,"0")}`}async function S_(n,l="Copied to clipboard"){var o,i,u;try{if((i=(o=globalThis.navigator)==null?void 0:o.clipboard)!=null&&i.writeText)return await globalThis.navigator.clipboard.writeText(n),wt.success(l),!0;const d=globalThis.document,f=(u=d==null?void 0:d.execCommand)==null?void 0:u.bind(d);if(!(d!=null&&d.body)||typeof d.createElement!="function"||typeof f!="function")throw new Error("Clipboard access is unavailable");const h=d.createElement("textarea"),y=d.activeElement,g=y&&typeof y.focus=="function"?y:null;h.value=n,h.setAttribute("readonly","true"),h.style.position="fixed",h.style.opacity="0",h.style.pointerEvents="none",d.body.appendChild(h),h.select(),h.setSelectionRange(0,h.value.length);const x=f("copy");if(d.body.removeChild(h),g==null||g.focus(),!x)throw new Error("Clipboard access is unavailable");return wt.success(l),!0}catch(d){return wt.error(d instanceof Error?d.message:"Failed to copy"),!1}}function oj(n,l,o){const i=new Map;for(const d of n){const f=d.assignedTo??null,h=f??"__unassigned__",y=f?l.get(f)??d.assignedNodeName??f.slice(0,8):"Unassigned",g=d.effectiveProjectPath??d.project??"default workspace";i.has(h)||i.set(h,{nodeId:f,nodeName:y,dirMap:new Map});const x=i.get(h);x.dirMap.has(g)||x.dirMap.set(g,[]),x.dirMap.get(g).push(d)}const u=Array.from(i.values()).map(({nodeId:d,nodeName:f,dirMap:h})=>{const y=Array.from(h.entries()).map(([g,x])=>({path:g,tasks:x})).sort((g,x)=>x.tasks.length-g.tasks.length||g.path.localeCompare(x.path));return{nodeId:d,nodeName:f,dirs:y}});return u.sort((d,f)=>{if(o){if(d.nodeId===o)return-1;if(f.nodeId===o)return 1}return d.nodeId===null?1:f.nodeId===null?-1:d.nodeName.localeCompare(f.nodeName)}),u}const w_={node:"border-teal-500/30 bg-teal-500/10 text-teal-700 dark:text-teal-300",task:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",election:"border-indigo-500/30 bg-indigo-500/10 text-indigo-700 dark:text-indigo-300",cluster:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",transport:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300"},E_={node:"text-teal-700/70 dark:text-teal-300/70",task:"text-amber-700/70 dark:text-amber-300/70",election:"text-indigo-700/70 dark:text-indigo-300/70",cluster:"text-emerald-700/70 dark:text-emerald-300/70",transport:"text-sky-700/70 dark:text-sky-300/70"};function N_(n){return n.split(".")[0]??"unknown"}function C_(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function Nr(n,l){return(l==null?void 0:l.get(n))??n}function Mx(n,l){const o=n.data,i=o.operation;switch(n.type){case"node.joined":return`${o.name} joined the cluster`;case"node.left":return`${Nr(o.nodeId,l)} left (${o.reason})`;case"node.status":return`${Nr(o.nodeId,l)} is now ${o.status}`;case"node.operation.created":return`${i==null?void 0:i.kind} ${i==null?void 0:i.status} on ${Nr(i==null?void 0:i.nodeId,l)}`;case"node.operation.updated":return`${i==null?void 0:i.kind} ${i==null?void 0:i.status} on ${Nr(i==null?void 0:i.nodeId,l)}`;case"transport.changed":return`${Nr(o.nodeId,l)} transport switched to ${o.transportType}`;case"task.created":return`"${o.title}" created`;case"task.assigned":return`task assigned to ${Nr(o.nodeId,l)}`;case"task.status":return`task ${o.taskId.slice(0,8)} -> ${o.status}`;case"election.started":return`candidate ${o.candidateId.slice(0,8)} term ${o.term}`;case"election.complete":return`leader elected, term ${o.term}`;case"cluster.state":return`${o.nodeCount} nodes, term ${o.term}`;default:return JSON.stringify(o)}}function T_(n){return JSON.stringify(n,null,2)}function R_({events:n,maxHeight:l="400px",nodeNameById:o,onDismiss:i,density:u="default"}){if(n.length===0)return null;const d=u==="compact";return m.jsx("div",{className:"overflow-y-auto pr-1",style:{maxHeight:l},children:m.jsx("div",{className:"space-y-1.5",children:n.map(f=>{const h=N_(f.type);return m.jsx("div",{className:fe("transition-colors hover:bg-muted/30",d?"rounded-[7px] px-1 py-0.5":"rounded-lg px-1.5 py-1"),children:m.jsxs("div",{className:"space-y-1",children:[m.jsxs("div",{className:"flex items-start justify-between gap-1.5",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx("div",{className:fe("font-mono text-muted-foreground",d?"text-[8px]":"text-[9px]"),children:C_(f.timestamp)}),d?m.jsx("span",{className:fe("max-w-[8.5rem] truncate text-[7px] font-medium uppercase tracking-[0.08em] text-muted-foreground/70",E_[h]),children:f.type}):m.jsx(yt,{variant:"outline",className:fe("w-fit text-[9px] font-medium uppercase tracking-[0.14em] px-1.5 py-0",w_[h]),children:f.type})]}),m.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[m.jsx(Qn,{type:"button",variant:"ghost",size:"icon",className:fe("rounded-[8px] text-muted-foreground",d?"h-4 w-4":"h-5 w-5"),onClick:()=>void S_(T_(f),"Event copied"),"aria-label":`Copy ${f.type} event`,title:"Copy event",children:m.jsx(jE,{className:d?"h-2.5 w-2.5":"h-3 w-3"})}),i&&m.jsx(Qn,{type:"button",variant:"ghost",size:"icon",className:fe("rounded-[8px] text-muted-foreground hover:text-foreground",d?"h-4 w-4":"h-5 w-5"),onClick:()=>i(f.id),"aria-label":`Dismiss ${f.type} event`,title:"Dismiss event",children:m.jsx(y0,{className:d?"h-2.5 w-2.5":"h-3 w-3"})})]})]}),m.jsx("div",{className:"text-[9px] leading-snug text-foreground/85",children:Mx(f,o)})]})},f.id)})})})}const A_=["node.","election.","transport."],__="cluster.state";function j_(n){return n.type==="node.status"?!1:A_.some(l=>n.type.startsWith(l))}function O_(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function M_(n,l){return n?{time:O_(n.timestamp),text:Mx(n,l)}:null}function D_(n){return n.transportType==="devtunnel"||!!n.devtunnelEndpoint}function k_(n){if(n.length===0)return"No node tunnel";const l=n.filter(u=>u.status==="offline").length;if(l>0)return`${l} offline`;const o=n.filter(u=>{var d;return((d=u.devtunnelHealth)==null?void 0:d.status)==="failed"}).length;if(o>0)return`${o} failed`;const i=n.filter(u=>{var d;return u.status!=="offline"&&((d=u.devtunnelHealth)==null?void 0:d.status)!=="healthy"}).length;return i>0?`${i} checking`:"Healthy"}function z_(n,l){var u;const o=(l==null?void 0:l.get(n.id))??n.name??n.id;if(n.status==="offline")return{label:o,status:"offline"};const i=((u=n.devtunnelHealth)==null?void 0:u.status)??"checking";return{label:o,status:i}}function L_(n){if(n.length===0)return"No nodes";const l=n.filter(i=>i.status==="offline").length;if(l>0)return`${l} offline`;const o=n.filter(i=>i.status==="busy").length;return o>0?`${o} busy`:"Healthy"}function U_(n,l){return{label:(l==null?void 0:l.get(n.id))??n.name??n.id,status:n.status}}function B_({connected:n,events:l,nodes:o=[],nodeNameById:i,defaultOpen:u=!1}){const[d,f]=v.useState(u),[h,y]=v.useState(!0),[g,x]=v.useState(new Set),p=v.useRef(null),w=v.useMemo(()=>l.filter(k=>j_(k)&&!g.has(k.id)),[l,g]),C=v.useMemo(()=>l.find(k=>k.type===__)??w[0],[l,w]),N=v.useMemo(()=>M_(C,i),[C,i]),E=v.useMemo(()=>o.filter(D_),[o]),R=E.some(k=>{var q;return k.status==="offline"||((q=k.devtunnelHealth)==null?void 0:q.status)==="failed"}),T=o.some(k=>k.status==="offline"),j=o.some(k=>k.status==="busy"),O=o.length>0;return v.useEffect(()=>{x(k=>{if(k.size===0)return k;const q=new Set(l.map(B=>B.id)),$=new Set(Array.from(k).filter(B=>q.has(B)));return $.size===k.size?k:$})},[l]),v.useEffect(()=>{if(!d)return;const k=$=>{var B;(B=p.current)!=null&&B.contains($.target)||f(!1)},q=$=>{$.key==="Escape"&&f(!1)};return document.addEventListener("pointerdown",k),document.addEventListener("keydown",q),()=>{document.removeEventListener("pointerdown",k),document.removeEventListener("keydown",q)}},[d]),m.jsxs("div",{ref:p,className:"relative",children:[m.jsxs("button",{type:"button","aria-expanded":d,"aria-haspopup":"dialog",onClick:()=>f(k=>!k),className:fe("flex items-center gap-1.5 rounded-[16px] border px-2 py-1.5 text-[11px] shadow-sm transition-all sm:gap-2 sm:px-3 sm:py-2 sm:text-xs",n?"border-emerald-500/25 bg-emerald-500/8 text-muted-foreground hover:border-emerald-500/40 hover:bg-emerald-500/12":"border-destructive/25 bg-destructive/8 text-muted-foreground hover:border-destructive/40 hover:bg-destructive/12",d&&"shadow-[0_14px_40px_-26px_rgba(16,185,129,0.95)]"),title:n?"Live link connected":"Live link reconnecting",children:[m.jsx(p0,{className:fe("h-3.5 w-3.5",n?"text-emerald-500":"text-destructive")}),n?"Live link":"Reconnecting"]}),d&&m.jsxs("div",{role:"dialog","aria-label":"Live link connection events",className:"absolute right-0 top-[calc(100%+0.4rem)] z-50 w-[18rem] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-[18px] border border-border/70 bg-background/96 shadow-[0_28px_90px_-42px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl max-sm:fixed max-sm:right-3 max-sm:top-[3.75rem] max-sm:w-[calc(100vw-1.5rem)]",children:[m.jsx("div",{className:"border-b border-border/60 bg-muted/25 px-2.5 py-1.5",children:m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[n?m.jsx(Ts,{className:"h-3 w-3 text-emerald-500"}):m.jsx(rN,{className:"h-3 w-3 text-destructive"}),m.jsx("span",{className:"text-[10px] font-semibold text-foreground",children:"Live link"}),m.jsx("span",{className:"text-[9px] text-muted-foreground",children:n?"· SSE connected":"· reconnecting"})]}),m.jsx("div",{className:fe("rounded-[9px] border px-1.5 py-0.5 text-[8px] font-medium uppercase tracking-[0.12em]",n?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"border-destructive/30 bg-destructive/10 text-destructive"),children:n?"Connected":"Retrying"})]})}),m.jsxs("div",{className:"grid grid-cols-2 border-b border-border/60",children:[m.jsxs("div",{className:"border-r border-border/60 px-2.5 py-1.5",children:[m.jsx("div",{className:"text-[8px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Events"}),m.jsx("div",{className:"mt-0.5 text-base font-semibold tracking-tight text-foreground",children:w.length})]}),m.jsxs("div",{className:"min-w-0 px-2.5 py-1.5",children:[m.jsx("div",{className:"text-[8px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Latest"}),N?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"mt-0.5 truncate text-[9px] leading-snug text-foreground/80",children:N.text}),m.jsx("div",{className:"font-mono text-[8px] text-muted-foreground/60",children:N.time})]}):m.jsx("div",{className:"mt-0.5 text-[8px] text-muted-foreground/50",children:"—"})]})]}),m.jsxs("div",{className:"border-b border-border/60 px-2.5 py-1.5",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[T?m.jsx(is,{className:"h-3 w-3 shrink-0 text-destructive"}):j?m.jsx(Ts,{className:"h-3 w-3 shrink-0 text-amber-500"}):m.jsx(zo,{className:fe("h-3 w-3 shrink-0",O?"text-emerald-500":"text-muted-foreground")}),m.jsx("span",{className:"text-[9px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Node health"})]}),m.jsx("span",{className:fe("shrink-0 rounded-[8px] border px-1.5 py-0.5 text-[8px] font-medium uppercase tracking-[0.1em]",T?"border-destructive/30 bg-destructive/10 text-destructive":j?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":O?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"border-border/70 bg-background/60 text-muted-foreground"),children:L_(o)})]}),o.length>0&&m.jsx("div",{className:"mt-1.5 flex flex-col gap-0.5",children:o.map(k=>{const{label:q,status:$}=U_(k,i),B=$==="offline",V=$==="busy";return m.jsxs("div",{"aria-label":`${q} ${$}`,className:fe("flex items-center justify-between gap-2 rounded-[7px] px-2 py-0.5",B?"bg-destructive/6":V?"bg-amber-500/6":"bg-emerald-500/5"),title:`${q} ${$}`,children:[m.jsx("span",{className:"truncate text-[9px] text-foreground/70",children:q}),B?m.jsx(is,{className:"h-3 w-3 shrink-0 text-destructive"}):V?m.jsx(Jg,{className:"h-3 w-3 shrink-0 text-amber-500"}):m.jsx(zo,{className:"h-3 w-3 shrink-0 text-emerald-500"})]},k.id)})})]}),E.length>0&&m.jsxs("div",{className:"border-b border-border/60 px-2.5 py-1.5",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[R?m.jsx(is,{className:"h-3 w-3 shrink-0 text-destructive"}):m.jsx(zo,{className:"h-3 w-3 shrink-0 text-emerald-500"}),m.jsx("span",{className:"text-[9px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"DevTunnel"})]}),m.jsx("span",{className:fe("shrink-0 rounded-[8px] border px-1.5 py-0.5 text-[8px] font-medium uppercase tracking-[0.1em]",R?"border-destructive/30 bg-destructive/10 text-destructive":"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"),children:k_(E)})]}),m.jsx("div",{className:"mt-1.5 flex flex-col gap-0.5",children:E.map(k=>{var le;const{label:q,status:$}=z_(k,i),B=$==="failed"||$==="offline",V=$!=="healthy"&&$!=="failed"&&$!=="offline",te=(le=k.devtunnelHealth)!=null&&le.reason?`${q} ${$}: ${k.devtunnelHealth.reason}`:`${q} ${$}`;return m.jsxs("div",{"aria-label":`${q} ${$}`,className:fe("flex items-center justify-between gap-2 rounded-[7px] px-2 py-0.5",B?"bg-destructive/6":V?"bg-muted/30":"bg-emerald-500/5"),title:te,children:[m.jsx("span",{className:"truncate text-[9px] text-foreground/70",children:q}),B?m.jsx(is,{className:"h-3 w-3 shrink-0 text-destructive"}):V?m.jsx(Jg,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):m.jsx(zo,{className:"h-3 w-3 shrink-0 text-emerald-500"})]},k.id)})})]}),m.jsxs("div",{children:[m.jsxs("button",{type:"button",onClick:()=>y(k=>!k),className:"flex w-full items-center justify-between px-2.5 py-1.5 text-left hover:bg-muted/30",children:[m.jsxs("span",{className:"text-[8px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:["Notifications ",w.length>0&&`(${w.length})`]}),h?m.jsx(Xs,{className:"h-3 w-3 text-muted-foreground"}):m.jsx(SE,{className:"h-3 w-3 text-muted-foreground"})]}),h&&m.jsx("div",{className:"px-2 pb-2",children:m.jsx(R_,{events:w,maxHeight:"12rem",density:"compact",emptyTitle:"No connection events yet",emptyDescription:"Node, election, and system events will appear here.",nodeNameById:i,onDismiss:k=>x(q=>new Set(q).add(k))})})]}),m.jsxs("div",{className:"flex items-center justify-end gap-1 border-t border-border/60 px-2.5 py-1",children:[m.jsx(Qn,{type:"button",variant:"ghost",size:"sm",className:"h-5 rounded-[9px] px-1.5 text-[9px]",onClick:()=>x(new Set(l.map(k=>k.id))),disabled:w.length===0,title:"Dismiss all notifications",children:"Dismiss all"}),m.jsx(Qn,{type:"button",variant:"ghost",size:"sm",className:"h-5 rounded-[9px] px-1.5 text-[9px]",onClick:()=>f(!1),children:"Close"})]})]})]})}const Dx=v.createContext(null);function H_({children:n}){const[l,o]=v.useState(()=>typeof window<"u"?localStorage.getItem("meshy-theme")??"system":"system"),[i,u]=v.useState(()=>typeof window<"u"?localStorage.getItem("meshy-palette")??"default":"default");return v.useEffect(()=>{const d=document.documentElement,f=h=>{if(h==="system"){const y=window.matchMedia("(prefers-color-scheme: dark)").matches;d.classList.toggle("dark",y)}else d.classList.toggle("dark",h==="dark")};if(f(l),localStorage.setItem("meshy-theme",l),l==="system"){const h=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>f("system");return h.addEventListener("change",y),()=>h.removeEventListener("change",y)}},[l]),v.useEffect(()=>{const d=document.documentElement;i==="default"?d.removeAttribute("data-palette"):d.setAttribute("data-palette",i),localStorage.setItem("meshy-palette",i)},[i]),m.jsx(Dx.Provider,{value:{theme:l,setTheme:o,palette:i,setPalette:u},children:n})}function V_(){const n=v.useContext(Dx);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}const q_=[{value:"light",label:"Light",icon:g0},{value:"dark",label:"Dark",icon:h0},{value:"system",label:"System",icon:m0}],Y_=[{value:"default",label:"Default",hint:"Porcelain + blue"},{value:"warm",label:"Warm",hint:"Cream + amber"},{value:"finsight",label:"FinSight",hint:"Cool sage green"},{value:"inshield",label:"inShield",hint:"Pure white + navy"},{value:"edge",label:"Edge",hint:"Rounded violet panels"}];function $_(){const{theme:n,setTheme:l,palette:o,setPalette:i}=V_(),[u,d]=v.useState(!1),f=v.useRef(null),h=v.useRef(null),y=n==="dark"?h0:n==="light"?g0:m0,g=()=>{f.current&&(clearTimeout(f.current),f.current=null)},x=()=>{g(),f.current=setTimeout(()=>d(!1),180)};return v.useEffect(()=>{if(!u)return;const p=w=>{h.current&&!h.current.contains(w.target)&&d(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[u]),v.useEffect(()=>()=>g(),[]),m.jsxs("div",{ref:h,className:"relative",onMouseEnter:()=>{g(),d(!0)},onMouseLeave:x,children:[m.jsx(Qn,{variant:"ghost",size:"icon",onClick:()=>d(p=>!p),className:fe("rounded-[16px] border bg-background/70",o==="default"?"border-border/60":"border-primary/60 text-primary"),title:"Appearance","aria-haspopup":"menu","aria-expanded":u,children:m.jsx(y,{className:"h-4 w-4"})}),u&&m.jsxs("div",{role:"menu",className:"absolute right-0 top-[calc(100%+8px)] z-50 w-64 rounded-[20px] border border-border/70 bg-popover/95 p-3 text-popover-foreground shadow-[0_24px_80px_-32px_rgba(0,0,0,0.35)] backdrop-blur-xl",children:[m.jsx("div",{className:"px-1 pb-1 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"Theme"}),m.jsx("div",{className:"mb-2 grid grid-cols-3 gap-1",children:q_.map(({value:p,label:w,icon:C})=>{const N=n===p;return m.jsxs("button",{type:"button",onClick:()=>l(p),className:fe("flex flex-col items-center gap-1 rounded-[14px] border px-2 py-2 text-[11px] font-medium transition-colors",N?"border-primary/50 bg-primary/10 text-primary":"border-border/60 text-muted-foreground hover:border-border hover:bg-muted/60 hover:text-foreground"),children:[m.jsx(C,{className:"h-4 w-4"}),w]},p)})}),m.jsxs("div",{className:"mt-2 flex items-center gap-1.5 px-1 pb-1 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:[m.jsx(tN,{className:"h-3 w-3"}),"Palette"]}),m.jsx("div",{className:"space-y-1",children:Y_.map(({value:p,label:w,hint:C})=>{const N=o===p;return m.jsxs("button",{type:"button",onClick:()=>i(p),className:fe("flex w-full items-center gap-2 rounded-[14px] border px-2.5 py-1.5 text-left transition-colors",N?"border-primary/50 bg-primary/10":"border-transparent hover:bg-muted/60"),children:[m.jsx(G_,{value:p}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:fe("text-[12px] font-medium",N?"text-primary":"text-foreground"),children:w}),m.jsx("div",{className:"text-[10px] text-muted-foreground",children:C})]}),N&&m.jsx(uf,{className:"h-3.5 w-3.5 text-primary"})]},p)})})]})]})}function G_({value:n}){const l={default:["hsl(212 76% 44%)","hsl(210 22% 98%)","hsl(174 42% 61%)"],warm:["hsl(35 88% 56%)","hsl(42 22% 97%)","hsl(160 60% 45%)"],finsight:["hsl(152 38% 32%)","hsl(150 14% 97%)","hsl(142 55% 58%)"],inshield:["hsl(220 25% 12%)","hsl(0 0% 100%)","hsl(195 80% 55%)"],edge:["hsl(265 75% 55%)","hsl(260 12% 98%)","hsl(285 70% 65%)"]},[o,i,u]=l[n];return m.jsxs("div",{className:fe("flex h-6 w-6 shrink-0 overflow-hidden border border-border/60",n==="edge"?"rounded-[10px]":"rounded-[12px]"),children:[m.jsx("div",{className:"h-full w-1/3",style:{background:o}}),m.jsx("div",{className:"h-full w-1/3",style:{background:i}}),m.jsx("div",{className:"h-full w-1/3",style:{background:u}})]})}function X_(){var y,g;const{cluster:n,events:l,sseConnected:o}=u0(),i=Kn(),[u,d]=v.useState(!1),f=i.pathname==="/"||/^\/tasks\/[^/]+$/.test(i.pathname),h=v.useMemo(()=>{const x=new Map;for(const p of(n==null?void 0:n.nodes)??[])x.set(p.id,p.name);return x},[n==null?void 0:n.nodes]);return m.jsxs("div",{className:"relative h-full overflow-hidden bg-background text-foreground",children:[m.jsx("div",{className:"mesh-grid pointer-events-none absolute inset-0"}),m.jsxs("div",{className:"relative z-10 flex h-full min-h-0 flex-col",children:[m.jsx("header",{className:"relative z-50 shrink-0 px-2 pb-2 pt-3 sm:px-5 sm:pb-3 sm:pt-4 lg:px-6",children:m.jsxs("div",{className:"dashboard-panel dashboard-panel-muted animate-panel-settle mx-auto flex max-w-[1760px] flex-wrap items-center justify-between gap-2 rounded-[22px] px-3 py-2 sm:gap-3 sm:rounded-[24px] sm:px-4 sm:py-3",children:[m.jsx("div",{className:"flex min-w-0 items-center gap-4",children:m.jsxs(o0,{to:"/",className:"flex items-center gap-3",children:[m.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-[15px] border border-border/70 bg-foreground text-xs font-semibold tracking-[0.24em] text-background shadow-sm sm:h-11 sm:w-11 sm:rounded-[17px] sm:text-sm",children:"M"}),m.jsxs("div",{className:"hidden min-w-0 sm:block",children:[m.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.34em] text-muted-foreground",children:"MESHY"}),m.jsx("div",{className:"truncate text-base font-semibold tracking-tight text-foreground",children:"Workspace"})]})]})}),m.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[m.jsxs("div",{className:"hidden items-center gap-2 rounded-[16px] border border-border/70 bg-background/70 px-3 py-2 text-xs text-muted-foreground shadow-sm sm:flex",children:[m.jsxs("span",{className:"flex items-center gap-2",children:[(n==null?void 0:n.self)&&m.jsx(L0,{status:n.self.status}),m.jsx("span",{className:"font-medium text-foreground",children:((y=n==null?void 0:n.self)==null?void 0:y.name)??"offline"})]}),m.jsx("span",{className:"text-border",children:"/"}),m.jsx("span",{className:"capitalize",children:((g=n==null?void 0:n.self)==null?void 0:g.role)??"node"})]}),m.jsx(B_,{connected:o,events:l,nodes:(n==null?void 0:n.nodes)??[],nodeNameById:h}),f&&m.jsx(Qn,{variant:"ghost",size:"icon",onClick:()=>d(x=>!x),"aria-label":u?"Close terminal":"Open terminal",title:u?"Close terminal":"Open terminal",className:fe("rounded-[16px] border bg-background/70 shadow-sm",u?"border-primary/50 bg-primary/10 text-primary":"border-border/70"),children:m.jsx(v0,{className:"h-4 w-4"})}),m.jsx(p_,{}),m.jsx($_,{})]})]})}),m.jsx("main",{className:fe("min-h-0 flex-1 px-3 pb-3 sm:px-5 lg:px-6",f?"overflow-hidden":"overflow-y-auto"),children:m.jsx("div",{className:"mx-auto h-full min-h-0 max-w-[1760px]",children:m.jsx(W2,{context:{terminalOpen:u,setTerminalOpen:d}})})})]})]})}const Uv=v.lazy(async()=>({default:(await Vv(()=>import("./DashboardPage-CT2ZnUEE.js").then(l=>l.D),__vite__mapDeps([0,1,2,3]))).DashboardPage})),Q_=v.lazy(async()=>({default:(await Vv(()=>import("./SharedConversationPage-Braz3WkI.js"),__vite__mapDeps([4,1]))).SharedConversationPage}));function K_(){return m.jsx(Cw,{children:m.jsx(v.Suspense,{fallback:m.jsx(Z_,{}),children:m.jsxs(tw,{children:[m.jsx(Al,{path:"/shared/tasks/:shareId",element:m.jsx(Q_,{})}),m.jsxs(Al,{element:m.jsx(rE,{children:m.jsx(X_,{})}),children:[m.jsx(Al,{path:"/",element:m.jsx(Uv,{})}),m.jsx(Al,{path:"/nodes",element:m.jsx(Pg,{to:"/",replace:!0})}),m.jsx(Al,{path:"/tasks",element:m.jsx(Pg,{to:"/",replace:!0})}),m.jsx(Al,{path:"/tasks/:id",element:m.jsx(Uv,{})})]})]})})})}function Z_(){return m.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading workspace..."})}function P_(n){return m.jsx(RC,{className:"toaster group",style:{"--normal-bg":"hsl(var(--popover))","--normal-text":"hsl(var(--popover-foreground))","--normal-border":"hsl(var(--border))"},...n})}e2.createRoot(document.getElementById("root")).render(m.jsx(v.StrictMode,{children:m.jsxs(H_,{children:[m.jsx(K_,{}),m.jsx(P_,{})]})}));export{Vv as $,jE as A,Qn as B,uf as C,$3 as D,S_ as E,LE as F,x_ as G,RA as H,Ax as I,yt as J,V3 as K,Wb as L,Es as M,lj as N,Ns as O,q3 as P,Wd as Q,zs as R,Cr as S,G3 as T,Ls as U,Bs as V,Hs as W,y0 as X,Us as Y,qs as Z,Vs as _,OC as a,W_ as a$,e3 as a0,xy as a1,p5 as a2,m3 as a3,v0 as a4,zo as a5,AE as a6,f3 as a7,h3 as a8,d3 as a9,E3 as aA,l3 as aB,n3 as aC,wy as aD,a3 as aE,r3 as aF,qw as aG,p_ as aH,F_ as aI,Kn as aJ,Fv as aK,I_ as aL,u0 as aM,ej as aN,J3 as aO,Z3 as aP,P3 as aQ,F3 as aR,I3 as aS,g3 as aT,X3 as aU,y_ as aV,N3 as aW,S3 as aX,w3 as aY,x3 as aZ,b3 as a_,FE as aa,VE as ab,W3 as ac,p0 as ad,R_ as ae,L0 as af,kE as ag,JN as ah,rj as ai,v_ as aj,oj as ak,Q3 as al,K3 as am,Rx as an,nj as ao,tj as ap,aj as aq,ef as ar,C3 as as,T3 as at,p3 as au,Jw as av,Qw as aw,H3 as ax,B3 as ay,tE as az,fe as b,t3 as b0,J_ as b1,o3 as b2,O3 as b3,j3 as b4,_3 as b5,R3 as b6,A3 as b7,M3 as b8,EE as b9,Bv as ba,z3 as bb,k3 as bc,D3 as bd,KE as be,L3 as bf,Y3 as bg,U3 as bh,Ye as c,z0 as d,u3 as e,Vw as f,s3 as g,i3 as h,SE as i,m as j,c3 as k,y3 as l,jb as m,Lf as n,Ob as o,Uf as p,f0 as q,v as r,Xs as s,wt as t,g_ as u,tN as v,v3 as w,f5 as x,by as y,Sy as z};
|
|
301
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{var i;document.getElementById((i=n.current)==null?void 0:i.getAttribute("aria-describedby"))||console.warn(l)},[l,n]),null},UA=tx,BA=nx,HA=ax,mx=lx,hx=rx,px=ux,gx=fx,vx=ix,yx=cx;const Wd=UA,ef=BA,VA=HA,bx=v.forwardRef(({className:n,...l},o)=>m.jsx(mx,{className:fe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...l,ref:o}));bx.displayName=mx.displayName;const zs=v.forwardRef(({className:n,...l},o)=>m.jsxs(VA,{children:[m.jsx(bx,{}),m.jsx(hx,{ref:o,className:fe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-[22px] border bg-background p-6 shadow-[0_34px_110px_-54px_rgba(0,0,0,0.55)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",n),...l})]}));zs.displayName=hx.displayName;const Ls=({className:n,...l})=>m.jsx("div",{className:fe("flex flex-col space-y-2 text-center sm:text-left",n),...l});Ls.displayName="AlertDialogHeader";const Us=({className:n,...l})=>m.jsx("div",{className:fe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...l});Us.displayName="AlertDialogFooter";const Bs=v.forwardRef(({className:n,...l},o)=>m.jsx(vx,{ref:o,className:fe("text-lg font-semibold",n),...l}));Bs.displayName=vx.displayName;const Hs=v.forwardRef(({className:n,...l},o)=>m.jsx(yx,{ref:o,className:fe("text-sm text-muted-foreground",n),...l}));Hs.displayName=yx.displayName;const Vs=v.forwardRef(({className:n,...l},o)=>m.jsx(px,{ref:o,className:fe(hf(),n),...l}));Vs.displayName=px.displayName;const qs=v.forwardRef(({className:n,...l},o)=>m.jsx(gx,{ref:o,className:fe(hf({variant:"outline"}),"mt-2 sm:mt-0",n),...l}));qs.displayName=gx.displayName;var ac="Checkbox",[qA]=tl(ac),[YA,Hf]=qA(ac);function $A(n){const{__scopeCheckbox:l,checked:o,children:i,defaultChecked:u,disabled:d,form:f,name:h,onCheckedChange:y,required:g,value:x="on",internal_do_not_use_render:p}=n,[w,C]=_r({prop:o,defaultProp:u??!1,onChange:y,caller:ac}),[N,E]=v.useState(null),[R,T]=v.useState(null),j=v.useRef(!1),O=N?!!f||!!N.closest("form"):!0,k={checked:w,disabled:d,setChecked:C,control:N,setControl:E,name:h,form:f,value:x,hasConsumerStoppedPropagationRef:j,required:g,defaultChecked:Ia(u)?!1:u,isFormControl:O,bubbleInput:R,setBubbleInput:T};return m.jsx(YA,{scope:l,...k,children:GA(p)?p(k):i})}var xx="CheckboxTrigger",Sx=v.forwardRef(({__scopeCheckbox:n,onKeyDown:l,onClick:o,...i},u)=>{const{control:d,value:f,disabled:h,checked:y,required:g,setControl:x,setChecked:p,hasConsumerStoppedPropagationRef:w,isFormControl:C,bubbleInput:N}=Hf(xx,n),E=Fe(u,x),R=v.useRef(y);return v.useEffect(()=>{const T=d==null?void 0:d.form;if(T){const j=()=>p(R.current);return T.addEventListener("reset",j),()=>T.removeEventListener("reset",j)}},[d,p]),m.jsx(Ue.button,{type:"button",role:"checkbox","aria-checked":Ia(y)?"mixed":y,"aria-required":g,"data-state":Tx(y),"data-disabled":h?"":void 0,disabled:h,value:f,...i,ref:E,onKeyDown:Me(l,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:Me(o,T=>{p(j=>Ia(j)?!0:!j),N&&C&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})});Sx.displayName=xx;var Vf=v.forwardRef((n,l)=>{const{__scopeCheckbox:o,name:i,checked:u,defaultChecked:d,required:f,disabled:h,value:y,onCheckedChange:g,form:x,...p}=n;return m.jsx($A,{__scopeCheckbox:o,checked:u,defaultChecked:d,disabled:h,required:f,onCheckedChange:g,name:i,form:x,value:y,internal_do_not_use_render:({isFormControl:w})=>m.jsxs(m.Fragment,{children:[m.jsx(Sx,{...p,ref:l,__scopeCheckbox:o}),w&&m.jsx(Cx,{__scopeCheckbox:o})]})})});Vf.displayName=ac;var wx="CheckboxIndicator",Ex=v.forwardRef((n,l)=>{const{__scopeCheckbox:o,forceMount:i,...u}=n,d=Hf(wx,o);return m.jsx(kr,{present:i||Ia(d.checked)||d.checked===!0,children:m.jsx(Ue.span,{"data-state":Tx(d.checked),"data-disabled":d.disabled?"":void 0,...u,ref:l,style:{pointerEvents:"none",...n.style}})})});Ex.displayName=wx;var Nx="CheckboxBubbleInput",Cx=v.forwardRef(({__scopeCheckbox:n,...l},o)=>{const{control:i,hasConsumerStoppedPropagationRef:u,checked:d,defaultChecked:f,required:h,disabled:y,name:g,value:x,form:p,bubbleInput:w,setBubbleInput:C}=Hf(Nx,n),N=Fe(o,C),E=Ky(d),R=Ly(i);v.useEffect(()=>{const j=w;if(!j)return;const O=window.HTMLInputElement.prototype,q=Object.getOwnPropertyDescriptor(O,"checked").set,$=!u.current;if(E!==d&&q){const B=new Event("click",{bubbles:$});j.indeterminate=Ia(d),q.call(j,Ia(d)?!1:d),j.dispatchEvent(B)}},[w,E,d,u]);const T=v.useRef(Ia(d)?!1:d);return m.jsx(Ue.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??T.current,required:h,disabled:y,name:g,value:x,form:p,...l,tabIndex:-1,ref:N,style:{...l.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Cx.displayName=Nx;function GA(n){return typeof n=="function"}function Ia(n){return n==="indeterminate"}function Tx(n){return Ia(n)?"indeterminate":n?"checked":"unchecked"}const Rx=v.forwardRef(({className:n,...l},o)=>m.jsx(Vf,{ref:o,className:fe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n),...l,children:m.jsx(Ex,{className:fe("flex items-center justify-center text-current"),children:m.jsx(uf,{className:"h-3.5 w-3.5"})})}));Rx.displayName=Vf.displayName;const Ax=v.forwardRef(({className:n,type:l,...o},i)=>m.jsx("input",{type:l,className:fe("flex h-10 w-full rounded-[16px] border border-input/85 bg-background/72 px-3 py-2 text-sm shadow-sm ring-offset-background transition-all duration-200 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground/75 focus-visible:border-primary/45 focus-visible:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/45 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),ref:i,...o}));Ax.displayName="Input";const kv=["queued","running"];function XA(n){return n.map(l=>`${l.id}:${l.name}`).join("\0")}function QA(n){return n==="claude"||n==="codex"}function _x(n){var o;if(n.kind!=="agent.upgrade")return null;const l=(o=n.payload)==null?void 0:o.agent;return QA(l)?`${n.nodeId}:${l}`:null}function KA(n){return n.status==="succeeded"||n.status==="failed"}async function jx(n,l={}){const o=l.getOperation??Vw,i=l.pollIntervalMs??2e3,u=l.timeoutMs??24e4,d=Date.now()+u;let f=n;for(;!KA(f)&&Date.now()<d;)await PA(i),f=await o(n.id);return f}async function ZA(n,l=qw){const o=new Set(n),i=await Promise.all(kv.map(d=>l({kind:"agent.upgrade",status:d}))),u=new Map;for(const d of i.flat()){if(!kv.includes(d.status)||o.size>0&&!o.has(d.nodeId))continue;const f=_x(d);if(!f)continue;const h=u.get(f);(!h||d.updatedAt>h.updatedAt)&&u.set(f,d)}return u}function PA(n){return new Promise(l=>setTimeout(l,n))}function IA(n,l=!0){return l?(n==null?void 0:n.restartMode)==="development"?"Restart dev runtime":n!=null&&n.updateAvailable?"Update & restart":"Restart runtime":n!=null&&n.updateAvailable?"Update & restart follower":"Restart follower"}function FA({checkedLabel:n,disableAuthDefault:l,endpoint:o,isLiveLocalNode:i,nodeId:u,nodeName:d,pid:f,transportType:h,update:y,workDir:g}){const x=IA(y,i),[p,w]=v.useState(null),[C,N]=v.useState(()=>zv({disableAuthDefault:l,endpoint:o,nodeName:d,transportType:h,workDir:g})),[E,R]=v.useState(!1),[T,j]=v.useState(!1),[O,k]=v.useState(!1);v.useEffect(()=>{N(zv({disableAuthDefault:l,endpoint:o,nodeName:d,transportType:h,workDir:g}))},[l,o,d,h,g]);async function q(){if(!u||E||T)return;const te=y.updateAvailable?"update":"restart",le=e_(C);if(C.port.trim()&&(le==null?void 0:le.port)===void 0){wt.error("Runtime restart port must be a positive integer");return}const ve=le?{reason:te,startArgs:le}:{reason:te};R(!0);try{if(i){const ue=await Uw(ve);w({...ue,pid:ue.pid??f,status:"accepted"}),wt.info(`Restarting ${d} from a detached helper. PID ${ue.pid??f??"unknown"} will not stay attached to the original terminal window; follow ${ue.logPath} for launch output.`);return}const ie=await $w(u,ve);w({operationId:ie.id,pid:f,status:ie.status}),wt.info(`Restart requested on ${d}. Operation ${Ud(ie.id)} will hand off to a detached process, so the new runtime will not stay attached to the original terminal window.`);const ce=await jx(ie,{timeoutMs:6e4}),re=WA(ce);w({command:re==null?void 0:re.command,logPath:re==null?void 0:re.logPath,mode:re==null?void 0:re.mode,operationId:ce.id,pid:(re==null?void 0:re.pid)??f,status:ce.status}),ce.status==="succeeded"?wt.success(`Restart handoff accepted on ${d}. Follow ${(re==null?void 0:re.logPath)??"the node restart log"} for launch output.`):ce.status==="failed"?wt.error(ce.error??`Restart failed on ${d}`):wt.info(`Restart operation ${Ud(ce.id)} is still ${ce.status}. More details will update after the node reports back.`),R(!1)}catch(ie){R(!1),wt.error(ie instanceof Error?ie.message:"Runtime restart failed")}}async function $(){if(!(!i||E||T)){j(!0);try{const te=await Bw();wt.info(`Stopping Meshy process ${te.pid}`)}catch(te){j(!1),wt.error(te instanceof Error?te.message:"Runtime stop failed")}}}const B=E?"restarting":T?"stopping":(p==null?void 0:p.status)??"idle",V=y.restartMode==="development";return m.jsxs("div",{className:"rounded-xl border border-border/70 bg-background/70 overflow-hidden",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border/50",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Ts,{className:"h-3.5 w-3.5 text-primary shrink-0"}),m.jsxs("div",{children:[m.jsx("div",{className:"text-[11px] font-semibold text-foreground leading-tight",children:"Runtime"}),m.jsx("div",{className:"text-[10px] text-muted-foreground leading-tight",children:V?"Development launcher":`Latest ${y.latestVersion??"—"}`})]})]}),m.jsx("div",{className:"flex items-center gap-1.5",children:m.jsx(yt,{variant:y.updateAvailable?"default":"outline",className:"rounded-full border-border/70 bg-background/60 font-mono text-[10px] px-2 py-0.5",children:V?"dev":y.updateAvailable?`→ ${y.latestVersion}`:"current"})})]}),m.jsxs("div",{className:"grid grid-cols-2 divide-x divide-border/50 border-b border-border/50",children:[m.jsxs("div",{className:"px-3 py-1.5",children:[m.jsx("div",{className:"text-[9px] uppercase tracking-[0.16em] text-muted-foreground",children:"PID"}),m.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-foreground",children:f??"—"})]}),m.jsxs("div",{className:"px-3 py-1.5",children:[m.jsx("div",{className:"text-[9px] uppercase tracking-[0.16em] text-muted-foreground",children:"Status"}),m.jsx("div",{className:"mt-0.5 text-[11px] text-foreground capitalize",children:B})]})]}),m.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2",children:[m.jsxs("div",{className:"text-[10px] text-muted-foreground",children:["Checked ",n]}),m.jsxs("div",{className:"flex items-center gap-1.5",children:[i&&m.jsxs(Wd,{children:[m.jsx(ef,{asChild:!0,children:m.jsxs(Qn,{type:"button",size:"sm",variant:"ghost",disabled:E||T,className:"h-7 rounded-lg px-2 text-[11px] text-muted-foreground hover:text-destructive hover:bg-destructive/10",children:[m.jsx(GE,{className:fe("mr-1 h-3.5 w-3.5",T&&"animate-pulse")}),T?"Stopping":"Stop"]})}),m.jsxs(zs,{className:"max-w-[22rem] rounded-xl gap-2 p-4",children:[m.jsxs(Ls,{className:"space-y-1",children:[m.jsx(Bs,{className:"text-sm",children:"Stop runtime?"}),m.jsx(Hs,{className:"text-[11px] leading-4",children:"Gracefully stops the current Meshy process without launching a replacement. The dashboard will disconnect until the node is started again."})]}),m.jsxs(Us,{className:"gap-1 pt-0 sm:space-x-1",children:[m.jsx(qs,{className:"h-7 rounded-lg px-2 text-[11px]",children:"Cancel"}),m.jsx(Vs,{className:"h-7 rounded-lg px-2 text-[11px] bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>void $(),children:"Stop runtime"})]})]})]}),m.jsxs(Wd,{children:[m.jsx(ef,{asChild:!0,children:m.jsxs(Qn,{type:"button",size:"sm",variant:y.updateAvailable?"default":"outline",disabled:!u||E||T,className:"h-7 rounded-lg px-2 text-[11px]",children:[m.jsx(KE,{className:fe("mr-1 h-3.5 w-3.5",E&&"animate-spin")}),E?"Restarting…":x]})}),m.jsxs(zs,{className:"max-w-[28rem] gap-3 rounded-xl p-4",children:[m.jsxs(Ls,{className:"space-y-1",children:[m.jsxs(Bs,{className:"text-sm",children:[x,"?"]}),m.jsxs(Hs,{className:"text-[11px] leading-4",children:["Starts a detached restart helper, shuts down ",i?"the current node":d,", and brings it back with the configured launcher. The new process will not stay attached to the original terminal window."]})]}),m.jsx(JA,{value:C,onChange:N}),m.jsxs(Us,{className:"gap-1 pt-0 sm:space-x-1",children:[m.jsx(qs,{className:"h-7 rounded-lg px-2 text-[11px]",children:"Cancel"}),m.jsx(Vs,{className:"h-7 rounded-lg px-2 text-[11px]",onClick:()=>void q(),children:x})]})]})]})]})]}),m.jsxs("div",{className:"border-t border-border/50",children:[m.jsxs("button",{type:"button",onClick:()=>k(te=>!te),className:"flex w-full items-center justify-between px-3 py-1.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors",children:[m.jsxs("span",{className:"flex items-center gap-1.5",children:[m.jsx(v0,{className:"h-3 w-3"}),"Restart details"]}),m.jsx(Xs,{className:fe("h-3 w-3 transition-transform duration-150",O&&"rotate-180")})]}),O&&m.jsxs("div",{className:"border-t border-border/50 bg-muted/20 px-3 py-2 space-y-1",children:[m.jsx(Rl,{label:"Current PID",value:f===void 0?"—":String(f),mono:f!==void 0}),m.jsx(Rl,{label:"Restart PID",value:(p==null?void 0:p.pid)===void 0?"Pending":String(p.pid),mono:(p==null?void 0:p.pid)!==void 0}),m.jsx(Rl,{label:"Operation",value:p!=null&&p.operationId?Ud(p.operationId):"Local direct request",mono:!!(p!=null&&p.operationId)}),m.jsx(Rl,{label:"Status",value:(p==null?void 0:p.status)??(E?"requested":"idle")}),m.jsx(Rl,{label:"Launcher",value:(p==null?void 0:p.command)??"Available after restart",mono:!!(p!=null&&p.command)}),m.jsx(Rl,{label:"Log",value:(p==null?void 0:p.logPath)??"Available after restart",mono:!!(p!=null&&p.logPath)}),m.jsx(Rl,{label:"Terminal",value:"New process is detached from original terminal"})]})]}),y.detail&&m.jsx("div",{className:"border-t border-border/50 px-3 py-1.5 text-[10px] text-muted-foreground bg-muted/20",children:y.detail})]})}function JA({onChange:n,value:l}){const o=(i,u)=>{n({...l,[i]:u})};return m.jsxs("div",{className:"rounded-lg border border-border/70 bg-muted/30 p-3 space-y-3",children:[m.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:"Startup arguments"}),m.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[m.jsx(ko,{label:"HTTP port",value:l.port,onChange:i=>o("port",i),inputMode:"numeric"}),m.jsx(ko,{label:"Node name",value:l.name,onChange:i=>o("name",i)}),m.jsx(ko,{label:"Join endpoint",value:l.join,onChange:i=>o("join",i),className:"sm:col-span-2"}),m.jsxs("div",{className:"space-y-1",children:[m.jsx("label",{className:"text-[9px] uppercase tracking-[0.14em] text-muted-foreground",children:"Transport"}),m.jsxs(jb,{value:l.transport,onValueChange:i=>o("transport",Ox(i)),children:[m.jsx(Lf,{className:"h-7 rounded-md border-border/70 bg-background/70 px-2 text-[10px]",children:m.jsx(Ob,{placeholder:"Transport"})}),m.jsxs(Uf,{children:[m.jsx(Cr,{className:"py-1 text-[11px]",value:"inherit",children:"current / default"}),m.jsx(Cr,{className:"py-1 text-[11px]",value:"direct",children:"direct"}),m.jsx(Cr,{className:"py-1 text-[11px]",value:"devtunnel",children:"devtunnel"}),m.jsx(Cr,{className:"py-1 text-[11px]",value:"tailscale",children:"tailscale"})]})]})]}),m.jsx(ko,{label:"Working directory",value:l.workDir,onChange:i=>o("workDir",i)}),m.jsx(ko,{label:"Config path",value:l.config,onChange:i=>o("config",i),className:"sm:col-span-2"}),m.jsxs("label",{className:"flex items-center gap-2 rounded-md border border-border/60 bg-background/60 px-2 py-1.5 text-[10px] text-foreground sm:col-span-2 cursor-pointer hover:bg-muted/40 transition-colors",children:[m.jsx(Rx,{className:"h-3.5 w-3.5",checked:l.disableAuth,onCheckedChange:i=>n({...l,disableAuth:i===!0,disableAuthKnown:!0})}),"Disable auth"]})]})]})}function ko({className:n,inputMode:l,label:o,onChange:i,value:u}){return m.jsxs("label",{className:fe("space-y-1",n),children:[m.jsx("span",{className:"text-[9px] uppercase tracking-[0.14em] text-muted-foreground",children:o}),m.jsx(Ax,{className:"h-7 rounded-md px-2 text-[10px]",inputMode:l,value:u,onChange:d=>i(d.target.value)})]})}function Rl({label:n,value:l,mono:o=!1}){return m.jsxs("div",{className:"flex items-start justify-between gap-3 text-[10px]",children:[m.jsx("span",{className:"shrink-0 uppercase tracking-[0.14em] text-muted-foreground",children:n}),m.jsx("span",{className:fe("break-all text-right text-foreground",o&&"font-mono"),children:l})]})}function WA(n){const l=n.result;if(!l||typeof l!="object")return null;const o=l;return o.ok!==!0||typeof o.command!="string"||typeof o.logPath!="string"?null:{ok:!0,mode:o.mode==="package"?"package":"development",command:o.command,logPath:o.logPath,pid:typeof o.pid=="number"?o.pid:void 0}}function zv(n){return{port:t_(n.endpoint),name:n.nodeName,join:"",transport:Ox(n.transportType),workDir:n.workDir??"",config:"",disableAuth:n.disableAuthDefault===!0,disableAuthKnown:n.disableAuthDefault!==void 0}}function e_(n){const l={},o=Number(n.port.trim());return n.port.trim()&&Number.isInteger(o)&&o>0&&(l.port=o),n.name.trim()&&(l.name=n.name.trim()),n.join.trim()&&(l.join=n.join.trim()),n.transport!=="inherit"&&(l.transport=n.transport),n.workDir.trim()&&(l.workDir=n.workDir.trim()),n.config.trim()&&(l.config=n.config.trim()),n.disableAuthKnown&&(l.disableAuth=n.disableAuth),Object.keys(l).length>0?l:void 0}function Ox(n){return n==="direct"||n==="devtunnel"||n==="tailscale"?n:"inherit"}function t_(n){if(!n)return"";try{return new URL(n).port||""}catch{return""}}function Ud(n){return n.length<=8?n:n.slice(0,8)}function vs({formatDateTime:n,name:l,status:o,statusVariant:i}){return m.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-border/60 bg-background/70 px-2.5 py-1.5",children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-[11px] font-medium text-foreground",children:l}),m.jsx("div",{className:"text-[10px] text-muted-foreground",children:n(o==null?void 0:o.checkedAt)})]}),m.jsxs("div",{className:"flex items-center gap-1.5",children:[typeof(o==null?void 0:o.authenticated)=="boolean"&&m.jsx(yt,{variant:o.authenticated?"default":"outline",className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:o.authenticated?"auth ok":"auth required"}),m.jsx(yt,{variant:i(o==null?void 0:o.status),className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:(o==null?void 0:o.status)??"unknown"})]})]})}function vn(n){if(n==null||n==="")return"Unavailable";const l=new Date(n);return Number.isNaN(l.getTime())?"Unavailable":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(l)}function n_(n){const l=Math.max(0,Math.floor(n)),o=Math.floor(l/86400),i=Math.floor(l%86400/3600),u=Math.floor(l%3600/60);return o>0?`${o}d ${i}h`:i>0?`${i}h ${u}m`:`${u}m`}function Lv(n){if(n==null||Number.isNaN(n))return"Unavailable";const l=["B","KB","MB","GB","TB"];let o=n,i=0;for(;o>=1024&&i<l.length-1;)o/=1024,i+=1;return`${o.toFixed(o>=10||i===0?0:1)} ${l[i]}`}function Uo(n){return n==="ok"?"default":n==="missing"||n==="install-failed"||n==="login-failed"?"destructive":n==="not-authenticated"||n==="unsupported-platform"?"outline":"secondary"}function a_(n){return n.available?m.jsxs(yt,{className:"gap-1 rounded-full px-2 py-0.5 text-[10px]",children:[m.jsx(zo,{className:"h-3 w-3"}),"Available"]}):m.jsxs(yt,{variant:"destructive",className:"gap-1 rounded-full px-2 py-0.5 text-[10px]",children:[m.jsx(AE,{className:"h-3 w-3"}),"Unavailable"]})}function l_(n){return n.update?n.update.updateAvailable?m.jsxs(yt,{variant:"outline",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.14em]",children:["Update ",n.update.latestVersion]}):m.jsx(yt,{variant:"secondary",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.14em]",children:"Up to date"}):null}function r_(n){var o;const l=`npm install -g ${(o=n.update)==null?void 0:o.packageName}@latest`;return n.id==="claude"?`${l} --include=optional --ignore-scripts=false`:l}function o_(n){if(n.error)return n.error;const l=n.result;return(l==null?void 0:l.detail)??null}function Le({label:n,value:l,mono:o=!1}){return m.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border/50 py-1 last:border-b-0 last:pb-0 first:pt-0",children:[m.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:n}),m.jsx("span",{className:fe("break-all text-right text-[11px] text-foreground",o&&"font-mono text-[11px]"),children:l})]})}function i_({agent:n,nodeName:l,activeOperation:o,onUpgrade:i}){var h,y;const u=((h=n.update)==null?void 0:h.updateAvailable)===!0,d=l_(n),f=!!o;return m.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/70 p-2.5 shadow-sm",children:[m.jsxs("div",{className:"flex items-start justify-between gap-2",children:[m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-semibold text-foreground",children:[m.jsx(f0,{className:"h-3.5 w-3.5 text-primary"}),n.label]}),m.jsxs("div",{className:"mt-0.5 text-[10px] text-muted-foreground",children:["Command: ",m.jsx("span",{className:"font-mono text-[10px]",children:n.command})]})]}),m.jsxs("div",{className:"flex flex-col items-end gap-1",children:[a_(n),o?m.jsxs(yt,{variant:"outline",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.14em]",children:["Upgrade ",o.status]}):u?m.jsxs(Wd,{children:[m.jsx(ef,{asChild:!0,children:m.jsx("button",{type:"button",disabled:f,className:"rounded-full transition duration-150 hover:-translate-y-0.5 hover:scale-[1.03] hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/45 focus-visible:ring-offset-2 active:translate-y-0 active:scale-95 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:scale-100 disabled:hover:shadow-none",children:d})}),m.jsxs(zs,{children:[m.jsxs(Ls,{children:[m.jsxs(Bs,{children:["Upgrade ",n.label,"?"]}),m.jsxs(Hs,{children:["This runs ",r_(n)," on ",l,". Remote nodes execute the command on the remote machine."]})]}),m.jsxs(Us,{children:[m.jsx(qs,{children:"Cancel"}),m.jsx(Vs,{onClick:()=>i(n),children:"Upgrade"})]})]})]}):d]})]}),m.jsxs("div",{className:"mt-2 space-y-1 text-[11px]",children:[m.jsx(Le,{label:"Version",value:n.version??"Unavailable",mono:!!n.version}),n.update&&m.jsx(Le,{label:"Latest",value:n.update.latestVersion??"Unavailable",mono:!!n.update.latestVersion}),m.jsx(Le,{label:"Path",value:n.path??"Not on PATH",mono:!!n.path}),m.jsx(Le,{label:"Checked",value:vn(n.checkedAt)}),n.update&&m.jsx(Le,{label:"Update check",value:vn(n.update.checkedAt)})]}),((y=n.update)==null?void 0:y.detail)&&m.jsx("div",{className:"mt-1.5 rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[10px] text-muted-foreground",children:n.update.detail}),n.metadataStatus&&m.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[m.jsx(yt,{variant:Uo(n.metadataStatus),className:"rounded-full px-2 py-0 text-[10px] uppercase tracking-[0.14em]",children:n.metadataStatus}),m.jsx("span",{children:"Startup preflight"})]}),n.detail&&m.jsx("div",{className:"mt-1.5 rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[10px] text-muted-foreground",children:n.detail})]})}function s_(n){return[{key:"workspace",label:"Workspace",value:n==null?void 0:n.workspace},{key:"node",label:"Node app",value:n==null?void 0:n.node},{key:"core",label:"Core",value:n==null?void 0:n.core},{key:"dashboard",label:"Dashboard",value:n==null?void 0:n.dashboard},{key:"api",label:"API",value:n==null?void 0:n.api}].filter(o=>o.value)}function c_(n,l){var o;return(o=n==null?void 0:n.nodes)!=null&&o.length?n.nodes:l?[l]:[]}function u_(n,l){var i;if(l&&n.id===l.nodeId)return l;const o=n.settingsSnapshot;return{...n,nodeId:n.id,version:(o==null?void 0:o.version)??"Unavailable",packageName:o==null?void 0:o.packageName,uptime:(o==null?void 0:o.uptime)??0,localDashboardOrigin:((i=o==null?void 0:o.runtime)==null?void 0:i.localDashboardOrigin)??void 0,auth:o==null?void 0:o.auth,os:o==null?void 0:o.os,runtime:o==null?void 0:o.runtime,runtimeUpdate:o==null?void 0:o.runtimeUpdate,agents:o==null?void 0:o.agents,startupRequirements:o==null?void 0:o.startupRequirements,components:o==null?void 0:o.components,repository:o==null?void 0:o.repository,packages:o==null?void 0:o.packages}}function d_(n,l){return n.id===l?`${n.name} (this node)`:`${n.name} (${n.role})`}function f_(n){return n==="claude"?"Claude Code":"Codex"}function m_(n){var o;const l=(o=n.payload)==null?void 0:o.agent;return l==="claude"||l==="codex"?l:null}function h_({cluster:n,systemInfo:l,sseConnected:o,initialSelectedNodeId:i,onRefresh:u}){var le,ve,ie,ce,re,ue,M,G,I,se,F,_,X,K,J,W,ae,ee,oe,de,Te,Ee,we,Je,$e,zt,Mt;const d=v.useMemo(()=>c_(n,l),[n,l]),[f,h]=v.useState(()=>{var ye;return i??(l==null?void 0:l.nodeId)??((ye=n==null?void 0:n.self)==null?void 0:ye.id)??""}),[y,g]=v.useState(()=>new Map),x=v.useRef(new Set),p=v.useRef(new Set),w=(n==null?void 0:n.self)??l??d[0]??null,C=d.find(ye=>ye.id===f)??w,N=C?u_(C,l):null,E=!!(l&&C&&C.id===l.nodeId),R=E||!!(C!=null&&C.settingsSnapshot),T=v.useMemo(()=>s_(N==null?void 0:N.packages),[N==null?void 0:N.packages]),j=N==null?void 0:N.runtimeUpdate,O=((le=N==null?void 0:N.startupRequirements)==null?void 0:le.components)??(N==null?void 0:N.components)??{},k=v.useMemo(()=>d.map(ye=>ye.id),[d]),q=k.join("\0"),$=XA(d),B=v.useMemo(()=>new Map(d.map(ye=>[ye.id,ye.name])),[$]);v.useEffect(()=>{i&&k.includes(i)&&h(i)},[i,q]);const V=v.useCallback(async(ye,tt)=>{const Be=_x(ye);if(!Be||x.current.has(ye.id))return;const rn=m_(ye),Kt=(tt==null?void 0:tt.agentLabel)??(rn?f_(rn):"Agent"),dt=(tt==null?void 0:tt.nodeName)??B.get(ye.nodeId)??ye.nodeId;x.current.add(ye.id),g(Ie=>new Map(Ie).set(Be,ye));try{const Ie=await jx(ye);if(Ie.status==="succeeded")await(u==null?void 0:u()),p.current.has(Ie.id)||(wt.success(`${Kt} upgrade finished on ${dt}`),p.current.add(Ie.id));else if(Ie.status==="failed")p.current.has(Ie.id)||(wt.error(o_(Ie)??`${Kt} upgrade failed`),p.current.add(Ie.id));else{g(st=>new Map(st).set(Be,Ie)),wt.info(`${Kt} upgrade is still ${Ie.status} on ${dt}`);return}g(st=>{const bn=new Map(st),Zt=bn.get(Be);return(!Zt||Zt.id===Ie.id)&&bn.delete(Be),bn})}catch(Ie){g(st=>{const bn=new Map(st),Zt=bn.get(Be);return(!Zt||Zt.id===ye.id)&&bn.delete(Be),bn}),wt.error(Ie instanceof Error?Ie.message:`${Kt} upgrade failed`)}finally{x.current.delete(ye.id)}},[u,B]);v.useEffect(()=>{if(k.length===0)return;let ye=!1;async function tt(){let Be;try{Be=await ZA(k)}catch{return}if(!ye){g(rn=>{const Kt=new Map(rn);for(const[dt,Ie]of Be)Kt.set(dt,Ie);return Kt});for(const rn of Be.values())V(rn)}}return tt(),()=>{ye=!0}},[V,q]);async function te(ye){if(C)try{const tt=await Yw(C.id,ye.id);wt.info(`${ye.label} upgrade started on ${C.name}`),await V(tt,{agentLabel:ye.label,nodeName:C.name})}catch(tt){wt.error(tt instanceof Error?tt.message:`${ye.label} upgrade failed`)}}return!C||!N?m.jsx("div",{className:"rounded-2xl border border-dashed border-border/70 bg-muted/20 px-4 py-8 text-center text-[12px] text-muted-foreground",children:"Loading session metadata..."}):m.jsxs("div",{className:"space-y-3",children:[m.jsxs("section",{className:"relative mt-2 rounded-2xl border border-border/70 bg-[radial-gradient(circle_at_top_left,rgba(59,130,246,0.18),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(16,185,129,0.12),transparent_32%),rgba(255,255,255,0.72)] p-3 shadow-[0_24px_90px_-54px_rgba(15,23,42,0.55)] dark:bg-[radial-gradient(circle_at_top_left,rgba(59,130,246,0.18),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(16,185,129,0.12),transparent_32%),rgba(10,15,23,0.78)]",children:[!E&&m.jsxs(yt,{variant:"outline",className:"absolute right-3 top-2.5 rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em] whitespace-nowrap",children:["Updated ",vn((ve=C.settingsSnapshot)==null?void 0:ve.collectedAt)]}),m.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end md:justify-between",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsxs("span",{className:"flex items-center gap-1.5 rounded-full border border-border/70 bg-background/75 px-2 py-0.5 text-[10px] text-muted-foreground backdrop-blur",children:[m.jsx(L0,{status:C.status}),m.jsx("span",{className:"font-medium text-foreground",children:C.name})]}),m.jsx(JN,{role:C.role}),m.jsx(yt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:C.transportType??N.transportType??"direct"}),m.jsx(yt,{variant:E?"default":"outline",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:E?"Live local session":"Leader-synced snapshot"})]}),m.jsxs("div",{children:[m.jsx("div",{className:"text-[10px] uppercase tracking-[0.34em] text-muted-foreground",children:"Session"}),m.jsx("h3",{className:"mt-0.5 text-sm font-semibold tracking-tight text-foreground",children:"Node runtime"}),m.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:"Runtime environment, connectivity, and build metadata."})]}),d.length>1&&m.jsxs("div",{className:"w-48 space-y-1.5",children:[m.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Inspect node"}),m.jsxs(jb,{value:C.id,onValueChange:h,children:[m.jsx(Lf,{className:"h-7 rounded-lg border-border/70 bg-background/70 text-[11px]",children:m.jsx(Ob,{placeholder:"Choose a node"})}),m.jsx(Uf,{children:d.map(ye=>m.jsx(Cr,{value:ye.id,children:d_(ye,l==null?void 0:l.nodeId)},ye.id))})]})]})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsxs(yt,{variant:o?"default":"outline",className:"gap-1 rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:[m.jsx(p0,{className:"h-3 w-3"}),o?"Live link":"Reconnecting"]}),m.jsxs(yt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Uptime ",n_(N.uptime)]})]})]})]}),!R&&m.jsx("div",{className:"rounded-xl border border-dashed border-border/70 bg-muted/20 px-3 py-2 text-[11px] text-muted-foreground",children:"This node has not synced its settings snapshot to the leader yet. Wait for the next keepalive and reopen the dialog if needed."}),m.jsxs(RA,{defaultValue:"session",className:"space-y-2",children:[m.jsxs(Wb,{className:"h-auto flex-wrap rounded-xl border border-border/60 bg-muted/40 p-0.5",children:[m.jsx(Es,{value:"session",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"Session"}),m.jsx(Es,{value:"access",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"Access"}),m.jsx(Es,{value:"about",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"About"})]}),m.jsxs(Ns,{value:"session",className:"mt-0 grid gap-2 xl:grid-cols-[1.15fr_0.85fr]",children:[m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(PE,{className:"h-3.5 w-3.5 text-primary"}),"Selected node"]}),m.jsx(Vn,{className:"text-[10px]",children:"Cluster role, identity, and node-scoped runtime state."})]}),m.jsxs(qn,{className:"space-y-0 px-3 pb-2.5",children:[m.jsx(Le,{label:"Node ID",value:N.nodeId,mono:!0}),m.jsx(Le,{label:"Status",value:C.status}),m.jsx(Le,{label:"Role",value:C.role}),m.jsx(Le,{label:"Endpoint",value:C.endpoint,mono:!0}),m.jsx(Le,{label:"Joined",value:vn(C.joinedAt)}),m.jsx(Le,{label:"Heartbeat",value:vn(C.lastHeartbeat)}),m.jsx(Le,{label:"Capabilities",value:C.capabilities.length>0?C.capabilities.join(", "):"None"})]})]}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(ME,{className:"h-3.5 w-3.5 text-primary"}),"OS info"]}),m.jsx(Vn,{className:"text-[10px]",children:"Host and resource details reported by the current process."})]}),m.jsxs(qn,{className:"space-y-0 px-3 pb-2.5",children:[m.jsx(Le,{label:"Host",value:((ie=N.os)==null?void 0:ie.hostname)??"Unavailable"}),m.jsx(Le,{label:"Platform",value:N.os?`${N.os.platform} ${N.os.release}`:"Unavailable"}),m.jsx(Le,{label:"Arch",value:((ce=N.os)==null?void 0:ce.arch)??"Unavailable"}),m.jsx(Le,{label:"CPU",value:((re=N.os)==null?void 0:re.cpuModel)??"Unavailable"}),m.jsx(Le,{label:"Cores",value:String(((ue=N.os)==null?void 0:ue.cpuCount)??"Unavailable")}),m.jsx(Le,{label:"Memory",value:N.os?`${Lv(N.os.freeMemoryBytes)} free / ${Lv(N.os.totalMemoryBytes)} total`:"Unavailable"})]})]}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)] xl:col-span-2",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(f0,{className:"h-3.5 w-3.5 text-primary"}),"Available agents"]}),m.jsx(Vn,{className:"text-[10px]",children:E?"Live command availability for Codex and Claude Code on this node.":"Most recent agent availability snapshot synced from this node."})]}),m.jsx(qn,{className:"grid gap-2 px-3 pb-2.5 md:grid-cols-2",children:(N.agents??[]).map(ye=>m.jsx(i_,{agent:ye,nodeName:C.name,activeOperation:y.get(`${C.id}:${ye.id}`),onUpgrade:te},ye.id))})]})]}),m.jsxs(Ns,{value:"access",className:"mt-0 grid gap-2 xl:grid-cols-2",children:[m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(vE,{className:"h-3.5 w-3.5 text-primary"}),"Access surface"]}),m.jsx(Vn,{className:"text-[10px]",children:"How this node is exposed to the dashboard and other peers."})]}),m.jsxs(qn,{className:"space-y-0 px-3 pb-2.5",children:[m.jsx(Le,{label:"Transport",value:C.transportType??N.transportType??"direct"}),m.jsx(Le,{label:"Node URL",value:C.endpoint,mono:!0}),m.jsx(Le,{label:"Node tunnel",value:C.devtunnelEndpoint??"Disabled",mono:!!C.devtunnelEndpoint}),m.jsx(Le,{label:"Dashboard URL",value:C.dashboardOrigin??N.localDashboardOrigin??"Unavailable",mono:!!(C.dashboardOrigin||N.localDashboardOrigin)}),m.jsx(Le,{label:"Local dashboard",value:N.localDashboardOrigin??"Unavailable",mono:!!N.localDashboardOrigin})]})]}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(WE,{className:"h-3.5 w-3.5 text-primary"}),"Auth"]}),m.jsx(Vn,{className:"text-[10px]",children:"Current bearer-auth and trusted access posture."})]}),m.jsxs(qn,{className:"space-y-0 px-3 pb-2.5",children:[m.jsx(Le,{label:"Enabled",value:(M=N.auth)!=null&&M.enabled?"Yes":"No"}),m.jsx(Le,{label:"Same tenant",value:(G=N.auth)!=null&&G.allowSameTenant?"Allowed":"Off"}),m.jsx(Le,{label:"Allowed users",value:(I=N.auth)!=null&&I.allowedUsers.length?N.auth.allowedUsers.join(", "):"None"})]})]}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(LE,{className:"h-3.5 w-3.5 text-primary"}),"Paths"]}),m.jsx(Vn,{className:"text-[10px]",children:"Workspace and runtime paths currently used by this node."})]}),m.jsxs(qn,{className:"space-y-0 px-3 pb-2.5",children:[m.jsx(Le,{label:"Work dir",value:((se=N.runtime)==null?void 0:se.workDir)??N.workDir??"Unavailable",mono:!!(((F=N.runtime)==null?void 0:F.workDir)??N.workDir)}),m.jsx(Le,{label:"Storage",value:((_=N.runtime)==null?void 0:_.storagePath)??"Unavailable",mono:!!((X=N.runtime)!=null&&X.storagePath)}),m.jsx(Le,{label:"Process cwd",value:((K=N.runtime)==null?void 0:K.cwd)??"Unavailable",mono:!!((J=N.runtime)!=null&&J.cwd)}),m.jsx(Le,{label:"Started",value:vn((W=N.runtime)==null?void 0:W.startedAt)}),m.jsx(Le,{label:"PID",value:N.runtime?String(N.runtime.pid):"Unavailable",mono:!!N.runtime})]})]}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(Ts,{className:"h-3.5 w-3.5 text-primary"}),"Startup checks"]}),m.jsx(Vn,{className:"text-[10px]",children:"Dependency preflight snapshot persisted during node startup."})]}),m.jsxs(qn,{className:"space-y-3 px-3 pb-2.5",children:[m.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/70 px-3 py-2",children:[m.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Last checked"}),m.jsx("div",{className:"mt-0.5 text-[11px] text-foreground",children:vn((ae=N.startupRequirements)==null?void 0:ae.lastCheckedAt)})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(vs,{formatDateTime:vn,name:"Azure CLI",status:O.az,statusVariant:Uo}),m.jsx(vs,{formatDateTime:vn,name:"DevTunnel",status:O.devtunnel,statusVariant:Uo}),m.jsx(vs,{formatDateTime:vn,name:"Claude Code",status:O.claude,statusVariant:Uo}),m.jsx(vs,{formatDateTime:vn,name:"Codex",status:O.codex,statusVariant:Uo})]})]})]})]}),m.jsxs(Ns,{value:"about",className:"mt-0 grid gap-2 xl:grid-cols-[0.92fr_1.08fr]",children:[m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(hE,{className:"h-3.5 w-3.5 text-primary"}),"Repository"]}),m.jsx(Vn,{className:"text-[10px]",children:"Source-of-truth repository metadata for this running node."})]}),m.jsxs(qn,{className:"space-y-3 px-3 pb-2.5",children:[(ee=N.repository)!=null&&ee.url?m.jsxs("a",{href:N.repository.url,target:"_blank",rel:"noreferrer",className:"group flex items-center justify-between rounded-lg border border-border/70 bg-background/70 px-2.5 py-1.5 text-[11px] text-foreground transition-colors hover:border-primary/40 hover:bg-primary/5",children:[m.jsx("span",{className:"font-mono text-[10px]",children:N.repository.url}),m.jsx(kE,{className:"h-3.5 w-3.5 text-muted-foreground transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5"})]}):m.jsx("div",{className:"rounded-lg border border-dashed border-border/70 bg-muted/20 px-2.5 py-1.5 text-[11px] text-muted-foreground",children:"Repository URL is unavailable in this runtime."}),m.jsxs("div",{className:"space-y-0",children:[m.jsx(Le,{label:"Branch",value:((oe=N.repository)==null?void 0:oe.branch)??"Unavailable",mono:!!((de=N.repository)!=null&&de.branch)}),m.jsx(Le,{label:"Commit",value:((Te=N.repository)==null?void 0:Te.commit)??"Unavailable",mono:!!((Ee=N.repository)!=null&&Ee.commit)}),m.jsx(Le,{label:"Runtime",value:`${N.packageName??"meshy"} ${N.version}`,mono:!0}),m.jsx(Le,{label:"Node.js",value:((we=N.runtime)==null?void 0:we.nodeVersion)??"Unavailable",mono:!!((Je=N.runtime)!=null&&Je.nodeVersion)})]})]})]}),m.jsxs("div",{className:"space-y-2",children:[j&&m.jsx(FA,{checkedLabel:vn(j.checkedAt),disableAuthDefault:(($e=N.auth)==null?void 0:$e.enabled)===void 0?void 0:N.auth.enabled===!1,endpoint:C.endpoint,isLiveLocalNode:E,nodeId:C.id,nodeName:C.name,pid:(zt=N.runtime)==null?void 0:zt.pid,transportType:C.transportType,update:j,workDir:((Mt=N.runtime)==null?void 0:Mt.workDir)??C.workDir}),m.jsxs(Un,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[m.jsxs(Bn,{className:"pb-1.5 pt-2.5 px-3",children:[m.jsxs(Hn,{className:"flex items-center gap-1.5 text-[12px]",children:[m.jsx(BE,{className:"h-3.5 w-3.5 text-primary"}),"Package versions"]}),m.jsx(Vn,{className:"text-[10px]",children:"Version snapshot for the packages most relevant to this dashboard session."})]}),m.jsx(qn,{className:"space-y-1.5 px-3 pb-2.5",children:T.map(ye=>{var tt,Be;return m.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-background/70 px-2.5 py-1.5",children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-[11px] font-medium text-foreground",children:ye.label}),m.jsx("div",{className:"text-[10px] text-muted-foreground",children:(tt=ye.value)==null?void 0:tt.name})]}),m.jsx(yt,{variant:"outline",className:"rounded-[11px] border-border/70 bg-background/60 font-mono text-[10px]",children:(Be=ye.value)==null?void 0:Be.version})]},ye.key)})})]})]})]})]})]})}function p_({initialSelectedNodeId:n,open:l,onOpenChange:o,showTrigger:i=!0}={}){const{cluster:u,systemInfo:d,sseConnected:f,refresh:h}=u0();return m.jsx(g5,{open:l,onOpenChange:o,showTrigger:i,children:m.jsx(h_,{cluster:u,systemInfo:d,sseConnected:f,initialSelectedNodeId:n,onRefresh:h})})}const $3="bypass",g_=[{value:"claudecode",label:"claudecode",supportsFollowUp:!0},{value:"codex",label:"codex",supportsFollowUp:!0},{value:"mars",label:"mars",disabled:!0,description:"coming soon"},{value:"eureka",label:"eureka",disabled:!0,description:"coming soon"}],G3=[{value:"bypass",label:"Bypass"},{value:"plan",label:"Plan"},{value:"edit",label:"Edit"},{value:"dangerous",label:"Dangerous"}],X3=new Set(g_.filter(n=>n.supportsFollowUp).map(n=>n.value)),Q3=[{value:"active",label:"Active"},{value:"running",label:"Running"},{value:"waiting",label:"Waiting"},{value:"closed",label:"Closed"},{value:"shared",label:"Shared"},{value:"archived",label:"Archived"}],K3=[{value:"all",label:"All task types"},{value:"native",label:"Native sessions"},{value:"meshy",label:"Meshy chats"}],v_=new Set(["pending","assigned"]),y_=new Set(["running"]),b_=new Set(["completed","failed","cancelled"]);function Z3(n,l){switch(l){case"running":return y_.has(n.status);case"waiting":return v_.has(n.status);case"closed":return b_.has(n.status);case"shared":return!!n.activeShare;case"archived":return n.status==="archived";case"active":default:return n.status!=="archived"}}function P3(n,l){if(l==="all")return!0;const o=n.conversationKind==="nativeSession";return l==="native"?o:!o}function I3(n,l){const o=l.trim().toLowerCase();return o?[n.title,n.description,n.id,n.agent,n.assignedTo??"",n.assignedNodeName??"",n.project??"",n.effectiveProjectPath??"",n.conversationKind==="nativeSession"?"native session":"meshy chat",n.activeShare?"shared conversation":""].some(i=>i.toLowerCase().includes(o)):!0}function x_(n,l,o){if(!n)return"unassigned";const i=l==null?void 0:l.find(u=>u.id===n);return(i==null?void 0:i.name)??o??n.slice(0,8)}function F3(n,l,o){return x_(n,l,o).toLowerCase()}function J3(n,l,o){return!n.assignedTo||(o==null?void 0:o.id)===n.assignedTo?!0:(l==null?void 0:l.some(i=>i.id===n.assignedTo))??!1}function W3(n,l){return[...n].sort((o,i)=>o.id===l?-1:i.id===l?1:o.name.localeCompare(i.name))}function ej(n){if(!n||typeof n!="object")return null;const l=n,o=l.createMode,i=o==="chat"||o==="native"?o:void 0;return{draftNewTask:l.draftNewTask===!0,returnRoute:typeof l.returnRoute=="string"?l.returnRoute:void 0,returnTaskId:typeof l.returnTaskId=="string"||l.returnTaskId===null?l.returnTaskId:void 0,createMode:i}}function tj(n){switch(n){case"running":return"bg-amber-500";case"completed":return"bg-emerald-500";case"failed":return"bg-destructive";case"cancelled":case"archived":return"bg-slate-400";case"assigned":return"bg-teal-500";case"pending":default:return"bg-muted-foreground"}}function nj(n){return n==="default workspace"?n:n.replace(/\\/g,"/").split("/").filter(Boolean).at(-1)??n}function aj(n){const l=Date.now()-n;return l<6e4?"just now":l<36e5?`${Math.floor(l/6e4)}m`:l<864e5?`${Math.floor(l/36e5)}h`:`${Math.floor(l/864e5)}d`}function lj(n){return new Date(n).toLocaleString()}function rj(n){const l=Math.floor(n/1e3),o=Math.floor(l/3600),i=Math.floor(l%3600/60),u=l%60;return`${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}:${String(u).padStart(2,"0")}`}async function S_(n,l="Copied to clipboard"){var o,i,u;try{if((i=(o=globalThis.navigator)==null?void 0:o.clipboard)!=null&&i.writeText)return await globalThis.navigator.clipboard.writeText(n),wt.success(l),!0;const d=globalThis.document,f=(u=d==null?void 0:d.execCommand)==null?void 0:u.bind(d);if(!(d!=null&&d.body)||typeof d.createElement!="function"||typeof f!="function")throw new Error("Clipboard access is unavailable");const h=d.createElement("textarea"),y=d.activeElement,g=y&&typeof y.focus=="function"?y:null;h.value=n,h.setAttribute("readonly","true"),h.style.position="fixed",h.style.opacity="0",h.style.pointerEvents="none",d.body.appendChild(h),h.select(),h.setSelectionRange(0,h.value.length);const x=f("copy");if(d.body.removeChild(h),g==null||g.focus(),!x)throw new Error("Clipboard access is unavailable");return wt.success(l),!0}catch(d){return wt.error(d instanceof Error?d.message:"Failed to copy"),!1}}function oj(n,l,o){const i=new Map;for(const d of n){const f=d.assignedTo??null,h=f??"__unassigned__",y=f?l.get(f)??d.assignedNodeName??f.slice(0,8):"Unassigned",g=d.effectiveProjectPath??d.project??"default workspace";i.has(h)||i.set(h,{nodeId:f,nodeName:y,dirMap:new Map});const x=i.get(h);x.dirMap.has(g)||x.dirMap.set(g,[]),x.dirMap.get(g).push(d)}const u=Array.from(i.values()).map(({nodeId:d,nodeName:f,dirMap:h})=>{const y=Array.from(h.entries()).map(([g,x])=>({path:g,tasks:x})).sort((g,x)=>x.tasks.length-g.tasks.length||g.path.localeCompare(x.path));return{nodeId:d,nodeName:f,dirs:y}});return u.sort((d,f)=>{if(o){if(d.nodeId===o)return-1;if(f.nodeId===o)return 1}return d.nodeId===null?1:f.nodeId===null?-1:d.nodeName.localeCompare(f.nodeName)}),u}const w_={node:"border-teal-500/30 bg-teal-500/10 text-teal-700 dark:text-teal-300",task:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",election:"border-indigo-500/30 bg-indigo-500/10 text-indigo-700 dark:text-indigo-300",cluster:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",transport:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300"},E_={node:"text-teal-700/70 dark:text-teal-300/70",task:"text-amber-700/70 dark:text-amber-300/70",election:"text-indigo-700/70 dark:text-indigo-300/70",cluster:"text-emerald-700/70 dark:text-emerald-300/70",transport:"text-sky-700/70 dark:text-sky-300/70"};function N_(n){return n.split(".")[0]??"unknown"}function C_(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function Nr(n,l){return(l==null?void 0:l.get(n))??n}function Mx(n,l){const o=n.data,i=o.operation;switch(n.type){case"node.joined":return`${o.name} joined the cluster`;case"node.left":return`${Nr(o.nodeId,l)} left (${o.reason})`;case"node.status":return`${Nr(o.nodeId,l)} is now ${o.status}`;case"node.operation.created":return`${i==null?void 0:i.kind} ${i==null?void 0:i.status} on ${Nr(i==null?void 0:i.nodeId,l)}`;case"node.operation.updated":return`${i==null?void 0:i.kind} ${i==null?void 0:i.status} on ${Nr(i==null?void 0:i.nodeId,l)}`;case"transport.changed":return`${Nr(o.nodeId,l)} transport switched to ${o.transportType}`;case"task.created":return`"${o.title}" created`;case"task.assigned":return`task assigned to ${Nr(o.nodeId,l)}`;case"task.status":return`task ${o.taskId.slice(0,8)} -> ${o.status}`;case"election.started":return`candidate ${o.candidateId.slice(0,8)} term ${o.term}`;case"election.complete":return`leader elected, term ${o.term}`;case"cluster.state":return`${o.nodeCount} nodes, term ${o.term}`;default:return JSON.stringify(o)}}function T_(n){return JSON.stringify(n,null,2)}function R_({events:n,maxHeight:l="400px",nodeNameById:o,onDismiss:i,density:u="default"}){if(n.length===0)return null;const d=u==="compact";return m.jsx("div",{className:"overflow-y-auto pr-1",style:{maxHeight:l},children:m.jsx("div",{className:"space-y-1.5",children:n.map(f=>{const h=N_(f.type);return m.jsx("div",{className:fe("transition-colors hover:bg-muted/30",d?"rounded-[7px] px-1 py-0.5":"rounded-lg px-1.5 py-1"),children:m.jsxs("div",{className:"space-y-1",children:[m.jsxs("div",{className:"flex items-start justify-between gap-1.5",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx("div",{className:fe("font-mono text-muted-foreground",d?"text-[8px]":"text-[9px]"),children:C_(f.timestamp)}),d?m.jsx("span",{className:fe("max-w-[8.5rem] truncate text-[7px] font-medium uppercase tracking-[0.08em] text-muted-foreground/70",E_[h]),children:f.type}):m.jsx(yt,{variant:"outline",className:fe("w-fit text-[9px] font-medium uppercase tracking-[0.14em] px-1.5 py-0",w_[h]),children:f.type})]}),m.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[m.jsx(Qn,{type:"button",variant:"ghost",size:"icon",className:fe("rounded-[8px] text-muted-foreground",d?"h-4 w-4":"h-5 w-5"),onClick:()=>void S_(T_(f),"Event copied"),"aria-label":`Copy ${f.type} event`,title:"Copy event",children:m.jsx(jE,{className:d?"h-2.5 w-2.5":"h-3 w-3"})}),i&&m.jsx(Qn,{type:"button",variant:"ghost",size:"icon",className:fe("rounded-[8px] text-muted-foreground hover:text-foreground",d?"h-4 w-4":"h-5 w-5"),onClick:()=>i(f.id),"aria-label":`Dismiss ${f.type} event`,title:"Dismiss event",children:m.jsx(y0,{className:d?"h-2.5 w-2.5":"h-3 w-3"})})]})]}),m.jsx("div",{className:"text-[9px] leading-snug text-foreground/85",children:Mx(f,o)})]})},f.id)})})})}const A_=["node.","election.","transport."],__="cluster.state";function j_(n){return n.type==="node.status"?!1:A_.some(l=>n.type.startsWith(l))}function O_(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function M_(n,l){return n?{time:O_(n.timestamp),text:Mx(n,l)}:null}function D_(n){return n.transportType==="devtunnel"||!!n.devtunnelEndpoint}function k_(n){if(n.length===0)return"No node tunnel";const l=n.filter(u=>u.status==="offline").length;if(l>0)return`${l} offline`;const o=n.filter(u=>{var d;return((d=u.devtunnelHealth)==null?void 0:d.status)==="failed"}).length;if(o>0)return`${o} failed`;const i=n.filter(u=>{var d;return u.status!=="offline"&&((d=u.devtunnelHealth)==null?void 0:d.status)!=="healthy"}).length;return i>0?`${i} checking`:"Healthy"}function z_(n,l){var u;const o=(l==null?void 0:l.get(n.id))??n.name??n.id;if(n.status==="offline")return{label:o,status:"offline"};const i=((u=n.devtunnelHealth)==null?void 0:u.status)??"checking";return{label:o,status:i}}function L_(n){if(n.length===0)return"No nodes";const l=n.filter(i=>i.status==="offline").length;if(l>0)return`${l} offline`;const o=n.filter(i=>i.status==="busy").length;return o>0?`${o} busy`:"Healthy"}function U_(n,l){return{label:(l==null?void 0:l.get(n.id))??n.name??n.id,status:n.status}}function B_({connected:n,events:l,nodes:o=[],nodeNameById:i,defaultOpen:u=!1}){const[d,f]=v.useState(u),[h,y]=v.useState(!0),[g,x]=v.useState(new Set),p=v.useRef(null),w=v.useMemo(()=>l.filter(k=>j_(k)&&!g.has(k.id)),[l,g]),C=v.useMemo(()=>l.find(k=>k.type===__)??w[0],[l,w]),N=v.useMemo(()=>M_(C,i),[C,i]),E=v.useMemo(()=>o.filter(D_),[o]),R=E.some(k=>{var q;return k.status==="offline"||((q=k.devtunnelHealth)==null?void 0:q.status)==="failed"}),T=o.some(k=>k.status==="offline"),j=o.some(k=>k.status==="busy"),O=o.length>0;return v.useEffect(()=>{x(k=>{if(k.size===0)return k;const q=new Set(l.map(B=>B.id)),$=new Set(Array.from(k).filter(B=>q.has(B)));return $.size===k.size?k:$})},[l]),v.useEffect(()=>{if(!d)return;const k=$=>{var B;(B=p.current)!=null&&B.contains($.target)||f(!1)},q=$=>{$.key==="Escape"&&f(!1)};return document.addEventListener("pointerdown",k),document.addEventListener("keydown",q),()=>{document.removeEventListener("pointerdown",k),document.removeEventListener("keydown",q)}},[d]),m.jsxs("div",{ref:p,className:"relative",children:[m.jsxs("button",{type:"button","aria-expanded":d,"aria-haspopup":"dialog",onClick:()=>f(k=>!k),className:fe("flex items-center gap-1.5 rounded-[16px] border px-2 py-1.5 text-[11px] shadow-sm transition-all sm:gap-2 sm:px-3 sm:py-2 sm:text-xs",n?"border-emerald-500/25 bg-emerald-500/8 text-muted-foreground hover:border-emerald-500/40 hover:bg-emerald-500/12":"border-destructive/25 bg-destructive/8 text-muted-foreground hover:border-destructive/40 hover:bg-destructive/12",d&&"shadow-[0_14px_40px_-26px_rgba(16,185,129,0.95)]"),title:n?"Live link connected":"Live link reconnecting",children:[m.jsx(p0,{className:fe("h-3.5 w-3.5",n?"text-emerald-500":"text-destructive")}),n?"Live link":"Reconnecting"]}),d&&m.jsxs("div",{role:"dialog","aria-label":"Live link connection events",className:"absolute right-0 top-[calc(100%+0.4rem)] z-50 w-[18rem] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-[18px] border border-border/70 bg-background/96 shadow-[0_28px_90px_-42px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl max-sm:fixed max-sm:right-3 max-sm:top-[3.75rem] max-sm:w-[calc(100vw-1.5rem)]",children:[m.jsx("div",{className:"border-b border-border/60 bg-muted/25 px-2.5 py-1.5",children:m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[n?m.jsx(Ts,{className:"h-3 w-3 text-emerald-500"}):m.jsx(rN,{className:"h-3 w-3 text-destructive"}),m.jsx("span",{className:"text-[10px] font-semibold text-foreground",children:"Live link"}),m.jsx("span",{className:"text-[9px] text-muted-foreground",children:n?"· SSE connected":"· reconnecting"})]}),m.jsx("div",{className:fe("rounded-[9px] border px-1.5 py-0.5 text-[8px] font-medium uppercase tracking-[0.12em]",n?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"border-destructive/30 bg-destructive/10 text-destructive"),children:n?"Connected":"Retrying"})]})}),m.jsxs("div",{className:"grid grid-cols-2 border-b border-border/60",children:[m.jsxs("div",{className:"border-r border-border/60 px-2.5 py-1.5",children:[m.jsx("div",{className:"text-[8px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Events"}),m.jsx("div",{className:"mt-0.5 text-base font-semibold tracking-tight text-foreground",children:w.length})]}),m.jsxs("div",{className:"min-w-0 px-2.5 py-1.5",children:[m.jsx("div",{className:"text-[8px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Latest"}),N?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"mt-0.5 truncate text-[9px] leading-snug text-foreground/80",children:N.text}),m.jsx("div",{className:"font-mono text-[8px] text-muted-foreground/60",children:N.time})]}):m.jsx("div",{className:"mt-0.5 text-[8px] text-muted-foreground/50",children:"—"})]})]}),m.jsxs("div",{className:"border-b border-border/60 px-2.5 py-1.5",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[T?m.jsx(is,{className:"h-3 w-3 shrink-0 text-destructive"}):j?m.jsx(Ts,{className:"h-3 w-3 shrink-0 text-amber-500"}):m.jsx(zo,{className:fe("h-3 w-3 shrink-0",O?"text-emerald-500":"text-muted-foreground")}),m.jsx("span",{className:"text-[9px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Node health"})]}),m.jsx("span",{className:fe("shrink-0 rounded-[8px] border px-1.5 py-0.5 text-[8px] font-medium uppercase tracking-[0.1em]",T?"border-destructive/30 bg-destructive/10 text-destructive":j?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":O?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"border-border/70 bg-background/60 text-muted-foreground"),children:L_(o)})]}),o.length>0&&m.jsx("div",{className:"mt-1.5 flex flex-col gap-0.5",children:o.map(k=>{const{label:q,status:$}=U_(k,i),B=$==="offline",V=$==="busy";return m.jsxs("div",{"aria-label":`${q} ${$}`,className:fe("flex items-center justify-between gap-2 rounded-[7px] px-2 py-0.5",B?"bg-destructive/6":V?"bg-amber-500/6":"bg-emerald-500/5"),title:`${q} ${$}`,children:[m.jsx("span",{className:"truncate text-[9px] text-foreground/70",children:q}),B?m.jsx(is,{className:"h-3 w-3 shrink-0 text-destructive"}):V?m.jsx(Jg,{className:"h-3 w-3 shrink-0 text-amber-500"}):m.jsx(zo,{className:"h-3 w-3 shrink-0 text-emerald-500"})]},k.id)})})]}),E.length>0&&m.jsxs("div",{className:"border-b border-border/60 px-2.5 py-1.5",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[R?m.jsx(is,{className:"h-3 w-3 shrink-0 text-destructive"}):m.jsx(zo,{className:"h-3 w-3 shrink-0 text-emerald-500"}),m.jsx("span",{className:"text-[9px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"DevTunnel"})]}),m.jsx("span",{className:fe("shrink-0 rounded-[8px] border px-1.5 py-0.5 text-[8px] font-medium uppercase tracking-[0.1em]",R?"border-destructive/30 bg-destructive/10 text-destructive":"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"),children:k_(E)})]}),m.jsx("div",{className:"mt-1.5 flex flex-col gap-0.5",children:E.map(k=>{var le;const{label:q,status:$}=z_(k,i),B=$==="failed"||$==="offline",V=$!=="healthy"&&$!=="failed"&&$!=="offline",te=(le=k.devtunnelHealth)!=null&&le.reason?`${q} ${$}: ${k.devtunnelHealth.reason}`:`${q} ${$}`;return m.jsxs("div",{"aria-label":`${q} ${$}`,className:fe("flex items-center justify-between gap-2 rounded-[7px] px-2 py-0.5",B?"bg-destructive/6":V?"bg-muted/30":"bg-emerald-500/5"),title:te,children:[m.jsx("span",{className:"truncate text-[9px] text-foreground/70",children:q}),B?m.jsx(is,{className:"h-3 w-3 shrink-0 text-destructive"}):V?m.jsx(Jg,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):m.jsx(zo,{className:"h-3 w-3 shrink-0 text-emerald-500"})]},k.id)})})]}),m.jsxs("div",{children:[m.jsxs("button",{type:"button",onClick:()=>y(k=>!k),className:"flex w-full items-center justify-between px-2.5 py-1.5 text-left hover:bg-muted/30",children:[m.jsxs("span",{className:"text-[8px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:["Notifications ",w.length>0&&`(${w.length})`]}),h?m.jsx(Xs,{className:"h-3 w-3 text-muted-foreground"}):m.jsx(SE,{className:"h-3 w-3 text-muted-foreground"})]}),h&&m.jsx("div",{className:"px-2 pb-2",children:m.jsx(R_,{events:w,maxHeight:"12rem",density:"compact",emptyTitle:"No connection events yet",emptyDescription:"Node, election, and system events will appear here.",nodeNameById:i,onDismiss:k=>x(q=>new Set(q).add(k))})})]}),m.jsxs("div",{className:"flex items-center justify-end gap-1 border-t border-border/60 px-2.5 py-1",children:[m.jsx(Qn,{type:"button",variant:"ghost",size:"sm",className:"h-5 rounded-[9px] px-1.5 text-[9px]",onClick:()=>x(new Set(l.map(k=>k.id))),disabled:w.length===0,title:"Dismiss all notifications",children:"Dismiss all"}),m.jsx(Qn,{type:"button",variant:"ghost",size:"sm",className:"h-5 rounded-[9px] px-1.5 text-[9px]",onClick:()=>f(!1),children:"Close"})]})]})]})}const Dx=v.createContext(null);function H_({children:n}){const[l,o]=v.useState(()=>typeof window<"u"?localStorage.getItem("meshy-theme")??"system":"system"),[i,u]=v.useState(()=>typeof window<"u"?localStorage.getItem("meshy-palette")??"default":"default");return v.useEffect(()=>{const d=document.documentElement,f=h=>{if(h==="system"){const y=window.matchMedia("(prefers-color-scheme: dark)").matches;d.classList.toggle("dark",y)}else d.classList.toggle("dark",h==="dark")};if(f(l),localStorage.setItem("meshy-theme",l),l==="system"){const h=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>f("system");return h.addEventListener("change",y),()=>h.removeEventListener("change",y)}},[l]),v.useEffect(()=>{const d=document.documentElement;i==="default"?d.removeAttribute("data-palette"):d.setAttribute("data-palette",i),localStorage.setItem("meshy-palette",i)},[i]),m.jsx(Dx.Provider,{value:{theme:l,setTheme:o,palette:i,setPalette:u},children:n})}function V_(){const n=v.useContext(Dx);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}const q_=[{value:"light",label:"Light",icon:g0},{value:"dark",label:"Dark",icon:h0},{value:"system",label:"System",icon:m0}],Y_=[{value:"default",label:"Default",hint:"Porcelain + blue"},{value:"warm",label:"Warm",hint:"Cream + amber"},{value:"finsight",label:"FinSight",hint:"Cool sage green"},{value:"inshield",label:"inShield",hint:"Pure white + navy"},{value:"edge",label:"Edge",hint:"Rounded violet panels"}];function $_(){const{theme:n,setTheme:l,palette:o,setPalette:i}=V_(),[u,d]=v.useState(!1),f=v.useRef(null),h=v.useRef(null),y=n==="dark"?h0:n==="light"?g0:m0,g=()=>{f.current&&(clearTimeout(f.current),f.current=null)},x=()=>{g(),f.current=setTimeout(()=>d(!1),180)};return v.useEffect(()=>{if(!u)return;const p=w=>{h.current&&!h.current.contains(w.target)&&d(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[u]),v.useEffect(()=>()=>g(),[]),m.jsxs("div",{ref:h,className:"relative",onMouseEnter:()=>{g(),d(!0)},onMouseLeave:x,children:[m.jsx(Qn,{variant:"ghost",size:"icon",onClick:()=>d(p=>!p),className:fe("rounded-[16px] border bg-background/70",o==="default"?"border-border/60":"border-primary/60 text-primary"),title:"Appearance","aria-haspopup":"menu","aria-expanded":u,children:m.jsx(y,{className:"h-4 w-4"})}),u&&m.jsxs("div",{role:"menu",className:"absolute right-0 top-[calc(100%+8px)] z-50 w-64 rounded-[20px] border border-border/70 bg-popover/95 p-3 text-popover-foreground shadow-[0_24px_80px_-32px_rgba(0,0,0,0.35)] backdrop-blur-xl",children:[m.jsx("div",{className:"px-1 pb-1 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"Theme"}),m.jsx("div",{className:"mb-2 grid grid-cols-3 gap-1",children:q_.map(({value:p,label:w,icon:C})=>{const N=n===p;return m.jsxs("button",{type:"button",onClick:()=>l(p),className:fe("flex flex-col items-center gap-1 rounded-[14px] border px-2 py-2 text-[11px] font-medium transition-colors",N?"border-primary/50 bg-primary/10 text-primary":"border-border/60 text-muted-foreground hover:border-border hover:bg-muted/60 hover:text-foreground"),children:[m.jsx(C,{className:"h-4 w-4"}),w]},p)})}),m.jsxs("div",{className:"mt-2 flex items-center gap-1.5 px-1 pb-1 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:[m.jsx(tN,{className:"h-3 w-3"}),"Palette"]}),m.jsx("div",{className:"space-y-1",children:Y_.map(({value:p,label:w,hint:C})=>{const N=o===p;return m.jsxs("button",{type:"button",onClick:()=>i(p),className:fe("flex w-full items-center gap-2 rounded-[14px] border px-2.5 py-1.5 text-left transition-colors",N?"border-primary/50 bg-primary/10":"border-transparent hover:bg-muted/60"),children:[m.jsx(G_,{value:p}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:fe("text-[12px] font-medium",N?"text-primary":"text-foreground"),children:w}),m.jsx("div",{className:"text-[10px] text-muted-foreground",children:C})]}),N&&m.jsx(uf,{className:"h-3.5 w-3.5 text-primary"})]},p)})})]})]})}function G_({value:n}){const l={default:["hsl(212 76% 44%)","hsl(210 22% 98%)","hsl(174 42% 61%)"],warm:["hsl(35 88% 56%)","hsl(42 22% 97%)","hsl(160 60% 45%)"],finsight:["hsl(152 38% 32%)","hsl(150 14% 97%)","hsl(142 55% 58%)"],inshield:["hsl(220 25% 12%)","hsl(0 0% 100%)","hsl(195 80% 55%)"],edge:["hsl(265 75% 55%)","hsl(260 12% 98%)","hsl(285 70% 65%)"]},[o,i,u]=l[n];return m.jsxs("div",{className:fe("flex h-6 w-6 shrink-0 overflow-hidden border border-border/60",n==="edge"?"rounded-[10px]":"rounded-[12px]"),children:[m.jsx("div",{className:"h-full w-1/3",style:{background:o}}),m.jsx("div",{className:"h-full w-1/3",style:{background:i}}),m.jsx("div",{className:"h-full w-1/3",style:{background:u}})]})}function X_(){var y,g;const{cluster:n,events:l,sseConnected:o}=u0(),i=Kn(),[u,d]=v.useState(!1),f=i.pathname==="/"||/^\/tasks\/[^/]+$/.test(i.pathname),h=v.useMemo(()=>{const x=new Map;for(const p of(n==null?void 0:n.nodes)??[])x.set(p.id,p.name);return x},[n==null?void 0:n.nodes]);return m.jsxs("div",{className:"relative h-full overflow-hidden bg-background text-foreground",children:[m.jsx("div",{className:"mesh-grid pointer-events-none absolute inset-0"}),m.jsxs("div",{className:"relative z-10 flex h-full min-h-0 flex-col",children:[m.jsx("header",{className:"relative z-50 shrink-0 px-2 pb-2 pt-3 sm:px-5 sm:pb-3 sm:pt-4 lg:px-6",children:m.jsxs("div",{className:"dashboard-panel dashboard-panel-muted animate-panel-settle mx-auto flex max-w-[1760px] flex-wrap items-center justify-between gap-2 rounded-[22px] px-3 py-2 sm:gap-3 sm:rounded-[24px] sm:px-4 sm:py-3",children:[m.jsx("div",{className:"flex min-w-0 items-center gap-4",children:m.jsxs(o0,{to:"/",className:"flex items-center gap-3",children:[m.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-[15px] border border-border/70 bg-foreground text-xs font-semibold tracking-[0.24em] text-background shadow-sm sm:h-11 sm:w-11 sm:rounded-[17px] sm:text-sm",children:"M"}),m.jsxs("div",{className:"hidden min-w-0 sm:block",children:[m.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.34em] text-muted-foreground",children:"MESHY"}),m.jsx("div",{className:"truncate text-base font-semibold tracking-tight text-foreground",children:"Workspace"})]})]})}),m.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[m.jsxs("div",{className:"hidden items-center gap-2 rounded-[16px] border border-border/70 bg-background/70 px-3 py-2 text-xs text-muted-foreground shadow-sm sm:flex",children:[m.jsxs("span",{className:"flex items-center gap-2",children:[(n==null?void 0:n.self)&&m.jsx(L0,{status:n.self.status}),m.jsx("span",{className:"font-medium text-foreground",children:((y=n==null?void 0:n.self)==null?void 0:y.name)??"offline"})]}),m.jsx("span",{className:"text-border",children:"/"}),m.jsx("span",{className:"capitalize",children:((g=n==null?void 0:n.self)==null?void 0:g.role)??"node"})]}),m.jsx(B_,{connected:o,events:l,nodes:(n==null?void 0:n.nodes)??[],nodeNameById:h}),f&&m.jsx(Qn,{variant:"ghost",size:"icon",onClick:()=>d(x=>!x),"aria-label":u?"Close terminal":"Open terminal",title:u?"Close terminal":"Open terminal",className:fe("rounded-[16px] border bg-background/70 shadow-sm",u?"border-primary/50 bg-primary/10 text-primary":"border-border/70"),children:m.jsx(v0,{className:"h-4 w-4"})}),m.jsx(p_,{}),m.jsx($_,{})]})]})}),m.jsx("main",{className:fe("min-h-0 flex-1 px-3 pb-3 sm:px-5 lg:px-6",f?"overflow-hidden":"overflow-y-auto"),children:m.jsx("div",{className:"mx-auto h-full min-h-0 max-w-[1760px]",children:m.jsx(W2,{context:{terminalOpen:u,setTerminalOpen:d}})})})]})]})}const Uv=v.lazy(async()=>({default:(await Vv(()=>import("./DashboardPage-BSAt8kN_.js").then(l=>l.D),__vite__mapDeps([0,1,2,3]))).DashboardPage})),Q_=v.lazy(async()=>({default:(await Vv(()=>import("./SharedConversationPage-DmcJdyZj.js"),__vite__mapDeps([4,1]))).SharedConversationPage}));function K_(){return m.jsx(Cw,{children:m.jsx(v.Suspense,{fallback:m.jsx(Z_,{}),children:m.jsxs(tw,{children:[m.jsx(Al,{path:"/shared/tasks/:shareId",element:m.jsx(Q_,{})}),m.jsxs(Al,{element:m.jsx(rE,{children:m.jsx(X_,{})}),children:[m.jsx(Al,{path:"/",element:m.jsx(Uv,{})}),m.jsx(Al,{path:"/nodes",element:m.jsx(Pg,{to:"/",replace:!0})}),m.jsx(Al,{path:"/tasks",element:m.jsx(Pg,{to:"/",replace:!0})}),m.jsx(Al,{path:"/tasks/:id",element:m.jsx(Uv,{})})]})]})})})}function Z_(){return m.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading workspace..."})}function P_(n){return m.jsx(RC,{className:"toaster group",style:{"--normal-bg":"hsl(var(--popover))","--normal-text":"hsl(var(--popover-foreground))","--normal-border":"hsl(var(--border))"},...n})}e2.createRoot(document.getElementById("root")).render(m.jsx(v.StrictMode,{children:m.jsxs(H_,{children:[m.jsx(K_,{}),m.jsx(P_,{})]})}));export{Vv as $,jE as A,Qn as B,uf as C,$3 as D,S_ as E,LE as F,x_ as G,RA as H,Ax as I,yt as J,V3 as K,Wb as L,Es as M,lj as N,Ns as O,q3 as P,Wd as Q,zs as R,Cr as S,G3 as T,Ls as U,Bs as V,Hs as W,y0 as X,Us as Y,qs as Z,Vs as _,OC as a,W_ as a$,e3 as a0,xy as a1,p5 as a2,m3 as a3,v0 as a4,zo as a5,AE as a6,f3 as a7,h3 as a8,d3 as a9,E3 as aA,l3 as aB,n3 as aC,wy as aD,a3 as aE,r3 as aF,qw as aG,p_ as aH,F_ as aI,Kn as aJ,Fv as aK,I_ as aL,u0 as aM,ej as aN,J3 as aO,Z3 as aP,P3 as aQ,F3 as aR,I3 as aS,g3 as aT,X3 as aU,y_ as aV,N3 as aW,S3 as aX,w3 as aY,x3 as aZ,b3 as a_,FE as aa,VE as ab,W3 as ac,p0 as ad,R_ as ae,L0 as af,kE as ag,JN as ah,rj as ai,v_ as aj,oj as ak,Q3 as al,K3 as am,Rx as an,nj as ao,tj as ap,aj as aq,ef as ar,C3 as as,T3 as at,p3 as au,Jw as av,Qw as aw,H3 as ax,B3 as ay,tE as az,fe as b,t3 as b0,J_ as b1,o3 as b2,O3 as b3,j3 as b4,_3 as b5,R3 as b6,A3 as b7,M3 as b8,EE as b9,Bv as ba,z3 as bb,k3 as bc,D3 as bd,KE as be,L3 as bf,Y3 as bg,U3 as bh,Ye as c,z0 as d,u3 as e,Vw as f,s3 as g,i3 as h,SE as i,m as j,c3 as k,y3 as l,jb as m,Lf as n,Ob as o,Uf as p,f0 as q,v as r,Xs as s,wt as t,g_ as u,tN as v,v3 as w,f5 as x,by as y,Sy as z};
|
package/dashboard/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Meshy Dashboard</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🕸</text></svg>" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-nG4cAWuh.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-DgDWjVGo.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|