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.
- package/README.md +1 -1
- package/dashboard/assets/DashboardPage-0TdEZxup.js +119 -0
- package/dashboard/assets/{DashboardShared-C3sx-Aj3.js → DashboardShared-BfSOAHkB.js} +1 -1
- package/dashboard/assets/{DiffTab-DF380dMh.js → DiffTab-Dkqx4lg8.js} +1 -1
- package/dashboard/assets/{FilesTab-DZ2CIfBe.js → FilesTab-BWK1YZk0.js} +1 -1
- package/dashboard/assets/{PreviewTab-DGzp5vs_.js → PreviewTab-CgGqqXSW.js} +5 -10
- package/dashboard/assets/{SharedConversationPage-6Y6HiGBv.js → SharedConversationPage-COhUZENs.js} +3 -3
- package/dashboard/assets/{file-CkjhxpTi.js → file-BdIshbRs.js} +1 -1
- package/dashboard/assets/{folder-DcAuKKJN.js → folder-Cl9WN_cx.js} +1 -1
- package/dashboard/assets/{index-U21aiFFx.js → index-DHC5U3_j.js} +2 -2
- package/dashboard/assets/input-CdkmqjGJ.js +6 -0
- package/dashboard/index.html +1 -1
- package/main.cjs +167 -242
- package/package.json +1 -1
- package/runtime-metadata.json +4 -4
- package/dashboard/assets/DashboardPage-BGDwH7LG.js +0 -119
- package/dashboard/assets/input-BA2z1FFh.js +0 -1
package/README.md
CHANGED
|
@@ -0,0 +1,119 @@
|
|
|
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","assets/DiffTab-Dkqx4lg8.js","assets/DashboardShared-BfSOAHkB.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as fe,r as s,j as e,a as Ja,b as L,d as Ya,e as Xa,D as As,f as Qa,g as Ls,B as Ae,h as Za,i as $,X as Ue,k as er,l as tr,C as qe,m as Ps,n as sr,F as ar,S as pe,o as Ze,p as rr,q as nr,t as xe,s as Se,u as Ee,v as Me,w as _e,x as Vt,y as st,T as Kt,z as Rs,A as or,E as lr,G as Fs,H as $s,I as We,J as Is,K as Os,L as Bs,P as ir,M as zs,N as Be,O as dr,Q as ze,R as Ct,U as St,V as Et,W as _t,Y as Tt,Z as Dt,_ as Mt,$ as At,a0 as Ht,a1 as ms,a2 as cr,a3 as Lt,a4 as ur,a5 as xr,a6 as mr,a7 as hr,a8 as Us,a9 as Vs,aa as Ks,ab as pr,ac as ut,ad as fr,ae as qt,af as gr,ag as Hs,ah as hs,ai as br,aj as vr,ak as jr,al as Nr,am as kr,an as yr,ao as wr,ap as Cr,aq as Sr,ar as ps,as as Er,at as _r,au as Tr,av as Dr,aw as qs,ax as Mr,ay as Ar,az as Lr,aA as Pr,aB as Rr,aC as Fr,aD as $r,aE as Ir,aF as Or,aG as Br,aH as zr,aI as Ur,aJ as Vr,aK as Kr,aL as Hr,aM as qr,aN as Wr,aO as Gr,aP as Jr,aQ as Yr,aR as Xr,aS as Qr}from"./index-DHC5U3_j.js";import{r as fs,e as Zr,b as Ws,t as Gs,L as je,C as gs,a as en,T as kt,D as He,I as Pe,M as Pt,c as Js,m as Ys,d as Xs,f as tn,g as bs,h as sn,i as an,j as yt,k as rn,n as nn,l as on}from"./DashboardShared-BfSOAHkB.js";import{I as Re,P as ln}from"./input-CdkmqjGJ.js";import{F as dn,C as et}from"./folder-Cl9WN_cx.js";/**
|
|
3
|
+
* @license lucide-react v1.7.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const cn=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],un=fe("archive",cn);/**
|
|
8
|
+
* @license lucide-react v1.7.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/const xn=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],mn=fe("arrow-up",xn);/**
|
|
13
|
+
* @license lucide-react v1.7.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/const hn=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],pn=fe("flag",hn);/**
|
|
18
|
+
* @license lucide-react v1.7.0 - ISC
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the ISC license.
|
|
21
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
+
*/const fn=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],gn=fe("funnel",fn);/**
|
|
23
|
+
* @license lucide-react v1.7.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/const bn=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],vs=fe("git-branch",bn);/**
|
|
28
|
+
* @license lucide-react v1.7.0 - ISC
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the ISC license.
|
|
31
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/const vn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],jn=fe("globe",vn);/**
|
|
33
|
+
* @license lucide-react v1.7.0 - ISC
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the ISC license.
|
|
36
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/const Nn=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Rt=fe("history",Nn);/**
|
|
38
|
+
* @license lucide-react v1.7.0 - ISC
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the ISC license.
|
|
41
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/const kn=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],Ft=fe("image-plus",kn);/**
|
|
43
|
+
* @license lucide-react v1.7.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/const yn=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],wn=fe("laptop",yn);/**
|
|
48
|
+
* @license lucide-react v1.7.0 - ISC
|
|
49
|
+
*
|
|
50
|
+
* This source code is licensed under the ISC license.
|
|
51
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
+
*/const Cn=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Wt=fe("link-2",Cn);/**
|
|
53
|
+
* @license lucide-react v1.7.0 - ISC
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the ISC license.
|
|
56
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/const Sn=[["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:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],Gt=fe("message-square-plus",Sn);/**
|
|
58
|
+
* @license lucide-react v1.7.0 - ISC
|
|
59
|
+
*
|
|
60
|
+
* This source code is licensed under the ISC license.
|
|
61
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
+
*/const En=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Qs=fe("panel-left-close",En);/**
|
|
63
|
+
* @license lucide-react v1.7.0 - ISC
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the ISC license.
|
|
66
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
+
*/const _n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Tn=fe("panel-left-open",_n);/**
|
|
68
|
+
* @license lucide-react v1.7.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/const Dn=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],Jt=fe("panel-right-close",Dn);/**
|
|
73
|
+
* @license lucide-react v1.7.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/const Mn=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],Zs=fe("panel-right-open",Mn);/**
|
|
78
|
+
* @license lucide-react v1.7.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/const An=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],at=fe("pencil",An);/**
|
|
83
|
+
* @license lucide-react v1.7.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const Ln=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pn=fe("plus",Ln);/**
|
|
88
|
+
* @license lucide-react v1.7.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/const Rn=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Fn=fe("rotate-ccw",Rn);/**
|
|
93
|
+
* @license lucide-react v1.7.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const $n=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$t=fe("search",$n);/**
|
|
98
|
+
* @license lucide-react v1.7.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const In=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ea=fe("send",In);/**
|
|
103
|
+
* @license lucide-react v1.7.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const On=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Bn=fe("share-2",On);/**
|
|
108
|
+
* @license lucide-react v1.7.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const zn=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Un=fe("sliders-horizontal",zn);/**
|
|
113
|
+
* @license lucide-react v1.7.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const Vn=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Kn=fe("trash-2",Vn),Hn=new Set(["assigned","running"]);function qn(t,a){return t.reduce((r,o)=>o.assignedTo===a&&Hn.has(o.status)?r+1:r,0)}function Je(t){return(t==null?void 0:t.toLowerCase())==="devtunnel"}function Wn(t){return t?Je(t)?"DevTunnel":t.charAt(0).toUpperCase()+t.slice(1):"Direct"}function Yt(t,a){return Je(a??t.transportType)||!!t.devtunnelEndpoint}function ta(t,a){return!Je(a??t.transportType)}function sa(t,a){const r=a??t.transportType;return Je(r)?"DevTunnel":t.devtunnelEndpoint?"Direct + DevTunnel":Wn(r)}function js(t,a){return!t&&!a}function Gn({routeTaskId:t,creatingTask:a,internalSelectedTaskId:r,sortedTaskIds:o}){return t||(a?null:r??o[0]??null)}function Jn(t,a){return[a,...t.filter(r=>r.id!==a.id)]}function Yn(t,a){const r=a.taskId,o=a.updates;return typeof r!="string"||!o||typeof o!="object"?t:t.map(n=>n.id===r?{...n,...o}:n)}const Xn=new Set(["completed","failed","cancelled","archived"]);function Qn(t,a){const r=new Set(a);return new Set(Array.from(t).filter(o=>r.has(o)))}function Zn(t,a){const r=new Set(a);if(r.size===0)return!1;const o=t.filter(n=>r.has(n.id));return o.length===r.size&&o.every(n=>Xn.has(n.status))}function eo(t,a){var o;const r=new Set(a);return((o=t.find(n=>!r.has(n.id)))==null?void 0:o.id)??null}var to=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],so=to.reduce((t,a)=>{const r=Ja(`Primitive.${a}`),o=s.forwardRef((n,l)=>{const{asChild:u,...j}=n,f=u?r:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(f,{...j,ref:l})});return o.displayName=`Primitive.${a}`,{...t,[a]:o}},{}),ao="Label",aa=s.forwardRef((t,a)=>e.jsx(so.label,{...t,ref:a,onMouseDown:r=>{var n;r.target.closest("button, input, select, textarea")||((n=t.onMouseDown)==null||n.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));aa.displayName=ao;var ra=aa;const ro=Ya("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Te=s.forwardRef(({className:t,...a},r)=>e.jsx(ra,{ref:r,className:L(ro(),t),...a}));Te.displayName=ra.displayName;function no({onAdded:t}){const[a,r]=s.useState(""),[o,n]=s.useState(!1),[l,u]=s.useState(null),j=s.useCallback(async f=>{if(f.preventDefault(),!!a.trim()){n(!0),u(null);try{await Xa({leaderEndpoint:a.trim(),transport:"devtunnel"}),t()}catch(g){u(g instanceof Error?g.message:"Failed to join node")}finally{n(!1)}}},[a,t]);return e.jsx(As,{className:"overflow-hidden border-border/60 bg-transparent p-0 shadow-none sm:max-w-xl",children:e.jsxs("div",{className:"overflow-hidden rounded-[28px] border border-border/60 bg-background/95 p-0 shadow-[0_40px_120px_-60px_rgba(0,0,0,0.88)] backdrop-blur-xl",children:[e.jsx("div",{className:"border-b border-border/60 px-6 py-5",children:e.jsxs(Qa,{className:"space-y-2 text-left",children:[e.jsx(Ls,{className:"text-2xl tracking-tight",children:"Join node"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Verify the remote leader's DevTunnel endpoint, sync this node's tasks to that leader, and join the cluster as a follower."})]})}),e.jsxs("form",{onSubmit:j,className:"space-y-4 px-6 py-5",children:[l&&e.jsx("div",{className:"rounded-[20px] border border-destructive/20 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:l}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(Te,{htmlFor:"leader-endpoint",children:"Leader endpoint"}),e.jsx(Ae,{variant:"outline",className:"rounded-[11px] border-border/70 bg-background/60 text-[10px] uppercase tracking-[0.16em]",children:"DevTunnel only"})]}),e.jsx(Re,{id:"leader-endpoint",type:"url",value:a,onChange:f=>r(f.target.value),placeholder:"https://your-leader.devtunnels.ms",className:"h-11 rounded-[18px] border-border/70 bg-background/70"})]}),e.jsx("div",{className:"rounded-[20px] border border-border/60 bg-background/45 px-4 py-3 text-sm text-muted-foreground",children:"This does not switch the local node transport or auto-enable a local DevTunnel. Leaving later will detach this node from the remote leader and make it leader of its own cluster again."}),e.jsx(Za,{className:"border-t border-border/60 pt-4",children:e.jsx($,{type:"submit",disabled:!a.trim()||o,className:"rounded-[16px]",children:o?"Joining...":"Join node"})})]})]})})}function na(){const[t,a]=s.useState([]),[r,o]=s.useState(null),n=s.useRef(null),l=s.useCallback(()=>{var N;(N=n.current)==null||N.click()},[]),u=s.useCallback(async N=>{const d=Array.from(N.target.files??[]);if(d.length!==0)try{const c=await fs(d);a(x=>[...x,...c]),o(null)}catch(c){o(c instanceof Error?c.message:"Failed to attach image")}finally{N.target.value=""}},[]),j=s.useCallback(async N=>{const d=Zr(N.clipboardData);if(d.length!==0){N.preventDefault();try{const c=await fs(d);a(x=>[...x,...c]),o(null)}catch(c){o(c instanceof Error?c.message:"Failed to attach image")}}},[]),f=s.useCallback(N=>{a(d=>d.filter((c,x)=>x!==N))},[]),g=s.useCallback(()=>{a([]),o(null)},[]);return{images:t,error:r,fileInputRef:n,pickImages:l,handleFileChange:u,handlePaste:j,removeImage:f,clearImages:g}}function oo({onSend:t,disabled:a,disabledReason:r="Chat is waiting on the agent.",placeholder:o="Send a follow-up message...",contextItems:n=[],running:l=!1,onStop:u}){const[j,f]=s.useState(""),g=s.useRef(null),{images:N,error:d,fileInputRef:c,pickImages:x,handleFileChange:y,handlePaste:b,removeImage:S,clearImages:w}=na(),C=s.useCallback(()=>{g.current&&(g.current.style.height="auto")},[]),h=s.useCallback(()=>{const A=Ws(j,N);A.length===0||a||(t(A),f(""),w(),C())},[j,N,a,t,w,C]),I=s.useCallback(A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),h())},[h]),_=s.useCallback(()=>{g.current&&(g.current.style.height="auto",g.current.style.height=`${Math.min(g.current.scrollHeight,220)}px`)},[]),K=!a&&!l&&(j.trim().length>0||N.length>0),M=l&&!!u,z=l?u?"Task is running — click to stop":"Task is running...":a?r:"Enter sends, Shift+Enter adds a line";return e.jsxs("div",{className:"animate-composer-settle border-t border-border/45 bg-background/42 px-2 py-2 backdrop-blur-xl sm:px-4 sm:py-3",children:[n.length>0&&e.jsx("div",{className:"flex flex-wrap items-center gap-1.5 px-2 pb-2.5",children:n.map(A=>e.jsxs("div",{className:"inline-flex max-w-full items-center gap-1.5 rounded-[13px] border border-border/60 bg-muted/40 px-2 py-1 text-[11px] shadow-sm",children:[e.jsx("span",{className:"shrink-0 text-[9px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:A.label}),e.jsx("span",{className:`truncate text-foreground/90 ${A.mono?"font-mono text-[11px]":""}`,children:A.value})]},`${A.label}:${A.value}`))}),e.jsxs("div",{className:"overflow-hidden rounded-[26px] border border-border/65 bg-card/88 shadow-[0_30px_92px_-62px_rgba(15,23,42,0.55)] backdrop-blur-xl sm:rounded-[30px] dark:shadow-[0_30px_92px_-62px_rgba(0,0,0,0.95)]",children:[e.jsx("input",{ref:c,type:"file",accept:"image/*",multiple:!0,onChange:y,className:"hidden"}),N.length>0&&e.jsx("div",{className:"px-2 pt-3 sm:px-6 sm:pt-6",children:e.jsx("div",{className:"flex flex-wrap gap-3",children:N.map((A,O)=>e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:Gs(A),alt:A.filename??`attachment ${O+1}`,className:"h-24 w-24 rounded-[22px] border border-border/70 object-cover"}),e.jsx("button",{type:"button",onClick:()=>S(O),className:"absolute -top-2 -right-2 flex h-7 w-7 items-center justify-center rounded-[12px] border border-border/70 bg-background text-muted-foreground shadow-sm transition-all hover:-translate-y-px hover:text-foreground","aria-label":`Remove ${A.filename??`image ${O+1}`}`,children:e.jsx(Ue,{className:"h-3.5 w-3.5"})})]},`${A.filename??"image"}-${O}`))})}),e.jsxs("div",{className:"flex items-end gap-1.5 px-2 pt-3 pb-3 sm:px-6 sm:pt-4 sm:pb-4",children:[e.jsx("textarea",{ref:g,value:j,onChange:A=>f(A.target.value),onKeyDown:I,onPaste:b,onInput:_,placeholder:o,disabled:a,rows:1,className:"min-h-[2.5rem] flex-1 resize-none bg-transparent px-0 py-1 text-[11px] leading-7 text-foreground placeholder:text-muted-foreground/70 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50"}),e.jsxs($,{type:"button",variant:"ghost",onClick:x,disabled:a,className:"mb-0.5 h-8 shrink-0 gap-1.5 rounded-[14px] px-2.5 text-[11px] text-muted-foreground hover:text-foreground sm:px-2.5",title:"Attach images",children:[e.jsx(Ft,{className:"h-4 w-4 sm:h-3.5 sm:w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Images"})]}),e.jsx("span",{title:z,children:e.jsx($,{onClick:l?u:h,disabled:l?!M:!K,size:"icon","aria-label":l?"Stop running task":"Send message",className:"mb-0.5 h-8 w-10 shrink-0 rounded-[14px] bg-primary/90 text-primary-foreground shadow-[0_12px_30px_-18px_hsl(var(--primary)/0.95)] hover:bg-primary",children:l?e.jsx(je,{className:"h-4 w-4 animate-spin"}):e.jsx(ea,{className:"h-4 w-4"})})})]}),d&&e.jsx("div",{className:"border-t border-destructive/20 bg-destructive/10 px-2 py-2 text-[11px] text-destructive sm:px-6 sm:py-3",children:d})]})]})}function lo(t,a,r){return t!=="auto"?a.find(o=>o.id===t)??null:r.length===1?r[0]??null:null}function io(t){return t.trim()||"."}function co(t){return new Promise(a=>window.setTimeout(a,t))}function uo(t){return!!t&&typeof t=="object"&&typeof t.createdBranch=="string"&&typeof t.currentBranch<"u"}async function xo(t){let a=t;for(let r=0;r<60;r++){if(a.status==="succeeded"){if(uo(a.result))return a.result;throw new Error("Branch creation completed without branch details")}if(a.status==="failed")throw new Error(a.error||"Branch creation failed");await co(1e3),a=await Ps(a.id)}throw new Error("Timed out waiting for branch creation")}function Ns({value:t,onChange:a,project:r,assignTo:o,nodes:n,assignableNodes:l,layout:u="default",chipClassName:j,chipActiveClassName:f,chipInactiveClassName:g,labelClassName:N,triggerClassName:d}){const[c,x]=s.useState(!1),[y,b]=s.useState(null),[S,w]=s.useState(""),[C,h]=s.useState(!1),[I,_]=s.useState(!1),[K,M]=s.useState(!1),[z,A]=s.useState(null),[O,de]=s.useState(""),[R,H]=s.useState(""),[J,F]=s.useState(""),[oe,ie]=s.useState(!1),B=s.useRef(null),W=s.useRef(0),ce=s.useMemo(()=>lo(o,n,l),[o,n,l]),V=ce==null?void 0:ce.id,Z=s.useMemo(()=>io(r),[r]),Y=s.useMemo(()=>V?`${V}
|
|
118
|
+
${Z}`:"",[V,Z]),ae=s.useCallback(async(p=0,T=!1)=>{const U=W.current+1,ke=Y;if(W.current=U,!V){b(null),w("");return}A(null),T||w(""),T?_(!0):h(!0);try{const k=await er(V,{path:Z,limit:20,offset:p,allowAbsolute:!0});if(U!==W.current)return;w(ke),b(X=>T&&X?{...k,branches:[...X.branches,...k.branches]}:k)}catch(k){if(U!==W.current)return;A(k instanceof Error?k.message:"Failed to load branch info"),T||(b(null),w(""))}finally{U===W.current&&(h(!1),_(!1))}},[V,Y,Z]);s.useEffect(()=>{if(!V){W.current+=1,b(null),w(""),A(null);return}ae()},[V,Z,ae]),s.useEffect(()=>{const p=t.trim(),T=S===Y?y:null,U=T!=null&&T.available&&T.currentBranch?T.currentBranch:"";p!==U&&a(U)},[y,Y,S,a,t]),s.useEffect(()=>{if(!c)return;const p=U=>{B.current&&(B.current.contains(U.target)||x(!1))},T=U=>{U.key==="Escape"&&x(!1)};return document.addEventListener("mousedown",p),document.addEventListener("keydown",T),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",T)}},[c]),s.useEffect(()=>{c&&(H(""),F(""),ie(!1))},[c,V,Z]);const le=s.useCallback(async()=>{if(!V)return;const p=O.trim(),T=oe?J.trim():R.trim();if(!(!p||!T)){M(!0),A(null);try{const U=await tr(V,{path:Z,branchName:p,startPoint:T,limit:20,offset:0,allowAbsolute:!0}),ke=await xo(U);w(Y),b(ke),a(ke.currentBranch??ke.createdBranch),de(""),H(""),F(""),ie(!1),x(!1)}catch(U){A(U instanceof Error?U.message:"Failed to create branch")}finally{M(!1)}}},[V,Y,Z,oe,J,O,a,R]),m=S===Y?y:null,ee=s.useCallback(()=>{m!=null&&m.hasMore&&ae(m.branches.length,!0)},[m,ae]),P=t.trim()||(m==null?void 0:m.currentBranch)||(m&&!m.available?"No git repo":"Branch"),Ne=oe?J.trim():R.trim(),re=!!(m!=null&&m.available&&O.trim()&&Ne&&!K),we=u==="composer"?e.jsxs($,{type:"button",variant:"ghost",onClick:()=>x(p=>!p),title:P,"aria-label":`Branch: ${P}`,className:L(j,d,"min-w-0 max-w-full",t.trim()?f:g),children:[C&&!m?e.jsx(je,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}):e.jsx(vs,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:L("min-w-0 truncate",N),children:P})]}):e.jsxs($,{type:"button",variant:"outline",onClick:()=>x(p=>!p),className:"h-11 w-full justify-between rounded-2xl border-border/70 bg-background/70 px-4",title:P,children:[e.jsx("span",{className:L("truncate",t.trim()?"font-mono text-foreground":"text-muted-foreground"),children:P}),e.jsx("span",{className:"ml-3 shrink-0 text-xs text-muted-foreground",children:ce?ce.name:"Manual"})]});return e.jsxs("div",{className:L("relative inline-block",u==="composer"?"min-w-0 shrink-0":"w-full"),ref:B,children:[u==="default"?e.jsxs("div",{className:"space-y-2",children:[e.jsx(Te,{className:"text-sm font-medium",children:"Branch"}),we]}):we,c&&e.jsxs("div",{className:L("absolute z-50 mt-2 w-[240px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 shadow-lg backdrop-blur",u==="composer"?"left-0":"left-0 right-0 w-auto min-w-[240px]"),children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border/60 px-3 py-2",children:[e.jsx(vs,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",title:m!=null&&m.repoRoot?`${m.currentBranch??P} · ${m.repoRoot}`:(m==null?void 0:m.currentBranch)??P,children:(m==null?void 0:m.currentBranch)??P}),C?e.jsx(je,{className:"h-3 w-3 shrink-0 animate-spin text-muted-foreground"}):null]}),ce?C&&!m?e.jsxs("div",{className:"flex items-center justify-center px-3 py-4 text-[11px] text-muted-foreground",children:[e.jsx(je,{className:"mr-1.5 h-3 w-3 animate-spin"}),"Loading..."]}):m&&!m.available?e.jsx("div",{className:"px-3 py-4 text-center text-[11px] text-muted-foreground",children:"Not a git repository."}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"space-y-2 px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Re,{value:O,onChange:p=>de(p.target.value),placeholder:"New branch name",className:"h-8 flex-1 rounded-md border-border/60 bg-background/70 font-mono text-[11px]"}),e.jsx($,{type:"button",size:"sm",onClick:()=>void le(),disabled:!re,title:re?"Create branch":"Enter a name and pick a base","aria-label":"Create branch",className:"h-8 w-8 shrink-0 rounded-md p-0",children:K?e.jsx(je,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Pn,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Base from"}),!oe&&e.jsxs("button",{type:"button",onClick:()=>ie(!0),className:"flex items-center gap-1 rounded px-1 py-0.5 text-[10px] text-muted-foreground hover:bg-background/60 hover:text-foreground",children:[e.jsx(at,{className:"h-2.5 w-2.5"}),"Manual"]})]}),oe?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Re,{value:J,onChange:p=>F(p.target.value),placeholder:"upstream/release/1.0",className:"h-8 flex-1 rounded-md border-border/60 bg-background/70 font-mono text-[11px]"}),e.jsx("button",{type:"button",onClick:()=>{ie(!1),F("")},className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/60 hover:text-foreground",title:"Cancel manual input","aria-label":"Cancel manual input",children:e.jsx(Ue,{className:"h-3.5 w-3.5"})})]}):m!=null&&m.branches.length?e.jsxs("div",{className:"max-h-44 overflow-y-auto rounded-md border border-border/40 bg-background/40",children:[m.branches.map(p=>{const T=R===p.ref,U=p.branch==="main"||p.branch==="master";return e.jsxs("button",{type:"button",onClick:()=>H(p.ref),className:L("flex w-full items-center gap-2 border-b border-border/20 px-2.5 py-1.5 text-left text-[11px] last:border-b-0 hover:bg-background/60",T&&"bg-background/70"),title:p.ref,children:[e.jsx("span",{className:L("shrink-0 text-[10px]",U?"text-amber-500 dark:text-amber-400":"text-muted-foreground/60"),"aria-hidden":!0,children:U?"★":"·"}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-foreground",children:p.ref}),T?e.jsx(qe,{className:"h-3 w-3 shrink-0 text-primary"}):null]},p.ref)}),m.hasMore&&e.jsxs("button",{type:"button",onClick:ee,disabled:I,className:"flex w-full items-center justify-center gap-1 border-t border-border/20 py-1 text-[10px] text-muted-foreground hover:bg-background/60 hover:text-foreground disabled:opacity-50",children:[I?e.jsx(je,{className:"h-3 w-3 animate-spin"}):e.jsx(Rt,{className:"h-3 w-3"}),"Load more"]})]}):e.jsx("div",{className:"rounded-md border border-dashed border-border/40 px-2.5 py-2 text-[11px] text-muted-foreground",children:"No remote branches found."})]})]})}):e.jsx("div",{className:"px-3 py-4 text-center text-[11px] text-muted-foreground",children:"Select a specific node first."}),z&&e.jsx("div",{className:"border-t border-destructive/20 bg-destructive/10 px-3 py-1.5 text-[11px] text-destructive",children:z})]})]})}const mo=20,ho=3,It="meshy-working-dir-recents-by-node";function po(t){return t.startsWith("/")||t.startsWith("\\\\")||/^[A-Za-z]:[\\/]/.test(t)}function fo(t){const a=t.trim();return a||"."}function Ot(t){const a=[],r=new Set;for(const o of t){const n=o.trim();if(!(!n||r.has(n))&&(r.add(n),a.push(n),a.length===ho))break}return a}function go(t,a){const r=a.trim();return Ot(r?[r,...t]:t)}function oa(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const a={};for(const[r,o]of Object.entries(t)){if(!r||!Array.isArray(o))continue;const n=o.filter(u=>typeof u=="string"),l=Ot(n);l.length>0&&(a[r]=l)}return a}function bo(t,a,r){if(!a)return t;const o=t[a]??[],n=go(o,r);if(n.length===0){if(!(a in t))return t;const{[a]:l,...u}=t;return u}return{...t,[a]:n}}function vo(t,a){var r;return a?((r=t[a])==null?void 0:r[0])??"":""}function la(t){if(!t||typeof window>"u")return"";try{const a=window.localStorage.getItem(It);return a?vo(oa(JSON.parse(a)),t):""}catch{return""}}function jo(t,a,r){return t!=="auto"?a.find(o=>o.id===t)??null:r.length===1?r[0]??null:null}function No(t,a){const r=a.trim();return r?po(r)||!t?r:`${t.replace(/[/\\]+$/,"")}/${r}`:""}function ko(t,a){return t?t.isAbsolute?t.currentPath:t.currentPath==="."||t.currentPath===""?t.rootPath||(a==null?void 0:a.workDir)||"Node root":t.currentPath:(a==null?void 0:a.workDir)??"Node root"}function xt({value:t,onChange:a,assignTo:r,nodes:o,assignableNodes:n,layout:l="default",chipClassName:u,chipActiveClassName:j,chipInactiveClassName:f,labelClassName:g,triggerClassName:N}){const[d,c]=s.useState(!1),[x,y]=s.useState(null),[b,S]=s.useState(!1),[w,C]=s.useState(!1),[h,I]=s.useState(null),[_,K]=s.useState(""),[M,z]=s.useState(!1),[A,O]=s.useState({}),de=s.useRef(null),R=s.useMemo(()=>jo(r,o,n),[r,o,n]),H=R==null?void 0:R.id,J=s.useMemo(()=>H?A[H]??[]:[],[A,H]),F=s.useMemo(()=>t.trim()?No(R==null?void 0:R.workDir,t):"Use node default",[t,R==null?void 0:R.workDir]);s.useEffect(()=>{if(!(typeof window>"u"))try{const m=window.localStorage.getItem(It);if(!m)return;const ee=JSON.parse(m);O(oa(ee))}catch{}},[]);const oe=s.useCallback(m=>{H&&O(ee=>{const P=bo(ee,H,m);if(P===ee)return ee;if(typeof window<"u")try{window.localStorage.setItem(It,JSON.stringify(P))}catch{}return P})},[H]),ie=s.useCallback((m,ee=!0)=>{const P=m.trim();a(P),ee&&P&&oe(P),c(!1)},[a,oe]),B=s.useCallback(async(m,ee=0,P=!1)=>{if(H){I(null),P?C(!0):S(!0);try{const Ne=await sr(H,{path:m,limit:mo,offset:ee,directoriesOnly:!0,allowAbsolute:!0});y(re=>P&&re?{...Ne,entries:[...re.entries,...Ne.entries]}:Ne)}catch(Ne){I(Ne instanceof Error?Ne.message:"Failed to browse directories"),P||y(null)}finally{S(!1),C(!1)}}},[H]),W=s.useRef(t);W.current=t;const ce=s.useRef(B);ce.current=B,s.useEffect(()=>{if(!d)return;const m=W.current;K(m),z(!1),y(null),I(null),H&&ce.current(fo(m))},[d,H]),s.useEffect(()=>{if(!d)return;const m=P=>{de.current&&(de.current.contains(P.target)||c(!1))},ee=P=>{P.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",m),document.addEventListener("keydown",ee),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",ee)}},[d]);const V=s.useCallback(m=>{B(m)},[B]),Z=s.useCallback(()=>{x&&B(x.currentPath,x.entries.length,!0)},[x,B]),Y=l==="composer"?e.jsxs($,{type:"button",variant:"ghost",onClick:()=>c(m=>!m),title:F,"aria-label":`Working directory: ${F}`,className:L(u,N,"min-w-0 max-w-full",t.trim()?j:f),children:[e.jsx(ar,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:L("min-w-0 truncate",g),children:F})]}):e.jsxs($,{type:"button",variant:"outline",onClick:()=>c(m=>!m),className:"h-11 w-full justify-between rounded-2xl border-border/70 bg-background/70 px-4",title:F,children:[e.jsx("span",{className:L("truncate",t.trim()?"font-mono text-foreground":"text-muted-foreground"),children:F}),e.jsx("span",{className:"ml-3 shrink-0 text-xs text-muted-foreground",children:R?R.name:"Manual"})]}),ae=ko(x,R),le=!!(x!=null&&x.parentPath);return e.jsxs("div",{className:L("relative inline-block",l==="composer"?"min-w-0 max-w-[60%] shrink":"w-full"),ref:de,children:[l==="default"?e.jsxs("div",{className:"space-y-2",children:[e.jsx(Te,{className:"text-sm font-medium",children:"Working directory"}),Y]}):Y,d&&e.jsxs("div",{className:L("absolute z-50 mt-2 w-[240px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 shadow-lg backdrop-blur",l==="composer"?"left-0":"left-0 right-0 w-auto min-w-[240px]"),children:[J.length>0&&e.jsxs("div",{className:"border-b border-border/60 px-3 py-2",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1 text-[10px] text-muted-foreground",children:[e.jsx(Rt,{className:"h-2.5 w-2.5"}),"Recent"]}),e.jsx("div",{className:"flex flex-col",children:J.map(m=>e.jsx("button",{type:"button",onClick:()=>ie(m),className:"truncate rounded px-1.5 py-0.5 text-left font-mono text-[11px] text-foreground hover:bg-background/60",title:m,children:m},m))})]}),e.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border/60 px-2.5 py-1.5",children:[e.jsx("button",{type:"button",onClick:()=>(x==null?void 0:x.parentPath)&&V(x.parentPath),disabled:!le||b,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border/60 text-muted-foreground transition-colors hover:bg-background/60 hover:text-foreground disabled:opacity-40",title:"Parent directory",children:e.jsx(mn,{className:"h-3 w-3"})}),e.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",title:ae,children:ae}),x&&e.jsx("button",{type:"button",onClick:()=>ie(x.isAbsolute?x.currentPath:x.currentPath==="."?"":x.currentPath),className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium text-foreground hover:bg-background/60",title:"Use this folder",children:"Use"})]}),e.jsxs("div",{className:"max-h-56 overflow-y-auto",children:[R?b?e.jsxs("div",{className:"flex items-center justify-center px-3 py-4 text-[11px] text-muted-foreground",children:[e.jsx(je,{className:"mr-1.5 h-3 w-3 animate-spin"}),"Loading..."]}):x&&x.entries.length>0?e.jsxs(e.Fragment,{children:[x.entries.map(m=>e.jsxs("div",{className:"group flex items-stretch border-b border-border/30 last:border-b-0",children:[e.jsxs("button",{type:"button",onClick:()=>ie(m.path),className:"flex min-w-0 flex-1 items-center gap-2 px-2.5 py-1.5 text-left hover:bg-background/55",title:`Use ${m.path}`,children:[e.jsx(dn,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"truncate text-[11px] text-foreground",children:m.name})]}),e.jsx("button",{type:"button",onClick:()=>V(m.path),className:"flex w-9 shrink-0 items-center justify-center border-l border-border/30 text-muted-foreground hover:bg-background/70 hover:text-foreground",title:"Open subfolder","aria-label":`Open ${m.name}`,children:e.jsx(et,{className:"h-3.5 w-3.5"})})]},m.path)),x.hasMore&&e.jsxs("button",{type:"button",onClick:Z,disabled:w,className:"flex w-full items-center justify-center gap-1 border-t border-border/40 py-1 text-[10px] text-muted-foreground hover:bg-background/60 hover:text-foreground disabled:opacity-50",children:[w?e.jsx(je,{className:"h-3 w-3 animate-spin"}):e.jsx(Rt,{className:"h-3 w-3"}),"Load more"]})]}):e.jsx("div",{className:"px-3 py-4 text-center text-[11px] text-muted-foreground",children:h??"No subfolders."}):e.jsx("div",{className:"px-3 py-4 text-center text-[11px] text-muted-foreground",children:"Select a node to browse."}),h&&x&&x.entries.length>0&&e.jsx("div",{className:"border-t border-border/60 px-3 py-1.5 text-[11px] text-destructive",children:h})]}),e.jsx("div",{className:"flex items-center gap-1 border-t border-border/60 bg-background/40 px-2.5 py-1.5",children:M?e.jsxs(e.Fragment,{children:[e.jsx(Re,{value:_,onChange:m=>K(m.target.value),onKeyDown:m=>{m.key==="Enter"&&_.trim()?(m.preventDefault(),ie(_)):m.key==="Escape"&&(m.preventDefault(),z(!1),K(t))},autoFocus:!0,placeholder:"Path (relative or absolute)",className:"h-7 flex-1 rounded-md border-border/60 bg-background/70 font-mono text-[11px]"}),e.jsx("button",{type:"button",onClick:()=>ie(_),disabled:!_.trim(),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-foreground hover:bg-background/60 disabled:opacity-40",title:"Apply","aria-label":"Apply manual path",children:e.jsx(qe,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:()=>{z(!1),K(t)},className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/60 hover:text-foreground",title:"Cancel","aria-label":"Cancel manual path",children:e.jsx(Ue,{className:"h-3.5 w-3.5"})})]}):e.jsxs("button",{type:"button",onClick:()=>{K(t),z(!0)},className:"flex h-7 flex-1 items-center justify-between rounded-md px-1.5 text-[11px] text-muted-foreground hover:bg-background/60 hover:text-foreground",title:"Enter a manual path",children:[e.jsx("span",{children:"Manual input"}),e.jsx(at,{className:"h-3 w-3"})]})})]})]})}function ia(t,a={}){const r=t.filter(o=>o.status==="online");return a.currentNodeRole!=="follower"||!a.leaderNodeId?r:r.filter(o=>o.id!==a.leaderNodeId)}function Xt({isCurrent:t}){return t?e.jsx(wn,{className:"h-3.5 w-3.5 shrink-0 text-emerald-500 dark:text-emerald-400","aria-label":"current node"}):e.jsx(jn,{className:"h-3.5 w-3.5 shrink-0 text-sky-500 dark:text-sky-400","aria-label":"remote follower node"})}function Bt(t,a){return t.map(r=>{const o=!!a&&r.id===a;return e.jsx(pe,{value:r.id,children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(Xt,{isCurrent:o}),e.jsx("span",{className:"truncate",children:r.name}),e.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:o?"current":"remote"})]})},r.id)})}function yo(t){var o;const a=t.sessionId.trim(),r=t.cwd.trim();return!a||!r||!t.assignTo?null:{title:t.title.trim()||((o=t.defaultTitle)==null?void 0:o.trim())||void 0,agent:t.agent,sessionId:a,cwd:r,assignTo:t.assignTo,priority:t.priority,mode:t.mode??Ze}}function wo(){return Kt.map(t=>e.jsx(pe,{value:t.value,children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{children:t.label}),t.description&&e.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:t.description})]})},t.value))}function Co(t){if(!t)return"unknown time";const a=Date.parse(t);return Number.isNaN(a)?t:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(a)}function So({nodes:t,currentNodeRole:a,currentNodeId:r,leaderNodeId:o,onCreated:n,onCancel:l,className:u,footerClassName:j,submitLabel:f="Load session",cancelLabel:g="Cancel",autoFocus:N=!1}){const d=s.useMemo(()=>ia(t,{currentNodeRole:a,leaderNodeId:o}),[t,a,o]),c=s.useMemo(()=>{var p;return r&&d.some(T=>T.id===r)?r:((p=d[0])==null?void 0:p.id)??""},[d,r]),[x,y]=s.useState(""),[b,S]=s.useState("codex"),[w,C]=s.useState(""),[h,I]=s.useState(""),[_,K]=s.useState(""),[M,z]=s.useState(c),[A,O]=s.useState("normal"),[de,R]=s.useState(Ze),[H,J]=s.useState(!1),[F,oe]=s.useState([]),[ie,B]=s.useState(!1),[W,ce]=s.useState(null),V=s.useMemo(()=>F.find(p=>p.sessionId===w)??null,[F,w]);s.useEffect(()=>{M&&d.some(p=>p.id===M)||z(c)},[M,d,c]),s.useEffect(()=>{C(""),I(""),K("")},[b,M]),s.useEffect(()=>{let p=!1;return M?(B(!0),ce(null),rr(M,{agent:b,limit:50}).then(T=>{p||oe(T.sessions)}).catch(T=>{p||(oe([]),ce(T instanceof Error?T.message:"Failed to load native sessions"))}).finally(()=>{p||B(!1)}),()=>{p=!0}):(oe([]),ce(null),B(!1),()=>{p=!0})},[b,M]),s.useEffect(()=>{V&&(I(V.sessionId),K(V.cwd))},[V]);const Z=s.useCallback(async p=>{p.preventDefault();const T=yo({title:x,defaultTitle:V==null?void 0:V.summary,agent:b,sessionId:h,cwd:_,assignTo:M,priority:A,mode:de});if(T){J(!0);try{const U=await nr(T);n(U)}catch(U){xe.error(U instanceof Error?U.message:"Failed to load native session")}finally{J(!1)}}},[x,V,b,h,_,M,A,de,n]),Y=!!(h.trim()&&_.trim()&&M),[ae,le]=s.useState(!1),[m,ee]=s.useState(""),P=d.find(p=>p.id===M)??null,Ne=!!(r&&(P==null?void 0:P.id)===r),re=s.useMemo(()=>{const p=m.trim().toLowerCase();return p?F.filter(T=>T.summary.toLowerCase().includes(p)||T.sessionId.toLowerCase().includes(p)||T.cwd.toLowerCase().includes(p)):F},[F,m]),we="h-9 w-auto gap-1.5 rounded-[15px] border-border/60 bg-background/60 px-3 text-xs shadow-none transition-colors hover:bg-background/80";return e.jsxs("form",{onSubmit:Z,className:L("space-y-4",u),children:[e.jsxs("div",{className:"rounded-[26px] border border-border/60 bg-background/54 shadow-[0_24px_86px_-48px_rgba(15,23,42,0.55)] backdrop-blur-xl dark:shadow-[0_24px_86px_-48px_rgba(0,0,0,0.9)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border/50 px-4 py-3",children:[e.jsxs(Se,{value:M,onValueChange:z,children:[e.jsx(Ee,{className:L(we),"aria-label":"Node",children:P?e.jsxs(e.Fragment,{children:[e.jsx(Xt,{isCurrent:Ne}),e.jsx("span",{className:"max-w-[10rem] truncate",children:P.name})]}):e.jsx(Me,{placeholder:"Node"})}),e.jsx(_e,{children:Bt(d,r)})]}),e.jsxs(Se,{value:b,onValueChange:p=>S(p),children:[e.jsxs(Ee,{className:L(we),"aria-label":"Agent",children:[e.jsx(Vt,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{children:b})]}),e.jsxs(_e,{children:[e.jsx(pe,{value:"codex",children:"codex"}),e.jsx(pe,{value:"claudecode",children:"claudecode"})]})]}),e.jsxs("div",{className:"relative ml-auto min-w-0 flex-1 sm:max-w-56",children:[e.jsx($t,{className:"pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),e.jsx(Re,{value:m,onChange:p=>ee(p.target.value),placeholder:"Filter sessions",className:"h-9 rounded-[15px] border-border/60 bg-background/60 pl-9 text-xs shadow-none"})]})]}),e.jsxs("div",{className:"px-3 py-3",children:[e.jsx("div",{className:"flex items-center justify-between px-1 pb-2",children:e.jsx(Te,{className:"text-[10px] font-medium uppercase tracking-[0.2em] text-muted-foreground",children:ie?"Loading...":`${re.length} session${re.length===1?"":"s"}`})}),e.jsxs("div",{className:"relative h-88 overflow-hidden rounded-[20px]",children:[ie&&e.jsx("div",{className:"absolute inset-x-0 top-0 z-10 h-0.5 overflow-hidden bg-primary/10",children:e.jsx("div",{className:"h-full w-1/3 animate-indeterminate-bar bg-primary/70"})}),e.jsxs("div",{className:"h-full space-y-1.5 overflow-y-auto pr-1 pt-1",children:[!M&&e.jsx("div",{className:"rounded-[18px] border border-dashed border-border/60 bg-background/35 px-4 py-6 text-center text-xs text-muted-foreground",children:"Pick a node to load its recent sessions."}),M&&!ie&&re.length===0&&e.jsx("div",{className:"rounded-[18px] border border-dashed border-border/60 bg-background/35 px-4 py-6 text-center text-xs text-muted-foreground",children:F.length===0?"No recent sessions on this node. Use Manual session ID under More options.":"No sessions match your filter."}),re.map(p=>{const T=p.sessionId===w;return e.jsxs("button",{type:"button",onClick:()=>C(p.sessionId),className:L("flex w-full flex-col gap-1 rounded-[18px] border px-3 py-2.5 text-left transition-all duration-200 hover:-translate-y-px",T?"border-primary/45 bg-primary/9 shadow-[0_18px_60px_-44px_hsl(var(--primary)/0.95)]":"border-border/55 bg-background/40 hover:border-border hover:bg-background/65"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:L("h-2 w-2 shrink-0 rounded-full",T?"bg-primary":"bg-border")}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:p.summary}),e.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:Co(p.updatedAt)})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-4 text-[10px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:p.sessionId.slice(0,12)}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-border"}),e.jsx("span",{className:"truncate font-mono",children:p.cwd})]})]},p.sessionId)})]})]}),W&&e.jsx("p",{className:"px-1 pt-2 text-[11px] text-destructive",children:W})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("button",{type:"button",onClick:()=>le(p=>!p),className:"flex w-full items-center gap-2 text-[11px] font-medium uppercase tracking-[0.2em] text-muted-foreground transition-colors hover:text-foreground","aria-expanded":ae,children:[e.jsx("span",{className:"h-px flex-1 bg-border/60","aria-hidden":!0}),e.jsx("span",{className:"shrink-0",children:ae?"Less options":"More options"}),e.jsx(st,{className:L("h-3.5 w-3.5 shrink-0 transition-transform",ae&&"rotate-180")}),e.jsx("span",{className:"h-px flex-1 bg-border/60","aria-hidden":!0})]}),ae&&e.jsxs("div",{className:"space-y-4 rounded-[22px] border border-border/60 bg-background/35 p-4",children:[e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Te,{htmlFor:"native-session-id",className:"text-xs font-medium text-muted-foreground",children:"Session ID"}),e.jsx(Re,{id:"native-session-id",type:"text",value:h,onChange:p=>{C(""),I(p.target.value)},placeholder:"ses_... or thread_...",autoFocus:N,className:"h-10 rounded-[16px] border-border/70 bg-background/70 font-mono text-xs"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Te,{htmlFor:"native-session-title",className:"text-xs font-medium text-muted-foreground",children:"Task title"}),e.jsx(Re,{id:"native-session-title",type:"text",value:x,onChange:p=>y(p.target.value),placeholder:"Optional",className:"h-10 rounded-[16px] border-border/70 bg-background/70 text-sm"})]})]}),e.jsx(xt,{value:_,onChange:p=>{C(""),K(p)},assignTo:M,nodes:t,assignableNodes:d}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Te,{className:"text-xs font-medium text-muted-foreground",children:"Mode"}),e.jsxs(Se,{value:de,onValueChange:p=>R(p),children:[e.jsx(Ee,{className:"h-10 rounded-[16px] border-border/70 bg-background/70 text-sm",children:e.jsx(Me,{placeholder:"Select mode"})}),e.jsx(_e,{children:wo()})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Te,{className:"text-xs font-medium text-muted-foreground",children:"Priority"}),e.jsxs(Se,{value:A,onValueChange:O,children:[e.jsx(Ee,{className:"h-10 rounded-[16px] border-border/70 bg-background/70 text-sm",children:e.jsx(Me,{placeholder:"Select priority"})}),e.jsxs(_e,{children:[e.jsx(pe,{value:"low",children:"Low"}),e.jsx(pe,{value:"normal",children:"Normal"}),e.jsx(pe,{value:"high",children:"High"}),e.jsx(pe,{value:"critical",children:"Critical"})]})]})]})]})]})]}),e.jsxs("div",{className:L("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",j),children:[l&&e.jsx($,{type:"button",variant:"ghost",onClick:l,className:"rounded-[16px]",children:g}),e.jsx($,{type:"submit",disabled:!Y||H,className:"rounded-[16px] px-5",children:H?e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"h-4 w-4 animate-spin"})," Loading..."]}):f})]})]})}function ks(){return Rs.map(t=>e.jsx(pe,{value:t.value,disabled:t.disabled,children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{children:t.label}),t.description&&e.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:t.description})]})},t.value))}function ys(){return Kt.map(t=>e.jsx(pe,{value:t.value,children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{children:t.label}),t.description&&e.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:t.description})]})},t.value))}function Eo(t){var a;return((a=Rs.find(r=>r.value===t))==null?void 0:a.label)??t}function _o(t){var a;return((a=Kt.find(r=>r.value===t))==null?void 0:a.label)??t}function da(t,a,r=!1){const o=t.trim();if(o)return o;const n=a.trim().split(`
|
|
119
|
+
`).map(l=>l.trim()).find(Boolean);return n?n.length>72?`${n.slice(0,69).trimEnd()}...`:n:r?"Image task":""}function To(t){var u;const a=t.title.trim(),r=da(t.title,t.description,t.images.length>0),o=t.description.trim()||r,n=t.mode??Ze,l=Ws(t.description,t.images);return!r||!o||!t.agent?null:{title:r,description:o,agent:t.agent,project:t.project.trim()||null,branch:((u=t.branch)==null?void 0:u.trim())||null,payload:{initialMessage:l,mode:n,titleSource:a?"manual":"derived"},priority:t.priority,assignTo:t.assignTo==="auto"?void 0:t.assignTo}}function Do({nodes:t,currentNodeRole:a,currentNodeId:r,leaderNodeId:o,onCreated:n,onCancel:l,className:u,footerClassName:j,submitLabel:f="Create chat",cancelLabel:g="Cancel",autoFocus:N=!1,layout:d="default"}){const[c,x]=s.useState(""),[y,b]=s.useState(""),[S,w]=s.useState("claudecode"),[C,h]=s.useState(Ze),[I,_]=s.useState(""),[K,M]=s.useState(""),[z,A]=s.useState("normal"),O=s.useMemo(()=>ia(t,{currentNodeRole:a,leaderNodeId:o}),[t,a,o]),de=s.useMemo(()=>{var D;return r&&O.some(te=>te.id===r)?r:((D=O[0])==null?void 0:D.id)??""},[O,r]),[R,H]=s.useState(de),[J,F]=s.useState(!1),[oe,ie]=s.useState(!1),{images:B,error:W,fileInputRef:ce,pickImages:V,handleFileChange:Z,handlePaste:Y,removeImage:ae}=na(),le=s.useMemo(()=>O.find(D=>D.id===R)??null,[R,O]),m=!!(r&&(le==null?void 0:le.id)===r),ee=Eo(S),P=_o(C);s.useEffect(()=>{R&&O.some(D=>D.id===R)||H(de)},[R,O,de]),s.useEffect(()=>{_(la(R)),M("")},[R]),s.useEffect(()=>{M("")},[I]);const Ne=s.useCallback(async D=>{D.preventDefault();const te=To({title:c,description:y,agent:S,project:I,branch:K,priority:z,assignTo:R,mode:C,images:B});if(te){F(!0);try{const ge=await lr(te);n(ge)}catch(ge){xe.error(ge instanceof Error?ge.message:"Failed to create task")}finally{F(!1)}}},[c,y,S,I,K,z,R,C,B,n]),re=da(c,y,B.length>0),we=!!(re&&S&&R&&(y.trim()||B.length>0)),p=s.useCallback(D=>{var te;D.nativeEvent.isComposing||D.key==="Enter"&&(D.ctrlKey||D.metaKey)&&we&&!J&&(D.preventDefault(),(te=D.currentTarget.form)==null||te.requestSubmit())},[we,J]),T=B.length>0&&e.jsx("div",{className:"flex flex-wrap gap-3",children:B.map((D,te)=>e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:Gs(D),alt:D.filename??`attachment ${te+1}`,className:"h-24 w-24 rounded-2xl border border-border/70 object-cover"}),e.jsx("button",{type:"button",onClick:()=>ae(te),className:"absolute -top-2 -right-2 flex h-6 w-6 items-center justify-center rounded-[10px] border border-border/70 bg-background text-muted-foreground shadow-sm transition-all hover:-translate-y-px hover:text-foreground","aria-label":`Remove ${D.filename??`image ${te+1}`}`,children:e.jsx(Ue,{className:"h-3.5 w-3.5"})})]},`${D.filename??"image"}-${te}`))}),U=e.jsxs("div",{className:"space-y-2",children:[e.jsx(Te,{className:"text-sm font-medium",children:"Assign to"}),e.jsxs(Se,{value:R,onValueChange:H,children:[e.jsx(Ee,{className:"h-11 rounded-[18px] border-border/70 bg-background/70",children:e.jsx(Me,{placeholder:"Select node"})}),e.jsx(_e,{children:Bt(O,r)})]})]}),ke=e.jsxs("div",{className:"space-y-2",children:[e.jsx(Te,{className:"text-sm font-medium",children:"Agent"}),e.jsxs(Se,{value:S,onValueChange:w,children:[e.jsx(Ee,{className:"h-11 rounded-[18px] border-border/70 bg-background/70",children:e.jsx(Me,{placeholder:"Select agent"})}),e.jsx(_e,{children:ks()})]})]}),k=e.jsxs("div",{className:"space-y-2",children:[e.jsx(Te,{className:"text-sm font-medium",children:"Mode"}),e.jsxs(Se,{value:C,onValueChange:D=>h(D),children:[e.jsx(Ee,{className:"h-11 rounded-[18px] border-border/70 bg-background/70",children:e.jsx(Me,{placeholder:"Select mode"})}),e.jsx(_e,{children:ys()})]})]}),X=e.jsxs("div",{className:"space-y-2",children:[e.jsx(Te,{className:"text-sm font-medium",children:"Priority"}),e.jsxs(Se,{value:z,onValueChange:A,children:[e.jsx(Ee,{className:"h-11 rounded-[18px] border-border/70 bg-background/70",children:e.jsx(Me,{placeholder:"Select priority"})}),e.jsxs(_e,{children:[e.jsx(pe,{value:"low",children:"Low"}),e.jsx(pe,{value:"normal",children:"Normal"}),e.jsx(pe,{value:"high",children:"High"}),e.jsx(pe,{value:"critical",children:"Critical"})]})]})]}),ne=e.jsx(xt,{value:I,onChange:_,assignTo:R,nodes:t,assignableNodes:O}),me=e.jsx(Ns,{value:K,onChange:M,project:I,assignTo:R,nodes:t,assignableNodes:O});return d==="composer"?e.jsxs("form",{onSubmit:Ne,className:L("space-y-4",u),children:[e.jsx("input",{ref:ce,type:"file",accept:"image/*",multiple:!0,onChange:Z,className:"hidden"}),(()=>{const D="chat-composer__chip h-9 w-auto gap-1.5 rounded-[15px] px-3.5 text-xs shadow-none transition-colors",te="border-transparent bg-transparent text-muted-foreground hover:bg-background/40 hover:text-foreground",ge="border-border/70 bg-background/55 text-foreground",Q=S==="claudecode",Fe=C===Ze;return e.jsxs("div",{className:"chat-composer space-y-2",children:[e.jsxs("div",{className:"rounded-[26px] border border-border/60 bg-background/54 shadow-[0_24px_86px_-48px_rgba(15,23,42,0.55)] backdrop-blur-xl dark:shadow-[0_24px_86px_-48px_rgba(0,0,0,0.9)]",children:[e.jsxs("div",{className:"chat-composer__header flex min-w-0 items-center justify-between gap-3 px-4 pt-3",children:[e.jsxs(Se,{value:R,onValueChange:H,children:[e.jsx(Ee,{className:L(D,ge,"chat-composer__node-trigger border-transparent bg-transparent hover:bg-background/40"),title:`Assigned node: ${(le==null?void 0:le.name)??"unassigned"}`,"aria-label":`Assigned node: ${(le==null?void 0:le.name)??"unassigned"}`,children:le?e.jsxs(e.Fragment,{children:[e.jsx(Xt,{isCurrent:m}),e.jsx("span",{className:"min-w-0 truncate",children:le.name}),e.jsx("span",{className:"chat-composer__header-meta shrink-0 text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:m?"current":"remote"})]}):e.jsx(Me,{placeholder:"Select node"})}),e.jsx(_e,{children:Bt(O,r)})]}),oe?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Re,{id:"task-title-composer",type:"text",value:c,onChange:ye=>x(ye.target.value),onKeyDown:ye=>{(ye.key==="Enter"||ye.key==="Escape")&&(ye.preventDefault(),ie(!1))},autoFocus:!0,placeholder:"Chat title",className:"h-8 w-48 min-w-0 rounded-[13px] border-border/70 bg-background/55 px-3 text-xs shadow-none"}),e.jsx($,{type:"button",variant:"ghost",size:"icon",onClick:()=>ie(!1),"aria-label":"Save title",className:"h-8 w-8 shrink-0 rounded-[12px] text-muted-foreground hover:text-foreground",children:e.jsx(qe,{className:"h-3.5 w-3.5"})})]}):e.jsxs("button",{type:"button",onClick:()=>ie(!0),className:"chat-composer__title-button flex min-w-0 items-center gap-1.5 rounded-[13px] px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-background/55 hover:text-foreground",title:re||"Title","aria-label":re?`Edit title: ${re}`:"Edit title",children:[e.jsx("span",{className:"chat-composer__title-text max-w-[220px] truncate",children:re||"Title"}),e.jsx(at,{className:"h-3 w-3 shrink-0"})]})]}),e.jsx("textarea",{id:"task-description",value:y,onChange:ye=>b(ye.target.value),onKeyDown:p,onPaste:Y,placeholder:"Ask anything...",rows:4,autoFocus:N,"aria-label":"Opening prompt",className:"min-h-[140px] w-full resize-none rounded-[24px] bg-transparent px-5 pt-2 pb-2 text-[15px] leading-7 text-foreground ring-offset-background placeholder:text-muted-foreground/70 focus-visible:outline-none"}),e.jsxs("div",{className:"chat-composer__rail flex flex-nowrap items-center gap-2 px-3 pb-3",children:[e.jsx($,{type:"button",variant:"ghost",size:"icon",onClick:V,"aria-label":"Add images",className:"h-9 w-9 shrink-0 rounded-[14px] text-muted-foreground hover:text-foreground",children:e.jsx(Ft,{className:"h-4 w-4"})}),e.jsx("span",{className:"mx-0.5 h-5 w-px bg-border/60","aria-hidden":!0}),e.jsxs(Se,{value:S,onValueChange:w,children:[e.jsxs(Ee,{className:L(D,"chat-composer__icon-trigger",Q?te:ge),title:`Agent: ${ee}`,"aria-label":`Agent: ${ee}`,children:[e.jsx(Vt,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"chat-composer__footer-label truncate",children:ee})]}),e.jsx(_e,{children:ks()})]}),e.jsxs(Se,{value:C,onValueChange:ye=>h(ye),children:[e.jsxs(Ee,{className:L(D,"chat-composer__icon-trigger",Fe?te:ge),title:`Mode: ${P}`,"aria-label":`Mode: ${P}`,children:[e.jsx(Un,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"chat-composer__footer-label truncate",children:P})]}),e.jsx(_e,{children:ys()})]}),e.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[e.jsxs(Se,{value:z,onValueChange:A,children:[e.jsx(Ee,{"aria-label":`Priority: ${z}`,title:`Priority: ${z}`,className:L("h-9 w-9 justify-center gap-0 rounded-[14px] p-0 text-xs shadow-none [&>svg:last-child]:hidden",z==="normal"?"border-transparent bg-transparent text-muted-foreground hover:bg-background/40":"border-border/70 bg-background/55",z==="critical"&&"text-destructive",z==="high"&&"text-amber-600 dark:text-amber-400",z==="low"&&"text-muted-foreground"),children:e.jsx(pn,{className:L("h-4 w-4",z==="critical"&&"fill-destructive/20")})}),e.jsxs(_e,{children:[e.jsx(pe,{value:"low",children:"Low"}),e.jsx(pe,{value:"normal",children:"Normal"}),e.jsx(pe,{value:"high",children:"High"}),e.jsx(pe,{value:"critical",children:"Critical"})]})]}),l&&e.jsxs($,{type:"button",variant:"ghost",size:"sm",onClick:l,"aria-label":g,className:"chat-composer__cancel h-9 rounded-[14px] px-4 text-xs text-muted-foreground",children:[e.jsx(Ue,{className:"chat-composer__cancel-icon h-4 w-4 shrink-0"}),e.jsx("span",{className:"chat-composer__footer-label",children:g})]}),e.jsxs($,{type:"submit",size:"icon",disabled:!we||J,className:"h-10 w-10 rounded-[16px] shadow-[0_8px_30px_-8px_hsl(var(--primary)/0.6)]",children:[J?e.jsx(je,{className:"h-4 w-4 animate-spin"}):e.jsx(ea,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:J?"Creating chat":f})]})]})]})]}),e.jsx("div",{className:"chat-composer__location flex flex-wrap items-center gap-2 px-1",children:(()=>{const ye="border-border/40 bg-muted/40 text-foreground/80 hover:bg-muted/60 hover:text-foreground";return e.jsxs(e.Fragment,{children:[e.jsx(xt,{value:I,onChange:_,assignTo:R,nodes:t,assignableNodes:O,layout:"composer",chipClassName:D,chipActiveClassName:ye,chipInactiveClassName:ye,triggerClassName:"chat-composer__icon-trigger",labelClassName:"chat-composer__location-label"}),e.jsx(Ns,{value:K,onChange:M,project:I,assignTo:R,nodes:t,assignableNodes:O,layout:"composer",chipClassName:D,chipActiveClassName:ye,chipInactiveClassName:ye,triggerClassName:"chat-composer__icon-trigger",labelClassName:"chat-composer__location-label"})]})})()})]})})(),(T||W)&&e.jsxs("div",{className:"space-y-3 rounded-[20px] border border-border/60 bg-background/45 p-4",children:[T,W&&e.jsx("div",{className:"text-xs text-destructive",children:W}),!W&&e.jsx("div",{className:"text-xs text-muted-foreground",children:"Ctrl/Cmd+Enter starts the chat. Enter adds a new line. Paste screenshots directly into the prompt box or use the Images button."})]})]}):e.jsxs("form",{onSubmit:Ne,className:L("space-y-5",u),children:[e.jsx("input",{ref:ce,type:"file",accept:"image/*",multiple:!0,onChange:Z,className:"hidden"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Te,{htmlFor:"task-description",className:"text-sm font-medium",children:"Opening prompt"}),e.jsx("textarea",{id:"task-description",value:y,onChange:D=>b(D.target.value),onKeyDown:p,onPaste:Y,placeholder:"Describe what the agent should do. This becomes the first message in the chat.",rows:6,autoFocus:N,className:"flex min-h-[144px] w-full resize-none rounded-[22px] border border-border/70 bg-background/70 px-4 py-3 text-sm leading-6 ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs($,{type:"button",variant:"outline",onClick:V,className:"rounded-[16px]",children:[e.jsx(Ft,{className:"h-4 w-4"}),"Add images"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Ctrl/Cmd+Enter starts the chat. Enter adds a new line. Upload or paste screenshots and reference images with the opening prompt."})]}),T,W&&e.jsx("p",{className:"text-xs text-destructive",children:W})]}),e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1fr)_220px_220px]",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Te,{htmlFor:"task-title",className:"text-sm font-medium",children:"Chat title"}),e.jsx(Re,{id:"task-title",type:"text",value:c,onChange:D=>x(D.target.value),placeholder:"Optional. Leave blank to derive it from the prompt.",className:"h-11 rounded-[18px] border-border/70 bg-background/70"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:re?`Will appear as: ${re}`:"A title will be generated from the first line of the prompt."})]}),ke,k]}),ne,me,e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[X,U]}),e.jsxs("div",{className:L("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",j),children:[l&&e.jsx($,{type:"button",variant:"ghost",onClick:l,className:"rounded-[16px]",children:g}),e.jsx($,{type:"submit",disabled:!we||J,className:"rounded-[16px] px-5",children:J?"Creating...":f})]})]})}function Mo({nodes:t,currentNodeRole:a,currentNodeId:r,leaderNodeId:o,onCreated:n,onCancel:l,defaultMode:u="chat",mode:j,onModeChange:f,layout:g="default",className:N,footerClassName:d,autoFocus:c=!1}){const[x,y]=s.useState(u),b=j!==void 0,S=b?j:x,w=C=>{b||y(C),f==null||f(C)};return e.jsxs("div",{className:L("space-y-4",N),children:[!b&&e.jsxs("div",{className:"flex items-center gap-2 rounded-[20px] border border-border/60 bg-background/45 p-1",children:[e.jsxs($,{type:"button",variant:S==="chat"?"default":"ghost",onClick:()=>w("chat"),className:"flex-1 rounded-[16px]",children:[e.jsx(or,{className:"h-4 w-4"}),"New chat"]}),e.jsxs($,{type:"button",variant:S==="native"?"default":"ghost",onClick:()=>w("native"),className:"flex-1 rounded-[16px]",children:[e.jsx(Wt,{className:"h-4 w-4"}),"Load session"]})]}),S==="chat"?e.jsx(Do,{nodes:t,currentNodeRole:a,currentNodeId:r,leaderNodeId:o,onCreated:n,onCancel:l,footerClassName:d,submitLabel:g==="composer"?"Start chat":"Create chat",cancelLabel:"Cancel",autoFocus:c,layout:g}):e.jsx(So,{nodes:t,currentNodeRole:a,currentNodeId:r,leaderNodeId:o,onCreated:n,onCancel:l,footerClassName:d,autoFocus:c})]})}const Ge="72f988bf-86f1-41af-91ab-2d7cd011db47",ca=`${Ge} (MSIT)`;function Ao({open:t,onOpenChange:a,onShare:r,onStopShare:o,sharing:n,stopping:l=!1,shareResult:u}){return e.jsx(Fs,{open:t,onOpenChange:a,children:e.jsxs(As,{className:"max-w-md rounded-[22px] p-5",children:[e.jsx(Ls,{className:"sr-only",children:"Share conversation"}),e.jsx(Lo,{onOpenChange:a,onShare:r,onStopShare:o,sharing:n,stopping:l,shareResult:u})]})})}function Lo({onOpenChange:t,onShare:a,onStopShare:r,sharing:o,stopping:n=!1,shareResult:l}){const[u,j]=s.useState((l==null?void 0:l.tenant)??Ge),[f,g]=s.useState((l==null?void 0:l.scope)??"chat"),N=(l==null?void 0:l.url)??null,d=o||n;return s.useEffect(()=>{j((l==null?void 0:l.tenant)??Ge),g((l==null?void 0:l.scope)??"chat")},[l==null?void 0:l.shareId,l==null?void 0:l.tenant,l==null?void 0:l.scope]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h2",{className:"text-base font-semibold leading-none tracking-tight",children:"Share conversation"}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:"Create a tenant-gated link for this task."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(Po,{value:u,onChange:j,disabled:d}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-xs font-medium text-foreground",children:"Access"}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(ws,{active:f==="chat",title:"Chat only",description:"Conversation transcript and opening prompt.",onClick:()=>g("chat")}),e.jsx(ws,{active:f==="filesPreview",title:"Chat, files and preview",description:"Transcript plus task output files and HTML preview.",onClick:()=>g("filesPreview")})]})]}),N&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-xs font-medium text-foreground",children:"Shared link"}),e.jsxs("div",{className:"flex items-center gap-2 rounded-[16px] border border-border/70 bg-muted/30 px-3 py-2",children:[e.jsx("input",{readOnly:!0,value:N,className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-foreground outline-none","aria-label":"Shared link"}),e.jsx($,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 rounded-[12px] text-muted-foreground",onClick:()=>void We(N,"Shared link copied"),"aria-label":"Copy shared link",title:"Copy shared link",children:e.jsx($s,{className:"h-3.5 w-3.5"})})]})]})]}),e.jsxs("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[e.jsx($,{variant:"outline",onClick:()=>t(!1),disabled:d,className:"h-8 text-xs",children:l?"Done":"Cancel"}),l&&r&&e.jsxs($,{variant:"outline",onClick:()=>void r(),disabled:d,className:"h-8 border-destructive/30 text-xs text-destructive hover:bg-destructive/10 hover:text-destructive",children:[n&&e.jsx(je,{className:"h-3.5 w-3.5 animate-spin"}),"Stop share"]}),e.jsxs($,{onClick:()=>void a({tenant:u,scope:f}),disabled:d,className:"h-8 text-xs",children:[o&&e.jsx(je,{className:"h-3.5 w-3.5 animate-spin"}),l?"Update link":"Share link"]})]})]})}function Po({value:t,onChange:a,disabled:r}){const[o,n]=s.useState(!1),[l,u]=s.useState(!1),[j,f]=s.useState(t),g=s.useRef(null);s.useEffect(()=>{f(t)},[t]),s.useEffect(()=>{if(!o)return;const d=x=>{var b;const y=x.target;y instanceof Node&&((b=g.current)!=null&&b.contains(y)||(n(!1),u(!1)))},c=x=>{x.key==="Escape"&&(n(!1),u(!1))};return document.addEventListener("mousedown",d),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",c)}},[o]);const N=d=>{const c=d.trim();c&&(a(c),f(c),u(!1),n(!1))};return e.jsxs("div",{className:"space-y-2 text-xs",ref:g,children:[e.jsx("div",{className:"font-medium text-foreground",children:"Tenant"}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>!r&&n(d=>!d),disabled:r,className:"flex h-9 w-full items-center justify-between gap-2 rounded-[15px] border border-border/70 bg-background/70 px-3 text-left text-xs text-foreground shadow-sm outline-none transition-colors hover:bg-background disabled:opacity-50",children:[e.jsx("span",{className:"min-w-0 truncate font-mono",children:Ro(t)}),e.jsx(st,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})]}),o&&e.jsxs("div",{className:"absolute left-0 right-0 z-50 mt-2 overflow-hidden rounded-[18px] border border-border/60 bg-background/95 text-xs shadow-lg backdrop-blur",children:[e.jsxs("button",{type:"button",onClick:()=>N(Ge),className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left hover:bg-background/60",children:[e.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:ca}),t===Ge&&e.jsx(qe,{className:"h-3.5 w-3.5 shrink-0 text-primary"})]}),e.jsx("div",{className:"border-t border-border/60 bg-background/40 px-2.5 py-1.5",children:l?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{value:j,onChange:d=>f(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),N(j))},autoFocus:!0,placeholder:"Tenant ID",className:"h-7 min-w-0 flex-1 rounded-[11px] border border-border/60 bg-background/70 px-2 font-mono text-[11px] outline-none focus:ring-2 focus:ring-ring"}),e.jsx("button",{type:"button",onClick:()=>N(j),className:"flex h-7 w-7 items-center justify-center rounded-[11px] hover:bg-background/60",children:e.jsx(qe,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:()=>{f(t),u(!1)},className:"flex h-7 w-7 items-center justify-center rounded-[11px] text-muted-foreground hover:bg-background/60 hover:text-foreground",children:e.jsx(Ue,{className:"h-3.5 w-3.5"})})]}):e.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex h-7 w-full items-center justify-between rounded-[11px] px-1.5 text-[11px] text-muted-foreground hover:bg-background/60 hover:text-foreground",children:[e.jsx("span",{children:"Manual tenant ID"}),e.jsx(at,{className:"h-3 w-3"})]})})]})]})]})}function Ro(t){return t===Ge?ca:t}function ws({active:t,title:a,description:r,onClick:o}){return e.jsxs("button",{type:"button",onClick:o,className:t?"rounded-[15px] border border-primary/45 bg-primary/10 px-3 py-2 text-left shadow-sm":"rounded-[15px] border border-border/70 bg-background px-3 py-2 text-left shadow-sm hover:bg-muted/50",children:[e.jsx("div",{className:"text-xs font-medium text-foreground",children:a}),e.jsx("div",{className:"mt-1 text-[11px] leading-4 text-muted-foreground",children:r})]})}const Fo=s.lazy(async()=>({default:(await Ht(()=>import("./FilesTab-BWK1YZk0.js"),__vite__mapDeps([0,1,2,3,4]))).FilesTab})),$o=s.lazy(async()=>({default:(await Ht(()=>import("./PreviewTab-CgGqqXSW.js"),__vite__mapDeps([5,1,2,6]))).PreviewTab})),Io=s.lazy(async()=>({default:(await Ht(()=>import("./DiffTab-Dkqx4lg8.js"),__vite__mapDeps([7,1,2,3,4,8,6]))).DiffTab}));function Oo({onToggleTasks:t,desktopTasksOpen:a,mobileTasksPanelOpen:r,operationsOpen:o,onToggleOperations:n,cluster:l,sseConnected:u,activeTab:j,setActiveTab:f,creatingTask:g,createMode:N,activeTask:d,assignedNode:c,taskLoading:x,taskError:y,displayEvents:b,initialPromptAlreadyInLogs:S,initialPrompt:w,supportsFollowUp:C,taskUnavailable:h,chatDisabled:I,chatDisabledReason:_,questionBypassEnabled:K,isRunning:M,isStarting:z,hasPendingFollowUp:A,canCancel:O,canRetry:de,onRetry:R,onCancel:H,onShareTask:J,onStopShareTask:F,onStartCreateTask:oe,onCancelCreateTask:ie,onCreateTask:B,onSendMessage:W,onQuestionBypassChange:ce,onSubmitQuestionResponse:V,messagesEndRef:Z}){const[Y,ae]=s.useState(!1),[le,m]=s.useState(!1),[ee,P]=s.useState(!1),[Ne,re]=s.useState(!1),[we,p]=s.useState(!1),[T,U]=s.useState({}),[ke,k]=s.useState(new Set),[X,ne]=s.useState(new Set),me=s.useRef(0),D=s.useRef(!1),te=s.useCallback(Ce=>{const be=Ce.currentTarget,he=me.current;if(me.current=be.scrollTop,D.current)return;if(be.scrollHeight-be.scrollTop-be.clientHeight<30){ae(!1),D.current=!0,setTimeout(()=>{D.current=!1},300);return}be.scrollTop<he&&he-be.scrollTop>10&&ae(!0),be.scrollTop<=0&&ae(!0)},[]),ge=(d==null?void 0:d.effectiveProjectPath)??(d==null?void 0:d.project)??"default workspace",Q=d?(c==null?void 0:c.name)??Is(d.assignedTo,l==null?void 0:l.nodes,d.assignedNodeName):"unassigned",Fe=d!=null&&d.assignedTo?e.jsxs(e.Fragment,{children:["Connecting session on node ",e.jsx("span",{className:"font-medium text-foreground",children:Q}),"..."]}):"Connecting session to an available node...",ye=d?[{label:"Working dir",value:ge,mono:!0},...d.branch?[{label:"Branch",value:d.branch,mono:!0}]:[],{label:"Agent",value:d.agent,mono:!0},{label:"Node",value:Q}]:[],rt=!!(w&&!S),Ye=rt||b.length>0,nt=M&&Ye,Xe=(z||A||M)&&!nt,Qe=(d==null?void 0:d.conversationKind)==="nativeSession",$e=d&&!ke.has(d.id)?T[d.id]??d.activeShare??null:null;return g?e.jsx(Bo,{onToggleTasks:t,desktopTasksOpen:a,mobileTasksPanelOpen:r,operationsOpen:o,onToggleOperations:n,cluster:l,sseConnected:u,defaultMode:N,onCancel:ie,onCreated:B}):!d&&x?e.jsxs("div",{className:"dashboard-panel animate-panel-settle flex h-full min-h-0 flex-col overflow-hidden rounded-[28px]",children:[e.jsx("div",{className:"shrink-0 border-b border-border/55 bg-card/28 px-3 py-3 sm:px-5",children:e.jsx(zt,{onToggleTasks:t,desktopTasksOpen:a,mobileTasksPanelOpen:r,operationsOpen:o,onToggleOperations:n,cluster:l,sseConnected:u})}),e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center overflow-y-auto px-6 py-10 sm:px-8",children:e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-[22px] border border-primary/20 bg-primary/10 text-primary shadow-sm",children:e.jsx(je,{className:"h-7 w-7 animate-spin"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Loading conversation"}),e.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-[11px] text-muted-foreground",children:[e.jsx(je,{className:"h-4 w-4 animate-spin"}),"Fetching the selected chat thread..."]})]})]})})]}):d?e.jsxs(Os,{value:j,onValueChange:f,className:"dashboard-panel animate-panel-settle flex h-full min-h-0 flex-col overflow-hidden rounded-[28px]",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/55 bg-card/28 px-3 py-3 sm:px-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ua,{desktopTasksOpen:a,mobileTasksPanelOpen:r,onToggleTasks:t}),e.jsx("h2",{className:"min-w-0 truncate text-sm font-semibold tracking-tight text-foreground sm:text-lg",title:d.title,children:d.title}),Qe&&e.jsx(Ae,{variant:"outline",className:"shrink-0 rounded-[11px] border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300",children:"Native session"}),e.jsx(Bs,{status:d.status}),e.jsx(ir,{priority:d.priority}),e.jsx($,{variant:"outline",size:"icon",onClick:n,title:o?"Hide cluster":"Show cluster","aria-label":o?"Hide cluster":"Show cluster",className:"ml-auto h-7 w-7 shrink-0 rounded-[12px] border-border/70 bg-background/68",children:o?e.jsx(Jt,{className:"h-4 w-4"}):e.jsx(Zs,{className:"h-4 w-4"})})]}),y&&e.jsx("div",{className:"mt-2 w-fit rounded-[12px] border border-destructive/25 bg-destructive/10 px-2 py-1 text-[11px] text-destructive",children:y}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[e.jsxs(zs,{className:"h-auto max-w-full overflow-x-auto rounded-[16px] bg-muted/70 p-0.5",children:[e.jsx(Be,{value:"transcript",className:"rounded-[12px] px-2 py-0.5 text-[11px] sm:px-2.5",children:"Transcript"}),e.jsx(Be,{value:"files",className:"rounded-[12px] px-2 py-0.5 text-[11px] sm:px-2.5",children:"Files"}),e.jsx(Be,{value:"preview",className:"rounded-[12px] px-2 py-0.5 text-[11px] sm:px-2.5",children:"Preview"}),e.jsx(Be,{value:"diff",className:"rounded-[12px] px-2 py-0.5 text-[11px] sm:px-2.5",children:"Diff"})]}),M&&e.jsx(Ae,{variant:"outline",className:"hidden rounded-[11px] border-amber-500/30 bg-amber-500/10 text-amber-700 sm:inline-flex dark:text-amber-300",children:"Working"}),h&&e.jsx(Ae,{variant:"outline",className:"hidden rounded-[11px] border-destructive/25 bg-destructive/10 text-destructive sm:inline-flex",children:"Unavailable"}),e.jsxs("div",{className:"ml-auto flex items-center gap-2 text-[10px] text-muted-foreground",children:[e.jsxs("span",{className:"hidden sm:inline",children:["updated ",dr(d.updatedAt)]}),e.jsx("span",{className:"font-mono",children:d.id.slice(0,8)}),de&&e.jsxs($,{variant:"outline",size:"sm",onClick:R,className:"h-7 shrink-0 rounded-[12px] px-2 text-[11px]",children:[e.jsx(Fn,{className:"h-3.5 w-3.5"}),"Retry"]}),e.jsxs($,{type:"button",variant:"outline",size:"sm",disabled:h,title:h?"Unavailable tasks cannot be shared.":"Share conversation",className:"h-7 shrink-0 rounded-[12px] border-primary/30 bg-primary/10 px-2 text-[11px] text-primary hover:bg-primary/15 hover:text-primary disabled:border-border/60 disabled:bg-muted/40 disabled:text-muted-foreground",onClick:()=>P(!0),children:[e.jsx(Bn,{className:"h-3.5 w-3.5"}),"Share"]})]})]})]}),e.jsx(ze,{value:"transcript",className:"mt-0 min-h-0 flex-1",children:e.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[e.jsx("div",{className:"min-h-0 flex-1 touch-pan-y overflow-x-hidden overflow-y-auto overscroll-x-none bg-gradient-to-b from-background/15 via-transparent to-background/35 px-3 py-5 sm:px-5",onScroll:te,children:e.jsxs("div",{className:"mx-auto flex max-w-[72rem] flex-col gap-5",children:[rt&&w&&e.jsx(gs,{event:w,questionBypassEnabled:K,onQuestionBypassChange:ce,onSubmitQuestionResponse:V,questionResponseDisabled:!C||I}),b.map((Ce,be)=>e.jsx(gs,{event:Ce,questionBypassEnabled:K,onQuestionBypassChange:ce,onSubmitQuestionResponse:V,questionResponseDisabled:!C||I},en("transcript",Ce,be))),!Ye&&!Xe&&e.jsxs("div",{className:"rounded-[28px] border border-dashed border-border/70 bg-background/35 px-5 py-8 text-center",children:[e.jsx("div",{className:"text-[11px] font-medium text-foreground",children:"Transcript is warming up"}),e.jsx("div",{className:"mt-2 text-[11px] leading-6 text-muted-foreground",children:x?"Fetching task output...":Qe?"This native session is attached. Transcript starts after the next message you send from Meshy.":"The opening prompt has been stored, but the agent has not emitted conversation output yet."})]}),(!C&&d.result||d.error)&&e.jsxs("div",{className:"space-y-3",children:[!C&&d.result&&e.jsxs("div",{className:"rounded-[26px] border border-border/70 bg-card/80 px-3 py-3",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:"Stored result"}),e.jsx("pre",{className:"mt-3 overflow-x-auto whitespace-pre-wrap text-[11px] leading-5 text-muted-foreground",children:JSON.stringify(d.result,null,2)})]}),d.error&&!X.has(d.id)&&e.jsxs("div",{className:"rounded-[26px] border border-destructive/20 bg-destructive/10 px-3 py-3 text-destructive",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.22em]",children:"Stored error"}),e.jsx("button",{onClick:()=>ne(Ce=>new Set(Ce).add(d.id)),className:"rounded p-0.5 hover:bg-destructive/20","aria-label":"Dismiss error",children:e.jsx(Ue,{className:"h-3.5 w-3.5"})})]}),e.jsx("pre",{className:"mt-3 overflow-x-auto whitespace-pre-wrap text-[11px] leading-5",children:d.error})]})]}),Xe&&e.jsx(Cs,{children:Fe}),nt&&e.jsx(Cs,{children:"The agent is still working on this conversation."}),e.jsx("div",{ref:Z})]})}),C?Y?e.jsx($,{size:"icon",onClick:()=>ae(!1),className:"absolute bottom-4 right-4 z-10 h-12 w-12 rounded-[18px] shadow-lg",children:e.jsx(at,{className:"h-4 w-4"})}):e.jsx("div",{className:"shrink-0",children:e.jsx("div",{className:"mx-auto w-full max-w-[72rem]",children:e.jsx(oo,{onSend:W,disabled:I,disabledReason:_,contextItems:ye,placeholder:I?_:"Continue the conversation...",running:M||A,onStop:O?()=>m(!0):void 0})})}):e.jsx("div",{className:"shrink-0 border-t border-border/60 px-3 py-3 text-[11px] text-muted-foreground sm:px-5",children:"This task does not expose follow-up chat messages. Use Files, Preview, or Diff to inspect the result."})]})}),e.jsx(ze,{value:"files",className:"mt-0 min-h-0 flex-1 overflow-hidden",children:e.jsx(s.Suspense,{fallback:e.jsx(kt,{label:"Loading files..."}),children:e.jsx(Fo,{taskId:d.id})})}),e.jsx(ze,{value:"preview",className:"mt-0 min-h-0 flex-1 overflow-hidden",children:e.jsx(s.Suspense,{fallback:e.jsx(kt,{label:"Loading preview..."}),children:e.jsx($o,{taskId:d.id})})}),e.jsx(ze,{value:"diff",className:"mt-0 min-h-0 flex-1 overflow-hidden",children:e.jsx(s.Suspense,{fallback:e.jsx(kt,{label:"Loading diff..."}),children:e.jsx(Io,{taskId:d.id})})}),e.jsx(Ct,{open:le,onOpenChange:m,children:e.jsxs(St,{children:[e.jsxs(Et,{children:[e.jsx(_t,{children:"Stop this task?"}),e.jsx(Tt,{children:"The task will stop and move to a cancelled state."})]}),e.jsxs(Dt,{children:[e.jsx(Mt,{children:"Keep running"}),e.jsx(At,{onClick:H,children:"Stop task"})]})]})}),e.jsx(Ao,{open:ee,onOpenChange:P,sharing:Ne,stopping:we,shareResult:$e,onShare:async Ce=>{if(!d)return null;re(!0);try{const be=await J(Ce);return be!=null&&be.url&&(U(he=>({...he,[d.id]:be})),k(he=>{const Ve=new Set(he);return Ve.delete(d.id),Ve})),be}finally{re(!1)}},onStopShare:async()=>{if(!d)return!1;p(!0);try{const Ce=await F();return Ce!==!1&&(U(be=>{const he={...be};return delete he[d.id],he}),k(be=>new Set(be).add(d.id))),Ce}finally{p(!1)}}})]}):e.jsxs("div",{className:"dashboard-panel animate-panel-settle flex h-full min-h-0 flex-col overflow-hidden rounded-[28px]",children:[e.jsx("div",{className:"shrink-0 border-b border-border/55 bg-card/28 px-3 py-3 sm:px-5",children:e.jsx(zt,{onToggleTasks:t,desktopTasksOpen:a,mobileTasksPanelOpen:r,operationsOpen:o,onToggleOperations:n,cluster:l,sseConnected:u})}),e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center overflow-y-auto px-6 py-10 sm:px-8",children:e.jsxs("div",{className:"w-full max-w-2xl text-center",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-[22px] border border-primary/20 bg-primary/10 text-primary shadow-sm",children:e.jsx(Vt,{className:"h-7 w-7"})}),e.jsx("h2",{className:"mt-5 text-xl font-semibold tracking-tight text-foreground sm:text-3xl",children:"No chat selected"}),e.jsx("p",{className:"mx-auto mt-3 max-w-xl text-[11px] leading-6 text-muted-foreground",children:"Open a task from the left sidebar to continue the conversation, or start a new task or load a native session."}),e.jsxs($,{onClick:oe,className:"mt-6 rounded-[18px] px-5",children:[e.jsx(Gt,{className:"h-4 w-4"}),"Start or load chat"]}),y&&e.jsx("div",{className:"mx-auto mt-4 max-w-lg rounded-[20px] border border-destructive/20 bg-destructive/10 px-3 py-2 text-[11px] text-destructive",children:y})]})})]})}function Cs({children:t}){return e.jsxs("div",{className:"flex items-center gap-1.5 rounded-[18px] border border-border/60 bg-background/55 px-3 py-2 text-[11px] text-muted-foreground shadow-sm",children:[e.jsx(je,{className:"h-4 w-4 shrink-0 animate-spin"}),e.jsx("div",{className:"min-w-0 leading-5",children:t})]})}function Bo({onToggleTasks:t,desktopTasksOpen:a,mobileTasksPanelOpen:r,operationsOpen:o,onToggleOperations:n,cluster:l,sseConnected:u,defaultMode:j,onCancel:f,onCreated:g}){var x,y,b;const[N,d]=s.useState(j??"chat");s.useEffect(()=>{j&&d(j)},[j]);const c=e.jsx("div",{className:"flex items-center gap-1 rounded-[18px] border border-border/60 bg-background/65 p-0.5 text-[11px] font-medium shadow-sm",children:[{value:"chat",label:"New chat",icon:Gt},{value:"native",label:"Load session",icon:Wt}].map(S=>{const w=S.icon,C=S.value===N;return e.jsxs("button",{type:"button",onClick:()=>d(S.value),"aria-pressed":C,className:L("flex items-center gap-1.5 rounded-[14px] px-2 py-1 transition-all duration-200",C?"bg-primary text-primary-foreground shadow-[0_8px_24px_-12px_hsl(var(--primary)/0.7)]":"text-muted-foreground hover:bg-background/80 hover:text-foreground"),children:[e.jsx(w,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:S.label})]},S.value)})});return e.jsxs("div",{className:"dashboard-panel animate-panel-settle flex h-full min-h-0 flex-col overflow-hidden rounded-[28px]",children:[e.jsx("div",{className:"shrink-0 border-b border-border/55 bg-card/28 px-3 py-3 sm:px-5",children:e.jsx(zt,{onToggleTasks:t,desktopTasksOpen:a,mobileTasksPanelOpen:r,operationsOpen:o,onToggleOperations:n,cluster:l,sseConnected:u,centerSlot:c})}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center overflow-y-auto px-6 py-10 sm:px-8",children:e.jsx("div",{className:"w-full max-w-2xl",children:e.jsx(Mo,{nodes:(l==null?void 0:l.nodes)??[],currentNodeRole:(x=l==null?void 0:l.self)==null?void 0:x.role,currentNodeId:((y=l==null?void 0:l.self)==null?void 0:y.id)??null,leaderNodeId:((b=l==null?void 0:l.leader)==null?void 0:b.id)??null,mode:N,onModeChange:d,onCreated:g,onCancel:f,autoFocus:!0,layout:"composer"})})})]})}function zt({onToggleTasks:t,desktopTasksOpen:a,mobileTasksPanelOpen:r,operationsOpen:o,onToggleOperations:n,centerSlot:l}){return e.jsxs("div",{className:"relative flex w-full items-center justify-between gap-1.5",children:[e.jsx("div",{className:"flex min-w-0 items-center gap-1.5",children:e.jsx(ua,{desktopTasksOpen:a,mobileTasksPanelOpen:r,onToggleTasks:t})}),l&&e.jsx("div",{className:"pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:e.jsx("div",{className:"pointer-events-auto",children:l})}),e.jsx($,{variant:"outline",size:"icon",onClick:n,title:o?"Hide cluster":"Show cluster","aria-label":o?"Hide cluster":"Show cluster",className:"h-7 w-7 shrink-0 rounded-[12px] border-border/70 bg-background/68",children:o?e.jsx(Jt,{className:"h-4 w-4"}):e.jsx(Zs,{className:"h-4 w-4"})})]})}function ua({desktopTasksOpen:t,mobileTasksPanelOpen:a,onToggleTasks:r}){var n,l;const o=(l=(n=globalThis.window)==null?void 0:n.matchMedia("(min-width: 1024px)"))!=null&&l.matches?t:a;return e.jsx($,{variant:"outline",size:"icon",onClick:r,title:o?"Hide tasks":"Show tasks","aria-label":o?"Hide tasks":"Show tasks",className:"h-7 w-7 shrink-0 rounded-[12px] border-border/70 bg-background/68",children:o?e.jsx(Qs,{className:"h-4 w-4"}):e.jsx(Tn,{className:"h-4 w-4"})})}function zo(t){return"result"in t}function Ss(t,a){var r;return a&&t.some(o=>o.id===a)?a:((r=t[0])==null?void 0:r.id)??""}function wt(t){return t&&(la(t.id)||t.workDir)||""}function Uo(t){return new Promise(a=>window.setTimeout(a,t))}function Vo(t){return!!t&&typeof t=="object"&&typeof t.command=="string"&&typeof t.stdout=="string"&&typeof t.stderr=="string"&&typeof t.durationMs=="number"}async function Ko(t){let a=t;for(let r=0;r<120;r++){if(a.status==="succeeded"){if(Vo(a.result))return a.result;throw new Error("Terminal command completed without output")}if(a.status==="failed")throw new Error(a.error||"Terminal command failed");await Uo(1e3),a=await Ps(a.id)}throw new Error("Timed out waiting for terminal command")}function Ho({nodes:t,defaultNodeId:a,onClose:r}){const[o,n]=s.useState(()=>Ss(t,a)),l=s.useMemo(()=>t.find(h=>h.id===o)??t[0]??null,[t,o]),[u,j]=s.useState(()=>wt(l)),[f,g]=s.useState(""),[N,d]=s.useState([]),[c,x]=s.useState(!1),y=s.useRef(null),b=s.useMemo(()=>t.find(h=>h.id===o)??t[0]??null,[t,o]),S=s.useRef((b==null?void 0:b.id)??"");s.useEffect(()=>{o&&t.some(h=>h.id===o)||n(Ss(t,a))},[a,t,o]),s.useEffect(()=>{const h=(b==null?void 0:b.id)??"";S.current!==h&&(S.current=h,j(wt(b)))},[b]),s.useEffect(()=>{var h;(h=y.current)==null||h.scrollTo({top:y.current.scrollHeight})},[N]);const w=s.useRef(null);async function C(h){if(h.preventDefault(),!b||!f.trim()||c)return;const I=f.trim(),_=b.name;x(!0),g("");try{const K=await ur(b.id,{command:I,...u.trim()?{cwd:u.trim()}:{}}),M=await Ko(K);d(z=>[...z,{id:`${Date.now()}-${Math.random().toString(16).slice(2)}`,nodeName:_,result:M}])}catch(K){d(M=>[...M,{id:`${Date.now()}-${Math.random().toString(16).slice(2)}`,nodeName:_,command:I,error:K instanceof Error?K.message:"Command failed"}])}finally{x(!1)}}return e.jsx("section",{className:"dashboard-panel animate-composer-settle shrink-0 overflow-hidden rounded-[24px]","aria-label":"Node terminal",children:e.jsxs("div",{className:"flex w-full flex-col overflow-hidden bg-card/72 text-card-foreground",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border/60 px-3 py-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-[11px] font-medium",children:[r?e.jsx("button",{type:"button",onClick:r,"aria-label":"Close terminal",title:"Close terminal",className:"flex h-6 w-6 items-center justify-center rounded-md text-primary transition-colors hover:bg-muted/65 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70",children:e.jsx(ms,{className:"h-3.5 w-3.5"})}):e.jsx(ms,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{children:"Terminal"})]}),e.jsxs("div",{className:"ml-auto flex min-w-0 flex-wrap items-center justify-end gap-2",children:[e.jsx("select",{value:(b==null?void 0:b.id)??"",onChange:h=>{n(h.target.value),j(wt(t.find(I=>I.id===h.target.value)??null))},disabled:c||t.length===0,"aria-label":"Terminal node",className:"h-7 max-w-[11rem] rounded-[10px] border border-border/70 bg-background/70 px-2 text-[11px] text-foreground outline-none transition-colors hover:bg-muted/65 disabled:opacity-50",children:t.map(h=>e.jsx("option",{value:h.id,className:"bg-background text-foreground",children:h.name},h.id))}),e.jsx(xt,{value:u,onChange:j,assignTo:(b==null?void 0:b.id)??"",nodes:t,assignableNodes:t,layout:"composer",chipClassName:"h-7 max-w-[18rem] rounded-[10px] border border-border/70 bg-background/70 px-2 text-[11px] text-foreground hover:bg-muted/65",chipActiveClassName:"font-mono",chipInactiveClassName:"text-muted-foreground",labelClassName:"text-[11px]",triggerClassName:"terminal-workdir-trigger"})]})]}),e.jsxs("div",{ref:y,className:"max-h-64 min-h-[8rem] overflow-y-auto bg-muted/22 px-3 py-2 font-mono text-[11px] leading-5 cursor-text",onClick:()=>{var h;return(h=w.current)==null?void 0:h.focus()},children:[N.length===0?e.jsx("div",{className:"text-muted-foreground mb-2",children:"Commands run once on the selected node and return stdout, stderr, and exit code."}):e.jsx("div",{className:"space-y-3 mb-2",children:N.map(h=>zo(h)?e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[e.jsxs("span",{className:"text-primary",children:[h.nodeName,"$"]}),e.jsx("span",{className:"break-all text-foreground",children:h.result.command}),e.jsxs("span",{className:L("inline-flex items-center gap-1",h.result.exitCode===0?"text-primary":"text-amber-600 dark:text-amber-300"),children:[h.result.exitCode===0?e.jsx(cr,{className:"h-3 w-3"}):e.jsx(Lt,{className:"h-3 w-3"}),h.result.timedOut?"timeout":`exit ${h.result.exitCode??"signal"}`]})]}),h.result.stdout&&e.jsx("pre",{className:"whitespace-pre-wrap break-words text-foreground",children:h.result.stdout}),h.result.stderr&&e.jsx("pre",{className:"whitespace-pre-wrap break-words text-destructive",children:h.result.stderr}),(h.result.stdoutTruncated||h.result.stderrTruncated)&&e.jsx("div",{className:"text-muted-foreground",children:"Output truncated."})]},h.id):e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[e.jsxs("span",{className:"text-primary",children:[h.nodeName,"$"]}),e.jsx("span",{className:"break-all text-foreground",children:h.command}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-destructive",children:[e.jsx(Lt,{className:"h-3 w-3"}),"error"]})]}),e.jsx("pre",{className:"whitespace-pre-wrap break-words text-destructive",children:h.error})]},h.id))}),e.jsxs("form",{onSubmit:C,className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"shrink-0 text-primary select-none",children:b?`${b.name}$`:"$"}),e.jsx("input",{ref:w,value:f,onChange:h=>g(h.target.value),disabled:!b||c,placeholder:b?"":"No online nodes available",className:"flex-1 min-w-0 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground font-mono text-[11px] caret-primary disabled:opacity-50",autoComplete:"off",spellCheck:!1}),e.jsx("button",{type:"submit","aria-label":"Run",title:"Run",disabled:!b||!f.trim()||c,className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-primary transition-colors hover:bg-muted/65 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70 disabled:pointer-events-none disabled:text-muted-foreground disabled:opacity-50",children:c?e.jsx(je,{className:"h-3 w-3 animate-spin"}):e.jsx(ln,{className:"h-3 w-3"})})]})]})]})})}function Es({cluster:t,systemInfo:a,nodeNameById:r,nodeBlockingTaskCounts:o,eventTypeFilter:n,onEventTypeFilterChange:l,eventTypeOptions:u,filteredEvents:j,sseConnected:f,clusterLoading:g,clusterError:N,promotePending:d,onPromote:c,onAddNode:x,leavePending:y,onLeaveCluster:b,onToggleNodeDevTunnel:S,devTunnelNodeId:w,onClose:C}){var R,H,J;const h=((R=t==null?void 0:t.self)==null?void 0:R.role)==="leader",I=((H=t==null?void 0:t.self)==null?void 0:H.role)==="follower"&&!(t!=null&&t.leader),_=(t==null?void 0:t.self)??null,M=xr((t==null?void 0:t.nodes)??[],_==null?void 0:_.id).filter(F=>F.id!==(_==null?void 0:_.id)),z=t!=null&&t.leader?t.nodes.find(F=>{var oe;return F.id===((oe=t.leader)==null?void 0:oe.id)})??null:null,A=t!=null&&t.leader?t.leader.dashboardOrigin??(z==null?void 0:z.dashboardOrigin)??(a&&t.leader.id===(a.nodeId??a.id)?a.dashboardOrigin:void 0)??t.leader.endpoint:null,O=(_==null?void 0:_.role)==="leader"&&M.length===0,de=(_==null?void 0:_.role)==="follower";return e.jsx("aside",{className:"dashboard-panel dashboard-panel-muted animate-panel-settle flex h-full min-h-0 flex-col overflow-hidden rounded-[28px]",children:e.jsxs(Os,{defaultValue:"overview",className:"flex h-full min-h-0 flex-col",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/55 bg-card/24 px-3 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-semibold tracking-tight",children:"Operations"}),e.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:"Node, cluster, and live events."})]}),e.jsx($,{variant:"ghost",size:"icon",onClick:C,className:"h-7 w-7 rounded-[12px]",children:e.jsx(Jt,{className:"h-4 w-4"})})]}),e.jsxs(zs,{className:"mt-2 grid h-auto w-full grid-cols-3 rounded-[16px] bg-muted/70 p-0.5",children:[e.jsx(Be,{value:"overview",className:"rounded-[12px] px-2 py-0.5 text-[11px]",children:"Overview"}),e.jsx(Be,{value:"nodes",className:"rounded-[12px] px-2 py-0.5 text-[11px]",children:"Nodes"}),e.jsx(Be,{value:"events",className:"rounded-[12px] px-2 py-0.5 text-[11px]",children:"Live events"})]})]}),e.jsx(ze,{value:"overview",className:"mt-0 min-h-0 flex-1",children:e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto px-3 py-3",children:e.jsxs("div",{className:"space-y-4",children:[_&&e.jsx(_s,{node:_,systemInfo:a,blockingTaskCount:o.get(_.id)??0,devTunnelNodeId:w,onToggleNodeDevTunnel:S,showActions:!1,defaultExpanded:!1}),e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[e.jsx("div",{className:"text-[11px] font-medium text-foreground",children:"Cluster snapshot"}),e.jsx(Ae,{variant:"outline",className:"rounded-[11px] border-border/70 bg-background/60",children:f?"Connected":"Reconnecting"})]}),g&&!t?e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[e.jsx(je,{className:"h-4 w-4 animate-spin"}),"Loading cluster state..."]}):N&&!t?e.jsx("div",{className:"rounded-[18px] border border-destructive/20 bg-destructive/10 px-2.5 py-2 text-[11px] text-destructive",children:N}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsx(He,{label:"Term",value:String((t==null?void 0:t.term)??0)}),e.jsx(He,{label:"Nodes",value:String((t==null?void 0:t.nodes.length)??0)}),e.jsx(He,{label:"Pending",value:String((t==null?void 0:t.taskSummary.pending)??0)}),e.jsx(He,{label:"Running",value:String((t==null?void 0:t.taskSummary.running)??0)}),e.jsx(He,{label:"Completed",value:String((t==null?void 0:t.taskSummary.completed)??0)}),e.jsx(He,{label:"Failed",value:String((t==null?void 0:t.taskSummary.failed)??0)})]}),e.jsxs("div",{className:"space-y-2 rounded-[18px] border border-border/60 bg-background/52 px-2.5 py-2.5 shadow-sm",children:[e.jsx(Pe,{label:"Leader",value:((J=t==null?void 0:t.leader)==null?void 0:J.name)??"None"}),e.jsx(Pe,{label:"Leader URL",value:A??"Unavailable",mono:!0,action:A?e.jsx(tt,{label:"Copy leader URL",onClick:()=>void We(A,"Leader URL copied")}):void 0}),e.jsx(Pe,{label:"Feed",value:f?"Receiving live updates":"Reconnecting to event stream"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:I&&e.jsxs($,{variant:"outline",size:"sm",onClick:c,disabled:d,className:"h-7 rounded-[12px] px-2.5 text-[11px]",children:[d&&e.jsx(je,{className:"h-3.5 w-3.5 animate-spin"}),"Promote self"]})})]})]})]})})}),e.jsx(ze,{value:"nodes",className:"mt-0 min-h-0 flex-1",children:e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto px-3 py-3",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[e.jsx("div",{className:"text-[11px] font-medium text-foreground",children:"This node"}),O?e.jsx($,{variant:"outline",size:"sm",onClick:x,className:"h-7 rounded-[12px] px-2.5 text-[11px]",children:"Join node"}):de?e.jsxs($,{variant:"outline",size:"sm",onClick:b,disabled:y,className:"h-7 rounded-[12px] px-2.5 text-[11px]",children:[y&&e.jsx(je,{className:"h-3.5 w-3.5 animate-spin"}),"Leave cluster"]}):null]}),_&&e.jsx(_s,{node:_,systemInfo:a,blockingTaskCount:o.get(_.id)??0,devTunnelNodeId:w,onToggleNodeDevTunnel:S,showActions:!0,defaultExpanded:!0})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"text-[11px] font-medium text-foreground",children:["Peer nodes (",M.length,")"]}),M.length>0?e.jsx("div",{className:"space-y-2",children:M.map(F=>e.jsx(qo,{node:F,isLeader:!!h,blockingTaskCount:o.get(F.id)??0,devTunnelNodeId:w,onToggleNodeDevTunnel:S},F.id))}):e.jsx("div",{className:"rounded-[20px] border border-dashed border-border/70 bg-background/35 px-3 py-3 text-[11px] text-muted-foreground",children:"No peer nodes are connected yet."})]})]})})}),e.jsx(ze,{value:"events",className:"mt-0 min-h-0 flex-1",children:e.jsxs("div",{className:"flex h-full min-h-0 flex-col px-3 py-3",children:[e.jsxs("div",{className:"mb-3 space-y-2",children:[e.jsx("div",{children:e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-medium text-foreground",children:[e.jsx(mr,{className:L("h-4 w-4",f?"text-emerald-500":"text-destructive")}),"Live events"]})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsxs(Se,{value:n,onValueChange:l,children:[e.jsx(Ee,{className:"h-7 min-w-[11rem] flex-1 rounded-[13px] border-border/70 bg-background/60 text-[11px] sm:max-w-[15rem]",children:e.jsx(Me,{placeholder:"Event type"})}),e.jsx(_e,{children:u.map(F=>e.jsx(pe,{value:F,className:"text-[11px]",children:F==="all"?"All event types":F},F))})]}),e.jsx(Ae,{variant:"outline",className:"rounded-[11px] border-border/70 bg-background/60",children:f?"Connected":"Reconnecting"})]})]}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(hr,{events:j,maxHeight:"100%",emptyTitle:n==="all"?"No live events yet":"No matching events",emptyDescription:n==="all"?"Cluster activity appears here as it happens.":`No "${n}" events are in the current stream.`,nodeNameById:r})})]})})]})})}function _s({node:t,systemInfo:a,blockingTaskCount:r,devTunnelNodeId:o,onToggleNodeDevTunnel:n,showActions:l=!0,defaultExpanded:u=!1}){const[j,f]=s.useState(u),g=(a==null?void 0:a.dashboardOrigin)??t.dashboardOrigin,N=t.devtunnelEndpoint??t.endpoint,d=g??t.endpoint,c=(a==null?void 0:a.workDir)??t.workDir,x=sa(t,a==null?void 0:a.transportType),y=Yt(t,a==null?void 0:a.transportType),b=y&&Je((a==null?void 0:a.transportType)??t.transportType)?!0:ta(t,a==null?void 0:a.transportType),S=r>0;return e.jsxs("section",{className:"rounded-[22px] border border-primary/20 bg-primary/8 shadow-[0_24px_80px_-60px_hsl(var(--primary)/0.9)]",children:[e.jsxs("button",{type:"button",onClick:()=>f(w=>!w),className:"w-full px-3 py-2 text-left",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[j?e.jsx(st,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(et,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx(Us,{status:t.status}),e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:"Current node"}),e.jsx("a",{href:d,target:"_blank",rel:"noreferrer",onClick:w=>w.stopPropagation(),className:"ml-auto shrink-0 text-muted-foreground transition-colors hover:text-primary",title:"Open Dashboard",children:e.jsx(Vs,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 pl-6",children:[e.jsx("span",{className:"text-[11px] font-semibold tracking-tight text-foreground",children:t.name}),e.jsx(Ks,{role:t.role}),e.jsx(Ae,{variant:"outline",className:"rounded-[11px] border-primary/30 bg-background/60 text-[10px] capitalize",children:t.status})]})]}),j&&e.jsxs("div",{className:"space-y-3 border-t border-primary/15 px-3 pb-3 pt-2.5",children:[e.jsxs("div",{className:"space-y-2 rounded-[16px] border border-primary/20 bg-background/72 px-2 py-2 shadow-sm",children:[e.jsx(Pe,{label:"Node ID",value:t.id,mono:!0}),g&&e.jsx(Pe,{label:"Dashboard",value:g,mono:!0,action:e.jsx(tt,{label:"Copy dashboard URL",onClick:()=>void We(g,"Dashboard URL copied")})}),e.jsx(Pe,{label:"Node URL",value:N,mono:!0,action:e.jsx(tt,{label:"Copy node URL",onClick:()=>void We(N,"Node URL copied")})}),c&&e.jsx(Pe,{label:"Workspace",value:c,mono:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[e.jsx(Pt,{label:"Transport",value:x}),a&&e.jsx(Pt,{label:"Uptime",value:pr(a.uptime),mono:!0})]}),e.jsx(Js,{capabilities:t.capabilities,action:l&&b?e.jsxs($,{variant:"outline",size:"sm",onClick:()=>n(t),disabled:o===t.id||S,className:"h-7 rounded-[12px] px-2.5 text-[11px]",title:S?"Finish assigned or running tasks before changing remote access":void 0,children:[o===t.id&&e.jsx(je,{className:"h-3.5 w-3.5 animate-spin"}),y?"Disable Remote Access":"Enable Remote Access"]}):void 0}),l&&b&&S&&e.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[r," active task",r===1?"":"s"," on this node."]})]})]})}function qo({node:t,isLeader:a,blockingTaskCount:r,devTunnelNodeId:o,onToggleNodeDevTunnel:n}){const[l,u]=s.useState(!1),j=t.dashboardOrigin,f=t.devtunnelEndpoint??t.endpoint,g=j??t.endpoint,N=sa(t),d=Yt(t),c=ta(t),x=r>0;return e.jsxs("div",{className:"rounded-[18px] border border-border/60 bg-background/50 shadow-sm",children:[e.jsxs("button",{type:"button",onClick:()=>u(y=>!y),className:"w-full px-3 py-2 text-left",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[l?e.jsx(st,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):e.jsx(et,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx(Us,{status:t.status}),e.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:"Peer node"}),e.jsx("a",{href:g,target:"_blank",rel:"noreferrer",onClick:y=>y.stopPropagation(),className:"ml-auto shrink-0 text-muted-foreground transition-colors hover:text-primary",title:"Open Dashboard",children:e.jsx(Vs,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-1.5 pl-5",children:[e.jsx("span",{className:"text-[11px] font-semibold text-foreground",children:t.name}),e.jsx(Ks,{role:t.role}),e.jsx(Ae,{variant:"outline",className:"rounded-[11px] border-border/70 bg-background/60 text-[10px] capitalize",children:t.status})]})]}),l&&e.jsxs("div",{className:"space-y-3 border-t border-border/50 px-3 pb-3 pt-2.5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Pe,{label:"Node ID",value:t.id,mono:!0}),j&&e.jsx(Pe,{label:"Dashboard",value:j,mono:!0,action:e.jsx(tt,{label:"Copy dashboard URL",onClick:()=>void We(j,"Dashboard URL copied")})}),e.jsx(Pe,{label:"Node URL",value:f,mono:!0,action:e.jsx(tt,{label:"Copy node URL",onClick:()=>void We(f,"Node URL copied")})}),t.workDir&&e.jsx(Pe,{label:"Workspace",value:t.workDir,mono:!0}),e.jsx(Pt,{label:"Transport",value:N})]}),e.jsx(Js,{capabilities:t.capabilities,action:a&&c?e.jsxs($,{variant:"outline",size:"sm",onClick:()=>n(t),disabled:o===t.id||x,className:"h-7 rounded-[12px] px-2.5 text-[11px]",title:x?"Finish assigned or running tasks before changing remote access":void 0,children:[o===t.id&&e.jsx(je,{className:"h-3.5 w-3.5 animate-spin"}),d?"Disable Remote Access":"Enable Remote Access"]}):void 0}),a&&c&&x&&e.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[r," active task",r===1?"":"s"," on this node."]})]})]})}function tt({label:t,onClick:a}){return e.jsx($,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 rounded-[12px] text-muted-foreground",onClick:a,"aria-label":t,title:t,children:e.jsx($s,{className:"h-3.5 w-3.5"})})}function Wo(t,a,r,o){var u;if(!t)return{taskUnavailable:!1,chatDisabled:!0,chatDisabledReason:"Select a task to continue the conversation."};const n=((u=a==null?void 0:a.self)==null?void 0:u.role)==="follower";return t.assignedTo!==null&&t.assignedNodeAvailable===!1?{taskUnavailable:!0,chatDisabled:!0,chatDisabledReason:`${t.assignedNodeName??"Assigned node"} is unavailable. Leave the cluster on that node or re-run the task elsewhere.`}:n?{taskUnavailable:!1,chatDisabled:!0,chatDisabledReason:"Follower nodes are read-only. Use the leader dashboard to manage chat, or leave the cluster first."}:r||o?{taskUnavailable:!1,chatDisabled:!0,chatDisabledReason:"Waiting for the current turn to finish..."}:ut.has(t.status)||t.status==="archived"?{taskUnavailable:!1,chatDisabled:!0,chatDisabledReason:ut.has(t.status)?"Task has not started yet...":"Archived tasks are read-only."}:{taskUnavailable:!1,chatDisabled:!1,chatDisabledReason:"Continue the conversation..."}}var mt="Checkbox",[Go]=jr(mt),[Jo,Qt]=Go(mt);function Yo(t){const{__scopeCheckbox:a,checked:r,children:o,defaultChecked:n,disabled:l,form:u,name:j,onCheckedChange:f,required:g,value:N="on",internal_do_not_use_render:d}=t,[c,x]=gr({prop:r,defaultProp:n??!1,onChange:f,caller:mt}),[y,b]=s.useState(null),[S,w]=s.useState(null),C=s.useRef(!1),h=y?!!u||!!y.closest("form"):!0,I={checked:c,disabled:l,setChecked:x,control:y,setControl:b,name:j,form:u,value:N,hasConsumerStoppedPropagationRef:C,required:g,defaultChecked:Oe(n)?!1:n,isFormControl:h,bubbleInput:S,setBubbleInput:w};return e.jsx(Jo,{scope:a,...I,children:Xo(d)?d(I):o})}var xa="CheckboxTrigger",ma=s.forwardRef(({__scopeCheckbox:t,onKeyDown:a,onClick:r,...o},n)=>{const{control:l,value:u,disabled:j,checked:f,required:g,setControl:N,setChecked:d,hasConsumerStoppedPropagationRef:c,isFormControl:x,bubbleInput:y}=Qt(xa,t),b=Hs(n,N),S=s.useRef(f);return s.useEffect(()=>{const w=l==null?void 0:l.form;if(w){const C=()=>d(S.current);return w.addEventListener("reset",C),()=>w.removeEventListener("reset",C)}},[l,d]),e.jsx(qt.button,{type:"button",role:"checkbox","aria-checked":Oe(f)?"mixed":f,"aria-required":g,"data-state":ba(f),"data-disabled":j?"":void 0,disabled:j,value:u,...o,ref:b,onKeyDown:hs(a,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:hs(r,w=>{d(C=>Oe(C)?!0:!C),y&&x&&(c.current=w.isPropagationStopped(),c.current||w.stopPropagation())})})});ma.displayName=xa;var Zt=s.forwardRef((t,a)=>{const{__scopeCheckbox:r,name:o,checked:n,defaultChecked:l,required:u,disabled:j,value:f,onCheckedChange:g,form:N,...d}=t;return e.jsx(Yo,{__scopeCheckbox:r,checked:n,defaultChecked:l,disabled:j,required:u,onCheckedChange:g,name:o,form:N,value:f,internal_do_not_use_render:({isFormControl:c})=>e.jsxs(e.Fragment,{children:[e.jsx(ma,{...d,ref:a,__scopeCheckbox:r}),c&&e.jsx(ga,{__scopeCheckbox:r})]})})});Zt.displayName=mt;var ha="CheckboxIndicator",pa=s.forwardRef((t,a)=>{const{__scopeCheckbox:r,forceMount:o,...n}=t,l=Qt(ha,r);return e.jsx(fr,{present:o||Oe(l.checked)||l.checked===!0,children:e.jsx(qt.span,{"data-state":ba(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:a,style:{pointerEvents:"none",...t.style}})})});pa.displayName=ha;var fa="CheckboxBubbleInput",ga=s.forwardRef(({__scopeCheckbox:t,...a},r)=>{const{control:o,hasConsumerStoppedPropagationRef:n,checked:l,defaultChecked:u,required:j,disabled:f,name:g,value:N,form:d,bubbleInput:c,setBubbleInput:x}=Qt(fa,t),y=Hs(r,x),b=br(l),S=vr(o);s.useEffect(()=>{const C=c;if(!C)return;const h=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(h,"checked").set,K=!n.current;if(b!==l&&_){const M=new Event("click",{bubbles:K});C.indeterminate=Oe(l),_.call(C,Oe(l)?!1:l),C.dispatchEvent(M)}},[c,b,l,n]);const w=s.useRef(Oe(l)?!1:l);return e.jsx(qt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??w.current,required:j,disabled:f,name:g,value:N,form:d,...a,tabIndex:-1,ref:y,style:{...a.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ga.displayName=fa;function Xo(t){return typeof t=="function"}function Oe(t){return t==="indeterminate"}function ba(t){return Oe(t)?"indeterminate":t?"checked":"unchecked"}const Ut=s.forwardRef(({className:t,...a},r)=>e.jsx(Zt,{ref:r,className:L("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...a,children:e.jsx(pa,{className:L("flex items-center justify-center text-current"),children:e.jsx(qe,{className:"h-3.5 w-3.5"})})}));Ut.displayName=Zt.displayName;function Ts({toolbarTasks:t,activeTaskId:a,tasksLoading:r,tasksError:o,isLeader:n,scope:l,agentFilter:u,nodeFilter:j,taskKindFilter:f,agentOptions:g,nodeOptions:N,nodeNameById:d,leaderNodeId:c,searchQuery:x,selectedTaskIds:y,allVisibleTasksSelected:b,someVisibleTasksSelected:S,canBatchArchive:w,onSearchChange:C,onScopeChange:h,onAgentFilterChange:I,onNodeFilterChange:_,onTaskKindFilterChange:K,onToggleTaskSelected:M,onToggleAllVisibleTasks:z,onBatchArchive:A,onBatchDelete:O,onCreateTask:de,onSelectTask:R,onClose:H}){const[J,F]=s.useState(!!x),[oe,ie]=s.useState(!1),[B,W]=s.useState(!1),ce=s.useRef(null),V=s.useRef(null),Z=s.useRef(null),Y=y.size,ae=l!=="active"||j!=="all"||u!=="all"||f!=="all",le=x.trim().length>0,[m,ee]=s.useState(new Set),[P,Ne]=s.useState(new Set),re=s.useMemo(()=>Nr(t,d,c),[t,d,c]),we=re.length===1,p=!we||ae||le,T=we&&(ae||le),U=s.useCallback(k=>{ee(X=>{const ne=new Set(X);return ne.has(k)?ne.delete(k):ne.add(k),ne})},[]),ke=s.useCallback(k=>{Ne(X=>{const ne=new Set(X);return ne.has(k)?ne.delete(k):ne.add(k),ne})},[]);return s.useEffect(()=>{x&&F(!0)},[x]),s.useEffect(()=>{var k;J&&((k=ce.current)==null||k.focus())},[J]),s.useEffect(()=>{if(!J)return;const k=ne=>{var D;const me=ne.target;me instanceof Node&&((D=V.current)!=null&&D.contains(me)||F(!1))},X=ne=>{ne.key==="Escape"&&F(!1)};return document.addEventListener("mousedown",k),document.addEventListener("keydown",X),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",X)}},[J]),s.useEffect(()=>{if(!B)return;const k=ne=>{var D;const me=ne.target;me instanceof Node&&((D=Z.current)!=null&&D.contains(me)||W(!1))},X=ne=>{ne.key==="Escape"&&W(!1)};return document.addEventListener("mousedown",k),document.addEventListener("keydown",X),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",X)}},[B]),e.jsxs("aside",{className:"dashboard-panel dashboard-panel-muted animate-panel-settle flex h-full min-h-0 flex-col overflow-hidden rounded-[28px]",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/55 bg-card/24 px-3 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[e.jsx("div",{className:"text-lg font-semibold tracking-tight text-foreground",children:"Tasks"}),e.jsx($,{variant:"ghost",size:"icon",onClick:H,className:"rounded-[12px]",children:e.jsx(Qs,{className:"h-4 w-4"})})]}),e.jsxs("div",{ref:V,className:"mt-4 flex items-center gap-1.5",children:[e.jsxs("div",{ref:Z,className:L("relative flex items-stretch transition-[flex] duration-200",J?"flex-[2]":"flex-1"),children:[e.jsxs($,{onClick:()=>{W(!1),de("chat")},className:"h-11 flex-1 justify-start rounded-l-[18px] rounded-r-none px-3 text-left shadow-[0_18px_48px_-30px_hsl(var(--primary)/0.95)]",children:[e.jsx(Gt,{className:"h-4 w-4"}),"New chat"]}),e.jsx($,{onClick:()=>W(k=>!k),"aria-label":"More chat options","aria-haspopup":"menu","aria-expanded":B,className:"h-11 w-9 rounded-l-none rounded-r-[18px] border-l border-primary-foreground/20 px-0 shadow-[0_18px_48px_-30px_hsl(var(--primary)/0.95)]",children:e.jsx(st,{className:L("h-3.5 w-3.5 transition-transform",B&&"rotate-180")})}),B&&e.jsx("div",{role:"menu",className:"absolute left-0 right-0 top-full z-20 mt-2 overflow-hidden rounded-[18px] border border-border/60 bg-popover/96 p-1 shadow-[0_20px_60px_-30px_rgba(0,0,0,0.45)] backdrop-blur-xl",children:e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{W(!1),de("native")},className:"flex w-full items-center gap-1.5 rounded-[13px] px-2 py-2 text-left text-[11px] font-medium text-foreground transition-colors hover:bg-muted/80",children:[e.jsx(Wt,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),e.jsx("span",{className:"flex-1 truncate whitespace-nowrap",children:"Load session"}),e.jsx("span",{className:"shrink-0 text-[9px] uppercase tracking-[0.18em] text-muted-foreground",children:"native"})]})})]}),J?e.jsxs("div",{className:"flex min-w-0 flex-[3] items-center gap-1.5",children:[e.jsxs("div",{className:"relative min-w-0 flex-1",children:[e.jsx($t,{className:"pointer-events-none absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(Re,{ref:ce,value:x,onChange:k=>C(k.target.value),placeholder:"Search tasks",className:"h-11 rounded-[18px] border-border/70 bg-background/68 pl-11 text-[11px]"})]}),e.jsx($,{variant:"outline",size:"icon",onClick:()=>F(!1),className:"rounded-[14px] border-border/70 bg-background/68",children:e.jsx(Lt,{className:"h-4 w-4"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs($,{variant:"outline",onClick:()=>F(!0),className:L("rounded-[14px] border-border/70 bg-background/68 px-3 text-[11px]",x&&"border-primary/40 bg-primary/8 text-primary"),children:[e.jsx($t,{className:"h-4 w-4"}),"Search"]}),e.jsx($,{variant:oe||ae?"secondary":"outline",size:"icon",onClick:()=>ie(k=>!k),className:L("shrink-0 rounded-[14px] border-border/70 bg-background/68",ae&&"border-primary/40 bg-primary/8 text-primary"),title:"Filters",children:e.jsx(gn,{className:"h-4 w-4"})})]})]}),(oe||ae)&&e.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-1.5 sm:grid-cols-2",children:[e.jsxs(Se,{value:l,onValueChange:k=>h(k),children:[e.jsx(Ee,{className:"h-7 rounded-[13px] border-border/70 bg-background/60 text-[12px]",children:e.jsx(Me,{})}),e.jsx(_e,{children:kr.map(k=>e.jsx(pe,{value:k.value,className:"text-[12px]",children:k.label},k.value))})]}),e.jsxs(Se,{value:j,onValueChange:_,children:[e.jsx(Ee,{className:"h-7 rounded-[13px] border-border/70 bg-background/60 text-[12px]",children:e.jsx(Me,{placeholder:"Node"})}),e.jsx(_e,{children:N.map(k=>e.jsx(pe,{value:k.value,className:"text-[12px]",children:k.label},k.value))})]}),e.jsxs(Se,{value:u,onValueChange:I,children:[e.jsx(Ee,{className:"h-7 rounded-[13px] border-border/70 bg-background/60 text-[12px]",children:e.jsx(Me,{placeholder:"Agent"})}),e.jsx(_e,{children:g.map(k=>e.jsx(pe,{value:k,className:"text-[12px]",children:k==="all"?"All agents":k},k))})]}),e.jsxs(Se,{value:f,onValueChange:k=>K(k),children:[e.jsx(Ee,{className:"h-7 rounded-[13px] border-border/70 bg-background/60 text-[12px]",children:e.jsx(Me,{placeholder:"Type"})}),e.jsx(_e,{children:yr.map(k=>e.jsx(pe,{value:k.value,className:"text-[12px]",children:k.label},k.value))})]})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2",children:re.length>0?e.jsxs("div",{className:"space-y-1",children:[n&&e.jsxs("div",{className:"mb-1 flex items-center justify-between px-1 py-1",children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:[e.jsx(Ut,{checked:S&&!b?"indeterminate":b,onCheckedChange:k=>z(k===!0),"aria-label":"Select all visible tasks"}),e.jsx("span",{children:"Select all"})]}),Y>0&&e.jsx($,{variant:"ghost",size:"sm",onClick:()=>z(!1),className:"h-7 rounded-[12px] px-2 text-[11px]",children:"Clear"})]}),re.map(k=>{const X=k.nodeId??"__unassigned__",ne=p&&!T&&m.has(X);return e.jsxs("div",{className:"space-y-1",children:[p&&e.jsxs("button",{type:"button",onClick:()=>U(X),"aria-expanded":!ne,className:"flex w-full items-center gap-1.5 rounded-[15px] bg-gradient-to-r from-primary/8 to-muted/20 px-2 py-1.5 text-left text-[11px] font-semibold uppercase tracking-[0.16em] text-muted-foreground transition-all duration-150 hover:from-primary/12 hover:to-muted/30 hover:text-foreground active:scale-[0.99] active:from-primary/15",children:[e.jsx(et,{className:L("h-3.5 w-3.5 shrink-0 transition-transform duration-200",!ne&&"rotate-90")}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.nodeName}),e.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[k.nodeId===c&&e.jsx(Ae,{variant:"outline",className:"rounded-[9px] border-primary/25 bg-primary/8 px-1.5 py-0 text-[9px] font-semibold leading-4 text-primary shadow-none",children:"leader"}),e.jsx("span",{className:"tabular-nums text-muted-foreground/60",children:k.dirs.reduce((me,D)=>me+D.tasks.length,0)})]})]}),e.jsx("div",{className:L("grid transition-[grid-template-rows] duration-300 ease-in-out",ne?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:e.jsx("div",{className:"overflow-hidden",children:k.dirs.map(me=>{const D=`${X}::${me.path}`,te=P.has(D),ge=wr(me.path);return e.jsxs("div",{className:L("space-y-0.5 rounded-xl",p&&"pl-3"),children:[e.jsxs("button",{type:"button",onClick:()=>ke(D),"aria-expanded":!te,title:me.path,className:"flex w-full items-center gap-1.5 rounded-[12px] bg-muted/15 px-2 py-1 text-left text-[10px] font-medium text-muted-foreground/70 transition-all duration-150 hover:bg-muted/30 hover:text-foreground active:scale-[0.98] active:bg-muted/40",children:[e.jsx(et,{className:L("h-3 w-3 shrink-0 transition-transform duration-200",!te&&"rotate-90")}),e.jsx("span",{className:"truncate font-mono",children:ge}),e.jsx("span",{className:"ml-auto shrink-0 tabular-nums text-muted-foreground/40",children:me.tasks.length})]}),e.jsx("div",{className:L("grid transition-[grid-template-rows] duration-300 ease-in-out",te?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:e.jsx("div",{className:L("overflow-hidden",p?"pl-2":"pl-0"),children:e.jsx("div",{className:"space-y-1.5 border-l border-border/35 py-1 pl-2.5 ml-1.5",children:me.tasks.map(Q=>e.jsxs("div",{className:L("flex items-center gap-1.5 rounded-[18px] border px-2.5 py-1.5 transition-all duration-200","hover:-translate-y-px",Q.id===a?"border-primary/45 bg-primary/9 shadow-[0_24px_80px_-54px_hsl(var(--primary)/0.95)]":"border-border/58 bg-background/46 hover:border-border hover:bg-background/70 hover:shadow-[0_10px_28px_-18px_rgba(0,0,0,0.35)]"),children:[n&&e.jsx("div",{className:"flex shrink-0",onClick:Fe=>Fe.stopPropagation(),children:e.jsx(Ut,{checked:y.has(Q.id),onCheckedChange:Fe=>M(Q.id,Fe===!0),"aria-label":`Select ${Q.title}`})}),e.jsxs("button",{type:"button",onClick:()=>R(Q.id),className:"min-w-0 flex-1 text-left",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:L("h-1.5 w-1.5 shrink-0 rounded-full",Cr(Q.status),(Q.status==="running"||Q.status==="assigned")&&"animate-soft-status-pulse")}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",children:Q.title}),e.jsx("span",{className:"ml-1 shrink-0 tabular-nums text-[10px] text-muted-foreground/55",children:Sr(Q.updatedAt)})]}),e.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-1 pl-3",children:[e.jsx(Bs,{status:Q.status}),e.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/60",children:Q.agent}),Q.conversationKind==="nativeSession"&&e.jsx(Ae,{variant:"outline",className:"border-sky-500/25 bg-sky-500/10 text-[10px] text-sky-700 dark:text-sky-300",children:"native"}),Q.activeShare&&e.jsx(Ae,{variant:"outline",className:"border-primary/25 bg-primary/10 text-[10px] text-primary",children:"shared"}),Q.assignedNodeAvailable===!1&&e.jsx(Ae,{variant:"outline",className:"border-destructive/25 bg-destructive/10 text-[10px] text-destructive",children:"unavailable"})]})]})]},Q.id))})})})]},D)})})})]},X)})]}):r?e.jsx("div",{className:"space-y-2 px-1",children:[1,2,3].map(k=>e.jsx("div",{className:"rounded-[24px] border border-border/40 bg-background/30 px-3 py-3",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"mt-1 h-2.5 w-2.5 shrink-0 animate-pulse rounded-full bg-muted-foreground/20"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("div",{className:"h-2.5 animate-pulse rounded-full bg-muted-foreground/15",style:{width:`${60+k*12}%`,animationDelay:`${k*120}ms`}}),e.jsx("div",{className:"h-2 w-24 animate-pulse rounded-full bg-muted-foreground/10",style:{animationDelay:`${k*120+60}ms`}})]})]})},k))}):e.jsx("div",{className:"rounded-[24px] border border-dashed border-border/70 bg-background/35 px-3 py-5 text-[11px] text-muted-foreground",children:o||"No tasks match this view."})}),n&&Y>0?e.jsxs("div",{className:"shrink-0 border-t border-border/60 px-3 py-3",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:"Batch actions"}),e.jsxs("div",{className:"mt-2 text-[11px] font-semibold text-foreground",children:[Y," task",Y!==1?"s":""," selected"]}),!w&&e.jsx("div",{className:"mt-2 text-[11px] text-muted-foreground",children:"Only completed, failed, cancelled, or archived tasks can be archived."}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[e.jsxs(Ct,{children:[e.jsx(ps,{asChild:!0,children:e.jsxs($,{variant:"outline",size:"sm",disabled:!w,className:"rounded-[14px]",children:[e.jsx(un,{className:"h-3.5 w-3.5"}),"Archive"]})}),e.jsxs(St,{children:[e.jsxs(Et,{children:[e.jsxs(_t,{children:["Archive ",Y," task",Y!==1?"s":"","?"]}),e.jsx(Tt,{children:"Archived tasks stay hidden from the default task view and can be reopened from the archived scope."})]}),e.jsxs(Dt,{children:[e.jsx(Mt,{children:"Cancel"}),e.jsx(At,{onClick:A,disabled:!w,children:"Archive"})]})]})]}),e.jsxs(Ct,{children:[e.jsx(ps,{asChild:!0,children:e.jsxs($,{variant:"destructive",size:"sm",className:"rounded-[14px]",children:[e.jsx(Kn,{className:"h-3.5 w-3.5"}),"Delete"]})}),e.jsxs(St,{children:[e.jsxs(Et,{children:[e.jsxs(_t,{children:["Delete ",Y," task",Y!==1?"s":"","?"]}),e.jsx(Tt,{children:"This removes the selected tasks and their saved logs."})]}),e.jsxs(Dt,{children:[e.jsx(Mt,{children:"Cancel"}),e.jsx(At,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})]}):null]})}async function Qo(t,a){var r,o;try{const n=await Er(t,a);if((o=(r=globalThis.navigator)==null?void 0:r.clipboard)!=null&&o.writeText)try{await globalThis.navigator.clipboard.writeText(n.url),xe.success("Shared link copied")}catch{xe.success("Shared link created")}else xe.success("Shared link created");return n}catch(n){xe.error(n instanceof Error?n.message:"Failed to create shared link");return}}async function Zo(t){try{return await _r(t),xe.success("Shared link stopped"),!0}catch(a){return xe.error(a instanceof Error?a.message:"Failed to stop shared link"),!1}}function el(t,a,r){const o=s.useCallback(()=>{a(),r()},[a,r]),n=s.useCallback(async u=>{if(!t)return;const j=await Qo(t.id,u);return j&&o(),j},[t,o]),l=s.useCallback(async()=>{if(!t)return!1;const u=await Zo(t.id);return u&&o(),u},[t,o]);return{handleShareTask:n,handleStopShareTask:l}}function Ds(t,a,r){const o=s.useRef(a);o.current=a,s.useEffect(()=>{let u=0,j=0;const f=d=>{const c=d.touches[0];c&&(u=c.clientX,j=c.clientY)},g=d=>{var b,S,w,C;const c=d.changedTouches[0];if(!c)return;const x=c.clientX-u;Math.abs(c.clientY-j)>100||Math.abs(x)<50||(x>0?(S=(b=o.current).onSwipeRight)==null||S.call(b):(C=(w=o.current).onSwipeLeft)==null||C.call(w))},N=(t==null?void 0:t.current)??document;return N.addEventListener("touchstart",f,{passive:!0}),N.addEventListener("touchend",g,{passive:!0}),()=>{N.removeEventListener("touchstart",f),N.removeEventListener("touchend",g)}},[t,r==null?void 0:r.threshold,r==null?void 0:r.maxVertical])}const tl="(min-width: 1024px)",sl="(min-width: 1800px)";function Ms(t){var a,r,o;return((o=(r=(a=globalThis.window)==null?void 0:a.matchMedia)==null?void 0:r.call(a,t))==null?void 0:o.matches)??!1}function al(){const[t,a]=s.useState(!0),[r,o]=s.useState(!1),[n,l]=s.useState(()=>Ms(sl)),u=s.useRef(null),j=s.useRef(null);Ds(u,{onSwipeLeft:()=>o(!1)}),Ds(j,{onSwipeRight:()=>l(!1)});const f=s.useCallback(()=>{if(Ms(tl)){a(g=>!g);return}o(g=>!g)},[]);return{desktopTasksOpen:t,mobileTasksPanelOpen:r,mobileTasksPanelRef:u,operationsOpen:n,operationsPanelRef:j,setMobileTasksPanelOpen:o,setOperationsOpen:l,toggleTasksPanel:f}}function rl({isLeader:t,selfId:a,subscribe:r}){const[o,n]=s.useState([]),[l,u]=s.useState(!0),[j,f]=s.useState(null),g=s.useCallback(async()=>{try{const N=await Tr({assignedTo:!t&&a?a:void 0,limit:100});n(N),f(null)}catch(N){f(N instanceof Error?N.message:"Failed to load tasks")}finally{u(!1)}},[t,a]);return Dr(g,1e4),s.useEffect(()=>{g()},[g]),s.useEffect(()=>r("task",g),[r,g]),{fetchTasks:g,setTasks:n,tasks:o,tasksError:j,tasksLoading:l}}function nl(t,a){return a.data.nodeId===t.self.id||a.data.name===t.self.name||a.data.endpoint===t.self.endpoint}function ol({cluster:t,subscribe:a}){s.useEffect(()=>{var r;if(((r=t==null?void 0:t.self)==null?void 0:r.role)==="leader")return a("node",o=>{const n=String(o.data.name??o.data.nodeId??"node"),l=nl(t,o);o.type==="node.joined"&&!l&&xe.success(`${n} joined the cluster`),o.type==="node.left"&&!l&&xe.message(`${n} left the cluster`)})},[t,a])}const ll=[0,300,1e3,2e3];function il({task:t,getActiveTaskId:a,setLogs:r,setPendingMessages:o}){t.conversationKind==="nativeSession"&&(async()=>{for(const n of ll){if(n>0&&await new Promise(l=>setTimeout(l,n)),a()!==t.id)return;try{const l=await qs(t.id);if(a()!==t.id||(r(u=>Ys(u,l.logs)),o(u=>Xs(u,l.logs)),l.total>0))return}catch{}}})()}function dl(){var ns,os,ls,is,ds,cs;const{id:t}=Mr(),a=Ar(),r=Lr(),o=Pr(),{cluster:n,systemInfo:l,events:u,sseConnected:j,subscribe:f,refresh:g,loading:N,error:d}=Rr(),c=s.useMemo(()=>Fr(a.state),[a.state]),[x,y]=s.useState(null),[b,S]=s.useState("active"),[w,C]=s.useState("all"),[h,I]=s.useState("all"),[_,K]=s.useState("all"),[M,z]=s.useState(""),A=s.useDeferredValue(M),{desktopTasksOpen:O,mobileTasksPanelOpen:de,mobileTasksPanelRef:R,operationsOpen:H,operationsPanelRef:J,setMobileTasksPanelOpen:F,setOperationsOpen:oe,toggleTasksPanel:ie}=al(),[B,W]=s.useState(()=>!!(c!=null&&c.draftNewTask)),[ce,V]=s.useState(()=>(c==null?void 0:c.createMode)??"chat"),[Z,Y]=s.useState(()=>c!=null&&c.draftNewTask?{route:c.returnRoute??"/",taskId:c.returnTaskId??null}:null),[ae,le]=s.useState(!1),[m,ee]=s.useState("transcript"),[P,Ne]=s.useState("all"),[re,we]=s.useState(!1),[p,T]=s.useState(null),[U,ke]=s.useState([]),[k,X]=s.useState([]),[ne,me]=s.useState(!1),[D,te]=s.useState(null),[ge,Q]=s.useState(new Set),[Fe,ye]=s.useState(!1),[rt,Ye]=s.useState(!1),[nt,Xe]=s.useState(null),Qe=s.useRef(null),$e=s.useRef(null),Ce=((ns=n==null?void 0:n.self)==null?void 0:ns.role)==="leader",be=(os=n==null?void 0:n.self)==null?void 0:os.id;ol({cluster:n,subscribe:f});const{fetchTasks:he,setTasks:Ve,tasks:Ie,tasksError:va,tasksLoading:ht}=rl({isLeader:Ce,selfId:be,subscribe:f}),ve=s.useMemo(()=>[...Ie].sort((i,v)=>v.updatedAt-i.updatedAt),[Ie]),ja=s.useMemo(()=>{const i=new Map;for(const v of(n==null?void 0:n.nodes)??[]){const E=qn(ve,v.id);E>0&&i.set(v.id,E)}return i},[n==null?void 0:n.nodes,ve]),Le=s.useMemo(()=>ve.filter(i=>!$r(i,b)||w!=="all"&&i.agent!==w||!Ir(i,_)||h==="unassigned"&&i.assignedTo||h!=="all"&&h!=="unassigned"&&Or(i.assignedTo,n==null?void 0:n.nodes,i.assignedNodeName)!==h?!1:A.trim()?Br(i,A):!0),[ve,b,w,_,h,A]);s.useEffect(()=>{Q(i=>{const v=Qn(i,Le.map(E=>E.id));return v.size===i.size?i:v})},[Le]),s.useEffect(()=>{Ce||Q(new Set)},[Ce]);const Na=s.useMemo(()=>["all",...Array.from(new Set(ve.map(i=>i.agent))).sort()],[ve]),ka=s.useMemo(()=>{const v=Array.from(new Set(ve.map(E=>E.assignedTo).filter(E=>!!E))).map(E=>{const ue=ve.find(G=>G.assignedTo===E);return(n==null?void 0:n.nodes.find(G=>G.id===E))??{id:E,name:Is(E,n==null?void 0:n.nodes,ue==null?void 0:ue.assignedNodeName)}}).sort((E,ue)=>E.name.localeCompare(ue.name));return[{value:"all",label:"All nodes"},{value:"unassigned",label:"Unassigned"},...v.map(E=>({value:E.name.toLowerCase(),label:E.name}))]},[ve,n==null?void 0:n.nodes]),es=s.useMemo(()=>{const i=new Map;for(const v of(n==null?void 0:n.nodes)??[])i.set(v.id,v.name);for(const v of ve)v.assignedTo&&v.assignedNodeName&&!i.has(v.assignedTo)&&i.set(v.assignedTo,v.assignedNodeName);return i},[n==null?void 0:n.nodes,ve]),ts=s.useMemo(()=>{const i=new Map;for(const v of(n==null?void 0:n.nodes)??[])v.status!=="offline"&&i.set(v.id,v);return n!=null&&n.self&&n.self.status!=="offline"&&i.set(n.self.id,n.self),Array.from(i.values())},[n]),ya=((ls=n==null?void 0:n.self)==null?void 0:ls.id)??((is=ts[0])==null?void 0:is.id)??null,pt=s.useMemo(()=>["all",...Array.from(new Set(u.map(i=>i.type))).sort()],[u]),wa=s.useMemo(()=>P==="all"?u:u.filter(i=>i.type===P),[u,P]),Ca=Le.length>0&&Le.every(i=>ge.has(i.id)),Sa=Le.some(i=>ge.has(i.id)),Ea=Zn(Le,ge);s.useEffect(()=>{c!=null&&c.draftNewTask&&(W(!0),Y({route:c.returnRoute??"/",taskId:c.returnTaskId??null}))},[c]),s.useEffect(()=>{P!=="all"&&!pt.includes(P)&&Ne("all")},[P,pt]),s.useEffect(()=>{js(t,B)&&!x&&ve[0]&&y(ve[0].id)},[t,B,x,ve]),s.useEffect(()=>{var i;js(t,B)&&(x&&Ie.some(v=>v.id===x)||y(((i=ve[0])==null?void 0:i.id)??null))},[t,B,x,ve,Ie]);const se=Gn({routeTaskId:t,creatingTask:B,internalSelectedTaskId:x,sortedTaskIds:ve.map(i=>i.id)}),Ke=s.useMemo(()=>Ie.find(i=>i.id===se)??null,[Ie,se]);s.useEffect(()=>{$e.current=se??null},[se]);const ot=s.useCallback(()=>{T(null),ke([]),X([]),te(null)},[]),De=s.useCallback(async()=>{const i=se;if(i)try{const v=await zr(i);if($e.current!==i)return;T(v),te(null)}catch(v){if($e.current!==i)return;T(null),ke([]),X([]),te(v instanceof Error?v.message:"Failed to load task")}finally{$e.current===i&&me(!1)}},[se]),lt=s.useCallback(async()=>{const i=se;if(i)try{const v=await qs(i);if($e.current!==i)return;ke(E=>Ys(E,v.logs)),X(E=>Xs(E,v.logs))}catch{}},[se]);s.useEffect(()=>{if(!se){T(null),ke([]),X([]),te(null),me(!1);return}ee("transcript"),T(Ke),ke([]),X([]),te(null),me(!0),De(),lt()},[se,lt,De]),s.useEffect(()=>{var v;if(!se||B||ht||Ie.some(E=>E.id===se))return;const i=((v=ve[0])==null?void 0:v.id)??null;y(i),ot(),s.startTransition(()=>{r(i?`/tasks/${i}`:"/",{state:null})})},[se,ot,B,r,ve,Ie,ht]),s.useEffect(()=>{Ke&&T(i=>!i||i.id!==Ke.id?i:{...i,...Ke})},[Ke]),s.useEffect(()=>f("task.updated",i=>{Ve(v=>Yn(v,i.data))}),[f]),s.useEffect(()=>{if(se)return f("task",i=>{const v=i.data.taskId;if(!(typeof v!="string"||v!==se)){if(i.type==="task.output"){const E=i.data.event;if(E){ke(G=>tn(G,E));const ue=bs(E);ue&&X(G=>sn(G,ue))}}i.type==="task.updated"&&De(),i.type==="task.status"&&(De(),lt())}})},[f,se,De,lt]),s.useEffect(()=>{var i;m==="transcript"&&((i=Qe.current)==null||i.scrollIntoView({behavior:"smooth"}))},[U,k,m]);const q=p??Ke,_a=q!=null&&q.assignedTo?(n==null?void 0:n.nodes.find(i=>i.id===q.assignedTo))??null:null,ft=k.length>0,Ta=q?Ur.has(q.agent):!1,gt=(q==null?void 0:q.status)==="running",Da=q?ut.has(q.status):!1,Ma=q?ut.has(q.status)||Vr.has(q.status):!1,Aa=!!(q&&Ce&&q.status==="failed"),bt=s.useMemo(()=>Wo(q,n,ft,!!gt),[q,n,ft,gt]),vt=s.useMemo(()=>an([...U,...k.map(i=>yt(i.content,i.timestamp))]),[U,k]),it=s.useMemo(()=>{if(!q||q.conversationKind==="nativeSession")return null;const i=rn(q);if(i.length>0)return yt(i,new Date(q.createdAt).toISOString());if(vt.length>0)return null;const v=nn(q.description||q.title);return v.length>0?yt(v,new Date(q.createdAt).toISOString()):null},[q,vt]),jt=s.useMemo(()=>it?bs(it):null,[it]),La=s.useMemo(()=>jt?on(U,jt):!1,[U,jt]),Nt=s.useCallback((i="chat")=>{const v={route:t?`/tasks/${t}`:"/",taskId:se};Y(v),V(i),W(!0),s.startTransition(()=>{r("/",{state:{draftNewTask:!0,returnRoute:v.route,returnTaskId:v.taskId,createMode:i}})})},[t,se,r]),Pa=s.useCallback(()=>{var v;const i=(Z==null?void 0:Z.taskId)??((v=ve[0])==null?void 0:v.id)??null;W(!1),Y(null),y(i),s.startTransition(()=>{r((Z==null?void 0:Z.route)??"/",{state:null})})},[Z,ve,r]),ss=s.useCallback(i=>{W(!1),Y(null),y(i),s.startTransition(()=>{r(`/tasks/${i}`,{state:null})})},[r]),Ra=s.useCallback(i=>{$e.current=i.id,W(!1),Y(null),Ve(v=>Jn(v,i)),T(i),ke([]),X([]),te(null),me(!1),ee("transcript"),y(i.id),il({task:i,getActiveTaskId:()=>$e.current,setLogs:ke,setPendingMessages:X}),he(),s.startTransition(()=>{r(`/tasks/${i.id}`,{state:null})})},[he,r]),dt=s.useCallback(async i=>{if(!se)return!1;const v=`local-${Date.now()}-${Math.random().toString(16).slice(2)}`;X(E=>[...E,{id:v,content:i,timestamp:new Date().toISOString()}]);try{return await Kr(se,i),De(),!0}catch(E){return X(ue=>ue.filter(G=>G.id!==v)),xe.error(E instanceof Error?E.message:"Failed to send message"),!1}},[se,De]),Fa=s.useCallback(i=>{dt(i)},[dt]),$a=s.useCallback(i=>dt(i),[dt]),Ia=s.useCallback(async()=>{if(q)try{await Hr(q.id),De(),he()}catch(i){xe.error(i instanceof Error?i.message:"Failed to cancel task")}},[q,De,he]),{handleShareTask:Oa,handleStopShareTask:Ba}=el(q,De,he),za=s.useCallback(async()=>{if(q)try{await qr(q.id),De(),he()}catch(i){xe.error(i instanceof Error?i.message:"Failed to retry task")}},[q,De,he]),ct=s.useCallback((i,v=!1)=>{const E=eo(Le,i);return y(E),(v||!E)&&ot(),s.startTransition(()=>{r(E?`/tasks/${E}`:"/",{state:null})}),E},[ot,Le,r]),Ua=s.useCallback((i,v)=>{Q(E=>{const ue=new Set(E);return v?ue.add(i):ue.delete(i),ue})},[]),Va=s.useCallback(i=>{if(!i){Q(new Set);return}Q(new Set(Le.map(v=>v.id)))},[Le]),Ka=s.useCallback(async()=>{const i=Array.from(ge);if(i.length!==0)try{const{results:v}=await Wr(i),E=v.filter(G=>!G.ok),ue=v.filter(G=>G.ok).map(G=>G.id);se&&ue.includes(se)&&ct(ue),E.length>0?xe.error(`Failed to archive ${E.length} task(s): ${E.map(G=>G.error??G.id).join(", ")}`):xe.success(`Archived ${ue.length} task(s)`),Q(new Set(E.map(G=>G.id))),he()}catch(v){xe.error(v instanceof Error?v.message:"Failed to archive tasks")}},[se,he,ct,ge]),Ha=s.useCallback(async()=>{const i=Array.from(ge);if(i.length!==0)try{const{results:v}=await Gr(i),E=v.filter(G=>!G.ok),ue=v.filter(G=>G.ok).map(G=>G.id);se&&ue.includes(se)&&ct(ue,!0),E.length>0?xe.error(`Failed to delete ${E.length} task(s): ${E.map(G=>G.error??G.id).join(", ")}`):xe.success(`Deleted ${ue.length} task(s)`),Q(new Set(E.map(G=>G.id))),he()}catch(v){xe.error(v instanceof Error?v.message:"Failed to delete tasks")}},[se,he,ct,ge]),qa=s.useCallback(async()=>{ye(!0);try{await Jr(),g()}catch(i){xe.error(i instanceof Error?i.message:"Failed to promote node")}finally{ye(!1)}},[g]),Wa=s.useCallback(async()=>{Ye(!0);try{await Yr(),xe.success("This node left the remote cluster and is leading itself again."),he(),De(),g()}catch(i){xe.error(i instanceof Error?i.message:"Failed to leave cluster")}finally{Ye(!1)}},[De,he,g]),Ga=s.useCallback(async i=>{var us;const v=!Yt(i),E=i.id===((us=n==null?void 0:n.self)==null?void 0:us.id),ue=E?(l==null?void 0:l.transportType)??i.transportType:i.transportType,G=E&&!v&&Je(ue);Xe(i.id);try{G?await Xr("direct"):await Qr(i.id,v),xe.success(v?`Enabled remote access on ${i.name}`:`Disabled remote access on ${i.name}`),g()}catch(xs){xe.error(xs instanceof Error?xs.message:"Failed to update remote access")}finally{Xe(null)}},[(ds=n==null?void 0:n.self)==null?void 0:ds.id,g,l==null?void 0:l.transportType]),as={toolbarTasks:Le,activeTaskId:se,tasksLoading:ht,tasksError:va,isLeader:Ce,scope:b,agentFilter:w,nodeFilter:h,taskKindFilter:_,agentOptions:Na,nodeOptions:ka,nodeNameById:es,leaderNodeId:((cs=n==null?void 0:n.leader)==null?void 0:cs.id)??null,searchQuery:M,selectedTaskIds:ge,allVisibleTasksSelected:Ca,someVisibleTasksSelected:Sa,canBatchArchive:Ea,onSearchChange:z,onScopeChange:S,onAgentFilterChange:C,onNodeFilterChange:I,onTaskKindFilterChange:K,onToggleTaskSelected:Ua,onToggleAllVisibleTasks:Va,onBatchArchive:Ka,onBatchDelete:Ha,onCreateTask:Nt,onSelectTask:ss,onClose:ie},rs={cluster:n,systemInfo:l,nodeNameById:es,nodeBlockingTaskCounts:ja,eventTypeFilter:P,onEventTypeFilterChange:Ne,eventTypeOptions:pt,filteredEvents:wa,sseConnected:j,clusterLoading:N,clusterError:d,promotePending:Fe,onPromote:qa,onAddNode:()=>le(!0),leavePending:rt,onLeaveCluster:Wa,onToggleNodeDevTunnel:Ga,devTunnelNodeId:nt,onClose:()=>oe(!1)};return e.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden pb-2",children:[e.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[e.jsx("div",{className:L("hidden lg:block lg:shrink-0 lg:transition-all lg:duration-300",O?"lg:mr-3 lg:w-[24rem]":"lg:w-0 lg:overflow-hidden"),children:O&&e.jsx(Ts,{...as})}),e.jsxs("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-3",children:[e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(Oo,{onToggleTasks:ie,desktopTasksOpen:O,mobileTasksPanelOpen:de,operationsOpen:H,onToggleOperations:()=>oe(i=>!i),cluster:n,sseConnected:j,activeTab:m,setActiveTab:ee,creatingTask:B,createMode:ce,activeTask:q,assignedNode:_a,taskLoading:ne,taskError:D,displayEvents:vt,initialPromptAlreadyInLogs:La,initialPrompt:it,supportsFollowUp:Ta,taskUnavailable:bt.taskUnavailable,chatDisabled:bt.chatDisabled,chatDisabledReason:bt.chatDisabledReason,questionBypassEnabled:re,isRunning:!!gt,isStarting:Da,hasPendingFollowUp:ft,canCancel:!!Ma,canRetry:!!Aa,onRetry:za,onCancel:Ia,onShareTask:Oa,onStopShareTask:Ba,onStartCreateTask:Nt,onCancelCreateTask:Pa,onCreateTask:Ra,onSendMessage:Fa,onQuestionBypassChange:we,onSubmitQuestionResponse:$a,messagesEndRef:Qe})}),(o==null?void 0:o.terminalOpen)&&e.jsx(Ho,{nodes:ts,defaultNodeId:ya,onClose:()=>o==null?void 0:o.setTerminalOpen(!1)})]}),e.jsx("div",{className:L("hidden xl:block xl:shrink-0 xl:transition-all xl:duration-300",H?"xl:ml-3 xl:w-[26rem]":"xl:w-0 xl:overflow-hidden"),children:H&&e.jsx(Es,{...rs})})]}),H&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button","aria-label":"Close operations panel",onClick:()=>oe(!1),className:"fixed inset-0 z-30 bg-black/45 backdrop-blur-sm xl:hidden"}),e.jsx("div",{ref:J,className:"fixed inset-y-0 right-0 z-40 w-full p-2 sm:max-w-sm sm:p-3 xl:hidden",children:e.jsx(Es,{...rs})})]}),de&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button","aria-label":"Close task list",onClick:()=>F(!1),className:"fixed inset-0 z-30 bg-black/45 backdrop-blur-sm lg:hidden"}),e.jsx("div",{ref:R,className:"fixed inset-y-0 left-0 z-40 w-full p-2 sm:max-w-sm sm:p-3 lg:hidden",children:e.jsx(Ts,{...as,onCreateTask:i=>{F(!1),Nt(i)},onSelectTask:i=>{F(!1),ss(i)},onClose:()=>F(!1)})})]}),e.jsx(Fs,{open:ae,onOpenChange:le,children:e.jsx(no,{onAdded:()=>{le(!1),g()}})})]})}const hl=Object.freeze(Object.defineProperty({__proto__:null,DashboardPage:dl},Symbol.toStringTag,{value:"Module"}));export{hl as D,vs as G};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as h,r as g,j as n,i as P,C as T,b as E,X as oe,x as ie,H as Q,aZ as ae,y as ce,B as le}from"./index-
|
|
1
|
+
import{c as h,r as g,j as n,i as P,C as T,b as E,X as oe,x as ie,H as Q,aZ as ae,y as ce,B as le}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{r as l,b4 as P,a$ as O,j as e,B as g,b as N,y as W}from"./index-
|
|
1
|
+
import{r as l,b4 as P,a$ as O,j as e,B as g,b as N,y as W}from"./index-DHC5U3_j.js";import{G as R}from"./DashboardPage-0TdEZxup.js";import{C as T,F as _}from"./folder-Cl9WN_cx.js";import{F as B}from"./file-BdIshbRs.js";import"./DashboardShared-BfSOAHkB.js";import"./input-CdkmqjGJ.js";function $(r,t){if(!(r!=null&&r.trim()))return[];const s=r.split(`
|
|
2
2
|
`),n=[];let a=[];const d=()=>{if(a.length===0)return;const c=a.join(`
|
|
3
3
|
`).trim();if(!c){a=[];return}const i=J(a);if(!i){a=[];return}n.push({id:`${t}:${i}`,path:i,section:t,patch:c}),a=[]};for(const c of s)c.startsWith("diff --git ")&&a.length>0&&d(),a.push(c);return d(),n}function I(r){const t=[];for(const s of[...r].sort((n,a)=>n.path.localeCompare(a.path))){const n=s.path.split("/").filter(Boolean);let a=t,d="";n.forEach((c,i)=>{d=d?`${d}/${c}`:c;const h=i===n.length-1;let u=a.find(b=>b.name===c);u||(u=h?{type:"file",name:c,path:d,item:s}:{type:"folder",name:c,path:d,children:[]},a.push(u)),h||(u.children??(u.children=[]),a=u.children)})}return t}function G(r){const t=[];let s="";for(const n of r.split("/").filter(Boolean).slice(0,-1))s=s?`${s}/${n}`:n,t.push(s);return t}function A(r){return r.filter(t=>t&&!t.endsWith("/")).map(t=>({id:`untracked:${t}`,path:t,section:"untracked"}))}function J(r){var d,c;const t=(d=r.find(i=>i.startsWith("+++ ")))==null?void 0:d.slice(4).trim();if(t&&t!=="/dev/null")return w(t);const s=(c=r.find(i=>i.startsWith("--- ")))==null?void 0:c.slice(4).trim();if(s&&s!=="/dev/null")return w(s);const n=r.find(i=>i.startsWith("diff --git "));if(!n)return null;const a=n.match(/^diff --git a\/(.+?) b\/(.+)$/);return a?w(a[2]||a[1]||""):null}function w(r){return r.replace(/^[ab]\//,"")}const y={staged:"Staged",unstaged:"Unstaged",untracked:"Untracked"};function se({taskId:r}){const[t,s]=l.useState(null),[n,a]=l.useState(!0),[d,c]=l.useState(null),[i,h]=l.useState(null),[u,b]=l.useState(null),[L,v]=l.useState(!1),[M,k]=l.useState(null),S=l.useCallback(async()=>{a(!0),c(null),s(null);try{const o=await P(r);s(o)}catch(o){c(o instanceof Error?o.message:"Failed to load diff")}finally{a(!1)}},[r]);l.useEffect(()=>{S()},[S]);const F=l.useMemo(()=>$(t==null?void 0:t.staged,"staged"),[t==null?void 0:t.staged]),E=l.useMemo(()=>$(t==null?void 0:t.unstaged,"unstaged"),[t==null?void 0:t.unstaged]),C=l.useMemo(()=>A((t==null?void 0:t.untrackedFiles)??[]),[t==null?void 0:t.untrackedFiles]),j=l.useMemo(()=>[{section:"staged",items:F},{section:"unstaged",items:E},{section:"untracked",items:C}],[F,E,C]),p=l.useMemo(()=>j.flatMap(o=>o.items),[j]),f=l.useMemo(()=>p.find(o=>o.id===i)??p[0]??null,[p,i]);return l.useEffect(()=>{var o;(!i||!p.some(m=>m.id===i))&&h(((o=p[0])==null?void 0:o.id)??null)},[p,i]),l.useEffect(()=>{if(b(null),k(null),v(!1),!f||f.section!=="untracked")return;if(f.path.endsWith("/")){k("This untracked path is a directory. Open the Files tab to inspect its contents.");return}let o=!1;return v(!0),O(r,f.path).then(m=>{o||b(m)}).catch(m=>{o||k(m instanceof Error?m.message:"Failed to load file content")}).finally(()=>{o||v(!1)}),()=>{o=!0}},[f,r]),n?e.jsx(x,{tone:"muted",children:"Loading diff..."}):d?e.jsx(x,{tone:"destructive",children:d}):t!=null&&t.available?p.length>0?e.jsxs("div",{className:"grid h-full min-h-0 grid-cols-1 lg:grid-cols-[18rem_minmax(0,1fr)]",children:[e.jsxs("aside",{className:"flex min-h-0 flex-col border-b border-border/60 bg-background/30 lg:border-b-0 lg:border-r",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-3 py-2.5",children:[e.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.24em] text-muted-foreground",children:"Repository diff"}),e.jsx("div",{className:"mt-1.5 flex items-start justify-between gap-2",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-semibold text-foreground",children:[e.jsx(R,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"truncate",children:t.branch??"detached HEAD"})]}),t.repoRoot&&e.jsx("div",{className:"mt-0.5 truncate font-mono text-[10px] text-muted-foreground",children:t.repoRoot})]})}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:j.map(o=>e.jsxs(g,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 text-[10px]",children:[y[o.section]," ",o.items.length]},o.section))})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-1.5",children:e.jsx("div",{className:"space-y-1.5",children:j.map(({section:o,items:m})=>e.jsx(V,{section:o,items:m,selectedId:(f==null?void 0:f.id)??null,onSelect:h},o))})})]}),e.jsx("section",{className:"min-h-0 flex flex-col bg-card/10",children:f?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-3 py-2.5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx(g,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 text-[10px]",children:y[f.section]}),f.section==="untracked"?e.jsx(g,{variant:"secondary",className:"rounded-full text-[10px]",children:"File content"}):e.jsx(g,{variant:"secondary",className:"rounded-full text-[10px]",children:"Diff patch"})]}),e.jsx("div",{className:"mt-1.5 break-all font-mono text-[10px] text-muted-foreground",children:f.path})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-2.5",children:f.section==="untracked"?e.jsx(q,{loading:L,error:M,content:u}):e.jsx(H,{patch:f.patch??""})})]}):e.jsx(x,{tone:"muted",children:"Select a file to inspect."})})]}):e.jsx(x,{tone:"muted",children:"Working tree is clean."}):e.jsx(x,{tone:"muted",children:"Task working directory is not inside a Git repository."})}function V({section:r,items:t,selectedId:s,onSelect:n}){const a=l.useMemo(()=>I(t),[t]),d=l.useMemo(()=>t.find(u=>u.id===s)??null,[t,s]),c=l.useMemo(()=>new Set(d?G(d.path):[]),[d]),[i,h]=l.useState(!0);return e.jsxs("section",{className:"rounded-[16px] border border-border/60 bg-background/35",children:[e.jsxs("button",{type:"button",onClick:()=>h(u=>!u),"aria-expanded":i,className:N("flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left transition-colors hover:bg-background/55",i?"border-b border-border/60":""),children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[i?e.jsx(W,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):e.jsx(T,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"text-[12px] font-medium text-foreground",children:y[r]})]}),e.jsx(g,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 text-[10px]",children:t.length})]}),i&&e.jsx("div",{className:"p-1.5",children:a.length>0?e.jsx("div",{className:"space-y-0.5",children:a.map(u=>e.jsx(U,{node:u,depth:0,selectedId:s,expandedAncestorPaths:c,onSelect:n},`${r}:${u.path}`))}):e.jsx("div",{className:"rounded-[12px] border border-dashed border-border/70 bg-background/30 px-2.5 py-1.5 text-[11px] text-muted-foreground",children:"No files."})})]})}function U({node:r,depth:t,selectedId:s,expandedAncestorPaths:n,onSelect:a}){var d;return r.type==="folder"?e.jsx(z,{node:r,depth:t,selectedId:s,expandedAncestorPaths:n,onSelect:a}):e.jsxs("button",{type:"button",onClick:()=>{r.item&&a(r.item.id)},className:N("flex w-full cursor-pointer items-center gap-1.5 rounded-[10px] px-1.5 py-1 text-left transition-colors",((d=r.item)==null?void 0:d.id)===s?"bg-primary/10 text-foreground":"text-foreground/90 hover:bg-background/55"),style:{paddingLeft:`${t*12+6}px`},children:[e.jsx(B,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"truncate text-[12px]",children:r.name})]})}function z({node:r,depth:t,selectedId:s,expandedAncestorPaths:n,onSelect:a}){const[d,c]=l.useState(!0);return l.useEffect(()=>{n.has(r.path)&&c(!0)},[n,r.path]),e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:()=>c(i=>!i),"aria-expanded":d,className:"flex w-full cursor-pointer select-none items-center gap-1.5 rounded-[10px] px-1.5 py-1 text-left text-[12px] text-muted-foreground transition-colors hover:bg-background/55 hover:text-foreground",style:{paddingLeft:`${t*12+6}px`},children:[d?e.jsx(W,{className:"h-3.5 w-3.5 shrink-0"}):e.jsx(T,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx(_,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:r.name})]}),d&&e.jsx("div",{className:"space-y-0.5",children:(r.children??[]).map(i=>e.jsx(U,{node:i,depth:t+1,selectedId:s,expandedAncestorPaths:n,onSelect:a},i.path))})]})}function H({patch:r}){const t=r.split(`
|
|
4
4
|
`);return e.jsxs("div",{className:"rounded-[20px] border border-border/60 bg-background/55",children:[e.jsxs("div",{className:"border-b border-border/60 px-3 py-2",children:[e.jsx("div",{className:"text-[12px] font-medium text-foreground",children:"File diff"}),e.jsxs("div",{className:"mt-0.5 text-[10px] text-muted-foreground",children:[t.length," lines"]})]}),e.jsx("div",{className:"font-mono text-[11px] leading-5",children:t.map((s,n)=>e.jsxs("div",{className:N("grid grid-cols-[44px_minmax(0,1fr)] gap-3 px-3 py-0.5",K(s)),children:[e.jsx("span",{className:"select-none text-right text-muted-foreground/55",children:n+1}),e.jsx("span",{className:"whitespace-pre-wrap break-all text-foreground",children:s||" "})]},`${n}-${s}`))})]})}function q({loading:r,error:t,content:s}){if(r)return e.jsx(x,{tone:"muted",children:"Loading file content..."});if(t)return e.jsx(x,{tone:"destructive",children:t});if(!s)return e.jsx(x,{tone:"muted",children:"Select an untracked file to preview its content."});if(s.kind==="image"){const n=s.content?`data:${s.mimeType};base64,${s.content}`:s.downloadUrl;return n?e.jsx("div",{className:"flex min-h-[20rem] items-center justify-center rounded-[28px] border border-border/60 bg-background/55 p-4",children:e.jsx("img",{src:n,alt:s.path,className:"max-h-full max-w-full rounded-[20px] object-contain shadow-[0_24px_90px_-52px_rgba(0,0,0,0.65)]"})}):e.jsx(x,{tone:"muted",children:"Image preview is not available."})}if(s.kind==="pdf"&&s.downloadUrl)return e.jsx("div",{className:"h-full min-h-[24rem] overflow-hidden rounded-[28px] border border-border/60 bg-background/55",children:e.jsx("iframe",{src:s.downloadUrl,title:s.path,className:"h-full w-full border-0"})});if(s.kind==="json"){let n=s.content;try{n=JSON.stringify(JSON.parse(s.content),null,2)}catch{}return e.jsx(D,{content:n,truncated:s.truncated})}return s.kind==="markdown"||s.kind==="text"||s.kind==="html"?e.jsx(D,{content:s.content,truncated:s.truncated}):e.jsx(x,{tone:"muted",children:"This file cannot be previewed inline."})}function D({content:r,truncated:t}){return e.jsxs("div",{className:"rounded-[20px] border border-border/60 bg-background/55",children:[e.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap px-3 py-3 font-mono text-[11px] leading-5 text-foreground",children:r}),t&&e.jsx("div",{className:"border-t border-border/60 px-3 py-2 text-[11px] text-muted-foreground",children:"Content truncated. Open the Files tab to inspect the full artifact."})]})}function x({children:r,tone:t}){return e.jsx("div",{className:N("flex h-full min-h-[12rem] items-center justify-center rounded-[20px] text-[12px]",t==="muted"?"text-muted-foreground":"text-destructive"),children:r})}function K(r){return r.startsWith("@@")?"bg-sky-500/10":r.startsWith("+")&&!r.startsWith("+++")?"bg-emerald-500/10":r.startsWith("-")&&!r.startsWith("---")?"bg-destructive/10":r.startsWith("diff ")||r.startsWith("index ")||r.startsWith("---")||r.startsWith("+++")?"bg-muted/45":""}export{se as DiffTab};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Ze,a_ as Dt,j as y,r as re,a$ as Ar,b0 as Pr,b1 as zr,B as rn,i as Me,b as Te}from"./index-
|
|
1
|
+
import{c as Ze,a_ as Dt,j as y,r as re,a$ as Ar,b0 as Pr,b1 as zr,B as rn,i as Me,b as Te}from"./index-DHC5U3_j.js";import{F as jr,C as Lr}from"./folder-Cl9WN_cx.js";import{F as Fr}from"./file-BdIshbRs.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|