@kb-labs/qa-entry 2.109.0 → 2.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/baseline-diff.d.ts +1 -3
- package/dist/cli/commands/baseline-diff.js +3 -3
- package/dist/cli/commands/baseline-diff.js.map +1 -1
- package/dist/cli/commands/baseline-status.d.ts +1 -3
- package/dist/cli/commands/baseline-status.js +1 -1
- package/dist/cli/commands/baseline-status.js.map +1 -1
- package/dist/cli/commands/baseline-update.d.ts +1 -3
- package/dist/cli/commands/baseline-update.js +1 -1
- package/dist/cli/commands/baseline-update.js.map +1 -1
- package/dist/cli/commands/flags.d.ts +70 -1
- package/dist/cli/commands/flags.js +67 -1
- package/dist/cli/commands/flags.js.map +1 -1
- package/dist/cli/commands/qa-check.d.ts +1 -3
- package/dist/cli/commands/qa-check.js +1 -1
- package/dist/cli/commands/qa-check.js.map +1 -1
- package/dist/cli/commands/qa-ci-evidence-capture.d.ts +29 -0
- package/dist/cli/commands/qa-ci-evidence-capture.js +59 -0
- package/dist/cli/commands/qa-ci-evidence-capture.js.map +1 -0
- package/dist/cli/commands/qa-ci-evidence-sync.d.ts +31 -0
- package/dist/cli/commands/qa-ci-evidence-sync.js +51 -0
- package/dist/cli/commands/qa-ci-evidence-sync.js.map +1 -0
- package/dist/cli/commands/qa-ci-overview.d.ts +21 -0
- package/dist/cli/commands/qa-ci-overview.js +49 -0
- package/dist/cli/commands/qa-ci-overview.js.map +1 -0
- package/dist/cli/commands/qa-e2e-flaky.d.ts +1 -3
- package/dist/cli/commands/qa-e2e-flaky.js +6 -6
- package/dist/cli/commands/qa-e2e-flaky.js.map +1 -1
- package/dist/cli/commands/qa-gate.d.ts +1 -3
- package/dist/cli/commands/qa-gate.js +1 -1
- package/dist/cli/commands/qa-gate.js.map +1 -1
- package/dist/cli/commands/qa-history.d.ts +1 -3
- package/dist/cli/commands/qa-history.js +1 -1
- package/dist/cli/commands/qa-history.js.map +1 -1
- package/dist/cli/commands/qa-regressions.d.ts +1 -3
- package/dist/cli/commands/qa-regressions.js +1 -1
- package/dist/cli/commands/qa-regressions.js.map +1 -1
- package/dist/cli/commands/qa-run.d.ts +1 -3
- package/dist/cli/commands/qa-run.js +1 -1
- package/dist/cli/commands/qa-run.js.map +1 -1
- package/dist/cli/commands/qa-stats.d.ts +1 -3
- package/dist/cli/commands/qa-stats.js +1 -1
- package/dist/cli/commands/qa-stats.js.map +1 -1
- package/dist/cli/commands/qa-trends.d.ts +1 -3
- package/dist/cli/commands/qa-trends.js +1 -1
- package/dist/cli/commands/qa-trends.js.map +1 -1
- package/dist/index.js +99 -3
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +4 -0
- package/dist/manifest.js +99 -3
- package/dist/manifest.js.map +1 -1
- package/dist/manifest.json +245 -12
- package/dist/rest/handlers/ci-overview-handler.d.ts +7 -0
- package/dist/rest/handlers/ci-overview-handler.js +19 -0
- package/dist/rest/handlers/ci-overview-handler.js.map +1 -0
- package/dist/widgets/__federation_expose_QADashboard.js +1 -1
- package/dist/widgets/mf-manifest.json +5 -5
- package/dist/widgets/mf-stats.json +5 -5
- package/dist/widgets/remoteEntry.js +2 -2
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.rspackChunk_kb_labs_qa_entry=self.rspackChunk_kb_labs_qa_entry||[]).push([[23],{6286(e,r,t){t.r(r),t.d(r,{default:()=>ei});var n=t(4552),a=t(5155),o=t(92),s=t(4519),i=t(2137),l=i.Ik({commit:i.Yj(),branch:i.Yj(),message:i.Yj()}),c=i.Ik({id:i.Yj(),timestamp:i.Yj(),git:l.optional(),durationMs:i.ai(),runContext:i.g1(i.L5()).optional()}),u=i.Ik({Package:i.Yj(),Task:i.Yj(),OK:i.zM(),Cached:i.zM(),Elapsed:i.ai(),ExitCode:i.ai(),Stdout:i.Yj(),Stderr:i.Yj(),Error:i.Yj()}),d=i.Ik({elapsed:i.Yj(),ok:i.zM(),results:i.YO(u),summary:i.Ik({total:i.ai(),passed:i.ai(),failed:i.ai(),cached:i.ai()})}),g=i.Ik({check:i.Yj(),severity:i.k5(["error","warning","info"]),message:i.Yj(),file:i.Yj().optional(),fix:i.Yj().optional(),capability:i.Yj().optional()}),h=i.Ik({ok:i.zM(),packages:i.g1(i.Ik({ok:i.zM(),issues:i.YO(g).nullable()}))}),f=i.Ik({ok:i.zM(),score:i.ai(),grade:i.Yj(),summary:i.Ik({total:i.ai(),healthy:i.ai(),warning:i.ai(),error:i.ai(),total_errors:i.ai(),total_warnings:i.ai()}),by_category:i.g1(i.Ik({total:i.ai(),healthy:i.ai(),issues:i.ai(),grade:i.Yj()})),issues_by_type:i.g1(i.Ik({check:i.Yj(),errors:i.ai(),warnings:i.ai(),packages:i.ai()})),coverage:i.g1(i.Ik({pass:i.ai(),total:i.ai(),pct:i.ai()}))}),y=i.Ik({ok:i.zM(),staged_files:i.ai(),violations:i.YO(i.Ik({package:i.Yj(),check:i.Yj(),severity:i.Yj(),message:i.Yj()}))}),p=c.extend({kind:i.eu("run"),tasks:i.YO(i.Yj()),raw:d}),m=c.extend({kind:i.eu("check"),raw:h}),x=c.extend({kind:i.eu("stats"),raw:f}),j=c.extend({kind:i.eu("gate"),raw:y}),I=i.Ik({timestamp:i.Yj(),git:l.optional(),check:h,stats:f}),S=i.Ik({newIssues:i.YO(i.Ik({pkg:i.Yj(),check:i.Yj(),status:i.k5(["new","fixed","persisting"]),severity:i.Yj(),message:i.Yj()})),fixedIssues:i.YO(i.Ik({pkg:i.Yj(),check:i.Yj(),status:i.k5(["new","fixed","persisting"]),severity:i.Yj(),message:i.Yj()})),persistingIssues:i.YO(i.Ik({pkg:i.Yj(),check:i.Yj(),status:i.k5(["new","fixed","persisting"]),severity:i.Yj(),message:i.Yj()})),newIssueCount:i.ai(),fixedIssueCount:i.ai(),scoreDelta:i.ai(),gradeDelta:i.Yj()});i.Ik({score:i.ai().nullable(),grade:i.Yj().nullable(),ok:i.zM().nullable(),lastRunAt:i.Yj().nullable(),lastCheckAt:i.Yj().nullable(),lastStatsAt:i.Yj().nullable(),git:l.nullable(),hasBaseline:i.zM(),baselineTimestamp:i.Yj().nullable(),runHistoryCount:i.ai()}),i.Ik({tasks:i.YO(i.Yj()).optional(),save:i.zM().optional(),runContext:i.g1(i.L5()).optional()}),i.Ik({ok:i.zM(),snapshot:p,durationMs:i.ai()}),i.Ik({save:i.zM().optional(),runContext:i.g1(i.L5()).optional()}),i.Ik({ok:i.zM(),snapshot:m,durationMs:i.ai()}),i.Ik({snapshot:x.nullable()}),i.Ik({save:i.zM().optional()}),i.Ik({ok:i.zM(),snapshot:j,durationMs:i.ai()}),i.Ik({snapshots:i.YO(p),total:i.ai()}),i.Ik({baseline:I.nullable()}),i.KC([S,i.Ik({error:i.k5(["no-baseline","no-check","no-stats"])})]);var v="/v1/plugins/qa",k="/summary",b="/trends",w="/baseline/diff";function U(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function T(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function C(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,i=!1;try{for(a=a.call(e);!(s=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);s=!0);}catch(e){i=!0,n=e}finally{try{s||null==a.return||a.return()}finally{if(i)throw n}}return o}}(e,r)||z(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e){return function(e){if(Array.isArray(e))return U(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||z(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e,r){if(e){if("string"==typeof e)return U(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return U(e,r)}}function A(e){var r,t,i=e.availableTasks,l=e.defaultTasks,c=(0,s.useTheme)().antdToken,u=(0,s.useNotification)(),d=null!=l?l:i.slice(0,4),g=C(o.useState(new Set(d)),2),h=g[0],f=g[1],y=C(o.useState(null),2),p=y[0],m=y[1],x=(0,s.useMutateData)("".concat(v).concat("/run")),j=(null==p?void 0:p.raw.results)?function(){var e=new Map,r=!0,t=!1,n=void 0;try{for(var a,o=p.raw.results[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s,i=a.value,l=null!=(s=e.get(i.Task))?s:{passed:0,failed:0,cached:0,failures:[]};i.Cached?l.cached++:i.OK?l.passed++:(l.failed++,l.failures.push(i.Package)),e.set(i.Task,l)}}catch(e){t=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(t)throw n}}return e}():null;return(0,n.jsxs)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"PlayCircleOutlined"}),(0,n.jsx)("span",{children:"Run Tasks"})]}),extra:(0,n.jsxs)(a.UIButton,{type:"primary",loading:x.isLoading,disabled:0===h.size,onClick:function(){var e=O(h);0===e.length?u.error("Select at least one task"):x.mutate({tasks:e},{onSuccess:function(e){return m(e)},onError:function(e){return u.error("Run failed: ".concat(T(e,Error)?e.message:String(e)))}})},icon:(0,n.jsx)(a.UIIcon,{name:"CaretRightOutlined"}),children:["Run ",h.size>0?"(".concat(h.size,")"):""]}),children:[(0,n.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:c.marginMD},children:i.map(function(e){var r=h.has(e);return(0,n.jsx)("div",{onClick:function(){return f(function(r){var t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t})},style:{cursor:"pointer",padding:"2px 10px",borderRadius:4,border:"1px solid ".concat(r?c.colorPrimary:c.colorBorderSecondary),background:r?c.colorPrimaryBg:"transparent",fontSize:c.fontSizeSM,fontWeight:r?600:400,color:r?c.colorPrimary:c.colorTextSecondary,userSelect:"none",transition:"all 0.15s",lineHeight:"22px"},children:e},e)})}),p&&j&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIDivider,{style:{margin:"".concat(c.marginSM,"px 0")}}),(0,n.jsxs)(a.UIRow,{gutter:[8,8],children:[O(j.entries()).map(function(e){var r=C(e,2),t=r[0],o=r[1],s=o.passed+o.failed+o.cached,i=s>0?Math.round((o.passed+o.cached)/s*100):100,l=o.failed>0;return(0,n.jsx)(a.UICol,{xs:24,sm:12,lg:8,xl:6,children:(0,n.jsxs)("div",{style:{padding:"".concat(c.paddingXS,"px ").concat(c.paddingSM,"px"),border:"1px solid ".concat(l?c.colorErrorBorder:c.colorSuccessBorder),borderRadius:c.borderRadius,background:l?c.colorErrorBg:c.colorSuccessBg},children:[(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[(0,n.jsx)("span",{style:{fontWeight:600,fontSize:c.fontSizeSM},children:t}),(0,n.jsxs)("span",{style:{fontSize:11,color:c.colorTextSecondary},children:[o.passed>0&&"".concat(o.passed," pass"),o.passed>0&&o.failed>0&&" \xb7 ",o.failed>0&&(0,n.jsxs)("span",{style:{color:c.colorError},children:[o.failed," fail"]}),(o.passed>0||o.failed>0)&&o.cached>0&&" \xb7 ",o.cached>0&&"".concat(o.cached," cached")]})]}),(0,n.jsx)(a.UIProgress,{percent:i,size:"small",status:l?"exception":"success",showInfo:!1}),o.failures.length>0&&(0,n.jsxs)("div",{style:{marginTop:4,fontSize:11,color:c.colorError},children:[o.failures.slice(0,2).map(function(e){return(0,n.jsxs)("div",{children:["✗ ",e]},e)}),o.failures.length>2&&(0,n.jsxs)("div",{style:{color:c.colorTextSecondary},children:["+",o.failures.length-2," more"]})]})]})},t)}),(0,n.jsx)(a.UICol,{xs:24,children:(0,n.jsxs)("span",{style:{fontSize:11,color:c.colorTextSecondary},children:[(0,n.jsx)(a.UITag,{color:p.ok?"success":"error",style:{fontSize:11},children:p.ok?"✓ passed":"✗ failed"})," ",isNaN(t=parseFloat(r=p.raw.elapsed))?r:t>=60?"".concat((t/60).toFixed(1),"m"):"".concat(t.toFixed(1),"s")," \xb7 ",p.raw.summary.total," pkgs"]})})]})]})]})}function M(){var e=(0,s.useTheme)().antdToken,r=(0,s.useNotification)(),t=C(o.useState(null),2),i=t[0],l=t[1],c=(0,s.useMutateData)("".concat(v).concat("/check")),u=(null==i?void 0:i.raw.packages)?Object.entries(i.raw.packages).filter(function(e){var r=C(e,2)[1];return r.issues&&r.issues.length>0}).map(function(e){var r,t,n,a,o=C(e,2),s=o[0],i=o[1];return{key:s,pkg:s,errors:null!=(r=null==(n=i.issues)?void 0:n.filter(function(e){return"error"===e.severity}).length)?r:0,warnings:null!=(t=null==(a=i.issues)?void 0:a.filter(function(e){return"warning"===e.severity}).length)?t:0}}):null;return(0,n.jsxs)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"SafetyCertificateOutlined"}),(0,n.jsx)("span",{children:"Structural Check"})]}),extra:(0,n.jsx)(a.UIButton,{loading:c.isLoading,icon:(0,n.jsx)(a.UIIcon,{name:"AuditOutlined"}),onClick:function(){return c.mutate({},{onSuccess:function(e){return l(e)},onError:function(e){return r.error("Check failed: ".concat(T(e,Error)?e.message:String(e)))}})},children:"Run Check"}),children:[(0,n.jsxs)("div",{style:{color:e.colorTextSecondary,fontSize:e.fontSizeSM,marginBottom:e.marginMD},children:[(0,n.jsx)("code",{children:"kb-devkit check"})," — README, tsconfig, engines, dependencies и прочие структурные требования."]}),i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIDivider,{style:{margin:"".concat(e.marginSM,"px 0")}}),(null==u?void 0:u.length)?(0,n.jsx)(a.UITable,{dataSource:u,size:"small",pagination:u.length>8&&{pageSize:8},columns:[{title:"Package",dataIndex:"pkg",key:"pkg",ellipsis:!0},{title:"Errors",dataIndex:"errors",key:"errors",width:80,render:function(r){return r>0?(0,n.jsx)(a.UIBadge,{count:r,style:{backgroundColor:e.colorError}}):"—"}},{title:"Warnings",dataIndex:"warnings",key:"warnings",width:90,render:function(r){return r>0?(0,n.jsx)(a.UIBadge,{count:r,style:{backgroundColor:e.colorWarning}}):"—"}}]}):(0,n.jsx)(a.UIAlert,{variant:"success",showIcon:!0,message:"All packages pass structural checks"})]})]})}function D(){var e,r=(0,s.useTheme)().antdToken,t=(0,s.useNotification)(),i=C(o.useState(null),2),l=i[0],c=i[1],u=(0,s.useMutateData)("".concat(v).concat("/gate")),d=null!=(e=null==l?void 0:l.raw.violations)?e:[];return(0,n.jsxs)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"SecurityScanOutlined"}),(0,n.jsx)("span",{children:"Gate Check"})]}),extra:(0,n.jsx)(a.UIButton,{loading:u.isLoading,icon:(0,n.jsx)(a.UIIcon,{name:"ThunderboltOutlined"}),onClick:function(){return u.mutate({},{onSuccess:function(e){return c(e)},onError:function(e){return t.error("Gate failed: ".concat(T(e,Error)?e.message:String(e)))}})},children:"Run Gate"}),children:[(0,n.jsxs)("div",{style:{color:r.colorTextSecondary,fontSize:r.fontSizeSM,marginBottom:r.marginMD},children:[(0,n.jsx)("code",{children:"kb-devkit gate"})," — пре-коммит проверка staged файлов.",l?" Staged: ".concat(l.raw.staged_files):""]}),l&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIDivider,{style:{margin:"".concat(r.marginSM,"px 0")}}),l.ok?(0,n.jsx)(a.UIAlert,{variant:"success",showIcon:!0,message:"Gate passed — safe to commit"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIAlert,{variant:"error",showIcon:!0,message:"".concat(d.length," violation").concat(1!==d.length?"s":""),style:{marginBottom:r.marginSM}}),(0,n.jsx)(a.UITable,{dataSource:d.map(function(e,r){var t,n;return t=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({},e),n=n={key:r},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t}),size:"small",pagination:!1,columns:[{title:"Package",dataIndex:"package",key:"package",ellipsis:!0},{title:"Check",dataIndex:"check",key:"check"},{title:"Severity",dataIndex:"severity",key:"severity",width:90,render:function(e){return(0,n.jsx)(a.UITag,{color:"error"===e?"error":"warning",children:e})}},{title:"Message",dataIndex:"message",key:"message",ellipsis:!0}]})]})]})]})}function P(){var e,r,t=(0,s.useTheme)().antdToken,i=(0,s.useNotification)(),l=C(o.useState(null),2),c=l[0],u=l[1],d=(0,s.useMutateData)("".concat(v).concat("/baseline/update")),g=null==c?void 0:c.baseline;return(0,n.jsxs)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"AimOutlined"}),(0,n.jsx)("span",{children:"Baseline"})]}),extra:(0,n.jsx)(a.UIButton,{loading:d.isLoading,icon:(0,n.jsx)(a.UIIcon,{name:"SaveOutlined"}),onClick:function(){return d.mutate({},{onSuccess:function(e){u(e),i.success("Baseline updated")},onError:function(e){return i.error("Failed: ".concat(T(e,Error)?e.message:String(e)))}})},children:"Update Baseline"}),children:[(0,n.jsxs)("div",{style:{color:t.colorTextSecondary,fontSize:t.fontSizeSM,marginBottom:t.marginMD},children:[(0,n.jsx)("code",{children:"kb-devkit check"})," + ",(0,n.jsx)("code",{children:"kb-devkit stats"})," → сохраняет текущее состояние как новый baseline для diff."]}),g&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIDivider,{style:{margin:"".concat(t.marginSM,"px 0")}}),(0,n.jsx)(a.UIAlert,{variant:"success",showIcon:!0,message:"Baseline saved",description:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsxs)("span",{children:["Score: ",(0,n.jsxs)("strong",{children:[null==(e=g.stats)?void 0:e.score,"/100"]})]}),(0,n.jsx)(a.UITag,{color:"processing",children:null==(r=g.stats)?void 0:r.grade}),(0,n.jsxs)("span",{style:{color:t.colorTextSecondary,fontSize:t.fontSizeSM},children:[new Date(g.timestamp).toLocaleString(),g.git?" \xb7 ".concat(g.git.branch," (").concat(g.git.commit.slice(0,7),")"):""]})]})})]})]})}function E(){(0,s.useTheme)().antdToken;var e,r,t=(0,s.useData)("".concat(v).concat("/tasks")),o=t.data;if(t.isLoading)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});var i=null!=(e=null==o?void 0:o.tasks)?e:[];return(0,n.jsxs)(a.UISpace,{direction:"vertical",style:{width:"100%"},size:"large",children:[0===i.length?(0,n.jsx)(a.UIAlert,{variant:"warning",showIcon:!0,message:"devkit.yaml not found",description:"Add a devkit.yaml to the root of your repository to configure available tasks."}):(0,n.jsx)(A,{availableTasks:i,defaultTasks:null!=(r=null==o?void 0:o.defaultTasks)?r:null}),(0,n.jsxs)(a.UIRow,{gutter:[16,16],children:[(0,n.jsx)(a.UICol,{xs:24,lg:12,children:(0,n.jsx)(M,{})}),(0,n.jsx)(a.UICol,{xs:24,lg:12,children:(0,n.jsx)(D,{})})]}),(0,n.jsx)(P,{})]})}function B(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function Y(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,i=!1;try{for(a=a.call(e);!(s=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);s=!0);}catch(e){i=!0,n=e}finally{try{s||null==a.return||a.return()}finally{if(i)throw n}}return o}}(e,r)||function(e,r){if(e){if("string"==typeof e)return B(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return B(e,r)}}(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e){return"A"===e||"A+"===e?"success":"B"===e?"processing":"C"===e?"warning":"error"}function R(){var e,r,t=(0,s.useTheme)().antdToken,o=(0,s.useData)("".concat(v).concat(k)),i=o.data,l=o.isLoading,c=(0,s.useData)("".concat(v).concat(w)),u=c.data,d=c.isLoading;if(l||d)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});var g=null==i||null==(r=i.latestStats)?void 0:r.raw;if(!g)return(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No health data",description:"Run 'kb qa stats' to collect health data.",style:{marginBottom:t.marginLG}});var h=u&&!("error"in u)&&(u.newIssueCount>0||u.fixedIssueCount>0),f=!u||"error"in u?null:u,y=Object.entries(g.by_category).map(function(e){var r=Y(e,2),t=r[0],n=r[1];return{key:t,category:t,total:n.total,healthy:n.healthy,issues:n.issues,grade:n.grade,pct:n.total>0?Math.round(n.healthy/n.total*100):0}}),p=Object.entries(g.coverage).map(function(e){var r=Y(e,2),t=r[0],n=r[1];return{key:t,name:t,pass:n.pass,total:n.total,pct:n.pct}}),m=Object.entries(g.issues_by_type).map(function(e){var r=Y(e,2),t=r[0],n=r[1];return{key:t,check:n.check,errors:n.errors,warnings:n.warnings,packages:n.packages}});return(0,n.jsxs)(a.UISpace,{direction:"vertical",style:{width:"100%"},size:"large",children:[h&&f&&(0,n.jsx)(a.UIAlert,{variant:f.newIssueCount>0?"error":"success",showIcon:!0,message:(0,n.jsxs)(a.UISpace,{children:[f.newIssueCount>0&&(0,n.jsxs)(a.UITag,{color:"error",children:[f.newIssueCount," new issues"]}),f.fixedIssueCount>0&&(0,n.jsxs)(a.UITag,{color:"success",children:[f.fixedIssueCount," fixed"]}),(0,n.jsxs)(a.UITag,{color:f.scoreDelta>=0?"green":"red",children:["score ",f.scoreDelta>0?"+":"",f.scoreDelta]}),(0,n.jsx)(a.UITag,{children:f.gradeDelta})]})}),(0,n.jsxs)(a.UIRow,{gutter:[16,16],align:"stretch",children:[(0,n.jsx)(a.UICol,{xs:24,sm:8,children:(0,n.jsxs)(a.UICard,{style:{height:"100%"},children:[(0,n.jsx)(a.UIStatistic,{title:"Health Score",value:g.score,suffix:"/ 100",valueStyle:{color:(e=g.grade,"A"===e||"A+"===e?t.colorSuccess:"B"===e?t.colorPrimary:"C"===e?t.colorWarning:t.colorError),fontSize:40}}),(0,n.jsx)(a.UITag,{color:L(g.grade),style:{marginTop:t.marginSM,fontSize:16,padding:"2px 14px"},children:g.grade})]})}),(0,n.jsx)(a.UICol,{xs:24,sm:16,children:(0,n.jsxs)(a.UIRow,{gutter:[16,16],style:{height:"100%"},children:[(0,n.jsx)(a.UICol,{span:8,children:(0,n.jsx)(a.UICard,{style:{height:"100%"},children:(0,n.jsx)(a.UIStatistic,{title:"Healthy",value:g.summary.healthy,valueStyle:{color:t.colorSuccess}})})}),(0,n.jsx)(a.UICol,{span:8,children:(0,n.jsx)(a.UICard,{style:{height:"100%"},children:(0,n.jsx)(a.UIStatistic,{title:"Warning",value:g.summary.warning,valueStyle:{color:t.colorWarning}})})}),(0,n.jsx)(a.UICol,{span:8,children:(0,n.jsx)(a.UICard,{style:{height:"100%"},children:(0,n.jsx)(a.UIStatistic,{title:"Error",value:g.summary.error,valueStyle:{color:t.colorError}})})})]})})]}),(0,n.jsx)(a.UICard,{title:"By Category",children:(0,n.jsx)(a.UITable,{dataSource:y,size:"small",pagination:!1,columns:[{title:"Category",dataIndex:"category",key:"category"},{title:"Grade",dataIndex:"grade",key:"grade",render:function(e){return(0,n.jsx)(a.UITag,{color:L(e),children:e})}},{title:"Healthy",dataIndex:"healthy",key:"healthy"},{title:"Total",dataIndex:"total",key:"total"},{title:"Issues",dataIndex:"issues",key:"issues"},{title:"Coverage",dataIndex:"pct",key:"pct",render:function(e){return"".concat(e,"%")}}]})}),p.length>0&&(0,n.jsx)(a.UICard,{title:"Coverage",children:(0,n.jsx)(a.UITable,{dataSource:p,size:"small",pagination:!1,columns:[{title:"Check",dataIndex:"name",key:"name"},{title:"Pass",dataIndex:"pass",key:"pass"},{title:"Total",dataIndex:"total",key:"total"},{title:"Pct",dataIndex:"pct",key:"pct",render:function(e){return(0,n.jsxs)(a.UITag,{color:e>=80?"green":e>=50?"orange":"red",children:[e,"%"]})}}]})}),m.length>0&&(0,n.jsx)(a.UICard,{title:"Issues by Type",children:(0,n.jsx)(a.UITable,{dataSource:m,size:"small",pagination:!1,columns:[{title:"Check",dataIndex:"check",key:"check"},{title:"Errors",dataIndex:"errors",key:"errors",render:function(e){return e>0?(0,n.jsx)(a.UITag,{color:"red",children:e}):(0,n.jsx)(a.UITag,{children:"0"})}},{title:"Warnings",dataIndex:"warnings",key:"warnings",render:function(e){return e>0?(0,n.jsx)(a.UITag,{color:"orange",children:e}):(0,n.jsx)(a.UITag,{children:"0"})}},{title:"Packages",dataIndex:"packages",key:"packages"}]})}),f&&f.newIssues.length>0&&(0,n.jsx)(a.UICard,{title:"New Issues (".concat(f.newIssues.length,")"),children:(0,n.jsx)(a.UITable,{dataSource:f.newIssues.map(function(e,r){var t,n;return t=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({},e),n=n={key:r},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t}),size:"small",pagination:{pageSize:10},columns:[{title:"Package",dataIndex:"pkg",key:"pkg"},{title:"Check",dataIndex:"check",key:"check"},{title:"Severity",dataIndex:"severity",key:"severity",render:function(e){return(0,n.jsx)(a.UITag,{color:"error"===e?"red":"warning"===e?"orange":"blue",children:e})}},{title:"Message",dataIndex:"message",key:"message"}]})})]})}function N(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function F(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,i=!1;try{for(a=a.call(e);!(s=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);s=!0);}catch(e){i=!0,n=e}finally{try{s||null==a.return||a.return()}finally{if(i)throw n}}return o}}(e,r)||function(e,r){if(e){if("string"==typeof e)return N(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return N(e,r)}}(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var W={error:{color:"error",iconName:"CloseCircleOutlined"},warning:{color:"warning",iconName:"WarningOutlined"},info:{color:"default",iconName:"InfoCircleOutlined"}};function _(e){var r,t=e.open,i=e.onClose,l=(0,s.useTheme)().antdToken,c=F(o.useState(""),2),u=c[0],d=c[1],g=(0,s.useData)("".concat(v).concat(k)),h=g.data,f=g.isLoading,y=null!=(r=null==h?void 0:h.latestCheck)?r:null,p=o.useMemo(function(){if(!y)return[];var e=[],r=!0,t=!1,n=void 0;try{for(var a,o=Object.entries(y.raw.packages)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=F(a.value,2),i=s[0],l=s[1],c=!0,u=!1,d=void 0;try{for(var g,h,f=(null!=(g=l.issues)?g:[])[Symbol.iterator]();!(c=(h=f.next()).done);c=!0){var p=h.value;e.push(function(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({},p),{pkg:i}))}}catch(e){u=!0,d=e}finally{try{c||null==f.return||f.return()}finally{if(u)throw d}}}}catch(e){t=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(t)throw n}}return e},[y]),m=o.useMemo(function(){if(!u)return p;var e=u.toLowerCase();return p.filter(function(r){var t;return r.pkg.toLowerCase().includes(e)||r.check.toLowerCase().includes(e)||r.message.toLowerCase().includes(e)||(null!=(t=r.file)?t:"").toLowerCase().includes(e)})},[p,u]),x=m.filter(function(e){return"error"===e.severity}).length,j=m.filter(function(e){return"warning"===e.severity}).length,I=[{title:"Severity",dataIndex:"severity",key:"severity",width:90,filters:[{text:"Error",value:"error"},{text:"Warning",value:"warning"},{text:"Info",value:"info"}],onFilter:function(e,r){return r.severity===e},render:function(e){var r=W[e];return r?(0,n.jsx)(a.UITag,{color:r.color,icon:(0,n.jsx)(a.UIIcon,{name:r.iconName}),children:e}):(0,n.jsx)(a.UITag,{children:e})}},{title:"Package",dataIndex:"pkg",key:"pkg",width:200,sorter:function(e,r){return e.pkg.localeCompare(r.pkg)},render:function(e){return(0,n.jsx)(a.UITypographyText,{code:!0,style:{fontSize:l.fontSizeSM},children:e})}},{title:"Check",dataIndex:"check",key:"check",width:150,render:function(e){return(0,n.jsx)(a.UITag,{style:{fontSize:l.fontSizeSM},children:e})}},{title:"Message",dataIndex:"message",key:"message",render:function(e,r){return(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{style:{fontSize:l.fontSizeSM},children:e}),r.file&&(0,n.jsx)("div",{children:(0,n.jsx)(a.UITypographyText,{type:"secondary",style:{fontSize:l.fontSizeSM},children:r.file})})]})}}];return(0,n.jsxs)(a.UIDrawer,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)("span",{children:"Check Issues"}),x>0&&(0,n.jsxs)(a.UITag,{color:"error",children:[x," errors"]}),j>0&&(0,n.jsxs)(a.UITag,{color:"warning",children:[j," warnings"]})]}),placement:"right",width:820,open:t,onClose:i,children:[f&&(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}}),!f&&!y&&(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No check data available",description:"Run 'kb qa check --save' to generate check results."}),!f&&y&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIInput,{placeholder:"Filter by package, check, message, or file...",prefix:(0,n.jsx)(a.UIIcon,{name:"SearchOutlined"}),value:u,onChange:function(e){return d(e)},style:{marginBottom:l.marginMD},allowClear:!0}),0===m.length?(0,n.jsx)(a.UIEmptyState,{description:u?"No issues match your filter":"No issues found"}):(0,n.jsx)(a.UITable,{dataSource:m,columns:I,rowKey:function(e,r){return"".concat(e.pkg,"-").concat(e.check,"-").concat(null!=r?r:0)},size:"small",pagination:{pageSize:50},expandable:{expandedRowRender:function(e){return e.fix?(0,n.jsx)(a.UIAccordion,{ghost:!0,items:[{key:"1",label:"Suggested fix",children:(0,n.jsx)("pre",{style:{background:l.colorFillTertiary,color:l.colorText,padding:l.paddingSM,borderRadius:l.borderRadius,fontSize:l.fontSizeSM,maxHeight:200,overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:e.fix})}]}):null},rowExpandable:function(e){return!!e.fix}}})]})]})}function G(e){var r=e.issues;e.color;var t=(0,s.useTheme)().antdToken,o=r.slice(0,5);return(0,n.jsxs)("div",{children:[o.map(function(e,r){return(0,n.jsxs)("div",{style:{marginBottom:t.marginXXS},children:[(0,n.jsx)(a.UITag,{color:"error"===e.severity?"error":"warning"===e.severity?"warning":"default",style:{fontSize:t.fontSizeSM},children:e.check}),(0,n.jsx)(a.UITag,{style:{fontSize:t.fontSizeSM},children:e.pkg}),(0,n.jsxs)("span",{style:{fontSize:t.fontSizeSM,color:t.colorTextSecondary},children:[e.message.slice(0,60),e.message.length>60?"…":""]})]},r)}),r.length>5&&(0,n.jsxs)(a.UITypographyText,{type:"secondary",style:{fontSize:t.fontSizeSM},children:["+",r.length-5," more"]})]})}function H(e){var r=e.diff,t=(0,s.useTheme)().antdToken,o=r.newIssueCount>0,i=r.fixedIssueCount>0;return(0,n.jsx)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"WarningOutlined",style:{color:o?t.colorError:t.colorSuccess}}),(0,n.jsx)("span",{children:"Baseline Diff"}),o&&(0,n.jsxs)(a.UITag,{color:"error",children:["+",r.newIssueCount," new issues"]}),i&&(0,n.jsxs)(a.UITag,{color:"success",children:[r.fixedIssueCount," fixed"]})]}),children:(0,n.jsxs)(a.UIRow,{gutter:[16,16],children:[(0,n.jsx)(a.UICol,{xs:24,sm:8,children:(0,n.jsxs)(a.UICard,{size:"small",style:{textAlign:"center"},children:[(0,n.jsx)(a.UITypographyText,{strong:!0,children:"Score Delta"}),(0,n.jsx)("div",{style:{marginTop:t.marginXS},children:(0,n.jsx)(a.UIStatistic,{value:Math.abs(r.scoreDelta),prefix:r.scoreDelta>0?(0,n.jsx)(a.UIIcon,{name:"ArrowUpOutlined"}):r.scoreDelta<0?(0,n.jsx)(a.UIIcon,{name:"ArrowDownOutlined"}):null,valueStyle:{color:r.scoreDelta<0?t.colorError:r.scoreDelta>0?t.colorSuccess:t.colorTextSecondary,fontSize:t.fontSizeHeading3},suffix:r.gradeDelta?" (".concat(r.gradeDelta,")"):void 0})})]})}),r.newIssues.length>0&&(0,n.jsx)(a.UICol,{xs:24,sm:8,children:(0,n.jsxs)(a.UICard,{size:"small",children:[(0,n.jsxs)(a.UITypographyText,{type:"danger",strong:!0,children:["New Issues (",r.newIssues.length,")"]}),(0,n.jsx)("div",{style:{marginTop:t.marginXS},children:(0,n.jsx)(G,{issues:r.newIssues,color:"error"})})]})}),r.fixedIssues.length>0&&(0,n.jsx)(a.UICol,{xs:24,sm:8,children:(0,n.jsxs)(a.UICard,{size:"small",children:[(0,n.jsxs)(a.UITypographyText,{type:"success",strong:!0,children:["Fixed Issues (",r.fixedIssues.length,")"]}),(0,n.jsx)("div",{style:{marginTop:t.marginXS},children:(0,n.jsx)(G,{issues:r.fixedIssues,color:"success"})})]})})]})})}function X(){var e=(0,s.useData)("".concat(v).concat(w)),r=e.data;return e.isLoading?(0,n.jsx)(a.UISpin,{size:"small",style:{display:"block",margin:"16px auto"}}):r?"error"in r?"no-baseline"===r.error?(0,n.jsx)(a.UIAlert,{variant:"warning",showIcon:!0,message:"No baseline set",description:"Run QA checks and save a baseline to enable diff tracking."}):"no-check"===r.error?(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No check snapshot",description:"Run 'kb qa check --save' to generate a check snapshot."}):(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No stats snapshot",description:"Run 'kb qa stats --save' to generate a stats snapshot."}):r.newIssueCount>0||r.fixedIssueCount>0?(0,n.jsx)(H,{diff:r}):(0,n.jsx)(a.UIAlert,{variant:"success",showIcon:!0,icon:(0,n.jsx)(a.UIIcon,{name:"CheckCircleOutlined"}),message:"No changes since baseline",description:"Score delta: ".concat(r.scoreDelta>=0?"+":"").concat(r.scoreDelta).concat(r.gradeDelta?" (grade: ".concat(r.gradeDelta,")"):"")}):null}function q(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function K(){var e,r=(0,s.useTheme)().antdToken,t=(0,s.useData)("".concat(v).concat(k)),o=t.data;if(t.isLoading)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});var i=null!=(e=null==o?void 0:o.latestStats)?e:null;if(!i)return null;var l=Object.entries(i.raw.issues_by_type).map(function(e){var r=function(e){if(Array.isArray(e))return e}(e)||function(e){var r,t,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),2!==a.length);o=!0);}catch(e){s=!0,t=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw t}}return a}}(e)||function(e){if(e){if("string"==typeof e)return q(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({key:r[0]},r[1])});if(0===l.length)return null;var c=[{title:"Check",dataIndex:"check",key:"check",render:function(e){return(0,n.jsx)(a.UITypographyText,{code:!0,style:{fontSize:r.fontSizeSM},children:e})}},{title:"Errors",dataIndex:"errors",key:"errors",width:90,sorter:function(e,r){return e.errors-r.errors},defaultSortOrder:"descend",render:function(e){return e>0?(0,n.jsx)(a.UIBadge,{count:e,style:{backgroundColor:r.colorError}}):(0,n.jsx)("span",{style:{color:r.colorTextSecondary},children:"—"})}},{title:"Warnings",dataIndex:"warnings",key:"warnings",width:100,sorter:function(e,r){return e.warnings-r.warnings},render:function(e){return e>0?(0,n.jsx)(a.UIBadge,{count:e,style:{backgroundColor:r.colorWarning}}):(0,n.jsx)("span",{style:{color:r.colorTextSecondary},children:"—"})}},{title:"Packages Affected",dataIndex:"packages",key:"packages",width:150,sorter:function(e,r){return e.packages-r.packages},render:function(e){return(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIBadge,{count:e,style:{backgroundColor:e>5?r.colorError:e>2?r.colorWarning:r.colorSuccess}}),(0,n.jsx)("span",{style:{fontSize:r.fontSizeSM,color:r.colorTextSecondary},children:"packages"})]})}},{title:"Impact",key:"impact",width:90,render:function(e,r){return 0===r.errors+r.warnings?(0,n.jsx)(a.UITag,{children:"Clean"}):r.errors>0?(0,n.jsx)(a.UITag,{color:"error",children:"High"}):(0,n.jsx)(a.UITag,{color:"warning",children:"Medium"})}}],u=l.reduce(function(e,r){return e+r.errors},0),d=l.reduce(function(e,r){return e+r.warnings},0);return(0,n.jsx)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"BugOutlined"}),(0,n.jsx)("span",{children:"Issues by Type"}),u>0&&(0,n.jsxs)(a.UITag,{color:"error",children:[u," errors"]}),d>0&&(0,n.jsxs)(a.UITag,{color:"warning",children:[d," warnings"]})]}),children:(0,n.jsx)(a.UITable,{dataSource:l,columns:c,rowKey:"key",size:"small",pagination:l.length>10&&{pageSize:10}})})}function Q(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function $(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,i=!1;try{for(a=a.call(e);!(s=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);s=!0);}catch(e){i=!0,n=e}finally{try{s||null==a.return||a.return()}finally{if(i)throw n}}return o}}(e,r)||V(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e,r){if(e){if("string"==typeof e)return Q(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Q(e,r)}}function J(){var e,r=(0,s.useTheme)().antdToken,t=(0,s.useData)("".concat(v).concat(k)),i=t.data,l=t.isLoading,c=$(o.useState(!1),2),u=c[0],d=c[1];if(l)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});if(!i)return(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No QA data",description:"Run 'kb qa run' to generate QA history.",style:{marginBottom:r.marginLG}});var g=i.latestRun,h=i.latestStats,f=null==h?void 0:h.raw,y=null==g?void 0:g.raw,p=new Map;if(null==y?void 0:y.results){var m=!0,x=!1,j=void 0;try{for(var I,S,b,w,U=y.results[Symbol.iterator]();!(m=(w=U.next()).done);m=!0){var T,C=w.value,O=null!=(T=p.get(C.Task))?T:{passed:0,failed:0,cached:0};C.Cached?O.cached+=1:C.OK?O.passed+=1:O.failed+=1,p.set(C.Task,O)}}catch(e){x=!0,j=e}finally{try{m||null==U.return||U.return()}finally{if(x)throw j}}}var z=null!=(I=null==y?void 0:y.ok)?I:null,A=null!=(S=null==f?void 0:f.grade)?S:null,M=null!=(b=null==f?void 0:f.score)?b:null;return(0,n.jsxs)("div",{children:[(0,n.jsx)(a.UIAlert,{variant:!0===z?"success":!1===z?"error":"info",showIcon:!0,icon:!0===z?(0,n.jsx)(a.UIIcon,{name:"CheckCircleOutlined"}):(0,n.jsx)(a.UIIcon,{name:"CloseCircleOutlined"}),message:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsxs)("span",{style:{fontWeight:600},children:["QA Status: ",!0===z?"Passing":!1===z?"Failing":"No data"]}),A&&(0,n.jsxs)(a.UITag,{color:A.startsWith("A")?"success":"B"===A?"warning":"error",children:["Grade: ",A]}),null!==M&&(0,n.jsxs)(a.UITag,{children:["Score: ",M]})]}),description:g?(0,n.jsxs)(a.UISpace,{split:(0,n.jsx)("span",{style:{color:r.colorBorderSecondary},children:"|"}),children:[(0,n.jsxs)("span",{children:[(0,n.jsx)(a.UIIcon,{name:"ClockCircleOutlined"})," ",new Date(g.timestamp).toLocaleString()]}),g.git&&(0,n.jsxs)("span",{children:[(0,n.jsx)(a.UIIcon,{name:"BranchesOutlined"})," ",g.git.branch," (",g.git.commit.slice(0,7),")"]}),(0,n.jsxs)("span",{children:["tasks: ",g.tasks.join(", ")]})]}):void 0,style:{marginBottom:r.marginLG}}),p.size>0&&(0,n.jsx)(a.UIRow,{gutter:[16,16],style:{marginBottom:r.marginLG},children:((function(e){if(Array.isArray(e))return Q(e)})(e=p.entries())||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||V(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(e){var t=$(e,2),o=t[0],s=t[1],i=s.failed>0;return(0,n.jsx)(a.UICol,{xs:24,sm:12,lg:6,children:(0,n.jsxs)(a.UICard,{hoverable:!0,onClick:function(){return d(!0)},style:{cursor:"pointer",textAlign:"center"},children:[(0,n.jsxs)(a.UITag,{color:i?"error":"success",style:{marginBottom:r.marginSM,fontSize:r.fontSize},children:[i?(0,n.jsx)(a.UIIcon,{name:"CloseCircleOutlined"}):(0,n.jsx)(a.UIIcon,{name:"CheckCircleOutlined"})," ",i?"FAILED":"PASSED"]}),(0,n.jsx)("div",{style:{fontWeight:600,fontSize:r.fontSizeLG,marginBottom:r.marginSM},children:o}),(0,n.jsxs)(a.UIRow,{gutter:8,justify:"center",children:[(0,n.jsx)(a.UICol,{children:(0,n.jsx)(a.UIStatistic,{title:"Passed",value:s.passed,valueStyle:{color:r.colorSuccess,fontSize:r.fontSize}})}),(0,n.jsx)(a.UICol,{children:(0,n.jsx)(a.UIStatistic,{title:"Failed",value:s.failed,valueStyle:{color:s.failed>0?r.colorError:r.colorSuccess,fontSize:r.fontSize}})}),s.cached>0&&(0,n.jsx)(a.UICol,{children:(0,n.jsx)(a.UIStatistic,{title:"Cached",value:s.cached,valueStyle:{color:r.colorTextSecondary,fontSize:r.fontSize}})})]})]})},o)})}),(0,n.jsx)("div",{style:{marginBottom:r.marginLG},children:(0,n.jsx)(X,{})}),(0,n.jsx)("div",{style:{marginBottom:r.marginLG},children:(0,n.jsx)(K,{})}),(0,n.jsx)(_,{open:u,onClose:function(){return d(!1)}})]})}function Z(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function ee(e){return function(e){if(Array.isArray(e))return Z(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||er(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function er(e,r){if(e){if("string"==typeof e)return Z(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Z(e,r)}}function et(){var e=(0,s.useTheme)().antdToken,r=(0,s.useData)("".concat(v).concat("/history")),t=r.data;if(r.isLoading)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});if(!t||!t.snapshots||0===t.snapshots.length)return(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No QA history",description:"Run 'kb qa run --save' to record QA results to history."});var o=ee(new Set(t.snapshots.flatMap(function(e){var r;return null!=(r=e.tasks)?r:[]}))),i=[{title:"Date",dataIndex:"timestamp",key:"timestamp",width:180,render:function(e){return new Date(e).toLocaleString()},sorter:function(e,r){return new Date(e.timestamp).getTime()-new Date(r.timestamp).getTime()},defaultSortOrder:"descend"},{title:"Status",key:"status",width:100,render:function(e,r){var t=r.raw.ok;return(0,n.jsx)(a.UITag,{color:t?"success":"error",icon:t?(0,n.jsx)(a.UIIcon,{name:"CheckCircleOutlined"}):(0,n.jsx)(a.UIIcon,{name:"CloseCircleOutlined"}),children:t?"PASSED":"FAILED"})},filters:[{text:"Passed",value:!0},{text:"Failed",value:!1}],onFilter:function(e,r){return r.raw.ok===e}},{title:"Git",key:"git",width:220,render:function(r,t){return t.git?(0,n.jsxs)(a.UISpace,{direction:"vertical",size:0,children:[(0,n.jsxs)("span",{children:[(0,n.jsx)(a.UIIcon,{name:"BranchesOutlined"})," ",t.git.branch]}),(0,n.jsxs)("span",{style:{color:e.colorTextSecondary,fontSize:e.fontSizeSM},children:[t.git.commit.slice(0,7)," — ",t.git.message.slice(0,40),t.git.message.length>40?"...":""]})]}):(0,n.jsx)("span",{style:{color:e.colorTextSecondary},children:"—"})}},{title:"Total",key:"total",width:80,align:"center",render:function(e,r){return(0,n.jsxs)("span",{style:{fontVariantNumeric:"tabular-nums"},children:[r.raw.summary.passed,"/",r.raw.summary.total]})}}].concat(ee(o.map(function(e){return{title:e,key:e,width:90,align:"center",render:function(r,t){return function(e,r){var t,o=(null!=(t=e.raw.results)?t:[]).filter(function(e){return e.Task===r});if(0===o.length)return(0,n.jsx)("span",{style:{color:"#999"},children:"—"});var s=o.filter(function(e){return!e.OK&&!e.Cached}).length,i=o.filter(function(e){return e.Cached}).length,l=o.filter(function(e){return e.OK&&!e.Cached}).length;return s>0?(0,n.jsxs)(a.UITag,{color:"error",style:{fontVariantNumeric:"tabular-nums"},children:[l,"/",o.length]}):i>0?(0,n.jsxs)(a.UITag,{color:"default",style:{fontVariantNumeric:"tabular-nums"},children:[i," cached"]}):(0,n.jsxs)(a.UITag,{color:"success",style:{fontVariantNumeric:"tabular-nums"},children:[l,"/",o.length]})}(t,e)}}})));return(0,n.jsx)(a.UITable,{columns:i,dataSource:t.snapshots,rowKey:"id",pagination:{pageSize:15},size:"middle",expandable:{expandedRowRender:function(r){var t=r.raw.results.filter(function(e){return!e.OK&&!e.Cached});if(0===t.length)return null;var o=new Map,s=!0,i=!1,l=void 0;try{for(var c,u=t[Symbol.iterator]();!(s=(c=u.next()).done);s=!0){var d,g=c.value,h=null!=(d=o.get(g.Task))?d:[];h.push(g.Package),o.set(g.Task,h)}}catch(e){i=!0,l=e}finally{try{s||null==u.return||u.return()}finally{if(i)throw l}}return(0,n.jsx)("div",{style:{padding:"".concat(e.paddingXS,"px ").concat(e.paddingMD,"px")},children:ee(o.entries()).map(function(r){var t=function(e){if(Array.isArray(e))return e}(r)||function(e){var r,t,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),2!==a.length);o=!0);}catch(e){s=!0,t=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw t}}return a}}(r)||er(r,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=t[0],s=t[1];return(0,n.jsxs)("div",{style:{marginBottom:e.marginSM},children:[(0,n.jsxs)("strong",{children:[o," failures (",s.length,"):"]}),(0,n.jsx)(a.UIFlex,{wrap:"wrap",gap:1,style:{marginTop:e.marginXXS},children:s.map(function(r){return(0,n.jsx)(a.UITag,{color:"error",style:{fontSize:e.fontSizeSM},children:r},r)})})]},o)})})},rowExpandable:function(e){return e.raw.results.some(function(e){return!e.OK&&!e.Cached})}}})}function en(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function ea(e,r){if(e){if("string"==typeof e)return en(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return en(e,r)}}function eo(){var e,r=(0,s.useTheme)().antdToken,t=function(e){if(Array.isArray(e))return e}(e=o.useState(void 0))||function(e){var r,t,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),2!==a.length);o=!0);}catch(e){s=!0,t=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw t}}return a}}(e)||ea(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=t[0],l=t[1],c=i?"".concat(v).concat(b,"?window=").concat(i):"".concat(v).concat(b),u=(0,s.useData)(c),d=u.data;if(u.isLoading)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});if(!d||0===d.tasks.length)return(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"Not enough data for trend analysis",description:"Need at least 2 history entries. Run 'kb qa run --save' multiple times."});var g=function(e){var r=[],t=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var i=o.value,l=!0,c=!1,u=void 0;try{for(var d,g=i.timeSeries[Symbol.iterator]();!(l=(d=g.next()).done);l=!0){var h=d.value;r.push({date:function(e){var r=new Date(e),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0"),a=String(r.getHours()).padStart(2,"0"),o=String(r.getMinutes()).padStart(2,"0");return"".concat(t,"-").concat(n," ").concat(a,":").concat(o)}(h.timestamp),value:h.failed,category:i.task})}}catch(e){c=!0,u=e}finally{try{l||null==g.return||g.return()}finally{if(c)throw u}}}}catch(e){n=!0,a=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw a}}return r}(d.tasks),h=function(e){var r,t=new Map,n=!0,a=!1,o=void 0;try{for(var s,i=e[Symbol.iterator]();!(n=(s=i.next()).done);n=!0){var l=s.value,c=!0,u=!1,d=void 0;try{for(var g,h=l.changelog[Symbol.iterator]();!(c=(g=h.next()).done);c=!0){var f=g.value,y=t.get(f.gitCommit);y||(y={timestamp:f.timestamp,gitCommit:f.gitCommit,gitMessage:f.gitMessage,changes:[]},t.set(f.gitCommit,y)),y.changes.push({task:l.task,entry:f})}}catch(e){u=!0,d=e}finally{try{c||null==h.return||h.return()}finally{if(u)throw d}}}}catch(e){a=!0,o=e}finally{try{n||null==i.return||i.return()}finally{if(a)throw o}}return((function(e){if(Array.isArray(e))return en(e)})(r=t.values())||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||ea(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(function(e,r){return r.timestamp.localeCompare(e.timestamp)})}(d.tasks);return(0,n.jsxs)("div",{children:[(0,n.jsxs)(a.UIFlex,{justify:"between",align:"center",style:{marginBottom:r.marginMD},children:[(0,n.jsxs)("span",{style:{color:r.colorTextSecondary},children:["Analyzing ",d.historyCount," history entries (window: ",d.window,")"]}),(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)("span",{children:"Window size:"}),(0,n.jsx)(a.UISelect,{value:null!=i?i:d.window,onChange:function(e){return l(e)},style:{width:80},options:[{label:"5",value:5},{label:"10",value:10},{label:"20",value:20},{label:"50",value:50}]})]})]}),(0,n.jsx)(a.UIStatisticsChart,{title:"Failure Count Over Time",data:g,loading:!1,xField:"date",yField:"value",colorField:"category",height:300,showLegend:!1,chartProps:{legend:{position:"top"}}}),(0,n.jsx)(a.UIRow,{gutter:[16,16],style:{marginTop:r.marginMD},children:d.tasks.map(function(e){return(0,n.jsx)(a.UICol,{xs:24,sm:12,children:(0,n.jsxs)(a.UICard,{size:"small",children:[(0,n.jsx)(a.UIRow,{align:"middle",gutter:16,children:(0,n.jsx)(a.UICol,{flex:"auto",children:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"ExperimentOutlined"}),(0,n.jsx)("span",{style:{fontWeight:600,fontSize:r.fontSizeLG},children:e.task}),function(e){switch(e){case"regression":return(0,n.jsx)(a.UITag,{color:"error",children:"Regression"});case"improvement":return(0,n.jsx)(a.UITag,{color:"success",children:"Improvement"});default:return(0,n.jsx)(a.UITag,{children:"No Change"})}}(e.direction)]})})}),(0,n.jsxs)(a.UIRow,{gutter:16,style:{marginTop:r.marginSM},children:[(0,n.jsx)(a.UICol,{span:6,children:(0,n.jsx)(a.UIStatistic,{title:"Previous",value:e.previous,valueStyle:{fontSize:r.fontSizeHeading4}})}),(0,n.jsx)(a.UICol,{span:6,children:(0,n.jsx)(a.UIStatistic,{title:"Current",value:e.current,valueStyle:{fontSize:r.fontSizeHeading4}})}),(0,n.jsx)(a.UICol,{span:6,children:(0,n.jsx)(a.UIStatistic,{title:"Delta",value:Math.abs(e.delta),prefix:function(e){switch(e){case"regression":return(0,n.jsx)(a.UIIcon,{name:"ArrowUpOutlined"});case"improvement":return(0,n.jsx)(a.UIIcon,{name:"ArrowDownOutlined"});default:return(0,n.jsx)(a.UIIcon,{name:"MinusOutlined"})}}(e.direction),valueStyle:{color:function(e,r){switch(e){case"regression":return r.colorError;case"improvement":return r.colorSuccess;default:return r.colorTextSecondary}}(e.direction,r),fontSize:r.fontSizeHeading4}})}),(0,n.jsx)(a.UICol,{span:6,children:(0,n.jsx)(a.UIStatistic,{title:"Velocity",value:Math.abs(e.velocity),precision:1,prefix:e.velocity>0?(0,n.jsx)(a.UIIcon,{name:"ArrowUpOutlined"}):e.velocity<0?(0,n.jsx)(a.UIIcon,{name:"ArrowDownOutlined"}):(0,n.jsx)(a.UIIcon,{name:"MinusOutlined"}),suffix:"/run",valueStyle:{color:e.velocity>0?r.colorError:e.velocity<0?r.colorSuccess:r.colorTextSecondary,fontSize:r.fontSizeHeading4}})})]})]})},e.task)})}),(0,n.jsx)(a.UICard,{title:"Changelog — What Changed",style:{marginTop:r.marginMD},children:0===h.length?(0,n.jsx)(a.UIEmptyState,{description:"No changes detected between entries"}):(0,n.jsx)(a.UITimeline,{children:h.map(function(e){var t=e.changes.reduce(function(e,r){return e+r.entry.newFailures.length},0)>e.changes.reduce(function(e,r){return e+r.entry.fixed.length},0)?r.colorError:r.colorSuccess;return(0,n.jsxs)(a.UITimelineItem,{color:t,children:[(0,n.jsxs)("div",{style:{marginBottom:r.marginXXS},children:[(0,n.jsx)(a.UITag,{style:{fontFamily:"monospace"},children:e.gitCommit.slice(0,7)}),(0,n.jsx)("span",{style:{color:r.colorTextSecondary,fontSize:r.fontSizeSM},children:new Date(e.timestamp).toLocaleString()})]}),(0,n.jsx)("div",{style:{fontSize:r.fontSize,color:r.colorTextSecondary,marginBottom:r.marginXS},children:e.gitMessage}),e.changes.map(function(e){var t=e.task,o=e.entry;return(0,n.jsxs)("div",{style:{marginBottom:r.marginXXS},children:[(0,n.jsxs)("span",{style:{fontWeight:500},children:[t,":"]}),o.newFailures.length>0&&(0,n.jsxs)("span",{style:{marginLeft:8},children:[(0,n.jsxs)(a.UITag,{color:"error",style:{fontSize:r.fontSizeSM},children:["+",o.newFailures.length," new"]}),o.newFailures.map(function(e){return(0,n.jsx)(a.UITag,{color:"red",style:{fontSize:r.fontSizeSM},children:e},e)})]}),o.fixed.length>0&&(0,n.jsxs)("span",{style:{marginLeft:8},children:[(0,n.jsxs)(a.UITag,{color:"success",style:{fontSize:r.fontSizeSM},children:["-",o.fixed.length," fixed"]}),o.fixed.map(function(e){return(0,n.jsx)(a.UITag,{color:"green",style:{fontSize:r.fontSizeSM},children:e},e)})]})]},t)})]},e.gitCommit)})})})]})}function es(){var e=(0,s.useTheme)().antdToken,r=(0,s.useData)("".concat(v).concat("/regressions")),t=r.data;return r.isLoading?(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}}):t?t.hasRegressions?(0,n.jsxs)("div",{children:[(0,n.jsx)(a.UIAlert,{variant:"error",showIcon:!0,icon:(0,n.jsx)(a.UIIcon,{name:"WarningOutlined"}),message:"".concat(t.regressions.length," regression").concat(t.regressions.length>1?"s":""," detected"),description:(0,n.jsxs)(a.UISpace,{direction:"vertical",size:0,children:[(0,n.jsx)("span",{children:"The following tasks have new failures compared to the previous run."}),(0,n.jsxs)("span",{style:{fontSize:e.fontSizeSM,color:e.colorTextSecondary},children:["Compared: ",new Date(t.comparedAt.previous).toLocaleString()," →"," ",new Date(t.comparedAt.current).toLocaleString()]})]}),style:{marginBottom:e.marginLG}}),t.regressions.map(function(r,t){return(0,n.jsx)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"ExperimentOutlined"}),(0,n.jsx)("span",{children:r.task}),(0,n.jsxs)(a.UITag,{color:"error",children:["+",r.delta," new failure",r.delta>1?"s":""]})]}),style:{marginBottom:e.marginMD},children:(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"New failures:"}),(0,n.jsx)(a.UIFlex,{wrap:"wrap",gap:1,style:{marginTop:e.marginXS},children:r.newFailures.map(function(e){return(0,n.jsx)(a.UITag,{color:"error",children:e},e)})})]})},t)}),(0,n.jsx)(a.UIAlert,{variant:"warning",showIcon:!0,message:"Action required",description:(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{children:"Fix the regressions above before merging. Recommendations:"}),(0,n.jsxs)("ol",{style:{margin:0,paddingLeft:20},children:[(0,n.jsxs)("li",{children:["Run ",(0,n.jsx)("code",{children:"kb qa run"})," to see detailed error output"]}),(0,n.jsx)("li",{children:"Fix the failing packages"}),(0,n.jsxs)("li",{children:["Re-run ",(0,n.jsx)("code",{children:"kb qa run --save"})," to verify fixes"]})]})]}),style:{marginTop:e.marginMD}})]}):(0,n.jsxs)("div",{children:[(0,n.jsx)(a.UIAlert,{variant:"success",showIcon:!0,icon:(0,n.jsx)(a.UIIcon,{name:"CheckCircleOutlined"}),message:"No regressions detected",description:(0,n.jsxs)(a.UISpace,{direction:"vertical",size:0,children:[(0,n.jsx)("span",{children:"All tasks show the same or fewer failures compared to the previous run."}),(0,n.jsxs)("span",{style:{color:e.colorTextSecondary,fontSize:e.fontSizeSM},children:["Compared: ",new Date(t.comparedAt.previous).toLocaleString()," →"," ",new Date(t.comparedAt.current).toLocaleString()]})]}),style:{marginBottom:e.marginLG}}),(0,n.jsx)(a.UIEmptyState,{description:"No regressions to display"})]}):(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"Not enough data for regression detection",description:"Need at least 2 history entries. Run 'kb qa run --save' multiple times."})}function ei(){var e=(0,n.jsx)(a.UITabs,{syncUrl:"search",items:[{key:"run",label:"Run",children:(0,n.jsx)(E,{})},{key:"health",label:"Health",children:(0,n.jsx)(R,{})},{key:"overview",label:"Overview",children:(0,n.jsx)(J,{})},{key:"history",label:"History",children:(0,n.jsx)(et,{})},{key:"trends",label:"Trends",children:(0,n.jsx)(eo,{})},{key:"regressions",label:"Regressions",children:(0,n.jsx)(es,{})}]});return(0,n.jsx)(a.UIPage,{children:(0,n.jsx)(a.UIPageHeader,{title:"QA",description:"Build, lint, type check, and test results with baseline tracking and regression detection",tabs:e})})}}}]);
|
|
1
|
+
"use strict";(self.rspackChunk_kb_labs_qa_entry=self.rspackChunk_kb_labs_qa_entry||[]).push([[23],{6286(e,r,t){t.r(r),t.d(r,{default:()=>ei});var n=t(4552),a=t(5155),o=t(92),s=t(4519),i=t(2137),l=i.Ik({commit:i.Yj(),branch:i.Yj(),message:i.Yj()}),c=i.Ik({id:i.Yj(),timestamp:i.Yj(),git:l.optional(),durationMs:i.ai(),runContext:i.g1(i.L5()).optional()}),u=i.Ik({Package:i.Yj(),Task:i.Yj(),OK:i.zM(),Cached:i.zM(),Elapsed:i.ai(),ExitCode:i.ai(),Stdout:i.Yj(),Stderr:i.Yj(),Error:i.Yj()}),d=i.Ik({elapsed:i.Yj(),ok:i.zM(),results:i.YO(u),summary:i.Ik({total:i.ai(),passed:i.ai(),failed:i.ai(),cached:i.ai()})}),g=i.Ik({check:i.Yj(),severity:i.k5(["error","warning","info"]),message:i.Yj(),file:i.Yj().optional(),fix:i.Yj().optional(),capability:i.Yj().optional()}),h=i.Ik({ok:i.zM(),packages:i.g1(i.Ik({ok:i.zM(),issues:i.YO(g).nullable()}))}),f=i.Ik({ok:i.zM(),score:i.ai(),grade:i.Yj(),summary:i.Ik({total:i.ai(),healthy:i.ai(),warning:i.ai(),error:i.ai(),total_errors:i.ai(),total_warnings:i.ai()}),by_category:i.g1(i.Ik({total:i.ai(),healthy:i.ai(),issues:i.ai(),grade:i.Yj()})),issues_by_type:i.g1(i.Ik({check:i.Yj(),errors:i.ai(),warnings:i.ai(),packages:i.ai()})),coverage:i.g1(i.Ik({pass:i.ai(),total:i.ai(),pct:i.ai()}))}),y=i.Ik({ok:i.zM(),staged_files:i.ai(),violations:i.YO(i.Ik({package:i.Yj(),check:i.Yj(),severity:i.Yj(),message:i.Yj()}))}),p=c.extend({kind:i.eu("run"),tasks:i.YO(i.Yj()),raw:d}),m=c.extend({kind:i.eu("check"),raw:h}),x=c.extend({kind:i.eu("stats"),raw:f}),j=c.extend({kind:i.eu("gate"),raw:y}),I=i.Ik({timestamp:i.Yj(),git:l.optional(),check:h,stats:f}),S=i.Ik({newIssues:i.YO(i.Ik({pkg:i.Yj(),check:i.Yj(),status:i.k5(["new","fixed","persisting"]),severity:i.Yj(),message:i.Yj()})),fixedIssues:i.YO(i.Ik({pkg:i.Yj(),check:i.Yj(),status:i.k5(["new","fixed","persisting"]),severity:i.Yj(),message:i.Yj()})),persistingIssues:i.YO(i.Ik({pkg:i.Yj(),check:i.Yj(),status:i.k5(["new","fixed","persisting"]),severity:i.Yj(),message:i.Yj()})),newIssueCount:i.ai(),fixedIssueCount:i.ai(),scoreDelta:i.ai(),gradeDelta:i.Yj()});i.Ik({score:i.ai().nullable(),grade:i.Yj().nullable(),ok:i.zM().nullable(),lastRunAt:i.Yj().nullable(),lastCheckAt:i.Yj().nullable(),lastStatsAt:i.Yj().nullable(),git:l.nullable(),hasBaseline:i.zM(),baselineTimestamp:i.Yj().nullable(),runHistoryCount:i.ai()}),i.Ik({tasks:i.YO(i.Yj()).optional(),save:i.zM().optional(),runContext:i.g1(i.L5()).optional()}),i.Ik({ok:i.zM(),snapshot:p,durationMs:i.ai()}),i.Ik({save:i.zM().optional(),runContext:i.g1(i.L5()).optional()}),i.Ik({ok:i.zM(),snapshot:m,durationMs:i.ai()}),i.Ik({snapshot:x.nullable()}),i.Ik({save:i.zM().optional()}),i.Ik({ok:i.zM(),snapshot:j,durationMs:i.ai()}),i.Ik({snapshots:i.YO(p),total:i.ai()}),i.Ik({baseline:I.nullable()}),i.KC([S,i.Ik({error:i.k5(["no-baseline","no-check","no-stats"])})]);var v="/v1/plugins/qa",k="/summary",b="/trends",w="/baseline/diff";function U(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function T(e,r){return null!=r&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function C(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,i=!1;try{for(a=a.call(e);!(s=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);s=!0);}catch(e){i=!0,n=e}finally{try{s||null==a.return||a.return()}finally{if(i)throw n}}return o}}(e,r)||z(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e){return function(e){if(Array.isArray(e))return U(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||z(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e,r){if(e){if("string"==typeof e)return U(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return U(e,r)}}function A(e){var r,t,i=e.availableTasks,l=e.defaultTasks,c=(0,s.useTheme)().antdToken,u=(0,s.useNotification)(),d=null!=l?l:i.slice(0,4),g=C(o.useState(new Set(d)),2),h=g[0],f=g[1],y=C(o.useState(null),2),p=y[0],m=y[1],x=(0,s.useMutateData)("".concat(v).concat("/run")),j=(null==p?void 0:p.raw.results)?function(){var e=new Map,r=!0,t=!1,n=void 0;try{for(var a,o=p.raw.results[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s,i=a.value,l=null!=(s=e.get(i.Task))?s:{passed:0,failed:0,cached:0,failures:[]};i.Cached?l.cached++:i.OK?l.passed++:(l.failed++,l.failures.push(i.Package)),e.set(i.Task,l)}}catch(e){t=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(t)throw n}}return e}():null;return(0,n.jsxs)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"PlayCircleOutlined"}),(0,n.jsx)("span",{children:"Run Tasks"})]}),extra:(0,n.jsxs)(a.UIButton,{variant:"primary",loading:x.isLoading,disabled:0===h.size,onClick:function(){var e=O(h);0===e.length?u.error("Select at least one task"):x.mutate({tasks:e},{onSuccess:function(e){return m(e)},onError:function(e){return u.error("Run failed: ".concat(T(e,Error)?e.message:String(e)))}})},icon:(0,n.jsx)(a.UIIcon,{name:"CaretRightOutlined"}),children:["Run ",h.size>0?"(".concat(h.size,")"):""]}),children:[(0,n.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:c.marginMD},children:i.map(function(e){var r=h.has(e);return(0,n.jsx)("div",{onClick:function(){return f(function(r){var t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t})},style:{cursor:"pointer",padding:"2px 10px",borderRadius:4,border:"1px solid ".concat(r?c.colorPrimary:c.colorBorderSecondary),background:r?c.colorPrimaryBg:"transparent",fontSize:c.fontSizeSM,fontWeight:r?600:400,color:r?c.colorPrimary:c.colorTextSecondary,userSelect:"none",transition:"all 0.15s",lineHeight:"22px"},children:e},e)})}),p&&j&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIDivider,{style:{margin:"".concat(c.marginSM,"px 0")}}),(0,n.jsxs)(a.UIRow,{gutter:[8,8],children:[O(j.entries()).map(function(e){var r=C(e,2),t=r[0],o=r[1],s=o.passed+o.failed+o.cached,i=s>0?Math.round((o.passed+o.cached)/s*100):100,l=o.failed>0;return(0,n.jsx)(a.UICol,{xs:24,sm:12,lg:8,xl:6,children:(0,n.jsxs)("div",{style:{padding:"".concat(c.paddingXS,"px ").concat(c.paddingSM,"px"),border:"1px solid ".concat(l?c.colorErrorBorder:c.colorSuccessBorder),borderRadius:c.borderRadius,background:l?c.colorErrorBg:c.colorSuccessBg},children:[(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[(0,n.jsx)("span",{style:{fontWeight:600,fontSize:c.fontSizeSM},children:t}),(0,n.jsxs)("span",{style:{fontSize:11,color:c.colorTextSecondary},children:[o.passed>0&&"".concat(o.passed," pass"),o.passed>0&&o.failed>0&&" \xb7 ",o.failed>0&&(0,n.jsxs)("span",{style:{color:c.colorError},children:[o.failed," fail"]}),(o.passed>0||o.failed>0)&&o.cached>0&&" \xb7 ",o.cached>0&&"".concat(o.cached," cached")]})]}),(0,n.jsx)(a.UIProgress,{percent:i,size:"small",status:l?"exception":"success",showInfo:!1}),o.failures.length>0&&(0,n.jsxs)("div",{style:{marginTop:4,fontSize:11,color:c.colorError},children:[o.failures.slice(0,2).map(function(e){return(0,n.jsxs)("div",{children:["✗ ",e]},e)}),o.failures.length>2&&(0,n.jsxs)("div",{style:{color:c.colorTextSecondary},children:["+",o.failures.length-2," more"]})]})]})},t)}),(0,n.jsx)(a.UICol,{xs:24,children:(0,n.jsxs)("span",{style:{fontSize:11,color:c.colorTextSecondary},children:[(0,n.jsx)(a.UITag,{color:p.ok?"success":"error",style:{fontSize:11},children:p.ok?"✓ passed":"✗ failed"})," ",isNaN(t=parseFloat(r=p.raw.elapsed))?r:t>=60?"".concat((t/60).toFixed(1),"m"):"".concat(t.toFixed(1),"s")," \xb7 ",p.raw.summary.total," pkgs"]})})]})]})]})}function M(){var e=(0,s.useTheme)().antdToken,r=(0,s.useNotification)(),t=C(o.useState(null),2),i=t[0],l=t[1],c=(0,s.useMutateData)("".concat(v).concat("/check")),u=(null==i?void 0:i.raw.packages)?Object.entries(i.raw.packages).filter(function(e){var r=C(e,2)[1];return r.issues&&r.issues.length>0}).map(function(e){var r,t,n,a,o=C(e,2),s=o[0],i=o[1];return{key:s,pkg:s,errors:null!=(r=null==(n=i.issues)?void 0:n.filter(function(e){return"error"===e.severity}).length)?r:0,warnings:null!=(t=null==(a=i.issues)?void 0:a.filter(function(e){return"warning"===e.severity}).length)?t:0}}):null;return(0,n.jsxs)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"SafetyCertificateOutlined"}),(0,n.jsx)("span",{children:"Structural Check"})]}),extra:(0,n.jsx)(a.UIButton,{loading:c.isLoading,icon:(0,n.jsx)(a.UIIcon,{name:"AuditOutlined"}),onClick:function(){return c.mutate({},{onSuccess:function(e){return l(e)},onError:function(e){return r.error("Check failed: ".concat(T(e,Error)?e.message:String(e)))}})},children:"Run Check"}),children:[(0,n.jsxs)("div",{style:{color:e.colorTextSecondary,fontSize:e.fontSizeSM,marginBottom:e.marginMD},children:[(0,n.jsx)("code",{children:"kb-devkit check"})," — README, tsconfig, engines, dependencies и прочие структурные требования."]}),i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIDivider,{style:{margin:"".concat(e.marginSM,"px 0")}}),(null==u?void 0:u.length)?(0,n.jsx)(a.UITable,{dataSource:u,size:"small",pagination:u.length>8&&{pageSize:8},columns:[{title:"Package",dataIndex:"pkg",key:"pkg",ellipsis:!0},{title:"Errors",dataIndex:"errors",key:"errors",width:80,render:function(r){return r>0?(0,n.jsx)(a.UIBadge,{count:r,style:{backgroundColor:e.colorError}}):"—"}},{title:"Warnings",dataIndex:"warnings",key:"warnings",width:90,render:function(r){return r>0?(0,n.jsx)(a.UIBadge,{count:r,style:{backgroundColor:e.colorWarning}}):"—"}}]}):(0,n.jsx)(a.UIAlert,{variant:"success",showIcon:!0,message:"All packages pass structural checks"})]})]})}function D(){var e,r=(0,s.useTheme)().antdToken,t=(0,s.useNotification)(),i=C(o.useState(null),2),l=i[0],c=i[1],u=(0,s.useMutateData)("".concat(v).concat("/gate")),d=null!=(e=null==l?void 0:l.raw.violations)?e:[];return(0,n.jsxs)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"SecurityScanOutlined"}),(0,n.jsx)("span",{children:"Gate Check"})]}),extra:(0,n.jsx)(a.UIButton,{loading:u.isLoading,icon:(0,n.jsx)(a.UIIcon,{name:"ThunderboltOutlined"}),onClick:function(){return u.mutate({},{onSuccess:function(e){return c(e)},onError:function(e){return t.error("Gate failed: ".concat(T(e,Error)?e.message:String(e)))}})},children:"Run Gate"}),children:[(0,n.jsxs)("div",{style:{color:r.colorTextSecondary,fontSize:r.fontSizeSM,marginBottom:r.marginMD},children:[(0,n.jsx)("code",{children:"kb-devkit gate"})," — пре-коммит проверка staged файлов.",l?" Staged: ".concat(l.raw.staged_files):""]}),l&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIDivider,{style:{margin:"".concat(r.marginSM,"px 0")}}),l.ok?(0,n.jsx)(a.UIAlert,{variant:"success",showIcon:!0,message:"Gate passed — safe to commit"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIAlert,{variant:"error",showIcon:!0,message:"".concat(d.length," violation").concat(1!==d.length?"s":""),style:{marginBottom:r.marginSM}}),(0,n.jsx)(a.UITable,{dataSource:d.map(function(e,r){var t,n;return t=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({},e),n=n={key:r},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t}),size:"small",pagination:!1,columns:[{title:"Package",dataIndex:"package",key:"package",ellipsis:!0},{title:"Check",dataIndex:"check",key:"check"},{title:"Severity",dataIndex:"severity",key:"severity",width:90,render:function(e){return(0,n.jsx)(a.UITag,{color:"error"===e?"error":"warning",children:e})}},{title:"Message",dataIndex:"message",key:"message",ellipsis:!0}]})]})]})]})}function P(){var e,r,t=(0,s.useTheme)().antdToken,i=(0,s.useNotification)(),l=C(o.useState(null),2),c=l[0],u=l[1],d=(0,s.useMutateData)("".concat(v).concat("/baseline/update")),g=null==c?void 0:c.baseline;return(0,n.jsxs)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"AimOutlined"}),(0,n.jsx)("span",{children:"Baseline"})]}),extra:(0,n.jsx)(a.UIButton,{loading:d.isLoading,icon:(0,n.jsx)(a.UIIcon,{name:"SaveOutlined"}),onClick:function(){return d.mutate({},{onSuccess:function(e){u(e),i.success("Baseline updated")},onError:function(e){return i.error("Failed: ".concat(T(e,Error)?e.message:String(e)))}})},children:"Update Baseline"}),children:[(0,n.jsxs)("div",{style:{color:t.colorTextSecondary,fontSize:t.fontSizeSM,marginBottom:t.marginMD},children:[(0,n.jsx)("code",{children:"kb-devkit check"})," + ",(0,n.jsx)("code",{children:"kb-devkit stats"})," → сохраняет текущее состояние как новый baseline для diff."]}),g&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIDivider,{style:{margin:"".concat(t.marginSM,"px 0")}}),(0,n.jsx)(a.UIAlert,{variant:"success",showIcon:!0,message:"Baseline saved",description:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsxs)("span",{children:["Score: ",(0,n.jsxs)("strong",{children:[null==(e=g.stats)?void 0:e.score,"/100"]})]}),(0,n.jsx)(a.UITag,{color:"processing",children:null==(r=g.stats)?void 0:r.grade}),(0,n.jsxs)("span",{style:{color:t.colorTextSecondary,fontSize:t.fontSizeSM},children:[new Date(g.timestamp).toLocaleString(),g.git?" \xb7 ".concat(g.git.branch," (").concat(g.git.commit.slice(0,7),")"):""]})]})})]})]})}function E(){(0,s.useTheme)().antdToken;var e,r,t=(0,s.useData)("".concat(v).concat("/tasks")),o=t.data;if(t.isLoading)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});var i=null!=(e=null==o?void 0:o.tasks)?e:[];return(0,n.jsxs)(a.UISpace,{direction:"vertical",style:{width:"100%"},size:"large",children:[0===i.length?(0,n.jsx)(a.UIAlert,{variant:"warning",showIcon:!0,message:"devkit.yaml not found",description:"Add a devkit.yaml to the root of your repository to configure available tasks."}):(0,n.jsx)(A,{availableTasks:i,defaultTasks:null!=(r=null==o?void 0:o.defaultTasks)?r:null}),(0,n.jsxs)(a.UIRow,{gutter:[16,16],children:[(0,n.jsx)(a.UICol,{xs:24,lg:12,children:(0,n.jsx)(M,{})}),(0,n.jsx)(a.UICol,{xs:24,lg:12,children:(0,n.jsx)(D,{})})]}),(0,n.jsx)(P,{})]})}function B(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function Y(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,i=!1;try{for(a=a.call(e);!(s=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);s=!0);}catch(e){i=!0,n=e}finally{try{s||null==a.return||a.return()}finally{if(i)throw n}}return o}}(e,r)||function(e,r){if(e){if("string"==typeof e)return B(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return B(e,r)}}(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e){return"A"===e||"A+"===e?"success":"B"===e?"processing":"C"===e?"warning":"error"}function R(){var e,r,t=(0,s.useTheme)().antdToken,o=(0,s.useData)("".concat(v).concat(k)),i=o.data,l=o.isLoading,c=(0,s.useData)("".concat(v).concat(w)),u=c.data,d=c.isLoading;if(l||d)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});var g=null==i||null==(r=i.latestStats)?void 0:r.raw;if(!g)return(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No health data",description:"Run 'kb qa stats' to collect health data.",style:{marginBottom:t.marginLG}});var h=u&&!("error"in u)&&(u.newIssueCount>0||u.fixedIssueCount>0),f=!u||"error"in u?null:u,y=Object.entries(g.by_category).map(function(e){var r=Y(e,2),t=r[0],n=r[1];return{key:t,category:t,total:n.total,healthy:n.healthy,issues:n.issues,grade:n.grade,pct:n.total>0?Math.round(n.healthy/n.total*100):0}}),p=Object.entries(g.coverage).map(function(e){var r=Y(e,2),t=r[0],n=r[1];return{key:t,name:t,pass:n.pass,total:n.total,pct:n.pct}}),m=Object.entries(g.issues_by_type).map(function(e){var r=Y(e,2),t=r[0],n=r[1];return{key:t,check:n.check,errors:n.errors,warnings:n.warnings,packages:n.packages}});return(0,n.jsxs)(a.UISpace,{direction:"vertical",style:{width:"100%"},size:"large",children:[h&&f&&(0,n.jsx)(a.UIAlert,{variant:f.newIssueCount>0?"error":"success",showIcon:!0,message:(0,n.jsxs)(a.UISpace,{children:[f.newIssueCount>0&&(0,n.jsxs)(a.UITag,{color:"error",children:[f.newIssueCount," new issues"]}),f.fixedIssueCount>0&&(0,n.jsxs)(a.UITag,{color:"success",children:[f.fixedIssueCount," fixed"]}),(0,n.jsxs)(a.UITag,{color:f.scoreDelta>=0?"green":"red",children:["score ",f.scoreDelta>0?"+":"",f.scoreDelta]}),(0,n.jsx)(a.UITag,{children:f.gradeDelta})]})}),(0,n.jsxs)(a.UIRow,{gutter:[16,16],align:"stretch",children:[(0,n.jsx)(a.UICol,{xs:24,sm:8,children:(0,n.jsxs)(a.UICard,{style:{height:"100%"},children:[(0,n.jsx)(a.UIStatistic,{title:"Health Score",value:g.score,suffix:"/ 100",valueStyle:{color:(e=g.grade,"A"===e||"A+"===e?t.colorSuccess:"B"===e?t.colorPrimary:"C"===e?t.colorWarning:t.colorError),fontSize:40}}),(0,n.jsx)(a.UITag,{color:L(g.grade),style:{marginTop:t.marginSM,fontSize:16,padding:"2px 14px"},children:g.grade})]})}),(0,n.jsx)(a.UICol,{xs:24,sm:16,children:(0,n.jsxs)(a.UIRow,{gutter:[16,16],style:{height:"100%"},children:[(0,n.jsx)(a.UICol,{span:8,children:(0,n.jsx)(a.UICard,{style:{height:"100%"},children:(0,n.jsx)(a.UIStatistic,{title:"Healthy",value:g.summary.healthy,valueStyle:{color:t.colorSuccess}})})}),(0,n.jsx)(a.UICol,{span:8,children:(0,n.jsx)(a.UICard,{style:{height:"100%"},children:(0,n.jsx)(a.UIStatistic,{title:"Warning",value:g.summary.warning,valueStyle:{color:t.colorWarning}})})}),(0,n.jsx)(a.UICol,{span:8,children:(0,n.jsx)(a.UICard,{style:{height:"100%"},children:(0,n.jsx)(a.UIStatistic,{title:"Error",value:g.summary.error,valueStyle:{color:t.colorError}})})})]})})]}),(0,n.jsx)(a.UICard,{title:"By Category",children:(0,n.jsx)(a.UITable,{dataSource:y,size:"small",pagination:!1,columns:[{title:"Category",dataIndex:"category",key:"category"},{title:"Grade",dataIndex:"grade",key:"grade",render:function(e){return(0,n.jsx)(a.UITag,{color:L(e),children:e})}},{title:"Healthy",dataIndex:"healthy",key:"healthy"},{title:"Total",dataIndex:"total",key:"total"},{title:"Issues",dataIndex:"issues",key:"issues"},{title:"Coverage",dataIndex:"pct",key:"pct",render:function(e){return"".concat(e,"%")}}]})}),p.length>0&&(0,n.jsx)(a.UICard,{title:"Coverage",children:(0,n.jsx)(a.UITable,{dataSource:p,size:"small",pagination:!1,columns:[{title:"Check",dataIndex:"name",key:"name"},{title:"Pass",dataIndex:"pass",key:"pass"},{title:"Total",dataIndex:"total",key:"total"},{title:"Pct",dataIndex:"pct",key:"pct",render:function(e){return(0,n.jsxs)(a.UITag,{color:e>=80?"green":e>=50?"orange":"red",children:[e,"%"]})}}]})}),m.length>0&&(0,n.jsx)(a.UICard,{title:"Issues by Type",children:(0,n.jsx)(a.UITable,{dataSource:m,size:"small",pagination:!1,columns:[{title:"Check",dataIndex:"check",key:"check"},{title:"Errors",dataIndex:"errors",key:"errors",render:function(e){return e>0?(0,n.jsx)(a.UITag,{color:"red",children:e}):(0,n.jsx)(a.UITag,{children:"0"})}},{title:"Warnings",dataIndex:"warnings",key:"warnings",render:function(e){return e>0?(0,n.jsx)(a.UITag,{color:"orange",children:e}):(0,n.jsx)(a.UITag,{children:"0"})}},{title:"Packages",dataIndex:"packages",key:"packages"}]})}),f&&f.newIssues.length>0&&(0,n.jsx)(a.UICard,{title:"New Issues (".concat(f.newIssues.length,")"),children:(0,n.jsx)(a.UITable,{dataSource:f.newIssues.map(function(e,r){var t,n;return t=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({},e),n=n={key:r},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t}),size:"small",pagination:{pageSize:10},columns:[{title:"Package",dataIndex:"pkg",key:"pkg"},{title:"Check",dataIndex:"check",key:"check"},{title:"Severity",dataIndex:"severity",key:"severity",render:function(e){return(0,n.jsx)(a.UITag,{color:"error"===e?"red":"warning"===e?"orange":"blue",children:e})}},{title:"Message",dataIndex:"message",key:"message"}]})})]})}function N(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function F(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,i=!1;try{for(a=a.call(e);!(s=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);s=!0);}catch(e){i=!0,n=e}finally{try{s||null==a.return||a.return()}finally{if(i)throw n}}return o}}(e,r)||function(e,r){if(e){if("string"==typeof e)return N(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return N(e,r)}}(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var W={error:{color:"error",iconName:"CloseCircleOutlined"},warning:{color:"warning",iconName:"WarningOutlined"},info:{color:"default",iconName:"InfoCircleOutlined"}};function _(e){var r,t=e.open,i=e.onClose,l=(0,s.useTheme)().antdToken,c=F(o.useState(""),2),u=c[0],d=c[1],g=(0,s.useData)("".concat(v).concat(k)),h=g.data,f=g.isLoading,y=null!=(r=null==h?void 0:h.latestCheck)?r:null,p=o.useMemo(function(){if(!y)return[];var e=[],r=!0,t=!1,n=void 0;try{for(var a,o=Object.entries(y.raw.packages)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=F(a.value,2),i=s[0],l=s[1],c=!0,u=!1,d=void 0;try{for(var g,h,f=(null!=(g=l.issues)?g:[])[Symbol.iterator]();!(c=(h=f.next()).done);c=!0){var p=h.value;e.push(function(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({},p),{pkg:i}))}}catch(e){u=!0,d=e}finally{try{c||null==f.return||f.return()}finally{if(u)throw d}}}}catch(e){t=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(t)throw n}}return e},[y]),m=o.useMemo(function(){if(!u)return p;var e=u.toLowerCase();return p.filter(function(r){var t;return r.pkg.toLowerCase().includes(e)||r.check.toLowerCase().includes(e)||r.message.toLowerCase().includes(e)||(null!=(t=r.file)?t:"").toLowerCase().includes(e)})},[p,u]),x=m.filter(function(e){return"error"===e.severity}).length,j=m.filter(function(e){return"warning"===e.severity}).length,I=[{title:"Severity",dataIndex:"severity",key:"severity",width:90,filters:[{text:"Error",value:"error"},{text:"Warning",value:"warning"},{text:"Info",value:"info"}],onFilter:function(e,r){return r.severity===e},render:function(e){var r=W[e];return r?(0,n.jsx)(a.UITag,{color:r.color,icon:(0,n.jsx)(a.UIIcon,{name:r.iconName}),children:e}):(0,n.jsx)(a.UITag,{children:e})}},{title:"Package",dataIndex:"pkg",key:"pkg",width:200,sorter:function(e,r){return e.pkg.localeCompare(r.pkg)},render:function(e){return(0,n.jsx)(a.UITypographyText,{code:!0,style:{fontSize:l.fontSizeSM},children:e})}},{title:"Check",dataIndex:"check",key:"check",width:150,render:function(e){return(0,n.jsx)(a.UITag,{style:{fontSize:l.fontSizeSM},children:e})}},{title:"Message",dataIndex:"message",key:"message",render:function(e,r){return(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{style:{fontSize:l.fontSizeSM},children:e}),r.file&&(0,n.jsx)("div",{children:(0,n.jsx)(a.UITypographyText,{type:"secondary",style:{fontSize:l.fontSizeSM},children:r.file})})]})}}];return(0,n.jsxs)(a.UIDrawer,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)("span",{children:"Check Issues"}),x>0&&(0,n.jsxs)(a.UITag,{color:"error",children:[x," errors"]}),j>0&&(0,n.jsxs)(a.UITag,{color:"warning",children:[j," warnings"]})]}),placement:"right",width:820,open:t,onClose:i,children:[f&&(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}}),!f&&!y&&(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No check data available",description:"Run 'kb qa check --save' to generate check results."}),!f&&y&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.UIInput,{placeholder:"Filter by package, check, message, or file...",prefix:(0,n.jsx)(a.UIIcon,{name:"SearchOutlined"}),value:u,onChange:function(e){return d(e)},style:{marginBottom:l.marginMD},allowClear:!0}),0===m.length?(0,n.jsx)(a.UIEmptyState,{description:u?"No issues match your filter":"No issues found"}):(0,n.jsx)(a.UITable,{dataSource:m,columns:I,rowKey:function(e,r){return"".concat(e.pkg,"-").concat(e.check,"-").concat(null!=r?r:0)},size:"small",pagination:{pageSize:50},expandable:{expandedRowRender:function(e){return e.fix?(0,n.jsx)(a.UIAccordion,{ghost:!0,items:[{key:"1",label:"Suggested fix",children:(0,n.jsx)("pre",{style:{background:l.colorFillTertiary,color:l.colorText,padding:l.paddingSM,borderRadius:l.borderRadius,fontSize:l.fontSizeSM,maxHeight:200,overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:e.fix})}]}):null},rowExpandable:function(e){return!!e.fix}}})]})]})}function G(e){var r=e.issues;e.color;var t=(0,s.useTheme)().antdToken,o=r.slice(0,5);return(0,n.jsxs)("div",{children:[o.map(function(e,r){return(0,n.jsxs)("div",{style:{marginBottom:t.marginXXS},children:[(0,n.jsx)(a.UITag,{color:"error"===e.severity?"error":"warning"===e.severity?"warning":"default",style:{fontSize:t.fontSizeSM},children:e.check}),(0,n.jsx)(a.UITag,{style:{fontSize:t.fontSizeSM},children:e.pkg}),(0,n.jsxs)("span",{style:{fontSize:t.fontSizeSM,color:t.colorTextSecondary},children:[e.message.slice(0,60),e.message.length>60?"…":""]})]},r)}),r.length>5&&(0,n.jsxs)(a.UITypographyText,{type:"secondary",style:{fontSize:t.fontSizeSM},children:["+",r.length-5," more"]})]})}function H(e){var r=e.diff,t=(0,s.useTheme)().antdToken,o=r.newIssueCount>0,i=r.fixedIssueCount>0;return(0,n.jsx)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"WarningOutlined",style:{color:o?t.colorError:t.colorSuccess}}),(0,n.jsx)("span",{children:"Baseline Diff"}),o&&(0,n.jsxs)(a.UITag,{color:"error",children:["+",r.newIssueCount," new issues"]}),i&&(0,n.jsxs)(a.UITag,{color:"success",children:[r.fixedIssueCount," fixed"]})]}),children:(0,n.jsxs)(a.UIRow,{gutter:[16,16],children:[(0,n.jsx)(a.UICol,{xs:24,sm:8,children:(0,n.jsxs)(a.UICard,{size:"small",style:{textAlign:"center"},children:[(0,n.jsx)(a.UITypographyText,{strong:!0,children:"Score Delta"}),(0,n.jsx)("div",{style:{marginTop:t.marginXS},children:(0,n.jsx)(a.UIStatistic,{value:Math.abs(r.scoreDelta),prefix:r.scoreDelta>0?(0,n.jsx)(a.UIIcon,{name:"ArrowUpOutlined"}):r.scoreDelta<0?(0,n.jsx)(a.UIIcon,{name:"ArrowDownOutlined"}):null,valueStyle:{color:r.scoreDelta<0?t.colorError:r.scoreDelta>0?t.colorSuccess:t.colorTextSecondary,fontSize:t.fontSizeHeading3},suffix:r.gradeDelta?" (".concat(r.gradeDelta,")"):void 0})})]})}),r.newIssues.length>0&&(0,n.jsx)(a.UICol,{xs:24,sm:8,children:(0,n.jsxs)(a.UICard,{size:"small",children:[(0,n.jsxs)(a.UITypographyText,{type:"danger",strong:!0,children:["New Issues (",r.newIssues.length,")"]}),(0,n.jsx)("div",{style:{marginTop:t.marginXS},children:(0,n.jsx)(G,{issues:r.newIssues,color:"error"})})]})}),r.fixedIssues.length>0&&(0,n.jsx)(a.UICol,{xs:24,sm:8,children:(0,n.jsxs)(a.UICard,{size:"small",children:[(0,n.jsxs)(a.UITypographyText,{type:"success",strong:!0,children:["Fixed Issues (",r.fixedIssues.length,")"]}),(0,n.jsx)("div",{style:{marginTop:t.marginXS},children:(0,n.jsx)(G,{issues:r.fixedIssues,color:"success"})})]})})]})})}function X(){var e=(0,s.useData)("".concat(v).concat(w)),r=e.data;return e.isLoading?(0,n.jsx)(a.UISpin,{size:"small",style:{display:"block",margin:"16px auto"}}):r?"error"in r?"no-baseline"===r.error?(0,n.jsx)(a.UIAlert,{variant:"warning",showIcon:!0,message:"No baseline set",description:"Run QA checks and save a baseline to enable diff tracking."}):"no-check"===r.error?(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No check snapshot",description:"Run 'kb qa check --save' to generate a check snapshot."}):(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No stats snapshot",description:"Run 'kb qa stats --save' to generate a stats snapshot."}):r.newIssueCount>0||r.fixedIssueCount>0?(0,n.jsx)(H,{diff:r}):(0,n.jsx)(a.UIAlert,{variant:"success",showIcon:!0,icon:(0,n.jsx)(a.UIIcon,{name:"CheckCircleOutlined"}),message:"No changes since baseline",description:"Score delta: ".concat(r.scoreDelta>=0?"+":"").concat(r.scoreDelta).concat(r.gradeDelta?" (grade: ".concat(r.gradeDelta,")"):"")}):null}function q(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function K(){var e,r=(0,s.useTheme)().antdToken,t=(0,s.useData)("".concat(v).concat(k)),o=t.data;if(t.isLoading)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});var i=null!=(e=null==o?void 0:o.latestStats)?e:null;if(!i)return null;var l=Object.entries(i.raw.issues_by_type).map(function(e){var r=function(e){if(Array.isArray(e))return e}(e)||function(e){var r,t,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),2!==a.length);o=!0);}catch(e){s=!0,t=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw t}}return a}}(e)||function(e){if(e){if("string"==typeof e)return q(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({key:r[0]},r[1])});if(0===l.length)return null;var c=[{title:"Check",dataIndex:"check",key:"check",render:function(e){return(0,n.jsx)(a.UITypographyText,{code:!0,style:{fontSize:r.fontSizeSM},children:e})}},{title:"Errors",dataIndex:"errors",key:"errors",width:90,sorter:function(e,r){return e.errors-r.errors},defaultSortOrder:"descend",render:function(e){return e>0?(0,n.jsx)(a.UIBadge,{count:e,style:{backgroundColor:r.colorError}}):(0,n.jsx)("span",{style:{color:r.colorTextSecondary},children:"—"})}},{title:"Warnings",dataIndex:"warnings",key:"warnings",width:100,sorter:function(e,r){return e.warnings-r.warnings},render:function(e){return e>0?(0,n.jsx)(a.UIBadge,{count:e,style:{backgroundColor:r.colorWarning}}):(0,n.jsx)("span",{style:{color:r.colorTextSecondary},children:"—"})}},{title:"Packages Affected",dataIndex:"packages",key:"packages",width:150,sorter:function(e,r){return e.packages-r.packages},render:function(e){return(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIBadge,{count:e,style:{backgroundColor:e>5?r.colorError:e>2?r.colorWarning:r.colorSuccess}}),(0,n.jsx)("span",{style:{fontSize:r.fontSizeSM,color:r.colorTextSecondary},children:"packages"})]})}},{title:"Impact",key:"impact",width:90,render:function(e,r){return 0===r.errors+r.warnings?(0,n.jsx)(a.UITag,{children:"Clean"}):r.errors>0?(0,n.jsx)(a.UITag,{color:"error",children:"High"}):(0,n.jsx)(a.UITag,{color:"warning",children:"Medium"})}}],u=l.reduce(function(e,r){return e+r.errors},0),d=l.reduce(function(e,r){return e+r.warnings},0);return(0,n.jsx)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"BugOutlined"}),(0,n.jsx)("span",{children:"Issues by Type"}),u>0&&(0,n.jsxs)(a.UITag,{color:"error",children:[u," errors"]}),d>0&&(0,n.jsxs)(a.UITag,{color:"warning",children:[d," warnings"]})]}),children:(0,n.jsx)(a.UITable,{dataSource:l,columns:c,rowKey:"key",size:"small",pagination:l.length>10&&{pageSize:10}})})}function Q(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function $(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],s=!0,i=!1;try{for(a=a.call(e);!(s=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);s=!0);}catch(e){i=!0,n=e}finally{try{s||null==a.return||a.return()}finally{if(i)throw n}}return o}}(e,r)||V(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e,r){if(e){if("string"==typeof e)return Q(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Q(e,r)}}function J(){var e,r=(0,s.useTheme)().antdToken,t=(0,s.useData)("".concat(v).concat(k)),i=t.data,l=t.isLoading,c=$(o.useState(!1),2),u=c[0],d=c[1];if(l)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});if(!i)return(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No QA data",description:"Run 'kb qa run' to generate QA history.",style:{marginBottom:r.marginLG}});var g=i.latestRun,h=i.latestStats,f=null==h?void 0:h.raw,y=null==g?void 0:g.raw,p=new Map;if(null==y?void 0:y.results){var m=!0,x=!1,j=void 0;try{for(var I,S,b,w,U=y.results[Symbol.iterator]();!(m=(w=U.next()).done);m=!0){var T,C=w.value,O=null!=(T=p.get(C.Task))?T:{passed:0,failed:0,cached:0};C.Cached?O.cached+=1:C.OK?O.passed+=1:O.failed+=1,p.set(C.Task,O)}}catch(e){x=!0,j=e}finally{try{m||null==U.return||U.return()}finally{if(x)throw j}}}var z=null!=(I=null==y?void 0:y.ok)?I:null,A=null!=(S=null==f?void 0:f.grade)?S:null,M=null!=(b=null==f?void 0:f.score)?b:null;return(0,n.jsxs)("div",{children:[(0,n.jsx)(a.UIAlert,{variant:!0===z?"success":!1===z?"error":"info",showIcon:!0,icon:!0===z?(0,n.jsx)(a.UIIcon,{name:"CheckCircleOutlined"}):(0,n.jsx)(a.UIIcon,{name:"CloseCircleOutlined"}),message:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsxs)("span",{style:{fontWeight:600},children:["QA Status: ",!0===z?"Passing":!1===z?"Failing":"No data"]}),A&&(0,n.jsxs)(a.UITag,{color:A.startsWith("A")?"success":"B"===A?"warning":"error",children:["Grade: ",A]}),null!==M&&(0,n.jsxs)(a.UITag,{children:["Score: ",M]})]}),description:g?(0,n.jsxs)(a.UISpace,{split:(0,n.jsx)("span",{style:{color:r.colorBorderSecondary},children:"|"}),children:[(0,n.jsxs)("span",{children:[(0,n.jsx)(a.UIIcon,{name:"ClockCircleOutlined"})," ",new Date(g.timestamp).toLocaleString()]}),g.git&&(0,n.jsxs)("span",{children:[(0,n.jsx)(a.UIIcon,{name:"BranchesOutlined"})," ",g.git.branch," (",g.git.commit.slice(0,7),")"]}),(0,n.jsxs)("span",{children:["tasks: ",g.tasks.join(", ")]})]}):void 0,style:{marginBottom:r.marginLG}}),p.size>0&&(0,n.jsx)(a.UIRow,{gutter:[16,16],style:{marginBottom:r.marginLG},children:((function(e){if(Array.isArray(e))return Q(e)})(e=p.entries())||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||V(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(e){var t=$(e,2),o=t[0],s=t[1],i=s.failed>0;return(0,n.jsx)(a.UICol,{xs:24,sm:12,lg:6,children:(0,n.jsxs)(a.UICard,{hoverable:!0,onClick:function(){return d(!0)},style:{cursor:"pointer",textAlign:"center"},children:[(0,n.jsxs)(a.UITag,{color:i?"error":"success",style:{marginBottom:r.marginSM,fontSize:r.fontSize},children:[i?(0,n.jsx)(a.UIIcon,{name:"CloseCircleOutlined"}):(0,n.jsx)(a.UIIcon,{name:"CheckCircleOutlined"})," ",i?"FAILED":"PASSED"]}),(0,n.jsx)("div",{style:{fontWeight:600,fontSize:r.fontSizeLG,marginBottom:r.marginSM},children:o}),(0,n.jsxs)(a.UIRow,{gutter:8,justify:"center",children:[(0,n.jsx)(a.UICol,{children:(0,n.jsx)(a.UIStatistic,{title:"Passed",value:s.passed,valueStyle:{color:r.colorSuccess,fontSize:r.fontSize}})}),(0,n.jsx)(a.UICol,{children:(0,n.jsx)(a.UIStatistic,{title:"Failed",value:s.failed,valueStyle:{color:s.failed>0?r.colorError:r.colorSuccess,fontSize:r.fontSize}})}),s.cached>0&&(0,n.jsx)(a.UICol,{children:(0,n.jsx)(a.UIStatistic,{title:"Cached",value:s.cached,valueStyle:{color:r.colorTextSecondary,fontSize:r.fontSize}})})]})]})},o)})}),(0,n.jsx)("div",{style:{marginBottom:r.marginLG},children:(0,n.jsx)(X,{})}),(0,n.jsx)("div",{style:{marginBottom:r.marginLG},children:(0,n.jsx)(K,{})}),(0,n.jsx)(_,{open:u,onClose:function(){return d(!1)}})]})}function Z(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function ee(e){return function(e){if(Array.isArray(e))return Z(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||er(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function er(e,r){if(e){if("string"==typeof e)return Z(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Z(e,r)}}function et(){var e=(0,s.useTheme)().antdToken,r=(0,s.useData)("".concat(v).concat("/history")),t=r.data;if(r.isLoading)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});if(!t||!t.snapshots||0===t.snapshots.length)return(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"No QA history",description:"Run 'kb qa run --save' to record QA results to history."});var o=ee(new Set(t.snapshots.flatMap(function(e){var r;return null!=(r=e.tasks)?r:[]}))),i=[{title:"Date",dataIndex:"timestamp",key:"timestamp",width:180,render:function(e){return new Date(e).toLocaleString()},sorter:function(e,r){return new Date(e.timestamp).getTime()-new Date(r.timestamp).getTime()},defaultSortOrder:"descend"},{title:"Status",key:"status",width:100,render:function(e,r){var t=r.raw.ok;return(0,n.jsx)(a.UITag,{color:t?"success":"error",icon:t?(0,n.jsx)(a.UIIcon,{name:"CheckCircleOutlined"}):(0,n.jsx)(a.UIIcon,{name:"CloseCircleOutlined"}),children:t?"PASSED":"FAILED"})},filters:[{text:"Passed",value:!0},{text:"Failed",value:!1}],onFilter:function(e,r){return r.raw.ok===e}},{title:"Git",key:"git",width:220,render:function(r,t){return t.git?(0,n.jsxs)(a.UISpace,{direction:"vertical",size:0,children:[(0,n.jsxs)("span",{children:[(0,n.jsx)(a.UIIcon,{name:"BranchesOutlined"})," ",t.git.branch]}),(0,n.jsxs)("span",{style:{color:e.colorTextSecondary,fontSize:e.fontSizeSM},children:[t.git.commit.slice(0,7)," — ",t.git.message.slice(0,40),t.git.message.length>40?"...":""]})]}):(0,n.jsx)("span",{style:{color:e.colorTextSecondary},children:"—"})}},{title:"Total",key:"total",width:80,align:"center",render:function(e,r){return(0,n.jsxs)("span",{style:{fontVariantNumeric:"tabular-nums"},children:[r.raw.summary.passed,"/",r.raw.summary.total]})}}].concat(ee(o.map(function(e){return{title:e,key:e,width:90,align:"center",render:function(r,t){return function(e,r){var t,o=(null!=(t=e.raw.results)?t:[]).filter(function(e){return e.Task===r});if(0===o.length)return(0,n.jsx)("span",{style:{color:"#999"},children:"—"});var s=o.filter(function(e){return!e.OK&&!e.Cached}).length,i=o.filter(function(e){return e.Cached}).length,l=o.filter(function(e){return e.OK&&!e.Cached}).length;return s>0?(0,n.jsxs)(a.UITag,{color:"error",style:{fontVariantNumeric:"tabular-nums"},children:[l,"/",o.length]}):i>0?(0,n.jsxs)(a.UITag,{color:"default",style:{fontVariantNumeric:"tabular-nums"},children:[i," cached"]}):(0,n.jsxs)(a.UITag,{color:"success",style:{fontVariantNumeric:"tabular-nums"},children:[l,"/",o.length]})}(t,e)}}})));return(0,n.jsx)(a.UITable,{columns:i,dataSource:t.snapshots,rowKey:"id",pagination:{pageSize:15},size:"middle",expandable:{expandedRowRender:function(r){var t=r.raw.results.filter(function(e){return!e.OK&&!e.Cached});if(0===t.length)return null;var o=new Map,s=!0,i=!1,l=void 0;try{for(var c,u=t[Symbol.iterator]();!(s=(c=u.next()).done);s=!0){var d,g=c.value,h=null!=(d=o.get(g.Task))?d:[];h.push(g.Package),o.set(g.Task,h)}}catch(e){i=!0,l=e}finally{try{s||null==u.return||u.return()}finally{if(i)throw l}}return(0,n.jsx)("div",{style:{padding:"".concat(e.paddingXS,"px ").concat(e.paddingMD,"px")},children:ee(o.entries()).map(function(r){var t=function(e){if(Array.isArray(e))return e}(r)||function(e){var r,t,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),2!==a.length);o=!0);}catch(e){s=!0,t=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw t}}return a}}(r)||er(r,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=t[0],s=t[1];return(0,n.jsxs)("div",{style:{marginBottom:e.marginSM},children:[(0,n.jsxs)("strong",{children:[o," failures (",s.length,"):"]}),(0,n.jsx)(a.UIFlex,{wrap:"wrap",gap:1,style:{marginTop:e.marginXXS},children:s.map(function(r){return(0,n.jsx)(a.UITag,{color:"error",style:{fontSize:e.fontSizeSM},children:r},r)})})]},o)})})},rowExpandable:function(e){return e.raw.results.some(function(e){return!e.OK&&!e.Cached})}}})}function en(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function ea(e,r){if(e){if("string"==typeof e)return en(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return en(e,r)}}function eo(){var e,r=(0,s.useTheme)().antdToken,t=function(e){if(Array.isArray(e))return e}(e=o.useState(void 0))||function(e){var r,t,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),2!==a.length);o=!0);}catch(e){s=!0,t=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw t}}return a}}(e)||ea(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=t[0],l=t[1],c=i?"".concat(v).concat(b,"?window=").concat(i):"".concat(v).concat(b),u=(0,s.useData)(c),d=u.data;if(u.isLoading)return(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});if(!d||0===d.tasks.length)return(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"Not enough data for trend analysis",description:"Need at least 2 history entries. Run 'kb qa run --save' multiple times."});var g=function(e){var r=[],t=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var i=o.value,l=!0,c=!1,u=void 0;try{for(var d,g=i.timeSeries[Symbol.iterator]();!(l=(d=g.next()).done);l=!0){var h=d.value;r.push({date:function(e){var r=new Date(e),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0"),a=String(r.getHours()).padStart(2,"0"),o=String(r.getMinutes()).padStart(2,"0");return"".concat(t,"-").concat(n," ").concat(a,":").concat(o)}(h.timestamp),value:h.failed,category:i.task})}}catch(e){c=!0,u=e}finally{try{l||null==g.return||g.return()}finally{if(c)throw u}}}}catch(e){n=!0,a=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw a}}return r}(d.tasks),h=function(e){var r,t=new Map,n=!0,a=!1,o=void 0;try{for(var s,i=e[Symbol.iterator]();!(n=(s=i.next()).done);n=!0){var l=s.value,c=!0,u=!1,d=void 0;try{for(var g,h=l.changelog[Symbol.iterator]();!(c=(g=h.next()).done);c=!0){var f=g.value,y=t.get(f.gitCommit);y||(y={timestamp:f.timestamp,gitCommit:f.gitCommit,gitMessage:f.gitMessage,changes:[]},t.set(f.gitCommit,y)),y.changes.push({task:l.task,entry:f})}}catch(e){u=!0,d=e}finally{try{c||null==h.return||h.return()}finally{if(u)throw d}}}}catch(e){a=!0,o=e}finally{try{n||null==i.return||i.return()}finally{if(a)throw o}}return((function(e){if(Array.isArray(e))return en(e)})(r=t.values())||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||ea(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(function(e,r){return r.timestamp.localeCompare(e.timestamp)})}(d.tasks);return(0,n.jsxs)("div",{children:[(0,n.jsxs)(a.UIFlex,{justify:"between",align:"center",style:{marginBottom:r.marginMD},children:[(0,n.jsxs)("span",{style:{color:r.colorTextSecondary},children:["Analyzing ",d.historyCount," history entries (window: ",d.window,")"]}),(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)("span",{children:"Window size:"}),(0,n.jsx)(a.UISelect,{value:null!=i?i:d.window,onChange:function(e){return l(e)},style:{width:80},options:[{label:"5",value:5},{label:"10",value:10},{label:"20",value:20},{label:"50",value:50}]})]})]}),(0,n.jsx)(a.UIStatisticsChart,{title:"Failure Count Over Time",data:g,loading:!1,xField:"date",yField:"value",colorField:"category",height:300,showLegend:!1,chartProps:{legend:{position:"top"}}}),(0,n.jsx)(a.UIRow,{gutter:[16,16],style:{marginTop:r.marginMD},children:d.tasks.map(function(e){return(0,n.jsx)(a.UICol,{xs:24,sm:12,children:(0,n.jsxs)(a.UICard,{size:"small",children:[(0,n.jsx)(a.UIRow,{align:"middle",gutter:16,children:(0,n.jsx)(a.UICol,{flex:"auto",children:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"ExperimentOutlined"}),(0,n.jsx)("span",{style:{fontWeight:600,fontSize:r.fontSizeLG},children:e.task}),function(e){switch(e){case"regression":return(0,n.jsx)(a.UITag,{color:"error",children:"Regression"});case"improvement":return(0,n.jsx)(a.UITag,{color:"success",children:"Improvement"});default:return(0,n.jsx)(a.UITag,{children:"No Change"})}}(e.direction)]})})}),(0,n.jsxs)(a.UIRow,{gutter:16,style:{marginTop:r.marginSM},children:[(0,n.jsx)(a.UICol,{span:6,children:(0,n.jsx)(a.UIStatistic,{title:"Previous",value:e.previous,valueStyle:{fontSize:r.fontSizeHeading4}})}),(0,n.jsx)(a.UICol,{span:6,children:(0,n.jsx)(a.UIStatistic,{title:"Current",value:e.current,valueStyle:{fontSize:r.fontSizeHeading4}})}),(0,n.jsx)(a.UICol,{span:6,children:(0,n.jsx)(a.UIStatistic,{title:"Delta",value:Math.abs(e.delta),prefix:function(e){switch(e){case"regression":return(0,n.jsx)(a.UIIcon,{name:"ArrowUpOutlined"});case"improvement":return(0,n.jsx)(a.UIIcon,{name:"ArrowDownOutlined"});default:return(0,n.jsx)(a.UIIcon,{name:"MinusOutlined"})}}(e.direction),valueStyle:{color:function(e,r){switch(e){case"regression":return r.colorError;case"improvement":return r.colorSuccess;default:return r.colorTextSecondary}}(e.direction,r),fontSize:r.fontSizeHeading4}})}),(0,n.jsx)(a.UICol,{span:6,children:(0,n.jsx)(a.UIStatistic,{title:"Velocity",value:Math.abs(e.velocity),precision:1,prefix:e.velocity>0?(0,n.jsx)(a.UIIcon,{name:"ArrowUpOutlined"}):e.velocity<0?(0,n.jsx)(a.UIIcon,{name:"ArrowDownOutlined"}):(0,n.jsx)(a.UIIcon,{name:"MinusOutlined"}),suffix:"/run",valueStyle:{color:e.velocity>0?r.colorError:e.velocity<0?r.colorSuccess:r.colorTextSecondary,fontSize:r.fontSizeHeading4}})})]})]})},e.task)})}),(0,n.jsx)(a.UICard,{title:"Changelog — What Changed",style:{marginTop:r.marginMD},children:0===h.length?(0,n.jsx)(a.UIEmptyState,{description:"No changes detected between entries"}):(0,n.jsx)(a.UITimeline,{children:h.map(function(e){var t=e.changes.reduce(function(e,r){return e+r.entry.newFailures.length},0)>e.changes.reduce(function(e,r){return e+r.entry.fixed.length},0)?r.colorError:r.colorSuccess;return(0,n.jsxs)(a.UITimelineItem,{color:t,children:[(0,n.jsxs)("div",{style:{marginBottom:r.marginXXS},children:[(0,n.jsx)(a.UITag,{style:{fontFamily:"monospace"},children:e.gitCommit.slice(0,7)}),(0,n.jsx)("span",{style:{color:r.colorTextSecondary,fontSize:r.fontSizeSM},children:new Date(e.timestamp).toLocaleString()})]}),(0,n.jsx)("div",{style:{fontSize:r.fontSize,color:r.colorTextSecondary,marginBottom:r.marginXS},children:e.gitMessage}),e.changes.map(function(e){var t=e.task,o=e.entry;return(0,n.jsxs)("div",{style:{marginBottom:r.marginXXS},children:[(0,n.jsxs)("span",{style:{fontWeight:500},children:[t,":"]}),o.newFailures.length>0&&(0,n.jsxs)("span",{style:{marginLeft:8},children:[(0,n.jsxs)(a.UITag,{color:"error",style:{fontSize:r.fontSizeSM},children:["+",o.newFailures.length," new"]}),o.newFailures.map(function(e){return(0,n.jsx)(a.UITag,{color:"red",style:{fontSize:r.fontSizeSM},children:e},e)})]}),o.fixed.length>0&&(0,n.jsxs)("span",{style:{marginLeft:8},children:[(0,n.jsxs)(a.UITag,{color:"success",style:{fontSize:r.fontSizeSM},children:["-",o.fixed.length," fixed"]}),o.fixed.map(function(e){return(0,n.jsx)(a.UITag,{color:"green",style:{fontSize:r.fontSizeSM},children:e},e)})]})]},t)})]},e.gitCommit)})})})]})}function es(){var e=(0,s.useTheme)().antdToken,r=(0,s.useData)("".concat(v).concat("/regressions")),t=r.data;return r.isLoading?(0,n.jsx)(a.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}}):t?t.hasRegressions?(0,n.jsxs)("div",{children:[(0,n.jsx)(a.UIAlert,{variant:"error",showIcon:!0,icon:(0,n.jsx)(a.UIIcon,{name:"WarningOutlined"}),message:"".concat(t.regressions.length," regression").concat(t.regressions.length>1?"s":""," detected"),description:(0,n.jsxs)(a.UISpace,{direction:"vertical",size:0,children:[(0,n.jsx)("span",{children:"The following tasks have new failures compared to the previous run."}),(0,n.jsxs)("span",{style:{fontSize:e.fontSizeSM,color:e.colorTextSecondary},children:["Compared: ",new Date(t.comparedAt.previous).toLocaleString()," →"," ",new Date(t.comparedAt.current).toLocaleString()]})]}),style:{marginBottom:e.marginLG}}),t.regressions.map(function(r,t){return(0,n.jsx)(a.UICard,{title:(0,n.jsxs)(a.UISpace,{children:[(0,n.jsx)(a.UIIcon,{name:"ExperimentOutlined"}),(0,n.jsx)("span",{children:r.task}),(0,n.jsxs)(a.UITag,{color:"error",children:["+",r.delta," new failure",r.delta>1?"s":""]})]}),style:{marginBottom:e.marginMD},children:(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"New failures:"}),(0,n.jsx)(a.UIFlex,{wrap:"wrap",gap:1,style:{marginTop:e.marginXS},children:r.newFailures.map(function(e){return(0,n.jsx)(a.UITag,{color:"error",children:e},e)})})]})},t)}),(0,n.jsx)(a.UIAlert,{variant:"warning",showIcon:!0,message:"Action required",description:(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{children:"Fix the regressions above before merging. Recommendations:"}),(0,n.jsxs)("ol",{style:{margin:0,paddingLeft:20},children:[(0,n.jsxs)("li",{children:["Run ",(0,n.jsx)("code",{children:"kb qa run"})," to see detailed error output"]}),(0,n.jsx)("li",{children:"Fix the failing packages"}),(0,n.jsxs)("li",{children:["Re-run ",(0,n.jsx)("code",{children:"kb qa run --save"})," to verify fixes"]})]})]}),style:{marginTop:e.marginMD}})]}):(0,n.jsxs)("div",{children:[(0,n.jsx)(a.UIAlert,{variant:"success",showIcon:!0,icon:(0,n.jsx)(a.UIIcon,{name:"CheckCircleOutlined"}),message:"No regressions detected",description:(0,n.jsxs)(a.UISpace,{direction:"vertical",size:0,children:[(0,n.jsx)("span",{children:"All tasks show the same or fewer failures compared to the previous run."}),(0,n.jsxs)("span",{style:{color:e.colorTextSecondary,fontSize:e.fontSizeSM},children:["Compared: ",new Date(t.comparedAt.previous).toLocaleString()," →"," ",new Date(t.comparedAt.current).toLocaleString()]})]}),style:{marginBottom:e.marginLG}}),(0,n.jsx)(a.UIEmptyState,{description:"No regressions to display"})]}):(0,n.jsx)(a.UIAlert,{variant:"info",showIcon:!0,message:"Not enough data for regression detection",description:"Need at least 2 history entries. Run 'kb qa run --save' multiple times."})}function ei(){var e=(0,n.jsx)(a.UITabs,{syncUrl:"search",items:[{key:"run",label:"Run",children:(0,n.jsx)(E,{})},{key:"health",label:"Health",children:(0,n.jsx)(R,{})},{key:"overview",label:"Overview",children:(0,n.jsx)(J,{})},{key:"history",label:"History",children:(0,n.jsx)(et,{})},{key:"trends",label:"Trends",children:(0,n.jsx)(eo,{})},{key:"regressions",label:"Regressions",children:(0,n.jsx)(es,{})}]});return(0,n.jsx)(a.UIPage,{children:(0,n.jsx)(a.UIPageHeader,{title:"QA",description:"Build, lint, type check, and test results with baseline tracking and regression detection",tabs:e})})}}}]);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "qaPlugin",
|
|
6
6
|
"globalName": "qaPlugin",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "2.
|
|
8
|
+
"buildVersion": "2.110.0",
|
|
9
9
|
"buildName": "@kb-labs/qa-entry"
|
|
10
10
|
},
|
|
11
11
|
"publicPath": "auto",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
{
|
|
28
28
|
"id": "qaPlugin:@kb-labs/studio-event-bus",
|
|
29
29
|
"name": "@kb-labs/studio-event-bus",
|
|
30
|
-
"version": "2.
|
|
30
|
+
"version": "2.110.0",
|
|
31
31
|
"singleton": true,
|
|
32
32
|
"requiredVersion": "^2.0.0",
|
|
33
33
|
"assets": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
{
|
|
48
48
|
"id": "qaPlugin:@kb-labs/studio-ui-core",
|
|
49
49
|
"name": "@kb-labs/studio-ui-core",
|
|
50
|
-
"version": "2.
|
|
50
|
+
"version": "2.110.0",
|
|
51
51
|
"singleton": true,
|
|
52
52
|
"requiredVersion": "^2.0.0",
|
|
53
53
|
"assets": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
{
|
|
87
87
|
"id": "qaPlugin:@kb-labs/studio-hooks",
|
|
88
88
|
"name": "@kb-labs/studio-hooks",
|
|
89
|
-
"version": "2.
|
|
89
|
+
"version": "2.110.0",
|
|
90
90
|
"singleton": true,
|
|
91
91
|
"requiredVersion": "^2.0.0",
|
|
92
92
|
"assets": {
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
{
|
|
107
107
|
"id": "qaPlugin:@kb-labs/studio-ui-kit",
|
|
108
108
|
"name": "@kb-labs/studio-ui-kit",
|
|
109
|
-
"version": "2.
|
|
109
|
+
"version": "2.110.0",
|
|
110
110
|
"singleton": true,
|
|
111
111
|
"requiredVersion": "^2.0.0",
|
|
112
112
|
"assets": {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "qaPlugin",
|
|
6
6
|
"globalName": "qaPlugin",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "2.
|
|
8
|
+
"buildVersion": "2.110.0",
|
|
9
9
|
"buildName": "@kb-labs/qa-entry"
|
|
10
10
|
},
|
|
11
11
|
"publicPath": "auto",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
{
|
|
28
28
|
"id": "qaPlugin:@kb-labs/studio-event-bus",
|
|
29
29
|
"name": "@kb-labs/studio-event-bus",
|
|
30
|
-
"version": "2.
|
|
30
|
+
"version": "2.110.0",
|
|
31
31
|
"requiredVersion": "^2.0.0",
|
|
32
32
|
"singleton": true,
|
|
33
33
|
"assets": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
{
|
|
50
50
|
"id": "qaPlugin:@kb-labs/studio-ui-core",
|
|
51
51
|
"name": "@kb-labs/studio-ui-core",
|
|
52
|
-
"version": "2.
|
|
52
|
+
"version": "2.110.0",
|
|
53
53
|
"requiredVersion": "^2.0.0",
|
|
54
54
|
"singleton": true,
|
|
55
55
|
"assets": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
{
|
|
93
93
|
"id": "qaPlugin:@kb-labs/studio-hooks",
|
|
94
94
|
"name": "@kb-labs/studio-hooks",
|
|
95
|
-
"version": "2.
|
|
95
|
+
"version": "2.110.0",
|
|
96
96
|
"requiredVersion": "^2.0.0",
|
|
97
97
|
"singleton": true,
|
|
98
98
|
"assets": {
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
{
|
|
115
115
|
"id": "qaPlugin:@kb-labs/studio-ui-kit",
|
|
116
116
|
"name": "@kb-labs/studio-ui-kit",
|
|
117
|
-
"version": "2.
|
|
117
|
+
"version": "2.110.0",
|
|
118
118
|
"requiredVersion": "^2.0.0",
|
|
119
119
|
"singleton": true,
|
|
120
120
|
"assets": {
|