@ashlr/hub 3.11.0 → 3.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -0
- package/dist/authority-surface.json +12 -7
- package/dist/build-identity.json +2 -2
- package/dist/core/universe/builtins/preparation/manifest.json +1 -1
- package/dist/core/universe/builtins/preparation/preparation-bridge.mjs +5 -4
- package/dist/core/universe/builtins/preparation/preparation-verification-fixtures.mjs +4 -3
- package/dist/core/universe/campaign.js +9 -1
- package/dist/core/universe/campaign.js.map +1 -1
- package/dist/core/universe/runner.d.ts +3 -0
- package/dist/core/universe/runner.js +7 -3
- package/dist/core/universe/runner.js.map +1 -1
- package/dist/core/verse/compaction-point.d.ts +55 -0
- package/dist/core/verse/compaction-point.js +75 -0
- package/dist/core/verse/compaction-point.js.map +1 -0
- package/dist/core/verse/context-math.d.ts +1 -38
- package/dist/core/verse/context-math.js +5 -59
- package/dist/core/verse/context-math.js.map +1 -1
- package/dist/core/web/public/next/assets/{ActionMenu-CQvNJvHY.js → ActionMenu-_DhtX2gO.js} +2 -2
- package/dist/core/web/public/next/assets/{ActionMenu-CQvNJvHY.js.map → ActionMenu-_DhtX2gO.js.map} +1 -1
- package/dist/core/web/public/next/assets/Advanced-CAAfaBke.js +2 -0
- package/dist/core/web/public/next/assets/{Advanced-DEM93sKI.js.map → Advanced-CAAfaBke.js.map} +1 -1
- package/dist/core/web/public/next/assets/App-BAywyjE8.js +7 -0
- package/dist/core/web/public/next/assets/{App-CimXmK0L.js.map → App-BAywyjE8.js.map} +1 -1
- package/dist/core/web/public/next/assets/AppsSection-CUypKeog.js +2 -0
- package/dist/core/web/public/next/assets/{AppsSection-D6U-dSj6.js.map → AppsSection-CUypKeog.js.map} +1 -1
- package/dist/core/web/public/next/assets/{AreaTrend-LD9lCPkT.js → AreaTrend-CblDqC8Q.js} +2 -2
- package/dist/core/web/public/next/assets/{AreaTrend-LD9lCPkT.js.map → AreaTrend-CblDqC8Q.js.map} +1 -1
- package/dist/core/web/public/next/assets/AutonomySection-D3d8lYO3.js +2 -0
- package/dist/core/web/public/next/assets/{AutonomySection-3V9pUyxm.js.map → AutonomySection-D3d8lYO3.js.map} +1 -1
- package/dist/core/web/public/next/assets/BranchBar-DU0jAV1E.js +2 -0
- package/dist/core/web/public/next/assets/{BranchBar-U8UdpfEB.js.map → BranchBar-DU0jAV1E.js.map} +1 -1
- package/dist/core/web/public/next/assets/{BudgetControl-DOTlMSmW.js → BudgetControl-Mm1ZL4u6.js} +2 -2
- package/dist/core/web/public/next/assets/{BudgetControl-DOTlMSmW.js.map → BudgetControl-Mm1ZL4u6.js.map} +1 -1
- package/dist/core/web/public/next/assets/{BurnDown-x4PWH9JF.js → BurnDown-C1fgcFqo.js} +2 -2
- package/dist/core/web/public/next/assets/{BurnDown-x4PWH9JF.js.map → BurnDown-C1fgcFqo.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Button-DYv_KKxr.js → Button-DqgLUZvd.js} +2 -2
- package/dist/core/web/public/next/assets/{Button-DYv_KKxr.js.map → Button-DqgLUZvd.js.map} +1 -1
- package/dist/core/web/public/next/assets/CapacityStrip-nWFHvqFB.js +2 -0
- package/dist/core/web/public/next/assets/CapacityStrip-nWFHvqFB.js.map +1 -0
- package/dist/core/web/public/next/assets/ChatSection-DUZNpiVr.js +3 -0
- package/dist/core/web/public/next/assets/ChatSection-DUZNpiVr.js.map +1 -0
- package/dist/core/web/public/next/assets/{CloudBudgetForm-DJeJvBEu.js → CloudBudgetForm-2OW38o_C.js} +2 -2
- package/dist/core/web/public/next/assets/{CloudBudgetForm-DJeJvBEu.js.map → CloudBudgetForm-2OW38o_C.js.map} +1 -1
- package/dist/core/web/public/next/assets/CommandPalette-C5w2o1-r.js +2 -0
- package/dist/core/web/public/next/assets/{CommandPalette-FiD4N8XD.js.map → CommandPalette-C5w2o1-r.js.map} +1 -1
- package/dist/core/web/public/next/assets/CommandSection-Bx2knNqY.js +2 -0
- package/dist/core/web/public/next/assets/{CommandSection-DN8KwH-X.js.map → CommandSection-Bx2knNqY.js.map} +1 -1
- package/dist/core/web/public/next/assets/ConfirmDialog-B7ZwCQOX.js +2 -0
- package/dist/core/web/public/next/assets/ConfirmDialog-B7ZwCQOX.js.map +1 -0
- package/dist/core/web/public/next/assets/ConfirmDialog-Dx15x0Ho.css +1 -0
- package/dist/core/web/public/next/assets/Dialog-BpgcEW6b.js +2 -0
- package/dist/core/web/public/next/assets/Dialog-BpgcEW6b.js.map +1 -0
- package/dist/core/web/public/next/assets/Dialog-tQ8kFulD.css +1 -0
- package/dist/core/web/public/next/assets/{DiffPane-DLJ3gGGK.js → DiffPane-DpqRUtCx.js} +2 -2
- package/dist/core/web/public/next/assets/{DiffPane-DLJ3gGGK.js.map → DiffPane-DpqRUtCx.js.map} +1 -1
- package/dist/core/web/public/next/assets/{DiffViewer-B7NWPjIO.js → DiffViewer-CoV5-nUf.js} +2 -2
- package/dist/core/web/public/next/assets/{DiffViewer-B7NWPjIO.js.map → DiffViewer-CoV5-nUf.js.map} +1 -1
- package/dist/core/web/public/next/assets/DockHost-C0Pq7Jak.js +2 -0
- package/dist/core/web/public/next/assets/{DockHost-DvR-hPhZ.js.map → DockHost-C0Pq7Jak.js.map} +1 -1
- package/dist/core/web/public/next/assets/{EmptyState-DhNgDDrF.js → EmptyState-DYW29ncw.js} +2 -2
- package/dist/core/web/public/next/assets/{EmptyState-DhNgDDrF.js.map → EmptyState-DYW29ncw.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Epistemic-uARPnx9x.js → Epistemic-DVx6oHzp.js} +2 -2
- package/dist/core/web/public/next/assets/{Epistemic-uARPnx9x.js.map → Epistemic-DVx6oHzp.js.map} +1 -1
- package/dist/core/web/public/next/assets/FleetSection-DSETviPK.js +3 -0
- package/dist/core/web/public/next/assets/{FleetSection-D_zRBCub.js.map → FleetSection-DSETviPK.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Funnel-CL8uHONq.js → Funnel-DxiGqJrt.js} +2 -2
- package/dist/core/web/public/next/assets/{Funnel-CL8uHONq.js.map → Funnel-DxiGqJrt.js.map} +1 -1
- package/dist/core/web/public/next/assets/GearTray-C3I89sIt.js +2 -0
- package/dist/core/web/public/next/assets/{GearTray-C7k4l_BW.js.map → GearTray-C3I89sIt.js.map} +1 -1
- package/dist/core/web/public/next/assets/{GrowthSection-DwdNSGj8.js → GrowthSection-C3m2bPEz.js} +2 -2
- package/dist/core/web/public/next/assets/{GrowthSection-DwdNSGj8.js.map → GrowthSection-C3m2bPEz.js.map} +1 -1
- package/dist/core/web/public/next/assets/HandoffDialog-Bjb96a0N.js +2 -0
- package/dist/core/web/public/next/assets/{HandoffDialog-FPVOqOMN.js.map → HandoffDialog-Bjb96a0N.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Input-B9-VLcHS.js → Input-ekTehVaH.js} +2 -2
- package/dist/core/web/public/next/assets/{Input-B9-VLcHS.js.map → Input-ekTehVaH.js.map} +1 -1
- package/dist/core/web/public/next/assets/LeaderCard-85VBbbaZ.js +2 -0
- package/dist/core/web/public/next/assets/{LeaderCard-4R0BhDzT.js.map → LeaderCard-85VBbbaZ.js.map} +1 -1
- package/dist/core/web/public/next/assets/{MatrixHeatmap-DiuushcS.js → MatrixHeatmap-Bo8j0QPC.js} +2 -2
- package/dist/core/web/public/next/assets/{MatrixHeatmap-DiuushcS.js.map → MatrixHeatmap-Bo8j0QPC.js.map} +1 -1
- package/dist/core/web/public/next/assets/McpSection-DvHFaVyp.js +2 -0
- package/dist/core/web/public/next/assets/{McpSection-CJ__OJKl.js.map → McpSection-DvHFaVyp.js.map} +1 -1
- package/dist/core/web/public/next/assets/{MessageMarkdown-qWKyJvAQ.js → MessageMarkdown-fsY_ltVa.js} +3 -3
- package/dist/core/web/public/next/assets/{MessageMarkdown-qWKyJvAQ.js.map → MessageMarkdown-fsY_ltVa.js.map} +1 -1
- package/dist/core/web/public/next/assets/{MessageMarkdownRenderer-x05TrsrW.js → MessageMarkdownRenderer-DDdtu82l.js} +2 -2
- package/dist/core/web/public/next/assets/{MessageMarkdownRenderer-x05TrsrW.js.map → MessageMarkdownRenderer-DDdtu82l.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Meter-D-hncpkO.js → Meter-CeGDXdDM.js} +2 -2
- package/dist/core/web/public/next/assets/{Meter-D-hncpkO.js.map → Meter-CeGDXdDM.js.map} +1 -1
- package/dist/core/web/public/next/assets/MindSection-CDVhHvXl.js +2 -0
- package/dist/core/web/public/next/assets/{MindSection-BjXHkQPS.js.map → MindSection-CDVhHvXl.js.map} +1 -1
- package/dist/core/web/public/next/assets/MutationTokenDialog-CrfJ0PdD.css +1 -0
- package/dist/core/web/public/next/assets/MutationTokenDialog-DTQzEOHR.js +2 -0
- package/dist/core/web/public/next/assets/MutationTokenDialog-DTQzEOHR.js.map +1 -0
- package/dist/core/web/public/next/assets/NeedsYouDrawer-6AuN0BF3.js +2 -0
- package/dist/core/web/public/next/assets/{NeedsYouDrawer-rSd1ZHAR.js.map → NeedsYouDrawer-6AuN0BF3.js.map} +1 -1
- package/dist/core/web/public/next/assets/{NeedsYouList-CG-nB1tr.js → NeedsYouList-ChnRmbSk.js} +2 -2
- package/dist/core/web/public/next/assets/{NeedsYouList-CG-nB1tr.js.map → NeedsYouList-ChnRmbSk.js.map} +1 -1
- package/dist/core/web/public/next/assets/NewChatDialog-B06E7sqg.js +3 -0
- package/dist/core/web/public/next/assets/{NewChatDialog-BeDQ1eW3.js.map → NewChatDialog-B06E7sqg.js.map} +1 -1
- package/dist/core/web/public/next/assets/OnboardingFlow-C2M3zov9.js +2 -0
- package/dist/core/web/public/next/assets/{OnboardingFlow-CkTZtt-m.js.map → OnboardingFlow-C2M3zov9.js.map} +1 -1
- package/dist/core/web/public/next/assets/PreviewPane-Bd6HsX1k.js +2 -0
- package/dist/core/web/public/next/assets/{PreviewPane-kzbbSK4u.js.map → PreviewPane-Bd6HsX1k.js.map} +1 -1
- package/dist/core/web/public/next/assets/ProviderLogo-Bz7KR5j3.js +2 -0
- package/dist/core/web/public/next/assets/ProviderLogo-Bz7KR5j3.js.map +1 -0
- package/dist/core/web/public/next/assets/{RailStatus-D-t2gPae.js → RailStatus-CctCuuLy.js} +2 -2
- package/dist/core/web/public/next/assets/{RailStatus-D-t2gPae.js.map → RailStatus-CctCuuLy.js.map} +1 -1
- package/dist/core/web/public/next/assets/{RefreshIndicator-BLnr9IOM.js → RefreshIndicator-CKY5BGdD.js} +2 -2
- package/dist/core/web/public/next/assets/{RefreshIndicator-BLnr9IOM.js.map → RefreshIndicator-CKY5BGdD.js.map} +1 -1
- package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-CM_8pJs6.css → ResourcePoolConsoleApp-BX9JLkT4.css} +1 -1
- package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-BeG0gBif.js → ResourcePoolConsoleApp-CspIsW_G.js} +5 -5
- package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-BeG0gBif.js.map → ResourcePoolConsoleApp-CspIsW_G.js.map} +1 -1
- package/dist/core/web/public/next/assets/ResourcesChrome-B7fHZ6zX.js +3 -0
- package/dist/core/web/public/next/assets/ResourcesChrome-B7fHZ6zX.js.map +1 -0
- package/dist/core/web/public/next/assets/ResourcesChrome-uZEqC2EM.css +1 -0
- package/dist/core/web/public/next/assets/ResourcesDrawer-B7-N9n7-.js +2 -0
- package/dist/core/web/public/next/assets/ResourcesDrawer-B7-N9n7-.js.map +1 -0
- package/dist/core/web/public/next/assets/RouteErrorBoundary-C_B11J0s.js +2 -0
- package/dist/core/web/public/next/assets/RouteErrorBoundary-C_B11J0s.js.map +1 -0
- package/dist/core/web/public/next/assets/RouteErrorBoundary-DdxhTdZ6.css +1 -0
- package/dist/core/web/public/next/assets/{RunInCloudAction-C3LBp7C4.js → RunInCloudAction-_juw4EXd.js} +2 -2
- package/dist/core/web/public/next/assets/{RunInCloudAction-C3LBp7C4.js.map → RunInCloudAction-_juw4EXd.js.map} +1 -1
- package/dist/core/web/public/next/assets/SeatSelector-D_YXvkPy.js +3 -0
- package/dist/core/web/public/next/assets/{SeatSelector-DpvvbjNm.js.map → SeatSelector-D_YXvkPy.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Segmented-BL40udoO.js → Segmented-DnKP6rr7.js} +2 -2
- package/dist/core/web/public/next/assets/{Segmented-BL40udoO.js.map → Segmented-DnKP6rr7.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Select-FWLnAw_j.js → Select-DlbUupTX.js} +2 -2
- package/dist/core/web/public/next/assets/{Select-FWLnAw_j.js.map → Select-DlbUupTX.js.map} +1 -1
- package/dist/core/web/public/next/assets/SessionGate-DnuTZACL.js +2 -0
- package/dist/core/web/public/next/assets/SessionGate-DnuTZACL.js.map +1 -0
- package/dist/core/web/public/next/assets/SessionGate-DvMpXNpJ.css +1 -0
- package/dist/core/web/public/next/assets/SessionInsightChip-C33-k-Q5.js +2 -0
- package/dist/core/web/public/next/assets/{SessionInsightChip-CWye87Ju.js.map → SessionInsightChip-C33-k-Q5.js.map} +1 -1
- package/dist/core/web/public/next/assets/{SessionSearch-YvCHFUuN.js → SessionSearch-DhhR9Csg.js} +2 -2
- package/dist/core/web/public/next/assets/{SessionSearch-YvCHFUuN.js.map → SessionSearch-DhhR9Csg.js.map} +1 -1
- package/dist/core/web/public/next/assets/SettingsSection-C0xQvCz3.js +2 -0
- package/dist/core/web/public/next/assets/SettingsSection-C0xQvCz3.js.map +1 -0
- package/dist/core/web/public/next/assets/Sheet-BvNYOYv5.js +2 -0
- package/dist/core/web/public/next/assets/{Sheet-DZKcQXQg.js.map → Sheet-BvNYOYv5.js.map} +1 -1
- package/dist/core/web/public/next/assets/ShortcutsOverlay-1nUBVO-Z.js +2 -0
- package/dist/core/web/public/next/assets/{ShortcutsOverlay-BpDimdPq.js.map → ShortcutsOverlay-1nUBVO-Z.js.map} +1 -1
- package/dist/core/web/public/next/assets/Sidebar-YrVvvBNM.js +3 -0
- package/dist/core/web/public/next/assets/{Sidebar-BoBzBEFX.js.map → Sidebar-YrVvvBNM.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Slider-DUMo9HDD.js → Slider-B2c-dbQb.js} +2 -2
- package/dist/core/web/public/next/assets/{Slider-DUMo9HDD.js.map → Slider-B2c-dbQb.js.map} +1 -1
- package/dist/core/web/public/next/assets/{StatusBadge-BwnBNFQr.js → StatusBadge-Q9YYkijx.js} +2 -2
- package/dist/core/web/public/next/assets/{StatusBadge-BwnBNFQr.js.map → StatusBadge-Q9YYkijx.js.map} +1 -1
- package/dist/core/web/public/next/assets/{StepBand-PDXMIlRk.js → StepBand-Ci-C0GUG.js} +2 -2
- package/dist/core/web/public/next/assets/{StepBand-PDXMIlRk.js.map → StepBand-Ci-C0GUG.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Surface-B3TZVoER.js → Surface-DBovMq4P.js} +2 -2
- package/dist/core/web/public/next/assets/{Surface-B3TZVoER.js.map → Surface-DBovMq4P.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Swimlane-DR4OgON_.js → Swimlane-Cdc4TqDe.js} +2 -2
- package/dist/core/web/public/next/assets/{Swimlane-DR4OgON_.js.map → Swimlane-Cdc4TqDe.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Switch-CcR5Llk5.js → Switch-CUrvzO2k.js} +2 -2
- package/dist/core/web/public/next/assets/{Switch-CcR5Llk5.js.map → Switch-CUrvzO2k.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Tag-_-K1h7Hk.js → Tag-Bv8u6APt.js} +2 -2
- package/dist/core/web/public/next/assets/{Tag-_-K1h7Hk.js.map → Tag-Bv8u6APt.js.map} +1 -1
- package/dist/core/web/public/next/assets/TerminalPane-BE4Xlqi5.js +7 -0
- package/dist/core/web/public/next/assets/{TerminalPane-_1aH4ndN.js.map → TerminalPane-BE4Xlqi5.js.map} +1 -1
- package/dist/core/web/public/next/assets/UniverseConsoleApp-BGwejf0m.js +2 -0
- package/dist/core/web/public/next/assets/{UniverseConsoleApp-BUsq-inZ.js.map → UniverseConsoleApp-BGwejf0m.js.map} +1 -1
- package/dist/core/web/public/next/assets/{UniverseConsoleApp-Dh7A-hLD.css → UniverseConsoleApp-DfuT-wFw.css} +1 -1
- package/dist/core/web/public/next/assets/{UniverseView-Dogy_dsB.js → UniverseView-CgKa-WXC.js} +4 -4
- package/dist/core/web/public/next/assets/{UniverseView-Dogy_dsB.js.map → UniverseView-CgKa-WXC.js.map} +1 -1
- package/dist/core/web/public/next/assets/UsageSection-CazsHm1f.js +2 -0
- package/dist/core/web/public/next/assets/{UsageSection-DiX_dTyo.js.map → UsageSection-CazsHm1f.js.map} +1 -1
- package/dist/core/web/public/next/assets/VerseConsoleApp-CTF3Shs0.js +3 -0
- package/dist/core/web/public/next/assets/VerseConsoleApp-CTF3Shs0.js.map +1 -0
- package/dist/core/web/public/next/assets/Workspace-CgdyXiEV.js +10 -0
- package/dist/core/web/public/next/assets/Workspace-CgdyXiEV.js.map +1 -0
- package/dist/core/web/public/next/assets/Workspace-Dwri2jFJ.css +1 -0
- package/dist/core/web/public/next/assets/actions-MtxBGS5B.js +2 -0
- package/dist/core/web/public/next/assets/{actions-s2lfm_5k.js.map → actions-MtxBGS5B.js.map} +1 -1
- package/dist/core/web/public/next/assets/budget-queries-CP7hgR-p.js +2 -0
- package/dist/core/web/public/next/assets/{budget-queries-wUshcovN.js.map → budget-queries-CP7hgR-p.js.map} +1 -1
- package/dist/core/web/public/next/assets/{capacity-strip-model-Bj_9ztzs.js → capacity-strip-model-fHfu5cph.js} +2 -2
- package/dist/core/web/public/next/assets/{capacity-strip-model-Bj_9ztzs.js.map → capacity-strip-model-fHfu5cph.js.map} +1 -1
- package/dist/core/web/public/next/assets/{charts-CMSgAUKn.js → charts-Bis9WSiS.js} +2 -2
- package/dist/core/web/public/next/assets/{charts-CMSgAUKn.js.map → charts-Bis9WSiS.js.map} +1 -1
- package/dist/core/web/public/next/assets/cloud-queries-BsOepFz6.js +2 -0
- package/dist/core/web/public/next/assets/{cloud-queries-CnV1yaNG.js.map → cloud-queries-BsOepFz6.js.map} +1 -1
- package/dist/core/web/public/next/assets/{cloud.module-CiwatLj3.js → cloud.module-DoFnr8ZH.js} +2 -2
- package/dist/core/web/public/next/assets/{cloud.module-CiwatLj3.js.map → cloud.module-DoFnr8ZH.js.map} +1 -1
- package/dist/core/web/public/next/assets/{command-bus-DqimKCUY.js → command-bus-CMvbYP5K.js} +2 -2
- package/dist/core/web/public/next/assets/{command-bus-DqimKCUY.js.map → command-bus-CMvbYP5K.js.map} +1 -1
- package/dist/core/web/public/next/assets/command-catalog-Bb_PxC5w.js +2 -0
- package/dist/core/web/public/next/assets/command-catalog-Bb_PxC5w.js.map +1 -0
- package/dist/core/web/public/next/assets/compaction-point-VL9oegWS.js +2 -0
- package/dist/core/web/public/next/assets/compaction-point-VL9oegWS.js.map +1 -0
- package/dist/core/web/public/next/assets/{composer-keys-DBRymxQn.js → composer-keys-su0g1h9o.js} +2 -2
- package/dist/core/web/public/next/assets/{composer-keys-DBRymxQn.js.map → composer-keys-su0g1h9o.js.map} +1 -1
- package/dist/core/web/public/next/assets/context-model-Ci3Ch9t5.js +2 -0
- package/dist/core/web/public/next/assets/{context-model-Dwd49-dp.js.map → context-model-Ci3Ch9t5.js.map} +1 -1
- package/dist/core/web/public/next/assets/context-model-CjiJTnf1.js +2 -0
- package/dist/core/web/public/next/assets/{context-model-MT17V86_.js.map → context-model-CjiJTnf1.js.map} +1 -1
- package/dist/core/web/public/next/assets/context-queries-BDXT6LQ3.js +2 -0
- package/dist/core/web/public/next/assets/{context-queries-xVKIeynP.js.map → context-queries-BDXT6LQ3.js.map} +1 -1
- package/dist/core/web/public/next/assets/control-queries-Dv-h1Clu.js +2 -0
- package/dist/core/web/public/next/assets/{control-queries-DOZR-D8G.js.map → control-queries-Dv-h1Clu.js.map} +1 -1
- package/dist/core/web/public/next/assets/{dock-icons-8EtARwUm.js → dock-icons-t--Eugrd.js} +2 -2
- package/dist/core/web/public/next/assets/{dock-icons-8EtARwUm.js.map → dock-icons-t--Eugrd.js.map} +1 -1
- package/dist/core/web/public/next/assets/{dock-store-BA1cHOYA.js → dock-store-qIu7kSQE.js} +2 -2
- package/dist/core/web/public/next/assets/{dock-store-BA1cHOYA.js.map → dock-store-qIu7kSQE.js.map} +1 -1
- package/dist/core/web/public/next/assets/{fleet-model-CNe8Wh-s.js → fleet-model-IRbwfhkR.js} +2 -2
- package/dist/core/web/public/next/assets/{fleet-model-CNe8Wh-s.js.map → fleet-model-IRbwfhkR.js.map} +1 -1
- package/dist/core/web/public/next/assets/fleet-queries-7FVNByX1.js +2 -0
- package/dist/core/web/public/next/assets/{fleet-queries-BSdRlUwJ.js.map → fleet-queries-7FVNByX1.js.map} +1 -1
- package/dist/core/web/public/next/assets/focus-trap-QqQxQdvH.js +2 -0
- package/dist/core/web/public/next/assets/focus-trap-QqQxQdvH.js.map +1 -0
- package/dist/core/web/public/next/assets/{format-B8DAVcn2.js → format-CaMmVQCn.js} +2 -2
- package/dist/core/web/public/next/assets/{format-B8DAVcn2.js.map → format-CaMmVQCn.js.map} +1 -1
- package/dist/core/web/public/next/assets/git-model-B4S_GUNA.js +5 -0
- package/dist/core/web/public/next/assets/{git-model-CivuBY_D.js.map → git-model-B4S_GUNA.js.map} +1 -1
- package/dist/core/web/public/next/assets/global-BkNl4e6E.js +2 -0
- package/dist/core/web/public/next/assets/global-BkNl4e6E.js.map +1 -0
- package/dist/core/web/public/next/assets/global-BlI2BYa1.css +1 -0
- package/dist/core/web/public/next/assets/guarded-action-DHiL8tY5.js +3 -0
- package/dist/core/web/public/next/assets/guarded-action-DHiL8tY5.js.map +1 -0
- package/dist/core/web/public/next/assets/guarded-runners-DmGEkM2P.js +2 -0
- package/dist/core/web/public/next/assets/guarded-runners-DmGEkM2P.js.map +1 -0
- package/dist/core/web/public/next/assets/icon-base-NtFmP2yB.js +2 -0
- package/dist/core/web/public/next/assets/icon-base-NtFmP2yB.js.map +1 -0
- package/dist/core/web/public/next/assets/icons-C5EFt_Ts.js +2 -0
- package/dist/core/web/public/next/assets/icons-C5EFt_Ts.js.map +1 -0
- package/dist/core/web/public/next/assets/{index-oAAq8XJa.js → index-DbDw9UAs.js} +3 -3
- package/dist/core/web/public/next/assets/{index-oAAq8XJa.js.map → index-DbDw9UAs.js.map} +1 -1
- package/dist/core/web/public/next/assets/{live-model-DCw_IFRI.js → live-model-DEwrl7_A.js} +2 -2
- package/dist/core/web/public/next/assets/{live-model-DCw_IFRI.js.map → live-model-DEwrl7_A.js.map} +1 -1
- package/dist/core/web/public/next/assets/{mind.module-vnuJcwvD.js → mind.module-CLhqMQak.js} +2 -2
- package/dist/core/web/public/next/assets/{mind.module-vnuJcwvD.js.map → mind.module-CLhqMQak.js.map} +1 -1
- package/dist/core/web/public/next/assets/mutations-Kvzsg-iK.js +2 -0
- package/dist/core/web/public/next/assets/{mutations-Dpsql5t7.js.map → mutations-Kvzsg-iK.js.map} +1 -1
- package/dist/core/web/public/next/assets/nav-C0IunEYF.js +2 -0
- package/dist/core/web/public/next/assets/nav-C0IunEYF.js.map +1 -0
- package/dist/core/web/public/next/assets/overnight-queries-C_AfcL7q.js +2 -0
- package/dist/core/web/public/next/assets/{overnight-queries-X-44Gsw5.js.map → overnight-queries-C_AfcL7q.js.map} +1 -1
- package/dist/core/web/public/next/assets/preloaded-CctOitLu.js +2 -0
- package/dist/core/web/public/next/assets/preloaded-CctOitLu.js.map +1 -0
- package/dist/core/web/public/next/assets/primitives-CbAGCNKt.js +1 -0
- package/dist/core/web/public/next/assets/{queries-BA4rNGD-.js → queries-THD05gHP.js} +2 -2
- package/dist/core/web/public/next/assets/{queries-BA4rNGD-.js.map → queries-THD05gHP.js.map} +1 -1
- package/dist/core/web/public/next/assets/reasoning-pref-BVPu0SME.js +2 -0
- package/dist/core/web/public/next/assets/{reasoning-pref-B9-DJUXP.js.map → reasoning-pref-BVPu0SME.js.map} +1 -1
- package/dist/core/web/public/next/assets/reveal-anchor-wCT5b4m3.js +2 -0
- package/dist/core/web/public/next/assets/reveal-anchor-wCT5b4m3.js.map +1 -0
- package/dist/core/web/public/next/assets/seat-subscription-CR_VylsK.js +2 -0
- package/dist/core/web/public/next/assets/{seat-subscription-CH6fW4fJ.js.map → seat-subscription-CR_VylsK.js.map} +1 -1
- package/dist/core/web/public/next/assets/{section-visibility-qFqc_d4Z.js → section-visibility-B0xXUQJ0.js} +2 -2
- package/dist/core/web/public/next/assets/{section-visibility-qFqc_d4Z.js.map → section-visibility-B0xXUQJ0.js.map} +1 -1
- package/dist/core/web/public/next/assets/{sidebar-model-M1GaQU5l.js → sidebar-model-C5wVXGpb.js} +2 -2
- package/dist/core/web/public/next/assets/{sidebar-model-M1GaQU5l.js.map → sidebar-model-C5wVXGpb.js.map} +1 -1
- package/dist/core/web/public/next/assets/slots-DDd8cEoh.js +3 -0
- package/dist/core/web/public/next/assets/{slots-Ds9ZIqUL.js.map → slots-DDd8cEoh.js.map} +1 -1
- package/dist/core/web/public/next/assets/surface-data-BFxAlefI.js +2 -0
- package/dist/core/web/public/next/assets/{surface-data-J52iIGMD.js.map → surface-data-BFxAlefI.js.map} +1 -1
- package/dist/core/web/public/next/assets/surface-prefetch-CHusyO9q.js +2 -0
- package/dist/core/web/public/next/assets/{surface-prefetch-CgZ-LEJK.js.map → surface-prefetch-CHusyO9q.js.map} +1 -1
- package/dist/core/web/public/next/assets/{tasks-model-ent8f0jZ.js → tasks-model-DvkWveXs.js} +2 -2
- package/dist/core/web/public/next/assets/{tasks-model-ent8f0jZ.js.map → tasks-model-DvkWveXs.js.map} +1 -1
- package/dist/core/web/public/next/assets/{terminal-icons-DJTK7QpR.js → terminal-icons-Dp6pJgV2.js} +2 -2
- package/dist/core/web/public/next/assets/{terminal-icons-DJTK7QpR.js.map → terminal-icons-Dp6pJgV2.js.map} +1 -1
- package/dist/core/web/public/next/assets/{usage-queries-Bn8ccqyN.js → usage-queries-CUTmnegA.js} +2 -2
- package/dist/core/web/public/next/assets/{usage-queries-Bn8ccqyN.js.map → usage-queries-CUTmnegA.js.map} +1 -1
- package/dist/core/web/public/next/assets/use-guarded-action-UCX2u1t1.js +2 -0
- package/dist/core/web/public/next/assets/{use-guarded-action-C2HlSzkz.js.map → use-guarded-action-UCX2u1t1.js.map} +1 -1
- package/dist/core/web/public/next/assets/{use-ticker-BNc1H4ZC.js → use-ticker-OXAjob3y.js} +2 -2
- package/dist/core/web/public/next/assets/{use-ticker-BNc1H4ZC.js.map → use-ticker-OXAjob3y.js.map} +1 -1
- package/dist/core/web/public/next/assets/use-token-gate-CDDRAoKH.js +2 -0
- package/dist/core/web/public/next/assets/{use-token-gate-B3IJL6bf.js.map → use-token-gate-CDDRAoKH.js.map} +1 -1
- package/dist/core/web/public/next/assets/useChartWidth-BW6SwYIK.css +1 -0
- package/dist/core/web/public/next/assets/useChartWidth-D9M7kUw7.js +2 -0
- package/dist/core/web/public/next/assets/{useChartWidth-lZ9PrQn0.js.map → useChartWidth-D9M7kUw7.js.map} +1 -1
- package/dist/core/web/public/next/assets/{useSeatsRefresh-CG4jczeL.js → useSeatsRefresh-B2dCVcj9.js} +2 -2
- package/dist/core/web/public/next/assets/{useSeatsRefresh-CG4jczeL.js.map → useSeatsRefresh-B2dCVcj9.js.map} +1 -1
- package/dist/core/web/public/next/assets/useVerseTranscript-BL3CljSI.js +2 -0
- package/dist/core/web/public/next/assets/useVerseTranscript-BL3CljSI.js.map +1 -0
- package/dist/core/web/public/next/assets/verse-icons-DASWdYuE.js +2 -0
- package/dist/core/web/public/next/assets/verse-icons-DASWdYuE.js.map +1 -0
- package/dist/core/web/public/next/assets/verse-model-BQ0Y2CSr.js +2 -0
- package/dist/core/web/public/next/assets/verse-model-BQ0Y2CSr.js.map +1 -0
- package/dist/core/web/public/next/assets/verse-store-b_Lek_c5.js +3 -0
- package/dist/core/web/public/next/assets/verse-store-b_Lek_c5.js.map +1 -0
- package/dist/core/web/public/next/assets/verse-ui-store-D7YXi63q.js +3 -0
- package/dist/core/web/public/next/assets/{verse-ui-store-zafyzXKD.js.map → verse-ui-store-D7YXi63q.js.map} +1 -1
- package/dist/core/web/public/next/assets/{viewport-BEqGUoTA.js → viewport-BYGH5EgA.js} +2 -2
- package/dist/core/web/public/next/assets/{viewport-BEqGUoTA.js.map → viewport-BYGH5EgA.js.map} +1 -1
- package/dist/core/web/public/next/assets/warmup-AsqwWCUi.js +3 -0
- package/dist/core/web/public/next/assets/{warmup-BR6pxAKs.js.map → warmup-AsqwWCUi.js.map} +1 -1
- package/dist/core/web/public/next/assets/{workspace-model-D_tWD5Wt.js → workspace-model-CXorJr0G.js} +2 -2
- package/dist/core/web/public/next/assets/{workspace-model-D_tWD5Wt.js.map → workspace-model-CXorJr0G.js.map} +1 -1
- package/dist/core/web/public/next/index.html +1 -1
- package/dist/release-dependency-inventory.json +1 -1
- package/package.json +5 -2
- package/dist/cli/activation.d.ts +0 -41
- package/dist/cli/activation.js +0 -485
- package/dist/cli/activation.js.map +0 -1
- package/dist/core/fleet/generated-repair-resolution.d.ts +0 -36
- package/dist/core/fleet/generated-repair-resolution.js +0 -245
- package/dist/core/fleet/generated-repair-resolution.js.map +0 -1
- package/dist/core/local-runtime/llama/port.d.ts +0 -17
- package/dist/core/local-runtime/llama/port.js +0 -47
- package/dist/core/local-runtime/llama/port.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-host.d.ts +0 -54
- package/dist/core/local-runtime/llama/proxy-host.js +0 -159
- package/dist/core/local-runtime/llama/proxy-host.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-process.d.ts +0 -148
- package/dist/core/local-runtime/llama/proxy-process.js +0 -250
- package/dist/core/local-runtime/llama/proxy-process.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-record.d.ts +0 -40
- package/dist/core/local-runtime/llama/proxy-record.js +0 -133
- package/dist/core/local-runtime/llama/proxy-record.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-supervisor.d.ts +0 -118
- package/dist/core/local-runtime/llama/proxy-supervisor.js +0 -511
- package/dist/core/local-runtime/llama/proxy-supervisor.js.map +0 -1
- package/dist/core/web/public/next/assets/Advanced-DEM93sKI.js +0 -2
- package/dist/core/web/public/next/assets/App-CimXmK0L.js +0 -7
- package/dist/core/web/public/next/assets/AppsSection-D6U-dSj6.js +0 -2
- package/dist/core/web/public/next/assets/AutonomySection-3V9pUyxm.js +0 -2
- package/dist/core/web/public/next/assets/BranchBar-U8UdpfEB.js +0 -2
- package/dist/core/web/public/next/assets/CapacityStrip-C667yQe8.js +0 -2
- package/dist/core/web/public/next/assets/CapacityStrip-C667yQe8.js.map +0 -1
- package/dist/core/web/public/next/assets/ChatSection-CCcIPpOq.js +0 -3
- package/dist/core/web/public/next/assets/ChatSection-CCcIPpOq.js.map +0 -1
- package/dist/core/web/public/next/assets/CommandPalette-FiD4N8XD.js +0 -2
- package/dist/core/web/public/next/assets/CommandSection-DN8KwH-X.js +0 -2
- package/dist/core/web/public/next/assets/DockHost-DvR-hPhZ.js +0 -2
- package/dist/core/web/public/next/assets/FleetSection-D_zRBCub.js +0 -3
- package/dist/core/web/public/next/assets/GearTray-C7k4l_BW.js +0 -2
- package/dist/core/web/public/next/assets/HandoffDialog-FPVOqOMN.js +0 -2
- package/dist/core/web/public/next/assets/LeaderCard-4R0BhDzT.js +0 -2
- package/dist/core/web/public/next/assets/McpSection-CJ__OJKl.js +0 -2
- package/dist/core/web/public/next/assets/MindSection-BjXHkQPS.js +0 -2
- package/dist/core/web/public/next/assets/MutationTokenDialog-Cum_DqQZ.css +0 -1
- package/dist/core/web/public/next/assets/MutationTokenDialog-SkRxqV_I.js +0 -2
- package/dist/core/web/public/next/assets/MutationTokenDialog-SkRxqV_I.js.map +0 -1
- package/dist/core/web/public/next/assets/NeedsYouDrawer-rSd1ZHAR.js +0 -2
- package/dist/core/web/public/next/assets/NewChatDialog-BeDQ1eW3.js +0 -3
- package/dist/core/web/public/next/assets/OnboardingFlow-CkTZtt-m.js +0 -2
- package/dist/core/web/public/next/assets/PreviewPane-kzbbSK4u.js +0 -2
- package/dist/core/web/public/next/assets/ResourcesChrome-B3Z3O98t.css +0 -1
- package/dist/core/web/public/next/assets/ResourcesChrome-BzV6bkIa.js +0 -3
- package/dist/core/web/public/next/assets/ResourcesChrome-BzV6bkIa.js.map +0 -1
- package/dist/core/web/public/next/assets/ResourcesDrawer-o4ILHdep.js +0 -2
- package/dist/core/web/public/next/assets/ResourcesDrawer-o4ILHdep.js.map +0 -1
- package/dist/core/web/public/next/assets/RouteErrorBoundary-6RMd_aZg.css +0 -1
- package/dist/core/web/public/next/assets/RouteErrorBoundary-C5SxA2Dg.js +0 -2
- package/dist/core/web/public/next/assets/RouteErrorBoundary-C5SxA2Dg.js.map +0 -1
- package/dist/core/web/public/next/assets/SeatSelector-DpvvbjNm.js +0 -3
- package/dist/core/web/public/next/assets/SessionInsightChip-CWye87Ju.js +0 -2
- package/dist/core/web/public/next/assets/SettingsSection-Dr18upeE.js +0 -2
- package/dist/core/web/public/next/assets/SettingsSection-Dr18upeE.js.map +0 -1
- package/dist/core/web/public/next/assets/Sheet-DZKcQXQg.js +0 -2
- package/dist/core/web/public/next/assets/ShortcutsOverlay-BpDimdPq.js +0 -2
- package/dist/core/web/public/next/assets/Sidebar-BoBzBEFX.js +0 -3
- package/dist/core/web/public/next/assets/TerminalPane-_1aH4ndN.js +0 -7
- package/dist/core/web/public/next/assets/UniverseConsoleApp-BUsq-inZ.js +0 -2
- package/dist/core/web/public/next/assets/UsageSection-DiX_dTyo.js +0 -2
- package/dist/core/web/public/next/assets/VerseConsoleApp-WVeyJnW7.js +0 -3
- package/dist/core/web/public/next/assets/VerseConsoleApp-WVeyJnW7.js.map +0 -1
- package/dist/core/web/public/next/assets/Workspace-BYW9dm90.css +0 -1
- package/dist/core/web/public/next/assets/Workspace-BbxZHwQd.js +0 -10
- package/dist/core/web/public/next/assets/Workspace-BbxZHwQd.js.map +0 -1
- package/dist/core/web/public/next/assets/actions-s2lfm_5k.js +0 -2
- package/dist/core/web/public/next/assets/budget-queries-wUshcovN.js +0 -2
- package/dist/core/web/public/next/assets/cloud-queries-CnV1yaNG.js +0 -2
- package/dist/core/web/public/next/assets/command-catalog-BdtDH93o.js +0 -2
- package/dist/core/web/public/next/assets/command-catalog-BdtDH93o.js.map +0 -1
- package/dist/core/web/public/next/assets/context-model-Dwd49-dp.js +0 -2
- package/dist/core/web/public/next/assets/context-model-MT17V86_.js +0 -2
- package/dist/core/web/public/next/assets/context-queries-xVKIeynP.js +0 -2
- package/dist/core/web/public/next/assets/control-queries-DOZR-D8G.js +0 -2
- package/dist/core/web/public/next/assets/dock-panes-UKS-mXhr.js +0 -2
- package/dist/core/web/public/next/assets/dock-panes-UKS-mXhr.js.map +0 -1
- package/dist/core/web/public/next/assets/fleet-queries-BSdRlUwJ.js +0 -2
- package/dist/core/web/public/next/assets/git-model-CivuBY_D.js +0 -5
- package/dist/core/web/public/next/assets/global-Di2PUgj4.js +0 -2
- package/dist/core/web/public/next/assets/global-Di2PUgj4.js.map +0 -1
- package/dist/core/web/public/next/assets/global-_tOCFt9y.css +0 -1
- package/dist/core/web/public/next/assets/guarded-action-CvOHcqyH.js +0 -2
- package/dist/core/web/public/next/assets/guarded-action-CvOHcqyH.js.map +0 -1
- package/dist/core/web/public/next/assets/icons-B_yuAgdN.js +0 -2
- package/dist/core/web/public/next/assets/icons-B_yuAgdN.js.map +0 -1
- package/dist/core/web/public/next/assets/mutations-Dpsql5t7.js +0 -2
- package/dist/core/web/public/next/assets/overnight-queries-X-44Gsw5.js +0 -2
- package/dist/core/web/public/next/assets/primitives-BDIcUvob.js +0 -1
- package/dist/core/web/public/next/assets/reasoning-pref-B9-DJUXP.js +0 -2
- package/dist/core/web/public/next/assets/seat-subscription-CH6fW4fJ.js +0 -2
- package/dist/core/web/public/next/assets/slots-Ds9ZIqUL.js +0 -3
- package/dist/core/web/public/next/assets/surface-data-J52iIGMD.js +0 -2
- package/dist/core/web/public/next/assets/surface-prefetch-CgZ-LEJK.js +0 -2
- package/dist/core/web/public/next/assets/use-guarded-action-C2HlSzkz.js +0 -2
- package/dist/core/web/public/next/assets/use-token-gate-B3IJL6bf.js +0 -2
- package/dist/core/web/public/next/assets/useActivity-Bk3XgXjL.js +0 -2
- package/dist/core/web/public/next/assets/useActivity-Bk3XgXjL.js.map +0 -1
- package/dist/core/web/public/next/assets/useChartWidth-BAtVgn2n.css +0 -1
- package/dist/core/web/public/next/assets/useChartWidth-lZ9PrQn0.js +0 -2
- package/dist/core/web/public/next/assets/verse-model-D7NZQFAR.js +0 -2
- package/dist/core/web/public/next/assets/verse-model-D7NZQFAR.js.map +0 -1
- package/dist/core/web/public/next/assets/verse-queries-DvIJcn6Z.js +0 -2
- package/dist/core/web/public/next/assets/verse-queries-DvIJcn6Z.js.map +0 -1
- package/dist/core/web/public/next/assets/verse-store-DjBWj04q.js +0 -3
- package/dist/core/web/public/next/assets/verse-store-DjBWj04q.js.map +0 -1
- package/dist/core/web/public/next/assets/verse-ui-store-zafyzXKD.js +0 -3
- package/dist/core/web/public/next/assets/warmup-BR6pxAKs.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChartWidth-lZ9PrQn0.js","names":[],"sources":["../../../../../../src/web-ui/components/charts/chart-tokens.css","../../../../../../src/web-ui/components/charts/chart-math.ts","../../../../../../src/web-ui/components/charts/useTextScale.ts","../../../../../../src/web-ui/components/charts/TableView.module.css","../../../../../../src/web-ui/components/charts/TableView.tsx","../../../../../../src/web-ui/components/charts/plot.module.css","../../../../../../src/web-ui/components/charts/ChartParts.tsx","../../../../../../src/web-ui/components/charts/ChartFrame.module.css","../../../../../../src/web-ui/components/charts/ChartFrame.tsx","../../../../../../src/web-ui/components/charts/useChartWidth.ts"],"sourcesContent":["/**\n * components/charts/chart-tokens.css — chart-only aliases over the design\n * tokens (owner: unit C0, with colors.ts; the chart components are C7's).\n * Every value below is `var(--existing-token)`, never a hex: the raw values\n * and their light/dark variants live in design/tokens.css, so theming is\n * inherited and can never drift out of sync with the rest of the app.\n *\n * V3.10 COLOUR ROLES (SPEC-310C §6), one meaning per hue:\n *\n * QUANTITY — `--chart-seq-1..7`, the fixed azure ramp at 214°\n * (tokens.css --data-seq-*). Every magnitude — heat cells, a single\n * nominal series, gauge fills, the positive diverging pole — is azure.\n * It is NEVER the accent: the accent is interaction-only and the\n * operator can drag it to any hue, which used to re-colour every chart\n * (tokens-310.test.ts fails if a data token here points at --accent-*).\n *\n * CATEGORICAL — `--chart-series-1..6` (tokens.css --data-cat-*). Six\n * identity inks chosen to avoid every engine, status and quantity hue,\n * with the validator scores recorded in tokens.css. Order is identity,\n * never rank: a series keeps its slot even when others are filtered out.\n * A seventh series goes to `--chart-neutral` (\"Other\") — colors.ts never\n * cycles, because a repeated colour would say two series are one.\n *\n * UNKNOWN — gray, drawn as a 45° HATCH with an outline, never a solid\n * fill on a data ramp (a solid gray would read as \"zero\" or \"neutral\").\n * `--chart-unknown-hatch` for CSS fills; colors.ts UNKNOWN_HATCH for SVG.\n *\n * QUEUED / PARKED — a neutral OUTLINE with no fill (Fleet Gantt, Swimlane).\n *\n * ENGINES — identity only, and only in charts that show nothing else\n * (runs by engine, usage bars); passed explicitly via colors.ts\n * engineColor(), never picked by index.\n *\n * STATUS — unchanged; always travels with a text label.\n *\n * Mandatory secondary encoding (direct or legend labels, and the TableView\n * twin every chart has) stays in place whatever the palette scores — colour\n * is never the only carrier of meaning.\n */\n:root {\n /* Categorical identity (fixed order; see tokens.css for the derivation). */\n --chart-series-1: var(--data-cat-1); /* steel */\n --chart-series-2: var(--data-cat-2); /* olive */\n --chart-series-3: var(--data-cat-3); /* wine */\n --chart-series-4: var(--data-cat-4); /* purple */\n --chart-series-5: var(--data-cat-5); /* green */\n --chart-series-6: var(--data-cat-6); /* pink */\n\n /* Overflow \"Other\" bucket — never part of the identity rotation above. */\n --chart-neutral: var(--status-neutral-solid);\n\n /* Quantity: the fixed azure ramp, low → high. */\n --chart-seq-1: var(--data-seq-1);\n --chart-seq-2: var(--data-seq-2);\n --chart-seq-3: var(--data-seq-3);\n --chart-seq-4: var(--data-seq-4);\n --chart-seq-5: var(--data-seq-5);\n --chart-seq-6: var(--data-seq-6);\n --chart-seq-7: var(--data-seq-7);\n\n /* The single hue for magnitude and for one nominal series (one series\n needs no legend box — it takes this colour and a direct label). */\n --chart-sequential: var(--chart-seq-5);\n --chart-sequential-soft: var(--chart-seq-3);\n\n /* Diverging pair around a neutral midpoint: azure reads \"up / better\",\n danger reads \"down / worse\" (ForestPlot effect sizes, deltas). */\n --chart-diverging-pos: var(--chart-seq-5);\n --chart-diverging-neg: var(--status-danger-solid);\n --chart-diverging-mid: var(--border-strong);\n\n /* Unknown: gray, hatched at 45°, outlined. */\n --chart-unknown: var(--status-unknown-solid);\n --chart-unknown-hatch: repeating-linear-gradient(135deg, var(--chart-unknown) 0 1px, transparent 1px 5px);\n\n /* Queued / parked: an outline, no fill. */\n --chart-queued-outline: var(--status-neutral-solid);\n\n /* Chart chrome — hairline grid/axis, one step off the surface. */\n --chart-grid: var(--border-subtle);\n --chart-axis: var(--border-strong);\n --chart-surface: var(--bg-surface);\n --chart-tooltip-bg: var(--bg-surface-raised);\n --chart-tooltip-border: var(--border-default);\n\n /* Heat (CalendarHeatmap, MatrixHeatmap): four steps of the quantity ramp.\n Step 0 is a TRUE ZERO; \"no data\" is the unknown hatch or an outlined\n empty cell, never a colour on this ramp. */\n --chart-heat-0: var(--chart-grid);\n --chart-heat-1: var(--chart-seq-2);\n --chart-heat-2: var(--chart-seq-3);\n --chart-heat-3: var(--chart-seq-5);\n --chart-heat-4: var(--chart-seq-7);\n\n /* Gauge/meter track: the lightest step of the fill's own ramp. */\n --chart-track: var(--chart-seq-1);\n\n /* Ink for a number printed on a NEAR-surface quantity cell (colors.ts\n quantityInk, steps 1–4). The END of the gray ramp, not --text-primary:\n the two are the same #09090b in light, but in dark --text-primary is\n #f4f4f5, which measured 4.49:1 on --chart-seq-4 (rgb 31 110 214) — just\n under AA for 12 px digits. --gray-950 flips to #fafafa there: 4.72:1.\n Asserted per step and theme in charts/chart-contrast.test.ts. */\n --chart-quantity-ink: var(--gray-950);\n}\n","/**\n * components/charts/chart-math.ts — the pure geometry and statistics behind\n * the V3.10 chart kit (AreaTrend, BarStack, Swimlane, Funnel, CalendarHeatmap,\n * BurnDown, Gauge). No React, no DOM: every function here is unit tested\n * directly, so a chart component is only layout glue around numbers that are\n * already proven.\n *\n * Honesty rule shared with types.ts: `null` is UNKNOWN and is never coerced to\n * 0 by anything in this file. Functions that need a number skip nulls and say\n * so in their return value.\n */\nimport { formatTick, tickUnit } from './format.js';\n\n// ---------------------------------------------------------------------------\n// Scales and ticks\n// ---------------------------------------------------------------------------\n\nexport interface NiceTickOptions {\n /**\n * The data are whole counts: ticks land on integers only (a max of 1 run\n * gives 0 and 1, never 0 / 0.25 / 0.5 / 0.75 / 1 of a run).\n */\n integer?: boolean;\n /**\n * Never step finer than this (pass a power of ten). axisTicks raises it\n * one decade at a time to reach a resolution a caller's formatter can\n * print — 0.01 for a two-decimal \"$\" formatter — before it ever resorts\n * to integer ticks.\n */\n minStep?: number;\n}\n\n/**\n * \"Nice\" axis ticks: a step of 1, 2 or 5 × 10^n (and 25 × 10^n from 25 up)\n * chosen so there are about `count` intervals, starting at or below `min`\n * and ending at or above `max`. Clean numbers (0 / 250 / 500), never\n * 0 / 233.3 / 466.7.\n *\n * V3.10.1: a 2.5 step is only taken where it stays a whole number (25, 250,\n * …). 0.25 or 2.5 needs one more decimal than its magnitude, and every\n * one-decimal formatter in the app printed a 0–1 axis as\n * \"0 / 0.3 / 0.5 / 0.8 / 1\" — 0.2 steps say the same thing in clean numbers.\n */\nexport function niceTicks(min: number, max: number, count = 4, opts: NiceTickOptions = {}): number[] {\n if (!Number.isFinite(min) || !Number.isFinite(max)) return [0];\n if (max < min) [min, max] = [max, min];\n if (max === min) {\n if (max === 0) return [0, 1];\n const pad = Math.abs(max) * 0.5;\n return niceTicks(Math.min(0, min - pad), max + pad, count, opts);\n }\n const rawStep = (max - min) / Math.max(1, count);\n const magnitude = 10 ** Math.floor(Math.log10(rawStep));\n const residual = rawStep / magnitude;\n const allowQuarter = magnitude >= 10;\n const nice = residual <= 1 ? 1 : residual <= 2 ? 2 : residual <= 2.5 ? (allowQuarter ? 2.5 : 2) : residual <= 5 ? 5 : 10;\n let step = nice * magnitude;\n if (opts.integer && step < 1) step = 1;\n if (opts.minStep !== undefined && Number.isFinite(opts.minStep) && step < opts.minStep) step = opts.minStep;\n const start = Math.floor(min / step) * step;\n const end = Math.ceil(max / step) * step;\n const n = Math.round((end - start) / step);\n // Round away float drift (0.1 + 0.2) so labels stay clean; index-based so\n // the error never accumulates across a long axis.\n const decimals = Math.max(0, -Math.floor(Math.log10(step)) + 1);\n const ticks: number[] = [];\n for (let i = 0; i <= n; i++) ticks.push(Number((start + i * step).toFixed(decimals)) || 0);\n return ticks;\n}\n\n/** True when every value is a whole number — counts, not measurements. */\nexport function allIntegers(values: ReadonlyArray<number>): boolean {\n return values.every((v) => Number.isInteger(v));\n}\n\n/**\n * Does a caller's tick formatter print these ticks honestly? A formatter\n * that rounds (`${Math.round(v)}%`, one decimal, \"13K\") can print two ticks\n * the same, or print 0.25 as \"0.3\". Each label's first number must equal\n * its tick up to a power-of-ten unit change (50 % of 0.5, 12.5K of 12500);\n * labels with no number in them are taken at their word.\n */\nexport function labelsFaithful(ticks: ReadonlyArray<number>, labels: ReadonlyArray<string>): boolean {\n if (new Set(labels).size !== labels.length) return false;\n return ticks.every((tick, i) => {\n if (tick === 0) return true;\n const match = /\\d[\\d,]*(?:\\.\\d+)?/.exec(labels[i] ?? '');\n if (!match) return true;\n const shown = Number(match[0].replace(/,/g, ''));\n if (!Number.isFinite(shown) || shown === 0) return false;\n const ratio = shown / Math.abs(tick);\n const unit = 10 ** Math.round(Math.log10(ratio));\n return Math.abs(ratio / unit - 1) < 1e-6;\n });\n}\n\nexport interface AxisTicks {\n ticks: number[];\n labels: string[];\n step: number;\n}\n\n/**\n * Ticks AND their labels for a numeric axis. With no `format` the labels\n * take their precision from the step and share ONE unit, chosen from the\n * largest tick (format.ts tickUnit / formatTick). With a caller's `format`\n * (units: \"%\", \"$\", \"pts\") the ticks are coarsened until that formatter\n * prints every one of them faithfully — never a rounded label on a precise\n * tick.\n *\n * Coarsening order (V3.10.1 review): fewer ticks at the same resolution,\n * then one decade coarser at a time, and integer ticks only as the last\n * resort. Jumping straight to integers put a day of spend under half a cent\n * on a $0.00–$1.00 axis (the line drawn ~0.6 px off the baseline, reading as\n * a flat zero) when a $0.01 step prints faithfully.\n */\nexport function axisTicks(\n min: number,\n max: number,\n opts: { count?: number; integer?: boolean; format?: (v: number) => string } = {},\n): AxisTicks {\n const count = Math.max(1, opts.count ?? 4);\n const integer = opts.integer === true;\n const format = opts.format;\n const build = (c: number, asInteger: boolean, minStep?: number): AxisTicks => {\n const ticks = niceTicks(min, max, c, { integer: asInteger, minStep });\n const step = ticks.length > 1 ? ticks[1]! - ticks[0]! : 1;\n // One argument only: formatPercent(v, digits) must never get an index.\n if (format) return { ticks, labels: ticks.map((t) => format(t)), step };\n const unit = tickUnit(ticks, step);\n return { ticks, labels: ticks.map((t) => formatTick(t, step, unit)), step };\n };\n const first = build(count, integer);\n if (!opts.format || labelsFaithful(first.ticks, first.labels)) return first;\n if (!Number.isFinite(min) || !Number.isFinite(max) || !(first.step > 0)) return first;\n const faithfulAt = (asInteger: boolean, minStep?: number): AxisTicks | null => {\n for (let c = count; c >= 1; c--) {\n const candidate = build(c, asInteger, minStep);\n if (labelsFaithful(candidate.ticks, candidate.labels)) return candidate;\n }\n return null;\n };\n const sameResolution = faithfulAt(integer);\n if (sameResolution) return sameResolution;\n // One decade coarser at a time, up to ten times the data's own extent (a\n // step past that only draws the data flatter; the integer pass follows).\n const extent = Math.max(Math.abs(min), Math.abs(max), 1);\n for (let decade = Math.floor(Math.log10(first.step)) + 1; 10 ** decade <= extent * 10; decade++) {\n const coarser = faithfulAt(integer, Number((10 ** decade).toPrecision(1)));\n if (coarser) return coarser;\n }\n return faithfulAt(true) ?? first;\n}\n\n/**\n * What a formatter's \"%\" means: 100 when it prints 50 as \"50%\" (values are\n * percent points), 1 when it prints 0.5 as \"50%\" (values are fractions),\n * null when it is not a percent formatter at all.\n */\nexport function percentScale(format: (v: number) => string): 100 | 1 | null {\n const asPercent = (v: number): number | null => {\n const s = format(v).trim();\n if (!s.endsWith('%')) return null;\n const n = Number(s.slice(0, -1).replace(/[,\\s+]/g, ''));\n return Number.isFinite(n) ? n : null;\n };\n if (asPercent(50) === 50) return 100;\n if (asPercent(0.5) === 50) return 1;\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Time domains (V3.10.1)\n// ---------------------------------------------------------------------------\n\n/**\n * 2000-01-01T00:00:00Z. On a time axis anything earlier — 0 from a null\n * timestamp, a NaN from a failed parse — is a leak, not data: it drew an\n * axis starting \"Dec 31\" (1969, in the viewer's zone) on the live Verse.\n */\nexport const MIN_PLAUSIBLE_TIME = 946_684_800_000;\n\nexport function isPlausibleTime(ms: number): boolean {\n return Number.isFinite(ms) && ms >= MIN_PLAUSIBLE_TIME;\n}\n\n/**\n * An x axis is a time axis when any of its values is a plausible epoch-ms\n * timestamp. Small ordinals (0, 1, 2 — an index axis) are not, and keep\n * every finite value.\n */\nexport function isTimeAxis(xs: ReadonlyArray<number>): boolean {\n return xs.some(isPlausibleTime);\n}\n\n/** A filter for x values: on a time axis only plausible timestamps, otherwise any finite value. */\nexport function xKeeper(xs: ReadonlyArray<number>): (x: number) => boolean {\n return isTimeAxis(xs) ? isPlausibleTime : Number.isFinite;\n}\n\n/**\n * The narrowest time domain a chart draws: 10 minutes. A burst of readings\n * a few seconds apart used to stretch across the full width with three\n * identical time labels stacked on each other; widened, it sits as the\n * short cluster it is, on an axis whose ends read as two different times.\n */\nexport const MIN_TIME_SPAN_MS = 10 * 60_000;\n\n/**\n * Widen [min, max] to at least `minSpan`, around its middle ('center') or\n * keeping its right edge ('end' — for axes that end at now or a reset).\n */\nexport function ensureSpan(min: number, max: number, minSpan: number, align: 'center' | 'end' = 'center'): [number, number] {\n if (max < min) [min, max] = [max, min];\n if (max - min >= minSpan) return [min, max];\n if (align === 'end') return [max - minSpan, max];\n const mid = (min + max) / 2;\n return [mid - minSpan / 2, mid + minSpan / 2];\n}\n\n// ---------------------------------------------------------------------------\n// Label layout (V3.10.1): collision-free axis labels and dodged end labels\n// ---------------------------------------------------------------------------\n\n/**\n * Estimated advance of one label character at the DEFAULT display size:\n * --text-xs-size (12 px) × 0.6, the UI sans's average advance at medium\n * weight, rounded up so estimates err wide rather than letting two labels\n * touch.\n *\n * --text-xs-size is `12px * var(--ui-text-scale)`, and Appearance → Display\n * size sets that multiplier to 1.125 (Large) or 1.25 (XLarge). A chart must\n * budget at the size the text really renders — labelCharPx(useTextScale()) —\n * or the layout accepts a pair of 15 px labels as if they were 12 px ones\n * and prints them over each other (V3.10.1 review).\n */\nexport const LABEL_CHAR_PX = 12 * 0.6;\n\n/** A usable display text multiplier: anything non-finite or non-positive is the default, 1. */\nexport function validTextScale(textScale: number): number {\n return Number.isFinite(textScale) && textScale > 0 ? textScale : 1;\n}\n\n/** LABEL_CHAR_PX at a display text scale (1 Default, 1.125 Large, 1.25 XLarge). */\nexport function labelCharPx(textScale = 1): number {\n return LABEL_CHAR_PX * validTextScale(textScale);\n}\n\nexport function estimateTextWidth(text: string, charPx = LABEL_CHAR_PX): number {\n return text.length * charPx;\n}\n\n/**\n * Per-character budget of the y-axis tick gutters at 12 px — a shade under\n * LABEL_CHAR_PX because tick labels are mostly tabular digits.\n */\nconst TICK_CHAR_PX = 7;\n\n/**\n * Left gutter for right-aligned y tick labels: the widest label plus 10 px,\n * clamped to [floor, cap]. The per-character budget AND the cap scale with\n * the display text size (the cap was chosen for 12 px text); the floor is a\n * minimum, not a fit, and does not.\n */\nexport function tickGutter(labels: ReadonlyArray<string>, floor: number, cap: number, textScale = 1): number {\n const s = validTextScale(textScale);\n const widest = Math.max(0, ...labels.map((l) => l.length));\n return Math.min(cap * s, Math.max(floor, widest * TICK_CHAR_PX * s + 10));\n}\n\nexport type LabelAnchor = 'start' | 'middle' | 'end';\n\nexport interface AxisLabelSpec {\n key: string;\n /** Where the label points. */\n x: number;\n /** How it would like to hang off `x`. */\n anchor: LabelAnchor;\n /** Higher survives a collision: a marker / reset > the end > the start > interior ticks. */\n priority: number;\n /** The label at each detail level, most detailed first; the last entry repeats for deeper levels. */\n variants: ReadonlyArray<string>;\n /**\n * Required labels (the ends, markers) decide how far down the detail\n * ladder the axis goes; optional ones (interior ticks) are simply dropped\n * when they collide.\n */\n required?: boolean;\n}\n\nexport interface PlacedAxisLabel {\n key: string;\n text: string;\n x: number;\n anchor: LabelAnchor;\n}\n\nexport interface AxisLabelBounds {\n /** Leftmost / rightmost extent a label may occupy. */\n min: number;\n max: number;\n /** Minimum clear space between two labels. */\n gap?: number;\n charPx?: number;\n}\n\nfunction placeLevel(specs: ReadonlyArray<AxisLabelSpec>, level: number, bounds: AxisLabelBounds): PlacedAxisLabel[] {\n const gap = bounds.gap ?? 8;\n const order = specs.map((s, i) => ({ s, i })).sort((a, b) => b.s.priority - a.s.priority || a.i - b.i);\n const boxes: { left: number; right: number; text: string; i: number; label: PlacedAxisLabel }[] = [];\n for (const { s, i } of order) {\n const text = s.variants[Math.min(level, s.variants.length - 1)] ?? '';\n if (!text) continue;\n const w = estimateTextWidth(text, bounds.charPx);\n if (w > bounds.max - bounds.min) continue;\n let left = s.anchor === 'start' ? s.x : s.anchor === 'end' ? s.x - w : s.x - w / 2;\n let x = s.x;\n let anchor: LabelAnchor = s.anchor;\n // Keep the label inside the axis: pinned to an edge, it hangs off that edge.\n if (left < bounds.min) {\n left = bounds.min;\n x = bounds.min;\n anchor = 'start';\n } else if (left + w > bounds.max) {\n left = bounds.max - w;\n x = bounds.max;\n anchor = 'end';\n }\n const right = left + w;\n // Two labels that say the same thing are one label too many, wherever they sit.\n const clash = boxes.some((b) => b.text === text || (left < b.right + gap && b.left < right + gap));\n if (clash) continue;\n boxes.push({ left, right, text, i, label: { key: s.key, text, x, anchor } });\n }\n return boxes.sort((a, b) => a.i - b.i).map((b) => b.label);\n}\n\n/**\n * Lay out one axis's labels so none overlap. Every label at a level uses\n * the same rung of its detail ladder; the chosen level is the most detailed\n * one that places as many REQUIRED labels as any level can. Within a level,\n * higher priority wins a collision and the loser is dropped — so a tight\n * burn-down keeps \"Resets Sep 25\" and shortens or drops the start, rather\n * than printing the two over each other.\n */\nexport function layoutAxisLabels(specs: ReadonlyArray<AxisLabelSpec>, bounds: AxisLabelBounds): PlacedAxisLabel[] {\n if (specs.length === 0) return [];\n const levels = Math.max(1, ...specs.map((s) => s.variants.length));\n const requiredKeys = new Set(specs.filter((s) => s.required !== false).map((s) => s.key));\n let best: PlacedAxisLabel[] = [];\n let bestScore = -1;\n for (let level = 0; level < levels; level++) {\n const placed = placeLevel(specs, level, bounds);\n const score = placed.filter((p) => requiredKeys.has(p.key)).length;\n if (score > bestScore) {\n best = placed;\n bestScore = score;\n }\n if (bestScore === requiredKeys.size) break;\n }\n return best;\n}\n\n/**\n * Spread direct labels (end-of-line series names) vertically so none\n * overlaps: labels closer than `gap` merge into a cluster centred on their\n * own targets, clamped inside [top, bottom]. Returns each key's y, or null\n * when they cannot all fit — the caller then falls back to the legend\n * alone rather than drawing labels over each other. Ties keep input order.\n */\nexport function dodgeLabels(\n items: ReadonlyArray<{ key: string; y: number }>,\n gap: number,\n top: number,\n bottom: number,\n): Map<string, number> | null {\n if (items.length === 0) return new Map();\n if ((items.length - 1) * gap > bottom - top + 1e-9) return null;\n const sorted = items.map((it, i) => ({ ...it, i })).sort((a, b) => a.y - b.y || a.i - b.i);\n interface Cluster { members: typeof sorted; top: number }\n const place = (members: typeof sorted): Cluster => {\n const mean = members.reduce((s, m) => s + m.y, 0) / members.length;\n const extent = (members.length - 1) * gap;\n return { members, top: clamp(mean - extent / 2, top, bottom - extent) };\n };\n let clusters: Cluster[] = sorted.map((m) => place([m]));\n for (let merged = true; merged; ) {\n merged = false;\n for (let i = 0; i + 1 < clusters.length; i++) {\n const a = clusters[i]!;\n const b = clusters[i + 1]!;\n if (a.top + a.members.length * gap > b.top + 1e-9) {\n clusters = [...clusters.slice(0, i), place([...a.members, ...b.members]), ...clusters.slice(i + 2)];\n merged = true;\n break;\n }\n }\n }\n const out = new Map<string, number>();\n for (const c of clusters) c.members.forEach((m, k) => out.set(m.key, c.top + k * gap));\n return out;\n}\n\n/** Linear map from [d0, d1] to [r0, r1]; a zero-width domain maps to the range midpoint. */\nexport function linearScale(d0: number, d1: number, r0: number, r1: number): (v: number) => number {\n const span = d1 - d0;\n if (span === 0) return () => (r0 + r1) / 2;\n return (v: number) => r0 + ((v - d0) / span) * (r1 - r0);\n}\n\n/** Evenly thinned indexes so at most `max` labels are drawn, always keeping the last one. */\nexport function thinIndexes(length: number, max: number): number[] {\n if (length <= 0) return [];\n if (max <= 1) return [length - 1];\n if (length <= max) return Array.from({ length }, (_, i) => i);\n const step = Math.ceil((length - 1) / (max - 1));\n const out: number[] = [];\n for (let i = length - 1; i >= 0; i -= step) out.push(i);\n return out.reverse();\n}\n\n/** Clamp to [lo, hi]. */\nexport function clamp(v: number, lo: number, hi: number): number {\n return Math.min(hi, Math.max(lo, v));\n}\n\n// ---------------------------------------------------------------------------\n// Runs (null-aware line segments)\n// ---------------------------------------------------------------------------\n\nexport interface XY {\n x: number;\n y: number;\n}\n\n/** Split a series at nulls so a gap renders as a break, never as a dip to zero. */\nexport function splitRuns(points: ReadonlyArray<{ x: number; y: number | null }>): XY[][] {\n const runs: XY[][] = [];\n let current: XY[] = [];\n for (const p of points) {\n if (p.y === null || !Number.isFinite(p.y)) {\n if (current.length) runs.push(current);\n current = [];\n continue;\n }\n current.push({ x: p.x, y: p.y });\n }\n if (current.length) runs.push(current);\n return runs;\n}\n\nexport function linePath(run: ReadonlyArray<XY>): string {\n return run.map((p, i) => `${i === 0 ? 'M' : 'L'}${round(p.x)},${round(p.y)}`).join(' ');\n}\n\n/** Closed area under (or between) a run and a baseline run of equal length. */\nexport function areaPath(top: ReadonlyArray<XY>, bottom: ReadonlyArray<XY>): string {\n if (top.length === 0) return '';\n const back = [...bottom].reverse();\n return `${linePath(top)} ${back.map((p) => `L${round(p.x)},${round(p.y)}`).join(' ')} Z`;\n}\n\nexport function round(v: number): number {\n return Math.round(v * 10) / 10;\n}\n\n// ---------------------------------------------------------------------------\n// Stacking\n// ---------------------------------------------------------------------------\n\nexport interface StackSegment {\n /** Segment index in the caller's segment list. */\n index: number;\n value: number;\n y0: number;\n y1: number;\n}\n\nexport interface StackedColumn {\n segments: StackSegment[];\n /** Sum of known values. */\n total: number;\n /** True when at least one segment value is null (the total is a lower bound). */\n incomplete: boolean;\n /** True when every segment value is null (nothing is known). */\n unknown: boolean;\n}\n\n/** Stack one column's values bottom-up. Nulls are skipped and flagged, zeros take no height. */\nexport function stackColumn(values: ReadonlyArray<number | null>): StackedColumn {\n let acc = 0;\n let incomplete = false;\n let known = 0;\n const segments: StackSegment[] = [];\n values.forEach((value, index) => {\n if (value === null || !Number.isFinite(value)) {\n incomplete = true;\n return;\n }\n known++;\n const v = Math.max(0, value);\n if (v > 0) segments.push({ index, value: v, y0: acc, y1: acc + v });\n acc += v;\n });\n return { segments, total: acc, incomplete, unknown: known === 0 && values.length > 0 };\n}\n\n// ---------------------------------------------------------------------------\n// Rounded-end bars (4 px data end, square at the baseline)\n// ---------------------------------------------------------------------------\n\n/**\n * Path for a vertical bar whose TOP corners are rounded by `r` (the data end)\n * and whose bottom sits square on the baseline. `r` shrinks for short bars so\n * the corners never cross.\n */\nexport function roundedTopBar(x: number, y: number, w: number, h: number, r = 4): string {\n if (h <= 0 || w <= 0) return '';\n const rr = Math.max(0, Math.min(r, w / 2, h));\n return [\n `M${round(x)},${round(y + h)}`,\n `L${round(x)},${round(y + rr)}`,\n `Q${round(x)},${round(y)} ${round(x + rr)},${round(y)}`,\n `L${round(x + w - rr)},${round(y)}`,\n `Q${round(x + w)},${round(y)} ${round(x + w)},${round(y + rr)}`,\n `L${round(x + w)},${round(y + h)}`,\n 'Z',\n ].join(' ');\n}\n\n/** Horizontal twin: RIGHT corners rounded (the data end), left square on the baseline. */\nexport function roundedRightBar(x: number, y: number, w: number, h: number, r = 4): string {\n if (h <= 0 || w <= 0) return '';\n const rr = Math.max(0, Math.min(r, h / 2, w));\n return [\n `M${round(x)},${round(y)}`,\n `L${round(x + w - rr)},${round(y)}`,\n `Q${round(x + w)},${round(y)} ${round(x + w)},${round(y + rr)}`,\n `L${round(x + w)},${round(y + h - rr)}`,\n `Q${round(x + w)},${round(y + h)} ${round(x + w - rr)},${round(y + h)}`,\n `L${round(x)},${round(y + h)}`,\n 'Z',\n ].join(' ');\n}\n\n// ---------------------------------------------------------------------------\n// Funnel\n// ---------------------------------------------------------------------------\n\nexport interface FunnelStep {\n value: number | null;\n /** Share of the FIRST stage (0..1), null when either side is unknown or the first is 0. */\n ofFirst: number | null;\n /** Share of the PREVIOUS stage (0..1), null for the first stage or when unknown. */\n ofPrevious: number | null;\n}\n\nexport function funnelSteps(values: ReadonlyArray<number | null>): FunnelStep[] {\n const first = values[0] ?? null;\n return values.map((value, i) => {\n const previous = i > 0 ? values[i - 1] ?? null : null;\n return {\n value,\n ofFirst: value !== null && first !== null && first > 0 ? value / first : null,\n ofPrevious: i > 0 && value !== null && previous !== null && previous > 0 ? value / previous : null,\n };\n });\n}\n\n// ---------------------------------------------------------------------------\n// Calendar heatmap\n// ---------------------------------------------------------------------------\n\nexport interface CalendarCell {\n day: string;\n value: number | null;\n /** Column (week index from the first rendered week). */\n week: number;\n /** Row, 0 = weekStart. */\n weekday: number;\n /** True for days before the first datum / after the last (padding cells). */\n outside: boolean;\n}\n\nexport interface CalendarGrid {\n cells: CalendarCell[];\n weeks: number;\n /** Week index where each month first appears, for the month labels. */\n months: { week: number; label: string }[];\n}\n\nconst MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\nfunction utcDayMs(day: string): number | null {\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(day)) return null;\n const ms = Date.parse(`${day}T00:00:00Z`);\n return Number.isFinite(ms) && new Date(ms).toISOString().slice(0, 10) === day ? ms : null;\n}\n\n/**\n * Lay out consecutive days on a weeks × weekdays grid. Input days may be\n * sparse or unordered; missing days in the span become `value: null`\n * (unknown), never 0. `weekStart` 1 = Monday (ISO), 0 = Sunday.\n */\nexport function calendarGrid(\n days: ReadonlyArray<{ day: string; value: number | null }>,\n weekStart: 0 | 1 = 1,\n): CalendarGrid {\n const byDay = new Map<string, number | null>();\n let minMs = Infinity;\n let maxMs = -Infinity;\n for (const d of days) {\n const ms = utcDayMs(d.day);\n // A pre-2000 day is a null/zero date that leaked through, not a datum —\n // one would stretch the grid back to 1970.\n if (ms === null || ms < MIN_PLAUSIBLE_TIME) continue;\n byDay.set(d.day, d.value);\n minMs = Math.min(minMs, ms);\n maxMs = Math.max(maxMs, ms);\n }\n if (!Number.isFinite(minMs)) return { cells: [], weeks: 0, months: [] };\n const DAY = 86_400_000;\n const firstWeekday = (new Date(minMs).getUTCDay() - weekStart + 7) % 7;\n const gridStart = minMs - firstWeekday * DAY;\n const lastWeekday = (new Date(maxMs).getUTCDay() - weekStart + 7) % 7;\n const gridEnd = maxMs + (6 - lastWeekday) * DAY;\n const cells: CalendarCell[] = [];\n const months: { week: number; label: string }[] = [];\n let lastMonth = -1;\n for (let ms = gridStart, i = 0; ms <= gridEnd; ms += DAY, i++) {\n const day = new Date(ms).toISOString().slice(0, 10);\n const week = Math.floor(i / 7);\n const weekday = i % 7;\n const outside = ms < minMs || ms > maxMs;\n cells.push({ day, value: outside ? null : byDay.has(day) ? byDay.get(day)! : null, week, weekday, outside });\n const month = new Date(ms).getUTCMonth();\n // First rendered week of each month; the component drops a label that\n // would collide with the previous one.\n if (!outside && month !== lastMonth) {\n months.push({ week, label: MONTHS[month]! });\n lastMonth = month;\n }\n }\n return { cells, weeks: Math.floor((gridEnd - gridStart) / DAY / 7) + 1, months };\n}\n\n/**\n * Bucket a value into 0..steps for a sequential ramp: 0 is reserved for a\n * true zero, 1..steps split (0, max] evenly. null → null (unknown).\n */\nexport function heatBucket(value: number | null, max: number, steps = 4): number | null {\n if (value === null || !Number.isFinite(value)) return null;\n if (value <= 0 || max <= 0) return 0;\n return clamp(Math.ceil((value / max) * steps), 1, steps);\n}\n\n// ---------------------------------------------------------------------------\n// Burn-down projection\n// ---------------------------------------------------------------------------\n\nexport interface BurnPoint {\n t: number;\n remaining: number | null;\n}\n\nexport interface BurnProjection {\n /** Units per millisecond (negative while burning). Null with fewer than two known points. */\n slopePerMs: number | null;\n /** When the projection crosses 0, if it does before `resetAt`. */\n exhaustAt: number | null;\n /** When it crosses `reserve`, if a reserve is set and it does before `resetAt`. */\n reserveAt: number | null;\n /** Projected remaining at reset (clamped at 0), or null when there is no slope. */\n remainingAtReset: number | null;\n /** The last known point the projection starts from. */\n from: { t: number; remaining: number } | null;\n}\n\n/**\n * Least-squares slope over the most recent `window` known points, projected\n * forward from the last known point. A flat or rising series never\n * \"exhausts\". Pure: the caller supplies `resetAt`.\n *\n * `resetAt` null (or non-finite) is an UNKNOWN reset: nothing is projected\n * forward — there is no moment to project to — so only a line the window\n * has ALREADY crossed is reported, and remainingAtReset is null. (An\n * epoch-0 reset used to fail every `at <= resetAt` check and come back as\n * \"no crossing, current remaining at reset\": a green verdict for a seat\n * burning 10%/h.)\n */\nexport function projectBurnDown(\n points: ReadonlyArray<BurnPoint>,\n resetAtIn: number | null,\n opts: { window?: number; reserve?: number | null } = {},\n): BurnProjection {\n const resetAt = resetAtIn !== null && Number.isFinite(resetAtIn) ? resetAtIn : null;\n const known = points\n .filter((p): p is { t: number; remaining: number } => p.remaining !== null && Number.isFinite(p.remaining) && Number.isFinite(p.t))\n .sort((a, b) => a.t - b.t);\n const from = known.length ? known[known.length - 1]! : null;\n const recent = known.slice(-(opts.window ?? 6));\n if (!from || recent.length < 2) {\n return { slopePerMs: null, exhaustAt: null, reserveAt: null, remainingAtReset: null, from };\n }\n const n = recent.length;\n const meanT = recent.reduce((s, p) => s + p.t, 0) / n;\n const meanR = recent.reduce((s, p) => s + p.remaining, 0) / n;\n let num = 0;\n let den = 0;\n for (const p of recent) {\n num += (p.t - meanT) * (p.remaining - meanR);\n den += (p.t - meanT) ** 2;\n }\n const slope = den === 0 ? 0 : num / den;\n const crossing = (level: number): number | null => {\n if (from.remaining <= level) return from.t;\n if (slope >= 0 || resetAt === null) return null;\n const at = from.t + (level - from.remaining) / slope;\n return at <= resetAt ? at : null;\n };\n const reserve = opts.reserve ?? null;\n return {\n slopePerMs: slope,\n exhaustAt: crossing(0),\n reserveAt: reserve === null ? null : crossing(reserve),\n remainingAtReset: resetAt === null ? null : Math.max(0, from.remaining + slope * Math.max(0, resetAt - from.t)),\n from,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Gauge arcs\n// ---------------------------------------------------------------------------\n\n/** Point on a circle; angle in radians, 0 = +x axis, measured counter-clockwise (SVG y flipped). */\nexport function polar(cx: number, cy: number, r: number, angle: number): XY {\n return { x: cx + r * Math.cos(angle), y: cy - r * Math.sin(angle) };\n}\n\n/**\n * SVG arc for a 180° gauge from fraction `f0` to `f1` (0 = left end, 1 =\n * right end, sweeping over the top). Fractions are clamped to [0, 1].\n */\nexport function gaugeArc(cx: number, cy: number, r: number, f0: number, f1: number): string {\n const a = clamp(f0, 0, 1);\n const b = clamp(f1, 0, 1);\n if (b <= a) return '';\n const start = polar(cx, cy, r, Math.PI * (1 - a));\n const end = polar(cx, cy, r, Math.PI * (1 - b));\n // A 180° gauge never needs the large-arc flag (the span is at most π).\n return `M${round(start.x)},${round(start.y)} A${r},${r} 0 0 1 ${round(end.x)},${round(end.y)}`;\n}\n\nexport type GaugeSeverity = 'ok' | 'warn' | 'danger' | 'unknown';\n\nexport function gaugeSeverity(value: number | null, warn: number, danger: number): GaugeSeverity {\n if (value === null || !Number.isFinite(value)) return 'unknown';\n if (value >= danger) return 'danger';\n if (value >= warn) return 'warn';\n return 'ok';\n}\n","/**\n * components/charts/useTextScale.ts — the operator's Display size, as the\n * multiplier every type token carries: --ui-text-scale is 1 at Default,\n * 1.125 at Large and 1.25 at XLarge (clamped back to 1.125 for XLarge under\n * 1100 px — see the [data-ui-scale] blocks in design/tokens.css).\n *\n * Charts lay labels out from WIDTH ESTIMATES (chart-math layoutAxisLabels,\n * dodgeLabels, tickGutter) written for 12 px text. This is what they\n * multiply those estimates by, so the no-overlap guarantee holds at the size\n * the labels actually render instead of only at Default (V3.10.1 review:\n * at XLarge a weekly burn-down's start and reset labels overprinted).\n *\n * Read from <html>, where data/appearance-store.ts sets data-ui-scale and\n * tokens.css resolves --ui-text-scale. ONE shared subscription for every\n * chart on screen — a MutationObserver for the setting and a resize\n * listener for the narrow-window clamp (a media query) — not one per chart.\n */\nimport { useSyncExternalStore } from 'react';\nimport { validTextScale } from './chart-math.js';\n\n/** --ui-text-scale as computed on `root` (default <html>); 1 when unset or unreadable. */\nexport function readTextScale(root: Element | null = typeof document === 'undefined' ? null : document.documentElement): number {\n if (!root || typeof getComputedStyle !== 'function') return 1;\n return validTextScale(Number.parseFloat(getComputedStyle(root).getPropertyValue('--ui-text-scale')));\n}\n\nconst listeners = new Set<() => void>();\nlet current: number | null = null;\nlet stopWatching: (() => void) | null = null;\n\nfunction refresh(): void {\n const next = readTextScale();\n if (next === current) return;\n current = next;\n for (const listener of listeners) listener();\n}\n\nfunction watch(): () => void {\n current = readTextScale();\n const root = document.documentElement;\n // `style` as well as the attribute: an inline --ui-text-scale is the same\n // setting, and the check is one computed-style read per mutation batch.\n const observer = typeof MutationObserver === 'undefined' ? null : new MutationObserver(refresh);\n observer?.observe(root, { attributes: true, attributeFilter: ['data-ui-scale', 'style'] });\n const raf = typeof requestAnimationFrame === 'function';\n let frame = 0;\n const onResize = (): void => {\n if (!raf) return refresh();\n cancelAnimationFrame(frame);\n frame = requestAnimationFrame(refresh);\n };\n window.addEventListener('resize', onResize);\n return () => {\n observer?.disconnect();\n if (raf) cancelAnimationFrame(frame);\n window.removeEventListener('resize', onResize);\n };\n}\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener);\n if (listeners.size === 1 && typeof document !== 'undefined') stopWatching = watch();\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0) return;\n stopWatching?.();\n stopWatching = null;\n current = null;\n };\n}\n\nfunction getSnapshot(): number {\n return current ?? readTextScale();\n}\n\n/** The display text multiplier; re-renders the caller when the operator changes Display size. */\nexport function useTextScale(): number {\n return useSyncExternalStore(subscribe, getSnapshot, () => 1);\n}\n",".table {\n width: 100%;\n border-collapse: collapse;\n font-size: var(--text-xs-size);\n}\n\n.table th,\n.table td {\n text-align: left;\n padding: var(--space-1) var(--space-2);\n border-bottom: 1px solid var(--border-subtle);\n}\n\n.table th {\n color: var(--text-tertiary);\n font-weight: var(--font-weight-medium);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n font-size: var(--text-xs-size);\n}\n\n.numeric {\n text-align: right;\n font-variant-numeric: tabular-nums;\n}\n\n.empty {\n color: var(--text-tertiary);\n text-align: center;\n}\n","/**\n * components/charts/TableView.tsx — the WCAG-clean accessibility twin every\n * chart should ship (dataviz skill: \"no table view / color-only encoding on\n * a continuous scale\" is an anti-pattern). Every value a chart's tooltip or\n * direct label shows must also be reachable here without hovering anything.\n */\nimport type { ReactNode } from 'react';\nimport styles from './TableView.module.css';\n\nexport interface TableColumn<T> {\n key: string;\n label: string;\n numeric?: boolean;\n render: (row: T) => ReactNode;\n}\n\nexport function TableView<T>({\n caption,\n columns,\n rows,\n rowKey,\n emptyMessage = 'No rows.',\n}: {\n caption: string;\n columns: TableColumn<T>[];\n rows: T[];\n rowKey: (row: T, index: number) => string;\n /** Shown as a single full-width row when `rows` is empty (V3.10). */\n emptyMessage?: string;\n}) {\n return (\n <table className={styles.table}>\n <caption className=\"visually-hidden\">{caption}</caption>\n <thead>\n <tr>\n {columns.map((c) => (\n <th key={c.key} scope=\"col\" className={c.numeric ? styles.numeric : undefined}>\n {c.label}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.length === 0 ? (\n <tr>\n <td colSpan={Math.max(1, columns.length)} className={styles.empty}>\n {emptyMessage}\n </td>\n </tr>\n ) : null}\n {rows.map((row, i) => (\n <tr key={rowKey(row, i)}>\n {columns.map((c) => (\n <td key={c.key} className={c.numeric ? styles.numeric : undefined}>\n {c.render(row)}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n","/* Shared plot chrome for the V3.10 charts: recessive hairline grid/axes,\n text in text tokens (never the series colour), one tooltip style. */\n.plotWrap {\n position: relative;\n width: 100%;\n min-width: 0;\n}\n\n.svg {\n display: block;\n overflow: visible;\n max-width: 100%;\n}\n\n.grid {\n stroke: var(--chart-grid);\n stroke-width: 1;\n shape-rendering: crispEdges;\n}\n\n.axis {\n stroke: var(--chart-axis);\n stroke-width: 1;\n shape-rendering: crispEdges;\n}\n\n.tick {\n font-family: var(--font-ui);\n font-size: var(--text-xs-size);\n fill: var(--text-tertiary);\n font-variant-numeric: tabular-nums;\n}\n\n.label {\n font-family: var(--font-ui);\n font-size: var(--text-xs-size);\n fill: var(--text-secondary);\n}\n\n.labelStrong {\n font-family: var(--font-ui);\n font-size: var(--text-xs-size);\n font-weight: var(--font-weight-medium);\n fill: var(--text-primary);\n}\n\n.line {\n fill: none;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.wash {\n stroke: none;\n opacity: 0.1;\n}\n\n.reference {\n fill: none;\n stroke: var(--text-tertiary);\n stroke-width: 1;\n stroke-dasharray: 4 3;\n}\n\n.projection {\n fill: none;\n stroke-width: 2;\n stroke-dasharray: 5 4;\n stroke-linecap: round;\n}\n\n.marker {\n stroke: var(--chart-surface);\n stroke-width: 2;\n}\n\n.crosshair {\n stroke: var(--chart-axis);\n stroke-width: 1;\n pointer-events: none;\n}\n\n.hit {\n fill: transparent;\n cursor: default;\n}\n\n.hit:focus {\n outline: none;\n}\n\n.hit:focus-visible {\n stroke: var(--border-focus);\n stroke-width: 2;\n}\n\n.focusable:focus {\n outline: none;\n}\n\n.focusable:focus-visible {\n outline: 2px solid var(--border-focus);\n outline-offset: 2px;\n border-radius: var(--radius-sm);\n}\n\n.track {\n fill: var(--chart-track);\n}\n\n/* V3.10.1 — the empty part of a bar that is a share of something (Funnel):\n NEUTRAL, because the azure --chart-track reads as \"a little\" — at zero a\n whole row of it read as 100%. It is the app's empty-meter token, not the\n heat-0 hairline gray it first borrowed: that measured 1.18:1 / 1.14:1 on\n the card, so a zero stage was blank space and a bar's length had nothing\n to be read against. --meter-track is 1.83:1 light / 2.06:1 dark (the\n floor tokens.css holds an empty meter to) while the azure fill stays\n 2.66:1 / 2.50:1 against it — a 3:1 track would cut that data edge to\n ~1.6:1, and each stage's count and rate are printed beside its bar.\n Asserted in charts/chart-contrast.test.ts. */\n.trackEmpty {\n fill: var(--meter-track);\n}\n\n.noData {\n fill: none;\n stroke: var(--chart-grid);\n stroke-width: 1;\n stroke-dasharray: 2 2;\n}\n\n.tooltip {\n position: absolute;\n z-index: var(--z-dropdown);\n pointer-events: none;\n transform: translate(-50%, calc(-100% - 8px));\n padding: var(--space-2);\n border: 1px solid var(--chart-tooltip-border);\n border-radius: var(--radius-sm);\n background: var(--chart-tooltip-bg);\n box-shadow: var(--shadow-md);\n color: var(--text-primary);\n font-size: var(--text-xs-size);\n white-space: nowrap;\n}\n\n.tooltipTitle {\n color: var(--text-tertiary);\n margin-bottom: var(--space-1);\n}\n\n.tooltipRow {\n display: flex;\n align-items: center;\n gap: var(--space-2);\n}\n\n.tooltipKey {\n width: 8px;\n height: 8px;\n border-radius: 2px;\n flex: none;\n}\n\n.tooltipValue {\n margin-left: auto;\n padding-left: var(--space-3);\n font-weight: var(--font-weight-semibold);\n font-variant-numeric: tabular-nums;\n}\n\n.tooltipMuted {\n color: var(--text-tertiary);\n font-style: italic;\n}\n\n.legend {\n display: flex;\n flex-wrap: wrap;\n gap: var(--space-1) var(--space-3);\n margin: var(--space-2) 0 0;\n padding: 0;\n list-style: none;\n font-size: var(--text-xs-size);\n color: var(--text-secondary);\n}\n\n.legendItem {\n display: inline-flex;\n align-items: center;\n gap: var(--space-1);\n}\n\n.swatch {\n width: 10px;\n height: 10px;\n border-radius: 2px;\n flex: none;\n}\n\n.swatchLine {\n width: 12px;\n height: 2px;\n flex: none;\n}\n\n.swatchEmpty {\n width: 10px;\n height: 10px;\n border-radius: 2px;\n flex: none;\n border: 1px dashed var(--chart-axis);\n}\n\n.note {\n margin: var(--space-2) 0 0;\n font-size: var(--text-xs-size);\n color: var(--text-tertiary);\n}\n\n.srOnly {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .animated {\n transition: opacity 120ms ease;\n }\n}\n\n/* V3.10 — engine monogram beside a lane label (EngineTick). */\n.monogram {\n font-family: var(--font-display);\n font-size: var(--text-2xs-size);\n font-weight: var(--font-weight-semibold);\n fill: var(--text-secondary);\n}\n\n/* V3.10 — an unknown mark: hatch fill (set inline via url(#id)) + outline. */\n.unknownMark {\n stroke: var(--chart-unknown);\n stroke-width: 1;\n}\n\n/* A swatch in a legend that stands for \"unknown / not measured\". */\n.swatchHatch {\n width: 10px;\n height: 10px;\n border-radius: 2px;\n flex: none;\n border: 1px solid var(--chart-unknown);\n background: var(--chart-unknown-hatch);\n}\n\n/* Text laid over the plot (reference labels): a surface-coloured halo keeps it\n legible where it crosses a line, in both themes. */\n.halo {\n paint-order: stroke;\n stroke: var(--chart-surface);\n stroke-width: 3px;\n stroke-linejoin: round;\n}\n","/**\n * components/charts/ChartParts.tsx — small shared pieces of the V3.10 charts:\n * the legend list, the tooltip, the unknown hatch and the engine tick.\n * Identity is never colour alone: every swatch sits beside its text label,\n * and text always wears text tokens.\n */\nimport type { ReactNode } from 'react';\nimport { UNKNOWN_HATCH, engineColor, type ChartEngine } from './colors.js';\nimport plot from './plot.module.css';\n\nexport interface ChartLegendItem {\n label: string;\n color?: string;\n /** `hatch` = the unknown texture (not measured), never a colour. */\n kind?: 'swatch' | 'line' | 'empty' | 'hatch';\n}\n\n/** Renders nothing for fewer than `min` items (a lone series is named by the title). */\nexport function ChartLegend({ items, min = 2 }: { items: ChartLegendItem[]; min?: number }): ReactNode {\n if (items.length < min) return null;\n return (\n <ul className={plot.legend}>\n {items.map((item) => (\n <li key={item.label} className={plot.legendItem}>\n <span\n aria-hidden=\"true\"\n className={\n item.kind === 'line' ? plot.swatchLine : item.kind === 'empty' ? plot.swatchEmpty : item.kind === 'hatch' ? plot.swatchHatch : plot.swatch\n }\n style={item.kind === 'empty' || item.kind === 'hatch' ? undefined : { background: item.color }}\n />\n {item.label}\n </li>\n ))}\n </ul>\n );\n}\n\nexport interface TooltipRow {\n key: string;\n label: string;\n value: string | null;\n color?: string;\n}\n\n/**\n * Positioned in the plot's own pixel space (the plot wrapper is\n * position:relative). `left` is clamped by the caller so it never overflows.\n */\nexport function ChartTooltip({ left, top, title, rows }: { left: number; top: number; title: string; rows: TooltipRow[] }) {\n return (\n <div className={plot.tooltip} style={{ left, top }} role=\"presentation\">\n <div className={plot.tooltipTitle}>{title}</div>\n {rows.map((row) => (\n <div key={row.key} className={plot.tooltipRow}>\n {row.color ? <span className={plot.tooltipKey} style={{ background: row.color }} aria-hidden=\"true\" /> : null}\n <span>{row.label}</span>\n {row.value === null ? (\n <span className={`${plot.tooltipValue} ${plot.tooltipMuted}`}>no data</span>\n ) : (\n <span className={plot.tooltipValue}>{row.value}</span>\n )}\n </div>\n ))}\n </div>\n );\n}\n\n/** Keep a centred tooltip inside [margin, width - margin]. */\nexport function clampTooltipLeft(x: number, width: number, margin = 70): number {\n return Math.min(Math.max(x, Math.min(margin, width / 2)), Math.max(width - margin, width / 2));\n}\n\n// ---------------------------------------------------------------------------\n// Unknown hatch (V3.10) — one <pattern> per chart instance\n// ---------------------------------------------------------------------------\n\n/**\n * The 45° unknown hatch as an SVG <pattern>. Render it inside the chart's own\n * <svg><defs> with an id from `hatchPatternId(useId())` (colors.ts) — ids are\n * document-global, so a shared literal id would let one chart's unmount blank\n * another's hatch — then fill unknown marks with `url(#id)` and outline them\n * with CHART_UNKNOWN. Texture, not hue, is what separates \"not measured\" from\n * a low value, so it survives colour-blindness and greyscale print.\n */\nexport function HatchPattern({ id }: { id: string }) {\n const { size, angle, strokeWidth, stroke } = UNKNOWN_HATCH;\n return (\n <pattern id={id} width={size} height={size} patternUnits=\"userSpaceOnUse\" patternTransform={`rotate(${angle})`}>\n <line x1={0} y1={0} x2={0} y2={size} stroke={stroke} strokeWidth={strokeWidth} />\n </pattern>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Engine identity (V3.10) — a 2px tick plus a one-letter monogram\n// ---------------------------------------------------------------------------\n\nconst ENGINE_LETTER: Readonly<Record<ChartEngine, string>> = { claude: 'C', codex: 'X', grok: 'G', local: 'L' };\n\n/** The monogram letter for an engine (mirrors workbench-types ENGINE_MONOGRAM; charts stay core-free). */\nexport function engineLetter(engine: ChartEngine): string {\n return ENGINE_LETTER[engine];\n}\n\n/**\n * SVG engine mark for a lane label: the 2px identity tick and the monogram.\n * Never a vendor logo (SPEC-310C §6). The engine's NAME still travels in the\n * lane's spoken summary and the table — the letter is a glance aid only.\n */\nexport function EngineTick({ engine, x, y, height }: { engine: ChartEngine; x: number; y: number; height: number }) {\n return (\n <g data-engine={engine} aria-hidden=\"true\">\n <rect x={x} y={y} width={2} height={height} rx={1} fill={engineColor(engine)} />\n <text className={plot.monogram} x={x + 6} y={y + height / 2} dy=\"0.34em\">\n {ENGINE_LETTER[engine]}\n </text>\n </g>\n );\n}\n\n/** A quiet ⋯ glyph (three dots), currentColor, 16px. */\nexport function MoreGlyph() {\n return (\n <svg width={16} height={16} viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\">\n <circle cx={3.5} cy={8} r={1.4} fill=\"currentColor\" />\n <circle cx={8} cy={8} r={1.4} fill=\"currentColor\" />\n <circle cx={12.5} cy={8} r={1.4} fill=\"currentColor\" />\n </svg>\n );\n}\n",".frame {\n margin: 0;\n min-width: 0;\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-lg);\n background: var(--bg-surface);\n /* V3.10: 16px (12px compact density) — the card-pad token follows density. */\n padding: var(--card-pad, var(--space-4));\n}\n\n.header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--space-3);\n flex-wrap: wrap;\n margin-bottom: var(--space-3);\n}\n\n.actions {\n display: inline-flex;\n align-items: center;\n gap: var(--space-2);\n flex: none;\n margin-left: auto;\n}\n\n.menuWrap {\n position: relative;\n display: inline-flex;\n}\n\n/* The ⋯ button: quiet until hovered or focused, but always a real control. */\n.more {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: calc(var(--control-h-xs, 20px) + 4px);\n height: calc(var(--control-h-xs, 20px) + 4px);\n padding: 0;\n border: 1px solid transparent;\n border-radius: var(--radius-sm);\n background: transparent;\n color: var(--text-tertiary);\n cursor: pointer;\n transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);\n}\n\n.more:hover,\n.more[aria-expanded='true'] {\n background: var(--bg-hover);\n color: var(--text-primary);\n}\n\n.more:focus-visible {\n outline: 2px solid var(--border-focus);\n outline-offset: 1px;\n}\n\n.menu {\n position: absolute;\n top: calc(100% + var(--space-1));\n right: 0;\n z-index: var(--z-dropdown);\n display: flex;\n flex-direction: column;\n min-width: 176px;\n padding: var(--space-1);\n border: 1px solid var(--border-default);\n border-radius: var(--radius-md);\n background: var(--bg-surface-raised);\n box-shadow: var(--shadow-menu);\n}\n\n.menuItem {\n display: flex;\n align-items: center;\n gap: var(--space-2);\n padding: var(--space-1) var(--space-2);\n border: 0;\n border-radius: var(--radius-sm);\n background: transparent;\n color: var(--text-primary);\n font: inherit;\n font-size: var(--text-xs-size);\n line-height: var(--text-xs-line);\n text-align: left;\n cursor: pointer;\n}\n\n.menuItem:hover,\n.menuItem:focus-visible {\n background: var(--bg-hover);\n outline: none;\n}\n\n.check {\n width: 1em;\n color: var(--text-secondary);\n}\n\n.hint {\n margin-left: auto;\n padding: 0 var(--space-1);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-xs, 3px);\n color: var(--text-tertiary);\n font-family: var(--font-mono);\n font-size: var(--text-2xs-size);\n}\n\n.heading {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.title {\n font-size: var(--text-sm-size);\n font-weight: var(--font-weight-semibold);\n color: var(--text-primary);\n}\n\n.description {\n font-size: var(--text-xs-size);\n color: var(--text-tertiary);\n}\n\n.plot {\n position: relative;\n width: 100%;\n min-width: 0;\n}\n\n.table {\n max-height: 360px;\n overflow: auto;\n}\n\n.caveat {\n margin: 0 0 var(--space-3);\n padding: var(--space-2) var(--space-3);\n border-radius: var(--radius-md);\n background: var(--status-unknown-bg);\n color: var(--status-unknown-fg);\n font-size: var(--text-xs-size);\n line-height: var(--text-sm-line);\n}\n\n.state {\n margin: 0;\n padding: var(--space-6) var(--space-3);\n text-align: center;\n color: var(--text-tertiary);\n font-size: var(--text-sm-size);\n}\n\n.dark {\n display: flex;\n flex-direction: column;\n gap: var(--space-1);\n align-items: center;\n}\n\n.darkTitle {\n margin: 0;\n color: var(--text-secondary);\n font-weight: var(--font-weight-semibold);\n}\n\n.darkBody {\n margin: 0;\n font-size: var(--text-xs-size);\n max-width: 44ch;\n}\n\n.unknown {\n color: var(--status-unknown-fg);\n}\n","/**\n * components/charts/ChartFrame.tsx — the shell every V3.10 chart renders in:\n * title + description, an honest caveat, the Table twin (the WCAG-clean view,\n * reachable without hovering anything), and the designed non-ready states. A\n * chart never draws empty axes: it says what the emptiness means.\n *\n * loading — the previous render is held when there is one (no skeleton\n * flash on refetch); otherwise a quiet placeholder.\n * empty — \"No runs in this window.\" A genuine, known zero.\n * dark — \"Fleet dark since Sep 1\": nothing has happened since a date.\n * unknown — the source could not be read. Never drawn as zeros.\n *\n * V3.10 (SPEC-310C §6 \"Table toggle: moves into ⋯\"): the Chart | Table\n * segmented control used to sit beside every title — noise on a KPI-sized\n * card, and it wrapped against long titles (\"Memo hit rate\"). It is now a\n * quiet ⋯ menu button (still a real, labelled button: the table stays one\n * Tab + Enter away) plus the `T` key anywhere inside the card, which is the\n * `chart.table` command in routes/verse/shell/command-catalog.ts. The key is\n * matched here directly rather than through the catalog so this shared kit\n * (also used by the legacy console) never imports a route module; the chart\n * tests assert the two stay the same key.\n */\nimport { useCallback, useEffect, useId, useRef, useState, type KeyboardEvent, type ReactNode } from 'react';\nimport { MoreGlyph } from './ChartParts.js';\nimport { formatDayLabel } from './format.js';\nimport './chart-tokens.css';\nimport styles from './ChartFrame.module.css';\n\nexport type ChartStatus =\n | { kind: 'ready' }\n | { kind: 'loading' }\n | { kind: 'empty'; message?: string }\n | { kind: 'dark'; since: string; subject?: string; detail?: string }\n | { kind: 'unknown'; reason?: string };\n\nexport type ChartView = 'chart' | 'table';\n\n/** The key that flips a focused chart card between plot and table (catalog `chart.table`). */\nexport const CHART_TABLE_KEY = 't';\n\nexport interface ChartFrameProps {\n title: string;\n description?: string;\n caveat?: string;\n status?: ChartStatus;\n /** Start on the table (e.g. a screen-reader-first surface, or a matrix at 375 px). */\n defaultView?: ChartView;\n /** Hide the view menu (only for a chart that already IS its numbers). */\n hideToggle?: boolean;\n /** Extra header controls (a facet picker), rendered before the ⋯ menu. */\n actions?: ReactNode;\n /** The plot. */\n children: ReactNode;\n table: ReactNode;\n /** Rendered under the plot in chart view (legends, notes). */\n footer?: ReactNode;\n}\n\n/** \"Sep 1\" from an ISO timestamp or YYYY-MM-DD (UTC day, like the axis labels). */\nexport function sinceLabel(since: string): string {\n return formatDayLabel(since.slice(0, 10));\n}\n\nfunction StatusMessage({ status }: { status: Exclude<ChartStatus, { kind: 'ready' }> }): ReactNode {\n switch (status.kind) {\n case 'loading':\n return <p className={styles.state} aria-busy=\"true\">Loading…</p>;\n case 'empty':\n return <p className={styles.state}>{status.message ?? 'Nothing happened in this window.'}</p>;\n case 'dark':\n return (\n <div className={`${styles.state} ${styles.dark}`}>\n <p className={styles.darkTitle}>\n {status.subject ?? 'Fleet'} dark since {sinceLabel(status.since)}\n </p>\n <p className={styles.darkBody}>{status.detail ?? 'No runs or proposals have been recorded since then.'}</p>\n </div>\n );\n case 'unknown':\n return (\n <p className={`${styles.state} ${styles.unknown}`} role=\"note\">\n Unknown — {status.reason ?? 'the data source could not be read.'} Nothing is shown rather than a guess.\n </p>\n );\n }\n}\n\n/** True when a key press is typing into a field — never steal it for the T shortcut. */\nfunction isEditableTarget(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n const tag = target.tagName;\n return tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || target.isContentEditable;\n}\n\nconst VIEW_ITEMS: ReadonlyArray<{ view: ChartView; label: string; hint: string | null }> = [\n { view: 'chart', label: 'Show as chart', hint: null },\n { view: 'table', label: 'Show as table', hint: 'T' },\n];\n\n/**\n * The ⋯ menu: a menu button (WAI-ARIA menu-button pattern) with two\n * menuitemradio entries. Arrow keys move, Enter / Space pick, Escape and Tab\n * close; focus returns to the button on every close so the keyboard user is\n * never dropped at the top of the document.\n */\nfunction ViewMenu({ title, view, onPick }: { title: string; view: ChartView; onPick: (view: ChartView) => void }) {\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState(0);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const menuId = useId();\n\n const close = useCallback((refocus: boolean) => {\n setOpen(false);\n if (refocus) buttonRef.current?.focus();\n }, []);\n\n useEffect(() => {\n if (!open) return undefined;\n const onDown = (e: PointerEvent): void => {\n const t = e.target as Node | null;\n if (t && (menuRef.current?.contains(t) || buttonRef.current?.contains(t))) return;\n setOpen(false);\n };\n document.addEventListener('pointerdown', onDown);\n return () => document.removeEventListener('pointerdown', onDown);\n }, [open]);\n\n useEffect(() => {\n if (!open) return;\n menuRef.current?.querySelectorAll<HTMLElement>('[role=\"menuitemradio\"]')[active]?.focus();\n }, [open, active]);\n\n function openAt(index: number): void {\n setActive(index);\n setOpen(true);\n }\n\n function onButtonKey(e: KeyboardEvent<HTMLButtonElement>): void {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n openAt(e.key === 'ArrowUp' ? VIEW_ITEMS.length - 1 : 0);\n }\n }\n\n function onMenuKey(e: KeyboardEvent<HTMLDivElement>): void {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setActive((a) => (a + 1) % VIEW_ITEMS.length);\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n setActive((a) => (a - 1 + VIEW_ITEMS.length) % VIEW_ITEMS.length);\n } else if (e.key === 'Home') {\n e.preventDefault();\n setActive(0);\n } else if (e.key === 'End') {\n e.preventDefault();\n setActive(VIEW_ITEMS.length - 1);\n } else if (e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n close(true);\n } else if (e.key === 'Tab') {\n close(false);\n }\n }\n\n return (\n <span className={styles.menuWrap}>\n <button\n ref={buttonRef}\n type=\"button\"\n className={styles.more}\n aria-label={`${title}: view options`}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n aria-controls={open ? menuId : undefined}\n title=\"View options (T toggles the table)\"\n onClick={() => (open ? close(false) : openAt(Math.max(0, VIEW_ITEMS.findIndex((i) => i.view === view))))}\n onKeyDown={onButtonKey}\n >\n <MoreGlyph />\n </button>\n {open ? (\n <div ref={menuRef} id={menuId} role=\"menu\" aria-label={`${title} view`} className={styles.menu} onKeyDown={onMenuKey}>\n {VIEW_ITEMS.map((item, i) => (\n <button\n key={item.view}\n type=\"button\"\n role=\"menuitemradio\"\n aria-checked={view === item.view}\n tabIndex={i === active ? 0 : -1}\n className={styles.menuItem}\n onClick={() => {\n onPick(item.view);\n close(true);\n }}\n >\n <span className={styles.check} aria-hidden=\"true\">{view === item.view ? '✓' : ''}</span>\n <span>{item.label}</span>\n {item.hint ? <kbd className={styles.hint}>{item.hint}</kbd> : null}\n </button>\n ))}\n </div>\n ) : null}\n </span>\n );\n}\n\nexport function ChartFrame({\n title,\n description,\n caveat,\n status = { kind: 'ready' },\n defaultView = 'chart',\n hideToggle = false,\n actions,\n children,\n table,\n footer,\n}: ChartFrameProps) {\n const [view, setView] = useState<ChartView>(defaultView);\n const titleId = useId();\n const ready = status.kind === 'ready';\n const canToggle = ready && !hideToggle;\n\n function onKeyDown(e: KeyboardEvent<HTMLElement>): void {\n if (!canToggle || e.defaultPrevented) return;\n if (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) return;\n if (e.key.toLowerCase() !== CHART_TABLE_KEY || isEditableTarget(e.target)) return;\n e.preventDefault();\n setView((v) => (v === 'chart' ? 'table' : 'chart'));\n }\n\n return (\n <figure className={styles.frame} aria-labelledby={titleId} data-chart-card=\"\" data-view={view} onKeyDown={onKeyDown}>\n <figcaption className={styles.header}>\n <span className={styles.heading}>\n <span id={titleId} className={styles.title}>{title}</span>\n {description ? <span className={styles.description}>{description}</span> : null}\n </span>\n {actions || canToggle ? (\n <span className={styles.actions}>\n {actions}\n {canToggle ? <ViewMenu title={title} view={view} onPick={setView} /> : null}\n </span>\n ) : null}\n </figcaption>\n {caveat ? (\n <p className={styles.caveat} role=\"note\">\n {caveat}\n </p>\n ) : null}\n {!ready ? (\n <StatusMessage status={status} />\n ) : view === 'table' ? (\n <div className={styles.table}>{table}</div>\n ) : (\n <>\n <div className={styles.plot}>{children}</div>\n {footer}\n </>\n )}\n </figure>\n );\n}\n","/**\n * components/charts/useChartWidth.ts — the measured pixel width of a chart's\n * container, so the V3.10 charts draw at their REAL size (text stays 12 px at\n * 375 px wide) instead of scaling a fixed viewBox down until labels are\n * unreadable. Falls back to `fallback` until measured (jsdom, SSR, first paint).\n */\nimport { useLayoutEffect, useState, type RefObject } from 'react';\n\n/** Narrowest width any chart lays itself out for (a 375 px phone minus padding). */\nexport const MIN_CHART_WIDTH = 280;\n\nexport function useChartWidth(ref: RefObject<HTMLElement | null>, fixed: number | undefined, fallback = 640): number {\n const [measured, setMeasured] = useState<number | null>(null);\n // WHY track the node: a chart whose frame starts in a non-ready state\n // (loading / empty / dark) mounts its plot — and so this ref — LATER than\n // the hook. An effect keyed only on the ref object never re-ran, so every\n // chart that first rendered \"Loading…\" stayed at the 640 px fallback and\n // was scaled down by CSS (V3.10 fix, found in the 1440 harness).\n const [node, setNode] = useState<HTMLElement | null>(null);\n // Runs after every render on purpose (ref.current is not a dependency React\n // can see); the equality guard makes it settle in one pass, never a loop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(() => {\n if (ref.current !== node) setNode(ref.current);\n });\n useLayoutEffect(() => {\n if (fixed !== undefined) return undefined;\n const el = node;\n if (!el) return undefined;\n const read = (): void => {\n const w = Math.floor(el.getBoundingClientRect().width);\n // 0 means \"not laid out yet\" (hidden tab, jsdom) — keep the fallback.\n if (w > 0) setMeasured((prev) => (prev === w ? prev : w));\n };\n read();\n if (typeof ResizeObserver === 'undefined') return undefined;\n // rAF-coalesced: a drag-resize fires many entries per frame.\n let frame = 0;\n const observer = new ResizeObserver(() => {\n cancelAnimationFrame(frame);\n frame = requestAnimationFrame(read);\n });\n observer.observe(el);\n return () => {\n cancelAnimationFrame(frame);\n observer.disconnect();\n };\n }, [node, fixed]);\n return Math.max(MIN_CHART_WIDTH, fixed ?? measured ?? fallback);\n}\n"],"mappings":"6KC2CA,SAAgB,EAAU,EAAa,EAAa,EAAQ,EAAG,EAAwB,CAAC,EAAa,CACnG,GAAI,CAAC,OAAO,SAAS,CAAG,GAAK,CAAC,OAAO,SAAS,CAAG,EAAG,MAAO,CAAC,CAAC,EAE7D,GADI,EAAM,IAAK,CAAC,EAAK,GAAO,CAAC,EAAK,CAAG,GACjC,IAAQ,EAAK,CACf,GAAI,IAAQ,EAAG,MAAO,CAAC,EAAG,CAAC,EAC3B,IAAM,EAAM,KAAK,IAAI,CAAG,EAAI,G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GAPF,EAAA,EAAA,IAAA,CAAC,GAAD,CAAuB,QAAS,CAAA,CAS5B,GAEZ,CC9PA,SAAgB,GAAc,EAAoC,EAA2B,EAAW,IAAa,CACnH,GAAM,CAAC,EAAU,IAAA,EAAe,EAAA,SAAA,CAAwB,IAAI,EAMtD,CAAC,EAAM,IAAA,EAAW,EAAA,SAAA,CAA6B,IAAI,EA8BzD,OA1BA,EAAA,EAAA,gBAAA,KAAsB,CAChB,EAAI,UAAY,GAAM,EAAQ,EAAI,OAAO,CAC/C,CAAC,GACD,EAAA,EAAA,gBAAA,KAAsB,CACpB,GAAI,IAAU,IAAA,GAAW,OACzB,IAAM,EAAK,EACX,GAAI,CAAC,EAAI,OACT,IAAM,MAAmB,CACvB,IAAM,EAAI,KAAK,MAAM,EAAG,sBAAsB,CAAC,CAAC,KAAK,EAEjD,EAAI,GAAG,EAAa,GAAU,IAAS,EAAI,EAAO,CAAE,CAC1D,EAEA,GADA,EAAK,EACD,OAAO,eAAmB,IAAa,OAE3C,IAAI,EAAQ,EACN,EAAW,IAAI,mBAAqB,CACxC,qBAAqB,CAAK,EAC1B,EAAQ,sBAAsB,CAAI,CACpC,CAAC,EAED,OADA,EAAS,QAAQ,CAAE,MACN,CACX,qBAAqB,CAAK,EAC1B,EAAS,WAAW,CACtB,CACF,EAAG,CAAC,EAAM,CAAK,CAAC,EACT,KAAK,IAAA,IAAqB,GAAS,GAAY,CAAQ,CAChE"}
|
|
1
|
+
{"version":3,"file":"useChartWidth-D9M7kUw7.js","names":[],"sources":["../../../../../../src/web-ui/components/charts/chart-tokens.css","../../../../../../src/web-ui/components/charts/chart-math.ts","../../../../../../src/web-ui/components/charts/useTextScale.ts","../../../../../../src/web-ui/components/charts/TableView.module.css","../../../../../../src/web-ui/components/charts/TableView.tsx","../../../../../../src/web-ui/components/charts/plot.module.css","../../../../../../src/web-ui/components/charts/ChartParts.tsx","../../../../../../src/web-ui/components/charts/ChartFrame.module.css","../../../../../../src/web-ui/components/charts/ChartFrame.tsx","../../../../../../src/web-ui/components/charts/useChartWidth.ts"],"sourcesContent":["/**\n * components/charts/chart-tokens.css — chart-only aliases over the design\n * tokens (owner: unit C0, with colors.ts; the chart components are C7's).\n * Every value below is `var(--existing-token)`, never a hex: the raw values\n * and their light/dark variants live in design/tokens.css, so theming is\n * inherited and can never drift out of sync with the rest of the app.\n *\n * V3.10 COLOUR ROLES (SPEC-310C §6), one meaning per hue:\n *\n * QUANTITY — `--chart-seq-1..7`, the fixed azure ramp at 214°\n * (tokens.css --data-seq-*). Every magnitude — heat cells, a single\n * nominal series, gauge fills, the positive diverging pole — is azure.\n * It is NEVER the accent: the accent is interaction-only and the\n * operator can drag it to any hue, which used to re-colour every chart\n * (tokens-310.test.ts fails if a data token here points at --accent-*).\n *\n * CATEGORICAL — `--chart-series-1..6` (tokens.css --data-cat-*). Six\n * identity inks chosen to avoid every engine, status and quantity hue,\n * with the validator scores recorded in tokens.css. Order is identity,\n * never rank: a series keeps its slot even when others are filtered out.\n * A seventh series goes to `--chart-neutral` (\"Other\") — colors.ts never\n * cycles, because a repeated colour would say two series are one.\n *\n * UNKNOWN — gray, drawn as a 45° HATCH with an outline, never a solid\n * fill on a data ramp (a solid gray would read as \"zero\" or \"neutral\").\n * `--chart-unknown-hatch` for CSS fills; colors.ts UNKNOWN_HATCH for SVG.\n *\n * QUEUED / PARKED — a neutral OUTLINE with no fill (Fleet Gantt, Swimlane).\n *\n * ENGINES — identity only, and only in charts that show nothing else\n * (runs by engine, usage bars); passed explicitly via colors.ts\n * engineColor(), never picked by index.\n *\n * STATUS — unchanged; always travels with a text label.\n *\n * Mandatory secondary encoding (direct or legend labels, and the TableView\n * twin every chart has) stays in place whatever the palette scores — colour\n * is never the only carrier of meaning.\n */\n:root {\n /* Categorical identity (fixed order; see tokens.css for the derivation). */\n --chart-series-1: var(--data-cat-1); /* steel */\n --chart-series-2: var(--data-cat-2); /* olive */\n --chart-series-3: var(--data-cat-3); /* wine */\n --chart-series-4: var(--data-cat-4); /* purple */\n --chart-series-5: var(--data-cat-5); /* green */\n --chart-series-6: var(--data-cat-6); /* pink */\n\n /* Overflow \"Other\" bucket — never part of the identity rotation above. */\n --chart-neutral: var(--status-neutral-solid);\n\n /* Quantity: the fixed azure ramp, low → high. */\n --chart-seq-1: var(--data-seq-1);\n --chart-seq-2: var(--data-seq-2);\n --chart-seq-3: var(--data-seq-3);\n --chart-seq-4: var(--data-seq-4);\n --chart-seq-5: var(--data-seq-5);\n --chart-seq-6: var(--data-seq-6);\n --chart-seq-7: var(--data-seq-7);\n\n /* The single hue for magnitude and for one nominal series (one series\n needs no legend box — it takes this colour and a direct label). */\n --chart-sequential: var(--chart-seq-5);\n --chart-sequential-soft: var(--chart-seq-3);\n\n /* Diverging pair around a neutral midpoint: azure reads \"up / better\",\n danger reads \"down / worse\" (ForestPlot effect sizes, deltas). */\n --chart-diverging-pos: var(--chart-seq-5);\n --chart-diverging-neg: var(--status-danger-solid);\n --chart-diverging-mid: var(--border-strong);\n\n /* Unknown: gray, hatched at 45°, outlined. */\n --chart-unknown: var(--status-unknown-solid);\n --chart-unknown-hatch: repeating-linear-gradient(135deg, var(--chart-unknown) 0 1px, transparent 1px 5px);\n\n /* Queued / parked: an outline, no fill. */\n --chart-queued-outline: var(--status-neutral-solid);\n\n /* Chart chrome — hairline grid/axis, one step off the surface. */\n --chart-grid: var(--border-subtle);\n --chart-axis: var(--border-strong);\n --chart-surface: var(--bg-surface);\n --chart-tooltip-bg: var(--bg-surface-raised);\n --chart-tooltip-border: var(--border-default);\n\n /* Heat (CalendarHeatmap, MatrixHeatmap): four steps of the quantity ramp.\n Step 0 is a TRUE ZERO; \"no data\" is the unknown hatch or an outlined\n empty cell, never a colour on this ramp. */\n --chart-heat-0: var(--chart-grid);\n --chart-heat-1: var(--chart-seq-2);\n --chart-heat-2: var(--chart-seq-3);\n --chart-heat-3: var(--chart-seq-5);\n --chart-heat-4: var(--chart-seq-7);\n\n /* Gauge/meter track: the lightest step of the fill's own ramp. */\n --chart-track: var(--chart-seq-1);\n\n /* Ink for a number printed on a NEAR-surface quantity cell (colors.ts\n quantityInk, steps 1–4). The END of the gray ramp, not --text-primary:\n the two are the same #09090b in light, but in dark --text-primary is\n #f4f4f5, which measured 4.49:1 on --chart-seq-4 (rgb 31 110 214) — just\n under AA for 12 px digits. --gray-950 flips to #fafafa there: 4.72:1.\n Asserted per step and theme in charts/chart-contrast.test.ts. */\n --chart-quantity-ink: var(--gray-950);\n}\n","/**\n * components/charts/chart-math.ts — the pure geometry and statistics behind\n * the V3.10 chart kit (AreaTrend, BarStack, Swimlane, Funnel, CalendarHeatmap,\n * BurnDown, Gauge). No React, no DOM: every function here is unit tested\n * directly, so a chart component is only layout glue around numbers that are\n * already proven.\n *\n * Honesty rule shared with types.ts: `null` is UNKNOWN and is never coerced to\n * 0 by anything in this file. Functions that need a number skip nulls and say\n * so in their return value.\n */\nimport { formatTick, tickUnit } from './format.js';\n\n// ---------------------------------------------------------------------------\n// Scales and ticks\n// ---------------------------------------------------------------------------\n\nexport interface NiceTickOptions {\n /**\n * The data are whole counts: ticks land on integers only (a max of 1 run\n * gives 0 and 1, never 0 / 0.25 / 0.5 / 0.75 / 1 of a run).\n */\n integer?: boolean;\n /**\n * Never step finer than this (pass a power of ten). axisTicks raises it\n * one decade at a time to reach a resolution a caller's formatter can\n * print — 0.01 for a two-decimal \"$\" formatter — before it ever resorts\n * to integer ticks.\n */\n minStep?: number;\n}\n\n/**\n * \"Nice\" axis ticks: a step of 1, 2 or 5 × 10^n (and 25 × 10^n from 25 up)\n * chosen so there are about `count` intervals, starting at or below `min`\n * and ending at or above `max`. Clean numbers (0 / 250 / 500), never\n * 0 / 233.3 / 466.7.\n *\n * V3.10.1: a 2.5 step is only taken where it stays a whole number (25, 250,\n * …). 0.25 or 2.5 needs one more decimal than its magnitude, and every\n * one-decimal formatter in the app printed a 0–1 axis as\n * \"0 / 0.3 / 0.5 / 0.8 / 1\" — 0.2 steps say the same thing in clean numbers.\n */\nexport function niceTicks(min: number, max: number, count = 4, opts: NiceTickOptions = {}): number[] {\n if (!Number.isFinite(min) || !Number.isFinite(max)) return [0];\n if (max < min) [min, max] = [max, min];\n if (max === min) {\n if (max === 0) return [0, 1];\n const pad = Math.abs(max) * 0.5;\n return niceTicks(Math.min(0, min - pad), max + pad, count, opts);\n }\n const rawStep = (max - min) / Math.max(1, count);\n const magnitude = 10 ** Math.floor(Math.log10(rawStep));\n const residual = rawStep / magnitude;\n const allowQuarter = magnitude >= 10;\n const nice = residual <= 1 ? 1 : residual <= 2 ? 2 : residual <= 2.5 ? (allowQuarter ? 2.5 : 2) : residual <= 5 ? 5 : 10;\n let step = nice * magnitude;\n if (opts.integer && step < 1) step = 1;\n if (opts.minStep !== undefined && Number.isFinite(opts.minStep) && step < opts.minStep) step = opts.minStep;\n const start = Math.floor(min / step) * step;\n const end = Math.ceil(max / step) * step;\n const n = Math.round((end - start) / step);\n // Round away float drift (0.1 + 0.2) so labels stay clean; index-based so\n // the error never accumulates across a long axis.\n const decimals = Math.max(0, -Math.floor(Math.log10(step)) + 1);\n const ticks: number[] = [];\n for (let i = 0; i <= n; i++) ticks.push(Number((start + i * step).toFixed(decimals)) || 0);\n return ticks;\n}\n\n/** True when every value is a whole number — counts, not measurements. */\nexport function allIntegers(values: ReadonlyArray<number>): boolean {\n return values.every((v) => Number.isInteger(v));\n}\n\n/**\n * Does a caller's tick formatter print these ticks honestly? A formatter\n * that rounds (`${Math.round(v)}%`, one decimal, \"13K\") can print two ticks\n * the same, or print 0.25 as \"0.3\". Each label's first number must equal\n * its tick up to a power-of-ten unit change (50 % of 0.5, 12.5K of 12500);\n * labels with no number in them are taken at their word.\n */\nexport function labelsFaithful(ticks: ReadonlyArray<number>, labels: ReadonlyArray<string>): boolean {\n if (new Set(labels).size !== labels.length) return false;\n return ticks.every((tick, i) => {\n if (tick === 0) return true;\n const match = /\\d[\\d,]*(?:\\.\\d+)?/.exec(labels[i] ?? '');\n if (!match) return true;\n const shown = Number(match[0].replace(/,/g, ''));\n if (!Number.isFinite(shown) || shown === 0) return false;\n const ratio = shown / Math.abs(tick);\n const unit = 10 ** Math.round(Math.log10(ratio));\n return Math.abs(ratio / unit - 1) < 1e-6;\n });\n}\n\nexport interface AxisTicks {\n ticks: number[];\n labels: string[];\n step: number;\n}\n\n/**\n * Ticks AND their labels for a numeric axis. With no `format` the labels\n * take their precision from the step and share ONE unit, chosen from the\n * largest tick (format.ts tickUnit / formatTick). With a caller's `format`\n * (units: \"%\", \"$\", \"pts\") the ticks are coarsened until that formatter\n * prints every one of them faithfully — never a rounded label on a precise\n * tick.\n *\n * Coarsening order (V3.10.1 review): fewer ticks at the same resolution,\n * then one decade coarser at a time, and integer ticks only as the last\n * resort. Jumping straight to integers put a day of spend under half a cent\n * on a $0.00–$1.00 axis (the line drawn ~0.6 px off the baseline, reading as\n * a flat zero) when a $0.01 step prints faithfully.\n */\nexport function axisTicks(\n min: number,\n max: number,\n opts: { count?: number; integer?: boolean; format?: (v: number) => string } = {},\n): AxisTicks {\n const count = Math.max(1, opts.count ?? 4);\n const integer = opts.integer === true;\n const format = opts.format;\n const build = (c: number, asInteger: boolean, minStep?: number): AxisTicks => {\n const ticks = niceTicks(min, max, c, { integer: asInteger, minStep });\n const step = ticks.length > 1 ? ticks[1]! - ticks[0]! : 1;\n // One argument only: formatPercent(v, digits) must never get an index.\n if (format) return { ticks, labels: ticks.map((t) => format(t)), step };\n const unit = tickUnit(ticks, step);\n return { ticks, labels: ticks.map((t) => formatTick(t, step, unit)), step };\n };\n const first = build(count, integer);\n if (!opts.format || labelsFaithful(first.ticks, first.labels)) return first;\n if (!Number.isFinite(min) || !Number.isFinite(max) || !(first.step > 0)) return first;\n const faithfulAt = (asInteger: boolean, minStep?: number): AxisTicks | null => {\n for (let c = count; c >= 1; c--) {\n const candidate = build(c, asInteger, minStep);\n if (labelsFaithful(candidate.ticks, candidate.labels)) return candidate;\n }\n return null;\n };\n const sameResolution = faithfulAt(integer);\n if (sameResolution) return sameResolution;\n // One decade coarser at a time, up to ten times the data's own extent (a\n // step past that only draws the data flatter; the integer pass follows).\n const extent = Math.max(Math.abs(min), Math.abs(max), 1);\n for (let decade = Math.floor(Math.log10(first.step)) + 1; 10 ** decade <= extent * 10; decade++) {\n const coarser = faithfulAt(integer, Number((10 ** decade).toPrecision(1)));\n if (coarser) return coarser;\n }\n return faithfulAt(true) ?? first;\n}\n\n/**\n * What a formatter's \"%\" means: 100 when it prints 50 as \"50%\" (values are\n * percent points), 1 when it prints 0.5 as \"50%\" (values are fractions),\n * null when it is not a percent formatter at all.\n */\nexport function percentScale(format: (v: number) => string): 100 | 1 | null {\n const asPercent = (v: number): number | null => {\n const s = format(v).trim();\n if (!s.endsWith('%')) return null;\n const n = Number(s.slice(0, -1).replace(/[,\\s+]/g, ''));\n return Number.isFinite(n) ? n : null;\n };\n if (asPercent(50) === 50) return 100;\n if (asPercent(0.5) === 50) return 1;\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Time domains (V3.10.1)\n// ---------------------------------------------------------------------------\n\n/**\n * 2000-01-01T00:00:00Z. On a time axis anything earlier — 0 from a null\n * timestamp, a NaN from a failed parse — is a leak, not data: it drew an\n * axis starting \"Dec 31\" (1969, in the viewer's zone) on the live Verse.\n */\nexport const MIN_PLAUSIBLE_TIME = 946_684_800_000;\n\nexport function isPlausibleTime(ms: number): boolean {\n return Number.isFinite(ms) && ms >= MIN_PLAUSIBLE_TIME;\n}\n\n/**\n * An x axis is a time axis when any of its values is a plausible epoch-ms\n * timestamp. Small ordinals (0, 1, 2 — an index axis) are not, and keep\n * every finite value.\n */\nexport function isTimeAxis(xs: ReadonlyArray<number>): boolean {\n return xs.some(isPlausibleTime);\n}\n\n/** A filter for x values: on a time axis only plausible timestamps, otherwise any finite value. */\nexport function xKeeper(xs: ReadonlyArray<number>): (x: number) => boolean {\n return isTimeAxis(xs) ? isPlausibleTime : Number.isFinite;\n}\n\n/**\n * The narrowest time domain a chart draws: 10 minutes. A burst of readings\n * a few seconds apart used to stretch across the full width with three\n * identical time labels stacked on each other; widened, it sits as the\n * short cluster it is, on an axis whose ends read as two different times.\n */\nexport const MIN_TIME_SPAN_MS = 10 * 60_000;\n\n/**\n * Widen [min, max] to at least `minSpan`, around its middle ('center') or\n * keeping its right edge ('end' — for axes that end at now or a reset).\n */\nexport function ensureSpan(min: number, max: number, minSpan: number, align: 'center' | 'end' = 'center'): [number, number] {\n if (max < min) [min, max] = [max, min];\n if (max - min >= minSpan) return [min, max];\n if (align === 'end') return [max - minSpan, max];\n const mid = (min + max) / 2;\n return [mid - minSpan / 2, mid + minSpan / 2];\n}\n\n// ---------------------------------------------------------------------------\n// Label layout (V3.10.1): collision-free axis labels and dodged end labels\n// ---------------------------------------------------------------------------\n\n/**\n * Estimated advance of one label character at the DEFAULT display size:\n * --text-xs-size (12 px) × 0.6, the UI sans's average advance at medium\n * weight, rounded up so estimates err wide rather than letting two labels\n * touch.\n *\n * --text-xs-size is `12px * var(--ui-text-scale)`, and Appearance → Display\n * size sets that multiplier to 1.125 (Large) or 1.25 (XLarge). A chart must\n * budget at the size the text really renders — labelCharPx(useTextScale()) —\n * or the layout accepts a pair of 15 px labels as if they were 12 px ones\n * and prints them over each other (V3.10.1 review).\n */\nexport const LABEL_CHAR_PX = 12 * 0.6;\n\n/** A usable display text multiplier: anything non-finite or non-positive is the default, 1. */\nexport function validTextScale(textScale: number): number {\n return Number.isFinite(textScale) && textScale > 0 ? textScale : 1;\n}\n\n/** LABEL_CHAR_PX at a display text scale (1 Default, 1.125 Large, 1.25 XLarge). */\nexport function labelCharPx(textScale = 1): number {\n return LABEL_CHAR_PX * validTextScale(textScale);\n}\n\nexport function estimateTextWidth(text: string, charPx = LABEL_CHAR_PX): number {\n return text.length * charPx;\n}\n\n/**\n * Per-character budget of the y-axis tick gutters at 12 px — a shade under\n * LABEL_CHAR_PX because tick labels are mostly tabular digits.\n */\nconst TICK_CHAR_PX = 7;\n\n/**\n * Left gutter for right-aligned y tick labels: the widest label plus 10 px,\n * clamped to [floor, cap]. The per-character budget AND the cap scale with\n * the display text size (the cap was chosen for 12 px text); the floor is a\n * minimum, not a fit, and does not.\n */\nexport function tickGutter(labels: ReadonlyArray<string>, floor: number, cap: number, textScale = 1): number {\n const s = validTextScale(textScale);\n const widest = Math.max(0, ...labels.map((l) => l.length));\n return Math.min(cap * s, Math.max(floor, widest * TICK_CHAR_PX * s + 10));\n}\n\nexport type LabelAnchor = 'start' | 'middle' | 'end';\n\nexport interface AxisLabelSpec {\n key: string;\n /** Where the label points. */\n x: number;\n /** How it would like to hang off `x`. */\n anchor: LabelAnchor;\n /** Higher survives a collision: a marker / reset > the end > the start > interior ticks. */\n priority: number;\n /** The label at each detail level, most detailed first; the last entry repeats for deeper levels. */\n variants: ReadonlyArray<string>;\n /**\n * Required labels (the ends, markers) decide how far down the detail\n * ladder the axis goes; optional ones (interior ticks) are simply dropped\n * when they collide.\n */\n required?: boolean;\n}\n\nexport interface PlacedAxisLabel {\n key: string;\n text: string;\n x: number;\n anchor: LabelAnchor;\n}\n\nexport interface AxisLabelBounds {\n /** Leftmost / rightmost extent a label may occupy. */\n min: number;\n max: number;\n /** Minimum clear space between two labels. */\n gap?: number;\n charPx?: number;\n}\n\nfunction placeLevel(specs: ReadonlyArray<AxisLabelSpec>, level: number, bounds: AxisLabelBounds): PlacedAxisLabel[] {\n const gap = bounds.gap ?? 8;\n const order = specs.map((s, i) => ({ s, i })).sort((a, b) => b.s.priority - a.s.priority || a.i - b.i);\n const boxes: { left: number; right: number; text: string; i: number; label: PlacedAxisLabel }[] = [];\n for (const { s, i } of order) {\n const text = s.variants[Math.min(level, s.variants.length - 1)] ?? '';\n if (!text) continue;\n const w = estimateTextWidth(text, bounds.charPx);\n if (w > bounds.max - bounds.min) continue;\n let left = s.anchor === 'start' ? s.x : s.anchor === 'end' ? s.x - w : s.x - w / 2;\n let x = s.x;\n let anchor: LabelAnchor = s.anchor;\n // Keep the label inside the axis: pinned to an edge, it hangs off that edge.\n if (left < bounds.min) {\n left = bounds.min;\n x = bounds.min;\n anchor = 'start';\n } else if (left + w > bounds.max) {\n left = bounds.max - w;\n x = bounds.max;\n anchor = 'end';\n }\n const right = left + w;\n // Two labels that say the same thing are one label too many, wherever they sit.\n const clash = boxes.some((b) => b.text === text || (left < b.right + gap && b.left < right + gap));\n if (clash) continue;\n boxes.push({ left, right, text, i, label: { key: s.key, text, x, anchor } });\n }\n return boxes.sort((a, b) => a.i - b.i).map((b) => b.label);\n}\n\n/**\n * Lay out one axis's labels so none overlap. Every label at a level uses\n * the same rung of its detail ladder; the chosen level is the most detailed\n * one that places as many REQUIRED labels as any level can. Within a level,\n * higher priority wins a collision and the loser is dropped — so a tight\n * burn-down keeps \"Resets Sep 25\" and shortens or drops the start, rather\n * than printing the two over each other.\n */\nexport function layoutAxisLabels(specs: ReadonlyArray<AxisLabelSpec>, bounds: AxisLabelBounds): PlacedAxisLabel[] {\n if (specs.length === 0) return [];\n const levels = Math.max(1, ...specs.map((s) => s.variants.length));\n const requiredKeys = new Set(specs.filter((s) => s.required !== false).map((s) => s.key));\n let best: PlacedAxisLabel[] = [];\n let bestScore = -1;\n for (let level = 0; level < levels; level++) {\n const placed = placeLevel(specs, level, bounds);\n const score = placed.filter((p) => requiredKeys.has(p.key)).length;\n if (score > bestScore) {\n best = placed;\n bestScore = score;\n }\n if (bestScore === requiredKeys.size) break;\n }\n return best;\n}\n\n/**\n * Spread direct labels (end-of-line series names) vertically so none\n * overlaps: labels closer than `gap` merge into a cluster centred on their\n * own targets, clamped inside [top, bottom]. Returns each key's y, or null\n * when they cannot all fit — the caller then falls back to the legend\n * alone rather than drawing labels over each other. Ties keep input order.\n */\nexport function dodgeLabels(\n items: ReadonlyArray<{ key: string; y: number }>,\n gap: number,\n top: number,\n bottom: number,\n): Map<string, number> | null {\n if (items.length === 0) return new Map();\n if ((items.length - 1) * gap > bottom - top + 1e-9) return null;\n const sorted = items.map((it, i) => ({ ...it, i })).sort((a, b) => a.y - b.y || a.i - b.i);\n interface Cluster { members: typeof sorted; top: number }\n const place = (members: typeof sorted): Cluster => {\n const mean = members.reduce((s, m) => s + m.y, 0) / members.length;\n const extent = (members.length - 1) * gap;\n return { members, top: clamp(mean - extent / 2, top, bottom - extent) };\n };\n let clusters: Cluster[] = sorted.map((m) => place([m]));\n for (let merged = true; merged; ) {\n merged = false;\n for (let i = 0; i + 1 < clusters.length; i++) {\n const a = clusters[i]!;\n const b = clusters[i + 1]!;\n if (a.top + a.members.length * gap > b.top + 1e-9) {\n clusters = [...clusters.slice(0, i), place([...a.members, ...b.members]), ...clusters.slice(i + 2)];\n merged = true;\n break;\n }\n }\n }\n const out = new Map<string, number>();\n for (const c of clusters) c.members.forEach((m, k) => out.set(m.key, c.top + k * gap));\n return out;\n}\n\n/** Linear map from [d0, d1] to [r0, r1]; a zero-width domain maps to the range midpoint. */\nexport function linearScale(d0: number, d1: number, r0: number, r1: number): (v: number) => number {\n const span = d1 - d0;\n if (span === 0) return () => (r0 + r1) / 2;\n return (v: number) => r0 + ((v - d0) / span) * (r1 - r0);\n}\n\n/** Evenly thinned indexes so at most `max` labels are drawn, always keeping the last one. */\nexport function thinIndexes(length: number, max: number): number[] {\n if (length <= 0) return [];\n if (max <= 1) return [length - 1];\n if (length <= max) return Array.from({ length }, (_, i) => i);\n const step = Math.ceil((length - 1) / (max - 1));\n const out: number[] = [];\n for (let i = length - 1; i >= 0; i -= step) out.push(i);\n return out.reverse();\n}\n\n/** Clamp to [lo, hi]. */\nexport function clamp(v: number, lo: number, hi: number): number {\n return Math.min(hi, Math.max(lo, v));\n}\n\n// ---------------------------------------------------------------------------\n// Runs (null-aware line segments)\n// ---------------------------------------------------------------------------\n\nexport interface XY {\n x: number;\n y: number;\n}\n\n/** Split a series at nulls so a gap renders as a break, never as a dip to zero. */\nexport function splitRuns(points: ReadonlyArray<{ x: number; y: number | null }>): XY[][] {\n const runs: XY[][] = [];\n let current: XY[] = [];\n for (const p of points) {\n if (p.y === null || !Number.isFinite(p.y)) {\n if (current.length) runs.push(current);\n current = [];\n continue;\n }\n current.push({ x: p.x, y: p.y });\n }\n if (current.length) runs.push(current);\n return runs;\n}\n\nexport function linePath(run: ReadonlyArray<XY>): string {\n return run.map((p, i) => `${i === 0 ? 'M' : 'L'}${round(p.x)},${round(p.y)}`).join(' ');\n}\n\n/** Closed area under (or between) a run and a baseline run of equal length. */\nexport function areaPath(top: ReadonlyArray<XY>, bottom: ReadonlyArray<XY>): string {\n if (top.length === 0) return '';\n const back = [...bottom].reverse();\n return `${linePath(top)} ${back.map((p) => `L${round(p.x)},${round(p.y)}`).join(' ')} Z`;\n}\n\nexport function round(v: number): number {\n return Math.round(v * 10) / 10;\n}\n\n// ---------------------------------------------------------------------------\n// Stacking\n// ---------------------------------------------------------------------------\n\nexport interface StackSegment {\n /** Segment index in the caller's segment list. */\n index: number;\n value: number;\n y0: number;\n y1: number;\n}\n\nexport interface StackedColumn {\n segments: StackSegment[];\n /** Sum of known values. */\n total: number;\n /** True when at least one segment value is null (the total is a lower bound). */\n incomplete: boolean;\n /** True when every segment value is null (nothing is known). */\n unknown: boolean;\n}\n\n/** Stack one column's values bottom-up. Nulls are skipped and flagged, zeros take no height. */\nexport function stackColumn(values: ReadonlyArray<number | null>): StackedColumn {\n let acc = 0;\n let incomplete = false;\n let known = 0;\n const segments: StackSegment[] = [];\n values.forEach((value, index) => {\n if (value === null || !Number.isFinite(value)) {\n incomplete = true;\n return;\n }\n known++;\n const v = Math.max(0, value);\n if (v > 0) segments.push({ index, value: v, y0: acc, y1: acc + v });\n acc += v;\n });\n return { segments, total: acc, incomplete, unknown: known === 0 && values.length > 0 };\n}\n\n// ---------------------------------------------------------------------------\n// Rounded-end bars (4 px data end, square at the baseline)\n// ---------------------------------------------------------------------------\n\n/**\n * Path for a vertical bar whose TOP corners are rounded by `r` (the data end)\n * and whose bottom sits square on the baseline. `r` shrinks for short bars so\n * the corners never cross.\n */\nexport function roundedTopBar(x: number, y: number, w: number, h: number, r = 4): string {\n if (h <= 0 || w <= 0) return '';\n const rr = Math.max(0, Math.min(r, w / 2, h));\n return [\n `M${round(x)},${round(y + h)}`,\n `L${round(x)},${round(y + rr)}`,\n `Q${round(x)},${round(y)} ${round(x + rr)},${round(y)}`,\n `L${round(x + w - rr)},${round(y)}`,\n `Q${round(x + w)},${round(y)} ${round(x + w)},${round(y + rr)}`,\n `L${round(x + w)},${round(y + h)}`,\n 'Z',\n ].join(' ');\n}\n\n/** Horizontal twin: RIGHT corners rounded (the data end), left square on the baseline. */\nexport function roundedRightBar(x: number, y: number, w: number, h: number, r = 4): string {\n if (h <= 0 || w <= 0) return '';\n const rr = Math.max(0, Math.min(r, h / 2, w));\n return [\n `M${round(x)},${round(y)}`,\n `L${round(x + w - rr)},${round(y)}`,\n `Q${round(x + w)},${round(y)} ${round(x + w)},${round(y + rr)}`,\n `L${round(x + w)},${round(y + h - rr)}`,\n `Q${round(x + w)},${round(y + h)} ${round(x + w - rr)},${round(y + h)}`,\n `L${round(x)},${round(y + h)}`,\n 'Z',\n ].join(' ');\n}\n\n// ---------------------------------------------------------------------------\n// Funnel\n// ---------------------------------------------------------------------------\n\nexport interface FunnelStep {\n value: number | null;\n /** Share of the FIRST stage (0..1), null when either side is unknown or the first is 0. */\n ofFirst: number | null;\n /** Share of the PREVIOUS stage (0..1), null for the first stage or when unknown. */\n ofPrevious: number | null;\n}\n\nexport function funnelSteps(values: ReadonlyArray<number | null>): FunnelStep[] {\n const first = values[0] ?? null;\n return values.map((value, i) => {\n const previous = i > 0 ? values[i - 1] ?? null : null;\n return {\n value,\n ofFirst: value !== null && first !== null && first > 0 ? value / first : null,\n ofPrevious: i > 0 && value !== null && previous !== null && previous > 0 ? value / previous : null,\n };\n });\n}\n\n// ---------------------------------------------------------------------------\n// Calendar heatmap\n// ---------------------------------------------------------------------------\n\nexport interface CalendarCell {\n day: string;\n value: number | null;\n /** Column (week index from the first rendered week). */\n week: number;\n /** Row, 0 = weekStart. */\n weekday: number;\n /** True for days before the first datum / after the last (padding cells). */\n outside: boolean;\n}\n\nexport interface CalendarGrid {\n cells: CalendarCell[];\n weeks: number;\n /** Week index where each month first appears, for the month labels. */\n months: { week: number; label: string }[];\n}\n\nconst MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\nfunction utcDayMs(day: string): number | null {\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(day)) return null;\n const ms = Date.parse(`${day}T00:00:00Z`);\n return Number.isFinite(ms) && new Date(ms).toISOString().slice(0, 10) === day ? ms : null;\n}\n\n/**\n * Lay out consecutive days on a weeks × weekdays grid. Input days may be\n * sparse or unordered; missing days in the span become `value: null`\n * (unknown), never 0. `weekStart` 1 = Monday (ISO), 0 = Sunday.\n */\nexport function calendarGrid(\n days: ReadonlyArray<{ day: string; value: number | null }>,\n weekStart: 0 | 1 = 1,\n): CalendarGrid {\n const byDay = new Map<string, number | null>();\n let minMs = Infinity;\n let maxMs = -Infinity;\n for (const d of days) {\n const ms = utcDayMs(d.day);\n // A pre-2000 day is a null/zero date that leaked through, not a datum —\n // one would stretch the grid back to 1970.\n if (ms === null || ms < MIN_PLAUSIBLE_TIME) continue;\n byDay.set(d.day, d.value);\n minMs = Math.min(minMs, ms);\n maxMs = Math.max(maxMs, ms);\n }\n if (!Number.isFinite(minMs)) return { cells: [], weeks: 0, months: [] };\n const DAY = 86_400_000;\n const firstWeekday = (new Date(minMs).getUTCDay() - weekStart + 7) % 7;\n const gridStart = minMs - firstWeekday * DAY;\n const lastWeekday = (new Date(maxMs).getUTCDay() - weekStart + 7) % 7;\n const gridEnd = maxMs + (6 - lastWeekday) * DAY;\n const cells: CalendarCell[] = [];\n const months: { week: number; label: string }[] = [];\n let lastMonth = -1;\n for (let ms = gridStart, i = 0; ms <= gridEnd; ms += DAY, i++) {\n const day = new Date(ms).toISOString().slice(0, 10);\n const week = Math.floor(i / 7);\n const weekday = i % 7;\n const outside = ms < minMs || ms > maxMs;\n cells.push({ day, value: outside ? null : byDay.has(day) ? byDay.get(day)! : null, week, weekday, outside });\n const month = new Date(ms).getUTCMonth();\n // First rendered week of each month; the component drops a label that\n // would collide with the previous one.\n if (!outside && month !== lastMonth) {\n months.push({ week, label: MONTHS[month]! });\n lastMonth = month;\n }\n }\n return { cells, weeks: Math.floor((gridEnd - gridStart) / DAY / 7) + 1, months };\n}\n\n/**\n * Bucket a value into 0..steps for a sequential ramp: 0 is reserved for a\n * true zero, 1..steps split (0, max] evenly. null → null (unknown).\n */\nexport function heatBucket(value: number | null, max: number, steps = 4): number | null {\n if (value === null || !Number.isFinite(value)) return null;\n if (value <= 0 || max <= 0) return 0;\n return clamp(Math.ceil((value / max) * steps), 1, steps);\n}\n\n// ---------------------------------------------------------------------------\n// Burn-down projection\n// ---------------------------------------------------------------------------\n\nexport interface BurnPoint {\n t: number;\n remaining: number | null;\n}\n\nexport interface BurnProjection {\n /** Units per millisecond (negative while burning). Null with fewer than two known points. */\n slopePerMs: number | null;\n /** When the projection crosses 0, if it does before `resetAt`. */\n exhaustAt: number | null;\n /** When it crosses `reserve`, if a reserve is set and it does before `resetAt`. */\n reserveAt: number | null;\n /** Projected remaining at reset (clamped at 0), or null when there is no slope. */\n remainingAtReset: number | null;\n /** The last known point the projection starts from. */\n from: { t: number; remaining: number } | null;\n}\n\n/**\n * Least-squares slope over the most recent `window` known points, projected\n * forward from the last known point. A flat or rising series never\n * \"exhausts\". Pure: the caller supplies `resetAt`.\n *\n * `resetAt` null (or non-finite) is an UNKNOWN reset: nothing is projected\n * forward — there is no moment to project to — so only a line the window\n * has ALREADY crossed is reported, and remainingAtReset is null. (An\n * epoch-0 reset used to fail every `at <= resetAt` check and come back as\n * \"no crossing, current remaining at reset\": a green verdict for a seat\n * burning 10%/h.)\n */\nexport function projectBurnDown(\n points: ReadonlyArray<BurnPoint>,\n resetAtIn: number | null,\n opts: { window?: number; reserve?: number | null } = {},\n): BurnProjection {\n const resetAt = resetAtIn !== null && Number.isFinite(resetAtIn) ? resetAtIn : null;\n const known = points\n .filter((p): p is { t: number; remaining: number } => p.remaining !== null && Number.isFinite(p.remaining) && Number.isFinite(p.t))\n .sort((a, b) => a.t - b.t);\n const from = known.length ? known[known.length - 1]! : null;\n const recent = known.slice(-(opts.window ?? 6));\n if (!from || recent.length < 2) {\n return { slopePerMs: null, exhaustAt: null, reserveAt: null, remainingAtReset: null, from };\n }\n const n = recent.length;\n const meanT = recent.reduce((s, p) => s + p.t, 0) / n;\n const meanR = recent.reduce((s, p) => s + p.remaining, 0) / n;\n let num = 0;\n let den = 0;\n for (const p of recent) {\n num += (p.t - meanT) * (p.remaining - meanR);\n den += (p.t - meanT) ** 2;\n }\n const slope = den === 0 ? 0 : num / den;\n const crossing = (level: number): number | null => {\n if (from.remaining <= level) return from.t;\n if (slope >= 0 || resetAt === null) return null;\n const at = from.t + (level - from.remaining) / slope;\n return at <= resetAt ? at : null;\n };\n const reserve = opts.reserve ?? null;\n return {\n slopePerMs: slope,\n exhaustAt: crossing(0),\n reserveAt: reserve === null ? null : crossing(reserve),\n remainingAtReset: resetAt === null ? null : Math.max(0, from.remaining + slope * Math.max(0, resetAt - from.t)),\n from,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Gauge arcs\n// ---------------------------------------------------------------------------\n\n/** Point on a circle; angle in radians, 0 = +x axis, measured counter-clockwise (SVG y flipped). */\nexport function polar(cx: number, cy: number, r: number, angle: number): XY {\n return { x: cx + r * Math.cos(angle), y: cy - r * Math.sin(angle) };\n}\n\n/**\n * SVG arc for a 180° gauge from fraction `f0` to `f1` (0 = left end, 1 =\n * right end, sweeping over the top). Fractions are clamped to [0, 1].\n */\nexport function gaugeArc(cx: number, cy: number, r: number, f0: number, f1: number): string {\n const a = clamp(f0, 0, 1);\n const b = clamp(f1, 0, 1);\n if (b <= a) return '';\n const start = polar(cx, cy, r, Math.PI * (1 - a));\n const end = polar(cx, cy, r, Math.PI * (1 - b));\n // A 180° gauge never needs the large-arc flag (the span is at most π).\n return `M${round(start.x)},${round(start.y)} A${r},${r} 0 0 1 ${round(end.x)},${round(end.y)}`;\n}\n\nexport type GaugeSeverity = 'ok' | 'warn' | 'danger' | 'unknown';\n\nexport function gaugeSeverity(value: number | null, warn: number, danger: number): GaugeSeverity {\n if (value === null || !Number.isFinite(value)) return 'unknown';\n if (value >= danger) return 'danger';\n if (value >= warn) return 'warn';\n return 'ok';\n}\n","/**\n * components/charts/useTextScale.ts — the operator's Display size, as the\n * multiplier every type token carries: --ui-text-scale is 1 at Default,\n * 1.125 at Large and 1.25 at XLarge (clamped back to 1.125 for XLarge under\n * 1100 px — see the [data-ui-scale] blocks in design/tokens.css).\n *\n * Charts lay labels out from WIDTH ESTIMATES (chart-math layoutAxisLabels,\n * dodgeLabels, tickGutter) written for 12 px text. This is what they\n * multiply those estimates by, so the no-overlap guarantee holds at the size\n * the labels actually render instead of only at Default (V3.10.1 review:\n * at XLarge a weekly burn-down's start and reset labels overprinted).\n *\n * Read from <html>, where data/appearance-store.ts sets data-ui-scale and\n * tokens.css resolves --ui-text-scale. ONE shared subscription for every\n * chart on screen — a MutationObserver for the setting and a resize\n * listener for the narrow-window clamp (a media query) — not one per chart.\n */\nimport { useSyncExternalStore } from 'react';\nimport { validTextScale } from './chart-math.js';\n\n/** --ui-text-scale as computed on `root` (default <html>); 1 when unset or unreadable. */\nexport function readTextScale(root: Element | null = typeof document === 'undefined' ? null : document.documentElement): number {\n if (!root || typeof getComputedStyle !== 'function') return 1;\n return validTextScale(Number.parseFloat(getComputedStyle(root).getPropertyValue('--ui-text-scale')));\n}\n\nconst listeners = new Set<() => void>();\nlet current: number | null = null;\nlet stopWatching: (() => void) | null = null;\n\nfunction refresh(): void {\n const next = readTextScale();\n if (next === current) return;\n current = next;\n for (const listener of listeners) listener();\n}\n\nfunction watch(): () => void {\n current = readTextScale();\n const root = document.documentElement;\n // `style` as well as the attribute: an inline --ui-text-scale is the same\n // setting, and the check is one computed-style read per mutation batch.\n const observer = typeof MutationObserver === 'undefined' ? null : new MutationObserver(refresh);\n observer?.observe(root, { attributes: true, attributeFilter: ['data-ui-scale', 'style'] });\n const raf = typeof requestAnimationFrame === 'function';\n let frame = 0;\n const onResize = (): void => {\n if (!raf) return refresh();\n cancelAnimationFrame(frame);\n frame = requestAnimationFrame(refresh);\n };\n window.addEventListener('resize', onResize);\n return () => {\n observer?.disconnect();\n if (raf) cancelAnimationFrame(frame);\n window.removeEventListener('resize', onResize);\n };\n}\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener);\n if (listeners.size === 1 && typeof document !== 'undefined') stopWatching = watch();\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0) return;\n stopWatching?.();\n stopWatching = null;\n current = null;\n };\n}\n\nfunction getSnapshot(): number {\n return current ?? readTextScale();\n}\n\n/** The display text multiplier; re-renders the caller when the operator changes Display size. */\nexport function useTextScale(): number {\n return useSyncExternalStore(subscribe, getSnapshot, () => 1);\n}\n",".table {\n width: 100%;\n border-collapse: collapse;\n font-size: var(--text-xs-size);\n}\n\n.table th,\n.table td {\n text-align: left;\n padding: var(--space-1) var(--space-2);\n border-bottom: 1px solid var(--border-subtle);\n}\n\n.table th {\n color: var(--text-tertiary);\n font-weight: var(--font-weight-medium);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n font-size: var(--text-xs-size);\n}\n\n.numeric {\n text-align: right;\n font-variant-numeric: tabular-nums;\n}\n\n.empty {\n color: var(--text-tertiary);\n text-align: center;\n}\n","/**\n * components/charts/TableView.tsx — the WCAG-clean accessibility twin every\n * chart should ship (dataviz skill: \"no table view / color-only encoding on\n * a continuous scale\" is an anti-pattern). Every value a chart's tooltip or\n * direct label shows must also be reachable here without hovering anything.\n */\nimport type { ReactNode } from 'react';\nimport styles from './TableView.module.css';\n\nexport interface TableColumn<T> {\n key: string;\n label: string;\n numeric?: boolean;\n render: (row: T) => ReactNode;\n}\n\nexport function TableView<T>({\n caption,\n columns,\n rows,\n rowKey,\n emptyMessage = 'No rows.',\n}: {\n caption: string;\n columns: TableColumn<T>[];\n rows: T[];\n rowKey: (row: T, index: number) => string;\n /** Shown as a single full-width row when `rows` is empty (V3.10). */\n emptyMessage?: string;\n}) {\n return (\n <table className={styles.table}>\n <caption className=\"visually-hidden\">{caption}</caption>\n <thead>\n <tr>\n {columns.map((c) => (\n <th key={c.key} scope=\"col\" className={c.numeric ? styles.numeric : undefined}>\n {c.label}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.length === 0 ? (\n <tr>\n <td colSpan={Math.max(1, columns.length)} className={styles.empty}>\n {emptyMessage}\n </td>\n </tr>\n ) : null}\n {rows.map((row, i) => (\n <tr key={rowKey(row, i)}>\n {columns.map((c) => (\n <td key={c.key} className={c.numeric ? styles.numeric : undefined}>\n {c.render(row)}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n","/* Shared plot chrome for the V3.10 charts: recessive hairline grid/axes,\n text in text tokens (never the series colour), one tooltip style. */\n.plotWrap {\n position: relative;\n width: 100%;\n min-width: 0;\n}\n\n.svg {\n display: block;\n overflow: visible;\n max-width: 100%;\n}\n\n.grid {\n stroke: var(--chart-grid);\n stroke-width: 1;\n shape-rendering: crispEdges;\n}\n\n.axis {\n stroke: var(--chart-axis);\n stroke-width: 1;\n shape-rendering: crispEdges;\n}\n\n.tick {\n font-family: var(--font-ui);\n font-size: var(--text-xs-size);\n fill: var(--text-tertiary);\n font-variant-numeric: tabular-nums;\n}\n\n.label {\n font-family: var(--font-ui);\n font-size: var(--text-xs-size);\n fill: var(--text-secondary);\n}\n\n.labelStrong {\n font-family: var(--font-ui);\n font-size: var(--text-xs-size);\n font-weight: var(--font-weight-medium);\n fill: var(--text-primary);\n}\n\n.line {\n fill: none;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.wash {\n stroke: none;\n opacity: 0.1;\n}\n\n.reference {\n fill: none;\n stroke: var(--text-tertiary);\n stroke-width: 1;\n stroke-dasharray: 4 3;\n}\n\n.projection {\n fill: none;\n stroke-width: 2;\n stroke-dasharray: 5 4;\n stroke-linecap: round;\n}\n\n.marker {\n stroke: var(--chart-surface);\n stroke-width: 2;\n}\n\n.crosshair {\n stroke: var(--chart-axis);\n stroke-width: 1;\n pointer-events: none;\n}\n\n.hit {\n fill: transparent;\n cursor: default;\n}\n\n.hit:focus {\n outline: none;\n}\n\n.hit:focus-visible {\n stroke: var(--border-focus);\n stroke-width: 2;\n}\n\n.focusable:focus {\n outline: none;\n}\n\n.focusable:focus-visible {\n outline: 2px solid var(--border-focus);\n outline-offset: 2px;\n border-radius: var(--radius-sm);\n}\n\n.track {\n fill: var(--chart-track);\n}\n\n/* V3.10.1 — the empty part of a bar that is a share of something (Funnel):\n NEUTRAL, because the azure --chart-track reads as \"a little\" — at zero a\n whole row of it read as 100%. It is the app's empty-meter token, not the\n heat-0 hairline gray it first borrowed: that measured 1.18:1 / 1.14:1 on\n the card, so a zero stage was blank space and a bar's length had nothing\n to be read against. --meter-track is 1.83:1 light / 2.06:1 dark (the\n floor tokens.css holds an empty meter to) while the azure fill stays\n 2.66:1 / 2.50:1 against it — a 3:1 track would cut that data edge to\n ~1.6:1, and each stage's count and rate are printed beside its bar.\n Asserted in charts/chart-contrast.test.ts. */\n.trackEmpty {\n fill: var(--meter-track);\n}\n\n.noData {\n fill: none;\n stroke: var(--chart-grid);\n stroke-width: 1;\n stroke-dasharray: 2 2;\n}\n\n.tooltip {\n position: absolute;\n z-index: var(--z-dropdown);\n pointer-events: none;\n transform: translate(-50%, calc(-100% - 8px));\n padding: var(--space-2);\n border: 1px solid var(--chart-tooltip-border);\n border-radius: var(--radius-sm);\n background: var(--chart-tooltip-bg);\n box-shadow: var(--shadow-md);\n color: var(--text-primary);\n font-size: var(--text-xs-size);\n white-space: nowrap;\n}\n\n.tooltipTitle {\n color: var(--text-tertiary);\n margin-bottom: var(--space-1);\n}\n\n.tooltipRow {\n display: flex;\n align-items: center;\n gap: var(--space-2);\n}\n\n.tooltipKey {\n width: 8px;\n height: 8px;\n border-radius: 2px;\n flex: none;\n}\n\n.tooltipValue {\n margin-left: auto;\n padding-left: var(--space-3);\n font-weight: var(--font-weight-semibold);\n font-variant-numeric: tabular-nums;\n}\n\n.tooltipMuted {\n color: var(--text-tertiary);\n font-style: italic;\n}\n\n.legend {\n display: flex;\n flex-wrap: wrap;\n gap: var(--space-1) var(--space-3);\n margin: var(--space-2) 0 0;\n padding: 0;\n list-style: none;\n font-size: var(--text-xs-size);\n color: var(--text-secondary);\n}\n\n.legendItem {\n display: inline-flex;\n align-items: center;\n gap: var(--space-1);\n}\n\n.swatch {\n width: 10px;\n height: 10px;\n border-radius: 2px;\n flex: none;\n}\n\n.swatchLine {\n width: 12px;\n height: 2px;\n flex: none;\n}\n\n.swatchEmpty {\n width: 10px;\n height: 10px;\n border-radius: 2px;\n flex: none;\n border: 1px dashed var(--chart-axis);\n}\n\n.note {\n margin: var(--space-2) 0 0;\n font-size: var(--text-xs-size);\n color: var(--text-tertiary);\n}\n\n.srOnly {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .animated {\n transition: opacity 120ms ease;\n }\n}\n\n/* V3.10 — engine monogram beside a lane label (EngineTick). */\n.monogram {\n font-family: var(--font-display);\n font-size: var(--text-2xs-size);\n font-weight: var(--font-weight-semibold);\n fill: var(--text-secondary);\n /* 3.11.1: the tick draws a provider mark (nested svg, currentColor). */\n color: var(--text-secondary);\n}\n\n/* V3.10 — an unknown mark: hatch fill (set inline via url(#id)) + outline. */\n.unknownMark {\n stroke: var(--chart-unknown);\n stroke-width: 1;\n}\n\n/* A swatch in a legend that stands for \"unknown / not measured\". */\n.swatchHatch {\n width: 10px;\n height: 10px;\n border-radius: 2px;\n flex: none;\n border: 1px solid var(--chart-unknown);\n background: var(--chart-unknown-hatch);\n}\n\n/* Text laid over the plot (reference labels): a surface-coloured halo keeps it\n legible where it crosses a line, in both themes. */\n.halo {\n paint-order: stroke;\n stroke: var(--chart-surface);\n stroke-width: 3px;\n stroke-linejoin: round;\n}\n","/**\n * components/charts/ChartParts.tsx — small shared pieces of the V3.10 charts:\n * the legend list, the tooltip, the unknown hatch and the engine tick.\n * Identity is never colour alone: every swatch sits beside its text label,\n * and text always wears text tokens.\n */\nimport type { ReactNode } from 'react';\nimport { UNKNOWN_HATCH, engineColor, type ChartEngine } from './colors.js';\nimport plot from './plot.module.css';\nimport { ProviderLogo } from '../primitives/ProviderLogo.js';\n\nexport interface ChartLegendItem {\n label: string;\n color?: string;\n /** `hatch` = the unknown texture (not measured), never a colour. */\n kind?: 'swatch' | 'line' | 'empty' | 'hatch';\n}\n\n/** Renders nothing for fewer than `min` items (a lone series is named by the title). */\nexport function ChartLegend({ items, min = 2 }: { items: ChartLegendItem[]; min?: number }): ReactNode {\n if (items.length < min) return null;\n return (\n <ul className={plot.legend}>\n {items.map((item) => (\n <li key={item.label} className={plot.legendItem}>\n <span\n aria-hidden=\"true\"\n className={\n item.kind === 'line' ? plot.swatchLine : item.kind === 'empty' ? plot.swatchEmpty : item.kind === 'hatch' ? plot.swatchHatch : plot.swatch\n }\n style={item.kind === 'empty' || item.kind === 'hatch' ? undefined : { background: item.color }}\n />\n {item.label}\n </li>\n ))}\n </ul>\n );\n}\n\nexport interface TooltipRow {\n key: string;\n label: string;\n value: string | null;\n color?: string;\n}\n\n/**\n * Positioned in the plot's own pixel space (the plot wrapper is\n * position:relative). `left` is clamped by the caller so it never overflows.\n */\nexport function ChartTooltip({ left, top, title, rows }: { left: number; top: number; title: string; rows: TooltipRow[] }) {\n return (\n <div className={plot.tooltip} style={{ left, top }} role=\"presentation\">\n <div className={plot.tooltipTitle}>{title}</div>\n {rows.map((row) => (\n <div key={row.key} className={plot.tooltipRow}>\n {row.color ? <span className={plot.tooltipKey} style={{ background: row.color }} aria-hidden=\"true\" /> : null}\n <span>{row.label}</span>\n {row.value === null ? (\n <span className={`${plot.tooltipValue} ${plot.tooltipMuted}`}>no data</span>\n ) : (\n <span className={plot.tooltipValue}>{row.value}</span>\n )}\n </div>\n ))}\n </div>\n );\n}\n\n/** Keep a centred tooltip inside [margin, width - margin]. */\nexport function clampTooltipLeft(x: number, width: number, margin = 70): number {\n return Math.min(Math.max(x, Math.min(margin, width / 2)), Math.max(width - margin, width / 2));\n}\n\n// ---------------------------------------------------------------------------\n// Unknown hatch (V3.10) — one <pattern> per chart instance\n// ---------------------------------------------------------------------------\n\n/**\n * The 45° unknown hatch as an SVG <pattern>. Render it inside the chart's own\n * <svg><defs> with an id from `hatchPatternId(useId())` (colors.ts) — ids are\n * document-global, so a shared literal id would let one chart's unmount blank\n * another's hatch — then fill unknown marks with `url(#id)` and outline them\n * with CHART_UNKNOWN. Texture, not hue, is what separates \"not measured\" from\n * a low value, so it survives colour-blindness and greyscale print.\n */\nexport function HatchPattern({ id }: { id: string }) {\n const { size, angle, strokeWidth, stroke } = UNKNOWN_HATCH;\n return (\n <pattern id={id} width={size} height={size} patternUnits=\"userSpaceOnUse\" patternTransform={`rotate(${angle})`}>\n <line x1={0} y1={0} x2={0} y2={size} stroke={stroke} strokeWidth={strokeWidth} />\n </pattern>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Engine identity (V3.10) — a 2px tick plus a one-letter monogram\n// ---------------------------------------------------------------------------\n\nconst ENGINE_LETTER: Readonly<Record<ChartEngine, string>> = { claude: 'C', codex: 'X', grok: 'G', local: 'L' };\n\n/** The monogram letter for an engine (mirrors workbench-types ENGINE_MONOGRAM; charts stay core-free). */\nexport function engineLetter(engine: ChartEngine): string {\n return ENGINE_LETTER[engine];\n}\n\n/**\n * SVG engine mark for a lane label: the 2px identity tick and the provider's\n * mark (3.11.1, ProviderLogo). The engine's NAME still travels in the lane's\n * spoken summary and the table — the mark is a glance aid only.\n */\nexport function EngineTick({ engine, x, y, height }: { engine: ChartEngine; x: number; y: number; height: number }) {\n return (\n <g data-engine={engine} aria-hidden=\"true\">\n <rect x={x} y={y} width={2} height={height} rx={1} fill={engineColor(engine)} />\n <ProviderLogo engine={engine} x={x + 5} y={y + height / 2 - 6} size={12} className={plot.monogram} />\n </g>\n );\n}\n\n/** A quiet ⋯ glyph (three dots), currentColor, 16px. */\nexport function MoreGlyph() {\n return (\n <svg width={16} height={16} viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\">\n <circle cx={3.5} cy={8} r={1.4} fill=\"currentColor\" />\n <circle cx={8} cy={8} r={1.4} fill=\"currentColor\" />\n <circle cx={12.5} cy={8} r={1.4} fill=\"currentColor\" />\n </svg>\n );\n}\n",".frame {\n margin: 0;\n min-width: 0;\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-lg);\n background: var(--bg-surface);\n /* V3.10: 16px (12px compact density) — the card-pad token follows density. */\n padding: var(--card-pad, var(--space-4));\n}\n\n.header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--space-3);\n flex-wrap: wrap;\n margin-bottom: var(--space-3);\n}\n\n.actions {\n display: inline-flex;\n align-items: center;\n gap: var(--space-2);\n flex: none;\n margin-left: auto;\n}\n\n.menuWrap {\n position: relative;\n display: inline-flex;\n}\n\n/* The ⋯ button: quiet until hovered or focused, but always a real control. */\n.more {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: calc(var(--control-h-xs, 20px) + 4px);\n height: calc(var(--control-h-xs, 20px) + 4px);\n padding: 0;\n border: 1px solid transparent;\n border-radius: var(--radius-sm);\n background: transparent;\n color: var(--text-tertiary);\n cursor: pointer;\n transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);\n}\n\n.more:hover,\n.more[aria-expanded='true'] {\n background: var(--bg-hover);\n color: var(--text-primary);\n}\n\n.more:focus-visible {\n outline: 2px solid var(--border-focus);\n outline-offset: 1px;\n}\n\n.menu {\n position: absolute;\n top: calc(100% + var(--space-1));\n right: 0;\n z-index: var(--z-dropdown);\n display: flex;\n flex-direction: column;\n min-width: 176px;\n padding: var(--space-1);\n border: 1px solid var(--border-default);\n border-radius: var(--radius-md);\n background: var(--bg-surface-raised);\n box-shadow: var(--shadow-menu);\n}\n\n.menuItem {\n display: flex;\n align-items: center;\n gap: var(--space-2);\n padding: var(--space-1) var(--space-2);\n border: 0;\n border-radius: var(--radius-sm);\n background: transparent;\n color: var(--text-primary);\n font: inherit;\n font-size: var(--text-xs-size);\n line-height: var(--text-xs-line);\n text-align: left;\n cursor: pointer;\n}\n\n.menuItem:hover,\n.menuItem:focus-visible {\n background: var(--bg-hover);\n outline: none;\n}\n\n.check {\n width: 1em;\n color: var(--text-secondary);\n}\n\n.hint {\n margin-left: auto;\n padding: 0 var(--space-1);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-xs, 3px);\n color: var(--text-tertiary);\n font-family: var(--font-mono);\n font-size: var(--text-2xs-size);\n}\n\n.heading {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.title {\n font-size: var(--text-sm-size);\n font-weight: var(--font-weight-semibold);\n color: var(--text-primary);\n}\n\n.description {\n font-size: var(--text-xs-size);\n color: var(--text-tertiary);\n}\n\n.plot {\n position: relative;\n width: 100%;\n min-width: 0;\n}\n\n.table {\n max-height: 360px;\n overflow: auto;\n}\n\n.caveat {\n margin: 0 0 var(--space-3);\n padding: var(--space-2) var(--space-3);\n border-radius: var(--radius-md);\n background: var(--status-unknown-bg);\n color: var(--status-unknown-fg);\n font-size: var(--text-xs-size);\n line-height: var(--text-sm-line);\n}\n\n.state {\n margin: 0;\n padding: var(--space-6) var(--space-3);\n text-align: center;\n color: var(--text-tertiary);\n font-size: var(--text-sm-size);\n}\n\n.dark {\n display: flex;\n flex-direction: column;\n gap: var(--space-1);\n align-items: center;\n}\n\n.darkTitle {\n margin: 0;\n color: var(--text-secondary);\n font-weight: var(--font-weight-semibold);\n}\n\n.darkBody {\n margin: 0;\n font-size: var(--text-xs-size);\n max-width: 44ch;\n}\n\n.unknown {\n color: var(--status-unknown-fg);\n}\n","/**\n * components/charts/ChartFrame.tsx — the shell every V3.10 chart renders in:\n * title + description, an honest caveat, the Table twin (the WCAG-clean view,\n * reachable without hovering anything), and the designed non-ready states. A\n * chart never draws empty axes: it says what the emptiness means.\n *\n * loading — the previous render is held when there is one (no skeleton\n * flash on refetch); otherwise a quiet placeholder.\n * empty — \"No runs in this window.\" A genuine, known zero.\n * dark — \"Fleet dark since Sep 1\": nothing has happened since a date.\n * unknown — the source could not be read. Never drawn as zeros.\n *\n * V3.10 (SPEC-310C §6 \"Table toggle: moves into ⋯\"): the Chart | Table\n * segmented control used to sit beside every title — noise on a KPI-sized\n * card, and it wrapped against long titles (\"Memo hit rate\"). It is now a\n * quiet ⋯ menu button (still a real, labelled button: the table stays one\n * Tab + Enter away) plus the `T` key anywhere inside the card, which is the\n * `chart.table` command in routes/verse/shell/command-catalog.ts. The key is\n * matched here directly rather than through the catalog so this shared kit\n * (also used by the legacy console) never imports a route module; the chart\n * tests assert the two stay the same key.\n */\nimport { useCallback, useEffect, useId, useRef, useState, type KeyboardEvent, type ReactNode } from 'react';\nimport { MoreGlyph } from './ChartParts.js';\nimport { formatDayLabel } from './format.js';\nimport './chart-tokens.css';\nimport styles from './ChartFrame.module.css';\n\nexport type ChartStatus =\n | { kind: 'ready' }\n | { kind: 'loading' }\n | { kind: 'empty'; message?: string }\n | { kind: 'dark'; since: string; subject?: string; detail?: string }\n | { kind: 'unknown'; reason?: string };\n\nexport type ChartView = 'chart' | 'table';\n\n/** The key that flips a focused chart card between plot and table (catalog `chart.table`). */\nexport const CHART_TABLE_KEY = 't';\n\nexport interface ChartFrameProps {\n title: string;\n description?: string;\n caveat?: string;\n status?: ChartStatus;\n /** Start on the table (e.g. a screen-reader-first surface, or a matrix at 375 px). */\n defaultView?: ChartView;\n /** Hide the view menu (only for a chart that already IS its numbers). */\n hideToggle?: boolean;\n /** Extra header controls (a facet picker), rendered before the ⋯ menu. */\n actions?: ReactNode;\n /** The plot. */\n children: ReactNode;\n table: ReactNode;\n /** Rendered under the plot in chart view (legends, notes). */\n footer?: ReactNode;\n}\n\n/** \"Sep 1\" from an ISO timestamp or YYYY-MM-DD (UTC day, like the axis labels). */\nexport function sinceLabel(since: string): string {\n return formatDayLabel(since.slice(0, 10));\n}\n\nfunction StatusMessage({ status }: { status: Exclude<ChartStatus, { kind: 'ready' }> }): ReactNode {\n switch (status.kind) {\n case 'loading':\n return <p className={styles.state} aria-busy=\"true\">Loading…</p>;\n case 'empty':\n return <p className={styles.state}>{status.message ?? 'Nothing happened in this window.'}</p>;\n case 'dark':\n return (\n <div className={`${styles.state} ${styles.dark}`}>\n <p className={styles.darkTitle}>\n {status.subject ?? 'Fleet'} dark since {sinceLabel(status.since)}\n </p>\n <p className={styles.darkBody}>{status.detail ?? 'No runs or proposals have been recorded since then.'}</p>\n </div>\n );\n case 'unknown':\n return (\n <p className={`${styles.state} ${styles.unknown}`} role=\"note\">\n Unknown — {status.reason ?? 'the data source could not be read.'} Nothing is shown rather than a guess.\n </p>\n );\n }\n}\n\n/** True when a key press is typing into a field — never steal it for the T shortcut. */\nfunction isEditableTarget(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n const tag = target.tagName;\n return tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || target.isContentEditable;\n}\n\nconst VIEW_ITEMS: ReadonlyArray<{ view: ChartView; label: string; hint: string | null }> = [\n { view: 'chart', label: 'Show as chart', hint: null },\n { view: 'table', label: 'Show as table', hint: 'T' },\n];\n\n/**\n * The ⋯ menu: a menu button (WAI-ARIA menu-button pattern) with two\n * menuitemradio entries. Arrow keys move, Enter / Space pick, Escape and Tab\n * close; focus returns to the button on every close so the keyboard user is\n * never dropped at the top of the document.\n */\nfunction ViewMenu({ title, view, onPick }: { title: string; view: ChartView; onPick: (view: ChartView) => void }) {\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState(0);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const menuId = useId();\n\n const close = useCallback((refocus: boolean) => {\n setOpen(false);\n if (refocus) buttonRef.current?.focus();\n }, []);\n\n useEffect(() => {\n if (!open) return undefined;\n const onDown = (e: PointerEvent): void => {\n const t = e.target as Node | null;\n if (t && (menuRef.current?.contains(t) || buttonRef.current?.contains(t))) return;\n setOpen(false);\n };\n document.addEventListener('pointerdown', onDown);\n return () => document.removeEventListener('pointerdown', onDown);\n }, [open]);\n\n useEffect(() => {\n if (!open) return;\n menuRef.current?.querySelectorAll<HTMLElement>('[role=\"menuitemradio\"]')[active]?.focus();\n }, [open, active]);\n\n function openAt(index: number): void {\n setActive(index);\n setOpen(true);\n }\n\n function onButtonKey(e: KeyboardEvent<HTMLButtonElement>): void {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n openAt(e.key === 'ArrowUp' ? VIEW_ITEMS.length - 1 : 0);\n }\n }\n\n function onMenuKey(e: KeyboardEvent<HTMLDivElement>): void {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setActive((a) => (a + 1) % VIEW_ITEMS.length);\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n setActive((a) => (a - 1 + VIEW_ITEMS.length) % VIEW_ITEMS.length);\n } else if (e.key === 'Home') {\n e.preventDefault();\n setActive(0);\n } else if (e.key === 'End') {\n e.preventDefault();\n setActive(VIEW_ITEMS.length - 1);\n } else if (e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n close(true);\n } else if (e.key === 'Tab') {\n close(false);\n }\n }\n\n return (\n <span className={styles.menuWrap}>\n <button\n ref={buttonRef}\n type=\"button\"\n className={styles.more}\n aria-label={`${title}: view options`}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n aria-controls={open ? menuId : undefined}\n title=\"View options (T toggles the table)\"\n onClick={() => (open ? close(false) : openAt(Math.max(0, VIEW_ITEMS.findIndex((i) => i.view === view))))}\n onKeyDown={onButtonKey}\n >\n <MoreGlyph />\n </button>\n {open ? (\n <div ref={menuRef} id={menuId} role=\"menu\" aria-label={`${title} view`} className={styles.menu} onKeyDown={onMenuKey}>\n {VIEW_ITEMS.map((item, i) => (\n <button\n key={item.view}\n type=\"button\"\n role=\"menuitemradio\"\n aria-checked={view === item.view}\n tabIndex={i === active ? 0 : -1}\n className={styles.menuItem}\n onClick={() => {\n onPick(item.view);\n close(true);\n }}\n >\n <span className={styles.check} aria-hidden=\"true\">{view === item.view ? '✓' : ''}</span>\n <span>{item.label}</span>\n {item.hint ? <kbd className={styles.hint}>{item.hint}</kbd> : null}\n </button>\n ))}\n </div>\n ) : null}\n </span>\n );\n}\n\nexport function ChartFrame({\n title,\n description,\n caveat,\n status = { kind: 'ready' },\n defaultView = 'chart',\n hideToggle = false,\n actions,\n children,\n table,\n footer,\n}: ChartFrameProps) {\n const [view, setView] = useState<ChartView>(defaultView);\n const titleId = useId();\n const ready = status.kind === 'ready';\n const canToggle = ready && !hideToggle;\n\n function onKeyDown(e: KeyboardEvent<HTMLElement>): void {\n if (!canToggle || e.defaultPrevented) return;\n if (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) return;\n if (e.key.toLowerCase() !== CHART_TABLE_KEY || isEditableTarget(e.target)) return;\n e.preventDefault();\n setView((v) => (v === 'chart' ? 'table' : 'chart'));\n }\n\n return (\n <figure className={styles.frame} aria-labelledby={titleId} data-chart-card=\"\" data-view={view} onKeyDown={onKeyDown}>\n <figcaption className={styles.header}>\n <span className={styles.heading}>\n <span id={titleId} className={styles.title}>{title}</span>\n {description ? <span className={styles.description}>{description}</span> : null}\n </span>\n {actions || canToggle ? (\n <span className={styles.actions}>\n {actions}\n {canToggle ? <ViewMenu title={title} view={view} onPick={setView} /> : null}\n </span>\n ) : null}\n </figcaption>\n {caveat ? (\n <p className={styles.caveat} role=\"note\">\n {caveat}\n </p>\n ) : null}\n {!ready ? (\n <StatusMessage status={status} />\n ) : view === 'table' ? (\n <div className={styles.table}>{table}</div>\n ) : (\n <>\n <div className={styles.plot}>{children}</div>\n {footer}\n </>\n )}\n </figure>\n );\n}\n","/**\n * components/charts/useChartWidth.ts — the measured pixel width of a chart's\n * container, so the V3.10 charts draw at their REAL size (text stays 12 px at\n * 375 px wide) instead of scaling a fixed viewBox down until labels are\n * unreadable. Falls back to `fallback` until measured (jsdom, SSR, first paint).\n */\nimport { useLayoutEffect, useState, type RefObject } from 'react';\n\n/** Narrowest width any chart lays itself out for (a 375 px phone minus padding). */\nexport const MIN_CHART_WIDTH = 280;\n\nexport function useChartWidth(ref: RefObject<HTMLElement | null>, fixed: number | undefined, fallback = 640): number {\n const [measured, setMeasured] = useState<number | null>(null);\n // WHY track the node: a chart whose frame starts in a non-ready state\n // (loading / empty / dark) mounts its plot — and so this ref — LATER than\n // the hook. An effect keyed only on the ref object never re-ran, so every\n // chart that first rendered \"Loading…\" stayed at the 640 px fallback and\n // was scaled down by CSS (V3.10 fix, found in the 1440 harness).\n const [node, setNode] = useState<HTMLElement | null>(null);\n // Runs after every render on purpose (ref.current is not a dependency React\n // can see); the equality guard makes it settle in one pass, never a loop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(() => {\n if (ref.current !== node) setNode(ref.current);\n });\n useLayoutEffect(() => {\n if (fixed !== undefined) return undefined;\n const el = node;\n if (!el) return undefined;\n const read = (): void => {\n const w = Math.floor(el.getBoundingClientRect().width);\n // 0 means \"not laid out yet\" (hidden tab, jsdom) — keep the fallback.\n if (w > 0) setMeasured((prev) => (prev === w ? prev : w));\n };\n read();\n if (typeof ResizeObserver === 'undefined') return undefined;\n // rAF-coalesced: a drag-resize fires many entries per frame.\n let frame = 0;\n const observer = new ResizeObserver(() => {\n cancelAnimationFrame(frame);\n frame = requestAnimationFrame(read);\n });\n observer.observe(el);\n return () => {\n cancelAnimationFrame(frame);\n observer.disconnect();\n };\n }, [node, fixed]);\n return Math.max(MIN_CHART_WIDTH, fixed ?? measured ?? fallback);\n}\n"],"mappings":"4NC2CA,SAAgB,EAAU,EA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
-
import{a as e,s as t}from"./index-
|
|
2
|
-
//# sourceMappingURL=useSeatsRefresh-
|
|
1
|
+
import{a as e,s as t}from"./index-DbDw9UAs.js";import{D as n,F as r,H as i,K as a,c as o,l as s,m as c,p as l}from"./global-BkNl4e6E.js";import{r as u,t as d,x as f}from"./VerseConsoleApp-CTF3Shs0.js";var p=t(e(),1),m=`verse-health`,h=`/api/verse/health`,g={key:m,fetch:e=>o(h,e)};function _(e,t){let n=!1;return()=>n?t():(n=!0,e())}async function v(e,t){let i=n();if(!i)throw new u;let a=await s(e,t,i);return r(),a}async function y(){let e=await v(`${h}/refresh`,{});return await a(m,_(()=>Promise.resolve(e),()=>g.fetch()),!0),e}async function b(e){await v(`${h}/reconnect`,{seatId:e})}var x=3e4;function S(e=!0){let t=l(g),n=c(g);return(0,p.useEffect)(()=>{if(!e)return;let t=()=>{(typeof document>`u`||document.visibilityState!==`hidden`)&&n()},r=window.setInterval(t,x);return document.addEventListener(`visibilitychange`,t),()=>{window.clearInterval(r),document.removeEventListener(`visibilitychange`,t)}},[e,n]),t}var C=3e4,w=`/api/verse/seats`;function T(e,t){return{...e,seats:t.seats,localRuntime:t.localRuntime}}function E(){let e=i(d).data,t=()=>f.fetch();return e===void 0?a(d,t):a(d,_(async()=>{let t=await o(w);return T(i(`verse-bootstrap`).data??e,t)},t))}function D(e=!0){let t=(0,p.useCallback)(()=>{E()},[]);(0,p.useEffect)(()=>{if(!e)return;let n=()=>{(typeof document>`u`||document.visibilityState!==`hidden`)&&t()},r=window.setInterval(n,C);return document.addEventListener(`visibilitychange`,n),()=>{window.clearInterval(r),document.removeEventListener(`visibilitychange`,n)}},[e,t])}export{y as a,b as i,S as n,g as o,_ as r,D as t};
|
|
2
|
+
//# sourceMappingURL=useSeatsRefresh-B2dCVcj9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSeatsRefresh-CG4jczeL.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/health/health-queries.ts","../../../../../../src/web-ui/routes/verse/health/useSeatHealth.ts","../../../../../../src/web-ui/routes/verse/useSeatsRefresh.ts"],"sourcesContent":["/**\n * routes/verse/health/health-queries.ts — the `/api/verse/health*` calls\n * (V3.10, unit A2). Server: core/verse/health-api.ts.\n *\n * Nothing here ever carries a launcher, a profile path or a credential: the\n * server withholds them, and Reconnect sends only the seat id — the server\n * resolves the seat's own login command privately and opens it in Terminal.\n */\nimport type { VerseHealthResponse } from '../../../../core/verse/health-types.js';\nimport { getMutationToken, touchMutationHold } from '../../../data/auth-store.js';\nimport { refetchQuery } from '../../../data/cache.js';\nimport { apiGet, apiPost } from '../../../data/client.js';\nimport type { QueryDef } from '../../../data/queries.js';\nimport { VerseMutationLockedError } from '../verse-queries.js';\n\nexport const VERSE_HEALTH_KEY = 'verse-health';\nexport const VERSE_HEALTH_URL = '/api/verse/health';\n\nexport const verseHealthQuery: QueryDef<VerseHealthResponse> = {\n key: VERSE_HEALTH_KEY,\n fetch: (signal) => apiGet<VerseHealthResponse>(VERSE_HEALTH_URL, signal),\n};\n\n/**\n * A fetcher that answers ONCE with `first`, then behaves like `fallback`.\n *\n * The cache (data/cache.ts) remembers the last fetcher it ran for a key and\n * re-runs it on every later invalidation. Writing a value we already hold\n * through a constant fetcher would freeze the key on that value forever;\n * this hands the cache the value now and the real read afterwards.\n */\nexport function oneShotFetcher<T>(first: () => Promise<T>, fallback: () => Promise<T>): () => Promise<T> {\n let used = false;\n return () => {\n if (used) return fallback();\n used = true;\n return first();\n };\n}\n\nasync function post<T>(path: string, body: unknown): Promise<T> {\n const token = getMutationToken();\n if (!token) throw new VerseMutationLockedError();\n const result = await apiPost<T>(path, body, token);\n touchMutationHold();\n return result;\n}\n\n/** Run a health sweep now and publish its result to every health reader. */\nexport async function refreshSeatHealth(): Promise<VerseHealthResponse> {\n const body = await post<VerseHealthResponse>(`${VERSE_HEALTH_URL}/refresh`, {});\n await refetchQuery(VERSE_HEALTH_KEY, oneShotFetcher(() => Promise.resolve(body), () => verseHealthQuery.fetch()), true);\n return body;\n}\n\n/**\n * Open the seat's own sign-in in Terminal (macOS). Resolves once the window\n * was asked to open; the sign-in itself is the operator's, in that window.\n */\nexport async function reconnectSeat(seatId: string): Promise<void> {\n await post<{ ok: true; seatId: string }>(`${VERSE_HEALTH_URL}/reconnect`, { seatId });\n}\n","/**\n * routes/verse/health/useSeatHealth.ts — the seat health reports, kept live\n * while the app is on screen.\n *\n * The SERVER sweeps every ten minutes whether or not anyone looks\n * (core/verse/account-health.ts) — that is what catches a sign-out while the\n * app is hidden, and it is what the desktop shell's notifications read. This\n * hook only has to keep a VISIBLE page current, so it polls a cheap cached\n * read every 30 s (no probe runs per request), skips ticks while hidden, and\n * re-reads the moment the page is looked at again.\n */\nimport { useEffect } from 'react';\nimport type { VerseHealthResponse } from '../../../../core/verse/health-types.js';\nimport type { QueryEntry } from '../../../data/cache.js';\nimport { useQuery, useRefetch } from '../../../data/hooks.js';\nimport { verseHealthQuery } from './health-queries.js';\n\n/** The fastest poll the performance budget allows is 2 s; 30 s is plenty for a status line. */\nexport const HEALTH_POLL_MS = 30_000;\n\nexport function useSeatHealth(active = true): QueryEntry<VerseHealthResponse> {\n const entry = useQuery(verseHealthQuery);\n const refetch = useRefetch(verseHealthQuery);\n useEffect(() => {\n if (!active) return;\n const tick = (): void => {\n if (typeof document !== 'undefined' && document.visibilityState === 'hidden') return;\n refetch();\n };\n const timer = window.setInterval(tick, HEALTH_POLL_MS);\n document.addEventListener('visibilitychange', tick);\n return () => {\n window.clearInterval(timer);\n document.removeEventListener('visibilitychange', tick);\n };\n }, [active, refetch]);\n return entry;\n}\n","/**\n * routes/verse/useSeatsRefresh.ts — keep the seat roster live.\n *\n * THE BUG THIS CLOSES. `GET /api/verse/bootstrap` carries the seats, and it\n * has NO entry in sse.ts's `EVENT_TO_CACHE_KEYS`: nothing on the server can\n * push a new reading into it. It is re-read only on mount and after a write\n * (`invalidateVerseLists`). The account collector, meanwhile, needs roughly a\n * cycle and a half — about 75 seconds measured — before its first readings\n * exist. Open the app cold, as Mason does, and the one read that ever happens\n * lands BEFORE any reading exists. Every seat then shows \"unknown\" for the\n * rest of the session, on the surface he looks at all day, and no amount of\n * correct rendering downstream can fix that.\n *\n * So the chat surfaces poll. The cost is a cached JSON read, not a probe: the\n * collector spawns its processes on its own 30s cycle regardless of whether\n * anyone asks, and this only picks up what it already published. Owner S's\n * V2.1 bootstrap handler recomputes seat telemetry on every read\n * (`liveSeats` in core/verse/verse-api.ts), so a poll of this key genuinely\n * returns the collector's CURRENT state rather than a warm cache.\n *\n * V3.10 — POLL `GET /api/verse/seats`, NOT BOOTSTRAP. Bootstrap also\n * re-reads projects, preferences and the workspace registry; measured, it\n * blocked the server's event loop ~384 ms per poll (research r2/perf-server).\n * `/seats` is the same live seat list and nothing else. The seats still have\n * to land in the `verse-bootstrap` cache key, because that is what ChatSection\n * hands to the sidebar, workspace, seat selector and new-chat dialog — so the\n * poll MERGES `/seats` into the cached bootstrap (`mergeSeatsIntoBootstrap`)\n * instead of re-reading all of it.\n *\n * The cache remembers the last fetcher it ran for a key and re-runs it on\n * every later `invalidate` (after a write). A plain \"/seats and merge\" fetcher\n * would therefore turn every later full refresh into a seats-only one; the\n * poll registers a ONE-SHOT fetcher (health/health-queries.ts\n * `oneShotFetcher`) that merges once and falls back to the real bootstrap read.\n * With no bootstrap cached yet there is nothing to merge into, so the poll\n * reads bootstrap itself.\n *\n * Two deliberate choices:\n *\n * - Refetch semantics, not refresh. A refetch collapses a burst of ticks (and\n * a tick landing on a read that just started) into ONE request, which is\n * what a poll wants. A forced refresh never joins, which is what a person\n * pressing a button wants; the panel's own Refresh control uses that.\n * - Nothing is requested while the document is hidden, and a read is issued\n * the moment it becomes visible again. A backgrounded app polls zero times\n * and is nonetheless correct the instant it is looked at.\n */\nimport { useCallback, useEffect } from 'react';\nimport type { VerseBootstrap } from '../../data/api-types.js';\nimport type { VerseSeatsResponse } from '../../../core/verse/types.js';\nimport { getQuerySnapshot, refetchQuery } from '../../data/cache.js';\nimport { apiGet } from '../../data/client.js';\nimport { oneShotFetcher } from './health/health-queries.js';\nimport { VERSE_BOOTSTRAP_KEY, verseBootstrapQuery } from './verse-queries.js';\n\n/** Matches the collector's own publish cadence; there is nothing to gain from faster. */\nexport const SEATS_POLL_MS = 30_000;\n\nexport const VERSE_SEATS_URL = '/api/verse/seats';\n\n/** The cached bootstrap with its seat list (and local runtime) replaced by a live `/seats` read. */\nexport function mergeSeatsIntoBootstrap(bootstrap: VerseBootstrap, live: VerseSeatsResponse): VerseBootstrap {\n return { ...bootstrap, seats: live.seats, localRuntime: live.localRuntime };\n}\n\n/** One poll tick: `/seats` merged into the cached bootstrap, or a full bootstrap when none is cached. */\nexport function pollSeats(): Promise<void> {\n const cached = getQuerySnapshot<VerseBootstrap>(VERSE_BOOTSTRAP_KEY).data;\n const full = (): Promise<VerseBootstrap> => verseBootstrapQuery.fetch();\n if (cached === undefined) return refetchQuery(VERSE_BOOTSTRAP_KEY, full);\n const merged = async (): Promise<VerseBootstrap> => {\n const live = await apiGet<VerseSeatsResponse>(VERSE_SEATS_URL);\n // Merge into whatever is cached NOW, not at tick time: a write may have\n // refreshed the rest of the bootstrap while this read was in flight.\n const current = getQuerySnapshot<VerseBootstrap>(VERSE_BOOTSTRAP_KEY).data ?? cached;\n return mergeSeatsIntoBootstrap(current, live);\n };\n return refetchQuery(VERSE_BOOTSTRAP_KEY, oneShotFetcher(merged, full));\n}\n\nexport function useSeatsRefresh(active = true): void {\n const refetch = useCallback(() => { void pollSeats(); }, []);\n useEffect(() => {\n if (!active) return;\n const tick = (): void => {\n if (typeof document !== 'undefined' && document.visibilityState === 'hidden') return;\n refetch();\n };\n const timer = window.setInterval(tick, SEATS_POLL_MS);\n document.addEventListener('visibilitychange', tick);\n return () => {\n window.clearInterval(timer);\n document.removeEventListener('visibilitychange', tick);\n };\n }, [active, refetch]);\n}\n"],"mappings":"wNAea,EAAmB,eACnB,EAAmB,oBAEnB,EAAkD,CAC7D,IAAK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S,EAAiC,CAAmB,CAAC,CAAC,KAC/D,MAAsC,EAAoB,MAAM,EAStE,OARI,IAAW,IAAA,GAAkB,EAAa,EAAqB,CAAI,EAQhE,EAAa,EAAqB,EAAe,SAPJ,CAClD,IAAM,EAAO,MAAM,EAA2B,CAAe,EAI7D,OAAO,EADS,EAAA,iBAAoD,CAAC,CAAC,MAAQ,EACtC,CAAI,CAC9C,EACgE,CAAI,CAAC,CACvE,CAEA,SAAgB,EAAgB,EAAS,GAAY,CACnD,IAAM,GAAA,EAAU,EAAA,YAAA,KAAkB,CAAE,EAAe,CAAG,EAAG,CAAC,CAAC,GAC3D,EAAA,EAAA,UAAA,KAAgB,CACd,GAAI,CAAC,EAAQ,OACb,IAAM,MAAmB,EACnB,OAAO,SAAa,KAAe,SAAS,kBAAoB,WACpE,EAAQ,CACV,EACM,EAAQ,OAAO,YAAY,EAAM,CAAa,EAEpD,OADA,SAAS,iBAAiB,mBAAoB,CAAI,MACrC,CACX,OAAO,cAAc,CAAK,EAC1B,SAAS,oBAAoB,mBAAoB,CAAI,CACvD,CACF,EAAG,CAAC,EAAQ,CAAO,CAAC,CACtB"}
|
|
1
|
+
{"version":3,"file":"useSeatsRefresh-B2dCVcj9.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/health/health-queries.ts","../../../../../../src/web-ui/routes/verse/health/useSeatHealth.ts","../../../../../../src/web-ui/routes/verse/useSeatsRefresh.ts"],"sourcesContent":["/**\n * routes/verse/health/health-queries.ts — the `/api/verse/health*` calls\n * (V3.10, unit A2). Server: core/verse/health-api.ts.\n *\n * Nothing here ever carries a launcher, a profile path or a credential: the\n * server withholds them, and Reconnect sends only the seat id — the server\n * resolves the seat's own login command privately and opens it in Terminal.\n */\nimport type { VerseHealthResponse } from '../../../../core/verse/health-types.js';\nimport { getMutationToken, touchMutationHold } from '../../../data/auth-store.js';\nimport { refetchQuery } from '../../../data/cache.js';\nimport { apiGet, apiPost } from '../../../data/client.js';\nimport type { QueryDef } from '../../../data/queries.js';\nimport { VerseMutationLockedError } from '../verse-queries.js';\n\nexport const VERSE_HEALTH_KEY = 'verse-health';\nexport const VERSE_HEALTH_URL = '/api/verse/health';\n\nexport const verseHealthQuery: QueryDef<VerseHealthResponse> = {\n key: VERSE_HEALTH_KEY,\n fetch: (signal) => apiGet<VerseHealthResponse>(VERSE_HEALTH_URL, signal),\n};\n\n/**\n * A fetcher that answers ONCE with `first`, then behaves like `fallback`.\n *\n * The cache (data/cache.ts) remembers the last fetcher it ran for a key and\n * re-runs it on every later invalidation. Writing a value we already hold\n * through a constant fetcher would freeze the key on that value forever;\n * this hands the cache the value now and the real read afterwards.\n */\nexport function oneShotFetcher<T>(first: () => Promise<T>, fallback: () => Promise<T>): () => Promise<T> {\n let used = false;\n return () => {\n if (used) return fallback();\n used = true;\n return first();\n };\n}\n\nasync function post<T>(path: string, body: unknown): Promise<T> {\n const token = getMutationToken();\n if (!token) throw new VerseMutationLockedError();\n const result = await apiPost<T>(path, body, token);\n touchMutationHold();\n return result;\n}\n\n/** Run a health sweep now and publish its result to every health reader. */\nexport async function refreshSeatHealth(): Promise<VerseHealthResponse> {\n const body = await post<VerseHealthResponse>(`${VERSE_HEALTH_URL}/refresh`, {});\n await refetchQuery(VERSE_HEALTH_KEY, oneShotFetcher(() => Promise.resolve(body), () => verseHealthQuery.fetch()), true);\n return body;\n}\n\n/**\n * Open the seat's own sign-in in Terminal (macOS). Resolves once the window\n * was asked to open; the sign-in itself is the operator's, in that window.\n */\nexport async function reconnectSeat(seatId: string): Promise<void> {\n await post<{ ok: true; seatId: string }>(`${VERSE_HEALTH_URL}/reconnect`, { seatId });\n}\n","/**\n * routes/verse/health/useSeatHealth.ts — the seat health reports, kept live\n * while the app is on screen.\n *\n * The SERVER sweeps every ten minutes whether or not anyone looks\n * (core/verse/account-health.ts) — that is what catches a sign-out while the\n * app is hidden, and it is what the desktop shell's notifications read. This\n * hook only has to keep a VISIBLE page current, so it polls a cheap cached\n * read every 30 s (no probe runs per request), skips ticks while hidden, and\n * re-reads the moment the page is looked at again.\n */\nimport { useEffect } from 'react';\nimport type { VerseHealthResponse } from '../../../../core/verse/health-types.js';\nimport type { QueryEntry } from '../../../data/cache.js';\nimport { useQuery, useRefetch } from '../../../data/hooks.js';\nimport { verseHealthQuery } from './health-queries.js';\n\n/** The fastest poll the performance budget allows is 2 s; 30 s is plenty for a status line. */\nexport const HEALTH_POLL_MS = 30_000;\n\nexport function useSeatHealth(active = true): QueryEntry<VerseHealthResponse> {\n const entry = useQuery(verseHealthQuery);\n const refetch = useRefetch(verseHealthQuery);\n useEffect(() => {\n if (!active) return;\n const tick = (): void => {\n if (typeof document !== 'undefined' && document.visibilityState === 'hidden') return;\n refetch();\n };\n const timer = window.setInterval(tick, HEALTH_POLL_MS);\n document.addEventListener('visibilitychange', tick);\n return () => {\n window.clearInterval(timer);\n document.removeEventListener('visibilitychange', tick);\n };\n }, [active, refetch]);\n return entry;\n}\n","/**\n * routes/verse/useSeatsRefresh.ts — keep the seat roster live.\n *\n * THE BUG THIS CLOSES. `GET /api/verse/bootstrap` carries the seats, and it\n * has NO entry in sse.ts's `EVENT_TO_CACHE_KEYS`: nothing on the server can\n * push a new reading into it. It is re-read only on mount and after a write\n * (`invalidateVerseLists`). The account collector, meanwhile, needs roughly a\n * cycle and a half — about 75 seconds measured — before its first readings\n * exist. Open the app cold, as Mason does, and the one read that ever happens\n * lands BEFORE any reading exists. Every seat then shows \"unknown\" for the\n * rest of the session, on the surface he looks at all day, and no amount of\n * correct rendering downstream can fix that.\n *\n * So the chat surfaces poll. The cost is a cached JSON read, not a probe: the\n * collector spawns its processes on its own 30s cycle regardless of whether\n * anyone asks, and this only picks up what it already published. Owner S's\n * V2.1 bootstrap handler recomputes seat telemetry on every read\n * (`liveSeats` in core/verse/verse-api.ts), so a poll of this key genuinely\n * returns the collector's CURRENT state rather than a warm cache.\n *\n * V3.10 — POLL `GET /api/verse/seats`, NOT BOOTSTRAP. Bootstrap also\n * re-reads projects, preferences and the workspace registry; measured, it\n * blocked the server's event loop ~384 ms per poll (research r2/perf-server).\n * `/seats` is the same live seat list and nothing else. The seats still have\n * to land in the `verse-bootstrap` cache key, because that is what ChatSection\n * hands to the sidebar, workspace, seat selector and new-chat dialog — so the\n * poll MERGES `/seats` into the cached bootstrap (`mergeSeatsIntoBootstrap`)\n * instead of re-reading all of it.\n *\n * The cache remembers the last fetcher it ran for a key and re-runs it on\n * every later `invalidate` (after a write). A plain \"/seats and merge\" fetcher\n * would therefore turn every later full refresh into a seats-only one; the\n * poll registers a ONE-SHOT fetcher (health/health-queries.ts\n * `oneShotFetcher`) that merges once and falls back to the real bootstrap read.\n * With no bootstrap cached yet there is nothing to merge into, so the poll\n * reads bootstrap itself.\n *\n * Two deliberate choices:\n *\n * - Refetch semantics, not refresh. A refetch collapses a burst of ticks (and\n * a tick landing on a read that just started) into ONE request, which is\n * what a poll wants. A forced refresh never joins, which is what a person\n * pressing a button wants; the panel's own Refresh control uses that.\n * - Nothing is requested while the document is hidden, and a read is issued\n * the moment it becomes visible again. A backgrounded app polls zero times\n * and is nonetheless correct the instant it is looked at.\n */\nimport { useCallback, useEffect } from 'react';\nimport type { VerseBootstrap } from '../../data/api-types.js';\nimport type { VerseSeatsResponse } from '../../../core/verse/types.js';\nimport { getQuerySnapshot, refetchQuery } from '../../data/cache.js';\nimport { apiGet } from '../../data/client.js';\nimport { oneShotFetcher } from './health/health-queries.js';\nimport { VERSE_BOOTSTRAP_KEY, verseBootstrapQuery } from './verse-queries.js';\n\n/** Matches the collector's own publish cadence; there is nothing to gain from faster. */\nexport const SEATS_POLL_MS = 30_000;\n\nexport const VERSE_SEATS_URL = '/api/verse/seats';\n\n/** The cached bootstrap with its seat list (and local runtime) replaced by a live `/seats` read. */\nexport function mergeSeatsIntoBootstrap(bootstrap: VerseBootstrap, live: VerseSeatsResponse): VerseBootstrap {\n return { ...bootstrap, seats: live.seats, localRuntime: live.localRuntime };\n}\n\n/** One poll tick: `/seats` merged into the cached bootstrap, or a full bootstrap when none is cached. */\nexport function pollSeats(): Promise<void> {\n const cached = getQuerySnapshot<VerseBootstrap>(VERSE_BOOTSTRAP_KEY).data;\n const full = (): Promise<VerseBootstrap> => verseBootstrapQuery.fetch();\n if (cached === undefined) return refetchQuery(VERSE_BOOTSTRAP_KEY, full);\n const merged = async (): Promise<VerseBootstrap> => {\n const live = await apiGet<VerseSeatsResponse>(VERSE_SEATS_URL);\n // Merge into whatever is cached NOW, not at tick time: a write may have\n // refreshed the rest of the bootstrap while this read was in flight.\n const current = getQuerySnapshot<VerseBootstrap>(VERSE_BOOTSTRAP_KEY).data ?? cached;\n return mergeSeatsIntoBootstrap(current, live);\n };\n return refetchQuery(VERSE_BOOTSTRAP_KEY, oneShotFetcher(merged, full));\n}\n\nexport function useSeatsRefresh(active = true): void {\n const refetch = useCallback(() => { void pollSeats(); }, []);\n useEffect(() => {\n if (!active) return;\n const tick = (): void => {\n if (typeof document !== 'undefined' && document.visibilityState === 'hidden') return;\n refetch();\n };\n const timer = window.setInterval(tick, SEATS_POLL_MS);\n document.addEventListener('visibilitychange', tick);\n return () => {\n window.clearInterval(timer);\n document.removeEventListener('visibilitychange', tick);\n };\n }, [active, refetch]);\n}\n"],"mappings":"wNAea,EAAmB,eACnB,EAAmB,oBAEnB,EAAkD,CAC7D,IAAK,EACL,MAAQ,GAAW,EAA4B,EAAkB,CAAM,CACzE,EAUA,SAAgB,EAAkB,EAAyB,EAA8C,CACvG,IAAI,EAAO,GACX,UACM,EAAa,EAAS,GAC1B,EAAO,GACA,EAAM,EAEjB,CAEA,eAAe,EAAQ,EAAc,EAA2B,CAC9D,IAAM,EAAQ,EAAiB,EAC/B,GAAI,CAAC,EAAO,MAAM,IAAI,EACtB,IAAM,EAAS,MAAM,EAAW,EAAM,EAAM,CAAK,EAEjD,OADA,EAAkB,EACX,CACT,CAGA,eAAsB,GAAkD,CACtE,IAAM,EAAO,MAAM,EAA0B,GAAG,EAAiB,UAAW,CAAC,CAAC,EAE9E,OADA,MAA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I,CAAC,EAAQ,OACb,IAAM,MAAmB,EACnB,OAAO,SAAa,KAAe,SAAS,kBAAoB,WACpE,EAAQ,CACV,EACM,EAAQ,OAAO,YAAY,EAAM,CAAa,EAEpD,OADA,SAAS,iBAAiB,mBAAoB,CAAI,MACrC,CACX,OAAO,cAAc,CAAK,EAC1B,SAAS,oBAAoB,mBAAoB,CAAI,CACvD,CACF,EAAG,CAAC,EAAQ,CAAO,CAAC,CACtB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,s as t}from"./index-DbDw9UAs.js";import{_ as n}from"./dock-store-qIu7kSQE.js";import{g as r,o as i,s as a}from"./verse-store-b_Lek_c5.js";import{o}from"./slots-DDd8cEoh.js";import{n as s}from"./ChatSection-DUZNpiVr.js";var c=Object.fromEntries(n.filter(e=>e.slot!==null).map(e=>[e.id,e.slot]));function l(e){let t=c[e];return t===void 0||o(t)}var u=Object.fromEntries(n.map(e=>[e.id,e.label])),d=t(e(),1),f=new Map;r(e=>{e.kind===`reset`?f.clear():f.delete(e.sessionId)});var p={items:[],live:!1,usage:null,segments:[]};function m(e){if(!e)return p;let t=i(e),n=f.get(e);if(n&&n.events===t.events)return n.transcript;let r=n?.cache??g(),o=y(t.events,{cache:r,thinkingStats:a(e)});return f.set(e,{events:t.events,transcript:o,cache:r}),o}function h(e,t){let n=Date.parse(e),r=Date.parse(t);return Number.isFinite(n)&&Number.isFinite(r)?Math.max(0,r-n):null}function g(){return{segments:new Map}}function _(e,t,n,r){let i=[],a=new Map,o=[],s=[],c=null,l=null,u=null,d=()=>{c&&=(i.push({kind:`assistant`,key:c.key,turnId:c.turnId,at:c.at,text:c.text,streaming:!1}),null)};for(let f=t;f<n;f+=1){let t=e[f];switch(t.type){case`user-message`:d(),i.push({kind:`user`,key:`u-${t.seq}`,turnId:t.turnId,at:t.at,text:t.text});break;case`turn-started`:l=!0;break;case`text-delta`:c&&c.turnId!==t.turnId&&d(),c||={turnId:t.turnId,at:t.at,text:``,key:`d-${t.seq}`},c.text+=t.text;break;case`assistant-message`:c=null,i.push({kind:`assistant`,key:`a-${t.seq}`,turnId:t.turnId,at:t.at,text:t.text,streaming:!1});break;case`thinking`:{d();let e=r?.get(t.seq);i.push({kind:`thinking`,key:`t-${t.seq}`,turnId:t.turnId,at:t.at,text:t.text,redacted:t.redacted===!0,durationMs:typeof t.durationMs==`number`&&Number.isFinite(t.durationMs)&&t.durationMs>=0?t.durationMs:e?.durationMs??null,estimatedTokens:e?.estimatedTokens??null,thinkingKind:t.kind??null});break}case`tool-use`:d(),a.set(t.toolUseId,i.length),s.push(t.toolUseId),i.push({kind:`tool`,key:`tu-${t.seq}`,turnId:t.turnId,at:t.at,toolUseId:t.toolUseId,name:t.name,input:t.input,result:null,durationMs:null});break;case`tool-result`:{let e=a.get(t.toolUseId),n=e===void 0?void 0:i[e];n&&n.kind===`tool`?i[e]={...n,result:{output:t.output,isError:t.isError},durationMs:h(n.at,t.at)}:(o.push(t.toolUseId),i.push({kind:`tool`,key:`tr-${t.seq}`,turnId:t.turnId,at:t.at,toolUseId:t.toolUseId,name:`tool`,input:null,result:{output:t.output,isError:t.isError},durationMs:null}));break}case`usage`:u=t.usage;break;case`compaction`:i.push({kind:`compaction`,key:`k-${t.seq}`,turnId:t.turnId,at:t.at,trigger:t.trigger,preTokens:t.preTokens,postTokens:t.postTokens,durationMs:t.durationMs});break;case`error`:d(),i.push({kind:`error`,key:`e-${t.seq}`,turnId:t.turnId,at:t.at,message:t.message,code:typeof t.code==`string`&&t.code?t.code:null});break;case`cancelled`:d(),l=!1,i.push({kind:`cancelled`,key:`c-${t.seq}`,turnId:t.turnId,at:t.at});break;case`turn-done`:d(),l=!1,i.push({kind:`turn-done`,key:`td-${t.seq}`,turnId:t.turnId,at:t.at,ok:t.ok,durationMs:t.durationMs});break;case`recovered`:i.push({kind:`recovered`,key:`r-${t.seq}`,turnId:t.turnId,at:t.at,how:t.how,message:t.message});break;case`history-truncated`:i.push({kind:`truncated`,key:`h-${t.seq}`,turnId:null,at:t.at,droppedBefore:t.droppedBefore})}}return{items:i,pending:c,liveEffect:l,usage:u,orphanResults:o,toolUseIds:s}}function v(e,t,n){let r=t.pending;return r?{key:e,items:[...t.items,{kind:`assistant`,key:r.key,turnId:r.turnId,at:r.at,text:r.text,streaming:n}]}:{key:e,items:t.items}}function y(e,t={}){let{cache:n,thinkingStats:r}=t;if(e.length===0)return{items:[],live:!1,usage:null,segments:[]};let i=[0];for(let t=1;t<e.length;t+=1)e[t].type===`user-message`&&i.push(t);let a=[],o=new Set;for(let t=0;t<i.length;t+=1){let s=i[t],c=t+1<i.length?i[t+1]:e.length,l=e[s].seq,u=e[c-1].seq,d=c-s,f=`s-${l}`;o.add(f);let p=n?.segments.get(f);if(p&&p.firstSeq===l&&p.lastSeq===u&&p.count===d){a.push({key:f,build:p.build,cached:p});continue}let m=_(e,s,c,r),h={firstSeq:l,lastSeq:u,count:d,build:m,finalized:null};n?.segments.set(f,h),a.push({key:f,build:m,cached:h})}if(n)for(let e of[...n.segments.keys()])o.has(e)||n.segments.delete(e);if(a.length>1){let t=new Set;for(let n of a){if(n.build.orphanResults.some(e=>t.has(e)))return b(e,r);for(let e of n.build.toolUseIds)t.add(e)}}let s=!1,c=null;for(let e of a)e.build.liveEffect!==null&&(s=e.build.liveEffect),e.build.usage!==null&&(c=e.build.usage);let l=[],u=[];for(let e=0;e<a.length;e+=1){let t=a[e],n=e===a.length-1&&s,r;t.cached?.finalized&&t.cached.finalized.streaming===n?r=t.cached.finalized.segment:(r=v(t.key,t.build,n),t.cached&&(t.cached.finalized={streaming:n,segment:r})),l.push(r);for(let e of r.items)u.push(e)}return{items:u,live:s,usage:c,segments:l}}function b(e,t){let n=_(e,0,e.length,t),r=n.liveEffect??!1,i=v(`s-${e[0].seq}`,n,r);return{items:i.items,live:r,usage:n.usage,segments:[i]}}function x(e){let t=[],n=[],r=()=>{if(n.length===0)return;let e=n.length;for(;e>0&&n[e-1].kind===`thinking`;)--e;let r=n.slice(0,e),i=n.slice(e);if(r.filter(e=>e.kind===`tool`).length>=2)t.push(S(r));else for(let e of r)t.push(e);for(let e of i)t.push(e);n=[]};for(let i of e){if((i.kind===`tool`||i.kind===`thinking`)&&(n.length===0||n[0].turnId===i.turnId)){n.push(i);continue}r(),i.kind===`tool`||i.kind===`thinking`?n.push(i):t.push(i)}return r(),t}function S(e){let t=new Map,n=0,r=!1;for(let i of e)i.kind===`tool`&&(t.set(i.name,(t.get(i.name)??0)+1),i.result===null?r=!0:i.result.isError&&(n+=1));let i=[...t.values()].reduce((e,t)=>e+t,0),a=[...t.entries()].map(([e,t])=>t>1?`${e} ×${t}`:e).join(`, `),o=h(e[0].at,e[e.length-1].at);return{kind:`toolGroup`,key:`g-${e[0].key}`,turnId:e[0].turnId,at:e[0].at,items:e,toolCount:i,summary:a,errorCount:n,pending:r,spanMs:o}}function C(e){let t=s(e);return(0,d.useSyncExternalStore)(t,()=>m(e),()=>m(e))}export{l as i,x as n,u as r,C as t};
|
|
2
|
+
//# sourceMappingURL=useVerseTranscript-BL3CljSI.js.map
|