@vostride/agent-qa-dashboard-ui 0.1.12 → 0.1.14
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.
- package/dist/assets/{arrow-up-down-CN-uHgX9.js → arrow-up-down-D_ErIdrE.js} +1 -1
- package/dist/assets/{badge-DrW2vGVJ.js → badge-ClWCtaXi.js} +1 -1
- package/dist/assets/{batch-action-bar-uEhHVDds.js → batch-action-bar-BoqzHfwU.js} +1 -1
- package/dist/assets/{circle-alert-BKX0IIz1.js → circle-alert-D7wbtVU2.js} +1 -1
- package/dist/assets/{circle-x-yPIxYoz1.js → circle-x-BOV-jCVR.js} +1 -1
- package/dist/assets/config-BH2rUSDL.js +10 -0
- package/dist/assets/{copy-Clw3wvSn.js → copy-DW4nc-pA.js} +1 -1
- package/dist/assets/{display-step-NqsJgW_B.js → display-step-vpHdm2LX.js} +1 -1
- package/dist/assets/{dist-BPheZrD6.js → dist-BABsMbMt.js} +1 -1
- package/dist/assets/dist-Bc4r79ls.js +1 -0
- package/dist/assets/{dist-m_OM4Je_.js → dist-BsGrTrYb.js} +1 -1
- package/dist/assets/{empty-state-BTvOA5lp.js → empty-state-BTFWlITi.js} +1 -1
- package/dist/assets/{external-link-C_uggQOc.js → external-link-CnabSkqe.js} +1 -1
- package/dist/assets/{eye-CZrufbYE.js → eye-Cj7s1eMQ.js} +1 -1
- package/dist/assets/{file-code-B3iDpJRP.js → file-code-DxVUPin2.js} +1 -1
- package/dist/assets/{file-search-DHHwYVza.js → file-search-BRbGARSr.js} +1 -1
- package/dist/assets/filename-validation-wKCpNal3.js +1 -0
- package/dist/assets/{grip-vertical-A-AANrBM.js → grip-vertical-C5AW4fiD.js} +1 -1
- package/dist/assets/{hook-editor-yhQoi-Ky.js → hook-editor-KoqKvv73.js} +1 -1
- package/dist/assets/{hook-runtime-JF-0oZpz.js → hook-runtime-DZ6bR69q.js} +1 -1
- package/dist/assets/{hook-viewer-DIkxp9uJ.js → hook-viewer-DWsN8RyZ.js} +1 -1
- package/dist/assets/hooks-BfUXcuyV.js +1 -0
- package/dist/assets/{id-badge-NwZYoNfB.js → id-badge-BpTnHwvn.js} +2 -2
- package/dist/assets/{index-Bvtm2F6f.js → index-C3AdCkmj.js} +2 -2
- package/dist/assets/index-DzWZqTlZ.css +2 -0
- package/dist/assets/{insights-DuYBsUzB.js → insights-Dtq5Rwby.js} +1 -1
- package/dist/assets/{insights-line-grid-BKOqA-1W.js → insights-line-grid-X5lNbmTY.js} +6 -6
- package/dist/assets/{lib-58FyJI_k.js → lib-u_ZEFKZp.js} +1 -1
- package/dist/assets/live-run-CfMxOSfk.js +1 -0
- package/dist/assets/{memory-B7nfWNTH.js → memory-DS-02aNZ.js} +1 -1
- package/dist/assets/memory-product-5m-eyxzH.js +2 -0
- package/dist/assets/{monaco-editor-DNT0Mzki.js → monaco-editor-BEWq4fzI.js} +2 -2
- package/dist/assets/{monaco-editor-inner-DuCqlGei.js → monaco-editor-inner-B6AQm3h7.js} +2 -2
- package/dist/assets/{monaco.contribution-LYJB_lCm.js → monaco.contribution-Dum2B1vn.js} +2 -2
- package/dist/assets/{observation-block-4AqYhL1h.js → observation-block-2qfTbm41.js} +1 -1
- package/dist/assets/{observation-markdown-Dx_5-T0t.js → observation-markdown-CIs-5TY2.js} +1 -1
- package/dist/assets/{pencil-DdRoBrsh.js → pencil-BUQgVaEH.js} +1 -1
- package/dist/assets/plus-Bf5Mbita.js +1 -0
- package/dist/assets/popover-OAiTzjiL.js +1 -0
- package/dist/assets/{refresh-cw-C_0AkMuu.js → refresh-cw-D0OwRzvm.js} +1 -1
- package/dist/assets/{resizable-BGEcNRZO.js → resizable-ugU12HrY.js} +1 -1
- package/dist/assets/run-detail-Cr984qgU.js +1 -0
- package/dist/assets/runs-CDAIeUbq.js +1 -0
- package/dist/assets/{scroll-area-CnATfQoe.js → scroll-area-CX3T8JWh.js} +1 -1
- package/dist/assets/{select-CeVjgiKI.js → select-D0GpDfUa.js} +1 -1
- package/dist/assets/{shortcut-hints-Bs5o743i.js → shortcut-hints-B8kCurzo.js} +1 -1
- package/dist/assets/split-button-CRYV8xU8.js +1 -0
- package/dist/assets/square-K8N8Yius.js +1 -0
- package/dist/assets/{step-name-pills-Dta5ZGMZ.js → step-name-pills-BQ8yv40K.js} +1 -1
- package/dist/assets/suite-editor-aAjvjp2R.js +5 -0
- package/dist/assets/suite-navbar-UATCw4Qb.js +1 -0
- package/dist/assets/suite-viewer-CmbLH1G2.js +1 -0
- package/dist/assets/{suites-BvfwzFEd.js → suites-BlJfefzt.js} +1 -1
- package/dist/assets/{switch-ByV5GV5L.js → switch-Dv7aVqt1.js} +1 -1
- package/dist/assets/tab-console-Ciur_Bee.js +1 -0
- package/dist/assets/{table-D08QBBt4.js → table-BOjrxBBL.js} +1 -1
- package/dist/assets/{tabs-DrB_Acb3.js → tabs-BEp-p5jh.js} +1 -1
- package/dist/assets/test-editor-CFzp3eq1.js +9 -0
- package/dist/assets/test-navbar-ChNg-qki.js +7 -0
- package/dist/assets/{test-viewer-BwUQNVa4.js → test-viewer-DEQQDURn.js} +1 -1
- package/dist/assets/tests-Dzlh9Zho.js +1 -0
- package/dist/assets/{tests-suites-table-widths-DNWnkAjA.js → tests-suites-table-widths-D2sc1JmR.js} +1 -1
- package/dist/assets/{textarea-DChEVvwQ.js → textarea-BFsDx2mB.js} +1 -1
- package/dist/assets/{trash-2-7P1Dp87k.js → trash-2-Dv939XWG.js} +1 -1
- package/dist/assets/{tsMode-DEhRZlmT.js → tsMode-CnaplBFQ.js} +1 -1
- package/dist/assets/use-hook-run-session-BLSTM6LJ.js +1 -0
- package/dist/assets/{use-keyboard-shortcuts-EAppuiKO.js → use-keyboard-shortcuts-COnAPsDD.js} +1 -1
- package/dist/assets/{use-page-title-B1t9-5_U.js → use-page-title-CsUoFrfG.js} +1 -1
- package/dist/assets/use-run-status-favicon-DLOLF3Hx.js +1 -0
- package/dist/assets/{use-selection-queue-BboTDies.js → use-selection-queue-BkEWIfvw.js} +1 -1
- package/dist/assets/{viewer-url-state-6mOK5_sY.js → viewer-url-state-PwkMc-qK.js} +1 -1
- package/dist/assets/{zap-KFJmkY3Y.js → zap-Dx2CqraS.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +2 -2
- package/dist/assets/config-TRu3J-E7.js +0 -10
- package/dist/assets/dist-BPJgj1d0.js +0 -1
- package/dist/assets/filename-validation-4sTTEagx.js +0 -1
- package/dist/assets/hooks-CDRbjPKv.js +0 -1
- package/dist/assets/index-CW7tbJhs.css +0 -2
- package/dist/assets/live-run-ucgeJa3o.js +0 -1
- package/dist/assets/memory-product-D1u5V75o.js +0 -2
- package/dist/assets/plus-pXO98OAE.js +0 -1
- package/dist/assets/popover-DGZi688D.js +0 -1
- package/dist/assets/run-detail-3tlB8sew.js +0 -1
- package/dist/assets/runs-CywxkFZ6.js +0 -1
- package/dist/assets/split-button-DcY8ames.js +0 -1
- package/dist/assets/square-D71GHEET.js +0 -1
- package/dist/assets/suite-editor-Bnf6KMna.js +0 -5
- package/dist/assets/suite-navbar-PStktQ6j.js +0 -1
- package/dist/assets/suite-viewer-BD74MY_X.js +0 -1
- package/dist/assets/tab-console-BQFkZJG_.js +0 -1
- package/dist/assets/test-editor-w7ZQPYgH.js +0 -9
- package/dist/assets/test-navbar-DoHKAy1p.js +0 -7
- package/dist/assets/tests-B5ELKDH2.js +0 -1
- package/dist/assets/use-hook-run-session-x-d_iodT.js +0 -1
- package/dist/assets/use-run-status-favicon-D69P46yH.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./dist-BPJgj1d0.js";import{n,r}from"./use-page-title-B1t9-5_U.js";import{$t as i,Cn as a,En as o,Jn as s,Mn as c,Qn as l,Qt as u,Sn as d,Tn as f,Wt as p,Xt as m,Zt as h,_n as g,en as _,fn as v,fr as y,gn as b,hn as x,kn as S,mn as C,pn as w,pr as T,vn as E,wn as D,xn as O,yn as k}from"./index-Bvtm2F6f.js";var A=s(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),j=s(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),M=s(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),N=e(y(),1),P=e(T(),1);function F(e){let t=P.useRef({value:e,previous:e});return P.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var I=l(),L=[` `,`Enter`,`ArrowUp`,`ArrowDown`],R=[` `,`Enter`],z=`Select`,[B,V,H]=t(z),[U,W]=D(z,[H,_]),G=_(),[ee,K]=U(z),[te,ne]=U(z),q=e=>{let{__scopeSelect:t,children:n,open:a,defaultOpen:o,onOpenChange:s,value:c,defaultValue:l,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g}=e,_=G(t),[v,y]=P.useState(null),[b,x]=P.useState(null),[S,C]=P.useState(!1),w=r(d),[T,E]=O({prop:a,defaultProp:o??!1,onChange:s,caller:z}),[D,A]=O({prop:c,defaultProp:l,onChange:u,caller:z}),j=P.useRef(null),M=v?g||!!v.closest(`form`):!0,[N,F]=P.useState(new Set),L=Array.from(N).map(e=>e.props.value).join(`;`);return(0,I.jsx)(i,{..._,children:(0,I.jsxs)(ee,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:k(),value:D,onValueChange:A,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:j,disabled:m,children:[(0,I.jsx)(B.Provider,{scope:t,children:(0,I.jsx)(te,{scope:e.__scopeSelect,onNativeOptionAdd:P.useCallback(e=>{F(t=>new Set(t).add(e))},[]),onNativeOptionRemove:P.useCallback(e=>{F(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),M?(0,I.jsxs)(Ge,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:D,onChange:e=>A(e.target.value),disabled:m,form:g,children:[D===void 0?(0,I.jsx)(`option`,{value:``}):null,Array.from(N)]},L):null]})})};q.displayName=z;var re=`SelectTrigger`,J=P.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,s=G(n),l=K(re,n),u=l.disabled||r,d=c(t,l.onTriggerChange),f=V(n),p=P.useRef(`touch`),[h,g,_]=qe(e=>{let t=f().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.value===l.value));n!==void 0&&l.onValueChange(n.value)}),v=e=>{u||(l.onOpenChange(!0),_()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(m,{asChild:!0,...s,children:(0,I.jsx)(o.button,{type:`button`,role:`combobox`,"aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":`none`,dir:l.dir,"data-state":l.open?`open`:`closed`,disabled:u,"data-disabled":u?``:void 0,"data-placeholder":Ke(l.value)?``:void 0,...i,ref:d,onClick:a(i.onClick,e=>{e.currentTarget.focus(),p.current!==`mouse`&&v(e)}),onPointerDown:a(i.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(v(e),e.preventDefault())}),onKeyDown:a(i.onKeyDown,e=>{let t=h.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&g(e.key),!(t&&e.key===` `)&&L.includes(e.key)&&(v(),e.preventDefault())})})})});J.displayName=re;var ie=`SelectValue`,ae=P.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:s=``,...l}=e,u=K(ie,n),{onValueNodeHasChildrenChange:f}=u,p=a!==void 0,m=c(t,u.onValueNodeChange);return d(()=>{f(p)},[f,p]),(0,I.jsx)(o.span,{...l,ref:m,style:{pointerEvents:`none`},children:Ke(u.value)?(0,I.jsx)(I.Fragment,{children:s}):a})});ae.displayName=ie;var oe=`SelectIcon`,se=P.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(o.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});se.displayName=oe;var ce=`SelectPortal`,le=e=>(0,I.jsx)(x,{asChild:!0,...e});le.displayName=ce;var Y=`SelectContent`,ue=P.forwardRef((e,t)=>{let n=K(Y,e.__scopeSelect),[r,i]=P.useState();if(d(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?N.createPortal((0,I.jsx)(de,{scope:e.__scopeSelect,children:(0,I.jsx)(B.Slot,{scope:e.__scopeSelect,children:(0,I.jsx)(`div`,{children:e.children})})}),t):null}return(0,I.jsx)(me,{...e,ref:t})});ue.displayName=Y;var X=10,[de,Z]=U(Y),fe=`SelectContentImpl`,pe=S(`SelectContent.RemoveScroll`),me=P.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:_,hideWhenDetached:y,avoidCollisions:x,...S}=e,T=K(Y,n),[E,D]=P.useState(null),[O,k]=P.useState(null),A=c(t,e=>D(e)),[j,M]=P.useState(null),[N,F]=P.useState(null),L=V(n),[R,z]=P.useState(!1),B=P.useRef(!1);P.useEffect(()=>{if(E)return v(E)},[E]),C();let H=P.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[L,O]),U=P.useCallback(()=>H([j,E]),[H,j,E]);P.useEffect(()=>{R&&U()},[R,U]);let{onOpenChange:W,triggerPointerDownPosRef:G}=T;P.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(G.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():E.contains(n.target)||W(!1),document.removeEventListener(`pointermove`,t),G.current=null};return G.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,W,G]),P.useEffect(()=>{let e=()=>W(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[W]);let[ee,te]=qe(e=>{let t=L().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=P.useCallback((e,t,n)=>{let r=!B.current&&!n;(T.value!==void 0&&T.value===t||r)&&(M(e),r&&(B.current=!0))},[T.value]),q=P.useCallback(()=>E?.focus(),[E]),re=P.useCallback((e,t,n)=>{let r=!B.current&&!n;(T.value!==void 0&&T.value===t||r)&&F(e)},[T.value]),J=r===`popper`?ve:ge,ie=J===ve?{side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:_,hideWhenDetached:y,avoidCollisions:x}:{};return(0,I.jsx)(de,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:ne,selectedItem:j,onItemLeave:q,itemTextRefCallback:re,focusSelectedItem:U,selectedItemText:N,position:r,isPositioned:R,searchRef:ee,children:(0,I.jsx)(w,{as:pe,allowPinchZoom:!0,children:(0,I.jsx)(b,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:a(i,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(g,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,I.jsx)(J,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...S,...ie,onPlaced:()=>z(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...S.style},onKeyDown:a(S.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>H(t)),e.preventDefault()}})})})})})})});me.displayName=fe;var he=`SelectItemAlignedPosition`,ge=P.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:i,...a}=e,s=K(Y,r),l=Z(Y,r),[u,f]=P.useState(null),[p,m]=P.useState(null),h=c(t,e=>m(e)),g=V(r),_=P.useRef(!1),v=P.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:x,focusSelectedItem:S}=l,C=P.useCallback(()=>{if(s.trigger&&s.valueNode&&u&&p&&y&&b&&x){let e=s.trigger.getBoundingClientRect(),t=p.getBoundingClientRect(),r=s.valueNode.getBoundingClientRect(),a=x.getBoundingClientRect();if(s.dir!==`rtl`){let i=a.left-t.left,o=r.left-i,s=e.left-o,c=e.width+s,l=Math.max(c,t.width),d=window.innerWidth-X,f=n(o,[X,Math.max(X,d-l)]);u.style.minWidth=c+`px`,u.style.left=f+`px`}else{let i=t.right-a.right,o=window.innerWidth-r.right-i,s=window.innerWidth-e.right-o,c=e.width+s,l=Math.max(c,t.width),d=window.innerWidth-X,f=n(o,[X,Math.max(X,d-l)]);u.style.minWidth=c+`px`,u.style.right=f+`px`}let o=g(),c=window.innerHeight-X*2,l=y.scrollHeight,d=window.getComputedStyle(p),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),h=parseInt(d.borderBottomWidth,10),v=parseInt(d.paddingBottom,10),S=f+m+l+v+h,C=Math.min(b.offsetHeight*5,S),w=window.getComputedStyle(y),T=parseInt(w.paddingTop,10),E=parseInt(w.paddingBottom,10),D=e.top+e.height/2-X,O=c-D,k=b.offsetHeight/2,A=b.offsetTop+k,j=f+m+A,M=S-j;if(j<=D){let e=o.length>0&&b===o[o.length-1].ref.current;u.style.bottom=`0px`;let t=p.clientHeight-y.offsetTop-y.offsetHeight,n=j+Math.max(O,k+(e?E:0)+t+h);u.style.height=n+`px`}else{let e=o.length>0&&b===o[0].ref.current;u.style.top=`0px`;let t=Math.max(D,f+y.offsetTop+(e?T:0)+k)+M;u.style.height=t+`px`,y.scrollTop=j-D+y.offsetTop}u.style.margin=`${X}px 0`,u.style.minHeight=C+`px`,u.style.maxHeight=c+`px`,i?.(),requestAnimationFrame(()=>_.current=!0)}},[g,s.trigger,s.valueNode,u,p,y,b,x,s.dir,i]);d(()=>C(),[C]);let[w,T]=P.useState();return d(()=>{p&&T(window.getComputedStyle(p).zIndex)},[p]),(0,I.jsx)(ye,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:_,onScrollButtonChange:P.useCallback(e=>{e&&v.current===!0&&(C(),S?.(),v.current=!1)},[C,S]),children:(0,I.jsx)(`div`,{ref:f,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:w},children:(0,I.jsx)(o.div,{...a,ref:h,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});ge.displayName=he;var _e=`SelectPopperPosition`,ve=P.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=X,...a}=e,o=G(n);return(0,I.jsx)(u,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ve.displayName=_e;var[ye,be]=U(Y,{}),xe=`SelectViewport`,Se=P.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,s=Z(xe,n),l=be(xe,n),u=c(t,s.onViewportChange),d=P.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(o.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:u,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:a(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){let e=Math.abs(d.current-t.scrollTop);if(e>0){let r=window.innerHeight-X*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}d.current=t.scrollTop})})})]})});Se.displayName=xe;var Ce=`SelectGroup`,[we,Te]=U(Ce),Ee=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=k();return(0,I.jsx)(we,{scope:n,id:i,children:(0,I.jsx)(o.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Ee.displayName=Ce;var De=`SelectLabel`,Oe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Te(De,n);return(0,I.jsx)(o.div,{id:i.id,...r,ref:t})});Oe.displayName=De;var Q=`SelectItem`,[ke,Ae]=U(Q),je=P.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...l}=e,u=K(Q,n),d=Z(Q,n),f=u.value===r,[p,m]=P.useState(s??``),[h,g]=P.useState(!1),_=c(t,e=>d.itemRefCallback?.(e,r,i)),v=k(),y=P.useRef(`touch`),b=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,I.jsx)(ke,{scope:n,value:r,disabled:i,textId:v,isSelected:f,onItemTextChange:P.useCallback(e=>{m(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(B.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:(0,I.jsx)(o.div,{role:`option`,"aria-labelledby":v,"data-highlighted":h?``:void 0,"aria-selected":f&&h,"data-state":f?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...l,ref:_,onFocus:a(l.onFocus,()=>g(!0)),onBlur:a(l.onBlur,()=>g(!1)),onClick:a(l.onClick,()=>{y.current!==`mouse`&&b()}),onPointerUp:a(l.onPointerUp,()=>{y.current===`mouse`&&b()}),onPointerDown:a(l.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:a(l.onPointerMove,e=>{y.current=e.pointerType,i?d.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:a(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:a(l.onKeyDown,e=>{d.searchRef?.current!==``&&e.key===` `||(R.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})});je.displayName=Q;var $=`SelectItemText`,Me=P.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,s=K($,n),l=Z($,n),u=Ae($,n),f=ne($,n),[p,m]=P.useState(null),h=c(t,e=>m(e),u.onItemTextChange,e=>l.itemTextRefCallback?.(e,u.value,u.disabled)),g=p?.textContent,_=P.useMemo(()=>(0,I.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=f;return d(()=>(v(_),()=>y(_)),[v,y,_]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(o.span,{id:u.textId,...a,ref:h}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?N.createPortal(a.children,s.valueNode):null]})});Me.displayName=$;var Ne=`SelectItemIndicator`,Pe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Ae(Ne,n).isSelected?(0,I.jsx)(o.span,{"aria-hidden":!0,...r,ref:t}):null});Pe.displayName=Ne;var Fe=`SelectScrollUpButton`,Ie=P.forwardRef((e,t)=>{let n=Z(Fe,e.__scopeSelect),r=be(Fe,e.__scopeSelect),[i,a]=P.useState(!1),o=c(t,r.onScrollButtonChange);return d(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(ze,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ie.displayName=Fe;var Le=`SelectScrollDownButton`,Re=P.forwardRef((e,t)=>{let n=Z(Le,e.__scopeSelect),r=be(Le,e.__scopeSelect),[i,a]=P.useState(!1),o=c(t,r.onScrollButtonChange);return d(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(ze,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Re.displayName=Le;var ze=P.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,s=Z(`SelectScrollButton`,n),c=P.useRef(null),l=V(n),u=P.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return P.useEffect(()=>()=>u(),[u]),d(()=>{l().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[l]),(0,I.jsx)(o.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:a(i.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:a(i.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:a(i.onPointerLeave,()=>{u()})})}),Be=`SelectSeparator`,Ve=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(o.div,{"aria-hidden":!0,...r,ref:t})});Ve.displayName=Be;var He=`SelectArrow`,Ue=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=G(n),a=K(He,n),o=Z(He,n);return a.open&&o.position===`popper`?(0,I.jsx)(h,{...i,...r,ref:t}):null});Ue.displayName=He;var We=`SelectBubbleInput`,Ge=P.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=P.useRef(null),a=c(r,i),s=F(t);return P.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(s!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[s,t]),(0,I.jsx)(o.select,{...n,style:{...f,...n.style},ref:a,defaultValue:t})});Ge.displayName=We;function Ke(e){return e===``||e===void 0}function qe(e){let t=E(e),n=P.useRef(``),r=P.useRef(0),i=P.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=P.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Je(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ye(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xe=q,Ze=J,Qe=ae,$e=se,et=le,tt=ue,nt=Se,rt=Ee,it=Oe,at=je,ot=Me,st=Pe,ct=Ie,lt=Re;function ut({...e}){return(0,I.jsx)(Xe,{"data-slot":`select`,...e})}function dt({...e}){return(0,I.jsx)(rt,{"data-slot":`select-group`,...e})}function ft({...e}){return(0,I.jsx)(Qe,{"data-slot":`select-value`,...e})}function pt({className:e,size:t=`default`,children:n,...r}){return(0,I.jsxs)(Ze,{"data-slot":`select-trigger`,"data-size":t,className:p(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,I.jsx)($e,{asChild:!0,children:(0,I.jsx)(j,{className:`size-4 opacity-50`})})]})}function mt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,I.jsx)(et,{children:(0,I.jsxs)(tt,{"data-slot":`select-content`,className:p(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,I.jsx)(_t,{}),(0,I.jsx)(nt,{className:p(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,I.jsx)(vt,{})]})})}function ht({className:e,...t}){return(0,I.jsx)(it,{"data-slot":`select-label`,className:p(`px-2 py-1.5 text-xs text-muted-foreground`,e),...t})}function gt({className:e,children:t,...n}){return(0,I.jsxs)(at,{"data-slot":`select-item`,className:p(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,I.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(st,{children:(0,I.jsx)(A,{className:`size-4`})})}),(0,I.jsx)(ot,{children:t})]})}function _t({className:e,...t}){return(0,I.jsx)(ct,{"data-slot":`select-scroll-up-button`,className:p(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(M,{className:`size-4`})})}function vt({className:e,...t}){return(0,I.jsx)(lt,{"data-slot":`select-scroll-down-button`,className:p(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(j,{className:`size-4`})})}export{ht as a,F as c,gt as i,j as l,mt as n,pt as o,dt as r,ft as s,ut as t,A as u};
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./dist-Bc4r79ls.js";import{n,r}from"./use-page-title-CsUoFrfG.js";import{$n as i,$t as a,An as o,Cn as s,Dn as c,En as l,Gt as u,Nn as d,Qt as f,Sn as p,Tn as m,Yn as h,Zt as g,_n as _,bn as v,en as y,gn as b,hn as x,mn as S,mr as C,pn as w,pr as T,tn as E,vn as D,wn as O,yn as k}from"./index-C3AdCkmj.js";var A=h(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),j=h(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),M=h(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),N=e(T(),1),P=e(C(),1);function F(e){let t=P.useRef({value:e,previous:e});return P.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var I=i(),L=[` `,`Enter`,`ArrowUp`,`ArrowDown`],R=[` `,`Enter`],z=`Select`,[B,V,H]=t(z),[U,W]=m(z,[H,E]),G=E(),[ee,K]=U(z),[te,ne]=U(z),q=e=>{let{__scopeSelect:t,children:n,open:i,defaultOpen:a,onOpenChange:o,value:s,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:m,required:h,form:g}=e,_=G(t),[b,x]=P.useState(null),[S,C]=P.useState(null),[w,T]=P.useState(!1),E=r(u),[D,O]=p({prop:i,defaultProp:a??!1,onChange:o,caller:z}),[k,A]=p({prop:s,defaultProp:c,onChange:l,caller:z}),j=P.useRef(null),M=b?g||!!b.closest(`form`):!0,[N,F]=P.useState(new Set),L=Array.from(N).map(e=>e.props.value).join(`;`);return(0,I.jsx)(y,{..._,children:(0,I.jsxs)(ee,{required:h,scope:t,trigger:b,onTriggerChange:x,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:v(),value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:j,disabled:m,children:[(0,I.jsx)(B.Provider,{scope:t,children:(0,I.jsx)(te,{scope:e.__scopeSelect,onNativeOptionAdd:P.useCallback(e=>{F(t=>new Set(t).add(e))},[]),onNativeOptionRemove:P.useCallback(e=>{F(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),M?(0,I.jsxs)(Ge,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:k,onChange:e=>A(e.target.value),disabled:m,form:g,children:[k===void 0?(0,I.jsx)(`option`,{value:``}):null,Array.from(N)]},L):null]})})};q.displayName=z;var re=`SelectTrigger`,J=P.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=G(n),o=K(re,n),s=o.disabled||r,l=d(t,o.onTriggerChange),u=V(n),f=P.useRef(`touch`),[p,m,h]=qe(e=>{let t=u().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),_=e=>{s||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(g,{asChild:!0,...a,children:(0,I.jsx)(c.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Ke(o.value)?``:void 0,...i,ref:l,onClick:O(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&_(e)}),onPointerDown:O(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:O(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&L.includes(e.key)&&(_(),e.preventDefault())})})})});J.displayName=re;var ie=`SelectValue`,ae=P.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...l}=e,u=K(ie,n),{onValueNodeHasChildrenChange:f}=u,p=a!==void 0,m=d(t,u.onValueNodeChange);return s(()=>{f(p)},[f,p]),(0,I.jsx)(c.span,{...l,ref:m,style:{pointerEvents:`none`},children:Ke(u.value)?(0,I.jsx)(I.Fragment,{children:o}):a})});ae.displayName=ie;var oe=`SelectIcon`,se=P.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(c.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});se.displayName=oe;var ce=`SelectPortal`,le=e=>(0,I.jsx)(b,{asChild:!0,...e});le.displayName=ce;var Y=`SelectContent`,ue=P.forwardRef((e,t)=>{let n=K(Y,e.__scopeSelect),[r,i]=P.useState();if(s(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?N.createPortal((0,I.jsx)(de,{scope:e.__scopeSelect,children:(0,I.jsx)(B.Slot,{scope:e.__scopeSelect,children:(0,I.jsx)(`div`,{children:e.children})})}),t):null}return(0,I.jsx)(me,{...e,ref:t})});ue.displayName=Y;var X=10,[de,Z]=U(Y),fe=`SelectContentImpl`,pe=o(`SelectContent.RemoveScroll`),me=P.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:v,...y}=e,b=K(Y,n),[C,T]=P.useState(null),[E,k]=P.useState(null),A=d(t,e=>T(e)),[j,M]=P.useState(null),[N,F]=P.useState(null),L=V(n),[R,z]=P.useState(!1),B=P.useRef(!1);P.useEffect(()=>{if(C)return w(C)},[C]),x();let H=P.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&E&&(E.scrollTop=0),n===r&&E&&(E.scrollTop=E.scrollHeight),n?.focus(),document.activeElement!==i))return},[L,E]),U=P.useCallback(()=>H([j,C]),[H,j,C]);P.useEffect(()=>{R&&U()},[R,U]);let{onOpenChange:W,triggerPointerDownPosRef:G}=b;P.useEffect(()=>{if(C){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(G.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():C.contains(n.target)||W(!1),document.removeEventListener(`pointermove`,t),G.current=null};return G.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[C,W,G]),P.useEffect(()=>{let e=()=>W(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[W]);let[ee,te]=qe(e=>{let t=L().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=P.useCallback((e,t,n)=>{let r=!B.current&&!n;(b.value!==void 0&&b.value===t||r)&&(M(e),r&&(B.current=!0))},[b.value]),q=P.useCallback(()=>C?.focus(),[C]),re=P.useCallback((e,t,n)=>{let r=!B.current&&!n;(b.value!==void 0&&b.value===t||r)&&F(e)},[b.value]),J=r===`popper`?ve:ge,ie=J===ve?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:v}:{};return(0,I.jsx)(de,{scope:n,content:C,viewport:E,onViewportChange:k,itemRefCallback:ne,selectedItem:j,onItemLeave:q,itemTextRefCallback:re,focusSelectedItem:U,selectedItemText:N,position:r,isPositioned:R,searchRef:ee,children:(0,I.jsx)(S,{as:pe,allowPinchZoom:!0,children:(0,I.jsx)(_,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:O(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(D,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,I.jsx)(J,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...ie,onPlaced:()=>z(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...y.style},onKeyDown:O(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>H(t)),e.preventDefault()}})})})})})})});me.displayName=fe;var he=`SelectItemAlignedPosition`,ge=P.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:i,...a}=e,o=K(Y,r),l=Z(Y,r),[u,f]=P.useState(null),[p,m]=P.useState(null),h=d(t,e=>m(e)),g=V(r),_=P.useRef(!1),v=P.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:x,focusSelectedItem:S}=l,C=P.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&p&&y&&b&&x){let e=o.trigger.getBoundingClientRect(),t=p.getBoundingClientRect(),r=o.valueNode.getBoundingClientRect(),a=x.getBoundingClientRect();if(o.dir!==`rtl`){let i=a.left-t.left,o=r.left-i,s=e.left-o,c=e.width+s,l=Math.max(c,t.width),d=window.innerWidth-X,f=n(o,[X,Math.max(X,d-l)]);u.style.minWidth=c+`px`,u.style.left=f+`px`}else{let i=t.right-a.right,o=window.innerWidth-r.right-i,s=window.innerWidth-e.right-o,c=e.width+s,l=Math.max(c,t.width),d=window.innerWidth-X,f=n(o,[X,Math.max(X,d-l)]);u.style.minWidth=c+`px`,u.style.right=f+`px`}let s=g(),c=window.innerHeight-X*2,l=y.scrollHeight,d=window.getComputedStyle(p),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),h=parseInt(d.borderBottomWidth,10),v=parseInt(d.paddingBottom,10),S=f+m+l+v+h,C=Math.min(b.offsetHeight*5,S),w=window.getComputedStyle(y),T=parseInt(w.paddingTop,10),E=parseInt(w.paddingBottom,10),D=e.top+e.height/2-X,O=c-D,k=b.offsetHeight/2,A=b.offsetTop+k,j=f+m+A,M=S-j;if(j<=D){let e=s.length>0&&b===s[s.length-1].ref.current;u.style.bottom=`0px`;let t=p.clientHeight-y.offsetTop-y.offsetHeight,n=j+Math.max(O,k+(e?E:0)+t+h);u.style.height=n+`px`}else{let e=s.length>0&&b===s[0].ref.current;u.style.top=`0px`;let t=Math.max(D,f+y.offsetTop+(e?T:0)+k)+M;u.style.height=t+`px`,y.scrollTop=j-D+y.offsetTop}u.style.margin=`${X}px 0`,u.style.minHeight=C+`px`,u.style.maxHeight=c+`px`,i?.(),requestAnimationFrame(()=>_.current=!0)}},[g,o.trigger,o.valueNode,u,p,y,b,x,o.dir,i]);s(()=>C(),[C]);let[w,T]=P.useState();return s(()=>{p&&T(window.getComputedStyle(p).zIndex)},[p]),(0,I.jsx)(ye,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:_,onScrollButtonChange:P.useCallback(e=>{e&&v.current===!0&&(C(),S?.(),v.current=!1)},[C,S]),children:(0,I.jsx)(`div`,{ref:f,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:w},children:(0,I.jsx)(c.div,{...a,ref:h,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});ge.displayName=he;var _e=`SelectPopperPosition`,ve=P.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=X,...o}=e,s=G(n);return(0,I.jsx)(a,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...o.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ve.displayName=_e;var[ye,be]=U(Y,{}),xe=`SelectViewport`,Se=P.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Z(xe,n),o=be(xe,n),s=d(t,a.onViewportChange),l=P.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(c.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:O(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-X*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});Se.displayName=xe;var Ce=`SelectGroup`,[we,Te]=U(Ce),Ee=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=v();return(0,I.jsx)(we,{scope:n,id:i,children:(0,I.jsx)(c.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Ee.displayName=Ce;var De=`SelectLabel`,Oe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Te(De,n);return(0,I.jsx)(c.div,{id:i.id,...r,ref:t})});Oe.displayName=De;var Q=`SelectItem`,[ke,Ae]=U(Q),je=P.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=K(Q,n),l=Z(Q,n),u=s.value===r,[f,p]=P.useState(a??``),[m,h]=P.useState(!1),g=d(t,e=>l.itemRefCallback?.(e,r,i)),_=v(),y=P.useRef(`touch`),b=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,I.jsx)(ke,{scope:n,value:r,disabled:i,textId:_,isSelected:u,onItemTextChange:P.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(B.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:(0,I.jsx)(c.div,{role:`option`,"aria-labelledby":_,"data-highlighted":m?``:void 0,"aria-selected":u&&m,"data-state":u?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:O(o.onFocus,()=>h(!0)),onBlur:O(o.onBlur,()=>h(!1)),onClick:O(o.onClick,()=>{y.current!==`mouse`&&b()}),onPointerUp:O(o.onPointerUp,()=>{y.current===`mouse`&&b()}),onPointerDown:O(o.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:O(o.onPointerMove,e=>{y.current=e.pointerType,i?l.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:O(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:O(o.onKeyDown,e=>{l.searchRef?.current!==``&&e.key===` `||(R.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})});je.displayName=Q;var $=`SelectItemText`,Me=P.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=K($,n),l=Z($,n),u=Ae($,n),f=ne($,n),[p,m]=P.useState(null),h=d(t,e=>m(e),u.onItemTextChange,e=>l.itemTextRefCallback?.(e,u.value,u.disabled)),g=p?.textContent,_=P.useMemo(()=>(0,I.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=f;return s(()=>(v(_),()=>y(_)),[v,y,_]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(c.span,{id:u.textId,...a,ref:h}),u.isSelected&&o.valueNode&&!o.valueNodeHasChildren?N.createPortal(a.children,o.valueNode):null]})});Me.displayName=$;var Ne=`SelectItemIndicator`,Pe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Ae(Ne,n).isSelected?(0,I.jsx)(c.span,{"aria-hidden":!0,...r,ref:t}):null});Pe.displayName=Ne;var Fe=`SelectScrollUpButton`,Ie=P.forwardRef((e,t)=>{let n=Z(Fe,e.__scopeSelect),r=be(Fe,e.__scopeSelect),[i,a]=P.useState(!1),o=d(t,r.onScrollButtonChange);return s(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(ze,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ie.displayName=Fe;var Le=`SelectScrollDownButton`,Re=P.forwardRef((e,t)=>{let n=Z(Le,e.__scopeSelect),r=be(Le,e.__scopeSelect),[i,a]=P.useState(!1),o=d(t,r.onScrollButtonChange);return s(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(ze,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Re.displayName=Le;var ze=P.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Z(`SelectScrollButton`,n),o=P.useRef(null),l=V(n),u=P.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return P.useEffect(()=>()=>u(),[u]),s(()=>{l().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[l]),(0,I.jsx)(c.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:O(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:O(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:O(i.onPointerLeave,()=>{u()})})}),Be=`SelectSeparator`,Ve=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(c.div,{"aria-hidden":!0,...r,ref:t})});Ve.displayName=Be;var He=`SelectArrow`,Ue=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=G(n),a=K(He,n),o=Z(He,n);return a.open&&o.position===`popper`?(0,I.jsx)(f,{...i,...r,ref:t}):null});Ue.displayName=He;var We=`SelectBubbleInput`,Ge=P.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=P.useRef(null),a=d(r,i),o=F(t);return P.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,I.jsx)(c.select,{...n,style:{...l,...n.style},ref:a,defaultValue:t})});Ge.displayName=We;function Ke(e){return e===``||e===void 0}function qe(e){let t=k(e),n=P.useRef(``),r=P.useRef(0),i=P.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=P.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Je(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ye(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xe=q,Ze=J,Qe=ae,$e=se,et=le,tt=ue,nt=Se,rt=Ee,it=Oe,at=je,ot=Me,st=Pe,ct=Ie,lt=Re;function ut({...e}){return(0,I.jsx)(Xe,{"data-slot":`select`,...e})}function dt({...e}){return(0,I.jsx)(rt,{"data-slot":`select-group`,...e})}function ft({...e}){return(0,I.jsx)(Qe,{"data-slot":`select-value`,...e})}function pt({className:e,size:t=`default`,children:n,...r}){return(0,I.jsxs)(Ze,{"data-slot":`select-trigger`,"data-size":t,className:u(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,I.jsx)($e,{asChild:!0,children:(0,I.jsx)(j,{className:`size-4 opacity-50`})})]})}function mt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,I.jsx)(et,{children:(0,I.jsxs)(tt,{"data-slot":`select-content`,className:u(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,I.jsx)(_t,{}),(0,I.jsx)(nt,{className:u(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,I.jsx)(vt,{})]})})}function ht({className:e,...t}){return(0,I.jsx)(it,{"data-slot":`select-label`,className:u(`px-2 py-1.5 text-xs text-muted-foreground`,e),...t})}function gt({className:e,children:t,...n}){return(0,I.jsxs)(at,{"data-slot":`select-item`,className:u(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,I.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(st,{children:(0,I.jsx)(A,{className:`size-4`})})}),(0,I.jsx)(ot,{children:t})]})}function _t({className:e,...t}){return(0,I.jsx)(ct,{"data-slot":`select-scroll-up-button`,className:u(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(M,{className:`size-4`})})}function vt({className:e,...t}){return(0,I.jsx)(lt,{"data-slot":`select-scroll-down-button`,className:u(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(j,{className:`size-4`})})}export{ht as a,F as c,gt as i,j as l,mt as n,pt as o,dt as r,ft as s,ut as t,A as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{$n as e,Gt as t,Yn as n}from"./index-C3AdCkmj.js";var r=n(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),i=e();function a({shortcut:e,className:n}){return(0,i.jsx)(`kbd`,{className:t(`text-[10px] font-mono px-1.5 py-0.5 rounded border bg-muted text-muted-foreground`,n),children:e})}function o({hints:e}){return(0,i.jsx)(`div`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5`,children:e.map(e=>(0,i.jsxs)(`div`,{className:`contents`,children:[(0,i.jsx)(a,{shortcut:e.key}),(0,i.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.label})]},e.key))})}export{o as n,r,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{l as t}from"./select-D0GpDfUa.js";import{t as n}from"./shortcut-hints-B8kCurzo.js";import{t as r}from"./dist-Bc4r79ls.js";import{r as i}from"./use-page-title-CsUoFrfG.js";import{n as a,r as o,t as s}from"./dist-BABsMbMt.js";import{$n as c,$t as l,An as u,Dn as d,Gt as f,H as p,Mn as m,Nn as h,On as ee,Qt as te,Sn as g,Tn as _,Wt as v,Yn as ne,Zt as re,_n as ie,bn as y,en as b,gn as x,hn as ae,mn as oe,mr as S,pn as se,tn as C,vn as ce,wn as w,xn as T,yn as E,zn as D}from"./index-C3AdCkmj.js";var O=ne(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),k=ne(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),A=e(S(),1),j=c(),M=[`Enter`,` `],le=[`ArrowDown`,`PageUp`,`Home`],ue=[`ArrowUp`,`PageDown`,`End`],de=[...le,...ue],fe={ltr:[...M,`ArrowRight`],rtl:[...M,`ArrowLeft`]},N={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},P=`Menu`,[F,pe,me]=r(P),[I,he]=_(P,[me,C,o]),L=C(),ge=o(),[_e,R]=I(P),[ve,z]=I(P),ye=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:s=!0}=e,c=L(t),[l,u]=A.useState(null),d=A.useRef(!1),f=E(o),p=i(a);return A.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,j.jsx)(b,{...c,children:(0,j.jsx)(_e,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,j.jsx)(ve,{scope:t,onClose:A.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:r})})})};ye.displayName=P;var be=`MenuAnchor`,B=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=L(n);return(0,j.jsx)(re,{...i,...r,ref:t})});B.displayName=be;var V=`MenuPortal`,[xe,Se]=I(V,{forceMount:void 0}),Ce=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=R(V,t);return(0,j.jsx)(xe,{scope:t,forceMount:n,children:(0,j.jsx)(T,{present:n||a.open,children:(0,j.jsx)(x,{asChild:!0,container:i,children:r})})})};Ce.displayName=V;var H=`MenuContent`,[we,U]=I(H),Te=A.forwardRef((e,t)=>{let n=Se(H,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=R(H,e.__scopeMenu),o=z(H,e.__scopeMenu);return(0,j.jsx)(F.Provider,{scope:e.__scopeMenu,children:(0,j.jsx)(T,{present:r||a.open,children:(0,j.jsx)(F.Slot,{scope:e.__scopeMenu,children:o.modal?(0,j.jsx)(Ee,{...i,ref:t}):(0,j.jsx)(De,{...i,ref:t})})})})}),Ee=A.forwardRef((e,t)=>{let n=R(H,e.__scopeMenu),r=A.useRef(null),i=h(t,r);return A.useEffect(()=>{let e=r.current;if(e)return se(e)},[]),(0,j.jsx)(W,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:w(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),De=A.forwardRef((e,t)=>{let n=R(H,e.__scopeMenu);return(0,j.jsx)(W,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Oe=u(`MenuContent.ScrollLock`),W=A.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:ee,disableOutsideScroll:te,...g}=e,_=R(H,n),v=z(H,n),ne=L(n),re=ge(n),y=pe(n),[b,x]=A.useState(null),S=A.useRef(null),se=h(t,S,_.onContentChange),C=A.useRef(0),T=A.useRef(``),E=A.useRef(0),D=A.useRef(null),O=A.useRef(`right`),k=A.useRef(0),M=te?oe:A.Fragment,le=te?{as:Oe,allowPinchZoom:!0}:void 0,fe=e=>{let t=T.current+e,n=y().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ct(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){T.current=t,window.clearTimeout(C.current),t!==``&&(C.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};A.useEffect(()=>()=>window.clearTimeout(C.current),[]),ae();let N=A.useCallback(e=>O.current===D.current?.side&&ut(e,D.current?.area),[]);return(0,j.jsx)(we,{scope:n,searchRef:T,onItemEnter:A.useCallback(e=>{N(e)&&e.preventDefault()},[N]),onItemLeave:A.useCallback(e=>{N(e)||(S.current?.focus(),x(null))},[N]),onTriggerLeave:A.useCallback(e=>{N(e)&&e.preventDefault()},[N]),pointerGraceTimerRef:E,onPointerGraceIntentChange:A.useCallback(e=>{D.current=e},[]),children:(0,j.jsx)(M,{...le,children:(0,j.jsx)(ie,{asChild:!0,trapped:i,onMountAutoFocus:w(o,e=>{e.preventDefault(),S.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,j.jsx)(ce,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:ee,children:(0,j.jsx)(a,{asChild:!0,...re,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:b,onCurrentTabStopIdChange:x,onEntryFocus:w(u,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,j.jsx)(l,{role:`menu`,"aria-orientation":`vertical`,"data-state":it(_.open),"data-radix-menu-content":``,dir:v.dir,...ne,...g,ref:se,style:{outline:`none`,...g.style},onKeyDown:w(g.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&fe(e.key));let i=S.current;if(e.target!==i||!de.includes(e.key))return;e.preventDefault();let a=y().filter(e=>!e.disabled).map(e=>e.ref.current);ue.includes(e.key)&&a.reverse(),ot(a)}),onBlur:w(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(C.current),T.current=``)}),onPointerMove:w(e.onPointerMove,Y(e=>{let t=e.target,n=k.current!==e.clientX;e.currentTarget.contains(t)&&n&&(O.current=e.clientX>k.current?`right`:`left`,k.current=e.clientX)}))})})})})})})});Te.displayName=H;var ke=`MenuGroup`,Ae=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,j.jsx)(d.div,{role:`group`,...r,ref:t})});Ae.displayName=ke;var je=`MenuLabel`,Me=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,j.jsx)(d.div,{...r,ref:t})});Me.displayName=je;var G=`MenuItem`,Ne=`menu.itemSelect`,K=A.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=A.useRef(null),o=z(G,e.__scopeMenu),s=U(G,e.__scopeMenu),c=h(t,a),l=A.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Ne,{bubbles:!0,cancelable:!0});e.addEventListener(Ne,e=>r?.(e),{once:!0}),ee(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,j.jsx)(Pe,{...i,ref:c,disabled:n,onClick:w(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:w(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:w(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||M.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});K.displayName=G;var Pe=A.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=U(G,n),c=ge(n),l=A.useRef(null),u=h(t,l),[f,p]=A.useState(!1),[m,ee]=A.useState(``);return A.useEffect(()=>{let e=l.current;e&&ee((e.textContent??``).trim())},[a.children]),(0,j.jsx)(F.ItemSlot,{scope:n,disabled:r,textValue:i??m,children:(0,j.jsx)(s,{asChild:!0,...c,focusable:!r,children:(0,j.jsx)(d.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:u,onPointerMove:w(e.onPointerMove,Y(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:w(e.onPointerLeave,Y(e=>o.onItemLeave(e))),onFocus:w(e.onFocus,()=>p(!0)),onBlur:w(e.onBlur,()=>p(!1))})})})}),Fe=`MenuCheckboxItem`,Ie=A.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,j.jsx)(We,{scope:e.__scopeMenu,checked:n,children:(0,j.jsx)(K,{role:`menuitemcheckbox`,"aria-checked":J(n)?`mixed`:n,...i,ref:t,"data-state":at(n),onSelect:w(i.onSelect,()=>r?.(J(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ie.displayName=Fe;var Le=`MenuRadioGroup`,[Re,ze]=I(Le,{value:void 0,onValueChange:()=>{}}),Be=A.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=E(r);return(0,j.jsx)(Re,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,j.jsx)(Ae,{...i,ref:t})})});Be.displayName=Le;var Ve=`MenuRadioItem`,He=A.forwardRef((e,t)=>{let{value:n,...r}=e,i=ze(Ve,e.__scopeMenu),a=n===i.value;return(0,j.jsx)(We,{scope:e.__scopeMenu,checked:a,children:(0,j.jsx)(K,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":at(a),onSelect:w(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});He.displayName=Ve;var Ue=`MenuItemIndicator`,[We,Ge]=I(Ue,{checked:!1}),Ke=A.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Ge(Ue,n);return(0,j.jsx)(T,{present:r||J(a.checked)||a.checked===!0,children:(0,j.jsx)(d.span,{...i,ref:t,"data-state":at(a.checked)})})});Ke.displayName=Ue;var qe=`MenuSeparator`,Je=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,j.jsx)(d.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Je.displayName=qe;var Ye=`MenuArrow`,Xe=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=L(n);return(0,j.jsx)(te,{...i,...r,ref:t})});Xe.displayName=Ye;var Ze=`MenuSub`,[Qe,$e]=I(Ze),et=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=R(Ze,t),o=L(t),[s,c]=A.useState(null),[l,u]=A.useState(null),d=E(i);return A.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,j.jsx)(b,{...o,children:(0,j.jsx)(_e,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,j.jsx)(Qe,{scope:t,contentId:y(),triggerId:y(),trigger:s,onTriggerChange:c,children:n})})})};et.displayName=Ze;var q=`MenuSubTrigger`,tt=A.forwardRef((e,t)=>{let n=R(q,e.__scopeMenu),r=z(q,e.__scopeMenu),i=$e(q,e.__scopeMenu),a=U(q,e.__scopeMenu),o=A.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=A.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return A.useEffect(()=>u,[u]),A.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,j.jsx)(B,{asChild:!0,...l,children:(0,j.jsx)(Pe,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":it(n.open),...e,ref:m(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:w(e.onPointerMove,Y(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:w(e.onPointerLeave,Y(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:w(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||fe[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});tt.displayName=q;var nt=`MenuSubContent`,rt=A.forwardRef((e,t)=>{let n=Se(H,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=R(H,e.__scopeMenu),o=z(H,e.__scopeMenu),s=$e(nt,e.__scopeMenu),c=A.useRef(null),l=h(t,c);return(0,j.jsx)(F.Provider,{scope:e.__scopeMenu,children:(0,j.jsx)(T,{present:r||a.open,children:(0,j.jsx)(F.Slot,{scope:e.__scopeMenu,children:(0,j.jsx)(W,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:w(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:w(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:w(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=N[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});rt.displayName=nt;function it(e){return e?`open`:`closed`}function J(e){return e===`indeterminate`}function at(e){return J(e)?`indeterminate`:e?`checked`:`unchecked`}function ot(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function st(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ct(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=st(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function lt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ut(e,t){return t?lt({x:e.clientX,y:e.clientY},t):!1}function Y(e){return t=>t.pointerType===`mouse`?e(t):void 0}var dt=ye,ft=B,pt=Ce,mt=Te,ht=Ae,gt=Me,_t=K,vt=Ie,yt=Be,bt=He,xt=Ke,St=Je,Ct=Xe,wt=tt,Tt=rt,X=`DropdownMenu`,[Et,Dt]=_(X,[he]),Z=he(),[Ot,kt]=Et(X),At=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Z(t),l=A.useRef(null),[u,d]=g({prop:i,defaultProp:a??!1,onChange:o,caller:X});return(0,j.jsx)(Ot,{scope:t,triggerId:y(),triggerRef:l,contentId:y(),open:u,onOpenChange:d,onOpenToggle:A.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,j.jsx)(dt,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};At.displayName=X;var jt=`DropdownMenuTrigger`,Mt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=kt(jt,n),o=Z(n);return(0,j.jsx)(ft,{asChild:!0,...o,children:(0,j.jsx)(d.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:m(t,a.triggerRef),onPointerDown:w(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:w(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Mt.displayName=jt;var Nt=`DropdownMenuPortal`,Pt=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Z(t);return(0,j.jsx)(pt,{...r,...n})};Pt.displayName=Nt;var Ft=`DropdownMenuContent`,It=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=kt(Ft,n),a=Z(n),o=A.useRef(!1);return(0,j.jsx)(mt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:w(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:w(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});It.displayName=Ft;var Lt=`DropdownMenuGroup`,Rt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(ht,{...i,...r,ref:t})});Rt.displayName=Lt;var zt=`DropdownMenuLabel`,Bt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(gt,{...i,...r,ref:t})});Bt.displayName=zt;var Vt=`DropdownMenuItem`,Ht=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(_t,{...i,...r,ref:t})});Ht.displayName=Vt;var Ut=`DropdownMenuCheckboxItem`,Wt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(vt,{...i,...r,ref:t})});Wt.displayName=Ut;var Gt=`DropdownMenuRadioGroup`,Kt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(yt,{...i,...r,ref:t})});Kt.displayName=Gt;var qt=`DropdownMenuRadioItem`,Jt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(bt,{...i,...r,ref:t})});Jt.displayName=qt;var Yt=`DropdownMenuItemIndicator`,Xt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(xt,{...i,...r,ref:t})});Xt.displayName=Yt;var Zt=`DropdownMenuSeparator`,Qt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(St,{...i,...r,ref:t})});Qt.displayName=Zt;var $t=`DropdownMenuArrow`,en=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(Ct,{...i,...r,ref:t})});en.displayName=$t;var tn=`DropdownMenuSubTrigger`,nn=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(wt,{...i,...r,ref:t})});nn.displayName=tn;var rn=`DropdownMenuSubContent`,an=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(Tt,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});an.displayName=rn;var on=At,sn=Mt,cn=Pt,ln=It,un=Ht,dn=Qt;function fn({...e}){return(0,j.jsx)(on,{"data-slot":`dropdown-menu`,...e})}function pn({...e}){return(0,j.jsx)(sn,{"data-slot":`dropdown-menu-trigger`,...e})}function mn({className:e,sideOffset:t=4,...n}){return(0,j.jsx)(cn,{children:(0,j.jsx)(ln,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:f(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function Q({className:e,inset:t,variant:n=`default`,...r}){return(0,j.jsx)(un,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:f(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function hn({className:e,...t}){return(0,j.jsx)(dn,{"data-slot":`dropdown-menu-separator`,className:f(`-mx-1 my-1 h-px bg-border`,e),...t})}var $=null,gn=null;function _n(){let[e,t]=(0,A.useState)(()=>$?{...$,isLoading:!1}:{defaultRunMode:`local`,hasFarm:!1,isLoading:!0});return(0,A.useEffect)(()=>{if($){t({...$,isLoading:!1});return}gn||=p().then(e=>{let t=e.config,n=t.farm;$={defaultRunMode:t.defaultRunMode===`farm`?`farm`:`local`,hasFarm:!!n?.provider}}).catch(()=>{$={defaultRunMode:`local`,hasFarm:!1}}).finally(()=>{gn=null}),gn.then(()=>{t({...$,isLoading:!1})})},[]),e}function vn({onRun:e,onRunNoCache:r,onPurgeCache:i,disabled:a=!1,size:o=`default`,className:s,label:c,shortcutKey:l}){let{hasFarm:u}=_n(),d=u||!!r||!!i,p=c??`Run`,m=l?(0,j.jsx)(n,{shortcut:l,className:`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`}):null;return d?(0,j.jsxs)(`div`,{className:f(`inline-flex items-center`,s),children:[(0,j.jsxs)(v,{size:o,disabled:a,onClick:()=>e(!0),className:`rounded-r-none`,children:[(0,j.jsx)(D,{className:`size-4`}),p,m]}),(0,j.jsxs)(fn,{children:[(0,j.jsx)(pn,{asChild:!0,children:(0,j.jsx)(v,{variant:`default`,size:o,disabled:a,className:`rounded-l-none border-l border-l-primary-foreground/20 px-2`,children:(0,j.jsx)(t,{className:`h-4 w-4`})})}),(0,j.jsxs)(mn,{align:`end`,children:[(0,j.jsxs)(Q,{onClick:()=>e(!0),children:[(0,j.jsx)(k,{className:`mr-2 h-4 w-4`}),`Run Local`]}),u&&(0,j.jsxs)(Q,{onClick:()=>e(!1),children:[(0,j.jsx)(O,{className:`mr-2 h-4 w-4`}),`Run on Farm`]}),(r||i)&&(0,j.jsx)(hn,{}),r&&(0,j.jsx)(Q,{onClick:()=>r(!0),children:`Run without cache`}),i&&(0,j.jsx)(Q,{onClick:i,children:`Purge cache`})]})]})]}):(0,j.jsxs)(v,{size:o,disabled:a,onClick:()=>e(!0),className:s,children:[(0,j.jsx)(D,{className:`size-4`}),p,m]})}export{Q as a,O as c,mn as i,_n as n,pn as o,fn as r,k as s,vn as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Yn as e}from"./index-C3AdCkmj.js";var t=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{$n as e,Ft as t,Gt as n,Mt as r,Nt as i}from"./index-C3AdCkmj.js";var a=e(),o={env:`env (.env file)`,inline:`inline (test config)`,suite:`suite (suite config)`,cli:`cli (--var flag)`,capture:`capture (captured from screen)`,hook:`hook (hook output)`,step:`step (set by agent)`,runJS:`runJS (inline JavaScript)`,runHook:`runHook uses the stable hook ID from the configured hooks file`,secret:`secret (runtime only)`};function s(e){switch(e){case`env`:return`bg-blue-500/15 border border-blue-500/20`;case`capture`:return`bg-emerald-500/15 border border-emerald-500/20`;case`cli`:return`bg-purple-500/15 border border-purple-500/20`;case`inline`:return`bg-amber-500/15 border border-amber-500/20`;case`suite`:return`bg-cyan-500/15 border border-cyan-500/20`;case`hook`:return`bg-orange-500/15 border border-orange-500/20`;case`step`:return`bg-teal-500/15 border border-teal-500/20`;case`runJS`:return`bg-yellow-500/15 border border-yellow-500/20`;case`runHook`:return`bg-orange-600/15 border border-orange-600/20`;case`secret`:return`bg-rose-500/15 border border-rose-500/20`;default:return`bg-accent/20 border border-accent/20`}}function c(e){let t=/\[secret:(\w+)\]/g,n=[],r=0,i;for(;(i=t.exec(e))!==null;){let[t,a]=i;i.index>r&&n.push({type:`text`,value:e.slice(r,i.index)}),n.push({type:`pill`,resolvedValue:t,varName:a,namespace:`secret`,templateSyntax:`{{secret:${a}}}`}),r=i.index+t.length}return r<e.length&&n.push({type:`text`,value:e.slice(r)}),n.length>0?n:[{type:`text`,value:e}]}function l(e,t,n){let r=/\{\{(\w+):([^}]*(?:\{[^}]*\}[^}]*)*)\}\}/g,i=[],a;for(;(a=r.exec(e))!==null;)i.push({index:a.index,fullMatch:a[0],namespace:a[1],key:a[2]});if(i.length===0)return t.length>0?[{type:`text`,value:t}]:[];let o=[],s=0;for(let t of i)t.index>s&&o.push({kind:`literal`,text:e.slice(s,t.index)}),t.namespace===`env`?o.push({kind:`env`,varName:t.key,templateSyntax:t.fullMatch}):t.namespace===`secret`?o.push({kind:`secret`,varName:t.key,templateSyntax:t.fullMatch}):o.push({kind:`other`,templateSyntax:t.fullMatch}),s=t.index+t.fullMatch.length;s<e.length&&o.push({kind:`literal`,text:e.slice(s)});let c=[],l=0;for(let e=0;e<o.length;e++){let r=o[e];if(r.kind===`literal`){let e=t.indexOf(r.text,l);e>=0&&(e>l&&c.push({type:`text`,value:t.slice(l,e)}),r.text.length>0&&c.push({type:`text`,value:r.text}),l=e+r.text.length)}else if(r.kind===`env`){let e=n?.[r.varName]?.value??null,i=e??r.templateSyntax,a=t.indexOf(i,l);a>=0&&(a>l&&c.push({type:`text`,value:t.slice(l,a)}),e===null?c.push({type:`text`,value:r.templateSyntax}):c.push({type:`pill`,resolvedValue:i,varName:r.varName,namespace:`env`,templateSyntax:r.templateSyntax}),l=a+i.length)}else if(r.kind===`secret`){let e=`[secret:${r.varName}]`,n=t.indexOf(e,l),i=t.indexOf(r.templateSyntax,l),a=n>=0&&(i===-1||n<=i)?e:r.templateSyntax,o=t.indexOf(a,l);o>=0?(o>l&&c.push({type:`text`,value:t.slice(l,o)}),c.push({type:`pill`,resolvedValue:e,varName:r.varName,namespace:`secret`,templateSyntax:r.templateSyntax}),l=o+a.length):c.push({type:`pill`,resolvedValue:e,varName:r.varName,namespace:`secret`,templateSyntax:r.templateSyntax})}else if(r.kind===`other`){let i=t.length;for(let r=e+1;r<o.length;r++){let e=o[r];if(e.kind===`literal`){let n=t.indexOf(e.text,l);if(n>=0){i=n;break}}else if(e.kind===`env`){let r=n?.[e.varName]?.value;if(r){let e=t.indexOf(r,l);if(e>=0){i=e;break}}}else if(e.kind===`secret`){let n=`[secret:${e.varName}]`,r=t.indexOf(n,l),a=t.indexOf(e.templateSyntax,l),o=r>=0&&(a===-1||r<=a)?r:a;if(o>=0){i=o;break}}}let a=t.slice(l,i),s=r.templateSyntax.match(/^\{\{(\w+):(.+)\}\}$/),u=s?.[1]??`unknown`,d=s?.[2]??r.templateSyntax;c.push({type:`pill`,resolvedValue:a,varName:d,namespace:u,templateSyntax:r.templateSyntax}),l=i}}return l<t.length&&c.push({type:`text`,value:t.slice(l)}),c}function u({step:e}){return(0,a.jsx)(`span`,{className:`flex-1 min-w-0 text-sm break-all`,children:(e.originalStepName?l(e.originalStepName,e.name,e.variableSnapshot):c(e.name)).map((c,l)=>{if(c.type===`text`)return(0,a.jsx)(`span`,{children:c.value},l);let u=e.variableSnapshot?.[c.varName],d=u?o[u.source]??u.source:o[c.namespace]??c.namespace;return(0,a.jsxs)(r,{children:[(0,a.jsx)(t,{asChild:!0,children:(0,a.jsx)(`span`,{className:n(`rounded-sm px-1 py-px cursor-default`,s(u?.source??c.namespace)),"aria-label":`variable: ${c.varName}`,children:c.resolvedValue})}),(0,a.jsx)(i,{className:`max-w-xs`,children:(0,a.jsxs)(`div`,{className:`space-y-1`,children:[(0,a.jsx)(`div`,{className:`text-xs font-medium`,children:c.varName}),(0,a.jsx)(`div`,{className:`text-[10px] font-mono text-muted-foreground`,children:c.templateSyntax}),(0,a.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:c.resolvedValue}),(0,a.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:d})]})})]},l)})})}export{u as n,s as r,o as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{c as t}from"./id-badge-BpTnHwvn.js";import{t as n}from"./monaco-editor-BEWq4fzI.js";import{n as r}from"./split-button-CRYV8xU8.js";import{a as i,c as a,i as o,n as ee,o as te,r as ne,s as re,t as s}from"./filename-validation-wKCpNal3.js";import{t as ie}from"./use-page-title-CsUoFrfG.js";import{a as ae,n as oe}from"./dist-BsGrTrYb.js";import{i as se,n as ce,r as le,t as ue}from"./tabs-BEp-p5jh.js";import{$n as de,Bt as fe,Ct as pe,D as me,Dt as he,E as ge,Ft as c,H as _e,Hn as ve,Lt as ye,Mt as l,Nt as be,Rt as xe,S as Se,Ut as Ce,Vn as u,Vt as we,Xt as Te,dr as Ee,er as d,jt as f,kt as De,lr as Oe,mr as ke,r as Ae,st as je,ur as Me,zt as Ne}from"./index-C3AdCkmj.js";import{n as p,r as Pe,t as Fe}from"./resizable-ugU12HrY.js";import{t as Ie}from"./empty-state-BTFWlITi.js";import{t as Le}from"./use-keyboard-shortcuts-COnAPsDD.js";import{i as Re,n as ze,r as Be,t as Ve}from"./suite-navbar-UATCw4Qb.js";var m=e(ke(),1);function He(e,t){return s(e,t,`suiteMatch`)}var h=de(),Ue=`name: My Suite
|
|
2
|
+
target: ""
|
|
3
|
+
tests: []
|
|
4
|
+
`;function We(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Ge(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`}function Ke({text:e}){return(0,h.jsxs)(l,{children:[(0,h.jsx)(c,{asChild:!0,children:(0,h.jsx)(u,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,h.jsx)(be,{className:`max-w-[250px] text-[13px]`,children:e})]})}function g(){let e=Me()[`suite-id`]??``,s=Oe(),[de]=Ee(),c=Te(),{defaultRunMode:l}=r(),{targets:be,globalUse:u,isLoading:ke}=t(),g=!e,qe=de.get(`live`)===`1`,_=(0,m.useRef)(null),v=(0,m.useRef)(null),Je=(0,m.useRef)(()=>{}),Ye=(0,m.useRef)(!1),y=(0,m.useRef)(null),b=(0,m.useRef)(null),[x,S]=(0,m.useState)(g?Ue:``),[Xe,Ze]=(0,m.useState)(``),[C,Qe]=(0,m.useState)(``),[w,$e]=(0,m.useState)(!g),[T,et]=(0,m.useState)(!1),[tt,nt]=(0,m.useState)(!1),[rt,it]=(0,m.useState)(!1),[at,ot]=(0,m.useState)(!1),[E,st]=(0,m.useState)(null),[ct,lt]=(0,m.useState)(!1),[ut,dt]=(0,m.useState)(!1),[ft,pt]=(0,m.useState)([]),[D,O]=(0,m.useState)(null),[k,A]=(0,m.useState)(null),[j,M]=(0,m.useState)(!1),[N,P]=(0,m.useState)(!1),[F,I]=(0,m.useState)(null),[mt,L]=(0,m.useState)(`reasoning`),[ht,R]=(0,m.useState)(null),[z,B]=(0,m.useState)({setup:[],teardown:[]}),[V,gt]=(0,m.useState)(``),_t=!g&&x!==Xe,vt=g&&C?He(C.trim(),ft):null,H=g&&!!C&&!!vt,{suggestions:yt}=ee(null),bt=(0,m.useMemo)(()=>yt.filter(e=>e.namespace!==`capture`),[yt]),U=(0,m.useMemo)(()=>Be(x),[x]),xt=U?.suiteId??``,W=U?.name||(g?`New Suite`:V),G=o(D,{tests:(0,m.useMemo)(()=>U?U.tests.map(e=>({draftId:e.id,testId:e.id,path:e.test,name:e.test.split(`/`).pop()??e.test,steps:[],setup:[],teardown:[]})):[],[U]),setupHooks:z.setup,teardownHooks:z.teardown,allowReconnect:!1}),K=G.terminateSession;v.current=D,Je.current=K;let St=U?.target?.trim()??``,q=N?`connecting`:G.connectionState,J=D!==null,Y=J&&U!==null&&(!We(U.setup??[],z.setup)||!We(U.teardown??[],z.teardown)),Ct=J&&q===`connected`&&U!==null&&U.tests.length>0,wt=N||J,Tt=N||J||at||E!==null||g||U===null||!U?.target.trim()||ke;ie((0,m.useMemo)(()=>J&&k!==null?`Live #${k} — ${U?.name?.trim()||W||`Suite`}`:g?`New Suite`:`Edit Suite`,[J,k,U?.name,W,g]));let X=(0,m.useMemo)(()=>{if(U)return{suiteName:U.name,suiteContext:U.context||void 0}},[U]),Et=(0,m.useMemo)(()=>F===`ended`?{reason:`ended`,title:`Live session ended`,description:`The current draft is unchanged. Close live mode or start a fresh disposable session from this target.`}:F===`disconnected`?{reason:`disconnected`,title:`Live session disconnected`,description:`The connection dropped and the disposable session was terminated. Start a fresh session to reconnect.`}:null,[F]);(0,m.useEffect)(()=>{if(g)return;let t=!1;return je(e).then(e=>{t||(S(e.content),Ze(e.content),gt(e.path),$e(!1))}).catch(()=>{t||(et(!0),$e(!1))}),()=>{t=!0}},[e,g]),(0,m.useEffect)(()=>{let e=!1;return _e().then(t=>{if(e)return;let n=t.config?.workspace?.suiteMatch;Array.isArray(n)&&pt(n)}).catch(()=>{}),()=>{e=!0}},[]),(0,m.useEffect)(()=>{g&&S(e=>Re(e,[`suite-id`],oe()))},[g]),(0,m.useEffect)(()=>{if(g||w)return;let e=Be(x);e&&!e.suiteId&&S(e=>Re(e,[`suite-id`],oe()))},[g,w,Xe]);let Z=(0,m.useCallback)(async()=>{nt(!0);try{if(g){let e=He(C.trim(),ft);if(e){f.error(e);return}await me(C.trim(),x),f.success(`Suite file created`);let t=U?.suiteId??``;if(!t){f.error(`Created suite is missing suite-id; please reload`);return}s(d.suiteEdit(t))}else await he(e,x),Ze(x),f.success(`Saved`)}catch(e){e instanceof Se&&e.missingTests&&e.missingTests.length>0?f.error(`Cannot save — referenced tests not found: ${e.missingTests.map(e=>e.test).join(`, `)}`):f.error(`Failed to save: ${e instanceof Error?e.message:String(e)}`)}finally{nt(!1)}},[g,C,ft,x,e,U?.suiteId,s]),Dt=(0,m.useCallback)(async()=>{it(!0);try{let e=await De(x);e.valid?f.success(`Valid suite`):f.error(e.errors.map(e=>e.message).join(`
|
|
5
|
+
`))}catch(e){f.error(`Validation failed: ${e instanceof Error?e.message:String(e)}`)}finally{it(!1)}},[x]),Ot=(0,m.useCallback)(async e=>{if(!g){ot(!0);try{st((await pe({file:V,local:e})).runId),f.success(`Suite run started`)}catch(e){f.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`)}finally{ot(!1)}}},[g,V]),kt=(0,m.useCallback)(()=>st(null),[]),At=(0,m.useCallback)(()=>{i(`page`,`closing live mode`,{liveSessionId:D??void 0,terminalReason:F??void 0}),_.current?.abort(),_.current=null,D&&K(),P(!1),O(null),A(null),I(null),R(null),y.current=null,b.current=null,B({setup:[],teardown:[]}),M(!1)},[D,F,K]),jt=(0,m.useCallback)(()=>{i(`page`,`ending live session from UI`,{liveSessionId:D??void 0}),_.current?.abort(),_.current=null,D&&K(),P(!1),O(null),A(null),I(`ended`),R(null),y.current=null,b.current=null,B({setup:[],teardown:[]}),M(!1)},[D,K]),Q=(0,m.useCallback)(async(e,t)=>{let n=e.target.trim();if(!n){f.error(`Select a target before starting live mode`);return}let r=new AbortController;_.current?.abort(),_.current=r,M(!0),I(null),L(`reasoning`),R(null),y.current=null,b.current=null,P(!0);try{t?.replaceCurrentSession&&v.current&&(K(),O(null),A(null));let a=ne({content:x,targetName:n,targets:be,globalUse:u});i(`page`,`requesting live session`,{targetName:n,platform:a.platform,headless:a.headless??void 0,replacingSession:t?.replaceCurrentSession??!1});let o=[...e.setup??[]],ee=[...e.teardown??[]],te=e.suiteId?{type:`suite`,id:e.suiteId}:void 0,{sessionId:re,sessionNumber:s}=await ge({...a,setupHooks:o,teardownHooks:ee,entity:te},r.signal);if(r.signal.aborted)return;B({setup:o,teardown:ee}),O(re),A(s),i(`page`,`live session created`,{sessionId:re,targetName:n})}catch(e){Ge(e)||(i(`page`,`failed to create live session`,{error:e instanceof Error?e.message:String(e),targetName:n}),f.error(e instanceof Error?e.message:`Failed to start live session`)),t?.replaceCurrentSession||M(!1)}finally{_.current===r&&(_.current=null),P(!1)}},[x,u,be,K]),$=(0,m.useCallback)(async()=>{if(!Tt){if(!U){f.error(`Fix YAML errors before starting live mode`);return}await Q(U)}},[U,Q,Tt]),Mt=(0,m.useCallback)(async()=>{if(J){if(!U){f.error(`Fix YAML errors before restarting live mode`);return}await Q(U,{replaceCurrentSession:!0})}},[U,J,Q]),Nt=(0,m.useCallback)(e=>{if(e){M(!0);return}At()},[At]),Pt=(0,m.useCallback)((e,t)=>{if(!J){f.error(`Start a live session first.`);return}let n=(e===`setup`?G.setupHooks:G.teardownHooks).find(e=>e.id===t);n&&R({type:`suite-hook`,phase:e,hookId:n.id}),L(`reasoning`),G.executeHookById(e,t)},[J,G]),Ft=(0,m.useCallback)(e=>{R({type:`test`,testIndex:e}),L(`reasoning`),G.executeTestByIndex(e,X)},[X,G]);if((0,m.useEffect)(()=>()=>{_.current?.abort(),v.current&&Je.current()},[]),(0,m.useEffect)(()=>{D&&q===`disconnected`&&(i(`page`,`live session moved to terminal state`,{liveSessionId:D,liveConnectionState:q}),O(null),A(null),P(!1),I(`disconnected`),R(null),y.current=null,b.current=null,B({setup:[],teardown:[]}),M(!0))},[q,D]),(0,m.useEffect)(()=>{if(!j||G.runningTestIndex===null)return;let e=`${G.tests[G.runningTestIndex]?.testExecutionId??`pending`}:${G.runningTestIndex}`;y.current!==e&&(y.current=e,R({type:`test`,testIndex:G.runningTestIndex}),L(`reasoning`))},[G.runningTestIndex,G.tests,j]),(0,m.useEffect)(()=>{if(!j||G.runningTestIndex!==null)return;let e=G.tests.map((e,t)=>({index:t,test:e})).filter(({test:e})=>e.status===`failed`).sort((e,t)=>(t.test.lastRunAt??``).localeCompare(e.test.lastRunAt??``))[0];if(!e)return;let t=e.test.testExecutionId??e.test.lastRunAt??`failed:${e.index}`;b.current!==t&&(b.current=t,R({type:`test`,testIndex:e.index}),L(`reasoning`))},[G.runningTestIndex,G.tests,j]),(0,m.useEffect)(()=>{!qe||Ye.current||g||w||T||N||j||J||!U||!U.target.trim()||(Ye.current=!0,s(d.suiteEdit(e),{replace:!0}),$())},[U,$,J,g,N,w,j,s,T,e,qe]),Le((0,m.useMemo)(()=>({r:()=>{g||Ot(l===`local`)},escape:()=>{E&&kt()}}),[g,E,Ot,kt,l])),(0,m.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),Z())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Z]),w)return(0,h.jsx)(Ae,{});if(T)return(0,h.jsx)(Ie,{icon:ve,title:`Suite not found`,description:`This suite doesn't exist`,actionLabel:`View All Suites`,onAction:()=>s(d.suites)});let It=(0,h.jsxs)(ue,{defaultValue:`builder`,className:`flex-1 flex min-h-0 flex-col`,children:[(0,h.jsxs)(le,{variant:`line`,className:`px-4`,children:[(0,h.jsx)(se,{value:`builder`,children:`Builder`}),(0,h.jsx)(se,{value:`yaml`,children:`YAML`})]}),(0,h.jsx)(ce,{value:`builder`,className:`mt-2 flex-1 overflow-auto [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-border [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb:hover]:bg-muted-foreground/50 [&::-webkit-scrollbar-track]:bg-transparent [scrollbar-width:thin]`,children:(0,h.jsx)(ze,{content:x,onChange:S,suggestions:bt,isCreateMode:g,liveMode:j,liveTests:G.tests,liveSetupHooks:G.setupHooks,liveTeardownHooks:G.teardownHooks,runningTestIndex:G.runningTestIndex,canRunTest:J&&G.connectionState===`connected`,canRunAll:Ct,isRunningAll:G.isRunningAllTests,isStoppingRunAll:G.isStoppingRunAllTests,onRunTest:Ft,onCancelTest:e=>{G.runningTestIndex===e&&G.cancelStep()},onRunAll:()=>void G.runAllTests(X),onStopAll:G.cancelRunAllTests,setupHooksStale:Y,onRestartSession:Y?()=>void Mt():void 0,selection:ht,onSelect:R,onRunLiveHook:Pt})}),(0,h.jsx)(ce,{value:`yaml`,className:`flex-1 min-h-0 mt-2`,children:(0,h.jsx)(n,{value:x,onChange:S,onSave:Z,className:`h-full`,filePath:V||void 0})})]}),Lt=(0,h.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[g&&(0,h.jsx)(`div`,{className:`px-4 pt-3`,children:(0,h.jsxs)(`div`,{className:`rounded-md border bg-muted/15 px-3 py-2`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,h.jsxs)(ae,{className:`flex items-center gap-1 text-xs font-medium`,children:[`File Path `,(0,h.jsx)(Ke,{text:`Path is relative to your workspace root. Must match your workspace's suiteMatch pattern. Directories are created automatically on save.`})]}),(0,h.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Created only when you save`})]}),(0,h.jsx)(Ce,{placeholder:`my-suite.suite.yaml`,value:C,onChange:e=>Qe(e.target.value),className:`mt-2 max-w-md h-8 text-sm font-mono ${H?`border-red-500 focus-visible:ring-red-500`:``}`}),H&&(0,h.jsx)(`p`,{className:`mt-1 text-xs text-red-500`,children:vt})]})}),It]}),Rt=(0,h.jsx)(te,{connectionState:G.connectionState,isLaunching:N,targetName:St||`Selected Target`,targetLabel:G.currentUrl||`Configured start URL`,liveSessionNumber:k,platform:G.platform,screenshot:G.screenshot,currentUrl:G.currentUrl,pendingNavigation:G.pendingNavigation,steps:G.steps,setupHooks:G.setupHooks,teardownHooks:G.teardownHooks,tests:G.tests,selection:ht,runningStepId:G.runningStepId,terminalState:Et,draftState:U===null?`invalid`:_t||g?`unsaved`:`saved`,ariaTree:G.ariaTree,errorMessage:G.error,devtoolsTab:mt,canRunAll:Ct,isRunningAll:G.isRunningAllTests,isStoppingRunAll:G.isStoppingRunAllTests,setupHooksStale:Y,executionUnit:`test`,runAllLabel:`Run All Tests`,stopAllLabel:`Stop Run All`,unitRowsSlot:null,onDevtoolsTabChange:L,onRunAll:()=>void G.runAllTests(X),onStopAll:G.cancelRunAllTests,onEndSession:jt,onRestartSession:Y?()=>void Mt():void 0,showEndSessionAction:c,onCloseLiveMode:At,onStartFreshSession:()=>void $(),onBack:G.goBack,onForward:G.goForward,onRefresh:G.refreshPage,onNavigate:G.navigate,onRequestAriaTree:G.requestAriaTree});return(0,h.jsxs)(`div`,{className:`flex h-screen flex-col`,children:[(0,h.jsx)(Ve,{suiteName:W,suiteId:xt,unsaved:_t,isCreateMode:g,mode:`edit`,suiteHref:g?void 0:d.suiteView(e),isSaving:tt,isValidating:rt,isRunning:at,runDisabled:wt,hasInvalidFilename:H,shortcutsOpen:ut,hasLiveSession:J,liveConnectionState:q,isLiveActionDisabled:Tt,liveSessionNumber:k,onBack:()=>s(d.suites),onSave:Z,onValidate:Dt,onRun:Ot,onLiveConnect:j?void 0:$,onLiveEnd:J?jt:void 0,onSettingsOpen:()=>lt(!0),onToggleShortcuts:()=>dt(e=>!e)}),E?(0,h.jsxs)(Pe,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,h.jsx)(p,{defaultSize:60,minSize:30,children:(0,h.jsx)(n,{value:x,onChange:S,onSave:Z,className:`h-full`})}),(0,h.jsx)(Fe,{withHandle:!0}),(0,h.jsx)(p,{defaultSize:40,minSize:25,children:(0,h.jsx)(re,{runId:E,onClose:kt})})]}):j&&!c?(0,h.jsxs)(Pe,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,h.jsx)(p,{defaultSize:45,minSize:30,children:Lt}),(0,h.jsx)(Fe,{withHandle:!0}),(0,h.jsx)(p,{defaultSize:55,minSize:40,children:Rt})]}):Lt,(0,h.jsx)(ye,{open:ct,onOpenChange:lt,children:(0,h.jsxs)(xe,{side:`right`,className:`sm:max-w-[400px] overflow-y-auto p-0`,children:[(0,h.jsxs)(fe,{className:`px-4 pt-4 pb-2`,children:[(0,h.jsx)(we,{children:`Suite Settings`}),(0,h.jsx)(Ne,{children:`Advanced configuration for this suite`})]}),(0,h.jsx)(`div`,{className:`px-4 pb-4`,children:(0,h.jsx)(a,{content:x,onChange:S,selectedTarget:U?.target,showMeta:!1})})]})}),c&&(0,h.jsx)(ye,{open:j,onOpenChange:Nt,children:(0,h.jsxs)(xe,{side:`bottom`,showCloseButton:!1,className:`h-[100dvh] max-h-[100dvh] rounded-none p-0`,children:[(0,h.jsxs)(fe,{className:`sr-only`,children:[(0,h.jsx)(we,{children:`Live Session`}),(0,h.jsx)(Ne,{children:`Live execution workspace for the current suite draft.`})]}),Rt]})})]})}export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
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-D0GpDfUa.js";import{t as o}from"./circle-alert-D7wbtVU2.js";import{C as s,S as c,_ as l,a as u,b as d,c as f,d as p,f as m,g as h,h as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,w as D,x as ee,y as te}from"./id-badge-BpTnHwvn.js";import{n as ne,r as O}from"./monaco-editor-BEWq4fzI.js";import{t as re}from"./circle-x-BOV-jCVR.js";import{c as ie,t as k}from"./split-button-CRYV8xU8.js";import{t as ae}from"./grip-vertical-C5AW4fiD.js";import{n as A,r as j,t as M}from"./shortcut-hints-B8kCurzo.js";import{t as oe}from"./plus-Bf5Mbita.js";import{t as N}from"./refresh-cw-D0OwRzvm.js";import{n as P,t as F}from"./textarea-BFsDx2mB.js";import{t as se}from"./square-K8N8Yius.js";import{a as I,n as L}from"./dist-BsGrTrYb.js";import{n as ce,r as R,t as z}from"./popover-OAiTzjiL.js";import{$n as B,Bn as le,Fn as V,Ft as H,Gn as U,Gt as W,In as ue,Mt as G,Nt as K,Pn as de,Ut as fe,Vn as q,Wn as J,Wt as Y,c as pe,cr as X,d as me,ft as he,l as ge,mr as _e,o as ve,s as ye,u as be,zn as xe}from"./index-C3AdCkmj.js";import{t as Se}from"./badge-ClWCtaXi.js";import{t as Ce}from"./display-step-vpHdm2LX.js";var Z=e(_e(),1),Q=B();function we({text:e}){return(0,Q.jsxs)(G,{children:[(0,Q.jsx)(H,{asChild:!0,children:(0,Q.jsx)(q,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,Q.jsx)(K,{className:`max-w-[250px] text-[13px]`,children:e})]})}function Te({name:e,suiteId:o,target:c,context:l,isCreateMode:d,suggestions:p,hookLabels:m={},onChange:h,disabled:g=!1}){let{targets:v,isLoading:y}=_(),{targets:x}=f(),S=c?x[c]:void 0,w=(0,Z.useRef)(null),[T,E]=(0,Z.useState)(0),D=u({text:l,cursorPos:T,suggestions:p,anchorRef:w,onInsert:(e,t,n)=>{h(`context`,l.slice(0,t)+e+l.slice(n)),requestAnimationFrame(()=>w.current?.focus())}}),ee=!y&&v.length>0;return(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(I,{htmlFor:`suite-name`,className:`text-xs flex items-center gap-1`,children:[`Suite Name `,(0,Q.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,Q.jsx)(fe,{id:`suite-name`,value:e,onChange:e=>h(`name`,e.target.value),placeholder:`My Suite`,required:!0,disabled:g,className:`h-8 text-sm`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(I,{htmlFor:`suite-id`,className:`text-xs flex items-center gap-1`,children:[`Suite ID `,(0,Q.jsx)(we,{text:`Unique identifier used for memory and analytics. Changing this breaks the association with past runs and observations.`})]}),d?(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(fe,{id:`suite-id`,value:o,readOnly:!0,disabled:!0,className:`h-8 text-sm font-mono pr-9`}),(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>h(`suite-id`,L()),"aria-label":`Generate new ID`,disabled:g,className:`absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6`,children:(0,Q.jsx)(N,{className:`size-3.5`})})]}):(0,Q.jsx)(`p`,{className:`text-[13px] font-mono text-muted-foreground`,children:o||`No ID assigned`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(I,{htmlFor:`suite-target`,className:`text-xs flex items-center gap-1`,children:[`Target `,(0,Q.jsx)(`span`,{className:`text-destructive`,children:`*`}),` `,(0,Q.jsx)(we,{text:`A registered app target from your workspace config. Defines where the suite runs (web URL or mobile app).`})]}),ee?(0,Q.jsxs)(a,{value:c||void 0,onValueChange:e=>h(`target`,e),disabled:g,children:[(0,Q.jsx)(r,{id:`suite-target`,className:`w-full h-8 text-sm`,children:(0,Q.jsx)(i,{placeholder:`Select a target`})}),(0,Q.jsx)(n,{children:v.map(e=>(0,Q.jsx)(t,{value:e,children:e},e))})]}):y?null:(0,Q.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No targets configured.`,` `,(0,Q.jsx)(X,{to:`/config`,className:`text-primary underline underline-offset-4 hover:text-primary/80`,children:`Add targets in Settings.`})]}),S&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px] text-muted-foreground mt-1.5`,children:[S.platform===`web`?(0,Q.jsx)(ie,{className:`h-3.5 w-3.5 shrink-0`}):(0,Q.jsx)(s,{className:`h-3.5 w-3.5 shrink-0`}),(0,Q.jsx)(`span`,{className:`text-muted-foreground/70 uppercase text-[11px] tracking-wider shrink-0`,children:S.platform}),(0,Q.jsxs)(`span`,{className:`font-mono truncate`,children:[S.product&&(0,Q.jsx)(`span`,{className:`mr-1.5`,children:S.product}),S.platform===`web`&&S.url,S.platform===`android`&&`${S.appPackage}${S.appActivity?` / ${S.appActivity}`:``}`,S.platform===`ios`&&S.bundleId]})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(I,{htmlFor:`suite-context`,className:`text-xs flex items-center gap-1`,children:[`Context `,(0,Q.jsx)(we,{text:`Additional instructions passed to every test in this suite before its own context. Use this for suite-wide setup notes or shared preconditions.`})]}),(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(F,{ref:w,id:`suite-context`,value:l,onChange:e=>{h(`context`,e.target.value),E(e.target.selectionStart??0)},onKeyDown:e=>{D.handleKeyDown(e)},onBlur:()=>setTimeout(()=>D.setVisible(!1),150),placeholder:`Additional instructions applied to every test in this suite...`,disabled:g,className:`min-h-[60px] resize-none text-sm`,rows:2}),D.dropdown]}),C(l)&&(0,Q.jsx)(b,{text:l,hookLabels:m})]})]})}function Ee(e){if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<10?`${t.toFixed(1)}s`:`${Math.round(t)}s`}function De({status:e}){switch(e){case`running`:return(0,Q.jsx)(D,{className:`size-3 text-primary`});case`passed`:return(0,Q.jsx)(J,{className:`size-3 text-emerald-500`});case`failed`:return(0,Q.jsx)(ue,{className:`size-3 text-destructive`});default:return(0,Q.jsx)(V,{className:`size-3 text-muted-foreground`})}}function Oe({status:e}){switch(e){case`running`:case`cancelling`:return(0,Q.jsx)(D,{className:`size-3 text-primary`});case`passed`:return(0,Q.jsx)(J,{className:`size-3 text-emerald-500`});case`failed`:return(0,Q.jsx)(re,{className:`size-3 text-red-500`});case`cancelled`:return(0,Q.jsx)(se,{className:`size-3 text-amber-500`});default:return(0,Q.jsx)(D,{className:`size-3 text-muted-foreground/50`})}}function ke(e){return e.observation?e.observation:e.reasoning?e.reasoning:e.plannedAction==null?e.verifierReasoning?e.verifierReasoning:e.result:`Planned action captured`}function Ae({id:e,name:t,path:n,testId:r,isMissing:i,onRemove:a,disabled:o=!1,actionsLocked:s=!1,sortableDisabled:l=!1,liveMode:u=!1,liveStatus:d=`idle`,liveDuration:f,liveError:p=null,liveSteps:m=[],runningStepIndex:h=null,perTestSetupHooks:g=[],perTestTeardownHooks:_=[],canRunTest:y=!0,onRunTest:b,onCancelTest:x,testIndex:S,selection:C=null,onSelect:w}){let{attributes:T,listeners:E,setNodeRef:ee,transform:te,transition:ne,isDragging:O}=v({id:e,disabled:o||l}),ie={transform:c.Transform.toString(te),transition:ne,opacity:O?.55:1,zIndex:O?10:void 0},k=u&&d===`running`,A=u&&d===`passed`,j=u&&d===`failed`,M=u&&(A||j||u&&d===`cancelled`)&&f!=null,oe=u&&C?.type===`test`&&S!==void 0&&C.testIndex===S,N=u&&g.length+_.length>0,P=u?m.map(e=>({step:e,displayStep:Ce(e,e.stepIndex)})):[],F=C&&`stepId`in C?C.stepId:null,I=C?.type===`subaction`?C.subIndex:null;return(0,Q.jsxs)(`div`,{ref:ee,style:ie,className:W(`relative overflow-hidden flex flex-col gap-0.5 rounded-md border bg-card/60 px-3 py-2 hover:bg-card transition-colors`,i&&`border-amber-500/30`,i&&`bg-amber-500/[0.06]`,!i&&`border-border/70`,O&&`shadow-lg ring-2 ring-primary/20`,o&&`opacity-60`,k&&`live-running-surface border-border/60 bg-primary/5`,j&&!k&&`border-destructive/30`,j&&!k&&!oe&&`ring-1 ring-destructive/20`,oe&&!k&&`bg-primary/10 ring-1 ring-primary/30`),children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`mt-0.5 flex shrink-0 items-center p-0.5 text-muted-foreground/40 hover:text-muted-foreground cursor-grab active:cursor-grabbing touch-none disabled:cursor-not-allowed`,...T,...E,"aria-label":`Reorder ${t}`,"aria-disabled":o||l,disabled:o||l,children:(0,Q.jsx)(ae,{className:`size-3.5`})}),k&&(0,Q.jsx)(D,{className:`size-4 shrink-0 mt-0.5 text-primary`}),A&&(0,Q.jsx)(J,{className:`size-3.5 text-emerald-500 shrink-0 mt-1`}),j&&(0,Q.jsx)(re,{className:`size-3.5 text-red-500 shrink-0 mt-1`}),(0,Q.jsxs)(`div`,{className:W(`flex-1 min-w-0 space-y-0.5`,u&&w&&`cursor-pointer`),onClick:u&&w&&S!==void 0?()=>w({type:`test`,testIndex:S}):void 0,children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-foreground truncate`,children:t}),(0,Q.jsx)(`div`,{className:`text-[11px] font-mono text-muted-foreground truncate`,children:n}),(0,Q.jsx)(`div`,{className:`text-[10px] font-mono text-muted-foreground/70 truncate`,children:r}),P.length>0&&(0,Q.jsx)(`div`,{className:`mt-1.5 space-y-1.5`,children:P.map(({step:e,displayStep:t},n)=>{let r=e.status===`running`||h===e.stepIndex,i=oe&&F===null&&(r||h===null&&n===P.length-1),a=F===e.id||i,o=t.subActionsData??[];return(0,Q.jsxs)(`div`,{className:W(`relative overflow-hidden rounded-sm border bg-background/60`,r?`live-running-surface border-border/60 bg-primary/5`:a?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-border/60`),children:[(0,Q.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-center gap-2 px-2 py-1.5 text-left`,onClick:t=>{t.stopPropagation(),w?.({type:`step`,stepId:e.id})},"aria-label":`Select step ${e.stepIndex+1} ${e.instruction}`,children:[(0,Q.jsx)(Oe,{status:e.status}),(0,Q.jsxs)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:[`Step `,e.stepIndex+1]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-foreground`,children:e.instruction})]}),(r||a)&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-x-2 gap-y-0.5 px-2 pb-1 text-[11px] text-muted-foreground`,children:[r&&(0,Q.jsx)(`span`,{children:`Current step`}),a&&(0,Q.jsx)(`span`,{children:`Inspecting below`})]}),o.length>0&&(0,Q.jsx)(`div`,{className:`space-y-1 border-t border-border/50 px-2 py-1.5`,children:o.map(t=>(0,Q.jsxs)(`button`,{type:`button`,className:W(`flex w-full min-w-0 items-center gap-2 rounded-sm px-1.5 py-1 text-left text-[11px] transition-colors`,a&&I===t.index?`bg-primary/15 text-foreground`:`text-muted-foreground hover:bg-muted/40`),onClick:n=>{n.stopPropagation(),w?.({type:`subaction`,stepId:e.id,subIndex:t.index})},"aria-label":`Select sub-action ${t.index+1} for step ${e.stepIndex+1}`,children:[(0,Q.jsxs)(`span`,{className:`shrink-0 font-medium`,children:[`Sub `,t.index+1]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:ke(t)})]},`${e.id}-sub-${t.index}`))})]},e.id)})}),i&&(0,Q.jsx)(`div`,{className:`text-[11px] text-amber-700 dark:text-amber-300`,children:`This test file no longer exists in your workspace.`})]}),(0,Q.jsxs)(`div`,{className:`mt-0.5 flex shrink-0 self-start items-center gap-1`,children:[M&&(0,Q.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground whitespace-nowrap shrink-0`,children:Ee(f)}),u&&!k&&(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:b,disabled:!y||!b||s,className:W(`text-muted-foreground hover:text-foreground`,(!y||!b||s)&&`text-muted-foreground/30`),"aria-label":d===`idle`?`Run test ${t}`:`Re-run test ${t}`,children:(0,Q.jsx)(xe,{className:`size-3.5`})}),u&&k&&x&&(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:x,className:`text-muted-foreground hover:text-foreground`,"aria-label":`Cancel test ${t}`,children:(0,Q.jsx)(se,{className:`size-3`})}),(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-destructive`,onClick:a,disabled:o||s,"aria-label":`Remove ${t}`,children:(0,Q.jsx)(de,{className:`size-3.5`})})]})]}),j&&p&&(0,Q.jsxs)(`p`,{className:`text-destructive text-xs mt-1 ml-7 line-clamp-2`,children:[p,` — see Reasoning tab for details`]}),N&&(0,Q.jsxs)(`ul`,{className:`mt-1.5 space-y-1 pl-5`,children:[g.map(e=>{let t=C?.type===`test-hook`&&C.hookId===e.id;return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>S!==void 0&&w?.({type:`test-hook`,testIndex:S,phase:`setup`,hookId:e.id}),className:W(`relative flex w-full items-center gap-2 overflow-hidden rounded-sm border px-1.5 py-0.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-transparent bg-transparent hover:bg-muted/40`),children:[(0,Q.jsx)(V,{className:`size-3 text-muted-foreground shrink-0`}),(0,Q.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate flex-1`,children:[`setup: `,e.name]}),(0,Q.jsx)(De,{status:e.status})]})},`setup-${e.id}`)}),_.map(e=>{let t=C?.type===`test-hook`&&C.hookId===e.id;return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>S!==void 0&&w?.({type:`test-hook`,testIndex:S,phase:`teardown`,hookId:e.id}),className:W(`relative flex w-full items-center gap-2 overflow-hidden rounded-sm border px-1.5 py-0.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-transparent bg-transparent hover:bg-muted/40`),children:[(0,Q.jsx)(V,{className:`size-3 text-muted-foreground shrink-0`}),(0,Q.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate flex-1`,children:[`teardown: `,e.name]}),(0,Q.jsx)(De,{status:e.status})]})},`teardown-${e.id}`)})]})]})}function je({availableTests:e,onAdd:t,disabled:n=!1}){return e.length===0?(0,Q.jsxs)(`div`,{className:`rounded-md border bg-card/20 p-3 text-sm text-muted-foreground`,children:[`No test files found.`,` `,(0,Q.jsx)(X,{to:`/tests/new`,className:`text-primary underline underline-offset-4 hover:text-primary/80`,children:`Create a test first.`})]}):(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(ve,{className:`rounded-md border`,children:[(0,Q.jsx)(ge,{placeholder:`Search by test name, path, or ID...`,disabled:n}),(0,Q.jsxs)(me,{className:`max-h-64`,children:[(0,Q.jsx)(ye,{children:`No tests match your query.`}),(0,Q.jsx)(pe,{children:e.map(e=>(0,Q.jsx)(be,{value:`${e.name} ${e.path} ${e.testId??``}`,onSelect:()=>t({test:e.path,id:e.testId??``}),disabled:n,className:`px-2 py-1.5`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-0.5 w-full min-w-0`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e.name}),(0,Q.jsx)(`span`,{className:`text-[11px] font-mono text-muted-foreground truncate`,children:e.path}),(0,Q.jsx)(`span`,{className:`text-[10px] font-mono text-muted-foreground/70 truncate`,children:e.testId??``})]})},e.path))})]})]}),(0,Q.jsx)(`p`,{className:`text-[10px] text-muted-foreground/60`,children:`Type to filter by name, path, or test ID. Click to add. Same test can be added multiple times.`})]})}var $=[`name`,`suite-id`,`target`,`use`,`context`,`setup`,`tests`,`teardown`];function Me(e){function t(e,n){if(S(e)){n?e.items.sort((e,t)=>{let n=$.indexOf(String(e.key)),r=$.indexOf(String(t.key));return(n===-1?$.length:n)-(r===-1?$.length:r)}):e.items.sort((e,t)=>String(e.key).localeCompare(String(t.key)));for(let n of e.items)t(n.value,!1)}}t(e.contents,!0)}function Ne(e){return Me(e),e.toString()}function Pe(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Fe(e){return Array.isArray(e)?e.map(e=>{if(e&&typeof e==`object`&&`test`in e&&`id`in e){let t=e;if(typeof t.test==`string`&&typeof t.id==`string`)return{test:t.test,id:t.id}}return null}).filter(e=>e!==null):[]}function Ie(e){try{let t=y(e);if(t.errors.length>0)return null;let n=t.toJSON();return!n||typeof n!=`object`?null:{name:n.name??``,suiteId:n[`suite-id`]??``,target:n.target??``,context:n.context??``,setup:Pe(n.setup),teardown:Pe(n.teardown),tests:Fe(n.tests)}}catch{return null}}function Le(e,t,n){try{let r=y(e);return n===void 0||Array.isArray(n)&&n.length===0||n===``?r.deleteIn(t):r.setIn(t,n),Ne(r)}catch{return e}}function Re(e,t,n){try{if(t===n||t<0||n<0)return e;let r=y(e),i=Fe(r.toJSON()?.tests);if(t>=i.length||n>=i.length)return e;let a=[...i],[o]=a.splice(t,1);return a.splice(n,0,o),r.setIn([`tests`],a),Ne(r)}catch{return e}}function ze(e,t){try{let n=y(e),r=Fe(n.toJSON()?.tests);return n.setIn([`tests`],[...r,t]),Ne(n)}catch{return e}}function Be(e,t){try{let n=y(e),r=Fe(n.toJSON()?.tests);if(t<0||t>=r.length)return e;let i=r.filter((e,n)=>n!==t);return i.length===0?n.deleteIn([`tests`]):n.setIn([`tests`],i),Ne(n)}catch{return e}}function Ve({text:e}){return(0,Q.jsxs)(G,{children:[(0,Q.jsx)(H,{asChild:!0,children:(0,Q.jsx)(q,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,Q.jsx)(K,{className:`max-w-[250px] text-[13px]`,children:e})]})}function He({status:e}){switch(e){case`running`:return(0,Q.jsx)(D,{className:`size-3.5 text-primary`});case`passed`:return(0,Q.jsx)(J,{className:`size-3.5 text-emerald-500`});case`failed`:return(0,Q.jsx)(ue,{className:`size-3.5 text-destructive`});default:return(0,Q.jsx)(V,{className:`size-3.5 text-muted-foreground`})}}function Ue(e){return e===`running`||e===`cancelling`}function We(e){return e===`running`||e===`cancelling`}function Ge(e){return e===`running`}function Ke(e){return e.some(e=>Ge(e.status))}function qe(e){return Ue(e.status)||e.runningStepIndex!==null||e.liveSteps.some(e=>We(e.status))||Ke(e.perTestSetupHooks)||Ke(e.perTestTeardownHooks)}function Je({title:e,hooks:t,selection:n,onSelect:r}){return t.length===0?null:(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider font-medium text-muted-foreground`,children:e}),(0,Q.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>{let t=n?.type===`suite-hook`&&n.hookId===e.id;return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>r?.({type:`suite-hook`,phase:e.phase,hookId:e.id}),className:W(`relative flex w-full items-center gap-2 overflow-hidden rounded-md border px-3 py-1.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-border/60 bg-card/40 hover:bg-card/60`),children:[(0,Q.jsx)(He,{status:e.status}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`truncate text-sm`,children:e.name}),(0,Q.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.id})]})]})},e.id)})})]})}function Ye({content:e,onChange:t,disabled:n=!1,suggestions:r,isCreateMode:i=!1,liveMode:a=!1,liveTests:s=[],liveSetupHooks:c=[],liveTeardownHooks:u=[],runningTestIndex:f=null,canRunTest:_=!0,canRunAll:v=!1,isRunningAll:y=!1,isStoppingRunAll:b=!1,onRunTest:S,onCancelTest:C,onRunAll:w,onStopAll:D,onRunLiveHook:ne,setupHooksStale:re=!1,onRestartSession:ie,selection:k=null,onSelect:ae}){let A=(0,Z.useRef)(null),{hooks:j,warningCopy:M}=T(),N=j??[],P=(0,Z.useMemo)(()=>Object.fromEntries(N.map(e=>[e.id,e.name])),[N]),[F,I]=(0,Z.useState)([]),[L,ce]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{he().then(e=>I(e.files)).catch(()=>{})},[]),(0,Z.useEffect)(()=>{if(!L)return;function e(e){e.key===`Escape`&&ce(!1)}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[L]);let R=Ie(e),z=R===null,B=R??A.current;R&&(A.current=R);let H=ee(d(E,{activationConstraint:{distance:8}}),d(l,{coordinateGetter:x})),U=(0,Z.useCallback)((n,r)=>{t(Le(e,[n],r))},[e,t]),W=(0,Z.useCallback)(n=>{t(ze(e,n))},[e,t]),G=(0,Z.useCallback)(n=>{t(Be(e,n))},[e,t]),K=B?.tests.map((e,t)=>`test-${t}`)??[],de=a&&(y||b),fe=a&&(f!==null||s.some(e=>qe(e))||Ke(c)||Ke(u)),q=de||fe,J=de,pe=n||z||q,X=(0,Z.useCallback)(r=>{if(n||z||q)return;let{active:i,over:a}=r;if(!a||i.id===a.id)return;let o=parseInt(String(i.id).replace(`test-`,``),10),s=parseInt(String(a.id).replace(`test-`,``),10);if(Number.isNaN(o)||Number.isNaN(s))return;let c=Re(e,o,s);c!==e&&t(c)},[e,n,t,q,z]);return(0,Q.jsx)(`div`,{className:`flex flex-col`,children:(0,Q.jsxs)(`div`,{className:`space-y-4 p-4`,children:[z&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive`,children:[(0,Q.jsx)(o,{className:`size-4 shrink-0`}),(0,Q.jsx)(`span`,{children:`YAML has errors — builder shows last valid state`})]}),a&&re&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-700 dark:text-amber-300`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:[(0,Q.jsx)(ue,{className:`mt-0.5 size-4 shrink-0`}),(0,Q.jsx)(`span`,{children:`Setup hooks changed — restart session to re-apply the latest setup and teardown hooks.`})]}),ie&&(0,Q.jsx)(Y,{type:`button`,size:`sm`,className:`shrink-0`,onClick:ie,children:`Restart Live Session`})]}),B?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Te,{name:B.name,suiteId:B.suiteId,target:B.target,context:B.context,isCreateMode:i,suggestions:r,hookLabels:P,onChange:U,disabled:n||z}),a&&(0,Q.jsx)(Je,{title:`Setup Hooks (Live)`,hooks:c,selection:k,onSelect:ae}),(0,Q.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-card/20 p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(V,{className:`size-4 text-muted-foreground`}),(0,Q.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Hooks`})]}),(0,Q.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[B.setup.length+B.teardown.length,` `,B.setup.length+B.teardown.length===1?`hook`:`hooks`]})]}),M&&(0,Q.jsxs)(`div`,{className:`flex gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300`,children:[(0,Q.jsx)(o,{className:`mt-0.5 size-3.5 shrink-0`}),(0,Q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,Q.jsx)(`p`,{className:`font-medium`,children:M.title}),(0,Q.jsx)(`p`,{children:M.body})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Search hook names or paste an h_ ID. Saved as stable ID in YAML. Inline runHook uses the stable hook ID.`}),(0,Q.jsx)(p,{phase:`setup`,label:`Setup`,values:B.setup,suggestions:N,disabled:pe,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>U(`setup`,e)}),(0,Q.jsx)(p,{phase:`teardown`,label:`Teardown`,values:B.teardown,suggestions:N,disabled:pe,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>U(`teardown`,e)})]})]}),a&&(0,Q.jsx)(Je,{title:`Teardown Hooks (Live)`,hooks:u,selection:k,onSelect:ae}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1`,children:[`Tests in Suite`,` `,(0,Q.jsx)(Ve,{text:`Tests run in the order shown. Drag to reorder. The suite fails fast if any referenced test is missing at save.`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[B.tests.length,` `,B.tests.length===1?`test`:`tests`]}),a&&(0,Q.jsx)(Y,{type:`button`,variant:`outline`,size:`sm`,onClick:y?D:w,disabled:b||!y&&!v,children:b?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(le,{className:`size-3.5 animate-spin`}),`Stopping...`]}):y?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(se,{className:`size-3.5`}),`Stop Run All`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(O,{className:`size-3.5`}),`Run All Tests`]})})]})]}),B.tests.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tests added yet. Use the picker below.`}):(0,Q.jsx)(h,{sensors:H,collisionDetection:te,onDragEnd:X,children:(0,Q.jsx)(m,{items:K,strategy:g,children:(0,Q.jsx)(`div`,{className:`space-y-1.5`,children:B.tests.map((e,t)=>{let r=F.find(t=>t.path===e.test),i=r?.name??e.test.split(`/`).pop()??e.test,o=F.length>0&&!r,c=a?s[t]:void 0,l=a?_&&f===null&&!J:!0;return(0,Q.jsx)(Ae,{id:`test-${t}`,name:i,path:e.test,testId:e.id,isMissing:o,onRemove:()=>G(t),disabled:n||z,actionsLocked:J,sortableDisabled:q,liveMode:a,liveStatus:c?.status,liveDuration:c?.duration,liveError:c?.error??null,liveSteps:c?.liveSteps??[],runningStepIndex:c?.runningStepIndex??null,perTestSetupHooks:c?.perTestSetupHooks??[],perTestTeardownHooks:c?.perTestTeardownHooks??[],canRunTest:l,onRunTest:a&&S?()=>S(t):void 0,onCancelTest:a&&C?()=>C(t):void 0,testIndex:t,selection:k,onSelect:ae},`test-${t}`)})})})})]}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Available Tests`}),(0,Q.jsxs)(Y,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>ce(e=>!e),disabled:n||z||J,"aria-expanded":L,"aria-controls":`suite-test-picker-region`,children:[(0,Q.jsx)(oe,{className:`size-3`}),L?`Hide picker`:`Add new test`]})]}),L&&(0,Q.jsx)(`div`,{id:`suite-test-picker-region`,children:(0,Q.jsx)(je,{availableTests:F,onAdd:W,disabled:n||z||J})})]})]}):(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12 text-sm text-muted-foreground`,children:`Enter valid YAML to use the visual builder`})]})})}function Xe({suiteName:e,suiteId:t,unsaved:n,isCreateMode:r,mode:i=`view`,suiteHref:a,isSaving:o,isValidating:s,isRunning:c,runDisabled:l=!1,hasInvalidFilename:u,shortcutsOpen:d,showSuiteId:f=!0,hasLiveSession:p=!1,liveConnectionState:m=`idle`,isLiveActionDisabled:h=!1,liveSessionNumber:g=null,onSave:_,onValidate:v,onRun:y,onLiveConnect:b,onLiveEnd:x,onSettingsOpen:S,onToggleShortcuts:C}){let T=i===`view`&&!r,E=!!b||!!x||p||m===`connecting`,D=!r||E,ee=!r&&!T&&i===`edit`,te=`Start a disposable live session for this suite. Setup hooks run on connect, included tests run serially on a shared browser context, teardown hooks run when the session ends, and changes are not saved automatically.`;return(0,Q.jsxs)(`div`,{"data-testid":`suite-navbar-root`,className:`flex h-14 shrink-0 items-center justify-between border-b px-4 min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,Q.jsx)(X,{to:`/suites`,className:`text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:`Suites`}),(0,Q.jsx)(U,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),r?(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`New Suite`}):a&&!T?(0,Q.jsx)(X,{to:a,className:`truncate text-sm font-medium hover:text-primary transition-colors`,children:e}):(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e}),ee&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(U,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`Edit`})]}),n&&(0,Q.jsx)(Se,{variant:`outline`,className:`text-xs`,children:`Unsaved`}),!T&&!r&&t&&f&&(0,Q.jsx)(w,{label:`S`,value:t})]}),(0,Q.jsx)(`div`,{className:`flex items-center gap-3 shrink-0`,children:T?(0,Q.jsxs)(Q.Fragment,{children:[a?(0,Q.jsx)(Y,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Q.jsxs)(X,{to:a,children:[`Edit`,(0,Q.jsx)(M,{shortcut:`E`})]})}):(0,Q.jsxs)(Y,{variant:`outline`,size:`sm`,disabled:!0,children:[`Edit`,(0,Q.jsx)(M,{shortcut:`E`})]}),(0,Q.jsx)(k,{onRun:y,disabled:c||l,label:c?`Running...`:`Run`,shortcutKey:`R`,size:`sm`}),E&&(0,Q.jsxs)(G,{children:[(0,Q.jsx)(H,{asChild:!0,children:(0,Q.jsxs)(Y,{size:`sm`,onClick:b,disabled:h||!b,children:[m===`connecting`?(0,Q.jsx)(le,{className:`h-3.5 w-3.5 animate-spin`}):(0,Q.jsx)(O,{className:`h-3.5 w-3.5`}),m===`connecting`?`Connecting...`:`Connect Live Session`,(0,Q.jsx)(M,{shortcut:`L`,className:`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`})]})}),(0,Q.jsx)(K,{className:`max-w-sm text-[13px]`,children:te})]}),!r&&(0,Q.jsxs)(z,{open:d,onOpenChange:e=>{e||C()},children:[(0,Q.jsxs)(G,{children:[(0,Q.jsx)(H,{asChild:!0,children:(0,Q.jsx)(R,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,size:`icon-sm`,onClick:C,"aria-label":`Shortcuts`,children:(0,Q.jsx)(j,{className:`h-3.5 w-3.5`})})})}),(0,Q.jsx)(K,{children:`Shortcuts`})]}),(0,Q.jsx)(ce,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,Q.jsx)(`div`,{className:`space-y-3`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,Q.jsx)(A,{hints:[{key:`E`,label:`Edit`},{key:`R`,label:`Run`},{key:`L`,label:`Connect Live Session`}]})]})})})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:v,disabled:s||u,children:[(0,Q.jsx)(J,{className:`h-3.5 w-3.5`}),s?`Validating...`:`Validate`]}),(0,Q.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:_,disabled:o||u,children:[(0,Q.jsx)(ne,{className:`h-3.5 w-3.5`}),o?`Saving...`:`Save`]}),(0,Q.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:S,children:[(0,Q.jsx)(P,{className:`h-3.5 w-3.5`}),`Settings`]}),D&&(0,Q.jsx)(`div`,{className:`h-4 w-px bg-border`}),!r&&(0,Q.jsxs)(G,{children:[(0,Q.jsx)(H,{asChild:!0,children:(0,Q.jsx)(`span`,{className:`inline-flex`,children:(0,Q.jsx)(k,{onRun:y,disabled:c||l||p,label:c?`Running...`:`Run Suite`,size:`sm`})})}),p&&(0,Q.jsx)(K,{children:`End the live session to queue a new suite run.`})]}),E&&(p&&m!==`connecting`?(0,Q.jsxs)(Y,{variant:`destructive`,size:`sm`,onClick:x,disabled:!x,children:[(0,Q.jsx)(se,{className:`h-3.5 w-3.5`}),`End Live Session`]}):(0,Q.jsxs)(G,{children:[(0,Q.jsx)(H,{asChild:!0,children:(0,Q.jsxs)(Y,{size:`sm`,onClick:b,disabled:h||!b,children:[m===`connecting`?(0,Q.jsx)(le,{className:`h-3.5 w-3.5 animate-spin`}):(0,Q.jsx)(O,{className:`h-3.5 w-3.5`}),m===`connecting`?`Connecting...`:`Connect Live Session`]})}),(0,Q.jsx)(K,{className:`max-w-sm text-[13px]`,children:te})]})),!T&&p&&typeof g==`number`&&(m===`connected`||m===`executing`)&&(0,Q.jsxs)(Se,{variant:`outline`,"aria-live":`polite`,className:`text-[10px] tracking-wider font-medium text-muted-foreground bg-muted/50 border-border/50`,children:[`Session #`,g]}),!r&&(0,Q.jsxs)(z,{open:d,onOpenChange:e=>{e||C()},children:[(0,Q.jsxs)(G,{children:[(0,Q.jsx)(H,{asChild:!0,children:(0,Q.jsx)(R,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,size:`icon-sm`,onClick:C,children:(0,Q.jsx)(j,{className:`h-3.5 w-3.5`})})})}),(0,Q.jsx)(K,{children:`Shortcuts`})]}),(0,Q.jsx)(ce,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,Q.jsx)(`div`,{className:`space-y-3`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,Q.jsx)(A,{hints:[{key:`R`,label:`Run suite`},{key:`Cmd+S`,label:`Save`},{key:`Esc`,label:`Close results panel`}]})]})})})]})]})})]})}export{Le as i,Ye as n,Ie as r,Xe as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-BEWq4fzI.js";import{t as n}from"./file-code-DxVUPin2.js";import{n as r}from"./split-button-CRYV8xU8.js";import{t as i}from"./zap-Dx2CqraS.js";import{t as a}from"./use-page-title-CsUoFrfG.js";import{a as o,n as s,o as ee,t as c}from"./insights-line-grid-X5lNbmTY.js";import{i as l,n as u,r as d,t as f}from"./tabs-BEp-p5jh.js";import{$n as p,Ct as te,Ft as m,Jt as h,Kt as g,Mt as ne,Nt as _,Pt as re,Wt as v,Yt as y,cr as b,dr as ie,er as x,jt as S,lr as ae,mr as C,ot as oe,qt as w,r as se,st as ce,ur as le}from"./index-C3AdCkmj.js";import{t as T}from"./badge-ClWCtaXi.js";import{a as E,i as D,n as O,o as k,r as A,t as j}from"./table-BOjrxBBL.js";import{t as ue}from"./empty-state-BTFWlITi.js";import{t as de}from"./use-keyboard-shortcuts-COnAPsDD.js";import{n as fe,t as pe}from"./suite-navbar-UATCw4Qb.js";import{n as M,r as me,t as he}from"./viewer-url-state-PwkMc-qK.js";var N=e(C(),1),P=p(),ge=[`builder`,`yaml`,`memory`];function _e(e){let t=e.trim();return t.length>=2&&(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))?t.slice(1,-1).trim():t}function F(e){return{suiteId:e,total:0,flakyScore:0,isFlaky:!1,runs:[],trends:{daily:[],passRate:0,totalRuns:0,avgDuration:0}}}function I(e){if(!e)return``;let t=new Date(y(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`:g(e)}function L({status:e}){switch(e){case`passed`:return(0,P.jsx)(T,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,P.jsx)(T,{variant:`destructive`,children:`Failed`});case`healed`:return(0,P.jsx)(T,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,P.jsx)(T,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,P.jsx)(T,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,P.jsx)(T,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,P.jsx)(T,{variant:`outline`,children:e})}}function R({configured:e,mode:t,scopedCount:n,totalCount:r,onModeChange:i}){return e?(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[`scoped`,`all`].map(e=>(0,P.jsx)(v,{type:`button`,size:`xs`,variant:t===e?`default`:`ghost`,"aria-pressed":t===e,className:`h-7 rounded-[2px] px-2 text-xs`,onClick:()=>i(e),children:e===`scoped`?`Scoped`:`All runs`},e))}),(0,P.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` scoped / `,r,` total runs`]})]}):(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No analytics scope configured`})}function z({runs:e,compactDate:t=!1}){return e.length===0?(0,P.jsx)(`div`,{className:`flex items-center justify-center h-16 text-sm text-muted-foreground`,children:`No runs yet`}):(0,P.jsxs)(j,{children:[(0,P.jsx)(E,{children:(0,P.jsxs)(k,{children:[(0,P.jsx)(D,{children:`Status`}),(0,P.jsx)(D,{children:`Duration`}),(0,P.jsx)(D,{children:`Date`})]})}),(0,P.jsx)(O,{children:e.map(e=>(0,P.jsxs)(k,{className:`relative cursor-pointer hover:bg-muted/50`,children:[(0,P.jsxs)(A,{children:[(0,P.jsx)(b,{to:x.runDetailOrLive(e.id,e.status),className:`absolute inset-0`,tabIndex:-1}),(0,P.jsx)(L,{status:e.status})]}),(0,P.jsx)(A,{children:e.status===`running`?(0,P.jsx)(`span`,{className:`text-blue-500 text-sm`,children:`In progress...`}):(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:h(e.duration)})}),(0,P.jsx)(A,{children:t?(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:I(e.createdAt)}):(0,P.jsxs)(ne,{children:[(0,P.jsx)(m,{asChild:!0,children:(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:g(e.createdAt)})}),(0,P.jsx)(_,{children:w(e.createdAt)})]})})]},e.id))})]})}function B(){let e=le(),p=ae(),[m,g]=ie(),{defaultRunMode:ne}=r(),_=e[`suite-id`]??``,v=(0,N.useMemo)(()=>he(m,ge),[m]),y=(0,N.useMemo)(()=>M(v,m),[m,v]),b=v.tab,C=v.view,[w,E]=(0,N.useState)(``),[D,O]=(0,N.useState)(``),[k,A]=(0,N.useState)(!0),[j,I]=(0,N.useState)(!1),[L,B]=(0,N.useState)(()=>F(_)),[V,H]=(0,N.useState)(`all`),[U,W]=(0,N.useState)(!1),[ve,ye]=(0,N.useState)(!1),G=(0,N.useMemo)(()=>{let e=w.match(/^name:\s*(.+)$/m);return e?_e(e[1]):null},[w]);a(G||`Suite`);let K=L.scope?.configured===!0,q=V===`scoped`&&K&&L.scopedTrends?L.scopedTrends:L.trends,J=V===`scoped`&&K&&L.scopedFlakyScore!==void 0?L.scopedFlakyScore:L.flakyScore,be=V===`scoped`&&K?L.scopedRuns??[]:L.runs,xe=(0,N.useMemo)(()=>q.daily.map(e=>({date:e.date,passRate:e.total>0?Math.round(e.passed/e.total*1e3)/10:0})),[q]),Se=(0,N.useMemo)(()=>L.trends.daily.map(e=>({date:e.date,duration:e.avgDuration})),[L]),Y=be;(0,N.useEffect)(()=>{H(L.scope?.configured?`scoped`:`all`)},[L]),(0,N.useEffect)(()=>{y.toString()!==m.toString()&&g(y,{replace:!0})},[y,m,g]),(0,N.useEffect)(()=>{if(!_){I(!0),A(!1),B(F(``));return}let e=!1;return A(!0),I(!1),E(``),O(``),B(F(_)),ce(_).then(t=>{e||(E(t.content),O(t.path))}).catch(()=>{e||(I(!0),S.error(`Failed to load suite file`))}).finally(()=>{e||A(!1)}),()=>{e=!0}},[_]),(0,N.useEffect)(()=>{if(!_)return;let e=!1;return oe(_,{limit:50}).then(t=>{e||B(t)}).catch(()=>{e||B(F(_))}),()=>{e=!0}},[_]);let X=async e=>{if(!(U||!D)){W(!0);try{let t=await te({file:D,local:e});S.success(`Run started`),p(x.runLive(t.runId))}catch(e){S.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`)}finally{W(!1)}}},Z=x.suiteEdit(_),Q=`${Z}?live=1`;de({e:()=>p(Z),r:()=>{D&&X(ne===`local`)},l:()=>p(Q)});let $=e=>{g(M(e,m),{replace:!0})};if(k)return(0,P.jsx)(se,{});if(j)return(0,P.jsx)(ue,{icon:n,title:`Suite not found`,description:`This suite doesn't exist`,actionLabel:`View All Suites`,onAction:()=>p(x.suites)});let Ce=(0,P.jsx)(fe,{content:w,onChange:()=>{},disabled:!0,suggestions:[]}),we=(0,P.jsx)(t,{value:w,onChange:()=>{},readOnly:!0,className:`h-full`}),Te=(0,P.jsxs)(`aside`,{"data-testid":`suite-detail-analytics-sidebar`,className:`flex flex-col gap-0 overflow-y-auto border-t border-border md:border-t-0 md:border-l md:border-border`,children:[(0,P.jsx)(`div`,{className:`border-b border-border px-3 py-2`,children:(0,P.jsx)(R,{configured:K,mode:V,scopedCount:L.scope?.scopedCount??0,totalCount:L.scope?.totalCount??L.total,onModeChange:H})}),(0,P.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 border-x-0 border-t-0`,children:[(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Pass Rate`}),(0,P.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[Math.round(q.passRate*100),`%`]})]}),(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Avg Duration`}),(0,P.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:h(L.trends.avgDuration)})]}),(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Total Runs`}),(0,P.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:L.total.toLocaleString()})]}),(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Flaky Score`}),(0,P.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[(J*100).toFixed(0),`%`]})]})]}),(0,P.jsx)(s,{className:`border-x-0 border-y-0`,children:(0,P.jsxs)(c,{className:`flex flex-col gap-2 px-3 py-3`,children:[(0,P.jsxs)(`span`,{className:`text-sm font-medium text-foreground`,children:[V===`scoped`&&K?`Scoped Runs`:`All Runs`,` (`,Y.length,`)`]}),(0,P.jsx)(z,{runs:Y.slice(0,5),compactDate:!0})]})})]});return(0,P.jsx)(re,{children:(0,P.jsxs)(`div`,{className:`flex flex-col h-screen`,children:[(0,P.jsx)(pe,{suiteName:G||`Suite`,suiteId:_,unsaved:!1,isCreateMode:!1,mode:`view`,suiteHref:Z,isSaving:!1,isValidating:!1,isRunning:U,runDisabled:!D,hasInvalidFilename:!1,shortcutsOpen:ve,showSuiteId:!1,onBack:()=>p(x.suites),onSave:()=>{},onValidate:()=>{},onRun:e=>X(e),onLiveConnect:()=>p(Q),onSettingsOpen:()=>{},onToggleShortcuts:()=>ye(e=>!e)}),(0,P.jsxs)(f,{value:b,onValueChange:e=>$({tab:e,view:C}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,P.jsx)(`div`,{className:`px-4 border-b border-border`,children:(0,P.jsxs)(d,{variant:`line`,children:[(0,P.jsx)(l,{value:`overview`,children:`Overview`}),(0,P.jsx)(l,{value:`insights`,children:`Insights`})]})}),(0,P.jsxs)(u,{value:`overview`,className:`flex-1 min-h-0 mt-0 grid grid-cols-1 md:grid-cols-[minmax(480px,1fr)_minmax(260px,320px)]`,children:[(0,P.jsx)(`div`,{className:`min-w-0 min-h-0 flex flex-col`,children:(0,P.jsxs)(f,{value:C,onValueChange:e=>$({tab:b,view:e}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,P.jsx)(`div`,{className:`border-b border-border`,children:(0,P.jsxs)(d,{variant:`line`,className:`w-full grid grid-cols-3 px-4 md:w-fit md:inline-flex`,children:[(0,P.jsx)(l,{value:`builder`,children:`Builder`}),(0,P.jsx)(l,{value:`yaml`,children:`YAML`}),(0,P.jsx)(l,{value:`memory`,children:`Memory`})]})}),(0,P.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[(0,P.jsx)(u,{value:`builder`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:Ce}),(0,P.jsx)(u,{value:`yaml`,className:`absolute inset-0 data-[state=inactive]:hidden`,children:we}),(0,P.jsx)(u,{value:`memory`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:(0,P.jsx)(me,{scope:`suite`,scopeId:_,emptyTitle:`No suite memory yet`,emptyDescription:`This suite doesn't have cataloged observations in this workspace yet. Run the suite with memory enabled, then reopen this tab.`})})]})]})}),Te]}),(0,P.jsx)(u,{value:`insights`,className:`flex-1 overflow-y-auto mt-0`,children:(0,P.jsxs)(`div`,{"data-testid":`suite-detail-insights`,className:`space-y-3 px-4 py-3`,children:[L.isFlaky&&(0,P.jsxs)(T,{variant:`destructive`,children:[(0,P.jsx)(i,{className:`size-3`}),`Flaky (score: `,L.flakyScore.toFixed(2),`)`]}),(0,P.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 md:grid-cols-4`,children:[(0,P.jsx)(c,{className:`border-b border-border md:border-b-0`,children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Total Runs`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:L.total.toLocaleString()})]})}),(0,P.jsx)(c,{className:`border-b border-border md:border-b-0 md:border-r`,children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pass Rate`}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:[Math.round(q.passRate*100),`%`]})]})}),(0,P.jsx)(c,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Avg Duration`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:h(L.trends.avgDuration)})]})}),(0,P.jsx)(c,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Flaky Score`}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:[(J*100).toFixed(0),`%`]})]})})]}),(0,P.jsx)(s,{children:(0,P.jsx)(c,{className:`px-4 py-3`,children:(0,P.jsx)(R,{configured:K,mode:V,scopedCount:L.scope?.scopedCount??0,totalCount:L.scope?.totalCount??L.total,onModeChange:H})})}),q.daily.length>0&&(0,P.jsxs)(s,{className:`md:grid-cols-2 md:divide-x md:divide-y-0`,children:[(0,P.jsxs)(c,{className:`px-4 py-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Pass Rate`}),(0,P.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,P.jsx)(ee,{data:xe})})]}),(0,P.jsxs)(c,{className:`px-4 py-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Duration`}),(0,P.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,P.jsx)(o,{data:Se})})]})]}),(0,P.jsx)(s,{children:(0,P.jsxs)(c,{className:`px-4 py-3`,children:[(0,P.jsxs)(`p`,{className:`text-sm font-medium mb-2`,children:[V===`scoped`&&K?`Scoped Runs`:`All Runs`,` (`,Y.length,`)`]}),(0,P.jsx)(z,{runs:Y})]})})]})})]})]})})}export{B as default};
|
|
@@ -1 +1 @@
|
|
|
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,r as c}from"./shortcut-hints-Bs5o743i.js";import{t as ee}from"./plus-pXO98OAE.js";import{t as te}from"./use-page-title-B1t9-5_U.js";import{t as l}from"./batch-action-bar-uEhHVDds.js";import{n as ne,t as re}from"./scroll-area-CnATfQoe.js";import{$n as u,At as d,Gt as ie,Ht as ae,M as oe,Mt as se,Nt as ce,Pt as f,Qn as p,St as m,Ut as h,Vn as le,Wt as g,a as ue,cr as de,jt as fe,nt as pe,pr as _,sr as me,st as he,ur as v}from"./index-Bvtm2F6f.js";import{t as y}from"./badge-DrW2vGVJ.js";import{a as ge,i as _e,n as ve,o as ye,r as be,t as b}from"./lib-58FyJI_k.js";import{a as xe,i as Se,n as Ce,o as x,r as S,t as we}from"./table-D08QBBt4.js";import{t as Te}from"./empty-state-BTvOA5lp.js";import{t as C}from"./use-keyboard-shortcuts-EAppuiKO.js";import{n as w,r as T,t as E}from"./tests-suites-table-widths-DNWnkAjA.js";var D=e(_(),1);function O(){let[e,t]=v(),n=e.get(`status`)??``,r=e.get(`platform`)??``,i=e.get(`sort`)??``,a=e.get(`order`)??`desc`,o=(0,D.useCallback)((e,n)=>{t(t=>{let r=new URLSearchParams(t);return n?r.set(e,n):r.delete(e),r},{replace:!0})},[t]),s=(0,D.useMemo)(()=>i?[{id:i,desc:a===`desc`}]:[],[i,a]),c=(0,D.useRef)(s);return c.current=s,{status:n,platform:r,sort:i,order:a,sorting:s,onSortingChange:(0,D.useCallback)(e=>{let n=typeof e==`function`?e(c.current):e;t(e=>{let t=new URLSearchParams(e);return n.length>0?(t.set(`sort`,n[0].id),t.set(`order`,n[0].desc?`desc`:`asc`)):(t.delete(`sort`),t.delete(`order`)),t},{replace:!0})},[t]),setStatus:(0,D.useCallback)(e=>o(`status`,e),[o]),setPlatform:(0,D.useCallback)(e=>o(`platform`,e),[o])}}var k=p(),Ee=new Set([`passed`,`healed`]),De=new Set([`passed`,`healed`,`failed`,`flaky`,`cancelled`]),Oe=50;function ke(e){return e?e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1):`—`}function A(e){return e.createdAt||e.startedAt||e.endedAt||``}function Ae({status:e}){switch(e){case`passed`:return(0,k.jsx)(y,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,k.jsx)(y,{variant:`destructive`,children:`Failed`});case`healed`:return(0,k.jsx)(y,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,k.jsx)(y,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,k.jsx)(y,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,k.jsx)(y,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,k.jsx)(y,{variant:`outline`,children:e})}}function je(e){return g(`h-10 bg-background text-[13px] font-medium text-foreground/90`,e===`select`?`px-2 text-center`:`px-3`,(e===`passRate`||e===`lastRun`)&&`text-right`)}function Me(e){return g(`py-2 align-top`,e===`select`&&`px-2`,e===`name`&&`max-w-0 px-3`,e===`targetName`&&`max-w-0 px-3`,e===`platform`&&`px-3`,e===`passRate`&&`px-3 text-right`,e===`lastRun`&&`max-w-0 px-3 text-right`)}function Ne({isActive:e,isBatchSelected:t}){return g(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary/60`,t&&!e&&`bg-muted/20`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function j(){te(`Suites`);let[e,p]=(0,D.useState)([]),[_,v]=(0,D.useState)([]),[y,j]=(0,D.useState)(!0),[M,N]=(0,D.useState)({}),[Pe,P]=(0,D.useState)(!1),[Fe,Ie]=(0,D.useState)([]),[F,I]=(0,D.useState)(-1),L=(0,D.useRef)([]),R=de(),{status:z,platform:B,sorting:Le,onSortingChange:Re,setStatus:ze,setPlatform:Be}=O();(0,D.useEffect)(()=>{let e=!1;return Promise.all([he(),pe({limit:200})]).then(([t,n])=>{e||(p(t.files),v(n.runs))}).catch(()=>{e||d.error(`Failed to load suites`)}).finally(()=>{e||j(!1)}),()=>{e=!0}},[]);let V=(0,D.useMemo)(()=>e.map(e=>{let t=[..._.filter(t=>t.suiteId&&e.suiteId?t.suiteId===e.suiteId:t.suiteId?!1:t.name===e.name)].sort((e,t)=>A(t).localeCompare(A(e))),n=t.filter(e=>De.has(e.status)),r=n.filter(e=>Ee.has(e.status)).length,i=n.length>0?Math.round(r/n.length*100):null,a=t[0]??null,o=t.find(e=>e.targetName?.trim())??null;return{path:e.path,suiteId:e.suiteId,name:e.name,platform:e.platform??o?.platform??a?.platform??null,lastRunStatus:a?.status??null,lastRun:a,targetName:o?.targetName?.trim()??a?.targetName?.trim()??null,passRate:i,passCount:r,completedRunCount:n.length}}),[e,_]),H=(0,D.useMemo)(()=>{let e=V;return z&&(e=z===`no-runs`?e.filter(e=>!e.lastRunStatus):e.filter(e=>e.lastRunStatus===z)),B&&(e=e.filter(e=>e.platform===B)),e},[V,z,B]),Ve={id:`select`,header:({table:e})=>(0,k.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,k.jsx)(T,{checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&`indeterminate`,onCheckedChange:t=>e.toggleAllPageRowsSelected(t),ariaLabel:`Select all`})}),cell:({row:e})=>(0,k.jsx)(T,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(t)}),enableSorting:!1,size:48},U=(0,D.useMemo)(()=>[{accessorKey:`name`,header:({column:e})=>(0,k.jsxs)(h,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Name`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,k.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:e.getValue(`name`)}),(0,k.jsx)(`span`,{className:`block whitespace-normal break-all text-xs leading-snug text-muted-foreground`,children:e.original.path})]}),size:400,filterFn:(e,t,n)=>{let r=e.getValue(`name`).toLowerCase(),i=e.original.path.toLowerCase(),a=n.toLowerCase();return r.includes(a)||i.includes(a)}},{accessorKey:`targetName`,header:({column:e})=>(0,k.jsxs)(h,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Target`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsx)(`span`,{className:`block whitespace-normal break-words text-sm leading-snug text-muted-foreground`,children:e.original.targetName??`No target`})},{accessorKey:`platform`,header:({column:e})=>(0,k.jsxs)(h,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Platform`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:ke(e.getValue(`platform`))})},{accessorKey:`passRate`,header:({column:e})=>(0,k.jsxs)(h,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Pass rate`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>e.original.passRate===null?(0,k.jsxs)(`div`,{className:`space-y-0.5 text-right`,children:[(0,k.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`No runs`}),(0,k.jsx)(`div`,{className:`text-xs tabular-nums text-muted-foreground`,children:`0 completed`})]}):(0,k.jsxs)(`div`,{className:`space-y-0.5 text-right`,children:[(0,k.jsxs)(`div`,{className:`text-sm font-medium tabular-nums text-foreground`,children:[e.original.passRate,`%`]}),(0,k.jsxs)(`div`,{className:`text-xs tabular-nums text-muted-foreground`,children:[e.original.passCount,`/`,e.original.completedRunCount]})]})},{id:`lastRun`,accessorFn:e=>e.lastRun?.createdAt??e.lastRun?.startedAt??e.lastRun?.endedAt??``,header:({column:e})=>(0,k.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,k.jsxs)(h,{variant:`ghost`,className:`h-auto justify-end px-0 text-[13px] font-medium text-foreground/90 hover:bg-transparent`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Last run`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]})}),cell:({row:e})=>e.original.lastRun?(0,k.jsxs)(me,{to:u.runDetail(e.original.lastRun.id),className:`relative z-10 flex w-full flex-col items-end gap-1 rounded-sm text-right focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60`,onClick:e=>e.stopPropagation(),children:[(0,k.jsx)(Ae,{status:e.original.lastRun.status}),(0,k.jsx)(`span`,{className:`whitespace-normal break-words text-xs leading-snug text-muted-foreground`,children:ie(A(e.original.lastRun))})]}):(0,k.jsx)(`span`,{className:`block text-sm text-muted-foreground`,children:`No runs`})}],[]),W=(0,D.useMemo)(()=>Object.keys(M).filter(e=>M[e]),[M]),G=(0,D.useMemo)(()=>H.filter(e=>W.includes(e.path)),[H,W]),K=(0,D.useCallback)(async e=>{if(G.length!==0){P(!0);try{let t=await Promise.allSettled(G.map(t=>m({file:t.path,local:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;r>0?d.error(`${n} runs queued, ${r} failed`):d.success(`${n} runs queued`),N({})}finally{P(!1)}}},[G]),He=(0,D.useCallback)(async e=>{if(G.length!==0){P(!0);try{let t=await Promise.allSettled(G.map(t=>m({file:t.path,noCache:!0,local:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;r>0?d.error(`${n} runs queued (no cache), ${r} failed`):d.success(`${n} runs queued (no cache)`),N({})}finally{P(!1)}}},[G]),Ue=(0,D.useCallback)(async()=>{if(G.length!==0){P(!0);try{let e=await Promise.allSettled(G.map(e=>oe(e.path))),t=G.filter((t,n)=>e[n]?.status===`fulfilled`),n=new Set(t.map(e=>e.path)),r=e.length-t.length;t.length>0&&(p(e=>e.filter(e=>!n.has(e.path))),N(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e))))),r>0?d.error(`Deleted ${t.length} suite${t.length===1?``:`s`}, ${r} failed`):d.success(`Deleted ${t.length} suite${t.length===1?``:`s`}`)}finally{P(!1)}}},[G]),q=ve({data:H,columns:[Ve,...U],getCoreRowModel:be(),getSortedRowModel:ye(),getFilteredRowModel:_e(),getPaginationRowModel:ge(),onSortingChange:Re,onColumnFiltersChange:Ie,enableRowSelection:!0,onRowSelectionChange:N,getRowId:e=>e.path,state:{sorting:Le,columnFilters:Fe,rowSelection:M},initialState:{pagination:{pageSize:Oe}}}),J=q.getRowModel().rows,Y=q.getColumn(`name`)?.getFilterValue()??``,We=(0,D.useCallback)(e=>{q.getColumn(`name`)?.setFilterValue(e||void 0),q.setPageIndex(0),I(-1),N({})},[q]);C((0,D.useMemo)(()=>{let e=()=>I(e=>Math.min(e+1,J.length-1)),t=()=>I(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{if(F>=0&&J[F]){let t=J[F].original;if(!t.suiteId)return;let n=u.suiteView(t.suiteId);e.metaKey||e.ctrlKey?window.open(n,`_blank`):R(n)}}}},[J,F,R])),(0,D.useEffect)(()=>{if(F<0)return;let e=L.current[F];e&&document.activeElement!==e&&e.focus()},[F,J.length]);let X=(0,D.useCallback)((e,t)=>{e.suiteId&&(t&&t.preventDefault(),R(u.suiteView(e.suiteId)))},[R]);if(y)return(0,k.jsx)(ue,{});if(e.length===0)return(0,k.jsx)(Te,{icon:le,title:`No suites found`,description:`Create your first suite file`,actionLabel:`New Suite`,onAction:()=>R(u.suiteNew)});let Z=q.getFilteredRowModel().rows.length,Ge=q.getState().pagination.pageIndex,Q=q.getState().pagination.pageSize,$=Ge*Q+1,Ke=Math.min($+Q-1,Z);return(0,k.jsx)(ce,{children:(0,k.jsxs)(`div`,{className:`space-y-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,k.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Suites`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(fe,{children:[(0,k.jsx)(f,{asChild:!0,children:(0,k.jsx)(h,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,k.jsx)(c,{className:`h-4 w-4`})})}),(0,k.jsx)(se,{side:`bottom`,className:`p-3`,children:(0,k.jsx)(s,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open suite`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]}),(0,k.jsxs)(h,{size:`sm`,onClick:()=>R(u.suiteNew),children:[(0,k.jsx)(ee,{className:`size-4`}),`New Suite`]})]})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,k.jsx)(ae,{placeholder:`Search suites...`,value:Y,onChange:e=>We(e.target.value),className:`max-w-[220px]`}),(0,k.jsxs)(o,{value:z||`all`,onValueChange:e=>{ze(e===`all`?``:e),I(-1),N({})},children:[(0,k.jsx)(i,{className:`w-[150px]`,children:(0,k.jsx)(a,{placeholder:`All statuses`})}),(0,k.jsxs)(r,{children:[(0,k.jsx)(n,{value:`all`,children:`All statuses`}),(0,k.jsx)(n,{value:`passed`,children:`Passed`}),(0,k.jsx)(n,{value:`failed`,children:`Failed`}),(0,k.jsx)(n,{value:`running`,children:`Running`}),(0,k.jsx)(n,{value:`no-runs`,children:`No runs`})]})]}),(0,k.jsxs)(o,{value:B||`all`,onValueChange:e=>{Be(e===`all`?``:e),I(-1),N({})},children:[(0,k.jsx)(i,{className:`w-[140px]`,children:(0,k.jsx)(a,{placeholder:`All platforms`})}),(0,k.jsxs)(r,{children:[(0,k.jsx)(n,{value:`all`,children:`All platforms`}),(0,k.jsx)(n,{value:`web`,children:`Web`}),(0,k.jsx)(n,{value:`android`,children:`Android`}),(0,k.jsx)(n,{value:`ios`,children:`iOS`})]})]})]}),(0,k.jsxs)(re,{className:`rounded-md border`,children:[(0,k.jsxs)(we,{className:`min-w-full table-fixed`,children:[(0,k.jsx)(`colgroup`,{children:E.map(e=>{let t=w(e);return(0,k.jsx)(`col`,{"data-column-id":e,style:t?{width:t}:void 0},e)})}),(0,k.jsx)(xe,{children:q.getHeaderGroups().map(e=>(0,k.jsx)(x,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,k.jsx)(Se,{className:je(e.column.id),children:e.isPlaceholder?null:b(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,k.jsx)(Ce,{children:J.length?J.map((e,t)=>{let n=t===F,r=e.getIsSelected();return(0,k.jsx)(x,{ref:e=>{L.current[t]=e},"data-runs-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:Ne({isActive:n,isBatchSelected:r}),onClick:()=>{I(t),X(e.original)},onFocus:()=>I(t),onKeyDown:t=>{t.key===`Enter`&&X(e.original,t)},children:e.getVisibleCells().map(e=>{let t=e.column.id===`select`;return(0,k.jsx)(S,{className:g(Me(e.column.id),t&&`relative z-10`),children:b(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)}):(0,k.jsx)(x,{children:(0,k.jsx)(S,{colSpan:U.length+1,className:`h-24 text-center`,children:`No results.`})})})]}),(0,k.jsx)(ne,{orientation:`horizontal`})]}),(0,k.jsxs)(`div`,{className:`flex items-center justify-between px-2`,children:[(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Z>0?`Showing ${$}-${Ke} of ${Z}${Y||z||B?` (${V.length} total)`:``}`:`No suites found`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(h,{variant:`outline`,size:`sm`,onClick:()=>q.previousPage(),disabled:!q.getCanPreviousPage(),children:`Previous`}),(0,k.jsx)(h,{variant:`outline`,size:`sm`,onClick:()=>q.nextPage(),disabled:!q.getCanNextPage(),children:`Next`})]})]}),(0,k.jsx)(l,{selectedCount:W.length,onRun:K,onRunNoCache:He,onDelete:Ue,onCancel:()=>N({}),isRunning:Pe})]})})}export{j as default};
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-D_ErIdrE.js";import{i as n,n as r,o as i,s as a,t as o}from"./select-D0GpDfUa.js";import{n as s,r as c}from"./shortcut-hints-B8kCurzo.js";import{t as ee}from"./plus-Bf5Mbita.js";import{t as te}from"./use-page-title-CsUoFrfG.js";import{t as ne}from"./batch-action-bar-BoqzHfwU.js";import{n as re,t as ie}from"./scroll-area-CX3T8JWh.js";import{$n as l,Ct as u,Ft as ae,Gt as d,Hn as oe,Kt as se,M as ce,Mt as f,Nt as p,Pt as le,Ut as ue,Wt as m,a as de,cr as fe,ct as pe,dr as h,er as g,jt as _,lr as me,mr as v,rt as he}from"./index-C3AdCkmj.js";import{t as y}from"./badge-ClWCtaXi.js";import{a as ge,i as _e,n as ve,o as ye,r as be,t as b}from"./lib-u_ZEFKZp.js";import{a as xe,i as Se,n as Ce,o as x,r as S,t as we}from"./table-BOjrxBBL.js";import{t as Te}from"./empty-state-BTFWlITi.js";import{t as C}from"./use-keyboard-shortcuts-COnAPsDD.js";import{n as w,r as T,t as E}from"./tests-suites-table-widths-D2sc1JmR.js";var D=e(v(),1);function O(){let[e,t]=h(),n=e.get(`status`)??``,r=e.get(`platform`)??``,i=e.get(`sort`)??``,a=e.get(`order`)??`desc`,o=(0,D.useCallback)((e,n)=>{t(t=>{let r=new URLSearchParams(t);return n?r.set(e,n):r.delete(e),r},{replace:!0})},[t]),s=(0,D.useMemo)(()=>i?[{id:i,desc:a===`desc`}]:[],[i,a]),c=(0,D.useRef)(s);return c.current=s,{status:n,platform:r,sort:i,order:a,sorting:s,onSortingChange:(0,D.useCallback)(e=>{let n=typeof e==`function`?e(c.current):e;t(e=>{let t=new URLSearchParams(e);return n.length>0?(t.set(`sort`,n[0].id),t.set(`order`,n[0].desc?`desc`:`asc`)):(t.delete(`sort`),t.delete(`order`)),t},{replace:!0})},[t]),setStatus:(0,D.useCallback)(e=>o(`status`,e),[o]),setPlatform:(0,D.useCallback)(e=>o(`platform`,e),[o])}}var k=l(),Ee=new Set([`passed`,`healed`]),De=new Set([`passed`,`healed`,`failed`,`flaky`,`cancelled`]),Oe=50;function ke(e){return e?e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1):`—`}function A(e){return e.createdAt||e.startedAt||e.endedAt||``}function Ae({status:e}){switch(e){case`passed`:return(0,k.jsx)(y,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,k.jsx)(y,{variant:`destructive`,children:`Failed`});case`healed`:return(0,k.jsx)(y,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,k.jsx)(y,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,k.jsx)(y,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,k.jsx)(y,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,k.jsx)(y,{variant:`outline`,children:e})}}function je(e){return d(`h-10 bg-background text-[13px] font-medium text-foreground/90`,e===`select`?`px-2 text-center`:`px-3`,(e===`passRate`||e===`lastRun`)&&`text-right`)}function Me(e){return d(`py-2 align-top`,e===`select`&&`px-2`,e===`name`&&`max-w-0 px-3`,e===`targetName`&&`max-w-0 px-3`,e===`platform`&&`px-3`,e===`passRate`&&`px-3 text-right`,e===`lastRun`&&`max-w-0 px-3 text-right`)}function Ne({isActive:e,isBatchSelected:t}){return d(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary/60`,t&&!e&&`bg-muted/20`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function j(){te(`Suites`);let[e,l]=(0,D.useState)([]),[h,v]=(0,D.useState)([]),[y,j]=(0,D.useState)(!0),[M,N]=(0,D.useState)({}),[Pe,P]=(0,D.useState)(!1),[Fe,Ie]=(0,D.useState)([]),[F,I]=(0,D.useState)(-1),L=(0,D.useRef)([]),R=me(),{status:z,platform:B,sorting:Le,onSortingChange:Re,setStatus:ze,setPlatform:Be}=O();(0,D.useEffect)(()=>{let e=!1;return Promise.all([pe(),he({limit:200})]).then(([t,n])=>{e||(l(t.files),v(n.runs))}).catch(()=>{e||_.error(`Failed to load suites`)}).finally(()=>{e||j(!1)}),()=>{e=!0}},[]);let V=(0,D.useMemo)(()=>e.map(e=>{let t=[...h.filter(t=>t.suiteId&&e.suiteId?t.suiteId===e.suiteId:t.suiteId?!1:t.name===e.name)].sort((e,t)=>A(t).localeCompare(A(e))),n=t.filter(e=>De.has(e.status)),r=n.filter(e=>Ee.has(e.status)).length,i=n.length>0?Math.round(r/n.length*100):null,a=t[0]??null,o=t.find(e=>e.targetName?.trim())??null;return{path:e.path,suiteId:e.suiteId,name:e.name,platform:e.platform??o?.platform??a?.platform??null,lastRunStatus:a?.status??null,lastRun:a,targetName:o?.targetName?.trim()??a?.targetName?.trim()??null,passRate:i,passCount:r,completedRunCount:n.length}}),[e,h]),H=(0,D.useMemo)(()=>{let e=V;return z&&(e=z===`no-runs`?e.filter(e=>!e.lastRunStatus):e.filter(e=>e.lastRunStatus===z)),B&&(e=e.filter(e=>e.platform===B)),e},[V,z,B]),Ve={id:`select`,header:({table:e})=>(0,k.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,k.jsx)(T,{checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&`indeterminate`,onCheckedChange:t=>e.toggleAllPageRowsSelected(t),ariaLabel:`Select all`})}),cell:({row:e})=>(0,k.jsx)(T,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(t)}),enableSorting:!1,size:48},U=(0,D.useMemo)(()=>[{accessorKey:`name`,header:({column:e})=>(0,k.jsxs)(m,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Name`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,k.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:e.getValue(`name`)}),(0,k.jsx)(`span`,{className:`block whitespace-normal break-all text-xs leading-snug text-muted-foreground`,children:e.original.path})]}),size:400,filterFn:(e,t,n)=>{let r=e.getValue(`name`).toLowerCase(),i=e.original.path.toLowerCase(),a=n.toLowerCase();return r.includes(a)||i.includes(a)}},{accessorKey:`targetName`,header:({column:e})=>(0,k.jsxs)(m,{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)(m,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Platform`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:ke(e.getValue(`platform`))})},{accessorKey:`passRate`,header:({column:e})=>(0,k.jsxs)(m,{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)(m,{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)(fe,{to:g.runDetail(e.original.lastRun.id),className:`relative z-10 flex w-full flex-col items-end gap-1 rounded-sm text-right focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60`,onClick:e=>e.stopPropagation(),children:[(0,k.jsx)(Ae,{status:e.original.lastRun.status}),(0,k.jsx)(`span`,{className:`whitespace-normal break-words text-xs leading-snug text-muted-foreground`,children:se(A(e.original.lastRun))})]}):(0,k.jsx)(`span`,{className:`block text-sm text-muted-foreground`,children:`No runs`})}],[]),W=(0,D.useMemo)(()=>Object.keys(M).filter(e=>M[e]),[M]),G=(0,D.useMemo)(()=>H.filter(e=>W.includes(e.path)),[H,W]),K=(0,D.useCallback)(async e=>{if(G.length!==0){P(!0);try{let t=await Promise.allSettled(G.map(t=>u({file:t.path,local:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;r>0?_.error(`${n} runs queued, ${r} failed`):_.success(`${n} runs queued`),N({})}finally{P(!1)}}},[G]),He=(0,D.useCallback)(async e=>{if(G.length!==0){P(!0);try{let t=await Promise.allSettled(G.map(t=>u({file:t.path,noCache:!0,local:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;r>0?_.error(`${n} runs queued (no cache), ${r} failed`):_.success(`${n} runs queued (no cache)`),N({})}finally{P(!1)}}},[G]),Ue=(0,D.useCallback)(async()=>{if(G.length!==0){P(!0);try{let e=await Promise.allSettled(G.map(e=>ce(e.path))),t=G.filter((t,n)=>e[n]?.status===`fulfilled`),n=new Set(t.map(e=>e.path)),r=e.length-t.length;t.length>0&&(l(e=>e.filter(e=>!n.has(e.path))),N(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e))))),r>0?_.error(`Deleted ${t.length} suite${t.length===1?``:`s`}, ${r} failed`):_.success(`Deleted ${t.length} suite${t.length===1?``:`s`}`)}finally{P(!1)}}},[G]),q=ve({data:H,columns:[Ve,...U],getCoreRowModel:be(),getSortedRowModel:ye(),getFilteredRowModel:_e(),getPaginationRowModel:ge(),onSortingChange:Re,onColumnFiltersChange:Ie,enableRowSelection:!0,onRowSelectionChange:N,getRowId:e=>e.path,state:{sorting:Le,columnFilters:Fe,rowSelection:M},initialState:{pagination:{pageSize:Oe}}}),J=q.getRowModel().rows,Y=q.getColumn(`name`)?.getFilterValue()??``,We=(0,D.useCallback)(e=>{q.getColumn(`name`)?.setFilterValue(e||void 0),q.setPageIndex(0),I(-1),N({})},[q]);C((0,D.useMemo)(()=>{let e=()=>I(e=>Math.min(e+1,J.length-1)),t=()=>I(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{if(F>=0&&J[F]){let t=J[F].original;if(!t.suiteId)return;let n=g.suiteView(t.suiteId);e.metaKey||e.ctrlKey?window.open(n,`_blank`):R(n)}}}},[J,F,R])),(0,D.useEffect)(()=>{if(F<0)return;let e=L.current[F];e&&document.activeElement!==e&&e.focus()},[F,J.length]);let X=(0,D.useCallback)((e,t)=>{e.suiteId&&(t&&t.preventDefault(),R(g.suiteView(e.suiteId)))},[R]);if(y)return(0,k.jsx)(de,{});if(e.length===0)return(0,k.jsx)(Te,{icon:oe,title:`No suites found`,description:`Create your first suite file`,actionLabel:`New Suite`,onAction:()=>R(g.suiteNew)});let Z=q.getFilteredRowModel().rows.length,Ge=q.getState().pagination.pageIndex,Q=q.getState().pagination.pageSize,$=Ge*Q+1,Ke=Math.min($+Q-1,Z);return(0,k.jsx)(le,{children:(0,k.jsxs)(`div`,{className:`space-y-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,k.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Suites`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(f,{children:[(0,k.jsx)(ae,{asChild:!0,children:(0,k.jsx)(m,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,k.jsx)(c,{className:`h-4 w-4`})})}),(0,k.jsx)(p,{side:`bottom`,className:`p-3`,children:(0,k.jsx)(s,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open suite`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]}),(0,k.jsxs)(m,{size:`sm`,onClick:()=>R(g.suiteNew),children:[(0,k.jsx)(ee,{className:`size-4`}),`New Suite`]})]})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,k.jsx)(ue,{placeholder:`Search suites...`,value:Y,onChange:e=>We(e.target.value),className:`max-w-[220px]`}),(0,k.jsxs)(o,{value:z||`all`,onValueChange:e=>{ze(e===`all`?``:e),I(-1),N({})},children:[(0,k.jsx)(i,{className:`w-[150px]`,children:(0,k.jsx)(a,{placeholder:`All statuses`})}),(0,k.jsxs)(r,{children:[(0,k.jsx)(n,{value:`all`,children:`All statuses`}),(0,k.jsx)(n,{value:`passed`,children:`Passed`}),(0,k.jsx)(n,{value:`failed`,children:`Failed`}),(0,k.jsx)(n,{value:`running`,children:`Running`}),(0,k.jsx)(n,{value:`no-runs`,children:`No runs`})]})]}),(0,k.jsxs)(o,{value:B||`all`,onValueChange:e=>{Be(e===`all`?``:e),I(-1),N({})},children:[(0,k.jsx)(i,{className:`w-[140px]`,children:(0,k.jsx)(a,{placeholder:`All platforms`})}),(0,k.jsxs)(r,{children:[(0,k.jsx)(n,{value:`all`,children:`All platforms`}),(0,k.jsx)(n,{value:`web`,children:`Web`}),(0,k.jsx)(n,{value:`android`,children:`Android`}),(0,k.jsx)(n,{value:`ios`,children:`iOS`})]})]})]}),(0,k.jsxs)(ie,{className:`rounded-md border`,children:[(0,k.jsxs)(we,{className:`min-w-full table-fixed`,children:[(0,k.jsx)(`colgroup`,{children:E.map(e=>{let t=w(e);return(0,k.jsx)(`col`,{"data-column-id":e,style:t?{width:t}:void 0},e)})}),(0,k.jsx)(xe,{children:q.getHeaderGroups().map(e=>(0,k.jsx)(x,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,k.jsx)(Se,{className:je(e.column.id),children:e.isPlaceholder?null:b(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,k.jsx)(Ce,{children:J.length?J.map((e,t)=>{let n=t===F,r=e.getIsSelected();return(0,k.jsx)(x,{ref:e=>{L.current[t]=e},"data-runs-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:Ne({isActive:n,isBatchSelected:r}),onClick:()=>{I(t),X(e.original)},onFocus:()=>I(t),onKeyDown:t=>{t.key===`Enter`&&X(e.original,t)},children:e.getVisibleCells().map(e=>{let t=e.column.id===`select`;return(0,k.jsx)(S,{className:d(Me(e.column.id),t&&`relative z-10`),children:b(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)}):(0,k.jsx)(x,{children:(0,k.jsx)(S,{colSpan:U.length+1,className:`h-24 text-center`,children:`No results.`})})})]}),(0,k.jsx)(re,{orientation:`horizontal`})]}),(0,k.jsxs)(`div`,{className:`flex items-center justify-between px-2`,children:[(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Z>0?`Showing ${$}-${Ke} of ${Z}${Y||z||B?` (${V.length} total)`:``}`:`No suites found`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(m,{variant:`outline`,size:`sm`,onClick:()=>q.previousPage(),disabled:!q.getCanPreviousPage(),children:`Previous`}),(0,k.jsx)(m,{variant:`outline`,size:`sm`,onClick:()=>q.nextPage(),disabled:!q.getCanNextPage(),children:`Next`})]})]}),(0,k.jsx)(ne,{selectedCount:W.length,onRun:K,onRunNoCache:He,onDelete:Ue,onCancel:()=>N({}),isRunning:Pe})]})})}export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{c as t}from"./select-
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{c as t}from"./select-D0GpDfUa.js";import{$n as n,Dn as r,Gt as i,Nn as a,Sn as o,Tn as s,mr as c,nn as l,wn as u}from"./index-C3AdCkmj.js";var d=e(c(),1),f=n(),p=`Switch`,[m,h]=s(p),[g,_]=m(p),v=d.forwardRef((e,t)=>{let{__scopeSwitch:n,name:i,checked:s,defaultChecked:c,required:l,disabled:m,value:h=`on`,onCheckedChange:_,form:v,...y}=e,[b,x]=d.useState(null),w=a(t,e=>x(e)),T=d.useRef(!1),E=b?v||!!b.closest(`form`):!0,[D,O]=o({prop:s,defaultProp:c??!1,onChange:_,caller:p});return(0,f.jsxs)(g,{scope:n,checked:D,disabled:m,children:[(0,f.jsx)(r.button,{type:`button`,role:`switch`,"aria-checked":D,"aria-required":l,"data-state":C(D),"data-disabled":m?``:void 0,disabled:m,value:h,...y,ref:w,onClick:u(e.onClick,e=>{O(e=>!e),E&&(T.current=e.isPropagationStopped(),T.current||e.stopPropagation())})}),E&&(0,f.jsx)(S,{control:b,bubbles:!T.current,name:i,value:h,checked:D,required:l,disabled:m,form:v,style:{transform:`translateX(-100%)`}})]})});v.displayName=p;var y=`SwitchThumb`,b=d.forwardRef((e,t)=>{let{__scopeSwitch:n,...i}=e,a=_(y,n);return(0,f.jsx)(r.span,{"data-state":C(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})});b.displayName=y;var x=`SwitchBubbleInput`,S=d.forwardRef(({__scopeSwitch:e,control:n,checked:r,bubbles:i=!0,...o},s)=>{let c=d.useRef(null),u=a(c,s),p=t(r),m=l(n);return d.useEffect(()=>{let e=c.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(p!==r&&n){let t=new Event(`click`,{bubbles:i});n.call(e,r),e.dispatchEvent(t)}},[p,r,i]),(0,f.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:u,style:{...o.style,...m,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});S.displayName=x;function C(e){return e?`checked`:`unchecked`}var w=v,T=b;function E({className:e,size:t=`default`,...n}){return(0,f.jsx)(w,{"data-slot":`switch`,"data-size":t,className:i(`peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80`,e),...n,children:(0,f.jsx)(T,{"data-slot":`switch-thumb`,className:i(`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-muted-foreground`)})})}export{E as t};
|
|
@@ -0,0 +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-D0GpDfUa.js";import{t as c}from"./circle-x-BOV-jCVR.js";import{t as l}from"./copy-DW4nc-pA.js";import{t as u}from"./eye-Cj7s1eMQ.js";import{t as d}from"./refresh-cw-D0OwRzvm.js";import{t as f}from"./dist-Bc4r79ls.js";import{r as p}from"./use-page-title-CsUoFrfG.js";import{$n as m,Cn as h,Dn as g,Gn as _,Gt as v,It as y,Jt as b,Nn as x,Pn as ee,Rn as te,Sn as S,Tn as ne,Wn as C,Yn as w,at as re,bn as ie,mr as ae,wn as oe,xn as se,zn as ce}from"./index-C3AdCkmj.js";import{t as T}from"./badge-ClWCtaXi.js";var E=w(`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=w(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ue=w(`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(ae(),1),O=m(),k=`Collapsible`,[de,fe]=ne(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]=S({prop:r,defaultProp:i??!1,onChange:o,caller:k});return(0,O.jsx)(pe,{scope:n,disabled:a,contentId:ie(),open:c,onOpenToggle:D.useCallback(()=>l(e=>!e),[l]),children:(0,O.jsx)(g.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)(g.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:oe(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)(se,{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=x(t,l),d=D.useRef(0),f=d.current,p=D.useRef(0),m=p.current,_=o.open||s,v=D.useRef(_),y=D.useRef(void 0);return D.useEffect(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),h(()=>{let e=l.current;if(e){y.current=y.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,v.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),c(r)}},[o.open,r]),(0,O.jsx)(g.div,{"data-state":P(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!_,...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:_&&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]=ne(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]=S({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]=S({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=x(D.useRef(null),t),c=be(n),l=p(i)===`ltr`,u=oe(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)(g.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=ie(),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)(g.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)(T,{variant:`outline`,className:v(`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:v(`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:v(`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:v(`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)(T,{variant:`secondary`,className:`text-xs`,children:e.strategy}),e.success?(0,O.jsx)(C,{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:E},{key:`execute`,label:`Execute`,icon:ce},{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:b(n)}),r,(0,O.jsx)(`span`,{className:`flex-1`}),m&&(0,O.jsx)(_,{className:v(`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 re(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)(y,{className:`h-4 w-3/4`}),(0,O.jsx)(y,{className:`h-4 w-1/2`}),(0,O.jsx)(y,{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:v(`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)(_,{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)(T,{className:v(`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)(C,{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:b(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)(C,{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:b(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)(te,{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:v(`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)(_,{className:v(`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)(T,{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:v(`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)(te,{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)(T,{variant:`outline`,className:`text-[10px] px-1.5 py-0 font-mono`,children:e.name}),(0,O.jsx)(T,{className:v(`text-[10px] px-1.5 py-0`,pt(e.phase)),children:e.phase}),(0,O.jsx)(`span`,{className:v(`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:v(`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:v(`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,E 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{
|
|
1
|
+
import"./chunk-CilyBKbf.js";import{$n as e,Gt as t,mr as n}from"./index-C3AdCkmj.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-
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{r as t}from"./use-page-title-CsUoFrfG.js";import{n,r,t as i}from"./dist-BABsMbMt.js";import{$n as a,Dn as o,Gt as s,Sn as c,Tn as l,Xn as u,bn as d,mr as f,wn as p,xn as m}from"./index-C3AdCkmj.js";var h=e(f(),1),g=a(),_=`Tabs`,[v,y]=l(_,[r]),b=r(),[x,S]=v(_),C=h.forwardRef((e,n)=>{let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:s,orientation:l=`horizontal`,dir:u,activationMode:f=`automatic`,...p}=e,m=t(u),[h,v]=c({prop:i,onChange:a,defaultProp:s??``,caller:_});return(0,g.jsx)(x,{scope:r,baseId:d(),value:h,onValueChange:v,orientation:l,dir:m,activationMode:f,children:(0,g.jsx)(o.div,{dir:m,"data-orientation":l,...p,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:a=!1,...s}=e,c=S(E,n),l=b(n),u=A(c.baseId,r),d=j(c.baseId,r),f=r===c.value;return(0,g.jsx)(i,{asChild:!0,...l,focusable:!a,active:f,children:(0,g.jsx)(o.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:u,...s,ref:t,onMouseDown:p(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?c.onValueChange(r):e.preventDefault()}),onKeyDown:p(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&c.onValueChange(r)}),onFocus:p(e.onFocus,()=>{let e=c.activationMode!==`manual`;!f&&!a&&e&&c.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),u=j(c.baseId,r),d=r===c.value,f=h.useRef(d);return h.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(m,{present:i||d,children:({present:n})=>(0,g.jsx)(o.div,{"data-state":d?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.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:s(`group/tabs flex gap-0 data-[orientation=horizontal]:flex-col`,e),...n})}var L=u(`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:s(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:s(`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:s(`flex-1 outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
|