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

1 lines 68.9 kB
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{16736:(e,s,t)=>{"use strict";t.d(s,{PulseDashboard:()=>sm});var a=t(95155),r=t(12115),l=t(66766),i=t(7323),n=t(66695),o=t(68856),d=t(55365),c=t(7270),m=t(63587),u=t(8376),h=t(24371),x=t(79225),p=t(37648),f=t(60794),g=t(12236),j=t(27140),b=t(56013),N=t(12682),v=t(13300),w=t(57679),y=t(99036),k=t(81710),A=t(75853),S=t(57082),E=t(26854),T=t(50594),C=t(87057);let L=e=>{let s=e.toLowerCase();return s.includes("os")||s.includes("operative system")?(0,a.jsx)(f.A,{className:"h-4 w-4 text-primary"}):s.includes("cpu")?(0,a.jsx)(g.A,{className:"h-4 w-4 text-primary"}):s.includes("mem")||s.includes("ram")?(0,a.jsx)(j.A,{className:"h-4 w-4 text-primary"}):s.includes("node")?(0,a.jsx)(b.A,{className:"h-4 w-4 text-primary"}):s.includes("playwright")?(0,a.jsx)(N.A,{className:"h-4 w-4 text-primary"}):s.includes("y playwright")?(0,a.jsx)(v.A,{className:"h-4 w-4 text-primary"}):s.includes("browser")?(0,a.jsx)(w.A,{className:"h-4 w-4 text-primary"}):s.includes("chromium")||s.includes("chrome")?(0,a.jsx)(y.A,{className:"h-4 w-4 text-primary"}):s.includes("firefox")?(0,a.jsx)(w.A,{className:"h-4 w-4 text-primary"}):s.includes("webkit")||s.includes("safari")?(0,a.jsx)(k.A,{className:"h-4 w-4 text-primary"}):s.includes("provider")&&(e.toLowerCase().includes("ci")||e.toLowerCase().includes("cd"))?(0,a.jsx)(A.A,{className:"h-4 w-4 text-primary"}):s.includes("job")&&(e.toLowerCase().includes("ci")||e.toLowerCase().includes("cd"))?(0,a.jsx)(S.A,{className:"h-4 w-4 text-primary"}):s.includes("disk")||s.includes("storage")?(0,a.jsx)(E.A,{className:"h-4 w-4 text-primary"}):(0,a.jsx)(T.A,{className:"h-4 w-4 text-primary"})},R=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"string"==typeof e||"number"==typeof e||"boolean"==typeof e?(0,a.jsx)("span",{className:"text-sm text-foreground",children:String(e)}):Array.isArray(e)?(0,a.jsx)("ul",{className:"list-disc list-inside pl-4",children:e.map((e,t)=>(0,a.jsx)("li",{className:"text-sm text-foreground",children:R(e,"".concat(s,"-arr-item-").concat(t))},"".concat(s,"-arr-").concat(t)))}):"object"==typeof e&&null!==e?(0,a.jsx)("div",{className:"ml-4 mt-1 space-y-1 border-l pl-3 border-border",children:Object.entries(e).map(e=>{let[t,r]=e;return(0,a.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,a.jsx)("div",{className:"flex-shrink-0 pt-0.5",children:L(t)}),(0,a.jsxs)("div",{className:"flex-grow",children:[(0,a.jsxs)("span",{className:"text-xs font-medium text-muted-foreground capitalize",children:[t.replace(/([A-Z])/g," $1"),": "]}),R(r,"".concat(s,"-").concat(t))]})]},"".concat(s,"-").concat(t))})}):(0,a.jsx)("span",{className:"text-sm text-muted-foreground italic",children:"N/A"})};function F(e){let{environmentInfo:s,loading:t}=e;return t?(0,a.jsxs)(n.Zp,{className:"shadow-lg rounded-xl mt-6",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsx)(o.E,{className:"h-6 w-48 mb-1"}),(0,a.jsx)(o.E,{className:"h-4 w-3/4"})]}),(0,a.jsx)(n.Wu,{className:"space-y-3",children:[void 0,void 0,void 0,void 0].map((e,s)=>(0,a.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,a.jsx)(o.E,{className:"h-5 w-5 rounded-full"}),(0,a.jsx)(o.E,{className:"h-4 w-1/4"}),(0,a.jsx)(o.E,{className:"h-4 w-1/2"})]},s))})]}):s&&0!==Object.keys(s).length?(0,a.jsxs)(n.Zp,{className:"shadow-lg rounded-xl mt-6 hover:shadow-xl transition-shadow duration-300",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsxs)(n.ZB,{className:"text-lg font-semibold text-primary flex items-center",children:[(0,a.jsx)(C.A,{className:"h-5 w-5 mr-2"})," System Information"]}),(0,a.jsx)(n.BT,{className:"text-xs",children:"Details about the test execution environment."})]}),(0,a.jsx)(n.Wu,{className:"space-y-3 pr-2",children:Object.entries(s).map(e=>{let[s,t]=e;return(0,a.jsxs)("div",{className:"flex items-start space-x-3 p-2 rounded-md hover:bg-muted/30 transition-colors",children:[(0,a.jsx)("div",{className:"flex-shrink-0 pt-1",children:L(s)}),(0,a.jsxs)("div",{className:"flex-grow",children:[(0,a.jsxs)("span",{className:"text-sm font-semibold text-muted-foreground capitalize",children:[s.replace(/([A-Z]+)/g," $1").replace(/([A-Z][a-z])/g," $1").replace(/^./,e=>e.toUpperCase()),":"]}),R(t,s)]})]},s)})})]}):(0,a.jsxs)(n.Zp,{className:"shadow-lg rounded-xl mt-6",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsxs)(n.ZB,{className:"text-lg font-semibold text-primary flex items-center",children:[(0,a.jsx)(C.A,{className:"h-5 w-5 mr-2"})," System Information"]}),(0,a.jsx)(n.BT,{className:"text-xs",children:"Details about the test execution environment."})]}),(0,a.jsx)(n.Wu,{children:(0,a.jsxs)(d.Fc,{variant:"default",className:"border-muted-foreground/30",children:[(0,a.jsx)(T.A,{className:"h-4 w-4"}),(0,a.jsx)(d.XL,{children:"No Environment Data"}),(0,a.jsx)(d.TN,{children:"Environment information is not available in the current report."})]})})]})}let D=(0,t(55028).default)(()=>Promise.all([t.e(713),t.e(966)]).then(t.bind(t,5966)).then(e=>e.DashboardOverviewCharts),{loadableGenerated:{webpack:()=>[5966]},ssr:!1,loading:()=>(0,a.jsx)("div",{className:"grid gap-6 md:grid-cols-1 lg:grid-cols-2 mt-6",children:[...Array(6)].map((e,s)=>(0,a.jsxs)(n.Zp,{className:"shadow-lg rounded-xl",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsx)(o.E,{className:"h-5 w-3/4 rounded-md"}),(0,a.jsx)(o.E,{className:"h-4 w-1/2 mt-1 rounded-md"})]}),(0,a.jsx)(n.Wu,{children:(0,a.jsx)(o.E,{className:"h-48 w-full rounded-lg"})})]},"loader-chart-".concat(s)))})});function M(e){var s;let{currentRun:t,loading:r,error:l,onMetricClick:i}=e,f=null==t?void 0:t.run,g=(null==t?void 0:null===(s=t.run)||void 0===s?void 0:s.environment)||(null==t?void 0:t.environment);if(l&&!f)return(0,a.jsxs)(d.Fc,{variant:"destructive",className:"col-span-full md:col-span-2 lg:col-span-5",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"}),(0,a.jsx)(d.XL,{children:"Error Fetching Summary Metrics"}),(0,a.jsx)(d.TN,{children:l})]});if(r&&!f)return(0,a.jsxs)(a.Fragment,{children:[(0,a.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,s)=>(0,a.jsxs)(n.Zp,{className:"shadow-lg rounded-xl",children:[(0,a.jsxs)(n.aR,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,a.jsx)(o.E,{className:"h-5 w-24"}),(0,a.jsx)(o.E,{className:"h-6 w-6"})]}),(0,a.jsxs)(n.Wu,{children:[(0,a.jsx)(o.E,{className:"h-8 w-16"}),(0,a.jsx)(o.E,{className:"h-4 w-32 mt-1"})]})]},s))}),(0,a.jsx)(F,{environmentInfo:null,loading:!0,error:null}),(0,a.jsx)("div",{className:"grid gap-6 md:grid-cols-1 lg:grid-cols-2 mt-6",children:[...Array(6)].map((e,s)=>(0,a.jsxs)(n.Zp,{className:"shadow-lg rounded-xl",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsx)(o.E,{className:"h-5 w-3/4 rounded-md"}),(0,a.jsx)(o.E,{className:"h-4 w-1/2 mt-1 rounded-md"})]}),(0,a.jsx)(n.Wu,{children:(0,a.jsx)(o.E,{className:"h-48 w-full rounded-lg"})})]},"skeleton-chart-main-".concat(s)))})]});let j=f?[{title:"Total Tests",value:f.totalTests.toString(),icon:(0,a.jsx)(m.A,{className:"h-5 w-5 text-muted-foreground"}),change:null,filterKey:null},{title:"Passed",value:f.passed.toString(),icon:(0,a.jsx)(u.A,{className:"h-5 w-5 text-[hsl(var(--chart-3))]"}),change:"".concat(f.totalTests>0?(f.passed/f.totalTests*100).toFixed(1):"0.0","% pass rate"),filterKey:"passed"},{title:"Failed",value:f.failed.toString(),icon:(0,a.jsx)(h.A,{className:"h-5 w-5 text-destructive"}),change:"".concat(f.totalTests>0?(f.failed/f.totalTests*100).toFixed(1):"0.0","% fail rate"),filterKey:"failed"},{title:"Skipped",value:f.skipped.toString(),icon:(0,a.jsx)(x.A,{className:"h-5 w-5 text-[hsl(var(--accent))]"}),change:"".concat(f.totalTests>0?(f.skipped/f.totalTests*100).toFixed(1):"0.0","% skip rate"),filterKey:"skipped"},{title:"Duration",value:function(e){if(0===e)return"0s";let s=Math.floor(e/1e3%60),t=Math.floor(e/6e4%60),a=Math.floor(e/36e5%24),r="";return a>0&&(r+="".concat(a,"h ")),t>0&&(r+="".concat(t,"m ")),(s>0||0===a&&0===t)&&(r+="".concat(s,"s")),r.trim()||"0s"}(f.duration),icon:(0,a.jsx)(p.A,{className:"h-5 w-5 text-primary"}),change:"Total execution time",filterKey:null}]:[],b=e=>{e&&i&&i(e)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-5",children:[j.map(e=>(0,a.jsxs)(n.Zp,{className:"shadow-lg hover:shadow-xl transition-shadow duration-300 rounded-xl ".concat(e.filterKey&&i?"cursor-pointer hover:ring-2 hover:ring-primary":""),onClick:()=>b(e.filterKey),tabIndex:e.filterKey&&i?0:-1,onKeyDown:s=>{("Enter"===s.key||" "===s.key)&&e.filterKey&&i&&b(e.filterKey)},role:e.filterKey&&i?"button":void 0,"aria-label":e.filterKey&&i?"View ".concat(e.filterKey," tests"):void 0,children:[(0,a.jsxs)(n.aR,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,a.jsx)(n.ZB,{className:"text-sm font-medium text-muted-foreground",children:e.title}),e.icon]}),(0,a.jsxs)(n.Wu,{children:[(0,a.jsx)("div",{className:"text-3xl font-bold text-foreground",children:e.value}),e.change&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground pt-1",children:e.change})]})]},e.title)),r&&f&&[...Array(5-j.length)].map((e,s)=>(0,a.jsxs)(n.Zp,{className:"shadow-lg rounded-xl",children:[(0,a.jsxs)(n.aR,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,a.jsx)(o.E,{className:"h-5 w-24"}),(0,a.jsx)(o.E,{className:"h-6 w-6"})]}),(0,a.jsxs)(n.Wu,{children:[(0,a.jsx)(o.E,{className:"h-8 w-16"}),(0,a.jsx)(o.E,{className:"h-4 w-32 mt-1"})]})]},"loading-".concat(s)))]}),(0,a.jsx)(F,{environmentInfo:g,loading:r,error:l}),(0,a.jsx)(D,{currentRun:t,loading:r,error:l})]})}var O=t(10549),z=t(26126),Z=t(6874),I=t.n(Z),B=t(58127),W=t(11133),_=t(73158),K=t(17607),P=t(59434);function U(e){let{status:s}=e;switch(s){case"passed":return(0,a.jsx)(B.A,{className:"h-5 w-5 text-[hsl(var(--chart-3))]"});case"failed":return(0,a.jsx)(h.A,{className:"h-5 w-5 text-destructive"});case"skipped":return(0,a.jsx)(W.A,{className:"h-5 w-5 text-[hsl(var(--accent))]"});case"timedOut":return(0,a.jsx)(p.A,{className:"h-5 w-5 text-destructive"});case"pending":return(0,a.jsx)(p.A,{className:"h-5 w-5 text-primary animate-pulse"});default:return(0,a.jsx)(T.A,{className:"h-5 w-5 text-muted-foreground"})}}function V(e){var s;let{test:t}=e,i=(0,r.useMemo)(()=>t.screenshots&&Array.isArray(t.screenshots)?t.screenshots.slice(0,4).map((e,s)=>({name:function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Attachment";return e&&"string"==typeof e&&e.split(/[/\\]/).pop()||s}(e,"Screenshot ".concat(s+1)),path:e,contentType:"image/png","data-ai-hint":"test screenshot thumbnail"})):[],[t.screenshots]),n=t.errorMessage||i.length>0,o=function(e){if(!e)return"";let s=e.split(" > ");return s[s.length-1]||e}(t.name);return(0,a.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,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-3 flex-1 min-w-0",children:[(0,a.jsx)(U,{status:t.status}),(0,a.jsx)(I(),{href:"/test/".concat(t.id),className:"font-medium text-foreground text-sm md:text-base hover:underline truncate",title:t.name,children:o})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-3 ml-2 flex-shrink-0",children:[(0,a.jsx)(z.E,{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))"}}}(t.status),children:t.status}),(0,a.jsx)("span",{className:"text-sm text-muted-foreground w-20 text-right",children:(s=t.duration)<1e3?"".concat(s,"ms"):"".concat((s/1e3).toFixed(2),"s")}),(0,a.jsx)(I(),{href:"/test/".concat(t.id),"aria-label":"View details for ".concat(o),children:(0,a.jsx)(_.A,{className:"h-5 w-5 text-muted-foreground hover:text-primary transition-colors"})})]})]}),n&&(0,a.jsx)(O.nD,{type:"single",collapsible:!0,className:"w-full mt-2",children:(0,a.jsxs)(O.As,{value:"details",className:"border-none",children:[(0,a.jsx)(O.$m,{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,a.jsxs)(O.ub,{className:"pt-2 pl-2 pr-2 pb-1 bg-muted/30 rounded-lg",children:[t.errorMessage&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("h4",{className:"font-semibold text-xs text-destructive mb-1",children:"Error:"}),(0,a.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,a.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,P.cA)(t.errorMessage)}})})]}),i.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold text-xs text-primary mb-1",children:"Screenshots:"}),(0,a.jsx)("div",{className:"mt-1 grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-1",children:i.map((e,s)=>{let t=(0,P.OX)(e.path);return"#"===t?null:(0,a.jsxs)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"relative aspect-video rounded-md overflow-hidden group border hover:border-primary shadow-sm",children:[(0,a.jsx)(l.default,{src:t,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,a.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,a.jsx)(K.A,{className:"h-6 w-6 text-white"})})]},"img-thumb-".concat(s))})})]}),!t.errorMessage&&0===i.length&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"No error or screenshots for quick look. Click to view full details."})]})]})})]})}var X=t(60679),$=t(79556),H=t(70919),q=t(16861),G=t(60960),Y=t(62523),J=t(59409),Q=t(40968),ee=t(74466);let es=(0,ee.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),et=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(Q.b,{ref:s,className:(0,P.cn)(es(),t),...r})});et.displayName=Q.b.displayName;var ea=t(30285),er=t(20547);let el=er.bL,ei=er.l9,en=r.forwardRef((e,s)=>{let{className:t,align:r="center",sideOffset:l=4,...i}=e;return(0,a.jsx)(er.ZL,{children:(0,a.jsx)(er.UC,{ref:s,align:r,sideOffset:l,className:(0,P.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",t),...i})})});en.displayName=er.UC.displayName;var eo=t(76981),ed=t(10518);let ec=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(eo.bL,{ref:s,className:(0,P.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",t),...r,children:(0,a.jsx)(eo.C1,{className:(0,P.cn)("flex items-center justify-center text-current"),children:(0,a.jsx)(ed.A,{className:"h-4 w-4"})})})});ec.displayName=eo.bL.displayName;var em=t(66424),eu=t(87481);let eh=["all","passed","failed","skipped","timedOut","pending"],ex=["--suite-color-1-hsl","--suite-color-2-hsl","--suite-color-3-hsl","--suite-color-4-hsl","--suite-color-5-hsl"];function ep(e){var s,t,l,i,m,u;let{report:f,loading:g,error:j,initialFilter:b}=e,[N,v]=(0,r.useState)(b||"all"),[w,y]=(0,r.useState)(""),[k,A]=(0,r.useState)([]),[S,E]=(0,r.useState)([]),[C,L]=(0,r.useState)(!1),[R,F]=(0,r.useState)("all"),[D,M]=(0,r.useState)(["all"]),[Z,I]=(0,r.useState)("all"),[W,_]=(0,r.useState)(["all"]),[K,P]=(0,r.useState)(!1),{toast:U}=(0,eu.dj)();(0,r.useEffect)(()=>{b&&v(b)},[b]),(0,r.useEffect)(()=>{if(null==f?void 0:f.results){let e=new Set,s=new Set,t=new Set;f.results.forEach(a=>{var r;null===(r=a.tags)||void 0===r||r.forEach(s=>e.add(s)),a.browser&&s.add(a.browser),a.suiteName?t.add(a.suiteName):t.add("Untitled Suite")}),E(Array.from(e).sort()),M(["all",...Array.from(s).sort()]),_(["all",...Array.from(t).sort()])}},[f]);let Q=(0,r.useMemo)(()=>"all"!==N||""!==w||k.length>0||"all"!==R||"all"!==Z||K,[N,w,k,R,Z,K]),ee=(0,r.useMemo)(()=>{if(!(null==f?void 0:f.results))return[];let e=f.results.filter(e=>{let s="all"===N||e.status===N||"failed"===N&&"timedOut"===e.status,t=(e.name||"").toLowerCase().includes(w.toLowerCase())||(e.suiteName||"").toLowerCase().includes(w.toLowerCase()),a=0===k.length||e.tags&&e.tags.some(e=>k.includes(e)),r="all"===R||e.browser===R,l=e.suiteName||"Untitled Suite",i="all"===Z||l===Z,n=!K||K&&e.retries>0;return s&&t&&a&&r&&i&&n}),s=new Map;return e.forEach(e=>{let t=e.suiteName||"Untitled Suite";s.has(t)||s.set(t,{tests:[],stats:{total:0,passed:0,failed:0,skipped:0,pending:0}});let a=s.get(t);a.tests.push(e),a.stats.total++,"passed"===e.status?a.stats.passed++:"failed"===e.status||"timedOut"===e.status?a.stats.failed++:"skipped"===e.status?a.stats.skipped++:"pending"===e.status&&a.stats.pending++}),Array.from(s.entries()).map(e=>{let[s,t]=e;return{title:s,tests:t.tests,stats:t.stats}}).sort((e,s)=>s.stats.failed-e.stats.failed||s.stats.total-e.stats.total||e.title.localeCompare(s.title))},[f,N,w,k,R,Z,K]);return g?(0,a.jsxs)(n.Zp,{className:"shadow-xl",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsx)(o.E,{className:"h-6 w-48"}),(0,a.jsx)(o.E,{className:"h-4 w-64 mt-1"})]}),(0,a.jsxs)(n.Wu,{className:"space-y-4",children:[(0,a.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,a.jsx)(o.E,{className:"h-10 w-full"}),(0,a.jsx)(o.E,{className:"h-10 w-full"}),(0,a.jsx)(o.E,{className:"h-10 w-full"}),(0,a.jsx)(o.E,{className:"h-10 w-full"}),(0,a.jsx)(o.E,{className:"h-10 w-full"}),(0,a.jsx)(o.E,{className:"h-10 w-full"}),(0,a.jsx)(o.E,{className:"h-10 w-full"})]}),[void 0,void 0,void 0].map((e,s)=>(0,a.jsxs)("div",{className:"space-y-2 p-2 border rounded-lg shadow-md",children:[(0,a.jsx)(o.E,{className:"h-5 w-1/3"}),(0,a.jsx)(o.E,{className:"h-8 w-full"}),(0,a.jsx)(o.E,{className:"h-8 w-full"})]},s))]})]}):j?(0,a.jsxs)(d.Fc,{variant:"destructive",className:"mt-4 shadow-md",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"}),(0,a.jsx)(d.XL,{children:"Error Fetching Test Results"}),(0,a.jsx)(d.TN,{children:j})]}):f&&f.results&&0!==f.results.length?(0,a.jsxs)(n.Zp,{className:"shadow-xl",children:[(0,a.jsxs)(n.aR,{className:"flex flex-row items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(n.ZB,{className:"text-2xl font-headline text-primary",children:"Test Results"}),((null===(s=f.metadata)||void 0===s?void 0:s.generatedAt)||(null===(t=f.run)||void 0===t?void 0:t.timestamp))&&(0,a.jsxs)(n.BT,{children:["Last updated:"," ",new Date(f.metadata.generatedAt||f.run.timestamp).toLocaleString()]})]}),(0,a.jsxs)(ea.$,{onClick:()=>{if(!f||!f.results||0===f.results.length){U({title:"Export Failed",description:"No data available to export.",variant:"destructive"});return}let e=["id","name","suiteName","status","duration","startTime","endTime","browser","retries","tags","stdout","stderr","workerId"],s=e=>{if(null==e)return"";let s=String(e);return(s.includes(",")||s.includes('"')||s.includes("\n"))&&(s='"'.concat(s.replace(/"/g,'""'),'"')),s},t=e.map(s).join(",")+"\n";f.results.forEach(a=>{let r=e.map(e=>{let t;switch(e){case"tags":t=a.tags?a.tags.join("; "):"";break;case"stdout":t=a.stdout?a.stdout.join("\\n"):"";break;case"stderr":t=a.errorMessage||"";break;case"workerId":t=void 0!==a.workerId&&null!==a.workerId?String(a.workerId):"";break;default:t=a[e]}return s(t)});t+=r.join(",")+"\n"});let a=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(a),l=document.createElement("a");l.setAttribute("href",r);let i="data";if(f.run&&f.run.id&&"string"==typeof f.run.id&&""!==f.run.id.trim()){let e=f.run.id.trim().split("-");e.length>1&&"run"===e[0].toLowerCase()&&e[1]&&""!==e[1].trim()?i=e[1]:e.length>0&&""!==e[0].trim()&&(i=e[0])}else if(f.run&&f.run.timestamp)try{i=String(new Date(f.run.timestamp).getTime())}catch(e){}let n="run-".concat(i,".csv");l.setAttribute("download",n),l.style.visibility="hidden",document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(r),U({title:"Export Successful",description:"".concat(n," has been downloaded.")})},variant:"outline",size:"sm",className:"ml-auto rounded-md shadow-md",children:[(0,a.jsx)(X.A,{className:"mr-2 h-4 w-4"}),"Export as CSV"]})]}),(0,a.jsxs)(n.Wu,{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"p-6 border rounded-xl bg-muted/50 shadow-lg space-y-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(et,{htmlFor:"status-filter",className:"text-sm font-medium text-muted-foreground",children:"Filter by Status"}),(0,a.jsxs)(J.l6,{value:N,onValueChange:e=>v(e),children:[(0,a.jsx)(J.bq,{id:"status-filter",className:"w-full bg-background shadow-inner rounded-md",children:(0,a.jsx)(J.yv,{placeholder:"Select status"})}),(0,a.jsx)(J.gC,{className:"rounded-md",children:eh.map(e=>(0,a.jsx)(J.eb,{value:e,className:"capitalize",children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(et,{htmlFor:"search-filter",className:"text-sm font-medium text-muted-foreground",children:"Search by Name/Suite"}),(0,a.jsx)(Y.p,{id:"search-filter",type:"text",placeholder:"Enter test or suite name...",value:w,onChange:e=>y(e.target.value),className:"w-full bg-background shadow-inner rounded-md"})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(et,{className:"text-sm font-medium text-muted-foreground",children:"Filter by Tags"}),(0,a.jsxs)(el,{open:C,onOpenChange:L,children:[(0,a.jsx)(ei,{asChild:!0,children:(0,a.jsxs)(ea.$,{variant:"outline",className:"w-full bg-background shadow-inner justify-between rounded-md",children:[k.length>0?"Tags (".concat(k.length,")"):"Select Tags",(0,a.jsx)($.A,{className:"ml-2 h-4 w-4 opacity-50"})]})}),(0,a.jsxs)(en,{className:"w-[var(--radix-popover-trigger-width)] p-0 rounded-md",align:"start",children:[(0,a.jsx)("div",{className:"p-2 border-b",children:(0,a.jsx)("p",{className:"text-sm font-medium",children:"Filter by Tags"})}),(0,a.jsx)(em.F,{className:"h-48",children:(0,a.jsx)("div",{className:"p-2 space-y-1",children:S.length>0?S.map(e=>(0,a.jsxs)(et,{htmlFor:"tag-".concat(e),className:"flex items-center space-x-2 p-1.5 rounded-md hover:bg-accent/10 cursor-pointer",children:[(0,a.jsx)(ec,{id:"tag-".concat(e),checked:k.includes(e),onCheckedChange:s=>{A(t=>!0===s?[...t,e]:t.filter(s=>s!==e))},className:"rounded-sm"}),(0,a.jsx)("span",{children:e})]},e)):(0,a.jsx)("p",{className:"text-xs text-muted-foreground p-2",children:"No tags available in this report."})})}),k.length>0&&(0,a.jsx)("div",{className:"p-2 border-t flex justify-end",children:(0,a.jsx)(ea.$,{variant:"ghost",size:"sm",onClick:()=>A([]),children:"Clear selected"})})]})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(et,{htmlFor:"browser-filter",className:"text-sm font-medium text-muted-foreground",children:"Filter by Browser"}),(0,a.jsxs)(J.l6,{value:R,onValueChange:F,children:[(0,a.jsx)(J.bq,{id:"browser-filter",className:"w-full bg-background shadow-inner rounded-md",children:(0,a.jsx)(J.yv,{placeholder:"Select browser"})}),(0,a.jsx)(J.gC,{className:"rounded-md",children:D.map(e=>(0,a.jsx)(J.eb,{value:e,className:"capitalize",children:"all"===e?"All Browsers":e},e))})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(et,{htmlFor:"suite-filter",className:"text-sm font-medium text-muted-foreground",children:"Filter by Test Suite"}),(0,a.jsxs)(J.l6,{value:Z,onValueChange:I,children:[(0,a.jsx)(J.bq,{id:"suite-filter",className:"w-full bg-background shadow-inner rounded-md",children:(0,a.jsx)(J.yv,{placeholder:"Select test suite"})}),(0,a.jsx)(J.gC,{className:"rounded-md",children:W.map(e=>(0,a.jsx)(J.eb,{value:e,className:"capitalize truncate",children:"all"===e?"All Suites":e.length>40?e.substring(0,37)+"...":e},e))})]})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2 pt-5",children:[(0,a.jsx)(ec,{id:"retries-filter",checked:K,onCheckedChange:e=>P(!!e),className:"rounded-sm"}),(0,a.jsxs)(et,{htmlFor:"retries-filter",className:"text-sm font-medium text-muted-foreground cursor-pointer flex items-center",children:[(0,a.jsx)(H.A,{className:"h-4 w-4 mr-1.5 text-muted-foreground"}),"Retries Only"]})]})]}),Q&&(0,a.jsx)("div",{className:"mt-4 flex justify-end",children:(0,a.jsxs)(ea.$,{variant:"ghost",onClick:()=>{v("all"),y(""),A([]),F("all"),I("all"),P(!1)},className:"text-sm rounded-md",children:[(0,a.jsx)(q.A,{className:"mr-2 h-4 w-4"}),"Clear All Filters"]})})]}),k.length>0&&(0,a.jsxs)("div",{className:"mb-4 flex flex-wrap gap-2 items-center",children:[(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:"Active tags:"}),k.map(e=>(0,a.jsxs)(z.E,{variant:"secondary",className:"flex items-center rounded-full",children:[e,(0,a.jsx)("button",{type:"button","aria-label":"Remove ".concat(e," filter"),onClick:()=>{A(s=>s.filter(s=>s!==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,a.jsx)(h.A,{className:"h-3.5 w-3.5"})})]},e))]}),ee.length>0?(0,a.jsx)(O.nD,{type:"multiple",className:"w-full space-y-3",children:ee.map((e,s)=>(0,a.jsxs)(O.As,{value:"suite-".concat(e.title.replace(/\s+/g,"-"),"-").concat(s),className:"border rounded-xl shadow-lg bg-card hover:shadow-xl transition-shadow duration-300",children:[(0,a.jsx)(O.$m,{className:"p-4 hover:no-underline text-left w-full group",children:(0,a.jsx)("div",{className:"flex justify-between items-center w-full",children:(0,a.jsxs)("div",{className:"flex-grow min-w-0",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold group-hover:opacity-80 transition-opacity",title:e.title,style:{color:"hsl(var(".concat(ex[s%ex.length],"))")},children:e.title}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1.5 mt-2",children:[(0,a.jsxs)(z.E,{variant:"outline",className:"text-xs border-muted-foreground/50",children:[(0,a.jsx)(G.A,{className:"mr-1.5 h-3 w-3 text-muted-foreground"}),"Total: ",e.stats.total]}),(0,a.jsxs)(z.E,{variant:"outline",className:"text-xs",style:{color:"hsl(var(--chart-3))",borderColor:"hsl(var(--chart-3) / 0.5)"},children:[(0,a.jsx)(B.A,{className:"mr-1.5 h-3 w-3"}),"Passed: ",e.stats.passed]}),(0,a.jsxs)(z.E,{variant:"outline",className:"text-xs",style:{color:"hsl(var(--destructive))",borderColor:"hsl(var(--destructive) / 0.5)"},children:[(0,a.jsx)(h.A,{className:"mr-1.5 h-3 w-3"}),"Failed: ",e.stats.failed]}),(0,a.jsxs)(z.E,{variant:"outline",className:"text-xs",style:{color:"hsl(var(--accent))",borderColor:"hsl(var(--accent) / 0.5)"},children:[(0,a.jsx)(x.A,{className:"mr-1.5 h-3 w-3"}),"Skipped: ",e.stats.skipped]}),e.stats.pending>0&&(0,a.jsxs)(z.E,{variant:"outline",className:"text-xs",style:{color:"hsl(var(--primary))",borderColor:"hsl(var(--primary) / 0.5)"},children:[(0,a.jsx)(p.A,{className:"mr-1.5 h-3 w-3"}),"Pending: ",e.stats.pending]})]})]})})}),(0,a.jsx)(O.ub,{className:"p-4 pt-0",children:e.tests.length>0?(0,a.jsx)("div",{className:"space-y-1 mt-2",children:e.tests.map(e=>(0,a.jsx)(V,{test:e},e.id))}):(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:"No tests in this suite match the current filters."})})]},"suite-".concat(e.title.replace(/\s+/g,"-"),"-").concat(s)))}):(0,a.jsxs)("div",{className:"text-center py-8",children:[(0,a.jsx)("p",{className:"text-muted-foreground text-lg",children:"No test results match your current filters."}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Try adjusting the status, search term, or tag filters."})]})]})]}):(0,a.jsxs)(n.Zp,{className:"shadow-xl",children:[(0,a.jsx)(n.aR,{className:"flex flex-row items-center justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(n.ZB,{className:"text-2xl font-headline text-primary",children:"Test Results"}),((null==f?void 0:null===(l=f.metadata)||void 0===l?void 0:l.generatedAt)||(null==f?void 0:null===(i=f.run)||void 0===i?void 0:i.timestamp))&&(0,a.jsxs)(n.BT,{children:["Last updated:"," ",new Date((null===(m=f.metadata)||void 0===m?void 0:m.generatedAt)||(null===(u=f.run)||void 0===u?void 0:u.timestamp)||Date.now()).toLocaleString()]})]})}),(0,a.jsx)(n.Wu,{children:(0,a.jsxs)(d.Fc,{className:"shadow-sm rounded-lg",children:[(0,a.jsx)(T.A,{className:"h-4 w-4"}),(0,a.jsx)(d.XL,{children:"No Test Data"}),(0,a.jsx)(d.TN,{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 ef=t(83540),eg=t(93504),ej=t(94754),eb=t(96025),eN=t(16238),ev=t(94517),ew=t(24026),ey=t(21374),ek=t(3401),eA=t(83394),eS=t(80659),eE=t(50286);let eT=e=>{let{active:s,payload:t,label:r}=e;return s&&t&&t.length?(0,a.jsxs)("div",{className:"custom-recharts-tooltip",children:[(0,a.jsx)("p",{className:"label",children:"Date: ".concat(r)}),t.map((e,s)=>{var t;return(0,a.jsx)("p",{style:{color:e.color},className:"text-xs",children:"".concat(e.name,": ").concat(null===(t=e.value)||void 0===t?void 0:t.toLocaleString()).concat(e.unit||"")},"item-".concat(s))})]}):null},eC=r.memo(e=>{let{trends:s,loading:t,error:l}=e,i=r.useRef(null),m=r.useRef(null),u=r.useRef(null),h=r.useMemo(()=>s&&0!==s.length?s.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})):[],[s]);if(t)return(0,a.jsxs)(n.Zp,{className:"shadow-xl rounded-xl backdrop-blur-md bg-card/80 border-border/50",children:[(0,a.jsx)(n.aR,{children:(0,a.jsxs)(n.ZB,{className:"flex items-center text-2xl font-headline text-primary",children:[(0,a.jsx)(eS.A,{className:"h-7 w-7 mr-2"}),"Historical Trend Analysis"]})}),(0,a.jsx)(n.Wu,{className:"space-y-8 p-6",children:[void 0,void 0,void 0].map((e,s)=>(0,a.jsxs)("div",{className:"bg-muted/30 p-4 rounded-lg shadow-inner",children:[(0,a.jsx)(o.E,{className:"h-6 w-1/3 mb-4 rounded-md bg-muted/50"}),(0,a.jsx)(o.E,{className:"h-64 w-full rounded-md bg-muted/50"})]},s))})]});if(l)return(0,a.jsxs)(d.Fc,{variant:"destructive",className:"mt-4 shadow-md rounded-lg",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"}),(0,a.jsx)(d.XL,{children:"Error Fetching Historical Trends"}),(0,a.jsx)(d.TN,{children:l})]});if(!s||0===s.length)return(0,a.jsxs)(n.Zp,{className:"shadow-xl rounded-xl backdrop-blur-md bg-card/80 border-border/50",children:[(0,a.jsx)(n.aR,{children:(0,a.jsxs)(n.ZB,{className:"flex items-center text-2xl font-headline text-primary",children:[(0,a.jsx)(eS.A,{className:"h-7 w-7 mr-2"}),"Historical Trend Analysis"]})}),(0,a.jsx)(n.Wu,{className:"p-6",children:(0,a.jsxs)(d.Fc,{className:"rounded-lg border-primary/30 bg-primary/5 text-primary",children:[(0,a.jsx)(T.A,{className:"h-5 w-5 text-primary/80"}),(0,a.jsx)(d.XL,{className:"font-semibold",children:"No Historical Data"}),(0,a.jsx)(d.TN,{children:"No historical trend data available. Ensure 'trend-*.json' files exist in 'pulse-report/history/' and are correctly formatted."})]})})]});let x=h.some(e=>"number"==typeof e.workerCount&&e.workerCount>0);return(0,a.jsxs)(n.Zp,{className:"shadow-xl rounded-xl backdrop-blur-md bg-card/80 border-border/50",children:[(0,a.jsx)(n.aR,{children:(0,a.jsxs)(n.ZB,{className:"text-2xl font-headline text-primary flex items-center",children:[(0,a.jsx)(eS.A,{className:"h-7 w-7 mr-2"}),"Historical Trend Analysis"]})}),(0,a.jsxs)(n.Wu,{className:"space-y-10 p-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,a.jsx)("h4",{className:"text-xl font-semibold text-foreground",children:"Test Outcomes Over Time"})}),(0,a.jsx)("div",{ref:i,className:"w-full h-[350px] bg-muted/30 p-4 rounded-lg shadow-inner",children:(0,a.jsx)(ef.u,{width:"100%",height:"100%",children:(0,a.jsxs)(eg.b,{data:h,margin:{top:5,right:20,left:0,bottom:5},children:[(0,a.jsx)(ej.d,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,a.jsx)(eb.W,{dataKey:"date",stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12}}),(0,a.jsx)(eN.h,{stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12}}),(0,a.jsx)(ev.m,{content:(0,a.jsx)(eT,{}),cursor:{fill:"hsl(var(--muted))",fillOpacity:.2}}),(0,a.jsx)(ew.s,{wrapperStyle:{fontSize:"12px",paddingTop:"10px"}}),(0,a.jsx)(ey.N,{type:"monotone",dataKey:"totalTests",name:"Total Tests",stroke:"hsl(var(--chart-2))",strokeWidth:2,dot:{r:3},activeDot:{r:6}}),(0,a.jsx)(ey.N,{type:"monotone",dataKey:"passed",name:"Passed",stroke:"hsl(var(--chart-3))",strokeWidth:2,dot:{r:3},activeDot:{r:6}}),(0,a.jsx)(ey.N,{type:"monotone",dataKey:"failed",name:"Failed",stroke:"hsl(var(--chart-4))",strokeWidth:2,dot:{r:3},activeDot:{r:6}}),(0,a.jsx)(ey.N,{type:"monotone",dataKey:"skipped",name:"Skipped",stroke:"hsl(var(--chart-5))",strokeWidth:2,dot:{r:3},activeDot:{r:6}})]})})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,a.jsx)("h4",{className:"text-xl font-semibold text-foreground",children:"Test Duration Over Time"})}),(0,a.jsx)("div",{ref:m,className:"w-full h-[350px] bg-muted/30 p-4 rounded-lg shadow-inner",children:(0,a.jsx)(ef.u,{width:"100%",height:"100%",children:(0,a.jsxs)(ek.E,{data:h,margin:{top:5,right:20,left:0,bottom:5},children:[(0,a.jsx)(ej.d,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,a.jsx)(eb.W,{dataKey:"date",stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12}}),(0,a.jsx)(eN.h,{stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12},unit:"s",name:"Seconds"}),(0,a.jsx)(ev.m,{content:(0,a.jsx)(eT,{}),cursor:{fill:"hsl(var(--muted))",fillOpacity:.2}}),(0,a.jsx)(ew.s,{wrapperStyle:{fontSize:"12px",paddingTop:"10px"}}),(0,a.jsx)(eA.y,{dataKey:"durationSeconds",name:"Duration (s)",fill:"hsl(var(--chart-1))",radius:[6,6,0,0],barSize:20})]})})})]}),x&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,a.jsxs)("h4",{className:"text-xl font-semibold text-foreground flex items-center",children:[(0,a.jsx)(eE.A,{className:"h-5 w-5 mr-2 text-primary"})," Active Worker Count Over Time"]})}),(0,a.jsx)("div",{ref:u,className:"w-full h-[350px] bg-muted/30 p-4 rounded-lg shadow-inner",children:(0,a.jsx)(ef.u,{width:"100%",height:"100%",children:(0,a.jsxs)(eg.b,{data:h.filter(e=>"number"==typeof e.workerCount),margin:{top:5,right:20,left:0,bottom:5},children:[(0,a.jsx)(ej.d,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,a.jsx)(eb.W,{dataKey:"date",stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12}}),(0,a.jsx)(eN.h,{stroke:"hsl(var(--muted-foreground))",tick:{fontSize:12},allowDecimals:!1,domain:["dataMin","dataMax"]}),(0,a.jsx)(ev.m,{content:(0,a.jsx)(eT,{}),cursor:{fill:"hsl(var(--muted))",fillOpacity:.2}}),(0,a.jsx)(ew.s,{wrapperStyle:{fontSize:"12px",paddingTop:"10px"}}),(0,a.jsx)(ey.N,{type:"monotone",dataKey:"workerCount",name:"Active Workers",stroke:"hsl(var(--chart-info))",strokeWidth:2,dot:{r:3},activeDot:{r:6},connectNulls:!1})]})})}),(0,a.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."})]})]})]})});eC.displayName="TrendAnalysis";var eL=t(34477);let eR=(0,eL.createServerReference)("00726f4a2d03b7e1982c9028d63d09cd83408f916d",eL.callServer,void 0,eL.findSourceMapURL,"getFlakyTestsAnalysis");var eF=t(59069),eD=t(80621),eM=t(98328);function eO(e){let{status:s}=e,t={},r=(0,a.jsx)(p.A,{className:"h-3 w-3 mr-1"}),l=s;switch(s){case"passed":t={backgroundColor:"hsl(var(--chart-3) / 0.1)",color:"hsl(var(--chart-3))",borderColor:"hsl(var(--chart-3) / 0.3)"},r=(0,a.jsx)(u.A,{className:"h-3 w-3 mr-1",style:{color:"hsl(var(--chart-3))"}}),l="passed";break;case"failed":case"timedOut":t={backgroundColor:"hsl(var(--destructive) / 0.1)",color:"hsl(var(--destructive))",borderColor:"hsl(var(--destructive) / 0.3)"},r=(0,a.jsx)(h.A,{className:"h-3 w-3 mr-1",style:{color:"hsl(var(--destructive))"}}),l="failed"===s?"failed":"timedOut";break;case"skipped":t={backgroundColor:"hsl(var(--accent) / 0.1)",color:"hsl(var(--accent))",borderColor:"hsl(var(--accent) / 0.3)"},r=(0,a.jsx)(x.A,{className:"h-3 w-3 mr-1",style:{color:"hsl(var(--accent))"}}),l="skipped";break;case"pending":t={backgroundColor:"hsl(var(--primary) / 0.1)",color:"hsl(var(--primary))",borderColor:"hsl(var(--primary) / 0.3)"},r=(0,a.jsx)(p.A,{className:"h-3 w-3 mr-1",style:{color:"hsl(var(--primary))"}}),l="pending";break;default:t={backgroundColor:"hsl(var(--muted) / 0.5)",color:"hsl(var(--muted-foreground))",borderColor:"hsl(var(--border))"}}return(0,a.jsxs)(z.E,{variant:"outline",className:"capitalize text-xs px-2 py-0.5 whitespace-nowrap border",style:t,children:[r,l]})}function ez(){let[e,s]=(0,r.useState)(null),[t,l]=(0,r.useState)(!0),[i,m]=(0,r.useState)(null);if((0,r.useEffect)(()=>{(async function(){l(!0),m(null);let e=await eR();e.success&&e.flakyTests?s(e.flakyTests):m(e.error||"Failed to fetch flaky test analysis."),l(!1)})()},[]),t)return(0,a.jsxs)(n.Zp,{className:"shadow-xl",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsx)(o.E,{className:"h-7 w-48 mb-1"}),(0,a.jsx)(o.E,{className:"h-4 w-3/4"})]}),(0,a.jsx)(n.Wu,{className:"space-y-4",children:[void 0,void 0,void 0].map((e,s)=>(0,a.jsxs)("div",{className:"p-4 border rounded-lg space-y-2",children:[(0,a.jsx)(o.E,{className:"h-5 w-2/3"}),(0,a.jsx)(o.E,{className:"h-4 w-1/2"}),(0,a.jsx)(o.E,{className:"h-4 w-1/3"})]},s))})]});if(i)return(0,a.jsxs)(d.Fc,{variant:"destructive",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"}),(0,a.jsx)(d.XL,{children:"Flaky Test Analysis Error"}),(0,a.jsx)(d.TN,{children:i})]});if(!e||0===e.length)return(0,a.jsxs)(n.Zp,{className:"shadow-xl",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsxs)(n.ZB,{className:"text-2xl font-headline text-primary flex items-center",children:[(0,a.jsx)(eF.A,{className:"h-7 w-7 mr-2"}),"Flaky Test Analysis"]}),(0,a.jsx)(n.BT,{children:"Analysis of tests that have shown inconsistent pass/fail behavior across historical runs."})]}),(0,a.jsx)(n.Wu,{children:(0,a.jsxs)(d.Fc,{children:[(0,a.jsx)(u.A,{className:"h-4 w-4"}),(0,a.jsx)(d.XL,{children:"No Flaky Tests Identified"}),(0,a.jsx)(d.TN,{children:"No tests were identified as flaky based on the available historical data."})]})})]});let x=e=>{if(!e)return"Unknown Test";let s=e.split(" > ");return s[s.length-1]||e};return(0,a.jsxs)(n.Zp,{className:"shadow-xl",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsxs)(n.ZB,{className:"text-2xl font-headline text-primary flex items-center",children:[(0,a.jsx)(eF.A,{className:"h-7 w-7 mr-2"}),"Flaky Test Analysis (",e.length,")"]}),(0,a.jsx)(n.BT,{children:"Tests that have shown inconsistent pass/fail behavior across historical runs. Click on a test to see its run history."})]}),(0,a.jsx)(n.Wu,{children:(0,a.jsx)(O.nD,{type:"multiple",className:"w-full space-y-3",children:e.map((e,s)=>(0,a.jsxs)(O.As,{value:"flaky-".concat(e.id,"-").concat(s),className:"border rounded-lg bg-card hover:bg-muted/20 transition-colors",children:[(0,a.jsx)(O.$m,{className:"p-4 text-left hover:no-underline",children:(0,a.jsxs)("div",{className:"flex flex-col w-full",children:[(0,a.jsx)(I(),{href:"/test/".concat(e.id),className:"hover:underline text-base font-semibold text-primary",onClick:e=>e.stopPropagation(),children:x(e.name)}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Suite: ",e.suiteName]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs mt-2 items-center",children:[(0,a.jsxs)(z.E,{variant:"outline",style:{borderColor:"hsl(var(--chart-3))",color:"hsl(var(--chart-3))"},children:[(0,a.jsx)(u.A,{className:"h-3 w-3 mr-1.5"})," ",e.passedCount," Passed"]}),(0,a.jsxs)(z.E,{variant:"outline",style:{borderColor:"hsl(var(--destructive))",color:"hsl(var(--destructive))"},children:[(0,a.jsx)(h.A,{className:"h-3 w-3 mr-1.5"})," ",e.failedCount," Failed"]}),(0,a.jsxs)(z.E,{variant:"secondary",children:[(0,a.jsx)(eD.A,{className:"h-3 w-3 mr-1.5"})," ",e.totalRuns," Total Runs"]}),(0,a.jsxs)(z.E,{variant:"outline",className:"text-xs",children:[(0,a.jsx)(eM.A,{className:"h-3 w-3 mr-1.5"}),"Seen: ",new Date(e.firstSeen).toLocaleDateString()," - ",new Date(e.lastSeen).toLocaleDateString()]})]})]})}),(0,a.jsxs)(O.ub,{className:"p-4 pt-0",children:[(0,a.jsxs)("h4",{className:"text-sm font-semibold mb-2 text-foreground",children:["Run History (",e.occurrences.length,"):"]}),(0,a.jsx)("div",{className:"max-h-60 overflow-y-auto space-y-1.5 pr-2",children:e.occurrences.map((e,s)=>(0,a.jsxs)("div",{className:"flex justify-between items-center text-xs p-1.5 bg-muted/30 rounded-md",children:[(0,a.jsx)("span",{children:new Date(e.runTimestamp).toLocaleString()}),(0,a.jsx)(eO,{status:e.status})]},s))})]})]},e.id+s))})})]})}var eZ=t(4884);let eI=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(eZ.bL,{className:(0,P.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",t),...r,ref:s,children:(0,a.jsx)(eZ.zi,{className:(0,P.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 eB(){let[e,s]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e;let 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,a.jsxs)(n.Zp,{className:"shadow-xl",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsx)(n.ZB,{className:"text-2xl font-headline text-primary",children:"Settings"}),(0,a.jsx)(n.BT,{children:"Customize the appearance of the dashboard."})]}),(0,a.jsx)(n.Wu,{children:(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-card/70 shadow-sm",children:[(0,a.jsx)(et,{htmlFor:"theme-toggle",className:"text-base font-medium text-foreground",children:"Theme"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:e?"Dark Mode":"Light Mode"}),(0,a.jsx)(eI,{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,a.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,a.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-card/70 shadow-sm",children:[(0,a.jsx)("span",{children:"Learn more from Documentation Website: "}),(0,a.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"})]})]})})]})}eI.displayName=eZ.bL.displayName;var eW=t(74074),e_=t(54583);let eK=[{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."}],eP="Other Errors";function eU(e){if(!e)return"Unknown Test";let s=e.split(" > ");return s[s.length-1]||e}function eV(){let{currentRun:e,loadingCurrent:s,errorCurrent:t}=(0,i.O)(),l=(0,r.useMemo)(()=>{if(!(null==e?void 0:e.results))return[];let s=e.results.filter(e=>"failed"===e.status||"timedOut"===e.status),t=new Map;s.forEach(e=>{let s=(e.errorMessage||"Unknown error").replace(/\u001b\[[0-9;]*[mGKH]/g,"").toLowerCase(),a=!1;for(let r of eK)if(r.keywords.some(e=>s.includes(e.toLowerCase()))){t.has(r.name)||t.set(r.name,{tests:[],exampleErrorMessages:[]}),t.get(r.name).tests.push(e),t.get(r.name).exampleErrorMessages.length<3&&t.get(r.name).exampleErrorMessages.push(e.errorMessage),a=!0;break}!a&&(t.has(eP)||t.set(eP,{tests:[],exampleErrorMessages:[]}),t.get(eP).tests.push(e),t.get(eP).exampleErrorMessages.length<3&&t.get(eP).exampleErrorMessages.push(e.errorMessage))});let a=[];return t.forEach((e,s)=>{a.push({categoryName:s,count:e.tests.length,tests:e.tests,exampleErrorMessages:e.exampleErrorMessages})}),a.sort((e,s)=>s.count-e.count),a},[e]);if(s)return(0,a.jsx)("div",{className:"space-y-6",children:[void 0,void 0,void 0].map((e,s)=>(0,a.jsxs)(n.Zp,{className:"shadow-lg",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsx)(o.E,{className:"h-7 w-1/2 mb-2"}),(0,a.jsx)(o.E,{className:"h-4 w-3/4"})]}),(0,a.jsxs)(n.Wu,{children:[(0,a.jsx)(o.E,{className:"h-10 w-full"}),(0,a.jsx)(o.E,{className:"h-10 w-full mt-2"})]})]},s))});if(t)return(0,a.jsxs)(d.Fc,{variant:"destructive",className:"shadow-md",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"}),(0,a.jsx)(d.XL,{children:"Error Fetching Data"}),(0,a.jsx)(d.TN,{children:t})]});if(!e||!e.results)return(0,a.jsxs)(d.Fc,{className:"shadow-md",children:[(0,a.jsx)(T.A,{className:"h-4 w-4"}),(0,a.jsx)(d.XL,{children:"No Data Available"}),(0,a.jsx)(d.TN,{children:"The current run report ('playwright-pulse-report.json') could not be loaded or is empty."})]});let m=e.results.filter(e=>"failed"===e.status||"timedOut"===e.status).length;return 0===m?(0,a.jsxs)(d.Fc,{variant:"default",className:"shadow-md border-green-500 bg-green-50 dark:bg-green-900/30",children:[(0,a.jsx)(u.A,{className:"h-5 w-5 text-green-600"}),(0,a.jsx)(d.XL,{className:"text-green-700 dark:text-green-400",children:"No Failures Found!"}),(0,a.jsx)(d.TN,{className:"text-green-600 dark:text-green-300",children:"Excellent! There are no failed or timed out tests in the current run report."})]}):0===l.length&&m>0?(0,a.jsxs)(d.Fc,{className:"shadow-md",children:[(0,a.jsx)(eW.A,{className:"h-4 w-4"}),(0,a.jsx)(d.XL,{children:"Failures Present, But Not Categorized"}),(0,a.jsxs)(d.TN,{children:["There are ",m,' 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,a.jsxs)("div",{className:"space-y-6",children:[l.map(e=>{let s=eK.find(s=>s.name===e.categoryName),t=e.exampleErrorMessages[0],r=t?(0,P.cA)(t.substring(0,150)):"",l=t&&t.length>150;return(0,a.jsxs)(n.Zp,{className:"shadow-lg hover:shadow-xl transition-shadow duration-300",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsxs)(n.ZB,{className:"text-xl font-semibold text-primary flex items-center",children:[(0,a.jsx)(e_.A,{className:"h-6 w-6 mr-2"}),e.categoryName," ",(0,a.jsxs)(z.E,{variant:"secondary",className:"ml-3 text-sm",children:[e.count," tests"]})]}),(null==s?void 0:s.description)&&(0,a.jsx)(n.BT,{className:"text-xs mt-1",children:s.description}),e.categoryName===eP&&t&&(0,a.jsxs)(n.BT,{className:"text-xs mt-1 italic",children:["Example error: ",(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:r}}),l?"...":""]})]}),(0,a.jsx)(n.Wu,{children:e.tests.length>0?(0,a.jsx)(O.nD,{type:"multiple",className:"w-full space-y-2",children:e.tests.map(e=>(0,a.jsxs)(O.As,{value:e.id,className:"border rounded-md bg-card hover:bg-muted/20 transition-colors px-1",children:[(0,a.jsx)(O.$m,{className:"p-3 text-left hover:no-underline text-sm",children:(0,a.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,a.jsxs)("span",{className:"font-medium text-foreground flex-1 min-w-0",title:"".concat(eU(e.name)," (Suite: ").concat(e.suiteName,")"),children:[eU(e.name),(0,a.jsxs)("span",{className:"text-muted-foreground text-xs ml-1",children:["(Suite: ",e.suiteName&&e.suiteName.length>30?"".concat(e.suiteName.substring(0,27),"..."):e.suiteName||"N/A",")"]})]}),(0,a.jsx)(_.A,{className:"h-4 w-4 text-muted-foreground group-data-[state=open]:rotate-90 transition-transform"})]})}),(0,a.jsxs)(O.ub,{className:"p-3 pt-0",children:[(0,a.jsx)(I(),{href:"/test/".concat(e.id),className:"text-xs text-primary hover:underline mb-2 block",children:"View full test details"}),(0,a.jsx)("h5",{className:"text-xs font-semibold text-muted-foreground mb-1",children:"Error Message:"}),(0,a.jsx)(em.F,{className:"max-h-32 w-full",children:(0,a.jsx)("pre",{className:"text-xs whitespace-pre-wrap break-words font-code bg-muted/30 p-2 rounded-sm",children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,P.cA)(e.errorMessage||"No error message captured.")}})})})]})]},e.id))}):(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No tests found in this category."})})]},e.categoryName)}),0===l.length&&(0,a.jsxs)(d.Fc,{className:"shadow-md",children:[(0,a.jsx)(eW.A,{className:"h-4 w-4"}),(0,a.jsx)(d.XL,{children:"No Failures Categorized"}),(0,a.jsx)(d.TN,{children:"Could not categorize any failures based on the current rules."})]})]})}var eX=t(99708),e$=t(15546),eH=t(87489);let eq=r.forwardRef((e,s)=>{let{className:t,orientation:r="horizontal",decorative:l=!0,...i}=e;return(0,a.jsx)(eH.b,{ref:s,decorative:l,orientation:r,className:(0,P.cn)("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...i})});eq.displayName=eH.b.displayName;var eG=t(15452),eY=t(25318);let eJ=eG.bL;eG.l9,eG.bm;let eQ=eG.ZL,e0=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(eG.hJ,{className:(0,P.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",t),...r,ref:s})});e0.displayName=eG.hJ.displayName;let e1=(0,ee.F)("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"}}),e4=r.forwardRef((e,s)=>{let{side:t="right",className:r,children:l,...i}=e;return(0,a.jsxs)(eQ,{children:[(0,a.jsx)(e0,{}),(0,a.jsxs)(eG.UC,{ref:s,className:(0,P.cn)(e1({side:t}),r),...i,children:[l,(0,a.jsxs)(eG.bm,{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,a.jsx)(eY.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});e4.displayName=eG.UC.displayName,r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(eG.hE,{ref:s,className:(0,P.cn)("text-lg font-semibold text-foreground",t),...r})}).displayName=eG.hE.displayName,r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(eG.VY,{ref:s,className:(0,P.cn)("text-sm text-muted-foreground",t),...r})}).displayName=eG.VY.displayName;var e5=t(46102);let e2=r.createContext(null);function e3(){let e=r.useContext(e2);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}let e6=r.forwardRef((e,s)=>{let{defaultOpen:t=!0,open:l,onOpenChange:i,className:n,style:o,children:d,...c}=e,m=function(){let[e,s]=r.useState(void 0);return r.useEffect(()=>{let e=window.matchMedia("(max-width: ".concat(767,"px)")),t=()=>{s(window.innerWidth<768)};return e.addEventListener("change",t),s(window.innerWidth<768),()=>e.removeEventListener("change",t)},[]),!!e}(),[u,h]=r.useState(!1),[x,p]=r.useState(t),f=null!=l?l:x,g=r.useCallback(e=>{let s="function"==typeof e?e(f):e;i?i(s):p(s),document.cookie="".concat("sidebar_state","=").concat(s,"; path=/; max-age=").concat(604800)},[i,f]),j=r.useCallback(()=>m?h(e=>!e):g(e=>!e),[m,g,h]);r.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),j())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[j]);let b=f?"expanded":"collapsed",N=r.useMemo(()=>({state:b,open:f,setOpen:g,isMobile:m,openMobile:u,setOpenMobile:h,toggleSidebar:j}),[b,f,g,m,u,h,j]);return(0,a.jsx)(e2.Provider,{value:N,children:(0,a.jsx)(e5.Bc,{delayDuration:0,children:(0,a.jsx)("div",{style:{"--sidebar-width":"320px","--sidebar-width-icon":"3.5rem",...o},className:(0,P.cn)("group/sidebar-wrapper flex min-h-svh w-full",n),ref:s,...c,children:d})})})});e6.displayName="SidebarProvider";let e7=r.forwardRef((e,s)=>{let{side:t="left",collapsible:r="icon",className:l,children:i,...n}=e,{isMobile:o,state:d,openMobile:c,setOpenMobile:m}=e3();return o?(0,a.jsxs)(eJ,{open:c,onOpenChange:m,children:[(0,a.jsx)(e0,{className:"bg-black/60 backdrop-blur-sm"}),(0,a.jsx)(e4,{"data-sidebar":"sidebar","data-mobile":"true",className:(0,P.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:t,children:(0,a.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})]}):(0,a.jsx)("aside",{ref:s,"data-sidebar":"sidebar","data-state":d,"data-collapsible":r,"data-side":t,className:(0,P.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"===t?"border-r":"border-l","transition-all duration-300 ease-in-out","collapsed"===d?"w-[var(--sidebar-width-icon)]":"w-[var(--sidebar-width)]",l),...n,children:(0,a.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})});e7.displayName="Sidebar";let e8=r.forwardRef((e,s)=>{let{className:t,onClick:r,...l}=e,{toggleSidebar:i}=e3();return(0,a.jsxs)(ea.$,{ref:s,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:(0,P.cn)("h-7 w-7 md:hidden",t),onClick:e=>{null==r||r(e),i()},...l,children:[(0,a.jsx)(e$.A,{}),(0,a.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});e8.displayName="SidebarTrigger";let e9=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("main",{ref:s,className:(0,P.cn)("relative flex min-h-svh flex-1 flex-col bg-background",t),...r})});e9.displayName="SidebarInset";let se=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("div",{ref:s,"data-sidebar":"header",className:(0,P.cn)("flex flex-col gap-4 p-6",t),...r})});se.displayName="SidebarHeader";let ss=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("div",{ref:s,"data-sidebar":"content",className:(0,P.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",t),...r})});ss.displayName="SidebarContent";let st=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("ul",{ref:s,"data-sidebar":"menu",className:(0,P.cn)("flex w-full min-w-0 flex-col gap-1",t),...r})});st.displayName="SidebarMenu";let sa=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("li",{ref:s,"data-sidebar":"menu-item",className:(0,P.cn)("group/menu-item relative",t),...r})});sa.displayName="SidebarMenuItem";let sr=(0,ee.F)("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"}}),sl=r.forwardRef((e,s)=>{let{asChild:t=!1,isActive:r=!1,variant:l="default",tooltip:i,className:n,children:o,...d}=e,c=t?eX.DX:"button",{isMobile:m,state:u}=e3(),h=(0,a.jsxs)(c,{ref:s,"data-sidebar":"menu-button","data-active":r,className:(0,P.cn)(sr({variant:l}),"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",n),...d,children:[(0,a.jsx)("div",{className:(0,P.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")}),o]});return i?("string"==typeof i&&(i={children:i}),(0,a.jsxs)(e5.m_,{children:[(0,a.jsx)(e5.k$,{asChild:!0,children:h}),(0,a.jsx)(e5.ZI,{side:"right",align:"center",className:(0,P.cn)("collapsed"!==u||m?"hidden":"block"),...i,children:i.children})]})):h});sl.displayName="SidebarMenuButton";let si=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("div",{ref:s,"data-sidebar":"footer",className:(0,P.cn)("flex flex-col gap-2 p-6 mt-auto",t),...r})});si.displayName="SidebarFooter";let sn=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(eq,{ref:s,"data-sidebar":"separator",className:(0,P.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",t),...r})});sn.displayName="SidebarSeparator",r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("div",{ref:s,"data-sidebar":"group",className:(0,P.cn)("relative flex w-full min-w-0 flex-col",t),...r})}).displayName="SidebarGroup",r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(Y.p,{ref:s,"data-sidebar":"input",className:(0,P.cn)("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-[--color-primary]",t),...r})}).displayName="SidebarInput";var so=t(10469),sd=t(18271),sc=t(76570);function sm(){var e;let s;let{currentRun:t,historicalTrends:n,loadingCurrent:o,loadingHistorical:d,errorCurrent:c,errorHistorical:m}=(0,i.O)(),[u,h]=(0,r.useState)("dashboard"),[x,p]=(0,r.useState)(void 0),[f,g]=(0,r.useState)("#7737BF");(0,r.useEffect)(()=>{"live-results"!==u&&x&&p(void 0)},[u,x]);let j=[{id:"dashboard",label:"Dashboard",icon:so.A,description:"Real-time Playwright Test Execution Monitoring & Analysis Overview",labelColorVar:"--sidebar-tab-dashboard-color-hsl"},{id:"live-results",label:"Test Results",icon:G.A,description:"Detailed view of the latest test run results with filters.",labelColorVar:"--sidebar-tab-results-color-hsl"},{id:"trend-analysis",label:"Trend Analysis",icon:eS.A,description:"Historical data visualization for test performance.",labelColorVar:"--sidebar-tab-trends-color-hsl"},{id:"flaky-tests",label:"Flaky Tests",icon:eF.A,description:"Analysis of historically flaky tests.",labelColorVar:"--sidebar-tab-flaky-color-hsl"},{id:"failure-categorization",label:"Failure Categorization",icon:e_.A,description:"Categorize and view common failure types.",labelColorVar:"--sidebar-tab-failures-color-hsl"},{id:"settings",label:"Settings",icon:sd.A,description:"Configure dashboard appearance and preferences.",labelColorVar:"--sidebar-tab-settings-color-hsl"}],b=j.find(e=>"settings"===e.id),N=j.filter(e=>"settings"!==e.id),v=j.find(e=>e.id===u);switch(u){case"dashboard":default:s=(0,a.jsx)(M,{currentRun:t,loading:o,error:c,onMetricClick:e=>{p(e),h("live-results")}});break;case"live-results":s=(0,a.jsx)(ep,{report:t,loading:o,error:c,initialFilter:x});break;case"trend-analysis":s=(0,a.jsx)(eC,{trends:n,loading:d,error:m});break;case"flaky-tests":s=(0,a.jsx)(ez,{});break;case"failure-categorization":s=(0,a.jsx)(eV,{});break;case"settings":s=(0,a.jsx)(eB,{})}return(0,a.jsxs)(e6,{defaultOpen:!0,children:[(0,a.jsxs)(e7,{collapsible:"icon",className:"border-r border-sidebar-border shadow-lg",children:[(0,a.jsxs)(se,{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,a.jsxs)(I(),{href:"/",className:"flex items-center",onClick:()=>h("dashboard"),children:[(0,a.jsx)(l.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,a.jsx)("span",{style:{marginLeft:"10px",color:"#489ef9",fontWeight:900},children:"PULSE DASHBOARD"})]}),(0,a.jsx)(e8,{className:"md:hidden"})]}),(0,a.jsx)(ss,{children:(0,a.jsx)(st,{children:N.map(e=>(0,a.jsx)(sa,{children:(0,a.jsxs)(sl,{onClick:()=>{h(e.id)},isActive:u===e.id,tooltip:{children:e.label,side:"right",align:"center"},children:[(0,a.jsx)(e.icon,{className:"h-5 w-5"}),(0,a.jsx)("span",{style:u===e.id?void 0:e.labelColorVar?{color:"hsl(var(".concat(e.labelColorVar,"))")}:void 0,children:e.label})]})},e.id))})}),(0,a.jsxs)(si,{className:"p-2 mt-auto border-t border-sidebar-border",children:[b&&(0,a.jsx)(st,{className:"group-data-[collapsible=icon]:py-2",children:(0,a.jsx)(sa,{children:(0,a.jsxs)(sl,{onClick:()=>{h(b.id)},isActive:u===b.id,tooltip:{children:b.label,side:"right",align:"center"},children:[(0,a.jsx)(b.icon,{className:"h-5 w-5"}),(0,a.jsx)("span",{className:"group-data-[collapsible=icon]:hidden",style:u===b.id?void 0:b.labelColorVar?{color:"hsl(var(".concat(b.labelColorVar,"))")}:void 0,children:b.label})]})})}),(0,a.jsxs)("div",{className:"pt-2 group-data-[collapsible=icon]:hidden",children:[(0,a.jsx)(sn,{className:"my-1 group-data-[collapsible=icon]:hidden"}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-1.5 text-xs p-2",children:[(0,a.jsx)(sc.A,{className:"h-3.5 w-3.5 text-sidebar-foreground/70"}),(0,a.jsx)("span",{className:"font-medium text-sidebar-foreground",children:"Pulse"}),(0,a.jsx)("span",{className:"text-muted-foreground/80",children:"v1.1.0"})]})]})]})]}),(0,a.jsx)(e9,{children:(0,a.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,a.jsxs)("header",{className:"mb-0",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold font-headline text-primary tracking-tight",children:(null==v?void 0:v.label)||"Pulse Dashboard"}),(0,a.jsx)("p",{className:"text-md text-muted-foreground mt-1",children:(null==v?void 0:v.description)||"Real-time Playwright Test Execution Monitoring & Analysis Overview"}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground mt-2",children:["Latest Run Date:"," ",o?(0,a.jsx)("span",{className:"text-muted-foreground",children:"Loading..."}):(null==t?void 0:null===(e=t.run)||void 0===e?void 0:e.timestamp)?(0,a.jsx)("span",{className:"text-muted-foreground font-medium",children:new Date(t.run.timestamp).toLocaleString()}):c?(0,a.jsx)("span",{className:"text-destructive font-medium",children:"Error loading data"}):(0,a.jsx)("span",{className:"text-muted-foreground font-medium",children:"Not available"})]})]}),(0,a.jsx)("main",{className:"flex-grow mt-6",children:s}),(0,a.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,a.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem",fontSize:"0.9rem",fontWeight:600,letterSpacing:"0.5px"},children:[(0,a.jsx)("span",{children:"Created by"}),(0,a.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:()=>g("#BF5C37"),onMouseOut:()=>g("#7737BF"),children:"Arghajit Singha"})]}),(0,a.jsx)("div",{style:{marginTop:"0.5rem",fontSize:"0.75rem"},className:"text-muted-foreground",children:"Crafted with precision"})]})]})})]})}},46102:(e,s,t)=>{"use strict";t.d(s,{Bc:()=>n,ZI:()=>c,k$:()=>d,m_:()=>o});var a=t(95155),r=t(12115),l=t(89613),i=t(59434);let n=l.Kq,o=l.bL,d=l.l9,c=r.forwardRef((e,s)=>{let{className:t,sideOffset:r=4,...n}=e;return(0,a.jsx)(l.UC,{ref:s,sideOffset:r,className:(0,i.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",t),...n})});c.displayName=l.UC.displayName},62523:(e,s,t)=>{"use strict";t.d(s,{p:()=>i});var a=t(95155),r=t(12115),l=t(59434);let i=r.forwardRef((e,s)=>{let{className:t,type:r,...i}=e;return(0,a.jsx)("input",{type:r,className:(0,l.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:s,...i})});i.displayName="Input"},64711:(e,s,t)=>{Promise.resolve().then(t.bind(t,16736))},87481:(e,s,t)=>{"use strict";t.d(s,{dj:()=>u});var a=t(12115);let r=0,l=new Map,i=e=>{if(l.has(e))return;let s=setTimeout(()=>{l.delete(e),c({type:"REMOVE_TOAST",toastId:e})},1e6);l.set(e,s)},n=(e,s)=>{switch(s.type){case"ADD_TOAST":return{...e,toasts:[s.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===s.toast.id?{...e,...s.toast}:e)};case"DISMISS_TOAST":{let{toastId:t}=s;return t?i(t):e.toasts.forEach(e=>{i(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===t||void 0===t?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===s.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==s.toastId)}}},o=[],d={toasts:[]};function c(e){d=n(d,e),o.forEach(e=>{e(d)})}function m(e){let{...s}=e,t=(r=(r+1)%Number.MAX_SAFE_INTEGER).toString(),a=()=>c({type:"DISMISS_TOAST",toastId:t});return c({type:"ADD_TOAST",toast:{...s,id:t,open:!0,onOpenChange:e=>{e||a()}}}),{id:t,dismiss:a,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function u(){let[e,s]=a.useState(d);return a.useEffect(()=>(o.push(s),()=>{let e=o.indexOf(s);e>-1&&o.splice(e,1)}),[e]),{...e,toast:m,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}}},e=>{var s=s=>e(e.s=s);e.O(0,[638,972,780,616,441,684,358],()=>s(64711)),_N_E=e.O()}]);