@straiffi/archon 1.8.19 → 1.8.21

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 (139) hide show
  1. package/dist/client/assets/{ActivityView-BaoAJ8JM.js → ActivityView-BcguXTZ5.js} +1 -1
  2. package/dist/client/assets/GitHubActionsDialog-BGecTzoq.js +1 -0
  3. package/dist/client/assets/VerificationDialog-D4QkMLZr.js +4 -0
  4. package/dist/client/assets/{architectureDiagram-3BPJPVTR-8hDT9YFW.js → architectureDiagram-3BPJPVTR-DnC7Twj0.js} +1 -1
  5. package/dist/client/assets/{blockDiagram-GPEHLZMM-DrSgZhh1.js → blockDiagram-GPEHLZMM-D0VbjiKd.js} +1 -1
  6. package/dist/client/assets/{c4Diagram-AAUBKEIU-BjowoLmV.js → c4Diagram-AAUBKEIU-CzQ3l15K.js} +1 -1
  7. package/dist/client/assets/channel-BwRO4uiw.js +1 -0
  8. package/dist/client/assets/{chunk-2J33WTMH-BwZDhXTf.js → chunk-2J33WTMH-B5UGiqLW.js} +1 -1
  9. package/dist/client/assets/{chunk-3OPIFGDE-CVc43Ukf.js → chunk-3OPIFGDE-SCksTqtu.js} +1 -1
  10. package/dist/client/assets/{chunk-5ZQYHXKU-D5FDCGhy.js → chunk-5ZQYHXKU-IOkwLOtG.js} +1 -1
  11. package/dist/client/assets/{chunk-727SXJPM-CJSR5Mh2.js → chunk-727SXJPM-Do60Xs9p.js} +1 -1
  12. package/dist/client/assets/{chunk-AQP2D5EJ-B6kTsClX.js → chunk-AQP2D5EJ-CuQT3imB.js} +1 -1
  13. package/dist/client/assets/{chunk-CSCIHK7Q-C5UH_dAR.js → chunk-CSCIHK7Q-BkxMIESX.js} +1 -1
  14. package/dist/client/assets/{chunk-KSCS5N6A-D_rzcB2b.js → chunk-KSCS5N6A-uUU3sWgR.js} +1 -1
  15. package/dist/client/assets/{chunk-L5ZTLDWV-CztP7jdd.js → chunk-L5ZTLDWV-DLYccV6J.js} +1 -1
  16. package/dist/client/assets/{chunk-LZXEDZCA-wTLCL7Pg.js → chunk-LZXEDZCA-CgJFfCRZ.js} +2 -2
  17. package/dist/client/assets/{chunk-ND2GUHAM-B5AHIrUy.js → chunk-ND2GUHAM-D7IQSQfK.js} +1 -1
  18. package/dist/client/assets/{chunk-NZK2D7GU-D3MtrIk4.js → chunk-NZK2D7GU-B4O6JWAo.js} +1 -1
  19. package/dist/client/assets/{chunk-O5CBEL6O-iIPXNV3t.js → chunk-O5CBEL6O-DidlQEqb.js} +1 -1
  20. package/dist/client/assets/{chunk-WU5MYG2G-Cwu-Oylq.js → chunk-WU5MYG2G-2-oq_Gue.js} +1 -1
  21. package/dist/client/assets/classDiagram-4FO5ZUOK-BIszcze-.js +1 -0
  22. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-D5dvxldS.js +1 -0
  23. package/dist/client/assets/{dagre-BM42HDAG-D3wiIOnk.js → dagre-BM42HDAG-TubuN0hR.js} +1 -1
  24. package/dist/client/assets/{diagram-2AECGRRQ-Bysb-ntU.js → diagram-2AECGRRQ-DNcUk6rV.js} +1 -1
  25. package/dist/client/assets/{diagram-5GNKFQAL-CtS_bpE5.js → diagram-5GNKFQAL-B1sJn4w_.js} +1 -1
  26. package/dist/client/assets/{diagram-KO2AKTUF-_PI56fZq.js → diagram-KO2AKTUF-CnW6ZuQe.js} +1 -1
  27. package/dist/client/assets/{diagram-LMA3HP47-BNgWnFoz.js → diagram-LMA3HP47-YHUmDzyS.js} +1 -1
  28. package/dist/client/assets/{diagram-OG6HWLK6-BM-wG_lJ.js → diagram-OG6HWLK6-BkOQphxq.js} +1 -1
  29. package/dist/client/assets/{erDiagram-TEJ5UH35-BPqNBsVc.js → erDiagram-TEJ5UH35-oNMxAdxN.js} +1 -1
  30. package/dist/client/assets/{flowDiagram-I6XJVG4X-BgA6MiBD.js → flowDiagram-I6XJVG4X-ByuCV-Am.js} +1 -1
  31. package/dist/client/assets/{ganttDiagram-6RSMTGT7-BMDzgC7L.js → ganttDiagram-6RSMTGT7-CRkNH8Ft.js} +1 -1
  32. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-C0cZUYmG.js → gitGraphDiagram-PVQCEYII-DRXzXjd8.js} +1 -1
  33. package/dist/client/assets/index-CYPgEn1h.css +2 -0
  34. package/dist/client/assets/index-Ck2OKMsl.js +276 -0
  35. package/dist/client/assets/{infoDiagram-5YYISTIA-DelAWwhC.js → infoDiagram-5YYISTIA-CJ4-hWch.js} +1 -1
  36. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-D62h0NJG.js → ishikawaDiagram-YF4QCWOH-CW1xqvim.js} +1 -1
  37. package/dist/client/assets/{journeyDiagram-JHISSGLW-BXwYQf_j.js → journeyDiagram-JHISSGLW-BVVFg8_h.js} +1 -1
  38. package/dist/client/assets/{kanban-definition-UN3LZRKU-x5KfcIYo.js → kanban-definition-UN3LZRKU-AcLZ63tA.js} +1 -1
  39. package/dist/client/assets/{line-Blzshjst.js → line-CG_TG6Ci.js} +1 -1
  40. package/dist/client/assets/{mermaid-parser.core-Dnu-fpL9.js → mermaid-parser.core-UDLSm_c3.js} +1 -1
  41. package/dist/client/assets/{mermaid.core-BngDHztH.js → mermaid.core-IvBk22DF.js} +3 -3
  42. package/dist/client/assets/{mindmap-definition-RKZ34NQL-BRB9WnNL.js → mindmap-definition-RKZ34NQL-BflWNtnl.js} +1 -1
  43. package/dist/client/assets/{pieDiagram-4H26LBE5-Ddzhxmp2.js → pieDiagram-4H26LBE5-Dm1iGMm7.js} +1 -1
  44. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-CWKRt2y6.js → quadrantDiagram-W4KKPZXB-CM4zJd_R.js} +1 -1
  45. package/dist/client/assets/{requirementDiagram-4Y6WPE33-D309qLEz.js → requirementDiagram-4Y6WPE33-miuP86cp.js} +1 -1
  46. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-0Ukkluzd.js → sankeyDiagram-5OEKKPKP-zUcRagtr.js} +1 -1
  47. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-DkvDbOkQ.js → sequenceDiagram-3UESZ5HK-BRYqVpsT.js} +1 -1
  48. package/dist/client/assets/{stateDiagram-AJRCARHV-LRTZRjK3.js → stateDiagram-AJRCARHV-DwcF0DJm.js} +1 -1
  49. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-DmICWsmn.js +1 -0
  50. package/dist/client/assets/{timeline-definition-PNZ67QCA-CTwwDhpg.js → timeline-definition-PNZ67QCA-BzH929s_.js} +1 -1
  51. package/dist/client/assets/{vennDiagram-CIIHVFJN-BqldUpJn.js → vennDiagram-CIIHVFJN-BIq8rooy.js} +1 -1
  52. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-DPCPZAsx.js → wardleyDiagram-YWT4CUSO-CyV_gL5J.js} +1 -1
  53. package/dist/client/assets/{xychartDiagram-2RQKCTM6-DWkIjgNu.js → xychartDiagram-2RQKCTM6-Dxo-U-qe.js} +1 -1
  54. package/dist/client/index.html +2 -2
  55. package/dist/server/db.js +431 -1
  56. package/dist/server/db.js.map +1 -1
  57. package/dist/server/index.js +77 -17
  58. package/dist/server/index.js.map +1 -1
  59. package/dist/server/lib/agent.js +8 -4
  60. package/dist/server/lib/agent.js.map +1 -1
  61. package/dist/server/lib/agentProvider.js +8 -1
  62. package/dist/server/lib/agentProvider.js.map +1 -1
  63. package/dist/server/lib/automationProgression.js +44 -14
  64. package/dist/server/lib/automationProgression.js.map +1 -1
  65. package/dist/server/lib/buildCompletionContinuation.js +14 -3
  66. package/dist/server/lib/buildCompletionContinuation.js.map +1 -1
  67. package/dist/server/lib/buildExecutionEnvironment.js +226 -59
  68. package/dist/server/lib/buildExecutionEnvironment.js.map +1 -1
  69. package/dist/server/lib/buildOpenQuestionOperations.js +47 -3
  70. package/dist/server/lib/buildOpenQuestionOperations.js.map +1 -1
  71. package/dist/server/lib/buildSequences.js +267 -18
  72. package/dist/server/lib/buildSequences.js.map +1 -1
  73. package/dist/server/lib/buildSetupAuthority.js +138 -0
  74. package/dist/server/lib/buildSetupAuthority.js.map +1 -0
  75. package/dist/server/lib/bundleReviewOperations.js +15 -4
  76. package/dist/server/lib/bundleReviewOperations.js.map +1 -1
  77. package/dist/server/lib/dockerSandboxCredentials.js +64 -10
  78. package/dist/server/lib/dockerSandboxCredentials.js.map +1 -1
  79. package/dist/server/lib/dockerSandboxExecutionProvider.js +11 -2
  80. package/dist/server/lib/dockerSandboxExecutionProvider.js.map +1 -1
  81. package/dist/server/lib/executionCredentialCapabilities.js +106 -0
  82. package/dist/server/lib/executionCredentialCapabilities.js.map +1 -0
  83. package/dist/server/lib/executionEnvironment.js.map +1 -1
  84. package/dist/server/lib/executionEnvironmentContexts.js +55 -1
  85. package/dist/server/lib/executionEnvironmentContexts.js.map +1 -1
  86. package/dist/server/lib/executionEnvironmentRoutes.js +76 -5
  87. package/dist/server/lib/executionEnvironmentRoutes.js.map +1 -1
  88. package/dist/server/lib/executionEnvironmentValidation.js +116 -44
  89. package/dist/server/lib/executionEnvironmentValidation.js.map +1 -1
  90. package/dist/server/lib/executionEnvironmentValidationOperations.js +48 -8
  91. package/dist/server/lib/executionEnvironmentValidationOperations.js.map +1 -1
  92. package/dist/server/lib/executionEnvironments.js +92 -9
  93. package/dist/server/lib/executionEnvironments.js.map +1 -1
  94. package/dist/server/lib/executionProfileRoutes.js +67 -0
  95. package/dist/server/lib/executionProfileRoutes.js.map +1 -0
  96. package/dist/server/lib/executionProfileStore.js +108 -0
  97. package/dist/server/lib/executionProfileStore.js.map +1 -0
  98. package/dist/server/lib/executionProfiles.js +201 -0
  99. package/dist/server/lib/executionProfiles.js.map +1 -0
  100. package/dist/server/lib/executionReconciliation.js +151 -66
  101. package/dist/server/lib/executionReconciliation.js.map +1 -1
  102. package/dist/server/lib/executionRetry.js +24 -5
  103. package/dist/server/lib/executionRetry.js.map +1 -1
  104. package/dist/server/lib/executionRunAuthority.js +299 -0
  105. package/dist/server/lib/executionRunAuthority.js.map +1 -0
  106. package/dist/server/lib/executionRuns.js +4 -0
  107. package/dist/server/lib/executionRuns.js.map +1 -1
  108. package/dist/server/lib/git.js +25 -0
  109. package/dist/server/lib/git.js.map +1 -1
  110. package/dist/server/lib/hostExecutionEnvironment.js +7 -1
  111. package/dist/server/lib/hostExecutionEnvironment.js.map +1 -1
  112. package/dist/server/lib/integrations/github.js +44 -0
  113. package/dist/server/lib/integrations/github.js.map +1 -1
  114. package/dist/server/lib/projects.js +1 -0
  115. package/dist/server/lib/projects.js.map +1 -1
  116. package/dist/server/lib/run.js +58 -2
  117. package/dist/server/lib/run.js.map +1 -1
  118. package/dist/server/lib/ticketFollowUpOperations.js +32 -6
  119. package/dist/server/lib/ticketFollowUpOperations.js.map +1 -1
  120. package/dist/server/lib/transcriptRuns.js +3 -0
  121. package/dist/server/lib/transcriptRuns.js.map +1 -1
  122. package/dist/server/lib/types.js.map +1 -1
  123. package/dist/server/lib/workspaceProcessEnvironment.js +72 -1
  124. package/dist/server/lib/workspaceProcessEnvironment.js.map +1 -1
  125. package/dist/server/workers/build.js +214 -46
  126. package/dist/server/workers/build.js.map +1 -1
  127. package/dist/server/workers/followUp.js +74 -1
  128. package/dist/server/workers/followUp.js.map +1 -1
  129. package/dist/server/workers/review.js +15 -4
  130. package/dist/server/workers/review.js.map +1 -1
  131. package/package.json +1 -1
  132. package/dist/client/assets/GitHubActionsDialog-D7iT7xTt.js +0 -1
  133. package/dist/client/assets/VerificationDialog-ayyiyvGt.js +0 -4
  134. package/dist/client/assets/channel-CGc3oFdr.js +0 -1
  135. package/dist/client/assets/classDiagram-4FO5ZUOK-CBhybRSO.js +0 -1
  136. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-C9ErMU7v.js +0 -1
  137. package/dist/client/assets/index-Ci2Or91O.js +0 -275
  138. package/dist/client/assets/index-CsZfTdMO.css +0 -2
  139. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-BDLRoPbQ.js +0 -1
@@ -1 +1 @@
1
- import{dt as e,r as t}from"./index-Ci2Or91O.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};
1
+ import{ft as e,r as t}from"./index-Ck2OKMsl.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,D as r,E as i,F as a,G as o,H as s,I as c,J as l,N as u,S as d,T as f,U as p,V as m,W as h,X as g,Y as _,ct as ee,d as v,dt as te,ft as y,ht as ne,lt as b,pt as x,ut as re,w as ie,x as S,yt as C}from"./index-Ck2OKMsl.js";var w=e(C(),1),T=y(),E=`https://docs.github.com/en/actions`,ae=5e3,D=(e,t)=>i.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 i=e.state===`active`,o=t?.dispatchable??!0,s=i&&o&&!t?.isLoading,l=e.path.split(`/`).pop();return(0,T.jsxs)(`div`,{className:g(`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,T.jsx)(`p`,{className:`line-clamp-2 break-words text-sm font-medium text-foreground`,children:e.name}),(0,T.jsx)(`p`,{className:`min-w-0 break-words text-[11px] text-muted-foreground`,children:l}),(0,T.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,T.jsx)(S,{variant:`outline`,className:g(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,i?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:`border-border/70 bg-background/60 text-muted-foreground`),children:D(i?`workflows.stateActive`:`workflows.stateDisabled`)}),(0,T.jsxs)(_,{type:`button`,variant:n?`secondary`:`outline`,size:`sm`,className:`h-8 gap-1.5 px-3 text-xs`,disabled:!s,"aria-label":D(`workflows.runAriaLabel`,{name:e.name}),title:!o&&t?D(`inputs.notDispatchable`):void 0,onClick:r,children:[t?.isLoading?(0,T.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}):(0,T.jsx)(a,{className:`h-3.5 w-3.5`}),(0,T.jsx)(`span`,{children:D(`actions.run`)})]})]})]})},I=({workflow:e,inputsState:n,refValue:r,onRefChange:i,values:o,onValueChange:s,isDispatching:l,onDispatch:u,onCancel:d})=>{let p=n.inputs.filter(e=>e.required&&!L(o[e.name],e)),h=n.dispatchable&&!n.isLoading&&!n.error&&r.trim()!==``&&p.length===0&&!l;return(0,T.jsxs)(`div`,{className:`space-y-4 rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:D(`inputs.title`)}),(0,T.jsx)(`p`,{className:`mt-0.5 truncate text-sm font-medium text-foreground`,children:e.name})]}),(0,T.jsx)(_,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":D(`actions.cancel`),onClick:d,children:(0,T.jsx)(f,{className:`h-4 w-4`})})]}),(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(t,{htmlFor:`github-actions-ref`,children:D(`inputs.refLabel`)}),(0,T.jsx)(m,{id:`github-actions-ref`,type:`text`,value:r,onChange:e=>{i(e.target.value)},placeholder:D(`inputs.refPlaceholder`),"aria-label":D(`inputs.refAriaLabel`)})]}),n.isLoading&&(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,T.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}),(0,T.jsx)(`span`,{children:D(`inputs.loading`)})]}),n.error&&(0,T.jsx)(`p`,{className:`text-xs text-rose-200`,children:n.error}),!n.dispatchable&&!n.isLoading&&!n.error&&(0,T.jsx)(`p`,{className:`text-xs text-amber-200`,children:D(`inputs.notDispatchable`)}),n.inputs.map(e=>(0,T.jsx)(R,{input:e,value:o[e.name],onChange:t=>{s(e.name,t)}},e.name)),p.length>0&&(0,T.jsx)(`p`,{className:`text-xs text-rose-200`,children:D(`inputs.requiredValidationError`)}),(0,T.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,T.jsx)(_,{type:`button`,variant:`ghost`,onClick:d,disabled:l,children:D(`actions.cancel`)}),(0,T.jsxs)(_,{type:`button`,variant:`success`,onClick:u,disabled:!h,children:[l?(0,T.jsx)(c,{className:`h-4 w-4 animate-spin`}):(0,T.jsx)(a,{className:`h-4 w-4`}),(0,T.jsx)(`span`,{children:D(`actions.dispatch`)})]})]})]})},L=(e,t)=>t.type===`boolean`?typeof e==`boolean`:typeof e==`string`&&e.trim()!==``,R=({input:e,value:n,onChange:r})=>{let i=`github-actions-input-${e.name}`;return(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsxs)(t,{htmlFor:i,className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{children:e.name}),e.required&&(0,T.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.18em] text-rose-200/80`,children:D(`inputs.requiredLabel`)})]}),e.description&&(0,T.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.description}),z(e,i,n,r)]})},z=(e,t,n,r)=>{if(e.type===`boolean`){let i=typeof n==`boolean`?n:e.default===!0;return(0,T.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,T.jsx)(v,{id:t,checked:i,onCheckedChange:e=>{r(e)}}),(0,T.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:D(i?`inputs.booleanYes`:`inputs.booleanNo`)})]})}if(e.type===`choice`){let i=e.options??[],a=typeof n==`string`?n:typeof e.default==`string`?e.default:``;return(0,T.jsxs)(`select`,{id:t,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=>{r(e.target.value)},children:[a===``&&(0,T.jsx)(`option`,{value:``,children:D(`inputs.selectPlaceholder`)}),i.map(e=>(0,T.jsx)(`option`,{value:e,children:e},e))]})}return(0,T.jsx)(m,{id:t,type:`text`,value:typeof n==`string`?n:typeof e.default==`string`?e.default:``,onChange:e=>{r(e.target.value)}})},B=({job:e})=>e.steps.length===0?null:(0,T.jsx)(`div`,{className:`mt-2 ml-4 space-y-1 border-l border-border/60 pl-4`,children:e.steps.map(t=>(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(S,{variant:`outline`,className:g(`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,T.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:t.name})]},`${e.id}-${t.number}`))}),V=({run:e})=>{let t=M(e),n=N(e);return(0,T.jsxs)(`div`,{className:`rounded-2xl border border-border/60 bg-background/20 px-4 py-3`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name??`#${e.id}`}),(0,T.jsx)(S,{variant:`outline`,className:g(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,A(e)),children:n})]}),(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[t&&(0,T.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t}),e.html_url&&(0,T.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,T.jsx)(d,{className:`h-3 w-3`})]})]})]}),e.head_branch&&(0,T.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e.head_branch}),e.jobs.map(e=>(0,T.jsxs)(`div`,{className:`mt-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(S,{variant:`outline`,className:g(`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,T.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.name})]}),(0,T.jsx)(B,{job:e})]},e.id))]})},H=({tracked:e})=>{let t=e.state===`resolving`,n=e.failure?.message??D(`runs.trackingState.${e.state}`);return(0,T.jsxs)(`div`,{className:g(`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,T.jsx)(c,{className:`mt-0.5 h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`span`,{className:g(`block break-words text-xs`,t?`text-muted-foreground`:`text-red-200`),children:n}),(0,T.jsx)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:e.ref??D(`runs.unknownRef`)})]})]})},U=(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()]},W=(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()]},oe=(e,t,n)=>{let r=t.filter(e=>e.run===null),i=new Set(r.map(e=>e.tracking_key));return W(e.filter(e=>i.has(e.tracking_key)||n.get(e.tracking_key)?.run===null),r.filter(e=>!n.has(e.tracking_key)))},se=e=>({ref:e??`main`}),G=({projectId:e,defaultBranch:t,onClose:i})=>{let[a,m]=(0,w.useState)([]),[g,v]=(0,w.useState)(!0),[y,S]=(0,w.useState)(null),[C,O]=(0,w.useState)([]),[k,A]=(0,w.useState)([]),[j,M]=(0,w.useState)({}),[N,L]=(0,w.useState)(null),[R,z]=(0,w.useState)(!1),[B]=(0,w.useState)(()=>se(t)),W=(0,w.useRef)({}),G=(0,w.useRef)({}),K=(0,w.useRef)(null),q=(0,w.useRef)(!1),J=(0,w.useRef)(0),Y=(0,w.useRef)(new Map),X=(0,w.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 b(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 x?e.message:D(`workflows.loadError`)}})),null}},[e]),Z=(0,w.useCallback)(async()=>{v(!0),S(null);try{let t=await te(e);m(t.workflows),Promise.allSettled(t.workflows.map(e=>X(e)))}catch(e){S(e instanceof x?e.message:D(`workflows.loadError`))}finally{v(!1)}},[X,e]),Q=(0,w.useCallback)(async t=>{if(q.current)return;q.current=!0;let n=J.current;try{let r=await re(e,t);O(e=>U(e,r.runs)),A(e=>{let t=new Map([...Y.current.entries()].filter(([,e])=>e.revision>n).map(([e,t])=>[e,t.event]));return oe(e,r.tracked_runs??[],t)})}catch(e){ne(e)||console.warn(`[github-actions] unable to load runs`,e)}finally{q.current=!1}},[e]);(0,w.useEffect)(()=>{Z()},[Z]),(0,w.useEffect)(()=>{let e=new AbortController,t=()=>{document.visibilityState===`visible`&&Q(e.signal)};t();let n=window.setInterval(t,ae),r=ie(t);return()=>{e.abort(),window.clearInterval(n),r()}},[Q]);let ce=(0,w.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,w.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 ee(e,N.workflow.id,{ref:N.ref,workflowName:N.workflow.name,workflowUrl:N.workflow.url,inputs:n}),u.success(D(`messages.dispatched`)),L(null),Q()}catch(e){u.error(e instanceof x?e.message:D(`messages.dispatchError`))}finally{z(!1)}},[j,Q,e,N]);(0,w.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=>U(e,[t.run])))};return n.on(`github-actions:updated`,t),()=>{n.off(`github-actions:updated`,t)}},[e]),(0,w.useEffect)(()=>{let e=N?.workflow.id;!e||K.current!==e||(W.current[e]?.scrollIntoView({block:`nearest`}),G.current[e]?.scrollIntoView({block:`nearest`}),K.current=null)},[N?.workflow.id]);let $=(0,w.useMemo)(()=>[...C].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}),[C]);return(0,T.jsx)(s,{open:!0,onOpenChange:e=>{e||i()},children:(0,T.jsxs)(h,{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,T.jsx)(l,{className:`sr-only`,children:D(`dialog.srTitle`)}),(0,T.jsx)(o,{className:`sr-only`,children:D(`dialog.srDescription`)}),(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,T.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,T.jsx)(r,{className:`h-5 w-5`})}),(0,T.jsx)(`div`,{children:(0,T.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:D(`dialog.title`)})})]}),(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(_,{type:`button`,"aria-label":D(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,T.jsx)(f,{className:`h-4 w-4`})})})]}),(0,T.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 overflow-hidden lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,T.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,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:D(`workflows.title`)}),(0,T.jsx)(_,{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`)})]}),g&&(0,T.jsxs)(`div`,{className:`flex items-center gap-2 px-2 text-xs text-muted-foreground`,children:[(0,T.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}),(0,T.jsx)(`span`,{children:D(`workflows.loading`)})]}),y&&(0,T.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:y}),!g&&a.length===0&&!y&&(0,T.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,T.jsx)(`p`,{children:D(`workflows.empty`)}),(0,T.jsx)(`p`,{className:`mt-1`,children:D(`workflows.emptyHint`)}),(0,T.jsxs)(`a`,{href:E,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,T.jsx)(d,{className:`h-3 w-3`})]})]}),(0,T.jsx)(`div`,{className:`space-y-2`,children:a.map(e=>{let t=N?.workflow.id===e.id;return(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(`div`,{ref:t=>{W.current[e.id]=t},children:(0,T.jsx)(F,{workflow:e,inputsState:j[e.id]??null,isSelected:t,onSelect:()=>{ce(e)}})}),t&&N&&(0,T.jsx)(`div`,{ref:t=>{G.current[e.id]=t},children:(0,T.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,T.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-3 overflow-y-auto px-4 py-4`,children:[(0,T.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:D(`runs.title`)}),k.map(e=>(0,T.jsx)(H,{tracked:e},e.tracking_key)),$.map(e=>(0,T.jsx)(V,{run:e},e.id)),$.length===0&&k.length===0&&(0,T.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,C as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,L as d,M as f,O as p,P as m,Q as h,R as g,T as _,V as v,W as ee,X as y,Y as b,Z as te,_ as x,_t as S,a as C,at as w,b as T,c as ne,et as re,f as ie,ft as E,g as ae,gt as D,h as O,ht as oe,i as k,it as se,j as A,k as ce,m as le,mt as j,n as ue,nt as de,o as fe,ot as pe,p as me,pt as he,q as ge,rt as _e,s as ve,st as ye,t as M,tt as be,u as N,v as xe,vt as P,x as F,y as I,yt as Se,z as Ce}from"./index-Ck2OKMsl.js";var L=e(Se(),1),R=E(),z=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}`},B=[`error`,`warning`,`info`,`unknown`],V=e=>{let t={error:0,warning:0,info:0,unknown:0};return e.forEach(e=>{t[e.severity]+=1}),t},H=({counts:e,totalCount:t})=>{let{t:n}=P(`common`,{keyPrefix:`checksDialog.diagnostics`}),r=B.filter(t=>e[t]>0);return(0,R.jsxs)(`div`,{"aria-label":n(`severitySummaryLabel`),className:`mt-3 flex flex-wrap items-center gap-2`,children:[r.map(t=>(0,R.jsx)(`span`,{className:`rounded-full border border-border/70 bg-background/45 px-2 py-1 text-[11px] text-muted-foreground`,children:n(`severityCount`,{count:e[t],severity:n(`severity.${t}`)})},t)),t>0&&t!==r.reduce((t,n)=>t+e[n],0)&&(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`totalAvailable`,{count:t})})]})},we=({attempt:e,parser:t,repair:n,ticketRequired:r,selectedTicketId:i,onSelectedTicketChange:a})=>{let{t:o}=P(`common`,{keyPrefix:`checksDialog.diagnostics`}),s=e.currency??`unavailable`;return(0,R.jsxs)(xe,{className:`mt-4 rounded-xl border border-border/60 bg-background/25`,children:[(0,R.jsx)(T,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"aria-label":o(`technicalDetails`),className:`group flex w-full items-center gap-2 rounded-xl px-3 py-2.5 text-left outline-none transition-colors hover:bg-accent/40 focus-visible:ring-2 focus-visible:ring-ring/60`,children:[(0,R.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:o(`technicalDetails`)}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:o(`technicalDetailsHint`)}),(0,R.jsx)(Ce,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]})}),(0,R.jsxs)(I,{className:`border-t border-border/60 px-3 py-3`,children:[(0,R.jsxs)(`dl`,{className:`grid gap-3 text-xs sm:grid-cols-2`,children:[t&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:o(`parserLabel`)}),(0,R.jsx)(`dd`,{className:`mt-1 text-foreground`,children:o(`parser.${t.parser_kind}`)})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:o(`parserStateLabel`)}),(0,R.jsx)(`dd`,{className:`mt-1 text-foreground`,children:o(`state.${t.status}`)})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:o(`parserRetentionLabel`)}),(0,R.jsx)(`dd`,{className:`mt-1 text-foreground`,children:o(`retentionState.${t.retention_state}`)})]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:o(`outputRetentionLabel`)}),(0,R.jsx)(`dd`,{className:`mt-1 text-foreground`,children:o(`retentionState.${e.output_retention_state}`)})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:o(`applicabilityLabel`)}),(0,R.jsx)(`dd`,{className:`mt-1 text-foreground`,children:o(`applicability`,{state:o(`applicabilityState.${s}`)})})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:o(`sourceLabel`)}),(0,R.jsx)(`dd`,{className:`mt-1 break-words text-foreground`,children:e.command_snapshot.name})]}),n&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:o(`destinationTitle`)}),(0,R.jsx)(`dd`,{className:`mt-1 text-foreground`,children:o(`destination.${n.destination}`)}),(0,R.jsx)(`dd`,{className:`mt-1 text-muted-foreground`,children:o(`destinationHint`)})]})]}),r&&n&&(0,R.jsxs)(`label`,{className:`mt-3 block text-xs text-muted-foreground`,children:[o(`ticketLabel`),(0,R.jsxs)(`select`,{value:i,onChange:e=>a(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,R.jsx)(`option`,{value:``,children:o(`ticketPlaceholder`)}),n.candidate_tickets.map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.title},e.id))]})]})]})]})},U=({attempt:e,diagnostics:t,repair:n,selectedDiagnosticIds:r,selectedRawOutputAttemptRunIds:i,selectedAttemptRunIds:a,selectedTicketId:o,pending:s,activeRepair:c,autoFix:l,onSelectedTicketChange:u,onToggleDiagnostic:d,onToggleRawOutput:f,onStartRepair:p,onStopRepair:m})=>{let{t:h}=P(`common`,{keyPrefix:`checksDialog.diagnostics`}),{t:g}=P(`common`,{keyPrefix:`checksDialog`});if(e.execution_status!==`failed`)return null;let _=t?.parser??null,v=t?.diagnostics??[],ee=V(v),y=!!(l&&!l.terminal_reason),te=l?.attempts[l.attempts.length-1]??null,x=c?.terminal_result===null||y,S=!!(n?.eligibility.eligible&&n.eligible_attempt_run_ids.includes(e.execution_run_id)&&_?.status===`complete`&&_.retention_state===`retained`),C=!!(n?.eligibility.eligible&&n.eligible_raw_output_attempt_run_ids.includes(e.execution_run_id)&&e.output_retention_state===`retained`&&e.retained_output),w=i.has(e.execution_run_id),T=r.size,ne=T>=32,re=a.size>=8&&!a.has(e.execution_run_id),ie=ne?h(`diagnosticLimit`,{count:32}):re?h(`attemptLimit`,{count:8}):null,E=!!(n?.accepts_ticket_id&&n.candidate_tickets.length>1),ae=T+i.size,D=ae>0&&(!E||o!==``),O=n&&!n.eligibility.eligible?h(`disabled.${n.eligibility.reason}`):null,oe=_&&t&&(_.status===`interrupted`||v.length===0&&[`unsupported`,`malformed`].includes(_.status))?_.status:null,k=!!(_&&t&&v.length===0&&_.status===`complete`&&_.retention_state===`retained`&&_.diagnostic_count===0),se=!!(_&&t&&v.length===0&&_.status===`complete`&&_.retention_state===`retained`&&_.diagnostic_count>0),A=_?.diagnostic_count??v.length;return(0,R.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,R.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{id:`diagnostics-${e.execution_run_id}`,className:`text-sm font-semibold text-foreground`,children:h(`title`)}),(0,R.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:_&&_.status===`pending`?h(`loading`):_&&A>0?se||_.retention_state===`expired`?h(`totalAvailable`,{count:A}):h(`availableCount`,{count:A}):h(t?`noneAvailable`:`loading`)}),(0,R.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:h(`failureOutcome`,{outcome:e.outcome?g(`outcomeValue.${e.outcome}`):g(`status.${e.execution_status}`)})}),t&&v.length>0&&(0,R.jsx)(H,{counts:ee,totalCount:A})]})}),_?.retention_state===`expired`&&(0,R.jsx)(`p`,{className:`mt-3 text-sm text-amber-200`,children:h(`expired`)}),_?.truncated&&(0,R.jsx)(`p`,{className:`mt-3 text-sm text-amber-200`,children:h(`truncated`)}),oe&&(0,R.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:h(`fallback.${oe}`)}),k&&(0,R.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:h(`noStructuredDiagnostics`)}),se&&(0,R.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:h(`structuredDetailsUnavailable`)}),C&&(0,R.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,R.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 accent-primary`,"aria-label":h(`rawOutputSelect`),checked:w,disabled:x||!w&&re,onChange:e=>f(e.target.checked)}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:h(`rawOutputSelect`)}),(0,R.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:h(`rawOutputHint`)}),e.retained_start_offset>0&&(0,R.jsx)(`span`,{className:`mt-1 block text-xs text-amber-200`,children:h(`rawOutputTruncated`)})]})]}),t&&v.length>0&&(0,R.jsxs)(`fieldset`,{className:`mt-4`,children:[(0,R.jsx)(`legend`,{className:`text-xs font-medium text-muted-foreground`,children:h(`selectLegend`)}),(0,R.jsx)(`ul`,{className:`mt-2 space-y-2`,children:v.map(e=>{let t=z(e),n=r.has(e.id);return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`label`,{className:`flex items-start gap-3 rounded-xl border border-border/60 bg-background/35 p-3`,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 accent-primary`,checked:n,disabled:!S||x||!n&&ie!==null,onChange:t=>d(e.id,t.target.checked)}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`span`,{className:`flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`font-semibold uppercase text-foreground`,children:h(`severity.${e.severity}`)}),e.code&&(0,R.jsx)(`code`,{children:e.code})]}),(0,R.jsx)(`span`,{className:`mt-1 block break-words text-sm text-foreground`,children:e.message}),t&&(0,R.jsx)(`span`,{className:`mt-1 block break-all font-mono text-xs text-muted-foreground`,children:t})]})]})},e.id)})})]}),O&&(0,R.jsx)(`p`,{className:`mt-3 text-xs text-amber-200`,children:O}),ie&&(0,R.jsx)(`p`,{className:`mt-3 text-xs text-amber-200`,children:ie}),c&&(0,R.jsxs)(`div`,{className:`mt-4 rounded-xl border border-sky-400/25 bg-sky-500/10 p-3 text-sm`,children:[(0,R.jsx)(`p`,{className:`font-medium text-sky-100`,children:h(c.terminal_result?`repairResult.${c.terminal_result}`:`repairRunning`)}),c.terminal_message&&(0,R.jsx)(`p`,{className:`mt-1 text-xs text-sky-100/80`,children:c.terminal_message})]}),l&&(0,R.jsxs)(`div`,{className:`mt-4 rounded-xl border border-sky-400/25 bg-sky-500/10 p-3 text-sm`,role:`status`,children:[(0,R.jsx)(`p`,{className:`font-medium text-sky-100`,children:l.terminal_reason?h(`autoFix.terminal.${l.terminal_reason}`):te?.fallback_used?h(`autoFix.phase.fallback`):h(`autoFix.phase.${l.phase}`)}),!l.terminal_reason&&l.attempt_count>0&&(0,R.jsx)(`p`,{className:`mt-1 text-xs text-sky-100/80`,children:h(`autoFix.attempt`,{current:l.attempt_count,total:l.max_attempts})})]}),(0,R.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h(`selectedEvidence`,{count:ae})}),(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsx)(b,{type:`button`,size:`sm`,disabled:n?.eligibility.eligible!==!0||!D||s||x,title:O??void 0,onClick:p,children:s?h(`starting`):h(`repairSelectedEvidence`,{count:ae})}),x&&(0,R.jsx)(b,{type:`button`,variant:`destructive`,size:`sm`,disabled:s||l?.phase===`stopping`,onClick:m,children:h(y?`autoFix.stop`:`stopRepair`)})]})]}),(0,R.jsx)(we,{attempt:e,parser:_,repair:n,ticketRequired:E,selectedTicketId:o,onSelectedTicketChange:u})]})},W=({attempt:e})=>{let{t}=P(`common`,{keyPrefix:`checksDialog`}),n=e.retained_output?k(e.retained_output):``;return(0,R.jsxs)(N,{title:t(`rawOutput`),defaultOpen:!0,children:[e.output_retention_state===`expired`&&(0,R.jsx)(`p`,{className:`rounded-xl border border-border bg-background/30 p-4 text-sm text-muted-foreground`,children:t(`outputExpired`)}),e.output_retention_state===`retained`&&!n&&(0,R.jsx)(`p`,{className:`rounded-xl border border-border bg-background/30 p-4 text-sm text-muted-foreground`,children:t(`outputEmpty`)}),e.output_retention_state===`retained`&&n&&(0,R.jsx)(`pre`,{className:`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:n}),e.retained_start_offset>0&&(0,R.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:t(`outputTruncated`)})]})},G=({definition:e,policy:t})=>{let{t:n}=P(`common`,{keyPrefix:`checksDialog`});return(0,R.jsxs)(`article`,{"aria-labelledby":`configured-check-${e.id}`,children:[(0,R.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`h2`,{id:`configured-check-${e.id}`,className:`text-lg font-semibold text-foreground`,children:e.name}),(0,R.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n(`status.notRun`)})]})}),(0,R.jsx)(`p`,{className:`mt-4 rounded-xl border border-dashed border-border px-3 py-2 text-sm text-muted-foreground`,children:n(`notRunDescription`)}),(0,R.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`command`)}),(0,R.jsx)(`dd`,{className:`mt-0.5 break-words font-mono text-xs text-foreground`,children:e.command})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`directory`)}),(0,R.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.cwd??n(`targetRoot`)})]}),t&&(0,R.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,R.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`policyLabel`)}),(0,R.jsxs)(`dd`,{className:`mt-0.5 break-words text-foreground`,children:[n(t.required?`required`:`optional`),` · `,n(t.preReview?`preReview`:`finalOnly`)]})]})]})]})},Te=({attempt:e,definition:t,diagnostics:n,repair:r,selectedDiagnosticIds:i,selectedRawOutputAttemptRunIds:a,selectedAttemptRunIds:o,selectedTicketId:s,pending:c,activeRepair:l,autoFix:u,onSelectedTicketChange:d,onToggleDiagnostic:f,onToggleRawOutput:p,onStartRepair:m,onStopRepair:h,policy:g})=>{let{t:_}=P(`common`,{keyPrefix:`checksDialog`}),{t:v}=P(`common`,{keyPrefix:`activityView`});return e?(0,R.jsxs)(`article`,{"aria-labelledby":`selected-check-${e.execution_run_id}`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`h2`,{id:`selected-check-${e.execution_run_id}`,className:`text-lg font-semibold text-foreground`,children:e.command_snapshot.name}),(0,R.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:_(`status.${e.execution_status}`)})]}),e.outcome&&(0,R.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1 text-xs text-muted-foreground`,children:_(`outcomeValue.${e.outcome}`)})]}),(0,R.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:_(`command`)}),(0,R.jsx)(`dd`,{className:`mt-0.5 break-words font-mono text-xs text-foreground`,children:e.command_snapshot.command})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:_(`directory`)}),(0,R.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.command_snapshot.cwd??_(`targetRoot`)})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:_(`outcome`)}),(0,R.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.outcome?_(`outcomeValue.${e.outcome}`):_(`status.${e.execution_status}`)})]}),e.currency&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:_(`currencyLabel`)}),(0,R.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:v(`currency.${e.currency}`)})]}),g&&(0,R.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,R.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:_(`policyLabel`)}),(0,R.jsxs)(`dd`,{className:`mt-0.5 break-words text-foreground`,children:[_(g.required?`required`:`optional`),` · `,_(g.preReview?`preReview`:`finalOnly`)]})]})]}),e.execution_status===`failed`&&(0,R.jsx)(U,{attempt:e,diagnostics:n,repair:r,selectedDiagnosticIds:i,selectedRawOutputAttemptRunIds:a,selectedAttemptRunIds:o,selectedTicketId:s,pending:c,activeRepair:l,autoFix:u,onSelectedTicketChange:d,onToggleDiagnostic:f,onToggleRawOutput:p,onStartRepair:m,onStopRepair:h}),(0,R.jsx)(W,{attempt:e},e.execution_run_id)]}):t?(0,R.jsx)(G,{definition:t,policy:g}):(0,R.jsxs)(`section`,{"aria-labelledby":`selected-check-heading`,className:`rounded-2xl border border-dashed border-border p-6`,children:[(0,R.jsx)(`h2`,{id:`selected-check-heading`,className:`font-medium text-foreground`,children:_(`selectAttemptTitle`)}),(0,R.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:_(`selectAttemptDescription`)})]})},K={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`},Ee=(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`,De=e=>e===!0?`gateApplicability.overallCurrent`:e===!1?`gateApplicability.overallStale`:`gateApplicability.overallUnverifiable`,Oe=({evaluation:e})=>{let{t}=P(`common`,{keyPrefix:`checksDialog`}),n=e.presentApplicability.appliesToCurrentState===!1?`gateStale`:e.presentApplicability.appliesToCurrentState===null?`gateUnverifiable`:e.decision===`passed`?`gatePassed`:`gateBlocked`,r=e.reasonCodes[0],i=r?t(`gateReasonSummary`,{reason:t(`reason.${r}`)}):e.decision===`passed`?t(`gatePassedSummary`):t(`gateBlockedSummary`);return(0,R.jsxs)(`section`,{"aria-labelledby":`automated-delivery-gate-heading`,className:`mb-5 rounded-2xl border border-border/70 bg-background/30 p-4`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`h2`,{id:`automated-delivery-gate-heading`,className:`font-semibold text-foreground`,children:t(`gateTitle`)}),(0,R.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:i})]}),(0,R.jsx)(`span`,{className:y(`shrink-0 rounded-full border px-2.5 py-1 text-xs font-medium`,e.decision===`passed`&&e.presentApplicability.appliesToCurrentState===!0?K.current:K.blocked),children:t(n)})]}),(0,R.jsx)(N,{title:t(`gateDetails`),children:(0,R.jsxs)(`div`,{className:`space-y-3 text-xs text-muted-foreground`,children:[(0,R.jsx)(`p`,{children:t(`gateScope`)}),(0,R.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,R.jsx)(`p`,{children:t(`gateBoundary.label`,{boundary:t(`gateBoundary.${e.boundaryKind}`)})}),(0,R.jsx)(`p`,{className:`break-all`,children:t(`gatePolicy`,{fingerprint:e.policy.fingerprint.slice(0,12)})}),(0,R.jsx)(`p`,{children:t(`gatePolicyStatus`,{status:t(e.policy.status===`valid`?`gatePolicyValid`:`gatePolicyInvalid`)})}),(0,R.jsx)(`p`,{className:`break-all`,children:e.sourceBatchRunId?t(`gateSourceBatch`,{batchId:e.sourceBatchRunId}):t(`gateNoBatch`)}),(0,R.jsx)(`p`,{className:`break-words`,children:t(`gateApplicability.label`,{workspace:t(`gateApplicability.${e.presentApplicability.workspace}`),policy:t(`gateApplicability.${e.presentApplicability.policy}`),overall:t(De(e.presentApplicability.appliesToCurrentState))})})]}),e.reasonCodes.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`font-medium text-foreground`,children:t(`gateReasonsTitle`)}),(0,R.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.reasonCodes.map(e=>(0,R.jsx)(`li`,{children:t(`reason.${e}`)},e))})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`font-medium text-foreground`,children:t(`gateEvidenceTitle`)}),(0,R.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.policy.definitions.map(n=>{let r=Ee(e,e.evaluatedAttempts.find(e=>e.definition_id===n.id));return(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-xl border border-border/60 p-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`break-words text-sm font-medium text-foreground`,children:n.name}),(0,R.jsx)(`code`,{className:`mt-1 block break-all text-xs text-muted-foreground`,children:n.command})]}),(0,R.jsx)(`span`,{className:y(`shrink-0 rounded-full border px-2 py-1 text-xs`,K[r]),children:t(`evidence.${r}`)})]},n.id)})})]}),e.policy.status===`invalid`&&(0,R.jsx)(`p`,{className:`break-words text-amber-200`,children:e.policy.error})]})})]})},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&&e.outcome!==`passed`?`outcomeValue.${e.outcome}`:`status.${e.execution_status}`,je=(e,t,n,r)=>((t?.attempts.find(t=>t.attempt_run_id===e.execution_run_id))?.diagnostics.filter(e=>n.has(e.id)).length??0)+ +!!r.has(e.execution_run_id),Me=({definitions:e,attempts:t,requiredDefinitionIds:n,preReviewDefinitionIds:r,selectedDefinitionIds:i,selectedCheckId:a,diagnostics:o,selectedDiagnosticIds:s,selectedRawOutputAttemptRunIds:c,onToggleDefinition:l,onSelectCheck:u})=>{let{t:d}=P(`common`,{keyPrefix:`checksDialog`}),f=new Set(n),p=new Set(r),m=new Set(e.map(e=>e.id)),h=[...e.map(e=>({definition:e,attempt:t.find(t=>t.definition_id===e.id),historical:!1})),...t.filter(e=>!m.has(e.definition_id)).map(e=>({definition:e.command_snapshot,attempt:e,historical:!0}))];return(0,R.jsxs)(`section`,{"aria-labelledby":`configured-checks-heading`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,R.jsxs)(`header`,{className:`shrink-0 border-b border-border/60 px-4 py-4 sm:px-5`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-1`,children:[(0,R.jsx)(`h2`,{id:`configured-checks-heading`,className:`text-sm font-semibold text-foreground`,children:d(`configured`)}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:d(`selectionHint`)})]}),(0,R.jsxs)(`div`,{className:`mt-3 rounded-xl border border-border/70 bg-background/35 p-3 text-xs text-muted-foreground`,children:[(0,R.jsx)(`p`,{className:`font-medium text-foreground`,children:d(`policySummary.title`)}),(0,R.jsx)(`p`,{className:`mt-1`,children:d(`policySummary.counts`,{requiredCount:n.length,preReviewCount:r.length})})]})]}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5 md:max-h-none md:py-5 max-md:max-h-[min(35vh,18rem)]`,children:(0,R.jsx)(`ul`,{"aria-label":d(`configured`),className:`space-y-2`,children:h.map(({definition:e,attempt:t,historical:n})=>{let r=a===e.id,m=t?je(t,o,s,c):0,h=f.has(e.id),g=p.has(e.id),_=`${d(`category.${e.category}`)} · ${d(h?`required`:`optional`)} · ${d(g?`preReview`:`finalOnly`)}`;return(0,R.jsx)(`li`,{className:`rounded-xl border border-border/60 bg-background/30 p-2.5`,children:(0,R.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[!n&&(0,R.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 shrink-0 accent-primary`,checked:i.has(e.id),"aria-label":d(`selectForRun`,{name:e.name}),onChange:t=>l(e.id,t.target.checked)}),t?(0,R.jsxs)(`button`,{type:`button`,className:y(`min-w-0 flex-1 cursor-pointer rounded-lg px-1.5 py-1 text-left outline-none transition-colors hover:bg-accent/60 focus-visible:ring-2 focus-visible:ring-ring/60`,r&&`bg-accent/60`),"aria-label":d(`inspectAttempt`,{name:e.name,status:d(Ae(t))}),"aria-pressed":r,"aria-current":r?`true`:void 0,onClick:()=>u(e.id),children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.name}),(0,R.jsx)(`span`,{className:y(`shrink-0 rounded-full border px-2 py-0.5 text-[11px] font-medium`,ke(t)),children:d(Ae(t))})]}),(0,R.jsx)(`span`,{className:`mt-1 block truncate text-[11px] text-muted-foreground`,children:_}),m>0&&(0,R.jsx)(`span`,{"data-evidence-selected":`true`,className:`mt-1.5 inline-flex rounded-full border border-amber-400/30 bg-amber-500/10 px-2 py-0.5 text-[11px] text-amber-200`,children:d(`evidenceSelected`,{count:m})})]}):(0,R.jsxs)(`button`,{type:`button`,className:y(`min-w-0 flex-1 cursor-pointer rounded-lg px-1.5 py-1 text-left outline-none transition-colors hover:bg-accent/60 focus-visible:ring-2 focus-visible:ring-ring/60`,r&&`bg-accent/60`),"aria-label":d(`inspectAttempt`,{name:e.name,status:d(`status.notRun`)}),"aria-pressed":r,"aria-current":r?`true`:void 0,onClick:()=>u(e.id),children:[(0,R.jsx)(`span`,{className:`flex min-w-0 items-center justify-between gap-2`,children:(0,R.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.name})}),(0,R.jsx)(`span`,{className:`mt-1 block truncate text-[11px] text-muted-foreground`,children:_})]})]})},t?.execution_run_id??e.id)})})})]})},Ne=(e,t)=>{let n=new Set(t?.attempts.filter(e=>e.parser.status===`complete`&&e.parser.retention_state===`retained`&&e.diagnostics.length>0).map(e=>e.attempt_run_id)??[]);return e.find(e=>e.execution_status===`failed`&&n.has(e.execution_run_id))??e.find(e=>e.execution_status===`failed`)??e.find(e=>e.execution_status===`running`)??e[0]??null},Pe=new Set([`queued`,`running`,`waiting`]),Fe=75,Ie=32,Le=64,Re=3,ze=32,Be=8,q=(e,t)=>e instanceof he?e.message:t,Ve=e=>{let t=new Set(e.repair.eligibility.eligible?e.repair.eligible_attempt_run_ids:[]);return new Set(e.attempts.filter(e=>t.has(e.attempt_run_id)).flatMap(e=>e.diagnostics.map(e=>e.id)))},He=e=>new Set(e.repair.eligibility.eligible?e.repair.eligible_raw_output_attempt_run_ids:[]),Ue=({projectId:e,targetKind:n,targetBundleId:r,definitions:i,requiredDefinitionIds:a=[],preReviewDefinitionIds:o=[],gateEvaluationId:s=null,directBatchRunId:c=null,directAttemptRunId:l=null,onSelectionChange:u,onUnavailable:d,onStatusChange:f})=>{let{t:p}=P(`common`,{keyPrefix:`checksDialog`}),m=ne(),[g,_]=(0,L.useState)(()=>new Set(i.map(e=>e.id))),[v,ee]=(0,L.useState)(null),[y,te]=(0,L.useState)(null),[x,S]=(0,L.useState)(null),[T,ie]=(0,L.useState)(null),[E,ae]=(0,L.useState)(!0),[D,O]=(0,L.useState)(null),[k,A]=(0,L.useState)(null),[ce,le]=(0,L.useState)(new Set),[j,ue]=(0,L.useState)(new Set),[me,ge]=(0,L.useState)(``),[M,N]=(0,L.useState)(null),[xe,F]=(0,L.useState)(!1),[I,Se]=(0,L.useState)(0),[Ce,z]=(0,L.useState)(null),B=(0,L.useRef)(v),V=(0,L.useRef)(null),H=(0,L.useRef)(new Set),we=(0,L.useRef)(new Map),U=(0,L.useRef)(0),W=(0,L.useRef)(0),G=(0,L.useRef)(null),K=(0,L.useRef)(!1),Ee=(0,L.useRef)(!0),De=(0,L.useRef)(null),ke=(0,L.useRef)(`automatic`),Ae=(0,L.useRef)(null),je=(0,L.useRef)(async()=>void 0),Ue=(0,L.useRef)(async()=>void 0),We=(0,L.useRef)(()=>void 0),Ge=(0,L.useRef)(0),Ke=(0,L.useRef)(k);B.current=v,Ke.current=k,Ee.current=E||D!==null;let J=(0,L.useCallback)((e,t)=>{De.current=e,ke.current=t,S(e)},[]),qe=(0,L.useCallback)(e=>{A(e),N(e.latest_repair?.source_batch_run_id===e.batch_run_id?e.latest_repair:null),le(t=>{let n=Ve(e);return new Set([...t].filter(e=>n.has(e)))}),ue(t=>{let n=He(e);return new Set([...t].filter(e=>n.has(e)))}),ge(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:``);let t=B.current;ke.current===`automatic`&&t?.batch.execution_run_id===e.batch_run_id&&J(Ne(t.attempts,e)?.execution_run_id??null,`automatic`)},[J]),Je=(0,L.useCallback)(e=>{let t=we.current;if(!t.has(e.attempt_run_id)&&t.size>=Ie){let e=t.keys().next().value;e&&(t.delete(e),H.current.delete(e))}let n=t.get(e.attempt_run_id)??[];t.set(e.attempt_run_id,[...n.slice(-(Le-1)),e])},[]),Ye=(0,L.useCallback)((e,t,n=`route`)=>{let r=B.current?.batch.execution_run_id===e.batch.execution_run_id?B.current:null,i=!1,a=new Set(e.attempts.map(e=>e.execution_run_id));for(let e of we.current.keys())a.has(e)||(we.current.delete(e),H.current.delete(e));let o=e.attempts.map(e=>{let t=!1,n=r?.attempts.find(t=>t.execution_run_id===e.execution_run_id),a=n&&n.output_revision>e.output_revision?n:e,o=we.current.get(e.execution_run_id)??[];for(let e of[...o].sort((e,t)=>e.revision-t.revision)){let n=fe(C(a),e);if(n.status===`refetch`){t=!0,i=!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?H.current.add(e.execution_run_id):(H.current.delete(e.execution_run_id),we.current.delete(e.execution_run_id)),a}),s={...e,attempts:o};G.current=e.batch.execution_run_id,B.current=s,ee(s);let c=t?s.attempts.find(e=>e.execution_run_id===t):null,l=De.current,f=ke.current,m=!!(l&&s.attempts.some(e=>e.execution_run_id===l)),h=Ne(s.attempts,Ke.current?.batch_run_id===s.batch.execution_run_id?Ke.current:null),g=Ae.current,_=!!(g&&g.batchRunId===s.batch.execution_run_id&&g.attemptRunId===t),v=!!(g&&g.previousBatchRunId===s.batch.execution_run_id&&g.previousAttemptRunId===t);if(n===`reset`)J(h?.execution_run_id??null,`automatic`);else if(t)if(c)if(_)J(c.execution_run_id,`manual`);else if(v&&f===`manual`)J(m?l:h?.execution_run_id??null,m?`manual`:`automatic`);else{let e=f!==`external`||l!==c.execution_run_id;J(c.execution_run_id,`external`),e&&u?.(s.batch.execution_run_id,c.execution_run_id)}else _||v?f===`manual`&&m?J(l,`manual`):J(h?.execution_run_id??null,`automatic`):(J(t,`external`),d?.());else n===`preserve`?f===`external`&&l?m?J(l,`external`):(J(l,`external`),d?.()):f===`manual`&&m?J(l,`manual`):J(f===`automatic`&&m?l:h?.execution_run_id??null,`automatic`):f===`manual`&&m?J(l,`manual`):J(h?.execution_run_id??null,`automatic`);i?We.current(e.batch.execution_run_id):Ge.current=0,K.current&&!V.current&&(K.current=!1,V.current=setTimeout(()=>{V.current=null,Ue.current().catch(e=>z(q(e,p(`errors.load`))))},Fe))},[u,d,p,J]),Y=(0,L.useCallback)(async(t,n)=>{let r=++U.current,i=await h(e,t,n);if(r!==U.current||i.batch.execution_run_id!==t||G.current!==null&&G.current!==t){i.batch.execution_run_id!==t&&d?.();return}Ye(i,t===c?l:null)},[l,c,Ye,d,e]);je.current=Y,We.current=(0,L.useCallback)(e=>{if(V.current)return;if(Ge.current>=Re){Ge.current=0,H.current.clear(),we.current.clear();return}let t=Fe*2**Ge.current;V.current=setTimeout(()=>{V.current=null,Ge.current+=1,je.current(e).catch(t=>{z(q(t,p(`errors.load`))),H.current.size>0&&We.current(e)})},t)},[p]);let X=(0,L.useCallback)(async t=>{let i=++U.current,a=await de(e,n,r,t);if(i===U.current){if(a.batch_run_id){G.current=a.batch_run_id,await Y(a.batch_run_id,t);return}!t?.aborted&&i===U.current&&(G.current=null,B.current=null,ee(null),J(null,`automatic`))}},[Y,e,r,n,J]),Xe=(0,L.useCallback)(async()=>{if(s||c){let e=G.current;e&&await Y(e);return}await X()},[c,s,Y,X]);Ue.current=Xe;let Ze=(0,L.useCallback)(e=>{V.current||=setTimeout(()=>{V.current=null,Y(e).catch(e=>z(q(e,p(`errors.load`))))},Fe)},[Y,p]);(0,L.useEffect)(()=>{let t=new AbortController;return ae(!0),z(null),(async()=>{if(c){if(te(null),l){let n=await ve(e,l,t.signal);if(n.run.kind!==`check_attempt`||n.details.kind!==`check_attempt`||!n.details.available||!n.details.attempt||n.details.attempt.batch_run_id!==c){d?.();return}}G.current=c,await Y(c,t.signal);return}if(!s){te(null),await X(t.signal);return}let n=await re(e,s,t.signal);if(te(n),n.sourceBatchRunId){G.current=n.sourceBatchRunId,await Y(n.sourceBatchRunId,t.signal);return}G.current=null,B.current=null,ee(null),J(null,`automatic`)})().catch(e=>{oe(e)||(e instanceof he&&e.status===404&&d?.(),z(q(e,p(`errors.load`))))}).finally(()=>{t.signal.aborted||(ae(!1),Ee.current=!1,K.current&&!V.current&&(K.current=!1,V.current=setTimeout(()=>{V.current=null,Ue.current().catch(e=>z(q(e,p(`errors.load`))))},Fe)))}),()=>t.abort()},[l,c,s,Y,X,d,e,p,J]),(0,L.useEffect)(()=>{let n=v?.batch.execution_run_id;if(!n){W.current+=1,A(null),le(new Set),ue(new Set),ge(``),N(null);return}Ke.current?.batch_run_id!==n&&(A(null),le(new Set),ue(new Set),ge(``),N(null));let r=++W.current,i=new AbortController;return t(e,n,i.signal).then(e=>{r===W.current&&e.batch_run_id===n&&G.current===n&&qe(e)}).catch(e=>{oe(e)||z(q(e,p(`errors.diagnostics`)))}),()=>i.abort()},[v?.batch.execution_run_id,I,qe,e,p]),(0,L.useEffect)(()=>{let t=t=>{if(t.project_id!==e)return;let n=G.current;if(n!==null&&t.batch_run_id!==n)return;let r=B.current;if(!r||H.current.has(t.attempt_run_id)){Je(t),r&&H.current.has(t.attempt_run_id)&&We.current(r.batch.execution_run_id);return}let i=r.attempts.findIndex(e=>e.execution_run_id===t.attempt_run_id);if(i<0){Je(t),Ze(r.batch.execution_run_id);return}let a=r.attempts[i],o=fe(C(a),t);if(o.status===`ignored`)return;if(o.status===`refetch`){H.current.add(t.attempt_run_id),Je(t),We.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};B.current=c,ee(c)},n=t=>{if(t.project_id&&t.project_id!==e)return;if(Ee.current){K.current=!0;return}let n=B.current,r=t.execution_run_id??t.id;if(Se(e=>e+1),M&&r===M.execution_run_id&&M.source_batch_run_id===G.current&&be(e,M.execution_run_id).then(N).catch(()=>void 0),n&&(r===n.batch.execution_run_id||n.attempts.some(e=>e.execution_run_id===r))){U.current+=1,Ze(n.batch.execution_run_id);return}K.current=!0,!Ee.current&&!V.current&&(K.current=!1,V.current=setTimeout(()=>{V.current=null,Ue.current().catch(e=>z(q(e,p(`errors.load`))))},Fe))},r=()=>{Se(e=>e+1),Xe().catch(e=>z(q(e,p(`errors.load`))))};return m.on(`check-attempt:output`,t),m.on(`execution-run:updated`,n),m.on(`lifecycle-event:created`,n),m.on(`connect`,r),()=>{m.off(`check-attempt:output`,t),m.off(`execution-run:updated`,n),m.off(`lifecycle-event:created`,n),m.off(`connect`,r)}},[M,Je,e,Xe,Ze,m,p]),(0,L.useEffect)(()=>()=>{V.current&&clearTimeout(V.current),H.current.clear(),we.current.clear()},[]);let Qe=(e,t)=>{U.current+=1,G.current=e.batch.execution_run_id,Ye(e,null,t)},$e=async(e,t)=>{U.current+=1,Ee.current=!0,O(e),z(null);try{let n=await t();e!==`stop`&&(Ae.current=null),Qe(n,e===`stop`?`preserve`:`reset`),e!==`stop`&&u?.(n.batch.execution_run_id,void 0)}catch(t){z(q(t,p(`errors.${e}`))),t instanceof he&&t.status===409&&await Xe().catch(()=>void 0)}finally{O(null),Ee.current=E,K.current&&!V.current&&(K.current=!1,V.current=setTimeout(()=>{V.current=null,Ue.current().catch(e=>z(q(e,p(`errors.load`))))},Fe))}},et=v?Pe.has(v.batch.execution_status):!1,tt=v?et?`running`:v.batch.execution_status===`completed`?`finished`:v.batch.execution_status===`cancelled`||v.batch.execution_status===`interrupted`?`interrupted`:`error`:`inactive`,nt=v?.batch.execution_run_id??null,Z=k?.batch_run_id===nt?k:null,rt=M?.source_batch_run_id===nt?M:null,Q=Z?.auto_fix??null,it=!!(Q&&!Q.terminal_reason),at=Z?Ve(Z):new Set,ot=Z?He(Z):new Set,st=new Set([...ce].filter(e=>at.has(e))),ct=new Set([...j].filter(e=>ot.has(e))),lt=[...g],ut=v?.attempts.filter(e=>e.execution_status!==`completed`).length??0,dt=async()=>{let n=[...st],r=[...ct];if(!(!Z||!nt||G.current!==nt||Z.repair.eligibility.eligible!==!0||rt?.terminal_result===null||Q&&!Q.terminal_reason||n.length===0&&r.length===0)){F(!0),z(null);try{let t=await w(e,n,r,Z.repair.accepts_ticket_id?Z.repair.candidate_tickets.some(e=>e.id===me)?me:Z.repair.candidate_tickets[0]?.id||null:null);N(t.source_batch_run_id===nt?t:null)}catch(n){if(z(q(n,p(`errors.repair`))),n instanceof he&&n.status===409&&v){let n=v.batch.execution_run_id,r=++W.current;t(e,n).then(e=>{r===W.current&&e.batch_run_id===n&&G.current===n&&qe(e)}).catch(()=>void 0)}}finally{F(!1)}}},ft=async()=>{let t=Q&&!Q.terminal_reason?Q.execution_run_id:rt?.execution_run_id;if(t){F(!0),z(null);try{let n=await ye(e,t);`source_batch_run_id`in n&&N(n),Se(e=>e+1)}catch(e){z(q(e,p(`errors.repairStop`)))}finally{F(!1)}}},pt=new Set([...Z?.attempts.filter(e=>e.diagnostics.some(e=>st.has(e.id))).map(e=>e.attempt_run_id)??[],...ct]),mt=(e,t,n)=>{le(r=>{let i=new Set(r);if(!n)return i.delete(t),i;if(i.size>=ze||!Z||!at.has(t))return r;let a=new Set(Z.attempts.filter(e=>e.diagnostics.some(e=>i.has(e.id))).map(e=>e.attempt_run_id)??[]);return!a.has(e)&&a.size>=Be?r:(i.add(t),i)})},ht=(e,t)=>{ue(n=>{let r=new Set(n);return t?!pt.has(e)&&pt.size>=Be||!ot.has(e)?n:(r.add(e),r):(r.delete(e),r)})},gt=(e,t)=>{_(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},_t=e=>{v&&(ie(null),Ae.current={batchRunId:v.batch.execution_run_id,attemptRunId:e,previousBatchRunId:c===v.batch.execution_run_id?c:null,previousAttemptRunId:c===v.batch.execution_run_id?l:null},J(e,`manual`),u?.(v.batch.execution_run_id,e))},vt=e=>{let t=v?.attempts.find(t=>t.definition_id===e);if(t){_t(t.execution_run_id);return}ie(e)},$=T?v?.attempts.find(e=>e.definition_id===T)??null:v?.attempts.find(e=>e.execution_run_id===x)??null,yt=$?.command_snapshot??i.find(e=>e.id===T)??null,bt=T??$?.definition_id??null,xt=yt?{required:a.includes(yt.id),preReview:o.includes(yt.id)}:null;return(0,L.useEffect)(()=>{f?.(tt)},[tt,f]),(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[Ce&&(0,R.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:Ce}),(0,R.jsxs)(`div`,{role:`toolbar`,"aria-label":p(`runActions`),className:`flex shrink-0 flex-wrap items-center justify-between gap-3 border-y border-border/70 bg-background/30 px-4 py-3 sm:px-6`,children:[(0,R.jsx)(`div`,{className:`min-w-0`,children:(0,R.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:p(`runActions`)})}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(b,{type:`button`,size:`sm`,disabled:lt.length===0||et||it||D!==null,onClick:()=>void $e(`run`,()=>se(e,{targetKind:n,targetBundleId:r,definitionIds:lt})),children:p(D===`run`?`starting`:`runSelected`)}),v&&et&&(0,R.jsx)(b,{type:`button`,variant:`destructive`,size:`sm`,disabled:D!==null||xe,onClick:()=>void(it?ft():$e(`stop`,()=>pe(e,v.batch.execution_run_id))),children:p(D===`stop`||xe?`stopping`:`stop`)}),v&&!et&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(b,{type:`button`,variant:`outline`,size:`xs`,disabled:it||D!==null,onClick:()=>void $e(`rerun`,()=>_e(e,v.batch.execution_run_id,{mode:`all`})),children:p(`rerunAll`)}),(0,R.jsx)(b,{type:`button`,variant:`outline`,size:`xs`,disabled:it||D!==null||ut===0,onClick:()=>void $e(`rerun`,()=>_e(e,v.batch.execution_run_id,{mode:`failed_only`})),children:p(`rerunFailed`)})]})]})]}),(0,R.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-rows-[minmax(0,auto)_minmax(0,1fr)] overflow-hidden md:grid-cols-[19rem_minmax(0,1fr)] md:grid-rows-1`,children:[(0,R.jsx)(`aside`,{className:`flex min-h-0 flex-col border-b border-border/70 md:border-r md:border-b-0`,children:(0,R.jsx)(Me,{definitions:i,attempts:v?.attempts??[],requiredDefinitionIds:a,preReviewDefinitionIds:o,selectedDefinitionIds:g,selectedCheckId:bt,diagnostics:Z,selectedDiagnosticIds:st,selectedRawOutputAttemptRunIds:ct,onToggleDefinition:gt,onSelectCheck:vt})}),(0,R.jsxs)(`main`,{className:`min-h-0 overflow-y-auto p-4 sm:p-6`,children:[s&&!y&&E&&(0,R.jsx)(`p`,{role:`status`,className:`mb-4 text-sm text-muted-foreground`,children:p(`gateLoading`)}),y&&(0,R.jsx)(Oe,{evaluation:y}),E&&(0,R.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:p(`loading`)}),!E&&!v&&!yt&&(0,R.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border p-6 text-center`,children:[(0,R.jsx)(`h2`,{className:`font-medium text-foreground`,children:p(`emptyTitle`)}),(0,R.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:p(`emptyDescription`)})]}),v&&(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1 text-xs text-muted-foreground`,children:p(`status.${v.batch.execution_status}`)}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:p(`summary`,{passed:v.batch.passed_count,failed:v.batch.failed_count,running:v.batch.running_count,queued:v.batch.queued_count})}),v.batch.stop_requested&&(0,R.jsx)(`span`,{className:`text-xs text-amber-200`,children:p(`stopRequested`)})]})}),(v||yt)&&(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(Te,{attempt:$,definition:yt,diagnostics:Z?.attempts.find(e=>e.attempt_run_id===$?.execution_run_id)??null,repair:Z?.repair??null,selectedDiagnosticIds:st,selectedRawOutputAttemptRunIds:ct,selectedAttemptRunIds:pt,selectedTicketId:me,pending:xe,activeRepair:rt,autoFix:Q,policy:xt,onSelectedTicketChange:ge,onToggleDiagnostic:(e,t)=>$&&mt($.execution_run_id,e,t),onToggleRawOutput:e=>$&&ht($.execution_run_id,e),onStartRepair:()=>void dt(),onStopRepair:()=>void ft()})})]})]})]})},We=(e,t)=>S(j(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),Ge=(e,t)=>S(j(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),Ke=(e,t={})=>S(j(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),J=(e,t)=>S(j(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),qe=e=>S(j(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),Je=e=>D(j(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),Ye=256*1024,Y=24,X=(e,t)=>i.t(`common:testsDialog.${e}`,t),Xe=(e,t)=>{let n=`${e}${t}`;return n.length<=Ye?n:n.slice(-Ye)},Ze=(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,Qe=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=Y,$e=e=>{e.scrollTop=e.scrollHeight},et=(e,t=!1)=>{$e(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{$e(e),t&&(r=window.requestAnimationFrame(()=>{$e(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},tt=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`,nt=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`},Z=e=>{let t=e.split(`/`);return t[t.length-1]||e},rt=e=>e.toLowerCase().trim().split(/\s+/).filter(Boolean),Q=(e,t)=>e.length===0?!0:e.every(e=>t.some(t=>t.includes(e))),it=(e,t)=>{let n=rt(t);return n.length===0?e:e.flatMap(e=>{let t=Z(e.path);if(Q(n,[t.toLowerCase(),e.path.toLowerCase()]))return[e];let r=e.cases.filter(r=>Q(n,[t.toLowerCase(),e.path.toLowerCase(),r.name.toLowerCase()]));return r.length===0?[]:[{...e,cases:r}]})},at=e=>X(e===`passed`?`status.passed`:e===`failed`?`status.failed`:e===`running`?`status.running`:e===`error`?`status.error`:e===`stopped`?`status.stopped`:`status.idle`),ot=e=>e?.selection?e.selection.kind===`all`?X(`selection.allTests`):e.selection.kind===`case`?e.selection.name:Z(e.selection.path):X(`selection.noRunYet`),st=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`,ct=e=>e===`failure`?`text-rose-200`:e===`success`?`text-emerald-200`:e===`warning`?`text-amber-200`:`text-slate-200`,lt=(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,ut=`min-w-24 justify-center shadow-none transition-none disabled:opacity-100`,dt=({line:e,tone:t})=>(0,R.jsx)(`div`,{"data-tone":t,className:y(`whitespace-pre-wrap break-words`,ct(t)),children:e===``?` `:e}),ft=(0,L.memo)(({canRunGranular:e,filePath:t,isActive:n,name:r,onRunCase:i})=>(0,R.jsxs)(`button`,{type:`button`,"aria-label":X(`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,R.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,R.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:r})]}));ft.displayName=`TestCaseRow`;var pt=(0,L.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:r,file:i,isExpanded:a,onRunCase:o,onRunFile:s,onToggleFile:c})=>{let l=e===`file`&&n===i.path,u=e===`case`&&n===i.path;return(0,R.jsx)(xe,{open:a,onOpenChange:e=>{c(i.path,e)},children:(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(T,{asChild:!0,children:(0,R.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":X(a?`fileRow.collapseAriaLabel`:`fileRow.expandAriaLabel`,{path:i.path}),className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,R.jsx)(Ce,{className:y(`h-4 w-4 transition-transform`,a&&`rotate-180`)})})}),(0,R.jsx)(`button`,{type:`button`,"aria-label":X(`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`,(l||u)&&`border-sky-400/45 bg-sky-500/10`),disabled:!r,onClick:()=>{s(i.path)},children:(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,R.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,R.jsx)(d,{className:`h-3.5 w-3.5`})}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:Z(i.path)}),(0,R.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:i.path})]}),(0,R.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:X(`fileRow.testCount`,{count:i.cases.length})})]})]})})]}),(0,R.jsx)(I,{children:(0,R.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:i.cases.length===0?(0,R.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:X(`fileRow.noNamedTests`)}):(0,R.jsx)(`div`,{className:`space-y-1`,children:i.cases.map(a=>{let s=e===`case`&&n===i.path&&t===a.name;return(0,R.jsx)(ft,{canRunGranular:r,filePath:i.path,isActive:s,name:a.name,onRunCase:o},a.id)})})})})]})})});pt.displayName=`DiscoveryFileRow`;var mt=(0,L.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:r,availableCommands:i,canRunGranular:a,discovery:o,expandedFiles:s,fullSuiteOnlyNotice:l,isLoading:u,selectedCommandId:d,selectedCommandName:p,sessionError:m,sessionStatus:h,shouldShowCommandSelector:g,onRunCase:ee,onRunFile:te,onSelectCommand:x,onToggleFile:S})=>{let[C,w]=(0,L.useState)(``),T=(0,L.useMemo)(()=>it(o,C),[o,C]),ne=(0,L.useMemo)(()=>T.reduce((e,t)=>e+t.cases.length,0),[T]),re=rt(C).length>0;return(0,R.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[g&&(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:X(`scope.label`)}),(0,R.jsxs)(ce,{children:[(0,R.jsx)(f,{asChild:!0,children:(0,R.jsxs)(b,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":X(`scope.selectedCommandAriaLabel`),disabled:i.length===0||h===`running`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:p??X(`scope.selectTestScope`)}),(0,R.jsx)(Ce,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,R.jsx)(n,{align:`start`,className:`w-72`,children:i.map(e=>(0,R.jsx)(A,{className:y(d===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{x(e.id)},children:(0,R.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),l&&(0,R.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:l}),(o.length>0||C.length>0)&&(0,R.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,R.jsx)(v,{type:`search`,value:C,onChange:e=>{w(e.target.value)},placeholder:X(`filter.placeholder`),"aria-label":X(`filter.ariaLabel`),className:`pr-10`}),C.length>0&&(0,R.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":X(`filter.clearAriaLabel`),className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{w(``)},children:(0,R.jsx)(_,{className:`size-4`})})]}),!i.length&&(0,R.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-4 text-sm text-muted-foreground`,children:X(`discovery.noCommands`)}),m&&(0,R.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:m}),(0,R.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,R.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,R.jsx)(`div`,{className:`min-w-0`,children:(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[X(`discovery.fileCount`,{count:T.length}),`, `,X(`discovery.caseCount`,{count:ne})]})}),u&&(0,R.jsx)(c,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:o.length===0&&!u?(0,R.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:X(`discovery.noFilesDetected`)}):T.length===0?(0,R.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:X(`discovery.noFilterMatches`)}):T.map(n=>(0,R.jsx)(pt,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:r,canRunGranular:a,file:n,isExpanded:re||(s[n.path]??!1),onRunCase:ee,onRunFile:te,onToggleFile:S},n.path))})]})]})})});mt.displayName=`DiscoveryPane`;var ht=(0,L.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:a,viewportRef:o,onScroll:s})=>{let c=(0,L.useMemo)(()=>t?k(t).replace(/\r\n/g,`
2
+ `).replace(/\r/g,`
3
+ `).split(`
4
+ `).map(e=>({line:e,tone:st(e)})):[],[t]);return(0,R.jsx)(`section`,{className:`min-h-0 px-4 py-4`,children:(0,R.jsxs)(`div`,{className:`flex h-full flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:r}),i&&(0,R.jsx)(F,{variant:`outline`,className:y(`px-3 py-1 text-xs uppercase tracking-[0.2em]`,tt(i)),children:at(i)}),a&&(0,R.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-xs font-medium uppercase tracking-[0.18em]`,children:[(0,R.jsxs)(`span`,{className:`text-rose-200`,children:[a.failed.count,` `,a.failed.label]}),(0,R.jsxs)(`span`,{className:`text-emerald-200`,children:[a.passed.count,` `,a.passed.label]})]}),e!=null&&(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:nt(e)}),n&&(0,R.jsx)(F,{variant:`outline`,className:`border-amber-400/30 bg-amber-500/10 text-amber-200`,children:X(`output.trimmed`)})]}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-2xl border border-border/70 bg-[#0d1017]`,children:(0,R.jsx)(`div`,{ref:o,"aria-label":X(`output.ariaLabel`),className:`h-full overflow-auto px-4 py-4`,onScroll:s,children:(0,R.jsx)(`div`,{className:`font-mono text-xs leading-5`,children:c.length>0?c.map((e,t)=>(0,R.jsx)(dt,{line:e.line,tone:e.tone},`${t}:${e.line}`)):(0,R.jsx)(`div`,{className:`text-slate-200`,children:X(`output.empty`)})})})})]})})});ht.displayName=`OutputPane`;var gt=(0,L.forwardRef)(({testCommands:e,onStatusChange:t,onTargetLabelChange:n,onClose:i,...c},d)=>{let f=c.scope,p=c.projectId,h=c.scope===`ticket`?c.ticketId:null,g=c.scope===`project`?c.targetKind:null,_=c.scope===`project`?c.targetBundleId:null,[v,y]=(0,L.useState)(e),[x,S]=(0,L.useState)(null),[C,w]=(0,L.useState)([]),[T,ne]=(0,L.useState)(``),[re,E]=(0,L.useState)({}),[ae,D]=(0,L.useState)(!0),[O,oe]=(0,L.useState)(!1),[k,se]=(0,L.useState)(!1),[A,ce]=(0,L.useState)(null),[le,j]=(0,L.useState)(!1),[de,fe]=(0,L.useState)(!1),pe=(0,L.useRef)(null),me=(0,L.useRef)(!1),_e=(0,L.useRef)(null),ve=(0,L.useRef)(!0),ye=(0,L.useRef)(null),M=(0,L.useRef)(null),be=x?.selection?.kind??null,N=x?.selection?.kind===`all`?null:x?.selection?.path??null,xe=x?.selection?.kind===`case`?x.selection.name:null,P=x?.id??null,F=x?.status??null,I=(0,L.useMemo)(()=>v.find(e=>e.id===T)??null,[v,T]),Se=(0,L.useMemo)(()=>{if(x?.summary?.failed_count==null&&x?.summary?.passed_count==null&&x?.summary?.failed_file_count==null&&x?.summary?.passed_file_count==null)return null;let e=x?.summary?.failed_count==null&&x?.summary?.passed_count==null;return{failed:F===`failed`&&x?.summary?.failed_count==null&&x?.summary?.failed_file_count!=null||e?{count:x?.summary?.failed_file_count??0,label:X(`summaryCounts.filesFailed`)}:{count:x?.summary?.failed_count??0,label:X(`summaryCounts.failed`)},passed:e?{count:x?.summary?.passed_file_count??0,label:X(`summaryCounts.filesPassed`)}:{count:x?.summary?.passed_count??x?.summary?.passed_file_count??0,label:X(`summaryCounts.passed`)}}},[x?.summary?.failed_count,x?.summary?.passed_count,x?.summary?.failed_file_count,x?.summary?.passed_file_count,F]),Ce=I?.runner===`unknown`?X(`scope.fullSuiteOnlyNotice`):null,z=!!(I&&x?.status!==`running`&&!O&&!k),B=z,V=z&&de,H=v.length>1,{runs:we}=ue(p),U=x?.run_id?we.find(e=>e.id===x.run_id)??null:null;(0,L.useEffect)(()=>{T||v.length===0||ne(v[0]?.id??``)},[v,T]),(0,L.useEffect)(()=>{e.length>0&&y(t=>lt(t,e)?t:e)},[e]),(0,L.useEffect)(()=>{if(v.length>0||!p)return;let e=new AbortController;return te(e.signal).then(e=>{let t=e.find(e=>e.id===p);t&&y(e=>{let n=ie(t);return lt(e,n)?e:n})}).catch(()=>{}),()=>{e.abort()}},[v.length,p]),(0,L.useEffect)(()=>{let e=e=>{!e||e.id!==pe.current||S(t=>Ze(t,e))},t=e=>{!e||e.session_id!==pe.current||S(t=>!t||t.id!==e.session_id||e.run_id&&t.run_id&&e.run_id!==t.run_id?t:{...t,output:Xe(t.output,e.chunk),output_truncated:e.output_truncated})};return r.on(`test-session:updated`,e),r.on(`test-session:output`,t),()=>{r.off(`test-session:updated`,e),r.off(`test-session:output`,t)}},[]),(0,L.useEffect)(()=>{let e=_e.current;if(!e){ye.current=x?.output??null,M.current=x?.status??null;return}let t=ye.current!==(x?.output??null),n=M.current!==`running`&&x?.status===`running`,r=M.current===`running`&&x?.status!==`running`;if(n&&(ve.current=!0),n||t&&x?.status===`running`&&ve.current||r&&ve.current){let t=et(e,r);return ye.current=x?.output??null,M.current=x?.status??null,t}ye.current=x?.output??null,M.current=x?.status??null},[x?.output,x?.status]),(0,L.useEffect)(()=>{let e=!1;return(async()=>{try{let t;if(f===`project`){if(!p)return;t=await We(p,{target_kind:g??`repo_root`,target_bundle_id:_??null})}else t=await Ge(h??``,p);if(e){Je(t.id).catch(()=>{});return}pe.current=t.id,S(t)}catch(t){e||ce(t instanceof he?t.message:X(`messages.loadRunnerError`))}finally{!e&&pe.current==null&&D(!1)}})(),()=>{e=!0}},[p,f,_,g,h]),(0,L.useEffect)(()=>{U&&S(e=>{if(!e||e.run_id!==U.id)return e;let t=U.status===`completed`?`passed`:U.status===`failed`?`failed`:U.status===`cancelled`||U.status===`interrupted`?`stopped`:`running`;return e.status===t&&e.error===(U.failure?.message??e.error)?e:{...e,status:t,error:U.failure?.message??e.error,started_at:U.started_at??e.started_at,completed_at:U.completed_at??e.completed_at}})},[U]),(0,L.useEffect)(()=>{if(!x?.id){fe(!1);return}if(v.length>0&&!T){fe(!1);return}let e=new AbortController,t=!1;return D(!0),fe(!1),Ke(x.id,{commandId:T||null,signal:e.signal}).then(e=>{t||(w(e.files),fe(e.supports_granular_selection))}).catch(n=>{t||e.signal.aborted||ce(n instanceof he?n.message:X(`messages.discoverError`))}).finally(()=>{t||D(!1)}),()=>{t=!0,e.abort()}},[v.length,T,x?.id]),(0,L.useEffect)(()=>()=>{let e=pe.current;!e||me.current||(me.current=!0,Je(e).catch(()=>{}))},[]);let W=(0,L.useCallback)(async e=>{if(!(!P||F===`running`||!I||O||k)){ce(null),oe(!0);try{let t=await J(P,{command_id:I.id,selection:e});S(e=>Ze(e,t))}catch(e){ce(e instanceof he?e.message:X(`messages.startError`))}finally{oe(!1)}}},[O,k,I,P,F]),G=(0,L.useCallback)(async()=>{if(!(!P||F!==`running`||k)){ce(null),se(!0);try{let e=await qe(P);S(t=>Ze(t,e))}catch(e){ce(e instanceof he?e.message:X(`messages.stopError`))}finally{se(!1)}}},[k,P,F]),Te=(0,L.useCallback)(()=>{let e=pe.current;if(!e||me.current){i();return}me.current=!0,i(),Je(e).catch(()=>{})},[i]),K=(0,L.useCallback)(()=>{if(F===`running`){j(!0);return}Te()},[Te,F]);(0,L.useImperativeHandle)(d,()=>({requestClose:K}),[K]),(0,L.useEffect)(()=>{t?.(F===`running`?`running`:F===`passed`?`finished`:F===`failed`||F===`error`?`error`:F===`stopped`?`interrupted`:`inactive`)},[t,F]),(0,L.useEffect)(()=>{x?.target_label&&n?.(x.target_label)},[n,x?.target_label]);let Ee=(0,L.useCallback)(()=>{let e=_e.current;e&&(ve.current=Qe(e))},[]),De=(0,L.useCallback)(e=>{ne(e)},[]),Oe=(0,L.useCallback)((e,t)=>{E(n=>(n[e]??!1)===t?n:{...n,[e]:t})},[]),ke=(0,L.useCallback)(e=>{W({kind:`file`,path:e})},[W]),Ae=(0,L.useCallback)((e,t)=>{W({kind:`case`,path:e,name:t})},[W]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,"data-testid":`tests-panel-layout`,children:[(0,R.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,R.jsx)(mt,{activeSelectionKind:be,activeSelectionName:xe,activeSelectionPath:N,availableCommands:v,canRunGranular:V,discovery:C,expandedFiles:re,fullSuiteOnlyNotice:Ce,isLoading:ae,selectedCommandId:T,selectedCommandName:I?.name??null,sessionError:A,sessionStatus:F,shouldShowCommandSelector:H,onRunCase:Ae,onRunFile:ke,onSelectCommand:De,onToggleFile:Oe}),(0,R.jsx)(ht,{durationMs:x?.duration_ms??null,output:x?.output??``,outputTruncated:x?.output_truncated??!1,selectionLabel:ot(x),status:F,summaryCounts:Se,viewportRef:_e,onScroll:Ee})]}),(0,R.jsx)(u,{className:`shrink-0 border-t border-border/70 px-6 py-4 sm:flex-row sm:items-center sm:justify-end`,children:(0,R.jsx)(`div`,{className:`flex items-center justify-end gap-2`,children:x?.status===`running`?(0,R.jsxs)(b,{type:`button`,variant:`destructive`,className:ut,onClick:()=>{G()},disabled:k,children:[(0,R.jsx)(m,{className:`h-4 w-4`}),(0,R.jsx)(`span`,{children:X(`actions.stop`)})]}):(0,R.jsxs)(b,{type:`button`,variant:`success`,className:ut,disabled:!B,onClick:()=>{W({kind:`all`})},children:[(0,R.jsx)(a,{className:`h-4 w-4`}),(0,R.jsx)(`span`,{children:X(`actions.run`)})]})})})]}),(0,R.jsx)(s,{open:le,onOpenChange:j,children:(0,R.jsxs)(ee,{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,R.jsxs)(ge,{children:[(0,R.jsx)(l,{className:`text-sm font-semibold uppercase tracking-widest text-muted-foreground`,children:X(`closeConfirmation.title`)}),(0,R.jsx)(o,{className:`text-sm text-foreground whitespace-pre-line`,children:X(`closeConfirmation.description`)})]}),(0,R.jsxs)(u,{className:`sm:flex-row sm:justify-end`,children:[(0,R.jsx)(b,{type:`button`,variant:`ghost`,onClick:()=>j(!1),children:X(`closeConfirmation.keepRunning`)}),(0,R.jsx)(b,{type:`button`,variant:`destructive`,onClick:()=>{j(!1),Te()},children:X(`closeConfirmation.stopAndClose`)})]})]})})]})});gt.displayName=`TestsPanel`;var _t=`archon.verification-tab`,vt=()=>{try{let e=window.localStorage.getItem(_t);return e===`checks`||e===`tests`?e:null}catch{return null}},$=e=>{try{window.localStorage.setItem(_t,e)}catch{}},yt=({targetLabel:e,definitions:t,requiredDefinitionIds:n=[],preReviewDefinitionIds:r=[],checksTarget:i,testsTarget:a,onClose:c,onOpenActivity:u,requestedInitialTab:d,directBatchRunId:f,directAttemptRunId:m,onCheckSelectionChange:h,onUnavailable:v})=>{let{t:y}=P(`common`,{keyPrefix:`verificationDialog`}),te=me(t),S=i!==null&&(t.length>0||!!i.gateEvaluationId||!!f),C=a!==null&&te.length>0,[w,T]=(0,L.useState)(()=>{if(d===`checks`&&S||d===`tests`&&C)return d;let e=vt();return e===`checks`&&S||e===`tests`&&C?e:S?`checks`:`tests`}),[ne,re]=(0,L.useState)(()=>new Set([w])),[ie,E]=(0,L.useState)(`inactive`),[D,oe]=(0,L.useState)(`inactive`),k=(0,L.useRef)(null),se=(0,L.useRef)(null);(0,L.useEffect)(()=>{if(w===`checks`&&!S||w===`tests`&&!C){let e=S?`checks`:`tests`;T(e),re(t=>new Set(t).add(e))}},[w,S,C]);let A=e=>{if(se.current=e??null,a){let e=k.current;if(e){e.requestClose();return}}(e??c)()},ce=()=>{let e=se.current??c;se.current=null,e()};return(0,R.jsx)(s,{open:!0,onOpenChange:e=>{e||A()},children:(0,R.jsxs)(ee,{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,R.jsx)(l,{className:`sr-only`,children:y(`title`)}),(0,R.jsx)(o,{className:`sr-only`,children:y(`description`)}),(0,R.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,R.jsxs)(`div`,{className:`flex min-w-0 gap-3`,children:[(0,R.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,R.jsx)(g,{className:`size-5`})}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:y(`title`)}),(0,R.jsx)(`p`,{className:`truncate text-sm text-muted-foreground`,children:e})]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u&&(0,R.jsx)(b,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>A(u),children:y(`openActivity`)}),(0,R.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":y(`close`),onClick:()=>A(),children:(0,R.jsx)(_,{className:`size-4`})})]})]}),(0,R.jsxs)(le,{value:w,onValueChange:e=>{e!==`checks`&&e!==`tests`||(T(e),re(t=>new Set(t).add(e)),$(e))},className:`flex min-h-0 flex-1 flex-col`,children:[(0,R.jsxs)(`div`,{className:`shrink-0 border-b border-border/70 px-4 py-3 sm:px-6`,children:[(0,R.jsxs)(ae,{"aria-label":y(`tabsAriaLabel`),children:[S&&(0,R.jsxs)(x,{value:`checks`,className:`gap-2`,children:[(0,R.jsx)(g,{className:`size-4`}),(0,R.jsx)(`span`,{children:y(`tabs.checks.label`)}),(0,R.jsx)(`span`,{className:`inline-flex shrink-0`,role:`status`,"aria-label":y(`status.checks.${ie}`),children:(0,R.jsx)(p,{state:ie})})]}),C&&(0,R.jsxs)(x,{value:`tests`,className:`gap-2`,children:[(0,R.jsx)(M,{className:`size-4`}),(0,R.jsx)(`span`,{children:y(`tabs.tests.label`)}),(0,R.jsx)(`span`,{className:`inline-flex shrink-0`,role:`status`,"aria-label":y(`status.tests.${D}`),children:(0,R.jsx)(p,{state:D})})]})]}),(0,R.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:y(`tabs.${w}.description`)})]}),S&&i&&ne.has(`checks`)&&(0,R.jsx)(O,{value:`checks`,forceMount:!0,className:`mt-0 flex min-h-0 flex-1 flex-col overflow-hidden data-[state=inactive]:hidden`,children:(0,R.jsx)(Ue,{...i,definitions:t,requiredDefinitionIds:n,preReviewDefinitionIds:r,directBatchRunId:f,directAttemptRunId:m,onSelectionChange:w===`checks`?h:void 0,onUnavailable:v,onStatusChange:E})}),a&&te.length>0&&ne.has(`tests`)&&(0,R.jsx)(O,{value:`tests`,forceMount:!0,className:`mt-0 flex min-h-0 flex-1 flex-col overflow-hidden data-[state=inactive]:hidden`,children:(0,R.jsx)(gt,{ref:k,...a,testCommands:te,onStatusChange:oe,onClose:ce})})]})]})})};export{yt as VerificationDialog};