@aeolus-fleet/console 0.25.1 → 0.25.2
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)/inbox/page/server-reference-manifest.json +16 -16
- 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 +16 -16
- 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 +16 -16
- 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 +16 -16
- 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 +16 -16
- 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 +16 -16
- 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)/questions/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/questions/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/questions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/settings/page/server-reference-manifest.json +16 -16
- 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 +16 -16
- 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 +16 -16
- 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 +16 -16
- 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 +16 -16
- 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 +16 -16
- 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 +16 -16
- 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 +16 -16
- 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_170owr_.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0mxb_server_app_(console)_squadrons_templates_[name]_page_actions_09abrr0.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_needs-crew_page_actions_08gu8-f.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_network_page_actions_1muuv-j.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_questions_page_actions_12d6yd2.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_settings_page_actions_0b6qztr.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_ships_[shipId]_page_actions_0g2nd1p.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_squadrons_page_actions_1x3afts.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_trierarchs_page_actions_1ow37mz.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/1eui__next-internal_server_app_(console)_needs-attention_page_actions_1jfgclw.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/1eui__next-internal_server_app_(console)_squadrons_[squadronId]_page_actions_1lzqlye.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/1eui__next-internal_server_app_(console)_trierarchs_[shipId]_page_actions_0l7bxva.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/[root-of-the-server]__197gd9r._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_01eyvjo._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_07bnv77._.js → _03figwl._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0cak8i7._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0ll55v1._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_127j_99._.js → _0magod9._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0u0wzbz._.js → _0ze4jen._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_11s1izd._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_195z53h._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_1p-k4-7._.js → _1aub6rh._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1buuyye._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1geqwzr._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_207-ta6._.js → _1hl4kpn._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1or2awi._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_09we890._.js → _1tt3h4z._.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/{node_modules_@base-ui_react_0xxx54b._.js → node_modules_@base-ui_react_1of81la._.js} +2 -2
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_0sqk26-._.js → packages_console_122o2i3._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1ey0_d3._.js → packages_console_1adfz1r._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_0ogk6t7._.js → packages_console_1upjt78._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console__next-internal_server_app_(console)_inbox_page_actions_0q9_xye.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console__next-internal_server_app_(console)_labels_page_actions_0tk7mqs.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console__next-internal_server_app_(console)_page_actions_1ftjjyq.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_needs-attention_page_tsx_03s6y-o._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_overview-page_tsx_15siba6._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_0tur713._.js → packages_console_features_1ycqicv._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_squadrons_organisms_form-squadron-dialog_tsx_0la8z4f._.js → packages_console_features_squadrons_organisms_form-squadron-dialog_tsx_12z690a._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_trierarchs_organisms_clear-worktree-dialog_tsx_01eb-00._.js → packages_console_features_trierarchs_organisms_clear-worktree-dialog_tsx_140y8dv._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_lib_11xnux-._.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 +17 -17
- package/.next/standalone/packages/console/.next/static/chunks/{2vnmap15_4ik5.js → 08fntqgo3353u.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{0rr9rjc_bc3gf.js → 0nztfy7ba1ez4.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{1s_391feiypzt.js → 0xklzua--y-te.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{2zu0p9hjzqg_-.js → 1cys0q4nekmo8.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{0jvnv44qtww0y.js → 1vusd9lpo6rtl.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{1ek70m0owmcgq.js → 274y91hwkjxt3.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{3faqga4wbve_5.js → 2fawp7c5ud5cq.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{14gq9h4bre4zl.js → 2fcx48n2u74f8.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{2mlx4u2m3gj4n.js → 2fqbkmkhj5cfr.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{2vjnc-m734xfm.js → 2fsy26x-aeybj.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{1kzen4nzgfhzx.js → 2nxpt1ggh42xf.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/2sdb6_s313-_0.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/{1jz4bf7w_acy8.js → 3a-i8z6d_l5j9.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{2iwxdddbd25in.js → 3hfbb6--wbkq6.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{11tuykopff7e_.js → 3lwa1pmekf5yn.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/3otcabh_gijq-.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/{3sgvr4qucbnoq.js → 3pq58846qyog_.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{3fz2o2p_07f9u.js → 3t0b867w1fd16.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{2w9atwkwe6d4r.js → 3yteehwrrznjm.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{1cg31hv7ug_rw.js → 43wruh-j46sq_.js} +1 -1
- package/.next/standalone/packages/console/package.json +3 -3
- package/package.json +3 -3
- package/.next/standalone/packages/console/.next/static/chunks/0bb19hfyc42kn.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/3dmesrmg4eee9.js +0 -1
- /package/.next/standalone/packages/console/.next/static/{bXH06v_D0kt92IaQZhnO3 → -CS98dpuGlTUZ_q58bGCs}/_buildManifest.js +0 -0
- /package/.next/standalone/packages/console/.next/static/{bXH06v_D0kt92IaQZhnO3 → -CS98dpuGlTUZ_q58bGCs}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/packages/console/.next/static/{bXH06v_D0kt92IaQZhnO3 → -CS98dpuGlTUZ_q58bGCs}/_ssgManifest.js +0 -0
package/.next/standalone/packages/console/.next/static/chunks/{1kzen4nzgfhzx.js → 2nxpt1ggh42xf.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,57153,e=>{"use strict";e.i(47167);var t=e.i(71645);let s=t.createContext({disabled:!1});e.s(["FieldItemContext",0,s,"useFieldItemContext",0,function(){return t.useContext(s)}])},55627,68815,e=>{"use strict";var t=e.i(71645),s=e.i(56789),r=e.i(39957),a=e.i(67865),i=e.i(88940),n=e.i(47778),l=e.i(76782),o=e.i(75812),d=e.i(84708);function u(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}e.s(["getCombinedFieldValidityData",0,u],68815);let c=Object.keys(o.DEFAULT_VALIDITY_STATE);function m(e,t){return!e.matches(":disabled")&&(!t||e.form===t||null===e.form&&!e.hasAttribute("form"))}function f(e,t){let s=null;for(let r of e.keys())if(m(r,t)){if(!r.validity.valid)return r;s??=r}return s}function x(e){return{...o.DEFAULT_VALIDITY_STATE,valid:!e,customError:e}}function h(e){return e&&e.validationMessage?[e.validationMessage]:[]}e.s(["isEligibleInput",0,m,"useFieldValidation",0,function(e){let{elementRef:o,formRef:m}=(0,d.useFormContext)(),{setValidityData:p,validate:g,validityData:b,validationDebounceTime:v,invalid:y,markedDirtyRef:j,state:w,shouldValidateOnChange:N,validationMode:k,registeredFieldIdRef:C}=e,{controlId:S,getDescriptionProps:I}=(0,n.useLabelableContext)(),T=(0,r.useTimeout)(),q=t.useRef(null),O=(0,i.useRefWithInit)(()=>new Map).current,R=t.useRef(0),E=t.useRef(null),A=t.useCallback((e,t)=>(O.set(e,t),()=>{O.delete(e)}),[O]),L=(0,a.useStableCallback)(()=>{let e=f(O,o.current);return e&&O.get(e)?.controlRef.current||null}),z=(0,a.useStableCallback)(async(e,t=!1)=>{R.current+=1;let s=R.current;function r(){let e=E.current;E.current=null,e&&(!e[0].willValidate||e[0].validationMessage===e[1])&&e[0].setCustomValidity(e[2])}function a(t,s,r){let a,i=(a=!1===t.valid?s:[],{value:e,state:t,error:a[0]??"",errors:a,initialValue:b.initialValue});!function(e,t=y){let s=C.current??S;if(null==s)return;let r=m.current.fields.get(s);if(!r)return;let a=u(e,t);m.current.fields.set(s,{...r,validityData:a})}(i,r),p(i)}function i(){return O.size>0?f(O,o.current):q.current}let n=i();function l(){return n=i(),n?.willValidate?function(e){let t=c.reduce((t,s)=>(t[s]=e.validity[s],t),{}),s=!1;for(let e of c)if("valid"!==e){if("valueMissing"===e&&t[e])s=!0;else if(t[e])return t}return s&&!j.current&&(t.valid=!0,t.valueMissing=!1),t}(n):x(!1)}if(t){if(!1!==w.valid||!n)return;if(!n.validity.valueMissing){r();let e=i(),t=e?.validity.customError?h(e):[];a(x(t.length>0),t,!1);return}for(let e of c)if("valid"!==e&&"valueMissing"!==e&&"customError"!==e&&n.validity[e])return}T.clear(),r();let d=l(),v=h(n),I=N();if(0===v.length||I){let t,r=g(e,Array.from(m.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));if("object"==typeof r&&null!==r&&"then"in r){if(!1===d.valid?a(d,v):"onSubmit"!==k&&b.state.customError||(d.valid=null,a(d,v)),t=await r,s!==R.current)return;d=l()}else t=r;if((v=t?[].concat(t).filter(Boolean):[]).length>0){var A,L;let e,t;d.valid=!1,d.customError=!0,n?.willValidate&&(A=n,L=v.join("\n"),e=A.validity.customError?A.validationMessage:"",t=L.replace(/\r\n?/g,"\n"),A.setCustomValidity(t),E.current=[A,t,e])}else v=h(n)}a(d,v)}),M=(0,a.useStableCallback)((e,t=!1)=>{if(T.clear(),R.current+=1,t)return;let s=N();s&&""!==e&&v?T.start(v,()=>{z(e)}):z(e,!s)}),P=t.useCallback((e,t={})=>(0,l.mergeProps)(I(t),!1!==w.valid||w.disabled||e?s.EMPTY_OBJECT:{"aria-invalid":!0}),[I,w.disabled,w.valid]);return t.useMemo(()=>({getValidationProps:P,inputRef:q,registeredInputs:O,registerInput:A,getInputControl:L,commit:z,change:M}),[P,O,A,L,z,M])}],55627)},87068,e=>{"use strict";e.i(47167);var t=e.i(33332),s=e.i(71645);let r=s.createContext(void 0);e.s(["useFieldsetRootContext",0,function(e=!1){let a=s.useContext(r);if(!a&&!e)throw Error((0,t.default)(86));return a}])},81104,e=>{"use strict";var t=e.i(46376),s=e.i(88940),r=e.i(69690);e.s(["useRegisterFieldControl",0,function(e,a,i,n,l=!0,o){let{registerFieldControl:d}=(0,r.useFieldRootContext)(),u=(0,s.useRefWithInit)(()=>Symbol());(0,t.useIsoLayoutEffect)(()=>{let t=u.current;l?d(t,{controlRef:e,getValue:n,id:a,name:o,value:i}):d(t,void 0)},[e,l,n,a,o,d,u,i]),(0,t.useIsoLayoutEffect)(()=>{let e=u.current;return()=>{d(e,void 0)}},[d,u])}])},69690,75812,e=>{"use strict";var t=e.i(33332),s=e.i(71645),r=e.i(56789);let a={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},i={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},n={disabled:!1,...i};e.s(["DEFAULT_FIELD_ROOT_STATE",0,n,"DEFAULT_FIELD_STATE_ATTRIBUTES",0,i,"DEFAULT_VALIDITY_STATE",0,a,"fieldValidityMapping",0,{valid:e=>null===e?null:e?{"data-valid":""}:{"data-invalid":""}}],75812);let l={invalid:void 0,name:void 0,validityData:{state:a,errors:[],error:"",value:"",initialValue:null},setValidityData:r.NOOP,disabled:void 0,setTouched:r.NOOP,setDirty:r.NOOP,setFilled:r.NOOP,setFocused:r.NOOP,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:n,registerFieldControl:r.NOOP,validation:{getValidationProps:(e,t=r.EMPTY_OBJECT)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:r.NOOP,getInputControl:()=>null,commit:async()=>{},change:r.NOOP}},o=s.createContext(l);e.s(["DEFAULT_FIELD_ROOT_CONTEXT",0,l,"FieldRootContext",0,o,"useFieldRootContext",0,function(e=!0){let a=s.useContext(o);if(a.setValidityData===r.NOOP&&!e)throw Error((0,t.default)(28));return a}],69690)},84708,e=>{"use strict";e.i(47167);var t=e.i(71645),s=e.i(56789);let r=t.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:s.NOOP,validationMode:"onSubmit",submitCountRef:{current:0}});e.s(["useFormContext",0,function(){return t.useContext(r)}])},47778,e=>{"use strict";e.i(47167);var t=e.i(71645),s=e.i(56789);let r=t.createContext({controlId:void 0,registerControlId:s.NOOP,resetControlId:s.NOOP,labelId:void 0,setLabelId:s.NOOP,messageIds:[],setMessageIds:s.NOOP,getDescriptionProps:e=>e});e.s(["LabelableContext",0,r,"useLabelableContext",0,function(){return t.useContext(r)}])},31421,e=>{"use strict";var t=e.i(71645),s=e.i(46376),r=e.i(88015);e.s(["useAriaLabelledBy",0,function(e,a,i,n=!0,l){let[o,d]=t.useState(),u=(0,r.useBaseUiId)(l?`${l}-label`:void 0),c=e??a??o;return(0,s.useIsoLayoutEffect)(()=>{let t=e||a||!n?void 0:function(e,t){let s=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let s=e.id;if(s){let t=e.nextElementSibling;if(t&&t.htmlFor===s)return t}let r=e.labels;return r&&r[0]}(e);if(s)return!s.id&&t&&(s.id=t),s.id||void 0}(i.current,u);o!==t&&d(t)}),c}])},38489,e=>{"use strict";var t=e.i(71645),s=e.i(46376),r=e.i(67865),a=e.i(88940),i=e.i(56789),n=e.i(88015),l=e.i(47778);e.s(["useLabelableId",0,function(e={}){let{id:o,enabled:d=!0}=e,{controlId:u,registerControlId:c,resetControlId:m}=(0,l.useLabelableContext)(),f=(0,n.useBaseUiId)(),x=(0,a.useRefWithInit)(()=>Symbol()),h=t.useRef(!1),p=t.useRef(!1),g=(0,r.useStableCallback)(()=>{h.current&&c!==i.NOOP&&(h.current=!1,c(x.current,void 0))});return(0,s.useIsoLayoutEffect)(()=>{let e;if(!d||c===i.NOOP)return void g();if(void 0!==o)p.current=!0,e=o;else{if(!p.current)return void m();e=f}void 0===e?g():(h.current=!0,c(x.current,e))},[o,d,c,m,f,x,g]),(0,s.useIsoLayoutEffect)(()=>g,[g]),(d?u:void 0)??o??f}])},86698,e=>{"use strict";e.s(["serializeValue",0,function(e){if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}])},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 r=(0,t.default)(s);e.s(["ChevronLeft",0,r],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 r=(0,t.default)(s);e.s(["ChevronRight",0,r],67927)},36518,e=>{"use strict";var t=e.i(56420);let s={name:"cloud-off",size:24,node:[["path",{d:"M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057",key:"1uxyv8"}],["path",{d:"M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78",key:"99tcn7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};s.node;let r=(0,t.default)(s);e.s(["CloudOff",0,r],36518)},25398,e=>{"use strict";var t=e.i(56420);let s={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};s.node;let r=(0,t.default)(s);e.s(["RotateCw",0,r],25398)},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 r=(0,t.default)(s);e.s(["Search",0,r],66595)},30274,e=>{"use strict";var t=e.i(56420);let s={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};s.node;let r=(0,t.default)(s);e.s(["Send",0,r],30274)},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 r=(0,t.default)(s);e.s(["SquarePen",0,r],19759)},1753,e=>{"use strict";var t=e.i(43476),s=e.i(18566),r=e.i(71645),a=e.i(41880),i=e.i(77821),n=e.i(24071),l=e.i(85595),o=e.i(35056),d=e.i(56420);let u={name:"circle-slash",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]};u.node;let c=(0,d.default)(u),m={name:"replace",size:24,node:[["path",{d:"M14 4a1 1 0 0 1 1-1",key:"dhj8ez"}],["path",{d:"M15 10a1 1 0 0 1-1-1",key:"1mnyi5"}],["path",{d:"M21 4a1 1 0 0 0-1-1",key:"sfs9ap"}],["path",{d:"M21 9a1 1 0 0 1-1 1",key:"mp6qeo"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a2 2 0 0 1 2-2h2",key:"15xut4"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}]]};m.node;let f=(0,d.default)(m);var x=e.i(30274),h=e.i(90063),p=e.i(49635),g=e.i(74470),b=e.i(66390),v=e.i(15905),y=e.i(91727);e.s([],6329),e.i(6329);var j=e.i(28918),w=e.i(46376),N=e.i(2077),k=e.i(56789),C=e.i(75606),S=e.i(56434),I=e.i(74354),T=e.i(75812);let q={checked:e=>e?{"data-checked":""}:{"data-unchecked":""},...I.transitionStatusMapping,...T.fieldValidityMapping};var O=e.i(64350),R=e.i(88015),E=e.i(52245),A=e.i(40886),L=e.i(70359),z=e.i(48990),M=e.i(69690),P=e.i(57153),F=e.i(47778),D=e.i(31421),V=e.i(38489);let _=r.createContext(void 0);var B=e.i(86698),K=e.i(33332);let U=r.createContext(void 0),Q=r.forwardRef(function(e,s){let{render:a,className:i,disabled:n=!1,readOnly:l=!1,required:o=!1,"aria-labelledby":d,value:u,inputRef:c,nativeButton:m=!1,id:f,style:x,...h}=e,p=r.useContext(_),{disabled:g,readOnly:b,required:v,form:y,checkedValue:I,touched:T=!1,validation:K,name:Q,setCheckedValue:W=k.NOOP,setTouched:H=k.NOOP,registerInputRef:$=k.NOOP}=p??{},{setTouched:Y,setFilled:J,state:G,disabled:X}=(0,M.useFieldRootContext)(),Z=(0,P.useFieldItemContext)(),{labelId:ee,getDescriptionProps:et}=(0,F.useLabelableContext)(),es=X||Z.disabled||g||n,er=b||l,ea=v||o,ei=p?I===u:""===u,en=r.useRef(null),el=r.useRef(null),eo=K?.registerInput,ed=r.useCallback(e=>eo?.(e,{controlRef:en,value:void 0}),[eo]),eu=(0,j.useMergedRefs)(c,el,$,ed);(0,w.useIsoLayoutEffect)(()=>{el.current?.checked&&J(!0)},[J]),(0,w.useIsoLayoutEffect)(()=>{if(el.current){if(es&&ei)return void $(null);$(el.current)}},[ei,es,$]);let ec=(0,R.useBaseUiId)(),em=(0,V.useLabelableId)({id:f}),ef=m?void 0:em,ex={role:"radio","aria-checked":ei,"aria-labelledby":(0,D.useAriaLabelledBy)(d,ee,el,!m,ef),[L.ACTIVE_COMPOSITE_ITEM]:ei?"":void 0,id:m?em:ec,onKeyDown(e){"Enter"===e.key&&e.preventDefault()},onClick(e){if(e.defaultPrevented||es||er)return;e.preventDefault();let t=el.current;t&&(0,O.dispatchClickWithModifiers)(t,e)},onFocus(e){e.defaultPrevented||es||er||!T||(el.current?.click(),H(!1))}},{getButtonProps:eh,buttonRef:ep}=(0,A.useButton)({disabled:es,native:m,composite:!1}),eg={type:"radio",ref:eu,form:y,id:ef,name:Q,tabIndex:-1,style:Q?N.visuallyHiddenInput:N.visuallyHidden,"aria-hidden":!0,...void 0!==u?{value:(0,B.serializeValue)(u)}:k.EMPTY_OBJECT,disabled:es,checked:ei,required:ea,readOnly:er,onChange(e){if(e.nativeEvent.defaultPrevented||es||er||void 0===u)return;let t=(0,C.createChangeEventDetails)(S.REASONS.none,e.nativeEvent);W(u,t),t.isCanceled||Y(!0)},onClick(e){e.stopPropagation()},onFocus(){en.current?.focus()}},eb=r.useMemo(()=>({...G,required:ea,disabled:es,readOnly:er,checked:ei}),[G,es,er,ei,ea]),ev=void 0!==p,ey=[s,en,ep],ej=[ex,h,eh,et,K?e=>K.getValidationProps(es,e):k.EMPTY_OBJECT],ew=(0,E.useRenderElement)("span",e,{enabled:!ev,state:eb,ref:ey,props:ej,stateAttributesMapping:q});return(0,t.jsxs)(U.Provider,{value:eb,children:[ev?(0,t.jsx)(z.CompositeItem,{tag:"span",render:a,className:i,style:x,state:eb,refs:ey,props:ej,stateAttributesMapping:q}):ew,(0,t.jsx)("input",{...eg,suppressHydrationWarning:!0})]})});var W=e.i(37584),H=e.i(23910);let $=r.forwardRef(function(e,t){let{render:s,className:a,style:i,keepMounted:n=!1,...l}=e,o=function(){let e=r.useContext(U);if(void 0===e)throw Error((0,K.default)(52));return e}(),d=o.checked,{mounted:u,transitionStatus:c,setMounted:m}=(0,H.useTransitionStatus)(d),f={...o,transitionStatus:c},x=r.useRef(null),h=(0,E.useRenderElement)("span",e,{ref:[t,x],state:f,props:l,stateAttributesMapping:q});return((0,W.useOpenChangeComplete)({batch:!0,enabled:!d,open:d,ref:x,onComplete(){d||m(!1)}}),n||u)?h:null});e.s(["Indicator",0,$,"Root",0,Q],66747);var Y=e.i(66747),Y=Y,J=e.i(51437),G=e.i(67865),X=e.i(84446),Z=e.i(73327),ee=e.i(5934),et=e.i(81104),es=e.i(55627),er=e.i(87068),ea=e.i(84708),ei=e.i(6039);let en=[Z.SHIFT],el=r.forwardRef(function(e,s){let{render:a,className:i,disabled:n,readOnly:l,required:o,onValueChange:d,value:u,defaultValue:c,form:m,name:f,inputRef:x,id:h,style:p,...g}=e,{setTouched:b,setFocused:v,validationMode:y,name:j,disabled:w,state:N,validation:k,setDirty:C,setFilled:S,validityData:I}=(0,M.useFieldRootContext)(),{labelId:q}=(0,F.useLabelableContext)(),{clearErrors:O,elementRef:E}=(0,ea.useFormContext)(),A=(0,er.useFieldsetRootContext)(!0),L=w||n,z=j??f,P=(0,R.useBaseUiId)(h),[D,V]=(0,J.useControlled)({controlled:u,default:c,name:"RadioGroup",state:"value"}),[B,K]=r.useState(!1),U=(0,G.useStableCallback)((e,t)=>{d?.(e,t),t.isCanceled||V(e)}),Q=k.getInputControl,W=r.useMemo(()=>({get current(){return Q()}}),[Q]),H=r.useRef(null),$=r.useRef(null);function Y(e){let t;return x&&("function"==typeof x?t=x(e):x.current=e),H.current=e,t}let Z=(0,G.useStableCallback)(e=>{if(!e||e.disabled)return;$.current||($.current=e);let t=H.current,s=e.checked||null==t||t.disabled?Y(e):void 0;return()=>{$.current===e&&($.current=null),H.current===e?s?(s(),H.current=null):Y(null):s?.()}}),el=(0,G.useStableCallback)(()=>{let e=E.current;if(!e)return D??null;for(let t of k.registeredInputs.keys())if(t.checked&&(0,es.isEligibleInput)(t,e))return D??null;return null});(0,et.useRegisterFieldControl)(W,P,D??null,el,!L,f),(0,ei.useValueChanged)(D,()=>{O(z),C(D!==I.initialValue),S(null!=D),k.change(D);let e=$.current;null==D&&e&&!e.disabled&&Y(e)});let eo=q??A?.legendId,ed={...N,disabled:L??!1,required:o??!1,readOnly:l??!1},eu=r.useMemo(()=>({checkedValue:D,disabled:L,form:m,validation:k,name:z,readOnly:l,registerInputRef:Z,required:o,setCheckedValue:U,setTouched:K,touched:B}),[D,L,m,k,z,l,Z,o,U,K,B]);return(0,t.jsx)(_.Provider,{value:eu,children:(0,t.jsx)(ee.CompositeRoot,{render:a,className:i,style:p,state:ed,props:[{id:h,role:"radiogroup","aria-required":o||void 0,"aria-disabled":L||void 0,"aria-readonly":l||void 0,"aria-labelledby":eo,onFocus(){v(!0)},onBlur(e){(0,X.contains)(e.currentTarget,e.relatedTarget)||(b(!0),v(!1),"onBlur"===y&&k.commit(D))},onKeyDownCapture(e){e.key.startsWith("Arrow")&&(K(!0),v(!0))}},g,e=>k.getValidationProps(L??!1,e)],refs:[s],stateAttributesMapping:T.fieldValidityMapping,enableHomeAndEndKeys:!1,modifierKeys:en})})});function eo({className:e,...s}){return(0,t.jsx)(el,{"data-slot":"radio-group",className:(0,h.classNames)("flex flex-col gap-2",e),...s})}function ed({className:e,...s}){return(0,t.jsx)(Y.Root,{"data-slot":"radio-group-item",className:(0,h.classNames)("inline-flex size-4 shrink-0 items-center justify-center rounded-full border border-input bg-background transition-colors duration-(--duration-fast) outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring data-checked:border-primary data-disabled:opacity-45",e),...s,children:(0,t.jsx)(Y.Indicator,{"data-slot":"radio-group-indicator",className:"size-2 rounded-full bg-primary"})})}var eu=e.i(60592),ec=e.i(43988),em=e.i(67874),ef=e.i(17981),ex=e.i(88393),eh=e.i(31071),ep=e.i(39448);let eg=[{value:"open",label:"Open"},{value:"answered",label:"Answered"},{value:"stale",label:"Stale"},{value:"all",label:"All"}],eb={title:"No questions for you",description:"When a ship asks argo a question, it shows up here with its options. You answer it from the question."},ev={open:eb,answered:{title:"Nothing answered yet",description:"Questions you answer show up here."},stale:{title:"Nothing stale",description:"Questions their ship withdrew or replaced before you answered show up here."},all:eb};function ey({state:e}){let s="size-(--size-icon-sm) shrink-0 text-muted-foreground";switch(e){case"Answered":return(0,t.jsx)(l.CircleCheck,{"aria-hidden":!0,className:s});case"Withdrawn":return(0,t.jsx)(c,{"aria-hidden":!0,className:s});case"Replaced":return(0,t.jsx)(f,{"aria-hidden":!0,className:s});case"Open":return null}}function ej({filter:e,onFilterChange:s,counts:r}){return(0,t.jsx)(eu.Tabs,{value:e,onValueChange:e=>{let t=eg.find(t=>t.value===e);t&&s(t.value)},children:(0,t.jsx)(eu.TabsList,{"aria-label":"Show",className:"max-sm:w-full",children:eg.map(({value:e,label:s})=>(0,t.jsxs)(eu.TabsTrigger,{value:e,"data-testid":`questions-filter-${e}`,className:"max-sm:grow",children:[s,void 0===r[e]?null:(0,t.jsx)(eu.TabsCount,{children:r[e]})]},e))})})}function ew({questions:e,selectedId:s,onSelect:r,now:a}){return(0,t.jsx)("ul",{"aria-label":"Questions to argo",className:"flex flex-col max-sm:gap-2",children:e.map(e=>{let i=new Date(e.message.sentAt),n=function(e){if(null!==e.question.answer)return"Answered";switch(e.stale?.kind){case"withdrawn":return"Withdrawn";case"replaced":return"Replaced";case void 0:return"Open"}}(e),l="Open"===n,o=e.deliveryId===s;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"questions-row","data-delivery-id":e.deliveryId,"aria-current":o?"true":void 0,onClick:()=>{r(e.deliveryId)},className:"relative flex w-full min-w-0 flex-col gap-1 border-b border-border py-2.5 pr-3 pl-5 text-left transition-colors duration-(--duration-fast) outline-none hover:bg-accent focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring aria-[current=true]:bg-accent max-sm:rounded-lg max-sm:border max-sm:bg-card max-sm:py-3",children:[l?(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute top-4 left-2 size-1.5 rounded-full bg-primary max-sm:top-4.5"}):null,(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(ey,{state:n}),(0,t.jsx)(ep.ShipName,{name:e.message.sender.name,shipId:e.message.sender.id,isSuffixShown:!0,className:(0,h.classNames)("min-w-0",l?"font-semibold":"text-muted-foreground")}),(0,t.jsx)("time",{dateTime:e.message.sentAt,title:(0,p.fullDateTime)(i),className:"ml-auto shrink-0 text-meta text-muted-foreground tabular-nums",children:a.getTime()-i.getTime()<864e5?(0,p.clockTime)(i):(0,p.shortDateTime)(i)})]}),(0,t.jsx)("span",{className:(0,h.classNames)("block min-w-0 truncate text-meta max-sm:text-body",null===e.stale?"text-foreground":"text-muted-foreground line-through"),children:e.question.title}),(0,t.jsx)("span",{className:"sr-only",children:n})]})},e.deliveryId)})})}function eN({question:e}){let{answer:s,options:r}=e.question;if(null===s)return null;let a=new Date(s.sentAt),i=r.find(({key:e})=>e===s.option);return(0,t.jsxs)("div",{"data-testid":"questions-answered",className:"flex flex-col gap-1 rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-meta text-tone-ok-fg",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,t.jsx)(l.CircleCheck,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:["Answered at"," ",(0,t.jsx)("time",{dateTime:s.sentAt,title:(0,p.fullDateTime)(a),children:(0,p.clockTime)(a)}),void 0===i?" with a note.":`: ${i.key}. ${i.label}`]})]}),null===s.note?null:(0,t.jsx)("p",{className:"whitespace-pre-wrap [overflow-wrap:anywhere]",children:s.note})]})}function ek({deliveryId:e,title:s,onSelect:r,testId:a}){return(0,t.jsx)("button",{type:"button","data-testid":a,onClick:()=>{r(e)},className:"min-w-0 text-left font-medium text-foreground underline underline-offset-2 [overflow-wrap:anywhere] hover:text-primary focus-visible:outline-2 focus-visible:outline-ring",children:s})}function eC({question:e,onSelect:s}){let{stale:r}=e;if(null===r)return null;let a=new Date(r.sentAt),i=(0,t.jsx)("time",{dateTime:r.sentAt,title:(0,p.fullDateTime)(a),children:(0,p.clockTime)(a)});return(0,t.jsxs)("div",{role:"status","data-testid":"questions-stale",className:"flex flex-col gap-1 rounded-md border border-tone-ended-border bg-tone-ended-bg px-3 py-2 text-meta text-tone-ended-fg",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:["withdrawn"===r.kind?(0,t.jsx)(c,{"aria-hidden":!0}):(0,t.jsx)(f,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:["withdrawn"===r.kind?"Withdrawn":"Replaced"," by ",e.message.sender.name," at ",i,". It can’t be answered."]})]}),"replaced"===r.kind?(0,t.jsxs)("p",{className:"flex flex-wrap items-baseline gap-1",children:["Answer the new question:"," ",(0,t.jsx)(ek,{deliveryId:r.deliveryId,title:r.by.title,onSelect:s,testId:"questions-replacement"})]}):null]})}function eS({option:e,pick:s,asker:r}){let a=e.key===s.option;return(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-2 font-medium text-foreground",children:[e.key,". ",e.label,a?(0,t.jsxs)(b.Badge,{variant:"outline",children:[r,"’s pick"]}):null]}),""===e.detail?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e.detail}),a?(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["Why: ",s.why]}):null]})}function eI({question:e}){let{options:s,pick:r,answer:a}=e.question;return(0,t.jsx)("ol",{"aria-label":"Options",className:"flex flex-col gap-2",children:s.map(s=>(0,t.jsx)("li",{"data-testid":`questions-option-${s.key}`,className:(0,h.classNames)("rounded-md border px-3 py-2.5",a?.option===s.key?"border-primary bg-accent":"border-border bg-card"),children:(0,t.jsx)(eS,{option:s,pick:r,asker:e.message.sender.name})},s.key))})}function eT({question:e,onAnswer:s,isPending:a,isPhone:i}){let n=(0,r.useId)(),l=(0,r.useId)(),[o,d]=(0,r.useState)(void 0),[u,c]=(0,r.useState)(""),m=(0,g.useShortcutPlatform)(),{options:f,pick:h}=e.question,p=e.message.sender.name,b=void 0===o&&""===u.trim();return(0,t.jsxs)("form",{className:"flex flex-col gap-3",onSubmit:t=>{if(t.preventDefault(),b||a)return;let r=u.trim();s({deliveryId:e.deliveryId,answer:void 0===o?{note:r}:{option:o,...""===r?{}:{note:r}}})},children:[(0,t.jsx)(eo,{"aria-label":"Options",onValueChange:e=>{d(e)},children:f.map(e=>{let s=`${n}-option-${e.key}`;return(0,t.jsxs)("div",{"data-testid":`questions-option-${e.key}`,className:"flex items-start gap-2.5 rounded-md border border-border bg-card px-3 py-2.5 has-data-checked:border-primary",children:[(0,t.jsx)(ed,{id:s,value:e.key,className:"mt-0.5"}),(0,t.jsx)("label",{htmlFor:s,className:"min-w-0 grow cursor-pointer",children:(0,t.jsx)(eS,{option:e,pick:h,asker:p})})]},e.key)})}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border pt-3",children:[(0,t.jsxs)(y.Label,{htmlFor:n,children:["Note to ",p]}),(0,t.jsx)(ec.Textarea,{id:n,rows:3,size:i?"touch":"md",placeholder:"Optional with an option; on its own, ask for more context or say none fits",value:u,onChange:e=>{c(e.target.value)},onKeyDown:g.submitOnSendShortcut,"aria-describedby":l,"data-testid":"questions-note"}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("p",{id:l,className:"text-meta text-muted-foreground",children:["Sent as a reply to ",p,"; also marks the message done."]}),(0,t.jsxs)(v.Button,{type:"submit",variant:"primary",size:i?"touch":"sm",icon:(0,t.jsx)(x.Send,{"aria-hidden":!0}),isLoading:a,disabled:b&&!a,"aria-keyshortcuts":null===m?void 0:(0,g.sendShortcutAria)(m),"data-testid":"questions-send",children:["Send answer",null===m?null:(0,t.jsx)(eh.SendShortcutHint,{platform:m})]})]})]})]})}function eq({question:e,onAnswer:s,onSelect:r,pendingIds:a,isPhone:i,isReadOnly:n=!1}){let l=new Date(e.message.sentAt),o=e.message.sender,d=null===e.question.answer&&null===e.stale;return(0,t.jsxs)("article",{"aria-label":e.question.title,"data-testid":"questions-question",className:(0,h.classNames)("flex min-h-0 flex-col gap-3",i?"grow":"h-full"),children:[(0,t.jsxs)("header",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("h2",{className:"min-w-0 text-heading font-semibold [overflow-wrap:anywhere]",children:e.question.title}),(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-1 text-meta text-muted-foreground",children:["From ",(0,t.jsx)(ep.ShipName,{name:o.name,shipId:o.id,isSuffixShown:!0})," ·"," ",(0,t.jsx)("time",{dateTime:e.message.sentAt,title:(0,p.fullDateTime)(l),children:(0,p.shortDateTime)(l)})]}),null===e.replaces?null:(0,t.jsxs)("p",{className:"flex flex-wrap items-baseline gap-1 text-meta text-muted-foreground",children:["Replaces"," ",(0,t.jsx)(ek,{deliveryId:e.replaces.deliveryId,title:e.replaces.title,onSelect:r,testId:"questions-replaces"})]})]}),(0,t.jsx)(eN,{question:e}),(0,t.jsx)(eC,{question:e,onSelect:r}),(0,t.jsxs)("div",{className:"flex min-h-0 grow flex-col gap-3 overflow-y-auto",children:[""===e.question.context?null:(0,t.jsx)("p",{className:"text-body whitespace-pre-wrap text-foreground [overflow-wrap:anywhere] max-sm:text-body-touch",children:e.question.context}),!d||n?(0,t.jsx)(eI,{question:e}):(0,t.jsx)(eT,{question:e,onAnswer:s,isPending:a.has(e.deliveryId),isPhone:i})]}),n&&d?(0,t.jsx)("p",{"data-testid":"questions-read-only",className:"border-t border-border pt-3 text-meta text-muted-foreground",children:"Read-only: you see argo’s questions, and can’t answer them."}):null]})}function eO({questions:e,filter:s,onFilterChange:r,counts:a,selectedId:i,onSelect:l,state:d,onRetry:u,now:c,...m}){if("loading"===d)return(0,t.jsxs)("div",{"data-slot":"operator-questions","data-state":"loading",className:"grid gap-4 sm:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]",children:[(0,t.jsx)(ex.LoadingSkeleton,{variant:"list",rows:5,label:"Loading the questions"}),(0,t.jsx)(ex.LoadingSkeleton,{variant:"detail",label:"Loading the question",className:"max-sm:hidden"})]});if("error"===d)return(0,t.jsx)("div",{"data-slot":"operator-questions","data-state":"error","data-testid":"questions-error",children:(0,t.jsx)(ef.InlineError,{variant:"page",title:"Couldn’t load the questions",description:"This page couldn’t reach the fleet server. Questions to argo are stored on the server, so nothing is lost.",onRetry:u})});let f=e.find(e=>e.deliveryId===i),x=(0,t.jsx)(ej,{filter:s,onFilterChange:r,counts:a}),h=(0,t.jsx)("div",{"data-testid":"questions-empty",children:(0,t.jsx)(em.EmptyState,{icon:(0,t.jsx)(o.CircleHelp,{}),title:ev[s].title,description:ev[s].description})});return(0,t.jsxs)("div",{"data-slot":"operator-questions","data-state":"ready",children:[(0,t.jsxs)("div",{className:"grid min-h-128 grid-cols-[minmax(0,2fr)_minmax(0,3fr)] overflow-hidden rounded-lg border border-border bg-card max-sm:hidden",children:[(0,t.jsxs)("div",{className:"flex min-h-0 flex-col border-r border-border",children:[(0,t.jsx)("div",{className:"border-b border-border p-2.5",children:x}),0===e.length?(0,t.jsx)("div",{className:"p-4",children:h}):(0,t.jsx)(ew,{questions:e,selectedId:i,onSelect:l,now:c})]}),(0,t.jsx)("div",{className:"flex min-h-0 flex-col bg-background p-5",children:f?(0,t.jsx)(eq,{question:f,isPhone:!1,onSelect:l,...m}):(0,t.jsx)("p",{className:"m-auto text-meta text-muted-foreground",children:0===e.length?null:!0===m.isReadOnly?"Choose a question to read it.":"Choose a question to answer it."})})]}),(0,t.jsx)("div",{className:"flex flex-col gap-3 sm:hidden",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v.Button,{variant:"ghost",size:"touch",icon:(0,t.jsx)(n.ChevronLeft,{"aria-hidden":!0}),className:"-ml-2 self-start","data-testid":"questions-back",onClick:()=>{l(void 0)},children:"Questions"}),(0,t.jsx)(eq,{question:f,isPhone:!0,onSelect:l,...m})]}):(0,t.jsxs)(t.Fragment,{children:[x,0===e.length?h:(0,t.jsx)(ew,{questions:e,selectedId:i,onSelect:l,now:c})]})})]})}var eR=e.i(90262),eE=e.i(87964),eA=e.i(18423),eL=e.i(96676),ez=e.i(42454),eM=e.i(78485);e.s(["QuestionsPageFor",0,function({filterParameter:e,selectedId:n}){let l=(0,s.useRouter)(),o=(0,eL.useNow)(),d=(0,ez.readQuestionFilter)(e),u=(0,ez.useQuestions)(),c=(0,ez.useAnswer)(),m=(0,eA.useLiveFleet)(),f=(0,eE.useConsoleFrame)();(0,eM.useSignInWhenSessionEnds)([m.error]);let x=(0,eR.useAccess)(),[h,p]=(0,r.useState)(new Set),g=u.data??[],b=e=>{l.replace((0,ez.questionsPathOf)(e),{scroll:!1})};return(0,t.jsx)(i.ListPage,{...f,title:"Questions",description:"Questions ships asked argo, with their options and the asker’s pick. Answering sends your answer back as a reply.",live:m.live,children:(0,t.jsx)(eO,{isReadOnly:!x.canReceive,questions:(0,ez.questionsFor)(g,d),filter:d,onFilterChange:e=>{b({filter:e})},counts:u.data?(0,ez.questionFilterCounts)(g):{},selectedId:n,onSelect:e=>{void 0===e?b({filter:d}):b({filter:(0,ez.questionsFor)(g,d).some(t=>t.deliveryId===e)?d:"all",deliveryId:e})},state:u.isError?"error":u.data?"ready":"loading",onRetry:()=>{u.refetch()},onAnswer:({deliveryId:e,answer:t})=>{p(t=>new Set([...t,e])),c.mutateAsync({deliveryId:e,answer:t,idempotencyKey:`answer-${e}-${crypto.randomUUID()}`}).catch(e=>{(0,a.showToast)({title:"Couldn’t send the answer",description:e instanceof Error?e.message:"Try again in a moment.",tone:"error"})}).finally(()=>{p(t=>new Set([...t].filter(t=>t!==e)))})},pendingIds:h,now:o})})}],1753)},36651,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Kbd",0,function({className:e,...r}){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),...r})}])},91727,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Label",0,function({className:e,htmlFor:r,...a}){return(0,t.jsx)("label",{"data-slot":"label",htmlFor:r,className:(0,s.classNames)("text-body font-medium text-foreground select-none",e),...a})}])},19321,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Skeleton",0,function({className:e,...r}){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),...r})}])},43988,e=>{"use strict";var t=e.i(43476),s=e.i(25913),r=e.i(90063);let a=(0,s.cva)("w-full min-w-0 resize-none rounded-md border border-input bg-card px-3 py-2 text-foreground shadow-sm transition-[border-color,box-shadow] duration-(--duration-fast) outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/22 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/16 disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50 disabled:shadow-none",{variants:{size:{md:"text-body",touch:"rounded-lg text-input-touch"},isMono:{true:"font-mono",false:""}},compoundVariants:[{size:"md",isMono:!0,className:"text-code"}],defaultVariants:{size:"md",isMono:!1}});e.s(["Textarea",0,function({className:e,size:s,isMono:i,rows:n=4,...l}){return(0,t.jsx)("textarea",{"data-slot":"textarea",rows:n,className:(0,r.classNames)(a({size:s,isMono:i}),e),...l})}])},67874,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["EmptyState",0,function({title:e,description:r,icon:a,action:i,variant:n="page",className:l}){return"section"===n?(0,t.jsxs)("p",{"data-slot":"empty-state","data-variant":n,className:(0,s.classNames)("rounded-lg border border-border px-4 py-3 text-center text-meta text-muted-foreground",l),children:[e,r?(0,t.jsxs)(t.Fragment,{children:[" ",r]}):null]}):"no-results"===n?(0,t.jsxs)("div",{"data-slot":"empty-state","data-variant":n,className:(0,s.classNames)("flex flex-col items-center gap-2.5 rounded-lg border border-border bg-card px-4 py-6 text-center",l),children:[(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:e}),i]}):(0,t.jsxs)("div",{"data-slot":"empty-state","data-variant":n,className:(0,s.classNames)("flex flex-col items-center gap-3 rounded-lg border border-dashed border-border bg-card px-6 py-10 text-center",l),children:[a?(0,t.jsx)("span",{"aria-hidden":!0,className:"flex size-10 items-center justify-center rounded-lg border border-border bg-muted text-muted-foreground [&_svg]:size-(--size-icon-xl)",children:a}):null,(0,t.jsx)("h2",{className:"text-heading font-semibold text-foreground max-sm:text-heading-touch",children:e}),r?(0,t.jsx)("p",{className:"max-w-96 text-meta text-muted-foreground max-sm:text-body-touch",children:r}):null,i?(0,t.jsx)("div",{className:"mt-1 max-sm:w-full max-sm:[&>*]:w-full",children:i}):null]})}])},17981,e=>{"use strict";var t=e.i(43476),s=e.i(22768),r=e.i(36518),a=e.i(25398),i=e.i(90063),n=e.i(15905);e.s(["InlineError",0,function({title:e,description:l,detail:o,onRetry:d,retryNote:u,variant:c="section",id:m,className:f}){return"field"===c?(0,t.jsxs)("p",{id:m,"data-slot":"inline-error","data-variant":c,className:(0,i.classNames)("flex items-center gap-1.5 text-meta text-destructive-text [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",f),children:[(0,t.jsx)(s.CircleAlert,{"aria-hidden":!0}),e]}):"section"===c?(0,t.jsxs)("div",{role:"alert","data-slot":"inline-error","data-variant":c,className:(0,i.classNames)("flex gap-2 rounded-lg border border-tone-attention-border bg-tone-attention-bg p-3 text-tone-attention-fg",f),children:[(0,t.jsx)(s.CircleAlert,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon) shrink-0"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("p",{className:"text-body font-medium",children:e}),l?(0,t.jsx)("p",{className:"text-meta text-foreground",children:l}):null,d?(0,t.jsx)(n.Button,{size:"xs",icon:(0,t.jsx)(a.RotateCw,{"aria-hidden":!0}),onClick:d,className:"self-start",children:"Try again"}):null]})]}):(0,t.jsxs)("div",{role:"alert","data-slot":"inline-error","data-variant":c,className:(0,i.classNames)("flex flex-col items-center gap-3 rounded-lg border border-border bg-card px-6 py-10 text-center",f),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"flex size-10 items-center justify-center rounded-lg border border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg [&_svg]:size-(--size-icon-xl)",children:(0,t.jsx)(r.CloudOff,{})}),(0,t.jsx)("h2",{className:"text-heading font-semibold text-foreground max-sm:text-heading-touch",children:e}),l?(0,t.jsx)("p",{className:"max-w-96 text-meta text-muted-foreground max-sm:text-body-touch",children:l}):null,o?(0,t.jsx)("code",{className:"rounded-sm border border-border bg-muted px-2 py-0.5 font-mono text-id text-muted-foreground",children:o}):null,d?(0,t.jsxs)("div",{className:"flex items-center gap-2 max-sm:w-full max-sm:flex-col",children:[(0,t.jsx)(n.Button,{size:"sm",icon:(0,t.jsx)(a.RotateCw,{"aria-hidden":!0}),onClick:d,className:"max-sm:w-full",children:"Try again"}),u?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:u}):null]}):null]})}])},88393,e=>{"use strict";var t=e.i(43476),s=e.i(90063),r=e.i(19321);function a(e){return Array.from({length:e},(e,t)=>`row-${String(t)}`)}e.s(["LoadingSkeleton",0,function({variant:e,rows:i=4,label:n="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:n}),"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"}),a(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)(r.Skeleton,{className:"h-2.5 w-24"}),(0,t.jsx)(r.Skeleton,{className:"h-5 w-16"}),(0,t.jsx)(r.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(r.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:a(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)(r.Skeleton,{className:"h-2.5 w-20"}),(0,t.jsx)(r.Skeleton,{className:"h-6 w-10"}),(0,t.jsx)(r.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)(r.Skeleton,{className:"h-7 w-48"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(r.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(r.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:a(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)(r.Skeleton,{className:"h-3 w-28"}),(0,t.jsx)(r.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(r.Skeleton,{className:"h-2.5 w-44"})]},e))}):null]})}])},39448,e=>{"use strict";var t=e.i(43476),s=e.i(25913),r=e.i(22016),a=e.i(90063);let i=(0,s.cva)("min-w-0 truncate font-sans font-medium",{variants:{size:{body:"text-body text-foreground",meta:"text-meta text-muted-foreground",title:"text-title font-semibold tracking-tight text-foreground max-sm:text-title-touch"}},defaultVariants:{size:"body"}});e.s(["ShipName",0,function({name:e,shipId:s,size:n,isSuffixShown:l=!1,isOperator:o=!1,href:d,className:u}){let c=d?(0,t.jsx)(r.default,{href:d,className:(0,a.classNames)(i({size:n}),"rounded-xs underline-offset-3 hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"),title:e,children:e}):(0,t.jsx)("span",{className:i({size:n}),title:e,children:e});return(0,t.jsxs)("span",{"data-slot":"ship-name",className:(0,a.classNames)("inline-flex min-w-0 items-baseline gap-1.5",u),children:[c,o?(0,t.jsx)("span",{className:"shrink-0 font-normal text-muted-foreground",children:"(you)"}):null,l&&!o?(0,t.jsxs)("span",{className:"shrink-0 font-mono text-id text-muted-foreground uppercase",children:[(0,t.jsx)("span",{"aria-hidden":!0,children:"· "}),s.slice(-4)]}):null]})}])},77880,85538,e=>{"use strict";var t=e.i(43476),s=e.i(67927),r=e.i(66595),a=e.i(19759),i=e.i(22016),n=e.i(15905),l=e.i(36651),o=e.i(90063);let d={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 u({state:e,className:s}){let{label:r,dot:a}=d[e];return(0,t.jsxs)("span",{"data-slot":"live-status","data-state":e,"aria-live":"polite",className:(0,o.classNames)("inline-flex items-center gap-1.5 text-meta text-muted-foreground",s),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,o.classNames)("size-2 shrink-0 rounded-full",a)}),r]})}e.s(["Header",0,function({breadcrumb:e,parents:o=[],live:d,onCompose:c,onSearch:m}){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:[o.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)(u,{state:d}),m?(0,t.jsxs)(n.Button,{size:"sm",icon:(0,t.jsx)(r.Search,{"aria-hidden":!0}),"data-testid":"header-search",className:"w-60 justify-start font-normal text-muted-foreground",onClick:m,children:[(0,t.jsx)("span",{className:"grow text-left",children:"Search ships or jump to"}),(0,t.jsx)(l.Kbd,{children:"⌘K"})]}):null,c?(0,t.jsx)(n.Button,{size:"sm",icon:(0,t.jsx)(a.SquarePen,{"aria-hidden":!0}),"data-testid":"header-compose",onClick:c,children:"Compose"}):null]})]})}],77880);var c=e.i(24071),m=e.i(57957);e.s(["TopBar",0,function({title:e,live:s,actions:a,back:l,account:o,onSearch:d}){let f=d&&!l?d: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)(c.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)(u,{state:s}),a||f||o&&!l?(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[f?(0,t.jsx)(n.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Search ships or jump to","data-testid":"top-bar-search",onClick:f,children:(0,t.jsx)(r.Search,{"aria-hidden":!0})}):null,a,o&&!l?(0,t.jsx)(m.AccountMenuSheet,{...o}):null]}):null]})}],85538)},77821,e=>{"use strict";var t=e.i(43476),s=e.i(19759),r=e.i(15905),a=e.i(77880),i=e.i(85538);e.s(["ListPage",0,function({title:e,description:n,titleMeta:l,primaryAction:o,toolbar:d,live:u,onCompose:c,onSearch:m,account:f,banner:x,children:h}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Header,{breadcrumb:e,live:u,onCompose:c,onSearch:m}),x,(0,t.jsx)(i.TopBar,{title:e,live:u,account:f,onSearch:m,actions:c?(0,t.jsx)(r.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Compose","data-testid":"top-bar-compose",onClick:c,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]}),n?(0,t.jsx)("p",{className:"text-meta text-muted-foreground max-sm:text-body-touch",children:n}):null]}),o?(0,t.jsx)("div",{className:"shrink-0 max-sm:w-full max-sm:[&>*]:w-full",children:o}):null]}),d,h]})]})}])},18423,e=>{"use strict";var t=e.i(12598),s=e.i(5861),r=e.i(71645),a=e.i(42454),i=e.i(27702);let n=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 o=new Set(["LabelDefined","LabelValuesChanged","LabelRetired","LabelAssigned","LabelUnassigned","LabelDeleted"]),d=new Set(["DeliveryUndeliverable","DeliveryDismissed"]);e.s(["useLiveFleet",0,function(){let e=(0,i.useTRPC)(),u=(0,t.useQueryClient)(),[c,m]=(0,r.useState)(new Set),f=e=>{l(u,e)},x=(0,s.useSubscription)(e.fleet.events.subscriptionOptions({lastEventId:null},{onData:({data:t})=>{var s,r,i;if("resync"===t.kind)return void f(e.fleet.pathKey());let{event:l}=t;for(let t of new Set([l.shipId,l.actorShipId]))null!==t&&(f(e.fleet.ship.queryKey({shipId:t})),f(e.fleet.shipTimeline.queryKey({shipId:t})),f(e.fleet.shipWay.queryKey({shipId:t})));if(null!==l.messageId&&(f(e.fleet.shipMessages.pathKey()),f(e.fleet.shipWay.pathKey()),f(e.fleet.overdue.queryKey()),f(e.fleet.message.queryKey({messageId:l.messageId})),f(e.fleet.inbox.pathKey()),f(a.QUESTIONS_KEY),f(e.fleet.noShipCanTake.queryKey())),s=l.type,d.has(s)&&f(e.fleet.needsAttention.queryKey()),r=l.type,o.has(r)&&f(e.fleet.labels.queryKey()),"NetworkRulesDeclared"===l.type&&f(e.fleet.declaredNetworkRules.queryKey()),i=l.type,!n.has(i))return;f(e.fleet.list.queryKey()),f(e.fleet.noShipCanTake.queryKey());let{shipId:u}=l;"ShipCommissioned"===l.type&&null!==u&&m(e=>new Set([...e,u]))}}));return{live:function(e){switch(e){case"pending":return"live";case"connecting":return"reconnecting";case"idle":case"error":return"offline"}}(x.status),newShipIds:c,error:x.error}}])},74470,31071,e=>{"use strict";var t=e.i(71645);let s=/Mac|iPhone|iPad|iPod/;function r(e){return"mac"===e?"⌘↵":"Ctrl ↵"}function a(){return()=>void 0}function i(){var e;return e=navigator.userAgent,s.test(e)?"mac":"other"}function n(){return null}e.s(["sendShortcutAria",0,function(e){return"mac"===e?"Meta+Enter":"Control+Enter"},"sendShortcutKeys",0,r,"submitOnSendShortcut",0,function(e){var t;let{key:s,metaKey:r,ctrlKey:a}=e;"Enter"===(t={key:s,metaKey:r,ctrlKey:a,isComposing:e.nativeEvent.isComposing}).key&&(t.metaKey||t.ctrlKey)&&!t.isComposing&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},"useShortcutPlatform",0,function(){return(0,t.useSyncExternalStore)(a,i,n)}],74470);var l=e.i(43476),o=e.i(36651);e.s(["SendShortcutHint",0,function({platform:e}){return(0,l.jsx)(o.Kbd,{"aria-hidden":!0,"data-testid":"send-shortcut-hint",className:"border-primary-foreground/25 bg-primary-foreground/10 text-primary-foreground",children:r(e)})}],31071)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,57153,e=>{"use strict";e.i(47167);var t=e.i(71645);let s=t.createContext({disabled:!1});e.s(["FieldItemContext",0,s,"useFieldItemContext",0,function(){return t.useContext(s)}])},55627,68815,e=>{"use strict";var t=e.i(71645),s=e.i(56789),r=e.i(39957),a=e.i(67865),i=e.i(88940),n=e.i(47778),l=e.i(76782),o=e.i(75812),d=e.i(84708);function u(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}e.s(["getCombinedFieldValidityData",0,u],68815);let c=Object.keys(o.DEFAULT_VALIDITY_STATE);function m(e,t){return!e.matches(":disabled")&&(!t||e.form===t||null===e.form&&!e.hasAttribute("form"))}function f(e,t){let s=null;for(let r of e.keys())if(m(r,t)){if(!r.validity.valid)return r;s??=r}return s}function x(e){return{...o.DEFAULT_VALIDITY_STATE,valid:!e,customError:e}}function h(e){return e&&e.validationMessage?[e.validationMessage]:[]}e.s(["isEligibleInput",0,m,"useFieldValidation",0,function(e){let{elementRef:o,formRef:m}=(0,d.useFormContext)(),{setValidityData:p,validate:g,validityData:b,validationDebounceTime:v,invalid:y,markedDirtyRef:j,state:w,shouldValidateOnChange:N,validationMode:k,registeredFieldIdRef:C}=e,{controlId:S,getDescriptionProps:I}=(0,n.useLabelableContext)(),T=(0,r.useTimeout)(),q=t.useRef(null),O=(0,i.useRefWithInit)(()=>new Map).current,R=t.useRef(0),E=t.useRef(null),A=t.useCallback((e,t)=>(O.set(e,t),()=>{O.delete(e)}),[O]),L=(0,a.useStableCallback)(()=>{let e=f(O,o.current);return e&&O.get(e)?.controlRef.current||null}),z=(0,a.useStableCallback)(async(e,t=!1)=>{R.current+=1;let s=R.current;function r(){let e=E.current;E.current=null,e&&(!e[0].willValidate||e[0].validationMessage===e[1])&&e[0].setCustomValidity(e[2])}function a(t,s,r){let a,i=(a=!1===t.valid?s:[],{value:e,state:t,error:a[0]??"",errors:a,initialValue:b.initialValue});!function(e,t=y){let s=C.current??S;if(null==s)return;let r=m.current.fields.get(s);if(!r)return;let a=u(e,t);m.current.fields.set(s,{...r,validityData:a})}(i,r),p(i)}function i(){return O.size>0?f(O,o.current):q.current}let n=i();function l(){return n=i(),n?.willValidate?function(e){let t=c.reduce((t,s)=>(t[s]=e.validity[s],t),{}),s=!1;for(let e of c)if("valid"!==e){if("valueMissing"===e&&t[e])s=!0;else if(t[e])return t}return s&&!j.current&&(t.valid=!0,t.valueMissing=!1),t}(n):x(!1)}if(t){if(!1!==w.valid||!n)return;if(!n.validity.valueMissing){r();let e=i(),t=e?.validity.customError?h(e):[];a(x(t.length>0),t,!1);return}for(let e of c)if("valid"!==e&&"valueMissing"!==e&&"customError"!==e&&n.validity[e])return}T.clear(),r();let d=l(),v=h(n),I=N();if(0===v.length||I){let t,r=g(e,Array.from(m.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));if("object"==typeof r&&null!==r&&"then"in r){if(!1===d.valid?a(d,v):"onSubmit"!==k&&b.state.customError||(d.valid=null,a(d,v)),t=await r,s!==R.current)return;d=l()}else t=r;if((v=t?[].concat(t).filter(Boolean):[]).length>0){var A,L;let e,t;d.valid=!1,d.customError=!0,n?.willValidate&&(A=n,L=v.join("\n"),e=A.validity.customError?A.validationMessage:"",t=L.replace(/\r\n?/g,"\n"),A.setCustomValidity(t),E.current=[A,t,e])}else v=h(n)}a(d,v)}),M=(0,a.useStableCallback)((e,t=!1)=>{if(T.clear(),R.current+=1,t)return;let s=N();s&&""!==e&&v?T.start(v,()=>{z(e)}):z(e,!s)}),P=t.useCallback((e,t={})=>(0,l.mergeProps)(I(t),!1!==w.valid||w.disabled||e?s.EMPTY_OBJECT:{"aria-invalid":!0}),[I,w.disabled,w.valid]);return t.useMemo(()=>({getValidationProps:P,inputRef:q,registeredInputs:O,registerInput:A,getInputControl:L,commit:z,change:M}),[P,O,A,L,z,M])}],55627)},87068,e=>{"use strict";e.i(47167);var t=e.i(33332),s=e.i(71645);let r=s.createContext(void 0);e.s(["useFieldsetRootContext",0,function(e=!1){let a=s.useContext(r);if(!a&&!e)throw Error((0,t.default)(86));return a}])},81104,e=>{"use strict";var t=e.i(46376),s=e.i(88940),r=e.i(69690);e.s(["useRegisterFieldControl",0,function(e,a,i,n,l=!0,o){let{registerFieldControl:d}=(0,r.useFieldRootContext)(),u=(0,s.useRefWithInit)(()=>Symbol());(0,t.useIsoLayoutEffect)(()=>{let t=u.current;l?d(t,{controlRef:e,getValue:n,id:a,name:o,value:i}):d(t,void 0)},[e,l,n,a,o,d,u,i]),(0,t.useIsoLayoutEffect)(()=>{let e=u.current;return()=>{d(e,void 0)}},[d,u])}])},69690,75812,e=>{"use strict";var t=e.i(33332),s=e.i(71645),r=e.i(56789);let a={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},i={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},n={disabled:!1,...i};e.s(["DEFAULT_FIELD_ROOT_STATE",0,n,"DEFAULT_FIELD_STATE_ATTRIBUTES",0,i,"DEFAULT_VALIDITY_STATE",0,a,"fieldValidityMapping",0,{valid:e=>null===e?null:e?{"data-valid":""}:{"data-invalid":""}}],75812);let l={invalid:void 0,name:void 0,validityData:{state:a,errors:[],error:"",value:"",initialValue:null},setValidityData:r.NOOP,disabled:void 0,setTouched:r.NOOP,setDirty:r.NOOP,setFilled:r.NOOP,setFocused:r.NOOP,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:n,registerFieldControl:r.NOOP,validation:{getValidationProps:(e,t=r.EMPTY_OBJECT)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:r.NOOP,getInputControl:()=>null,commit:async()=>{},change:r.NOOP}},o=s.createContext(l);e.s(["DEFAULT_FIELD_ROOT_CONTEXT",0,l,"FieldRootContext",0,o,"useFieldRootContext",0,function(e=!0){let a=s.useContext(o);if(a.setValidityData===r.NOOP&&!e)throw Error((0,t.default)(28));return a}],69690)},84708,e=>{"use strict";e.i(47167);var t=e.i(71645),s=e.i(56789);let r=t.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:s.NOOP,validationMode:"onSubmit",submitCountRef:{current:0}});e.s(["useFormContext",0,function(){return t.useContext(r)}])},47778,e=>{"use strict";e.i(47167);var t=e.i(71645),s=e.i(56789);let r=t.createContext({controlId:void 0,registerControlId:s.NOOP,resetControlId:s.NOOP,labelId:void 0,setLabelId:s.NOOP,messageIds:[],setMessageIds:s.NOOP,getDescriptionProps:e=>e});e.s(["LabelableContext",0,r,"useLabelableContext",0,function(){return t.useContext(r)}])},31421,e=>{"use strict";var t=e.i(71645),s=e.i(46376),r=e.i(88015);e.s(["useAriaLabelledBy",0,function(e,a,i,n=!0,l){let[o,d]=t.useState(),u=(0,r.useBaseUiId)(l?`${l}-label`:void 0),c=e??a??o;return(0,s.useIsoLayoutEffect)(()=>{let t=e||a||!n?void 0:function(e,t){let s=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let s=e.id;if(s){let t=e.nextElementSibling;if(t&&t.htmlFor===s)return t}let r=e.labels;return r&&r[0]}(e);if(s)return!s.id&&t&&(s.id=t),s.id||void 0}(i.current,u);o!==t&&d(t)}),c}])},38489,e=>{"use strict";var t=e.i(71645),s=e.i(46376),r=e.i(67865),a=e.i(88940),i=e.i(56789),n=e.i(88015),l=e.i(47778);e.s(["useLabelableId",0,function(e={}){let{id:o,enabled:d=!0}=e,{controlId:u,registerControlId:c,resetControlId:m}=(0,l.useLabelableContext)(),f=(0,n.useBaseUiId)(),x=(0,a.useRefWithInit)(()=>Symbol()),h=t.useRef(!1),p=t.useRef(!1),g=(0,r.useStableCallback)(()=>{h.current&&c!==i.NOOP&&(h.current=!1,c(x.current,void 0))});return(0,s.useIsoLayoutEffect)(()=>{let e;if(!d||c===i.NOOP)return void g();if(void 0!==o)p.current=!0,e=o;else{if(!p.current)return void m();e=f}void 0===e?g():(h.current=!0,c(x.current,e))},[o,d,c,m,f,x,g]),(0,s.useIsoLayoutEffect)(()=>g,[g]),(d?u:void 0)??o??f}])},86698,e=>{"use strict";e.s(["serializeValue",0,function(e){if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}])},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 r=(0,t.default)(s);e.s(["ChevronLeft",0,r],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 r=(0,t.default)(s);e.s(["ChevronRight",0,r],67927)},36518,e=>{"use strict";var t=e.i(56420);let s={name:"cloud-off",size:24,node:[["path",{d:"M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057",key:"1uxyv8"}],["path",{d:"M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78",key:"99tcn7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};s.node;let r=(0,t.default)(s);e.s(["CloudOff",0,r],36518)},25398,e=>{"use strict";var t=e.i(56420);let s={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};s.node;let r=(0,t.default)(s);e.s(["RotateCw",0,r],25398)},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 r=(0,t.default)(s);e.s(["Search",0,r],66595)},30274,e=>{"use strict";var t=e.i(56420);let s={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};s.node;let r=(0,t.default)(s);e.s(["Send",0,r],30274)},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 r=(0,t.default)(s);e.s(["SquarePen",0,r],19759)},1753,e=>{"use strict";var t=e.i(43476),s=e.i(18566),r=e.i(71645),a=e.i(41880),i=e.i(77821),n=e.i(24071),l=e.i(85595),o=e.i(35056),d=e.i(56420);let u={name:"circle-slash",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]};u.node;let c=(0,d.default)(u),m={name:"replace",size:24,node:[["path",{d:"M14 4a1 1 0 0 1 1-1",key:"dhj8ez"}],["path",{d:"M15 10a1 1 0 0 1-1-1",key:"1mnyi5"}],["path",{d:"M21 4a1 1 0 0 0-1-1",key:"sfs9ap"}],["path",{d:"M21 9a1 1 0 0 1-1 1",key:"mp6qeo"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a2 2 0 0 1 2-2h2",key:"15xut4"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}]]};m.node;let f=(0,d.default)(m);var x=e.i(30274),h=e.i(90063),p=e.i(49635),g=e.i(74470),b=e.i(66390),v=e.i(15905),y=e.i(91727);e.s([],6329),e.i(6329);var j=e.i(28918),w=e.i(46376),N=e.i(2077),k=e.i(56789),C=e.i(75606),S=e.i(56434),I=e.i(74354),T=e.i(75812);let q={checked:e=>e?{"data-checked":""}:{"data-unchecked":""},...I.transitionStatusMapping,...T.fieldValidityMapping};var O=e.i(64350),R=e.i(88015),E=e.i(52245),A=e.i(40886),L=e.i(70359),z=e.i(48990),M=e.i(69690),P=e.i(57153),F=e.i(47778),D=e.i(31421),V=e.i(38489);let _=r.createContext(void 0);var B=e.i(86698),K=e.i(33332);let U=r.createContext(void 0),Q=r.forwardRef(function(e,s){let{render:a,className:i,disabled:n=!1,readOnly:l=!1,required:o=!1,"aria-labelledby":d,value:u,inputRef:c,nativeButton:m=!1,id:f,style:x,...h}=e,p=r.useContext(_),{disabled:g,readOnly:b,required:v,form:y,checkedValue:I,touched:T=!1,validation:K,name:Q,setCheckedValue:W=k.NOOP,setTouched:H=k.NOOP,registerInputRef:$=k.NOOP}=p??{},{setTouched:Y,setFilled:J,state:G,disabled:X}=(0,M.useFieldRootContext)(),Z=(0,P.useFieldItemContext)(),{labelId:ee,getDescriptionProps:et}=(0,F.useLabelableContext)(),es=X||Z.disabled||g||n,er=b||l,ea=v||o,ei=p?I===u:""===u,en=r.useRef(null),el=r.useRef(null),eo=K?.registerInput,ed=r.useCallback(e=>eo?.(e,{controlRef:en,value:void 0}),[eo]),eu=(0,j.useMergedRefs)(c,el,$,ed);(0,w.useIsoLayoutEffect)(()=>{el.current?.checked&&J(!0)},[J]),(0,w.useIsoLayoutEffect)(()=>{if(el.current){if(es&&ei)return void $(null);$(el.current)}},[ei,es,$]);let ec=(0,R.useBaseUiId)(),em=(0,V.useLabelableId)({id:f}),ef=m?void 0:em,ex={role:"radio","aria-checked":ei,"aria-labelledby":(0,D.useAriaLabelledBy)(d,ee,el,!m,ef),[L.ACTIVE_COMPOSITE_ITEM]:ei?"":void 0,id:m?em:ec,onKeyDown(e){"Enter"===e.key&&e.preventDefault()},onClick(e){if(e.defaultPrevented||es||er)return;e.preventDefault();let t=el.current;t&&(0,O.dispatchClickWithModifiers)(t,e)},onFocus(e){e.defaultPrevented||es||er||!T||(el.current?.click(),H(!1))}},{getButtonProps:eh,buttonRef:ep}=(0,A.useButton)({disabled:es,native:m,composite:!1}),eg={type:"radio",ref:eu,form:y,id:ef,name:Q,tabIndex:-1,style:Q?N.visuallyHiddenInput:N.visuallyHidden,"aria-hidden":!0,...void 0!==u?{value:(0,B.serializeValue)(u)}:k.EMPTY_OBJECT,disabled:es,checked:ei,required:ea,readOnly:er,onChange(e){if(e.nativeEvent.defaultPrevented||es||er||void 0===u)return;let t=(0,C.createChangeEventDetails)(S.REASONS.none,e.nativeEvent);W(u,t),t.isCanceled||Y(!0)},onClick(e){e.stopPropagation()},onFocus(){en.current?.focus()}},eb=r.useMemo(()=>({...G,required:ea,disabled:es,readOnly:er,checked:ei}),[G,es,er,ei,ea]),ev=void 0!==p,ey=[s,en,ep],ej=[ex,h,eh,et,K?e=>K.getValidationProps(es,e):k.EMPTY_OBJECT],ew=(0,E.useRenderElement)("span",e,{enabled:!ev,state:eb,ref:ey,props:ej,stateAttributesMapping:q});return(0,t.jsxs)(U.Provider,{value:eb,children:[ev?(0,t.jsx)(z.CompositeItem,{tag:"span",render:a,className:i,style:x,state:eb,refs:ey,props:ej,stateAttributesMapping:q}):ew,(0,t.jsx)("input",{...eg,suppressHydrationWarning:!0})]})});var W=e.i(37584),H=e.i(23910);let $=r.forwardRef(function(e,t){let{render:s,className:a,style:i,keepMounted:n=!1,...l}=e,o=function(){let e=r.useContext(U);if(void 0===e)throw Error((0,K.default)(52));return e}(),d=o.checked,{mounted:u,transitionStatus:c,setMounted:m}=(0,H.useTransitionStatus)(d),f={...o,transitionStatus:c},x=r.useRef(null),h=(0,E.useRenderElement)("span",e,{ref:[t,x],state:f,props:l,stateAttributesMapping:q});return((0,W.useOpenChangeComplete)({batch:!0,enabled:!d,open:d,ref:x,onComplete(){d||m(!1)}}),n||u)?h:null});e.s(["Indicator",0,$,"Root",0,Q],66747);var Y=e.i(66747),Y=Y,J=e.i(51437),G=e.i(67865),X=e.i(84446),Z=e.i(73327),ee=e.i(5934),et=e.i(81104),es=e.i(55627),er=e.i(87068),ea=e.i(84708),ei=e.i(6039);let en=[Z.SHIFT],el=r.forwardRef(function(e,s){let{render:a,className:i,disabled:n,readOnly:l,required:o,onValueChange:d,value:u,defaultValue:c,form:m,name:f,inputRef:x,id:h,style:p,...g}=e,{setTouched:b,setFocused:v,validationMode:y,name:j,disabled:w,state:N,validation:k,setDirty:C,setFilled:S,validityData:I}=(0,M.useFieldRootContext)(),{labelId:q}=(0,F.useLabelableContext)(),{clearErrors:O,elementRef:E}=(0,ea.useFormContext)(),A=(0,er.useFieldsetRootContext)(!0),L=w||n,z=j??f,P=(0,R.useBaseUiId)(h),[D,V]=(0,J.useControlled)({controlled:u,default:c,name:"RadioGroup",state:"value"}),[B,K]=r.useState(!1),U=(0,G.useStableCallback)((e,t)=>{d?.(e,t),t.isCanceled||V(e)}),Q=k.getInputControl,W=r.useMemo(()=>({get current(){return Q()}}),[Q]),H=r.useRef(null),$=r.useRef(null);function Y(e){let t;return x&&("function"==typeof x?t=x(e):x.current=e),H.current=e,t}let Z=(0,G.useStableCallback)(e=>{if(!e||e.disabled)return;$.current||($.current=e);let t=H.current,s=e.checked||null==t||t.disabled?Y(e):void 0;return()=>{$.current===e&&($.current=null),H.current===e?s?(s(),H.current=null):Y(null):s?.()}}),el=(0,G.useStableCallback)(()=>{let e=E.current;if(!e)return D??null;for(let t of k.registeredInputs.keys())if(t.checked&&(0,es.isEligibleInput)(t,e))return D??null;return null});(0,et.useRegisterFieldControl)(W,P,D??null,el,!L,f),(0,ei.useValueChanged)(D,()=>{O(z),C(D!==I.initialValue),S(null!=D),k.change(D);let e=$.current;null==D&&e&&!e.disabled&&Y(e)});let eo=q??A?.legendId,ed={...N,disabled:L??!1,required:o??!1,readOnly:l??!1},eu=r.useMemo(()=>({checkedValue:D,disabled:L,form:m,validation:k,name:z,readOnly:l,registerInputRef:Z,required:o,setCheckedValue:U,setTouched:K,touched:B}),[D,L,m,k,z,l,Z,o,U,K,B]);return(0,t.jsx)(_.Provider,{value:eu,children:(0,t.jsx)(ee.CompositeRoot,{render:a,className:i,style:p,state:ed,props:[{id:h,role:"radiogroup","aria-required":o||void 0,"aria-disabled":L||void 0,"aria-readonly":l||void 0,"aria-labelledby":eo,onFocus(){v(!0)},onBlur(e){(0,X.contains)(e.currentTarget,e.relatedTarget)||(b(!0),v(!1),"onBlur"===y&&k.commit(D))},onKeyDownCapture(e){e.key.startsWith("Arrow")&&(K(!0),v(!0))}},g,e=>k.getValidationProps(L??!1,e)],refs:[s],stateAttributesMapping:T.fieldValidityMapping,enableHomeAndEndKeys:!1,modifierKeys:en})})});function eo({className:e,...s}){return(0,t.jsx)(el,{"data-slot":"radio-group",className:(0,h.classNames)("flex flex-col gap-2",e),...s})}function ed({className:e,...s}){return(0,t.jsx)(Y.Root,{"data-slot":"radio-group-item",className:(0,h.classNames)("inline-flex size-4 shrink-0 items-center justify-center rounded-full border border-input bg-background transition-colors duration-(--duration-fast) outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring data-checked:border-primary data-disabled:opacity-45",e),...s,children:(0,t.jsx)(Y.Indicator,{"data-slot":"radio-group-indicator",className:"size-2 rounded-full bg-primary"})})}var eu=e.i(60592),ec=e.i(43988),em=e.i(67874),ef=e.i(17981),ex=e.i(88393),eh=e.i(31071),ep=e.i(39448);let eg=[{value:"open",label:"Open"},{value:"answered",label:"Answered"},{value:"stale",label:"Stale"},{value:"all",label:"All"}],eb={title:"No questions for you",description:"When a ship asks argo a question, it shows up here with its options. You answer it from the question."},ev={open:eb,answered:{title:"Nothing answered yet",description:"Questions you answer show up here."},stale:{title:"Nothing stale",description:"Questions their ship withdrew or replaced before you answered show up here."},all:eb};function ey({state:e}){let s="size-(--size-icon-sm) shrink-0 text-muted-foreground";switch(e){case"Answered":return(0,t.jsx)(l.CircleCheck,{"aria-hidden":!0,className:s});case"Withdrawn":return(0,t.jsx)(c,{"aria-hidden":!0,className:s});case"Replaced":return(0,t.jsx)(f,{"aria-hidden":!0,className:s});case"Open":return null}}function ej({filter:e,onFilterChange:s,counts:r}){return(0,t.jsx)(eu.Tabs,{value:e,onValueChange:e=>{let t=eg.find(t=>t.value===e);t&&s(t.value)},children:(0,t.jsx)(eu.TabsList,{"aria-label":"Show",className:"max-sm:w-full",children:eg.map(({value:e,label:s})=>(0,t.jsxs)(eu.TabsTrigger,{value:e,"data-testid":`questions-filter-${e}`,className:"max-sm:grow",children:[s,void 0===r[e]?null:(0,t.jsx)(eu.TabsCount,{children:r[e]})]},e))})})}function ew({questions:e,selectedId:s,onSelect:r,now:a}){return(0,t.jsx)("ul",{"aria-label":"Questions to argo",className:"flex flex-col max-sm:gap-2",children:e.map(e=>{let i=new Date(e.message.sentAt),n=function(e){if(null!==e.question.answer)return"Answered";switch(e.stale?.kind){case"withdrawn":return"Withdrawn";case"replaced":return"Replaced";case void 0:return"Open"}}(e),l="Open"===n,o=e.deliveryId===s;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"questions-row","data-delivery-id":e.deliveryId,"aria-current":o?"true":void 0,onClick:()=>{r(e.deliveryId)},className:"relative flex w-full min-w-0 flex-col gap-1 border-b border-border py-2.5 pr-3 pl-5 text-left transition-colors duration-(--duration-fast) outline-none hover:bg-accent focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring aria-[current=true]:bg-accent max-sm:rounded-lg max-sm:border max-sm:bg-card max-sm:py-3",children:[l?(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute top-4 left-2 size-1.5 rounded-full bg-primary max-sm:top-4.5"}):null,(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(ey,{state:n}),(0,t.jsx)(ep.ShipName,{name:e.message.sender.name,shipId:e.message.sender.id,isSuffixShown:!0,className:(0,h.classNames)("min-w-0",l?"font-semibold":"text-muted-foreground")}),(0,t.jsx)("time",{dateTime:e.message.sentAt,title:(0,p.fullDateTime)(i),className:"ml-auto shrink-0 text-meta text-muted-foreground tabular-nums",children:a.getTime()-i.getTime()<864e5?(0,p.clockTime)(i):(0,p.shortDateTime)(i)})]}),(0,t.jsx)("span",{className:(0,h.classNames)("block min-w-0 truncate text-meta max-sm:text-body",null===e.stale?"text-foreground":"text-muted-foreground line-through"),children:e.question.title}),(0,t.jsx)("span",{className:"sr-only",children:n})]})},e.deliveryId)})})}function eN({question:e}){let{answer:s,options:r}=e.question;if(null===s)return null;let a=new Date(s.sentAt),i=r.find(({key:e})=>e===s.option);return(0,t.jsxs)("div",{"data-testid":"questions-answered",className:"flex flex-col gap-1 rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-meta text-tone-ok-fg",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,t.jsx)(l.CircleCheck,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:["Answered at"," ",(0,t.jsx)("time",{dateTime:s.sentAt,title:(0,p.fullDateTime)(a),children:(0,p.clockTime)(a)}),void 0===i?" with a note.":`: ${i.key}. ${i.label}`]})]}),null===s.note?null:(0,t.jsx)("p",{className:"whitespace-pre-wrap [overflow-wrap:anywhere]",children:s.note})]})}function ek({deliveryId:e,title:s,onSelect:r,testId:a}){return(0,t.jsx)("button",{type:"button","data-testid":a,onClick:()=>{r(e)},className:"min-w-0 text-left font-medium text-foreground underline underline-offset-2 [overflow-wrap:anywhere] hover:text-primary focus-visible:outline-2 focus-visible:outline-ring",children:s})}function eC({question:e,onSelect:s}){let{stale:r}=e;if(null===r)return null;let a=new Date(r.sentAt),i=(0,t.jsx)("time",{dateTime:r.sentAt,title:(0,p.fullDateTime)(a),children:(0,p.clockTime)(a)});return(0,t.jsxs)("div",{role:"status","data-testid":"questions-stale",className:"flex flex-col gap-1 rounded-md border border-tone-ended-border bg-tone-ended-bg px-3 py-2 text-meta text-tone-ended-fg",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:["withdrawn"===r.kind?(0,t.jsx)(c,{"aria-hidden":!0}):(0,t.jsx)(f,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:["withdrawn"===r.kind?"Withdrawn":"Replaced"," by ",e.message.sender.name," at ",i,". It can’t be answered."]})]}),"replaced"===r.kind?(0,t.jsxs)("p",{className:"flex flex-wrap items-baseline gap-1",children:["Answer the new question:"," ",(0,t.jsx)(ek,{deliveryId:r.deliveryId,title:r.by.title,onSelect:s,testId:"questions-replacement"})]}):null]})}function eS({option:e,pick:s,asker:r}){let a=e.key===s.option;return(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-2 font-medium text-foreground",children:[e.key,". ",e.label,a?(0,t.jsxs)(b.Badge,{variant:"outline",children:[r,"’s pick"]}):null]}),""===e.detail?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e.detail}),a?(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["Why: ",s.why]}):null]})}function eI({question:e}){let{options:s,pick:r,answer:a}=e.question;return(0,t.jsx)("ol",{"aria-label":"Options",className:"flex flex-col gap-2",children:s.map(s=>(0,t.jsx)("li",{"data-testid":`questions-option-${s.key}`,className:(0,h.classNames)("rounded-md border px-3 py-2.5",a?.option===s.key?"border-primary bg-accent":"border-border bg-card"),children:(0,t.jsx)(eS,{option:s,pick:r,asker:e.message.sender.name})},s.key))})}function eT({question:e,onAnswer:s,isPending:a,isPhone:i}){let n=(0,r.useId)(),l=(0,r.useId)(),[o,d]=(0,r.useState)(void 0),[u,c]=(0,r.useState)(""),m=(0,g.useShortcutPlatform)(),{options:f,pick:h}=e.question,p=e.message.sender.name,b=void 0===o&&""===u.trim();return(0,t.jsxs)("form",{className:"flex flex-col gap-3",onSubmit:t=>{if(t.preventDefault(),b||a)return;let r=u.trim();s({deliveryId:e.deliveryId,answer:void 0===o?{note:r}:{option:o,...""===r?{}:{note:r}}})},children:[(0,t.jsx)(eo,{"aria-label":"Options",onValueChange:e=>{d(e)},children:f.map(e=>{let s=`${n}-option-${e.key}`;return(0,t.jsxs)("div",{"data-testid":`questions-option-${e.key}`,className:"flex items-start gap-2.5 rounded-md border border-border bg-card px-3 py-2.5 has-data-checked:border-primary",children:[(0,t.jsx)(ed,{id:s,value:e.key,className:"mt-0.5"}),(0,t.jsx)("label",{htmlFor:s,className:"min-w-0 grow cursor-pointer",children:(0,t.jsx)(eS,{option:e,pick:h,asker:p})})]},e.key)})}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border pt-3",children:[(0,t.jsxs)(y.Label,{htmlFor:n,children:["Note to ",p]}),(0,t.jsx)(ec.Textarea,{id:n,rows:3,size:i?"touch":"md",placeholder:"Optional with an option; on its own, ask for more context or say none fits",value:u,onChange:e=>{c(e.target.value)},onKeyDown:g.submitOnSendShortcut,"aria-describedby":l,"data-testid":"questions-note"}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("p",{id:l,className:"text-meta text-muted-foreground",children:["Sent as a reply to ",p,"; also marks the message done."]}),(0,t.jsxs)(v.Button,{type:"submit",variant:"primary",size:i?"touch":"sm",icon:(0,t.jsx)(x.Send,{"aria-hidden":!0}),isLoading:a,disabled:b&&!a,"aria-keyshortcuts":null===m?void 0:(0,g.sendShortcutAria)(m),"data-testid":"questions-send",children:["Send answer",null===m?null:(0,t.jsx)(eh.SendShortcutHint,{platform:m})]})]})]})]})}function eq({question:e,onAnswer:s,onSelect:r,pendingIds:a,isPhone:i,isReadOnly:n=!1}){let l=new Date(e.message.sentAt),o=e.message.sender,d=null===e.question.answer&&null===e.stale;return(0,t.jsxs)("article",{"aria-label":e.question.title,"data-testid":"questions-question",className:(0,h.classNames)("flex min-h-0 flex-col gap-3",i?"grow":"h-full"),children:[(0,t.jsxs)("header",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("h2",{className:"min-w-0 text-heading font-semibold [overflow-wrap:anywhere]",children:e.question.title}),(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-1 text-meta text-muted-foreground",children:["From ",(0,t.jsx)(ep.ShipName,{name:o.name,shipId:o.id,isSuffixShown:!0})," ·"," ",(0,t.jsx)("time",{dateTime:e.message.sentAt,title:(0,p.fullDateTime)(l),children:(0,p.shortDateTime)(l)})]}),null===e.replaces?null:(0,t.jsxs)("p",{className:"flex flex-wrap items-baseline gap-1 text-meta text-muted-foreground",children:["Replaces"," ",(0,t.jsx)(ek,{deliveryId:e.replaces.deliveryId,title:e.replaces.title,onSelect:r,testId:"questions-replaces"})]})]}),(0,t.jsx)(eN,{question:e}),(0,t.jsx)(eC,{question:e,onSelect:r}),(0,t.jsxs)("div",{className:"flex min-h-0 grow flex-col gap-3 overflow-y-auto",children:[""===e.question.context?null:(0,t.jsx)("p",{className:"text-body whitespace-pre-wrap text-foreground [overflow-wrap:anywhere] max-sm:text-body-touch",children:e.question.context}),!d||n?(0,t.jsx)(eI,{question:e}):(0,t.jsx)(eT,{question:e,onAnswer:s,isPending:a.has(e.deliveryId),isPhone:i})]}),n&&d?(0,t.jsx)("p",{"data-testid":"questions-read-only",className:"border-t border-border pt-3 text-meta text-muted-foreground",children:"Read-only: you see argo’s questions, and can’t answer them."}):null]})}function eO({questions:e,filter:s,onFilterChange:r,counts:a,selectedId:i,onSelect:l,state:d,onRetry:u,now:c,...m}){if("loading"===d)return(0,t.jsxs)("div",{"data-slot":"operator-questions","data-state":"loading",className:"grid gap-4 sm:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]",children:[(0,t.jsx)(ex.LoadingSkeleton,{variant:"list",rows:5,label:"Loading the questions"}),(0,t.jsx)(ex.LoadingSkeleton,{variant:"detail",label:"Loading the question",className:"max-sm:hidden"})]});if("error"===d)return(0,t.jsx)("div",{"data-slot":"operator-questions","data-state":"error","data-testid":"questions-error",children:(0,t.jsx)(ef.InlineError,{variant:"page",title:"Couldn’t load the questions",description:"This page couldn’t reach the fleet server. Questions to argo are stored on the server, so nothing is lost.",onRetry:u})});let f=e.find(e=>e.deliveryId===i),x=(0,t.jsx)(ej,{filter:s,onFilterChange:r,counts:a}),h=(0,t.jsx)("div",{"data-testid":"questions-empty",children:(0,t.jsx)(em.EmptyState,{icon:(0,t.jsx)(o.CircleHelp,{}),title:ev[s].title,description:ev[s].description})});return(0,t.jsxs)("div",{"data-slot":"operator-questions","data-state":"ready",children:[(0,t.jsxs)("div",{className:"grid min-h-128 grid-cols-[minmax(0,2fr)_minmax(0,3fr)] overflow-hidden rounded-lg border border-border bg-card max-sm:hidden",children:[(0,t.jsxs)("div",{className:"flex min-h-0 flex-col border-r border-border",children:[(0,t.jsx)("div",{className:"border-b border-border p-2.5",children:x}),0===e.length?(0,t.jsx)("div",{className:"p-4",children:h}):(0,t.jsx)(ew,{questions:e,selectedId:i,onSelect:l,now:c})]}),(0,t.jsx)("div",{className:"flex min-h-0 flex-col bg-background p-5",children:f?(0,t.jsx)(eq,{question:f,isPhone:!1,onSelect:l,...m}):(0,t.jsx)("p",{className:"m-auto text-meta text-muted-foreground",children:0===e.length?null:!0===m.isReadOnly?"Choose a question to read it.":"Choose a question to answer it."})})]}),(0,t.jsx)("div",{className:"flex flex-col gap-3 sm:hidden",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v.Button,{variant:"ghost",size:"touch",icon:(0,t.jsx)(n.ChevronLeft,{"aria-hidden":!0}),className:"-ml-2 self-start","data-testid":"questions-back",onClick:()=>{l(void 0)},children:"Questions"}),(0,t.jsx)(eq,{question:f,isPhone:!0,onSelect:l,...m})]}):(0,t.jsxs)(t.Fragment,{children:[x,0===e.length?h:(0,t.jsx)(ew,{questions:e,selectedId:i,onSelect:l,now:c})]})})]})}var eR=e.i(90262),eE=e.i(87964),eA=e.i(18423),eL=e.i(96676),ez=e.i(42454),eM=e.i(78485);e.s(["QuestionsPageFor",0,function({filterParameter:e,selectedId:n}){let l=(0,s.useRouter)(),o=(0,eL.useNow)(),d=(0,ez.readQuestionFilter)(e),u=(0,ez.useQuestions)(),c=(0,ez.useAnswer)(),m=(0,eA.useLiveFleet)(),f=(0,eE.useConsoleFrame)();(0,eM.useSignInWhenSessionEnds)([m.error]);let x=(0,eR.useAccess)(),[h,p]=(0,r.useState)(new Set),g=u.data??[],b=e=>{l.replace((0,ez.questionsPathOf)(e),{scroll:!1})};return(0,t.jsx)(i.ListPage,{...f,title:"Questions",description:"Questions ships asked argo, with their options and the asker’s pick. Answering sends your answer back as a reply.",live:m.live,children:(0,t.jsx)(eO,{isReadOnly:!x.canReceive,questions:(0,ez.questionsFor)(g,d),filter:d,onFilterChange:e=>{b({filter:e})},counts:u.data?(0,ez.questionFilterCounts)(g):{},selectedId:n,onSelect:e=>{void 0===e?b({filter:d}):b({filter:(0,ez.questionsFor)(g,d).some(t=>t.deliveryId===e)?d:"all",deliveryId:e})},state:u.isError?"error":u.data?"ready":"loading",onRetry:()=>{u.refetch()},onAnswer:({deliveryId:e,answer:t})=>{p(t=>new Set([...t,e])),c.mutateAsync({deliveryId:e,answer:t,idempotencyKey:`answer-${e}-${crypto.randomUUID()}`}).catch(e=>{(0,a.showToast)({title:"Couldn’t send the answer",description:e instanceof Error?e.message:"Try again in a moment.",tone:"error"})}).finally(()=>{p(t=>new Set([...t].filter(t=>t!==e)))})},pendingIds:h,now:o})})}],1753)},36651,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Kbd",0,function({className:e,...r}){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),...r})}])},91727,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Label",0,function({className:e,htmlFor:r,...a}){return(0,t.jsx)("label",{"data-slot":"label",htmlFor:r,className:(0,s.classNames)("text-body font-medium text-foreground select-none",e),...a})}])},19321,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Skeleton",0,function({className:e,...r}){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),...r})}])},43988,e=>{"use strict";var t=e.i(43476),s=e.i(25913),r=e.i(90063);let a=(0,s.cva)("w-full min-w-0 resize-none rounded-md border border-input bg-card px-3 py-2 text-foreground shadow-sm transition-[border-color,box-shadow] duration-(--duration-fast) outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/22 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/16 disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50 disabled:shadow-none",{variants:{size:{md:"text-body",touch:"rounded-lg text-input-touch"},isMono:{true:"font-mono",false:""}},compoundVariants:[{size:"md",isMono:!0,className:"text-code"}],defaultVariants:{size:"md",isMono:!1}});e.s(["Textarea",0,function({className:e,size:s,isMono:i,rows:n=4,...l}){return(0,t.jsx)("textarea",{"data-slot":"textarea",rows:n,className:(0,r.classNames)(a({size:s,isMono:i}),e),...l})}])},67874,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["EmptyState",0,function({title:e,description:r,icon:a,action:i,variant:n="page",className:l}){return"section"===n?(0,t.jsxs)("p",{"data-slot":"empty-state","data-variant":n,className:(0,s.classNames)("rounded-lg border border-border px-4 py-3 text-center text-meta text-muted-foreground",l),children:[e,r?(0,t.jsxs)(t.Fragment,{children:[" ",r]}):null]}):"no-results"===n?(0,t.jsxs)("div",{"data-slot":"empty-state","data-variant":n,className:(0,s.classNames)("flex flex-col items-center gap-2.5 rounded-lg border border-border bg-card px-4 py-6 text-center",l),children:[(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:e}),i]}):(0,t.jsxs)("div",{"data-slot":"empty-state","data-variant":n,className:(0,s.classNames)("flex flex-col items-center gap-3 rounded-lg border border-dashed border-border bg-card px-6 py-10 text-center",l),children:[a?(0,t.jsx)("span",{"aria-hidden":!0,className:"flex size-10 items-center justify-center rounded-lg border border-border bg-muted text-muted-foreground [&_svg]:size-(--size-icon-xl)",children:a}):null,(0,t.jsx)("h2",{className:"text-heading font-semibold text-foreground max-sm:text-heading-touch",children:e}),r?(0,t.jsx)("p",{className:"max-w-96 text-meta text-muted-foreground max-sm:text-body-touch",children:r}):null,i?(0,t.jsx)("div",{className:"mt-1 max-sm:w-full max-sm:[&>*]:w-full",children:i}):null]})}])},17981,e=>{"use strict";var t=e.i(43476),s=e.i(22768),r=e.i(36518),a=e.i(25398),i=e.i(90063),n=e.i(15905);e.s(["InlineError",0,function({title:e,description:l,detail:o,onRetry:d,retryNote:u,variant:c="section",id:m,className:f}){return"field"===c?(0,t.jsxs)("p",{id:m,"data-slot":"inline-error","data-variant":c,className:(0,i.classNames)("flex items-center gap-1.5 text-meta text-destructive-text [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",f),children:[(0,t.jsx)(s.CircleAlert,{"aria-hidden":!0}),e]}):"section"===c?(0,t.jsxs)("div",{role:"alert","data-slot":"inline-error","data-variant":c,className:(0,i.classNames)("flex gap-2 rounded-lg border border-tone-attention-border bg-tone-attention-bg p-3 text-tone-attention-fg",f),children:[(0,t.jsx)(s.CircleAlert,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon) shrink-0"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("p",{className:"text-body font-medium",children:e}),l?(0,t.jsx)("p",{className:"text-meta text-foreground",children:l}):null,d?(0,t.jsx)(n.Button,{size:"xs",icon:(0,t.jsx)(a.RotateCw,{"aria-hidden":!0}),onClick:d,className:"self-start",children:"Try again"}):null]})]}):(0,t.jsxs)("div",{role:"alert","data-slot":"inline-error","data-variant":c,className:(0,i.classNames)("flex flex-col items-center gap-3 rounded-lg border border-border bg-card px-6 py-10 text-center",f),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"flex size-10 items-center justify-center rounded-lg border border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg [&_svg]:size-(--size-icon-xl)",children:(0,t.jsx)(r.CloudOff,{})}),(0,t.jsx)("h2",{className:"text-heading font-semibold text-foreground max-sm:text-heading-touch",children:e}),l?(0,t.jsx)("p",{className:"max-w-96 text-meta text-muted-foreground max-sm:text-body-touch",children:l}):null,o?(0,t.jsx)("code",{className:"rounded-sm border border-border bg-muted px-2 py-0.5 font-mono text-id text-muted-foreground",children:o}):null,d?(0,t.jsxs)("div",{className:"flex items-center gap-2 max-sm:w-full max-sm:flex-col",children:[(0,t.jsx)(n.Button,{size:"sm",icon:(0,t.jsx)(a.RotateCw,{"aria-hidden":!0}),onClick:d,className:"max-sm:w-full",children:"Try again"}),u?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:u}):null]}):null]})}])},88393,e=>{"use strict";var t=e.i(43476),s=e.i(90063),r=e.i(19321);function a(e){return Array.from({length:e},(e,t)=>`row-${String(t)}`)}e.s(["LoadingSkeleton",0,function({variant:e,rows:i=4,label:n="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:n}),"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"}),a(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)(r.Skeleton,{className:"h-2.5 w-24"}),(0,t.jsx)(r.Skeleton,{className:"h-5 w-16"}),(0,t.jsx)(r.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(r.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:a(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)(r.Skeleton,{className:"h-2.5 w-20"}),(0,t.jsx)(r.Skeleton,{className:"h-6 w-10"}),(0,t.jsx)(r.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)(r.Skeleton,{className:"h-7 w-48"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(r.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(r.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:a(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)(r.Skeleton,{className:"h-3 w-28"}),(0,t.jsx)(r.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(r.Skeleton,{className:"h-2.5 w-44"})]},e))}):null]})}])},39448,e=>{"use strict";var t=e.i(43476),s=e.i(25913),r=e.i(22016),a=e.i(90063);let i=(0,s.cva)("min-w-0 truncate font-sans font-medium",{variants:{size:{body:"text-body text-foreground",meta:"text-meta text-muted-foreground",title:"text-title font-semibold tracking-tight text-foreground max-sm:text-title-touch"}},defaultVariants:{size:"body"}});e.s(["ShipName",0,function({name:e,shipId:s,size:n,isSuffixShown:l=!1,isOperator:o=!1,href:d,className:u}){let c=d?(0,t.jsx)(r.default,{href:d,className:(0,a.classNames)(i({size:n}),"rounded-xs underline-offset-3 hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"),title:e,children:e}):(0,t.jsx)("span",{className:i({size:n}),title:e,children:e});return(0,t.jsxs)("span",{"data-slot":"ship-name",className:(0,a.classNames)("inline-flex min-w-0 items-baseline gap-1.5",u),children:[c,o?(0,t.jsx)("span",{className:"shrink-0 font-normal text-muted-foreground",children:"(you)"}):null,l&&!o?(0,t.jsxs)("span",{className:"shrink-0 font-mono text-id text-muted-foreground uppercase",children:[(0,t.jsx)("span",{"aria-hidden":!0,children:"· "}),s.slice(-4)]}):null]})}])},77880,85538,e=>{"use strict";var t=e.i(43476),s=e.i(67927),r=e.i(66595),a=e.i(19759),i=e.i(22016),n=e.i(15905),l=e.i(36651),o=e.i(90063);let d={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 u({state:e,className:s}){let{label:r,dot:a}=d[e];return(0,t.jsxs)("span",{"data-slot":"live-status","data-state":e,"aria-live":"polite",className:(0,o.classNames)("inline-flex items-center gap-1.5 text-meta text-muted-foreground",s),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,o.classNames)("size-2 shrink-0 rounded-full",a)}),r]})}e.s(["Header",0,function({breadcrumb:e,parents:o=[],live:d,onCompose:c,onSearch:m}){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:[o.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)(u,{state:d}),m?(0,t.jsxs)(n.Button,{size:"sm",icon:(0,t.jsx)(r.Search,{"aria-hidden":!0}),"data-testid":"header-search",className:"w-60 justify-start font-normal text-muted-foreground",onClick:m,children:[(0,t.jsx)("span",{className:"grow text-left",children:"Search ships or jump to"}),(0,t.jsx)(l.Kbd,{children:"⌘K"})]}):null,c?(0,t.jsx)(n.Button,{size:"sm",icon:(0,t.jsx)(a.SquarePen,{"aria-hidden":!0}),"data-testid":"header-compose",onClick:c,children:"Compose"}):null]})]})}],77880);var c=e.i(24071),m=e.i(57957);e.s(["TopBar",0,function({title:e,live:s,actions:a,back:l,account:o,onSearch:d}){let f=d&&!l?d: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)(c.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)(u,{state:s}),a||f||o&&!l?(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[f?(0,t.jsx)(n.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Search ships or jump to","data-testid":"top-bar-search",onClick:f,children:(0,t.jsx)(r.Search,{"aria-hidden":!0})}):null,a,o&&!l?(0,t.jsx)(m.AccountMenuSheet,{...o}):null]}):null]})}],85538)},77821,e=>{"use strict";var t=e.i(43476),s=e.i(19759),r=e.i(15905),a=e.i(77880),i=e.i(85538);e.s(["ListPage",0,function({title:e,description:n,titleMeta:l,primaryAction:o,toolbar:d,live:u,onCompose:c,onSearch:m,account:f,banner:x,children:h}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Header,{breadcrumb:e,live:u,onCompose:c,onSearch:m}),x,(0,t.jsx)(i.TopBar,{title:e,live:u,account:f,onSearch:m,actions:c?(0,t.jsx)(r.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Compose","data-testid":"top-bar-compose",onClick:c,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]}),n?(0,t.jsx)("p",{className:"text-meta text-muted-foreground max-sm:text-body-touch",children:n}):null]}),o?(0,t.jsx)("div",{className:"shrink-0 max-sm:w-full max-sm:[&>*]:w-full",children:o}):null]}),d,h]})]})}])},18423,e=>{"use strict";var t=e.i(12598),s=e.i(5861),r=e.i(71645),a=e.i(42454),i=e.i(27702);let n=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 o=new Set(["LabelDefined","LabelValuesChanged","LabelRetired","LabelAssigned","LabelUnassigned","LabelDeleted"]),d=new Set(["DeliveryUndeliverable","DeliveryNotHandled","DeliveryDismissed"]);e.s(["useLiveFleet",0,function(){let e=(0,i.useTRPC)(),u=(0,t.useQueryClient)(),[c,m]=(0,r.useState)(new Set),f=e=>{l(u,e)},x=(0,s.useSubscription)(e.fleet.events.subscriptionOptions({lastEventId:null},{onData:({data:t})=>{var s,r,i;if("resync"===t.kind)return void f(e.fleet.pathKey());let{event:l}=t;for(let t of new Set([l.shipId,l.actorShipId]))null!==t&&(f(e.fleet.ship.queryKey({shipId:t})),f(e.fleet.shipTimeline.queryKey({shipId:t})),f(e.fleet.shipWay.queryKey({shipId:t})));if(null!==l.messageId&&(f(e.fleet.shipMessages.pathKey()),f(e.fleet.shipWay.pathKey()),f(e.fleet.overdue.queryKey()),f(e.fleet.message.queryKey({messageId:l.messageId})),f(e.fleet.inbox.pathKey()),f(a.QUESTIONS_KEY),f(e.fleet.noShipCanTake.queryKey())),s=l.type,d.has(s)&&f(e.fleet.needsAttention.queryKey()),r=l.type,o.has(r)&&f(e.fleet.labels.queryKey()),"NetworkRulesDeclared"===l.type&&f(e.fleet.declaredNetworkRules.queryKey()),i=l.type,!n.has(i))return;f(e.fleet.list.queryKey()),f(e.fleet.noShipCanTake.queryKey());let{shipId:u}=l;"ShipCommissioned"===l.type&&null!==u&&m(e=>new Set([...e,u]))}}));return{live:function(e){switch(e){case"pending":return"live";case"connecting":return"reconnecting";case"idle":case"error":return"offline"}}(x.status),newShipIds:c,error:x.error}}])},74470,31071,e=>{"use strict";var t=e.i(71645);let s=/Mac|iPhone|iPad|iPod/;function r(e){return"mac"===e?"⌘↵":"Ctrl ↵"}function a(){return()=>void 0}function i(){var e;return e=navigator.userAgent,s.test(e)?"mac":"other"}function n(){return null}e.s(["sendShortcutAria",0,function(e){return"mac"===e?"Meta+Enter":"Control+Enter"},"sendShortcutKeys",0,r,"submitOnSendShortcut",0,function(e){var t;let{key:s,metaKey:r,ctrlKey:a}=e;"Enter"===(t={key:s,metaKey:r,ctrlKey:a,isComposing:e.nativeEvent.isComposing}).key&&(t.metaKey||t.ctrlKey)&&!t.isComposing&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},"useShortcutPlatform",0,function(){return(0,t.useSyncExternalStore)(a,i,n)}],74470);var l=e.i(43476),o=e.i(36651);e.s(["SendShortcutHint",0,function({platform:e}){return(0,l.jsx)(o.Kbd,{"aria-hidden":!0,"data-testid":"send-shortcut-hint",className:"border-primary-foreground/25 bg-primary-foreground/10 text-primary-foreground",children:r(e)})}],31071)}]);
|
|
@@ -0,0 +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(66787),u=e.i(92870),c=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,c.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(28459),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.useNeedsAttention)(),c=(0,f.useAttentionCount)(),p=(0,x.useNow)();if(!r.data)return null;let j=(i=(n=(s=v((e={ships:r.data,undeliverable:l.data??[],now:p}).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.undeliverable.map(e=>new Date(e.since)).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)},oldestUndeliverable:a&&(0,g.duration)(a,e.now)});return 0===j.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:j.crewedCount,detail:`of ${String(j.activeCount)} active ships`,href:"/?status=crewed",icon:u.UserCheck,tone:"ok",testId:"overview-crewed"}),(0,t.jsx)(h,{label:"Awaiting crew",value:j.awaitingCount,detail:j.longestWait?`Longest wait: ${j.longestWait.name}, ${j.longestWait.wait}`:"Every active ship is crewed",href:"/?status=awaitingCrew",icon:o.CircleDashed,tone:"waiting",testId:"overview-awaiting"}),(0,t.jsx)(h,{label:"Needs attention",value:c??0,detail:j.oldestUndeliverable?`Undeliverable deliveries, oldest ${j.oldestUndeliverable}`:"Nothing needs you",href:"/needs-attention",icon:d.TriangleAlert,tone:"attention",testId:"overview-attention"})]})}var b=e.i(77071),w=e.i(17540),S=e.i(25242),y=e.i(8041),C=e.i(78608),k=e.i(41880),N=e.i(49092),P=e.i(87600),R=e.i(16752),I=e.i(86165),O=e.i(48695),T=e.i(265);let q=(0,w.lazyDialog)(()=>e.A(27830).then(e=>e.CommissionDialog),e=>e.isOpen),E=(0,w.lazyDialog)(()=>e.A(95953).then(e=>e.StartingPromptDialog),e=>e.isOpen);function A({isOpen:e,onOpenChange:s}){let n=(0,m.useFleetSnapshot)(),i=(0,N.useFleetLimits)(),l=(0,P.useHostedAccountUrl)(),o=(0,m.useCommissionShip)(),d=(0,m.useRequestCrew)(),u="connected"===(0,T.useTrierarchPluginConnection)(),c=(0,T.useMachines)(),p=(0,I.useSquadronsConnection)(),h=(0,O.useSquadrons)(),[f,x]=(0,a.useState)(!1),[g,v]=(0,a.useState)(null),j=(0,y.offersOf)(c.data??[]),w=(0,m.useLabelContext)(),{shipLabelsMax:M}=(0,S.useConsoleConstants)(),L=void 0===w||void 0===c.data?void 0:(0,C.machineLabelsInputOf)(w,{machines:c.data,shipLabelsMax:M}),z=(0,T.useCrewSettingsCheck)(e&&u?null===g?(0,y.settingsOf)((0,y.defaultValues)(j)):g:void 0),$=(n.data??[]).filter(e=>"retired"!==e.status),D=(e,t)=>{o.mutate(e,{onSuccess:({shipId:n})=>{s(!1);let i=u&&void 0!==t;i||x(!0),void 0!==t&&d.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)(b.Plus,{}),"data-testid":"fleet-commission",onClick:()=>{o.reset(),v(null),s(!0)},children:"Commission ship"}),(0,t.jsx)(q,{activeShips:$,isOpen:e,onOpenChange:s,isPending:o.isPending,error:o.error?.message,shipLimit:(0,R.shipLimitReached)(i.data),accountUrl:l,...u?{crewRequest:{offers:j,squadrons:"connected"===p?(h.data??[]).filter(e=>"disbanded"!==e.state).map(e=>e.id):void 0,...void 0===L?{}:{machineLabels:L},check:z.data,onSettingsChange:v}}:{},onSubmit:(e,t)=>{let s={...e,idempotencyKey:crypto.randomUUID()};u&&void 0!==t?z.checkNow().catch(()=>void 0).then(e=>{e?.kind!=="refused"&&D(s,t)}).catch(()=>void 0):D(s,t)}}),(0,t.jsx)(E,{shipName:o.variables?.name??"",state:"shown",prompt:o.data?.prompt??void 0,crewLines:o.data?.crewLines??void 0,isOpen:f&&void 0!==o.data,onOpenChange:e=>{e||(x(!1),o.reset())},onConfirm:()=>void 0})]})}var M=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,M.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],u=(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,c.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:[u,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,M.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 eu={query:"",filters:{status:[],crewRequest:[],kind:[],type:[],squadron:[],isRetiredShown:!1,labelValueIds:[]},sort:null},ec=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 eb(e).length+e.labelValueIds.length}function ej(e,t){return 0===t.length?void 0:`${e}: ${t.join(", ")}`}function eb(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 ew=e.i(66390),eS=e.i(12470),ey=e.i(91727),eC=e.i(75305),ek=e.i(75867),eN=e.i(14732),eP=e.i(67874),eR=e.i(17981),eI=e.i(95960);function eO({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)(eI.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,M.default)(eq),eA={name:"signal-low",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}]]};eA.node;let eM=(0,M.default)(eA),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,M.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:u,handle:c,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",u);let x=f.useState("open"),g=!s&&x,v=f.useState("activeTriggerId"),j=f.useState("mounted"),b=f.useState("payload");f.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:r,disabled:s}),(0,eQ.useImplicitActiveTrigger)(f,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:w,transitionStatus:S}=(0,eQ.useOpenStateTransitions)(g,f),y=f.useState("isInstantPhase"),C=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&&y?("delay"!==C&&(N.current=C),f.set("instantType","delay")):null!==N.current&&(f.set("instantType",N.current),N.current=null)},[S,y,k,C,f]),(0,eB.useIsoLayoutEffect)(()=>{g&&null==v&&f.set("payload",void 0)},[f,v,g]),a.useImperativeHandle(o,()=>({unmount:w,close:()=>f.setOpen(!1,(0,eJ.createChangeEventDetails)(e1.REASONS.imperativeAction))}),[w,f]);let P=g||j||!s&&"none"!==l;return(0,t.jsxs)(eF.Provider,{value:f,children:[c&&(0,t.jsx)(eQ.PopupHandleAttachment,{handle:c,store:f}),P&&(0,t.jsx)(te,{store:f,disabled:s,trackCursorAxis:l}),"function"==typeof m?m({payload:b}):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,u=a.useRef(!1),c=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(!u.current&&(!d.current.openEvent||eX(d.current.openEvent))){var a,r;let l,u,c;i.set("positionReference",(a=s??o,r={x:e,y:t,axis:n,dataRef:d,pointerType:p},l=null,u=null,c=!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==u&&r.y&&s&&(u=e.y-r.y),d-=l||0,p-=u||0,i=0,o=0,!c||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):c&&!n&&(o="x"===r.axis?e.height:o,i="y"===r.axis?e.width:i),c=!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?c.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(){c.current?.(),c.current=null}let t=(0,eK.getWindow)(l);return!d.current.openEvent||eX(d.current.openEvent)?c.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&&(u.current=!1)},[s,l]),a.useEffect(()=>{!s&&r&&(u.current=!0)},[s,r]);let b=a.useMemo(()=>{function e(e){h(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return a.useMemo(()=>s?{reference:b,trigger:b}:{},[s,b])}(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 tu=a.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new tt.Timeout,currentIdRef:{current:null},currentContextRef:{current:null}});function tc(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),u=(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)(tu.Provider,{value:a.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:l,currentIdRef:o,timeoutMs:i,currentContextRef:d,timeout:u}),[i,u]),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:u=!0,closeDelay:c,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"),b=a.useRef(null),w=c??0,{registerTrigger:S,isMountedByThisTrigger:y}=(0,eQ.useTriggerDataForwarding)(x,b,f,{payload:l,closeOnClick:u,closeDelay:w}),C=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:u,hasProvider:c,timeout:p}=a.useContext(tu),[h,m]=a.useState(!1),f=a.useRef(s);return(0,eB.useIsoLayoutEffect)(()=>{f.current=s},[s]),(0,eB.useIsoLayoutEffect)(()=>{function e(){u.current?.setIsInstantPhase(!1),r.current=null,u.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,u,p,n]),(0,eB.useIsoLayoutEffect)(()=>{if(!s)return;let e=u.current,t=r.current;p.clear(),u.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,u,p]),(0,eB.useIsoLayoutEffect)(()=>()=>{r.current===i&&(u.current=null,f.current)&&(r.current=null,l.current=d.current,p.clear())},[u,r,l,i,d,p]),a.useMemo(()=>({activeIdRef:r,hasProvider:c,delayRef:l,isInstantPhase:h}),[r,c,l,h])}(j,{open:v}),I=(0,tm.useHoverInteractionSharedState)(j);f.useSyncedValue("isInstantPhase",P);let O=f.useState("disabled"),T=o??O,q=(0,ts.useValueAsRef)(T),E=f.useState("trackCursorAxis"),A=f.useState("disableHoverablePopup"),M=a.useRef(!1),L=(0,tt.useTimeout)(),z=a.useRef(void 0);function $(){return R&&null!=k.current?0:d??C??600}function D(e){let t=b.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:A||"both"===E?null:(0,to.safePolygon)(),restMs:$,delay:()=>null==c&&R?{close:(0,td.getDelay)(N.current,"close")}:{close:w},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>"ending"===f.select("transitionStatus"),shouldOpen:()=>!M.current}),V=(0,tp.useFocus)(j,{enabled:!T}).reference,F=f.useState("triggerProps",y),H=y||"none"!==E;return(0,ti.useRenderElement)("button",e,{state:{open:v},ref:[t,S,b],props:[B,V,H?F:void 0,{onMouseOver(e){(e=>{let t,s=M.current,n=tg(e),i=(M.current=t=D(n),t&&(I.openChangeTimeout.clear(),I.restTimeout.clear(),I.restTimeoutPending=!1,L.clear()),t),a=b.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=()=>{M.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(){M.current=!1,L.clear(),z.current=void 0},onPointerEnter(e){z.current=e.pointerType},onPointerDown(e){z.current=e.pointerType,f.set("closeOnClick",u),u&&!f.select("open")&&f.cancelPendingOpen(e.nativeEvent)},onClick(e){u&&!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 tb=e.i(74080),tw=e.i(26674);let tS=a.forwardRef(function(e,s){let{children:n,container:i,className:r,render:l,style:o,...d}=e,{node:u,subtree:c}=(0,tw.useFloatingPortalNode)({container:i,ref:s,componentProps:e,elementProps:d});return c||u?(0,t.jsxs)(a.Fragment,{children:[c,u&&tb.createPortal(n,u)]}):null}),ty=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}),tC=a.createContext(void 0);function tk(){let e=a.useContext(tC);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 tI=a.forwardRef(function(e,s){let{render:n,className:i,anchor:r,positionMethod:l="absolute",side:o="top",align:d="center",sideOffset:u=0,alignOffset:c=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,b=eH(),w=function(){let e=a.useContext(tj);if(void 0===e)throw Error((0,eV.default)(70));return e}(),S=b.useState("open"),y=b.useState("mounted"),C=b.useState("trackCursorAxis"),k=b.useState("disableHoverablePopup"),N=b.useState("floatingRootContext"),P=b.useState("instantType"),R=b.useState("transitionStatus"),I=b.useState("adaptiveOrigin"),O=(0,tN.useAnchorPositioning)({anchor:r,positionMethod:l,floatingRootContext:N,mounted:y,side:o,sideOffset:u,align:d,alignOffset:c,collisionBoundary:p,collisionPadding:h,sticky:f,arrowPadding:m,disableAnchorTracking:x,keepMounted:w,collisionAvoidance:g,adaptiveOrigin:I}),T=a.useMemo(()=>({open:S,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:"none"!==C?"tracking-cursor":P}),[S,O.side,O.align,O.anchorHidden,C,P]),q=(0,tR.usePositioner)(e,T,{styles:O.positionerStyles,transitionStatus:R,props:j,refs:[s,b.useStateSetter("positionerElement")],hidden:!y,inert:!S||"both"===C||k});return(0,t.jsx)(tC.Provider,{value:O,children:q})});var tO=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"),u=r.useState("instantType"),c=r.useState("transitionStatus"),p=r.useState("popupProps"),h=r.useState("floatingRootContext"),m=r.useState("disabled"),f=r.useState("closeDelay");(0,tO.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:u,transitionStatus:c},ref:[t,r.context.popupRef,x],props:[eQ.FOCUSABLE_POPUP_PROPS,p,(0,tT.getDisabledMountTransitionStyles)(c),a],stateAttributesMapping:tn.popupTransitionStateMapping})}),tA=a.forwardRef(function(e,t){let{render:s,className:n,style:i,...a}=e,r=eH(),{arrowRef:l,side:o,align:d,arrowUncentered:u,arrowStyles:c}=tk(),p=r.useState("open"),h=r.useState("instantType");return(0,ti.useRenderElement)("div",e,{state:{open:p,side:o,align:d,uncentered:u,instant:h},ref:[t,l],props:[{style:c,"aria-hidden":!0},a],stateAttributesMapping:tn.popupStateMapping})});var tM=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:u,state:c}=(0,tM.usePopupViewport)({store:l,side:o.side,children:a}),p={activationDirection:c.activationDirection,transitioning:c.transitioning,instant:d};return(0,ti.useRenderElement)("div",e,{state:p,ref:t,props:[r,{children:u}],stateAttributesMapping:tM.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,tA,"Handle",0,t$,"Popup",0,tE,"Portal",0,ty,"Positioner",0,tI,"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)(tc,{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,c.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:eM,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,c.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,c.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)(eI.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)(b.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)(eI.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)(b.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)(ew.Badge,{variant:"kind",children:[(0,t.jsx)(ee.UserRound,{"aria-hidden":!0}),"operator"]}):"viewer"===e.kind?(0,t.jsxs)(ew.Badge,{variant:"kind","data-testid":"fleet-viewer",children:[(0,t.jsx)(G.Eye,{"aria-hidden":!0}),"viewer"]}):n?(0,t.jsxs)(ew.Badge,{variant:"kind","data-testid":"fleet-plugin",children:[(0,t.jsx)(Y.Plug,{"aria-hidden":!0}),"plugin"]}):s?.role===null?(0,t.jsxs)(ew.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)(eO,{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,u=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]))}}),eb(d).length>0&&!m?(0,t.jsx)(r.Button,{variant:"ghost",size:"xs","data-testid":"fleet-filters-clear",onClick:()=>{n({...s,filters:eu.filters})},children:"Clear filters"}):null,(0,t.jsxs)("div",{className:(0,c.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)(ey.Label,{htmlFor:p,className:(0,c.classNames)("font-normal text-muted-foreground",m?"text-body-touch":"text-meta"),children:["Show retired (",u,")"]})]})]})}function so({ships:e,view:s,onViewChange:n,shownCount:i,squadronsOf:a,labels:l}){let o=se((0,S.useConsoleConstants)().crewStatuses),{filters:d}=s,u=e=>{n({...s,filters:{...d,...e}})},c=ev(d),p=ef(e);return(0,t.jsxs)(eC.Sheet,{children:[(0,t.jsx)(eC.SheetTrigger,{render:(0,t.jsx)(r.Button,{size:"touch",isIconOnly:!0,"aria-label":c>0?`Filter ships, ${String(c)} active`:"Filter ships","data-testid":"fleet-filters-open",icon:(0,t.jsx)(Z,{}),className:"relative sm:hidden",children:c>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)(eC.SheetContent,{side:"bottom",children:[(0,t.jsxs)(eC.SheetHeader,{className:"flex-row items-center justify-between",children:[(0,t.jsx)(eC.SheetTitle,{children:"Filter ships"}),(0,t.jsx)(r.Button,{variant:"ghost",size:"touch","data-testid":"fleet-filters-reset",onClick:()=>{n({...s,filters:eu.filters})},children:"Reset"})]}),(0,t.jsxs)(eC.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=>{u({status:e.filter(t9)})}}),(0,t.jsx)(tQ,{label:"Crew request",items:o,picked:d.crewRequest,onPickedChange:e=>{u({crewRequest:e.filter(e=>st(e,o))})}}),(0,t.jsx)(tQ,{label:"Kind",items:es,picked:d.kind,onPickedChange:e=>{u({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=>{u({type:e})}}),a&&(0,t.jsx)(tQ,{label:"Squadron",items:ss(ex(a)),picked:d.squadron,onPickedChange:e=>{u({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)(ey.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=>{u({isRetiredShown:e})}})]}),(0,t.jsx)(eC.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=eb(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)(ew.Badge,{variant:"outline",className:"max-w-full truncate",children:e},e)),a.map(n=>(0,t.jsx)(eI.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:eu.filters})},children:"Clear filters"})]})}function su({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 sc({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)(sc,{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)(sc,{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:u,squadronsOf:c,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,retryNote:a?.retryNote,onRetry:a?.onRetry});let b={highlightedShipIds:l,now:o,renderRowActions:d,squadronsOf:c,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,...b}),(0,t.jsx)(sm,{ships:s,...b}),(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:u})]})}let w=(v=null===(m={...s,squadronsOf:c,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=ec}=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)(su,{ships:e,view:s,onViewChange:n,shownCount:w.length,squadronsOf:c,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===w.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({...eu,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:w,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)})},...b}),(0,t.jsx)(sm,{ships:w,...b})]})]})}function sx({view:e,onViewChange:s,newShipIds:n,renderRowActions:i}){let a=(0,m.useFleetSnapshot)(),r=(0,x.useNow)(),l=(0,O.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),sb=e.i(77821),sw=e.i(87964),sS=e.i(62687),sy=e.i(90262),sC=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)(),u=(0,m.useFleetSnapshot)(),c=(0,sC.useLiveFleet)(),p=(0,sw.useConsoleFrame)(),h=(0,R.messageLimitReached)((0,N.useFleetLimits)().data),f=(0,P.useHostedAccountUrl)(),x=(0,sy.useAccess)(),g=(0,sN.usePluginNav)(),[b,w]=(0,a.useState)(!1),[S,y]=(0,a.useOptimistic)(e);(0,sk.useSignInWhenSessionEnds)([u.error,c.error]);let C=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)(()=>{y(e),d.replace(""===t?"/":`/?${t}`,{scroll:!1})})};return(0,t.jsxs)(sb.ListPage,{...p,title:"Fleet overview",description:u.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:u.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)(A,{isOpen:b||o,onOpenChange:t=>{w(t),!t&&o&&C(e)}}):null]}),live:c.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:C,newShipIds:c.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)}]);
|