@vostride/agent-qa-dashboard-ui 0.1.20 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/dist/assets/{arrow-up-down-B4k_G_pz.js → arrow-up-down-CKc1J6oh.js} +1 -1
  2. package/dist/assets/{badge-DHCU59H0.js → badge-B-yh3kbi.js} +1 -1
  3. package/dist/assets/batch-action-bar-MMUxALHz.js +4 -0
  4. package/dist/assets/check-DH5_3cK-.js +1 -0
  5. package/dist/assets/checkbox-B5x0V2a2.js +1 -0
  6. package/dist/assets/circle-DjggEctd.js +1 -0
  7. package/dist/assets/circle-dashed-WDoZ8ADk.js +1 -0
  8. package/dist/assets/circle-slash-Baq9Dw6f.js +1 -0
  9. package/dist/assets/{circle-x-ITZ_DbXH.js → circle-x-1lf_9y_c.js} +1 -1
  10. package/dist/assets/config-CnN4bOco.js +3 -0
  11. package/dist/assets/{cssMode-Ci86QdEV.js → cssMode-CIWhUqfG.js} +1 -1
  12. package/dist/assets/display-step-opeACkeD.js +1 -0
  13. package/dist/assets/dist-Cy8QoEce.js +1 -0
  14. package/dist/assets/{empty-state-3cB27tBp.js → empty-state-2mwYYmoQ.js} +1 -1
  15. package/dist/assets/{file-code-DDa3GwxK.js → file-code-BTJCyvvJ.js} +1 -1
  16. package/dist/assets/filename-validation-I94bcMf7.js +1 -0
  17. package/dist/assets/{freemarker2-BAginoYi.js → freemarker2-BiVXttLB.js} +1 -1
  18. package/dist/assets/globe-B0WEPp3h.js +1 -0
  19. package/dist/assets/{grip-vertical-MY-i_r9J.js → grip-vertical-B87oMfre.js} +1 -1
  20. package/dist/assets/{handlebars-C6jsxsLs.js → handlebars-C_rmhix8.js} +1 -1
  21. package/dist/assets/hook-editor-DetIWjh8.js +1 -0
  22. package/dist/assets/{hook-runtime-DCkWsFrF.js → hook-runtime-8xwsNog-.js} +1 -1
  23. package/dist/assets/hook-viewer-C_nzb-qD.js +1 -0
  24. package/dist/assets/hooks-BIXR5djX.js +1 -0
  25. package/dist/assets/{html-Cyb0M0oP.js → html-v4GGDD2l.js} +1 -1
  26. package/dist/assets/{htmlMode-DshMgI5s.js → htmlMode-DsnRJeF2.js} +1 -1
  27. package/dist/assets/id-badge-CIbcJUv0.js +111 -0
  28. package/dist/assets/index-0GfHLQ0v.css +2 -0
  29. package/dist/assets/index-CXuVkD6-.js +116 -0
  30. package/dist/assets/insights-CfqFVe4T.js +1 -0
  31. package/dist/assets/{insights-line-grid-eCcWaGgD.js → insights-line-grid-EcYgqiLS.js} +6 -6
  32. package/dist/assets/{javascript-BsU_m_4o.js → javascript-B12FD1Gz.js} +1 -1
  33. package/dist/assets/{jsonMode-DUKNqYzB.js → jsonMode-C_mhVvGR.js} +1 -1
  34. package/dist/assets/knowledge-view-BHNh7MwX.js +1 -0
  35. package/dist/assets/label-CYpyu7PJ.js +1 -0
  36. package/dist/assets/{liquid-BYz2oQ7r.js → liquid-l2oB7oKx.js} +1 -1
  37. package/dist/assets/live-run-DOfPiVKU.js +1 -0
  38. package/dist/assets/live-step-row-BtLYYCKS.js +1 -0
  39. package/dist/assets/{lspLanguageFeatures-CPMJ3OMK.js → lspLanguageFeatures-By4f0cSm.js} +1 -1
  40. package/dist/assets/{mdx-Bfn3OASJ.js → mdx-Cyix08OW.js} +1 -1
  41. package/dist/assets/monaco-editor-BQB4vEk_.js +2 -0
  42. package/dist/assets/{monaco-editor-inner-B2iWC3vK.js → monaco-editor-inner-DBI8AgAJ.js} +4 -4
  43. package/dist/assets/{monaco.contribution-B-XUbmv5.js → monaco.contribution-C7Dknl5j.js} +2 -2
  44. package/dist/assets/numeric-input-DcozBggQ.js +1 -0
  45. package/dist/assets/plus-DNc2RueT.js +1 -0
  46. package/dist/assets/popover-DThBIgGA.js +1 -0
  47. package/dist/assets/{python-D7QiYvsM.js → python-cdSYU9zt.js} +1 -1
  48. package/dist/assets/radio-group-DDMpRS3x.js +1 -0
  49. package/dist/assets/{razor-ByxQWcvk.js → razor-BWMXhgx8.js} +1 -1
  50. package/dist/assets/{refresh-cw-BtT1wl9S.js → refresh-cw-BQdOC6UA.js} +1 -1
  51. package/dist/assets/resizable-om0nWp3k.js +1 -0
  52. package/dist/assets/run-detail-C9oixuvH.js +1 -0
  53. package/dist/assets/run-status-badge-DRzXddrc.js +1 -0
  54. package/dist/assets/run-stream-reducer-BXMulZq1.js +1 -0
  55. package/dist/assets/runs-BDKh94Pq.js +1 -0
  56. package/dist/assets/{scroll-area-CPuygHdB.js → scroll-area-WFIgUp-0.js} +1 -1
  57. package/dist/assets/select-JI5Kadjp.js +1 -0
  58. package/dist/assets/{shortcut-hints-CUbl8p3Z.js → shortcut-hints-_J-i7rAL.js} +1 -1
  59. package/dist/assets/split-button-BHdketN3.js +1 -0
  60. package/dist/assets/suite-editor-Ce16nUF9.js +5 -0
  61. package/dist/assets/suite-navbar-D8RcUReD.js +1 -0
  62. package/dist/assets/suite-viewer-Bc78bHVL.js +1 -0
  63. package/dist/assets/suites-D2VXpj7W.js +1 -0
  64. package/dist/assets/switch-BgfA6DyL.js +1 -0
  65. package/dist/assets/tab-console-CpnOoTyg.js +1 -0
  66. package/dist/assets/table-e38rtLis.js +1 -0
  67. package/dist/assets/tabs-CsAJVEvt.js +1 -0
  68. package/dist/assets/test-editor-vZsQDd2R.js +9 -0
  69. package/dist/assets/test-navbar-BfzeL-K8.js +7 -0
  70. package/dist/assets/test-viewer-Cek_cnB3.js +1 -0
  71. package/dist/assets/tests-CzPu8CPe.js +1 -0
  72. package/dist/assets/tests-suites-table-widths-nMJHxqRN.js +1 -0
  73. package/dist/assets/textarea-BP7XqG3v.js +1 -0
  74. package/dist/assets/{trash-2-B2a3jDA4.js → trash-2-87f7wzeR.js} +1 -1
  75. package/dist/assets/{tsMode-CPlGHPm6.js → tsMode-CqMhxF8i.js} +1 -1
  76. package/dist/assets/{typescript-BAelS_Yl.js → typescript-DOy-nOZu.js} +1 -1
  77. package/dist/assets/use-clipboard-copy-Bmyv0FFY.js +1 -0
  78. package/dist/assets/use-hook-run-session-DnSkzl1A.js +1 -0
  79. package/dist/assets/use-keyboard-shortcuts-befVnBO6.js +1 -0
  80. package/dist/assets/{use-page-title-C_f72ri7.js → use-page-title-fn79XYtf.js} +1 -1
  81. package/dist/assets/use-run-status-favicon-vVlATUoT.js +1 -0
  82. package/dist/assets/use-selection-queue-BAssrkmC.js +1 -0
  83. package/dist/assets/viewer-url-state-BnbixmdH.js +1 -0
  84. package/dist/assets/{workers-Br5uqX4Z.js → workers-By3SZV-o.js} +1 -1
  85. package/dist/assets/wrench-y-wKZ-0A.js +1 -0
  86. package/dist/assets/{xml-DB-ZrZ2e.js → xml-BEMkcljk.js} +1 -1
  87. package/dist/assets/{yaml-BeKBVxAt.js → yaml-CfPYAxWJ.js} +1 -1
  88. package/dist/assets/{zap-CHRkZMyJ.js → zap-DKRM77fm.js} +1 -1
  89. package/dist/index.html +2 -2
  90. package/package.json +8 -8
  91. package/dist/assets/batch-action-bar-Dd_8W0p9.js +0 -1
  92. package/dist/assets/circle-alert-TPWM0719.js +0 -1
  93. package/dist/assets/config-DMv2WZOF.js +0 -10
  94. package/dist/assets/copy-D-NZb7QZ.js +0 -1
  95. package/dist/assets/display-step-CYKXUkbs.js +0 -1
  96. package/dist/assets/dist-_gv57K8d.js +0 -1
  97. package/dist/assets/external-link-DvyIDphy.js +0 -1
  98. package/dist/assets/eye-DkGk2gsF.js +0 -1
  99. package/dist/assets/file-search-NMd1pdjr.js +0 -1
  100. package/dist/assets/filename-validation-CaFIUcWo.js +0 -1
  101. package/dist/assets/hook-editor-Cjix8FD5.js +0 -1
  102. package/dist/assets/hook-viewer-Ca73H02j.js +0 -1
  103. package/dist/assets/hooks-3zdPj97l.js +0 -1
  104. package/dist/assets/id-badge-CIlIhfqv.js +0 -111
  105. package/dist/assets/index-Bu0wLCES.css +0 -2
  106. package/dist/assets/index-CWwAjH9Q.js +0 -58
  107. package/dist/assets/insights-_VG03kv7.js +0 -1
  108. package/dist/assets/lib-B4PNeU44.js +0 -4
  109. package/dist/assets/live-run-CL1uuNh1.js +0 -1
  110. package/dist/assets/marked.esm-DGP46SGL.js +0 -64
  111. package/dist/assets/memory-CAPirlHn.js +0 -1
  112. package/dist/assets/memory-product-CBcChlmH.js +0 -2
  113. package/dist/assets/monaco-editor-q3UYuc-5.js +0 -2
  114. package/dist/assets/observation-block-DR8MBlgg.js +0 -1
  115. package/dist/assets/observation-markdown-BOJNfOw1.js +0 -1
  116. package/dist/assets/pencil-DBjmgk_1.js +0 -1
  117. package/dist/assets/plus-DWwmmJlz.js +0 -1
  118. package/dist/assets/popover-CuqW26_E.js +0 -1
  119. package/dist/assets/resizable-C3bJVUPo.js +0 -1
  120. package/dist/assets/run-detail-Bo30AusG.js +0 -1
  121. package/dist/assets/runs-BDWggMSA.js +0 -1
  122. package/dist/assets/select-DF8sGWfv.js +0 -1
  123. package/dist/assets/split-button-BKCtgFiC.js +0 -1
  124. package/dist/assets/square-CEW9RAjr.js +0 -1
  125. package/dist/assets/step-name-pills-RalYL-ZJ.js +0 -1
  126. package/dist/assets/suite-editor-DMnWq7BC.js +0 -5
  127. package/dist/assets/suite-navbar-D9wliAeW.js +0 -1
  128. package/dist/assets/suite-viewer-D55qWO4b.js +0 -1
  129. package/dist/assets/suites-C02UROvF.js +0 -1
  130. package/dist/assets/switch-CgiZ-8Q1.js +0 -1
  131. package/dist/assets/tab-console-vamiKOKH.js +0 -1
  132. package/dist/assets/table-cLA2Rr2t.js +0 -1
  133. package/dist/assets/tabs-xxRH91gb.js +0 -1
  134. package/dist/assets/test-editor-SQG9pODg.js +0 -9
  135. package/dist/assets/test-navbar-DGyMPxYJ.js +0 -7
  136. package/dist/assets/test-viewer-D3UUL8p1.js +0 -1
  137. package/dist/assets/tests-Dz-BuO2B.js +0 -1
  138. package/dist/assets/tests-suites-table-widths-CAr7nQWt.js +0 -1
  139. package/dist/assets/textarea-wN2tIsDn.js +0 -1
  140. package/dist/assets/use-hook-run-session-RU-LfCyB.js +0 -1
  141. package/dist/assets/use-keyboard-shortcuts-O6nfytzm.js +0 -1
  142. package/dist/assets/use-run-status-favicon-CoVHCGAy.js +0 -1
  143. package/dist/assets/use-selection-queue-3FNZ4lRr.js +0 -1
  144. package/dist/assets/viewer-url-state-Dsu1DY22.js +0 -1
  145. /package/dist/assets/{abap-BEq1sfI-.js → abap-CpHUwCVK.js} +0 -0
  146. /package/dist/assets/{apex-B44QgtCx.js → apex-DlD7oJX6.js} +0 -0
  147. /package/dist/assets/{azcli-DMZ9GGL6.js → azcli-CmXFAbc-.js} +0 -0
  148. /package/dist/assets/{bat-C9UmLmb8.js → bat-DdNJq4hH.js} +0 -0
  149. /package/dist/assets/{bicep-DftblL_H.js → bicep-Bppz7WOA.js} +0 -0
  150. /package/dist/assets/{cameligo-CzLnGslK.js → cameligo-0MRMdSmg.js} +0 -0
  151. /package/dist/assets/{clojure-ByLwyAQs.js → clojure-B5dKj863.js} +0 -0
  152. /package/dist/assets/{coffee-68kO868m.js → coffee-DSbWjzk7.js} +0 -0
  153. /package/dist/assets/{cpp-DzwB3t3R.js → cpp-SBF8SAh9.js} +0 -0
  154. /package/dist/assets/{csharp-DYYXYf_U.js → csharp-Lzuq_1t-.js} +0 -0
  155. /package/dist/assets/{csp-CM2i4rGd.js → csp-BEzxZqi1.js} +0 -0
  156. /package/dist/assets/{css-DeSoHz_W.js → css-C3D3PKln.js} +0 -0
  157. /package/dist/assets/{cypher-BKNyhJD3.js → cypher-CQ3dEPmv.js} +0 -0
  158. /package/dist/assets/{dart-BQc3JPCX.js → dart-DCPmxolI.js} +0 -0
  159. /package/dist/assets/{dockerfile-BGxPbctm.js → dockerfile-B_2_aaTO.js} +0 -0
  160. /package/dist/assets/{ecl-CKjBzfQ2.js → ecl-rADUeXsV.js} +0 -0
  161. /package/dist/assets/{editor.api2-CX0IWJmc.js → editor.api2-DXR_ThFM.js} +0 -0
  162. /package/dist/assets/{elixir-BBLR1E4J.js → elixir-DOd-TuJO.js} +0 -0
  163. /package/dist/assets/{flow9-DZyS6Im9.js → flow9-Bf7zg_j0.js} +0 -0
  164. /package/dist/assets/{format-Y_Dbfary.js → format-BpI4TiHn.js} +0 -0
  165. /package/dist/assets/{fsharp-B_k18Kji.js → fsharp-BqROZjbA.js} +0 -0
  166. /package/dist/assets/{go-B5m-VPlE.js → go-oQTP5uLe.js} +0 -0
  167. /package/dist/assets/{graphql-B4NvZBRl.js → graphql-CSHfTU3q.js} +0 -0
  168. /package/dist/assets/{hcl-CXiUP62m.js → hcl-CeG-RoFJ.js} +0 -0
  169. /package/dist/assets/{ini-DIf6wU5x.js → ini-B2Dv4ohc.js} +0 -0
  170. /package/dist/assets/{java-CpjOue3Z.js → java-aUDDeufb.js} +0 -0
  171. /package/dist/assets/{julia-dxHeF5LM.js → julia-C5LbruO5.js} +0 -0
  172. /package/dist/assets/{kotlin-DRRSuc55.js → kotlin-C6mOuSKk.js} +0 -0
  173. /package/dist/assets/{less-tNOoNPeH.js → less-D5qC3caW.js} +0 -0
  174. /package/dist/assets/{lexon-zuaObGAE.js → lexon-Dr2La-fj.js} +0 -0
  175. /package/dist/assets/{lua-BDGwBzPZ.js → lua-Zy6u5z6Z.js} +0 -0
  176. /package/dist/assets/{m3-FllEI98A.js → m3-C7XHeDz_.js} +0 -0
  177. /package/dist/assets/{markdown-Dg9O28Mh.js → markdown-PiF7r-2h.js} +0 -0
  178. /package/dist/assets/{mips-BSEXxt-j.js → mips-nn07GiyE.js} +0 -0
  179. /package/dist/assets/{msdax-BUYxl4Gb.js → msdax-DaKFVMST.js} +0 -0
  180. /package/dist/assets/{mysql-CKjgZvko.js → mysql-C6d6xrbU.js} +0 -0
  181. /package/dist/assets/{objective-c-CMAdlqWg.js → objective-c-B6KMtI-k.js} +0 -0
  182. /package/dist/assets/{pascal-DnrBRw9P.js → pascal-DYr8MPE7.js} +0 -0
  183. /package/dist/assets/{pascaligo-DGZxRh0P.js → pascaligo-B3pd-jJ_.js} +0 -0
  184. /package/dist/assets/{perl-CKcCV5P6.js → perl-z2xUzoaL.js} +0 -0
  185. /package/dist/assets/{pgsql-D117QWhR.js → pgsql-DUvT-09-.js} +0 -0
  186. /package/dist/assets/{php-B7LpRV3v.js → php-CGyOmJfy.js} +0 -0
  187. /package/dist/assets/{pla-75s5EwYc.js → pla-CMqgvyD0.js} +0 -0
  188. /package/dist/assets/{postiats-FKqEVO_y.js → postiats-Dx5LUn4Z.js} +0 -0
  189. /package/dist/assets/{powerquery-D2B9xeZA.js → powerquery-DazYxvJ6.js} +0 -0
  190. /package/dist/assets/{powershell-DVyjSbmt.js → powershell-B3nwlDka.js} +0 -0
  191. /package/dist/assets/{protobuf-BBsLf-fq.js → protobuf-BGuu2u2s.js} +0 -0
  192. /package/dist/assets/{pug-CWV-ph9P.js → pug-Dbte1MXA.js} +0 -0
  193. /package/dist/assets/{qsharp-QhIGXK1X.js → qsharp-DJLwBOvG.js} +0 -0
  194. /package/dist/assets/{r-BQomAm4N.js → r-DmGBRSHj.js} +0 -0
  195. /package/dist/assets/{redis-DzIifZp4.js → redis-VvUYn0a4.js} +0 -0
  196. /package/dist/assets/{redshift-C4TPhoa0.js → redshift-6GdDrxg3.js} +0 -0
  197. /package/dist/assets/{restructuredtext-Dapr4eTe.js → restructuredtext-CfAB8aRU.js} +0 -0
  198. /package/dist/assets/{ruby-BfU5yBGC.js → ruby-CIYK6MXY.js} +0 -0
  199. /package/dist/assets/{rust-BkuRlY3p.js → rust-CTHZfjj9.js} +0 -0
  200. /package/dist/assets/{sb-C5vEAPYs.js → sb-CkKTdkz_.js} +0 -0
  201. /package/dist/assets/{scala-CUr1vafD.js → scala-Bx-Wr9TM.js} +0 -0
  202. /package/dist/assets/{scheme-wTgw6IJZ.js → scheme-Dcfi6f83.js} +0 -0
  203. /package/dist/assets/{scss-D_2qOFds.js → scss-ByL-7PFQ.js} +0 -0
  204. /package/dist/assets/{shell-CYPHnmAv.js → shell-Csnb9Yqd.js} +0 -0
  205. /package/dist/assets/{solidity-Dg-teBwM.js → solidity-Dbw5-0QP.js} +0 -0
  206. /package/dist/assets/{sophia-BZcSzYf2.js → sophia-ZQ3saZQx.js} +0 -0
  207. /package/dist/assets/{sparql-B198P2td.js → sparql-BEtOel8u.js} +0 -0
  208. /package/dist/assets/{sql-DTwIGDsL.js → sql-DGPDbzB7.js} +0 -0
  209. /package/dist/assets/{st-DRydv-vG.js → st-GeW2MOgh.js} +0 -0
  210. /package/dist/assets/{swift-DsJ-FzuB.js → swift-BVYTN8jq.js} +0 -0
  211. /package/dist/assets/{systemverilog-BfzGNA0B.js → systemverilog-Deg2a8Lr.js} +0 -0
  212. /package/dist/assets/{tcl-i-A18rYd.js → tcl-6DnLmROF.js} +0 -0
  213. /package/dist/assets/{twig-BcTx4v-O.js → twig-XbbXW9Yz.js} +0 -0
  214. /package/dist/assets/{typespec-C8pW8LGC.js → typespec-CRlV8GhI.js} +0 -0
  215. /package/dist/assets/{vb-DhhgAOPk.js → vb-BHE2izPH.js} +0 -0
  216. /package/dist/assets/{wgsl-CLi0cHxr.js → wgsl-Bf5vkfmY.js} +0 -0
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{a as t,o as n}from"./run-stream-reducer-BXMulZq1.js";import{a as r,c as i,l as a,o,p as s,r as c,s as l,t as u,u as d}from"./use-clipboard-copy-Bmyv0FFY.js";import{A as f,C as p,D as m,E as h,M as g,N as _,O as v,S as y,T as b,_ as x,a as S,b as C,c as w,d as T,f as E,g as D,h as O,i as k,j as A,k as j,l as M,m as N,n as ee,o as P,p as F,r as I,s as te,t as L,u as R,v as z,w as ne,x as re,y as ie}from"./tab-console-CpnOoTyg.js";import{t as ae}from"./check-DH5_3cK-.js";import{a as B,i as V,n as oe,r as se,t as ce}from"./select-JI5Kadjp.js";import{n as le,r as ue,t as de}from"./textarea-BP7XqG3v.js";import{t as fe}from"./circle-dashed-WDoZ8ADk.js";import{a as pe,i as me,n as he,r as ge,t as _e}from"./use-run-status-favicon-vVlATUoT.js";import{t as ve}from"./circle-slash-Baq9Dw6f.js";import{t as H}from"./circle-x-1lf_9y_c.js";import{t as ye}from"./circle-DjggEctd.js";import{n as be,r as xe,t as Se}from"./radio-group-DDMpRS3x.js";import{t as Ce}from"./globe-B0WEPp3h.js";import{n as we,r as Te}from"./shortcut-hints-_J-i7rAL.js";import{t as Ee}from"./plus-DNc2RueT.js";import{t as De}from"./refresh-cw-BQdOC6UA.js";import{t as Oe}from"./zap-DKRM77fm.js";import{t as ke}from"./label-CYpyu7PJ.js";import{n as Ae,r as je,t as Me}from"./popover-DThBIgGA.js";import{i as Ne,n as Pe,r as Fe,t as Ie}from"./tabs-CsAJVEvt.js";import{A as Le,Ar as Re,B as U,Ct as ze,D as Be,Dt as W,F as Ve,Fs as He,Hs as Ue,Ht as We,I as Ge,In as Ke,It as G,J as qe,K as Je,Kt as K,Ln as Ye,Lt as Xe,M as Ze,Mn as q,Mt as Qe,N as $e,Nn as et,Nt as tt,O as nt,Or as rt,P as it,Pt as J,Qt as at,Rn as ot,Rs as st,Sc as ct,Sr as lt,T as ut,Tt as dt,U as ft,Un as pt,Us as mt,Ut as Y,Vn as ht,Xt as gt,_c as _t,br as vt,f as yt,gc as bt,h as xt,j as St,js as Ct,k as wt,kr as Tt,m as Et,n as Dt,p as Ot,pr as kt,q as At,qt as jt,rr as Mt,v as Nt,vc as Pt,vt as Ft,wn as It,xc as Lt,xr as Rt,xt as zt,y as Bt,yc as Vt,z as X}from"./index-CXuVkD6-.js";import{t as Ht}from"./use-page-title-fn79XYtf.js";import{t as Ut}from"./badge-B-yh3kbi.js";import{t as Wt}from"./scroll-area-WFIgUp-0.js";import{i as Gt,n as Kt,r as qt,t as Jt}from"./resizable-om0nWp3k.js";import{t as Yt}from"./empty-state-2mwYYmoQ.js";import{t as Xt}from"./use-keyboard-shortcuts-befVnBO6.js";import{$ as Zt,A as Qt,B as $t,C as en,D as tn,E as nn,F as rn,G as an,I as on,J as sn,K as cn,L as ln,M as un,N as dn,O as fn,P as pn,Q as mn,R as hn,S as gn,T as _n,U as vn,W as yn,X as bn,Y as xn,Z as Sn,_ as Cn,a as wn,b as Tn,c as En,d as Dn,et as On,f as kn,g as An,h as jn,i as Mn,j as Nn,k as Pn,l as Fn,m as In,n as Ln,o as Rn,p as zn,q as Bn,r as Vn,s as Hn,t as Un,tt as Wn,v as Gn,w as Kn,x as qn,y as Jn,z as Yn}from"./knowledge-view-BHNh7MwX.js";import{a as Xn,i as Zn,n as Qn,o as $n,s as er}from"./display-step-opeACkeD.js";var tr=K(`accessibility`,[[`circle`,{cx:`16`,cy:`4`,r:`1`,key:`1grugj`}],[`path`,{d:`m18 19 1-7-6 1`,key:`r0i19z`}],[`path`,{d:`m5 8 3-3 5.5 3-2.36 3.5`,key:`9ptxx2`}],[`path`,{d:`M4.24 14.5a5 5 0 0 0 6.88 6`,key:`10kmtu`}],[`path`,{d:`M13.76 17.5a5 5 0 0 0-6.88-6`,key:`2qq6rc`}]]),nr=K(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),rr=K(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),ir=K(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),ar=K(`circle-minus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),or=K(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),sr=K(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),cr=K(`corner-down-right`,[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),lr=K(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ur=K(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),dr=K(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),fr=K(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),pr=K(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),mr=K(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),hr=K(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),gr=K(`list-x`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`m15.5 9.5 5 5`,key:`ytk86i`}],[`path`,{d:`m20.5 9.5-5 5`,key:`17o44f`}]]),_r=K(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),vr=K(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),yr=K(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),br=K(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),xr=K(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Sr=K(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Cr=K(`replace`,[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]),wr=K(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Tr=K(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Er=K(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),Dr=K(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),Z=e(ct(),1),Q=gt(),Or=`Toggle`,kr=Z.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=zt({prop:n,onChange:i,defaultProp:r??!1,caller:Or});return(0,Q.jsx)(W.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:ze(e.onClick,()=>{e.disabled||s(!o)})})});kr.displayName=Or;var Ar=`ToggleGroup`,[jr,Mr]=dt(Ar,[qe]),Nr=qe(),Pr=Z.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,Q.jsx)(Lr,{...r,ref:t});if(n===`multiple`)return(0,Q.jsx)(Rr,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${Ar}\``)});Pr.displayName=Ar;var[Fr,Ir]=jr(Ar),Lr=Z.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=zt({prop:n,defaultProp:r??``,onChange:i,caller:Ar});return(0,Q.jsx)(Fr,{scope:e.__scopeToggleGroup,type:`single`,value:Z.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:Z.useCallback(()=>s(``),[s]),children:(0,Q.jsx)(Vr,{...a,ref:t})})}),Rr=Z.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=zt({prop:n,defaultProp:r??[],onChange:i,caller:Ar}),c=Z.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=Z.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,Q.jsx)(Fr,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,Q.jsx)(Vr,{...a,ref:t})})});Pr.displayName=Ar;var[zr,Br]=jr(Ar),Vr=Z.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=Nr(n),u=Ft(o),d={role:`group`,dir:u,...c};return(0,Q.jsx)(zr,{scope:n,rovingFocus:i,disabled:r,children:i?(0,Q.jsx)(At,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,Q.jsx)(W.div,{...d,ref:t})}):(0,Q.jsx)(W.div,{...d,ref:t})})}),Hr=`ToggleGroupItem`,Ur=Z.forwardRef((e,t)=>{let n=Ir(Hr,e.__scopeToggleGroup),r=Br(Hr,e.__scopeToggleGroup),i=Nr(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=Z.useRef(null);return r.rovingFocus?(0,Q.jsx)(Je,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,Q.jsx)(Wr,{...s,ref:t})}):(0,Q.jsx)(Wr,{...s,ref:t})});Ur.displayName=Hr;var Wr=Z.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=Ir(Hr,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,Q.jsx)(kr,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),Gr=Pr,Kr=Ur;function qr(e,t,n=document.createElement(`video`)){return new Promise(r=>{let i=!1,a,o=e=>{i||(i=!0,clearTimeout(a),n.removeEventListener(`loadedmetadata`,s),n.removeEventListener(`durationchange`,s),n.removeEventListener(`error`,c),t.removeEventListener(`abort`,c),n.removeAttribute(`src`),n.load(),r(e))},s=()=>{Number.isFinite(n.duration)&&n.duration>0&&o(n.duration*1e3)},c=()=>o();if(t.aborted){o();return}n.preload=`metadata`,n.muted=!0,n.addEventListener(`loadedmetadata`,s),n.addEventListener(`durationchange`,s),n.addEventListener(`error`,c),t.addEventListener(`abort`,c,{once:!0}),a=setTimeout(c,1e4),n.src=e})}function Jr(e,t){let n=e.flatMap(e=>{let n=e.member.recording;return n?.state===`present`&&!n.ref.evidenceIncomplete?[{key:`${t}:${e.member.testIndex}:${n.ref.sha}`,sha:n.ref.sha}]:[]}),r=n.map(e=>e.key).join(`|`),i=(0,Z.useRef)(new Map),[a,o]=(0,Z.useState)();(0,Z.useEffect)(()=>{let e=new AbortController,a=new Set(n.map(e=>e.key));for(let e of i.current.keys())a.has(e)||i.current.delete(e);let s=n.filter(e=>!i.current.has(e.key)),c=0;return Promise.all(Array.from({length:Math.min(3,s.length)},async()=>{for(;!e.signal.aborted&&c<s.length;){let n=s[c++],r=await qr(lt.runArtifact(t,n.sha),e.signal);e.signal.aborted||i.current.set(n.key,r)}})).then(()=>{e.signal.aborted||o({signature:r,values:new Map(i.current)})}),()=>e.abort()},[r,t]);let s=a?.signature===r;return{groups:(0,Z.useMemo)(()=>e.map(e=>{let n=e.member.recording,r=s&&n?.state===`present`?a.values.get(`${t}:${e.member.testIndex}:${n.ref.sha}`):void 0;return r===void 0||n?.state!==`present`?e:{...e,member:{...e.member,recording:{...n,durationMs:r}}}}),[e,a,s,t]),ready:s,decodedDurations:(0,Z.useMemo)(()=>new Map(e.flatMap(e=>{let n=e.member.recording,r=s&&n?.state===`present`?a.values.get(`${t}:${e.member.testIndex}:${n.ref.sha}`):void 0;return r===void 0?[]:[[e.member.testIndex,r]]})),[e,a,s,t])}}var Yr={complete:{Glyph:We,glyphClass:`text-emerald-500`,wordClass:`text-muted-foreground`},running:{Glyph:fe,glyphClass:`text-amber-500 motion-safe:animate-pulse`,wordClass:`text-muted-foreground`},pending:{Glyph:ye,glyphClass:`text-muted-foreground`,wordClass:`text-muted-foreground`},failed:{Glyph:H,glyphClass:`text-destructive`,wordClass:`text-destructive`},skipped:{Glyph:ar,glyphClass:`text-muted-foreground`,wordClass:`text-muted-foreground`},unavailable:{Glyph:ar,glyphClass:`text-muted-foreground`,wordClass:`text-muted-foreground`}},Xr=`inline-flex items-center gap-1 min-h-6 rounded-sm text-xs`,Zr=`focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`;function Qr(e,t){return e===void 0?[]:[{kind:`outcome`,text:e.outcome},...e.note===void 0?[]:[{kind:`note`,text:e.note}],...e.timing===void 0?[]:[{kind:`timing`,text:e.timing}],...e.proposals===void 0?[]:[{kind:`proposals`,text:e.proposals}],...e.retry===void 0?[]:[{kind:`retry`,text:e.retry}],...t===void 0?[]:[{kind:`door`,text:bn[t]}]]}function $r({stage:e,lines:t,children:n}){return t.length===0?n:(0,Q.jsxs)(Be,{children:[(0,Q.jsx)(Le,{asChild:!0,children:n}),(0,Q.jsx)(nt,{side:`bottom`,align:`start`,sideOffset:4,className:`max-w-[320px] text-left break-words`,"data-stage-card":e,children:(0,Q.jsx)(`div`,{className:`space-y-1`,children:t.map((e,t)=>(0,Q.jsx)(`p`,{"data-stage-card-line":e.kind,className:t===0?`font-medium`:`text-muted-foreground`,children:e.text},e.kind))})})]})}function ei({stage:e,chip:t,onActivate:n,door:r}){let{Glyph:i,glyphClass:a,wordClass:o}=Yr[t.state],s=n!==void 0&&r!==void 0,c=Qr(t.card,s?r:void 0),l=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(i,{"aria-hidden":`true`,className:`h-3.5 w-3.5 ${a}`}),(0,Q.jsx)(`span`,{className:o,children:t.word})]});return s?(0,Q.jsx)($r,{stage:e,lines:c,children:(0,Q.jsx)(`button`,{type:`button`,"data-chip":e,"data-chip-status":t.status,"data-stage-state":t.state,onClick:n,"aria-label":e===`curation`?Zt(t):Wn(e,t.state,t.card?.outcome,r),className:`${Xr} ${Zr} cursor-pointer transition-colors hover:text-foreground`,children:l})}):(0,Q.jsx)($r,{stage:e,lines:c,children:(0,Q.jsxs)(`span`,{"data-chip":e,"data-chip-status":t.status,"data-stage-state":t.state,tabIndex:0,className:`${Xr} ${Zr} cursor-default`,children:[l,(0,Q.jsx)(`span`,{className:`sr-only`,children:Wn(e,t.state,t.card?.outcome)})]})})}function ti({view:e,onCurationClick:t,onOpenVerdict:n}){if(e===void 0)return(0,Q.jsxs)(`span`,{"data-chips-state":`loading`,role:`status`,className:`text-xs text-muted-foreground shrink-0`,children:[`…`,(0,Q.jsx)(`span`,{className:`sr-only`,children:Sn})]});if(e.kind===`unavailable`){let{Glyph:t,glyphClass:n,wordClass:r}=Yr.unavailable;return(0,Q.jsx)($r,{stage:`unavailable`,lines:[{kind:`outcome`,text:xn},{kind:`error`,text:e.error},...e.reason===void 0?[]:[{kind:`reason`,text:e.reason}]],children:(0,Q.jsxs)(`span`,{"data-chips-state":`unavailable`,"data-stage-state":`unavailable`,tabIndex:0,className:`${Xr} ${Zr} cursor-default ${r}`,children:[(0,Q.jsx)(t,{"aria-hidden":`true`,className:`h-3.5 w-3.5 ${n}`}),mn]})})}return(0,Q.jsxs)(`span`,{"data-chips-state":`chips`,...e.skipped===void 0?{}:{"data-postprocessing-skipped":e.skipped.reason},className:`inline-flex items-center gap-2 min-w-0`,children:[(0,Q.jsx)(ei,{stage:`analysis`,chip:e.analysis,onActivate:n,door:`verdict`}),(0,Q.jsx)(ei,{stage:`curation`,chip:e.curation,onActivate:t,door:`knowledge`})]})}function ni(e,t){let n=O(e),r=h(e);return[{kind:`totals`,text:v(e)},...n===void 0?[]:[{kind:`cached`,text:n}],...r===void 0?[]:[{kind:`coverage`,text:r}],...m(t).map(e=>({kind:e.kind,text:e.text}))]}function ri({tokens:e,models:t}){return(0,Q.jsx)(nt,{side:`bottom`,align:`end`,sideOffset:4,className:`max-w-[320px] text-left break-words`,"data-usage-card":!0,children:(0,Q.jsx)(`div`,{className:`space-y-1 text-xs tabular-nums`,children:ni(e,t).map((e,t)=>(0,Q.jsx)(`p`,{"data-usage-line":e.kind,className:e.kind===`totals`?`font-medium`:`text-muted-foreground`,children:e.text},`${e.kind}-${String(t)}`))})})}var ii={note:``,expectation:``,actionText:``};function ai(e){return st(e)}function oi(e){return e.kind===void 0&&e.note===``&&e.expectation===``&&e.actionText===``}function si({stepIndex:e,member:t}){let n=t===void 0?void 0:`${ie(t)} ${C(t.testIndex)}`;return e===void 0?n??`this test`:n===void 0?`step ${String(e+1)}`:`step ${String(e+1)} of ${n}`}function ci(e,t){let n=e.member!==void 0&&t.member!==void 0&&e.member.testIndex!==t.member.testIndex,r=n?e:{stepIndex:e.stepIndex},i=t.stepIndex===void 0||n?t:{stepIndex:t.stepIndex};return`You're viewing ${si(r)} — this feedback is about ${si(i)}.`}function li(e){return`Switch to ${si(e)}`}function ui(e){return`Unsent draft: ${si(e)}`}var di=`Note (optional)`,fi=2e3;function pi(e){return`${String(e)} / ${String(fi)}`}var mi=`Add a correction`;function hi(e,t=0){switch(e){case`no-choice`:return`Pick a choice first — a corrected action is only possible when the mark covers exactly one recorded decision.`;case`loading`:return`Checking whether a corrected action is possible…`;case`count`:return t===0?`A corrected action isn't possible here — this mark covers no recorded decision.`:`A corrected action isn't possible here — this mark covers ${String(t)} recorded decisions, and a correction needs exactly one.`;case`quarantined`:return`A corrected action isn't used — this mark is quarantined.`;case`unavailable`:return`A corrected action can't be checked until the preview above answers.`;default:return e}}function gi({kind:e,landedForTargetAndKind:t}){if(e===void 0)return{shown:!1,state:`no-choice`};if(t===void 0)return{shown:!1,state:`loading`};if(t.kind===`failed`)return{shown:!1,state:`unavailable`};let n=t.result;return n.kind===`quarantined`?{shown:!1,state:`quarantined`}:n.kind===`consequences`?n.markedDecisionCount===1?{shown:!0}:{shown:!1,state:`count`,count:n.markedDecisionCount}:{shown:!1,state:`unavailable`}}function _i(e){return e?.kind===`read`&&(e.result.kind===`consequences`||e.result.kind===`quarantined`)}function vi(e){return e.shown?e:{shown:!1,reason:hi(e.state,e.state===`count`?e.count:void 0)}}var yi={"false-fail":`This should have passed`,"false-pass":`This should have failed`,"confirmed-bug":`This is a real product bug`},bi={failed:[`false-fail`,`confirmed-bug`,`false-pass`],passed:[`false-pass`,`confirmed-bug`,`false-fail`]},xi=`Which is true?`,Si={failed:{"false-fail":`The app behaved correctly; the test was wrong to fail.`,"confirmed-bug":`The failure is real — the app is broken here.`,"false-pass":`The test missed a problem it should have caught.`},passed:{"false-fail":`The pass is right; this confirms the test.`,"confirmed-bug":`The app has a real bug here, even though the test passed.`,"false-pass":`The app was broken here, but the test passed anyway.`}};function Ci(e){return e===`passed`||e===`healed`?`passed`:`failed`}function wi(e,t){return Ci(e??t)}function Ti({member:e,step:t,runStatus:n}){let r=t?.verifierVerdict;return r==null?wi(e?.outcome,n):r.pass?`passed`:`failed`}function Ei(e){return`${e.prefix}${e.name??``}${e.suffix??``}`}var Di=`Whole test`,Oi=`One step`,ki={passed:`recorded: passed`,healed:`recorded: healed — counts as passed`,failed:`recorded: failed`,timeout:`recorded: timed out — counts as failed`,cancelled:`recorded: cancelled — counts as failed`,skipped:`recorded: skipped — counts as failed`};function Ai(e){return`no step verdict recorded — using the test's result (${e})`}function ji(e){return e!==void 0&&Object.hasOwn(ki,e)?e:void 0}function Mi({member:e,step:t,stepCount:n,suite:r}){return t===void 0?r?{prefix:`Feedback on `,name:ie(e),suffix:` ${C(e.testIndex)}`}:{prefix:`Feedback on `,name:ie(e)}:{prefix:`Feedback on step ${String(t.stepIndex+1)} of ${String(n)} · `,name:t.stepText??`Untitled step`}}function Ni(e,t){return ki[ji(e.outcome??t)??wi(e.outcome,t)]}function Pi(e,t,n){let r=e.verifierVerdict;if(r==null)return Ai(Ni(t,n));let i=r.pass?`passed`:`failed`,a=ji(e.status);return ki[a!==void 0&&wi(a)===i?a:i]}function Fi({member:e,step:t,suite:n,runStatus:r}){if(t===void 0)return{prefix:`${Di} · ${Ni(e,r)}`};let i=Pi(t,e,r);return n?{prefix:`${Oi} in `,name:ie(e),suffix:` ${C(e.testIndex)} · ${i}`}:{prefix:`${Oi} · ${i}`}}function Ii({detail:e,target:t,runStatus:n}){let r=e?.members.find(e=>e.testIndex===t.testIndex),i=r??{testIndex:t.testIndex},a=e?.steps.filter(e=>e.testIndex===t.testIndex)??[],o=t.stepIndex===void 0?void 0:a.find(e=>e.stepIndex===t.stepIndex)??{stepIndex:t.stepIndex},s=(e?.members.length??0)>1,c=Math.max(r?.totalSteps??a.length,o===void 0?0:o.stepIndex+1);return{outcomeClass:Ti({member:i,step:o,runStatus:n}),heading:Mi({member:i,step:o,stepCount:c,suite:s}),scopeLine:Fi({member:i,step:o,suite:s,runStatus:n}),stepCount:c}}function Li({detail:e,selectedStep:t,memberFilter:n,runStatus:r}){let i=e?.members??[],a=e=>e===void 0?void 0:i.find(t=>t.testIndex===e),o=i.length===1?i[0]:a(t?.testIndex)??a(n)??i.find(e=>wi(e.outcome,r)===`failed`)??i[0];return o===void 0?void 0:{testIndex:o.testIndex}}var Ri=`Test`,zi=`This test has no unique address in this run, so feedback can't be recorded for it.`;function Bi(e,t){let n=e?.members??[],r=n.find(e=>e.testIndex===t);return r===void 0?!1:n.length<=1?!0:!!r.testId&&n.filter(e=>e.testId===r.testId).length===1}function Vi(e,t){return t&&e>0&&e<768?`stacked`:`docked`}var Hi={tree:`run-tree`,evidence:`run-evidence`,feedback:`run-feedback`},Ui={tree:`run-tree-stacked`,evidence:`run-evidence-stacked`,feedback:`run-feedback-stacked`};function Wi(e){return e===`stacked`?Ui:Hi}function Gi(e,t){let n=Wi(e);if(e===`stacked`)return{[n.tree]:30,[n.evidence]:30,[n.feedback]:40};let r=t>0?Math.min(Math.max(384/t*100,320/t*100),50):30,i=(100-r)*.35;return{[n.tree]:i,[n.evidence]:100-r-i,[n.feedback]:r}}function Ki(e,t,n,r){return{kind:n,...e.testId?{testId:e.testId}:{},...t.stepIndex===void 0?{}:{stepIndex:t.stepIndex},...r}}function qi(e){return JSON.stringify([e.kind,e.testIndex,e.stepIndex??`run`,e.correctedExpectation??null,e.correctedAction??null])}var Ji=new Set(Ct),Yi=`This test can't be marked from the dashboard.`,Xi=`Choose one of the three options.`,Zi=`Checking what this will do…`,Qi=`Consequences couldn't be checked — retry above.`,$i=`This mark can't be recorded — see above.`,ea=`You already said this — there's nothing new to record.`,ta=`Fix the corrected action JSON first.`,na=`Sending…`;function ra(e){if(e.noUniqueAddress===!0)return Yi;if(e.kind===void 0)return Xi;let t=e.landedOutcome;return t===void 0||e.landedKey!==e.currentKey?Zi:t===`failed`?Qi:Ji.has(t)?$i:t!==`consequences`&&t!==`quarantined`?ea:e.invalidCorrection===!0?ta:e.inFlight?na:``}var ia=`Send feedback`,aa=`What this will do`,oa=`Sending feedback…`,sa=`Give feedback on this test`,ca=`Close feedback`,la=`Close (Esc)`,ua=`Draft kept. Check the message above before sending again.`;function da({scope:e,stepNumber:t,memberName:n,handle:r,markedChoice:i}){let a=e===`step`?`Give feedback on step ${String(t)}`:r===void 0?sa:`Give feedback on ${n??``} ${r}`;return i===void 0?a:`${a} — already marked: ${yi[i]}`}function fa(e,t){return t?`Step ${String(e)} is already marked — review or change`:`Give feedback on step ${String(e)}`}function pa(e){return`Marked: ${yi[e]}`}var ma={applied:{fact:`Recorded — a knowledge fact was added`,caution:`Recorded — a caution was added`,"procedure-hint":`Recorded — a procedure hint was added`,"test-edit":`Recorded — the test file was edited`},drafted:`Recorded — a fix was drafted (older mark)`,"no-draftable-fix":`Recorded — no fix could be drafted`,"confirmed-bug":`Recorded — kept as a real product bug; nothing changed`,"not-applied":{"target-not-found":`Recorded — the fix was not applied: the knowledge it replaces is gone`,"policy-materialize-refused":`Recorded — the fix was not applied: its policy text was refused`,"outside-workspace":`Recorded — the fix was not applied: the test file is outside the workspace`}};function ha(e){switch(e.kind){case`quarantined`:return`Recorded — quarantined (${e.class})`;case`applied`:return ma.applied[e.fix];case`drafted`:return ma.drafted;case`no-draftable-fix`:return ma[`no-draftable-fix`];case`confirmed-bug`:return ma[`confirmed-bug`];case`not-applied`:return ma[`not-applied`][e.reason];default:return e}}function ga(e){return`Feedback recorded — ${ha(e).replace(/^Recorded — /,``)}.`}function _a({kind:e,landed:t}){if(e===void 0)return`idle`;if(t===void 0)return`loading`;if(t.kind===`failed`)return`failed`;let n=t.result.kind;return Ji.has(n)?`refused`:n===`consequences`||n===`quarantined`?n:`already-marked`}var va=`Updating…`,ya=`Choose an option above to see what this will do.`,ba={result:`Result`,labels:`Eval labels`,knowledge:`Knowledge`,change:`Change`},xa={pass:`passed`,fail:`failed`};function Sa(e){let t=`Step ${String(e.stepIndex+1)} will count as ${xa[e.verdict]} (recorded: ${xa[e.recordedVerdict.pass?`pass`:`fail`]}`,{reasoning:n}=e.recordedVerdict;return n===``?{prefix:`${t})`}:{prefix:`${t} — "`,name:n,suffix:`")`}}function Ca(e){let t=e.correctedExpectation!==void 0;if(t&&e.correctedAction)return`with your corrected expectation and action`;if(t)return`with your corrected expectation`;if(e.correctedAction)return`with your corrected action`}var wa=`No step verdict changes.`;function Ta(e){return e===0?`No eval labels change`:e===1?`1 decision becomes a held-out eval label`:`${String(e)} decisions become held-out eval labels`}function Ea(e,t){if(t===0)return`No knowledge records are reached`;let n=[e.confirmed===0?void 0:`${String(e.confirmed)} ${e.confirmed===1?`record`:`records`} confirmed`,e.overturned===0?void 0:`${String(e.overturned)} counted against`].filter(e=>e!==void 0);return n.length>0?n.join(` · `):t===1?`1 record reached — it can't be read`:`${String(t)} records reached — none can be read`}function Da(e){return`Show records (${String(e)})`}var Oa={confirm:`confirms`,overturn:`counts against`},ka=`This record can't be read — it keeps its place, and nothing is applied to it.`;function Aa(e){if(e.evidence.kind===`unreadable`)return ka;let{effects:t}=e.evidence,n=t.filter(e=>e.direction===`overturn`).length;return[t.some(e=>e.direction===`confirm`)?Oa.confirm:void 0,n===0?void 0:n===1?Oa.overturn:`${Oa.overturn} × ${String(n)}`].filter(e=>e!==void 0).join(` · `)}var ja={"not-found":`Record content not found`,"scan-incomplete":`Record content could not be fully read`,"not-bound":`Record content isn't available on this host`},Ma={knowledge:{fact:`A knowledge fact will be added`,caution:`A caution will be added`,"procedure-hint":`A procedure hint will be added`},"test-edit":`The test file will be edited`,"no-draftable-fix":`No fix can be made from this run`,"confirmed-bug":`Nothing changes — a real product bug needs a product fix, not a test or knowledge change`};function Na(e){switch(e.kind){case`knowledge`:return Ma.knowledge[e.fix];case`test-edit`:return Ma[`test-edit`];case`no-draftable-fix`:return Ma[`no-draftable-fix`];case`confirmed-bug`:return Ma[`confirmed-bug`];default:return e}}var Pa=`The exact wording isn't shown here — it's written when you send.`;function Fa(e){return e.kind===`knowledge`||e.kind===`test-edit`}function Ia(e,t){return`Replaces your earlier mark (${t===void 0?`#${String(e)}`:`#${String(e)}, ${t}`}); what it changed stays`}function La(e,t,n,r){let i=`This marks step ${String(n)} of ${String(r)} — `;switch(e){case`failing-step`:return`${i}the first step that failed.`;case`passing-verdict`:return t===`false-pass`?`${i}the last step, where the test finished.`:`${i}the last step, because no step failed.`;case`step-mark`:return;default:return e}}function Ra(e){return`Show step ${String(e)}`}var za={timeout:`a timeout`,flake:`a flaky run`,environment:`an environment problem`};function Ba(e){return`This test failed from ${za[e]}, so your mark is recorded but quarantined — no labels, knowledge or tests change.`}function Va(e){return`You already said this${e===void 0?``:` (${e})`}. A new note alone isn't recorded.`}var Ha={"run-not-found":()=>`This run is no longer in the run store, so feedback can't be recorded.`,"member-not-found":()=>`This test can't be found in the run, so feedback can't be recorded.`,"step-not-found":e=>e.stepCount===0?`This test recorded no steps, so there is nothing to mark.`:`This test recorded ${String(e.stepCount)} ${e.stepCount===1?`step`:`steps`}, so there is no step ${String(e.stepIndex+1)} to mark.`,"ambiguous-address":e=>`${String(e.candidates.length)} tests in this run share this address, so the mark can't be placed.`,"ambiguous-correction":e=>`A corrected action needs exactly one recorded decision; this mark covers ${String(e.decisionCount)}. Remove the corrected action to continue.`};function Ua(e){return Ji.has(e.kind)}function Wa(e){switch(e.kind){case`run-not-found`:return Ha[e.kind]();case`member-not-found`:return Ha[e.kind]();case`step-not-found`:return Ha[e.kind](e);case`ambiguous-address`:return Ha[e.kind](e);case`ambiguous-correction`:return Ha[e.kind](e);default:return e}}var Ga={network:`the dashboard server didn't answer`,"ledger-corrupt":`this run's feedback ledger is damaged`,"ledger-unavailable":`this run's feedback ledger can't be read right now`,refused:`the server refused the request`,shape:`the server's answer didn't match the expected shape`};function Ka(e){return Ga[e]}function qa(e){return`Couldn't check what this will do — ${e}.`}var Ja={prefix:`You can still record feedback from the CLI (`,name:`agent-qa runs mark`,suffix:`) or over MCP.`};Ei(Ja);var Ya=`Retry`,Xa=`${Ya} checking what this will do`,Za=`Technical details`,Qa={kind:`Mark kind`,address:`Address`,testId:`Test id`,records:`Reached records`,labels:`Labels`,basis:`Basis`};function $a(e){return`decision ${String(e.decisionOrdinal)} · step ${String(e.stepIndex+1)} · ${e.channel}`}function eo(e){let t=e.priorMarkOrdinal===void 0?``:` · prior mark #${String(e.priorMarkOrdinal)}`;return`ledger ordinal ${String(e.ledgerOrdinal)}${t}`}function to(e){if(e===void 0)return`loading`;if(e.kind===`failed`)return`failed`;let{result:t}=e;return t.kind===`history`?t.entries.length===0?`empty`:`history`:t.kind}var no={step:`Feedback on this step`,test:`Feedback on this test`};function ro(e,t){return`${no[e]} (${String(t)})`}function io(e){return`All feedback on this run (${String(e)})`}var ao=`Active`;function oo(e){return e===void 0?`Replaced by your later mark`:`Replaced by your later mark at ${e}`}var so=`Only your latest mark on a test or step counts.`;function co(e){if(e.expectation&&e.action)return`With a corrected expectation and action`;if(e.expectation)return`With a corrected expectation`;if(e.action)return`With a corrected action`}function lo(e){return`${e} (content unavailable)`}function uo(e){let{disposition:t}=e;if(t.kind===`drafted`)return{kind:`unavailable`};if(t.kind!==`applied`)return;if(t.change.kind===`test-file`)return{kind:`test-file`,filePath:t.change.filePath};if(t.change.recordIds.length===0)return{kind:`unavailable`};let n=new Map((e.changedRecords??[]).map(e=>[e.recordId,e.recordContent?.content]));return{kind:`knowledge`,records:t.change.recordIds.map(e=>{let t=n.get(e);return t===void 0?{recordId:e}:{recordId:e,content:t}})}}var fo=`its content was not recorded.`,po=`what it changed was not recorded.`,mo=`A fix stays when you mark again: correct knowledge with new feedback or by forgetting it, and revert a test edit with git.`,ho={step:`No feedback on this step yet.`,test:`No feedback on this test yet.`,run:`No feedback on this run yet.`};function go(e,t){switch(e){case`run-not-found`:return`This run's feedback history can't be found.`;case`ledger-corrupt`:return`This run's feedback history is damaged at line ${String(t)}, so it can't be shown.`;case`ledger-unavailable`:return`This run's feedback history can't be read right now.`;default:return e}}function _o(e){return`Couldn't load this run's feedback history — ${e}.`}var vo=`${Ya} loading feedback history`,yo=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`});function bo(e){return e===void 0||!Number.isFinite(e)?void 0:yo.format(new Date(e))}function xo(e,t){let n=Ii({detail:t,target:e.stepIndex===void 0?{testIndex:e.testIndex}:{testIndex:e.testIndex,stepIndex:e.stepIndex},runStatus:void 0});return e.stepIndex===void 0?{prefix:``,name:ie(t?.members.find(t=>t.testIndex===e.testIndex)??{testIndex:e.testIndex}),suffix:` ${C(e.testIndex)} · whole test`}:{prefix:`Step ${String(e.stepIndex+1)} of ${String(n.stepCount)} · `,name:n.heading.name}}function So({scope:e,label:t,target:n,marked:r,expanded:i,controls:a,onOpen:o,tooltip:s}){let c=r?yr:vr;return(0,Q.jsxs)(Be,{children:[(0,Q.jsx)(Le,{asChild:!0,children:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,className:U(`shrink-0`,e===`step`&&`size-7`,r?`text-foreground`:`text-muted-foreground hover:text-foreground`),"data-feedback-entry":e,"data-feedback-target":n,"data-feedback-marked":String(r),"aria-label":t,"aria-expanded":i,"aria-controls":a,onClick:e=>o(e.currentTarget),children:(0,Q.jsx)(c,{className:U(`h-3.5 w-3.5`,r&&`fill-current`),"aria-hidden":`true`})})}),(0,Q.jsx)(nt,{side:e===`step`?`left`:`bottom`,children:s??(r?`Already marked — review or change`:`Give feedback`)})]})}function Co({scope:e,target:t,kind:n}){return(0,Q.jsx)(`span`,{role:`img`,"aria-label":pa(n),"data-feedback-mark-glyph":e,"data-feedback-target":t,className:`inline-flex size-4 shrink-0 items-center justify-center text-muted-foreground`,children:(0,Q.jsx)(yr,{className:`size-3 fill-current`,"aria-hidden":`true`})})}function wo({status:e}){let{label:t,...n}=Re(e);return(0,Q.jsx)(Ut,{"data-verdict-badge":e,...n,className:U(n.className,`text-sm font-medium px-2 py-1 rounded-sm`),children:t})}function To({run:e,tokens:t,models:n,shortcutsOpen:r,onToggleShortcuts:i,onOpenArtifacts:a,postProcessing:o,hasPostProcessing:s=!1,onCurationClick:c,onOpenVerdict:l,retrievalRung:u,feedbackEntry:d}){let f=_t(),p=e.suiteId!=null&&e.parentRunId==null,m=p&&e.suiteId?lt.suiteView(e.suiteId):e.testId?lt.testView(e.testId):null,h=p&&e.suiteId?`Open suite`:`Open test`,g=e.metadata?.farmSessionUrl,_=()=>{let t=e.attributes[`agent-qa.runner`]===`local`;kt({file:e.filePath??e.name,local:t}).then(e=>{Bt.success(`Re-run started`),f(lt.runLive(e.runId))}).catch(e=>Bt.error(e instanceof at?e.message:`Failed to start re-run`))};return(0,Q.jsxs)(`div`,{className:`shrink-0 @container`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-y-2 min-h-14 border-b px-4 py-2 min-w-0 @5xl:flex-row @5xl:items-center @5xl:justify-between @5xl:gap-y-0 @5xl:py-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,Q.jsx)(`button`,{onClick:()=>f(lt.runs),className:`text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:`Runs`}),(0,Q.jsx)(Y,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate min-w-[96px]`,title:e.name,children:e.name}),m?(0,Q.jsx)(`a`,{href:m,target:`_blank`,rel:`noopener noreferrer`,"aria-label":h,className:`shrink-0 text-muted-foreground transition-colors hover:text-foreground`,children:(0,Q.jsx)(rr,{className:`h-3.5 w-3.5`})}):null,(0,Q.jsx)(wo,{status:e.status}),d===void 0?null:(0,Q.jsx)(So,{scope:`test`,...d})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 shrink-0`,children:[s?(0,Q.jsx)(ti,{view:o,onCurationClick:c,onOpenVerdict:l}):null,t===void 0?null:(0,Q.jsxs)(Be,{children:[(0,Q.jsx)(Le,{asChild:!0,children:(0,Q.jsxs)(`span`,{"data-run-token-summary":!0,tabIndex:0,className:`text-xs text-muted-foreground flex items-center gap-1 tabular-nums cursor-default rounded-sm focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:[(0,Q.jsx)(lr,{className:`h-3.5 w-3.5`}),b(t),(0,Q.jsx)(`span`,{className:`sr-only`,children:N})]})}),(0,Q.jsx)(ri,{tokens:t,models:n})]}),(0,Q.jsxs)(`span`,{"data-run-duration":!0,className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,Q.jsx)(or,{className:`h-3.5 w-3.5`}),ft(e.duration)]}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[(0,Q.jsx)(`div`,{className:`h-4 w-px bg-border`}),(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run artifacts`,title:`Run details (I/C/M)`,onClick:()=>a?.(`test`),children:(0,Q.jsx)(xr,{className:`h-3.5 w-3.5`})}),(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,"aria-expanded":r,title:`Shortcuts (Shift+?)`,onClick:i,children:(0,Q.jsx)(Te,{className:`h-3.5 w-3.5`})}),r?(0,Q.jsx)(`div`,{role:`dialog`,"aria-label":`Keyboard shortcuts`,className:`absolute right-0 top-full z-50 mt-2 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md`,children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Navigation`}),(0,Q.jsx)(we,{hints:[{key:`← →`,label:`Previous / next action`},{key:`Space`,label:`Play / pause`},{key:`V`,label:`Frames / Video`},{key:`↑ / K`,label:`Previous item`},{key:`↓ / J`,label:`Next item`},{key:`Shift+↑`,label:`Previous step`},{key:`Shift+↓`,label:`Next step`}]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Tabs`}),(0,Q.jsx)(we,{hints:[{key:`1`,label:`Overview`},{key:`2`,label:`Env`},{key:`3`,label:`Network`},{key:`4`,label:`Console`},{key:`5`,label:`ARIA`},{key:`6`,label:`A11y`},{key:`7`,label:`Knowledge`}]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Phases`}),(0,Q.jsx)(we,{hints:[{key:`Shift+1`,label:`Toggle Observe`},{key:`Shift+2`,label:`Toggle Plan`},{key:`Shift+3`,label:`Toggle Execute`},{key:`Shift+4`,label:`Toggle Verify`}]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,Q.jsx)(we,{hints:[{key:`I`,label:`Details: Attributes`},{key:`C`,label:`Artifacts: Config`},{key:`M`,label:`Knowledge tab`},{key:`R`,label:`Re-run`},{key:`Shift+?`,label:`Shortcuts`},{key:`Esc`,label:`Close`}]})]})]})}):null]}),(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`Re-run`,title:`Re-run (R)`,onClick:_,children:(0,Q.jsx)(wr,{className:`h-3.5 w-3.5`})}),g&&(0,Q.jsx)(`a`,{href:g,target:`_blank`,rel:`noopener noreferrer`,title:`BrowserStack`,children:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,children:(0,Q.jsx)(xe,{className:`h-3.5 w-3.5`})})})]})]})]}),(0,Q.jsx)(ge,{rung:u?.rung,reason:u?.reason})]})}var $={test:`Test`,config:`Config`,testAsWritten:`Test as written`,resolvedDefinition:`Resolved definition`,suiteMembers:`Suite members`,runTests:`Tests in this run`,runAttributes:`Run attributes`,effectiveConfig:`Effective config`,globalConfigAsWritten:`Global config as written`,model:`Model`,runtime:`Runtime`,errors:`Errors`,notCaptured:`Not captured`,configNotCaptured:`Config not captured`,unsealedCapture:`This run's setup capture didn't finish, so the test and config shown here may be incomplete.`,technicalDetails:`Technical details`,runId:`Run ID`,artifactKind:`Artifact kind`,schemaVersion:`Schema version`,captureSealedAt:`Capture sealed at`,copyRunId:`Copy run ID`,retry:`Retry loading run details`},Eo={test:`Test`,unknown:`Not recorded`};function Do(e){return e.finalizedAt?`sealed`:`unsealed`}function Oo(e){return`Run ${e}`}function ko(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function Ao(e){return typeof e==`string`&&e.trim()&&e.trim().toLowerCase()!==`unknown`?e:void 0}function jo(e){let t=ko(e),n=ko(t.runtime),r=ko(t.effectiveConfig),i=ko(r.use),a=ko(i.browser),o=ko(ko(t.model).planner);return[Ao(n.targetName)??Ao(r.baseUrl),[Ao(n.platform)??Ao(i.platform),Ao(a.name)].filter(Boolean).join(` `),Ao(o.model)].filter(e=>typeof e==`string`&&e.length>0)}function Mo(e){return Object.entries(e).sort(([e],[t])=>{let n=e.startsWith(`agent-qa.`);return n===t.startsWith(`agent-qa.`)?e.localeCompare(t):n?-1:1})}function No(e){navigator.clipboard?.writeText(e)}function Po({attributes:e}){let t=Mo(e);return t.length===0?(0,Q.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`No run attributes`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`This run did not record any attributes.`})]}):(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsxs)(X,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>No(JSON.stringify(Object.fromEntries(t),null,2)),children:[(0,Q.jsx)(le,{className:`size-4`}),`Copy JSON`]})}),(0,Q.jsx)(`div`,{className:`overflow-hidden rounded-[2px] border border-border`,children:(0,Q.jsx)(`table`,{className:`w-full table-fixed text-sm`,children:(0,Q.jsx)(`tbody`,{children:t.map(([e,t])=>(0,Q.jsxs)(`tr`,{className:`border-b border-border/70 last:border-b-0`,children:[(0,Q.jsx)(`th`,{className:`w-[240px] align-top px-3 py-2 text-left font-mono text-xs font-medium text-muted-foreground`,children:e}),(0,Q.jsx)(`td`,{className:`align-top px-3 py-2`,children:(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 break-all font-mono text-xs text-foreground`,children:t}),(0,Q.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Copy ${e} value`,title:`Copy value`,onClick:()=>No(t),children:(0,Q.jsx)(le,{className:`size-3.5`})})]})})]},e))})})})]})}function Fo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Io(e){return Array.isArray(e)}function Lo(e,t=`Not captured`){return e===void 0?t:e===null?`None`:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?Number.isFinite(e)?String(e):`None`:typeof e==`string`?e.length>0?e:`None`:Array.isArray(e)?`${e.length} ${e.length===1?`item`:`items`}`:Fo(e)?`${Object.keys(e).length} ${Object.keys(e).length===1?`field`:`fields`}`:String(e)}function Ro({title:e,badges:t=[],children:n,className:r,"data-drawer-section":i}){return(0,Q.jsxs)(`section`,{"data-drawer-section":i,className:U(`rounded-[2px] border border-border bg-transparent`,r),children:[(0,Q.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 border-b px-4 py-3`,children:[(0,Q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground`,children:e}),t.map(e=>(0,Q.jsx)(Ut,{variant:`outline`,className:`text-[10px]`,children:e},e))]}),(0,Q.jsx)(`div`,{className:`space-y-3 px-4 py-4`,children:n})]})}function zo({rows:e}){return(0,Q.jsx)(`div`,{className:`divide-y divide-border/50`,children:e.map(e=>(0,Q.jsxs)(`div`,{className:`grid gap-1 py-1.5 text-xs sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3`,children:[(0,Q.jsx)(`dt`,{className:`font-medium text-muted-foreground`,children:e.label}),(0,Q.jsx)(`dd`,{className:U(`min-w-0 break-words text-foreground`,e.mono&&`break-all font-mono`),children:e.value})]},e.label))})}function Bo({value:e}){return(0,Q.jsx)(`span`,{className:U(`break-words`,(e==null||typeof e==`boolean`||typeof e==`number`)&&`font-mono text-[11px]`,e==null?`text-muted-foreground`:`text-foreground`),children:Lo(e)})}function Vo({value:e,label:t=`root`,level:n=0}){if(Io(e))return(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:`group flex w-full min-w-0 items-center gap-1.5 py-1.5 text-left text-xs hover:text-foreground`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:t}),(0,Q.jsxs)(`span`,{className:`font-mono text-[11px] text-foreground`,children:[e.length,` `,e.length===1?`item`:`items`]})]}),(0,Q.jsx)(f,{children:(0,Q.jsx)(`div`,{className:`ml-3 border-l border-border pl-3`,children:e.length===0?(0,Q.jsx)(`div`,{className:`py-1.5 text-xs text-muted-foreground`,children:`None`}):e.map((e,r)=>(0,Q.jsx)(Vo,{label:`${r}`,value:e,level:n+1},`${t}-${r}`))})})]});if(Fo(e)){let r=Object.entries(e);return(0,Q.jsxs)(j,{defaultOpen:n===0,children:[(0,Q.jsxs)(A,{className:`group flex w-full min-w-0 items-center gap-1.5 py-1.5 text-left text-xs hover:text-foreground`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:t}),(0,Q.jsxs)(`span`,{className:`font-mono text-[11px] text-foreground`,children:[r.length,` `,r.length===1?`field`:`fields`]})]}),(0,Q.jsx)(f,{children:(0,Q.jsx)(`div`,{className:`ml-3 border-l border-border pl-3`,children:r.length===0?(0,Q.jsx)(`div`,{className:`py-1.5 text-xs text-muted-foreground`,children:`None`}):r.map(([e,t])=>(0,Q.jsx)(Vo,{label:e,value:t,level:n+1},e))})})]})}return(0,Q.jsxs)(`div`,{className:`grid gap-1 py-1.5 text-xs sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 break-words font-medium text-muted-foreground`,children:t}),(0,Q.jsx)(Bo,{value:e})]})}function Ho({label:e,content:t}){return t?(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:`group flex w-full items-center gap-1.5 rounded-[2px] py-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),e]}),(0,Q.jsx)(f,{children:(0,Q.jsx)(`pre`,{className:`mt-2 max-h-80 overflow-x-auto overflow-y-auto rounded-[2px] border border-border bg-muted/30 p-3 font-mono text-[11px] leading-relaxed whitespace-pre text-foreground`,children:t})})]}):null}function Uo(e,t){return e?e[t]:void 0}function Wo(e,t){let n=Uo(e,t);return typeof n==`string`&&n.length>0?n:null}function Go(e,t){let n=Uo(e,t);return Fo(n)?n:null}function Ko(e,t){let n=Uo(e,t);return Io(n)?n:[]}function qo(e){return Fo(e)&&[Wo(e,`code`),Wo(e,`phase`),Wo(e,`message`)].filter(Boolean).join(` - `)||null}function Jo(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return Object.fromEntries(t)}function Yo(e){let t=Jo(e.run.attributes);if(Object.keys(t).length>0)return t;let n=e.artifact?.payload;return Jo(Go(Go(Fo(n)?n:null,`metadata`),`attributes`))}function Xo({config:e}){let t=Uo(e,`runtime`),n=Uo(e,`timeouts`),r=Uo(e,`model`);return(0,Q.jsxs)(`div`,{"data-member-config":!0,children:[t==null?null:(0,Q.jsx)(Vo,{label:`runtime`,value:t}),n==null?null:(0,Q.jsx)(Vo,{label:`timeouts`,value:n}),r==null?null:(0,Q.jsx)(Vo,{label:`model`,value:r})]})}function Zo({source:e,kind:t}){let n=Ko(e,`members`).filter(Fo).sort((e,t)=>(typeof e.index==`number`?e.index:0)-(typeof t.index==`number`?t.index:0));return(0,Q.jsx)(Ro,{title:t===`tests`?$.runTests:$.suiteMembers,"data-drawer-section":t===`tests`?`run-tests`:`suite-members`,children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[n.length===0?$.notCaptured:null,n.map(e=>{let n=Go(e,`ref`),r=typeof e.index==`number`?e.index:0,i=Wo(e,`childRunId`),a=qo(Uo(e,`error`)),o=Go(e,`config`),s=o?jo(o).join(` · `):``;return(0,Q.jsxs)(`div`,{"data-suite-member-index":r,className:`rounded-[2px] border border-border p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(Ut,{variant:`outline`,className:`text-[10px]`,children:[`#`,r+1]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-sm font-medium`,children:Wo(e,`name`)??Wo(n,`test`)??`Unnamed member`}),(0,Q.jsx)(Ut,{variant:`outline`,className:`text-[10px]`,children:Lo(Wo(e,`loadStatus`))})]}),(0,Q.jsx)(zo,{rows:[{label:`Test ID`,value:Lo(Wo(e,`testId`)),mono:!0},{label:`Ref`,value:Lo(Wo(n,`test`)),mono:!0},{label:`Ref ID`,value:Lo(Wo(n,`id`)),mono:!0},{label:`Path`,value:Lo(Wo(e,`filePath`)),mono:!0},{label:`Target`,value:Lo(Wo(e,`target`))},{label:`Child run`,value:i?(0,Q.jsx)(`a`,{className:`break-all text-primary hover:underline`,href:lt.runDetail(i),children:i}):`Not captured`,mono:!!i},{label:`Error`,value:a??`None`},...o?[{label:`Ran against`,value:s||$.notCaptured}]:[]]}),(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:`group mt-2 flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),`Member snapshots`]}),(0,Q.jsxs)(f,{className:`mt-2 space-y-2`,children:[(0,Q.jsx)(Ho,{label:t===`tests`?`Raw test YAML`:`Raw member YAML`,content:Wo(e,`rawYaml`)}),Uo(e,`resolvedDefinition`)===void 0?null:(0,Q.jsx)(Vo,{label:`resolvedDefinition`,value:Uo(e,`resolvedDefinition`)}),o?(0,Q.jsx)(Xo,{config:o}):null]})]})]},`${r}-${Wo(e,`testId`)??Wo(n,`test`)??`member`}`)})]})})}function Qo({response:e}){let t=e.artifact?.payload,n=Go(Fo(t)?t:null,`source`),r=e.missingSections.includes(`source`)?null:n,i=Wo(n,`kind`),a=Wo(r,`rawYaml`),o=Uo(r,`resolvedDefinition`),s=Yo(e);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[i===`tests`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ro,{title:$.testAsWritten,"data-drawer-section":`test-as-written`,children:a?(0,Q.jsx)(Ho,{label:i===`suite`?`Raw suite YAML`:`Raw test YAML`,content:a}):$.notCaptured}),(0,Q.jsx)(Ro,{title:$.resolvedDefinition,"data-drawer-section":`resolved-definition`,children:o==null?$.notCaptured:(0,Q.jsx)(Vo,{label:`resolvedDefinition`,value:o})})]}),i===`suite`||i===`tests`?(0,Q.jsx)(Zo,{source:r??{},kind:i}):null,Object.keys(s).length>0?(0,Q.jsx)(Ro,{title:$.runAttributes,"data-drawer-section":`run-attributes`,children:(0,Q.jsx)(Po,{attributes:s})}):null]})}function $o(e,t){return e?e[t]:void 0}function es(e,t){let n=$o(e,t);return typeof n==`string`&&n.length>0?n:null}function ts(e,t){let n=$o(e,t);return Fo(n)?n:null}function ns(e,t){let n=$o(e,t);return Io(n)?n:[]}function rs(e){return Fo(e)&&[es(e,`code`),es(e,`phase`),es(e,`message`)].filter(Boolean).join(` - `)||null}function is({response:e}){let t=e.artifact?.payload,n=Fo(t)?t:null,r=e.missingSections.includes(`config`)?null:ts(n,`config`),i=$o(r,`effectiveConfig`),a=es(r,`rawConfigContent`),o=$o(r,`model`),s=$o(n,`runtime`),c=ns(n,`errors`);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(Ro,{title:$.effectiveConfig,"data-drawer-section":`effective-config`,children:i==null?$.notCaptured:(0,Q.jsx)(Vo,{label:`effectiveConfig`,value:i})}),(0,Q.jsx)(Ro,{title:$.globalConfigAsWritten,"data-drawer-section":`global-config`,children:a?(0,Q.jsx)(Ho,{label:`Raw global config`,content:a}):$.notCaptured}),(0,Q.jsx)(Ro,{title:$.model,"data-drawer-section":`model`,children:o==null?$.notCaptured:(0,Q.jsx)(Vo,{label:`model`,value:o})}),(0,Q.jsx)(Ro,{title:$.runtime,"data-drawer-section":`runtime`,children:s==null?$.notCaptured:(0,Q.jsx)(Vo,{label:`runtime`,value:s})}),(0,Q.jsx)(Ro,{title:$.errors,"data-drawer-section":`errors`,children:c.length>0?(0,Q.jsx)(`div`,{className:`space-y-2`,children:c.map((e,t)=>(0,Q.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-3 text-sm`,children:rs(e)??JSON.stringify(e)},t))}):$.notCaptured})]})}function as({runId:e,artifact:t}){return(0,Q.jsxs)(j,{"data-technical-details":!0,className:`shrink-0 border-t bg-muted/40 p-4`,children:[(0,Q.jsxs)(A,{className:`group flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),$.technicalDetails]}),(0,Q.jsx)(f,{children:(0,Q.jsxs)(`dl`,{className:`mt-4 grid grid-cols-[auto_minmax(0,1fr)] items-start gap-x-4 gap-y-2 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:$.runId}),(0,Q.jsxs)(`dd`,{className:`flex min-w-0 items-start gap-2 break-all font-mono`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1`,children:e}),(0,Q.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":$.copyRunId,onClick:()=>{navigator.clipboard?.writeText(e)},children:(0,Q.jsx)(le,{className:`size-3.5`})})]}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:$.artifactKind}),(0,Q.jsx)(`dd`,{className:`break-all`,children:Eo[t.kind]}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:$.schemaVersion}),(0,Q.jsx)(`dd`,{className:`break-all font-mono`,children:t.schemaVersion}),Do(t)===`sealed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:$.captureSealedAt}),(0,Q.jsx)(`dd`,{className:`break-all`,children:t.finalizedAt})]}):null]})})]})}function os(){return(0,Q.jsxs)(`div`,{className:`space-y-4`,"aria-label":`Loading artifact data`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading artifact data...`}),[0,1,2].map(e=>(0,Q.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,Q.jsx)(St,{className:`h-4 w-40`}),(0,Q.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,Q.jsx)(St,{className:`h-3 w-full`}),(0,Q.jsx)(St,{className:`h-3 w-5/6`}),(0,Q.jsx)(St,{className:`h-3 w-3/5`})]})]},e))]})}function ss({error:e,onRetry:t}){return(0,Q.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-4`,children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(ue,{className:`mt-0.5 h-4 w-4 shrink-0 text-red-500`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Could not load artifact data`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Retry the request. If it continues, verify the dashboard server can read run artifacts.`}),(0,Q.jsx)(`p`,{className:`mt-2 break-words font-mono text-xs text-red-500`,children:e}),(0,Q.jsx)(X,{className:`mt-3`,size:`sm`,variant:`outline`,onClick:t,children:$.retry})]})]})})}function cs(){return(0,Q.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Artifact data is not available for this run`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`This run does not have a persisted artifact record.`})]})}function ls({tab:e,response:t}){return e===`test`?(0,Q.jsx)(Qo,{response:t}):(0,Q.jsx)(is,{response:t})}function us({tab:e,response:t,loading:n,error:r,onRetry:i}){return n?(0,Q.jsx)(os,{}):r?(0,Q.jsx)(ss,{error:r,onRetry:i}):!t||e!==`test`&&!t.artifact?(0,Q.jsx)(cs,{}):(0,Q.jsx)(ls,{tab:e,response:t})}function ds({run:e,open:t,tab:n=`test`,response:r,loading:i,error:a,onOpenChange:o,onTabChange:s,onRetry:c}){let l=r?.artifact??null,u=e.name||Oo(e.id),d=jo(l?.payload.config),f=d.length>0?d.join(` · `):$.configNotCaptured;return(0,Q.jsx)(Ze,{open:t,onOpenChange:o,children:(0,Q.jsxs)($e,{side:`right`,className:`w-[min(820px,92vw)] sm:max-w-none gap-0 overflow-hidden p-0`,children:[(0,Q.jsxs)(Ve,{className:`border-b px-4 py-3 pr-12`,children:[(0,Q.jsx)(Ge,{className:`text-base leading-snug font-medium line-clamp-2`,children:u}),(0,Q.jsx)(it,{className:`truncate text-xs`,children:f})]}),l&&Do(l)===`unsealed`?(0,Q.jsxs)(`div`,{role:`status`,"data-capture-state":`unsealed`,className:`m-4 flex items-start gap-2 rounded-sm border border-amber-500/25 bg-amber-500/5 p-3 text-sm`,children:[(0,Q.jsx)(J,{className:`h-4 w-4 shrink-0 text-amber-500`}),(0,Q.jsx)(`span`,{children:$.unsealedCapture})]}):null,(0,Q.jsxs)(Ie,{value:n,onValueChange:e=>s(e),className:`min-h-0 flex-1 overflow-hidden`,children:[(0,Q.jsx)(`div`,{className:`border-b px-3`,children:(0,Q.jsxs)(Fe,{variant:`line`,className:`h-9 w-full justify-start`,children:[(0,Q.jsx)(Ne,{value:`test`,className:`max-w-32 flex-none`,children:$.test}),(0,Q.jsx)(Ne,{value:`config`,className:`max-w-32 flex-none`,children:$.config})]})}),(0,Q.jsxs)(Wt,{className:`min-h-0 flex-1`,children:[(0,Q.jsx)(Pe,{value:`test`,className:`m-0 px-4 py-4`,children:(0,Q.jsx)(us,{tab:`test`,response:r,loading:i,error:a,onRetry:c})}),(0,Q.jsx)(Pe,{value:`config`,className:`m-0 px-4 py-4`,children:(0,Q.jsx)(us,{tab:`config`,response:r,loading:i,error:a,onRetry:c})})]})]}),l?(0,Q.jsx)(as,{runId:e.id,artifact:l}):null]})})}function fs({variant:e}){return(0,Q.jsx)(te,{kind:`frame`,state:`unavailable`,incomplete:!0,variant:e,title:e===`inline`?E:w.frame.unavailable.title,explanation:M})}var ps=`LLM verdict`,ms=`deterministic fallback`,hs=`analysis running — this may upgrade`,gs=`analysis failed — showing deterministic fallback`;function _s(e,t){return e===`analyze-run`?`${ps} · ${t.toFixed(2)}`:ms}function vs(e){switch(e){case`pending`:case`running`:return`provisional`;case`failed`:return`failed`;case`complete`:case void 0:return}}function ys(e){if(e!==void 0)return e===`provisional`?hs:gs}function bs(e){return`step ${String(e)}`}var xs=`screenshot`;function Ss(e){return`same failure as ${String(e)} other ${e===1?`test`:`tests`}`}var Cs=`circularity: not recorded`,ws=`circularity: cross-check held`,Ts=`circularity: unresolved`,Es=`circularity: declared-only — no evaluation root, nothing measured`,Ds=`memory on path: not recorded`,Os=`memory on path: none declared`,ks=`Causal records (flipped)`,As=`All records on path`,js=`Per-record cross-checks`,Ms={held:`Held — outcome unchanged`,flipped:`Flipped — removing this record changed the outcome`,inconclusive:`Inconclusive — no reliable result`,"not-run":`Not run`},Ns={"cap-exceeded":`Cross-check limit reached; this memory remains unchecked`,interrupted:`Cross-check interrupted; no completed result is available`,"no-eval-root":`No evaluation root; this claim was not measured`,"posture-unavailable":`Evaluation root unavailable; this memory was not cleared`};function Ps(e){return`circularity: memory attribution — ${String(e)} flipped ${e===1?`record`:`records`}`}function Fs(e){return`memory on path: ${String(e)} ${e===1?`record`:`records`}`}function Is(e){return Ns[e]}function Ls(e){let t=e.results??[],n=t.filter(e=>e.crossCheck===`flipped`).map(e=>e.recordId),r=Rs(e,n.length,e.crossCheck),i=r===`unresolved`?t.find(e=>e.reason!==void 0)?.reason:void 0;return{state:r,text:zs(r,n.length),causalRecords:n,...e.results===void 0?{}:{results:e.results},...e.memoryOnPath===void 0?{}:{onPath:e.memoryOnPath},onPathText:e.memoryOnPath===void 0?Ds:e.memoryOnPath.length===0?Os:Fs(e.memoryOnPath.length),...i===void 0?{}:{unbackedReason:i,unbackedText:Is(i)}}}function Rs(e,t,n){if(t>0)return`flipped`;if(e.state===`not-recorded`)return`not-recorded`;if(e.state===`declared-only`)return`declared-only`;switch(n){case`held`:return`held`;case`flipped`:return`flipped`;case`inconclusive`:case`not-run`:case void 0:return`unresolved`}}function zs(e,t){switch(e){case`held`:return ws;case`flipped`:return Ps(t);case`declared-only`:return Es;case`unresolved`:return Ts;case`not-recorded`:return Cs}}function Bs(e){let t=e.total===1?`cited artifact`:`cited artifacts`;return`${String(e.missing)} of ${String(e.total)} ${t} unavailable`}function Vs(e,t,n){let r=new Map;if(e===void 0)return r;let i=vs(t),a=ys(i),o=new Map(e.sentences.map(e=>[e.perTest,e.sentence])),s=new Map;for(let t of e.clusters)for(let e of t.members)s.has(e.testIndex)||s.set(e.testIndex,t.members.filter(t=>t.testIndex!==e.testIndex).map(e=>({testIndex:e.testIndex,testId:e.testId})));for(let t of e.verdicts){let e=(t.evidence?.citedArtifacts??[]).map(e=>({id:e.id,sha:e.sha,incomplete:e.present===!1||e.evidenceIncomplete===!0})),c=e.filter(e=>e.incomplete).length,l=c===0?void 0:{missing:c,total:e.length},u=s.get(t.perTest)??[];r.set(t.perTest,{...(()=>{let e=n?.members.find(e=>e.testIndex===t.perTest)?.marks;return e===void 0?{}:{marks:e}})(),testIndex:t.perTest,sentence:o.get(t.perTest)??``,producer:t.producer,confidence:t.confidence,provenance:_s(t.producer,t.confidence),marker:i,markerText:a,citedSteps:t.evidence?.citedSteps??[],citedArtifacts:e,siblings:u,siblingText:u.length===0?void 0:Ss(u.length),missingEvidence:l,missingEvidenceText:l===void 0?void 0:Bs(l),...t.misdirection===void 0?{}:{misdirectionEvidence:Ls(t.misdirection)}})}return r}var Hs=`rounded-[2px] border border-border/60 bg-background/60 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground`,Us=`inline-block max-w-full break-all rounded-[2px] border border-border/60 bg-background/60 px-1.5 py-0.5 font-mono text-xs text-muted-foreground`,Ws=`inline-block max-w-full break-all rounded-[2px] border border-amber-500/60 bg-amber-500/10 px-1.5 py-0.5 font-mono text-xs text-amber-800 dark:text-amber-300`;function Gs({view:e,onCitedStep:t,onSelectMember:n,onCitedArtifact:r}){return(0,Q.jsxs)(`div`,{"data-verdict-block":!0,"data-verdict-producer":e.producer,"data-verdict-confidence":String(e.confidence),tabIndex:-1,className:`mx-2 mt-1 mb-1.5 rounded-[2px] border border-border/60 bg-muted/10 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-ring/50`,children:[(0,Q.jsx)(`span`,{"data-verdict-sentence":!0,className:`select-text text-foreground/80`,children:e.sentence}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-[10px] text-muted-foreground`,children:[e.marker===void 0?null:(0,Q.jsx)(`span`,{"data-verdict-marker":e.marker,className:`whitespace-nowrap text-amber-500`,children:e.markerText}),(0,Q.jsx)(`span`,{"data-verdict-provenance":!0,className:`whitespace-nowrap`,children:e.provenance})]}),e.citedSteps.length===0?null:(0,Q.jsx)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,children:e.citedSteps.map(n=>(0,Q.jsx)(`button`,{type:`button`,"data-cited-step":String(n),onClick:()=>{t(e.testIndex,n)},className:Hs,children:bs(n)},n))}),e.citedArtifacts.length===0?null:(0,Q.jsx)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,children:e.citedArtifacts.map(e=>e.incomplete?(0,Q.jsx)(`span`,{"data-cited-artifact-state":`unavailable`,"data-cited-artifact-sha":e.sha,className:`inline-flex items-center`,children:(0,Q.jsx)(fs,{variant:`inline`})},e.id):(0,Q.jsx)(`button`,{type:`button`,"data-cited-artifact":e.sha,onClick:()=>{r(e.sha)},className:Hs,children:xs},e.id))}),e.missingEvidence===void 0?null:(0,Q.jsx)(`div`,{"data-evidence-incomplete":`${String(e.missingEvidence.missing)}/${String(e.missingEvidence.total)}`,className:`mt-1.5 text-[10px] text-muted-foreground`,children:e.missingEvidenceText}),e.misdirectionEvidence===void 0?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`span`,{"data-misdirection":e.misdirectionEvidence.state,className:e.misdirectionEvidence.state===`flipped`?`min-w-0 text-amber-800 dark:text-amber-300`:`min-w-0`,children:e.misdirectionEvidence.text}),e.misdirectionEvidence.unbackedReason===void 0?null:(0,Q.jsx)(`span`,{"data-misdirection-unbacked":e.misdirectionEvidence.unbackedReason,className:`min-w-0`,children:e.misdirectionEvidence.unbackedText}),(0,Q.jsx)(`span`,{"data-misdirection-on-path":!0,className:`min-w-0`,children:e.misdirectionEvidence.onPathText})]}),e.misdirectionEvidence.causalRecords.length===0&&(e.misdirectionEvidence.onPath===void 0||e.misdirectionEvidence.onPath.length===0)?null:(0,Q.jsxs)(`dl`,{className:`mt-2 space-y-2 text-xs text-muted-foreground`,children:[e.misdirectionEvidence.causalRecords.length===0?null:(0,Q.jsxs)(`div`,{"data-misdirection-causal":String(e.misdirectionEvidence.causalRecords.length),children:[(0,Q.jsx)(`dt`,{className:`mb-1`,children:ks}),(0,Q.jsx)(`dd`,{children:(0,Q.jsx)(`ul`,{className:`flex flex-wrap items-start gap-1`,children:e.misdirectionEvidence.causalRecords.map(e=>(0,Q.jsx)(`li`,{className:`min-w-0 max-w-full`,children:(0,Q.jsx)(`span`,{"data-misdirection-causal-record":e,className:Ws,children:e})},e))})})]}),e.misdirectionEvidence.onPath===void 0||e.misdirectionEvidence.onPath.length===0?null:(0,Q.jsxs)(`div`,{"data-misdirection-exposed":String(e.misdirectionEvidence.onPath.length),children:[(0,Q.jsx)(`dt`,{className:`mb-1`,children:As}),(0,Q.jsx)(`dd`,{children:(0,Q.jsx)(`ul`,{className:`flex flex-wrap items-start gap-1`,children:e.misdirectionEvidence.onPath.map(e=>(0,Q.jsx)(`li`,{className:`min-w-0 max-w-full`,children:(0,Q.jsx)(`span`,{"data-misdirection-on-path-record":e.recordId,"data-misdirection-trust":e.trust,className:Us,children:e.recordId})},e.recordId))})})]})]}),e.misdirectionEvidence.results===void 0||e.misdirectionEvidence.results.length===0?null:(0,Q.jsxs)(`details`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer rounded-[2px] py-1 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:js}),(0,Q.jsx)(`ul`,{className:`mt-2 space-y-2`,children:e.misdirectionEvidence.results.map(e=>(0,Q.jsxs)(`li`,{"data-misdirection-result":e.recordId,children:[(0,Q.jsx)(`div`,{className:`break-all font-mono text-foreground`,children:e.recordId}),(0,Q.jsx)(`div`,{children:Ms[e.crossCheck]}),e.reason===void 0?null:(0,Q.jsx)(`div`,{"data-misdirection-result-reason":e.reason,children:Is(e.reason)})]},e.recordId))})]})]}),e.siblings.length===0?null:(0,Q.jsxs)(`div`,{"data-cluster-siblings":String(e.siblings.length),className:`mt-1.5 flex flex-wrap items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,Q.jsx)(`span`,{className:`whitespace-nowrap`,children:e.siblingText}),e.siblings.map(e=>(0,Q.jsx)(`button`,{type:`button`,"data-cluster-sibling":String(e.testIndex),onClick:()=>{n(e.testIndex)},className:Hs,children:C(e.testIndex)},e.testIndex))]})]})}var Ks=()=>{};function qs({group:e}){let t=re(e.member,e),{failureSummary:n}=e.member;return(0,Q.jsxs)(`div`,{className:`mx-2 mb-1.5 rounded-[2px] border border-border/60 bg-muted/10 px-3 py-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`span`,{"data-member-note":!0,children:t}),n?(0,Q.jsx)(`span`,{"data-member-failure-summary":!0,className:`ml-2 select-text text-foreground/70`,children:n}):null]})}function Js({group:e,showChrome:t,verdict:n,onCitedStep:r=Ks,onSelectMember:i=Ks,onCitedArtifact:a=Ks,children:o}){let[s,c]=(0,Z.useState)(!0),{member:l}=e,u=e.steps.length===0,d=p(l.attempts),f=l.outcome===void 0?void 0:Re(l.outcome),m=l.marks?.find(e=>e.stepIndex===void 0),h=u?(0,Q.jsx)(qs,{group:e}):(0,Q.jsx)(`ul`,{role:`group`,children:o}),g=n===void 0?null:(0,Q.jsx)(Gs,{view:n,onCitedStep:r,onSelectMember:i,onCitedArtifact:a});return t?(0,Q.jsxs)(`li`,{role:`none`,"data-member":String(l.testIndex),children:[(0,Q.jsxs)(`div`,{className:`mt-3 mb-1 flex items-center gap-2 bg-muted/30 px-3 py-1.5 text-xs font-medium text-muted-foreground first:mt-0`,children:[(0,Q.jsx)(`button`,{type:`button`,"data-member-toggle":!0,...n===void 0?{}:{"data-member-has-verdict":``},"aria-expanded":s,"aria-label":ie(l),onClick:()=>c(e=>!e),className:`shrink-0 rounded-sm p-0.5 transition-colors hover:bg-muted/60`,children:(0,Q.jsx)(Y,{className:U(`h-3 w-3 transition-transform`,s&&`rotate-90`)})}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:ie(l)}),(0,Q.jsx)(`span`,{"data-member-handle":!0,className:`shrink-0 font-mono text-[10px] text-muted-foreground/70`,children:C(l.testIndex)}),m===void 0?null:(0,Q.jsx)(Co,{scope:`test`,target:ai({testIndex:l.testIndex}),kind:m.kind}),d?(0,Q.jsx)(`span`,{"data-member-rerun":!0,className:`shrink-0 text-[10px] text-amber-500`,children:d}):null,f===void 0?null:(0,Q.jsx)(Ut,{"data-member-outcome":l.outcome,variant:f.variant,className:U(`ml-auto shrink-0 text-[10px] uppercase tracking-wide`,f.className),children:f.label})]}),s?g:null,s?h:null]}):u?(0,Q.jsxs)(`li`,{role:`none`,children:[g,h]}):(0,Q.jsxs)(Q.Fragment,{children:[g===null?null:(0,Q.jsx)(`li`,{role:`none`,children:g}),o]})}function Ys({sub:e,wrap:t=`free`,ordinal:n,wrapIcon:o}){let s=a(e),c=(0,Q.jsx)(s.family?r[s.family]:l,{"aria-hidden":`true`,className:U(`h-3.5 w-3.5 shrink-0 text-muted-foreground`,s.outcome===`failed`&&`text-red-500`)});return(0,Q.jsxs)(`span`,{"data-action-family":s.family??`unknown`,"data-action-outcome":s.outcome,className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-muted-foreground`,children:[o?o(c):c,n!==void 0&&(0,Q.jsxs)(`span`,{className:`shrink-0`,children:[`#`,n]}),(0,Q.jsx)(`span`,{className:U(`min-w-0`,t===`free`?`break-words`:t),children:i(s)})]})}function Xs({children:e,marker:t,state:n,tone:r,label:i}){let a=r===`primary`?`text-primary`:`text-amber-500`;return(0,Q.jsxs)(Be,{children:[(0,Q.jsx)(Le,{asChild:!0,children:(0,Q.jsxs)(`span`,{className:`relative inline-flex shrink-0 cursor-default`,children:[e,(0,Q.jsx)(`span`,{"data-cache-marker":t,"data-cache-state":n,"aria-label":i,className:U(`absolute -bottom-px -right-px inline-flex size-2 items-center justify-center rounded-full border border-background/90 bg-background/70 shadow-[0_0_0_1px_color-mix(in_srgb,var(--border)_70%,transparent)]`,a),children:(0,Q.jsx)(Oe,{className:U(`size-1.5 fill-current stroke-[2.5]`,a)})})]})}),(0,Q.jsx)(nt,{children:i})]})}function Zs(e){return Ue(e.result)?`no-input`:e.result.success?`success`:`failure`}function Qs({sub:e,stepId:t,cached:n,isSelected:r,isPlayheadRow:i=!1,onSelect:a}){let o=Zs(e);return(0,Q.jsx)(`li`,{role:`treeitem`,"aria-level":2,"aria-selected":r,"aria-current":i?!0:void 0,"data-playhead-row":i?``:void 0,"data-sub-action":String(e.subActionIndex),"data-sub-action-result":o,"data-sub-action-id":`${t}-${String(e.subActionIndex)}`,children:(0,Q.jsx)(`button`,{className:U(`relative flex w-full items-center gap-2 py-1.5 px-3 text-left rounded-[2px] text-sm`,`hover:bg-muted/50 transition-colors`,(r||i)&&`rounded-md bg-primary/10 ring-1 ring-inset ring-primary/60`),onClick:a,children:(0,Q.jsx)(Ys,{sub:e,wrap:`truncate`,wrapIcon:n?e=>(0,Q.jsx)(Xs,{marker:`sub-action-status`,state:`cached`,tone:`primary`,label:`Cached action`,children:e}):void 0})})})}function $s({log:e,isSelected:t,onSelect:n}){let r=e.type===`runjs`?sr:tt,i=(0,Q.jsx)(`span`,{className:U(`h-1.5 w-1.5 rounded-full shrink-0`,e.status===`passed`?`bg-emerald-500`:`bg-red-500`)});return(0,Q.jsx)(`li`,{role:`treeitem`,"aria-level":2,"aria-selected":t,"data-execution-id":e.id,children:(0,Q.jsxs)(`button`,{className:U(`flex w-full items-center gap-2 py-1.5 px-3 text-left rounded-[2px] text-sm`,`hover:bg-muted/50 transition-colors`,t&&`bg-primary/10 ring-1 ring-primary/30`),onClick:n,children:[(0,Q.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center`,children:i}),(0,Q.jsx)(r,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),e.phase===`inline`&&(0,Q.jsx)(`span`,{className:`text-[9px] px-1 py-0 rounded bg-amber-500/15 text-amber-400 border border-amber-500/20 font-medium shrink-0`,children:`pre`}),(0,Q.jsx)(`span`,{className:`flex-1 min-w-0 text-xs break-all text-muted-foreground`,children:e.name}),(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:ft(e.duration)})]})})}function ec({status:e}){switch(e){case`passed`:return(0,Q.jsx)(We,{className:`h-4 w-4 text-emerald-500 shrink-0 mt-0.5`});case`failed`:return(0,Q.jsx)(H,{className:`h-4 w-4 text-red-500 shrink-0 mt-0.5`});case`healed`:case`flaky`:return(0,Q.jsx)(De,{className:`h-4 w-4 text-amber-500 shrink-0 mt-0.5`});default:return(0,Q.jsx)(ye,{className:`h-4 w-4 text-muted-foreground shrink-0 mt-0.5`})}}function tc({step:e,isSelected:t,isExpanded:n,selection:r,playhead:i,onSelect:a,inlineLogs:o=[],embedded:s=!1,marks:l,onOpenFeedback:u,feedbackExpanded:d=!1,composerId:f=``}){let p=l?.find(t=>t.stepIndex===e.stepIndex),m=e.testIndex===void 0||e.stepIndex===void 0?void 0:ai({testIndex:e.testIndex,stepIndex:e.stepIndex}),h=t&&u!==void 0&&l!==void 0&&m!==void 0,g=(e.stepIndex??0)+1,_=e.subActions??[],v=_.length>0,y=e.cacheStatus===`hit`,b=v||o.length>0,x=(0,Q.jsx)(ec,{status:e.selfHealOccurred?`healed`:e.status}),S=y?(0,Q.jsx)(Xs,{marker:`step-status`,state:`all`,tone:`primary`,label:`All actions cached`,children:x}):x;return(0,Q.jsxs)(`li`,{role:`treeitem`,"aria-expanded":b?n:void 0,"aria-selected":t&&r?.type===`step`,"aria-level":1,"data-step-id":e.id,className:U(`relative`,h&&`@container/row`,!s&&`mx-2 mb-1.5 rounded-[2px]`,b&&n&&!s&&`border border-border/70 bg-muted/15`),children:[(0,Q.jsxs)(`button`,{className:U(`flex w-full items-start gap-2 py-2 px-3 text-left rounded-[2px]`,`hover:bg-muted/50 transition-colors`,t&&`rounded-md ring-1 ring-inset ring-border`,t&&r?.type===`step`&&`bg-muted/30`,h&&`pr-9 @max-[14rem]/row:flex-wrap`),onClick:()=>a({type:`step`,stepId:e.id}),children:[S,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[e.displayStepTotal?(0,Q.jsxs)(`div`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground/70`,children:[`Step `,e.displayStepOrder,` of `,e.displayStepTotal]}):null,(0,Q.jsx)(c,{step:e})]}),p!==void 0&&m!==void 0&&!h?(0,Q.jsx)(Co,{scope:`step`,target:m,kind:p.kind}):null,(0,Q.jsx)(`span`,{className:U(`text-xs text-muted-foreground shrink-0 pt-0.5`,h&&`@max-[14rem]/row:basis-full @max-[14rem]/row:pl-6`),children:ft(e.duration)})]}),h?(0,Q.jsx)(`span`,{className:`absolute right-1 top-1`,children:(0,Q.jsx)(So,{scope:`step`,label:da({scope:`step`,stepNumber:g,markedChoice:p?.kind}),tooltip:fa(g,p!==void 0),target:m,marked:p!==void 0,expanded:d,controls:f,onOpen:u})}):null,n&&b&&(0,Q.jsxs)(`ul`,{role:`group`,children:[o.map(t=>(0,Q.jsx)($s,{log:t,isSelected:r?.type===`execution`&&r.logId===t.id,onSelect:()=>a({type:`execution`,stepId:e.id,logId:t.id})},t.id)),_.map(t=>(0,Q.jsx)(Qs,{sub:t,stepId:e.id,cached:y,isPlayheadRow:i?.testIndex===t.testIndex&&i.stepIndex===t.stepIndex&&i.subActionIndex===t.subActionIndex,isSelected:r?.type===`subaction`&&r.stepId===e.id&&r.subIndex===t.subActionIndex,onSelect:()=>a({type:`subaction`,stepId:e.id,subIndex:t.subActionIndex})},t.subActionIndex))]})]})}function nc({log:e,isSelected:t,onSelect:n}){return(0,Q.jsx)(`li`,{role:`treeitem`,"aria-level":1,"aria-selected":t,children:(0,Q.jsxs)(`button`,{className:U(`flex w-full items-center gap-2 py-1.5 px-3 text-left rounded-[2px] text-sm`,`hover:bg-muted/50 transition-colors`,t&&`bg-primary/10 ring-1 ring-primary/30`),onClick:n,children:[e.status===`passed`?(0,Q.jsx)(We,{className:`h-3 w-3 text-emerald-500 shrink-0`}):e.status===`running`?(0,Q.jsx)(ye,{className:`h-3 w-3 text-blue-500 shrink-0`}):(0,Q.jsx)(H,{className:`h-3 w-3 text-red-500 shrink-0`}),(0,Q.jsx)(tt,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,Q.jsx)(`span`,{className:`flex-1 min-w-0 text-xs truncate`,children:e.name}),(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:ft(e.duration)})]})})}function rc({title:e}){return(0,Q.jsx)(`div`,{className:`px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60`,children:e})}function ic({title:e,hooks:t,selection:n,onSelect:r}){return t.length===0?null:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(rc,{title:e}),(0,Q.jsx)(`div`,{className:`mx-2 mb-1.5 rounded-[2px] border border-border/70 bg-muted/15`,children:(0,Q.jsx)(`ul`,{role:`group`,children:t.map(e=>(0,Q.jsx)(nc,{log:e,isSelected:n?.type===`hook`&&n.hookId===e.id,onSelect:()=>r({type:`hook`,hookId:e.id})},e.id))})})]})}function ac({groups:e,showMemberChrome:t=!1,analysisView:n,onCitedStep:r,onSelectMember:i,onCitedArtifact:a,selection:o,playhead:s,onSelect:c,setupHooks:l=[],teardownHooks:u=[],inlineLogs:d=[],feedback:f}){let p=(0,Z.useMemo)(()=>{let t=Qn(e),n=0;return e.map(e=>{let r=t.slice(n,n+e.steps.length);return n+=e.steps.length,{group:e,steps:r}})},[e]),m=(0,Z.useMemo)(()=>{let t=new Map;if(e.length!==1)return t;let[n]=p;if(!n)return t;for(let e of d){if(!e.stepId)continue;let r=Number(e.stepId),i=n.steps.find(e=>e.rawStepOrder===r)?.id??e.stepId,a=t.get(i)??[];a.push(e),t.set(i,a)}return t},[d,p,e.length]),h=p.some(e=>e.steps.length>0);return e.length===0&&!h?l.length>0||u.length>0?(0,Q.jsx)(Wt,{className:`flex-1`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(ic,{title:`Setup`,hooks:l,selection:o,onSelect:c}),(0,Q.jsx)(ic,{title:`Teardown`,hooks:u,selection:o,onSelect:c})]})}):(0,Q.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-muted-foreground text-sm`,children:`No steps were executed.`}):(0,Q.jsx)(Wt,{className:`flex-1`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(ic,{title:`Setup`,hooks:l,selection:o,onSelect:c}),(0,Q.jsx)(rc,{title:`Steps`}),(0,Q.jsx)(`ul`,{role:`tree`,"aria-label":`Test steps`,className:`py-1`,children:p.map(({group:e,steps:l})=>(0,Q.jsx)(Js,{group:e,showChrome:t,verdict:n?.get(e.member.testIndex),onCitedStep:r,onSelectMember:i,onCitedArtifact:a,children:l.map(t=>{let{testIndex:n,stepIndex:r}=t,i=f!==void 0&&n!==void 0&&r!==void 0;return(0,Q.jsx)(tc,{step:t,onOpenFeedback:i?e=>f.onOpenStep(n,r,e):void 0,feedbackExpanded:i&&f.expandedAddress===ai({testIndex:n,stepIndex:r}),composerId:f?.composerId,marks:e.member.marks,isSelected:Zn(o)&&o.stepId===t.id,isExpanded:!0,selection:o,playhead:s,onSelect:c,inlineLogs:m.get(t.id)??[]},t.id)})},e.member.testIndex))}),(0,Q.jsx)(ic,{title:`Teardown`,hooks:u,selection:o,onSelect:c})]})})}function oc(e,t){let n=e.split(/\s+/u).filter(e=>e!==``);return n.length<=t?{text:e,isTruncated:!1}:{text:`${n.slice(0,t).join(` `)}...`,isTruncated:!0}}var sc={idle:``,copied:`Failure summary copied to the clipboard`,failed:`Could not copy the failure summary to the clipboard`};function cc({summary:e}){let[t,n]=(0,Z.useState)(!1),[r,i]=(0,Z.useState)(`idle`),a=oc(e,20),o=t||!a.isTruncated,s=e=>{i(e),setTimeout(()=>i(`idle`),2e3)};return(0,Q.jsx)(`div`,{"data-failure-banner":!0,"data-failure-banner-state":o?`full`:`truncated`,className:`mx-2 mt-2 rounded-[2px] border border-red-500/20 bg-red-500/5 px-3 py-2 shrink-0`,children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(ue,{className:`h-4 w-4 text-red-400 shrink-0 mt-0.5`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{"data-failure-banner-text":!0,className:`flex-1 text-sm text-foreground/80 select-text`,children:t?e:a.text}),(0,Q.jsx)(`button`,{"data-failure-banner-copy":!0,"data-copy-status":r,onClick:()=>{let n=navigator.clipboard?.writeText(t?e:a.text);if(n===void 0){s(`failed`);return}n.then(()=>{s(`copied`)},()=>{s(`failed`)})},className:`shrink-0 mt-0.5 p-0.5 rounded-sm hover:bg-red-500/10 transition-colors`,"aria-label":`Copy failure summary`,title:`Copy failure summary`,children:r===`copied`?(0,Q.jsx)(ae,{className:`h-3.5 w-3.5 text-emerald-400`,"aria-hidden":`true`}):(0,Q.jsx)(le,{className:U(`h-3.5 w-3.5`,r===`failed`?`text-red-400`:`text-muted-foreground`),"aria-hidden":`true`})}),(0,Q.jsx)(`span`,{"data-failure-banner-copy-status":!0,role:`status`,"aria-live":`polite`,className:`sr-only`,children:sc[r]}),a.isTruncated&&(0,Q.jsx)(`button`,{"data-failure-banner-toggle":!0,"aria-label":t?`Show less`:`Show full failure summary`,onClick:()=>n(e=>!e),className:`shrink-0 mt-0.5 p-0.5 rounded-sm hover:bg-red-500/10 transition-colors`,children:(0,Q.jsx)(Y,{"aria-hidden":`true`,className:U(`h-3.5 w-3.5 text-muted-foreground transition-transform`,t&&`rotate-90`)})})]})})}var lc=e(Lt(),1);function uc({annotation:e,refLabel:t,renderedW:n,renderedH:r,offsetX:i=0,offsetY:a=0}){let o=(0,Z.useId)(),s=n/(e.viewport?.width||1),c=r/(e.viewport?.height||1);return(0,Q.jsxs)(Q.Fragment,{children:[e.failureHighlight&&(0,Q.jsx)(`div`,{"data-annotation":`failure`,className:`absolute border-2 border-red-500/70 rounded-sm bg-red-500/15 animate-pulse pointer-events-none`,style:{left:i+e.failureHighlight.x*s,top:a+e.failureHighlight.y*c,width:e.failureHighlight.width*s,height:e.failureHighlight.height*c}}),e.boundingBox&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{"data-annotation":`region`,className:`absolute border-2 border-emerald-500/70 rounded-sm bg-emerald-500/10 pointer-events-none`,style:{left:i+e.boundingBox.x*s,top:a+e.boundingBox.y*c,width:e.boundingBox.width*s,height:e.boundingBox.height*c}}),t&&(0,Q.jsx)(`div`,{className:`absolute text-[10px] font-mono font-bold text-white bg-emerald-600/90 px-1 rounded-sm pointer-events-none leading-tight`,style:{left:i+e.boundingBox.x*s,top:a+e.boundingBox.y*c-14},children:t})]}),e.clickPoint&&(0,Q.jsx)(`div`,{"data-annotation":`point`,className:`absolute pointer-events-none`,style:{left:i+e.clickPoint.x*s,top:a+e.clickPoint.y*c,transform:`translate(-50%, -50%)`,zIndex:1},children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full bg-turquoise-500 border-[1.5px] border-black/60 shadow-[0_0_0_1px_rgba(255,255,255,0.4)]`}),(0,Q.jsx)(`div`,{className:`absolute rounded-full border-2 border-turquoise-500/50 animate-ping`,style:{width:22,height:22,left:-8.5,top:-8.5}})]})}),e.startPoint&&e.endPoint&&(()=>{let t=e.type===`drag`?`oklch(0.65 0.19 150)`:`oklch(0.65 0.19 210)`,n=e.type===`drag`?`oklch(0.65 0.19 150 / 0.4)`:`oklch(0.65 0.19 210 / 0.4)`,r=i+e.startPoint.x*s,o=a+e.startPoint.y*c,l=i+e.endPoint.x*s,u=a+e.endPoint.y*c;return(0,Q.jsxs)(Q.Fragment,{children:[Array.from({length:4},(e,t)=>{let i=(t+1)/5;return(0,Q.jsx)(`div`,{className:`absolute pointer-events-none animate-gesture-trail`,style:{left:r+(l-r)*i,top:o+(u-o)*i,transform:`translate(-50%, -50%)`,zIndex:1,animationDelay:`${t*.15}s`},children:(0,Q.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full`,style:{backgroundColor:n}})},`trail-${t}`)}),(0,Q.jsx)(`div`,{className:`absolute pointer-events-none`,style:{left:r,top:o,transform:`translate(-50%, -50%)`,zIndex:1},children:(0,Q.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full border-[1.5px] border-black/50 shadow-[0_0_0_1px_rgba(255,255,255,0.3)]`,style:{backgroundColor:t}})}),(0,Q.jsx)(`div`,{className:`absolute pointer-events-none`,style:{left:l,top:u,transform:`translate(-50%, -50%)`,zIndex:1},children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(`div`,{className:`w-2 h-2 rounded-full border-[1.5px] border-black/50 shadow-[0_0_0_1px_rgba(255,255,255,0.3)]`,style:{backgroundColor:t}}),(0,Q.jsx)(`div`,{className:`absolute rounded-full border-[1.5px] animate-ping`,style:{borderColor:n,width:18,height:18,left:-7,top:-7}})]})})]})})(),e.direction&&!e.startPoint&&(()=>{let t=e.clickPoint?i+e.clickPoint.x*s:i+n/2,l=e.clickPoint?a+e.clickPoint.y*c:a+r/2,u=Math.min(r,n)*.35,[d,f]={up:[0,-u],down:[0,u],left:[-u,0],right:[u,0]}[e.direction]||[0,0];return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`svg`,{className:`absolute pointer-events-none`,style:{left:i,top:a,zIndex:1},width:n,height:r,children:[(0,Q.jsxs)(`defs`,{children:[(0,Q.jsx)(`marker`,{id:`scroll-arrow-border-${o}`,markerWidth:`16`,markerHeight:`14`,refX:`14`,refY:`7`,orient:`auto`,markerUnits:`userSpaceOnUse`,children:(0,Q.jsx)(`path`,{d:`M1 1 L14 7 L1 13`,fill:`none`,stroke:`oklch(0 0 0 / 0.5)`,strokeWidth:`3`,strokeLinejoin:`round`,strokeLinecap:`round`})}),(0,Q.jsx)(`marker`,{id:`scroll-arrow-${o}`,markerWidth:`16`,markerHeight:`14`,refX:`14`,refY:`7`,orient:`auto`,markerUnits:`userSpaceOnUse`,children:(0,Q.jsx)(`path`,{d:`M1 1 L14 7 L1 13`,fill:`none`,stroke:`oklch(0.719 0.119 209.8)`,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`})})]}),(0,Q.jsx)(`line`,{x1:t-i,y1:l-a,x2:t-i+d,y2:l-a+f,stroke:`oklch(0 0 0 / 0.5)`,strokeWidth:4,strokeLinecap:`round`,markerEnd:`url(#scroll-arrow-border-${o})`}),(0,Q.jsx)(`line`,{x1:t-i,y1:l-a,x2:t-i+d,y2:l-a+f,stroke:`oklch(0.719 0.119 209.8 / 0.8)`,strokeWidth:2.5,strokeLinecap:`round`,markerEnd:`url(#scroll-arrow-${o})`})]}),(0,Q.jsx)(`div`,{className:`absolute pointer-events-none`,style:{left:t,top:l,transform:`translate(-50%, -50%)`,zIndex:2},children:(0,Q.jsxs)(`div`,{className:`relative flex items-center justify-center`,style:{width:22,height:22},children:[(0,Q.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full bg-turquoise-500 border-[1.5px] border-black/60 shadow-[0_0_0_1px_rgba(255,255,255,0.4)]`}),(0,Q.jsx)(`div`,{className:`absolute inset-0 rounded-full border-2 border-turquoise-500/50 animate-ping`})]})})]})})(),e.pinchScale&&(()=>{let t=e.startPoint?i+e.startPoint.x*s:i+n/2,o=e.startPoint?a+e.startPoint.y*c:a+r/2,l=e.pinchScale===`out`?`animate-gesture-pinch-out`:`animate-gesture-pinch-in`;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`absolute pointer-events-none ${l}`,style:{left:t-24,top:o,transform:`translate(-50%, -50%)`,zIndex:1},children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full bg-turquoise-500 border-[1.5px] border-black/50 shadow-[0_0_0_1px_rgba(255,255,255,0.3)]`}),(0,Q.jsx)(`div`,{className:`absolute rounded-full border-[1.5px] border-turquoise-500/40 animate-ping`,style:{width:18,height:18,left:-6.5,top:-6.5}})]})}),(0,Q.jsx)(`div`,{className:`absolute pointer-events-none ${l}`,style:{left:t+24,top:o,transform:`translate(-50%, -50%)`,zIndex:1,animationDirection:`reverse`},children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full bg-turquoise-500 border-[1.5px] border-black/50 shadow-[0_0_0_1px_rgba(255,255,255,0.3)]`}),(0,Q.jsx)(`div`,{className:`absolute rounded-full border-[1.5px] border-turquoise-500/40 animate-ping`,style:{width:18,height:18,left:-6.5,top:-6.5}})]})})]})})()]})}function dc({children:e,width:t,height:n,annotation:r,annotationLabel:i,magnifier:a=!1,fullscreen:o=!1,mediaKey:s}){let c=(0,Z.useRef)(null),l=(0,Z.useRef)(null),u=(0,Z.useRef)(!1),[d,f]=(0,Z.useState)({width:0,height:0}),[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(e=>{let t=e[0]?.contentRect;t&&f({width:t.width,height:t.height})});return t.observe(e),()=>t.disconnect()},[]);let _=t>0&&n>0?Math.min(d.width/t,d.height/n):0,v=t*_,y=n*_,b=(d.width-v)/2,x=(d.height-y)/2,S=Math.min(150,d.width,d.height),C=2.5,w=p?Math.max(0,Math.min(d.width-S,p.x+20+S>d.width?p.x-S-10:p.x+20)):0,T=p?Math.max(0,Math.min(d.height-S,p.y+20+S>d.height?p.y-S-10:p.y+20)):0,E=p?S/2-(p.x-b)*C:0,D=p?S/2-(p.y-x)*C:0;return(0,Z.useEffect)(()=>{m(null)},[a,o,s,t,n,d.width,d.height]),(0,Z.useEffect)(()=>{u.current=!1},[s]),(0,Z.useEffect)(()=>{if(g(!1),!a||!p||S<=0)return;let e=c.current?.querySelector(`video, img`),t=l.current;if(!(e instanceof HTMLVideoElement||e instanceof HTMLImageElement)||!t)return;let n=t.getContext(`2d`);if(!n)return;let r,i=!1,o=()=>{r!==void 0&&cancelAnimationFrame(r),r=void 0},s=()=>{if(r=void 0,!i){try{n.clearRect(0,0,S,S),n.drawImage(e,E,D,v*C,y*C),g(!0)}catch{g(!1)}e instanceof HTMLVideoElement&&!e.paused&&!e.ended&&(r=requestAnimationFrame(s))}},d=()=>{o(),s()},f=()=>{u.current=!0,o(),m(null)};for(let t of[`loadeddata`,`seeked`,`play`,`pause`])e.addEventListener(t,d);return e.addEventListener(`error`,f),s(),()=>{i=!0,o();for(let t of[`loadeddata`,`seeked`,`play`,`pause`])e.removeEventListener(t,d);e.removeEventListener(`error`,f)}},[a,p,S,E,D,v,y,s]),(0,Q.jsxs)(`div`,{ref:c,"data-media-viewport":!0,className:`relative w-full overflow-hidden rounded-lg border bg-muted/20`,onPointerMove:e=>{if(!a||u.current||e.pointerType===`touch`||_<=0)return;let t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-e.currentTarget.clientLeft,r=e.clientY-t.top-e.currentTarget.clientTop;m(n>=b&&n<=b+v&&r>=x&&r<=x+y?{x:n,y:r}:null)},onPointerLeave:()=>m(null),style:{height:o?`72vh`:`50vh`},children:[(0,Q.jsxs)(`div`,{"data-media-transform":!0,style:{position:`absolute`,width:v,height:y,left:b,top:x},children:[e,r&&_>0&&(0,Q.jsx)(uc,{annotation:r,renderedW:v,renderedH:y})]}),a&&p&&(0,Q.jsxs)(`div`,{"data-media-lens":!0,"aria-hidden":`true`,className:`pointer-events-none absolute z-10 overflow-hidden rounded-full border-2 border-muted-foreground/50 bg-background shadow-lg`,style:{width:S,height:S,left:w,top:T,visibility:h?`visible`:`hidden`},children:[(0,Q.jsx)(`canvas`,{ref:l,width:S,height:S,className:`absolute inset-0`}),r&&(0,Q.jsx)(`div`,{"data-lens-annotation":!0,style:{position:`absolute`,left:E,top:D,width:v,height:y,transform:`scale(${C})`,transformOrigin:`top left`},children:(0,Q.jsx)(uc,{annotation:r,renderedW:v,renderedH:y})})]}),i&&(0,Q.jsx)(`span`,{"data-video-action-cue":!0,className:`absolute bottom-1 left-1 rounded bg-background/90 px-2 py-1 text-xs`,children:i})]})}function fc({src:e,annotation:t,refLabel:n,className:r,onUnavailable:i,embedded:a}){let o=(0,Z.useRef)(null),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)({width:0,height:0}),[p,m]=(0,Z.useState)({width:0,height:0}),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)({x:0,y:0}),[y,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(!0);(0,Z.useEffect)(()=>{c(!1),u(!1)},[e]),(0,Z.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e)f({width:t.contentRect.width,height:t.contentRect.height})});return t.observe(e),()=>t.disconnect()},[]),(0,Z.useEffect)(()=>{if(!x)return;let e=e=>{e.key===`Escape`&&S(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x]);let T=(0,Z.useCallback)(e=>{let t=e.currentTarget;m({width:t.naturalWidth,height:t.naturalHeight}),c(!0),a?.onAvailability?.(!0)},[a?.onAvailability]),E=(0,Z.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();v({x:e.clientX-t.left,y:e.clientY-t.top})},[]),D=d.width,O=d.height,k=p.width/(p.height||1),A=D/(O||1),j=D,M=O,N=0,ee=0;s&&p.width>0&&(k>A?(j=D,M=D/k,ee=(O-M)/2):(M=O,j=O*k,N=(D-j)/2));let P=2.5,F=j*P,I=M*P,te=-((_.x-N)*P-150/2),L=-((_.y-ee)*P-150/2),R=_.x+20,z=_.y+20;R+150>D&&(R=_.x-150-10),z+150>O&&(z=_.y-150-10),R<0&&(R=0),z<0&&(z=0);let ne=y&&h&&s;if(l)return(0,Q.jsx)(`div`,{className:U(`relative rounded-lg border bg-muted/20 flex items-center justify-center`,r),style:{aspectRatio:`16 / 9`,maxHeight:`50vh`},children:(0,Q.jsxs)(`div`,{className:`text-muted-foreground flex flex-col items-center gap-2`,children:[(0,Q.jsx)(ir,{className:`h-8 w-8`}),(0,Q.jsx)(`span`,{className:`text-sm`,children:`Screenshot unavailable`})]})});let re=!!(t?.clickPoint||t?.boundingBox||t?.failureHighlight||t?.startPoint||t?.endPoint||t?.direction||t?.pinchScale),ie=s&&t&&C&&(0,Q.jsx)(uc,{annotation:t,refLabel:n,renderedW:j,renderedH:M,offsetX:N,offsetY:ee});return a?(0,Q.jsx)(dc,{width:p.width,height:p.height,magnifier:a.magnifier,fullscreen:a.fullscreen,mediaKey:e,annotation:s&&a.annotationsVisible?t??void 0:void 0,children:(0,Q.jsx)(`img`,{src:e,alt:`Step screenshot`,className:`h-full w-full object-contain`,onLoad:T,onError:()=>{u(!0),a.onAvailability?.(!1),i?.()}})}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{ref:o,className:U(`relative overflow-hidden rounded-lg border bg-muted/20 group w-full`,r),style:{aspectRatio:s&&p.width>0?`${p.width} / ${p.height}`:`16 / 9`,maxHeight:`50vh`},onMouseMove:y?E:void 0,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[!s&&(0,Q.jsx)(St,{className:`absolute inset-0 rounded-lg`}),(0,Q.jsx)(`img`,{src:e,alt:`Step screenshot`,className:U(`w-full h-full object-contain`,!s&&`opacity-0`),onLoad:T,onError:()=>{u(!0),i?.()}}),ie,ne&&(0,Q.jsx)(`div`,{className:`absolute rounded-full border-2 border-primary/50 shadow-lg pointer-events-none z-10`,style:{width:150,height:150,left:R,top:z,backgroundImage:`url(${e})`,backgroundSize:`${F}px ${I}px`,backgroundPosition:`${te}px ${L}px`,backgroundRepeat:`no-repeat`}}),s&&(0,Q.jsxs)(`div`,{className:`absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity z-20`,children:[re&&(0,Q.jsx)(X,{variant:`secondary`,size:`icon-sm`,className:`h-7 w-7 bg-background/80 backdrop-blur-sm`,onClick:e=>{e.stopPropagation(),w(!C)},title:C?`Hide annotations`:`Show annotations`,children:(0,Q.jsx)(ur,{className:U(`h-3.5 w-3.5`,C&&`text-primary`)})}),(0,Q.jsx)(X,{variant:`secondary`,size:`icon-sm`,className:`h-7 w-7 bg-background/80 backdrop-blur-sm`,onClick:e=>{e.stopPropagation(),b(!y)},title:y?`Disable magnifier`:`Enable magnifier`,children:(0,Q.jsx)(G,{className:U(`h-3.5 w-3.5`,y&&`text-primary`)})}),(0,Q.jsx)(X,{variant:`secondary`,size:`icon-sm`,className:`h-7 w-7 bg-background/80 backdrop-blur-sm`,onClick:e=>{e.stopPropagation(),S(!0)},title:`View full size`,children:(0,Q.jsx)(_r,{className:`h-3.5 w-3.5`})})]})]}),x&&(0,Q.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center`,onClick:()=>S(!1),children:[(0,Q.jsx)(X,{variant:`secondary`,size:`icon-sm`,className:`absolute top-4 right-4 h-8 w-8 bg-background/80 backdrop-blur-sm z-10`,onClick:()=>S(!1),children:(0,Q.jsx)(Qe,{className:`h-4 w-4`})}),(0,Q.jsx)(`img`,{src:e,alt:`Step screenshot (full size)`,className:`object-contain rounded-lg`,style:{maxWidth:`90vw`,maxHeight:`90vh`},onClick:e=>e.stopPropagation()})]})]})}var pc=jt(`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 min-w-9 px-2`,sm:`h-8 min-w-8 px-1.5`,lg:`h-10 min-w-10 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}}),mc=Z.createContext({size:`default`,variant:`default`,spacing:0});function hc({className:e,variant:t,size:n,spacing:r=0,children:i,...a}){return(0,Q.jsx)(Gr,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:U(`group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs`,e),...a,children:(0,Q.jsx)(mc.Provider,{value:{variant:t,size:n,spacing:r},children:i})})}function gc({className:e,children:t,variant:n,size:r,...i}){let a=Z.useContext(mc);return(0,Q.jsx)(Kr,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:U(pc({variant:a.variant||n,size:a.size||r}),`w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10`,`data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l`,e),...i,children:t})}function _c(e){let t=e?.result.annotation;if(!t||!e)return;let n={type:e.plannedAction.type,viewport:t.viewport,direction:t.direction,failureHighlight:t.failureHighlight};switch(t.kind){case`point`:return{...n,clickPoint:t.point,boundingBox:t.point.boundingBox};case`region`:return{...n,boundingBox:t.region.boundingBox};case`path`:return{...n,startPoint:t.path.start,endPoint:t.path.end};case`pinch`:return{...n,startPoint:t.pinch.center,pinchScale:t.pinch.scale>1?`out`:`in`}}}function vc(e,t,n,r){let i=e.result.annotation,a=i?.recording;if(!(!i||!a||!mt(i)||!Number.isFinite(t)||n!==a.width||r!==a.height||t<a.startMs||t>=a.endMs))return _c(e)}function yc(e){let t=e.result.annotation,n=t?.recording;return t&&n&&mt(t)&&n.endMs>n.startMs?(n.startMs+n.endMs)/2:e.recordingOffsetMs}function bc(e,t,n,r){for(let[i,a]of e.entries()){let o=vc(a,t,n,r);if(o)return{annotation:o,recent:!1};let s=a.result.annotation?.recording,c=e[i+1],l=c?.result.annotation?.recording;if(!s||c&&(!l||!mt(c.result.annotation)))continue;let u=Math.min(s.endMs+350,l?.startMs??1/0);if(t>=s.endMs&&t<u){let e=vc(a,(s.startMs+s.endMs)/2,n,r);if(e)return{annotation:e,recent:!0}}}}function xc(e){return e!==void 0&&e.evidenceIncomplete!==!0&&e.present!==!1}function Sc(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=D(n);if(xc(r))return{index:n.subActionIndex,ref:r,...t===e.length-1?{}:{substitution:{shown:t+1,total:e.length}}}}}function Cc(e){return{testIndex:e.step.testIndex,stepIndex:e.step.stepIndex,subActionIndex:Sc(e.subActions)?.index??e.subActions.at(-1)?.subActionIndex??null}}function wc(e){return Number.isSafeInteger(e)&&e>=0}function Tc(e){if(e?.type!==`step`&&e?.type!==`subaction`)return null;let t=$n(e.stepId);return!t||e.type===`subaction`&&!wc(e.subIndex)?null:{...t,subActionIndex:e.type===`subaction`?e.subIndex:null}}function Ec(e){if(!e||!wc(e.testIndex)||!wc(e.stepIndex)||e.subActionIndex!==null&&!wc(e.subActionIndex))return null;let t=er(e.testIndex,e.stepIndex);return e.subActionIndex===null?{type:`step`,stepId:t}:{type:`subaction`,stepId:t,subIndex:e.subActionIndex}}function Dc(e){let t=[...e.steps].sort((e,t)=>e.step.stepIndex-t.step.stepIndex).map(e=>({...e,subActions:[...e.subActions].sort((e,t)=>e.subActionIndex-t.subActionIndex)})),n=e.member.recording,r=n?.state===`present`?n.durationMs:void 0,i=r!==void 0&&Number.isFinite(r)&&r>=0&&t.every(e=>e.subActions.every(e=>e.recordingOffsetMs!==void 0))?`time`:`ordinal`,a=i===`time`?r:t.reduce((e,t)=>e+Math.max(1,t.subActions.length),0),o=[],s=0,c=t.map(e=>{let t=s,n=e.subActions.map(e=>{let t=D(e),n=e.recordingOffsetMs,r=yc(e),c={testIndex:e.testIndex,stepIndex:e.stepIndex,subActionIndex:e.subActionIndex,ordinal:o.length+1,position:i===`time`?a===0?+(r>0):Math.min(1,Math.max(0,r/a)):(s+.5)/a,result:Ue(e.result)?`no-input`:e.result.success?`passed`:`failed`,frame:xc(t)?`available`:`absent`,...t?{ref:t}:{},...n===void 0?{}:{recordingOffsetMs:n},subAction:e};return s++,o.push(c),c});return e.subActions.length===0&&s++,{...e,start:t/a,end:s/a,markers:n}});if(i===`time`){let e=1;for(let t=c.length-1;t>=0;t--){let n=c[t];n.start=n.markers[0]?.position??e,n.end=e,e=n.start}}return{testIndex:e.member.testIndex,axis:i,extent:a,segments:c,markers:o,playhead:t[0]?Cc(t[0]):null}}function Oc(e,t){let n,r=1/0;for(let i of t){let t=Math.abs(e-i.centrePx);(t<r||t===r&&n&&i.marker.ordinal<n.ordinal)&&(n=i.marker,r=t)}return n}function kc(e,t){return Oc(e,t.filter(t=>Math.abs(e-t.centrePx)<=12))}function Ac(e,t){return e.markers.find(e=>e.ref?.sha===t)}function jc(e,t=`readout`){if(e===void 0||!Number.isFinite(e)||e<0)return;let n=Math.floor(e/1e3),r=Math.floor(n/60),i=String(n%60).padStart(2,`0`),a=r<60?`${r}:${i}`:`${Math.floor(r/60)}:${String(r%60).padStart(2,`0`)}:${i}`;return t===`popover`?`${a}.${Math.floor(e/100)%10}`:a}var Mc={frames:`Frames`,video:`Video`,source:`Playback source`,framesTooltip:`The exact screenshots the model saw when it decided`,play:`Play recording`,pause:`Pause recording`,speed:`Playback speed`,substitution:(e,t)=>`Showing #${e} of ${t} — the latest sub-action with a screenshot`,lightboxTitle:`Cited screenshot`,lightboxClose:`Close screenshot`,lightboxNote:`This screenshot is cited by the analysis but does not belong to a recorded sub-action, so it has no place on the timeline.`},Nc=`agent-qa.run-detail.player-source`,Pc=[.5,1,2,4,8,16],Fc=`This recording cannot be synchronized with the selected action. Switch to Frames to see its screenshot.`;function Ic(e,t,n){if(e?.state!==`present`||t===`ordinal`)return`frames`;try{return(n??globalThis.localStorage)?.getItem(`agent-qa.run-detail.player-source`)===`frames`?`frames`:`video`}catch{return`video`}}function Lc(e,t){try{(t??globalThis.localStorage)?.setItem(Nc,e)}catch{}}function Rc(e,t){return t.status===404||t.blobAbsent?{state:`unavailable`,incomplete:!0,...w[e].unavailable,explanation:w.frame.unavailable.explanation}:{state:`failed`,failure:`load`,...w[e].failed.load,actionLabel:R[e]}}function zc(e,t){return{sentence:a(e.subAction),ordinal:e.ordinal,result:o[e.result],offset:jc(e.recordingOffsetMs),...t?.substitution?{substitution:Mc.substitution(t.substitution.shown,t.substitution.total),frameSourceSubAction:t.index}:{}}}async function Bc(e,t){try{let n=await fetch(e,{method:`GET`,headers:{Range:`bytes=0-0`},signal:t});try{await n.body?.cancel()}catch{}return{status:n.status}}catch{return{}}}function Vc({runId:e,frame:t,annotation:n,wholeStep:r=!1,embedded:i}){let[a,o]=(0,Z.useState)(),[s,c]=(0,Z.useState)(0),l=(0,Z.useRef)(null),u=t?lt.runArtifact(e,t.sha):void 0;return(0,Z.useEffect)(()=>()=>l.current?.abort(),[u]),a||t&&!xc(t)?(0,Q.jsx)(`div`,{"data-artifact-state":`unavailable`,className:`p-3`,children:(0,Q.jsx)(te,{kind:`frame`,...a??Rc(`frame`,{blobAbsent:!0}),onAction:()=>{o(void 0),c(e=>e+1)}})}):xc(t)?(0,Q.jsx)(`div`,{"data-artifact-state":`available`,className:`p-3`,children:(0,Q.jsx)(fc,{src:u,annotation:n,embedded:i,onUnavailable:()=>{l.current?.abort();let e=new AbortController;l.current=e,Bc(u,e.signal).then(t=>{e.signal.aborted||o(Rc(`frame`,t))})}},s)}):(0,Q.jsx)(`div`,{"data-artifact-state":`unavailable`,className:`p-3`,children:(0,Q.jsx)(te,{kind:`frame`,state:`not-captured`,...w.frame[`not-captured`][r?`step`:`sub-action`]})})}function Hc({timeline:e,caption:t,controls:n,note:r,readout:i}){return(0,Q.jsxs)(`div`,{"data-player-footer":!0,className:`pb-2`,children:[(0,Q.jsxs)(`div`,{"data-player-timeline-row":!0,className:`flex min-w-0 items-start pr-3`,children:[e,i]}),(0,Q.jsxs)(`div`,{"data-player-actions":!0,className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 px-3`,children:[t,(0,Q.jsx)(`div`,{"data-player-controls":!0,className:`ml-auto flex min-w-0 flex-wrap items-center justify-end gap-2`,children:n})]}),r&&(0,Q.jsx)(`p`,{className:`px-3 pt-1 text-xs text-muted-foreground`,children:r})]})}var Uc=2;function Wc(e){return e?`${e.testIndex}:${e.stepIndex}:${e.subActionIndex}`:``}function Gc({model:e,playhead:t,recording:n,runId:r,media:i,seekFraction:a,seekRevision:o,onPlayheadChange:s,onPlayheadObserved:c,onProgress:l,onRecordingEnded:u,autoPlay:d,speed:f,setSpeed:p,isTimelineKeyIgnored:m,readoutHost:h,transportHost:g,toolbar:_,view:v,clock:y}){let b=(0,Z.useRef)(null),x=(0,Z.useRef)(null),S=(0,Z.useRef)({model:e,playhead:t,onPlayheadChange:s,onPlayheadObserved:c,onProgress:l,onRecordingEnded:u});S.current={model:e,playhead:t,onPlayheadChange:s,onPlayheadObserved:c,onProgress:l,onRecordingEnded:u};let C=(0,Z.useRef)(``),w=(0,Z.useRef)(!1),T=(0,Z.useRef)(null),E=(0,Z.useRef)(!1),D=(0,Z.useRef)(void 0),[O,k]=(0,Z.useState)(!1),[A,j]=(0,Z.useState)(!1),[M,N]=(0,Z.useState)(0),[ee,P]=(0,Z.useState)({width:0,height:0}),[F,I]=(0,Z.useState)(),[L,R]=(0,Z.useState)(0),z=lt.runArtifact(r,n.ref.sha),ne=e.markers.find(e=>Wc(e)===Wc(t)),re=ne?yc(ne.subAction):void 0,ie=Wc(t),ae=v.annotationsVisible?bc(e.markers.map(e=>e.subAction),M*1e3,ee.width,ee.height):void 0;(0,Z.useEffect)(()=>{let e=i??b.current;if(!e)return;x.current=e,w.current=!1,T.current=null,E.current=!1,D.current=void 0,k(!1);let t=new AbortController,n,r=()=>{n!==void 0&&cancelAnimationFrame(n),n=void 0},a=()=>{w.current=!0,k(!0),v.onAvailability?.(!0),N(e.currentTime),P({width:b.current?.videoWidth??0,height:b.current?.videoHeight??0})},o=()=>{let t=D.current;t===void 0||!le(e)||(D.current=void 0,e.currentTime=t,N(e.currentTime))},s=()=>{E.current=!0,o()},c=()=>{l(),o()},l=()=>{if(N(e.currentTime),S.current.onProgress?.(S.current.model.testIndex,e.currentTime),e.paused||S.current.model.axis!==`time`)return;let t=S.current.model.markers.filter(t=>yc(t.subAction)<=e.currentTime*1e3).reduce((e,t)=>!e||yc(t.subAction)>=yc(e.subAction)?t:e,void 0);!t||Wc(t)===Wc(S.current.playhead)||Wc(t)===C.current||(C.current=Wc(t),(S.current.onPlayheadObserved??S.current.onPlayheadChange)({testIndex:t.testIndex,stepIndex:t.stepIndex,subActionIndex:t.subActionIndex}))},u=()=>{n=void 0,!(e.paused||t.signal.aborted)&&(l(),n=requestAnimationFrame(u))},d={loadedmetadata:a,resize:a,loadeddata:s,timeupdate:l,seeked:c,ended:()=>{r(),e.pause(),j(!1),N(e.currentTime),S.current.onRecordingEnded?.()},error:()=>{e.pause(),v.onAvailability?.(!1),Bc(z,t.signal).then(e=>{t.signal.aborted||(I(Rc(`video`,e)),k(!1))})},play:()=>{j(!0),r(),n=requestAnimationFrame(u)},pause:()=>{j(!1),r()}};for(let[t,n]of Object.entries(d))e.addEventListener(t,n);return e.paused||e.pause(),!i&&b.current&&b.current.readyState>=1&&a(),()=>{t.abort(),r();for(let[t,n]of Object.entries(d))e.removeEventListener(t,n);e.paused||e.pause(),x.current=null}},[i,z,L]),(0,Z.useEffect)(()=>{if(!(!O||!w.current||e.axis!==`time`||re===void 0||!x.current)){if(C.current===ie){C.current=``;return}ue(x.current,re/1e3)}},[O,e.axis,ie,re]),(0,Z.useEffect)(()=>{if(a===void 0||!Number.isFinite(a)){T.current=null;return}!O||!w.current||e.axis!==`time`||n.durationMs===void 0||!x.current||T.current?.fraction===a&&T.current.revision===o||(C.current=``,ue(x.current,Math.max(0,Math.min(1,a))*n.durationMs/1e3),T.current={fraction:a,revision:o})},[O,e.axis,a,o,n.durationMs,i,z,L]);function le(e){return(E.current||e.readyState>=Uc)&&!e.seeking}function ue(e,t){if(!le(e)){D.current=t;return}D.current=void 0,e.currentTime=t,N(e.currentTime)}(0,Z.useEffect)(()=>{x.current&&(x.current.playbackRate=f)},[f,L]),(0,Z.useEffect)(()=>{O&&d&&x.current?.play().catch(()=>{I(Rc(`video`,{})),k(!1),v.onAvailability?.(!1)})},[O,d]);function de(){let e=x.current;if(!O||!e)return!1;e.paused?e.play().catch(()=>{I(Rc(`video`,{})),k(!1),v.onAvailability?.(!1)}):e.pause()}return Xt({" ":e=>!m||m(e)?!1:de()}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{"data-player-preview":!0,className:`relative px-3 pt-3`,"data-artifact-state":F?`unavailable`:`available`,children:[F?(0,Q.jsx)(te,{...F,kind:`video`,onAction:()=>{I(void 0),k(!1),j(!1),C.current=``,R(e=>e+1)}}):(0,Q.jsx)(dc,{...ee,magnifier:v.magnifier,fullscreen:v.fullscreen,mediaKey:`${z}:${L}`,annotation:ae?.annotation,annotationLabel:ae?.recent?`Last recorded action`:void 0,children:(0,Q.jsx)(`video`,{ref:b,src:z,preload:`metadata`,muted:!0,playsInline:!0,className:`h-full w-full object-contain`},L)}),_]}),h&&(0,lc.createPortal)((0,Q.jsx)(Kc,{elapsedMs:y?y.offsetMs===void 0?void 0:y.offsetMs+M*1e3:M*1e3,totalMs:y?y.totalMs:n.durationMs}),h),g&&(0,lc.createPortal)((0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(X,{size:`icon-sm`,variant:`ghost`,"aria-label":A?Mc.pause:Mc.play,disabled:!O,onClick:de,children:A?(0,Q.jsx)(Sr,{className:`h-4 w-4`}):(0,Q.jsx)(Xe,{className:`h-4 w-4`})}),(0,Q.jsxs)(ce,{value:String(f),onValueChange:e=>{let t=Number(e);Pc.some(e=>e===t)&&(p(t),x.current&&(x.current.playbackRate=t))},children:[(0,Q.jsx)(V,{"aria-label":Mc.speed,size:`sm`,className:`w-[60px] shrink-0 gap-0.5 px-1.5 [&>svg]:size-3`,children:(0,Q.jsx)(B,{})}),(0,Q.jsx)(oe,{children:Pc.map(e=>(0,Q.jsxs)(se,{value:String(e),children:[e,`×`]},e))})]})]}),g)]})}function Kc({elapsedMs:e,totalMs:t}){return(0,Q.jsxs)(`span`,{"data-player-time":!0,"data-player-elapsed-ms":e,"data-player-total-ms":t,title:t===void 0?`Full playback time is unavailable because a recording duration is missing or still loading.`:void 0,className:`mt-2.5 min-w-0 font-mono text-xs leading-4 tabular-nums`,children:[(0,Q.jsx)(`span`,{"data-player-timestamp":!0,className:`inline-block max-w-full [overflow-wrap:anywhere]`,children:jc(e)??`—`}),` / `,(0,Q.jsx)(`span`,{"data-player-timestamp":!0,className:`inline-block max-w-full [overflow-wrap:anywhere]`,children:jc(t)??`—`})]})}function qc(e){let[t,n]=(0,Z.useState)(1),[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(!0),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(null),h=(0,Z.useRef)(null),g=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!s)return;let e=document.body.style.overflow;document.body.style.overflow=`hidden`,g.current?.focus();let t=e=>{if(e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),c(!1)),e.key===`Tab`){let t=[...h.current.querySelectorAll(`button:not(:disabled), [tabindex="0"]`)],n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}};return window.addEventListener(`keydown`,t,!0),()=>{document.body.style.overflow=e,window.removeEventListener(`keydown`,t,!0),g.current?.focus()}},[s]);let{model:_,playhead:v,source:y,recording:b,frame:x,runId:S,onSourceChange:C}=e,w=_.markers.find(e=>e.testIndex===v?.testIndex&&e.stepIndex===v.stepIndex&&e.subActionIndex===v.subActionIndex),E=x?.ref??w?.ref;(0,Z.useEffect)(()=>{u(!1)},[S,_.testIndex,y,y===`frames`?E?.sha:void 0,b?.state===`present`?b.ref.sha:void 0]);let D=x?_.markers.find(e=>e.testIndex===v?.testIndex&&e.stepIndex===v.stepIndex&&e.subActionIndex===x.index&&e.ref?.sha===x.ref.sha):w,O=w?zc(w,x):void 0,k=T({kind:`video`,selection:`sub-action`,entry:b,read:`idle`}),A=k.kind===`state`,j=A?`${Mc.video} — ${k.title}`:Mc.video,M=l&&(y===`frames`?xc(E):!A),N=y===`frames`?!!_c(D?.subAction):_.markers.some(e=>e.subAction.result.annotation&&mt(e.subAction.result.annotation)),ee=y===`video`&&!N?`This recording has no saved timing to place action highlights on the video. Open Frames to see any saved action highlights.`:a?`Hide annotations`:`Show annotations`,P=(0,Q.jsxs)(hc,{type:`single`,value:y,"aria-label":Mc.source,onValueChange:e=>{(e===`frames`||e===`video`)&&(Lc(e),C(e))},children:[(0,Q.jsx)(gc,{value:`frames`,title:Mc.framesTooltip,className:`text-xs`,children:Mc.frames}),(0,Q.jsx)(gc,{value:`video`,"aria-label":j,title:j,className:`text-xs${A?` opacity-60`:``}`,children:Mc.video})]}),F=(0,Q.jsxs)(`div`,{"data-player-preview-toolbar":!0,className:`absolute bottom-2 right-5 z-20 flex flex-col rounded-md border bg-background/90 p-0.5 text-muted-foreground shadow-sm`,children:[(0,Q.jsx)(X,{size:`icon-sm`,variant:`ghost`,className:`h-7 w-7${r?` bg-primary/15 text-primary ring-1 ring-inset ring-primary/40`:``}`,"aria-label":r?`Disable magnifier`:`Enable magnifier`,"aria-pressed":r,disabled:!M,onClick:()=>i(e=>!e),children:(0,Q.jsx)(G,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{title:ee,tabIndex:N?void 0:0,"aria-label":N?void 0:ee,children:(0,Q.jsx)(X,{size:`icon-sm`,variant:`ghost`,className:`h-7 w-7`,"aria-label":a?`Hide annotations`:`Show annotations`,"aria-pressed":a,disabled:!M||!N,onClick:()=>o(e=>!e),children:(0,Q.jsx)(ur,{className:`h-3.5 w-3.5`})})}),(0,Q.jsx)(X,{ref:g,size:`icon-sm`,variant:`ghost`,className:`h-7 w-7`,"aria-label":s?`Exit fullscreen`:`Enter fullscreen`,disabled:!M&&!s,onClick:()=>c(e=>!e),children:s?(0,Q.jsx)(br,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(_r,{className:`h-3.5 w-3.5`})})]}),I={magnifier:r,annotationsVisible:a,fullscreen:s,onAvailability:u},L=w&&O&&(0,Q.jsxs)(`div`,{"data-player-caption":!0,"data-frame-source-sub-action":O.frameSourceSubAction,className:`min-w-0 flex-1 basis-40 text-sm font-medium [overflow-wrap:anywhere] [&_[data-action-family]]:text-sm [&_[data-action-family]]:font-medium`,children:[(0,Q.jsx)(Ys,{sub:w.subAction,wrap:`free`}),O.substitution&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:O.substitution})]});return(0,Q.jsxs)(`section`,{ref:h,"data-player":!0,"data-player-source":y,role:s?`dialog`:void 0,"aria-modal":s?!0:void 0,"aria-label":s?`Evidence media fullscreen`:void 0,className:s?`fixed inset-0 z-50 overflow-auto bg-background p-4`:void 0,children:[y===`video`&&b?.state===`present`&&!A?(0,Q.jsx)(Gc,{...e,speed:t,setSpeed:n,recording:b,readoutHost:d,transportHost:p,toolbar:F,view:I},`${S}:${_.testIndex}:${b.ref.sha}`):(0,Q.jsxs)(`div`,{"data-player-preview":!0,className:`relative [&>[data-artifact-state]]:pb-0`,children:[y===`frames`&&(0,Q.jsx)(Vc,{runId:S,frame:E,annotation:_c(D?.subAction),wholeStep:!w,embedded:I},`${S}:${E?.sha??`none`}:${v?.stepIndex}:${v?.subActionIndex}`),y===`video`&&k.kind===`state`&&(0,Q.jsx)(`div`,{className:`p-3`,"data-artifact-state":`unavailable`,children:(0,Q.jsx)(te,{...k,kind:`video`})}),F]}),(0,Q.jsx)(Hc,{timeline:e.timeline,caption:L,note:y===`video`&&b?.state===`present`&&!A&&_.axis===`ordinal`?Fc:void 0,readout:(0,Q.jsx)(`span`,{ref:f,className:y===`video`?`flex w-[13ch] shrink-0 font-mono text-xs`:`contents`,children:y===`video`&&(b?.state!==`present`||A)&&(0,Q.jsx)(Kc,{totalMs:e.clock?.totalMs})}),controls:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{ref:m,className:`contents`}),P]})})]})}function Jc(e){return Ue(e.result)?o[`no-input`]:e.result.success?`success`:`failure`}function Yc(e){return Ue(e.result)?`text-muted-foreground`:e.result.success?`text-emerald-500`:`text-red-500`}function Xc(e){let n=[];if(n.push({key:`reasoning`,label:`Reasoning`,icon:_,content:null,duration:null,children:(0,Q.jsx)(`p`,{"data-sub-action-plan":!0,className:`m-0 whitespace-pre-wrap break-words text-sm text-muted-foreground [overflow-wrap:anywhere]`,children:e.plan})}),n.push({key:`plannedAction`,label:`Planned Action`,icon:Xe,content:null,duration:null,children:(0,Q.jsx)(`pre`,{"data-sub-action-planned-action":!0,className:`max-w-full min-w-0 text-[10px] font-mono bg-muted/30 rounded-sm p-2 overflow-x-auto whitespace-pre-wrap break-words`,children:JSON.stringify(e.plannedAction,null,2)})}),n.push({key:`result`,label:`Result`,icon:t,content:null,duration:null,outcome:(0,Q.jsx)(`span`,{className:`text-xs font-medium ${Yc(e)}`,children:Jc(e)}),children:e.result.error===void 0?null:(0,Q.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded-sm p-2 text-xs break-words [overflow-wrap:anywhere]`,children:e.result.error})}),e.grounding!==void 0){let{role:t,name:r}=e.grounding.descriptor,i=[t,r===void 0?void 0:d(r)].filter(e=>e!==void 0&&e!==``).join(` `);i!==``&&n.push({key:`grounding`,label:`Grounding`,icon:Tr,content:null,duration:null,children:(0,Q.jsx)(`p`,{"data-grounding-descriptor":!0,className:`m-0 text-sm text-muted-foreground break-words`,children:i})})}return n}function Zc({step:e,subAction:t,runId:n,model:r,playhead:i=null,recording:a,frame:o,playerSource:s=`frames`,onPlayerSourceChange:c=()=>{},onPlayheadChange:l=()=>{},seekFraction:u,isTimelineKeyIgnored:d,pipelineRef:f,timeline:p,clock:m,seekRevision:h,onProgress:g,onPlayheadObserved:_,onRecordingEnded:v,autoPlay:y}){return(0,Q.jsxs)(`div`,{"data-overview":!0,children:[r&&n&&(0,Q.jsx)(qc,{timeline:p,model:r,playhead:i,recording:a,frame:o,source:s,runId:n,onSourceChange:c,onPlayheadChange:l,seekFraction:u,seekRevision:h,clock:m,onProgress:g,onPlayheadObserved:_,onRecordingEnded:v,autoPlay:y,isTimelineKeyIgnored:d}),(0,Q.jsx)(`div`,{className:`border-t`,children:(0,Q.jsxs)(`div`,{className:`p-3 space-y-3 min-w-0`,children:[t===null?null:(0,Q.jsx)(S,{ref:f,mode:`static`,sections:Xc(t)}),e?.error?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Error`}),(0,Q.jsx)(`div`,{"data-step-error":!0,className:`bg-destructive/10 text-destructive rounded-sm p-2 text-sm break-words [overflow-wrap:anywhere]`,children:e.error})]}):null]})})]})}function Qc({step:e,subAction:t,runId:n,selection:r=t?`sub-action`:e?`step`:`none`}){let i=t?.ariaEvidence,{read:a,retry:o}=k(t?{runId:n??``,testIndex:t.testIndex,stepIndex:t.stepIndex,subActionIndex:t.subActionIndex,kind:`aria`}:null,r===`sub-action`&&i?.state===`present`&&!i.ref.evidenceIncomplete),s=T({kind:`aria`,selection:t?r:`none`,entry:i,read:a});return s.kind===`loading`?(0,Q.jsx)(P,{kind:`aria`}):s.kind===`state`?(0,Q.jsx)(te,{...s,kind:`aria`,actionLabel:s.action?.label,onAction:s.action?.type===`retry`?o:void 0}):s.document.kind===`aria`?(0,Q.jsx)(Wt,{className:`h-full min-h-0 w-full`,children:(0,Q.jsx)(`pre`,{className:`p-3 font-mono text-xs whitespace-pre-wrap break-words`,children:s.document.tree})}):null}function $c(e){switch(e){case`critical`:return`bg-red-500/15 text-red-500 border-red-500/20`;case`serious`:return`bg-orange-500/15 text-orange-500 border-orange-500/20`;case`moderate`:return`bg-amber-500/15 text-amber-500 border-amber-500/20`;case`minor`:return`bg-blue-500/15 text-blue-500 border-blue-500/20`;default:return`bg-muted text-muted-foreground`}}function el({records:e}){return(0,Q.jsx)(`div`,{className:`p-3`,children:[`critical`,`serious`,`moderate`,`minor`].map(t=>{let n=e.filter(e=>e.impact===t);return n.length===0?null:(0,Q.jsxs)(`section`,{"data-a11y-impact":t,className:`space-y-3 [&+section]:pt-6`,children:[(0,Q.jsxs)(`h3`,{className:`text-[10px] font-medium uppercase tracking-wider`,children:[t,` · `,n.length]}),n.map((e,t)=>(0,Q.jsxs)(`div`,{className:`border border-border/50 rounded-sm p-3 space-y-1.5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Ut,{className:U(`text-[10px] px-1.5 py-0`,$c(e.impact)),children:e.impact}),(0,Q.jsx)(`span`,{className:`text-sm font-medium`,children:e.help})]}),(0,Q.jsx)(`div`,{className:`text-[10px] font-mono text-muted-foreground`,children:e.ruleId}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}),e.nodes.length>0&&(0,Q.jsx)(`div`,{className:`space-y-1 mt-1`,children:e.nodes.map((e,t)=>(0,Q.jsx)(`pre`,{className:`text-[10px] font-mono bg-muted/30 rounded p-1.5 overflow-x-auto whitespace-pre-wrap break-words`,children:e.html},t))}),(0,Q.jsx)(`a`,{href:e.helpUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-[10px] text-blue-500 hover:underline`,children:`Learn more`})]},t))]},t)})})}function tl({step:e,runId:t,selection:n=e?`step`:`none`,allSteps:r=[],onSelectStep:i}){let a=e?.evidence?.a11y,o=e?.testIndex,s=e?.stepIndex,c=a?.state===`present`&&!a.ref.evidenceIncomplete&&(n===`step`||n===`sub-action`),{read:l,retry:u}=k(o!==void 0&&s!==void 0?{runId:t??``,testIndex:o,stepIndex:s,kind:`a11y`}:null,c),d=r.filter(e=>e.testIndex===o&&e.stepIndex!==void 0).map(e=>({...e,stepIndex:e.stepIndex})),f=T({kind:`a11y`,selection:n,entry:a,read:l,elsewhere:s===void 0?void 0:{steps:d,currentStepIndex:s}});if(f.kind===`loading`)return(0,Q.jsx)(P,{kind:`a11y`});if(f.kind===`state`){let e=f.action;return(0,Q.jsx)(te,{...f,kind:`a11y`,explanation:e?.type===`step`?`${f.explanation} ${e.description}`:f.explanation,actionLabel:e?.label,onAction:e?.type===`retry`?u:e?.type===`step`&&i?()=>{let t=d.find(t=>t.stepIndex===e.stepIndex);t&&i(t.id)}:void 0})}return f.document.kind===`a11y`?(0,Q.jsx)(el,{records:f.document.records}):null}var nl=`inline rounded-sm text-primary tabular-nums underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`;function rl({address:e,stepRefs:t,testName:n,children:r}){return t===void 0||!t.resolvable(e)?(0,Q.jsx)(`span`,{className:`tabular-nums`,children:r}):(0,Q.jsx)(`button`,{type:`button`,"data-step-ref":!0,"data-step-ref-test":String(e.testIndex),"data-step-ref-step":String(e.stepIndex),"aria-label":an(e,n),className:nl,onClick:()=>{t.onSelect(e)},children:r})}function il({segments:e,stepRefs:t,testNames:n=t?.testNames}){return(0,Q.jsx)(Q.Fragment,{children:e.map((e,r)=>(0,Q.jsx)(Z.Fragment,{children:e.kind===`text`?e.text:(0,Q.jsx)(rl,{address:e.address,stepRefs:t,testName:n?.get(e.address.testIndex),children:e.label})},r))})}var al=`text-base font-medium leading-snug`,ol=`focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,sl={contradicted:H,harmful:Er,"replay-stopped":gr,confirmed:We,helpful:Dr,"replay-complete":hr,pending:s,unknown:pe},cl={problem:{glyph:`text-destructive`,sentence:`text-destructive font-medium`},positive:{glyph:`text-emerald-500`,sentence:`text-foreground`},pending:{glyph:`text-amber-500`,sentence:`text-foreground`},unknown:{glyph:`text-muted-foreground`,sentence:`text-muted-foreground`}};function ll({view:e,stepRefs:t,testNames:n=t?.testNames}){let r=(0,Z.useId)(),i=(0,Z.useId)();return(0,Q.jsxs)(`section`,{"data-knowledge-section":`effect`,"aria-labelledby":r,className:`space-y-2`,children:[(0,Q.jsx)(`h4`,{id:r,className:al,children:En}),e.entries.length===0?(0,Q.jsx)(`p`,{"data-section-absence":!0,className:`text-sm text-muted-foreground`,children:e.absence}):(0,Q.jsx)(`ul`,{"data-effect-list":!0,className:`space-y-2`,children:e.entries.map(e=>(0,Q.jsx)(ul,{entry:e,stepRefs:t,testNames:n},e.key))}),e.uncounted===void 0?null:(0,Q.jsx)(`p`,{"data-effect-uncounted":String(e.uncounted.count),className:`text-xs text-muted-foreground`,children:(0,Q.jsxs)(Be,{children:[(0,Q.jsx)(Le,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-describedby":i,className:`cursor-help rounded-sm text-left underline decoration-dotted underline-offset-4 ${ol}`,children:e.uncounted.line})}),(0,Q.jsx)(`span`,{id:i,hidden:!0,children:_n}),(0,Q.jsx)(nt,{side:`bottom`,align:`start`,sideOffset:4,className:`max-w-[320px] text-left`,children:_n})]})}),e.unmeasured===void 0?null:(0,Q.jsx)(`p`,{"data-effect-unmeasured":String(e.unmeasured.count),className:`text-xs text-muted-foreground tabular-nums`,children:e.unmeasured.line})]})}function ul({entry:e,stepRefs:t,testNames:n}){let r=sl[e.outcome],i=cl[e.tone];return(0,Q.jsxs)(`li`,{"data-effect-entry":!0,"data-effect-outcome":e.outcome,"data-effect-tone":e.tone,className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1`,children:[(0,Q.jsx)(r,{className:`mt-0.5 size-3.5 ${i.glyph}`,"aria-hidden":!0}),(0,Q.jsxs)(`p`,{"data-effect-sentence":!0,className:`text-sm ${i.sentence}`,children:[e.parts.lead,` `,(0,Q.jsx)(il,{segments:pn(e.addresses,n),stepRefs:t,testNames:n}),e.parts.tail]}),(0,Q.jsx)(`p`,{"data-effect-record":!0,className:`col-start-2 text-xs text-muted-foreground wrap-anywhere`,children:e.record})]})}function dl({id:e,className:t}){let{status:n,copy:r}=u();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"data-record-id-copy":!0,"data-copy-status":n,"aria-label":un(e),onClick:()=>r(e),className:`shrink-0 align-middle ${t??``}`,children:n===`copied`?(0,Q.jsx)(ae,{className:`size-3.5 text-success`,"aria-hidden":`true`}):(0,Q.jsx)(le,{className:`size-3.5`,"aria-hidden":`true`})}),(0,Q.jsx)(`span`,{"data-record-id-copy-status":!0,role:`status`,"aria-live":`polite`,className:`sr-only`,children:n===`copied`?Gn:n===`failed`?$t(e):``})]})}var fl=`group flex items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,pl=`font-mono text-xs text-muted-foreground tabular-nums`,ml=`text-xs text-muted-foreground`;function hl(e){switch(e){case`confirmed`:case`helpful`:case`contradicted`:case`harmful`:return Pn(e);case`pending`:return Un;case`not-attributed`:return In;case`unknown`:return Vn;case`skipped`:return Ln}}function gl({line:e}){return(0,Q.jsxs)(`li`,{"data-served-channel":`1`,"data-served-as-canary":e.servedAsCanary?`true`:`false`,...e.canaryOutcome===void 0?{}:{"data-canary-outcome":e.canaryOutcome},"data-trace-state":e.why.kind===`answered`?`answered`:e.why.reason,className:`space-y-1`,children:[(0,Q.jsx)(`span`,{className:`block text-xs wrap-anywhere`,children:e.summary}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(`p`,{className:`${pl} min-w-0 wrap-anywhere`,children:e.id}),(0,Q.jsx)(dl,{id:e.id})]}),e.servedAsCanary?(0,Q.jsx)(`span`,{className:ml,children:Dn}):null]}),(0,Q.jsx)(`p`,{className:pl,children:sn(e.trust,e.tier,e.status)}),(0,Q.jsx)(_l,{line:e}),e.canaryOutcome===void 0?null:(0,Q.jsx)(`p`,{className:ml,children:hl(e.canaryOutcome)})]})}function _l({line:e}){return e.why.kind===`answered`?(0,Q.jsx)(`p`,{className:pl,children:cn(e.why.leg,e.why.rank,e.why.score)}):e.why.reason===`artifact-missing`?(0,Q.jsx)(fs,{variant:`inline`}):(0,Q.jsx)(`p`,{className:ml,children:e.why.reason===`pre-trace-run`?Cn:en})}function vl({view:e}){return(0,Q.jsxs)(`p`,{"data-row-applicability":!0,className:`text-xs text-muted-foreground wrap-anywhere`,children:[e.lead,e.phrases.map((e,t)=>(0,Q.jsxs)(Z.Fragment,{children:[` · `,(0,Q.jsx)(yl,{phrase:e})]},t))]})}function yl({phrase:e}){return e.literal===void 0?(0,Q.jsx)(`span`,{"data-anchor-type":e.type,className:e.type===`unparsed`?`font-mono wrap-anywhere`:void 0,children:e.text}):(0,Q.jsxs)(`span`,{"data-anchor-type":e.type,children:[e.text,` `,(0,Q.jsx)(`code`,{className:`font-mono wrap-anywhere`,children:e.literal})]})}function bl({content:e}){let{confirmations:t,contradictions:n,trustNarrative:r}=e.currentTrust;return(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:fl,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),qn]}),(0,Q.jsxs)(f,{"data-full-record":!0,className:`mt-1 rounded-md bg-muted/40 px-3 py-2 space-y-2`,children:[(0,Q.jsx)(`p`,{"data-record-current-status":!0,className:`text-xs text-muted-foreground`,children:dn(e.currentStatus)}),(0,Q.jsx)(`p`,{"data-record-content":!0,className:`text-sm whitespace-pre-wrap wrap-anywhere`,children:e.content}),(0,Q.jsx)(`p`,{"data-trust-counts":!0,className:`text-xs text-muted-foreground tabular-nums`,children:Bn(t,n)}),r===void 0?null:(0,Q.jsxs)(`div`,{"data-evidence-note":!0,className:`border-l-2 border-border pl-2 space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:Fn}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground whitespace-pre-wrap wrap-anywhere`,children:r})]})]})]})}var xl=`text-base font-medium leading-snug`,Sl=`focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,Cl={added:Ee,confirmed:ae,superseded:Cr,deprecated:nr,proposed:pr};function wl({view:e}){let t=(0,Z.useId)(),n=e.rows.filter(e=>e.section!==`since-then`),r=e.rows.filter(e=>e.section===`since-then`);return(0,Q.jsxs)(`section`,{"data-knowledge-section":`changes`,"aria-labelledby":t,"data-learned-state":e.state,...e.scanIncomplete===!0?{"data-learned-read":`incomplete`}:{},"data-learned-snapshot":e.curationSnapshot===void 0?`absent`:`recorded`,...e.curationSnapshot?.sinceThenCount===void 0?{}:{"data-learned-since-then":String(e.curationSnapshot.sinceThenCount)},className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Q.jsx)(`h4`,{id:t,className:xl,children:zn}),e.countLine===void 0?null:(0,Q.jsx)(`span`,{"data-learned-count-line":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.countLine})]}),e.countNote===void 0?null:(0,Q.jsx)(`p`,{"data-learned-count-note":!0,className:`text-xs text-muted-foreground`,children:e.countNote}),e.curationSnapshot?.reconciliation===void 0?null:(0,Q.jsxs)(`div`,{"data-learned-reconciliation":!0,className:`space-y-1`,children:[(0,Q.jsx)(`p`,{"data-learned-reconciliation-count":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.curationSnapshot.reconciliation.count}),(0,Q.jsx)(`p`,{"data-learned-reconciliation-cause":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.curationSnapshot.reconciliation.cause})]}),e.sentence===void 0?null:(0,Q.jsx)(`p`,{"data-learned-sentence":!0,"data-section-absence":!0,className:`text-sm text-muted-foreground`,children:e.sentence}),n.length===0?null:(0,Q.jsx)(`ul`,{className:`divide-y divide-border`,children:n.map(e=>(0,Q.jsx)(Tl,{row:e},e.key))}),r.length===0?null:(0,Q.jsxs)(`div`,{"data-since-this-run":String(r.length),className:`space-y-1 pt-2`,children:[(0,Q.jsx)(`h5`,{className:`text-xs font-medium text-muted-foreground tabular-nums`,children:yn(r.length)}),(0,Q.jsx)(`ul`,{className:`divide-y divide-border`,children:r.map(e=>(0,Q.jsx)(Tl,{row:e},e.key))})]}),e.chainNote===void 0?null:(0,Q.jsx)(`p`,{"data-learned-chain-note":!0,className:`text-xs text-muted-foreground`,children:e.chainNote}),e.readNote===void 0?null:(0,Q.jsx)(`p`,{"data-learned-read-note":!0,className:`text-xs text-muted-foreground`,children:e.readNote})]})}function Tl({row:e}){return(0,Q.jsxs)(`li`,{"data-record-change":e.bucket,...e.section===void 0?{}:{"data-learned-section":e.section},className:`py-2 space-y-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1`,children:[(0,Q.jsx)(El,{bucket:e.bucket}),(0,Q.jsx)(`span`,{"data-row-primary":!0,className:`text-sm wrap-anywhere`,children:e.primary}),e.note===void 0?null:(0,Q.jsxs)(`span`,{"data-proposed-note":!0,className:`text-xs text-muted-foreground`,children:[`· `,e.note]})]}),e.was===void 0?null:(0,Q.jsxs)(`p`,{"data-superseded-was":!0,className:`flex items-baseline gap-1 text-xs text-muted-foreground wrap-anywhere`,children:[(0,Q.jsx)(cr,{className:`size-3 shrink-0`,"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[fn,` `,e.was.primary]})]}),e.applicability===void 0?null:(0,Q.jsx)(vl,{view:e.applicability}),e.sinceDetail===void 0?null:(0,Q.jsx)(`p`,{"data-since-detail":!0,className:`text-xs text-muted-foreground`,children:e.sinceDetail}),e.content===void 0?null:(0,Q.jsx)(bl,{content:e.content})]})}function El({bucket:e}){let t=Cl[e],n=(0,Z.useId)();return(0,Q.jsxs)(Be,{children:[(0,Q.jsx)(Le,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"data-bucket-label":e,"aria-describedby":n,className:`inline-flex items-center gap-1 cursor-help rounded-sm text-xs font-medium uppercase tracking-wider text-muted-foreground underline decoration-dotted underline-offset-4 ${Sl}`,children:[(0,Q.jsx)(t,{className:`size-3`,"aria-hidden":!0}),Mn[e]]})}),(0,Q.jsx)(`span`,{id:n,hidden:!0,children:wn[e]}),(0,Q.jsx)(nt,{side:`bottom`,align:`start`,sideOffset:4,className:`max-w-[320px] text-left`,children:wn[e]})]})}var Dl=`text-base font-medium leading-snug`,Ol=`focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`;function kl({view:e,stepRefs:t}){let n=(0,Z.useId)();return(0,Q.jsxs)(`section`,{"data-knowledge-section":`used`,"aria-labelledby":n,className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Q.jsx)(`h4`,{id:n,className:Dl,children:nn}),e.countLine===void 0?null:(0,Q.jsx)(`span`,{"data-used-count-line":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.countLine})]}),e.retrieval===void 0?null:(0,Q.jsx)(me,{view:e.retrieval}),e.records.length===0?(0,Q.jsx)(`p`,{"data-section-absence":!0,className:`text-sm text-muted-foreground`,children:e.absence}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`ul`,{className:`divide-y divide-border`,children:e.records.slice(0,50).map(e=>(0,Q.jsx)(Al,{record:e,stepRefs:t},e.key))}),e.records.length<=50?null:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{"data-used-show-all":String(e.records.length),className:fl,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),vn(e.records.length)]}),(0,Q.jsx)(f,{className:`mt-2`,children:(0,Q.jsx)(`ul`,{className:`divide-y divide-border`,children:e.records.slice(50).map(e=>(0,Q.jsx)(Al,{record:e,stepRefs:t},e.key))})})]})]})]})}function Al({record:e,stepRefs:t}){return(0,Q.jsxs)(`li`,{"data-used-record":!0,"data-use-verbs":e.uses.map(e=>e.verb).join(` `),...e.kind===void 0?{}:{"data-record-kind":e.kind},...e.onTrial===void 0?{}:{"data-on-trial":`true`},...e.sinceStatus===void 0?{}:{"data-since-status":e.sinceStatus},...e.contentAbsence===void 0?{}:{"data-content-absence":e.contentAbsence.reason},className:`py-2 space-y-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1`,children:[e.kind===void 0?null:(0,Q.jsx)(Ut,{variant:`outline`,className:`text-muted-foreground`,children:Jn[e.kind]}),(0,Q.jsx)(`span`,{"data-row-primary":!0,className:`text-sm wrap-anywhere`,children:e.primary}),e.onTrial===void 0?null:(0,Q.jsx)(jl,{}),e.sinceStatus===void 0?null:(0,Q.jsxs)(Ut,{variant:`outline`,className:`text-muted-foreground`,children:[(0,Q.jsx)(fr,{className:`size-3`,"aria-hidden":!0}),gn[e.sinceStatus]]})]}),e.applicability===void 0?null:(0,Q.jsx)(vl,{view:e.applicability}),e.contentAbsence===void 0?null:(0,Q.jsx)(`p`,{"data-row-absence-reason":!0,className:`text-xs text-muted-foreground wrap-anywhere`,children:Hn[e.contentAbsence.reason]}),(0,Q.jsx)(`p`,{"data-row-uses":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.uses.map((e,n)=>(0,Q.jsxs)(Z.Fragment,{children:[n>0?` · `:null,n===0?tn[e.verb].lead:tn[e.verb].follow,` `,(0,Q.jsx)(il,{segments:pn(e.addresses,t?.testNames),stepRefs:t})]},e.verb))}),e.content===void 0?null:(0,Q.jsx)(bl,{content:e.content})]})}function jl(){let e=(0,Z.useId)();return(0,Q.jsxs)(Be,{children:[(0,Q.jsx)(Le,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-describedby":e,className:`inline-flex rounded-md ${Ol}`,children:(0,Q.jsxs)(Ut,{variant:`outline`,className:`cursor-help text-muted-foreground`,children:[(0,Q.jsx)(dr,{className:`size-3`,"aria-hidden":!0}),jn]})})}),(0,Q.jsx)(`span`,{id:e,hidden:!0,children:An}),(0,Q.jsx)(nt,{side:`bottom`,align:`start`,sideOffset:4,className:`max-w-[320px] text-left`,children:An})]})}var Ml=`text-xs uppercase tracking-wider font-medium text-muted-foreground`,Nl=`pl-5 space-y-2`,Pl=`font-mono text-xs text-muted-foreground tabular-nums`,Fl=`CUT CANDIDATES`;function Il({detail:e}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[e.channel1.length>0?(0,Q.jsx)(Ll,{lines:e.channel1}):null,e.channel2.length>0?(0,Q.jsxs)(`section`,{"data-ledger-channel":`2`,className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:Ml,children:Rn[2]}),(0,Q.jsx)(`ul`,{className:Nl,children:e.channel2.map(e=>(0,Q.jsxs)(`li`,{"data-served-channel":`2`,className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(`span`,{className:`${Pl} wrap-anywhere`,children:e.id}),(0,Q.jsx)(dl,{id:e.id})]}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.detailLevel}),(0,Q.jsx)(`span`,{className:`${Pl} wrap-anywhere`,children:e.bodyDigest})]},e.id))})]}):null,e.channel3.length>0?(0,Q.jsxs)(`section`,{"data-ledger-channel":`3`,className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:Ml,children:Rn[3]}),(0,Q.jsx)(`ul`,{className:Nl,children:e.channel3.map(e=>(0,Q.jsxs)(`li`,{"data-served-channel":`3`,className:`space-y-1`,children:[(0,Q.jsx)(`span`,{className:`block text-xs wrap-anywhere`,children:e.summary}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(`p`,{className:`${Pl} min-w-0 wrap-anywhere`,children:e.id}),(0,Q.jsx)(dl,{id:e.id})]})]},e.id))})]}):null,e.cut===void 0?null:(0,Q.jsx)(`div`,{"data-cut-candidates":String(e.cut.lines.length),children:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:fl,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),e.cut.label]}),(0,Q.jsxs)(f,{className:`mt-2 space-y-1`,children:[(0,Q.jsx)(`p`,{className:Ml,children:Fl}),(0,Q.jsx)(`ul`,{className:Nl,children:e.cut.lines.map(e=>(0,Q.jsxs)(`li`,{className:`${Pl} wrap-anywhere`,children:[e.recordId,` · leg `,e.leg,` · rank `,String(e.rank),` · score`,` `,e.score.toFixed(3)]},e.recordId))})]})]})}),e.planSource===void 0?null:(0,Q.jsx)(Rl,{planSource:e.planSource}),e.rung===void 0?null:(0,Q.jsx)(`p`,{"data-ledger-rung":!0,className:`text-xs text-muted-foreground`,children:on(e.rung.rung,e.rung.reason)})]})}function Ll({lines:e}){let t=Nn(e);return(0,Q.jsxs)(`section`,{"data-ledger-channel":`1`,className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:Ml,children:Rn[1]}),(0,Q.jsx)(`ul`,{className:Nl,children:t.lines.map(e=>(0,Q.jsx)(gl,{line:e},e.id))}),t.showAllLabel===void 0?null:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{"data-channel-show-all":String(e.length),className:fl,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),t.showAllLabel]}),(0,Q.jsx)(f,{className:`mt-2`,children:(0,Q.jsx)(`ul`,{className:Nl,children:e.slice(50).map(e=>(0,Q.jsx)(gl,{line:e},e.id))})})]})]})}function Rl({planSource:e}){return(0,Q.jsxs)(`div`,{"data-plan-source-outcome":e.tone,className:`space-y-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(`span`,{className:`${Pl} wrap-anywhere`,children:e.procedureId}),(0,Q.jsx)(dl,{id:e.procedureId})]}),(0,Q.jsx)(`p`,{className:`text-xs`,children:e.sentence}),e.missReason===void 0?null:(0,Q.jsx)(`p`,{className:Pl,children:e.missReason})]})}function zl({ledger:e}){let t=(0,Z.useId)();return(0,Q.jsx)(`section`,{"data-knowledge-section":`retrieval-details`,"aria-labelledby":t,className:`border-t pt-4`,children:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{id:t,className:fl,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),Tn]}),(0,Q.jsxs)(f,{className:`mt-4 space-y-4`,children:[(0,Q.jsx)(`p`,{"data-used-summary":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.summary}),e.steps.length>0?(0,Q.jsx)(`ul`,{className:`space-y-1`,children:e.steps.map(e=>(0,Q.jsx)(Bl,{row:e},`${String(e.testIndex)}:${String(e.stepIndex)}`))}):null,e.changes.length===0?null:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:zn}),e.changes.map(e=>(0,Q.jsx)(Ul,{entry:e},e.key))]})]})]})})}function Bl({row:e}){return(0,Q.jsx)(j,{asChild:!0,children:(0,Q.jsxs)(`li`,{"data-step-index":String(e.stepIndex),"data-test-index":String(e.testIndex),"data-plan-source":e.planSource,"data-brief-lines":String(e.briefLines),"data-canary-lines":String(e.canaryLines),children:[(0,Q.jsxs)(A,{className:`group flex w-full items-center gap-2 py-1 text-left text-xs font-medium hover:text-foreground`,children:[(0,Q.jsx)(Y,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,Q.jsx)(`span`,{className:`truncate`,children:e.title}),e.noBrief===!0?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Kn}):(0,Q.jsx)(`span`,{className:`flex flex-wrap items-center gap-1`,children:e.facts.map(e=>(0,Q.jsx)(Ut,{variant:`outline`,className:`text-xs font-medium`,children:e},e))})]}),(0,Q.jsx)(f,{className:`bg-muted/40 rounded-[var(--radius)] px-3 py-2 space-y-2`,children:(0,Q.jsx)(`div`,{"data-step-detail":!0,children:(0,Q.jsx)(Il,{detail:e.detail})})})]})})}function Vl(e){return e.map((e,t)=>(0,Q.jsx)(`span`,{className:`block`,children:e},t))}function Hl(e){return e.map((e,t)=>(0,Q.jsxs)(`span`,{className:`block`,children:[e,(0,Q.jsx)(dl,{id:e,className:`ml-1`})]},t))}function Ul({entry:e}){let t=[[`bucket`,e.bucket],[`record`,Hl(e.recordIds)]];return e.events.length>0&&t.push([`events`,Vl(e.events.map(rn))]),e.promotionPath!==void 0&&t.push([`promotion`,Yn(e.promotionPath)]),e.promotionReceiptDigest!==void 0&&t.push([`receipt`,e.promotionReceiptDigest]),e.evidenceTokens.length>0&&t.push([`evidence`,Vl(e.evidenceTokens)]),e.observationIds.length>0&&t.push([`observation`,Vl(e.observationIds)]),e.sourceRunIds.length>0&&t.push([`sourceRun`,Vl(e.sourceRunIds)]),e.validity!==void 0&&t.push([`validity`,ln(e.validity)]),e.ref!==void 0&&t.push([`link`,e.href===void 0?e.ref:(0,Q.jsx)(`a`,{href:e.href,className:`text-primary underline-offset-4 hover:underline`,children:e.ref})]),(0,Q.jsx)(`dl`,{"data-ledger-changes":!0,className:`grid grid-cols-[auto_minmax(0,1fr)] items-start gap-x-4 gap-y-2 text-xs`,children:t.map(([e,t])=>(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:kn[e]}),(0,Q.jsx)(`dd`,{"data-ledger-row":e,className:`font-mono break-all select-text`,children:t})]},e))})}var Wl=`px-3 py-4 space-y-4`,Gl=`text-base font-medium leading-snug`,Kl=`text-sm text-muted-foreground break-words`;function ql({view:e,stepRefs:t}){return e===void 0?(0,Q.jsx)(`div`,{"data-knowledge-state":`loading`,className:Wl,children:(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(St,{className:`h-4`}),(0,Q.jsx)(St,{className:`h-4`}),(0,Q.jsx)(St,{className:`h-4`})]})}):e.state===`error`?(0,Q.jsxs)(`div`,{"data-knowledge-state":`error`,className:Wl,children:[(0,Q.jsx)(`h4`,{className:Gl,children:e.heading}),(0,Q.jsx)(`p`,{className:Kl,children:e.body})]}):e.state===`evidence-incomplete`?(0,Q.jsx)(`div`,{"data-knowledge-state":`evidence-incomplete`,className:`px-3`,children:(0,Q.jsx)(fs,{variant:`pane`})}):e.state===`empty-no-store`?(0,Q.jsxs)(`div`,{"data-knowledge-state":`empty-no-store`,className:Wl,children:[(0,Q.jsx)(`h4`,{className:Gl,children:e.heading}),(0,Q.jsx)(`p`,{className:Kl,children:e.body})]}):(0,Q.jsxs)(`div`,{"data-knowledge-state":`ready`,className:`px-3 py-4 space-y-6`,children:[(0,Q.jsx)(kl,{view:e.used,stepRefs:t}),(0,Q.jsx)(ll,{view:e.effect,stepRefs:t,testNames:t?.testNames}),(0,Q.jsx)(wl,{view:e.learned}),(0,Q.jsx)(zl,{ledger:e.ledger})]})}var Jl={high:`text-red-500`,moderate:`text-amber-500`},Yl={variables:`Variables`,network:`Network`,console:`Console`,aria:`ARIA Tree`,a11y:`A11y`};function Xl(e){let t=e?.console,n=e?.network,r=e?.a11y,i=e=>e>0?e:void 0;return{console:t?.state===`present`&&!t.ref.evidenceIncomplete?i(t.counts.errors):void 0,network:n?.state===`present`&&!n.ref.evidenceIncomplete?i(n.counts.failed+n.counts.errored):void 0,a11y:r?.state===`present`&&!r.ref.evidenceIncomplete?i(r.counts.minor+r.counts.moderate+r.counts.serious+r.counts.critical):void 0}}function Zl(e){let t=Xl(e),n=n=>{let r=t[n];if(r===void 0)return;let i=e?.a11y;return{kind:`problem`,count:r,severity:n===`a11y`&&i?.state===`present`&&i.counts.critical===0&&i.counts.serious===0?`moderate`:`high`}};return{console:n(`console`),network:n(`network`),a11y:n(`a11y`)}}function Ql(e,t,n=`sub-action`){let r=Zl(e),i=i=>{let a=i===`aria`?t:e?.[i],o=T({kind:i,entry:a,selection:n,read:`idle`});if(o.kind===`state`)return{kind:`absent`,title:o.title};if(!a||a.state!==`present`||a.kind===`aria`)return;if(a.kind!==`variables`){let e=r[a.kind];if(e!==void 0)return e}let s=a.kind===`variables`?a.counts.count:a.kind===`a11y`?0:a.counts.total;return s>0?{kind:`total`,count:s}:{kind:`absent`,title:w[i].empty.title}};return{variables:i(`variables`),network:i(`network`),console:i(`console`),aria:i(`aria`),a11y:i(`a11y`)}}function $l(e,t){let{count:n}=t,r=t.kind===`problem`?{console:[`error`,`errors`],network:[`failed request`,`failed requests`],a11y:[`violation`,`violations`]}:{console:[`message`,`messages`],network:[`request`,`requests`],a11y:[`violation`,`violations`]},i=e===`variables`||e===`aria`?``:` ${r[e][n===1?0:1]}`;return`${Yl[e]}, ${n}${i}`}function eu(e,t){return`${Yl[e]} — ${t}`}var tu=(e,t)=>`Step ${e} of ${t} · whole step`,nu=(e,t,n)=>`Sub-action #${e} of ${t} · step ${n}`;function ru({scope:e,step:t,total:n,subAction:r}){return e===`sub-action`&&r===void 0?null:(0,Q.jsx)(`div`,{"data-evidence-scope":e,className:`shrink-0 px-3 py-2 border-b text-xs text-muted-foreground tabular-nums`,children:e===`step`?tu(t,n):nu(r,n,t)})}function iu({activeTab:e,onTabChange:t,step:n,subAction:r,runId:i,allSteps:a,executionLogs:o=[],platform:s,model:c,playhead:l,recording:u,frame:d,playerSource:f,onPlayerSourceChange:p,onPlayheadChange:m,seekFraction:h,isTimelineKeyIgnored:g,pipelineRef:_,timeline:v,clock:y,seekRevision:b,onProgress:x,onPlayheadObserved:S,onRecordingEnded:C,autoPlay:w,knowledge:T,knowledgeStepRefs:E,onSelectStep:D}){let O=o.length>0,k=(0,Z.useRef)(null),A=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(e!==`console`&&e!==`network`)return;let t=e===`console`?k:A,n=()=>{let e=t.current?.querySelector(`[data-slot="scroll-area-viewport"]`);e&&(e.scrollTop=e.scrollHeight)},r=requestAnimationFrame(n),i=new MutationObserver(n);return t.current&&i.observe(t.current,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(r),i.disconnect()}},[e,n?.id]);let j=O?o.some(e=>e.type===`hook`)?`hook`:`execution-log`:n?r?`sub-action`:`step`:`none`,M=Ql(n?.evidence,r?.ariaEvidence,j),N=!O&&n?.testIndex!==void 0&&n.stepIndex!==void 0?n:null,P=e=>N&&(0,Q.jsx)(ru,{scope:e,step:N.displayStepOrder,total:e===`step`?N.displayStepTotal??a.length:N.subActions?.length??0,subAction:r?r.subActionIndex+1:void 0}),F=(e,t,n)=>{let r=e===`console`&&O?void 0:M[e],i=r?.kind===`absent`?eu(e,r.title):r?$l(e,r):void 0,a=e===`console`?H:e===`network`?Ce:tr,o=(0,Q.jsxs)(Ne,{value:t,"aria-label":i||void 0,className:`text-xs rounded-none flex-initial${r?.kind===`absent`?` opacity-60 data-[state=active]:opacity-100`:``}`,children:[n,r&&r.kind!==`absent`&&(0,Q.jsxs)(`span`,{"data-tab-count":r.count,"data-tab-count-kind":r.kind,"aria-hidden":`true`,className:`inline-flex items-center gap-1 tabular-nums ${r.kind===`total`?`text-muted-foreground`:Jl[r.severity]}`,children:[r.kind===`problem`&&(0,Q.jsx)(a,{className:`h-3.5 w-3.5 size-3.5`}),r.count]})]});return r?.kind===`absent`?(0,Q.jsxs)(Be,{children:[(0,Q.jsx)(Le,{asChild:!0,children:o}),(0,Q.jsx)(nt,{children:i})]}):o};return(0,Q.jsx)(wt,{children:(0,Q.jsxs)(Ie,{value:e,onValueChange:t,className:`flex h-full min-h-0 flex-col overflow-hidden gap-0`,children:[(0,Q.jsxs)(Fe,{variant:`line`,className:`w-full justify-start overflow-x-auto border-b px-3 h-9 shrink-0 rounded-none [&_[role=tab]]:shrink-0`,children:[(0,Q.jsx)(Ne,{value:`overview`,className:`text-xs rounded-none flex-initial`,children:`Overview`}),F(`variables`,`env`,`Variables`),F(`network`,`network`,`Network`),F(`console`,`console`,O?`stdout`:`Console`),F(`aria`,`aria`,`ARIA Tree`),F(`a11y`,`a11y`,`A11y`),(0,Q.jsx)(Ne,{value:`knowledge`,className:`text-xs rounded-none flex-initial`,children:`Knowledge`})]}),(0,Q.jsx)(Pe,{value:`overview`,className:`flex-1 min-h-0`,children:(0,Q.jsx)(Wt,{className:`h-full`,children:(n||c)&&(0,Q.jsx)(Zc,{timeline:v,step:n,subAction:r,runId:i,model:c,playhead:l,recording:u,frame:d,playerSource:f,onPlayerSourceChange:p,onPlayheadChange:m,seekFraction:h,seekRevision:b,clock:y,onProgress:x,onPlayheadObserved:S,onRecordingEnded:C,autoPlay:w,isTimelineKeyIgnored:g,pipelineRef:_})})}),(0,Q.jsx)(Pe,{value:`env`,className:`flex-1 min-h-0`,children:(0,Q.jsxs)(Wt,{className:`h-full`,children:[P(`step`),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(I,{step:n,executionLogs:o,runId:i,selection:j,allSteps:a,onSelectStep:D})})]})}),(0,Q.jsx)(Pe,{value:`network`,className:`flex-1 min-h-0`,children:(0,Q.jsx)(`div`,{ref:A,className:`h-full`,children:(0,Q.jsxs)(Wt,{className:`h-full`,children:[P(`step`),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(ee,{step:n,allSteps:a,platform:s,runId:i,selection:j,evidenceSteps:a,onSelectStep:D})})]})})}),(0,Q.jsx)(Pe,{value:`console`,className:`flex-1 min-h-0`,children:(0,Q.jsx)(`div`,{ref:k,className:`h-full`,children:(0,Q.jsxs)(Wt,{className:`h-full`,children:[P(`step`),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(L,{step:n,allSteps:a,executionLogs:o,isHookStep:O,runId:i,selection:j,evidenceSteps:a,onSelectStep:D})})]})})}),(0,Q.jsxs)(Pe,{value:`aria`,className:`flex flex-col flex-1 min-h-0 overflow-hidden`,children:[P(`sub-action`),(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:(0,Q.jsx)(Qc,{step:n,subAction:r,runId:i,selection:j})})]}),(0,Q.jsx)(Pe,{value:`a11y`,className:`flex-1 min-h-0`,children:(0,Q.jsxs)(Wt,{className:`h-full`,children:[P(`step`),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(tl,{step:n,runId:i,selection:j,allSteps:a,onSelectStep:D})})]})}),(0,Q.jsx)(Pe,{value:`knowledge`,className:`flex-1 min-h-0`,children:(0,Q.jsx)(Wt,{className:`h-full`,children:(0,Q.jsx)(ql,{view:T,stepRefs:E})})})]})})}function au({neutralReason:e}){return(0,Q.jsxs)(`div`,{"data-entry":`denial`,className:`flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm`,children:[(0,Q.jsx)(n,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{className:`text-foreground`,children:e})]})}function ou({parts:e}){return(0,Q.jsxs)(Q.Fragment,{children:[e.prefix,e.name,e.suffix]})}function su({scope:e,address:t,read:n,detail:r,newMarkId:i,onRetry:a}){let o=(0,Z.useId)(),s=to(n),c=n?.kind===`read`&&n.result.kind===`history`?n.result.entries:[],l=s===`history`||s===`empty`,u=[...c].reverse(),d=u.filter(e=>st(e)===t),p=s===`history`&&d.length===0?`empty`:s,m=e=>bo(c.find(t=>t.markId===e)?.markedAt),h=c.some(e=>!e.active),g=c.some(e=>e.disposition.kind===`applied`);return(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[h?(0,Q.jsx)(`p`,{"data-feedback-replaced-note":!0,className:`text-xs text-muted-foreground`,children:so}):null,g?(0,Q.jsx)(`p`,{"data-feedback-correction-note":!0,className:`text-xs text-muted-foreground`,children:mo}):null,(0,Q.jsxs)(`section`,{"data-feedback-history":`target`,"data-history-state":p,"aria-labelledby":o,className:`space-y-2`,children:[(0,Q.jsx)(`h3`,{id:o,className:`text-sm font-medium`,children:l?ro(e,d.length):no[e]}),s===`loading`?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(St,{className:`h-10 motion-reduce:animate-none`}),(0,Q.jsx)(St,{className:`h-10 motion-reduce:animate-none`})]}):l?d.length===0?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:ho[e]}):(0,Q.jsx)(`ol`,{className:`space-y-2`,children:d.map(e=>(0,Q.jsx)(lu,{entry:e,replacedAt:m(e.supersededBy),isNew:e.markId===i},e.markId))}):(0,Q.jsx)(cu,{read:n,onRetry:a})]}),l?(0,Q.jsx)(`div`,{"data-feedback-history":`run`,"data-history-state":s,children:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:`group flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),io(c.length)]}),(0,Q.jsx)(f,{children:u.length===0?(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:ho.run}):(0,Q.jsx)(`ol`,{className:`mt-2 space-y-2`,children:u.map(e=>(0,Q.jsx)(lu,{entry:e,replacedAt:m(e.supersededBy),target:xo(e,r)},e.markId))})})]})}):null]})}function cu({read:e,onRetry:t}){let n,r=!1;if(e===void 0)return null;if(e.kind===`failed`)n=_o(Ka(e.reason)),r=!0;else if(e.result.kind===`ledger-corrupt`)n=go(`ledger-corrupt`,e.result.line);else if(e.result.kind===`run-not-found`||e.result.kind===`ledger-unavailable`)n=go(e.result.kind),r=e.result.kind===`ledger-unavailable`;else return null;return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:n}),r?(0,Q.jsx)(X,{variant:`outline`,size:`sm`,"data-feedback-history-retry":!0,"aria-label":vo,onClick:()=>t?.(),children:Ya}):null]})}function lu({entry:e,replacedAt:t,target:n,isNew:r=!1}){let i=bo(e.markedAt),a=co(e.corrected),o=uo(e);return(0,Q.jsxs)(`li`,{"data-history-entry":!0,"data-mark-id":e.markId,"data-history-active":String(e.active),"data-history-new":r?`true`:void 0,className:U(`space-y-1 rounded-md border px-3 py-2 text-xs`,!e.active&&`text-muted-foreground`),children:[(0,Q.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,Q.jsxs)(`span`,{className:`min-w-0 break-words`,children:[n===void 0?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"data-history-target":!0,children:(0,Q.jsx)(ou,{parts:n})}),` · `]}),(0,Q.jsx)(`span`,{className:`font-medium`,children:yi[e.kind]})]}),i===void 0?null:(0,Q.jsx)(`time`,{dateTime:new Date(e.markedAt).toISOString(),className:`shrink-0 tabular-nums text-muted-foreground`,children:i})]}),(0,Q.jsx)(`p`,{className:e.active?`font-medium text-foreground`:void 0,children:e.active?ao:oo(t)}),e.note===void 0?null:(0,Q.jsxs)(`p`,{className:`break-words`,children:[`“`,e.note,`”`]}),a===void 0?null:(0,Q.jsx)(`p`,{children:a}),(0,Q.jsxs)(`p`,{"data-history-disposition":!0,"data-history-applied":o?.kind,className:`break-words`,children:[(0,Q.jsx)(`span`,{"data-history-disposition-lead":!0,children:ha(e.disposition)}),o===void 0?null:(0,Q.jsx)(uu,{applied:o,drafted:e.disposition.kind===`drafted`})]})]})}function uu({applied:e,drafted:t}){switch(e.kind){case`knowledge`:return(0,Q.jsxs)(Q.Fragment,{children:[`: `,e.records.map((e,t)=>(0,Q.jsxs)(`span`,{"data-history-applied-record":e.recordId,children:[t===0?null:`; `,e.content===void 0?lo(e.recordId):(0,Q.jsxs)(Q.Fragment,{children:[`“`,e.content,`”`]})]},e.recordId))]});case`test-file`:return(0,Q.jsxs)(Q.Fragment,{children:[`: `,(0,Q.jsx)(`code`,{className:`font-mono`,children:e.filePath})]});case`unavailable`:return(0,Q.jsx)(Q.Fragment,{children:`; ${t?po:fo}`});default:return e}}var du=[`w-full`,`w-5/6`,`w-2/3`,`w-3/4`];function fu({parts:e}){return(0,Q.jsxs)(Q.Fragment,{children:[e.prefix,e.name,e.suffix]})}function pu({state:e,current:t,read:n,updating:r=!1,replacesTime:i,alreadyMarkedTime:a,timeFor:o,failure:s,onRetry:c}){let l=(0,Z.useId)();return(0,Q.jsxs)(`section`,{"data-feedback-preview":!0,"data-preview-state":e,"data-preview-current":String(t),"aria-labelledby":l,"aria-busy":e===`loading`||r,className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Q.jsx)(`h3`,{id:l,className:`text-sm font-medium`,children:aa}),r?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:va}):null]}),e===`idle`?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:ya}):e===`loading`?(0,Q.jsx)(`div`,{className:`space-y-2`,children:du.map(e=>(0,Q.jsx)(St,{className:U(`h-4 motion-reduce:animate-none`,e)},e))}):(0,Q.jsx)(`div`,{className:U(r&&`opacity-60`),children:e===`consequences`&&n?.kind===`consequences`?(0,Q.jsx)(gu,{read:n,replacesTime:i??(n.latest.kind===`supersedes`?o?.(n.latest.markId):void 0)}):e===`quarantined`&&n?.kind===`quarantined`?(0,Q.jsx)(`div`,{"data-preview-line":`quarantined`,className:mu,children:Ba(n.class)}):e===`already-marked`&&n?.kind===`already-marked`?(0,Q.jsx)(`div`,{"data-preview-line":`already-marked`,className:mu,children:Va(a??o?.(n.prior.markId))}):e===`refused`&&n!==void 0&&Ua(n)?(0,Q.jsx)(`div`,{"data-preview-refusal":n.kind,children:(0,Q.jsx)(au,{neutralReason:Wa(n)})}):e===`failed`&&s!==void 0?(0,Q.jsx)(hu,{failure:s,onRetry:c}):null})]})}var mu=`rounded-md bg-muted/40 px-3 py-2 text-xs`;function hu({failure:e,onRetry:t}){return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(au,{neutralReason:qa(Ka(e))}),(0,Q.jsx)(X,{variant:`outline`,size:`sm`,"data-feedback-preview-retry":!0,"aria-label":Xa,onClick:()=>t?.(),children:Ya}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[Ja.prefix,(0,Q.jsx)(`span`,{className:`font-mono`,children:Ja.name}),Ja.suffix]})]})}function gu({read:e,replacesTime:t}){let{groundTruth:n,labels:r,knowledge:i,draft:a,latest:o}=e;return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`font-medium text-muted-foreground`,children:ba.result}),(0,Q.jsx)(`dd`,{"data-preview-line":`result`,className:`space-y-1 break-words text-foreground`,children:n.length===0?wa:n.map(e=>{let t=Ca(e);return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{children:(0,Q.jsx)(fu,{parts:Sa(e)})}),t===void 0?null:(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:t})]},`${String(e.testIndex)}:${String(e.stepIndex)}`)})}),(0,Q.jsx)(`dt`,{className:`font-medium text-muted-foreground`,children:ba.labels}),(0,Q.jsx)(`dd`,{"data-preview-line":`labels`,className:`break-words text-foreground`,children:Ta(r.length)}),(0,Q.jsx)(`dt`,{className:`font-medium text-muted-foreground`,children:ba.knowledge}),(0,Q.jsxs)(`dd`,{"data-preview-line":`knowledge`,className:`space-y-1 break-words text-foreground`,children:[(0,Q.jsx)(`p`,{children:Ea(i.evidence,i.records.length)}),i.records.length===0?null:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:`group flex items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),Da(i.records.length)]}),(0,Q.jsx)(f,{children:(0,Q.jsx)(`ul`,{className:`mt-2 space-y-2`,children:i.records.map(e=>(0,Q.jsx)(_u,{record:e},e.recordId))})})]})]}),(0,Q.jsx)(`dt`,{className:`font-medium text-muted-foreground`,children:ba.change}),(0,Q.jsxs)(`dd`,{"data-preview-line":`change`,className:`space-y-1 break-words text-foreground`,children:[(0,Q.jsx)(`p`,{children:Na(a)}),Fa(a)?(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:Pa}):null]})]}),o.kind===`supersedes`?(0,Q.jsx)(`p`,{"data-preview-line":`replaces`,className:`text-xs text-foreground`,children:Ia(o.ordinal,t)}):null]})}function _u({record:e}){return(0,Q.jsxs)(`li`,{"data-preview-record":e.evidence.kind===`unreadable`?`unreadable`:e.served?`served`:`unserved`,className:`space-y-0.5 break-words`,children:[(0,Q.jsx)(`p`,{className:`text-foreground`,children:e.recordContent===void 0?e.contentAbsence===void 0?null:ja[e.contentAbsence.reason]:e.recordContent.content}),(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:Aa(e)})]})}function vu({kind:e,address:t,testId:n,recordIds:r=[],labels:i=[],basis:a}){let o=[];return e!==void 0&&o.push([`kind`,e]),o.push([`address`,t]),n&&o.push([`testId`,n]),r.length>0&&o.push([`records`,r.join(`, `)]),i.length>0&&o.push([`labels`,i.map((e,t)=>(0,Q.jsx)(`span`,{className:`block`,children:$a(e)},t))]),a!==void 0&&o.push([`basis`,eo(a)]),(0,Q.jsxs)(j,{className:`mt-6`,children:[(0,Q.jsxs)(A,{className:`group flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),Za]}),(0,Q.jsx)(f,{children:(0,Q.jsx)(`div`,{"data-feedback-technical":!0,className:`mt-2 rounded-md bg-muted/40 px-3 py-2`,children:(0,Q.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-xs`,children:o.map(([e,t])=>(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:Qa[e]}),(0,Q.jsx)(`dd`,{"data-technical-row":e,className:`font-mono break-all select-text`,children:t})]},e))})})})]})}var yu=`Corrected expectation (optional)`,bu=`Prose is retained as evidence.`,xu=`Corrected action JSON (optional)`,Su=`{"type":"click","ref":"e1"}`,Cu=`The ref must identify the intended target in the recorded decision. Action scoring requires a valid executable correction for exactly one recorded decision.`,wu=`Corrected action JSON must be valid JSON matching an Action, including its required fields.`;function Tu(e){if(e.trim()===``)return{kind:`empty`};try{return{kind:`valid`,action:He.parse(JSON.parse(e))}}catch{return{kind:`invalid`}}}function Eu(){return(0,Q.jsxs)(Q.Fragment,{children:[`Example: `,(0,Q.jsx)(`code`,{children:Su}),`. `,Cu]})}function Du({expectation:e,actionText:t,disabled:n,actionField:r,onChange:i}){let a=(0,Z.useId)(),o=`${a}-expectation`,s=`${a}-action`,c=r.shown&&Tu(t).kind===`invalid`;return(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{"data-feedback-correction":!0,className:`group flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),mi]}),(0,Q.jsxs)(f,{className:`mt-2 space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(ke,{htmlFor:o,className:`text-xs font-medium`,children:yu}),(0,Q.jsx)(de,{id:o,"aria-describedby":`${o}-help`,maxLength:2e3,disabled:n,value:e,onChange:e=>i(e.target.value,t),className:`max-h-40 overflow-y-auto`}),(0,Q.jsx)(`p`,{id:`${o}-help`,className:`text-xs text-muted-foreground`,children:bu})]}),r.shown?(0,Q.jsxs)(`div`,{"data-feedback-action-gate":`shown`,className:`space-y-1`,children:[(0,Q.jsx)(ke,{htmlFor:s,className:`text-xs font-medium`,children:xu}),(0,Q.jsx)(de,{id:s,"aria-invalid":c,"aria-describedby":`${s}-help${c?` ${s}-error`:``}`,disabled:n,value:t,onChange:t=>i(e,t.target.value),className:`max-h-40 overflow-y-auto font-mono`}),(0,Q.jsx)(`p`,{id:`${s}-help`,className:`text-xs text-muted-foreground`,children:(0,Q.jsx)(Eu,{})}),c?(0,Q.jsx)(`p`,{id:`${s}-error`,role:`alert`,className:`text-xs text-destructive`,children:wu}):null]}):(0,Q.jsx)(`p`,{"data-feedback-action-gate":`hidden`,className:`text-xs text-muted-foreground`,children:r.reason})]})]})}function Ou({parts:e}){return(0,Q.jsxs)(Q.Fragment,{children:[e.prefix,e.name,e.suffix]})}function ku({composerId:e,headingId:t,heading:n,scopeLine:r,state:i,scope:a,target:o,outcomeClass:s,selected:c,onChoose:l,noUniqueAddress:u=!1,testSwitcher:d,pinned:f,unsentDrafts:p=[],note:m=``,onNoteChange:h,expectation:g=``,actionText:_=``,actionField:v,onCorrectionChange:y,previewState:b,previewCurrent:x,previewRead:S,previewUpdating:C=!1,previewReplacesTime:w,previewAlreadyMarkedTime:T,timeFor:E,history:D,previewFailure:O,onPreviewRetry:k,stepCount:A=0,testId:j,onShowStep:M,submitReason:N,onSubmit:ee,status:P,denial:F,headingRef:I,onClose:te,layout:L=`docked`}){let R=(0,Z.useId)(),z=`${R}-submit-reason`,ne=`${R}-test-switcher`,re=`${R}-note`,ie=(0,Z.useRef)(null),ae=D?.newMarkId,le=D?.read;(0,Z.useEffect)(()=>{if(ae===void 0)return;let e=ie.current?.querySelector(`[data-history-new]`),t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;e?.scrollIntoView({block:`nearest`,behavior:t?`auto`:`smooth`})},[ae,le]);let ue=N!==``,fe=bi[s],pe=a===`test`&&c!==void 0&&b!==`idle`&&!x,me=a===`test`&&c!==void 0&&x&&(S?.kind===`consequences`||S?.kind===`quarantined`)?S.resolvedStep:void 0,he=x&&(S?.kind===`consequences`||S?.kind===`quarantined`)?S:void 0,ge=me===void 0||c===void 0?void 0:La(me.reason,c,me.stepIndex+1,A);return(0,Q.jsxs)(`section`,{id:e,"aria-labelledby":t,"data-feedback-composer":!0,"data-feedback-state":i,"data-feedback-scope":a,"data-feedback-target":o,"data-feedback-layout":L,className:`flex h-full min-h-0 flex-col`,onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&!e.defaultPrevented&&te()},children:[(0,Q.jsxs)(`div`,{className:`shrink-0 space-y-1 border-b px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`h2`,{id:t,ref:I,tabIndex:-1,className:`min-w-0 flex-1 break-words text-base font-medium leading-snug`,children:(0,Q.jsx)(Ou,{parts:n})}),(0,Q.jsxs)(Be,{children:[(0,Q.jsx)(Le,{asChild:!0,children:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,"data-feedback-close":!0,"aria-label":ca,onClick:te,children:(0,Q.jsx)(Qe,{className:`h-3.5 w-3.5`,"aria-hidden":`true`})})}),(0,Q.jsx)(nt,{side:`bottom`,children:la})]})]}),(0,Q.jsx)(`p`,{"data-feedback-scope-line":!0,className:`break-words text-xs text-muted-foreground`,children:(0,Q.jsx)(Ou,{parts:r})}),d===void 0?null:(0,Q.jsxs)(`div`,{className:`space-y-1 pt-1`,children:[(0,Q.jsx)(ke,{htmlFor:ne,className:`text-xs font-medium`,children:Ri}),(0,Q.jsxs)(ce,{value:String(d.value),onValueChange:e=>{let t=d.options.find(t=>String(t.testIndex)===e);t!==void 0&&d.onChange(t.testIndex)},children:[(0,Q.jsx)(V,{id:ne,className:`w-full h-8 text-xs`,"data-feedback-test-switcher":!0,children:(0,Q.jsx)(B,{})}),(0,Q.jsx)(oe,{children:d.options.map(e=>(0,Q.jsx)(se,{value:String(e.testIndex),children:e.label},e.testIndex))})]})]})]}),(0,Q.jsxs)(`div`,{ref:ie,className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-3 py-4`,children:[f===void 0&&p.length===0?null:(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[f===void 0?null:(0,Q.jsxs)(`div`,{"data-feedback-pinned":!0,role:`note`,className:`rounded-md bg-muted/40 px-3 py-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`p`,{children:f.text}),(0,Q.jsx)(X,{variant:`ghost`,size:`xs`,"data-feedback-switch":!0,className:`-ml-2 mt-1`,onClick:f.onSwitch,children:f.switchLabel})]}),p.map(e=>(0,Q.jsx)(X,{variant:`ghost`,size:`xs`,"data-feedback-unsent-draft":e.address,className:`text-muted-foreground hover:text-foreground`,onClick:e.onOpen,children:e.label},e.address))]}),u?(0,Q.jsx)(`div`,{"data-feedback-no-address":!0,children:(0,Q.jsx)(au,{neutralReason:zi})}):null,(0,Q.jsxs)(`fieldset`,{className:`space-y-2`,children:[(0,Q.jsx)(`legend`,{className:`text-xs font-medium text-muted-foreground`,children:xi}),(0,Q.jsx)(Se,{className:`gap-2`,"data-feedback-choices":!0,"data-feedback-outcome-class":s,value:c??``,onValueChange:e=>{let t=fe.find(t=>t===e);t!==void 0&&l(t)},children:fe.map((e,t)=>{let n=`${R}-${e}`,r=`${n}-meaning`;return(0,Q.jsxs)(ke,{htmlFor:n,"data-feedback-choice":e,"data-choice-position":t+1,className:`flex items-start gap-2 rounded-md border px-3 py-2 font-normal leading-normal cursor-pointer hover:bg-muted/40 has-[[data-state=checked]]:border-primary/60 has-[[data-state=checked]]:bg-primary/5`,children:[(0,Q.jsx)(be,{id:n,value:e,"aria-describedby":r,className:`mt-0.5`}),(0,Q.jsxs)(`span`,{className:`min-w-0 space-y-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium leading-normal`,children:yi[e]}),(0,Q.jsx)(`span`,{id:r,className:`block text-xs text-muted-foreground`,children:Si[s][e]})]})]},e)})})]}),pe?(0,Q.jsx)(St,{"data-feedback-resolved-step-pending":!0,className:`h-4 w-3/4 motion-reduce:animate-none`}):me!==void 0&&ge!==void 0?(0,Q.jsxs)(`div`,{"data-feedback-resolved-step":!0,"data-resolved-reason":me.reason,className:`flex flex-wrap items-center gap-x-2 text-xs`,children:[(0,Q.jsx)(`p`,{className:`break-words`,children:ge}),(0,Q.jsx)(X,{variant:`ghost`,size:`xs`,"data-feedback-show-step":!0,onClick:()=>M?.(me.stepIndex),children:Ra(me.stepIndex+1)})]}):null,(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(ke,{htmlFor:re,className:`text-xs font-medium`,children:di}),(0,Q.jsx)(de,{id:re,"data-feedback-note":!0,maxLength:fi,value:m,onChange:e=>h?.(e.target.value),className:`max-h-40 overflow-y-auto`}),m.length>=1800?(0,Q.jsx)(`p`,{"aria-live":`off`,className:`text-xs text-muted-foreground tabular-nums`,children:pi(m.length)}):null]}),(0,Q.jsx)(Du,{expectation:g,actionText:_,disabled:i===`submitting`,actionField:v??{shown:!1,reason:hi(c===void 0?`no-choice`:`loading`)},onChange:(e,t)=>y?.(e,t)}),(0,Q.jsx)(pu,{state:b,current:x,read:S,updating:C,replacesTime:w,alreadyMarkedTime:T,timeFor:E,failure:O,onRetry:k}),D===void 0?null:(0,Q.jsx)(`div`,{className:`mt-6 border-t pt-6`,children:(0,Q.jsx)(su,{scope:a,address:o,...D})}),(0,Q.jsx)(vu,{kind:c,address:o,testId:j,recordIds:he?.kind===`consequences`?he.knowledge.records.map(e=>e.recordId):void 0,labels:he?.kind===`consequences`?he.labels:void 0,basis:he?.basis})]}),(0,Q.jsxs)(`div`,{className:`shrink-0 space-y-2 border-t px-3 py-2`,children:[F===void 0?null:(0,Q.jsx)(`div`,{"data-feedback-denied":!0,role:`alert`,children:(0,Q.jsx)(au,{neutralReason:F.reason})}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(X,{size:`sm`,"data-feedback-submit":!0,"aria-disabled":ue,"aria-describedby":z,className:`aria-disabled:cursor-not-allowed aria-disabled:opacity-50`,onClick:()=>{ue||ee()},children:ia}),(0,Q.jsx)(`p`,{id:z,"data-feedback-submit-reason":!0,className:`text-xs text-muted-foreground`,children:N})]}),(0,Q.jsx)(`p`,{"data-feedback-status":!0,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-xs text-muted-foreground`,children:P})]})]})}var Au={state:`composing`,status:``};function ju(e){let[t,n]=e.split(`:`);return n===`run`?{testIndex:Number(t)}:{testIndex:Number(t),stepIndex:Number(n)}}function Mu(e,t){return`${e}|${t}`}function Nu(e,t){let n=Tu(e.actionText),r={...e.expectation===``?{}:{correctedExpectation:e.expectation},...t.shown&&n.kind===`valid`?{correctedAction:n.action}:{}};return{...Object.keys(r).length===0?{}:{correction:r},invalid:t.shown&&n.kind===`invalid`}}function Pu({runId:e,runStatus:t,detail:n,onMark:r,markPending:i,selectedStep:a,memberFilter:o,markDenial:s,reloadDetail:c,setSelection:l,beforeOpen:u}){let d=(0,Z.useId)(),f=`${d}-feedback`,p=`${d}-feedback-heading`,[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(()=>new Map),[b,x]=(0,Z.useState)(),[S,w]=(0,Z.useState)(()=>new Map),T=(0,Z.useRef)(void 0),[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(()=>new Map),[A,j]=(0,Z.useState)(()=>new Map),[M,N]=(0,Z.useState)(0),ee=(0,Z.useRef)(null),P=(0,Z.useRef)(null),F=(0,Z.useRef)(0),[I,te]=(0,Z.useState)(),L=(0,Z.useRef)(0),R=(0,Z.useRef)(void 0),z=(0,Z.useRef)(void 0),ne=(0,Z.useRef)(e),re=(0,Z.useRef)(n);(0,Z.useEffect)(()=>{re.current=n},[n]),(0,Z.useEffect)(()=>{M>0&&ee.current?.focus()},[M]),(0,Z.useEffect)(()=>{s!==void 0&&j(e=>new Map(e).set(ai(s),{reason:s.reason}))},[s]),(0,Z.useEffect)(()=>(ne.current=e,F.current+=1,L.current+=1,te(void 0),clearTimeout(R.current),z.current=void 0,P.current=null,h(!1),_(null),y(new Map),x(void 0),w(new Map),T.current=void 0,D(!1),k(new Map),j(new Map),()=>{F.current+=1,L.current+=1,clearTimeout(R.current)}),[e]);let ae=()=>{let e=ne.current;if(e===void 0)return;let t=++L.current;et(e).then(n=>{L.current!==t||ne.current!==e||te(n)})},B=g===null?void 0:ai(g),V=(B===void 0?void 0:v.get(B))??ii,{state:oe,status:se}=(B===void 0?void 0:O.get(B))??Au,ce=oe===`submitting`,le=(e,t)=>k(n=>new Map(n).set(e,t)),ue=(e,t)=>gi({kind:t,landedForTargetAndKind:e===void 0||t===void 0?void 0:S.get(Mu(e,t))}),de=ue(B,V.kind),{correction:fe,invalid:pe}=Nu(V,de),me=g===null||V.kind===void 0?``:qi({kind:V.kind,...g,...fe}),he=b!==void 0&&b.address===B?b:void 0,ge=he===void 0?void 0:he.read.kind===`read`?he.read.result.kind:`failed`,_e=he!==void 0&&me!==``&&he.key===me,ve=g===null||Bi(n,g.testIndex),H=ve?_a({kind:V.kind,landed:he?.read}):`idle`,ye=he?.read.kind===`failed`?he.read.reason:void 0,be=H!==`idle`&&H!==`loading`&&!_e||E&&H===`failed`,xe=ra({noUniqueAddress:!ve,kind:V.kind,currentKey:me,landedKey:he?.key,landedOutcome:ge,invalidCorrection:pe,inFlight:i||oe===`submitting`}),Se=(e,t,n,r=300)=>{clearTimeout(R.current),D(!1);let i=++F.current,a=qi({kind:t,...e,...n});if(T.current=a,!Bi(re.current,e.testIndex))return;let o=()=>{if(F.current!==i)return;let r=ne.current,o=re.current?.members.find(t=>t.testIndex===e.testIndex);if(r===void 0||o===void 0)return;let s=ai(e);q(r,Ki(o,e,t,n)).then(e=>{if(F.current!==i||ne.current!==r)return;D(!1),x({key:a,address:s,kind:t,read:e});let n=Mu(s,t);w(t=>_i(e)||!t.has(n)?new Map(t).set(n,e):t)})};r===0?o():R.current=setTimeout(o,r)},Ce=()=>{g===null||V.kind===void 0||ce||(Se(g,V.kind,fe,0),D(!0))},we=(e,t)=>Nu(v.get(e)??ii,ue(e,t)).correction;(0,Z.useEffect)(()=>{!m||g===null||V.kind===void 0||ce||T.current!==me&&Se(g,V.kind,fe)},[m,me]);let Te=(e,t)=>{u?.(),P.current=t,c?.().catch(()=>void 0),ae();let n=ai(e);if(B!==n){F.current+=1;let t=v.get(n)?.kind;t===void 0?clearTimeout(R.current):Se(e,t,we(n,t))}_(e),h(!0),N(e=>e+1)},Ee=e=>{let t=ai(e);if(oe===`submitting`||t===B)return;F.current+=1,_(e),N(e=>e+1),ae();let n=v.get(t)?.kind;n===void 0?clearTimeout(R.current):Se(e,n,we(t,n))},De=()=>{h(!1),(P.current?.isConnected?P.current:document.querySelector(`[data-feedback-entry="test"]`)??document.querySelector(`[role="tab"][aria-selected="true"]`))?.focus()},Oe=e=>{le(e,Au)},ke=e=>{B===void 0||ce||(y(t=>new Map(t).set(B,{...t.get(B)??ii,note:e})),Oe(B))},Ae=e=>{g===null||B===void 0||ce||(y(t=>new Map(t).set(B,{...t.get(B)??ii,kind:e})),Oe(B),Se(g,e,we(B,e)))},je=(e,t)=>{B===void 0||ce||(y(n=>new Map(n).set(B,{...n.get(B)??ii,expectation:e,actionText:t})),Oe(B))},Me=async()=>{if(g===null||B===void 0||V.kind===void 0||xe!==``||z.current)return;let e={},t=g;z.current=e,le(B,{state:`submitting`,status:oa}),j(e=>{let t=new Map(e);return t.delete(B),t});try{let n=await r(t.testIndex,t.stepIndex,V.kind,V.note||void 0,fe);if(z.current!==e)return;n===`refreshed`?(y(e=>{let t=new Map(e);return t.delete(B),t}),x(void 0),le(B,{state:`recorded`,status:``}),ae()):n===`retained`?le(B,{state:`retained`,status:ua}):le(B,Au)}finally{z.current===e&&(z.current=void 0)}},Ne=oe!==`recorded`||g===null?void 0:n?.members.find(e=>e.testIndex===g.testIndex)?.marks?.find(e=>e.stepIndex===g.stepIndex),Pe=oe===`recorded`?Ne===void 0?``:ga(Ne.disposition):se,Fe=I?.kind===`read`&&I.result.kind===`history`?I.result.entries:[],Ie=e=>bo(Fe.find(t=>t.markId===e)?.markedAt),Le=g===null?void 0:Ii({detail:n,target:g,runStatus:t}),Re=n?.members??[],U=g===null||g.stepIndex!==void 0||Re.length<=1?void 0:{value:g.testIndex,options:Re.map(e=>({testIndex:e.testIndex,label:`${ie(e)} ${C(e.testIndex)}`})),onChange:e=>Ee({testIndex:e})},ze=(n?.members.length??0)>1,Be=e=>ze?Re.find(t=>t.testIndex===e)??{testIndex:e}:void 0,W=a,Ve=!(g!==null&&W!==null&&(g.stepIndex===void 0?W.testIndex!==g.testIndex:ai(W)!==B))||g===null||W===null?void 0:{text:ci({stepIndex:W.stepIndex,member:Be(W.testIndex)},{stepIndex:g.stepIndex,member:Be(g.testIndex)}),switchLabel:li(g.stepIndex===void 0?{member:Be(W.testIndex)}:{stepIndex:W.stepIndex,member:W.testIndex===g.testIndex?void 0:Be(W.testIndex)}),onSwitch:()=>Ee(g.stepIndex===void 0?{testIndex:W.testIndex}:W)},He=e=>({stepIndex:e.stepIndex,member:e.stepIndex!==void 0&&e.testIndex===g?.testIndex?void 0:Be(e.testIndex)}),Ue=[...v].filter(([e,t])=>e!==B&&!oi(t)).map(([e])=>{let t=ju(e);return{address:e,label:ui(He(t)),onOpen:()=>Ee(t)}}),We=oe===`retained`&&B!==void 0?A.get(B):void 0,Ge=!m||g===null||B===void 0||Le===void 0?void 0:{composerId:f,headingId:p,heading:Le.heading,scopeLine:Le.scopeLine,state:oe,scope:g.stepIndex===void 0?`test`:`step`,target:B,outcomeClass:Le.outcomeClass,selected:V.kind,onChoose:Ae,noUniqueAddress:!ve,testSwitcher:U,pinned:Ve,unsentDrafts:Ue,note:V.note,onNoteChange:ke,expectation:V.expectation,actionText:V.actionText,actionField:vi(de),onCorrectionChange:je,previewState:H,previewCurrent:_e,previewRead:he?.read.kind===`read`?he.read.result:void 0,previewUpdating:be,previewFailure:ye,onPreviewRetry:Ce,timeFor:Ie,history:{read:I,detail:n,newMarkId:Ne?.markId,onRetry:ae},stepCount:Le.stepCount,testId:Re.find(e=>e.testIndex===g.testIndex)?.testId,onShowStep:e=>{l?.({type:`step`,stepId:er(g.testIndex,e)})},submitReason:xe,onSubmit:()=>{Me()},status:Pe,denial:We,headingRef:ee,onClose:De},Ke=Li({detail:n,selectedStep:a,memberFilter:o,runStatus:t}),G=Ke===void 0?void 0:n?.members.find(e=>e.testIndex===Ke.testIndex),qe=G?.marks?.find(e=>e.stepIndex===void 0),Je=Ke===void 0||G?.marks===void 0?void 0:{label:da({scope:`test`,...ze?{memberName:ie(G),handle:C(G.testIndex)}:{},...qe===void 0?{}:{markedChoice:qe.kind}}),target:ai(Ke),marked:qe!==void 0,expanded:m&&g?.stepIndex===void 0,controls:f,onOpen:e=>Te(Ke,e)},K=(e,t,n)=>Te({testIndex:e,stepIndex:t},n);return{open:m,target:g,composerId:f,openFeedback:Te,openStepFeedback:K,retarget:Ee,composer:Ge,headerEntry:Je,tree:{composerId:f,expandedAddress:m&&g?.stepIndex!==void 0?B:void 0,onOpenStep:K}}}function Fu({runId:e,sha:t,open:n,onOpenChange:r,returnFocus:i}){let a=(0,Z.useRef)(null);return(0,Q.jsx)(yt,{open:n,onOpenChange:r,children:(0,Q.jsxs)(Et,{"data-player-lightbox":!0,showCloseButton:!1,className:`sm:max-w-4xl`,onOpenAutoFocus:()=>{a.current=i??(document.activeElement instanceof HTMLElement?document.activeElement:null)},onCloseAutoFocus:e=>{e.preventDefault(),a.current?.focus()},children:[(0,Q.jsx)(Nt,{className:`pr-8 text-sm font-medium`,children:Mc.lightboxTitle}),(0,Q.jsx)(Vc,{runId:e,frame:{id:`decision-screenshot:${t}`,sha:t}},`${e}:${t}`),(0,Q.jsx)(xt,{className:`py-8 text-xs`,children:Mc.lightboxNote}),(0,Q.jsx)(Ot,{asChild:!0,children:(0,Q.jsx)(X,{size:`icon-sm`,variant:`ghost`,className:`absolute right-4 top-4`,"aria-label":Mc.lightboxClose,children:(0,Q.jsx)(Qe,{className:`h-4 w-4`})})})]})})}function Iu(e,t,n){let r=0,i;for(let a of e.members){a.model.testIndex===n&&(i=r);let e=t.get(a.model.testIndex);r=r!==void 0&&e!==void 0&&Number.isFinite(e)&&e>0?r+e:void 0}return{offsetMs:i,totalMs:r}}function Lu(e){let t=e.map(Dc),n=t.length>0&&t.every(e=>e.axis===`time`),r=t.map(e=>n?e.extent:Math.max(1,e.segments.reduce((e,t)=>e+Math.max(1,t.subActions.length),0))),i=r.reduce((e,t)=>e+t,0),a=0,o=0,s=e.map((n,o)=>{let s=i===0?o/e.length:a/i;a+=r[o];let c=i===0?(o+1)/e.length:a/i;return{group:n,model:t[o],start:s,end:c,label:`${C(n.member.testIndex)} · ${ie(n.member)}`}}),c=s.flatMap(e=>e.model.segments.map(t=>({...t,start:e.start+t.start*(e.end-e.start),end:e.start+t.end*(e.end-e.start),markers:t.markers.map(t=>({...t,ordinal:++o,position:e.start+t.position*(e.end-e.start)}))})));return{testIndex:t[0]?.testIndex??0,axis:n?`time`:`ordinal`,extent:i,members:s,segments:c,markers:c.flatMap(e=>e.markers),playhead:t[0]?.playhead??null}}function Ru(e,t,n){let r=Math.max(0,Math.min(1,t)),i=n&&e.members.find(e=>e.model.testIndex===n.testIndex)||e.members.find(e=>r<e.end)||e.members.at(-1);if(!i)return;let a=i.end===i.start?0:Math.max(0,Math.min(1,(r-i.start)/(i.end-i.start))),o=i.model.markers;return{member:i,playhead:o.filter(e=>e.position<=a).at(-1)??o[0]??i.model.playhead,localFraction:i.model.axis===`time`?a:void 0}}function zu(e,t,n){let r=e.members.find(e=>e.model.testIndex===t);if(!r||r.model.axis!==`time`||!Number.isFinite(n))return;let i=r.model.extent===0?0:Math.max(0,Math.min(1,n*1e3/r.model.extent));return r.start+i*(r.end-r.start)}var Bu={slider:`Test timeline`,signals:`Step signals`,results:o};function Vu(e,t){let n=jc(e.recordingOffsetMs);return`Step ${e.stepIndex+1}, sub-action ${e.ordinal} of ${t}: ${i(a(e.subAction))}, ${o[e.result]}${n===void 0?``:`, ${n}`}`}function Hu({model:e,playhead:t,source:n,memberLabel:i,seekFraction:o,observedPosition:s,mediaDurationsReady:c,onPlayheadChange:u,onSeekFraction:d}){let f=(0,Z.useRef)(null),[p,m]=(0,Z.useState)(320),[h,g]=(0,Z.useState)(null),_=e.members;(0,Z.useEffect)(()=>{let e=f.current;if(!e)return;let t=()=>{e.clientWidth>0&&m(e.clientWidth)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let v=(0,Z.useRef)(null),y=(0,Z.useRef)(null),b=e.markers.find(e=>e.testIndex===t?.testIndex&&e.stepIndex===t.stepIndex&&e.subActionIndex===t.subActionIndex),x=s??o,S=n===`video`&&x!==void 0?Math.max(0,Math.min(1,x)):b?.position;function C(e){u({testIndex:e.testIndex,stepIndex:e.stepIndex,subActionIndex:e.subActionIndex})}function w(t){let r=f.current.getBoundingClientRect();if(r.width<=0)return;let i=Math.max(0,Math.min(r.width,t-r.left)),a=e.markers.map(e=>({marker:e,centrePx:e.position*r.width})),o=n===`frames`?Oc(i,a):kc(i,a);if(o)C(o),n===`video`&&d(o.position,o);else if(n===`video`){let t=i/r.width,n=e.markers.filter(e=>e.position<=t).at(-1)??e.markers[0];n&&!_&&C(n),d(t)}}function T(e,t,n){e.button===0&&(e.preventDefault(),e.stopPropagation(),v.current?.focus({preventScroll:!0}),y.current={pointerId:e.pointerId,startX:e.clientX,moved:!1,group:n},f.current.setPointerCapture(e.pointerId),t?N(t):n===void 0&&w(e.clientX))}function E(e){let t=y.current;t?.pointerId===e.pointerId&&(y.current=null,e.type===`pointerup`&&t.group!==void 0&&!t.moved&&g(e=>e===t.group?null:t.group),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))}function D(t){let r=b?e.markers.indexOf(b):-1,i;switch(t.key){case`ArrowLeft`:i=e.markers[Math.max(0,r-1)];break;case`ArrowRight`:i=e.markers[Math.min(e.markers.length-1,r+1)];break;case`Home`:i=e.markers[0];break;case`End`:i=e.markers.at(-1);break;case`PageUp`:i=e.segments.slice(0,e.segments.findIndex(e=>b&&e.markers.includes(b))).filter(e=>e.markers.length>0).at(-1)?.markers[0];break;case`PageDown`:i=e.segments.slice(e.segments.findIndex(e=>b&&e.markers.includes(b))+1).find(e=>e.markers.length>0)?.markers[0];break;default:return}t.preventDefault(),t.stopPropagation(),i&&(C(i),n===`video`&&d(i.position,i))}let O=[],k=e=>e.position*p;for(let t of e.markers){let e=O.at(-1);e&&k(t)-k(e[0])<28?e.push(t):O.push([t])}let A=S??b?.position??0,j=O.find(e=>Math.abs(e[0].position-A)*p<=10),M=e=>{let t=_?.find(t=>t.model.testIndex===e.testIndex);return`${t?`${t.label}, `:``}Step ${e.stepIndex+1}`},N=e=>{C(e),n===`video`&&d(e.position,e),g(null)};return e.markers.length===0&&!_?.length?null:(0,Q.jsx)(`div`,{"data-timeline":!0,"data-timeline-axis":e.axis,"data-timeline-member":_?`suite`:e.testIndex,"data-media-durations-ready":c,className:`min-w-0 flex-1 px-5 py-1`,children:(0,Q.jsxs)(`div`,{ref:f,"data-timeline-track":!0,className:`relative h-7 touch-none cursor-pointer`,onPointerDown:e=>T(e),onPointerMove:e=>{let t=y.current;t?.pointerId===e.pointerId&&(Math.abs(e.clientX-t.startX)>3&&(t.moved=!0),(t.group===void 0||t.moved)&&w(e.clientX))},onPointerUp:E,onPointerCancel:E,onLostPointerCapture:()=>{y.current=null},children:[(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`absolute inset-x-0 top-3 h-1 rounded-full bg-muted`}),_?.map(e=>(0,Q.jsx)(`span`,{"data-timeline-member-span":e.model.testIndex,className:`absolute top-3 h-1 border-l border-background ${e.group.member.recording?.state===`present`?``:`bg-muted-foreground/30`}`,style:{left:`${e.start*100}%`,width:`${(e.end-e.start)*100}%`}},e.model.testIndex)),(b||S!==void 0)&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`absolute left-0 top-3 h-1 rounded-full bg-primary/50`,style:{width:`${A*100}%`}}),(0,Q.jsx)(`span`,{ref:v,"data-timeline-playhead":!0,role:`slider`,tabIndex:0,"aria-label":i?`${Bu.slider}: ${i}`:Bu.slider,"aria-orientation":`horizontal`,onKeyDown:D,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round((S??0)*100),"aria-valuetext":b?Vu(b,e.markers.length):`No actions recorded for this test`,style:{left:`${A*100}%`},"data-playhead-circle":j?!0:void 0,className:`pointer-events-none absolute z-10 -translate-x-1/2 rounded-full ${j?`top-1 h-5 w-5 bg-transparent`:`top-[5px] h-[18px] w-1.5 bg-primary`} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`})]}),O.map(t=>{let n=t[0],i=a(n.subAction).family,o=i?r[i]:l,s={left:`${n.position*100}%`},c=t===j||!j&&t.some(e=>e===b),u=`absolute top-0 flex h-7 w-7 -translate-x-1/2 items-center justify-center rounded-full focus-visible:outline-2 focus-visible:outline-ring`,d=`flex h-5 w-5 items-center justify-center rounded-full border ${c?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground/30 bg-background text-muted-foreground hover:bg-muted`}`;return t.length===1?(0,Q.jsx)(`button`,{type:`button`,"data-timeline-marker":n.ordinal,"data-timeline-active":c||void 0,"aria-current":c?`step`:void 0,style:s,className:u,"aria-label":`${M(n)}: ${Vu(n,e.markers.length)}`,onPointerDown:e=>T(e,n),onClick:e=>{e.detail===0&&N(n)},children:(0,Q.jsx)(`span`,{"data-timeline-circle":!0,className:d,children:(0,Q.jsx)(o,{"aria-hidden":`true`,className:`h-3 w-3`})})},n.ordinal):(0,Q.jsxs)(Me,{open:h===n.ordinal,onOpenChange:e=>g(e?n.ordinal:null),children:[(0,Q.jsx)(je,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"data-timeline-marker-group":!0,"data-timeline-active":c||void 0,"aria-current":c?`step`:void 0,style:s,className:u,"aria-label":`Choose from ${t.length} nearby actions`,onPointerDown:e=>T(e,void 0,n.ordinal),onClick:e=>{e.detail>0&&e.preventDefault()},children:(0,Q.jsx)(`span`,{"data-timeline-circle":!0,className:d,children:(0,Q.jsx)(mr,{"aria-hidden":`true`,className:`h-3 w-3`})})})}),(0,Q.jsx)(Ae,{className:`max-h-64 w-80 overflow-y-auto p-1`,"aria-label":`Nearby actions`,onPointerDown:e=>e.stopPropagation(),children:t.map(e=>(0,Q.jsxs)(`button`,{type:`button`,"data-timeline-marker":e.ordinal,className:`block w-full rounded p-2 text-left hover:bg-muted`,onClick:()=>N(e),children:[(0,Q.jsx)(`span`,{className:`text-xs`,children:M(e)}),(0,Q.jsx)(Ys,{sub:e.subAction})]},e.ordinal))})]},n.ordinal)}),_?.filter(e=>e.model.markers.length===0).map(e=>(0,Q.jsx)(`button`,{type:`button`,"data-timeline-empty-member":e.model.testIndex,"aria-label":`${e.label}: No actions recorded`,className:`absolute top-0 flex h-7 w-7 -translate-x-1/2 items-center justify-center rounded-full focus-visible:outline-2 focus-visible:outline-ring`,style:{left:`${(e.start+e.end)*50}%`},onPointerDown:e=>T(e),onClick:t=>{t.detail===0&&d((e.start+e.end)/2)},children:(0,Q.jsx)(`span`,{"data-timeline-circle":!0,className:`flex h-5 w-5 items-center justify-center rounded-full border border-muted-foreground/30 bg-background`,children:(0,Q.jsx)(ve,{"aria-hidden":`true`,className:`h-3 w-3 text-muted-foreground`})})},`empty-${e.model.testIndex}`))]})})}var Uu={message:`This run was recorded before evidence was saved. Variables, network, console, ARIA, accessibility and video were not recorded.`,dismiss:`Dismiss notice`};function Wu(e){return`agent-qa.run-detail.notice-dismissed:${e}`}function Gu(e){return e?.state===`absent`&&e.reason===`unavailable`&&e.evidenceIncomplete!==!0}function Ku(e){return e.steps.length>0&&e.steps.every(e=>Gu(e.evidence?.variables)&&Gu(e.evidence?.network)&&Gu(e.evidence?.console)&&Gu(e.evidence?.a11y))&&e.subActions.every(e=>Gu(e.ariaEvidence))&&e.members.every(e=>Gu(e.recording))}function qu({runId:e}){let t=Wu(e),[n,r]=(0,Z.useState)(()=>{try{return sessionStorage.getItem(t)===`true`}catch{return!1}});return n?null:(0,Q.jsxs)(`div`,{"data-run-notice":!0,role:`status`,className:`flex items-center gap-2 border-b bg-muted/40 px-4 py-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(fr,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1`,children:Uu.message}),(0,Q.jsx)(X,{size:`icon-sm`,variant:`ghost`,className:`shrink-0`,"aria-label":Uu.dismiss,onClick:()=>{r(!0);try{sessionStorage.setItem(t,`true`)}catch{}},children:(0,Q.jsx)(Qe,{className:`h-4 w-4`,"aria-hidden":`true`})})]})}var Ju=[`overview`,`env`,`network`,`console`,`aria`,`a11y`,`knowledge`];function Yu(e){let t=e.get(`tab`);return Ju.find(e=>e===t)??`overview`}function Xu(e,t){let n=t.get(`step`),r=t.get(`sub`);if(n){let t=e.find(e=>e.id===n);if(t){if(r!=null){let e=/^\d+$/.test(r)?Number(r):NaN;return!Number.isSafeInteger(e)||!t.subActions?.some(t=>t.subActionIndex===e)?null:{type:`subaction`,stepId:t.id,subIndex:e}}return{type:`step`,stepId:t.id}}}return e.length>0?{type:`step`,stepId:e[0].id}:null}function Zu(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top+12,a=n.bottom-12;if(r.top>=i&&r.bottom<=a)return;let o=r.top<i?e.scrollTop+(r.top-i):e.scrollTop+(r.bottom-a),s=Math.max(0,o);if(typeof e.scrollTo==`function`){e.scrollTo({top:s,behavior:`smooth`});return}e.scrollTop=s}function Qu(e){return!(e.target instanceof Element)||e.target.closest(`button, [role="tablist"], [role="radiogroup"], [role="tree"], [role="dialog"]:not([data-state="closed"]), dialog[open]`)!==null}function $u(){let{id:e}=Pt(),t=_t(),n=Rt(bt().state),[r,i]=Vt(),a=ut()?.recordRunDetailStatus,[o,s]=(0,Z.useState)(null);Ht(o?`Run - ${o.name}`:`Run`),he(_e(o?.status));let[c,l]=(0,Z.useState)(void 0),[u,d]=(0,Z.useState)(),[p,m]=(0,Z.useState)(!1),h=(0,Z.useRef)(void 0),_=(0,Z.useRef)(0),v=(0,Z.useRef)(e);(0,Z.useEffect)(()=>(_.current+=1,v.current=e,h.current=void 0,m(!1),d(void 0),l(void 0),()=>{v.current=void 0,_.current+=1}),[e]);let b=(0,Z.useCallback)(async(t=_.current)=>{if(!e)return;let n=await ht(e);if(!(v.current!==e||_.current!==t))return n.runId===e&&l(n),n},[e]),S=(0,Z.useCallback)(async(t,n,r,i,a)=>{if(!e||c?.runId!==e)return`stale`;if(h.current)return`retained`;let o=c.members.find(e=>e.testIndex===t);if(o?.marks===void 0)return`retained`;let s={testIndex:t,...n===void 0?{}:{stepIndex:n}};if(c.members.length>1&&(!o.testId||c.members.filter(e=>e.testId===o.testId).length!==1))return d({...s,reason:`This member has no unique mark address.`}),`retained`;let l={},u=_.current,f=()=>v.current===e&&_.current===u&&h.current===l;h.current=l,m(!0),d(void 0);try{let c=await Mt(e,{kind:r,...o.testId?{testId:o.testId}:{},...n===void 0?{}:{stepIndex:n},...i?{note:i}:{},...a});if(!f())return`stale`;if(c.kind===`marked`||c.kind===`already-marked`){let i=await b(u);if(!f())return`stale`;let a=i?.runId===e?i.members.find(e=>e.testIndex===t&&e.testId===o.testId)?.marks?.find(e=>e.stepIndex===n):void 0;if(a?.markId===c.receipt.markId&&a.ordinal===c.receipt.ordinal&&a.kind===c.receipt.kind&&a.kind===r)return`refreshed`;d({...s,reason:`The matching mark receipt could not be refreshed. Reload this run before trying again.`})}else d({...s,reason:`Mark refused: ${c.kind}.`});return`retained`}catch{return f()?(d({...s,reason:`Could not complete the mark or refresh its receipt. Reload this run before trying again.`}),`retained`):`stale`}finally{f()&&(h.current=void 0,m(!1))}},[e,c,b]),[C,w]=(0,Z.useState)(null),[T,E]=(0,Z.useState)(0);(0,Z.useEffect)(()=>{if(!C)return;let e=new ResizeObserver(e=>{let t=e[e.length-1];t&&E(t.contentRect.width)});return e.observe(C),()=>e.disconnect()},[C]);let[D,O]=(0,Z.useState)(!0),[k,M]=(0,Z.useState)(!1),N=(0,Z.useRef)(null),ee=(0,Z.useRef)(null),P=(0,Z.useRef)(null),[I,te]=(0,Z.useState)(null),[L,R]=(0,Z.useState)(null),[re,ae]=(0,Z.useState)(),[le,ue]=(0,Z.useState)(0),[de,fe]=(0,Z.useState)(),[pe,me]=(0,Z.useState)(),[ge,ve]=(0,Z.useState)(),H=(0,Z.useCallback)(e=>{te(e),me(void 0),ve(void 0),fe(void 0),R(null),ae(void 0)},[]),ye=(0,Z.useCallback)(e=>{let t=Ec(e);Zn(t)&&(te(t),me(void 0),ve(void 0),fe(void 0),R(e),ae(void 0))},[]),[be,xe]=(0,Z.useState)([]),[Se,Ce]=(0,Z.useState)(void 0),[we,Te]=(0,Z.useState)(void 0),[Ee,De]=(0,Z.useState)(void 0),[Oe,ke]=(0,Z.useState)(!1),[Ae,je]=(0,Z.useState)(!1),[Me,Ne]=(0,Z.useState)(`test`),[Pe,Fe]=(0,Z.useState)(null),[Ie,Le]=(0,Z.useState)(null),Re=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{Fe(null)},[e]);let[U,ze]=(0,Z.useState)(null),[Be,W]=(0,Z.useState)(!1),[Ve,He]=(0,Z.useState)(null),Ue=(0,Z.useRef)(null),We=(0,Z.useRef)(0),[Ge,G]=(0,Z.useState)(()=>Yu(r));(0,Z.useEffect)(()=>{o?.status&&a?.(o.status)},[a,o?.status]),(0,Z.useEffect)(()=>{if(e)return Ce(void 0),vt(e,{onRead:Ce})},[e]);let qe=Se?.kind===`read`?Se.status.chips.analysis:void 0;(0,Z.useEffect)(()=>{De(void 0)},[e]),(0,Z.useEffect)(()=>{if(!e)return;let t=!1;return Ye(e).then(n=>{!t&&n.runId===e&&De(n)},()=>{}),()=>{t=!0}},[e,qe]),(0,Z.useEffect)(()=>{if(!e)return;P.current=null;let i=!1,a=0,o=0,c;async function u(){try{let a=await Ke(e);if(i)return;let d=Tt(a.run.status);if(d&&n===void 0){t(lt.runLive(e),{replace:!0});return}s(a.run),d&&o<8&&(o+=1,c=setTimeout(()=>{i||u()},250));try{let e=await b();if(i||e===void 0)return;H(Xu(Qn(x(z(e),y(r.get(`member`)))),r))}catch{if(i)return;l(null),H(null)}}catch(e){if(i)return;if(e instanceof Error&&e.message.includes(`404`)){if(a<5){a++,setTimeout(()=>{i||u()},1e3);return}M(!0)}else Bt.error(`Failed to load run`)}finally{i||O(!1)}}return u(),()=>{i=!0,c!==void 0&&clearTimeout(c)}},[e,t,n]),(0,Z.useEffect)(()=>{if(!e||D)return;let t=!1;return It(e).then(({logs:e})=>{t||xe(e)}).catch(()=>{}),()=>{t=!0}},[e,D]),(0,Z.useEffect)(()=>{if(!e)return;let t=!1;return Te(void 0),pt(e).then(e=>{t||Te({kind:`read`,projection:e})}).catch(e=>{t||Te({kind:`unavailable`,error:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},[e]);let Je=(0,Z.useMemo)(()=>we===void 0?void 0:hn(we),[we]);(0,Z.useEffect)(()=>{Ue.current=null,We.current+=1,ze(null),He(null),W(!1)},[o?.id]);let K=(0,Z.useCallback)(async()=>{if(!o?.id)return;let e=We.current+1;We.current=e,W(!0),He(null);try{let t=await ot(o.id);if(We.current!==e)return;Ue.current=o.id,ze(t)}catch(t){if(We.current!==e)return;He(t instanceof Error?t.message:`Failed to load artifact data`)}finally{We.current===e&&W(!1)}},[o?.id]);(0,Z.useEffect)(()=>{!Ae||!o?.id||Be||Ve||Ue.current===o.id&&U||K()},[Ae,Ve,Be,U,K,o?.id]);let Xe=(0,Z.useCallback)((e=`test`)=>{Ne(e),je(!0)},[]),Ze=y(r.get(`member`)),{groups:q,ready:Qe,decodedDurations:$e}=Jr((0,Z.useMemo)(()=>c?z(c):[],[c]),e??``),et=(0,Z.useMemo)(()=>x(q,Ze),[q,Ze]),tt=(0,Z.useMemo)(()=>Vs(Ee,qe,c),[Ee,qe,c]),nt=(0,Z.useCallback)(()=>{let e=ee.current??document,t=e.querySelector(`[data-verdict-block]`)??e.querySelector(`[data-member-toggle][data-member-has-verdict]`)??e.querySelector(`[data-member-toggle]`);if(t===null)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`;t.scrollIntoView({block:`center`,behavior:n}),t.focus({preventScroll:!0})},[]),it=c?ne(c):!1,J=(0,Z.useMemo)(()=>Qn(et),[et]),st=(0,Z.useMemo)(()=>Zn(I)?J.find(e=>e.id===I.stepId)??null:null,[I,J]),ct=Pu({runId:e,runStatus:o?.status,detail:c,onMark:S,markPending:p,selectedStep:st?.testIndex!==void 0&&st.stepIndex!==void 0?{testIndex:st.testIndex,stepIndex:st.stepIndex}:null,memberFilter:Ze===`all`?void 0:Ze,markDenial:u,reloadDetail:b,setSelection:H}),dt=ct.composer!==void 0,ft=Vi(T,dt),mt=Wi(ft),gt=Gt(),yt=(0,Z.useRef)(void 0);(0,Z.useEffect)(()=>{if(!dt){yt.current=void 0;return}if(yt.current===ft)return;let e=yt.current===void 0;yt.current=ft,e||gt.current?.setLayout(Gi(ft,T))},[dt,ft,T,gt]);let xt=(0,Z.useMemo)(()=>{let e=Tc(I);if(!e||!st)return null;if(L?.testIndex===e.testIndex&&L.stepIndex===e.stepIndex)return L;if(I?.type===`subaction`)return e;let t=q.find(t=>t.member.testIndex===e.testIndex)?.steps.find(t=>t.step.stepIndex===e.stepIndex);return t?Cc(t):null},[I,st,L,q]),St=(0,Z.useMemo)(()=>st?.subActions?.find(e=>e.subActionIndex===xt?.subActionIndex)??null,[st,xt]),Ct=et.find(e=>e.member.testIndex===(pe??xt?.testIndex))??et[0],Et=(0,Z.useMemo)(()=>Ct?Dc(Ct):null,[Ct]),Ot=(0,Z.useMemo)(()=>Lu(et),[et]),At=Ct?.member.recording,[jt,Nt]=(0,Z.useState)(),Ft=`${e}:${Ct?.member.testIndex}:${At?.state}`,Lt=jt?.member===Ft?jt.source:Ic(At,Et?.axis??`ordinal`),zt=e=>{ve(void 0),fe(void 0),Nt({member:Ft,source:e})},X=e=>{te(Ec(e)),R(e)},Ut=(t,n)=>{let r=Ru(Ot,t,n);if(!r)return;n??r.playhead?ye(n??r.playhead):(H(null),me(r.member.model.testIndex));let i=r.member.group.member;Lt===`video`&&Nt({member:`${e}:${i.testIndex}:${i.recording?.state}`,source:`video`}),ae(r.localFraction),ue(e=>e+1),fe(t)},Wt=()=>{let t=et.findIndex(e=>e===Ct),n=et[t+1];if(!n){ve(void 0);return}let r=Dc(n),i=r.markers[0]??r.playhead;i?ye(i):(H(null),me(n.member.testIndex));let a=n.member.recording;Nt({member:`${e}:${n.member.testIndex}:${a?.state}`,source:`video`}),ae(r.axis===`time`?0:void 0),ue(e=>e+1),ve(a?.state===`present`&&!a.ref.evidenceIncomplete?n.member.testIndex:void 0),fe(Ot.members[t+1]?.start)},Zt=(0,Z.useCallback)(t=>{for(let n of q){let a=Ac(Dc(n),t);if(a){if(!et.includes(n)){Le(t);let e=new URLSearchParams(r);e.delete(`member`),e.set(`step`,er(a.testIndex,a.stepIndex)),e.set(`sub`,String(a.subActionIndex)),e.delete(`tab`),i(e,{replace:!0});return}ye(a),Nt({member:`${e}:${n.member.testIndex}:${n.member.recording?.state}`,source:`frames`}),G(`overview`);return}}Re.current=document.activeElement instanceof HTMLElement?document.activeElement:null,Fe(t)},[q,et,r,i,ye,e]);(0,Z.useEffect)(()=>{Ie&&Ze===`all`&&(Le(null),Zt(Ie))},[Ie,Ze,Zt]);let $t=I?.type===`step`&&!L?Sc(st?.subActions??[]):void 0,en=Zn(I)?I.stepId:null,tn=(0,Z.useMemo)(()=>be.filter(e=>e.stepId===null&&e.phase===`setup`),[be]),nn=(0,Z.useMemo)(()=>be.filter(e=>e.stepId===null&&e.phase===`teardown`),[be]),rn=(0,Z.useMemo)(()=>be.filter(e=>e.stepId!==null),[be]),an=(0,Z.useMemo)(()=>I?.type===`hook`?be.find(e=>e.id===I.hookId)??null:null,[I,be]),on=(0,Z.useMemo)(()=>I?.type===`execution`?be.find(e=>e.id===I.logId)??null:null,[I,be]),sn=(0,Z.useMemo)(()=>{let e=[];for(let t of tn)e.push({type:`hook`,logId:t.id});for(let t of J){t.subActions?.length||e.push({type:`step`,stepId:t.id});for(let n of rn)et.length===1&&(n.stepId===t.id||Number(n.stepId)===t.rawStepOrder)&&e.push({type:`exec`,stepId:t.id,logId:n.id});for(let n of t.subActions??[])e.push({type:`sub`,stepId:t.id,subIndex:n.subActionIndex})}for(let t of nn)e.push({type:`hook`,logId:t.id});return e},[J,rn,tn,nn,et.length]),cn=(0,Z.useMemo)(()=>{let e=I?.type===`step`&&xt?.subActionIndex!==null?Ec(xt):I;return e?sn.findIndex(t=>e.type===`hook`&&t.type===`hook`?t.logId===e.hookId:e.type===`step`&&t.type===`step`?t.stepId===e.stepId:e.type===`subaction`&&t.type===`sub`?t.stepId===e.stepId&&t.subIndex===e.subIndex:e.type===`execution`&&t.type===`exec`?t.logId===e.logId:!1):-1},[sn,I,xt]);function ln(e){return e.type===`hook`?{type:`hook`,hookId:e.logId}:e.type===`step`?{type:`step`,stepId:e.stepId}:e.type===`exec`?{type:`execution`,stepId:e.stepId,logId:e.logId}:{type:`subaction`,stepId:e.stepId,subIndex:e.subIndex}}function un(e){let t=ln(e),n=Tc(t);e.type===`sub`&&n?ye(n):H(t)}Xt((0,Z.useMemo)(()=>{let e=e=>e.target instanceof Element&&e.target.closest(`[role="dialog"]:not([data-state="closed"]), dialog[open], [role="listbox"], [role="combobox"]`)!==null,n=(e,t)=>{if(Qu(e))return!1;let n=et.flatMap(e=>Dc(e).markers);if(n.length===0)return!1;let r=n.findIndex(e=>e.testIndex===xt?.testIndex&&e.stepIndex===xt.stepIndex&&e.subActionIndex===xt.subActionIndex);ye(n[r<0?t===1?0:n.length-1:Math.max(0,Math.min(n.length-1,r+t))])},r={arrowleft:e=>n(e,-1),arrowright:e=>n(e,1),v:e=>{if(Qu(e))return!1;let t=Lt===`video`?`frames`:`video`;Lc(t),zt(t)},arrowdown:t=>{if(e(t))return!1;sn.length!==0&&un(cn===-1?sn[0]:sn[Math.min(cn+1,sn.length-1)])},arrowup:t=>{if(e(t))return!1;sn.length!==0&&un(cn===-1?sn[sn.length-1]:sn[Math.max(cn-1,0)])},j:e=>r.arrowdown(e),k:e=>r.arrowup(e),"shift+arrowdown":t=>{if(e(t))return!1;let n=J[J.findIndex(e=>e.id===en)+1];n&&H({type:`step`,stepId:n.id})},"shift+arrowup":t=>{if(e(t))return!1;let n=J[J.findIndex(e=>e.id===en)-1];n&&H({type:`step`,stepId:n.id})},1:()=>G(Ju[0]),2:()=>G(Ju[1]),3:()=>G(Ju[2]),4:()=>G(Ju[3]),5:()=>G(Ju[4]),6:()=>G(Ju[5]),7:()=>G(Ju[6]),i:()=>Xe(`test`),c:()=>Xe(`config`),m:()=>G(`knowledge`),r:()=>{if(!o)return;let e=o.attributes[`agent-qa.runner`]===`local`;kt({file:o.filePath??o.name,local:e}).then(e=>{Bt.success(`Re-run started`),t(lt.runLive(e.runId))}).catch(e=>Bt.error(e instanceof at?e.message:`Failed to start re-run`))},escape:()=>{Pe?Fe(null):Ae?je(!1):H(null)},"shift+?":()=>ke(e=>!e),"shift+!":()=>N.current?.togglePhase(0),"shift+@":()=>N.current?.togglePhase(1),"shift+#":()=>N.current?.togglePhase(2),"shift+$":()=>N.current?.togglePhase(3)};return r},[sn,cn,I,o,t,Ae,N,Xe,et,xt,Lt,Ft,Pe,J,en])),(0,Z.useEffect)(()=>{if(D||c===void 0||Ie)return;let e=Zn(I)?J.find(e=>e.id===I.stepId):null,t=new URLSearchParams(r);e?t.set(`step`,e.id):t.delete(`step`),t.delete(`run`),xt?.subActionIndex==null?t.delete(`sub`):t.set(`sub`,String(xt.subActionIndex)),Ge===`overview`?t.delete(`tab`):t.set(`tab`,Ge),t.toString()!==r.toString()&&i(t,{replace:!0})},[I,xt,Ge,J,r,i,D,c,Ie]),(0,Z.useEffect)(()=>{if(!Zn(I))return;let e=ee.current;if(!e)return;if(I.type===`step`&&!r.has(`step`)&&!r.has(`sub`)&&J[0]?.id===I.stepId){P.current=I.stepId;return}P.current=null;let t=I.type===`step`?`[data-step-id="${I.stepId}"]`:I.type===`execution`?`[data-execution-id="${I.logId}"]`:Xn(I)?`[data-sub-action-id="${I.stepId}-${I.subIndex}"]`:null;if(!t)return;let n=requestAnimationFrame(()=>{let n=e.querySelector(t);n&&Zu(e,n)});return()=>cancelAnimationFrame(n)},[I,J,r]);let dn=(0,Z.useCallback)(e=>{let t=new URLSearchParams(r);e===`all`?t.delete(`member`):t.set(`member`,e),i(t,{replace:!1})},[r,i]),fn=(0,Z.useCallback)((e,t)=>{let n=er(e,t);if(q.some(n=>n.member.testIndex===e&&n.steps.some(({step:e})=>e.stepIndex===t))){if(!J.some(e=>e.id===n)){let e=new URLSearchParams(r);e.delete(`member`),i(e,{replace:!1})}H({type:`step`,stepId:n})}},[q,J,r,i]),[pn,mn]=(0,Z.useState)(null),gn=(0,Z.useCallback)(e=>{requestAnimationFrame(()=>{let t=(ee.current??document).querySelector(`[data-step-id="${e}"]`),n=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;t?.scrollIntoView({block:`nearest`,behavior:n?`auto`:`smooth`})})},[]),_n=(0,Z.useCallback)(e=>{let t=er(e.testIndex,e.stepIndex);if(J.some(e=>e.id===t)){fn(e.testIndex,e.stepIndex),gn(t);return}if(!q.some(t=>t.member.testIndex===e.testIndex&&t.steps.some(({step:t})=>t.stepIndex===e.stepIndex)))return;let n=new URLSearchParams(r);n.delete(`member`),i(n,{replace:!1}),mn(t)},[J,q,fn,gn,r,i]);(0,Z.useEffect)(()=>{pn!==null&&J.some(e=>e.id===pn)&&(mn(null),H({type:`step`,stepId:pn}),gn(pn))},[pn,J,H,gn]);let vn=(0,Z.useMemo)(()=>({onSelect:_n,resolvable:e=>q.some(t=>t.member.testIndex===e.testIndex&&t.steps.some(({step:t})=>t.stepIndex===e.stepIndex)),testNames:q.length>1?new Map(q.map(({member:e})=>[e.testIndex,ie(e)])):new Map}),[q,_n]),yn=(0,Z.useCallback)(e=>{let t=new URLSearchParams(r);t.set(`member`,String(e)),i(t,{replace:!1})},[r,i]);return(0,Z.useEffect)(()=>{D||Zn(I)&&(J.some(e=>e.id===I.stepId)||H(J.length>0?{type:`step`,stepId:J[0].id}:null))},[J,I,D]),D?(0,Q.jsx)(Dt,{}):k||!o?(0,Q.jsx)(Yt,{icon:g,title:`Run not found`,description:`This test run doesn't exist or has been deleted`,actionLabel:`View All Runs`,onAction:()=>t(lt.runs)}):(0,Q.jsxs)(wt,{children:[Pe&&(0,Q.jsx)(Fu,{runId:o.id,sha:Pe,open:!0,onOpenChange:e=>{e||Fe(null)},returnFocus:Re.current}),(0,Q.jsxs)(`div`,{ref:w,className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,Q.jsx)(To,{run:o,tokens:c?.tokens,models:c?.models,shortcutsOpen:Oe,onToggleShortcuts:()=>ke(e=>!e),onOpenArtifacts:Xe,onCurationClick:()=>G(`knowledge`),onOpenVerdict:rt(o.status)===`fail`&&tt.size>0?nt:void 0,retrievalRung:Qt(we),feedbackEntry:ct.headerEntry,hasPostProcessing:!0,postProcessing:Se===void 0?void 0:On(Se)}),c&&Ku(c)&&(0,Q.jsx)(qu,{runId:o.id},o.id),(0,Q.jsxs)(qt,{groupRef:gt,orientation:ft===`stacked`?`vertical`:`horizontal`,className:`min-h-0 flex-1 overflow-hidden`,defaultLayout:dt?Gi(ft,T):void 0,children:[(0,Q.jsx)(Kt,{id:mt.tree,defaultSize:35,minSize:20,children:(0,Q.jsxs)(`div`,{ref:ee,className:`flex h-full min-h-0 min-w-0 flex-col overflow-y-auto`,children:[it?(0,Q.jsx)(`div`,{className:`border-b px-3 py-2 shrink-0`,children:(0,Q.jsxs)(ce,{value:Ze===`all`?`all`:String(Ze),onValueChange:dn,children:[(0,Q.jsx)(V,{className:`w-full h-8 text-xs`,"data-member-filter":!0,children:(0,Q.jsx)(B,{})}),(0,Q.jsxs)(oe,{children:[(0,Q.jsxs)(se,{value:`all`,children:[`All tests (`,q.length,`)`]}),q.map(({member:e})=>(0,Q.jsx)(se,{value:String(e.testIndex),children:ie(e)},e.testIndex))]})]})}):null,rt(o.status)===`fail`&&o.failureSummary&&(0,Q.jsx)(cc,{summary:o.failureSummary}),rt(o.status)===`fail`&&o.errorLog&&(0,Q.jsxs)(j,{className:`mx-2 mt-1`,children:[(0,Q.jsxs)(A,{className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors group w-full`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),(0,Q.jsx)(`span`,{children:`Error Details`})]}),(0,Q.jsx)(f,{children:(0,Q.jsx)(`pre`,{className:`mt-1 text-xs font-mono bg-muted/30 border border-border/50 rounded-[2px] px-3 py-2 overflow-x-auto whitespace-pre-wrap max-h-60 overflow-y-auto text-foreground/70 select-text`,children:o.errorLog})})]}),c===null?(0,Q.jsx)(`div`,{"data-run-detail-error":!0,className:`flex-1 flex items-center justify-center px-4 text-center text-sm text-muted-foreground`,children:F}):(0,Q.jsx)(ac,{groups:et,showMemberChrome:it,analysisView:tt,onCitedStep:fn,onSelectMember:yn,onCitedArtifact:Zt,selection:I,playhead:xt,onSelect:H,setupHooks:tn,teardownHooks:nn,inlineLogs:rn,feedback:c?ct.tree:void 0})]})},`tree`),(0,Q.jsx)(Jt,{withHandle:!0}),(0,Q.jsx)(Kt,{id:mt.evidence,defaultSize:65,minSize:30,"data-tour-id":`tour-run-detail-reasoning`,children:(0,Q.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,children:c===null?(0,Q.jsx)(`div`,{"data-run-detail-error":!0,className:`flex flex-1 items-center justify-center px-4 text-center text-sm text-muted-foreground`,children:F}):(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,Q.jsx)(iu,{timeline:(0,Q.jsx)(Hu,{model:Ot,mediaDurationsReady:Qe,playhead:xt,source:Lt,memberLabel:Ot.members.length>1?`All tests`:Ot.members[0]?.label,observedPosition:de,onPlayheadChange:ye,onSeekFraction:Ut}),activeTab:Ge,onTabChange:G,step:st,subAction:St,model:Et,playhead:xt,recording:At,frame:$t,clock:Iu(Ot,$e,Ct?.member.testIndex??-1),playerSource:Lt,onPlayerSourceChange:zt,onPlayheadChange:ye,seekFraction:re,seekRevision:le,onPlayheadObserved:X,onProgress:(e,t)=>fe(zu(Ot,e,t)),onRecordingEnded:Wt,autoPlay:ge===Ct?.member.testIndex,isTimelineKeyIgnored:Qu,runId:st?.rawRunId??o.id,allSteps:J,executionLogs:I?.type===`hook`&&an?[an]:I?.type===`execution`&&on?[on]:[],platform:o.platform,pipelineRef:N,knowledge:Je,knowledgeStepRefs:vn,onSelectStep:e=>H({type:`step`,stepId:e})})})})})},`evidence`),ct.composer===void 0?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Jt,{withHandle:!0}),(0,Q.jsx)(Kt,{id:mt.feedback,minSize:ft===`stacked`?`240px`:`320px`,maxSize:ft===`stacked`?void 0:`50%`,children:(0,Q.jsx)(ku,{...ct.composer,layout:ft})},`feedback`)]})]}),Ae?(0,Q.jsx)(ds,{run:o,open:Ae,tab:Me,response:U,loading:Be,error:Ve,onOpenChange:je,onTabChange:Ne,onRetry:K}):null]})]})}export{$u as default,Qu as isTimelineKeyIgnored};
@@ -0,0 +1 @@
1
+ import{Ar as e,Xt as t}from"./index-CXuVkD6-.js";import{t as n}from"./badge-B-yh3kbi.js";var r=t();function i({status:t}){let{label:i,...a}=e(t);return(0,r.jsx)(n,{...a,children:i})}export{i as t};
@@ -0,0 +1 @@
1
+ import{Kt as e}from"./index-CXuVkD6-.js";var t=e(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),n=e(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),r=[`passed`,`failed`,`healed`,`skipped`,`cancelled`],i=`did not run`;function a(){return{members:{},steps:[],handles:void 0,lastEnvelopeAt:void 0,lastSeq:0,verdict:void 0,terminal:!1,notices:[],gap:void 0}}function o(e){let t=e.status;return t!==void 0&&r.includes(t)?t:e.selfHealOccurred===!0?`healed`:e.verifierVerdict===void 0?`failed`:e.verifierVerdict.pass?`passed`:`failed`}function s(e,t,n){if(e.gap!==void 0)return e;let r=t+1,i=n-1;return i<r?e:{...e,gap:{from:r,to:i}}}function c(e,t){return e.members[t]??{testIndex:t,name:``,sawStepStarted:!1}}function l(e,t){return{...e.members,[t.testIndex]:t}}function u(e,t){let n=[...e],r=n.length;for(;r>0&&n[r-1].createdSeq>t.createdSeq;)--r;return n.splice(r,0,t),n}function d(e,t,n){let r=[...e];return r[t]=n,r}var f=(e,t,n)=>e.findIndex(e=>e.testIndex===t&&e.stepIndex===n);function p(e,t,n){let r={...e,lastEnvelopeAt:n,lastSeq:Math.max(e.lastSeq,t.seq)};if(e.terminal)return r;switch(t.type){case`runStarted`:{let e=t.payload;return{...r,handles:e.handles===void 0?void 0:[...e.handles]}}case`testStarted`:{let e=t.payload,n={...c(r,e.testIndex),testIndex:e.testIndex,name:e.name,totalSteps:e.totalSteps},i=e.stepTexts,a=e=>{if(!Array.isArray(i))return``;let t=i[e];return typeof t==`string`?t:``},o=r.steps;if(e.totalSteps!==void 0)for(let n=0;n<e.totalSteps;n+=1)f(o,e.testIndex,n)>=0||(o=u(o,{testIndex:e.testIndex,stepIndex:n,status:`pending`,text:a(n),ticks:0,createdSeq:t.seq}));return{...r,members:l(r,n),steps:o}}case`stepStarted`:{let e=t.payload,n={...c(r,e.testIndex),testIndex:e.testIndex,sawStepStarted:!0},i=f(r.steps,e.testIndex,e.stepIndex),a={testIndex:e.testIndex,stepIndex:e.stepIndex,status:`running`,text:e.stepText,startedAt:t.ts,ticks:0,lastTickAt:void 0,createdSeq:i>=0?r.steps[i].createdSeq:t.seq};return{...r,members:l(r,n),steps:i>=0?d(r.steps,i,a):u(r.steps,a)}}case`stepFinalized`:{let e=t.payload,n=o(e),i=f(r.steps,e.testIndex,e.stepIndex),a=r.retrievalRung??e.retrievalRung,s=a===void 0?{}:{retrievalRung:a};if(i<0)return{...r,...s,members:l(r,{...c(r,e.testIndex),testIndex:e.testIndex}),steps:u(r.steps,{testIndex:e.testIndex,stepIndex:e.stepIndex,status:n,text:``,ticks:0,durationMs:e.durationMs,createdSeq:t.seq})};let p=r.steps[i];return{...r,...s,steps:d(r.steps,i,{...p,status:n,durationMs:e.durationMs})}}case`subActionRecorded`:{let{testIndex:e,stepIndex:n}=t.payload,i=f(r.steps,e,n);if(i<0)return r;let a=r.steps[i];return{...r,steps:d(r.steps,i,{...a,ticks:a.ticks+1,lastTickAt:t.ts})}}case`testFinished`:{let e=t.payload,n=c(r,e.testIndex),a={...n,testIndex:e.testIndex,outcome:e.outcome,durationMs:e.durationMs,note:n.sawStepStarted?void 0:i},o=n.sawStepStarted?r.steps:r.steps.map(t=>t.testIndex===e.testIndex&&t.status===`pending`?{...t,status:`skipped`}:t);return{...r,members:l(r,a),steps:o}}case`testRetryScheduled`:{let e=t.payload;return{...r,members:l(r,{...c(r,e.testIndex),testIndex:e.testIndex,outcome:void 0,note:void 0}),steps:r.steps.map(t=>t.testIndex===e.testIndex?{...t,status:`pending`,ticks:0,lastTickAt:void 0,startedAt:void 0,durationMs:void 0}:t)}}case`verdict`:return r.verdict===void 0?{...r,verdict:t.payload.verdict}:r;case`runFinished`:return{...r,terminal:!0};case`runWarning`:case`runError`:{let e=t.payload;return{...r,notices:[...r.notices,{code:e.code,message:e.message}]}}default:return r}}export{n as a,p as i,a as n,t as o,s as r,i as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-CKc1J6oh.js";import{a as n,i as r,n as i,r as a,s as o,t as s}from"./select-JI5Kadjp.js";import{n as c,r as l}from"./shortcut-hints-_J-i7rAL.js";import{n as u}from"./split-button-BHdketN3.js";import{t as d}from"./plus-DNc2RueT.js";import{t as f}from"./trash-2-87f7wzeR.js";import{t as p}from"./checkbox-B5x0V2a2.js";import{n as m,r as h,t as g}from"./popover-DThBIgGA.js";import{i as _,r as v,t as y}from"./tabs-CsAJVEvt.js";import{A as b,B as x,Bn as ee,Cr as S,D as C,Fn as te,Ft as ne,H as re,Lt as ie,Mt as ae,O as w,Or as oe,R as se,Sc as ce,Sr as le,U as ue,Ut as de,V as fe,W as T,Wn as pe,Xt as E,_c as me,a as he,hn as ge,k as _e,pn as ve,pr as ye,sr as be,un as xe,wr as D,y as O,yc as k,z as A,zn as j}from"./index-CXuVkD6-.js";import{t as M}from"./use-page-title-fn79XYtf.js";import{t as N}from"./badge-B-yh3kbi.js";import{a as Se,i as P,n as Ce,o as F,r as I,t as we}from"./table-e38rtLis.js";import{n as L,t as R}from"./scroll-area-WFIgUp-0.js";import{t as Te}from"./empty-state-2mwYYmoQ.js";import{t as Ee}from"./use-keyboard-shortcuts-befVnBO6.js";import{i as De,n as Oe,r as ke,s as z,t as Ae}from"./batch-action-bar-MMUxALHz.js";import{n as je,t as Me}from"./use-selection-queue-BAssrkmC.js";var B=e(ce(),1),V=E();function H({startedAt:e}){let[t,n]=(0,B.useState)(()=>{let t=new Date(T(e)).getTime();return Math.max(0,Math.floor((Date.now()-t)/1e3))});return(0,B.useEffect)(()=>{let t=new Date(T(e)).getTime(),r=setInterval(()=>{n(Math.max(0,Math.floor((Date.now()-t)/1e3)))},1e3);return()=>clearInterval(r)},[e]),(0,V.jsxs)(`span`,{className:`text-blue-500 tabular-nums`,children:[Math.floor(t/60),`m `,t%60,`s`]})}var U={select:`44px`,status:`clamp(112px, 13cqw, 136px)`,target:`clamp(96px, 12cqw, 180px)`,attributes:`260px`,duration:`104px`,createdAt:`128px`},W=`@max-[1200px]/runs:hidden`,G=[`agent-qa.trigger`,`agent-qa.runner`],K=`agent-qa.gate-run`;function q(e){return e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1)}function J(e){return`${e.targetName?.trim()||`No target`} (${q(e.platform)})`}function Y(e){return e.suiteId!=null&&e.parentRunId==null}function Ne(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=new Map(G.map((e,t)=>[e,t]));return Object.entries(e??{}).filter(([,e])=>typeof e==`string`).sort(([e],[t])=>{let i=n.get(e),a=n.get(t);if(i!==void 0||a!==void 0)return(i??2**53-1)-(a??2**53-1);let o=r.get(e),s=r.get(t);return o!==void 0||s!==void 0?(o??2**53-1)-(s??2**53-1):e.localeCompare(t)})}function Pe({attributes:e,activeKeys:t}){let n=Ne(e,t).filter(([e])=>e!==K);if(n.length===0)return(0,V.jsx)(`span`,{className:`text-[12px] text-muted-foreground`,children:`No attributes`});let r=n.length>2?1:2,i=n.slice(0,r),a=n.length-i.length;return(0,V.jsxs)(C,{children:[(0,V.jsx)(b,{asChild:!0,children:(0,V.jsxs)(`div`,{className:`max-h-[38px] overflow-hidden text-[12px] leading-[18px]`,"aria-label":n.map(([e,t])=>`${e}=${t}`).join(`, `),children:[i.map(([e,t])=>(0,V.jsxs)(`div`,{className:`min-w-0 truncate font-mono`,children:[(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`=`]}),(0,V.jsx)(`span`,{className:`text-foreground`,children:t})]},e)),a>0?(0,V.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`+`,a,` more`]}):null]})}),(0,V.jsx)(w,{side:`top`,align:`start`,className:`max-w-[420px] p-2`,children:(0,V.jsx)(`div`,{className:`max-h-64 overflow-auto font-mono text-[11px] leading-5`,children:n.map(([e,t])=>(0,V.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-2`,children:[(0,V.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e}),(0,V.jsx)(`span`,{className:`truncate text-foreground`,children:t})]},e))})})]})}function Fe({run:e,className:t}){let n=J(e);return(0,V.jsxs)(C,{children:[(0,V.jsx)(b,{asChild:!0,children:(0,V.jsx)(`span`,{className:x(`block truncate text-[13px] leading-snug`,t),children:n})}),(0,V.jsx)(w,{side:`top`,align:`start`,children:n})]})}function Ie(e){return e.mode===`regex`?`${e.key} matches ${e.value}`:`${e.key} = ${e.value}`}function Le({predicates:e,onChange:t}){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(`exact`),[u,p]=(0,B.useState)(null),[_,v]=(0,B.useState)([]),[y,b]=(0,B.useState)([]);(0,B.useEffect)(()=>{if(!n)return;let e=!1;return j({q:i,limit:8}).then(t=>{e||v(t.keys)}).catch(()=>{e||v([])}),()=>{e=!0}},[i,n]),(0,B.useEffect)(()=>{if(!n||!i.trim()){b([]);return}let e=!1;return ee(i.trim(),{q:o,limit:8}).then(t=>{e||b(t.values)}).catch(()=>{e||b([])}),()=>{e=!0}},[i,n,o]);function S(){let n=i.trim(),r=o.trim();if(!n||!r){p(`Enter an attribute key and value, or remove this filter.`);return}if(c===`regex`)try{new RegExp(r)}catch{p(`Enter a valid regular expression.`);return}p(null);let u=e.filter(e=>e.key!==n);t?.([...u,{key:n,value:r,mode:c}]),a(``),s(``),l(`exact`)}function C(n){t?.(e.filter((e,t)=>t!==n))}return(0,V.jsxs)(g,{open:n,onOpenChange:r,children:[(0,V.jsx)(h,{asChild:!0,children:(0,V.jsxs)(A,{type:`button`,variant:e.length>0?`secondary`:`outline`,size:`sm`,"aria-label":`Filter by attributes`,className:`h-9 gap-2`,children:[(0,V.jsx)(ne,{className:`size-4`}),`Attributes`,e.length>0?` (${e.length})`:``]})}),(0,V.jsxs)(m,{align:`start`,className:`w-[380px] p-0`,children:[(0,V.jsx)(`div`,{className:`border-b px-3 py-2`,children:(0,V.jsx)(`h3`,{className:`text-sm font-medium`,children:`Filter by attributes`})}),(0,V.jsxs)(`div`,{className:`space-y-3 p-3`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`label`,{className:`text-[11px] font-medium text-muted-foreground`,htmlFor:`run-attribute-key`,children:`Key`}),(0,V.jsx)(se,{id:`run-attribute-key`,value:i,onChange:e=>{a(e.target.value),p(null)},placeholder:`git.branch`}),(0,V.jsx)(`div`,{className:`max-h-28 overflow-y-auto rounded border border-border/60`,children:_.length>0?_.map(e=>(0,V.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 px-2 py-1 text-left text-xs hover:bg-muted`,onClick:()=>a(e.key),children:[(0,V.jsx)(`span`,{className:`truncate font-mono`,children:e.key}),(0,V.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:e.count})]},e.key)):(0,V.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No attributes found`})})]}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`label`,{className:`text-[11px] font-medium text-muted-foreground`,htmlFor:`run-attribute-value`,children:`Value`}),(0,V.jsx)(se,{id:`run-attribute-value`,value:o,onChange:e=>{s(e.target.value),p(null)},placeholder:c===`regex`?`^(master|main)$`:`master`,"aria-describedby":u?`run-attribute-filter-error`:void 0}),(0,V.jsx)(`div`,{className:`max-h-28 overflow-y-auto rounded border border-border/60`,children:y.length>0?y.map(e=>(0,V.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 px-2 py-1 text-left text-xs hover:bg-muted`,onClick:()=>s(e.value),children:[(0,V.jsx)(`span`,{className:`truncate font-mono`,children:e.value}),(0,V.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:e.count})]},e.value)):(0,V.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No values found for this key`})})]})]}),(0,V.jsxs)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[(0,V.jsx)(`button`,{type:`button`,className:x(`rounded-[2px] px-2 py-1 text-xs`,c===`exact`?`bg-primary text-primary-foreground`:`text-muted-foreground`),"aria-pressed":c===`exact`,onClick:()=>l(`exact`),children:`Exact match`}),(0,V.jsx)(`button`,{type:`button`,className:x(`rounded-[2px] px-2 py-1 text-xs`,c===`regex`?`bg-primary text-primary-foreground`:`text-muted-foreground`),"aria-pressed":c===`regex`,onClick:()=>l(`regex`),children:`Regex`})]}),u?(0,V.jsx)(`p`,{id:`run-attribute-filter-error`,className:`text-xs text-destructive`,children:u}):null,(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(A,{type:`button`,size:`sm`,onClick:S,children:[(0,V.jsx)(d,{className:`size-4`}),`Apply filter`]}),(0,V.jsx)(A,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>t?.([]),disabled:e.length===0,children:`Clear attributes`})]}),e.length>0?(0,V.jsx)(`div`,{className:`space-y-1 border-t pt-3`,children:e.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 break-all font-mono`,children:Ie(e)}),(0,V.jsx)(A,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e.key} filter`,onClick:()=>C(t),children:(0,V.jsx)(f,{className:`size-3.5`})})]},`${e.key}-${e.mode}`))}):null]})]})]})}function X({status:e}){let t=S(e);return(0,V.jsx)(N,{className:D(t.tone),children:t.label})}function Re({column:e,label:n}){return(0,V.jsx)(`div`,{className:`flex justify-end`,children:(0,V.jsxs)(A,{type:`button`,variant:`ghost`,size:`xs`,"data-runs-sort-button":`compact`,className:`h-7 max-w-full shrink justify-end px-1.5 text-[12px] leading-none text-foreground/90`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[(0,V.jsx)(`span`,{className:`truncate`,children:n}),(0,V.jsx)(t,{})]})})}var Z=[{accessorKey:`status`,header:({column:e})=>(0,V.jsxs)(A,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Status`,(0,V.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{accessorKey:`name`,header:({column:e})=>(0,V.jsxs)(A,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Test Name`,(0,V.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{id:`target`,accessorFn:e=>`${e.targetName??`No target`} ${e.platform}`,header:({column:e})=>(0,V.jsxs)(A,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Target`,(0,V.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{id:`attributes`,accessorFn:e=>Object.entries(e.attributes??{}).map(([e,t])=>`${e}=${t}`).join(` `),header:`Attributes`},{accessorKey:`duration`,header:({column:e})=>(0,V.jsx)(Re,{column:e,label:`Duration`})},{accessorKey:`createdAt`,header:({column:e})=>(0,V.jsx)(Re,{column:e,label:`Started`})}];function ze(e){e.stopPropagation()}function Q(e){(e.key===`Enter`||e.key===` `)&&e.stopPropagation()}function Be(e,t){if(e.length===0)return!1;let n=e.filter(e=>t.has(e)).length;return n===0?!1:n===e.length?!0:`indeterminate`}function Ve(e){let t=U[e];if(t)return{width:t,minWidth:t}}function He(e){return x(`h-10 bg-background text-[13px] font-medium text-foreground/90`,e===`select`&&`w-11 px-2 text-center`,e===`status`&&`w-[clamp(112px,13cqw,136px)] px-3`,e===`name`&&`min-w-[280px] px-3`,e===`target`&&`w-[clamp(96px,12cqw,180px)] px-3`,e===`attributes`&&x(`w-[260px] px-3`,W),e===`duration`&&`w-[104px] px-3 text-right`,e===`createdAt`&&`w-[128px] px-3 text-right`)}function $(e,t){return x(`py-2 align-top`,e===`select`&&`w-11 px-2`,e===`status`&&`w-[clamp(112px,13cqw,136px)] px-3`,e===`name`&&x(`min-w-[280px] max-w-0 px-3`,t&&`pl-8`),e===`target`&&`w-[clamp(96px,12cqw,180px)] max-w-0 px-3 text-muted-foreground`,e===`attributes`&&x(`w-[260px] max-w-0 px-3`,W),e===`duration`&&`w-[104px] px-3 text-right tabular-nums`,e===`createdAt`&&`w-[128px] px-3 text-right tabular-nums`)}function Ue({isActive:e,isBatchSelected:t,isChild:n}){return x(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10`,n&&`bg-muted/[0.04]`,t&&!e&&`bg-muted/20`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function We(e,t){let n=[];for(let r of e)if(n.push({id:r.id,run:r,isChild:!1,parentId:null}),!(!Y(r)||!t.has(r.id)))for(let e of r.tests??[])n.push({id:e.id,run:e,isChild:!0,parentId:r.id});return n}function Ge(e,t){return e.length===t.length?e.every((e,n)=>{let r=t[n];return!!r&&e.id===r.id&&e.isChild===r.isChild&&e.parentId===r.parentId&&e.run===r.run}):!1}function Ke({runs:e,total:t,isLoading:c,page:l,onPageChange:u,onSearchChange:d,searchValue:f,selectedRunId:m=null,onSelectedRunIdChange:h,expandedSuites:g=new Set,onToggleSuite:_,onOpenRun:v,onVisibleRunsChange:y,platformFilter:x=``,onPlatformChange:ee,targetFilter:S=``,targetOptions:te=[],onTargetChange:ne,attributePredicates:ie=[],onAttributePredicatesChange:ae,sorting:ce,onSortingChange:le,headerActions:T,topSlot:pe,enableSelection:E=!1,selectedRunIds:me=new Set,onToggleRunSelection:he,onToggleVisibleSelection:ge}){let[ve,ye]=(0,B.useState)([]),be=ce??ve,xe=le??ye,D=ke({data:e,columns:[...E?[{id:`select`,header:({table:e})=>(0,V.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,V.jsx)(p,{checked:Be(e.getRowModel().rows.map(e=>e.original.id),me),onCheckedChange:t=>ge?.(e.getRowModel().rows.map(e=>e.original),t===!0),onClick:e=>e.stopPropagation(),"aria-label":`Select all`})}),enableSorting:!1}]:[],...Z],getRowId:e=>e.id,getCoreRowModel:De(),getSortedRowModel:z(),onSortingChange:xe,state:{sorting:be}}),O=D.getHeaderGroups(),k=D.getRowModel().rows,j=(0,B.useMemo)(()=>k.map(e=>e.original),[k]),M=(0,B.useMemo)(()=>We(j,g),[g,j]),Te=Math.ceil(t/50),Ee=l*50+1,Ae=Math.min((l+1)*50,t),je=Array.from(new Set([S,...te].filter(e=>!!e))),Me=[...E?[`select`]:[],`status`,`name`,`target`,`attributes`,`duration`,`createdAt`],U=(0,B.useMemo)(()=>ie.map(e=>e.key),[ie]),G=(0,B.useRef)([]);(0,B.useEffect)(()=>{y&&(Ge(G.current,M)||(G.current=M,y(M)))},[y,M]),(0,B.useEffect)(()=>{if(!m)return;let e=document.querySelector(`[data-runs-row-surface="${m}"]`);e&&document.activeElement!==e&&e.focus()},[m]);function q(e){return e.status===`running`&&e.startedAt?(0,V.jsx)(`span`,{className:`text-sm tabular-nums`,children:(0,V.jsx)(H,{startedAt:e.startedAt})}):e.status===`running`?(0,V.jsx)(`span`,{className:`text-sm text-blue-500`,children:`Starting...`}):(0,V.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:ue(e.duration)})}function J(e,t){h?.(e.id),v?.(e,t)}function Ne(e,t){t.key===`Enter`&&(t.preventDefault(),J(e,t))}return(0,V.jsx)(_e,{children:(0,V.jsxs)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col gap-4`,children:[(0,V.jsxs)(`div`,{className:`shrink-0 space-y-4`,children:[pe,(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(se,{placeholder:`Search runs...`,value:f,onChange:e=>d(e.target.value),className:`max-w-[220px]`}),ee&&(0,V.jsxs)(s,{value:x||`all`,onValueChange:e=>ee(e===`all`?``:e),children:[(0,V.jsx)(r,{className:`w-[140px]`,children:(0,V.jsx)(n,{placeholder:`All platforms`})}),(0,V.jsxs)(i,{children:[(0,V.jsx)(a,{value:`all`,children:`All platforms`}),(0,V.jsx)(a,{value:`web`,children:`Web`}),(0,V.jsx)(a,{value:`android`,children:`Android`}),(0,V.jsx)(a,{value:`ios`,children:`iOS`})]})]}),ne&&(0,V.jsxs)(s,{value:S||`all`,onValueChange:e=>ne(e===`all`?``:e),children:[(0,V.jsx)(r,{className:`w-[180px]`,children:(0,V.jsx)(n,{placeholder:`All targets`})}),(0,V.jsxs)(i,{children:[(0,V.jsx)(a,{value:`all`,children:`All targets`}),je.map(e=>(0,V.jsx)(a,{value:e,children:e},e))]})]}),ae&&(0,V.jsx)(Le,{predicates:ie,onChange:ae}),(0,V.jsx)(`div`,{className:`flex-1`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c&&(0,V.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading...`}),T]})]})]}),(0,V.jsxs)(R,{"data-tour-id":`tour-runs-table`,className:`@container/runs min-h-0 flex-1 rounded-md border`,children:[(0,V.jsxs)(we,{className:`min-w-full table-fixed`,children:[(0,V.jsx)(`colgroup`,{children:Me.map(e=>(0,V.jsx)(`col`,{style:Ve(e),className:e===`attributes`?W:void 0},e))}),(0,V.jsx)(Se,{children:O.map(e=>(0,V.jsx)(F,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,V.jsx)(P,{className:He(e.column.id),children:e.isPlaceholder?null:Oe(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,V.jsx)(Ce,{children:k.length?k.map(e=>{let t=e.original,n=Y(t),r=n&&g.has(t.id),i=t.tests??[],a=i.filter(e=>oe(e.status)===`pass`).length,s=m===t.id,c=me.has(t.id);return(0,V.jsxs)(B.Fragment,{children:[(0,V.jsxs)(F,{tabIndex:s?0:-1,"data-runs-row-surface":t.id,"data-active":String(s),"data-state":c?`selected`:void 0,"aria-selected":s,className:Ue({isActive:s,isBatchSelected:c,isChild:!1}),onClick:e=>J(t,e),onFocus:()=>h?.(t.id),onKeyDown:e=>Ne(t,e),children:[E&&(0,V.jsx)(I,{className:$(`select`,!1),onClick:e=>e.stopPropagation(),children:(0,V.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,V.jsx)(p,{checked:me.has(t.id),onCheckedChange:e=>he?.(t,e===!0),"aria-label":`Select row`})})}),(0,V.jsx)(I,{className:$(`status`,!1),children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(X,{status:t.status}),n&&i.length>0&&(0,V.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/80 tabular-nums`,children:[a,`/`,i.length]})]})}),(0,V.jsx)(I,{className:$(`name`,!1),children:(0,V.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[n&&(0,V.jsx)(`button`,{type:`button`,tabIndex:s?0:-1,className:`rounded p-0.5 hover:bg-muted`,onClick:e=>{ze(e),_?.(t.id)},onKeyDown:Q,children:r?(0,V.jsx)(o,{className:`h-4 w-4 text-muted-foreground`}):(0,V.jsx)(de,{className:`h-4 w-4 text-muted-foreground`})}),(0,V.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:t.name}),t.attributes?.[K]===`true`&&(0,V.jsxs)(C,{children:[(0,V.jsx)(b,{asChild:!0,children:(0,V.jsx)(N,{variant:`secondary`,"data-slot":`badge`,tabIndex:s?0:-1,className:`mt-0.5`,onKeyDown:Q,children:`Verify run`})}),(0,V.jsx)(w,{side:`top`,children:`Started by authoring verify. Not used for learning.`})]})]})}),(0,V.jsx)(I,{className:$(`target`,!1),children:(0,V.jsx)(Fe,{run:t,className:`text-muted-foreground/90`})}),(0,V.jsx)(I,{className:$(`attributes`,!1),children:(0,V.jsx)(Pe,{attributes:t.attributes,activeKeys:U})}),(0,V.jsx)(I,{className:$(`duration`,!1),children:q(t)}),(0,V.jsx)(I,{className:$(`createdAt`,!1),children:(0,V.jsxs)(C,{children:[(0,V.jsx)(b,{asChild:!0,children:(0,V.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:fe(t.createdAt)})}),(0,V.jsx)(w,{children:re(t.createdAt)})]})})]}),r&&i.map(t=>{let n=m===t.id;return(0,V.jsxs)(F,{tabIndex:n?0:-1,"data-runs-row-surface":t.id,"data-active":String(n),"aria-selected":n,className:Ue({isActive:n,isBatchSelected:!1,isChild:!0}),onClick:e=>J(t,e),onFocus:()=>h?.(t.id),onKeyDown:e=>Ne(t,e),children:[E&&(0,V.jsx)(I,{className:$(`select`,!0)}),(0,V.jsx)(I,{className:$(`status`,!0),children:(0,V.jsx)(X,{status:t.status})}),(0,V.jsx)(I,{className:$(`name`,!0),children:(0,V.jsx)(`span`,{className:`block whitespace-normal break-words text-sm leading-snug text-foreground/90`,children:t.name})}),(0,V.jsx)(I,{className:$(`target`,!0),children:(0,V.jsx)(Fe,{run:t,className:`text-muted-foreground`})}),(0,V.jsx)(I,{className:$(`attributes`,!0),children:(0,V.jsx)(Pe,{attributes:t.attributes,activeKeys:U})}),(0,V.jsx)(I,{className:$(`duration`,!0),children:q(t)}),(0,V.jsx)(I,{className:$(`createdAt`,!0),children:(0,V.jsxs)(C,{children:[(0,V.jsx)(b,{asChild:!0,children:(0,V.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:fe(t.createdAt)})}),(0,V.jsx)(w,{children:re(t.createdAt)})]})})]},`${e.id}-child-${t.id}`)})]},e.id)}):(0,V.jsx)(F,{children:(0,V.jsx)(I,{colSpan:Me.length,className:`h-24 text-center`,children:`No results.`})})})]}),(0,V.jsx)(L,{orientation:`horizontal`})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-1`,children:[(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t>0?`Showing ${Ee}-${Ae} of ${t}`:`No runs found`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>u(l-1),disabled:l===0,children:`Previous`}),(0,V.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>u(l+1),disabled:l>=Te-1||Te===0,children:`Next`})]})]})]})})}var qe=new Set([`all`,`running`,`queued`,`completed`,`failed`]),Je=new Set([`asc`,`desc`]);function Ye(e){if(!e)return 1;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>1?t:1}function Xe(e){let t=new URLSearchParams;e.tab!==`all`&&t.set(`tab`,e.tab),e.search&&t.set(`search`,e.search),e.platform&&t.set(`platform`,e.platform),e.target&&t.set(`target`,e.target);for(let n of e.attributePredicates){if(!n.key||!n.value)continue;let e=n.mode===`regex`?`attributes[${n.key}][regex]`:`attributes[${n.key}]`;t.set(e,n.value)}return e.sort&&(t.set(`sort`,e.sort),t.set(`order`,e.order)),e.page>1&&t.set(`page`,String(e.page)),t}function Ze(e){let t=[];for(let[n,r]of e.entries()){let e=/^attributes\[([^\]]+)\](?:\[(regex)\])?$/.exec(n);!e||!r||t.push({key:e[1],value:r,mode:e[2]===`regex`?`regex`:`exact`})}return t}function Qe(){let[e,t]=k(),n=e.get(`tab`),r=n&&qe.has(n)?n:`all`,i=e.get(`search`)??``,a=e.get(`platform`)??``,o=e.get(`target`)??``,s=(0,B.useMemo)(()=>Ze(e),[e]),c=e.get(`sort`)??``,l=e.get(`order`)??`desc`,u=Je.has(l)?l:`desc`,d=Ye(e.get(`page`)),f=(0,B.useMemo)(()=>c?[{id:c,desc:u===`desc`}]:[],[c,u]),p=(0,B.useRef)(f);p.current=f;let m=(0,B.useMemo)(()=>({tab:r,search:i,platform:a,target:o,attributePredicates:s,sort:c,order:u,page:d}),[r,i,a,o,s,c,u,d]);(0,B.useEffect)(()=>{let n=Xe(m);e.toString()!==n.toString()&&t(n,{replace:!0})},[e,t,m]);let h=(0,B.useCallback)((e,n)=>{let r={...m,...e};n?.resetPage&&(r.page=1),t(Xe(r),{replace:!0})},[t,m]);return{tab:r,search:i,platform:a,target:o,attributePredicates:s,sort:c,order:u,page:d,sorting:f,onSortingChange:(0,B.useCallback)(e=>{let t=typeof e==`function`?e(p.current):e;t.length>0?h({sort:t[0].id,order:t[0].desc?`desc`:`asc`}):h({sort:``,order:`desc`})},[h]),setTab:(0,B.useCallback)(e=>h({tab:e},{resetPage:!0}),[h]),setSearch:(0,B.useCallback)(e=>h({search:e},{resetPage:!0}),[h]),setPlatform:(0,B.useCallback)(e=>h({platform:e},{resetPage:!0}),[h]),setTarget:(0,B.useCallback)(e=>h({target:e},{resetPage:!0}),[h]),setAttributePredicates:(0,B.useCallback)(e=>h({attributePredicates:e},{resetPage:!0}),[h]),setPage:(0,B.useCallback)(e=>h({page:e}),[h])}}var $e=[],et={all:$e,running:[`running`],queued:[`pending`],completed:[`passed`,`healed`,`failed`,`timeout`,`cancelled`],failed:[`failed`,`timeout`]};function tt(e){return e.length===0||e.length===1&&e[0]===`running`}function nt(e,t){let n=e.trim().toLowerCase();if(!n)return!0;let r=t.runId.toLowerCase().includes(n),i=(t.testName??``).toLowerCase().includes(n);return r||i}function rt(){M(`Runs`);let e=me(),[t,n]=(0,B.useState)([]),[r,i]=(0,B.useState)(0),[a,o]=(0,B.useState)([]),[s,d]=(0,B.useState)(!0),{tab:f,search:p,platform:m,target:h,attributePredicates:g,page:x,sorting:ee,onSortingChange:S,setTab:ne,setSearch:re,setPlatform:oe,setTarget:se,setAttributePredicates:ce,setPage:ue}=Qe(),[de,fe]=(0,B.useState)(!1),[T,E]=(0,B.useState)(null),[D,k]=(0,B.useState)([]),[j,Se]=(0,B.useState)(()=>new Set),[P,Ce]=(0,B.useState)(null),[F,I]=(0,B.useState)(!1),[we,L]=(0,B.useState)(!1),[R,De]=(0,B.useState)(!0),{hasFarm:Oe,isLoading:ke}=u(),z=(0,B.useCallback)(async(e,t,r,a)=>{try{if(!tt(r)){n(e),i(t);return}let{executions:o}=await ge();if(o.length===0){n(e),i(t);return}let s=new Set(e.map(e=>e.id)),c=o.filter(e=>!s.has(e.runId)).filter(e=>nt(a,e)).map(e=>({id:e.runId,name:e.testName??`Running test...`,filePath:null,status:`running`,duration:e.duration,attributes:{},environment:null,metadata:null,startedAt:e.startedAt,endedAt:null,failureSummary:null,errorLog:null,memoryLog:null,testId:null,suiteId:null,platform:`web`,testFileContent:null,modelName:null,llmProvider:null,parentRunId:null,attemptNumber:1,retryCount:0,maxRetries:0,createdAt:e.startedAt}));n([...c,...e]),i(t+c.length)}catch{n(e),i(t)}},[]),H=(0,B.useCallback)(e=>({limit:50,offset:(e.page-1)*50,name:e.name||void 0,statuses:e.statuses.length>0?e.statuses:void 0,platform:e.platform||void 0,target:e.target||void 0,attributes:e.attributes}),[]),U=et[f]??$e,W=(0,B.useCallback)(async e=>{try{d(!0);let[t,n]=await Promise.all([pe(H(e)),te()]);Ce(n),o(t.targets??[]),await z(t.runs,t.total,e.statuses,e.name)}catch{O.error(`Failed to load runs`)}finally{d(!1),fe(!0)}},[z,H]),G=(0,B.useCallback)(async e=>{try{let[t,n]=await Promise.all([pe(H(e)),te()]);Ce(n),o(t.targets??[]),await z(t.runs,t.total,e.statuses,e.name)}catch{}},[z,H]),K=(0,B.useMemo)(()=>({page:x,name:p,statuses:U,platform:m,target:h,attributes:g}),[x,p,U,m,h,g]);(0,B.useEffect)(()=>{W(K)},[W,K]),(0,B.useEffect)(()=>{if(!de)return;let e=setInterval(()=>{G(K)},5e3);return()=>clearInterval(e)},[de,G,K]),(0,B.useEffect)(()=>{E(null),Se(new Set),k([])},[f,p,m,h,g,x]),(0,B.useEffect)(()=>{T&&(D.some(e=>e.id===T)||E(t.find(e=>e.tests?.some(e=>e.id===T))?.id??null))},[t,T,D]);let q=Me({items:t,getId:e=>e.id,visibleIds:t.map(e=>e.id)}),J=q.selectedIds,Y=q.selectedItems,Ne=(0,B.useCallback)(()=>{q.clearSelection(),L(!1),De(!0)},[q]),Pe=(0,B.useCallback)(async e=>{if(Y.length===0)return;let t=Y.flatMap(e=>e.filePath?[e.filePath]:[]);if(t.length===0){O.error(`No selected runs can be rerun`);return}I(!0);try{let n=await Promise.allSettled(t.map(t=>ye({file:t,local:e,noCache:!R}))),r=n.filter(e=>e.status===`fulfilled`).length,i=n.length-r;if(i>0){let e=ve(n);O.error(`${r} runs queued, ${i} failed${e===void 0?``:`. ${e}`}`)}else O.success(`${r} runs queued`);L(!1)}finally{I(!1)}},[Y,R]),Fe=(0,B.useCallback)(async()=>{if(Y.length===0)return;let e=Array.from(new Set(Y.flatMap(e=>e.filePath?[e.filePath]:[])));if(e.length===0){O.error(`No selected runs have file paths to purge`);return}I(!0);try{let t=await Promise.allSettled(e.map(e=>be({file:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.filter(e=>e.status===`fulfilled`).reduce((e,t)=>e+t.value.purged,0),i=t.length-n;i>0?O.error(`Purged ${r} plans from ${n} tests, ${i} failed`):O.success(`Purged ${r} cached plan${r===1?``:`s`} from ${n} test${n===1?``:`s`}`)}finally{I(!1)}},[Y]),Ie=(0,B.useCallback)(async()=>{if(Y.length!==0){I(!0);try{let e=await Promise.allSettled(Y.map(e=>xe(e.id))),t=Y.filter((t,n)=>e[n]?.status===`fulfilled`),r=new Set(e.flatMap(e=>e.status===`fulfilled`?e.value.deletedRunIds:[])),a=e.length-t.length;t.length>0&&(q.setItemsSelected(t,!1),n(e=>e.filter(e=>!r.has(e.id))),i(e=>Math.max(0,e-t.length)),L(!1)),a>0?O.error(`Deleted ${t.length} run${t.length===1?``:`s`}, ${a} failed`):O.success(`Deleted ${t.length} run${t.length===1?``:`s`}`)}finally{I(!1)}}},[Y,q]),Le=(0,B.useCallback)(e=>{Se(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),X=(0,B.useCallback)((t,n)=>{let r=le.runDetailOrLive(t.id,t.status);if(n?.metaKey||n?.ctrlKey||n?.button===1){window.open(r,`_blank`,`noopener,noreferrer`);return}e(r)},[e]),Re=(0,B.useCallback)((e,t)=>{X(e,t)},[X]),Z=(0,B.useMemo)(()=>D.findIndex(e=>e.id===T),[T,D]);Ee((0,B.useMemo)(()=>{let e=e=>{if(D.length!==0){if(Z===-1){E(e>0?D[0].id:D[D.length-1].id);return}E(D[Math.max(0,Math.min(Z+e,D.length-1))].id)}},t=()=>e(1),n=()=>e(-1);return{j:t,arrowdown:t,k:n,arrowup:n,enter:e=>{Z<0||X(D[Z].run,e)}}},[X,Z,D]));let ze=P?.running.count??0,Q=P?.pending.count??0,Be=Q>0||ze>0;if(!de)return(0,V.jsx)(he,{});let Ve=!!p||f!==`all`||!!m||!!h||g.length>0;if(t.length===0&&!Ve)return(0,V.jsx)(`div`,{"data-tour-id":`tour-runs-table`,children:(0,V.jsx)(Te,{icon:ie,title:`No test runs yet`,description:`Run your first test to see results here`,actionLabel:`View Tests`,onAction:()=>e(le.tests)})});let He=(0,V.jsx)(y,{value:f,onValueChange:ne,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(v,{variant:`line`,children:[(0,V.jsx)(_,{value:`all`,children:`All`}),(0,V.jsxs)(_,{value:`running`,children:[`Running`,ze>0&&(0,V.jsx)(N,{variant:`secondary`,className:`ml-1 px-1.5 text-xs`,children:ze})]}),(0,V.jsxs)(_,{value:`queued`,children:[`Queued`,Q>0&&(0,V.jsx)(N,{variant:`secondary`,className:`ml-1 px-1.5 text-xs`,children:Q})]}),(0,V.jsx)(_,{value:`completed`,children:`Completed`}),(0,V.jsx)(_,{value:`failed`,children:`Failed`})]}),Be&&P&&(0,V.jsxs)(N,{variant:`outline`,className:`text-xs`,children:[P.activeSlots,`/`,P.concurrency,` slots`]})]})});return(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4 overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3`,children:[(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Runs`}),(0,V.jsx)(_e,{children:(0,V.jsxs)(C,{children:[(0,V.jsx)(b,{asChild:!0,children:(0,V.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,V.jsx)(l,{className:`h-4 w-4`})})}),(0,V.jsx)(w,{side:`bottom`,className:`p-3`,children:(0,V.jsx)(c,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open run`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]})})]}),(0,V.jsx)(Ke,{topSlot:He,runs:t,total:r,isLoading:s,page:x-1,onPageChange:e=>ue(e+1),onSearchChange:re,searchValue:p,selectedRunId:T,onSelectedRunIdChange:E,expandedSuites:j,onToggleSuite:Le,onOpenRun:Re,onVisibleRunsChange:k,platformFilter:m,onPlatformChange:oe,targetFilter:h,targetOptions:a,onTargetChange:se,attributePredicates:g,onAttributePredicatesChange:ce,sorting:ee,onSortingChange:S,enableSelection:!0,selectedRunIds:q.selectedIdSet,onToggleRunSelection:q.setItemSelected,onToggleVisibleSelection:q.setItemsSelected}),(0,V.jsx)(Ae,{selectedCount:J.length,summaryMeta:q.hiddenCount>0?`${q.hiddenCount} hidden by filters`:void 0,secondaryIcon:(0,V.jsx)(ae,{className:`size-4`}),secondaryAriaLabel:`Clear queue`,onDelete:Ie,actionSlot:(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(je,{selectedCount:q.selectedCount,hiddenCount:q.hiddenCount,useCache:R,browserStackAvailable:!ke&&Oe,open:we,onOpenChange:L,onUseCacheChange:De,onRunLocal:()=>Pe(!0),onRunBrowserStack:()=>Pe(!1),disabled:F}),(0,V.jsx)(A,{variant:`outline`,size:`sm`,onClick:Fe,disabled:F,children:`Purge cache`})]}),onCancel:Ne,isRunning:F})]})}export{rt as default};
@@ -1 +1 @@
1
- import"./chunk-CilyBKbf.js";import{Er as e,U as t,en as n}from"./index-CWwAjH9Q.js";e();var r=n();function i({className:e,children:n,type:i,scrollHideDelay:a,...o}){return(0,r.jsx)(`div`,{"data-slot":`scroll-area`,className:t(`relative overflow-auto [scrollbar-width:thin]`,e),...o,children:(0,r.jsx)(`div`,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 [&>div]:!block`,children:n})})}function a({orientation:e=`vertical`,...t}){return null}export{a as n,i as t};
1
+ import"./chunk-CilyBKbf.js";import{B as e,Sc as t,Xt as n}from"./index-CXuVkD6-.js";t();var r=n();function i({className:t,children:n,type:i,scrollHideDelay:a,...o}){return(0,r.jsx)(`div`,{"data-slot":`scroll-area`,className:e(`relative overflow-auto [scrollbar-width:thin]`,t),...o,children:(0,r.jsx)(`div`,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 [&>div]:!block`,children:n})})}function a({orientation:e=`vertical`,...t}){return null}export{a as n,i as t};