cogpit 3.4.1 → 3.5.1
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/dist/cli-runtime.js +1497 -291
- package/dist/instance-worker.js +14 -7
- package/dist/web/assets/{CogpitBlock-B7SKhn5k.js → CogpitBlock-ZgOubpsS.js} +1 -1
- package/dist/web/assets/{CommandPaletteHost-Dig9sRnN.js → CommandPaletteHost-Djn2jqYR.js} +1 -1
- package/dist/web/assets/{ConfigBrowser-C_4UyHta.js → ConfigBrowser-CRwh8BXq.js} +1 -1
- package/dist/web/assets/CrewPanel-BxPl5D7h.js +1 -0
- package/dist/web/assets/{HighlightedEditor-YAPOkcjz.js → HighlightedEditor-D9A-dW2Z.js} +1 -1
- package/dist/web/assets/{KeyboardShortcutsDialog-CjA8MBfY.js → KeyboardShortcutsDialog-L7rRhApI.js} +1 -1
- package/dist/web/assets/{MissionHome-CK5zZCld.js → MissionHome-zp7VebSO.js} +2 -2
- package/dist/web/assets/{MobileFileChanges-DyjwWXMW.js → MobileFileChanges-O-SvMq9F.js} +1 -1
- package/dist/web/assets/{PluginsDialog-BHKZ3Esx.js → PluginsDialog-CBOyfoUX.js} +1 -1
- package/dist/web/assets/{PreviewPanel-CXOXFWWK.js → PreviewPanel-_pKuUaps.js} +1 -1
- package/dist/web/assets/{ProjectFilesPanel-CwBgFc0T.js → ProjectFilesPanel-BsbpTgWK.js} +1 -1
- package/dist/web/assets/{ProjectSwitcherModal-DB-xcVjM.js → ProjectSwitcherModal-D4MzdPVH.js} +1 -1
- package/dist/web/assets/{TerminalOutput-BA4pFb8E.js → TerminalOutput-DOX29EmA.js} +1 -1
- package/dist/web/assets/{ThemeSelectorModal-B8nIlHO2.js → ThemeSelectorModal-7CWXZB-z.js} +1 -1
- package/dist/web/assets/{WorkflowsPanel-BZhR5Ld-.js → WorkflowsPanel-aOz1o3kA.js} +1 -1
- package/dist/web/assets/{WorktreePanel-DYxBPlno.js → WorktreePanel-BFve9bpC.js} +1 -1
- package/dist/web/assets/{edition-ui-CXQDiuhB.js → edition-ui-CFxEM3WF.js} +1 -1
- package/dist/web/assets/{index-C0oae6L9.js → index-By5-_P50.js} +1 -1
- package/dist/web/assets/{index-D3WV64DU.js → index-CPTFl4Qh.js} +104 -104
- package/dist/web/assets/index-DjpYbGVZ.js +2 -0
- package/dist/web/assets/{index-B1Aq64LJ.js → index-DmMg-zf3.js} +1 -1
- package/dist/web/assets/{session-parser.worker-B1_qLRIm.js → session-parser.worker-3tFlB6dy.js} +2 -2
- package/dist/web/assets/{switch-B1AuQGfo.js → switch-DS7UyNS2.js} +1 -1
- package/dist/web/assets/{vendor-ui-DkzcTXCS.js → vendor-ui-DQeMoSiV.js} +195 -190
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/CrewPanel-CyCZndfq.js +0 -1
- package/dist/web/assets/index-utwOdTFc.js +0 -2
package/dist/web/index.html
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
.dark body { background: var(--canvas, #09090b); color: var(--foreground, #fafafa); }
|
|
15
15
|
body { background: var(--canvas, #fafafa); color: var(--foreground, #09090b); }
|
|
16
16
|
</style>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-CPTFl4Qh.js"></script>
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-gGw_S5I_.js">
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-ui-
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-ui-DQeMoSiV.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/vendor-markdown-BE1gYnO9.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/assets/vendor-shiki-DOn6sF-i.js">
|
|
22
22
|
<link rel="stylesheet" crossorigin href="/assets/index-hGMtuUNI.css">
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as S,c as re,j as n}from"./vendor-react-gGw_S5I_.js";import{U as ze,bJ as it,bK as be,bL as jt,bM as yt,bN as Nt,B as J,L as rt,M as ct,N as It,O as dt,Q as ut,C as Ze,bO as kt,b6 as Je,z as Qe,bP as Ct,bQ as St,q as ft,aK as Mt,bR as $t,b7 as Rt,bC as Tt,bS as At,aP as Ot,R as Et,D as Lt,h as _t,j as zt,k as Dt,J as se,bT as Pt,bU as Ft,bV as Yt,bW as qt,bX as Ye,$ as qe,bY as Wt,bz as Ht,bZ as Ut,b_ as Bt,b$ as Ae,c0 as Oe,bk as Kt,Z as Gt,c1 as Vt,c2 as Xt,c3 as Zt,bH as Jt}from"./index-D3WV64DU.js";import{S as Qt}from"./switch-B1AuQGfo.js";import{m as es,aq as ts,ak as ss,e as ns,ar as ht,as as pt,P as os,a7 as as,$ as ls,C as et,at as is,au as rs,X as cs}from"./vendor-ui-DkzcTXCS.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";async function Ce(s){if(s.ok)return s;const e=await s.json().catch(()=>null);throw new Error((e==null?void 0:e.error)||"Couldn't update crew chat.")}function Ee(s,e){return[...new Map([...s,...e].map(t=>[t.sequence,t])).values()].sort((t,i)=>t.sequence-i.sequence)}function ds(s){const[e,t]=S.useState(null),[i,a]=S.useState([]),[l,c]=S.useState(null),[o,u]=S.useState(!1),[r,d]=S.useState(!1),[m,w]=S.useState(!1),[g,x]=S.useState(new Set),p=S.useRef(0),h=S.useRef(null),v=S.useRef(!1),N=S.useRef(!1),b=S.useRef(new Set),k=S.useRef(!1),C=S.useRef(null),M=S.useCallback(async j=>{const R=++p.current;try{const I=C.current,E=await(await Ce(await ze(`/api/crew-chat/${encodeURIComponent(s)}${I===null?"":`?after=${I}&limit=100`}`))).json();if(!j()||R!==p.current)return;t(A=>A&&JSON.stringify(A.members)===JSON.stringify(E.members)?{...E,members:A.members}:E),a(A=>Ee(A,E.messages)),C.current=E.nextCursor,k.current||(k.current=!0,w(E.hasMore)),c(null)}catch(I){j()&&R===p.current&&c(I instanceof Error?I.message:"Couldn't load crew chat.")}},[s]);it(M,2e3);const _=S.useCallback(async j=>{var R;if(v.current)return!1;v.current=!0,u(!0),((R=h.current)==null?void 0:R.text)!==j&&(h.current={text:j,id:crypto.randomUUID()});try{const $=await(await Ce(await be(`/api/crew-chat/${encodeURIComponent(s)}`,{text:j,commandId:h.current.id}))).json();return p.current++,a(E=>Ee(E,[$.message])),h.current=null,c($.pending.length?"Message saved. Some members are unavailable; delivery will retry.":null),!0}catch(I){return c(I instanceof Error?I.message:"Couldn't send the message."),!1}finally{v.current=!1,u(!1)}},[s]),O=S.useCallback(async(j,R)=>{if(!b.current.has(j)){b.current.add(j),x(I=>new Set(I).add(j));try{await Ce(await be(`/api/crew-chat/${encodeURIComponent(s)}`,{sessionId:j,listening:R},{method:"PATCH"})),p.current++,t(I=>I&&{...I,members:I.members.map($=>$.sessionId===j?{...$,listening:R}:$)}),c(null)}catch(I){c(I instanceof Error?I.message:"Couldn't change listening.")}finally{b.current.delete(j),x(I=>{const $=new Set(I);return $.delete(j),$})}}},[s]),L=S.useCallback(async()=>{if(!(!i.length||N.current)){N.current=!0,d(!0);try{const R=await(await Ce(await ze(`/api/crew-chat/${encodeURIComponent(s)}?before=${i[0].sequence}`))).json();a(I=>Ee(I,R.messages)),w(R.hasMore)}catch(j){c(j instanceof Error?j.message:"Couldn't load older messages.")}finally{N.current=!1,d(!1)}}},[i,s]);return{page:e,messages:i,error:l,posting:o,busyMembers:g,hasOlder:m,loadingOlder:r,post:_,setListening:O,older:L}}const us=[],fs=new Map;function hs(s){var We,He,Ue,Be,Ke,Ge,Ve;const e=re.c(111),{rootId:t,kinds:i,active:a}=s,l=i===void 0?fs:i,c=a===void 0?!0:a,o=ds(t),[u,r]=S.useState(""),d=S.useRef(null),m=S.useRef(!0);let w;e[0]!==o.messages?(w=(We=o.messages.at(-1))==null?void 0:We.sequence,e[0]=o.messages,e[1]=w):w=e[1];const g=w,x=((He=o.page)==null?void 0:He.members)??us;let p;e[2]!==x?(p=jt(x),e[2]=x,e[3]=p):p=e[3];const h=p;let v;e[4]!==x||e[5]!==t?(v=yt(x,t),e[4]=x,e[5]=t,e[6]=v):v=e[6];const N=v;let b;e[7]!==x?(b=new Map(x.map(ms)),e[7]=x,e[8]=b):b=e[8];const k=b;let C;e[9]!==o.messages||e[10]!==t?(C=Nt(o.messages,t),e[9]=o.messages,e[10]=t,e[11]=C):C=e[11];const M=C;let _;e[12]!==c?(_=()=>{var q,F;c&&m.current&&((F=(q=d.current)==null?void 0:q.scrollIntoView)==null||F.call(q,{block:"end"}))},e[12]=c,e[13]=_):_=e[13];let O;e[14]!==c||e[15]!==g?(O=[c,g],e[14]=c,e[15]=g,e[16]=O):O=e[16],S.useEffect(_,O);let L;e[17]!==o||e[18]!==u?(L=async()=>{const q=u.trim();!q||o.posting||await o.post(q)&&(r(F=>F.trim()===q?"":F),m.current=!0)},e[17]=o,e[18]=u,e[19]=L):L=e[19];const j=L;let R;e[20]!==o.page||e[21]!==x?(R=o.page?`${x.filter(ps).length} listening · Members & mentions`:"Loading chat…",e[20]=o.page,e[21]=x,e[22]=R):R=e[22];let I;e[23]!==R?(I=n.jsx("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:R}),e[23]=R,e[24]=I):I=e[24];let $;if(e[25]!==o||e[26]!==l||e[27]!==x||e[28]!==t||e[29]!==N){let q;e[31]!==o||e[32]!==l||e[33]!==t||e[34]!==N?(q=F=>{var Xe;return n.jsxs(Ze,{orientation:"horizontal",className:"items-center gap-2",children:[n.jsx(kt,{role:F.sessionId===t?"lead":"agent",sessionId:F.sessionId,kinds:l,tints:N,className:"size-5"}),n.jsxs(Je,{className:"min-w-0 flex-1 items-baseline gap-1.5",htmlFor:`listen-${F.sessionId}`,"aria-label":`Listen for ${F.name}`,children:[n.jsx("span",{className:"truncate",children:F.name}),n.jsxs("span",{className:"truncate text-xs font-normal text-muted-foreground",children:["@",F.handle]})]}),n.jsx(J,{variant:"ghost",size:"icon-xs",disabled:!((Xe=o.page)!=null&&Xe.canPost)||!F.canInteract,onClick:()=>r(je=>`${je}${je&&!/\s$/.test(je)?" ":""}@${F.handle} `),"aria-label":`Mention ${F.name}`,title:`Mention @${F.handle}`,className:"text-muted-foreground",children:n.jsx(ts,{"data-icon":"inline-start"})}),n.jsx(Qt,{id:`listen-${F.sessionId}`,size:"sm",checked:F.listening,disabled:!F.canInteract||o.busyMembers.has(F.sessionId),onCheckedChange:je=>void o.setListening(F.sessionId,je)})]},F.sessionId)},e[31]=o,e[32]=l,e[33]=t,e[34]=N,e[35]=q):q=e[35],$=x.map(q),e[25]=o,e[26]=l,e[27]=x,e[28]=t,e[29]=N,e[30]=$}else $=e[30];let E;e[36]!==$?(E=n.jsx(Qe,{className:"max-h-48 gap-2 overflow-y-auto py-2",children:$}),e[36]=$,e[37]=E):E=e[37];let A;e[38]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("p",{className:"pb-1 text-xs text-muted-foreground",children:"Listening sends short notices while an agent works. @mentions send the full message, even when listening is off."}),e[38]=A):A=e[38];let z;e[39]!==I||e[40]!==E?(z=n.jsxs("details",{className:"shrink-0 border-b px-3 py-2",children:[I,E,A]}),e[39]=I,e[40]=E,e[41]=z):z=e[41];let D;e[42]===Symbol.for("react.memo_cache_sentinel")?(D=q=>{const F=q.target;m.current=F.scrollHeight-F.scrollTop-F.clientHeight<80},e[42]=D):D=e[42];let W;e[43]!==o?(W=o.hasOlder&&n.jsx("div",{className:"flex justify-center py-2",children:n.jsx(J,{variant:"ghost",size:"xs",disabled:o.loadingOlder,onClick:()=>void o.older(),children:o.loadingOlder?"Loading…":"Load earlier messages"})}),e[43]=o,e[44]=W):W=e[44];let P;e[45]!==o.messages.length||e[46]!==o.page?(P=o.page&&o.messages.length===0&&n.jsx(rt,{children:n.jsxs(ct,{children:[n.jsx(It,{variant:"icon",children:n.jsx(es,{})}),n.jsx(dt,{children:"Talk to the crew"}),n.jsx(ut,{children:"Share a discovery, ask a question, or tag someone for their input."})]})}),e[45]=o.messages.length,e[46]=o.page,e[47]=P):P=e[47];let Y;if(e[48]!==k||e[49]!==h||e[50]!==l||e[51]!==t||e[52]!==M||e[53]!==N){let q;e[55]!==k||e[56]!==h||e[57]!==l||e[58]!==t||e[59]!==N?(q=F=>n.jsxs(S.Fragment,{children:[F.day!==void 0&&n.jsx(Ct,{day:F.day}),n.jsx(St,{run:F,members:k,handles:h,kinds:l,tints:N,rootId:t})]},F.messages[0].sequence),e[55]=k,e[56]=h,e[57]=l,e[58]=t,e[59]=N,e[60]=q):q=e[60],Y=M.map(q),e[48]=k,e[49]=h,e[50]=l,e[51]=t,e[52]=M,e[53]=N,e[54]=Y}else Y=e[54];let K;e[61]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("div",{ref:d}),e[61]=K):K=e[61];let B;e[62]!==Y?(B=n.jsxs("div",{role:"log","aria-label":"Shared messages","aria-live":"polite","aria-relevant":"additions",className:"flex flex-col gap-4 px-3 py-3",children:[Y,K]}),e[62]=Y,e[63]=B):B=e[63];let X;e[64]!==W||e[65]!==P||e[66]!==B?(X=n.jsxs(ft,{className:"min-h-0 flex-1",onScrollCapture:D,children:[W,P,B]}),e[64]=W,e[65]=P,e[66]=B,e[67]=X):X=e[67];let H;e[68]!==j?(H=q=>{q.preventDefault(),j()},e[68]=j,e[69]=H):H=e[69];const U=!!o.error,G=`crew-chat-${t}`;let f;e[70]!==G?(f=n.jsx(Je,{htmlFor:G,className:"sr-only",children:"Message the crew"}),e[70]=G,e[71]=f):f=e[71];const y=`crew-chat-${t}`,T=!((Ue=o.page)!=null&&Ue.canPost),V=!!o.error;let ee;e[72]===Symbol.for("react.memo_cache_sentinel")?(ee=q=>r(q.target.value),e[72]=ee):ee=e[72];let Z;e[73]!==j?(Z=q=>{q.key==="Enter"&&(q.metaKey||q.ctrlKey)&&!q.nativeEvent.isComposing&&(q.preventDefault(),j())},e[73]=j,e[74]=Z):Z=e[74];let te;e[75]!==u||e[76]!==y||e[77]!==T||e[78]!==V||e[79]!==Z?(te=n.jsx(Mt,{id:y,value:u,rows:3,maxLength:$t,placeholder:"Message the crew… use @ to tag an agent",disabled:T,"aria-invalid":V,onChange:ee,onKeyDown:Z}),e[75]=u,e[76]=y,e[77]=T,e[78]=V,e[79]=Z,e[80]=te):te=e[80];let ae;e[81]!==o.error?(ae=o.error&&n.jsx("p",{role:"alert",className:"text-xs text-destructive",children:o.error}),e[81]=o.error,e[82]=ae):ae=e[82];let ce;e[83]!==U||e[84]!==f||e[85]!==te||e[86]!==ae?(ce=n.jsxs(Ze,{"data-invalid":U,children:[f,te,ae]}),e[83]=U,e[84]=f,e[85]=te,e[86]=ae,e[87]=ce):ce=e[87];const ve=((Be=o.page)==null?void 0:Be.canPost)===!1?"You have read access to this crew.":"⌘ / Ctrl + Enter to send";let le;e[88]!==ve?(le=n.jsx(Rt,{className:"flex-1",children:ve}),e[88]=ve,e[89]=le):le=e[89];let de;e[90]!==((Ke=o.page)==null?void 0:Ke.canPost)||e[91]!==o.posting||e[92]!==u?(de=!((Ge=o.page)!=null&&Ge.canPost)||!u.trim()||o.posting,e[90]=(Ve=o.page)==null?void 0:Ve.canPost,e[91]=o.posting,e[92]=u,e[93]=de):de=e[93];let Ie;e[94]===Symbol.for("react.memo_cache_sentinel")?(Ie=n.jsx(ss,{"data-icon":"inline-start"}),e[94]=Ie):Ie=e[94];const Te=o.posting?"Sending…":"Send";let pe;e[95]!==de||e[96]!==Te?(pe=n.jsxs(J,{type:"submit",size:"sm",disabled:de,children:[Ie,Te]}),e[95]=de,e[96]=Te,e[97]=pe):pe=e[97];let me;e[98]!==le||e[99]!==pe?(me=n.jsxs("div",{className:"flex items-center gap-2",children:[le,pe]}),e[98]=le,e[99]=pe,e[100]=me):me=e[100];let ge;e[101]!==ce||e[102]!==me?(ge=n.jsxs(Qe,{className:"gap-2",children:[ce,me]}),e[101]=ce,e[102]=me,e[103]=ge):ge=e[103];let xe;e[104]!==H||e[105]!==ge?(xe=n.jsx("form",{className:"shrink-0 border-t p-3",onSubmit:H,children:ge}),e[104]=H,e[105]=ge,e[106]=xe):xe=e[106];let ke;return e[107]!==z||e[108]!==X||e[109]!==xe?(ke=n.jsxs("section",{"aria-label":"Crew chat",className:"flex h-full min-h-0 flex-col",children:[z,X,xe]}),e[107]=z,e[108]=X,e[109]=xe,e[110]=ke):ke=e[110],ke}function ps(s){return s.listening}function ms(s){return[s.sessionId,s]}const ue={working:"bg-success ring-2 ring-success/30","needs-you":"bg-warning",done:"bg-muted-foreground/50",failed:"bg-destructive",unreachable:"border border-muted-foreground/60"};function mt(s){const e=new Date(s),t=e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return e.toDateString()===new Date().toDateString()?t:`${e.toLocaleDateString([],{month:"short",day:"numeric"})}, ${t}`}function fe(s){if(s.status==="deferred")return"needs-you";switch(s.outcome){case"needs_input":return"needs-you";case"running":return"working";case"error":return"failed";case"unreachable":case"not_found":return"unreachable";default:return"done"}}function tt(s,e){var t,i;return{sessionId:s.sessionId,dirName:((t=s.address)==null?void 0:t.dirName)??"",fileName:((i=s.address)==null?void 0:i.fileName)??"",projectShortName:"",lastModified:s.lastActivityAt??"",lastActivityAt:s.lastActivityAt,size:0,cwd:s.cwd,customTitle:s.customTitle,aiTitle:s.aiTitle,firstUserMessage:s.firstUserMessage,...s.parentId&&{crew:{rootId:e,parentId:s.parentId,startedAt:s.startedAt??0,...s.name&&{name:s.name}}}}}function gs(s,e,t){var o;const i=((o=[...e.values()].find(u=>u.parentId===null))==null?void 0:o.sessionId)??s.sessionId,a=t[s.sessionId],l=tt(s,i);if(!s.parentId)return Tt(l,a);const c=e.get(s.parentId);return At(l,{customName:a,parent:c&&tt(c,i)})}function xs(s){const e=new Map;for(const l of s.members){if(!l.parentId)continue;const c=e.get(l.parentId);c?c.push(l):e.set(l.parentId,[l])}const t=[],i=new Set,a=(l,c)=>{var u;const o=[...e.get(l)??[]].sort((r,d)=>(r.startedAt??0)-(d.startedAt??0));for(const r of o)i.has(r.sessionId)||(i.add(r.sessionId),t.push({member:r,depth:c,children:((u=e.get(r.sessionId))==null?void 0:u.length)??0}),a(r.sessionId,c+1))};a(s.rootId,0);for(const l of s.members)l.parentId&&!i.has(l.sessionId)&&(i.add(l.sessionId),t.push({member:l,depth:0,children:0}));return t}function ws(s){const e=({member:t,pending:i})=>i.askedAt??(Date.parse(t.lastActivityAt??"")||0);return s.members.flatMap(t=>t.waiting.map(i=>({member:t,pending:i}))).sort((t,i)=>e(t)-e(i))}function bs(s){const e={size:0,working:0,needsYou:0,done:0,failed:0,unreachable:0,unreadResults:0};for(const t of s.members){if(!t.parentId)continue;e.size++;const i=fe(t);i==="working"?e.working++:i==="needs-you"?e.needsYou++:i==="failed"?e.failed++:i==="unreachable"?e.unreachable++:e.done++,Re(t)&&e.unreadResults++}return e}function Re(s){return!!(s.result&&s.result.state!=="running"&&!s.result.acknowledged)}function Ne(s){const[e]=s.waiting;switch(fe(s)){case"needs-you":return(e==null?void 0:e.kind)==="permission"?`Waiting on a permission · ${e.toolName}`:(e==null?void 0:e.kind)==="question"?"Asked a question":!e&&s.status==="deferred"?"Awaiting permission review":"Plan to review";case"working":return s.status==="tool_use"&&s.toolName?s.toolName:s.status==="thinking"?"Thinking":s.status==="compacting"?"Compacting":s.status==="awaiting_agents"?"Waiting on its agents":"Working";case"failed":return s.error?`Failed · ${s.error}`:"Failed";case"unreachable":return s.device?`${s.device.name} is not answering`:"Not found";default:return Re(s)?"Finished · result unread":"Finished"}}const ne=196,Q=86,ie=40,we=12,vs=28,Me=6,st=8,he=10,js=6,$e=28,De=36;function gt(s){const e=fe(s);return e==="working"||e==="needs-you"}function ys(s){const e={all:s.members.length,active:0,working:0,needsYou:0};for(const t of s.members){const i=fe(t);i==="working"?e.working++:i==="needs-you"&&e.needsYou++}return e.active=e.working+e.needsYou,e}const nt=(s,e)=>(s.startedAt??0)-(e.startedAt??0)||s.sessionId.localeCompare(e.sessionId);function xt(s){const e=new Map(s.members.map(a=>[a.sessionId,a])),t=new Map,i=[];for(const a of s.members){const l=a.parentId&&a.sessionId!==s.rootId?e.get(a.parentId):void 0;if(!l){i.push(a);continue}const c=t.get(l.sessionId);c?c.push(a):t.set(l.sessionId,[a])}for(const a of t.values())a.sort(nt);return i.sort((a,l)=>+(l.sessionId===s.rootId)-+(a.sessionId===s.rootId)||nt(a,l)),{roots:i,childrenOf:t}}function Ns(s,e){if(e==="all")return new Set(s.members.map(a=>a.sessionId));const t=new Map(s.members.map(a=>[a.sessionId,a])),i=new Set;for(const a of s.members){if(!gt(a))continue;let l=a;for(;l&&!i.has(l.sessionId);)i.add(l.sessionId),l=l.sessionId===s.rootId||!l.parentId?void 0:t.get(l.parentId)}return i}function Is(s){const{roots:e,childrenOf:t}=xt(s),i=new Set;let a=0;const l=e.map(c=>({member:c,depth:0}));for(;l.length>0;){const{member:c,depth:o}=l.pop();if(!i.has(c.sessionId)){i.add(c.sessionId),a=Math.max(a,o);for(const u of t.get(c.sessionId)??[])l.push({member:u,depth:o+1})}}return a}function ks(s){return(s+1)*ne+s*ie}function Cs(s,e,t,{group:i=!1,stacked:a}={}){const{roots:l,childrenOf:c}=xt(s),o=Ns(s,e),u=C=>(c.get(C)??[]).filter(M=>o.has(M.sessionId)),r=(a==null?void 0:a.cardWidth)??ne,d=[],m=[],w=[],g=new Set;let x=0,p=0;const h=C=>{const M={count:0,working:0,needsYou:0},_=new Set(g),O=[...u(C)];for(;O.length>0;){const L=O.pop();if(_.has(L.sessionId))continue;_.add(L.sessionId),M.count++;const j=fe(L);j==="working"?M.working++:j==="needs-you"&&M.needsYou++,O.push(...u(L.sessionId))}return M},v=C=>u(C).filter(M=>!g.has(M.sessionId)),N=C=>v(C.sessionId).length===0||t.has(C.sessionId),b=(C,M,_)=>{g.add(C.sessionId);const O=v(C.sessionId),L=O.length>0&&t.has(C.sessionId),j=L?[]:O,R=i&&!a&&j.length>=st?j.filter(N):[],I=R.length>=st?R:[],$=new Set(I),E=j.filter(D=>!$.has(D)),A={member:C,depth:M,x:(_==null?void 0:_.x)??M*(a?$e:ne+ie),y:(_==null?void 0:_.y)??x+(E.length===0&&I.length>0?he:0),childCount:O.length,collapsed:L,hidden:L?h(C.sessionId):{count:0,working:0,needsYou:0},context:e==="active"&&!gt(C),grouped:!!_};if(d.push(A),p=Math.max(p,A.x+r+(a&&O.length>0?De:0)),a){x+=Q+we;const D=j.map(W=>b(W,M+1));return D.length>0&&m.push({parentId:C.sessionId,path:Ms(A.x,A.y,D)}),A.y}if(L){const D=A.y+Q/2;m.push({parentId:C.sessionId,path:`M${A.x+ne} ${D}H${A.x+ne+ie/2}`})}if(_)return A.y;if(j.length===0)return x+=Q+we,A.y;const z=E.map(D=>b(D,M+1));return I.length>0&&z.push(k(C.sessionId,I,M+1)+he),m.push({parentId:C.sessionId,path:Ss(A.x+ne,A.y,z)}),A.y},k=(C,M,_)=>{const O=Math.min(js,Math.max(2,Math.ceil(Math.sqrt(M.length/1.5)))),L=Math.ceil(M.length/O),j={parentId:C,x:_*(ne+ie),y:x,width:O*ne+(O-1)*ie+2*he,height:L*Q+(L-1)*we+2*he};return w.push(j),M.forEach((R,I)=>b(R,_,{x:j.x+he+I%O*(ne+ie),y:j.y+he+Math.floor(I/O)*(Q+we)})),p=Math.max(p,j.x+j.width),x+=j.height+we,j.y};for(const C of l)!o.has(C.sessionId)||g.has(C.sessionId)||(d.length>0&&(x+=vs),b(C,0));return{orientation:a?"stacked":"across",cardWidth:r,nodes:d,edges:m,groups:w,width:p,height:Math.max(0,x-we)}}function Ss(s,e,t){const i=e+Q/2,a=[`M${s} ${i}H${s+ie}`];for(const l of t)l!==e&&a.push(wt(s,i,l+Q/2));return a.join("")}function wt(s,e,t){const i=s+ie/2;return`M${i} ${e}V${t-Me}Q${i} ${t} ${i+Me} ${t}H${s+ie}`}function Ms(s,e,t){return t.map(i=>bt(s,e,i)).join("")}function bt(s,e,t){const i=s+$e/2,a=t+Q/2;return`M${i} ${e+Q}V${a-Me}Q${i} ${a} ${i+Me} ${a}H${s+$e}`}function $s(s,e){const t=new Map(s.nodes.map(c=>[c.member.sessionId,c])),i=new Map(s.groups.map(c=>[c.parentId,c]));let a=e?t.get(e):void 0;const l=[];for(;a!=null&&a.member.parentId;){const c=a.member.parentId,o=t.get(c);if(!o||o.depth!==a.depth-1)break;if(s.orientation==="stacked"){l.unshift(bt(o.x,o.y,a.y)),a=o;continue}const u=o.x+ne,r=o.y+Q/2,d=a.grouped?i.get(c):void 0,m=(d?d.y+he:a.y)+Q/2;l.unshift(m===r?`M${u} ${r}H${u+ie}`:`M${u} ${r}H${u+ie/2}${wt(u,r,m)}`),a=o}return l.length>0?l.join(""):null}const oe=14,Pe=.25,ot=1.5,Rs=.7,Se=1.2,Ts=56,As=900,Os=.85,Es=320,Le={all:new Set,active:new Set};function Ls(s){const[e,t]=Ot(Et("crew-map-filter"),"all"),i=e==="active"?"active":"all",[a,l]=S.useState({rootId:s,folds:Le}),c=S.useRef(new Map),o=a.rootId===s?a.folds:Le,u=S.useCallback(d=>l(m=>{const w=m.rootId===s?m.folds:Le,g=new Set(w[i]);return g.delete(d)||g.add(d),{rootId:s,folds:{...w,[i]:g}}}),[i,s]),r=S.useMemo(()=>({get current(){return c.current.get(s)??null},set current(d){c.current.set(s,d)}}),[s]);return{filter:i,setFilter:t,collapsed:o[i],toggle:u,viewport:r}}function _s(s){const e=re.c(86),{crew:t,hereId:i,controls:a,kinds:l,nameOf:c,onOpen:o}=s,[u,r]=S.useState(!1),{filter:d,collapsed:m,toggle:w}=a;let g,x,p,h,v,N,b,k,C,M,_,O,L,j,R,I;if(e[0]!==m||e[1]!==a||e[2]!==t||e[3]!==u||e[4]!==d||e[5]!==i||e[6]!==l||e[7]!==c||e[8]!==o||e[9]!==w){let B;e[26]!==t.rootId?(B=y=>y.sessionId===t.rootId,e[26]=t.rootId,e[27]=B):B=e[27];const X=t.members.find(B);let H;e[28]!==m||e[29]!==a||e[30]!==t||e[31]!==d||e[32]!==i||e[33]!==l||e[34]!==c||e[35]!==w?(H=(y,T)=>n.jsx(Fs,{crew:t,collapsed:m,groups:!y,filter:d,hereId:i,kinds:l,nameOf:c,memory:y,onOpen:T,onToggle:w,onShowAll:()=>a.setFilter("all")}),e[28]=m,e[29]=a,e[30]=t,e[31]=d,e[32]=i,e[33]=l,e[34]=c,e[35]=w,e[36]=H):H=e[36],p=H,N="flex h-full min-h-0 flex-col";let U;e[37]!==a||e[38]!==t?(U=n.jsx(at,{crew:t,controls:a}),e[37]=a,e[38]=t,e[39]=U):U=e[39];let G;e[40]===Symbol.for("react.memo_cache_sentinel")?(G=n.jsx("span",{className:"flex-1"}),e[40]=G):G=e[40];let f;e[41]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(J,{variant:"ghost",size:"icon-xs","aria-label":"Expand the map",title:"Expand the map",onClick:()=>r(!0),children:n.jsx(ns,{"data-icon":"inline-start"})}),e[41]=f):f=e[41],e[42]!==U?(b=n.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-3 pb-2",children:[U,G,f]}),e[42]=U,e[43]=b):b=e[43],e[44]!==p||e[45]!==a.viewport||e[46]!==o?(k=p(a.viewport,o),e[44]=p,e[45]=a.viewport,e[46]=o,e[47]=k):k=e[47],x=Lt,I=u,v=r,g=_t,O=!0,L="flex h-[calc(100dvh-1rem)] w-[calc(100vw-1rem)] max-w-none flex-col gap-0 overflow-hidden p-0 sm:h-[calc(100dvh-4rem)] sm:w-[calc(100vw-4rem)] sm:max-w-none",e[48]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(zt,{className:"sr-only",children:"Crew map"}),R=n.jsx(Dt,{className:"sr-only",children:"Every session in this crew, from the one that started it."}),e[48]=j,e[49]=R):(j=e[48],R=e[49]),M="flex h-12 shrink-0 items-center gap-3 pl-4 pr-14",e[50]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ht,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"}),e[50]=_):_=e[50],h="min-w-0 truncate text-sm font-medium",C=X?c(X):"Crew",e[0]=m,e[1]=a,e[2]=t,e[3]=u,e[4]=d,e[5]=i,e[6]=l,e[7]=c,e[8]=o,e[9]=w,e[10]=g,e[11]=x,e[12]=p,e[13]=h,e[14]=v,e[15]=N,e[16]=b,e[17]=k,e[18]=C,e[19]=M,e[20]=_,e[21]=O,e[22]=L,e[23]=j,e[24]=R,e[25]=I}else g=e[10],x=e[11],p=e[12],h=e[13],v=e[14],N=e[15],b=e[16],k=e[17],C=e[18],M=e[19],_=e[20],O=e[21],L=e[22],j=e[23],R=e[24],I=e[25];let $;e[51]!==h||e[52]!==C?($=n.jsx("span",{className:h,children:C}),e[51]=h,e[52]=C,e[53]=$):$=e[53];let E;e[54]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx("span",{className:"flex-1"}),e[54]=E):E=e[54];let A;e[55]!==a||e[56]!==t?(A=n.jsx(at,{crew:t,controls:a}),e[55]=a,e[56]=t,e[57]=A):A=e[57];let z;e[58]!==$||e[59]!==A||e[60]!==M||e[61]!==_?(z=n.jsxs("header",{className:M,children:[_,$,E,A]}),e[58]=$,e[59]=A,e[60]=M,e[61]=_,e[62]=z):z=e[62];let D;e[63]!==o?(D=B=>{r(!1),o(B)},e[63]=o,e[64]=D):D=e[64];let W;e[65]!==p||e[66]!==D?(W=p(null,D),e[65]=p,e[66]=D,e[67]=W):W=e[67];let P;e[68]!==g||e[69]!==z||e[70]!==W||e[71]!==O||e[72]!==L||e[73]!==j||e[74]!==R?(P=n.jsxs(g,{showCloseButton:O,className:L,children:[j,R,z,W]}),e[68]=g,e[69]=z,e[70]=W,e[71]=O,e[72]=L,e[73]=j,e[74]=R,e[75]=P):P=e[75];let Y;e[76]!==x||e[77]!==v||e[78]!==P||e[79]!==I?(Y=n.jsx(x,{open:I,onOpenChange:v,children:P}),e[76]=x,e[77]=v,e[78]=P,e[79]=I,e[80]=Y):Y=e[80];let K;return e[81]!==N||e[82]!==b||e[83]!==k||e[84]!==Y?(K=n.jsxs("div",{className:N,children:[b,k,Y]}),e[81]=N,e[82]=b,e[83]=k,e[84]=Y,e[85]=K):K=e[85],K}function at(s){const e=re.c(3),{crew:t,controls:i}=s;let a;if(e[0]!==i||e[1]!==t){const l=ys(t),c=[{id:"all",label:"All",count:l.all,hint:"Every session in the crew"},{id:"active",label:"Active",count:l.active,hint:"Sessions working or waiting on you, and the sessions that started them"}];a=n.jsx("div",{role:"radiogroup","aria-label":"Show on the map",className:"flex shrink-0 gap-0.5 rounded-full border bg-background p-0.5",children:c.map(o=>{const{id:u,label:r,count:d,hint:m}=o;return n.jsxs("button",{type:"button",role:"radio","aria-checked":i.filter===u,"aria-label":`${r}, ${vt(d)}`,title:m,onClick:()=>i.setFilter(u),className:se("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",i.filter===u&&"bg-accent text-foreground"),children:[r,n.jsx("span",{className:"tabular-nums text-muted-foreground",children:d})]},u)})}),e[0]=i,e[1]=t,e[2]=a}else a=e[2];return a}function vt(s){return`${s} ${s===1?"session":"sessions"}`}function _e(s,e,t){return s.orientation==="stacked"?{scale:e,left:oe,top:oe}:{scale:e,left:Math.max(oe,(t.width-s.width*e)/2),top:Math.max(oe,Math.min((t.height-s.height*e)/2,t.height*.12))}}function zs(s,e,t){return{width:Math.max(t.width,e.left+s.width*e.scale+oe),height:Math.max(t.height,e.top+s.height*e.scale+Ts)}}function lt(s,e,{widthOnly:t=!1}={}){if(s.width===0||e.width===0)return 1;const i=(e.width-2*oe)/s.width,a=t?i:Math.min(i,(e.height-2*oe)/s.height);return Fe(a,Pe,1)}const Fe=(s,e,t)=>Math.min(t,Math.max(e,s));function Ds(s,e,t,i,a){var w;const l=new Map(e.layout.nodes.map(g=>[g.member.sessionId,g])),c=new Map(t.nodes.map(g=>[g.member.sessionId,g]));if(e.frame===i&&l.size===c.size&&t.nodes.every(g=>{const x=l.get(g.member.sessionId);return x!==void 0&&x.x===g.x&&x.y===g.y}))return null;const u=g=>({x:e.frame.left+g.x*e.frame.scale-s.left,y:e.frame.top+g.y*e.frame.scale-s.top}),r=a&&l.has(a)&&c.has(a)?a:(w=e.layout.nodes.filter(g=>c.has(g.member.sessionId)).map(g=>({node:g,screen:u(g)})).filter(({screen:g})=>g.y+Q*e.frame.scale>0&&g.x+e.layout.cardWidth*e.frame.scale>0).sort((g,x)=>g.screen.y-x.screen.y||g.screen.x-x.screen.x)[0])==null?void 0:w.node.member.sessionId;if(!r)return null;const d=u(l.get(r)),m=c.get(r);return{left:i.left+m.x*i.scale-d.x,top:i.top+m.y*i.scale-d.y}}function Ps(s,e,t,i){const a=new Map(s.nodes.map(x=>[x.member.sessionId,x])),l=e?a.get(e):void 0;if(!l)return{left:0,top:0};const{scale:c}=t,o=t.left+l.x*c,u=t.top+l.y*c,r=o+s.cardWidth*c,d=u+Q*c;if(r<=i.clientWidth&&d<=i.clientHeight)return{left:0,top:0};const m=l.member.parentId&&a.get(l.member.parentId)||l;let w=t.left+Math.min(m.x,l.x)*c-oe,g=t.top+Math.min(m.y,l.y)*c-oe;return r-w>i.clientWidth&&(w=o-oe),d-g>i.clientHeight&&(g=u-i.clientHeight/3),{left:Math.max(0,w),top:Math.max(0,g)}}function Fs({crew:s,collapsed:e,groups:t,filter:i,hereId:a,kinds:l,nameOf:c,memory:o,onOpen:u,onToggle:r,onShowAll:d}){const m=S.useRef(null),[w,g]=S.useState({width:0,height:0}),x=t&&w.width>=As,p=S.useMemo(()=>Is(s),[s]),h=w.width-2*oe,v=!t&&w.width>0&&ks(p)*Os>h,N=v?Fe(h-p*$e-De,ne,Es):ne,b=S.useMemo(()=>Cs(s,i,e,{group:x,...v&&{stacked:{cardWidth:N}}}),[s,i,e,x,v,N]),[k,C]=S.useState(()=>{var f;return((f=o==null?void 0:o.current)==null?void 0:f.frame)??{scale:1,left:oe,top:oe}}),[M,_]=S.useState(!1),O=S.useRef(null),L=S.useRef(null),j=S.useRef({left:0,top:0}),R=S.useRef(null),I=S.useRef(null),$=zs(b,k,w),{scale:E}=k;S.useLayoutEffect(()=>{const f=m.current;if(!f)return;const y=()=>g(V=>V.width===f.clientWidth&&V.height===f.clientHeight?V:{width:f.clientWidth,height:f.clientHeight});y();const T=new ResizeObserver(y);return T.observe(f),()=>T.disconnect()},[]);const A=S.useCallback(f=>{const y=m.current;o&&y&&(o.current={frame:f,left:y.scrollLeft,top:y.scrollTop})},[o]),z=S.useCallback((f,y)=>{O.current={frame:f,scroll:y},C(f)},[]),D=S.useCallback(f=>{const y=_e(f,Math.max(lt(f,w,{widthOnly:!0}),Rs),w);z(y,()=>{const T=m.current;return T?Ps(f,a,y,T):{left:0,top:0}})},[z,a,w]);S.useLayoutEffect(()=>{const f=m.current;if(w.width===0||!f)return;const y=R.current;if(y){if(y.filter!==i||y.layout.orientation!==b.orientation)D(b);else if(y.layout!==b){const T=Ds(j.current,y,b,k,L.current);T&&(f.scrollLeft=T.left,f.scrollTop=T.top,j.current={left:f.scrollLeft,top:f.scrollTop})}}else{const T=o==null?void 0:o.current;T?z(T.frame,()=>({left:T.left,top:T.top})):D(b)}L.current=null,R.current={layout:b,filter:i,frame:k}}),S.useLayoutEffect(()=>{const f=O.current,y=m.current;if(!f||!y||f.frame!==k)return;O.current=null;const{left:T,top:V}=f.scroll();y.scrollLeft=T,y.scrollTop=V,j.current={left:y.scrollLeft,top:y.scrollTop},A(k)});const W=S.useRef(a);S.useEffect(()=>{var f,y;W.current!==a&&(W.current=a,a&&((y=(f=m.current)==null?void 0:f.querySelector(`[data-crew-map-card="${CSS.escape(a)}"]`))==null||y.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})))},[a]);const P=S.useCallback((f,y)=>{var de;const T=m.current,V=((de=O.current)==null?void 0:de.frame.scale)??E,ee=Fe(V*f,Pe,ot);if(!T||ee===V)return;const Z=T.getBoundingClientRect(),te=y?y.clientX-Z.left:T.clientWidth/2,ae=y?y.clientY-Z.top:T.clientHeight/2,ce=(T.scrollLeft+te-k.left)/E,ve=(T.scrollTop+ae-k.top)/E,le=_e(b,ee,w);z(le,()=>({left:le.left+ce*le.scale-te,top:le.top+ve*le.scale-ae}))},[z,k.left,k.top,b,E,w]),Y=S.useRef(P);S.useLayoutEffect(()=>{Y.current=P}),S.useEffect(()=>{const f=m.current;if(!f)return;const y=T=>{!T.ctrlKey&&!T.metaKey||(T.preventDefault(),Y.current(Math.exp(-T.deltaY*.01),T))};return f.addEventListener("wheel",y,{passive:!1}),()=>f.removeEventListener("wheel",y)},[]);const K=f=>{const y=m.current;!y||f.pointerType!=="mouse"||f.button!==0||f.target.closest("button")||(I.current={pointerId:f.pointerId,x:f.clientX,y:f.clientY,left:y.scrollLeft,top:y.scrollTop},y.setPointerCapture(f.pointerId),_(!0))},B=f=>{const y=I.current,T=m.current;!y||!T||y.pointerId!==f.pointerId||(T.scrollLeft=y.left-(f.clientX-y.x),T.scrollTop=y.top-(f.clientY-y.y))},X=f=>{var y,T;((y=I.current)==null?void 0:y.pointerId)===f.pointerId&&(I.current=null,(T=m.current)==null||T.releasePointerCapture(f.pointerId),_(!1))},H=S.useMemo(()=>$s(b,a),[b,a]),U=b.nodes.length===0,G=b.orientation==="stacked"?b.cardWidth+De/2:ne+ie/2;return n.jsxs("div",{className:"relative min-h-0 flex-1 border-t",children:[n.jsx("div",{ref:m,role:"region","aria-label":"Crew map","data-crew-map-layout":b.orientation,onScroll:f=>{j.current={left:f.currentTarget.scrollLeft,top:f.currentTarget.scrollTop},O.current||A(k)},onPointerDown:K,onPointerMove:B,onPointerUp:X,onPointerCancel:X,onKeyDown:f=>{f.target===f.currentTarget&&(f.key==="+"||f.key==="="?P(Se):f.key==="-"&&P(1/Se))},tabIndex:-1,className:se("absolute inset-0 overflow-auto overscroll-contain outline-none [touch-action:pan-x_pan-y]","bg-muted/30 bg-local bg-[radial-gradient(circle,var(--border)_1px,transparent_1px)] bg-size-[18px_18px]",M?"cursor-grabbing select-none":"cursor-grab"),children:U?n.jsxs(rt,{className:"h-full",children:[n.jsxs(ct,{children:[n.jsx(dt,{children:"Nothing is active"}),n.jsx(ut,{className:"text-xs",children:"No session in this crew is working or waiting on you."})]}),n.jsx(J,{variant:"outline",size:"xs",onClick:d,children:"Show all sessions"})]}):n.jsx("div",{className:"relative",style:{width:$.width,height:$.height},children:n.jsxs("div",{className:"absolute origin-top-left",style:{left:k.left,top:k.top,width:b.width,height:b.height,transform:`scale(${E})`},children:[b.groups.map(f=>n.jsx("div",{"aria-hidden":"true",className:"absolute rounded-xl border border-dashed border-muted-foreground/25 bg-muted/25",style:{left:f.x,top:f.y,width:f.width,height:f.height}},f.parentId)),n.jsxs("svg",{"aria-hidden":"true",width:b.width,height:b.height,className:"pointer-events-none absolute inset-0 overflow-visible",fill:"none",children:[b.edges.map(f=>n.jsx("path",{d:f.path,className:"stroke-muted-foreground/35",strokeWidth:1.25},f.parentId)),H&&n.jsx("path",{d:H,className:"stroke-foreground/55",strokeWidth:1.5})]}),n.jsx("ul",{"aria-label":"Sessions",className:"absolute inset-0",children:b.nodes.map(f=>n.jsx(Hs,{node:f,width:b.cardWidth,toggleLeft:G,here:f.member.sessionId===a,kind:l.get(f.member.sessionId),name:c(f.member),onOpen:u,onToggle:y=>{L.current=y,r(y)}},f.member.sessionId))})]})})}),!U&&n.jsxs("div",{className:"absolute bottom-2.5 right-2.5 flex items-center gap-0.5 rounded-lg border bg-popover p-0.5 shadow-sm",children:[n.jsx(J,{variant:"ghost",size:"icon-xs","aria-label":"Zoom out",title:"Zoom out",disabled:E<=Pe,onClick:()=>P(1/Se),children:n.jsx(pt,{"data-icon":"inline-start"})}),n.jsxs(J,{variant:"ghost",size:"xs","aria-label":"Actual size",title:"Actual size",className:"min-w-11 px-1 tabular-nums text-muted-foreground",onClick:()=>P(1/E),children:[Math.round(E*100),"%"]}),n.jsx(J,{variant:"ghost",size:"icon-xs","aria-label":"Zoom in",title:"Zoom in",disabled:E>=ot,onClick:()=>P(Se),children:n.jsx(os,{"data-icon":"inline-start"})}),n.jsx("span",{className:"mx-0.5 h-4 w-px bg-border","aria-hidden":"true"}),n.jsx(J,{variant:"ghost",size:"xs",title:"Fit the whole crew on screen",className:"px-1.5 text-muted-foreground",onClick:()=>z(_e(b,lt(b,w),w),()=>({left:0,top:0})),children:"Fit"})]})]})}const Ys={"needs-you":"border-warning/60 bg-[color-mix(in_oklch,var(--warning)_7%,var(--card))]",failed:"border-destructive/45",unreachable:"border-dashed"},qs={"needs-you":"text-warning",failed:"text-destructive"};function Ws(s){var t,i;const e=(t=s.pullRequests)==null?void 0:t.at(-1);return[s.model&&Ye(s.model),(i=s.device)==null?void 0:i.name,e&&`#${e.number}`,s.lastActivityAt&&qe(s.lastActivityAt)].filter(Boolean).join(" · ")}function Hs(s){const e=re.c(75),{node:t,width:i,toggleLeft:a,here:l,kind:c,name:o,onOpen:u,onToggle:r}=s,{member:d}=t;let m;e[0]!==d?(m=fe(d),e[0]=d,e[1]=m):m=e[1];const w=m;let g;e[2]!==d?(g=Ne(d),e[2]=d,e[3]=g):g=e[3];const x=g;let p;e[4]!==c?(p=c?Pt(c):as,e[4]=c,e[5]=p):p=e[5];const h=p;let v;e[6]!==d?(v=Ws(d),e[6]=d,e[7]=v):v=e[7];const N=v,b=t.context&&"shown because a session it started is active";let k;e[8]!==x||e[9]!==o||e[10]!==b?(k=[o,x,b].filter(Boolean),e[8]=x,e[9]=o,e[10]=b,e[11]=k):k=e[11];const C=k.join(", ");let M;e[12]!==t.x||e[13]!==t.y||e[14]!==i?(M={left:t.x,top:t.y,width:i,height:Q},e[12]=t.x,e[13]=t.y,e[14]=i,e[15]=M):M=e[15];const _=d.sessionId,O=l?"true":void 0;let L;e[16]!==d||e[17]!==u?(L=()=>u(d),e[16]=d,e[17]=u,e[18]=L):L=e[18];const j=Ys[w],R=l&&"outline-solid outline-[1.5px] outline-offset-2 outline-foreground/70",I=t.context&&"opacity-60 hover:opacity-100 focus-visible:opacity-100";let $;e[19]!==j||e[20]!==R||e[21]!==I?($=se("flex size-full cursor-pointer flex-col justify-center gap-1 rounded-lg border bg-card px-2.5 py-2 text-left shadow-xs outline-none","transition-[border-color,opacity,box-shadow] hover:border-foreground/25 hover:shadow-sm focus-visible:ring-2 focus-visible:ring-ring",j,R,I),e[19]=j,e[20]=R,e[21]=I,e[22]=$):$=e[22];let E;e[23]!==C||e[24]!==d.sessionId||e[25]!==w||e[26]!==L||e[27]!==$||e[28]!==O?(E=n.jsx("button",{type:"button","data-crew-map-card":_,"data-crew-map-state":w,"aria-current":O,"aria-label":C,onClick:L,className:$}),e[23]=C,e[24]=d.sessionId,e[25]=w,e[26]=L,e[27]=$,e[28]=O,e[29]=E):E=e[29];let A;e[30]!==h?(A=n.jsx(h,{"aria-hidden":"true",className:"mt-[3px] size-3.5 shrink-0 text-muted-foreground"}),e[30]=h,e[31]=A):A=e[31];let z;e[32]!==o?(z=n.jsx("span",{className:"line-clamp-2 min-w-0 flex-1 text-[13px]/[18px] font-medium",children:o}),e[32]=o,e[33]=z):z=e[33];let D;e[34]!==A||e[35]!==z?(D=n.jsxs("span",{className:"flex min-w-0 items-start gap-1.5",children:[A,z]}),e[34]=A,e[35]=z,e[36]=D):D=e[36];const W=ue[w];let P;e[37]!==W?(P=se("size-1.5 shrink-0 rounded-full",W),e[37]=W,e[38]=P):P=e[38];let Y;e[39]!==P?(Y=n.jsx("span",{className:P,"aria-hidden":"true"}),e[39]=P,e[40]=Y):Y=e[40];let K;e[41]!==d||e[42]!==w?(K=Re(d)?"text-warning":qs[w],e[41]=d,e[42]=w,e[43]=K):K=e[43];let B;e[44]!==K?(B=se("min-w-0 truncate text-muted-foreground",K),e[44]=K,e[45]=B):B=e[45];let X;e[46]!==x||e[47]!==B?(X=n.jsx("span",{className:B,children:x}),e[46]=x,e[47]=B,e[48]=X):X=e[48];let H;e[49]!==Y||e[50]!==X?(H=n.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-xs",children:[Y,X]}),e[49]=Y,e[50]=X,e[51]=H):H=e[51];let U;e[52]!==l||e[53]!==N?(U=(N||l)&&n.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[11.5px] tabular-nums text-muted-foreground/75",children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:N}),l&&n.jsx("span",{className:"shrink-0 font-medium text-foreground/70",children:"You are here"})]}),e[52]=l,e[53]=N,e[54]=U):U=e[54];let G;e[55]!==E||e[56]!==D||e[57]!==H||e[58]!==U?(G=n.jsxs(Ft,{delay:700,render:E,children:[D,H,U]}),e[55]=E,e[56]=D,e[57]=H,e[58]=U,e[59]=G):G=e[59];let f;e[60]!==d||e[61]!==o?(f=n.jsx(Yt,{side:"left",align:"start",className:"max-w-72",children:n.jsx(Bs,{member:d,name:o})}),e[60]=d,e[61]=o,e[62]=f):f=e[62];let y;e[63]!==G||e[64]!==f?(y=n.jsxs(qt,{children:[G,f]}),e[63]=G,e[64]=f,e[65]=y):y=e[65];let T;e[66]!==o||e[67]!==t||e[68]!==r||e[69]!==a?(T=t.childCount>0&&n.jsx(Us,{node:t,name:o,left:a,onToggle:r}),e[66]=o,e[67]=t,e[68]=r,e[69]=a,e[70]=T):T=e[70];let V;return e[71]!==y||e[72]!==T||e[73]!==M?(V=n.jsxs("li",{className:"group/node absolute",style:M,children:[y,T]}),e[71]=y,e[72]=T,e[73]=M,e[74]=V):V=e[74],V}function Us(s){const e=re.c(25),{node:t,name:i,left:a,onToggle:l}=s,{collapsed:c,hidden:o}=t;let u=null;o.needsYou>0?u="needs-you":o.working>0&&(u="working");let r;e[0]!==c||e[1]!==o.count||e[2]!==o.needsYou||e[3]!==o.working||e[4]!==i?(r=c?[`Show the ${vt(o.count)} under ${i}`,o.needsYou>0&&`${o.needsYou} waiting on you`,o.working>0&&`${o.working} working`].filter(Boolean).join(", "):`Fold the sessions under ${i}`,e[0]=c,e[1]=o.count,e[2]=o.needsYou,e[3]=o.working,e[4]=i,e[5]=r):r=e[5];const d=r,m=!c,w=c?void 0:"Fold";let g;e[6]!==t.member.sessionId||e[7]!==l?(g=()=>l(t.member.sessionId),e[6]=t.member.sessionId,e[7]=l,e[8]=g):g=e[8];const x=!c&&"opacity-0 group-hover/node:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100";let p;e[9]!==x?(p=se("absolute z-10 flex h-5 min-w-5 -translate-x-1/2 -translate-y-1/2 cursor-pointer items-center justify-center gap-1 rounded-full border bg-card px-1.5 text-[11px] font-medium tabular-nums text-muted-foreground shadow-xs outline-none","transition-opacity hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",x),e[9]=x,e[10]=p):p=e[10];let h;e[11]!==a?(h={left:a,top:Q/2},e[11]=a,e[12]=h):h=e[12];let v;e[13]!==u||e[14]!==c||e[15]!==o.count?(v=c?n.jsxs(n.Fragment,{children:[u&&n.jsx("span",{className:se("size-1.5 rounded-full",ue[u]),"aria-hidden":"true"}),"+",o.count]}):n.jsx(pt,{"aria-hidden":"true",className:"size-3"}),e[13]=u,e[14]=c,e[15]=o.count,e[16]=v):v=e[16];let N;return e[17]!==d||e[18]!==m||e[19]!==w||e[20]!==g||e[21]!==p||e[22]!==h||e[23]!==v?(N=n.jsx("button",{type:"button","aria-expanded":m,"aria-label":d,title:w,onClick:g,className:p,style:h,children:v}),e[17]=d,e[18]=m,e[19]=w,e[20]=g,e[21]=p,e[22]=h,e[23]=v,e[24]=N):N=e[24],N}function Bs(s){var g,x;const e=re.c(35),{member:t,name:i}=s;let a;e[0]!==t.firstUserMessage?(a=(g=t.firstUserMessage)==null?void 0:g.replace(/\s+/g," ").trim(),e[0]=t.firstUserMessage,e[1]=a):a=e[1];const l=a;let c;e[2]!==t.cwd?(c=(x=t.cwd)==null?void 0:x.split(/[\\/]/).filter(Boolean).at(-1),e[2]=t.cwd,e[3]=c):c=e[3];const o=c;let u;if(e[4]!==o||e[5]!==t.device||e[6]!==t.model||e[7]!==t.startedAt||e[8]!==t.turnCount){if(u=[],t.model){let p;e[10]!==t.model?(p=Ye(t.model),e[10]=t.model,e[11]=p):p=e[11];let h;e[12]!==p?(h=["Model",p],e[12]=p,e[13]=h):h=e[13],u.push(h)}if(t.device){let p;e[14]!==t.device.name?(p=["Device",t.device.name],e[14]=t.device.name,e[15]=p):p=e[15],u.push(p)}if(o){let p;e[16]!==o?(p=["Folder",o],e[16]=o,e[17]=p):p=e[17],u.push(p)}if(t.startedAt){let p;e[18]!==t.startedAt?(p=mt(t.startedAt),e[18]=t.startedAt,e[19]=p):p=e[19];let h;e[20]!==p?(h=["Started",p],e[20]=p,e[21]=h):h=e[21],u.push(h)}if(t.turnCount){const p=String(t.turnCount);let h;e[22]!==p?(h=["Turns",p],e[22]=p,e[23]=h):h=e[23],u.push(h)}e[4]=o,e[5]=t.device,e[6]=t.model,e[7]=t.startedAt,e[8]=t.turnCount,e[9]=u}else u=e[9];let r;e[24]!==i?(r=n.jsx("p",{className:"font-medium",children:i}),e[24]=i,e[25]=r):r=e[25];let d;e[26]!==i||e[27]!==l?(d=l&&l!==i&&n.jsx("p",{className:"line-clamp-3 text-muted-foreground",children:l}),e[26]=i,e[27]=l,e[28]=d):d=e[28];let m;e[29]!==u?(m=u.length>0&&n.jsx("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-0.5",children:u.map(Ks)}),e[29]=u,e[30]=m):m=e[30];let w;return e[31]!==r||e[32]!==d||e[33]!==m?(w=n.jsxs("div",{className:"flex flex-col gap-1.5 py-0.5",children:[r,d,m]}),e[31]=r,e[32]=d,e[33]=m,e[34]=w):w=e[34],w}function Ks(s){const[e,t]=s;return n.jsxs("div",{className:"contents",children:[n.jsx("dt",{className:"text-muted-foreground",children:e}),n.jsx("dd",{className:"truncate tabular-nums",children:t})]},e)}const Gs=4e3;function Vs(s){var p;const[e,t]=S.useState(null),[i,a]=S.useState(null),[l,c]=S.useState(new Set),o=(p=Wt())==null?void 0:p.refresh,u=S.useRef(s),r=S.useRef(new Set);S.useLayoutEffect(()=>(u.current=s,()=>{u.current=null}),[s]);const d=S.useCallback(async h=>{if(s)try{const v=await ze(`/api/session-crew/${encodeURIComponent(s)}`);if(!h())return;if(!v.ok){a(v.status===404?"This session is no longer available.":"Couldn't load the crew.");return}const N=await v.json();if(!h())return;t(b=>JSON.stringify(b)===JSON.stringify(N)?b:N),a(null)}catch{h()&&a("Couldn't load the crew.")}},[s]);it(s?d:null,Gs),S.useEffect(()=>{t(h=>h!=null&&h.members.some(v=>v.sessionId===s)?h:null),a(null),c(new Set)},[s]);const m=S.useCallback(async(h,v,N)=>{const b=`${s}:${h}`;if(r.current.has(b))return;const k=()=>u.current===s;r.current.add(b),c(C=>new Set(C).add(h));try{const C=await v();if(!k())return;if(!C.ok&&C.status!==404){a(N);return}o==null||o(),await d(k)}catch{k()&&a(N)}finally{r.current.delete(b),k()&&c(C=>{const M=new Set(C);return M.delete(h),M})}},[d,o,s]),w=S.useCallback((h,v,N)=>m(v,()=>be("/api/session-respond",{sessionId:h,requestId:v,...N}),"Couldn't send the answer."),[m]),g=S.useCallback((h,v)=>m(v,()=>be("/api/delegated-tasks",{sessionId:h,taskId:v,action:"ack"}),"Couldn't mark the result read."),[m]),x=S.useCallback(h=>m(h.sessionId,()=>{var v;return((v=h.result)==null?void 0:v.state)==="running"&&h.parentId?be("/api/delegated-tasks",{sessionId:h.parentId,taskId:h.result.taskId,action:"cancel"}):be("/api/stop-session",{sessionId:h.sessionId,cancelQueued:!0})},"Couldn't stop the session."),[m]);return{crew:e,error:i,busy:l,respond:w,markRead:g,stop:x}}const Xs=[{id:"all",label:"All"},{id:"working",label:"Working"},{id:"needs-you",label:"Need you"},{id:"done",label:"Done"}],Zs={working:"bg-success shadow-[0_0_0_2px_color-mix(in_oklch,var(--success)_25%,transparent)]","needs-you":"bg-warning",done:"bg-muted-foreground/40",failed:"bg-destructive",unreachable:"border border-muted-foreground/50"};function fn(s){var A;const e=re.c(34),{context:t,closePanel:i}=s,a=((A=t.session)==null?void 0:A.sessionId)??null,{crew:l,error:c,busy:o,respond:u,markRead:r,stop:d}=Vs(a),{names:m}=Ht(),[w,g]=S.useState("overview"),x=Ls((l==null?void 0:l.rootId)??"");let p;e[0]!==(l==null?void 0:l.members)?(p=new Map(((l==null?void 0:l.members)??[]).map(Qs)),e[0]=l==null?void 0:l.members,e[1]=p):p=e[1];const h=p;let v;e[2]!==(l==null?void 0:l.members)?(v=new Map(((l==null?void 0:l.members)??[]).flatMap(Js)),e[2]=l==null?void 0:l.members,e[3]=v):v=e[3];const N=v;let b;e[4]!==h||e[5]!==m?(b=z=>gs(z,h,m),e[4]=h,e[5]=m,e[6]=b):b=e[6];const k=b;let C;e[7]!==t?(C=z=>{z.address&&z.device?Xt(Zt(z.address.dirName,z.address.fileName,z.device.id)):z.address&&t.openSession?t.openSession(z.address.dirName,z.address.fileName):Jt(z.sessionId)},e[7]=t,e[8]=C):C=e[8];const M=C;let _,O,L;e[9]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ht,{"aria-hidden":"true",className:"size-4 text-muted-foreground"}),O=n.jsx("h2",{className:"text-sm font-medium",children:"Crew"}),L=n.jsx("div",{className:"flex-1"}),e[9]=_,e[10]=O,e[11]=L):(_=e[9],O=e[10],L=e[11]);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(cs,{"data-icon":"inline-start"}),e[12]=j):j=e[12];let R;e[13]!==i?(R=n.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-2 px-3",children:[_,O,L,n.jsx(J,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close crew",children:j})]}),e[13]=i,e[14]=R):R=e[14];let I;e[15]!==c?(I=c&&n.jsx("p",{role:"alert",className:"px-3 pb-2 text-xs text-destructive",children:c}),e[15]=c,e[16]=I):I=e[16];let $;e[17]!==o||e[18]!==l||e[19]!==c||e[20]!==N||e[21]!==x||e[22]!==r||e[23]!==k||e[24]!==M||e[25]!==u||e[26]!==a||e[27]!==d||e[28]!==w?($=l?n.jsxs(Ut,{value:w,onValueChange:g,className:"min-h-0 flex-1 grid-rows-[auto_minmax(0,1fr)]",children:[n.jsxs(Bt,{variant:"line",className:"mx-3 mb-1",children:[n.jsx(Ae,{value:"overview",children:"Overview"}),n.jsx(Ae,{value:"map",children:"Map"}),n.jsx(Ae,{value:"chat",children:"Chat"})]}),n.jsx(Oe,{value:"overview",className:"min-h-0",children:n.jsxs(ft,{className:"h-full min-h-0",children:[n.jsx(en,{crew:l,hereId:a,nameOf:k,onOpen:M}),n.jsx(sn,{crew:l,busy:o,nameOf:k,onOpen:M,onRespond:u}),n.jsx(nn,{crew:l,hereId:a,busy:o,nameOf:k,onOpen:M,onMarkRead:r,onStop:d})]})}),n.jsx(Oe,{value:"map",className:"min-h-0",children:n.jsx(_s,{crew:l,hereId:a,controls:x,kinds:N,nameOf:k,onOpen:M})}),n.jsx(Oe,{value:"chat",keepMounted:!0,className:"min-h-0",children:n.jsx(hs,{rootId:l.rootId,kinds:N,active:w==="chat"},l.rootId)})]}):!c&&n.jsx("p",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Loading the crew…"}),e[17]=o,e[18]=l,e[19]=c,e[20]=N,e[21]=x,e[22]=r,e[23]=k,e[24]=M,e[25]=u,e[26]=a,e[27]=d,e[28]=w,e[29]=$):$=e[29];let E;return e[30]!==I||e[31]!==$||e[32]!==R?(E=n.jsxs("aside",{"aria-label":"Crew",className:"flex size-full min-h-0 flex-col bg-canvas",children:[R,I,$]}),e[30]=I,e[31]=$,e[32]=R,e[33]=E):E=e[33],E}function Js(s){return s.address?[[s.sessionId,Kt(s.address.dirName)]]:[]}function Qs(s){return[s.sessionId,s]}function en(s){var b;const e=re.c(45),{crew:t,hereId:i,nameOf:a,onOpen:l}=s;let c,o,u,r,d;if(e[0]!==t||e[1]!==i||e[2]!==a||e[3]!==l){let k;e[9]!==t.rootId?(k=$=>$.sessionId===t.rootId,e[9]=t.rootId,e[10]=k):k=e[10];const C=t.members.find(k),M=t.members.filter(tn);let _;e[11]!==t?(_=bs(t),e[11]=t,e[12]=_):_=e[12],d=_;const O=(b=M[0])==null?void 0:b.startedAt;c="Crew summary",o="border-b px-3 pb-3 pt-1";const L=C&&n.jsx("button",{type:"button",onClick:()=>l(C),"aria-current":C.sessionId===i?"true":void 0,className:"min-w-0 flex-1 truncate rounded-sm text-left text-sm font-medium outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring",children:a(C)}),j=d.size===1?"session":"sessions",R=O?` · since ${mt(O)}`:"";let I;e[13]!==j||e[14]!==R||e[15]!==d.size?(I=n.jsxs("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:[d.size," ",j,R]}),e[13]=j,e[14]=R,e[15]=d.size,e[16]=I):I=e[16],e[17]!==I||e[18]!==L?(u=n.jsxs("div",{className:"flex items-baseline gap-2",children:[L,I]}),e[17]=I,e[18]=L,e[19]=u):u=e[19],r=M.length>0&&n.jsx("div",{"data-crew-strip":!0,className:"mt-2.5 grid grid-cols-[repeat(auto-fit,minmax(6px,1fr))] gap-[3px]",role:"list","aria-label":"One cell per session, in the order they were started",children:M.map($=>{const E=fe($);return n.jsx("button",{type:"button",role:"listitem","data-crew-cell":E,title:`${a($)}: ${Ne($)}`,"aria-label":`${a($)}: ${Ne($)}`,onClick:()=>{var A;return(A=document.querySelector(`[data-crew-row="${$.sessionId}"]`))==null?void 0:A.scrollIntoView({block:"nearest",behavior:"smooth"})},className:se("h-2.5 rounded-[2px] outline-none focus-visible:ring-2 focus-visible:ring-ring",Zs[E],$.sessionId===i&&"outline outline-[1.5px] outline-offset-2 outline-foreground")},$.sessionId)})}),e[0]=t,e[1]=i,e[2]=a,e[3]=l,e[4]=c,e[5]=o,e[6]=u,e[7]=r,e[8]=d}else c=e[4],o=e[5],u=e[6],r=e[7],d=e[8];let m;e[20]!==d.working?(m=d.working>0&&n.jsx(ye,{dot:ue.working,value:d.working,label:"working"}),e[20]=d.working,e[21]=m):m=e[21];let w;e[22]!==d.needsYou?(w=d.needsYou>0&&n.jsx(ye,{dot:ue["needs-you"],value:d.needsYou,label:d.needsYou===1?"needs you":"need you"}),e[22]=d.needsYou,e[23]=w):w=e[23];let g;e[24]!==d.done?(g=d.done>0&&n.jsx(ye,{dot:ue.done,value:d.done,label:"done"}),e[24]=d.done,e[25]=g):g=e[25];let x;e[26]!==d.failed?(x=d.failed>0&&n.jsx(ye,{dot:ue.failed,value:d.failed,label:"failed"}),e[26]=d.failed,e[27]=x):x=e[27];let p;e[28]!==d.unreachable?(p=d.unreachable>0&&n.jsx(ye,{dot:ue.unreachable,value:d.unreachable,label:"away"}),e[28]=d.unreachable,e[29]=p):p=e[29];let h;e[30]!==d.unreadResults?(h=d.unreadResults>0&&n.jsxs("span",{className:"ml-auto text-warning",children:[n.jsx("span",{className:"font-medium tabular-nums",children:d.unreadResults})," ",d.unreadResults===1?"result":"results"," unread"]}),e[30]=d.unreadResults,e[31]=h):h=e[31];let v;e[32]!==h||e[33]!==m||e[34]!==w||e[35]!==g||e[36]!==x||e[37]!==p?(v=n.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3.5 gap-y-1 text-xs text-muted-foreground",children:[m,w,g,x,p,h]}),e[32]=h,e[33]=m,e[34]=w,e[35]=g,e[36]=x,e[37]=p,e[38]=v):v=e[38];let N;return e[39]!==c||e[40]!==v||e[41]!==o||e[42]!==u||e[43]!==r?(N=n.jsxs("section",{"aria-label":c,className:o,children:[u,r,v]}),e[39]=c,e[40]=v,e[41]=o,e[42]=u,e[43]=r,e[44]=N):N=e[44],N}function tn(s){return s.parentId!==null}function ye(s){const e=re.c(10),{dot:t,value:i,label:a}=s;let l;e[0]!==t?(l=se("size-1.5 rounded-full",t),e[0]=t,e[1]=l):l=e[1];let c;e[2]!==l?(c=n.jsx("span",{className:l,"aria-hidden":"true"}),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==i?(o=n.jsx("span",{className:"font-medium tabular-nums text-foreground",children:i}),e[4]=i,e[5]=o):o=e[5];let u;return e[6]!==a||e[7]!==c||e[8]!==o?(u=n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c,o," ",a]}),e[6]=a,e[7]=c,e[8]=o,e[9]=u):u=e[9],u}function sn(s){const e=re.c(6),{crew:t,busy:i,nameOf:a,onOpen:l,onRespond:c}=s,o=ws(t),[u,r]=S.useState(0);if(o.length===0)return null;const d=Math.min(u,o.length-1),{member:m,pending:w}=o[d],g=o[d+1];let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Needs you"}),e[0]=x):x=e[0];let p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{className:"flex-1"}),e[1]=p):p=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("span",{className:se("size-1.5 shrink-0 rounded-full",ue["needs-you"]),"aria-hidden":"true"}),e[2]=h):h=e[2];const v=w.askedAt?`waiting ${qe(new Date(w.askedAt).toISOString())}`:"waiting";let N;e[3]!==v?(N=n.jsx("span",{className:"ml-auto shrink-0 tabular-nums text-warning",children:v}),e[3]=v,e[4]=N):N=e[4];let b;return e[5]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(et,{"data-icon":"inline-end"}),e[5]=b):b=e[5],n.jsxs("section",{"aria-label":"Needs you",className:"border-b px-3 py-2.5",children:[n.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs text-muted-foreground",children:[x,n.jsx("span",{className:"tabular-nums",children:o.length}),p,o.length>1&&n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"tabular-nums",children:[d+1," of ",o.length]}),n.jsx(J,{variant:"ghost",size:"icon-xs","aria-label":"Previous request",disabled:d===0,onClick:()=>r(d-1),children:n.jsx(ls,{"data-icon":"inline-start"})}),n.jsx(J,{variant:"ghost",size:"icon-xs","aria-label":"Next request",disabled:d===o.length-1,onClick:()=>r(d+1),children:n.jsx(et,{"data-icon":"inline-start"})})]})]}),n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsxs("div",{className:"flex items-center gap-2 px-0.5 text-xs",children:[h,n.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:a(m)}),m.device&&n.jsx(Gt,{variant:"outline",children:m.device.name}),N]}),n.jsx(Vt,{sessionId:m.sessionId,pending:w,queued:0,responding:i.has(w.requestId),onRespond:(k,C)=>void c(m.sessionId,k,C),onOpen:()=>l(m)},w.requestId),n.jsxs(J,{variant:"ghost",size:"xs",className:"self-end text-muted-foreground",onClick:()=>l(m),children:["Open session",b]})]}),g&&n.jsxs("p",{className:"mt-2 truncate text-xs text-muted-foreground",children:["Next: ",n.jsx("span",{className:"font-medium text-foreground",children:a(g.member)})," ",Ne(g.member).toLowerCase()]})]})}function nn(s){const e=re.c(17),{crew:t,hereId:i,busy:a,nameOf:l,onOpen:c,onMarkRead:o,onStop:u}=s,[r,d]=S.useState("all");let m;if(e[0]!==a||e[1]!==t||e[2]!==r||e[3]!==i||e[4]!==l||e[5]!==o||e[6]!==c||e[7]!==u){let w;e[9]!==r?(w=N=>{const{member:b}=N;if(r==="all")return!0;const k=fe(b);return r==="done"?k!=="working"&&k!=="needs-you":k===r},e[9]=r,e[10]=w):w=e[10];const g=xs(t).filter(w);let x,p;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("h3",{className:"text-sm font-medium",children:"Sessions"}),p=n.jsx("span",{className:"flex-1"}),e[11]=x,e[12]=p):(x=e[11],p=e[12]);let h;e[13]!==r?(h=Xs.map(N=>{const{id:b,label:k}=N;return n.jsx("button",{type:"button",role:"radio","aria-checked":r===b,onClick:()=>d(b),className:se("rounded-full px-2 py-0.5 text-[11px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",r===b&&"bg-accent text-foreground"),children:k},b)}),e[13]=r,e[14]=h):h=e[14];let v;e[15]!==h?(v=n.jsxs("div",{className:"mb-1.5 flex items-center gap-2 px-1.5",children:[x,p,n.jsx("div",{role:"radiogroup","aria-label":"Show sessions",className:"flex gap-0.5",children:h})]}),e[15]=h,e[16]=v):v=e[16],m=n.jsxs("section",{"aria-label":"Sessions",className:"px-1.5 py-2.5",children:[v,g.length===0?n.jsx("p",{className:"px-1.5 py-4 text-center text-xs text-muted-foreground",children:"No sessions here."}):n.jsx("ul",{className:"flex flex-col",children:g.map(N=>n.jsx(on,{row:N,here:N.member.sessionId===i,busy:a,name:l(N.member),onOpen:c,onMarkRead:o,onStop:u},N.member.sessionId))})]}),e[0]=a,e[1]=t,e[2]=r,e[3]=i,e[4]=l,e[5]=o,e[6]=c,e[7]=u,e[8]=m}else m=e[8];return m}function on(s){var ae,ce;const e=re.c(73),{row:t,here:i,busy:a,name:l,onOpen:c,onMarkRead:o,onStop:u}=s,{member:r,depth:d,children:m}=t;let w;e[0]!==r?(w=fe(r),e[0]=r,e[1]=w):w=e[1];const g=w;let x;e[2]!==r?(x=Ne(r),e[2]=r,e[3]=x):x=e[3];const p=x;let h;e[4]!==r.pullRequests?(h=(ae=r.pullRequests)==null?void 0:ae.at(-1),e[4]=r.pullRequests,e[5]=h):h=e[5];const v=h;let N;e[6]!==r?(N=Re(r)&&r.result&&r.parentId,e[6]=r,e[7]=N):N=e[7];const b=N,k=(g==="working"||g==="needs-you")&&(!r.device||((ce=r.result)==null?void 0:ce.state)==="running"&&r.parentId!==null),C=r.sessionId,M=i?"bg-accent":"hover:bg-accent/60",_=d>0&&"border-l border-border/70";let O;e[8]!==M||e[9]!==_?(O=se("group/crew relative rounded-md",M,_),e[8]=M,e[9]=_,e[10]=O):O=e[10];const L=d>0?6+(d-1)*14:0;let j;e[11]!==L?(j={marginLeft:L},e[11]=L,e[12]=j):j=e[12];let R;e[13]!==r||e[14]!==c?(R=()=>c(r),e[13]=r,e[14]=c,e[15]=R):R=e[15];const I=i?"true":void 0,$=`${l}, ${p}`,E=ue[g];let A;e[16]!==E?(A=se("size-1.5 justify-self-center rounded-full",E),e[16]=E,e[17]=A):A=e[17];let z;e[18]!==A?(z=n.jsx("span",{className:A,"aria-hidden":"true"}),e[18]=A,e[19]=z):z=e[19];let D;e[20]!==l?(D=n.jsx("span",{className:"truncate",children:l}),e[20]=l,e[21]=D):D=e[21];let W;e[22]!==i?(W=i&&n.jsx("span",{className:"shrink-0 rounded-full border px-1.5 text-[10.5px] font-normal text-muted-foreground",children:"you are here"}),e[22]=i,e[23]=W):W=e[23];let P;e[24]!==D||e[25]!==W?(P=n.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12.5px] font-medium",children:[D,W]}),e[24]=D,e[25]=W,e[26]=P):P=e[26];let Y;e[27]!==r.lastActivityAt?(Y=r.lastActivityAt?qe(r.lastActivityAt):"",e[27]=r.lastActivityAt,e[28]=Y):Y=e[28];let K;e[29]!==Y?(K=n.jsx("span",{className:"text-[11px] tabular-nums text-muted-foreground/80",children:Y}),e[29]=Y,e[30]=K):K=e[30];const B=(g==="needs-you"||b)&&"text-warning",X=g==="failed"&&"text-destructive";let H;e[31]!==B||e[32]!==X?(H=se("min-w-0 flex-1 truncate",B,X),e[31]=B,e[32]=X,e[33]=H):H=e[33];let U;e[34]!==p||e[35]!==H?(U=n.jsx("span",{className:H,children:p}),e[34]=p,e[35]=H,e[36]=U):U=e[36];let G;e[37]!==v?(G=v&&n.jsxs("span",{className:"shrink-0 rounded-full border px-1.5 text-[11px]",children:["#",v.number]}),e[37]=v,e[38]=G):G=e[38];let f;e[39]!==r.device?(f=r.device&&n.jsx("span",{className:"shrink-0",children:r.device.name}),e[39]=r.device,e[40]=f):f=e[40];let y;e[41]!==m?(y=m>0&&n.jsxs("span",{className:"shrink-0",children:[m," ",m===1?"session":"sessions"]}),e[41]=m,e[42]=y):y=e[42];let T;e[43]!==r.model?(T=r.model&&n.jsx("span",{className:"shrink-0 text-muted-foreground/70",children:Ye(r.model)}),e[43]=r.model,e[44]=T):T=e[44];let V;e[45]!==U||e[46]!==G||e[47]!==f||e[48]!==y||e[49]!==T?(V=n.jsxs("span",{className:"col-start-2 col-end-4 flex min-w-0 items-center gap-2 text-[11.5px] text-muted-foreground",children:[U,G,f,y,T]}),e[45]=U,e[46]=G,e[47]=f,e[48]=y,e[49]=T,e[50]=V):V=e[50];let ee;e[51]!==R||e[52]!==I||e[53]!==$||e[54]!==z||e[55]!==P||e[56]!==K||e[57]!==V?(ee=n.jsxs("button",{type:"button",onClick:R,"aria-current":I,"aria-label":$,className:"grid w-full grid-cols-[14px_minmax(0,1fr)_auto] items-center gap-x-2 gap-y-0.5 rounded-md px-2 py-1.5 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[z,P,K,V]}),e[51]=R,e[52]=I,e[53]=$,e[54]=z,e[55]=P,e[56]=K,e[57]=V,e[58]=ee):ee=e[58];let Z;e[59]!==a||e[60]!==k||e[61]!==r||e[62]!==l||e[63]!==o||e[64]!==u||e[65]!==b?(Z=(b||k)&&n.jsxs("div",{className:"absolute right-1.5 top-1 hidden gap-1 group-focus-within/crew:flex group-hover/crew:flex",children:[b&&r.result&&r.parentId&&n.jsx(J,{variant:"outline",size:"icon-xs",className:"bg-popover","aria-label":`Mark ${l}'s result read`,title:"Mark the result read",disabled:a.has(r.result.taskId),onClick:()=>void o(r.parentId,r.result.taskId),children:n.jsx(is,{"data-icon":"inline-start"})}),k&&n.jsx(J,{variant:"outline",size:"icon-xs",className:"bg-popover text-destructive","aria-label":`Stop ${l}`,title:"Stop this session",disabled:a.has(r.sessionId),onClick:()=>void u(r),children:n.jsx(rs,{"data-icon":"inline-start"})})]}),e[59]=a,e[60]=k,e[61]=r,e[62]=l,e[63]=o,e[64]=u,e[65]=b,e[66]=Z):Z=e[66];let te;return e[67]!==r.sessionId||e[68]!==j||e[69]!==ee||e[70]!==Z||e[71]!==O?(te=n.jsxs("li",{"data-crew-row":C,className:O,style:j,children:[ee,Z]}),e[67]=r.sessionId,e[68]=j,e[69]=ee,e[70]=Z,e[71]=O,e[72]=te):te=e[72],te}export{fn as CrewPanel};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PluginsDialog-BHKZ3Esx.js","assets/vendor-react-gGw_S5I_.js","assets/index-D3WV64DU.js","assets/vendor-ui-DkzcTXCS.js","assets/vendor-shiki-DOn6sF-i.js","assets/vendor-markdown-BE1gYnO9.js","assets/index-hGMtuUNI.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{C as Z,b6 as re,b7 as V,m as pt,n as gt,I as jt,E as It,G as Pt,b8 as zt,B as le,b9 as bt,J as dt,U as Le,ba as vt,a0 as wt,a1 as Nt,a4 as St,bb as ot,bc as yt,Z as lt,bd as Dt,at as Lt,au as Rt,be as Ot,bf as Ct,bg as Ft,i as Ut,j as Bt,k as Mt,bh as Gt,z as Ht,aL as Vt,h as Wt,D as Xt}from"./index-D3WV64DU.js";import{c as ae,j as t,r as p}from"./vendor-react-gGw_S5I_.js";import{S as qt}from"./switch-B1AuQGfo.js";import{aa as Kt,ab as Jt,d as Zt,T as Qt,M as Yt,ac as es,ad as ts,ae as ss,a5 as kt,C as _t,af as ut,ag as ns,n as is,z as ls,ah as as,I as rs,ai as os,aj as cs}from"./vendor-ui-DkzcTXCS.js";import{P as mt}from"./password-BV9mqUzz.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";function ds(s){const e=ae.c(3),{name:n}=s,i=n.toLowerCase();if(i.includes("iphone")||i.includes("android")){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Zt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=r):r=e[0],r}if(i.includes("ipad")||i.includes("tablet")){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[1]=r):r=e[1],r}let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Yt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[2]=l):l=e[2],l}function ct(s){const e=Math.floor((Date.now()-s)/1e3);if(e<60)return"just now";const n=Math.floor(e/60);if(n<60)return`${n}m ago`;const i=Math.floor(n/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function us(s){const e=[`Shared ${ct(s.createdAt)}`,s.lastAccessAt>0?`opened ${ct(s.lastAccessAt)}`:"never opened"];return s.guests>0&&e.push(s.guests===1?"1 guest":`${s.guests} guests`),e.join(" · ")}function ms(){const s=ae.c(12),{shares:e,revoke:n,revokeAll:i}=zt();let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-xs text-muted-foreground",children:"Shared sessions"}),s[0]=l):l=s[0];let r;s[1]!==i||s[2]!==e.length?(r=e.length>0&&t.jsx(le,{variant:"ghost",size:"xs",className:"text-destructive hover:text-destructive",onClick:()=>void i(),children:"Revoke all"}),s[1]=i,s[2]=e.length,s[3]=r):r=s[3];let a;s[4]!==r?(a=t.jsxs("div",{className:"flex h-6 items-center justify-between",children:[l,r]}),s[4]=r,s[5]=a):a=s[5];let g;s[6]!==n||s[7]!==e?(g=e.length===0?t.jsx("p",{className:"text-xs text-muted-foreground",children:"No sessions are shared."}):t.jsx("div",{className:"flex flex-col gap-1.5",children:e.map(o=>{const m=o.title||o.sessionId;return t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border px-3 py-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate text-sm text-foreground",children:m}),t.jsx("p",{className:"text-xs text-muted-foreground",children:us(o)})]}),t.jsx(le,{variant:"ghost",size:"xs","aria-label":`Revoke share of ${m}`,className:"text-destructive hover:text-destructive",onClick:()=>void n(o.sessionId),children:"Revoke"})]},o.sessionId)})}),s[6]=n,s[7]=e,s[8]=g):g=s[8];let c;return s[9]!==a||s[10]!==g?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[a,g]}),s[9]=a,s[10]=g,s[11]=c):c=s[11],c}function fs(s){const e=ae.c(30),{networkAccess:n,setNetworkAccess:i,networkPassword:l,setNetworkPassword:r,showNetworkPassword:a,setShowNetworkPassword:g,hasExistingPassword:c,initialNetworkAccess:o,connectedDevices:m,minPasswordLength:w}=s;let h;e[0]!==n?(h=n?t.jsx(es,{"data-icon":"inline-start",className:"size-4 text-success"}):t.jsx(ts,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=n,e[1]=h):h=e[1];let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Network Access"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow other devices to connect"})]}),e[2]=v):v=e[2];let C;e[3]!==h?(C=t.jsxs("div",{className:"flex items-center gap-2",children:[h,v]}),e[3]=h,e[4]=C):C=e[4];let _;e[5]!==i?(_=j=>i(j),e[5]=i,e[6]=_):_=e[6];let N;e[7]!==n||e[8]!==_?(N=t.jsx(qt,{"aria-label":"Network Access",checked:n,onCheckedChange:_}),e[7]=n,e[8]=_,e[9]=N):N=e[9];let S;e[10]!==C||e[11]!==N?(S=t.jsxs("div",{className:"flex items-center justify-between",children:[C,N]}),e[10]=C,e[11]=N,e[12]=S):S=e[12];let f;e[13]!==c||e[14]!==w||e[15]!==n||e[16]!==l||e[17]!==r||e[18]!==g||e[19]!==a?(f=n&&t.jsxs(Z,{"data-invalid":l.length>0&&l.length<w,children:[t.jsx(re,{htmlFor:"network-password",children:"Password"}),t.jsx(V,{children:c&&l.length===0?"A password is already set. Leave blank to keep it.":`Use at least ${w} characters.`}),t.jsxs(pt,{children:[t.jsx(gt,{id:"network-password",type:a?"text":"password",value:l,onChange:j=>r(j.target.value),placeholder:c?"Enter new password to change":"Set a password for remote access"}),t.jsx(jt,{align:"inline-end",children:t.jsx(It,{size:"icon-xs","aria-label":a?"Hide password":"Show password",onClick:()=>g(!a),children:a?t.jsx(Kt,{"data-icon":"inline-start"}):t.jsx(Jt,{"data-icon":"inline-start"})})})]}),l.length>0&&l.length<w&&t.jsxs(Pt,{children:["Password must be at least ",w," characters (",l.length,"/",w,")"]}),t.jsx(V,{children:"Requires app restart. Remote browsers need an HTTPS reverse proxy; port 19384 remains available to Cogpit hubs and device clients."})]}),e[13]=c,e[14]=w,e[15]=n,e[16]=l,e[17]=r,e[18]=g,e[19]=a,e[20]=f):f=e[20];let x;e[21]!==m||e[22]!==o||e[23]!==n?(x=n&&o&&m.length>0&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:"Connected devices"}),t.jsx("div",{className:"flex flex-col gap-1.5",children:m.map(hs)})]}),e[21]=m,e[22]=o,e[23]=n,e[24]=x):x=e[24];let y;e[25]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ms,{}),e[25]=y):y=e[25];let k;return e[26]!==S||e[27]!==f||e[28]!==x?(k=t.jsxs("div",{className:"flex flex-col gap-4 border-t pt-5",children:[S,f,x,y]}),e[26]=S,e[27]=f,e[28]=x,e[29]=k):k=e[29],k}function hs(s,e){return t.jsxs("div",{className:"flex items-center justify-between rounded-lg border px-3 py-2",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx(ds,{name:s.deviceName}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-foreground",children:s.deviceName}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s.ip})]})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:ct(s.lastActivity)})]})]},`${s.ip}-${e}`)}const xs=["auto","path","npm","bundled","custom"],at={source:"auto"},ps=["path","npm","bundled"];function gs(s){return xs.includes(s)}function js(s){if(!s||typeof s!="object")return;const{source:e,path:n}=s;if(!(!gs(e)||e==="auto"))return e==="custom"?typeof n=="string"&&n.trim()?{source:e,path:n.trim()}:void 0:{source:e}}const De={auto:"Automatic",path:"Installed on PATH",npm:"Global npm install",bundled:"Bundled with Cogpit",custom:"Custom path"};function Et(s,e){return e?`v${e} · ${s}`:s}function bs(s,e){return s===null?"Checking installed binaries…":e?e.version===null?`${e.path} did not report a version — check the path.`:`Now running: ${Et(e.path,e.version)}`:"No launchable binary for the saved choice — sessions cannot start."}function vs(s){return s!==null&&s.version!==null}function ws(s){const e=ae.c(92),{kind:n,value:i,onChange:l,disabled:r,reportVersion:a}=s;let g;e[0]!==n?(g=bt(n),e[0]=n,e[1]=g):g=e[1];const{displayName:c}=g,[o,m]=p.useState(null),[w,h]=p.useState(!1),v=`agent-executable-${n}`;let C;e[2]!==n?(C=()=>{let se=!1;return Le(`/api/agent-executable/${n}`).then(ys).then(G=>{se||m(G)}).catch(Ss),()=>{se=!0}},e[2]=n,e[3]=C):C=e[3];let _;e[4]!==n||e[5]!==a?(_=[n,a],e[4]=n,e[5]=a,e[6]=_):_=e[6],p.useEffect(C,_);let N,S,f,x,y,k,j,T,b,I,E,D,u;if(e[7]!==r||e[8]!==c||e[9]!==v||e[10]!==l||e[11]!==w||e[12]!==(o==null?void 0:o.active)||e[13]!==(o==null?void 0:o.candidates)||e[14]!==i.path||e[15]!==i.source){const se=new Map((o==null?void 0:o.candidates.map(Ns))??[]);x=(o==null?void 0:o.active)??null;let G;e[29]!==r||e[30]!==v||e[31]!==l||e[32]!==i.path||e[33]!==i.source?(G=(z,F,ce,de)=>{const ue=de===void 0?!0:de,J=`${v}-${z}`;return t.jsxs(Z,{orientation:"horizontal",children:[t.jsx("input",{type:"radio",id:J,name:v,className:"mt-1 size-4 shrink-0 accent-primary",checked:i.source===z,disabled:r||!ue,onChange:()=>l(z==="custom"?{source:z,path:i.path??""}:{source:z})}),t.jsxs(vt,{children:[t.jsx(re,{htmlFor:J,children:F}),t.jsx(V,{className:"break-all",children:ce})]})]},z)},e[29]=r,e[30]=v,e[31]=l,e[32]=i.path,e[33]=i.source,e[34]=G):G=e[34],y=G;const st=z=>{const F=se.get(z);return y(z,De[z],F?Et(F.path,F.version):"Not found on this machine.",F!==void 0||i.source===z)},L=x?`${De[i.source]} · v${x.version??"?"}`:De[i.source];f=wt,D=w,u=h,k="flex flex-col gap-2";let oe;e[35]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx(le,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 font-medium hover:bg-transparent"}),e[35]=oe):oe=e[35];let R;e[36]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(ss,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[36]=R):R=e[36];let ne;e[37]!==c?(ne=t.jsxs("span",{className:"flex items-center gap-2",children:[R,c," executable"]}),e[37]=c,e[38]=ne):ne=e[38];let O;e[39]!==L?(O=t.jsx("span",{className:"truncate",children:L}),e[39]=L,e[40]=O):O=e[40];let H;e[41]!==w?(H=w?t.jsx(kt,{className:"size-4 shrink-0"}):t.jsx(_t,{className:"size-4 shrink-0"}),e[41]=w,e[42]=H):H=e[42];let K;e[43]!==O||e[44]!==H?(K=t.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-normal text-muted-foreground",children:[O,H]}),e[43]=O,e[44]=H,e[45]=K):K=e[45],e[46]!==ne||e[47]!==K?(j=t.jsxs(Nt,{render:oe,children:[ne,K]}),e[46]=ne,e[47]=K,e[48]=j):j=e[48],S=St,N=Z,e[49]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(V,{children:"Which binary new sessions run. Automatic uses your installed CLI unless it is older than the copy bundled with Cogpit."}),e[49]=E):E=e[49],T="flex flex-col gap-2 pl-1",e[50]!==y?(b=y("auto",De.auto,"Recommended."),e[50]=y,e[51]=b):b=e[51],I=ps.map(st),e[7]=r,e[8]=c,e[9]=v,e[10]=l,e[11]=w,e[12]=o==null?void 0:o.active,e[13]=o==null?void 0:o.candidates,e[14]=i.path,e[15]=i.source,e[16]=N,e[17]=S,e[18]=f,e[19]=x,e[20]=y,e[21]=k,e[22]=j,e[23]=T,e[24]=b,e[25]=I,e[26]=E,e[27]=D,e[28]=u}else N=e[16],S=e[17],f=e[18],x=e[19],y=e[20],k=e[21],j=e[22],T=e[23],b=e[24],I=e[25],E=e[26],D=e[27],u=e[28];const Q=`${c} executable path`,U=i.source==="custom"?i.path??"":"",ze=r||i.source!=="custom";let P;e[52]!==l?(P=se=>l({source:"custom",path:se.target.value}),e[52]=l,e[53]=P):P=e[53];let W;e[54]!==Q||e[55]!==U||e[56]!==ze||e[57]!==P?(W=t.jsx(ot,{"aria-label":Q,value:U,placeholder:"/path/to/binary",disabled:ze,onChange:P,className:"mt-1"}),e[54]=Q,e[55]=U,e[56]=ze,e[57]=P,e[58]=W):W=e[58];let B;e[59]!==y||e[60]!==W?(B=y("custom",De.custom,W),e[59]=y,e[60]=W,e[61]=B):B=e[61];let Y;e[62]!==B||e[63]!==T||e[64]!==b||e[65]!==I?(Y=t.jsxs("div",{className:T,children:[b,I,B]}),e[62]=B,e[63]=T,e[64]=b,e[65]=I,e[66]=Y):Y=e[66];let A;e[67]!==x?(A=vs(x)?"text-muted-foreground":"text-destructive",e[67]=x,e[68]=A):A=e[68];let X;e[69]!==A?(X=dt("text-xs",A),e[69]=A,e[70]=X):X=e[70];let M;e[71]!==x||e[72]!==o?(M=bs(o,x),e[71]=x,e[72]=o,e[73]=M):M=e[73];let ee;e[74]!==X||e[75]!==M?(ee=t.jsx("p",{className:X,"aria-live":"polite",children:M}),e[74]=X,e[75]=M,e[76]=ee):ee=e[76];let $;e[77]!==N||e[78]!==Y||e[79]!==ee||e[80]!==E?($=t.jsxs(N,{children:[E,Y,ee]}),e[77]=N,e[78]=Y,e[79]=ee,e[80]=E,e[81]=$):$=e[81];let q;e[82]!==S||e[83]!==$?(q=t.jsx(S,{children:$}),e[82]=S,e[83]=$,e[84]=q):q=e[84];let te;return e[85]!==f||e[86]!==k||e[87]!==j||e[88]!==q||e[89]!==D||e[90]!==u?(te=t.jsxs(f,{open:D,onOpenChange:u,className:k,children:[j,q]}),e[85]=f,e[86]=k,e[87]=j,e[88]=q,e[89]=D,e[90]=u,e[91]=te):te=e[91],te}function Ns(s){return[s.source,s]}function Ss(){}function ys(s){return s.ok?s.json():null}function At(s){return s instanceof Error?s.message:String(s)}async function ft(s){try{const e=await Le(`/api/agent-accounts/${s}`);return e.status===404?{status:"missing"}:e.ok?await e.json():{status:"error",error:await yt(e,`Request failed (${e.status})`)}}catch(e){return{status:"error",error:At(e)}}}function Cs(s){const[e,n]=p.useState(null),[i,l]=p.useState(null),[r,a]=p.useState(null);p.useEffect(()=>{let c=!1;return ft(s).then(o=>{c||n(o)}),()=>{c=!0}},[s]);const g=p.useCallback(async c=>{l(c),a(null);try{const o=await Le(`/api/agent-accounts/${s}/switch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slot:c})});if(!o.ok){a({kind:"failed",error:await yt(o,`Request failed (${o.status})`)});return}a({kind:"switched",result:await o.json()}),n(await ft(s))}catch(o){a({kind:"failed",error:At(o)})}finally{l(null)}},[s]);return{report:e,switchingSlot:i,outcome:r,switchTo:g}}const ks={token_expired:"Token expired",relogin_required:"Login needed",no_credentials:"No credentials",keychain_unavailable:"Keychain locked",foreign_credential:"Credential mismatch",api_key:"API key",unavailable:"Usage unavailable"};function rt(s){return s.alias??s.email}function ht(s){const e=ae.c(18),{label:n,window:i}=s;if(!i)return null;const l=i.pct>=80,r=i.resetsIn?`${n} window resets in ${i.resetsIn}`:void 0;let a;e[0]!==n?(a=t.jsx("span",{className:"w-5",children:n}),e[0]=n,e[1]=a):a=e[1];const g=l?"bg-destructive":"bg-primary";let c;e[2]!==g?(c=dt("absolute inset-y-0 left-0 rounded-full",g),e[2]=g,e[3]=c):c=e[3];const o=`${i.pct}%`;let m;e[4]!==o?(m={width:o},e[4]=o,e[5]=m):m=e[5];let w;e[6]!==c||e[7]!==m?(w=t.jsx("span",{className:"relative h-1 w-16 overflow-hidden rounded-full bg-muted",children:t.jsx("span",{className:c,style:m})}),e[6]=c,e[7]=m,e[8]=w):w=e[8];let h;e[9]!==i.pct?(h=Math.round(i.pct),e[9]=i.pct,e[10]=h):h=e[10];let v;e[11]!==h?(v=t.jsxs("span",{className:"tabular-nums",children:[h,"%"]}),e[11]=h,e[12]=v):v=e[12];let C;return e[13]!==r||e[14]!==a||e[15]!==w||e[16]!==v?(C=t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",title:r,children:[a,w,v]}),e[13]=r,e[14]=a,e[15]=w,e[16]=v,e[17]=C):C=e[17],C}function xt(s){return/[.!?]$/.test(s)?s:`${s}.`}function _s(s,e){if(s.kind==="failed")return`Switch failed: ${s.error}`;const{result:n}=s,i=[xt(n.message)];return n.switched&&i.push(n.credentialStore==="keychain"?`Running ${e} sessions pick it up within about 30 seconds; restart one to apply it immediately.`:`New messages in ${e} use it from now on.`),[...i,...n.warnings.map(xt)].join(" ")}function Es(s){const e=ae.c(41),{kind:n,disabled:i}=s;let l;e[0]!==n?(l=bt(n),e[0]=n,e[1]=l):l=e[1];const{displayName:r}=l,{report:a,switchingSlot:g,outcome:c,switchTo:o}=Cs(n),[m,w]=p.useState(!1);if(a===null||a.status==="missing")return null;let h,v;if(e[2]!==a.accounts||e[3]!==a.status){h=a.status==="ok"?a.accounts:[];const u=h.find(As)??null;v=a.status==="error"?"Unavailable":u?`${rt(u)} · ${h.length} account${h.length===1?"":"s"}`:`${h.length} account${h.length===1?"":"s"}`,e[2]=a.accounts,e[3]=a.status,e[4]=h,e[5]=v}else h=e[4],v=e[5];const C=v;let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(le,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 font-medium hover:bg-transparent"}),e[6]=_):_=e[6];let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ns,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[7]=N):N=e[7];let S;e[8]!==r?(S=t.jsxs("span",{className:"flex items-center gap-2",children:[N,r," accounts"]}),e[8]=r,e[9]=S):S=e[9];let f;e[10]!==C?(f=t.jsx("span",{className:"truncate",children:C}),e[10]=C,e[11]=f):f=e[11];let x;e[12]!==m?(x=m?t.jsx(kt,{className:"size-4 shrink-0"}):t.jsx(_t,{className:"size-4 shrink-0"}),e[12]=m,e[13]=x):x=e[13];let y;e[14]!==f||e[15]!==x?(y=t.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-normal text-muted-foreground",children:[f,x]}),e[14]=f,e[15]=x,e[16]=y):y=e[16];let k;e[17]!==S||e[18]!==y?(k=t.jsxs(Nt,{render:_,children:[S,y]}),e[17]=S,e[18]=y,e[19]=k):k=e[19];const j=a.status==="ok"&&`Logins managed by ${a.tool}${a.version?` ${a.version}`:""}. `;let T;e[20]!==r||e[21]!==j?(T=t.jsxs(V,{children:[j,"Switching changes which login ",r," sessions authenticate with."]}),e[20]=r,e[21]=j,e[22]=T):T=e[22];let b;e[23]!==h||e[24]!==i||e[25]!==a.error||e[26]!==a.status||e[27]!==o||e[28]!==g?(b=a.status==="error"?t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a.error}):t.jsx("ul",{className:"flex flex-col divide-y divide-border rounded-md border border-border",children:h.map(u=>{const Q=g===u.slot,U=ks[u.usageStatus];return t.jsxs("li",{className:"flex items-center gap-3 px-3 py-2",children:[t.jsx("span",{className:"w-5 shrink-0 text-xs tabular-nums text-muted-foreground",children:u.slot}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:rt(u)}),u.alias&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:u.email}),u.active&&t.jsx(lt,{children:"Active"}),u.disabled&&t.jsx(lt,{variant:"outline",children:"Disabled"}),U&&t.jsx(lt,{variant:"destructive",children:U})]}),u.organization&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:u.organization}),u.usage&&t.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[t.jsx(ht,{label:"5h",window:u.usage.fiveHour}),t.jsx(ht,{label:"7d",window:u.usage.sevenDay})]})]}),!i&&!u.active&&t.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:g!==null,onClick:()=>o(u.slot),"aria-label":`Switch to ${rt(u)}`,children:Q?t.jsxs(t.Fragment,{children:[t.jsx(ut,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Switching…"]}):"Switch"})]},u.slot)})}),e[23]=h,e[24]=i,e[25]=a.error,e[26]=a.status,e[27]=o,e[28]=g,e[29]=b):b=e[29];let I;e[30]!==r||e[31]!==c?(I=c&&t.jsx("p",{className:dt("text-xs",c.kind==="failed"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",role:c.kind==="failed"?"alert":"status",children:_s(c,r)}),e[30]=r,e[31]=c,e[32]=I):I=e[32];let E;e[33]!==T||e[34]!==b||e[35]!==I?(E=t.jsx(St,{children:t.jsxs(Z,{children:[T,b,I]})}),e[33]=T,e[34]=b,e[35]=I,e[36]=E):E=e[36];let D;return e[37]!==m||e[38]!==E||e[39]!==k?(D=t.jsxs(wt,{open:m,onOpenChange:w,className:"flex flex-col gap-2",children:[k,E]}),e[37]=m,e[38]=E,e[39]=k,e[40]=D):D=e[40],D}function As(s){return s.active}const $s=p.lazy(()=>Ft(()=>import("./PluginsDialog-BHKZ3Esx.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(s=>({default:s.PluginsDialog}))),Ts=Ct().filter(s=>s.cli.bundledBySdk).map(s=>s.kind),Is=Ct().filter(s=>s.capabilities.accountSwitching).map(s=>s.kind);function Ps(s,e){return s.source===e.source&&(s.source!=="custom"||s.path===e.path)}function zs(s){const e=ae.c(5),{status:n,error:i}=s;if(n==="validating"){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(ut,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Checking path..."]}),e[0]=l):l=e[0],l}if(n==="valid"){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-success",children:[t.jsx(os,{"data-icon":"inline-start",className:"size-3.5"}),"Valid .claude directory found"]}),e[1]=l):l=e[1],l}if(n==="invalid"&&i){let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(cs,{"data-icon":"inline-start",className:"size-3.5"}),e[2]=l):l=e[2];let r;return e[3]!==i?(r=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[l,i]}),e[3]=i,e[4]=r):r=e[4],r}return null}function qs(s){const e=ae.c(118),{open:n,currentPath:i,onClose:l,onSaved:r}=s,[a,g]=p.useState(i),[c,o]=p.useState(!1),{status:m,error:w,debouncedValidate:h,reset:v,save:C}=Dt();let _;e[0]===Symbol.for("react.memo_cache_sentinel")?(_=Lt(),e[0]=_):_=e[0];const N=_;let S;e[1]===Symbol.for("react.memo_cache_sentinel")?(S=Rt("configWrite"),e[1]=S):S=e[1];const f=S,[x,y]=p.useState(!1),k=Ot(n&&x&&f),[j,T]=p.useState(!1),[b,I]=p.useState(""),[E,D]=p.useState(!1),[u,Q]=p.useState(""),[U,ze]=p.useState(""),[P,W]=p.useState(""),[B,Y]=p.useState(""),[A,X]=p.useState(!1),[M,ee]=p.useState(!1),[$,q]=p.useState(at),[te,se]=p.useState(0),[G,st]=p.useState(at),[L,oe]=p.useState(!1),[R,ne]=p.useState(!1);let O;e[2]===Symbol.for("react.memo_cache_sentinel")?(O=[],e[2]=O):O=e[2];const[H,K]=p.useState(O);let z,F;e[3]!==i||e[4]!==n||e[5]!==v?(z=()=>{n&&(g(i),v(),Le("/api/config").then(Fs).then(d=>{const ie=(d==null?void 0:d.networkAccess)||!1;T(ie),oe(ie),ne(!!(d!=null&&d.networkPassword)),I("");const Qe=(d==null?void 0:d.terminalApp)||"";Q(Qe),ze(Qe);const Ye=(d==null?void 0:d.editorApp)||"";W(Ye),Y(Ye);const et=(d==null?void 0:d.useBuiltInEditor)===!0;X(et),ee(et);const tt=js(d==null?void 0:d.agentExecutable)??at;q(tt),st(tt),ie&&(d!=null&&d.networkPassword)&&!N?Le("/api/connected-devices").then(Os).then(Pe=>K((Pe==null?void 0:Pe.devices)||[])).catch(Rs):K([])}).catch(Ls))},F=[n,i,v,N],e[3]=i,e[4]=n,e[5]=v,e[6]=z,e[7]=F):(z=e[6],F=e[7]),p.useEffect(z,F);let ce;e[8]!==h?(ce=d=>{const ie=d.target.value;g(ie),h(ie)},e[8]=h,e[9]=ce):ce=e[9];const de=ce;let ue;e[10]!==$||e[11]!==P||e[12]!==L||e[13]!==j||e[14]!==b||e[15]!==r||e[16]!==a||e[17]!==C||e[18]!==u||e[19]!==A?(ue=async()=>{o(!0);const d=await C(a,{networkAccess:N?L:j,networkPassword:!N&&j&&b.length>0?b:void 0,terminalApp:u.trim()||void 0,editorApp:P.trim()||void 0,useBuiltInEditor:A,agentExecutable:$});d.success&&d.claudeDir&&(se(Ds),r(d.claudeDir)),o(!1)},e[10]=$,e[11]=P,e[12]=L,e[13]=j,e[14]=b,e[15]=r,e[16]=a,e[17]=C,e[18]=u,e[19]=A,e[20]=ue):ue=e[20];const J=ue;let Re;e[21]!==$||e[22]!==P||e[23]!==R||e[24]!==G||e[25]!==B||e[26]!==L||e[27]!==U||e[28]!==M||e[29]!==j||e[30]!==b||e[31]!==m||e[32]!==u||e[33]!==A?(Re=function(){var Pe;if(m==="validating"||m==="invalid")return!1;const ie=m==="valid",Qe=!N&&(j!==L||j&&b.length>0),Ye=u!==U,et=P!==B||A!==M,tt=!Ps($,G);if(!ie&&!Qe&&!Ye&&!et&&!tt||$.source==="custom"&&!((Pe=$.path)!=null&&Pe.trim()))return!1;if(!N&&j){const $t=b.length>0&&b.length<mt,Tt=!R&&b.length===0;if($t||Tt)return!1}return!0},e[21]=$,e[22]=P,e[23]=R,e[24]=G,e[25]=B,e[26]=L,e[27]=U,e[28]=M,e[29]=j,e[30]=b,e[31]=m,e[32]=u,e[33]=A,e[34]=Re):Re=e[34];const me=Re();let fe;e[35]!==l?(fe=d=>{d||l()},e[35]=l,e[36]=fe):fe=e[36];let Oe;e[37]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsxs(Ut,{children:[t.jsx(Bt,{className:"text-foreground",children:"Configuration"}),t.jsx(Mt,{className:"text-muted-foreground",children:"Manage local paths, preferred apps, and remote access."})]}),e[37]=Oe):Oe=e[37];let Fe;e[38]===Symbol.for("react.memo_cache_sentinel")?(Fe=f&&t.jsxs(Z,{children:[t.jsx(re,{children:"Plugins"}),t.jsx(V,{children:"Manage installed plugins, their settings, and service connections."}),t.jsx(le,{type:"button",variant:"outline",onClick:()=>y(!0),children:"Manage plugins"})]}),e[38]=Fe):Fe=e[38];let Ue,Be;e[39]===Symbol.for("react.memo_cache_sentinel")?(Ue=t.jsx(re,{htmlFor:"claude-directory",children:"Claude directory"}),Be=t.jsx(V,{children:"The directory containing your Claude configuration."}),e[39]=Ue,e[40]=Be):(Ue=e[39],Be=e[40]);let Me;e[41]===Symbol.for("react.memo_cache_sentinel")?(Me=t.jsx(jt,{children:t.jsx(is,{"data-icon":"inline-start"})}),e[41]=Me):Me=e[41];let he;e[42]!==me||e[43]!==J||e[44]!==c?(he=d=>{d.key==="Enter"&&me&&!c&&J()},e[42]=me,e[43]=J,e[44]=c,e[45]=he):he=e[45];let xe;e[46]!==de||e[47]!==a||e[48]!==he?(xe=t.jsxs(pt,{children:[Me,t.jsx(gt,{id:"claude-directory",value:a,onChange:de,placeholder:"/Users/you/.claude",disabled:!f,onKeyDown:he})]}),e[46]=de,e[47]=a,e[48]=he,e[49]=xe):xe=e[49];let pe;e[50]!==w||e[51]!==m?(pe=t.jsx("div",{"aria-live":"polite",children:t.jsx(zs,{status:m,error:w})}),e[50]=w,e[51]=m,e[52]=pe):pe=e[52];let ge;e[53]!==xe||e[54]!==pe?(ge=t.jsxs(Z,{children:[Ue,Be,xe,pe]}),e[53]=xe,e[54]=pe,e[55]=ge):ge=e[55];let Ge,He;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ge=t.jsxs(re,{htmlFor:"terminal-application",children:[t.jsx(ls,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Terminal application"]}),He=t.jsx(V,{children:"Leave blank to use the system default for Ctrl+Cmd+T."}),e[56]=Ge,e[57]=He):(Ge=e[56],He=e[57]);let Ve;e[58]===Symbol.for("react.memo_cache_sentinel")?(Ve=d=>Q(d.target.value),e[58]=Ve):Ve=e[58];let je;e[59]!==u?(je=t.jsxs(Z,{children:[Ge,He,t.jsx(ot,{id:"terminal-application",value:u,onChange:Ve,placeholder:"Ghostty, iTerm, or /path/to/binary",disabled:!f})]}),e[59]=u,e[60]=je):je=e[60];let We;e[61]===Symbol.for("react.memo_cache_sentinel")?(We=d=>X(d===!0),e[61]=We):We=e[61];let be;e[62]!==A?(be=t.jsx(Gt,{id:"use-built-in-editor",checked:A,onCheckedChange:We,disabled:!f}),e[62]=A,e[63]=be):be=e[63];let Xe;e[64]===Symbol.for("react.memo_cache_sentinel")?(Xe=t.jsxs(vt,{children:[t.jsxs(re,{htmlFor:"use-built-in-editor",children:[t.jsx(as,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Open files in Cogpit"]}),t.jsx(V,{children:"Files and diffs open in Cogpit’s file workspace instead of launching an external editor."})]}),e[64]=Xe):Xe=e[64];let ve;e[65]!==be?(ve=t.jsxs(Z,{orientation:"horizontal",children:[be,Xe]}),e[65]=be,e[66]=ve):ve=e[66];let qe;e[67]===Symbol.for("react.memo_cache_sentinel")?(qe=t.jsxs(re,{htmlFor:"editor-application",children:[t.jsx(rs,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Editor application"]}),e[67]=qe):qe=e[67];const nt=A?"Not used while files open in Cogpit.":"Leave blank to use $VISUAL or automatic detection.";let we;e[68]!==nt?(we=t.jsx(V,{children:nt}),e[68]=nt,e[69]=we):we=e[69];let Ke;e[70]===Symbol.for("react.memo_cache_sentinel")?(Ke=d=>W(d.target.value),e[70]=Ke):Ke=e[70];const it=!f||A;let Ne;e[71]!==P||e[72]!==it?(Ne=t.jsx(ot,{id:"editor-application",value:P,onChange:Ke,placeholder:"cursor, code, zed, or /path/to/binary",disabled:it}),e[71]=P,e[72]=it,e[73]=Ne):Ne=e[73];let Se;e[74]!==we||e[75]!==Ne?(Se=t.jsxs(Z,{children:[qe,we,Ne]}),e[74]=we,e[75]=Ne,e[76]=Se):Se=e[76];let ye;e[77]!==$||e[78]!==te?(ye=Ts.map(d=>t.jsx(ws,{kind:d,value:$,onChange:q,disabled:!f,reportVersion:te},d)),e[77]=$,e[78]=te,e[79]=ye):ye=e[79];let Je;e[80]===Symbol.for("react.memo_cache_sentinel")?(Je=Is.map(d=>t.jsx(Es,{kind:d,disabled:!f},d)),e[80]=Je):Je=e[80];let Ce;e[81]!==H||e[82]!==R||e[83]!==L||e[84]!==j||e[85]!==b||e[86]!==E?(Ce=!N&&f&&t.jsx(fs,{networkAccess:j,setNetworkAccess:T,networkPassword:b,setNetworkPassword:I,showNetworkPassword:E,setShowNetworkPassword:D,hasExistingPassword:R,initialNetworkAccess:L,connectedDevices:H,minPasswordLength:mt}),e[81]=H,e[82]=R,e[83]=L,e[84]=j,e[85]=b,e[86]=E,e[87]=Ce):Ce=e[87];let ke;e[88]!==ge||e[89]!==je||e[90]!==ve||e[91]!==Se||e[92]!==ye||e[93]!==Ce?(ke=t.jsxs(Ht,{children:[Fe,ge,je,ve,Se,ye,Je,Ce]}),e[88]=ge,e[89]=je,e[90]=ve,e[91]=Se,e[92]=ye,e[93]=Ce,e[94]=ke):ke=e[94];let _e;e[95]!==l?(_e=t.jsx(le,{variant:"outline",onClick:l,children:"Cancel"}),e[95]=l,e[96]=_e):_e=e[96];let Ee;e[97]!==me||e[98]!==J||e[99]!==c?(Ee=f&&t.jsx(le,{disabled:!me||c,onClick:J,children:c?t.jsxs(t.Fragment,{children:[t.jsx(ut,{"data-icon":"inline-start",className:"size-4 animate-spin"}),"Saving..."]}):"Save"}),e[97]=me,e[98]=J,e[99]=c,e[100]=Ee):Ee=e[100];let Ae;e[101]!==_e||e[102]!==Ee?(Ae=t.jsxs(Vt,{children:[_e,Ee]}),e[101]=_e,e[102]=Ee,e[103]=Ae):Ae=e[103];let $e;e[104]!==ke||e[105]!==Ae?($e=t.jsxs(Wt,{className:"max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-lg",children:[Oe,ke,Ae]}),e[104]=ke,e[105]=Ae,e[106]=$e):$e=e[106];let Te;e[107]!==n||e[108]!==$e||e[109]!==fe?(Te=t.jsx(Xt,{open:n,onOpenChange:fe,children:$e}),e[107]=n,e[108]=$e,e[109]=fe,e[110]=Te):Te=e[110];let Ie;e[111]!==n||e[112]!==x||e[113]!==k?(Ie=n&&x&&f&&t.jsx(p.Suspense,{fallback:null,children:t.jsx($s,{client:k.client,state:k,currentPath:null,onClose:()=>y(!1)})}),e[111]=n,e[112]=x,e[113]=k,e[114]=Ie):Ie=e[114];let Ze;return e[115]!==Te||e[116]!==Ie?(Ze=t.jsxs(t.Fragment,{children:[Te,Ie]}),e[115]=Te,e[116]=Ie,e[117]=Ze):Ze=e[117],Ze}function Ds(s){return s+1}function Ls(){}function Rs(){}function Os(s){return s.json()}function Fs(s){return s.json()}export{qs as ConfigDialog};
|