meshy-node 0.3.8 → 0.3.9

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.
@@ -1,26 +1,21 @@
1
- import{c as k,j as e,i as u,a9 as B,r as a,b2 as W,b1 as X,G as Y,D as Z,g as ee,b3 as se,B as D}from"./index-U21aiFFx.js";import{I as re}from"./input-BA2z1FFh.js";/**
1
+ import{c as M,j as e,i as u,a9 as B,r as a,b2 as W,b1 as X,G as Y,D as Z,g as ee,b3 as se,B as D}from"./index-DHC5U3_j.js";import{I as re,P as te}from"./input-CdkmqjGJ.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const te=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ne=k("maximize-2",te);/**
6
+ */const ne=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ie=M("maximize-2",ne);/**
7
7
  * @license lucide-react v1.7.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const ie=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],ae=k("minimize-2",ie);/**
11
+ */const ae=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],le=M("minimize-2",ae);/**
12
12
  * @license lucide-react v1.7.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const le=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ce=k("play",le);/**
16
+ */const ce=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],O=M("refresh-cw",ce);/**
17
17
  * @license lucide-react v1.7.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const oe=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],z=k("refresh-cw",oe);/**
22
- * @license lucide-react v1.7.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const de=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],ue=k("settings-2",de),xe={getOutput:X,createPreviewSession:W};function ve({taskId:s,api:n=xe,allowPortPreview:l=!0}){const[i,c]=a.useState(null),[r,v]=a.useState(null),[d,p]=a.useState(null),[b,h]=a.useState(""),[P,y]=a.useState(!1),[K,C]=a.useState(!0),[j,m]=a.useState(null),[V,E]=a.useState(!1),_=a.useCallback(async()=>{C(!0),m(null),c(null),v(null),p(null);try{const t=await n.getOutput(s);c(t),C(!1)}catch(t){m(t instanceof Error?t.message:"Failed to load output"),C(!1)}},[n,s]);a.useEffect(()=>{_()},[_]);const w=a.useCallback(async t=>{m(null);try{const o=await n.createPreviewSession(s,t!=null&&t.path?{path:t.path}:void 0);v(o),y(!1),t&&p(t)}catch(o){m(o instanceof Error?o.message:"Failed to create preview session")}},[n,s]),S=a.useCallback(async t=>{const o=t??Number.parseInt(b,10);if(!Number.isInteger(o)||o<1||o>65535){m("Enter a port between 1 and 65535");return}m(null);try{const M=await n.createPreviewSession(s,{port:o});v(M),p(null),h(String(o)),y(!0)}catch(M){m(M instanceof Error?M.message:"Failed to create preview session")}},[n,b,s]),g=a.useMemo(()=>R(i),[i]);a.useEffect(()=>{if(P||!(i!=null&&i.available)||g.length===0||r&&r.kind!=="service")return;const t=d??g[0];t&&w(t)},[d,i,g,P,r,w]);const f=a.useCallback(()=>{if((r==null?void 0:r.kind)==="service"&&typeof r.port=="number"){S(r.port);return}v(null);const t=d??R(i)[0];t&&w(t)},[d,i,r,S,w]);if(a.useEffect(()=>{if(!r)return;const t=r.expiresAt-Date.now()-5e3;if(t<=0){f();return}const o=window.setTimeout(f,t);return()=>window.clearTimeout(o)},[f,r]),K)return e.jsx(N,{children:"Loading preview..."});const x=l&&P;if(j&&r&&!x)return e.jsx(N,{children:e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"text-sm text-destructive",children:j}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(u,{variant:"outline",size:"sm",onClick:f,className:"rounded-full",children:[e.jsx(z,{className:"h-3.5 w-3.5"}),"Retry"]})})]})});const $=!!(i!=null&&i.available);if(!$&&!l)return e.jsx(N,{children:"Task output is not available yet."});if(!r)return e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-4 py-2.5",children:[e.jsx(H,{session:null,serviceModeOpen:x,allowPortPreview:l,servicePort:b,onRefresh:f,onFullscreen:()=>E(!0),onServiceModeToggle:()=>y(t=>!t),onServicePortChange:h,onServiceStart:()=>void S()}),!x&&e.jsx(U,{entries:g,activeEntry:d,onEntrySelect:t=>void w(t)})]}),x?e.jsx(I,{serviceSession:null,error:j}):e.jsx(N,{children:j?e.jsx("span",{className:"text-sm text-destructive",children:j}):$?g.length>0?"Starting preview session...":"No HTML or Markdown files were found in this task output.":"Task output is not available yet."})]});const F=G(r),J=q(r),A=he(r),T=r.kind==="service"?r:null,Q=x?T:r,L=e.jsx("iframe",{src:r.previewUrl,className:"h-full w-full border-0",sandbox:A,title:"Task Preview"});return e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-4 py-2.5",children:[e.jsx(H,{session:Q,serviceModeOpen:x,allowPortPreview:l,servicePort:b,onRefresh:f,onFullscreen:()=>E(!0),onServiceModeToggle:()=>y(t=>!t),onServicePortChange:h,onServiceStart:()=>void S()}),!x&&e.jsx(U,{entries:g,activeEntry:d,previewKind:r.kind,onEntrySelect:t=>void w(t)})]}),x?e.jsx(I,{serviceSession:T,error:j,children:T?L:null}):e.jsx("div",{className:"min-h-0 flex-1 p-2",children:e.jsx("div",{className:"h-full overflow-hidden rounded-2xl border border-border/60 bg-white shadow-sm",children:L})}),e.jsx(Y,{open:V,onOpenChange:E,children:e.jsxs(Z,{className:"flex h-[95vh] max-w-[95vw] flex-col gap-0 overflow-hidden p-0",children:[e.jsxs(ee,{className:"sr-only",children:["Preview: ",F]}),e.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border/60 px-4 py-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:F}),e.jsx("span",{className:"text-xs text-muted-foreground",children:O(r.expiresAt)})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(u,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",onClick:f,title:"Refresh",children:e.jsx(z,{className:"h-3.5 w-3.5"})}),e.jsx(u,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",asChild:!0,title:"Open in new tab",children:e.jsx("a",{href:J,target:"_blank",rel:"noopener noreferrer",children:e.jsx(B,{className:"h-3.5 w-3.5"})})}),e.jsx(se,{asChild:!0,children:e.jsxs(u,{variant:"outline",size:"sm",className:"rounded-full",title:"Exit fullscreen",children:[e.jsx(ae,{className:"h-3.5 w-3.5"}),"Exit fullscreen"]})})]})]}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx("iframe",{src:r.previewUrl,className:"h-full w-full border-0",sandbox:A,title:"Task Preview Fullscreen"})})]})})]})}function R(s){var i,c;const n=((i=s==null?void 0:s.summary)==null?void 0:i.htmlEntries)??[],l=((c=s==null?void 0:s.summary)==null?void 0:c.markdownEntries)??[];return[...n.map(r=>({...r,kind:"html"})),...l.map(r=>({...r,kind:"markdown"}))]}function U({entries:s,activeEntry:n,previewKind:l,onEntrySelect:i}){return e.jsx("div",{className:"mt-2 flex flex-wrap items-center justify-between gap-2",children:e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.map(c=>{const r=(n==null?void 0:n.path)===c.path;return e.jsx("button",{type:"button",onClick:()=>i(c),className:r?"rounded-full border border-primary/40 bg-primary/10 px-3 py-1 text-xs font-medium text-primary":"rounded-full border border-border/70 bg-background/55 px-3 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:c.label},`${c.kind}:${c.path}`)}),e.jsxs(D,{variant:"outline",className:"rounded-full border-border/70 bg-background/60",children:[s.length," ",s.length===1?"file":"files"]}),e.jsx(D,{variant:"outline",className:"rounded-full border-border/70 bg-background/60",children:l==="service"?"Service proxy":"Sandboxed iframe"})]})})}function H({session:s,serviceModeOpen:n,allowPortPreview:l,servicePort:i,onRefresh:c,onFullscreen:r,onServiceModeToggle:v,onServicePortChange:d,onServiceStart:p}){const b=s?q(s):null;return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"flex min-w-0 items-center gap-3",children:n&&d&&p?e.jsxs("form",{className:"flex min-w-0 items-center gap-2",onSubmit:h=>{h.preventDefault(),p()},children:[e.jsx("span",{className:"shrink-0 text-sm font-semibold text-foreground",children:"Preview service"}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:["Port",e.jsx(re,{type:"number",min:1,max:65535,inputMode:"numeric",value:i??"",onChange:h=>d(h.target.value),placeholder:"12345","aria-label":"Service preview port",className:"h-7 w-24 rounded-full px-3 text-xs"})]}),e.jsxs(u,{type:"submit",variant:"outline",size:"sm",className:"h-7 rounded-full px-2.5 text-xs",children:[e.jsx(ce,{className:"h-3.5 w-3.5"}),"Run"]}),s&&e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:O(s.expiresAt)})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"truncate text-sm font-semibold text-foreground",children:s?G(s):"Preview"}),s&&e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:O(s.expiresAt)})]})}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",onClick:c,title:"Refresh",children:e.jsx(z,{className:"h-3.5 w-3.5"})}),e.jsx(u,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",asChild:!0,title:"Open in new tab",children:e.jsx("a",{href:b??s.previewUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsx(B,{className:"h-3.5 w-3.5"})})}),e.jsx(u,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",onClick:r,title:"Fullscreen",children:e.jsx(ne,{className:"h-3.5 w-3.5"})})]}),l&&e.jsxs(u,{type:"button",variant:n?"secondary":"ghost",size:"sm","aria-pressed":n,onClick:v,className:"h-7 shrink-0 rounded-full px-2.5 text-xs",children:[e.jsx(ue,{className:"h-3.5 w-3.5"}),"Advanced"]})]})]})}function I({serviceSession:s,error:n,children:l}){return e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n&&e.jsx("div",{className:"shrink-0 border-b border-destructive/20 bg-destructive/5 px-4 py-2 text-xs text-destructive",children:n}),e.jsx("div",{className:"min-h-0 flex-1 p-2",children:s&&l?e.jsx("div",{className:"h-full overflow-hidden rounded-2xl border border-border/60 bg-white shadow-sm",children:l}):e.jsx(N,{children:"No service preview running."})})]})}function q(s){return s.openUrl??s.previewUrl}function he(s){return s.kind==="service"?void 0:"allow-scripts allow-same-origin"}function G(s){if(s.kind==="service"&&typeof s.port=="number"){const n=s.entryPath?`/${s.entryPath.replace(/^\/+/,"")}`:"";return`127.0.0.1:${s.port}${n}`}return s.entryPath}function N({children:s}){return e.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:s})}function O(s){const n=Math.max(0,Math.round((s-Date.now())/1e3));if(n<60)return`${n}s`;const l=Math.floor(n/60),i=n%60;return`${l}m ${i}s`}export{H as PreviewHeader,I as PreviewServicePanel,ve as PreviewTab,U as PreviewToolbar,he as getPreviewIframeSandbox,q as getPreviewOpenUrl};
21
+ */const oe=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],de=M("settings-2",oe),ue={getOutput:X,createPreviewSession:W};function fe({taskId:s,api:n=ue,allowPortPreview:l=!0}){const[i,c]=a.useState(null),[r,v]=a.useState(null),[d,p]=a.useState(null),[b,h]=a.useState(""),[P,k]=a.useState(!1),[K,C]=a.useState(!0),[j,m]=a.useState(null),[V,E]=a.useState(!1),$=a.useCallback(async()=>{C(!0),m(null),c(null),v(null),p(null);try{const t=await n.getOutput(s);c(t),C(!1)}catch(t){m(t instanceof Error?t.message:"Failed to load output"),C(!1)}},[n,s]);a.useEffect(()=>{$()},[$]);const w=a.useCallback(async t=>{m(null);try{const o=await n.createPreviewSession(s,t!=null&&t.path?{path:t.path}:void 0);v(o),k(!1),t&&p(t)}catch(o){m(o instanceof Error?o.message:"Failed to create preview session")}},[n,s]),y=a.useCallback(async t=>{const o=t??Number.parseInt(b,10);if(!Number.isInteger(o)||o<1||o>65535){m("Enter a port between 1 and 65535");return}m(null);try{const S=await n.createPreviewSession(s,{port:o});v(S),p(null),h(String(o)),k(!0)}catch(S){m(S instanceof Error?S.message:"Failed to create preview session")}},[n,b,s]),g=a.useMemo(()=>R(i),[i]);a.useEffect(()=>{if(P||!(i!=null&&i.available)||g.length===0||r&&r.kind!=="service")return;const t=d??g[0];t&&w(t)},[d,i,g,P,r,w]);const f=a.useCallback(()=>{if((r==null?void 0:r.kind)==="service"&&typeof r.port=="number"){y(r.port);return}v(null);const t=d??R(i)[0];t&&w(t)},[d,i,r,y,w]);if(a.useEffect(()=>{if(!r)return;const t=r.expiresAt-Date.now()-5e3;if(t<=0){f();return}const o=window.setTimeout(f,t);return()=>window.clearTimeout(o)},[f,r]),K)return e.jsx(N,{children:"Loading preview..."});const x=l&&P;if(j&&r&&!x)return e.jsx(N,{children:e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"text-sm text-destructive",children:j}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(u,{variant:"outline",size:"sm",onClick:f,className:"rounded-full",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),"Retry"]})})]})});const F=!!(i!=null&&i.available);if(!F&&!l)return e.jsx(N,{children:"Task output is not available yet."});if(!r)return e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-4 py-2.5",children:[e.jsx(H,{session:null,serviceModeOpen:x,allowPortPreview:l,servicePort:b,onRefresh:f,onFullscreen:()=>E(!0),onServiceModeToggle:()=>k(t=>!t),onServicePortChange:h,onServiceStart:()=>void y()}),!x&&e.jsx(U,{entries:g,activeEntry:d,onEntrySelect:t=>void w(t)})]}),x?e.jsx(I,{serviceSession:null,error:j}):e.jsx(N,{children:j?e.jsx("span",{className:"text-sm text-destructive",children:j}):F?g.length>0?"Starting preview session...":"No HTML or Markdown files were found in this task output.":"Task output is not available yet."})]});const _=G(r),J=q(r),L=xe(r),T=r.kind==="service"?r:null,Q=x?T:r,A=e.jsx("iframe",{src:r.previewUrl,className:"h-full w-full border-0",sandbox:L,title:"Task Preview"});return e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-4 py-2.5",children:[e.jsx(H,{session:Q,serviceModeOpen:x,allowPortPreview:l,servicePort:b,onRefresh:f,onFullscreen:()=>E(!0),onServiceModeToggle:()=>k(t=>!t),onServicePortChange:h,onServiceStart:()=>void y()}),!x&&e.jsx(U,{entries:g,activeEntry:d,previewKind:r.kind,onEntrySelect:t=>void w(t)})]}),x?e.jsx(I,{serviceSession:T,error:j,children:T?A:null}):e.jsx("div",{className:"min-h-0 flex-1 p-2",children:e.jsx("div",{className:"h-full overflow-hidden rounded-2xl border border-border/60 bg-white shadow-sm",children:A})}),e.jsx(Y,{open:V,onOpenChange:E,children:e.jsxs(Z,{className:"flex h-[95vh] max-w-[95vw] flex-col gap-0 overflow-hidden p-0",children:[e.jsxs(ee,{className:"sr-only",children:["Preview: ",_]}),e.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border/60 px-4 py-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:_}),e.jsx("span",{className:"text-xs text-muted-foreground",children:z(r.expiresAt)})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(u,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",onClick:f,title:"Refresh",children:e.jsx(O,{className:"h-3.5 w-3.5"})}),e.jsx(u,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",asChild:!0,title:"Open in new tab",children:e.jsx("a",{href:J,target:"_blank",rel:"noopener noreferrer",children:e.jsx(B,{className:"h-3.5 w-3.5"})})}),e.jsx(se,{asChild:!0,children:e.jsxs(u,{variant:"outline",size:"sm",className:"rounded-full",title:"Exit fullscreen",children:[e.jsx(le,{className:"h-3.5 w-3.5"}),"Exit fullscreen"]})})]})]}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx("iframe",{src:r.previewUrl,className:"h-full w-full border-0",sandbox:L,title:"Task Preview Fullscreen"})})]})})]})}function R(s){var i,c;const n=((i=s==null?void 0:s.summary)==null?void 0:i.htmlEntries)??[],l=((c=s==null?void 0:s.summary)==null?void 0:c.markdownEntries)??[];return[...n.map(r=>({...r,kind:"html"})),...l.map(r=>({...r,kind:"markdown"}))]}function U({entries:s,activeEntry:n,previewKind:l,onEntrySelect:i}){return e.jsx("div",{className:"mt-2 flex flex-wrap items-center justify-between gap-2",children:e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.map(c=>{const r=(n==null?void 0:n.path)===c.path;return e.jsx("button",{type:"button",onClick:()=>i(c),className:r?"rounded-full border border-primary/40 bg-primary/10 px-3 py-1 text-xs font-medium text-primary":"rounded-full border border-border/70 bg-background/55 px-3 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:c.label},`${c.kind}:${c.path}`)}),e.jsxs(D,{variant:"outline",className:"rounded-full border-border/70 bg-background/60",children:[s.length," ",s.length===1?"file":"files"]}),e.jsx(D,{variant:"outline",className:"rounded-full border-border/70 bg-background/60",children:l==="service"?"Service proxy":"Sandboxed iframe"})]})})}function H({session:s,serviceModeOpen:n,allowPortPreview:l,servicePort:i,onRefresh:c,onFullscreen:r,onServiceModeToggle:v,onServicePortChange:d,onServiceStart:p}){const b=s?q(s):null;return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"flex min-w-0 items-center gap-3",children:n&&d&&p?e.jsxs("form",{className:"flex min-w-0 items-center gap-2",onSubmit:h=>{h.preventDefault(),p()},children:[e.jsx("span",{className:"shrink-0 text-sm font-semibold text-foreground",children:"Preview service"}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:["Port",e.jsx(re,{type:"number",min:1,max:65535,inputMode:"numeric",value:i??"",onChange:h=>d(h.target.value),placeholder:"12345","aria-label":"Service preview port",className:"h-7 w-24 rounded-full px-3 text-xs"})]}),e.jsxs(u,{type:"submit",variant:"outline",size:"sm",className:"h-7 rounded-full px-2.5 text-xs",children:[e.jsx(te,{className:"h-3.5 w-3.5"}),"Run"]}),s&&e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:z(s.expiresAt)})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"truncate text-sm font-semibold text-foreground",children:s?G(s):"Preview"}),s&&e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:z(s.expiresAt)})]})}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",onClick:c,title:"Refresh",children:e.jsx(O,{className:"h-3.5 w-3.5"})}),e.jsx(u,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",asChild:!0,title:"Open in new tab",children:e.jsx("a",{href:b??s.previewUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsx(B,{className:"h-3.5 w-3.5"})})}),e.jsx(u,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",onClick:r,title:"Fullscreen",children:e.jsx(ie,{className:"h-3.5 w-3.5"})})]}),l&&e.jsxs(u,{type:"button",variant:n?"secondary":"ghost",size:"sm","aria-pressed":n,onClick:v,className:"h-7 shrink-0 rounded-full px-2.5 text-xs",children:[e.jsx(de,{className:"h-3.5 w-3.5"}),"Advanced"]})]})]})}function I({serviceSession:s,error:n,children:l}){return e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n&&e.jsx("div",{className:"shrink-0 border-b border-destructive/20 bg-destructive/5 px-4 py-2 text-xs text-destructive",children:n}),e.jsx("div",{className:"min-h-0 flex-1 p-2",children:s&&l?e.jsx("div",{className:"h-full overflow-hidden rounded-2xl border border-border/60 bg-white shadow-sm",children:l}):e.jsx(N,{children:"No service preview running."})})]})}function q(s){return s.openUrl??s.previewUrl}function xe(s){return s.kind==="service"?void 0:"allow-scripts allow-same-origin"}function G(s){if(s.kind==="service"&&typeof s.port=="number"){const n=s.entryPath?`/${s.entryPath.replace(/^\/+/,"")}`:"";return`127.0.0.1:${s.port}${n}`}return s.entryPath}function N({children:s}){return e.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:s})}function z(s){const n=Math.max(0,Math.round((s-Date.now())/1e3));if(n<60)return`${n}s`;const l=Math.floor(n/60),i=n%60;return`${l}m ${i}s`}export{H as PreviewHeader,I as PreviewServicePanel,fe as PreviewTab,U as PreviewToolbar,xe as getPreviewIframeSandbox,q as getPreviewOpenUrl};
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilesTab-DZ2CIfBe.js","assets/index-U21aiFFx.js","assets/index-DfiptIs_.css","assets/folder-DcAuKKJN.js","assets/file-CkjhxpTi.js","assets/PreviewTab-DGzp5vs_.js","assets/input-BA2z1FFh.js"])))=>i.map(i=>d[i]);
2
- import{c as N,ax as k,r as s,j as e,L as S,P as T,O as C,a1 as P,aT as M,aU as _,aV as j,aW as L,aX as E,a0 as w,aY as O}from"./index-U21aiFFx.js";import{n as A,j as I,i as F,L as R,C as z,T as v,m as V}from"./DashboardShared-C3sx-Aj3.js";/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilesTab-BWK1YZk0.js","assets/index-DHC5U3_j.js","assets/index-DfiptIs_.css","assets/folder-Cl9WN_cx.js","assets/file-BdIshbRs.js","assets/PreviewTab-CgGqqXSW.js","assets/input-CdkmqjGJ.js"])))=>i.map(i=>d[i]);
2
+ import{c as N,ax as k,r as s,j as e,L as S,P as T,O as C,a1 as P,aT as M,aU as _,aV as j,aW as L,aX as E,a0 as w,aY as O}from"./index-DHC5U3_j.js";import{n as A,j as I,i as F,L as R,C as z,T as v,m as V}from"./DashboardShared-BfSOAHkB.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 D=[["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",D),B=s.lazy(async()=>({default:(await w(()=>import("./FilesTab-DZ2CIfBe.js"),__vite__mapDeps([0,1,2,3,4]))).FilesTab})),U=s.lazy(async()=>({default:(await w(()=>import("./PreviewTab-DGzp5vs_.js"),__vite__mapDeps([5,1,2,6]))).PreviewTab})),W={getOutput:j,getOutputTree:_,getOutputContent:M},G={getOutput:j,createPreviewSession:(t,r)=>O(t,typeof r=="string"?r:r==null?void 0:r.path)};function $(){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,b]=await Promise.all([L(t),E(t)]);if(o||l.current!==t)return;n(f),a(y=>h?b.logs:V(y,b.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(H,{conversation:r,logs:c,loading:x,error:p})}function H({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?I(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(X,{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:g(a==="transcript"),children:"Transcript"}),e.jsx("button",{type:"button",onClick:()=>x("files"),className:g(a==="files"),children:"Files"}),e.jsx("button",{type:"button",onClick:()=>x("preview"),className:g(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:W})})}),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(U,{taskId:t.shareId,api:G,allowPortPreview:!1})})})]}):m]})]})}function g(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 X({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{$ as SharedConversationPage,H as SharedConversationView};
7
+ */const D=[["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",D),B=s.lazy(async()=>({default:(await w(()=>import("./FilesTab-BWK1YZk0.js"),__vite__mapDeps([0,1,2,3,4]))).FilesTab})),U=s.lazy(async()=>({default:(await w(()=>import("./PreviewTab-CgGqqXSW.js"),__vite__mapDeps([5,1,2,6]))).PreviewTab})),W={getOutput:j,getOutputTree:_,getOutputContent:M},G={getOutput:j,createPreviewSession:(t,r)=>O(t,typeof r=="string"?r:r==null?void 0:r.path)};function $(){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,b]=await Promise.all([L(t),E(t)]);if(o||l.current!==t)return;n(f),a(y=>h?b.logs:V(y,b.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(H,{conversation:r,logs:c,loading:x,error:p})}function H({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?I(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(X,{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:g(a==="transcript"),children:"Transcript"}),e.jsx("button",{type:"button",onClick:()=>x("files"),className:g(a==="files"),children:"Files"}),e.jsx("button",{type:"button",onClick:()=>x("preview"),className:g(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:W})})}),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(U,{taskId:t.shareId,api:G,allowPortPreview:!1})})})]}):m]})]})}function g(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 X({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{$ as SharedConversationPage,H as SharedConversationView};
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-U21aiFFx.js";/**
1
+ import{c as a}from"./index-DHC5U3_j.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}from"./index-U21aiFFx.js";/**
1
+ import{c as o}from"./index-DHC5U3_j.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
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-BGDwH7LG.js","assets/DashboardShared-C3sx-Aj3.js","assets/input-BA2z1FFh.js","assets/folder-DcAuKKJN.js","assets/SharedConversationPage-6Y6HiGBv.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-0TdEZxup.js","assets/DashboardShared-BfSOAHkB.js","assets/input-CdkmqjGJ.js","assets/folder-Cl9WN_cx.js","assets/SharedConversationPage-COhUZENs.js"])))=>i.map(i=>d[i]);
2
2
  function gS(n,r){for(var o=0;o<r.length;o++){const i=r[o];if(typeof i!="string"&&!Array.isArray(i)){for(const u in i)if(u!=="default"&&!(u in n)){const f=Object.getOwnPropertyDescriptor(i,u);f&&Object.defineProperty(n,u,f.get?f:{enumerable:!0,get:()=>i[u]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function o(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(u){if(u.ep)return;u.ep=!0;const f=o(u);fetch(u.href,f)}})();function dv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Iu={exports:{}},No={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -273,4 +273,4 @@ You can add a description to the \`${wr}\` by passing a \`${Ub}\` component as a
273
273
 
274
274
  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 \`${wr}\`. 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.
275
275
 
276
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return b.useEffect(()=>{var i;document.getElementById((i=n.current)==null?void 0:i.getAttribute("aria-describedby"))||console.warn(r)},[r,n]),null},$5=Ob,X5=Mb,Q5=Db,qb=jb,Gb=zb,$b=Hb,Xb=Yb,Qb=Lb,Zb=Bb;const Z5=$5,K5=X5,P5=Q5,Kb=b.forwardRef(({className:n,...r},o)=>v.jsx(qb,{className:be("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),...r,ref:o}));Kb.displayName=qb.displayName;const Pb=b.forwardRef(({className:n,...r},o)=>v.jsxs(P5,{children:[v.jsx(Kb,{}),v.jsx(Gb,{ref:o,className:be("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),...r})]}));Pb.displayName=Gb.displayName;const Jb=({className:n,...r})=>v.jsx("div",{className:be("flex flex-col space-y-2 text-center sm:text-left",n),...r});Jb.displayName="AlertDialogHeader";const Fb=({className:n,...r})=>v.jsx("div",{className:be("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...r});Fb.displayName="AlertDialogFooter";const Ib=b.forwardRef(({className:n,...r},o)=>v.jsx(Qb,{ref:o,className:be("text-lg font-semibold",n),...r}));Ib.displayName=Qb.displayName;const Wb=b.forwardRef(({className:n,...r},o)=>v.jsx(Zb,{ref:o,className:be("text-sm text-muted-foreground",n),...r}));Wb.displayName=Zb.displayName;const ex=b.forwardRef(({className:n,...r},o)=>v.jsx($b,{ref:o,className:be(Zf(),n),...r}));ex.displayName=$b.displayName;const tx=b.forwardRef(({className:n,...r},o)=>v.jsx(Xb,{ref:o,className:be(Zf({variant:"outline"}),"mt-2 sm:mt-0",n),...r}));tx.displayName=Xb.displayName;const J5=2e3,F5=24e4;function qa(n){if(n==null||n==="")return"Unavailable";const r=new Date(n);return Number.isNaN(r.getTime())?"Unavailable":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(r)}function I5(n){const r=Math.max(0,Math.floor(n)),o=Math.floor(r/86400),i=Math.floor(r%86400/3600),u=Math.floor(r%3600/60);return o>0?`${o}d ${i}h`:i>0?`${i}h ${u}m`:`${u}m`}function sv(n){if(n==null||Number.isNaN(n))return"Unavailable";const r=["B","KB","MB","GB","TB"];let o=n,i=0;for(;o>=1024&&i<r.length-1;)o/=1024,i+=1;return`${o.toFixed(o>=10||i===0?0:1)} ${r[i]}`}function nx(n){return n==="ok"?"default":n==="missing"||n==="install-failed"||n==="login-failed"?"destructive":n==="not-authenticated"||n==="unsupported-platform"?"outline":"secondary"}function W5(n){return n.available?v.jsxs(St,{className:"gap-1 rounded-full px-2 py-0.5 text-[10px]",children:[v.jsx(jw,{className:"h-3 w-3"}),"Available"]}):v.jsxs(St,{variant:"destructive",className:"gap-1 rounded-full px-2 py-0.5 text-[10px]",children:[v.jsx(kw,{className:"h-3 w-3"}),"Unavailable"]})}function eR(n){return n.update?n.update.updateAvailable?v.jsxs(St,{variant:"outline",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.14em]",children:["Update ",n.update.latestVersion]}):v.jsx(St,{variant:"secondary",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.14em]",children:"Up to date"}):null}function tR(n){var o;const r=`npm install -g ${(o=n.update)==null?void 0:o.packageName}@latest`;return n.id==="claude"?`${r} --include=optional --ignore-scripts=false`:r}function nR(n){return new Promise(r=>setTimeout(r,n))}function cv(n){return n.status==="succeeded"||n.status==="failed"}async function aR(n){if(cv(n))return n;const r=Date.now()+F5;let o=n;for(;!cv(o)&&Date.now()<r;)await nR(J5),o=await cw(n.id);return o}function lR(n){if(n.error)return n.error;const r=n.result;return(r==null?void 0:r.detail)??null}function ze({label:n,value:r,mono:o=!1}){return v.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:[v.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:n}),v.jsx("span",{className:be("break-all text-right text-[11px] text-foreground",o&&"font-mono text-[11px]"),children:r})]})}function rR({agent:n,nodeName:r,upgrading:o,onUpgrade:i}){var d,h;const u=((d=n.update)==null?void 0:d.updateAvailable)===!0,f=eR(n);return v.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/70 p-2.5 shadow-sm",children:[v.jsxs("div",{className:"flex items-start justify-between gap-2",children:[v.jsxs("div",{children:[v.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-semibold text-foreground",children:[v.jsx(Yv,{className:"h-3.5 w-3.5 text-primary"}),n.label]}),v.jsxs("div",{className:"mt-0.5 text-[10px] text-muted-foreground",children:["Command: ",v.jsx("span",{className:"font-mono text-[10px]",children:n.command})]})]}),v.jsxs("div",{className:"flex flex-col items-end gap-1",children:[W5(n),u?v.jsxs(Z5,{children:[v.jsx(K5,{asChild:!0,children:v.jsx("button",{type:"button",disabled:o,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:f})}),v.jsxs(Pb,{children:[v.jsxs(Jb,{children:[v.jsxs(Ib,{children:["Upgrade ",n.label,"?"]}),v.jsxs(Wb,{children:["This runs ",tR(n)," on ",r,". Remote nodes execute the command on the remote machine."]})]}),v.jsxs(Fb,{children:[v.jsx(tx,{children:"Cancel"}),v.jsx(ex,{onClick:()=>i(n),children:"Upgrade"})]})]})]}):f]})]}),v.jsxs("div",{className:"mt-2 space-y-1 text-[11px]",children:[v.jsx(ze,{label:"Version",value:n.version??"Unavailable",mono:!!n.version}),n.update&&v.jsx(ze,{label:"Latest",value:n.update.latestVersion??"Unavailable",mono:!!n.update.latestVersion}),v.jsx(ze,{label:"Path",value:n.path??"Not on PATH",mono:!!n.path}),v.jsx(ze,{label:"Checked",value:qa(n.checkedAt)}),n.update&&v.jsx(ze,{label:"Update check",value:qa(n.update.checkedAt)})]}),((h=n.update)==null?void 0:h.detail)&&v.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&&v.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[v.jsx(St,{variant:nx(n.metadataStatus),className:"rounded-full px-2 py-0 text-[10px] uppercase tracking-[0.14em]",children:n.metadataStatus}),v.jsx("span",{children:"Startup preflight"})]}),n.detail&&v.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 cs({name:n,status:r}){return v.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:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[11px] font-medium text-foreground",children:n}),v.jsx("div",{className:"text-[10px] text-muted-foreground",children:qa(r==null?void 0:r.checkedAt)})]}),v.jsxs("div",{className:"flex items-center gap-1.5",children:[typeof(r==null?void 0:r.authenticated)=="boolean"&&v.jsx(St,{variant:r.authenticated?"default":"outline",className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:r.authenticated?"auth ok":"auth required"}),v.jsx(St,{variant:nx(r==null?void 0:r.status),className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:(r==null?void 0:r.status)??"unknown"})]})]})}function oR(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 iR(n,r){var o;return(o=n==null?void 0:n.nodes)!=null&&o.length?n.nodes:r?[r]:[]}function sR(n,r){var i;if(r&&n.id===r.nodeId)return r;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,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 cR(n,r){return n.id===r?`${n.name} (this node)`:`${n.name} (${n.role})`}function uR({cluster:n,systemInfo:r,sseConnected:o,onRefresh:i}){var C,j,D,B,Z,F,q,V,le,he,pe,fe,me,ge,ue,O,Y,J,re,I,_,G,X,W;const u=b.useMemo(()=>iR(n,r),[n,r]),[f,d]=b.useState(()=>{var P;return(r==null?void 0:r.nodeId)??((P=n==null?void 0:n.self)==null?void 0:P.id)??""}),[h,y]=b.useState(null),p=(n==null?void 0:n.self)??r??u[0]??null,x=u.find(P=>P.id===f)??p,m=x?sR(x,r):null,w=!!(r&&x&&x.id===r.nodeId),N=w||!!(x!=null&&x.settingsSnapshot),A=b.useMemo(()=>oR(m==null?void 0:m.packages),[m==null?void 0:m.packages]),E=((C=m==null?void 0:m.startupRequirements)==null?void 0:C.components)??(m==null?void 0:m.components)??{};async function T(P){if(!x)return;const ne=`${x.id}:${P.id}`;y(ne);try{const ee=await uw(x.id,P.id);Ya.info(`${P.label} upgrade started on ${x.name}`);const ae=await aR(ee);ae.status==="succeeded"?(Ya.success(`${P.label} upgrade finished on ${x.name}`),i==null||i()):ae.status==="failed"?Ya.error(lR(ae)??`${P.label} upgrade failed`):Ya.info(`${P.label} upgrade is still running on ${x.name}`)}catch(ee){Ya.error(ee instanceof Error?ee.message:`${P.label} upgrade failed`)}finally{y(null)}}return!x||!m?v.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..."}):v.jsxs("div",{className:"space-y-4",children:[v.jsx("section",{className:"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:v.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end md:justify-between",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[v.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:[v.jsx(dy,{status:x.status}),v.jsx("span",{className:"font-medium text-foreground",children:x.name})]}),v.jsx(nN,{role:x.role}),v.jsx(St,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:x.transportType??m.transportType??"direct"}),v.jsx(St,{variant:w?"default":"outline",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:w?"Live local session":"Leader-synced snapshot"})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] uppercase tracking-[0.34em] text-muted-foreground",children:"Session"}),v.jsx("h3",{className:"mt-0.5 text-sm font-semibold tracking-tight text-foreground",children:"Node runtime"}),v.jsx("p",{className:"mt-1 max-w-2xl text-[11px] text-muted-foreground",children:"Inspect the selected node's runtime environment, connectivity surface, and packaged build metadata from one place."})]}),u.length>1&&v.jsxs("div",{className:"max-w-md space-y-1.5",children:[v.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Inspect node"}),v.jsxs(p5,{value:x.id,onValueChange:d,children:[v.jsx(lb,{className:"h-7 rounded-lg border-border/70 bg-background/70 text-[11px]",children:v.jsx(g5,{placeholder:"Choose a node"})}),v.jsx(ib,{children:u.map(P=>v.jsx(sb,{value:P.id,children:cR(P,r==null?void 0:r.nodeId)},P.id))})]})]})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[v.jsxs(St,{variant:o?"default":"outline",className:"gap-1 rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:[v.jsx(Qv,{className:"h-3 w-3"}),o?"Live link connected":"Live link reconnecting"]}),v.jsxs(St,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Uptime ",I5(m.uptime)]}),!w&&v.jsxs(St,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Updated ",qa((j=x.settingsSnapshot)==null?void 0:j.collectedAt)]})]})]})}),!N&&v.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."}),v.jsxs(z5,{defaultValue:"session",className:"space-y-2",children:[v.jsxs(Rb,{className:"h-auto flex-wrap rounded-xl border border-border/60 bg-muted/40 p-0.5",children:[v.jsx(ps,{value:"session",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"Session"}),v.jsx(ps,{value:"access",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"Access"}),v.jsx(ps,{value:"about",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"About"})]}),v.jsxs(gs,{value:"session",className:"mt-0 grid gap-2 xl:grid-cols-[1.15fr_0.85fr]",children:[v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Iw,{className:"h-3.5 w-3.5 text-primary"}),"Selected node"]}),v.jsx(Dn,{className:"text-[10px]",children:"Cluster role, identity, and node-scoped runtime state."})]}),v.jsxs(jn,{className:"space-y-0 px-3 pb-2.5",children:[v.jsx(ze,{label:"Node ID",value:m.nodeId,mono:!0}),v.jsx(ze,{label:"Status",value:x.status}),v.jsx(ze,{label:"Role",value:x.role}),v.jsx(ze,{label:"Endpoint",value:x.endpoint,mono:!0}),v.jsx(ze,{label:"Joined",value:qa(x.joinedAt)}),v.jsx(ze,{label:"Heartbeat",value:qa(x.lastHeartbeat)}),v.jsx(ze,{label:"Capabilities",value:x.capabilities.length>0?x.capabilities.join(", "):"None"})]})]}),v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Hw,{className:"h-3.5 w-3.5 text-primary"}),"OS info"]}),v.jsx(Dn,{className:"text-[10px]",children:"Host and resource details reported by the current process."})]}),v.jsxs(jn,{className:"space-y-0 px-3 pb-2.5",children:[v.jsx(ze,{label:"Host",value:((D=m.os)==null?void 0:D.hostname)??"Unavailable"}),v.jsx(ze,{label:"Platform",value:m.os?`${m.os.platform} ${m.os.release}`:"Unavailable"}),v.jsx(ze,{label:"Arch",value:((B=m.os)==null?void 0:B.arch)??"Unavailable"}),v.jsx(ze,{label:"CPU",value:((Z=m.os)==null?void 0:Z.cpuModel)??"Unavailable"}),v.jsx(ze,{label:"Cores",value:String(((F=m.os)==null?void 0:F.cpuCount)??"Unavailable")}),v.jsx(ze,{label:"Memory",value:m.os?`${sv(m.os.freeMemoryBytes)} free / ${sv(m.os.totalMemoryBytes)} total`:"Unavailable"})]})]}),v.jsxs(_n,{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:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Yv,{className:"h-3.5 w-3.5 text-primary"}),"Available agents"]}),v.jsx(Dn,{className:"text-[10px]",children:w?"Live command availability for Codex and Claude Code on this node.":"Most recent agent availability snapshot synced from this node."})]}),v.jsx(jn,{className:"grid gap-2 px-3 pb-2.5 md:grid-cols-2",children:(m.agents??[]).map(P=>v.jsx(rR,{agent:P,nodeName:x.name,upgrading:h===`${x.id}:${P.id}`,onUpgrade:T},P.id))})]})]}),v.jsxs(gs,{value:"access",className:"mt-0 grid gap-2 xl:grid-cols-2",children:[v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Aw,{className:"h-3.5 w-3.5 text-primary"}),"Access surface"]}),v.jsx(Dn,{className:"text-[10px]",children:"How this node is exposed to the dashboard and other peers."})]}),v.jsxs(jn,{className:"space-y-0 px-3 pb-2.5",children:[v.jsx(ze,{label:"Transport",value:x.transportType??m.transportType??"direct"}),v.jsx(ze,{label:"Node URL",value:x.endpoint,mono:!0}),v.jsx(ze,{label:"Node tunnel",value:x.devtunnelEndpoint??"Disabled",mono:!!x.devtunnelEndpoint}),v.jsx(ze,{label:"Dashboard URL",value:x.dashboardOrigin??m.localDashboardOrigin??"Unavailable",mono:!!(x.dashboardOrigin||m.localDashboardOrigin)}),v.jsx(ze,{label:"Local dashboard",value:m.localDashboardOrigin??"Unavailable",mono:!!m.localDashboardOrigin})]})]}),v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(nE,{className:"h-3.5 w-3.5 text-primary"}),"Auth"]}),v.jsx(Dn,{className:"text-[10px]",children:"Current bearer-auth and trusted access posture."})]}),v.jsxs(jn,{className:"space-y-0 px-3 pb-2.5",children:[v.jsx(ze,{label:"Enabled",value:(q=m.auth)!=null&&q.enabled?"Yes":"No"}),v.jsx(ze,{label:"Same tenant",value:(V=m.auth)!=null&&V.allowSameTenant?"Allowed":"Off"}),v.jsx(ze,{label:"Allowed users",value:(le=m.auth)!=null&&le.allowedUsers.length?m.auth.allowedUsers.join(", "):"None"})]})]}),v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Gw,{className:"h-3.5 w-3.5 text-primary"}),"Paths"]}),v.jsx(Dn,{className:"text-[10px]",children:"Workspace and runtime paths currently used by this node."})]}),v.jsxs(jn,{className:"space-y-0 px-3 pb-2.5",children:[v.jsx(ze,{label:"Work dir",value:((he=m.runtime)==null?void 0:he.workDir)??m.workDir??"Unavailable",mono:!!(((pe=m.runtime)==null?void 0:pe.workDir)??m.workDir)}),v.jsx(ze,{label:"Storage",value:((fe=m.runtime)==null?void 0:fe.storagePath)??"Unavailable",mono:!!((me=m.runtime)!=null&&me.storagePath)}),v.jsx(ze,{label:"Process cwd",value:((ge=m.runtime)==null?void 0:ge.cwd)??"Unavailable",mono:!!((ue=m.runtime)!=null&&ue.cwd)}),v.jsx(ze,{label:"Started",value:qa((O=m.runtime)==null?void 0:O.startedAt)}),v.jsx(ze,{label:"PID",value:m.runtime?String(m.runtime.pid):"Unavailable",mono:!!m.runtime})]})]}),v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Vv,{className:"h-3.5 w-3.5 text-primary"}),"Startup checks"]}),v.jsx(Dn,{className:"text-[10px]",children:"Dependency preflight snapshot persisted during node startup."})]}),v.jsxs(jn,{className:"space-y-3 px-3 pb-2.5",children:[v.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/70 px-3 py-2",children:[v.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Last checked"}),v.jsx("div",{className:"mt-0.5 text-[11px] text-foreground",children:qa((Y=m.startupRequirements)==null?void 0:Y.lastCheckedAt)})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(cs,{name:"Azure CLI",status:E.az}),v.jsx(cs,{name:"DevTunnel",status:E.devtunnel}),v.jsx(cs,{name:"Claude Code",status:E.claude}),v.jsx(cs,{name:"Codex",status:E.codex})]})]})]})]}),v.jsxs(gs,{value:"about",className:"mt-0 grid gap-2 xl:grid-cols-[0.92fr_1.08fr]",children:[v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Nw,{className:"h-3.5 w-3.5 text-primary"}),"Repository"]}),v.jsx(Dn,{className:"text-[10px]",children:"Source-of-truth repository metadata for this running node."})]}),v.jsxs(jn,{className:"space-y-3 px-3 pb-2.5",children:[(J=m.repository)!=null&&J.url?v.jsxs("a",{href:m.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:[v.jsx("span",{className:"font-mono text-[10px]",children:m.repository.url}),v.jsx(Yw,{className:"h-3.5 w-3.5 text-muted-foreground transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5"})]}):v.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."}),v.jsxs("div",{className:"space-y-0",children:[v.jsx(ze,{label:"Branch",value:((re=m.repository)==null?void 0:re.branch)??"Unavailable",mono:!!((I=m.repository)!=null&&I.branch)}),v.jsx(ze,{label:"Commit",value:((_=m.repository)==null?void 0:_.commit)??"Unavailable",mono:!!((G=m.repository)!=null&&G.commit)}),v.jsx(ze,{label:"Runtime",value:`${m.packageName??"meshy"} ${m.version}`,mono:!0}),v.jsx(ze,{label:"Node.js",value:((X=m.runtime)==null?void 0:X.nodeVersion)??"Unavailable",mono:!!((W=m.runtime)!=null&&W.nodeVersion)})]})]})]}),v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Xw,{className:"h-3.5 w-3.5 text-primary"}),"Package versions"]}),v.jsx(Dn,{className:"text-[10px]",children:"Version snapshot for the packages most relevant to this dashboard session."})]}),v.jsx(jn,{className:"space-y-1.5 px-3 pb-2.5",children:A.map(P=>{var ne,ee;return v.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:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[11px] font-medium text-foreground",children:P.label}),v.jsx("div",{className:"text-[10px] text-muted-foreground",children:(ne=P.value)==null?void 0:ne.name})]}),v.jsx(St,{variant:"outline",className:"rounded-[11px] border-border/70 bg-background/60 font-mono text-[10px]",children:(ee=P.value)==null?void 0:ee.version})]},P.key)})})]})]})]})]})}function fR(){const{cluster:n,systemInfo:r,sseConnected:o,refresh:i}=Bv(),[u,f]=b.useState(!1);return v.jsxs(gC,{open:u,onOpenChange:f,children:[v.jsx(vC,{asChild:!0,children:v.jsx($a,{variant:"ghost",size:"icon","aria-label":"Settings",title:"Settings",className:"rounded-[16px] border border-border/70 bg-background/70 shadow-sm",children:v.jsx(eE,{className:"h-4 w-4"})})}),v.jsxs(Py,{className:"grid h-[min(82vh,42rem)] max-h-[82vh] max-w-[min(90vw,56rem)] grid-rows-[auto_minmax(0,1fr)] overflow-hidden rounded-[22px] border-border/70 bg-background/96 p-0 shadow-[0_40px_120px_-56px_rgba(15,23,42,0.75)] backdrop-blur-xl",children:[v.jsxs(Jy,{className:"shrink-0 border-b border-border/60 px-3 py-2 sm:px-4",children:[v.jsxs(Fy,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Zw,{className:"h-3.5 w-3.5 text-primary"}),"Settings"]}),v.jsx(Iy,{className:"text-[11px]",children:"Session diagnostics, access configuration, and build metadata for the current Meshy node."})]}),v.jsx("div",{className:"min-h-0 overflow-y-auto px-3 py-2.5 sm:px-4 sm:py-3",children:v.jsx(uR,{cluster:n,systemInfo:r,sseConnected:o,onRefresh:i})})]})]})}const T_="bypass",dR=[{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"}],C_=[{value:"bypass",label:"Bypass"},{value:"plan",label:"Plan"},{value:"edit",label:"Edit"},{value:"dangerous",label:"Dangerous"}],A_=new Set(dR.filter(n=>n.supportsFollowUp).map(n=>n.value)),R_=[{value:"active",label:"Active"},{value:"running",label:"Running"},{value:"waiting",label:"Waiting"},{value:"closed",label:"Closed"},{value:"shared",label:"Shared"},{value:"archived",label:"Archived"}],__=[{value:"all",label:"All task types"},{value:"native",label:"Native sessions"},{value:"meshy",label:"Meshy chats"}],mR=new Set(["pending","assigned"]),hR=new Set(["running"]),pR=new Set(["completed","failed","cancelled"]);function O_(n,r){switch(r){case"running":return hR.has(n.status);case"waiting":return mR.has(n.status);case"closed":return pR.has(n.status);case"shared":return!!n.activeShare;case"archived":return n.status==="archived";case"active":default:return n.status!=="archived"}}function M_(n,r){if(r==="all")return!0;const o=n.conversationKind==="nativeSession";return r==="native"?o:!o}function D_(n,r){const o=r.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 gR(n,r,o){if(!n)return"unassigned";const i=r==null?void 0:r.find(u=>u.id===n);return(i==null?void 0:i.name)??o??n.slice(0,8)}function j_(n,r,o){return gR(n,r,o).toLowerCase()}function z_(n,r){return[...n].sort((o,i)=>o.id===r?-1:i.id===r?1:o.name.localeCompare(i.name))}function k_(n){if(!n||typeof n!="object")return null;const r=n,o=r.createMode,i=o==="chat"||o==="native"?o:void 0;return{draftNewTask:r.draftNewTask===!0,returnRoute:typeof r.returnRoute=="string"?r.returnRoute:void 0,returnTaskId:typeof r.returnTaskId=="string"||r.returnTaskId===null?r.returnTaskId:void 0,createMode:i}}function L_(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 U_(n){return n==="default workspace"?n:n.replace(/\\/g,"/").split("/").filter(Boolean).at(-1)??n}function B_(n){const r=Date.now()-n;return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m`:r<864e5?`${Math.floor(r/36e5)}h`:`${Math.floor(r/864e5)}d`}function H_(n){return new Date(n).toLocaleString()}function V_(n){const r=Math.floor(n/1e3),o=Math.floor(r/3600),i=Math.floor(r%3600/60),u=r%60;return`${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}:${String(u).padStart(2,"0")}`}async function vR(n,r="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),Ya.success(r),!0;const f=globalThis.document,d=(u=f==null?void 0:f.execCommand)==null?void 0:u.bind(f);if(!(f!=null&&f.body)||typeof f.createElement!="function"||typeof d!="function")throw new Error("Clipboard access is unavailable");const h=f.createElement("textarea"),y=f.activeElement,p=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",f.body.appendChild(h),h.select(),h.setSelectionRange(0,h.value.length);const x=d("copy");if(f.body.removeChild(h),p==null||p.focus(),!x)throw new Error("Clipboard access is unavailable");return Ya.success(r),!0}catch(f){return Ya.error(f instanceof Error?f.message:"Failed to copy"),!1}}function Y_(n,r,o){const i=new Map;for(const f of n){const d=f.assignedTo??null,h=d??"__unassigned__",y=d?r.get(d)??f.assignedNodeName??d.slice(0,8):"Unassigned",p=f.effectiveProjectPath??f.project??"default workspace";i.has(h)||i.set(h,{nodeId:d,nodeName:y,dirMap:new Map});const x=i.get(h);x.dirMap.has(p)||x.dirMap.set(p,[]),x.dirMap.get(p).push(f)}const u=Array.from(i.values()).map(({nodeId:f,nodeName:d,dirMap:h})=>{const y=Array.from(h.entries()).map(([p,x])=>({path:p,tasks:x})).sort((p,x)=>x.tasks.length-p.tasks.length||p.path.localeCompare(x.path));return{nodeId:f,nodeName:d,dirs:y}});return u.sort((f,d)=>{if(o){if(f.nodeId===o)return-1;if(d.nodeId===o)return 1}return f.nodeId===null?1:d.nodeId===null?-1:f.nodeName.localeCompare(d.nodeName)}),u}const yR={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"};function bR(n){return n.split(".")[0]??"unknown"}function xR(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function br(n,r){return(r==null?void 0:r.get(n))??n}function SR(n,r){const o=n.data,i=o.operation;switch(n.type){case"node.joined":return`${o.name} joined the cluster`;case"node.left":return`${br(o.nodeId,r)} left (${o.reason})`;case"node.status":return`${br(o.nodeId,r)} is now ${o.status}`;case"node.operation.created":return`${i==null?void 0:i.kind} ${i==null?void 0:i.status} on ${br(i==null?void 0:i.nodeId,r)}`;case"node.operation.updated":return`${i==null?void 0:i.kind} ${i==null?void 0:i.status} on ${br(i==null?void 0:i.nodeId,r)}`;case"transport.changed":return`${br(o.nodeId,r)} transport switched to ${o.transportType}`;case"task.created":return`"${o.title}" created`;case"task.assigned":return`task assigned to ${br(o.nodeId,r)}`;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 wR(n){return JSON.stringify(n,null,2)}function ER({events:n,maxHeight:r="400px",emptyTitle:o="No live events yet",emptyDescription:i="Cluster activity appears here as it happens.",nodeNameById:u,onDismiss:f}){return n.length===0?v.jsx("div",{className:"flex h-28 items-center justify-center rounded-[20px] border border-dashed border-border/70 bg-background/40 text-center",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[11px] text-muted-foreground",children:o}),v.jsx("div",{className:"mt-1 text-[11px] text-muted-foreground/70",children:i})]})}):v.jsx("div",{className:"overflow-y-auto pr-1",style:{maxHeight:r},children:v.jsx("div",{className:"space-y-1.5",children:n.map(d=>{const h=bR(d.type);return v.jsx("div",{className:"rounded-xl border border-border/60 bg-background/45 px-2 py-1.5 transition-colors hover:border-border hover:bg-background/65",children:v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex items-start justify-between gap-1.5",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[v.jsx("div",{className:"font-mono text-[10px] text-muted-foreground",children:xR(d.timestamp)}),v.jsx(St,{variant:"outline",className:be("w-fit text-[9px] font-medium uppercase tracking-[0.14em] px-1.5 py-0",yR[h]),children:d.type})]}),v.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[v.jsx($a,{type:"button",variant:"ghost",size:"icon",className:"h-5 w-5 rounded-[8px] text-muted-foreground",onClick:()=>void vR(wR(d),"Event copied"),"aria-label":`Copy ${d.type} event`,title:"Copy event",children:v.jsx(Uw,{className:"h-3 w-3"})}),f&&v.jsx($a,{type:"button",variant:"ghost",size:"icon",className:"h-5 w-5 rounded-[8px] text-muted-foreground hover:text-foreground",onClick:()=>f(d.id),"aria-label":`Dismiss ${d.type} event`,title:"Dismiss event",children:v.jsx(Kv,{className:"h-3 w-3"})})]})]}),v.jsx("div",{className:"text-[11px] leading-snug text-foreground/85",children:SR(d,u)})]})},d.id)})})})}const NR=["node.","election.","transport."],ax="cluster.state";function TR(n){return NR.some(r=>n.type.startsWith(r))}function CR(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function uv(n,r){return typeof n=="string"?(r==null?void 0:r.get(n))??n:null}function AR(n,r){if(n.type===ax)return uv(n.data.leaderId,r);const o=n.data.operation;return uv(n.data.nodeId??(o==null?void 0:o.nodeId)??n.data.leaderId??n.data.candidateId,r)}function RR(n,r){return n?`${AR(n,r)??n.type}: ${CR(n.timestamp)}`:"Waiting for cluster activity"}function _R({connected:n,events:r,nodeNameById:o,defaultOpen:i=!1}){const[u,f]=b.useState(i),[d,h]=b.useState(new Set),y=b.useRef(null),p=b.useMemo(()=>{const m=r.filter(N=>TR(N)&&!d.has(N.id)),w=new Set;return m.filter(N=>{if(N.type!=="node.status")return!0;const A=typeof N.data.nodeId=="string"?N.data.nodeId:N.type;return w.has(A)?!1:(w.add(A),!0)})},[r,d]),x=b.useMemo(()=>r.find(m=>m.type===ax)??p[0],[r,p]);return b.useEffect(()=>{h(m=>{if(m.size===0)return m;const w=new Set(r.map(A=>A.id)),N=new Set(Array.from(m).filter(A=>w.has(A)));return N.size===m.size?m:N})},[r]),b.useEffect(()=>{if(!u)return;const m=N=>{var A;(A=y.current)!=null&&A.contains(N.target)||f(!1)},w=N=>{N.key==="Escape"&&f(!1)};return document.addEventListener("pointerdown",m),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",m),document.removeEventListener("keydown",w)}},[u]),v.jsxs("div",{ref:y,className:"relative",children:[v.jsxs("button",{type:"button","aria-expanded":u,"aria-haspopup":"dialog",onClick:()=>f(m=>!m),className:be("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",u&&"shadow-[0_14px_40px_-26px_rgba(16,185,129,0.95)]"),title:n?"Live link connected":"Live link reconnecting",children:[v.jsx(Qv,{className:be("h-3.5 w-3.5",n?"text-emerald-500":"text-destructive")}),n?"Live link":"Reconnecting"]}),u&&v.jsxs("div",{role:"dialog","aria-label":"Live link connection events",className:"absolute right-0 top-[calc(100%+0.4rem)] z-50 w-[20rem] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-[20px] border border-border/70 bg-background/96 shadow-[0_28px_90px_-42px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl",children:[v.jsx("div",{className:"border-b border-border/60 bg-muted/25 px-3 py-2",children:v.jsxs("div",{className:"flex items-start justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-foreground",children:[n?v.jsx(Vv,{className:"h-3.5 w-3.5 text-emerald-500"}):v.jsx(cE,{className:"h-3.5 w-3.5 text-destructive"}),"Live link"]}),v.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:n?"SSE stream is connected":"SSE stream is reconnecting"})]}),v.jsx("div",{className:be("rounded-[11px] border px-2 py-0.5 text-[9px] font-medium uppercase tracking-[0.14em]",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"})]})}),v.jsxs("div",{className:"grid grid-cols-2 border-b border-border/60",children:[v.jsxs("div",{className:"border-r border-border/60 px-3 py-2",children:[v.jsx("div",{className:"text-[9px] font-medium uppercase tracking-[0.16em] text-muted-foreground",children:"Connection events"}),v.jsx("div",{className:"mt-0.5 text-lg font-semibold tracking-tight text-foreground",children:p.length})]}),v.jsxs("div",{className:"min-w-0 px-3 py-2",children:[v.jsx("div",{className:"text-[9px] font-medium uppercase tracking-[0.16em] text-muted-foreground",children:"Latest"}),v.jsx("div",{className:"mt-1 truncate font-mono text-[9px] text-foreground/80",children:RR(x,o)})]})]}),v.jsx("div",{className:"px-2 py-2",children:v.jsx(ER,{events:p,maxHeight:"16rem",emptyTitle:"No connection events yet",emptyDescription:"Node, election, and system events will appear here.",nodeNameById:o,onDismiss:m=>h(w=>new Set(w).add(m))})}),v.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-border/60 px-3 py-2 text-[10px] text-muted-foreground",children:[v.jsx("span",{className:"truncate",children:"Node, election, and system activity."}),v.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[v.jsx($a,{type:"button",variant:"ghost",size:"sm",className:"h-6 rounded-[11px] px-2 text-[10px]",onClick:()=>h(new Set(r.map(m=>m.id))),disabled:p.length===0,title:"Dismiss all notifications",children:"Dismiss all"}),v.jsx($a,{type:"button",variant:"ghost",size:"sm",className:"h-6 rounded-[11px] px-2 text-[10px]",onClick:()=>f(!1),children:"Close"})]})]})]})]})}const lx=b.createContext(null);function OR({children:n}){const[r,o]=b.useState(()=>typeof window<"u"?localStorage.getItem("meshy-theme")??"system":"system"),[i,u]=b.useState(()=>typeof window<"u"?localStorage.getItem("meshy-palette")??"default":"default");return b.useEffect(()=>{const f=document.documentElement,d=h=>{if(h==="system"){const y=window.matchMedia("(prefers-color-scheme: dark)").matches;f.classList.toggle("dark",y)}else f.classList.toggle("dark",h==="dark")};if(d(r),localStorage.setItem("meshy-theme",r),r==="system"){const h=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>d("system");return h.addEventListener("change",y),()=>h.removeEventListener("change",y)}},[r]),b.useEffect(()=>{const f=document.documentElement;i==="default"?f.removeAttribute("data-palette"):f.setAttribute("data-palette",i),localStorage.setItem("meshy-palette",i)},[i]),v.jsx(lx.Provider,{value:{theme:r,setTheme:o,palette:i,setPalette:u},children:n})}function MR(){const n=b.useContext(lx);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}const DR=[{value:"light",label:"Light",icon:Zv},{value:"dark",label:"Dark",icon:Xv},{value:"system",label:"System",icon:$v}],jR=[{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 zR(){const{theme:n,setTheme:r,palette:o,setPalette:i}=MR(),[u,f]=b.useState(!1),d=b.useRef(null),h=b.useRef(null),y=n==="dark"?Xv:n==="light"?Zv:$v,p=()=>{d.current&&(clearTimeout(d.current),d.current=null)},x=()=>{p(),d.current=setTimeout(()=>f(!1),180)};return b.useEffect(()=>{if(!u)return;const m=w=>{h.current&&!h.current.contains(w.target)&&f(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[u]),b.useEffect(()=>()=>p(),[]),v.jsxs("div",{ref:h,className:"relative",onMouseEnter:()=>{p(),f(!0)},onMouseLeave:x,children:[v.jsx($a,{variant:"ghost",size:"icon",onClick:()=>f(m=>!m),className:be("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:v.jsx(y,{className:"h-4 w-4"})}),u&&v.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:[v.jsx("div",{className:"px-1 pb-1 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"Theme"}),v.jsx("div",{className:"mb-2 grid grid-cols-3 gap-1",children:DR.map(({value:m,label:w,icon:N})=>{const A=n===m;return v.jsxs("button",{type:"button",onClick:()=>r(m),className:be("flex flex-col items-center gap-1 rounded-[14px] border px-2 py-2 text-[11px] font-medium transition-colors",A?"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:[v.jsx(N,{className:"h-4 w-4"}),w]},m)})}),v.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:[v.jsx(lE,{className:"h-3 w-3"}),"Palette"]}),v.jsx("div",{className:"space-y-1",children:jR.map(({value:m,label:w,hint:N})=>{const A=o===m;return v.jsxs("button",{type:"button",onClick:()=>i(m),className:be("flex w-full items-center gap-2 rounded-[14px] border px-2.5 py-1.5 text-left transition-colors",A?"border-primary/50 bg-primary/10":"border-transparent hover:bg-muted/60"),children:[v.jsx(kR,{value:m}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:be("text-[12px] font-medium",A?"text-primary":"text-foreground"),children:w}),v.jsx("div",{className:"text-[10px] text-muted-foreground",children:N})]}),A&&v.jsx(qv,{className:"h-3.5 w-3.5 text-primary"})]},m)})})]})]})}function kR({value:n}){const r={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]=r[n];return v.jsxs("div",{className:be("flex h-6 w-6 shrink-0 overflow-hidden border border-border/60",n==="edge"?"rounded-[10px]":"rounded-[12px]"),children:[v.jsx("div",{className:"h-full w-1/3",style:{background:o}}),v.jsx("div",{className:"h-full w-1/3",style:{background:i}}),v.jsx("div",{className:"h-full w-1/3",style:{background:u}})]})}function LR(){var y,p;const{cluster:n,events:r,sseConnected:o}=Bv(),i=Bn(),[u,f]=b.useState(!1),d=i.pathname==="/"||/^\/tasks\/[^/]+$/.test(i.pathname),h=b.useMemo(()=>{const x=new Map;for(const m of(n==null?void 0:n.nodes)??[])x.set(m.id,m.name);return x},[n==null?void 0:n.nodes]);return v.jsxs("div",{className:"relative h-full overflow-hidden bg-background text-foreground",children:[v.jsx("div",{className:"mesh-grid pointer-events-none absolute inset-0"}),v.jsxs("div",{className:"relative z-10 flex h-full min-h-0 flex-col",children:[v.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:v.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:[v.jsx("div",{className:"flex min-w-0 items-center gap-4",children:v.jsxs(zv,{to:"/",className:"flex items-center gap-3",children:[v.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"}),v.jsxs("div",{className:"hidden min-w-0 sm:block",children:[v.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.34em] text-muted-foreground",children:"MESHY"}),v.jsx("div",{className:"truncate text-base font-semibold tracking-tight text-foreground",children:"Workspace"})]})]})}),v.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[v.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:[v.jsxs("span",{className:"flex items-center gap-2",children:[(n==null?void 0:n.self)&&v.jsx(dy,{status:n.self.status}),v.jsx("span",{className:"font-medium text-foreground",children:((y=n==null?void 0:n.self)==null?void 0:y.name)??"offline"})]}),v.jsx("span",{className:"text-border",children:"/"}),v.jsx("span",{className:"capitalize",children:((p=n==null?void 0:n.self)==null?void 0:p.role)??"node"})]}),v.jsx(_R,{connected:o,events:r,nodeNameById:h}),d&&v.jsx($a,{variant:"ghost",size:"icon",onClick:()=>f(x=>!x),"aria-label":u?"Close terminal":"Open terminal",title:u?"Close terminal":"Open terminal",className:be("rounded-[16px] border bg-background/70 shadow-sm",u?"border-primary/50 bg-primary/10 text-primary":"border-border/70"),children:v.jsx(iE,{className:"h-4 w-4"})}),v.jsx(fR,{}),v.jsx(zR,{})]})]})}),v.jsx("main",{className:be("min-h-0 flex-1 px-3 pb-3 sm:px-5 lg:px-6",d?"overflow-hidden":"overflow-y-auto"),children:v.jsx("div",{className:"mx-auto h-full min-h-0 max-w-[1760px]",children:v.jsx(N2,{context:{terminalOpen:u,setTerminalOpen:f}})})})]})]})}const fv=b.lazy(async()=>({default:(await hv(()=>import("./DashboardPage-BGDwH7LG.js").then(r=>r.D),__vite__mapDeps([0,1,2,3]))).DashboardPage})),UR=b.lazy(async()=>({default:(await hv(()=>import("./SharedConversationPage-6Y6HiGBv.js"),__vite__mapDeps([4,1]))).SharedConversationPage}));function BR(){return v.jsx(J2,{children:v.jsx(b.Suspense,{fallback:v.jsx(HR,{}),children:v.jsxs(C2,{children:[v.jsx(wl,{path:"/shared/tasks/:shareId",element:v.jsx(UR,{})}),v.jsxs(wl,{element:v.jsx(pw,{children:v.jsx(LR,{})}),children:[v.jsx(wl,{path:"/",element:v.jsx(fv,{})}),v.jsx(wl,{path:"/nodes",element:v.jsx(Ng,{to:"/",replace:!0})}),v.jsx(wl,{path:"/tasks",element:v.jsx(Ng,{to:"/",replace:!0})}),v.jsx(wl,{path:"/tasks/:id",element:v.jsx(fv,{})})]})]})})})}function HR(){return v.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading workspace..."})}function VR(n){return v.jsx(MN,{className:"toaster group",style:{"--normal-bg":"hsl(var(--popover))","--normal-text":"hsl(var(--popover-foreground))","--normal-border":"hsl(var(--border))"},...n})}TS.createRoot(document.getElementById("root")).render(v.jsx(b.StrictMode,{children:v.jsxs(OR,{children:[v.jsx(BR,{}),v.jsx(VR,{})]})}));export{ex as $,lE as A,St as B,qv as C,Py as D,t_ as E,Gw as F,gC as G,Uw as H,vR as I,gR as J,z5 as K,w_ as L,Rb as M,ps as N,H_ as O,E_ as P,gs as Q,Z5 as R,sb as S,C_ as T,Pb as U,Jb as V,Ib as W,Kv as X,Wb as Y,Fb as Z,tx as _,zN as a,b_ as a$,hv as a0,iE as a1,jw as a2,kw as a3,IR as a4,z_ as a5,Qv as a6,ER as a7,dy as a8,Yw as a9,YR as aA,Bv as aB,k_ as aC,O_ as aD,M_ as aE,j_ as aF,D_ as aG,e_ as aH,A_ as aI,hR as aJ,s_ as aK,r_ as aL,o_ as aM,l_ as aN,a_ as aO,$R as aP,QR as aQ,GR as aR,ZR as aS,p_ as aT,h_ as aU,m_ as aV,f_ as aW,d_ as aX,g_ as aY,Mw as aZ,dv as a_,nN as aa,V_ as ab,mR as ac,Lo as ad,Be as ae,Oo as af,We as ag,ke as ah,BA as ai,AA as aj,Rl as ak,Y_ as al,R_ as am,__ as an,U_ as ao,L_ as ap,B_ as aq,K5 as ar,c_ as as,u_ as at,WR as au,dw as av,i_ as aw,qR as ax,Bn as ay,Tv as az,be as b,y_ as b0,v_ as b1,x_ as b2,N_ as b3,S_ as b4,Ze as c,fy as d,XR as e,Jy as f,Fy as g,bC as h,$a as i,v as j,PR as k,FR as l,cw as m,KR as n,T_ as o,JR as p,n_ as q,b as r,p5 as s,Ya as t,lb as u,g5 as v,ib as w,Yv as x,Gv as y,dR as z};
276
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return b.useEffect(()=>{var i;document.getElementById((i=n.current)==null?void 0:i.getAttribute("aria-describedby"))||console.warn(r)},[r,n]),null},$5=Ob,X5=Mb,Q5=Db,qb=jb,Gb=zb,$b=Hb,Xb=Yb,Qb=Lb,Zb=Bb;const Z5=$5,K5=X5,P5=Q5,Kb=b.forwardRef(({className:n,...r},o)=>v.jsx(qb,{className:be("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),...r,ref:o}));Kb.displayName=qb.displayName;const Pb=b.forwardRef(({className:n,...r},o)=>v.jsxs(P5,{children:[v.jsx(Kb,{}),v.jsx(Gb,{ref:o,className:be("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),...r})]}));Pb.displayName=Gb.displayName;const Jb=({className:n,...r})=>v.jsx("div",{className:be("flex flex-col space-y-2 text-center sm:text-left",n),...r});Jb.displayName="AlertDialogHeader";const Fb=({className:n,...r})=>v.jsx("div",{className:be("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...r});Fb.displayName="AlertDialogFooter";const Ib=b.forwardRef(({className:n,...r},o)=>v.jsx(Qb,{ref:o,className:be("text-lg font-semibold",n),...r}));Ib.displayName=Qb.displayName;const Wb=b.forwardRef(({className:n,...r},o)=>v.jsx(Zb,{ref:o,className:be("text-sm text-muted-foreground",n),...r}));Wb.displayName=Zb.displayName;const ex=b.forwardRef(({className:n,...r},o)=>v.jsx($b,{ref:o,className:be(Zf(),n),...r}));ex.displayName=$b.displayName;const tx=b.forwardRef(({className:n,...r},o)=>v.jsx(Xb,{ref:o,className:be(Zf({variant:"outline"}),"mt-2 sm:mt-0",n),...r}));tx.displayName=Xb.displayName;const J5=2e3,F5=24e4;function qa(n){if(n==null||n==="")return"Unavailable";const r=new Date(n);return Number.isNaN(r.getTime())?"Unavailable":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(r)}function I5(n){const r=Math.max(0,Math.floor(n)),o=Math.floor(r/86400),i=Math.floor(r%86400/3600),u=Math.floor(r%3600/60);return o>0?`${o}d ${i}h`:i>0?`${i}h ${u}m`:`${u}m`}function sv(n){if(n==null||Number.isNaN(n))return"Unavailable";const r=["B","KB","MB","GB","TB"];let o=n,i=0;for(;o>=1024&&i<r.length-1;)o/=1024,i+=1;return`${o.toFixed(o>=10||i===0?0:1)} ${r[i]}`}function nx(n){return n==="ok"?"default":n==="missing"||n==="install-failed"||n==="login-failed"?"destructive":n==="not-authenticated"||n==="unsupported-platform"?"outline":"secondary"}function W5(n){return n.available?v.jsxs(St,{className:"gap-1 rounded-full px-2 py-0.5 text-[10px]",children:[v.jsx(jw,{className:"h-3 w-3"}),"Available"]}):v.jsxs(St,{variant:"destructive",className:"gap-1 rounded-full px-2 py-0.5 text-[10px]",children:[v.jsx(kw,{className:"h-3 w-3"}),"Unavailable"]})}function eR(n){return n.update?n.update.updateAvailable?v.jsxs(St,{variant:"outline",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.14em]",children:["Update ",n.update.latestVersion]}):v.jsx(St,{variant:"secondary",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.14em]",children:"Up to date"}):null}function tR(n){var o;const r=`npm install -g ${(o=n.update)==null?void 0:o.packageName}@latest`;return n.id==="claude"?`${r} --include=optional --ignore-scripts=false`:r}function nR(n){return new Promise(r=>setTimeout(r,n))}function cv(n){return n.status==="succeeded"||n.status==="failed"}async function aR(n){if(cv(n))return n;const r=Date.now()+F5;let o=n;for(;!cv(o)&&Date.now()<r;)await nR(J5),o=await cw(n.id);return o}function lR(n){if(n.error)return n.error;const r=n.result;return(r==null?void 0:r.detail)??null}function ze({label:n,value:r,mono:o=!1}){return v.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:[v.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:n}),v.jsx("span",{className:be("break-all text-right text-[11px] text-foreground",o&&"font-mono text-[11px]"),children:r})]})}function rR({agent:n,nodeName:r,upgrading:o,onUpgrade:i}){var d,h;const u=((d=n.update)==null?void 0:d.updateAvailable)===!0,f=eR(n);return v.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/70 p-2.5 shadow-sm",children:[v.jsxs("div",{className:"flex items-start justify-between gap-2",children:[v.jsxs("div",{children:[v.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-semibold text-foreground",children:[v.jsx(Yv,{className:"h-3.5 w-3.5 text-primary"}),n.label]}),v.jsxs("div",{className:"mt-0.5 text-[10px] text-muted-foreground",children:["Command: ",v.jsx("span",{className:"font-mono text-[10px]",children:n.command})]})]}),v.jsxs("div",{className:"flex flex-col items-end gap-1",children:[W5(n),u?v.jsxs(Z5,{children:[v.jsx(K5,{asChild:!0,children:v.jsx("button",{type:"button",disabled:o,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:f})}),v.jsxs(Pb,{children:[v.jsxs(Jb,{children:[v.jsxs(Ib,{children:["Upgrade ",n.label,"?"]}),v.jsxs(Wb,{children:["This runs ",tR(n)," on ",r,". Remote nodes execute the command on the remote machine."]})]}),v.jsxs(Fb,{children:[v.jsx(tx,{children:"Cancel"}),v.jsx(ex,{onClick:()=>i(n),children:"Upgrade"})]})]})]}):f]})]}),v.jsxs("div",{className:"mt-2 space-y-1 text-[11px]",children:[v.jsx(ze,{label:"Version",value:n.version??"Unavailable",mono:!!n.version}),n.update&&v.jsx(ze,{label:"Latest",value:n.update.latestVersion??"Unavailable",mono:!!n.update.latestVersion}),v.jsx(ze,{label:"Path",value:n.path??"Not on PATH",mono:!!n.path}),v.jsx(ze,{label:"Checked",value:qa(n.checkedAt)}),n.update&&v.jsx(ze,{label:"Update check",value:qa(n.update.checkedAt)})]}),((h=n.update)==null?void 0:h.detail)&&v.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&&v.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[v.jsx(St,{variant:nx(n.metadataStatus),className:"rounded-full px-2 py-0 text-[10px] uppercase tracking-[0.14em]",children:n.metadataStatus}),v.jsx("span",{children:"Startup preflight"})]}),n.detail&&v.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 cs({name:n,status:r}){return v.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:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[11px] font-medium text-foreground",children:n}),v.jsx("div",{className:"text-[10px] text-muted-foreground",children:qa(r==null?void 0:r.checkedAt)})]}),v.jsxs("div",{className:"flex items-center gap-1.5",children:[typeof(r==null?void 0:r.authenticated)=="boolean"&&v.jsx(St,{variant:r.authenticated?"default":"outline",className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:r.authenticated?"auth ok":"auth required"}),v.jsx(St,{variant:nx(r==null?void 0:r.status),className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:(r==null?void 0:r.status)??"unknown"})]})]})}function oR(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 iR(n,r){var o;return(o=n==null?void 0:n.nodes)!=null&&o.length?n.nodes:r?[r]:[]}function sR(n,r){var i;if(r&&n.id===r.nodeId)return r;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,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 cR(n,r){return n.id===r?`${n.name} (this node)`:`${n.name} (${n.role})`}function uR({cluster:n,systemInfo:r,sseConnected:o,onRefresh:i}){var C,j,D,B,Z,F,q,V,le,he,pe,fe,me,ge,ue,O,Y,J,re,I,_,G,X,W;const u=b.useMemo(()=>iR(n,r),[n,r]),[f,d]=b.useState(()=>{var P;return(r==null?void 0:r.nodeId)??((P=n==null?void 0:n.self)==null?void 0:P.id)??""}),[h,y]=b.useState(null),p=(n==null?void 0:n.self)??r??u[0]??null,x=u.find(P=>P.id===f)??p,m=x?sR(x,r):null,w=!!(r&&x&&x.id===r.nodeId),N=w||!!(x!=null&&x.settingsSnapshot),A=b.useMemo(()=>oR(m==null?void 0:m.packages),[m==null?void 0:m.packages]),E=((C=m==null?void 0:m.startupRequirements)==null?void 0:C.components)??(m==null?void 0:m.components)??{};async function T(P){if(!x)return;const ne=`${x.id}:${P.id}`;y(ne);try{const ee=await uw(x.id,P.id);Ya.info(`${P.label} upgrade started on ${x.name}`);const ae=await aR(ee);ae.status==="succeeded"?(Ya.success(`${P.label} upgrade finished on ${x.name}`),i==null||i()):ae.status==="failed"?Ya.error(lR(ae)??`${P.label} upgrade failed`):Ya.info(`${P.label} upgrade is still running on ${x.name}`)}catch(ee){Ya.error(ee instanceof Error?ee.message:`${P.label} upgrade failed`)}finally{y(null)}}return!x||!m?v.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..."}):v.jsxs("div",{className:"space-y-4",children:[v.jsx("section",{className:"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:v.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end md:justify-between",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[v.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:[v.jsx(dy,{status:x.status}),v.jsx("span",{className:"font-medium text-foreground",children:x.name})]}),v.jsx(nN,{role:x.role}),v.jsx(St,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:x.transportType??m.transportType??"direct"}),v.jsx(St,{variant:w?"default":"outline",className:"rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:w?"Live local session":"Leader-synced snapshot"})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] uppercase tracking-[0.34em] text-muted-foreground",children:"Session"}),v.jsx("h3",{className:"mt-0.5 text-sm font-semibold tracking-tight text-foreground",children:"Node runtime"}),v.jsx("p",{className:"mt-1 max-w-2xl text-[11px] text-muted-foreground",children:"Inspect the selected node's runtime environment, connectivity surface, and packaged build metadata from one place."})]}),u.length>1&&v.jsxs("div",{className:"max-w-md space-y-1.5",children:[v.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Inspect node"}),v.jsxs(p5,{value:x.id,onValueChange:d,children:[v.jsx(lb,{className:"h-7 rounded-lg border-border/70 bg-background/70 text-[11px]",children:v.jsx(g5,{placeholder:"Choose a node"})}),v.jsx(ib,{children:u.map(P=>v.jsx(sb,{value:P.id,children:cR(P,r==null?void 0:r.nodeId)},P.id))})]})]})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[v.jsxs(St,{variant:o?"default":"outline",className:"gap-1 rounded-full px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:[v.jsx(Qv,{className:"h-3 w-3"}),o?"Live link connected":"Live link reconnecting"]}),v.jsxs(St,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Uptime ",I5(m.uptime)]}),!w&&v.jsxs(St,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Updated ",qa((j=x.settingsSnapshot)==null?void 0:j.collectedAt)]})]})]})}),!N&&v.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."}),v.jsxs(z5,{defaultValue:"session",className:"space-y-2",children:[v.jsxs(Rb,{className:"h-auto flex-wrap rounded-xl border border-border/60 bg-muted/40 p-0.5",children:[v.jsx(ps,{value:"session",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"Session"}),v.jsx(ps,{value:"access",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"Access"}),v.jsx(ps,{value:"about",className:"rounded-md px-2.5 py-0.5 text-[11px]",children:"About"})]}),v.jsxs(gs,{value:"session",className:"mt-0 grid gap-2 xl:grid-cols-[1.15fr_0.85fr]",children:[v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Iw,{className:"h-3.5 w-3.5 text-primary"}),"Selected node"]}),v.jsx(Dn,{className:"text-[10px]",children:"Cluster role, identity, and node-scoped runtime state."})]}),v.jsxs(jn,{className:"space-y-0 px-3 pb-2.5",children:[v.jsx(ze,{label:"Node ID",value:m.nodeId,mono:!0}),v.jsx(ze,{label:"Status",value:x.status}),v.jsx(ze,{label:"Role",value:x.role}),v.jsx(ze,{label:"Endpoint",value:x.endpoint,mono:!0}),v.jsx(ze,{label:"Joined",value:qa(x.joinedAt)}),v.jsx(ze,{label:"Heartbeat",value:qa(x.lastHeartbeat)}),v.jsx(ze,{label:"Capabilities",value:x.capabilities.length>0?x.capabilities.join(", "):"None"})]})]}),v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Hw,{className:"h-3.5 w-3.5 text-primary"}),"OS info"]}),v.jsx(Dn,{className:"text-[10px]",children:"Host and resource details reported by the current process."})]}),v.jsxs(jn,{className:"space-y-0 px-3 pb-2.5",children:[v.jsx(ze,{label:"Host",value:((D=m.os)==null?void 0:D.hostname)??"Unavailable"}),v.jsx(ze,{label:"Platform",value:m.os?`${m.os.platform} ${m.os.release}`:"Unavailable"}),v.jsx(ze,{label:"Arch",value:((B=m.os)==null?void 0:B.arch)??"Unavailable"}),v.jsx(ze,{label:"CPU",value:((Z=m.os)==null?void 0:Z.cpuModel)??"Unavailable"}),v.jsx(ze,{label:"Cores",value:String(((F=m.os)==null?void 0:F.cpuCount)??"Unavailable")}),v.jsx(ze,{label:"Memory",value:m.os?`${sv(m.os.freeMemoryBytes)} free / ${sv(m.os.totalMemoryBytes)} total`:"Unavailable"})]})]}),v.jsxs(_n,{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:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Yv,{className:"h-3.5 w-3.5 text-primary"}),"Available agents"]}),v.jsx(Dn,{className:"text-[10px]",children:w?"Live command availability for Codex and Claude Code on this node.":"Most recent agent availability snapshot synced from this node."})]}),v.jsx(jn,{className:"grid gap-2 px-3 pb-2.5 md:grid-cols-2",children:(m.agents??[]).map(P=>v.jsx(rR,{agent:P,nodeName:x.name,upgrading:h===`${x.id}:${P.id}`,onUpgrade:T},P.id))})]})]}),v.jsxs(gs,{value:"access",className:"mt-0 grid gap-2 xl:grid-cols-2",children:[v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Aw,{className:"h-3.5 w-3.5 text-primary"}),"Access surface"]}),v.jsx(Dn,{className:"text-[10px]",children:"How this node is exposed to the dashboard and other peers."})]}),v.jsxs(jn,{className:"space-y-0 px-3 pb-2.5",children:[v.jsx(ze,{label:"Transport",value:x.transportType??m.transportType??"direct"}),v.jsx(ze,{label:"Node URL",value:x.endpoint,mono:!0}),v.jsx(ze,{label:"Node tunnel",value:x.devtunnelEndpoint??"Disabled",mono:!!x.devtunnelEndpoint}),v.jsx(ze,{label:"Dashboard URL",value:x.dashboardOrigin??m.localDashboardOrigin??"Unavailable",mono:!!(x.dashboardOrigin||m.localDashboardOrigin)}),v.jsx(ze,{label:"Local dashboard",value:m.localDashboardOrigin??"Unavailable",mono:!!m.localDashboardOrigin})]})]}),v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(nE,{className:"h-3.5 w-3.5 text-primary"}),"Auth"]}),v.jsx(Dn,{className:"text-[10px]",children:"Current bearer-auth and trusted access posture."})]}),v.jsxs(jn,{className:"space-y-0 px-3 pb-2.5",children:[v.jsx(ze,{label:"Enabled",value:(q=m.auth)!=null&&q.enabled?"Yes":"No"}),v.jsx(ze,{label:"Same tenant",value:(V=m.auth)!=null&&V.allowSameTenant?"Allowed":"Off"}),v.jsx(ze,{label:"Allowed users",value:(le=m.auth)!=null&&le.allowedUsers.length?m.auth.allowedUsers.join(", "):"None"})]})]}),v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Gw,{className:"h-3.5 w-3.5 text-primary"}),"Paths"]}),v.jsx(Dn,{className:"text-[10px]",children:"Workspace and runtime paths currently used by this node."})]}),v.jsxs(jn,{className:"space-y-0 px-3 pb-2.5",children:[v.jsx(ze,{label:"Work dir",value:((he=m.runtime)==null?void 0:he.workDir)??m.workDir??"Unavailable",mono:!!(((pe=m.runtime)==null?void 0:pe.workDir)??m.workDir)}),v.jsx(ze,{label:"Storage",value:((fe=m.runtime)==null?void 0:fe.storagePath)??"Unavailable",mono:!!((me=m.runtime)!=null&&me.storagePath)}),v.jsx(ze,{label:"Process cwd",value:((ge=m.runtime)==null?void 0:ge.cwd)??"Unavailable",mono:!!((ue=m.runtime)!=null&&ue.cwd)}),v.jsx(ze,{label:"Started",value:qa((O=m.runtime)==null?void 0:O.startedAt)}),v.jsx(ze,{label:"PID",value:m.runtime?String(m.runtime.pid):"Unavailable",mono:!!m.runtime})]})]}),v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Vv,{className:"h-3.5 w-3.5 text-primary"}),"Startup checks"]}),v.jsx(Dn,{className:"text-[10px]",children:"Dependency preflight snapshot persisted during node startup."})]}),v.jsxs(jn,{className:"space-y-3 px-3 pb-2.5",children:[v.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/70 px-3 py-2",children:[v.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Last checked"}),v.jsx("div",{className:"mt-0.5 text-[11px] text-foreground",children:qa((Y=m.startupRequirements)==null?void 0:Y.lastCheckedAt)})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(cs,{name:"Azure CLI",status:E.az}),v.jsx(cs,{name:"DevTunnel",status:E.devtunnel}),v.jsx(cs,{name:"Claude Code",status:E.claude}),v.jsx(cs,{name:"Codex",status:E.codex})]})]})]})]}),v.jsxs(gs,{value:"about",className:"mt-0 grid gap-2 xl:grid-cols-[0.92fr_1.08fr]",children:[v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Nw,{className:"h-3.5 w-3.5 text-primary"}),"Repository"]}),v.jsx(Dn,{className:"text-[10px]",children:"Source-of-truth repository metadata for this running node."})]}),v.jsxs(jn,{className:"space-y-3 px-3 pb-2.5",children:[(J=m.repository)!=null&&J.url?v.jsxs("a",{href:m.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:[v.jsx("span",{className:"font-mono text-[10px]",children:m.repository.url}),v.jsx(Yw,{className:"h-3.5 w-3.5 text-muted-foreground transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5"})]}):v.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."}),v.jsxs("div",{className:"space-y-0",children:[v.jsx(ze,{label:"Branch",value:((re=m.repository)==null?void 0:re.branch)??"Unavailable",mono:!!((I=m.repository)!=null&&I.branch)}),v.jsx(ze,{label:"Commit",value:((_=m.repository)==null?void 0:_.commit)??"Unavailable",mono:!!((G=m.repository)!=null&&G.commit)}),v.jsx(ze,{label:"Runtime",value:`${m.packageName??"meshy"} ${m.version}`,mono:!0}),v.jsx(ze,{label:"Node.js",value:((X=m.runtime)==null?void 0:X.nodeVersion)??"Unavailable",mono:!!((W=m.runtime)!=null&&W.nodeVersion)})]})]})]}),v.jsxs(_n,{className:"rounded-xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[v.jsxs(On,{className:"pb-1.5 pt-2.5 px-3",children:[v.jsxs(Mn,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Xw,{className:"h-3.5 w-3.5 text-primary"}),"Package versions"]}),v.jsx(Dn,{className:"text-[10px]",children:"Version snapshot for the packages most relevant to this dashboard session."})]}),v.jsx(jn,{className:"space-y-1.5 px-3 pb-2.5",children:A.map(P=>{var ne,ee;return v.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:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[11px] font-medium text-foreground",children:P.label}),v.jsx("div",{className:"text-[10px] text-muted-foreground",children:(ne=P.value)==null?void 0:ne.name})]}),v.jsx(St,{variant:"outline",className:"rounded-[11px] border-border/70 bg-background/60 font-mono text-[10px]",children:(ee=P.value)==null?void 0:ee.version})]},P.key)})})]})]})]})]})}function fR(){const{cluster:n,systemInfo:r,sseConnected:o,refresh:i}=Bv(),[u,f]=b.useState(!1);return v.jsxs(gC,{open:u,onOpenChange:f,children:[v.jsx(vC,{asChild:!0,children:v.jsx($a,{variant:"ghost",size:"icon","aria-label":"Settings",title:"Settings",className:"rounded-[16px] border border-border/70 bg-background/70 shadow-sm",children:v.jsx(eE,{className:"h-4 w-4"})})}),v.jsxs(Py,{className:"grid h-[min(82vh,42rem)] max-h-[82vh] max-w-[min(90vw,56rem)] grid-rows-[auto_minmax(0,1fr)] overflow-hidden rounded-[22px] border-border/70 bg-background/96 p-0 shadow-[0_40px_120px_-56px_rgba(15,23,42,0.75)] backdrop-blur-xl",children:[v.jsxs(Jy,{className:"shrink-0 border-b border-border/60 px-3 py-2 sm:px-4",children:[v.jsxs(Fy,{className:"flex items-center gap-1.5 text-[12px]",children:[v.jsx(Zw,{className:"h-3.5 w-3.5 text-primary"}),"Settings"]}),v.jsx(Iy,{className:"text-[11px]",children:"Session diagnostics, access configuration, and build metadata for the current Meshy node."})]}),v.jsx("div",{className:"min-h-0 overflow-y-auto px-3 py-2.5 sm:px-4 sm:py-3",children:v.jsx(uR,{cluster:n,systemInfo:r,sseConnected:o,onRefresh:i})})]})]})}const T_="bypass",dR=[{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"}],C_=[{value:"bypass",label:"Bypass"},{value:"plan",label:"Plan"},{value:"edit",label:"Edit"},{value:"dangerous",label:"Dangerous"}],A_=new Set(dR.filter(n=>n.supportsFollowUp).map(n=>n.value)),R_=[{value:"active",label:"Active"},{value:"running",label:"Running"},{value:"waiting",label:"Waiting"},{value:"closed",label:"Closed"},{value:"shared",label:"Shared"},{value:"archived",label:"Archived"}],__=[{value:"all",label:"All task types"},{value:"native",label:"Native sessions"},{value:"meshy",label:"Meshy chats"}],mR=new Set(["pending","assigned"]),hR=new Set(["running"]),pR=new Set(["completed","failed","cancelled"]);function O_(n,r){switch(r){case"running":return hR.has(n.status);case"waiting":return mR.has(n.status);case"closed":return pR.has(n.status);case"shared":return!!n.activeShare;case"archived":return n.status==="archived";case"active":default:return n.status!=="archived"}}function M_(n,r){if(r==="all")return!0;const o=n.conversationKind==="nativeSession";return r==="native"?o:!o}function D_(n,r){const o=r.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 gR(n,r,o){if(!n)return"unassigned";const i=r==null?void 0:r.find(u=>u.id===n);return(i==null?void 0:i.name)??o??n.slice(0,8)}function j_(n,r,o){return gR(n,r,o).toLowerCase()}function z_(n,r){return[...n].sort((o,i)=>o.id===r?-1:i.id===r?1:o.name.localeCompare(i.name))}function k_(n){if(!n||typeof n!="object")return null;const r=n,o=r.createMode,i=o==="chat"||o==="native"?o:void 0;return{draftNewTask:r.draftNewTask===!0,returnRoute:typeof r.returnRoute=="string"?r.returnRoute:void 0,returnTaskId:typeof r.returnTaskId=="string"||r.returnTaskId===null?r.returnTaskId:void 0,createMode:i}}function L_(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 U_(n){return n==="default workspace"?n:n.replace(/\\/g,"/").split("/").filter(Boolean).at(-1)??n}function B_(n){const r=Date.now()-n;return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m`:r<864e5?`${Math.floor(r/36e5)}h`:`${Math.floor(r/864e5)}d`}function H_(n){return new Date(n).toLocaleString()}function V_(n){const r=Math.floor(n/1e3),o=Math.floor(r/3600),i=Math.floor(r%3600/60),u=r%60;return`${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}:${String(u).padStart(2,"0")}`}async function vR(n,r="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),Ya.success(r),!0;const f=globalThis.document,d=(u=f==null?void 0:f.execCommand)==null?void 0:u.bind(f);if(!(f!=null&&f.body)||typeof f.createElement!="function"||typeof d!="function")throw new Error("Clipboard access is unavailable");const h=f.createElement("textarea"),y=f.activeElement,p=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",f.body.appendChild(h),h.select(),h.setSelectionRange(0,h.value.length);const x=d("copy");if(f.body.removeChild(h),p==null||p.focus(),!x)throw new Error("Clipboard access is unavailable");return Ya.success(r),!0}catch(f){return Ya.error(f instanceof Error?f.message:"Failed to copy"),!1}}function Y_(n,r,o){const i=new Map;for(const f of n){const d=f.assignedTo??null,h=d??"__unassigned__",y=d?r.get(d)??f.assignedNodeName??d.slice(0,8):"Unassigned",p=f.effectiveProjectPath??f.project??"default workspace";i.has(h)||i.set(h,{nodeId:d,nodeName:y,dirMap:new Map});const x=i.get(h);x.dirMap.has(p)||x.dirMap.set(p,[]),x.dirMap.get(p).push(f)}const u=Array.from(i.values()).map(({nodeId:f,nodeName:d,dirMap:h})=>{const y=Array.from(h.entries()).map(([p,x])=>({path:p,tasks:x})).sort((p,x)=>x.tasks.length-p.tasks.length||p.path.localeCompare(x.path));return{nodeId:f,nodeName:d,dirs:y}});return u.sort((f,d)=>{if(o){if(f.nodeId===o)return-1;if(d.nodeId===o)return 1}return f.nodeId===null?1:d.nodeId===null?-1:f.nodeName.localeCompare(d.nodeName)}),u}const yR={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"};function bR(n){return n.split(".")[0]??"unknown"}function xR(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function br(n,r){return(r==null?void 0:r.get(n))??n}function SR(n,r){const o=n.data,i=o.operation;switch(n.type){case"node.joined":return`${o.name} joined the cluster`;case"node.left":return`${br(o.nodeId,r)} left (${o.reason})`;case"node.status":return`${br(o.nodeId,r)} is now ${o.status}`;case"node.operation.created":return`${i==null?void 0:i.kind} ${i==null?void 0:i.status} on ${br(i==null?void 0:i.nodeId,r)}`;case"node.operation.updated":return`${i==null?void 0:i.kind} ${i==null?void 0:i.status} on ${br(i==null?void 0:i.nodeId,r)}`;case"transport.changed":return`${br(o.nodeId,r)} transport switched to ${o.transportType}`;case"task.created":return`"${o.title}" created`;case"task.assigned":return`task assigned to ${br(o.nodeId,r)}`;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 wR(n){return JSON.stringify(n,null,2)}function ER({events:n,maxHeight:r="400px",emptyTitle:o="No live events yet",emptyDescription:i="Cluster activity appears here as it happens.",nodeNameById:u,onDismiss:f}){return n.length===0?v.jsx("div",{className:"flex h-28 items-center justify-center rounded-[20px] border border-dashed border-border/70 bg-background/40 text-center",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[11px] text-muted-foreground",children:o}),v.jsx("div",{className:"mt-1 text-[11px] text-muted-foreground/70",children:i})]})}):v.jsx("div",{className:"overflow-y-auto pr-1",style:{maxHeight:r},children:v.jsx("div",{className:"space-y-1.5",children:n.map(d=>{const h=bR(d.type);return v.jsx("div",{className:"rounded-xl border border-border/60 bg-background/45 px-2 py-1.5 transition-colors hover:border-border hover:bg-background/65",children:v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex items-start justify-between gap-1.5",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[v.jsx("div",{className:"font-mono text-[10px] text-muted-foreground",children:xR(d.timestamp)}),v.jsx(St,{variant:"outline",className:be("w-fit text-[9px] font-medium uppercase tracking-[0.14em] px-1.5 py-0",yR[h]),children:d.type})]}),v.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[v.jsx($a,{type:"button",variant:"ghost",size:"icon",className:"h-5 w-5 rounded-[8px] text-muted-foreground",onClick:()=>void vR(wR(d),"Event copied"),"aria-label":`Copy ${d.type} event`,title:"Copy event",children:v.jsx(Uw,{className:"h-3 w-3"})}),f&&v.jsx($a,{type:"button",variant:"ghost",size:"icon",className:"h-5 w-5 rounded-[8px] text-muted-foreground hover:text-foreground",onClick:()=>f(d.id),"aria-label":`Dismiss ${d.type} event`,title:"Dismiss event",children:v.jsx(Kv,{className:"h-3 w-3"})})]})]}),v.jsx("div",{className:"text-[11px] leading-snug text-foreground/85",children:SR(d,u)})]})},d.id)})})})}const NR=["node.","election.","transport."],ax="cluster.state";function TR(n){return NR.some(r=>n.type.startsWith(r))}function CR(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function uv(n,r){return typeof n=="string"?(r==null?void 0:r.get(n))??n:null}function AR(n,r){if(n.type===ax)return uv(n.data.leaderId,r);const o=n.data.operation;return uv(n.data.nodeId??(o==null?void 0:o.nodeId)??n.data.leaderId??n.data.candidateId,r)}function RR(n,r){return n?`${AR(n,r)??n.type}: ${CR(n.timestamp)}`:"Waiting for cluster activity"}function _R({connected:n,events:r,nodeNameById:o,defaultOpen:i=!1}){const[u,f]=b.useState(i),[d,h]=b.useState(new Set),y=b.useRef(null),p=b.useMemo(()=>{const m=r.filter(N=>TR(N)&&!d.has(N.id)),w=new Set;return m.filter(N=>{if(N.type!=="node.status")return!0;const A=typeof N.data.nodeId=="string"?N.data.nodeId:N.type;return w.has(A)?!1:(w.add(A),!0)})},[r,d]),x=b.useMemo(()=>r.find(m=>m.type===ax)??p[0],[r,p]);return b.useEffect(()=>{h(m=>{if(m.size===0)return m;const w=new Set(r.map(A=>A.id)),N=new Set(Array.from(m).filter(A=>w.has(A)));return N.size===m.size?m:N})},[r]),b.useEffect(()=>{if(!u)return;const m=N=>{var A;(A=y.current)!=null&&A.contains(N.target)||f(!1)},w=N=>{N.key==="Escape"&&f(!1)};return document.addEventListener("pointerdown",m),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",m),document.removeEventListener("keydown",w)}},[u]),v.jsxs("div",{ref:y,className:"relative",children:[v.jsxs("button",{type:"button","aria-expanded":u,"aria-haspopup":"dialog",onClick:()=>f(m=>!m),className:be("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",u&&"shadow-[0_14px_40px_-26px_rgba(16,185,129,0.95)]"),title:n?"Live link connected":"Live link reconnecting",children:[v.jsx(Qv,{className:be("h-3.5 w-3.5",n?"text-emerald-500":"text-destructive")}),n?"Live link":"Reconnecting"]}),u&&v.jsxs("div",{role:"dialog","aria-label":"Live link connection events",className:"absolute right-0 top-[calc(100%+0.4rem)] z-50 w-[20rem] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-[20px] border border-border/70 bg-background/96 shadow-[0_28px_90px_-42px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl",children:[v.jsx("div",{className:"border-b border-border/60 bg-muted/25 px-3 py-2",children:v.jsxs("div",{className:"flex items-start justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-foreground",children:[n?v.jsx(Vv,{className:"h-3.5 w-3.5 text-emerald-500"}):v.jsx(cE,{className:"h-3.5 w-3.5 text-destructive"}),"Live link"]}),v.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:n?"SSE stream is connected":"SSE stream is reconnecting"})]}),v.jsx("div",{className:be("rounded-[11px] border px-2 py-0.5 text-[9px] font-medium uppercase tracking-[0.14em]",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"})]})}),v.jsxs("div",{className:"grid grid-cols-2 border-b border-border/60",children:[v.jsxs("div",{className:"border-r border-border/60 px-3 py-2",children:[v.jsx("div",{className:"text-[9px] font-medium uppercase tracking-[0.16em] text-muted-foreground",children:"Connection events"}),v.jsx("div",{className:"mt-0.5 text-lg font-semibold tracking-tight text-foreground",children:p.length})]}),v.jsxs("div",{className:"min-w-0 px-3 py-2",children:[v.jsx("div",{className:"text-[9px] font-medium uppercase tracking-[0.16em] text-muted-foreground",children:"Latest"}),v.jsx("div",{className:"mt-1 truncate font-mono text-[9px] text-foreground/80",children:RR(x,o)})]})]}),v.jsx("div",{className:"px-2 py-2",children:v.jsx(ER,{events:p,maxHeight:"16rem",emptyTitle:"No connection events yet",emptyDescription:"Node, election, and system events will appear here.",nodeNameById:o,onDismiss:m=>h(w=>new Set(w).add(m))})}),v.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-border/60 px-3 py-2 text-[10px] text-muted-foreground",children:[v.jsx("span",{className:"truncate",children:"Node, election, and system activity."}),v.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[v.jsx($a,{type:"button",variant:"ghost",size:"sm",className:"h-6 rounded-[11px] px-2 text-[10px]",onClick:()=>h(new Set(r.map(m=>m.id))),disabled:p.length===0,title:"Dismiss all notifications",children:"Dismiss all"}),v.jsx($a,{type:"button",variant:"ghost",size:"sm",className:"h-6 rounded-[11px] px-2 text-[10px]",onClick:()=>f(!1),children:"Close"})]})]})]})]})}const lx=b.createContext(null);function OR({children:n}){const[r,o]=b.useState(()=>typeof window<"u"?localStorage.getItem("meshy-theme")??"system":"system"),[i,u]=b.useState(()=>typeof window<"u"?localStorage.getItem("meshy-palette")??"default":"default");return b.useEffect(()=>{const f=document.documentElement,d=h=>{if(h==="system"){const y=window.matchMedia("(prefers-color-scheme: dark)").matches;f.classList.toggle("dark",y)}else f.classList.toggle("dark",h==="dark")};if(d(r),localStorage.setItem("meshy-theme",r),r==="system"){const h=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>d("system");return h.addEventListener("change",y),()=>h.removeEventListener("change",y)}},[r]),b.useEffect(()=>{const f=document.documentElement;i==="default"?f.removeAttribute("data-palette"):f.setAttribute("data-palette",i),localStorage.setItem("meshy-palette",i)},[i]),v.jsx(lx.Provider,{value:{theme:r,setTheme:o,palette:i,setPalette:u},children:n})}function MR(){const n=b.useContext(lx);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}const DR=[{value:"light",label:"Light",icon:Zv},{value:"dark",label:"Dark",icon:Xv},{value:"system",label:"System",icon:$v}],jR=[{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 zR(){const{theme:n,setTheme:r,palette:o,setPalette:i}=MR(),[u,f]=b.useState(!1),d=b.useRef(null),h=b.useRef(null),y=n==="dark"?Xv:n==="light"?Zv:$v,p=()=>{d.current&&(clearTimeout(d.current),d.current=null)},x=()=>{p(),d.current=setTimeout(()=>f(!1),180)};return b.useEffect(()=>{if(!u)return;const m=w=>{h.current&&!h.current.contains(w.target)&&f(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[u]),b.useEffect(()=>()=>p(),[]),v.jsxs("div",{ref:h,className:"relative",onMouseEnter:()=>{p(),f(!0)},onMouseLeave:x,children:[v.jsx($a,{variant:"ghost",size:"icon",onClick:()=>f(m=>!m),className:be("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:v.jsx(y,{className:"h-4 w-4"})}),u&&v.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:[v.jsx("div",{className:"px-1 pb-1 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"Theme"}),v.jsx("div",{className:"mb-2 grid grid-cols-3 gap-1",children:DR.map(({value:m,label:w,icon:N})=>{const A=n===m;return v.jsxs("button",{type:"button",onClick:()=>r(m),className:be("flex flex-col items-center gap-1 rounded-[14px] border px-2 py-2 text-[11px] font-medium transition-colors",A?"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:[v.jsx(N,{className:"h-4 w-4"}),w]},m)})}),v.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:[v.jsx(lE,{className:"h-3 w-3"}),"Palette"]}),v.jsx("div",{className:"space-y-1",children:jR.map(({value:m,label:w,hint:N})=>{const A=o===m;return v.jsxs("button",{type:"button",onClick:()=>i(m),className:be("flex w-full items-center gap-2 rounded-[14px] border px-2.5 py-1.5 text-left transition-colors",A?"border-primary/50 bg-primary/10":"border-transparent hover:bg-muted/60"),children:[v.jsx(kR,{value:m}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:be("text-[12px] font-medium",A?"text-primary":"text-foreground"),children:w}),v.jsx("div",{className:"text-[10px] text-muted-foreground",children:N})]}),A&&v.jsx(qv,{className:"h-3.5 w-3.5 text-primary"})]},m)})})]})]})}function kR({value:n}){const r={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]=r[n];return v.jsxs("div",{className:be("flex h-6 w-6 shrink-0 overflow-hidden border border-border/60",n==="edge"?"rounded-[10px]":"rounded-[12px]"),children:[v.jsx("div",{className:"h-full w-1/3",style:{background:o}}),v.jsx("div",{className:"h-full w-1/3",style:{background:i}}),v.jsx("div",{className:"h-full w-1/3",style:{background:u}})]})}function LR(){var y,p;const{cluster:n,events:r,sseConnected:o}=Bv(),i=Bn(),[u,f]=b.useState(!1),d=i.pathname==="/"||/^\/tasks\/[^/]+$/.test(i.pathname),h=b.useMemo(()=>{const x=new Map;for(const m of(n==null?void 0:n.nodes)??[])x.set(m.id,m.name);return x},[n==null?void 0:n.nodes]);return v.jsxs("div",{className:"relative h-full overflow-hidden bg-background text-foreground",children:[v.jsx("div",{className:"mesh-grid pointer-events-none absolute inset-0"}),v.jsxs("div",{className:"relative z-10 flex h-full min-h-0 flex-col",children:[v.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:v.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:[v.jsx("div",{className:"flex min-w-0 items-center gap-4",children:v.jsxs(zv,{to:"/",className:"flex items-center gap-3",children:[v.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"}),v.jsxs("div",{className:"hidden min-w-0 sm:block",children:[v.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.34em] text-muted-foreground",children:"MESHY"}),v.jsx("div",{className:"truncate text-base font-semibold tracking-tight text-foreground",children:"Workspace"})]})]})}),v.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[v.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:[v.jsxs("span",{className:"flex items-center gap-2",children:[(n==null?void 0:n.self)&&v.jsx(dy,{status:n.self.status}),v.jsx("span",{className:"font-medium text-foreground",children:((y=n==null?void 0:n.self)==null?void 0:y.name)??"offline"})]}),v.jsx("span",{className:"text-border",children:"/"}),v.jsx("span",{className:"capitalize",children:((p=n==null?void 0:n.self)==null?void 0:p.role)??"node"})]}),v.jsx(_R,{connected:o,events:r,nodeNameById:h}),d&&v.jsx($a,{variant:"ghost",size:"icon",onClick:()=>f(x=>!x),"aria-label":u?"Close terminal":"Open terminal",title:u?"Close terminal":"Open terminal",className:be("rounded-[16px] border bg-background/70 shadow-sm",u?"border-primary/50 bg-primary/10 text-primary":"border-border/70"),children:v.jsx(iE,{className:"h-4 w-4"})}),v.jsx(fR,{}),v.jsx(zR,{})]})]})}),v.jsx("main",{className:be("min-h-0 flex-1 px-3 pb-3 sm:px-5 lg:px-6",d?"overflow-hidden":"overflow-y-auto"),children:v.jsx("div",{className:"mx-auto h-full min-h-0 max-w-[1760px]",children:v.jsx(N2,{context:{terminalOpen:u,setTerminalOpen:f}})})})]})]})}const fv=b.lazy(async()=>({default:(await hv(()=>import("./DashboardPage-0TdEZxup.js").then(r=>r.D),__vite__mapDeps([0,1,2,3]))).DashboardPage})),UR=b.lazy(async()=>({default:(await hv(()=>import("./SharedConversationPage-COhUZENs.js"),__vite__mapDeps([4,1]))).SharedConversationPage}));function BR(){return v.jsx(J2,{children:v.jsx(b.Suspense,{fallback:v.jsx(HR,{}),children:v.jsxs(C2,{children:[v.jsx(wl,{path:"/shared/tasks/:shareId",element:v.jsx(UR,{})}),v.jsxs(wl,{element:v.jsx(pw,{children:v.jsx(LR,{})}),children:[v.jsx(wl,{path:"/",element:v.jsx(fv,{})}),v.jsx(wl,{path:"/nodes",element:v.jsx(Ng,{to:"/",replace:!0})}),v.jsx(wl,{path:"/tasks",element:v.jsx(Ng,{to:"/",replace:!0})}),v.jsx(wl,{path:"/tasks/:id",element:v.jsx(fv,{})})]})]})})})}function HR(){return v.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading workspace..."})}function VR(n){return v.jsx(MN,{className:"toaster group",style:{"--normal-bg":"hsl(var(--popover))","--normal-text":"hsl(var(--popover-foreground))","--normal-border":"hsl(var(--border))"},...n})}TS.createRoot(document.getElementById("root")).render(v.jsx(b.StrictMode,{children:v.jsxs(OR,{children:[v.jsx(BR,{}),v.jsx(VR,{})]})}));export{ex as $,lE as A,St as B,qv as C,Py as D,t_ as E,Gw as F,gC as G,Uw as H,vR as I,gR as J,z5 as K,w_ as L,Rb as M,ps as N,H_ as O,E_ as P,gs as Q,Z5 as R,sb as S,C_ as T,Pb as U,Jb as V,Ib as W,Kv as X,Wb as Y,Fb as Z,tx as _,zN as a,b_ as a$,hv as a0,iE as a1,jw as a2,kw as a3,IR as a4,z_ as a5,Qv as a6,ER as a7,dy as a8,Yw as a9,YR as aA,Bv as aB,k_ as aC,O_ as aD,M_ as aE,j_ as aF,D_ as aG,e_ as aH,A_ as aI,hR as aJ,s_ as aK,r_ as aL,o_ as aM,l_ as aN,a_ as aO,$R as aP,QR as aQ,GR as aR,ZR as aS,p_ as aT,h_ as aU,m_ as aV,f_ as aW,d_ as aX,g_ as aY,Mw as aZ,dv as a_,nN as aa,V_ as ab,mR as ac,Lo as ad,Be as ae,Oo as af,We as ag,ke as ah,BA as ai,AA as aj,Rl as ak,Y_ as al,R_ as am,__ as an,U_ as ao,L_ as ap,B_ as aq,K5 as ar,c_ as as,u_ as at,WR as au,dw as av,i_ as aw,qR as ax,Bn as ay,Tv as az,be as b,y_ as b0,v_ as b1,x_ as b2,N_ as b3,S_ as b4,Ze as c,fy as d,XR as e,Jy as f,Fy as g,bC as h,$a as i,v as j,PR as k,FR as l,cw as m,KR as n,T_ as o,JR as p,n_ as q,b as r,p5 as s,Ya as t,lb as u,g5 as v,ib as w,Yv as x,Gv as y,dR as z};
@@ -0,0 +1,6 @@
1
+ import{c as s,r as t,j as a,b as n}from"./index-DHC5U3_j.js";/**
2
+ * @license lucide-react v1.7.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const l=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],f=s("play",l),d=t.forwardRef(({className:e,type:o,...r},i)=>a.jsx("input",{type:o,className:n("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",e),ref:i,...r}));d.displayName="Input";export{d as I,f as P};
@@ -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'>&#x1F578;</text></svg>" />
8
- <script type="module" crossorigin src="/assets/index-U21aiFFx.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-DHC5U3_j.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-DfiptIs_.css">
10
10
  </head>
11
11
  <body>