@coreplane/switchboard 1.18.0 → 1.18.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 +45 -9
- package/dist/assets/package-lock.json +3 -3
- package/dist/assets/package.json +1 -1
- package/dist/assets/source.json +3 -3
- package/dist/assets/web/dist/.vite/manifest.json +17 -17
- package/dist/assets/web/dist/assets/{ResidentDetailPage-D3shEnzl.js → ResidentDetailPage-DvQ05AGa.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentsIndexPage-DWIubQ05.js → ResidentsIndexPage-B3uxKUne.js} +1 -1
- package/dist/assets/web/dist/assets/{RunRoutePage-BMjuE-oX.js → RunRoutePage-ty94olNM.js} +3 -3
- package/dist/assets/web/dist/assets/{RunsIndexPage-C3_jYIo0.js → RunsIndexPage-CM-qxyQm.js} +1 -1
- package/dist/assets/web/dist/assets/{ScheduledPage-g1W58mtN.js → ScheduledPage-C1psvLD4.js} +1 -1
- package/dist/assets/web/dist/assets/{StatusDot-DcPRw3zu.js → StatusDot-DuoQnQeU.js} +1 -1
- package/dist/assets/web/dist/assets/{Tooltip-DJUkMYjo.js → Tooltip-BfLPyxQy.js} +1 -1
- package/dist/assets/web/dist/assets/{main-CyM5f4JC.js → main-Bnbk_Rsg.js} +2 -2
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{_ as e,b as t,d as n,f as r,h as i,m as a,n as o,p as s,r as c,t as l,v as u}from"./AppShell-Bk2gbvet.js";import{$n as d,A as f,B as p,En as m,Fn as h,Gn as g,H as _,Hn as v,Ir as y,J as b,N as x,P as S,Pr as C,Vn as w,Vt as T,Yn as E,_ as D,a as ee,ai as O,an as k,bi as A,cr as j,d as te,di as ne,dr as re,f as M,fi as ie,g as ae,gn as N,h as oe,hi as P,in as F,j as se,kr as I,lt as ce,m as le,mn as L,nt as ue,on as R,p as de,pn as z,qt as B,r as fe,ri as pe,rn as V,rr as me,sn as H,sr as U,t as he,tr as W,u as ge,vi as G,vr as _e,wr as ve,x as ye,xi as K,y as be,yi as xe,z as Se,zt as Ce}from"./seed-BglCRKLA.js";import{t as we}from"./Tooltip-DJUkMYjo.js";import{n as q}from"./main-CyM5f4JC.js";import{t as Te}from"./NotFoundPage-C-BuaSm8.js";import{n as Ee,r as De,t as Oe}from"./wallClock-Ckv3sKoR.js";import{A as ke,D as Ae,E as je,M as J,O as Me,b as Ne,j as Pe,k as Fe,n as Ie,t as Le}from"./favicon-DL1rdWJt.js";import{t as Re}from"./localIso-L06jV29p.js";var[Y,ze]=p(`DialogRoot`),Be=N({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=ue(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=O(),a=O(),{modal:o,unmountOnHide:s}=ie(n);return ze({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>j(e.$slots,`default`,{open:P(r),close:()=>r.value=!1})}}),Ve=N({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;x();let n=Y();return(e,r)=>(W(),k(P(f),w(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>P(n).onOpenChange(!1)}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`type`]))}}),He=N({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let i=e,o=t,c=Y(),{forwardRef:l,currentElement:u}=x();return c.titleId||=a(void 0,`reka-dialog-title`),c.descriptionId||=a(void 0,`reka-dialog-description`),E(()=>{c.contentElement=u,Se()!==document.body&&(c.triggerElement.value=Se())}),(e,t)=>(W(),k(P(r),{"as-child":``,loop:``,trapped:i.trapFocus,present:i.present,onMountAutoFocus:t[5]||=e=>o(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>o(`closeAutoFocus`,e)},{default:C(()=>[L(P(s),w({id:P(c).contentId,ref:P(l),as:e.as,"as-child":e.asChild,present:i.present,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":P(c).descriptionId,"aria-labelledby":P(c).titleId,"data-state":P(n)(P(c).open.value)},e.$attrs,{onDismiss:t[0]||=e=>P(c).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>o(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>o(`focusOutside`,e),onInteractOutside:t[3]||=e=>o(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>o(`pointerDownOutside`,e)}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),Ue=N({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,a=Y(),o=S(r),{forwardRef:s,currentElement:c}=x(),l=V(()=>n.present?c.value:void 0);i(l);let u=V(()=>{let{present:e,...t}=n;return t});return I(()=>n.present,(e,t)=>{!e&&t&&a.triggerElement.value?.focus()}),(e,t)=>(W(),k(He,w({...u.value,...P(o)},{ref:P(s),present:e.present,"trap-focus":P(a).open.value,"disable-outside-pointer-events":n.disableOutsidePointerEvents,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),P(a).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),We=N({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=S(t);x();let i=Y(),a=O(!1),o=O(!1),s=V(()=>{let{present:e,...t}=n;return t});return I(()=>n.present,(e,t)=>{!e&&t&&(a.value||i.triggerElement.value?.focus(),a.value=!1,o.value=!1)}),(e,t)=>(W(),k(He,w({...s.value,...P(r)},{present:e.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(a.value||P(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;P(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`present`]))}}),Ge=N({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Y(),a=S(r),{forwardRef:o}=x();return(e,t)=>(W(),k(P(se),{present:e.forceMount||P(i).open.value,"force-mount":e.forceMount||!P(i).unmountOnHide.value},{default:C(({present:t})=>[P(i).modal.value?y((W(),k(Ue,w({key:0,ref:P(o),present:P(i).unmountOnHide.value||t},{...n,...P(a),...e.$attrs}),{default:C(()=>[j(e.$slots,`default`)]),_:2},1040,[`present`])),[[Ce,P(i).unmountOnHide.value||t]]):y((W(),k(We,w({key:1,ref:P(o),present:P(i).unmountOnHide.value||t},{...n,...P(a),...e.$attrs}),{default:C(()=>[j(e.$slots,`default`)]),_:2},1040,[`present`])),[[Ce,P(i).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),Ke=N({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;x();let n=Y();return(e,r)=>(W(),k(P(f),w(t,{id:P(n).descriptionId}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`id`]))}}),qe=N({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(t){let n=t,r=Y(),i=e(n.present);return I(()=>n.present,e=>i.value=e),x(),(e,t)=>(W(),k(P(f),{as:e.as,"as-child":e.asChild,"data-state":P(r).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=T(()=>{},[`left`,`self`,`prevent`])},{default:C(()=>[j(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),Je=N({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Y(),{forwardRef:n}=x();return(e,r)=>P(t)?.modal.value?(W(),k(P(se),{key:0,present:e.forceMount||P(t).open.value,"force-mount":e.forceMount||!P(t).unmountOnHide.value},{default:C(({present:r})=>[y(L(qe,w(e.$attrs,{ref:P(n),as:e.as,"as-child":e.asChild,present:P(t).unmountOnHide.value||r}),{default:C(()=>[j(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[Ce,P(t).unmountOnHide.value||r]])]),_:3},8,[`present`,`force-mount`])):R(`v-if`,!0)}}),Ye=N({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(W(),k(P(ye),xe(m(t)),{default:C(()=>[j(e.$slots,`default`)]),_:3},16))}}),Xe=N({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=Y();return x(),(e,r)=>(W(),k(P(f),w(t,{id:P(n).titleId}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`id`]))}}),Ze=N({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Y(),{forwardRef:r,currentElement:i}=x();return n.contentId||=a(void 0,`reka-dialog-content`),E(()=>{n.triggerElement.value=i.value}),(e,i)=>(W(),k(P(f),w(t,{ref:P(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":P(n).open.value||!1,"aria-controls":P(n).open.value?P(n).contentId:void 0,"data-state":P(n).open.value?`open`:`closed`,onClick:P(n).onOpenToggle}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}});function Qe(e){let t=new Date(e),n=t.getHours(),r=e=>String(e).padStart(2,`0`),i=new Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value;return`${n%12==0?12:n%12}:${r(t.getMinutes())}:${r(t.getSeconds())} ${n<12?`AM`:`PM`}${i?` ${i}`:``}`}function $e(e,t={}){let n=e.detail.originalEvent,r=n.target;if(!r?.isConnected){e.preventDefault();return}t.scrollable&&(n.offsetX>r.clientWidth||n.offsetY>r.clientHeight)&&e.preventDefault()}var et={slots:{overlay:`fixed inset-0 bg-elevated/75`,content:`fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none`,header:`flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)`,wrapper:``,body:`flex-1 overflow-y-auto p-4 sm:p-6`,footer:`flex items-center gap-1.5 p-4 sm:px-6`,title:`text-highlighted font-semibold`,description:`mt-1 text-muted text-sm`,close:`absolute top-4 end-4`},variants:{side:{top:{content:``},right:{content:`max-w-md`},bottom:{content:``},left:{content:`max-w-md`}},inset:{true:{content:`rounded-lg`}},transition:{true:{overlay:`data-[state=open]:animate-[fade-in_200ms_var(--ease-out)] data-[state=closed]:animate-[fade-out_200ms_var(--ease-out)]`}}},compoundVariants:[{side:`top`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 top-4`}},{side:`top`,inset:!1,class:{content:`max-h-full inset-x-0 top-0`}},{side:`right`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 right-4`}},{side:`right`,inset:!1,class:{content:`w-full inset-y-0 right-0`}},{side:`bottom`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 bottom-4`}},{side:`bottom`,inset:!1,class:{content:`max-h-full inset-x-0 bottom-0`}},{side:`left`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 left-4`}},{side:`left`,inset:!1,class:{content:`w-full inset-y-0 left-0`}},{transition:!0,side:`top`,class:{content:`data-[state=open]:animate-[slide-in-from-top_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-top_200ms_var(--ease-out)]`}},{transition:!0,side:`right`,class:{content:`data-[state=open]:animate-[slide-in-from-right_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-right_200ms_var(--ease-out)]`}},{transition:!0,side:`bottom`,class:{content:`data-[state=open]:animate-[slide-in-from-bottom_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-bottom_200ms_var(--ease-out)]`}},{transition:!0,side:`left`,class:{content:`data-[state=open]:animate-[slide-in-from-left_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-left_200ms_var(--ease-out)]`}}]},tt={__name:`Slideover`,props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:`right`},inset:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1}},emits:[`leave`,`after:leave`,`enter`,`after:enter`,`close:prevent`,`update:open`],setup(e,{emit:t}){let n=e,r=t,i=ve(),a=D(`slideover`,n),{t:o}=_(),s=b(),c=ae(ce(a,`open`,`defaultOpen`,`modal`,`unmountOnHide`),r),l=be(ne(()=>a.portal)),u=ne(()=>a.content),d=V(()=>a.dismissible?{pointerDownOutside:$e}:[`interactOutside`,`escapeKeyDown`].reduce((e,t)=>(e[t]=e=>{e.preventDefault(),r(`close:prevent`)},e),{})),f=V(()=>oe({extend:et,...s.ui?.slideover||{}})({transition:a.transition,side:a.side,inset:a.inset}));return(e,t)=>(W(),k(P(Be),xe(m(P(c))),{default:C(({open:n,close:c})=>[i.default?(W(),k(P(Ze),{key:0,"as-child":``,class:G(P(a).class)},{default:C(()=>[j(e.$slots,`default`,{open:n})]),_:2},1032,[`class`])):R(``,!0),L(P(Ye),w(P(l),{"force-mount":P(l).disabled&&P(a).unmountOnHide===!1||void 0}),{default:C(()=>[L(P(ge),null,{default:C(()=>[P(a).overlay?(W(),k(P(Je),{key:0,"data-slot":`overlay`,class:G(f.value.overlay({class:P(a).ui?.overlay}))},null,8,[`class`])):R(``,!0),L(P(Ge),w({"data-side":P(a).side,"data-slot":`content`,class:f.value.content({class:[!i.default&&P(a).class,P(a).ui?.content]})},u.value,{onEnter:t[0]||=e=>r(`enter`),onAfterEnter:t[1]||=e=>r(`after:enter`),onLeave:t[2]||=e=>r(`leave`),onAfterLeave:t[3]||=e=>r(`after:leave`)},_e(d.value)),{default:C(()=>[!P(a).title&&!i.title||!P(a).description&&!i.description||i.content?(W(),k(P(q),{key:0},{default:C(()=>[!P(a).title&&!i.title?(W(),k(P(Xe),{key:0})):i.content?(W(),k(P(Xe),{key:1},{default:C(()=>[j(e.$slots,`title`,{},()=>[z(K(P(a).title),1)])]),_:3})):R(``,!0),!P(a).description&&!i.description?(W(),k(P(Ke),{key:2})):i.content?(W(),k(P(Ke),{key:3},{default:C(()=>[j(e.$slots,`description`,{},()=>[z(K(P(a).description),1)])]),_:3})):R(``,!0)]),_:3})):R(``,!0),j(e.$slots,`content`,{close:c},()=>[i.header||P(a).title||i.title||P(a).description||i.description||P(a).close||i.close?(W(),H(`div`,{key:0,"data-slot":`header`,class:G(f.value.header({class:P(a).ui?.header}))},[j(e.$slots,`header`,{close:c},()=>[P(a).title||i.title||P(a).description||i.description?(W(),H(`div`,{key:0,"data-slot":`wrapper`,class:G(f.value.wrapper({class:P(a).ui?.wrapper}))},[P(a).title||i.title?(W(),k(P(Xe),{key:0,"data-slot":`title`,class:G(f.value.title({class:P(a).ui?.title}))},{default:C(()=>[j(e.$slots,`title`,{},()=>[z(K(P(a).title),1)])]),_:3},8,[`class`])):R(``,!0),P(a).description||i.description?(W(),k(P(Ke),{key:1,"data-slot":`description`,class:G(f.value.description({class:P(a).ui?.description}))},{default:C(()=>[j(e.$slots,`description`,{},()=>[z(K(P(a).description),1)])]),_:3},8,[`class`])):R(``,!0)],2)):R(``,!0),j(e.$slots,`actions`),P(a).close||i.close?(W(),k(P(Ve),{key:1,"as-child":``},{default:C(()=>[j(e.$slots,`close`,{ui:f.value},()=>[P(a).close?(W(),k(ee,w({key:0,icon:P(a).closeIcon||P(s).ui.icons.close,color:`neutral`,variant:`ghost`,"aria-label":P(o)(`slideover.close`)},typeof P(a).close==`object`?P(a).close:{},{"data-slot":`close`,class:f.value.close({class:P(a).ui?.close})}),null,16,[`icon`,`aria-label`,`class`])):R(``,!0)])]),_:2},1024)):R(``,!0)])],2)):R(``,!0),F(`div`,{"data-slot":`body`,class:G(f.value.body({class:P(a).ui?.body}))},[j(e.$slots,`body`,{close:c})],2),i.footer?(W(),H(`div`,{key:1,"data-slot":`footer`,class:G(f.value.footer({class:P(a).ui?.footer}))},[j(e.$slots,`footer`,{close:c})],2)):R(``,!0)])]),_:2},1040,[`data-side`,`class`])]),_:2},1024)]),_:2},1040,[`force-mount`])]),_:3},16))}},nt=[`data-expanded`,`data-overflowing`],rt={key:0,class:`fade pointer-events-none absolute inset-x-0 bottom-6 h-10`},it={key:1,class:`mt-1 flex justify-start`},at=[`aria-expanded`],ot=c(N({__name:`ExpandableText`,props:{lines:{default:5}},setup(e){let t=e,n=O(!1),r=O(!1),i=O(null),a=`expandable-${Math.random().toString(36).slice(2,8)}`;function o(){let e=i.value;e&&!n.value&&(r.value=e.scrollHeight>e.clientHeight+1)}let s=null;E(()=>{o(),typeof ResizeObserver<`u`&&i.value&&(s=new ResizeObserver(()=>o()),s.observe(i.value))}),g(()=>s?.disconnect()),I(n,e=>{e||Promise.resolve().then(o)});function c(){n.value=!n.value}function l(e){!n.value&&r.value&&(e.target?.closest?.(`a`)||(n.value=!0))}return(e,o)=>(W(),H(`div`,{class:G([`expandable group relative`,!n.value&&r.value?`cursor-pointer`:``]),"data-expanded":n.value?`1`:`0`,"data-overflowing":r.value?`1`:`0`,onClick:l},[F(`div`,{id:a,ref_key:`body`,ref:i,class:G([`body`,n.value?``:`clamped`]),style:A(n.value?void 0:{"--expandable-lines":String(t.lines)})},[j(e.$slots,`default`,{},void 0,!0)],6),!n.value&&r.value?(W(),H(`div`,rt)):R(``,!0),r.value||n.value?(W(),H(`div`,it,[F(`button`,{type:`button`,class:`more cursor-pointer text-xs text-dimmed group-hover:text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"aria-expanded":n.value?`true`:`false`,"aria-controls":a,onClick:T(c,[`stop`])},K(n.value?`Show less`:`Show more`),9,at)])):R(``,!0)],10,nt))}}),[[`__scopeId`,`data-v-ce3bfa89`]]);function st(e,t){let n=e.ownerDocument;e.textContent=``;let r=String(t??``).replace(/\r\n?/g,`
|
|
1
|
+
import{_ as e,b as t,d as n,f as r,h as i,m as a,n as o,p as s,r as c,t as l,v as u}from"./AppShell-Bk2gbvet.js";import{$n as d,A as f,B as p,En as m,Fn as h,Gn as g,H as _,Hn as v,Ir as y,J as b,N as x,P as S,Pr as C,Vn as w,Vt as T,Yn as E,_ as D,a as ee,ai as O,an as k,bi as A,cr as j,d as te,di as ne,dr as re,f as M,fi as ie,g as ae,gn as N,h as oe,hi as P,in as F,j as se,kr as I,lt as ce,m as le,mn as L,nt as ue,on as R,p as de,pn as z,qt as B,r as fe,ri as pe,rn as V,rr as me,sn as H,sr as U,t as he,tr as W,u as ge,vi as G,vr as _e,wr as ve,x as ye,xi as K,y as be,yi as xe,z as Se,zt as Ce}from"./seed-BglCRKLA.js";import{t as we}from"./Tooltip-BfLPyxQy.js";import{n as q}from"./main-Bnbk_Rsg.js";import{t as Te}from"./NotFoundPage-C-BuaSm8.js";import{n as Ee,r as De,t as Oe}from"./wallClock-Ckv3sKoR.js";import{A as ke,D as Ae,E as je,M as J,O as Me,b as Ne,j as Pe,k as Fe,n as Ie,t as Le}from"./favicon-DL1rdWJt.js";import{t as Re}from"./localIso-L06jV29p.js";var[Y,ze]=p(`DialogRoot`),Be=N({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=ue(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=O(),a=O(),{modal:o,unmountOnHide:s}=ie(n);return ze({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>j(e.$slots,`default`,{open:P(r),close:()=>r.value=!1})}}),Ve=N({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;x();let n=Y();return(e,r)=>(W(),k(P(f),w(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>P(n).onOpenChange(!1)}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`type`]))}}),He=N({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let i=e,o=t,c=Y(),{forwardRef:l,currentElement:u}=x();return c.titleId||=a(void 0,`reka-dialog-title`),c.descriptionId||=a(void 0,`reka-dialog-description`),E(()=>{c.contentElement=u,Se()!==document.body&&(c.triggerElement.value=Se())}),(e,t)=>(W(),k(P(r),{"as-child":``,loop:``,trapped:i.trapFocus,present:i.present,onMountAutoFocus:t[5]||=e=>o(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>o(`closeAutoFocus`,e)},{default:C(()=>[L(P(s),w({id:P(c).contentId,ref:P(l),as:e.as,"as-child":e.asChild,present:i.present,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":P(c).descriptionId,"aria-labelledby":P(c).titleId,"data-state":P(n)(P(c).open.value)},e.$attrs,{onDismiss:t[0]||=e=>P(c).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>o(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>o(`focusOutside`,e),onInteractOutside:t[3]||=e=>o(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>o(`pointerDownOutside`,e)}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),Ue=N({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,a=Y(),o=S(r),{forwardRef:s,currentElement:c}=x(),l=V(()=>n.present?c.value:void 0);i(l);let u=V(()=>{let{present:e,...t}=n;return t});return I(()=>n.present,(e,t)=>{!e&&t&&a.triggerElement.value?.focus()}),(e,t)=>(W(),k(He,w({...u.value,...P(o)},{ref:P(s),present:e.present,"trap-focus":P(a).open.value,"disable-outside-pointer-events":n.disableOutsidePointerEvents,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),P(a).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),We=N({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=S(t);x();let i=Y(),a=O(!1),o=O(!1),s=V(()=>{let{present:e,...t}=n;return t});return I(()=>n.present,(e,t)=>{!e&&t&&(a.value||i.triggerElement.value?.focus(),a.value=!1,o.value=!1)}),(e,t)=>(W(),k(He,w({...s.value,...P(r)},{present:e.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(a.value||P(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;P(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`present`]))}}),Ge=N({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Y(),a=S(r),{forwardRef:o}=x();return(e,t)=>(W(),k(P(se),{present:e.forceMount||P(i).open.value,"force-mount":e.forceMount||!P(i).unmountOnHide.value},{default:C(({present:t})=>[P(i).modal.value?y((W(),k(Ue,w({key:0,ref:P(o),present:P(i).unmountOnHide.value||t},{...n,...P(a),...e.$attrs}),{default:C(()=>[j(e.$slots,`default`)]),_:2},1040,[`present`])),[[Ce,P(i).unmountOnHide.value||t]]):y((W(),k(We,w({key:1,ref:P(o),present:P(i).unmountOnHide.value||t},{...n,...P(a),...e.$attrs}),{default:C(()=>[j(e.$slots,`default`)]),_:2},1040,[`present`])),[[Ce,P(i).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),Ke=N({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;x();let n=Y();return(e,r)=>(W(),k(P(f),w(t,{id:P(n).descriptionId}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`id`]))}}),qe=N({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(t){let n=t,r=Y(),i=e(n.present);return I(()=>n.present,e=>i.value=e),x(),(e,t)=>(W(),k(P(f),{as:e.as,"as-child":e.asChild,"data-state":P(r).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=T(()=>{},[`left`,`self`,`prevent`])},{default:C(()=>[j(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),Je=N({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Y(),{forwardRef:n}=x();return(e,r)=>P(t)?.modal.value?(W(),k(P(se),{key:0,present:e.forceMount||P(t).open.value,"force-mount":e.forceMount||!P(t).unmountOnHide.value},{default:C(({present:r})=>[y(L(qe,w(e.$attrs,{ref:P(n),as:e.as,"as-child":e.asChild,present:P(t).unmountOnHide.value||r}),{default:C(()=>[j(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[Ce,P(t).unmountOnHide.value||r]])]),_:3},8,[`present`,`force-mount`])):R(`v-if`,!0)}}),Ye=N({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(W(),k(P(ye),xe(m(t)),{default:C(()=>[j(e.$slots,`default`)]),_:3},16))}}),Xe=N({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=Y();return x(),(e,r)=>(W(),k(P(f),w(t,{id:P(n).titleId}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`id`]))}}),Ze=N({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Y(),{forwardRef:r,currentElement:i}=x();return n.contentId||=a(void 0,`reka-dialog-content`),E(()=>{n.triggerElement.value=i.value}),(e,i)=>(W(),k(P(f),w(t,{ref:P(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":P(n).open.value||!1,"aria-controls":P(n).open.value?P(n).contentId:void 0,"data-state":P(n).open.value?`open`:`closed`,onClick:P(n).onOpenToggle}),{default:C(()=>[j(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}});function Qe(e){let t=new Date(e),n=t.getHours(),r=e=>String(e).padStart(2,`0`),i=new Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value;return`${n%12==0?12:n%12}:${r(t.getMinutes())}:${r(t.getSeconds())} ${n<12?`AM`:`PM`}${i?` ${i}`:``}`}function $e(e,t={}){let n=e.detail.originalEvent,r=n.target;if(!r?.isConnected){e.preventDefault();return}t.scrollable&&(n.offsetX>r.clientWidth||n.offsetY>r.clientHeight)&&e.preventDefault()}var et={slots:{overlay:`fixed inset-0 bg-elevated/75`,content:`fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none`,header:`flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)`,wrapper:``,body:`flex-1 overflow-y-auto p-4 sm:p-6`,footer:`flex items-center gap-1.5 p-4 sm:px-6`,title:`text-highlighted font-semibold`,description:`mt-1 text-muted text-sm`,close:`absolute top-4 end-4`},variants:{side:{top:{content:``},right:{content:`max-w-md`},bottom:{content:``},left:{content:`max-w-md`}},inset:{true:{content:`rounded-lg`}},transition:{true:{overlay:`data-[state=open]:animate-[fade-in_200ms_var(--ease-out)] data-[state=closed]:animate-[fade-out_200ms_var(--ease-out)]`}}},compoundVariants:[{side:`top`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 top-4`}},{side:`top`,inset:!1,class:{content:`max-h-full inset-x-0 top-0`}},{side:`right`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 right-4`}},{side:`right`,inset:!1,class:{content:`w-full inset-y-0 right-0`}},{side:`bottom`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 bottom-4`}},{side:`bottom`,inset:!1,class:{content:`max-h-full inset-x-0 bottom-0`}},{side:`left`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 left-4`}},{side:`left`,inset:!1,class:{content:`w-full inset-y-0 left-0`}},{transition:!0,side:`top`,class:{content:`data-[state=open]:animate-[slide-in-from-top_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-top_200ms_var(--ease-out)]`}},{transition:!0,side:`right`,class:{content:`data-[state=open]:animate-[slide-in-from-right_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-right_200ms_var(--ease-out)]`}},{transition:!0,side:`bottom`,class:{content:`data-[state=open]:animate-[slide-in-from-bottom_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-bottom_200ms_var(--ease-out)]`}},{transition:!0,side:`left`,class:{content:`data-[state=open]:animate-[slide-in-from-left_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-left_200ms_var(--ease-out)]`}}]},tt={__name:`Slideover`,props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:`right`},inset:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1}},emits:[`leave`,`after:leave`,`enter`,`after:enter`,`close:prevent`,`update:open`],setup(e,{emit:t}){let n=e,r=t,i=ve(),a=D(`slideover`,n),{t:o}=_(),s=b(),c=ae(ce(a,`open`,`defaultOpen`,`modal`,`unmountOnHide`),r),l=be(ne(()=>a.portal)),u=ne(()=>a.content),d=V(()=>a.dismissible?{pointerDownOutside:$e}:[`interactOutside`,`escapeKeyDown`].reduce((e,t)=>(e[t]=e=>{e.preventDefault(),r(`close:prevent`)},e),{})),f=V(()=>oe({extend:et,...s.ui?.slideover||{}})({transition:a.transition,side:a.side,inset:a.inset}));return(e,t)=>(W(),k(P(Be),xe(m(P(c))),{default:C(({open:n,close:c})=>[i.default?(W(),k(P(Ze),{key:0,"as-child":``,class:G(P(a).class)},{default:C(()=>[j(e.$slots,`default`,{open:n})]),_:2},1032,[`class`])):R(``,!0),L(P(Ye),w(P(l),{"force-mount":P(l).disabled&&P(a).unmountOnHide===!1||void 0}),{default:C(()=>[L(P(ge),null,{default:C(()=>[P(a).overlay?(W(),k(P(Je),{key:0,"data-slot":`overlay`,class:G(f.value.overlay({class:P(a).ui?.overlay}))},null,8,[`class`])):R(``,!0),L(P(Ge),w({"data-side":P(a).side,"data-slot":`content`,class:f.value.content({class:[!i.default&&P(a).class,P(a).ui?.content]})},u.value,{onEnter:t[0]||=e=>r(`enter`),onAfterEnter:t[1]||=e=>r(`after:enter`),onLeave:t[2]||=e=>r(`leave`),onAfterLeave:t[3]||=e=>r(`after:leave`)},_e(d.value)),{default:C(()=>[!P(a).title&&!i.title||!P(a).description&&!i.description||i.content?(W(),k(P(q),{key:0},{default:C(()=>[!P(a).title&&!i.title?(W(),k(P(Xe),{key:0})):i.content?(W(),k(P(Xe),{key:1},{default:C(()=>[j(e.$slots,`title`,{},()=>[z(K(P(a).title),1)])]),_:3})):R(``,!0),!P(a).description&&!i.description?(W(),k(P(Ke),{key:2})):i.content?(W(),k(P(Ke),{key:3},{default:C(()=>[j(e.$slots,`description`,{},()=>[z(K(P(a).description),1)])]),_:3})):R(``,!0)]),_:3})):R(``,!0),j(e.$slots,`content`,{close:c},()=>[i.header||P(a).title||i.title||P(a).description||i.description||P(a).close||i.close?(W(),H(`div`,{key:0,"data-slot":`header`,class:G(f.value.header({class:P(a).ui?.header}))},[j(e.$slots,`header`,{close:c},()=>[P(a).title||i.title||P(a).description||i.description?(W(),H(`div`,{key:0,"data-slot":`wrapper`,class:G(f.value.wrapper({class:P(a).ui?.wrapper}))},[P(a).title||i.title?(W(),k(P(Xe),{key:0,"data-slot":`title`,class:G(f.value.title({class:P(a).ui?.title}))},{default:C(()=>[j(e.$slots,`title`,{},()=>[z(K(P(a).title),1)])]),_:3},8,[`class`])):R(``,!0),P(a).description||i.description?(W(),k(P(Ke),{key:1,"data-slot":`description`,class:G(f.value.description({class:P(a).ui?.description}))},{default:C(()=>[j(e.$slots,`description`,{},()=>[z(K(P(a).description),1)])]),_:3},8,[`class`])):R(``,!0)],2)):R(``,!0),j(e.$slots,`actions`),P(a).close||i.close?(W(),k(P(Ve),{key:1,"as-child":``},{default:C(()=>[j(e.$slots,`close`,{ui:f.value},()=>[P(a).close?(W(),k(ee,w({key:0,icon:P(a).closeIcon||P(s).ui.icons.close,color:`neutral`,variant:`ghost`,"aria-label":P(o)(`slideover.close`)},typeof P(a).close==`object`?P(a).close:{},{"data-slot":`close`,class:f.value.close({class:P(a).ui?.close})}),null,16,[`icon`,`aria-label`,`class`])):R(``,!0)])]),_:2},1024)):R(``,!0)])],2)):R(``,!0),F(`div`,{"data-slot":`body`,class:G(f.value.body({class:P(a).ui?.body}))},[j(e.$slots,`body`,{close:c})],2),i.footer?(W(),H(`div`,{key:1,"data-slot":`footer`,class:G(f.value.footer({class:P(a).ui?.footer}))},[j(e.$slots,`footer`,{close:c})],2)):R(``,!0)])]),_:2},1040,[`data-side`,`class`])]),_:2},1024)]),_:2},1040,[`force-mount`])]),_:3},16))}},nt=[`data-expanded`,`data-overflowing`],rt={key:0,class:`fade pointer-events-none absolute inset-x-0 bottom-6 h-10`},it={key:1,class:`mt-1 flex justify-start`},at=[`aria-expanded`],ot=c(N({__name:`ExpandableText`,props:{lines:{default:5}},setup(e){let t=e,n=O(!1),r=O(!1),i=O(null),a=`expandable-${Math.random().toString(36).slice(2,8)}`;function o(){let e=i.value;e&&!n.value&&(r.value=e.scrollHeight>e.clientHeight+1)}let s=null;E(()=>{o(),typeof ResizeObserver<`u`&&i.value&&(s=new ResizeObserver(()=>o()),s.observe(i.value))}),g(()=>s?.disconnect()),I(n,e=>{e||Promise.resolve().then(o)});function c(){n.value=!n.value}function l(e){!n.value&&r.value&&(e.target?.closest?.(`a`)||(n.value=!0))}return(e,o)=>(W(),H(`div`,{class:G([`expandable group relative`,!n.value&&r.value?`cursor-pointer`:``]),"data-expanded":n.value?`1`:`0`,"data-overflowing":r.value?`1`:`0`,onClick:l},[F(`div`,{id:a,ref_key:`body`,ref:i,class:G([`body`,n.value?``:`clamped`]),style:A(n.value?void 0:{"--expandable-lines":String(t.lines)})},[j(e.$slots,`default`,{},void 0,!0)],6),!n.value&&r.value?(W(),H(`div`,rt)):R(``,!0),r.value||n.value?(W(),H(`div`,it,[F(`button`,{type:`button`,class:`more cursor-pointer text-xs text-dimmed group-hover:text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"aria-expanded":n.value?`true`:`false`,"aria-controls":a,onClick:T(c,[`stop`])},K(n.value?`Show less`:`Show more`),9,at)])):R(``,!0)],10,nt))}}),[[`__scopeId`,`data-v-ce3bfa89`]]);function st(e,t){let n=e.ownerDocument;e.textContent=``;let r=String(t??``).replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),i=/^(\s*)([-*]|\d+[.)])\s+(.*)$/,a=/^(```|#{1,6}\s|>)/;function o(e,t){let r=n.createElement(t);return e.appendChild(r),r}function s(e,t){t&&e.appendChild(n.createTextNode(t))}function c(e){let t=e.trim();return t[0]===`|`&&(t=t.slice(1)),t[t.length-1]===`|`&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function l(e){let t=e.trim();return t.indexOf(`|`)<0||!/^[\s:|-]+$/.test(t)?!1:c(t).every(e=>/^:?-+:?$/.test(e))}function u(e,t){let n=e[t];return n.indexOf(`|`)<0||l(n)||t+1>=e.length||!l(e[t+1])?!1:c(n).length===c(e[t+1]).length}function d(e,t){let n=0,r=``,i=()=>{s(e,r),r=``};for(;n<t.length;){let a=t[n];if(a==="`"){let r=t.indexOf("`",n+1);if(r>n+1){i(),o(e,`code`).textContent=t.slice(n+1,r),n=r+1;continue}}else if(a===`*`&&t[n+1]===`*`){let r=t.indexOf(`**`,n+2);if(r>n+2){i(),d(o(e,`strong`),t.slice(n+2,r)),n=r+2;continue}}else if(a===`*`||a===`_`){let r=n>0?t[n-1]:``;if(/\S/.test(t[n+1]||``)&&!/\w/.test(r)){let r=-1;for(let e=n+2;e<t.length;e++)if(t[e]===a&&/\S/.test(t[e-1])&&!/\w/.test(t[e+1]||``)){r=e;break}if(r>0){i(),d(o(e,`em`),t.slice(n+1,r)),n=r+1;continue}}}else if(a===`[`){let r=/^\[([^\]\n]+)\]\(([^)\s]+)\)/.exec(t.slice(n));if(r&&/^https?:\/\//i.test(r[2])){i();let t=o(e,`a`);t.setAttribute(`href`,r[2]),t.setAttribute(`rel`,`noopener noreferrer`),t.setAttribute(`target`,`_blank`),d(t,r[1]),n+=r[0].length;continue}}r+=a,n++}i()}function f(e,t,n=0){let r=0;for(;r<t.length;){let s=t[r];if(/^\s*$/.test(s)){r++;continue}if(/^```/.test(s)){let n=[];for(r++;r<t.length&&!/^```\s*$/.test(t[r]);)n.push(t[r++]);r++,o(o(e,`pre`),`code`).textContent=n.join(`
|
|
4
4
|
`);continue}let l=/^(#{1,6})\s+(\S.*?)\s*$/.exec(s);if(l){d(o(e,`h`+l[1].length),l[2]),r++;continue}if(s[0]===`>`&&n<8){let i=[];for(;r<t.length&&t[r][0]===`>`;)i.push(t[r++].replace(/^>\s?/,``));f(o(e,`blockquote`),i,n+1);continue}if(u(t,r)){let n=c(s),i=o(e,`table`),a=o(o(i,`thead`),`tr`);for(let e of n)d(o(a,`th`),e);r+=2;let l=null;for(;r<t.length&&t[r].indexOf(`|`)>=0&&!u(t,r);){l||=o(i,`tbody`);let e=c(t[r]),a=o(l,`tr`);for(let t=0;t<n.length;t++)d(o(a,`td`),t<e.length?e[t]:``);r++}continue}if(i.test(s)){let n=[],a;for(;r<t.length&&(a=i.exec(t[r]))!==null;)n.push({indent:a[1].length,ordered:/^\d/.test(a[2]),text:a[3]}),r++;let s=n[0].indent,c=o(e,n[0].ordered?`ol`:`ul`),l=null,u=null;for(let e of n)e.indent>s&&l?(u||=o(l,e.ordered?`ol`:`ul`),d(o(u,`li`),e.text)):(l=o(c,`li`),u=null,d(l,e.text));continue}let p=[];for(;r<t.length&&!/^\s*$/.test(t[r])&&!a.test(t[r])&&!i.test(t[r])&&!u(t,r);)p.push(t[r++]);p.length===0&&p.push(t[r++]),d(o(e,`p`),p.join(`
|
|
5
5
|
`))}}f(e,r)}var ct=N({__name:`MarkdownText`,props:{text:{}},setup(e){let t=e,n=O(null);function r(){let e=n.value;if(e)try{st(e,t.text)}catch{e.textContent=t.text}}return E(r),I(()=>t.text,r),(e,t)=>(W(),H(`div`,{ref_key:`root`,ref:n,class:`md prose prose-sm dark:prose-invert min-w-0 max-w-none flex-1 whitespace-pre-wrap break-words font-sans text-[0.875rem] leading-normal [&_blockquote]:my-1.5 [&_li>ol]:my-0.5 [&_li>ul]:my-0.5 [&_li]:my-0.5 [&_li]:whitespace-pre-wrap [&_ol]:my-1.5 [&_ol]:whitespace-normal [&_p]:my-1.5 [&_pre]:my-2 [&_pre]:whitespace-pre [&_table]:whitespace-normal [&_ul]:my-1.5 [&_ul]:whitespace-normal`},null,512))}}),lt={},ut={viewBox:`0 0 16 16`,class:`inline-block size-[1em] shrink-0`,"aria-hidden":`true`};function dt(e,t){return W(),H(`svg`,ut,[...t[0]||=[F(`path`,{fill:`currentColor`,d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z`},null,-1)]])}var ft=c(lt,[[`render`,dt]]);function pt(){let e=[],t=null,n=0,r=[];function i(e){return typeof e==`number`&&isFinite(e)?e:void 0}function a(e){return typeof e==`string`?e:``}function o(n){let r={index:e.length,calls:[]};return n&&(r.narration=n),e.push(r),t=r,r}function s(e){return e<1e3?String(e):e<1e6?(Math.round(e/100)/10).toFixed(1)+`k`:(Math.round(e/1e5)/10).toFixed(1)+`M`}function c(e){let t=/\((\d+) chars(?:, (\d+) lines)?\)$/.exec(e.summary);if(t)return t[2]?Number(t[2]):1;if(e.output)return e.output.split(`
|
|
6
6
|
`).length}function l(e){let t=[],n=e.result;if(!n)return t;n.infra?t.push(`sandbox error`):e.shell?t.push(n.exitCode===void 0?n.ok?`exit 0`:`error`:`exit `+n.exitCode):n.ok||t.push(`error`);let r=c(n);return r!==void 0&&r>1&&t.push(r+` lines`),e.durationMs!==void 0&&t.push(J(e.durationMs,`precise`)),t}function u(e,t){let n={ok:t.ok===!0,infra:t.infra===!0,summary:a(t.summary),output:a(t.output),at:i(t.at)},o=i(t.exitCode);o!==void 0&&(n.exitCode=o),e.result=n;let s=r.indexOf(e);s!==-1&&r.splice(s,1),e.status=n.infra?`infra`:n.ok?`ok`:`failed`,e.status!==`ok`&&(e.tags=e.tags.concat(e.status)),e.startedAt!==void 0&&n.at!==void 0&&n.at>=e.startedAt&&(e.durationMs=n.at-e.startedAt),e.facts=l(e)}let d=[[`tests`,/\b(npm|pnpm|yarn|bun)\s+(run\s+)?test\b|\b(vitest|jest|pytest|mocha|go test|cargo test)\b/],[`build`,/\b(npm|pnpm|yarn|bun)\s+run\s+(build|typecheck|lint)\b|\b(tsc|make|cargo build|go build|eslint|prettier)\b/],[`install`,/\b(npm|pnpm|yarn|bun)\s+(i|install|ci|add)\b|\bpip3?\s+install\b|\bapt(-get)?\s+install\b|\bbrew\s+install\b/],[`git`,/(^|[\s;&|(])(git|gh)\s/],[`network`,/(^|[\s;&|(])(curl|wget)\s/],[`read`,/(^|[\s;&|(])(cat|sed|head|tail|less|ls|find|grep|rg|wc|tree|pwd|echo|env|which|stat|file|diff)\b/]];function f(e){let t=e.replace(/^(\s*cd\s+("[^"]*"|'[^']*'|\S+)\s*(&&|;)\s*)+/,``);return t.trim()?t:e}function p(e){let t=f(e);for(let[e,n]of d)if(n.test(t))return e;return`shell`}function m(e,t){let n=t?f(e):e,r=n.indexOf(`
|
|
7
|
-
`),i=r===-1?n:n.slice(0,r).trimEnd();return i.length<e.length?i+` …`:i}function h(e,t){let o=a(e.tool),s=o===`bash`,c=t||o,l=s&&c.startsWith(`$ `)?c.slice(2):!s&&c.startsWith(o+` `)?c.slice(o.length+1):c,u={id:a(e.callId)||`c`+ ++n,tool:o,title:l,headline:m(l,s),shell:s,quiet:o===`update_status`,tags:[s?p(l):o],status:`running`,startedAt:i(e.at),facts:[]};return r.push(u),u}function g(t){for(let n=e.length-1;n>=0;n--)for(let r of e[n].calls)if(r.id===t)return{step:e[n],call:r};return null}function _(t){let n=a(t.callId);if(!n)return null;for(let t=e.length-1;t>=0;t--)for(let r of e[t].calls)if(r.id===n&&!r.result)return{step:e[t],call:r};return null}function v(e){if(!e||typeof e!=`object`)return[];let n=e;switch(n.type){case`input`:{let e={kind:`input`,text:a(n.text),at:i(n.at)},t=n.source;if(t&&typeof t==`object`){let n=t,r={};a(n.url)&&(r.url=a(n.url)),a(n.channel)&&(r.channel=a(n.channel)),a(n.user)&&(r.user=a(n.user)),Object.keys(r).length>0&&(e.source=r)}return[e]}case`answer`:return[{kind:`answer`,text:a(n.text),at:i(n.at)}];case`pr_opened`:{let e=i(n.number);return!a(n.url)||e===void 0||!Number.isInteger(e)||e<=0?[]:[{kind:`pr_opened`,url:a(n.url),number:e,created:n.created===!0,at:i(n.at)}]}case`run_meta`:{if(!a(n.agent))return[];let e={kind:`meta`,agent:a(n.agent),model:a(n.model),at:i(n.at)};return a(n.effort)&&(e.effort=a(n.effort)),a(n.repo)&&(e.repo=a(n.repo)),a(n.ref)&&(e.ref=a(n.ref)),i(n.pr)!==void 0&&Number.isInteger(n.pr)&&n.pr>0&&(e.pr=n.pr),/^[0-9a-f]{7,40}$/i.test(a(n.headSha))&&(e.headSha=a(n.headSha)),[e]}case`context`:return[{kind:`context`,text:a(n.text),at:i(n.at)}];case`replay_note`:return[{kind:`replay_note`,text:a(n.summary)}];case`run_note`:return[{kind:`note`,text:a(n.summary),noteKind:a(n.kind),mode:a(n.mode)||void 0,at:i(n.at)}];case`assistant`:return[{kind:`step`,step:o({text:a(n.text),at:i(n.at)})}];case`review_artifact`:return[];case`span_start`:{let e=a(n.name),t=a(n.spanId);return!e||!t||e.startsWith(`tool.`)||e.startsWith(`mcp.`)||e===`model.turn`?[]:[{kind:`span`,spanId:t,name:e,open:!0,at:i(n.at)}]}case`span_end`:{let e=a(n.name),r=a(n.spanId),o=i(n.durationMs);if(!e||!r||o===void 0)return[];let c=n.status===`error`?`error`:`ok`,u=typeof n.attrs==`object`&&n.attrs!==null?n.attrs:{};if(e===`model.turn`){t=null;let e=[],c=i(u.inputTokens),l=i(u.outputTokens),d=i(u.cacheReadTokens);c!==void 0&&e.push(s(c)+` in`),l!==void 0&&e.push(s(l)+` out`),d!==void 0&&e.push(s(d)+` cached`);let f=i(u.ttftMs);f!==void 0&&e.push(`first token `+J(f,`precise`));let p=i(u.thinkingMs);p!==void 0&&e.push(`thinking `+J(p,`precise`));let m=i(u.textMs);m!==void 0&&e.push(`writing `+J(m,`precise`));let h=a(u.model);return[{kind:`turn`,spanId:r,label:`Thought for `+J(o,`precise`),facts:e,durationMs:o,...h?{model:h}:{},at:i(n.at)}]}if(e.startsWith(`tool.`)||e.startsWith(`mcp.`)){if(!e.startsWith(`tool.`))return[];let t=a(u.callId);if(!t)return[];let n=g(t);return!n||n.call.durationMs!==void 0?[]:(n.call.durationMs=o,n.call.facts=l(n.call),[{kind:`result`,step:n.step,call:n.call}])}let d=i(n.startedAt);return[{kind:`span`,spanId:r,name:e,open:!1,durationMs:o,status:c,at:i(n.at),...d===void 0?{}:{startedAt:d}}]}case`skill_use`:{let e=a(n.skill);if(!e)return[];let r=[];t||r.push({kind:`step`,step:o()});let s=a(n.source),c={name:e,description:a(n.description),agent:a(n.agent),bodyBytes:i(n.bodyBytes)??0,at:i(n.at)};return/^https?:\/\//.test(s)&&(c.source=s),r.push({kind:`skill`,step:t,skill:c}),r}case`tool_call`:{let e=[];t||e.push({kind:`step`,step:o()});let r=h(n,a(n.summary));return t.calls.push(r),e.push({kind:`call`,step:t,call:r}),e}case`tool_result`:{let e=_(n);if(e)return u(e.call,n),[{kind:`result`,step:e.step,call:e.call}];let r=[];t||r.push({kind:`step`,step:o()});let i=h(n,``);return i.startedAt=void 0,u(i,n),t.calls.push(i),r.push({kind:`call`,step:t,call:i}),r}default:return[]}}function y(){return r.length>0?r[0]:null}return{push:v,pending:y,steps:()=>e}}new Set(`request,slack.receive,dispatch.history,dispatch.admission,dispatch.ack_card,dispatch.gate.repo,dispatch.gate.pr_head,dispatch.workspace.attach,dispatch.gate.attached_head,dispatch.mcp_discovery,dispatch.compose,dispatch.channel_visibility,dispatch.repo_context,dispatch.memory_read,dispatch.refuse,dispatch.ship_preflight,dispatch.ledger_claim,run.agent,run.command,run.reading_diff,run.settle_reviewed_head,run.description_turn,run.observe_workspace,run.pr_post_step,run.reading_diff_join,run.pr_description_join,model.turn,ship.round,post.card_close,post.reply`.split(`,`));var mt=new Set([`slack.receive`,`dispatch.history`,`dispatch.admission`,`dispatch.ack_card`,`dispatch.gate.repo`,`dispatch.gate.pr_head`,`dispatch.workspace.attach`,`dispatch.gate.attached_head`,`dispatch.mcp_discovery`,`dispatch.compose`,`dispatch.channel_visibility`,`dispatch.repo_context`,`dispatch.memory_read`,`dispatch.refuse`,`dispatch.ship_preflight`,`dispatch.ledger_claim`]),ht=new Set([`run.observe_workspace`,`run.pr_post_step`,`run.reading_diff_join`,`run.pr_description_join`]),gt=new Set([`request`,`run.agent`,`ship.round`,`run.settle_reviewed_head`,`run.description_turn`,`post.card_close`,`post.reply`]),_t=new Set([`run.reading_diff`]);function vt(e,t){if(_t.has(e))return{kind:`background`};if(gt.has(e))return{kind:`uncounted`};if(e===`model.turn`)return{kind:`counted`,bucket:`thinking`};if(e===`run.command`||e.startsWith(`run.command.`))return{kind:`counted`,bucket:t===`command`?`tools`:`getting_ready`};if(mt.has(e)||e.startsWith(`dispatch.workspace.attach.`))return{kind:`counted`,bucket:`getting_ready`};if(ht.has(e))return{kind:`counted`,bucket:`finishing_up`};if(e.startsWith(`tool.`)||e.startsWith(`mcp.`))return{kind:`counted`,bucket:`tools`}}var yt={clone:`cloning the repo`,"checkout-clone":`cloning the checkout`,"worktree-clone":`cloning the worktree`,"worktree-detach":`checking out the expected commit`,"op-clone":`cloning the op tree`,fetch:`fetching the branch`,"wake-fetch":`fetching the latest commits`,"reclaim-fetch":`fetching to reclaim the mirror`,"for-each-ref":`listing the branches`,checkout:`checking out the branch`,"checkout-update":`updating the checkout`,"rev-parse":`reading the commit`,"cat-file":`checking the mirror for the commit`,"show-ref":`reading the branch tip`,"detect-default-branch":`detecting the default branch`,git:`a git command`,"git-setup":`configuring git`,"stage-perms":`securing the credential stage`,install:`installing dependencies`,build:`building`,test:`running the tests`,"clear-markers":`clearing the build markers`,"lockfile-key":`hashing the lockfile`,"deps-store-dir":`preparing the dependency store`,"deps-scratch":`cloning a scratch tree for the dependency install`,"deps-install":`installing the dependency store`,"deps-harden":`locking down the installed dependencies`,"deps-commit":`recording the installed dependencies`,"deps-adopt":`adopting the dependency store`,"deps-restore-scratch":`restoring dependencies to scratch`,"deps-restore-chown":`setting the restored dependencies' owner`,"deps-restore-commit":`recording the restored dependencies`,"deps-scratch-chown":`setting the dependency scratch owner`,"deps-evict":`evicting an old dependency store`,"unlink-deps-view":`unlinking the dependency view`,"clear-installing-marker":`clearing the install marker`,chown:`setting the workspace owner`,"worktree-chown":`setting the worktree owner`,"op-chown":`setting the op tree's owner`,"worktree-clean":`cleaning the worktree`,"clean-workspace":`cleaning the workspace`,"clean-before-restore":`cleaning before the restore`,"unmount-restores":`unmounting earlier restores`,"mirror-restore-extract":`extracting the mirror snapshot`,"checkout-restore-extract":`extracting the checkout snapshot`,"deps-restore-extract":`extracting the dependency snapshot`,evict:`evicting a stale tree`,"thread-dir":`preparing a directory`,"threads-dir":`preparing a directory`,"op-dir":`preparing a directory`,"ops-dir":`preparing a directory`,"stage-dir":`preparing a directory`,stat:`checking a file`,touch:`touching a marker`,nproc:`counting CPUs`,mutex_wait:`waiting for the workspace`,kill:`stopping the previous step`};Object.keys(yt);function bt(e){return Object.prototype.hasOwnProperty.call(yt,e)?e:void 0}function xt(e){let t=bt(e);if(t!==void 0)return yt[t];if(e.endsWith(`-stale-sweep`)){let t=bt(e.slice(0,-12));if(t!==void 0)return`clearing leftovers before ${yt[t]}`}}var St={request:`the request`,"slack.receive":`receiving`,"dispatch.history":`reading the thread`,"dispatch.admission":`checking the thread`,"dispatch.ack_card":`posting the status card`,"dispatch.gate.repo":`checking the repo`,"dispatch.gate.pr_head":`checking the PR`,"dispatch.workspace.attach":`attaching the workspace`,"dispatch.gate.attached_head":`checking out the branch`,"dispatch.mcp_discovery":`loading tools`,"dispatch.compose":`preparing the prompt`,"dispatch.channel_visibility":`checking the channel`,"dispatch.repo_context":`reading the repo's context`,"dispatch.memory_read":`recalling memory`,"dispatch.refuse":`refusing`,"dispatch.ship_preflight":`checking the ship request`,"dispatch.ledger_claim":`claiming the run's row`,"run.agent":`the agent loop`,"run.command":`the command`,"run.reading_diff":`reading the diff (in parallel)`,"run.settle_reviewed_head":`re-checking the moved branch`,"run.description_turn":`asking for the PR description`,"run.observe_workspace":`checking the workspace`,"run.pr_post_step":`posting the PR`,"run.reading_diff_join":`waiting for the diff`,"run.pr_description_join":`waiting for the PR description`,"model.turn":`a model turn`,"ship.round":`a ship round`,"post.card_close":`closing the card`,"post.reply":`posting the reply`},Ct=`a Switchboard step`;function wt(e){if(e in St)return St[e];if(e.startsWith(`tool.`))return e.slice(5)||`a Switchboard step`;if(e.startsWith(`mcp.`)){let t=e.slice(e.lastIndexOf(`.`)+1);return t&&t!==`mcp`?t:Ct}for(let t of[`dispatch.workspace.attach.`,`run.command.`])if(e.startsWith(t))return xt(e.slice(t.length))??`a Switchboard step`;return Ct}var Tt=`A-Za-z0-9:@._-`;RegExp(`^[${Tt}]{1,128}$`),RegExp(`[^${Tt}]`,`g`);function Et(e){return e.type===`span_start`||e.type===`span_end`}function Dt(e,t,n){let r=e.get(t.spanId);if(t.type===`span_start`){if(r)return;e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?{}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.at??0,attrs:t.attrs??{}});return}e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?r?.parentSpanId===void 0?{}:{parentSpanId:r.parentSpanId}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.startedAt,endedAt:t.startedAt+t.durationMs,durationMs:t.durationMs,status:t.status,...t.error===void 0?{}:{errorMessage:t.error},attrs:{...r?.attrs??{},...t.attrs??{}}})}function Ot(){let e,t,n=[];return{push(r){e?t&&r.seq!==void 0&&t.seq!==void 0&&r.seq>t.seq+1&&t.at!==void 0&&r.at!==void 0&&n.push({kind:`gap`,fromSeq:t.seq+1,toSeq:r.seq-1,from:Math.min(t.at,r.at),to:Math.max(t.at,r.at)}):e={seq:r.seq??1,at:r.at},r.type===`run_note`&&r.kind===`spans_dropped`&&r.from!==void 0&&r.to!==void 0&&r.to>=r.from&&n.push({kind:`note`,from:r.from,to:r.to}),t={seq:r.seq,at:r.at}},losses(t={}){let r=t.elided??[],i=(e,t)=>r.some(n=>n.fromSeq<=e&&t<=n.toSeq),a=[];e&&e.seq>1&&t.windowStart!==void 0&&e.at!==void 0&&e.at>t.windowStart&&a.push({from:t.windowStart,to:e.at,kind:`lost`});for(let e of n)a.push(e.kind===`note`?{from:e.from,to:e.to,kind:`lost`}:{from:e.from,to:e.to,kind:i(e.fromSeq,e.toSeq)?`elided`:`lost`});return a}}}var kt=[/\bslack[\s-]?only\b/i,/\bpost\s*[:=]\s*(?:off|no|false|none)\b/i,/\bno[\s-]post\b/i,/\b(?:don['’]?t|do\s+not|never|skip|without)\s+(?:\w+\s+){0,2}?(?:post|comment)(?:ing|s)?\b/i,/\bno\s+need\s+to\s+(?:post|comment)\b/i];function At(e){return kt.some(t=>t.test(e))}var jt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Mt=/^[0-9a-f]{7,40}$/,Nt=/^(?![.-])(?!.*\.\.)(?!.*\/\/)(?!.*@\{)(?!.*\.lock$)(?!.*[./]$)[\w][\w./-]*$/;function Pt(e){return e&&jt.test(e)?`https://github.com/${e}`:void 0}function Ft(e,t){let n=Pt(e);if(!(!n||t===void 0||!Number.isInteger(t)||t<=0))return`${n}/pull/${t}`}function It(e,t){let n=Pt(e);if(n&&t&&Nt.test(t))return`${n}/tree/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function Lt(e,t){let n=Pt(e);if(n&&t&&Mt.test(t))return`${n}/commit/${t}`}function Rt(e){return e.slice(0,7)}function zt(e){if(e===`slack.receive`||e.startsWith(`dispatch.`))return`getting_ready`;let t=vt(e,`agent`);return t?.kind===`counted`&&t.bucket===`finishing_up`?`finishing_up`:void 0}function Bt(e){return e===`request`||e===`run.agent`}var Vt={getting_ready:`Getting ready`,finishing_up:`Finishing up`};function Ht(e){let t=e.rows.length,n=`${t} step${t===1?``:`s`}`,r=Vt[e.phase];if(t===0||e.rows.some(e=>e.open||e.at===void 0||e.durationMs===void 0))return`${r} · ${n}`;let i=Math.min(...e.rows.map(e=>e.at)),a=Math.max(...e.rows.map(e=>e.at+e.durationMs));return`${r} · ${n} · ${J(Math.max(0,a-i),`precise`)}`}function Ut(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{fromSeq:n,toSeq:r}=t,i=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;return!i(n)||!i(r)||n>r?null:{fromSeq:n,toSeq:r}}function Wt(e){let t=e.toSeq-e.fromSeq+1,n=t===1?`event ${e.fromSeq}`:`events ${e.fromSeq}–${e.toSeq}`;return`${t} ${t===1?`event`:`events`} not loaded (${n}) — the record has them`}function Gt(e,t,n){let r=!!e.model&&t!==null&&nn(e.model,t),i=r?t:e.model??t??void 0,a=!!e.model&&t!==null&&!r;return{spanId:e.spanId,label:e.label,chip:e.label.replace(/^Thought for /,``),quick:e.durationMs<6e4,durationMs:e.durationMs,facts:e.facts,...i?{model:i}:{},switched:a,showModel:!!i&&(!n||a),at:e.at}}function Kt(e){let t=`${e.n} tool call${e.n===1?``:`s`}`;if(e.n===0)return`no tool calls`;if(e.ok===e.n)return`${t}, all succeeded`;if(e.running===e.n)return`${t}, all running`;let n=[];return e.bad&&n.push(`${e.bad} failed`),e.infra&&n.push(`${e.infra} sandbox error${e.infra===1?``:`s`}`),e.running&&n.push(`${e.running} still running`),`${t}, ${n.join(`, `)}`}function qt(e){let{meta:t,prOpened:n}=e,r=t?.repo&&Pt(t.repo)?t.repo:void 0;if(t?.agent===`review`){if(At(e.requestText))return{text:`verdict, Slack only`};if(r&&t.pr!==void 0){let e=Ft(r,t.pr);return e?{text:`verdict for ${r}#${t.pr}`,href:e}:{text:`verdict`}}return{text:`verdict`}}if(t?.agent===`coding`&&n){let e=n.created?`pull request opened`:`pull request updated`,t=r?Ft(r,n.number):void 0;return t?{text:`${e} ${r}#${n.number}`,href:t}:{text:e}}return t?.agent===`command`?{text:`output`}:{text:`answer`}}function Jt(e,t){return{id:e.id,tool:e.tool,title:e.title,headline:e.headline,shell:e.shell,status:e.status,facts:[...e.facts],startedAt:e.startedAt,output:e.result?e.result.output||e.result.summary:``,hasResult:e.result!==void 0,chipOnly:!e.shell&&e.title===e.tool,durationMs:e.durationMs,exitCode:e.result?.exitCode,timedOut:ke(e.result?.exitCode),open:t}}function Yt(e={}){let t=e.openTags&&e.openTags.length>0?e.openTags:[`failed`,`infra`],n=pt(),r=pe({request:null,meta:null,context:[],log:[],reply:null,prOpened:null,placeholder:!0,allOpen:!1,stopMode:null,model:null,firstAt:null,lastAt:null,lastAtWall:null,elided:[],traceVersion:0}),i=Ot(),a=new Map,o=new Map,s=new Map,c=new Map,l=new Map,u=new Map,d=new Map,f=new Set,p=null,m=!1,h=-1,g=0,_=e=>`${e}-${g++}`;function v(e){return t.includes(`all`)?!0:e.some(e=>t.includes(e))}function y(e){let t=0,n=0,r=0;for(let i of e.items)i.kind===`call`&&(i.call.status===`failed`?t++:i.call.status===`infra`?n++:i.call.status===`running`&&r++);return{bad:t,infra:n,running:r}}function b(e){let{bad:t,infra:n,running:r}=y(e);(t||n||r)&&(e.groupOpen=!0)}function x(e){let t=o.get(h);t&&(t.live=!1),h=e.index;let n=p;p=null;let i=pe({kind:`step`,key:_(`step`),index:e.index,at:e.narration?e.narration.at:n?.at,turn:n,narration:e.narration?e.narration.text:null,note:`no commentary`,items:[],live:!0,manual:!1,groupOpen:!0});return o.set(e.index,i),r.log.push(i),i}function S(e){return o.get(e.index)??x(e)}function C(e,t){let n=S(e);if(t.quiet){f.add(t.id),n.items.push({kind:`quiet`,at:t.startedAt,text:`✎ ${t.tool===`update_status`?`status checklist updated`:t.title}`}),b(n);return}let i=pe(Jt(t,r.allOpen||v(t.tags)));u.set(t.id,i),d.set(t.id,n),n.items.push({kind:`call`,call:i}),b(n)}function w(e,t){if(f.has(t.id)){let t=o.get(e.index);t&&b(t);return}let n=u.get(t.id);if(!n){C(e,t);return}Object.assign(n,Jt(t,n.open)),v(t.tags)&&(n.open=!0);let r=o.get(e.index);r&&b(r)}function T(e){p&&=(r.log.push({kind:`turn`,key:_(`turn`),turn:p,note:e}),null)}function E(e){switch(r.placeholder=!1,e.kind){case`input`:{let t={text:e.text,at:e.at,...e.source?{source:e.source}:{}};r.request?r.log.push({kind:`followup`,key:_(`followup`),input:t}):r.request=t;return}case`step`:x(e.step);return;case`call`:C(e.step,e.call);return;case`result`:w(e.step,e.call);return;case`turn`:T(``),p=Gt(e,r.model,m),p.model&&(m=!0),e.model&&!(r.model!==null&&nn(e.model,r.model))&&(r.model=e.model);return;case`meta`:r.model===null&&e.model&&(r.model=e.model),r.meta={agent:e.agent,model:e.model,...e.effort?{effort:e.effort}:{},...e.repo?{repo:e.repo}:{},...e.ref?{ref:e.ref}:{},...e.pr===void 0?{}:{pr:e.pr},...e.headSha?{headSha:e.headSha}:{}};return;case`pr_opened`:r.prOpened={url:e.url,number:e.number,created:e.created};return;case`skill`:S(e.step).items.push({kind:`skill`,skill:e.skill});return;case`context`:r.context.push({key:_(`ctx`),at:e.at,text:e.text});return;case`note`:if(e.noteKind===`follow_up`)return;r.log.push({kind:`note`,key:_(`note`),at:e.at,replay:!1,text:e.text}),(e.noteKind===`stop_requested`||e.noteKind===`stopped`)&&(e.mode===`soft`||e.mode===`hard`)&&j(e.mode);return;case`replay_note`:r.log.push({kind:`note`,key:_(`note`),replay:!0,text:e.text});return;case`span`:{if(Bt(e.name)){e.name===`run.agent`&&e.open&&D(`getting_ready`);return}e.name.startsWith(`post.`)&&e.open&&D(`finishing_up`);let t=s.get(e.spanId);if(t){t.open=e.open,e.durationMs!==void 0&&(t.durationMs=e.durationMs),e.status&&(t.status=e.status);return}let n=pe({kind:`span`,key:_(`span`),spanId:e.spanId,text:wt(e.name),open:e.open,...e.durationMs===void 0?{}:{durationMs:e.durationMs},...e.status?{status:e.status}:{},at:e.open?e.at:e.startedAt??e.at});s.set(e.spanId,n);let i=zt(e.name);if(i){let t=l.get(i);t||(t={group:pe({kind:`phase`,phase:i,key:_(i),rows:[],open:!0}),toggled:!1},l.set(i,t),r.log.push(t.group)),t.group.rows.push(n),c.set(e.spanId,t.group);return}r.log.push(n);return}case`answer`:T(`wrote the reply below`),r.reply={text:e.text,at:e.at};return}}function D(e){let t=l.get(e);t&&!t.toggled&&(t.group.open=!1)}function ee(e){let t=e,o=t?.type===`span_start`||t?.type===`span_end`;if(t&&typeof t.type==`string`){let t=e;i.push(t),Et(t)&&Dt(a,t,``),r.traceVersion++}t&&!o&&typeof t.at==`number`&&((r.firstAt===null||t.at<r.firstAt)&&(r.firstAt=t.at),(r.lastAt===null||t.at>=r.lastAt)&&(r.lastAt=t.at,r.lastAtWall=Ee()));for(let t of n.push(e))E(t)}function O(){for(let e of u.values())if(e.status===`running`)return e;return null}function k(e){r.allOpen=e;for(let t of l.values())t.group.open=e,t.toggled=!0;for(let t of u.values())t.open=e}function A(e){if(e.startsWith(`call-`)){let t=e.slice(5),n=d.get(t);return!n||!u.has(t)?!1:(n.manual=!0,n.groupOpen=!0,!0)}if(e.startsWith(`span-`)){let t=e.slice(5),n=c.get(t);if(n){n.open=!0;let e=l.get(n.phase);return e&&(e.toggled=!0),!0}if(s.has(t))return!0;for(let e of r.log)if(e.kind===`step`&&e.turn?.spanId===t||e.kind===`turn`&&e.turn.spanId===t)return!0}return!1}function j(e){r.stopMode=e}function te(e){r.elided.push(e),r.log.push({kind:`note`,key:_(`note`),replay:!0,text:Wt(e)}),r.placeholder=!1,r.traceVersion++}return{state:r,handle:ee,noteElided:te,spanSet:()=>[...a.values()],losses:e=>i.losses({windowStart:e,elided:r.elided}),pendingCall:O,flushPendingTurn:T,closePhases(){D(`getting_ready`),D(`finishing_up`)},setAllOpen:k,togglePhase(e){e.open=!e.open;let t=l.get(e.phase);t&&(t.toggled=!0)},reveal:A,callHeadline:e=>u.get(e)?.headline,toggleGroup(e){e.manual=!0,e.groupOpen=!e.groupOpen},toggleCall(e){e.open=!e.open},markStopping:j,opensByDefault:v}}function Xt(e,t){return e.lastAt===null||e.lastAtWall===null?null:e.lastAt+(t-e.lastAtWall)}function Zt(e,t){return{now:n=>e.serverNow+(n-t),elapsedMs(t){return Ae(e,this.now(t))??0},elapsedAt(t){return Ae({receivedAt:e.receivedAt,startedAt:e.startedAt,finishedAt:t})??0}}}function Qt(e){if(typeof e!=`string`)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!=`object`||!t)return{};let{sealedAt:n,replyOk:r}=t;return{...typeof n==`number`&&Number.isFinite(n)&&n>0?{sealedAt:n}:{},...typeof r==`boolean`?{replyOk:r}:{}}}function $t(e){return e.replyOk===!1?`reply failed`:e.replyOk!==!0||e.finishedAt===void 0||e.sealedAt===void 0?``:`delivered in ${J(Math.max(0,e.sealedAt-e.finishedAt),`clock`)}`}function en(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{finishedAt:n}=t;return typeof n==`number`&&Number.isFinite(n)&&n>0?{finishedAt:n}:null}var tn=Symbol(`sb-runner-clock`);function nn(e,t){return e===t||!e.includes(`/`)!=!t.includes(`/`)&&rn(e)===rn(t)}function rn(e){if(!e)return`model`;let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1))||e}var an=6e4;function on(e,t,n){let r=Xt(e,n);if(r===null||e.lastAt===null)return{kind:`starting`};if(t)return{kind:`call`,call:t,elapsedMs:Math.max(0,r-(t.startedAt??e.lastAt))};let i=Math.max(0,r-e.lastAt);return{kind:`thinking`,elapsedMs:i,slow:i>=an}}var sn=[`id`,`open`,`title`,`data-status`,`data-heat`],cn={key:0,class:`spin inline-block size-[0.7em] shrink-0 animate-spin self-center rounded-full border-2 border-accented border-t-info motion-reduce:animate-none`,role:`img`,"aria-label":`running`},ln={key:2,class:`dollar shrink-0 select-none text-dimmed`},un={key:3,class:`tool shrink-0 rounded bg-accented px-1.5 text-xs leading-normal text-muted`},dn={key:0,class:`cmd brief min-w-0 flex-1 truncate text-info`},fn={key:1,class:`cmd full min-w-0 flex-1 whitespace-pre-wrap break-words text-info max-sm:order-last max-sm:basis-full`},pn={key:5,class:`cmd min-w-0 flex-1`},mn={class:`facts ml-auto flex shrink-0 gap-2.5 text-xs tabular-nums text-muted`},hn={key:0,class:`fact elapsed`,title:`since this call started (runner clock)`},gn={key:0,class:`over rounded bg-bad/15 px-1 font-semibold text-bad`},_n={key:1,class:`over rounded bg-bad/15 px-1 font-semibold text-bad`},vn={class:`body`},yn={key:1,class:`none px-3 py-1.5 text-xs italic text-dimmed`},bn={key:2,class:`none px-3 py-1.5 text-xs italic text-dimmed`},xn=N({__name:`CallCard`,props:{call:{}},setup(e){let t=e,n=h(tn,null),r=V(()=>{let e=n?.value;return t.call.status!==`running`||typeof e!=`number`||t.call.startedAt===void 0?``:J(Math.max(0,e-t.call.startedAt),`clock`)}),i=V(()=>Me(t.call.durationMs,`tool`,t.call.timedOut)),a=V(()=>Fe(i.value)),o=V(()=>t.call.durationMs===void 0?-1:t.call.facts.length-1);function s(){t.call.open=!t.call.open}return(t,n)=>(W(),H(`details`,{id:`call-${e.call.id}`,class:G([`call rounded-md border border-default bg-elevated open:bg-accented/40`,e.call.status]),open:e.call.open,title:typeof e.call.startedAt==`number`?`started ${P(Re)(e.call.startedAt)}`:void 0,"data-status":e.call.status,"data-heat":i.value.level},[F(`summary`,{class:G([`flex min-w-0 cursor-pointer list-none items-baseline gap-3 rounded-md pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 hover:bg-accented/60 focus-visible:outline-2 focus-visible:outline-primary max-sm:flex-wrap [&::-webkit-details-marker]:hidden`,e.call.open?`rounded-b-none border-b border-default`:``]),onClick:T(s,[`prevent`])},[F(`span`,{class:G([`chev shrink-0 select-none text-xs text-dimmed transition-transform motion-reduce:transition-none`,e.call.open?`rotate-90`:``])},`❯`,2),e.call.status===`running`?(W(),H(`span`,cn)):(W(),H(`span`,{key:1,class:G([`glyph w-[1em] shrink-0 text-center font-bold`,e.call.status===`ok`?`text-ok`:e.call.status===`failed`?`text-bad`:`text-warn`])},K(e.call.status===`ok`?`✓`:e.call.status===`failed`?`✗`:`⚠`),3)),e.call.shell?(W(),H(`span`,ln,`$`)):(W(),H(`span`,un,K(e.call.tool),1)),e.call.chipOnly?(W(),H(`span`,pn)):(W(),H(B,{key:4},[e.call.open?(W(),H(`code`,fn,K(e.call.title),1)):(W(),H(`code`,dn,K(e.call.headline),1))],64)),F(`span`,mn,[r.value?(W(),H(`span`,hn,K(r.value),1)):R(``,!0),(W(!0),H(B,null,U(e.call.facts,(t,n)=>(W(),H(B,{key:n},[n===o.value&&i.value.over?(W(),H(`span`,gn,`timed out`)):R(``,!0),F(`span`,{class:G([`fact`,[e.call.status!==`ok`&&n===0?`text-bad`:``,n===o.value&&i.value.over?`font-semibold text-bad`:``,n===o.value&&a.value?`heat`:``,n===o.value&&i.value.level>=2&&!i.value.over?`font-medium`:``]]),style:A(n===o.value?a.value:void 0)},K(t),7)],64))),128)),i.value.over&&o.value===-1?(W(),H(`span`,_n,`timed out`)):R(``,!0)])],2),F(`div`,vn,[e.call.hasResult&&e.call.output?(W(),H(`pre`,{key:0,class:G([`out max-h-[28rem] overflow-auto whitespace-pre-wrap break-words px-3.5 py-2.5 font-mono leading-normal`,e.call.status===`failed`?`text-bad`:`text-toned`])},K(e.call.output),3)):e.call.hasResult?(W(),H(`div`,yn,`no output`)):(W(),H(`div`,bn,`no output yet`))])],10,sn))}}),Sn=[`title`],Cn=[`title`],wn={class:`skillname whitespace-nowrap font-semibold text-skill`},Tn={key:0,class:`skilldesc min-w-0 flex-1 truncate text-xs text-muted`},En={class:`facts ml-auto flex shrink-0 gap-2.5 text-xs text-muted`},Dn=[`href`],On={class:`fact`},kn=N({__name:`StepItems`,props:{items:{}},setup(e){function t(e){return e>0?e<1024?`${e} B`:e<1048576?`${(Math.round(e/102.4)/10).toFixed(1)} KB`:`${(Math.round(e/104857.6)/10).toFixed(1)} MB`:`0 B`}return(n,r)=>(W(!0),H(B,null,U(e.items,(e,n)=>(W(),H(B,{key:n},[e.kind===`call`?(W(),k(xn,{key:0,call:e.call},null,8,[`call`])):e.kind===`quiet`?(W(),H(`div`,{key:1,class:`quiet flex items-baseline gap-3 pl-3 pr-(--sb-gutter) py-0.5 text-xs text-dimmed`,title:e.at===void 0?void 0:P(Re)(e.at)},[F(`span`,null,K(e.text),1)],8,Sn)):(W(),H(`div`,{key:2,class:`skill flex items-baseline gap-2.5 pl-3 pr-(--sb-gutter) py-0.5`,title:e.skill.at===void 0?void 0:P(Re)(e.skill.at)},[r[0]||=F(`span`,{class:`skillmark shrink-0 select-none text-xs`},`📚`,-1),F(`span`,wn,`skill `+K(e.skill.name),1),e.skill.description?(W(),H(`span`,Tn,K(e.skill.description),1)):R(``,!0),F(`span`,En,[e.skill.source?(W(),H(`a`,{key:0,class:`fact text-primary hover:underline`,href:e.skill.source,target:`_blank`,rel:`noopener noreferrer`},`source`,8,Dn)):R(``,!0),F(`span`,On,K(t(e.skill.bodyBytes))+` into context`,1)])],8,Cn))],64))),128))}}),An=[`id`,`data-live`],jn={class:`head flex items-baseline gap-x-6 pb-1.5 pr-(--sb-gutter)`},Mn={class:`min-w-0 flex-1`},Nn={key:0,class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 text-xs tabular-nums text-dimmed`},Pn=[`data-heat`,`title`],Fn=[`title`],In=[`title`],Ln={key:2,class:`nonar font-sans text-sm italic text-dimmed`},Rn=[`title`],zn={key:0,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},Bn={key:1,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},Vn={class:`nonar flex-1 font-sans text-sm italic text-dimmed`},Hn={class:`calls flex flex-col gap-2`},Un=[`open`,`data-group-open`],Wn=[`title`],Gn=[`data-ok`,`data-bad`,`data-infra`,`data-running`],Kn=[`data-heat`],qn={class:`gbody flex flex-col gap-2 pb-1 pt-1.5`},Jn=N({__name:`StepBlock`,props:{step:{}},emits:[`toggleGroup`],setup(e,{emit:t}){let n=e,r=t,i=V(()=>n.step.items.filter(e=>e.kind===`call`)),a=V(()=>i.value.length>=2),o=V(()=>{let e=0,t=0,n=0,r=0,a=0;for(let o of i.value){if(o.kind!==`call`)continue;let i=o.call;i.status===`ok`?e++:i.status===`failed`?t++:i.status===`infra`?n++:r++,typeof i.durationMs==`number`&&(a+=i.durationMs)}return{n:e+t+n+r,ok:e,bad:t,infra:n,running:r,ms:a}}),s=V(()=>Kt(o.value)),c=V(()=>i.value.some(e=>e.kind===`call`&&e.call.timedOut)),l=V(()=>Me(o.value.ms,`tool`,c.value)),u=V(()=>Fe(l.value)),d=V(()=>n.step.turn?Me(n.step.turn.durationMs,`turn`):void 0),f=V(()=>d.value?Fe(d.value):void 0),p=V(()=>{let e=i.value[0];return e?.kind===`call`?e.call.startedAt:void 0});return(t,n)=>(W(),H(`li`,{id:e.step.turn?`span-${e.step.turn.spanId}`:void 0,class:G([`step relative border-l-2 pb-3 pl-3 pt-2`,e.step.live?`border-ok/40`:`border-(--ui-border-accented)/50`]),"data-live":e.step.live?`1`:void 0},[F(`div`,jn,[F(`div`,Mn,[e.step.turn?(W(),H(`div`,Nn,[F(`span`,{class:G([`thought`,[f.value?`heat`:``,d.value&&d.value.level>=2?`font-medium`:``]]),style:A(f.value),"data-heat":d.value?.level,title:e.step.turn.label},`thought `+K(e.step.turn.chip),15,Pn),e.step.turn.switched?(W(),H(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-semibold text-warn`,title:`model changed: this turn ran on ${e.step.turn.model}`},`⇄ `+K(P(rn)(e.step.turn.model)),9,Fn)):e.step.turn.showModel?(W(),H(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-semibold leading-normal tracking-wider text-muted`,title:e.step.turn.model},K(P(rn)(e.step.turn.model)),9,In)):R(``,!0),(W(!0),H(B,null,U(e.step.turn.facts,(e,t)=>(W(),H(`span`,{key:t,class:`fact`},K(e),1))),128))])):e.step.narration===null?(W(),H(`span`,Ln,K(e.step.note),1)):(W(),k(ct,{key:1,text:e.step.narration},null,8,[`text`]))]),e.step.at===void 0?R(``,!0):(W(),H(`span`,{key:0,class:`ts shrink-0 select-none text-xs tabular-nums text-dimmed`,title:P(Re)(e.step.at)},K(P(Qe)(e.step.at)),9,Rn))]),e.step.turn&&e.step.narration!==null?(W(),H(`div`,zn,[L(ct,{text:e.step.narration},null,8,[`text`])])):e.step.turn&&e.step.narration===null&&!e.step.turn.facts.length?(W(),H(`div`,Bn,[F(`span`,Vn,K(e.step.note),1)])):R(``,!0),F(`div`,Hn,[a.value?(W(),H(`details`,{key:1,class:`grp`,open:e.step.groupOpen,"data-group-open":e.step.groupOpen?`1`:`0`},[F(`summary`,{class:`gsummary flex cursor-pointer list-none items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1 text-xs text-dimmed hover:bg-accented/40 hover:text-muted focus-visible:outline-2 focus-visible:outline-primary [&::-webkit-details-marker]:hidden`,title:typeof p.value==`number`?`calls began ${P(Re)(p.value)}`:void 0,onClick:n[0]||=T(e=>r(`toggleGroup`),[`prevent`])},[F(`span`,{class:G([`gchev shrink-0 select-none transition-transform motion-reduce:transition-none`,e.step.groupOpen?`rotate-90`:``])},`❯`,2),F(`span`,{class:G([`gcount`,o.value.bad||o.value.infra?`text-bad`:``]),"data-ok":o.value.ok,"data-bad":o.value.bad,"data-infra":o.value.infra,"data-running":o.value.running},K(s.value),11,Gn),o.value.ms>0?(W(),H(`span`,{key:0,class:G([`gtime ml-auto tabular-nums`,[u.value?`heat`:``,l.value.over?`font-semibold text-bad`:l.value.level>=2?`font-medium`:``]]),style:A(u.value),"data-heat":l.value.level},[l.value.over?(W(),H(B,{key:0},[z(`timed out · `)],64)):R(``,!0),z(K(P(J)(o.value.ms,`clock`)),1)],14,Kn)):R(``,!0)],8,Wn),F(`div`,qn,[L(kn,{items:e.step.items},null,8,[`items`])])],8,Un)):(W(),k(kn,{key:0,items:e.step.items},null,8,[`items`]))])],10,An))}}),Yn=[`id`],Xn={class:`what`},Zn={key:0,class:`text-dimmed`},Qn={key:1,class:`dur tabular-nums text-dimmed`},$n=[`title`],er=N({__name:`SpanRow`,props:{item:{}},setup(e){return(t,n)=>(W(),H(`li`,{id:`span-${e.item.spanId}`,class:`span flex items-baseline gap-2 py-0.5 pr-(--sb-gutter) text-xs text-muted`},[F(`span`,{class:G([`glyph select-none`,e.item.status===`error`?`text-bad`:`text-dimmed`])},K(e.item.open?`◌`:e.item.status===`error`?`✗`:`◷`),3),F(`span`,Xn,K(e.item.text),1),e.item.open?(W(),H(`span`,Zn,`…`)):e.item.durationMs===void 0?R(``,!0):(W(),H(`span`,Qn,K(P(J)(e.item.durationMs,`precise`)),1)),e.item.at===void 0?R(``,!0):(W(),H(`span`,{key:2,class:`ts ml-auto select-none text-dimmed`,title:P(Re)(e.item.at)},K(P(Qe)(e.item.at)),9,$n))],8,Yn))}}),tr={"getting ready":`paint-ready`,thinking:`paint-thinking`,"in tools":`paint-tools`,"finishing up":`paint-finishing`,"Switchboard overhead":`paint-overhead`,"not recorded":`paint-lost`,"not loaded":`paint-elided`},nr={getting_ready:`getting ready`,finishing_up:`finishing up`};function rr(e){return tr[nr[e]]}var ir={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},ar={class:`mb-2 flex items-baseline gap-2.5 text-xs font-semibold uppercase tracking-wider text-muted`},or={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},sr=[`href`],cr={class:`lede text-sm text-toned`},lr={class:`shape tabular-nums`},ur={key:0,class:`current text-muted`},dr={key:0,class:`note mt-0.5 text-xs text-muted`},fr=[`aria-label`],pr=[`title`,`data-term`],mr={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs`},hr=[`title`,`data-term`],gr={class:`term text-muted`},_r={class:`ms tabular-nums text-toned`},vr=[`title`],yr={class:`ranked mt-1 flex flex-col gap-1 text-xs`},br={class:`ms w-14 shrink-0 tabular-nums text-toned`},xr=[`href`,`data-anchor`,`onClick`],Sr=N({__name:`TimelineSection`,props:{vm:{},eventsHref:{}},emits:[`reveal`],setup(e,{emit:t}){let n=e,r=t;function i(e){return`${J(e.ms,`clock`)} ${e.term}${e.hatched?` (in flight)`:``}`}function a(){o.copyText(JSON.stringify(n.vm.debug,null,2))}return(t,n)=>(W(),H(`section`,ir,[F(`h2`,ar,[n[0]||=F(`span`,null,`Where the time went`,-1),F(`span`,or,[e.eventsHref?(W(),H(`a`,{key:0,class:`text-dimmed no-underline hover:text-primary hover:underline`,href:e.eventsHref,title:`the stored events, as JSON lines`},`raw events`,8,sr)):R(``,!0),F(`button`,{type:`button`,class:`debug cursor-pointer text-dimmed hover:text-toned`,title:`the partition and the raw span names, for a bug report`,onClick:a},` Copy debug JSON `)])]),F(`p`,cr,[F(`span`,lr,K(e.vm.shown?e.vm.total:e.vm.lede),1),e.vm.current?(W(),H(`span`,ur,` · `+K(e.vm.current),1)):R(``,!0)]),(W(!0),H(B,null,U(e.vm.captions,e=>(W(),H(`p`,{key:e,class:`caption mt-0.5 text-xs text-muted`},K(e),1))),128)),e.vm.note?(W(),H(`p`,dr,K(e.vm.note),1)):R(``,!0),e.vm.shown?(W(),H(B,{key:1},[F(`div`,{class:`bar mt-2.5 flex h-2 w-full overflow-hidden rounded-sm`,role:`img`,"aria-label":e.vm.lede},[(W(!0),H(B,null,U(e.vm.bar,(e,t)=>(W(),H(`div`,{key:t,class:G([`seg h-full`,[P(tr)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:A({width:`${e.pct}%`}),title:i(e),"data-term":e.term},null,14,pr))),128))],8,fr),F(`ul`,mr,[(W(!0),H(B,null,U(e.vm.legend,e=>(W(),H(`li`,{key:e.term,class:`flex items-baseline gap-1.5 cursor-help`,title:e.definition,"data-term":e.term},[F(`span`,{class:G([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,P(tr)[e.term]])},null,2),F(`span`,gr,K(e.term),1),F(`span`,_r,K(e.text),1)],8,hr))),128))]),e.vm.ranked.length>0?(W(),H(B,{key:0},[F(`h3`,{class:`ranked-head mt-3 inline-block cursor-help text-xs font-semibold text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.rankedNote},` Longest steps `,8,vr),F(`ol`,yr,[(W(!0),H(B,null,U(e.vm.ranked,(e,t)=>(W(),H(`li`,{key:t,class:`flex items-baseline gap-2`},[F(`span`,br,K(P(J)(e.ms,`clock`)),1),F(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:T(t=>r(`reveal`,e.anchor),[`prevent`])},K(e.label),9,xr),(W(!0),H(B,null,U(e.facts,e=>(W(),H(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},K(e),1))),128))]))),128))])],64)):R(``,!0)],64)):R(``,!0)]))}}),Cr=[`data-position`],wr={class:`mb-2 flex items-baseline gap-2.5 text-xs font-semibold uppercase tracking-wider text-ok`},Tr=[`href`],Er={key:1,class:`caption font-normal normal-case tracking-normal text-dimmed`},Dr=[`title`],Or=N({__name:`ReplyBlock`,props:{text:{},at:{},caption:{},when:{},whenTitle:{},position:{}},setup(e){return(t,n)=>(W(),H(`section`,{id:`reply`,class:G([`block rounded-lg border border-ok/40 bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,e.position===`first`?`mb-4`:`mt-6`]),"data-position":e.position},[F(`h2`,wr,[n[0]||=F(`span`,null,`Reply`,-1),e.caption.href?(W(),H(`a`,{key:0,class:`caption font-normal normal-case tracking-normal text-dimmed no-underline hover:text-primary hover:underline`,href:e.caption.href,target:`_blank`,rel:`noopener noreferrer`},K(e.caption.text),9,Tr)):(W(),H(`span`,Er,K(e.caption.text),1)),F(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:e.whenTitle},K(e.when),9,Dr)]),L(ct,{text:e.text},null,8,[`text`])],10,Cr))}});function kr(e,t){let{window:n,owner:r,finished:i}=t,a=Math.max(0,n.end-n.start),o=new Map(e.map(e=>[e.spanId,e])),s=new Map,c=e=>{let t=s.get(e.spanId);if(t!==void 0)return t;s.set(e.spanId,1);let n=e.parentSpanId?o.get(e.parentSpanId):void 0,r=n?c(n)+1:1;return s.set(e.spanId,r),r},l=e=>{let t=e,n=new Set;for(;t&&!n.has(t.spanId);){if(n.add(t.spanId),vt(t.name,r)?.kind===`background`)return!0;t=t.parentSpanId?o.get(t.parentSpanId):void 0}return!1},u=t.losses.map(e=>Math.max(n.start,e.from)).sort((e,t)=>e-t),d=e=>{if(e.endedAt!==void 0)return Math.min(n.end,e.endedAt);if(!i)return n.end;let t=u.find(t=>t>e.startedAt);return t===void 0?n.end:Math.min(n.end,t)},f=[],p=[];for(let t of e){let e=vt(t.name,r);if(!e)continue;let i=Math.max(n.start,t.startedAt);if(e.kind===`background`){let e=Math.min(n.end,t.endedAt??n.end);e>i&&p.push([i,e]);continue}if(e.kind!==`counted`||l(t))continue;let a=d(t);a<=i||f.push({start:i,end:a,bucket:e.bucket,depth:c(t),startedAt:t.startedAt,spanId:t.spanId})}f.sort((e,t)=>t.depth-e.depth||e.startedAt-t.startedAt||(e.spanId<t.spanId?-1:+(e.spanId>t.spanId)));let m=new Set([n.start,n.end]);for(let e of f)m.add(e.start),m.add(e.end);for(let e of t.losses)m.add(Ar(e.from,n)),m.add(Ar(e.to,n));for(let[e,t]of p)m.add(e),m.add(t);let h=[...m].filter(e=>e>=n.start&&e<=n.end).sort((e,t)=>e-t),g={getting_ready:0,thinking:0,tools:0,finishing_up:0},_=0,v=0,y=0;for(let e=0;e+1<h.length;e++){let r=h[e],i=h[e+1],a=i-r;if(a<=0)continue;let o=f.find(e=>e.start<=r&&e.end>=i);if(o){g[o.bucket]+=a;continue}if(t.losses.some(e=>e.kind===`lost`&&Ar(e.from,n)<=r&&Ar(e.to,n)>=i)){_+=a;continue}if(t.losses.some(e=>e.kind===`elided`&&Ar(e.from,n)<=r&&Ar(e.to,n)>=i)){v+=a;continue}p.some(([e,t])=>e<=r&&t>=i)&&(y+=a)}let b=g.getting_ready+g.thinking+g.tools+g.finishing_up;return{windowMs:a,gettingReadyMs:g.getting_ready,thinkingMs:g.thinking,toolsMs:g.tools,finishingUpMs:g.finishing_up,overheadMs:Math.max(0,a-b-_-v),notRecordedMs:_,notLoadedMs:v,backgroundOnlyMs:y}}function Ar(e,t){return Math.min(t.end,Math.max(t.start,e))}function jr(e){let t=Math.floor(e.windowMs/1e3),n=[[`getting ready`,Math.floor(e.gettingReadyMs/1e3)],[`thinking`,Math.floor(e.thinkingMs/1e3)],[`in tools`,Math.floor(e.toolsMs/1e3)],[`finishing up`,Math.floor(e.finishingUpMs/1e3)],[`not recorded`,Math.floor(e.notRecordedMs/1e3)],[`not loaded`,Math.floor(e.notLoadedMs/1e3)]],r=n.reduce((e,[,t])=>e+t,0),i=n.filter(([,e])=>e>0).map(([e,t])=>({term:e,s:t})),a=t-r;a>0&&i.push({term:`Switchboard overhead`,s:a});let o=[`getting ready`,`thinking`,`in tools`,`finishing up`,`Switchboard overhead`,`not recorded`,`not loaded`];return i.sort((e,t)=>o.indexOf(e.term)-o.indexOf(t.term)),{totalS:t,items:i}}function Mr(e){return[e.gettingReadyMs,e.thinkingMs,e.toolsMs,e.finishingUpMs,e.overheadMs,e.notRecordedMs,e.notLoadedMs].filter(t=>t>=2e3||e.windowMs>0&&t/e.windowMs>=.05).length>=2}function Nr(e,t){if(t===void 0||t<6e4)return;let n=J(t,`clock`);return e===`before`?`queued ${n} before we saw it`:`queued ${n} behind the previous run`}var Pr={"getting ready":`before the agent's first turn: reading the thread, finding the repo, checking out, loading tools`,thinking:`the model's turns — from a request to the model until its reply came back`,"in tools":`the commands and tool calls the model ran`,"finishing up":`after the agent's last turn: posting the PR, checking the workspace`,"Switchboard overhead":`orchestration between steps, and moments when only a background read was running — the time no step claims`,"not recorded":`a stretch of the run the record does not carry`,"not loaded":`a stretch of the run this page did not load — the record has the full shape`},Fr=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,Ir=`currently delivering`,Lr=`getting ready: not recorded (too large)`,Rr=`no timing data`,zr=`not loaded (the record has the full shape)`,Br={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function Vr(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=kr(t,{window:n,owner:r,finished:i,losses:e.losses}),o=jr(a),s=J(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?Ur(t,r,n):void 0,u=Gr(e,l),d=l?wt(l.name):``,f={window:n,owner:r,phase:e.phase,partition:a,spans:t.map(e=>({spanId:e.spanId,parentSpanId:e.parentSpanId,name:e.name,startedAt:e.startedAt,endedAt:e.endedAt,status:e.status,attrs:e.attrs}))};if(e.untimed)return{total:s,current:u,openStep:d,captions:[],rankedNote:Fr,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:Rr};let p={total:s,current:u,openStep:d,captions:[Nr(`before`,Hr(c,`queuedBeforeMs`)),Nr(`behind`,Hr(c,`queuedBehindMs`))].filter(e=>e!==void 0),rankedNote:Fr,debug:f};if(!c)return{...p,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:i?Lr:``};let m=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?zr:t,h=Mr(a)&&o.items.length>0,g=h?`${s} — ${o.items.map(({term:e,s:t})=>`${J(t*1e3,`clock`)} ${m(e)}`).join(` · `)}`:a.windowMs>0?`${s} — ${m(qr(a))}`:s,_=h?o.items.map(({term:t,s:n})=>({term:t,text:J(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${Pr[t]} (too large)`:Pr[t]})):[];return{...p,lede:g,shown:h,bar:h?Jr(a,l):[],legend:_,ranked:h?Yr(t,c,r,n,e.callTitle):[],note:``}}function Hr(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function Ur(e,t,n){let r=new Map(e.map(e=>[e.spanId,e])),i=e=>{let t=1,n=new Set([e.spanId]),i=e.parentSpanId?r.get(e.parentSpanId):void 0;for(;i&&!n.has(i.spanId);)n.add(i.spanId),t++,i=i.parentSpanId?r.get(i.parentSpanId):void 0;return t},a;for(let o of e){if(o.endedAt!==void 0||o.startedAt>=n.end)continue;let e=vt(o.name,t);if(e?.kind!==`counted`||Wr(o,r,t))continue;let s=i(o);(!a||s>a.depth||s===a.depth&&o.startedAt>a.span.startedAt)&&(a={span:o,depth:s,bucket:e.bucket})}if(a)return{bucket:a.bucket,name:a.span.name,elapsedMs:Math.max(0,n.end-Math.max(n.start,a.span.startedAt))}}function Wr(e,t,n){let r=e,i=new Set;for(;r&&!i.has(r.spanId);){if(i.add(r.spanId),vt(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function Gr(e,t){return e.phase===`delivering`?Ir:e.phase===`ended`?$t(e.delivery??{}):t?`currently ${Br[t.bucket]} ${J(t.elapsedMs,`clock`)}`:``}function Kr(e){return[[`getting ready`,e.gettingReadyMs],[`thinking`,e.thinkingMs],[`in tools`,e.toolsMs],[`finishing up`,e.finishingUpMs],[`Switchboard overhead`,e.overheadMs],[`not recorded`,e.notRecordedMs],[`not loaded`,e.notLoadedMs]]}function qr(e){let t=[`getting ready`,-1];for(let n of Kr(e))n[1]>t[1]&&(t=n);return t[0]}function Jr(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of Kr(e))if(!(a<=0)){if(t&&Br[t.bucket]===i){let e=Math.min(t.elapsedMs,a);a-e>0&&n.push({term:i,ms:a-e,pct:r(a-e),hatched:!1}),e>0&&n.push({term:i,ms:e,pct:r(e),hatched:!0});continue}n.push({term:i,ms:a,pct:r(a),hatched:!1})}return n}function Yr(e,t,n,r,i){let a=new Map(e.map(e=>[e.spanId,e])),o=new Map;for(let t of e){if(t.parentSpanId===void 0)continue;let e=o.get(t.parentSpanId);e?e.push(t):o.set(t.parentSpanId,[t])}let s=e=>[Math.max(r.start,e.startedAt),Math.min(r.end,e.endedAt??r.end)],c=[];for(let r of e){if(r===t||r.name===`run.agent`||vt(r.name,n)===void 0||Wr(r,a,n))continue;let[e,l]=s(r);if(l<=e)continue;let u=(o.get(r.spanId)??[]).map(s).map(([t,n])=>[Math.max(e,t),Math.min(l,n)]).filter(([e,t])=>t>e),d=l-e-Xr(u);if(d<=0)continue;let f=r.name.startsWith(`tool.`)&&typeof r.attrs.callId==`string`?r.attrs.callId:void 0,p=f?i?.(f):void 0;c.push({label:p??wt(r.name),ms:d,facts:Zr(r),anchor:f?`call-${f}`:`span-${r.spanId}`,startedAt:r.startedAt})}return c.sort((e,t)=>t.ms-e.ms||e.startedAt-t.startedAt),c.slice(0,3).map(({label:e,ms:t,facts:n,anchor:r})=>({label:e,ms:t,facts:n,anchor:r}))}function Xr(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=0,r;for(let[e,i]of t)!r||e>r[1]?(r&&(n+=r[1]-r[0]),r=[e,i]):i>r[1]&&(r[1]=i);return r&&(n+=r[1]-r[0]),n}function Zr(e){let t=e.attrs,n=[];return(t.token===`expired`||t.token===`expiring`)&&n.push(`token ${t.token}`),t.budget===`clipped`&&n.push(`budget clipped`),typeof t.timeoutMs==`number`&&n.push(`timeout ${J(t.timeoutMs,`clock`)}`),typeof t.waitedMs==`number`&&n.push(`waited ${J(t.waitedMs,`clock`)}`),typeof t.exitCode==`number`&&t.exitCode!==0&&n.push(`exit ${t.exitCode}`),t.timedOut===!0&&n.push(`timed out`),typeof t.attempts==`number`&&t.attempts>1&&n.push(`${t.attempts} attempts`),e.status===`error`&&n.length===0&&n.push(`failed`),n}function Qr(e){return e===`command`?`command`:`agent`}function $r(e){return e.description?.title?e.description.title:e.pr.repo&&e.pr.number!==void 0?`${e.pr.repo}#${e.pr.number}`:e.pr.repo??`PR review`}var ei=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,ti=/^[0-9a-f]{7,40}$/;function ni(e){if(!e.repo||!ei.test(e.repo))return{};let t=`https://github.com/${e.repo}`,n={};return e.number!==void 0&&Number.isInteger(e.number)&&e.number>0&&(n.pr=`${t}/pull/${e.number}`,n.files=`${t}/pull/${e.number}/files`),e.headSha&&ti.test(e.headSha)&&(n.commit=e.number!==void 0&&n.pr?`${t}/pull/${e.number}/commits/${e.headSha}`:`${t}/commit/${e.headSha}`),n}function ri(e,t){if(!e.repo||!ei.test(e.repo)||!e.headSha||!ti.test(e.headSha))return;let n=t.path.split(`/`),r=/[\\\u0000-\u001f]/;if(n.some(e=>e===``||e===`.`||e===`..`||r.test(e)))return;let i=n.map(encodeURIComponent).join(`/`),{from:a,to:o}=t,s=a===void 0?``:o===void 0||o===a?`#L${a}`:`#L${a}-L${o}`;return`https://github.com/${e.repo}/blob/${e.headSha}/${i}${s}`}function ii(e){return e.find(e=>e.poweredBy===`meat`)??e.find(e=>e.poweredBy===`git`)??null}function ai(e){return e===`meat`?`An abridged reading of the change: a model dropped what a reviewer need not read (style, imports, boilerplate) and kept the concepts`:`The complete change, base…head, as git reports it`}function oi(e){return`The recorded diff was cut at ${e.toLocaleString(`en-US`)} characters; open the full diff on GitHub for the rest`}function si(e){return e===`meat`?`reading diff · meat`:`full diff · git`}var ci=e=>typeof e==`object`&&!!e,li=e=>typeof e==`string`&&e!==``,ui=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;function di(e){for(let t of e.split(/\n\s*\n/)){let e=t.split(`
|
|
7
|
+
`),i=r===-1?n:n.slice(0,r).trimEnd();return i.length<e.length?i+` …`:i}function h(e,t){let o=a(e.tool),s=o===`bash`,c=t||o,l=s&&c.startsWith(`$ `)?c.slice(2):!s&&c.startsWith(o+` `)?c.slice(o.length+1):c,u={id:a(e.callId)||`c`+ ++n,tool:o,title:l,headline:m(l,s),shell:s,quiet:o===`update_status`,tags:[s?p(l):o],status:`running`,startedAt:i(e.at),facts:[]};return r.push(u),u}function g(t){for(let n=e.length-1;n>=0;n--)for(let r of e[n].calls)if(r.id===t)return{step:e[n],call:r};return null}function _(t){let n=a(t.callId);if(!n)return null;for(let t=e.length-1;t>=0;t--)for(let r of e[t].calls)if(r.id===n&&!r.result)return{step:e[t],call:r};return null}function v(e){if(!e||typeof e!=`object`)return[];let n=e;switch(n.type){case`input`:{let e={kind:`input`,text:a(n.text),at:i(n.at)},t=n.source;if(t&&typeof t==`object`){let n=t,r={};a(n.url)&&(r.url=a(n.url)),a(n.channel)&&(r.channel=a(n.channel)),a(n.user)&&(r.user=a(n.user)),Object.keys(r).length>0&&(e.source=r)}return[e]}case`answer`:return[{kind:`answer`,text:a(n.text),at:i(n.at)}];case`pr_opened`:{let e=i(n.number);return!a(n.url)||e===void 0||!Number.isInteger(e)||e<=0?[]:[{kind:`pr_opened`,url:a(n.url),number:e,created:n.created===!0,at:i(n.at)}]}case`run_meta`:{if(!a(n.agent))return[];let e={kind:`meta`,agent:a(n.agent),model:a(n.model),at:i(n.at)};return a(n.effort)&&(e.effort=a(n.effort)),a(n.repo)&&(e.repo=a(n.repo)),a(n.ref)&&(e.ref=a(n.ref)),i(n.pr)!==void 0&&Number.isInteger(n.pr)&&n.pr>0&&(e.pr=n.pr),/^[0-9a-f]{7,40}$/i.test(a(n.headSha))&&(e.headSha=a(n.headSha)),[e]}case`context`:return[{kind:`context`,text:a(n.text),at:i(n.at)}];case`replay_note`:return[{kind:`replay_note`,text:a(n.summary)}];case`run_note`:return[{kind:`note`,text:a(n.summary),noteKind:a(n.kind),mode:a(n.mode)||void 0,at:i(n.at)}];case`assistant`:return[{kind:`step`,step:o({text:a(n.text),at:i(n.at)})}];case`review_artifact`:return[];case`span_start`:{let e=a(n.name),t=a(n.spanId);return!e||!t||e.startsWith(`tool.`)||e.startsWith(`mcp.`)||e===`model.turn`?[]:[{kind:`span`,spanId:t,name:e,open:!0,at:i(n.at)}]}case`span_end`:{let e=a(n.name),r=a(n.spanId),o=i(n.durationMs);if(!e||!r||o===void 0)return[];let c=n.status===`error`?`error`:`ok`,u=typeof n.attrs==`object`&&n.attrs!==null?n.attrs:{};if(e===`model.turn`){t=null;let e=[],c=i(u.inputTokens),l=i(u.outputTokens),d=i(u.cacheReadTokens);c!==void 0&&e.push(s(c)+` in`),l!==void 0&&e.push(s(l)+` out`),d!==void 0&&e.push(s(d)+` cached`);let f=i(u.ttftMs);f!==void 0&&e.push(`first token `+J(f,`precise`));let p=i(u.thinkingMs);p!==void 0&&e.push(`thinking `+J(p,`precise`));let m=i(u.textMs);m!==void 0&&e.push(`writing `+J(m,`precise`));let h=a(u.model);return[{kind:`turn`,spanId:r,label:`Thought for `+J(o,`precise`),facts:e,durationMs:o,...h?{model:h}:{},at:i(n.at)}]}if(e.startsWith(`tool.`)||e.startsWith(`mcp.`)){if(!e.startsWith(`tool.`))return[];let t=a(u.callId);if(!t)return[];let n=g(t);return!n||n.call.durationMs!==void 0?[]:(n.call.durationMs=o,n.call.facts=l(n.call),[{kind:`result`,step:n.step,call:n.call}])}let d=i(n.startedAt);return[{kind:`span`,spanId:r,name:e,open:!1,durationMs:o,status:c,at:i(n.at),...d===void 0?{}:{startedAt:d}}]}case`skill_use`:{let e=a(n.skill);if(!e)return[];let r=[];t||r.push({kind:`step`,step:o()});let s=a(n.source),c={name:e,description:a(n.description),agent:a(n.agent),bodyBytes:i(n.bodyBytes)??0,at:i(n.at)};return/^https?:\/\//.test(s)&&(c.source=s),r.push({kind:`skill`,step:t,skill:c}),r}case`tool_call`:{let e=[];t||e.push({kind:`step`,step:o()});let r=h(n,a(n.summary));return t.calls.push(r),e.push({kind:`call`,step:t,call:r}),e}case`tool_result`:{let e=_(n);if(e)return u(e.call,n),[{kind:`result`,step:e.step,call:e.call}];let r=[];t||r.push({kind:`step`,step:o()});let i=h(n,``);return i.startedAt=void 0,u(i,n),t.calls.push(i),r.push({kind:`call`,step:t,call:i}),r}default:return[]}}function y(){return r.length>0?r[0]:null}return{push:v,pending:y,steps:()=>e}}new Set(`request,slack.receive,dispatch.history,dispatch.admission,dispatch.ack_card,dispatch.gate.repo,dispatch.gate.pr_head,dispatch.workspace.attach,dispatch.gate.attached_head,dispatch.mcp_discovery,dispatch.compose,dispatch.channel_visibility,dispatch.repo_context,dispatch.memory_read,dispatch.refuse,dispatch.ship_preflight,dispatch.ledger_claim,run.agent,run.command,run.reading_diff,run.settle_reviewed_head,run.description_turn,run.observe_workspace,run.pr_post_step,run.reading_diff_join,run.pr_description_join,model.turn,ship.round,post.card_close,post.reply`.split(`,`));var mt=new Set([`slack.receive`,`dispatch.history`,`dispatch.admission`,`dispatch.ack_card`,`dispatch.gate.repo`,`dispatch.gate.pr_head`,`dispatch.workspace.attach`,`dispatch.gate.attached_head`,`dispatch.mcp_discovery`,`dispatch.compose`,`dispatch.channel_visibility`,`dispatch.repo_context`,`dispatch.memory_read`,`dispatch.refuse`,`dispatch.ship_preflight`,`dispatch.ledger_claim`]),ht=new Set([`run.observe_workspace`,`run.pr_post_step`,`run.reading_diff_join`,`run.pr_description_join`]),gt=new Set([`request`,`run.agent`,`ship.round`,`run.settle_reviewed_head`,`run.description_turn`,`post.card_close`,`post.reply`]),_t=new Set([`run.reading_diff`]);function vt(e,t){if(_t.has(e))return{kind:`background`};if(gt.has(e))return{kind:`uncounted`};if(e===`model.turn`)return{kind:`counted`,bucket:`thinking`};if(e===`run.command`||e.startsWith(`run.command.`))return{kind:`counted`,bucket:t===`command`?`tools`:`getting_ready`};if(mt.has(e)||e.startsWith(`dispatch.workspace.attach.`))return{kind:`counted`,bucket:`getting_ready`};if(ht.has(e))return{kind:`counted`,bucket:`finishing_up`};if(e.startsWith(`tool.`)||e.startsWith(`mcp.`))return{kind:`counted`,bucket:`tools`}}var yt={clone:`cloning the repo`,"checkout-clone":`cloning the checkout`,"worktree-clone":`cloning the worktree`,"worktree-detach":`checking out the expected commit`,"op-clone":`cloning the op tree`,fetch:`fetching the branch`,"wake-fetch":`fetching the latest commits`,"reclaim-fetch":`fetching to reclaim the mirror`,"for-each-ref":`listing the branches`,checkout:`checking out the branch`,"checkout-update":`updating the checkout`,"rev-parse":`reading the commit`,"cat-file":`checking the mirror for the commit`,"show-ref":`reading the branch tip`,"detect-default-branch":`detecting the default branch`,git:`a git command`,"git-setup":`configuring git`,"stage-perms":`securing the credential stage`,install:`installing dependencies`,build:`building`,test:`running the tests`,"clear-markers":`clearing the build markers`,"lockfile-key":`hashing the lockfile`,"deps-store-dir":`preparing the dependency store`,"deps-scratch":`cloning a scratch tree for the dependency install`,"deps-install":`installing the dependency store`,"deps-harden":`locking down the installed dependencies`,"deps-commit":`recording the installed dependencies`,"deps-adopt":`adopting the dependency store`,"deps-restore-scratch":`restoring dependencies to scratch`,"deps-restore-chown":`setting the restored dependencies' owner`,"deps-restore-commit":`recording the restored dependencies`,"deps-scratch-chown":`setting the dependency scratch owner`,"deps-evict":`evicting an old dependency store`,"unlink-deps-view":`unlinking the dependency view`,"clear-installing-marker":`clearing the install marker`,chown:`setting the workspace owner`,"worktree-chown":`setting the worktree owner`,"op-chown":`setting the op tree's owner`,"worktree-clean":`cleaning the worktree`,"clean-workspace":`cleaning the workspace`,"clean-before-restore":`cleaning before the restore`,"unmount-restores":`unmounting earlier restores`,"mirror-restore-extract":`extracting the mirror snapshot`,"checkout-restore-extract":`extracting the checkout snapshot`,"deps-restore-extract":`extracting the dependency snapshot`,evict:`evicting a stale tree`,"thread-dir":`preparing a directory`,"threads-dir":`preparing a directory`,"op-dir":`preparing a directory`,"ops-dir":`preparing a directory`,"stage-dir":`preparing a directory`,stat:`checking a file`,touch:`touching a marker`,nproc:`counting CPUs`,mutex_wait:`waiting for the workspace`,kill:`stopping the previous step`};Object.keys(yt);function bt(e){return Object.prototype.hasOwnProperty.call(yt,e)?e:void 0}function xt(e){let t=bt(e);if(t!==void 0)return yt[t];if(e.endsWith(`-stale-sweep`)){let t=bt(e.slice(0,-12));if(t!==void 0)return`clearing leftovers before ${yt[t]}`}}var St={request:`the request`,"slack.receive":`receiving`,"dispatch.history":`reading the thread`,"dispatch.admission":`checking the thread`,"dispatch.ack_card":`posting the status card`,"dispatch.gate.repo":`checking the repo`,"dispatch.gate.pr_head":`checking the PR`,"dispatch.workspace.attach":`attaching the workspace`,"dispatch.gate.attached_head":`checking out the branch`,"dispatch.mcp_discovery":`loading tools`,"dispatch.compose":`preparing the prompt`,"dispatch.channel_visibility":`checking the channel`,"dispatch.repo_context":`reading the repo's context`,"dispatch.memory_read":`recalling memory`,"dispatch.refuse":`refusing`,"dispatch.ship_preflight":`checking the ship request`,"dispatch.ledger_claim":`claiming the run's row`,"run.agent":`the agent loop`,"run.command":`the command`,"run.reading_diff":`reading the diff (in parallel)`,"run.settle_reviewed_head":`re-checking the moved branch`,"run.description_turn":`asking for the PR description`,"run.observe_workspace":`checking the workspace`,"run.pr_post_step":`posting the PR`,"run.reading_diff_join":`waiting for the diff`,"run.pr_description_join":`waiting for the PR description`,"model.turn":`a model turn`,"ship.round":`a ship round`,"post.card_close":`closing the card`,"post.reply":`posting the reply`},Ct=`a Switchboard step`;function wt(e){if(e in St)return St[e];if(e.startsWith(`tool.`))return e.slice(5)||`a Switchboard step`;if(e.startsWith(`mcp.`)){let t=e.slice(e.lastIndexOf(`.`)+1);return t&&t!==`mcp`?t:Ct}for(let t of[`dispatch.workspace.attach.`,`run.command.`])if(e.startsWith(t))return xt(e.slice(t.length))??`a Switchboard step`;return Ct}var Tt=`A-Za-z0-9:@._-`;RegExp(`^[${Tt}]{1,128}$`),RegExp(`[^${Tt}]`,`g`);function Et(e){return e.type===`span_start`||e.type===`span_end`}function Dt(e,t,n){let r=e.get(t.spanId);if(t.type===`span_start`){if(r)return;e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?{}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.at??0,attrs:t.attrs??{}});return}e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?r?.parentSpanId===void 0?{}:{parentSpanId:r.parentSpanId}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.startedAt,endedAt:t.startedAt+t.durationMs,durationMs:t.durationMs,status:t.status,...t.error===void 0?{}:{errorMessage:t.error},attrs:{...r?.attrs??{},...t.attrs??{}}})}function Ot(){let e,t,n=[];return{push(r){e?t&&r.seq!==void 0&&t.seq!==void 0&&r.seq>t.seq+1&&t.at!==void 0&&r.at!==void 0&&n.push({kind:`gap`,fromSeq:t.seq+1,toSeq:r.seq-1,from:Math.min(t.at,r.at),to:Math.max(t.at,r.at)}):e={seq:r.seq??1,at:r.at},r.type===`run_note`&&r.kind===`spans_dropped`&&r.from!==void 0&&r.to!==void 0&&r.to>=r.from&&n.push({kind:`note`,from:r.from,to:r.to}),t={seq:r.seq,at:r.at}},losses(t={}){let r=t.elided??[],i=(e,t)=>r.some(n=>n.fromSeq<=e&&t<=n.toSeq),a=[];e&&e.seq>1&&t.windowStart!==void 0&&e.at!==void 0&&e.at>t.windowStart&&a.push({from:t.windowStart,to:e.at,kind:`lost`});for(let e of n)a.push(e.kind===`note`?{from:e.from,to:e.to,kind:`lost`}:{from:e.from,to:e.to,kind:i(e.fromSeq,e.toSeq)?`elided`:`lost`});return a}}}var kt=[/\bslack[\s-]?only\b/i,/\bpost\s*[:=]\s*(?:off|no|false|none)\b/i,/\bno[\s-]post\b/i,/\b(?:don['’]?t|do\s+not|never|skip|without)\s+(?:\w+\s+){0,2}?(?:post|comment)(?:ing|s)?\b/i,/\bno\s+need\s+to\s+(?:post|comment)\b/i];function At(e){return kt.some(t=>t.test(e))}var jt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Mt=/^[0-9a-f]{7,40}$/,Nt=/^(?![.-])(?!.*\.\.)(?!.*\/\/)(?!.*@\{)(?!.*\.lock$)(?!.*[./]$)[\w][\w./-]*$/;function Pt(e){return e&&jt.test(e)?`https://github.com/${e}`:void 0}function Ft(e,t){let n=Pt(e);if(!(!n||t===void 0||!Number.isInteger(t)||t<=0))return`${n}/pull/${t}`}function It(e,t){let n=Pt(e);if(n&&t&&Nt.test(t))return`${n}/tree/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function Lt(e,t){let n=Pt(e);if(n&&t&&Mt.test(t))return`${n}/commit/${t}`}function Rt(e){return e.slice(0,7)}function zt(e){if(e===`slack.receive`||e.startsWith(`dispatch.`))return`getting_ready`;let t=vt(e,`agent`);return t?.kind===`counted`&&t.bucket===`finishing_up`?`finishing_up`:void 0}function Bt(e){return e===`request`||e===`run.agent`}var Vt={getting_ready:`Getting ready`,finishing_up:`Finishing up`};function Ht(e){let t=e.rows.length,n=`${t} step${t===1?``:`s`}`,r=Vt[e.phase];if(t===0||e.rows.some(e=>e.open||e.at===void 0||e.durationMs===void 0))return`${r} · ${n}`;let i=Math.min(...e.rows.map(e=>e.at)),a=Math.max(...e.rows.map(e=>e.at+e.durationMs));return`${r} · ${n} · ${J(Math.max(0,a-i),`precise`)}`}function Ut(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{fromSeq:n,toSeq:r}=t,i=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;return!i(n)||!i(r)||n>r?null:{fromSeq:n,toSeq:r}}function Wt(e){let t=e.toSeq-e.fromSeq+1,n=t===1?`event ${e.fromSeq}`:`events ${e.fromSeq}–${e.toSeq}`;return`${t} ${t===1?`event`:`events`} not loaded (${n}) — the record has them`}function Gt(e,t,n){let r=!!e.model&&t!==null&&nn(e.model,t),i=r?t:e.model??t??void 0,a=!!e.model&&t!==null&&!r;return{spanId:e.spanId,label:e.label,chip:e.label.replace(/^Thought for /,``),quick:e.durationMs<6e4,durationMs:e.durationMs,facts:e.facts,...i?{model:i}:{},switched:a,showModel:!!i&&(!n||a),at:e.at}}function Kt(e){let t=`${e.n} tool call${e.n===1?``:`s`}`;if(e.n===0)return`no tool calls`;if(e.ok===e.n)return`${t}, all succeeded`;if(e.running===e.n)return`${t}, all running`;let n=[];return e.bad&&n.push(`${e.bad} failed`),e.infra&&n.push(`${e.infra} sandbox error${e.infra===1?``:`s`}`),e.running&&n.push(`${e.running} still running`),`${t}, ${n.join(`, `)}`}function qt(e){let{meta:t,prOpened:n}=e,r=t?.repo&&Pt(t.repo)?t.repo:void 0;if(t?.agent===`review`){if(At(e.requestText))return{text:`verdict, Slack only`};if(r&&t.pr!==void 0){let e=Ft(r,t.pr);return e?{text:`verdict for ${r}#${t.pr}`,href:e}:{text:`verdict`}}return{text:`verdict`}}if(t?.agent===`coding`&&n){let e=n.created?`pull request opened`:`pull request updated`,t=r?Ft(r,n.number):void 0;return t?{text:`${e} ${r}#${n.number}`,href:t}:{text:e}}return t?.agent===`command`?{text:`output`}:{text:`answer`}}function Jt(e,t){return{id:e.id,tool:e.tool,title:e.title,headline:e.headline,shell:e.shell,status:e.status,facts:[...e.facts],startedAt:e.startedAt,output:e.result?e.result.output||e.result.summary:``,hasResult:e.result!==void 0,chipOnly:!e.shell&&e.title===e.tool,durationMs:e.durationMs,exitCode:e.result?.exitCode,timedOut:ke(e.result?.exitCode),open:t}}function Yt(e={}){let t=e.openTags&&e.openTags.length>0?e.openTags:[`failed`,`infra`],n=pt(),r=pe({request:null,meta:null,context:[],log:[],reply:null,prOpened:null,placeholder:!0,allOpen:!1,stopMode:null,model:null,firstAt:null,lastAt:null,lastAtWall:null,elided:[],traceVersion:0}),i=Ot(),a=new Map,o=new Map,s=new Map,c=new Map,l=new Map,u=new Map,d=new Map,f=new Set,p=null,m=!1,h=-1,g=0,_=e=>`${e}-${g++}`;function v(e){return t.includes(`all`)?!0:e.some(e=>t.includes(e))}function y(e){let t=0,n=0,r=0;for(let i of e.items)i.kind===`call`&&(i.call.status===`failed`?t++:i.call.status===`infra`?n++:i.call.status===`running`&&r++);return{bad:t,infra:n,running:r}}function b(e){let{bad:t,infra:n,running:r}=y(e);(t||n||r)&&(e.groupOpen=!0)}function x(e){let t=o.get(h);t&&(t.live=!1),h=e.index;let n=p;p=null;let i=pe({kind:`step`,key:_(`step`),index:e.index,at:e.narration?e.narration.at:n?.at,turn:n,narration:e.narration?e.narration.text:null,note:`no commentary`,items:[],live:!0,manual:!1,groupOpen:!0});return o.set(e.index,i),r.log.push(i),i}function S(e){return o.get(e.index)??x(e)}function C(e,t){let n=S(e);if(t.quiet){f.add(t.id),n.items.push({kind:`quiet`,at:t.startedAt,text:`✎ ${t.tool===`update_status`?`status checklist updated`:t.title}`}),b(n);return}let i=pe(Jt(t,r.allOpen||v(t.tags)));u.set(t.id,i),d.set(t.id,n),n.items.push({kind:`call`,call:i}),b(n)}function w(e,t){if(f.has(t.id)){let t=o.get(e.index);t&&b(t);return}let n=u.get(t.id);if(!n){C(e,t);return}Object.assign(n,Jt(t,n.open)),v(t.tags)&&(n.open=!0);let r=o.get(e.index);r&&b(r)}function T(e){p&&=(r.log.push({kind:`turn`,key:_(`turn`),turn:p,note:e}),null)}function E(e){switch(r.placeholder=!1,e.kind){case`input`:{let t={text:e.text,at:e.at,...e.source?{source:e.source}:{}};r.request?r.log.push({kind:`followup`,key:_(`followup`),input:t}):r.request=t;return}case`step`:x(e.step);return;case`call`:C(e.step,e.call);return;case`result`:w(e.step,e.call);return;case`turn`:T(``),p=Gt(e,r.model,m),p.model&&(m=!0),e.model&&!(r.model!==null&&nn(e.model,r.model))&&(r.model=e.model);return;case`meta`:r.model===null&&e.model&&(r.model=e.model),r.meta={agent:e.agent,model:e.model,...e.effort?{effort:e.effort}:{},...e.repo?{repo:e.repo}:{},...e.ref?{ref:e.ref}:{},...e.pr===void 0?{}:{pr:e.pr},...e.headSha?{headSha:e.headSha}:{}};return;case`pr_opened`:r.prOpened={url:e.url,number:e.number,created:e.created};return;case`skill`:S(e.step).items.push({kind:`skill`,skill:e.skill});return;case`context`:r.context.push({key:_(`ctx`),at:e.at,text:e.text});return;case`note`:if(e.noteKind===`follow_up`)return;r.log.push({kind:`note`,key:_(`note`),at:e.at,replay:!1,text:e.text}),(e.noteKind===`stop_requested`||e.noteKind===`stopped`)&&(e.mode===`soft`||e.mode===`hard`)&&j(e.mode);return;case`replay_note`:r.log.push({kind:`note`,key:_(`note`),replay:!0,text:e.text});return;case`span`:{if(Bt(e.name)){e.name===`run.agent`&&e.open&&D(`getting_ready`);return}e.name.startsWith(`post.`)&&e.open&&D(`finishing_up`);let t=s.get(e.spanId);if(t){t.open=e.open,e.durationMs!==void 0&&(t.durationMs=e.durationMs),e.status&&(t.status=e.status);return}let n=pe({kind:`span`,key:_(`span`),spanId:e.spanId,text:wt(e.name),open:e.open,...e.durationMs===void 0?{}:{durationMs:e.durationMs},...e.status?{status:e.status}:{},at:e.open?e.at:e.startedAt??e.at});s.set(e.spanId,n);let i=zt(e.name);if(i){let t=l.get(i);t||(t={group:pe({kind:`phase`,phase:i,key:_(i),rows:[],open:!0}),toggled:!1},l.set(i,t),r.log.push(t.group)),t.group.rows.push(n),c.set(e.spanId,t.group);return}r.log.push(n);return}case`answer`:T(`wrote the reply below`),r.reply={text:e.text,at:e.at};return}}function D(e){let t=l.get(e);t&&!t.toggled&&(t.group.open=!1)}function ee(e){let t=e,o=t?.type===`span_start`||t?.type===`span_end`;if(t&&typeof t.type==`string`){let t=e;i.push(t),Et(t)&&Dt(a,t,``),r.traceVersion++}t&&!o&&typeof t.at==`number`&&((r.firstAt===null||t.at<r.firstAt)&&(r.firstAt=t.at),(r.lastAt===null||t.at>=r.lastAt)&&(r.lastAt=t.at,r.lastAtWall=Ee()));for(let t of n.push(e))E(t)}function O(){for(let e of u.values())if(e.status===`running`)return e;return null}function k(e){r.allOpen=e;for(let t of l.values())t.group.open=e,t.toggled=!0;for(let t of u.values())t.open=e}function A(e){if(e.startsWith(`call-`)){let t=e.slice(5),n=d.get(t);return!n||!u.has(t)?!1:(n.manual=!0,n.groupOpen=!0,!0)}if(e.startsWith(`span-`)){let t=e.slice(5),n=c.get(t);if(n){n.open=!0;let e=l.get(n.phase);return e&&(e.toggled=!0),!0}if(s.has(t))return!0;for(let e of r.log)if(e.kind===`step`&&e.turn?.spanId===t||e.kind===`turn`&&e.turn.spanId===t)return!0}return!1}function j(e){r.stopMode=e}function te(e){r.elided.push(e),r.log.push({kind:`note`,key:_(`note`),replay:!0,text:Wt(e)}),r.placeholder=!1,r.traceVersion++}return{state:r,handle:ee,noteElided:te,spanSet:()=>[...a.values()],losses:e=>i.losses({windowStart:e,elided:r.elided}),pendingCall:O,flushPendingTurn:T,closePhases(){D(`getting_ready`),D(`finishing_up`)},setAllOpen:k,togglePhase(e){e.open=!e.open;let t=l.get(e.phase);t&&(t.toggled=!0)},reveal:A,callHeadline:e=>u.get(e)?.headline,toggleGroup(e){e.manual=!0,e.groupOpen=!e.groupOpen},toggleCall(e){e.open=!e.open},markStopping:j,opensByDefault:v}}function Xt(e,t){return e.lastAt===null||e.lastAtWall===null?null:e.lastAt+(t-e.lastAtWall)}function Zt(e,t){return{now:n=>e.serverNow+(n-t),elapsedMs(t){return Ae(e,this.now(t))??0},elapsedAt(t){return Ae({receivedAt:e.receivedAt,startedAt:e.startedAt,finishedAt:t})??0}}}function Qt(e){if(typeof e!=`string`)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!=`object`||!t)return{};let{sealedAt:n,replyOk:r}=t;return{...typeof n==`number`&&Number.isFinite(n)&&n>0?{sealedAt:n}:{},...typeof r==`boolean`?{replyOk:r}:{}}}function $t(e){return e.replyOk===!1?`reply failed`:e.replyOk!==!0||e.finishedAt===void 0||e.sealedAt===void 0?``:`delivered in ${J(Math.max(0,e.sealedAt-e.finishedAt),`clock`)}`}function en(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{finishedAt:n}=t;return typeof n==`number`&&Number.isFinite(n)&&n>0?{finishedAt:n}:null}var tn=Symbol(`sb-runner-clock`);function nn(e,t){return e===t||!e.includes(`/`)!=!t.includes(`/`)&&rn(e)===rn(t)}function rn(e){if(!e)return`model`;let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1))||e}var an=6e4;function on(e,t,n){let r=Xt(e,n);if(r===null||e.lastAt===null)return{kind:`starting`};if(t)return{kind:`call`,call:t,elapsedMs:Math.max(0,r-(t.startedAt??e.lastAt))};let i=Math.max(0,r-e.lastAt);return{kind:`thinking`,elapsedMs:i,slow:i>=an}}var sn=[`id`,`open`,`title`,`data-status`,`data-heat`],cn={key:0,class:`spin inline-block size-[0.7em] shrink-0 animate-spin self-center rounded-full border-2 border-accented border-t-info motion-reduce:animate-none`,role:`img`,"aria-label":`running`},ln={key:2,class:`dollar shrink-0 select-none text-dimmed`},un={key:3,class:`tool shrink-0 rounded bg-accented px-1.5 text-xs leading-normal text-muted`},dn={key:0,class:`cmd brief min-w-0 flex-1 truncate text-info`},fn={key:1,class:`cmd full min-w-0 flex-1 whitespace-pre-wrap break-words text-info max-sm:order-last max-sm:basis-full`},pn={key:5,class:`cmd min-w-0 flex-1`},mn={class:`facts ml-auto flex shrink-0 gap-2.5 text-xs tabular-nums text-muted`},hn={key:0,class:`fact elapsed`,title:`since this call started (runner clock)`},gn={key:0,class:`over rounded bg-bad/15 px-1 font-semibold text-bad`},_n={key:1,class:`over rounded bg-bad/15 px-1 font-semibold text-bad`},vn={class:`body`},yn={key:1,class:`none px-3 py-1.5 text-xs italic text-dimmed`},bn={key:2,class:`none px-3 py-1.5 text-xs italic text-dimmed`},xn=N({__name:`CallCard`,props:{call:{}},setup(e){let t=e,n=h(tn,null),r=V(()=>{let e=n?.value;return t.call.status!==`running`||typeof e!=`number`||t.call.startedAt===void 0?``:J(Math.max(0,e-t.call.startedAt),`clock`)}),i=V(()=>Me(t.call.durationMs,`tool`,t.call.timedOut)),a=V(()=>Fe(i.value)),o=V(()=>t.call.durationMs===void 0?-1:t.call.facts.length-1);function s(){t.call.open=!t.call.open}return(t,n)=>(W(),H(`details`,{id:`call-${e.call.id}`,class:G([`call rounded-md border border-default bg-elevated open:bg-accented/40`,e.call.status]),open:e.call.open,title:typeof e.call.startedAt==`number`?`started ${P(Re)(e.call.startedAt)}`:void 0,"data-status":e.call.status,"data-heat":i.value.level},[F(`summary`,{class:G([`flex min-w-0 cursor-pointer list-none items-baseline gap-3 rounded-md pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 hover:bg-accented/60 focus-visible:outline-2 focus-visible:outline-primary max-sm:flex-wrap [&::-webkit-details-marker]:hidden`,e.call.open?`rounded-b-none border-b border-default`:``]),onClick:T(s,[`prevent`])},[F(`span`,{class:G([`chev shrink-0 select-none text-xs text-dimmed transition-transform motion-reduce:transition-none`,e.call.open?`rotate-90`:``])},`❯`,2),e.call.status===`running`?(W(),H(`span`,cn)):(W(),H(`span`,{key:1,class:G([`glyph w-[1em] shrink-0 text-center font-bold`,e.call.status===`ok`?`text-ok`:e.call.status===`failed`?`text-bad`:`text-warn`])},K(e.call.status===`ok`?`✓`:e.call.status===`failed`?`✗`:`⚠`),3)),e.call.shell?(W(),H(`span`,ln,`$`)):(W(),H(`span`,un,K(e.call.tool),1)),e.call.chipOnly?(W(),H(`span`,pn)):(W(),H(B,{key:4},[e.call.open?(W(),H(`code`,fn,K(e.call.title),1)):(W(),H(`code`,dn,K(e.call.headline),1))],64)),F(`span`,mn,[r.value?(W(),H(`span`,hn,K(r.value),1)):R(``,!0),(W(!0),H(B,null,U(e.call.facts,(t,n)=>(W(),H(B,{key:n},[n===o.value&&i.value.over?(W(),H(`span`,gn,`timed out`)):R(``,!0),F(`span`,{class:G([`fact`,[e.call.status!==`ok`&&n===0?`text-bad`:``,n===o.value&&i.value.over?`font-semibold text-bad`:``,n===o.value&&a.value?`heat`:``,n===o.value&&i.value.level>=2&&!i.value.over?`font-medium`:``]]),style:A(n===o.value?a.value:void 0)},K(t),7)],64))),128)),i.value.over&&o.value===-1?(W(),H(`span`,_n,`timed out`)):R(``,!0)])],2),F(`div`,vn,[e.call.hasResult&&e.call.output?(W(),H(`pre`,{key:0,class:G([`out max-h-[28rem] overflow-auto whitespace-pre-wrap break-words px-3.5 py-2.5 font-mono leading-normal`,e.call.status===`failed`?`text-bad`:`text-toned`])},K(e.call.output),3)):e.call.hasResult?(W(),H(`div`,yn,`no output`)):(W(),H(`div`,bn,`no output yet`))])],10,sn))}}),Sn=[`title`],Cn=[`title`],wn={class:`skillname whitespace-nowrap font-semibold text-skill`},Tn={key:0,class:`skilldesc min-w-0 flex-1 truncate text-xs text-muted`},En={class:`facts ml-auto flex shrink-0 gap-2.5 text-xs text-muted`},Dn=[`href`],On={class:`fact`},kn=N({__name:`StepItems`,props:{items:{}},setup(e){function t(e){return e>0?e<1024?`${e} B`:e<1048576?`${(Math.round(e/102.4)/10).toFixed(1)} KB`:`${(Math.round(e/104857.6)/10).toFixed(1)} MB`:`0 B`}return(n,r)=>(W(!0),H(B,null,U(e.items,(e,n)=>(W(),H(B,{key:n},[e.kind===`call`?(W(),k(xn,{key:0,call:e.call},null,8,[`call`])):e.kind===`quiet`?(W(),H(`div`,{key:1,class:`quiet flex items-baseline gap-3 pl-3 pr-(--sb-gutter) py-0.5 text-xs text-dimmed`,title:e.at===void 0?void 0:P(Re)(e.at)},[F(`span`,null,K(e.text),1)],8,Sn)):(W(),H(`div`,{key:2,class:`skill flex items-baseline gap-2.5 pl-3 pr-(--sb-gutter) py-0.5`,title:e.skill.at===void 0?void 0:P(Re)(e.skill.at)},[r[0]||=F(`span`,{class:`skillmark shrink-0 select-none text-xs`},`📚`,-1),F(`span`,wn,`skill `+K(e.skill.name),1),e.skill.description?(W(),H(`span`,Tn,K(e.skill.description),1)):R(``,!0),F(`span`,En,[e.skill.source?(W(),H(`a`,{key:0,class:`fact text-primary hover:underline`,href:e.skill.source,target:`_blank`,rel:`noopener noreferrer`},`source`,8,Dn)):R(``,!0),F(`span`,On,K(t(e.skill.bodyBytes))+` into context`,1)])],8,Cn))],64))),128))}}),An=[`id`,`data-live`],jn={class:`head flex items-baseline gap-x-6 pb-1.5 pr-(--sb-gutter)`},Mn={class:`min-w-0 flex-1`},Nn={key:0,class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 text-xs tabular-nums text-dimmed`},Pn=[`data-heat`,`title`],Fn=[`title`],In=[`title`],Ln={key:2,class:`nonar font-sans text-sm italic text-dimmed`},Rn=[`title`],zn={key:0,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},Bn={key:1,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},Vn={class:`nonar flex-1 font-sans text-sm italic text-dimmed`},Hn={class:`calls flex flex-col gap-2`},Un=[`open`,`data-group-open`],Wn=[`title`],Gn=[`data-ok`,`data-bad`,`data-infra`,`data-running`],Kn=[`data-heat`],qn={class:`gbody flex flex-col gap-2 pb-1 pt-1.5`},Jn=N({__name:`StepBlock`,props:{step:{}},emits:[`toggleGroup`],setup(e,{emit:t}){let n=e,r=t,i=V(()=>n.step.items.filter(e=>e.kind===`call`)),a=V(()=>i.value.length>=2),o=V(()=>{let e=0,t=0,n=0,r=0,a=0;for(let o of i.value){if(o.kind!==`call`)continue;let i=o.call;i.status===`ok`?e++:i.status===`failed`?t++:i.status===`infra`?n++:r++,typeof i.durationMs==`number`&&(a+=i.durationMs)}return{n:e+t+n+r,ok:e,bad:t,infra:n,running:r,ms:a}}),s=V(()=>Kt(o.value)),c=V(()=>i.value.some(e=>e.kind===`call`&&e.call.timedOut)),l=V(()=>Me(o.value.ms,`tool`,c.value)),u=V(()=>Fe(l.value)),d=V(()=>n.step.turn?Me(n.step.turn.durationMs,`turn`):void 0),f=V(()=>d.value?Fe(d.value):void 0),p=V(()=>{let e=i.value[0];return e?.kind===`call`?e.call.startedAt:void 0});return(t,n)=>(W(),H(`li`,{id:e.step.turn?`span-${e.step.turn.spanId}`:void 0,class:G([`step relative border-l-2 pb-3 pl-3 pt-2`,e.step.live?`border-ok/40`:`border-(--ui-border-accented)/50`]),"data-live":e.step.live?`1`:void 0},[F(`div`,jn,[F(`div`,Mn,[e.step.turn?(W(),H(`div`,Nn,[F(`span`,{class:G([`thought`,[f.value?`heat`:``,d.value&&d.value.level>=2?`font-medium`:``]]),style:A(f.value),"data-heat":d.value?.level,title:e.step.turn.label},`thought `+K(e.step.turn.chip),15,Pn),e.step.turn.switched?(W(),H(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-semibold text-warn`,title:`model changed: this turn ran on ${e.step.turn.model}`},`⇄ `+K(P(rn)(e.step.turn.model)),9,Fn)):e.step.turn.showModel?(W(),H(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-semibold leading-normal tracking-wider text-muted`,title:e.step.turn.model},K(P(rn)(e.step.turn.model)),9,In)):R(``,!0),(W(!0),H(B,null,U(e.step.turn.facts,(e,t)=>(W(),H(`span`,{key:t,class:`fact`},K(e),1))),128))])):e.step.narration===null?(W(),H(`span`,Ln,K(e.step.note),1)):(W(),k(ct,{key:1,text:e.step.narration},null,8,[`text`]))]),e.step.at===void 0?R(``,!0):(W(),H(`span`,{key:0,class:`ts shrink-0 select-none text-xs tabular-nums text-dimmed`,title:P(Re)(e.step.at)},K(P(Qe)(e.step.at)),9,Rn))]),e.step.turn&&e.step.narration!==null?(W(),H(`div`,zn,[L(ct,{text:e.step.narration},null,8,[`text`])])):e.step.turn&&e.step.narration===null&&!e.step.turn.facts.length?(W(),H(`div`,Bn,[F(`span`,Vn,K(e.step.note),1)])):R(``,!0),F(`div`,Hn,[a.value?(W(),H(`details`,{key:1,class:`grp`,open:e.step.groupOpen,"data-group-open":e.step.groupOpen?`1`:`0`},[F(`summary`,{class:`gsummary flex cursor-pointer list-none items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1 text-xs text-dimmed hover:bg-accented/40 hover:text-muted focus-visible:outline-2 focus-visible:outline-primary [&::-webkit-details-marker]:hidden`,title:typeof p.value==`number`?`calls began ${P(Re)(p.value)}`:void 0,onClick:n[0]||=T(e=>r(`toggleGroup`),[`prevent`])},[F(`span`,{class:G([`gchev shrink-0 select-none transition-transform motion-reduce:transition-none`,e.step.groupOpen?`rotate-90`:``])},`❯`,2),F(`span`,{class:G([`gcount`,o.value.bad||o.value.infra?`text-bad`:``]),"data-ok":o.value.ok,"data-bad":o.value.bad,"data-infra":o.value.infra,"data-running":o.value.running},K(s.value),11,Gn),o.value.ms>0?(W(),H(`span`,{key:0,class:G([`gtime ml-auto tabular-nums`,[u.value?`heat`:``,l.value.over?`font-semibold text-bad`:l.value.level>=2?`font-medium`:``]]),style:A(u.value),"data-heat":l.value.level},[l.value.over?(W(),H(B,{key:0},[z(`timed out · `)],64)):R(``,!0),z(K(P(J)(o.value.ms,`clock`)),1)],14,Kn)):R(``,!0)],8,Wn),F(`div`,qn,[L(kn,{items:e.step.items},null,8,[`items`])])],8,Un)):(W(),k(kn,{key:0,items:e.step.items},null,8,[`items`]))])],10,An))}}),Yn=[`id`],Xn={class:`what`},Zn={key:0,class:`text-dimmed`},Qn={key:1,class:`dur tabular-nums text-dimmed`},$n=[`title`],er=N({__name:`SpanRow`,props:{item:{}},setup(e){return(t,n)=>(W(),H(`li`,{id:`span-${e.item.spanId}`,class:`span flex items-baseline gap-2 py-0.5 pr-(--sb-gutter) text-xs text-muted`},[F(`span`,{class:G([`glyph select-none`,e.item.status===`error`?`text-bad`:`text-dimmed`])},K(e.item.open?`◌`:e.item.status===`error`?`✗`:`◷`),3),F(`span`,Xn,K(e.item.text),1),e.item.open?(W(),H(`span`,Zn,`…`)):e.item.durationMs===void 0?R(``,!0):(W(),H(`span`,Qn,K(P(J)(e.item.durationMs,`precise`)),1)),e.item.at===void 0?R(``,!0):(W(),H(`span`,{key:2,class:`ts ml-auto select-none text-dimmed`,title:P(Re)(e.item.at)},K(P(Qe)(e.item.at)),9,$n))],8,Yn))}}),tr={"getting ready":`paint-ready`,thinking:`paint-thinking`,"in tools":`paint-tools`,"finishing up":`paint-finishing`,"Switchboard overhead":`paint-overhead`,"not recorded":`paint-lost`,"not loaded":`paint-elided`},nr={getting_ready:`getting ready`,finishing_up:`finishing up`};function rr(e){return tr[nr[e]]}var ir={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},ar={class:`mb-2 flex items-baseline gap-2.5 text-xs font-semibold uppercase tracking-wider text-muted`},or={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},sr=[`href`],cr={class:`lede text-sm text-toned`},lr={class:`shape tabular-nums`},ur={key:0,class:`current text-muted`},dr={key:0,class:`note mt-0.5 text-xs text-muted`},fr=[`aria-label`],pr=[`title`,`data-term`],mr={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs`},hr=[`title`,`data-term`],gr={class:`term text-muted`},_r={class:`ms tabular-nums text-toned`},vr=[`title`],yr={class:`ranked mt-1 flex flex-col gap-1 text-xs`},br={class:`ms w-14 shrink-0 tabular-nums text-toned`},xr=[`href`,`data-anchor`,`onClick`],Sr=N({__name:`TimelineSection`,props:{vm:{},eventsHref:{}},emits:[`reveal`],setup(e,{emit:t}){let n=e,r=t;function i(e){return`${J(e.ms,`clock`)} ${e.term}${e.hatched?` (in flight)`:``}`}function a(){o.copyText(JSON.stringify(n.vm.debug,null,2))}return(t,n)=>(W(),H(`section`,ir,[F(`h2`,ar,[n[0]||=F(`span`,null,`Where the time went`,-1),F(`span`,or,[e.eventsHref?(W(),H(`a`,{key:0,class:`text-dimmed no-underline hover:text-primary hover:underline`,href:e.eventsHref,title:`the stored events, as JSON lines`},`raw events`,8,sr)):R(``,!0),F(`button`,{type:`button`,class:`debug cursor-pointer text-dimmed hover:text-toned`,title:`the partition and the raw span names, for a bug report`,onClick:a},` Copy debug JSON `)])]),F(`p`,cr,[F(`span`,lr,K(e.vm.shown?e.vm.total:e.vm.lede),1),e.vm.current?(W(),H(`span`,ur,` · `+K(e.vm.current),1)):R(``,!0)]),(W(!0),H(B,null,U(e.vm.captions,e=>(W(),H(`p`,{key:e,class:`caption mt-0.5 text-xs text-muted`},K(e),1))),128)),e.vm.note?(W(),H(`p`,dr,K(e.vm.note),1)):R(``,!0),e.vm.shown?(W(),H(B,{key:1},[F(`div`,{class:`bar mt-2.5 flex h-2 w-full overflow-hidden rounded-sm`,role:`img`,"aria-label":e.vm.lede},[(W(!0),H(B,null,U(e.vm.bar,(e,t)=>(W(),H(`div`,{key:t,class:G([`seg h-full`,[P(tr)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:A({width:`${e.pct}%`}),title:i(e),"data-term":e.term},null,14,pr))),128))],8,fr),F(`ul`,mr,[(W(!0),H(B,null,U(e.vm.legend,e=>(W(),H(`li`,{key:e.term,class:`flex items-baseline gap-1.5 cursor-help`,title:e.definition,"data-term":e.term},[F(`span`,{class:G([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,P(tr)[e.term]])},null,2),F(`span`,gr,K(e.term),1),F(`span`,_r,K(e.text),1)],8,hr))),128))]),e.vm.ranked.length>0?(W(),H(B,{key:0},[F(`h3`,{class:`ranked-head mt-3 inline-block cursor-help text-xs font-semibold text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.rankedNote},` Longest steps `,8,vr),F(`ol`,yr,[(W(!0),H(B,null,U(e.vm.ranked,(e,t)=>(W(),H(`li`,{key:t,class:`flex items-baseline gap-2`},[F(`span`,br,K(P(J)(e.ms,`clock`)),1),F(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:T(t=>r(`reveal`,e.anchor),[`prevent`])},K(e.label),9,xr),(W(!0),H(B,null,U(e.facts,e=>(W(),H(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},K(e),1))),128))]))),128))])],64)):R(``,!0)],64)):R(``,!0)]))}}),Cr=[`data-position`],wr={class:`mb-2 flex items-baseline gap-2.5 text-xs font-semibold uppercase tracking-wider text-ok`},Tr=[`href`],Er={key:1,class:`caption font-normal normal-case tracking-normal text-dimmed`},Dr=[`title`],Or=N({__name:`ReplyBlock`,props:{text:{},caption:{},when:{},whenTitle:{},position:{}},setup(e){return(t,n)=>(W(),H(`section`,{id:`reply`,class:G([`block rounded-lg border border-ok/40 bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,e.position===`first`?`mb-4`:`mt-6`]),"data-position":e.position},[F(`h2`,wr,[n[0]||=F(`span`,null,`Reply`,-1),e.caption.href?(W(),H(`a`,{key:0,class:`caption font-normal normal-case tracking-normal text-dimmed no-underline hover:text-primary hover:underline`,href:e.caption.href,target:`_blank`,rel:`noopener noreferrer`},K(e.caption.text),9,Tr)):(W(),H(`span`,Er,K(e.caption.text),1)),F(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:e.whenTitle},K(e.when),9,Dr)]),L(ct,{text:e.text},null,8,[`text`])],10,Cr))}});function kr(e,t){let{window:n,owner:r,finished:i}=t,a=Math.max(0,n.end-n.start),o=new Map(e.map(e=>[e.spanId,e])),s=new Map,c=e=>{let t=s.get(e.spanId);if(t!==void 0)return t;s.set(e.spanId,1);let n=e.parentSpanId?o.get(e.parentSpanId):void 0,r=n?c(n)+1:1;return s.set(e.spanId,r),r},l=e=>{let t=e,n=new Set;for(;t&&!n.has(t.spanId);){if(n.add(t.spanId),vt(t.name,r)?.kind===`background`)return!0;t=t.parentSpanId?o.get(t.parentSpanId):void 0}return!1},u=t.losses.map(e=>Math.max(n.start,e.from)).sort((e,t)=>e-t),d=e=>{if(e.endedAt!==void 0)return Math.min(n.end,e.endedAt);if(!i)return n.end;let t=u.find(t=>t>e.startedAt);return t===void 0?n.end:Math.min(n.end,t)},f=[],p=[];for(let t of e){let e=vt(t.name,r);if(!e)continue;let i=Math.max(n.start,t.startedAt);if(e.kind===`background`){let e=Math.min(n.end,t.endedAt??n.end);e>i&&p.push([i,e]);continue}if(e.kind!==`counted`||l(t))continue;let a=d(t);a<=i||f.push({start:i,end:a,bucket:e.bucket,depth:c(t),startedAt:t.startedAt,spanId:t.spanId})}f.sort((e,t)=>t.depth-e.depth||e.startedAt-t.startedAt||(e.spanId<t.spanId?-1:+(e.spanId>t.spanId)));let m=new Set([n.start,n.end]);for(let e of f)m.add(e.start),m.add(e.end);for(let e of t.losses)m.add(Ar(e.from,n)),m.add(Ar(e.to,n));for(let[e,t]of p)m.add(e),m.add(t);let h=[...m].filter(e=>e>=n.start&&e<=n.end).sort((e,t)=>e-t),g={getting_ready:0,thinking:0,tools:0,finishing_up:0},_=0,v=0,y=0;for(let e=0;e+1<h.length;e++){let r=h[e],i=h[e+1],a=i-r;if(a<=0)continue;let o=f.find(e=>e.start<=r&&e.end>=i);if(o){g[o.bucket]+=a;continue}if(t.losses.some(e=>e.kind===`lost`&&Ar(e.from,n)<=r&&Ar(e.to,n)>=i)){_+=a;continue}if(t.losses.some(e=>e.kind===`elided`&&Ar(e.from,n)<=r&&Ar(e.to,n)>=i)){v+=a;continue}p.some(([e,t])=>e<=r&&t>=i)&&(y+=a)}let b=g.getting_ready+g.thinking+g.tools+g.finishing_up;return{windowMs:a,gettingReadyMs:g.getting_ready,thinkingMs:g.thinking,toolsMs:g.tools,finishingUpMs:g.finishing_up,overheadMs:Math.max(0,a-b-_-v),notRecordedMs:_,notLoadedMs:v,backgroundOnlyMs:y}}function Ar(e,t){return Math.min(t.end,Math.max(t.start,e))}function jr(e){let t=Math.floor(e.windowMs/1e3),n=[[`getting ready`,Math.floor(e.gettingReadyMs/1e3)],[`thinking`,Math.floor(e.thinkingMs/1e3)],[`in tools`,Math.floor(e.toolsMs/1e3)],[`finishing up`,Math.floor(e.finishingUpMs/1e3)],[`not recorded`,Math.floor(e.notRecordedMs/1e3)],[`not loaded`,Math.floor(e.notLoadedMs/1e3)]],r=n.reduce((e,[,t])=>e+t,0),i=n.filter(([,e])=>e>0).map(([e,t])=>({term:e,s:t})),a=t-r;a>0&&i.push({term:`Switchboard overhead`,s:a});let o=[`getting ready`,`thinking`,`in tools`,`finishing up`,`Switchboard overhead`,`not recorded`,`not loaded`];return i.sort((e,t)=>o.indexOf(e.term)-o.indexOf(t.term)),{totalS:t,items:i}}function Mr(e){return[e.gettingReadyMs,e.thinkingMs,e.toolsMs,e.finishingUpMs,e.overheadMs,e.notRecordedMs,e.notLoadedMs].filter(t=>t>=2e3||e.windowMs>0&&t/e.windowMs>=.05).length>=2}function Nr(e,t){if(t===void 0||t<6e4)return;let n=J(t,`clock`);return e===`before`?`queued ${n} before we saw it`:`queued ${n} behind the previous run`}var Pr={"getting ready":`before the agent's first turn: reading the thread, finding the repo, checking out, loading tools`,thinking:`the model's turns — from a request to the model until its reply came back`,"in tools":`the commands and tool calls the model ran`,"finishing up":`after the agent's last turn: posting the PR, checking the workspace`,"Switchboard overhead":`orchestration between steps, and moments when only a background read was running — the time no step claims`,"not recorded":`a stretch of the run the record does not carry`,"not loaded":`a stretch of the run this page did not load — the record has the full shape`},Fr=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,Ir=`currently delivering`,Lr=`getting ready: not recorded (too large)`,Rr=`no timing data`,zr=`not loaded (the record has the full shape)`,Br={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function Vr(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=kr(t,{window:n,owner:r,finished:i,losses:e.losses}),o=jr(a),s=J(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?Ur(t,r,n):void 0,u=Gr(e,l),d=l?wt(l.name):``,f={window:n,owner:r,phase:e.phase,partition:a,spans:t.map(e=>({spanId:e.spanId,parentSpanId:e.parentSpanId,name:e.name,startedAt:e.startedAt,endedAt:e.endedAt,status:e.status,attrs:e.attrs}))};if(e.untimed)return{total:s,current:u,openStep:d,captions:[],rankedNote:Fr,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:Rr};let p={total:s,current:u,openStep:d,captions:[Nr(`before`,Hr(c,`queuedBeforeMs`)),Nr(`behind`,Hr(c,`queuedBehindMs`))].filter(e=>e!==void 0),rankedNote:Fr,debug:f};if(!c)return{...p,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:i?Lr:``};let m=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?zr:t,h=Mr(a)&&o.items.length>0,g=h?`${s} — ${o.items.map(({term:e,s:t})=>`${J(t*1e3,`clock`)} ${m(e)}`).join(` · `)}`:a.windowMs>0?`${s} — ${m(qr(a))}`:s,_=h?o.items.map(({term:t,s:n})=>({term:t,text:J(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${Pr[t]} (too large)`:Pr[t]})):[];return{...p,lede:g,shown:h,bar:h?Jr(a,l):[],legend:_,ranked:h?Yr(t,c,r,n,e.callTitle):[],note:``}}function Hr(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function Ur(e,t,n){let r=new Map(e.map(e=>[e.spanId,e])),i=e=>{let t=1,n=new Set([e.spanId]),i=e.parentSpanId?r.get(e.parentSpanId):void 0;for(;i&&!n.has(i.spanId);)n.add(i.spanId),t++,i=i.parentSpanId?r.get(i.parentSpanId):void 0;return t},a;for(let o of e){if(o.endedAt!==void 0||o.startedAt>=n.end)continue;let e=vt(o.name,t);if(e?.kind!==`counted`||Wr(o,r,t))continue;let s=i(o);(!a||s>a.depth||s===a.depth&&o.startedAt>a.span.startedAt)&&(a={span:o,depth:s,bucket:e.bucket})}if(a)return{bucket:a.bucket,name:a.span.name,elapsedMs:Math.max(0,n.end-Math.max(n.start,a.span.startedAt))}}function Wr(e,t,n){let r=e,i=new Set;for(;r&&!i.has(r.spanId);){if(i.add(r.spanId),vt(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function Gr(e,t){return e.phase===`delivering`?Ir:e.phase===`ended`?$t(e.delivery??{}):t?`currently ${Br[t.bucket]} ${J(t.elapsedMs,`clock`)}`:``}function Kr(e){return[[`getting ready`,e.gettingReadyMs],[`thinking`,e.thinkingMs],[`in tools`,e.toolsMs],[`finishing up`,e.finishingUpMs],[`Switchboard overhead`,e.overheadMs],[`not recorded`,e.notRecordedMs],[`not loaded`,e.notLoadedMs]]}function qr(e){let t=[`getting ready`,-1];for(let n of Kr(e))n[1]>t[1]&&(t=n);return t[0]}function Jr(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of Kr(e))if(!(a<=0)){if(t&&Br[t.bucket]===i){let e=Math.min(t.elapsedMs,a);a-e>0&&n.push({term:i,ms:a-e,pct:r(a-e),hatched:!1}),e>0&&n.push({term:i,ms:e,pct:r(e),hatched:!0});continue}n.push({term:i,ms:a,pct:r(a),hatched:!1})}return n}function Yr(e,t,n,r,i){let a=new Map(e.map(e=>[e.spanId,e])),o=new Map;for(let t of e){if(t.parentSpanId===void 0)continue;let e=o.get(t.parentSpanId);e?e.push(t):o.set(t.parentSpanId,[t])}let s=e=>[Math.max(r.start,e.startedAt),Math.min(r.end,e.endedAt??r.end)],c=[];for(let r of e){if(r===t||r.name===`run.agent`||vt(r.name,n)===void 0||Wr(r,a,n))continue;let[e,l]=s(r);if(l<=e)continue;let u=(o.get(r.spanId)??[]).map(s).map(([t,n])=>[Math.max(e,t),Math.min(l,n)]).filter(([e,t])=>t>e),d=l-e-Xr(u);if(d<=0)continue;let f=r.name.startsWith(`tool.`)&&typeof r.attrs.callId==`string`?r.attrs.callId:void 0,p=f?i?.(f):void 0;c.push({label:p??wt(r.name),ms:d,facts:Zr(r),anchor:f?`call-${f}`:`span-${r.spanId}`,startedAt:r.startedAt})}return c.sort((e,t)=>t.ms-e.ms||e.startedAt-t.startedAt),c.slice(0,3).map(({label:e,ms:t,facts:n,anchor:r})=>({label:e,ms:t,facts:n,anchor:r}))}function Xr(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=0,r;for(let[e,i]of t)!r||e>r[1]?(r&&(n+=r[1]-r[0]),r=[e,i]):i>r[1]&&(r[1]=i);return r&&(n+=r[1]-r[0]),n}function Zr(e){let t=e.attrs,n=[];return(t.token===`expired`||t.token===`expiring`)&&n.push(`token ${t.token}`),t.budget===`clipped`&&n.push(`budget clipped`),typeof t.timeoutMs==`number`&&n.push(`timeout ${J(t.timeoutMs,`clock`)}`),typeof t.waitedMs==`number`&&n.push(`waited ${J(t.waitedMs,`clock`)}`),typeof t.exitCode==`number`&&t.exitCode!==0&&n.push(`exit ${t.exitCode}`),t.timedOut===!0&&n.push(`timed out`),typeof t.attempts==`number`&&t.attempts>1&&n.push(`${t.attempts} attempts`),e.status===`error`&&n.length===0&&n.push(`failed`),n}function Qr(e){return e===`command`?`command`:`agent`}function $r(e){return e.description?.title?e.description.title:e.pr.repo&&e.pr.number!==void 0?`${e.pr.repo}#${e.pr.number}`:e.pr.repo??`PR review`}var ei=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,ti=/^[0-9a-f]{7,40}$/;function ni(e){if(!e.repo||!ei.test(e.repo))return{};let t=`https://github.com/${e.repo}`,n={};return e.number!==void 0&&Number.isInteger(e.number)&&e.number>0&&(n.pr=`${t}/pull/${e.number}`,n.files=`${t}/pull/${e.number}/files`),e.headSha&&ti.test(e.headSha)&&(n.commit=e.number!==void 0&&n.pr?`${t}/pull/${e.number}/commits/${e.headSha}`:`${t}/commit/${e.headSha}`),n}function ri(e,t){if(!e.repo||!ei.test(e.repo)||!e.headSha||!ti.test(e.headSha))return;let n=t.path.split(`/`),r=/[\\\u0000-\u001f]/;if(n.some(e=>e===``||e===`.`||e===`..`||r.test(e)))return;let i=n.map(encodeURIComponent).join(`/`),{from:a,to:o}=t,s=a===void 0?``:o===void 0||o===a?`#L${a}`:`#L${a}-L${o}`;return`https://github.com/${e.repo}/blob/${e.headSha}/${i}${s}`}function ii(e){return e.find(e=>e.poweredBy===`meat`)??e.find(e=>e.poweredBy===`git`)??null}function ai(e){return e===`meat`?`An abridged reading of the change: a model dropped what a reviewer need not read (style, imports, boilerplate) and kept the concepts`:`The complete change, base…head, as git reports it`}function oi(e){return`The recorded diff was cut at ${e.toLocaleString(`en-US`)} characters; open the full diff on GitHub for the rest`}function si(e){return e===`meat`?`reading diff · meat`:`full diff · git`}var ci=e=>typeof e==`object`&&!!e,li=e=>typeof e==`string`&&e!==``,ui=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;function di(e){for(let t of e.split(/\n\s*\n/)){let e=t.split(`
|
|
8
8
|
`).map(e=>e.trim()).filter(e=>e!==``);if(!(e.length===0||e.every(e=>e.startsWith(`#`))))return e.join(`
|
|
9
9
|
`)}}function fi(e,t){let n=t.trim().toLowerCase(),r=[],i=!1,a=!1;for(let t of e.split(`
|
|
10
10
|
`)){/^\s*```/.test(t)&&(i=!i);let e=i?null:/^##\s+(.+?)\s*$/.exec(t);if(e){if(a)break;a=e[1].toLowerCase()===n;continue}a&&r.push(t)}let o=r.join(`
|
|
@@ -123,4 +123,4 @@ import{_ as e,b as t,d as n,f as r,h as i,m as a,n as o,p as s,r as c,t as l,v a
|
|
|
123
123
|
`+n),r.b(` </div>`),r.b(`
|
|
124
124
|
`+n),r.b(` </div>`),r.b(`
|
|
125
125
|
`+n),r.b(` </div>`),r.b(`
|
|
126
|
-
`+n),r.b(`</div>`),r.fl()},partials:{},subs:{}}),$[`tag-file-added`]=new Q.Template({code:function(e,t,n){var r=this;return r.b(n||=``),r.b(`<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>`),r.fl()},partials:{},subs:{}}),$[`tag-file-changed`]=new Q.Template({code:function(e,t,n){var r=this;return r.b(n||=``),r.b(`<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>`),r.fl()},partials:{},subs:{}}),$[`tag-file-deleted`]=new Q.Template({code:function(e,t,n){var r=this;return r.b(n||=``),r.b(`<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>`),r.fl()},partials:{},subs:{}}),$[`tag-file-renamed`]=new Q.Template({code:function(e,t,n){var r=this;return r.b(n||=``),r.b(`<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>`),r.fl()},partials:{},subs:{}});var Ua=class{constructor({compiledTemplates:e={},rawTemplates:t={}}){let n=Object.entries(t).reduce((e,[t,n])=>{let r=Q.compile(n,{asString:!1});return Object.assign(Object.assign({},e),{[t]:r})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},$),e),n)}static compile(e){return Q.compile(e,{asString:!1})}render(e,t,n,r,i){let a=this.templateKey(e,t);try{return this.preCompiledTemplates[a].render(n,r,i)}catch{throw Error(`Could not find template to render '${a}'`)}}template(e,t){return this.preCompiledTemplates[this.templateKey(e,t)]}templateKey(e,t){return`${e}-${t}`}},Wa=Object.assign(Object.assign(Object.assign({},ka),Fa),{outputFormat:xi.LINE_BY_LINE,drawFileList:!0});function Ga(e,t={}){return Ii(e,Object.assign(Object.assign({},Wa),t))}function Ka(e,t={}){let n=Object.assign(Object.assign({},Wa),t),r=typeof e==`string`?Ii(e,n):e,i=new Ua(n),{colorScheme:a}=n,o={colorScheme:a};return(n.drawFileList?new Oa(i,o).render(r):``)+(n.outputFormat===`side-by-side`?new Ba(i,n).render(r):new Pa(i,n).render(r))}function qa(e){return e.isNew?`added`:e.isDeleted?`deleted`:e.isRename||e.isCopy?`renamed`:`modified`}function Ja(e){return qa(e)===`deleted`?e.oldName:e.newName}function Ya(e){return Ga(e).map(e=>{let t=qa(e);return{path:Ja(e),...t===`renamed`&&e.oldName!==e.newName?{from:e.oldName}:{},status:t,added:e.addedLines,deleted:e.deletedLines,binary:e.isBinary===!0,html:Ka([e],{drawFileList:!1,outputFormat:`line-by-line`,matching:`lines`})}})}function Xa(e){return Ga(e).length}function Za(e){return Ga(e).map(Ja)}function Qa(e){let t=e.lastIndexOf(`/`);return t<0?{dir:``,name:e}:{dir:e.slice(0,t+1),name:e.slice(t+1)}}function $a(e,t,n){if(e.length===0)return-1;if(n)return e.length-1;let r=0;for(let n=0;n<e.length;n++)e[n]<=t+2&&(r=n);return r}function eo(e,t,n){let r=Math.min(t,n),i=Math.max(t,n),a=-1,o=-1;return e.forEach((e,t)=>{e===null||e<r||e>i||(a<0&&(a=t),o=t)}),a<0?[]:Array.from({length:o-a+1},(e,t)=>a+t)}function to(e){return e.from===e.to?`${e.path}:${e.from}`:`${e.path}:${e.from}–${e.to}`}function no(e,t){return!e.sha||!t?!1:!t.startsWith(e.sha)&&!e.sha.startsWith(t)}function ro(e,t){return`anchored at ${e.slice(0,7)}, the review is at ${t.slice(0,7)}; lines may have moved`}function io(e){if(!(e.origin!==`parsed`||e.complete))return e.tour.length===0?`description read from the PR body; no Tour`:`description read from the PR body`}function ao(e,t,n,r=!1){return t.has(e)?`shown`:n.has(e)?`full`:r?`beyond`:`absent`}function oo(e,t,n){return e===`full`?`not in the reading diff · open full diff`:e===`beyond`?t?`beyond the recorded diff · open on GitHub ↗`:`beyond the recorded diff`:e===`absent`?`not in this diff`:n?`lines not in this diff`:void 0}function so(e){return e.description?`${e.title} — ${e.description}`:e.title}var co={key:0,class:`description border-b border-default px-3 py-2`,"data-testid":`pr-description`},lo={key:0,class:`m-0 whitespace-pre-line leading-snug`,"data-testid":`description-tldr`},uo={class:`m-0 mt-0.5 whitespace-pre-line leading-snug`,"data-testid":`description-what-why`},fo={key:0,class:`m-0 mt-1.5 font-sans text-[0.7rem] italic text-dimmed`,"data-testid":`description-origin`},po=N({__name:`DescriptionBlock`,props:{description:{}},setup(e){let t=e,n=V(()=>io(t.description));return(t,r)=>e.description.tldr||e.description.whatWhy||n.value?(W(),H(`section`,co,[r[1]||=F(`h3`,{class:`m-0 mb-1 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},`Description`,-1),L(ot,{lines:5,class:`font-sans text-[0.8rem] text-default`,style:{"--expandable-surface":`var(--ui-bg)`}},{default:C(()=>[e.description.tldr?(W(),H(`p`,lo,K(e.description.tldr),1)):R(``,!0),e.description.whatWhy?(W(),H(B,{key:1},[r[0]||=F(`h4`,{class:`m-0 mt-2 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},`What & why`,-1),F(`p`,uo,K(e.description.whatWhy),1)],64)):R(``,!0)]),_:1}),n.value?(W(),H(`p`,fo,K(n.value),1)):R(``,!0)])):R(``,!0)}}),mo={class:`file-list flex flex-col pb-24 text-xs`,"aria-label":`Files changed`,"data-testid":`file-list`},ho={class:`files`},go={class:`sticky top-0 z-10 flex items-baseline gap-1.5 border-b border-default bg-default px-3 py-1.5 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},_o={class:`tabular-nums text-dimmed`},vo={class:`m-0 list-none p-0`},yo=[`aria-current`,`title`,`onClick`],bo={class:`path min-w-0 flex-1 truncate font-mono`,dir:`rtl`},xo={class:`text-dimmed`},So={class:`counts inline-flex shrink-0 gap-1 font-mono tabular-nums`},Co={key:0,class:`text-dimmed`},wo={class:`text-ins`},To={class:`text-del`},Eo=[`title`],Do=[`checked`,`aria-label`,`onChange`],Oo=N({__name:`FileList`,props:{files:{},current:{},viewed:{}},emits:[`select`,`toggle-viewed`],setup(e,{emit:t}){let n=t,r={added:`i-lucide-file-plus`,deleted:`i-lucide-file-minus`,renamed:`i-lucide-file-symlink`,modified:`i-lucide-file-pen`},i={added:`text-ins`,deleted:`text-del`,renamed:`text-muted`,modified:`text-muted`};return(t,a)=>{let o=le;return W(),H(`nav`,mo,[j(t.$slots,`description`),j(t.$slots,`tour`),F(`section`,ho,[F(`h3`,go,[a[0]||=z(` Files `,-1),F(`span`,_o,K(e.files.length),1)]),F(`ol`,vo,[(W(!0),H(B,null,U(e.files,t=>(W(),H(`li`,{key:t.path,class:`border-b border-muted`},[F(`div`,{class:G([`entry flex items-center gap-1.5 px-2 py-1 hover:bg-muted`,[t.path===e.current?`is-current bg-accented`:``,e.viewed.has(t.path)?`is-viewed`:``]])},[F(`button`,{type:`button`,class:G([`flex min-w-0 flex-1 items-center gap-1.5 text-left`,e.viewed.has(t.path)?`text-dimmed`:`text-default`]),"aria-current":t.path===e.current?`true`:void 0,title:t.from?`${t.from} → ${t.path}`:t.path,"data-testid":`file-entry`,onClick:e=>n(`select`,t.path)},[L(o,{name:r[t.status],class:G([`size-3.5 shrink-0`,i[t.status]])},null,8,[`name`,`class`]),F(`span`,bo,[F(`bdi`,null,[F(`span`,xo,K(P(Qa)(t.path).dir),1),F(`span`,{class:G(e.viewed.has(t.path)?``:`text-highlighted`)},K(P(Qa)(t.path).name),3)])]),F(`span`,So,[t.binary?(W(),H(`span`,Co,`bin`)):(W(),H(B,{key:1},[F(`span`,wo,`+`+K(t.added),1),F(`span`,To,`−`+K(t.deleted),1)],64))])],10,yo),F(`label`,{class:`viewed-toggle flex shrink-0 cursor-pointer items-center`,title:e.viewed.has(t.path)?`Mark as not viewed`:`Mark as viewed`},[F(`input`,{type:`checkbox`,class:`sr-only`,checked:e.viewed.has(t.path),"aria-label":`Viewed: ${t.path}`,"data-testid":`file-entry-viewed`,onChange:e=>n(`toggle-viewed`,t.path)},null,40,Do),L(o,{name:e.viewed.has(t.path)?`i-lucide-square-check`:`i-lucide-square`,class:G([`size-3.5`,e.viewed.has(t.path)?`text-ins`:`text-dimmed`])},null,8,[`name`,`class`])],8,Eo)],2)]))),128))])])])}}}),ko=N({__name:`LabelTip`,props:{text:{},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>{let r=we;return W(),k(r,{text:e.text,disabled:e.disabled,"delay-duration":250,content:{side:`bottom`,align:`end`,sideOffset:6,collisionPadding:8},ui:{content:`h-auto max-w-[28rem] px-2.5 py-1.5`,text:`text-clip whitespace-normal leading-snug`}},{default:C(()=>[j(t.$slots,`default`)]),_:3},8,[`text`,`disabled`])}}}),Ao={key:0,class:`lede border-b border-default px-4 py-3`,"data-testid":`diff-lede`},jo={class:`m-0 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},Mo={class:`m-0 mt-1 max-w-[80ch] font-sans text-sm leading-normal text-default`,"data-testid":`diff-summary`},No={key:1,class:`px-4 py-6 text-sm text-muted`,"data-testid":`no-files`},Po=[`data-path`],Fo={class:`file-head sticky top-0 z-10 flex h-8 items-center gap-2 border-b border-default bg-elevated px-2 text-xs`},Io=[`aria-expanded`,`aria-label`,`onClick`],Lo=[`title`],Ro={class:`text-muted`},zo={key:0,class:`shrink-0 rounded bg-accented px-1.5 text-[0.68rem] leading-normal text-muted`},Bo={key:1,class:`counts inline-flex shrink-0 gap-1 font-mono tabular-nums`},Vo={class:`text-ins`},Ho={class:`text-del`},Uo={class:`viewed flex shrink-0 cursor-pointer select-none items-center gap-1.5 pl-2 text-muted`},Wo=[`checked`,`onChange`],Go=[`innerHTML`],Ko={key:2,class:`footer px-4 pb-24 pt-4 text-center font-sans text-[0.68rem] font-semibold uppercase tracking-wider text-muted`,"data-testid":`diff-end`},qo={class:`text-ins`},Jo={class:`text-del`},Yo=`is-focus`,Xo=.3,Zo=N({__name:`ReadingDiffView`,props:{diff:{},files:{},current:{},viewed:{},wrap:{type:Boolean},fullFileCount:{}},emits:[`reached`,`toggle-viewed`],setup(e,{expose:t,emit:n}){let r=e,i=V(()=>({added:r.files.reduce((e,t)=>e+t.added,0),deleted:r.files.reduce((e,t)=>e+t.deleted,0)})),a=n,o={added:`i-lucide-file-plus`,deleted:`i-lucide-file-minus`,renamed:`i-lucide-file-symlink`,modified:`i-lucide-file-pen`},s=O(null),c=new Map;function l(e,t){t instanceof HTMLElement?c.set(e,t):c.delete(e)}let u=pe(new Map);function d(e){return u.get(e)??!r.viewed.has(e)}function f(e){u.set(e,!d(e))}function p(e){u.delete(e),a(`toggle-viewed`,e)}I(()=>r.diff,()=>u.clear());function m(){let e=s.value;if(!e)return;let t=r.files.map(e=>c.get(e.path)).filter(e=>e!==void 0),n=t.map(e=>e.offsetTop),i=e.scrollTop+e.clientHeight>=e.scrollHeight-2,o=t[$a(n,e.scrollTop,i)]?.dataset.path;o!==void 0&&o!==r.current&&a(`reached`,o)}E(()=>s.value?.addEventListener(`scroll`,m,{passive:!0})),g(()=>s.value?.removeEventListener(`scroll`,m));function h(e){let t=s.value,n=c.get(e);return!t||!n?!1:(t.scrollTo({top:n.offsetTop}),!0)}let _=[];function b(){for(let e of _)e.classList.remove(Yo);_=[]}async function x(e,t,n){let r=s.value,i=c.get(e);if(!r||!i)return!1;let a=Array.from(i.querySelectorAll(`tr`)),o=eo(a.map(e=>{let t=Number.parseInt(e.querySelector(`.line-num2`)?.textContent?.trim()??``,10);return Number.isFinite(t)?t:null}),t,n);if(o.length===0)return!1;b(),_=o.map(e=>a[e]);for(let e of _)e.classList.add(Yo);d(e)||(u.set(e,!0),await v());let l=_[0],f=i.querySelector(`header`)?.getBoundingClientRect().height??0,p=Math.max(f+24,Math.round(r.clientHeight*Xo)),m=l.getBoundingClientRect().top-r.getBoundingClientRect().top+r.scrollTop-p;return r.scrollTo({top:Math.max(0,m)}),!0}return t({scrollTo:x,scrollToFile:h}),(t,n)=>{let r=le;return W(),H(`div`,{ref_key:`container`,ref:s,class:G([`reading-diff d2h-host relative min-w-0 overflow-y-auto overflow-x-hidden`,{wrap:e.wrap}]),"data-testid":`reading-diff`},[e.diff.summary?(W(),H(`section`,Ao,[F(`h3`,jo,` Summary · `+K(e.diff.poweredBy),1),F(`p`,Mo,K(e.diff.summary),1)])):R(``,!0),e.files.length===0?(W(),H(`p`,No,` Nothing in this diff parsed as a file. `)):R(``,!0),(W(!0),H(B,null,U(e.files,t=>(W(),H(`section`,{key:t.path,ref_for:!0,ref:e=>l(t.path,e),"data-path":t.path,class:G([`file border-b border-default`,{"is-viewed":e.viewed.has(t.path)}]),"data-testid":`diff-file`},[F(`header`,Fo,[F(`button`,{type:`button`,class:`flex size-5 shrink-0 items-center justify-center rounded text-dimmed hover:bg-accented hover:text-default`,"aria-expanded":d(t.path),"aria-label":d(t.path)?`Collapse file`:`Expand file`,"data-testid":`file-collapse`,onClick:e=>f(t.path)},[L(r,{name:d(t.path)?`i-lucide-chevron-down`:`i-lucide-chevron-right`,class:`size-3.5`},null,8,[`name`])],8,Io),L(r,{name:o[t.status],class:G([`size-3.5 shrink-0`,t.status===`added`?`text-ins`:t.status===`deleted`?`text-del`:`text-muted`])},null,8,[`name`,`class`]),F(`span`,{class:`path min-w-0 flex-1 truncate font-mono text-highlighted`,title:t.from?`${t.from} → ${t.path}`:t.path},[t.from?(W(),H(B,{key:0},[F(`span`,Ro,K(t.from),1),n[0]||=z(` → `,-1)],64)):R(``,!0),z(K(t.path),1)],8,Lo),t.binary?(W(),H(`span`,zo,`binary`)):(W(),H(`span`,Bo,[F(`span`,Vo,`+`+K(t.added),1),F(`span`,Ho,`−`+K(t.deleted),1)])),F(`label`,Uo,[F(`input`,{type:`checkbox`,class:`size-3.5 cursor-pointer accent-(--pr-review-ins)`,checked:e.viewed.has(t.path),"data-testid":`file-viewed`,onChange:e=>p(t.path)},null,40,Wo),n[1]||=z(` Viewed `,-1)])]),y(F(`div`,{class:`file-body`,"data-testid":`file-body`,innerHTML:t.html},null,8,Go),[[Ce,d(t.path)]])],10,Po))),128)),e.files.length>0?(W(),H(`footer`,Ko,[e.fullFileCount===void 0?(W(),H(B,{key:1},[z(` End of diff · `+K(e.files.length)+` `+K(e.files.length===1?`file`:`files`)+` · `,1),F(`span`,qo,`+`+K(i.value.added),1),n[2]||=z(),F(`span`,Jo,`−`+K(i.value.deleted),1)],64)):(W(),H(B,{key:0},[z(` End of reading diff · `+K(e.files.length)+` of `+K(e.fullFileCount)+` files shown `,1)],64))])):R(``,!0)],2)}}}),Qo={class:`m-0 flex items-baseline gap-1.5 border-b border-muted px-3 py-1.5 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},$o={class:`normal-case tracking-normal text-dimmed`},es={class:`m-0 list-none p-0`},ts={class:`flex min-w-0 flex-1 flex-col gap-0.5 font-sans text-[0.8rem]`},ns={key:0,class:`step-description line-clamp-2 leading-snug text-muted`},rs={key:0,class:`step-look-for leading-snug text-muted`},is={class:`flex min-w-0 items-baseline gap-x-2`},as=[`aria-label`],os={key:1,class:`text-[0.7rem] italic leading-snug text-dimmed`,"data-testid":`tour-step-note`},ss={key:1,class:`px-3 py-1.5`,"data-testid":`tour-remaining`},cs={class:`m-0 flex list-none flex-col gap-0.5 p-0`},ls={class:`font-sans text-[0.8rem] text-muted`},us=N({__name:`TourList`,props:{steps:{},remaining:{},shownPaths:{},fullPaths:{},fullTruncated:{type:Boolean},pr:{},reviewedSha:{},active:{},missed:{}},emits:[`jump`,`open`],setup(e,{emit:t}){let n=e,r=t,i=V(()=>n.steps.map(e=>ao(e.anchor.path,n.shownPaths,n.fullPaths,n.fullTruncated))),a=V(()=>n.steps.map((e,t)=>i.value[t]===`beyond`?ri(n.pr,e.anchor):void 0));function o(e){return oo(i.value[e],a.value[e]!==void 0,n.missed===e)}function s(e){let t=i.value[e];return t===`shown`||t===`full`||a.value[e]!==void 0}function c(e){(i.value[e]===`shown`||i.value[e]===`full`)&&r(`jump`,e)}function l(e){let{sha:t}=e.anchor;return t&&n.reviewedSha&&no(e.anchor,n.reviewedSha)?ro(t,n.reviewedSha):void 0}function u(e){return n.shownPaths.has(e)||n.fullPaths.has(e)}function d(e){return!u(e)&&n.fullTruncated?ri(n.pr,{path:e}):void 0}function f(e){return u(e)?e:d(e)?`${e} — beyond the recorded diff · open on GitHub`:`${e} — not in this diff`}let p=O(null),m=new Map,h=new Map;function _(e,t,n){n instanceof HTMLElement?e.set(t,n):e.delete(t)}let y=O(new Set),b=e=>e.scrollHeight>e.clientHeight+1;function x(){let e=new Set;for(let[t,n]of m)Array.from(n.querySelectorAll(`.step-title, .step-description`)).some(b)&&e.add(`prose:${t}`);for(let[t,n]of h)n.scrollWidth>n.clientWidth+1&&e.add(`anchor:${t}`);y.value=e}let S=null;E(()=>{x(),typeof ResizeObserver<`u`&&p.value&&(S=new ResizeObserver(()=>x()),S.observe(p.value))}),g(()=>S?.disconnect()),I(()=>n.steps,()=>void v(x),{deep:!0});function w(e){let t=n.steps[e];return[y.value.has(`prose:${e}`)?so(t):void 0,y.value.has(`anchor:${e}`)?to(t.anchor):void 0,l(t)].filter(e=>e!==void 0).join(` · `)}return(t,n)=>{let g=le;return W(),H(`section`,{ref_key:`root`,ref:p,class:`tour border-b border-default text-xs`,"data-testid":`tour`},[e.steps.length>0?(W(),H(B,{key:0},[F(`h3`,Qo,[n[0]||=z(` Tour `,-1),F(`span`,$o,`· `+K(e.steps.length)+` `+K(e.steps.length===1?`step`:`steps`),1)]),F(`ol`,es,[(W(!0),H(B,null,U(e.steps,(t,r)=>(W(),H(`li`,{key:r,class:`border-b border-muted`},[L(ko,{text:w(r),disabled:w(r)===``},{default:C(()=>[(W(),k(re(a.value[r]?`a`:`button`),{type:a.value[r]?void 0:`button`,href:a.value[r],target:a.value[r]?`_blank`:void 0,rel:a.value[r]?`noopener noreferrer`:void 0,class:G([`step flex w-full gap-2 px-3 py-1.5 text-left no-underline transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary motion-reduce:transition-none`,[e.active===r?`is-active`:`hover:bg-muted`,s(r)?`text-default`:`is-muted text-dimmed`,a.value[r]?`is-beyond`:``]]),"data-placement":i.value[r],"aria-current":e.active===r?`step`:void 0,"data-testid":`tour-step`,onClick:e=>c(r)},{default:C(()=>[F(`span`,{class:G([`step-number mt-px flex size-4 shrink-0 items-center justify-center rounded-full text-[0.65rem] font-semibold tabular-nums`,e.active===r?`bg-(--pr-review-mark) text-inverted`:`bg-accented text-muted`])},K(r+1),3),F(`span`,ts,[F(`span`,{ref_for:!0,ref:e=>_(P(m),r,e),class:`step-prose flex min-w-0 flex-col gap-0.5`,"data-testid":`tour-step-prose`},[F(`span`,{class:G([`step-title line-clamp-2 min-w-0 font-medium leading-snug`,s(r)?`text-highlighted`:``])},K(t.title),3),t.description?(W(),H(`span`,ns,K(t.description),1)):R(``,!0)],512),t.lookFor?(W(),H(`span`,rs,[n[1]||=F(`span`,{class:`font-medium text-default`},`Look for:`,-1),z(` `+K(t.lookFor),1)])):R(``,!0),F(`span`,is,[F(`span`,{ref_for:!0,ref:e=>_(P(h),r,e),class:`step-anchor min-w-0 shrink truncate font-mono text-[0.7rem] text-dimmed`,dir:`rtl`},[F(`bdi`,null,K(P(to)(t.anchor)),1)],512),l(t)?(W(),H(`span`,{key:0,class:`inline-flex shrink-0 items-center self-center rounded bg-warning/15 px-1 text-warning`,"aria-label":l(t),"data-testid":`tour-step-stale`},[L(g,{name:`i-lucide-triangle-alert`,class:`size-3`})],8,as)):R(``,!0)]),o(r)?(W(),H(`span`,os,K(o(r)),1)):R(``,!0)])]),_:2},1032,[`type`,`href`,`target`,`rel`,`class`,`data-placement`,`aria-current`,`onClick`]))]),_:2},1032,[`text`,`disabled`])]))),128))])],64)):R(``,!0),e.remaining.length>0?(W(),H(`div`,ss,[n[2]||=F(`h4`,{class:`m-0 mb-1 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},`Remaining changes`,-1),F(`ul`,cs,[(W(!0),H(B,null,U(e.remaining,e=>(W(),H(`li`,{key:e.path,class:`min-w-0 leading-snug`,"data-testid":`tour-remaining-entry`},[(W(),k(re(d(e.path)?`a`:`button`),{type:d(e.path)?void 0:`button`,href:d(e.path),target:d(e.path)?`_blank`:void 0,rel:d(e.path)?`noopener noreferrer`:void 0,class:G([`font-mono text-[0.7rem] no-underline hover:underline focus-visible:outline-2 focus-visible:outline-primary`,u(e.path)||d(e.path)?`text-default`:`is-muted text-dimmed`]),title:f(e.path),onClick:t=>u(e.path)?r(`open`,e.path):void 0},{default:C(()=>[z(K(e.path),1)]),_:2},1032,[`type`,`href`,`target`,`rel`,`class`,`title`,`onClick`])),F(`span`,ls,` — `+K(e.note),1)]))),128))])])):R(``,!0)],512)}}}),ds={class:`pr-review-panel flex h-full min-h-0 min-w-0 flex-col`,"data-testid":`pr-review-panel`},fs={class:`header flex shrink-0 flex-col gap-1 border-b border-default px-4 py-2.5`},ps={class:`flex items-center gap-2`},ms={class:`m-0 min-w-0 flex-1 truncate text-sm font-semibold text-highlighted`,"data-testid":`pr-title`},hs=[`href`],gs={key:0,class:`flex shrink-0 gap-0.5 rounded-md bg-accented p-0.5`,role:`tablist`,"aria-label":`Diff producer`,"data-testid":`diff-tabs`},_s=[`aria-selected`,`onClick`],vs={key:1,class:`inline-flex shrink-0 items-center gap-1.5 text-xs text-muted`,"data-testid":`abridge-running`},ys={key:2,class:`inline-flex min-w-0 shrink items-center gap-1.5 text-xs text-error`,"data-testid":`abridge-failed`},bs=[`title`],xs={class:`facts flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted`,"data-testid":`pr-facts`},Ss=[`href`],Cs={key:1,class:`font-medium`},ws=[`href`],Ts={title:`the base the diff is against`},Es={class:`inline-flex gap-1 tabular-nums`,"data-testid":`pr-totals`},Ds={class:`text-ins`},Os={class:`text-del`},ks=[`href`],As={key:0,class:`body flex min-h-0 flex-1`},js={class:`hidden w-[19rem] shrink-0 overflow-y-auto border-r border-default md:block`},Ms={key:1,class:`px-4 py-3 text-sm text-muted`,"data-testid":`no-diff`},Ns=`Abridge the full diff with meat.dev: a model keeps the concepts and drops what a reviewer need not read. One model call; usually a minute or three.`,Ps=N({__name:`PrReviewPanel`,props:{data:{},closable:{type:Boolean,default:!1},abridge:{default:void 0}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=V(()=>ni(n.data.pr)),a=V(()=>$r(n.data)),o=V(()=>n.data.readingDiffs),s=V(()=>n.data.description),c=V(()=>[o.value.find(e=>e.poweredBy===`meat`),o.value.find(e=>e.poweredBy===`git`)].filter(e=>e!==void 0)),l=O(0);I(()=>ii(o.value),()=>l.value=0);let u=V(()=>c.value[l.value]??c.value[0]??null),d=V(()=>u.value?Ya(u.value.diff):[]),f=V(()=>c.value.findIndex(e=>e.poweredBy===`git`)),p=V(()=>{let e=c.value[f.value];return u.value?.poweredBy===`meat`&&e?Xa(e.diff):void 0}),m=V(()=>({added:d.value.reduce((e,t)=>e+t.added,0),deleted:d.value.reduce((e,t)=>e+t.deleted,0)})),h=V(()=>n.data.pr.headSha?.slice(0,7)),g=V(()=>n.abridge!==void 0&&n.abridge.state.state!==`done`&&c.value.length===1&&u.value?.poweredBy===`git`),_=pe(new Set);function y(e){_.has(e)?_.delete(e):_.add(e)}let b=O(null);I(d,e=>b.value=e[0]?.path??null,{immediate:!0});let x=O(null);function S(e){b.value=e,x.value?.scrollToFile(e)}let w=V(()=>new Set(d.value.map(e=>e.path))),T=V(()=>{let e=c.value[f.value];return e?new Set(Za(e.diff)):w.value}),E=V(()=>(c.value[f.value]??u.value)?.truncated===!0),D=O(null),A=O(null);I(s,()=>{D.value=null,A.value=null});async function te(e){return w.value.has(e)?!0:f.value<0||!T.value.has(e)?!1:(l.value=f.value,await v(),!0)}async function ne(e){let t=s.value?.tour[e];if(!t||!await te(t.anchor.path))return;let{path:n,from:r,to:i}=t.anchor;D.value=e,b.value=n;let a=await x.value?.scrollTo(n,r,i)??!1;!a&&l.value!==f.value&&f.value>=0&&(l.value=f.value,await v(),b.value=n,a=await x.value?.scrollTo(n,r,i)??!1),A.value=a?null:e,a||x.value?.scrollToFile(n)}async function re(e){await te(e)&&S(e)}let M=O(!1);return(t,n)=>{let o=ee,f=le,v=bi;return W(),H(`div`,ds,[F(`header`,fs,[F(`div`,ps,[F(`h2`,ms,[i.value.pr?(W(),H(`a`,{key:0,href:i.value.pr,target:`_blank`,rel:`noopener noreferrer`,class:`hover:underline`},K(a.value),9,hs)):(W(),H(B,{key:1},[z(K(a.value),1)],64))]),c.value.length>1?(W(),H(`div`,gs,[(W(!0),H(B,null,U(c.value,(e,t)=>(W(),k(ko,{key:e.poweredBy,text:P(ai)(e.poweredBy)},{default:C(()=>[F(`button`,{type:`button`,role:`tab`,class:G([`rounded px-2 py-0.5 text-xs leading-normal transition-colors motion-reduce:transition-none`,t===l.value?`bg-default font-semibold text-highlighted shadow-sm ring-1 ring-default`:`font-medium text-muted hover:bg-default/60 hover:text-default`]),"aria-selected":t===l.value,onClick:e=>l.value=t},K(e.poweredBy===`meat`?`Reading diff`:`Full diff`),11,_s)]),_:2},1032,[`text`]))),128))])):g.value&&e.abridge?(W(),H(B,{key:1},[e.abridge.state.state===`absent`?(W(),k(ko,{key:0,text:Ns},{default:C(()=>[L(o,{size:`xs`,color:`neutral`,variant:`outline`,icon:`i-lucide-scissors`,label:`Abridge with meat`,"data-testid":`abridge-button`,onClick:n[0]||=t=>e.abridge.start()})]),_:1})):e.abridge.state.state===`running`?(W(),H(`span`,vs,[L(f,{name:`i-lucide-loader-circle`,class:`size-3.5 animate-spin`}),n[5]||=z(` Abridging… usually 1–3 minutes `,-1)])):e.abridge.state.state===`failed`?(W(),H(`span`,ys,[L(f,{name:`i-lucide-circle-alert`,class:`size-3.5 shrink-0`}),F(`span`,{class:`truncate`,title:e.abridge.state.reason},`Abridging failed: `+K(e.abridge.state.reason),9,bs),L(o,{size:`xs`,color:`neutral`,variant:`outline`,label:`Retry`,"data-testid":`abridge-retry`,onClick:n[1]||=t=>e.abridge.start()})])):R(``,!0)],64)):R(``,!0),u.value?(W(),k(o,{key:2,size:`xs`,color:`neutral`,variant:M.value?`soft`:`ghost`,icon:`i-lucide-wrap-text`,"aria-pressed":M.value,"aria-label":`Wrap long lines`,title:`Wrap long lines`,"data-testid":`wrap-toggle`,onClick:n[2]||=e=>M.value=!M.value},null,8,[`variant`,`aria-pressed`])):R(``,!0),e.closable?(W(),k(o,{key:3,size:`xs`,color:`neutral`,variant:`ghost`,icon:`i-lucide-x`,"aria-label":`Close`,"data-testid":`panel-close`,onClick:n[3]||=e=>r(`close`)})):R(``,!0)]),F(`div`,xs,[i.value.pr?(W(),H(`a`,{key:0,href:i.value.pr,target:`_blank`,rel:`noopener noreferrer`,class:`font-medium text-primary hover:underline`,"data-testid":`pr-link`},K(e.data.pr.repo)+`#`+K(e.data.pr.number),9,Ss)):e.data.pr.repo?(W(),H(`span`,Cs,K(e.data.pr.repo),1)):R(``,!0),i.value.commit?(W(),H(B,{key:2},[n[6]||=F(`span`,{"aria-hidden":`true`},`·`,-1),F(`a`,{href:i.value.commit,target:`_blank`,rel:`noopener noreferrer`,class:`font-mono hover:underline`,"data-testid":`commit-link`},K(h.value),9,ws)],64)):R(``,!0),u.value?(W(),H(B,{key:3},[n[7]||=F(`span`,{"aria-hidden":`true`},`·`,-1),F(`span`,Ts,`against origin/`+K(u.value.baseRef),1),n[8]||=F(`span`,{"aria-hidden":`true`},`·`,-1),F(`span`,Es,[F(`span`,null,K(d.value.length)+` `+K(d.value.length===1?`file`:`files`)+`,`,1),F(`span`,Ds,`+`+K(m.value.added),1),F(`span`,Os,`−`+K(m.value.deleted),1)]),n[9]||=F(`span`,{"aria-hidden":`true`},`·`,-1),L(ko,{text:P(ai)(u.value.poweredBy)},{default:C(()=>[L(v,{color:u.value.poweredBy===`meat`?`primary`:`neutral`,variant:`subtle`,size:`sm`,label:P(si)(u.value.poweredBy),"data-testid":`producer-badge`},null,8,[`color`,`label`])]),_:1},8,[`text`]),u.value.truncated?(W(),k(ko,{key:0,text:P(oi)(u.value.diff.length)},{default:C(()=>[L(v,{color:`warning`,variant:`subtle`,size:`sm`,label:`truncated`,"data-testid":`truncated-badge`})]),_:1},8,[`text`])):R(``,!0)],64)):R(``,!0),i.value.files?(W(),H(B,{key:4},[n[10]||=F(`span`,{"aria-hidden":`true`},`·`,-1),F(`a`,{href:i.value.files,target:`_blank`,rel:`noopener noreferrer`,class:`hover:underline`,"data-testid":`files-link`},` all files on GitHub ↗ `,8,ks)],64)):R(``,!0)])]),u.value?(W(),H(`div`,As,[F(`aside`,js,[L(Oo,{files:d.value,current:b.value,viewed:_,onSelect:S,onToggleViewed:y},{description:C(()=>[j(t.$slots,`description`,{},()=>[s.value?(W(),k(po,{key:0,description:s.value},null,8,[`description`])):R(``,!0)])]),tour:C(()=>[j(t.$slots,`tour`,{},()=>[s.value&&(s.value.tour.length>0||s.value.remaining.length>0)?(W(),k(us,{key:0,steps:s.value.tour,remaining:s.value.remaining,"shown-paths":w.value,"full-paths":T.value,"full-truncated":E.value,pr:e.data.pr,"reviewed-sha":e.data.pr.headSha??s.value.headSha,active:D.value,missed:A.value,onJump:ne,onOpen:re},null,8,[`steps`,`remaining`,`shown-paths`,`full-paths`,`full-truncated`,`pr`,`reviewed-sha`,`active`,`missed`])):R(``,!0)])]),_:3},8,[`files`,`current`,`viewed`])]),L(Zo,{ref_key:`view`,ref:x,class:`flex-1`,diff:u.value,files:d.value,current:b.value,viewed:_,wrap:M.value,"full-file-count":p.value,onReached:n[4]||=e=>b.value=e,onToggleViewed:y},null,8,[`diff`,`files`,`current`,`viewed`,`wrap`,`full-file-count`])])):(W(),H(`p`,Ms,` No reading diff was produced for this review. `))])}}}),Fs={class:`conn flex items-center gap-2`},Is={key:0,class:`ok text-ok`,role:`img`,"aria-label":`succeeded`},Ls=[`data-heat`],Rs={key:2,id:`delivery`,class:`text-xs text-muted`},zs=[`title`],Bs={key:0,id:`actions`,class:`actions flex gap-1.5`},Vs={class:`mx-auto max-w-6xl`},Hs={key:0,id:`runmeta`,class:`runmeta facts mb-3 flex flex-wrap items-baseline gap-x-3 gap-y-1.5 px-(--sb-gutter) text-xs text-dimmed`},Us={class:`agent text-[0.68rem] font-semibold uppercase tracking-wider text-toned`},Ws={class:`model`},Gs={key:0,class:`effort`},Ks=[`href`],qs={key:2,class:`repo`},Js=[`href`],Ys={key:4,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned`},Xs=[`href`,`title`],Zs=[`href`],Qs={key:1,id:`request`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},$s={class:`mb-2 flex items-baseline gap-2.5 text-xs font-semibold uppercase tracking-wider text-muted`},ec={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},tc=[`href`],nc={key:1},rc={key:1},ic=[`title`],ac={key:3,id:`context`,class:`group mb-4 px-(--sb-gutter)`},oc={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 text-xs font-semibold uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},sc={class:`count font-normal normal-case tracking-normal text-dimmed`},cc={id:`contextturns`,class:`pb-1 pl-5`},lc=[`title`],uc={id:`thisrun`,class:`mb-2 flex items-baseline gap-2.5 px-(--sb-gutter) text-xs font-semibold uppercase tracking-wider text-muted`},dc={key:0,class:`count font-normal normal-case tracking-normal text-dimmed`},fc=[`aria-pressed`,`data-open`,`title`],pc={id:`log`,class:`m-0 list-none p-0`},mc={key:0,id:`placeholder`,class:`empty text-muted`},hc=[`id`],gc={class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 pr-(--sb-gutter) text-xs tabular-nums text-dimmed`},_c=[`title`],vc=[`title`],yc=[`title`],bc={key:2,class:`nonar font-sans italic`},xc=[`title`],Sc=[`data-phase`],Cc=[`aria-expanded`,`onClick`],wc={class:`glyph select-none text-dimmed`},Tc={class:`what`},Ec={key:0,class:`m-0 list-none p-0 pl-4`},Dc={key:4,class:`followup block mt-5 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Oc={class:`mb-2 flex items-baseline gap-2.5 text-xs font-semibold uppercase tracking-wider text-muted`},kc={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},Ac=[`href`],jc={key:1},Mc=[`title`],Nc=[`title`],Pc={key:1,id:`thinking`,class:`pending ml-3.5 mt-5 flex items-center gap-3 rounded-md border border-dashed border-accented pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 text-sm first:mt-0`,"aria-live":`off`,title:`the model is working on its next turn — nothing back yet (since the last event, runner clock)`},Fc=[`title`],Ic={class:`verb min-w-0 truncate text-toned`},Lc=N({__name:`RunPage`,setup(e){let t=fe(`run`),n=t?.mode===`history`,r=n?`Run`:`Live run`,i=n,a=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,s=Yt({openTags:a?a.split(`,`).map(e=>e.trim()).filter(Boolean):void 0}),c=s.state,u=O(n?`ended`:`connecting`),f=O(``),p=Oe(),m=t?.mode===`live`?Zt(t,p.value):null,h=O(void 0),g=O({}),_=V(()=>{if(n&&t?.mode===`history`)return t.status===`completed`?{ok:!0,cls:``,word:`succeeded`}:{ok:!1,cls:t.status===`failed`||t.status===`stopped_hard`||t.status===`interrupted`?`red`:t.status===`stopped_soft`?`amber`:`grey`,word:t.status?Ne(t.status):`ended`};let e=c.stopMode;return{ok:!1,cls:e===`hard`?`red`:e===`soft`?`amber`:`grey`,word:e===`hard`?`killed`:e===`soft`?`stopped early`:`ended`}}),y=V(()=>n&&t?.mode===`history`?t.durationMs:h.value),b=V(()=>$t(n&&t?.mode===`history`?{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk}:g.value)),x=V(()=>y.value===void 0?``:J(y.value,`clock`)),S=V(()=>Me(y.value,`run`)),w=V(()=>Fe(S.value)),D={red:`border-bad/30 text-bad`,amber:`border-warn/30 text-warn`,grey:`border-accented text-muted`},j=V(()=>f.value?f.value:u.value===`connecting`?`connecting…`:u.value===`disconnected`?`disconnected`:u.value===`stopping`?`stopping (${c.stopMode??`soft`})`:u.value===`finished`?h.value===void 0?`delivering…`:`delivering… · ${J(h.value,`clock`)}`:m?`running · ${J(m.elapsedMs(p.value),`clock`)}`:`running`),te=V(()=>f.value||u.value===`disconnected`?`text-bad`:u.value===`running`?`text-ok motion-safe:animate-pulse`:u.value===`finished`?`text-ok`:`text-warn motion-safe:animate-pulse`),ne=V(()=>{if(!t||t.mode!==`live`&&t.mode!==`history`)return null;c.traceVersion;let e=t.receivedAt??t.startedAt,n=Qr(c.meta?.agent);if(t.mode===`history`){let r=t.durationMs??(t.finishedAt===void 0?0:Math.max(0,t.finishedAt-e));return Vr({spans:s.spanSet(),losses:s.losses(e),window:{start:e,end:e+r},owner:n,totalMs:r,phase:`ended`,delivery:{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk},...t.truncated===void 0?{}:{truncated:t.truncated},...t.untimed?{untimed:!0}:{},callTitle:s.callHeadline})}if(!m)return null;let r=u.value===`ended`?`ended`:u.value===`finished`?`delivering`:`live`,i=r===`live`?m.elapsedMs(p.value):h.value??m.elapsedMs(p.value);return Vr({spans:s.spanSet(),losses:s.losses(e),window:{start:e,end:e+i},owner:n,totalMs:i,phase:r,delivery:g.value,callTitle:s.callHeadline})}),re=n&&t?.mode===`history`?`/runs/${encodeURIComponent(t.id)}/events`:void 0;function M(e){s.reveal(e)&&v().then(()=>{let t=document.getElementById(e);t&&(t.scrollIntoView?.({block:`center`}),t.classList.add(`revealed`),setTimeout(()=>t.classList.remove(`revealed`),1500))})}let ie=O(n),ae=O(!1);function N(e){t?.mode===`live`&&(e!==`hard`||o.confirm(`Hard stop: abort the run now with no summary and free its sandbox?`))&&(ae.value=!0,fetch(`${t.stopUrl}&mode=${encodeURIComponent(e)}`,{method:`POST`,credentials:`same-origin`}).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status}`);oe(e)}).catch(e=>{ae.value=!1,f.value=`stop failed: ${e instanceof Error?e.message:`error`}`}))}function oe(e){s.markStopping(e),ie.value=!0,(u.value===`connecting`||u.value===`running`)&&(u.value=`stopping`)}I(()=>c.stopMode,e=>{e&&u.value!==`ended`&&u.value!==`disconnected`&&u.value!==`finished`&&oe(e)}),n||I(u,e=>o.setFavicon(e===`ended`||e===`disconnected`||e===`finished`?Le:Ie),{immediate:!0});let se=V(()=>!n&&u.value!==`ended`&&u.value!==`disconnected`&&u.value!==`finished`),ce=V(()=>se.value?Xt(c,p.value):null);me(tn,ce);let ue=V(()=>se.value?on(c,s.pendingCall(),p.value):null),de=[`Thinking`,`Pondering`,`Mulling it over`,`Reasoning`,`Cogitating`,`Weighing options`,`Puzzling`,`Deliberating`,`Noodling`,`Chewing on it`,`Ruminating`,`Reticulating splines`],pe=V(()=>ue.value?.kind===`thinking`?ne.value?.openStep||de[Math.floor(ue.value.elapsedMs/6e3)%de.length]:``);function he(){s.setAllOpen(!c.allOpen)}let ge=V(()=>c.log.filter(e=>e.kind===`step`).length),_e=O(null);function ve(){return window.innerHeight+window.scrollY>=document.body.scrollHeight-60}let ye=hi(),be=O(!1),xe=t?.mode===`history`&&t.capabilities.readingDiffAbridge?vi(t.id,e=>ye.handle(e)):void 0;d(()=>xe?.dispose());function Se(e){let t=ve();s.handle(e),ye.handle(e),t&&requestAnimationFrame(()=>_e.value?.scrollIntoView?.({block:`nearest`}))}let Ce=je(),q=null;if(t?.mode===`history`){for(let e of t.events)s.handle(e),ye.handle(e);s.closePhases()}E(()=>{if(t?.mode!==`live`)return;q=Ce(t.eventsUrl),q.onopen=()=>{c.stopMode||(u.value=`running`)};let e=0;q.onmessage=t=>{let n;try{n=JSON.parse(t.data)}catch{return}if(n.type!==`replay_note`){let n=Number(t.lastEventId);if(n>0){if(n<=e)return;e=n}}Se(n)},q.addEventListener(`replay_elided`,e=>{let t=Ut(e);t&&s.noteElided(t)}),q.addEventListener(`finished`,e=>{let t=en(e);t&&m&&(h.value=m.elapsedAt(t.finishedAt)),t&&(g.value={...g.value,finishedAt:t.finishedAt}),ie.value=!0,(u.value===`connecting`||u.value===`running`)&&(u.value=`finished`)}),q.addEventListener(`end`,e=>{s.flushPendingTurn(`the run ended here`),s.closePhases(),ie.value=!0,h.value??=m?.elapsedMs(p.value),g.value={...g.value,...Qt(e)},u.value=`ended`,q?.close()}),q.onerror=()=>{q&&q.readyState===2&&(u.value=`disconnected`)}}),d(()=>{q?.close()});function Te(e){return e&&/^https?:\/\//.test(e)?e:``}let Ee=V(()=>Te(c.request?.source?.url)),ke=V(()=>{let e=c.meta;return{repo:Pt(e?.repo),tree:It(e?.repo,e?.ref),commit:Lt(e?.repo,e?.headSha),pr:Ft(e?.repo,e?.pr)}}),Ae=V(()=>qt({meta:c.meta,requestText:c.request?.text??``,prOpened:c.prOpened}));function Y(e){return typeof e==`number`?De(e,p.value):``}function ze(e){return typeof e==`number`?Re(e):void 0}return(e,t)=>{let n=ee,a=we,o=le,d=tt;return W(),k(l,{title:P(r),nav:`runs`},{leading:C(()=>[...t[4]||=[F(`a`,{class:`back text-sm text-primary no-underline hover:underline`,href:`/runs`},`← All runs`,-1)]]),status:C(()=>[F(`span`,Fs,[u.value===`ended`?(W(),H(B,{key:0},[_.value.ok?(W(),H(`span`,Is,`✓`)):(W(),H(`span`,{key:1,class:G([`chip rounded border px-1.5 text-[0.7rem]`,D[_.value.cls]])},K(_.value.word),3)),F(`span`,{id:`state`,class:G([`dur text-xs tabular-nums`,[w.value?`heat`:`text-muted`,S.value.level>=2?`font-medium`:``]]),style:A(w.value),"data-heat":S.value.level},K(x.value),15,Ls),b.value?(W(),H(`span`,Rs,`· `+K(b.value),1)):R(``,!0)],64)):(W(),H(B,{key:1},[F(`span`,{id:`statedot`,class:G([`pulse text-[1.1em] leading-none`,te.value])},`∿`,2),F(`span`,{id:`state`,class:G([`text-xs tabular-nums`,f.value?`text-bad`:`text-muted`]),title:u.value===`running`&&!f.value?`the whole run, since we received the message`:u.value===`finished`?`the agent stopped; the reply is being posted`:void 0},K(j.value),11,zs)],64))])]),actions:C(()=>[ie.value?R(``,!0):(W(),H(`span`,Bs,[L(a,{text:`Soft stop: no new steps, the agent writes up what it has`},{default:C(()=>[L(n,{size:`xs`,color:`neutral`,variant:`outline`,label:`Stop`,disabled:ae.value,onClick:t[0]||=e=>N(`soft`)},null,8,[`disabled`])]),_:1}),L(a,{text:`Hard stop: abort now, no summary, free the sandbox`},{default:C(()=>[L(n,{size:`xs`,color:`error`,variant:`outline`,label:`Kill`,disabled:ae.value,onClick:t[1]||=e=>N(`hard`)},null,8,[`disabled`])]),_:1})]))]),default:C(()=>[F(`div`,Vs,[P(c).meta?(W(),H(`div`,Hs,[F(`span`,Us,K(P(c).meta.agent),1),F(`span`,Ws,K(P(c).meta.model),1),P(c).meta.effort?(W(),H(`span`,Gs,K(P(c).meta.effort)+` effort`,1)):R(``,!0),ke.value.repo?(W(),H(`a`,{key:1,class:`text-primary no-underline hover:underline`,href:ke.value.repo,target:`_blank`,rel:`noopener noreferrer`},K(P(c).meta.repo),9,Ks)):P(c).meta.repo?(W(),H(`span`,qs,K(P(c).meta.repo),1)):R(``,!0),ke.value.tree?(W(),H(`a`,{key:3,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned no-underline hover:border-primary hover:text-primary`,href:ke.value.tree,target:`_blank`,rel:`noopener noreferrer`,title:`the branch on GitHub`},K(P(c).meta.ref),9,Js)):P(c).meta.ref?(W(),H(`span`,Ys,K(P(c).meta.ref),1)):R(``,!0),ke.value.commit&&P(c).meta.headSha?(W(),H(`a`,{key:5,class:`sha tabular-nums text-toned no-underline hover:text-primary hover:underline`,href:ke.value.commit,target:`_blank`,rel:`noopener noreferrer`,title:`the head commit ${P(c).meta.headSha}`},K(P(Rt)(P(c).meta.headSha)),9,Xs)):R(``,!0),ke.value.pr?(W(),H(`a`,{key:6,class:`prlink whitespace-nowrap text-primary no-underline hover:underline`,href:ke.value.pr,target:`_blank`,rel:`noopener noreferrer`},[L(ft,{class:`mr-1 align-[-0.125em]`}),z(`#`+K(P(c).meta.pr),1)],8,Zs)):R(``,!0),P(ye).state.ready?(W(),H(`button`,{key:7,type:`button`,class:`reading-diff ml-auto inline-flex cursor-pointer items-center gap-1 whitespace-nowrap text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"data-testid":`reading-diff-button`,onClick:t[2]||=e=>be.value=!0},[L(o,{name:`i-lucide-git-compare`,class:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[5]||=z(` Reading diff `,-1)])):R(``,!0)])):R(``,!0),P(c).request?(W(),H(`section`,Qs,[F(`h2`,$s,[t[6]||=F(`span`,null,`Request`,-1),P(c).request.source?(W(),H(`span`,ec,[P(c).request.source.channel?(W(),H(B,{key:0},[L(Pe),Ee.value?(W(),H(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:Ee.value,target:`_blank`,rel:`noopener noreferrer`,title:`open the thread`},`#`+K(P(c).request.source.channel),9,tc)):(W(),H(`span`,nc,`#`+K(P(c).request.source.channel),1))],64)):R(``,!0),P(c).request.source.user?(W(),H(`span`,rc,K(P(c).request.source.user),1)):R(``,!0)])):R(``,!0),F(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:ze(P(c).request.at)},K(Y(P(c).request.at)),9,ic)]),L(ot,{lines:3},{default:C(()=>[L(ct,{text:P(c).request.text},null,8,[`text`])]),_:1})])):R(``,!0),P(c).reply&&P(i)?(W(),k(Or,{key:2,position:`first`,text:P(c).reply.text,at:P(c).reply.at,caption:Ae.value,when:Y(P(c).reply.at),"when-title":ze(P(c).reply.at)},null,8,[`text`,`at`,`caption`,`when`,`when-title`])):R(``,!0),P(c).context.length>0?(W(),H(`details`,ac,[F(`summary`,oc,[t[7]||=F(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),t[8]||=F(`span`,null,`Earlier in this thread`,-1),F(`span`,sc,`· `+K(P(c).context.length)+` turn`+K(P(c).context.length===1?``:`s`),1)]),F(`div`,cc,[(W(!0),H(B,null,U(P(c).context,e=>(W(),H(`div`,{key:e.key,class:`turn flex items-baseline gap-3 border-t border-default py-1.5 opacity-85 first-of-type:border-t-0`},[L(ct,{text:e.text},null,8,[`text`]),F(`span`,{class:`ts ml-auto shrink-0 select-none text-xs text-dimmed`,title:ze(e.at)},K(Y(e.at)),9,lc)]))),128))])])):R(``,!0),F(`h2`,uc,[t[9]||=F(`span`,null,`This run`,-1),ge.value>0?(W(),H(`span`,dc,`· `+K(ge.value)+` step`+K(ge.value===1?``:`s`),1)):R(``,!0),F(`button`,{id:`fold`,type:`button`,class:`ml-auto cursor-pointer font-normal normal-case tracking-normal text-dimmed hover:text-toned focus-visible:outline-2 focus-visible:outline-primary`,"aria-pressed":P(c).allOpen?`true`:`false`,"data-open":P(c).allOpen?`1`:`0`,title:P(c).allOpen?`Close every call card`:`Open every call card`,onClick:he},K(P(c).allOpen?`Collapse all`:`Expand all`),9,fc)]),ne.value?(W(),k(Sr,{key:4,vm:ne.value,"events-href":P(re),onReveal:M},null,8,[`vm`,`events-href`])):R(``,!0),F(`ol`,pc,[P(c).placeholder?(W(),H(`li`,mc,`Waiting for activity…`)):R(``,!0),(W(!0),H(B,null,U(P(c).log,e=>(W(),H(B,{key:e.key},[e.kind===`step`?(W(),k(Jn,{key:0,step:e,class:`mt-5 first:mt-0`,onToggleGroup:t=>P(s).toggleGroup(e)},null,8,[`step`,`onToggleGroup`])):e.kind===`turn`?(W(),H(`li`,{key:1,id:`span-${e.turn.spanId}`,class:`turn mt-5 border-l-2 border-(--ui-border-accented)/50 pb-3 pl-3 pt-2`},[F(`div`,gc,[F(`span`,{class:G([`thought`,e.turn.quick?``:`text-warn`]),title:e.turn.label},`thought `+K(e.turn.chip),11,_c),e.turn.switched?(W(),H(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-semibold text-warn`,title:`model changed: this turn ran on ${e.turn.model}`},`⇄ `+K(P(rn)(e.turn.model)),9,vc)):e.turn.showModel?(W(),H(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-semibold leading-normal tracking-wider text-muted`,title:e.turn.model},K(P(rn)(e.turn.model)),9,yc)):R(``,!0),(W(!0),H(B,null,U(e.turn.facts,(e,t)=>(W(),H(`span`,{key:t,class:`fact`},K(e),1))),128)),e.note?(W(),H(`span`,bc,K(e.note),1)):R(``,!0),e.turn.at===void 0?R(``,!0):(W(),H(`span`,{key:3,class:`ts ml-auto select-none`,title:P(Re)(e.turn.at)},K(P(Qe)(e.turn.at)),9,xc))])],8,hc)):e.kind===`span`?(W(),k(er,{key:2,item:e},null,8,[`item`])):e.kind===`phase`?(W(),H(`li`,{key:3,class:`phase py-0.5 text-xs`,"data-phase":e.phase},[F(`button`,{type:`button`,class:`phase-head flex w-full cursor-pointer items-baseline gap-2 text-left text-muted hover:text-toned`,"aria-expanded":e.open,onClick:T(t=>P(s).togglePhase(e),[`prevent`])},[F(`span`,wc,K(e.open?`▾`:`▸`),1),F(`span`,{class:G([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,P(rr)(e.phase)]),"aria-hidden":`true`},null,2),F(`span`,Tc,K(P(Ht)(e)),1)],8,Cc),e.open?(W(),H(`ul`,Ec,[(W(!0),H(B,null,U(e.rows,e=>(W(),k(er,{key:e.key,item:e},null,8,[`item`]))),128))])):R(``,!0)],8,Sc)):e.kind===`followup`?(W(),H(`li`,Dc,[F(`h2`,Oc,[t[10]||=F(`span`,null,`↪ Follow-up`,-1),e.input.source?.user?(W(),H(`span`,kc,[Te(e.input.source.url)?(W(),H(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:e.input.source.url,target:`_blank`,rel:`noopener noreferrer`,title:`open the message`},K(e.input.source.user),9,Ac)):(W(),H(`span`,jc,K(e.input.source.user),1))])):R(``,!0),F(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:ze(e.input.at)},K(Y(e.input.at)),9,Mc)]),L(ct,{text:e.input.text},null,8,[`text`])])):(W(),H(`li`,{key:5,class:G([`note mt-4 flex items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1.5`,e.replay?`text-dimmed`:`bg-warn/10 text-warn`])},[F(`span`,null,K((e.replay?`… `:`⏱ `)+e.text),1),e.at===void 0?R(``,!0):(W(),H(`span`,{key:0,class:`ts ml-auto select-none text-xs text-dimmed`,title:P(Re)(e.at)},K(P(Qe)(e.at)),9,Nc))],2))],64))),128)),ue.value?.kind===`thinking`?(W(),H(`li`,Pc,[t[11]||=F(`span`,{class:`pulse text-[1.1em] leading-none text-info motion-safe:animate-pulse`},`∿`,-1),F(`span`,{class:`badge shrink-0 rounded bg-accented px-1.5 text-[0.68rem] font-semibold leading-normal tracking-wider text-muted`,title:P(c).model??void 0},K(P(rn)(P(c).model)),9,Fc),F(`span`,Ic,K(pe.value)+`…`,1),F(`span`,{class:G([`since ml-auto shrink-0 text-xs tabular-nums`,ue.value.slow?`text-warn`:`text-dimmed`])},K(P(J)(ue.value.elapsedMs,`clock`)),3)])):R(``,!0),F(`li`,{ref_key:`logEnd`,ref:_e,"aria-hidden":`true`},null,512)]),P(c).reply&&!P(i)?(W(),k(Or,{key:5,position:`last`,text:P(c).reply.text,at:P(c).reply.at,caption:Ae.value,when:Y(P(c).reply.at),"when-title":ze(P(c).reply.at)},null,8,[`text`,`at`,`caption`,`when`,`when-title`])):R(``,!0)]),L(d,{open:be.value,"onUpdate:open":t[3]||=e=>be.value=e,title:P($r)(P(ye).state),ui:{content:`w-[min(96vw,90rem)] max-w-none`}},{content:C(({close:e})=>[L(Ps,{data:P(ye).state,abridge:P(xe),closable:``,style:{"--pr-review-ins":`var(--sb-ok)`,"--pr-review-del":`var(--sb-bad)`},onClose:t=>e()},null,8,[`data`,`abridge`,`onClose`])]),_:1},8,[`open`,`title`])]),_:1},8,[`title`])}}}),Rc=N({__name:`RunRoutePage`,setup(e){let t=h(he,null);return(e,n)=>!P(t)||P(t).page===`runNotFound`?(W(),k(Te,{key:0})):(W(),k(Lc,{key:1}))}});export{Rc as default};
|
|
126
|
+
`+n),r.b(`</div>`),r.fl()},partials:{},subs:{}}),$[`tag-file-added`]=new Q.Template({code:function(e,t,n){var r=this;return r.b(n||=``),r.b(`<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>`),r.fl()},partials:{},subs:{}}),$[`tag-file-changed`]=new Q.Template({code:function(e,t,n){var r=this;return r.b(n||=``),r.b(`<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>`),r.fl()},partials:{},subs:{}}),$[`tag-file-deleted`]=new Q.Template({code:function(e,t,n){var r=this;return r.b(n||=``),r.b(`<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>`),r.fl()},partials:{},subs:{}}),$[`tag-file-renamed`]=new Q.Template({code:function(e,t,n){var r=this;return r.b(n||=``),r.b(`<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>`),r.fl()},partials:{},subs:{}});var Ua=class{constructor({compiledTemplates:e={},rawTemplates:t={}}){let n=Object.entries(t).reduce((e,[t,n])=>{let r=Q.compile(n,{asString:!1});return Object.assign(Object.assign({},e),{[t]:r})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},$),e),n)}static compile(e){return Q.compile(e,{asString:!1})}render(e,t,n,r,i){let a=this.templateKey(e,t);try{return this.preCompiledTemplates[a].render(n,r,i)}catch{throw Error(`Could not find template to render '${a}'`)}}template(e,t){return this.preCompiledTemplates[this.templateKey(e,t)]}templateKey(e,t){return`${e}-${t}`}},Wa=Object.assign(Object.assign(Object.assign({},ka),Fa),{outputFormat:xi.LINE_BY_LINE,drawFileList:!0});function Ga(e,t={}){return Ii(e,Object.assign(Object.assign({},Wa),t))}function Ka(e,t={}){let n=Object.assign(Object.assign({},Wa),t),r=typeof e==`string`?Ii(e,n):e,i=new Ua(n),{colorScheme:a}=n,o={colorScheme:a};return(n.drawFileList?new Oa(i,o).render(r):``)+(n.outputFormat===`side-by-side`?new Ba(i,n).render(r):new Pa(i,n).render(r))}function qa(e){return e.isNew?`added`:e.isDeleted?`deleted`:e.isRename||e.isCopy?`renamed`:`modified`}function Ja(e){return qa(e)===`deleted`?e.oldName:e.newName}function Ya(e){return Ga(e).map(e=>{let t=qa(e);return{path:Ja(e),...t===`renamed`&&e.oldName!==e.newName?{from:e.oldName}:{},status:t,added:e.addedLines,deleted:e.deletedLines,binary:e.isBinary===!0,html:Ka([e],{drawFileList:!1,outputFormat:`line-by-line`,matching:`lines`})}})}function Xa(e){return Ga(e).length}function Za(e){return Ga(e).map(Ja)}function Qa(e){let t=e.lastIndexOf(`/`);return t<0?{dir:``,name:e}:{dir:e.slice(0,t+1),name:e.slice(t+1)}}function $a(e,t,n){if(e.length===0)return-1;if(n)return e.length-1;let r=0;for(let n=0;n<e.length;n++)e[n]<=t+2&&(r=n);return r}function eo(e,t,n){let r=Math.min(t,n),i=Math.max(t,n),a=-1,o=-1;return e.forEach((e,t)=>{e===null||e<r||e>i||(a<0&&(a=t),o=t)}),a<0?[]:Array.from({length:o-a+1},(e,t)=>a+t)}function to(e){return e.from===e.to?`${e.path}:${e.from}`:`${e.path}:${e.from}–${e.to}`}function no(e,t){return!e.sha||!t?!1:!t.startsWith(e.sha)&&!e.sha.startsWith(t)}function ro(e,t){return`anchored at ${e.slice(0,7)}, the review is at ${t.slice(0,7)}; lines may have moved`}function io(e){if(!(e.origin!==`parsed`||e.complete))return e.tour.length===0?`description read from the PR body; no Tour`:`description read from the PR body`}function ao(e,t,n,r=!1){return t.has(e)?`shown`:n.has(e)?`full`:r?`beyond`:`absent`}function oo(e,t,n){return e===`full`?`not in the reading diff · open full diff`:e===`beyond`?t?`beyond the recorded diff · open on GitHub ↗`:`beyond the recorded diff`:e===`absent`?`not in this diff`:n?`lines not in this diff`:void 0}function so(e){return e.description?`${e.title} — ${e.description}`:e.title}var co={key:0,class:`description border-b border-default px-3 py-2`,"data-testid":`pr-description`},lo={key:0,class:`m-0 whitespace-pre-line leading-snug`,"data-testid":`description-tldr`},uo={class:`m-0 mt-0.5 whitespace-pre-line leading-snug`,"data-testid":`description-what-why`},fo={key:0,class:`m-0 mt-1.5 font-sans text-[0.7rem] italic text-dimmed`,"data-testid":`description-origin`},po=N({__name:`DescriptionBlock`,props:{description:{}},setup(e){let t=e,n=V(()=>io(t.description));return(t,r)=>e.description.tldr||e.description.whatWhy||n.value?(W(),H(`section`,co,[r[1]||=F(`h3`,{class:`m-0 mb-1 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},`Description`,-1),L(ot,{lines:5,class:`font-sans text-[0.8rem] text-default`,style:{"--expandable-surface":`var(--ui-bg)`}},{default:C(()=>[e.description.tldr?(W(),H(`p`,lo,K(e.description.tldr),1)):R(``,!0),e.description.whatWhy?(W(),H(B,{key:1},[r[0]||=F(`h4`,{class:`m-0 mt-2 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},`What & why`,-1),F(`p`,uo,K(e.description.whatWhy),1)],64)):R(``,!0)]),_:1}),n.value?(W(),H(`p`,fo,K(n.value),1)):R(``,!0)])):R(``,!0)}}),mo={class:`file-list flex flex-col pb-24 text-xs`,"aria-label":`Files changed`,"data-testid":`file-list`},ho={class:`files`},go={class:`sticky top-0 z-10 flex items-baseline gap-1.5 border-b border-default bg-default px-3 py-1.5 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},_o={class:`tabular-nums text-dimmed`},vo={class:`m-0 list-none p-0`},yo=[`aria-current`,`title`,`onClick`],bo={class:`path min-w-0 flex-1 truncate font-mono`,dir:`rtl`},xo={class:`text-dimmed`},So={class:`counts inline-flex shrink-0 gap-1 font-mono tabular-nums`},Co={key:0,class:`text-dimmed`},wo={class:`text-ins`},To={class:`text-del`},Eo=[`title`],Do=[`checked`,`aria-label`,`onChange`],Oo=N({__name:`FileList`,props:{files:{},current:{},viewed:{}},emits:[`select`,`toggle-viewed`],setup(e,{emit:t}){let n=t,r={added:`i-lucide-file-plus`,deleted:`i-lucide-file-minus`,renamed:`i-lucide-file-symlink`,modified:`i-lucide-file-pen`},i={added:`text-ins`,deleted:`text-del`,renamed:`text-muted`,modified:`text-muted`};return(t,a)=>{let o=le;return W(),H(`nav`,mo,[j(t.$slots,`description`),j(t.$slots,`tour`),F(`section`,ho,[F(`h3`,go,[a[0]||=z(` Files `,-1),F(`span`,_o,K(e.files.length),1)]),F(`ol`,vo,[(W(!0),H(B,null,U(e.files,t=>(W(),H(`li`,{key:t.path,class:`border-b border-muted`},[F(`div`,{class:G([`entry flex items-center gap-1.5 px-2 py-1 hover:bg-muted`,[t.path===e.current?`is-current bg-accented`:``,e.viewed.has(t.path)?`is-viewed`:``]])},[F(`button`,{type:`button`,class:G([`flex min-w-0 flex-1 items-center gap-1.5 text-left`,e.viewed.has(t.path)?`text-dimmed`:`text-default`]),"aria-current":t.path===e.current?`true`:void 0,title:t.from?`${t.from} → ${t.path}`:t.path,"data-testid":`file-entry`,onClick:e=>n(`select`,t.path)},[L(o,{name:r[t.status],class:G([`size-3.5 shrink-0`,i[t.status]])},null,8,[`name`,`class`]),F(`span`,bo,[F(`bdi`,null,[F(`span`,xo,K(P(Qa)(t.path).dir),1),F(`span`,{class:G(e.viewed.has(t.path)?``:`text-highlighted`)},K(P(Qa)(t.path).name),3)])]),F(`span`,So,[t.binary?(W(),H(`span`,Co,`bin`)):(W(),H(B,{key:1},[F(`span`,wo,`+`+K(t.added),1),F(`span`,To,`−`+K(t.deleted),1)],64))])],10,yo),F(`label`,{class:`viewed-toggle flex shrink-0 cursor-pointer items-center`,title:e.viewed.has(t.path)?`Mark as not viewed`:`Mark as viewed`},[F(`input`,{type:`checkbox`,class:`sr-only`,checked:e.viewed.has(t.path),"aria-label":`Viewed: ${t.path}`,"data-testid":`file-entry-viewed`,onChange:e=>n(`toggle-viewed`,t.path)},null,40,Do),L(o,{name:e.viewed.has(t.path)?`i-lucide-square-check`:`i-lucide-square`,class:G([`size-3.5`,e.viewed.has(t.path)?`text-ins`:`text-dimmed`])},null,8,[`name`,`class`])],8,Eo)],2)]))),128))])])])}}}),ko=N({__name:`LabelTip`,props:{text:{},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>{let r=we;return W(),k(r,{text:e.text,disabled:e.disabled,"delay-duration":250,content:{side:`bottom`,align:`end`,sideOffset:6,collisionPadding:8},ui:{content:`h-auto max-w-[28rem] px-2.5 py-1.5`,text:`text-clip whitespace-normal leading-snug`}},{default:C(()=>[j(t.$slots,`default`)]),_:3},8,[`text`,`disabled`])}}}),Ao={key:0,class:`lede border-b border-default px-4 py-3`,"data-testid":`diff-lede`},jo={class:`m-0 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},Mo={class:`m-0 mt-1 max-w-[80ch] font-sans text-sm leading-normal text-default`,"data-testid":`diff-summary`},No={key:1,class:`px-4 py-6 text-sm text-muted`,"data-testid":`no-files`},Po=[`data-path`],Fo={class:`file-head sticky top-0 z-10 flex h-8 items-center gap-2 border-b border-default bg-elevated px-2 text-xs`},Io=[`aria-expanded`,`aria-label`,`onClick`],Lo=[`title`],Ro={class:`text-muted`},zo={key:0,class:`shrink-0 rounded bg-accented px-1.5 text-[0.68rem] leading-normal text-muted`},Bo={key:1,class:`counts inline-flex shrink-0 gap-1 font-mono tabular-nums`},Vo={class:`text-ins`},Ho={class:`text-del`},Uo={class:`viewed flex shrink-0 cursor-pointer select-none items-center gap-1.5 pl-2 text-muted`},Wo=[`checked`,`onChange`],Go=[`innerHTML`],Ko={key:2,class:`footer px-4 pb-24 pt-4 text-center font-sans text-[0.68rem] font-semibold uppercase tracking-wider text-muted`,"data-testid":`diff-end`},qo={class:`text-ins`},Jo={class:`text-del`},Yo=`is-focus`,Xo=.3,Zo=N({__name:`ReadingDiffView`,props:{diff:{},files:{},current:{},viewed:{},wrap:{type:Boolean},fullFileCount:{}},emits:[`reached`,`toggle-viewed`],setup(e,{expose:t,emit:n}){let r=e,i=V(()=>({added:r.files.reduce((e,t)=>e+t.added,0),deleted:r.files.reduce((e,t)=>e+t.deleted,0)})),a=n,o={added:`i-lucide-file-plus`,deleted:`i-lucide-file-minus`,renamed:`i-lucide-file-symlink`,modified:`i-lucide-file-pen`},s=O(null),c=new Map;function l(e,t){t instanceof HTMLElement?c.set(e,t):c.delete(e)}let u=pe(new Map);function d(e){return u.get(e)??!r.viewed.has(e)}function f(e){u.set(e,!d(e))}function p(e){u.delete(e),a(`toggle-viewed`,e)}I(()=>r.diff,()=>u.clear());function m(){let e=s.value;if(!e)return;let t=r.files.map(e=>c.get(e.path)).filter(e=>e!==void 0),n=t.map(e=>e.offsetTop),i=e.scrollTop+e.clientHeight>=e.scrollHeight-2,o=t[$a(n,e.scrollTop,i)]?.dataset.path;o!==void 0&&o!==r.current&&a(`reached`,o)}E(()=>s.value?.addEventListener(`scroll`,m,{passive:!0})),g(()=>s.value?.removeEventListener(`scroll`,m));function h(e){let t=s.value,n=c.get(e);return!t||!n?!1:(t.scrollTo({top:n.offsetTop}),!0)}let _=[];function b(){for(let e of _)e.classList.remove(Yo);_=[]}async function x(e,t,n){let r=s.value,i=c.get(e);if(!r||!i)return!1;let a=Array.from(i.querySelectorAll(`tr`)),o=eo(a.map(e=>{let t=Number.parseInt(e.querySelector(`.line-num2`)?.textContent?.trim()??``,10);return Number.isFinite(t)?t:null}),t,n);if(o.length===0)return!1;b(),_=o.map(e=>a[e]);for(let e of _)e.classList.add(Yo);d(e)||(u.set(e,!0),await v());let l=_[0],f=i.querySelector(`header`)?.getBoundingClientRect().height??0,p=Math.max(f+24,Math.round(r.clientHeight*Xo)),m=l.getBoundingClientRect().top-r.getBoundingClientRect().top+r.scrollTop-p;return r.scrollTo({top:Math.max(0,m)}),!0}return t({scrollTo:x,scrollToFile:h}),(t,n)=>{let r=le;return W(),H(`div`,{ref_key:`container`,ref:s,class:G([`reading-diff d2h-host relative min-w-0 overflow-y-auto overflow-x-hidden`,{wrap:e.wrap}]),"data-testid":`reading-diff`},[e.diff.summary?(W(),H(`section`,Ao,[F(`h3`,jo,` Summary · `+K(e.diff.poweredBy),1),F(`p`,Mo,K(e.diff.summary),1)])):R(``,!0),e.files.length===0?(W(),H(`p`,No,` Nothing in this diff parsed as a file. `)):R(``,!0),(W(!0),H(B,null,U(e.files,t=>(W(),H(`section`,{key:t.path,ref_for:!0,ref:e=>l(t.path,e),"data-path":t.path,class:G([`file border-b border-default`,{"is-viewed":e.viewed.has(t.path)}]),"data-testid":`diff-file`},[F(`header`,Fo,[F(`button`,{type:`button`,class:`flex size-5 shrink-0 items-center justify-center rounded text-dimmed hover:bg-accented hover:text-default`,"aria-expanded":d(t.path),"aria-label":d(t.path)?`Collapse file`:`Expand file`,"data-testid":`file-collapse`,onClick:e=>f(t.path)},[L(r,{name:d(t.path)?`i-lucide-chevron-down`:`i-lucide-chevron-right`,class:`size-3.5`},null,8,[`name`])],8,Io),L(r,{name:o[t.status],class:G([`size-3.5 shrink-0`,t.status===`added`?`text-ins`:t.status===`deleted`?`text-del`:`text-muted`])},null,8,[`name`,`class`]),F(`span`,{class:`path min-w-0 flex-1 truncate font-mono text-highlighted`,title:t.from?`${t.from} → ${t.path}`:t.path},[t.from?(W(),H(B,{key:0},[F(`span`,Ro,K(t.from),1),n[0]||=z(` → `,-1)],64)):R(``,!0),z(K(t.path),1)],8,Lo),t.binary?(W(),H(`span`,zo,`binary`)):(W(),H(`span`,Bo,[F(`span`,Vo,`+`+K(t.added),1),F(`span`,Ho,`−`+K(t.deleted),1)])),F(`label`,Uo,[F(`input`,{type:`checkbox`,class:`size-3.5 cursor-pointer accent-(--pr-review-ins)`,checked:e.viewed.has(t.path),"data-testid":`file-viewed`,onChange:e=>p(t.path)},null,40,Wo),n[1]||=z(` Viewed `,-1)])]),y(F(`div`,{class:`file-body`,"data-testid":`file-body`,innerHTML:t.html},null,8,Go),[[Ce,d(t.path)]])],10,Po))),128)),e.files.length>0?(W(),H(`footer`,Ko,[e.fullFileCount===void 0?(W(),H(B,{key:1},[z(` End of diff · `+K(e.files.length)+` `+K(e.files.length===1?`file`:`files`)+` · `,1),F(`span`,qo,`+`+K(i.value.added),1),n[2]||=z(),F(`span`,Jo,`−`+K(i.value.deleted),1)],64)):(W(),H(B,{key:0},[z(` End of reading diff · `+K(e.files.length)+` of `+K(e.fullFileCount)+` files shown `,1)],64))])):R(``,!0)],2)}}}),Qo={class:`m-0 flex items-baseline gap-1.5 border-b border-muted px-3 py-1.5 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},$o={class:`normal-case tracking-normal text-dimmed`},es={class:`m-0 list-none p-0`},ts={class:`flex min-w-0 flex-1 flex-col gap-0.5 font-sans text-[0.8rem]`},ns={key:0,class:`step-description line-clamp-2 leading-snug text-muted`},rs={key:0,class:`step-look-for leading-snug text-muted`},is={class:`flex min-w-0 items-baseline gap-x-2`},as=[`aria-label`],os={key:1,class:`text-[0.7rem] italic leading-snug text-dimmed`,"data-testid":`tour-step-note`},ss={key:1,class:`px-3 py-1.5`,"data-testid":`tour-remaining`},cs={class:`m-0 flex list-none flex-col gap-0.5 p-0`},ls={class:`font-sans text-[0.8rem] text-muted`},us=N({__name:`TourList`,props:{steps:{},remaining:{},shownPaths:{},fullPaths:{},fullTruncated:{type:Boolean},pr:{},reviewedSha:{},active:{},missed:{}},emits:[`jump`,`open`],setup(e,{emit:t}){let n=e,r=t,i=V(()=>n.steps.map(e=>ao(e.anchor.path,n.shownPaths,n.fullPaths,n.fullTruncated))),a=V(()=>n.steps.map((e,t)=>i.value[t]===`beyond`?ri(n.pr,e.anchor):void 0));function o(e){return oo(i.value[e],a.value[e]!==void 0,n.missed===e)}function s(e){let t=i.value[e];return t===`shown`||t===`full`||a.value[e]!==void 0}function c(e){(i.value[e]===`shown`||i.value[e]===`full`)&&r(`jump`,e)}function l(e){let{sha:t}=e.anchor;return t&&n.reviewedSha&&no(e.anchor,n.reviewedSha)?ro(t,n.reviewedSha):void 0}function u(e){return n.shownPaths.has(e)||n.fullPaths.has(e)}function d(e){return!u(e)&&n.fullTruncated?ri(n.pr,{path:e}):void 0}function f(e){return u(e)?e:d(e)?`${e} — beyond the recorded diff · open on GitHub`:`${e} — not in this diff`}let p=O(null),m=new Map,h=new Map;function _(e,t,n){n instanceof HTMLElement?e.set(t,n):e.delete(t)}let y=O(new Set),b=e=>e.scrollHeight>e.clientHeight+1;function x(){let e=new Set;for(let[t,n]of m)Array.from(n.querySelectorAll(`.step-title, .step-description`)).some(b)&&e.add(`prose:${t}`);for(let[t,n]of h)n.scrollWidth>n.clientWidth+1&&e.add(`anchor:${t}`);y.value=e}let S=null;E(()=>{x(),typeof ResizeObserver<`u`&&p.value&&(S=new ResizeObserver(()=>x()),S.observe(p.value))}),g(()=>S?.disconnect()),I(()=>n.steps,()=>void v(x),{deep:!0});function w(e){let t=n.steps[e];return[y.value.has(`prose:${e}`)?so(t):void 0,y.value.has(`anchor:${e}`)?to(t.anchor):void 0,l(t)].filter(e=>e!==void 0).join(` · `)}return(t,n)=>{let g=le;return W(),H(`section`,{ref_key:`root`,ref:p,class:`tour border-b border-default text-xs`,"data-testid":`tour`},[e.steps.length>0?(W(),H(B,{key:0},[F(`h3`,Qo,[n[0]||=z(` Tour `,-1),F(`span`,$o,`· `+K(e.steps.length)+` `+K(e.steps.length===1?`step`:`steps`),1)]),F(`ol`,es,[(W(!0),H(B,null,U(e.steps,(t,r)=>(W(),H(`li`,{key:r,class:`border-b border-muted`},[L(ko,{text:w(r),disabled:w(r)===``},{default:C(()=>[(W(),k(re(a.value[r]?`a`:`button`),{type:a.value[r]?void 0:`button`,href:a.value[r],target:a.value[r]?`_blank`:void 0,rel:a.value[r]?`noopener noreferrer`:void 0,class:G([`step flex w-full gap-2 px-3 py-1.5 text-left no-underline transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary motion-reduce:transition-none`,[e.active===r?`is-active`:`hover:bg-muted`,s(r)?`text-default`:`is-muted text-dimmed`,a.value[r]?`is-beyond`:``]]),"data-placement":i.value[r],"aria-current":e.active===r?`step`:void 0,"data-testid":`tour-step`,onClick:e=>c(r)},{default:C(()=>[F(`span`,{class:G([`step-number mt-px flex size-4 shrink-0 items-center justify-center rounded-full text-[0.65rem] font-semibold tabular-nums`,e.active===r?`bg-(--pr-review-mark) text-inverted`:`bg-accented text-muted`])},K(r+1),3),F(`span`,ts,[F(`span`,{ref_for:!0,ref:e=>_(P(m),r,e),class:`step-prose flex min-w-0 flex-col gap-0.5`,"data-testid":`tour-step-prose`},[F(`span`,{class:G([`step-title line-clamp-2 min-w-0 font-medium leading-snug`,s(r)?`text-highlighted`:``])},K(t.title),3),t.description?(W(),H(`span`,ns,K(t.description),1)):R(``,!0)],512),t.lookFor?(W(),H(`span`,rs,[n[1]||=F(`span`,{class:`font-medium text-default`},`Look for:`,-1),z(` `+K(t.lookFor),1)])):R(``,!0),F(`span`,is,[F(`span`,{ref_for:!0,ref:e=>_(P(h),r,e),class:`step-anchor min-w-0 shrink truncate font-mono text-[0.7rem] text-dimmed`,dir:`rtl`},[F(`bdi`,null,K(P(to)(t.anchor)),1)],512),l(t)?(W(),H(`span`,{key:0,class:`inline-flex shrink-0 items-center self-center rounded bg-warning/15 px-1 text-warning`,"aria-label":l(t),"data-testid":`tour-step-stale`},[L(g,{name:`i-lucide-triangle-alert`,class:`size-3`})],8,as)):R(``,!0)]),o(r)?(W(),H(`span`,os,K(o(r)),1)):R(``,!0)])]),_:2},1032,[`type`,`href`,`target`,`rel`,`class`,`data-placement`,`aria-current`,`onClick`]))]),_:2},1032,[`text`,`disabled`])]))),128))])],64)):R(``,!0),e.remaining.length>0?(W(),H(`div`,ss,[n[2]||=F(`h4`,{class:`m-0 mb-1 text-[0.68rem] font-semibold uppercase tracking-wider text-muted`},`Remaining changes`,-1),F(`ul`,cs,[(W(!0),H(B,null,U(e.remaining,e=>(W(),H(`li`,{key:e.path,class:`min-w-0 leading-snug`,"data-testid":`tour-remaining-entry`},[(W(),k(re(d(e.path)?`a`:`button`),{type:d(e.path)?void 0:`button`,href:d(e.path),target:d(e.path)?`_blank`:void 0,rel:d(e.path)?`noopener noreferrer`:void 0,class:G([`font-mono text-[0.7rem] no-underline hover:underline focus-visible:outline-2 focus-visible:outline-primary`,u(e.path)||d(e.path)?`text-default`:`is-muted text-dimmed`]),title:f(e.path),onClick:t=>u(e.path)?r(`open`,e.path):void 0},{default:C(()=>[z(K(e.path),1)]),_:2},1032,[`type`,`href`,`target`,`rel`,`class`,`title`,`onClick`])),F(`span`,ls,` — `+K(e.note),1)]))),128))])])):R(``,!0)],512)}}}),ds={class:`pr-review-panel flex h-full min-h-0 min-w-0 flex-col`,"data-testid":`pr-review-panel`},fs={class:`header flex shrink-0 flex-col gap-1 border-b border-default px-4 py-2.5`},ps={class:`flex items-center gap-2`},ms={class:`m-0 min-w-0 flex-1 truncate text-sm font-semibold text-highlighted`,"data-testid":`pr-title`},hs=[`href`],gs={key:0,class:`flex shrink-0 gap-0.5 rounded-md bg-accented p-0.5`,role:`tablist`,"aria-label":`Diff producer`,"data-testid":`diff-tabs`},_s=[`aria-selected`,`onClick`],vs={key:1,class:`inline-flex shrink-0 items-center gap-1.5 text-xs text-muted`,"data-testid":`abridge-running`},ys={key:2,class:`inline-flex min-w-0 shrink items-center gap-1.5 text-xs text-error`,"data-testid":`abridge-failed`},bs=[`title`],xs={class:`facts flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted`,"data-testid":`pr-facts`},Ss=[`href`],Cs={key:1,class:`font-medium`},ws=[`href`],Ts={title:`the base the diff is against`},Es={class:`inline-flex gap-1 tabular-nums`,"data-testid":`pr-totals`},Ds={class:`text-ins`},Os={class:`text-del`},ks=[`href`],As={key:0,class:`body flex min-h-0 flex-1`},js={class:`hidden w-[19rem] shrink-0 overflow-y-auto border-r border-default md:block`},Ms={key:1,class:`px-4 py-3 text-sm text-muted`,"data-testid":`no-diff`},Ns=`Abridge the full diff with meat.dev: a model keeps the concepts and drops what a reviewer need not read. One model call; usually a minute or three.`,Ps=N({__name:`PrReviewPanel`,props:{data:{},closable:{type:Boolean,default:!1},abridge:{default:void 0}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=V(()=>ni(n.data.pr)),a=V(()=>$r(n.data)),o=V(()=>n.data.readingDiffs),s=V(()=>n.data.description),c=V(()=>[o.value.find(e=>e.poweredBy===`meat`),o.value.find(e=>e.poweredBy===`git`)].filter(e=>e!==void 0)),l=O(0);I(()=>ii(o.value),()=>l.value=0);let u=V(()=>c.value[l.value]??c.value[0]??null),d=V(()=>u.value?Ya(u.value.diff):[]),f=V(()=>c.value.findIndex(e=>e.poweredBy===`git`)),p=V(()=>{let e=c.value[f.value];return u.value?.poweredBy===`meat`&&e?Xa(e.diff):void 0}),m=V(()=>({added:d.value.reduce((e,t)=>e+t.added,0),deleted:d.value.reduce((e,t)=>e+t.deleted,0)})),h=V(()=>n.data.pr.headSha?.slice(0,7)),g=V(()=>n.abridge!==void 0&&n.abridge.state.state!==`done`&&c.value.length===1&&u.value?.poweredBy===`git`),_=pe(new Set);function y(e){_.has(e)?_.delete(e):_.add(e)}let b=O(null);I(d,e=>b.value=e[0]?.path??null,{immediate:!0});let x=O(null);function S(e){b.value=e,x.value?.scrollToFile(e)}let w=V(()=>new Set(d.value.map(e=>e.path))),T=V(()=>{let e=c.value[f.value];return e?new Set(Za(e.diff)):w.value}),E=V(()=>(c.value[f.value]??u.value)?.truncated===!0),D=O(null),A=O(null);I(s,()=>{D.value=null,A.value=null});async function te(e){return w.value.has(e)?!0:f.value<0||!T.value.has(e)?!1:(l.value=f.value,await v(),!0)}async function ne(e){let t=s.value?.tour[e];if(!t||!await te(t.anchor.path))return;let{path:n,from:r,to:i}=t.anchor;D.value=e,b.value=n;let a=await x.value?.scrollTo(n,r,i)??!1;!a&&l.value!==f.value&&f.value>=0&&(l.value=f.value,await v(),b.value=n,a=await x.value?.scrollTo(n,r,i)??!1),A.value=a?null:e,a||x.value?.scrollToFile(n)}async function re(e){await te(e)&&S(e)}let M=O(!1);return(t,n)=>{let o=ee,f=le,v=bi;return W(),H(`div`,ds,[F(`header`,fs,[F(`div`,ps,[F(`h2`,ms,[i.value.pr?(W(),H(`a`,{key:0,href:i.value.pr,target:`_blank`,rel:`noopener noreferrer`,class:`hover:underline`},K(a.value),9,hs)):(W(),H(B,{key:1},[z(K(a.value),1)],64))]),c.value.length>1?(W(),H(`div`,gs,[(W(!0),H(B,null,U(c.value,(e,t)=>(W(),k(ko,{key:e.poweredBy,text:P(ai)(e.poweredBy)},{default:C(()=>[F(`button`,{type:`button`,role:`tab`,class:G([`rounded px-2 py-0.5 text-xs leading-normal transition-colors motion-reduce:transition-none`,t===l.value?`bg-default font-semibold text-highlighted shadow-sm ring-1 ring-default`:`font-medium text-muted hover:bg-default/60 hover:text-default`]),"aria-selected":t===l.value,onClick:e=>l.value=t},K(e.poweredBy===`meat`?`Reading diff`:`Full diff`),11,_s)]),_:2},1032,[`text`]))),128))])):g.value&&e.abridge?(W(),H(B,{key:1},[e.abridge.state.state===`absent`?(W(),k(ko,{key:0,text:Ns},{default:C(()=>[L(o,{size:`xs`,color:`neutral`,variant:`outline`,icon:`i-lucide-scissors`,label:`Abridge with meat`,"data-testid":`abridge-button`,onClick:n[0]||=t=>e.abridge.start()})]),_:1})):e.abridge.state.state===`running`?(W(),H(`span`,vs,[L(f,{name:`i-lucide-loader-circle`,class:`size-3.5 animate-spin`}),n[5]||=z(` Abridging… usually 1–3 minutes `,-1)])):e.abridge.state.state===`failed`?(W(),H(`span`,ys,[L(f,{name:`i-lucide-circle-alert`,class:`size-3.5 shrink-0`}),F(`span`,{class:`truncate`,title:e.abridge.state.reason},`Abridging failed: `+K(e.abridge.state.reason),9,bs),L(o,{size:`xs`,color:`neutral`,variant:`outline`,label:`Retry`,"data-testid":`abridge-retry`,onClick:n[1]||=t=>e.abridge.start()})])):R(``,!0)],64)):R(``,!0),u.value?(W(),k(o,{key:2,size:`xs`,color:`neutral`,variant:M.value?`soft`:`ghost`,icon:`i-lucide-wrap-text`,"aria-pressed":M.value,"aria-label":`Wrap long lines`,title:`Wrap long lines`,"data-testid":`wrap-toggle`,onClick:n[2]||=e=>M.value=!M.value},null,8,[`variant`,`aria-pressed`])):R(``,!0),e.closable?(W(),k(o,{key:3,size:`xs`,color:`neutral`,variant:`ghost`,icon:`i-lucide-x`,"aria-label":`Close`,"data-testid":`panel-close`,onClick:n[3]||=e=>r(`close`)})):R(``,!0)]),F(`div`,xs,[i.value.pr?(W(),H(`a`,{key:0,href:i.value.pr,target:`_blank`,rel:`noopener noreferrer`,class:`font-medium text-primary hover:underline`,"data-testid":`pr-link`},K(e.data.pr.repo)+`#`+K(e.data.pr.number),9,Ss)):e.data.pr.repo?(W(),H(`span`,Cs,K(e.data.pr.repo),1)):R(``,!0),i.value.commit?(W(),H(B,{key:2},[n[6]||=F(`span`,{"aria-hidden":`true`},`·`,-1),F(`a`,{href:i.value.commit,target:`_blank`,rel:`noopener noreferrer`,class:`font-mono hover:underline`,"data-testid":`commit-link`},K(h.value),9,ws)],64)):R(``,!0),u.value?(W(),H(B,{key:3},[n[7]||=F(`span`,{"aria-hidden":`true`},`·`,-1),F(`span`,Ts,`against origin/`+K(u.value.baseRef),1),n[8]||=F(`span`,{"aria-hidden":`true`},`·`,-1),F(`span`,Es,[F(`span`,null,K(d.value.length)+` `+K(d.value.length===1?`file`:`files`)+`,`,1),F(`span`,Ds,`+`+K(m.value.added),1),F(`span`,Os,`−`+K(m.value.deleted),1)]),n[9]||=F(`span`,{"aria-hidden":`true`},`·`,-1),L(ko,{text:P(ai)(u.value.poweredBy)},{default:C(()=>[L(v,{color:u.value.poweredBy===`meat`?`primary`:`neutral`,variant:`subtle`,size:`sm`,label:P(si)(u.value.poweredBy),"data-testid":`producer-badge`},null,8,[`color`,`label`])]),_:1},8,[`text`]),u.value.truncated?(W(),k(ko,{key:0,text:P(oi)(u.value.diff.length)},{default:C(()=>[L(v,{color:`warning`,variant:`subtle`,size:`sm`,label:`truncated`,"data-testid":`truncated-badge`})]),_:1},8,[`text`])):R(``,!0)],64)):R(``,!0),i.value.files?(W(),H(B,{key:4},[n[10]||=F(`span`,{"aria-hidden":`true`},`·`,-1),F(`a`,{href:i.value.files,target:`_blank`,rel:`noopener noreferrer`,class:`hover:underline`,"data-testid":`files-link`},` all files on GitHub ↗ `,8,ks)],64)):R(``,!0)])]),u.value?(W(),H(`div`,As,[F(`aside`,js,[L(Oo,{files:d.value,current:b.value,viewed:_,onSelect:S,onToggleViewed:y},{description:C(()=>[j(t.$slots,`description`,{},()=>[s.value?(W(),k(po,{key:0,description:s.value},null,8,[`description`])):R(``,!0)])]),tour:C(()=>[j(t.$slots,`tour`,{},()=>[s.value&&(s.value.tour.length>0||s.value.remaining.length>0)?(W(),k(us,{key:0,steps:s.value.tour,remaining:s.value.remaining,"shown-paths":w.value,"full-paths":T.value,"full-truncated":E.value,pr:e.data.pr,"reviewed-sha":e.data.pr.headSha??s.value.headSha,active:D.value,missed:A.value,onJump:ne,onOpen:re},null,8,[`steps`,`remaining`,`shown-paths`,`full-paths`,`full-truncated`,`pr`,`reviewed-sha`,`active`,`missed`])):R(``,!0)])]),_:3},8,[`files`,`current`,`viewed`])]),L(Zo,{ref_key:`view`,ref:x,class:`flex-1`,diff:u.value,files:d.value,current:b.value,viewed:_,wrap:M.value,"full-file-count":p.value,onReached:n[4]||=e=>b.value=e,onToggleViewed:y},null,8,[`diff`,`files`,`current`,`viewed`,`wrap`,`full-file-count`])])):(W(),H(`p`,Ms,` No reading diff was produced for this review. `))])}}}),Fs={class:`conn flex items-center gap-2`},Is={key:0,class:`ok text-ok`,role:`img`,"aria-label":`succeeded`},Ls=[`data-heat`],Rs={key:2,id:`delivery`,class:`text-xs text-muted`},zs=[`title`],Bs={key:0,id:`actions`,class:`actions flex gap-1.5`},Vs={class:`mx-auto max-w-6xl`},Hs={key:0,id:`runmeta`,class:`runmeta facts mb-3 flex flex-wrap items-baseline gap-x-3 gap-y-1.5 px-(--sb-gutter) text-xs text-dimmed`},Us={class:`agent text-[0.68rem] font-semibold uppercase tracking-wider text-toned`},Ws={class:`model`},Gs={key:0,class:`effort`},Ks=[`href`],qs={key:2,class:`repo`},Js=[`href`],Ys={key:4,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned`},Xs=[`href`,`title`],Zs=[`href`],Qs={key:1,id:`request`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},$s={class:`mb-2 flex items-baseline gap-2.5 text-xs font-semibold uppercase tracking-wider text-muted`},ec={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},tc=[`href`],nc={key:1},rc={key:1},ic=[`title`],ac={key:3,id:`context`,class:`group mb-4 px-(--sb-gutter)`},oc={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 text-xs font-semibold uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},sc={class:`count font-normal normal-case tracking-normal text-dimmed`},cc={id:`contextturns`,class:`pb-1 pl-5`},lc=[`title`],uc={id:`thisrun`,class:`mb-2 flex items-baseline gap-2.5 px-(--sb-gutter) text-xs font-semibold uppercase tracking-wider text-muted`},dc={key:0,class:`count font-normal normal-case tracking-normal text-dimmed`},fc=[`aria-pressed`,`data-open`,`title`],pc={id:`log`,class:`m-0 list-none p-0`},mc={key:0,id:`placeholder`,class:`empty text-muted`},hc=[`id`],gc={class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 pr-(--sb-gutter) text-xs tabular-nums text-dimmed`},_c=[`title`],vc=[`title`],yc=[`title`],bc={key:2,class:`nonar font-sans italic`},xc=[`title`],Sc=[`data-phase`],Cc=[`aria-expanded`,`onClick`],wc={class:`glyph select-none text-dimmed`},Tc={class:`what`},Ec={key:0,class:`m-0 list-none p-0 pl-4`},Dc={key:4,class:`followup block mt-5 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Oc={class:`mb-2 flex items-baseline gap-2.5 text-xs font-semibold uppercase tracking-wider text-muted`},kc={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},Ac=[`href`],jc={key:1},Mc=[`title`],Nc=[`title`],Pc={key:1,id:`thinking`,class:`pending ml-3.5 mt-5 flex items-center gap-3 rounded-md border border-dashed border-accented pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 text-sm first:mt-0`,"aria-live":`off`,title:`the model is working on its next turn — nothing back yet (since the last event, runner clock)`},Fc=[`title`],Ic={class:`verb min-w-0 truncate text-toned`},Lc=N({__name:`RunPage`,setup(e){let t=fe(`run`),n=t?.mode===`history`,r=n?`Run`:`Live run`,i=n,a=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,s=Yt({openTags:a?a.split(`,`).map(e=>e.trim()).filter(Boolean):void 0}),c=s.state,u=O(n?`ended`:`connecting`),f=O(``),p=Oe(),m=t?.mode===`live`?Zt(t,p.value):null,h=O(void 0),g=O({}),_=V(()=>{if(n&&t?.mode===`history`)return t.status===`completed`?{ok:!0,cls:``,word:`succeeded`}:{ok:!1,cls:t.status===`failed`||t.status===`stopped_hard`||t.status===`interrupted`?`red`:t.status===`stopped_soft`?`amber`:`grey`,word:t.status?Ne(t.status):`ended`};let e=c.stopMode;return{ok:!1,cls:e===`hard`?`red`:e===`soft`?`amber`:`grey`,word:e===`hard`?`killed`:e===`soft`?`stopped early`:`ended`}}),y=V(()=>n&&t?.mode===`history`?t.durationMs:h.value),b=V(()=>$t(n&&t?.mode===`history`?{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk}:g.value)),x=V(()=>y.value===void 0?``:J(y.value,`clock`)),S=V(()=>Me(y.value,`run`)),w=V(()=>Fe(S.value)),D={red:`border-bad/30 text-bad`,amber:`border-warn/30 text-warn`,grey:`border-accented text-muted`},j=V(()=>f.value?f.value:u.value===`connecting`?`connecting…`:u.value===`disconnected`?`disconnected`:u.value===`stopping`?`stopping (${c.stopMode??`soft`})`:u.value===`finished`?h.value===void 0?`delivering…`:`delivering… · ${J(h.value,`clock`)}`:m?`running · ${J(m.elapsedMs(p.value),`clock`)}`:`running`),te=V(()=>f.value||u.value===`disconnected`?`text-bad`:u.value===`running`?`text-ok motion-safe:animate-pulse`:u.value===`finished`?`text-ok`:`text-warn motion-safe:animate-pulse`),ne=V(()=>{if(!t||t.mode!==`live`&&t.mode!==`history`)return null;c.traceVersion;let e=t.receivedAt??t.startedAt,n=Qr(c.meta?.agent);if(t.mode===`history`){let r=t.durationMs??(t.finishedAt===void 0?0:Math.max(0,t.finishedAt-e));return Vr({spans:s.spanSet(),losses:s.losses(e),window:{start:e,end:e+r},owner:n,totalMs:r,phase:`ended`,delivery:{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk},...t.truncated===void 0?{}:{truncated:t.truncated},...t.untimed?{untimed:!0}:{},callTitle:s.callHeadline})}if(!m)return null;let r=u.value===`ended`?`ended`:u.value===`finished`?`delivering`:`live`,i=r===`live`?m.elapsedMs(p.value):h.value??m.elapsedMs(p.value);return Vr({spans:s.spanSet(),losses:s.losses(e),window:{start:e,end:e+i},owner:n,totalMs:i,phase:r,delivery:g.value,callTitle:s.callHeadline})}),re=n&&t?.mode===`history`?`/runs/${encodeURIComponent(t.id)}/events`:void 0;function M(e){s.reveal(e)&&v().then(()=>{let t=document.getElementById(e);t&&(t.scrollIntoView?.({block:`center`}),t.classList.add(`revealed`),setTimeout(()=>t.classList.remove(`revealed`),1500))})}let ie=O(n),ae=O(!1);function N(e){t?.mode===`live`&&(e!==`hard`||o.confirm(`Hard stop: abort the run now with no summary and free its sandbox?`))&&(ae.value=!0,fetch(`${t.stopUrl}&mode=${encodeURIComponent(e)}`,{method:`POST`,credentials:`same-origin`}).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status}`);oe(e)}).catch(e=>{ae.value=!1,f.value=`stop failed: ${e instanceof Error?e.message:`error`}`}))}function oe(e){s.markStopping(e),ie.value=!0,(u.value===`connecting`||u.value===`running`)&&(u.value=`stopping`)}I(()=>c.stopMode,e=>{e&&u.value!==`ended`&&u.value!==`disconnected`&&u.value!==`finished`&&oe(e)}),n||I(u,e=>o.setFavicon(e===`ended`||e===`disconnected`||e===`finished`?Le:Ie),{immediate:!0});let se=V(()=>!n&&u.value!==`ended`&&u.value!==`disconnected`&&u.value!==`finished`),ce=V(()=>se.value?Xt(c,p.value):null);me(tn,ce);let ue=V(()=>se.value?on(c,s.pendingCall(),p.value):null),de=[`Thinking`,`Pondering`,`Mulling it over`,`Reasoning`,`Cogitating`,`Weighing options`,`Puzzling`,`Deliberating`,`Noodling`,`Chewing on it`,`Ruminating`,`Reticulating splines`],pe=V(()=>ue.value?.kind===`thinking`?ne.value?.openStep||de[Math.floor(ue.value.elapsedMs/6e3)%de.length]:``);function he(){s.setAllOpen(!c.allOpen)}let ge=V(()=>c.log.filter(e=>e.kind===`step`).length),_e=O(null);function ve(){return window.innerHeight+window.scrollY>=document.body.scrollHeight-60}let ye=hi(),be=O(!1),xe=t?.mode===`history`&&t.capabilities.readingDiffAbridge?vi(t.id,e=>ye.handle(e)):void 0;d(()=>xe?.dispose());function Se(e){let t=ve();s.handle(e),ye.handle(e),t&&requestAnimationFrame(()=>_e.value?.scrollIntoView?.({block:`nearest`}))}let Ce=je(),q=null;if(t?.mode===`history`){for(let e of t.events)s.handle(e),ye.handle(e);s.closePhases()}E(()=>{if(t?.mode!==`live`)return;q=Ce(t.eventsUrl),q.onopen=()=>{c.stopMode||(u.value=`running`)};let e=0;q.onmessage=t=>{let n;try{n=JSON.parse(t.data)}catch{return}if(n.type!==`replay_note`){let n=Number(t.lastEventId);if(n>0){if(n<=e)return;e=n}}Se(n)},q.addEventListener(`replay_elided`,e=>{let t=Ut(e);t&&s.noteElided(t)}),q.addEventListener(`finished`,e=>{let t=en(e);t&&m&&(h.value=m.elapsedAt(t.finishedAt)),t&&(g.value={...g.value,finishedAt:t.finishedAt}),ie.value=!0,(u.value===`connecting`||u.value===`running`)&&(u.value=`finished`)}),q.addEventListener(`end`,e=>{s.flushPendingTurn(`the run ended here`),s.closePhases(),ie.value=!0,h.value??=m?.elapsedMs(p.value),g.value={...g.value,...Qt(e)},u.value=`ended`,q?.close()}),q.onerror=()=>{q&&q.readyState===2&&(u.value=`disconnected`)}}),d(()=>{q?.close()});function Te(e){return e&&/^https?:\/\//.test(e)?e:``}let Ee=V(()=>Te(c.request?.source?.url)),ke=V(()=>{let e=c.meta;return{repo:Pt(e?.repo),tree:It(e?.repo,e?.ref),commit:Lt(e?.repo,e?.headSha),pr:Ft(e?.repo,e?.pr)}}),Ae=V(()=>qt({meta:c.meta,requestText:c.request?.text??``,prOpened:c.prOpened}));function Y(e){return typeof e==`number`?De(e,p.value):``}function ze(e){return typeof e==`number`?Re(e):void 0}return(e,t)=>{let n=ee,a=we,o=le,d=tt;return W(),k(l,{title:P(r),nav:`runs`},{leading:C(()=>[...t[4]||=[F(`a`,{class:`back text-sm text-primary no-underline hover:underline`,href:`/runs`},`← All runs`,-1)]]),status:C(()=>[F(`span`,Fs,[u.value===`ended`?(W(),H(B,{key:0},[_.value.ok?(W(),H(`span`,Is,`✓`)):(W(),H(`span`,{key:1,class:G([`chip rounded border px-1.5 text-[0.7rem]`,D[_.value.cls]])},K(_.value.word),3)),F(`span`,{id:`state`,class:G([`dur text-xs tabular-nums`,[w.value?`heat`:`text-muted`,S.value.level>=2?`font-medium`:``]]),style:A(w.value),"data-heat":S.value.level},K(x.value),15,Ls),b.value?(W(),H(`span`,Rs,`· `+K(b.value),1)):R(``,!0)],64)):(W(),H(B,{key:1},[F(`span`,{id:`statedot`,class:G([`pulse text-[1.1em] leading-none`,te.value])},`∿`,2),F(`span`,{id:`state`,class:G([`text-xs tabular-nums`,f.value?`text-bad`:`text-muted`]),title:u.value===`running`&&!f.value?`the whole run, since we received the message`:u.value===`finished`?`the agent stopped; the reply is being posted`:void 0},K(j.value),11,zs)],64))])]),actions:C(()=>[ie.value?R(``,!0):(W(),H(`span`,Bs,[L(a,{text:`Soft stop: no new steps, the agent writes up what it has`},{default:C(()=>[L(n,{size:`xs`,color:`neutral`,variant:`outline`,label:`Stop`,disabled:ae.value,onClick:t[0]||=e=>N(`soft`)},null,8,[`disabled`])]),_:1}),L(a,{text:`Hard stop: abort now, no summary, free the sandbox`},{default:C(()=>[L(n,{size:`xs`,color:`error`,variant:`outline`,label:`Kill`,disabled:ae.value,onClick:t[1]||=e=>N(`hard`)},null,8,[`disabled`])]),_:1})]))]),default:C(()=>[F(`div`,Vs,[P(c).meta?(W(),H(`div`,Hs,[F(`span`,Us,K(P(c).meta.agent),1),F(`span`,Ws,K(P(c).meta.model),1),P(c).meta.effort?(W(),H(`span`,Gs,K(P(c).meta.effort)+` effort`,1)):R(``,!0),ke.value.repo?(W(),H(`a`,{key:1,class:`text-primary no-underline hover:underline`,href:ke.value.repo,target:`_blank`,rel:`noopener noreferrer`},K(P(c).meta.repo),9,Ks)):P(c).meta.repo?(W(),H(`span`,qs,K(P(c).meta.repo),1)):R(``,!0),ke.value.tree?(W(),H(`a`,{key:3,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned no-underline hover:border-primary hover:text-primary`,href:ke.value.tree,target:`_blank`,rel:`noopener noreferrer`,title:`the branch on GitHub`},K(P(c).meta.ref),9,Js)):P(c).meta.ref?(W(),H(`span`,Ys,K(P(c).meta.ref),1)):R(``,!0),ke.value.commit&&P(c).meta.headSha?(W(),H(`a`,{key:5,class:`sha tabular-nums text-toned no-underline hover:text-primary hover:underline`,href:ke.value.commit,target:`_blank`,rel:`noopener noreferrer`,title:`the head commit ${P(c).meta.headSha}`},K(P(Rt)(P(c).meta.headSha)),9,Xs)):R(``,!0),ke.value.pr?(W(),H(`a`,{key:6,class:`prlink whitespace-nowrap text-primary no-underline hover:underline`,href:ke.value.pr,target:`_blank`,rel:`noopener noreferrer`},[L(ft,{class:`mr-1 align-[-0.125em]`}),z(`#`+K(P(c).meta.pr),1)],8,Zs)):R(``,!0),P(ye).state.ready?(W(),H(`button`,{key:7,type:`button`,class:`reading-diff ml-auto inline-flex cursor-pointer items-center gap-1 whitespace-nowrap text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"data-testid":`reading-diff-button`,onClick:t[2]||=e=>be.value=!0},[L(o,{name:`i-lucide-git-compare`,class:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[5]||=z(` Reading diff `,-1)])):R(``,!0)])):R(``,!0),P(c).request?(W(),H(`section`,Qs,[F(`h2`,$s,[t[6]||=F(`span`,null,`Request`,-1),P(c).request.source?(W(),H(`span`,ec,[P(c).request.source.channel?(W(),H(B,{key:0},[L(Pe),Ee.value?(W(),H(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:Ee.value,target:`_blank`,rel:`noopener noreferrer`,title:`open the thread`},`#`+K(P(c).request.source.channel),9,tc)):(W(),H(`span`,nc,`#`+K(P(c).request.source.channel),1))],64)):R(``,!0),P(c).request.source.user?(W(),H(`span`,rc,K(P(c).request.source.user),1)):R(``,!0)])):R(``,!0),F(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:ze(P(c).request.at)},K(Y(P(c).request.at)),9,ic)]),L(ot,{lines:3},{default:C(()=>[L(ct,{text:P(c).request.text},null,8,[`text`])]),_:1})])):R(``,!0),P(c).reply&&P(i)?(W(),k(Or,{key:2,position:`first`,text:P(c).reply.text,caption:Ae.value,when:Y(P(c).reply.at),"when-title":ze(P(c).reply.at)},null,8,[`text`,`caption`,`when`,`when-title`])):R(``,!0),P(c).context.length>0?(W(),H(`details`,ac,[F(`summary`,oc,[t[7]||=F(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),t[8]||=F(`span`,null,`Earlier in this thread`,-1),F(`span`,sc,`· `+K(P(c).context.length)+` turn`+K(P(c).context.length===1?``:`s`),1)]),F(`div`,cc,[(W(!0),H(B,null,U(P(c).context,e=>(W(),H(`div`,{key:e.key,class:`turn flex items-baseline gap-3 border-t border-default py-1.5 opacity-85 first-of-type:border-t-0`},[L(ct,{text:e.text},null,8,[`text`]),F(`span`,{class:`ts ml-auto shrink-0 select-none text-xs text-dimmed`,title:ze(e.at)},K(Y(e.at)),9,lc)]))),128))])])):R(``,!0),F(`h2`,uc,[t[9]||=F(`span`,null,`This run`,-1),ge.value>0?(W(),H(`span`,dc,`· `+K(ge.value)+` step`+K(ge.value===1?``:`s`),1)):R(``,!0),F(`button`,{id:`fold`,type:`button`,class:`ml-auto cursor-pointer font-normal normal-case tracking-normal text-dimmed hover:text-toned focus-visible:outline-2 focus-visible:outline-primary`,"aria-pressed":P(c).allOpen?`true`:`false`,"data-open":P(c).allOpen?`1`:`0`,title:P(c).allOpen?`Close every call card`:`Open every call card`,onClick:he},K(P(c).allOpen?`Collapse all`:`Expand all`),9,fc)]),ne.value?(W(),k(Sr,{key:4,vm:ne.value,"events-href":P(re),onReveal:M},null,8,[`vm`,`events-href`])):R(``,!0),F(`ol`,pc,[P(c).placeholder?(W(),H(`li`,mc,`Waiting for activity…`)):R(``,!0),(W(!0),H(B,null,U(P(c).log,e=>(W(),H(B,{key:e.key},[e.kind===`step`?(W(),k(Jn,{key:0,step:e,class:`mt-5 first:mt-0`,onToggleGroup:t=>P(s).toggleGroup(e)},null,8,[`step`,`onToggleGroup`])):e.kind===`turn`?(W(),H(`li`,{key:1,id:`span-${e.turn.spanId}`,class:`turn mt-5 border-l-2 border-(--ui-border-accented)/50 pb-3 pl-3 pt-2`},[F(`div`,gc,[F(`span`,{class:G([`thought`,e.turn.quick?``:`text-warn`]),title:e.turn.label},`thought `+K(e.turn.chip),11,_c),e.turn.switched?(W(),H(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-semibold text-warn`,title:`model changed: this turn ran on ${e.turn.model}`},`⇄ `+K(P(rn)(e.turn.model)),9,vc)):e.turn.showModel?(W(),H(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-semibold leading-normal tracking-wider text-muted`,title:e.turn.model},K(P(rn)(e.turn.model)),9,yc)):R(``,!0),(W(!0),H(B,null,U(e.turn.facts,(e,t)=>(W(),H(`span`,{key:t,class:`fact`},K(e),1))),128)),e.note?(W(),H(`span`,bc,K(e.note),1)):R(``,!0),e.turn.at===void 0?R(``,!0):(W(),H(`span`,{key:3,class:`ts ml-auto select-none`,title:P(Re)(e.turn.at)},K(P(Qe)(e.turn.at)),9,xc))])],8,hc)):e.kind===`span`?(W(),k(er,{key:2,item:e},null,8,[`item`])):e.kind===`phase`?(W(),H(`li`,{key:3,class:`phase py-0.5 text-xs`,"data-phase":e.phase},[F(`button`,{type:`button`,class:`phase-head flex w-full cursor-pointer items-baseline gap-2 text-left text-muted hover:text-toned`,"aria-expanded":e.open,onClick:T(t=>P(s).togglePhase(e),[`prevent`])},[F(`span`,wc,K(e.open?`▾`:`▸`),1),F(`span`,{class:G([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,P(rr)(e.phase)]),"aria-hidden":`true`},null,2),F(`span`,Tc,K(P(Ht)(e)),1)],8,Cc),e.open?(W(),H(`ul`,Ec,[(W(!0),H(B,null,U(e.rows,e=>(W(),k(er,{key:e.key,item:e},null,8,[`item`]))),128))])):R(``,!0)],8,Sc)):e.kind===`followup`?(W(),H(`li`,Dc,[F(`h2`,Oc,[t[10]||=F(`span`,null,`↪ Follow-up`,-1),e.input.source?.user?(W(),H(`span`,kc,[Te(e.input.source.url)?(W(),H(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:e.input.source.url,target:`_blank`,rel:`noopener noreferrer`,title:`open the message`},K(e.input.source.user),9,Ac)):(W(),H(`span`,jc,K(e.input.source.user),1))])):R(``,!0),F(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:ze(e.input.at)},K(Y(e.input.at)),9,Mc)]),L(ct,{text:e.input.text},null,8,[`text`])])):(W(),H(`li`,{key:5,class:G([`note mt-4 flex items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1.5`,e.replay?`text-dimmed`:`bg-warn/10 text-warn`])},[F(`span`,null,K((e.replay?`… `:`⏱ `)+e.text),1),e.at===void 0?R(``,!0):(W(),H(`span`,{key:0,class:`ts ml-auto select-none text-xs text-dimmed`,title:P(Re)(e.at)},K(P(Qe)(e.at)),9,Nc))],2))],64))),128)),ue.value?.kind===`thinking`?(W(),H(`li`,Pc,[t[11]||=F(`span`,{class:`pulse text-[1.1em] leading-none text-info motion-safe:animate-pulse`},`∿`,-1),F(`span`,{class:`badge shrink-0 rounded bg-accented px-1.5 text-[0.68rem] font-semibold leading-normal tracking-wider text-muted`,title:P(c).model??void 0},K(P(rn)(P(c).model)),9,Fc),F(`span`,Ic,K(pe.value)+`…`,1),F(`span`,{class:G([`since ml-auto shrink-0 text-xs tabular-nums`,ue.value.slow?`text-warn`:`text-dimmed`])},K(P(J)(ue.value.elapsedMs,`clock`)),3)])):R(``,!0),F(`li`,{ref_key:`logEnd`,ref:_e,"aria-hidden":`true`},null,512)]),P(c).reply&&!P(i)?(W(),k(Or,{key:5,position:`last`,text:P(c).reply.text,caption:Ae.value,when:Y(P(c).reply.at),"when-title":ze(P(c).reply.at)},null,8,[`text`,`caption`,`when`,`when-title`])):R(``,!0)]),L(d,{open:be.value,"onUpdate:open":t[3]||=e=>be.value=e,title:P($r)(P(ye).state),ui:{content:`w-[min(96vw,90rem)] max-w-none`}},{content:C(({close:e})=>[L(Ps,{data:P(ye).state,abridge:P(xe),closable:``,style:{"--pr-review-ins":`var(--sb-ok)`,"--pr-review-del":`var(--sb-bad)`},onClose:t=>e()},null,8,[`data`,`abridge`,`onClose`])]),_:1},8,[`open`,`title`])]),_:1},8,[`title`])}}}),Rc=N({__name:`RunRoutePage`,setup(e){let t=h(he,null);return(e,n)=>!P(t)||P(t).page===`runNotFound`?(W(),k(Te,{key:0})):(W(),k(Lc,{key:1}))}});export{Rc as default};
|