@vostride/agent-qa-dashboard-ui 0.1.11 → 0.1.12

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 (78) hide show
  1. package/dist/assets/{arrow-up-down-D8UGCR46.js → arrow-up-down-CN-uHgX9.js} +1 -1
  2. package/dist/assets/{badge-Dd058S66.js → badge-DrW2vGVJ.js} +1 -1
  3. package/dist/assets/{batch-action-bar-BlKdJC25.js → batch-action-bar-uEhHVDds.js} +1 -1
  4. package/dist/assets/{circle-alert-Cr31wwud.js → circle-alert-BKX0IIz1.js} +1 -1
  5. package/dist/assets/{circle-x-CbsF-Or-.js → circle-x-yPIxYoz1.js} +1 -1
  6. package/dist/assets/{config-B6eE0o2y.js → config-TRu3J-E7.js} +1 -1
  7. package/dist/assets/{copy-BdD4bkD_.js → copy-Clw3wvSn.js} +1 -1
  8. package/dist/assets/{display-step-4AfU6w4K.js → display-step-NqsJgW_B.js} +1 -1
  9. package/dist/assets/{dist-KjoEChiB.js → dist-BPJgj1d0.js} +1 -1
  10. package/dist/assets/{dist-D9h3nbVK.js → dist-BPheZrD6.js} +1 -1
  11. package/dist/assets/{dist-DrO-WGvP.js → dist-m_OM4Je_.js} +1 -1
  12. package/dist/assets/{empty-state-c1UKljbh.js → empty-state-BTvOA5lp.js} +1 -1
  13. package/dist/assets/{external-link-MKpqbawt.js → external-link-C_uggQOc.js} +1 -1
  14. package/dist/assets/{eye-vXF-W3Sy.js → eye-CZrufbYE.js} +1 -1
  15. package/dist/assets/{file-code-C7vOuS4q.js → file-code-B3iDpJRP.js} +1 -1
  16. package/dist/assets/{file-search-COrO0ndH.js → file-search-DHHwYVza.js} +1 -1
  17. package/dist/assets/{filename-validation-Ccwuaki1.js → filename-validation-4sTTEagx.js} +1 -1
  18. package/dist/assets/{grip-vertical-B4rX3Pd9.js → grip-vertical-A-AANrBM.js} +1 -1
  19. package/dist/assets/{hook-editor-fVte-sFt.js → hook-editor-yhQoi-Ky.js} +1 -1
  20. package/dist/assets/{hook-runtime-CPPjqz70.js → hook-runtime-JF-0oZpz.js} +1 -1
  21. package/dist/assets/{hook-viewer-Ceps9GqL.js → hook-viewer-DIkxp9uJ.js} +1 -1
  22. package/dist/assets/{hooks-BwveYPPu.js → hooks-CDRbjPKv.js} +1 -1
  23. package/dist/assets/{id-badge-5c0D9pZV.js → id-badge-NwZYoNfB.js} +1 -1
  24. package/dist/assets/{index-CZotRLCc.js → index-Bvtm2F6f.js} +2 -2
  25. package/dist/assets/index-CW7tbJhs.css +2 -0
  26. package/dist/assets/{insights-D_d7szDN.js → insights-DuYBsUzB.js} +1 -1
  27. package/dist/assets/{insights-line-grid-DzQiRxUU.js → insights-line-grid-BKOqA-1W.js} +1 -1
  28. package/dist/assets/{lib-CCr9qhea.js → lib-58FyJI_k.js} +1 -1
  29. package/dist/assets/{live-run-BxEaMSEi.js → live-run-ucgeJa3o.js} +1 -1
  30. package/dist/assets/{memory-7vVmoZvP.js → memory-B7nfWNTH.js} +1 -1
  31. package/dist/assets/{memory-product-B30NAtAP.js → memory-product-D1u5V75o.js} +1 -1
  32. package/dist/assets/{monaco-editor-Ba9qdSve.js → monaco-editor-DNT0Mzki.js} +2 -2
  33. package/dist/assets/{monaco-editor-inner-CeD8qR_F.js → monaco-editor-inner-DuCqlGei.js} +1 -1
  34. package/dist/assets/{monaco.contribution-ZpEX2Im1.js → monaco.contribution-LYJB_lCm.js} +2 -2
  35. package/dist/assets/{observation-block-BRa3lkBV.js → observation-block-4AqYhL1h.js} +1 -1
  36. package/dist/assets/{observation-markdown-BJ9B18Mk.js → observation-markdown-Dx_5-T0t.js} +1 -1
  37. package/dist/assets/{pencil-BdoVUAcl.js → pencil-DdRoBrsh.js} +1 -1
  38. package/dist/assets/plus-pXO98OAE.js +1 -0
  39. package/dist/assets/{popover-BAlAEoO4.js → popover-DGZi688D.js} +1 -1
  40. package/dist/assets/{refresh-cw-3zJOKpgR.js → refresh-cw-C_0AkMuu.js} +1 -1
  41. package/dist/assets/{resizable-BuOu2RfX.js → resizable-BGEcNRZO.js} +1 -1
  42. package/dist/assets/{run-detail-BkmoKeU2.js → run-detail-3tlB8sew.js} +1 -1
  43. package/dist/assets/{runs-Bs16pBe9.js → runs-CywxkFZ6.js} +1 -1
  44. package/dist/assets/{scroll-area-48uajHeh.js → scroll-area-CnATfQoe.js} +1 -1
  45. package/dist/assets/{select-B2_tSMl_.js → select-CeVjgiKI.js} +1 -1
  46. package/dist/assets/{shortcut-hints-BnEYaq1r.js → shortcut-hints-Bs5o743i.js} +1 -1
  47. package/dist/assets/{split-button-C54F4hz3.js → split-button-DcY8ames.js} +1 -1
  48. package/dist/assets/square-D71GHEET.js +1 -0
  49. package/dist/assets/{step-name-pills-hCVbMRBe.js → step-name-pills-Dta5ZGMZ.js} +1 -1
  50. package/dist/assets/{suite-editor-HxXY0n_h.js → suite-editor-Bnf6KMna.js} +1 -1
  51. package/dist/assets/{suite-navbar-DzgJZNSk.js → suite-navbar-PStktQ6j.js} +1 -1
  52. package/dist/assets/{suite-viewer-DX-uI0KI.js → suite-viewer-BD74MY_X.js} +1 -1
  53. package/dist/assets/{suites-BrCm410e.js → suites-BvfwzFEd.js} +1 -1
  54. package/dist/assets/{switch-C7U17ptQ.js → switch-ByV5GV5L.js} +1 -1
  55. package/dist/assets/{tab-console-W4FDWhGS.js → tab-console-BQFkZJG_.js} +1 -1
  56. package/dist/assets/{table-BGMQ2E9D.js → table-D08QBBt4.js} +1 -1
  57. package/dist/assets/{tabs-CWnvxa-h.js → tabs-DrB_Acb3.js} +1 -1
  58. package/dist/assets/{test-editor-C7jMc_bm.js → test-editor-w7ZQPYgH.js} +1 -1
  59. package/dist/assets/{test-navbar-1FE5zQJP.js → test-navbar-DoHKAy1p.js} +1 -1
  60. package/dist/assets/{test-viewer-yi44-64J.js → test-viewer-BwUQNVa4.js} +1 -1
  61. package/dist/assets/{tests-D9iNxwue.js → tests-B5ELKDH2.js} +1 -1
  62. package/dist/assets/{tests-suites-table-widths-C3pXnpiW.js → tests-suites-table-widths-DNWnkAjA.js} +1 -1
  63. package/dist/assets/{textarea-C-0LUFGZ.js → textarea-DChEVvwQ.js} +1 -1
  64. package/dist/assets/{trash-2-Cj6kkRf4.js → trash-2-7P1Dp87k.js} +1 -1
  65. package/dist/assets/{tsMode-fizT3CAG.js → tsMode-DEhRZlmT.js} +1 -1
  66. package/dist/assets/{use-hook-run-session-RvECpdZN.js → use-hook-run-session-x-d_iodT.js} +1 -1
  67. package/dist/assets/{use-keyboard-shortcuts-BTppBDf3.js → use-keyboard-shortcuts-EAppuiKO.js} +1 -1
  68. package/dist/assets/{use-page-title-BeSr97vd.js → use-page-title-B1t9-5_U.js} +1 -1
  69. package/dist/assets/use-run-status-favicon-D69P46yH.js +1 -0
  70. package/dist/assets/{use-selection-queue-B7ZRHEAV.js → use-selection-queue-BboTDies.js} +1 -1
  71. package/dist/assets/{viewer-url-state-aAMA3-2e.js → viewer-url-state-6mOK5_sY.js} +1 -1
  72. package/dist/assets/{zap-oUNJUGP6.js → zap-KFJmkY3Y.js} +1 -1
  73. package/dist/index.html +2 -2
  74. package/package.json +2 -2
  75. package/dist/assets/index-cLLRFOsN.css +0 -2
  76. package/dist/assets/plus-BDA9KiOF.js +0 -1
  77. package/dist/assets/square-lmyO8EeE.js +0 -1
  78. package/dist/assets/use-run-status-favicon-ClaOG7BI.js +0 -1
@@ -1 +1 @@
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-B2_tSMl_.js";import{t as c}from"./circle-x-CbsF-Or-.js";import{t as l}from"./copy-BdD4bkD_.js";import{t as u}from"./eye-vXF-W3Sy.js";import{t as d}from"./refresh-cw-3zJOKpgR.js";import{t as f}from"./dist-KjoEChiB.js";import{r as p}from"./use-page-title-BeSr97vd.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-CZotRLCc.js";import{t as E}from"./badge-Dd058S66.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};
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-CeVjgiKI.js";import{t as c}from"./circle-x-yPIxYoz1.js";import{t as l}from"./copy-Clw3wvSn.js";import{t as u}from"./eye-CZrufbYE.js";import{t as d}from"./refresh-cw-C_0AkMuu.js";import{t as f}from"./dist-BPJgj1d0.js";import{r as p}from"./use-page-title-B1t9-5_U.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-Bvtm2F6f.js";import{t as E}from"./badge-DrW2vGVJ.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};
@@ -1 +1 @@
1
- import"./chunk-CilyBKbf.js";import{Qn as e,Wt as t,pr as n}from"./index-CZotRLCc.js";n();var r=e();function i({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:t(`w-full caption-bottom text-sm`,e),...n})})}function a({className:e,...n}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:t(`[&_tr]:border-b`,e),...n})}function o({className:e,...n}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:t(`[&_tr:last-child]:border-0`,e),...n})}function s({className:e,...n}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:t(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,e),...n})}function c({className:e,...n}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:t(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...n})}function l({className:e,...n}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:t(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...n})}export{a,c as i,o as n,s as o,l as r,i as t};
1
+ import"./chunk-CilyBKbf.js";import{Qn as e,Wt as t,pr as n}from"./index-Bvtm2F6f.js";n();var r=e();function i({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:t(`w-full caption-bottom text-sm`,e),...n})})}function a({className:e,...n}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:t(`[&_tr]:border-b`,e),...n})}function o({className:e,...n}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:t(`[&_tr:last-child]:border-0`,e),...n})}function s({className:e,...n}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:t(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,e),...n})}function c({className:e,...n}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:t(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...n})}function l({className:e,...n}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:t(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...n})}export{a,c as i,o as n,s as o,l as r,i as t};
@@ -1 +1 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{r as t}from"./use-page-title-BeSr97vd.js";import{n,r,t as i}from"./dist-D9h3nbVK.js";import{Cn as a,En as o,Qn as s,Wt as c,Yn as l,bn as u,pr as d,wn as f,xn as p,yn as m}from"./index-CZotRLCc.js";var h=e(d(),1),g=s(),_=`Tabs`,[v,y]=f(_,[r]),b=r(),[x,S]=v(_),C=h.forwardRef((e,n)=>{let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:s,orientation:c=`horizontal`,dir:l,activationMode:u=`automatic`,...d}=e,f=t(l),[h,v]=p({prop:i,onChange:a,defaultProp:s??``,caller:_});return(0,g.jsx)(x,{scope:r,baseId:m(),value:h,onValueChange:v,orientation:c,dir:f,activationMode:u,children:(0,g.jsx)(o.div,{dir:f,"data-orientation":c,...d,ref:n})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:r,loop:i=!0,...a}=e,s=S(w,r),c=b(r);return(0,g.jsx)(n,{asChild:!0,...c,orientation:s.orientation,dir:s.dir,loop:i,children:(0,g.jsx)(o.div,{role:`tablist`,"aria-orientation":s.orientation,...a,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:s=!1,...c}=e,l=S(E,n),u=b(n),d=A(l.baseId,r),f=j(l.baseId,r),p=r===l.value;return(0,g.jsx)(i,{asChild:!0,...u,focusable:!s,active:p,children:(0,g.jsx)(o.button,{type:`button`,role:`tab`,"aria-selected":p,"aria-controls":f,"data-state":p?`active`:`inactive`,"data-disabled":s?``:void 0,disabled:s,id:d,...c,ref:t,onMouseDown:a(e.onMouseDown,e=>{!s&&e.button===0&&e.ctrlKey===!1?l.onValueChange(r):e.preventDefault()}),onKeyDown:a(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&l.onValueChange(r)}),onFocus:a(e.onFocus,()=>{let e=l.activationMode!==`manual`;!p&&!s&&e&&l.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...s}=e,c=S(O,n),l=A(c.baseId,r),d=j(c.baseId,r),f=r===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(u,{present:i||f,children:({present:n})=>(0,g.jsx)(o.div,{"data-state":f?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&a})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:c(`group/tabs flex gap-0 data-[orientation=horizontal]:flex-col`,e),...n})}var L=l(`group/tabs-list inline-flex w-fit items-center justify-center rounded-sm p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-0 bg-transparent`}},defaultVariants:{variant:`default`}});function R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:c(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:c(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:c(`flex-1 outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{r as t}from"./use-page-title-B1t9-5_U.js";import{n,r,t as i}from"./dist-BPheZrD6.js";import{Cn as a,En as o,Qn as s,Wt as c,Yn as l,bn as u,pr as d,wn as f,xn as p,yn as m}from"./index-Bvtm2F6f.js";var h=e(d(),1),g=s(),_=`Tabs`,[v,y]=f(_,[r]),b=r(),[x,S]=v(_),C=h.forwardRef((e,n)=>{let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:s,orientation:c=`horizontal`,dir:l,activationMode:u=`automatic`,...d}=e,f=t(l),[h,v]=p({prop:i,onChange:a,defaultProp:s??``,caller:_});return(0,g.jsx)(x,{scope:r,baseId:m(),value:h,onValueChange:v,orientation:c,dir:f,activationMode:u,children:(0,g.jsx)(o.div,{dir:f,"data-orientation":c,...d,ref:n})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:r,loop:i=!0,...a}=e,s=S(w,r),c=b(r);return(0,g.jsx)(n,{asChild:!0,...c,orientation:s.orientation,dir:s.dir,loop:i,children:(0,g.jsx)(o.div,{role:`tablist`,"aria-orientation":s.orientation,...a,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:s=!1,...c}=e,l=S(E,n),u=b(n),d=A(l.baseId,r),f=j(l.baseId,r),p=r===l.value;return(0,g.jsx)(i,{asChild:!0,...u,focusable:!s,active:p,children:(0,g.jsx)(o.button,{type:`button`,role:`tab`,"aria-selected":p,"aria-controls":f,"data-state":p?`active`:`inactive`,"data-disabled":s?``:void 0,disabled:s,id:d,...c,ref:t,onMouseDown:a(e.onMouseDown,e=>{!s&&e.button===0&&e.ctrlKey===!1?l.onValueChange(r):e.preventDefault()}),onKeyDown:a(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&l.onValueChange(r)}),onFocus:a(e.onFocus,()=>{let e=l.activationMode!==`manual`;!p&&!s&&e&&l.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...s}=e,c=S(O,n),l=A(c.baseId,r),d=j(c.baseId,r),f=r===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(u,{present:i||f,children:({present:n})=>(0,g.jsx)(o.div,{"data-state":f?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&a})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:c(`group/tabs flex gap-0 data-[orientation=horizontal]:flex-col`,e),...n})}var L=l(`group/tabs-list inline-flex w-fit items-center justify-center rounded-sm p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-0 bg-transparent`}},defaultVariants:{variant:`default`}});function R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:c(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:c(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:c(`flex-1 outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{c as t}from"./id-badge-5c0D9pZV.js";import{t as n}from"./monaco-editor-Ba9qdSve.js";import{t as r}from"./file-code-C7vOuS4q.js";import{n as i}from"./split-button-C54F4hz3.js";import{t as a}from"./refresh-cw-3zJOKpgR.js";import{a as o,c as s,i as c,n as ee,o as te,r as ne,s as l,t as re}from"./filename-validation-Ccwuaki1.js";import{t as ie}from"./use-page-title-BeSr97vd.js";import{a as ae,c as u,d as oe,f as d,i as se,l as ce,n as le,o as ue,p as f,r as de,s as fe,t as pe,u as p}from"./test-navbar-1FE5zQJP.js";import{a as me,r as he}from"./dist-DrO-WGvP.js";import{i as ge,n as _e,r as ve,t as ye}from"./tabs-CWnvxa-h.js";import{$n as m,At as h,Bn as be,Bt as xe,Dt as Se,E as Ce,Ft as g,Ht as we,It as Te,Lt as Ee,Mt as _,Nn as De,O as Oe,P as ke,Pt as v,Qn as y,Rt as Ae,St as je,Ut as b,V as Me,Wt as Ne,Yt as Pe,cr as Fe,ft as x,jt as S,kt as Ie,lr as Le,pr as Re,qn as C,r as ze,ur as Be,ut as Ve,zt as He}from"./index-CZotRLCc.js";import{n as Ue,r as We,t as Ge}from"./resizable-BuOu2RfX.js";import{t as Ke}from"./empty-state-c1UKljbh.js";import{t as qe}from"./use-keyboard-shortcuts-BTppBDf3.js";import{t as Je}from"./observation-markdown-BJ9B18Mk.js";var w=e(Re(),1),T=y();function E(e){return e>=.7?`text-emerald-500`:e>=.4?`text-amber-500`:`text-destructive`}function Ye(e){try{return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}catch{return e}}function Xe({observation:e,onDelete:t,isDeleting:n}){return(0,T.jsxs)(`div`,{className:`rounded-md border bg-card/60 px-3 py-2 space-y-1.5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px]`,children:[(0,T.jsxs)(S,{children:[(0,T.jsx)(v,{asChild:!0,children:(0,T.jsx)(`span`,{className:Ne(`font-mono tabular-nums font-medium cursor-default`,E(e.trust)),children:e.trust.toFixed(2)})}),(0,T.jsx)(_,{side:`top`,className:`max-w-xs text-xs`,children:`Trust score (0–1). Higher means the agent is more confident this observation is accurate. Increases when confirmed across runs, decreases when contradicted.`})]}),(0,T.jsxs)(S,{children:[(0,T.jsx)(v,{asChild:!0,children:(0,T.jsx)(`span`,{className:`text-muted-foreground cursor-default`,children:Ye(e.created)})}),(0,T.jsx)(_,{side:`top`,className:`text-xs`,children:`First observed on this date`})]}),(0,T.jsxs)(S,{children:[(0,T.jsx)(v,{asChild:!0,children:(0,T.jsxs)(`span`,{className:`text-muted-foreground cursor-default`,children:[e.confirmed_count,`x confirmed · `,e.contradicted_count,`x contradicted`]})}),(0,T.jsx)(_,{side:`top`,className:`max-w-xs text-xs`,children:`Confirmed: how many runs validated this observation. Contradicted: how many runs found it inaccurate.`})]}),(0,T.jsx)(`div`,{className:`ml-auto`,children:(0,T.jsxs)(ae,{children:[(0,T.jsx)(f,{asChild:!0,children:(0,T.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:n,"aria-label":`Delete observation: ${e.title.slice(0,40)}`,className:`shrink-0 text-muted-foreground/70 hover:text-destructive`,children:(0,T.jsx)(De,{className:`size-3.5`})})}),(0,T.jsxs)(u,{size:`sm`,children:[(0,T.jsxs)(oe,{children:[(0,T.jsx)(d,{children:`Delete observation?`}),(0,T.jsx)(ce,{children:`This observation will be permanently removed. The agent will no longer use it during future runs.`})]}),(0,T.jsxs)(p,{children:[(0,T.jsx)(fe,{children:`Cancel`}),(0,T.jsx)(ue,{variant:`destructive`,onClick:()=>t(e.id),disabled:n,children:`Delete Observation`})]})]})]})})]}),(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(`h4`,{className:`text-sm font-semibold tracking-tight text-foreground`,children:e.title}),(0,T.jsx)(Je,{content:e.content})]})]})}function Ze({testId:e}){let[t,n]=(0,w.useState)([]),[r,i]=(0,w.useState)([]),[o,s]=(0,w.useState)(!0),[c,ee]=(0,w.useState)(null),[te,ne]=(0,w.useState)(null),l=(0,w.useCallback)(()=>{let t=!1;return s(!0),ee(null),i([]),x(e).then(e=>{t||(n(e.observations),i(e.invalidFiles),s(!1))}).catch(e=>{t||(n([]),ee(e instanceof Error?e.message:`Failed to load observations`),s(!1))}),()=>{t=!0}},[e]);(0,w.useEffect)(()=>l(),[l]);let re=(0,w.useCallback)(async t=>{ne(t);try{await ke(e,t),n(e=>e.filter(e=>e.id!==t)),h.success(`Observation deleted`)}catch(e){h.error(`Failed to delete: ${e instanceof Error?e.message:String(e)}`)}finally{ne(null)}},[e]);return o?(0,T.jsxs)(`div`,{className:`space-y-2 px-4 py-2`,children:[(0,T.jsx)(g,{className:`h-16 w-full rounded-md`}),(0,T.jsx)(g,{className:`h-16 w-full rounded-md`}),(0,T.jsx)(g,{className:`h-16 w-full rounded-md`})]}):c?(0,T.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 px-4 py-12 text-center`,children:[(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Could not load observations. Check that the dashboard server is running and try again.`}),(0,T.jsxs)(b,{variant:`outline`,size:`sm`,onClick:l,children:[(0,T.jsx)(a,{className:`mr-1.5 size-3.5`}),`Retry`]})]}):t.length===0?(0,T.jsxs)(`div`,{className:`space-y-3 px-4 py-2`,children:[r.length>0?(0,T.jsx)(D,{invalidFiles:r}):null,(0,T.jsx)(Ke,{icon:C,title:`No observations yet`,description:`Memory observations are created automatically when this test runs. They help the agent remember facts about your product.`})]}):(0,T.jsxs)(`div`,{className:`space-y-2 px-4 py-2`,children:[r.length>0?(0,T.jsx)(D,{invalidFiles:r}):null,(0,T.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,T.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[t.length,` observation`,t.length===1?``:`s`]})}),(0,T.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,T.jsx)(Xe,{observation:e,onDelete:re,isDeleting:te===e.id},e.id))})]})}function D({invalidFiles:e}){return(0,T.jsxs)(`div`,{className:`rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-xs text-amber-950 dark:text-amber-200`,children:[(0,T.jsxs)(`p`,{className:`font-medium`,children:[e.length,` invalid memory file`,e.length===1?``:`s`,` hidden from this panel.`]}),(0,T.jsx)(`p`,{className:`mt-1 text-[11px] text-amber-900/80 dark:text-amber-200/80`,children:e.map(e=>e.filename).join(`, `)})]})}var Qe=`name: My Test
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{c as t}from"./id-badge-NwZYoNfB.js";import{t as n}from"./monaco-editor-DNT0Mzki.js";import{t as r}from"./file-code-B3iDpJRP.js";import{n as i}from"./split-button-DcY8ames.js";import{t as a}from"./refresh-cw-C_0AkMuu.js";import{a as o,c as s,i as c,n as ee,o as te,r as ne,s as l,t as re}from"./filename-validation-4sTTEagx.js";import{t as ie}from"./use-page-title-B1t9-5_U.js";import{a as ae,c as u,d as oe,f as d,i as se,l as ce,n as le,o as ue,p as f,r as de,s as fe,t as pe,u as p}from"./test-navbar-DoHKAy1p.js";import{a as me,r as he}from"./dist-m_OM4Je_.js";import{i as ge,n as _e,r as ve,t as ye}from"./tabs-DrB_Acb3.js";import{$n as m,At as h,Bn as be,Bt as xe,Dt as Se,E as Ce,Ft as g,Ht as we,It as Te,Lt as Ee,Mt as _,Nn as De,O as Oe,P as ke,Pt as v,Qn as y,Rt as Ae,St as je,Ut as b,V as Me,Wt as Ne,Yt as Pe,cr as Fe,ft as x,jt as S,kt as Ie,lr as Le,pr as Re,qn as C,r as ze,ur as Be,ut as Ve,zt as He}from"./index-Bvtm2F6f.js";import{n as Ue,r as We,t as Ge}from"./resizable-BGEcNRZO.js";import{t as Ke}from"./empty-state-BTvOA5lp.js";import{t as qe}from"./use-keyboard-shortcuts-EAppuiKO.js";import{t as Je}from"./observation-markdown-Dx_5-T0t.js";var w=e(Re(),1),T=y();function E(e){return e>=.7?`text-emerald-500`:e>=.4?`text-amber-500`:`text-destructive`}function Ye(e){try{return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}catch{return e}}function Xe({observation:e,onDelete:t,isDeleting:n}){return(0,T.jsxs)(`div`,{className:`rounded-md border bg-card/60 px-3 py-2 space-y-1.5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px]`,children:[(0,T.jsxs)(S,{children:[(0,T.jsx)(v,{asChild:!0,children:(0,T.jsx)(`span`,{className:Ne(`font-mono tabular-nums font-medium cursor-default`,E(e.trust)),children:e.trust.toFixed(2)})}),(0,T.jsx)(_,{side:`top`,className:`max-w-xs text-xs`,children:`Trust score (0–1). Higher means the agent is more confident this observation is accurate. Increases when confirmed across runs, decreases when contradicted.`})]}),(0,T.jsxs)(S,{children:[(0,T.jsx)(v,{asChild:!0,children:(0,T.jsx)(`span`,{className:`text-muted-foreground cursor-default`,children:Ye(e.created)})}),(0,T.jsx)(_,{side:`top`,className:`text-xs`,children:`First observed on this date`})]}),(0,T.jsxs)(S,{children:[(0,T.jsx)(v,{asChild:!0,children:(0,T.jsxs)(`span`,{className:`text-muted-foreground cursor-default`,children:[e.confirmed_count,`x confirmed · `,e.contradicted_count,`x contradicted`]})}),(0,T.jsx)(_,{side:`top`,className:`max-w-xs text-xs`,children:`Confirmed: how many runs validated this observation. Contradicted: how many runs found it inaccurate.`})]}),(0,T.jsx)(`div`,{className:`ml-auto`,children:(0,T.jsxs)(ae,{children:[(0,T.jsx)(f,{asChild:!0,children:(0,T.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:n,"aria-label":`Delete observation: ${e.title.slice(0,40)}`,className:`shrink-0 text-muted-foreground/70 hover:text-destructive`,children:(0,T.jsx)(De,{className:`size-3.5`})})}),(0,T.jsxs)(u,{size:`sm`,children:[(0,T.jsxs)(oe,{children:[(0,T.jsx)(d,{children:`Delete observation?`}),(0,T.jsx)(ce,{children:`This observation will be permanently removed. The agent will no longer use it during future runs.`})]}),(0,T.jsxs)(p,{children:[(0,T.jsx)(fe,{children:`Cancel`}),(0,T.jsx)(ue,{variant:`destructive`,onClick:()=>t(e.id),disabled:n,children:`Delete Observation`})]})]})]})})]}),(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(`h4`,{className:`text-sm font-semibold tracking-tight text-foreground`,children:e.title}),(0,T.jsx)(Je,{content:e.content})]})]})}function Ze({testId:e}){let[t,n]=(0,w.useState)([]),[r,i]=(0,w.useState)([]),[o,s]=(0,w.useState)(!0),[c,ee]=(0,w.useState)(null),[te,ne]=(0,w.useState)(null),l=(0,w.useCallback)(()=>{let t=!1;return s(!0),ee(null),i([]),x(e).then(e=>{t||(n(e.observations),i(e.invalidFiles),s(!1))}).catch(e=>{t||(n([]),ee(e instanceof Error?e.message:`Failed to load observations`),s(!1))}),()=>{t=!0}},[e]);(0,w.useEffect)(()=>l(),[l]);let re=(0,w.useCallback)(async t=>{ne(t);try{await ke(e,t),n(e=>e.filter(e=>e.id!==t)),h.success(`Observation deleted`)}catch(e){h.error(`Failed to delete: ${e instanceof Error?e.message:String(e)}`)}finally{ne(null)}},[e]);return o?(0,T.jsxs)(`div`,{className:`space-y-2 px-4 py-2`,children:[(0,T.jsx)(g,{className:`h-16 w-full rounded-md`}),(0,T.jsx)(g,{className:`h-16 w-full rounded-md`}),(0,T.jsx)(g,{className:`h-16 w-full rounded-md`})]}):c?(0,T.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 px-4 py-12 text-center`,children:[(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Could not load observations. Check that the dashboard server is running and try again.`}),(0,T.jsxs)(b,{variant:`outline`,size:`sm`,onClick:l,children:[(0,T.jsx)(a,{className:`mr-1.5 size-3.5`}),`Retry`]})]}):t.length===0?(0,T.jsxs)(`div`,{className:`space-y-3 px-4 py-2`,children:[r.length>0?(0,T.jsx)(D,{invalidFiles:r}):null,(0,T.jsx)(Ke,{icon:C,title:`No observations yet`,description:`Memory observations are created automatically when this test runs. They help the agent remember facts about your product.`})]}):(0,T.jsxs)(`div`,{className:`space-y-2 px-4 py-2`,children:[r.length>0?(0,T.jsx)(D,{invalidFiles:r}):null,(0,T.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,T.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[t.length,` observation`,t.length===1?``:`s`]})}),(0,T.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,T.jsx)(Xe,{observation:e,onDelete:re,isDeleting:te===e.id},e.id))})]})}function D({invalidFiles:e}){return(0,T.jsxs)(`div`,{className:`rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-xs text-amber-950 dark:text-amber-200`,children:[(0,T.jsxs)(`p`,{className:`font-medium`,children:[e.length,` invalid memory file`,e.length===1?``:`s`,` hidden from this panel.`]}),(0,T.jsx)(`p`,{className:`mt-1 text-[11px] text-amber-900/80 dark:text-amber-200/80`,children:e.map(e=>e.filename).join(`, `)})]})}var Qe=`name: My Test
2
2
  test-id: ""
3
3
  target: ""
4
4
  context: ""
@@ -1,4 +1,4 @@
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-B2_tSMl_.js";import{t as o}from"./circle-alert-Cr31wwud.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 ee,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w,v as T,w as E,x as D,y as te}from"./id-badge-5c0D9pZV.js";import{n as ne,r as O}from"./monaco-editor-Ba9qdSve.js";import{c as k,t as A}from"./split-button-C54F4hz3.js";import{t as re}from"./grip-vertical-B4rX3Pd9.js";import{n as j,r as M,t as N}from"./shortcut-hints-BnEYaq1r.js";import{t as ie}from"./plus-BDA9KiOF.js";import{t as P}from"./refresh-cw-3zJOKpgR.js";import{n as F,t as ae}from"./textarea-C-0LUFGZ.js";import{t as oe}from"./square-lmyO8EeE.js";import{a as I,r as L}from"./dist-DrO-WGvP.js";import{n as R,r as z,t as se}from"./popover-BAlAEoO4.js";import{t as ce}from"./switch-C7U17ptQ.js";import{An as B,Bn as le,Cn as ue,Fn as de,Ht as V,In as fe,Mn as pe,Mt as H,Nn as me,Pn as he,Pt as U,Qn as ge,Rn as _e,Un as W,Ut as G,Wn as ve,Wt as K,an as ye,cn as be,dn as xe,in as Se,jt as q,ln as Ce,nn as we,on as Te,pr as Ee,rn as De,sn as Oe,sr as ke,un as Ae,wn as je,zn as J}from"./index-CZotRLCc.js";import{t as Me}from"./badge-Dd058S66.js";var Y=e(Ee(),1),X=ge(),Ne=`AlertDialog`,[Pe,Fe]=je(Ne,[xe]),Z=xe(),Ie=e=>{let{__scopeAlertDialog:t,...n}=e,r=Z(t);return(0,X.jsx)(Oe,{...r,...n,modal:!0})};Ie.displayName=Ne;var Le=`AlertDialogTrigger`,Re=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(Ce,{...i,...r,ref:t})});Re.displayName=Le;var ze=`AlertDialogPortal`,Be=e=>{let{__scopeAlertDialog:t,...n}=e,r=Z(t);return(0,X.jsx)(Te,{...r,...n})};Be.displayName=ze;var Ve=`AlertDialogOverlay`,He=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(ye,{...i,...r,ref:t})});He.displayName=Ve;var Q=`AlertDialogContent`,[Ue,We]=Pe(Q),Ge=B(`AlertDialogContent`),Ke=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=Z(n),o=Y.useRef(null),s=pe(t,o),c=Y.useRef(null);return(0,X.jsx)(Ae,{contentName:Q,titleName:qe,docsSlug:`alert-dialog`,children:(0,X.jsx)(Ue,{scope:n,cancelRef:c,children:(0,X.jsxs)(De,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:ue(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,X.jsx)(Ge,{children:r}),(0,X.jsx)(tt,{contentRef:o})]})})})});Ke.displayName=Q;var qe=`AlertDialogTitle`,Je=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(be,{...i,...r,ref:t})});Je.displayName=qe;var Ye=`AlertDialogDescription`,Xe=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(Se,{...i,...r,ref:t})});Xe.displayName=Ye;var Ze=`AlertDialogAction`,Qe=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(we,{...i,...r,ref:t})});Qe.displayName=Ze;var $e=`AlertDialogCancel`,et=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=We($e,n),a=Z(n),o=pe(t,i);return(0,X.jsx)(we,{...a,...r,ref:o})});et.displayName=$e;var tt=({contentRef:e})=>{let t=`\`${Q}\` requires a description for the component to be accessible for screen reader users.
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-CeVjgiKI.js";import{t as o}from"./circle-alert-BKX0IIz1.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 ee,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w,v as T,w as E,x as D,y as te}from"./id-badge-NwZYoNfB.js";import{n as ne,r as O}from"./monaco-editor-DNT0Mzki.js";import{c as k,t as A}from"./split-button-DcY8ames.js";import{t as re}from"./grip-vertical-A-AANrBM.js";import{n as j,r as M,t as N}from"./shortcut-hints-Bs5o743i.js";import{t as ie}from"./plus-pXO98OAE.js";import{t as P}from"./refresh-cw-C_0AkMuu.js";import{n as F,t as ae}from"./textarea-DChEVvwQ.js";import{t as oe}from"./square-D71GHEET.js";import{a as I,r as L}from"./dist-m_OM4Je_.js";import{n as R,r as z,t as se}from"./popover-DGZi688D.js";import{t as ce}from"./switch-ByV5GV5L.js";import{An as B,Bn as le,Cn as ue,Fn as de,Ht as V,In as fe,Mn as pe,Mt as H,Nn as me,Pn as he,Pt as U,Qn as ge,Rn as _e,Un as W,Ut as G,Wn as ve,Wt as K,an as ye,cn as be,dn as xe,in as Se,jt as q,ln as Ce,nn as we,on as Te,pr as Ee,rn as De,sn as Oe,sr as ke,un as Ae,wn as je,zn as J}from"./index-Bvtm2F6f.js";import{t as Me}from"./badge-DrW2vGVJ.js";var Y=e(Ee(),1),X=ge(),Ne=`AlertDialog`,[Pe,Fe]=je(Ne,[xe]),Z=xe(),Ie=e=>{let{__scopeAlertDialog:t,...n}=e,r=Z(t);return(0,X.jsx)(Oe,{...r,...n,modal:!0})};Ie.displayName=Ne;var Le=`AlertDialogTrigger`,Re=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(Ce,{...i,...r,ref:t})});Re.displayName=Le;var ze=`AlertDialogPortal`,Be=e=>{let{__scopeAlertDialog:t,...n}=e,r=Z(t);return(0,X.jsx)(Te,{...r,...n})};Be.displayName=ze;var Ve=`AlertDialogOverlay`,He=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(ye,{...i,...r,ref:t})});He.displayName=Ve;var Q=`AlertDialogContent`,[Ue,We]=Pe(Q),Ge=B(`AlertDialogContent`),Ke=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=Z(n),o=Y.useRef(null),s=pe(t,o),c=Y.useRef(null);return(0,X.jsx)(Ae,{contentName:Q,titleName:qe,docsSlug:`alert-dialog`,children:(0,X.jsx)(Ue,{scope:n,cancelRef:c,children:(0,X.jsxs)(De,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:ue(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,X.jsx)(Ge,{children:r}),(0,X.jsx)(tt,{contentRef:o})]})})})});Ke.displayName=Q;var qe=`AlertDialogTitle`,Je=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(be,{...i,...r,ref:t})});Je.displayName=qe;var Ye=`AlertDialogDescription`,Xe=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(Se,{...i,...r,ref:t})});Xe.displayName=Ye;var Ze=`AlertDialogAction`,Qe=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(we,{...i,...r,ref:t})});Qe.displayName=Ze;var $e=`AlertDialogCancel`,et=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=We($e,n),a=Z(n),o=pe(t,i);return(0,X.jsx)(we,{...a,...r,ref:o})});et.displayName=$e;var tt=({contentRef:e})=>{let t=`\`${Q}\` requires a description for the component to be accessible for screen reader users.
2
2
 
3
3
  You can add a description to the \`${Q}\` by passing a \`${Ye}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
4
 
@@ -1 +1 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-Ba9qdSve.js";import{t as n}from"./file-code-C7vOuS4q.js";import{n as r}from"./split-button-C54F4hz3.js";import{t as i}from"./zap-oUNJUGP6.js";import{t as a}from"./use-page-title-BeSr97vd.js";import{n as o,t as ee}from"./test-navbar-1FE5zQJP.js";import{a as te,n as s,o as ne,t as c}from"./insights-line-grid-DzQiRxUU.js";import{i as l,n as u,r as d,t as f}from"./tabs-CWnvxa-h.js";import{$n as p,At as m,Gt as h,Jt as g,Kt as _,Mt as v,Nt as re,Pt as y,Qn as b,St as ie,Ut as x,cr as ae,jt as S,lr as oe,lt as se,pr as C,qt as w,r as ce,sr as T,ur as le,ut as ue}from"./index-CZotRLCc.js";import{t as E}from"./badge-Dd058S66.js";import{a as D,i as O,n as k,o as A,r as j,t as M}from"./table-BGMQ2E9D.js";import{t as de}from"./empty-state-c1UKljbh.js";import{t as fe}from"./use-keyboard-shortcuts-BTppBDf3.js";import{n as N,r as pe,t as me}from"./viewer-url-state-aAMA3-2e.js";var P=e(C(),1),F=b();function he(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 I({configured:e,mode:t,scopedCount:n,totalCount:r,onModeChange:i}){return e?(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[`scoped`,`all`].map(e=>(0,F.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,F.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` scoped / `,r,` total runs`]})]}):(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No analytics scope configured`})}var ge=[`builder`,`yaml`,`memory`];function L({status:e}){switch(e){case`passed`:return(0,F.jsx)(E,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,F.jsx)(E,{variant:`destructive`,children:`Failed`});case`healed`:return(0,F.jsx)(E,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,F.jsx)(E,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,F.jsx)(E,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,F.jsx)(E,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,F.jsx)(E,{variant:`outline`,children:e})}}function _e({runs:e}){return e.length===0?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-32 text-sm text-muted-foreground`,children:`No runs yet — click Run to start`}):(0,F.jsxs)(M,{children:[(0,F.jsx)(D,{children:(0,F.jsxs)(A,{children:[(0,F.jsx)(O,{children:`Status`}),(0,F.jsx)(O,{children:`Duration`}),(0,F.jsx)(O,{children:`Date`})]})}),(0,F.jsx)(k,{children:e.map(e=>(0,F.jsxs)(A,{className:`relative cursor-pointer hover:bg-muted/50`,children:[(0,F.jsxs)(j,{children:[(0,F.jsx)(T,{to:p.runDetailOrLive(e.id,e.status),className:`absolute inset-0`,tabIndex:-1}),(0,F.jsx)(L,{status:e.status})]}),(0,F.jsx)(j,{children:e.status===`running`?(0,F.jsx)(`span`,{className:`text-blue-500 text-sm`,children:`In progress...`}):(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:w(e.duration)})}),(0,F.jsx)(j,{children:(0,F.jsxs)(S,{children:[(0,F.jsx)(y,{asChild:!0,children:(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:h(e.createdAt)})}),(0,F.jsx)(v,{children:_(e.createdAt)})]})})]},e.id))})]})}function R(){let{t_id:e}=oe(),h=ae(),{defaultRunMode:g}=r(),[_,v]=le(),y=e??``,b=(0,P.useMemo)(()=>me(_,ge),[_]),x=(0,P.useMemo)(()=>N(b,_),[_,b]),S=b.tab,C=b.view,[R,ve]=(0,P.useState)(``),[ye,be]=(0,P.useState)(``),[xe,z]=(0,P.useState)(!0),[Se,B]=(0,P.useState)(!1),[V,Ce]=(0,P.useState)(null),[H,U]=(0,P.useState)(`all`),[W,G]=(0,P.useState)(!1),[we,Te]=(0,P.useState)(!1),K=(0,P.useMemo)(()=>{let e=R.match(/^name:\s*(.+)$/m);return e?e[1].trim():null},[R]);a(K||`Test`);let q=V?.scope?.configured===!0,J=H===`scoped`&&q&&V?.scopedTrends?V.scopedTrends:V?.trends,Y=H===`scoped`&&q&&V?.scopedFlakyScore!==void 0?V.scopedFlakyScore:V?.flakyScore??0,Ee=H===`scoped`&&q?V?.scopedRuns??[]:V?.runs??[],De=(0,P.useMemo)(()=>J?.daily?J.daily.map(e=>({date:e.date,passRate:e.total>0?Math.round(e.passed/e.total*1e3)/10:0})):[],[J]),Oe=(0,P.useMemo)(()=>V?.trends.daily?V.trends.daily.map(e=>({date:e.date,duration:e.avgDuration})):[],[V]),X=Ee;(0,P.useEffect)(()=>{V&&U(V.scope?.configured?`scoped`:`all`)},[V]),(0,P.useEffect)(()=>{x.toString()!==_.toString()&&v(x,{replace:!0})},[x,_,v]),(0,P.useEffect)(()=>{if(!y){B(!0),z(!1);return}let e=!1;return ue(y).then(t=>{e||(ve(t.content),be(t.path))}).catch(()=>{e||(B(!0),m.error(`Failed to load test file`))}).finally(()=>{e||z(!1)}),()=>{e=!0}},[y]),(0,P.useEffect)(()=>{if(!K)return;let e=!1;return se(K,{limit:50}).then(t=>{e||Ce(t)}).catch(()=>{}),()=>{e=!0}},[K]);let Z=async e=>{if(!W){G(!0);try{let t=await ie({file:ye,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{G(!1)}}},Q=p.testEdit(y),$=p.testEditLive(y);fe({e:()=>h(Q),r:()=>{Z(g===`local`)},l:()=>h($)});let ke=e=>{v(N(e,_),{replace:!0})};if(xe)return(0,F.jsx)(ce,{});if(Se)return(0,F.jsx)(de,{icon:n,title:`Test not found`,description:`This test file doesn't exist`,actionLabel:`View All Tests`,onAction:()=>h(p.tests)});let Ae=(0,F.jsx)(o,{content:R,onChange:()=>{},disabled:!0}),je=(0,F.jsx)(t,{value:R,onChange:()=>{},readOnly:!0,className:`h-full`}),Me=V&&(0,F.jsxs)(`aside`,{"data-testid":`test-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,F.jsx)(`div`,{className:`border-b border-border px-3 py-2`,children:(0,F.jsx)(I,{configured:q,mode:H,scopedCount:V.scope?.scopedCount??0,totalCount:V.scope?.totalCount??V.total,onModeChange:U})}),(0,F.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 border-x-0 border-t-0`,children:[(0,F.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Pass Rate`}),(0,F.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[Math.round((J??V.trends).passRate*100),`%`]})]}),(0,F.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Avg Duration`}),(0,F.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:w(V.trends.avgDuration)})]}),(0,F.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Total Runs`}),(0,F.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:V.total.toLocaleString()})]}),(0,F.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Flaky Score`}),(0,F.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[(Y*100).toFixed(0),`%`]})]})]}),(0,F.jsx)(s,{className:`border-x-0 border-y-0`,children:(0,F.jsxs)(c,{className:`flex flex-col gap-2 px-3 py-3`,children:[(0,F.jsxs)(`span`,{className:`text-sm font-medium text-foreground`,children:[H===`scoped`&&q?`Scoped Runs`:`All Runs`,` (`,X.length,`)`]}),X.length===0?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-16 text-sm text-muted-foreground`,children:`No runs yet`}):(0,F.jsxs)(M,{children:[(0,F.jsx)(D,{children:(0,F.jsxs)(A,{children:[(0,F.jsx)(O,{children:`Status`}),(0,F.jsx)(O,{children:`Duration`}),(0,F.jsx)(O,{children:`Date`})]})}),(0,F.jsx)(k,{children:X.slice(0,5).map(e=>(0,F.jsxs)(A,{className:`relative cursor-pointer hover:bg-muted/50`,children:[(0,F.jsxs)(j,{children:[(0,F.jsx)(T,{to:p.runDetailOrLive(e.id,e.status),className:`absolute inset-0`,tabIndex:-1}),(0,F.jsx)(L,{status:e.status})]}),(0,F.jsx)(j,{children:e.status===`running`?(0,F.jsx)(`span`,{className:`text-blue-500 text-sm`,children:`In progress...`}):(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:w(e.duration)})}),(0,F.jsx)(j,{children:(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:he(e.createdAt)})})]},e.id))})]})]})})]});return(0,F.jsx)(re,{children:(0,F.jsxs)(`div`,{className:`flex flex-col h-screen`,children:[(0,F.jsx)(ee,{testName:K||`Test`,testId:y,unsaved:!1,isCreateMode:!1,mode:`view`,testHref:Q,isSaving:!1,isValidating:!1,isRunning:W,hasInvalidFilename:!1,showTestId:!1,onBack:()=>h(p.tests),onSave:()=>{},onValidate:()=>{},onRun:e=>Z(e),onLiveConnect:()=>h($),onSettingsOpen:()=>{},shortcutsOpen:we,onToggleShortcuts:()=>Te(e=>!e)}),(0,F.jsxs)(f,{value:S,onValueChange:e=>ke({tab:e,view:C}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,F.jsx)(`div`,{className:`px-4 border-b border-border`,children:(0,F.jsxs)(d,{variant:`line`,children:[(0,F.jsx)(l,{value:`overview`,children:`Overview`}),(0,F.jsx)(l,{value:`insights`,children:`Insights`})]})}),(0,F.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,F.jsx)(`div`,{className:`min-w-0 min-h-0 flex flex-col`,children:(0,F.jsxs)(f,{value:C,onValueChange:e=>ke({tab:S,view:e}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,F.jsx)(`div`,{className:`px-4 border-b border-border`,children:(0,F.jsxs)(d,{variant:`line`,className:`w-full grid grid-cols-3 md:w-fit md:inline-flex`,children:[(0,F.jsx)(l,{value:`builder`,children:`Builder`}),(0,F.jsx)(l,{value:`yaml`,children:`YAML`}),(0,F.jsx)(l,{value:`memory`,children:`Memory`})]})}),(0,F.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[(0,F.jsx)(u,{value:`builder`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:Ae}),(0,F.jsx)(u,{value:`yaml`,className:`absolute inset-0 data-[state=inactive]:hidden`,children:je}),(0,F.jsx)(u,{value:`memory`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:(0,F.jsx)(pe,{scope:`test`,scopeId:y,emptyTitle:`No test memory yet`,emptyDescription:`This test doesn't have cataloged observations in this workspace yet. Run the test with memory enabled, then reopen this tab.`})})]})]})}),Me]}),(0,F.jsx)(u,{value:`insights`,className:`flex-1 overflow-y-auto mt-0`,children:(0,F.jsx)(`div`,{"data-testid":`test-detail-insights`,className:`px-4 py-3`,children:V?(0,F.jsxs)(`div`,{className:`space-y-3`,children:[V.isFlaky&&(0,F.jsxs)(E,{variant:`destructive`,children:[(0,F.jsx)(i,{className:`size-3`}),`Flaky (score: `,V.flakyScore.toFixed(2),`)`]}),(0,F.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 md:grid-cols-4`,children:[(0,F.jsx)(c,{className:`border-b border-border md:border-b-0`,children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Total Runs`}),(0,F.jsx)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:V.total.toLocaleString()})]})}),(0,F.jsx)(c,{className:`border-b border-border md:border-b-0 md:border-r`,children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pass Rate`}),(0,F.jsxs)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:[Math.round((J??V.trends).passRate*100),`%`]})]})}),(0,F.jsx)(c,{children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Avg Duration`}),(0,F.jsx)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:w(V.trends.avgDuration)})]})}),(0,F.jsx)(c,{children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Flaky Score`}),(0,F.jsxs)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:[(Y*100).toFixed(0),`%`]})]})})]}),(0,F.jsx)(s,{children:(0,F.jsx)(c,{className:`px-4 py-3`,children:(0,F.jsx)(I,{configured:q,mode:H,scopedCount:V.scope?.scopedCount??0,totalCount:V.scope?.totalCount??V.total,onModeChange:U})})}),(J?.daily.length??0)>0&&(0,F.jsxs)(s,{className:`md:grid-cols-2 md:divide-x md:divide-y-0`,children:[(0,F.jsxs)(c,{className:`px-4 py-3`,children:[(0,F.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Pass Rate`}),(0,F.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,F.jsx)(ne,{data:De})})]}),(0,F.jsxs)(c,{className:`px-4 py-3`,children:[(0,F.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Duration`}),(0,F.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,F.jsx)(te,{data:Oe})})]})]}),(0,F.jsx)(s,{children:(0,F.jsxs)(c,{className:`px-4 py-3`,children:[(0,F.jsxs)(`p`,{className:`text-sm font-medium mb-2`,children:[H===`scoped`&&q?`Scoped Runs`:`All Runs`,` (`,X.length,`)`]}),(0,F.jsx)(_e,{runs:X})]})})]}):(0,F.jsx)(s,{children:(0,F.jsx)(c,{className:`flex h-32 items-center justify-center text-sm text-muted-foreground`,children:`No analytics data available`})})})})]})]})})}export{R as default};
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-DNT0Mzki.js";import{t as n}from"./file-code-B3iDpJRP.js";import{n as r}from"./split-button-DcY8ames.js";import{t as i}from"./zap-KFJmkY3Y.js";import{t as a}from"./use-page-title-B1t9-5_U.js";import{n as o,t as ee}from"./test-navbar-DoHKAy1p.js";import{a as te,n as s,o as ne,t as c}from"./insights-line-grid-BKOqA-1W.js";import{i as l,n as u,r as d,t as f}from"./tabs-DrB_Acb3.js";import{$n as p,At as m,Gt as h,Jt as g,Kt as _,Mt as v,Nt as re,Pt as y,Qn as b,St as ie,Ut as x,cr as ae,jt as S,lr as oe,lt as se,pr as C,qt as w,r as ce,sr as T,ur as le,ut as ue}from"./index-Bvtm2F6f.js";import{t as E}from"./badge-DrW2vGVJ.js";import{a as D,i as O,n as k,o as A,r as j,t as M}from"./table-D08QBBt4.js";import{t as de}from"./empty-state-BTvOA5lp.js";import{t as fe}from"./use-keyboard-shortcuts-EAppuiKO.js";import{n as N,r as pe,t as me}from"./viewer-url-state-6mOK5_sY.js";var P=e(C(),1),F=b();function he(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 I({configured:e,mode:t,scopedCount:n,totalCount:r,onModeChange:i}){return e?(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[`scoped`,`all`].map(e=>(0,F.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,F.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` scoped / `,r,` total runs`]})]}):(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No analytics scope configured`})}var ge=[`builder`,`yaml`,`memory`];function L({status:e}){switch(e){case`passed`:return(0,F.jsx)(E,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,F.jsx)(E,{variant:`destructive`,children:`Failed`});case`healed`:return(0,F.jsx)(E,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,F.jsx)(E,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,F.jsx)(E,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,F.jsx)(E,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,F.jsx)(E,{variant:`outline`,children:e})}}function _e({runs:e}){return e.length===0?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-32 text-sm text-muted-foreground`,children:`No runs yet — click Run to start`}):(0,F.jsxs)(M,{children:[(0,F.jsx)(D,{children:(0,F.jsxs)(A,{children:[(0,F.jsx)(O,{children:`Status`}),(0,F.jsx)(O,{children:`Duration`}),(0,F.jsx)(O,{children:`Date`})]})}),(0,F.jsx)(k,{children:e.map(e=>(0,F.jsxs)(A,{className:`relative cursor-pointer hover:bg-muted/50`,children:[(0,F.jsxs)(j,{children:[(0,F.jsx)(T,{to:p.runDetailOrLive(e.id,e.status),className:`absolute inset-0`,tabIndex:-1}),(0,F.jsx)(L,{status:e.status})]}),(0,F.jsx)(j,{children:e.status===`running`?(0,F.jsx)(`span`,{className:`text-blue-500 text-sm`,children:`In progress...`}):(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:w(e.duration)})}),(0,F.jsx)(j,{children:(0,F.jsxs)(S,{children:[(0,F.jsx)(y,{asChild:!0,children:(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:h(e.createdAt)})}),(0,F.jsx)(v,{children:_(e.createdAt)})]})})]},e.id))})]})}function R(){let{t_id:e}=oe(),h=ae(),{defaultRunMode:g}=r(),[_,v]=le(),y=e??``,b=(0,P.useMemo)(()=>me(_,ge),[_]),x=(0,P.useMemo)(()=>N(b,_),[_,b]),S=b.tab,C=b.view,[R,ve]=(0,P.useState)(``),[ye,be]=(0,P.useState)(``),[xe,z]=(0,P.useState)(!0),[Se,B]=(0,P.useState)(!1),[V,Ce]=(0,P.useState)(null),[H,U]=(0,P.useState)(`all`),[W,G]=(0,P.useState)(!1),[we,Te]=(0,P.useState)(!1),K=(0,P.useMemo)(()=>{let e=R.match(/^name:\s*(.+)$/m);return e?e[1].trim():null},[R]);a(K||`Test`);let q=V?.scope?.configured===!0,J=H===`scoped`&&q&&V?.scopedTrends?V.scopedTrends:V?.trends,Y=H===`scoped`&&q&&V?.scopedFlakyScore!==void 0?V.scopedFlakyScore:V?.flakyScore??0,Ee=H===`scoped`&&q?V?.scopedRuns??[]:V?.runs??[],De=(0,P.useMemo)(()=>J?.daily?J.daily.map(e=>({date:e.date,passRate:e.total>0?Math.round(e.passed/e.total*1e3)/10:0})):[],[J]),Oe=(0,P.useMemo)(()=>V?.trends.daily?V.trends.daily.map(e=>({date:e.date,duration:e.avgDuration})):[],[V]),X=Ee;(0,P.useEffect)(()=>{V&&U(V.scope?.configured?`scoped`:`all`)},[V]),(0,P.useEffect)(()=>{x.toString()!==_.toString()&&v(x,{replace:!0})},[x,_,v]),(0,P.useEffect)(()=>{if(!y){B(!0),z(!1);return}let e=!1;return ue(y).then(t=>{e||(ve(t.content),be(t.path))}).catch(()=>{e||(B(!0),m.error(`Failed to load test file`))}).finally(()=>{e||z(!1)}),()=>{e=!0}},[y]),(0,P.useEffect)(()=>{if(!K)return;let e=!1;return se(K,{limit:50}).then(t=>{e||Ce(t)}).catch(()=>{}),()=>{e=!0}},[K]);let Z=async e=>{if(!W){G(!0);try{let t=await ie({file:ye,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{G(!1)}}},Q=p.testEdit(y),$=p.testEditLive(y);fe({e:()=>h(Q),r:()=>{Z(g===`local`)},l:()=>h($)});let ke=e=>{v(N(e,_),{replace:!0})};if(xe)return(0,F.jsx)(ce,{});if(Se)return(0,F.jsx)(de,{icon:n,title:`Test not found`,description:`This test file doesn't exist`,actionLabel:`View All Tests`,onAction:()=>h(p.tests)});let Ae=(0,F.jsx)(o,{content:R,onChange:()=>{},disabled:!0}),je=(0,F.jsx)(t,{value:R,onChange:()=>{},readOnly:!0,className:`h-full`}),Me=V&&(0,F.jsxs)(`aside`,{"data-testid":`test-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,F.jsx)(`div`,{className:`border-b border-border px-3 py-2`,children:(0,F.jsx)(I,{configured:q,mode:H,scopedCount:V.scope?.scopedCount??0,totalCount:V.scope?.totalCount??V.total,onModeChange:U})}),(0,F.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 border-x-0 border-t-0`,children:[(0,F.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Pass Rate`}),(0,F.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[Math.round((J??V.trends).passRate*100),`%`]})]}),(0,F.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Avg Duration`}),(0,F.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:w(V.trends.avgDuration)})]}),(0,F.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Total Runs`}),(0,F.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:V.total.toLocaleString()})]}),(0,F.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Flaky Score`}),(0,F.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[(Y*100).toFixed(0),`%`]})]})]}),(0,F.jsx)(s,{className:`border-x-0 border-y-0`,children:(0,F.jsxs)(c,{className:`flex flex-col gap-2 px-3 py-3`,children:[(0,F.jsxs)(`span`,{className:`text-sm font-medium text-foreground`,children:[H===`scoped`&&q?`Scoped Runs`:`All Runs`,` (`,X.length,`)`]}),X.length===0?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-16 text-sm text-muted-foreground`,children:`No runs yet`}):(0,F.jsxs)(M,{children:[(0,F.jsx)(D,{children:(0,F.jsxs)(A,{children:[(0,F.jsx)(O,{children:`Status`}),(0,F.jsx)(O,{children:`Duration`}),(0,F.jsx)(O,{children:`Date`})]})}),(0,F.jsx)(k,{children:X.slice(0,5).map(e=>(0,F.jsxs)(A,{className:`relative cursor-pointer hover:bg-muted/50`,children:[(0,F.jsxs)(j,{children:[(0,F.jsx)(T,{to:p.runDetailOrLive(e.id,e.status),className:`absolute inset-0`,tabIndex:-1}),(0,F.jsx)(L,{status:e.status})]}),(0,F.jsx)(j,{children:e.status===`running`?(0,F.jsx)(`span`,{className:`text-blue-500 text-sm`,children:`In progress...`}):(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:w(e.duration)})}),(0,F.jsx)(j,{children:(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:he(e.createdAt)})})]},e.id))})]})]})})]});return(0,F.jsx)(re,{children:(0,F.jsxs)(`div`,{className:`flex flex-col h-screen`,children:[(0,F.jsx)(ee,{testName:K||`Test`,testId:y,unsaved:!1,isCreateMode:!1,mode:`view`,testHref:Q,isSaving:!1,isValidating:!1,isRunning:W,hasInvalidFilename:!1,showTestId:!1,onBack:()=>h(p.tests),onSave:()=>{},onValidate:()=>{},onRun:e=>Z(e),onLiveConnect:()=>h($),onSettingsOpen:()=>{},shortcutsOpen:we,onToggleShortcuts:()=>Te(e=>!e)}),(0,F.jsxs)(f,{value:S,onValueChange:e=>ke({tab:e,view:C}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,F.jsx)(`div`,{className:`px-4 border-b border-border`,children:(0,F.jsxs)(d,{variant:`line`,children:[(0,F.jsx)(l,{value:`overview`,children:`Overview`}),(0,F.jsx)(l,{value:`insights`,children:`Insights`})]})}),(0,F.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,F.jsx)(`div`,{className:`min-w-0 min-h-0 flex flex-col`,children:(0,F.jsxs)(f,{value:C,onValueChange:e=>ke({tab:S,view:e}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,F.jsx)(`div`,{className:`px-4 border-b border-border`,children:(0,F.jsxs)(d,{variant:`line`,className:`w-full grid grid-cols-3 md:w-fit md:inline-flex`,children:[(0,F.jsx)(l,{value:`builder`,children:`Builder`}),(0,F.jsx)(l,{value:`yaml`,children:`YAML`}),(0,F.jsx)(l,{value:`memory`,children:`Memory`})]})}),(0,F.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[(0,F.jsx)(u,{value:`builder`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:Ae}),(0,F.jsx)(u,{value:`yaml`,className:`absolute inset-0 data-[state=inactive]:hidden`,children:je}),(0,F.jsx)(u,{value:`memory`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:(0,F.jsx)(pe,{scope:`test`,scopeId:y,emptyTitle:`No test memory yet`,emptyDescription:`This test doesn't have cataloged observations in this workspace yet. Run the test with memory enabled, then reopen this tab.`})})]})]})}),Me]}),(0,F.jsx)(u,{value:`insights`,className:`flex-1 overflow-y-auto mt-0`,children:(0,F.jsx)(`div`,{"data-testid":`test-detail-insights`,className:`px-4 py-3`,children:V?(0,F.jsxs)(`div`,{className:`space-y-3`,children:[V.isFlaky&&(0,F.jsxs)(E,{variant:`destructive`,children:[(0,F.jsx)(i,{className:`size-3`}),`Flaky (score: `,V.flakyScore.toFixed(2),`)`]}),(0,F.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 md:grid-cols-4`,children:[(0,F.jsx)(c,{className:`border-b border-border md:border-b-0`,children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Total Runs`}),(0,F.jsx)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:V.total.toLocaleString()})]})}),(0,F.jsx)(c,{className:`border-b border-border md:border-b-0 md:border-r`,children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pass Rate`}),(0,F.jsxs)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:[Math.round((J??V.trends).passRate*100),`%`]})]})}),(0,F.jsx)(c,{children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Avg Duration`}),(0,F.jsx)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:w(V.trends.avgDuration)})]})}),(0,F.jsx)(c,{children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Flaky Score`}),(0,F.jsxs)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:[(Y*100).toFixed(0),`%`]})]})})]}),(0,F.jsx)(s,{children:(0,F.jsx)(c,{className:`px-4 py-3`,children:(0,F.jsx)(I,{configured:q,mode:H,scopedCount:V.scope?.scopedCount??0,totalCount:V.scope?.totalCount??V.total,onModeChange:U})})}),(J?.daily.length??0)>0&&(0,F.jsxs)(s,{className:`md:grid-cols-2 md:divide-x md:divide-y-0`,children:[(0,F.jsxs)(c,{className:`px-4 py-3`,children:[(0,F.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Pass Rate`}),(0,F.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,F.jsx)(ne,{data:De})})]}),(0,F.jsxs)(c,{className:`px-4 py-3`,children:[(0,F.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Duration`}),(0,F.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,F.jsx)(te,{data:Oe})})]})]}),(0,F.jsx)(s,{children:(0,F.jsxs)(c,{className:`px-4 py-3`,children:[(0,F.jsxs)(`p`,{className:`text-sm font-medium mb-2`,children:[H===`scoped`&&q?`Scoped Runs`:`All Runs`,` (`,X.length,`)`]}),(0,F.jsx)(_e,{runs:X})]})})]}):(0,F.jsx)(s,{children:(0,F.jsx)(c,{className:`flex h-32 items-center justify-center text-sm text-muted-foreground`,children:`No analytics data available`})})})})]})]})})}export{R as default};
@@ -1 +1 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-D8UGCR46.js";import{i as n,n as r,o as i,s as a,t as o}from"./select-B2_tSMl_.js";import{n as s}from"./split-button-C54F4hz3.js";import{n as c,r as l}from"./shortcut-hints-BnEYaq1r.js";import{t as u}from"./plus-BDA9KiOF.js";import{t as d}from"./use-page-title-BeSr97vd.js";import{t as f}from"./batch-action-bar-BlKdJC25.js";import{n as p,t as m}from"./scroll-area-48uajHeh.js";import{$n as h,At as g,Gt as _,Hn as ee,Ht as te,Mt as ne,N as re,Nn as ie,Nt as ae,Pt as oe,Qn as se,St as ce,Ut as v,Wt as y,a as le,cr as ue,dt as de,gt as fe,jt as pe,nt as me,pr as b,sr as he,ur as x}from"./index-CZotRLCc.js";import{t as S}from"./badge-Dd058S66.js";import{a as ge,n as _e,o as ve,r as ye,t as C}from"./lib-CCr9qhea.js";import{a as be,i as xe,n as Se,o as w,r as Ce,t as we}from"./table-BGMQ2E9D.js";import{t as Te}from"./empty-state-c1UKljbh.js";import{t as Ee}from"./use-keyboard-shortcuts-BTppBDf3.js";import{n as De,t as Oe}from"./use-selection-queue-B7ZRHEAV.js";import{n as ke,r as Ae,t as je}from"./tests-suites-table-widths-C3pXnpiW.js";var T=e(b(),1),E=new Set([`asc`,`desc`]),D=50;function Me(e){if(!e)return 1;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>1?t:1}function O(e){let t=new URLSearchParams;return e.search&&t.set(`search`,e.search),e.status&&t.set(`status`,e.status),e.platform&&t.set(`platform`,e.platform),e.target&&t.set(`target`,e.target),e.sort&&(t.set(`sort`,e.sort),t.set(`order`,e.order)),e.page>1&&t.set(`page`,String(e.page)),t}function Ne(){let[e,t]=x(),n=e.get(`search`)??``,r=e.get(`status`)??``,i=e.get(`platform`)??``,a=e.get(`target`)??``,o=e.get(`sort`)??``,s=e.get(`order`)??`desc`,c=E.has(s)?s:`desc`,l=Me(e.get(`page`)),u=(0,T.useMemo)(()=>o?[{id:o,desc:c===`desc`}]:[],[o,c]),d=(0,T.useRef)(u);d.current=u;let f=(0,T.useMemo)(()=>({search:n,status:r,platform:i,target:a,sort:o,order:c,page:l}),[n,r,i,a,o,c,l]);(0,T.useEffect)(()=>{let n=O(f);e.toString()!==n.toString()&&t(n,{replace:!0})},[e,t,f]);let p=(0,T.useCallback)((e,n)=>{let r={...f,...e};n?.resetPage&&(r.page=1),t(O(r),{replace:!0})},[t,f]),m=(0,T.useCallback)(e=>{let t=typeof e==`function`?e(d.current):e;t.length>0?p({sort:t[0].id,order:t[0].desc?`desc`:`asc`}):p({sort:``,order:`desc`})},[p]),h=(0,T.useMemo)(()=>({pageIndex:l-1,pageSize:D}),[l]);return{search:n,status:r,platform:i,target:a,sort:o,order:c,page:l,sorting:u,pagination:h,onSortingChange:m,onPaginationChange:(0,T.useCallback)(e=>{p({page:(typeof e==`function`?e(h):e).pageIndex+1})},[h,p]),setSearch:(0,T.useCallback)(e=>p({search:e},{resetPage:!0}),[p]),setStatus:(0,T.useCallback)(e=>p({status:e},{resetPage:!0}),[p]),setPlatform:(0,T.useCallback)(e=>p({platform:e},{resetPage:!0}),[p]),setTarget:(0,T.useCallback)(e=>p({target:e},{resetPage:!0}),[p]),setPage:(0,T.useCallback)(e=>p({page:e}),[p])}}var k=se();function A({status:e}){switch(e){case`passed`:return(0,k.jsx)(S,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,k.jsx)(S,{variant:`destructive`,children:`Failed`});case`healed`:return(0,k.jsx)(S,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,k.jsx)(S,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,k.jsx)(S,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,k.jsx)(S,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,k.jsx)(S,{variant:`outline`,children:e})}}var Pe=new Set([`passed`,`healed`]),Fe=new Set([`passed`,`healed`,`failed`,`flaky`,`cancelled`]);function j(e){return e?e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1):`—`}function M(e){return e.replace(/\\/g,`/`)}function N(e){let t=M(e).split(`/`).filter(Boolean);return t.length>1?t.slice(1).join(`/`):t[0]??e}function P(e){return e.createdAt||e.startedAt||e.endedAt||``}function Ie(e){return y(`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 Le(e){return y(`py-2 align-top`,e===`select`&&`px-2`,e===`name`&&`max-w-0 px-3`,(e===`target`||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 Re({isActive:e,isBatchSelected:t}){return y(`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`)}var F=[{accessorKey:`name`,header:({column:e})=>(0,k.jsxs)(v,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Test Name`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsxs)(`div`,{className:`min-w-0 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:N(e.original.path)})]}),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)(v,{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)(v,{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-sm text-muted-foreground`,children:j(e.getValue(`platform`))})},{accessorKey:`passRate`,header:({column:e})=>(0,k.jsxs)(v,{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)(v,{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)(he,{to:h.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)(A,{status:e.original.lastRun.status}),(0,k.jsx)(`span`,{className:`whitespace-normal break-words text-xs leading-snug text-muted-foreground`,children:_(P(e.original.lastRun))})]}):(0,k.jsx)(`span`,{className:`block text-sm text-muted-foreground`,children:`No runs`}),sortingFn:(e,t)=>{let n=P(e.original.lastRun??{createdAt:``,startedAt:null,endedAt:null}),r=P(t.original.lastRun??{createdAt:``,startedAt:null,endedAt:null});return n.localeCompare(r)}}];function I(){d(`Tests`);let[e,t]=(0,T.useState)([]),[_,se]=(0,T.useState)([]),[b,he]=(0,T.useState)([]),[x,S]=(0,T.useState)(!0),[E,D]=(0,T.useState)(!1),[Me,O]=(0,T.useState)(!1),[A,j]=(0,T.useState)(!0),[I,ze]=(0,T.useState)(!0),L=ue(),{hasFarm:Be,isLoading:Ve}=s();(0,T.useEffect)(()=>{let e=!1;return Promise.all([de(),me({limit:200})]).then(([n,r])=>{e||(t(n.files),he(n.targets??[]),se(r.runs))}).catch(()=>{e||g.error(`Failed to load test files`)}).finally(()=>{e||S(!1)}),()=>{e=!0}},[]);let{search:R,status:z,platform:B,target:V,page:He,sorting:Ue,pagination:H,onSortingChange:We,onPaginationChange:Ge,setSearch:Ke,setStatus:qe,setPlatform:Je,setTarget:Ye,setPage:Xe}=Ne(),[U,W]=(0,T.useState)(-1),Ze=(0,T.useRef)([]),G=(0,T.useMemo)(()=>{let t=new Map,n=new Map,r=(e,t,n)=>{if(!t)return;let r=e.get(t);r?r.push(n):e.set(t,[n])};for(let e of _){if(!e.filePath)continue;let i=M(e.filePath);r(t,i,e),r(n,N(i),e)}return e.map(e=>{let r=M(e.path),i=[...t.get(r)??n.get(N(r))??[]].sort((e,t)=>P(t).localeCompare(P(e))),a=i.filter(e=>Fe.has(e.status)),o=a.filter(e=>Pe.has(e.status)).length,s=a.length>0?Math.round(o/a.length*100):null,c=i[0]??null;return{path:e.path,name:e.name,testId:e.testId,targetName:e.targetName,platform:e.platform,lastRunStatus:c?.status??null,lastRun:c,passRate:s,passCount:o,completedRunCount:a.length}})},[e,_]),K=(0,T.useMemo)(()=>{let e=G;if(R){let t=R.toLowerCase();e=e.filter(e=>{let n=e.targetName?.toLowerCase()??``;return e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)||n.includes(t)})}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)),V&&(e=e.filter(e=>e.targetName===V)),e},[G,R,z,B,V]),q=Oe({items:G,getId:e=>e.path,visibleIds:K.map(e=>e.path)}),Qe=(0,T.useMemo)(()=>Array.from(new Set([V,...b,...G.map(e=>e.targetName??``)].filter(e=>!!e))),[G,V,b]),$e={id:`select`,header:({table:e})=>(0,k.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,k.jsx)(Ae,{checked:q.getVisibleSelectionState(e.getRowModel().rows.map(e=>e.original.path)),onCheckedChange:t=>q.setItemsSelected(e.getRowModel().rows.map(e=>e.original),t),ariaLabel:`Select all`})}),cell:({row:e})=>(0,k.jsx)(Ae,{checked:q.isSelected(e.original.path),onCheckedChange:t=>q.setItemSelected(e.original,t)}),enableSorting:!1,size:48},J=q.selectedIds,Y=q.selectedItems,et=(0,T.useCallback)(()=>{q.clearSelection(),O(!1),j(!0),ze(!0)},[q]),tt=(0,T.useCallback)(async e=>{if(J.length!==0){D(!0);try{let t=await Promise.allSettled(J.map(t=>ce({file:t,local:e,noCache:!A,noMemory:!I}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;r>0?g.error(`${n} runs queued, ${r} failed`):g.success(`${n} runs queued`),O(!1)}finally{D(!1)}}},[J,A,I]),nt=(0,T.useCallback)(async()=>{if(J.length!==0){D(!0);try{let e=await Promise.allSettled(J.map(e=>fe({file:e}))),t=e.filter(e=>e.status===`fulfilled`).length,n=e.filter(e=>e.status===`fulfilled`).reduce((e,t)=>e+t.value.purged,0),r=e.length-t;r>0?g.error(`Purged ${n} plans from ${t} tests, ${r} failed`):g.success(`Purged ${n} cached plan${n===1?``:`s`}`)}finally{D(!1)}}},[J]),rt=(0,T.useCallback)(async()=>{if(Y.length!==0){D(!0);try{let e=await Promise.allSettled(Y.map(e=>e.testId?re(e.testId):Promise.reject(Error(`Missing test id for ${e.path}`)))),n=Y.filter((t,n)=>e[n]?.status===`fulfilled`),r=new Set(n.map(e=>e.path)),i=e.length-n.length;n.length>0&&(q.setItemsSelected(n,!1),t(e=>e.filter(e=>!r.has(e.path))),O(!1)),i>0?g.error(`Deleted ${n.length} test${n.length===1?``:`s`}, ${i} failed`):g.success(`Deleted ${n.length} test${n.length===1?``:`s`}`)}finally{D(!1)}}},[Y,q]),X=_e({data:K,columns:[$e,...F],getCoreRowModel:ye(),getSortedRowModel:ve(),getPaginationRowModel:ge(),onSortingChange:We,onPaginationChange:Ge,getRowId:e=>e.path,state:{sorting:Ue,pagination:H}}),Z=X.getRowModel().rows,Q=q.hiddenCount,it=R;(0,T.useEffect)(()=>{if(x)return;let e=Math.max(1,Math.ceil(K.length/H.pageSize));He>e&&Xe(e)},[K.length,x,He,H.pageSize,Xe]);let at=(0,T.useCallback)(e=>{Ke(e),W(-1)},[Ke]);Ee((0,T.useMemo)(()=>{let e=()=>W(e=>Math.min(e+1,Z.length-1)),t=()=>W(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{if(U>=0&&Z[U]){let t=Z[U].original,n=h.testView(t.testId??t.path);e.metaKey||e.ctrlKey?window.open(n,`_blank`):L(n)}}}},[Z,U,L])),(0,T.useEffect)(()=>{if(U<0)return;let e=Ze.current[U];e&&document.activeElement!==e&&e.focus()},[U,Z.length]);let ot=(0,T.useCallback)((e,t)=>{t&&t.preventDefault(),L(h.testView(e.testId??e.path))},[L]);if(x)return(0,k.jsx)(le,{});if(e.length===0)return(0,k.jsx)(Te,{icon:ee,title:`No tests found`,description:`Create your first test file to get started`,actionLabel:`Create Test`,onAction:()=>L(h.testNew)});let $=K.length,st=H.pageIndex,ct=H.pageSize,lt=st*ct+1,ut=Math.min(lt+ct-1,$);return(0,k.jsx)(ae,{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:`Tests`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(pe,{children:[(0,k.jsx)(oe,{asChild:!0,children:(0,k.jsx)(v,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,k.jsx)(l,{className:`h-4 w-4`})})}),(0,k.jsx)(ne,{side:`bottom`,className:`p-3`,children:(0,k.jsx)(c,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open test`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]}),(0,k.jsxs)(v,{size:`sm`,onClick:()=>L(h.testNew),children:[(0,k.jsx)(u,{className:`size-4`}),`New Test`]})]})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,k.jsx)(te,{placeholder:`Search tests...`,value:it,onChange:e=>at(e.target.value),className:`max-w-[220px]`}),(0,k.jsxs)(o,{value:z||`all`,onValueChange:e=>{qe(e===`all`?``:e),W(-1)},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=>{Je(e===`all`?``:e),W(-1)},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)(o,{value:V||`all`,onValueChange:e=>{Ye(e===`all`?``:e),W(-1)},children:[(0,k.jsx)(i,{className:`w-[180px]`,children:(0,k.jsx)(a,{placeholder:`All targets`})}),(0,k.jsxs)(r,{children:[(0,k.jsx)(n,{value:`all`,children:`All targets`}),Qe.map(e=>(0,k.jsx)(n,{value:e,children:e},e))]})]})]}),(0,k.jsxs)(m,{className:`rounded-md border`,children:[(0,k.jsxs)(we,{className:`min-w-full table-fixed`,children:[(0,k.jsx)(`colgroup`,{children:je.map(e=>{let t=ke(e);return(0,k.jsx)(`col`,{"data-column-id":e,style:t?{width:t}:void 0},e)})}),(0,k.jsx)(be,{children:X.getHeaderGroups().map(e=>(0,k.jsx)(w,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,k.jsx)(xe,{className:Ie(e.column.id),children:e.isPlaceholder?null:C(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,k.jsx)(Se,{children:Z.length?Z.map((e,t)=>{let n=t===U,r=q.isSelected(e.original.path);return(0,k.jsx)(w,{ref:e=>{Ze.current[t]=e},"data-runs-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:Re({isActive:n,isBatchSelected:r}),onClick:()=>ot(e.original),onFocus:()=>W(t),onKeyDown:t=>{t.key===`Enter`&&ot(e.original,t)},children:e.getVisibleCells().map(e=>{let t=e.column.id===`select`;return(0,k.jsx)(Ce,{className:y(Le(e.column.id),t&&`relative z-10`),children:C(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)}):(0,k.jsx)(w,{children:(0,k.jsx)(Ce,{colSpan:F.length+1,className:`h-24 text-center`,children:`No tests match the current search or filters.`})})})]}),(0,k.jsx)(p,{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:$>0?`Showing ${lt}-${ut} of ${$}${it||z||B||V?` (${G.length} total)`:``}`:`No tests found`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>X.previousPage(),disabled:!X.getCanPreviousPage(),children:`Previous`}),(0,k.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>X.nextPage(),disabled:!X.getCanNextPage(),children:`Next`})]})]}),(0,k.jsx)(f,{selectedCount:q.selectedCount,summaryMeta:Q>0?`${Q} hidden by filters`:void 0,secondaryIcon:(0,k.jsx)(ie,{className:`size-4`}),secondaryAriaLabel:`Clear queue`,onDelete:rt,actionSlot:(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(De,{selectedCount:q.selectedCount,hiddenCount:Q,useCache:A,useMemory:I,browserStackAvailable:!Ve&&Be,open:Me,onOpenChange:O,onUseCacheChange:j,onUseMemoryChange:ze,onRunLocal:()=>tt(!0),onRunBrowserStack:()=>tt(!1),disabled:E}),(0,k.jsx)(v,{variant:`outline`,size:`sm`,onClick:nt,disabled:E,children:`Purge cache`})]}),onCancel:et,isRunning:E})]})})}export{I as default};
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-CN-uHgX9.js";import{i as n,n as r,o as i,s as a,t as o}from"./select-CeVjgiKI.js";import{n as s}from"./split-button-DcY8ames.js";import{n as c,r as l}from"./shortcut-hints-Bs5o743i.js";import{t as u}from"./plus-pXO98OAE.js";import{t as d}from"./use-page-title-B1t9-5_U.js";import{t as f}from"./batch-action-bar-uEhHVDds.js";import{n as p,t as m}from"./scroll-area-CnATfQoe.js";import{$n as h,At as g,Gt as _,Hn as ee,Ht as te,Mt as ne,N as re,Nn as ie,Nt as ae,Pt as oe,Qn as se,St as ce,Ut as v,Wt as y,a as le,cr as ue,dt as de,gt as fe,jt as pe,nt as me,pr as b,sr as he,ur as x}from"./index-Bvtm2F6f.js";import{t as S}from"./badge-DrW2vGVJ.js";import{a as ge,n as _e,o as ve,r as ye,t as C}from"./lib-58FyJI_k.js";import{a as be,i as xe,n as Se,o as w,r as Ce,t as we}from"./table-D08QBBt4.js";import{t as Te}from"./empty-state-BTvOA5lp.js";import{t as Ee}from"./use-keyboard-shortcuts-EAppuiKO.js";import{n as De,t as Oe}from"./use-selection-queue-BboTDies.js";import{n as ke,r as Ae,t as je}from"./tests-suites-table-widths-DNWnkAjA.js";var T=e(b(),1),E=new Set([`asc`,`desc`]),D=50;function Me(e){if(!e)return 1;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>1?t:1}function O(e){let t=new URLSearchParams;return e.search&&t.set(`search`,e.search),e.status&&t.set(`status`,e.status),e.platform&&t.set(`platform`,e.platform),e.target&&t.set(`target`,e.target),e.sort&&(t.set(`sort`,e.sort),t.set(`order`,e.order)),e.page>1&&t.set(`page`,String(e.page)),t}function Ne(){let[e,t]=x(),n=e.get(`search`)??``,r=e.get(`status`)??``,i=e.get(`platform`)??``,a=e.get(`target`)??``,o=e.get(`sort`)??``,s=e.get(`order`)??`desc`,c=E.has(s)?s:`desc`,l=Me(e.get(`page`)),u=(0,T.useMemo)(()=>o?[{id:o,desc:c===`desc`}]:[],[o,c]),d=(0,T.useRef)(u);d.current=u;let f=(0,T.useMemo)(()=>({search:n,status:r,platform:i,target:a,sort:o,order:c,page:l}),[n,r,i,a,o,c,l]);(0,T.useEffect)(()=>{let n=O(f);e.toString()!==n.toString()&&t(n,{replace:!0})},[e,t,f]);let p=(0,T.useCallback)((e,n)=>{let r={...f,...e};n?.resetPage&&(r.page=1),t(O(r),{replace:!0})},[t,f]),m=(0,T.useCallback)(e=>{let t=typeof e==`function`?e(d.current):e;t.length>0?p({sort:t[0].id,order:t[0].desc?`desc`:`asc`}):p({sort:``,order:`desc`})},[p]),h=(0,T.useMemo)(()=>({pageIndex:l-1,pageSize:D}),[l]);return{search:n,status:r,platform:i,target:a,sort:o,order:c,page:l,sorting:u,pagination:h,onSortingChange:m,onPaginationChange:(0,T.useCallback)(e=>{p({page:(typeof e==`function`?e(h):e).pageIndex+1})},[h,p]),setSearch:(0,T.useCallback)(e=>p({search:e},{resetPage:!0}),[p]),setStatus:(0,T.useCallback)(e=>p({status:e},{resetPage:!0}),[p]),setPlatform:(0,T.useCallback)(e=>p({platform:e},{resetPage:!0}),[p]),setTarget:(0,T.useCallback)(e=>p({target:e},{resetPage:!0}),[p]),setPage:(0,T.useCallback)(e=>p({page:e}),[p])}}var k=se();function A({status:e}){switch(e){case`passed`:return(0,k.jsx)(S,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,k.jsx)(S,{variant:`destructive`,children:`Failed`});case`healed`:return(0,k.jsx)(S,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,k.jsx)(S,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,k.jsx)(S,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,k.jsx)(S,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,k.jsx)(S,{variant:`outline`,children:e})}}var Pe=new Set([`passed`,`healed`]),Fe=new Set([`passed`,`healed`,`failed`,`flaky`,`cancelled`]);function j(e){return e?e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1):`—`}function M(e){return e.replace(/\\/g,`/`)}function N(e){let t=M(e).split(`/`).filter(Boolean);return t.length>1?t.slice(1).join(`/`):t[0]??e}function P(e){return e.createdAt||e.startedAt||e.endedAt||``}function Ie(e){return y(`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 Le(e){return y(`py-2 align-top`,e===`select`&&`px-2`,e===`name`&&`max-w-0 px-3`,(e===`target`||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 Re({isActive:e,isBatchSelected:t}){return y(`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`)}var F=[{accessorKey:`name`,header:({column:e})=>(0,k.jsxs)(v,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Test Name`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsxs)(`div`,{className:`min-w-0 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:N(e.original.path)})]}),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)(v,{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)(v,{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-sm text-muted-foreground`,children:j(e.getValue(`platform`))})},{accessorKey:`passRate`,header:({column:e})=>(0,k.jsxs)(v,{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)(v,{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)(he,{to:h.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)(A,{status:e.original.lastRun.status}),(0,k.jsx)(`span`,{className:`whitespace-normal break-words text-xs leading-snug text-muted-foreground`,children:_(P(e.original.lastRun))})]}):(0,k.jsx)(`span`,{className:`block text-sm text-muted-foreground`,children:`No runs`}),sortingFn:(e,t)=>{let n=P(e.original.lastRun??{createdAt:``,startedAt:null,endedAt:null}),r=P(t.original.lastRun??{createdAt:``,startedAt:null,endedAt:null});return n.localeCompare(r)}}];function I(){d(`Tests`);let[e,t]=(0,T.useState)([]),[_,se]=(0,T.useState)([]),[b,he]=(0,T.useState)([]),[x,S]=(0,T.useState)(!0),[E,D]=(0,T.useState)(!1),[Me,O]=(0,T.useState)(!1),[A,j]=(0,T.useState)(!0),[I,ze]=(0,T.useState)(!0),L=ue(),{hasFarm:Be,isLoading:Ve}=s();(0,T.useEffect)(()=>{let e=!1;return Promise.all([de(),me({limit:200})]).then(([n,r])=>{e||(t(n.files),he(n.targets??[]),se(r.runs))}).catch(()=>{e||g.error(`Failed to load test files`)}).finally(()=>{e||S(!1)}),()=>{e=!0}},[]);let{search:R,status:z,platform:B,target:V,page:He,sorting:Ue,pagination:H,onSortingChange:We,onPaginationChange:Ge,setSearch:Ke,setStatus:qe,setPlatform:Je,setTarget:Ye,setPage:Xe}=Ne(),[U,W]=(0,T.useState)(-1),Ze=(0,T.useRef)([]),G=(0,T.useMemo)(()=>{let t=new Map,n=new Map,r=(e,t,n)=>{if(!t)return;let r=e.get(t);r?r.push(n):e.set(t,[n])};for(let e of _){if(!e.filePath)continue;let i=M(e.filePath);r(t,i,e),r(n,N(i),e)}return e.map(e=>{let r=M(e.path),i=[...t.get(r)??n.get(N(r))??[]].sort((e,t)=>P(t).localeCompare(P(e))),a=i.filter(e=>Fe.has(e.status)),o=a.filter(e=>Pe.has(e.status)).length,s=a.length>0?Math.round(o/a.length*100):null,c=i[0]??null;return{path:e.path,name:e.name,testId:e.testId,targetName:e.targetName,platform:e.platform,lastRunStatus:c?.status??null,lastRun:c,passRate:s,passCount:o,completedRunCount:a.length}})},[e,_]),K=(0,T.useMemo)(()=>{let e=G;if(R){let t=R.toLowerCase();e=e.filter(e=>{let n=e.targetName?.toLowerCase()??``;return e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)||n.includes(t)})}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)),V&&(e=e.filter(e=>e.targetName===V)),e},[G,R,z,B,V]),q=Oe({items:G,getId:e=>e.path,visibleIds:K.map(e=>e.path)}),Qe=(0,T.useMemo)(()=>Array.from(new Set([V,...b,...G.map(e=>e.targetName??``)].filter(e=>!!e))),[G,V,b]),$e={id:`select`,header:({table:e})=>(0,k.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,k.jsx)(Ae,{checked:q.getVisibleSelectionState(e.getRowModel().rows.map(e=>e.original.path)),onCheckedChange:t=>q.setItemsSelected(e.getRowModel().rows.map(e=>e.original),t),ariaLabel:`Select all`})}),cell:({row:e})=>(0,k.jsx)(Ae,{checked:q.isSelected(e.original.path),onCheckedChange:t=>q.setItemSelected(e.original,t)}),enableSorting:!1,size:48},J=q.selectedIds,Y=q.selectedItems,et=(0,T.useCallback)(()=>{q.clearSelection(),O(!1),j(!0),ze(!0)},[q]),tt=(0,T.useCallback)(async e=>{if(J.length!==0){D(!0);try{let t=await Promise.allSettled(J.map(t=>ce({file:t,local:e,noCache:!A,noMemory:!I}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;r>0?g.error(`${n} runs queued, ${r} failed`):g.success(`${n} runs queued`),O(!1)}finally{D(!1)}}},[J,A,I]),nt=(0,T.useCallback)(async()=>{if(J.length!==0){D(!0);try{let e=await Promise.allSettled(J.map(e=>fe({file:e}))),t=e.filter(e=>e.status===`fulfilled`).length,n=e.filter(e=>e.status===`fulfilled`).reduce((e,t)=>e+t.value.purged,0),r=e.length-t;r>0?g.error(`Purged ${n} plans from ${t} tests, ${r} failed`):g.success(`Purged ${n} cached plan${n===1?``:`s`}`)}finally{D(!1)}}},[J]),rt=(0,T.useCallback)(async()=>{if(Y.length!==0){D(!0);try{let e=await Promise.allSettled(Y.map(e=>e.testId?re(e.testId):Promise.reject(Error(`Missing test id for ${e.path}`)))),n=Y.filter((t,n)=>e[n]?.status===`fulfilled`),r=new Set(n.map(e=>e.path)),i=e.length-n.length;n.length>0&&(q.setItemsSelected(n,!1),t(e=>e.filter(e=>!r.has(e.path))),O(!1)),i>0?g.error(`Deleted ${n.length} test${n.length===1?``:`s`}, ${i} failed`):g.success(`Deleted ${n.length} test${n.length===1?``:`s`}`)}finally{D(!1)}}},[Y,q]),X=_e({data:K,columns:[$e,...F],getCoreRowModel:ye(),getSortedRowModel:ve(),getPaginationRowModel:ge(),onSortingChange:We,onPaginationChange:Ge,getRowId:e=>e.path,state:{sorting:Ue,pagination:H}}),Z=X.getRowModel().rows,Q=q.hiddenCount,it=R;(0,T.useEffect)(()=>{if(x)return;let e=Math.max(1,Math.ceil(K.length/H.pageSize));He>e&&Xe(e)},[K.length,x,He,H.pageSize,Xe]);let at=(0,T.useCallback)(e=>{Ke(e),W(-1)},[Ke]);Ee((0,T.useMemo)(()=>{let e=()=>W(e=>Math.min(e+1,Z.length-1)),t=()=>W(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{if(U>=0&&Z[U]){let t=Z[U].original,n=h.testView(t.testId??t.path);e.metaKey||e.ctrlKey?window.open(n,`_blank`):L(n)}}}},[Z,U,L])),(0,T.useEffect)(()=>{if(U<0)return;let e=Ze.current[U];e&&document.activeElement!==e&&e.focus()},[U,Z.length]);let ot=(0,T.useCallback)((e,t)=>{t&&t.preventDefault(),L(h.testView(e.testId??e.path))},[L]);if(x)return(0,k.jsx)(le,{});if(e.length===0)return(0,k.jsx)(Te,{icon:ee,title:`No tests found`,description:`Create your first test file to get started`,actionLabel:`Create Test`,onAction:()=>L(h.testNew)});let $=K.length,st=H.pageIndex,ct=H.pageSize,lt=st*ct+1,ut=Math.min(lt+ct-1,$);return(0,k.jsx)(ae,{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:`Tests`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(pe,{children:[(0,k.jsx)(oe,{asChild:!0,children:(0,k.jsx)(v,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,k.jsx)(l,{className:`h-4 w-4`})})}),(0,k.jsx)(ne,{side:`bottom`,className:`p-3`,children:(0,k.jsx)(c,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open test`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]}),(0,k.jsxs)(v,{size:`sm`,onClick:()=>L(h.testNew),children:[(0,k.jsx)(u,{className:`size-4`}),`New Test`]})]})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,k.jsx)(te,{placeholder:`Search tests...`,value:it,onChange:e=>at(e.target.value),className:`max-w-[220px]`}),(0,k.jsxs)(o,{value:z||`all`,onValueChange:e=>{qe(e===`all`?``:e),W(-1)},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=>{Je(e===`all`?``:e),W(-1)},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)(o,{value:V||`all`,onValueChange:e=>{Ye(e===`all`?``:e),W(-1)},children:[(0,k.jsx)(i,{className:`w-[180px]`,children:(0,k.jsx)(a,{placeholder:`All targets`})}),(0,k.jsxs)(r,{children:[(0,k.jsx)(n,{value:`all`,children:`All targets`}),Qe.map(e=>(0,k.jsx)(n,{value:e,children:e},e))]})]})]}),(0,k.jsxs)(m,{className:`rounded-md border`,children:[(0,k.jsxs)(we,{className:`min-w-full table-fixed`,children:[(0,k.jsx)(`colgroup`,{children:je.map(e=>{let t=ke(e);return(0,k.jsx)(`col`,{"data-column-id":e,style:t?{width:t}:void 0},e)})}),(0,k.jsx)(be,{children:X.getHeaderGroups().map(e=>(0,k.jsx)(w,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,k.jsx)(xe,{className:Ie(e.column.id),children:e.isPlaceholder?null:C(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,k.jsx)(Se,{children:Z.length?Z.map((e,t)=>{let n=t===U,r=q.isSelected(e.original.path);return(0,k.jsx)(w,{ref:e=>{Ze.current[t]=e},"data-runs-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:Re({isActive:n,isBatchSelected:r}),onClick:()=>ot(e.original),onFocus:()=>W(t),onKeyDown:t=>{t.key===`Enter`&&ot(e.original,t)},children:e.getVisibleCells().map(e=>{let t=e.column.id===`select`;return(0,k.jsx)(Ce,{className:y(Le(e.column.id),t&&`relative z-10`),children:C(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)}):(0,k.jsx)(w,{children:(0,k.jsx)(Ce,{colSpan:F.length+1,className:`h-24 text-center`,children:`No tests match the current search or filters.`})})})]}),(0,k.jsx)(p,{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:$>0?`Showing ${lt}-${ut} of ${$}${it||z||B||V?` (${G.length} total)`:``}`:`No tests found`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>X.previousPage(),disabled:!X.getCanPreviousPage(),children:`Previous`}),(0,k.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>X.nextPage(),disabled:!X.getCanNextPage(),children:`Next`})]})]}),(0,k.jsx)(f,{selectedCount:q.selectedCount,summaryMeta:Q>0?`${Q} hidden by filters`:void 0,secondaryIcon:(0,k.jsx)(ie,{className:`size-4`}),secondaryAriaLabel:`Clear queue`,onDelete:rt,actionSlot:(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(De,{selectedCount:q.selectedCount,hiddenCount:Q,useCache:A,useMemory:I,browserStackAvailable:!Ve&&Be,open:Me,onOpenChange:O,onUseCacheChange:j,onUseMemoryChange:ze,onRunLocal:()=>tt(!0),onRunBrowserStack:()=>tt(!1),disabled:E}),(0,k.jsx)(v,{variant:`outline`,size:`sm`,onClick:nt,disabled:E,children:`Purge cache`})]}),onCancel:et,isRunning:E})]})})}export{I as default};
@@ -1 +1 @@
1
- import{n as e}from"./batch-action-bar-BlKdJC25.js";import{Qn as t}from"./index-CZotRLCc.js";var n=t();function r({checked:t,onCheckedChange:r,ariaLabel:i}){function a(e){e.stopPropagation(),!(e.target instanceof Element&&e.target.closest(`[data-slot="checkbox"]`))&&r(t!==!0)}function o(e){e.stopPropagation()}return(0,n.jsx)(`div`,{"data-selection-checkbox-hit-area":!0,className:`relative z-10 flex min-h-8 min-w-8 items-center justify-center -my-1 -mx-2 px-2 py-1`,onPointerDown:e=>e.stopPropagation(),onFocus:o,onClick:a,children:(0,n.jsx)(e,{checked:t,onCheckedChange:e=>r(e===!0),onClick:e=>e.stopPropagation(),"aria-label":i??`Select row`})})}var i=[`select`,`name`,`target`,`platform`,`passRate`,`lastRun`],a={select:`2.75rem`,target:`10rem`,platform:`6.25rem`,passRate:`7.25rem`,lastRun:`9rem`};function o(e){return a[e]}export{o as n,r,i as t};
1
+ import{n as e}from"./batch-action-bar-uEhHVDds.js";import{Qn as t}from"./index-Bvtm2F6f.js";var n=t();function r({checked:t,onCheckedChange:r,ariaLabel:i}){function a(e){e.stopPropagation(),!(e.target instanceof Element&&e.target.closest(`[data-slot="checkbox"]`))&&r(t!==!0)}function o(e){e.stopPropagation()}return(0,n.jsx)(`div`,{"data-selection-checkbox-hit-area":!0,className:`relative z-10 flex min-h-8 min-w-8 items-center justify-center -my-1 -mx-2 px-2 py-1`,onPointerDown:e=>e.stopPropagation(),onFocus:o,onClick:a,children:(0,n.jsx)(e,{checked:t,onCheckedChange:e=>r(e===!0),onClick:e=>e.stopPropagation(),"aria-label":i??`Select row`})})}var i=[`select`,`name`,`target`,`platform`,`passRate`,`lastRun`],a={select:`2.75rem`,target:`10rem`,platform:`6.25rem`,passRate:`7.25rem`,lastRun:`9rem`};function o(e){return a[e]}export{o as n,r,i as t};
@@ -1 +1 @@
1
- import"./chunk-CilyBKbf.js";import{Jn as e,Qn as t,Wt as n,pr as r}from"./index-CZotRLCc.js";var i=e(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);r();var a=t();function o({className:e,...t}){return(0,a.jsx)(`textarea`,{"data-slot":`textarea`,className:n(`flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground 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 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40`,e),...t})}export{i as n,o as t};
1
+ import"./chunk-CilyBKbf.js";import{Jn as e,Qn as t,Wt as n,pr as r}from"./index-Bvtm2F6f.js";var i=e(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);r();var a=t();function o({className:e,...t}){return(0,a.jsx)(`textarea`,{"data-slot":`textarea`,className:n(`flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground 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 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40`,e),...t})}export{i as n,o as t};
@@ -1 +1 @@
1
- import{Jn as e}from"./index-CZotRLCc.js";var t=e(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);export{t};
1
+ import{Jn as e}from"./index-Bvtm2F6f.js";var t=e(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);export{t};
@@ -1,4 +1,4 @@
1
- import{a as e,c as t,i as n,o as r,s as i,u as a}from"./editor.api2-DEGvZ9jW.js";import{t as o}from"./workers-BbHjH3Kx.js";import{n as s}from"./monaco.contribution-ZpEX2Im1.js";var c=class{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;let e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||=(async()=>(this._worker=o({moduleId:`vs/language/typescript/tsWorker`,createWorker:()=>new Worker(new URL(`/assets/ts.worker-METxwbDZ.js`,``+import.meta.url),{type:`module`}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(t.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))(),this._client}async getLanguageServiceWorker(...e){let t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}},l={};l[`lib.d.ts`]=!0,l[`lib.decorators.d.ts`]=!0,l[`lib.decorators.legacy.d.ts`]=!0,l[`lib.dom.asynciterable.d.ts`]=!0,l[`lib.dom.d.ts`]=!0,l[`lib.dom.iterable.d.ts`]=!0,l[`lib.es2015.collection.d.ts`]=!0,l[`lib.es2015.core.d.ts`]=!0,l[`lib.es2015.d.ts`]=!0,l[`lib.es2015.generator.d.ts`]=!0,l[`lib.es2015.iterable.d.ts`]=!0,l[`lib.es2015.promise.d.ts`]=!0,l[`lib.es2015.proxy.d.ts`]=!0,l[`lib.es2015.reflect.d.ts`]=!0,l[`lib.es2015.symbol.d.ts`]=!0,l[`lib.es2015.symbol.wellknown.d.ts`]=!0,l[`lib.es2016.array.include.d.ts`]=!0,l[`lib.es2016.d.ts`]=!0,l[`lib.es2016.full.d.ts`]=!0,l[`lib.es2016.intl.d.ts`]=!0,l[`lib.es2017.arraybuffer.d.ts`]=!0,l[`lib.es2017.d.ts`]=!0,l[`lib.es2017.date.d.ts`]=!0,l[`lib.es2017.full.d.ts`]=!0,l[`lib.es2017.intl.d.ts`]=!0,l[`lib.es2017.object.d.ts`]=!0,l[`lib.es2017.sharedmemory.d.ts`]=!0,l[`lib.es2017.string.d.ts`]=!0,l[`lib.es2017.typedarrays.d.ts`]=!0,l[`lib.es2018.asyncgenerator.d.ts`]=!0,l[`lib.es2018.asynciterable.d.ts`]=!0,l[`lib.es2018.d.ts`]=!0,l[`lib.es2018.full.d.ts`]=!0,l[`lib.es2018.intl.d.ts`]=!0,l[`lib.es2018.promise.d.ts`]=!0,l[`lib.es2018.regexp.d.ts`]=!0,l[`lib.es2019.array.d.ts`]=!0,l[`lib.es2019.d.ts`]=!0,l[`lib.es2019.full.d.ts`]=!0,l[`lib.es2019.intl.d.ts`]=!0,l[`lib.es2019.object.d.ts`]=!0,l[`lib.es2019.string.d.ts`]=!0,l[`lib.es2019.symbol.d.ts`]=!0,l[`lib.es2020.bigint.d.ts`]=!0,l[`lib.es2020.d.ts`]=!0,l[`lib.es2020.date.d.ts`]=!0,l[`lib.es2020.full.d.ts`]=!0,l[`lib.es2020.intl.d.ts`]=!0,l[`lib.es2020.number.d.ts`]=!0,l[`lib.es2020.promise.d.ts`]=!0,l[`lib.es2020.sharedmemory.d.ts`]=!0,l[`lib.es2020.string.d.ts`]=!0,l[`lib.es2020.symbol.wellknown.d.ts`]=!0,l[`lib.es2021.d.ts`]=!0,l[`lib.es2021.full.d.ts`]=!0,l[`lib.es2021.intl.d.ts`]=!0,l[`lib.es2021.promise.d.ts`]=!0,l[`lib.es2021.string.d.ts`]=!0,l[`lib.es2021.weakref.d.ts`]=!0,l[`lib.es2022.array.d.ts`]=!0,l[`lib.es2022.d.ts`]=!0,l[`lib.es2022.error.d.ts`]=!0,l[`lib.es2022.full.d.ts`]=!0,l[`lib.es2022.intl.d.ts`]=!0,l[`lib.es2022.object.d.ts`]=!0,l[`lib.es2022.regexp.d.ts`]=!0,l[`lib.es2022.string.d.ts`]=!0,l[`lib.es2023.array.d.ts`]=!0,l[`lib.es2023.collection.d.ts`]=!0,l[`lib.es2023.d.ts`]=!0,l[`lib.es2023.full.d.ts`]=!0,l[`lib.es2023.intl.d.ts`]=!0,l[`lib.es2024.arraybuffer.d.ts`]=!0,l[`lib.es2024.collection.d.ts`]=!0,l[`lib.es2024.d.ts`]=!0,l[`lib.es2024.full.d.ts`]=!0,l[`lib.es2024.object.d.ts`]=!0,l[`lib.es2024.promise.d.ts`]=!0,l[`lib.es2024.regexp.d.ts`]=!0,l[`lib.es2024.sharedmemory.d.ts`]=!0,l[`lib.es2024.string.d.ts`]=!0,l[`lib.es5.d.ts`]=!0,l[`lib.es6.d.ts`]=!0,l[`lib.esnext.array.d.ts`]=!0,l[`lib.esnext.collection.d.ts`]=!0,l[`lib.esnext.d.ts`]=!0,l[`lib.esnext.decorators.d.ts`]=!0,l[`lib.esnext.disposable.d.ts`]=!0,l[`lib.esnext.error.d.ts`]=!0,l[`lib.esnext.float16.d.ts`]=!0,l[`lib.esnext.full.d.ts`]=!0,l[`lib.esnext.intl.d.ts`]=!0,l[`lib.esnext.iterator.d.ts`]=!0,l[`lib.esnext.promise.d.ts`]=!0,l[`lib.esnext.sharedmemory.d.ts`]=!0,l[`lib.scripthost.d.ts`]=!0,l[`lib.webworker.asynciterable.d.ts`]=!0,l[`lib.webworker.d.ts`]=!0,l[`lib.webworker.importscripts.d.ts`]=!0,l[`lib.webworker.iterable.d.ts`]=!0;function u(e,t,n=0){if(typeof e==`string`)return e;if(e===void 0)return``;let r=``;if(n){r+=t;for(let e=0;e<n;e++)r+=` `}if(r+=e.messageText,n++,e.next)for(let i of e.next)r+=u(i,t,n);return r}function d(e){return e?e.map(e=>e.text).join(``):``}var f=class{constructor(e){this._worker=e}_textSpanToRange(e,t){let n=e.getPositionAt(t.start),r=e.getPositionAt(t.start+t.length),{lineNumber:i,column:a}=n,{lineNumber:o,column:s}=r;return{startLineNumber:i,startColumn:a,endLineNumber:o,endColumn:s}}},p=class{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e&&e.path.indexOf(`/lib.`)===0?!!l[e.path.slice(1)]:!1}getOrCreateModel(e){let n=i.parse(e),r=t.getModel(n);if(r)return r;if(this.isLibFile(n)&&this._hasFetchedLibFiles)return t.createModel(this._libFiles[n.path.slice(1)],`typescript`,n);let a=s.getExtraLibs()[e];return a?t.createModel(a.content,`typescript`,n):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e}),this._fetchLibFilesPromise}},m=class extends f{constructor(e,n,r,i){super(i),this._libFiles=e,this._defaults=n,this._selector=r,this._disposables=[],this._listener=Object.create(null);let a=e=>{if(e.getLanguageId()!==r)return;let n=()=>{let{onlyVisible:t}=this._defaults.getDiagnosticsOptions();t?e.isAttachedToEditor()&&this._doValidate(e):this._doValidate(e)},i,a=e.onDidChangeContent(()=>{clearTimeout(i),i=window.setTimeout(n,500)}),o=e.onDidChangeAttached(()=>{let{onlyVisible:r}=this._defaults.getDiagnosticsOptions();r&&(e.isAttachedToEditor()?n():t.setModelMarkers(e,this._selector,[]))});this._listener[e.uri.toString()]={dispose(){a.dispose(),o.dispose(),clearTimeout(i)}},n()},o=e=>{t.setModelMarkers(e,this._selector,[]);let n=e.uri.toString();this._listener[n]&&(this._listener[n].dispose(),delete this._listener[n])};this._disposables.push(t.onDidCreateModel(e=>a(e))),this._disposables.push(t.onWillDisposeModel(o)),this._disposables.push(t.onDidChangeModelLanguage(e=>{o(e.model),a(e.model)})),this._disposables.push({dispose(){for(let e of t.getModels())o(e)}});let s=()=>{for(let e of t.getModels())o(e),a(e)};this._disposables.push(this._defaults.onDidChange(s)),this._disposables.push(this._defaults.onDidExtraLibsChange(s)),t.getModels().forEach(e=>a(e))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){let n=await this._worker(e.uri);if(e.isDisposed())return;let r=[],{noSyntaxValidation:a,noSemanticValidation:o,noSuggestionDiagnostics:s}=this._defaults.getDiagnosticsOptions();a||r.push(n.getSyntacticDiagnostics(e.uri.toString())),o||r.push(n.getSemanticDiagnostics(e.uri.toString())),s||r.push(n.getSuggestionDiagnostics(e.uri.toString()));let c=await Promise.all(r);if(!c||e.isDisposed())return;let l=c.reduce((e,t)=>t.concat(e),[]).filter(e=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(e.code)===-1),u=l.map(e=>e.relatedInformation||[]).reduce((e,t)=>t.concat(e),[]).map(e=>e.file?i.parse(e.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(u),!e.isDisposed()&&t.setModelMarkers(e,this._selector,l.map(t=>this._convertDiagnostics(e,t)))}_convertDiagnostics(t,n){let r=n.start||0,i=n.length||1,{lineNumber:a,column:o}=t.getPositionAt(r),{lineNumber:s,column:c}=t.getPositionAt(r+i),l=[];return n.reportsUnnecessary&&l.push(e.Unnecessary),n.reportsDeprecated&&l.push(e.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(n.category),startLineNumber:a,startColumn:o,endLineNumber:s,endColumn:c,message:u(n.messageText,`
1
+ import{a as e,c as t,i as n,o as r,s as i,u as a}from"./editor.api2-DEGvZ9jW.js";import{t as o}from"./workers-BbHjH3Kx.js";import{n as s}from"./monaco.contribution-LYJB_lCm.js";var c=class{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;let e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||=(async()=>(this._worker=o({moduleId:`vs/language/typescript/tsWorker`,createWorker:()=>new Worker(new URL(`/assets/ts.worker-METxwbDZ.js`,``+import.meta.url),{type:`module`}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(t.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))(),this._client}async getLanguageServiceWorker(...e){let t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}},l={};l[`lib.d.ts`]=!0,l[`lib.decorators.d.ts`]=!0,l[`lib.decorators.legacy.d.ts`]=!0,l[`lib.dom.asynciterable.d.ts`]=!0,l[`lib.dom.d.ts`]=!0,l[`lib.dom.iterable.d.ts`]=!0,l[`lib.es2015.collection.d.ts`]=!0,l[`lib.es2015.core.d.ts`]=!0,l[`lib.es2015.d.ts`]=!0,l[`lib.es2015.generator.d.ts`]=!0,l[`lib.es2015.iterable.d.ts`]=!0,l[`lib.es2015.promise.d.ts`]=!0,l[`lib.es2015.proxy.d.ts`]=!0,l[`lib.es2015.reflect.d.ts`]=!0,l[`lib.es2015.symbol.d.ts`]=!0,l[`lib.es2015.symbol.wellknown.d.ts`]=!0,l[`lib.es2016.array.include.d.ts`]=!0,l[`lib.es2016.d.ts`]=!0,l[`lib.es2016.full.d.ts`]=!0,l[`lib.es2016.intl.d.ts`]=!0,l[`lib.es2017.arraybuffer.d.ts`]=!0,l[`lib.es2017.d.ts`]=!0,l[`lib.es2017.date.d.ts`]=!0,l[`lib.es2017.full.d.ts`]=!0,l[`lib.es2017.intl.d.ts`]=!0,l[`lib.es2017.object.d.ts`]=!0,l[`lib.es2017.sharedmemory.d.ts`]=!0,l[`lib.es2017.string.d.ts`]=!0,l[`lib.es2017.typedarrays.d.ts`]=!0,l[`lib.es2018.asyncgenerator.d.ts`]=!0,l[`lib.es2018.asynciterable.d.ts`]=!0,l[`lib.es2018.d.ts`]=!0,l[`lib.es2018.full.d.ts`]=!0,l[`lib.es2018.intl.d.ts`]=!0,l[`lib.es2018.promise.d.ts`]=!0,l[`lib.es2018.regexp.d.ts`]=!0,l[`lib.es2019.array.d.ts`]=!0,l[`lib.es2019.d.ts`]=!0,l[`lib.es2019.full.d.ts`]=!0,l[`lib.es2019.intl.d.ts`]=!0,l[`lib.es2019.object.d.ts`]=!0,l[`lib.es2019.string.d.ts`]=!0,l[`lib.es2019.symbol.d.ts`]=!0,l[`lib.es2020.bigint.d.ts`]=!0,l[`lib.es2020.d.ts`]=!0,l[`lib.es2020.date.d.ts`]=!0,l[`lib.es2020.full.d.ts`]=!0,l[`lib.es2020.intl.d.ts`]=!0,l[`lib.es2020.number.d.ts`]=!0,l[`lib.es2020.promise.d.ts`]=!0,l[`lib.es2020.sharedmemory.d.ts`]=!0,l[`lib.es2020.string.d.ts`]=!0,l[`lib.es2020.symbol.wellknown.d.ts`]=!0,l[`lib.es2021.d.ts`]=!0,l[`lib.es2021.full.d.ts`]=!0,l[`lib.es2021.intl.d.ts`]=!0,l[`lib.es2021.promise.d.ts`]=!0,l[`lib.es2021.string.d.ts`]=!0,l[`lib.es2021.weakref.d.ts`]=!0,l[`lib.es2022.array.d.ts`]=!0,l[`lib.es2022.d.ts`]=!0,l[`lib.es2022.error.d.ts`]=!0,l[`lib.es2022.full.d.ts`]=!0,l[`lib.es2022.intl.d.ts`]=!0,l[`lib.es2022.object.d.ts`]=!0,l[`lib.es2022.regexp.d.ts`]=!0,l[`lib.es2022.string.d.ts`]=!0,l[`lib.es2023.array.d.ts`]=!0,l[`lib.es2023.collection.d.ts`]=!0,l[`lib.es2023.d.ts`]=!0,l[`lib.es2023.full.d.ts`]=!0,l[`lib.es2023.intl.d.ts`]=!0,l[`lib.es2024.arraybuffer.d.ts`]=!0,l[`lib.es2024.collection.d.ts`]=!0,l[`lib.es2024.d.ts`]=!0,l[`lib.es2024.full.d.ts`]=!0,l[`lib.es2024.object.d.ts`]=!0,l[`lib.es2024.promise.d.ts`]=!0,l[`lib.es2024.regexp.d.ts`]=!0,l[`lib.es2024.sharedmemory.d.ts`]=!0,l[`lib.es2024.string.d.ts`]=!0,l[`lib.es5.d.ts`]=!0,l[`lib.es6.d.ts`]=!0,l[`lib.esnext.array.d.ts`]=!0,l[`lib.esnext.collection.d.ts`]=!0,l[`lib.esnext.d.ts`]=!0,l[`lib.esnext.decorators.d.ts`]=!0,l[`lib.esnext.disposable.d.ts`]=!0,l[`lib.esnext.error.d.ts`]=!0,l[`lib.esnext.float16.d.ts`]=!0,l[`lib.esnext.full.d.ts`]=!0,l[`lib.esnext.intl.d.ts`]=!0,l[`lib.esnext.iterator.d.ts`]=!0,l[`lib.esnext.promise.d.ts`]=!0,l[`lib.esnext.sharedmemory.d.ts`]=!0,l[`lib.scripthost.d.ts`]=!0,l[`lib.webworker.asynciterable.d.ts`]=!0,l[`lib.webworker.d.ts`]=!0,l[`lib.webworker.importscripts.d.ts`]=!0,l[`lib.webworker.iterable.d.ts`]=!0;function u(e,t,n=0){if(typeof e==`string`)return e;if(e===void 0)return``;let r=``;if(n){r+=t;for(let e=0;e<n;e++)r+=` `}if(r+=e.messageText,n++,e.next)for(let i of e.next)r+=u(i,t,n);return r}function d(e){return e?e.map(e=>e.text).join(``):``}var f=class{constructor(e){this._worker=e}_textSpanToRange(e,t){let n=e.getPositionAt(t.start),r=e.getPositionAt(t.start+t.length),{lineNumber:i,column:a}=n,{lineNumber:o,column:s}=r;return{startLineNumber:i,startColumn:a,endLineNumber:o,endColumn:s}}},p=class{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e&&e.path.indexOf(`/lib.`)===0?!!l[e.path.slice(1)]:!1}getOrCreateModel(e){let n=i.parse(e),r=t.getModel(n);if(r)return r;if(this.isLibFile(n)&&this._hasFetchedLibFiles)return t.createModel(this._libFiles[n.path.slice(1)],`typescript`,n);let a=s.getExtraLibs()[e];return a?t.createModel(a.content,`typescript`,n):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e}),this._fetchLibFilesPromise}},m=class extends f{constructor(e,n,r,i){super(i),this._libFiles=e,this._defaults=n,this._selector=r,this._disposables=[],this._listener=Object.create(null);let a=e=>{if(e.getLanguageId()!==r)return;let n=()=>{let{onlyVisible:t}=this._defaults.getDiagnosticsOptions();t?e.isAttachedToEditor()&&this._doValidate(e):this._doValidate(e)},i,a=e.onDidChangeContent(()=>{clearTimeout(i),i=window.setTimeout(n,500)}),o=e.onDidChangeAttached(()=>{let{onlyVisible:r}=this._defaults.getDiagnosticsOptions();r&&(e.isAttachedToEditor()?n():t.setModelMarkers(e,this._selector,[]))});this._listener[e.uri.toString()]={dispose(){a.dispose(),o.dispose(),clearTimeout(i)}},n()},o=e=>{t.setModelMarkers(e,this._selector,[]);let n=e.uri.toString();this._listener[n]&&(this._listener[n].dispose(),delete this._listener[n])};this._disposables.push(t.onDidCreateModel(e=>a(e))),this._disposables.push(t.onWillDisposeModel(o)),this._disposables.push(t.onDidChangeModelLanguage(e=>{o(e.model),a(e.model)})),this._disposables.push({dispose(){for(let e of t.getModels())o(e)}});let s=()=>{for(let e of t.getModels())o(e),a(e)};this._disposables.push(this._defaults.onDidChange(s)),this._disposables.push(this._defaults.onDidExtraLibsChange(s)),t.getModels().forEach(e=>a(e))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){let n=await this._worker(e.uri);if(e.isDisposed())return;let r=[],{noSyntaxValidation:a,noSemanticValidation:o,noSuggestionDiagnostics:s}=this._defaults.getDiagnosticsOptions();a||r.push(n.getSyntacticDiagnostics(e.uri.toString())),o||r.push(n.getSemanticDiagnostics(e.uri.toString())),s||r.push(n.getSuggestionDiagnostics(e.uri.toString()));let c=await Promise.all(r);if(!c||e.isDisposed())return;let l=c.reduce((e,t)=>t.concat(e),[]).filter(e=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(e.code)===-1),u=l.map(e=>e.relatedInformation||[]).reduce((e,t)=>t.concat(e),[]).map(e=>e.file?i.parse(e.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(u),!e.isDisposed()&&t.setModelMarkers(e,this._selector,l.map(t=>this._convertDiagnostics(e,t)))}_convertDiagnostics(t,n){let r=n.start||0,i=n.length||1,{lineNumber:a,column:o}=t.getPositionAt(r),{lineNumber:s,column:c}=t.getPositionAt(r+i),l=[];return n.reportsUnnecessary&&l.push(e.Unnecessary),n.reportsDeprecated&&l.push(e.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(n.category),startLineNumber:a,startColumn:o,endLineNumber:s,endColumn:c,message:u(n.messageText,`
2
2
  `),code:n.code.toString(),tags:l,relatedInformation:this._convertRelatedInformation(t,n.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];let n=[];return t.forEach(t=>{let r=e;if(t.file&&(r=this._libFiles.getOrCreateModel(t.file.fileName)),!r)return;let i=t.start||0,a=t.length||1,{lineNumber:o,column:s}=r.getPositionAt(i),{lineNumber:c,column:l}=r.getPositionAt(i+a);n.push({resource:r.uri,startLineNumber:o,startColumn:s,endLineNumber:c,endColumn:l,message:u(t.messageText,`
3
3
  `)})}),n}_tsDiagnosticCategoryToMarkerSeverity(e){switch(e){case 1:return n.Error;case 3:return n.Info;case 0:return n.Warning;case 2:return n.Hint}return n.Info}},h=class e extends f{get triggerCharacters(){return[`.`]}async provideCompletionItems(t,n,i,o){let s=t.getWordUntilPosition(n),c=new r(n.lineNumber,s.startColumn,n.lineNumber,s.endColumn),l=t.uri,u=t.getOffsetAt(n),d=await this._worker(l);if(t.isDisposed())return;let f=await d.getCompletionsAtPosition(l.toString(),u);if(!(!f||t.isDisposed()))return{suggestions:f.entries.map(i=>{let o=c;if(i.replacementSpan){let e=t.getPositionAt(i.replacementSpan.start),n=t.getPositionAt(i.replacementSpan.start+i.replacementSpan.length);o=new r(e.lineNumber,e.column,n.lineNumber,n.column)}let s=[];return i.kindModifiers!==void 0&&i.kindModifiers.indexOf(`deprecated`)!==-1&&s.push(a.CompletionItemTag.Deprecated),{uri:l,position:n,offset:u,range:o,label:i.name,insertText:i.name,sortText:i.sortText,kind:e.convertKind(i.kind),tags:s}})}}async resolveCompletionItem(t,n){let r=t,i=r.uri,a=r.position,o=r.offset,s=await(await this._worker(i)).getCompletionEntryDetails(i.toString(),o,r.label);return s?{uri:i,position:a,label:s.name,kind:e.convertKind(s.kind),detail:d(s.displayParts),documentation:{value:e.createDocumentationString(s)}}:r}static convertKind(e){switch(e){case C.primitiveType:case C.keyword:return a.CompletionItemKind.Keyword;case C.variable:case C.localVariable:return a.CompletionItemKind.Variable;case C.memberVariable:case C.memberGetAccessor:case C.memberSetAccessor:return a.CompletionItemKind.Field;case C.function:case C.memberFunction:case C.constructSignature:case C.callSignature:case C.indexSignature:return a.CompletionItemKind.Function;case C.enum:return a.CompletionItemKind.Enum;case C.module:return a.CompletionItemKind.Module;case C.class:return a.CompletionItemKind.Class;case C.interface:return a.CompletionItemKind.Interface;case C.warning:return a.CompletionItemKind.File}return a.CompletionItemKind.Property}static createDocumentationString(e){let t=d(e.documentation);if(e.tags)for(let n of e.tags)t+=`
4
4