@zaip-ai/cli 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/package.json +1 -1
  2. package/templates/.agents/dashboard/.zaip-managed.json +44 -44
  3. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-BZWjXQB-.js → CostCalculationGuidePage-D1mpyYwh.js} +1 -1
  4. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-D8qqeIPE.js → DashboardHelpDialog-CKO47D5s.js} +1 -1
  5. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-Cm12_A0v.js → PricingSettingsDialog-BuSlCbyZ.js} +1 -1
  6. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-DxO9F8B4.js → ProjectSettingsPage-CUHFkAhZ.js} +1 -1
  7. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-_x0twOcS.js → TraceabilityWorkspace-BmASq2gW.js} +1 -1
  8. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-Csj6LiAt.js +68 -0
  9. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-CR4Fbf3g.js → icons-vendor-VyTTl_ph.js} +1 -1
  10. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DIwDvCu5.js +2 -0
  11. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-hPPfVGQv.css +1 -0
  12. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-DRJQbKnp.js → react-vendor-CTC6vtln.js} +1 -1
  13. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-CMrDYqjR.js → traceability-9Mtvbwrg.js} +1 -1
  14. package/templates/.agents/dashboard/apps/frontend/dist/index.html +6 -6
  15. package/templates/.agents/dashboard/apps/frontend/src/App.tsx +32 -13
  16. package/templates/.agents/dashboard/apps/frontend/src/cost-period-refresh.test.ts +13 -3
  17. package/templates/.agents/dashboard/apps/frontend/src/dashboard-capability-nav.css +11 -0
  18. package/templates/.agents/dashboard/apps/frontend/src/operations-period-contract.test.ts +14 -0
  19. package/templates/.agents/dashboard/apps/frontend/src/operations-period.test.ts +3 -6
  20. package/templates/.agents/dashboard/apps/frontend/src/operations-period.ts +3 -2
  21. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.helpers.tsx +2 -1
  22. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +12 -4
  23. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +67 -24
  24. package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +19 -4
  25. package/templates/.agents/dashboard/modules/operations/src/react/operation-date-range.test.ts +25 -0
  26. package/templates/.agents/dashboard/modules/operations/src/react/operation-date-range.ts +29 -0
  27. package/templates/.agents/dashboard/modules/operations/src/react/operations-coverage-toast.test.ts +3 -2
  28. package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +12 -2
  29. package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-loading.spec.ts +1 -1
  30. package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-pagination.spec.ts +4 -0
  31. package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-period-transition.spec.ts +6 -0
  32. package/templates/.agents/dashboard/tests/e2e/specs/dashboard-performance-matrix.spec.ts +4 -0
  33. package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +40 -18
  34. package/templates/.agents/requirements/autonomous-assurance.md +1 -1
  35. package/templates/.agents/requirements/comparative-audit.md +1 -1
  36. package/templates/.agents/requirements/context-engine.md +1 -1
  37. package/templates/.agents/requirements/cost-observability.md +1 -1
  38. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  39. package/templates/.agents/requirements/data-export.md +1 -1
  40. package/templates/.agents/requirements/design-system.md +1 -1
  41. package/templates/.agents/requirements/execution-engine.md +1 -1
  42. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  43. package/templates/.agents/requirements/model-orchestration.md +1 -1
  44. package/templates/.agents/requirements/public-distribution.md +1 -1
  45. package/templates/.agents/requirements/software-architecture.md +1 -1
  46. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  47. package/templates/.agents/requirements/work-lifecycle.md +1 -1
  48. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  49. package/templates/template-manifest.json +61 -61
  50. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-Cpp8xFij.js +0 -68
  51. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-B31GMG5O.css +0 -1
  52. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-ncC1rxap.js +0 -2
@@ -1 +1 @@
1
- import{m as e}from"./cost-monitor-Cpp8xFij.js";var t=e(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),n=e(`CalendarDays`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),r=e(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),i=e(`CircleGauge`,[[`path`,{d:`M15.6 2.7a10 10 0 1 0 5.7 5.7`,key:`1e0p6d`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M13.4 10.6 19 5`,key:`1kr7tw`}]]),a=e(`ClipboardList`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),o=e(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),s=e(`FileCheck2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m3 15 2 2 4-4`,key:`1lhrkk`}]]),c=e(`FileStack`,[[`path`,{d:`M21 7h-3a2 2 0 0 1-2-2V2`,key:`9rb54x`}],[`path`,{d:`M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z`,key:`1059l0`}],[`path`,{d:`M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15`,key:`16874u`}],[`path`,{d:`M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11`,key:`k2ox98`}]]),l=e(`Gavel`,[[`path`,{d:`m14.5 12.5-8 8a2.119 2.119 0 1 1-3-3l8-8`,key:`15492f`}],[`path`,{d:`m16 16 6-6`,key:`vzrcl6`}],[`path`,{d:`m8 8 6-6`,key:`18bi4p`}],[`path`,{d:`m9 7 8 8`,key:`5jnvq1`}],[`path`,{d:`m21 11-8-8`,key:`z4y7zo`}]]),u=e(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),d=e(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),f=e(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),p=e(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),m=e(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]);export{u as a,s as c,i as d,r as f,d as i,o as l,t as m,p as n,l as o,n as p,f as r,c as s,m as t,a as u};
1
+ import{m as e}from"./cost-monitor-Csj6LiAt.js";var t=e(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),n=e(`CalendarDays`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),r=e(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),i=e(`CircleGauge`,[[`path`,{d:`M15.6 2.7a10 10 0 1 0 5.7 5.7`,key:`1e0p6d`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M13.4 10.6 19 5`,key:`1kr7tw`}]]),a=e(`ClipboardList`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),o=e(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),s=e(`FileCheck2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m3 15 2 2 4-4`,key:`1lhrkk`}]]),c=e(`FileStack`,[[`path`,{d:`M21 7h-3a2 2 0 0 1-2-2V2`,key:`9rb54x`}],[`path`,{d:`M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z`,key:`1059l0`}],[`path`,{d:`M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15`,key:`16874u`}],[`path`,{d:`M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11`,key:`k2ox98`}]]),l=e(`Gavel`,[[`path`,{d:`m14.5 12.5-8 8a2.119 2.119 0 1 1-3-3l8-8`,key:`15492f`}],[`path`,{d:`m16 16 6-6`,key:`vzrcl6`}],[`path`,{d:`m8 8 6-6`,key:`18bi4p`}],[`path`,{d:`m9 7 8 8`,key:`5jnvq1`}],[`path`,{d:`m21 11-8-8`,key:`z4y7zo`}]]),u=e(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),d=e(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),f=e(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),p=e(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),m=e(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]);export{u as a,s as c,i as d,r as f,d as i,o as l,t as m,p as n,l as o,n as p,f as r,c as s,m as t,a as u};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardHelpDialog-CKO47D5s.js","assets/cost-monitor-Csj6LiAt.js","assets/rolldown-runtime-D9-fqq9M.js","assets/cost-monitor-PoJA2PI1.css","assets/dashboard-localization-CLJ0lT9v.js","assets/DashboardHelpDialog-Je5nK-Et.css","assets/PricingSettingsDialog-BuSlCbyZ.js","assets/ProjectSettingsPage-CUHFkAhZ.js","assets/ProjectSettingsPage-BomxqCBU.css","assets/CostCalculationGuidePage-D1mpyYwh.js","assets/TraceabilityWorkspace-BmASq2gW.js","assets/traceability-9Mtvbwrg.js","assets/icons-vendor-VyTTl_ph.js","assets/traceability-DFY7ZDlu.css","assets/TraceabilityWorkspace-DvvavDLY.css"])))=>i.map(i=>d[i]);
2
+ import{S as e,a as t,b as n,g as r,h as i,i as a,n as o,r as s,t as c}from"./cost-monitor-Csj6LiAt.js";import{t as l}from"./react-vendor-CTC6vtln.js";import{n as u,t as d}from"./traceability-9Mtvbwrg.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=e(),p=l(),m=n();function h({locale:e}){let t=e===`pt-BR`?[`Definição`,`Planejamento`,`Pronto para Executar`,`Execução`,`Verificação`]:[`Definition`,`Planning`,`Ready to Execute`,`Execution`,`Verification`];return(0,m.jsxs)(`main`,{"aria-busy":`true`,"aria-live":`polite`,"aria-label":e===`pt-BR`?`Preparando dashboard`:`Preparing dashboard`,className:`app-skeleton`,role:`status`,children:[(0,m.jsxs)(`header`,{className:`app-skeleton-header`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-short`}),(0,m.jsx)(`h1`,{children:`Dashboard Zaip AIOS`})]}),(0,m.jsxs)(`div`,{className:`app-skeleton-actions`,children:[(0,m.jsx)(`span`,{}),(0,m.jsx)(`span`,{}),(0,m.jsx)(`span`,{})]})]}),(0,m.jsx)(`section`,{className:`app-skeleton-kpis`,"aria-hidden":`true`,children:Array.from({length:4},(e,t)=>`skeleton-kpi-${t}`).map(e=>(0,m.jsxs)(`article`,{children:[(0,m.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-short`}),(0,m.jsx)(`span`,{className:`app-skeleton-value`}),(0,m.jsx)(`span`,{className:`app-skeleton-line`})]},e))}),(0,m.jsxs)(`section`,{className:`app-skeleton-panels`,"aria-hidden":`true`,children:[(0,m.jsxs)(`article`,{children:[(0,m.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-medium`}),(0,m.jsx)(`div`,{className:`app-skeleton-chart`})]}),(0,m.jsxs)(`article`,{children:[(0,m.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-medium`}),(0,m.jsx)(`div`,{className:`app-skeleton-chart app-skeleton-chart-small`})]})]}),(0,m.jsx)(`section`,{className:`app-skeleton-board`,"aria-hidden":`true`,children:t.map((e,t)=>(0,m.jsxs)(`article`,{children:[(0,m.jsx)(`h2`,{children:e}),Array.from({length:t%2==0?2:1},(t,n)=>`${e}-${n}`).map(e=>(0,m.jsxs)(`div`,{className:`app-skeleton-card`,children:[(0,m.jsx)(`span`,{className:`app-skeleton-line`}),(0,m.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-medium`}),(0,m.jsx)(`span`,{className:`app-skeleton-pill`})]},e))]},e))})]})}function g(e,t){let n=t===`pt-BR`;return e===`costs`?n?{title:`Carregando Monitor de Custos…`,detail:`Isso costuma levar poucos segundos.`}:{title:`Loading Cost Monitor…`,detail:`This usually takes a few seconds.`}:e===`traceability`?n?{title:`Carregando Rastreabilidade…`,detail:`Estamos preparando as 6 etapas da task.`}:{title:`Loading Traceability…`,detail:`Preparing the task's 6 stages.`}:n?{title:`Atualizando dados do dashboard…`,detail:`Você pode continuar navegando.`}:{title:`Refreshing dashboard data…`,detail:`You can keep navigating.`}}function _({area:e,locale:t}){let n=g(e,t);return(0,m.jsxs)(`section`,{"aria-busy":`true`,"aria-live":`polite`,className:`app-loading-panel`,role:`status`,children:[(0,m.jsx)(`i`,{}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`strong`,{children:n.title}),(0,m.jsx)(`span`,{children:n.detail})]})]})}function v({area:e,locale:t}){let n=g(e,t);return(0,m.jsxs)(`section`,{"aria-live":`polite`,className:`app-refresh-status`,role:`status`,children:[(0,m.jsx)(`i`,{}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`strong`,{children:n.title}),(0,m.jsx)(`span`,{children:n.detail})]})]})}function y({locale:e,onRetry:t}){return(0,m.jsxs)(`section`,{"aria-live":`polite`,className:`app-loading-panel app-loading-panel-error`,role:`status`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`strong`,{children:e===`pt-BR`?`Não foi possível carregar os custos`:`Couldn't load costs`}),(0,m.jsx)(`span`,{children:e===`pt-BR`?`A tela continua disponível. Tente novamente quando quiser.`:`The dashboard remains available. Try again whenever you want.`})]}),(0,m.jsx)(`button`,{onClick:t,type:`button`,children:e===`pt-BR`?`Tentar novamente`:`Try again`})]})}function ee({costsLoaded:e,currency:t,snapshotCurrency:n}){return!e||n!==t}function te({aborted:e,currentCurrency:t,currentPeriod:n,currentRequestVersion:r,requestVersion:i,requestedCurrency:a,requestedPeriod:o}){return!e&&i===r&&a===t&&o.from===n.from&&o.to===n.to}function b(e,t){return e===t}function x(e,t,n,r){return b(e,t)&&n.from===r.from&&n.to===r.to}function S(e){return e instanceof DOMException&&e.name===`AbortError`}function ne(e,t){return e===t}function C(e,t,n){return b(e,t)&&!n.aborted}function re(e,t){let n=e=>[...new Map(e.map(e=>[e.id,e])).values()];return{...e,prds:n([...e.prds,...t.flatMap(e=>e.prds)]),specs:n([...e.specs,...t.flatMap(e=>e.specs)]),tasks:n([...e.tasks,...t.flatMap(e=>e.tasks)]),changes:n([...e.changes,...t.flatMap(e=>e.changes)])}}function ie(){let e=(0,f.useRef)(null);return(0,f.useEffect)(()=>{e.current?.focus()},[]),(0,m.jsx)(`div`,{"aria-busy":`true`,"aria-live":`polite`,className:`period-transition-overlay`,onKeyDownCapture:e=>e.preventDefault(),ref:e,role:`status`,tabIndex:-1,children:(0,m.jsxs)(`div`,{className:`period-transition-overlay__content`,children:[(0,m.jsx)(`i`,{"aria-hidden":`true`,className:`period-transition-overlay__spinner`}),(0,m.jsx)(`span`,{className:`period-transition-overlay__label`,children:`Carregando...`})]})})}function ae({pending:e,children:t}){return(0,m.jsx)(`div`,{"aria-hidden":e||void 0,inert:e,children:t})}function oe({children:e,error:t,globalLoadingPending:n,locale:r,onRefresh:i,operations:a,snapshotNotice:o,setupRoute:s}){return s===null?t&&a===null?(0,m.jsxs)(`main`,{className:`app-state`,children:[(0,m.jsx)(`p`,{children:`Dashboard local indisponível`}),(0,m.jsx)(`h1`,{children:`Não foi possível ler o workspace V2.`}),(0,m.jsx)(`pre`,{children:t}),(0,m.jsx)(`button`,{onClick:i,type:`button`,children:`Tentar novamente`})]}):a===null?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(h,{locale:r}),o,n?(0,m.jsx)(ie,{}):null]}):e:s}var se=`modulepreload`,w=function(e){return`/`+e},ce={},T=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=w(t,n),t=s(t),t in ce)return;ce[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:se,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},le=(0,f.lazy)(async()=>({default:(await T(async()=>{let{DashboardHelpDialog:e}=await import(`./DashboardHelpDialog-CKO47D5s.js`);return{DashboardHelpDialog:e}},__vite__mapDeps([0,1,2,3,4,5]))).DashboardHelpDialog}));function ue({costLocale:e,documentDetail:n,helpOpen:i,loadingArea:a,operations:s,reconciliationResult:c,refreshDialog:l,showTrace:p,trace:h,traceLink:g,traceLoadingTaskId:_,closeDocument:y,onCloseHelp:ee,onCloseTrace:te,onDismissReconciliation:b,onOpenDocument:x,onOpenTrace:S,onOpenTraceChange:ne,onOpenTraceMacro:C,onRefreshCancel:re,onRefreshFromDialog:ie,setTraceLink:ae}){return(0,m.jsxs)(m.Fragment,{children:[p?null:_?(0,m.jsx)(d,{locale:e,taskId:_}):h?(0,m.jsx)(u,{locale:e,onClose:te,onOpenChange:ne,onOpenPrd:e=>C(`PRD`,e),onOpenSpec:e=>C(`SPEC`,e),trace:h}):null,g?.kind===`change`?(0,m.jsx)(r,{details:{kind:`change`,row:g.row},locale:e,onClose:()=>ae(null)}):null,g?.kind===`macro`?(0,m.jsx)(t,{label:g.label,locale:e,onClose:()=>ae(null),onOpenDocument:x,onOpenTrace:e=>{ae(null),S(e)},row:g.row,runs:s.runs,specs:s.specs,tasks:s.tasks}):null,n?(0,m.jsx)(o,{detail:n.detail,error:n.error,label:n.label,locale:e,loading:!n.detail&&!n.error,onClose:y,onRetry:()=>x(n.kind,n.preview.id),preview:n.preview}):null,i?(0,m.jsx)(f.Suspense,{fallback:null,children:(0,m.jsx)(le,{locale:e,onClose:ee})}):null,l===`choose`?(0,m.jsx)(`div`,{className:`app-refresh-dialog-backdrop`,children:(0,m.jsxs)(`section`,{"aria-label":`Atualizar dashboard`,"aria-modal":`true`,className:`app-refresh-dialog`,role:`dialog`,children:[(0,m.jsx)(`h2`,{children:e===`pt-BR`?`Atualizar dashboard`:`Refresh dashboard`}),(0,m.jsx)(`p`,{children:e===`pt-BR`?`Escolha uma atualização rápida ou reconcilie os itens que ainda estão em aberto.`:`Choose a quick refresh or reconcile work items that are still open.`}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`button`,{onClick:()=>ie(!1),type:`button`,children:e===`pt-BR`?`Apenas atualizar dados`:`Refresh data only`}),(0,m.jsx)(`button`,{onClick:()=>ie(!0),type:`button`,children:e===`pt-BR`?`Reconciliar itens abertos`:`Reconcile open work`})]}),(0,m.jsx)(`button`,{className:`app-refresh-cancel`,onClick:re,type:`button`,children:e===`pt-BR`?`Cancelar`:`Cancel`})]})}):null,l===`refreshing`||l===`reconciling`?(0,m.jsxs)(`section`,{"aria-live":`polite`,className:`app-refresh-status`,role:`status`,children:[(0,m.jsx)(`i`,{}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`strong`,{children:l===`reconciling`?e===`pt-BR`?`Reconciliando itens em aberto…`:`Reconciling open work…`:e===`pt-BR`?`Atualizando dados…`:`Refreshing data…`}),(0,m.jsx)(`span`,{children:e===`pt-BR`?`Você pode continuar usando o dashboard.`:`You can keep using the dashboard.`})]})]}):null,c!==null&&l===null?(0,m.jsxs)(`section`,{"aria-live":`polite`,className:`app-reconciliation-result`,role:`status`,children:[(0,m.jsx)(`strong`,{children:e===`pt-BR`?`Resultado da reconciliação manual`:`Manual reconciliation result`}),(0,m.jsx)(`span`,{children:e===`pt-BR`?`${c.reconciled_ids.length} item(ns) reconciliado(s).`:`${c.reconciled_ids.length} item(s) reconciled.`}),c.reconciled_ids.length>0?(0,m.jsx)(`p`,{children:c.reconciled_ids.join(`, `)}):null,c.blocked.length>0?(0,m.jsxs)(`p`,{children:[e===`pt-BR`?`Bloqueados: `:`Blocked: `,c.blocked.map(e=>`${e.id}${e.reason===null?``:` (${e.reason})`}`).join(`; `)]}):null,c.not_reconciled.length>0?(0,m.jsxs)(`p`,{children:[e===`pt-BR`?`Não reconciliados: `:`Not reconciled: `,c.not_reconciled.map(e=>`${e.id}${e.reason===null?``:` (${e.reason})`}`).join(`; `)]}):null,(0,m.jsx)(`button`,{onClick:b,type:`button`,children:e===`pt-BR`?`Fechar`:`Dismiss`})]}):null,a!==null&&a!==`operations`&&l===null?(0,m.jsx)(v,{area:a,locale:e}):null]})}var de=(0,f.lazy)(async()=>({default:(await T(async()=>{let{PricingSettingsPage:e}=await import(`./PricingSettingsDialog-BuSlCbyZ.js`);return{PricingSettingsPage:e}},__vite__mapDeps([6,1,2,3,4]))).PricingSettingsPage})),fe=(0,f.lazy)(async()=>({default:(await T(async()=>{let{ProjectSettingsPage:e}=await import(`./ProjectSettingsPage-CUHFkAhZ.js`);return{ProjectSettingsPage:e}},__vite__mapDeps([7,1,2,3,8]))).ProjectSettingsPage})),pe=(0,f.lazy)(async()=>({default:(await T(async()=>{let{CostCalculationGuidePage:e}=await import(`./CostCalculationGuidePage-D1mpyYwh.js`);return{CostCalculationGuidePage:e}},__vite__mapDeps([9,1,2,3]))).CostCalculationGuidePage})),me=`/setup-pricing`,he=`/setup-project`,ge=`/cost-calculation-guide`;function _e(e){let{api:t,costLocale:n,fxRate:r,navigate:i,pathname:a,pricing:o,refresh:s,setFxRate:c,setPricing:l}=e;return a===`/setup-pricing`?o===null?(0,m.jsxs)(`main`,{className:`app-state`,children:[(0,m.jsx)(`p`,{children:n===`pt-BR`?`Configuração do projeto`:`Project settings`}),(0,m.jsx)(`h1`,{children:n===`pt-BR`?`Carregando catálogo de preços…`:`Loading pricing catalog…`}),(0,m.jsx)(`button`,{onClick:()=>i(`/`),type:`button`,children:n===`pt-BR`?`Voltar ao dashboard`:`Back to dashboard`})]}):(0,m.jsx)(f.Suspense,{fallback:null,children:(0,m.jsx)(de,{catalog:o,fxRate:r,locale:n,onClose:()=>i(`/`),onSave:async e=>{l(await t.savePricing(e)),await s()},onSaveFxRate:async e=>{c(await t.saveFxRate(e)),await s()}})}):a===`/cost-calculation-guide`&&o!==null?(0,m.jsx)(f.Suspense,{fallback:null,children:(0,m.jsx)(pe,{catalog:o,fxRate:r,locale:n,onClose:()=>i(`/`)})}):a===`/setup-project`?(0,m.jsx)(f.Suspense,{fallback:null,children:(0,m.jsx)(fe,{api:t,locale:n,onClose:()=>i(`/`)})}):null}var ve=`/zaip-cost-monitor`,E=`zaip-dashboard-session-token`,ye=`zaip-dashboard-locale`,D=`zaip-dashboard-currency`;function be(){return window.localStorage.getItem(`zaip-dashboard-locale`)===`en-US`?`en-US`:`pt-BR`}function xe(e){return e.replace(/\/+$/,``)===ve?`cost-monitor`:null}function Se(){let e=new URL(window.location.href),t=e.searchParams.get(`token`)??window.localStorage.getItem(`zaip-dashboard-session-token`)??window.sessionStorage.getItem(`zaip-dashboard-session-token`)??``;return t&&(window.localStorage.setItem(E,t),window.sessionStorage.setItem(E,t)),e.searchParams.has(`token`)&&(e.searchParams.delete(`token`),window.history.replaceState(null,``,`${e.pathname}${e.search}${e.hash}`)),t}var Ce=(0,f.lazy)(async()=>({default:(await T(async()=>{let{TraceabilityWorkspace:e}=await import(`./TraceabilityWorkspace-BmASq2gW.js`);return{TraceabilityWorkspace:e}},__vite__mapDeps([10,1,2,3,11,12,13,14]))).TraceabilityWorkspace}));function we({costs:e,costLocale:t,currency:n,dashboardView:r,failedArea:i,lastUpdatedAt:a,loadCostDetail:o,loadCostReadModelPage:s,loadCostRunPage:l,loadCostGroupPage:u,loadingArea:d,onActiveDataChange:p,onCurrencyChange:h,onLoadingChange:g,onLocaleChange:v,onOpenTrace:ee,onLoadMoreTraceTasks:te,onRefresh:b,onRetry:x,onSelectTraceTask:S,onOpenTraceChange:ne,onOpenTraceMacro:C,operations:re,selectedTraceTaskId:ie,trace:ae,traceLoadingTaskId:oe,traceTasksHasMore:se,traceTasksLoading:w,traceTasks:ce}){return r===`cost-monitor`?e===null?()=>i===`costs`?(0,m.jsx)(y,{locale:t,onRetry:x}):(0,m.jsx)(_,{area:`costs`,locale:t}):r=>(0,m.jsx)(f.Suspense,{fallback:(0,m.jsx)(_,{area:`costs`,locale:t}),children:(0,m.jsx)(c,{currency:n,data:e,embedded:!0,globalFilters:r,lastUpdatedAt:a,locale:t,loading:d===`costs`,loadDetail:o,loadReadModelPage:s,loadRunPage:l,loadGroupPage:u,onActiveDataChange:p,onCurrencyChange:h,onLoadingChange:g,onLocaleChange:v,onOpenTrace:ee,onRefresh:b,operations:re})}):r===`traceability`?()=>(0,m.jsx)(f.Suspense,{fallback:(0,m.jsx)(_,{area:`operations`,locale:t}),children:(0,m.jsx)(Ce,{loadingTaskId:oe,locale:t,onOpenChange:ne,onOpenPrd:e=>C(`PRD`,e),onOpenSpec:e=>C(`SPEC`,e),onLoadMoreTasks:te,onSelectTask:S,selectedTaskId:ie,tasks:ce.length>0?ce:re.tasks,hasMoreTasks:se,isLoadingTasks:w,trace:ae})}):r===null?(0,m.jsx)(`span`,{"aria-hidden":`true`,hidden:!0}):void 0}var O={"pt-BR":{label:`Áreas do dashboard`,operations:`Operação`,operationsHint:`Trabalho em andamento e priorização`,costs:`Monitor de Custos`,costsHint:`Tempo, tokens e custo`,traceability:`Rastreabilidade`,traceabilityHint:`Ciclo completo em 6 etapas`},"en-US":{label:`Dashboard areas`,operations:`Operations`,operationsHint:`Lifecycle and work in progress`,costs:`Cost Monitor`,costsHint:`Time, tokens, and cost`,traceability:`Traceability`,traceabilityHint:`Complete 6-stage lifecycle`}};function Te({activeView:e,locale:t,onChange:n}){let r=O[t],i=e=>{n(e),window.requestAnimationFrame(()=>{document.querySelector(`.dashboard-global-controls`)?.scrollIntoView({behavior:`smooth`,block:`start`})})};return(0,m.jsxs)(`nav`,{"aria-label":r.label,className:`dashboard-capability-nav`,children:[(0,m.jsxs)(`button`,{"aria-current":e===`cost-monitor`?`page`:void 0,className:e===`cost-monitor`?`is-active`:void 0,onClick:()=>i(`cost-monitor`),type:`button`,children:[(0,m.jsx)(Ee,{}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`strong`,{children:r.costs}),(0,m.jsx)(`small`,{children:r.costsHint})]})]}),(0,m.jsxs)(`button`,{"aria-current":e===`operations`?`page`:void 0,className:e===`operations`?`is-active`:void 0,onClick:()=>i(`operations`),type:`button`,children:[(0,m.jsx)(k,{}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`strong`,{children:r.operations}),(0,m.jsx)(`small`,{children:r.operationsHint})]})]}),(0,m.jsxs)(`button`,{"aria-current":e===`traceability`?`page`:void 0,className:e===`traceability`?`is-active`:void 0,onClick:()=>i(`traceability`),type:`button`,children:[(0,m.jsx)(A,{}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`strong`,{children:r.traceability}),(0,m.jsx)(`small`,{children:r.traceabilityHint})]})]})]})}function k(){return(0,m.jsxs)(`svg`,{"aria-hidden":`true`,className:`lucide lucide-square-kanban`,viewBox:`0 0 24 24`,children:[(0,m.jsx)(`rect`,{height:`18`,rx:`2`,width:`18`,x:`3`,y:`3`}),(0,m.jsx)(`path`,{d:`M8 7v7`}),(0,m.jsx)(`path`,{d:`M12 7v4`}),(0,m.jsx)(`path`,{d:`M16 7v9`})]})}function Ee(){return(0,m.jsxs)(`svg`,{"aria-hidden":`true`,className:`lucide lucide-circle-dollar-sign`,viewBox:`0 0 24 24`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,m.jsx)(`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`}),(0,m.jsx)(`path`,{d:`M12 18V6`})]})}function A(){return(0,m.jsxs)(`svg`,{"aria-hidden":`true`,className:`lucide lucide-route`,viewBox:`0 0 24 24`,children:[(0,m.jsx)(`circle`,{cx:`6`,cy:`19`,r:`3`}),(0,m.jsx)(`path`,{d:`M9 19h6.5a3.5 3.5 0 0 0 0-7h-7a3.5 3.5 0 0 1 0-7H18`}),(0,m.jsx)(`circle`,{cx:`18`,cy:`5`,r:`3`})]})}function De({currency:e,locale:t,onCurrencyChange:n,onHelpOpen:r,onNavigate:i,pricingSetupPath:a,projectSetupPath:o,costCalculationGuidePath:s}){return(0,m.jsxs)(`div`,{className:`dashboard-global-settings`,children:[(0,m.jsxs)(`label`,{children:[(0,m.jsx)(`span`,{children:t===`pt-BR`?`Moeda`:`Currency`}),(0,m.jsxs)(`select`,{"aria-label":t===`pt-BR`?`Moeda`:`Currency`,onChange:e=>n(e.target.value),value:e,children:[(0,m.jsx)(`option`,{value:`BRL`,children:`BRL · Real brasileiro`}),(0,m.jsx)(`option`,{value:`USD`,children:`USD · US Dollar`})]})]}),(0,m.jsx)(`button`,{className:`dashboard-help-open`,onClick:r,type:`button`,children:t===`pt-BR`?`Central de Ajuda`:`Open help and guides`}),(0,m.jsx)(`button`,{className:`dashboard-help-open`,onClick:()=>i(a),type:`button`,children:t===`pt-BR`?`Configurar preços e câmbio`:`Configure pricing and FX`}),(0,m.jsx)(`button`,{className:`dashboard-help-open`,onClick:()=>i(o),type:`button`,children:t===`pt-BR`?`Configurar projeto`:`Configure project`})]})}var Oe=class{token;constructor(e){this.token=e}ready(){return this.get(`/api/v2/ready`)}operations(e,t=`detail`,n,r=!1){let a=`${i.operations}?scope=${t}${r?`&fresh=1`:``}`;return this.get(P(a,e),n)}sqliteViewPage(e,t,n={},r){let i=new URLSearchParams({view:e,offset:String(n.offset??0)});return n.limit!==void 0&&i.set(`limit`,String(n.limit)),n.query&&i.set(`query`,n.query),n.status&&i.set(`status`,n.status),n.risk&&i.set(`risk`,n.risk),n.provider&&i.set(`provider`,n.provider),n.model&&i.set(`model`,n.model),n.agent&&i.set(`agent`,n.agent),n.phase&&i.set(`phase`,n.phase),n.origin&&i.set(`origin`,n.origin),n.workType&&i.set(`workType`,n.workType),n.priority&&i.set(`priority`,n.priority),n.kind&&i.set(`kind`,n.kind),this.get(P(`/api/v2/sqlite-views?${i.toString()}`,t),r)}operationsBoard(e,t,n=0,r,a,o=4){let s=new URLSearchParams({scope:`board`,stage:t,offset:String(n),limit:String(o)});return r?.query&&s.set(`query`,r.query),r?.status&&s.set(`status`,r.status),r?.risk&&s.set(`risk`,r.risk),r?.origin&&s.set(`origin`,r.origin),r?.kind&&s.set(`kind`,r.kind),this.get(P(`${i.operations}?${s.toString()}`,e),a)}operationsClassification(e,t,n,r=0,a,o=50){let s=new URLSearchParams({scope:`classification`,kind:t,classification:n,offset:String(r),limit:String(o)});return this.get(P(`${i.operations}?${s.toString()}`,e),a)}operationsEntityPage(e,t,n=0,r,a){let o=j(t,n,r);return this.get(P(`${i.operations}/runs?${o}`,e),a)}operationsLifecyclePage(e,t,n=0,r,a){let o=j(t,n,r);return this.get(P(`${i.operations}/entities?${o}`,e),a)}operationsReadModelPage(e,t,n=0,r=50,a=``,o){let s=new URLSearchParams({kind:t,offset:String(n),limit:String(r)});return a&&s.set(`query`,a),this.get(P(`${i.operations}/read-models?${s.toString()}`,e),o)}costMonitor(e=`BRL`,t,n=`detail`,r,a,o=!1){let s=new URLSearchParams({currency:e,scope:n});o&&s.set(`fresh`,`1`);for(let[e,t]of Object.entries(a??{}))t&&s.set(e,t);return this.get(P(`${i.costMonitor}?${s.toString()}`,t),r)}costMonitorRuns(e=`BRL`,t,n,r=100,a,o){let s=new URLSearchParams({currency:e,scope:`runs`,offset:String(n),limit:String(r)});for(let[e,t]of Object.entries(o??{}))t&&s.set(e,t);return this.get(P(`${i.costMonitor}?${s.toString()}`,t),a)}snapshot(e=`BRL`,t){return this.get(P(`${i.snapshot}?currency=${e}`,t))}reconcileOpenWork(e=`BRL`,t){return this.post(P(`${i.reconcileOpenWork}?currency=${e}`,t),ke)}refreshProjection(e=`BRL`,t){return this.post(P(`${i.refreshProjection}?currency=${e}`,t),ke)}task(e){return this.get(i.task(e))}prd(e){return this.get(i.prd(e))}spec(e){return this.get(i.spec(e))}taskTrace(e,t){return this.get(i.taskTrace(e),t)}pricing(){return this.get(`/api/v2/pricing`)}async savePricing(e){let t=await fetch(`/api/v2/pricing`,{method:`PUT`,headers:{"content-type":`application/json`,"x-zaip-session":this.token},body:JSON.stringify(e)});if(!t.ok)throw Error(`Pricing update failed with HTTP ${t.status}`);return await t.json()}fxRate(){return this.get(`/api/v2/fx-rate`)}agentCatalog(){return this.get(i.agentCatalog)}agentPortraitUrl(e){return`/api/v2/agent-catalog-assets/${encodeURIComponent(e)}?token=${encodeURIComponent(this.token)}`}projectSettings(){return this.get(i.projectSettings)}projectOverview(){return this.get(`${i.projectSettings}/overview`)}async saveWorkPriority(e){let t=await fetch(i.workPriority,{method:`PUT`,headers:{"content-type":`application/json`,"x-zaip-session":this.token},body:JSON.stringify({item_ids:e})});if(!t.ok)throw Error(`Work priority update failed with HTTP ${t.status}`);return await t.json()}async saveProjectSettings(e){let t=await fetch(i.projectSettings,{method:`PUT`,headers:{"content-type":`application/json`,"x-zaip-session":this.token},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??`Project settings update failed with HTTP ${t.status}`)}return await t.json()}async saveAgentCatalog(e){let t=e.map(({nickname_candidates:e,...t})=>t),n=await fetch(i.agentCatalog,{method:`PUT`,headers:{"content-type":`application/json`,"x-zaip-session":this.token},body:JSON.stringify({agents:t})});if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.error??`Agent catalog update failed with HTTP ${n.status}`)}return await n.json()}async saveFxRate(e){let t=await fetch(`/api/v2/fx-rate`,{method:`PUT`,headers:{"content-type":`application/json`,"x-zaip-session":this.token},body:JSON.stringify({rate:e})});if(!t.ok)throw Error(`FX update failed with HTTP ${t.status}`);return await t.json()}async get(e,t){let n=await N(e,{cache:`no-cache`,headers:{"x-zaip-session":this.token}},M,t);if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.error??`Dashboard API failed with HTTP ${n.status}`)}return await n.json()}async post(e,t=M){let n=await N(e,{method:`POST`,headers:{"x-zaip-session":this.token}},t);if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.error??`Dashboard API failed with HTTP ${n.status}`)}return await n.json()}};function j(e,t,n){let r=new URLSearchParams({kind:e,offset:String(t),limit:`100`});return n?.query&&r.set(`query`,n.query),n?.status&&r.set(`status`,n.status),n?.risk&&r.set(`risk`,n.risk),r.toString()}var M=6e4,ke=18e4;async function N(e,t,n=M,r){let i=new AbortController,a=()=>i.abort();r?.addEventListener(`abort`,a,{once:!0}),r?.aborted&&i.abort();let o=window.setTimeout(()=>i.abort(),n);try{return await fetch(e,{...t,signal:i.signal})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?Error(`A leitura demorou mais de ${Math.ceil(n/1e3)} segundos. Tente novamente.`):e}finally{window.clearTimeout(o),r?.removeEventListener(`abort`,a)}}function P(e,t){if(t===void 0)return e;let n=new URL(e,`http://dashboard.local`);return t.from!==null&&n.searchParams.set(`from`,t.from),t.to!==null&&n.searchParams.set(`to`,t.to),`${n.pathname}${n.search}`}var Ae={preset:`all`,range:a(`this-month`)};function F(e){return e.preset===`all`?{from:null,to:null}:{from:e.range.start,to:e.range.end}}var je=1500;function Me({snapshotUpdating:e,initialDataPending:t,dismissed:n,delayElapsed:r}){return e&&t&&!n&&r}function Ne({cursor:e,page:t,tasks:n}){let r=new Map(n.map(e=>[e.id,e]));for(let e of t.tasks)r.set(e.id,e);let i=e.offset+t.tasks.length;return{tasks:[...r.values()],cursor:t.tasks.length===0||i>=t.total?{offset:0,stageIndex:e.stageIndex+1}:{...e,offset:i}}}function Pe(e,t,n){return Math.min(t,e+n)}function I(e){return typeof e==`number`?e:null}function L(e){return typeof e==`number`?{known_sum:e,unknown:0,complete:!0,coverage_ratio:1}:{known_sum:0,unknown:1,complete:!1,coverage_ratio:0}}function Fe(e){return Object.hasOwn(e,`total_duration`)?I(e.total_duration):I(e.cost_monitor_total_duration)}function Ie(e,t,n){let{filters:r,query:i}=e;return{offset:t,limit:n,...i===void 0||i===``?{}:{query:i},...r.provider?{provider:r.provider}:{},...r.model?{model:r.model}:{},...r.agent?{agent:r.agent}:{},...r.phase?{phase:r.phase}:{},...r.status?{status:r.status}:{},...r.origin?{origin:r.origin}:{},...r.workType?{workType:r.workType}:{},...r.priority?{priority:r.priority}:{},...r.risk?{risk:r.risk}:{}}}function R(e){let t=Fe(e),n=Number(e.duration_unknown??+(t===null)),r=I(e.duration_known)??t??0;return{key:String(e.key??e.period_key??`total`),label:String(e.label??e.key??e.period_key??``),latest_started_at:typeof e.latest_started_at==`string`?e.latest_started_at:``,persona:typeof e.persona==`string`?e.persona:null,job:typeof e.job==`string`?e.job:null,run_count:Number(e.total_run_count??e.invocation_count??0),task_count:I(e.task_count),prd_count:Number(e.prd_count??0),spec_count:Number(e.spec_count??0),evidence_count:Number(e.evidence_count??0),test_count:Number(e.validation_count??0),event_count:Number(e.source_event_count??0),total_tokens:I(e.total_tokens),estimated_usd:I(e.total_cost_usd),estimated_brl:I(e.total_cost_brl),duration_ms:t,duration:{known_sum:r,unknown:n,complete:n===0,coverage_ratio:+(n===0)},coverage:{events:0,tokens:0,usd:0,brl:0}}}async function Le(e,t){let{from:n,limit:r,offset:i,signal:a,to:o,view:s}=t,c=n===void 0||o===void 0?void 0:{from:n,to:o};if(s===`daily`){let n=await e.sqliteViewPage(`cost_monitor_daily`,c,Ie(t,i,r),a);return{offset:n.offset,limit:n.limit,total_count:n.total_count,has_more:n.has_more,rows:n.rows.map(R),...n.totals===void 0?{}:{totals:R(n.totals)}}}let l={monthly:`cost_monitor_monthly`,annual:`cost_monitor_annual`,agents:`cost_monitor_zaip_agents`,models:`cost_monitor_models`,providers:`cost_monitor_providers`}[s],u=await e.sqliteViewPage(l,c,Ie(t,i,r),a);return{offset:u.offset,limit:u.limit,total_count:u.total_count,has_more:u.has_more,rows:u.rows.map(R),...u.totals===void 0?{}:{totals:R(u.totals)}}}async function Re(e,t){let{filters:n,from:r,limit:i=10,offset:a,signal:o,to:s}=t,c=await e.sqliteViewPage(`cost_monitor_agent_invocations`,r===void 0||s===void 0?void 0:{from:r,to:s},{offset:a,limit:i,...n?.query?{query:n.query}:{},...n?.provider?{provider:n.provider}:{},...n?.model?{model:n.model}:{},...n?.agent?{agent:n.agent}:{},...n?.phase?{phase:n.phase}:{},...n?.status?{status:n.status}:{}},o);return{page_only:!0,runs:c.rows.map(ze),run_page:{offset:c.offset,limit:c.limit,total:c.total_count,has_more:c.has_more}}}function ze(e){let t=(e,t)=>typeof e==`string`?e:t,n=e=>typeof e==`number`?e:null,r=t(e.agent_invocation_id,`unavailable`),i=typeof e.task_id==`string`?e.task_id:null,a=typeof e.spec_id==`string`?e.spec_id:null,o=typeof e.prd_id==`string`?e.prd_id:null,s=t(e.phase,`execution`),c=e.duration_provenance===`observed`||e.duration_provenance===`reconciled`||e.duration_provenance===`estimated`||e.duration_provenance===`legacy_inferred`?e.duration_provenance:`unavailable`,l=Object.hasOwn(e,`calculated_cost_usd`)?n(e.calculated_cost_usd):n(e.cost_usd),u=n(e.current_fx_rate)??n(e.fx_rate),d=n(e.recorded_cost_usd)??n(e.recorded_usd),f=Object.hasOwn(e,`recorded_fx_rate`)?n(e.recorded_fx_rate):n(e.fx_rate),p=n(e.recorded_brl)??(!Object.hasOwn(e,`recorded_brl`)&&d!==null?n(e.cost_brl):null),m=l!==null&&u!==null?Math.round(l*u*1e6)/1e6:null;return{run_id:r,execution_id:typeof e.execution_id==`string`?e.execution_id:null,conversation_id:t(e.run_id,r),task_id:i,task_title:t(e.task_title,i??`Tarefa avulsa`),task_status:t(e.task_status,`unavailable`),priority:t(e.priority,`unavailable`),risk:t(e.risk,`unavailable`),spec_id:a,prd_id:o,change_id:typeof e.change_id==`string`?e.change_id:null,parent_run_id:typeof e.parent_agent_invocation_id==`string`?e.parent_agent_invocation_id:null,run_role:e.invocation_kind===`subagent`?`subagent`:`orchestrator`,run_kind:e.run_kind===`subrun`?`subrun`:`run`,run_purpose:`execution`,requires_finalizer:!1,client:t(e.client,`unavailable`),agent:t(e.zaip_agent,`unavailable`),agent_name:t(e.zaip_agent,`unavailable`),provider:typeof e.provider==`string`?e.provider:null,model:t(e.model,`unavailable`),requested_model:t(e.requested_model,`unavailable`),reasoning_effort:typeof e.reasoning_effort==`string`?e.reasoning_effort:null,effective_reasoning_effort:typeof e.effective_reasoning_effort==`string`?e.effective_reasoning_effort:null,service_tier:typeof e.service_tier==`string`?e.service_tier:null,call_count:n(e.llm_call_count),status:t(e.status,`completed`),phase:s,origin:o===null?a===null?i===null?`conversation`:`task`:`spec`:`prd`,work_type:e.work_type===`rework`?`rework`:`new`,started_at:t(e.occurred_at,``),finished_at:typeof e.finished_at==`string`?e.finished_at:null,duration_ms:n(e.duration_ms),duration_provenance:c,estimation_basis:typeof e.estimation_basis==`string`?e.estimation_basis:null,source_started_at:typeof e.source_started_at==`string`?e.source_started_at:null,source_finished_at:typeof e.source_finished_at==`string`?e.source_finished_at:null,capture_lag_ms:n(e.capture_lag_ms),event_count:n(e.source_event_count),input_tokens:n(e.input_tokens),cached_input_tokens:n(e.cached_input_tokens),output_tokens:n(e.output_tokens),reasoning_tokens:n(e.reasoning_tokens),total_tokens:n(e.total_tokens),uncached_input_tokens:n(e.uncached_input_tokens),visible_output_tokens:n(e.visible_output_tokens),input_rate_usd_per_million:n(e.input_rate_usd_per_million),cached_input_rate_usd_per_million:n(e.cached_input_rate_usd_per_million),output_rate_usd_per_million:n(e.output_rate_usd_per_million),reasoning_rate_usd_per_million:n(e.reasoning_rate_usd_per_million),context_input_multiplier:n(e.context_input_multiplier),context_output_multiplier:n(e.context_output_multiplier),speed_cost_multiplier:n(e.speed_cost_multiplier),standard_cost_usd:n(e.standard_cost_usd),speed_uplift_usd:n(e.speed_uplift_usd),input_cost_usd:n(e.input_cost_usd),cached_input_cost_usd:n(e.cached_input_cost_usd),output_cost_usd:n(e.output_cost_usd),reasoning_cost_usd:n(e.reasoning_cost_usd),fx_rate:u,estimated_usd:l,estimated_brl:m,recorded_usd:d,recorded_brl:p,recorded_fx_rate:f,coverage:{events:0,tokens:0,usd:0,brl:0},artifact_path:`.agents/records/runs/${r}`}}function Be(e,t){let n=t.totals,r=e=>L(n?.[e]);return{data_source:`lifecycle_daily_read_models`,snapshot_id:null,source_latest_at:null,kind:e,offset:t.offset,limit:t.limit,total:t.total_count,has_more:t.has_more,next_cursor:null,subtotal:{entity_count:typeof n?.entity_count==`number`?n.entity_count:t.total_count,run_count:r(`invocation_count`),metrics:{duration:r(`total_duration`),total_tokens:r(`total_tokens`),cost_brl:r(`total_cost_brl`),cost_usd:r(`total_cost_usd`)}},rows:t.rows.map(t=>({id:String(t.task_id??t.spec_id??t.prd_id??t.execution_id??t.conversation_id??t.id??`unavailable`),title:String(t.title??t.task_id??t.spec_id??t.prd_id??t.execution_id??t.conversation_id??`Unavailable`),kind:e===`tasks`?`task`:e===`specs`?`spec`:e===`prds`?`prd`:e===`executions`?`execution`:`conversation`,status:typeof t.status==`string`?t.status:null,risk:typeof t.risk==`string`?t.risk:null,occurred_at:typeof t.occurred_at==`string`?t.occurred_at:typeof t.started_at==`string`?t.started_at:typeof t.last_day==`string`?`${t.last_day}T12:00:00.000Z`:``,parent_id:null,run_count:Number(t.invocation_count??0),cost_currency:`BRL`,metrics:{duration:L(t.total_duration),total_tokens:L(t.total_tokens),cost:L(t.total_cost_brl)}}))}}function Ve(e){return{loadCostDetail:(0,f.useCallback)(async()=>{throw Error(`SQLite Cost Monitor loads the selected paginated view; full detail is disabled.`)},[]),loadCostReadModelPage:(0,f.useCallback)(async({filters:t,from:n,kind:r,limit:i,offset:a,query:o,signal:s,to:c})=>{let l={tasks:`cost_monitor_tasks`,specs:`cost_monitor_specs`,prds:`cost_monitor_prds`,executions:`cost_monitor_executions`,conversations:`cost_monitor_conversations`}[r];return Be(r,await e.sqliteViewPage(l,n===void 0||c===void 0?void 0:{from:n,to:c},{offset:a,limit:i,...o===void 0||o===``?{}:{query:o},...t.provider?{provider:t.provider}:{},...t.model?{model:t.model}:{},...t.agent?{agent:t.agent}:{},...t.phase?{phase:t.phase}:{},...t.status?{status:t.status}:{},...t.origin?{origin:t.origin}:{},...t.workType?{workType:t.workType}:{},...t.priority?{priority:t.priority}:{},...t.risk?{risk:t.risk}:{}},s))},[e]),loadCostRunPage:(0,f.useCallback)(t=>Re(e,t),[e]),loadCostGroupPage:(0,f.useCallback)(t=>Le(e,t),[e])}}function He(e,t){return!1}function Ue(e,t=window,n=0){let r=!1,i=!1,a=new AbortController,o=t.setTimeout(()=>{r||i||(i=!0,e(a.signal))},n);return()=>{r||(r=!0,a.abort(),t.clearTimeout(o))}}function We({inFlight:e,lastRefreshAt:t,now:n,visibilityState:r}){return r===`visible`&&!e&&n-t>=5e3}function Ge({api:e,costLocale:t,currency:n,dashboardView:r,loadOperationsDetails:i,operations:a,operationsDetailAbortRef:o,operationsDetailCancelRef:s,operationsPageAbortRef:c,pathname:l,pricing:u,refresh:d,refreshVersion:p,setError:m,setFxRate:h,setPathname:g,setPricing:_}){let v=(0,f.useRef)(!1),y=(0,f.useRef)(0);(0,f.useEffect)(()=>(d(),()=>{s.current?.(),s.current=null,o.current?.abort(),o.current=null,c.current?.abort(),c.current=null,++p.current}),[o,s,c,d,p]),(0,f.useEffect)(()=>{let e=()=>{let e=Date.now();We({inFlight:v.current,lastRefreshAt:y.current,now:e,visibilityState:document.visibilityState})&&(y.current=e,v.current=!0,d(!1,!1,!0).finally(()=>{v.current=!1}))};return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,e)}},[d]),(0,f.useEffect)(()=>{if(!He(r,a?.summary.overview_metrics?.partial===!0))return;let e=Ue(async e=>{await i(e)});return s.current=e,()=>{s.current===e&&(s.current=null),e()}},[r,i,a?.summary.overview_metrics?.partial,s]),(0,f.useEffect)(()=>window.localStorage.setItem(ye,t),[t]),(0,f.useEffect)(()=>window.localStorage.setItem(D,n),[n]),(0,f.useEffect)(()=>{[`/`,`/setup-pricing`,`/setup-project`].includes(window.location.pathname)||(window.history.replaceState(null,``,`/${window.location.search}${window.location.hash}`),g(`/`))},[g]),(0,f.useEffect)(()=>{let e=()=>g(window.location.pathname);return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[g]),(0,f.useEffect)(()=>{l!==`/setup-pricing`||u!==null||Promise.all([e.pricing(),e.fxRate()]).then(([e,t])=>{_(e),h(t)}).catch(e=>m(String(e)))},[e,l,u,m,h,_])}var z={events:0,tokens:{input:null,cached_input:null,output:null,reasoning:null,total:null},cost:{usd:null,brl:null},coverage:{events:0,tokens:0,usd:0,brl:0}};function Ke(e,t,n){let r=e=>e===`intake`||e===`orchestration`||e===`execution`||e===`review`||e===`audit`||e===`finalization`?e:`execution`,i=n.rows.map(e=>({id:e.id,artifact_path:`.agents/records/runs/${e.id}`,status:e.status===`running`||e.status===`failed`||e.status===`cancelled`?e.status:`completed`,phase:e.phase??`execution`,entrypoint:e.conversation_id===null?`task`:`conversation`,work_type:`new`,run_role:e.run_kind===`subrun`?`subagent`:`orchestrator`,run_kind:e.run_kind??`run`,run_purpose:r(e.run_purpose),requires_finalizer:!1,parent_run_id:e.parent_run_id,client:e.client??`unknown`,agent:e.agent??`unknown`,agent_name:e.agent??`unknown`,agent_persona:e.agent_persona??null,agent_job:e.agent_job??null,provider:e.provider??null,model:e.model??`unknown`,reasoning_effort:e.reasoning_effort??null,effective_model:e.model??null,effective_reasoning_effort:e.reasoning_effort??null,effective_config_mixed:e.pricing_mixed??!1,service_tier:e.service_tier??null,call_count:e.llm_call_count??null,terminal_call_count:null,failed_call_count:null,cancelled_call_count:null,conversation_id:e.conversation_id??e.id,execution_id:e.execution_id,task_id:e.task_id,spec_id:null,prd_id:null,change_id:null,started_at:e.started_at,finished_at:e.finished_at,duration_ms:e.duration_ms,source_duration_ms:e.source_duration_ms===void 0?e.duration_ms:e.source_duration_ms,duration_provenance:e.duration_provenance===`observed`||e.duration_provenance===`reconciled`||e.duration_provenance===`legacy_inferred`||e.duration_provenance===`estimated`?e.duration_provenance:`unavailable`,llm_call_count:e.llm_call_count??null,input_tokens:e.input_tokens??null,cached_input_tokens:e.cached_input_tokens??null,uncached_input_tokens:e.uncached_input_tokens??null,output_tokens:e.output_tokens??null,reasoning_tokens:e.reasoning_tokens??null,visible_output_tokens:e.visible_output_tokens??null,input_rate_usd_per_million:e.input_rate_usd_per_million??null,cached_input_rate_usd_per_million:e.cached_input_rate_usd_per_million??null,output_rate_usd_per_million:e.output_rate_usd_per_million??null,reasoning_rate_usd_per_million:e.reasoning_rate_usd_per_million??null,context_input_multiplier:e.context_input_multiplier??null,context_output_multiplier:e.context_output_multiplier??null,speed_cost_multiplier:e.speed_cost_multiplier??null,pricing_scenario:e.pricing_scenario??null,standard_cost_usd:e.standard_cost_usd??null,speed_uplift_usd:e.speed_uplift_usd??null,input_cost_usd:e.input_cost_usd??null,cached_input_cost_usd:e.cached_input_cost_usd??null,output_cost_usd:e.output_cost_usd??null,reasoning_cost_usd:e.reasoning_cost_usd??null,calculated_cost_usd:e.calculated_cost_usd??null,recorded_cost_usd:e.recorded_cost_usd??null,cost_variance_usd:e.cost_variance_usd??null,cost_usd:e.cost_usd??null,cost_brl:e.currency===`BRL`?e.cost:null,fx_rate:e.fx_rate??null,pricing_segment_count:e.pricing_segment_count??null,pricing_mixed:e.pricing_mixed??!1,pricing_model:e.pricing_model??null,pricing_source:e.pricing_source??null,...e.lifecycle_elapsed_ms===void 0?{}:{lifecycle_elapsed_ms:e.lifecycle_elapsed_ms},usage:{conversation:z,planning:z,execution:{...z,events:e.llm_call_count??0,tokens:{input:e.input_tokens??null,cached_input:e.cached_input_tokens??null,output:e.output_tokens??null,reasoning:e.reasoning_tokens??null,total:e.total_tokens},cost:{usd:e.cost_usd??null,brl:e.currency===`BRL`?e.cost:null}},total:{...z,events:e.llm_call_count??0,tokens:{input:e.input_tokens??null,cached_input:e.cached_input_tokens??null,output:e.output_tokens??null,reasoning:e.reasoning_tokens??null,total:e.total_tokens},cost:{usd:e.cost_usd??null,brl:e.currency===`BRL`?e.cost:null}},new_work:z,rework:z}}));return{...e,runs:i,executions:t===`executions`||t===`conversations`?n.rows.map((e,n)=>{let r=i[n],a=r.execution_id??r.conversation_id,o=e.status??`unavailable`;return{id:a,kind:t===`conversations`?`interaction`:`delivery`,created_at:r.started_at,status:o,work_status:o,origin:t===`conversations`?{type:`interaction`,conversation_id:r.conversation_id}:{type:`task`,task_id:r.task_id??`unavailable`},dag:{nodes:[],topological_order:[]},result:null,artifact_path:`.agents/records/executions/${a}`,agent_call_count:0,orchestrator_run_count:0,subagent_run_count:0,finalizer_run_count:0,finalized_task_count:0,llm_call_count:0,llm_call_count_complete:!1,task_count:0,spec_count:0,prd_count:0,duration_ms:r.source_duration_ms??null,...e.lifecycle_elapsed_ms===void 0?{}:{lifecycle_elapsed_ms:e.lifecycle_elapsed_ms},total_tokens:r.usage.total.tokens.total,cost_brl:r.usage.total.cost.brl}}):e.executions}}function B(e){if(typeof e!=`string`)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function qe({api:e,entityFiltersRef:t,operationsPageAbortRef:n,operationsPageRequestVersionRef:r,operationsPeriod:i,operationsPeriodRef:a,refreshVersion:o,setEntityPage:s,setEntityPageKind:c,setOperations:l}){return{loadOperationsEntityPage:(0,f.useCallback)(async(u,d=0,f=t.current)=>{n.current?.abort();let p=new AbortController;n.current=p;let m=++r.current,h=o.current,g=F(i),_=()=>C(m,r.current,p.signal)&&x(h,o.current,g,F(a.current));c(u),s({offset:d,total:null,loading:!0,error:null});try{let t={runs:`operations_agent_invocations`,executions:`operations_executions`,conversations:`operations_conversations`}[u],n=await e.sqliteViewPage(t,g,{offset:d,limit:100,...f.query?{query:f.query}:{},...f.status?{status:f.status}:{},...f.risk?{risk:f.risk}:{}},p.signal),r={kind:u,offset:n.offset,limit:n.limit,total:n.total_count,aggregation:`canonical_entity`,rows:n.rows.map(e=>({id:String(e.agent_invocation_id??e.execution_id??e.conversation_id??e.id),started_at:String(e.occurred_at??e.started_at??`1970-01-01T00:00:00.000Z`),finished_at:typeof e.finished_at==`string`?e.finished_at:null,task_id:typeof e.task_id==`string`?e.task_id:null,execution_id:typeof e.execution_id==`string`?e.execution_id:null,conversation_id:typeof e.conversation_id==`string`?e.conversation_id:null,parent_run_id:typeof e.parent_agent_invocation_id==`string`?e.parent_agent_invocation_id:null,run_kind:e.invocation_kind===`delegated`||e.invocation_kind===`subagent`?`subrun`:e.invocation_kind===`orchestrator`?`run`:null,run_purpose:typeof e.purpose==`string`?e.purpose:null,phase:typeof e.phase==`string`?e.phase:null,status:typeof e.status==`string`?e.status:null,agent:typeof e.zaip_agent==`string`?e.zaip_agent:null,agent_persona:typeof e.zaip_agent_persona==`string`?e.zaip_agent_persona:null,agent_job:typeof e.zaip_agent_job==`string`?e.zaip_agent_job:null,client:typeof e.client==`string`?e.client:null,provider:typeof e.provider==`string`?e.provider:null,model:typeof e.model==`string`?e.model:null,reasoning_effort:typeof e.reasoning_effort==`string`?e.reasoning_effort:null,service_tier:typeof e.service_tier==`string`?e.service_tier:null,duration_ms:typeof e.duration_ms==`number`?e.duration_ms:typeof e.total_duration==`number`?e.total_duration:null,source_duration_ms:typeof e.source_duration_ms==`number`?e.source_duration_ms:null,duration_provenance:typeof e.duration_provenance==`string`?e.duration_provenance:null,llm_call_count:typeof e.llm_call_count==`number`?e.llm_call_count:null,input_tokens:typeof e.input_tokens==`number`?e.input_tokens:null,cached_input_tokens:typeof e.cached_input_tokens==`number`?e.cached_input_tokens:null,uncached_input_tokens:typeof e.uncached_input_tokens==`number`?e.uncached_input_tokens:null,output_tokens:typeof e.output_tokens==`number`?e.output_tokens:null,reasoning_tokens:typeof e.reasoning_tokens==`number`?e.reasoning_tokens:null,visible_output_tokens:typeof e.visible_output_tokens==`number`?e.visible_output_tokens:null,total_tokens:typeof e.total_tokens==`number`?e.total_tokens:null,input_rate_usd_per_million:typeof e.input_rate_usd_per_million==`number`?e.input_rate_usd_per_million:null,cached_input_rate_usd_per_million:typeof e.cached_input_rate_usd_per_million==`number`?e.cached_input_rate_usd_per_million:null,output_rate_usd_per_million:typeof e.output_rate_usd_per_million==`number`?e.output_rate_usd_per_million:null,reasoning_rate_usd_per_million:typeof e.reasoning_rate_usd_per_million==`number`?e.reasoning_rate_usd_per_million:null,context_input_multiplier:typeof e.context_input_multiplier==`number`?e.context_input_multiplier:null,context_output_multiplier:typeof e.context_output_multiplier==`number`?e.context_output_multiplier:null,speed_cost_multiplier:typeof e.speed_cost_multiplier==`number`?e.speed_cost_multiplier:null,pricing_scenario:typeof e.pricing_scenario==`string`?e.pricing_scenario:null,standard_cost_usd:typeof e.standard_cost_usd==`number`?e.standard_cost_usd:null,speed_uplift_usd:typeof e.speed_uplift_usd==`number`?e.speed_uplift_usd:null,input_cost_usd:typeof e.input_cost_usd==`number`?e.input_cost_usd:null,cached_input_cost_usd:typeof e.cached_input_cost_usd==`number`?e.cached_input_cost_usd:null,output_cost_usd:typeof e.output_cost_usd==`number`?e.output_cost_usd:null,reasoning_cost_usd:typeof e.reasoning_cost_usd==`number`?e.reasoning_cost_usd:null,calculated_cost_usd:typeof e.calculated_cost_usd==`number`?e.calculated_cost_usd:null,recorded_cost_usd:typeof e.recorded_cost_usd==`number`?e.recorded_cost_usd:null,cost_variance_usd:typeof e.cost_variance_usd==`number`?e.cost_variance_usd:null,cost_usd:typeof e.cost_usd==`number`?e.cost_usd:null,fx_rate:typeof e.fx_rate==`number`?e.fx_rate:null,pricing_segment_count:typeof e.pricing_segment_count==`number`?e.pricing_segment_count:null,pricing_mixed:e.pricing_mixed===1||e.pricing_mixed===!0,pricing_model:typeof e.audit_pricing_model==`string`?e.audit_pricing_model:typeof e.pricing_model==`string`?e.pricing_model:null,pricing_source:typeof e.audit_pricing_source==`string`?e.audit_pricing_source:typeof e.pricing_source==`string`?e.pricing_source:null,cost:typeof e.total_cost_brl==`number`?e.total_cost_brl:typeof e.cost_brl==`number`?e.cost_brl:null,currency:`BRL`}))};if(!_())return;l(e=>e===null?e:Ke(e,u,r)),s({offset:r.offset,total:r.total,loading:!1,error:null,aggregation:r.aggregation})}catch(e){if(!_()||S(e))return;s({offset:d,total:null,loading:!1,error:e instanceof Error?e.message:String(e)})}finally{n.current===p&&(n.current=null)}},[e,t,n,r,i,a,o,s,c,l]),loadOperationsLifecyclePage:(0,f.useCallback)(async(u,d=0,f=t.current)=>{n.current?.abort();let p=new AbortController;n.current=p;let m=++r.current,h=o.current,g=F(i),_=()=>C(m,r.current,p.signal)&&x(h,o.current,g,F(a.current));c(u),s({offset:d,total:null,loading:!0,error:null});try{let t=await e.sqliteViewPage(u===`changes`?`operations_changes`:`operations_decisions`,g,{offset:d,limit:100,...f.query?{query:f.query}:{},...f.status?{status:f.status}:{},...f.risk?{risk:f.risk}:{}},p.signal),n=u===`changes`?t.rows.map(e=>{let t=String(e.source_type),n=String(e.source_id);return{id:String(e.id),title:typeof e.title==`string`?e.title:String(e.id),created_at:typeof e.occurred_at==`string`?e.occurred_at:null,status:typeof e.status==`string`?e.status:`unclassified`,risk:typeof e.risk==`string`?e.risk:`unclassified`,source:t===`spec`?{type:`spec`,spec_id:n}:t===`prd`?{type:`prd`,prd_id:n,spec_id:null}:{type:`task`,task_id:n},requirement_ids:B(e.requirement_ids_json),acceptance_ids:B(e.acceptance_ids_json),task_ids:B(e.task_ids_json),result:typeof e.result==`string`?e.result:null,artifact_path:typeof e.source_path==`string`?e.source_path:String(e.id)}}):t.rows.map(e=>({id:String(e.id),title:typeof e.title==`string`?e.title:String(e.id),origin:e.origin===`human`?`human`:`agent`,scope_type:e.scope_type===`execution`?`execution`:`change`,scope_id:String(e.scope_id),artifact_path:typeof e.source_path==`string`?e.source_path:String(e.id),created_at:typeof e.occurred_at==`string`?e.occurred_at:`1970-01-01T00:00:00.000Z`})),r={kind:u,offset:t.offset,limit:t.limit,total:t.total_count,rows:n};if(!_())return;l(e=>e===null?e:{...e,...u===`changes`?{changes:r.rows}:{decisions:r.rows}}),s({offset:r.offset,total:r.total,loading:!1,error:null})}catch(e){if(!_()||S(e))return;s({offset:d,total:null,loading:!1,error:e instanceof Error?e.message:String(e)})}finally{n.current===p&&(n.current=null)}},[e,t,n,r,i,a,o,s,c,l])}}function Je({api:e,operations:t,setError:n,setFailedArea:r,setLoadingArea:i}){let[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)([]),[l,u]=(0,f.useState)(null),[d,p]=(0,f.useState)(null),m=(0,f.useRef)(0),h=(0,f.useRef)(0),g=(0,f.useRef)(null),[_,v]=(0,f.useState)(null),[y,ee]=(0,f.useState)(``);async function te(a){let c=++h.current;g.current?.abort();let l=new AbortController;g.current=l,n(null),r(null),o(null),v(a),i(`traceability`),await new Promise(e=>window.requestAnimationFrame(()=>e()));try{let n=await e.taskTrace(a,l.signal);if(h.current!==c)return!1;let r=s.find(e=>e.id===a)??t?.tasks.find(e=>e.id===a);return o({...n,task_title:r?.title||n.task_title||a,task_risk:r?.risk||n.task_risk||null,task_created_at:r?.created_at||n.task_created_at||null,task_progress:r?.progress??n.task_progress??0}),!0}catch(e){return l.signal.aborted||h.current!==c?!1:(n(e instanceof Error?e.message:String(e)),r(`traceability`),!1)}finally{h.current===c&&(g.current===l&&(g.current=null),v(null),i(e=>e===`traceability`?null:e))}}function b(e){let n=t?.changes.find(t=>t.id===e);n!==void 0&&(o(null),p({kind:`change`,row:n}))}function x(e,n){let r=(e===`PRD`?t?.prds:t?.specs)?.find(e=>e.id===n);r!==void 0&&(o(null),p({kind:`macro`,label:e,row:r}))}async function S(n,r){let i=(n===`prd`?t?.prds:t?.specs)?.find(e=>e.id===r);if(!i)return;let a=++m.current,o=n===`prd`?`PRD`:`SPEC`;u({kind:n,label:o,preview:i});try{let t=n===`prd`?await e.prd(r):await e.spec(r);if(m.current!==a)return;u({kind:n,label:o,preview:i,detail:t})}catch(e){if(m.current!==a)return;u({kind:n,label:o,preview:i,error:e instanceof Error?e.message:String(e)})}}function ne(){m.current+=1,u(null)}return{closeDocument:ne,documentDetail:l,openDocument:S,openTrace:te,openTraceChange:b,openTraceMacro:x,selectedTraceTaskId:y,setSelectedTraceTaskId:ee,setTrace:o,setTraceLink:p,setTraceLoadingTaskId:v,setTraceTasks:c,trace:a,traceLink:d,traceLoadingTaskId:_,traceTasks:s}}function Ye(e,t){return JSON.stringify([e.query,e.status,e.risk,e.origin??``,e.kind??``,t.from??``,t.to??``])}function Xe(e,t,n){return e===`explicit`||t!==n}function Ze(e,t){return{...e,kind:e.kind??t.kind??``}}var Qe={offset:0,limit:10,total:null,hasMore:!1,typeFilter:`all`,rows:[],loading:!1,error:null};function $e({api:e,operationsPeriod:t,operationsPeriodRef:n}){let[r,i]=(0,f.useState)(Qe),a=(0,f.useRef)({query:``,status:``,risk:``}),o=(0,f.useRef)(null),s=(0,f.useRef)(0),c=(0,f.useRef)(null),l=(0,f.useCallback)(async(r,l=0,u=`explicit`)=>{let d=F(t),f=Ze(r,a.current),p=Ye(f,d);if(!Xe(u,p,c.current))return;o.current?.abort();let m=new AbortController;o.current=m;let h=++s.current;a.current=f,c.current=p;let g=f.kind||`all`;i(e=>({...e,offset:l,typeFilter:g,loading:!0,error:null}));try{let t=await e.sqliteViewPage(`operations_work_list`,d,{offset:l,limit:10,...f.query?{query:f.query}:{},...f.status?{status:f.status}:{},...f.risk?{risk:f.risk}:{},...f.origin?{origin:f.origin}:{},...g===`all`?{}:{kind:g}},m.signal);if(m.signal.aborted||h!==s.current||d.from!==F(n.current).from||d.to!==F(n.current).to)return;i({offset:t.offset,limit:t.limit,total:t.total_count,hasMore:t.has_more,typeFilter:g,rows:t.rows,loading:!1,error:null})}catch(e){if(m.signal.aborted||h!==s.current)return;c.current===p&&(c.current=null),i(t=>({...t,offset:l,typeFilter:g,loading:!1,error:e instanceof Error?e.message:String(e)}))}finally{o.current===m&&(o.current=null)}},[e,t,n]),u=(0,f.useCallback)(()=>{o.current?.abort(),o.current=null,++s.current,c.current=null,i(Qe)},[]);return{workListPage:r,workListFiltersRef:a,loadWorkListFilters:(0,f.useCallback)(e=>l(e,0,`filter-hydration`),[l]),loadWorkListPage:l,resetWorkListPage:u}}async function*et(e,t){let n=e;for(;;){if(n.rows.length===0)return;yield n.rows;let e=n.offset+n.rows.length;if(!n.has_more||e>=n.total_count)return;n=await t(e)}}function tt({api:e,operationsPeriod:t}){return(0,f.useCallback)((n,r)=>{let i=F(t);if(n===`work-kanban`)return;let a={"work-list":`operations_work_list`,changes:`operations_changes`,decisions:`operations_decisions`,executions:`operations_executions`,runs:`operations_agent_invocations`,conversations:`operations_conversations`,daily:`operations_daily`,monthly:`operations_monthly`,yearly:`operations_annual`}[n];if(a===void 0)return;let o=e=>({offset:e,limit:100,...r.query?{query:r.query}:{},...r.status?{status:r.status}:{},...r.risk?{risk:r.risk}:{},...r.origin?{origin:r.origin}:{},...a===`operations_work_list`&&r.kind?{kind:r.kind}:{}});return{prepare:async()=>{let t=await e.sqliteViewPage(a,i,o(0));return{totalRows:t.total_count,pages:()=>et(t,t=>e.sqliteViewPage(a,i,o(t)))}}}},[e,t])}var nt=(e,t)=>`${e}:${t}`,rt=(e,t)=>`${e}:${t}`,it=[`definition`,`planning`,`ready`,`executing`,`verifying`,`completed`,`blocked`,`cancelled`,`failed`],at=[`completed`,`executing`,`ready`,`blocked`,`verifying`,`failed`,`cancelled`,`planning`,`definition`];function V(){let[e,t]=(0,f.useState)(!1),[n,r]=(0,f.useState)(!1),[i,a]=(0,f.useState)(!1),o=(0,f.useMemo)(Se,[]),c=(0,f.useMemo)(()=>new Oe(o),[o]),{loadCostDetail:l,loadCostReadModelPage:u,loadCostRunPage:d,loadCostGroupPage:p}=Ve(c),[h,g]=(0,f.useState)(()=>xe(window.location.pathname)),_=(0,f.useRef)(h);_.current=h;let[v,y]=(0,f.useState)(null),[C,se]=(0,f.useState)({offset:0,total:null,loading:!1,error:null}),[w,ce]=(0,f.useState)(`runs`),T=(0,f.useRef)({query:``,status:``,risk:``}),[le,de]=(0,f.useState)({}),[fe,pe]=(0,f.useState)({}),[ve,E]=(0,f.useState)({}),[ye,D]=(0,f.useState)({}),[Ce,O]=(0,f.useState)({}),[k,Ee]=(0,f.useState)(null),[A,j]=(0,f.useState)(null),[M,ke]=(0,f.useState)(be),[N,P]=(0,f.useState)(()=>window.localStorage.getItem(`zaip-dashboard-currency`)===`USD`?`USD`:`BRL`),Pe=(0,f.useRef)(N);Pe.current=N;let I=(0,f.useCallback)(e=>{ke(e),P(e===`en-US`?`USD`:`BRL`)},[]),[L,Fe]=(0,f.useState)(()=>Ae),Ie=(0,f.useMemo)(()=>F(L),[L.preset===`all`?`all`:`${L.preset}:${L.range.start}:${L.range.end}`]),R=(0,f.useRef)(L);R.current=L;let[Le,Re]=(0,f.useState)(!1),[ze,Be]=(0,f.useState)(null),[He,Ue]=(0,f.useState)(null),[We,z]=(0,f.useState)(window.location.pathname),[Ke,B]=(0,f.useState)(!0),[,Ye]=(0,f.useState)(!1),[,Xe]=(0,f.useState)(!1),[Ze,Qe]=(0,f.useState)(!1),[et,V]=(0,f.useState)(`operations`),[H,U]=(0,f.useState)(null),[ot,st]=(0,f.useState)(null);(0,f.useEffect)(()=>{c.ready().then(e=>t(e.snapshot_state===`updating`)).catch(()=>{})},[c]);let[ct,W]=(0,f.useState)(null),[lt,ut]=(0,f.useState)(null),[dt,ft]=(0,f.useState)(null),[pt,mt]=(0,f.useState)({title:`Dashboard Zaip AIOS`,repositoryName:``}),{closeDocument:ht,documentDetail:gt,openDocument:_t,openTrace:G,openTraceChange:vt,openTraceMacro:yt,selectedTraceTaskId:bt,setSelectedTraceTaskId:xt,setTrace:St,setTraceLink:Ct,setTraceLoadingTaskId:wt,setTraceTasks:Tt,trace:Et,traceLink:Dt,traceLoadingTaskId:Ot,traceTasks:kt}=Je({api:c,operations:v,setError:W,setFailedArea:U,setLoadingArea:V}),K=(0,f.useRef)(kt),At=(0,f.useRef)({offset:0,stageIndex:0}),jt=(0,f.useRef)(!1),[Mt,Nt]=(0,f.useState)(!1),[Pt,Ft]=(0,f.useState)(!1),q=(0,f.useRef)(0);(0,f.useEffect)(()=>{K.current=kt},[kt]);let It=(0,f.useRef)(0),Lt=(0,f.useRef)(!1),J=(0,f.useRef)(0),Rt=(0,f.useRef)(0),Y=(0,f.useRef)(null),zt=(0,f.useRef)(!1),Bt=(0,f.useRef)(!1),Vt=(0,f.useRef)(null),X=(0,f.useRef)(null),Ht=(0,f.useRef)(null),Ut=(0,f.useRef)(0),Wt=(0,f.useRef)({}),Z=(0,f.useRef)(new Set),Q=(0,f.useRef)(new Map),Gt=(0,f.useRef)(new Set),Kt=(0,f.useRef)(new Set),qt=(0,f.useRef)({query:``,status:``,risk:``,origin:``,kind:``}),Jt=(0,f.useRef)(`||||`),$=(0,f.useRef)(0),Yt=(0,f.useRef)(void 0),{workListPage:Xt,workListFiltersRef:Zt,loadWorkListFilters:Qt,loadWorkListPage:$t,resetWorkListPage:en}=$e({api:c,operationsPeriod:L,operationsPeriodRef:R}),tn=(0,f.useRef)(!1),nn=(0,f.useCallback)(async(e=!0,t=!1,n=!1)=>{Vt.current?.(),Vt.current=null,X.current?.abort(),X.current=null,$.current+=1;for(let e of Q.current.values())e.abort();Q.current.clear(),Z.current.clear(),Kt.current.clear(),Wt.current={},de({}),pe({}),E({}),D({}),O({});let r=++q.current,i=It.current,a=_.current,o=Ie,s=()=>b(r,q.current)&&x(r,q.current,o,F(R.current));e&&(B(!0),V(`operations`)),W(null),U(null);try{if(t||n){let e,n=null;if(t){let t=await c.reconcileOpenWork(N,o);n=t.reconciliation,e=t}else e=await c.refreshProjection(N,o);if(!s())return;n!==null&&ut(n),y(e.operations),Yt.current=e.operations.summary.overview_metrics,Bt.current=!0,Ee(e.costs),zt.current=!0,j(null),e.dashboard&&mt({title:e.dashboard.title,repositoryName:e.dashboard.repository_name}),ft(e.projection.source_latest_at)}else{let[e,t]=await Promise.all([c.operations(o,`quick`,void 0,tn.current),N===`USD`?c.costMonitor(N,o,`summary`):Promise.resolve(null)]);if(!s())return;tn.current=!1,y(e),Yt.current=e.summary.overview_metrics,Bt.current=!1,t!==null&&(Ee(t),zt.current=!1,j(null)),ft(e.summary.source_latest_at)}}catch(e){if(!s())return;W(e instanceof Error?e.message:String(e)),U(a===`cost-monitor`?`costs`:`operations`)}finally{s()&&ne(i,It.current)&&Qe(!1),e&&s()&&(B(!1),V(e=>e===`operations`?null:e))}},[c,N,Ie]),rn=(0,f.useCallback)(async e=>{if(Bt.current||Lt.current||e?.aborted)return null;X.current?.abort();let t=e===void 0?new AbortController:null,n=e??t?.signal;if(n===void 0)return null;t!==null&&(X.current=t),Lt.current=!0,J.current+=1,V(`costs`),U(null);try{let e=++q.current,t=F(L),r=()=>b(e,q.current)&&x(e,q.current,t,F(R.current)),i=await c.operations(t,`detail`,n);return r()?(y(i),Bt.current=!0,i):null}catch(e){return n.aborted||S(e)?null:(W(e instanceof Error?e.message:String(e)),U(`operations`),null)}finally{t!==null&&X.current===t&&(X.current=null),Lt.current=!1,J.current=Math.max(0,J.current-1),J.current===0&&V(e=>e===`costs`?null:e)}},[c,L]),{loadOperationsEntityPage:an,loadOperationsLifecyclePage:on}=qe({api:c,entityFiltersRef:T,operationsPageAbortRef:Ht,operationsPageRequestVersionRef:Ut,operationsPeriod:L,operationsPeriodRef:R,refreshVersion:q,setEntityPage:se,setEntityPageKind:ce,setOperations:y}),sn=(0,f.useCallback)((e,t)=>{T.current=t,e===`changes`||e===`decisions`?on(e,0,t):an(e,0,t)},[an,on]),cn=(0,f.useCallback)(async e=>{if(v===null||Z.current.has(e))return;Z.current.add(e),Q.current.get(e)?.abort();let t=new AbortController;Q.current.set(e,t);let n=$.current,r=F(L);E(t=>({...t,[e]:{loading:!0,error:null}}));let i=Wt.current[e]??0;try{let a=await c.operationsBoard(r,e,i,qt.current,t.signal,10);if(t.signal.aborted||n!==$.current||r.from!==F(R.current).from||r.to!==F(R.current).to)return;y(e=>e===null?e:{...re(e,[a]),summary:e.summary}),de(t=>({...t,[e]:a.total})),pe(t=>({...t,[e]:a.totals_by_kind}));let o=i+a.prds.length+a.specs.length+a.tasks.length;Wt.current={...Wt.current,[e]:o}}catch(r){if(t.signal.aborted||n!==$.current||S(r))return;E(t=>({...t,[e]:{loading:!1,error:r instanceof Error?r.message:String(r)}}))}finally{n===$.current&&(Z.current.delete(e),Q.current.get(e)===t&&Q.current.delete(e),E(t=>t[e]?.error===null?{...t,[e]:{loading:!1,error:null}}:t))}},[c,v,L]),ln=(0,f.useCallback)(e=>{let t={...e,kind:e.kind??qt.current.kind??``},n=`${t.query}|${t.status}|${t.risk}|${t.origin??``}|${t.kind}`;if(n!==Jt.current){Jt.current=n,qt.current=t,$.current+=1;for(let e of Q.current.values())e.abort();Q.current.clear(),Z.current.clear(),Kt.current.clear(),Wt.current={},de({}),pe({}),E({}),D({}),O({}),y(e=>e===null?e:{...e,prds:[],specs:[],tasks:[],changes:[],summary:n===`||||`&&Yt.current!==void 0?{...e.summary,overview_metrics:Yt.current}:e.summary})}},[]),un=(0,f.useCallback)(async(e,t,n)=>{let r=nt(e,t);if(Gt.current.has(r))return;Gt.current.add(r);let i=$.current,a=F(L);D(e=>({...e,[r]:{items:n===0?[]:e[r]?.items??[],total:e[r]?.total??0,loading:!0,error:null}}));try{let o=await c.operationsBoard(a,e,n,{kind:t===`task`?`all-tasks`:t});if(i!==$.current||a.from!==F(R.current).from||a.to!==F(R.current).to)return;let s=t===`task`?o.tasks:t===`spec`?o.specs:o.prds;D(e=>({...e,[r]:{items:n===0?s:[...e[r]?.items??[],...s],total:o.total,loading:!1,error:null}}))}catch(e){if(i!==$.current||S(e))return;D(t=>({...t,[r]:{items:t[r]?.items??[],total:t[r]?.total??0,loading:!1,error:e instanceof Error?e.message:String(e)}}))}finally{Gt.current.delete(r)}},[c,L]),dn=(0,f.useCallback)(async(e,t,n)=>{let r=rt(e,t);if(Gt.current.has(r))return;Gt.current.add(r);let i=$.current,a=F(L);O(e=>({...e,[r]:{items:n===0?[]:e[r]?.items??[],total:e[r]?.total??0,loading:!0,error:null}}));try{let o=await c.operationsClassification(a,e,t,n);if(i!==$.current||a.from!==F(R.current).from||a.to!==F(R.current).to)return;let s=e===`task`?o.tasks:e===`spec`?o.specs:o.prds;O(e=>({...e,[r]:{items:n===0?s:[...e[r]?.items??[],...s],total:o.total,loading:!1,error:null}}))}catch(e){if(i!==$.current||S(e))return;O(t=>({...t,[r]:{items:t[r]?.items??[],total:t[r]?.total??0,loading:!1,error:e instanceof Error?e.message:String(e)}}))}finally{Gt.current.delete(r)}},[c,L]),fn=(0,f.useCallback)(e=>{let t={...qt.current,...e},n=F(L);return{prepare:async()=>{let e=await Promise.all(it.map(e=>c.operationsBoard(n,e,0,t))),r=e=>[...e.prds.map(({kind:e,...t})=>({kind:`prd`,...t})),...e.specs.map(({kind:e,...t})=>({kind:`spec`,...t})),...e.tasks.map(e=>({kind:`task`,...e}))];return{totalRows:e.reduce((e,t)=>e+t.total,0),pages:async function*(){for(let i of e){let e=i,a=0;for(;;){let i=r(e);if(i.length===0||(a+=i.length,yield i,a>=e.total))break;e=await c.operationsBoard(n,e.stage,a,t)}}}}}}},[c,L]),pn=tt({api:c,operationsPeriod:L});(0,f.useEffect)(()=>{if(h!==`operations`||v===null)return;let e=!1,t=async()=>{if(e)return;let t=it.filter(e=>!Kt.current.has(e)&&!Z.current.has(e));for(let n=0;n<t.length&&!e;n+=3){let e=t.slice(n,n+3);for(let t of e)Kt.current.add(t);await Promise.all(e.map(e=>cn(e)))}},n=typeof window.requestIdleCallback==`function`?{kind:`idle`,id:window.requestIdleCallback(()=>void t())}:{kind:`timeout`,id:window.setTimeout(()=>void t(),0)};return()=>{e=!0,n.kind===`idle`?window.cancelIdleCallback(n.id):window.clearTimeout(n.id)}},[h,cn,v]);let mn=async e=>{e&&ut(null),st(e?`reconciling`:`refreshing`),await nn(!1,e,!e),st(null)};Ge({api:c,costLocale:M,currency:N,dashboardView:h,loadOperationsDetails:rn,operations:v,operationsDetailAbortRef:X,operationsDetailCancelRef:Vt,operationsPageAbortRef:Ht,pathname:We,pricing:ze,refresh:nn,refreshVersion:q,setError:W,setFxRate:Ue,setPathname:z,setPricing:Be});let hn=e=>{window.history.pushState(null,``,e),z(e),window.scrollTo({left:0,top:0})},gn=(0,f.useCallback)(async()=>{Y.current?.abort();let e=new AbortController;Y.current=e;let t=++Rt.current,n=F(L);J.current+=1,V(`costs`),U(null);try{let r=await c.costMonitor(N,n,`summary`,e.signal),i=F(R.current);if(!te({aborted:e.signal.aborted,currentCurrency:Pe.current,currentPeriod:i,currentRequestVersion:Rt.current,requestVersion:t,requestedCurrency:N,requestedPeriod:n}))return;Ee(r),zt.current=!0,j(null)}catch(n){if(e.signal.aborted||t!==Rt.current)return;W(n instanceof Error?n.message:String(n)),U(`costs`)}finally{J.current=Math.max(0,J.current-1),J.current===0&&V(e=>e===`costs`?null:e),Y.current===e&&(Y.current=null)}},[c,N,L]);(0,f.useEffect)(()=>{N!==`USD`||k?.currency===N||gn()},[k?.currency,N,gn]),(0,f.useEffect)(()=>{h!==`cost-monitor`&&L.preset!==`all`||Y.current!==null||ee({costsLoaded:zt.current,currency:N,snapshotCurrency:k?.currency})&&gn()},[k?.currency,N,h,gn,L.preset]);let _n=(0,f.useCallback)(async(e=!1,t=!1)=>{if(jt.current||(t&&(At.current={offset:0,stageIndex:0},K.current=[],Tt([]),Nt(!0)),At.current.stageIndex>=at.length))return K.current;jt.current=!0,Ft(!0);try{do{let t=At.current,n=at[t.stageIndex];if(n===void 0)break;let r=await c.operationsBoard({from:null,to:null},n,t.offset,{kind:`all-tasks`},void 0,10),i=Ne({cursor:t,page:r,tasks:K.current});if(K.current=i.tasks,Tt(K.current),At.current=i.cursor,r.tasks.length>0&&!e)break}while(At.current.stageIndex<at.length);return Nt(At.current.stageIndex<at.length),K.current}finally{jt.current=!1,Ft(!1)}},[c,Tt]),vn=async e=>{if(g(e),window.scrollTo({left:0,top:0}),e===`cost-monitor`?ee({costsLoaded:zt.current,currency:N,snapshotCurrency:k?.currency})&&gn():Y.current?.abort(),e===`traceability`){let e=kt;if(e.length===0){let t=$.current;if(e=await _n(!1,!0),t!==$.current)return;Tt(e)}let t=e.toSorted((e,t)=>Date.parse(t.finished_at??t.updated_at)-Date.parse(e.finished_at??e.updated_at)),n=t.find(e=>e.status===`completed`)??t[0];n&&(xt(n.id),G(n.id));return}St(null),wt(null)},yn=(0,m.jsx)(`div`,{className:`dashboard-capability-shell dashboard-capability-shell--${h??`initial`}`,children:(0,m.jsx)(Te,{activeView:h,locale:M,onChange:e=>void vn(e)})}),bn=(0,f.useMemo)(()=>new Map((A??k)?.runs.map(e=>[e.run_id,N===`USD`?e.estimated_usd:e.estimated_brl])??[]),[k,N,A]),xn=(0,f.useMemo)(()=>{let e=A??k;return e?.currency===N?N===`USD`?e.overview.estimated_usd:e.overview.estimated_brl:null},[k,N,A]),Sn=(0,f.useMemo)(()=>{let e=A??k;if(e?.currency===N)return{day:e.groups.daily,month:e.groups.monthly,year:e.groups.annual}},[k,N,A]),Cn=()=>{W(null),H===`costs`?gn():H===`traceability`&&bt?G(bt):H===`operations`&&v!==null?rn():nn()},wn=_e({api:c,costLocale:M,fxRate:He,navigate:hn,pathname:We,pricing:ze,refresh:nn,setFxRate:Ue,setPricing:Be}),Tn=Ze||N===`USD`&&k?.currency!==N,En=v===null&&Ke;(0,f.useEffect)(()=>{if(!e||!En||n){a(!1);return}let t=window.setTimeout(()=>a(!0),je);return()=>window.clearTimeout(t)},[En,n,e]);let Dn=Me({snapshotUpdating:e,initialDataPending:En,dismissed:n,delayElapsed:i})?(0,m.jsxs)(`div`,{"aria-live":`polite`,className:`app-notice app-snapshot-status`,role:`status`,children:[(0,m.jsx)(`span`,{children:`Exibindo o último snapshot local validado. Os dados canônicos estão sendo atualizados em segundo plano e estarão atuais na próxima abertura.`}),(0,m.jsx)(`button`,{"aria-label":M===`pt-BR`?`Fechar aviso de atualização do snapshot`:`Dismiss snapshot update notice`,onClick:()=>r(!0),type:`button`,children:`×`})]}):null,On=v;return(0,m.jsxs)(oe,{error:ct,globalLoadingPending:Tn,locale:M,onRefresh:()=>void nn(),operations:v,snapshotNotice:Dn,setupRoute:wn,children:[(0,m.jsxs)(ae,{pending:Tn,children:[ct?(0,m.jsxs)(`div`,{"aria-live":`assertive`,className:`app-warning app-error`,role:`alert`,children:[(0,m.jsx)(`span`,{children:ct}),H?(0,m.jsx)(`button`,{onClick:Cn,type:`button`,children:M===`pt-BR`?`Tentar novamente`:`Try again`}):null,(0,m.jsx)(`button`,{"aria-label":M===`pt-BR`?`Fechar erro`:`Dismiss error`,onClick:()=>W(null),type:`button`,children:`×`})]}):null,(0,m.jsx)(s,{alternateContent:we({costs:k,costLocale:M,currency:N,dashboardView:h,failedArea:H,lastUpdatedAt:dt,loadCostDetail:l,loadCostReadModelPage:u,loadCostRunPage:d,loadCostGroupPage:p,loadingArea:et,onActiveDataChange:j,onCurrencyChange:P,onLoadingChange:Xe,onLocaleChange:I,onLoadMoreTraceTasks:_n,onOpenTrace:e=>void G(e),onRefresh:()=>st(`choose`),onRetry:Cn,onSelectTraceTask:e=>{xt(e),G(e)},onOpenTraceChange:vt,onOpenTraceMacro:yt,operations:On,selectedTraceTaskId:bt,trace:Et,traceLoadingTaskId:Ot,traceTasksHasMore:Mt,traceTasksLoading:Pt,traceTasks:kt}),capabilityNavigation:yn,boardTotals:le,boardKindTotals:fe,boardExportSource:fn,detailExportSource:pn,boardStates:ve,data:On,datePreset:L.preset,dateRange:L.range,entityPage:C,dashboardTitle:pt.title,repositoryName:pt.repositoryName,loading:Ke,locale:M,currency:N,factualCostTotal:xn,factualCostPeriods:Sn,onLoadingChange:Ye,resolveRunCost:k===null?void 0:e=>bn.get(e)??null,onLocaleChange:I,onDetailDataRequest:e=>{let t=e===`conversations`?`conversations`:e===`executions`?`executions`:e===`runs`?`runs`:null;t===null?e===`changes`||e===`decisions`?on(e):rn():an(t)},onLoadMacroMetrics:()=>void rn(),onEntityPageChange:e=>{w===`changes`||w===`decisions`?on(w,e):an(w,e)},onEntityFiltersChange:sn,onBoardFiltersChange:ln,onWorkListFiltersChange:Qt,onWorkListPageChange:e=>void $t(Zt.current,e),onBoardTypeChange:e=>ln({...qt.current,kind:e===`all`?``:e}),onWorkListTypeChange:e=>void $t({...Zt.current,kind:e===`all`?``:e}),onLoadMoreBoard:e=>void cn(e),workListPage:Xt,statusPage:(e,t)=>ye[nt(e,t)],onLoadStatusPage:(e,t,n)=>void un(e,t,n),classificationPage:(e,t)=>Ce[rt(e,t)],onLoadClassificationPage:(e,t,n)=>void dn(e,t,n),onOpenDocument:(e,t)=>void _t(e,t),onOpenTask:G,onPriorityChange:async e=>{try{await c.saveWorkPriority(e)}catch(e){throw W(e instanceof Error?e.message:String(e)),e}},onDateChange:(e,t)=>{Bt.current=!1,Vt.current?.(),Vt.current=null,X.current?.abort(),X.current=null,Ht.current?.abort(),Ht.current=null,en(),++Ut.current,$.current+=1;for(let e of Q.current.values())e.abort();Q.current.clear(),Z.current.clear(),Kt.current.clear(),Wt.current={},de({}),pe({}),E({}),D({}),O({}),++q.current,Y.current?.abort(),Y.current=null,++Rt.current,se({offset:0,total:null,loading:!1,error:null}),zt.current=!1,Ee(null),j(null),B(!0),It.current+=1,Qe(!0),V(`operations`),Fe({preset:e,range:t})},onRefresh:()=>st(`choose`),settings:(0,m.jsx)(De,{costCalculationGuidePath:ge,currency:N,locale:M,onCurrencyChange:P,onHelpOpen:()=>Re(!0),onNavigate:hn,pricingSetupPath:me,projectSetupPath:he})}),(0,m.jsx)(ue,{closeDocument:ht,costLocale:M,documentDetail:gt,helpOpen:Le,loadingArea:h===`cost-monitor`&&k===null?null:et,operations:On,reconciliationResult:lt,refreshDialog:ot,showTrace:h===`traceability`,trace:Et,traceLink:Dt,traceLoadingTaskId:Ot,onCloseHelp:()=>Re(!1),onCloseTrace:()=>St(null),onDismissReconciliation:()=>ut(null),onOpenDocument:(e,t)=>void _t(e,t),onOpenTrace:e=>void G(e),onOpenTraceChange:vt,onOpenTraceMacro:yt,onRefreshCancel:()=>st(null),onRefreshFromDialog:e=>void mn(e),setTraceLink:e=>Ct(e)})]}),Tn?(0,m.jsx)(ie,{}):null]})}var H=document.getElementById(`root`);if(!H)throw Error(`Elemento #root não encontrado`);(0,p.createRoot)(H).render((0,m.jsx)(f.StrictMode,{children:(0,m.jsx)(V,{})}));export{Pe as t};
@@ -0,0 +1 @@
1
+ .dashboard-capability-nav{background:#080e19b8;border:1px solid #94a3b81f;border-radius:15px;grid-template-columns:repeat(3,minmax(190px,1fr));gap:5px;width:fit-content;margin:22px 0 14px;padding:5px;display:grid}.dashboard-capability-shell{flex:none}.dashboard-capability-shell--initial+.dashboard-global-filters,.dashboard-capability-shell--traceability+.dashboard-global-filters{display:none}.dashboard-capability-nav button{color:#7f91aa;text-align:left;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:11px;align-items:center;gap:10px;min-height:52px;padding:7px 13px;display:flex}.dashboard-capability-nav button:hover{color:#dce8f7;border-color:#38bdf82e}.dashboard-capability-nav button.is-active{color:#e7f5ff;background:#0ea5e91c;border-color:#38bdf847;box-shadow:inset 0 0 0 1px #38bdf80a}.dashboard-capability-nav svg{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.7px;flex:none;width:20px;height:20px}.dashboard-capability-nav span{gap:2px;display:grid}.dashboard-capability-nav strong{font-size:.78rem}.dashboard-capability-nav small{color:#64748b;white-space:nowrap;font-size:.62rem}@media (width<=560px){.dashboard-capability-nav{grid-template-columns:repeat(3,minmax(165px,1fr));width:max-content;max-width:100%;overflow-x:auto}.dashboard-capability-nav button{justify-content:center;padding-inline:8px}.dashboard-capability-nav small{display:none}}.app-loading-panel{color:#dbeafe;text-align:center;background:#0ea5e90a;border:1px solid #38bdf82e;border-radius:20px;place-content:center;justify-items:center;gap:14px;min-height:240px;display:grid}.app-loading-panel i{border:3px solid #334155;border-top-color:#38bdf8;border-radius:50%;width:28px;height:28px;animation:.9s linear infinite app-refresh-spin}.app-loading-panel div{gap:5px;display:grid}.app-loading-panel strong{color:#e2e8f0}.app-loading-panel span{color:#94a3b8;font-size:.85rem}.app-loading-panel-error{border-color:#f8717147}.app-loading-panel-error button{color:#fecaca;cursor:pointer;background:#7f1d1d66;border:1px solid #f8717159;border-radius:10px;padding:9px 12px}.period-transition-overlay{color:#f1f5f9;z-index:9999;background:#0a0e17;justify-content:center;align-items:center;font-family:Inter,ui-sans-serif,system-ui,sans-serif;display:flex;position:fixed;inset:0}.period-transition-overlay__content{align-items:center;gap:16px;display:flex}.period-transition-overlay__spinner{border:3px solid #f1f5f947;border-top-color:#00b0f0;border-radius:999px;width:32px;height:32px;animation:.8s linear infinite period-transition-spin}.period-transition-overlay__label{font-size:clamp(1rem,3vw,1.25rem);font-weight:700}@keyframes period-transition-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.period-transition-overlay__spinner{border-top-color:#00b0f0;animation:none}}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;color:#f1f5f9;--background:#010610;--surface:#0a0e17;--surface-muted:#0d1220;--surface-raised:#111827;--line:#ffffff14;--line-strong:#ffffff24;--text:#f1f5f9;--muted:#94a3b8;--muted-deep:#4b5563;--accent:#00b0f0;--accent-soft:#00b0f01f;--accent-border:#00b0f040;--shadow:0 18px 48px #00000073;font-synthesis:none;text-rendering:optimizelegibility;background:#010610;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}*{box-sizing:border-box}html{background:var(--background);min-width:320px;min-height:100%}html,body,#root{scrollbar-color:#00b0f0 #050b15;scrollbar-width:thin}html::-webkit-scrollbar{width:14px;height:14px}body::-webkit-scrollbar{width:14px;height:14px}#root::-webkit-scrollbar{width:14px;height:14px}html::-webkit-scrollbar-track{background:#050b15}body::-webkit-scrollbar-track{background:#050b15}#root::-webkit-scrollbar-track{background:#050b15}html::-webkit-scrollbar-thumb{background:linear-gradient(#38bdf8,#0284c7) padding-box padding-box;border:3px solid #050b15;border-radius:999px;box-shadow:inset 0 0 0 1px #bae6fd4d}body::-webkit-scrollbar-thumb{background:linear-gradient(#38bdf8,#0284c7) padding-box padding-box;border:3px solid #050b15;border-radius:999px;box-shadow:inset 0 0 0 1px #bae6fd4d}#root::-webkit-scrollbar-thumb{background:linear-gradient(#38bdf8,#0284c7) padding-box padding-box;border:3px solid #050b15;border-radius:999px;box-shadow:inset 0 0 0 1px #bae6fd4d}html::-webkit-scrollbar-thumb:hover{background:linear-gradient(#7dd3fc,#00b0f0)}body::-webkit-scrollbar-thumb:hover{background:linear-gradient(#7dd3fc,#00b0f0)}#root::-webkit-scrollbar-thumb:hover{background:linear-gradient(#7dd3fc,#00b0f0)}body{background:radial-gradient(circle at 50% 0, #00b0f00f 0%, transparent 42%), var(--background);min-width:320px;min-height:100vh;color:var(--text);margin:0}button,input,select{font:inherit}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.app-state{text-align:center;place-content:center;min-height:100vh;padding:2rem;display:grid}.app-state h1{max-width:720px}.app-state pre{white-space:pre-wrap;color:#fecaca;max-width:min(800px,90vw);overflow:auto}.app-state button{border:1px solid var(--accent-border);background:var(--surface);color:var(--accent);cursor:pointer;border-radius:12px;justify-self:center;padding:.7rem 1rem}.app-skeleton{min-height:100vh;padding:clamp(18px,2.4vw,38px)}.app-skeleton-header{justify-content:space-between;align-items:center;gap:24px;margin-bottom:24px;display:flex}.app-skeleton-header h1{margin:8px 0 0;font-size:clamp(1.45rem,2.4vw,2.25rem)}.app-skeleton-actions{gap:10px;display:flex}.app-skeleton-actions span{border:1px solid var(--line);background:var(--surface-muted);border-radius:12px;width:48px;height:42px}.app-skeleton-kpis,.app-skeleton-panels,.app-skeleton-board{gap:14px;display:grid}.app-skeleton-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}.app-skeleton-kpis article,.app-skeleton-panels article,.app-skeleton-board>article{border:1px solid var(--line);background:linear-gradient(145deg,#111827db,#0a0e17eb);border-radius:16px}.app-skeleton-kpis article{min-height:138px;padding:18px}.app-skeleton-line,.app-skeleton-value,.app-skeleton-pill,.app-skeleton-chart,.app-skeleton-actions span{position:relative;overflow:hidden}.app-skeleton-line:after,.app-skeleton-value:after,.app-skeleton-pill:after,.app-skeleton-chart:after,.app-skeleton-actions span:after{content:"";background:linear-gradient(90deg,#0000,#7dd3fc1f,#0000);animation:1.35s ease-in-out infinite app-skeleton-shimmer;position:absolute;inset:0;transform:translate(-100%)}.app-skeleton-line,.app-skeleton-value,.app-skeleton-pill{background:#172033;border-radius:999px;display:block}.app-skeleton-line{width:88%;height:10px;margin-top:12px}.app-skeleton-line-short{width:34%}.app-skeleton-line-medium{width:62%}.app-skeleton-value{width:42%;height:30px;margin-top:18px}.app-skeleton-panels{grid-template-columns:minmax(0,1.7fr) minmax(260px,1fr);margin-top:14px}.app-skeleton-panels article{padding:18px}.app-skeleton-chart{background:repeating-linear-gradient(#3341554d 0 1px,#0000 1px 38px);border-radius:12px;height:156px;margin-top:22px}.app-skeleton-chart-small{background:radial-gradient(circle,#172033 0 34%,#0000 35%)}.app-skeleton-board{grid-template-columns:repeat(5,minmax(210px,1fr));margin-top:18px;padding-bottom:10px;overflow-x:auto}.app-skeleton-board>article{min-height:220px;padding:14px}.app-skeleton-board h2{color:#cbd5e1;min-height:34px;margin:0 0 12px;font-size:.82rem;line-height:1.35}.app-skeleton-card{background:#0206178f;border:1px solid #ffffff0f;border-radius:12px;min-height:92px;margin-top:10px;padding:10px}.app-skeleton-pill{width:52px;height:15px;margin-top:14px}@keyframes app-skeleton-shimmer{to{transform:translate(100%)}}.app-notice,.app-warning{z-index:80;max-width:min(520px,100% - 2rem);box-shadow:var(--shadow);border-radius:16px;gap:1rem;padding:.9rem 1rem;display:flex;position:fixed;bottom:1rem;right:1rem}.app-snapshot-status{color:#dbeafe;background:#082f49f5;border:1px solid #38bdf857}.app-warning.app-error{color:#fecaca;background:#451010f5;border:1px solid #f8717147}.app-notice button,.app-warning button{color:inherit;cursor:pointer;background:0 0;border:0}.app-refresh-dialog-backdrop{z-index:200;background:#020617b8;border:0;justify-content:center;align-items:center;width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:24px;display:flex;position:fixed;inset:0;overflow:auto}.app-refresh-dialog{color:#e2e8f0;background:#0f172a;border:1px solid #334155;border-radius:16px;max-width:460px;padding:24px;box-shadow:0 24px 64px #0000006b}.app-refresh-dialog h2{margin:0 0 8px}.app-refresh-dialog p{color:#94a3b8;margin:0;line-height:1.5}.app-refresh-dialog>div{gap:10px;margin-top:20px;display:grid}.app-refresh-dialog button{cursor:pointer;border:0;border-radius:8px;padding:11px 14px}.app-refresh-dialog>div button:first-child{color:#f8fafc;background:#334155}.app-refresh-dialog>div button:last-child{color:#fff;background:#2563eb}.app-refresh-cancel{color:#94a3b8;background:0 0;width:100%;margin-top:12px}.app-refresh-progress{text-align:center;place-items:center;display:grid}.app-refresh-progress i{border:3px solid #334155;border-top-color:#38bdf8;border-radius:50%;width:28px;height:28px;margin-bottom:14px;animation:.9s linear infinite app-refresh-spin}.app-refresh-status{z-index:80;width:min(390px,100vw - 36px);box-shadow:var(--shadow);background:#0f172af5;border:1px solid #38bdf859;border-radius:14px;align-items:center;gap:12px;padding:13px 15px;display:flex;position:fixed;bottom:18px;right:18px}.app-refresh-status i{border:3px solid #334155;border-top-color:#38bdf8;border-radius:50%;flex:none;width:22px;height:22px;animation:.9s linear infinite app-refresh-spin}.app-refresh-status div{gap:3px;display:grid}.app-refresh-status strong{color:#e2e8f0;font-size:.9rem}.app-refresh-status span{color:#94a3b8;font-size:.78rem}.app-refresh-status-close{color:#cbd5e1;cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;align-self:flex-start;padding:0 5px;font-size:1.25rem;line-height:1}.app-refresh-status-close:hover,.app-refresh-status-close:focus-visible{color:#f8fafc;background:#94a3b829}.app-reconciliation-result{z-index:80;width:min(520px,100vw - 36px);box-shadow:var(--shadow);background:#0f172afa;border:1px solid #38bdf859;border-radius:14px;gap:8px;padding:13px 15px;display:grid;position:fixed;bottom:18px;right:18px}.app-reconciliation-result strong{color:#e2e8f0}.app-reconciliation-result span,.app-reconciliation-result p{color:#cbd5e1;margin:0;font-size:.82rem}.app-reconciliation-result button{cursor:pointer;border:0;border-radius:6px;justify-self:start;padding:7px 10px}@media (width<=860px){.app-skeleton-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.app-skeleton-panels{grid-template-columns:1fr}}@keyframes app-refresh-spin{to{transform:rotate(360deg)}}.dashboard-global-settings{gap:14px;display:grid}.dashboard-global-settings label{gap:7px;display:grid}.dashboard-global-settings .dashboard-help-open{color:#bae6fd;justify-content:center;width:100%}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto;transition:none;animation:none}}.pricing-backdrop{background:radial-gradient(circle at 50% 0,#308bcf17,#0000 36%),#070b13;min-height:100vh;padding:clamp(20px,3vw,48px)}.pricing-dialog{background:linear-gradient(145deg,#0d1320 0%,#090e18 100%);border:1px solid #2b3a52;border-radius:24px;flex-direction:column;width:100%;max-width:1840px;min-height:calc(100vh - clamp(40px,6vw,96px));margin:0 auto;display:flex;box-shadow:0 24px 80px #0000006b}.pricing-dialog>header,.pricing-dialog>footer{flex:none;justify-content:space-between;align-items:center;gap:24px;display:flex}.pricing-dialog>header{border-bottom:1px solid #202b3d;padding:28px 32px 24px}.pricing-dialog>header>div{max-width:820px}.pricing-dialog>header small{color:#77bff2;letter-spacing:.12em;font-size:11px;font-weight:700}.pricing-dialog>header h1{margin:7px 0 8px;font-size:clamp(26px,2.2vw,34px);line-height:1.15}.pricing-dialog>header p{color:#94a3b8;margin:0;line-height:1.55}.pricing-dialog small{color:#8391a7}.pricing-dialog button{color:#eaf3ff;cursor:pointer;background:#111a29;border:1px solid #34445e;border-radius:11px;padding:11px 16px;transition:border-color .16s,background .16s,transform .16s}.pricing-dialog button:hover:not(:disabled){background:#17243a;border-color:#5c7ca5}.pricing-dialog button:active:not(:disabled){transform:translateY(1px)}.pricing-dialog button:focus-visible,.pricing-dialog input:focus-visible,.pricing-dialog select:focus-visible{outline-offset:2px;outline:2px solid #65b8f3}.pricing-dialog>header>.pricing-back-button{color:#b9dafa;flex:none;align-items:center;gap:9px;padding:12px 16px;font-size:14px;display:inline-flex}.pricing-back-button span{font-size:18px;line-height:1}.pricing-fx-settings{background:#111a29ad;border:1px solid #24334a;border-radius:16px;grid-template-columns:minmax(0,1fr) minmax(260px,360px);align-items:end;gap:32px;margin:24px 32px 0;padding:20px 22px;display:grid}.pricing-fx-copy strong,.pricing-table-heading strong{color:#edf5ff;font-size:15px}.pricing-fx-copy p,.pricing-table-heading p{color:#8e9bb1;margin:7px 0 0;font-size:13px;line-height:1.5}.pricing-fx-settings label{color:#9fb0c8;letter-spacing:.04em;text-transform:uppercase;gap:8px;font-size:12px;font-weight:700;display:grid}.pricing-fx-input{background:#0c1422;border:1px solid #34465f;border-radius:11px;grid-template-columns:44px 1fr;align-items:center;display:grid;overflow:hidden}.pricing-fx-input>span{color:#75bff4;border-right:1px solid #2b3950;align-self:stretch;place-items:center;font-weight:800;display:grid}.pricing-dialog .pricing-fx-input input{background:0 0;border:0;border-radius:0;min-width:0}.pricing-table-heading{justify-content:space-between;align-items:end;gap:20px;padding:24px 34px 12px;display:flex}.pricing-table-heading>span{color:#8fc8f2;white-space:nowrap;background:#101c2c;border:1px solid #2c405c;border-radius:999px;padding:6px 10px;font-size:12px}.pricing-table-wrap{scrollbar-gutter:stable both-edges;margin:0 16px;padding:0 16px 24px;overflow:auto visible}.pricing-dialog table{border-collapse:separate;border-spacing:0;width:100%;min-width:1760px}.pricing-dialog th{z-index:2;color:#8fb9eb;text-align:left;letter-spacing:.09em;text-transform:uppercase;background:#0d1421;border-top:1px solid #202c40;border-bottom:1px solid #28364c;padding:14px 10px;font-size:10px;line-height:1.35;position:sticky;top:0}.pricing-dialog th:first-child{border-top-left-radius:12px;padding-left:14px}.pricing-dialog th:last-child{border-top-right-radius:12px}.pricing-dialog td{vertical-align:top;border-bottom:1px solid #1c2738;padding:12px 10px}.pricing-dialog tbody tr{transition:background .16s}.pricing-dialog tbody tr:hover{background:#3b82f60b}.pricing-dialog input,.pricing-dialog select{box-sizing:border-box;color:#eef5ff;background:#101827;border:1px solid #2e3e56;border-radius:10px;width:100%;min-width:116px;padding:11px 12px}.pricing-dialog input:hover,.pricing-dialog select:hover{border-color:#415978}.pricing-dialog td:first-child{min-width:240px;padding-left:14px}.pricing-dialog td:first-child input{min-width:220px}.pricing-dialog td:first-child small{margin:7px 2px 0;display:block}.pricing-dialog td:last-child{padding-right:14px}.pricing-dialog td:last-child button{color:#fca5a5;width:40px;height:40px;padding:0}.pricing-dialog>footer{z-index:4;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:#090e18f5;border-top:1px solid #202a3b;border-radius:0 0 24px 24px;margin-top:auto;padding:20px 32px 24px;position:sticky;bottom:0}.pricing-dialog>footer div{gap:12px;display:flex}.pricing-dialog>footer div button:last-child{background:#153550;border-color:#3d7eb0}@media (width<=760px){.pricing-backdrop{padding:10px}.pricing-dialog{border-radius:18px;min-height:calc(100vh - 20px)}.pricing-dialog>header{align-items:flex-start;padding:22px 20px 20px}.pricing-dialog>header p{font-size:13px}.pricing-dialog>header>.pricing-back-button{padding:10px 12px;font-size:0}.pricing-dialog>header>.pricing-back-button span{font-size:20px}.pricing-fx-settings{grid-template-columns:1fr;gap:18px;margin:18px 20px 0;padding:18px}.pricing-table-heading{padding:22px 22px 10px}.pricing-table-wrap{margin:0 8px;padding:0 12px 14px}.pricing-dialog>footer{flex-direction:column;align-items:stretch;padding:16px 20px 20px}.pricing-dialog>footer>button,.pricing-dialog>footer div,.pricing-dialog>footer div button{width:100%}}.cost-guide{color:#eaf3ff;background:radial-gradient(circle at 80% 0,#00b0f01a,#0000 34%),#070b13;min-height:100vh;padding:clamp(18px,4vw,56px)}.cost-guide>header,.cost-guide-controls,.cost-guide-section,.cost-guide-final-note{width:min(1160px,100%);margin-inline:auto}.cost-guide>header{justify-content:space-between;align-items:flex-start;gap:24px;display:flex}.cost-guide small{color:#7dd3fc;letter-spacing:.12em;font-weight:800}.cost-guide h1{margin:8px 0;font-size:clamp(2rem,4vw,3.25rem)}.cost-guide h2,.cost-guide h3{margin-top:0}.cost-guide p{color:#a9b8ca;line-height:1.6}.cost-guide button,.cost-guide select{color:#eaf3ff;background:#101a2a;border:1px solid #36506e;border-radius:11px;padding:11px 14px}.cost-guide button{cursor:pointer}.cost-guide-controls{gap:14px;margin-block:28px;display:flex}.cost-guide-controls label{color:#9fb8d4;gap:7px;font-size:.82rem;display:grid}.cost-guide-section{background:#0c1421;border:1px solid #24354b;border-radius:18px;margin-block:22px;padding:clamp(18px,3vw,28px)}.cost-guide-section-heading{max-width:780px;margin-bottom:20px}.cost-guide-section-heading p{margin-bottom:0}.cost-guide-table-wrap{overflow-x:auto}.cost-guide table{border-collapse:collapse;width:100%;min-width:650px}.cost-guide caption{color:#7dd3fc;text-align:left;padding:0 0 12px}.cost-guide th,.cost-guide td{text-align:left;border-bottom:1px solid #25364b;padding:12px}.cost-guide thead{color:#7dd3fc}.cost-guide-blocks{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.cost-guide-blocks article,.cost-guide-example-card{background:#0f1a2a;border:1px solid #263c55;border-radius:14px;padding:18px}.cost-guide-blocks strong{color:#ddecff}.cost-guide-blocks p{margin:8px 0 0;font-size:.92rem}.cost-guide-example-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;display:grid}.cost-guide-calculation{gap:4px;display:grid}.cost-guide-calculation-head,.cost-guide-calculation-line{grid-template-columns:minmax(95px,.7fr) minmax(260px,2fr) minmax(90px,.7fr);align-items:center;gap:12px;display:grid}.cost-guide-calculation-head{color:#7890aa;text-transform:uppercase;font-size:.75rem}.cost-guide-calculation-line{border-bottom:1px solid #223348;padding-block:9px}.cost-guide-calculation-line code,.cost-guide-speed code{color:#b9d5ee;white-space:normal;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.78rem}.cost-guide-calculation-line>span,.cost-guide-calculation-total>span{text-align:right}.cost-guide-calculation-total{color:#7dd3fc;justify-content:space-between;gap:16px;padding-top:14px;font-size:1.05rem;display:flex}.cost-guide-speed,.cost-guide-context-summary{background:#0b1b2b;border:1px solid #285579;border-radius:13px;flex-wrap:wrap;align-items:center;gap:12px 20px;margin-top:16px;padding:14px 16px;display:flex}.cost-guide-speed strong{color:#7dd3fc;font-size:1.3rem}.cost-guide-context-summary{color:#adc3d9;margin-bottom:18px}.cost-guide-unavailable,.cost-guide-unavailable-combination{background:#2a210b66;border:1px solid #8a6b22;border-radius:12px;padding:16px;color:#fcd34d!important}.cost-guide-unavailable-combination{margin-top:18px}.cost-guide-unavailable-combination p{margin:6px 0 0}.cost-guide-final-note{box-sizing:border-box;color:#d7e8fa;background:#0c1726;border-left:4px solid #38bdf8;border-radius:8px 14px 14px 8px;padding:20px;line-height:1.6}@media (width<=900px){.cost-guide-example-grid{grid-template-columns:1fr}}@media (width<=760px){.cost-guide>header,.cost-guide-controls{flex-direction:column}.cost-guide-blocks{grid-template-columns:1fr}.cost-guide-calculation-head{display:none}.cost-guide-calculation-line{grid-template-columns:1fr;gap:5px}.cost-guide-calculation-line>span{text-align:left}}
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-D9-fqq9M.js";import{S as t,x as n}from"./cost-monitor-Cpp8xFij.js";var r=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,oe());else{var t=n(l);t!==null&&le(x,t.startTime-e)}}var ee=!1,te=-1,ne=5,re=-1;function ie(){return g?!0:!(e.unstable_now()-re<ne)}function ae(){if(g=!1,ee){var t=e.unstable_now();re=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(te),te=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ie());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&le(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?oe():ee=!1}}}var oe;if(typeof y==`function`)oe=function(){y(ae)};else if(typeof MessageChannel<`u`){var se=new MessageChannel,ce=se.port2;se.port1.onmessage=ae,oe=function(){ce.postMessage(null)}}else oe=function(){_(ae,0)};function le(t,n){te=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ne=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,le(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,oe()))),r},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i=e(((e,t)=>{t.exports=r()})),a=e((e=>{var r=i(),a=t(),o=n();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),te=Symbol.for(`react.context`),ne=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.memo_cache_sentinel`),le=Symbol.iterator;function ue(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var de=Symbol.for(`react.client.reference`);function fe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case te:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var pe=Array.isArray,S=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},he=[],ge=-1;function _e(e){return{current:e}}function w(e){0>ge||(e.current=he[ge],he[ge]=null,ge--)}function T(e,t){ge++,he[ge]=e.current,e.current=t}var ve=_e(null),ye=_e(null),be=_e(null),xe=_e(null);function Se(e,t){switch(T(be,t),T(ye,e),T(ve,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}w(ve),T(ve,e)}function Ce(){w(ve),w(ye),w(be)}function we(e){e.memoizedState!==null&&T(xe,e);var t=ve.current,n=Hd(t,e.type);t!==n&&(T(ye,e),T(ve,n))}function Te(e){ye.current===e&&(w(ve),w(ye)),xe.current===e&&(w(xe),Qf._currentValue=me)}var Ee,De;function Oe(e){if(Ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||``,De=-1<e.stack.indexOf(`
1
+ import{t as e}from"./rolldown-runtime-D9-fqq9M.js";import{S as t,x as n}from"./cost-monitor-Csj6LiAt.js";var r=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,oe());else{var t=n(l);t!==null&&le(x,t.startTime-e)}}var ee=!1,te=-1,ne=5,re=-1;function ie(){return g?!0:!(e.unstable_now()-re<ne)}function ae(){if(g=!1,ee){var t=e.unstable_now();re=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(te),te=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ie());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&le(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?oe():ee=!1}}}var oe;if(typeof y==`function`)oe=function(){y(ae)};else if(typeof MessageChannel<`u`){var se=new MessageChannel,ce=se.port2;se.port1.onmessage=ae,oe=function(){ce.postMessage(null)}}else oe=function(){_(ae,0)};function le(t,n){te=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ne=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,le(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,oe()))),r},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i=e(((e,t)=>{t.exports=r()})),a=e((e=>{var r=i(),a=t(),o=n();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),te=Symbol.for(`react.context`),ne=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.memo_cache_sentinel`),le=Symbol.iterator;function ue(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var de=Symbol.for(`react.client.reference`);function fe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case te:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var pe=Array.isArray,S=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},he=[],ge=-1;function _e(e){return{current:e}}function w(e){0>ge||(e.current=he[ge],he[ge]=null,ge--)}function T(e,t){ge++,he[ge]=e.current,e.current=t}var ve=_e(null),ye=_e(null),be=_e(null),xe=_e(null);function Se(e,t){switch(T(be,t),T(ye,e),T(ve,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}w(ve),T(ve,e)}function Ce(){w(ve),w(ye),w(be)}function we(e){e.memoizedState!==null&&T(xe,e);var t=ve.current,n=Hd(t,e.type);t!==n&&(T(ye,e),T(ve,n))}function Te(e){ye.current===e&&(w(ve),w(ye)),xe.current===e&&(w(xe),Qf._currentValue=me)}var Ee,De;function Oe(e){if(Ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||``,De=-1<e.stack.indexOf(`
2
2
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
3
  `+Ee+e+De}var ke=!1;function Ae(e,t){if(!e||ke)return``;ke=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
4
  `),l=s.split(`
@@ -1 +1 @@
1
- import{S as e,_ as t,b as n,c as r,d as i,f as a,l as o,o as s,p as c,s as l,u,v as d,y as f}from"./cost-monitor-Cpp8xFij.js";import{a as p,c as m,d as h,f as g,i as _,l as v,m as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E}from"./icons-vendor-CR4Fbf3g.js";var D=e(),O=n();function k({ariaLabel:e,closeLabel:t,document:n,onClose:r}){return(0,O.jsxs)(`section`,{"aria-label":e,"aria-modal":`true`,className:`trace-document`,role:`dialog`,children:[(0,O.jsxs)(`header`,{children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`small`,{children:n.path}),(0,O.jsx)(`h2`,{children:n.title})]}),(0,O.jsx)(`button`,{"aria-label":t,className:`trace-close-button`,onClick:r,type:`button`,children:(0,O.jsx)(s,{"aria-hidden":`true`,size:20,strokeWidth:2})})]}),(0,O.jsx)(`pre`,{children:n.content})]})}function A({stage:e,stageRecord:t,documents:n,stageCopy:r,stageArtifacts:i,copy:o,onBack:s,onOpenDocument:l,onStageChange:u}){let d=[`definition`,`planning`,`execution`,`decisions`,`verification`,`evidence`],f=d.indexOf(e),m=d[f-1],h=d[f+1],g=n.filter(e=>e.kind===`evidence`).length,_=new Set(n.map(e=>e.kind)).size,v=new Map;for(let e of n)v.set(e.kind,[...v.get(e.kind)??[],e]);let y=t?.last_recorded_at??o.pending;return(0,O.jsxs)(`section`,{className:`trace-stage-detail`,children:[(0,O.jsx)(`header`,{children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{children:r[e].label}),(0,O.jsx)(`h3`,{children:i[e]}),(0,O.jsx)(`small`,{children:y})]})}),(0,O.jsxs)(`div`,{className:`trace-stage-metrics`,children:[(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{children:o.documents}),(0,O.jsx)(`strong`,{children:n.length})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{children:o.types}),(0,O.jsx)(`strong`,{children:_})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{children:o.evidenceMetric}),(0,O.jsx)(`strong`,{children:g})]})]}),(0,O.jsx)(`div`,{className:`trace-stage-documents`,children:n.length===0?(0,O.jsx)(`p`,{className:`trace-stage-empty`,children:o.empty}):[...v].map(([e,t])=>(0,O.jsxs)(`section`,{className:`trace-document-group`,children:[(0,O.jsxs)(`h4`,{children:[e,` `,(0,O.jsx)(`small`,{children:t.length})]}),t.map(e=>(0,O.jsxs)(`button`,{onClick:()=>l(e),type:`button`,children:[(0,O.jsx)(`strong`,{children:e.title}),(0,O.jsx)(`small`,{children:e.path})]},e.id))]},e))}),(0,O.jsxs)(`nav`,{"aria-label":o.navigation,className:`trace-stage-navigation`,children:[(0,O.jsxs)(`button`,{className:`trace-navigation-action trace-navigation-previous`,disabled:f===0,onClick:()=>u(d[f-1]),type:`button`,children:[(0,O.jsx)(c,{"aria-hidden":`true`,size:18,strokeWidth:1.9}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`small`,{children:o.previous}),(0,O.jsx)(`strong`,{children:m?r[m].label.split(` (`)[0]:`—`})]})]}),(0,O.jsxs)(`div`,{className:`trace-navigation-center`,children:[(0,O.jsx)(`div`,{"aria-hidden":`true`,className:`trace-navigation-progress`,children:d.map((t,n)=>(0,O.jsx)(`span`,{"data-active":t===e,"data-passed":n<f},t))}),(0,O.jsxs)(`small`,{children:[f+1,` `,o.of,` `,d.length]}),(0,O.jsxs)(`button`,{className:`trace-all-stages-button`,onClick:s,type:`button`,children:[(0,O.jsx)(p,{"aria-hidden":`true`,size:15,strokeWidth:1.9}),o.back]})]}),(0,O.jsxs)(`button`,{className:`trace-navigation-action trace-navigation-next`,disabled:f===d.length-1,onClick:()=>u(d[f+1]),type:`button`,children:[(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`small`,{children:o.next}),(0,O.jsx)(`strong`,{children:h?r[h].label.split(` (`)[0]:`—`})]}),(0,O.jsx)(a,{"aria-hidden":`true`,size:18,strokeWidth:1.9})]})]})]})}function j({ariaLabel:e,children:t,closeLabel:n,onClose:r}){return(0,D.useEffect)(()=>{let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,O.jsxs)(`div`,{className:`trace-stage-dialog-backdrop`,role:`presentation`,children:[(0,O.jsx)(`button`,{"aria-label":n,className:`trace-stage-dialog-backdrop-dismiss`,onClick:r,type:`button`}),(0,O.jsxs)(`section`,{"aria-label":e,"aria-modal":`true`,className:`trace-stage-dialog`,role:`dialog`,children:[(0,O.jsx)(`button`,{"aria-label":n,className:`trace-stage-dialog-close`,onClick:r,type:`button`,children:(0,O.jsx)(s,{"aria-hidden":`true`,size:22})}),t]})]})}var M=[`definition`,`planning`,`execution`,`decisions`,`verification`,`evidence`],N=[`task`,`change`,`spec`,`prd`],P=[`coverage`,`documents`,`evidence`,`links`],F={"pt-BR":{lite:`Leve`,standard:`Padrão`,critical:`Crítico`},"en-US":{lite:`Lite`,standard:`Standard`,critical:`Critical`}},I={definition:E,planning:o,execution:C,decisions:x,verification:b,evidence:m},L={definition:`PRD · Requisitos`,planning:`SPEC · Change`,execution:`Tarefas · DAG · Runs · arquivos`,decisions:`Decisões do planejamento e da execução`,verification:`Testes · revisões · evals · checks`,evidence:`Evidências · resultados · rastreabilidade`},R={definition:`PRD · Requirements`,planning:`SPEC · Change`,execution:`Tasks · DAG · Runs · files`,decisions:`Planning and execution decisions`,verification:`Tests · reviews · evals · checks`,evidence:`Evidence · results · traceability`};function z(e,t){return[{label:`Task`,value:e.task_id,onOpen:void 0},{label:`Change`,value:e.change_id,onOpen:t.onOpenChange},{label:`SPEC`,value:e.spec_id,onOpen:t.onOpenSpec},{label:`PRD`,value:e.prd_id,onOpen:t.onOpenPrd}]}var B={definition:{label:`Definição (PRD + Requisitos)`,description:`Objetivo, contexto e critérios que definem o trabalho.`},planning:{label:`Planejamento (SPEC + Change)`,description:`Escopo, solução e mudanças previstas antes da execução.`},execution:{label:`Execução (Tarefas ou DAG)`,description:`Tarefas, dependências da DAG, Runs e arquivos produzidos.`},decisions:{label:`Decisões (Plano e Execução)`,description:`Decisões humanas e da IA tomadas no planejamento e na execução.`},verification:{label:`Verificação (Testes + Revisões)`,description:`Testes, revisões, evals e checks comparam o resultado aos Critérios de Aceite.`},evidence:{label:`Evidências (Resultados + Rastreabilidade)`,description:`Provas reproduzíveis vinculadas às Tasks, Changes, Runs e Critérios de Aceite.`}},V={definition:{label:`Definition (PRD + Requirements)`,description:`Objective, context, and criteria that define the work.`},planning:{label:`Planning (SPEC + Change)`,description:`Scope, solution, and changes planned before execution.`},execution:{label:`Execution (Tasks or DAG)`,description:`Tasks, DAG dependencies, Runs, and produced files.`},decisions:{label:`Decisions (Plan and Execution)`,description:`Human and AI decisions made during planning and execution.`},verification:{label:`Verification (Tests + Reviews)`,description:`Tests, reviews, evals, and checks compare results with acceptance criteria.`},evidence:{label:`Evidence (Results + Traceability)`,description:`Reproducible proof linked to Tasks, Changes, Runs, and acceptance criteria.`}},H={"pt-BR":{aria:`Rastreabilidade da task`,coverage:`etapas rastreadas`,evidence:`evidências`,close:`Fechar`,empty:`Nenhum documento relacionado.`,closeDocument:`Fechar documento`,back:`Voltar às etapas`,previous:`Anterior`,next:`Próxima`,documents:`Documentos`,types:`Tipos`,evidenceMetric:`Evidências`,taskFirst:`Task-first`,specDriven:`Spec-driven`,copyId:`Copiar ID`,copied:`ID copiado`,unlinked:`Não vinculado`,recorded:`Registrada em`,pending:`Pendente`,missingTimestamp:`Sem data/hora`,tests:`testes registrados`,time:`Tempo`,tokens:`Tokens`,cost:`Custo`,measuredRuns:`Runs medidas`,items:`itens`,navigation:`Navegação entre etapas`,of:`de`,stageDetails:`Detalhes da etapa`,document:`Documento`},"en-US":{aria:`Task traceability`,coverage:`tracked stages`,evidence:`evidence items`,close:`Close`,empty:`No related document.`,closeDocument:`Close document`,back:`Back to stages`,previous:`Previous`,next:`Next`,documents:`Documents`,types:`Types`,evidenceMetric:`Evidence`,taskFirst:`Task-first`,specDriven:`Spec-driven`,copyId:`Copy ID`,copied:`ID copied`,unlinked:`Not linked`,recorded:`Recorded at`,pending:`Pending`,missingTimestamp:`Missing date/time`,tests:`recorded tests`,time:`Time`,tokens:`Tokens`,cost:`Cost`,measuredRuns:`measured Runs`,items:`items`,navigation:`Stage navigation`,of:`of`,stageDetails:`Stage details`,document:`Document`}};function U({taskId:e,locale:t=`pt-BR`}){let n=t===`pt-BR`;return(0,O.jsx)(`div`,{className:`trace-backdrop`,children:(0,O.jsxs)(`section`,{"aria-busy":`true`,"aria-label":n?`Carregando rastreabilidade`:`Loading traceability`,"aria-live":`polite`,className:`trace-panel trace-loading-panel`,role:`dialog`,children:[(0,O.jsxs)(`header`,{className:`trace-panel-header`,children:[(0,O.jsxs)(`div`,{className:`trace-heading`,children:[(0,O.jsx)(`span`,{className:`trace-heading-icon trace-loading-icon`,"aria-hidden":`true`,children:(0,O.jsx)(r,{size:22,strokeWidth:1.8})}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,O.jsx)(`h2`,{children:n?`Carregando rastreabilidade`:`Loading traceability`}),(0,O.jsx)(`p`,{children:e})]})]}),(0,O.jsxs)(`span`,{className:`trace-loading-status`,children:[(0,O.jsx)(r,{"aria-hidden":`true`,size:15,strokeWidth:2}),n?`Preparando trace`:`Preparing trace`]})]}),(0,O.jsx)(`div`,{className:`trace-loading-identifiers`,"aria-hidden":`true`,children:N.map(e=>(0,O.jsx)(`span`,{},e))}),(0,O.jsx)(`div`,{className:`trace-loading-metrics`,"aria-hidden":`true`,children:P.map(e=>(0,O.jsx)(`span`,{},e))}),(0,O.jsx)(`div`,{className:`trace-loading-stages`,"aria-hidden":`true`,children:M.map(e=>(0,O.jsx)(`span`,{},e))})]})})}function W({trace:e,locale:t=`pt-BR`,onClose:n,onOpenChange:r,onOpenPrd:o,onOpenSpec:c,embedded:d=!1}){let[f,p]=(0,D.useState)(null),[m,x]=(0,D.useState)(null),[C,E]=(0,D.useState)(!1),N=H[t],P=t===`en-US`?V:B,U=t===`en-US`?R:L,W=(0,D.useMemo)(()=>new Map(M.map(t=>[t,e.documents.filter(e=>e.stage===t)])),[e.documents]),K=(0,D.useMemo)(()=>new Map(e.stages.map(e=>[e.stage,e])),[e.stages]),Y=Math.round(e.coverage.stages_with_timestamps/e.coverage.total_stages*100),X=[e.task_id,e.change_id,e.spec_id,e.prd_id].filter(Boolean).length,Z=z(e,{onOpenChange:r,onOpenPrd:o,onOpenSpec:c}),Q=q(e.task_created_at,t),$=J(e.task_created_at,t),ee=async()=>{try{await navigator.clipboard.writeText(e.task_id),E(!0),window.setTimeout(()=>E(!1),2e3)}catch{E(!1)}};return(0,O.jsxs)(`div`,{className:d?`trace-embedded`:`trace-backdrop`,children:[(0,O.jsxs)(`section`,{"aria-label":N.aria,"aria-modal":d?void 0:`true`,className:`trace-panel`,role:`dialog`,children:[(0,O.jsxs)(`header`,{className:`trace-panel-header`,children:[(0,O.jsxs)(`div`,{className:`trace-heading`,children:[(0,O.jsx)(`span`,{className:`trace-heading-icon`,"aria-hidden":`true`,children:(0,O.jsx)(l,{size:22,strokeWidth:1.8})}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,O.jsx)(`div`,{className:`trace-heading-title`,children:(0,O.jsxs)(`h2`,{children:[(0,O.jsx)(`span`,{className:`trace-title-prefix`,children:`Trace:`}),` `,e.task_title||e.task_id]})}),(0,O.jsx)(`p`,{children:t===`pt-BR`?`Visão completa do ciclo de desenvolvimento`:`Complete development lifecycle view`})]})]}),(0,O.jsxs)(`div`,{className:`trace-header-actions`,children:[(0,O.jsx)(G,{copy:N,locale:t,usage:e.usage}),d?null:(0,O.jsx)(`button`,{className:`trace-close-button`,"aria-label":N.close,onClick:n,type:`button`,children:(0,O.jsx)(s,{"aria-hidden":`true`,size:20,strokeWidth:2})})]})]}),(0,O.jsxs)(`section`,{className:`trace-task-summary`,"aria-label":t===`pt-BR`?`Resumo da tarefa`:`Task summary`,children:[(0,O.jsxs)(`article`,{children:[(0,O.jsx)(S,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,O.jsx)(`span`,{children:t===`pt-BR`?`Criada em`:`Created at`}),(0,O.jsx)(`strong`,{children:Q})]})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(u,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,O.jsx)(`span`,{children:t===`pt-BR`?`Desde a criação`:`Since creation`}),(0,O.jsx)(`strong`,{children:$})]})]}),(0,O.jsxs)(`article`,{className:`trace-task-progress`,children:[(0,O.jsx)(h,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content trace-task-progress-content`,children:[(0,O.jsx)(`span`,{children:t===`pt-BR`?`Progresso`:`Progress`}),(0,O.jsxs)(`strong`,{children:[e.task_progress,`%`]}),(0,O.jsx)(`progress`,{max:100,value:e.task_progress})]})]}),(0,O.jsxs)(`article`,{className:`trace-task-classification`,children:[(0,O.jsx)(y,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,O.jsx)(`span`,{children:t===`pt-BR`?`Classificação`:`Classification`}),(0,O.jsxs)(`div`,{className:`trace-task-badges`,children:[(0,O.jsxs)(`span`,{className:`trace-mode-badge`,children:[(0,O.jsx)(T,{"aria-hidden":`true`,size:12,strokeWidth:2}),e.spec_id===null?N.taskFirst:N.specDriven]}),e.task_risk?(0,O.jsxs)(`span`,{className:`trace-risk-badge`,"data-risk":e.task_risk,children:[(0,O.jsx)(b,{"aria-hidden":`true`,size:12,strokeWidth:2}),F[t][e.task_risk]]}):null]})]})]})]}),(0,O.jsx)(`section`,{className:`trace-overview trace-lineage`,"aria-label":t===`pt-BR`?`Identificadores vinculados`:`Linked identifiers`,children:Z.map(({label:e,value:n,onOpen:r})=>{let i=n!==null&&r!==void 0,o=e===`Task`&&n!==null,s=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`trace-identifier-content`,children:[(0,O.jsxs)(`span`,{children:[(0,O.jsx)(_,{"aria-hidden":`true`,size:11,strokeWidth:2}),e]}),(0,O.jsx)(`strong`,{title:n??N.unlinked,children:n??N.unlinked})]}),o?(0,O.jsx)(`button`,{"aria-label":C?t===`pt-BR`?`ID da tarefa copiado`:`Task ID copied`:t===`pt-BR`?`Copiar ID da tarefa`:`Copy task ID`,className:`trace-identifier-copy`,onClick:()=>void ee(),title:C?t===`pt-BR`?`Copiado`:`Copied`:void 0,type:`button`,children:C?(0,O.jsx)(g,{"aria-hidden":`true`,size:15}):(0,O.jsx)(v,{"aria-hidden":`true`,size:15})}):null,i?(0,O.jsx)(a,{"aria-hidden":`true`,size:15,strokeWidth:1.9}):null]});return(0,O.jsx)(`article`,{"data-empty":n===null,"data-linked":n!==null,"data-navigable":i,children:i?(0,O.jsx)(`button`,{"aria-label":`${t===`pt-BR`?`Abrir`:`Open`} ${e}: ${n}`,className:`trace-identifier-navigation`,onClick:()=>r(n),type:`button`,children:s}):(0,O.jsx)(`div`,{className:`trace-identifier-static`,children:s})},e)})}),(0,O.jsxs)(`section`,{className:`trace-metrics`,"aria-label":t===`pt-BR`?`Resumo da rastreabilidade`:`Traceability summary`,children:[(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{className:`trace-metric-icon`,children:(0,O.jsx)(l,{"aria-hidden":`true`,size:18})}),(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`strong`,{children:[Y,`%`]}),(0,O.jsx)(`span`,{children:N.coverage})]}),(0,O.jsxs)(`small`,{children:[e.coverage.stages_with_timestamps,` `,N.of,` `,e.coverage.total_stages]})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{className:`trace-metric-icon`,children:(0,O.jsx)(w,{"aria-hidden":`true`,size:18})}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`strong`,{children:e.documents.length}),(0,O.jsx)(`span`,{children:N.documents})]}),(0,O.jsx)(`small`,{children:t===`pt-BR`?`no ciclo completo`:`in the full lifecycle`})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{className:`trace-metric-icon`,children:(0,O.jsx)(y,{"aria-hidden":`true`,size:18})}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`strong`,{children:e.coverage.evidence_count}),(0,O.jsx)(`span`,{children:N.evidenceMetric})]}),(0,O.jsxs)(`small`,{children:[e.coverage.test_count,` `,N.tests]})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{className:`trace-metric-icon`,children:(0,O.jsx)(_,{"aria-hidden":`true`,size:18})}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`strong`,{children:X}),(0,O.jsx)(`span`,{children:t===`pt-BR`?`Vínculos`:`Links`})]}),(0,O.jsx)(`small`,{children:`Task · Change · SPEC · PRD`})]})]}),(0,O.jsx)(`div`,{className:`trace-stage-menu`,children:M.map((e,n)=>{let r=I[e],o=(W.get(e)??[]).length;return(0,O.jsxs)(`button`,{className:`trace-stage-menu-button`,"data-stage":e,onClick:()=>x(e),type:`button`,children:[(0,O.jsx)(`span`,{className:`trace-stage-number`,children:String(n+1).padStart(2,`0`)}),(0,O.jsx)(r,{className:`trace-stage-icon`,"aria-hidden":`true`,size:22,strokeWidth:1.8}),(0,O.jsx)(`strong`,{children:P[e].label}),(0,O.jsx)(`em`,{children:P[e].description}),(0,O.jsxs)(`span`,{className:`trace-stage-action`,children:[(0,O.jsxs)(`small`,{children:[(0,O.jsx)(i,{"aria-hidden":`true`,size:13}),` `,o,` `,N.items]}),(0,O.jsxs)(`span`,{children:[t===`pt-BR`?`Ver etapa`:`View stage`,(0,O.jsx)(a,{"aria-hidden":`true`,size:13,strokeWidth:2})]})]})]},e)})})]}),m?(0,O.jsx)(j,{ariaLabel:N.stageDetails,closeLabel:t===`pt-BR`?`Fechar detalhes da etapa`:`Close stage details`,onClose:()=>x(null),children:(0,O.jsx)(A,{copy:N,documents:W.get(m)??[],locale:t,onBack:()=>x(null),onOpenDocument:p,onStageChange:x,stage:m,stageArtifacts:U,stageRecord:K.get(m),stageCopy:P})}):null,f?(0,O.jsx)(k,{ariaLabel:`${N.document} ${f.title}`,closeLabel:N.closeDocument,document:f,onClose:()=>p(null)}):null]})}function G({usage:e,locale:n,copy:r}){let i=[{label:r.time,metric:e.duration_ms,value:K(e.duration_ms.value,n)},{label:r.tokens,metric:e.total_tokens,value:e.total_tokens.value===null?`—`:t(e.total_tokens.value,n)},{label:r.cost,metric:e.cost,value:e.cost.value===null||e.cost.currency===null?`—`:d(e.cost.value,e.cost.currency,n)}];return(0,O.jsx)(`section`,{"aria-label":n===`pt-BR`?`Uso agregado da Task`:`Aggregated Task usage`,children:(0,O.jsx)(`dl`,{className:`trace-usage-strip`,children:i.map(({label:t,metric:n,value:i})=>{let a=Math.round(n.coverage_ratio*100),o=`${n.known_runs}/${e.run_count} ${r.measuredRuns} · ${a}%`;return(0,O.jsxs)(`div`,{title:o,children:[(0,O.jsxs)(`dt`,{children:[t,(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`trace-usage-coverage`,"data-complete":n.unknown_runs===0}),(0,O.jsx)(`span`,{className:`trace-usage-sr-only`,children:o})]}),(0,O.jsx)(`dd`,{children:i})]},t)})})})}function K(e,t){return e===null?`—`:f(e,t)}function q(e,t){if(e===null)return`—`;let n=new Date(e);return Number.isNaN(n.getTime())?`—`:new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`short`}).format(n)}function J(e,t){if(e===null)return`—`;let n=Date.parse(e);if(!Number.isFinite(n))return`—`;let r=Math.max(0,Date.now()-n),i=Math.max(1,Math.round(r/6e4)),a;if(i<60)a=`${i}m`;else{let e=Math.round(i/60);if(e<24)a=`${e}h`;else{let n=Math.round(e/24);if(n<7)a=`${n}d`;else{let e=Math.round(n/7);a=t===`pt-BR`?`${e}sem`:`${e}w`}}}return t===`pt-BR`?`Há ${a}`:`${a} ago`}export{W as n,U as t};
1
+ import{S as e,_ as t,b as n,c as r,d as i,f as a,l as o,o as s,p as c,s as l,u,v as d,y as f}from"./cost-monitor-Csj6LiAt.js";import{a as p,c as m,d as h,f as g,i as _,l as v,m as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E}from"./icons-vendor-VyTTl_ph.js";var D=e(),O=n();function k({ariaLabel:e,closeLabel:t,document:n,onClose:r}){return(0,O.jsxs)(`section`,{"aria-label":e,"aria-modal":`true`,className:`trace-document`,role:`dialog`,children:[(0,O.jsxs)(`header`,{children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`small`,{children:n.path}),(0,O.jsx)(`h2`,{children:n.title})]}),(0,O.jsx)(`button`,{"aria-label":t,className:`trace-close-button`,onClick:r,type:`button`,children:(0,O.jsx)(s,{"aria-hidden":`true`,size:20,strokeWidth:2})})]}),(0,O.jsx)(`pre`,{children:n.content})]})}function A({stage:e,stageRecord:t,documents:n,stageCopy:r,stageArtifacts:i,copy:o,onBack:s,onOpenDocument:l,onStageChange:u}){let d=[`definition`,`planning`,`execution`,`decisions`,`verification`,`evidence`],f=d.indexOf(e),m=d[f-1],h=d[f+1],g=n.filter(e=>e.kind===`evidence`).length,_=new Set(n.map(e=>e.kind)).size,v=new Map;for(let e of n)v.set(e.kind,[...v.get(e.kind)??[],e]);let y=t?.last_recorded_at??o.pending;return(0,O.jsxs)(`section`,{className:`trace-stage-detail`,children:[(0,O.jsx)(`header`,{children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{children:r[e].label}),(0,O.jsx)(`h3`,{children:i[e]}),(0,O.jsx)(`small`,{children:y})]})}),(0,O.jsxs)(`div`,{className:`trace-stage-metrics`,children:[(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{children:o.documents}),(0,O.jsx)(`strong`,{children:n.length})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{children:o.types}),(0,O.jsx)(`strong`,{children:_})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{children:o.evidenceMetric}),(0,O.jsx)(`strong`,{children:g})]})]}),(0,O.jsx)(`div`,{className:`trace-stage-documents`,children:n.length===0?(0,O.jsx)(`p`,{className:`trace-stage-empty`,children:o.empty}):[...v].map(([e,t])=>(0,O.jsxs)(`section`,{className:`trace-document-group`,children:[(0,O.jsxs)(`h4`,{children:[e,` `,(0,O.jsx)(`small`,{children:t.length})]}),t.map(e=>(0,O.jsxs)(`button`,{onClick:()=>l(e),type:`button`,children:[(0,O.jsx)(`strong`,{children:e.title}),(0,O.jsx)(`small`,{children:e.path})]},e.id))]},e))}),(0,O.jsxs)(`nav`,{"aria-label":o.navigation,className:`trace-stage-navigation`,children:[(0,O.jsxs)(`button`,{className:`trace-navigation-action trace-navigation-previous`,disabled:f===0,onClick:()=>u(d[f-1]),type:`button`,children:[(0,O.jsx)(c,{"aria-hidden":`true`,size:18,strokeWidth:1.9}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`small`,{children:o.previous}),(0,O.jsx)(`strong`,{children:m?r[m].label.split(` (`)[0]:`—`})]})]}),(0,O.jsxs)(`div`,{className:`trace-navigation-center`,children:[(0,O.jsx)(`div`,{"aria-hidden":`true`,className:`trace-navigation-progress`,children:d.map((t,n)=>(0,O.jsx)(`span`,{"data-active":t===e,"data-passed":n<f},t))}),(0,O.jsxs)(`small`,{children:[f+1,` `,o.of,` `,d.length]}),(0,O.jsxs)(`button`,{className:`trace-all-stages-button`,onClick:s,type:`button`,children:[(0,O.jsx)(p,{"aria-hidden":`true`,size:15,strokeWidth:1.9}),o.back]})]}),(0,O.jsxs)(`button`,{className:`trace-navigation-action trace-navigation-next`,disabled:f===d.length-1,onClick:()=>u(d[f+1]),type:`button`,children:[(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`small`,{children:o.next}),(0,O.jsx)(`strong`,{children:h?r[h].label.split(` (`)[0]:`—`})]}),(0,O.jsx)(a,{"aria-hidden":`true`,size:18,strokeWidth:1.9})]})]})]})}function j({ariaLabel:e,children:t,closeLabel:n,onClose:r}){return(0,D.useEffect)(()=>{let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,O.jsxs)(`div`,{className:`trace-stage-dialog-backdrop`,role:`presentation`,children:[(0,O.jsx)(`button`,{"aria-label":n,className:`trace-stage-dialog-backdrop-dismiss`,onClick:r,type:`button`}),(0,O.jsxs)(`section`,{"aria-label":e,"aria-modal":`true`,className:`trace-stage-dialog`,role:`dialog`,children:[(0,O.jsx)(`button`,{"aria-label":n,className:`trace-stage-dialog-close`,onClick:r,type:`button`,children:(0,O.jsx)(s,{"aria-hidden":`true`,size:22})}),t]})]})}var M=[`definition`,`planning`,`execution`,`decisions`,`verification`,`evidence`],N=[`task`,`change`,`spec`,`prd`],P=[`coverage`,`documents`,`evidence`,`links`],F={"pt-BR":{lite:`Leve`,standard:`Padrão`,critical:`Crítico`},"en-US":{lite:`Lite`,standard:`Standard`,critical:`Critical`}},I={definition:E,planning:o,execution:C,decisions:x,verification:b,evidence:m},L={definition:`PRD · Requisitos`,planning:`SPEC · Change`,execution:`Tarefas · DAG · Runs · arquivos`,decisions:`Decisões do planejamento e da execução`,verification:`Testes · revisões · evals · checks`,evidence:`Evidências · resultados · rastreabilidade`},R={definition:`PRD · Requirements`,planning:`SPEC · Change`,execution:`Tasks · DAG · Runs · files`,decisions:`Planning and execution decisions`,verification:`Tests · reviews · evals · checks`,evidence:`Evidence · results · traceability`};function z(e,t){return[{label:`Task`,value:e.task_id,onOpen:void 0},{label:`Change`,value:e.change_id,onOpen:t.onOpenChange},{label:`SPEC`,value:e.spec_id,onOpen:t.onOpenSpec},{label:`PRD`,value:e.prd_id,onOpen:t.onOpenPrd}]}var B={definition:{label:`Definição (PRD + Requisitos)`,description:`Objetivo, contexto e critérios que definem o trabalho.`},planning:{label:`Planejamento (SPEC + Change)`,description:`Escopo, solução e mudanças previstas antes da execução.`},execution:{label:`Execução (Tarefas ou DAG)`,description:`Tarefas, dependências da DAG, Runs e arquivos produzidos.`},decisions:{label:`Decisões (Plano e Execução)`,description:`Decisões humanas e da IA tomadas no planejamento e na execução.`},verification:{label:`Verificação (Testes + Revisões)`,description:`Testes, revisões, evals e checks comparam o resultado aos Critérios de Aceite.`},evidence:{label:`Evidências (Resultados + Rastreabilidade)`,description:`Provas reproduzíveis vinculadas às Tasks, Changes, Runs e Critérios de Aceite.`}},V={definition:{label:`Definition (PRD + Requirements)`,description:`Objective, context, and criteria that define the work.`},planning:{label:`Planning (SPEC + Change)`,description:`Scope, solution, and changes planned before execution.`},execution:{label:`Execution (Tasks or DAG)`,description:`Tasks, DAG dependencies, Runs, and produced files.`},decisions:{label:`Decisions (Plan and Execution)`,description:`Human and AI decisions made during planning and execution.`},verification:{label:`Verification (Tests + Reviews)`,description:`Tests, reviews, evals, and checks compare results with acceptance criteria.`},evidence:{label:`Evidence (Results + Traceability)`,description:`Reproducible proof linked to Tasks, Changes, Runs, and acceptance criteria.`}},H={"pt-BR":{aria:`Rastreabilidade da task`,coverage:`etapas rastreadas`,evidence:`evidências`,close:`Fechar`,empty:`Nenhum documento relacionado.`,closeDocument:`Fechar documento`,back:`Voltar às etapas`,previous:`Anterior`,next:`Próxima`,documents:`Documentos`,types:`Tipos`,evidenceMetric:`Evidências`,taskFirst:`Task-first`,specDriven:`Spec-driven`,copyId:`Copiar ID`,copied:`ID copiado`,unlinked:`Não vinculado`,recorded:`Registrada em`,pending:`Pendente`,missingTimestamp:`Sem data/hora`,tests:`testes registrados`,time:`Tempo`,tokens:`Tokens`,cost:`Custo`,measuredRuns:`Runs medidas`,items:`itens`,navigation:`Navegação entre etapas`,of:`de`,stageDetails:`Detalhes da etapa`,document:`Documento`},"en-US":{aria:`Task traceability`,coverage:`tracked stages`,evidence:`evidence items`,close:`Close`,empty:`No related document.`,closeDocument:`Close document`,back:`Back to stages`,previous:`Previous`,next:`Next`,documents:`Documents`,types:`Types`,evidenceMetric:`Evidence`,taskFirst:`Task-first`,specDriven:`Spec-driven`,copyId:`Copy ID`,copied:`ID copied`,unlinked:`Not linked`,recorded:`Recorded at`,pending:`Pending`,missingTimestamp:`Missing date/time`,tests:`recorded tests`,time:`Time`,tokens:`Tokens`,cost:`Cost`,measuredRuns:`measured Runs`,items:`items`,navigation:`Stage navigation`,of:`of`,stageDetails:`Stage details`,document:`Document`}};function U({taskId:e,locale:t=`pt-BR`}){let n=t===`pt-BR`;return(0,O.jsx)(`div`,{className:`trace-backdrop`,children:(0,O.jsxs)(`section`,{"aria-busy":`true`,"aria-label":n?`Carregando rastreabilidade`:`Loading traceability`,"aria-live":`polite`,className:`trace-panel trace-loading-panel`,role:`dialog`,children:[(0,O.jsxs)(`header`,{className:`trace-panel-header`,children:[(0,O.jsxs)(`div`,{className:`trace-heading`,children:[(0,O.jsx)(`span`,{className:`trace-heading-icon trace-loading-icon`,"aria-hidden":`true`,children:(0,O.jsx)(r,{size:22,strokeWidth:1.8})}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,O.jsx)(`h2`,{children:n?`Carregando rastreabilidade`:`Loading traceability`}),(0,O.jsx)(`p`,{children:e})]})]}),(0,O.jsxs)(`span`,{className:`trace-loading-status`,children:[(0,O.jsx)(r,{"aria-hidden":`true`,size:15,strokeWidth:2}),n?`Preparando trace`:`Preparing trace`]})]}),(0,O.jsx)(`div`,{className:`trace-loading-identifiers`,"aria-hidden":`true`,children:N.map(e=>(0,O.jsx)(`span`,{},e))}),(0,O.jsx)(`div`,{className:`trace-loading-metrics`,"aria-hidden":`true`,children:P.map(e=>(0,O.jsx)(`span`,{},e))}),(0,O.jsx)(`div`,{className:`trace-loading-stages`,"aria-hidden":`true`,children:M.map(e=>(0,O.jsx)(`span`,{},e))})]})})}function W({trace:e,locale:t=`pt-BR`,onClose:n,onOpenChange:r,onOpenPrd:o,onOpenSpec:c,embedded:d=!1}){let[f,p]=(0,D.useState)(null),[m,x]=(0,D.useState)(null),[C,E]=(0,D.useState)(!1),N=H[t],P=t===`en-US`?V:B,U=t===`en-US`?R:L,W=(0,D.useMemo)(()=>new Map(M.map(t=>[t,e.documents.filter(e=>e.stage===t)])),[e.documents]),K=(0,D.useMemo)(()=>new Map(e.stages.map(e=>[e.stage,e])),[e.stages]),Y=Math.round(e.coverage.stages_with_timestamps/e.coverage.total_stages*100),X=[e.task_id,e.change_id,e.spec_id,e.prd_id].filter(Boolean).length,Z=z(e,{onOpenChange:r,onOpenPrd:o,onOpenSpec:c}),Q=q(e.task_created_at,t),$=J(e.task_created_at,t),ee=async()=>{try{await navigator.clipboard.writeText(e.task_id),E(!0),window.setTimeout(()=>E(!1),2e3)}catch{E(!1)}};return(0,O.jsxs)(`div`,{className:d?`trace-embedded`:`trace-backdrop`,children:[(0,O.jsxs)(`section`,{"aria-label":N.aria,"aria-modal":d?void 0:`true`,className:`trace-panel`,role:`dialog`,children:[(0,O.jsxs)(`header`,{className:`trace-panel-header`,children:[(0,O.jsxs)(`div`,{className:`trace-heading`,children:[(0,O.jsx)(`span`,{className:`trace-heading-icon`,"aria-hidden":`true`,children:(0,O.jsx)(l,{size:22,strokeWidth:1.8})}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,O.jsx)(`div`,{className:`trace-heading-title`,children:(0,O.jsxs)(`h2`,{children:[(0,O.jsx)(`span`,{className:`trace-title-prefix`,children:`Trace:`}),` `,e.task_title||e.task_id]})}),(0,O.jsx)(`p`,{children:t===`pt-BR`?`Visão completa do ciclo de desenvolvimento`:`Complete development lifecycle view`})]})]}),(0,O.jsxs)(`div`,{className:`trace-header-actions`,children:[(0,O.jsx)(G,{copy:N,locale:t,usage:e.usage}),d?null:(0,O.jsx)(`button`,{className:`trace-close-button`,"aria-label":N.close,onClick:n,type:`button`,children:(0,O.jsx)(s,{"aria-hidden":`true`,size:20,strokeWidth:2})})]})]}),(0,O.jsxs)(`section`,{className:`trace-task-summary`,"aria-label":t===`pt-BR`?`Resumo da tarefa`:`Task summary`,children:[(0,O.jsxs)(`article`,{children:[(0,O.jsx)(S,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,O.jsx)(`span`,{children:t===`pt-BR`?`Criada em`:`Created at`}),(0,O.jsx)(`strong`,{children:Q})]})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(u,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,O.jsx)(`span`,{children:t===`pt-BR`?`Desde a criação`:`Since creation`}),(0,O.jsx)(`strong`,{children:$})]})]}),(0,O.jsxs)(`article`,{className:`trace-task-progress`,children:[(0,O.jsx)(h,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content trace-task-progress-content`,children:[(0,O.jsx)(`span`,{children:t===`pt-BR`?`Progresso`:`Progress`}),(0,O.jsxs)(`strong`,{children:[e.task_progress,`%`]}),(0,O.jsx)(`progress`,{max:100,value:e.task_progress})]})]}),(0,O.jsxs)(`article`,{className:`trace-task-classification`,children:[(0,O.jsx)(y,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,O.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,O.jsx)(`span`,{children:t===`pt-BR`?`Classificação`:`Classification`}),(0,O.jsxs)(`div`,{className:`trace-task-badges`,children:[(0,O.jsxs)(`span`,{className:`trace-mode-badge`,children:[(0,O.jsx)(T,{"aria-hidden":`true`,size:12,strokeWidth:2}),e.spec_id===null?N.taskFirst:N.specDriven]}),e.task_risk?(0,O.jsxs)(`span`,{className:`trace-risk-badge`,"data-risk":e.task_risk,children:[(0,O.jsx)(b,{"aria-hidden":`true`,size:12,strokeWidth:2}),F[t][e.task_risk]]}):null]})]})]})]}),(0,O.jsx)(`section`,{className:`trace-overview trace-lineage`,"aria-label":t===`pt-BR`?`Identificadores vinculados`:`Linked identifiers`,children:Z.map(({label:e,value:n,onOpen:r})=>{let i=n!==null&&r!==void 0,o=e===`Task`&&n!==null,s=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`trace-identifier-content`,children:[(0,O.jsxs)(`span`,{children:[(0,O.jsx)(_,{"aria-hidden":`true`,size:11,strokeWidth:2}),e]}),(0,O.jsx)(`strong`,{title:n??N.unlinked,children:n??N.unlinked})]}),o?(0,O.jsx)(`button`,{"aria-label":C?t===`pt-BR`?`ID da tarefa copiado`:`Task ID copied`:t===`pt-BR`?`Copiar ID da tarefa`:`Copy task ID`,className:`trace-identifier-copy`,onClick:()=>void ee(),title:C?t===`pt-BR`?`Copiado`:`Copied`:void 0,type:`button`,children:C?(0,O.jsx)(g,{"aria-hidden":`true`,size:15}):(0,O.jsx)(v,{"aria-hidden":`true`,size:15})}):null,i?(0,O.jsx)(a,{"aria-hidden":`true`,size:15,strokeWidth:1.9}):null]});return(0,O.jsx)(`article`,{"data-empty":n===null,"data-linked":n!==null,"data-navigable":i,children:i?(0,O.jsx)(`button`,{"aria-label":`${t===`pt-BR`?`Abrir`:`Open`} ${e}: ${n}`,className:`trace-identifier-navigation`,onClick:()=>r(n),type:`button`,children:s}):(0,O.jsx)(`div`,{className:`trace-identifier-static`,children:s})},e)})}),(0,O.jsxs)(`section`,{className:`trace-metrics`,"aria-label":t===`pt-BR`?`Resumo da rastreabilidade`:`Traceability summary`,children:[(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{className:`trace-metric-icon`,children:(0,O.jsx)(l,{"aria-hidden":`true`,size:18})}),(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`strong`,{children:[Y,`%`]}),(0,O.jsx)(`span`,{children:N.coverage})]}),(0,O.jsxs)(`small`,{children:[e.coverage.stages_with_timestamps,` `,N.of,` `,e.coverage.total_stages]})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{className:`trace-metric-icon`,children:(0,O.jsx)(w,{"aria-hidden":`true`,size:18})}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`strong`,{children:e.documents.length}),(0,O.jsx)(`span`,{children:N.documents})]}),(0,O.jsx)(`small`,{children:t===`pt-BR`?`no ciclo completo`:`in the full lifecycle`})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{className:`trace-metric-icon`,children:(0,O.jsx)(y,{"aria-hidden":`true`,size:18})}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`strong`,{children:e.coverage.evidence_count}),(0,O.jsx)(`span`,{children:N.evidenceMetric})]}),(0,O.jsxs)(`small`,{children:[e.coverage.test_count,` `,N.tests]})]}),(0,O.jsxs)(`article`,{children:[(0,O.jsx)(`span`,{className:`trace-metric-icon`,children:(0,O.jsx)(_,{"aria-hidden":`true`,size:18})}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`strong`,{children:X}),(0,O.jsx)(`span`,{children:t===`pt-BR`?`Vínculos`:`Links`})]}),(0,O.jsx)(`small`,{children:`Task · Change · SPEC · PRD`})]})]}),(0,O.jsx)(`div`,{className:`trace-stage-menu`,children:M.map((e,n)=>{let r=I[e],o=(W.get(e)??[]).length;return(0,O.jsxs)(`button`,{className:`trace-stage-menu-button`,"data-stage":e,onClick:()=>x(e),type:`button`,children:[(0,O.jsx)(`span`,{className:`trace-stage-number`,children:String(n+1).padStart(2,`0`)}),(0,O.jsx)(r,{className:`trace-stage-icon`,"aria-hidden":`true`,size:22,strokeWidth:1.8}),(0,O.jsx)(`strong`,{children:P[e].label}),(0,O.jsx)(`em`,{children:P[e].description}),(0,O.jsxs)(`span`,{className:`trace-stage-action`,children:[(0,O.jsxs)(`small`,{children:[(0,O.jsx)(i,{"aria-hidden":`true`,size:13}),` `,o,` `,N.items]}),(0,O.jsxs)(`span`,{children:[t===`pt-BR`?`Ver etapa`:`View stage`,(0,O.jsx)(a,{"aria-hidden":`true`,size:13,strokeWidth:2})]})]})]},e)})})]}),m?(0,O.jsx)(j,{ariaLabel:N.stageDetails,closeLabel:t===`pt-BR`?`Fechar detalhes da etapa`:`Close stage details`,onClose:()=>x(null),children:(0,O.jsx)(A,{copy:N,documents:W.get(m)??[],locale:t,onBack:()=>x(null),onOpenDocument:p,onStageChange:x,stage:m,stageArtifacts:U,stageRecord:K.get(m),stageCopy:P})}):null,f?(0,O.jsx)(k,{ariaLabel:`${N.document} ${f.title}`,closeLabel:N.closeDocument,document:f,onClose:()=>p(null)}):null]})}function G({usage:e,locale:n,copy:r}){let i=[{label:r.time,metric:e.duration_ms,value:K(e.duration_ms.value,n)},{label:r.tokens,metric:e.total_tokens,value:e.total_tokens.value===null?`—`:t(e.total_tokens.value,n)},{label:r.cost,metric:e.cost,value:e.cost.value===null||e.cost.currency===null?`—`:d(e.cost.value,e.cost.currency,n)}];return(0,O.jsx)(`section`,{"aria-label":n===`pt-BR`?`Uso agregado da Task`:`Aggregated Task usage`,children:(0,O.jsx)(`dl`,{className:`trace-usage-strip`,children:i.map(({label:t,metric:n,value:i})=>{let a=Math.round(n.coverage_ratio*100),o=`${n.known_runs}/${e.run_count} ${r.measuredRuns} · ${a}%`;return(0,O.jsxs)(`div`,{title:o,children:[(0,O.jsxs)(`dt`,{children:[t,(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`trace-usage-coverage`,"data-complete":n.unknown_runs===0}),(0,O.jsx)(`span`,{className:`trace-usage-sr-only`,children:o})]}),(0,O.jsx)(`dd`,{children:i})]},t)})})})}function K(e,t){return e===null?`—`:f(e,t)}function q(e,t){if(e===null)return`—`;let n=new Date(e);return Number.isNaN(n.getTime())?`—`:new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`short`}).format(n)}function J(e,t){if(e===null)return`—`;let n=Date.parse(e);if(!Number.isFinite(n))return`—`;let r=Math.max(0,Date.now()-n),i=Math.max(1,Math.round(r/6e4)),a;if(i<60)a=`${i}m`;else{let e=Math.round(i/60);if(e<24)a=`${e}h`;else{let n=Math.round(e/24);if(n<7)a=`${n}d`;else{let e=Math.round(n/7);a=t===`pt-BR`?`${e}sem`:`${e}w`}}}return t===`pt-BR`?`Há ${a}`:`${a} ago`}export{W as n,U as t};
@@ -6,15 +6,15 @@
6
6
  <meta name="color-scheme" content="dark light" />
7
7
  <link rel="icon" type="image/png" href="/icon_zaip.png" />
8
8
  <title>ZAIP-AIOS</title>
9
- <script type="module" crossorigin src="/assets/index-ncC1rxap.js"></script>
9
+ <script type="module" crossorigin src="/assets/index-DIwDvCu5.js"></script>
10
10
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-D9-fqq9M.js">
11
- <link rel="modulepreload" crossorigin href="/assets/cost-monitor-Cpp8xFij.js">
12
- <link rel="modulepreload" crossorigin href="/assets/react-vendor-DRJQbKnp.js">
13
- <link rel="modulepreload" crossorigin href="/assets/icons-vendor-CR4Fbf3g.js">
14
- <link rel="modulepreload" crossorigin href="/assets/traceability-CMrDYqjR.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/cost-monitor-Csj6LiAt.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/react-vendor-CTC6vtln.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/icons-vendor-VyTTl_ph.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/traceability-9Mtvbwrg.js">
15
15
  <link rel="stylesheet" crossorigin href="/assets/cost-monitor-PoJA2PI1.css">
16
16
  <link rel="stylesheet" crossorigin href="/assets/traceability-DFY7ZDlu.css">
17
- <link rel="stylesheet" crossorigin href="/assets/index-B31GMG5O.css">
17
+ <link rel="stylesheet" crossorigin href="/assets/index-hPPfVGQv.css">
18
18
  </head>
19
19
  <body>
20
20
  <div id="root"></div>
@@ -164,6 +164,17 @@ export function App() {
164
164
  setCurrency(next === "en-US" ? "USD" : "BRL");
165
165
  }, []);
166
166
  const [operationsPeriod, setOperationsPeriod] = useState(() => defaultOperationsPeriod);
167
+ // All Time may update its displayed factual range without changing the
168
+ // unbounded request identity. Keep the refresh callback stable for that
169
+ // presentation-only synchronization.
170
+ const operationsRequestPeriodKey =
171
+ operationsPeriod.preset === "all"
172
+ ? "all"
173
+ : `${operationsPeriod.preset}:${operationsPeriod.range.start}:${operationsPeriod.range.end}`;
174
+ const operationsRequestPeriod = useMemo(
175
+ () => requestPeriodForOperations(operationsPeriod),
176
+ [operationsRequestPeriodKey],
177
+ );
167
178
  const operationsPeriodRef = useRef(operationsPeriod);
168
179
  operationsPeriodRef.current = operationsPeriod;
169
180
  const [helpOpen, setHelpOpen] = useState(false);
@@ -280,7 +291,7 @@ export function App() {
280
291
  const requestVersion = ++refreshVersion.current;
281
292
  const transitionVersion = periodTransitionVersionRef.current;
282
293
  const activeDashboardView = dashboardViewRef.current;
283
- const period = requestPeriodForOperations(operationsPeriod);
294
+ const period = operationsRequestPeriod;
284
295
  const isCurrentRequest = () =>
285
296
  isCurrentDashboardRequest(requestVersion, refreshVersion.current) &&
286
297
  isCurrentOperationsPeriodRequest(
@@ -367,7 +378,7 @@ export function App() {
367
378
  }
368
379
  }
369
380
  },
370
- [api, currency, operationsPeriod],
381
+ [api, currency, operationsRequestPeriod],
371
382
  );
372
383
  const loadOperationsDetails = useCallback(
373
384
  async (signal?: AbortSignal): Promise<OperationsProjection | null> => {
@@ -800,12 +811,16 @@ export function App() {
800
811
  }, [costs?.currency, currency, loadCostSummary]);
801
812
 
802
813
  // A global period change invalidates the Cost snapshot before React commits
803
- // the replacement view. When Cost is already active, request that new BRL
804
- // summary here instead of waiting for another navigation click. The in-flight
805
- // guard prevents the navigation handler and this effect from issuing twins;
806
- // an error leaves the retry under explicit user control.
814
+ // the replacement view. All Time also needs its factual Cost range while
815
+ // Operations is active, so its disabled date inputs do not fall back to
816
+ // today's Operations range. The request itself remains deliberately
817
+ // unbounded. The in-flight guard prevents duplicate requests.
807
818
  useEffect(() => {
808
- if (dashboardView !== "cost-monitor" || costSummaryAbortRef.current !== null) return;
819
+ if (
820
+ (dashboardView !== "cost-monitor" && operationsPeriod.preset !== "all") ||
821
+ costSummaryAbortRef.current !== null
822
+ )
823
+ return;
809
824
  if (
810
825
  shouldLoadCostSummary({
811
826
  costsLoaded: costsLoadedRef.current,
@@ -814,7 +829,7 @@ export function App() {
814
829
  })
815
830
  )
816
831
  void loadCostSummary();
817
- }, [costs?.currency, currency, dashboardView, loadCostSummary]);
832
+ }, [costs?.currency, currency, dashboardView, loadCostSummary, operationsPeriod.preset]);
818
833
 
819
834
  const loadMoreTraceTasks = useCallback(
820
835
  async (loadAll = false, reset = false): Promise<OperationsProjection["tasks"]> => {
@@ -903,11 +918,15 @@ export function App() {
903
918
  };
904
919
 
905
920
  const capabilityNavigation = (
906
- <DashboardCapabilityNav
907
- activeView={dashboardView}
908
- locale={costLocale}
909
- onChange={(view) => void selectDashboardView(view)}
910
- />
921
+ <div
922
+ className={`dashboard-capability-shell dashboard-capability-shell--${dashboardView ?? "initial"}`}
923
+ >
924
+ <DashboardCapabilityNav
925
+ activeView={dashboardView}
926
+ locale={costLocale}
927
+ onChange={(view) => void selectDashboardView(view)}
928
+ />
929
+ </div>
911
930
  );
912
931
  const currentCostByRun = useMemo(
913
932
  () =>
@@ -54,20 +54,30 @@ describe("Cost period refresh", () => {
54
54
  expect(app).toContain('if (failedArea === "costs") void loadCostSummary();');
55
55
  });
56
56
 
57
- it("reloads the invalidated BRL Cost snapshot once when Cost remains active", () => {
57
+ it("reloads the invalidated BRL Cost snapshot for Cost Monitor and All Time presentation", () => {
58
58
  const app = readFileSync(new URL("./App.tsx", import.meta.url), "utf8");
59
59
  const activeCostReload = app.slice(
60
60
  app.indexOf("// A global period change invalidates the Cost snapshot"),
61
61
  app.indexOf("const loadMoreTraceTasks"),
62
62
  );
63
63
 
64
- expect(activeCostReload).toContain('dashboardView !== "cost-monitor"');
64
+ expect(activeCostReload).toContain('dashboardView !== "cost-monitor" && operationsPeriod.preset !== "all"');
65
65
  expect(activeCostReload).toContain("costSummaryAbortRef.current !== null");
66
66
  expect(activeCostReload).toContain("costsLoaded: costsLoadedRef.current");
67
67
  expect(activeCostReload).toContain("void loadCostSummary();");
68
+ expect(activeCostReload).toContain("operationsPeriod.preset");
68
69
  expect(activeCostReload).not.toContain("failedArea");
69
70
  });
70
71
 
72
+ it("does not make the all-time data request depend on its displayed factual range", () => {
73
+ const app = readFileSync(new URL("./App.tsx", import.meta.url), "utf8");
74
+
75
+ expect(app).toContain('operationsPeriod.preset === "all"');
76
+ expect(app).toContain('? "all"');
77
+ expect(app).toContain("const operationsRequestPeriod = useMemo(");
78
+ expect(app).toContain("[api, currency, operationsRequestPeriod]");
79
+ });
80
+
71
81
  it("rejects a late all-time summary after a newer period or currency takes ownership", () => {
72
82
  const allTime = { from: null, to: null };
73
83
  const currentMonth = { from: "2026-08-01", to: "2026-08-31" };
@@ -126,7 +136,7 @@ describe("Cost period refresh", () => {
126
136
  );
127
137
  expect(refresh).toContain("setDisplayedCosts(null);");
128
138
  expect(refresh).toContain("const activeDashboardView = dashboardViewRef.current");
129
- expect(refresh).toContain("[api, currency, operationsPeriod]");
139
+ expect(refresh).toContain("[api, currency, operationsRequestPeriod]");
130
140
  expect(refresh).not.toContain("[api, currency, dashboardView, operationsPeriod]");
131
141
  });
132
142
 
@@ -10,6 +10,17 @@
10
10
  background: rgba(8, 14, 25, 0.72);
11
11
  }
12
12
 
13
+ .dashboard-capability-shell {
14
+ flex: 0 0 auto;
15
+ }
16
+
17
+ /* The landing and Traceability surfaces have no temporal/search result to filter.
18
+ * Keep the controls available for the two capability views that consume them. */
19
+ .dashboard-capability-shell--initial + .dashboard-global-filters,
20
+ .dashboard-capability-shell--traceability + .dashboard-global-filters {
21
+ display: none;
22
+ }
23
+
13
24
  .dashboard-capability-nav button {
14
25
  display: flex;
15
26
  min-height: 52px;
@@ -39,6 +39,20 @@ describe("Operations period request contract", () => {
39
39
  expect(requestPeriodForOperations({ preset: "all", range })).toEqual({ from: null, to: null });
40
40
  });
41
41
 
42
+ it("keeps an All Time request unbounded when its displayed factual range changes", () => {
43
+ const initialDisplay = { start: "2026-09-01", end: "2026-09-01" };
44
+ const factualDisplay = { start: "2026-06-02", end: "2026-09-01" };
45
+
46
+ expect(requestPeriodForOperations({ preset: "all", range: initialDisplay })).toEqual({
47
+ from: null,
48
+ to: null,
49
+ });
50
+ expect(requestPeriodForOperations({ preset: "all", range: factualDisplay })).toEqual({
51
+ from: null,
52
+ to: null,
53
+ });
54
+ });
55
+
42
56
  it("keeps the latest Today/Yesterday selection when rapid requests resolve out of order", () => {
43
57
  const today = { start: "2026-08-08", end: "2026-08-08" };
44
58
  const yesterday = { start: "2026-08-07", end: "2026-08-07" };
@@ -2,12 +2,9 @@ import { describe, expect, it } from "vitest";
2
2
  import { defaultOperationsPeriod, requestPeriodForOperations } from "./operations-period.js";
3
3
 
4
4
  describe("dashboard default Operations period", () => {
5
- it("opens in This Month with its visible date bounds", () => {
6
- expect(defaultOperationsPeriod.preset).toBe("this-month");
7
- expect(requestPeriodForOperations(defaultOperationsPeriod)).toEqual({
8
- from: defaultOperationsPeriod.range.start,
9
- to: defaultOperationsPeriod.range.end,
10
- });
5
+ it("opens in All Time without date bounds", () => {
6
+ expect(defaultOperationsPeriod.preset).toBe("all");
7
+ expect(requestPeriodForOperations(defaultOperationsPeriod)).toEqual({ from: null, to: null });
11
8
  });
12
9
 
13
10
  it("keeps an explicit Sao Paulo This Month selection bounded", () => {
@@ -9,9 +9,10 @@ export interface OperationsPeriodState {
9
9
  range: OperationDateRange;
10
10
  }
11
11
 
12
- /** Operations opens on the current Sao Paulo month, like every dashboard tab. */
12
+ /** Operations opens across the full available period for the dashboard overview. */
13
13
  export const defaultOperationsPeriod: OperationsPeriodState = {
14
- preset: "this-month",
14
+ preset: "all",
15
+ // All Time deliberately ignores these display bounds in requests.
15
16
  range: dateRangeForPreset("this-month"),
16
17
  };
17
18