UNPKG

pulse-dashboard

Version:

A Next.js Dashboard application for real-time monitoring and historical analysis of Playwright test executions, based on playwright-pulse-report. This component provides the UI for visualizing Playwright test results and can be run as a standalone CLI too

5 lines 99.6 kB
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67585,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let s=e.r(32061);function a({reason:e,children:t}){if("undefined"==typeof window)throw Object.defineProperty(new s.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,r)=>{"use strict";function s(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return s}})},52157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return i}});let s=e.r(43476),a=e.r(74080),l=e.r(63599),n=e.r(9885),o=e.r(43369);function i({moduleIds:e}){if("undefined"!=typeof window)return null;let t=l.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let s=t.reactLoadableManifest;for(let t of e){if(!s[t])continue;let e=s[t].files;r.push(...e)}}if(0===r.length)return null;let i=(0,o.getDeploymentIdQueryOrEmptyString)();return(0,s.jsx)(s.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,n.encodeURIPath)(e)}${i}`;return e.endsWith(".css")?(0,s.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return d}});let s=e.r(43476),a=e.r(71645),l=e.r(67585),n=e.r(52157);function o(e){return{default:e&&"default"in e?e.default:e}}let i={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},d=function(e){let t={...i,...e},r=(0,a.lazy)(()=>t.loader().then(o)),d=t.loading;function c(e){let o=d?(0,s.jsx)(d,{isLoading:!0,pastDelay:!0,error:null}):null,i=!t.ssr||!!t.loading,c=i?a.Suspense:a.Fragment,u=t.ssr?(0,s.jsxs)(s.Fragment,{children:["undefined"==typeof window?(0,s.jsx)(n.PreloadChunks,{moduleIds:t.modules}):null,(0,s.jsx)(r,{...e})]}):(0,s.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,s.jsx)(r,{...e})});return(0,s.jsx)(c,{...i?{fallback:o}:{},children:u})}return c.displayName="LoadableComponent",c}},70703,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let s=e.r(55682)._(e.r(69093));function a(e,t){let r={};"function"==typeof e&&(r.loader=e);let a={...r,...t};return(0,s.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={assign:function(){return i},searchParamsToUrlQuery:function(){return l},urlQueryToSearchParams:function(){return o}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});function l(e){let t={};for(let[r,s]of e.entries()){let e=t[r];void 0===e?t[r]=s:Array.isArray(e)?e.push(s):t[r]=[e,s]}return t}function n(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[r,s]of Object.entries(e))if(Array.isArray(s))for(let e of s)t.append(r,n(e));else t.set(r,n(s));return t}function i(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,s]of r.entries())e.append(t,s)}return e}},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={formatUrl:function(){return o},formatWithValidation:function(){return d},urlObjectKeys:function(){return i}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let l=e.r(90809)._(e.r(98183)),n=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,s=e.protocol||"",a=e.pathname||"",o=e.hash||"",i=e.query||"",d=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?d=t+e.host:r&&(d=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(d+=":"+e.port)),i&&"object"==typeof i&&(i=String(l.urlQueryToSearchParams(i)));let c=e.search||i&&`?${i}`||"";return s&&!s.endsWith(":")&&(s+=":"),e.slashes||(!s||n.test(s))&&!1!==d?(d="//"+(d||""),a&&"/"!==a[0]&&(a="/"+a)):d||(d=""),o&&"#"!==o[0]&&(o="#"+o),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${s}${d}${a}${c}${o}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function d(e){return o(e)}},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return b},MissingStaticPage:function(){return v},NormalizeError:function(){return y},PageNotFoundError:function(){return j},SP:function(){return f},ST:function(){return x},WEB_VITALS:function(){return l},execOnce:function(){return n},getDisplayName:function(){return u},getLocationOrigin:function(){return d},getURL:function(){return c},isAbsoluteUrl:function(){return i},isResSent:function(){return h},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return m},stringifyError:function(){return w}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let l=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return(...s)=>(r||(r=!0,t=e(...s)),t)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=e=>o.test(e);function d(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=d();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function h(e){return e.finished||e.headersSent}function m(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let s=await e.getInitialProps(t);if(r&&h(r))return s;if(!s)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${s}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return s}let f="undefined"!=typeof performance,x=f&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class y extends Error{}class j extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class b extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(e){return JSON.stringify({message:e.message,stack:e.stack})}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return l}});let s=e.r(18967),a=e.r(52817);function l(e){if(!(0,s.isAbsoluteUrl)(e))return!0;try{let t=(0,s.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={default:function(){return g},useLinkStatus:function(){return j}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let l=e.r(90809),n=e.r(43476),o=l._(e.r(71645)),i=e.r(95057),d=e.r(8372),c=e.r(18581),u=e.r(18967),h=e.r(5550);e.r(33525);let m=e.r(91949),p=e.r(73668),f=e.r(9396);function x(e){return"string"==typeof e?e:(0,i.formatUrl)(e)}function g(t){var r;let s,a,l,[i,g]=(0,o.useOptimistic)(m.IDLE_LINK_STATUS),j=(0,o.useRef)(null),{href:v,as:b,children:w,prefetch:N=null,passHref:k,replace:C,shallow:S,scroll:T,onClick:A,onMouseEnter:E,onTouchStart:P,legacyBehavior:R=!1,onNavigate:M,ref:D,unstable_dynamicOnHover:O,...L}=t;s=w,R&&("string"==typeof s||"number"==typeof s)&&(s=(0,n.jsx)("a",{children:s}));let F=o.default.useContext(d.AppRouterContext),I=!1!==N,_=!1!==N?null===(r=N)||"auto"===r?f.FetchStrategy.PPR:f.FetchStrategy.Full:f.FetchStrategy.PPR,{href:$,as:z}=o.default.useMemo(()=>{let e=x(v);return{href:e,as:b?x(b):e}},[v,b]);if(R){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=o.default.Children.only(s)}let H=R?a&&"object"==typeof a&&a.ref:D,B=o.default.useCallback(e=>(null!==F&&(j.current=(0,m.mountLinkInstance)(e,$,F,_,I,g)),()=>{j.current&&((0,m.unmountLinkForCurrentNavigation)(j.current),j.current=null),(0,m.unmountPrefetchableInstance)(e)}),[I,$,F,_,g]),U={ref:(0,c.useMergedRef)(B,H),onClick(t){R||"function"!=typeof A||A(t),R&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!F||t.defaultPrevented||function(t,r,s,a,l,n,i){if("undefined"!=typeof window){let d,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(r)){l&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);o.default.startTransition(()=>{u(s||r,l?"replace":"push",n??!0,a.current)})}}(t,$,z,j,C,T,M)},onMouseEnter(e){R||"function"!=typeof E||E(e),R&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),F&&I&&(0,m.onNavigationIntent)(e.currentTarget,!0===O)},onTouchStart:function(e){R||"function"!=typeof P||P(e),R&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),F&&I&&(0,m.onNavigationIntent)(e.currentTarget,!0===O)}};return(0,u.isAbsoluteUrl)(z)?U.href=z:R&&!k&&("a"!==a.type||"href"in a.props)||(U.href=(0,h.addBasePath)(z)),l=R?o.default.cloneElement(a,U):(0,n.jsx)("a",{...L,...U,children:s}),(0,n.jsx)(y.Provider,{value:i,children:l})}e.r(84508);let y=(0,o.createContext)(m.IDLE_LINK_STATUS),j=()=>(0,o.useContext)(y);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},95923,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(57688),a=e.i(87596),l=e.i(15288),n=e.i(2747),o=e.i(29592),i=e.i(69638),d=e.i(73884),c=e.i(75254);let u=(0,c.default)("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);var h=e.i(3116),m=e.i(68054),p=e.i(11641);let f=(0,c.default)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),x=(0,c.default)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]),g=(0,c.default)("MemoryStick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]),y=(0,c.default)("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]),j=(0,c.default)("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]),v=(0,c.default)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),b=(0,c.default)("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);var w=e.i(52571);let N=(0,c.default)("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),k=(0,c.default)("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);var C=e.i(48256),S=e.i(94908),T=e.i(13248);let A=(0,c.default)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]),E=e=>{let r=e.toLowerCase();return r.includes("os")||r.includes("operative system")?(0,t.jsx)(b,{className:"h-4 w-4 text-primary"}):r.includes("cpu")?(0,t.jsx)(x,{className:"h-4 w-4 text-primary"}):r.includes("mem")||r.includes("ram")?(0,t.jsx)(g,{className:"h-4 w-4 text-primary"}):r.includes("node")?(0,t.jsx)(y,{className:"h-4 w-4 text-primary"}):r.includes("playwright")?(0,t.jsx)(j,{className:"h-4 w-4 text-primary"}):r.includes("y playwright")?(0,t.jsx)(v,{className:"h-4 w-4 text-primary"}):r.includes("browser")?(0,t.jsx)(C.Globe,{className:"h-4 w-4 text-primary"}):r.includes("chromium")||r.includes("chrome")?(0,t.jsx)(T.Chrome,{className:"h-4 w-4 text-primary"}):r.includes("firefox")?(0,t.jsx)(C.Globe,{className:"h-4 w-4 text-primary"}):r.includes("webkit")||r.includes("safari")?(0,t.jsx)(S.Compass,{className:"h-4 w-4 text-primary"}):r.includes("provider")&&(e.toLowerCase().includes("ci")||e.toLowerCase().includes("cd"))?(0,t.jsx)(N,{className:"h-4 w-4 text-primary"}):r.includes("job")&&(e.toLowerCase().includes("ci")||e.toLowerCase().includes("cd"))?(0,t.jsx)(k,{className:"h-4 w-4 text-primary"}):r.includes("disk")||r.includes("storage")?(0,t.jsx)(A,{className:"h-4 w-4 text-primary"}):(0,t.jsx)(w.Info,{className:"h-4 w-4 text-primary"})},P=(e,r="")=>"string"==typeof e||"number"==typeof e||"boolean"==typeof e?(0,t.jsx)("span",{className:"text-sm text-foreground",children:String(e)}):Array.isArray(e)?(0,t.jsx)("ul",{className:"list-disc list-inside pl-4",children:e.map((e,s)=>(0,t.jsx)("li",{className:"text-sm text-foreground",children:P(e,`${r}-arr-item-${s}`)},`${r}-arr-${s}`))}):"object"==typeof e&&null!==e?(0,t.jsx)("div",{className:"ml-4 mt-1 space-y-1 border-l pl-3 border-border",children:Object.entries(e).map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,t.jsx)("div",{className:"flex-shrink-0 pt-0.5",children:E(e)}),(0,t.jsxs)("div",{className:"flex-grow",children:[(0,t.jsxs)("span",{className:"text-xs font-medium text-muted-foreground capitalize",children:[e.replace(/([A-Z])/g," $1"),": "]}),P(s,`${r}-${e}`)]})]},`${r}-${e}`))}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground italic",children:"N/A"});function R({environmentInfo:e,loading:r}){return r?(0,t.jsxs)(l.Card,{className:"shadow-lg rounded-xl mt-6",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsx)(n.Skeleton,{className:"h-6 w-48 mb-1"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-3/4"})]}),(0,t.jsx)(l.CardContent,{className:"space-y-3",children:[void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)(n.Skeleton,{className:"h-5 w-5 rounded-full"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-1/4"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-1/2"})]},r))})]}):e&&0!==Object.keys(e).length?(0,t.jsxs)(l.Card,{className:"shadow-lg rounded-xl mt-6 hover:shadow-xl transition-shadow duration-300",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsxs)(l.CardTitle,{className:"text-lg font-semibold text-primary flex items-center",children:[(0,t.jsx)(f,{className:"h-5 w-5 mr-2"})," System Information"]}),(0,t.jsx)(l.CardDescription,{className:"text-xs",children:"Details about the test execution environment."})]}),(0,t.jsx)(l.CardContent,{className:"space-y-3 pr-2",children:Object.entries(e).map(([e,r])=>(0,t.jsxs)("div",{className:"flex items-start space-x-3 p-2 rounded-md hover:bg-muted/30 transition-colors",children:[(0,t.jsx)("div",{className:"flex-shrink-0 pt-1",children:E(e)}),(0,t.jsxs)("div",{className:"flex-grow",children:[(0,t.jsxs)("span",{className:"text-sm font-semibold text-muted-foreground capitalize",children:[e.replace(/([A-Z]+)/g," $1").replace(/([A-Z][a-z])/g," $1").replace(/^./,e=>e.toUpperCase()),":"]}),P(r,e)]})]},e))})]}):(0,t.jsxs)(l.Card,{className:"shadow-lg rounded-xl mt-6",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsxs)(l.CardTitle,{className:"text-lg font-semibold text-primary flex items-center",children:[(0,t.jsx)(f,{className:"h-5 w-5 mr-2"})," System Information"]}),(0,t.jsx)(l.CardDescription,{className:"text-xs",children:"Details about the test execution environment."})]}),(0,t.jsx)(l.CardContent,{children:(0,t.jsxs)(o.Alert,{variant:"default",className:"border-muted-foreground/30",children:[(0,t.jsx)(w.Info,{className:"h-4 w-4"}),(0,t.jsx)(o.AlertTitle,{children:"No Environment Data"}),(0,t.jsx)(o.AlertDescription,{children:"Environment information is not available in the current report."})]})})]})}let M=(0,e.i(70703).default)(()=>e.A(51558).then(e=>e.DashboardOverviewCharts),{loadableGenerated:{modules:[78472]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"grid gap-6 md:grid-cols-1 lg:grid-cols-2 mt-6",children:[...Array(6)].map((e,r)=>(0,t.jsxs)(l.Card,{className:"shadow-lg rounded-xl",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsx)(n.Skeleton,{className:"h-5 w-3/4 rounded-md"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-1/2 mt-1 rounded-md"})]}),(0,t.jsx)(l.CardContent,{children:(0,t.jsx)(n.Skeleton,{className:"h-48 w-full rounded-lg"})})]},`loader-chart-${r}`))})});function D({currentRun:e,loading:r,error:s,onMetricClick:a}){let c=e?.run,f=e?.run?.environment||e?.environment;if(s&&!c)return(0,t.jsxs)(o.Alert,{variant:"destructive",className:"col-span-full md:col-span-2 lg:col-span-5",children:[(0,t.jsx)(m.Terminal,{className:"h-4 w-4"}),(0,t.jsx)(o.AlertTitle,{children:"Error Fetching Summary Metrics"}),(0,t.jsx)(o.AlertDescription,{children:s})]});if(r&&!c)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-5",children:[void 0,void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)(l.Card,{className:"shadow-lg rounded-xl",children:[(0,t.jsxs)(l.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,t.jsx)(n.Skeleton,{className:"h-5 w-24"}),(0,t.jsx)(n.Skeleton,{className:"h-6 w-6"})]}),(0,t.jsxs)(l.CardContent,{children:[(0,t.jsx)(n.Skeleton,{className:"h-8 w-16"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-32 mt-1"})]})]},r))}),(0,t.jsx)(R,{environmentInfo:null,loading:!0,error:null}),(0,t.jsx)("div",{className:"grid gap-6 md:grid-cols-1 lg:grid-cols-2 mt-6",children:[...Array(6)].map((e,r)=>(0,t.jsxs)(l.Card,{className:"shadow-lg rounded-xl",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsx)(n.Skeleton,{className:"h-5 w-3/4 rounded-md"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-1/2 mt-1 rounded-md"})]}),(0,t.jsx)(l.CardContent,{children:(0,t.jsx)(n.Skeleton,{className:"h-48 w-full rounded-lg"})})]},`skeleton-chart-main-${r}`))})]});let x=c?[{title:"Total Tests",value:c.totalTests.toString(),icon:(0,t.jsx)(p.ListFilter,{className:"h-5 w-5 text-muted-foreground"}),change:null,filterKey:null},{title:"Passed",value:c.passed.toString(),icon:(0,t.jsx)(i.CheckCircle,{className:"h-5 w-5 text-[hsl(var(--chart-3))]"}),change:`${c.totalTests>0?(c.passed/c.totalTests*100).toFixed(1):"0.0"}% pass rate`,filterKey:"passed"},{title:"Failed",value:c.failed.toString(),icon:(0,t.jsx)(d.XCircle,{className:"h-5 w-5 text-destructive"}),change:`${c.totalTests>0?(c.failed/c.totalTests*100).toFixed(1):"0.0"}% fail rate`,filterKey:"failed"},{title:"Skipped",value:c.skipped.toString(),icon:(0,t.jsx)(u,{className:"h-5 w-5 text-[hsl(var(--accent))]"}),change:`${c.totalTests>0?(c.skipped/c.totalTests*100).toFixed(1):"0.0"}% skip rate`,filterKey:"skipped"},{title:"Duration",value:function(e){if(0===e)return"0s";let t=Math.floor(e/1e3%60),r=Math.floor(e/6e4%60),s=Math.floor(e/36e5%24),a="";return s>0&&(a+=`${s}h `),r>0&&(a+=`${r}m `),(t>0||0===s&&0===r)&&(a+=`${t}s`),a.trim()||"0s"}(c.duration),icon:(0,t.jsx)(h.Clock,{className:"h-5 w-5 text-primary"}),change:"Total execution time",filterKey:null}]:[],g=e=>{e&&a&&a(e)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-5",children:[x.map(e=>(0,t.jsxs)(l.Card,{className:`shadow-lg hover:shadow-xl transition-shadow duration-300 rounded-xl ${e.filterKey&&a?"cursor-pointer hover:ring-2 hover:ring-primary":""}`,onClick:()=>g(e.filterKey),tabIndex:e.filterKey&&a?0:-1,onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&e.filterKey&&a&&g(e.filterKey)},role:e.filterKey&&a?"button":void 0,"aria-label":e.filterKey&&a?`View ${e.filterKey} tests`:void 0,children:[(0,t.jsxs)(l.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,t.jsx)(l.CardTitle,{className:"text-sm font-medium text-muted-foreground",children:e.title}),e.icon]}),(0,t.jsxs)(l.CardContent,{children:[(0,t.jsx)("div",{className:"text-3xl font-bold text-foreground",children:e.value}),e.change&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground pt-1",children:e.change})]})]},e.title)),r&&c&&[...Array(5-x.length)].map((e,r)=>(0,t.jsxs)(l.Card,{className:"shadow-lg rounded-xl",children:[(0,t.jsxs)(l.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,t.jsx)(n.Skeleton,{className:"h-5 w-24"}),(0,t.jsx)(n.Skeleton,{className:"h-6 w-6"})]}),(0,t.jsxs)(l.CardContent,{children:[(0,t.jsx)(n.Skeleton,{className:"h-8 w-16"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-32 mt-1"})]})]},`loading-${r}`))]}),(0,t.jsx)(R,{environmentInfo:f,loading:r,error:s}),(0,t.jsx)(M,{currentRun:e,loading:r,error:s})]})}var O=e.i(73443),L=e.i(87486),F=e.i(22016),I=e.i(95468),_=e.i(63209);let $=(0,c.default)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var z=e.i(63059),H=e.i(75157);function B({status:e}){switch(e){case"passed":return(0,t.jsx)(I.CheckCircle2,{className:"h-5 w-5 text-[hsl(var(--chart-3))]"});case"failed":return(0,t.jsx)(d.XCircle,{className:"h-5 w-5 text-destructive"});case"skipped":return(0,t.jsx)(_.AlertCircle,{className:"h-5 w-5 text-[hsl(var(--accent))]"});case"timedOut":return(0,t.jsx)(h.Clock,{className:"h-5 w-5 text-destructive"});case"pending":return(0,t.jsx)(h.Clock,{className:"h-5 w-5 text-primary animate-pulse"});default:return(0,t.jsx)(w.Info,{className:"h-5 w-5 text-muted-foreground"})}}function U({test:e}){var a;let l=(0,r.useMemo)(()=>e.screenshots&&Array.isArray(e.screenshots)?e.screenshots.slice(0,4).map((e,t)=>({name:function(e,t="Attachment"){return e&&"string"==typeof e&&e.split(/[/\\]/).pop()||t}(e,`Screenshot ${t+1}`),path:e,contentType:"image/png","data-ai-hint":"test screenshot thumbnail"})):[],[e.screenshots]),n=e.errorMessage||l.length>0,o=function(e){if(!e)return"";let t=e.split(" > ");return t[t.length-1]||e}(e.name);return(0,t.jsxs)("div",{className:"border-b border-border last:border-b-0 py-3 hover:bg-muted/20 transition-colors duration-200 px-4 rounded-lg mb-2 shadow-md bg-card hover:shadow-lg",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3 flex-1 min-w-0",children:[(0,t.jsx)(B,{status:e.status}),(0,t.jsx)(F.default,{href:`/test/${e.id}`,className:"font-medium text-foreground text-sm md:text-base hover:underline truncate",title:e.name,children:o})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-3 ml-2 flex-shrink-0",children:[(0,t.jsx)(L.Badge,{variant:"outline",className:"capitalize text-xs px-2 py-0.5 rounded-full border",style:function(e){switch(e){case"passed":return{backgroundColor:"hsl(var(--chart-3))",color:"hsl(var(--primary-foreground))"};case"failed":case"timedOut":return{backgroundColor:"hsl(var(--destructive))",color:"hsl(var(--destructive-foreground))"};case"skipped":return{backgroundColor:"hsl(var(--accent))",color:"hsl(var(--accent-foreground))"};case"pending":return{backgroundColor:"hsl(var(--primary))",color:"hsl(var(--primary-foreground))"};default:return{backgroundColor:"hsl(var(--muted))",color:"hsl(var(--muted-foreground))"}}}(e.status),children:e.status}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground w-20 text-right",children:(a=e.duration)<1e3?`${a}ms`:`${(a/1e3).toFixed(2)}s`}),(0,t.jsx)(F.default,{href:`/test/${e.id}`,"aria-label":`View details for ${o}`,children:(0,t.jsx)(z.ChevronRight,{className:"h-5 w-5 text-muted-foreground hover:text-primary transition-colors"})})]})]}),n&&(0,t.jsx)(O.Accordion,{type:"single",collapsible:!0,className:"w-full mt-2",children:(0,t.jsxs)(O.AccordionItem,{value:"details",className:"border-none",children:[(0,t.jsx)(O.AccordionTrigger,{className:"text-xs py-1 px-1 hover:no-underline text-muted-foreground justify-start hover:bg-accent/10 rounded-md [&[data-state=open]>svg]:ml-2",children:"Quick Look"}),(0,t.jsxs)(O.AccordionContent,{className:"pt-2 pl-2 pr-2 pb-1 bg-muted/30 rounded-lg",children:[e.errorMessage&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h4",{className:"font-semibold text-xs text-destructive mb-1",children:"Error:"}),(0,t.jsx)("pre",{className:"bg-destructive/10 text-xs p-2 rounded-md whitespace-pre-wrap break-all font-code max-h-20 overflow-y-auto",children:(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,H.ansiToHtml)(e.errorMessage)}})})]}),l.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold text-xs text-primary mb-1",children:"Screenshots:"}),(0,t.jsx)("div",{className:"mt-1 grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-1",children:l.map((e,r)=>{let a=(0,H.getAssetPath)(e.path);return"#"===a?null:(0,t.jsxs)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"relative aspect-video rounded-md overflow-hidden group border hover:border-primary shadow-sm",children:[(0,t.jsx)(s.default,{src:a,alt:e.name,fill:!0,style:{objectFit:"cover"},className:"group-hover:scale-105 transition-transform duration-300","data-ai-hint":e["data-ai-hint"]}),(0,t.jsx)("div",{className:"absolute inset-0 bg-black/30 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center",children:(0,t.jsx)($,{className:"h-6 w-6 text-white"})})]},`img-thumb-${r}`)})})]}),!e.errorMessage&&0===l.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"No error or screenshots for quick look. Click to view full details."})]})]})})]})}var K=e.i(64659);let V=(0,c.default)("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]),q=(0,c.default)("Repeat1",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}],["path",{d:"M11 10h1v4",key:"70cz1p"}]]),W=(0,c.default)("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);var X=e.i(94918),G=e.i(93479),Z=e.i(67489),Q=e.i(48425),Y=r.forwardRef((e,r)=>(0,t.jsx)(Q.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Y.displayName="Label";var J=e.i(25913);let ee=(0,J.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),et=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(Y,{ref:s,className:(0,H.cn)(ee(),e),...r}));et.displayName=Y.displayName;var er=e.i(19455),es=e.i(81140),ea=e.i(20783),el=e.i(30030),en=e.i(26330),eo=e.i(3536),ei=e.i(65491),ed=e.i(10772),ec=e.i(53660),eu=e.i(74606),eh=e.i(96626),em=e.i(91918),ep=e.i(69340),ef=e.i(86312),ex=e.i(85369),eg="Popover",[ey,ej]=(0,el.createContextScope)(eg,[ec.createPopperScope]),ev=(0,ec.createPopperScope)(),[eb,ew]=ey(eg),eN=e=>{let{__scopePopover:s,children:a,open:l,defaultOpen:n,onOpenChange:o,modal:i=!1}=e,d=ev(s),c=r.useRef(null),[u,h]=r.useState(!1),[m=!1,p]=(0,ep.useControllableState)({prop:l,defaultProp:n,onChange:o});return(0,t.jsx)(ec.Root,{...d,children:(0,t.jsx)(eb,{scope:s,contentId:(0,ed.useId)(),triggerRef:c,open:m,onOpenChange:p,onOpenToggle:r.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:r.useCallback(()=>h(!0),[]),onCustomAnchorRemove:r.useCallback(()=>h(!1),[]),modal:i,children:a})})};eN.displayName=eg;var ek="PopoverAnchor";r.forwardRef((e,s)=>{let{__scopePopover:a,...l}=e,n=ew(ek,a),o=ev(a),{onCustomAnchorAdd:i,onCustomAnchorRemove:d}=n;return r.useEffect(()=>(i(),()=>d()),[i,d]),(0,t.jsx)(ec.Anchor,{...o,...l,ref:s})}).displayName=ek;var eC="PopoverTrigger",eS=r.forwardRef((e,r)=>{let{__scopePopover:s,...a}=e,l=ew(eC,s),n=ev(s),o=(0,ea.useComposedRefs)(r,l.triggerRef),i=(0,t.jsx)(Q.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":eI(l.open),...a,ref:o,onClick:(0,es.composeEventHandlers)(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?i:(0,t.jsx)(ec.Anchor,{asChild:!0,...n,children:i})});eS.displayName=eC;var eT="PopoverPortal",[eA,eE]=ey(eT,{forceMount:void 0}),eP=e=>{let{__scopePopover:r,forceMount:s,children:a,container:l}=e,n=ew(eT,r);return(0,t.jsx)(eA,{scope:r,forceMount:s,children:(0,t.jsx)(eh.Presence,{present:s||n.open,children:(0,t.jsx)(eu.Portal,{asChild:!0,container:l,children:a})})})};eP.displayName=eT;var eR="PopoverContent",eM=r.forwardRef((e,r)=>{let s=eE(eR,e.__scopePopover),{forceMount:a=s.forceMount,...l}=e,n=ew(eR,e.__scopePopover);return(0,t.jsx)(eh.Presence,{present:a||n.open,children:n.modal?(0,t.jsx)(eD,{...l,ref:r}):(0,t.jsx)(eO,{...l,ref:r})})});eM.displayName=eR;var eD=r.forwardRef((e,s)=>{let a=ew(eR,e.__scopePopover),l=r.useRef(null),n=(0,ea.useComposedRefs)(s,l),o=r.useRef(!1);return r.useEffect(()=>{let e=l.current;if(e)return(0,ef.hideOthers)(e)},[]),(0,t.jsx)(ex.RemoveScroll,{as:em.Slot,allowPinchZoom:!0,children:(0,t.jsx)(eL,{...e,ref:n,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,es.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||a.triggerRef.current?.focus()}),onPointerDownOutside:(0,es.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;o.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,es.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),eO=r.forwardRef((e,s)=>{let a=ew(eR,e.__scopePopover),l=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(eL,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(l.current||a.triggerRef.current?.focus(),t.preventDefault()),l.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(l.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;a.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),eL=r.forwardRef((e,r)=>{let{__scopePopover:s,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:n,disableOutsidePointerEvents:o,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:u,...h}=e,m=ew(eR,s),p=ev(s);return(0,eo.useFocusGuards)(),(0,t.jsx)(ei.FocusScope,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:n,children:(0,t.jsx)(en.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:(0,t.jsx)(ec.Content,{"data-state":eI(m.open),role:"dialog",id:m.contentId,...p,...h,ref:r,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),eF="PopoverClose";function eI(e){return e?"open":"closed"}r.forwardRef((e,r)=>{let{__scopePopover:s,...a}=e,l=ew(eF,s);return(0,t.jsx)(Q.Primitive.button,{type:"button",...a,ref:r,onClick:(0,es.composeEventHandlers)(e.onClick,()=>l.onOpenChange(!1))})}).displayName=eF,r.forwardRef((e,r)=>{let{__scopePopover:s,...a}=e,l=ev(s);return(0,t.jsx)(ec.Arrow,{...l,...a,ref:r})}).displayName="PopoverArrow";let e_=r.forwardRef(({className:e,align:r="center",sideOffset:s=4,...a},l)=>(0,t.jsx)(eP,{children:(0,t.jsx)(eM,{ref:l,align:r,sideOffset:s,className:(0,H.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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",e),...a})}));e_.displayName=eM.displayName;var e$=e.i(99682),ez=e.i(35804),eH="Checkbox",[eB,eU]=(0,el.createContextScope)(eH),[eK,eV]=eB(eH),eq=r.forwardRef((e,s)=>{let{__scopeCheckbox:a,name:l,checked:n,defaultChecked:o,required:i,disabled:d,value:c="on",onCheckedChange:u,form:h,...m}=e,[p,f]=r.useState(null),x=(0,ea.useComposedRefs)(s,e=>f(e)),g=r.useRef(!1),y=!p||h||!!p.closest("form"),[j=!1,v]=(0,ep.useControllableState)({prop:n,defaultProp:o,onChange:u}),b=r.useRef(j);return r.useEffect(()=>{let e=p?.form;if(e){let t=()=>v(b.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[p,v]),(0,t.jsxs)(eK,{scope:a,state:j,disabled:d,children:[(0,t.jsx)(Q.Primitive.button,{type:"button",role:"checkbox","aria-checked":eZ(j)?"mixed":j,"aria-required":i,"data-state":eQ(j),"data-disabled":d?"":void 0,disabled:d,value:c,...m,ref:x,onKeyDown:(0,es.composeEventHandlers)(e.onKeyDown,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,es.composeEventHandlers)(e.onClick,e=>{v(e=>!!eZ(e)||!e),y&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),y&&(0,t.jsx)(eG,{control:p,bubbles:!g.current,name:l,value:c,checked:j,required:i,disabled:d,form:h,style:{transform:"translateX(-100%)"},defaultChecked:!eZ(o)&&o})]})});eq.displayName=eH;var eW="CheckboxIndicator",eX=r.forwardRef((e,r)=>{let{__scopeCheckbox:s,forceMount:a,...l}=e,n=eV(eW,s);return(0,t.jsx)(eh.Presence,{present:a||eZ(n.state)||!0===n.state,children:(0,t.jsx)(Q.Primitive.span,{"data-state":eQ(n.state),"data-disabled":n.disabled?"":void 0,...l,ref:r,style:{pointerEvents:"none",...e.style}})})});eX.displayName=eW;var eG=e=>{let{control:s,checked:a,bubbles:l=!0,defaultChecked:n,...o}=e,i=r.useRef(null),d=(0,e$.usePrevious)(a),c=(0,ez.useSize)(s);r.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(d!==a&&t){let r=new Event("click",{bubbles:l});e.indeterminate=eZ(a),t.call(e,!eZ(a)&&a),e.dispatchEvent(r)}},[d,a,l]);let u=r.useRef(!eZ(a)&&a);return(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n??u.current,...o,tabIndex:-1,ref:i,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function eZ(e){return"indeterminate"===e}function eQ(e){return eZ(e)?"indeterminate":e?"checked":"unchecked"}var eY=e.i(43531);let eJ=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(eq,{ref:s,className:(0,H.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...r,children:(0,t.jsx)(eX,{className:(0,H.cn)("flex items-center justify-center text-current"),children:(0,t.jsx)(eY.Check,{className:"h-4 w-4"})})}));eJ.displayName=eq.displayName;var e0=e.i(59684),e1=e.i(74911);let e2=["all","passed","failed","skipped","timedOut","pending"],e4=["--suite-color-1-hsl","--suite-color-2-hsl","--suite-color-3-hsl","--suite-color-4-hsl","--suite-color-5-hsl"];function e3({report:e,loading:s,error:a,initialFilter:i}){let[c,p]=(0,r.useState)(i||"all"),[f,x]=(0,r.useState)(""),[g,y]=(0,r.useState)([]),[j,v]=(0,r.useState)([]),[b,N]=(0,r.useState)(!1),[k,C]=(0,r.useState)("all"),[S,T]=(0,r.useState)(["all"]),[A,E]=(0,r.useState)("all"),[P,R]=(0,r.useState)(["all"]),[M,D]=(0,r.useState)(!1),{toast:F}=(0,e1.useToast)();(0,r.useEffect)(()=>{i&&p(i)},[i]),(0,r.useEffect)(()=>{if(e?.results){let t=new Set,r=new Set,s=new Set;e.results.forEach(e=>{e.tags?.forEach(e=>t.add(e)),e.browser&&r.add(e.browser),e.suiteName?s.add(e.suiteName):s.add("Untitled Suite")}),v(Array.from(t).sort()),T(["all",...Array.from(r).sort()]),R(["all",...Array.from(s).sort()])}},[e]);let _=(0,r.useMemo)(()=>"all"!==c||""!==f||g.length>0||"all"!==k||"all"!==A||M,[c,f,g,k,A,M]),$=(0,r.useMemo)(()=>{if(!e?.results)return[];let t=e.results.filter(e=>{let t="all"===c||e.status===c||"failed"===c&&"timedOut"===e.status,r=(e.name||"").toLowerCase().includes(f.toLowerCase())||(e.suiteName||"").toLowerCase().includes(f.toLowerCase()),s=0===g.length||e.tags&&e.tags.some(e=>g.includes(e)),a="all"===k||e.browser===k,l=e.suiteName||"Untitled Suite",n="all"===A||l===A,o=!M||M&&e.retries>0;return t&&r&&s&&a&&n&&o}),r=new Map;return t.forEach(e=>{let t=e.suiteName||"Untitled Suite";r.has(t)||r.set(t,{tests:[],stats:{total:0,passed:0,failed:0,skipped:0,pending:0}});let s=r.get(t);s.tests.push(e),s.stats.total++,"passed"===e.status?s.stats.passed++:"failed"===e.status||"timedOut"===e.status?s.stats.failed++:"skipped"===e.status?s.stats.skipped++:"pending"===e.status&&s.stats.pending++}),Array.from(r.entries()).map(([e,t])=>({title:e,tests:t.tests,stats:t.stats})).sort((e,t)=>t.stats.failed-e.stats.failed||t.stats.total-e.stats.total||e.title.localeCompare(t.title))},[e,c,f,g,k,A,M]);return s?(0,t.jsxs)(l.Card,{className:"shadow-xl",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsx)(n.Skeleton,{className:"h-6 w-48"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-64 mt-1"})]}),(0,t.jsxs)(l.CardContent,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-6 p-6 border rounded-xl bg-muted/50 shadow-lg",children:[(0,t.jsx)(n.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(n.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(n.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(n.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(n.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(n.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(n.Skeleton,{className:"h-10 w-full"})]}),[void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)("div",{className:"space-y-2 p-2 border rounded-lg shadow-md",children:[(0,t.jsx)(n.Skeleton,{className:"h-5 w-1/3"}),(0,t.jsx)(n.Skeleton,{className:"h-8 w-full"}),(0,t.jsx)(n.Skeleton,{className:"h-8 w-full"})]},r))]})]}):a?(0,t.jsxs)(o.Alert,{variant:"destructive",className:"mt-4 shadow-md",children:[(0,t.jsx)(m.Terminal,{className:"h-4 w-4"}),(0,t.jsx)(o.AlertTitle,{children:"Error Fetching Test Results"}),(0,t.jsx)(o.AlertDescription,{children:a})]}):e&&e.results&&0!==e.results.length?(0,t.jsxs)(l.Card,{className:"shadow-xl",children:[(0,t.jsxs)(l.CardHeader,{className:"flex flex-row items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(l.CardTitle,{className:"text-2xl font-headline text-primary",children:"Test Results"}),(e.metadata?.generatedAt||e.run?.timestamp)&&(0,t.jsxs)(l.CardDescription,{children:["Last updated:"," ",new Date(e.metadata.generatedAt||e.run.timestamp).toLocaleString()]})]}),(0,t.jsxs)(er.Button,{onClick:()=>{if(!e||!e.results||0===e.results.length)return void F({title:"Export Failed",description:"No data available to export.",variant:"destructive"});let t=["id","name","suiteName","status","duration","startTime","endTime","browser","retries","tags","stdout","stderr","workerId"],r=e=>{if(null==e)return"";let t=String(e);return(t.includes(",")||t.includes('"')||t.includes("\n"))&&(t=`"${t.replace(/"/g,'""')}"`),t},s=t.map(r).join(",")+"\n";e.results.forEach(e=>{let a=t.map(t=>{let s;switch(t){case"tags":s=e.tags?e.tags.join("; "):"";break;case"stdout":s=e.stdout?e.stdout.join("\\n"):"";break;case"stderr":s=e.errorMessage||"";break;case"workerId":s=void 0!==e.workerId&&null!==e.workerId?String(e.workerId):"";break;default:s=e[t]}return r(s)});s+=a.join(",")+"\n"});let a=new Blob([s],{type:"text/csv;charset=utf-8;"}),l=URL.createObjectURL(a),n=document.createElement("a");n.setAttribute("href",l);let o="data";if(e.run&&e.run.id&&"string"==typeof e.run.id&&""!==e.run.id.trim()){let t=e.run.id.trim().split("-");t.length>1&&"run"===t[0].toLowerCase()&&t[1]&&""!==t[1].trim()?o=t[1]:t.length>0&&""!==t[0].trim()&&(o=t[0])}else if(e.run&&e.run.timestamp)try{o=String(new Date(e.run.timestamp).getTime())}catch(e){}let i=`run-${o}.csv`;n.setAttribute("download",i),n.style.visibility="hidden",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(l),F({title:"Export Successful",description:`${i} has been downloaded.`})},variant:"outline",size:"sm",className:"ml-auto rounded-md shadow-md",children:[(0,t.jsx)(X.FileSpreadsheet,{className:"mr-2 h-4 w-4"}),"Export as CSV"]})]}),(0,t.jsxs)(l.CardContent,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"p-6 border rounded-xl bg-muted/50 shadow-lg space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(et,{htmlFor:"status-filter",className:"text-sm font-medium text-muted-foreground",children:"Filter by Status"}),(0,t.jsxs)(Z.Select,{value:c,onValueChange:e=>p(e),children:[(0,t.jsx)(Z.SelectTrigger,{id:"status-filter",className:"w-full bg-background shadow-inner rounded-md",children:(0,t.jsx)(Z.SelectValue,{placeholder:"Select status"})}),(0,t.jsx)(Z.SelectContent,{className:"rounded-md",children:e2.map(e=>(0,t.jsx)(Z.SelectItem,{value:e,className:"capitalize",children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(et,{htmlFor:"search-filter",className:"text-sm font-medium text-muted-foreground",children:"Search by Name/Suite"}),(0,t.jsx)(G.Input,{id:"search-filter",type:"text",placeholder:"Enter test or suite name...",value:f,onChange:e=>x(e.target.value),className:"w-full bg-background shadow-inner rounded-md"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(et,{className:"text-sm font-medium text-muted-foreground",children:"Filter by Tags"}),(0,t.jsxs)(eN,{open:b,onOpenChange:N,children:[(0,t.jsx)(eS,{asChild:!0,children:(0,t.jsxs)(er.Button,{variant:"outline",className:"w-full bg-background shadow-inner justify-between rounded-md",children:[g.length>0?`Tags (${g.length})`:"Select Tags",(0,t.jsx)(K.ChevronDown,{className:"ml-2 h-4 w-4 opacity-50"})]})}),(0,t.jsxs)(e_,{className:"w-[var(--radix-popover-trigger-width)] p-0 rounded-md",align:"start",children:[(0,t.jsx)("div",{className:"p-2 border-b",children:(0,t.jsx)("p",{className:"text-sm font-medium",children:"Filter by Tags"})}),(0,t.jsx)(e0.ScrollArea,{className:"h-48",children:(0,t.jsx)("div",{className:"p-2 space-y-1",children:j.length>0?j.map(e=>(0,t.jsxs)(et,{htmlFor:`tag-${e}`,className:"flex items-center space-x-2 p-1.5 rounded-md hover:bg-accent/10 cursor-pointer",children:[(0,t.jsx)(eJ,{id:`tag-${e}`,checked:g.includes(e),onCheckedChange:t=>{y(r=>!0===t?[...r,e]:r.filter(t=>t!==e))},className:"rounded-sm"}),(0,t.jsx)("span",{children:e})]},e)):(0,t.jsx)("p",{className:"text-xs text-muted-foreground p-2",children:"No tags available in this report."})})}),g.length>0&&(0,t.jsx)("div",{className:"p-2 border-t flex justify-end",children:(0,t.jsx)(er.Button,{variant:"ghost",size:"sm",onClick:()=>y([]),children:"Clear selected"})})]})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(et,{htmlFor:"browser-filter",className:"text-sm font-medium text-muted-foreground",children:"Filter by Browser"}),(0,t.jsxs)(Z.Select,{value:k,onValueChange:C,children:[(0,t.jsx)(Z.SelectTrigger,{id:"browser-filter",className:"w-full bg-background shadow-inner rounded-md",children:(0,t.jsx)(Z.SelectValue,{placeholder:"Select browser"})}),(0,t.jsx)(Z.SelectContent,{className:"rounded-md",children:S.map(e=>(0,t.jsx)(Z.SelectItem,{value:e,className:"capitalize",children:"all"===e?"All Browsers":e},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(et,{htmlFor:"suite-filter",className:"text-sm font-medium text-muted-foreground",children:"Filter by Test Suite"}),(0,t.jsxs)(Z.Select,{value:A,onValueChange:E,children:[(0,t.jsx)(Z.SelectTrigger,{id:"suite-filter",className:"w-full bg-background shadow-inner rounded-md",children:(0,t.jsx)(Z.SelectValue,{placeholder:"Select test suite"})}),(0,t.jsx)(Z.SelectContent,{className:"rounded-md",children:P.map(e=>(0,t.jsx)(Z.SelectItem,{value:e,className:"capitalize truncate",children:"all"===e?"All Suites":e.length>40?e.substring(0,37)+"...":e},e))})]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 pt-5",children:[(0,t.jsx)(eJ,{id:"retries-filter",checked:M,onCheckedChange:e=>D(!!e),className:"rounded-sm"}),(0,t.jsxs)(et,{htmlFor:"retries-filter",className:"text-sm font-medium text-muted-foreground cursor-pointer flex items-center",children:[(0,t.jsx)(q,{className:"h-4 w-4 mr-1.5 text-muted-foreground"}),"Retries Only"]})]})]}),_&&(0,t.jsx)("div",{className:"mt-4 flex justify-end",children:(0,t.jsxs)(er.Button,{variant:"ghost",onClick:()=>{p("all"),x(""),y([]),C("all"),E("all"),D(!1)},className:"text-sm rounded-md",children:[(0,t.jsx)(V,{className:"mr-2 h-4 w-4"}),"Clear All Filters"]})})]}),g.length>0&&(0,t.jsxs)("div",{className:"mb-4 flex flex-wrap gap-2 items-center",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Active tags:"}),g.map(e=>(0,t.jsxs)(L.Badge,{variant:"secondary",className:"flex items-center rounded-full",children:[e,(0,t.jsx)("button",{type:"button","aria-label":`Remove ${e} filter`,onClick:()=>{y(t=>t.filter(t=>t!==e))},className:"ml-1.5 p-0.5 rounded-full hover:bg-muted-foreground/20 focus:outline-none focus:ring-1 focus:ring-ring",children:(0,t.jsx)(d.XCircle,{className:"h-3.5 w-3.5"})})]},e))]}),$.length>0?(0,t.jsx)(O.Accordion,{type:"multiple",className:"w-full space-y-3",children:$.map((e,r)=>(0,t.jsxs)(O.AccordionItem,{value:`suite-${e.title.replace(/\s+/g,"-")}-${r}`,className:"border rounded-xl shadow-lg bg-card hover:shadow-xl transition-shadow duration-300",children:[(0,t.jsx)(O.AccordionTrigger,{className:"p-4 hover:no-underline text-left w-full group",children:(0,t.jsx)("div",{className:"flex justify-between items-center w-full",children:(0,t.jsxs)("div",{className:"flex-grow min-w-0",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold group-hover:opacity-80 transition-opacity",title:e.title,style:{color:`hsl(var(${e4[r%e4.length]}))`},children:e.title}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1.5 mt-2",children:[(0,t.jsxs)(L.Badge,{variant:"outline",className:"text-xs border-muted-foreground/50",children:[(0,t.jsx)(W,{className:"mr-1.5 h-3 w-3 text-muted-foreground"}),"Total: ",e.stats.total]}),(0,t.jsxs)(L.Badge,{variant:"outline",className:"text-xs",style:{color:"hsl(var(--chart-3))",borderColor:"hsl(var(--chart-3) / 0.5)"},children:[(0,t.jsx)(I.CheckCircle2,{className:"mr-1.5 h-3 w-3"}),"Passed: ",e.stats.passed]}),(0,t.jsxs)(L.Badge,{variant:"outline",className:"text-xs",style:{color:"hsl(var(--destructive))",borderColor:"hsl(var(--destructive) / 0.5)"},children:[(0,t.jsx)(d.XCircle,{className:"mr-1.5 h-3 w-3"}),"Failed: ",e.stats.failed]}),(0,t.jsxs)(L.Badge,{variant:"outline",className:"text-xs",style:{color:"hsl(var(--accent))",borderColor:"hsl(var(--accent) / 0.5)"},children:[(0,t.jsx)(u,{className:"mr-1.5 h-3 w-3"}),"Skipped: ",e.stats.skipped]}),e.stats.pending>0&&(0,t.jsxs)(L.Badge,{variant:"outline",className:"text-xs",style:{color:"hsl(var(--primary))",borderColor:"hsl(var(--primary) / 0.5)"},children:[(0,t.jsx)(h.Clock,{className:"mr-1.5 h-3 w-3"}),"Pending: ",e.stats.pending]})]})]})})}),(0,t.jsx)(O.AccordionContent,{className:"p-4 pt-0",children:e.tests.length>0?(0,t.jsx)("div",{className:"space-y-1 mt-2",children:e.tests.map(e=>(0,t.jsx)(U,{test:e},e.id))}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:"No tests in this suite match the current filters."})})]},`suite-${e.title.replace(/\s+/g,"-")}-${r}`))}):(0,t.jsxs)("div",{className:"text-center py-8",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-lg",children:"No test results match your current filters."}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Try adjusting the status, search term, or tag filters."})]})]})]}):(0,t.jsxs)(l.Card,{className:"shadow-xl",children:[(0,t.jsx)(l.CardHeader,{className:"flex flex-row items-center justify-between",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(l.CardTitle,{className:"text-2xl font-headline text-primary",children:"Test Results"}),(e?.metadata?.generatedAt||e?.run?.timestamp)&&(0,t.jsxs)(l.CardDescription,{children:["Last updated:"," ",new Date(e.metadata?.generatedAt||e.run?.timestamp||Date.now()).toLocaleString()]})]})}),(0,t.jsx)(l.CardContent,{children:(0,t.jsxs)(o.Alert,{className:"shadow-sm rounded-lg",children:[(0,t.jsx)(w.Info,{className:"h-4 w-4"}),(0,t.jsx)(o.AlertTitle,{children:"No Test Data"}),(0,t.jsx)(o.AlertDescription,{children:"No test results available. Ensure 'playwright-pulse-report.json' exists in 'pulse-report/' and is correctly formatted, or that the data source is providing results."})]})})]})}var e5=e.i(29228),e6=e.i(55706),e7=e.i(85183),e8=e.i(93230),e9=e.i(72526),te=e.i(34239),tt=e.i(59559),tr=e.i(44098),ts=e.i(9694),ta=e.i(75225);let tl=(0,c.default)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);var tn=e.i(61911);let to=({active:e,payload:r,label:s})=>e&&r&&r.length?(0,t.jsxs)("div",{className:"custom-recharts-tooltip",children:[(0,t.jsx)("p",{className:"label",children:`Date: ${s}`}),r.map((e,r)=>(0,t.jsx)("p",{style:{color:e.color},className:"text-xs",children:`${e.name}: ${e.value?.toLocaleString()}${e.unit||""}`},`item-${r}`))]}):null,ti=r.memo(({trends:e,loading:s,error:a})=>{let i=r.useRef(null),d=r.useRef(null),c=r.useRef(null),u=r.useMemo(()=>e&&0!==e.length?e.map(e=>({...e,date:new Date(e.date).toLocaleDateString("en-CA",{month:"short",day:"numeric"}),durationSeconds:parseFloat((e.duration/1e3).toFixed(2)),workerCount:e.workerCount})):[],[e]);if(s)return(0,t.jsxs)(l.Card,{className:"shadow-xl rounded-xl backdrop-blur-md bg-card/80 border-border/50",children:[(0,t.jsx)(l.CardHeader,{children:(0,t.jsxs)(l.CardTitle,{className:"flex items-center text-2xl font-headline text-primary",children:[(0,t.jsx)(tl,{className:"h-7 w-7 mr-2"}),"Historical Trend Analysis"]})}),(0,t.jsx)(l.CardContent,{className:"space-y-8 p-6",children:[void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)("div",{className:"bg-muted/30 p-4 rounded-lg shadow-inner",children:[(0,t.jsx)(n.Skeleton,{className:"h-6 w-1/3 mb-4 rounded-md bg-muted/50"}),(0,t.jsx)(n.Skeleton,{className:"h-64 w-full rounded-md bg-muted/50"})]},r))})]});if(a)return(0,t.jsxs)(o.Alert,{variant:"destructive",className:"mt-4 shadow-md rounded-lg",children:[(0,t.jsx)(m.Terminal,{className:"h-4 w-4"}),(0,t.jsx)(o.AlertTitle,{children:"Error Fetching Historical Trends"}),(0,t.jsx)(o.AlertDescription,{children:a})]});if(!e||0===e.length)return(0,t.jsxs)(l.Card,{className:"shadow-xl rounded-xl backdrop-blur-md bg-card/80 border-border/50",children:[(0,t.jsx)(l.CardHeader,{children:(0,t.jsxs)(l.CardTitle,{className:"flex items-center text-2xl font-headline text-primary",children:[(0,t.jsx)(tl,{className:"h-7 w-7 mr-2"}),"Historical Trend Analysis"]})}),(0,t.jsx)(l.CardContent,{className:"p-6",children:(0,t.jsxs)(o.Alert,{className:"rounded-lg border-primary/30 bg-primary/5 text-primary",children:[(0,t.jsx)(w.Info,{className:"h-5 w-5 text-primary/80"}),(0,t.jsx)(o.AlertTitle,{className:"font-semibold",children:"No Historical Data"}),(0,t.jsx)(o.AlertDescription,{children:"No historical trend data available. Ensure 'trend-*.json' files exist in 'pulse-report/history/' and are correctly formatted."})]})})]});let h=u.some(e=>"number"==typeof e.workerCount&&e.workerCount>0);return(0,t.jsxs)(l.Card,{className:"shadow-xl rounded-xl backdrop-blur-md bg-card/80 border-border/50",children:[(0,t.jsx)(l.CardHeader,{children:(0,t.jsxs)(l.CardTitle,{className:"text-2xl font-headline text-primary flex items-center",children:[(0,t.jsx)(tl,{className:"h-7 w-7 mr-2"}),"Historical Trend Analysis"]})}),(0,t.jsxs)(l.CardContent,{className:"space-y-10 p-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,t.jsx)("h4",{className:"text-xl font-semibold text-foreground",children:"Test Outcomes Over Time"})}),(0,t.jsx)("div",{ref:i,className:"w-full h-[350px] bg-muted/30 p-4 rounded-lg shadow-inner",children:(0,t.jsx)(tr.ResponsiveContainer,{width:"100%",height:"100%",children:(0,t.jsxs)(e5.LineChart,{data:u,margin:{top:5,right:20,left:0,bottom:5},children:[(0,t.jsx)(e9.CartesianGrid,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,t.jsx)(e7.XAxis,{dataKey:"date",stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12}}),(0,t.jsx)(e8.YAxis,{stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12}}),(0,t.jsx)(te.Tooltip,{content:(0,t.jsx)(to,{}),cursor:{fill:"hsl(var(--muted))",fillOpacity:.2}}),(0,t.jsx)(tt.Legend,{wrapperStyle:{fontSize:"12px",paddingTop:"10px"}}),(0,t.jsx)(e6.Line,{type:"monotone",dataKey:"totalTests",name:"Total Tests",stroke:"hsl(var(--chart-2))",strokeWidth:2,dot:{r:3},activeDot:{r:6}}),(0,t.jsx)(e6.Line,{type:"monotone",dataKey:"passed",name:"Passed",stroke:"hsl(var(--chart-3))",strokeWidth:2,dot:{r:3},activeDot:{r:6}}),(0,t.jsx)(e6.Line,{type:"monotone",dataKey:"failed",name:"Failed",stroke:"hsl(var(--chart-4))",strokeWidth:2,dot:{r:3},activeDot:{r:6}}),(0,t.jsx)(e6.Line,{type:"monotone",dataKey:"skipped",name:"Skipped",stroke:"hsl(var(--chart-5))",strokeWidth:2,dot:{r:3},activeDot:{r:6}})]})})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,t.jsx)("h4",{className:"text-xl font-semibold text-foreground",children:"Test Duration Over Time"})}),(0,t.jsx)("div",{ref:d,className:"w-full h-[350px] bg-muted/30 p-4 rounded-lg shadow-inner",children:(0,t.jsx)(tr.ResponsiveContainer,{width:"100%",height:"100%",children:(0,t.jsxs)(ts.BarChart,{data:u,margin:{top:5,right:20,left:0,bottom:5},children:[(0,t.jsx)(e9.CartesianGrid,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,t.jsx)(e7.XAxis,{dataKey:"date",stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12}}),(0,t.jsx)(e8.YAxis,{stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12},unit:"s",name:"Seconds"}),(0,t.jsx)(te.Tooltip,{content:(0,t.jsx)(to,{}),cursor:{fill:"hsl(var(--muted))",fillOpacity:.2}}),(0,t.jsx)(tt.Legend,{wrapperStyle:{fontSize:"12px",paddingTop:"10px"}}),(0,t.jsx)(ta.Bar,{dataKey:"durationSeconds",name:"Duration (s)",fill:"hsl(var(--chart-1))",radius:[6,6,0,0],barSize:20})]})})})]}),h&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,t.jsxs)("h4",{className:"text-xl font-semibold text-foreground flex items-center",children:[(0,t.jsx)(tn.Users,{className:"h-5 w-5 mr-2 text-primary"})," Active Worker Count Over Time"]})}),(0,t.jsx)("div",{ref:c,className:"w-full h-[350px] bg-muted/30 p-4 rounded-lg shadow-inner",children:(0,t.jsx)(tr.ResponsiveContainer,{width:"100%",height:"100%",children:(0,t.jsxs)(e5.LineChart,{data:u.filter(e=>"number"==typeof e.workerCount),margin:{top:5,right:20,left:0,bottom:5},children:[(0,t.jsx)(e9.CartesianGrid,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,t.jsx)(e7.XAxis,{dataKey:"date",stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12}}),(0,t.jsx)(e8.YAxis,{stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12},allowDecimals:!1,domain:["dataMin","dataMax"]}),(0,t.jsx)(te.Tooltip,{content:(0,t.jsx)(to,{}),cursor:{fill:"hsl(var(--muted))",fillOpacity:.2}}),(0,t.jsx)(tt.Legend,{wrapperStyle:{fontSize:"12px",paddingTop:"10px"}}),(0,t.jsx)(e6.Line,{type:"monotone",dataKey:"workerCount",name:"Active Workers",stroke:"hsl(var(--chart-info))",strokeWidth:2,dot:{r:3},activeDot:{r:6},connectNulls:!1})]})})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Note: This chart shows the number of unique worker IDs detected in each historical run. Runs without worker information will not be plotted."})]})]})]})});ti.displayName="TrendAnalysis";var td=e.i(95187);let tc=(0,td.createServerReference)("005dc148eb74524845ff7ac73b9e675b141218b97d",td.callServer,void 0,td.findSourceMapURL,"getFlakyTestsAnalysis"),tu=(0,c.default)("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]),th=(0,c.default)("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]),tm=(0,c.default)("ChartBarBig",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["rect",{x:"7",y:"13",width:"9",height:"4",rx:"1",key:"1iip1u"}],["rect",{x:"7",y:"5",width:"12",height:"4",rx:"1",key:"1anskk"}]]);function tp({status:e}){let r={},s=(0,t.jsx)(h.Clock,{className:"h-3 w-3 mr-1"}),a=e;switch(e){case"passed":r={backgroundColor:"hsl(var(--chart-3) / 0.1)",color:"hsl(var(--chart-3))",borderColor:"hsl(var(--chart-3) / 0.3)"},s=(0,t.jsx)(i.CheckCircle,{className:"h-3 w-3 mr-1",style:{color:"hsl(var(--chart-3))"}}),a="passed";break;case"failed":case"timedOut":r={backgroundColor:"hsl(var(--destructive) / 0.1)",color:"hsl(var(--destructive))",borderColor:"hsl(var(--destructive) / 0.3)"},s=(0,t.jsx)(d.XCircle,{className:"h-3 w-3 mr-1",style:{color:"hsl(var(--destructive))"}}),a="failed"===e?"failed":"timedOut";break;case"skipped":r={backgroundColor:"hsl(var(--accent) / 0.1)",color:"hsl(var(--accent))",borderColor:"hsl(var(--accent) / 0.3)"},s=(0,t.jsx)(u,{className:"h-3 w-3 mr-1",style:{color:"hsl(var(--accent))"}}),a="skipped";break;case"pending":r={backgroundColor:"hsl(var(--primary) / 0.1)",color:"hsl(var(--primary))",borderColor:"hsl(var(--primary) / 0.3)"},s=(0,t.jsx)(h.Clock,{className:"h-3 w-3 mr-1",style:{color:"hsl(var(--primary))"}}),a="pending";break;default:r={backgroundColor:"hsl(var(--muted) / 0.5)",color:"hsl(var(--muted-foreground))",borderColor:"hsl(var(--border))"}}return(0,t.jsxs)(L.Badge,{variant:"outline",className:"capitalize text-xs px-2 py-0.5 whitespace-nowrap border",style:r,children:[s,a]})}function tf(){let[e,s]=(0,r.useState)(null),[a,c]=(0,r.useState)(!0),[u,h]=(0,r.useState)(null);return((0,r.useEffect)(()=>{!async function(){c(!0),h(null);let e=await tc();e.success&&e.flakyTests?s(e.flakyTests):h(e.error||"Failed to fetch flaky test analysis."),c(!1)}()},[]),a)?(0,t.jsxs)(l.Card,{className:"shadow-xl",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsx)(n.Skeleton,{className:"h-7 w-48 mb-1"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-3/4"})]}),(0,t.jsx)(l.CardContent,{className:"space-y-4",children:[void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)("div",{className:"p-4 border rounded-lg space-y-2",children:[(0,t.jsx)(n.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-1/2"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-1/3"})]},r))})]}):u?(0,t.jsxs)(o.Alert,{variant:"destructive",children:[(0,t.jsx)(m.Terminal,{className:"h-4 w-4"}),(0,t.jsx)(o.AlertTitle,{children:"Flaky Test Analysis Error"}),(0,t.jsx)(o.AlertDescription,{children:u})]}):e&&0!==e.length?(0,t.jsxs)(l.Card,{className:"shadow-xl",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsxs)(l.CardTitle,{className:"text-2xl font-headline text-primary flex items-center",children:[(0,t.jsx)(tu,{className:"h-7 w-7 mr-2"}),"Flaky Test Analysis (",e.length,")"]}),(0,t.jsx)(l.CardDescription,{children:"Tests that have shown inconsistent pass/fail behavior across historical runs. Click on a test to see its run history."})]}),(0,t.jsx)(l.CardContent,{children:(0,t.jsx)(O.Accordion,{type:"multiple",className:"w-full space-y-3",children:e.map((e,r)=>(0,t.jsxs)(O.AccordionItem,{value:`flaky-${e.id}-${r}`,className:"border rounded-lg bg-card hover:bg-muted/20 transition-colors",children:[(0,t.jsx)(O.AccordionTrigger,{className:"p-4 text-left hover:no-underline",children:(0,t.jsxs)("div",{className:"flex flex-col w-full",children:[(0,t.jsx)(F.default,{href:`/test/${e.id}`,className:"hover:underline text-base font-semibold text-primary",onClick:e=>e.stopPropagation(),children:(e=>{if(!e)return"Unknown Test";let t=e.split(" > ");return t[t.length-1]||e})(e.name)}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Suite: ",e.suiteName]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs mt-2 items-center",children:[(0,t.jsxs)(L.Badge,{variant:"outline",style:{borderColor:"hsl(var(--chart-3))",color:"hsl(var(--chart-3))"},children:[(0,t.jsx)(i.CheckCircle,{className:"h-3 w-3 mr-1.5"})," ",e.passedCount," Passed"]}),(0,t.jsxs)(L.Badge,{variant:"outline",style:{borderColor:"hsl(var(--destructive))",color:"hsl(var(--destructive))"},children:[(0,t.jsx)(d.XCircle,{className:"h-3 w-3 mr-1.5"})," ",e.failedCount," Failed"]}),(0,t.jsxs)(L.Badge,{variant:"secondary",children:[(0,t.jsx)(tm,{className:"h-3 w-3 mr-1.5"})," ",e.totalRuns," Total Runs"]}),(0,t.jsxs)(L.Badge,{variant:"outline",className:"text-xs",children:[(0,t.jsx)(th,{className:"h-3 w-3 mr-1.5"}),"Seen: ",new Date(e.firstSeen).toLocaleDateString()," - ",new Date(e.lastSeen).toLocaleDateString()]})]})]})}),(0,t.jsxs)(O.AccordionContent,{className:"p-4 pt-0",children:[(0,t.jsxs)("h4",{className:"text-sm font-semibold mb-2 text-foreground",children:["Run History (",e.occurrences.length,"):"]}),(0,t.jsx)("div",{className:"max-h-60 overflow-y-auto space-y-1.5 pr-2",children:e.occurrences.map((e,r)=>(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs p-1.5 bg-muted/30 rounded-md",children:[(0,t.jsx)("span",{children:new Date(e.runTimestamp).toLocaleString()}),(0,t.jsx)(tp,{status:e.status})]},r))})]})]},e.id+r))})})]}):(0,t.jsxs)(l.Card,{className:"shadow-xl",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsxs)(l.CardTitle,{className:"text-2xl font-headline text-primary flex items-center",children:[(0,t.jsx)(tu,{className:"h-7 w-7 mr-2"}),"Flaky Test Analysis"]}),(0,t.jsx)(l.CardDescription,{children:"Analysis of tests that have shown inconsistent pass/fail behavior across historical runs."})]}),(0,t.jsx)(l.CardContent,{children:(0,t.jsxs)(o.Alert,{children:[(0,t.jsx)(i.CheckCircle,{className:"h-4 w-4"}),(0,t.jsx)(o.AlertTitle,{children:"No Flaky Tests Identified"}),(0,t.jsx)(o.AlertDescription,{children:"No tests were identified as flaky based on the available historical data."})]})})]})}var tx="Switch",[tg,ty]=(0,el.createContextScope)(tx),[tj,tv]=tg(tx),tb=r.forwardRef((e,s)=>{let{__scopeSwitch:a,name:l,checked:n,defaultChecked:o,required:i,disabled:d,value:c="on",onCheckedChange:u,form:h,...m}=e,[p,f]=r.useState(null),x=(0,ea.useComposedRefs)(s,e=>f(e)),g=r.useRef(!1),y=!p||h||!!p.closest("form"),[j=!1,v]=(0,ep.useControllableState)({prop:n,defaultProp:o,onChange:u});return(0,t.jsxs)(tj,{scope:a,checked:j,disabled:d,children:[(0,t.jsx)(Q.Primitive.button,{type:"button",role:"switch","aria-checked":j,"aria-required":i,"data-state":tC(j),"data-disabled":d?"":void 0,disabled:d,value:c,...m,ref:x,onClick:(0,es.composeEventHandlers)(e.onClick,e=>{v(e=>!e),y&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),y&&(0,t.jsx)(tk,{control:p,bubbles:!g.current,name:l,value:c,checked:j,required:i,disabled:d,form:h,style:{transform:"translateX(-100%)"}})]})});tb.displayName=tx;var tw="SwitchThumb",tN=r.forwardRef((e,r)=>{let{__scopeSwitch:s,...a}=e,l=tv(tw,s);return(0,t.jsx)(Q.Primitive.span,{"data-state":tC(l.checked),"data-disabled":l.disabled?"":void 0,...a,ref:r})});tN.displayName=tw;var tk=e=>{let{control:s,checked:a,bubbles:l=!0,...n}=e,o=r.useRef(null),i=(0,e$.usePrevious)(a),d=(0,ez.useSize)(s);return r.useEffect(()=>{let e=o.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(i!==a&&t){let r=new Event("click",{bubbles:l});t.call(e,a),e.dispatchEvent(r)}},[i,a,l]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...n,tabIndex:-1,ref:o,style:{...e.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function tC(e){return e?"checked":"unchecked"}let tS=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(tb,{className:(0,H.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:s,children:(0,t.jsx)(tN,{className:(0,H.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));function tT(){let[e,s]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e,t=localStorage.getItem("pulse-theme");s(e=t?"dark"===t:document.documentElement.classList.contains("dark")),e&&!document.documentElement.classList.contains("dark")?document.documentElement.classList.add("dark"):!e&&document.documentElement.classList.contains("dark")&&document.documentElement.classList.remove("dark")},[]),(0,t.jsxs)(l.Card,{className:"shadow-xl",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsx)(l.CardTitle,{className:"text-2xl font-headline text-primary",children:"Settings"}),(0,t.jsx)(l.CardDescription,{children:"Customize the appearance of the dashboard."})]}),(0,t.jsx)(l.CardContent,{children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-card/70 shadow-sm",children:[(0,t.jsx)(et,{htmlFor:"theme-toggle",className:"text-base font-medium text-foreground",children:"Theme"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:e?"Dark Mode":"Light Mode"}),(0,t.jsx)(tS,{id:"theme-toggle",checked:e,onCheckedChange:e=>{s(e),e?(document.documentElement.classList.add("dark"),localStorage.setItem("pulse-theme","dark")):(document.documentElement.classList.remove("dark"),localStorage.setItem("pulse-theme","light"))},"aria-label":"Toggle theme"})]})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-4 text-center text-base font-medium text-foreground",children:"Your theme preference is saved in your browser."}),(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-card/70 shadow-sm",children:[(0,t.jsx)("span",{children:"Learn more from Documentation Website: "}),(0,t.jsx)("a",{className:"text-l font-headline text-primary underline hover:text-primary-dark transition-colors",href:"https://arghajit47.github.io/playwright-pulse-dashboard/",target:"_blank",rel:"noopener noreferrer",children:"Pulse Dashboard"})]})]})})]})}tS.displayName=tb.displayName;let tA=(0,c.default)("ListX",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"m19 10-4 4",key:"1tz659"}],["path",{d:"m15 10 4 4",key:"1n7nei"}]]),tE=(0,c.default)("SearchSlash",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),tP=[{name:"Timeout Errors",keywords:["timeout","exceeded"],description:"Tests that failed due to exceeding a specified time limit for an operation."},{name:"Locator/Selector Errors",keywords:["locator","selector","getByRole","getByText","getByLabel","getByPlaceholder","element not found","no element found"],description:"Failures related to finding or interacting with UI elements on the page."},{name:"Assertion Errors",keywords:["expect(","expected","assertion failed"],description:"Tests where a specific condition or value did not meet the expected criteria."},{name:"Strict Mode Violations",keywords:["strict mode violation"],description:"Failures caused by Playwright's strict mode, often when a locator resolves to multiple elements."},{name:"Navigation Errors",keywords:["navigation failed","page.goto","frame.goto"],description:"Errors that occurred during page navigation actions."}],tR="Other Errors";function tM(e){if(!e)return"Unknown Test";let t=e.split(" > ");return t[t.length-1]||e}function tD(){let{currentRun:e,loadingCurrent:s,errorCurrent:d}=(0,a.useTestData)(),c=(0,r.useMemo)(()=>{if(!e?.results)return[];let t=e.results.filter(e=>"failed"===e.status||"timedOut"===e.status),r=new Map;t.forEach(e=>{let t=(e.errorMessage||"Unknown error").replace(/\u001b\[[0-9;]*[mGKH]/g,"").toLowerCase(),s=!1;for(let a of tP)if(a.keywords.some(e=>t.includes(e.toLowerCase()))){r.has(a.name)||r.set(a.name,{tests:[],exampleErrorMessages:[]}),r.get(a.name).tests.push(e),r.get(a.name).exampleErrorMessages.length<3&&r.get(a.name).exampleErrorMessages.push(e.errorMessage),s=!0;break}!s&&(r.has(tR)||r.set(tR,{tests:[],exampleErrorMessages:[]}),r.get(tR).tests.push(e),r.get(tR).exampleErrorMessages.length<3&&r.get(tR).exampleErrorMessages.push(e.errorMessage))});let s=[];return r.forEach((e,t)=>{s.push({categoryName:t,count:e.tests.length,tests:e.tests,exampleErrorMessages:e.exampleErrorMessages})}),s.sort((e,t)=>t.count-e.count),s},[e]);if(s)return(0,t.jsx)("div",{className:"space-y-6",children:[void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)(l.Card,{className:"shadow-lg",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsx)(n.Skeleton,{className:"h-7 w-1/2 mb-2"}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-3/4"})]}),(0,t.jsxs)(l.CardContent,{children:[(0,t.jsx)(n.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(n.Skeleton,{className:"h-10 w-full mt-2"})]})]},r))});if(d)return(0,t.jsxs)(o.Alert,{variant:"destructive",className:"shadow-md",children:[(0,t.jsx)(m.Terminal,{className:"h-4 w-4"}),(0,t.jsx)(o.AlertTitle,{children:"Error Fetching Data"}),(0,t.jsx)(o.AlertDescription,{children:d})]});if(!e||!e.results)return(0,t.jsxs)(o.Alert,{className:"shadow-md",children:[(0,t.jsx)(w.Info,{className:"h-4 w-4"}),(0,t.jsx)(o.AlertTitle,{children:"No Data Available"}),(0,t.jsx)(o.AlertDescription,{children:"The current run report ('playwright-pulse-report.json') could not be loaded or is empty."})]});let u=e.results.filter(e=>"failed"===e.status||"timedOut"===e.status).length;return 0===u?(0,t.jsxs)(o.Alert,{variant:"default",className:"shadow-md border-green-500 bg-green-50 dark:bg-green-900/30",children:[(0,t.jsx)(i.CheckCircle,{className:"h-5 w-5 text-green-600"}),(0,t.jsx)(o.AlertTitle,{className:"text-green-700 dark:text-green-400",children:"No Failures Found!"}),(0,t.jsx)(o.AlertDescription,{className:"text-green-600 dark:text-green-300",children:"Excellent! There are no failed or timed out tests in the current run report."})]}):0===c.length&&u>0?(0,t.jsxs)(o.Alert,{className:"shadow-md",children:[(0,t.jsx)(tE,{className:"h-4 w-4"}),(0,t.jsx)(o.AlertTitle,{children:"Failures Present, But Not Categorized"}),(0,t.jsxs)(o.AlertDescription,{children:["There are ",u,' failures in the current report, but they did not match any predefined categories. They might be listed under "Other Errors" if that category appears.']})]}):(0,t.jsxs)("div",{className:"space-y-6",children:[c.map(e=>{let r=tP.find(t=>t.name===e.categoryName),s=e.exampleErrorMessages[0],a=s?(0,H.ansiToHtml)(s.substring(0,150)):"",n=s&&s.length>150;return(0,t.jsxs)(l.Card,{className:"shadow-lg hover:shadow-xl transition-shadow duration-300",children:[(0,t.jsxs)(l.CardHeader,{children:[(0,t.jsxs)(l.CardTitle,{className:"text-xl font-semibold text-primary flex items-center",children:[(0,t.jsx)(tA,{className:"h-6 w-6 mr-2"}),e.categoryName," ",(0,t.jsxs)(L.Badge,{variant:"secondary",className:"ml-3 text-sm",children:[e.count," tests"]})]}),r?.description&&(0,t.jsx)(l.CardDescription,{className:"text-xs mt-1",children:r.description}),e.categoryName===tR&&s&&(0,t.jsxs)(l.CardDescription,{className:"text-xs mt-1 italic",children:["Example error: ",(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:a}}),n?"...":""]})]}),(0,t.jsx)(l.CardContent,{children:e.tests.length>0?(0,t.jsx)(O.Accordion,{type:"multiple",className:"w-full space-y-2",children:e.tests.map(e=>(0,t.jsxs)(O.AccordionItem,{value:e.id,className:"border rounded-md bg-card hover:bg-muted/20 transition-colors px-1",children:[(0,t.jsx)(O.AccordionTrigger,{className:"p-3 text-left hover:no-underline text-sm",children:(0,t.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground flex-1 min-w-0",title:`${tM(e.name)} (Suite: ${e.suiteName})`,children:[tM(e.name),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs ml-1",children:["(Suite: ",e.suiteName&&e.suiteName.length>30?`${e.suiteName.substring(0,27)}...`:e.suiteName||"N/A",")"]})]}),(0,t.jsx)(z.ChevronRight,{className:"h-4 w-4 text-muted-foreground group-data-[state=open]:rotate-90 transition-transform"})]})}),(0,t.jsxs)(O.AccordionContent,{className:"p-3 pt-0",children:[(0,t.jsx)(F.default,{href:`/test/${e.id}`,className:"text-xs text-primary hover:underline mb-2 block",children:"View full test details"}),(0,t.jsx)("h5",{className:"text-xs font-semibold text-muted-foreground mb-1",children:"Error Message:"}),(0,t.jsx)(e0.ScrollArea,{className:"max-h-32 w-full",children:(0,t.jsx)("pre",{className:"text-xs whitespace-pre-wrap break-words font-code bg-muted/30 p-2 rounded-sm",children:(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,H.ansiToHtml)(e.errorMessage||"No error message captured.")}})})})]})]},e.id))}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No tests found in this category."})})]},e.categoryName)}),0===c.length&&(0,t.jsxs)(o.Alert,{className:"shadow-md",children:[(0,t.jsx)(tE,{className:"h-4 w-4"}),(0,t.jsx)(o.AlertTitle,{children:"No Failures Categorized"}),(0,t.jsx)(o.AlertDescription,{children:"Could not categorize any failures based on the current rules."})]})]})}let tO=(0,c.default)("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);var tL="horizontal",tF=["horizontal","vertical"],tI=r.forwardRef((e,r)=>{var s;let{decorative:a,orientation:l=tL,...n}=e,o=(s=l,tF.includes(s))?l:tL;return(0,t.jsx)(Q.Primitive.div,{"data-orientation":o,...a?{role:"none"}:{"aria-orientation":"vertical"===o?o:void 0,role:"separator"},...n,ref:r})});tI.displayName="Separator";let t_=r.forwardRef(({className:e,orientation:r="horizontal",decorative:s=!0,...a},l)=>(0,t.jsx)(tI,{ref:l,decorative:s,orientation:r,className:(0,H.cn)("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",e),...a}));t_.displayName=tI.displayName;var t$="Dialog",[tz,tH]=(0,el.createContextScope)(t$),[tB,tU]=tz(t$),tK=e=>{let{__scopeDialog:s,children:a,open:l,defaultOpen:n,onOpenChange:o,modal:i=!0}=e,d=r.useRef(null),c=r.useRef(null),[u=!1,h]=(0,ep.useControllableState)({prop:l,defaultProp:n,onChange:o});return(0,t.jsx)(tB,{scope:s,triggerRef:d,contentRef:c,contentId:(0,ed.useId)(),titleId:(0,ed.useId)(),descriptionId:(0,ed.useId)(),open:u,onOpenChange:h,onOpenToggle:r.useCallback(()=>h(e=>!e),[h]),modal:i,children:a})};tK.displayName=t$;var tV="DialogTrigger";r.forwardRef((e,r)=>{let{__scopeDialog:s,...a}=e,l=tU(tV,s),n=(0,ea.useComposedRefs)(r,l.triggerRef);return(0,t.jsx)(Q.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":re(l.open),...a,ref:n,onClick:(0,es.composeEventHandlers)(e.onClick,l.onOpenToggle)})}).displayName=tV;var tq="DialogPortal",[tW,tX]=tz(tq,{forceMount:void 0}),tG=e=>{let{__scopeDialog:s,forceMount:a,children:l,container:n}=e,o=tU(tq,s);return(0,t.jsx)(tW,{scope:s,forceMount:a,children:r.Children.map(l,e=>(0,t.jsx)(eh.Presence,{present:a||o.open,children:(0,t.jsx)(eu.Portal,{asChild:!0,container:n,children:e})}))})};tG.displayName=tq;var tZ="DialogOverlay",tQ=r.forwardRef((e,r)=>{let s=tX(tZ,e.__scopeDialog),{forceMount:a=s.forceMount,...l}=e,n=tU(tZ,e.__scopeDialog);return n.modal?(0,t.jsx)(eh.Presence,{present:a||n.open,children:(0,t.jsx)(tY,{...l,ref:r})}):null});tQ.displayName=tZ;var tY=r.forwardRef((e,r)=>{let{__scopeDialog:s,...a}=e,l=tU(tZ,s);return(0,t.jsx)(ex.RemoveScroll,{as:em.Slot,allowPinchZoom:!0,shards:[l.contentRef],children:(0,t.jsx)(Q.Primitive.div,{"data-state":re(l.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),tJ="DialogContent",t0=r.forwardRef((e,r)=>{let s=tX(tJ,e.__scopeDialog),{forceMount:a=s.forceMount,...l}=e,n=tU(tJ,e.__scopeDialog);return(0,t.jsx)(eh.Presence,{present:a||n.open,children:n.modal?(0,t.jsx)(t1,{...l,ref:r}):(0,t.jsx)(t2,{...l,ref:r})})});t0.displayName=tJ;var t1=r.forwardRef((e,s)=>{let a=tU(tJ,e.__scopeDialog),l=r.useRef(null),n=(0,ea.useComposedRefs)(s,a.contentRef,l);return r.useEffect(()=>{let e=l.current;if(e)return(0,ef.hideOthers)(e)},[]),(0,t.jsx)(t4,{...e,ref:n,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,es.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:(0,es.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,es.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),t2=r.forwardRef((e,s)=>{let a=tU(tJ,e.__scopeDialog),l=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(t4,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(l.current||a.triggerRef.current?.focus(),t.preventDefault()),l.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(l.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;a.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),t4=r.forwardRef((e,s)=>{let{__scopeDialog:a,trapFocus:l,onOpenAutoFocus:n,onCloseAutoFocus:o,...i}=e,d=tU(tJ,a),c=r.useRef(null),u=(0,ea.useComposedRefs)(s,c);return(0,eo.useFocusGuards)(),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei.FocusScope,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:n,onUnmountAutoFocus:o,children:(0,t.jsx)(en.DismissableLayer,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":re(d.open),...i,ref:u,onDismiss:()=>d.onOpenChange(!1)})}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ra,{titleId:d.titleId}),(0,t.jsx)(rl,{contentRef:c,descriptionId:d.descriptionId})]})]})}),t3="DialogTitle",t5=r.forwardRef((e,r)=>{let{__scopeDialog:s,...a}=e,l=tU(t3,s);return(0,t.jsx)(Q.Primitive.h2,{id:l.titleId,...a,ref:r})});t5.displayName=t3;var t6="DialogDescription",t7=r.forwardRef((e,r)=>{let{__scopeDialog:s,...a}=e,l=tU(t6,s);return(0,t.jsx)(Q.Primitive.p,{id:l.descriptionId,...a,ref:r})});t7.displayName=t6;var t8="DialogClose",t9=r.forwardRef((e,r)=>{let{__scopeDialog:s,...a}=e,l=tU(t8,s);return(0,t.jsx)(Q.Primitive.button,{type:"button",...a,ref:r,onClick:(0,es.composeEventHandlers)(e.onClick,()=>l.onOpenChange(!1))})});function re(e){return e?"open":"closed"}t9.displayName=t8;var rt="DialogTitleWarning",[rr,rs]=(0,el.createContext)(rt,{contentName:tJ,titleName:t3,docsSlug:"dialog"}),ra=({titleId:e})=>{let t=rs(rt),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return r.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},rl=({contentRef:e,descriptionId:t})=>{let s=rs("DialogDescriptionWarning"),a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${s.contentName}}.`;return r.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},rn=e.i(37727);let ro=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(tQ,{className:(0,H.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:s}));ro.displayName=tQ.displayName;let ri=(0,J.cva)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),rd=r.forwardRef(({side:e="right",className:r,children:s,...a},l)=>(0,t.jsxs)(tG,{children:[(0,t.jsx)(ro,{}),(0,t.jsxs)(t0,{ref:l,className:(0,H.cn)(ri({side:e}),r),...a,children:[s,(0,t.jsxs)(t9,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,t.jsx)(rn.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));rd.displayName=t0.displayName,r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(t5,{ref:s,className:(0,H.cn)("text-lg font-semibold text-foreground",e),...r})).displayName=t5.displayName,r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(t7,{ref:s,className:(0,H.cn)("text-sm text-muted-foreground",e),...r})).displayName=t7.displayName;var rc=e.i(46798);let ru=r.createContext(null);function rh(){let e=r.useContext(ru);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}let rm=r.forwardRef(({defaultOpen:e=!0,open:s,onOpenChange:a,className:l,style:n,children:o,...i},d)=>{let c=function(){let[e,t]=r.useState(void 0);return r.useEffect(()=>{let e=window.matchMedia("(max-width: 767px)"),r=()=>{t(window.innerWidth<768)};return e.addEventListener("change",r),t(window.innerWidth<768),()=>e.removeEventListener("change",r)},[]),!!e}(),[u,h]=r.useState(!1),[m,p]=r.useState(e),f=s??m,x=r.useCallback(e=>{let t="function"==typeof e?e(f):e;a?a(t):p(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[a,f]),g=r.useCallback(()=>c?h(e=>!e):x(e=>!e),[c,x,h]);r.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),g())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g]);let y=f?"expanded":"collapsed",j=r.useMemo(()=>({state:y,open:f,setOpen:x,isMobile:c,openMobile:u,setOpenMobile:h,toggleSidebar:g}),[y,f,x,c,u,h,g]);return(0,t.jsx)(ru.Provider,{value:j,children:(0,t.jsx)(rc.TooltipProvider,{delayDuration:0,children:(0,t.jsx)("div",{style:{"--sidebar-width":"320px","--sidebar-width-icon":"3.5rem",...n},className:(0,H.cn)("group/sidebar-wrapper flex min-h-svh w-full",l),ref:d,...i,children:o})})})});rm.displayName="SidebarProvider";let rp=r.forwardRef(({side:e="left",collapsible:r="icon",className:s,children:a,...l},n)=>{let{isMobile:o,state:i,openMobile:d,setOpenMobile:c}=rh();return o?(0,t.jsxs)(tK,{open:d,onOpenChange:c,children:[(0,t.jsx)(ro,{className:"bg-black/60 backdrop-blur-sm"}),(0,t.jsx)(rd,{"data-sidebar":"sidebar","data-mobile":"true",className:(0,H.cn)("w-[var(--sidebar-width)] p-0 text-[--color-text-primary] border-r-0","bg-[--glass-bg] backdrop-blur-[20px] saturate-180 border-r border-[--glass-border]"),style:{"--sidebar-width":"320px"},side:e,children:(0,t.jsx)("div",{className:"flex h-full w-full flex-col",children:a})})]}):(0,t.jsx)("aside",{ref:n,"data-sidebar":"sidebar","data-state":i,"data-collapsible":r,"data-side":e,className:(0,H.cn)("group hidden h-svh h-[100dvh] flex-shrink-0 flex-col md:flex sticky top-0","bg-[--glass-bg] backdrop-blur-[20px] saturate-180","border-[--glass-border]","left"===e?"border-r":"border-l","transition-all duration-300 ease-in-out","collapsed"===i?"w-[var(--sidebar-width-icon)]":"w-[var(--sidebar-width)]",s),...l,children:(0,t.jsx)("div",{className:"flex h-full w-full flex-col",children:a})})});rp.displayName="Sidebar";let rf=r.forwardRef(({className:e,onClick:r,...s},a)=>{let{toggleSidebar:l}=rh();return(0,t.jsxs)(er.Button,{ref:a,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:(0,H.cn)("h-7 w-7 md:hidden",e),onClick:e=>{r?.(e),l()},...s,children:[(0,t.jsx)(tO,{}),(0,t.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});rf.displayName="SidebarTrigger";let rx=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)("main",{ref:s,className:(0,H.cn)("relative flex min-h-svh flex-1 flex-col bg-background",e),...r}));rx.displayName="SidebarInset";let rg=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)("div",{ref:s,"data-sidebar":"header",className:(0,H.cn)("flex flex-col gap-4 p-6",e),...r}));rg.displayName="SidebarHeader";let ry=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)("div",{ref:s,"data-sidebar":"content",className:(0,H.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-6","group-data-[collapsible=icon][data-state=collapsed]:p-2 group-data-[collapsible=icon][data-state=collapsed]:overflow-hidden",e),...r}));ry.displayName="SidebarContent";let rj=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)("ul",{ref:s,"data-sidebar":"menu",className:(0,H.cn)("flex w-full min-w-0 flex-col gap-1",e),...r}));rj.displayName="SidebarMenu";let rv=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)("li",{ref:s,"data-sidebar":"menu-item",className:(0,H.cn)("group/menu-item relative",e),...r}));rv.displayName="SidebarMenuItem";let rb=(0,J.cva)("peer/menu-button relative flex w-full items-center gap-4 overflow-hidden rounded-xl p-4 text-left text-[0.95rem] font-medium outline-none transition-all duration-300 ease-in-out disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"text-[--color-text-secondary] hover:text-[--color-primary] hover:bg-[--color-hover] hover:translate-x-1 hover:shadow-md data-[active=true]:bg-primary/10 data-[active=true]:text-primary data-[active=true]:font-semibold data-[active=true]:shadow-lg"}},defaultVariants:{variant:"default"}}),rw=r.forwardRef(({asChild:e=!1,isActive:r=!1,variant:s="default",tooltip:a,className:l,children:n,...o},i)=>{let d=e?em.Slot:"button",{isMobile:c,state:u}=rh(),h=(0,t.jsxs)(d,{ref:i,"data-sidebar":"menu-button","data-active":r,className:(0,H.cn)(rb({variant:s}),"group-data-[collapsible=icon][data-state=collapsed]:size-12 group-data-[collapsible=icon][data-state=collapsed]:justify-center group-data-[collapsible=icon][data-state=collapsed]:p-0","group-data-[collapsible=icon][data-state=collapsed]:[&>span:last-child]:hidden",l),...o,children:[(0,t.jsx)("div",{className:(0,H.cn)("absolute top-0 left-[-100%] w-full h-full bg-gradient-to-r from-primary/10 to-transparent opacity-50 transition-all duration-400 ease-in-out","peer-hover/menu-button:left-0 peer-data-[active=true]/menu-button:left-0")}),n]});return a?("string"==typeof a&&(a={children:a}),(0,t.jsxs)(rc.Tooltip,{children:[(0,t.jsx)(rc.TooltipTrigger,{asChild:!0,children:h}),(0,t.jsx)(rc.TooltipContent,{side:"right",align:"center",className:(0,H.cn)("collapsed"!==u||c?"hidden":"block"),...a,children:a.children})]})):h});rw.displayName="SidebarMenuButton";let rN=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)("div",{ref:s,"data-sidebar":"footer",className:(0,H.cn)("flex flex-col gap-2 p-6 mt-auto",e),...r}));rN.displayName="SidebarFooter";let rk=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(t_,{ref:s,"data-sidebar":"separator",className:(0,H.cn)("mx-2 w-auto bg-[--color-border]","group-data-[state=collapsed]:mx-auto group-data-[state=collapsed]:my-2 group-data-[state=collapsed]:h-auto group-data-[state=collapsed]:w-8/12",e),...r}));rk.displayName="SidebarSeparator",r.forwardRef(({className:e,...r},s)=>(0,t.jsx)("div",{ref:s,"data-sidebar":"group",className:(0,H.cn)("relative flex w-full min-w-0 flex-col",e),...r})).displayName="SidebarGroup",r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(G.Input,{ref:s,"data-sidebar":"input",className:(0,H.cn)("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-[--color-primary]",e),...r})).displayName="SidebarInput";let rC=(0,c.default)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),rS=(0,c.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),rT=(0,c.default)("ShieldCheck",[["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"}]]);function rA(){let e,{currentRun:l,historicalTrends:n,loadingCurrent:o,loadingHistorical:i,errorCurrent:d,errorHistorical:c}=(0,a.useTestData)(),[u,h]=(0,r.useState)("dashboard"),[m,p]=(0,r.useState)(void 0),[f,x]=(0,r.useState)("#7737BF");(0,r.useEffect)(()=>{"live-results"!==u&&m&&p(void 0)},[u,m]);let g=[{id:"dashboard",label:"Dashboard",icon:rC,description:"Real-time Playwright Test Execution Monitoring & Analysis Overview",labelColorVar:"--sidebar-tab-dashboard-color-hsl"},{id:"live-results",label:"Test Results",icon:W,description:"Detailed view of the latest test run results with filters.",labelColorVar:"--sidebar-tab-results-color-hsl"},{id:"trend-analysis",label:"Trend Analysis",icon:tl,description:"Historical data visualization for test performance.",labelColorVar:"--sidebar-tab-trends-color-hsl"},{id:"flaky-tests",label:"Flaky Tests",icon:tu,description:"Analysis of historically flaky tests.",labelColorVar:"--sidebar-tab-flaky-color-hsl"},{id:"failure-categorization",label:"Failure Categorization",icon:tA,description:"Categorize and view common failure types.",labelColorVar:"--sidebar-tab-failures-color-hsl"},{id:"settings",label:"Settings",icon:rS,description:"Configure dashboard appearance and preferences.",labelColorVar:"--sidebar-tab-settings-color-hsl"}],y=g.find(e=>"settings"===e.id),j=g.filter(e=>"settings"!==e.id),v=g.find(e=>e.id===u);switch(u){case"dashboard":default:e=(0,t.jsx)(D,{currentRun:l,loading:o,error:d,onMetricClick:e=>{p(e),h("live-results")}});break;case"live-results":e=(0,t.jsx)(e3,{report:l,loading:o,error:d,initialFilter:m});break;case"trend-analysis":e=(0,t.jsx)(ti,{trends:n,loading:i,error:c});break;case"flaky-tests":e=(0,t.jsx)(tf,{});break;case"failure-categorization":e=(0,t.jsx)(tD,{});break;case"settings":e=(0,t.jsx)(tT,{})}return(0,t.jsxs)(rm,{defaultOpen:!0,children:[(0,t.jsxs)(rp,{collapsible:"icon",className:"border-r border-sidebar-border shadow-lg",children:[(0,t.jsxs)(rg,{className:"p-4 group-data-[collapsible=icon]:p-2 flex items-center justify-between group-data-[collapsible=icon]:justify-center border-b border-sidebar-border",children:[(0,t.jsxs)(F.default,{href:"/",className:"flex items-center",onClick:()=>h("dashboard"),children:[(0,t.jsx)(s.default,{src:"https://i.postimg.cc/v817w4sg/logo.png",alt:"Pulse Dashboard Logo",width:120,height:30,style:{objectFit:"fill"},className:"transition-all duration-200","data-ai-hint":"pulse logo"}),(0,t.jsx)("span",{style:{marginLeft:"10px",color:"#489ef9",fontWeight:900},children:"PULSE DASHBOARD"})]}),(0,t.jsx)(rf,{className:"md:hidden"})]}),(0,t.jsx)(ry,{children:(0,t.jsx)(rj,{children:j.map(e=>(0,t.jsx)(rv,{children:(0,t.jsxs)(rw,{onClick:()=>{h(e.id)},isActive:u===e.id,tooltip:{children:e.label,side:"right",align:"center"},children:[(0,t.jsx)(e.icon,{className:"h-5 w-5"}),(0,t.jsx)("span",{style:u===e.id?void 0:e.labelColorVar?{color:`hsl(var(${e.labelColorVar}))`}:void 0,children:e.label})]})},e.id))})}),(0,t.jsxs)(rN,{className:"p-2 mt-auto border-t border-sidebar-border",children:[y&&(0,t.jsx)(rj,{className:"group-data-[collapsible=icon]:py-2",children:(0,t.jsx)(rv,{children:(0,t.jsxs)(rw,{onClick:()=>{h(y.id)},isActive:u===y.id,tooltip:{children:y.label,side:"right",align:"center"},children:[(0,t.jsx)(y.icon,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"group-data-[collapsible=icon]:hidden",style:u===y.id?void 0:y.labelColorVar?{color:`hsl(var(${y.labelColorVar}))`}:void 0,children:y.label})]})})}),(0,t.jsxs)("div",{className:"pt-2 group-data-[collapsible=icon]:hidden",children:[(0,t.jsx)(rk,{className:"my-1 group-data-[collapsible=icon]:hidden"}),(0,t.jsxs)("div",{className:"flex items-center justify-center gap-1.5 text-xs p-2",children:[(0,t.jsx)(rT,{className:"h-3.5 w-3.5 text-sidebar-foreground/70"}),(0,t.jsx)("span",{className:"font-medium text-sidebar-foreground",children:"Pulse"}),(0,t.jsx)("span",{className:"text-muted-foreground/80",children:"v1.1.0"})]})]})]})]}),(0,t.jsx)(rx,{children:(0,t.jsxs)("div",{className:"container mx-auto p-6 md:p-8 space-y-6 min-h-screen flex flex-col rounded-xl shadow-lg bg-background",children:[(0,t.jsxs)("header",{className:"mb-0",children:[(0,t.jsx)("h1",{className:"text-3xl font-bold font-headline text-primary tracking-tight",children:v?.label||"Pulse Dashboard"}),(0,t.jsx)("p",{className:"text-md text-muted-foreground mt-1",children:v?.description||"Real-time Playwright Test Execution Monitoring & Analysis Overview"}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground mt-2",children:["Latest Run Date:"," ",o?(0,t.jsx)("span",{className:"text-muted-foreground",children:"Loading..."}):l?.run?.timestamp?(0,t.jsx)("span",{className:"text-muted-foreground font-medium",children:new Date(l.run.timestamp).toLocaleString()}):d?(0,t.jsx)("span",{className:"text-destructive font-medium",children:"Error loading data"}):(0,t.jsx)("span",{className:"text-muted-foreground font-medium",children:"Not available"})]})]}),(0,t.jsx)("main",{className:"flex-grow mt-6",children:e}),(0,t.jsxs)("footer",{style:{padding:"0.5rem",boxShadow:"0 -2px 10px rgba(0, 0, 0, 0.05)",textAlign:"center",fontFamily:"'Segoe UI', system-ui, sans-serif",marginTop:"auto"},className:"text-foreground",children:[(0,t.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem",fontSize:"0.9rem",fontWeight:600,letterSpacing:"0.5px"},children:[(0,t.jsx)("span",{children:"Created by"}),(0,t.jsx)("a",{href:"https://github.com/Arghajit47",target:"_blank",rel:"noopener noreferrer",style:{color:f,fontWeight:700,fontStyle:"italic",textDecoration:"none",transition:"all 0.2s ease"},onMouseOver:()=>x("#BF5C37"),onMouseOut:()=>x("#7737BF"),children:"Arghajit Singha"})]}),(0,t.jsx)("div",{style:{marginTop:"0.5rem",fontSize:"0.75rem"},className:"text-muted-foreground",children:"Crafted with precision"})]})]})})]})}e.s(["PulseDashboard",()=>rA],95923)}]);