@straiffi/archon 1.8.2 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/client/assets/ActivityView-_WBeUWWL.js +1 -0
  2. package/dist/client/assets/GitHubActionsDialog-CBb9kFXm.js +1 -0
  3. package/dist/client/assets/VerificationDialog-C5N4ftKi.js +4 -0
  4. package/dist/client/assets/{architectureDiagram-3BPJPVTR-DSq-Vw-s.js → architectureDiagram-3BPJPVTR-YAcjb-IA.js} +1 -1
  5. package/dist/client/assets/{blockDiagram-GPEHLZMM-C_0U0auf.js → blockDiagram-GPEHLZMM-BCPGaDad.js} +1 -1
  6. package/dist/client/assets/{c4Diagram-AAUBKEIU-CEHt0Kjy.js → c4Diagram-AAUBKEIU-fJhOu4Ij.js} +1 -1
  7. package/dist/client/assets/channel-9ISsn-ke.js +1 -0
  8. package/dist/client/assets/{chunk-2J33WTMH-C0Kxxq-6.js → chunk-2J33WTMH-C-_Ugy45.js} +1 -1
  9. package/dist/client/assets/{chunk-3OPIFGDE-QvjUuKmV.js → chunk-3OPIFGDE-D23LnWDf.js} +1 -1
  10. package/dist/client/assets/{chunk-5ZQYHXKU-Csrpz86K.js → chunk-5ZQYHXKU-Cc_biXgw.js} +1 -1
  11. package/dist/client/assets/{chunk-727SXJPM-B3vZVGMR.js → chunk-727SXJPM-CSF9LkHi.js} +1 -1
  12. package/dist/client/assets/{chunk-AQP2D5EJ-Cs9__8di.js → chunk-AQP2D5EJ-DHliNbxB.js} +1 -1
  13. package/dist/client/assets/{chunk-CSCIHK7Q-C9X7lfBM.js → chunk-CSCIHK7Q-BW11cpQ7.js} +1 -1
  14. package/dist/client/assets/{chunk-KSCS5N6A-CY0NGeTu.js → chunk-KSCS5N6A-CKaTqnRs.js} +1 -1
  15. package/dist/client/assets/{chunk-L5ZTLDWV-BboXbWo7.js → chunk-L5ZTLDWV-DZwb33Ik.js} +1 -1
  16. package/dist/client/assets/{chunk-LZXEDZCA-CUBnjoBD.js → chunk-LZXEDZCA-_cTPpjHZ.js} +2 -2
  17. package/dist/client/assets/{chunk-ND2GUHAM-BJqpZMk2.js → chunk-ND2GUHAM-D0HwGHDO.js} +1 -1
  18. package/dist/client/assets/{chunk-NZK2D7GU-BHRnsVyz.js → chunk-NZK2D7GU-BZvw0sGh.js} +1 -1
  19. package/dist/client/assets/{chunk-O5CBEL6O-Anqw_yuF.js → chunk-O5CBEL6O-D4CkvYFL.js} +1 -1
  20. package/dist/client/assets/{chunk-WU5MYG2G-BgGztexj.js → chunk-WU5MYG2G-D8hEcq7j.js} +1 -1
  21. package/dist/client/assets/classDiagram-4FO5ZUOK-Cb62gXr_.js +1 -0
  22. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CmX033GA.js +1 -0
  23. package/dist/client/assets/{dagre-BM42HDAG-BaQbcdG0.js → dagre-BM42HDAG-C8BK1hX6.js} +1 -1
  24. package/dist/client/assets/{diagram-2AECGRRQ-Brv-rcOf.js → diagram-2AECGRRQ-BuY39sUj.js} +1 -1
  25. package/dist/client/assets/{diagram-5GNKFQAL-D3eStICz.js → diagram-5GNKFQAL-C0rXzbL5.js} +1 -1
  26. package/dist/client/assets/{diagram-KO2AKTUF-CrZfGF7-.js → diagram-KO2AKTUF-DLdOz8VS.js} +1 -1
  27. package/dist/client/assets/{diagram-LMA3HP47-Dtk6gUIn.js → diagram-LMA3HP47-C8VMfBnH.js} +1 -1
  28. package/dist/client/assets/{diagram-OG6HWLK6-Bmarlaaa.js → diagram-OG6HWLK6-B5Rk5j3I.js} +1 -1
  29. package/dist/client/assets/{erDiagram-TEJ5UH35-BC_ZzN2S.js → erDiagram-TEJ5UH35-D8zk9anG.js} +1 -1
  30. package/dist/client/assets/{flowDiagram-I6XJVG4X-DpCPHLj5.js → flowDiagram-I6XJVG4X-yHoB6qvF.js} +1 -1
  31. package/dist/client/assets/{ganttDiagram-6RSMTGT7-CaLaeFMa.js → ganttDiagram-6RSMTGT7-CdYAAP7d.js} +1 -1
  32. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-36phJ4N5.js → gitGraphDiagram-PVQCEYII-ZW6nKwWo.js} +1 -1
  33. package/dist/client/assets/index-BcJjyvZL.css +2 -0
  34. package/dist/client/assets/index-CXhEwHXf.js +274 -0
  35. package/dist/client/assets/{infoDiagram-5YYISTIA-BI5oO32P.js → infoDiagram-5YYISTIA-CsCvEEDm.js} +1 -1
  36. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-bgfzr0xn.js → ishikawaDiagram-YF4QCWOH-L6YgNJNe.js} +1 -1
  37. package/dist/client/assets/{journeyDiagram-JHISSGLW-DrmwNzOC.js → journeyDiagram-JHISSGLW-CaDdypZa.js} +1 -1
  38. package/dist/client/assets/{kanban-definition-UN3LZRKU-Cg5rkyMP.js → kanban-definition-UN3LZRKU-CLgMcoKM.js} +1 -1
  39. package/dist/client/assets/{line-CFlz4TDX.js → line-MwAlVJyR.js} +1 -1
  40. package/dist/client/assets/{mermaid-parser.core-C7CnvU1K.js → mermaid-parser.core-YnCNioX9.js} +1 -1
  41. package/dist/client/assets/{mermaid.core-Dbab-VXW.js → mermaid.core-C-vjuXJ6.js} +3 -3
  42. package/dist/client/assets/{mindmap-definition-RKZ34NQL-DJze85_k.js → mindmap-definition-RKZ34NQL-DRwJsFL4.js} +1 -1
  43. package/dist/client/assets/{pieDiagram-4H26LBE5-DJAQkhKY.js → pieDiagram-4H26LBE5-D8-qF3PX.js} +1 -1
  44. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-BD8d4qar.js → quadrantDiagram-W4KKPZXB-BMhgWKrx.js} +1 -1
  45. package/dist/client/assets/{requirementDiagram-4Y6WPE33-C5mokQZP.js → requirementDiagram-4Y6WPE33-rHi9GD9i.js} +1 -1
  46. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-EkdPZKJO.js → sankeyDiagram-5OEKKPKP-BkXWM9ao.js} +1 -1
  47. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-B-5oe-32.js → sequenceDiagram-3UESZ5HK-YEoJ-ZTV.js} +1 -1
  48. package/dist/client/assets/{stateDiagram-AJRCARHV-BFHel4DJ.js → stateDiagram-AJRCARHV-Cj-qFZz1.js} +1 -1
  49. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-C3hkJar3.js +1 -0
  50. package/dist/client/assets/{timeline-definition-PNZ67QCA-DvyAtzba.js → timeline-definition-PNZ67QCA-BSOzNHtd.js} +1 -1
  51. package/dist/client/assets/{vennDiagram-CIIHVFJN-C9vIulQP.js → vennDiagram-CIIHVFJN-Bg8Uivxc.js} +1 -1
  52. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-CQTFOoRr.js → wardleyDiagram-YWT4CUSO-DU13oR2A.js} +1 -1
  53. package/dist/client/assets/{xychartDiagram-2RQKCTM6-CyXsRLmO.js → xychartDiagram-2RQKCTM6-Bj3Qm_Tg.js} +1 -1
  54. package/dist/client/index.html +2 -2
  55. package/dist/client/notification-service-worker.js +70 -0
  56. package/dist/server/db.js +1 -0
  57. package/dist/server/db.js.map +1 -1
  58. package/dist/server/index.js +26 -1
  59. package/dist/server/index.js.map +1 -1
  60. package/dist/server/lib/buildSequences.js +13 -6
  61. package/dist/server/lib/buildSequences.js.map +1 -1
  62. package/dist/server/lib/executionRuns.js +11 -4
  63. package/dist/server/lib/executionRuns.js.map +1 -1
  64. package/dist/server/lib/git.js +1 -0
  65. package/dist/server/lib/git.js.map +1 -1
  66. package/dist/server/lib/pullRequestContent.js +1 -1
  67. package/dist/server/lib/pullRequestContent.js.map +1 -1
  68. package/dist/server/lib/reviewFindings.js +1 -1
  69. package/dist/server/lib/reviewFindings.js.map +1 -1
  70. package/dist/server/lib/ticketAutomation.js +2 -1
  71. package/dist/server/lib/ticketAutomation.js.map +1 -1
  72. package/dist/server/lib/tickets.js +8 -4
  73. package/dist/server/lib/tickets.js.map +1 -1
  74. package/dist/server/lib/types.js.map +1 -1
  75. package/package.json +1 -1
  76. package/dist/client/assets/ActivityView-CF8punHV.js +0 -1
  77. package/dist/client/assets/GitHubActionsDialog-Ckb99-ve.js +0 -1
  78. package/dist/client/assets/VerificationDialog-BgEDRfgP.js +0 -4
  79. package/dist/client/assets/channel-BjDfVBsO.js +0 -1
  80. package/dist/client/assets/classDiagram-4FO5ZUOK-DSaSDx3D.js +0 -1
  81. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BwfjAHrx.js +0 -1
  82. package/dist/client/assets/index-D4qr0sQx.css +0 -2
  83. package/dist/client/assets/index-Os2WLcbu.js +0 -274
  84. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-iGqsY8gO.js +0 -1
@@ -0,0 +1 @@
1
+ import{dt as e,r as t}from"./index-CXhEwHXf.js";var n=e(),r=({projectId:e,onClose:r,onNavigateToLifecycleSource:i,initialRunId:a,initialEventId:o,onRunSelectionChange:s,onUnavailable:c})=>e?(0,n.jsx)(t,{projectId:e,scope:{type:`project`},initialRunId:a,initialEventId:o,onRunSelectionChange:s,onUnavailable:c,onClose:r,onNavigateToLifecycleSource:i}):null;export{r as ActivityView};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{B as t,C as n,E as r,F as i,H as a,J as o,M as s,P as c,S as l,T as u,U as d,V as f,W as p,Y as m,b as h,ct as g,dt as _,ft as v,lt as y,mt as ee,q as te,st as ne,u as b,ut as re,vt as x,w as S,x as C,z as w}from"./index-CXhEwHXf.js";var T=e(x(),1),E=_(),ie=`https://docs.github.com/en/actions`,ae=5e3,D=(e,t)=>C.t(`common:githubActions.${e}`,t),O=e=>D(`status.${e}`),k=e=>e?D(`conclusion.${e}`):null,A=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`||e.conclusion===`timed_out`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e.conclusion===`cancelled`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e.status===`queued`?`border-violet-400/40 bg-violet-500/10 text-violet-200`:`border-border/70 bg-background/60 text-muted-foreground`,j=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`?`border-rose-400/30 bg-rose-500/10 text-rose-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border/70 bg-background/60 text-muted-foreground`,M=e=>{let t=e.run_started_at??e.created_at,n=e.updated_at;if(!t||!n)return null;let r=Date.parse(t),i=Date.parse(n);if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return null;let a=i-r;if(a<1e3)return`${a} ms`;let o=Math.floor(a/1e3),s=Math.floor(o/3600),c=Math.floor(o%3600/60),l=o%60;return s>0?`${s}h ${c}m ${l}s`:c>0?`${c}m ${l}s`:`${(a/1e3).toFixed(a>=1e4?0:1)} s`},N=e=>e.status===`completed`?k(e.conclusion)??D(`status.completed`):O(e.status),P=e=>{let t={};for(let n of e){if(n.type===`boolean`){t[n.name]=n.default===!0;continue}typeof n.default==`string`&&n.default!==``&&(t[n.name]=n.default)}return t},F=({workflow:e,inputsState:t,isSelected:n,onSelect:r})=>{let a=e.state===`active`,s=t?.dispatchable??!0,l=a&&s&&!t?.isLoading,u=e.path.split(`/`).pop();return(0,E.jsxs)(`div`,{className:m(`flex flex-col gap-3 rounded-2xl border px-4 py-3 transition-colors`,n?`border-sky-400/45 bg-sky-500/10`:`border-border/60 bg-background/20 hover:bg-accent/20`),children:[(0,E.jsx)(`p`,{className:`line-clamp-2 break-words text-sm font-medium text-foreground`,children:e.name}),(0,E.jsx)(`p`,{className:`min-w-0 break-words text-[11px] text-muted-foreground`,children:u}),(0,E.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,E.jsx)(h,{variant:`outline`,className:m(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,a?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:`border-border/70 bg-background/60 text-muted-foreground`),children:D(a?`workflows.stateActive`:`workflows.stateDisabled`)}),(0,E.jsxs)(o,{type:`button`,variant:n?`secondary`:`outline`,size:`sm`,className:`h-8 gap-1.5 px-3 text-xs`,disabled:!l,"aria-label":D(`workflows.runAriaLabel`,{name:e.name}),title:!s&&t?D(`inputs.notDispatchable`):void 0,onClick:r,children:[t?.isLoading?(0,E.jsx)(i,{className:`h-3.5 w-3.5 animate-spin`}):(0,E.jsx)(c,{className:`h-3.5 w-3.5`}),(0,E.jsx)(`span`,{children:D(`actions.run`)})]})]})]})},I=({workflow:e,inputsState:n,refValue:r,onRefChange:a,values:s,onValueChange:u,isDispatching:d,onDispatch:f,onCancel:p})=>{let m=n.inputs.filter(e=>e.required&&!L(s[e.name],e)),h=n.dispatchable&&!n.isLoading&&!n.error&&r.trim()!==``&&m.length===0&&!d;return(0,E.jsxs)(`div`,{className:`space-y-4 rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:D(`inputs.title`)}),(0,E.jsx)(`p`,{className:`mt-0.5 truncate text-sm font-medium text-foreground`,children:e.name})]}),(0,E.jsx)(o,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":D(`actions.cancel`),onClick:p,children:(0,E.jsx)(l,{className:`h-4 w-4`})})]}),(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsx)(w,{htmlFor:`github-actions-ref`,children:D(`inputs.refLabel`)}),(0,E.jsx)(t,{id:`github-actions-ref`,type:`text`,value:r,onChange:e=>{a(e.target.value)},placeholder:D(`inputs.refPlaceholder`),"aria-label":D(`inputs.refAriaLabel`)})]}),n.isLoading&&(0,E.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,E.jsx)(i,{className:`h-3.5 w-3.5 animate-spin`}),(0,E.jsx)(`span`,{children:D(`inputs.loading`)})]}),n.error&&(0,E.jsx)(`p`,{className:`text-xs text-rose-200`,children:n.error}),!n.dispatchable&&!n.isLoading&&!n.error&&(0,E.jsx)(`p`,{className:`text-xs text-amber-200`,children:D(`inputs.notDispatchable`)}),n.inputs.map(e=>(0,E.jsx)(R,{input:e,value:s[e.name],onChange:t=>{u(e.name,t)}},e.name)),m.length>0&&(0,E.jsx)(`p`,{className:`text-xs text-rose-200`,children:D(`inputs.requiredValidationError`)}),(0,E.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,E.jsx)(o,{type:`button`,variant:`ghost`,onClick:p,disabled:d,children:D(`actions.cancel`)}),(0,E.jsxs)(o,{type:`button`,variant:`success`,onClick:f,disabled:!h,children:[d?(0,E.jsx)(i,{className:`h-4 w-4 animate-spin`}):(0,E.jsx)(c,{className:`h-4 w-4`}),(0,E.jsx)(`span`,{children:D(`actions.dispatch`)})]})]})]})},L=(e,t)=>t.type===`boolean`?typeof e==`boolean`:typeof e==`string`&&e.trim()!==``,R=({input:e,value:t,onChange:n})=>{let r=`github-actions-input-${e.name}`;return(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsxs)(w,{htmlFor:r,className:`flex items-center gap-2`,children:[(0,E.jsx)(`span`,{children:e.name}),e.required&&(0,E.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.18em] text-rose-200/80`,children:D(`inputs.requiredLabel`)})]}),e.description&&(0,E.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.description}),z(e,r,t,n)]})},z=(e,n,r,i)=>{if(e.type===`boolean`){let t=typeof r==`boolean`?r:e.default===!0;return(0,E.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,E.jsx)(b,{id:n,checked:t,onCheckedChange:e=>{i(e)}}),(0,E.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:D(t?`inputs.booleanYes`:`inputs.booleanNo`)})]})}if(e.type===`choice`){let t=e.options??[],a=typeof r==`string`?r:typeof e.default==`string`?e.default:``;return(0,E.jsxs)(`select`,{id:n,className:`h-9 w-full rounded-lg border border-border/70 bg-background/60 px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,value:a,onChange:e=>{i(e.target.value)},children:[a===``&&(0,E.jsx)(`option`,{value:``,children:D(`inputs.selectPlaceholder`)}),t.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]})}return(0,E.jsx)(t,{id:n,type:`text`,value:typeof r==`string`?r:typeof e.default==`string`?e.default:``,onChange:e=>{i(e.target.value)}})},B=({job:e})=>e.steps.length===0?null:(0,E.jsx)(`div`,{className:`mt-2 ml-4 space-y-1 border-l border-border/60 pl-4`,children:e.steps.map(t=>(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(h,{variant:`outline`,className:m(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,j(t)),children:t.status===`completed`?k(t.conclusion)??D(`status.completed`):O(t.status)}),(0,E.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:t.name})]},`${e.id}-${t.number}`))}),oe=({run:e})=>{let t=M(e),r=N(e);return(0,E.jsxs)(`div`,{className:`rounded-2xl border border-border/60 bg-background/20 px-4 py-3`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,E.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name??`#${e.id}`}),(0,E.jsx)(h,{variant:`outline`,className:m(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,A(e)),children:r})]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[t&&(0,E.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t}),e.html_url&&(0,E.jsxs)(`a`,{href:e.html_url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-sky-200 hover:text-sky-100`,children:[D(`actions.openOnGithub`),(0,E.jsx)(n,{className:`h-3 w-3`})]})]})]}),e.head_branch&&(0,E.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e.head_branch}),e.jobs.map(e=>(0,E.jsxs)(`div`,{className:`mt-2`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(h,{variant:`outline`,className:m(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,A(e)),children:e.status===`completed`?k(e.conclusion)??D(`status.completed`):O(e.status)}),(0,E.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.name})]}),(0,E.jsx)(B,{job:e})]},e.id))]})},se=({tracked:e})=>{let t=e.state===`resolving`,n=e.failure?.message??D(`runs.trackingState.${e.state}`);return(0,E.jsxs)(`div`,{className:m(`flex items-start gap-2 rounded-2xl border px-4 py-3`,t?`border-border/60 bg-background/20`:`border-red-400/25 bg-red-500/8`),children:[t&&(0,E.jsx)(i,{className:`mt-0.5 h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsx)(`span`,{className:m(`block break-words text-xs`,t?`text-muted-foreground`:`text-red-200`),children:n}),(0,E.jsx)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:e.ref??D(`runs.unknownRef`)})]})]})},V=(e,t)=>{let n=new Map(e.map(e=>[e.id,e]));for(let e of t){let t=n.get(e.id);(!t||(e.updated_at??``)>=(t.updated_at??``))&&n.set(e.id,e)}return[...n.values()]},H=(e,t)=>{let n=new Map(e.map(e=>[e.execution_run_id,e]));for(let e of t){let t=n.get(e.execution_run_id),r=t&&![`queued`,`waiting`,`running`].includes(t.execution_status),i=[`queued`,`waiting`,`running`].includes(e.execution_status);(!r||!i)&&n.set(e.execution_run_id,e)}return[...n.values()]},U=(e,t,n)=>{let r=t.filter(e=>e.run===null),i=new Set(r.map(e=>e.tracking_key));return H(e.filter(e=>i.has(e.tracking_key)||n.get(e.tracking_key)?.run===null),r.filter(e=>!n.has(e.tracking_key)))},W=e=>({ref:e??`main`}),G=({projectId:e,defaultBranch:t,onClose:c})=>{let[m,h]=(0,T.useState)([]),[_,b]=(0,T.useState)(!0),[x,C]=(0,T.useState)(null),[w,O]=(0,T.useState)([]),[k,A]=(0,T.useState)([]),[j,M]=(0,T.useState)({}),[N,L]=(0,T.useState)(null),[R,z]=(0,T.useState)(!1),[B]=(0,T.useState)(()=>W(t)),H=(0,T.useRef)({}),G=(0,T.useRef)({}),K=(0,T.useRef)(null),q=(0,T.useRef)(!1),J=(0,T.useRef)(0),Y=(0,T.useRef)(new Map),X=(0,T.useCallback)(async t=>{M(e=>{let n=e[t.id];return n?.isLoading?e:{...e,[t.id]:{inputs:n?.inputs??[],dispatchable:n?.dispatchable??!0,isLoading:!0,error:null}}});try{let n=await g(e,t.id,t.path);return M(e=>({...e,[t.id]:{inputs:n.inputs,dispatchable:n.dispatchable,isLoading:!1,error:null}})),n}catch(e){return M(n=>({...n,[t.id]:{inputs:[],dispatchable:!0,isLoading:!1,error:e instanceof v?e.message:D(`workflows.loadError`)}})),null}},[e]),Z=(0,T.useCallback)(async()=>{b(!0),C(null);try{let t=await re(e);h(t.workflows),Promise.allSettled(t.workflows.map(e=>X(e)))}catch(e){C(e instanceof v?e.message:D(`workflows.loadError`))}finally{b(!1)}},[X,e]),Q=(0,T.useCallback)(async t=>{if(q.current)return;q.current=!0;let n=J.current;try{let r=await y(e,t);O(e=>V(e,r.runs)),A(e=>{let t=new Map([...Y.current.entries()].filter(([,e])=>e.revision>n).map(([e,t])=>[e,t.event]));return U(e,r.tracked_runs??[],t)})}catch(e){ee(e)||console.warn(`[github-actions] unable to load runs`,e)}finally{q.current=!1}},[e]);(0,T.useEffect)(()=>{Z()},[Z]),(0,T.useEffect)(()=>{let e=new AbortController,t=()=>{document.visibilityState===`visible`&&Q(e.signal)};t();let n=window.setInterval(t,ae),r=u(t);return()=>{e.abort(),window.clearInterval(n),r()}},[Q]);let ce=(0,T.useCallback)(async e=>{if(N?.workflow.id===e.id)return;K.current=e.id,L({workflow:e,ref:B.ref,values:{}});let t=j[e.id];if(t&&!t.isLoading&&!t.error){L(n=>!n||n.workflow.id!==e.id?n:{...n,values:P(t.inputs)});return}let n=await X(e);n&&L(t=>!t||t.workflow.id!==e.id?t:{...t,values:P(n.inputs)})},[B.ref,j,X,N]),le=(0,T.useCallback)(async()=>{if(!N)return;let t=j[N.workflow.id];if(!t||!t.dispatchable)return;z(!0);let n={};for(let e of t.inputs){let t=N.values[e.name];e.type===`boolean`?n[e.name]=typeof t==`boolean`?t:e.default===!0:typeof t==`string`&&t!==``?n[e.name]=t:typeof e.default==`string`&&e.default!==``&&(n[e.name]=e.default)}try{await ne(e,N.workflow.id,{ref:N.ref,workflowName:N.workflow.name,workflowUrl:N.workflow.url,inputs:n}),s.success(D(`messages.dispatched`)),L(null),Q()}catch(e){s.error(e instanceof v?e.message:D(`messages.dispatchError`))}finally{z(!1)}},[j,Q,e,N]);(0,T.useEffect)(()=>{let t=t=>{!t||t.project_id!==e||(J.current+=1,Y.current.set(t.tracking_key,{revision:J.current,event:t}),A(e=>{let n=e.filter(e=>e.tracking_key!==t.tracking_key);return t.run?n:[...n,t]}),t.run&&O(e=>V(e,[t.run])))};return S.on(`github-actions:updated`,t),()=>{S.off(`github-actions:updated`,t)}},[e]),(0,T.useEffect)(()=>{let e=N?.workflow.id;!e||K.current!==e||(H.current[e]?.scrollIntoView({block:`nearest`}),G.current[e]?.scrollIntoView({block:`nearest`}),K.current=null)},[N?.workflow.id]);let $=(0,T.useMemo)(()=>[...w].sort((e,t)=>{let n=e.updated_at?Date.parse(e.updated_at):0;return(t.updated_at?Date.parse(t.updated_at):0)-n}),[w]);return(0,E.jsx)(f,{open:!0,onOpenChange:e=>{e||c()},children:(0,E.jsxs)(d,{showCloseButton:!1,overlayClassName:`bg-black/70`,className:`flex h-[calc(100vh-2rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl border border-[#2a2a38] bg-[#16161f] p-0 shadow-2xl sm:max-w-5xl`,onInteractOutside:e=>e.preventDefault(),children:[(0,E.jsx)(te,{className:`sr-only`,children:D(`dialog.srTitle`)}),(0,E.jsx)(p,{className:`sr-only`,children:D(`dialog.srDescription`)}),(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,E.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-violet-200`,children:(0,E.jsx)(r,{className:`h-5 w-5`})}),(0,E.jsx)(`div`,{children:(0,E.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:D(`dialog.title`)})})]}),(0,E.jsx)(a,{asChild:!0,children:(0,E.jsx)(o,{type:`button`,"aria-label":D(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,E.jsx)(l,{className:`h-4 w-4`})})})]}),(0,E.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 overflow-hidden lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,E.jsxs)(`aside`,{"aria-label":D(`workflows.ariaLabel`),className:`flex min-h-0 flex-col gap-3 overflow-y-auto border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,E.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:D(`workflows.title`)}),(0,E.jsx)(o,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>{Z(),Q()},children:D(`actions.refresh`)})]}),_&&(0,E.jsxs)(`div`,{className:`flex items-center gap-2 px-2 text-xs text-muted-foreground`,children:[(0,E.jsx)(i,{className:`h-3.5 w-3.5 animate-spin`}),(0,E.jsx)(`span`,{children:D(`workflows.loading`)})]}),x&&(0,E.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:x}),!_&&m.length===0&&!x&&(0,E.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:[(0,E.jsx)(`p`,{children:D(`workflows.empty`)}),(0,E.jsx)(`p`,{className:`mt-1`,children:D(`workflows.emptyHint`)}),(0,E.jsxs)(`a`,{href:ie,target:`_blank`,rel:`noreferrer`,className:`mt-2 inline-flex items-center gap-1 text-xs text-sky-200 hover:text-sky-100`,children:[D(`workflows.docsLink`),(0,E.jsx)(n,{className:`h-3 w-3`})]})]}),(0,E.jsx)(`div`,{className:`space-y-2`,children:m.map(e=>{let t=N?.workflow.id===e.id;return(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsx)(`div`,{ref:t=>{H.current[e.id]=t},children:(0,E.jsx)(F,{workflow:e,inputsState:j[e.id]??null,isSelected:t,onSelect:()=>{ce(e)}})}),t&&N&&(0,E.jsx)(`div`,{ref:t=>{G.current[e.id]=t},children:(0,E.jsx)(I,{workflow:e,inputsState:j[e.id]??{inputs:[],dispatchable:!0,isLoading:!1,error:null},refValue:N.ref,onRefChange:e=>{L(t=>t&&{...t,ref:e})},values:N.values,onValueChange:(e,t)=>{L(n=>n&&{...n,values:{...n.values,[e]:t}})},isDispatching:R,onDispatch:()=>{le()},onCancel:()=>{L(null)}})})]},e.id)})})]}),(0,E.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-3 overflow-y-auto px-4 py-4`,children:[(0,E.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:D(`runs.title`)}),k.map(e=>(0,E.jsx)(se,{tracked:e},e.tracking_key)),$.map(e=>(0,E.jsx)(oe,{run:e},e.id)),$.length===0&&k.length===0&&(0,E.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:D(`runs.empty`)})]})]})]})})};export{G as GitHubActionsDialog};
@@ -0,0 +1,4 @@
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{$ as t,A as n,B as r,D as i,F as a,G as o,I as s,J as c,K as l,L as u,N as d,O as f,P as ee,Q as p,R as m,S as h,U as g,V as te,W as _,X as v,Y as y,Z as b,_ as x,_t as ne,a as S,at as C,b as w,c as T,d as E,dt as D,et as re,f as O,ft as k,g as ie,gt as A,h as j,ht as M,i as ae,it as oe,j as se,k as N,m as ce,mt as le,n as ue,nt as P,o as de,ot as fe,p as pe,pt as F,q as me,rt as he,s as ge,t as _e,tt as ve,v as I,vt as L,w as ye,x as R,y as be}from"./index-CXhEwHXf.js";var z=e(L(),1),B=D(),xe=e=>{if(!e.file_path)return null;if(!e.start_line)return e.file_path;let t=`${e.start_line}${e.start_column?`:${e.start_column}`:``}`,n=e.end_line?`-${e.end_line}${e.end_column?`:${e.end_column}`:``}`:``;return`${e.file_path}:${t}${n}`},Se=({attempt:e,diagnostics:t,repair:n,selectedDiagnosticIds:r,selectedRawOutputAttemptRunIds:i,selectedAttemptRunIds:a,selectedTicketId:o,pending:s,activeRepair:l,onSelectedTicketChange:u,onToggleDiagnostic:d,onToggleRawOutput:f,onStartRepair:ee,onStopRepair:p})=>{let{t:m}=ne(`common`,{keyPrefix:`checksDialog.diagnostics`}),h=t?.parser,g=l?.terminal_result===null,te=!!(n?.eligibility.eligible&&n.eligible_attempt_run_ids.includes(e.execution_run_id)&&h?.status===`complete`&&h.retention_state===`retained`),_=!!(n?.eligibility.eligible&&n.eligible_raw_output_attempt_run_ids.includes(e.execution_run_id)&&e.output_retention_state===`retained`&&e.retained_output),v=i.has(e.execution_run_id),y=r.size,b=y>=32,x=a.size>=8&&!a.has(e.execution_run_id),S=b?m(`diagnosticLimit`,{count:32}):x?m(`attemptLimit`,{count:8}):null,C=!!(n?.accepts_ticket_id&&n.candidate_tickets.length>1),w=y+i.size,T=w>0&&(!C||o!==``),E=n&&!n.eligibility.eligible?m(`disabled.${n.eligibility.reason}`):null;return(0,B.jsxs)(`section`,{"aria-labelledby":`diagnostics-${e.execution_run_id}`,className:`mt-5 rounded-2xl border border-border/70 bg-background/25 p-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{id:`diagnostics-${e.execution_run_id}`,className:`text-sm font-semibold text-foreground`,children:m(`title`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:h?m(`summary`,{count:h.diagnostic_count,parser:m(`parser.${h.parser_kind}`)}):m(`loading`)})]}),h&&(0,B.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1 text-xs text-muted-foreground`,children:m(`state.${h.status}`)})]}),h?.retention_state===`expired`&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-amber-200`,children:m(`expired`)}),h?.truncated&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-amber-200`,children:m(`truncated`)}),h&&[`unsupported`,`malformed`,`interrupted`].includes(h.status)&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:m(`fallback.${h.status}`)}),_&&(0,B.jsxs)(`label`,{className:`mt-4 flex items-start gap-3 rounded-xl border border-amber-400/25 bg-amber-500/5 p-3`,children:[(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 accent-primary`,checked:v,disabled:g||!v&&x,onChange:e=>f(e.target.checked)}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:m(`rawOutputSelect`)}),(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:m(`rawOutputHint`)}),e.retained_start_offset>0&&(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-amber-200`,children:m(`rawOutputTruncated`)})]})]}),h&&t&&t.diagnostics.length>0&&(0,B.jsxs)(`fieldset`,{className:`mt-4`,children:[(0,B.jsx)(`legend`,{className:`text-xs font-medium text-muted-foreground`,children:m(`selectLegend`)}),(0,B.jsx)(`ul`,{className:`mt-2 space-y-2`,children:t.diagnostics.map(t=>{let n=xe(t),i=r.has(t.id);return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`label`,{className:`flex items-start gap-3 rounded-xl border border-border/60 bg-background/35 p-3`,children:[(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 accent-primary`,checked:i,disabled:!te||g||!i&&S!==null,onChange:e=>d(t.id,e.target.checked)}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`span`,{className:`flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{className:`font-semibold uppercase text-foreground`,children:m(`severity.${t.severity}`)}),t.code&&(0,B.jsx)(`code`,{children:t.code}),(0,B.jsx)(`span`,{children:m(`source`,{source:e.command_snapshot.name})})]}),(0,B.jsx)(`span`,{className:`mt-1 block break-words text-sm text-foreground`,children:t.message}),(0,B.jsx)(`span`,{className:`mt-1 block break-all font-mono text-xs text-muted-foreground`,children:n??m(`repositoryLocation`)}),(0,B.jsxs)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:[m(`repairApplicability`),` · `,m(`retention`,{state:m(`retentionState.${h.retention_state}`)})]})]})]})},t.id)})})]}),n&&(0,B.jsxs)(`aside`,{className:`mt-4 rounded-xl border border-border/60 bg-background/35 p-3`,children:[(0,B.jsx)(`h4`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:m(`destinationTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:m(`destination.${n.destination}`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:m(`destinationHint`)})]}),C&&n&&(0,B.jsxs)(`label`,{className:`mt-4 block text-xs text-muted-foreground`,children:[m(`ticketLabel`),(0,B.jsxs)(`select`,{value:o,onChange:e=>u(e.target.value),className:`mt-1 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,B.jsx)(`option`,{value:``,children:m(`ticketPlaceholder`)}),n.candidate_tickets.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.title},e.id))]})]}),E&&(0,B.jsx)(`p`,{className:`mt-3 text-xs text-amber-200`,children:E}),S&&(0,B.jsx)(`p`,{className:`mt-3 text-xs text-amber-200`,children:S}),l&&(0,B.jsxs)(`div`,{className:`mt-4 rounded-xl border border-sky-400/25 bg-sky-500/10 p-3 text-sm`,children:[(0,B.jsx)(`p`,{className:`font-medium text-sky-100`,children:m(l.terminal_result?`repairResult.${l.terminal_result}`:`repairRunning`)}),l.terminal_message&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-sky-100/80`,children:l.terminal_message})]}),(0,B.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,B.jsx)(c,{type:`button`,size:`sm`,disabled:!te&&!_||!T||s||g,title:E??void 0,onClick:ee,children:s?m(`starting`):m(`repairSelectedEvidence`,{count:w})}),g&&(0,B.jsx)(c,{type:`button`,variant:`destructive`,size:`sm`,disabled:s,onClick:p,children:m(`stopRepair`)})]})]})},Ce=new Set([`queued`,`running`,`waiting`]),we=75,Te=32,Ee=64,V=3,De=32,Oe=8,H=(e,t)=>e instanceof k?e.message:t,ke=e=>e.execution_status===`completed`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e.execution_status===`failed`||e.execution_status===`interrupted`?`border-red-400/30 bg-red-500/10 text-red-200`:e.execution_status===`running`||e.execution_status===`queued`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border bg-muted/40 text-muted-foreground`,Ae=e=>e.execution_status===`completed`&&e.outcome===`passed`,je=(e,t)=>e.presentApplicability.appliesToCurrentState===!1?`stale`:t?t.execution_status===`interrupted`||t.execution_status===`cancelled`?`interrupted`:t.execution_status===`failed`?`failed`:t.currency===`stale`?`stale`:t.outcome&&t.outcome!==`passed`?`failed`:t.outcome===`passed`&&t.currency===`current`?`current`:e.decision===`blocked`?`blocked`:`current`:`missing`,Me={current:`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`,stale:`border-amber-400/30 bg-amber-500/10 text-amber-200`,failed:`border-red-400/30 bg-red-500/10 text-red-200`,missing:`border-border bg-muted/40 text-muted-foreground`,interrupted:`border-orange-400/30 bg-orange-500/10 text-orange-200`,blocked:`border-amber-400/30 bg-amber-500/10 text-amber-200`},Ne=({projectId:e,targetKind:n,targetBundleId:r,definitions:i,requiredDefinitionIds:a=[],preReviewDefinitionIds:o=[],gateEvaluationId:s=null,directBatchRunId:l=null,directAttemptRunId:u=null,onSelectionChange:d,onUnavailable:f,onStatusChange:ee})=>{let{t:m}=ne(`common`,{keyPrefix:`checksDialog`}),h=T(),[g,te]=(0,z.useState)(()=>new Set(i.map(e=>e.id))),[_,v]=(0,z.useState)(null),[x,w]=(0,z.useState)(null),[E,D]=(0,z.useState)(null),[O,A]=(0,z.useState)(!0),[M,se]=(0,z.useState)(null),[N,ue]=(0,z.useState)(null),[F,me]=(0,z.useState)(new Set),[_e,I]=(0,z.useState)(new Set),[L,ye]=(0,z.useState)(``),[R,be]=(0,z.useState)(null),[xe,Ne]=(0,z.useState)(!1),[Pe,Fe]=(0,z.useState)(0),[Ie,U]=(0,z.useState)(null),W=(0,z.useRef)(_),G=(0,z.useRef)(null),K=(0,z.useRef)(new Set),q=(0,z.useRef)(new Map),J=(0,z.useRef)(0),Le=(0,z.useRef)(0),Y=(0,z.useRef)(null),X=(0,z.useRef)(!1),Z=(0,z.useRef)(!0),Re=(0,z.useRef)(async()=>void 0),ze=(0,z.useRef)(async()=>void 0),Be=(0,z.useRef)(()=>void 0),Q=(0,z.useRef)(0);W.current=_,Z.current=O||M!==null;let Ve=(0,z.useCallback)(e=>{ue(e),be(e.latest_repair),me(t=>{let n=new Set(e.attempts.flatMap(e=>e.diagnostics.map(e=>e.id)));return new Set([...t].filter(e=>n.has(e)))}),I(t=>{let n=new Set(e.repair.eligible_raw_output_attempt_run_ids);return new Set([...t].filter(e=>n.has(e)))}),ye(t=>e.repair.candidate_tickets.some(e=>e.id===t)?t:e.repair.candidate_tickets.length===1&&e.repair.accepts_ticket_id?e.repair.candidate_tickets[0].id:``)},[]),He=(0,z.useCallback)(e=>{let t=q.current;if(!t.has(e.attempt_run_id)&&t.size>=Te){let e=t.keys().next().value;e&&(t.delete(e),K.current.delete(e))}let n=t.get(e.attempt_run_id)??[];t.set(e.attempt_run_id,[...n.slice(-(Ee-1)),e])},[]),Ue=(0,z.useCallback)((e,t)=>{let n=W.current?.batch.execution_run_id===e.batch.execution_run_id?W.current:null,r=!1,i=new Set(e.attempts.map(e=>e.execution_run_id));for(let e of q.current.keys())i.has(e)||(q.current.delete(e),K.current.delete(e));let a=e.attempts.map(e=>{let t=!1,i=n?.attempts.find(t=>t.execution_run_id===e.execution_run_id),a=i&&i.output_revision>e.output_revision?i:e,o=q.current.get(e.execution_run_id)??[];for(let e of[...o].sort((e,t)=>e.revision-t.revision)){let n=de(S(a),e);if(n.status===`refetch`){t=!0,r=!0;continue}n.status===`applied`&&(a={...a,output_revision:n.snapshot.revision,retained_start_offset:n.snapshot.retainedStartOffset,retained_end_offset:n.snapshot.totalByteCount,total_persisted_bytes:n.snapshot.totalByteCount,retained_output:n.snapshot.retainedText})}return t?K.current.add(e.execution_run_id):(K.current.delete(e.execution_run_id),q.current.delete(e.execution_run_id)),a}),o={...e,attempts:a};Y.current=e.batch.execution_run_id,W.current=o,v(o);let s=t?o.attempts.find(e=>e.execution_run_id===t):null;t&&!s&&f?.(),D(e=>s?.execution_run_id??(o.attempts.some(t=>t.execution_run_id===e)?e:o.attempts.find(e=>e.execution_status===`running`)?.execution_run_id??o.attempts[0]?.execution_run_id??null)),d?.(o.batch.execution_run_id,s?.execution_run_id),r?Be.current(e.batch.execution_run_id):Q.current=0,X.current&&!G.current&&(X.current=!1,G.current=setTimeout(()=>{G.current=null,ze.current().catch(e=>U(H(e,m(`errors.load`))))},we))},[d,f,m]),$=(0,z.useCallback)(async(t,n)=>{let r=++J.current,i=await b(e,t,n);if(r!==J.current||i.batch.execution_run_id!==t||Y.current!==null&&Y.current!==t){i.batch.execution_run_id!==t&&f?.();return}Ue(i,t===l?u:null)},[u,l,Ue,f,e]);Re.current=$,Be.current=(0,z.useCallback)(e=>{if(G.current)return;if(Q.current>=V){Q.current=0,K.current.clear(),q.current.clear();return}let t=we*2**Q.current;G.current=setTimeout(()=>{G.current=null,Q.current+=1,Re.current(e).catch(t=>{U(H(t,m(`errors.load`))),K.current.size>0&&Be.current(e)})},t)},[m]);let We=(0,z.useCallback)(async t=>{let i=++J.current,a=null;do{let o=await ve(e,{limit:50,cursor:a,signal:t});if(i!==J.current)return;let s=o.items.find(e=>e.check_batch?.details?.target_kind===n&&e.check_batch.details.target_bundle_id===(n===`bundle`?r:null));if(s){Y.current=s.run.id,await $(s.run.id,t);return}a=o.next_cursor}while(a);!t?.aborted&&i===J.current&&(Y.current=null,W.current=null,v(null),D(null))},[$,e,r,n]),Ge=(0,z.useCallback)(async()=>{if(s||l){let e=Y.current;e&&await $(e);return}await We()},[l,s,$,We]);ze.current=Ge;let Ke=(0,z.useCallback)(e=>{G.current||=setTimeout(()=>{G.current=null,$(e).catch(e=>U(H(e,m(`errors.load`))))},we)},[$,m]);(0,z.useEffect)(()=>{let n=new AbortController;return A(!0),U(null),(async()=>{if(l){if(w(null),u){let t=await ge(e,u,n.signal);if(t.run.kind!==`check_attempt`||t.details.kind!==`check_attempt`||!t.details.available||!t.details.attempt||t.details.attempt.batch_run_id!==l){f?.();return}}Y.current=l,await $(l,n.signal);return}if(!s){w(null),await We(n.signal);return}let r=await t(e,s,n.signal);if(w(r),r.sourceBatchRunId){Y.current=r.sourceBatchRunId,await $(r.sourceBatchRunId,n.signal);return}Y.current=null,W.current=null,v(null),D(null)})().catch(e=>{le(e)||(e instanceof k&&e.status===404&&f?.(),U(H(e,m(`errors.load`))))}).finally(()=>{n.signal.aborted||(A(!1),Z.current=!1,X.current&&!G.current&&(X.current=!1,G.current=setTimeout(()=>{G.current=null,ze.current().catch(e=>U(H(e,m(`errors.load`))))},we)))}),()=>n.abort()},[u,l,s,$,We,f,e,m]),(0,z.useEffect)(()=>{let t=_?.batch.execution_run_id;if(!t){Le.current+=1,ue(null),me(new Set),I(new Set),ye(``);return}let n=++Le.current,r=new AbortController;return p(e,t,r.signal).then(e=>{n===Le.current&&e.batch_run_id===t&&Y.current===t&&Ve(e)}).catch(e=>{le(e)||U(H(e,m(`errors.diagnostics`)))}),()=>r.abort()},[_?.batch.execution_run_id,Pe,Ve,e,m]),(0,z.useEffect)(()=>{let t=t=>{if(t.project_id!==e)return;let n=Y.current;if(n!==null&&t.batch_run_id!==n)return;let r=W.current;if(!r||K.current.has(t.attempt_run_id)){He(t),r&&K.current.has(t.attempt_run_id)&&Be.current(r.batch.execution_run_id);return}let i=r.attempts.findIndex(e=>e.execution_run_id===t.attempt_run_id);if(i<0){He(t),Ke(r.batch.execution_run_id);return}let a=r.attempts[i],o=de(S(a),t);if(o.status===`ignored`)return;if(o.status===`refetch`){K.current.add(t.attempt_run_id),He(t),Be.current(r.batch.execution_run_id);return}let s=[...r.attempts];s[i]={...a,output_revision:o.snapshot.revision,retained_start_offset:o.snapshot.retainedStartOffset,retained_end_offset:o.snapshot.totalByteCount,total_persisted_bytes:o.snapshot.totalByteCount,retained_output:o.snapshot.retainedText};let c={...r,attempts:s};W.current=c,v(c)},n=t=>{if(t.project_id&&t.project_id!==e)return;if(Z.current){X.current=!0;return}let n=W.current,r=t.execution_run_id??t.id;if(Fe(e=>e+1),R&&r===R.execution_run_id&&re(e,R.execution_run_id).then(be).catch(()=>void 0),n&&(r===n.batch.execution_run_id||n.attempts.some(e=>e.execution_run_id===r))){J.current+=1,Ke(n.batch.execution_run_id);return}X.current=!0,!Z.current&&!G.current&&(X.current=!1,G.current=setTimeout(()=>{G.current=null,ze.current().catch(e=>U(H(e,m(`errors.load`))))},we))},r=()=>{Fe(e=>e+1),Ge().catch(e=>U(H(e,m(`errors.load`))))};return h.on(`check-attempt:output`,t),h.on(`execution-run:updated`,n),h.on(`lifecycle-event:created`,n),h.on(`connect`,r),()=>{h.off(`check-attempt:output`,t),h.off(`execution-run:updated`,n),h.off(`lifecycle-event:created`,n),h.off(`connect`,r)}},[R,He,e,Ge,Ke,h,m]),(0,z.useEffect)(()=>()=>{G.current&&clearTimeout(G.current),K.current.clear(),q.current.clear()},[]);let qe=e=>{J.current+=1,Y.current=e.batch.execution_run_id,Ue(e,null)},Je=async(e,t)=>{J.current+=1,Z.current=!0,se(e),U(null);try{qe(await t())}catch(t){U(H(t,m(`errors.${e}`))),t instanceof k&&t.status===409&&await Ge().catch(()=>void 0)}finally{se(null),Z.current=O,X.current&&!G.current&&(X.current=!1,G.current=setTimeout(()=>{G.current=null,ze.current().catch(e=>U(H(e,m(`errors.load`))))},we))}},Ye=_?Ce.has(_.batch.execution_status):!1,Xe=_?Ye?`running`:_.batch.execution_status===`completed`?`finished`:_.batch.execution_status===`cancelled`||_.batch.execution_status===`interrupted`?`interrupted`:`error`:`inactive`,Ze=[...g],Qe=new Set(a),$e=new Set(o),et=a.length,tt=o.length,nt=_?.attempts.filter(e=>e.execution_status!==`completed`).length??0,rt=async()=>{if(!(!N||F.size===0&&_e.size===0)){Ne(!0),U(null);try{let t=N.repair.accepts_ticket_id&&(L||N.repair.candidate_tickets[0]?.id)||null;be(await oe(e,[...F],[..._e],t))}catch(t){if(U(H(t,m(`errors.repair`))),t instanceof k&&t.status===409&&_){let t=_.batch.execution_run_id,n=++Le.current;p(e,t).then(e=>{n===Le.current&&e.batch_run_id===t&&Y.current===t&&Ve(e)}).catch(()=>void 0)}}finally{Ne(!1)}}},it=async()=>{if(R){Ne(!0),U(null);try{be(await fe(e,R.execution_run_id))}catch(e){U(H(e,m(`errors.repairStop`)))}finally{Ne(!1)}}},at=new Set([...N?.attempts.filter(e=>e.diagnostics.some(e=>F.has(e.id))).map(e=>e.attempt_run_id)??[],..._e]),ot=(e,t,n)=>{me(r=>{let i=new Set(r);if(!n)return i.delete(t),i;if(i.size>=De)return r;let a=new Set(N?.attempts.filter(e=>e.diagnostics.some(e=>i.has(e.id))).map(e=>e.attempt_run_id)??[]);return!a.has(e)&&a.size>=Oe?r:(i.add(t),i)})},st=(e,t)=>{I(n=>{let r=new Set(n);return t?!at.has(e)&&at.size>=Oe?n:(r.add(e),r):(r.delete(e),r)})};return(0,z.useEffect)(()=>{ee?.(Xe)},[Xe,ee]),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[Ie&&(0,B.jsx)(`p`,{role:`alert`,className:`mx-4 mt-3 rounded-xl border border-red-400/25 bg-red-500/10 px-3 py-2 text-sm text-red-200 sm:mx-6`,children:Ie}),(0,B.jsxs)(`div`,{className:`grid min-h-0 flex-1 overflow-hidden md:grid-cols-[19rem_minmax(0,1fr)]`,children:[(0,B.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto border-b border-border/70 p-4 md:border-r md:border-b-0 sm:p-5`,children:[(0,B.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:m(`configured`)}),(0,B.jsxs)(`div`,{className:`mt-3 rounded-xl border border-border/70 bg-background/35 p-3 text-xs text-muted-foreground`,children:[(0,B.jsx)(`p`,{className:`font-medium text-foreground`,children:m(`policySummary.title`)}),(0,B.jsx)(`p`,{className:`mt-1`,children:m(`policySummary.counts`,{requiredCount:et,preReviewCount:tt})}),(0,B.jsx)(`p`,{className:`mt-1`,children:m(`policySummary.projectPolicy`)})]}),(0,B.jsx)(`div`,{className:`mt-3 space-y-2`,children:i.map(e=>{let t=_?.attempts.find(t=>t.definition_id===e.id),n=Qe.has(e.id),r=$e.has(e.id);return(0,B.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-xl border border-border/60 bg-background/30 p-3`,children:[(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 accent-primary`,checked:g.has(e.id),onChange:t=>te(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:e.name}),(0,B.jsxs)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:[m(`category.${e.category}`),` · `,m(n?`required`:`optional`),` · `,m(r?`preReview`:`finalOnly`),t?` · ${m(`status.${t.execution_status}`)}`:``]})]})]},e.id)})}),(0,B.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,B.jsx)(c,{type:`button`,size:`sm`,disabled:Ze.length===0||Ye||M!==null,onClick:()=>void Je(`run`,()=>he(e,{targetKind:n,targetBundleId:r,definitionIds:Ze})),children:m(M===`run`?`starting`:`runSelected`)}),_&&Ye&&(0,B.jsx)(c,{type:`button`,variant:`destructive`,size:`sm`,disabled:M!==null,onClick:()=>void Je(`stop`,()=>C(e,_.batch.execution_run_id)),children:m(M===`stop`?`stopping`:`stop`)})]}),_&&!Ye&&(0,B.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,B.jsx)(c,{type:`button`,variant:`outline`,size:`xs`,disabled:M!==null,onClick:()=>void Je(`rerun`,()=>P(e,_.batch.execution_run_id,{mode:`all`})),children:m(`rerunAll`)}),(0,B.jsx)(c,{type:`button`,variant:`outline`,size:`xs`,disabled:M!==null||nt===0,onClick:()=>void Je(`rerun`,()=>P(e,_.batch.execution_run_id,{mode:`failed_only`})),children:m(`rerunFailed`)})]})]}),(0,B.jsxs)(`main`,{className:`min-h-0 overflow-y-auto p-4 sm:p-6`,children:[s&&!x&&O&&(0,B.jsx)(`p`,{role:`status`,className:`mb-4 text-sm text-muted-foreground`,children:m(`gateLoading`)}),x&&(0,B.jsxs)(`section`,{"aria-labelledby":`automated-delivery-gate-heading`,className:`mb-5 rounded-2xl border border-border/70 bg-background/30 p-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{id:`automated-delivery-gate-heading`,className:`font-semibold text-foreground`,children:m(`gateTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-muted-foreground`,children:m(`gateScope`)})]}),(0,B.jsx)(`span`,{className:y(`rounded-full border px-2.5 py-1 text-xs font-medium`,x.decision===`passed`&&x.presentApplicability.appliesToCurrentState===!0?Me.current:Me.blocked),children:m(x.presentApplicability.appliesToCurrentState===!1?`gateStale`:x.presentApplicability.appliesToCurrentState===null?`gateUnverifiable`:x.decision===`passed`?`gatePassed`:`gateBlocked`)})]}),(0,B.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:m(`gateBoundary.label`,{boundary:m(`gateBoundary.${x.boundaryKind}`)})}),(0,B.jsx)(`span`,{className:`break-all`,children:m(`gatePolicy`,{fingerprint:x.policy.fingerprint.slice(0,12)})}),(0,B.jsx)(`span`,{className:`break-all`,children:x.sourceBatchRunId?m(`gateSourceBatch`,{batchId:x.sourceBatchRunId}):m(`gateNoBatch`)})]}),x.reasonCodes.length>0&&(0,B.jsx)(`ul`,{className:`mt-3 space-y-1 text-sm text-muted-foreground`,children:x.reasonCodes.map(e=>(0,B.jsx)(`li`,{children:m(`reason.${e}`)},e))}),(0,B.jsx)(`div`,{className:`mt-4 space-y-2`,children:x.policy.definitions.map(e=>{let t=je(x,x.evaluatedAttempts.find(t=>t.definition_id===e.id));return(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-xl border border-border/60 p-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`break-words text-sm font-medium text-foreground`,children:e.name}),(0,B.jsx)(`code`,{className:`mt-1 block break-all text-xs text-muted-foreground`,children:e.command})]}),(0,B.jsx)(`span`,{className:y(`shrink-0 rounded-full border px-2 py-1 text-xs`,Me[t]),children:m(`evidence.${t}`)})]},e.id)})})]}),O&&(0,B.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:m(`loading`)}),!O&&!_&&(0,B.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border p-6 text-center`,children:[(0,B.jsx)(`h2`,{className:`font-medium text-foreground`,children:m(`emptyTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:m(`emptyDescription`)})]}),_&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1 text-xs text-muted-foreground`,children:m(`status.${_.batch.execution_status}`)}),(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m(`summary`,{passed:_.batch.passed_count,failed:_.batch.failed_count,running:_.batch.running_count,queued:_.batch.queued_count})}),_.batch.stop_requested&&(0,B.jsx)(`span`,{className:`text-xs text-amber-200`,children:m(`stopRequested`)})]}),(0,B.jsxs)(pe,{value:E??void 0,onValueChange:e=>{D(e),d?.(_.batch.execution_run_id,e)},children:[(0,B.jsx)(j,{className:`mt-4 flex flex-wrap gap-2 border-0 bg-transparent p-0`,"aria-label":m(`attempts`),children:_.attempts.map(e=>(0,B.jsx)(ie,{value:e.execution_run_id,tabIndex:E===e.execution_run_id?0:-1,className:y(`h-auto items-start border px-3 py-2 text-left text-xs data-[state=active]:ring-2 data-[state=active]:ring-ring/60`,ke(e)),children:(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`span`,{className:`block font-medium`,children:e.command_snapshot.name}),(0,B.jsx)(`span`,{className:`mt-0.5 block opacity-80`,children:m(`status.${e.execution_status}`)})]})},e.execution_run_id))}),_.attempts.map(e=>(0,B.jsx)(ce,{value:e.execution_run_id,className:`mt-5`,children:(0,B.jsxs)(`article`,{children:[(0,B.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:e.command_snapshot.name}),(0,B.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-sm sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:m(`command`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 break-words font-mono text-xs text-foreground`,children:e.command_snapshot.command})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:m(`directory`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.command_snapshot.cwd??m(`targetRoot`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:m(`outcome`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.outcome?m(`outcomeValue.${e.outcome}`):m(`status.${e.execution_status}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:m(`currencyLabel`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.currency?m(`currency.${e.currency}`):m(`currency.pending`)})]})]}),!Ae(e)&&(0,B.jsx)(Se,{attempt:e,diagnostics:N?.attempts.find(t=>t.attempt_run_id===e.execution_run_id)??null,repair:N?.repair??null,selectedDiagnosticIds:F,selectedRawOutputAttemptRunIds:_e,selectedAttemptRunIds:at,selectedTicketId:L,pending:xe,activeRepair:R,onSelectedTicketChange:ye,onToggleDiagnostic:(t,n)=>ot(e.execution_run_id,t,n),onToggleRawOutput:t=>st(e.execution_run_id,t),onStartRepair:()=>void rt(),onStopRepair:()=>void it()}),(0,B.jsx)(`h3`,{className:`mt-5 text-sm font-semibold text-foreground`,children:m(`output`)}),e.output_retention_state===`expired`?(0,B.jsx)(`p`,{className:`mt-2 rounded-xl border border-border bg-background/30 p-4 text-sm text-muted-foreground`,children:m(`outputExpired`)}):(0,B.jsx)(`pre`,{className:`mt-2 max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-xl border border-border bg-[#090b12] p-4 font-mono text-xs text-slate-200`,children:ae(e.retained_output)||m(`outputEmpty`)}),e.retained_start_offset>0&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:m(`outputTruncated`)})]})},e.execution_run_id))]})]})]})]})]})},Pe=(e,t)=>A(F(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),Fe=(e,t)=>A(F(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),Ie=(e,t={})=>A(F(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),U=(e,t)=>A(F(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),W=e=>A(F(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),G=e=>M(F(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),K=256*1024,q=24,J=(e,t)=>R.t(`common:testsDialog.${e}`,t),Le=(e,t)=>{let n=`${e}${t}`;return n.length<=K?n:n.slice(-K)},Y=(e,t)=>e?e.run_id&&t.run_id&&e.run_id!==t.run_id?e.status===`running`||t.status!==`running`?e:t:e.status!==`idle`&&e.status!==`running`&&t.status===`running`?e:e.run_id===t.run_id&&e.output.length>t.output.length?{...t,output:e.output,output_truncated:e.output_truncated||t.output_truncated}:t:t,X=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=q,Z=e=>{e.scrollTop=e.scrollHeight},Re=(e,t=!1)=>{Z(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{Z(e),t&&(r=window.requestAnimationFrame(()=>{Z(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},ze=e=>e===`running`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e===`passed`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e===`failed`||e===`error`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e===`stopped`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`,Be=e=>{if(e==null)return null;if(e<1e3)return`${e} ms`;let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m ${i}s`:r>0?`${r}m ${i}s`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`},Q=e=>{let t=e.split(`/`);return t[t.length-1]||e},Ve=e=>e.toLowerCase().trim().split(/\s+/).filter(Boolean),He=(e,t)=>e.length===0?!0:e.every(e=>t.some(t=>t.includes(e))),Ue=(e,t)=>{let n=Ve(t);return n.length===0?e:e.flatMap(e=>{let t=Q(e.path);if(He(n,[t.toLowerCase(),e.path.toLowerCase()]))return[e];let r=e.cases.filter(r=>He(n,[t.toLowerCase(),e.path.toLowerCase(),r.name.toLowerCase()]));return r.length===0?[]:[{...e,cases:r}]})},$=e=>J(e===`passed`?`status.passed`:e===`failed`?`status.failed`:e===`running`?`status.running`:e===`error`?`status.error`:e===`stopped`?`status.stopped`:`status.idle`),We=e=>e?.selection?e.selection.kind===`all`?J(`selection.allTests`):e.selection.kind===`case`?e.selection.name:Q(e.selection.path):J(`selection.noRunYet`),Ge=e=>/(^|\s)(?:FAIL|✗)(\s|$)|\b(?:failed|error|stderr|Expected:|Received:)\b/i.test(e)?`failure`:/(^|\s)(?:PASS|✓)(\s|$)|\bpassed\b/i.test(e)?`success`:/\b(?:WARN|warning|skipped|todo|pending)\b/i.test(e)?`warning`:`default`,Ke=e=>e===`failure`?`text-rose-200`:e===`success`?`text-emerald-200`:e===`warning`?`text-amber-200`:`text-slate-200`,qe=(e,t)=>e===t?!0:e.length===t.length?e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.name===r.name&&e.command===r.command&&e.cwd===r.cwd&&e.runner===r.runner}):!1,Je=`min-w-24 justify-center shadow-none transition-none disabled:opacity-100`,Ye=({line:e,tone:t})=>(0,B.jsx)(`div`,{"data-tone":t,className:y(`whitespace-pre-wrap break-words`,Ke(t)),children:e===``?` `:e}),Xe=(0,z.memo)(({canRunGranular:e,filePath:t,isActive:n,name:r,onRunCase:i})=>(0,B.jsxs)(`button`,{type:`button`,"aria-label":J(`caseRow.runAriaLabel`,{name:r}),title:r,className:y(`flex w-full min-w-0 items-center gap-2.5 rounded-xl px-2.5 py-1.5 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,e?`cursor-pointer hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,n&&`bg-sky-500/10`),disabled:!e,onClick:()=>{i(t,r)},children:[(0,B.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,B.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:r})]}));Xe.displayName=`TestCaseRow`;var Ze=(0,z.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:r,file:i,isExpanded:a,onRunCase:o,onRunFile:l,onToggleFile:u})=>{let d=e===`file`&&n===i.path,f=e===`case`&&n===i.path;return(0,B.jsx)(x,{open:a,onOpenChange:e=>{u(i.path,e)},children:(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(be,{asChild:!0,children:(0,B.jsx)(c,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":J(a?`fileRow.collapseAriaLabel`:`fileRow.expandAriaLabel`,{path:i.path}),className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,B.jsx)(m,{className:y(`h-4 w-4 transition-transform`,a&&`rotate-180`)})})}),(0,B.jsx)(`button`,{type:`button`,"aria-label":J(`fileRow.runAriaLabel`,{path:i.path}),className:y(`min-w-0 flex-1 rounded-xl border border-border/60 bg-background/20 px-2.5 py-2 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,r?`cursor-pointer hover:border-sky-400/35 hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,(d||f)&&`border-sky-400/45 bg-sky-500/10`),disabled:!r,onClick:()=>{l(i.path)},children:(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,B.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-sky-200`,children:(0,B.jsx)(s,{className:`h-3.5 w-3.5`})}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:Q(i.path)}),(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:i.path})]}),(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:J(`fileRow.testCount`,{count:i.cases.length})})]})]})})]}),(0,B.jsx)(I,{children:(0,B.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:i.cases.length===0?(0,B.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:J(`fileRow.noNamedTests`)}):(0,B.jsx)(`div`,{className:`space-y-1`,children:i.cases.map(a=>{let s=e===`case`&&n===i.path&&t===a.name;return(0,B.jsx)(Xe,{canRunGranular:r,filePath:i.path,isActive:s,name:a.name,onRunCase:o},a.id)})})})})]})})});Ze.displayName=`DiscoveryFileRow`;var Qe=(0,z.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:i,availableCommands:o,canRunGranular:s,discovery:l,expandedFiles:u,fullSuiteOnlyNotice:d,isLoading:ee,selectedCommandId:p,selectedCommandName:g,sessionError:te,sessionStatus:_,shouldShowCommandSelector:v,onRunCase:b,onRunFile:x,onSelectCommand:ne,onToggleFile:S})=>{let[C,w]=(0,z.useState)(``),T=(0,z.useMemo)(()=>Ue(l,C),[l,C]),E=(0,z.useMemo)(()=>T.reduce((e,t)=>e+t.cases.length,0),[T]),D=Ve(C).length>0;return(0,B.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,B.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[v&&(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:J(`scope.label`)}),(0,B.jsxs)(f,{children:[(0,B.jsx)(se,{asChild:!0,children:(0,B.jsxs)(c,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":J(`scope.selectedCommandAriaLabel`),disabled:o.length===0||_===`running`,children:[(0,B.jsx)(`span`,{className:`truncate`,children:g??J(`scope.selectTestScope`)}),(0,B.jsx)(m,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,B.jsx)(N,{align:`start`,className:`w-72`,children:o.map(e=>(0,B.jsx)(n,{className:y(p===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{ne(e.id)},children:(0,B.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),d&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:d}),(l.length>0||C.length>0)&&(0,B.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,B.jsx)(r,{type:`search`,value:C,onChange:e=>{w(e.target.value)},placeholder:J(`filter.placeholder`),"aria-label":J(`filter.ariaLabel`),className:`pr-10`}),C.length>0&&(0,B.jsx)(c,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":J(`filter.clearAriaLabel`),className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{w(``)},children:(0,B.jsx)(h,{className:`size-4`})})]}),!o.length&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-4 text-sm text-muted-foreground`,children:J(`discovery.noCommands`)}),te&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:te}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,B.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,B.jsx)(`div`,{className:`min-w-0`,children:(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[J(`discovery.fileCount`,{count:T.length}),`, `,J(`discovery.caseCount`,{count:E})]})}),ee&&(0,B.jsx)(a,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:l.length===0&&!ee?(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:J(`discovery.noFilesDetected`)}):T.length===0?(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:J(`discovery.noFilterMatches`)}):T.map(n=>(0,B.jsx)(Ze,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:i,canRunGranular:s,file:n,isExpanded:D||(u[n.path]??!1),onRunCase:b,onRunFile:x,onToggleFile:S},n.path))})]})]})})});Qe.displayName=`DiscoveryPane`;var $e=(0,z.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:a,viewportRef:o,onScroll:s})=>{let c=(0,z.useMemo)(()=>t?ae(t).replace(/\r\n/g,`
2
+ `).replace(/\r/g,`
3
+ `).split(`
4
+ `).map(e=>({line:e,tone:Ge(e)})):[],[t]);return(0,B.jsx)(`section`,{className:`min-h-0 px-4 py-4`,children:(0,B.jsxs)(`div`,{className:`flex h-full flex-col gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`font-medium text-foreground`,children:r}),i&&(0,B.jsx)(w,{variant:`outline`,className:y(`px-3 py-1 text-xs uppercase tracking-[0.2em]`,ze(i)),children:$(i)}),a&&(0,B.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-xs font-medium uppercase tracking-[0.18em]`,children:[(0,B.jsxs)(`span`,{className:`text-rose-200`,children:[a.failed.count,` `,a.failed.label]}),(0,B.jsxs)(`span`,{className:`text-emerald-200`,children:[a.passed.count,` `,a.passed.label]})]}),e!=null&&(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:Be(e)}),n&&(0,B.jsx)(w,{variant:`outline`,className:`border-amber-400/30 bg-amber-500/10 text-amber-200`,children:J(`output.trimmed`)})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-2xl border border-border/70 bg-[#0d1017]`,children:(0,B.jsx)(`div`,{ref:o,"aria-label":J(`output.ariaLabel`),className:`h-full overflow-auto px-4 py-4`,onScroll:s,children:(0,B.jsx)(`div`,{className:`font-mono text-xs leading-5`,children:c.length>0?c.map((e,t)=>(0,B.jsx)(Ye,{line:e.line,tone:e.tone},`${t}:${e.line}`)):(0,B.jsx)(`div`,{className:`text-slate-200`,children:J(`output.empty`)})})})})]})})});$e.displayName=`OutputPane`;var et=(0,z.forwardRef)(({testCommands:e,onStatusChange:t,onTargetLabelChange:n,onClose:r,...i},a)=>{let s=i.scope,u=i.projectId,f=i.scope===`ticket`?i.ticketId:null,p=i.scope===`project`?i.targetKind:null,m=i.scope===`project`?i.targetBundleId:null,[h,y]=(0,z.useState)(e),[b,x]=(0,z.useState)(null),[ne,S]=(0,z.useState)([]),[C,w]=(0,z.useState)(``),[T,D]=(0,z.useState)({}),[re,O]=(0,z.useState)(!0),[ie,A]=(0,z.useState)(!1),[j,M]=(0,z.useState)(!1),[ae,oe]=(0,z.useState)(null),[se,N]=(0,z.useState)(!1),[ce,le]=(0,z.useState)(!1),P=(0,z.useRef)(null),de=(0,z.useRef)(!1),fe=(0,z.useRef)(null),pe=(0,z.useRef)(!0),F=(0,z.useRef)(null),he=(0,z.useRef)(null),ge=b?.selection?.kind??null,_e=b?.selection?.kind===`all`?null:b?.selection?.path??null,ve=b?.selection?.kind===`case`?b.selection.name:null,I=b?.id??null,L=b?.status??null,R=(0,z.useMemo)(()=>h.find(e=>e.id===C)??null,[h,C]),be=(0,z.useMemo)(()=>{if(b?.summary?.failed_count==null&&b?.summary?.passed_count==null&&b?.summary?.failed_file_count==null&&b?.summary?.passed_file_count==null)return null;let e=b?.summary?.failed_count==null&&b?.summary?.passed_count==null;return{failed:L===`failed`&&b?.summary?.failed_count==null&&b?.summary?.failed_file_count!=null||e?{count:b?.summary?.failed_file_count??0,label:J(`summaryCounts.filesFailed`)}:{count:b?.summary?.failed_count??0,label:J(`summaryCounts.failed`)},passed:e?{count:b?.summary?.passed_file_count??0,label:J(`summaryCounts.filesPassed`)}:{count:b?.summary?.passed_count??b?.summary?.passed_file_count??0,label:J(`summaryCounts.passed`)}}},[b?.summary?.failed_count,b?.summary?.passed_count,b?.summary?.failed_file_count,b?.summary?.passed_file_count,L]),xe=R?.runner===`unknown`?J(`scope.fullSuiteOnlyNotice`):null,Se=!!(R&&b?.status!==`running`&&!ie&&!j),Ce=Se,we=Se&&ce,Te=h.length>1,{runs:Ee}=ue(u),V=b?.run_id?Ee.find(e=>e.id===b.run_id)??null:null;(0,z.useEffect)(()=>{C||h.length===0||w(h[0]?.id??``)},[h,C]),(0,z.useEffect)(()=>{e.length>0&&y(t=>qe(t,e)?t:e)},[e]),(0,z.useEffect)(()=>{if(h.length>0||!u)return;let e=new AbortController;return v(e.signal).then(e=>{let t=e.find(e=>e.id===u);t&&y(e=>{let n=E(t);return qe(e,n)?e:n})}).catch(()=>{}),()=>{e.abort()}},[h.length,u]),(0,z.useEffect)(()=>{let e=e=>{!e||e.id!==P.current||x(t=>Y(t,e))},t=e=>{!e||e.session_id!==P.current||x(t=>!t||t.id!==e.session_id||e.run_id&&t.run_id&&e.run_id!==t.run_id?t:{...t,output:Le(t.output,e.chunk),output_truncated:e.output_truncated})};return ye.on(`test-session:updated`,e),ye.on(`test-session:output`,t),()=>{ye.off(`test-session:updated`,e),ye.off(`test-session:output`,t)}},[]),(0,z.useEffect)(()=>{let e=fe.current;if(!e){F.current=b?.output??null,he.current=b?.status??null;return}let t=F.current!==(b?.output??null),n=he.current!==`running`&&b?.status===`running`,r=he.current===`running`&&b?.status!==`running`;if(n&&(pe.current=!0),n||t&&b?.status===`running`&&pe.current||r&&pe.current){let t=Re(e,r);return F.current=b?.output??null,he.current=b?.status??null,t}F.current=b?.output??null,he.current=b?.status??null},[b?.output,b?.status]),(0,z.useEffect)(()=>{let e=!1;return(async()=>{try{let t;if(s===`project`){if(!u)return;t=await Pe(u,{target_kind:p??`repo_root`,target_bundle_id:m??null})}else t=await Fe(f??``,u);if(e){G(t.id).catch(()=>{});return}P.current=t.id,x(t)}catch(t){e||oe(t instanceof k?t.message:J(`messages.loadRunnerError`))}finally{!e&&P.current==null&&O(!1)}})(),()=>{e=!0}},[u,s,m,p,f]),(0,z.useEffect)(()=>{V&&x(e=>{if(!e||e.run_id!==V.id)return e;let t=V.status===`completed`?`passed`:V.status===`failed`?`failed`:V.status===`cancelled`||V.status===`interrupted`?`stopped`:`running`;return e.status===t&&e.error===(V.failure?.message??e.error)?e:{...e,status:t,error:V.failure?.message??e.error,started_at:V.started_at??e.started_at,completed_at:V.completed_at??e.completed_at}})},[V]),(0,z.useEffect)(()=>{if(!b?.id){le(!1);return}if(h.length>0&&!C){le(!1);return}let e=new AbortController,t=!1;return O(!0),le(!1),Ie(b.id,{commandId:C||null,signal:e.signal}).then(e=>{t||(S(e.files),le(e.supports_granular_selection))}).catch(n=>{t||e.signal.aborted||oe(n instanceof k?n.message:J(`messages.discoverError`))}).finally(()=>{t||O(!1)}),()=>{t=!0,e.abort()}},[h.length,C,b?.id]),(0,z.useEffect)(()=>()=>{let e=P.current;!e||de.current||(de.current=!0,G(e).catch(()=>{}))},[]);let De=(0,z.useCallback)(async e=>{if(!(!I||L===`running`||!R||ie||j)){oe(null),A(!0);try{let t=await U(I,{command_id:R.id,selection:e});x(e=>Y(e,t))}catch(e){oe(e instanceof k?e.message:J(`messages.startError`))}finally{A(!1)}}},[ie,j,R,I,L]),Oe=(0,z.useCallback)(async()=>{if(!(!I||L!==`running`||j)){oe(null),M(!0);try{let e=await W(I);x(t=>Y(t,e))}catch(e){oe(e instanceof k?e.message:J(`messages.stopError`))}finally{M(!1)}}},[j,I,L]),H=(0,z.useCallback)(()=>{let e=P.current;if(!e||de.current){r();return}de.current=!0,r(),G(e).catch(()=>{})},[r]),ke=(0,z.useCallback)(()=>{if(L===`running`){N(!0);return}H()},[H,L]);(0,z.useImperativeHandle)(a,()=>({requestClose:ke}),[ke]),(0,z.useEffect)(()=>{t?.(L===`running`?`running`:L===`passed`?`finished`:L===`failed`||L===`error`?`error`:L===`stopped`?`interrupted`:`inactive`)},[t,L]),(0,z.useEffect)(()=>{b?.target_label&&n?.(b.target_label)},[n,b?.target_label]);let Ae=(0,z.useCallback)(()=>{let e=fe.current;e&&(pe.current=X(e))},[]),je=(0,z.useCallback)(e=>{w(e)},[]),Me=(0,z.useCallback)((e,t)=>{D(n=>(n[e]??!1)===t?n:{...n,[e]:t})},[]),Ne=(0,z.useCallback)(e=>{De({kind:`file`,path:e})},[De]),K=(0,z.useCallback)((e,t)=>{De({kind:`case`,path:e,name:t})},[De]);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,"data-testid":`tests-panel-layout`,children:[(0,B.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-0 lg:grid-cols-[22rem_minmax(0,1fr)] lg:grid-rows-1`,children:[(0,B.jsx)(Qe,{activeSelectionKind:ge,activeSelectionName:ve,activeSelectionPath:_e,availableCommands:h,canRunGranular:we,discovery:ne,expandedFiles:T,fullSuiteOnlyNotice:xe,isLoading:re,selectedCommandId:C,selectedCommandName:R?.name??null,sessionError:ae,sessionStatus:L,shouldShowCommandSelector:Te,onRunCase:K,onRunFile:Ne,onSelectCommand:je,onToggleFile:Me}),(0,B.jsx)($e,{durationMs:b?.duration_ms??null,output:b?.output??``,outputTruncated:b?.output_truncated??!1,selectionLabel:We(b),status:L,summaryCounts:be,viewportRef:fe,onScroll:Ae})]}),(0,B.jsx)(o,{className:`shrink-0 border-t border-border/70 px-6 py-4 sm:flex-row sm:items-center sm:justify-end`,children:(0,B.jsx)(`div`,{className:`flex items-center justify-end gap-2`,children:b?.status===`running`?(0,B.jsxs)(c,{type:`button`,variant:`destructive`,className:Je,onClick:()=>{Oe()},disabled:j,children:[(0,B.jsx)(d,{className:`h-4 w-4`}),(0,B.jsx)(`span`,{children:J(`actions.stop`)})]}):(0,B.jsxs)(c,{type:`button`,variant:`success`,className:Je,disabled:!Ce,onClick:()=>{De({kind:`all`})},children:[(0,B.jsx)(ee,{className:`h-4 w-4`}),(0,B.jsx)(`span`,{children:J(`actions.run`)})]})})})]}),(0,B.jsx)(te,{open:se,onOpenChange:N,children:(0,B.jsxs)(g,{showCloseButton:!1,overlayClassName:`z-[60] bg-black/60`,className:`z-[60] max-w-md rounded-2xl border border-border bg-card p-6 shadow-2xl`,children:[(0,B.jsxs)(l,{children:[(0,B.jsx)(me,{className:`text-sm font-semibold uppercase tracking-widest text-muted-foreground`,children:J(`closeConfirmation.title`)}),(0,B.jsx)(_,{className:`text-sm text-foreground whitespace-pre-line`,children:J(`closeConfirmation.description`)})]}),(0,B.jsxs)(o,{className:`sm:flex-row sm:justify-end`,children:[(0,B.jsx)(c,{type:`button`,variant:`ghost`,onClick:()=>N(!1),children:J(`closeConfirmation.keepRunning`)}),(0,B.jsx)(c,{type:`button`,variant:`destructive`,onClick:()=>{N(!1),H()},children:J(`closeConfirmation.stopAndClose`)})]})]})})]})});et.displayName=`TestsPanel`;var tt=`archon.verification-tab`,nt=()=>{try{let e=window.localStorage.getItem(tt);return e===`checks`||e===`tests`?e:null}catch{return null}},rt=e=>{try{window.localStorage.setItem(tt,e)}catch{}},it=({targetLabel:e,definitions:t,requiredDefinitionIds:n=[],preReviewDefinitionIds:r=[],checksTarget:a,testsTarget:o,onClose:s,onOpenActivity:l,requestedInitialTab:d,directBatchRunId:f,directAttemptRunId:ee,onCheckSelectionChange:p,onUnavailable:m})=>{let{t:v}=ne(`common`,{keyPrefix:`verificationDialog`}),y=O(t),b=a!==null&&(t.length>0||!!a.gateEvaluationId||!!f),x=o!==null&&y.length>0,[S,C]=(0,z.useState)(()=>{if(d===`checks`&&b||d===`tests`&&x)return d;let e=nt();return e===`checks`&&b||e===`tests`&&x?e:b?`checks`:`tests`}),[w,T]=(0,z.useState)(`inactive`),[E,D]=(0,z.useState)(`inactive`),re=(0,z.useRef)(null),k=(0,z.useRef)(null);(0,z.useEffect)(()=>{(S===`checks`&&!b||S===`tests`&&!x)&&C(b?`checks`:`tests`)},[S,b,x]);let A=e=>{if(k.current=e??null,o){let e=re.current;if(e){e.requestClose();return}}(e??s)()},M=()=>{let e=k.current??s;k.current=null,e()};return(0,B.jsx)(te,{open:!0,onOpenChange:e=>{e||A()},children:(0,B.jsxs)(g,{showCloseButton:!1,className:`flex h-[calc(100vh-1rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl p-0 sm:h-[calc(100vh-2rem)] sm:max-w-7xl`,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.stopPropagation(),children:[(0,B.jsx)(me,{className:`sr-only`,children:v(`title`)}),(0,B.jsx)(_,{className:`sr-only`,children:v(`description`)}),(0,B.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-border/70 px-4 py-4 sm:px-6`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 gap-3`,children:[(0,B.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border bg-background/60 text-sky-200`,children:(0,B.jsx)(u,{className:`size-5`})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:v(`title`)}),(0,B.jsx)(`p`,{className:`truncate text-sm text-muted-foreground`,children:e})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&(0,B.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>A(l),children:v(`openActivity`)}),(0,B.jsx)(c,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":v(`close`),onClick:()=>A(),children:(0,B.jsx)(h,{className:`size-4`})})]})]}),(0,B.jsxs)(pe,{value:S,onValueChange:e=>{e!==`checks`&&e!==`tests`||(C(e),rt(e))},className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`shrink-0 border-b border-border/70 px-4 py-3 sm:px-6`,children:[(0,B.jsxs)(j,{"aria-label":v(`tabsAriaLabel`),children:[b&&(0,B.jsxs)(ie,{value:`checks`,className:`gap-2`,children:[(0,B.jsx)(u,{className:`size-4`}),(0,B.jsx)(`span`,{children:v(`tabs.checks.label`)}),(0,B.jsx)(`span`,{className:`inline-flex shrink-0`,role:`status`,"aria-label":v(`status.checks.${w}`),children:(0,B.jsx)(i,{state:w})})]}),x&&(0,B.jsxs)(ie,{value:`tests`,className:`gap-2`,children:[(0,B.jsx)(_e,{className:`size-4`}),(0,B.jsx)(`span`,{children:v(`tabs.tests.label`)}),(0,B.jsx)(`span`,{className:`inline-flex shrink-0`,role:`status`,"aria-label":v(`status.tests.${E}`),children:(0,B.jsx)(i,{state:E})})]})]}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:v(`tabs.${S}.description`)})]}),b&&a&&(0,B.jsx)(ce,{value:`checks`,forceMount:!0,className:`mt-0 flex min-h-0 flex-1 flex-col overflow-hidden data-[state=inactive]:hidden`,children:(0,B.jsx)(Ne,{...a,definitions:t,requiredDefinitionIds:n,preReviewDefinitionIds:r,directBatchRunId:f,directAttemptRunId:ee,onSelectionChange:S===`checks`?p:void 0,onUnavailable:m,onStatusChange:T})}),o&&y.length>0&&(0,B.jsx)(ce,{value:`tests`,forceMount:!0,className:`mt-0 flex min-h-0 flex-1 flex-col overflow-hidden data-[state=inactive]:hidden`,children:(0,B.jsx)(et,{ref:re,...o,testCommands:y,onStatusChange:D,onClose:M})})]})]})})};export{it as VerificationDialog};