@fabiofiorita/porcelain 0.82.0 → 0.82.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/README.md +1 -1
- package/package.json +1 -1
- package/server/src/cli/main.mjs +59 -45
- package/web/dist/assets/{_-DLuWvCI2.js → _-b1prKmSp.js} +1 -1
- package/web/dist/assets/{_paired-CW4ku02g.js → _paired--LzhIV8q.js} +1 -1
- package/web/dist/assets/{_paired-C10XxJ8F.js → _paired-CqcR1ikJ.js} +1 -1
- package/web/dist/assets/{_section-8dZXUUxK.js → _section-C3rzCQs1.js} +1 -1
- package/web/dist/assets/{_worktreeId-CvY_CJtj.js → _worktreeId-BDJbQ5Cn.js} +1 -1
- package/web/dist/assets/{_worktreeId-CK00Ut-s.js → _worktreeId-D1NaqSVx.js} +1 -1
- package/web/dist/assets/connected-workspace-DcS6e5zB.js +1 -0
- package/web/dist/assets/{desktop-actions-4xXr-L-Y.js → desktop-actions-WJQHB849.js} +22 -22
- package/web/dist/assets/{index-BkcQY4h9.js → index-Bk8Ig0Ne.js} +3 -3
- package/web/dist/assets/{pair-BfBMg7pt.js → pair-CqLMCfsc.js} +1 -1
- package/web/dist/assets/{settings-page-BlsRrwEe.js → settings-page-RYnO3e6i.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/connected-workspace-CwFgVbW_.js +0 -1
package/web/dist/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
|
|
15
15
|
<meta name="theme-color" content="#171717" media="(prefers-color-scheme: dark)" />
|
|
16
16
|
<title>Porcelain</title>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-Bk8Ig0Ne.js"></script>
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/access-WT1uwdZk.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/root-DLTE-HSj.js">
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<link rel="modulepreload" crossorigin href="/assets/formatCSSVariablePrefix-KRh9vnZf.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/edit-file-CG3WhqLS.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/resolveLanguages-BkDrap64.js">
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/assets/settings-page-
|
|
31
|
+
<link rel="modulepreload" crossorigin href="/assets/settings-page-RYnO3e6i.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/workspace-pending-oH5nDvO6.js">
|
|
33
33
|
<link rel="stylesheet" crossorigin href="/assets/index-BoONRxa4.css">
|
|
34
34
|
</head>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$s as t,Aa as n,B as r,Bs as i,Ca as a,Ci as o,Fs as s,Gs as c,Hc as l,Ho as u,Io as d,Ko as f,L as p,Lo as m,Ma as h,Ms as g,N as _,Oa as v,On as y,Qo as b,R as x,Ui as S,Us as C,V as w,Wo as T,Yi as E,Yo as D,ai as O,bi as k,bn as A,c as ee,ca as j,cc as M,ci as te,cn as ne,da as N,dc as P,fi as F,g as re,h as I,hl as L,ja as ie,jn as ae,ka as R,lc as oe,li as se,oc as z,ol as ce,pa as le,qi as B,to as ue,ts as de,ua as fe,uc as pe,ul as me,xi as V,xn as he,z as ge,zo as H}from"./access-WT1uwdZk.js";import{$ as _e,B as U,Fn as W,In as ve,L as G,M as K,N as ye,P as be,Un as xe,V as q,Y as Se,_t as Ce,at as we,et as Te,it as Ee,lt as De,m as Oe,n as ke,nt as Ae,rt as je,tt as Me,vt as Ne,x as Pe,z as Fe}from"./settings-page-BlsRrwEe.js";import{$r as Ie,G as Le,Qr as Re,W as ze,Xr as Be,Zr as J,ei as Ve}from"./edit-file-CG3WhqLS.js";import{a as Y,c as He,d as Ue,f as We,g as Ge,h as Ke,i as qe,l as Je,m as Ye,n as Xe,o as Ze,p as Qe,r as $e,s as et,u as tt,v as nt}from"./desktop-actions-4xXr-L-Y.js";var rt={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};rt.node;var it=v(rt),at={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};at.node;var ot=v(at),st={name:`folder-x`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`m9.5 10.5 5 5`,key:`ra9qjz`}],[`path`,{d:`m14.5 10.5-5 5`,key:`l2rkpq`}]]};st.node;var ct=v(st);function lt(e){let t=e.walkthrough;if(t===void 0)return{kind:`unwritten`};switch(t.state.status){case`queued`:case`running`:return{kind:`writing`,run:t};case`failed`:return{kind:`failed`,run:t,failure:t.state.failure};case`ready`:return{kind:`ready`,run:t,content:t.state.content,outOfDate:e.outOfDate,attempt:e.attempt}}}function ut(e){return e.walkthrough===void 0?`changes`:`walkthrough`}var dt=[`One`,`Two`,`Three`,`Four`,`Five`];function ft(e){return e.stops.flatMap((e,t)=>e.attention===void 0?[]:[{stop:e,step:t+1,attention:e.attention}])}function pt(e){let t=ft(e).length;return e.outcome===`nothing`?`Nothing needs you.`:e.outcome===`worth_knowing`||t===0?`Worth knowing.`:t===1?`One call is yours.`:`${dt[t-1]??t} calls are yours.`}function mt(e,t=[]){let n=[...e.excerpts.map(e=>e.path),...e.files.map(e=>e.path)],r=t.flatMap(e=>e.oldPath!==void 0&&n.includes(e.oldPath)?[e.path]:[]);return[...new Set([...n,...r])]}function ht(e){return new Set(e.stops.flatMap(e=>mt(e))).size}function gt(e,t){return e.has(t.path)||t.oldPath!==void 0&&e.has(t.oldPath)}function _t(e,t,n=[]){let r=new Set;return{steps:e.stops.map((e,i)=>{let a=new Set(mt(e,n)),o=t.filter(e=>gt(a,e));for(let e of o)r.add(e);return{stop:e,step:i+1,files:o}}),outside:t.filter(e=>!r.has(e))}}var vt={claude:`Claude`,codex:`Codex`},yt={claude:`claude auth login`,codex:`codex login`};function bt(e,t){let n=vt[t.provider];switch(e.kind){case`signed_out`:return{title:`Sign in to ${n} again with ${yt[t.provider]}, then try again.`,message:``,command:yt[t.provider]};case`agent_not_installed`:return{title:`${n} isn't installed here.`,message:e.message};case`timed_out`:return{title:`The walkthrough took too long.`,message:e.message};case`unusable_output`:return{title:`${n} wrote something unreadable.`,message:e.message};case`other`:return{title:`The walkthrough didn't finish.`,message:e.message}}}var xt=new Set([`signed_out`,`agent_not_installed`,`timed_out`,`unusable_output`,`other`]);function St(e){return typeof e==`string`&&xt.has(e)}function Ct(e){return typeof e==`object`&&e&&`kind`in e&&`message`in e&&St(e.kind)&&typeof e.message==`string`?{kind:e.kind,message:e.message}:{kind:`other`,message:e instanceof Error&&e.message!==``?e.message:`Porcelain could not start the walkthrough.`}}function wt(e){let t=(e.branch===void 0?void 0:e.pullRequests?.find(t=>t.headBranch===e.branch&&t.state===`open`)?.number)??e.displayedRun?.pullRequestNumber;return{...e.base===void 0?{}:{base:e.base},...t===void 0?{}:{pullRequestNumber:t}}}function Tt(e){let t=lt(e);return t.kind===`ready`?Et(t.content.title).replace(/\.$/,``):`Walkthrough`}function Et(e){return e.replaceAll("`",``)}function Dt(e){return e.split(/(`[^`]+`)/).filter(e=>e!==``).map(e=>e.length>2&&e.startsWith("`")&&e.endsWith("`")?{kind:`code`,text:e.slice(1,-1)}:{kind:`text`,text:e})}function Ot({branch:e,worktree:t,only:n}){let r=e=>[...new Set(e.filter(e=>n===void 0||n.includes(e.path)||e.oldPath!==void 0&&n.includes(e.oldPath)).map(e=>e.path))],i=t.flatMap(e=>[e,...(e.comparisons??[]).flatMap(t=>`oldPath`in t?[{path:e.path,oldPath:t.oldPath}]:[])]);return{branch:r(e),worktree:r(i)}}var X=e(g(),1),Z=T(),kt=s(e=>B(e.connection).fn(l(`Walkthroughs.start`)(function*(n){let r=yield*E(e.connection,t=>t.walkthroughs.startWalkthrough({params:{worktreeId:e.scope.worktreeId},payload:n}));return yield*t([S.reviewSurface(e.connection.environmentId,e.scope,[`walkthrough`])]),r})));function At([e,t],n){let r=L(P(n.pulls)),i=wt({...n,pullRequests:r?.kind===`available`?r.pullRequests:void 0});return{waiting:oe(e),failure:z(e)?Ct(me(e.cause)):void 0,start:()=>void t(i)}}var jt=s(({connection:e,scope:n,runId:r})=>{let i=B(e),a={worktreeId:n.worktreeId,runId:r},o=t([S.reviewSurface(e.environmentId,n,[`walkthrough-conversations`])]),s=e=>({...a,messageId:e});return{addMessage:i.fn(l(`Walkthroughs.addMessage`)(function*(t){let n=yield*E(e,e=>e.walkthroughs.addWalkthroughMessage({params:a,payload:t}));return yield*o,n})),retryAnswer:i.fn(l(`Walkthroughs.retryAnswer`)(function*(t){let n=yield*E(e,e=>e.walkthroughs.retryWalkthroughAnswer({params:s(t)}));return yield*o,n})),saveMessage:i.fn(l(`Walkthroughs.saveMessage`)(function*(t){let n=yield*E(e,e=>e.walkthroughs.saveWalkthroughMessage({params:s(t.messageId),payload:{saved:t.saved}}));return yield*o,n})),postMessage:i.fn(l(`Walkthroughs.postMessage`)(function*(t){let n=yield*E(e,e=>e.walkthroughs.postWalkthroughMessage({params:s(t)}));return yield*o,n})),readBrief:i.fn(l(`Walkthroughs.readBrief`)(function*(t){return(yield*E(e,e=>e.walkthroughs.readWalkthroughBrief({params:a,query:t===void 0?{}:{messageId:t}}))).text})),postSavedMessages:i.fn(l(`Walkthroughs.postSavedMessages`)(function*(){let t=yield*E(e,e=>e.walkthroughs.postSavedWalkthroughMessages({params:a}));return yield*o,t}))}});function Mt([e,t]){return{waiting:oe(e),run:async e=>{let n=await t(e);if(ce(n))throw me(n.cause);return n.value}}}var Nt=l(`Walkthroughs.readConversations`)(function*({connection:e,scope:t,runId:n}){return yield*E(e,e=>e.walkthroughs.listWalkthroughConversations({params:{worktreeId:t.worktreeId,runId:n}}))}),Pt=s(e=>o(e.connection,e.scope,[`walkthrough-conversations`,e.runId],Nt(e),B(e.connection)).pipe(V)),Ft=s(e=>k(e,[`walkthrough`],t=>t.walkthroughs.readWalkthrough({params:{worktreeId:e.scope.worktreeId}}),t=>t.walkthrough===void 0||t.walkthrough.worktreeId===e.scope.worktreeId)),It=s(e=>k(e,[`walkthrough-asset`,e.runId,e.assetId],t=>t.walkthroughs.readWalkthroughAsset({params:{worktreeId:e.scope.worktreeId,runId:e.runId,assetId:e.assetId}})));function Lt(e,t){let n=L(P(e));return n===void 0?z(e)?{status:`failed`}:{status:`reading`}:{status:`read`,value:t(n)}}function Rt(e,t){return e.conversations.filter(e=>e.anchor.kind===t.kind&&(e.anchor.kind===`walkthrough`||t.kind===`stop`&&e.anchor.title===t.title))}function zt(e){return e.messages.filter(e=>e.author===`developer`)}function Bt(e,t){return e.messages.find(e=>e.author===`agent`&&e.replyTo===t)}function Vt(e){return e.conversations.flatMap(zt).filter(e=>e.post.status===`saved`).length}function Ht(e){return e===void 0||e.post.status===`none`?`available`:e.post.status}function Ut(e,t){return(e?.conversations??[]).filter(({anchor:e})=>e.kind===`walkthrough`||!t.includes(e.title))}function Wt(e){return typeof e==`object`&&e&&(`status`in e&&e.status===409||`name`in e&&e.name===`WalkthroughRepositoryChangedError`)?{text:`Nothing was posted. Copy the brief instead.`,copy:!0}:{text:e instanceof Error?e.message:`The request failed. Try again.`,copy:!1}}var Gt=/^[a-z][a-z\d+.-]*:\/\/[^/?#\s]+(\/[^?#\s]*)?(?:[?#]\S*)?$/i,Kt=/\/(?:pull|issues)\/([1-9]\d*)\/?$/;function qt(e){let t=Gt.exec(e)?.[1]??``,n=Kt.exec(t)?.[1];return n===void 0?`Posted comment`:`Posted on #${n}`}function Jt(e){return e===void 0?{single:`Copy as prompt`,together:`Copy together`}:{single:`Post on #${e}`,together:`Post together on #${e}`}}function Yt(e){return zt(e).map(t=>({message:t,reply:Bt(e,t.id)}))}function Xt(e,t){return e?Rt(e,{kind:`stop`,title:t}):[]}function Zt(e){let t=e?Vt(e):0;if(t!==0)return t===1?`1 comment saved`:`${t} comments saved`}function Qt(e){let{outcome:t}=e;return t.status===`brief`?{kind:`brief`,text:t.text}:t.status!==`posted`||t.notPosted.length===0?{kind:`done`}:{kind:`still-saved`,messages:e.view.conversations.flatMap(zt).filter(e=>t.notPosted.includes(e.id))}}function $t(e){let t=e.walkthrough.status===`read`?e.walkthrough.value:void 0;return{name:ut(t??{walkthrough:void 0,outOfDate:!1}),pending:e.walkthrough.status===`reading`,guided:t?.walkthrough!==void 0,companion:t!==void 0&&t.walkthrough===void 0}}var en={product:`Product call`,contract:`Contract call`,tradeoff:`Tradeoff`,risk:`Risk to accept`,accessibility:`Accessibility call`};function tn(e){return en[e.kind]}var nn={added:`+`,changed:`~`,removed:`−`};function rn(e){return nn[e.change]}var an=4,on=7,sn=3;function cn(e,t){let n=e.growth;return{shown:t?n:n.slice(0,an),hidden:t?0:Math.max(0,n.length-an)}}function ln(e,t){let n=e.onlyInTranscript.length+e.stillUnclear.length,r=t?e.onlyInTranscript:e.onlyInTranscript.slice(0,sn),i=t?e.stillUnclear:e.stillUnclear.slice(0,Math.max(0,sn-r.length));return{explained:r,unclear:i,total:n,hidden:n-r.length-i.length}}function un(e,t){let n=t?ht(t):0;return[...e.pullRequestNumber===void 0?[]:[`#${e.pullRequestNumber}`],...n>0?[n===1?`1 file`:`${n} files`]:[],`written for ${e.headOid.slice(0,on)}${e.includesUncommitted?` and uncommitted work`:``}`].join(` · `)}function dn(e,t){return bt(e,t?.writer??{provider:`claude`,model:``,effort:`high`})}function fn(e,t){let n=e.attempt,r=n?.state.status,i=n?.state.status===`failed`?{failure:n.state.failure,writer:n.writer}:void 0;return{updating:t.waiting||r===`queued`||r===`running`,failure:t.failure?{failure:t.failure,writer:n?.writer??e.run.writer}:i}}function pn(e){switch(e.evidenceUnavailable){case`head_mismatch`:return`Screenshots and checks are not shown: the pull request is at another commit. Push, then update.`;case`github_account`:return`Screenshots and checks are not shown: choose a GitHub account for this project, then update.`;case`github_unavailable`:return`Screenshots and checks are not shown: GitHub could not be reached. Try updating later.`;case void 0:return}}function mn(e,t){return{connection:t.connection,scope:{projectId:e.projectId,worktreeId:e.worktreeId}}}var hn=s(e=>Ft(e).pipe(C,c(0)));function gn(e,t){let n=(0,Z.c)(12),r;n[0]!==t||n[1]!==e?(r=hn(mn(e,t)),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i=r,a=u(i),o,s,c;if(n[3]!==a){let e=L(P(a));o=a,s=e,c=e?lt(e):void 0,n[3]=a,n[4]=o,n[5]=s,n[6]=c}else o=n[4],s=n[5],c=n[6];let l=H(i),d;return n[7]!==o||n[8]!==s||n[9]!==c||n[10]!==l?(d={result:o,read:s,phase:c,refresh:l},n[7]=o,n[8]=s,n[9]=c,n[10]=l,n[11]=d):d=n[11],d}function _n(e,t){let{phase:n}=gn(e,t);return n?.kind===`ready`?n:void 0}function vn(e,t,n){let r=(0,Z.c)(2),i=De(e,t.connection,n).result,a;return r[0]===i?a=r[1]:(a=L(P(i))?.files??[],r[0]=i,r[1]=a),a}function yn(e,t){let n=(0,Z.c)(2),{read:r}=gn(e,t),i;return n[0]===r?i=n[1]:(i=r?Tt(r):`Walkthrough`,n[0]=r,n[1]=i),i}function bn(e,t){let n=(0,Z.c)(2),{result:r}=gn(e,t),i;return n[0]===r?i=n[1]:(i=$t({walkthrough:Lt(r,xn)}),n[0]=r,n[1]=i),i}function xn(e){return e}var Sn=s(e=>i(t=>{let n=t(It(e));return pe(n,e=>{let n=URL.createObjectURL(new Blob([Uint8Array.from(e)]));return t.addFinalizer(()=>URL.revokeObjectURL(n)),n})}));function Cn(e){let t=(0,Z.c)(5),n;return t[0]!==e.assetId||t[1]!==e.context||t[2]!==e.runId||t[3]!==e.scope?(n=Sn({...mn(e.scope,e.context),runId:e.runId,assetId:e.assetId}),t[0]=e.assetId,t[1]=e.context,t[2]=e.runId,t[3]=e.scope,t[4]=n):n=t[4],u(n)}function wn(e,t,n,r){let i=(0,Z.c)(8),a;i[0]!==t.connection||i[1]!==e.projectId||i[2]!==e.worktreeId?(a=kt({connection:t.connection,scope:{projectId:e.projectId,worktreeId:e.worktreeId}}),i[0]=t.connection,i[1]=e.projectId,i[2]=e.worktreeId,i[3]=a):a=i[3];let o;i[4]===Symbol.for(`react.memo_cache_sentinel`)?(o={mode:`promiseExit`},i[4]=o):o=i[4];let[s,c]=d(a,o),l=L(P(Ne(e,t.connection))),f;i[5]!==t.connection||i[6]!==e.projectId?(f=F({connection:t.connection,projectId:e.projectId}),i[5]=t.connection,i[6]=e.projectId,i[7]=f):f=i[7];let p=u(f);return At([s,c],{pulls:p,branch:l?.branch?.name,displayedRun:r,base:n})}var Q=de();function $(e){let t=(0,Z.c)(4),{text:n}=e,r;t[0]===n?r=t[1]:(r=Dt(n).map(Tn),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(Q.Fragment,{children:r}),t[2]=r,t[3]=i),i}function Tn(e,t){return e.kind===`code`?(0,Q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px font-mono text-[0.86em]`,children:e.text},t):e.text}var En=ie(`group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full`,{variants:{variant:{default:`*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80`,secondary:`*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]`,muted:`*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]`,tinted:`*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]`,outline:`*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30`,ghost:`border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50`,destructive:`*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30`}},defaultVariants:{variant:`default`}});function Dn({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,Q.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:h(En({variant:e}),n),...r})}function On({className:e,render:t,...n}){return ne({defaultTagName:`div`,props:ue({className:h(`w-fit max-w-full min-w-0 overflow-hidden rounded-lg border border-transparent px-2.5 py-1.5 text-xs/relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-2 [button,a]:focus-visible:ring-ring/30`,e)},n),render:t,state:{slot:`bubble-content`}})}ie(`absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-xs ring-2 ring-card has-[button]:p-0`,{variants:{side:{top:`top-0 -translate-y-3/4`,bottom:`bottom-0 translate-y-3/4`},align:{start:`left-3`,end:`right-3`}},defaultVariants:{side:`bottom`,align:`end`}});function kn({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`message-group`,className:h(`flex min-w-0 flex-col gap-1.5`,e),...t})}function An({className:e,align:t=`start`,...n}){return(0,Q.jsx)(`div`,{"data-slot":`message`,"data-align":t,className:h(`group/message relative flex w-full min-w-0 gap-1.5 text-xs/relaxed data-[align=end]:flex-row-reverse`,e),...n})}function jn({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`message-content`,className:h(`flex w-full min-w-0 flex-col gap-2 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end`,e),...t})}function Mn({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`message-header`,className:h(`flex max-w-full min-w-0 items-center px-2.5 text-[0.625rem] font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0`,e),...t})}function Nn({scope:e,context:t,runId:n}){return{connection:t.connection,runId:n,scope:{projectId:e.projectId,worktreeId:e.worktreeId}}}function Pn(e){let t=(0,Z.c)(10),n;t[0]===e?n=t[1]:(n=Pt(Nn(e)),t[0]=e,t[1]=n);let r=n,i=u(r),a;t[2]===i?a=t[3]:(a=L(P(i)),t[2]=i,t[3]=a);let o;t[4]===i?o=t[5]:(o=z(i),t[4]=i,t[5]=o);let s=H(r),c;return t[6]!==a||t[7]!==o||t[8]!==s?(c={view:a,failed:o,refresh:s},t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Fn(e){let t=(0,Z.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={mode:`promiseExit`},t[0]=n):n=t[0];let r=d(e,n),i;return t[1]===r?i=t[2]:(i=Mt(r),t[1]=r,t[2]=i),i}function In(e){let t=(0,Z.c)(9),n;t[0]===e?n=t[1]:(n=jt(Nn(e)),t[0]=e,t[1]=n);let r=n,i=Fn(r.addMessage),a=Fn(r.retryAnswer),o=Fn(r.saveMessage),s=Fn(r.postMessage),c=Fn(r.postSavedMessages),l=Fn(r.readBrief),u;return t[2]!==i||t[3]!==a||t[4]!==o||t[5]!==s||t[6]!==c||t[7]!==l?(u={add:i,retry:a,save:o,post:s,postSaved:c,brief:l},t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function Ln(e,t){let n=(0,Z.c)(17),r=In(e),[i,a]=(0,X.useState)(),o=r.post.waiting||r.postSaved.waiting||r.save.waiting||r.brief.waiting,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>a(Wt(e)),n[0]=s):s=n[0];let c=s,l;n[1]!==r.brief||n[2]!==t?.id?(l=()=>void r.brief.run(t?.id).then(zn,c),n[1]=r.brief,n[2]=t?.id,n[3]=l):l=n[3];let u=l,d;n[4]!==r.save||n[5]!==t?(d=e=>{t&&r.save.run({messageId:t.id,saved:e}).catch(c)},n[4]=r.save,n[5]=t,n[6]=d):d=n[6];let f=d,p;n[7]!==r.post||n[8]!==r.postSaved||n[9]!==t?(p=()=>{a(void 0),(t?r.post.run(t.id):r.postSaved.run(void 0)).then(e=>{let t=Qt(e);t.kind===`brief`&&j(t.text,`brief`,!1),t.kind===`still-saved`&&a({text:`Still saved: ${t.messages.map(Rn).join(`; `)}. These comments belong to a different repository.`,copy:!1})},c)},n[7]=r.post,n[8]=r.postSaved,n[9]=t,n[10]=p):p=n[10];let m=p,h;return n[11]!==u||n[12]!==i||n[13]!==m||n[14]!==f||n[15]!==o?(h={notice:i,waiting:o,copy:u,save:f,post:m},n[11]=u,n[12]=i,n[13]=m,n[14]=f,n[15]=o,n[16]=h):h=n[16],h}function Rn(e){return e.text}function zn(e){e&&j(e,`brief`,!1)}function Bn(e,t){let n=(0,Z.c)(7),[r,i]=(0,X.useState)(),a=In(e),o;n[0]!==a.retry||n[1]!==t?(o=()=>{i(void 0),a.retry.run(t).catch(e=>i(Wt(e).text))},n[0]=a.retry,n[1]=t,n[2]=o):o=n[2];let s=o,c;return n[3]!==a.retry.waiting||n[4]!==r||n[5]!==s?(c={failure:r,waiting:a.retry.waiting,retry:s},n[3]=a.retry.waiting,n[4]=r,n[5]=s,n[6]=c):c=n[6],c}function Vn(e){let t=(0,Z.c)(6),[n,r]=(0,X.useState)(),i=In(e),a;t[0]===i.add?a=t[1]:(a=(e,t)=>{r(void 0),i.add.run(e).then(t,e=>r(Wt(e).text))},t[0]=i.add,t[1]=a);let o;return t[2]!==i.add.waiting||t[3]!==n||t[4]!==a?(o={failure:n,waiting:i.add.waiting,send:a},t[2]=i.add.waiting,t[3]=n,t[4]=a,t[5]=o):o=t[5],o}function Hn(e){let t=(0,Z.c)(27),{owner:n,message:r,number:i}=e,{notice:a,waiting:o,copy:s,save:c,post:l}=Ln(n,r),u;t[0]===r?u=t[1]:(u=Ht(r),t[0]=r,t[1]=u);let d=u,f=i===void 0?s:l,p;t[2]===i?p=t[3]:(p=Jt(i),t[2]=i,t[3]=p);let m=p,h;t[4]!==r||t[5]!==d?(h=d===`posted`&&r?.post.status===`posted`?(0,Q.jsx)(`a`,{className:`text-caption text-muted-foreground hover:underline`,href:r.post.url,target:`_blank`,rel:`noreferrer`,children:qt(r.post.url)}):null,t[4]=r,t[5]=d,t[6]=h):h=t[6];let g;t[7]!==c||t[8]!==d||t[9]!==o?(g=d===`saved`&&(0,Q.jsxs)(`span`,{className:`flex items-center gap-2 text-caption text-muted-foreground`,children:[`Saved for later`,(0,Q.jsx)(R,{variant:`link`,size:`sm`,disabled:o,onClick:()=>c(!1),children:`Undo`})]}),t[7]=c,t[8]=d,t[9]=o,t[10]=g):g=t[10];let _;t[11]!==f||t[12]!==m||t[13]!==r||t[14]!==c||t[15]!==d||t[16]!==o?(_=d===`available`&&(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsx)(R,{size:`sm`,variant:r?`outline`:`default`,disabled:o,onClick:f,children:r?m.single:m.together}),r&&(0,Q.jsx)(R,{variant:`link`,size:`sm`,disabled:o,onClick:()=>c(!0),children:`Save for later`})]}),t[11]=f,t[12]=m,t[13]=r,t[14]=c,t[15]=d,t[16]=o,t[17]=_):_=t[17];let v;t[18]!==s||t[19]!==a||t[20]!==o?(v=a&&(0,Q.jsxs)(`div`,{role:`status`,className:`text-caption text-muted-foreground`,children:[a.text,a.copy&&(0,Q.jsx)(R,{variant:`link`,size:`sm`,disabled:o,onClick:()=>s(),children:`Copy`})]}),t[18]=s,t[19]=a,t[20]=o,t[21]=v):v=t[21];let y;return t[22]!==h||t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[h,g,_,v]}),t[22]=h,t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26],y}function Un(e){let t=(0,Z.c)(33),{message:n,children:r,owner:i}=e,[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(!1),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>e=>{if(!e)return;let t=()=>c(e.scrollHeight>e.clientHeight);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},t[0]=l):l=t[0];let[u]=(0,X.useState)(l),{failure:d,waiting:f,retry:p}=Bn(i,n.replyTo),m=n.state,h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(Mn,{children:`Walkthrough agent`}),t[1]=h):h=t[1];let g;t[2]!==a||t[3]!==m.status||t[4]!==m.text?(g=m.status===`answered`?(0,Q.jsx)(`span`,{ref:u,className:a?void 0:`line-clamp-3`,children:(0,Q.jsx)($,{text:m.text})}):null,t[2]=a,t[3]=m.status,t[4]=m.text,t[5]=g):g=t[5];let _;t[6]===m.status?_=t[7]:(_=m.status===`answering`&&(0,Q.jsx)(`span`,{role:`status`,className:`text-muted-foreground`,children:`Working…`}),t[6]=m.status,t[7]=_);let v;t[8]!==m.failure||t[9]!==m.status?(v=m.status===`failed`&&(0,Q.jsx)(`span`,{children:m.failure.message}),t[8]=m.failure,t[9]=m.status,t[10]=v):v=t[10];let y;t[11]!==g||t[12]!==_||t[13]!==v?(y=(0,Q.jsx)(Dn,{variant:`ghost`,className:`max-w-full`,children:(0,Q.jsxs)(On,{className:`whitespace-pre-wrap`,children:[g,_,v]})}),t[11]=g,t[12]=_,t[13]=v,t[14]=y):y=t[14];let b;t[15]!==s||t[16]!==a||t[17]!==m.status?(b=m.status===`answered`&&!a&&s&&(0,Q.jsx)(R,{variant:`link`,size:`sm`,onClick:()=>o(!0),children:`Read all`}),t[15]=s,t[16]=a,t[17]=m.status,t[18]=b):b=t[18];let x;t[19]!==p||t[20]!==m.status||t[21]!==f?(x=m.status===`failed`&&(0,Q.jsx)(R,{variant:`link`,size:`sm`,disabled:f,onClick:()=>p(),children:`Try again`}),t[19]=p,t[20]=m.status,t[21]=f,t[22]=x):x=t[22];let S;t[23]!==r||t[24]!==b||t[25]!==x?(S=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[b,x,r]}),t[23]=r,t[24]=b,t[25]=x,t[26]=S):S=t[26];let C;t[27]===d?C=t[28]:(C=d&&(0,Q.jsx)(`p`,{role:`alert`,children:d}),t[27]=d,t[28]=C);let w;return t[29]!==C||t[30]!==y||t[31]!==S?(w=(0,Q.jsx)(An,{children:(0,Q.jsxs)(jn,{children:[h,y,S,C]})}),t[29]=C,t[30]=y,t[31]=S,t[32]=w):w=t[32],w}function Wn({conversation:e,owner:t,number:n}){return Yt(e).map(({message:e,reply:r})=>{let i=(0,Q.jsx)(Hn,{owner:t,message:e,number:n});return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(An,{align:`end`,children:(0,Q.jsx)(jn,{children:(0,Q.jsx)(Dn,{align:`end`,variant:`secondary`,children:(0,Q.jsx)(On,{className:`whitespace-pre-wrap`,children:(0,Q.jsx)($,{text:e.text})})})})}),r?(0,Q.jsx)(Un,{owner:t,message:r,children:i}):(0,Q.jsx)(`div`,{className:`flex justify-end`,children:i})]},e.id)})}function Gn(e){let t=(0,Z.c)(32),{owner:n,anchor:r,placeholder:i}=e,[a,o]=(0,X.useState)(``),{failure:s,waiting:c,send:l}=Vn(n),u;t[0]!==r||t[1]!==a||t[2]!==l||t[3]!==c?(u=()=>{let e=a.trim();e&&!c&&l({anchor:r,text:e},()=>o(e=>e===a?``:e))},t[0]=r,t[1]=a,t[2]=l,t[3]=c,t[4]=u):u=t[4];let d=u,f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>o(e.target.value),t[5]=f):f=t[5];let p;t[6]===d?p=t[7]:(p=e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),d())},t[6]=d,t[7]=p);let m;t[8]!==a||t[9]!==i||t[10]!==p?(m=(0,Q.jsx)(G,{value:a,rows:1,maxLength:8e3,"aria-label":i,placeholder:i,className:`min-h-9`,onChange:f,onKeyDown:p}),t[8]=a,t[9]=i,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==a||t[13]!==c?(h=!a.trim()||c,t[12]=a,t[13]=c,t[14]=h):h=t[14];let g;t[15]===d?g=t[16]:(g=()=>d(),t[15]=d,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(xe,{}),t[17]=_):_=t[17];let v;t[18]!==h||t[19]!==g?(v=(0,Q.jsx)(le,{render:(0,Q.jsx)(be,{size:`icon-xs`,variant:`default`,"aria-label":`Send`,disabled:h,onClick:g,children:_})}),t[18]=h,t[19]=g,t[20]=v):v=t[20];let y;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(N,{children:`Send`}),t[21]=y):y=t[21];let b;t[22]===v?b=t[23]:(b=(0,Q.jsx)(ye,{align:`inline-end`,children:(0,Q.jsxs)(fe,{children:[v,y]})}),t[22]=v,t[23]=b);let x;t[24]!==b||t[25]!==m?(x=(0,Q.jsxs)(K,{children:[m,b]}),t[24]=b,t[25]=m,t[26]=x):x=t[26];let S;t[27]===s?S=t[28]:(S=s&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-caption text-destructive`,children:s}),t[27]=s,t[28]=S);let C;return t[29]!==x||t[30]!==S?(C=(0,Q.jsxs)(Q.Fragment,{children:[x,S]}),t[29]=x,t[30]=S,t[31]=C):C=t[31],C}function Kn(e){let t=(0,Z.c)(22),{owner:n,title:r,call:i}=e,{view:a,failed:o,refresh:s}=Pn(n),[c,l]=(0,X.useState)(!1),u,d,f,p;if(t[0]!==c||t[1]!==i||t[2]!==o||t[3]!==n||t[4]!==s||t[5]!==r||t[6]!==a){let e=Xt(a,r),m=i||c||e.some(qn);u=`flex flex-col gap-3`,t[11]!==c||t[12]!==i?(d=!i&&(0,Q.jsx)(R,{variant:`link`,size:`sm`,className:`self-start`,onClick:()=>l(!c),children:`Ask about this`}),t[11]=c,t[12]=i,t[13]=d):d=t[13],t[14]!==o||t[15]!==s?(f=o&&(0,Q.jsxs)(`p`,{role:`alert`,className:`text-caption`,children:[`Comments could not be read.`,` `,(0,Q.jsx)(R,{variant:`link`,size:`sm`,onClick:s,children:`Try again`})]}),t[14]=o,t[15]=s,t[16]=f):f=t[16],p=m&&(0,Q.jsxs)(Q.Fragment,{children:[e.length>0&&(0,Q.jsx)(`div`,{className:`border-t pt-3`,children:(0,Q.jsx)(kn,{children:e.map(e=>(0,Q.jsx)(Wn,{owner:n,conversation:e,number:a?.pullRequestNumber},e.runId))})}),(0,Q.jsx)(Gn,{owner:n,anchor:{kind:`stop`,title:r},placeholder:i?`Decide, or ask about this`:`Ask about this step`})]}),t[0]=c,t[1]=i,t[2]=o,t[3]=n,t[4]=s,t[5]=r,t[6]=a,t[7]=u,t[8]=d,t[9]=f,t[10]=p}else u=t[7],d=t[8],f=t[9],p=t[10];let m;return t[17]!==u||t[18]!==d||t[19]!==f||t[20]!==p?(m=(0,Q.jsxs)(`div`,{className:u,children:[d,f,p]}),t[17]=u,t[18]=d,t[19]=f,t[20]=p,t[21]=m):m=t[21],m}function qn(e){return e.messages.length>0}function Jn(e){let t=(0,Z.c)(19),{owner:n,titles:r}=e,{view:i}=Pn(n),a,o,s,c,l;if(t[0]!==n||t[1]!==r||t[2]!==i){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Ut(i,r);if(e.length===0){l=null;break bb0}s=`flex flex-col gap-3 border-t pt-5`,t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`h2`,{className:`text-ui font-semibold`,children:`Earlier comments`}),t[8]=c):c=t[8],a=kn;let u;t[9]!==n||t[10]!==i?.pullRequestNumber?(u=(e,t)=>(0,Q.jsx)(Wn,{owner:n,conversation:e,number:i?.pullRequestNumber},`${e.runId}:${t}`),t[9]=n,t[10]=i?.pullRequestNumber,t[11]=u):u=t[11],o=e.map(u)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;t[12]!==a||t[13]!==o?(u=(0,Q.jsx)(a,{children:o}),t[12]=a,t[13]=o,t[14]=u):u=t[14];let d;return t[15]!==s||t[16]!==c||t[17]!==u?(d=(0,Q.jsxs)(`section`,{className:s,children:[c,u]}),t[15]=s,t[16]=c,t[17]=u,t[18]=d):d=t[18],d}function Yn(e){let t=(0,Z.c)(10),{owner:n}=e,{view:r}=Pn(n),i;t[0]===r?i=t[1]:(i=Zt(r),t[0]=r,t[1]=i);let a=i;if(!a)return null;let o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(`span`,{children:a}),t[2]=a,t[3]=o);let s=r?.pullRequestNumber,c;t[4]!==n||t[5]!==s?(c=(0,Q.jsx)(Hn,{owner:n,number:s}),t[4]=n,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==o||t[8]!==c?(l=(0,Q.jsx)(`div`,{className:`sticky bottom-4 z-30 flex justify-center`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-3 rounded-full border bg-popover py-1.5 pr-1.5 pl-4 text-ui shadow-sm`,children:[o,c]})}),t[7]=o,t[8]=c,t[9]=l):l=t[9],l}function Xn(e){let t=(0,Z.c)(12),{label:n,icon:r,disabled:i,onClick:a}=e,o;t[0]!==i||t[1]!==n||t[2]!==a?(o=(0,Q.jsx)(R,{size:`icon-sm`,variant:`ghost`,"aria-label":n,disabled:i,onClick:a}),t[0]=i,t[1]=n,t[2]=a,t[3]=o):o=t[3];let s;t[4]!==r||t[5]!==o?(s=(0,Q.jsx)(le,{render:o,children:r}),t[4]=r,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n?c=t[8]:(c=(0,Q.jsx)(N,{children:n}),t[7]=n,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,Q.jsxs)(fe,{children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function Zn(e){let t=(0,Z.c)(11),{scope:n,context:r,run:i,item:a,className:o,placeholder:s}=e,c;t[0]!==r||t[1]!==a.assetId||t[2]!==i.id||t[3]!==n?(c={scope:n,context:r,runId:i.id,assetId:a.assetId},t[0]=r,t[1]=a.assetId,t[2]=i.id,t[3]=n,t[4]=c):c=t[4];let l=Cn(c);if(z(l)){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`span`,{className:`flex h-56 w-full items-center justify-center rounded-lg border p-3 text-center text-caption text-muted-foreground`,children:`This screenshot could not be loaded.`}),t[5]=e):e=t[5],e}if(!M(l)){let e;return t[6]===s?e=t[7]:(e=(0,Q.jsx)(`span`,{className:`block overflow-hidden rounded-lg border`,children:(0,Q.jsx)(w,{className:s})}),t[6]=s,t[7]=e),e}let u;return t[8]!==o||t[9]!==l.value?(u=(0,Q.jsx)(`img`,{src:l.value,alt:``,loading:`lazy`,decoding:`async`,className:o}),t[8]=o,t[9]=l.value,t[10]=u):u=t[10],u}function Qn(e){let t=(0,Z.c)(34),{scope:n,context:r,run:i,items:o}=e,[s,c]=(0,X.useState)(null),l=s===null?void 0:o[s],u;if(t[0]!==r||t[1]!==o||t[2]!==i||t[3]!==n){let e;t[5]!==r||t[6]!==i||t[7]!==n?(e=(e,t)=>(0,Q.jsxs)(`button`,{type:`button`,"aria-label":`Enlarge screenshot ${t+1}`,onClick:()=>c(t),className:`group flex w-34 shrink-0 flex-col gap-1.5 text-left`,children:[(0,Q.jsx)(Zn,{scope:n,context:r,run:i,item:e,className:`h-56 w-full rounded-lg border object-cover object-top transition-opacity group-hover:opacity-85`,placeholder:`h-56 w-full`}),(0,Q.jsx)(`span`,{className:`line-clamp-3 text-caption leading-4 text-muted-foreground`,children:(0,Q.jsx)($,{text:e.shows})})]},e.assetId),t[5]=r,t[6]=i,t[7]=n,t[8]=e):e=t[8],u=o.map(e),t[0]=r,t[1]=o,t[2]=i,t[3]=n,t[4]=u}else u=t[4];let d;t[9]===u?d=t[10]:(d=(0,Q.jsx)(`div`,{className:`-mx-5 flex gap-3 overflow-x-auto px-5 pb-1 @3xl:-mx-0 @3xl:px-0`,children:u}),t[9]=u,t[10]=d);let f=l!==void 0,p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e||c(null)},t[11]=p):p=t[11];let m;t[12]===l?m=t[13]:(m=l&&(0,Q.jsx)($,{text:l.shows}),t[12]=l,t[13]=m);let h;t[14]===m?h=t[15]:(h=(0,Q.jsx)(je,{children:m}),t[14]=m,t[15]=h);let g;t[16]!==r||t[17]!==i||t[18]!==n||t[19]!==l?(g=l&&(0,Q.jsx)(Zn,{scope:n,context:r,run:i,item:l,className:`mx-auto max-h-[72vh] rounded-lg border`,placeholder:`h-96 w-full`}),t[16]=r,t[17]=i,t[18]=n,t[19]=l,t[20]=g):g=t[20];let _;t[21]!==o.length||t[22]!==s?(_=o.length>1&&s!==null&&(0,Q.jsxs)(`div`,{className:`flex items-center justify-center gap-3 text-caption text-muted-foreground`,children:[(0,Q.jsx)(Xn,{label:`Previous screenshot`,icon:(0,Q.jsx)(it,{}),disabled:s===0,onClick:()=>c(s-1)}),s+1,` of `,o.length,(0,Q.jsx)(Xn,{label:`Next screenshot`,icon:(0,Q.jsx)(a,{}),disabled:s===o.length-1,onClick:()=>c(s+1)})]}),t[21]=o.length,t[22]=s,t[23]=_):_=t[23];let v;t[24]!==h||t[25]!==g||t[26]!==_?(v=(0,Q.jsxs)(Te,{className:`max-h-[92vh] overflow-auto sm:max-w-[min(92vw,52rem)]`,children:[h,g,_]}),t[24]=h,t[25]=g,t[26]=_,t[27]=v):v=t[27];let y;t[28]!==f||t[29]!==v?(y=(0,Q.jsx)(_e,{open:f,onOpenChange:p,children:v}),t[28]=f,t[29]=v,t[30]=y):y=t[30];let b;return t[31]!==y||t[32]!==d?(b=(0,Q.jsxs)(Q.Fragment,{children:[d,y]}),t[31]=y,t[32]=d,t[33]=b):b=t[33],b}var $n=e=>document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`}),er=e=>`walkthrough-step-${e}`;function tr(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`mx-auto flex w-full max-w-180 flex-col gap-10 px-5 py-8 @3xl:px-8 @3xl:py-12`,children:n}),t[0]=n,t[1]=r),r}function nr(e){let t=(0,Z.c)(8),{run:n,content:r}=e,i;t[0]!==r||t[1]!==n?(i=un(n,r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a;t[3]===n?a=t[4]:(a=pn(n)?`\n${pn(n)}`:``,t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,Q.jsxs)(`p`,{className:`whitespace-pre-line font-mono text-caption text-muted-foreground`,children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function rr(e){let t=(0,Z.c)(10),{content:n}=e,r;if(t[0]!==n.title){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\.$/,t[2]=e):e=t[2],r=n.title.replace(e,``),t[0]=n.title,t[1]=r}else r=t[1];let i;t[3]===r?i=t[4]:(i=(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[r,`.`]}),t[3]=r,t[4]=i);let a;t[5]===n?a=t[6]:(a=pt(n),t[5]=n,t[6]=a);let o;return t[7]!==i||t[8]!==a?(o=(0,Q.jsxs)(`h1`,{className:`text-subpage-title font-semibold tracking-tight text-balance @3xl:text-page-title`,children:[i,` `,a]}),t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function ir(e){let t=(0,Z.c)(8),[n,r]=(0,X.useState)(!1),i;t[0]!==e||t[1]!==n?(i=e(n),t[0]=e,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===a.hidden?o=t[4]:(o=a.hidden>0?(0,Q.jsx)(ar,{hidden:a.hidden,onClick:()=>r(!0)}):null,t[3]=a.hidden,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s={...a,more:o},t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function ar(e){let t=(0,Z.c)(3),{hidden:n,onClick:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Q.jsx)(`div`,{className:`-ml-2`,children:(0,Q.jsxs)(R,{variant:`link`,size:`sm`,onClick:r,children:[n,` more`]})}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function or(e){let t=(0,Z.c)(10),{content:n}=e,r;t[0]===n?r=t[1]:(r=e=>cn(n,e),t[0]=n,t[1]=r);let{shown:i,more:a}=ir(r),o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(`h2`,{className:`text-ui font-semibold`,children:`How the system grew`}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=i.map(sr),t[3]=i,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,Q.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:s}),t[5]=s,t[6]=c);let l;return t[7]!==a||t[8]!==c?(l=(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[o,c,a]}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function sr(e,t){return(0,Q.jsxs)(`li`,{className:`grid grid-cols-[1rem_minmax(0,1fr)] text-prose`,children:[(0,Q.jsx)(`span`,{"aria-label":e.change,className:h(`font-mono`,e.change===`added`&&`text-add-fg`,e.change===`removed`&&`text-del-fg`,e.change===`changed`&&`text-muted-foreground`),children:rn(e)}),(0,Q.jsxs)(`span`,{className:`wrap-anywhere`,children:[(0,Q.jsxs)(`span`,{className:`font-medium`,children:[(0,Q.jsx)($,{text:e.what}),`.`]}),` `,(0,Q.jsx)(`span`,{className:`text-foreground-2`,children:(0,Q.jsx)($,{text:e.note})})]})]},`${t}:${e.what}`)}function cr(e){let t=(0,Z.c)(13),{content:n}=e,r;t[0]===n?r=t[1]:(r=e=>ln(n,e),t[0]=n,t[1]=r);let{explained:i,unclear:a,total:o,more:s}=ir(r);if(o===0)return null;let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`h2`,{className:`text-ui font-semibold`,children:`What the code doesn't say`}),t[2]=c):c=t[2];let l;t[3]===i?l=t[4]:(l=i.map(ur),t[3]=i,t[4]=l);let u;t[5]===a?u=t[6]:(u=a.map(lr),t[5]=a,t[6]=u);let d;t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`ul`,{className:`flex flex-col gap-2 text-prose`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==s||t[11]!==d?(f=(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2 border-t pt-5`,children:[c,d,s]}),t[10]=s,t[11]=d,t[12]=f):f=t[12],f}function lr(e,t){return(0,Q.jsx)(`li`,{className:`text-foreground-2`,children:(0,Q.jsx)($,{text:e})},`${t}:${e}`)}function ur(e,t){return(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`span`,{children:(0,Q.jsx)($,{text:e.point})}),` `,(0,Q.jsx)(`span`,{className:`text-foreground-2`,children:(0,Q.jsx)($,{text:e.answer})})]},`${t}:${e.point}`)}function dr(e){let t=(0,Z.c)(12),{content:n,conversation:r}=e,i,a,o,s;if(t[0]!==n||t[1]!==r){s=Symbol.for(`react.early_return_sentinel`);bb0:{let e=ft(n);if(e.length===0){s=null;break bb0}i=`your-calls`,a=`flex scroll-mt-6 flex-col gap-3`;let c;t[6]===r?c=t[7]:(c=e=>{let{attention:t,step:n}=e;return(0,Q.jsxs)(`article`,{className:`flex flex-col gap-3 rounded-xl border bg-card p-4 @3xl:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-caption text-muted-foreground`,children:[(0,Q.jsx)(`span`,{children:tn(t)}),(0,Q.jsxs)(`button`,{type:`button`,className:`hover:text-foreground`,onClick:()=>$n(er(n)),children:[`Step `,n]})]}),(0,Q.jsx)(`h2`,{className:`text-section font-semibold text-pretty`,children:(0,Q.jsx)($,{text:t.question})}),(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:(0,Q.jsx)($,{text:t.note})}),r?.({kind:`call`,step:n})]},n)},t[6]=r,t[7]=c),o=e.map(c)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s}else i=t[2],a=t[3],o=t[4],s=t[5];if(s!==Symbol.for(`react.early_return_sentinel`))return s;let c;return t[8]!==i||t[9]!==a||t[10]!==o?(c=(0,Q.jsx)(`section`,{id:i,className:a,children:o}),t[8]=i,t[9]=a,t[10]=o,t[11]=c):c=t[11],c}function fr(e){let t=(0,Z.c)(30),{stop:n,step:r,run:i,props:a,conversation:o}=e,s;t[0]===r?s=t[1]:(s=er(r),t[0]=r,t[1]=s);let c;t[2]===n.attention?c=t[3]:(c=n.attention&&(0,Q.jsx)(`button`,{type:`button`,className:`ml-2 text-foreground hover:underline`,onClick:pr,children:`Your call`}),t[2]=n.attention,t[3]=c);let l;t[4]!==r||t[5]!==c?(l=(0,Q.jsxs)(`p`,{className:`whitespace-pre-line font-mono text-caption text-muted-foreground`,children:[`Step `,r,c]}),t[4]=r,t[5]=c,t[6]=l):l=t[6];let u;t[7]===n.title?u=t[8]:(u=(0,Q.jsx)(`h2`,{className:`text-lg leading-6 font-semibold text-pretty`,children:(0,Q.jsx)($,{text:n.title})}),t[7]=n.title,t[8]=u);let d;t[9]===n.explanation?d=t[10]:(d=(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:(0,Q.jsx)($,{text:n.explanation})}),t[9]=n.explanation,t[10]=d);let f;t[11]!==a||t[12]!==i||t[13]!==n.evidence?(f=n.evidence.length>0&&(0,Q.jsx)(Qn,{scope:a.scope,context:a.context,run:i,items:n.evidence}),t[11]=a,t[12]=i,t[13]=n.evidence,t[14]=f):f=t[14];let p;t[15]!==a||t[16]!==r||t[17]!==n?(p=mt(n).length>0&&(0,Q.jsx)(`div`,{className:`-ml-2`,children:(0,Q.jsx)(R,{variant:`link`,size:`sm`,"aria-label":`See the code for step ${r}`,onClick:()=>a.onOpen({kind:`walkthrough-step`,step:r}),children:`See the code`})}),t[15]=a,t[16]=r,t[17]=n,t[18]=p):p=t[18];let m;t[19]!==o||t[20]!==r?(m=o?.({kind:`step`,step:r}),t[19]=o,t[20]=r,t[21]=m):m=t[21];let h;return t[22]!==s||t[23]!==l||t[24]!==u||t[25]!==d||t[26]!==f||t[27]!==p||t[28]!==m?(h=(0,Q.jsxs)(`li`,{id:s,className:`flex scroll-mt-6 flex-col gap-2.5 border-t pt-5`,children:[l,u,d,f,p,m]}),t[22]=s,t[23]=l,t[24]=u,t[25]=d,t[26]=f,t[27]=p,t[28]=m,t[29]=h):h=t[29],h}function pr(){return $n(`your-calls`)}function mr(e){let t=(0,Z.c)(98),{run:n,content:r,outOfDate:i,props:a,onUpdate:o,updating:s,updateFailure:c}=e,l;t[0]!==a||t[1]!==n.id?(l={...a,runId:n.id},t[0]=a,t[1]=n.id,t[2]=l):l=t[2];let u=l,d;t[3]!==r.stops||t[4]!==u?(d=e=>{let{kind:t,step:n}=e,i=r.stops[n-1].title;return(0,Q.jsx)(Kn,{owner:u,title:i,call:t===`call`},i)},t[3]=r.stops,t[4]=u,t[5]=d):d=t[5];let f=d,p;t[6]===i?p=t[7]:(p=i&&(0,Q.jsx)(`span`,{children:`The work changed after this was written.`}),t[6]=i,t[7]=p);let m;t[8]===o?m=t[9]:(m=(0,Q.jsx)(R,{size:`sm`,variant:`outline`,onClick:o,children:`Update walkthrough`}),t[8]=o,t[9]=m);let h;t[10]!==p||t[11]!==m?(h=(0,Q.jsxs)(Q.Fragment,{children:[p,m]}),t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=h;if(s){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`span`,{role:`status`,children:`Updating…`}),t[13]=e):e=t[13],g=e}else if(c){let e;t[14]!==c.failure||t[15]!==c.writer?(e=bt(c.failure,c.writer),t[14]=c.failure,t[15]=c.writer,t[16]=e):e=t[16];let n=c.failure.kind!==`signed_out`&&` ${c.failure.message}`,r;t[17]!==e.title||t[18]!==n?(r=(0,Q.jsxs)(`span`,{role:`alert`,children:[e.title,n]}),t[17]=e.title,t[18]=n,t[19]=r):r=t[19];let i;t[20]===o?i=t[21]:(i=(0,Q.jsx)(R,{size:`sm`,variant:`outline`,onClick:o,children:`Try again`}),t[20]=o,t[21]=i);let a;t[22]!==r||t[23]!==i?(a=(0,Q.jsxs)(Q.Fragment,{children:[r,i]}),t[22]=r,t[23]=i,t[24]=a):a=t[24],g=a}let _;t[25]===g?_=t[26]:(_=(0,Q.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-ui text-foreground-2`,children:g}),t[25]=g,t[26]=_);let v=_;if(r.outcome===`nothing`){let e;t[27]!==r||t[28]!==n?(e=(0,Q.jsx)(nr,{run:n,content:r}),t[27]=r,t[28]=n,t[29]=e):e=t[29];let o;t[30]===r?o=t[31]:(o=(0,Q.jsx)(rr,{content:r}),t[30]=r,t[31]=o);let l;t[32]===r.summary?l=t[33]:(l=(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:(0,Q.jsx)($,{text:r.summary})}),t[32]=r.summary,t[33]=l);let d=(i||n.evidenceUnavailable||s||c)&&v,f;t[34]===a?f=t[35]:(f=(0,Q.jsx)(`div`,{className:`-ml-2`,children:(0,Q.jsx)(R,{variant:`link`,size:`sm`,onClick:()=>a.onOpen({kind:`walkthrough-changes`}),children:`See the change`})}),t[34]=a,t[35]=f);let p;t[36]!==d||t[37]!==f||t[38]!==e||t[39]!==o||t[40]!==l?(p=(0,Q.jsxs)(`header`,{className:`flex flex-col gap-3`,children:[e,o,l,d,f]}),t[36]=d,t[37]=f,t[38]=e,t[39]=o,t[40]=l,t[41]=p):p=t[41];let m;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],t[42]=m):m=t[42];let h,g;t[43]===u?(h=t[44],g=t[45]):(h=(0,Q.jsx)(Jn,{owner:u,titles:m}),g=(0,Q.jsx)(Yn,{owner:u}),t[43]=u,t[44]=h,t[45]=g);let _;return t[46]!==p||t[47]!==h||t[48]!==g?(_=(0,Q.jsxs)(tr,{children:[p,h,g]}),t[46]=p,t[47]=h,t[48]=g,t[49]=_):_=t[49],_}let y;t[50]!==r||t[51]!==n?(y=(0,Q.jsx)(nr,{run:n,content:r}),t[50]=r,t[51]=n,t[52]=y):y=t[52];let b;t[53]===r?b=t[54]:(b=(0,Q.jsx)(rr,{content:r}),t[53]=r,t[54]=b);let x;t[55]===r.summary?x=t[56]:(x=(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:(0,Q.jsx)($,{text:r.summary})}),t[55]=r.summary,t[56]=x);let S=(i||n.evidenceUnavailable||s||c)&&v,C;t[57]!==S||t[58]!==y||t[59]!==b||t[60]!==x?(C=(0,Q.jsxs)(`header`,{className:`flex flex-col gap-3`,children:[y,b,x,S]}),t[57]=S,t[58]=y,t[59]=b,t[60]=x,t[61]=C):C=t[61];let w;t[62]!==r||t[63]!==f?(w=(0,Q.jsx)(dr,{content:r,conversation:f}),t[62]=r,t[63]=f,t[64]=w):w=t[64];let T;t[65]===r?T=t[66]:(T=r.growth.length>0&&(0,Q.jsx)(or,{content:r}),t[65]=r,t[66]=T);let E;if(t[67]!==r.stops||t[68]!==f||t[69]!==a||t[70]!==n){let e;t[72]!==f||t[73]!==a||t[74]!==n?(e=(e,t)=>(0,Q.jsx)(fr,{stop:e,step:t+1,run:n,props:a,conversation:f},t),t[72]=f,t[73]=a,t[74]=n,t[75]=e):e=t[75],E=r.stops.map(e),t[67]=r.stops,t[68]=f,t[69]=a,t[70]=n,t[71]=E}else E=t[71];let D;t[76]===E?D=t[77]:(D=(0,Q.jsx)(`ol`,{className:`flex flex-col gap-10`,children:E}),t[76]=E,t[77]=D);let O;t[78]===r?O=t[79]:(O=(0,Q.jsx)(cr,{content:r}),t[78]=r,t[79]=O);let k;t[80]===r.stops?k=t[81]:(k=r.stops.map(hr),t[80]=r.stops,t[81]=k);let A;t[82]!==u||t[83]!==k?(A=(0,Q.jsx)(Jn,{owner:u,titles:k}),t[82]=u,t[83]=k,t[84]=A):A=t[84];let ee;t[85]===a?ee=t[86]:(ee=(0,Q.jsx)(`footer`,{className:`border-t pt-5`,children:(0,Q.jsx)(`div`,{className:`-ml-2`,children:(0,Q.jsx)(R,{variant:`link`,size:`sm`,onClick:()=>a.onOpen({kind:`walkthrough-changes`}),children:`See every changed file`})})}),t[85]=a,t[86]=ee);let j;t[87]===u?j=t[88]:(j=(0,Q.jsx)(Yn,{owner:u}),t[87]=u,t[88]=j);let M;return t[89]!==C||t[90]!==w||t[91]!==T||t[92]!==D||t[93]!==O||t[94]!==A||t[95]!==ee||t[96]!==j?(M=(0,Q.jsxs)(tr,{children:[C,w,T,D,O,A,ee,j]}),t[89]=C,t[90]=w,t[91]=T,t[92]=D,t[93]=O,t[94]=A,t[95]=ee,t[96]=j,t[97]=M):M=t[97],M}function hr(e){return e.title}function gr(e){let t=(0,Z.c)(6),{waiting:n,onWrite:r}=e,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(`h1`,{className:`text-subpage-title font-semibold tracking-tight @3xl:text-page-title`,children:`No walkthrough yet.`}),a=(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:`A fresh agent reads this change and explains it. It never edits the code.`}),t[0]=i,t[1]=a):(i=t[0],a=t[1]);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(nt,{"data-icon":`inline-start`}),t[2]=o):o=t[2];let s;return t[3]!==r||t[4]!==n?(s=(0,Q.jsx)(tr,{children:(0,Q.jsxs)(`header`,{className:`flex flex-col items-start gap-3`,children:[i,a,(0,Q.jsxs)(R,{disabled:n,onClick:r,children:[o,`Write walkthrough`]})]})}),t[3]=r,t[4]=n,t[5]=s):s=t[5],s}function _r(e){let t=(0,Z.c)(7),{run:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(nr,{run:n}),t[0]=n,t[1]=r);let i,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 text-prose text-foreground-2`,children:[(0,Q.jsx)(A,{}),`Reading the change`]}),a=(0,Q.jsx)(w,{className:`h-9 w-4/5`}),o=(0,Q.jsx)(w,{className:`h-20 w-full`}),t[2]=i,t[3]=a,t[4]=o):(i=t[2],a=t[3],o=t[4]);let s;return t[5]===r?s=t[6]:(s=(0,Q.jsx)(tr,{children:(0,Q.jsxs)(`header`,{role:`status`,className:`flex flex-col gap-3`,children:[r,i,a,o]})}),t[5]=r,t[6]=s),s}function vr(e){let t=(0,Z.c)(14),{run:n,failure:r,waiting:i,onRetry:a}=e,o;t[0]!==r||t[1]!==n?(o=dn(r,n),t[0]=r,t[1]=n,t[2]=o):o=t[2];let s=o,c;t[3]===s.title?c=t[4]:(c=(0,Q.jsx)(`h1`,{className:`text-subpage-title font-semibold tracking-tight`,children:s.title}),t[3]=s.title,t[4]=c);let l;t[5]===s.message?l=t[6]:(l=s.message&&(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:s.message}),t[5]=s.message,t[6]=l);let u;t[7]!==a||t[8]!==i?(u=(0,Q.jsx)(R,{disabled:i,onClick:a,children:`Try again`}),t[7]=a,t[8]=i,t[9]=u):u=t[9];let d;return t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,Q.jsx)(tr,{children:(0,Q.jsxs)(`header`,{className:`flex flex-col items-start gap-3`,children:[c,l,u]})}),t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function yr(e){let t=(0,Z.c)(11),{result:n,phase:i,refresh:a}=gn(e.scope,e.context),o=wn(e.scope,e.context,e.base,i&&i.kind!==`unwritten`?i.run:void 0);if(i===void 0){let e;return t[0]!==a||t[1]!==n?(e=z(n)?(0,Q.jsx)(x,{description:`The walkthrough could not be read.`,onRetry:a}):(0,Q.jsx)(r,{label:`Loading walkthrough`}),t[0]=a,t[1]=n,t[2]=e):e=t[2],e}let s;t[3]!==i||t[4]!==e||t[5]!==o?(s=()=>{let t=o.failure&&(i.kind===`unwritten`||i.kind===`failed`)?o.failure:void 0;if(t)return(0,Q.jsx)(vr,{run:i.kind===`failed`?i.run:void 0,failure:t,waiting:o.waiting,onRetry:o.start});switch(i.kind){case`unwritten`:return(0,Q.jsx)(gr,{waiting:o.waiting,onWrite:o.start});case`writing`:return(0,Q.jsx)(_r,{run:i.run});case`failed`:return(0,Q.jsx)(vr,{run:i.run,failure:i.failure,waiting:o.waiting,onRetry:o.start});case`ready`:{let t=fn(i,o);return(0,Q.jsx)(mr,{run:i.run,content:i.content,outOfDate:i.outOfDate,props:e,onUpdate:o.start,updating:t.updating,updateFailure:t.failure},i.run.id)}}},t[3]=i,t[4]=e,t[5]=o,t[6]=s):s=t[6];let c=s,l;t[7]===c?l=t[8]:(l=c(),t[7]=c,t[8]=l);let u;return t[9]===l?u=t[10]:(u=(0,Q.jsx)(`div`,{className:`@container h-full overflow-auto`,children:l}),t[9]=l,t[10]=u),u}function br(e){let t=(0,Z.c)(14),{steps:n,activeEntry:r,onOpen:i,row:a}=e,[o,s]=(0,X.useState)(null);if(n.length===0)return null;let c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`p`,{className:`px-2 pt-2 pb-1 text-2xs text-muted-foreground`,children:`By step`}),t[0]=c):c=t[0];let l;if(t[1]!==r||t[2]!==i||t[3]!==o||t[4]!==a||t[5]!==n){let e;t[7]!==r||t[8]!==i||t[9]!==o||t[10]!==a?(e=e=>{let{stop:t,step:n,files:c}=e,l={kind:`walkthrough-step`,step:n},u=r===Ke(l);return(0,Q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Q.jsxs)(Y,{plain:!0,label:`Step ${n}`,active:u,onOpen:()=>{s(n),i(l)},children:[(0,Q.jsx)(`span`,{className:`w-3.5 shrink-0 text-center font-mono text-2xs text-muted-foreground`,children:n}),(0,Q.jsx)(he,{className:`min-w-0 flex-1`,text:Et(t.title)}),t.attention&&(0,Q.jsx)(`span`,{role:`img`,"aria-label":`Your call`,className:`size-1.5 shrink-0 rounded-full bg-foreground`}),(0,Q.jsx)(`span`,{className:`ml-auto text-2xs text-muted-foreground tabular-nums`,children:c.length})]}),(o===n||u)&&(0,Q.jsx)(`div`,{className:`pl-3`,children:c.map(a)})]},n)},t[7]=r,t[8]=i,t[9]=o,t[10]=a,t[11]=e):e=t[11],l=n.map(e),t[1]=r,t[2]=i,t[3]=o,t[4]=a,t[5]=n,t[6]=l}else l=t[6];let u;return t[12]===l?u=t[13]:(u=(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-col`,children:[c,l]}),t[12]=l,t[13]=u),u}function xr(e){let t=(0,Z.c)(6),{files:n,row:r}=e;if(n.length===0)return null;let i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(`p`,{className:`px-2 pt-2 pb-1 text-2xs text-muted-foreground`,children:`Not in the walkthrough yet`}),t[0]=i):i=t[0];let a;t[1]!==n||t[2]!==r?(a=n.map(r),t[1]=n,t[2]=r,t[3]=a):a=t[3];let o;return t[4]===a?o=t[5]:(o=(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-col`,children:[i,a]}),t[4]=a,t[5]=o),o}function Sr(e){let t=(0,Z.c)(22),{scope:n,context:r,items:i,row:a,activeEntry:o,onOpen:s}=e,c=_n(n,r);if(!c||c.content.stops.length===0){let e;t[0]!==i||t[1]!==a?(e=i.map(a),t[0]=i,t[1]=a,t[2]=e):e=t[2];let n;return t[3]===e?n=t[4]:(n=(0,Q.jsx)(Q.Fragment,{children:e}),t[3]=e,t[4]=n),n}let l,u,d;t[5]!==i||t[6]!==c.content?(u=_t(c.content,i),l=br,d=u.steps.filter(Cr),t[5]=i,t[6]=c.content,t[7]=l,t[8]=u,t[9]=d):(l=t[7],u=t[8],d=t[9]);let f;t[10]!==l||t[11]!==o||t[12]!==s||t[13]!==a||t[14]!==d?(f=(0,Q.jsx)(l,{steps:d,activeEntry:o,onOpen:s,row:a}),t[10]=l,t[11]=o,t[12]=s,t[13]=a,t[14]=d,t[15]=f):f=t[15];let p;t[16]!==u.outside||t[17]!==a?(p=(0,Q.jsx)(xr,{files:u.outside,row:a}),t[16]=u.outside,t[17]=a,t[18]=p):p=t[18];let m;return t[19]!==f||t[20]!==p?(m=(0,Q.jsxs)(Q.Fragment,{children:[f,p]}),t[19]=f,t[20]=p,t[21]=m):m=t[21],m}function Cr(e){return e.files.length>0}function wr(e){let t=(0,Z.c)(38),{scope:n,context:r,base:i,paths:a,row:o,activeEntry:s,onOpen:c}=e,l=_n(n,r),u=vn(n,r,i);if(a.length===0){let e=l?`Nothing uncommitted.`:`No changes`,n;return t[0]===e?n=t[1]:(n=(0,Q.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:e}),t[0]=e,t[1]=n),n}let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=Ke(Ye),t[2]=d):d=t[2];let f=s===d,p;t[3]===c?p=t[4]:(p=()=>c(Ye),t[3]=c,t[4]=p);let m,h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(ve,{className:`size-3.5 shrink-0 text-muted-foreground`}),h=(0,Q.jsx)(`span`,{className:`min-w-0 flex-1`,children:`All changes`}),t[5]=m,t[6]=h):(m=t[5],h=t[6]);let g;t[7]===a.length?g=t[8]:(g=(0,Q.jsx)(`span`,{className:`ml-auto text-2xs text-muted-foreground tabular-nums`,children:a.length}),t[7]=a.length,t[8]=g);let _;t[9]!==f||t[10]!==p||t[11]!==g?(_=(0,Q.jsxs)(Y,{plain:!0,label:`All changes`,active:f,onOpen:p,children:[m,h,g]}),t[9]=f,t[10]=p,t[11]=g,t[12]=_):_=t[12];let v=_;if(!l||l.content.stops.length===0){let e;t[13]!==a||t[14]!==o?(e=a.map(o),t[13]=a,t[14]=o,t[15]=e):e=t[15];let n;return t[16]!==v||t[17]!==e?(n=(0,Q.jsxs)(`div`,{className:`flex flex-col`,children:[v,e]}),t[16]=v,t[17]=e,t[18]=n):n=t[18],n}let y,b;if(t[19]!==a||t[20]!==l.content||t[21]!==u){let e=a.map(Er);y=_t(l.content,e,u),b=y.steps.filter(Tr),t[19]=a,t[20]=l.content,t[21]=u,t[22]=y,t[23]=b}else y=t[22],b=t[23];let x=b,S;t[24]!==s||t[25]!==c||t[26]!==o||t[27]!==x?(S=x.length>0&&(0,Q.jsx)(br,{steps:x,activeEntry:s,onOpen:c,row:e=>o(e.path)}),t[24]=s,t[25]=c,t[26]=o,t[27]=x,t[28]=S):S=t[28];let C;t[29]===o?C=t[30]:(C=e=>o(e.path),t[29]=o,t[30]=C);let w;t[31]!==y.outside||t[32]!==C?(w=(0,Q.jsx)(xr,{files:y.outside,row:C}),t[31]=y.outside,t[32]=C,t[33]=w):w=t[33];let T;return t[34]!==v||t[35]!==w||t[36]!==S?(T=(0,Q.jsxs)(`div`,{className:`flex flex-col`,children:[v,S,w]}),t[34]=v,t[35]=w,t[36]=S,t[37]=T):T=t[37],T}function Tr(e){return e.files.length>0}function Er(e){return{path:e}}var Dr={branch:Sr,uncommitted:wr};function Or(e){let t=(0,Z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Q.jsx)(qe,{...e,grouping:Dr}),t[0]=e,t[1]=n),n}function kr(e){let t=(0,Z.c)(45),n,r;t[0]===e?(n=t[1],r=t[2]):({document:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=_n(r.scope,r.context),o=vn(r.scope,r.context,r.base),s=n.kind===`walkthrough-step`?n.step:void 0,c=s===void 0?void 0:i?.content.stops[s-1];if(!i||n.kind===`walkthrough-step`&&!c){let e;return t[3]===r?e=t[4]:(e=(0,Q.jsx)(ge,{title:`This step isn't available`,description:`The walkthrough changed since this tab was opened. Open the Walkthrough tab for the current steps.`,children:(0,Q.jsx)(R,{variant:`outline`,onClick:()=>r.onOpen({kind:`walkthrough`}),children:`Open walkthrough`})}),t[3]=r,t[4]=e),e}if(s===void 0||c===void 0){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e={title:`All changes`,titleLabel:`All changes`},t[5]=e):e=t[5];let n;return t[6]===r?n=t[7]:(n=(0,Q.jsx)(Ar,{...r,heading:e}),t[6]=r,t[7]=n),n}let l=i.content.stops.length,u=`Step ${s} of ${l}`,d;t[8]===u?d=t[9]:(d=(0,Q.jsx)(`span`,{className:`mr-2 font-normal text-muted-foreground`,children:u}),t[8]=u,t[9]=d);let f;t[10]===c.title?f=t[11]:(f=(0,Q.jsx)($,{text:c.title}),t[10]=c.title,t[11]=f);let p;t[12]!==d||t[13]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[d,f]}),t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;t[15]===c.title?m=t[16]:(m=Et(c.title),t[15]=c.title,t[16]=m);let h=`${u}: ${m}`,g;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(it,{}),t[17]=g):g=t[17];let _=s===1,v;t[18]!==r||t[19]!==s?(v=()=>r.onOpen({kind:`walkthrough-step`,step:s-1}),t[18]=r,t[19]=s,t[20]=v):v=t[20];let y;t[21]!==_||t[22]!==v?(y=(0,Q.jsx)(Xn,{label:`Previous step`,icon:g,disabled:_,onClick:v}),t[21]=_,t[22]=v,t[23]=y):y=t[23];let b;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(a,{}),t[24]=b):b=t[24];let x=s===l,S;t[25]!==r||t[26]!==s?(S=()=>r.onOpen({kind:`walkthrough-step`,step:s+1}),t[25]=r,t[26]=s,t[27]=S):S=t[27];let C;t[28]!==x||t[29]!==S?(C=(0,Q.jsx)(Xn,{label:`Next step`,icon:b,disabled:x,onClick:S}),t[28]=x,t[29]=S,t[30]=C):C=t[30];let w;t[31]!==C||t[32]!==y?(w=(0,Q.jsxs)(`span`,{className:`flex items-center`,children:[y,C]}),t[31]=C,t[32]=y,t[33]=w):w=t[33];let T;t[34]!==w||t[35]!==p||t[36]!==h?(T={title:p,titleLabel:h,after:w},t[34]=w,t[35]=p,t[36]=h,t[37]=T):T=t[37];let E=T,D;t[38]!==o||t[39]!==c?(D=mt(c,o),t[38]=o,t[39]=c,t[40]=D):D=t[40];let O=D,k;return t[41]!==E||t[42]!==O||t[43]!==r?(k=(0,Q.jsx)(Ar,{...r,only:O,heading:E}),t[41]=E,t[42]=O,t[43]=r,t[44]=k):k=t[44],k}function Ar(e){let t=(0,Z.c)(9),n=Ce(e.scope,e.context.connection),[r,i]=(0,X.useState)(`branch`),a;t[0]!==n.changes||t[1]!==r||t[2]!==e?(a=t=>{let{branch:a,worktree:o}=Ot({branch:t.files,worktree:n.changes,only:e.only}),s=a.length>0&&o.length>0,c=t=>({...e.interaction,active:e.interaction.active&&(!s||r===t),toolbarTarget:s&&r!==t?null:e.interaction.toolbarTarget,entry:s?`${e.interaction.entry}:${t}`:e.interaction.entry});return(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[s&&(0,Q.jsx)(tt,{inline:!0,title:e.heading.title,titleLabel:e.heading.titleLabel,children:e.heading.after}),(0,Q.jsxs)(`div`,{className:s?`min-h-0 flex-1 overflow-auto`:`flex min-h-0 flex-1 flex-col`,children:[a.length>0&&(0,Q.jsx)(`section`,{"aria-label":`Branch code`,className:`flex min-h-0 flex-1 flex-col`,onFocusCapture:()=>i(`branch`),onPointerDownCapture:()=>i(`branch`),children:(0,Q.jsx)(Je,{...e,only:a,fullHeight:s,interaction:c(`branch`),heading:s?{title:`Branch`,titleLabel:`Branch`}:e.heading})}),o.length>0&&(0,Q.jsx)(`section`,{"aria-label":`Uncommitted code`,className:`flex min-h-0 flex-1 flex-col`,onFocusCapture:()=>i(`uncommitted`),onPointerDownCapture:()=>i(`uncommitted`),children:(0,Q.jsx)(He,{...e,only:o,fullHeight:s,interaction:c(`uncommitted`),heading:s?{title:`Uncommitted`,titleLabel:`Uncommitted`}:e.heading})}),a.length===0&&o.length===0&&(0,Q.jsx)(ge,{title:`No changed files`,description:`These files no longer have changes in the branch or working tree.`})]})]})},t[0]=n.changes,t[1]=r,t[2]=e,t[3]=a):a=t[3];let o;return t[4]!==e.base||t[5]!==e.context||t[6]!==e.scope||t[7]!==a?(o=(0,Q.jsx)(Ue,{scope:e.scope,context:e.context,base:e.base,children:a}),t[4]=e.base,t[5]=e.context,t[6]=e.scope,t[7]=a,t[8]=o):o=t[8],o}function jr(e){let t=(0,Z.c)(9),n;t[0]!==e.projectId||t[1]!==e.worktree.id?(n={projectId:e.projectId,worktreeId:e.worktree.id},t[0]=e.projectId,t[1]=e.worktree.id,t[2]=n):n=t[2];let r;t[3]===e?r=t[4]:(r=(0,Q.jsx)(Mr,{...e}),t[3]=e,t[4]=r);let i;return t[5]!==e.context.connection||t[6]!==n||t[7]!==r?(i=(0,Q.jsx)(et,{connection:e.context.connection,scope:n,children:r}),t[5]=e.context.connection,t[6]=n,t[7]=r,t[8]=i):i=t[8],i}function Mr(e){let t=(0,Z.c)(15),n;t[0]!==e.projectId||t[1]!==e.worktree.id?(n={projectId:e.projectId,worktreeId:e.worktree.id},t[0]=e.projectId,t[1]=e.worktree.id,t[2]=n):n=t[2];let r=n,i=bn(r,e.context),a=i.name===`walkthrough`,o=yn(r,e.context),s=a||e.search.entry===`walkthrough`?o:`Changes`,c;t[3]!==e.worktree.id||t[4]!==s?(c=Qe({worktreeId:e.worktree.id,title:s}),t[3]=e.worktree.id,t[4]=s,t[5]=c):c=t[5],m(c);let l=a?`Walkthrough`:void 0,u;t[6]!==l||t[7]!==i.companion||t[8]!==i.guided||t[9]!==i.pending?(u={title:l,pending:i.pending,guided:i.guided,companion:i.companion},t[6]=l,t[7]=i.companion,t[8]=i.guided,t[9]=i.pending,t[10]=u):u=t[10];let d=u,f=i.guided?Or:qe,p;return t[11]!==d||t[12]!==e||t[13]!==f?(p=(0,Q.jsx)(Ze,{...e,walkthrough:yr,changesNavigation:f,walkthroughCode:kr,firstDocument:d}),t[11]=d,t[12]=e,t[13]=f,t[14]=p):p=t[14],p}function Nr(e){let t=(0,Z.c)(2),n;t[0]===e?n=t[1]:(n=_(e),t[0]=e,t[1]=n),m(n)}function Pr(e){let t=(0,Z.c)(7),{icon:n,tone:r}=e,i=(r===void 0?`default`:r)===`destructive`?`bg-destructive/10 text-destructive`:`bg-muted text-foreground`,a;t[0]===i?a=t[1]:(a=h(`grid size-10 shrink-0 place-items-center rounded-xl`,i),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,Q.jsx)(n,{className:`size-5`}),t[2]=n,t[3]=o);let s;return t[4]!==a||t[5]!==o?(s=(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:a,children:o}),t[4]=a,t[5]=o,t[6]=s):s=t[6],s}function Fr(e){let t=(0,Z.c)(4),{keys:n}=e,r;t[0]===n?r=t[1]:(r=n.split(`+`).map(Ir),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(q,{children:r}),t[2]=r,t[3]=i),i}function Ir(e){return(0,Q.jsx)(U,{className:`min-w-6 justify-center`,children:J(e)},e)}function Lr(e){let t=(0,Z.c)(6),{open:n,onOpenChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Pr,{icon:W}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(Ae,{className:`flex-row items-center text-left`,children:[i,(0,Q.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(je,{children:`Keyboard shortcuts`}),(0,Q.jsx)(Me,{children:`None of them fire while you are typing.`})]})]}),t[1]=a):a=t[1];let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsxs)(Te,{className:`max-h-[85svh] grid-rows-[auto_minmax(0,1fr)] overflow-hidden sm:max-w-xl`,children:[a,(0,Q.jsx)(Se,{className:`-mr-3 min-h-0`,children:(0,Q.jsx)(`div`,{className:`flex flex-col gap-5 pr-3`,children:Le.map(Rr)})})]}),t[2]=o):o=t[2];let s;return t[3]!==r||t[4]!==n?(s=(0,Q.jsx)(_e,{open:n,onOpenChange:r,children:o}),t[3]=r,t[4]=n,t[5]=s):s=t[5],s}function Rr(e){return(0,Q.jsxs)(`section`,{"aria-labelledby":`shortcuts-${e.title}`,children:[(0,Q.jsx)(`h3`,{id:`shortcuts-${e.title}`,className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e.title}),(0,Q.jsx)(`dl`,{className:`divide-y rounded-xl border`,children:e.items.map(zr)})]},e.title)}function zr(e){return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 px-3 py-2`,children:[(0,Q.jsx)(`dt`,{className:`text-sm`,children:e.label}),(0,Q.jsx)(`dd`,{className:`shrink-0`,children:(0,Q.jsx)(Fr,{keys:e.keys})})]},e.keys)}var Br={"not-found":{title:`Page not found`,description:`This URL does not open a page in Porcelain.`,icon:ot},"missing-worktree":{title:`Worktree not found`,description:`This URL has an invalid or unavailable worktree ID.`,icon:ct},empty:{title:`Select a worktree`,description:`Choose one on the left to open its review.`,icon:ve}};function Vr(e){let t=(0,Z.c)(111),{review:r,remote:i,unavailable:a,notice:o,children:s,settingsOpen:c}=e,l=c!==void 0&&c,d=Fe(),[m,g]=(0,X.useState)(!1),[_,v]=(0,X.useState)(!1),{setOpenMobile:x,isMobile:S,open:C,openMobile:w}=re(),T;t[0]===x?T=t[1]:(T=(e,t)=>{g(!e&&t.reason===`escape-key`),x(e)},t[0]=x,t[1]=T);let E;t[2]!==d||t[3]!==m?(E=e=>{!e&&m&&(g(!1),d.element?.focus())},t[2]=d,t[3]=m,t[4]=E):E=t[4];let k;t[5]!==T||t[6]!==E?(k={onOpenChange:T,onOpenChangeComplete:E},t[5]=T,t[6]=E,t[7]=k):k=t[7];let A=k,j=D(),M=b(),ne=y(),N=Ee(ne.connection),P,F,I,L,ie;if(t[8]!==N||t[9]!==o){L=te(N,O(N)?.id),F=!o&&N.projects.length===0;let e;t[15]!==F||t[16]!==o?(e=F?{title:`Open your first project`,description:`Open a Git repository to see its worktrees and review changes.`,icon:ve}:Br[o??`empty`],t[15]=F,t[16]=o,t[17]=e):e=t[17],I=e,P=I.icon,ie=se(L?.worktree.branch||void 0),t[8]=N,t[9]=o,t[10]=P,t[11]=F,t[12]=I,t[13]=L,t[14]=ie}else P=t[10],F=t[11],I=t[12],L=t[13],ie=t[14];let oe=ie;ae();let z=y(i?.connection),ce=i?.remote.environmentId??null,le;t[18]!==r||t[19]!==ce?(le=r&&{remote:ce,projectId:r.selection.projectId,worktreeId:r.selection.worktree.id},t[18]=r,t[19]=ce,t[20]=le):le=t[20];let B=le,ue=r?.selection.worktree.id??``,de;t[21]===ue?de=t[22]:(de=We(ue),t[21]=ue,t[22]=de);let fe=u(de),pe;t[23]!==fe||t[24]!==i||t[25]!==r?(pe=r?Ge({firstDocument:fe,entry:r.search.entry,surface:r.search.surface,project:r.inventory.projects.find(e=>e.id===r.selection.projectId)?.name,environment:i||r.inventory.environment.custom?r.inventory.environment.name:void 0}):`Porcelain`,t[23]=fe,t[24]=i,t[25]=r,t[26]=pe):pe=t[26],Nr(pe);let me;t[27]!==j||t[28]!==r?(me=e=>j({...$e(e),replace:r===void 0}),t[27]=j,t[28]=r,t[29]=me):me=t[29];let V=me,H=Xe(ne.connection,V),_e;t[30]!==j||t[31]!==x?(_e=e=>{let t=e===void 0?ke:e;x(!1),j({to:`/settings/$section`,params:{section:t}})},t[30]=j,t[31]=x,t[32]=_e):_e=t[32];let U=_e,W;t[33]!==ne.connection||t[34]!==j||t[35]!==r?.search||t[36]!==x||t[37]!==B?(W=e=>{if(e.pullRequest.state!==`available`||!e.pullRequest.number)return;let t=Ke({kind:`pull-request`,projectId:e.projectId,number:e.pullRequest.number,environmentId:e.environmentId});x(!1);let n=B??(e.worktreeId?{remote:e.environmentId===ne.connection.environmentId?null:e.environmentId,projectId:e.projectId,worktreeId:e.worktreeId}:void 0);n&&j({...$e(n),search:{...r?.search??{},entry:t}})},t[33]=ne.connection,t[34]=j,t[35]=r?.search,t[36]=x,t[37]=B,t[38]=W):W=t[38];let G;t[39]===H?G=t[40]:(G=e=>e?we.openWithPayload({remote:e.remote.environmentId}):H(),t[39]=H,t[40]=G);let K;t[41]===U?K=t[42]:(K=()=>U(),t[41]=U,t[42]=K);let ye;t[43]!==j||t[44]!==x?(ye=e=>{x(!1),j({to:`/settings/$section/$environmentId`,params:{section:`computers`,environmentId:e}})},t[43]=j,t[44]=x,t[45]=ye):ye=t[45];let be;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(be=()=>v(!0),t[46]=be):be=t[46];let xe;t[47]!==l||t[48]!==B||t[49]!==void 0||t[50]!==W||t[51]!==G||t[52]!==K||t[53]!==ye?(xe={settingsOpen:l,remotes:void 0,selected:B,onOpenPullRequest:W,onOpenProject:G,onOpenSettings:K,onOpenRemotes:ye,onOpenShortcuts:be},t[47]=l,t[48]=B,t[49]=void 0,t[50]=W,t[51]=G,t[52]=K,t[53]=ye,t[54]=xe):xe=t[54];let q=xe,Se;t[55]!==j||t[56]!==M||t[57]!==B?(Se=(e,t)=>{if(!B)return;let n=$e(B);M.buildLocation({}).pathname===M.buildLocation(n).pathname&&j({...n,search:t=>({...t,...e}),...t})},t[55]=j,t[56]=M,t[57]=B,t[58]=Se):Se=t[58];let Ce=Se,Te;t[59]===U?Te=t[60]:(Te=()=>U(),t[59]=U,t[60]=Te);let De;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(De={ignoreInputs:!0},t[61]=De):De=t[61],Be(ze.openSettings,Te,De);let Ae,je;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=()=>v(!0),je={ignoreInputs:!0},t[62]=Ae,t[63]=je):(Ae=t[62],je=t[63]),Be(ze.openShortcuts,Ae,je);let Me;t[64]!==s||t[65]!==d?(Me=typeof s==`function`?s(d):s,t[64]=s,t[65]=d,t[66]=Me):Me=t[66];let Ne=Me,Ie;t[67]!==S||t[68]!==A||t[69]!==q||t[70]!==V||t[71]!==x?(Ie=S&&(0,Q.jsx)(ee,{variant:`floating`,...A,children:(0,Q.jsx)(Pe,{...q,onSelect:e=>{V(e),x(!1)}})}),t[67]=S,t[68]=A,t[69]=q,t[70]=V,t[71]=x,t[72]=Ie):Ie=t[72];let Le;t[73]===V?Le=t[74]:(Le=e=>void V(e),t[73]=V,t[74]=Le);let Re;t[75]!==q||t[76]!==Le?(Re={...q,onSelect:Le},t[75]=q,t[76]=Le,t[77]=Re):Re=t[77];let J;t[78]!==P||t[79]!==Ne||t[80]!==z||t[81]!==F||t[82]!==S||t[83]!==I.description||t[84]!==I.title||t[85]!==d||t[86]!==q||t[87]!==o||t[88]!==Ce||t[89]!==C||t[90]!==H||t[91]!==w||t[92]!==L||t[93]!==oe||t[94]!==i||t[95]!==r||t[96]!==x||t[97]!==ce||t[98]!==a?(J=Ne??(r?(0,Q.jsx)(jr,{navigationTrigger:d,worktree:r.selection.worktree,projectId:r.selection.projectId,search:r.search,onSearch:Ce,context:z},`${ce??``}:${r.selection.worktree.id}`):(0,Q.jsx)(Hr,{navigationTrigger:d,isMobile:S,open:C,openMobile:w,children:i&&a?(0,Q.jsx)(p,{name:i.remote.name,status:a,onOpenRemotes:()=>q.onOpenRemotes(i.remote.environmentId)}):(0,Q.jsxs)(ge,{title:I.title,description:I.description,icon:(0,Q.jsx)(P,{}),children:[F&&(0,Q.jsx)(R,{variant:`outline`,onClick:()=>{x(!1),H()},children:`Open project`}),!o&&L&&(0,Q.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`First that needs you`}),(0,Q.jsx)(f,{className:`flex min-w-0 flex-col rounded-lg border p-3 text-ui hover:bg-accent`,to:`/$projectId/$worktreeId`,params:{projectId:L.projectId,worktreeId:L.worktree.id},children:(0,Q.jsx)(he,{text:oe,className:`font-medium`})})]}),o===`missing-worktree`&&L&&(0,Q.jsx)(f,{className:h(n()),to:`/$projectId/$worktreeId`,params:{projectId:L.projectId,worktreeId:L.worktree.id},children:`Open available worktree`}),o&&(0,Q.jsx)(f,{className:h(n({variant:`outline`})),to:`/`,search:{},children:`Back to workspace`})]})})),t[78]=P,t[79]=Ne,t[80]=z,t[81]=F,t[82]=S,t[83]=I.description,t[84]=I.title,t[85]=d,t[86]=q,t[87]=o,t[88]=Ce,t[89]=C,t[90]=H,t[91]=w,t[92]=L,t[93]=oe,t[94]=i,t[95]=r,t[96]=x,t[97]=ce,t[98]=a,t[99]=J):J=t[99];let Ve;t[100]!==S||t[101]!==C||t[102]!==Re||t[103]!==J?(Ve=(0,Q.jsx)(Oe,{navigator:Re,isMobile:S,open:C,children:J}),t[100]=S,t[101]=C,t[102]=Re,t[103]=J,t[104]=Ve):Ve=t[104];let Y;t[105]===_?Y=t[106]:(Y=(0,Q.jsx)(Lr,{open:_,onOpenChange:v}),t[105]=_,t[106]=Y);let He;return t[107]!==Ie||t[108]!==Ve||t[109]!==Y?(He=(0,Q.jsxs)(Q.Fragment,{children:[Ie,Ve,Y]}),t[107]=Ie,t[108]=Ve,t[109]=Y,t[110]=He):He=t[110],He}function Hr(e){let t=(0,Z.c)(12),{navigationTrigger:n,isMobile:r,open:i,openMobile:a,children:o}=e,s;t[0]===n?s=t[1]:(s=e=>n.attach(e),t[0]=n,t[1]=s);let c=r?a:i,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=Re(Ie(ze.toggleNavigator,Ve())),t[2]=l):l=t[2];let u;t[3]!==s||t[4]!==c?(u=(0,Q.jsx)(le,{render:(0,Q.jsx)(I,{ref:s,className:`absolute top-3 left-3`,"aria-label":`Toggle Sidebar`,"aria-expanded":c,"aria-keyshortcuts":l})}),t[3]=s,t[4]=c,t[5]=u):u=t[5];let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsxs)(N,{side:`right`,children:[`Toggle sidebar`,(0,Q.jsx)(U,{children:J(ze.toggleNavigator)})]}),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=(0,Q.jsxs)(fe,{children:[u,d]}),t[7]=u,t[8]=f);let p;return t[9]!==o||t[10]!==f?(p=(0,Q.jsxs)(`div`,{className:`relative grid h-full min-h-0 place-items-center rounded-paper border bg-card p-8`,children:[f,o]}),t[9]=o,t[10]=f,t[11]=p):p=t[11],p}export{Nr as n,Vr as t};
|