@aeolus-fleet/console 0.28.1 → 0.28.3
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/.next/standalone/packages/console/.next/BUILD_ID +1 -1
- package/.next/standalone/packages/console/.next/build-manifest.json +3 -3
- package/.next/standalone/packages/console/.next/prerender-manifest.json +3 -3
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/labels/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/labels/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/labels/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/network/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/network/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/network/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/settings/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/settings/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page/server-reference-manifest.json +14 -14
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/api/reads/[read]/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/version/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/[root-of-the-server]__06f_104._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/[root-of-the-server]__1cfwaji._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0mxb_server_app_(console)_squadrons_blueprints_[name]_page_actions_1ccrd2_.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0mxb_server_app_(console)_squadrons_templates_[name]_page_actions_0qzhozy.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_fleet-health_page_actions_0dxyn06.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_needs-crew_page_actions_0rhp085.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_network_page_actions_1qbofc5.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_settings_page_actions_07zyuya.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_ships_[shipId]_page_actions_09ros_6.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_squadrons_page_actions_04wqu1c.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_trierarchs_page_actions_13sd72a.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{0ysl_console_features_trierarchs_ui_organisms_clear-worktree-dialog_tsx_1317p-q._.js → 0ysl_console_features_trierarchs_ui_organisms_clear-worktree-dialog_tsx_0xsufp6._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/1eui__next-internal_server_app_(console)_fleet-health_[cause]_page_actions_196vwwc.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/1eui__next-internal_server_app_(console)_needs-attention_page_actions_17c4s8j.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/1eui__next-internal_server_app_(console)_squadrons_[squadronId]_page_actions_0183_z3.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/1eui__next-internal_server_app_(console)_trierarchs_[shipId]_page_actions_1yx88bk.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0eeox-9._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_07gombw._.js → _0gaycoj._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0q3cblh._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0qft7s4._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0qo94ne._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0ulogg0._.js +3 -0
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0z9_vmu._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0rxmuqz._.js → _13glq4v._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_11kd6ba._.js → _18wvycx._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1dwmj6t._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_1a8rkag._.js → _1goyv2m._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1svohzj._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1u0h4gj._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1yr1u1_._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_121u9ci._.js → packages_console_0tb6slk._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_0fashga._.js → packages_console_10p4oa0._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_0mw328z._.js → packages_console_1e5xv3c._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console__next-internal_server_app_(console)_inbox_page_actions_1g5uv6y.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console__next-internal_server_app_(console)_labels_page_actions_14z7vqr.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console__next-internal_server_app_(console)_page_actions_05lw-oq.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_components_organisms_crew-line-dialog_tsx_1hro237._.js → packages_console_components_organisms_crew-line-dialog_tsx_10ic0jx._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_1w4_d-7._.js → packages_console_features_10l91-9._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_squadrons_organisms_form-squadron-dialog_tsx_0iy9qp1._.js → packages_console_features_squadrons_organisms_form-squadron-dialog_tsx_18a-ikh._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/packages/console/.next/server/pages/500.html +1 -1
- package/.next/standalone/packages/console/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/server-reference-manifest.json +15 -15
- package/.next/standalone/packages/console/.next/static/chunks/{0k37l03brt1lx.js → 07fu9dcwa8gxg.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{1619u51m6z_zy.js → 0kuif7aw271c8.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{0-fzym4ddbgfl.js → 0wfjsy5tg3f5e.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{2lposccpgczy6.js → 1f9n-u_wk0h0z.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{2luplqg0e_2uu.js → 1g0s6oau289ch.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{12bv9goo6bo3g.js → 1lb3vicavory4.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{2cgenpdif8p18.js → 1rncy8otm-mdl.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{22sev5tbikm_p.js → 1y84-8pn5z-yf.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{0qpp7ptesfktl.js → 2ffgwmm-2s67e.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{1e5jqgsx_ixev.js → 2n5j8o83jx0pa.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{0q7s6fjx5zvzy.js → 2rnnem2_dp22_.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{02_0efuv8zr04.js → 2ut57cu4zz5tr.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{14e-f0w_cfqhg.js → 2vrrs04ad7ixx.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{2e383naxva7i6.js → 3698wv8cb8cwt.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{3ew37_k6shef6.js → 3cmed7o3h-y6p.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{0u8cdjuofezss.js → 3e0k_3qlcm9yl.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{41t0n1c_xovg1.js → 3e3zqxdrtx589.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/3pji8axxz6oas.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/3xvonltm45tuc.js +1 -0
- package/.next/standalone/packages/console/package.json +3 -3
- package/package.json +3 -3
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0h21fie._.js +0 -3
- package/.next/standalone/packages/console/.next/static/chunks/16uyfps7c1xj6.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/1od7uozkhtt39.js +0 -1
- /package/.next/standalone/packages/console/.next/static/{a78dlby20rZF8ZnmPRYuF → mdxdjzB3-wk2MuucguEaJ}/_buildManifest.js +0 -0
- /package/.next/standalone/packages/console/.next/static/{a78dlby20rZF8ZnmPRYuF → mdxdjzB3-wk2MuucguEaJ}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/packages/console/.next/static/{a78dlby20rZF8ZnmPRYuF → mdxdjzB3-wk2MuucguEaJ}/_ssgManifest.js +0 -0
package/.next/standalone/packages/console/.next/static/chunks/{02_0efuv8zr04.js → 2ut57cu4zz5tr.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71567,e=>{"use strict";var t=e.i(56420);let s={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};s.node;let a=(0,t.default)(s);e.s(["Bot",0,a],71567)},24071,e=>{"use strict";var t=e.i(56420);let s={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};s.node;let a=(0,t.default)(s);e.s(["ChevronLeft",0,a],24071)},67927,e=>{"use strict";var t=e.i(56420);let s={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};s.node;let a=(0,t.default)(s);e.s(["ChevronRight",0,a],67927)},69644,69846,e=>{"use strict";var t=e.i(56420);let s={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};s.node;let a=(0,t.default)(s);e.s(["FolderOpen",0,a],69644);let n={name:"git-branch",size:24,node:[["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"}]]};n.node;let i=(0,t.default)(n);e.s(["GitBranch",0,i],69846)},11147,e=>{"use strict";var t=e.i(56420);let s={name:"octagon-pause",size:24,node:[["path",{d:"M10 15V9",key:"1lckn7"}],["path",{d:"M14 15V9",key:"1muqhk"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]],aliases:["pause-octagon"]};s.node;let a=(0,t.default)(s);e.s(["OctagonPause",0,a],11147)},66595,e=>{"use strict";var t=e.i(56420);let s={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};s.node;let a=(0,t.default)(s);e.s(["Search",0,a],66595)},41220,e=>{"use strict";var t=e.i(56420);let s={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};s.node;let a=(0,t.default)(s);e.s(["Server",0,a],41220)},19759,e=>{"use strict";var t=e.i(56420);let s={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};s.node;let a=(0,t.default)(s);e.s(["SquarePen",0,a],19759)},83035,e=>{"use strict";var t=e.i(56420);let s={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};s.node;let a=(0,t.default)(s);e.s(["SquareTerminal",0,a],83035)},94831,e=>{"use strict";var t=e.i(56420);let s={name:"unplug",size:24,node:[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]};s.node;let a=(0,t.default)(s);e.s(["Unplug",0,a],94831)},46980,e=>{"use strict";var t=e.i(43476),s=e.i(77821),a=e.i(5387),n=e.i(90437),i=e.i(14695),r=e.i(96676),l=e.i(49635),d=e.i(265),o=e.i(16634),c=e.i(17981),m=e.i(88393),u=e.i(67927),h=e.i(22016),x=e.i(66390),p=e.i(15905),g=e.i(78865),f=e.i(38614);function b({place:e}){return"ship"===e.kind?(0,t.jsx)("span",{className:"font-medium text-foreground",children:e.ship.name}):(0,t.jsx)(x.Badge,{variant:"type",children:e.type})}function j({group:e,notes:s,now:a}){let{cause:n,count:i,places:r}=e;return(0,t.jsxs)("section",{"aria-label":(0,g.statusLabel)(n),"data-testid":"health-cause","data-cause":n,className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4 shadow-sm max-sm:rounded-xl",children:[(0,t.jsxs)("header",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)(h.default,{href:(0,o.causePathOf)(n),className:"group inline-flex items-center gap-1.5 rounded-md","data-testid":"health-cause-open",children:[(0,t.jsx)(g.StatusBadge,{status:n}),(0,t.jsx)(u.ChevronRight,{"aria-hidden":!0,className:"size-(--size-icon-sm) text-muted-foreground group-hover:text-foreground"}),(0,t.jsxs)("span",{className:"sr-only",children:["Open the deliveries ",(0,g.statusLabel)(n).toLowerCase()]})]}),(0,t.jsx)("span",{className:"text-metric font-semibold tabular-nums text-foreground max-sm:text-title-touch",children:i})]}),(0,t.jsx)("p",{className:"text-body text-muted-foreground max-sm:text-body-touch",children:o.CAUSE_SENTENCES[n]}),(0,t.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_minmax(0,1.2fr)_auto] gap-x-4 max-sm:grid-cols-1",children:[(0,t.jsxs)("div",{className:"col-span-3 grid grid-cols-subgrid items-center text-caption font-medium text-muted-foreground max-sm:col-span-1",children:[(0,t.jsx)("span",{className:"max-sm:hidden",children:"Where, how long"}),(0,t.jsx)(f.WaitAxis,{}),(0,t.jsx)("span",{className:"text-right max-sm:hidden",children:"Next step"})]}),(0,t.jsx)("ul",{className:"col-span-3 grid grid-cols-subgrid divide-y divide-border max-sm:col-span-1",children:r.map(e=>{let n=(0,o.nextStepOf)(e),i=s.get(e),r=(0,l.duration)(new Date(e.oldestSince),a);return(0,t.jsxs)("li",{"data-testid":"health-place",className:"col-span-3 grid grid-cols-subgrid items-center gap-y-2 py-3 last:pb-0 max-sm:col-span-1",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)(b,{place:e.place}),(0,t.jsxs)("span",{className:"text-meta tabular-nums text-muted-foreground",children:[e.count," · oldest ",r]})]}),(0,t.jsx)(f.WaitStrip,{waits:e.deliveries.map(e=>(0,o.waitMinutes)(e.since,a)),label:`${String(e.count)} waiting, the oldest ${r}`}),(0,t.jsx)(p.Button,{variant:"secondary",size:"sm",nativeButton:!1,render:(0,t.jsx)(h.default,{href:n.href}),className:"max-sm:h-(--size-control-touch) max-sm:w-full max-sm:text-body-touch","data-testid":"health-next-step",children:n.label}),void 0!==i&&(0,t.jsx)("p",{className:"col-span-3 text-meta text-muted-foreground max-sm:col-span-1",children:i})]},`${e.cause}-${"ship"===e.place.kind?e.place.ship.id:e.place.type}`)})})]})]})}function v({perHour:e}){let s=Math.max(1,...e.map(e=>e.count));return(0,t.jsx)("div",{role:"img","aria-label":`Acknowledged per hour over the last 24 hours, at most ${Math.max(0,...e.map(e=>e.count))} in an hour`,"data-testid":"health-acknowledged-bars",className:"flex h-8 w-full items-end gap-0.5 sm:w-48",children:e.map(e=>(0,t.jsx)("span",{className:"min-h-0.5 flex-1 rounded-xs bg-tone-ok-fg opacity-75",style:{height:`${e.count/s*100}%`}},e.at))})}function w({acknowledged:e}){return(0,t.jsxs)("section",{"aria-label":"Delivering","data-testid":"health-delivering",className:"flex items-center gap-4 rounded-lg border border-border bg-card p-4 shadow-sm max-sm:flex-col max-sm:items-start max-sm:gap-3 max-sm:rounded-xl",children:[(0,t.jsx)(g.StatusBadge,{status:"delivering"}),(0,t.jsx)("p",{className:"flex-1 text-body text-foreground max-sm:text-body-touch",children:null===e.medianMs?"Nothing acknowledged in the last 24 h.":(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold tabular-nums",children:e.count})," acknowledged in the last 24 h, median"," ",(0,t.jsx)("span",{className:"font-semibold tabular-nums",children:(0,o.medianText)(e.medianMs,l.duration)})," from send to acknowledgement."]})}),(0,t.jsx)(v,{perHour:e.perHour})]})}function N({perHour:e,marks:s}){let a=Math.max(5,5*Math.ceil(Math.max(0,...e.map(e=>e.count))/5)),n=Math.max(e.length-1,1),i=e=>100-e/a*100,[r]=e,d=e.slice(1).map((e,t)=>`H${(t+1)/n*1e3} V${i(e.count)}`),o=[`M0 ${i(r?.count??0)}`,...d].join(" "),c=`${o} H1000 V100 H0 Z`,m=e.at(-1)?.count??0,u=e.flatMap((e,t)=>t%24==12?[{index:t,label:(0,l.dayMonth)(new Date(e.at))}]:[]);return(0,t.jsxs)("figure",{"data-testid":"health-trend",className:"flex min-w-0 flex-col gap-2",children:[(0,t.jsx)("figcaption",{className:"text-meta font-medium text-foreground",children:"Stuck deliveries, last 7 days, per hour"}),(0,t.jsxs)("div",{className:"grid grid-cols-[auto_1fr] gap-x-2",children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"relative h-36 w-5 text-caption tabular-nums text-muted-foreground",children:[a,a/2,0].map(e=>(0,t.jsx)("span",{className:"absolute right-0 -translate-y-1/2",style:{top:`${100-e/a*100}%`},children:e},e))}),(0,t.jsxs)("div",{className:"relative h-36",children:[(0,t.jsxs)("svg",{role:"img","aria-label":`Stuck deliveries per hour over the last 7 days: ${m} now, at most ${Math.max(0,...e.map(e=>e.count))}`,viewBox:"0 0 1000 100",preserveAspectRatio:"none",className:"size-full overflow-visible",children:[[0,a/2,a].map(e=>(0,t.jsx)("line",{x1:0,x2:1e3,y1:i(e),y2:i(e),className:"stroke-border",vectorEffect:"non-scaling-stroke"},e)),(0,t.jsx)("path",{d:c,className:"fill-tone-waiting-bg"}),(0,t.jsx)("path",{d:o,className:"fill-none stroke-tone-waiting-fg",strokeWidth:2,strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]}),s.map(s=>(0,t.jsx)("span",{"aria-hidden":!0,"data-testid":"health-trend-mark",className:"absolute flex size-4 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full border-2 border-foreground bg-card text-micro font-semibold text-foreground max-sm:hidden",style:{left:`${s.hour/n*100}%`,top:`${i(e[s.hour]?.count??0)/100*100}%`},children:s.number},s.number)),(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute size-2 -translate-1/2 rounded-full bg-tone-waiting-fg",style:{left:"100%",top:`${i(m)/100*100}%`}})]}),(0,t.jsx)("div",{"aria-hidden":!0,className:"relative col-start-2 h-4 text-caption text-muted-foreground",children:u.map(e=>(0,t.jsx)("span",{className:"absolute -translate-x-1/2 whitespace-nowrap max-sm:[&:nth-child(even)]:hidden",style:{left:`${e.index/n*100}%`},children:e.label},e.index))})]}),s.length>0&&(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:s.map((e,s)=>(0,t.jsxs)("span",{children:[s>0&&" · ",(0,t.jsx)("span",{className:"font-semibold text-foreground",children:e.number})," ",e.label]},e.number))})]})}function y({health:e}){let s=(0,o.verdictOf)(e);return(0,t.jsxs)("section",{"aria-label":"Verdict","data-testid":"health-verdict","data-verdict":s.kind,className:"grid gap-6 rounded-lg border border-border bg-card p-4 shadow-sm lg:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] max-sm:gap-4 max-sm:rounded-xl",children:[(0,t.jsxs)("div",{className:"flex flex-col items-start gap-3",children:[(0,t.jsx)(g.StatusBadge,{status:s.kind}),"stuck"===s.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-section font-semibold text-foreground",children:[(0,t.jsx)("span",{className:"text-metric tabular-nums max-sm:text-title-touch","data-testid":"health-stuck-count",children:s.count})," ",1===s.count?"delivery":"deliveries"," stuck in ",s.places," ",1===s.places?"place":"places"]}),(0,t.jsxs)("p",{className:"text-body text-muted-foreground max-sm:text-body-touch",children:["Stuck since ",(0,l.shortDateTime)(new Date(s.since)),". ",(0,o.trendSentence)(s)]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Nothing is lost: each one is stored and moves on as soon as its cause is gone."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-section font-semibold text-foreground",children:"Delivering. Nothing is stuck."}),(0,t.jsx)("p",{className:"text-body text-muted-foreground max-sm:text-body-touch",children:"Every delivery waits only on its ship to take it."})]})]}),(0,t.jsx)(N,{perHour:e.stuckPerHour,marks:(0,o.marksOf)(e)})]})}var k=e.i(41220);function S({machines:e,stuckByMachine:s,renderLiveness:a}){return(0,t.jsxs)("section",{"aria-labelledby":"health-machines","data-testid":"health-machines",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4 shadow-sm max-sm:rounded-xl",children:[(0,t.jsxs)("header",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("h2",{id:"health-machines",className:"text-section font-semibold text-foreground",children:"Machines"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Each machine runs a trierarch that crews ships."})]}),(0,t.jsx)("ul",{className:"flex flex-col divide-y divide-border",children:e.map(e=>{let n=s.get(e.id)??0;return(0,t.jsxs)("li",{"data-testid":"health-machine",className:"flex items-center gap-4 py-3 first:pt-0 last:pb-0 max-sm:flex-wrap max-sm:gap-2",children:[(0,t.jsxs)("span",{className:"inline-flex min-w-40 items-center gap-2 font-medium text-foreground",children:[(0,t.jsx)(k.Server,{"aria-hidden":!0,className:"size-(--size-icon) text-muted-foreground"}),e.name]}),(0,t.jsx)("span",{className:"min-w-0 flex-1",children:a(e)}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:[e.ships," ",1===e.ships?"ship":"ships",n>0&&(0,t.jsxs)(t.Fragment,{children:[" · ",(0,t.jsxs)("span",{className:"font-semibold text-foreground",children:[n," ",1===n?"delivery":"deliveries"," stuck on its ships"]})]})]}),n>0&&(0,t.jsx)(p.Button,{variant:"secondary",size:"sm",nativeButton:!1,render:(0,t.jsx)(h.default,{href:`/trierarchs/${e.id}`}),className:"max-sm:h-(--size-control-touch) max-sm:w-full",children:"Open machine"})]},e.id)})})]})}function C({state:e,health:s,onRetry:a,notes:n,machines:i,renderLiveness:r,children:l,now:d}){if("error"===e)return(0,t.jsx)(c.InlineError,{variant:"page",title:"Couldn’t load the fleet’s health",description:"Nothing changed in the fleet. The page tries again by itself.",onRetry:a});if("loading"===e||void 0===s)return(0,t.jsx)(m.LoadingSkeleton,{variant:"cards",rows:4,label:"Loading the fleet’s health"});let u=(0,o.causeGroupsOf)(s);return(0,t.jsxs)("div",{"data-testid":"health-board",className:"flex flex-col gap-5 max-sm:gap-3.5",children:[(0,t.jsx)(y,{health:s}),(0,t.jsx)(w,{acknowledged:s.acknowledged}),u.length>0&&(0,t.jsx)("div",{className:"grid gap-5 lg:grid-cols-2 max-sm:gap-3.5",children:u.map(e=>(0,t.jsx)(j,{group:e,notes:n,now:d},e.cause))}),void 0!==i&&i.length>0&&(0,t.jsx)(S,{machines:i,stuckByMachine:(0,o.stuckByMachine)(s),renderLiveness:r}),l]})}function $({renderLiveness:e,children:s}){let c=(0,r.useNow)(),m=(0,n.useFleetHealth)(),u=(0,a.useFleetSnapshot)(),h=(0,d.useMachines)(),x=u.data??[],p=new Map(x.map(e=>[e.id,e])),g=new Map;for(let e of m.data?.stuck??[]){let t="ship"===e.place.kind?p.get(e.place.ship.id):void 0,s=(0,o.placeNote)(e,{facts:t&&{lastSeenAt:t.lastSeenAt},since:e=>(0,l.relativeTime)(e,c)});null!==s&&g.set(e,s)}let f=new Map((h.data??[]).map(e=>[e.shipId,e])),b=h.data?.map(e=>({id:e.shipId,name:e.name,ships:(0,i.spotsOf)(e,x).length}));return(0,t.jsx)(C,{state:m.isError?"error":m.data?"ready":"loading",health:m.data,onRetry:()=>{m.refetch()},notes:g,machines:b,renderLiveness:t=>{let s=f.get(t.id);return void 0===s?null:e(s)},now:c,children:s})}var z=e.i(84294),M=e.i(19249),T=e.i(81830),R=e.i(1935);function A({members:e,ships:s,now:a,renderAction:n}){return(0,t.jsx)("ul",{"data-testid":"silent-members",className:"divide-y divide-border overflow-hidden rounded-lg border border-border",children:e.map(({squadronId:e,member:i})=>{let{lastSeenAt:r}=i.crew;return(0,t.jsxs)("li",{"data-testid":"silent-member",className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 px-3 py-2.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(M.HealthIndicator,{health:"silent"}),(0,t.jsx)("span",{className:"font-medium",children:i.name})]}),(0,t.jsx)(R.SquadronTag,{squadronId:e,role:i.role,size:"sm"})]}),(0,t.jsxs)("span",{className:"flex flex-col text-meta",children:[(0,t.jsx)("span",{children:null===r?"never seen":`not seen for ${(0,l.duration)(new Date(r),a)}`}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["checks in ",(0,z.checkInText)(i.checkInMinutes)]})]}),(0,t.jsx)("span",{className:"grow",children:(0,t.jsx)(T.ReportLine,{report:s.get(i.shipId)?.report??null,now:a,variant:"row",testId:"silent-member-report"})}),n?.({squadronId:e,member:i}),(0,t.jsxs)(h.default,{href:`/squadrons/${e}`,className:"inline-flex items-center gap-1 text-meta font-medium hover:underline",children:["Open",(0,t.jsx)(u.ChevronRight,{"aria-hidden":!0,className:"size-(--size-icon-sm)"})]})]},i.shipId)})})}var O=e.i(15327),I=e.i(36556),D=e.i(90262),L=e.i(87964),q=e.i(18423),E=e.i(78485),B=e.i(53573),H=e.i(48695);e.s(["default",0,function(){let e=(0,r.useNow)(),i=(0,L.useConsoleFrame)(),l=(0,q.useLiveFleet)(),d=(0,n.useFleetHealth)(),o=(0,D.useAccess)(),c=(0,H.useSquadrons)(),m=(0,z.silentMembers)(c.data??[]),u=(0,B.useShips)(m.map(({member:e})=>e.shipId)),h=new Map(((0,a.useFleetSnapshot)().data??[]).map(e=>[e.id,e]));return(0,E.useSignInWhenSessionEnds)([d.error,l.error]),(0,t.jsx)(s.ListPage,{...i,title:"Health",description:"Where deliveries wait, since when, and what lets them move.",live:l.live,children:(0,t.jsx)($,{renderLiveness:s=>(0,t.jsx)(I.MachineLiveness,{machine:s,now:e}),children:m.length>0?(0,t.jsxs)("section",{"aria-labelledby":"health-silent",className:"flex flex-col gap-2",children:[(0,t.jsxs)("h2",{id:"health-silent",className:"text-section font-semibold text-foreground",children:["Silent members (",m.length,")"]}),(0,t.jsx)(A,{members:m,ships:h,now:e,renderAction:o.canManage?({squadronId:e,member:s})=>(0,t.jsx)(O.GetNewCrewLine,{squadronId:e,member:s,ship:u.get(s.shipId),isPrimary:!0,testId:"silent-member-new-crew-line"}):void 0}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"A member is silent after 3 missed check-ins; only you can start its new session. Late members and blocked reports stay on their squadron page."})]}):null})})}],46980)},36651,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Kbd",0,function({className:e,...a}){return(0,t.jsx)("kbd",{"data-slot":"kbd",className:(0,s.classNames)("inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-xs border border-border bg-muted px-1.25 font-sans text-micro font-medium text-muted-foreground max-sm:hidden",e),...a})}])},19321,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Skeleton",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"skeleton","aria-hidden":!0,className:(0,s.classNames)("animate-pulse rounded-sm bg-secondary [animation-duration:var(--duration-pulse)] motion-reduce:animate-none",e),...a})}])},19249,e=>{"use strict";var t=e.i(43476),s=e.i(90063);let a={"on-time":{label:"On time",dot:"bg-tone-ok-fg",text:"text-tone-ok-fg"},late:{label:"Late",dot:"bg-tone-waiting-fg",text:"text-tone-waiting-fg"},silent:{label:"Silent",dot:"bg-tone-attention-fg",text:"text-tone-attention-fg"},"standing-down":{label:"Standing down",dot:"bg-tone-active-fg",text:"text-tone-active-fg"},"not-on-station":{label:"Not on station",dot:"border border-dashed border-muted-foreground",text:"text-foreground"}};function n({health:e}){return(0,t.jsx)("span",{"aria-hidden":!0,className:(0,s.classNames)("size-2 shrink-0 rounded-full",a[e].dot)})}e.s(["HealthIndicator",0,function({health:e,detail:i,className:r}){return(0,t.jsxs)("span",{"data-slot":"health-indicator","data-health":e,className:(0,s.classNames)("inline-flex items-center gap-1.5 text-meta",r),children:[(0,t.jsx)(n,{health:e}),(0,t.jsx)("span",{className:(0,s.classNames)("font-medium",a[e].text),children:a[e].label}),void 0!==i&&(0,t.jsx)("span",{className:"text-muted-foreground",children:i})]})},"HealthSummary",0,function({counts:e,className:i}){return(0,t.jsx)("span",{"data-slot":"health-summary",className:(0,s.classNames)("inline-flex flex-wrap items-center gap-x-3 gap-y-1 text-meta",i),children:e.map(({health:e,count:s})=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(n,{health:e}),(0,t.jsxs)("span",{children:[s," ",a[e].label.toLowerCase()]})]},e))})}])},88393,e=>{"use strict";var t=e.i(43476),s=e.i(90063),a=e.i(19321);function n(e){return Array.from({length:e},(e,t)=>`row-${String(t)}`)}e.s(["LoadingSkeleton",0,function({variant:e,rows:i=4,label:r="Loading",className:l}){return(0,t.jsxs)("div",{role:"status","data-slot":"loading-skeleton","data-variant":e,className:(0,s.classNames)("w-full",l),children:[(0,t.jsx)("span",{className:"sr-only",children:r}),"table"===e?(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border border-border bg-card shadow-sm",children:[(0,t.jsx)("div",{className:"h-(--size-row-header) border-b border-border bg-muted"}),n(i).map(e=>(0,t.jsxs)("div",{className:"flex h-(--size-row) items-center gap-8 border-b border-border px-4 last:border-0",children:[(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-24"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-16"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-28"})]},e))]}):null,"cards"===e?(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:n(4).map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-20"}),(0,t.jsx)(a.Skeleton,{className:"h-6 w-10"}),(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-28"})]},e))}):null,"detail"===e?(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(a.Skeleton,{className:"h-7 w-48"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(a.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(a.Skeleton,{className:"h-16 w-full rounded-lg"})]}):null,"list"===e?(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border border-border bg-card",children:n(i).map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 border-b border-border px-3.5 py-3 last:border-0",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)(a.Skeleton,{className:"h-3 w-28"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-44"})]},e))}):null]})}])},63481,e=>{"use strict";var t=e.i(43476),s=e.i(56420);let a={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};a.node;let n=(0,s.default)(a);var i=e.i(71567);let r={name:"cloud",size:24,node:[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]};r.node;let l=(0,s.default)(r),d={name:"laptop",size:24,node:[["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"}]]};d.node;let o=(0,s.default)(d),c={name:"map-pin",size:24,node:[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]};c.node;let m=(0,s.default)(c),u={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};u.node;let h=(0,s.default)(u);var x=e.i(41220),p=e.i(83035),g=e.i(94831),f=e.i(90063),b=e.i(66616),j=e.i(40798);let v={DEVICE:o,CLOUD:l,SERVER:x.Server,OTHER:m},w={coding:p.SquareTerminal,chat:h,bot:i.Bot,console:n},N={md:"text-body",sm:"text-meta"};e.s(["LocationTag",0,function({kind:e,description:s=null,harness:a=null,isCompact:n=!1,size:i="md",className:r}){let l=(0,f.classNames)("inline-flex min-w-0 items-center gap-1.5 text-muted-foreground [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",N[i],r);if(null===e)return(0,t.jsxs)("span",{"data-slot":"location-tag",className:l,children:[(0,t.jsx)(g.Unplug,{"aria-hidden":!0}),"No session"]});let d=v[e],o=(0,j.locationKindWord)(e),c=null===s?o:`${o} \xb7 ${s}`;if(null!==a){let e=(0,b.harnessKind)(a),n=void 0===e?void 0:w[e],i=(0,b.harnessWord)(a);return(0,t.jsxs)("span",{"data-slot":"location-tag",className:l,title:null===s?`${i} \xb7 ${o}`:`${i} \xb7 ${o}: ${s}`,children:[void 0===n?null:(0,t.jsx)(n,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate text-foreground",children:i}),(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}),(0,t.jsx)(d,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:o}),null===s?null:(0,t.jsxs)("span",{className:"sr-only",children:[": ",s]})]})}return n?(0,t.jsxs)("span",{"data-slot":"location-tag",className:l,title:c,children:[(0,t.jsx)(d,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"sr-only",children:[o,": "]}),(0,t.jsx)("span",{className:"truncate text-foreground",children:s??o})]}):(0,t.jsxs)("span",{"data-slot":"location-tag",className:l,children:[(0,t.jsx)(d,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:[o,null===s?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,children:" · "}),(0,t.jsx)("span",{className:"sr-only",children:", "}),(0,t.jsx)("span",{className:"text-foreground",children:s})]})]})]})}],63481)},81830,e=>{"use strict";var t=e.i(43476),s=e.i(79432),a=e.i(19002),n=e.i(11147),i=e.i(90063),r=e.i(49635),l=e.i(93361);let d={working:s.Activity,blocked:n.OctagonPause,idle:a.CirclePause},o={active:"text-tone-active-fg",waiting:"text-tone-waiting-fg",ended:"text-tone-ended-fg"};e.s(["ReportLine",0,function({report:e,now:s,variant:a,isTimeInTitle:n=!1,testId:c}){let m="full"===a,u=(0,i.classNames)("flex min-w-0 items-center gap-1.5",m?"text-body":"text-meta");if(null===e)return(0,t.jsx)("span",{"data-testid":c,"data-state":"none",className:(0,i.classNames)(u,"text-muted-foreground"),children:"No report yet"});let h=d[e.state],x=o[l.REPORT_TONES[e.state]],p=new Date(e.reportedAt);return(0,t.jsxs)("span",{"data-testid":c,"data-state":e.state,title:n?`${(0,l.reportText)(e)} \xb7 ${(0,l.reportedWhen)(p,s)}`:(0,l.reportText)(e),className:u,children:[(0,t.jsx)(h,{"aria-hidden":!0,className:(0,i.classNames)("size-(--size-icon-sm) shrink-0",x)}),(0,t.jsx)("span",{className:(0,i.classNames)("shrink-0 font-medium",x),children:l.REPORT_STATE_WORDS[e.state]}),null===e.note?null:(0,t.jsx)("span",{className:"min-w-0 truncate text-foreground",children:e.note}),n?null:(0,t.jsx)("time",{dateTime:e.reportedAt,title:(0,r.fullDateTime)(p),className:"shrink-0 text-muted-foreground tabular-nums",children:m?`\xb7 ${(0,l.reportedWhen)(p,s)}`:(0,l.reportAge)(p,s)})]})}])},1935,e=>{"use strict";var t=e.i(43476),s=e.i(60011),a=e.i(22016),n=e.i(90063);e.s(["SquadronTag",0,function({squadronId:e,role:i,size:r="md",className:l}){return(0,t.jsxs)(a.default,{href:`/squadrons/${e}`,"data-slot":"squadron-tag",className:(0,n.classNames)("inline-flex max-w-full items-center gap-1 rounded-sm bg-secondary px-1.5 text-secondary-foreground hover:underline [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0","sm"===r?"h-5.5 text-meta":"h-6 text-body",l),children:[(0,t.jsx)(s.Shapes,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate font-medium",children:e}),void 0!==i&&(0,t.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:["· ",i]})]})}])},77880,85538,e=>{"use strict";var t=e.i(43476),s=e.i(67927),a=e.i(66595),n=e.i(19759),i=e.i(22016),r=e.i(15905),l=e.i(36651),d=e.i(90063);let o={live:{label:"Live",dot:"bg-tone-ok-fg"},reconnecting:{label:"Reconnecting",dot:"bg-tone-waiting-fg"},offline:{label:"Offline",dot:"bg-tone-attention-fg"}};function c({state:e,className:s}){let{label:a,dot:n}=o[e];return(0,t.jsxs)("span",{"data-slot":"live-status","data-state":e,"aria-live":"polite",className:(0,d.classNames)("inline-flex items-center gap-1.5 text-meta text-muted-foreground",s),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,d.classNames)("size-2 shrink-0 rounded-full",n)}),a]})}e.s(["Header",0,function({breadcrumb:e,parents:d=[],live:o,onCompose:m,onSearch:u}){return(0,t.jsxs)("header",{"data-slot":"header",className:"sticky top-0 z-30 hidden h-(--size-header) shrink-0 items-center justify-between gap-4 border-b border-border bg-background px-6 sm:flex",children:[(0,t.jsx)("nav",{"aria-label":"Breadcrumb","data-testid":"header-breadcrumb",className:"min-w-0 text-body",children:(0,t.jsxs)("ol",{className:"flex min-w-0 items-center gap-1.5",children:[d.map(e=>(0,t.jsxs)("li",{className:"flex shrink-0 items-center gap-1.5",children:[(0,t.jsx)(i.default,{href:e.href,className:"text-muted-foreground hover:text-foreground hover:underline",children:e.label}),(0,t.jsx)(s.ChevronRight,{"aria-hidden":!0,className:"size-3.5 text-muted-foreground"})]},e.href)),(0,t.jsx)("li",{"aria-current":"page",className:"truncate font-medium text-foreground",children:e})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(c,{state:o}),u?(0,t.jsxs)(r.Button,{size:"sm",icon:(0,t.jsx)(a.Search,{"aria-hidden":!0}),"data-testid":"header-search",className:"w-60 justify-start font-normal text-muted-foreground",onClick:u,children:[(0,t.jsx)("span",{className:"grow text-left",children:"Search ships or jump to"}),(0,t.jsx)(l.Kbd,{children:"⌘K"})]}):null,m?(0,t.jsx)(r.Button,{size:"sm",icon:(0,t.jsx)(n.SquarePen,{"aria-hidden":!0}),"data-testid":"header-compose",onClick:m,children:"Compose"}):null]})]})}],77880);var m=e.i(24071),u=e.i(57957);e.s(["TopBar",0,function({title:e,live:s,actions:n,back:l,account:d,onSearch:o}){let h=o&&!l?o:void 0;return(0,t.jsxs)("header",{"data-slot":"top-bar","data-mode":l?"detail":"root",className:"sticky top-0 z-30 flex h-(--size-header) items-center gap-2.5 border-b border-border bg-background px-4 sm:hidden",children:[l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(i.default,{href:l.href,className:"-ml-1.5 inline-flex h-(--size-control-touch) shrink-0 items-center gap-0.5 rounded-md pr-2 text-body-touch text-foreground focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon)",children:[(0,t.jsx)(m.ChevronLeft,{"aria-hidden":!0}),l.label]}),(0,t.jsx)("p",{className:"min-w-0 flex-1 truncate text-center text-body-touch font-semibold text-foreground",children:e})]}):(0,t.jsx)("h1",{className:"truncate text-title-touch font-semibold tracking-tight text-foreground",children:e}),(0,t.jsx)(c,{state:s}),n||h||d&&!l?(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[h?(0,t.jsx)(r.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Search ships or jump to","data-testid":"top-bar-search",onClick:h,children:(0,t.jsx)(a.Search,{"aria-hidden":!0})}):null,n,d&&!l?(0,t.jsx)(u.AccountMenuSheet,{...d}):null]}):null]})}],85538)},77821,e=>{"use strict";var t=e.i(43476),s=e.i(19759),a=e.i(15905),n=e.i(77880),i=e.i(85538);e.s(["ListPage",0,function({title:e,description:r,titleMeta:l,primaryAction:d,toolbar:o,live:c,onCompose:m,onSearch:u,account:h,banner:x,phoneTopBar:p,children:g}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.Header,{breadcrumb:e,live:c,onCompose:m,onSearch:u}),x,p??(0,t.jsx)(i.TopBar,{title:e,live:c,account:h,onSearch:u,actions:m?(0,t.jsx)(a.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Compose","data-testid":"top-bar-compose",onClick:m,children:(0,t.jsx)(s.SquarePen,{"aria-hidden":!0})}):void 0}),(0,t.jsxs)("main",{className:"flex grow flex-col gap-5 px-8 py-6 max-sm:gap-3.5 max-sm:px-4 max-sm:pt-3.5 max-sm:pb-[calc(var(--size-tabbar)+var(--spacing)*4)]",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 max-sm:gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1",children:[(0,t.jsx)("h1",{className:"text-title font-semibold tracking-tight text-foreground max-sm:hidden",children:e}),l]}),r?(0,t.jsx)("p",{className:"text-meta text-muted-foreground max-sm:text-body-touch",children:r}):null]}),d?(0,t.jsx)("div",{className:"shrink-0 max-sm:w-full max-sm:[&>*]:w-full",children:d}):null]}),o,g]})]})}])},16634,38614,e=>{"use strict";let t=["noShipCanTake","waitingForCrew","stalledInFlight","undeliverable"];function s(e){return`/fleet-health/${e}`}function a(e){return"ship"===e.kind?e.ship.name:e.type}let n={noShipCanTake:"no ship can take",waitingForCrew:"waiting for crew",stalledInFlight:"stalled in flight",undeliverable:"undeliverable"},i=[{minutes:1,label:"1 min"},{minutes:10,label:"10 min"},{minutes:60,label:"1 h"},{minutes:1440,label:"1 d"},{minutes:10080,label:"7 d"}],r=Math.log(1),l=Math.log(10080);function d(e){return Math.min(Math.max((Math.log(Math.max(e,1))-r)/(l-r),0),1)}let o={pending:"pending",received:"received",handed:"handed (pulled)",undeliverable:"undeliverable"};e.s(["CAUSE_SENTENCES",0,{noShipCanTake:"Sent to a type with no active ship. Waits until you commission one.",waitingForCrew:"Sent to a ship no session crews. Waits until it is crewed.",stalledInFlight:"Taken by a session that went quiet. Waits until it acknowledges or the ship is released.",undeliverable:"Taken five times, never acknowledged. Waits for you to resend or dismiss."},"WAIT_TICKS",0,i,"causeGroupsOf",0,function(e){return t.flatMap(t=>{let s=e.stuck.filter(e=>e.cause===t).toSorted((e,t)=>e.oldestSince.localeCompare(t.oldestSince));return 0===s.length?[]:[{cause:t,count:s.reduce((e,t)=>e+t.count,0),places:s}]})},"causePathOf",0,s,"marksOf",0,function(e){let[t]=e.stuckPerHour;return void 0===t?[]:e.stuck.filter(e=>e.oldestSince>t.at).toSorted((e,t)=>e.oldestSince.localeCompare(t.oldestSince)).map((t,s)=>({number:s+1,hour:e.stuckPerHour.findIndex(e=>e.at>=t.oldestSince),label:`${a(t.place)}: ${n[t.cause]}`}))},"medianText",0,function(e,t){let s=Math.round(e/1e3);return s<60?`${String(s)} s`:t(new Date(0),new Date(e))},"messagePathOn",0,function(e,t){return`/ships/${e}?tab=messages&message=${t}`},"nextStepOf",0,function(e){let t=e.place;switch(e.cause){case"noShipCanTake":return{label:`Commission a ${a(t)}`,href:"/?commission=new"};case"waitingForCrew":return"ship"===t.kind?{label:"Get starting prompt",href:`/ships/${t.ship.id}`}:{label:"Open ships of type",href:`/?type=${encodeURIComponent(t.type)}`};case"stalledInFlight":if("ship"===t.kind&&null!==t.machine)return{label:"Open machine",href:`/trierarchs/${t.machine.id}`};return"ship"===t.kind?{label:"Open ship",href:`/ships/${t.ship.id}`}:{label:"Open ships of type",href:`/?type=${encodeURIComponent(t.type)}`};case"undeliverable":return{label:"Resend or dismiss",href:s("undeliverable")}}},"placeName",0,a,"placeNote",0,function(e,t){let s=e.place;if("stalledInFlight"!==e.cause||"ship"!==s.kind)return null;let a=[...new Set(e.deliveries.map(e=>o[e.state]))].join(", ");if(null!==s.machine){let e=null===s.machine.lastSeenAt?"never seen":`last seen ${t.since(new Date(s.machine.lastSeenAt))}`;return`${a}, machine ${s.machine.name} ${e}`}let n=t.facts?.lastSeenAt??null;return null===n?a:`${a}, session last seen ${t.since(new Date(n))}`},"previewOf",0,function(e){return e.split("\n",1)[0]?.trim()??""},"stuckByMachine",0,function(e){let t=new Map;for(let s of e.stuck)"ship"===s.place.kind&&null!==s.place.machine&&t.set(s.place.machine.id,(t.get(s.place.machine.id)??0)+s.count);return t},"trendSentence",0,function(e){return e.count>e.dayAgo?`Up from ${String(e.dayAgo)} a day ago.`:e.count<e.dayAgo?`Down from ${String(e.dayAgo)} a day ago.`:"As many as a day ago."},"verdictOf",0,function(e){let[t]=e.stuck.map(e=>e.oldestSince).toSorted();if(void 0===t)return{kind:"delivering"};let s=e.stuckPerHour.at(-25)?.count??0;return{kind:"stuck",count:e.stuck.reduce((e,t)=>e+t.count,0),places:e.stuck.length,since:t,dayAgo:s}},"waitMinutes",0,function(e,t){return Math.max(0,(t.getTime()-Date.parse(e))/6e4)},"waitPosition",0,d],16634);var c=e.i(43476),m=e.i(90063);function u(e){return`${100*d(e)}%`}e.s(["WaitAxis",0,function({className:e}){return(0,c.jsx)("div",{"aria-hidden":!0,className:(0,m.classNames)("relative h-4 w-full text-micro text-muted-foreground",e),children:i.map((e,t)=>(0,c.jsx)("span",{className:(0,m.classNames)("absolute whitespace-nowrap",0===t?"":t===i.length-1?"-translate-x-full":"-translate-x-1/2"),style:{left:u(e.minutes)},children:e.label},e.minutes))})},"WaitStrip",0,function({waits:e,label:t,className:s}){let a=Math.max(0,...e);return(0,c.jsxs)("div",{role:"img","aria-label":t,"data-testid":"health-wait-strip",className:(0,m.classNames)("relative h-4 w-full",s),children:[(0,c.jsx)("span",{"aria-hidden":!0,className:"absolute inset-y-0 rounded-xs bg-muted",style:{left:u(10),right:`calc(100% - ${u(60)})`}}),(0,c.jsx)("span",{"aria-hidden":!0,className:"absolute inset-x-0 top-1/2 h-px bg-border"}),i.map(e=>(0,c.jsx)("span",{"aria-hidden":!0,className:"absolute top-1/4 h-1/2 w-px bg-border",style:{left:u(e.minutes)}},e.minutes)),(0,c.jsx)("span",{"aria-hidden":!0,className:"absolute top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-foreground opacity-35",style:{left:0,width:u(a)}}),e.map((e,t)=>(0,c.jsx)("span",{"aria-hidden":!0,className:"absolute top-1/2 size-2.5 -translate-1/2 rounded-full border-2 border-card bg-foreground",style:{left:u(e)}},`${e}-${String(t)}`))]})}],38614)},15385,e=>{"use strict";var t=e.i(43476),s=e.i(90063),a=e.i(14695);let n={running:"bg-tone-ok-fg",crewing:"bg-tone-active-fg",releasing:"bg-tone-active-fg",restarting:"bg-tone-waiting-fg",crashed:"bg-tone-attention-fg"};e.s(["CapacityBar",0,function({spots:e,caps:i,unknownText:r="Unknown",testId:l}){let d=(0,a.capacityLine)(e,i);if(void 0===i||void 0===d)return(0,t.jsx)("span",{"data-testid":l,className:"text-meta text-muted-foreground",children:r});let o=Math.max(0,i.ships-e.length);return(0,t.jsxs)("span",{role:"img","aria-label":d,"data-testid":l,className:"inline-flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsxs)("span",{"aria-hidden":!0,className:"inline-flex shrink-0 gap-0.5",children:[e.map((e,a)=>(0,t.jsx)("span",{title:`Spot ${String(a+1)}: ${e.name}, ${e.status}`,className:(0,s.classNames)("h-2 w-3 rounded-xs",n[e.status])},e.shipId)),Array.from({length:o},(s,a)=>(0,t.jsx)("span",{title:`Spot ${String(e.length+a+1)}: vacant`,className:"h-2 w-3 rounded-xs border border-input"},`free-${String(a)}`))]}),(0,t.jsx)("span",{className:"text-meta tabular-nums",children:d})]})}])},36556,e=>{"use strict";var t=e.i(43476),s=e.i(71567),a=e.i(52886),n=e.i(69644),i=e.i(69846),r=e.i(86875),l=e.i(66787),d=e.i(22016),o=e.i(66616),c=e.i(14695),m=e.i(49635),u=e.i(66390),h=e.i(15385),x=e.i(63481);let p={alive:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",silent:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg","not-started":"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg"},g={alive:"Alive",silent:"Not answering","not-started":"Not started"};function f({machine:e,now:s}){let n=(0,c.machineLiveness)(e),i=null===e.lastSeenAt?null:new Date(e.lastSeenAt);return(0,t.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-x-2 gap-y-1 text-meta","data-testid":"machine-liveness","data-liveness":n,children:[(0,t.jsxs)(u.Badge,{variant:"outline",className:p[n],children:["alive"===n?(0,t.jsx)(r.ShipWheel,{"aria-hidden":!0}):(0,t.jsx)(a.CircleDashed,{"aria-hidden":!0}),g[n]]}),null===i?(0,t.jsx)("span",{className:"text-muted-foreground",children:"· run its setup line on the machine"}):(0,t.jsxs)("time",{dateTime:e.lastSeenAt??void 0,title:(0,m.fullDateTime)(i),className:"text-muted-foreground tabular-nums",children:["· ","silent"===n?`since ${(0,m.clockTime)(i)}`:(0,m.lastSeen)(i,s).replace("Last seen","seen")]})]})}function b(e,t){let s=(0,m.relativeTime)(e,t);return"Just now"===s?"just now":s}function j({title:e,children:s,className:a}){return(0,t.jsxs)("div",{className:`flex min-w-0 flex-col gap-2 px-4.5 py-4 ${a??""}`,children:[(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:e}),s]})}function v({harness:e,now:a}){let n=(0,o.harnessDetection)(e,a);return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border py-2.5 first-of-type:border-t-0 first-of-type:pt-0",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-body font-medium [&_svg]:size-(--size-icon-sm) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(s.Bot,{"aria-hidden":!0}),(0,o.harnessWord)(e.harness),void 0===n?null:(0,t.jsx)("span",{className:"font-normal text-meta text-muted-foreground",children:n})]}),(0,c.harnessOptions)(e.options).map(e=>(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-meta",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e.name}),e.values.map(s=>(0,t.jsxs)("span",{className:"font-mono text-id whitespace-nowrap",children:[s,s===e.defaultValue?(0,t.jsx)("span",{className:"font-sans text-muted-foreground",children:" (default)"}):null]},s))]},e.name)),0===e.flags.length?null:(0,t.jsx)("span",{className:"flex flex-wrap items-center gap-1.5",children:e.flags.map(s=>e.riskyFlags?.includes(s)===!0?(0,t.jsxs)("code",{"data-testid":"machine-risky-flag",title:"Risky: every launch runs without its harness's safeguards",className:"inline-flex items-center gap-1 rounded-sm border border-tone-waiting-border bg-tone-waiting-bg px-1.5 font-mono text-id text-tone-waiting-fg [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(l.TriangleAlert,{"aria-hidden":!0}),s,(0,t.jsx)("span",{className:"sr-only",children:" (risky)"})]},s):(0,t.jsx)("code",{className:"rounded-sm bg-muted px-1.5 font-mono text-id",children:s},s))})]})}function w({title:e,icon:s,names:a}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-caption text-muted-foreground",children:e}),0===a.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"None"}):a.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[s,e]},e))]})}function N({workspaces:e}){return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(w,{title:"Repositories · a new worktree per ship",icon:(0,t.jsx)(i.GitBranch,{"aria-hidden":!0}),names:e.repositories}),(0,t.jsx)(w,{title:"Folders · used as they are",icon:(0,t.jsx)(n.FolderOpen,{"aria-hidden":!0}),names:e.folders})]})}e.s(["HarnessOffer",0,v,"MachineCard",0,function({machine:e,spots:s,location:a,now:n}){let{details:i,report:l}=e,o=null===l?null:new Date(l.reportedAt);return(0,t.jsxs)("section",{"aria-label":e.name,"data-testid":"machine-card",className:"grid grid-cols-[minmax(0,18.75rem)_minmax(0,1.25fr)_minmax(0,1fr)] divide-x divide-border rounded-lg border border-border bg-card shadow-sm max-lg:grid-cols-1 max-lg:divide-x-0 max-lg:divide-y",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-2.5 px-4.5 py-4",children:[(0,t.jsxs)(d.default,{href:`/trierarchs/${e.shipId}`,"data-testid":"machine-card-name",className:"inline-flex items-center gap-2 text-section font-semibold hover:underline [&_svg]:size-(--size-icon) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(r.ShipWheel,{"aria-hidden":!0}),e.name]}),(0,t.jsx)(f,{machine:e,now:n}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(x.LocationTag,{kind:a?.kind??null,description:a?.description}),null===i?null:(0,t.jsxs)("span",{className:"font-mono text-id",children:["· trierarch ",i.version]})]}),(0,t.jsx)("div",{role:"separator",className:"h-px bg-border"}),(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:"Capacity"}),(0,t.jsx)(h.CapacityBar,{spots:s,caps:i?.caps,testId:"machine-card-capacity",unknownText:null===o?"Unknown until it answers":`Unknown since ${(0,m.clockTime)(o)}`}),null===o?null:(0,t.jsxs)("time",{dateTime:l?.reportedAt,title:(0,m.fullDateTime)(o),className:"text-meta text-muted-foreground",children:["Last answer ",b(o,n)]})]}),(0,t.jsx)(j,{title:"Harnesses, options and flags",children:null===i?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):i.harnesses.map(e=>(0,t.jsx)(v,{harness:e,now:n},e.harness))}),(0,t.jsx)(j,{title:"Workspaces",children:null===i?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):(0,t.jsx)(N,{workspaces:i.workspaces})})]})},"MachineLiveness",0,f,"WorkspaceOffer",0,N,"lastAnswer",0,b])},66616,e=>{"use strict";var t=e.i(49635);let s={"claude-code":{word:"Claude Code",kind:"coding"},codex:{word:"Codex",kind:"coding"},"claude-chat":{word:"Claude chat",kind:"chat"},chatgpt:{word:"ChatGPT",kind:"chat"},grok:{word:"Grok",kind:"chat"},grokbot:{word:"Grokbot",kind:"bot"},console:{word:"Console",kind:"console"}};function a(e){return s[e]?.word??e}e.s(["crewLineHarnessWord",0,function(e){return"chat"===e?"Chat":a(e)},"harnessDetection",0,function(e,s){if(void 0===e.version)return;if(void 0===e.modelsConfirmedAt||null===e.modelsConfirmedAt)return`${e.version} \xb7 no model confirmed`;let a=(0,t.relativeTime)(new Date(e.modelsConfirmedAt),s);return`${e.version} \xb7 models confirmed ${"Just now"===a?"just now":a}`},"harnessKind",0,function(e){return s[e]?.kind},"harnessWord",0,a])},18423,e=>{"use strict";var t=e.i(12598),s=e.i(5861),a=e.i(71645),n=e.i(86413),i=e.i(27702);let r=new Set(["FleetInitialised","ShipCommissioned","ShipClaimed","LeaseRevoked","CredentialRevoked","StartingPromptIssued","ShipRetired","DeliveryAcknowledged","DeliveryUndeliverable","ShipReported","CrewRequested","CrewRequestRemoved","CrewAssigned","CrewStatusChanged","CrewRequestExplained","CrewRequestGivenBack","LabelAssigned","LabelUnassigned","LabelRetired"]);async function l(e,t){await e.cancelQueries({queryKey:t,predicate:e=>void 0===e.state.data&&"fetching"===e.state.fetchStatus}),await e.invalidateQueries({queryKey:t})}let d=new Set(["LabelDefined","LabelValuesChanged","LabelRetired","LabelAssigned","LabelUnassigned","LabelDeleted"]),o=new Set(["DeliveryUndeliverable","DeliveryNotHandled","DeliveryDismissed"]),c=new Set(["NetworkRulesSet","NetworkRulesDraftSaved","NetworkRulesDraftDiscarded","NetworkRulesDeclared","BuiltInRuleChanged"]);e.s(["useLiveFleet",0,function(){let e=(0,i.useTRPC)(),m=(0,t.useQueryClient)(),[u,h]=(0,a.useState)(new Set),x=e=>{l(m,e)},p=(0,s.useSubscription)(e.fleet.events.subscriptionOptions({lastEventId:null},{onData:({data:t})=>{var s,a,i,l,m;if("resync"===t.kind){x(e.fleet.pathKey()),x(n.INBOX_KEY);return}let{event:u}=t;for(let t of new Set([u.shipId,u.actorShipId]))null!==t&&(x(e.fleet.ship.queryKey({shipId:t})),x(e.fleet.shipTimeline.queryKey({shipId:t})),x(e.fleet.shipWay.queryKey({shipId:t})));if(null!==u.messageId&&(x(e.fleet.shipMessages.pathKey()),x(e.fleet.shipWay.pathKey()),x(e.fleet.message.queryKey({messageId:u.messageId})),x(e.fleet.inbox.pathKey()),x(n.INBOX_KEY),x(e.fleet.health.queryKey())),s=u.type,o.has(s)&&x(e.fleet.needsAttention.queryKey()),a=u.type,d.has(a)&&x(e.fleet.labels.queryKey()),"NetworkRulesDeclared"===u.type&&x(e.fleet.declaredNetworkRules.queryKey()),("BuiltInRuleChanged"===(i=u.type)||"NetworkRulesSet"===i)&&x(e.fleet.builtInRules.queryKey()),l=u.type,c.has(l)&&(x(e.fleet.networkRules.queryKey()),x(e.fleet.networkRulesDraftChanges.queryKey()),x(e.fleet.explainReach.pathKey())),m=u.type,!r.has(m))return;x(e.fleet.list.queryKey()),x(e.fleet.health.queryKey());let{shipId:p}=u;"ShipCommissioned"===u.type&&null!==p&&h(e=>new Set([...e,p]))}}));return{live:function(e){switch(e){case"pending":return"live";case"connecting":return"reconnecting";case"idle":case"error":return"offline"}}(p.status),newShipIds:u,error:p.error}}])},40798,e=>{"use strict";let t={DEVICE:"Device",CLOUD:"Cloud",SERVER:"Server",OTHER:"Other"};e.s(["locationKindWord",0,function(e){return t[e]}])},93361,e=>{"use strict";var t=e.i(49635);let s={working:"Working",blocked:"Blocked",idle:"Idle"};e.s(["REPORT_STATE_WORDS",0,s,"REPORT_TONES",0,{working:"active",blocked:"waiting",idle:"ended"},"reportAge",0,function(e,s){let a=Math.max(0,s.getTime()-e.getTime());return a<6e4?`${String(Math.floor(a/1e3))} s`:a<36e5?`${String(Math.floor(a/6e4))} min`:a<864e5?`${String(Math.floor(a/36e5))} h`:(0,t.relativeTime)(e,s)},"reportDetailsJson",0,function(e){return JSON.stringify(e,null,2)},"reportDetailsLabel",0,function(e){return`JSON \xb7 ${String(e)} bytes`},"reportText",0,function(e){let t=s[e.state];return null===e.note?t:`${t}: ${e.note}`},"reportedWhen",0,function(e,s){let a=(0,t.relativeTime)(e,s);return`reported ${"Just now"===a?"just now":a}`}])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71567,e=>{"use strict";var t=e.i(56420);let s={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};s.node;let a=(0,t.default)(s);e.s(["Bot",0,a],71567)},24071,e=>{"use strict";var t=e.i(56420);let s={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};s.node;let a=(0,t.default)(s);e.s(["ChevronLeft",0,a],24071)},67927,e=>{"use strict";var t=e.i(56420);let s={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};s.node;let a=(0,t.default)(s);e.s(["ChevronRight",0,a],67927)},69644,69846,e=>{"use strict";var t=e.i(56420);let s={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};s.node;let a=(0,t.default)(s);e.s(["FolderOpen",0,a],69644);let n={name:"git-branch",size:24,node:[["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"}]]};n.node;let i=(0,t.default)(n);e.s(["GitBranch",0,i],69846)},11147,e=>{"use strict";var t=e.i(56420);let s={name:"octagon-pause",size:24,node:[["path",{d:"M10 15V9",key:"1lckn7"}],["path",{d:"M14 15V9",key:"1muqhk"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]],aliases:["pause-octagon"]};s.node;let a=(0,t.default)(s);e.s(["OctagonPause",0,a],11147)},66595,e=>{"use strict";var t=e.i(56420);let s={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};s.node;let a=(0,t.default)(s);e.s(["Search",0,a],66595)},41220,e=>{"use strict";var t=e.i(56420);let s={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};s.node;let a=(0,t.default)(s);e.s(["Server",0,a],41220)},19759,e=>{"use strict";var t=e.i(56420);let s={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};s.node;let a=(0,t.default)(s);e.s(["SquarePen",0,a],19759)},83035,e=>{"use strict";var t=e.i(56420);let s={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};s.node;let a=(0,t.default)(s);e.s(["SquareTerminal",0,a],83035)},94831,e=>{"use strict";var t=e.i(56420);let s={name:"unplug",size:24,node:[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]};s.node;let a=(0,t.default)(s);e.s(["Unplug",0,a],94831)},46980,e=>{"use strict";var t=e.i(43476),s=e.i(77821),a=e.i(5387),n=e.i(90437),i=e.i(14695),r=e.i(96676),l=e.i(49635),d=e.i(265),o=e.i(16634),c=e.i(17981),m=e.i(88393),u=e.i(67927),h=e.i(22016),x=e.i(66390),p=e.i(15905),f=e.i(78865),g=e.i(38614);function b({place:e}){return"ship"===e.kind?(0,t.jsx)("span",{className:"font-medium text-foreground",children:e.ship.name}):(0,t.jsx)(x.Badge,{variant:"type",children:e.type})}function j({group:e,notes:s,now:a}){let{cause:n,count:i,places:r}=e;return(0,t.jsxs)("section",{"aria-label":(0,f.statusLabel)(n),"data-testid":"health-cause","data-cause":n,className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4 shadow-sm max-sm:rounded-xl",children:[(0,t.jsxs)("header",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)(h.default,{href:(0,o.causePathOf)(n),className:"group inline-flex items-center gap-1.5 rounded-md","data-testid":"health-cause-open",children:[(0,t.jsx)(f.StatusBadge,{status:n}),(0,t.jsx)(u.ChevronRight,{"aria-hidden":!0,className:"size-(--size-icon-sm) text-muted-foreground group-hover:text-foreground"}),(0,t.jsxs)("span",{className:"sr-only",children:["Open the deliveries ",(0,f.statusLabel)(n).toLowerCase()]})]}),(0,t.jsx)("span",{className:"text-metric font-semibold tabular-nums text-foreground max-sm:text-title-touch",children:i})]}),(0,t.jsx)("p",{className:"text-body text-muted-foreground max-sm:text-body-touch",children:o.CAUSE_SENTENCES[n]}),(0,t.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_minmax(0,1.2fr)_auto] gap-x-4 max-sm:grid-cols-1",children:[(0,t.jsxs)("div",{className:"col-span-3 grid grid-cols-subgrid items-center text-caption font-medium text-muted-foreground max-sm:col-span-1",children:[(0,t.jsx)("span",{className:"max-sm:hidden",children:"Where, how long"}),(0,t.jsx)(g.WaitAxis,{}),(0,t.jsx)("span",{className:"text-right max-sm:hidden",children:"Next step"})]}),(0,t.jsx)("ul",{className:"col-span-3 grid grid-cols-subgrid divide-y divide-border max-sm:col-span-1",children:r.map(e=>{let n=(0,o.nextStepOf)(e),i=s.get(e),r=(0,l.duration)(new Date(e.oldestSince),a);return(0,t.jsxs)("li",{"data-testid":"health-place",className:"col-span-3 grid grid-cols-subgrid items-center gap-y-2 py-3 last:pb-0 max-sm:col-span-1",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)(b,{place:e.place}),(0,t.jsxs)("span",{className:"text-meta tabular-nums text-muted-foreground",children:[e.count," · oldest ",r]})]}),(0,t.jsx)(g.WaitStrip,{waits:e.deliveries.map(e=>(0,o.waitMinutes)(e.since,a)),label:`${String(e.count)} waiting, the oldest ${r}`}),(0,t.jsx)(p.Button,{variant:"secondary",size:"sm",nativeButton:!1,render:(0,t.jsx)(h.default,{href:n.href}),className:"max-sm:h-(--size-control-touch) max-sm:w-full max-sm:text-body-touch","data-testid":"health-next-step",children:n.label}),void 0!==i&&(0,t.jsx)("p",{className:"col-span-3 text-meta text-muted-foreground max-sm:col-span-1",children:i})]},`${e.cause}-${"ship"===e.place.kind?e.place.ship.id:e.place.type}`)})})]})]})}function v({perHour:e}){let s=Math.max(1,...e.map(e=>e.count));return(0,t.jsx)("div",{role:"img","aria-label":`Acknowledged per hour over the last 24 hours, at most ${Math.max(0,...e.map(e=>e.count))} in an hour`,"data-testid":"health-acknowledged-bars",className:"flex h-8 w-full items-end gap-0.5 sm:w-48",children:e.map(e=>(0,t.jsx)("span",{className:"min-h-0.5 flex-1 rounded-xs bg-tone-ok-fg opacity-75",style:{height:`${e.count/s*100}%`}},e.at))})}function y({acknowledged:e}){return(0,t.jsxs)("section",{"aria-label":"Delivering","data-testid":"health-delivering",className:"flex items-center gap-4 rounded-lg border border-border bg-card p-4 shadow-sm max-sm:flex-col max-sm:items-start max-sm:gap-3 max-sm:rounded-xl",children:[(0,t.jsx)(f.StatusBadge,{status:"delivering"}),(0,t.jsx)("p",{className:"flex-1 text-body text-foreground max-sm:text-body-touch",children:null===e.medianMs?"Nothing acknowledged in the last 24 h.":(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold tabular-nums",children:e.count})," acknowledged in the last 24 h, median"," ",(0,t.jsx)("span",{className:"font-semibold tabular-nums",children:(0,o.medianText)(e.medianMs,l.duration)})," from send to acknowledgement."]})}),(0,t.jsx)(v,{perHour:e.perHour})]})}function w({perHour:e,marks:s}){let a=Math.max(5,5*Math.ceil(Math.max(0,...e.map(e=>e.count))/5)),n=Math.max(e.length-1,1),i=e=>100-e/a*100,[r]=e,d=e.slice(1).map((e,t)=>`H${(t+1)/n*1e3} V${i(e.count)}`),o=[`M0 ${i(r?.count??0)}`,...d].join(" "),c=`${o} H1000 V100 H0 Z`,m=e.at(-1)?.count??0,u=e.flatMap((e,t)=>t%24==12?[{index:t,label:(0,l.dayMonth)(new Date(e.at))}]:[]);return(0,t.jsxs)("figure",{"data-testid":"health-trend",className:"flex min-w-0 flex-col gap-2",children:[(0,t.jsx)("figcaption",{className:"text-meta font-medium text-foreground",children:"Stuck deliveries, last 7 days, per hour"}),(0,t.jsxs)("div",{className:"grid grid-cols-[auto_1fr] gap-x-2",children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"relative h-36 w-5 text-caption tabular-nums text-muted-foreground",children:[a,a/2,0].map(e=>(0,t.jsx)("span",{className:"absolute right-0 -translate-y-1/2",style:{top:`${100-e/a*100}%`},children:e},e))}),(0,t.jsxs)("div",{className:"relative h-36",children:[(0,t.jsxs)("svg",{role:"img","aria-label":`Stuck deliveries per hour over the last 7 days: ${m} now, at most ${Math.max(0,...e.map(e=>e.count))}`,viewBox:"0 0 1000 100",preserveAspectRatio:"none",className:"size-full overflow-visible",children:[[0,a/2,a].map(e=>(0,t.jsx)("line",{x1:0,x2:1e3,y1:i(e),y2:i(e),className:"stroke-border",vectorEffect:"non-scaling-stroke"},e)),(0,t.jsx)("path",{d:c,className:"fill-tone-waiting-bg"}),(0,t.jsx)("path",{d:o,className:"fill-none stroke-tone-waiting-fg",strokeWidth:2,strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]}),s.map(s=>(0,t.jsx)("span",{"aria-hidden":!0,"data-testid":"health-trend-mark",className:"absolute flex size-4 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full border-2 border-foreground bg-card text-micro font-semibold text-foreground max-sm:hidden",style:{left:`${s.hour/n*100}%`,top:`${i(e[s.hour]?.count??0)/100*100}%`},children:s.number},s.number)),(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute size-2 -translate-1/2 rounded-full bg-tone-waiting-fg",style:{left:"100%",top:`${i(m)/100*100}%`}})]}),(0,t.jsx)("div",{"aria-hidden":!0,className:"relative col-start-2 h-4 text-caption text-muted-foreground",children:u.map(e=>(0,t.jsx)("span",{className:"absolute -translate-x-1/2 whitespace-nowrap max-sm:[&:nth-child(even)]:hidden",style:{left:`${e.index/n*100}%`},children:e.label},e.index))})]}),s.length>0&&(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:s.map((e,s)=>(0,t.jsxs)("span",{children:[s>0&&" · ",(0,t.jsx)("span",{className:"font-semibold text-foreground",children:e.number})," ",e.label]},e.number))})]})}function N({health:e}){let s=(0,o.verdictOf)(e);return(0,t.jsxs)("section",{"aria-label":"Verdict","data-testid":"health-verdict","data-verdict":s.kind,className:"grid gap-6 rounded-lg border border-border bg-card p-4 shadow-sm lg:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] max-sm:gap-4 max-sm:rounded-xl",children:[(0,t.jsxs)("div",{className:"flex flex-col items-start gap-3",children:[(0,t.jsx)(f.StatusBadge,{status:s.kind}),"stuck"===s.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-section font-semibold text-foreground",children:[(0,t.jsx)("span",{className:"text-metric tabular-nums max-sm:text-title-touch","data-testid":"health-stuck-count",children:s.count})," ",1===s.count?"delivery":"deliveries"," stuck in ",s.places," ",1===s.places?"place":"places"]}),(0,t.jsxs)("p",{className:"text-body text-muted-foreground max-sm:text-body-touch",children:["Stuck since ",(0,l.shortDateTime)(new Date(s.since)),". ",(0,o.trendSentence)(s)]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Nothing is lost: each one is stored and moves on as soon as its cause is gone."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-section font-semibold text-foreground",children:"Delivering. Nothing is stuck."}),(0,t.jsx)("p",{className:"text-body text-muted-foreground max-sm:text-body-touch",children:"Every delivery waits only on its ship to take it."})]})]}),(0,t.jsx)(w,{perHour:e.stuckPerHour,marks:(0,o.marksOf)(e)})]})}var k=e.i(41220);function S({machines:e,stuckByMachine:s,renderLiveness:a}){return(0,t.jsxs)("section",{"aria-labelledby":"health-machines","data-testid":"health-machines",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4 shadow-sm max-sm:rounded-xl",children:[(0,t.jsxs)("header",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("h2",{id:"health-machines",className:"text-section font-semibold text-foreground",children:"Machines"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Each machine runs a trierarch that crews ships."})]}),(0,t.jsx)("ul",{className:"flex flex-col divide-y divide-border",children:e.map(e=>{let n=s.get(e.id)??0;return(0,t.jsxs)("li",{"data-testid":"health-machine",className:"flex items-center gap-4 py-3 first:pt-0 last:pb-0 max-sm:flex-wrap max-sm:gap-2",children:[(0,t.jsxs)("span",{className:"inline-flex min-w-40 items-center gap-2 font-medium text-foreground",children:[(0,t.jsx)(k.Server,{"aria-hidden":!0,className:"size-(--size-icon) text-muted-foreground"}),e.name]}),(0,t.jsx)("span",{className:"min-w-0 flex-1",children:a(e)}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:[e.ships," ",1===e.ships?"ship":"ships",n>0&&(0,t.jsxs)(t.Fragment,{children:[" · ",(0,t.jsxs)("span",{className:"font-semibold text-foreground",children:[n," ",1===n?"delivery":"deliveries"," stuck on its ships"]})]})]}),n>0&&(0,t.jsx)(p.Button,{variant:"secondary",size:"sm",nativeButton:!1,render:(0,t.jsx)(h.default,{href:`/trierarchs/${e.id}`}),className:"max-sm:h-(--size-control-touch) max-sm:w-full",children:"Open machine"})]},e.id)})})]})}function C({state:e,health:s,onRetry:a,notes:n,machines:i,renderLiveness:r,children:l,now:d}){if("error"===e)return(0,t.jsx)(c.InlineError,{variant:"page",title:"Couldn’t load the fleet’s health",description:"Nothing changed in the fleet. The page tries again by itself.",onRetry:a});if("loading"===e||void 0===s)return(0,t.jsx)(m.LoadingSkeleton,{variant:"cards",rows:4,label:"Loading the fleet’s health"});let u=(0,o.causeGroupsOf)(s);return(0,t.jsxs)("div",{"data-testid":"health-board",className:"flex flex-col gap-5 max-sm:gap-3.5",children:[(0,t.jsx)(N,{health:s}),(0,t.jsx)(y,{acknowledged:s.acknowledged}),u.length>0&&(0,t.jsx)("div",{className:"grid gap-5 lg:grid-cols-2 max-sm:gap-3.5",children:u.map(e=>(0,t.jsx)(j,{group:e,notes:n,now:d},e.cause))}),void 0!==i&&i.length>0&&(0,t.jsx)(S,{machines:i,stuckByMachine:(0,o.stuckByMachine)(s),renderLiveness:r}),l]})}function $({renderLiveness:e,children:s}){let c=(0,r.useNow)(),m=(0,n.useFleetHealth)(),u=(0,a.useFleetSnapshot)(),h=(0,d.useMachines)(),x=u.data??[],p=new Map(x.map(e=>[e.id,e])),f=new Map;for(let e of m.data?.stuck??[]){let t="ship"===e.place.kind?p.get(e.place.ship.id):void 0,s=(0,o.placeNote)(e,{facts:t&&{lastSeenAt:t.lastSeenAt},since:e=>(0,l.relativeTime)(e,c)});null!==s&&f.set(e,s)}let g=new Map((h.data??[]).map(e=>[e.shipId,e])),b=h.data?.map(e=>({id:e.shipId,name:e.name,ships:(0,i.spotsOf)(e,x).length}));return(0,t.jsx)(C,{state:m.isError?"error":m.data?"ready":"loading",health:m.data,onRetry:()=>{m.refetch()},notes:f,machines:b,renderLiveness:t=>{let s=g.get(t.id);return void 0===s?null:e(s)},now:c,children:s})}var z=e.i(84294),M=e.i(19249),T=e.i(81830),R=e.i(1935);function q({members:e,ships:s,now:a,renderAction:n}){return(0,t.jsx)("ul",{"data-testid":"silent-members",className:"divide-y divide-border overflow-hidden rounded-lg border border-border",children:e.map(({squadronId:e,member:i})=>{let{lastSeenAt:r}=i.crew;return(0,t.jsxs)("li",{"data-testid":"silent-member",className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 px-3 py-2.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(M.HealthIndicator,{health:"silent"}),(0,t.jsx)("span",{className:"font-medium",children:i.name})]}),(0,t.jsx)(R.SquadronTag,{squadronId:e,role:i.role,size:"sm"})]}),(0,t.jsxs)("span",{className:"flex flex-col text-meta",children:[(0,t.jsx)("span",{children:null===r?"never seen":`not seen for ${(0,l.duration)(new Date(r),a)}`}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["checks in ",(0,z.checkInText)(i.checkInMinutes)]})]}),(0,t.jsx)("span",{className:"grow",children:(0,t.jsx)(T.ReportLine,{report:s.get(i.shipId)?.report??null,now:a,variant:"row",testId:"silent-member-report"})}),n?.({squadronId:e,member:i}),(0,t.jsxs)(h.default,{href:`/squadrons/${e}`,className:"inline-flex items-center gap-1 text-meta font-medium hover:underline",children:["Open",(0,t.jsx)(u.ChevronRight,{"aria-hidden":!0,className:"size-(--size-icon-sm)"})]})]},i.shipId)})})}var A=e.i(15327),O=e.i(36556),I=e.i(90262),D=e.i(87964),L=e.i(18423),H=e.i(78485),B=e.i(53573),E=e.i(48695);e.s(["default",0,function(){let e=(0,r.useNow)(),i=(0,D.useConsoleFrame)(),l=(0,L.useLiveFleet)(),d=(0,n.useFleetHealth)(),o=(0,I.useAccess)(),c=(0,E.useSquadrons)(),m=(0,z.silentMembers)(c.data??[]),u=(0,B.useShips)(m.map(({member:e})=>e.shipId)),h=new Map(((0,a.useFleetSnapshot)().data??[]).map(e=>[e.id,e]));return(0,H.useSignInWhenSessionEnds)([d.error,l.error]),(0,t.jsx)(s.ListPage,{...i,title:"Health",description:"Where deliveries wait, since when, and what lets them move.",live:l.live,children:(0,t.jsx)($,{renderLiveness:s=>(0,t.jsx)(O.MachineLiveness,{machine:s,now:e}),children:m.length>0?(0,t.jsxs)("section",{"aria-labelledby":"health-silent",className:"flex flex-col gap-2",children:[(0,t.jsxs)("h2",{id:"health-silent",className:"text-section font-semibold text-foreground",children:["Silent members (",m.length,")"]}),(0,t.jsx)(q,{members:m,ships:h,now:e,renderAction:o.canManage?({squadronId:e,member:s})=>(0,t.jsx)(A.GetNewCrewLine,{squadronId:e,member:s,ship:u.get(s.shipId),isPrimary:!0,testId:"silent-member-new-crew-line"}):void 0}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"A member is silent after 3 missed check-ins; only you can start its new session. Late members and blocked reports stay on their squadron page."})]}):null})})}],46980)},36651,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Kbd",0,function({className:e,...a}){return(0,t.jsx)("kbd",{"data-slot":"kbd",className:(0,s.classNames)("inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-xs border border-border bg-muted px-1.25 font-sans text-micro font-medium text-muted-foreground max-sm:hidden",e),...a})}])},19321,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Skeleton",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"skeleton","aria-hidden":!0,className:(0,s.classNames)("animate-pulse rounded-sm bg-secondary [animation-duration:var(--duration-pulse)] motion-reduce:animate-none",e),...a})}])},19249,e=>{"use strict";var t=e.i(43476),s=e.i(90063);let a={"on-time":{label:"On time",dot:"bg-tone-ok-fg",text:"text-tone-ok-fg"},late:{label:"Late",dot:"bg-tone-waiting-fg",text:"text-tone-waiting-fg"},silent:{label:"Silent",dot:"bg-tone-attention-fg",text:"text-tone-attention-fg"},"standing-down":{label:"Standing down",dot:"bg-tone-active-fg",text:"text-tone-active-fg"},"not-on-station":{label:"Not on station",dot:"border border-dashed border-muted-foreground",text:"text-foreground"}};function n({health:e}){return(0,t.jsx)("span",{"aria-hidden":!0,className:(0,s.classNames)("size-2 shrink-0 rounded-full",a[e].dot)})}e.s(["HealthIndicator",0,function({health:e,detail:i,className:r}){return(0,t.jsxs)("span",{"data-slot":"health-indicator","data-health":e,className:(0,s.classNames)("inline-flex items-center gap-1.5 text-meta",r),children:[(0,t.jsx)(n,{health:e}),(0,t.jsx)("span",{className:(0,s.classNames)("font-medium",a[e].text),children:a[e].label}),void 0!==i&&(0,t.jsx)("span",{className:"text-muted-foreground",children:i})]})},"HealthSummary",0,function({counts:e,className:i}){return(0,t.jsx)("span",{"data-slot":"health-summary",className:(0,s.classNames)("inline-flex flex-wrap items-center gap-x-3 gap-y-1 text-meta",i),children:e.map(({health:e,count:s})=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(n,{health:e}),(0,t.jsxs)("span",{children:[s," ",a[e].label.toLowerCase()]})]},e))})}])},88393,e=>{"use strict";var t=e.i(43476),s=e.i(90063),a=e.i(19321);function n(e){return Array.from({length:e},(e,t)=>`row-${String(t)}`)}e.s(["LoadingSkeleton",0,function({variant:e,rows:i=4,label:r="Loading",className:l}){return(0,t.jsxs)("div",{role:"status","data-slot":"loading-skeleton","data-variant":e,className:(0,s.classNames)("w-full",l),children:[(0,t.jsx)("span",{className:"sr-only",children:r}),"table"===e?(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border border-border bg-card shadow-sm",children:[(0,t.jsx)("div",{className:"h-(--size-row-header) border-b border-border bg-muted"}),n(i).map(e=>(0,t.jsxs)("div",{className:"flex h-(--size-row) items-center gap-8 border-b border-border px-4 last:border-0",children:[(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-24"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-16"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-28"})]},e))]}):null,"cards"===e?(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:n(4).map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-20"}),(0,t.jsx)(a.Skeleton,{className:"h-6 w-10"}),(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-28"})]},e))}):null,"detail"===e?(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(a.Skeleton,{className:"h-7 w-48"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(a.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(a.Skeleton,{className:"h-16 w-full rounded-lg"})]}):null,"list"===e?(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border border-border bg-card",children:n(i).map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 border-b border-border px-3.5 py-3 last:border-0",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)(a.Skeleton,{className:"h-3 w-28"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-44"})]},e))}):null]})}])},63481,e=>{"use strict";var t=e.i(43476),s=e.i(56420);let a={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};a.node;let n=(0,s.default)(a);var i=e.i(71567);let r={name:"cloud",size:24,node:[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]};r.node;let l=(0,s.default)(r),d={name:"laptop",size:24,node:[["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"}]]};d.node;let o=(0,s.default)(d),c={name:"map-pin",size:24,node:[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]};c.node;let m=(0,s.default)(c),u={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};u.node;let h=(0,s.default)(u);var x=e.i(41220),p=e.i(83035),f=e.i(94831),g=e.i(90063),b=e.i(66616),j=e.i(40798);let v={DEVICE:o,CLOUD:l,SERVER:x.Server,OTHER:m},y={coding:p.SquareTerminal,chat:h,bot:i.Bot,console:n},w={md:"text-body",sm:"text-meta"};e.s(["LocationTag",0,function({kind:e,description:s=null,harness:a=null,isCompact:n=!1,size:i="md",className:r}){let l=(0,g.classNames)("inline-flex min-w-0 items-center gap-1.5 text-muted-foreground [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",w[i],r);if(null===e)return(0,t.jsxs)("span",{"data-slot":"location-tag",className:l,children:[(0,t.jsx)(f.Unplug,{"aria-hidden":!0}),"No session"]});let d=v[e],o=(0,j.locationKindWord)(e),c=null===s?o:`${o} \xb7 ${s}`;if(null!==a){let e=(0,b.harnessKind)(a),n=void 0===e?void 0:y[e],i=(0,b.harnessWord)(a);return(0,t.jsxs)("span",{"data-slot":"location-tag",className:l,title:null===s?`${i} \xb7 ${o}`:`${i} \xb7 ${o}: ${s}`,children:[void 0===n?null:(0,t.jsx)(n,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate text-foreground",children:i}),(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}),(0,t.jsx)(d,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:o}),null===s?null:(0,t.jsxs)("span",{className:"sr-only",children:[": ",s]})]})}return n?(0,t.jsxs)("span",{"data-slot":"location-tag",className:l,title:c,children:[(0,t.jsx)(d,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"sr-only",children:[o,": "]}),(0,t.jsx)("span",{className:"truncate text-foreground",children:s??o})]}):(0,t.jsxs)("span",{"data-slot":"location-tag",className:l,children:[(0,t.jsx)(d,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:[o,null===s?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,children:" · "}),(0,t.jsx)("span",{className:"sr-only",children:", "}),(0,t.jsx)("span",{className:"text-foreground",children:s})]})]})]})}],63481)},81830,e=>{"use strict";var t=e.i(43476),s=e.i(79432),a=e.i(19002),n=e.i(11147),i=e.i(90063),r=e.i(49635),l=e.i(93361);let d={working:s.Activity,blocked:n.OctagonPause,idle:a.CirclePause},o={active:"text-tone-active-fg",waiting:"text-tone-waiting-fg",ended:"text-tone-ended-fg"};e.s(["ReportLine",0,function({report:e,now:s,variant:a,isTimeInTitle:n=!1,testId:c}){let m="full"===a,u=(0,i.classNames)("flex min-w-0 items-center gap-1.5",m?"text-body":"text-meta");if(null===e)return(0,t.jsx)("span",{"data-testid":c,"data-state":"none",className:(0,i.classNames)(u,"text-muted-foreground"),children:"No report yet"});let h=d[e.state],x=o[l.REPORT_TONES[e.state]],p=new Date(e.reportedAt);return(0,t.jsxs)("span",{"data-testid":c,"data-state":e.state,title:n?`${(0,l.reportText)(e)} \xb7 ${(0,l.reportedWhen)(p,s)}`:(0,l.reportText)(e),className:u,children:[(0,t.jsx)(h,{"aria-hidden":!0,className:(0,i.classNames)("size-(--size-icon-sm) shrink-0",x)}),(0,t.jsx)("span",{className:(0,i.classNames)("shrink-0 font-medium",x),children:l.REPORT_STATE_WORDS[e.state]}),null===e.note?null:(0,t.jsx)("span",{className:"min-w-0 truncate text-foreground",children:e.note}),n?null:(0,t.jsx)("time",{dateTime:e.reportedAt,title:(0,r.fullDateTime)(p),className:"shrink-0 text-muted-foreground tabular-nums",children:m?`\xb7 ${(0,l.reportedWhen)(p,s)}`:(0,l.reportAge)(p,s)})]})}])},1935,e=>{"use strict";var t=e.i(43476),s=e.i(60011),a=e.i(22016),n=e.i(90063);e.s(["SquadronTag",0,function({squadronId:e,role:i,size:r="md",className:l}){return(0,t.jsxs)(a.default,{href:`/squadrons/${e}`,"data-slot":"squadron-tag",className:(0,n.classNames)("inline-flex max-w-full items-center gap-1 rounded-sm bg-secondary px-1.5 text-secondary-foreground hover:underline [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0","sm"===r?"h-5.5 text-meta":"h-6 text-body",l),children:[(0,t.jsx)(s.Shapes,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate font-medium",children:e}),void 0!==i&&(0,t.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:["· ",i]})]})}])},77880,85538,e=>{"use strict";var t=e.i(43476),s=e.i(67927),a=e.i(66595),n=e.i(19759),i=e.i(22016),r=e.i(15905),l=e.i(36651),d=e.i(90063);let o={live:{label:"Live",dot:"bg-tone-ok-fg"},reconnecting:{label:"Reconnecting",dot:"bg-tone-waiting-fg"},offline:{label:"Offline",dot:"bg-tone-attention-fg"}};function c({state:e,className:s}){let{label:a,dot:n}=o[e];return(0,t.jsxs)("span",{"data-slot":"live-status","data-state":e,"aria-live":"polite",className:(0,d.classNames)("inline-flex items-center gap-1.5 text-meta text-muted-foreground",s),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,d.classNames)("size-2 shrink-0 rounded-full",n)}),a]})}e.s(["Header",0,function({breadcrumb:e,parents:d=[],live:o,onCompose:m,onSearch:u}){return(0,t.jsxs)("header",{"data-slot":"header",className:"sticky top-0 z-30 hidden h-(--size-header) shrink-0 items-center justify-between gap-4 border-b border-border bg-background px-6 sm:flex",children:[(0,t.jsx)("nav",{"aria-label":"Breadcrumb","data-testid":"header-breadcrumb",className:"min-w-0 text-body",children:(0,t.jsxs)("ol",{className:"flex min-w-0 items-center gap-1.5",children:[d.map(e=>(0,t.jsxs)("li",{className:"flex shrink-0 items-center gap-1.5",children:[(0,t.jsx)(i.default,{href:e.href,className:"text-muted-foreground hover:text-foreground hover:underline",children:e.label}),(0,t.jsx)(s.ChevronRight,{"aria-hidden":!0,className:"size-3.5 text-muted-foreground"})]},e.href)),(0,t.jsx)("li",{"aria-current":"page",className:"truncate font-medium text-foreground",children:e})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(c,{state:o}),u?(0,t.jsxs)(r.Button,{size:"sm",icon:(0,t.jsx)(a.Search,{"aria-hidden":!0}),"data-testid":"header-search",className:"w-60 justify-start font-normal text-muted-foreground",onClick:u,children:[(0,t.jsx)("span",{className:"grow text-left",children:"Search ships or jump to"}),(0,t.jsx)(l.Kbd,{children:"⌘K"})]}):null,m?(0,t.jsx)(r.Button,{size:"sm",icon:(0,t.jsx)(n.SquarePen,{"aria-hidden":!0}),"data-testid":"header-compose",onClick:m,children:"Compose"}):null]})]})}],77880);var m=e.i(24071),u=e.i(57957);e.s(["TopBar",0,function({title:e,live:s,actions:n,back:l,account:d,onSearch:o}){let h=o&&!l?o:void 0;return(0,t.jsxs)("header",{"data-slot":"top-bar","data-mode":l?"detail":"root",className:"sticky top-0 z-30 flex h-(--size-header) items-center gap-2.5 border-b border-border bg-background px-4 sm:hidden",children:[l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(i.default,{href:l.href,className:"-ml-1.5 inline-flex h-(--size-control-touch) shrink-0 items-center gap-0.5 rounded-md pr-2 text-body-touch text-foreground focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon)",children:[(0,t.jsx)(m.ChevronLeft,{"aria-hidden":!0}),l.label]}),(0,t.jsx)("p",{className:"min-w-0 flex-1 truncate text-center text-body-touch font-semibold text-foreground",children:e})]}):(0,t.jsx)("h1",{className:"truncate text-title-touch font-semibold tracking-tight text-foreground",children:e}),(0,t.jsx)(c,{state:s}),n||h||d&&!l?(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[h?(0,t.jsx)(r.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Search ships or jump to","data-testid":"top-bar-search",onClick:h,children:(0,t.jsx)(a.Search,{"aria-hidden":!0})}):null,n,d&&!l?(0,t.jsx)(u.AccountMenuSheet,{...d}):null]}):null]})}],85538)},77821,e=>{"use strict";var t=e.i(43476),s=e.i(19759),a=e.i(15905),n=e.i(77880),i=e.i(85538);e.s(["ListPage",0,function({title:e,description:r,titleMeta:l,primaryAction:d,toolbar:o,live:c,onCompose:m,onSearch:u,account:h,banner:x,phoneTopBar:p,children:f}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.Header,{breadcrumb:e,live:c,onCompose:m,onSearch:u}),x,p??(0,t.jsx)(i.TopBar,{title:e,live:c,account:h,onSearch:u,actions:m?(0,t.jsx)(a.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Compose","data-testid":"top-bar-compose",onClick:m,children:(0,t.jsx)(s.SquarePen,{"aria-hidden":!0})}):void 0}),(0,t.jsxs)("main",{className:"flex grow flex-col gap-5 px-8 py-6 max-sm:gap-3.5 max-sm:px-4 max-sm:pt-3.5 max-sm:pb-[calc(var(--size-tabbar)+var(--spacing)*4)]",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 max-sm:gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1",children:[(0,t.jsx)("h1",{className:"text-title font-semibold tracking-tight text-foreground max-sm:hidden",children:e}),l]}),r?(0,t.jsx)("p",{className:"text-meta text-muted-foreground max-sm:text-body-touch",children:r}):null]}),d?(0,t.jsx)("div",{className:"shrink-0 max-sm:w-full max-sm:[&>*]:w-full",children:d}):null]}),o,f]})]})}])},16634,38614,e=>{"use strict";let t=["noShipCanTake","waitingForCrew","stalledInFlight","undeliverable"];function s(e){return`/fleet-health/${e}`}function a(e){return"ship"===e.kind?e.ship.name:e.type}let n={noShipCanTake:"no ship can take",waitingForCrew:"waiting for crew",stalledInFlight:"stalled in flight",undeliverable:"undeliverable"},i=[{minutes:1,label:"1 min"},{minutes:10,label:"10 min"},{minutes:60,label:"1 h"},{minutes:1440,label:"1 d"},{minutes:10080,label:"7 d"}],r=Math.log(1),l=Math.log(10080);function d(e){return Math.min(Math.max((Math.log(Math.max(e,1))-r)/(l-r),0),1)}let o={pending:"pending",received:"received",handed:"handed (pulled)",undeliverable:"undeliverable"};e.s(["CAUSE_SENTENCES",0,{noShipCanTake:"Sent to a type with no active ship. Waits until you commission one.",waitingForCrew:"Sent to a ship no session crews. Waits until it is crewed.",stalledInFlight:"Taken by a session that went quiet. Waits until it acknowledges or the ship is released.",undeliverable:"Taken five times, never acknowledged. Waits for you to resend or dismiss."},"WAIT_TICKS",0,i,"causeGroupsOf",0,function(e){return t.flatMap(t=>{let s=e.stuck.filter(e=>e.cause===t).toSorted((e,t)=>e.oldestSince.localeCompare(t.oldestSince));return 0===s.length?[]:[{cause:t,count:s.reduce((e,t)=>e+t.count,0),places:s}]})},"causePathOf",0,s,"marksOf",0,function(e){let[t]=e.stuckPerHour;return void 0===t?[]:e.stuck.filter(e=>e.oldestSince>t.at).toSorted((e,t)=>e.oldestSince.localeCompare(t.oldestSince)).map((t,s)=>({number:s+1,hour:e.stuckPerHour.findIndex(e=>e.at>=t.oldestSince),label:`${a(t.place)}: ${n[t.cause]}`}))},"medianText",0,function(e,t){let s=Math.round(e/1e3);return s<60?`${String(s)} s`:t(new Date(0),new Date(e))},"messagePathOn",0,function(e,t){return`/ships/${e}?tab=messages&message=${t}`},"nextStepOf",0,function(e){let t=e.place;switch(e.cause){case"noShipCanTake":return{label:`Commission a ${a(t)}`,href:"/?commission=new"};case"waitingForCrew":return"ship"===t.kind?{label:"Get starting prompt",href:`/ships/${t.ship.id}`}:{label:"Open ships of type",href:`/?type=${encodeURIComponent(t.type)}`};case"stalledInFlight":if("ship"===t.kind&&null!==t.machine)return{label:"Open machine",href:`/trierarchs/${t.machine.id}`};return"ship"===t.kind?{label:"Open ship",href:`/ships/${t.ship.id}`}:{label:"Open ships of type",href:`/?type=${encodeURIComponent(t.type)}`};case"undeliverable":return{label:"Resend or dismiss",href:s("undeliverable")}}},"placeName",0,a,"placeNote",0,function(e,t){let s=e.place;if("stalledInFlight"!==e.cause||"ship"!==s.kind)return null;let a=[...new Set(e.deliveries.map(e=>o[e.state]))].join(", ");if(null!==s.machine){let e=null===s.machine.lastSeenAt?"never seen":`last seen ${t.since(new Date(s.machine.lastSeenAt))}`;return`${a}, machine ${s.machine.name} ${e}`}let n=t.facts?.lastSeenAt??null;return null===n?a:`${a}, session last seen ${t.since(new Date(n))}`},"previewOf",0,function(e){return e.split("\n",1)[0]?.trim()??""},"stuckByMachine",0,function(e){let t=new Map;for(let s of e.stuck)"ship"===s.place.kind&&null!==s.place.machine&&t.set(s.place.machine.id,(t.get(s.place.machine.id)??0)+s.count);return t},"trendSentence",0,function(e){return e.count>e.dayAgo?`Up from ${String(e.dayAgo)} a day ago.`:e.count<e.dayAgo?`Down from ${String(e.dayAgo)} a day ago.`:"As many as a day ago."},"verdictOf",0,function(e){let[t]=e.stuck.map(e=>e.oldestSince).toSorted();if(void 0===t)return{kind:"delivering"};let s=e.stuckPerHour.at(-25)?.count??0;return{kind:"stuck",count:e.stuck.reduce((e,t)=>e+t.count,0),places:e.stuck.length,since:t,dayAgo:s}},"waitMinutes",0,function(e,t){return Math.max(0,(t.getTime()-Date.parse(e))/6e4)},"waitPosition",0,d],16634);var c=e.i(43476),m=e.i(90063);function u(e){return`${100*d(e)}%`}e.s(["WaitAxis",0,function({className:e}){return(0,c.jsx)("div",{"aria-hidden":!0,className:(0,m.classNames)("relative h-4 w-full text-micro text-muted-foreground",e),children:i.map((e,t)=>(0,c.jsx)("span",{className:(0,m.classNames)("absolute whitespace-nowrap",0===t?"":t===i.length-1?"-translate-x-full":"-translate-x-1/2"),style:{left:u(e.minutes)},children:e.label},e.minutes))})},"WaitStrip",0,function({waits:e,label:t,className:s}){let a=Math.max(0,...e);return(0,c.jsxs)("div",{role:"img","aria-label":t,"data-testid":"health-wait-strip",className:(0,m.classNames)("relative h-4 w-full",s),children:[(0,c.jsx)("span",{"aria-hidden":!0,className:"absolute inset-y-0 rounded-xs bg-muted",style:{left:u(10),right:`calc(100% - ${u(60)})`}}),(0,c.jsx)("span",{"aria-hidden":!0,className:"absolute inset-x-0 top-1/2 h-px bg-border"}),i.map(e=>(0,c.jsx)("span",{"aria-hidden":!0,className:"absolute top-1/4 h-1/2 w-px bg-border",style:{left:u(e.minutes)}},e.minutes)),(0,c.jsx)("span",{"aria-hidden":!0,className:"absolute top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-foreground opacity-35",style:{left:0,width:u(a)}}),e.map((e,t)=>(0,c.jsx)("span",{"aria-hidden":!0,className:"absolute top-1/2 size-2.5 -translate-1/2 rounded-full border-2 border-card bg-foreground",style:{left:u(e)}},`${e}-${String(t)}`))]})}],38614)},15385,e=>{"use strict";var t=e.i(43476),s=e.i(90063),a=e.i(14695);let n={running:"bg-tone-ok-fg",crewing:"bg-tone-active-fg",releasing:"bg-tone-active-fg",restarting:"bg-tone-waiting-fg",crashed:"bg-tone-attention-fg"};e.s(["CapacityBar",0,function({spots:e,caps:i,unknownText:r="Unknown",testId:l}){let d=(0,a.capacityLine)(e,i);if(void 0===i||void 0===d)return(0,t.jsx)("span",{"data-testid":l,className:"text-meta text-muted-foreground",children:r});let o=Math.max(0,i.ships-e.length);return(0,t.jsxs)("span",{role:"img","aria-label":d,"data-testid":l,className:"inline-flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsxs)("span",{"aria-hidden":!0,className:"inline-flex shrink-0 gap-0.5",children:[e.map((e,a)=>(0,t.jsx)("span",{title:`Spot ${String(a+1)}: ${e.name}, ${e.status}`,className:(0,s.classNames)("h-2 w-3 rounded-xs",n[e.status])},e.shipId)),Array.from({length:o},(s,a)=>(0,t.jsx)("span",{title:`Spot ${String(e.length+a+1)}: vacant`,className:"h-2 w-3 rounded-xs border border-input"},`free-${String(a)}`))]}),(0,t.jsx)("span",{className:"text-meta tabular-nums",children:d})]})}])},36556,e=>{"use strict";var t=e.i(43476),s=e.i(71567),a=e.i(52886),n=e.i(69644),i=e.i(69846),r=e.i(86875),l=e.i(66787),d=e.i(22016),o=e.i(66616),c=e.i(14695),m=e.i(49635),u=e.i(66390),h=e.i(15385),x=e.i(63481);let p={alive:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",silent:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg","not-started":"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg"},f={alive:"Alive",silent:"Not answering","not-started":"Not started"};function g({machine:e,now:s}){let n=(0,c.machineLiveness)(e),i=null===e.lastSeenAt?null:new Date(e.lastSeenAt);return(0,t.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-x-2 gap-y-1 text-meta","data-testid":"machine-liveness","data-liveness":n,children:[(0,t.jsxs)(u.Badge,{variant:"outline",className:p[n],children:["alive"===n?(0,t.jsx)(r.ShipWheel,{"aria-hidden":!0}):(0,t.jsx)(a.CircleDashed,{"aria-hidden":!0}),f[n]]}),null===i?(0,t.jsx)("span",{className:"text-muted-foreground",children:"· run its setup line on the machine"}):(0,t.jsxs)("time",{dateTime:e.lastSeenAt??void 0,title:(0,m.fullDateTime)(i),className:"text-muted-foreground tabular-nums",children:["· ","silent"===n?`since ${(0,m.clockTime)(i)}`:(0,m.lastSeen)(i,s).replace("Last seen","seen")]})]})}function b(e,t){let s=(0,m.relativeTime)(e,t);return"Just now"===s?"just now":s}function j({title:e,children:s,className:a}){return(0,t.jsxs)("div",{className:`flex min-w-0 flex-col gap-2 px-4.5 py-4 ${a??""}`,children:[(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:e}),s]})}function v({harness:e,now:a}){let n=(0,o.harnessDetection)(e,a);return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border py-2.5 first-of-type:border-t-0 first-of-type:pt-0",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-body font-medium [&_svg]:size-(--size-icon-sm) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(s.Bot,{"aria-hidden":!0}),(0,o.harnessWord)(e.harness),void 0===n?null:(0,t.jsx)("span",{className:"font-normal text-meta text-muted-foreground",children:n})]}),(0,c.harnessOptions)(e.options).map(e=>(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-meta",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e.name}),e.values.map(s=>(0,t.jsxs)("span",{className:"font-mono text-id whitespace-nowrap",children:[s,s===e.defaultValue?(0,t.jsx)("span",{className:"font-sans text-muted-foreground",children:" (default)"}):null]},s))]},e.name)),0===e.flags.length?null:(0,t.jsx)("span",{className:"flex flex-wrap items-center gap-1.5",children:e.flags.map(s=>e.riskyFlags?.includes(s)===!0?(0,t.jsxs)("code",{"data-testid":"machine-risky-flag",title:"Risky: every launch runs without its harness's safeguards",className:"inline-flex items-center gap-1 rounded-sm border border-tone-waiting-border bg-tone-waiting-bg px-1.5 font-mono text-id text-tone-waiting-fg [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(l.TriangleAlert,{"aria-hidden":!0}),s,(0,t.jsx)("span",{className:"sr-only",children:" (risky)"})]},s):(0,t.jsx)("code",{className:"rounded-sm bg-muted px-1.5 font-mono text-id",children:s},s))})]})}function y({title:e,icon:s,names:a}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-caption text-muted-foreground",children:e}),0===a.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"None"}):a.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[s,e]},e))]})}function w({workspaces:e}){return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(y,{title:"Repositories · a new worktree per ship",icon:(0,t.jsx)(i.GitBranch,{"aria-hidden":!0}),names:e.repositories}),(0,t.jsx)(y,{title:"Folders · used as they are",icon:(0,t.jsx)(n.FolderOpen,{"aria-hidden":!0}),names:e.folders})]})}e.s(["HarnessOffer",0,v,"MachineCard",0,function({machine:e,spots:s,location:a,now:n}){let{details:i,report:l}=e,o=null===l?null:new Date(l.reportedAt);return(0,t.jsxs)("section",{"aria-label":e.name,"data-testid":"machine-card",className:"grid grid-cols-[minmax(0,18.75rem)_minmax(0,1.25fr)_minmax(0,1fr)] divide-x divide-border rounded-lg border border-border bg-card shadow-sm max-lg:grid-cols-1 max-lg:divide-x-0 max-lg:divide-y",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-2.5 px-4.5 py-4",children:[(0,t.jsxs)(d.default,{href:`/trierarchs/${e.shipId}`,"data-testid":"machine-card-name",className:"inline-flex items-center gap-2 text-section font-semibold hover:underline [&_svg]:size-(--size-icon) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(r.ShipWheel,{"aria-hidden":!0}),e.name]}),(0,t.jsx)(g,{machine:e,now:n}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(x.LocationTag,{kind:a?.kind??null,description:a?.description}),null===i?null:(0,t.jsxs)("span",{className:"font-mono text-id",children:["· trierarch ",i.version]})]}),(0,t.jsx)("div",{role:"separator",className:"h-px bg-border"}),(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:"Capacity"}),(0,t.jsx)(h.CapacityBar,{spots:s,caps:i?.caps,testId:"machine-card-capacity",unknownText:null===o?"Unknown until it answers":`Unknown since ${(0,m.clockTime)(o)}`}),null===o?null:(0,t.jsxs)("time",{dateTime:l?.reportedAt,title:(0,m.fullDateTime)(o),className:"text-meta text-muted-foreground",children:["Last answer ",b(o,n)]})]}),(0,t.jsx)(j,{title:"Harnesses, options and flags",children:null===i?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):i.harnesses.map(e=>(0,t.jsx)(v,{harness:e,now:n},e.harness))}),(0,t.jsx)(j,{title:"Workspaces",children:null===i?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):(0,t.jsx)(w,{workspaces:i.workspaces})})]})},"MachineLiveness",0,g,"WorkspaceOffer",0,w,"lastAnswer",0,b])},66616,e=>{"use strict";var t=e.i(49635);let s={"claude-code":{word:"Claude Code",kind:"coding"},codex:{word:"Codex",kind:"coding"},"claude-chat":{word:"Claude chat",kind:"chat"},chatgpt:{word:"ChatGPT",kind:"chat"},grok:{word:"Grok",kind:"chat"},grokbot:{word:"Grokbot",kind:"bot"},console:{word:"Console",kind:"console"}};function a(e){return s[e]?.word??e}e.s(["crewLineHarnessWord",0,function(e){return"chat"===e?"Chat":a(e)},"harnessDetection",0,function(e,s){if(void 0===e.version)return;if(void 0===e.modelsConfirmedAt||null===e.modelsConfirmedAt)return`${e.version} \xb7 no model confirmed`;let a=(0,t.relativeTime)(new Date(e.modelsConfirmedAt),s);return`${e.version} \xb7 models confirmed ${"Just now"===a?"just now":a}`},"harnessKind",0,function(e){return s[e]?.kind},"harnessWord",0,a])},18423,e=>{"use strict";var t=e.i(12598),s=e.i(5861),a=e.i(71645),n=e.i(86413),i=e.i(27702);let r=new Set(["FleetInitialised","ShipCommissioned","ShipClaimed","LeaseRevoked","CredentialRevoked","StartingPromptIssued","ShipRetired","DeliveryAcknowledged","DeliveryUndeliverable","ShipReported","CrewRequested","CrewRequestRemoved","CrewAssigned","CrewStatusChanged","CrewRequestExplained","CrewRequestGivenBack","LabelAssigned","LabelUnassigned","LabelRetired"]),l=new Set(["LabelDefined","LabelValuesChanged","LabelRetired","LabelAssigned","LabelUnassigned","LabelDeleted"]),d=new Set(["DeliveryUndeliverable","DeliveryNotHandled","DeliveryDismissed"]),o=new Set(["NetworkRulesSet","NetworkRulesDraftSaved","NetworkRulesDraftDiscarded","NetworkRulesDeclared","BuiltInRuleChanged"]);e.s(["useLiveFleet",0,function(){let e=(0,i.useTRPC)(),c=(0,t.useQueryClient)(),[m,u]=(0,a.useState)(new Set),[h]=(0,a.useState)(()=>{let e,t,s,a;return e=new Set,t=new Set,s=e=>c.invalidateQueries({queryKey:e,exact:!0},{cancelRefetch:!1}),a=async a=>{e.add(a.queryHash);let n=a.isBehind;try{for(await s(a.queryKey);n||t.delete(a.queryHash);)n=!1,await s(a.queryKey)}finally{e.delete(a.queryHash)}},s=>{for(let n of c.getQueryCache().findAll({queryKey:s}))e.has(n.queryHash)?t.add(n.queryHash):a({queryHash:n.queryHash,queryKey:n.queryKey,isBehind:"fetching"===n.state.fetchStatus})}}),x=(0,s.useSubscription)(e.fleet.events.subscriptionOptions({lastEventId:null},{onData:({data:t})=>{var s,a,i,c,m;if("resync"===t.kind){h(e.fleet.pathKey()),h(n.INBOX_KEY);return}let{event:x}=t;for(let t of new Set([x.shipId,x.actorShipId]))null!==t&&(h(e.fleet.ship.queryKey({shipId:t})),h(e.fleet.shipTimeline.queryKey({shipId:t})),h(e.fleet.shipWay.queryKey({shipId:t})));if(null!==x.messageId&&(h(e.fleet.shipMessages.pathKey()),h(e.fleet.shipWay.pathKey()),h(e.fleet.message.queryKey({messageId:x.messageId})),h(e.fleet.inbox.pathKey()),h(n.INBOX_KEY),h(e.fleet.health.queryKey())),s=x.type,d.has(s)&&h(e.fleet.needsAttention.queryKey()),a=x.type,l.has(a)&&h(e.fleet.labels.queryKey()),"NetworkRulesDeclared"===x.type&&h(e.fleet.declaredNetworkRules.queryKey()),("BuiltInRuleChanged"===(i=x.type)||"NetworkRulesSet"===i)&&h(e.fleet.builtInRules.queryKey()),c=x.type,o.has(c)&&(h(e.fleet.networkRules.queryKey()),h(e.fleet.networkRulesDraftChanges.queryKey()),h(e.fleet.explainReach.pathKey())),m=x.type,!r.has(m))return;h(e.fleet.list.queryKey()),h(e.fleet.health.queryKey());let{shipId:p}=x;"ShipCommissioned"===x.type&&null!==p&&u(e=>new Set([...e,p]))}}));return{live:function(e){switch(e){case"pending":return"live";case"connecting":return"reconnecting";case"idle":case"error":return"offline"}}(x.status),newShipIds:m,error:x.error}}])},40798,e=>{"use strict";let t={DEVICE:"Device",CLOUD:"Cloud",SERVER:"Server",OTHER:"Other"};e.s(["locationKindWord",0,function(e){return t[e]}])},93361,e=>{"use strict";var t=e.i(49635);let s={working:"Working",blocked:"Blocked",idle:"Idle"};e.s(["REPORT_STATE_WORDS",0,s,"REPORT_TONES",0,{working:"active",blocked:"waiting",idle:"ended"},"reportAge",0,function(e,s){let a=Math.max(0,s.getTime()-e.getTime());return a<6e4?`${String(Math.floor(a/1e3))} s`:a<36e5?`${String(Math.floor(a/6e4))} min`:a<864e5?`${String(Math.floor(a/36e5))} h`:(0,t.relativeTime)(e,s)},"reportDetailsJson",0,function(e){return JSON.stringify(e,null,2)},"reportDetailsLabel",0,function(e){return`JSON \xb7 ${String(e)} bytes`},"reportText",0,function(e){let t=s[e.state];return null===e.note?t:`${t}: ${e.note}`},"reportedWhen",0,function(e,s){let a=(0,t.relativeTime)(e,s);return`reported ${"Just now"===a?"just now":a}`}])}]);
|
package/.next/standalone/packages/console/.next/static/chunks/{14e-f0w_cfqhg.js → 2vrrs04ad7ixx.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42047,e=>{"use strict";var t=e.i(43476),s=e.i(80799),n=e.i(22016),i=e.i(18566),a=e.i(71645),r=e.i(15905),l=e.i(65041),o=e.i(52886),d=e.i(85512),c=e.i(92870),u=e.i(90063);let p={ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg"};function h({label:e,shortLabel:s,value:i,detail:a,href:r,icon:l,tone:o,testId:d}){return(0,t.jsxs)(n.default,{href:r,"data-testid":d,className:"flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-card px-4.5 py-4 shadow-sm transition-colors duration-(--duration-fast) hover:bg-accent max-sm:gap-1.5 max-sm:rounded-xl max-sm:px-3.5 max-sm:py-3",children:[(0,t.jsxs)("span",{className:"flex items-center justify-between gap-2 text-meta font-medium text-muted-foreground",children:[(0,t.jsx)("span",{className:"max-sm:hidden",children:e}),(0,t.jsx)("span",{className:"sm:hidden",children:s??e}),(0,t.jsx)("span",{className:(0,u.classNames)("flex size-6.5 shrink-0 items-center justify-center rounded-md border max-sm:size-5.5",p[o]),children:(0,t.jsx)(l,{"aria-hidden":!0,className:"size-3.5"})})]}),(0,t.jsx)("span",{className:"text-[28px] leading-none font-semibold tracking-tight tabular-nums text-foreground max-sm:text-2xl",children:i}),(0,t.jsx)("span",{className:"truncate text-meta text-muted-foreground",children:a})]})}var m=e.i(5387),f=e.i(90437),x=e.i(96676),g=e.i(49635);function v(e){return e.filter(e=>"agent"===e.kind&&"retired"!==e.status)}function j(){var e;let s,n,i,a,r=(0,m.useFleetSnapshot)(),l=(0,f.useFleetHealth)(),u=(0,x.useNow)();if(!r.data)return null;let p=(i=(n=(s=v((e={ships:r.data,stuck:l.data?.stuck??[],now:u}).ships)).filter(e=>"awaitingCrew"===e.status)).flatMap(e=>null===e.awaitingCrewSince?[]:[{name:e.name,since:new Date(e.awaitingCrewSince)}]).sort((e,t)=>e.since.getTime()-t.since.getTime())[0],a=e.stuck.map(e=>new Date(e.oldestSince)).sort((e,t)=>e.getTime()-t.getTime())[0],{activeCount:s.length,crewedCount:s.filter(e=>"crewed"===e.status).length,awaitingCount:n.length,longestWait:i&&{name:i.name,wait:(0,g.duration)(i.since,e.now)},oldestStuck:a&&(0,g.duration)(a,e.now)});return 0===p.activeCount?null:(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4 max-sm:grid-cols-2 max-sm:gap-2.5","data-testid":"overview-metrics",children:[(0,t.jsx)(h,{label:"Ships crewed",shortLabel:"Crewed",value:p.crewedCount,detail:`of ${String(p.activeCount)} active ships`,href:"/?status=crewed",icon:c.UserCheck,tone:"ok",testId:"overview-crewed"}),(0,t.jsx)(h,{label:"Awaiting crew",value:p.awaitingCount,detail:p.longestWait?`Longest wait: ${p.longestWait.name}, ${p.longestWait.wait}`:"Every active ship is crewed",href:"/?status=awaitingCrew",icon:o.CircleDashed,tone:"waiting",testId:"overview-awaiting"}),(0,t.jsx)(h,{label:"Stuck",value:(0,f.stuckCountOf)(l.data)??0,detail:p.oldestStuck?`Deliveries stuck, oldest ${p.oldestStuck}`:"Delivering",href:"/fleet-health",icon:d.OctagonAlert,tone:"attention",testId:"overview-stuck"})]})}var w=e.i(77071),b=e.i(17540),S=e.i(25242),C=e.i(8041),y=e.i(78608),k=e.i(41880),N=e.i(49092),P=e.i(87600),R=e.i(16752),O=e.i(86165),I=e.i(48695),T=e.i(265);let q=(0,b.lazyDialog)(()=>e.A(38801).then(e=>e.CommissionDialog),e=>e.isOpen),E=(0,b.lazyDialog)(()=>e.A(95953).then(e=>e.StartingPromptDialog),e=>e.isOpen);function M({isOpen:e,onOpenChange:s}){var n;let i,l=(0,m.useFleetSnapshot)(),o=(0,N.useFleetLimits)(),d=(0,P.useHostedAccountUrl)(),c=(0,m.useCommissionShip)(),u=(0,m.useRequestCrew)(),p="connected"===(0,T.useTrierarchPluginConnection)(),h=(0,T.useMachines)(),f=(0,O.useSquadronsConnection)(),x=(0,I.useSquadrons)(),[g,v]=(0,a.useState)(!1),[j,b]=(0,a.useState)(null),A=(0,C.offersOf)(h.data??[]),L=(0,m.useLabelContext)(),{shipLabelsMax:z,fleetScopes:$}=(0,S.useConsoleConstants)(),D=(0,m.useFleetScopes)(),B=void 0===L||void 0===h.data?void 0:(0,y.machineLabelsInputOf)(L,{machines:h.data,shipLabelsMax:z}),V=(0,T.useCrewSettingsCheck)(e&&p?null===j?(0,C.settingsOf)((0,C.defaultValues)(A)):j:void 0),F=(l.data??[]).filter(e=>"retired"!==e.status),H=(e,t)=>{c.mutate(e,{onSuccess:({shipId:n})=>{s(!1);let i=p&&void 0!==t;i||v(!0),void 0!==t&&u.mutate({shipId:n,settings:t.settings},{onSuccess:()=>{i&&(0,k.showToast)({title:`${e.name} commissioned, crew requested`,description:"The trierarch plugin assigns a trierarch that fits.",tone:"success"})},onError:t=>{(0,k.showToast)({title:`Couldn’t request a crew for ${e.name}`,description:`${t.message} The ship is commissioned; request a crew on its page.`,tone:"error"})}})}})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Button,{variant:"primary",icon:(0,t.jsx)(w.Plus,{}),"data-testid":"fleet-commission",onClick:()=>{c.reset(),b(null),s(!0)},children:"Commission ship"}),(0,t.jsx)(q,{activeShips:F,isOpen:e,onOpenChange:s,isPending:c.isPending,error:c.error?.message,shipLimit:(0,R.shipLimitReached)(o.data),accountUrl:d,scopeGroups:void 0===D.data?void 0:(n=D.data,i=new Map(n.filter(({declaredBy:e})=>null===e).flatMap(({scopes:e})=>e.map(({scope:e,description:t})=>[e,t]))),[{title:"Fleet access",namespace:null,scopes:$.flatMap(e=>{let t=i.get(e);return void 0===t?[]:[{scope:e,description:t}]})},...n.flatMap(({namespace:e,declaredBy:t,scopes:s})=>null===t||0===s.length?[]:[{title:t.name,namespace:e,scopes:s.map(({scope:e,description:t})=>({scope:e,description:t}))}])]),...p?{crewRequest:{offers:A,squadrons:"connected"===f?(x.data??[]).filter(e=>"disbanded"!==e.state).map(e=>e.id):void 0,...void 0===B?{}:{machineLabels:B},check:V.data,onSettingsChange:b}}:{},onSubmit:(e,t)=>{let s={...e,idempotencyKey:crypto.randomUUID()};p&&void 0!==t?V.checkNow().catch(()=>void 0).then(e=>{e?.kind!=="refused"&&H(s,t)}).catch(()=>void 0):H(s,t)}}),(0,t.jsx)(E,{shipName:c.variables?.name??"",state:"shown",prompt:c.data?.prompt??void 0,crewLines:c.data?.crewLines??void 0,isOpen:g&&void 0!==c.data,onOpenChange:e=>{e||(v(!1),c.reset())},onConfirm:()=>void 0})]})}var A=e.i(56420);let L={name:"infinity",size:24,node:[["path",{d:"M6 16c5 0 7-8 12-8a4 4 0 0 1 0 8c-5 0-7-8-12-8a4 4 0 1 0 0 8",key:"18ogeb"}]]};L.node;let z=(0,A.default)(L);var $=e.i(30274),D=e.i(49287),B=e.i(78865);let V={ships:{label:"Ships",unit:"ships",Icon:D.Ship},messages:{label:"Messages today",unit:"messages",Icon:$.Send}},F={below:"bg-primary",at:"bg-tone-waiting-fg",over:"bg-tone-attention-fg"},H={at:"at-limit",over:"over-limit"};function U({kind:e,count:s,limit:n,resetsAt:i}){let{label:a,unit:r,Icon:l}=V[e],o=(0,R.meterState)({count:s,limit:n}),d=H[o],c=(0,R.meterCaption)({count:s,limit:n}),p=null===n?0:0===n?1:Math.min(s/n,1);return(0,t.jsxs)("div",{"data-testid":`limit-meter-${e}`,"data-state":o,className:"flex flex-col gap-2 rounded-lg border border-border bg-card p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta font-medium text-muted-foreground",children:[(0,t.jsx)(l,{"aria-hidden":!0,className:"size-(--size-icon-sm)"}),a]}),void 0===d?null:(0,t.jsx)(B.StatusBadge,{status:d})]}),(0,t.jsxs)("p",{className:"flex items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"text-metric font-semibold tabular-nums",children:(0,R.meterCount)(s)}),(0,t.jsx)("span",{className:"text-body text-muted-foreground",children:null===n?r:`of ${(0,R.meterCount)(n)} ${r}`})]}),null===n?(0,t.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(z,{"aria-hidden":!0,className:"size-(--size-icon-sm)"}),"No limit"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{role:"meter","aria-label":`${a}: ${String(s)} of ${String(n)}`,"aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":n,className:"block h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,t.jsx)("span",{className:(0,u.classNames)("block h-full rounded-full","none"===o?void 0:F[o]),style:{width:`${String(100*p)}%`}})}),(0,t.jsxs)("p",{"data-testid":`limit-meter-${e}-caption`,className:"text-caption text-muted-foreground",children:[c,void 0===i?null:` \xb7 resets at ${(0,R.resetTime)(i)}`]})]})]})}function _(){let e=(0,N.useFleetLimits)().data,s=(0,P.useHostedAccountUrl)();return(0,R.hasLimits)(e)?(0,t.jsxs)("section",{"aria-labelledby":"overview-limits-title","data-testid":"overview-limits",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("h2",{id:"overview-limits-title",className:"text-body font-semibold",children:"Limits"}),void 0===s?null:(0,t.jsx)("a",{href:s,"data-testid":"overview-limits-view",className:"text-meta font-medium text-primary underline underline-offset-2",children:"View limits"})]}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsx)(U,{kind:"ships",count:e.ships.count,limit:e.ships.limit}),(0,t.jsx)(U,{kind:"messages",count:e.dailyMessages.count,limit:e.dailyMessages.limit,resetsAt:e.dailyMessages.resetsAt})]})]}):null}var K=e.i(9176),W=e.i(84294),G=e.i(72382),X=e.i(31458),Y=e.i(69309),J=e.i(66595);let Q={name:"sliders-horizontal",size:24,node:[["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"}]]};Q.node;let Z=(0,A.default)(Q);var ee=e.i(26478);let et=["console","claudeCode","codex","trierarch","plugin","other"],es={console:"Console",claudeCode:"Claude Code",codex:"Codex",trierarch:"Trierarch",plugin:"Plugin",other:"Other"},en={"claude-code":"claudeCode",codex:"codex"};function ei(e){return et.some(t=>t===e)}let ea={awaitingCrew:"Awaiting crew",crewed:"Crewed",retired:"Retired"};function er(e,{column:t,squadronsOf:s}){switch(t){case"ship":return e.name;case"status":return ea[e.status];case"report":return"agent"===e.kind&&"crewed"===e.status?e.report?.note??void 0:void 0;case"squadronAndLabels":{let t=s?.get(e.id);if(void 0!==t&&null!==t.role)return t.squadronId;let[n]=e.labels;return void 0===n?void 0:`${n.key}=${n.value}`}case"runsOn":if("crewed"!==e.status||"viewer"===e.kind)return;return"operator"===e.kind?"console":e.harness??void 0;case"seen":return e.lastSeenAt??void 0}}var el=e.i(54492),eo=e.i(80581),ed=e.i(49841);let ec={query:"",filters:{status:[],crewRequest:[],kind:[],type:[],squadron:[],isRetiredShown:!1,labelValueIds:[]},sort:null},eu=new Set;function ep(e,t){return 0===e.length||void 0!==t&&e.includes(t)}function eh(e,t){return e.kind!==t.kind?"operator"===e.kind?-1:+("operator"===t.kind):0}function em(e,t){return[...new Set(e.filter(e=>t||"retired"!==e.status).map(e=>e.type))].toSorted((e,t)=>e.localeCompare(t))}function ef(e){return e.filter(e=>"retired"===e.status).length}function ex(e){return[...new Set([...e.values()].map(e=>e.squadronId))].toSorted((e,t)=>e.localeCompare(t))}let eg={crewed:"Crewed",awaitingCrew:"Awaiting crew"};function ev(e){return ew(e).length+e.labelValueIds.length}function ej(e,t){return 0===t.length?void 0:`${e}: ${t.join(", ")}`}function ew(e){return[ej("Status",e.status.map(e=>eg[e])),ej("Crew request",e.crewRequest.map(ed.crewRequestKeyWord)),ej("Kind",e.kind.map(e=>es[e])),ej("Type",e.type),ej("Squadron",e.squadron),e.isRetiredShown?"Retired shown":void 0].filter(e=>void 0!==e)}var eb=e.i(66390),eS=e.i(12470),eC=e.i(91727),ey=e.i(75305),ek=e.i(75867),eN=e.i(14732),eP=e.i(67874),eR=e.i(17981),eO=e.i(95960);function eI({chips:e,width:s,testId:i,href:a}){if(0===e.length)return null;let{shown:r,folded:l}=0===s?{shown:[],folded:e}:(0,eo.rowChips)(e,s);return(0,t.jsxs)("span",{"data-testid":i,className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r.map((e,s)=>(0,t.jsx)(eO.LabelChip,{chip:e,className:0===s?"min-w-0 shrink":void 0},e.valueId)),0===l.length?null:void 0===a?(0,t.jsxs)("span",{title:l.map(eo.chipTitleOf).join("; "),className:"inline-flex h-5.5 shrink-0 items-center rounded-sm bg-secondary px-1.5 text-caption font-medium text-foreground tabular-nums",children:["+",l.length,(0,t.jsx)("span",{className:"sr-only",children:" more labels"})]}):(0,t.jsxs)(n.default,{href:a,title:l.map(eo.chipTitleOf).join("; "),"aria-label":`View ${l.length} more labels`,className:"inline-flex h-5.5 shrink-0 items-center rounded-sm bg-secondary px-1.5 text-caption font-medium text-foreground tabular-nums hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:["+",l.length]})]})}var eT=e.i(88393);let eq={name:"signal",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}],["path",{d:"M17 20V8",key:"1tkaf5"}],["path",{d:"M22 4v16",key:"sih9yq"}]]};eq.node;let eE=(0,A.default)(eq),eM={name:"signal-low",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}]]};eM.node;let eA=(0,A.default)(eM),eL={name:"signal-medium",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}]]};eL.node;let ez=(0,A.default)(eL);e.s([],51047),e.i(51047);var e$=e.i(96499),eD=e.i(56789),eB=e.i(46376),eV=e.i(33332);let eF=a.createContext(void 0);function eH(e){let t=a.useContext(eF);if(void 0===t&&!e)throw Error((0,eV.default)(72));return t}var eU=e.i(74735),e_=e.i(67865),eK=e.i(29315),eW=e.i(84446),eG=e.i(57940);function eX(e){return null!=e&&null!=e.clientX}var eY=e.i(17989),eJ=e.i(75606),eQ=e.i(64111),eZ=e.i(76782),e0=e.i(26352),e1=e.i(56434),e2=e.i(18478),e4=e.i(16786),e5=e.i(90627);let e6={...e4.popupStoreSelectors,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class e7 extends e0.ReactStore{constructor(e,t,s){const n=new e5.PopupTriggerMap;super(e8(e,n,t,s),e3(n),e6)}setOpen=(e,t)=>{(0,eQ.applyPopupOpenChange)(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,(0,eJ.createChangeEventDetails)(e1.REASONS.triggerPress,e))}}function e8(e,t,s,n=!1){return{...(0,e4.createInitialPopupStoreState)(t,s,n),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function e3(e){return{popupRef:a.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}let e9=(0,e$.fastComponent)(function(e){let{disabled:s=!1,defaultOpen:n=!1,open:i,disableHoverablePopup:r=!1,trackCursorAxis:l="none",actionsRef:o,onOpenChange:d,onOpenChangeComplete:c,handle:u,triggerId:p,defaultTriggerId:h=null,children:m}=e,f=(0,eQ.usePopupRootStore)((e,t)=>new e7({open:n,openProp:i,activeTriggerId:h,triggerIdProp:p},e,t));f.useControlledProp("openProp",i),f.useControlledProp("triggerIdProp",p),f.useContextCallback("onOpenChange",d),f.useContextCallback("onOpenChangeComplete",c);let x=f.useState("open"),g=!s&&x,v=f.useState("activeTriggerId"),j=f.useState("mounted"),w=f.useState("payload");f.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:r,disabled:s}),(0,eQ.useImplicitActiveTrigger)(f,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:S}=(0,eQ.useOpenStateTransitions)(g,f),C=f.useState("isInstantPhase"),y=f.useState("instantType"),k=f.useState("lastOpenChangeReason"),N=a.useRef(null);(0,eB.useIsoLayoutEffect)(()=>{x&&s&&f.setOpen(!1,(0,eJ.createChangeEventDetails)(e1.REASONS.disabled))},[x,s,f]),(0,eB.useIsoLayoutEffect)(()=>{"ending"===S&&k===e1.REASONS.none||"ending"!==S&&C?("delay"!==y&&(N.current=y),f.set("instantType","delay")):null!==N.current&&(f.set("instantType",N.current),N.current=null)},[S,C,k,y,f]),(0,eB.useIsoLayoutEffect)(()=>{g&&null==v&&f.set("payload",void 0)},[f,v,g]),a.useImperativeHandle(o,()=>({unmount:b,close:()=>f.setOpen(!1,(0,eJ.createChangeEventDetails)(e1.REASONS.imperativeAction))}),[b,f]);let P=g||j||!s&&"none"!==l;return(0,t.jsxs)(eF.Provider,{value:f,children:[u&&(0,t.jsx)(eQ.PopupHandleAttachment,{handle:u,store:f}),P&&(0,t.jsx)(te,{store:f,disabled:s,trackCursorAxis:l}),"function"==typeof m?m({payload:w}):m]})});function te({store:e,disabled:t,trackCursorAxis:s}){let n=e.useState("floatingRootContext"),i=(0,eY.useDismiss)(n,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),r=function(e,t={}){let{enabled:s=!0,axis:n="both"}=t,i="rootStore"in e?e.rootStore:e,r=i.useState("open"),l=i.useState("floatingElement"),o=i.useState("domReferenceElement"),d=i.context.dataRef,c=a.useRef(!1),u=a.useRef(null),[p,h]=a.useState(),[m,f]=a.useState([]),x=(0,e_.useStableCallback)(e=>{i.set("positionReference",e)}),g=(0,e_.useStableCallback)((e,t,s)=>{if(!c.current&&(!d.current.openEvent||eX(d.current.openEvent))){var a,r;let l,c,u;i.set("positionReference",(a=s??o,r={x:e,y:t,axis:n,dataRef:d,pointerType:p},l=null,c=null,u=!1,{contextElement:a||void 0,getBoundingClientRect(){let e=a?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},t="x"===r.axis||"both"===r.axis,s="y"===r.axis||"both"===r.axis,n=["mouseenter","mousemove"].includes(r.dataRef.current.openEvent?.type||"")&&"touch"!==r.pointerType,i=e.width,o=e.height,d=e.x,p=e.y;return null==l&&r.x&&t&&(l=e.x-r.x),null==c&&r.y&&s&&(c=e.y-r.y),d-=l||0,p-=c||0,i=0,o=0,!u||n?(i="y"===r.axis?e.width:0,o="x"===r.axis?e.height:0,d=t&&null!=r.x?r.x:d,p=s&&null!=r.y?r.y:p):u&&!n&&(o="x"===r.axis?e.height:o,i="y"===r.axis?e.width:i),u=!0,{width:i,height:o,x:d,y:p,top:p,right:d+i,bottom:p+o,left:d}}}))}}),v=(0,e_.useStableCallback)(e=>{r?u.current||(g(e.clientX,e.clientY,e.currentTarget),f([])):g(e.clientX,e.clientY,e.currentTarget)}),j=(0,eG.isMouseLikePointerType)(p)?l:r;a.useEffect(()=>{if(!s)return void x(o);if(!j)return;function e(){u.current?.(),u.current=null}let t=(0,eK.getWindow)(l);return!d.current.openEvent||eX(d.current.openEvent)?u.current=(0,eU.addEventListener)(t,"mousemove",function(t){let s=(0,eW.getTarget)(t);(0,eW.contains)(l,s)?e():g(t.clientX,t.clientY)}):x(o),e},[j,s,l,d,o,i,g,x,m]),a.useEffect(()=>()=>{i.set("positionReference",null)},[i]),a.useEffect(()=>{s&&!l&&(c.current=!1)},[s,l]),a.useEffect(()=>{!s&&r&&(c.current=!0)},[s,r]);let w=a.useMemo(()=>{function e(e){h(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return a.useMemo(()=>s?{reference:w,trigger:w}:{},[s,w])}(n,{enabled:!t&&"none"!==s,axis:"none"===s?void 0:s}),l=a.useMemo(()=>(0,eZ.mergeProps)(r.reference,i.reference),[r.reference,i.reference]);return(0,eQ.usePopupInteractionProps)(e,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:i.floating??eD.EMPTY_OBJECT}),null}var tt=e.i(39957),ts=e.i(46265),tn=e.i(79938),ti=e.i(52245),ta=e.i(59636),tr=e.i(88015);let tl=a.createContext(void 0);var to=e.i(50316),td=e.i(44681);let tc=a.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new tt.Timeout,currentIdRef:{current:null},currentContextRef:{current:null}});function tu(e){let{children:s,delay:n,timeoutMs:i=0}=e,r=a.useRef(n),l=a.useRef(n),o=a.useRef(null),d=a.useRef(null),c=(0,tt.useTimeout)();return(0,eB.useIsoLayoutEffect)(()=>{if(l.current=n,!o.current){r.current=n;return}r.current={open:(0,td.getDelay)(r.current,"open"),close:(0,td.getDelay)(n,"close")}},[n,o,r,l]),(0,t.jsx)(tc.Provider,{value:a.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:l,currentIdRef:o,timeoutMs:i,currentContextRef:d,timeout:c}),[i,c]),children:s})}var tp=e.i(13082),th=e.i(72135),tm=e.i(73752),tf=e.i(22846);let tx="data-base-ui-tooltip-trigger";function tg(e){if("composedPath"in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let s=t[e];if((0,eK.isElement)(s))return s}}let t=e.target;return(0,eK.isElement)(t)?t:null}let tv=(0,e$.fastComponentRef)(function(e,t){let{render:s,className:n,style:i,handle:r,payload:l,disabled:o,delay:d,closeOnClick:c=!0,closeDelay:u,id:p,...h}=e,m=eH(!0),f=(0,ta.usePopupHandleStore)(r)??m;if(!f)throw Error((0,eV.default)(82));let x=(0,tr.useBaseUiId)(p),g=f.useState("isTriggerActive",x),v=f.useState("isOpenedByTrigger",x),j=f.useState("floatingRootContext"),w=a.useRef(null),b=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=(0,eQ.useTriggerDataForwarding)(x,w,f,{payload:l,closeOnClick:c,closeDelay:b}),y=a.useContext(tl),{activeIdRef:k,delayRef:N,isInstantPhase:P,hasProvider:R}=function(e,t={open:!1}){let{open:s}=t,n="rootStore"in e?e.rootStore:e,i=n.useState("floatingId"),{currentIdRef:r,delayRef:l,timeoutMs:o,initialDelayRef:d,currentContextRef:c,hasProvider:u,timeout:p}=a.useContext(tc),[h,m]=a.useState(!1),f=a.useRef(s);return(0,eB.useIsoLayoutEffect)(()=>{f.current=s},[s]),(0,eB.useIsoLayoutEffect)(()=>{function e(){c.current?.setIsInstantPhase(!1),r.current=null,c.current=null,l.current=d.current,p.clear()}if(r.current&&!s&&r.current===i){if(m(!1),o)return p.start(o,()=>{n.select("open")||r.current&&r.current!==i||e()}),()=>{(f.current||r.current!==i)&&p.clear()};e()}},[s,i,r,l,o,d,c,p,n]),(0,eB.useIsoLayoutEffect)(()=>{if(!s)return;let e=c.current,t=r.current;p.clear(),c.current={onOpenChange:n.setOpen,setIsInstantPhase:m},r.current=i,l.current={open:0,close:(0,td.getDelay)(d.current,"close")},null!==t&&t!==i?(m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,(0,eJ.createChangeEventDetails)(e1.REASONS.none))):(m(!1),e?.setIsInstantPhase(!1))},[s,i,n,r,l,d,c,p]),(0,eB.useIsoLayoutEffect)(()=>()=>{r.current===i&&(c.current=null,f.current)&&(r.current=null,l.current=d.current,p.clear())},[c,r,l,i,d,p]),a.useMemo(()=>({activeIdRef:r,hasProvider:u,delayRef:l,isInstantPhase:h}),[r,u,l,h])}(j,{open:v}),O=(0,tm.useHoverInteractionSharedState)(j);f.useSyncedValue("isInstantPhase",P);let I=f.useState("disabled"),T=o??I,q=(0,ts.useValueAsRef)(T),E=f.useState("trackCursorAxis"),M=f.useState("disableHoverablePopup"),A=a.useRef(!1),L=(0,tt.useTimeout)(),z=a.useRef(void 0);function $(){return R&&null!=k.current?0:d??y??600}function D(e){let t=w.current;if(!t||!e)return!1;let s=function(e){let t=e;for(;t;){let e=t.closest(`[${tx}]`);if(e)return e;let s=t.getRootNode();t="host"in s&&(0,eK.isElement)(s.host)?s.host:null}return null}(e);return null!==s&&s!==t&&(0,eW.contains)(t,s)}let B=(0,th.useHoverReferenceInteraction)(j,{enabled:!T,mouseOnly:!0,move:!1,handleClose:M||"both"===E?null:(0,to.safePolygon)(),restMs:$,delay:()=>null==u&&R?{close:(0,td.getDelay)(N.current,"close")}:{close:b},triggerElementRef:w,isActiveTrigger:g,isClosing:()=>"ending"===f.select("transitionStatus"),shouldOpen:()=>!A.current}),V=(0,tp.useFocus)(j,{enabled:!T}).reference,F=f.useState("triggerProps",C),H=C||"none"!==E;return(0,ti.useRenderElement)("button",e,{state:{open:v},ref:[t,S,w],props:[B,V,H?F:void 0,{onMouseOver(e){(e=>{let t,s=A.current,n=tg(e),i=(A.current=t=D(n),t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,L.clear()),t),a=w.current,r=a&&n&&(0,eW.contains)(a,n);if(i&&f.select("open")&&f.select("lastOpenChangeReason")===e1.REASONS.triggerHover)return f.setOpen(!1,(0,eJ.createChangeEventDetails)(e1.REASONS.triggerHover,e));if(s&&!i&&r&&!q.current&&!f.select("open")&&a&&(0,eG.isMouseLikePointerType)(z.current)){let t=()=>{A.current||q.current||f.select("open")||f.setOpen(!0,(0,eJ.createChangeEventDetails)(e1.REASONS.triggerHover,e,a))},s=$();0===s?(L.clear(),t()):L.start(s,t)}})(e.nativeEvent)},onFocus(e){D(tg(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){A.current=!1,L.clear(),z.current=void 0},onPointerEnter(e){z.current=e.pointerType},onPointerDown(e){z.current=e.pointerType,f.set("closeOnClick",c),c&&!f.select("open")&&f.cancelPendingOpen(e.nativeEvent)},onClick(e){c&&!f.select("open")&&f.cancelPendingOpen(e.nativeEvent)},id:x,[tf.triggerDisabled]:T?"":void 0,[tx]:T?void 0:""},h],stateAttributesMapping:tn.triggerOpenStateMapping})}),tj=a.createContext(void 0);var tw=e.i(74080),tb=e.i(26674);let tS=a.forwardRef(function(e,s){let{children:n,container:i,className:r,render:l,style:o,...d}=e,{node:c,subtree:u}=(0,tb.useFloatingPortalNode)({container:i,ref:s,componentProps:e,elementProps:d});return u||c?(0,t.jsxs)(a.Fragment,{children:[u,c&&tw.createPortal(n,c)]}):null}),tC=a.forwardRef(function(e,s){let{keepMounted:n=!1,...i}=e;return eH().useState("mounted")||n?(0,t.jsx)(tj.Provider,{value:n,children:(0,t.jsx)(tS,{ref:s,...i})}):null}),ty=a.createContext(void 0);function tk(){let e=a.useContext(ty);if(void 0===e)throw Error((0,eV.default)(71));return e}var tN=e.i(23706),tP=e.i(38396),tR=e.i(89579);let tO=a.forwardRef(function(e,s){let{render:n,className:i,anchor:r,positionMethod:l="absolute",side:o="top",align:d="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:p="clipping-ancestors",collisionPadding:h=5,arrowPadding:m=5,sticky:f=!1,disableAnchorTracking:x=!1,collisionAvoidance:g=tP.POPUP_COLLISION_AVOIDANCE,style:v,...j}=e,w=eH(),b=function(){let e=a.useContext(tj);if(void 0===e)throw Error((0,eV.default)(70));return e}(),S=w.useState("open"),C=w.useState("mounted"),y=w.useState("trackCursorAxis"),k=w.useState("disableHoverablePopup"),N=w.useState("floatingRootContext"),P=w.useState("instantType"),R=w.useState("transitionStatus"),O=w.useState("adaptiveOrigin"),I=(0,tN.useAnchorPositioning)({anchor:r,positionMethod:l,floatingRootContext:N,mounted:C,side:o,sideOffset:c,align:d,alignOffset:u,collisionBoundary:p,collisionPadding:h,sticky:f,arrowPadding:m,disableAnchorTracking:x,keepMounted:b,collisionAvoidance:g,adaptiveOrigin:O}),T=a.useMemo(()=>({open:S,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:"none"!==y?"tracking-cursor":P}),[S,I.side,I.align,I.anchorHidden,y,P]),q=(0,tR.usePositioner)(e,T,{styles:I.positionerStyles,transitionStatus:R,props:j,refs:[s,w.useStateSetter("positionerElement")],hidden:!C,inert:!S||"both"===y||k});return(0,t.jsx)(ty.Provider,{value:I,children:q})});var tI=e.i(37584),tT=e.i(53984),tq=e.i(31157);let tE=a.forwardRef(function(e,t){let{render:s,className:n,style:i,...a}=e,r=eH(),{side:l,align:o}=tk(),d=r.useState("open"),c=r.useState("instantType"),u=r.useState("transitionStatus"),p=r.useState("popupProps"),h=r.useState("floatingRootContext"),m=r.useState("disabled"),f=r.useState("closeDelay");(0,tI.useOpenChangeComplete)({open:d,ref:r.context.popupRef,onComplete(){d&&r.context.onOpenChangeComplete?.(!0)}}),(0,tq.useHoverFloatingInteraction)(h,{enabled:!m,closeDelay:f});let x=r.useStateSetter("popupElement");return(0,ti.useRenderElement)("div",e,{state:{open:d,side:l,align:o,instant:c,transitionStatus:u},ref:[t,r.context.popupRef,x],props:[eQ.FOCUSABLE_POPUP_PROPS,p,(0,tT.getDisabledMountTransitionStyles)(u),a],stateAttributesMapping:tn.popupTransitionStateMapping})}),tM=a.forwardRef(function(e,t){let{render:s,className:n,style:i,...a}=e,r=eH(),{arrowRef:l,side:o,align:d,arrowUncentered:c,arrowStyles:u}=tk(),p=r.useState("open"),h=r.useState("instantType");return(0,ti.useRenderElement)("div",e,{state:{open:p,side:o,align:d,uncentered:c,instant:h},ref:[t,l],props:[{style:u,"aria-hidden":!0},a],stateAttributesMapping:tn.popupStateMapping})});var tA=e.i(18390);let tL=a.forwardRef(function(e,t){let{render:s,className:n,style:i,children:a,...r}=e,l=eH(),o=tk(),d=l.useState("instantType"),{children:c,state:u}=(0,tA.usePopupViewport)({store:l,side:o.side,children:a}),p={activationDirection:u.activationDirection,transitioning:u.transitioning,instant:d};return(0,ti.useRenderElement)("div",e,{state:p,ref:t,props:[r,{children:c}],stateAttributesMapping:tA.popupViewportStateMapping})});var tz=e.i(64170);class t$ extends tz.BasePopupHandle{constructor(){super(function(){let e=new e5.PopupTriggerMap;return Object.assign(new e2.NullStore(Object.freeze(e8(void 0,e)),Object.freeze(e3(e)),e6),{setOpen:eD.NOOP,cancelPendingOpen:eD.NOOP})}(),"Tooltip")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}e.s(["Arrow",0,tM,"Handle",0,t$,"Popup",0,tE,"Portal",0,tC,"Positioner",0,tO,"Provider",0,function(e){let{delay:s,closeDelay:n,timeout:i=400}=e,r=a.useMemo(()=>({open:s,close:n}),[s,n]);return(0,t.jsx)(tl.Provider,{value:s,children:(0,t.jsx)(tu,{delay:r,timeoutMs:i,children:e.children})})},"Root",0,e9,"Trigger",0,tv,"Viewport",0,tL,"createHandle",0,function(){return new t$}],99643);var tD=e.i(99643),tD=tD;function tB(e){return(0,t.jsx)(tD.Root,{"data-slot":"tooltip",...e})}function tV(e){return(0,t.jsx)(tD.Trigger,{"data-slot":"tooltip-trigger",...e})}function tF({className:e,side:s="top",sideOffset:n=6,align:i="center",...a}){return(0,t.jsx)(tD.Portal,{children:(0,t.jsx)(tD.Positioner,{align:i,side:s,sideOffset:n,className:"isolate z-50 max-sm:hidden",children:(0,t.jsx)(tD.Popup,{"data-slot":"tooltip-content",className:(0,u.classNames)("w-fit max-w-xs origin-(--transform-origin) rounded-sm bg-foreground px-2 py-1 text-caption font-medium text-background shadow-md duration-(--duration-fast) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...a})})})}let tH={fresh:{Icon:eE,tone:"text-tone-ok-fg"},while:{Icon:ez,tone:"text-muted-foreground"},long:{Icon:eA,tone:"text-tone-waiting-fg"}};function tU({seenAt:e,now:s,testId:n}){let i;if(null===e)return null;let a=new Date(e),r=(i=s.getTime()-a.getTime())<6e4?"fresh":i<=9e5?"while":"long",{Icon:l,tone:o}=tH[r],d=(0,g.lastSeen)(a,s);return(0,t.jsxs)(tB,{children:[(0,t.jsx)(tV,{render:(0,t.jsx)("span",{role:"img","aria-label":d,"data-testid":n,"data-signal":r,className:(0,u.classNames)("inline-flex [&_svg]:size-(--size-icon) max-sm:[&_svg]:size-4",o)}),children:(0,t.jsx)(l,{"aria-hidden":!0})}),(0,t.jsx)(tF,{children:d})]})}var t_=e.i(63481);function tK({model:e,now:s}){let n=function(e,t){var s;let n=new Date(e.statedAt),i=Math.max(0,t.getTime()-n.getTime()),a=(s=e.id).startsWith("@")||/@\d+\.\d+\.\d+$/.test(s)?"Software":"Model";if(i<6e4)return`${a}, stated ${String(Math.floor(i/1e3))} s ago`;let r=(0,g.relativeTime)(n,t);return`${a}, stated ${r.charAt(0).toLowerCase()}${r.slice(1)}`}(e,s);return(0,t.jsxs)(tB,{children:[(0,t.jsxs)(tV,{render:(0,t.jsx)("span",{"data-testid":"fleet-model-hint",className:"min-w-0 truncate font-mono text-id text-muted-foreground"}),children:[e.id,(0,t.jsxs)("span",{className:"sr-only",children:[", ",n]})]}),(0,t.jsx)(tF,{children:(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"font-mono",children:e.id}),(0,t.jsx)("span",{children:n})]})})]})}var tW=e.i(81830),tG=e.i(1935),tX=e.i(39448),tY=e.i(46033);function tJ({label:e,items:s,picked:n,onPickedChange:i,size:a="sm",valueClassName:r,testId:l}){let o=function(e,t){let[s]=e;return void 0===s?{kind:"all"}:1===e.length?{kind:"one",word:t[s]??s}:{kind:"several",count:e.length}}(n,s);return(0,t.jsxs)(tY.Select,{multiple:!0,value:0===n.length?["all"]:[...n],onValueChange:e=>{i(n.length>0&&e.includes("all")?[]:e.filter(e=>"all"!==e))},children:[(0,t.jsx)(tY.SelectTrigger,{size:a,"aria-label":e,"data-testid":l,children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e}),"several"===o.kind?(0,t.jsxs)("span",{className:"inline-flex size-5 items-center justify-center rounded-full bg-primary text-caption font-semibold text-primary-foreground tabular-nums",children:[o.count,(0,t.jsx)("span",{className:"sr-only",children:" picked"})]}):(0,t.jsx)("span",{className:(0,u.classNames)("font-medium","one"===o.kind?r:void 0),children:"one"===o.kind?o.word:"All"})]})}),(0,t.jsxs)(tY.SelectContent,{children:[(0,t.jsx)(tY.SelectItem,{value:"all",children:"All"}),Object.entries(s).map(([e,s])=>(0,t.jsx)(tY.SelectItem,{value:e,className:r,children:s},e))]})]})}function tQ({label:e,allLabel:s="All",items:n,picked:i,onPickedChange:a,layout:l="chips",testId:o}){return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"text-meta font-medium text-muted-foreground",children:e}),(0,t.jsxs)("div",{role:"group","aria-label":e,"data-testid":o,className:"segments"===l?"flex gap-1.5 [&>*]:flex-1":"flex flex-wrap gap-1.5",children:[(0,t.jsx)(r.Button,{variant:0===i.length?"primary":"secondary",size:"touch","aria-pressed":0===i.length,onClick:()=>{a([])},children:s}),Object.entries(n).map(([e,s])=>{let n=i.includes(e);return(0,t.jsx)(r.Button,{variant:n?"primary":"secondary",size:"touch","aria-pressed":n,onClick:()=>{a(n?i.filter(t=>t!==e):[...i,e])},children:s},e)})]})]})}var tZ=e.i(16327),t0=e.i(68401),t1=e.i(70703),t2=e.i(6734);let t4=(0,t1.default)(()=>e.A(67858).then(e=>e.LabelPicker),{loadableGenerated:{modules:[59068]},ssr:!1});function t5({groups:e,picked:s,onPick:i,trigger:r}){let[l,o]=(0,a.useState)(!1);return(0,t.jsxs)(t2.Popover,{open:l,onOpenChange:o,children:[(0,t.jsx)(t2.PopoverTrigger,{render:r}),(0,t.jsxs)(t2.PopoverContent,{align:"start",sideOffset:6,className:"w-80 p-2","data-testid":"label-filter-popover",children:[(0,t.jsx)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:"Filter by label"}),(0,t.jsx)(t4,{groups:e,pickedValueIds:s.map(e=>e.valueId),onPick:e=>{i(e),o(!1)}}),(0,t.jsxs)("p",{className:"mt-2 flex items-center justify-between gap-2 border-t border-border px-2 pt-2 text-meta text-muted-foreground",children:["Exact matches, all must hold.",(0,t.jsx)(n.default,{href:"/labels",className:"font-medium text-foreground hover:underline","data-testid":"label-filter-manage",children:"Manage labels"})]})]})]})}function t6({groups:e,picked:n,onPick:i}){return(0,t.jsx)(t5,{groups:e,picked:n,onPick:i,trigger:(0,t.jsxs)(r.Button,{variant:"secondary",size:"sm",icon:(0,t.jsx)(s.Tag,{}),"data-testid":"fleet-filter-labels",children:["Labels",0===n.length?null:(0,t.jsxs)("span",{className:"inline-flex size-5 items-center justify-center rounded-full bg-primary text-caption font-semibold text-primary-foreground tabular-nums",children:[n.length,(0,t.jsx)("span",{className:"sr-only",children:" picked"})]}),(0,t.jsx)(tZ.ChevronDown,{"aria-hidden":!0,className:"text-muted-foreground"})]})})}function t7({groups:e,picked:s,onPick:n,onRemove:i,onClear:a}){return 0===s.length?null:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1.5 text-meta max-sm:hidden","data-testid":"fleet-picked-labels",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Ships with"}),s.map((e,s)=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[0===s?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:"and"}),(0,t.jsx)(eO.LabelChip,{chip:e,testId:"fleet-picked-label",onRemove:()=>{i(e.valueId)}})]},e.valueId)),(0,t.jsx)(t5,{groups:e,picked:s,onPick:n,trigger:(0,t.jsx)(r.Button,{variant:"ghost",size:"xs",icon:(0,t.jsx)(w.Plus,{}),children:"Add"})}),(0,t.jsx)("span",{"aria-hidden":!0,className:"h-4 w-px bg-border"}),(0,t.jsx)(r.Button,{variant:"ghost",size:"xs",onClick:a,"data-testid":"fleet-labels-clear",children:"Clear labels"})]})}function t8({groups:e,picked:s,onPick:i,onRemove:l}){let[o,d]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"fleet-filter-labels-touch",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 text-meta font-medium text-muted-foreground",children:["Labels ",(0,t.jsx)("span",{className:"font-normal",children:"all must hold"})]}),0===s.length?null:(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 text-meta",children:s.map((e,s)=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[0===s?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:"and"}),(0,t.jsx)(eO.LabelChip,{chip:e,onRemove:()=>{l(e.valueId)}})]},e.valueId))}),o?(0,t.jsx)("div",{className:"rounded-lg border border-border p-2",children:(0,t.jsx)(t4,{groups:e,pickedValueIds:s.map(e=>e.valueId),size:"touch",onPick:e=>{i(e),d(!1)}})}):(0,t.jsx)(r.Button,{variant:"secondary",size:"touch",icon:(0,t.jsx)(w.Plus,{}),className:"self-start",onClick:()=>{d(!0)},children:"Add label"}),(0,t.jsxs)(n.default,{href:"/labels",className:"inline-flex items-center gap-1.5 self-start text-meta text-muted-foreground hover:underline [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(t0.Tags,{"aria-hidden":!0}),"All labels and their owners"]})]})}function t3(e,t){return{...e,filters:{...e.filters,labelValueIds:t}}}function t9(e){return Object.hasOwn(eg,e)}function se(e){return Object.fromEntries((0,ed.crewRequestKeysOf)(e).map(e=>[e,(0,ed.crewRequestKeyWord)(e)]))}function st(e,t){return Object.hasOwn(t,e)}function ss(e){return Object.fromEntries(e.map(e=>[e,e]))}function sn({ship:e,squadron:s,isPluginShip:n}){return"operator"===e.kind?(0,t.jsxs)(eb.Badge,{variant:"kind",children:[(0,t.jsx)(ee.UserRound,{"aria-hidden":!0}),"operator"]}):"viewer"===e.kind?(0,t.jsxs)(eb.Badge,{variant:"kind","data-testid":"fleet-viewer",children:[(0,t.jsx)(G.Eye,{"aria-hidden":!0}),"viewer"]}):n?(0,t.jsxs)(eb.Badge,{variant:"kind","data-testid":"fleet-plugin",children:[(0,t.jsx)(Y.Plug,{"aria-hidden":!0}),"plugin"]}):s?.role===null?(0,t.jsxs)(eb.Badge,{variant:"kind","data-testid":"fleet-flagship",children:[(0,t.jsx)(X.Flag,{"aria-hidden":!0}),"flagship"]}):null}function si({ship:e,now:s}){return"crewed"!==e.status||"viewer"===e.kind?null:(0,t.jsxs)("span",{"data-testid":"fleet-runs-on",className:"flex min-w-0 items-center gap-3 max-sm:flex-wrap max-sm:gap-y-1",children:[(0,t.jsx)(t_.LocationTag,{kind:"operator"===e.kind&&null!==e.location?"DEVICE":e.location?.kind??null,description:e.location?.description,harness:"operator"===e.kind?"console":e.harness,size:"sm",className:"shrink-0"}),"agent"===e.kind&&null!==e.model?(0,t.jsx)(tK,{model:e.model,now:s}):null]})}function sa({ship:e,squadron:s,labels:n}){let i=s?.role===null?void 0:s,a=void 0===n?[]:(0,eo.chipsOf)(e,n).filter(e=>void 0===i||("squadron"!==e.key||e.value!==i.squadronId)&&("squadron-role"!==e.key||e.value!==i.role));return void 0===i&&0===a.length?null:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[void 0===i?null:(0,t.jsx)("span",{className:"min-w-0 shrink",title:null===i.role?i.squadronId:`${i.squadronId} \xb7 ${i.role}`,children:(0,t.jsx)(tG.SquadronTag,{squadronId:i.squadronId,size:"sm"})}),(0,t.jsx)(eI,{chips:a,width:22*(void 0===i),testId:"fleet-labels",href:`/ships/${e.id}`})]})}function sr({ship:e,now:s,next:n}){let i="agent"===e.kind&&"crewed"===e.status;return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 max-sm:flex-col max-sm:items-stretch [&:has(button)>[data-testid=fleet-report]]:hidden",children:[i?(0,t.jsx)(tW.ReportLine,{report:e.report,now:s,variant:"row",isTimeInTitle:!0,testId:"fleet-report"}):null,n]})}function sl({ships:e,view:s,onViewChange:n,size:i,squadronsOf:a,labels:l}){let o=se((0,S.useConsoleConstants)().crewStatuses),{filters:d}=s,c=ef(e),p="sm"===i?"fleet-show-retired":"fleet-show-retired-touch",h=e=>{n({...s,filters:{...d,...e}})},m="touch"===i;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tJ,{label:"Status",items:eg,picked:d.status,onPickedChange:e=>{h({status:e.filter(t9)})},size:i,testId:m?void 0:"fleet-filter-status"}),(0,t.jsx)(tJ,{label:"Crew request",items:o,picked:d.crewRequest,onPickedChange:e=>{h({crewRequest:e.filter(e=>st(e,o))})},size:i,testId:m?void 0:"fleet-filter-crew-request"}),(0,t.jsx)(tJ,{label:"Kind",items:es,picked:d.kind,onPickedChange:e=>{h({kind:e.filter(ei)})},size:i,testId:m?void 0:"fleet-filter-kind"}),(0,t.jsx)(tJ,{label:"Type",items:ss(em(e,d.isRetiredShown)),picked:d.type,onPickedChange:e=>{h({type:e})},size:i,valueClassName:"font-mono",testId:m?void 0:"fleet-filter-type"}),a&&(0,t.jsx)(tJ,{label:"Squadron",items:ss(ex(a)),picked:d.squadron,onPickedChange:e=>{h({squadron:e})},size:i,testId:m?void 0:"fleet-filter-squadron"}),void 0===l||m?null:(0,t.jsx)(t6,{groups:(0,eo.filterGroupsOf)(l),picked:(0,eo.pickedChips)(d.labelValueIds,l),onPick:e=>{n(t3(s,[...d.labelValueIds,e]))}}),ew(d).length>0&&!m?(0,t.jsx)(r.Button,{variant:"ghost",size:"xs","data-testid":"fleet-filters-clear",onClick:()=>{n({...s,filters:ec.filters})},children:"Clear filters"}):null,(0,t.jsxs)("div",{className:(0,u.classNames)("inline-flex items-center gap-2",m?"py-2":"sm:ml-auto"),children:[(0,t.jsx)(ek.Switch,{id:p,"data-testid":m?void 0:"fleet-show-retired",checked:d.isRetiredShown,onCheckedChange:e=>{h({isRetiredShown:e})}}),(0,t.jsxs)(eC.Label,{htmlFor:p,className:(0,u.classNames)("font-normal text-muted-foreground",m?"text-body-touch":"text-meta"),children:["Show retired (",c,")"]})]})]})}function so({ships:e,view:s,onViewChange:n,shownCount:i,squadronsOf:a,labels:l}){let o=se((0,S.useConsoleConstants)().crewStatuses),{filters:d}=s,c=e=>{n({...s,filters:{...d,...e}})},u=ev(d),p=ef(e);return(0,t.jsxs)(ey.Sheet,{children:[(0,t.jsx)(ey.SheetTrigger,{render:(0,t.jsx)(r.Button,{size:"touch",isIconOnly:!0,"aria-label":u>0?`Filter ships, ${String(u)} active`:"Filter ships","data-testid":"fleet-filters-open",icon:(0,t.jsx)(Z,{}),className:"relative sm:hidden",children:u>0?(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute top-1.5 right-1.5 size-2 rounded-full bg-primary"}):null})}),(0,t.jsxs)(ey.SheetContent,{side:"bottom",children:[(0,t.jsxs)(ey.SheetHeader,{className:"flex-row items-center justify-between",children:[(0,t.jsx)(ey.SheetTitle,{children:"Filter ships"}),(0,t.jsx)(r.Button,{variant:"ghost",size:"touch","data-testid":"fleet-filters-reset",onClick:()=>{n({...s,filters:ec.filters})},children:"Reset"})]}),(0,t.jsxs)(ey.SheetBody,{className:"flex flex-col gap-4 pb-4",children:[(0,t.jsx)(tQ,{label:"Status",layout:"segments",items:eg,picked:d.status,onPickedChange:e=>{c({status:e.filter(t9)})}}),(0,t.jsx)(tQ,{label:"Crew request",items:o,picked:d.crewRequest,onPickedChange:e=>{c({crewRequest:e.filter(e=>st(e,o))})}}),(0,t.jsx)(tQ,{label:"Kind",items:es,picked:d.kind,onPickedChange:e=>{c({kind:e.filter(ei)})},testId:"fleet-filter-kind-touch"}),(0,t.jsx)(tQ,{label:"Type",allLabel:"All types",items:ss(em(e,d.isRetiredShown)),picked:d.type,onPickedChange:e=>{c({type:e})}}),a&&(0,t.jsx)(tQ,{label:"Squadron",items:ss(ex(a)),picked:d.squadron,onPickedChange:e=>{c({squadron:e})}}),void 0===l?null:(0,t.jsx)(t8,{groups:(0,eo.filterGroupsOf)(l),picked:(0,eo.pickedChips)(d.labelValueIds,l),onPick:e=>{n(t3(s,[...d.labelValueIds,e]))},onRemove:e=>{n(t3(s,d.labelValueIds.filter(t=>t!==e)))}}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 py-1",children:[(0,t.jsxs)(eC.Label,{htmlFor:"fleet-show-retired-touch",className:"text-body-touch font-normal",children:["Show retired ships ",(0,t.jsxs)("span",{className:"text-muted-foreground",children:["(",p,")"]})]}),(0,t.jsx)(ek.Switch,{id:"fleet-show-retired-touch",checked:d.isRetiredShown,onCheckedChange:e=>{c({isRetiredShown:e})}})]}),(0,t.jsx)(ey.SheetClose,{render:(0,t.jsx)(r.Button,{size:"touch","data-testid":"fleet-filters-apply"}),children:1===i?"Show 1 ship":`Show ${String(i)} ships`})]})]})]})}function sd({view:e,onViewChange:s,labels:n}){let i=ew(e.filters),a=void 0===n?[]:(0,eo.pickedChips)(e.filters.labelValueIds,n);return 0===i.length&&0===a.length?null:(0,t.jsxs)("div",{className:"flex w-full flex-wrap items-center gap-1.5 sm:hidden","data-testid":"fleet-filter-chips",children:[i.map(e=>(0,t.jsx)(eb.Badge,{variant:"outline",className:"max-w-full truncate",children:e},e)),a.map(n=>(0,t.jsx)(eO.LabelChip,{chip:n,onRemove:()=>{s(t3(e,e.filters.labelValueIds.filter(e=>e!==n.valueId)))}},n.valueId)),(0,t.jsx)(r.Button,{variant:"ghost",size:"touch",onClick:()=>{s({...e,filters:ec.filters})},children:"Clear filters"})]})}function sc({ships:e,view:s,onViewChange:n,shownCount:i,squadronsOf:a,labels:r}){return(0,t.jsxs)("div",{"data-slot":"fleet-toolbar",className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"w-60 max-sm:min-w-0 max-sm:flex-1",children:(0,t.jsx)(eS.Input,{type:"search","aria-label":"Search ships by name or type",placeholder:"Search ships by name","data-testid":"fleet-search",value:s.query,onChange:e=>{n({...s,query:e.target.value})},leadingIcon:(0,t.jsx)(J.Search,{}),className:"h-(--size-control-sm) text-meta max-sm:h-(--size-control-touch) max-sm:text-input-touch"})}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 max-sm:hidden sm:flex-1",children:(0,t.jsx)(sl,{ships:e,view:s,onViewChange:n,squadronsOf:a,labels:r,size:"sm"})}),(0,t.jsx)(so,{ships:e,view:s,onViewChange:n,shownCount:i,squadronsOf:a,labels:r}),(0,t.jsx)(sd,{view:s,onViewChange:n,labels:r}),(0,t.jsxs)("p",{"aria-live":"polite",className:"text-meta text-muted-foreground tabular-nums max-sm:w-full",children:[i," of ",e.length," ships"]})]})}function su({ship:e}){return(0,t.jsx)(tX.ShipName,{name:e.name,shipId:e.id,isSuffixShown:"retired"===e.status,href:"operator"===e.kind?"/inbox":`/ships/${e.id}`,className:"[&_a]:max-sm:whitespace-normal [&_a]:max-sm:break-all [&_a]:max-sm:text-body-touch"})}let sp=[{column:"ship",head:"Ship"},{column:"status",head:"Status"},{column:"report",head:"Report"},{column:"squadronAndLabels",head:"Squadron and labels"},{column:"runsOn",head:"Runs on"},{column:"seen",head:"Seen"}];function sh({ships:e,highlightedShipIds:s,now:n,renderRowActions:i,squadronsOf:a,labels:r,pluginShipIds:l,sort:o,onSort:d}){return(0,t.jsx)("div",{className:"max-sm:hidden",children:(0,t.jsxs)(eN.Table,{"aria-label":"Ships",className:"min-w-320 table-fixed",children:[(0,t.jsxs)("colgroup",{children:[(0,t.jsx)("col",{className:"w-56"}),(0,t.jsx)("col",{className:"w-40"}),(0,t.jsx)("col",{className:"w-64"}),(0,t.jsx)("col",{className:"w-56"}),(0,t.jsx)("col",{className:"w-80"}),(0,t.jsx)("col",{className:"w-12"}),(0,t.jsx)("col",{className:"w-12"})]}),(0,t.jsx)(eN.TableHeader,{children:(0,t.jsxs)(eN.TableRow,{children:[sp.map(({column:e,head:s})=>void 0===d?(0,t.jsx)(eN.TableHead,{children:s},e):(0,t.jsx)(eN.TableSortHead,{"data-testid":`fleet-sort-${e}`,direction:o?.column===e?o.direction:null,onSort:()=>{d(e)},children:s},e)),(0,t.jsx)(eN.TableHead,{children:(0,t.jsx)("span",{className:"sr-only",children:"Actions"})})]})}),(0,t.jsx)(eN.TableBody,{children:e.map(e=>(0,t.jsxs)(eN.TableRow,{"data-testid":`fleet-row-${e.name}`,"data-new":s?.has(e.id)?"":void 0,className:"h-12",children:[(0,t.jsx)(eN.TableCell,{children:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 whitespace-nowrap",children:[(0,t.jsx)(su,{ship:e}),(0,t.jsx)(sn,{ship:e,squadron:a?.get(e.id),isPluginShip:l?.has(e.id)??!1})]})}),(0,t.jsx)(eN.TableCell,{children:(0,t.jsx)(B.StatusBadge,{status:e.status})}),(0,t.jsx)(eN.TableCell,{children:(0,t.jsx)(sr,{ship:e,now:n,next:i?.(e,"next")})}),(0,t.jsx)(eN.TableCell,{children:(0,t.jsx)(sa,{ship:e,squadron:a?.get(e.id),labels:r})}),(0,t.jsx)(eN.TableCell,{children:(0,t.jsx)(si,{ship:e,now:n})}),(0,t.jsx)(eN.TableCell,{children:(0,t.jsx)(tU,{seenAt:e.lastSeenAt,now:n,testId:"fleet-last-seen"})}),(0,t.jsx)(eN.TableCell,{className:"w-10 text-right",children:i?.(e,"table")})]},e.id))})]})})}function sm({ships:e,highlightedShipIds:s,now:n,renderRowActions:i,squadronsOf:a,pluginShipIds:r}){return(0,t.jsx)("ul",{"aria-label":"Ships",className:"overflow-hidden rounded-lg border border-border bg-card sm:hidden",children:e.map(e=>(0,t.jsxs)("li",{"data-testid":`fleet-card-${e.name}`,"data-new":s?.has(e.id)?"":void 0,className:"flex items-start gap-2 border-b border-border px-3.5 py-3 last:border-0 data-new:animate-highlight",children:[(0,t.jsxs)("div",{className:"flex min-w-0 grow flex-col gap-1.5",children:[(0,t.jsx)("div",{className:"text-body-touch",children:(0,t.jsx)(su,{ship:e})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(B.StatusBadge,{status:e.status}),(0,t.jsx)(sn,{ship:e,squadron:a?.get(e.id),isPluginShip:r?.has(e.id)??!1})]}),(0,t.jsx)(sa,{ship:e,squadron:a?.get(e.id)}),(0,t.jsx)(sr,{ship:e,now:n,next:i?.(e,"next")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1",children:[(0,t.jsx)(si,{ship:e,now:n}),(0,t.jsx)(tU,{seenAt:e.lastSeenAt,now:n})]})]}),i?.(e,"phone")]},e.id))})}function sf({ships:e,view:s,onViewChange:n,state:i,error:a,highlightedShipIds:l,now:o,renderRowActions:d,emptyAction:c,squadronsOf:u,labels:p,pluginShipIds:h}){var m,f,x;let g,v,j;if("loading"===i)return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"loading",className:"flex flex-col gap-3",children:[(0,t.jsx)(eT.LoadingSkeleton,{variant:"table",rows:6,label:"Loading the fleet",className:"max-sm:hidden"}),(0,t.jsx)(eT.LoadingSkeleton,{variant:"list",rows:5,label:"Loading the fleet",className:"sm:hidden"})]});if("error"===i)return(0,t.jsx)(eR.InlineError,{variant:"page",title:"Couldn’t load the fleet",description:"This page couldn’t reach the fleet server. Check that the server is running and reachable from this browser, then try again.",detail:a?.detail,onRetry:a?.onRetry});let w={highlightedShipIds:l,now:o,renderRowActions:d,squadronsOf:u,pluginShipIds:h};if(e.every(e=>"operator"===e.kind||"retired"===e.status)){let s=e.filter(e=>"operator"===e.kind);return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"empty",className:"flex flex-col gap-3",children:[(0,t.jsx)(sh,{ships:s,labels:p,...w}),(0,t.jsx)(sm,{ships:s,...w}),(0,t.jsx)(eP.EmptyState,{icon:(0,t.jsx)(D.Ship,{}),title:"No ships besides argo yet",description:"argo is your own ship: messages to the operator land in its inbox. Commission a ship to add an agent to the fleet.",action:c})]})}let b=(v=null===(m={...s,squadronsOf:u,pluginShipIds:h}).sort?eh:(f=m.sort,x=m.squadronsOf,g=("ascending"===f.direction?1:-1)*("seen"===f.column?-1:1),(e,t)=>{let s=er(e,{column:f.column,squadronsOf:x}),n=er(t,{column:f.column,squadronsOf:x});return void 0===s||void 0===n?Number(void 0===s)-Number(void 0===n):g*s.localeCompare(n,void 0,{sensitivity:"base"})}),e.filter(e=>{let t;return(""===(t=m.query.trim().toLowerCase())||e.name.toLowerCase().includes(t)||e.type.toLowerCase().includes(t))&&function(e,t){let{filters:s,squadronsOf:n,pluginShipIds:i=eu}=t;if("retired"===e.status&&!s.isRetiredShown)return!1;let a="retired"===e.status?void 0:e.status;return ep(s.squadron,n?.get(e.id)?.squadronId)&&ep(s.status,a)&&ep(s.crewRequest,(0,ed.crewRequestKey)((0,el.crewRequestStage)(e)))&&ep(s.kind,"operator"===e.kind||"viewer"===e.kind?"console":i.has(e.id)?"plugin":"trierarch"===e.type?"trierarch":(null===e.harness?void 0:en[e.harness])??"other")&&ep(s.type,e.type)&&(0,eo.carriesEvery)(e,s.labelValueIds)}(e,m)}).toSorted((e,t)=>v(e,t)||e.name.localeCompare(t.name)||e.id.localeCompare(t.id))),S=s.query.trim();return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"ready",className:"flex flex-col gap-3",children:[(0,t.jsx)(sc,{ships:e,view:s,onViewChange:n,shownCount:b.length,squadronsOf:u,labels:p}),void 0===p?null:(0,t.jsx)(t7,{groups:(0,eo.filterGroupsOf)(p),picked:(0,eo.pickedChips)(s.filters.labelValueIds,p),onPick:e=>{n(t3(s,[...s.filters.labelValueIds,e]))},onRemove:e=>{n(t3(s,s.filters.labelValueIds.filter(t=>t!==e)))},onClear:()=>{n(t3(s,[]))}}),0===b.length?(0,t.jsx)(eP.EmptyState,{variant:"no-results",title:""===S?"No ships match these filters.":`No ships match “${S}”.`,action:(0,t.jsx)(r.Button,{size:"xs","data-testid":"fleet-clear-filters",onClick:()=>{n({...ec,sort:s.sort})},children:(j=ev(s.filters)>0,""===S?"Clear filters":j?"Clear search and filters":"Clear search")})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(sh,{ships:b,labels:p,sort:s.sort,onSort:e=>{var t;n({...s,sort:(t=s.sort,t?.column!==e?{column:e,direction:"ascending"}:"ascending"===t.direction?{column:e,direction:"descending"}:null)})},...w}),(0,t.jsx)(sm,{ships:b,...w})]})]})}function sx({view:e,onViewChange:s,newShipIds:n,renderRowActions:i}){let a=(0,m.useFleetSnapshot)(),r=(0,x.useNow)(),l=(0,I.useSquadrons)(),o=(0,m.useLabelContext)(),d=(0,K.usePluginShipIds)();return(0,t.jsx)("section",{"aria-label":"Fleet",className:"flex flex-col gap-3",children:(0,t.jsx)(sf,{ships:a.data??[],view:e,onViewChange:s,state:a.isPending?"loading":a.isError?"error":"ready",error:{detail:a.error?.message,onRetry:()=>{a.refetch()}},highlightedShipIds:n,now:r,renderRowActions:i,squadronsOf:l.data?(0,W.shipsInSquadrons)(l.data):void 0,labels:o,pluginShipIds:d})})}var sg=e.i(21959),sv=e.i(15327),sj=e.i(77435),sw=e.i(77821),sb=e.i(87964),sS=e.i(62687),sC=e.i(90262),sy=e.i(18423),sk=e.i(78485),sN=e.i(3979);e.s(["OverviewPage",0,function({view:e,isCommissionAsked:o}){let d=(0,i.useRouter)(),c=(0,m.useFleetSnapshot)(),u=(0,sy.useLiveFleet)(),p=(0,sb.useConsoleFrame)(),h=(0,R.messageLimitReached)((0,N.useFleetLimits)().data),f=(0,P.useHostedAccountUrl)(),x=(0,sC.useAccess)(),g=(0,sN.usePluginNav)(),[w,b]=(0,a.useState)(!1),[S,C]=(0,a.useOptimistic)(e);(0,sk.useSignInWhenSessionEnds)([c.error,u.error]);let y=e=>{let t=(function(e){let t=new URLSearchParams;for(let[s,n]of(""!==e.query&&t.set("q",e.query),[["status",e.filters.status],["crew",e.filters.crewRequest],["kind",e.filters.kind],["type",e.filters.type],["squadron",e.filters.squadron]]))for(let e of n)t.append(s,e);for(let s of(e.filters.isRetiredShown&&t.set("retired","1"),e.filters.labelValueIds))t.append("label",s);return null!==e.sort&&(t.set("sort",e.sort.column),"descending"===e.sort.direction&&t.set("order","desc")),t})(e).toString();(0,a.startTransition)(()=>{C(e),d.replace(""===t?"/":`/?${t}`,{scroll:!1})})};return(0,t.jsxs)(sw.ListPage,{...p,title:"Fleet overview",description:c.data?function(e){let t=v(e.ships).length,s=e.ships.filter(e=>"agent"===e.kind&&"retired"===e.status).length;if(0===t&&0===s)return e.canCommission?"Only argo so far. Ships you commission appear here.":"Only argo so far.";let n=0===s?"":`, ${String(s)} retired`;return`${1===t?"1 active ship":`${String(t)} active ships`} and argo${n}. Changes appear as they happen.`}({ships:c.data,canCommission:x.canManage}):"Loading your fleet",primaryAction:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 max-sm:flex-col max-sm:items-stretch",children:[(0,t.jsx)(r.Button,{render:(0,t.jsx)(n.default,{href:"/labels"}),nativeButton:!1,icon:(0,t.jsx)(s.Tag,{}),"data-testid":"overview-labels",children:x.canDefineLabels?"Manage labels":"View labels"}),x.canManage?(0,t.jsx)(M,{isOpen:w||o,onOpenChange:t=>{b(t),!t&&o&&y(e)}}):null]}),live:u.live,children:[(0,t.jsx)(sS.FleetSegments,{active:"ships",needsCrewCount:g.needsCrewCount}),void 0===h?null:(0,t.jsx)(sj.LimitNotice,{...(0,R.messageLimitNotice)(h),accountUrl:f,testId:"overview-message-limit"}),(0,t.jsx)(_,{}),(0,t.jsx)(j,{}),(0,t.jsx)(sx,{view:S,onViewChange:y,newShipIds:u.newShipIds,renderRowActions:(e,s)=>(0,t.jsx)(sg.ShipActions,{ship:e,layout:"table"===s?"menu":"phone"===s?"sheet":"next",compose:l.ComposeMessage,crewLineFlow:sv.NewCrewLineFlow})})]})}],42047)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42047,e=>{"use strict";var t=e.i(43476),s=e.i(80799),n=e.i(22016),i=e.i(18566),a=e.i(71645),r=e.i(15905),l=e.i(65041),o=e.i(52886),d=e.i(85512),c=e.i(92870),u=e.i(90063);let p={ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg"};function h({label:e,shortLabel:s,value:i,detail:a,href:r,icon:l,tone:o,testId:d}){return(0,t.jsxs)(n.default,{href:r,"data-testid":d,className:"flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-card px-4.5 py-4 shadow-sm transition-colors duration-(--duration-fast) hover:bg-accent max-sm:gap-1.5 max-sm:rounded-xl max-sm:px-3.5 max-sm:py-3",children:[(0,t.jsxs)("span",{className:"flex items-center justify-between gap-2 text-meta font-medium text-muted-foreground",children:[(0,t.jsx)("span",{className:"max-sm:hidden",children:e}),(0,t.jsx)("span",{className:"sm:hidden",children:s??e}),(0,t.jsx)("span",{className:(0,u.classNames)("flex size-6.5 shrink-0 items-center justify-center rounded-md border max-sm:size-5.5",p[o]),children:(0,t.jsx)(l,{"aria-hidden":!0,className:"size-3.5"})})]}),(0,t.jsx)("span",{className:"text-[28px] leading-none font-semibold tracking-tight tabular-nums text-foreground max-sm:text-2xl",children:i}),(0,t.jsx)("span",{className:"truncate text-meta text-muted-foreground",children:a})]})}var m=e.i(5387),f=e.i(90437),x=e.i(96676),g=e.i(49635);function v(e){return e.filter(e=>"agent"===e.kind&&"retired"!==e.status)}function j(){var e;let s,n,i,a,r=(0,m.useFleetSnapshot)(),l=(0,f.useFleetHealth)(),u=(0,x.useNow)();if(!r.data)return null;let p=(i=(n=(s=v((e={ships:r.data,stuck:l.data?.stuck??[],now:u}).ships)).filter(e=>"awaitingCrew"===e.status)).flatMap(e=>null===e.awaitingCrewSince?[]:[{name:e.name,since:new Date(e.awaitingCrewSince)}]).sort((e,t)=>e.since.getTime()-t.since.getTime())[0],a=e.stuck.map(e=>new Date(e.oldestSince)).sort((e,t)=>e.getTime()-t.getTime())[0],{activeCount:s.length,crewedCount:s.filter(e=>"crewed"===e.status).length,awaitingCount:n.length,longestWait:i&&{name:i.name,wait:(0,g.duration)(i.since,e.now)},oldestStuck:a&&(0,g.duration)(a,e.now)});return 0===p.activeCount?null:(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4 max-sm:grid-cols-2 max-sm:gap-2.5","data-testid":"overview-metrics",children:[(0,t.jsx)(h,{label:"Ships crewed",shortLabel:"Crewed",value:p.crewedCount,detail:`of ${String(p.activeCount)} active ships`,href:"/?status=crewed",icon:c.UserCheck,tone:"ok",testId:"overview-crewed"}),(0,t.jsx)(h,{label:"Awaiting crew",value:p.awaitingCount,detail:p.longestWait?`Longest wait: ${p.longestWait.name}, ${p.longestWait.wait}`:"Every active ship is crewed",href:"/?status=awaitingCrew",icon:o.CircleDashed,tone:"waiting",testId:"overview-awaiting"}),(0,t.jsx)(h,{label:"Stuck",value:(0,f.stuckCountOf)(l.data)??0,detail:p.oldestStuck?`Deliveries stuck, oldest ${p.oldestStuck}`:"Delivering",href:"/fleet-health",icon:d.OctagonAlert,tone:"attention",testId:"overview-stuck"})]})}var w=e.i(77071),b=e.i(17540),S=e.i(25242),C=e.i(8041),y=e.i(78608),k=e.i(41880),N=e.i(49092),P=e.i(87600),R=e.i(16752),O=e.i(86165),I=e.i(48695),T=e.i(265);let q=(0,b.lazyDialog)(()=>e.A(38801).then(e=>e.CommissionDialog),e=>e.isOpen),E=(0,b.lazyDialog)(()=>e.A(95953).then(e=>e.StartingPromptDialog),e=>e.isOpen);function M({isOpen:e,onOpenChange:s}){var n;let i,l=(0,m.useFleetSnapshot)(),o=(0,N.useFleetLimits)(),d=(0,P.useHostedAccountUrl)(),c=(0,m.useCommissionShip)(),u=(0,m.useRequestCrew)(),p="connected"===(0,T.useTrierarchPluginConnection)(),h=(0,T.useMachines)(),f=(0,O.useSquadronsConnection)(),x=(0,I.useSquadrons)(),[g,v]=(0,a.useState)(!1),[j,b]=(0,a.useState)(null),A=(0,C.offersOf)(h.data??[]),L=(0,m.useLabelContext)(),{shipLabelsMax:z,fleetScopes:$}=(0,S.useConsoleConstants)(),D=(0,m.useFleetScopes)(),B=void 0===L||void 0===h.data?void 0:(0,y.machineLabelsInputOf)(L,{machines:h.data,shipLabelsMax:z}),V=(0,T.useCrewSettingsCheck)(e&&p?null===j?(0,C.settingsOf)((0,C.defaultValues)(A)):j:void 0),F=(l.data??[]).filter(e=>"retired"!==e.status),H=(e,t)=>{c.mutate(e,{onSuccess:({shipId:n})=>{s(!1);let i=p&&void 0!==t;i||v(!0),void 0!==t&&u.mutate({shipId:n,settings:t.settings},{onSuccess:()=>{i&&(0,k.showToast)({title:`${e.name} commissioned, crew requested`,description:"The trierarch plugin assigns a trierarch that fits.",tone:"success"})},onError:t=>{(0,k.showToast)({title:`Couldn’t request a crew for ${e.name}`,description:`${t.message} The ship is commissioned; request a crew on its page.`,tone:"error"})}})}})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Button,{variant:"primary",icon:(0,t.jsx)(w.Plus,{}),"data-testid":"fleet-commission",onClick:()=>{c.reset(),b(null),s(!0)},children:"Commission ship"}),(0,t.jsx)(q,{activeShips:F,isOpen:e,onOpenChange:s,isPending:c.isPending,error:c.error?.message,shipLimit:(0,R.shipLimitReached)(o.data),accountUrl:d,scopeGroups:void 0===D.data?void 0:(n=D.data,i=new Map(n.filter(({declaredBy:e})=>null===e).flatMap(({scopes:e})=>e.map(({scope:e,description:t})=>[e,t]))),[{title:"Fleet access",namespace:null,scopes:$.flatMap(e=>{let t=i.get(e);return void 0===t?[]:[{scope:e,description:t}]})},...n.flatMap(({namespace:e,declaredBy:t,scopes:s})=>null===t||0===s.length?[]:[{title:t.name,namespace:e,scopes:s.map(({scope:e,description:t})=>({scope:e,description:t}))}])]),...p?{crewRequest:{offers:A,squadrons:"connected"===f?(x.data??[]).filter(e=>"disbanded"!==e.state).map(e=>e.id):void 0,...void 0===B?{}:{machineLabels:B},check:V.data,onSettingsChange:b}}:{},onSubmit:(e,t)=>{let s={...e,idempotencyKey:crypto.randomUUID()};p&&void 0!==t?V.checkNow().catch(()=>void 0).then(e=>{e?.kind!=="refused"&&H(s,t)}).catch(()=>void 0):H(s,t)}}),(0,t.jsx)(E,{shipName:c.variables?.name??"",state:"shown",prompt:c.data?.prompt??void 0,crewLines:c.data?.crewLines??void 0,isOpen:g&&void 0!==c.data,onOpenChange:e=>{e||(v(!1),c.reset())},onConfirm:()=>void 0})]})}var A=e.i(56420);let L={name:"infinity",size:24,node:[["path",{d:"M6 16c5 0 7-8 12-8a4 4 0 0 1 0 8c-5 0-7-8-12-8a4 4 0 1 0 0 8",key:"18ogeb"}]]};L.node;let z=(0,A.default)(L);var $=e.i(30274),D=e.i(49287),B=e.i(78865);let V={ships:{label:"Ships",unit:"ships",Icon:D.Ship},messages:{label:"Messages today",unit:"messages",Icon:$.Send}},F={below:"bg-primary",at:"bg-tone-waiting-fg",over:"bg-tone-attention-fg"},H={at:"at-limit",over:"over-limit"};function U({kind:e,count:s,limit:n,resetsAt:i}){let{label:a,unit:r,Icon:l}=V[e],o=(0,R.meterState)({count:s,limit:n}),d=H[o],c=(0,R.meterCaption)({count:s,limit:n}),p=null===n?0:0===n?1:Math.min(s/n,1);return(0,t.jsxs)("div",{"data-testid":`limit-meter-${e}`,"data-state":o,className:"flex flex-col gap-2 rounded-lg border border-border bg-card p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta font-medium text-muted-foreground",children:[(0,t.jsx)(l,{"aria-hidden":!0,className:"size-(--size-icon-sm)"}),a]}),void 0===d?null:(0,t.jsx)(B.StatusBadge,{status:d})]}),(0,t.jsxs)("p",{className:"flex items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"text-metric font-semibold tabular-nums",children:(0,R.meterCount)(s)}),(0,t.jsx)("span",{className:"text-body text-muted-foreground",children:null===n?r:`of ${(0,R.meterCount)(n)} ${r}`})]}),null===n?(0,t.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(z,{"aria-hidden":!0,className:"size-(--size-icon-sm)"}),"No limit"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{role:"meter","aria-label":`${a}: ${String(s)} of ${String(n)}`,"aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":n,className:"block h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,t.jsx)("span",{className:(0,u.classNames)("block h-full rounded-full","none"===o?void 0:F[o]),style:{width:`${String(100*p)}%`}})}),(0,t.jsxs)("p",{"data-testid":`limit-meter-${e}-caption`,className:"text-caption text-muted-foreground",children:[c,void 0===i?null:` \xb7 resets at ${(0,R.resetTime)(i)}`]})]})]})}function _(){let e=(0,N.useFleetLimits)().data,s=(0,P.useHostedAccountUrl)();return(0,R.hasLimits)(e)?(0,t.jsxs)("section",{"aria-labelledby":"overview-limits-title","data-testid":"overview-limits",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("h2",{id:"overview-limits-title",className:"text-body font-semibold",children:"Limits"}),void 0===s?null:(0,t.jsx)("a",{href:s,"data-testid":"overview-limits-view",className:"text-meta font-medium text-primary underline underline-offset-2",children:"View limits"})]}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsx)(U,{kind:"ships",count:e.ships.count,limit:e.ships.limit}),(0,t.jsx)(U,{kind:"messages",count:e.dailyMessages.count,limit:e.dailyMessages.limit,resetsAt:e.dailyMessages.resetsAt})]})]}):null}var K=e.i(9176),W=e.i(84294),G=e.i(72382),X=e.i(31458),Y=e.i(69309),J=e.i(66595);let Q={name:"sliders-horizontal",size:24,node:[["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"}]]};Q.node;let Z=(0,A.default)(Q);var ee=e.i(26478);let et=["console","claudeCode","codex","trierarch","plugin","other"],es={console:"Console",claudeCode:"Claude Code",codex:"Codex",trierarch:"Trierarch",plugin:"Plugin",other:"Other"},en={"claude-code":"claudeCode",codex:"codex"};function ei(e){return et.some(t=>t===e)}let ea={awaitingCrew:"Awaiting crew",crewed:"Crewed",retired:"Retired"};function er(e,{column:t,squadronsOf:s}){switch(t){case"ship":return e.name;case"status":return ea[e.status];case"report":return"agent"===e.kind&&"crewed"===e.status?e.report?.note??void 0:void 0;case"squadronAndLabels":{let t=s?.get(e.id);if(void 0!==t&&null!==t.role)return t.squadronId;let[n]=e.labels;return void 0===n?void 0:`${n.key}=${n.value}`}case"runsOn":if("crewed"!==e.status||"viewer"===e.kind)return;return"operator"===e.kind?"console":e.harness??void 0;case"seen":return e.lastSeenAt??void 0}}var el=e.i(54492),eo=e.i(80581),ed=e.i(60356);let ec={query:"",filters:{status:[],crewRequest:[],kind:[],type:[],squadron:[],isRetiredShown:!1,labelValueIds:[]},sort:null},eu=new Set;function ep(e,t){return 0===e.length||void 0!==t&&e.includes(t)}function eh(e,t){return e.kind!==t.kind?"operator"===e.kind?-1:+("operator"===t.kind):0}function em(e,t){return[...new Set(e.filter(e=>t||"retired"!==e.status).map(e=>e.type))].toSorted((e,t)=>e.localeCompare(t))}function ef(e){return e.filter(e=>"retired"===e.status).length}function ex(e){return[...new Set([...e.values()].map(e=>e.squadronId))].toSorted((e,t)=>e.localeCompare(t))}let eg={crewed:"Crewed",awaitingCrew:"Awaiting crew"};function ev(e){return ew(e).length+e.labelValueIds.length}function ej(e,t){return 0===t.length?void 0:`${e}: ${t.join(", ")}`}function ew(e){return[ej("Status",e.status.map(e=>eg[e])),ej("Crew request",e.crewRequest.map(ed.crewRequestKeyWord)),ej("Kind",e.kind.map(e=>es[e])),ej("Type",e.type),ej("Squadron",e.squadron),e.isRetiredShown?"Retired shown":void 0].filter(e=>void 0!==e)}var eb=e.i(66390),eS=e.i(12470),eC=e.i(91727),ey=e.i(75305),ek=e.i(75867),eN=e.i(14732),eP=e.i(67874),eR=e.i(17981),eO=e.i(95960);function eI({chips:e,width:s,testId:i,href:a}){if(0===e.length)return null;let{shown:r,folded:l}=0===s?{shown:[],folded:e}:(0,eo.rowChips)(e,s);return(0,t.jsxs)("span",{"data-testid":i,className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r.map((e,s)=>(0,t.jsx)(eO.LabelChip,{chip:e,className:0===s?"min-w-0 shrink":void 0},e.valueId)),0===l.length?null:void 0===a?(0,t.jsxs)("span",{title:l.map(eo.chipTitleOf).join("; "),className:"inline-flex h-5.5 shrink-0 items-center rounded-sm bg-secondary px-1.5 text-caption font-medium text-foreground tabular-nums",children:["+",l.length,(0,t.jsx)("span",{className:"sr-only",children:" more labels"})]}):(0,t.jsxs)(n.default,{href:a,title:l.map(eo.chipTitleOf).join("; "),"aria-label":`View ${l.length} more labels`,className:"inline-flex h-5.5 shrink-0 items-center rounded-sm bg-secondary px-1.5 text-caption font-medium text-foreground tabular-nums hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:["+",l.length]})]})}var eT=e.i(88393);let eq={name:"signal",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}],["path",{d:"M17 20V8",key:"1tkaf5"}],["path",{d:"M22 4v16",key:"sih9yq"}]]};eq.node;let eE=(0,A.default)(eq),eM={name:"signal-low",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}]]};eM.node;let eA=(0,A.default)(eM),eL={name:"signal-medium",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}]]};eL.node;let ez=(0,A.default)(eL);e.s([],51047),e.i(51047);var e$=e.i(96499),eD=e.i(56789),eB=e.i(46376),eV=e.i(33332);let eF=a.createContext(void 0);function eH(e){let t=a.useContext(eF);if(void 0===t&&!e)throw Error((0,eV.default)(72));return t}var eU=e.i(74735),e_=e.i(67865),eK=e.i(29315),eW=e.i(84446),eG=e.i(57940);function eX(e){return null!=e&&null!=e.clientX}var eY=e.i(17989),eJ=e.i(75606),eQ=e.i(64111),eZ=e.i(76782),e0=e.i(26352),e1=e.i(56434),e2=e.i(18478),e5=e.i(16786),e4=e.i(90627);let e6={...e5.popupStoreSelectors,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class e7 extends e0.ReactStore{constructor(e,t,s){const n=new e4.PopupTriggerMap;super(e8(e,n,t,s),e3(n),e6)}setOpen=(e,t)=>{(0,eQ.applyPopupOpenChange)(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,(0,eJ.createChangeEventDetails)(e1.REASONS.triggerPress,e))}}function e8(e,t,s,n=!1){return{...(0,e5.createInitialPopupStoreState)(t,s,n),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function e3(e){return{popupRef:a.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}let e9=(0,e$.fastComponent)(function(e){let{disabled:s=!1,defaultOpen:n=!1,open:i,disableHoverablePopup:r=!1,trackCursorAxis:l="none",actionsRef:o,onOpenChange:d,onOpenChangeComplete:c,handle:u,triggerId:p,defaultTriggerId:h=null,children:m}=e,f=(0,eQ.usePopupRootStore)((e,t)=>new e7({open:n,openProp:i,activeTriggerId:h,triggerIdProp:p},e,t));f.useControlledProp("openProp",i),f.useControlledProp("triggerIdProp",p),f.useContextCallback("onOpenChange",d),f.useContextCallback("onOpenChangeComplete",c);let x=f.useState("open"),g=!s&&x,v=f.useState("activeTriggerId"),j=f.useState("mounted"),w=f.useState("payload");f.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:r,disabled:s}),(0,eQ.useImplicitActiveTrigger)(f,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:S}=(0,eQ.useOpenStateTransitions)(g,f),C=f.useState("isInstantPhase"),y=f.useState("instantType"),k=f.useState("lastOpenChangeReason"),N=a.useRef(null);(0,eB.useIsoLayoutEffect)(()=>{x&&s&&f.setOpen(!1,(0,eJ.createChangeEventDetails)(e1.REASONS.disabled))},[x,s,f]),(0,eB.useIsoLayoutEffect)(()=>{"ending"===S&&k===e1.REASONS.none||"ending"!==S&&C?("delay"!==y&&(N.current=y),f.set("instantType","delay")):null!==N.current&&(f.set("instantType",N.current),N.current=null)},[S,C,k,y,f]),(0,eB.useIsoLayoutEffect)(()=>{g&&null==v&&f.set("payload",void 0)},[f,v,g]),a.useImperativeHandle(o,()=>({unmount:b,close:()=>f.setOpen(!1,(0,eJ.createChangeEventDetails)(e1.REASONS.imperativeAction))}),[b,f]);let P=g||j||!s&&"none"!==l;return(0,t.jsxs)(eF.Provider,{value:f,children:[u&&(0,t.jsx)(eQ.PopupHandleAttachment,{handle:u,store:f}),P&&(0,t.jsx)(te,{store:f,disabled:s,trackCursorAxis:l}),"function"==typeof m?m({payload:w}):m]})});function te({store:e,disabled:t,trackCursorAxis:s}){let n=e.useState("floatingRootContext"),i=(0,eY.useDismiss)(n,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),r=function(e,t={}){let{enabled:s=!0,axis:n="both"}=t,i="rootStore"in e?e.rootStore:e,r=i.useState("open"),l=i.useState("floatingElement"),o=i.useState("domReferenceElement"),d=i.context.dataRef,c=a.useRef(!1),u=a.useRef(null),[p,h]=a.useState(),[m,f]=a.useState([]),x=(0,e_.useStableCallback)(e=>{i.set("positionReference",e)}),g=(0,e_.useStableCallback)((e,t,s)=>{if(!c.current&&(!d.current.openEvent||eX(d.current.openEvent))){var a,r;let l,c,u;i.set("positionReference",(a=s??o,r={x:e,y:t,axis:n,dataRef:d,pointerType:p},l=null,c=null,u=!1,{contextElement:a||void 0,getBoundingClientRect(){let e=a?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},t="x"===r.axis||"both"===r.axis,s="y"===r.axis||"both"===r.axis,n=["mouseenter","mousemove"].includes(r.dataRef.current.openEvent?.type||"")&&"touch"!==r.pointerType,i=e.width,o=e.height,d=e.x,p=e.y;return null==l&&r.x&&t&&(l=e.x-r.x),null==c&&r.y&&s&&(c=e.y-r.y),d-=l||0,p-=c||0,i=0,o=0,!u||n?(i="y"===r.axis?e.width:0,o="x"===r.axis?e.height:0,d=t&&null!=r.x?r.x:d,p=s&&null!=r.y?r.y:p):u&&!n&&(o="x"===r.axis?e.height:o,i="y"===r.axis?e.width:i),u=!0,{width:i,height:o,x:d,y:p,top:p,right:d+i,bottom:p+o,left:d}}}))}}),v=(0,e_.useStableCallback)(e=>{r?u.current||(g(e.clientX,e.clientY,e.currentTarget),f([])):g(e.clientX,e.clientY,e.currentTarget)}),j=(0,eG.isMouseLikePointerType)(p)?l:r;a.useEffect(()=>{if(!s)return void x(o);if(!j)return;function e(){u.current?.(),u.current=null}let t=(0,eK.getWindow)(l);return!d.current.openEvent||eX(d.current.openEvent)?u.current=(0,eU.addEventListener)(t,"mousemove",function(t){let s=(0,eW.getTarget)(t);(0,eW.contains)(l,s)?e():g(t.clientX,t.clientY)}):x(o),e},[j,s,l,d,o,i,g,x,m]),a.useEffect(()=>()=>{i.set("positionReference",null)},[i]),a.useEffect(()=>{s&&!l&&(c.current=!1)},[s,l]),a.useEffect(()=>{!s&&r&&(c.current=!0)},[s,r]);let w=a.useMemo(()=>{function e(e){h(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return a.useMemo(()=>s?{reference:w,trigger:w}:{},[s,w])}(n,{enabled:!t&&"none"!==s,axis:"none"===s?void 0:s}),l=a.useMemo(()=>(0,eZ.mergeProps)(r.reference,i.reference),[r.reference,i.reference]);return(0,eQ.usePopupInteractionProps)(e,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:i.floating??eD.EMPTY_OBJECT}),null}var tt=e.i(39957),ts=e.i(46265),tn=e.i(79938),ti=e.i(52245),ta=e.i(59636),tr=e.i(88015);let tl=a.createContext(void 0);var to=e.i(50316),td=e.i(44681);let tc=a.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new tt.Timeout,currentIdRef:{current:null},currentContextRef:{current:null}});function tu(e){let{children:s,delay:n,timeoutMs:i=0}=e,r=a.useRef(n),l=a.useRef(n),o=a.useRef(null),d=a.useRef(null),c=(0,tt.useTimeout)();return(0,eB.useIsoLayoutEffect)(()=>{if(l.current=n,!o.current){r.current=n;return}r.current={open:(0,td.getDelay)(r.current,"open"),close:(0,td.getDelay)(n,"close")}},[n,o,r,l]),(0,t.jsx)(tc.Provider,{value:a.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:l,currentIdRef:o,timeoutMs:i,currentContextRef:d,timeout:c}),[i,c]),children:s})}var tp=e.i(13082),th=e.i(72135),tm=e.i(73752),tf=e.i(22846);let tx="data-base-ui-tooltip-trigger";function tg(e){if("composedPath"in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let s=t[e];if((0,eK.isElement)(s))return s}}let t=e.target;return(0,eK.isElement)(t)?t:null}let tv=(0,e$.fastComponentRef)(function(e,t){let{render:s,className:n,style:i,handle:r,payload:l,disabled:o,delay:d,closeOnClick:c=!0,closeDelay:u,id:p,...h}=e,m=eH(!0),f=(0,ta.usePopupHandleStore)(r)??m;if(!f)throw Error((0,eV.default)(82));let x=(0,tr.useBaseUiId)(p),g=f.useState("isTriggerActive",x),v=f.useState("isOpenedByTrigger",x),j=f.useState("floatingRootContext"),w=a.useRef(null),b=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=(0,eQ.useTriggerDataForwarding)(x,w,f,{payload:l,closeOnClick:c,closeDelay:b}),y=a.useContext(tl),{activeIdRef:k,delayRef:N,isInstantPhase:P,hasProvider:R}=function(e,t={open:!1}){let{open:s}=t,n="rootStore"in e?e.rootStore:e,i=n.useState("floatingId"),{currentIdRef:r,delayRef:l,timeoutMs:o,initialDelayRef:d,currentContextRef:c,hasProvider:u,timeout:p}=a.useContext(tc),[h,m]=a.useState(!1),f=a.useRef(s);return(0,eB.useIsoLayoutEffect)(()=>{f.current=s},[s]),(0,eB.useIsoLayoutEffect)(()=>{function e(){c.current?.setIsInstantPhase(!1),r.current=null,c.current=null,l.current=d.current,p.clear()}if(r.current&&!s&&r.current===i){if(m(!1),o)return p.start(o,()=>{n.select("open")||r.current&&r.current!==i||e()}),()=>{(f.current||r.current!==i)&&p.clear()};e()}},[s,i,r,l,o,d,c,p,n]),(0,eB.useIsoLayoutEffect)(()=>{if(!s)return;let e=c.current,t=r.current;p.clear(),c.current={onOpenChange:n.setOpen,setIsInstantPhase:m},r.current=i,l.current={open:0,close:(0,td.getDelay)(d.current,"close")},null!==t&&t!==i?(m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,(0,eJ.createChangeEventDetails)(e1.REASONS.none))):(m(!1),e?.setIsInstantPhase(!1))},[s,i,n,r,l,d,c,p]),(0,eB.useIsoLayoutEffect)(()=>()=>{r.current===i&&(c.current=null,f.current)&&(r.current=null,l.current=d.current,p.clear())},[c,r,l,i,d,p]),a.useMemo(()=>({activeIdRef:r,hasProvider:u,delayRef:l,isInstantPhase:h}),[r,u,l,h])}(j,{open:v}),O=(0,tm.useHoverInteractionSharedState)(j);f.useSyncedValue("isInstantPhase",P);let I=f.useState("disabled"),T=o??I,q=(0,ts.useValueAsRef)(T),E=f.useState("trackCursorAxis"),M=f.useState("disableHoverablePopup"),A=a.useRef(!1),L=(0,tt.useTimeout)(),z=a.useRef(void 0);function $(){return R&&null!=k.current?0:d??y??600}function D(e){let t=w.current;if(!t||!e)return!1;let s=function(e){let t=e;for(;t;){let e=t.closest(`[${tx}]`);if(e)return e;let s=t.getRootNode();t="host"in s&&(0,eK.isElement)(s.host)?s.host:null}return null}(e);return null!==s&&s!==t&&(0,eW.contains)(t,s)}let B=(0,th.useHoverReferenceInteraction)(j,{enabled:!T,mouseOnly:!0,move:!1,handleClose:M||"both"===E?null:(0,to.safePolygon)(),restMs:$,delay:()=>null==u&&R?{close:(0,td.getDelay)(N.current,"close")}:{close:b},triggerElementRef:w,isActiveTrigger:g,isClosing:()=>"ending"===f.select("transitionStatus"),shouldOpen:()=>!A.current}),V=(0,tp.useFocus)(j,{enabled:!T}).reference,F=f.useState("triggerProps",C),H=C||"none"!==E;return(0,ti.useRenderElement)("button",e,{state:{open:v},ref:[t,S,w],props:[B,V,H?F:void 0,{onMouseOver(e){(e=>{let t,s=A.current,n=tg(e),i=(A.current=t=D(n),t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,L.clear()),t),a=w.current,r=a&&n&&(0,eW.contains)(a,n);if(i&&f.select("open")&&f.select("lastOpenChangeReason")===e1.REASONS.triggerHover)return f.setOpen(!1,(0,eJ.createChangeEventDetails)(e1.REASONS.triggerHover,e));if(s&&!i&&r&&!q.current&&!f.select("open")&&a&&(0,eG.isMouseLikePointerType)(z.current)){let t=()=>{A.current||q.current||f.select("open")||f.setOpen(!0,(0,eJ.createChangeEventDetails)(e1.REASONS.triggerHover,e,a))},s=$();0===s?(L.clear(),t()):L.start(s,t)}})(e.nativeEvent)},onFocus(e){D(tg(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){A.current=!1,L.clear(),z.current=void 0},onPointerEnter(e){z.current=e.pointerType},onPointerDown(e){z.current=e.pointerType,f.set("closeOnClick",c),c&&!f.select("open")&&f.cancelPendingOpen(e.nativeEvent)},onClick(e){c&&!f.select("open")&&f.cancelPendingOpen(e.nativeEvent)},id:x,[tf.triggerDisabled]:T?"":void 0,[tx]:T?void 0:""},h],stateAttributesMapping:tn.triggerOpenStateMapping})}),tj=a.createContext(void 0);var tw=e.i(74080),tb=e.i(26674);let tS=a.forwardRef(function(e,s){let{children:n,container:i,className:r,render:l,style:o,...d}=e,{node:c,subtree:u}=(0,tb.useFloatingPortalNode)({container:i,ref:s,componentProps:e,elementProps:d});return u||c?(0,t.jsxs)(a.Fragment,{children:[u,c&&tw.createPortal(n,c)]}):null}),tC=a.forwardRef(function(e,s){let{keepMounted:n=!1,...i}=e;return eH().useState("mounted")||n?(0,t.jsx)(tj.Provider,{value:n,children:(0,t.jsx)(tS,{ref:s,...i})}):null}),ty=a.createContext(void 0);function tk(){let e=a.useContext(ty);if(void 0===e)throw Error((0,eV.default)(71));return e}var tN=e.i(23706),tP=e.i(38396),tR=e.i(89579);let tO=a.forwardRef(function(e,s){let{render:n,className:i,anchor:r,positionMethod:l="absolute",side:o="top",align:d="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:p="clipping-ancestors",collisionPadding:h=5,arrowPadding:m=5,sticky:f=!1,disableAnchorTracking:x=!1,collisionAvoidance:g=tP.POPUP_COLLISION_AVOIDANCE,style:v,...j}=e,w=eH(),b=function(){let e=a.useContext(tj);if(void 0===e)throw Error((0,eV.default)(70));return e}(),S=w.useState("open"),C=w.useState("mounted"),y=w.useState("trackCursorAxis"),k=w.useState("disableHoverablePopup"),N=w.useState("floatingRootContext"),P=w.useState("instantType"),R=w.useState("transitionStatus"),O=w.useState("adaptiveOrigin"),I=(0,tN.useAnchorPositioning)({anchor:r,positionMethod:l,floatingRootContext:N,mounted:C,side:o,sideOffset:c,align:d,alignOffset:u,collisionBoundary:p,collisionPadding:h,sticky:f,arrowPadding:m,disableAnchorTracking:x,keepMounted:b,collisionAvoidance:g,adaptiveOrigin:O}),T=a.useMemo(()=>({open:S,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:"none"!==y?"tracking-cursor":P}),[S,I.side,I.align,I.anchorHidden,y,P]),q=(0,tR.usePositioner)(e,T,{styles:I.positionerStyles,transitionStatus:R,props:j,refs:[s,w.useStateSetter("positionerElement")],hidden:!C,inert:!S||"both"===y||k});return(0,t.jsx)(ty.Provider,{value:I,children:q})});var tI=e.i(37584),tT=e.i(53984),tq=e.i(31157);let tE=a.forwardRef(function(e,t){let{render:s,className:n,style:i,...a}=e,r=eH(),{side:l,align:o}=tk(),d=r.useState("open"),c=r.useState("instantType"),u=r.useState("transitionStatus"),p=r.useState("popupProps"),h=r.useState("floatingRootContext"),m=r.useState("disabled"),f=r.useState("closeDelay");(0,tI.useOpenChangeComplete)({open:d,ref:r.context.popupRef,onComplete(){d&&r.context.onOpenChangeComplete?.(!0)}}),(0,tq.useHoverFloatingInteraction)(h,{enabled:!m,closeDelay:f});let x=r.useStateSetter("popupElement");return(0,ti.useRenderElement)("div",e,{state:{open:d,side:l,align:o,instant:c,transitionStatus:u},ref:[t,r.context.popupRef,x],props:[eQ.FOCUSABLE_POPUP_PROPS,p,(0,tT.getDisabledMountTransitionStyles)(u),a],stateAttributesMapping:tn.popupTransitionStateMapping})}),tM=a.forwardRef(function(e,t){let{render:s,className:n,style:i,...a}=e,r=eH(),{arrowRef:l,side:o,align:d,arrowUncentered:c,arrowStyles:u}=tk(),p=r.useState("open"),h=r.useState("instantType");return(0,ti.useRenderElement)("div",e,{state:{open:p,side:o,align:d,uncentered:c,instant:h},ref:[t,l],props:[{style:u,"aria-hidden":!0},a],stateAttributesMapping:tn.popupStateMapping})});var tA=e.i(18390);let tL=a.forwardRef(function(e,t){let{render:s,className:n,style:i,children:a,...r}=e,l=eH(),o=tk(),d=l.useState("instantType"),{children:c,state:u}=(0,tA.usePopupViewport)({store:l,side:o.side,children:a}),p={activationDirection:u.activationDirection,transitioning:u.transitioning,instant:d};return(0,ti.useRenderElement)("div",e,{state:p,ref:t,props:[r,{children:c}],stateAttributesMapping:tA.popupViewportStateMapping})});var tz=e.i(64170);class t$ extends tz.BasePopupHandle{constructor(){super(function(){let e=new e4.PopupTriggerMap;return Object.assign(new e2.NullStore(Object.freeze(e8(void 0,e)),Object.freeze(e3(e)),e6),{setOpen:eD.NOOP,cancelPendingOpen:eD.NOOP})}(),"Tooltip")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}e.s(["Arrow",0,tM,"Handle",0,t$,"Popup",0,tE,"Portal",0,tC,"Positioner",0,tO,"Provider",0,function(e){let{delay:s,closeDelay:n,timeout:i=400}=e,r=a.useMemo(()=>({open:s,close:n}),[s,n]);return(0,t.jsx)(tl.Provider,{value:s,children:(0,t.jsx)(tu,{delay:r,timeoutMs:i,children:e.children})})},"Root",0,e9,"Trigger",0,tv,"Viewport",0,tL,"createHandle",0,function(){return new t$}],99643);var tD=e.i(99643),tD=tD;function tB(e){return(0,t.jsx)(tD.Root,{"data-slot":"tooltip",...e})}function tV(e){return(0,t.jsx)(tD.Trigger,{"data-slot":"tooltip-trigger",...e})}function tF({className:e,side:s="top",sideOffset:n=6,align:i="center",...a}){return(0,t.jsx)(tD.Portal,{children:(0,t.jsx)(tD.Positioner,{align:i,side:s,sideOffset:n,className:"isolate z-50 max-sm:hidden",children:(0,t.jsx)(tD.Popup,{"data-slot":"tooltip-content",className:(0,u.classNames)("w-fit max-w-xs origin-(--transform-origin) rounded-sm bg-foreground px-2 py-1 text-caption font-medium text-background shadow-md duration-(--duration-fast) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...a})})})}let tH={fresh:{Icon:eE,tone:"text-tone-ok-fg"},while:{Icon:ez,tone:"text-muted-foreground"},long:{Icon:eA,tone:"text-tone-waiting-fg"}};function tU({seenAt:e,now:s,testId:n}){let i;if(null===e)return null;let a=new Date(e),r=(i=s.getTime()-a.getTime())<6e4?"fresh":i<=9e5?"while":"long",{Icon:l,tone:o}=tH[r],d=(0,g.lastSeen)(a,s);return(0,t.jsxs)(tB,{children:[(0,t.jsx)(tV,{render:(0,t.jsx)("span",{role:"img","aria-label":d,"data-testid":n,"data-signal":r,className:(0,u.classNames)("inline-flex [&_svg]:size-(--size-icon) max-sm:[&_svg]:size-4",o)}),children:(0,t.jsx)(l,{"aria-hidden":!0})}),(0,t.jsx)(tF,{children:d})]})}var t_=e.i(63481);function tK({model:e,now:s}){let n=function(e,t){var s;let n=new Date(e.statedAt),i=Math.max(0,t.getTime()-n.getTime()),a=(s=e.id).startsWith("@")||/@\d+\.\d+\.\d+$/.test(s)?"Software":"Model";if(i<6e4)return`${a}, stated ${String(Math.floor(i/1e3))} s ago`;let r=(0,g.relativeTime)(n,t);return`${a}, stated ${r.charAt(0).toLowerCase()}${r.slice(1)}`}(e,s);return(0,t.jsxs)(tB,{children:[(0,t.jsxs)(tV,{render:(0,t.jsx)("span",{"data-testid":"fleet-model-hint",className:"min-w-0 truncate font-mono text-id text-muted-foreground"}),children:[e.id,(0,t.jsxs)("span",{className:"sr-only",children:[", ",n]})]}),(0,t.jsx)(tF,{children:(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"font-mono",children:e.id}),(0,t.jsx)("span",{children:n})]})})]})}var tW=e.i(81830),tG=e.i(1935),tX=e.i(39448),tY=e.i(46033);function tJ({label:e,items:s,picked:n,onPickedChange:i,size:a="sm",valueClassName:r,testId:l}){let o=function(e,t){let[s]=e;return void 0===s?{kind:"all"}:1===e.length?{kind:"one",word:t[s]??s}:{kind:"several",count:e.length}}(n,s);return(0,t.jsxs)(tY.Select,{multiple:!0,value:0===n.length?["all"]:[...n],onValueChange:e=>{i(n.length>0&&e.includes("all")?[]:e.filter(e=>"all"!==e))},children:[(0,t.jsx)(tY.SelectTrigger,{size:a,"aria-label":e,"data-testid":l,children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e}),"several"===o.kind?(0,t.jsxs)("span",{className:"inline-flex size-5 items-center justify-center rounded-full bg-primary text-caption font-semibold text-primary-foreground tabular-nums",children:[o.count,(0,t.jsx)("span",{className:"sr-only",children:" picked"})]}):(0,t.jsx)("span",{className:(0,u.classNames)("font-medium","one"===o.kind?r:void 0),children:"one"===o.kind?o.word:"All"})]})}),(0,t.jsxs)(tY.SelectContent,{children:[(0,t.jsx)(tY.SelectItem,{value:"all",children:"All"}),Object.entries(s).map(([e,s])=>(0,t.jsx)(tY.SelectItem,{value:e,className:r,children:s},e))]})]})}function tQ({label:e,allLabel:s="All",items:n,picked:i,onPickedChange:a,layout:l="chips",testId:o}){return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"text-meta font-medium text-muted-foreground",children:e}),(0,t.jsxs)("div",{role:"group","aria-label":e,"data-testid":o,className:"segments"===l?"flex gap-1.5 [&>*]:flex-1":"flex flex-wrap gap-1.5",children:[(0,t.jsx)(r.Button,{variant:0===i.length?"primary":"secondary",size:"touch","aria-pressed":0===i.length,onClick:()=>{a([])},children:s}),Object.entries(n).map(([e,s])=>{let n=i.includes(e);return(0,t.jsx)(r.Button,{variant:n?"primary":"secondary",size:"touch","aria-pressed":n,onClick:()=>{a(n?i.filter(t=>t!==e):[...i,e])},children:s},e)})]})]})}var tZ=e.i(16327),t0=e.i(68401),t1=e.i(70703),t2=e.i(6734);let t5=(0,t1.default)(()=>e.A(67858).then(e=>e.LabelPicker),{loadableGenerated:{modules:[59068]},ssr:!1});function t4({groups:e,picked:s,onPick:i,trigger:r}){let[l,o]=(0,a.useState)(!1);return(0,t.jsxs)(t2.Popover,{open:l,onOpenChange:o,children:[(0,t.jsx)(t2.PopoverTrigger,{render:r}),(0,t.jsxs)(t2.PopoverContent,{align:"start",sideOffset:6,className:"w-80 p-2","data-testid":"label-filter-popover",children:[(0,t.jsx)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:"Filter by label"}),(0,t.jsx)(t5,{groups:e,pickedValueIds:s.map(e=>e.valueId),onPick:e=>{i(e),o(!1)}}),(0,t.jsxs)("p",{className:"mt-2 flex items-center justify-between gap-2 border-t border-border px-2 pt-2 text-meta text-muted-foreground",children:["Exact matches, all must hold.",(0,t.jsx)(n.default,{href:"/labels",className:"font-medium text-foreground hover:underline","data-testid":"label-filter-manage",children:"Manage labels"})]})]})]})}function t6({groups:e,picked:n,onPick:i}){return(0,t.jsx)(t4,{groups:e,picked:n,onPick:i,trigger:(0,t.jsxs)(r.Button,{variant:"secondary",size:"sm",icon:(0,t.jsx)(s.Tag,{}),"data-testid":"fleet-filter-labels",children:["Labels",0===n.length?null:(0,t.jsxs)("span",{className:"inline-flex size-5 items-center justify-center rounded-full bg-primary text-caption font-semibold text-primary-foreground tabular-nums",children:[n.length,(0,t.jsx)("span",{className:"sr-only",children:" picked"})]}),(0,t.jsx)(tZ.ChevronDown,{"aria-hidden":!0,className:"text-muted-foreground"})]})})}function t7({groups:e,picked:s,onPick:n,onRemove:i,onClear:a}){return 0===s.length?null:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1.5 text-meta max-sm:hidden","data-testid":"fleet-picked-labels",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Ships with"}),s.map((e,s)=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[0===s?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:"and"}),(0,t.jsx)(eO.LabelChip,{chip:e,testId:"fleet-picked-label",onRemove:()=>{i(e.valueId)}})]},e.valueId)),(0,t.jsx)(t4,{groups:e,picked:s,onPick:n,trigger:(0,t.jsx)(r.Button,{variant:"ghost",size:"xs",icon:(0,t.jsx)(w.Plus,{}),children:"Add"})}),(0,t.jsx)("span",{"aria-hidden":!0,className:"h-4 w-px bg-border"}),(0,t.jsx)(r.Button,{variant:"ghost",size:"xs",onClick:a,"data-testid":"fleet-labels-clear",children:"Clear labels"})]})}function t8({groups:e,picked:s,onPick:i,onRemove:l}){let[o,d]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"fleet-filter-labels-touch",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 text-meta font-medium text-muted-foreground",children:["Labels ",(0,t.jsx)("span",{className:"font-normal",children:"all must hold"})]}),0===s.length?null:(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 text-meta",children:s.map((e,s)=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[0===s?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:"and"}),(0,t.jsx)(eO.LabelChip,{chip:e,onRemove:()=>{l(e.valueId)}})]},e.valueId))}),o?(0,t.jsx)("div",{className:"rounded-lg border border-border p-2",children:(0,t.jsx)(t5,{groups:e,pickedValueIds:s.map(e=>e.valueId),size:"touch",onPick:e=>{i(e),d(!1)}})}):(0,t.jsx)(r.Button,{variant:"secondary",size:"touch",icon:(0,t.jsx)(w.Plus,{}),className:"self-start",onClick:()=>{d(!0)},children:"Add label"}),(0,t.jsxs)(n.default,{href:"/labels",className:"inline-flex items-center gap-1.5 self-start text-meta text-muted-foreground hover:underline [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(t0.Tags,{"aria-hidden":!0}),"All labels and their owners"]})]})}function t3(e,t){return{...e,filters:{...e.filters,labelValueIds:t}}}function t9(e){return Object.hasOwn(eg,e)}function se(e){return Object.fromEntries((0,ed.crewRequestKeysOf)(e).map(e=>[e,(0,ed.crewRequestKeyWord)(e)]))}function st(e,t){return Object.hasOwn(t,e)}function ss(e){return Object.fromEntries(e.map(e=>[e,e]))}function sn({ship:e,squadron:s,isPluginShip:n}){return"operator"===e.kind?(0,t.jsxs)(eb.Badge,{variant:"kind",children:[(0,t.jsx)(ee.UserRound,{"aria-hidden":!0}),"operator"]}):"viewer"===e.kind?(0,t.jsxs)(eb.Badge,{variant:"kind","data-testid":"fleet-viewer",children:[(0,t.jsx)(G.Eye,{"aria-hidden":!0}),"viewer"]}):n?(0,t.jsxs)(eb.Badge,{variant:"kind","data-testid":"fleet-plugin",children:[(0,t.jsx)(Y.Plug,{"aria-hidden":!0}),"plugin"]}):s?.role===null?(0,t.jsxs)(eb.Badge,{variant:"kind","data-testid":"fleet-flagship",children:[(0,t.jsx)(X.Flag,{"aria-hidden":!0}),"flagship"]}):null}function si({ship:e,now:s}){return"crewed"!==e.status||"viewer"===e.kind?null:(0,t.jsxs)("span",{"data-testid":"fleet-runs-on",className:"flex min-w-0 items-center gap-3 max-sm:flex-wrap max-sm:gap-y-1",children:[(0,t.jsx)(t_.LocationTag,{kind:"operator"===e.kind&&null!==e.location?"DEVICE":e.location?.kind??null,description:e.location?.description,harness:"operator"===e.kind?"console":e.harness,size:"sm",className:"shrink-0"}),"agent"===e.kind&&null!==e.model?(0,t.jsx)(tK,{model:e.model,now:s}):null]})}function sa({ship:e,squadron:s,labels:n}){let i=s?.role===null?void 0:s,a=void 0===n?[]:(0,eo.chipsOf)(e,n).filter(e=>void 0===i||("squadron"!==e.key||e.value!==i.squadronId)&&("squadron-role"!==e.key||e.value!==i.role));return void 0===i&&0===a.length?null:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[void 0===i?null:(0,t.jsx)("span",{className:"min-w-0 shrink",title:null===i.role?i.squadronId:`${i.squadronId} \xb7 ${i.role}`,children:(0,t.jsx)(tG.SquadronTag,{squadronId:i.squadronId,size:"sm"})}),(0,t.jsx)(eI,{chips:a,width:22*(void 0===i),testId:"fleet-labels",href:`/ships/${e.id}`})]})}function sr({ship:e,now:s,next:n}){let i="agent"===e.kind&&"crewed"===e.status;return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 max-sm:flex-col max-sm:items-stretch [&:has(button)>[data-testid=fleet-report]]:hidden",children:[i?(0,t.jsx)(tW.ReportLine,{report:e.report,now:s,variant:"row",isTimeInTitle:!0,testId:"fleet-report"}):null,n]})}function sl({ships:e,view:s,onViewChange:n,size:i,squadronsOf:a,labels:l}){let o=se((0,S.useConsoleConstants)().crewStatuses),{filters:d}=s,c=ef(e),p="sm"===i?"fleet-show-retired":"fleet-show-retired-touch",h=e=>{n({...s,filters:{...d,...e}})},m="touch"===i;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tJ,{label:"Status",items:eg,picked:d.status,onPickedChange:e=>{h({status:e.filter(t9)})},size:i,testId:m?void 0:"fleet-filter-status"}),(0,t.jsx)(tJ,{label:"Crew request",items:o,picked:d.crewRequest,onPickedChange:e=>{h({crewRequest:e.filter(e=>st(e,o))})},size:i,testId:m?void 0:"fleet-filter-crew-request"}),(0,t.jsx)(tJ,{label:"Kind",items:es,picked:d.kind,onPickedChange:e=>{h({kind:e.filter(ei)})},size:i,testId:m?void 0:"fleet-filter-kind"}),(0,t.jsx)(tJ,{label:"Type",items:ss(em(e,d.isRetiredShown)),picked:d.type,onPickedChange:e=>{h({type:e})},size:i,valueClassName:"font-mono",testId:m?void 0:"fleet-filter-type"}),a&&(0,t.jsx)(tJ,{label:"Squadron",items:ss(ex(a)),picked:d.squadron,onPickedChange:e=>{h({squadron:e})},size:i,testId:m?void 0:"fleet-filter-squadron"}),void 0===l||m?null:(0,t.jsx)(t6,{groups:(0,eo.filterGroupsOf)(l),picked:(0,eo.pickedChips)(d.labelValueIds,l),onPick:e=>{n(t3(s,[...d.labelValueIds,e]))}}),ew(d).length>0&&!m?(0,t.jsx)(r.Button,{variant:"ghost",size:"xs","data-testid":"fleet-filters-clear",onClick:()=>{n({...s,filters:ec.filters})},children:"Clear filters"}):null,(0,t.jsxs)("div",{className:(0,u.classNames)("inline-flex items-center gap-2",m?"py-2":"sm:ml-auto"),children:[(0,t.jsx)(ek.Switch,{id:p,"data-testid":m?void 0:"fleet-show-retired",checked:d.isRetiredShown,onCheckedChange:e=>{h({isRetiredShown:e})}}),(0,t.jsxs)(eC.Label,{htmlFor:p,className:(0,u.classNames)("font-normal text-muted-foreground",m?"text-body-touch":"text-meta"),children:["Show retired (",c,")"]})]})]})}function so({ships:e,view:s,onViewChange:n,shownCount:i,squadronsOf:a,labels:l}){let o=se((0,S.useConsoleConstants)().crewStatuses),{filters:d}=s,c=e=>{n({...s,filters:{...d,...e}})},u=ev(d),p=ef(e);return(0,t.jsxs)(ey.Sheet,{children:[(0,t.jsx)(ey.SheetTrigger,{render:(0,t.jsx)(r.Button,{size:"touch",isIconOnly:!0,"aria-label":u>0?`Filter ships, ${String(u)} active`:"Filter ships","data-testid":"fleet-filters-open",icon:(0,t.jsx)(Z,{}),className:"relative sm:hidden",children:u>0?(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute top-1.5 right-1.5 size-2 rounded-full bg-primary"}):null})}),(0,t.jsxs)(ey.SheetContent,{side:"bottom",children:[(0,t.jsxs)(ey.SheetHeader,{className:"flex-row items-center justify-between",children:[(0,t.jsx)(ey.SheetTitle,{children:"Filter ships"}),(0,t.jsx)(r.Button,{variant:"ghost",size:"touch","data-testid":"fleet-filters-reset",onClick:()=>{n({...s,filters:ec.filters})},children:"Reset"})]}),(0,t.jsxs)(ey.SheetBody,{className:"flex flex-col gap-4 pb-4",children:[(0,t.jsx)(tQ,{label:"Status",layout:"segments",items:eg,picked:d.status,onPickedChange:e=>{c({status:e.filter(t9)})}}),(0,t.jsx)(tQ,{label:"Crew request",items:o,picked:d.crewRequest,onPickedChange:e=>{c({crewRequest:e.filter(e=>st(e,o))})}}),(0,t.jsx)(tQ,{label:"Kind",items:es,picked:d.kind,onPickedChange:e=>{c({kind:e.filter(ei)})},testId:"fleet-filter-kind-touch"}),(0,t.jsx)(tQ,{label:"Type",allLabel:"All types",items:ss(em(e,d.isRetiredShown)),picked:d.type,onPickedChange:e=>{c({type:e})}}),a&&(0,t.jsx)(tQ,{label:"Squadron",items:ss(ex(a)),picked:d.squadron,onPickedChange:e=>{c({squadron:e})}}),void 0===l?null:(0,t.jsx)(t8,{groups:(0,eo.filterGroupsOf)(l),picked:(0,eo.pickedChips)(d.labelValueIds,l),onPick:e=>{n(t3(s,[...d.labelValueIds,e]))},onRemove:e=>{n(t3(s,d.labelValueIds.filter(t=>t!==e)))}}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 py-1",children:[(0,t.jsxs)(eC.Label,{htmlFor:"fleet-show-retired-touch",className:"text-body-touch font-normal",children:["Show retired ships ",(0,t.jsxs)("span",{className:"text-muted-foreground",children:["(",p,")"]})]}),(0,t.jsx)(ek.Switch,{id:"fleet-show-retired-touch",checked:d.isRetiredShown,onCheckedChange:e=>{c({isRetiredShown:e})}})]}),(0,t.jsx)(ey.SheetClose,{render:(0,t.jsx)(r.Button,{size:"touch","data-testid":"fleet-filters-apply"}),children:1===i?"Show 1 ship":`Show ${String(i)} ships`})]})]})]})}function sd({view:e,onViewChange:s,labels:n}){let i=ew(e.filters),a=void 0===n?[]:(0,eo.pickedChips)(e.filters.labelValueIds,n);return 0===i.length&&0===a.length?null:(0,t.jsxs)("div",{className:"flex w-full flex-wrap items-center gap-1.5 sm:hidden","data-testid":"fleet-filter-chips",children:[i.map(e=>(0,t.jsx)(eb.Badge,{variant:"outline",className:"max-w-full truncate",children:e},e)),a.map(n=>(0,t.jsx)(eO.LabelChip,{chip:n,onRemove:()=>{s(t3(e,e.filters.labelValueIds.filter(e=>e!==n.valueId)))}},n.valueId)),(0,t.jsx)(r.Button,{variant:"ghost",size:"touch",onClick:()=>{s({...e,filters:ec.filters})},children:"Clear filters"})]})}function sc({ships:e,view:s,onViewChange:n,shownCount:i,squadronsOf:a,labels:r}){return(0,t.jsxs)("div",{"data-slot":"fleet-toolbar",className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"w-60 max-sm:min-w-0 max-sm:flex-1",children:(0,t.jsx)(eS.Input,{type:"search","aria-label":"Search ships by name or type",placeholder:"Search ships by name","data-testid":"fleet-search",value:s.query,onChange:e=>{n({...s,query:e.target.value})},leadingIcon:(0,t.jsx)(J.Search,{}),className:"h-(--size-control-sm) text-meta max-sm:h-(--size-control-touch) max-sm:text-input-touch"})}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 max-sm:hidden sm:flex-1",children:(0,t.jsx)(sl,{ships:e,view:s,onViewChange:n,squadronsOf:a,labels:r,size:"sm"})}),(0,t.jsx)(so,{ships:e,view:s,onViewChange:n,shownCount:i,squadronsOf:a,labels:r}),(0,t.jsx)(sd,{view:s,onViewChange:n,labels:r}),(0,t.jsxs)("p",{"aria-live":"polite",className:"text-meta text-muted-foreground tabular-nums max-sm:w-full",children:[i," of ",e.length," ships"]})]})}function su({ship:e}){return(0,t.jsx)(tX.ShipName,{name:e.name,shipId:e.id,isSuffixShown:"retired"===e.status,href:"operator"===e.kind?"/inbox":`/ships/${e.id}`,className:"[&_a]:max-sm:whitespace-normal [&_a]:max-sm:break-all [&_a]:max-sm:text-body-touch"})}let sp=[{column:"ship",head:"Ship"},{column:"status",head:"Status"},{column:"report",head:"Report"},{column:"squadronAndLabels",head:"Squadron and labels"},{column:"runsOn",head:"Runs on"},{column:"seen",head:"Seen"}];function sh({ships:e,highlightedShipIds:s,now:n,renderRowActions:i,squadronsOf:a,labels:r,pluginShipIds:l,sort:o,onSort:d}){return(0,t.jsx)("div",{className:"max-sm:hidden",children:(0,t.jsxs)(eN.Table,{"aria-label":"Ships",className:"min-w-320 table-fixed",children:[(0,t.jsxs)("colgroup",{children:[(0,t.jsx)("col",{className:"w-56"}),(0,t.jsx)("col",{className:"w-40"}),(0,t.jsx)("col",{className:"w-64"}),(0,t.jsx)("col",{className:"w-56"}),(0,t.jsx)("col",{className:"w-80"}),(0,t.jsx)("col",{className:"w-12"}),(0,t.jsx)("col",{className:"w-12"})]}),(0,t.jsx)(eN.TableHeader,{children:(0,t.jsxs)(eN.TableRow,{children:[sp.map(({column:e,head:s})=>void 0===d?(0,t.jsx)(eN.TableHead,{children:s},e):(0,t.jsx)(eN.TableSortHead,{"data-testid":`fleet-sort-${e}`,direction:o?.column===e?o.direction:null,onSort:()=>{d(e)},children:s},e)),(0,t.jsx)(eN.TableHead,{children:(0,t.jsx)("span",{className:"sr-only",children:"Actions"})})]})}),(0,t.jsx)(eN.TableBody,{children:e.map(e=>(0,t.jsxs)(eN.TableRow,{"data-testid":`fleet-row-${e.name}`,"data-new":s?.has(e.id)?"":void 0,className:"h-12",children:[(0,t.jsx)(eN.TableCell,{children:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 whitespace-nowrap",children:[(0,t.jsx)(su,{ship:e}),(0,t.jsx)(sn,{ship:e,squadron:a?.get(e.id),isPluginShip:l?.has(e.id)??!1})]})}),(0,t.jsx)(eN.TableCell,{children:(0,t.jsx)(B.StatusBadge,{status:e.status})}),(0,t.jsx)(eN.TableCell,{children:(0,t.jsx)(sr,{ship:e,now:n,next:i?.(e,"next")})}),(0,t.jsx)(eN.TableCell,{children:(0,t.jsx)(sa,{ship:e,squadron:a?.get(e.id),labels:r})}),(0,t.jsx)(eN.TableCell,{children:(0,t.jsx)(si,{ship:e,now:n})}),(0,t.jsx)(eN.TableCell,{children:(0,t.jsx)(tU,{seenAt:e.lastSeenAt,now:n,testId:"fleet-last-seen"})}),(0,t.jsx)(eN.TableCell,{className:"w-10 text-right",children:i?.(e,"table")})]},e.id))})]})})}function sm({ships:e,highlightedShipIds:s,now:n,renderRowActions:i,squadronsOf:a,pluginShipIds:r}){return(0,t.jsx)("ul",{"aria-label":"Ships",className:"overflow-hidden rounded-lg border border-border bg-card sm:hidden",children:e.map(e=>(0,t.jsxs)("li",{"data-testid":`fleet-card-${e.name}`,"data-new":s?.has(e.id)?"":void 0,className:"flex items-start gap-2 border-b border-border px-3.5 py-3 last:border-0 data-new:animate-highlight",children:[(0,t.jsxs)("div",{className:"flex min-w-0 grow flex-col gap-1.5",children:[(0,t.jsx)("div",{className:"text-body-touch",children:(0,t.jsx)(su,{ship:e})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(B.StatusBadge,{status:e.status}),(0,t.jsx)(sn,{ship:e,squadron:a?.get(e.id),isPluginShip:r?.has(e.id)??!1})]}),(0,t.jsx)(sa,{ship:e,squadron:a?.get(e.id)}),(0,t.jsx)(sr,{ship:e,now:n,next:i?.(e,"next")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1",children:[(0,t.jsx)(si,{ship:e,now:n}),(0,t.jsx)(tU,{seenAt:e.lastSeenAt,now:n})]})]}),i?.(e,"phone")]},e.id))})}function sf({ships:e,view:s,onViewChange:n,state:i,error:a,highlightedShipIds:l,now:o,renderRowActions:d,emptyAction:c,squadronsOf:u,labels:p,pluginShipIds:h}){var m,f,x;let g,v,j;if("loading"===i)return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"loading",className:"flex flex-col gap-3",children:[(0,t.jsx)(eT.LoadingSkeleton,{variant:"table",rows:6,label:"Loading the fleet",className:"max-sm:hidden"}),(0,t.jsx)(eT.LoadingSkeleton,{variant:"list",rows:5,label:"Loading the fleet",className:"sm:hidden"})]});if("error"===i)return(0,t.jsx)(eR.InlineError,{variant:"page",title:"Couldn’t load the fleet",description:"This page couldn’t reach the fleet server. Check that the server is running and reachable from this browser, then try again.",detail:a?.detail,onRetry:a?.onRetry});let w={highlightedShipIds:l,now:o,renderRowActions:d,squadronsOf:u,pluginShipIds:h};if(e.every(e=>"operator"===e.kind||"retired"===e.status)){let s=e.filter(e=>"operator"===e.kind);return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"empty",className:"flex flex-col gap-3",children:[(0,t.jsx)(sh,{ships:s,labels:p,...w}),(0,t.jsx)(sm,{ships:s,...w}),(0,t.jsx)(eP.EmptyState,{icon:(0,t.jsx)(D.Ship,{}),title:"No ships besides argo yet",description:"argo is your own ship: messages to the operator land in its inbox. Commission a ship to add an agent to the fleet.",action:c})]})}let b=(v=null===(m={...s,squadronsOf:u,pluginShipIds:h}).sort?eh:(f=m.sort,x=m.squadronsOf,g=("ascending"===f.direction?1:-1)*("seen"===f.column?-1:1),(e,t)=>{let s=er(e,{column:f.column,squadronsOf:x}),n=er(t,{column:f.column,squadronsOf:x});return void 0===s||void 0===n?Number(void 0===s)-Number(void 0===n):g*s.localeCompare(n,void 0,{sensitivity:"base"})}),e.filter(e=>{let t;return(""===(t=m.query.trim().toLowerCase())||e.name.toLowerCase().includes(t)||e.type.toLowerCase().includes(t))&&function(e,t){let{filters:s,squadronsOf:n,pluginShipIds:i=eu}=t;if("retired"===e.status&&!s.isRetiredShown)return!1;let a="retired"===e.status?void 0:e.status;return ep(s.squadron,n?.get(e.id)?.squadronId)&&ep(s.status,a)&&ep(s.crewRequest,(0,ed.crewRequestKey)((0,el.crewRequestStage)(e)))&&ep(s.kind,"operator"===e.kind||"viewer"===e.kind?"console":i.has(e.id)?"plugin":"trierarch"===e.type?"trierarch":(null===e.harness?void 0:en[e.harness])??"other")&&ep(s.type,e.type)&&(0,eo.carriesEvery)(e,s.labelValueIds)}(e,m)}).toSorted((e,t)=>v(e,t)||e.name.localeCompare(t.name)||e.id.localeCompare(t.id))),S=s.query.trim();return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"ready",className:"flex flex-col gap-3",children:[(0,t.jsx)(sc,{ships:e,view:s,onViewChange:n,shownCount:b.length,squadronsOf:u,labels:p}),void 0===p?null:(0,t.jsx)(t7,{groups:(0,eo.filterGroupsOf)(p),picked:(0,eo.pickedChips)(s.filters.labelValueIds,p),onPick:e=>{n(t3(s,[...s.filters.labelValueIds,e]))},onRemove:e=>{n(t3(s,s.filters.labelValueIds.filter(t=>t!==e)))},onClear:()=>{n(t3(s,[]))}}),0===b.length?(0,t.jsx)(eP.EmptyState,{variant:"no-results",title:""===S?"No ships match these filters.":`No ships match “${S}”.`,action:(0,t.jsx)(r.Button,{size:"xs","data-testid":"fleet-clear-filters",onClick:()=>{n({...ec,sort:s.sort})},children:(j=ev(s.filters)>0,""===S?"Clear filters":j?"Clear search and filters":"Clear search")})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(sh,{ships:b,labels:p,sort:s.sort,onSort:e=>{var t;n({...s,sort:(t=s.sort,t?.column!==e?{column:e,direction:"ascending"}:"ascending"===t.direction?{column:e,direction:"descending"}:null)})},...w}),(0,t.jsx)(sm,{ships:b,...w})]})]})}function sx({view:e,onViewChange:s,newShipIds:n,renderRowActions:i}){let a=(0,m.useFleetSnapshot)(),r=(0,x.useNow)(),l=(0,I.useSquadrons)(),o=(0,m.useLabelContext)(),d=(0,K.usePluginShipIds)();return(0,t.jsx)("section",{"aria-label":"Fleet",className:"flex flex-col gap-3",children:(0,t.jsx)(sf,{ships:a.data??[],view:e,onViewChange:s,state:a.isPending?"loading":a.isError?"error":"ready",error:{detail:a.error?.message,onRetry:()=>{a.refetch()}},highlightedShipIds:n,now:r,renderRowActions:i,squadronsOf:l.data?(0,W.shipsInSquadrons)(l.data):void 0,labels:o,pluginShipIds:d})})}var sg=e.i(21959),sv=e.i(15327),sj=e.i(77435),sw=e.i(77821),sb=e.i(87964),sS=e.i(62687),sC=e.i(90262),sy=e.i(18423),sk=e.i(78485),sN=e.i(3979);e.s(["OverviewPage",0,function({view:e,isCommissionAsked:o}){let d=(0,i.useRouter)(),c=(0,m.useFleetSnapshot)(),u=(0,sy.useLiveFleet)(),p=(0,sb.useConsoleFrame)(),h=(0,R.messageLimitReached)((0,N.useFleetLimits)().data),f=(0,P.useHostedAccountUrl)(),x=(0,sC.useAccess)(),g=(0,sN.usePluginNav)(),[w,b]=(0,a.useState)(!1),[S,C]=(0,a.useOptimistic)(e);(0,sk.useSignInWhenSessionEnds)([c.error,u.error]);let y=e=>{let t=(function(e){let t=new URLSearchParams;for(let[s,n]of(""!==e.query&&t.set("q",e.query),[["status",e.filters.status],["crew",e.filters.crewRequest],["kind",e.filters.kind],["type",e.filters.type],["squadron",e.filters.squadron]]))for(let e of n)t.append(s,e);for(let s of(e.filters.isRetiredShown&&t.set("retired","1"),e.filters.labelValueIds))t.append("label",s);return null!==e.sort&&(t.set("sort",e.sort.column),"descending"===e.sort.direction&&t.set("order","desc")),t})(e).toString();(0,a.startTransition)(()=>{C(e),d.replace(""===t?"/":`/?${t}`,{scroll:!1})})};return(0,t.jsxs)(sw.ListPage,{...p,title:"Fleet overview",description:c.data?function(e){let t=v(e.ships).length,s=e.ships.filter(e=>"agent"===e.kind&&"retired"===e.status).length;if(0===t&&0===s)return e.canCommission?"Only argo so far. Ships you commission appear here.":"Only argo so far.";let n=0===s?"":`, ${String(s)} retired`;return`${1===t?"1 active ship":`${String(t)} active ships`} and argo${n}. Changes appear as they happen.`}({ships:c.data,canCommission:x.canManage}):"Loading your fleet",primaryAction:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 max-sm:flex-col max-sm:items-stretch",children:[(0,t.jsx)(r.Button,{render:(0,t.jsx)(n.default,{href:"/labels"}),nativeButton:!1,icon:(0,t.jsx)(s.Tag,{}),"data-testid":"overview-labels",children:x.canDefineLabels?"Manage labels":"View labels"}),x.canManage?(0,t.jsx)(M,{isOpen:w||o,onOpenChange:t=>{b(t),!t&&o&&y(e)}}):null]}),live:u.live,children:[(0,t.jsx)(sS.FleetSegments,{active:"ships",needsCrewCount:g.needsCrewCount}),void 0===h?null:(0,t.jsx)(sj.LimitNotice,{...(0,R.messageLimitNotice)(h),accountUrl:f,testId:"overview-message-limit"}),(0,t.jsx)(_,{}),(0,t.jsx)(j,{}),(0,t.jsx)(sx,{view:S,onViewChange:y,newShipIds:u.newShipIds,renderRowActions:(e,s)=>(0,t.jsx)(sg.ShipActions,{ship:e,layout:"table"===s?"menu":"phone"===s?"sheet":"next",compose:l.ComposeMessage,crewLineFlow:sv.NewCrewLineFlow})})]})}],42047)}]);
|