@vostride/agent-qa-dashboard-ui 0.1.13 → 0.1.15

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 (98) hide show
  1. package/dist/assets/{arrow-up-down-DD6yziGv.js → arrow-up-down-CwmMJuHC.js} +1 -1
  2. package/dist/assets/{badge-CC1v3nk4.js → badge-D56AWxFv.js} +1 -1
  3. package/dist/assets/{batch-action-bar-D1IfTx55.js → batch-action-bar-DI05CPwy.js} +1 -1
  4. package/dist/assets/{circle-alert-CULfrrqE.js → circle-alert-RZI0g_tD.js} +1 -1
  5. package/dist/assets/{circle-x-B7AOkLOS.js → circle-x-CcGlHxRU.js} +1 -1
  6. package/dist/assets/config-BafxmOwJ.js +10 -0
  7. package/dist/assets/{copy-CEZJVgtu.js → copy-CWpai22Y.js} +1 -1
  8. package/dist/assets/{display-step-CO4k5dQA.js → display-step-nrAd20yH.js} +1 -1
  9. package/dist/assets/{dist-wK15YRiu.js → dist-CyWxUoCv.js} +1 -1
  10. package/dist/assets/{dist-DzF0KPMF.js → dist-DaacWHUX.js} +1 -1
  11. package/dist/assets/{dist-BJdB11cl.js → dist-itgTE_D5.js} +1 -1
  12. package/dist/assets/{empty-state-BfgY0UGA.js → empty-state-DEbHhF9f.js} +1 -1
  13. package/dist/assets/{external-link-DC-KkLmq.js → external-link-xaS9gsyo.js} +1 -1
  14. package/dist/assets/{eye-YQHiLgt4.js → eye-BmHDIr7J.js} +1 -1
  15. package/dist/assets/{file-code-BpwHxsqo.js → file-code-B22xRpxi.js} +1 -1
  16. package/dist/assets/{file-search-LR6NeRNh.js → file-search-CeDGqauF.js} +1 -1
  17. package/dist/assets/filename-validation-Dabe2ngK.js +1 -0
  18. package/dist/assets/{grip-vertical-KfzS75WH.js → grip-vertical-CJUfU7Zx.js} +1 -1
  19. package/dist/assets/{hook-editor-tcKRn_gP.js → hook-editor-CmPzPqnr.js} +1 -1
  20. package/dist/assets/{hook-runtime-CTRviwQE.js → hook-runtime-D7L2zX15.js} +1 -1
  21. package/dist/assets/{hook-viewer-eGadGjA0.js → hook-viewer-BvNgWI6w.js} +1 -1
  22. package/dist/assets/hooks-C1lVbVNu.js +1 -0
  23. package/dist/assets/{id-badge-BmmZdbHv.js → id-badge-DO71VWC9.js} +2 -2
  24. package/dist/assets/index-B5JVEaaS.css +2 -0
  25. package/dist/assets/index-C_HfATr4.js +57 -0
  26. package/dist/assets/{insights-C_tn8W_Q.js → insights-EjXDNx86.js} +1 -1
  27. package/dist/assets/{insights-line-grid-DKZyKGcI.js → insights-line-grid-CJdb529A.js} +6 -6
  28. package/dist/assets/{lib-B9z0w3j9.js → lib-hhwTCYTD.js} +1 -1
  29. package/dist/assets/live-run-CnQOMMWG.js +1 -0
  30. package/dist/assets/{memory-CdMqWelO.js → memory-BSLWD6RW.js} +1 -1
  31. package/dist/assets/memory-product-0B7_AV3X.js +2 -0
  32. package/dist/assets/{monaco-editor-DF4W-NC-.js → monaco-editor-BYBlJAjA.js} +2 -2
  33. package/dist/assets/{monaco-editor-inner-I81tD0qz.js → monaco-editor-inner-C0PbrlIr.js} +2 -2
  34. package/dist/assets/{monaco.contribution-CEeipeu9.js → monaco.contribution-Bq7keHQp.js} +2 -2
  35. package/dist/assets/{observation-block-DC5e2IE9.js → observation-block-DvMkTmgC.js} +1 -1
  36. package/dist/assets/observation-markdown-Bgcyet5t.js +1 -0
  37. package/dist/assets/{pencil-CZF_NGi6.js → pencil-Dga__f-A.js} +1 -1
  38. package/dist/assets/plus-BhWnvE6F.js +1 -0
  39. package/dist/assets/popover-Boe1excX.js +1 -0
  40. package/dist/assets/{refresh-cw-RAow1kax.js → refresh-cw-Dhidp9m2.js} +1 -1
  41. package/dist/assets/{resizable-B2X6KlcC.js → resizable-o8j3Lihm.js} +1 -1
  42. package/dist/assets/run-detail-CPo5ENE6.js +1 -0
  43. package/dist/assets/runs-CvH2p_Ks.js +1 -0
  44. package/dist/assets/{scroll-area-BmkJ1y7Q.js → scroll-area-B8cRs7wd.js} +1 -1
  45. package/dist/assets/select-BE8tKMJy.js +1 -0
  46. package/dist/assets/{shortcut-hints-CtwepXR1.js → shortcut-hints-BGIo5sip.js} +1 -1
  47. package/dist/assets/split-button-CcR2TDPY.js +1 -0
  48. package/dist/assets/square-8TpalBCd.js +1 -0
  49. package/dist/assets/{step-name-pills-VuIw2nNC.js → step-name-pills-0sDNmrmn.js} +1 -1
  50. package/dist/assets/suite-editor-BUzpsLUR.js +5 -0
  51. package/dist/assets/suite-navbar-COFDYHho.js +1 -0
  52. package/dist/assets/suite-viewer-B62crjkX.js +1 -0
  53. package/dist/assets/suites-vH7UvBPg.js +1 -0
  54. package/dist/assets/{switch-CPd0R3ri.js → switch-A6NW_YxI.js} +1 -1
  55. package/dist/assets/tab-console-BXF3HNpW.js +1 -0
  56. package/dist/assets/{table-QG2rKYu8.js → table-D4kdbpq8.js} +1 -1
  57. package/dist/assets/{tabs-DzjvuMEX.js → tabs-C3NqUdx9.js} +1 -1
  58. package/dist/assets/test-editor-BnD3gcCG.js +9 -0
  59. package/dist/assets/{test-navbar-C6-h4kbc.js → test-navbar-ZDxlwtJH.js} +2 -2
  60. package/dist/assets/{test-viewer-0SziRmsW.js → test-viewer-B-G8G6FH.js} +1 -1
  61. package/dist/assets/tests-BcPHa9Nc.js +1 -0
  62. package/dist/assets/{tests-suites-table-widths-D49Zcf1r.js → tests-suites-table-widths-CPWjMEBc.js} +1 -1
  63. package/dist/assets/{textarea-CVB6Do1_.js → textarea-87HpNno6.js} +1 -1
  64. package/dist/assets/{trash-2-BhJSaMLG.js → trash-2-sbLDCPlz.js} +1 -1
  65. package/dist/assets/{tsMode-TiV3uQ0t.js → tsMode-BHB8FsID.js} +1 -1
  66. package/dist/assets/use-hook-run-session-n1RKgcn6.js +1 -0
  67. package/dist/assets/{use-keyboard-shortcuts-Bal_Cx9w.js → use-keyboard-shortcuts-BM0qq0DE.js} +1 -1
  68. package/dist/assets/{use-page-title-B4YPyIzc.js → use-page-title-CyHzJAcR.js} +1 -1
  69. package/dist/assets/use-run-status-favicon-DTTz9_8q.js +1 -0
  70. package/dist/assets/{use-selection-queue-O7K3NZNK.js → use-selection-queue-CIpsCzay.js} +1 -1
  71. package/dist/assets/{viewer-url-state-ClEUZJMl.js → viewer-url-state-BgjmiiI7.js} +1 -1
  72. package/dist/assets/{zap-BYpQfhU4.js → zap-DwOV0Yov.js} +1 -1
  73. package/dist/index.html +2 -2
  74. package/package.json +2 -2
  75. package/dist/assets/config-a9DxCBoP.js +0 -10
  76. package/dist/assets/filename-validation-S8QXnNdt.js +0 -1
  77. package/dist/assets/hooks-BM--ZgFe.js +0 -1
  78. package/dist/assets/index-B4FdO6Vk.js +0 -57
  79. package/dist/assets/index-DzWZqTlZ.css +0 -2
  80. package/dist/assets/live-run-EmcKA5cK.js +0 -1
  81. package/dist/assets/memory-product-f5AfXXJn.js +0 -2
  82. package/dist/assets/observation-markdown-DyWjt-yP.js +0 -1
  83. package/dist/assets/plus-Qf7V331e.js +0 -1
  84. package/dist/assets/popover-DwYq4QYF.js +0 -1
  85. package/dist/assets/run-detail-DZ-1orHT.js +0 -1
  86. package/dist/assets/runs-CTOIdEAQ.js +0 -1
  87. package/dist/assets/select-D5oFJNaq.js +0 -1
  88. package/dist/assets/split-button-wGcE-JDx.js +0 -1
  89. package/dist/assets/square-CgFZz_zK.js +0 -1
  90. package/dist/assets/suite-editor-DLu7OCZy.js +0 -5
  91. package/dist/assets/suite-navbar-B8gZoPMT.js +0 -1
  92. package/dist/assets/suite-viewer-CPBPmJdG.js +0 -1
  93. package/dist/assets/suites-wRKqOnN6.js +0 -1
  94. package/dist/assets/tab-console-BORDNFzI.js +0 -1
  95. package/dist/assets/test-editor-BoaHOuai.js +0 -9
  96. package/dist/assets/tests-OLyMTO9C.js +0 -1
  97. package/dist/assets/use-hook-run-session-DH_86Jtn.js +0 -1
  98. package/dist/assets/use-run-status-favicon-Rjqwuxhd.js +0 -1
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l}from"./use-run-status-favicon-Rjqwuxhd.js";import{c as u,d,f as ee,l as f,s as p}from"./tab-console-BORDNFzI.js";import{i as te,n as ne,o as re,s as ie,t as ae,u as m}from"./select-D5oFJNaq.js";import{t as oe}from"./circle-alert-CULfrrqE.js";import{t as se}from"./copy-CEZJVgtu.js";import{t as h}from"./external-link-DC-KkLmq.js";import{t as ce}from"./file-search-LR6NeRNh.js";import{n as g,r as le}from"./shortcut-hints-CtwepXR1.js";import{t as ue}from"./use-page-title-B4YPyIzc.js";import{n as de,r as fe,t as pe}from"./popover-DwYq4QYF.js";import{t as me}from"./scroll-area-BmkJ1y7Q.js";import{i as he,n as ge,r as _e,t as ve}from"./tabs-DzjvuMEX.js";import{$ as ye,$n as _,At as be,Bt as xe,Ft as Se,I as Ce,It as we,Jn as v,L as Te,Lt as Ee,Mt as y,Nn as De,Nt as Oe,Pt as b,Q as ke,Qn as Ae,Rt as x,St as je,U as Me,Ut as S,Wn as C,Wt as w,cr as Ne,jt as T,lr as Pe,n as Fe,nr as Ie,pr as Le,qt as E,tr as D,ur as Re,zt as O}from"./index-B4FdO6Vk.js";import{t as k}from"./badge-CC1v3nk4.js";import{n as ze,r as Be,t as Ve}from"./resizable-B2X6KlcC.js";import{t as He}from"./empty-state-BfgY0UGA.js";import{t as Ue}from"./use-keyboard-shortcuts-Bal_Cx9w.js";import{t as A}from"./format-BpI4TiHn.js";import{i as We,n as Ge}from"./display-step-CO4k5dQA.js";var Ke=v(`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`}]]),qe=v(`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`}]]),Je=v(`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`}]]),Ye=v(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),j=e(Le(),1),M=Ae();function Xe({status:e}){switch(e){case`passed`:return(0,M.jsx)(k,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,M.jsx)(k,{variant:`destructive`,children:`Failed`});case`healed`:return(0,M.jsx)(k,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,M.jsx)(k,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`skipped`:return(0,M.jsx)(k,{variant:`secondary`,children:`Skipped`});case`cancelled`:return(0,M.jsx)(k,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,M.jsx)(k,{variant:`outline`,children:e})}}function Ze({run:e,steps:t,shortcutsOpen:n,onToggleShortcuts:a,onOpenArtifacts:o}){let s=Ne(),c=t.reduce((e,t)=>e+(t.totalTokens??0),0),l=t.reduce((e,t)=>e+(t.promptTokens??0),0),u=t.reduce((e,t)=>e+(t.completionTokens??0),0),f=e.suiteId!=null&&e.parentRunId==null,p=f&&e.suiteId?_.suiteView(e.suiteId):e.testId?_.testView(e.testId):null,te=f&&e.suiteId?`Open suite`:`Open test`,ne=r(e.id,e.videoPath),re=e.metadata?.farmSessionUrl;return(0,M.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center justify-between border-b px-4 min-w-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,M.jsx)(`button`,{onClick:()=>s(_.runs),className:`text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:`Runs`}),(0,M.jsx)(C,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,M.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e.name}),p?(0,M.jsx)(`a`,{href:p,target:`_blank`,rel:`noopener noreferrer`,"aria-label":te,className:`shrink-0 text-muted-foreground transition-colors hover:text-foreground`,children:(0,M.jsx)(i,{className:`h-3.5 w-3.5`})}):null,(0,M.jsx)(Xe,{status:e.status})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[e.modelName&&(0,M.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,M.jsx)(ee,{className:`h-3.5 w-3.5`}),e.modelName]}),c>0&&(0,M.jsxs)(T,{children:[(0,M.jsx)(b,{asChild:!0,children:(0,M.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1 cursor-default`,children:[(0,M.jsx)(Ke,{className:`h-3.5 w-3.5`}),A(l),` / `,A(u)]})}),(0,M.jsx)(y,{children:`Prompt tokens / Completion tokens`})]}),(0,M.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,M.jsx)(d,{className:`h-3.5 w-3.5`}),E(e.duration)]}),(0,M.jsx)(`div`,{className:`h-4 w-px bg-border`}),(0,M.jsxs)(T,{children:[(0,M.jsx)(b,{asChild:!0,children:(0,M.jsx)(S,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run artifacts`,onClick:()=>o?.(`attributes`),children:(0,M.jsx)(qe,{className:`h-3.5 w-3.5`})})}),(0,M.jsx)(y,{children:`Run details (I/C/M)`})]}),(0,M.jsxs)(pe,{open:n,onOpenChange:e=>{e!==n&&a()},children:[(0,M.jsxs)(T,{children:[(0,M.jsx)(b,{asChild:!0,children:(0,M.jsx)(fe,{asChild:!0,children:(0,M.jsx)(S,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,M.jsx)(le,{className:`h-3.5 w-3.5`})})})}),(0,M.jsx)(y,{children:`Shortcuts (Shift+?)`})]}),(0,M.jsx)(de,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Navigation`}),(0,M.jsx)(g,{hints:[{key:`↑ / K`,label:`Previous item`},{key:`↓ / J`,label:`Next item`},{key:`Shift+↑`,label:`Previous step`},{key:`Shift+↓`,label:`Next step`}]})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Tabs`}),(0,M.jsx)(g,{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`}]})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Screenshots`}),(0,M.jsx)(g,{hints:[{key:`B`,label:`Before screenshot`},{key:`A`,label:`After screenshot`}]})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Phases`}),(0,M.jsx)(g,{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,M.jsxs)(`div`,{children:[(0,M.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,M.jsx)(g,{hints:[{key:`I`,label:`Details: Attributes`},{key:`C`,label:`Artifacts: Config`},{key:`M`,label:`Artifacts: Memory`},{key:`R`,label:`Re-run`},{key:`V`,label:`Video`},{key:`Shift+?`,label:`Shortcuts`},{key:`Esc`,label:`Close`}]})]})]})})]}),(0,M.jsxs)(T,{children:[(0,M.jsx)(b,{asChild:!0,children:(0,M.jsx)(S,{variant:`ghost`,size:`icon-sm`,"aria-label":`Re-run`,onClick:()=>{let t=e.attributes[`agent-qa.runner`]===`local`;je({file:e.filePath??e.name,local:t}).then(e=>{be.success(`Re-run started`),s(_.runLive(e.runId))}).catch(()=>be.error(`Failed to start re-run`))},children:(0,M.jsx)(Je,{className:`h-3.5 w-3.5`})})}),(0,M.jsx)(y,{children:`Re-run (R)`})]}),ne&&(0,M.jsxs)(T,{children:[(0,M.jsx)(b,{asChild:!0,children:(0,M.jsx)(`a`,{href:ne,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open recording`,children:(0,M.jsx)(S,{variant:`ghost`,size:`icon-sm`,children:(0,M.jsx)(Ye,{className:`h-3.5 w-3.5`})})})}),(0,M.jsx)(y,{children:`Recording (V)`})]}),re&&(0,M.jsxs)(T,{children:[(0,M.jsx)(b,{asChild:!0,children:(0,M.jsx)(`a`,{href:re,target:`_blank`,rel:`noopener noreferrer`,children:(0,M.jsx)(S,{variant:`ghost`,size:`icon-sm`,children:(0,M.jsx)(h,{className:`h-3.5 w-3.5`})})})}),(0,M.jsx)(y,{children:`BrowserStack`})]})]})]})}function N(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function P(e){return Array.isArray(e)}function F(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`}`:N(e)?`${Object.keys(e).length} ${Object.keys(e).length===1?`field`:`fields`}`:String(e)}function Qe({section:e}){return(0,M.jsxs)(`div`,{className:`rounded-[2px] border border-border px-4 py-4 text-sm text-muted-foreground`,children:[e,` was not captured for this run.`]})}function I({title:e,badges:t=[],children:n,className:r}){return(0,M.jsxs)(`section`,{className:w(`rounded-[2px] border border-border bg-transparent`,r),children:[(0,M.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 border-b px-4 py-3`,children:[(0,M.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-semibold text-foreground`,children:e}),t.map(e=>(0,M.jsx)(k,{variant:`outline`,className:`text-[10px]`,children:e},e))]}),(0,M.jsx)(`div`,{className:`space-y-3 px-4 py-4`,children:n})]})}function L({rows:e}){return(0,M.jsx)(`div`,{className:`divide-y divide-border/50`,children:e.map(e=>(0,M.jsxs)(`div`,{className:`grid gap-1 py-1.5 text-xs sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3`,children:[(0,M.jsx)(`dt`,{className:`font-medium text-muted-foreground`,children:e.label}),(0,M.jsx)(`dd`,{className:w(`min-w-0 break-words text-foreground`,e.mono&&`break-all font-mono`),children:e.value})]},e.label))})}function $e({value:e}){return(0,M.jsx)(`span`,{className:w(`break-words`,(e==null||typeof e==`boolean`||typeof e==`number`)&&`font-mono text-[11px]`,e==null?`text-muted-foreground`:`text-foreground`),children:F(e)})}function R({value:e,label:t=`root`,level:n=0}){if(P(e))return(0,M.jsxs)(p,{children:[(0,M.jsxs)(f,{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,M.jsx)(C,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,M.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:t}),(0,M.jsxs)(`span`,{className:`font-mono text-[11px] text-foreground`,children:[e.length,` `,e.length===1?`item`:`items`]})]}),(0,M.jsx)(u,{children:(0,M.jsx)(`div`,{className:`ml-3 border-l border-border pl-3`,children:e.length===0?(0,M.jsx)(`div`,{className:`py-1.5 text-xs text-muted-foreground`,children:`None`}):e.map((e,r)=>(0,M.jsx)(R,{label:`${r}`,value:e,level:n+1},`${t}-${r}`))})})]});if(N(e)){let r=Object.entries(e);return(0,M.jsxs)(p,{defaultOpen:n===0,children:[(0,M.jsxs)(f,{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,M.jsx)(C,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,M.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:t}),(0,M.jsxs)(`span`,{className:`font-mono text-[11px] text-foreground`,children:[r.length,` `,r.length===1?`field`:`fields`]})]}),(0,M.jsx)(u,{children:(0,M.jsx)(`div`,{className:`ml-3 border-l border-border pl-3`,children:r.length===0?(0,M.jsx)(`div`,{className:`py-1.5 text-xs text-muted-foreground`,children:`None`}):r.map(([e,t])=>(0,M.jsx)(R,{label:e,value:t,level:n+1},e))})})]})}return(0,M.jsxs)(`div`,{className:`grid gap-1 py-1.5 text-xs sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3`,children:[(0,M.jsx)(`span`,{className:`min-w-0 break-words font-medium text-muted-foreground`,children:t}),(0,M.jsx)($e,{value:e})]})}function et({label:e,content:t}){return t?(0,M.jsxs)(p,{children:[(0,M.jsxs)(f,{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,M.jsx)(C,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),e]}),(0,M.jsx)(u,{children:(0,M.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 z(e,t){return e?e[t]:void 0}function B(e,t){let n=z(e,t);return typeof n==`string`&&n.length>0?n:null}function V(e,t){let n=z(e,t);return N(n)?n:null}function H(e,t){let n=z(e,t);return P(n)?n:[]}function tt(e){return N(e)&&[B(e,`code`),B(e,`phase`),B(e,`message`)].filter(Boolean).join(` - `)||null}function nt(e){let t=B(e,`kind`);return t===`test`||t===`suite`?t:`unknown`}function U(e,t){let n=B(e,`childRunId`);if(n)return n;let r=B(e,`testId`),i=B(e,`name`);return t.children.find(({run:e})=>!!(r&&e.testId===r||i&&e.name===i))?.run.id??null}function W({config:e}){let t=V(e,`envFile`),n=V(e,`secretsFile`),r=H(e,`hooks`),i=V(e,`model`),a=B(n,`path`),o=B(n,`status`),s=typeof z(n,`count`)==`number`?z(n,`count`):null;return(0,M.jsx)(L,{rows:[{label:`Raw config`,value:B(e,`rawConfigContent`)?`Captured`:`Not captured`},{label:`Env file`,value:F(B(t,`path`))},{label:`Secrets file`,value:n?(0,M.jsxs)(`span`,{className:`inline-flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,M.jsx)(`span`,{className:`break-all font-mono text-xs`,children:F(a)}),o?(0,M.jsx)(k,{variant:`outline`,className:`text-[10px]`,children:o}):null,s===null?null:(0,M.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s,` secret`,s===1?``:`s`]})]}):`Not captured`},{label:`CLI vars`,value:F(Object.keys(V(e,`cliVars`)??{}).length),mono:!0},{label:`Inline vars`,value:F(Object.keys(V(e,`inlineVars`)??{}).length),mono:!0},{label:`Hooks`,value:F(r.length),mono:!0},{label:`Model`,value:i?(0,M.jsx)(R,{label:`model`,value:i}):`Not captured`}]})}function rt({source:e}){let t=nt(e),n=tt(z(e,`error`));return(0,M.jsx)(L,{rows:[{label:`Kind`,value:t,mono:!0},{label:`Name`,value:F(B(e,`name`))},{label:t===`suite`?`Suite ID`:`Test ID`,value:F(B(e,t===`suite`?`suiteId`:`testId`)),mono:!0},{label:`Path`,value:F(B(e,`filePath`)),mono:!0},{label:`Load status`,value:F(B(e,`loadStatus`)),mono:!0},{label:`Error`,value:n??`None`}]})}function it({source:e,response:t}){let n=H(e,`members`).filter(N).sort((e,t)=>(typeof e.index==`number`?e.index:0)-(typeof t.index==`number`?t.index:0));return n.length===0?null:(0,M.jsx)(I,{title:`Suite Members`,badges:[`${n.length} members`],children:(0,M.jsx)(`div`,{className:`space-y-3`,children:n.map(e=>{let n=V(e,`ref`),r=typeof e.index==`number`?e.index:0,i=U(e,t),a=tt(z(e,`error`));return(0,M.jsxs)(`div`,{"data-suite-member-index":r,className:`rounded-[2px] border border-border p-3`,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,M.jsxs)(k,{variant:`outline`,className:`text-[10px]`,children:[`#`,r+1]}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-sm font-medium`,children:B(e,`name`)??B(n,`test`)??`Unnamed member`}),(0,M.jsx)(k,{variant:`outline`,className:`text-[10px]`,children:F(B(e,`loadStatus`))})]}),(0,M.jsx)(L,{rows:[{label:`Test ID`,value:F(B(e,`testId`)),mono:!0},{label:`Ref`,value:F(B(n,`test`)),mono:!0},{label:`Ref ID`,value:F(B(n,`id`)),mono:!0},{label:`Path`,value:F(B(e,`filePath`)),mono:!0},{label:`Target`,value:F(B(e,`target`))},{label:`Child run`,value:i?(0,M.jsx)(`a`,{className:`break-all text-primary hover:underline`,href:_.runDetail(i),children:i}):`Not captured`,mono:!!i},{label:`Error`,value:a??`None`}]}),(0,M.jsxs)(p,{children:[(0,M.jsxs)(f,{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,M.jsx)(C,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),`Member snapshots`]}),(0,M.jsxs)(u,{className:`mt-2 space-y-2`,children:[(0,M.jsx)(et,{label:`Raw member YAML`,content:B(e,`rawYaml`)}),z(e,`resolvedDefinition`)===void 0?null:(0,M.jsx)(R,{label:`resolvedDefinition`,value:z(e,`resolvedDefinition`)})]})]})]},`${r}-${B(e,`testId`)??B(n,`test`)??`member`}`)})})})}function G({response:e}){let t=e.artifact,n=t?.payload??{schemaVersion:1},r=N(n)?n:{schemaVersion:1},i=V(r,`config`),a=V(r,`source`),o=V(r,`runtime`),s=H(r,`errors`),c=new Set(e.missingSections),l=nt(a);return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(I,{title:`Run Summary`,badges:[t?.kind??`unknown`],children:(0,M.jsx)(L,{rows:[{label:`Run`,value:e.run.name},{label:`Run ID`,value:e.run.id,mono:!0},{label:`Artifact kind`,value:t?.kind??`unknown`,mono:!0},{label:`Schema version`,value:t?.schemaVersion??r.schemaVersion??`Not captured`,mono:!0},{label:`Finalized`,value:t?.finalizedAt??`Not finalized`,mono:!0},{label:`Test ID`,value:F(e.run.testId),mono:!0},{label:`Suite ID`,value:F(e.run.suiteId),mono:!0},{label:`Platform`,value:F(e.run.platform)},{label:`Target`,value:F(e.run.targetName)}]})}),(0,M.jsx)(I,{title:`Global Config`,children:c.has(`config`)||!i?(0,M.jsx)(Qe,{section:`Config`}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(W,{config:i}),z(i,`parsedConfig`)===void 0?null:(0,M.jsx)(R,{label:`parsedConfig`,value:z(i,`parsedConfig`)}),(0,M.jsx)(et,{label:`Raw global config`,content:B(i,`rawConfigContent`)})]})}),(0,M.jsx)(I,{title:`Effective Config`,children:c.has(`config`)||!i?(0,M.jsx)(Qe,{section:`Config`}):(0,M.jsx)(R,{label:`effectiveConfig`,value:z(i,`effectiveConfig`)})}),(0,M.jsx)(I,{title:`Source Snapshot`,badges:[l],children:c.has(`source`)||!a?(0,M.jsx)(Qe,{section:`Source`}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(rt,{source:a}),(0,M.jsx)(et,{label:l===`suite`?`Raw suite YAML`:`Raw test YAML`,content:B(a,`rawYaml`)}),z(a,`resolvedDefinition`)===void 0?null:(0,M.jsx)(R,{label:`resolvedDefinition`,value:z(a,`resolvedDefinition`)})]})}),a?(0,M.jsx)(it,{source:a,response:e}):null,o||s.length>0?(0,M.jsxs)(I,{title:`Runtime and Errors`,badges:s.length>0?[`${s.length} errors`]:[],children:[o?(0,M.jsx)(R,{label:`runtime`,value:o}):null,s.length>0?(0,M.jsx)(`div`,{className:`space-y-2`,children:s.map((e,t)=>(0,M.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-3 text-sm`,children:tt(e)??JSON.stringify(e)},t))}):null]}):null]})}var at=[{action:`add`,title:`Added`,className:`border-emerald-500/20 bg-emerald-500/5 text-emerald-500`,railClassName:`border-l-emerald-500/80`,surfaceClassName:`bg-emerald-500/[0.04]`},{action:`confirm`,title:`Updated/Confirmed`,className:`border-blue-500/20 bg-blue-500/5 text-blue-500`,railClassName:`border-l-blue-500/80`,surfaceClassName:`bg-blue-500/[0.04]`},{action:`deprecate`,title:`Deprecated`,className:`border-amber-500/25 bg-amber-500/5 text-amber-500`,railClassName:`border-l-amber-500/80`,surfaceClassName:`bg-amber-500/[0.04]`},{action:`delete`,title:`Deleted`,className:`border-red-500/20 bg-red-500/5 text-red-500`,railClassName:`border-l-red-500/80`,surfaceClassName:`bg-red-500/[0.04]`}];function K(e,t){return e?e[t]:void 0}function q(e,t){let n=K(e,t);return typeof n==`string`&&n.length>0?n:null}function J(e,t){let n=K(e,t);return typeof n==`number`&&Number.isFinite(n)?n:null}function Y(e){if(!N(e))return null;let t=q(e,`id`),n=q(e,`title`),r=q(e,`content`),i=J(e,`trust`),a=J(e,`confirmed_count`),o=J(e,`contradicted_count`);return!t||!n||!r||i===null||a===null||o===null?null:{id:t,title:n,content:r,trust:i,last_confirmed:q(e,`last_confirmed`)??`Not captured`,confirmed_count:a,contradicted_count:o,source_test:q(e,`source_test`)??`Not captured`}}function ot(e){if(!N(e))return null;let t=q(e,`action`);if(t!==`add`&&t!==`confirm`&&t!==`deprecate`&&t!==`delete`)return null;let n=q(e,`tier`);return n!==`products`&&n!==`suites`&&n!==`tests`?null:{action:t,tier:n,scope:q(e,`scope`)??`unknown`,observationId:q(e,`observationId`)??Y(K(e,`after`))?.id??Y(K(e,`before`))?.id??`unknown`,reasoning:q(e,`reasoning`)??`No curator reasoning captured.`,before:Y(K(e,`before`)),after:Y(K(e,`after`)),error:q(e,`error`)??void 0}}function st(e){return N(e)?[`added`,`confirmed`,`deprecated`,`deleted`,`deltas`,`errors`,`curatorDuration`,`tokenUsage`].some(t=>t in e):!1}function ct(e){let t=e?.payload;if(!N(t))return null;let n=K(t,`memory`);if(!N(n))return null;let r=K(n,`log`);return st(r)?r:null}function X(e){if(!e)return null;try{let t=JSON.parse(e);return st(t)?t:null}catch{return null}}function Z(e){let t=[];for(let n of e.children){let e=ct(n.artifact);if(e){t.push(e);continue}let r=X(n.run.memoryLog);r&&t.push(r)}return t}function Q(e,t){return e.reduce((e,n)=>e+(J(n,t)??0),0)}function lt(e){let t=!1,n={promptTokens:0,completionTokens:0,totalTokens:0};for(let r of e){let e=K(r,`tokenUsage`);N(e)&&(t=!0,n.promptTokens+=J(e,`promptTokens`)??0,n.completionTokens+=J(e,`completionTokens`)??0,n.totalTokens+=J(e,`totalTokens`)??0)}return t?n:void 0}function ut(e){if(e.length===0)return null;let t=e.flatMap(e=>{let t=K(e,`deltas`);return P(t)?t:[]}),n=e.flatMap(e=>{let t=K(e,`errors`);return P(t)?t:[]}),r={added:Q(e,`added`),confirmed:Q(e,`confirmed`),deprecated:Q(e,`deprecated`),deleted:Q(e,`deleted`),errors:n,curatorDuration:Q(e,`curatorDuration`),deltas:t},i=lt(e);return i&&(r.tokenUsage=i),r}function dt(e){let t=ct(e.artifact);if(t)return t;let n=Z(e);return n.length>0?ut(n):X(e.run.memoryLog)}function ft(e){let t=K(e,`deltas`);return P(t)?t.map(ot).filter(e=>!!e):[]}function pt(e){return Object.fromEntries(at.map(t=>[t.action,e.filter(e=>e.action===t.action)]))}function mt(e,t,n){return J(e,t===`confirm`?`confirmed`:t===`add`?`added`:t===`deprecate`?`deprecated`:`deleted`)??n}function ht(e,t){if(e==null||t==null)return null;let n=Math.round((t-e)*1e3)/1e3;return n===0?`0`:n>0?`+${n}`:String(n)}function gt(e,t){return!e||!t?[]:[`title`,`content`,`trust`,`confirmed_count`,`contradicted_count`,`last_confirmed`,`source_test`].filter(n=>e[n]!==t[n])}function _t({log:e,counts:t}){let n=K(e,`tokenUsage`),r=J(e,`curatorDuration`),i=N(n)?J(n,`promptTokens`):null,a=N(n)?J(n,`completionTokens`):null,o=N(n)?J(n,`totalTokens`):null;return(0,M.jsxs)(`section`,{className:`rounded-[2px] border border-border/60 bg-muted/20 px-3 py-3`,children:[(0,M.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:at.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:e.title}),(0,M.jsx)(`div`,{className:`mt-1 font-mono text-lg text-foreground`,children:t[e.action]})]},e.action))}),(0,M.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-3 border-t border-border/40 pt-2 text-xs text-muted-foreground`,children:[(0,M.jsxs)(`span`,{children:[`Curator duration: `,r==null?`Not captured`:E(r)]}),(0,M.jsxs)(`span`,{children:[`Tokens: `,o==null?`Not captured`:`${A(i??0)} / ${A(a??0)} / ${A(o)}`]})]})]})}function vt({label:e,observation:t}){return t?(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(`div`,{className:`text-[11px] font-semibold text-muted-foreground`,children:e}),(0,M.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,M.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`Title `,(0,M.jsx)(`span`,{className:`text-foreground`,children:t.title})]}),(0,M.jsxs)(`span`,{className:`font-mono`,children:[`Trust `,t.trust]}),(0,M.jsxs)(`span`,{className:`font-mono`,children:[`Confirmed `,t.confirmed_count]}),(0,M.jsxs)(`span`,{className:`font-mono`,children:[`Contradicted `,t.contradicted_count]}),(0,M.jsxs)(`span`,{className:`min-w-0 break-all font-mono`,children:[`ID `,t.id]}),(0,M.jsxs)(`span`,{className:`min-w-0 break-all font-mono`,children:[`Source `,t.source_test]}),(0,M.jsxs)(`span`,{className:`font-mono`,children:[`Last `,t.last_confirmed]})]}),(0,M.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm leading-6 text-foreground`,children:t.content})]}):null}function yt({delta:e,group:t}){let n=e.after?.title??e.before?.title??e.observationId,r=ht(e.before?.trust,e.after?.trust),i=ht(e.before?.confirmed_count,e.after?.confirmed_count),a=ht(e.before?.contradicted_count,e.after?.contradicted_count),o=gt(e.before,e.after);return(0,M.jsx)(p,{children:(0,M.jsxs)(`div`,{className:w(`border-y border-l-2 border-border/55 px-4 py-3`,t.railClassName,t.surfaceClassName),children:[(0,M.jsxs)(f,{className:`group flex w-full min-w-0 items-start gap-2 text-left`,children:[(0,M.jsx)(C,{className:`mt-1 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,M.jsx)(`h4`,{className:`min-w-0 flex-1 break-words text-sm font-medium text-foreground`,children:n}),(0,M.jsx)(k,{variant:`outline`,className:w(`text-[10px]`,t.className),children:at.find(t=>t.action===e.action)?.title??e.action}),(0,M.jsxs)(k,{variant:`outline`,className:`max-w-full whitespace-normal break-all text-left text-[10px]`,children:[e.tier,`/`,e.scope]})]}),(0,M.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-2 font-mono text-[11px] text-muted-foreground`,children:[(0,M.jsx)(`span`,{className:`break-all`,children:e.observationId}),r?(0,M.jsxs)(`span`,{children:[`trust `,r]}):null,i?(0,M.jsxs)(`span`,{children:[`confirmed `,i]}):null,a?(0,M.jsxs)(`span`,{children:[`contradicted `,a]}):null]}),(0,M.jsx)(`p`,{className:`mt-2 line-clamp-2 break-words text-xs text-muted-foreground`,children:e.reasoning})]})]}),(0,M.jsxs)(u,{className:`mt-3 space-y-3`,children:[o.length>0?(0,M.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Changed fields: `,(0,M.jsx)(`span`,{className:`font-mono text-foreground`,children:o.join(`, `)})]}):(0,M.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Changed fields: None captured`}),e.error?(0,M.jsxs)(`div`,{className:`text-xs text-red-500`,children:[`Error: `,e.error]}):null,e.action===`add`?(0,M.jsx)(vt,{label:`After`,observation:e.after}):e.action===`delete`?(0,M.jsx)(vt,{label:`Before`,observation:e.before}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(vt,{label:`Before`,observation:e.before}),(0,M.jsx)(vt,{label:`After`,observation:e.after})]})]})]})})}function bt({response:e}){let t=dt(e);if(!t)return(0,M.jsx)(`div`,{className:`rounded-[2px] border border-border px-4 py-4 text-sm text-muted-foreground`,children:`Memory was not captured for this run.`});let n=pt(ft(t)),r={add:mt(t,`add`,n.add.length),confirm:mt(t,`confirm`,n.confirm.length),deprecate:mt(t,`deprecate`,n.deprecate.length),delete:mt(t,`delete`,n.delete.length)},i=r.add+r.confirm+r.deprecate+r.delete;return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(_t,{log:t,counts:r}),i===0?(0,M.jsxs)(`div`,{className:`rounded-[2px] border border-border px-4 py-4`,children:[(0,M.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`No memory changes`}),(0,M.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Memory completed without adding, updating, deprecating, or deleting observations.`})]}):null,at.map(e=>{let t=n[e.action];return(0,M.jsxs)(`section`,{className:`scroll-mt-4 space-y-3`,children:[(0,M.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 px-1`,children:[(0,M.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-semibold text-foreground`,children:e.title}),(0,M.jsxs)(k,{variant:`outline`,className:`text-[10px]`,children:[r[e.action],` changes`]})]}),(0,M.jsx)(`div`,{"data-memory-group":e.title,className:`space-y-3`,children:t.length===0?(0,M.jsxs)(`div`,{className:`px-1 text-sm text-muted-foreground`,children:[`No `,e.title.toLowerCase(),` changes.`]}):t.map(t=>(0,M.jsx)(yt,{delta:t,group:e},`${t.action}-${t.observationId}`))})]},e.action)}),P(K(t,`errors`))&&K(t,`errors`).length>0?(0,M.jsxs)(`section`,{className:`space-y-3`,children:[(0,M.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 px-1`,children:[(0,M.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-semibold text-foreground`,children:`Memory Errors`}),(0,M.jsxs)(k,{variant:`outline`,className:`text-[10px]`,children:[K(t,`errors`).length,` errors`]})]}),(0,M.jsx)(`div`,{className:`space-y-2`,children:K(t,`errors`).map((e,t)=>(0,M.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-3 text-sm text-red-500`,children:F(e)},t))})]}):null]})}function xt(){return(0,M.jsxs)(`div`,{className:`space-y-4`,"aria-label":`Loading artifact data`,children:[(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading artifact data...`}),[0,1,2].map(e=>(0,M.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,M.jsx)(Se,{className:`h-4 w-40`}),(0,M.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,M.jsx)(Se,{className:`h-3 w-full`}),(0,M.jsx)(Se,{className:`h-3 w-5/6`}),(0,M.jsx)(Se,{className:`h-3 w-3/5`})]})]},e))]})}function St({error:e,onRetry:t}){return(0,M.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-4`,children:(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,M.jsx)(oe,{className:`mt-0.5 h-4 w-4 shrink-0 text-red-500`}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Could not load artifact data`}),(0,M.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,M.jsx)(`p`,{className:`mt-2 break-words font-mono text-xs text-red-500`,children:e}),(0,M.jsx)(S,{className:`mt-3`,size:`sm`,variant:`outline`,onClick:t,children:`Retry`})]})]})})}function Ct(){return(0,M.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,M.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Artifact data is not available for this run`}),(0,M.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`This run does not have a persisted artifact record.`})]})}function wt(e,t){if(!e||typeof e!=`object`||Array.isArray(e))return null;let n=e[t];return n&&typeof n==`object`&&!Array.isArray(n)?n:null}function Tt(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 Et(e){let t=Tt(e.run.attributes);if(Object.keys(t).length>0)return t;let n=e.artifact?.payload;return Tt(wt(wt(n,`metadata`),`attributes`))}function Dt(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 Ot(e){navigator.clipboard?.writeText(e)}function kt({response:e}){let t=Dt(Et(e));return t.length===0?(0,M.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,M.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`No run attributes`}),(0,M.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`This run did not record any attributes.`})]}):(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsx)(`div`,{className:`flex justify-end`,children:(0,M.jsxs)(S,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>Ot(JSON.stringify(Object.fromEntries(t),null,2)),children:[(0,M.jsx)(se,{className:`size-4`}),`Copy JSON`]})}),(0,M.jsx)(`div`,{className:`overflow-hidden rounded-[2px] border border-border`,children:(0,M.jsx)(`table`,{className:`w-full table-fixed text-sm`,children:(0,M.jsx)(`tbody`,{children:t.map(([e,t])=>(0,M.jsxs)(`tr`,{className:`border-b border-border/70 last:border-b-0`,children:[(0,M.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,M.jsx)(`td`,{className:`align-top px-3 py-2`,children:(0,M.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,M.jsx)(`span`,{className:`min-w-0 flex-1 break-all font-mono text-xs text-foreground`,children:t}),(0,M.jsx)(S,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Copy ${e} value`,title:`Copy value`,onClick:()=>Ot(t),children:(0,M.jsx)(se,{className:`size-3.5`})})]})})]},e))})})})]})}function At({tab:e,response:t}){return e===`attributes`?(0,M.jsx)(kt,{response:t}):e===`config`?(0,M.jsx)(G,{response:t}):(0,M.jsx)(bt,{response:t})}function jt({tab:e,response:t,loading:n,error:r,onRetry:i}){return n?(0,M.jsx)(xt,{}):r?(0,M.jsx)(St,{error:r,onRetry:i}):!t||e!==`attributes`&&!t.artifact?(0,M.jsx)(Ct,{}):(0,M.jsx)(At,{tab:e,response:t})}function Mt({run:e,open:t,tab:n,response:r,loading:i,error:a,onOpenChange:o,onTabChange:s,onRetry:c}){let l=r?.artifact??null,u=e.name||`Run ${e.id}`;return(0,M.jsx)(we,{open:t,onOpenChange:o,children:(0,M.jsxs)(Ee,{side:`right`,className:`w-[min(820px,92vw)] sm:max-w-none gap-0 overflow-hidden p-0`,children:[(0,M.jsxs)(O,{className:`border-b px-4 py-3 pr-12`,children:[(0,M.jsx)(xe,{className:`text-base leading-snug`,children:`Run details`}),(0,M.jsx)(x,{className:`truncate text-xs`,children:u}),(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1 text-xs text-muted-foreground`,children:[(0,M.jsx)(`span`,{className:`break-all font-mono`,children:e.id}),l?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(k,{variant:`outline`,className:`text-[10px]`,children:l.kind}),(0,M.jsxs)(k,{variant:`outline`,className:`text-[10px]`,children:[`schema `,l.schemaVersion]}),(0,M.jsx)(k,{variant:`outline`,className:w(`text-[10px]`,l.finalizedAt?`border-emerald-500/20 text-emerald-500`:`border-amber-500/25 text-amber-500`),children:l.finalizedAt?`finalized`:`open`})]}):null]})]}),(0,M.jsxs)(ve,{value:n,onValueChange:e=>s(e),className:`min-h-0 flex-1 overflow-hidden`,children:[(0,M.jsx)(`div`,{className:`border-b px-3`,children:(0,M.jsxs)(_e,{variant:`line`,className:`h-9 w-full justify-start`,children:[(0,M.jsx)(he,{value:`attributes`,className:`max-w-32 flex-none`,children:`Attributes`}),(0,M.jsx)(he,{value:`config`,className:`max-w-32 flex-none`,children:`Config`}),(0,M.jsx)(he,{value:`memory`,className:`max-w-32 flex-none`,children:`Memory`})]})}),(0,M.jsxs)(me,{className:`min-h-0 flex-1`,children:[(0,M.jsx)(ge,{value:`attributes`,className:`m-0 px-4 py-4`,children:(0,M.jsx)(jt,{tab:`attributes`,response:r,loading:i,error:a,onRetry:c})}),(0,M.jsx)(ge,{value:`config`,className:`m-0 px-4 py-4`,children:(0,M.jsx)(jt,{tab:`config`,response:r,loading:i,error:a,onRetry:c})}),(0,M.jsx)(ge,{value:`memory`,className:`m-0 px-4 py-4`,children:(0,M.jsx)(jt,{tab:`memory`,response:r,loading:i,error:a,onRetry:c})})]})]})]})})}function Nt({status:e}){let t=D(e);return(0,M.jsx)(k,{className:Ie(t.tone),children:t.label})}function Pt(e,t){let n=e.split(/\s+/);return n.length<=t?{truncated:e,isTruncated:!1}:{truncated:n.slice(0,t).join(` `)+`...`,isTruncated:!0}}function Ft({summary:e}){let[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)(!1),{truncated:a,isTruncated:o}=Pt(e,20);return(0,M.jsx)(`div`,{className:`mx-2 mt-2 rounded-[2px] border border-red-500/20 bg-red-500/5 px-3 py-2 shrink-0`,children:(0,M.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,M.jsx)(oe,{className:`h-4 w-4 text-red-400 shrink-0 mt-0.5`}),(0,M.jsx)(`span`,{className:`flex-1 text-sm text-foreground/80 select-text`,children:t?e:a}),(0,M.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3)},className:`shrink-0 mt-0.5 p-0.5 rounded-sm hover:bg-red-500/10 transition-colors`,title:`Copy failure summary`,children:r?(0,M.jsx)(m,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,M.jsx)(se,{className:`h-3.5 w-3.5 text-muted-foreground`})}),o&&(0,M.jsx)(`button`,{onClick:()=>n(e=>!e),className:`shrink-0 mt-0.5 p-0.5 rounded-sm hover:bg-red-500/10 transition-colors`,children:(0,M.jsx)(C,{className:w(`h-3.5 w-3.5 text-muted-foreground transition-transform`,t&&`rotate-90`)})})]})})}function It(e,t){let n=new Map(t.map((e,t)=>[e.id,t]));return[...e].sort((e,t)=>{let r=n.get(e.runId)??0,i=n.get(t.runId)??0;return r===i?e.stepOrder-t.stepOrder:r-i})}function Lt(e){return e?.suiteId!=null&&e.parentRunId==null}function $(e,t,n,r){return We((r&&n===`all`&&t.length>0?It(e,t):[...e].sort((e,t)=>e.stepOrder-t.stepOrder)).map(Ge))}function Rt(e,t,n){let r=t.get(`step`),i=t.get(`run`),a=t.get(`sub`);if(r){let t=Number.parseInt(r,10),o=e.find(e=>e.rawStepOrder===t?n&&i?e.rawRunId===i:!0:!1);if(o)return a==null?{type:`step`,stepId:o.id}:{type:`subaction`,stepId:o.id,subIndex:Number.parseInt(a,10)}}return e.length>0?{type:`step`,stepId:e[0].id}:null}function zt(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 Bt(){let{id:e}=Pe(),i=Ne(),[d,ee]=Re(),[m,oe]=(0,j.useState)(null);ue(m?`Run - ${m.name}`:`Run`),a(l(m?.status));let[se,h]=(0,j.useState)([]),[g,le]=(0,j.useState)([]),[de,fe]=(0,j.useState)(null),[pe,me]=(0,j.useState)(!0),[he,ge]=(0,j.useState)(!1),[_e,ve]=(0,j.useState)(!1),[xe,Se]=(0,j.useState)(1),we=(0,j.useRef)(null),v=(0,j.useRef)(null),Ee=(0,j.useRef)(null),y=(0,j.useRef)(null),[b,Ae]=(0,j.useState)([]),[x,T]=(0,j.useState)(`all`),[Ie,Le]=(0,j.useState)([]),[E,D]=(0,j.useState)(null),[O,k]=(0,j.useState)([]),[We,Ge]=(0,j.useState)(null),[Ke,qe]=(0,j.useState)(!1),[Je,Ye]=(0,j.useState)(null),[Xe,N]=(0,j.useState)(!1),[P,F]=(0,j.useState)(`attributes`),[Qe,I]=(0,j.useState)(null),[L,$e]=(0,j.useState)(!1),[R,et]=(0,j.useState)(null),z=(0,j.useRef)(null),B=(0,j.useRef)(0),[V,H]=(0,j.useState)(()=>{let e=d.get(`tab`);return e===`screenshot`?`overview`:e??`overview`});(0,j.useEffect)(()=>{if(!e)return;y.current=null;let t=!1,n=0;async function r(){try{let{executions:n}=await Te();if(t)return;if(n.some(t=>t.runId===e)){i(_.runLive(e),{replace:!0});return}}catch{}try{let n=await ke(e);if(t)return;if(oe(n.run),Lt(n.run)&&n.tests&&n.tests.length>0){Ae(n.tests),T(`all`);let e=[];for(let r of n.tests)try{let n=await ke(r.id);if(t)return;e.push(...n.steps)}catch{}Le(e),h(e),D(Rt($(e,n.tests,`all`,!0),d,!0))}else{h(n.steps);let e=n.attempts??[];if(le(e),e.length>0){let n=e[e.length-1];fe(n.id);let r=await ke(n.id);t||(h(r.steps),D(Rt($(r.steps,[],``,!1),d,!1)))}else D(Rt($(n.steps,[],``,!1),d,!1))}}catch(e){if(t)return;if(e instanceof Error&&e.message.includes(`404`)){if(n<5){n++,setTimeout(()=>{t||r()},1e3);return}ge(!0)}else be.error(`Failed to load run`)}finally{t||me(!1)}}return r(),()=>{t=!0}},[e,i]),(0,j.useEffect)(()=>{if(!e||pe)return;let t=!1;return Me(e).then(({logs:e})=>{t||k(e)}).catch(()=>{}),()=>{t=!0}},[e,pe]),(0,j.useEffect)(()=>{z.current=null,B.current+=1,I(null),et(null),$e(!1)},[m?.id]);let tt=(0,j.useCallback)(async()=>{if(!m?.id)return;let e=B.current+1;B.current=e,$e(!0),et(null);try{let t=await ye(m.id);if(B.current!==e)return;z.current=m.id,I(t)}catch(t){if(B.current!==e)return;et(t instanceof Error?t.message:`Failed to load artifact data`)}finally{B.current===e&&$e(!1)}},[m?.id]);(0,j.useEffect)(()=>{!Xe||!m?.id||L||R||z.current===m.id&&Qe||tt()},[Xe,R,L,Qe,tt,m?.id]);let nt=(0,j.useCallback)(e=>{F(e),N(!0)},[]),U=(0,j.useMemo)(()=>$(se,b,x,Lt(m)),[se,b,x,m]),W=(0,j.useMemo)(()=>o(E)?U.find(e=>e.id===E.stepId)??null:null,[E,U]),rt=W?.rawRunId??m?.id??null;(0,j.useEffect)(()=>{if(!rt){Ge(null);return}Ge(null);let e=!1;return Ce(rt).then(t=>{e||Ge(t)}).catch(()=>{e||Ge(null)}),()=>{e=!0}},[rt]);let it=(0,j.useMemo)(()=>!c(E)||!W?null:W.subActionsData?.[E.subIndex]??null,[E,W]),G=(0,j.useMemo)(()=>{if(!W)return null;if(it){let e=it.screenshotBeforePath??null,t=it.screenshotAfterPath??null;return!e&&!t?null:{key:[W.id,`sub`,it.index,e??``,t??``].join(`|`),beforePath:e,afterPath:t}}let e=W.screenshotBeforePath,t=W.screenshotPath;return!e&&!t?null:{key:[W.id,`step`,e??``,t??``].join(`|`),beforePath:e,afterPath:t}},[W,it]),at=G&&Je?.key===G.key?Je.side:void 0,K=o(E)?E.stepId:null,q=(0,j.useMemo)(()=>O.filter(e=>e.stepId===null&&e.phase===`setup`),[O]),J=(0,j.useMemo)(()=>O.filter(e=>e.stepId===null&&e.phase===`teardown`),[O]),Y=(0,j.useMemo)(()=>O.filter(e=>e.stepId!==null),[O]),ot=(0,j.useMemo)(()=>W?Y.filter(e=>e.stepId===W.id?!0:!e.stepId||W.rawRunId&&e.runId&&W.rawRunId!==e.runId?!1:Number.parseInt(e.stepId,10)===W.rawStepOrder):[],[Y,W]),st=(0,j.useMemo)(()=>E?.type===`hook`?O.find(e=>e.id===E.hookId)??null:null,[E,O]),ct=(0,j.useMemo)(()=>E?.type===`execution`?O.find(e=>e.id===E.logId)??null:null,[E,O]),X=(0,j.useMemo)(()=>{let e=[],t=Lt(m)&&x===`all`&&b.length>0,n=t?new Set(b.map(e=>e.id)):null;for(let t of q)(!n||!n.has(t.runId))&&e.push({type:`hook`,logId:t.id});if(t){let t=new Map;for(let e of U){let n=e.rawRunId??e.id,r=t.get(n)??[];r.push(e),t.set(n,r)}for(let[n,r]of t){for(let t of q)t.runId===n&&e.push({type:`hook`,logId:t.id});for(let t of r)if(e.push({type:`step`,stepId:t.id}),t.id===K){let n=Y.filter(e=>e.stepId===t.id?!0:!e.stepId||t.rawRunId&&e.runId&&t.rawRunId!==e.runId?!1:Number.parseInt(e.stepId,10)===t.rawStepOrder);for(let r of n)e.push({type:`exec`,stepId:t.id,logId:r.id});t.subActionsData&&t.subActionsData.forEach((n,r)=>{e.push({type:`sub`,stepId:t.id,subIndex:r})})}for(let t of J)t.runId===n&&e.push({type:`hook`,logId:t.id})}}else for(let t of U)if(e.push({type:`step`,stepId:t.id}),t.id===K){let n=Y.filter(e=>e.stepId===t.id?!0:!e.stepId||t.rawRunId&&e.runId&&t.rawRunId!==e.runId?!1:Number.parseInt(e.stepId,10)===t.rawStepOrder);for(let r of n)e.push({type:`exec`,stepId:t.id,logId:r.id});t.subActionsData&&t.subActionsData.forEach((n,r)=>{e.push({type:`sub`,stepId:t.id,subIndex:r})})}for(let t of J)(!n||!n.has(t.runId))&&e.push({type:`hook`,logId:t.id});return e},[U,K,Y,q,J,m,x,b]),Z=(0,j.useMemo)(()=>E?X.findIndex(e=>E.type===`hook`&&e.type===`hook`?e.logId===E.hookId:E.type===`step`&&e.type===`step`?e.stepId===E.stepId:E.type===`subaction`&&e.type===`sub`?e.stepId===E.stepId&&e.subIndex===E.subIndex:E.type===`execution`&&e.type===`exec`?e.logId===E.logId:!1):-1,[X,E]);function Q(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}}let lt=[`overview`,`env`,`network`,`console`,`aria`,`a11y`],ut=(0,j.useCallback)(e=>{V===`overview`&&G&&(e===`before`?G.beforePath:G.afterPath)&&Ye({key:G.key,side:e})},[V,G]);Ue((0,j.useMemo)(()=>{let e={arrowdown:()=>{X.length!==0&&D(Q(Z===-1?X[0]:X[Math.min(Z+1,X.length-1)]))},arrowup:()=>{X.length!==0&&D(Q(Z===-1?X[X.length-1]:X[Math.max(Z-1,0)]))},j:()=>{e.arrowdown({})},k:()=>{e.arrowup({})},"shift+arrowdown":()=>{if(X.length===0)return;let e=X.findIndex((e,t)=>t>Z&&e.type===`step`);e!==-1&&D(Q(X[e]))},"shift+arrowup":()=>{if(X.length===0)return;let e=-1;for(let t=Z-1;t>=0;t--)if(X[t].type===`step`){e=t;break}e!==-1&&D(Q(X[e]))},1:()=>H(lt[0]),2:()=>H(lt[1]),3:()=>H(lt[2]),4:()=>H(lt[3]),5:()=>H(lt[4]),6:()=>H(lt[5]),a:()=>ut(`after`),b:()=>ut(`before`),i:()=>nt(`attributes`),c:()=>nt(`config`),m:()=>nt(`memory`),r:()=>{if(!m)return;let e=m.attributes[`agent-qa.runner`]===`local`;je({file:m.filePath??m.name,local:e}).then(e=>{be.success(`Re-run started`),i(_.runLive(e.runId))}).catch(()=>be.error(`Failed to start re-run`))},escape:()=>{Xe?N(!1):_e?ve(!1):D(null)},v:()=>{m?.videoPath&&ve(!0)},"shift+?":()=>qe(e=>!e),"shift+!":()=>v.current?.togglePhase(0),"shift+@":()=>v.current?.togglePhase(1),"shift+#":()=>v.current?.togglePhase(2),"shift+$":()=>v.current?.togglePhase(3)};return e},[X,Z,E,m,i,Xe,_e,v,ut,nt])),(0,j.useEffect)(()=>{let e=o(E)?U.find(e=>e.id===E.stepId):null,t=e?.rawStepOrder,n=e?.rawRunId;ee(e=>{let r=new URLSearchParams(e);return t==null?r.delete(`step`):r.set(`step`,String(t)),Lt(m)&&x===`all`&&n?r.set(`run`,n):r.delete(`run`),c(E)?r.set(`sub`,String(E.subIndex)):r.delete(`sub`),V===`overview`?r.delete(`tab`):r.set(`tab`,V),r},{replace:!0})},[E,V,U,m,x,ee]),(0,j.useEffect)(()=>{if(!o(E))return;let e=Ee.current;if(!e)return;if(E.type===`step`&&!d.has(`step`)&&!d.has(`sub`)&&U[0]?.id===E.stepId){y.current=E.stepId;return}y.current=null;let t=E.type===`step`?`[data-step-id="${E.stepId}"]`:E.type===`execution`?`[data-execution-id="${E.logId}"]`:c(E)?`[data-sub-action-id="${E.stepId}-${E.subIndex}"]`:null;if(!t)return;let n=requestAnimationFrame(()=>{let n=e.querySelector(t);n&&zt(e,n)});return()=>cancelAnimationFrame(n)},[E,U,d]);let dt=(0,j.useCallback)(async e=>{fe(e);try{let t=await ke(e);h(t.steps),D(Rt($(t.steps,[],``,!1),d,!1))}catch{be.error(`Failed to load attempt`)}},[d]),ft=(0,j.useCallback)(async t=>{if(T(t),t===`all`)h(Ie),D(Rt($(Ie,b,`all`,Lt(m)),d,!0)),e&&Me(e).then(({logs:e})=>k(e)).catch(()=>{});else try{let e=await ke(t);h(e.steps);let{logs:n}=await Me(t);k(n),D(Rt($(e.steps,[],t,!1),d,!1))}catch{be.error(`Failed to load test steps`)}},[Ie,e,m,d,b]);if(pe)return(0,M.jsx)(Fe,{});if(he||!m)return(0,M.jsx)(He,{icon:ce,title:`Run not found`,description:`This test run doesn't exist or has been deleted`,actionLabel:`View All Runs`,onAction:()=>i(_.runs)});let pt=r(m.id,m.videoPath);return(0,M.jsx)(Oe,{children:(0,M.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,M.jsx)(Ze,{run:m,steps:se,shortcutsOpen:Ke,onToggleShortcuts:()=>qe(e=>!e),onOpenArtifacts:nt}),(0,M.jsxs)(Be,{orientation:`horizontal`,className:`min-h-0 flex-1 overflow-hidden`,children:[(0,M.jsx)(ze,{defaultSize:35,minSize:20,children:(0,M.jsxs)(`div`,{ref:Ee,className:`flex h-full min-h-0 min-w-0 flex-col overflow-y-auto`,children:[Lt(m)&&b.length>0?(0,M.jsx)(`div`,{className:`border-b px-3 py-2 shrink-0`,children:(0,M.jsxs)(ae,{value:x,onValueChange:ft,children:[(0,M.jsx)(re,{className:`w-full h-8 text-xs`,children:(0,M.jsx)(ie,{})}),(0,M.jsxs)(ne,{children:[(0,M.jsxs)(te,{value:`all`,children:[`All Tests (`,b.length,`)`]}),b.map(e=>(0,M.jsx)(te,{value:e.id,children:(0,M.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.name,(0,M.jsx)(Nt,{status:e.status})]})},e.id))]})]})}):g.length>0?(0,M.jsx)(`div`,{className:`flex gap-1 border-b px-3 py-2 shrink-0`,children:g.map(e=>(0,M.jsxs)(`button`,{onClick:()=>dt(e.id),className:w(`px-3 py-1 text-xs rounded-sm border-b-2 transition-colors`,de===e.id?`border-primary text-foreground font-medium`:`border-transparent text-muted-foreground hover:text-foreground`),children:[`Attempt `,e.attemptNumber,(0,M.jsx)(`span`,{className:`ml-1.5`,children:(0,M.jsx)(Nt,{status:e.status})})]},e.id))}):null,m.status===`failed`&&m.failureSummary&&(0,M.jsx)(Ft,{summary:m.failureSummary}),m.status===`failed`&&m.errorLog&&(0,M.jsxs)(p,{className:`mx-2 mt-1`,children:[(0,M.jsxs)(f,{className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors group w-full`,children:[(0,M.jsx)(C,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),(0,M.jsx)(`span`,{children:`Error Details`})]}),(0,M.jsx)(u,{children:(0,M.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:m.errorLog})})]}),m.memoryLog&&(()=>{let e=JSON.parse(m.memoryLog);return(0,M.jsxs)(p,{className:`mx-2 mt-1`,children:[(0,M.jsxs)(f,{className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors group w-full`,children:[(0,M.jsx)(C,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),(0,M.jsx)(`span`,{children:`Memory`}),(0,M.jsxs)(`span`,{className:`ml-1 text-[10px] opacity-60`,children:[e.added,`A `,e.confirmed,`C `,e.deprecated,`D`]})]}),(0,M.jsx)(u,{children:(0,M.jsxs)(`div`,{className:`mt-1 grid grid-cols-2 gap-x-6 gap-y-1 text-xs px-3 py-2 bg-muted/30 border border-border/50 rounded-[2px]`,children:[(0,M.jsxs)(`div`,{className:`flex justify-between`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:`Added`}),(0,M.jsx)(`span`,{className:`font-mono`,children:e.added})]}),(0,M.jsxs)(`div`,{className:`flex justify-between`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:`Confirmed`}),(0,M.jsx)(`span`,{className:`font-mono`,children:e.confirmed})]}),(0,M.jsxs)(`div`,{className:`flex justify-between`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:`Deprecated`}),(0,M.jsx)(`span`,{className:`font-mono`,children:e.deprecated})]}),(0,M.jsxs)(`div`,{className:`flex justify-between`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:`Errors`}),(0,M.jsx)(`span`,{className:`font-mono`,children:e.errors.length})]}),(0,M.jsxs)(`div`,{className:`flex justify-between`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:`Curator Duration`}),(0,M.jsxs)(`span`,{className:`font-mono`,children:[(e.curatorDuration/1e3).toFixed(1),`s`]})]}),(0,M.jsxs)(`div`,{className:`flex justify-between`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:`Tokens`}),(0,M.jsx)(`span`,{className:`font-mono`,children:e.tokenUsage?`${A(e.tokenUsage.promptTokens)} / ${A(e.tokenUsage.completionTokens)}`:`—`})]})]})})]})})(),(0,M.jsx)(t,{steps:U,selection:E,onSelect:D,suiteTests:Lt(m)?b:void 0,suiteSelectedView:x,setupHooks:q,teardownHooks:J,inlineLogs:Y})]})}),(0,M.jsx)(Ve,{withHandle:!0}),(0,M.jsx)(ze,{defaultSize:65,minSize:30,children:(0,M.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,children:E?.type===`hook`&&st?(0,M.jsx)(n,{log:st}):E?.type===`execution`&&ct?(0,M.jsx)(n,{log:ct}):(0,M.jsx)(s,{activeTab:V,onTabChange:H,step:W,subAction:it,runId:W?.rawRunId??m.id,allSteps:U,executionLogs:ot,accessibilitySummary:We,platform:m.platform,screenshotSide:at,onScreenshotSideChange:ut,pipelineRef:v})})})]}),(0,M.jsx)(Mt,{run:m,open:Xe,tab:P,response:Qe,loading:L,error:R,onOpenChange:N,onTabChange:F,onRetry:tt}),_e&&pt&&(0,M.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center`,onClick:()=>ve(!1),children:[(0,M.jsx)(S,{variant:`secondary`,size:`icon-sm`,className:`absolute top-4 right-4 h-8 w-8 bg-background/80 backdrop-blur-sm z-10`,onClick:()=>ve(!1),children:(0,M.jsx)(De,{className:`h-4 w-4`})}),(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,onClick:e=>e.stopPropagation(),children:[(0,M.jsx)(`video`,{ref:we,src:pt,controls:!0,autoPlay:!0,className:`rounded-lg`,style:{maxWidth:`90vw`,maxHeight:`calc(90vh - 3rem)`},onLoadedMetadata:()=>{we.current&&(we.current.playbackRate=xe)}}),(0,M.jsx)(`div`,{className:`flex items-center gap-1 bg-background/80 backdrop-blur-sm rounded-full px-1 py-0.5`,children:[.5,1,1.5,2,3,4].map(e=>(0,M.jsxs)(`button`,{onClick:()=>{Se(e),we.current&&(we.current.playbackRate=e)},className:`px-2.5 py-1 rounded-full text-xs font-medium transition-colors ${xe===e?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-muted`}`,children:[e,`x`]},e))})]})]})]})})}export{Bt as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-DD6yziGv.js";import{i as n,l as r,n as i,o as a,s as o,t as s}from"./select-D5oFJNaq.js";import{n as c}from"./split-button-wGcE-JDx.js";import{n as l,r as u}from"./shortcut-hints-CtwepXR1.js";import{t as d}from"./plus-Qf7V331e.js";import{t as f}from"./trash-2-BhJSaMLG.js";import{t as p}from"./use-page-title-B4YPyIzc.js";import{n as m,t as h}from"./batch-action-bar-D1IfTx55.js";import{n as g,r as _,t as v}from"./popover-DwYq4QYF.js";import{n as y,t as b}from"./scroll-area-BmkJ1y7Q.js";import{i as x,r as ee,t as te}from"./tabs-DzjvuMEX.js";import{$n as ne,At as S,Gt as re,Ht as C,In as w,Jt as T,Kt as ie,L as ae,Mt as oe,Nn as se,Nt as ce,Pt as le,Qn as ue,Rn as de,St as fe,Ut as E,Wn as pe,Wt as D,Z as O,a as me,cr as he,et as ge,gt as _e,j as ve,jt as k,nr as A,nt as j,pr as M,qt as N,tr as P,tt as F,ur as I}from"./index-B4FdO6Vk.js";import{t as L}from"./badge-CC1v3nk4.js";import{n as R,o as ye,r as be,t as z}from"./lib-B9z0w3j9.js";import{a as xe,i as B,n as Se,o as V,r as H,t as Ce}from"./table-QG2rKYu8.js";import{t as we}from"./empty-state-BfgY0UGA.js";import{t as Te}from"./use-keyboard-shortcuts-Bal_Cx9w.js";import{n as Ee,t as De}from"./use-selection-queue-O7K3NZNK.js";var U=e(M(),1),W=ue();function Oe({startedAt:e}){let[t,n]=(0,U.useState)(()=>{let t=new Date(T(e)).getTime();return Math.max(0,Math.floor((Date.now()-t)/1e3))});return(0,U.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,W.jsxs)(`span`,{className:`text-blue-500 tabular-nums`,children:[Math.floor(t/60),`m `,t%60,`s`]})}var ke={select:`44px`,status:`136px`,target:`180px`,attributes:`260px`,duration:`104px`,createdAt:`128px`},G=[`agent-qa.trigger`,`agent-qa.runner`];function K(e){return e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1)}function Ae(e){return`${e.targetName?.trim()||`No target`} (${K(e.platform)})`}function je(e){return e.suiteId!=null&&e.parentRunId==null}function q(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 J({attributes:e,activeKeys:t}){let n=q(e,t);if(n.length===0)return(0,W.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,W.jsxs)(k,{children:[(0,W.jsx)(le,{asChild:!0,children:(0,W.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,W.jsxs)(`div`,{className:`min-w-0 truncate font-mono`,children:[(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`=`]}),(0,W.jsx)(`span`,{className:`text-foreground`,children:t})]},e)),a>0?(0,W.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`+`,a,` more`]}):null]})}),(0,W.jsx)(oe,{side:`top`,align:`start`,className:`max-w-[420px] p-2`,children:(0,W.jsx)(`div`,{className:`max-h-64 overflow-auto font-mono text-[11px] leading-5`,children:n.map(([e,t])=>(0,W.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e}),(0,W.jsx)(`span`,{className:`truncate text-foreground`,children:t})]},e))})})]})}function Y(e){return e.mode===`regex`?`${e.key} matches ${e.value}`:`${e.key} = ${e.value}`}function Me({predicates:e,onChange:t}){let[n,r]=(0,U.useState)(!1),[i,a]=(0,U.useState)(``),[o,s]=(0,U.useState)(``),[c,l]=(0,U.useState)(`exact`),[u,p]=(0,U.useState)(null),[m,h]=(0,U.useState)([]),[y,b]=(0,U.useState)([]);(0,U.useEffect)(()=>{if(!n)return;let e=!1;return ge({q:i,limit:8}).then(t=>{e||h(t.keys)}).catch(()=>{e||h([])}),()=>{e=!0}},[i,n]),(0,U.useEffect)(()=>{if(!n||!i.trim()){b([]);return}let e=!1;return F(i.trim(),{q:o,limit:8}).then(t=>{e||b(t.values)}).catch(()=>{e||b([])}),()=>{e=!0}},[i,n,o]);function x(){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 ee(n){t?.(e.filter((e,t)=>t!==n))}return(0,W.jsxs)(v,{open:n,onOpenChange:r,children:[(0,W.jsx)(_,{asChild:!0,children:(0,W.jsxs)(E,{type:`button`,variant:e.length>0?`secondary`:`outline`,size:`sm`,"aria-label":`Filter by attributes`,className:`h-9 gap-2`,children:[(0,W.jsx)(w,{className:`size-4`}),`Attributes`,e.length>0?` (${e.length})`:``]})}),(0,W.jsxs)(g,{align:`start`,className:`w-[380px] p-0`,children:[(0,W.jsx)(`div`,{className:`border-b px-3 py-2`,children:(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:`Filter by attributes`})}),(0,W.jsxs)(`div`,{className:`space-y-3 p-3`,children:[(0,W.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsx)(`label`,{className:`text-[11px] font-medium text-muted-foreground`,htmlFor:`run-attribute-key`,children:`Key`}),(0,W.jsx)(C,{id:`run-attribute-key`,value:i,onChange:e=>{a(e.target.value),p(null)},placeholder:`git.branch`}),(0,W.jsx)(`div`,{className:`max-h-28 overflow-y-auto rounded border border-border/60`,children:m.length>0?m.map(e=>(0,W.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,W.jsx)(`span`,{className:`truncate font-mono`,children:e.key}),(0,W.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:e.count})]},e.key)):(0,W.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No attributes found`})})]}),(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsx)(`label`,{className:`text-[11px] font-medium text-muted-foreground`,htmlFor:`run-attribute-value`,children:`Value`}),(0,W.jsx)(C,{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,W.jsx)(`div`,{className:`max-h-28 overflow-y-auto rounded border border-border/60`,children:y.length>0?y.map(e=>(0,W.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,W.jsx)(`span`,{className:`truncate font-mono`,children:e.value}),(0,W.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:e.count})]},e.value)):(0,W.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No values found for this key`})})]})]}),(0,W.jsxs)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[(0,W.jsx)(`button`,{type:`button`,className:D(`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,W.jsx)(`button`,{type:`button`,className:D(`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,W.jsx)(`p`,{id:`run-attribute-filter-error`,className:`text-xs text-destructive`,children:u}):null,(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsxs)(E,{type:`button`,size:`sm`,onClick:x,children:[(0,W.jsx)(d,{className:`size-4`}),`Apply filter`]}),(0,W.jsx)(E,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>t?.([]),disabled:e.length===0,children:`Clear attributes`})]}),e.length>0?(0,W.jsx)(`div`,{className:`space-y-1 border-t pt-3`,children:e.map((e,t)=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1 break-all font-mono`,children:Y(e)}),(0,W.jsx)(E,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e.key} filter`,onClick:()=>ee(t),children:(0,W.jsx)(f,{className:`size-3.5`})})]},`${e.key}-${e.mode}`))}):null]})]})]})}function X({status:e}){let t=P(e);return(0,W.jsx)(L,{className:A(t.tone),children:t.label})}function Ne({column:e,label:n}){return(0,W.jsx)(`div`,{className:`flex justify-end`,children:(0,W.jsxs)(E,{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,W.jsx)(`span`,{className:`truncate`,children:n}),(0,W.jsx)(t,{})]})})}var Pe=[{accessorKey:`status`,header:({column:e})=>(0,W.jsxs)(E,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Status`,(0,W.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{accessorKey:`name`,header:({column:e})=>(0,W.jsxs)(E,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Test Name`,(0,W.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{id:`target`,accessorFn:e=>`${e.targetName??`No target`} ${e.platform}`,header:({column:e})=>(0,W.jsxs)(E,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Target`,(0,W.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,W.jsx)(Ne,{column:e,label:`Duration`})},{accessorKey:`createdAt`,header:({column:e})=>(0,W.jsx)(Ne,{column:e,label:`Started`})}];function Fe(e){e.stopPropagation()}function Ie(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 Le(e){let t=ke[e];if(t)return{width:t,minWidth:t}}function Z(e){return D(`h-10 bg-background text-[13px] font-medium text-foreground/90`,e===`select`&&`w-11 px-2 text-center`,e===`status`&&`w-[136px] px-3`,e===`name`&&`px-3`,e===`target`&&`w-[180px] px-3`,e===`attributes`&&`w-[260px] px-3`,e===`duration`&&`w-[104px] px-3 text-right`,e===`createdAt`&&`w-[128px] px-3 text-right`)}function Q(e,t){return D(`py-2 align-top`,e===`select`&&`w-11 px-2`,e===`status`&&`w-[136px] px-3`,e===`name`&&D(`max-w-0 px-3`,t&&`pl-8`),e===`target`&&`w-[180px] max-w-0 px-3 text-muted-foreground`,e===`attributes`&&`w-[260px] max-w-0 px-3`,e===`duration`&&`w-[104px] px-3 text-right tabular-nums`,e===`createdAt`&&`w-[128px] px-3 text-right tabular-nums`)}function $({isActive:e,isBatchSelected:t,isChild:n}){return D(`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 Re(e,t){let n=[];for(let r of e)if(n.push({id:r.id,run:r,isChild:!1,parentId:null}),!(!je(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 ze({runs:e,total:t,isLoading:c,page:l,onPageChange:u,onSearchChange:d,searchValue:f,selectedRunId:p=null,onSelectedRunIdChange:h,expandedSuites:g=new Set,onToggleSuite:_,onOpenRun:v,onVisibleRunsChange:x,platformFilter:ee=``,onPlatformChange:te,targetFilter:ne=``,targetOptions:S=[],onTargetChange:w,attributePredicates:T=[],onAttributePredicatesChange:ae,sorting:se,onSortingChange:ue,headerActions:de,topSlot:fe,enableSelection:D=!1,selectedRunIds:O=new Set,onToggleRunSelection:me,onToggleVisibleSelection:he}){let[ge,_e]=(0,U.useState)([]),ve=se??ge,A=ue??_e,j=R({data:e,columns:[...D?[{id:`select`,header:({table:e})=>(0,W.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,W.jsx)(m,{checked:Ie(e.getRowModel().rows.map(e=>e.original.id),O),onCheckedChange:t=>he?.(e.getRowModel().rows.map(e=>e.original),t===!0),onClick:e=>e.stopPropagation(),"aria-label":`Select all`})}),enableSorting:!1}]:[],...Pe],getRowId:e=>e.id,getCoreRowModel:be(),getSortedRowModel:ye(),onSortingChange:A,state:{sorting:ve}}),M=j.getHeaderGroups(),P=j.getRowModel().rows,F=(0,U.useMemo)(()=>P.map(e=>e.original),[P]),I=(0,U.useMemo)(()=>Re(F,g),[g,F]),L=Math.ceil(t/50),we=l*50+1,Te=Math.min((l+1)*50,t),Ee=Array.from(new Set([ne,...S].filter(e=>!!e))),De=[...D?[`select`]:[],`status`,`name`,`target`,`attributes`,`duration`,`createdAt`],ke=(0,U.useMemo)(()=>T.map(e=>e.key),[T]);(0,U.useEffect)(()=>{x?.(I)},[x,I]),(0,U.useEffect)(()=>{if(!p)return;let e=document.querySelector(`[data-runs-row-surface="${p}"]`);e&&document.activeElement!==e&&e.focus()},[p]);function G(e){return e.status===`running`&&e.startedAt?(0,W.jsx)(`span`,{className:`text-sm tabular-nums`,children:(0,W.jsx)(Oe,{startedAt:e.startedAt})}):e.status===`running`?(0,W.jsx)(`span`,{className:`text-sm text-blue-500`,children:`Starting...`}):(0,W.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:N(e.duration)})}function K(e,t){h?.(e.id),v?.(e,t)}function q(e,t){t.key===`Enter`&&(t.preventDefault(),K(e,t))}return(0,W.jsx)(ce,{children:(0,W.jsxs)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col gap-4`,children:[(0,W.jsxs)(`div`,{className:`shrink-0 space-y-4`,children:[fe,(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(C,{placeholder:`Search runs...`,value:f,onChange:e=>d(e.target.value),className:`max-w-[220px]`}),te&&(0,W.jsxs)(s,{value:ee||`all`,onValueChange:e=>te(e===`all`?``:e),children:[(0,W.jsx)(a,{className:`w-[140px]`,children:(0,W.jsx)(o,{placeholder:`All platforms`})}),(0,W.jsxs)(i,{children:[(0,W.jsx)(n,{value:`all`,children:`All platforms`}),(0,W.jsx)(n,{value:`web`,children:`Web`}),(0,W.jsx)(n,{value:`android`,children:`Android`}),(0,W.jsx)(n,{value:`ios`,children:`iOS`})]})]}),w&&(0,W.jsxs)(s,{value:ne||`all`,onValueChange:e=>w(e===`all`?``:e),children:[(0,W.jsx)(a,{className:`w-[180px]`,children:(0,W.jsx)(o,{placeholder:`All targets`})}),(0,W.jsxs)(i,{children:[(0,W.jsx)(n,{value:`all`,children:`All targets`}),Ee.map(e=>(0,W.jsx)(n,{value:e,children:e},e))]})]}),ae&&(0,W.jsx)(Me,{predicates:T,onChange:ae}),(0,W.jsx)(`div`,{className:`flex-1`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c&&(0,W.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading...`}),de]})]})]}),(0,W.jsxs)(b,{className:`min-h-0 flex-1 rounded-md border`,children:[(0,W.jsxs)(Ce,{className:`min-w-full table-fixed`,children:[(0,W.jsx)(`colgroup`,{children:De.map(e=>(0,W.jsx)(`col`,{style:Le(e)},e))}),(0,W.jsx)(xe,{children:M.map(e=>(0,W.jsx)(V,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,W.jsx)(B,{className:Z(e.column.id),children:e.isPlaceholder?null:z(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,W.jsx)(Se,{children:P.length?P.map(e=>{let t=e.original,n=je(t),i=n&&g.has(t.id),a=t.tests??[],o=a.filter(e=>e.status===`passed`).length,s=p===t.id,c=O.has(t.id);return(0,W.jsxs)(U.Fragment,{children:[(0,W.jsxs)(V,{tabIndex:s?0:-1,"data-runs-row-surface":t.id,"data-active":String(s),"data-state":c?`selected`:void 0,"aria-selected":s,className:$({isActive:s,isBatchSelected:c,isChild:!1}),onClick:e=>K(t,e),onFocus:()=>h?.(t.id),onKeyDown:e=>q(t,e),children:[D&&(0,W.jsx)(H,{className:Q(`select`,!1),onClick:e=>e.stopPropagation(),children:(0,W.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,W.jsx)(m,{checked:O.has(t.id),onCheckedChange:e=>me?.(t,e===!0),"aria-label":`Select row`})})}),(0,W.jsx)(H,{className:Q(`status`,!1),children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(X,{status:t.status}),n&&a.length>0&&(0,W.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/80 tabular-nums`,children:[o,`/`,a.length]})]})}),(0,W.jsx)(H,{className:Q(`name`,!1),children:(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[n&&(0,W.jsx)(`button`,{type:`button`,className:`rounded p-0.5 hover:bg-muted`,onClick:e=>{Fe(e),_?.(t.id)},children:i?(0,W.jsx)(r,{className:`h-4 w-4 text-muted-foreground`}):(0,W.jsx)(pe,{className:`h-4 w-4 text-muted-foreground`})}),(0,W.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:t.name})]})}),(0,W.jsx)(H,{className:Q(`target`,!1),children:(0,W.jsx)(`span`,{className:`block whitespace-normal break-words text-[13px] leading-snug text-muted-foreground/90`,children:Ae(t)})}),(0,W.jsx)(H,{className:Q(`attributes`,!1),children:(0,W.jsx)(J,{attributes:t.attributes,activeKeys:ke})}),(0,W.jsx)(H,{className:Q(`duration`,!1),children:G(t)}),(0,W.jsx)(H,{className:Q(`createdAt`,!1),children:(0,W.jsxs)(k,{children:[(0,W.jsx)(le,{asChild:!0,children:(0,W.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:re(t.createdAt)})}),(0,W.jsx)(oe,{children:ie(t.createdAt)})]})})]}),i&&a.map(t=>{let n=p===t.id;return(0,W.jsxs)(V,{tabIndex:n?0:-1,"data-runs-row-surface":t.id,"data-active":String(n),"aria-selected":n,className:$({isActive:n,isBatchSelected:!1,isChild:!0}),onClick:e=>K(t,e),onFocus:()=>h?.(t.id),onKeyDown:e=>q(t,e),children:[D&&(0,W.jsx)(H,{className:Q(`select`,!0)}),(0,W.jsx)(H,{className:Q(`status`,!0),children:(0,W.jsx)(X,{status:t.status})}),(0,W.jsx)(H,{className:Q(`name`,!0),children:(0,W.jsx)(`span`,{className:`block whitespace-normal break-words text-sm leading-snug text-foreground/90`,children:t.name})}),(0,W.jsx)(H,{className:Q(`target`,!0),children:(0,W.jsx)(`span`,{className:`block whitespace-normal break-words text-[13px] leading-snug text-muted-foreground`,children:Ae(t)})}),(0,W.jsx)(H,{className:Q(`attributes`,!0),children:(0,W.jsx)(J,{attributes:t.attributes,activeKeys:ke})}),(0,W.jsx)(H,{className:Q(`duration`,!0),children:G(t)}),(0,W.jsx)(H,{className:Q(`createdAt`,!0),children:(0,W.jsxs)(k,{children:[(0,W.jsx)(le,{asChild:!0,children:(0,W.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:re(t.createdAt)})}),(0,W.jsx)(oe,{children:ie(t.createdAt)})]})})]},`${e.id}-child-${t.id}`)})]},e.id)}):(0,W.jsx)(V,{children:(0,W.jsx)(H,{colSpan:De.length,className:`h-24 text-center`,children:`No results.`})})})]}),(0,W.jsx)(y,{orientation:`horizontal`})]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between px-1`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t>0?`Showing ${we}-${Te} of ${t}`:`No runs found`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(E,{variant:`outline`,size:`sm`,onClick:()=>u(l-1),disabled:l===0,children:`Previous`}),(0,W.jsx)(E,{variant:`outline`,size:`sm`,onClick:()=>u(l+1),disabled:l>=L-1||L===0,children:`Next`})]})]})]})})}var Be=new Set([`all`,`running`,`queued`,`completed`,`failed`]),Ve=new Set([`asc`,`desc`]);function He(e){if(!e)return 1;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>1?t:1}function Ue(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 We(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 Ge(){let[e,t]=I(),n=e.get(`tab`),r=n&&Be.has(n)?n:`all`,i=e.get(`search`)??``,a=e.get(`platform`)??``,o=e.get(`target`)??``,s=(0,U.useMemo)(()=>We(e),[e]),c=e.get(`sort`)??``,l=e.get(`order`)??`desc`,u=Ve.has(l)?l:`desc`,d=He(e.get(`page`)),f=(0,U.useMemo)(()=>c?[{id:c,desc:u===`desc`}]:[],[c,u]),p=(0,U.useRef)(f);p.current=f;let m=(0,U.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,U.useEffect)(()=>{let n=Ue(m);e.toString()!==n.toString()&&t(n,{replace:!0})},[e,t,m]);let h=(0,U.useCallback)((e,n)=>{let r={...m,...e};n?.resetPage&&(r.page=1),t(Ue(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,U.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,U.useCallback)(e=>h({tab:e},{resetPage:!0}),[h]),setSearch:(0,U.useCallback)(e=>h({search:e},{resetPage:!0}),[h]),setPlatform:(0,U.useCallback)(e=>h({platform:e},{resetPage:!0}),[h]),setTarget:(0,U.useCallback)(e=>h({target:e},{resetPage:!0}),[h]),setAttributePredicates:(0,U.useCallback)(e=>h({attributePredicates:e},{resetPage:!0}),[h]),setPage:(0,U.useCallback)(e=>h({page:e}),[h])}}var Ke={all:``,running:`running`,queued:`pending`,completed:`passed`,failed:`failed`};function qe(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 Je(){p(`Runs`);let e=he(),[t,n]=(0,U.useState)([]),[r,i]=(0,U.useState)(0),[a,o]=(0,U.useState)([]),[s,d]=(0,U.useState)(!0),{tab:f,search:m,platform:g,target:_,attributePredicates:v,page:y,sorting:b,onSortingChange:re,setTab:C,setSearch:w,setPlatform:T,setTarget:ie,setAttributePredicates:ue,setPage:pe}=Ge(),[D,ge]=(0,U.useState)(!1),[A,M]=(0,U.useState)(null),[N,P]=(0,U.useState)([]),[F,I]=(0,U.useState)(()=>new Set),[R,ye]=(0,U.useState)(null),[be,z]=(0,U.useState)(!1),[xe,B]=(0,U.useState)(!1),[Se,V]=(0,U.useState)(!0),[H,Ce]=(0,U.useState)(!0),{hasFarm:Oe,isLoading:ke}=c(),G=(0,U.useCallback)(async(e,t,r,a)=>{try{if(r&&r!==`running`){n(e),i(t);return}let{executions:o}=await ae();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=>qe(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,videoPath: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)}},[]),K=(0,U.useCallback)(e=>({limit:50,offset:(e.page-1)*50,name:e.name||void 0,status:e.status||void 0,platform:e.platform||void 0,target:e.target||void 0,attributes:e.attributes}),[]),Ae=Ke[f]??``,je=(0,U.useCallback)(async e=>{try{d(!0);let[t,n]=await Promise.all([j(K(e)),O()]);ye(n),o(t.targets??[]),await G(t.runs,t.total,e.status,e.name)}catch{S.error(`Failed to load runs`)}finally{d(!1),ge(!0)}},[G,K]),q=(0,U.useCallback)(async e=>{try{let[t,n]=await Promise.all([j(K(e)),O()]);ye(n),o(t.targets??[]),await G(t.runs,t.total,e.status,e.name)}catch{}},[G,K]),J=(0,U.useMemo)(()=>({page:y,name:m,status:Ae,platform:g,target:_,attributes:v}),[y,m,Ae,g,_,v]);(0,U.useEffect)(()=>{je(J)},[je,J]),(0,U.useEffect)(()=>{if(!D)return;let e=setInterval(()=>{q(J)},5e3);return()=>clearInterval(e)},[D,q,J]),(0,U.useEffect)(()=>{M(null),I(new Set),P([])},[f,m,g,_,v,y]),(0,U.useEffect)(()=>{A&&(N.some(e=>e.id===A)||M(t.find(e=>e.tests?.some(e=>e.id===A))?.id??null))},[t,A,N]);let Y=De({items:t,getId:e=>e.id,visibleIds:t.map(e=>e.id)}),Me=Y.selectedIds,X=Y.selectedItems,Ne=(0,U.useCallback)(()=>{Y.clearSelection(),B(!1),V(!0),Ce(!0)},[Y]),Pe=(0,U.useCallback)(async e=>{if(X.length===0)return;let t=X.flatMap(e=>e.filePath?[e.filePath]:[]);if(t.length===0){S.error(`No selected runs can be rerun`);return}z(!0);try{let n=await Promise.allSettled(t.map(t=>fe({file:t,local:e,noCache:!Se,noMemory:!H}))),r=n.filter(e=>e.status===`fulfilled`).length,i=n.length-r;i>0?S.error(`${r} runs queued, ${i} failed`):S.success(`${r} runs queued`),B(!1)}finally{z(!1)}},[X,Se,H]),Fe=(0,U.useCallback)(async()=>{if(X.length===0)return;let e=Array.from(new Set(X.flatMap(e=>e.filePath?[e.filePath]:[])));if(e.length===0){S.error(`No selected runs have file paths to purge`);return}z(!0);try{let t=await Promise.allSettled(e.map(e=>_e({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?S.error(`Purged ${r} plans from ${n} tests, ${i} failed`):S.success(`Purged ${r} cached plan${r===1?``:`s`} from ${n} test${n===1?``:`s`}`)}finally{z(!1)}},[X]),Ie=(0,U.useCallback)(async()=>{if(X.length!==0){z(!0);try{let e=await Promise.allSettled(X.map(e=>ve(e.id))),t=X.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&&(Y.setItemsSelected(t,!1),n(e=>e.filter(e=>!r.has(e.id))),i(e=>Math.max(0,e-t.length)),B(!1)),a>0?S.error(`Deleted ${t.length} run${t.length===1?``:`s`}, ${a} failed`):S.success(`Deleted ${t.length} run${t.length===1?``:`s`}`)}finally{z(!1)}}},[X,Y]),Le=(0,U.useCallback)(e=>{I(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Z=(0,U.useCallback)((t,n)=>{let r=ne.runDetailOrLive(t.id,t.status);if(n?.metaKey||n?.ctrlKey||n?.button===1){window.open(r,`_blank`,`noopener,noreferrer`);return}e(r)},[e]),Q=(0,U.useCallback)((e,t)=>{Z(e,t)},[Z]),$=(0,U.useMemo)(()=>N.findIndex(e=>e.id===A),[A,N]);Te((0,U.useMemo)(()=>{let e=e=>{if(N.length!==0){if($===-1){M(e>0?N[0].id:N[N.length-1].id);return}M(N[Math.max(0,Math.min($+e,N.length-1))].id)}},t=()=>e(1),n=()=>e(-1);return{j:t,arrowdown:t,k:n,arrowup:n,enter:e=>{$<0||Z(N[$].run,e)}}},[Z,$,N]));let Re=R?.running.count??0,Be=R?.pending.count??0,Ve=Be>0||Re>0;if(!D)return(0,W.jsx)(me,{});let He=!!m||f!==`all`||!!g||!!_||v.length>0;if(t.length===0&&!He)return(0,W.jsx)(we,{icon:de,title:`No test runs yet`,description:`Run your first test to see results here`,actionLabel:`View Tests`,onAction:()=>e(ne.tests)});let Ue=(0,W.jsx)(te,{value:f,onValueChange:C,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsxs)(ee,{variant:`line`,children:[(0,W.jsx)(x,{value:`all`,children:`All`}),(0,W.jsxs)(x,{value:`running`,children:[`Running`,Re>0&&(0,W.jsx)(L,{variant:`secondary`,className:`ml-1 px-1.5 text-xs`,children:Re})]}),(0,W.jsxs)(x,{value:`queued`,children:[`Queued`,Be>0&&(0,W.jsx)(L,{variant:`secondary`,className:`ml-1 px-1.5 text-xs`,children:Be})]}),(0,W.jsx)(x,{value:`completed`,children:`Completed`}),(0,W.jsx)(x,{value:`failed`,children:`Failed`})]}),Ve&&R&&(0,W.jsxs)(L,{variant:`outline`,className:`text-xs`,children:[R.activeSlots,`/`,R.concurrency,` slots`]})]})});return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4 overflow-hidden`,children:[(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3`,children:[(0,W.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Runs`}),(0,W.jsx)(ce,{children:(0,W.jsxs)(k,{children:[(0,W.jsx)(le,{asChild:!0,children:(0,W.jsx)(E,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,W.jsx)(u,{className:`h-4 w-4`})})}),(0,W.jsx)(oe,{side:`bottom`,className:`p-3`,children:(0,W.jsx)(l,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open run`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]})})]}),(0,W.jsx)(ze,{topSlot:Ue,runs:t,total:r,isLoading:s,page:y-1,onPageChange:e=>pe(e+1),onSearchChange:w,searchValue:m,selectedRunId:A,onSelectedRunIdChange:M,expandedSuites:F,onToggleSuite:Le,onOpenRun:Q,onVisibleRunsChange:P,platformFilter:g,onPlatformChange:T,targetFilter:_,targetOptions:a,onTargetChange:ie,attributePredicates:v,onAttributePredicatesChange:ue,sorting:b,onSortingChange:re,enableSelection:!0,selectedRunIds:Y.selectedIdSet,onToggleRunSelection:Y.setItemSelected,onToggleVisibleSelection:Y.setItemsSelected}),(0,W.jsx)(h,{selectedCount:Me.length,summaryMeta:Y.hiddenCount>0?`${Y.hiddenCount} hidden by filters`:void 0,secondaryIcon:(0,W.jsx)(se,{className:`size-4`}),secondaryAriaLabel:`Clear queue`,onDelete:Ie,actionSlot:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Ee,{selectedCount:Y.selectedCount,hiddenCount:Y.hiddenCount,useCache:Se,useMemory:H,browserStackAvailable:!ke&&Oe,open:xe,onOpenChange:B,onUseCacheChange:V,onUseMemoryChange:Ce,onRunLocal:()=>Pe(!0),onRunBrowserStack:()=>Pe(!1),disabled:be}),(0,W.jsx)(E,{variant:`outline`,size:`sm`,onClick:Fe,disabled:be,children:`Purge cache`})]}),onCancel:Ne,isRunning:be})]})}export{Je as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./dist-BJdB11cl.js";import{n,r}from"./use-page-title-B4YPyIzc.js";import{$t as i,Cn as a,En as o,Jn as s,Mn as c,Qn as l,Qt as u,Sn as d,Tn as f,Wt as p,Xt as m,Zt as h,_n as g,en as _,fn as v,fr as y,gn as b,hn as x,kn as S,mn as C,pn as w,pr as T,vn as E,wn as D,xn as O,yn as k}from"./index-B4FdO6Vk.js";var A=s(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),j=s(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),M=s(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),N=e(y(),1),P=e(T(),1);function F(e){let t=P.useRef({value:e,previous:e});return P.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var I=l(),L=[` `,`Enter`,`ArrowUp`,`ArrowDown`],R=[` `,`Enter`],z=`Select`,[B,V,H]=t(z),[U,W]=D(z,[H,_]),G=_(),[ee,K]=U(z),[te,ne]=U(z),q=e=>{let{__scopeSelect:t,children:n,open:a,defaultOpen:o,onOpenChange:s,value:c,defaultValue:l,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g}=e,_=G(t),[v,y]=P.useState(null),[b,x]=P.useState(null),[S,C]=P.useState(!1),w=r(d),[T,E]=O({prop:a,defaultProp:o??!1,onChange:s,caller:z}),[D,A]=O({prop:c,defaultProp:l,onChange:u,caller:z}),j=P.useRef(null),M=v?g||!!v.closest(`form`):!0,[N,F]=P.useState(new Set),L=Array.from(N).map(e=>e.props.value).join(`;`);return(0,I.jsx)(i,{..._,children:(0,I.jsxs)(ee,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:k(),value:D,onValueChange:A,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:j,disabled:m,children:[(0,I.jsx)(B.Provider,{scope:t,children:(0,I.jsx)(te,{scope:e.__scopeSelect,onNativeOptionAdd:P.useCallback(e=>{F(t=>new Set(t).add(e))},[]),onNativeOptionRemove:P.useCallback(e=>{F(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),M?(0,I.jsxs)(Ge,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:D,onChange:e=>A(e.target.value),disabled:m,form:g,children:[D===void 0?(0,I.jsx)(`option`,{value:``}):null,Array.from(N)]},L):null]})})};q.displayName=z;var re=`SelectTrigger`,J=P.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,s=G(n),l=K(re,n),u=l.disabled||r,d=c(t,l.onTriggerChange),f=V(n),p=P.useRef(`touch`),[h,g,_]=qe(e=>{let t=f().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.value===l.value));n!==void 0&&l.onValueChange(n.value)}),v=e=>{u||(l.onOpenChange(!0),_()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(m,{asChild:!0,...s,children:(0,I.jsx)(o.button,{type:`button`,role:`combobox`,"aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":`none`,dir:l.dir,"data-state":l.open?`open`:`closed`,disabled:u,"data-disabled":u?``:void 0,"data-placeholder":Ke(l.value)?``:void 0,...i,ref:d,onClick:a(i.onClick,e=>{e.currentTarget.focus(),p.current!==`mouse`&&v(e)}),onPointerDown:a(i.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(v(e),e.preventDefault())}),onKeyDown:a(i.onKeyDown,e=>{let t=h.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&g(e.key),!(t&&e.key===` `)&&L.includes(e.key)&&(v(),e.preventDefault())})})})});J.displayName=re;var ie=`SelectValue`,ae=P.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:s=``,...l}=e,u=K(ie,n),{onValueNodeHasChildrenChange:f}=u,p=a!==void 0,m=c(t,u.onValueNodeChange);return d(()=>{f(p)},[f,p]),(0,I.jsx)(o.span,{...l,ref:m,style:{pointerEvents:`none`},children:Ke(u.value)?(0,I.jsx)(I.Fragment,{children:s}):a})});ae.displayName=ie;var oe=`SelectIcon`,se=P.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(o.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});se.displayName=oe;var ce=`SelectPortal`,le=e=>(0,I.jsx)(x,{asChild:!0,...e});le.displayName=ce;var Y=`SelectContent`,ue=P.forwardRef((e,t)=>{let n=K(Y,e.__scopeSelect),[r,i]=P.useState();if(d(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?N.createPortal((0,I.jsx)(de,{scope:e.__scopeSelect,children:(0,I.jsx)(B.Slot,{scope:e.__scopeSelect,children:(0,I.jsx)(`div`,{children:e.children})})}),t):null}return(0,I.jsx)(me,{...e,ref:t})});ue.displayName=Y;var X=10,[de,Z]=U(Y),fe=`SelectContentImpl`,pe=S(`SelectContent.RemoveScroll`),me=P.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:_,hideWhenDetached:y,avoidCollisions:x,...S}=e,T=K(Y,n),[E,D]=P.useState(null),[O,k]=P.useState(null),A=c(t,e=>D(e)),[j,M]=P.useState(null),[N,F]=P.useState(null),L=V(n),[R,z]=P.useState(!1),B=P.useRef(!1);P.useEffect(()=>{if(E)return v(E)},[E]),C();let H=P.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[L,O]),U=P.useCallback(()=>H([j,E]),[H,j,E]);P.useEffect(()=>{R&&U()},[R,U]);let{onOpenChange:W,triggerPointerDownPosRef:G}=T;P.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(G.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():E.contains(n.target)||W(!1),document.removeEventListener(`pointermove`,t),G.current=null};return G.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,W,G]),P.useEffect(()=>{let e=()=>W(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[W]);let[ee,te]=qe(e=>{let t=L().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=P.useCallback((e,t,n)=>{let r=!B.current&&!n;(T.value!==void 0&&T.value===t||r)&&(M(e),r&&(B.current=!0))},[T.value]),q=P.useCallback(()=>E?.focus(),[E]),re=P.useCallback((e,t,n)=>{let r=!B.current&&!n;(T.value!==void 0&&T.value===t||r)&&F(e)},[T.value]),J=r===`popper`?ve:ge,ie=J===ve?{side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:_,hideWhenDetached:y,avoidCollisions:x}:{};return(0,I.jsx)(de,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:ne,selectedItem:j,onItemLeave:q,itemTextRefCallback:re,focusSelectedItem:U,selectedItemText:N,position:r,isPositioned:R,searchRef:ee,children:(0,I.jsx)(w,{as:pe,allowPinchZoom:!0,children:(0,I.jsx)(b,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:a(i,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(g,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,I.jsx)(J,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...S,...ie,onPlaced:()=>z(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...S.style},onKeyDown:a(S.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>H(t)),e.preventDefault()}})})})})})})});me.displayName=fe;var he=`SelectItemAlignedPosition`,ge=P.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:i,...a}=e,s=K(Y,r),l=Z(Y,r),[u,f]=P.useState(null),[p,m]=P.useState(null),h=c(t,e=>m(e)),g=V(r),_=P.useRef(!1),v=P.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:x,focusSelectedItem:S}=l,C=P.useCallback(()=>{if(s.trigger&&s.valueNode&&u&&p&&y&&b&&x){let e=s.trigger.getBoundingClientRect(),t=p.getBoundingClientRect(),r=s.valueNode.getBoundingClientRect(),a=x.getBoundingClientRect();if(s.dir!==`rtl`){let i=a.left-t.left,o=r.left-i,s=e.left-o,c=e.width+s,l=Math.max(c,t.width),d=window.innerWidth-X,f=n(o,[X,Math.max(X,d-l)]);u.style.minWidth=c+`px`,u.style.left=f+`px`}else{let i=t.right-a.right,o=window.innerWidth-r.right-i,s=window.innerWidth-e.right-o,c=e.width+s,l=Math.max(c,t.width),d=window.innerWidth-X,f=n(o,[X,Math.max(X,d-l)]);u.style.minWidth=c+`px`,u.style.right=f+`px`}let o=g(),c=window.innerHeight-X*2,l=y.scrollHeight,d=window.getComputedStyle(p),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),h=parseInt(d.borderBottomWidth,10),v=parseInt(d.paddingBottom,10),S=f+m+l+v+h,C=Math.min(b.offsetHeight*5,S),w=window.getComputedStyle(y),T=parseInt(w.paddingTop,10),E=parseInt(w.paddingBottom,10),D=e.top+e.height/2-X,O=c-D,k=b.offsetHeight/2,A=b.offsetTop+k,j=f+m+A,M=S-j;if(j<=D){let e=o.length>0&&b===o[o.length-1].ref.current;u.style.bottom=`0px`;let t=p.clientHeight-y.offsetTop-y.offsetHeight,n=j+Math.max(O,k+(e?E:0)+t+h);u.style.height=n+`px`}else{let e=o.length>0&&b===o[0].ref.current;u.style.top=`0px`;let t=Math.max(D,f+y.offsetTop+(e?T:0)+k)+M;u.style.height=t+`px`,y.scrollTop=j-D+y.offsetTop}u.style.margin=`${X}px 0`,u.style.minHeight=C+`px`,u.style.maxHeight=c+`px`,i?.(),requestAnimationFrame(()=>_.current=!0)}},[g,s.trigger,s.valueNode,u,p,y,b,x,s.dir,i]);d(()=>C(),[C]);let[w,T]=P.useState();return d(()=>{p&&T(window.getComputedStyle(p).zIndex)},[p]),(0,I.jsx)(ye,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:_,onScrollButtonChange:P.useCallback(e=>{e&&v.current===!0&&(C(),S?.(),v.current=!1)},[C,S]),children:(0,I.jsx)(`div`,{ref:f,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:w},children:(0,I.jsx)(o.div,{...a,ref:h,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});ge.displayName=he;var _e=`SelectPopperPosition`,ve=P.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=X,...a}=e,o=G(n);return(0,I.jsx)(u,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ve.displayName=_e;var[ye,be]=U(Y,{}),xe=`SelectViewport`,Se=P.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,s=Z(xe,n),l=be(xe,n),u=c(t,s.onViewportChange),d=P.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(o.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:u,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:a(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){let e=Math.abs(d.current-t.scrollTop);if(e>0){let r=window.innerHeight-X*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}d.current=t.scrollTop})})})]})});Se.displayName=xe;var Ce=`SelectGroup`,[we,Te]=U(Ce),Ee=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=k();return(0,I.jsx)(we,{scope:n,id:i,children:(0,I.jsx)(o.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Ee.displayName=Ce;var De=`SelectLabel`,Oe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Te(De,n);return(0,I.jsx)(o.div,{id:i.id,...r,ref:t})});Oe.displayName=De;var Q=`SelectItem`,[ke,Ae]=U(Q),je=P.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...l}=e,u=K(Q,n),d=Z(Q,n),f=u.value===r,[p,m]=P.useState(s??``),[h,g]=P.useState(!1),_=c(t,e=>d.itemRefCallback?.(e,r,i)),v=k(),y=P.useRef(`touch`),b=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,I.jsx)(ke,{scope:n,value:r,disabled:i,textId:v,isSelected:f,onItemTextChange:P.useCallback(e=>{m(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(B.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:(0,I.jsx)(o.div,{role:`option`,"aria-labelledby":v,"data-highlighted":h?``:void 0,"aria-selected":f&&h,"data-state":f?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...l,ref:_,onFocus:a(l.onFocus,()=>g(!0)),onBlur:a(l.onBlur,()=>g(!1)),onClick:a(l.onClick,()=>{y.current!==`mouse`&&b()}),onPointerUp:a(l.onPointerUp,()=>{y.current===`mouse`&&b()}),onPointerDown:a(l.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:a(l.onPointerMove,e=>{y.current=e.pointerType,i?d.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:a(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:a(l.onKeyDown,e=>{d.searchRef?.current!==``&&e.key===` `||(R.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})});je.displayName=Q;var $=`SelectItemText`,Me=P.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,s=K($,n),l=Z($,n),u=Ae($,n),f=ne($,n),[p,m]=P.useState(null),h=c(t,e=>m(e),u.onItemTextChange,e=>l.itemTextRefCallback?.(e,u.value,u.disabled)),g=p?.textContent,_=P.useMemo(()=>(0,I.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=f;return d(()=>(v(_),()=>y(_)),[v,y,_]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(o.span,{id:u.textId,...a,ref:h}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?N.createPortal(a.children,s.valueNode):null]})});Me.displayName=$;var Ne=`SelectItemIndicator`,Pe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Ae(Ne,n).isSelected?(0,I.jsx)(o.span,{"aria-hidden":!0,...r,ref:t}):null});Pe.displayName=Ne;var Fe=`SelectScrollUpButton`,Ie=P.forwardRef((e,t)=>{let n=Z(Fe,e.__scopeSelect),r=be(Fe,e.__scopeSelect),[i,a]=P.useState(!1),o=c(t,r.onScrollButtonChange);return d(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(ze,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ie.displayName=Fe;var Le=`SelectScrollDownButton`,Re=P.forwardRef((e,t)=>{let n=Z(Le,e.__scopeSelect),r=be(Le,e.__scopeSelect),[i,a]=P.useState(!1),o=c(t,r.onScrollButtonChange);return d(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(ze,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Re.displayName=Le;var ze=P.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,s=Z(`SelectScrollButton`,n),c=P.useRef(null),l=V(n),u=P.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return P.useEffect(()=>()=>u(),[u]),d(()=>{l().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[l]),(0,I.jsx)(o.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:a(i.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:a(i.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:a(i.onPointerLeave,()=>{u()})})}),Be=`SelectSeparator`,Ve=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(o.div,{"aria-hidden":!0,...r,ref:t})});Ve.displayName=Be;var He=`SelectArrow`,Ue=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=G(n),a=K(He,n),o=Z(He,n);return a.open&&o.position===`popper`?(0,I.jsx)(h,{...i,...r,ref:t}):null});Ue.displayName=He;var We=`SelectBubbleInput`,Ge=P.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=P.useRef(null),a=c(r,i),s=F(t);return P.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(s!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[s,t]),(0,I.jsx)(o.select,{...n,style:{...f,...n.style},ref:a,defaultValue:t})});Ge.displayName=We;function Ke(e){return e===``||e===void 0}function qe(e){let t=E(e),n=P.useRef(``),r=P.useRef(0),i=P.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=P.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Je(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ye(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xe=q,Ze=J,Qe=ae,$e=se,et=le,tt=ue,nt=Se,rt=Ee,it=Oe,at=je,ot=Me,st=Pe,ct=Ie,lt=Re;function ut({...e}){return(0,I.jsx)(Xe,{"data-slot":`select`,...e})}function dt({...e}){return(0,I.jsx)(rt,{"data-slot":`select-group`,...e})}function ft({...e}){return(0,I.jsx)(Qe,{"data-slot":`select-value`,...e})}function pt({className:e,size:t=`default`,children:n,...r}){return(0,I.jsxs)(Ze,{"data-slot":`select-trigger`,"data-size":t,className:p(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,I.jsx)($e,{asChild:!0,children:(0,I.jsx)(j,{className:`size-4 opacity-50`})})]})}function mt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,I.jsx)(et,{children:(0,I.jsxs)(tt,{"data-slot":`select-content`,className:p(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,I.jsx)(_t,{}),(0,I.jsx)(nt,{className:p(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,I.jsx)(vt,{})]})})}function ht({className:e,...t}){return(0,I.jsx)(it,{"data-slot":`select-label`,className:p(`px-2 py-1.5 text-xs text-muted-foreground`,e),...t})}function gt({className:e,children:t,...n}){return(0,I.jsxs)(at,{"data-slot":`select-item`,className:p(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,I.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(st,{children:(0,I.jsx)(A,{className:`size-4`})})}),(0,I.jsx)(ot,{children:t})]})}function _t({className:e,...t}){return(0,I.jsx)(ct,{"data-slot":`select-scroll-up-button`,className:p(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(M,{className:`size-4`})})}function vt({className:e,...t}){return(0,I.jsx)(lt,{"data-slot":`select-scroll-down-button`,className:p(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(j,{className:`size-4`})})}export{ht as a,F as c,gt as i,j as l,mt as n,pt as o,dt as r,ft as s,ut as t,A as u};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{l as t}from"./select-D5oFJNaq.js";import{t as n}from"./shortcut-hints-CtwepXR1.js";import{t as r}from"./dist-BJdB11cl.js";import{r as i}from"./use-page-title-B4YPyIzc.js";import{n as a,r as o,t as s}from"./dist-DzF0KPMF.js";import{$t as c,Cn as l,Dn as u,En as d,Jn as f,Mn as p,Qn as m,Qt as ee,Rn as h,Ut as g,V as te,Wt as _,Xt as v,Zt as y,_n as ne,bn as b,en as x,fn as S,gn as re,hn as ie,jn as C,kn as w,mn as ae,pn as oe,pr as se,vn as T,wn as E,xn as ce,yn as D}from"./index-B4FdO6Vk.js";var O=f(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),k=f(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),A=e(se(),1),j=m(),M=[`Enter`,` `],le=[`ArrowDown`,`PageUp`,`Home`],ue=[`ArrowUp`,`PageDown`,`End`],de=[...le,...ue],fe={ltr:[...M,`ArrowRight`],rtl:[...M,`ArrowLeft`]},N={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},P=`Menu`,[F,pe,me]=r(P),[I,he]=E(P,[me,x,o]),L=x(),ge=o(),[_e,R]=I(P),[ve,z]=I(P),ye=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:s=!0}=e,l=L(t),[u,d]=A.useState(null),f=A.useRef(!1),p=T(o),m=i(a);return A.useEffect(()=>{let e=()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,j.jsx)(c,{...l,children:(0,j.jsx)(_e,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:d,children:(0,j.jsx)(ve,{scope:t,onClose:A.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:s,children:r})})})};ye.displayName=P;var be=`MenuAnchor`,B=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=L(n);return(0,j.jsx)(v,{...i,...r,ref:t})});B.displayName=be;var V=`MenuPortal`,[xe,Se]=I(V,{forceMount:void 0}),Ce=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=R(V,t);return(0,j.jsx)(xe,{scope:t,forceMount:n,children:(0,j.jsx)(b,{present:n||a.open,children:(0,j.jsx)(ie,{asChild:!0,container:i,children:r})})})};Ce.displayName=V;var H=`MenuContent`,[we,U]=I(H),Te=A.forwardRef((e,t)=>{let n=Se(H,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=R(H,e.__scopeMenu),o=z(H,e.__scopeMenu);return(0,j.jsx)(F.Provider,{scope:e.__scopeMenu,children:(0,j.jsx)(b,{present:r||a.open,children:(0,j.jsx)(F.Slot,{scope:e.__scopeMenu,children:o.modal?(0,j.jsx)(Ee,{...i,ref:t}):(0,j.jsx)(De,{...i,ref:t})})})})}),Ee=A.forwardRef((e,t)=>{let n=R(H,e.__scopeMenu),r=A.useRef(null),i=p(t,r);return A.useEffect(()=>{let e=r.current;if(e)return S(e)},[]),(0,j.jsx)(W,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:l(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),De=A.forwardRef((e,t)=>{let n=R(H,e.__scopeMenu);return(0,j.jsx)(W,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Oe=w(`MenuContent.ScrollLock`),W=A.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:h,onDismiss:g,disableOutsideScroll:te,..._}=e,v=R(H,n),y=z(H,n),b=L(n),x=ge(n),S=pe(n),[ie,C]=A.useState(null),w=A.useRef(null),se=p(t,w,v.onContentChange),T=A.useRef(0),E=A.useRef(``),ce=A.useRef(0),D=A.useRef(null),O=A.useRef(`right`),k=A.useRef(0),M=te?oe:A.Fragment,le=te?{as:Oe,allowPinchZoom:!0}:void 0,fe=e=>{let t=E.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ct(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};A.useEffect(()=>()=>window.clearTimeout(T.current),[]),ae();let N=A.useCallback(e=>O.current===D.current?.side&&ut(e,D.current?.area),[]);return(0,j.jsx)(we,{scope:n,searchRef:E,onItemEnter:A.useCallback(e=>{N(e)&&e.preventDefault()},[N]),onItemLeave:A.useCallback(e=>{N(e)||(w.current?.focus(),C(null))},[N]),onTriggerLeave:A.useCallback(e=>{N(e)&&e.preventDefault()},[N]),pointerGraceTimerRef:ce,onPointerGraceIntentChange:A.useCallback(e=>{D.current=e},[]),children:(0,j.jsx)(M,{...le,children:(0,j.jsx)(re,{asChild:!0,trapped:i,onMountAutoFocus:l(o,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,j.jsx)(ne,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:h,onDismiss:g,children:(0,j.jsx)(a,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:ie,onCurrentTabStopIdChange:C,onEntryFocus:l(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,j.jsx)(ee,{role:`menu`,"aria-orientation":`vertical`,"data-state":it(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:se,style:{outline:`none`,..._.style},onKeyDown:l(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&fe(e.key));let i=w.current;if(e.target!==i||!de.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);ue.includes(e.key)&&a.reverse(),ot(a)}),onBlur:l(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:l(e.onPointerMove,Y(e=>{let t=e.target,n=k.current!==e.clientX;e.currentTarget.contains(t)&&n&&(O.current=e.clientX>k.current?`right`:`left`,k.current=e.clientX)}))})})})})})})});Te.displayName=H;var ke=`MenuGroup`,Ae=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,j.jsx)(d.div,{role:`group`,...r,ref:t})});Ae.displayName=ke;var je=`MenuLabel`,Me=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,j.jsx)(d.div,{...r,ref:t})});Me.displayName=je;var G=`MenuItem`,Ne=`menu.itemSelect`,K=A.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=A.useRef(null),o=z(G,e.__scopeMenu),s=U(G,e.__scopeMenu),c=p(t,a),d=A.useRef(!1),f=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Ne,{bubbles:!0,cancelable:!0});e.addEventListener(Ne,e=>r?.(e),{once:!0}),u(e,t),t.defaultPrevented?d.current=!1:o.onClose()}};return(0,j.jsx)(Pe,{...i,ref:c,disabled:n,onClick:l(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:l(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:l(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||M.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});K.displayName=G;var Pe=A.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=U(G,n),c=ge(n),u=A.useRef(null),f=p(t,u),[m,ee]=A.useState(!1),[h,g]=A.useState(``);return A.useEffect(()=>{let e=u.current;e&&g((e.textContent??``).trim())},[a.children]),(0,j.jsx)(F.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:(0,j.jsx)(s,{asChild:!0,...c,focusable:!r,children:(0,j.jsx)(d.div,{role:`menuitem`,"data-highlighted":m?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:f,onPointerMove:l(e.onPointerMove,Y(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:l(e.onPointerLeave,Y(e=>o.onItemLeave(e))),onFocus:l(e.onFocus,()=>ee(!0)),onBlur:l(e.onBlur,()=>ee(!1))})})})}),Fe=`MenuCheckboxItem`,Ie=A.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,j.jsx)(We,{scope:e.__scopeMenu,checked:n,children:(0,j.jsx)(K,{role:`menuitemcheckbox`,"aria-checked":J(n)?`mixed`:n,...i,ref:t,"data-state":at(n),onSelect:l(i.onSelect,()=>r?.(J(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ie.displayName=Fe;var Le=`MenuRadioGroup`,[Re,ze]=I(Le,{value:void 0,onValueChange:()=>{}}),Be=A.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=T(r);return(0,j.jsx)(Re,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,j.jsx)(Ae,{...i,ref:t})})});Be.displayName=Le;var Ve=`MenuRadioItem`,He=A.forwardRef((e,t)=>{let{value:n,...r}=e,i=ze(Ve,e.__scopeMenu),a=n===i.value;return(0,j.jsx)(We,{scope:e.__scopeMenu,checked:a,children:(0,j.jsx)(K,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":at(a),onSelect:l(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});He.displayName=Ve;var Ue=`MenuItemIndicator`,[We,Ge]=I(Ue,{checked:!1}),Ke=A.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Ge(Ue,n);return(0,j.jsx)(b,{present:r||J(a.checked)||a.checked===!0,children:(0,j.jsx)(d.span,{...i,ref:t,"data-state":at(a.checked)})})});Ke.displayName=Ue;var qe=`MenuSeparator`,Je=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,j.jsx)(d.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Je.displayName=qe;var Ye=`MenuArrow`,Xe=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=L(n);return(0,j.jsx)(y,{...i,...r,ref:t})});Xe.displayName=Ye;var Ze=`MenuSub`,[Qe,$e]=I(Ze),et=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=R(Ze,t),o=L(t),[s,l]=A.useState(null),[u,d]=A.useState(null),f=T(i);return A.useEffect(()=>(a.open===!1&&f(!1),()=>f(!1)),[a.open,f]),(0,j.jsx)(c,{...o,children:(0,j.jsx)(_e,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:(0,j.jsx)(Qe,{scope:t,contentId:D(),triggerId:D(),trigger:s,onTriggerChange:l,children:n})})})};et.displayName=Ze;var q=`MenuSubTrigger`,tt=A.forwardRef((e,t)=>{let n=R(q,e.__scopeMenu),r=z(q,e.__scopeMenu),i=$e(q,e.__scopeMenu),a=U(q,e.__scopeMenu),o=A.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=A.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return A.useEffect(()=>d,[d]),A.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,j.jsx)(B,{asChild:!0,...u,children:(0,j.jsx)(Pe,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":it(n.open),...e,ref:C(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:l(e.onPointerMove,Y(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:l(e.onPointerLeave,Y(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:l(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||fe[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});tt.displayName=q;var nt=`MenuSubContent`,rt=A.forwardRef((e,t)=>{let n=Se(H,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=R(H,e.__scopeMenu),o=z(H,e.__scopeMenu),s=$e(nt,e.__scopeMenu),c=A.useRef(null),u=p(t,c);return(0,j.jsx)(F.Provider,{scope:e.__scopeMenu,children:(0,j.jsx)(b,{present:r||a.open,children:(0,j.jsx)(F.Slot,{scope:e.__scopeMenu,children:(0,j.jsx)(W,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:u,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:l(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:l(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=N[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});rt.displayName=nt;function it(e){return e?`open`:`closed`}function J(e){return e===`indeterminate`}function at(e){return J(e)?`indeterminate`:e?`checked`:`unchecked`}function ot(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function st(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ct(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=st(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function lt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ut(e,t){return t?lt({x:e.clientX,y:e.clientY},t):!1}function Y(e){return t=>t.pointerType===`mouse`?e(t):void 0}var dt=ye,ft=B,pt=Ce,mt=Te,ht=Ae,gt=Me,_t=K,vt=Ie,yt=Be,bt=He,xt=Ke,St=Je,Ct=Xe,wt=tt,Tt=rt,X=`DropdownMenu`,[Et,Dt]=E(X,[he]),Z=he(),[Ot,kt]=Et(X),At=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Z(t),l=A.useRef(null),[u,d]=ce({prop:i,defaultProp:a??!1,onChange:o,caller:X});return(0,j.jsx)(Ot,{scope:t,triggerId:D(),triggerRef:l,contentId:D(),open:u,onOpenChange:d,onOpenToggle:A.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,j.jsx)(dt,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};At.displayName=X;var jt=`DropdownMenuTrigger`,Mt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=kt(jt,n),o=Z(n);return(0,j.jsx)(ft,{asChild:!0,...o,children:(0,j.jsx)(d.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:C(t,a.triggerRef),onPointerDown:l(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:l(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Mt.displayName=jt;var Nt=`DropdownMenuPortal`,Pt=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Z(t);return(0,j.jsx)(pt,{...r,...n})};Pt.displayName=Nt;var Ft=`DropdownMenuContent`,It=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=kt(Ft,n),a=Z(n),o=A.useRef(!1);return(0,j.jsx)(mt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:l(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:l(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});It.displayName=Ft;var Lt=`DropdownMenuGroup`,Rt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(ht,{...i,...r,ref:t})});Rt.displayName=Lt;var zt=`DropdownMenuLabel`,Bt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(gt,{...i,...r,ref:t})});Bt.displayName=zt;var Vt=`DropdownMenuItem`,Ht=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(_t,{...i,...r,ref:t})});Ht.displayName=Vt;var Ut=`DropdownMenuCheckboxItem`,Wt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(vt,{...i,...r,ref:t})});Wt.displayName=Ut;var Gt=`DropdownMenuRadioGroup`,Kt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(yt,{...i,...r,ref:t})});Kt.displayName=Gt;var qt=`DropdownMenuRadioItem`,Jt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(bt,{...i,...r,ref:t})});Jt.displayName=qt;var Yt=`DropdownMenuItemIndicator`,Xt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(xt,{...i,...r,ref:t})});Xt.displayName=Yt;var Zt=`DropdownMenuSeparator`,Qt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(St,{...i,...r,ref:t})});Qt.displayName=Zt;var $t=`DropdownMenuArrow`,en=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(Ct,{...i,...r,ref:t})});en.displayName=$t;var tn=`DropdownMenuSubTrigger`,nn=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(wt,{...i,...r,ref:t})});nn.displayName=tn;var rn=`DropdownMenuSubContent`,an=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(Tt,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});an.displayName=rn;var on=At,sn=Mt,cn=Pt,ln=It,un=Ht,dn=Qt;function fn({...e}){return(0,j.jsx)(on,{"data-slot":`dropdown-menu`,...e})}function pn({...e}){return(0,j.jsx)(sn,{"data-slot":`dropdown-menu-trigger`,...e})}function mn({className:e,sideOffset:t=4,...n}){return(0,j.jsx)(cn,{children:(0,j.jsx)(ln,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:_(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function Q({className:e,inset:t,variant:n=`default`,...r}){return(0,j.jsx)(un,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:_(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function hn({className:e,...t}){return(0,j.jsx)(dn,{"data-slot":`dropdown-menu-separator`,className:_(`-mx-1 my-1 h-px bg-border`,e),...t})}var $=null,gn=null;function _n(){let[e,t]=(0,A.useState)(()=>$?{...$,isLoading:!1}:{defaultRunMode:`local`,hasFarm:!1,isLoading:!0});return(0,A.useEffect)(()=>{if($){t({...$,isLoading:!1});return}gn||=te().then(e=>{let t=e.config,n=t.farm;$={defaultRunMode:t.defaultRunMode===`farm`?`farm`:`local`,hasFarm:!!n?.provider}}).catch(()=>{$={defaultRunMode:`local`,hasFarm:!1}}).finally(()=>{gn=null}),gn.then(()=>{t({...$,isLoading:!1})})},[]),e}function vn({onRun:e,onRunNoCache:r,onPurgeCache:i,disabled:a=!1,size:o=`default`,className:s,label:c,shortcutKey:l}){let{hasFarm:u}=_n(),d=u||!!r||!!i,f=c??`Run`,p=l?(0,j.jsx)(n,{shortcut:l,className:`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`}):null;return d?(0,j.jsxs)(`div`,{className:_(`inline-flex items-center`,s),children:[(0,j.jsxs)(g,{size:o,disabled:a,onClick:()=>e(!0),className:`rounded-r-none`,children:[(0,j.jsx)(h,{className:`size-4`}),f,p]}),(0,j.jsxs)(fn,{children:[(0,j.jsx)(pn,{asChild:!0,children:(0,j.jsx)(g,{variant:`default`,size:o,disabled:a,className:`rounded-l-none border-l border-l-primary-foreground/20 px-2`,children:(0,j.jsx)(t,{className:`h-4 w-4`})})}),(0,j.jsxs)(mn,{align:`end`,children:[(0,j.jsxs)(Q,{onClick:()=>e(!0),children:[(0,j.jsx)(k,{className:`mr-2 h-4 w-4`}),`Run Local`]}),u&&(0,j.jsxs)(Q,{onClick:()=>e(!1),children:[(0,j.jsx)(O,{className:`mr-2 h-4 w-4`}),`Run on Farm`]}),(r||i)&&(0,j.jsx)(hn,{}),r&&(0,j.jsx)(Q,{onClick:()=>r(!0),children:`Run without cache`}),i&&(0,j.jsx)(Q,{onClick:i,children:`Purge cache`})]})]})]}):(0,j.jsxs)(g,{size:o,disabled:a,onClick:()=>e(!0),className:s,children:[(0,j.jsx)(h,{className:`size-4`}),f,p]})}export{Q as a,O as c,mn as i,_n as n,pn as o,fn as r,k as s,vn as t};
@@ -1 +0,0 @@
1
- import{Jn as e}from"./index-B4FdO6Vk.js";var t=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{t};
@@ -1,5 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{c as t}from"./id-badge-BmmZdbHv.js";import{t as n}from"./monaco-editor-DF4W-NC-.js";import{n as r}from"./split-button-wGcE-JDx.js";import{a as i,c as a,i as ee,n as o,o as te,r as ne,s,t as c}from"./filename-validation-S8QXnNdt.js";import{t as re}from"./use-page-title-B4YPyIzc.js";import{a as ie,n as ae}from"./dist-wK15YRiu.js";import{i as oe,n as se,r as ce,t as le}from"./tabs-DzjvuMEX.js";import{$n as l,At as u,Bn as ue,Bt as de,D as fe,E as pe,Et as me,Ht as he,It as ge,Lt as _e,Mt as d,Ot as ve,Pt as f,Qn as ye,Rt as be,S as xe,St as Se,V as Ce,Vn as we,Yt as Te,cr as Ee,jt as p,lr as De,ot as Oe,pr as ke,r as Ae,ur as je,zt as Me}from"./index-B4FdO6Vk.js";import{n as m,r as Ne,t as Pe}from"./resizable-B2X6KlcC.js";import{t as Fe}from"./empty-state-BfgY0UGA.js";import{t as Ie}from"./use-keyboard-shortcuts-Bal_Cx9w.js";import{i as Le,n as Re,r as ze,t as Be}from"./suite-navbar-B8gZoPMT.js";var h=e(ke(),1);function Ve(e,t){return c(e,t,`suiteMatch`)}var g=ye(),He=`name: My Suite
2
- target: ""
3
- tests: []
4
- `;function Ue(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function We(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`}function Ge({text:e}){return(0,g.jsxs)(p,{children:[(0,g.jsx)(f,{asChild:!0,children:(0,g.jsx)(ue,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,g.jsx)(d,{className:`max-w-[250px] text-[13px]`,children:e})]})}function _(){let e=De()[`suite-id`]??``,c=Ee(),[ue]=je(),d=Te(),{defaultRunMode:f}=r(),{targets:ye,globalUse:p,isLoading:ke}=t(),_=!e,Ke=ue.get(`live`)===`1`,v=(0,h.useRef)(null),y=(0,h.useRef)(null),qe=(0,h.useRef)(()=>{}),Je=(0,h.useRef)(!1),b=(0,h.useRef)(null),x=(0,h.useRef)(null),[S,C]=(0,h.useState)(_?He:``),[Ye,Xe]=(0,h.useState)(``),[w,Ze]=(0,h.useState)(``),[T,Qe]=(0,h.useState)(!_),[$e,et]=(0,h.useState)(!1),[tt,nt]=(0,h.useState)(!1),[rt,it]=(0,h.useState)(!1),[at,ot]=(0,h.useState)(!1),[E,st]=(0,h.useState)(null),[ct,lt]=(0,h.useState)(!1),[ut,dt]=(0,h.useState)(!1),[D,ft]=(0,h.useState)([]),[O,k]=(0,h.useState)(null),[A,j]=(0,h.useState)(null),[M,N]=(0,h.useState)(!1),[P,F]=(0,h.useState)(!1),[I,L]=(0,h.useState)(null),[pt,R]=(0,h.useState)(`reasoning`),[mt,z]=(0,h.useState)(null),[B,V]=(0,h.useState)({setup:[],teardown:[]}),[H,ht]=(0,h.useState)(``),gt=!_&&S!==Ye,_t=_&&w?Ve(w.trim(),D):null,U=_&&!!w&&!!_t,{suggestions:vt}=o(null),yt=(0,h.useMemo)(()=>vt.filter(e=>e.namespace!==`capture`),[vt]),W=(0,h.useMemo)(()=>ze(S),[S]),bt=W?.suiteId??``,xt=W?.name||(_?`New Suite`:H),G=ee(O,{tests:(0,h.useMemo)(()=>W?W.tests.map(e=>({draftId:e.id,testId:e.id,path:e.test,name:e.test.split(`/`).pop()??e.test,steps:[],setup:[],teardown:[]})):[],[W]),setupHooks:B.setup,teardownHooks:B.teardown,allowReconnect:!1}),K=G.terminateSession;y.current=O,qe.current=K;let St=W?.target?.trim()??``,q=P?`connecting`:G.connectionState,J=O!==null,Y=J&&W!==null&&(!Ue(W.setup??[],B.setup)||!Ue(W.teardown??[],B.teardown)),Ct=J&&q===`connected`&&W!==null&&W.tests.length>0,wt=P||J,Tt=P||J||at||E!==null||_||W===null||!W?.target.trim()||ke;re((0,h.useMemo)(()=>J&&A!==null?`Live #${A} — ${W?.name?.trim()||xt||`Suite`}`:_?`New Suite`:`Edit Suite`,[J,A,W?.name,xt,_]));let X=(0,h.useMemo)(()=>{if(W)return{suiteName:W.name,suiteContext:W.context||void 0}},[W]),Et=(0,h.useMemo)(()=>I===`ended`?{reason:`ended`,title:`Live session ended`,description:`The current draft is unchanged. Close live mode or start a fresh disposable session from this target.`}:I===`disconnected`?{reason:`disconnected`,title:`Live session disconnected`,description:`The connection dropped and the disposable session was terminated. Start a fresh session to reconnect.`}:null,[I]);(0,h.useEffect)(()=>{if(_)return;let t=!1;return Oe(e).then(e=>{t||(C(e.content),Xe(e.content),ht(e.path),Qe(!1))}).catch(()=>{t||(et(!0),Qe(!1))}),()=>{t=!0}},[e,_]),(0,h.useEffect)(()=>{let e=!1;return Ce().then(t=>{if(e)return;let n=t.config?.workspace?.suiteMatch;Array.isArray(n)&&ft(n)}).catch(()=>{}),()=>{e=!0}},[]),(0,h.useEffect)(()=>{_&&C(e=>Le(e,[`suite-id`],ae()))},[_]),(0,h.useEffect)(()=>{if(_||T)return;let e=ze(S);e&&!e.suiteId&&C(e=>Le(e,[`suite-id`],ae()))},[_,T,Ye]);let Z=(0,h.useCallback)(async()=>{nt(!0);try{if(_){let e=Ve(w.trim(),D);if(e){u.error(e);return}await fe(w.trim(),S),u.success(`Suite file created`);let t=W?.suiteId??``;if(!t){u.error(`Created suite is missing suite-id; please reload`);return}c(l.suiteEdit(t))}else await me(e,S),Xe(S),u.success(`Saved`)}catch(e){e instanceof xe&&e.missingTests&&e.missingTests.length>0?u.error(`Cannot save — referenced tests not found: ${e.missingTests.map(e=>e.test).join(`, `)}`):u.error(`Failed to save: ${e instanceof Error?e.message:String(e)}`)}finally{nt(!1)}},[_,w,D,S,e,W?.suiteId,c]),Dt=(0,h.useCallback)(async()=>{it(!0);try{let e=await ve(S);e.valid?u.success(`Valid suite`):u.error(e.errors.map(e=>e.message).join(`
5
- `))}catch(e){u.error(`Validation failed: ${e instanceof Error?e.message:String(e)}`)}finally{it(!1)}},[S]),Ot=(0,h.useCallback)(async e=>{if(!_){ot(!0);try{st((await Se({file:H,local:e})).runId),u.success(`Suite run started`)}catch(e){u.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`)}finally{ot(!1)}}},[_,H]),kt=(0,h.useCallback)(()=>st(null),[]),At=(0,h.useCallback)(()=>{i(`page`,`closing live mode`,{liveSessionId:O??void 0,terminalReason:I??void 0}),v.current?.abort(),v.current=null,O&&K(),F(!1),k(null),j(null),L(null),z(null),b.current=null,x.current=null,V({setup:[],teardown:[]}),N(!1)},[O,I,K]),jt=(0,h.useCallback)(()=>{i(`page`,`ending live session from UI`,{liveSessionId:O??void 0}),v.current?.abort(),v.current=null,O&&K(),F(!1),k(null),j(null),L(`ended`),z(null),b.current=null,x.current=null,V({setup:[],teardown:[]}),N(!1)},[O,K]),Q=(0,h.useCallback)(async(e,t)=>{let n=e.target.trim();if(!n){u.error(`Select a target before starting live mode`);return}let r=new AbortController;v.current?.abort(),v.current=r,N(!0),L(null),R(`reasoning`),z(null),b.current=null,x.current=null,F(!0);try{t?.replaceCurrentSession&&y.current&&(K(),k(null),j(null));let a=ne({content:S,targetName:n,targets:ye,globalUse:p});i(`page`,`requesting live session`,{targetName:n,platform:a.platform,headless:a.headless??void 0,replacingSession:t?.replaceCurrentSession??!1});let ee=[...e.setup??[]],o=[...e.teardown??[]],te=e.suiteId?{type:`suite`,id:e.suiteId}:void 0,{sessionId:s,sessionNumber:c}=await pe({...a,setupHooks:ee,teardownHooks:o,entity:te},r.signal);if(r.signal.aborted)return;V({setup:ee,teardown:o}),k(s),j(c),i(`page`,`live session created`,{sessionId:s,targetName:n})}catch(e){We(e)||(i(`page`,`failed to create live session`,{error:e instanceof Error?e.message:String(e),targetName:n}),u.error(e instanceof Error?e.message:`Failed to start live session`)),t?.replaceCurrentSession||N(!1)}finally{v.current===r&&(v.current=null),F(!1)}},[S,p,ye,K]),$=(0,h.useCallback)(async()=>{if(!Tt){if(!W){u.error(`Fix YAML errors before starting live mode`);return}await Q(W)}},[W,Q,Tt]),Mt=(0,h.useCallback)(async()=>{if(J){if(!W){u.error(`Fix YAML errors before restarting live mode`);return}await Q(W,{replaceCurrentSession:!0})}},[W,J,Q]),Nt=(0,h.useCallback)(e=>{if(e){N(!0);return}At()},[At]),Pt=(0,h.useCallback)((e,t)=>{if(!J){u.error(`Start a live session first.`);return}let n=(e===`setup`?G.setupHooks:G.teardownHooks).find(e=>e.id===t);n&&z({type:`suite-hook`,phase:e,hookId:n.id}),R(`reasoning`),G.executeHookById(e,t)},[J,G]),Ft=(0,h.useCallback)(e=>{z({type:`test`,testIndex:e}),R(`reasoning`),G.executeTestByIndex(e,X)},[X,G]);if((0,h.useEffect)(()=>()=>{v.current?.abort(),y.current&&qe.current()},[]),(0,h.useEffect)(()=>{O&&q===`disconnected`&&(i(`page`,`live session moved to terminal state`,{liveSessionId:O,liveConnectionState:q}),k(null),j(null),F(!1),L(`disconnected`),z(null),b.current=null,x.current=null,V({setup:[],teardown:[]}),N(!0))},[q,O]),(0,h.useEffect)(()=>{if(!M||G.runningTestIndex===null)return;let e=`${G.tests[G.runningTestIndex]?.testExecutionId??`pending`}:${G.runningTestIndex}`;b.current!==e&&(b.current=e,z({type:`test`,testIndex:G.runningTestIndex}),R(`reasoning`))},[G.runningTestIndex,G.tests,M]),(0,h.useEffect)(()=>{if(!M||G.runningTestIndex!==null)return;let e=G.tests.map((e,t)=>({index:t,test:e})).filter(({test:e})=>e.status===`failed`).sort((e,t)=>(t.test.lastRunAt??``).localeCompare(e.test.lastRunAt??``))[0];if(!e)return;let t=e.test.testExecutionId??e.test.lastRunAt??`failed:${e.index}`;x.current!==t&&(x.current=t,z({type:`test`,testIndex:e.index}),R(`reasoning`))},[G.runningTestIndex,G.tests,M]),(0,h.useEffect)(()=>{!Ke||Je.current||_||T||$e||P||M||J||!W||!W.target.trim()||(Je.current=!0,c(l.suiteEdit(e),{replace:!0}),$())},[W,$,J,_,P,T,M,c,$e,e,Ke]),Ie((0,h.useMemo)(()=>({r:()=>{_||Ot(f===`local`)},escape:()=>{E&&kt()}}),[_,E,Ot,kt,f])),(0,h.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),Z())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Z]),T)return(0,g.jsx)(Ae,{});if($e)return(0,g.jsx)(Fe,{icon:we,title:`Suite not found`,description:`This suite doesn't exist`,actionLabel:`View All Suites`,onAction:()=>c(l.suites)});let It=(0,g.jsxs)(le,{defaultValue:`builder`,className:`flex-1 flex min-h-0 flex-col`,children:[(0,g.jsxs)(ce,{variant:`line`,className:`px-4`,children:[(0,g.jsx)(oe,{value:`builder`,children:`Builder`}),(0,g.jsx)(oe,{value:`yaml`,children:`YAML`})]}),(0,g.jsx)(se,{value:`builder`,className:`mt-2 flex-1 overflow-auto [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-border [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb:hover]:bg-muted-foreground/50 [&::-webkit-scrollbar-track]:bg-transparent [scrollbar-width:thin]`,children:(0,g.jsx)(Re,{content:S,onChange:C,suggestions:yt,isCreateMode:_,liveMode:M,liveTests:G.tests,liveSetupHooks:G.setupHooks,liveTeardownHooks:G.teardownHooks,runningTestIndex:G.runningTestIndex,canRunTest:J&&G.connectionState===`connected`,canRunAll:Ct,isRunningAll:G.isRunningAllTests,isStoppingRunAll:G.isStoppingRunAllTests,onRunTest:Ft,onCancelTest:e=>{G.runningTestIndex===e&&G.cancelStep()},onRunAll:()=>void G.runAllTests(X),onStopAll:G.cancelRunAllTests,setupHooksStale:Y,onRestartSession:Y?()=>void Mt():void 0,selection:mt,onSelect:z,onRunLiveHook:Pt})}),(0,g.jsx)(se,{value:`yaml`,className:`flex-1 min-h-0 mt-2`,children:(0,g.jsx)(n,{value:S,onChange:C,onSave:Z,className:`h-full`,filePath:H||void 0})})]}),Lt=(0,g.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[_&&(0,g.jsx)(`div`,{className:`px-4 pt-3`,children:(0,g.jsxs)(`div`,{className:`rounded-md border bg-muted/15 px-3 py-2`,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,g.jsxs)(ie,{className:`flex items-center gap-1 text-xs font-medium`,children:[`File Path `,(0,g.jsx)(Ge,{text:`Path is relative to your workspace root. Must match your workspace's suiteMatch pattern. Directories are created automatically on save.`})]}),(0,g.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Created only when you save`})]}),(0,g.jsx)(he,{placeholder:`my-suite.suite.yaml`,value:w,onChange:e=>Ze(e.target.value),className:`mt-2 max-w-md h-8 text-sm font-mono ${U?`border-red-500 focus-visible:ring-red-500`:``}`}),U&&(0,g.jsx)(`p`,{className:`mt-1 text-xs text-red-500`,children:_t})]})}),It]}),Rt=(0,g.jsx)(te,{connectionState:G.connectionState,isLaunching:P,targetName:St||`Selected Target`,targetLabel:G.currentUrl||`Configured start URL`,liveSessionNumber:A,platform:G.platform,screenshot:G.screenshot,currentUrl:G.currentUrl,pendingNavigation:G.pendingNavigation,steps:G.steps,setupHooks:G.setupHooks,teardownHooks:G.teardownHooks,tests:G.tests,selection:mt,runningStepId:G.runningStepId,terminalState:Et,draftState:W===null?`invalid`:gt||_?`unsaved`:`saved`,ariaTree:G.ariaTree,errorMessage:G.error,devtoolsTab:pt,canRunAll:Ct,isRunningAll:G.isRunningAllTests,isStoppingRunAll:G.isStoppingRunAllTests,setupHooksStale:Y,executionUnit:`test`,runAllLabel:`Run All Tests`,stopAllLabel:`Stop Run All`,unitRowsSlot:null,onDevtoolsTabChange:R,onRunAll:()=>void G.runAllTests(X),onStopAll:G.cancelRunAllTests,onEndSession:jt,onRestartSession:Y?()=>void Mt():void 0,showEndSessionAction:d,onCloseLiveMode:At,onStartFreshSession:()=>void $(),onBack:G.goBack,onForward:G.goForward,onRefresh:G.refreshPage,onNavigate:G.navigate,onRequestAriaTree:G.requestAriaTree});return(0,g.jsxs)(`div`,{className:`flex h-screen flex-col`,children:[(0,g.jsx)(Be,{suiteName:xt,suiteId:bt,unsaved:gt,isCreateMode:_,mode:`edit`,suiteHref:_?void 0:l.suiteView(e),isSaving:tt,isValidating:rt,isRunning:at,runDisabled:wt,hasInvalidFilename:U,shortcutsOpen:ut,hasLiveSession:J,liveConnectionState:q,isLiveActionDisabled:Tt,liveSessionNumber:A,onBack:()=>c(l.suites),onSave:Z,onValidate:Dt,onRun:Ot,onLiveConnect:M?void 0:$,onLiveEnd:J?jt:void 0,onSettingsOpen:()=>lt(!0),onToggleShortcuts:()=>dt(e=>!e)}),E?(0,g.jsxs)(Ne,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,g.jsx)(m,{defaultSize:60,minSize:30,children:(0,g.jsx)(n,{value:S,onChange:C,onSave:Z,className:`h-full`})}),(0,g.jsx)(Pe,{withHandle:!0}),(0,g.jsx)(m,{defaultSize:40,minSize:25,children:(0,g.jsx)(s,{runId:E,onClose:kt})})]}):M&&!d?(0,g.jsxs)(Ne,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,g.jsx)(m,{defaultSize:45,minSize:30,children:Lt}),(0,g.jsx)(Pe,{withHandle:!0}),(0,g.jsx)(m,{defaultSize:55,minSize:40,children:Rt})]}):Lt,(0,g.jsx)(ge,{open:ct,onOpenChange:lt,children:(0,g.jsxs)(_e,{side:`right`,className:`sm:max-w-[400px] overflow-y-auto p-0`,children:[(0,g.jsxs)(Me,{className:`px-4 pt-4 pb-2`,children:[(0,g.jsx)(de,{children:`Suite Settings`}),(0,g.jsx)(be,{children:`Advanced configuration for this suite`})]}),(0,g.jsx)(`div`,{className:`px-4 pb-4`,children:(0,g.jsx)(a,{content:S,onChange:C,selectedTarget:W?.target,showMeta:!1})})]})}),d&&(0,g.jsx)(ge,{open:M,onOpenChange:Nt,children:(0,g.jsxs)(_e,{side:`bottom`,showCloseButton:!1,className:`h-[100dvh] max-h-[100dvh] rounded-none p-0`,children:[(0,g.jsxs)(Me,{className:`sr-only`,children:[(0,g.jsx)(de,{children:`Live Session`}),(0,g.jsx)(be,{children:`Live execution workspace for the current suite draft.`})]}),Rt]})})]})}export{_ as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{i as t,n,o as r,s as i,t as a}from"./select-D5oFJNaq.js";import{t as o}from"./circle-alert-CULfrrqE.js";import{C as s,S as c,_ as l,a as u,b as d,c as f,d as p,f as m,g as h,h as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,w as D,x as ee,y as te}from"./id-badge-BmmZdbHv.js";import{n as ne,r as O}from"./monaco-editor-DF4W-NC-.js";import{t as re}from"./circle-x-B7AOkLOS.js";import{c as ie,t as k}from"./split-button-wGcE-JDx.js";import{t as ae}from"./grip-vertical-KfzS75WH.js";import{n as A,r as j,t as M}from"./shortcut-hints-CtwepXR1.js";import{t as oe}from"./plus-Qf7V331e.js";import{t as N}from"./refresh-cw-RAow1kax.js";import{n as P,t as F}from"./textarea-CVB6Do1_.js";import{t as I}from"./square-CgFZz_zK.js";import{a as L,n as R}from"./dist-wK15YRiu.js";import{n as z,r as B,t as V}from"./popover-DwYq4QYF.js";import{Bn as H,Fn as se,Ht as ce,Mt as U,Nn as le,Pn as W,Pt as G,Qn as ue,Rn as de,Un as K,Ut as q,Wn as J,Wt as Y,c as fe,d as pe,dt as me,jt as X,l as he,o as ge,pr as _e,s as ve,sr as Z,u as ye,zn as be}from"./index-B4FdO6Vk.js";import{t as xe}from"./badge-CC1v3nk4.js";import{t as Se}from"./display-step-CO4k5dQA.js";var Q=e(_e(),1),$=ue();function Ce({text:e}){return(0,$.jsxs)(X,{children:[(0,$.jsx)(G,{asChild:!0,children:(0,$.jsx)(H,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,$.jsx)(U,{className:`max-w-[250px] text-[13px]`,children:e})]})}function we({name:e,suiteId:o,target:c,context:l,isCreateMode:d,suggestions:p,hookLabels:m={},onChange:h,disabled:g=!1}){let{targets:v,isLoading:y}=_(),{targets:x}=f(),S=c?x[c]:void 0,w=(0,Q.useRef)(null),[T,E]=(0,Q.useState)(0),D=u({text:l,cursorPos:T,suggestions:p,anchorRef:w,onInsert:(e,t,n)=>{h(`context`,l.slice(0,t)+e+l.slice(n)),requestAnimationFrame(()=>w.current?.focus())}}),ee=!y&&v.length>0;return(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(L,{htmlFor:`suite-name`,className:`text-xs flex items-center gap-1`,children:[`Suite Name `,(0,$.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,$.jsx)(ce,{id:`suite-name`,value:e,onChange:e=>h(`name`,e.target.value),placeholder:`My Suite`,required:!0,disabled:g,className:`h-8 text-sm`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(L,{htmlFor:`suite-id`,className:`text-xs flex items-center gap-1`,children:[`Suite ID `,(0,$.jsx)(Ce,{text:`Unique identifier used for memory and analytics. Changing this breaks the association with past runs and observations.`})]}),d?(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(ce,{id:`suite-id`,value:o,readOnly:!0,disabled:!0,className:`h-8 text-sm font-mono pr-9`}),(0,$.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>h(`suite-id`,R()),"aria-label":`Generate new ID`,disabled:g,className:`absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6`,children:(0,$.jsx)(N,{className:`size-3.5`})})]}):(0,$.jsx)(`p`,{className:`text-[13px] font-mono text-muted-foreground`,children:o||`No ID assigned`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(L,{htmlFor:`suite-target`,className:`text-xs flex items-center gap-1`,children:[`Target `,(0,$.jsx)(`span`,{className:`text-destructive`,children:`*`}),` `,(0,$.jsx)(Ce,{text:`A registered app target from your workspace config. Defines where the suite runs (web URL or mobile app).`})]}),ee?(0,$.jsxs)(a,{value:c||void 0,onValueChange:e=>h(`target`,e),disabled:g,children:[(0,$.jsx)(r,{id:`suite-target`,className:`w-full h-8 text-sm`,children:(0,$.jsx)(i,{placeholder:`Select a target`})}),(0,$.jsx)(n,{children:v.map(e=>(0,$.jsx)(t,{value:e,children:e},e))})]}):y?null:(0,$.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No targets configured.`,` `,(0,$.jsx)(Z,{to:`/config`,className:`text-primary underline underline-offset-4 hover:text-primary/80`,children:`Add targets in Settings.`})]}),S&&(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px] text-muted-foreground mt-1.5`,children:[S.platform===`web`?(0,$.jsx)(ie,{className:`h-3.5 w-3.5 shrink-0`}):(0,$.jsx)(s,{className:`h-3.5 w-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`text-muted-foreground/70 uppercase text-[11px] tracking-wider shrink-0`,children:S.platform}),(0,$.jsxs)(`span`,{className:`font-mono truncate`,children:[S.product&&(0,$.jsx)(`span`,{className:`mr-1.5`,children:S.product}),S.platform===`web`&&S.url,S.platform===`android`&&`${S.appPackage}${S.appActivity?` / ${S.appActivity}`:``}`,S.platform===`ios`&&S.bundleId]})]})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(L,{htmlFor:`suite-context`,className:`text-xs flex items-center gap-1`,children:[`Context `,(0,$.jsx)(Ce,{text:`Additional instructions passed to every test in this suite before its own context. Use this for suite-wide setup notes or shared preconditions.`})]}),(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(F,{ref:w,id:`suite-context`,value:l,onChange:e=>{h(`context`,e.target.value),E(e.target.selectionStart??0)},onKeyDown:e=>{D.handleKeyDown(e)},onBlur:()=>setTimeout(()=>D.setVisible(!1),150),placeholder:`Additional instructions applied to every test in this suite...`,disabled:g,className:`min-h-[60px] resize-none text-sm`,rows:2}),D.dropdown]}),C(l)&&(0,$.jsx)(b,{text:l,hookLabels:m})]})]})}function Te(e){if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<10?`${t.toFixed(1)}s`:`${Math.round(t)}s`}function Ee({status:e}){switch(e){case`running`:return(0,$.jsx)(D,{className:`size-3 text-primary`});case`passed`:return(0,$.jsx)(K,{className:`size-3 text-emerald-500`});case`failed`:return(0,$.jsx)(se,{className:`size-3 text-destructive`});default:return(0,$.jsx)(W,{className:`size-3 text-muted-foreground`})}}function De({status:e}){switch(e){case`running`:case`cancelling`:return(0,$.jsx)(D,{className:`size-3 text-primary`});case`passed`:return(0,$.jsx)(K,{className:`size-3 text-emerald-500`});case`failed`:return(0,$.jsx)(re,{className:`size-3 text-red-500`});case`cancelled`:return(0,$.jsx)(I,{className:`size-3 text-amber-500`});default:return(0,$.jsx)(D,{className:`size-3 text-muted-foreground/50`})}}function Oe(e){return e.observation?e.observation:e.reasoning?e.reasoning:e.plannedAction==null?e.verifierReasoning?e.verifierReasoning:e.result:`Planned action captured`}function ke({id:e,name:t,path:n,testId:r,isMissing:i,onRemove:a,disabled:o=!1,actionsLocked:s=!1,sortableDisabled:l=!1,liveMode:u=!1,liveStatus:d=`idle`,liveDuration:f,liveError:p=null,liveSteps:m=[],runningStepIndex:h=null,perTestSetupHooks:g=[],perTestTeardownHooks:_=[],canRunTest:y=!0,onRunTest:b,onCancelTest:x,testIndex:S,selection:C=null,onSelect:w}){let{attributes:T,listeners:E,setNodeRef:ee,transform:te,transition:ne,isDragging:O}=v({id:e,disabled:o||l}),ie={transform:c.Transform.toString(te),transition:ne,opacity:O?.55:1,zIndex:O?10:void 0},k=u&&d===`running`,A=u&&d===`passed`,j=u&&d===`failed`,M=u&&(A||j||u&&d===`cancelled`)&&f!=null,oe=u&&C?.type===`test`&&S!==void 0&&C.testIndex===S,N=u&&g.length+_.length>0,P=u?m.map(e=>({step:e,displayStep:Se(e,e.stepIndex)})):[],F=C&&`stepId`in C?C.stepId:null,L=C?.type===`subaction`?C.subIndex:null;return(0,$.jsxs)(`div`,{ref:ee,style:ie,className:Y(`relative overflow-hidden flex flex-col gap-0.5 rounded-md border bg-card/60 px-3 py-2 hover:bg-card transition-colors`,i&&`border-amber-500/30`,i&&`bg-amber-500/[0.06]`,!i&&`border-border/70`,O&&`shadow-lg ring-2 ring-primary/20`,o&&`opacity-60`,k&&`live-running-surface border-border/60 bg-primary/5`,j&&!k&&`border-destructive/30`,j&&!k&&!oe&&`ring-1 ring-destructive/20`,oe&&!k&&`bg-primary/10 ring-1 ring-primary/30`),children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`button`,{type:`button`,className:`mt-0.5 flex shrink-0 items-center p-0.5 text-muted-foreground/40 hover:text-muted-foreground cursor-grab active:cursor-grabbing touch-none disabled:cursor-not-allowed`,...T,...E,"aria-label":`Reorder ${t}`,"aria-disabled":o||l,disabled:o||l,children:(0,$.jsx)(ae,{className:`size-3.5`})}),k&&(0,$.jsx)(D,{className:`size-4 shrink-0 mt-0.5 text-primary`}),A&&(0,$.jsx)(K,{className:`size-3.5 text-emerald-500 shrink-0 mt-1`}),j&&(0,$.jsx)(re,{className:`size-3.5 text-red-500 shrink-0 mt-1`}),(0,$.jsxs)(`div`,{className:Y(`flex-1 min-w-0 space-y-0.5`,u&&w&&`cursor-pointer`),onClick:u&&w&&S!==void 0?()=>w({type:`test`,testIndex:S}):void 0,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium text-foreground truncate`,children:t}),(0,$.jsx)(`div`,{className:`text-[11px] font-mono text-muted-foreground truncate`,children:n}),(0,$.jsx)(`div`,{className:`text-[10px] font-mono text-muted-foreground/70 truncate`,children:r}),P.length>0&&(0,$.jsx)(`div`,{className:`mt-1.5 space-y-1.5`,children:P.map(({step:e,displayStep:t},n)=>{let r=e.status===`running`||h===e.stepIndex,i=oe&&F===null&&(r||h===null&&n===P.length-1),a=F===e.id||i,o=t.subActionsData??[];return(0,$.jsxs)(`div`,{className:Y(`relative overflow-hidden rounded-sm border bg-background/60`,r?`live-running-surface border-border/60 bg-primary/5`:a?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-border/60`),children:[(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-center gap-2 px-2 py-1.5 text-left`,onClick:t=>{t.stopPropagation(),w?.({type:`step`,stepId:e.id})},"aria-label":`Select step ${e.stepIndex+1} ${e.instruction}`,children:[(0,$.jsx)(De,{status:e.status}),(0,$.jsxs)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:[`Step `,e.stepIndex+1]}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-foreground`,children:e.instruction})]}),(r||a)&&(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-2 gap-y-0.5 px-2 pb-1 text-[11px] text-muted-foreground`,children:[r&&(0,$.jsx)(`span`,{children:`Current step`}),a&&(0,$.jsx)(`span`,{children:`Inspecting below`})]}),o.length>0&&(0,$.jsx)(`div`,{className:`space-y-1 border-t border-border/50 px-2 py-1.5`,children:o.map(t=>(0,$.jsxs)(`button`,{type:`button`,className:Y(`flex w-full min-w-0 items-center gap-2 rounded-sm px-1.5 py-1 text-left text-[11px] transition-colors`,a&&L===t.index?`bg-primary/15 text-foreground`:`text-muted-foreground hover:bg-muted/40`),onClick:n=>{n.stopPropagation(),w?.({type:`subaction`,stepId:e.id,subIndex:t.index})},"aria-label":`Select sub-action ${t.index+1} for step ${e.stepIndex+1}`,children:[(0,$.jsxs)(`span`,{className:`shrink-0 font-medium`,children:[`Sub `,t.index+1]}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:Oe(t)})]},`${e.id}-sub-${t.index}`))})]},e.id)})}),i&&(0,$.jsx)(`div`,{className:`text-[11px] text-amber-700 dark:text-amber-300`,children:`This test file no longer exists in your workspace.`})]}),(0,$.jsxs)(`div`,{className:`mt-0.5 flex shrink-0 self-start items-center gap-1`,children:[M&&(0,$.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground whitespace-nowrap shrink-0`,children:Te(f)}),u&&!k&&(0,$.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:b,disabled:!y||!b||s,className:Y(`text-muted-foreground hover:text-foreground`,(!y||!b||s)&&`text-muted-foreground/30`),"aria-label":d===`idle`?`Run test ${t}`:`Re-run test ${t}`,children:(0,$.jsx)(de,{className:`size-3.5`})}),u&&k&&x&&(0,$.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:x,className:`text-muted-foreground hover:text-foreground`,"aria-label":`Cancel test ${t}`,children:(0,$.jsx)(I,{className:`size-3`})}),(0,$.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-destructive`,onClick:a,disabled:o||s,"aria-label":`Remove ${t}`,children:(0,$.jsx)(le,{className:`size-3.5`})})]})]}),j&&p&&(0,$.jsxs)(`p`,{className:`text-destructive text-xs mt-1 ml-7 line-clamp-2`,children:[p,` — see Reasoning tab for details`]}),N&&(0,$.jsxs)(`ul`,{className:`mt-1.5 space-y-1 pl-5`,children:[g.map(e=>{let t=C?.type===`test-hook`&&C.hookId===e.id;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>S!==void 0&&w?.({type:`test-hook`,testIndex:S,phase:`setup`,hookId:e.id}),className:Y(`relative flex w-full items-center gap-2 overflow-hidden rounded-sm border px-1.5 py-0.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-transparent bg-transparent hover:bg-muted/40`),children:[(0,$.jsx)(W,{className:`size-3 text-muted-foreground shrink-0`}),(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate flex-1`,children:[`setup: `,e.name]}),(0,$.jsx)(Ee,{status:e.status})]})},`setup-${e.id}`)}),_.map(e=>{let t=C?.type===`test-hook`&&C.hookId===e.id;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>S!==void 0&&w?.({type:`test-hook`,testIndex:S,phase:`teardown`,hookId:e.id}),className:Y(`relative flex w-full items-center gap-2 overflow-hidden rounded-sm border px-1.5 py-0.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-transparent bg-transparent hover:bg-muted/40`),children:[(0,$.jsx)(W,{className:`size-3 text-muted-foreground shrink-0`}),(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate flex-1`,children:[`teardown: `,e.name]}),(0,$.jsx)(Ee,{status:e.status})]})},`teardown-${e.id}`)})]})]})}function Ae({availableTests:e,onAdd:t,disabled:n=!1}){return e.length===0?(0,$.jsxs)(`div`,{className:`rounded-md border bg-card/20 p-3 text-sm text-muted-foreground`,children:[`No test files found.`,` `,(0,$.jsx)(Z,{to:`/tests/new`,className:`text-primary underline underline-offset-4 hover:text-primary/80`,children:`Create a test first.`})]}):(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(ge,{className:`rounded-md border`,children:[(0,$.jsx)(he,{placeholder:`Search by test name, path, or ID...`,disabled:n}),(0,$.jsxs)(pe,{className:`max-h-64`,children:[(0,$.jsx)(ve,{children:`No tests match your query.`}),(0,$.jsx)(fe,{children:e.map(e=>(0,$.jsx)(ye,{value:`${e.name} ${e.path} ${e.testId??``}`,onSelect:()=>t({test:e.path,id:e.testId??``}),disabled:n,className:`px-2 py-1.5`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5 w-full min-w-0`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e.name}),(0,$.jsx)(`span`,{className:`text-[11px] font-mono text-muted-foreground truncate`,children:e.path}),(0,$.jsx)(`span`,{className:`text-[10px] font-mono text-muted-foreground/70 truncate`,children:e.testId??``})]})},e.path))})]})]}),(0,$.jsx)(`p`,{className:`text-[10px] text-muted-foreground/60`,children:`Type to filter by name, path, or test ID. Click to add. Same test can be added multiple times.`})]})}var je=[`name`,`suite-id`,`target`,`use`,`context`,`setup`,`tests`,`teardown`];function Me(e){function t(e,n){if(S(e)){n?e.items.sort((e,t)=>{let n=je.indexOf(String(e.key)),r=je.indexOf(String(t.key));return(n===-1?je.length:n)-(r===-1?je.length:r)}):e.items.sort((e,t)=>String(e.key).localeCompare(String(t.key)));for(let n of e.items)t(n.value,!1)}}t(e.contents,!0)}function Ne(e){return Me(e),e.toString()}function Pe(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Fe(e){return Array.isArray(e)?e.map(e=>{if(e&&typeof e==`object`&&`test`in e&&`id`in e){let t=e;if(typeof t.test==`string`&&typeof t.id==`string`)return{test:t.test,id:t.id}}return null}).filter(e=>e!==null):[]}function Ie(e){try{let t=y(e);if(t.errors.length>0)return null;let n=t.toJSON();return!n||typeof n!=`object`?null:{name:n.name??``,suiteId:n[`suite-id`]??``,target:n.target??``,context:n.context??``,setup:Pe(n.setup),teardown:Pe(n.teardown),tests:Fe(n.tests)}}catch{return null}}function Le(e,t,n){try{let r=y(e);return n===void 0||Array.isArray(n)&&n.length===0||n===``?r.deleteIn(t):r.setIn(t,n),Ne(r)}catch{return e}}function Re(e,t,n){try{if(t===n||t<0||n<0)return e;let r=y(e),i=Fe(r.toJSON()?.tests);if(t>=i.length||n>=i.length)return e;let a=[...i],[o]=a.splice(t,1);return a.splice(n,0,o),r.setIn([`tests`],a),Ne(r)}catch{return e}}function ze(e,t){try{let n=y(e),r=Fe(n.toJSON()?.tests);return n.setIn([`tests`],[...r,t]),Ne(n)}catch{return e}}function Be(e,t){try{let n=y(e),r=Fe(n.toJSON()?.tests);if(t<0||t>=r.length)return e;let i=r.filter((e,n)=>n!==t);return i.length===0?n.deleteIn([`tests`]):n.setIn([`tests`],i),Ne(n)}catch{return e}}function Ve({text:e}){return(0,$.jsxs)(X,{children:[(0,$.jsx)(G,{asChild:!0,children:(0,$.jsx)(H,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,$.jsx)(U,{className:`max-w-[250px] text-[13px]`,children:e})]})}function He({status:e}){switch(e){case`running`:return(0,$.jsx)(D,{className:`size-3.5 text-primary`});case`passed`:return(0,$.jsx)(K,{className:`size-3.5 text-emerald-500`});case`failed`:return(0,$.jsx)(se,{className:`size-3.5 text-destructive`});default:return(0,$.jsx)(W,{className:`size-3.5 text-muted-foreground`})}}function Ue(e){return e===`running`||e===`cancelling`}function We(e){return e===`running`||e===`cancelling`}function Ge(e){return e===`running`}function Ke(e){return e.some(e=>Ge(e.status))}function qe(e){return Ue(e.status)||e.runningStepIndex!==null||e.liveSteps.some(e=>We(e.status))||Ke(e.perTestSetupHooks)||Ke(e.perTestTeardownHooks)}function Je({title:e,hooks:t,selection:n,onSelect:r}){return t.length===0?null:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider font-medium text-muted-foreground`,children:e}),(0,$.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>{let t=n?.type===`suite-hook`&&n.hookId===e.id;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>r?.({type:`suite-hook`,phase:e.phase,hookId:e.id}),className:Y(`relative flex w-full items-center gap-2 overflow-hidden rounded-md border px-3 py-1.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-border/60 bg-card/40 hover:bg-card/60`),children:[(0,$.jsx)(He,{status:e.status}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate text-sm`,children:e.name}),(0,$.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.id})]})]})},e.id)})})]})}function Ye({content:e,onChange:t,disabled:n=!1,suggestions:r,isCreateMode:i=!1,liveMode:a=!1,liveTests:s=[],liveSetupHooks:c=[],liveTeardownHooks:u=[],runningTestIndex:f=null,canRunTest:_=!0,canRunAll:v=!1,isRunningAll:y=!1,isStoppingRunAll:b=!1,onRunTest:S,onCancelTest:C,onRunAll:w,onStopAll:D,onRunLiveHook:ne,setupHooksStale:re=!1,onRestartSession:ie,selection:k=null,onSelect:ae}){let A=(0,Q.useRef)(null),{hooks:j,warningCopy:M}=T(),N=j??[],P=(0,Q.useMemo)(()=>Object.fromEntries(N.map(e=>[e.id,e.name])),[N]),[F,L]=(0,Q.useState)([]),[R,z]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{me().then(e=>L(e.files)).catch(()=>{})},[]),(0,Q.useEffect)(()=>{if(!R)return;function e(e){e.key===`Escape`&&z(!1)}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[R]);let B=Ie(e),V=B===null,H=B??A.current;B&&(A.current=B);let ce=ee(d(E,{activationConstraint:{distance:8}}),d(l,{coordinateGetter:x})),U=(0,Q.useCallback)((n,r)=>{t(Le(e,[n],r))},[e,t]),le=(0,Q.useCallback)(n=>{t(ze(e,n))},[e,t]),G=(0,Q.useCallback)(n=>{t(Be(e,n))},[e,t]),ue=H?.tests.map((e,t)=>`test-${t}`)??[],de=a&&(y||b),K=a&&(f!==null||s.some(e=>qe(e))||Ke(c)||Ke(u)),J=de||K,Y=de,fe=n||V||J,pe=(0,Q.useCallback)(r=>{if(n||V||J)return;let{active:i,over:a}=r;if(!a||i.id===a.id)return;let o=parseInt(String(i.id).replace(`test-`,``),10),s=parseInt(String(a.id).replace(`test-`,``),10);if(Number.isNaN(o)||Number.isNaN(s))return;let c=Re(e,o,s);c!==e&&t(c)},[e,n,t,J,V]);return(0,$.jsx)(`div`,{className:`flex flex-col`,children:(0,$.jsxs)(`div`,{className:`space-y-4 p-4`,children:[V&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive`,children:[(0,$.jsx)(o,{className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:`YAML has errors — builder shows last valid state`})]}),a&&re&&(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-700 dark:text-amber-300`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:[(0,$.jsx)(se,{className:`mt-0.5 size-4 shrink-0`}),(0,$.jsx)(`span`,{children:`Setup hooks changed — restart session to re-apply the latest setup and teardown hooks.`})]}),ie&&(0,$.jsx)(q,{type:`button`,size:`sm`,className:`shrink-0`,onClick:ie,children:`Restart Live Session`})]}),H?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(we,{name:H.name,suiteId:H.suiteId,target:H.target,context:H.context,isCreateMode:i,suggestions:r,hookLabels:P,onChange:U,disabled:n||V}),a&&(0,$.jsx)(Je,{title:`Setup Hooks (Live)`,hooks:c,selection:k,onSelect:ae}),(0,$.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-card/20 p-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(W,{className:`size-4 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Hooks`})]}),(0,$.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[H.setup.length+H.teardown.length,` `,H.setup.length+H.teardown.length===1?`hook`:`hooks`]})]}),M&&(0,$.jsxs)(`div`,{className:`flex gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300`,children:[(0,$.jsx)(o,{className:`mt-0.5 size-3.5 shrink-0`}),(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:M.title}),(0,$.jsx)(`p`,{children:M.body})]})]}),(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Search hook names or paste an h_ ID. Saved as stable ID in YAML. Inline runHook uses the stable hook ID.`}),(0,$.jsx)(p,{phase:`setup`,label:`Setup`,values:H.setup,suggestions:N,disabled:fe,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>U(`setup`,e)}),(0,$.jsx)(p,{phase:`teardown`,label:`Teardown`,values:H.teardown,suggestions:N,disabled:fe,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>U(`teardown`,e)})]})]}),a&&(0,$.jsx)(Je,{title:`Teardown Hooks (Live)`,hooks:u,selection:k,onSelect:ae}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1`,children:[`Tests in Suite`,` `,(0,$.jsx)(Ve,{text:`Tests run in the order shown. Drag to reorder. The suite fails fast if any referenced test is missing at save.`})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[H.tests.length,` `,H.tests.length===1?`test`:`tests`]}),a&&(0,$.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:y?D:w,disabled:b||!y&&!v,children:b?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(be,{className:`size-3.5 animate-spin`}),`Stopping...`]}):y?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(I,{className:`size-3.5`}),`Stop Run All`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(O,{className:`size-3.5`}),`Run All Tests`]})})]})]}),H.tests.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tests added yet. Use the picker below.`}):(0,$.jsx)(h,{sensors:ce,collisionDetection:te,onDragEnd:pe,children:(0,$.jsx)(m,{items:ue,strategy:g,children:(0,$.jsx)(`div`,{className:`space-y-1.5`,children:H.tests.map((e,t)=>{let r=F.find(t=>t.path===e.test),i=r?.name??e.test.split(`/`).pop()??e.test,o=F.length>0&&!r,c=a?s[t]:void 0,l=a?_&&f===null&&!Y:!0;return(0,$.jsx)(ke,{id:`test-${t}`,name:i,path:e.test,testId:e.id,isMissing:o,onRemove:()=>G(t),disabled:n||V,actionsLocked:Y,sortableDisabled:J,liveMode:a,liveStatus:c?.status,liveDuration:c?.duration,liveError:c?.error??null,liveSteps:c?.liveSteps??[],runningStepIndex:c?.runningStepIndex??null,perTestSetupHooks:c?.perTestSetupHooks??[],perTestTeardownHooks:c?.perTestTeardownHooks??[],canRunTest:l,onRunTest:a&&S?()=>S(t):void 0,onCancelTest:a&&C?()=>C(t):void 0,testIndex:t,selection:k,onSelect:ae},`test-${t}`)})})})})]}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Available Tests`}),(0,$.jsxs)(q,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>z(e=>!e),disabled:n||V||Y,"aria-expanded":R,"aria-controls":`suite-test-picker-region`,children:[(0,$.jsx)(oe,{className:`size-3`}),R?`Hide picker`:`Add new test`]})]}),R&&(0,$.jsx)(`div`,{id:`suite-test-picker-region`,children:(0,$.jsx)(Ae,{availableTests:F,onAdd:le,disabled:n||V||Y})})]})]}):(0,$.jsx)(`div`,{className:`flex items-center justify-center py-12 text-sm text-muted-foreground`,children:`Enter valid YAML to use the visual builder`})]})})}function Xe({suiteName:e,suiteId:t,unsaved:n,isCreateMode:r,mode:i=`view`,suiteHref:a,isSaving:o,isValidating:s,isRunning:c,runDisabled:l=!1,hasInvalidFilename:u,shortcutsOpen:d,showSuiteId:f=!0,hasLiveSession:p=!1,liveConnectionState:m=`idle`,isLiveActionDisabled:h=!1,liveSessionNumber:g=null,onSave:_,onValidate:v,onRun:y,onLiveConnect:b,onLiveEnd:x,onSettingsOpen:S,onToggleShortcuts:C}){let T=i===`view`&&!r,E=!!b||!!x||p||m===`connecting`,D=!r||E,ee=!r&&!T&&i===`edit`,te=`Start a disposable live session for this suite. Setup hooks run on connect, included tests run serially on a shared browser context, teardown hooks run when the session ends, and changes are not saved automatically.`;return(0,$.jsxs)(`div`,{"data-testid":`suite-navbar-root`,className:`flex h-14 shrink-0 items-center justify-between border-b px-4 min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(Z,{to:`/suites`,className:`text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:`Suites`}),(0,$.jsx)(J,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),r?(0,$.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`New Suite`}):a&&!T?(0,$.jsx)(Z,{to:a,className:`truncate text-sm font-medium hover:text-primary transition-colors`,children:e}):(0,$.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e}),ee&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(J,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,$.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`Edit`})]}),n&&(0,$.jsx)(xe,{variant:`outline`,className:`text-xs`,children:`Unsaved`}),!T&&!r&&t&&f&&(0,$.jsx)(w,{label:`S`,value:t})]}),(0,$.jsx)(`div`,{className:`flex items-center gap-3 shrink-0`,children:T?(0,$.jsxs)($.Fragment,{children:[a?(0,$.jsx)(q,{variant:`outline`,size:`sm`,asChild:!0,children:(0,$.jsxs)(Z,{to:a,children:[`Edit`,(0,$.jsx)(M,{shortcut:`E`})]})}):(0,$.jsxs)(q,{variant:`outline`,size:`sm`,disabled:!0,children:[`Edit`,(0,$.jsx)(M,{shortcut:`E`})]}),(0,$.jsx)(k,{onRun:y,disabled:c||l,label:c?`Running...`:`Run`,shortcutKey:`R`,size:`sm`}),E&&(0,$.jsxs)(X,{children:[(0,$.jsx)(G,{asChild:!0,children:(0,$.jsxs)(q,{size:`sm`,onClick:b,disabled:h||!b,children:[m===`connecting`?(0,$.jsx)(be,{className:`h-3.5 w-3.5 animate-spin`}):(0,$.jsx)(O,{className:`h-3.5 w-3.5`}),m===`connecting`?`Connecting...`:`Connect Live Session`,(0,$.jsx)(M,{shortcut:`L`,className:`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`})]})}),(0,$.jsx)(U,{className:`max-w-sm text-[13px]`,children:te})]}),!r&&(0,$.jsxs)(V,{open:d,onOpenChange:e=>{e||C()},children:[(0,$.jsxs)(X,{children:[(0,$.jsx)(G,{asChild:!0,children:(0,$.jsx)(B,{asChild:!0,children:(0,$.jsx)(q,{variant:`ghost`,size:`icon-sm`,onClick:C,"aria-label":`Shortcuts`,children:(0,$.jsx)(j,{className:`h-3.5 w-3.5`})})})}),(0,$.jsx)(U,{children:`Shortcuts`})]}),(0,$.jsx)(z,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,$.jsx)(`div`,{className:`space-y-3`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,$.jsx)(A,{hints:[{key:`E`,label:`Edit`},{key:`R`,label:`Run`},{key:`L`,label:`Connect Live Session`}]})]})})})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(q,{variant:`ghost`,size:`sm`,onClick:v,disabled:s||u,children:[(0,$.jsx)(K,{className:`h-3.5 w-3.5`}),s?`Validating...`:`Validate`]}),(0,$.jsxs)(q,{variant:`ghost`,size:`sm`,onClick:_,disabled:o||u,children:[(0,$.jsx)(ne,{className:`h-3.5 w-3.5`}),o?`Saving...`:`Save`]}),(0,$.jsxs)(q,{variant:`ghost`,size:`sm`,onClick:S,children:[(0,$.jsx)(P,{className:`h-3.5 w-3.5`}),`Settings`]}),D&&(0,$.jsx)(`div`,{className:`h-4 w-px bg-border`}),!r&&(0,$.jsxs)(X,{children:[(0,$.jsx)(G,{asChild:!0,children:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(k,{onRun:y,disabled:c||l||p,label:c?`Running...`:`Run Suite`,size:`sm`})})}),p&&(0,$.jsx)(U,{children:`End the live session to queue a new suite run.`})]}),E&&(p&&m!==`connecting`?(0,$.jsxs)(q,{variant:`destructive`,size:`sm`,onClick:x,disabled:!x,children:[(0,$.jsx)(I,{className:`h-3.5 w-3.5`}),`End Live Session`]}):(0,$.jsxs)(X,{children:[(0,$.jsx)(G,{asChild:!0,children:(0,$.jsxs)(q,{size:`sm`,onClick:b,disabled:h||!b,children:[m===`connecting`?(0,$.jsx)(be,{className:`h-3.5 w-3.5 animate-spin`}):(0,$.jsx)(O,{className:`h-3.5 w-3.5`}),m===`connecting`?`Connecting...`:`Connect Live Session`]})}),(0,$.jsx)(U,{className:`max-w-sm text-[13px]`,children:te})]})),!T&&p&&typeof g==`number`&&(m===`connected`||m===`executing`)&&(0,$.jsxs)(xe,{variant:`outline`,"aria-live":`polite`,className:`text-[10px] tracking-wider font-medium text-muted-foreground bg-muted/50 border-border/50`,children:[`Session #`,g]}),!r&&(0,$.jsxs)(V,{open:d,onOpenChange:e=>{e||C()},children:[(0,$.jsxs)(X,{children:[(0,$.jsx)(G,{asChild:!0,children:(0,$.jsx)(B,{asChild:!0,children:(0,$.jsx)(q,{variant:`ghost`,size:`icon-sm`,onClick:C,children:(0,$.jsx)(j,{className:`h-3.5 w-3.5`})})})}),(0,$.jsx)(U,{children:`Shortcuts`})]}),(0,$.jsx)(z,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,$.jsx)(`div`,{className:`space-y-3`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,$.jsx)(A,{hints:[{key:`R`,label:`Run suite`},{key:`Cmd+S`,label:`Save`},{key:`Esc`,label:`Close results panel`}]})]})})})]})]})})]})}export{Le as i,Ye as n,Ie as r,Xe as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-DF4W-NC-.js";import{t as n}from"./file-code-BpwHxsqo.js";import{n as r}from"./split-button-wGcE-JDx.js";import{t as i}from"./zap-BYpQfhU4.js";import{t as a}from"./use-page-title-B4YPyIzc.js";import{a as o,n as s,o as ee,t as c}from"./insights-line-grid-DKZyKGcI.js";import{i as l,n as u,r as d,t as f}from"./tabs-DzjvuMEX.js";import{$n as p,At as m,Gt as h,Jt as g,Kt as _,Mt as v,Nt as te,Pt as y,Qn as b,St as ne,Ut as x,at as re,cr as ie,jt as S,lr as ae,ot as oe,pr as C,qt as w,r as se,sr as T,ur as ce}from"./index-B4FdO6Vk.js";import{t as E}from"./badge-CC1v3nk4.js";import{a as D,i as O,n as k,o as A,r as j,t as M}from"./table-QG2rKYu8.js";import{t as le}from"./empty-state-BfgY0UGA.js";import{t as ue}from"./use-keyboard-shortcuts-Bal_Cx9w.js";import{n as de,t as fe}from"./suite-navbar-B8gZoPMT.js";import{n as pe,r as me,t as he}from"./viewer-url-state-ClEUZJMl.js";var N=e(C(),1),P=b(),ge=[`builder`,`yaml`,`memory`];function _e(e){let t=e.trim();return t.length>=2&&(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))?t.slice(1,-1).trim():t}function F(e){return{suiteId:e,total:0,flakyScore:0,isFlaky:!1,runs:[],trends:{daily:[],passRate:0,totalRuns:0,avgDuration:0}}}function I(e){if(!e)return``;let t=new Date(g(e)),n=Date.now()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);if(a<24)return`${a}h ago`;let o=Math.floor(a/24);return o<7?`${o}d ago`:h(e)}function L({status:e}){switch(e){case`passed`:return(0,P.jsx)(E,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,P.jsx)(E,{variant:`destructive`,children:`Failed`});case`healed`:return(0,P.jsx)(E,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,P.jsx)(E,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,P.jsx)(E,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,P.jsx)(E,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,P.jsx)(E,{variant:`outline`,children:e})}}function R({configured:e,mode:t,scopedCount:n,totalCount:r,onModeChange:i}){return e?(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[`scoped`,`all`].map(e=>(0,P.jsx)(x,{type:`button`,size:`xs`,variant:t===e?`default`:`ghost`,"aria-pressed":t===e,className:`h-7 rounded-[2px] px-2 text-xs`,onClick:()=>i(e),children:e===`scoped`?`Scoped`:`All runs`},e))}),(0,P.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` scoped / `,r,` total runs`]})]}):(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No analytics scope configured`})}function z({runs:e,compactDate:t=!1}){return e.length===0?(0,P.jsx)(`div`,{className:`flex items-center justify-center h-16 text-sm text-muted-foreground`,children:`No runs yet`}):(0,P.jsxs)(M,{children:[(0,P.jsx)(D,{children:(0,P.jsxs)(A,{children:[(0,P.jsx)(O,{children:`Status`}),(0,P.jsx)(O,{children:`Duration`}),(0,P.jsx)(O,{children:`Date`})]})}),(0,P.jsx)(k,{children:e.map(e=>(0,P.jsxs)(A,{className:`relative cursor-pointer hover:bg-muted/50`,children:[(0,P.jsxs)(j,{children:[(0,P.jsx)(T,{to:p.runDetailOrLive(e.id,e.status),className:`absolute inset-0`,tabIndex:-1}),(0,P.jsx)(L,{status:e.status})]}),(0,P.jsx)(j,{children:e.status===`running`?(0,P.jsx)(`span`,{className:`text-blue-500 text-sm`,children:`In progress...`}):(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:w(e.duration)})}),(0,P.jsx)(j,{children:t?(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:I(e.createdAt)}):(0,P.jsxs)(S,{children:[(0,P.jsx)(y,{asChild:!0,children:(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:h(e.createdAt)})}),(0,P.jsx)(v,{children:_(e.createdAt)})]})})]},e.id))})]})}function B(){let e=ae(),h=ie(),[g,_]=ce(),{defaultRunMode:v}=r(),y=e[`suite-id`]??``,b=(0,N.useMemo)(()=>he(g,ge),[g]),x=(0,N.useMemo)(()=>pe(b,g),[g,b]),S=b.tab,C=b.view,[T,D]=(0,N.useState)(``),[O,k]=(0,N.useState)(``),[A,j]=(0,N.useState)(!0),[M,I]=(0,N.useState)(!1),[L,B]=(0,N.useState)(()=>F(y)),[V,H]=(0,N.useState)(`all`),[U,W]=(0,N.useState)(!1),[ve,ye]=(0,N.useState)(!1),G=(0,N.useMemo)(()=>{let e=T.match(/^name:\s*(.+)$/m);return e?_e(e[1]):null},[T]);a(G||`Suite`);let K=L.scope?.configured===!0,q=V===`scoped`&&K&&L.scopedTrends?L.scopedTrends:L.trends,J=V===`scoped`&&K&&L.scopedFlakyScore!==void 0?L.scopedFlakyScore:L.flakyScore,be=V===`scoped`&&K?L.scopedRuns??[]:L.runs,xe=(0,N.useMemo)(()=>q.daily.map(e=>({date:e.date,passRate:e.total>0?Math.round(e.passed/e.total*1e3)/10:0})),[q]),Se=(0,N.useMemo)(()=>L.trends.daily.map(e=>({date:e.date,duration:e.avgDuration})),[L]),Y=be;(0,N.useEffect)(()=>{H(L.scope?.configured?`scoped`:`all`)},[L]),(0,N.useEffect)(()=>{x.toString()!==g.toString()&&_(x,{replace:!0})},[x,g,_]),(0,N.useEffect)(()=>{if(!y){I(!0),j(!1),B(F(``));return}let e=!1;return j(!0),I(!1),D(``),k(``),B(F(y)),oe(y).then(t=>{e||(D(t.content),k(t.path))}).catch(()=>{e||(I(!0),m.error(`Failed to load suite file`))}).finally(()=>{e||j(!1)}),()=>{e=!0}},[y]),(0,N.useEffect)(()=>{if(!y)return;let e=!1;return re(y,{limit:50}).then(t=>{e||B(t)}).catch(()=>{e||B(F(y))}),()=>{e=!0}},[y]);let X=async e=>{if(!(U||!O)){W(!0);try{let t=await ne({file:O,local:e});m.success(`Run started`),h(p.runLive(t.runId))}catch(e){m.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`)}finally{W(!1)}}},Z=p.suiteEdit(y),Q=`${Z}?live=1`;ue({e:()=>h(Z),r:()=>{O&&X(v===`local`)},l:()=>h(Q)});let $=e=>{_(pe(e,g),{replace:!0})};if(A)return(0,P.jsx)(se,{});if(M)return(0,P.jsx)(le,{icon:n,title:`Suite not found`,description:`This suite doesn't exist`,actionLabel:`View All Suites`,onAction:()=>h(p.suites)});let Ce=(0,P.jsx)(de,{content:T,onChange:()=>{},disabled:!0,suggestions:[]}),we=(0,P.jsx)(t,{value:T,onChange:()=>{},readOnly:!0,className:`h-full`}),Te=(0,P.jsxs)(`aside`,{"data-testid":`suite-detail-analytics-sidebar`,className:`flex flex-col gap-0 overflow-y-auto border-t border-border md:border-t-0 md:border-l md:border-border`,children:[(0,P.jsx)(`div`,{className:`border-b border-border px-3 py-2`,children:(0,P.jsx)(R,{configured:K,mode:V,scopedCount:L.scope?.scopedCount??0,totalCount:L.scope?.totalCount??L.total,onModeChange:H})}),(0,P.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 border-x-0 border-t-0`,children:[(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Pass Rate`}),(0,P.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[Math.round(q.passRate*100),`%`]})]}),(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Avg Duration`}),(0,P.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:w(L.trends.avgDuration)})]}),(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Total Runs`}),(0,P.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:L.total.toLocaleString()})]}),(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Flaky Score`}),(0,P.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[(J*100).toFixed(0),`%`]})]})]}),(0,P.jsx)(s,{className:`border-x-0 border-y-0`,children:(0,P.jsxs)(c,{className:`flex flex-col gap-2 px-3 py-3`,children:[(0,P.jsxs)(`span`,{className:`text-sm font-medium text-foreground`,children:[V===`scoped`&&K?`Scoped Runs`:`All Runs`,` (`,Y.length,`)`]}),(0,P.jsx)(z,{runs:Y.slice(0,5),compactDate:!0})]})})]});return(0,P.jsx)(te,{children:(0,P.jsxs)(`div`,{className:`flex flex-col h-screen`,children:[(0,P.jsx)(fe,{suiteName:G||`Suite`,suiteId:y,unsaved:!1,isCreateMode:!1,mode:`view`,suiteHref:Z,isSaving:!1,isValidating:!1,isRunning:U,runDisabled:!O,hasInvalidFilename:!1,shortcutsOpen:ve,showSuiteId:!1,onBack:()=>h(p.suites),onSave:()=>{},onValidate:()=>{},onRun:e=>X(e),onLiveConnect:()=>h(Q),onSettingsOpen:()=>{},onToggleShortcuts:()=>ye(e=>!e)}),(0,P.jsxs)(f,{value:S,onValueChange:e=>$({tab:e,view:C}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,P.jsx)(`div`,{className:`px-4 border-b border-border`,children:(0,P.jsxs)(d,{variant:`line`,children:[(0,P.jsx)(l,{value:`overview`,children:`Overview`}),(0,P.jsx)(l,{value:`insights`,children:`Insights`})]})}),(0,P.jsxs)(u,{value:`overview`,className:`flex-1 min-h-0 mt-0 grid grid-cols-1 md:grid-cols-[minmax(480px,1fr)_minmax(260px,320px)]`,children:[(0,P.jsx)(`div`,{className:`min-w-0 min-h-0 flex flex-col`,children:(0,P.jsxs)(f,{value:C,onValueChange:e=>$({tab:S,view:e}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,P.jsx)(`div`,{className:`border-b border-border`,children:(0,P.jsxs)(d,{variant:`line`,className:`w-full grid grid-cols-3 px-4 md:w-fit md:inline-flex`,children:[(0,P.jsx)(l,{value:`builder`,children:`Builder`}),(0,P.jsx)(l,{value:`yaml`,children:`YAML`}),(0,P.jsx)(l,{value:`memory`,children:`Memory`})]})}),(0,P.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[(0,P.jsx)(u,{value:`builder`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:Ce}),(0,P.jsx)(u,{value:`yaml`,className:`absolute inset-0 data-[state=inactive]:hidden`,children:we}),(0,P.jsx)(u,{value:`memory`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:(0,P.jsx)(me,{scope:`suite`,scopeId:y,emptyTitle:`No suite memory yet`,emptyDescription:`This suite doesn't have cataloged observations in this workspace yet. Run the suite with memory enabled, then reopen this tab.`})})]})]})}),Te]}),(0,P.jsx)(u,{value:`insights`,className:`flex-1 overflow-y-auto mt-0`,children:(0,P.jsxs)(`div`,{"data-testid":`suite-detail-insights`,className:`space-y-3 px-4 py-3`,children:[L.isFlaky&&(0,P.jsxs)(E,{variant:`destructive`,children:[(0,P.jsx)(i,{className:`size-3`}),`Flaky (score: `,L.flakyScore.toFixed(2),`)`]}),(0,P.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 md:grid-cols-4`,children:[(0,P.jsx)(c,{className:`border-b border-border md:border-b-0`,children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Total Runs`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:L.total.toLocaleString()})]})}),(0,P.jsx)(c,{className:`border-b border-border md:border-b-0 md:border-r`,children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pass Rate`}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:[Math.round(q.passRate*100),`%`]})]})}),(0,P.jsx)(c,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Avg Duration`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:w(L.trends.avgDuration)})]})}),(0,P.jsx)(c,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Flaky Score`}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:[(J*100).toFixed(0),`%`]})]})})]}),(0,P.jsx)(s,{children:(0,P.jsx)(c,{className:`px-4 py-3`,children:(0,P.jsx)(R,{configured:K,mode:V,scopedCount:L.scope?.scopedCount??0,totalCount:L.scope?.totalCount??L.total,onModeChange:H})})}),q.daily.length>0&&(0,P.jsxs)(s,{className:`md:grid-cols-2 md:divide-x md:divide-y-0`,children:[(0,P.jsxs)(c,{className:`px-4 py-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Pass Rate`}),(0,P.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,P.jsx)(ee,{data:xe})})]}),(0,P.jsxs)(c,{className:`px-4 py-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Duration`}),(0,P.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,P.jsx)(o,{data:Se})})]})]}),(0,P.jsx)(s,{children:(0,P.jsxs)(c,{className:`px-4 py-3`,children:[(0,P.jsxs)(`p`,{className:`text-sm font-medium mb-2`,children:[V===`scoped`&&K?`Scoped Runs`:`All Runs`,` (`,Y.length,`)`]}),(0,P.jsx)(z,{runs:Y})]})})]})})]})]})})}export{B as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-DD6yziGv.js";import{i as n,n as r,o as i,s as a,t as o}from"./select-D5oFJNaq.js";import{n as s,r as c}from"./shortcut-hints-CtwepXR1.js";import{t as ee}from"./plus-Qf7V331e.js";import{t as te}from"./use-page-title-B4YPyIzc.js";import{t as l}from"./batch-action-bar-D1IfTx55.js";import{n as ne,t as re}from"./scroll-area-BmkJ1y7Q.js";import{$n as u,At as d,Gt as ie,Ht as ae,M as oe,Mt as se,Nt as ce,Pt as f,Qn as p,St as m,Ut as h,Vn as le,Wt as g,a as ue,cr as de,jt as fe,nt as pe,pr as _,sr as me,st as he,ur as v}from"./index-B4FdO6Vk.js";import{t as y}from"./badge-CC1v3nk4.js";import{a as ge,i as _e,n as ve,o as ye,r as be,t as b}from"./lib-B9z0w3j9.js";import{a as xe,i as Se,n as Ce,o as x,r as S,t as we}from"./table-QG2rKYu8.js";import{t as Te}from"./empty-state-BfgY0UGA.js";import{t as C}from"./use-keyboard-shortcuts-Bal_Cx9w.js";import{n as w,r as T,t as E}from"./tests-suites-table-widths-D49Zcf1r.js";var D=e(_(),1);function O(){let[e,t]=v(),n=e.get(`status`)??``,r=e.get(`platform`)??``,i=e.get(`sort`)??``,a=e.get(`order`)??`desc`,o=(0,D.useCallback)((e,n)=>{t(t=>{let r=new URLSearchParams(t);return n?r.set(e,n):r.delete(e),r},{replace:!0})},[t]),s=(0,D.useMemo)(()=>i?[{id:i,desc:a===`desc`}]:[],[i,a]),c=(0,D.useRef)(s);return c.current=s,{status:n,platform:r,sort:i,order:a,sorting:s,onSortingChange:(0,D.useCallback)(e=>{let n=typeof e==`function`?e(c.current):e;t(e=>{let t=new URLSearchParams(e);return n.length>0?(t.set(`sort`,n[0].id),t.set(`order`,n[0].desc?`desc`:`asc`)):(t.delete(`sort`),t.delete(`order`)),t},{replace:!0})},[t]),setStatus:(0,D.useCallback)(e=>o(`status`,e),[o]),setPlatform:(0,D.useCallback)(e=>o(`platform`,e),[o])}}var k=p(),Ee=new Set([`passed`,`healed`]),De=new Set([`passed`,`healed`,`failed`,`flaky`,`cancelled`]),Oe=50;function ke(e){return e?e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1):`—`}function A(e){return e.createdAt||e.startedAt||e.endedAt||``}function Ae({status:e}){switch(e){case`passed`:return(0,k.jsx)(y,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,k.jsx)(y,{variant:`destructive`,children:`Failed`});case`healed`:return(0,k.jsx)(y,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,k.jsx)(y,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,k.jsx)(y,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,k.jsx)(y,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,k.jsx)(y,{variant:`outline`,children:e})}}function je(e){return g(`h-10 bg-background text-[13px] font-medium text-foreground/90`,e===`select`?`px-2 text-center`:`px-3`,(e===`passRate`||e===`lastRun`)&&`text-right`)}function Me(e){return g(`py-2 align-top`,e===`select`&&`px-2`,e===`name`&&`max-w-0 px-3`,e===`targetName`&&`max-w-0 px-3`,e===`platform`&&`px-3`,e===`passRate`&&`px-3 text-right`,e===`lastRun`&&`max-w-0 px-3 text-right`)}function Ne({isActive:e,isBatchSelected:t}){return g(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary/60`,t&&!e&&`bg-muted/20`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function j(){te(`Suites`);let[e,p]=(0,D.useState)([]),[_,v]=(0,D.useState)([]),[y,j]=(0,D.useState)(!0),[M,N]=(0,D.useState)({}),[Pe,P]=(0,D.useState)(!1),[Fe,Ie]=(0,D.useState)([]),[F,I]=(0,D.useState)(-1),L=(0,D.useRef)([]),R=de(),{status:z,platform:B,sorting:Le,onSortingChange:Re,setStatus:ze,setPlatform:Be}=O();(0,D.useEffect)(()=>{let e=!1;return Promise.all([he(),pe({limit:200})]).then(([t,n])=>{e||(p(t.files),v(n.runs))}).catch(()=>{e||d.error(`Failed to load suites`)}).finally(()=>{e||j(!1)}),()=>{e=!0}},[]);let V=(0,D.useMemo)(()=>e.map(e=>{let t=[..._.filter(t=>t.suiteId&&e.suiteId?t.suiteId===e.suiteId:t.suiteId?!1:t.name===e.name)].sort((e,t)=>A(t).localeCompare(A(e))),n=t.filter(e=>De.has(e.status)),r=n.filter(e=>Ee.has(e.status)).length,i=n.length>0?Math.round(r/n.length*100):null,a=t[0]??null,o=t.find(e=>e.targetName?.trim())??null;return{path:e.path,suiteId:e.suiteId,name:e.name,platform:e.platform??o?.platform??a?.platform??null,lastRunStatus:a?.status??null,lastRun:a,targetName:o?.targetName?.trim()??a?.targetName?.trim()??null,passRate:i,passCount:r,completedRunCount:n.length}}),[e,_]),H=(0,D.useMemo)(()=>{let e=V;return z&&(e=z===`no-runs`?e.filter(e=>!e.lastRunStatus):e.filter(e=>e.lastRunStatus===z)),B&&(e=e.filter(e=>e.platform===B)),e},[V,z,B]),Ve={id:`select`,header:({table:e})=>(0,k.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,k.jsx)(T,{checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&`indeterminate`,onCheckedChange:t=>e.toggleAllPageRowsSelected(t),ariaLabel:`Select all`})}),cell:({row:e})=>(0,k.jsx)(T,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(t)}),enableSorting:!1,size:48},U=(0,D.useMemo)(()=>[{accessorKey:`name`,header:({column:e})=>(0,k.jsxs)(h,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Name`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,k.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:e.getValue(`name`)}),(0,k.jsx)(`span`,{className:`block whitespace-normal break-all text-xs leading-snug text-muted-foreground`,children:e.original.path})]}),size:400,filterFn:(e,t,n)=>{let r=e.getValue(`name`).toLowerCase(),i=e.original.path.toLowerCase(),a=n.toLowerCase();return r.includes(a)||i.includes(a)}},{accessorKey:`targetName`,header:({column:e})=>(0,k.jsxs)(h,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Target`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsx)(`span`,{className:`block whitespace-normal break-words text-sm leading-snug text-muted-foreground`,children:e.original.targetName??`No target`})},{accessorKey:`platform`,header:({column:e})=>(0,k.jsxs)(h,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Platform`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:ke(e.getValue(`platform`))})},{accessorKey:`passRate`,header:({column:e})=>(0,k.jsxs)(h,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Pass rate`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>e.original.passRate===null?(0,k.jsxs)(`div`,{className:`space-y-0.5 text-right`,children:[(0,k.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`No runs`}),(0,k.jsx)(`div`,{className:`text-xs tabular-nums text-muted-foreground`,children:`0 completed`})]}):(0,k.jsxs)(`div`,{className:`space-y-0.5 text-right`,children:[(0,k.jsxs)(`div`,{className:`text-sm font-medium tabular-nums text-foreground`,children:[e.original.passRate,`%`]}),(0,k.jsxs)(`div`,{className:`text-xs tabular-nums text-muted-foreground`,children:[e.original.passCount,`/`,e.original.completedRunCount]})]})},{id:`lastRun`,accessorFn:e=>e.lastRun?.createdAt??e.lastRun?.startedAt??e.lastRun?.endedAt??``,header:({column:e})=>(0,k.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,k.jsxs)(h,{variant:`ghost`,className:`h-auto justify-end px-0 text-[13px] font-medium text-foreground/90 hover:bg-transparent`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Last run`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]})}),cell:({row:e})=>e.original.lastRun?(0,k.jsxs)(me,{to:u.runDetail(e.original.lastRun.id),className:`relative z-10 flex w-full flex-col items-end gap-1 rounded-sm text-right focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60`,onClick:e=>e.stopPropagation(),children:[(0,k.jsx)(Ae,{status:e.original.lastRun.status}),(0,k.jsx)(`span`,{className:`whitespace-normal break-words text-xs leading-snug text-muted-foreground`,children:ie(A(e.original.lastRun))})]}):(0,k.jsx)(`span`,{className:`block text-sm text-muted-foreground`,children:`No runs`})}],[]),W=(0,D.useMemo)(()=>Object.keys(M).filter(e=>M[e]),[M]),G=(0,D.useMemo)(()=>H.filter(e=>W.includes(e.path)),[H,W]),K=(0,D.useCallback)(async e=>{if(G.length!==0){P(!0);try{let t=await Promise.allSettled(G.map(t=>m({file:t.path,local:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;r>0?d.error(`${n} runs queued, ${r} failed`):d.success(`${n} runs queued`),N({})}finally{P(!1)}}},[G]),He=(0,D.useCallback)(async e=>{if(G.length!==0){P(!0);try{let t=await Promise.allSettled(G.map(t=>m({file:t.path,noCache:!0,local:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;r>0?d.error(`${n} runs queued (no cache), ${r} failed`):d.success(`${n} runs queued (no cache)`),N({})}finally{P(!1)}}},[G]),Ue=(0,D.useCallback)(async()=>{if(G.length!==0){P(!0);try{let e=await Promise.allSettled(G.map(e=>oe(e.path))),t=G.filter((t,n)=>e[n]?.status===`fulfilled`),n=new Set(t.map(e=>e.path)),r=e.length-t.length;t.length>0&&(p(e=>e.filter(e=>!n.has(e.path))),N(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e))))),r>0?d.error(`Deleted ${t.length} suite${t.length===1?``:`s`}, ${r} failed`):d.success(`Deleted ${t.length} suite${t.length===1?``:`s`}`)}finally{P(!1)}}},[G]),q=ve({data:H,columns:[Ve,...U],getCoreRowModel:be(),getSortedRowModel:ye(),getFilteredRowModel:_e(),getPaginationRowModel:ge(),onSortingChange:Re,onColumnFiltersChange:Ie,enableRowSelection:!0,onRowSelectionChange:N,getRowId:e=>e.path,state:{sorting:Le,columnFilters:Fe,rowSelection:M},initialState:{pagination:{pageSize:Oe}}}),J=q.getRowModel().rows,Y=q.getColumn(`name`)?.getFilterValue()??``,We=(0,D.useCallback)(e=>{q.getColumn(`name`)?.setFilterValue(e||void 0),q.setPageIndex(0),I(-1),N({})},[q]);C((0,D.useMemo)(()=>{let e=()=>I(e=>Math.min(e+1,J.length-1)),t=()=>I(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{if(F>=0&&J[F]){let t=J[F].original;if(!t.suiteId)return;let n=u.suiteView(t.suiteId);e.metaKey||e.ctrlKey?window.open(n,`_blank`):R(n)}}}},[J,F,R])),(0,D.useEffect)(()=>{if(F<0)return;let e=L.current[F];e&&document.activeElement!==e&&e.focus()},[F,J.length]);let X=(0,D.useCallback)((e,t)=>{e.suiteId&&(t&&t.preventDefault(),R(u.suiteView(e.suiteId)))},[R]);if(y)return(0,k.jsx)(ue,{});if(e.length===0)return(0,k.jsx)(Te,{icon:le,title:`No suites found`,description:`Create your first suite file`,actionLabel:`New Suite`,onAction:()=>R(u.suiteNew)});let Z=q.getFilteredRowModel().rows.length,Ge=q.getState().pagination.pageIndex,Q=q.getState().pagination.pageSize,$=Ge*Q+1,Ke=Math.min($+Q-1,Z);return(0,k.jsx)(ce,{children:(0,k.jsxs)(`div`,{className:`space-y-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,k.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Suites`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(fe,{children:[(0,k.jsx)(f,{asChild:!0,children:(0,k.jsx)(h,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,k.jsx)(c,{className:`h-4 w-4`})})}),(0,k.jsx)(se,{side:`bottom`,className:`p-3`,children:(0,k.jsx)(s,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open suite`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]}),(0,k.jsxs)(h,{size:`sm`,onClick:()=>R(u.suiteNew),children:[(0,k.jsx)(ee,{className:`size-4`}),`New Suite`]})]})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,k.jsx)(ae,{placeholder:`Search suites...`,value:Y,onChange:e=>We(e.target.value),className:`max-w-[220px]`}),(0,k.jsxs)(o,{value:z||`all`,onValueChange:e=>{ze(e===`all`?``:e),I(-1),N({})},children:[(0,k.jsx)(i,{className:`w-[150px]`,children:(0,k.jsx)(a,{placeholder:`All statuses`})}),(0,k.jsxs)(r,{children:[(0,k.jsx)(n,{value:`all`,children:`All statuses`}),(0,k.jsx)(n,{value:`passed`,children:`Passed`}),(0,k.jsx)(n,{value:`failed`,children:`Failed`}),(0,k.jsx)(n,{value:`running`,children:`Running`}),(0,k.jsx)(n,{value:`no-runs`,children:`No runs`})]})]}),(0,k.jsxs)(o,{value:B||`all`,onValueChange:e=>{Be(e===`all`?``:e),I(-1),N({})},children:[(0,k.jsx)(i,{className:`w-[140px]`,children:(0,k.jsx)(a,{placeholder:`All platforms`})}),(0,k.jsxs)(r,{children:[(0,k.jsx)(n,{value:`all`,children:`All platforms`}),(0,k.jsx)(n,{value:`web`,children:`Web`}),(0,k.jsx)(n,{value:`android`,children:`Android`}),(0,k.jsx)(n,{value:`ios`,children:`iOS`})]})]})]}),(0,k.jsxs)(re,{className:`rounded-md border`,children:[(0,k.jsxs)(we,{className:`min-w-full table-fixed`,children:[(0,k.jsx)(`colgroup`,{children:E.map(e=>{let t=w(e);return(0,k.jsx)(`col`,{"data-column-id":e,style:t?{width:t}:void 0},e)})}),(0,k.jsx)(xe,{children:q.getHeaderGroups().map(e=>(0,k.jsx)(x,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,k.jsx)(Se,{className:je(e.column.id),children:e.isPlaceholder?null:b(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,k.jsx)(Ce,{children:J.length?J.map((e,t)=>{let n=t===F,r=e.getIsSelected();return(0,k.jsx)(x,{ref:e=>{L.current[t]=e},"data-runs-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:Ne({isActive:n,isBatchSelected:r}),onClick:()=>{I(t),X(e.original)},onFocus:()=>I(t),onKeyDown:t=>{t.key===`Enter`&&X(e.original,t)},children:e.getVisibleCells().map(e=>{let t=e.column.id===`select`;return(0,k.jsx)(S,{className:g(Me(e.column.id),t&&`relative z-10`),children:b(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)}):(0,k.jsx)(x,{children:(0,k.jsx)(S,{colSpan:U.length+1,className:`h-24 text-center`,children:`No results.`})})})]}),(0,k.jsx)(ne,{orientation:`horizontal`})]}),(0,k.jsxs)(`div`,{className:`flex items-center justify-between px-2`,children:[(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Z>0?`Showing ${$}-${Ke} of ${Z}${Y||z||B?` (${V.length} total)`:``}`:`No suites found`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(h,{variant:`outline`,size:`sm`,onClick:()=>q.previousPage(),disabled:!q.getCanPreviousPage(),children:`Previous`}),(0,k.jsx)(h,{variant:`outline`,size:`sm`,onClick:()=>q.nextPage(),disabled:!q.getCanNextPage(),children:`Next`})]})]}),(0,k.jsx)(l,{selectedCount:W.length,onRun:K,onRunNoCache:He,onDelete:Ue,onCancel:()=>N({}),isRunning:Pe})]})})}export{j as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{i as t,l as n,n as r,o as i,s as a,t as o,u as s}from"./select-D5oFJNaq.js";import{t as c}from"./circle-x-B7AOkLOS.js";import{t as l}from"./copy-CEZJVgtu.js";import{t as u}from"./eye-YQHiLgt4.js";import{t as d}from"./refresh-cw-RAow1kax.js";import{t as f}from"./dist-BJdB11cl.js";import{r as p}from"./use-page-title-B4YPyIzc.js";import{Cn as m,En as h,Ft as g,Jn as _,Ln as v,Mn as y,Nn as ee,Qn as te,Rn as ne,Sn as re,Un as b,Wn as x,Wt as S,bn as ie,it as ae,pr as oe,qt as C,wn as se,xn as w,yn as T}from"./index-B4FdO6Vk.js";import{t as E}from"./badge-CC1v3nk4.js";var ce=_(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),le=_(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ue=_(`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`}]]),D=e(oe(),1),O=te(),k=`Collapsible`,[de,fe]=se(k),[pe,A]=de(k),me=D.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=w({prop:r,defaultProp:i??!1,onChange:o,caller:k});return(0,O.jsx)(pe,{scope:n,disabled:a,contentId:T(),open:c,onOpenToggle:D.useCallback(()=>l(e=>!e),[l]),children:(0,O.jsx)(h.div,{"data-state":P(c),"data-disabled":a?``:void 0,...s,ref:t})})});me.displayName=k;var he=`CollapsibleTrigger`,j=D.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=A(he,n);return(0,O.jsx)(h.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":P(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:m(e.onClick,i.onOpenToggle)})});j.displayName=he;var M=`CollapsibleContent`,N=D.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=A(M,e.__scopeCollapsible);return(0,O.jsx)(ie,{present:n||i.open,children:({present:e})=>(0,O.jsx)(ge,{...r,ref:t,present:e})})});N.displayName=M;var ge=D.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=A(M,n),[s,c]=D.useState(r),l=D.useRef(null),u=y(t,l),d=D.useRef(0),f=d.current,p=D.useRef(0),m=p.current,g=o.open||s,_=D.useRef(g),v=D.useRef(void 0);return D.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),re(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,O.jsx)(h.div,{"data-state":P(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:g&&i})});function P(e){return e?`open`:`closed`}var F=me,_e=j,ve=N,I=`Accordion`,ye=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[L,be,xe]=f(I),[R,Se]=se(I,[xe,fe]),z=fe(),Ce=D.forwardRef((e,t)=>{let{type:n,...r}=e,i=r,a=r;return(0,O.jsx)(L.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,O.jsx)(Oe,{...a,ref:t}):(0,O.jsx)(De,{...i,ref:t})})});Ce.displayName=I;var[B,we]=R(I),[Te,Ee]=R(I,{collapsible:!1}),De=D.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,c]=w({prop:n,defaultProp:r??``,onChange:i,caller:I});return(0,O.jsx)(B,{scope:e.__scopeAccordion,value:D.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:D.useCallback(()=>a&&c(``),[a,c]),children:(0,O.jsx)(Te,{scope:e.__scopeAccordion,collapsible:a,children:(0,O.jsx)(Ae,{...o,ref:t})})})}),Oe=D.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=w({prop:n,defaultProp:r??[],onChange:i,caller:I}),c=D.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=D.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,O.jsx)(B,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,O.jsx)(Te,{scope:e.__scopeAccordion,collapsible:!0,children:(0,O.jsx)(Ae,{...a,ref:t})})})}),[ke,V]=R(I),Ae=D.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=y(D.useRef(null),t),c=be(n),l=p(i)===`ltr`,u=m(e.onKeyDown,e=>{if(!ye.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=()=>{o=r+1,o>s&&(o=0)},d=()=>{o=r-1,o<0&&(o=s)};switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,O.jsx)(ke,{scope:n,disabled:r,direction:i,orientation:a,children:(0,O.jsx)(L.Slot,{scope:n,children:(0,O.jsx)(h.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})}),H=`AccordionItem`,[je,U]=R(H),Me=D.forwardRef((e,t)=>{let{__scopeAccordion:n,value:r,...i}=e,a=V(H,n),o=we(H,n),s=z(n),c=T(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,O.jsx)(je,{scope:n,open:l,disabled:u,triggerId:c,children:(0,O.jsx)(F,{"data-orientation":a.orientation,"data-state":Re(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})});Me.displayName=H;var Ne=`AccordionHeader`,Pe=D.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=V(I,n),a=U(Ne,n);return(0,O.jsx)(h.h3,{"data-orientation":i.orientation,"data-state":Re(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})});Pe.displayName=Ne;var W=`AccordionTrigger`,Fe=D.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=V(I,n),a=U(W,n),o=Ee(W,n),s=z(n);return(0,O.jsx)(L.ItemSlot,{scope:n,children:(0,O.jsx)(_e,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})});Fe.displayName=W;var Ie=`AccordionContent`,Le=D.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=V(I,n),a=U(Ie,n),o=z(n);return(0,O.jsx)(ve,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})});Le.displayName=Ie;function Re(e){return e?`open`:`closed`}var ze=Ce,Be=Me,Ve=Pe,He=Fe,Ue=Le;function G({...e}){return(0,O.jsx)(F,{"data-slot":`collapsible`,...e})}function K({...e}){return(0,O.jsx)(j,{"data-slot":`collapsible-trigger`,...e})}function q({...e}){return(0,O.jsx)(N,{"data-slot":`collapsible-content`,...e})}function We({confidence:e}){let t=Math.round(e*100);return(0,O.jsxs)(E,{variant:`outline`,className:S(`text-xs font-mono`,t>80?`bg-emerald-500/10 text-emerald-500 border-emerald-500/20`:t>=50?`bg-amber-500/10 text-amber-500 border-amber-500/20`:`bg-red-500/10 text-red-500 border-red-500/20`),children:[t,`%`]})}function Ge({...e}){return(0,O.jsx)(ze,{"data-slot":`accordion`,...e})}function Ke({className:e,...t}){return(0,O.jsx)(Be,{"data-slot":`accordion-item`,className:S(`border-b last:border-b-0`,e),...t})}function qe({className:e,children:t,...r}){return(0,O.jsx)(Ve,{className:`flex`,children:(0,O.jsxs)(He,{"data-slot":`accordion-trigger`,className:S(`flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180`,e),...r,children:[t,(0,O.jsx)(n,{className:`pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200`})]})})}function Je({className:e,children:t,...n}){return(0,O.jsx)(Ue,{"data-slot":`accordion-content`,className:`overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,O.jsx)(`div`,{className:S(`pt-0 pb-4`,e),children:t})})}function Ye({attempts:e}){return!e||e.length===0?null:(0,O.jsx)(Ge,{type:`single`,collapsible:!0,className:`w-full`,children:e.map((e,t)=>(0,O.jsxs)(Ke,{value:`attempt-${t}`,children:[(0,O.jsx)(qe,{className:`py-2 text-sm`,children:(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`span`,{className:`font-medium`,children:[`Attempt `,e.attemptNumber??t+1]}),e.strategy&&(0,O.jsx)(E,{variant:`secondary`,className:`text-xs`,children:e.strategy}),e.success?(0,O.jsx)(b,{className:`h-3.5 w-3.5 text-emerald-500`}):(0,O.jsx)(c,{className:`h-3.5 w-3.5 text-red-500`})]})}),(0,O.jsxs)(Je,{className:`space-y-2`,children:[e.reasoning&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Reasoning`}),(0,O.jsx)(`p`,{className:`text-sm`,children:e.reasoning})]}),e.observationBefore&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Observation Before`}),(0,O.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.observationBefore.length>200?`${e.observationBefore.slice(0,200)}…`:e.observationBefore})]}),e.observationAfter&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Observation After`}),(0,O.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.observationAfter.length>200?`${e.observationAfter.slice(0,200)}…`:e.observationAfter})]}),e.action!=null&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Action`}),(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto`,children:typeof e.action==`string`?e.action:JSON.stringify(e.action,null,2)})]})]})]},t))})}var J=[{key:`observe`,label:`Observe`,icon:u},{key:`plan`,label:`Plan`,icon:ce},{key:`execute`,label:`Execute`,icon:ne},{key:`verify`,label:`Verify`,icon:ue},{key:`heal`,label:`Heal`,icon:d}];function Xe(e){return e==null?``:typeof e==`string`?e:JSON.stringify(e,null,2)}function Y({config:e,content:t,duration:n,outcome:r,children:i,open:a,onOpenChange:o,sectionRef:s}){let[c,l]=(0,D.useState)(!1),u=a!==void 0,d=u?a:c,f=u?o:l,p=e.icon,m=t||i;return(0,O.jsxs)(G,{open:d,onOpenChange:f,children:[(0,O.jsxs)(K,{ref:s,className:`flex w-full items-center gap-2 py-1.5 text-left group sticky top-0 z-20 bg-background`,children:[(0,O.jsx)(`div`,{className:`flex items-center justify-center h-4 w-4 rounded-full bg-background border shrink-0`,children:(0,O.jsx)(p,{className:`h-2.5 w-2.5 text-muted-foreground`})}),(0,O.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),n!=null&&(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:C(n)}),r,(0,O.jsx)(`span`,{className:`flex-1`}),m&&(0,O.jsx)(x,{className:S(`h-3 w-3 text-muted-foreground transition-transform duration-200`,d&&`rotate-90`)})]}),m&&(0,O.jsx)(q,{className:`overflow-hidden min-w-0 max-w-full`,children:(0,O.jsxs)(`div`,{className:`min-w-0 max-w-full pl-6 pb-2 space-y-2`,children:[t&&(0,O.jsx)(`div`,{"data-reasoning-content-shell":`true`,className:`min-w-0 max-w-full rounded-sm`,children:(0,O.jsx)(`div`,{"data-reasoning-prose":`true`,className:`m-0 whitespace-pre-wrap break-words text-sm text-muted-foreground [overflow-wrap:anywhere]`,children:t})}),i&&(0,O.jsx)(`div`,{"data-reasoning-children":`true`,className:`min-w-0 max-w-full`,children:i})]})})]})}function Ze(e){let t=[];return e.observation&&t.push({key:`observation`,label:`Observe`,icon:J[0].icon,content:e.observation,duration:null}),e.reasoning&&t.push({key:`reasoning`,label:`Plan`,icon:J[1].icon,content:e.reasoning,duration:null}),e.plannedAction!=null&&t.push({key:`plannedAction`,label:`Execute`,icon:J[2].icon,content:null,duration:null,children:(0,O.jsx)(`pre`,{className:`min-w-0 max-w-full text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:typeof e.plannedAction==`string`?e.plannedAction:JSON.stringify(e.plannedAction,null,2)})}),t}var Qe=(0,D.forwardRef)(function({step:e},t){let n=Ze(e);return n.length===0&&e.error?(0,O.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded p-2 text-sm break-words [overflow-wrap:anywhere]`,children:e.error}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)($e,{ref:t,sections:n}),e.error&&(0,O.jsx)(`div`,{className:`pl-6 pb-2`,children:(0,O.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded p-2 text-sm break-words [overflow-wrap:anywhere]`,children:e.error})})]})}),$e=(0,D.forwardRef)(function({sections:e},t){let[n,r]=(0,D.useState)(()=>e.map(()=>!1)),i=(0,D.useRef)([]),a=(0,D.useCallback)(e=>{r(t=>{let n=[...t],r=n[e];return n[e]=!r,r||requestAnimationFrame(()=>{i.current[e]?.scrollIntoView({block:`start`,behavior:`smooth`})}),n})},[]);return(0,D.useImperativeHandle)(t,()=>({togglePhase:a}),[a]),(0,O.jsxs)(`div`,{className:`relative space-y-0`,children:[(0,O.jsx)(`div`,{className:`absolute left-[7px] top-4 bottom-4 w-px bg-border`}),e.map((e,t)=>(0,O.jsx)(Y,{config:{key:e.key,label:e.label,icon:e.icon},content:e.content,duration:e.duration,outcome:e.outcome,open:n[t],onOpenChange:e=>r(n=>{let r=[...n];return r[t]=e,r}),sectionRef:e=>{i.current[t]=e},children:e.children},e.key))]})}),et=(0,D.forwardRef)(function({runId:e,stepOrder:t,stepData:n},r){let[i,a]=(0,D.useState)(null),[o,s]=(0,D.useState)(!0),[c,l]=(0,D.useState)(null),[u,d]=(0,D.useState)([!1,!1,!1,!1]),f=(0,D.useRef)([null,null,null,null]),p=(0,D.useCallback)(e=>{d(t=>{let n=[...t],r=n[e];return n[e]=!r,r||requestAnimationFrame(()=>{f.current[e]?.scrollIntoView({block:`start`,behavior:`smooth`})}),n})},[]);if((0,D.useImperativeHandle)(r,()=>({togglePhase:p}),[p]),(0,D.useEffect)(()=>{let n=!1;return ae(e,t).then(e=>{n||(a(e.trace),s(!1))}).catch(e=>{n||(l(e instanceof Error?e.message:`Failed to load reasoning`),s(!1))}),()=>{n=!0}},[e,t]),o)return(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsx)(g,{className:`h-4 w-3/4`}),(0,O.jsx)(g,{className:`h-4 w-1/2`}),(0,O.jsx)(g,{className:`h-4 w-2/3`})]});if(!i&&c||!i)return(0,O.jsx)(Qe,{ref:r,step:n});let m=i.healAttempts&&i.healAttempts.length>0;return(0,O.jsxs)(`div`,{className:`relative space-y-0`,children:[(0,O.jsx)(`div`,{className:`absolute left-[7px] top-4 bottom-4 w-px bg-border`}),(0,O.jsx)(Y,{config:J[0],content:i.observeText,duration:i.observeDuration,open:u[0],onOpenChange:e=>d(t=>{let n=[...t];return n[0]=e,n}),sectionRef:e=>{f.current[0]=e}}),(0,O.jsx)(Y,{config:J[1],content:i.planReasoning,duration:i.planDuration,outcome:i.planConfidence==null?void 0:(0,O.jsx)(We,{confidence:i.planConfidence}),open:u[1],onOpenChange:e=>d(t=>{let n=[...t];return n[1]=e,n}),sectionRef:e=>{f.current[1]=e},children:i.planAction!=null&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Planned Action`}),(0,O.jsx)(`pre`,{className:`min-w-0 max-w-full text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:Xe(i.planAction)})]})}),(0,O.jsx)(Y,{config:J[2],content:null,duration:i.executeDuration,open:u[2],onOpenChange:e=>d(t=>{let n=[...t];return n[2]=e,n}),sectionRef:e=>{f.current[2]=e},children:i.executeAction!=null&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Executed Action`}),(0,O.jsx)(`pre`,{className:`min-w-0 max-w-full text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:Xe(i.executeAction)})]})}),(0,O.jsx)(Y,{config:J[3],content:i.verifyReasoning,duration:i.verifyDuration,outcome:i.verifySuccess==null?void 0:(0,O.jsx)(`span`,{className:S(`text-xs font-medium`,i.verifySuccess?`text-emerald-500`:`text-red-500`),children:i.verifySuccess?`Passed`:`Failed`}),open:u[3],onOpenChange:e=>d(t=>{let n=[...t];return n[3]=e,n}),sectionRef:e=>{f.current[3]=e}}),m&&(0,O.jsx)(Y,{config:J[4],content:null,duration:null,children:(0,O.jsx)(Ye,{attempts:i.healAttempts})})]})}),tt=(0,D.forwardRef)(function(e,t){return e.mode===`static`?(0,O.jsx)($e,{sections:e.sections,ref:t}):(0,O.jsx)(et,{runId:e.runId,stepOrder:e.stepOrder,stepData:e.stepData,ref:t})});function nt(e){switch(e){case`env`:return`bg-blue-500/15 text-blue-400 border-blue-500/20`;case`capture`:return`bg-emerald-500/15 text-emerald-400 border-emerald-500/20`;case`cli`:return`bg-purple-500/15 text-purple-400 border-purple-500/20`;case`inline`:return`bg-amber-500/15 text-amber-400 border-amber-500/20`;case`suite`:return`bg-cyan-500/15 text-cyan-400 border-cyan-500/20`;case`test`:return`bg-pink-500/15 text-pink-400 border-pink-500/20`;case`hook`:return`bg-orange-500/15 text-orange-400 border-orange-500/20`;case`step`:return`bg-teal-500/15 text-teal-400 border-teal-500/20`;default:return`bg-muted text-muted-foreground`}}function X({title:e,count:t,defaultOpen:n,children:r}){return(0,O.jsxs)(G,{defaultOpen:n,children:[(0,O.jsxs)(K,{className:`flex items-center gap-1.5 w-full px-3 py-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors`,children:[(0,O.jsx)(x,{className:`h-3 w-3 transition-transform duration-200 [[data-state=open]>&]:rotate-90`}),e,(0,O.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:[`(`,t,`)`]})]}),(0,O.jsx)(q,{children:r})]})}function Z({message:e}){return(0,O.jsx)(`div`,{className:`px-4 py-3 text-xs text-muted-foreground/60 italic`,children:e})}function rt({step:e,executionLogs:t=[]}){let n=e.variableSnapshot,r=n?Object.entries(n):[],i=t.filter(e=>e.type===`runjs`),a=t.filter(e=>e.type===`hook`);return(0,O.jsxs)(`div`,{className:`py-1`,children:[(0,O.jsx)(X,{title:`Env`,count:r.length,defaultOpen:r.length>0,children:r.length===0?(0,O.jsx)(Z,{message:`No variables at this step`}):(0,O.jsx)(`div`,{className:`px-3 pb-2`,children:(0,O.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{className:`border-b`,children:[(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Variable`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Value`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Source`})]})}),(0,O.jsx)(`tbody`,{children:r.map(([e,t])=>(0,O.jsxs)(`tr`,{className:`border-b border-border/50`,children:[(0,O.jsx)(`td`,{className:`py-1.5 px-2 font-mono text-xs text-muted-foreground`,children:e}),(0,O.jsx)(`td`,{className:`py-1.5 px-2 font-mono text-xs break-all`,children:t.value}),(0,O.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,O.jsx)(E,{className:S(`text-[10px] px-1.5 py-0 border`,nt(t.source)),children:t.source})})]},e))})]})})}),(0,O.jsx)(X,{title:`runJS`,count:i.length,defaultOpen:i.length>0,children:i.length===0?(0,O.jsx)(Z,{message:`No runJS executions for this step`}):(0,O.jsx)(`div`,{className:`px-3 pb-2 space-y-2`,children:i.map(e=>(0,O.jsxs)(`div`,{className:`rounded-md border border-border/50 p-2 text-xs`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[e.status===`passed`?(0,O.jsx)(b,{className:`h-3.5 w-3.5 text-emerald-500 shrink-0`}):(0,O.jsx)(c,{className:`h-3.5 w-3.5 text-red-500 shrink-0`}),(0,O.jsx)(`span`,{className:`font-medium truncate`,children:e.name}),(0,O.jsx)(`span`,{className:`text-muted-foreground ml-auto shrink-0`,children:C(e.duration)})]}),e.stdout&&(0,O.jsx)(`pre`,{className:`mt-1 p-1.5 rounded bg-muted/50 font-mono text-[11px] whitespace-pre-wrap break-all overflow-hidden`,children:e.stdout}),e.returnData!=null&&(0,O.jsxs)(`div`,{className:`mt-1 p-1.5 rounded bg-muted/50`,children:[(0,O.jsx)(`span`,{className:`text-muted-foreground`,children:`Return: `}),(0,O.jsx)(`span`,{className:`font-mono text-[11px]`,children:typeof e.returnData==`string`?e.returnData:JSON.stringify(e.returnData)})]})]},e.id))})}),(0,O.jsx)(X,{title:`Hooks`,count:a.length,defaultOpen:a.length>0,children:a.length===0?(0,O.jsx)(Z,{message:`No hooks ran for this step`}):(0,O.jsx)(`div`,{className:`px-3 pb-2 space-y-2`,children:a.map(e=>(0,O.jsxs)(`div`,{className:`rounded-md border border-border/50 p-2 text-xs`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[e.status===`passed`?(0,O.jsx)(b,{className:`h-3.5 w-3.5 text-emerald-500 shrink-0`}):(0,O.jsx)(c,{className:`h-3.5 w-3.5 text-red-500 shrink-0`}),(0,O.jsx)(`span`,{className:`font-medium truncate`,children:e.name}),(0,O.jsx)(`span`,{className:`text-muted-foreground ml-auto shrink-0`,children:C(e.duration)})]}),e.variables&&Object.keys(e.variables).length>0&&(0,O.jsxs)(`div`,{className:`mt-1.5 space-y-0.5`,children:[(0,O.jsx)(`span`,{className:`text-muted-foreground text-[10px]`,children:`Emitted variables:`}),Object.entries(e.variables).map(([e,t])=>(0,O.jsxs)(`div`,{className:`flex gap-2 pl-2 font-mono text-[11px]`,children:[(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`:`]}),(0,O.jsx)(`span`,{className:`break-all`,children:t})]},e))]}),e.stdout&&(0,O.jsx)(`pre`,{className:`mt-1 p-1.5 rounded bg-muted/50 font-mono text-[11px] whitespace-pre-wrap break-all overflow-hidden max-h-24 overflow-y-auto`,children:e.stdout})]},e.id))})})]})}function it(e){return e>=1e3?`+${(e/1e3).toFixed(1)}s`:`+${Math.round(e)}ms`}function at(e){return Object.entries(e).filter(([e,t])=>e!==`startTime`&&t>0)}function ot(e){return e>=200&&e<300?`text-emerald-500`:e>=300&&e<400?`text-amber-500`:e>=400?`text-red-500`:`text-muted-foreground`}function st({headers:e}){let t=Object.entries(e);return t.length===0?(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`None`}):(0,O.jsx)(`div`,{className:`space-y-0.5`,children:t.map(([e,t])=>(0,O.jsxs)(`div`,{className:`flex gap-2 text-xs font-mono`,children:[(0,O.jsxs)(`span`,{className:`text-muted-foreground shrink-0`,children:[e,`:`]}),(0,O.jsx)(`span`,{className:`break-all`,children:t})]},e))})}function Q({label:e,children:t}){return(0,O.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,O.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:e}),t]})}function ct({text:e}){let[t,n]=(0,D.useState)(!1);return(0,O.jsx)(`button`,{onClick:(0,D.useCallback)(t=>{t.stopPropagation(),navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)},[e]),className:`text-muted-foreground hover:text-foreground`,children:t?(0,O.jsx)(s,{className:`h-3 w-3`}):(0,O.jsx)(l,{className:`h-3 w-3`})})}function lt({body:e,contentType:t}){let n=t.toLowerCase();if(n.includes(`application/json`))try{return(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:JSON.stringify(JSON.parse(e),null,2)})}catch{return(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e})}return n.includes(`image/svg+xml`)?(0,O.jsx)(`img`,{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:`SVG response`,className:`max-h-48`}):e.startsWith(`data:image/`)?(0,O.jsx)(`img`,{src:e,alt:`Image response`,className:`max-h-48 rounded-sm`}):n.includes(`image/`)?(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`Image not previewable (re-run test to capture)`}):(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e})}function ut({entry:e}){let t=e.method===`POST`||e.method===`PUT`||e.method===`PATCH`;return(0,O.jsx)(`tr`,{children:(0,O.jsx)(`td`,{colSpan:6,className:`px-0 py-0`,children:(0,O.jsxs)(`div`,{className:`bg-muted/20 border-b border-border/50 px-4 py-3 space-y-4`,children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,O.jsx)(Q,{label:`Request Headers`,children:(0,O.jsx)(st,{headers:e.requestHeaders??{}})}),(0,O.jsx)(Q,{label:`Response Headers`,children:(0,O.jsx)(st,{headers:e.responseHeaders??{}})})]}),t&&(0,O.jsx)(Q,{label:`Request Body`,children:e.requestBody?(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e.requestBody}):(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`No request body`})}),(0,O.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,O.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:`Response Body`}),e.body&&(0,O.jsx)(ct,{text:e.body})]}),e.body?(0,O.jsx)(lt,{body:e.body,contentType:e.responseHeaders?.[`content-type`]??``}):(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`Not captured`})]}),e.timing&&(()=>{let t=at(e.timing);return t.length===0?null:(0,O.jsx)(Q,{label:`Timing`,children:(0,O.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:t.map(([e,t])=>(0,O.jsxs)(`div`,{className:`text-xs font-mono`,children:[(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`:`]}),` `,(0,O.jsxs)(`span`,{children:[Math.round(t),`ms`]})]},e))})})})()]})})})}function $({text:e,query:t}){if(!t)return(0,O.jsx)(O.Fragment,{children:e});let n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?(0,O.jsx)(O.Fragment,{children:e}):(0,O.jsxs)(O.Fragment,{children:[e.slice(0,n),(0,O.jsx)(`mark`,{className:`bg-yellow-400/30 text-inherit rounded-sm px-0.5`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function dt({step:e,allSteps:t,platform:n}){let[r,i]=(0,D.useState)(new Set),a=(0,D.useMemo)(()=>{let n=e.displayStepOrder??e.stepOrder,r=[];for(let e of t){let t=e.displayStepOrder??e.stepOrder;if(t>n)continue;let i=t===n;for(let t of e.networkLogs??[])r.push({...t,isCurrent:i})}return r.sort((e,t)=>e.startTime-t.startTime)},[e,t]),o=(0,D.useMemo)(()=>a.length===0?0:Math.min(...a.map(e=>e.startTime)),[a]),[s,c]=(0,D.useState)(``),l=(0,D.useDeferredValue)(s),u=(0,D.useMemo)(()=>{if(!l)return a;let e=l.toLowerCase();return a.filter(t=>t.url.toLowerCase().includes(e)||t.method.toLowerCase().includes(e)||String(t.status).includes(e))},[a,l]);(0,D.useEffect)(()=>{i(new Set)},[l]);let d=(0,D.useCallback)(e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return a.length===0?(0,O.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm py-12`,children:n===`android`||n===`ios`?`Network capture is not available for mobile tests`:`No network requests captured for this step`}):(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`div`,{className:`sticky top-0 z-10 bg-background border-b border-border/50 px-3 py-1.5 flex items-center gap-2`,children:[(0,O.jsx)(v,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,O.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:`Filter...`,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`}),s&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:[u.length,` of `,a.length]}),(0,O.jsx)(`button`,{onClick:()=>c(``),className:`text-muted-foreground hover:text-foreground`,children:(0,O.jsx)(ee,{className:`h-3.5 w-3.5`})})]})]}),(0,O.jsx)(`div`,{className:`p-3`,children:(0,O.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{className:`border-b`,children:[(0,O.jsx)(`th`,{className:`w-6`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground w-16`,children:`Method`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`URL`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground w-16`,children:`Status`}),(0,O.jsx)(`th`,{className:`text-right py-1.5 px-2 text-xs font-medium text-muted-foreground w-20`,children:`Time`}),(0,O.jsx)(`th`,{className:`text-right py-1.5 px-2 text-xs font-medium text-muted-foreground w-20`,children:`Duration`})]})}),(0,O.jsx)(`tbody`,{children:u.map((e,t)=>{let n=e.endTime-e.startTime,i=r.has(t);return(0,O.jsxs)(D.Fragment,{children:[(0,O.jsxs)(`tr`,{onClick:()=>d(t),className:S(`border-b border-border/50 cursor-pointer hover:bg-muted/30 transition-colors`,i&&`bg-muted/20`,!e.isCurrent&&`opacity-40`),children:[(0,O.jsx)(`td`,{className:`py-1.5 pl-2 pr-0 w-6`,children:(0,O.jsx)(x,{className:S(`h-3 w-3 text-muted-foreground transition-transform`,i&&`rotate-90`)})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,O.jsx)(E,{variant:`outline`,className:`text-[10px] px-1.5 py-0 font-mono`,children:(0,O.jsx)($,{text:e.method,query:l})})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2 text-xs font-mono truncate max-w-0 min-w-0`,children:(0,O.jsx)($,{text:e.url,query:l})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,O.jsx)(`span`,{className:S(`text-xs font-mono`,ot(e.status)),children:(0,O.jsx)($,{text:String(e.status),query:l})})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2 text-xs font-mono text-muted-foreground text-right`,children:it(e.startTime-o)}),(0,O.jsxs)(`td`,{className:`py-1.5 px-2 text-xs text-muted-foreground text-right`,children:[n<1?`<1`:Math.round(n),`ms`]})]}),i&&(0,O.jsx)(ut,{entry:e})]},t)})})]})})]})}function ft(e){switch(e.toLowerCase()){case`error`:return`text-red-400`;case`warn`:case`warning`:return`text-amber-400`;case`info`:return`text-blue-400`;case`debug`:return`text-cyan-400`;default:return`text-muted-foreground`}}function pt(e){switch(e){case`setup`:return`bg-blue-500/15 text-blue-400 border-blue-500/20`;case`teardown`:return`bg-purple-500/15 text-purple-400 border-purple-500/20`;case`inline`:return`bg-emerald-500/15 text-emerald-400 border-emerald-500/20`;default:return`bg-muted text-muted-foreground`}}var mt=[`error`,`warn`,`info`,`log`,`debug`];function ht({text:e,query:t}){if(!t)return(0,O.jsx)(O.Fragment,{children:e});let n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?(0,O.jsx)(O.Fragment,{children:e}):(0,O.jsxs)(O.Fragment,{children:[e.slice(0,n),(0,O.jsx)(`mark`,{className:`bg-yellow-400/30 text-inherit rounded-sm px-0.5`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function gt({step:e,allSteps:n,executionLogs:s,isHookStep:c}){let l=(0,D.useMemo)(()=>{let t=e.displayStepOrder??e.stepOrder,r=[];for(let e of n){let n=e.displayStepOrder??e.stepOrder;if(n>t)continue;let i=n===t;for(let t of e.consoleLogs??[])r.push({...t,isCurrent:i})}return r.sort((e,t)=>e.timestamp-t.timestamp)},[e,n]),[u,d]=(0,D.useState)(``),f=(0,D.useDeferredValue)(u),[p,m]=(0,D.useState)(`all`),h=(0,D.useMemo)(()=>{let e=l;if(p!==`all`&&(e=e.filter(e=>{let t=e.level.toLowerCase(),n=mt.indexOf(p);if(n===-1)return!0;let r=mt.indexOf(t);return r!==-1&&r>=n})),f){let t=f.toLowerCase();e=e.filter(e=>e.text.toLowerCase().includes(t)||e.level.toLowerCase().includes(t))}return e},[l,f,p]),g=c&&s&&s.length>0,_=l.length>0;return!g&&!_?(0,O.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm py-12`,children:`No console output captured for this step`}):(0,O.jsxs)(`div`,{className:`w-full overflow-hidden`,children:[_&&(0,O.jsxs)(`div`,{className:`sticky top-0 z-10 bg-background border-b border-border/50 px-3 py-1.5 flex items-center gap-2`,children:[(0,O.jsx)(v,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,O.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:`Filter...`,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`}),u&&(0,O.jsxs)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:[h.length,` of `,l.length]}),(0,O.jsx)(`div`,{className:`h-3 w-px bg-border/50 shrink-0`}),(0,O.jsxs)(o,{value:p,onValueChange:m,children:[(0,O.jsx)(i,{size:`sm`,className:`h-6 rounded-sm text-xs px-2 gap-1 border-border/50 min-w-0 w-auto`,children:(0,O.jsx)(a,{})}),(0,O.jsxs)(r,{className:`rounded-sm`,children:[(0,O.jsx)(t,{value:`all`,className:`text-xs`,children:`All levels`}),(0,O.jsx)(t,{value:`error`,className:`text-xs`,children:`Errors`}),(0,O.jsx)(t,{value:`warn`,className:`text-xs`,children:`Warnings`}),(0,O.jsx)(t,{value:`info`,className:`text-xs`,children:`Info`}),(0,O.jsx)(t,{value:`log`,className:`text-xs`,children:`Log`}),(0,O.jsx)(t,{value:`debug`,className:`text-xs`,children:`Debug`})]})]}),u&&(0,O.jsx)(`button`,{onClick:()=>d(``),className:`text-muted-foreground hover:text-foreground shrink-0`,children:(0,O.jsx)(ee,{className:`h-3.5 w-3.5`})})]}),(0,O.jsxs)(`div`,{className:`p-3 space-y-0.5 overflow-x-hidden w-full max-w-full`,children:[g&&(0,O.jsx)(`div`,{className:`space-y-2 mb-3`,children:s.map(e=>(0,O.jsxs)(`div`,{className:`border border-border/50 rounded-sm overflow-hidden`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 bg-muted/20 border-b border-border/30`,children:[(0,O.jsx)(E,{variant:`outline`,className:`text-[10px] px-1.5 py-0 font-mono`,children:e.name}),(0,O.jsx)(E,{className:S(`text-[10px] px-1.5 py-0`,pt(e.phase)),children:e.phase}),(0,O.jsx)(`span`,{className:S(`text-[10px] font-mono`,e.status===`passed`?`text-emerald-500`:`text-red-500`),children:e.status}),(0,O.jsxs)(`span`,{className:`text-[10px] text-muted-foreground ml-auto`,children:[e.duration,`ms`]})]}),e.stdout&&(0,O.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap text-foreground/90`,children:e.stdout}),e.stderr&&(0,O.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap text-red-400/80 border-t border-border/30`,children:e.stderr})]},e.id))}),g&&_&&(0,O.jsx)(`div`,{className:`border-t border-border/30 pt-2 mb-1`,children:(0,O.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wider`,children:`Browser Console`})}),_&&h.map((e,t)=>(0,O.jsxs)(`div`,{className:S(`flex items-start gap-1.5 py-0.5 px-2 hover:bg-muted/30 font-mono text-xs overflow-hidden max-w-full`,!e.isCurrent&&`opacity-40`),children:[(0,O.jsx)(`span`,{className:S(`shrink-0 text-[10px]`,ft(e.level)),children:e.level}),(0,O.jsx)(`span`,{className:`text-muted-foreground/60 shrink-0 text-[10px] tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString()}),(0,O.jsx)(`span`,{className:`flex-1 min-w-0 break-all whitespace-pre-wrap overflow-hidden`,children:(0,O.jsx)(ht,{text:e.text,query:f})})]},t))]})]})}export{Ye as a,q as c,le as d,ce as f,tt as i,K as l,dt as n,We as o,rt as r,G as s,gt as t,ue as u};