@mistriwork/kit 1.0.0-rc.10 → 1.0.0-rc.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (970) hide show
  1. package/dist/client/actionGrants.d.ts +21 -0
  2. package/dist/client/actionGrants.js +24 -0
  3. package/dist/client/addressMount.d.ts +67 -0
  4. package/dist/client/addressMount.js +136 -0
  5. package/dist/client/app.d.ts +10 -0
  6. package/dist/client/app.js +976 -0
  7. package/dist/client/boot.d.ts +1 -0
  8. package/dist/client/boot.js +37 -0
  9. package/dist/client/brandLook.css +125 -0
  10. package/dist/client/breakdownBatch.d.ts +34 -0
  11. package/dist/client/breakdownBatch.js +115 -0
  12. package/dist/client/bulkActions.d.ts +66 -0
  13. package/dist/client/bulkActions.js +171 -0
  14. package/dist/client/chart.d.ts +20 -0
  15. package/dist/client/chart.js +80 -0
  16. package/dist/client/clauses.d.ts +121 -0
  17. package/dist/client/clauses.js +276 -0
  18. package/dist/client/columns.d.ts +77 -0
  19. package/dist/client/columns.js +102 -0
  20. package/dist/client/components/Accordion.d.ts +26 -0
  21. package/dist/client/components/Accordion.js +44 -0
  22. package/dist/client/components/ApiOperations.d.ts +3 -0
  23. package/dist/client/components/ApiOperations.js +162 -0
  24. package/dist/client/components/AppColumnMenu.d.ts +66 -0
  25. package/dist/client/components/AppColumnMenu.js +59 -0
  26. package/dist/client/components/AppColumnMenuPopups.d.ts +21 -0
  27. package/dist/client/components/AppColumnMenuPopups.js +92 -0
  28. package/dist/client/components/AppFooter.css +17 -0
  29. package/dist/client/components/AppFooter.d.ts +23 -0
  30. package/dist/client/components/AppFooter.js +12 -0
  31. package/dist/client/components/AppIssues.d.ts +4 -0
  32. package/dist/client/components/AppIssues.js +18 -0
  33. package/dist/client/components/AppList.d.ts +20 -0
  34. package/dist/client/components/AppList.js +696 -0
  35. package/dist/client/components/AttachmentList.d.ts +45 -0
  36. package/dist/client/components/AttachmentList.js +178 -0
  37. package/dist/client/components/BoardList.css +9 -0
  38. package/dist/client/components/Breakdown.d.ts +11 -0
  39. package/dist/client/components/Breakdown.js +157 -0
  40. package/dist/client/components/BreakdownRoom.d.ts +4 -0
  41. package/dist/client/components/BreakdownRoom.js +48 -0
  42. package/dist/client/components/CardsList.d.ts +23 -0
  43. package/dist/client/components/CardsList.js +209 -0
  44. package/dist/client/components/Chart.css +165 -0
  45. package/dist/client/components/Chart.d.ts +194 -0
  46. package/dist/client/components/Chart.js +801 -0
  47. package/dist/client/components/ChartFigure.d.ts +82 -0
  48. package/dist/client/components/ChartFigure.js +102 -0
  49. package/dist/client/components/ChartShapes.css +213 -0
  50. package/dist/client/components/ChartShapes.d.ts +63 -0
  51. package/dist/client/components/ChartShapes.js +393 -0
  52. package/dist/client/components/Checklist.css +16 -0
  53. package/dist/client/components/Composer.d.ts +1 -0
  54. package/dist/client/components/Composer.js +331 -0
  55. package/dist/client/components/Content.d.ts +8 -0
  56. package/dist/client/components/Content.js +170 -0
  57. package/dist/client/components/CountedLabel.d.ts +10 -0
  58. package/dist/client/components/CountedLabel.js +26 -0
  59. package/dist/client/components/Crumbs.d.ts +11 -0
  60. package/dist/client/components/Crumbs.js +142 -0
  61. package/dist/client/components/DashboardList.css +7 -0
  62. package/dist/client/components/DashboardList.d.ts +9 -0
  63. package/dist/client/components/DashboardList.js +46 -0
  64. package/dist/client/components/DashboardNote.d.ts +21 -0
  65. package/dist/client/components/DashboardNote.js +22 -0
  66. package/dist/client/components/DateField.css +6 -0
  67. package/dist/client/components/DateField.d.ts +7 -0
  68. package/dist/client/components/DateField.js +27 -0
  69. package/dist/client/components/DefinedFields.d.ts +50 -0
  70. package/dist/client/components/DefinedFields.js +186 -0
  71. package/dist/client/components/DeleteButton.d.ts +30 -0
  72. package/dist/client/components/DeleteButton.js +198 -0
  73. package/dist/client/components/Diagram.d.ts +7 -0
  74. package/dist/client/components/Diagram.js +320 -0
  75. package/dist/client/components/Dressed.d.ts +31 -0
  76. package/dist/client/components/Dressed.js +138 -0
  77. package/dist/client/components/Dropdown.d.ts +14 -0
  78. package/dist/client/components/Dropdown.js +20 -0
  79. package/dist/client/components/EditLayoutButton.d.ts +13 -0
  80. package/dist/client/components/EditLayoutButton.js +7 -0
  81. package/dist/client/components/Editable.d.ts +47 -0
  82. package/dist/client/components/Editable.js +422 -0
  83. package/dist/client/components/ErrorBoundary.d.ts +40 -0
  84. package/dist/client/components/ErrorBoundary.js +41 -0
  85. package/dist/client/components/Export.d.ts +15 -0
  86. package/dist/client/components/Export.js +151 -0
  87. package/dist/client/components/ExportHold.d.ts +18 -0
  88. package/dist/client/components/ExportHold.js +30 -0
  89. package/dist/client/components/FavoriteStar.d.ts +5 -0
  90. package/dist/client/components/FavoriteStar.js +14 -0
  91. package/dist/client/components/FieldArranger.d.ts +28 -0
  92. package/dist/client/components/FieldArranger.js +82 -0
  93. package/dist/client/components/FilePreview.css +20 -0
  94. package/dist/client/components/FilePreview.d.ts +26 -0
  95. package/dist/client/components/FilePreview.js +170 -0
  96. package/dist/client/components/FilterBoxes.d.ts +76 -0
  97. package/dist/client/components/FilterBoxes.js +294 -0
  98. package/dist/client/components/FilterRail.css +100 -0
  99. package/dist/client/components/FilterRail.d.ts +61 -0
  100. package/dist/client/components/FilterRail.js +559 -0
  101. package/dist/client/components/Gallery.d.ts +11 -0
  102. package/dist/client/components/Gallery.js +53 -0
  103. package/dist/client/components/Grid.d.ts +122 -0
  104. package/dist/client/components/Grid.js +1115 -0
  105. package/dist/client/components/GridCellEditor.d.ts +35 -0
  106. package/dist/client/components/GridCellEditor.js +291 -0
  107. package/dist/client/components/GridSelection.d.ts +16 -0
  108. package/dist/client/components/GridSelection.js +28 -0
  109. package/dist/client/components/HelpPanel.d.ts +5 -0
  110. package/dist/client/components/HelpPanel.js +92 -0
  111. package/dist/client/components/History.d.ts +10 -0
  112. package/dist/client/components/History.js +22 -0
  113. package/dist/client/components/Icon.d.ts +31 -0
  114. package/dist/client/components/Icon.js +20 -0
  115. package/dist/client/components/JsonPreview.d.ts +5 -0
  116. package/dist/client/components/JsonPreview.js +25 -0
  117. package/dist/client/components/JsonValue.d.ts +4 -0
  118. package/dist/client/components/JsonValue.js +3 -0
  119. package/dist/client/components/JsonView.css +109 -0
  120. package/dist/client/components/JsonView.d.ts +3 -0
  121. package/dist/client/components/JsonView.js +118 -0
  122. package/dist/client/components/Landing.d.ts +19 -0
  123. package/dist/client/components/Landing.js +55 -0
  124. package/dist/client/components/LandingSurface.css +177 -0
  125. package/dist/client/components/LandingSurface.d.ts +42 -0
  126. package/dist/client/components/LandingSurface.js +108 -0
  127. package/dist/client/components/LayoutBuilder.d.ts +36 -0
  128. package/dist/client/components/LayoutBuilder.js +104 -0
  129. package/dist/client/components/Lightbox.d.ts +29 -0
  130. package/dist/client/components/Lightbox.js +62 -0
  131. package/dist/client/components/ListEmpty.css +13 -0
  132. package/dist/client/components/ListEmpty.d.ts +10 -0
  133. package/dist/client/components/ListEmpty.js +8 -0
  134. package/dist/client/components/ListFilterBar.css +76 -0
  135. package/dist/client/components/ListFilterBar.d.ts +52 -0
  136. package/dist/client/components/ListFilterBar.js +304 -0
  137. package/dist/client/components/LiveNotices.css +105 -0
  138. package/dist/client/components/LiveNotices.d.ts +26 -0
  139. package/dist/client/components/LiveNotices.js +211 -0
  140. package/dist/client/components/MinorMoneyInput.d.ts +26 -0
  141. package/dist/client/components/MinorMoneyInput.js +50 -0
  142. package/dist/client/components/Modal.css +3 -0
  143. package/dist/client/components/MultiStepForm.css +122 -0
  144. package/dist/client/components/MultiStepForm.d.ts +59 -0
  145. package/dist/client/components/MultiStepForm.js +216 -0
  146. package/dist/client/components/NavGlyph.d.ts +14 -0
  147. package/dist/client/components/NavGlyph.js +27 -0
  148. package/dist/client/components/Nested.d.ts +21 -0
  149. package/dist/client/components/Nested.js +86 -0
  150. package/dist/client/components/NewRecord.d.ts +89 -0
  151. package/dist/client/components/NewRecord.js +897 -0
  152. package/dist/client/components/NewRecordButton.d.ts +13 -0
  153. package/dist/client/components/NewRecordButton.js +28 -0
  154. package/dist/client/components/Notes.css +39 -0
  155. package/dist/client/components/Notes.d.ts +59 -0
  156. package/dist/client/components/Notes.js +96 -0
  157. package/dist/client/components/OverflowMenu.d.ts +3 -0
  158. package/dist/client/components/OverflowMenu.js +60 -0
  159. package/dist/client/components/Page.d.ts +52 -0
  160. package/dist/client/components/Page.js +237 -0
  161. package/dist/client/components/PageCurrent.d.ts +38 -0
  162. package/dist/client/components/PageCurrent.js +27 -0
  163. package/dist/client/components/PageEmptyRun.d.ts +18 -0
  164. package/dist/client/components/PageEmptyRun.js +118 -0
  165. package/dist/client/components/PageFields.d.ts +3 -0
  166. package/dist/client/components/PageFields.js +294 -0
  167. package/dist/client/components/PageFlowDiagram.css +193 -0
  168. package/dist/client/components/PageFlowDiagram.d.ts +95 -0
  169. package/dist/client/components/PageFlowDiagram.js +276 -0
  170. package/dist/client/components/PageFlows.css +27 -0
  171. package/dist/client/components/PageFlows.d.ts +54 -0
  172. package/dist/client/components/PageFlows.js +92 -0
  173. package/dist/client/components/PageGroups.d.ts +43 -0
  174. package/dist/client/components/PageGroups.js +123 -0
  175. package/dist/client/components/PageHead.d.ts +28 -0
  176. package/dist/client/components/PageHead.js +279 -0
  177. package/dist/client/components/PageHeadline.d.ts +23 -0
  178. package/dist/client/components/PageHeadline.js +101 -0
  179. package/dist/client/components/PageHistory.d.ts +62 -0
  180. package/dist/client/components/PageHistory.js +160 -0
  181. package/dist/client/components/PageLayout.d.ts +22 -0
  182. package/dist/client/components/PageLayout.js +13 -0
  183. package/dist/client/components/PageMetrics.d.ts +11 -0
  184. package/dist/client/components/PageMetrics.js +252 -0
  185. package/dist/client/components/PageRelated.d.ts +70 -0
  186. package/dist/client/components/PageRelated.js +667 -0
  187. package/dist/client/components/PageRoom.d.ts +37 -0
  188. package/dist/client/components/PageRoom.js +277 -0
  189. package/dist/client/components/PageSectionBox.d.ts +28 -0
  190. package/dist/client/components/PageSectionBox.js +65 -0
  191. package/dist/client/components/PageSections.d.ts +38 -0
  192. package/dist/client/components/PageSections.js +352 -0
  193. package/dist/client/components/PageSkeleton.css +17 -0
  194. package/dist/client/components/PageSkeleton.d.ts +11 -0
  195. package/dist/client/components/PageSkeleton.js +25 -0
  196. package/dist/client/components/PageTimeline.d.ts +2 -0
  197. package/dist/client/components/PageTimeline.js +273 -0
  198. package/dist/client/components/Palette.d.ts +4 -0
  199. package/dist/client/components/Palette.js +176 -0
  200. package/dist/client/components/Peek.d.ts +1 -0
  201. package/dist/client/components/Peek.js +158 -0
  202. package/dist/client/components/PeekPanel.d.ts +16 -0
  203. package/dist/client/components/PeekPanel.js +120 -0
  204. package/dist/client/components/Picker.d.ts +13 -0
  205. package/dist/client/components/Picker.js +33 -0
  206. package/dist/client/components/Prefs.d.ts +3 -0
  207. package/dist/client/components/Prefs.js +121 -0
  208. package/dist/client/components/PresentationSwitch.d.ts +13 -0
  209. package/dist/client/components/PresentationSwitch.js +10 -0
  210. package/dist/client/components/Prompt.d.ts +35 -0
  211. package/dist/client/components/Prompt.js +114 -0
  212. package/dist/client/components/QrCode.css +11 -0
  213. package/dist/client/components/QrCode.d.ts +4 -0
  214. package/dist/client/components/QrCode.js +57 -0
  215. package/dist/client/components/QueueList.css +122 -0
  216. package/dist/client/components/QuickAdd.css +18 -0
  217. package/dist/client/components/QuickAdd.d.ts +11 -0
  218. package/dist/client/components/QuickAdd.js +53 -0
  219. package/dist/client/components/QuickAddOnDemand.d.ts +4 -0
  220. package/dist/client/components/QuickAddOnDemand.js +10 -0
  221. package/dist/client/components/Record.d.ts +36 -0
  222. package/dist/client/components/Record.js +385 -0
  223. package/dist/client/components/RecordGone.d.ts +7 -0
  224. package/dist/client/components/RecordGone.js +22 -0
  225. package/dist/client/components/RecordPicker.d.ts +59 -0
  226. package/dist/client/components/RecordPicker.js +299 -0
  227. package/dist/client/components/RecordSummaries.d.ts +55 -0
  228. package/dist/client/components/RecordSummaries.js +151 -0
  229. package/dist/client/components/RecordTags.d.ts +6 -0
  230. package/dist/client/components/RecordTags.js +119 -0
  231. package/dist/client/components/RecordTrailNav.d.ts +25 -0
  232. package/dist/client/components/RecordTrailNav.js +110 -0
  233. package/dist/client/components/RichText.d.ts +7 -0
  234. package/dist/client/components/RichText.js +82 -0
  235. package/dist/client/components/RichTextEditor.css +202 -0
  236. package/dist/client/components/RichTextEditor.d.ts +33 -0
  237. package/dist/client/components/RichTextEditor.js +348 -0
  238. package/dist/client/components/RichTextField.d.ts +26 -0
  239. package/dist/client/components/RichTextField.js +71 -0
  240. package/dist/client/components/Rooms.d.ts +35 -0
  241. package/dist/client/components/Rooms.js +276 -0
  242. package/dist/client/components/RowActions.d.ts +8 -0
  243. package/dist/client/components/RowActions.js +49 -0
  244. package/dist/client/components/RowHost.d.ts +110 -0
  245. package/dist/client/components/RowHost.js +212 -0
  246. package/dist/client/components/SavedViews.d.ts +25 -0
  247. package/dist/client/components/SavedViews.js +35 -0
  248. package/dist/client/components/SchemaExport.d.ts +15 -0
  249. package/dist/client/components/SchemaExport.js +42 -0
  250. package/dist/client/components/SectionPeriod.css +14 -0
  251. package/dist/client/components/SectionPeriod.d.ts +7 -0
  252. package/dist/client/components/SectionPeriod.js +14 -0
  253. package/dist/client/components/SetFieldDialog.d.ts +12 -0
  254. package/dist/client/components/SetFieldDialog.js +51 -0
  255. package/dist/client/components/Sidebar.d.ts +34 -0
  256. package/dist/client/components/Sidebar.js +398 -0
  257. package/dist/client/components/Skeleton.d.ts +35 -0
  258. package/dist/client/components/Skeleton.js +49 -0
  259. package/dist/client/components/SortMenu.d.ts +20 -0
  260. package/dist/client/components/SortMenu.js +45 -0
  261. package/dist/client/components/SplitListDetail.css +119 -0
  262. package/dist/client/components/SuggestBox.d.ts +29 -0
  263. package/dist/client/components/SuggestBox.js +60 -0
  264. package/dist/client/components/Summary.d.ts +14 -0
  265. package/dist/client/components/Summary.js +93 -0
  266. package/dist/client/components/TableRoom.d.ts +88 -0
  267. package/dist/client/components/TableRoom.js +246 -0
  268. package/dist/client/components/TableView.d.ts +111 -0
  269. package/dist/client/components/TableView.js +324 -0
  270. package/dist/client/components/ThMenu.d.ts +40 -0
  271. package/dist/client/components/ThMenu.js +163 -0
  272. package/dist/client/components/ThemeLab.d.ts +4 -0
  273. package/dist/client/components/ThemeLab.js +67 -0
  274. package/dist/client/components/TimelineSides.css +23 -0
  275. package/dist/client/components/TimelineSides.d.ts +7 -0
  276. package/dist/client/components/TimelineSides.js +9 -0
  277. package/dist/client/components/Tour.d.ts +12 -0
  278. package/dist/client/components/Tour.js +131 -0
  279. package/dist/client/components/Value.d.ts +38 -0
  280. package/dist/client/components/Value.js +172 -0
  281. package/dist/client/components/WorkPanel.d.ts +9 -0
  282. package/dist/client/components/WorkPanel.js +43 -0
  283. package/dist/client/components/WorkflowStatus.d.ts +6 -0
  284. package/dist/client/components/WorkflowStatus.js +44 -0
  285. package/dist/client/components/WriteConfirm.d.ts +4 -0
  286. package/dist/client/components/WriteConfirm.js +27 -0
  287. package/dist/client/components/appColumnMenuModel.d.ts +46 -0
  288. package/dist/client/components/appColumnMenuModel.js +51 -0
  289. package/dist/client/components/appListModel.d.ts +179 -0
  290. package/dist/client/components/appListModel.js +421 -0
  291. package/dist/client/components/appRooms.d.ts +106 -0
  292. package/dist/client/components/appRooms.js +133 -0
  293. package/dist/client/components/autoChart.d.ts +33 -0
  294. package/dist/client/components/autoChart.js +107 -0
  295. package/dist/client/components/avatarPhotos.d.ts +45 -0
  296. package/dist/client/components/avatarPhotos.js +93 -0
  297. package/dist/client/components/besideDetail.d.ts +1 -0
  298. package/dist/client/components/besideDetail.js +10 -0
  299. package/dist/client/components/boardNew.d.ts +2 -0
  300. package/dist/client/components/boardNew.js +8 -0
  301. package/dist/client/components/cardsModel.d.ts +11 -0
  302. package/dist/client/components/cardsModel.js +24 -0
  303. package/dist/client/components/chromeIcons.d.ts +16 -0
  304. package/dist/client/components/chromeIcons.js +16 -0
  305. package/dist/client/components/columnPresentation.d.ts +8 -0
  306. package/dist/client/components/columnPresentation.js +47 -0
  307. package/dist/client/components/componentSlot.d.ts +31 -0
  308. package/dist/client/components/componentSlot.js +76 -0
  309. package/dist/client/components/composerDraft.d.ts +16 -0
  310. package/dist/client/components/composerDraft.js +16 -0
  311. package/dist/client/components/conditionText.d.ts +14 -0
  312. package/dist/client/components/conditionText.js +45 -0
  313. package/dist/client/components/conditionWords.d.ts +37 -0
  314. package/dist/client/components/conditionWords.js +382 -0
  315. package/dist/client/components/crumbSlot.d.ts +14 -0
  316. package/dist/client/components/crumbSlot.js +49 -0
  317. package/dist/client/components/dashboardModel.d.ts +283 -0
  318. package/dist/client/components/dashboardModel.js +415 -0
  319. package/dist/client/components/dashboardParts.d.ts +9 -0
  320. package/dist/client/components/dashboardParts.js +18 -0
  321. package/dist/client/components/diagramModel.d.ts +83 -0
  322. package/dist/client/components/diagramModel.js +211 -0
  323. package/dist/client/components/dueOpen.d.ts +1 -0
  324. package/dist/client/components/dueOpen.js +23 -0
  325. package/dist/client/components/editInteraction.d.ts +20 -0
  326. package/dist/client/components/editInteraction.js +178 -0
  327. package/dist/client/components/favoriteNav.d.ts +6 -0
  328. package/dist/client/components/favoriteNav.js +31 -0
  329. package/dist/client/components/favorites.d.ts +23 -0
  330. package/dist/client/components/favorites.js +86 -0
  331. package/dist/client/components/filePreviewModel.d.ts +18 -0
  332. package/dist/client/components/filePreviewModel.js +21 -0
  333. package/dist/client/components/filterRailModel.d.ts +93 -0
  334. package/dist/client/components/filterRailModel.js +302 -0
  335. package/dist/client/components/formControlsStyle.d.ts +1 -0
  336. package/dist/client/components/formControlsStyle.js +3 -0
  337. package/dist/client/components/formDefaults.d.ts +17 -0
  338. package/dist/client/components/formDefaults.js +128 -0
  339. package/dist/client/components/gridArrange.d.ts +33 -0
  340. package/dist/client/components/gridArrange.js +62 -0
  341. package/dist/client/components/gridCellModel.d.ts +32 -0
  342. package/dist/client/components/gridCellModel.js +42 -0
  343. package/dist/client/components/gridSizing.d.ts +89 -0
  344. package/dist/client/components/gridSizing.js +295 -0
  345. package/dist/client/components/groupMoves.d.ts +44 -0
  346. package/dist/client/components/groupMoves.js +295 -0
  347. package/dist/client/components/groupOrder.d.ts +43 -0
  348. package/dist/client/components/groupOrder.js +63 -0
  349. package/dist/client/components/inputRenderers.d.ts +48 -0
  350. package/dist/client/components/inputRenderers.js +37 -0
  351. package/dist/client/components/intakeStyle.d.ts +2 -0
  352. package/dist/client/components/intakeStyle.js +6 -0
  353. package/dist/client/components/jsonModel.d.ts +98 -0
  354. package/dist/client/components/jsonModel.js +264 -0
  355. package/dist/client/components/listColumn.d.ts +20 -0
  356. package/dist/client/components/listColumn.js +31 -0
  357. package/dist/client/components/listNavigation.d.ts +16 -0
  358. package/dist/client/components/listNavigation.js +14 -0
  359. package/dist/client/components/mentionRows.d.ts +5 -0
  360. package/dist/client/components/mentionRows.js +62 -0
  361. package/dist/client/components/mount.d.ts +55 -0
  362. package/dist/client/components/mount.js +155 -0
  363. package/dist/client/components/myViews.d.ts +54 -0
  364. package/dist/client/components/myViews.js +82 -0
  365. package/dist/client/components/navCounts.d.ts +84 -0
  366. package/dist/client/components/navCounts.js +194 -0
  367. package/dist/client/components/navigationTree.d.ts +52 -0
  368. package/dist/client/components/navigationTree.js +49 -0
  369. package/dist/client/components/newMenuModel.d.ts +27 -0
  370. package/dist/client/components/newMenuModel.js +58 -0
  371. package/dist/client/components/newRecordModel.d.ts +58 -0
  372. package/dist/client/components/newRecordModel.js +232 -0
  373. package/dist/client/components/onDemand.d.ts +30 -0
  374. package/dist/client/components/onDemand.js +121 -0
  375. package/dist/client/components/optimisticMoves.d.ts +21 -0
  376. package/dist/client/components/optimisticMoves.js +145 -0
  377. package/dist/client/components/pageContext.d.ts +154 -0
  378. package/dist/client/components/pageContext.js +47 -0
  379. package/dist/client/components/pageFieldsRead.d.ts +67 -0
  380. package/dist/client/components/pageFieldsRead.js +55 -0
  381. package/dist/client/components/pageModel.d.ts +203 -0
  382. package/dist/client/components/pageModel.js +67 -0
  383. package/dist/client/components/pageStep.d.ts +31 -0
  384. package/dist/client/components/pageStep.js +15 -0
  385. package/dist/client/components/paletteModel.d.ts +9 -0
  386. package/dist/client/components/paletteModel.js +46 -0
  387. package/dist/client/components/pickerStaleness.d.ts +32 -0
  388. package/dist/client/components/pickerStaleness.js +27 -0
  389. package/dist/client/components/placeOrder.d.ts +47 -0
  390. package/dist/client/components/placeOrder.js +71 -0
  391. package/dist/client/components/pointerDrag.d.ts +54 -0
  392. package/dist/client/components/pointerDrag.js +95 -0
  393. package/dist/client/components/presentationFit.d.ts +19 -0
  394. package/dist/client/components/presentationFit.js +32 -0
  395. package/dist/client/components/recordKeys.d.ts +2 -0
  396. package/dist/client/components/recordKeys.js +8 -0
  397. package/dist/client/components/recordSearch.d.ts +31 -0
  398. package/dist/client/components/recordSearch.js +80 -0
  399. package/dist/client/components/recordSurface.d.ts +86 -0
  400. package/dist/client/components/recordSurface.js +267 -0
  401. package/dist/client/components/rowOpens.d.ts +19 -0
  402. package/dist/client/components/rowOpens.js +25 -0
  403. package/dist/client/components/sidebarModel.d.ts +152 -0
  404. package/dist/client/components/sidebarModel.js +372 -0
  405. package/dist/client/components/suggestModel.d.ts +22 -0
  406. package/dist/client/components/suggestModel.js +49 -0
  407. package/dist/client/components/suggestPart.d.ts +4 -0
  408. package/dist/client/components/suggestPart.js +4 -0
  409. package/dist/client/components/textMeasure.d.ts +2 -0
  410. package/dist/client/components/textMeasure.js +35 -0
  411. package/dist/client/components/unknownIcon.d.ts +8 -0
  412. package/dist/client/components/unknownIcon.js +32 -0
  413. package/dist/client/components/useBulkSelection.d.ts +30 -0
  414. package/dist/client/components/useBulkSelection.js +360 -0
  415. package/dist/client/components/useConditionWords.d.ts +17 -0
  416. package/dist/client/components/useConditionWords.js +104 -0
  417. package/dist/client/components/useGridKeyboard.d.ts +32 -0
  418. package/dist/client/components/useGridKeyboard.js +223 -0
  419. package/dist/client/components/useListOrder.d.ts +94 -0
  420. package/dist/client/components/useListOrder.js +294 -0
  421. package/dist/client/components/useMediaQuery.d.ts +10 -0
  422. package/dist/client/components/useMediaQuery.js +45 -0
  423. package/dist/client/components/useMessageLanguage.d.ts +1 -0
  424. package/dist/client/components/useMessageLanguage.js +6 -0
  425. package/dist/client/components/usePins.d.ts +20 -0
  426. package/dist/client/components/usePins.js +66 -0
  427. package/dist/client/components/usePointerDrag.d.ts +72 -0
  428. package/dist/client/components/usePointerDrag.js +553 -0
  429. package/dist/client/components/useRecordInsert.d.ts +42 -0
  430. package/dist/client/components/useRecordInsert.js +145 -0
  431. package/dist/client/components/useRowWindow.d.ts +35 -0
  432. package/dist/client/components/useRowWindow.js +149 -0
  433. package/dist/client/components/useStickyHead.d.ts +17 -0
  434. package/dist/client/components/useStickyHead.js +65 -0
  435. package/dist/client/components/useTabFold.d.ts +32 -0
  436. package/dist/client/components/useTabFold.js +145 -0
  437. package/dist/client/components/valueModel.d.ts +300 -0
  438. package/dist/client/components/valueModel.js +560 -0
  439. package/dist/client/components/valueRenderers.d.ts +36 -0
  440. package/dist/client/components/valueRenderers.js +13 -0
  441. package/dist/client/components/viewLink.d.ts +27 -0
  442. package/dist/client/components/viewLink.js +79 -0
  443. package/dist/client/components/walk.d.ts +14 -0
  444. package/dist/client/components/walk.js +16 -0
  445. package/dist/client/compose.d.ts +8 -0
  446. package/dist/client/compose.js +163 -0
  447. package/dist/client/composedHook.d.ts +20 -0
  448. package/dist/client/composedHook.js +12 -0
  449. package/dist/client/composedReads.d.ts +26 -0
  450. package/dist/client/composedReads.js +183 -0
  451. package/dist/client/composer.css +499 -0
  452. package/dist/client/composer.d.ts +121 -0
  453. package/dist/client/composer.js +1079 -0
  454. package/dist/client/composerEntry.d.ts +1 -0
  455. package/dist/client/composerEntry.js +58 -0
  456. package/dist/client/composerTab.d.ts +6 -0
  457. package/dist/client/composerTab.js +20 -0
  458. package/dist/client/conditions.d.ts +46 -0
  459. package/dist/client/conditions.js +150 -0
  460. package/dist/client/connectionList.d.ts +11 -0
  461. package/dist/client/connectionList.js +146 -0
  462. package/dist/client/connectionScope.d.ts +6 -0
  463. package/dist/client/connectionScope.js +14 -0
  464. package/dist/client/connectionTransition.d.ts +12 -0
  465. package/dist/client/connectionTransition.js +41 -0
  466. package/dist/client/copy/columnMenu/components/AppColumnMenu.d.ts +4 -0
  467. package/dist/client/copy/columnMenu/components/AppColumnMenu.js +6 -0
  468. package/dist/client/copy/columnMenu/components/AppColumnMenuPopups.d.ts +4 -0
  469. package/dist/client/copy/columnMenu/components/AppColumnMenuPopups.js +6 -0
  470. package/dist/client/copy/columnMenu/components/ThMenu.d.ts +35 -0
  471. package/dist/client/copy/columnMenu/components/ThMenu.js +37 -0
  472. package/dist/client/copy/columnMenu/components/appColumnMenuModel.d.ts +10 -0
  473. package/dist/client/copy/columnMenu/components/appColumnMenuModel.js +12 -0
  474. package/dist/client/copy/dashboards/breakdownBatch.d.ts +3 -0
  475. package/dist/client/copy/dashboards/breakdownBatch.js +5 -0
  476. package/dist/client/copy/dashboards/components/Breakdown.d.ts +32 -0
  477. package/dist/client/copy/dashboards/components/Breakdown.js +25 -0
  478. package/dist/client/copy/dashboards/components/BreakdownRoom.d.ts +3 -0
  479. package/dist/client/copy/dashboards/components/BreakdownRoom.js +5 -0
  480. package/dist/client/copy/dashboards/components/Chart.d.ts +26 -0
  481. package/dist/client/copy/dashboards/components/Chart.js +19 -0
  482. package/dist/client/copy/dashboards/components/ChartShapes.d.ts +16 -0
  483. package/dist/client/copy/dashboards/components/ChartShapes.js +12 -0
  484. package/dist/client/copy/dashboards/components/PageMetrics.d.ts +21 -0
  485. package/dist/client/copy/dashboards/components/PageMetrics.js +20 -0
  486. package/dist/client/copy/dashboards/components/SectionPeriod.d.ts +4 -0
  487. package/dist/client/copy/dashboards/components/SectionPeriod.js +6 -0
  488. package/dist/client/copy/dashboards/components/dashboardModel.d.ts +3 -0
  489. package/dist/client/copy/dashboards/components/dashboardModel.js +5 -0
  490. package/dist/client/copy/es.d.ts +11 -0
  491. package/dist/client/copy/es.js +60 -0
  492. package/dist/client/copy/filters/components/FilterBoxes.d.ts +10 -0
  493. package/dist/client/copy/filters/components/FilterBoxes.js +12 -0
  494. package/dist/client/copy/filters/components/FilterRail.d.ts +16 -0
  495. package/dist/client/copy/filters/components/FilterRail.js +18 -0
  496. package/dist/client/copy/filters/components/ListFilterBar.d.ts +9 -0
  497. package/dist/client/copy/filters/components/ListFilterBar.js +11 -0
  498. package/dist/client/copy/filters/components/conditionWords.d.ts +46 -0
  499. package/dist/client/copy/filters/components/conditionWords.js +95 -0
  500. package/dist/client/copy/filters/components/filterRailModel.d.ts +12 -0
  501. package/dist/client/copy/filters/components/filterRailModel.js +14 -0
  502. package/dist/client/copy/forms/components/DateField.d.ts +13 -0
  503. package/dist/client/copy/forms/components/DateField.js +15 -0
  504. package/dist/client/copy/forms/components/MinorMoneyInput.d.ts +4 -0
  505. package/dist/client/copy/forms/components/MinorMoneyInput.js +6 -0
  506. package/dist/client/copy/forms/components/MultiStepForm.d.ts +10 -0
  507. package/dist/client/copy/forms/components/MultiStepForm.js +12 -0
  508. package/dist/client/copy/forms/components/NewRecord.d.ts +29 -0
  509. package/dist/client/copy/forms/components/NewRecord.js +31 -0
  510. package/dist/client/copy/forms/components/NewRecordButton.d.ts +6 -0
  511. package/dist/client/copy/forms/components/NewRecordButton.js +8 -0
  512. package/dist/client/copy/forms/components/Picker.d.ts +4 -0
  513. package/dist/client/copy/forms/components/Picker.js +6 -0
  514. package/dist/client/copy/forms/components/QuickAdd.d.ts +3 -0
  515. package/dist/client/copy/forms/components/QuickAdd.js +5 -0
  516. package/dist/client/copy/forms/components/RecordPicker.d.ts +6 -0
  517. package/dist/client/copy/forms/components/RecordPicker.js +8 -0
  518. package/dist/client/copy/forms/components/RichTextEditor.d.ts +36 -0
  519. package/dist/client/copy/forms/components/RichTextEditor.js +40 -0
  520. package/dist/client/copy/forms/components/RichTextField.d.ts +3 -0
  521. package/dist/client/copy/forms/components/RichTextField.js +5 -0
  522. package/dist/client/copy/forms/components/SetFieldDialog.d.ts +10 -0
  523. package/dist/client/copy/forms/components/SetFieldDialog.js +9 -0
  524. package/dist/client/copy/forms/components/useRecordInsert.d.ts +7 -0
  525. package/dist/client/copy/forms/components/useRecordInsert.js +9 -0
  526. package/dist/client/copy/help/helpContent.d.ts +71 -0
  527. package/dist/client/copy/help/helpContent.js +73 -0
  528. package/dist/client/copy/lists/bulkActions.d.ts +12 -0
  529. package/dist/client/copy/lists/bulkActions.js +14 -0
  530. package/dist/client/copy/lists/components/AppList.d.ts +28 -0
  531. package/dist/client/copy/lists/components/AppList.js +30 -0
  532. package/dist/client/copy/lists/components/CardsList.d.ts +3 -0
  533. package/dist/client/copy/lists/components/CardsList.js +5 -0
  534. package/dist/client/copy/lists/components/Gallery.d.ts +7 -0
  535. package/dist/client/copy/lists/components/Gallery.js +9 -0
  536. package/dist/client/copy/lists/components/Grid.d.ts +30 -0
  537. package/dist/client/copy/lists/components/Grid.js +29 -0
  538. package/dist/client/copy/lists/components/GridCellEditor.d.ts +5 -0
  539. package/dist/client/copy/lists/components/GridCellEditor.js +7 -0
  540. package/dist/client/copy/lists/components/GridSelection.d.ts +4 -0
  541. package/dist/client/copy/lists/components/GridSelection.js +6 -0
  542. package/dist/client/copy/lists/components/Nested.d.ts +7 -0
  543. package/dist/client/copy/lists/components/Nested.js +9 -0
  544. package/dist/client/copy/lists/components/RowActions.d.ts +1 -0
  545. package/dist/client/copy/lists/components/RowActions.js +3 -0
  546. package/dist/client/copy/lists/components/SavedViews.d.ts +5 -0
  547. package/dist/client/copy/lists/components/SavedViews.js +7 -0
  548. package/dist/client/copy/lists/components/SortMenu.d.ts +5 -0
  549. package/dist/client/copy/lists/components/SortMenu.js +7 -0
  550. package/dist/client/copy/lists/components/TableRoom.d.ts +12 -0
  551. package/dist/client/copy/lists/components/TableRoom.js +14 -0
  552. package/dist/client/copy/lists/components/TableView.d.ts +37 -0
  553. package/dist/client/copy/lists/components/TableView.js +39 -0
  554. package/dist/client/copy/lists/components/appListModel.d.ts +6 -0
  555. package/dist/client/copy/lists/components/appListModel.js +5 -0
  556. package/dist/client/copy/lists/components/myViews.d.ts +4 -0
  557. package/dist/client/copy/lists/components/myViews.js +6 -0
  558. package/dist/client/copy/lists/components/placeOrder.d.ts +4 -0
  559. package/dist/client/copy/lists/components/placeOrder.js +6 -0
  560. package/dist/client/copy/lists/components/useBulkSelection.d.ts +20 -0
  561. package/dist/client/copy/lists/components/useBulkSelection.js +16 -0
  562. package/dist/client/copy/lists/components/useListOrder.d.ts +7 -0
  563. package/dist/client/copy/lists/components/useListOrder.js +9 -0
  564. package/dist/client/copy/public/components/appRooms.d.ts +3 -0
  565. package/dist/client/copy/public/components/appRooms.js +5 -0
  566. package/dist/client/copy/record/components/Actions.d.ts +13 -0
  567. package/dist/client/copy/record/components/Actions.js +15 -0
  568. package/dist/client/copy/record/components/AttachmentList.d.ts +23 -0
  569. package/dist/client/copy/record/components/AttachmentList.js +22 -0
  570. package/dist/client/copy/record/components/DeleteButton.d.ts +22 -0
  571. package/dist/client/copy/record/components/DeleteButton.js +24 -0
  572. package/dist/client/copy/record/components/Dressed.d.ts +5 -0
  573. package/dist/client/copy/record/components/Dressed.js +7 -0
  574. package/dist/client/copy/record/components/EditLayoutButton.d.ts +5 -0
  575. package/dist/client/copy/record/components/EditLayoutButton.js +7 -0
  576. package/dist/client/copy/record/components/Editable.d.ts +25 -0
  577. package/dist/client/copy/record/components/Editable.js +24 -0
  578. package/dist/client/copy/record/components/FieldArranger.d.ts +15 -0
  579. package/dist/client/copy/record/components/FieldArranger.js +17 -0
  580. package/dist/client/copy/record/components/FilePreview.d.ts +13 -0
  581. package/dist/client/copy/record/components/FilePreview.js +15 -0
  582. package/dist/client/copy/record/components/JsonPreview.d.ts +3 -0
  583. package/dist/client/copy/record/components/JsonPreview.js +5 -0
  584. package/dist/client/copy/record/components/JsonView.d.ts +12 -0
  585. package/dist/client/copy/record/components/JsonView.js +14 -0
  586. package/dist/client/copy/record/components/LayoutBuilder.d.ts +23 -0
  587. package/dist/client/copy/record/components/LayoutBuilder.js +25 -0
  588. package/dist/client/copy/record/components/Lightbox.d.ts +5 -0
  589. package/dist/client/copy/record/components/Lightbox.js +7 -0
  590. package/dist/client/copy/record/components/LiveNotices.d.ts +33 -0
  591. package/dist/client/copy/record/components/LiveNotices.js +29 -0
  592. package/dist/client/copy/record/components/PageCurrent.d.ts +1 -0
  593. package/dist/client/copy/record/components/PageCurrent.js +3 -0
  594. package/dist/client/copy/record/components/PageEmptyRun.d.ts +3 -0
  595. package/dist/client/copy/record/components/PageEmptyRun.js +5 -0
  596. package/dist/client/copy/record/components/PageFields.d.ts +5 -0
  597. package/dist/client/copy/record/components/PageFields.js +7 -0
  598. package/dist/client/copy/record/components/PageFlowDiagram.d.ts +33 -0
  599. package/dist/client/copy/record/components/PageFlowDiagram.js +37 -0
  600. package/dist/client/copy/record/components/PageFlows.d.ts +20 -0
  601. package/dist/client/copy/record/components/PageFlows.js +22 -0
  602. package/dist/client/copy/record/components/PageGroups.d.ts +12 -0
  603. package/dist/client/copy/record/components/PageGroups.js +14 -0
  604. package/dist/client/copy/record/components/PageHead.d.ts +8 -0
  605. package/dist/client/copy/record/components/PageHead.js +10 -0
  606. package/dist/client/copy/record/components/PageHistory.d.ts +18 -0
  607. package/dist/client/copy/record/components/PageHistory.js +20 -0
  608. package/dist/client/copy/record/components/PageLayout.d.ts +5 -0
  609. package/dist/client/copy/record/components/PageLayout.js +7 -0
  610. package/dist/client/copy/record/components/PageRelated.d.ts +24 -0
  611. package/dist/client/copy/record/components/PageRelated.js +26 -0
  612. package/dist/client/copy/record/components/PageRoom.d.ts +4 -0
  613. package/dist/client/copy/record/components/PageRoom.js +6 -0
  614. package/dist/client/copy/record/components/PageSectionBox.d.ts +6 -0
  615. package/dist/client/copy/record/components/PageSectionBox.js +10 -0
  616. package/dist/client/copy/record/components/PageTimeline.d.ts +9 -0
  617. package/dist/client/copy/record/components/PageTimeline.js +8 -0
  618. package/dist/client/copy/record/components/Peek.d.ts +3 -0
  619. package/dist/client/copy/record/components/Peek.js +5 -0
  620. package/dist/client/copy/record/components/PeekPanel.d.ts +5 -0
  621. package/dist/client/copy/record/components/PeekPanel.js +7 -0
  622. package/dist/client/copy/record/components/QrCode.d.ts +3 -0
  623. package/dist/client/copy/record/components/QrCode.js +5 -0
  624. package/dist/client/copy/record/components/Record.d.ts +19 -0
  625. package/dist/client/copy/record/components/Record.js +21 -0
  626. package/dist/client/copy/record/components/RecordGone.d.ts +4 -0
  627. package/dist/client/copy/record/components/RecordGone.js +6 -0
  628. package/dist/client/copy/record/components/RecordSummaries.d.ts +1 -0
  629. package/dist/client/copy/record/components/RecordSummaries.js +3 -0
  630. package/dist/client/copy/record/components/RecordTags.d.ts +9 -0
  631. package/dist/client/copy/record/components/RecordTags.js +11 -0
  632. package/dist/client/copy/record/components/RecordTrailNav.d.ts +8 -0
  633. package/dist/client/copy/record/components/RecordTrailNav.js +10 -0
  634. package/dist/client/copy/record/components/RichText.d.ts +4 -0
  635. package/dist/client/copy/record/components/RichText.js +6 -0
  636. package/dist/client/copy/record/components/Value.d.ts +4 -0
  637. package/dist/client/copy/record/components/Value.js +6 -0
  638. package/dist/client/copy/record/components/WorkflowStatus.d.ts +7 -0
  639. package/dist/client/copy/record/components/WorkflowStatus.js +9 -0
  640. package/dist/client/copy/record/components/WriteConfirm.d.ts +11 -0
  641. package/dist/client/copy/record/components/WriteConfirm.js +13 -0
  642. package/dist/client/copy/record/components/groupMoves.d.ts +7 -0
  643. package/dist/client/copy/record/components/groupMoves.js +9 -0
  644. package/dist/client/copy/record/components/jsonModel.d.ts +3 -0
  645. package/dist/client/copy/record/components/jsonModel.js +5 -0
  646. package/dist/client/copy/record/components/pageModel.d.ts +5 -0
  647. package/dist/client/copy/record/components/pageModel.js +7 -0
  648. package/dist/client/copy/record/components/recordSurface.d.ts +6 -0
  649. package/dist/client/copy/record/components/recordSurface.js +8 -0
  650. package/dist/client/copy/record/components/valueModel.d.ts +5 -0
  651. package/dist/client/copy/record/components/valueModel.js +7 -0
  652. package/dist/client/copy/record/fileSource.d.ts +3 -0
  653. package/dist/client/copy/record/fileSource.js +5 -0
  654. package/dist/client/copy/record/insert.d.ts +6 -0
  655. package/dist/client/copy/record/insert.js +8 -0
  656. package/dist/client/copy/record/page.d.ts +4 -0
  657. package/dist/client/copy/record/page.js +6 -0
  658. package/dist/client/copy/record/recordEditValidation.d.ts +4 -0
  659. package/dist/client/copy/record/recordEditValidation.js +6 -0
  660. package/dist/client/copy/record/savedPages.d.ts +4 -0
  661. package/dist/client/copy/record/savedPages.js +6 -0
  662. package/dist/client/copy/record/template.d.ts +9 -0
  663. package/dist/client/copy/record/template.js +11 -0
  664. package/dist/client/copy/record/write.d.ts +30 -0
  665. package/dist/client/copy/record/write.js +26 -0
  666. package/dist/client/copy/shell/app.d.ts +27 -0
  667. package/dist/client/copy/shell/app.js +43 -0
  668. package/dist/client/copy/shell/components/AppIssues.d.ts +10 -0
  669. package/dist/client/copy/shell/components/AppIssues.js +9 -0
  670. package/dist/client/copy/shell/components/Crumbs.d.ts +7 -0
  671. package/dist/client/copy/shell/components/Crumbs.js +17 -0
  672. package/dist/client/copy/shell/components/Dropdown.d.ts +3 -0
  673. package/dist/client/copy/shell/components/Dropdown.js +5 -0
  674. package/dist/client/copy/shell/components/ErrorBoundary.d.ts +4 -0
  675. package/dist/client/copy/shell/components/ErrorBoundary.js +6 -0
  676. package/dist/client/copy/shell/components/FavoriteStar.d.ts +4 -0
  677. package/dist/client/copy/shell/components/FavoriteStar.js +6 -0
  678. package/dist/client/copy/shell/components/MobileNavDrawer.d.ts +4 -0
  679. package/dist/client/copy/shell/components/MobileNavDrawer.js +12 -0
  680. package/dist/client/copy/shell/components/OverflowMenu.d.ts +3 -0
  681. package/dist/client/copy/shell/components/OverflowMenu.js +10 -0
  682. package/dist/client/copy/shell/components/Palette.d.ts +15 -0
  683. package/dist/client/copy/shell/components/Palette.js +18 -0
  684. package/dist/client/copy/shell/components/Prefs.d.ts +4 -0
  685. package/dist/client/copy/shell/components/Prefs.js +11 -0
  686. package/dist/client/copy/shell/components/Prompt.d.ts +1 -0
  687. package/dist/client/copy/shell/components/Prompt.js +3 -0
  688. package/dist/client/copy/shell/components/Rooms.d.ts +6 -0
  689. package/dist/client/copy/shell/components/Rooms.js +8 -0
  690. package/dist/client/copy/shell/components/Sidebar.d.ts +7 -0
  691. package/dist/client/copy/shell/components/Sidebar.js +9 -0
  692. package/dist/client/copy/shell/components/Skeleton.d.ts +5 -0
  693. package/dist/client/copy/shell/components/Skeleton.js +7 -0
  694. package/dist/client/copy/shell/components/TopNav.d.ts +4 -0
  695. package/dist/client/copy/shell/components/TopNav.js +12 -0
  696. package/dist/client/copy/shell/components/Tour.d.ts +4 -0
  697. package/dist/client/copy/shell/components/Tour.js +6 -0
  698. package/dist/client/copy/shell/components/newMenuModel.d.ts +3 -0
  699. package/dist/client/copy/shell/components/newMenuModel.js +5 -0
  700. package/dist/client/copy/shell/components/onDemand.d.ts +3 -0
  701. package/dist/client/copy/shell/components/onDemand.js +5 -0
  702. package/dist/client/copy/shell/components/sidebarModel.d.ts +3 -0
  703. package/dist/client/copy/shell/components/sidebarModel.js +5 -0
  704. package/dist/client/copy/shell/connectionList.d.ts +6 -0
  705. package/dist/client/copy/shell/connectionList.js +8 -0
  706. package/dist/client/copy/shell/core.d.ts +16 -0
  707. package/dist/client/copy/shell/core.js +18 -0
  708. package/dist/client/copy/shell/palette.d.ts +6 -0
  709. package/dist/client/copy/shell/palette.js +8 -0
  710. package/dist/client/copy/shell/prompt.d.ts +1 -0
  711. package/dist/client/copy/shell/prompt.js +3 -0
  712. package/dist/client/copy/shell/requestIdentity.d.ts +9 -0
  713. package/dist/client/copy/shell/requestIdentity.js +11 -0
  714. package/dist/client/copy/shell/resourceRequests.d.ts +4 -0
  715. package/dist/client/copy/shell/resourceRequests.js +6 -0
  716. package/dist/client/copy/shell/sessionIdentity.d.ts +11 -0
  717. package/dist/client/copy/shell/sessionIdentity.js +13 -0
  718. package/dist/client/copy/shell/sessionLifecycle.d.ts +5 -0
  719. package/dist/client/copy/shell/sessionLifecycle.js +7 -0
  720. package/dist/client/copy/shell/startup.d.ts +5 -0
  721. package/dist/client/copy/shell/startup.js +7 -0
  722. package/dist/client/copy/shell/theme.d.ts +5 -0
  723. package/dist/client/copy/shell/theme.js +14 -0
  724. package/dist/client/copy/shell/toast.d.ts +3 -0
  725. package/dist/client/copy/shell/toast.js +5 -0
  726. package/dist/client/copy/shell/updateAttempts.d.ts +6 -0
  727. package/dist/client/copy/shell/updateAttempts.js +8 -0
  728. package/dist/client/copy/shell/visualTheme.d.ts +4 -0
  729. package/dist/client/copy/shell/visualTheme.js +6 -0
  730. package/dist/client/copy/workbench/clauses.d.ts +3 -0
  731. package/dist/client/copy/workbench/clauses.js +5 -0
  732. package/dist/client/copy/workbench/components/ApiOperations.d.ts +21 -0
  733. package/dist/client/copy/workbench/components/ApiOperations.js +23 -0
  734. package/dist/client/copy/workbench/components/Composer.d.ts +105 -0
  735. package/dist/client/copy/workbench/components/Composer.js +92 -0
  736. package/dist/client/copy/workbench/components/Diagram.d.ts +56 -0
  737. package/dist/client/copy/workbench/components/Diagram.js +46 -0
  738. package/dist/client/copy/workbench/components/Export.d.ts +26 -0
  739. package/dist/client/copy/workbench/components/Export.js +25 -0
  740. package/dist/client/copy/workbench/components/HelpPanel.d.ts +10 -0
  741. package/dist/client/copy/workbench/components/HelpPanel.js +12 -0
  742. package/dist/client/copy/workbench/components/History.d.ts +11 -0
  743. package/dist/client/copy/workbench/components/History.js +10 -0
  744. package/dist/client/copy/workbench/components/Landing.d.ts +5 -0
  745. package/dist/client/copy/workbench/components/Landing.js +7 -0
  746. package/dist/client/copy/workbench/components/SchemaExport.d.ts +24 -0
  747. package/dist/client/copy/workbench/components/SchemaExport.js +20 -0
  748. package/dist/client/copy/workbench/components/Summary.d.ts +28 -0
  749. package/dist/client/copy/workbench/components/Summary.js +24 -0
  750. package/dist/client/copy/workbench/components/ThemeLab.d.ts +25 -0
  751. package/dist/client/copy/workbench/components/ThemeLab.js +27 -0
  752. package/dist/client/copy/workbench/components/WorkPanel.d.ts +12 -0
  753. package/dist/client/copy/workbench/components/WorkPanel.js +14 -0
  754. package/dist/client/copy/workbench/composer.d.ts +36 -0
  755. package/dist/client/copy/workbench/composer.js +32 -0
  756. package/dist/client/copy/workbench/composerEntry.d.ts +4 -0
  757. package/dist/client/copy/workbench/composerEntry.js +6 -0
  758. package/dist/client/copy/workbench/export.d.ts +8 -0
  759. package/dist/client/copy/workbench/export.js +7 -0
  760. package/dist/client/copy/workbench/filterbar.d.ts +6 -0
  761. package/dist/client/copy/workbench/filterbar.js +8 -0
  762. package/dist/client/copy/workbench/handoff.d.ts +20 -0
  763. package/dist/client/copy/workbench/handoff.js +19 -0
  764. package/dist/client/copy/workbench/help.d.ts +6 -0
  765. package/dist/client/copy/workbench/help.js +8 -0
  766. package/dist/client/copy/workbench/history.d.ts +3 -0
  767. package/dist/client/copy/workbench/history.js +5 -0
  768. package/dist/client/copy/workbench/schemaexport.d.ts +5 -0
  769. package/dist/client/copy/workbench/schemaexport.js +7 -0
  770. package/dist/client/copy/workbench/tour.d.ts +22 -0
  771. package/dist/client/copy/workbench/tour.js +24 -0
  772. package/dist/client/copy/workbench/views.d.ts +6 -0
  773. package/dist/client/copy/workbench/views.js +8 -0
  774. package/dist/client/core.d.ts +312 -0
  775. package/dist/client/core.js +1067 -0
  776. package/dist/client/customThemes.css +43 -0
  777. package/dist/client/dashboard.d.ts +16 -0
  778. package/dist/client/dashboard.js +35 -0
  779. package/dist/client/deeplink.d.ts +64 -0
  780. package/dist/client/deeplink.js +384 -0
  781. package/dist/client/delete.d.ts +8 -0
  782. package/dist/client/delete.js +35 -0
  783. package/dist/client/density.d.ts +8 -0
  784. package/dist/client/density.js +102 -0
  785. package/dist/client/devtoolsEventClient.d.ts +27 -0
  786. package/dist/client/devtoolsEventClient.js +32 -0
  787. package/dist/client/documents.d.ts +9 -0
  788. package/dist/client/documents.js +23 -0
  789. package/dist/client/dom.d.ts +36 -0
  790. package/dist/client/dom.js +232 -0
  791. package/dist/client/draftRecovery.d.ts +16 -0
  792. package/dist/client/draftRecovery.js +56 -0
  793. package/dist/client/export.d.ts +59 -0
  794. package/dist/client/export.js +217 -0
  795. package/dist/client/features.css +2187 -0
  796. package/dist/client/fieldErrors.d.ts +27 -0
  797. package/dist/client/fieldErrors.js +20 -0
  798. package/dist/client/fileSource.d.ts +10 -0
  799. package/dist/client/fileSource.js +115 -0
  800. package/dist/client/filterbar.d.ts +87 -0
  801. package/dist/client/filterbar.js +168 -0
  802. package/dist/client/firstPaint.d.ts +26 -0
  803. package/dist/client/firstPaint.js +102 -0
  804. package/dist/client/fonts/Barlow-OFL.txt +125 -0
  805. package/dist/client/fonts/IBMPlexMono-OFL.txt +104 -0
  806. package/dist/client/fonts/Inter-OFL.txt +92 -0
  807. package/dist/client/fonts/barlow-400.woff2 +0 -0
  808. package/dist/client/fonts/barlow-600.woff2 +0 -0
  809. package/dist/client/fonts/barlow-semi-condensed-700.woff2 +0 -0
  810. package/dist/client/fonts/ibm-plex-mono-400.woff2 +0 -0
  811. package/dist/client/fonts/ibm-plex-mono-500.woff2 +0 -0
  812. package/dist/client/fonts/inter-latin.woff2 +0 -0
  813. package/dist/client/formControls.css +5 -0
  814. package/dist/client/handoff.d.ts +47 -0
  815. package/dist/client/handoff.js +138 -0
  816. package/dist/client/help.css +151 -0
  817. package/dist/client/help.d.ts +20 -0
  818. package/dist/client/help.js +103 -0
  819. package/dist/client/helpContent.d.ts +95 -0
  820. package/dist/client/helpContent.js +661 -0
  821. package/dist/client/history.d.ts +10 -0
  822. package/dist/client/history.js +181 -0
  823. package/dist/client/historyToken.d.ts +18 -0
  824. package/dist/client/historyToken.js +27 -0
  825. package/dist/client/iconWeight.d.ts +16 -0
  826. package/dist/client/iconWeight.js +44 -0
  827. package/dist/client/index.html +244 -0
  828. package/dist/client/insert.d.ts +50 -0
  829. package/dist/client/insert.js +269 -0
  830. package/dist/client/kit.d.ts +7 -0
  831. package/dist/client/kit.js +1 -0
  832. package/dist/client/layoutDraftRecovery.d.ts +8 -0
  833. package/dist/client/layoutDraftRecovery.js +33 -0
  834. package/dist/client/ledgerLook.css +32 -0
  835. package/dist/client/liveReads.d.ts +23 -0
  836. package/dist/client/liveReads.js +38 -0
  837. package/dist/client/liveState.d.ts +94 -0
  838. package/dist/client/liveState.js +212 -0
  839. package/dist/client/locale.d.ts +141 -0
  840. package/dist/client/locale.js +0 -0
  841. package/dist/client/lumenLook.css +1867 -0
  842. package/dist/client/menu.d.ts +49 -0
  843. package/dist/client/menu.js +131 -0
  844. package/dist/client/menuScope.d.ts +6 -0
  845. package/dist/client/menuScope.js +4 -0
  846. package/dist/client/messages.d.ts +240 -0
  847. package/dist/client/messages.js +370 -0
  848. package/dist/client/motionStill.d.ts +1 -0
  849. package/dist/client/motionStill.js +17 -0
  850. package/dist/client/navigationHold.d.ts +37 -0
  851. package/dist/client/navigationHold.js +503 -0
  852. package/dist/client/nested.d.ts +8 -0
  853. package/dist/client/nested.js +26 -0
  854. package/dist/client/ownWrites.d.ts +33 -0
  855. package/dist/client/ownWrites.js +76 -0
  856. package/dist/client/page.css +4052 -0
  857. package/dist/client/page.d.ts +21 -0
  858. package/dist/client/page.js +187 -0
  859. package/dist/client/pagemarks.d.ts +32 -0
  860. package/dist/client/pagemarks.js +98 -0
  861. package/dist/client/palette.d.ts +35 -0
  862. package/dist/client/palette.js +357 -0
  863. package/dist/client/partsLook.css +1047 -0
  864. package/dist/client/peek.d.ts +11 -0
  865. package/dist/client/peek.js +51 -0
  866. package/dist/client/peekpanel.d.ts +26 -0
  867. package/dist/client/peekpanel.js +121 -0
  868. package/dist/client/pendingWork.d.ts +19 -0
  869. package/dist/client/pendingWork.js +36 -0
  870. package/dist/client/pins.d.ts +24 -0
  871. package/dist/client/pins.js +97 -0
  872. package/dist/client/prefs.d.ts +3 -0
  873. package/dist/client/prefs.js +32 -0
  874. package/dist/client/prompt.d.ts +27 -0
  875. package/dist/client/prompt.js +61 -0
  876. package/dist/client/readGathering.d.ts +4 -0
  877. package/dist/client/readGathering.js +23 -0
  878. package/dist/client/recordCompose.d.ts +11 -0
  879. package/dist/client/recordCompose.js +69 -0
  880. package/dist/client/recordDrafts.d.ts +40 -0
  881. package/dist/client/recordDrafts.js +57 -0
  882. package/dist/client/recordEditValidation.d.ts +12 -0
  883. package/dist/client/recordEditValidation.js +52 -0
  884. package/dist/client/recordIntent.d.ts +6 -0
  885. package/dist/client/recordIntent.js +15 -0
  886. package/dist/client/recordPress.d.ts +12 -0
  887. package/dist/client/recordPress.js +84 -0
  888. package/dist/client/recordSource.d.ts +6 -0
  889. package/dist/client/recordSource.js +15 -0
  890. package/dist/client/recordTrail.d.ts +77 -0
  891. package/dist/client/recordTrail.js +101 -0
  892. package/dist/client/recordWriteRefresh.d.ts +74 -0
  893. package/dist/client/recordWriteRefresh.js +284 -0
  894. package/dist/client/relatedRows.d.ts +4 -0
  895. package/dist/client/relatedRows.js +24 -0
  896. package/dist/client/requestIdentity.d.ts +36 -0
  897. package/dist/client/requestIdentity.js +97 -0
  898. package/dist/client/resourceRequests.d.ts +7 -0
  899. package/dist/client/resourceRequests.js +32 -0
  900. package/dist/client/roleLabels.d.ts +7 -0
  901. package/dist/client/roleLabels.js +24 -0
  902. package/dist/client/rowEditing.d.ts +15 -0
  903. package/dist/client/rowEditing.js +36 -0
  904. package/dist/client/sageLook.css +242 -0
  905. package/dist/client/savedPages.d.ts +15 -0
  906. package/dist/client/savedPages.js +123 -0
  907. package/dist/client/schemaexport.d.ts +14 -0
  908. package/dist/client/schemaexport.js +182 -0
  909. package/dist/client/sessionIdentity.d.ts +39 -0
  910. package/dist/client/sessionIdentity.js +255 -0
  911. package/dist/client/sessionLifecycle.d.ts +33 -0
  912. package/dist/client/sessionLifecycle.js +276 -0
  913. package/dist/client/shellHost.d.ts +70 -0
  914. package/dist/client/shellHost.js +92 -0
  915. package/dist/client/shellMain.d.ts +8 -0
  916. package/dist/client/shellMode.d.ts +433 -0
  917. package/dist/client/shellMode.js +68 -0
  918. package/dist/client/shellStart.d.ts +5 -0
  919. package/dist/client/shellStart.js +54 -0
  920. package/dist/client/shells.d.ts +123 -0
  921. package/dist/client/shells.js +1 -0
  922. package/dist/client/sql.css +139 -0
  923. package/dist/client/startup.d.ts +8 -0
  924. package/dist/client/startup.js +85 -0
  925. package/dist/client/startupHold.d.ts +10 -0
  926. package/dist/client/startupHold.js +73 -0
  927. package/dist/client/structure.css +1296 -0
  928. package/dist/client/style.css +3526 -0
  929. package/dist/client/styleImports.d.ts +3 -0
  930. package/dist/client/surfaces.d.ts +18 -0
  931. package/dist/client/surfaces.js +27 -0
  932. package/dist/client/surfacesLook.css +88 -0
  933. package/dist/client/template.d.ts +75 -0
  934. package/dist/client/template.js +403 -0
  935. package/dist/client/theme.d.ts +14 -0
  936. package/dist/client/theme.js +112 -0
  937. package/dist/client/themeFamilies.css +788 -0
  938. package/dist/client/thmenu.d.ts +12 -0
  939. package/dist/client/thmenu.js +94 -0
  940. package/dist/client/toast.d.ts +7 -0
  941. package/dist/client/toast.js +117 -0
  942. package/dist/client/tour.d.ts +8 -0
  943. package/dist/client/tour.js +176 -0
  944. package/dist/client/transport.d.ts +2 -0
  945. package/dist/client/transport.js +13 -0
  946. package/dist/client/typography.d.ts +4 -0
  947. package/dist/client/typography.js +51 -0
  948. package/dist/client/uiBridge.d.ts +57 -0
  949. package/dist/client/uiBridge.js +30 -0
  950. package/dist/client/updateAttempts.d.ts +46 -0
  951. package/dist/client/updateAttempts.js +131 -0
  952. package/dist/client/url.d.ts +74 -0
  953. package/dist/client/url.js +388 -0
  954. package/dist/client/views.d.ts +19 -0
  955. package/dist/client/views.js +133 -0
  956. package/dist/client/visualTheme.d.ts +62 -0
  957. package/dist/client/visualTheme.js +502 -0
  958. package/dist/client/visualThemes.css +421 -0
  959. package/dist/client/workshopLook.css +126 -0
  960. package/dist/client/write.d.ts +100 -0
  961. package/dist/client/write.js +882 -0
  962. package/dist/client/writePaths.d.ts +16 -0
  963. package/dist/client/writePaths.js +35 -0
  964. package/dist/client/yesNoRule.d.ts +12 -0
  965. package/dist/client/yesNoRule.js +39 -0
  966. package/dist/clientFiles.d.ts +11 -4
  967. package/dist/clientFiles.js +16 -12
  968. package/dist/vite.d.ts +136 -0
  969. package/dist/vite.js +571 -0
  970. package/package.json +130 -3
@@ -0,0 +1,801 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Charts for dashboards: a line for how a number moved, bars for how much
4
+ * each group holds, a donut for how a whole divides, stacked bars for how each of several wholes divides, a
5
+ * spark for the shape inside a KPI card. Hand-drawn SVG and HTML, not a
6
+ * dependency. A target is a rule in the ink, said in words beside it.
7
+ *
8
+ * Colour comes from theme tokens: the line uses the accent and categorical
9
+ * slices share their series token with the matching legend swatch. Without
10
+ * preset tokens, the original single-accent, stepped-opacity treatment remains.
11
+ * Values are spoken through the caller's `say` so money charts
12
+ * read "$4.6M" everywhere the number appears.
13
+ */
14
+ import { useLayoutEffect, useRef, useState } from 'react';
15
+ import { viewportBox } from '../core.js';
16
+ import { fillGaps, isPeriodRun } from '../chart.js';
17
+ import { formatDate, formatPercent } from '../locale.js';
18
+ import { niceScale } from '@mistriwork/engine/shared/niceTicks.js';
19
+ /* The charts' own sheet travels with the chunk that draws them (onDemand). */
20
+ import './Chart.css';
21
+ import { say as sayCopy } from '../copy/dashboards/components/Chart.js';
22
+ /** An axis's words for a level: the sayer's axis form, else the sayer itself. */
23
+ const tickSay = (say) => say.tick ?? say;
24
+ const f1 = (n) => n.toFixed(1);
25
+ const MONTH = /^(\d{4})-(\d{2})$/;
26
+ const DAY = /^(\d{4})-\d{2}-\d{2}$/;
27
+ /**
28
+ * A month bucket as a reader says it, in the App's locale: "Jan 2026" where
29
+ * the year starts or changes from the tick before it, "Feb" after it. The
30
+ * grammar spells a month `2026-01` on every engine, which is a key, not a
31
+ * word; any other key is said as it came.
32
+ */
33
+ export function periodTick(key, previous) {
34
+ /* A day is said as a month's is, "Sep 10, 2026" then "Sep 11": a stacked
35
+ bar over days read "2026-09-10", a key where every other chart said a date. */
36
+ const day = DAY.exec(key);
37
+ if (day) {
38
+ const year = !previous || DAY.exec(previous)?.[1] !== day[1];
39
+ return formatDate(key, year ? { month: 'short', day: 'numeric', year: 'numeric' } : { month: 'short', day: 'numeric' });
40
+ }
41
+ const month = MONTH.exec(key);
42
+ if (!month)
43
+ return key;
44
+ const year = !previous || MONTH.exec(previous)?.[1] !== month[1];
45
+ return formatDate(`${key}-01`, year ? { month: 'short', year: 'numeric' } : { month: 'short' });
46
+ }
47
+ /**
48
+ * Step `i` of `n` along one hue, for series over a scale (a priority, a
49
+ * severity, an age in days): categorical hues said Medium and High in two
50
+ * greens a reader could not tell apart, and said nothing of which came
51
+ * first. The first step is the lead series deepened toward the ink, the last
52
+ * the same hue washed toward the surface, mixed in OKLab so the steps are
53
+ * even to the eye; by night the ink is light and the surface dark, so the
54
+ * first step is still the one that stands out. Tokens only: an App's accent
55
+ * and its dark pair carry through.
56
+ */
57
+ function rampInk(i, n) {
58
+ const lead = 'var(--chart-1, var(--accent))';
59
+ if (n <= 1)
60
+ return lead;
61
+ const strong = Math.round(100 * (1 - Math.min(Math.max(i / (n - 1), 0), 1)));
62
+ return `color-mix(in oklab, color-mix(in oklab, ${lead}, var(--ink) 30%) ${strong}%, color-mix(in oklab, ${lead}, var(--surface) 55%))`;
63
+ }
64
+ /** The width a tick's words take at the axis's 11px, budgeted generously: a label that overlaps its neighbour is worse than one left out. */
65
+ const tickWidth = (text) => text.length * 6.6 + 4;
66
+ /**
67
+ * Which points the x axis names, and what it calls each: as many as fit the
68
+ * width, evenly spaced, the first and the last always among them. A month
69
+ * says its year only where the year turns from the mark before it, and a
70
+ * mark is budgeted at what it will actually say — "Oct", not "Oct 2025" — so
71
+ * a month that has room is not dropped for a year it would not have shown.
72
+ *
73
+ * A mark is budgeted where it is drawn: a line's first and last words stand
74
+ * inside the plot, starting and ending at their points; a bar's are centred
75
+ * under their bars, as every other mark is (`centered`). Budgeting a bar's
76
+ * as a line's took a whole word's width twice, and a half-width bar chart
77
+ * named only its first and last month.
78
+ */
79
+ export function axisMarks(keys, at, { centered = false } = {}) {
80
+ const last = keys.length - 1;
81
+ const said = (marks) => marks.map((index, k) => ({ index, text: periodTick(keys[index], k ? keys[marks[k - 1]] : undefined) }));
82
+ const extent = ({ index, text }) => {
83
+ const p = at(index), w = tickWidth(text);
84
+ return !centered && index === 0 ? [p, p + w] : !centered && index === last ? [p - w, p] : [p - w / 2, p + w / 2];
85
+ };
86
+ /* The first pair of neighbours too close to read apart, or -1. */
87
+ const clash = (marks) => marks.findIndex((mark, k) => k > 0 && extent(mark)[0] - extent(marks[k - 1])[1] < 12);
88
+ for (let stride = 1; stride <= Math.max(1, last); stride += 1) {
89
+ const marks = [];
90
+ for (let i = 0; i < last; i += stride)
91
+ marks.push(i);
92
+ /* The last point is always named; the evenly spaced mark before it gives
93
+ way when those two would meet — and only then: a clash further in is
94
+ a stride too short, and the next one is tried. */
95
+ marks.push(last);
96
+ let named = said(marks);
97
+ if (marks.length > 2 && clash(named) === marks.length - 1) {
98
+ marks.splice(marks.length - 2, 1);
99
+ named = said(marks);
100
+ }
101
+ if (clash(named) < 0)
102
+ return named;
103
+ }
104
+ return said([last]);
105
+ }
106
+ /**
107
+ * A path through points: straight segments, or with `smooth` a monotone cubic
108
+ * (Fritsch–Carlson) — a curve that never overshoots its points, so a smooth
109
+ * line still never says a value the data did not reach.
110
+ */
111
+ function linePath(pts, smooth = false) {
112
+ if (!smooth || pts.length < 3)
113
+ return pts.map(([px, py], i) => `${i ? 'L' : 'M'}${f1(px)},${f1(py)}`).join(' ');
114
+ const n = pts.length;
115
+ const dx = (i) => pts[i + 1][0] - pts[i][0];
116
+ const slope = Array.from({ length: n - 1 }, (_, i) => (pts[i + 1][1] - pts[i][1]) / (dx(i) || 1));
117
+ const m = pts.map((_, i) => i === 0 ? slope[0] : i === n - 1 ? slope[n - 2] : slope[i - 1] * slope[i] <= 0 ? 0 : (slope[i - 1] + slope[i]) / 2);
118
+ for (let i = 0; i < n - 1; i++) {
119
+ if (slope[i] === 0) {
120
+ m[i] = 0;
121
+ m[i + 1] = 0;
122
+ continue;
123
+ }
124
+ const a = m[i] / slope[i], b = m[i + 1] / slope[i];
125
+ const h = a * a + b * b;
126
+ if (h > 9) {
127
+ const t = 3 / Math.sqrt(h);
128
+ m[i] = t * a * slope[i];
129
+ m[i + 1] = t * b * slope[i];
130
+ }
131
+ }
132
+ let d = `M${f1(pts[0][0])},${f1(pts[0][1])}`;
133
+ for (let i = 0; i < n - 1; i++) {
134
+ const third = dx(i) / 3;
135
+ d += ` C${f1(pts[i][0] + third)},${f1(pts[i][1] + m[i] * third)} ${f1(pts[i + 1][0] - third)},${f1(pts[i + 1][1] - m[i + 1] * third)} ${f1(pts[i + 1][0])},${f1(pts[i + 1][1])}`;
136
+ }
137
+ return d;
138
+ }
139
+ /**
140
+ * A time-series line: keys along the bottom, values as an accent line over
141
+ * a soft fill, three labelled gridlines, and a crosshair on hover drawn in
142
+ * the chart rather than left to a native tooltip.
143
+ *
144
+ * Its words are set at their own size wherever it is drawn: the chart
145
+ * measures the width it is given (on the zoom-aware ruler) and draws a
146
+ * viewBox exactly that wide, so a phone does not shrink an 11px label to 6.
147
+ * `wide` is the first guess, before there is a box to measure. The levels
148
+ * are said on the left, in a gutter of their own, where the line cannot
149
+ * run through them. Every point is also a row of a table that assistive
150
+ * technology reads, since a picture's titles are not.
151
+ */
152
+ export function LineChart({ rows, say = String, wide = 600, high, target, smooth = false, dots = false, seriesLabel = String, seriesVocabulary, onPick, }) {
153
+ if (rows.some((row) => row.series !== undefined))
154
+ return (_jsx(MultiLine, { rows: rows, say: say, wide: wide, high: high, target: target, smooth: smooth, seriesLabel: seriesLabel, vocabulary: seriesVocabulary }));
155
+ return _jsx(OneLine, { rows: rows, say: say, wide: wide, high: high, target: target, smooth: smooth, dots: dots, onPick: onPick });
156
+ }
157
+ function OneLine({ rows, say, wide, high, target, smooth, dots, onPick, }) {
158
+ const points = fillGaps(rows
159
+ .map((r) => ({ key: r.key == null ? '—' : String(r.key), value: Number(r.value), raw: r.key }))
160
+ .filter((p) => Number.isFinite(p.value)));
161
+ const svg = useRef(null);
162
+ const [near, setNear] = useState(null);
163
+ const [measured, setMeasured] = useState(0);
164
+ /* Roving tabindex for drillable points: one tab stop for the whole
165
+ line, not one per point. The tabbable point is the roved-to one, or
166
+ the first drillable one where the roved-to one stopped drilling;
167
+ arrows move among drillable points only, Home and End take the
168
+ first and last. */
169
+ const drillableAt = points.map((p, i) => (onPick && p.raw != null ? i : -1)).filter((i) => i >= 0);
170
+ const [roved, setRoved] = useState(null);
171
+ const tabbable = roved !== null && drillableAt.includes(roved) ? roved : drillableAt[0];
172
+ const moveRoving = (at) => {
173
+ setRoved(at);
174
+ const el = svg.current?.querySelectorAll('.chart-point-drill')[drillableAt.indexOf(at)];
175
+ el?.focus?.();
176
+ };
177
+ /* Alone, a point has no line to join it to and no neighbour to space against: a dotted line draws even one. */
178
+ const drawn = points.length >= 2 || (dots && points.length === 1);
179
+ useLayoutEffect(() => {
180
+ const element = svg.current?.parentElement;
181
+ if (!element || typeof ResizeObserver === 'undefined')
182
+ return;
183
+ const measure = () => setMeasured(Math.max(0, Math.round(viewportBox(element).width)));
184
+ measure();
185
+ const observer = new ResizeObserver(measure);
186
+ observer.observe(element);
187
+ return () => observer.disconnect();
188
+ }, [drawn]);
189
+ if (!drawn)
190
+ return _jsx("p", { className: "note", children: sayCopy('notEnoughPointsToDraw') });
191
+ /* The viewBox is the width the chart is drawn at, so text and strokes
192
+ land at their own size. The height is the author's when given;
193
+ otherwise, page-wide, a quarter of the width, capped: at a third a page-wide line stood in 220px of plot,
194
+ most of it white over the line. */
195
+ const W = measured > 0 ? measured : wide;
196
+ /* Half a page wide (a pair, Dashboard.tsx) it keeps the third its neighbour has, so the two plots of a row
197
+ stand the same height rather than one short over white. */
198
+ const H = high
199
+ ? Math.max(120, Math.round(high))
200
+ : Math.max(120, W < 760 ? Math.min(Math.round(W / 3), 220) : Math.min(Math.round(W / 4), 180));
201
+ /* A target is kept in view: a line far under its goal still shows the goal. */
202
+ const goal = target !== undefined && Number.isFinite(target) ? target : undefined;
203
+ const max = Math.max(...points.map((p) => p.value), 0, goal ?? 0);
204
+ const min = Math.min(...points.map((p) => p.value), 0, goal ?? 0);
205
+ const scale = niceScale(min, max, 2, say.tick?.steps);
206
+ const levels = scale.levels;
207
+ const span = scale.max - scale.min || 1;
208
+ const gutter = Math.max(...levels.map((v) => tickWidth(tickSay(say)(v)))) + 6;
209
+ const PAD = { top: 14, right: 14, bottom: 24, left: gutter };
210
+ const x = (i) => PAD.left + (points.length > 1 ? (i * (W - PAD.left - PAD.right)) / (points.length - 1) : (W - PAD.left - PAD.right) / 2);
211
+ const y = (v) => PAD.top + (1 - (v - scale.min) / span) * (H - PAD.top - PAD.bottom);
212
+ const line = linePath(points.map((p, i) => [x(i), y(p.value)]), smooth);
213
+ const area = `${line} L${f1(x(points.length - 1))},${f1(y(scale.min))} L${f1(x(0))},${f1(y(scale.min))} Z`;
214
+ /* A point is named with its year wherever it stands alone — a dot's
215
+ title, the crosshair, the table — and the axis drops the year a tick
216
+ shares with the one before it. */
217
+ const named = points.map((p) => periodTick(p.key));
218
+ const marks = axisMarks(points.map((p) => p.key), x);
219
+ const onMove = (e) => {
220
+ // screen-px: clientX is a screen-pixel ruler too; the ratio maps it into viewBox units.
221
+ const box = svg.current.getBoundingClientRect();
222
+ const px = ((e.clientX - box.left) / box.width) * W;
223
+ let best = 0;
224
+ for (let i = 1; i < points.length; i++)
225
+ if (Math.abs(x(i) - px) < Math.abs(x(best) - px))
226
+ best = i;
227
+ setNear(best);
228
+ };
229
+ const cx = near === null ? 0 : x(near);
230
+ const cy = near === null ? 0 : y(points[near].value);
231
+ const right = cx > W * 0.7;
232
+ /* A picture must not hold buttons: where any point drills, the figure
233
+ is a group holding buttons, not an image — axe's nested-interactive
234
+ fails a button inside role="img", as a donut's does. Where nothing
235
+ drills it stays an image, as before. */
236
+ const anyDrillable = onPick && points.some((p) => p.raw != null);
237
+ return (_jsxs(_Fragment, { children: [_jsxs("svg", { ref: svg, className: "chart-line", viewBox: `0 0 ${W} ${H}`, role: anyDrillable ? 'group' : 'img', "aria-label": `${sayCopy('lineSummary', { count: points.length, from: say(points[0].value), to: say(points[points.length - 1].value), peak: say(Math.max(...points.map((p) => p.value))) })}${goal === undefined ? '' : sayCopy('targetAfter', { goal: say(goal) })}`, onPointerMove: onMove, onPointerLeave: () => setNear(null), children: [levels.map((v) => (_jsx("line", { className: "chart-grid", x1: PAD.left, x2: W - PAD.right, y1: f1(y(v)), y2: f1(y(v)) }, `g${v}`))), levels.map((v) => (_jsx("text", { className: "chart-tick chart-y-tick", x: f1(PAD.left - 6), y: f1(y(v) + 4), textAnchor: "end", children: tickSay(say)(v) }, `t${v}`))), goal !== undefined && (_jsxs("g", { className: "chart-target", children: [_jsx("line", { className: "chart-target-line", x1: PAD.left, x2: W - PAD.right, y1: f1(y(goal)), y2: f1(y(goal)) }), _jsx("text", { className: "chart-target-label", x: PAD.left + 4, y: f1(y(goal) - 4), children: sayCopy('target', { goal: say(goal) }) })] })), !dots && _jsx("path", { className: "chart-area", d: area }), !dots && _jsx("path", { className: "chart-stroke", d: line }), points.map((p, i) => {
238
+ const dot = (_jsx("circle", { className: dots && p.value !== 0 ? 'chart-dot chart-dot-solid' : 'chart-dot', cx: f1(x(i)), cy: f1(y(p.value)), r: dots ? 4 : 3, children: _jsx("title", { children: `${named[i]}: ${say(p.value)}` }) }));
239
+ /* A point drills where a door is wanted: the same raw value a
240
+ legend button would carry. A dot is too small a target to be
241
+ the button itself, so a drillable point is a group holding the
242
+ dot and a wider transparent hit disc — one tab stop, not two,
243
+ and roving tabindex keeps the whole line to that one stop.
244
+ Gap-filled buckets hold no raw key and are no door, as a
245
+ donut's "others" slice is none. */
246
+ const drillable = onPick && p.raw != null;
247
+ if (!drillable)
248
+ return _jsx("g", { children: dot }, i);
249
+ return (_jsxs("g", { className: "chart-point-drill", role: "button", tabIndex: i === tabbable ? 0 : -1, "aria-label": `${named[i]}: ${say(p.value)}`, onClick: () => onPick(p.raw), onKeyDown: (event) => {
250
+ if (event.key === 'Enter' || event.key === ' ') {
251
+ event.preventDefault();
252
+ onPick(p.raw);
253
+ }
254
+ else if (event.key === 'ArrowRight') {
255
+ const at = drillableAt[drillableAt.indexOf(i) + 1];
256
+ if (at !== undefined) {
257
+ event.preventDefault();
258
+ moveRoving(at);
259
+ }
260
+ }
261
+ else if (event.key === 'ArrowLeft') {
262
+ const at = drillableAt[drillableAt.indexOf(i) - 1];
263
+ if (at !== undefined) {
264
+ event.preventDefault();
265
+ moveRoving(at);
266
+ }
267
+ }
268
+ else if (event.key === 'Home') {
269
+ const at = drillableAt[0];
270
+ if (at !== undefined) {
271
+ event.preventDefault();
272
+ moveRoving(at);
273
+ }
274
+ }
275
+ else if (event.key === 'End') {
276
+ const at = drillableAt[drillableAt.length - 1];
277
+ if (at !== undefined) {
278
+ event.preventDefault();
279
+ moveRoving(at);
280
+ }
281
+ }
282
+ }, children: [_jsx("circle", { className: "chart-point-hit", cx: f1(x(i)), cy: f1(y(p.value)), r: 12 }), dot] }, i));
283
+ }), marks.map(({ index, text }) => (_jsx("text", { className: "chart-tick chart-x-tick", x: f1(x(index)), y: H - 6, textAnchor: points.length > 1 && index === 0 ? 'start' : points.length > 1 && index === points.length - 1 ? 'end' : 'middle', children: text }, `m${index}`))), _jsxs("g", { className: "chart-cursor", ...(near === null ? { hidden: true } : {}), children: [_jsx("line", { className: "chart-cursor-line", x1: f1(cx), x2: f1(cx), y1: PAD.top, y2: H - PAD.bottom }), _jsx("circle", { className: "chart-cursor-dot", cx: f1(cx), cy: f1(cy), r: 4 }), _jsx("text", { className: "chart-cursor-text", x: f1(right ? cx - 8 : cx + 8), y: f1(Math.max(PAD.top + 10, cy - 10)), textAnchor: right ? 'end' : 'start', children: near === null ? '' : `${named[near]} · ${say(points[near].value)}` })] })] }), _jsx("div", { className: "visually-hidden", children: _jsx("table", { className: "chart-data", children: _jsx("tbody", { children: points.map((p, i) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: named[i] }), _jsx("td", { children: say(p.value) })] }, i))) }) }) })] }));
284
+ }
285
+ /* A line chart's series past this many are gathered into one "others" line: more lines than that tangle. */
286
+ const MAX_LINES = 5;
287
+ /* Up to this many lines are named at their ends; more names than that stack into a column of their own. */
288
+ const DIRECT_LINES = 3;
289
+ /* Two names closer than a line of small text overlap: each is pushed apart from its neighbor, then the column is
290
+ kept inside the plot. Returned in the order the ends were given. */
291
+ export function namesAtEnds(ends, top, bottom, gap = 14) {
292
+ const order = ends.map((at, i) => ({ at, i })).sort((a, b) => a.at - b.at);
293
+ for (let k = 1; k < order.length; k++)
294
+ order[k].at = Math.max(order[k].at, order[k - 1].at + gap);
295
+ const over = order.length ? order[order.length - 1].at - bottom : 0;
296
+ if (over > 0)
297
+ for (const o of order)
298
+ o.at -= over;
299
+ for (let k = 0; k < order.length; k++)
300
+ order[k].at = Math.max(order[k].at, top + k * gap);
301
+ const out = [];
302
+ for (const o of order)
303
+ out[o.i] = o.at;
304
+ return out;
305
+ }
306
+ /**
307
+ * Several lines over one time axis, a series each: the line of a two-key
308
+ * breakdown ("month created_at, channel"). Each series keeps one theme token
309
+ * on its line, its legend dot and the hover card; the legend's picker shows
310
+ * every line or one alone. On hover a card lists every shown series at the
311
+ * point, so two lines are compared without chasing two tooltips.
312
+ */
313
+ function MultiLine({ rows, say, wide, high, target, smooth, seriesLabel, vocabulary, }) {
314
+ const svg = useRef(null);
315
+ const [near, setNear] = useState(null);
316
+ const [measured, setMeasured] = useState(0);
317
+ const [only, setOnly] = useState('');
318
+ const keys = [...new Set(rows.map((r) => (r.key == null ? '—' : String(r.key))))];
319
+ if (keys.every((key) => PERIOD.test(key)))
320
+ keys.sort();
321
+ const totals = new Map();
322
+ const named = new Map();
323
+ for (const r of rows) {
324
+ const id = r.series == null ? '—' : String(r.series);
325
+ named.set(id, r.series);
326
+ totals.set(id, (totals.get(id) ?? 0) + (Number(r.value) || 0));
327
+ }
328
+ const ranked = [...totals.keys()].sort((a, b) => totals.get(b) - totals.get(a));
329
+ const kept = ranked.length > MAX_LINES ? ranked.slice(0, MAX_LINES - 1) : ranked;
330
+ /* A vocabulary's values go in its order and keep its colors, so a source is the same color here as in a donut of
331
+ the same column; the largest still decide which lines are kept. */
332
+ const place = (id) => vocabulary?.indexOf(id) ?? -1;
333
+ if (vocabulary && kept.every((id) => place(id) >= 0))
334
+ kept.sort((a, b) => place(a) - place(b));
335
+ const OTHERS = '\u0000others';
336
+ const series = [...kept, ...(ranked.length > kept.length ? [OTHERS] : [])].map((id, i) => {
337
+ const slot = place(id) >= 0 && place(id) < 8 ? place(id) : i;
338
+ const values = keys.map(() => 0);
339
+ for (const r of rows) {
340
+ const own = r.series == null ? '—' : String(r.series);
341
+ const lane = kept.includes(own) ? own : OTHERS;
342
+ if (lane !== id)
343
+ continue;
344
+ const v = Number(r.value);
345
+ if (Number.isFinite(v))
346
+ values[keys.indexOf(r.key == null ? '—' : String(r.key))] += v;
347
+ }
348
+ return {
349
+ id,
350
+ label: id === OTHERS ? sayCopy('others', { restCount: ranked.length - kept.length }) : seriesLabel(named.get(id)),
351
+ color: `var(--chart-${slot + 1}, var(--accent))`,
352
+ values,
353
+ };
354
+ });
355
+ const shown = only && series.some((line) => line.id === only) ? series.filter((line) => line.id === only) : series;
356
+ const drawn = keys.length >= 2;
357
+ useLayoutEffect(() => {
358
+ const element = svg.current?.parentElement;
359
+ if (!element || typeof ResizeObserver === 'undefined')
360
+ return;
361
+ const measure = () => setMeasured(Math.max(0, Math.round(viewportBox(element).width)));
362
+ measure();
363
+ const observer = new ResizeObserver(measure);
364
+ observer.observe(element);
365
+ return () => observer.disconnect();
366
+ }, [drawn]);
367
+ if (!drawn)
368
+ return _jsx("p", { className: "note", children: sayCopy('notEnoughPointsToDraw') });
369
+ const W = measured > 0 ? measured : wide;
370
+ const H = high ? Math.max(120, Math.round(high)) : Math.max(120, Math.min(Math.round(W / 3), 220));
371
+ const goal = target !== undefined && Number.isFinite(target) ? target : undefined;
372
+ const all = shown.flatMap((line) => line.values);
373
+ const max = Math.max(...all, 0, goal ?? 0);
374
+ const min = Math.min(...all, 0, goal ?? 0);
375
+ const scale = niceScale(min, max, 2, say.tick?.steps);
376
+ const levels = scale.levels;
377
+ const span = scale.max - scale.min || 1;
378
+ const gutter = Math.max(...levels.map((v) => tickWidth(tickSay(say)(v)))) + 6;
379
+ /* A few lines are named where they end, not in a key above them: the eye follows a line to its name instead of
380
+ matching a color back to a list. Past three, or where the names would take more than a quarter of the width, the
381
+ legend says them. */
382
+ const nameRoom = Math.max(...shown.map((line) => tickWidth(line.label))) + 8;
383
+ const direct = shown.length <= DIRECT_LINES && nameRoom <= W / 4;
384
+ const PAD = { top: 14, right: direct ? nameRoom : 14, bottom: 24, left: gutter };
385
+ const x = (i) => PAD.left + (i * (W - PAD.left - PAD.right)) / (keys.length - 1);
386
+ const y = (v) => PAD.top + (1 - (v - scale.min) / span) * (H - PAD.top - PAD.bottom);
387
+ const ends = direct
388
+ ? namesAtEnds(shown.map((line) => y(line.values[line.values.length - 1])), PAD.top, H - PAD.bottom)
389
+ : [];
390
+ const ticks = keys.map((key) => periodTick(key));
391
+ const marks = axisMarks(keys, x);
392
+ const onMove = (e) => {
393
+ // screen-px: clientX is a screen-pixel ruler too; the ratio maps it into viewBox units.
394
+ const box = svg.current.getBoundingClientRect();
395
+ const px = ((e.clientX - box.left) / box.width) * W;
396
+ let best = 0;
397
+ for (let i = 1; i < keys.length; i++)
398
+ if (Math.abs(x(i) - px) < Math.abs(x(best) - px))
399
+ best = i;
400
+ setNear(best);
401
+ };
402
+ const cx = near === null ? 0 : x(near);
403
+ const right = cx > W * 0.6;
404
+ return (_jsxs("div", { className: "chart-multi", children: [_jsxs("div", { className: "chart-multi-head", children: [_jsx("ul", { className: "chart-legend chart-multi-legend", ...(direct ? { hidden: true } : {}), children: shown.map((line) => (_jsxs("li", { children: [_jsx("span", { className: "chart-dot-key", style: { background: line.color } }), _jsx("span", { className: "chart-legend-key", children: line.label })] }, line.id))) }), _jsxs("select", { className: "chart-series-pick", "aria-label": sayCopy('showSeries'), value: only, onChange: (event) => setOnly(event.target.value), children: [_jsx("option", { value: "", children: sayCopy('allSeries') }), series.map((line) => (_jsx("option", { value: line.id, children: line.label }, line.id)))] })] }), _jsxs("div", { className: "chart-multi-plot", children: [_jsxs("svg", { ref: svg, className: "chart-line", viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": sayCopy('linesSummary', {
405
+ count: shown.length,
406
+ points: keys.length,
407
+ names: shown.map((line) => line.label).join(', '),
408
+ }), onPointerMove: onMove, onPointerLeave: () => setNear(null), children: [levels.map((v) => (_jsx("line", { className: "chart-grid", x1: PAD.left, x2: W - PAD.right, y1: f1(y(v)), y2: f1(y(v)) }, `g${v}`))), levels.map((v) => (_jsx("text", { className: "chart-tick chart-y-tick", x: f1(PAD.left - 6), y: f1(y(v) + 4), textAnchor: "end", children: tickSay(say)(v) }, `t${v}`))), goal !== undefined && (_jsxs("g", { className: "chart-target", children: [_jsx("line", { className: "chart-target-line", x1: PAD.left, x2: W - PAD.right, y1: f1(y(goal)), y2: f1(y(goal)) }), _jsx("text", { className: "chart-target-label", x: PAD.left + 4, y: f1(y(goal) - 4), children: sayCopy('target', { goal: say(goal) }) })] })), shown.map((line) => (_jsx("path", { className: "chart-stroke chart-series-stroke", style: { stroke: line.color }, d: linePath(line.values.map((v, i) => [x(i), y(v)]), smooth) }, line.id))), direct &&
409
+ shown.map((line, i) => {
410
+ const last = line.values.length - 1;
411
+ return (_jsxs("g", { className: "chart-end", children: [_jsx("circle", { className: "chart-end-dot", style: { fill: line.color }, cx: f1(x(last)), cy: f1(y(line.values[last])), r: 3 }), _jsx("text", { className: "chart-end-name", x: f1(W - PAD.right + 8), y: f1(ends[i] + 4), children: line.label })] }, `n${line.id}`));
412
+ }), marks.map(({ index, text }) => (_jsx("text", { className: "chart-tick chart-x-tick", x: f1(x(index)), y: H - 6, textAnchor: index === 0 ? 'start' : index === keys.length - 1 ? 'end' : 'middle', children: text }, `m${index}`))), _jsxs("g", { className: "chart-cursor", ...(near === null ? { hidden: true } : {}), children: [_jsx("line", { className: "chart-cursor-line", x1: f1(cx), x2: f1(cx), y1: PAD.top, y2: H - PAD.bottom }), near !== null &&
413
+ shown.map((line) => (_jsx("circle", { className: "chart-cursor-dot", style: { fill: line.color }, cx: f1(cx), cy: f1(y(line.values[near])), r: 4 }, line.id)))] })] }), near !== null && (_jsxs("div", { className: "chart-tip-card", "aria-hidden": "true", style: right ? { right: `${((W - cx) / W) * 100}%`, marginRight: 10 } : { left: `${(cx / W) * 100}%`, marginLeft: 10 }, children: [_jsx("div", { className: "chart-tip-title", children: ticks[near] }), shown.map((line) => (_jsxs("div", { className: "chart-tip-row", children: [_jsx("span", { className: "chart-dot-key", style: { background: line.color } }), _jsx("span", { className: "chart-tip-name", children: line.label }), _jsx("span", { className: "chart-tip-value", children: say(line.values[near]) })] }, line.id)))] }))] }), _jsx("div", { className: "visually-hidden", children: _jsxs("table", { className: "chart-data", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("td", {}), shown.map((line) => (_jsx("th", { scope: "col", children: line.label }, line.id)))] }) }), _jsx("tbody", { children: keys.map((key, i) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: ticks[i] }), shown.map((line) => (_jsx("td", { children: say(line.values[i]) }, line.id)))] }, key))) })] }) })] }));
414
+ }
415
+ /** Whether a key is a period the grammar buckets by ("2026-08", "2026-Q3"). */
416
+ const PERIOD = /^\d{4}(-\d{2}(-\d{2})?|-Q[1-4])?$/;
417
+ /**
418
+ * Bars: one series, a bar per group — how much each week or each stage
419
+ * holds, where a line says how a number moved. Over calendar buckets one bar
420
+ * is the current one, drawn in the ink while the rest stay quiet: the last
421
+ * (the period in hand) until the pointer names another. Its value is said in
422
+ * a pill over it, and a guide runs from it across the levels, so the reader
423
+ * can read it off the scale without a tooltip's delay; there the pill is
424
+ * information, not a hover effect, so it is always there. Over categories (a
425
+ * stage, a source) no bar is the one in hand — the last is only last in the
426
+ * vocabulary — so at rest none is inked, with no pill and no guide, until the
427
+ * pointer names one. Nothing moves (motion rule 8).
428
+ *
429
+ * Periods keep their order and gain their missing buckets at zero, as a
430
+ * line's do; categories go in their vocabulary's order, else biggest first.
431
+ * The levels are on the left, in a gutter of their own, and every bar is a
432
+ * row of a table assistive technology reads, as a line's points are.
433
+ */
434
+ export function BarChart({ rows, say = String, label = String, wide = 600, high, target, tone, }) {
435
+ const periods = rows.length > 0 && rows.every((r) => r.key != null && PERIOD.test(String(r.key)));
436
+ const bars = periods
437
+ ? fillGaps(rows.map((r) => ({ key: String(r.key), value: Number(r.value) })).filter((p) => Number.isFinite(p.value))).map((p) => ({ raw: p.key, value: p.value }))
438
+ : rows.map((r) => ({ raw: r.key, value: Number(r.value) })).filter((p) => Number.isFinite(p.value));
439
+ const svg = useRef(null);
440
+ const [near, setNear] = useState(null);
441
+ const [measured, setMeasured] = useState(0);
442
+ useLayoutEffect(() => {
443
+ const element = svg.current?.parentElement;
444
+ if (!element || typeof ResizeObserver === 'undefined')
445
+ return;
446
+ const measure = () => setMeasured(Math.max(0, Math.round(viewportBox(element).width)));
447
+ measure();
448
+ const observer = new ResizeObserver(measure);
449
+ observer.observe(element);
450
+ return () => observer.disconnect();
451
+ }, [bars.length > 0]); // eslint-disable-line react-hooks/exhaustive-deps
452
+ if (!bars.length)
453
+ return _jsx("p", { className: "note", children: sayCopy('nothingToDraw') });
454
+ /* States are bars of the meaning they carry: where every category has a tone, each wears it (the same ink the status
455
+ dot and badge draw), shared or not, since the axis names every bar. Periods and untoned columns keep the look's hue. */
456
+ const inks = periods || !tone ? undefined : bars.map((b) => TONE_INK[tone(b.raw) ?? '']);
457
+ const toned = !!inks && inks.every(Boolean);
458
+ const named = bars.map((b, i) => (periods ? periodTick(String(b.raw), i ? String(bars[i - 1].raw) : undefined) : label(b.raw)));
459
+ const whole = bars.map((b) => (periods ? periodTick(String(b.raw)) : label(b.raw)));
460
+ const W = measured > 0 ? measured : wide;
461
+ const H = high ? Math.max(120, Math.round(high)) : Math.max(160, Math.min(Math.round(W / 3), 240));
462
+ const goal = target !== undefined && Number.isFinite(target) ? target : undefined;
463
+ const max = Math.max(...bars.map((b) => b.value), 0, goal ?? 0);
464
+ const min = Math.min(...bars.map((b) => b.value), 0);
465
+ const scale = niceScale(min, max, 2, say.tick?.steps);
466
+ const levels = scale.levels;
467
+ const span = scale.max - scale.min || 1;
468
+ const gutter = Math.max(...levels.map((v) => tickWidth(tickSay(say)(v)))) + 6;
469
+ /* Room over the tallest bar for the pill that names it. */
470
+ const PAD = { top: 30, right: 6, bottom: 24, left: gutter };
471
+ const band = (W - PAD.left - PAD.right) / bars.length;
472
+ const barWide = Math.max(2, Math.min(56, band * 0.64));
473
+ const x = (i) => PAD.left + band * i + (band - barWide) / 2;
474
+ const mid = (i) => PAD.left + band * (i + 0.5);
475
+ const y = (v) => PAD.top + (1 - (v - scale.min) / span) * (H - PAD.top - PAD.bottom);
476
+ const base = y(Math.max(scale.min, 0));
477
+ const marks = axisMarks(named.map((text, i) => (periods ? String(bars[i].raw) : text)), mid, { centered: true });
478
+ /* A mark is centred under its bar, and kept inside the figure at either end. */
479
+ const markAt = (index, text) => Math.min(Math.max(mid(index), tickWidth(text) / 2), W - tickWidth(text) / 2);
480
+ const active = near ?? (periods ? bars.length - 1 : null);
481
+ const tip = active === null ? '' : `${whole[active]} · ${say(bars[active].value)}`;
482
+ const tipWide = tickWidth(tip) + 12;
483
+ const tipLeft = active === null ? 0 : Math.min(Math.max(mid(active) - tipWide / 2, PAD.left), W - PAD.right - tipWide);
484
+ const top = active === null ? 0 : y(Math.max(bars[active].value, 0));
485
+ const tipTop = Math.max(2, top - 26);
486
+ const at = (e) => {
487
+ // screen-px: clientX is a screen-pixel ruler too; the ratio maps it into viewBox units.
488
+ const box = svg.current.getBoundingClientRect();
489
+ if (!box.width)
490
+ return bars.length - 1;
491
+ const px = ((e.clientX - box.left) / box.width) * W;
492
+ return Math.min(bars.length - 1, Math.max(0, Math.floor((px - PAD.left) / band)));
493
+ };
494
+ return (_jsxs(_Fragment, { children: [_jsxs("svg", { ref: svg, className: "chart-bars", viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": `${sayCopy('barsSummary', { count: bars.length, highest: say(Math.max(...bars.map((b) => b.value))), last: whole[bars.length - 1], value: say(bars[bars.length - 1].value) })}${goal === undefined ? '' : sayCopy('targetAfter', { goal: say(goal) })}`, onPointerMove: (e) => setNear(at(e)), onPointerLeave: () => setNear(null), children: [levels.map((v) => (_jsx("line", { className: "chart-grid", x1: PAD.left, x2: W - PAD.right, y1: f1(y(v)), y2: f1(y(v)) }, `g${v}`))), levels.map((v) => (_jsx("text", { className: "chart-tick chart-y-tick", x: f1(PAD.left - 6), y: f1(y(v) + 4), textAnchor: "end", children: tickSay(say)(v) }, `t${v}`))), active !== null && _jsx("line", { className: "chart-bar-guide", x1: PAD.left, x2: W - PAD.right, y1: f1(top), y2: f1(top) }), bars.map((b, i) => {
495
+ const h = Math.abs(y(b.value) - base);
496
+ return (_jsx("rect", { className: `chart-bar${toned ? ' is-toned' : ''}${i === active ? ' is-active' : ''}`, style: toned ? { ['--bar-ink']: inks[i] } : undefined, x: f1(x(i)), y: f1(Math.min(y(b.value), base)), width: f1(barWide), height: f1(Math.max(h, b.value ? 1 : 0)), children: _jsx("title", { children: `${whole[i]}: ${say(b.value)}` }) }, i));
497
+ }), goal !== undefined && (_jsxs("g", { className: "chart-target", children: [_jsx("line", { className: "chart-target-line", x1: PAD.left, x2: W - PAD.right, y1: f1(y(goal)), y2: f1(y(goal)) }), _jsx("text", { className: "chart-target-label", x: PAD.left + 4, y: f1(y(goal) - 4), children: sayCopy('target', { goal: say(goal) }) })] })), marks.map(({ index, text }) => (_jsx("text", { className: `chart-tick chart-x-tick${index === active ? ' is-active' : ''}`, x: f1(markAt(index, periods ? text : named[index])), y: H - 6, textAnchor: "middle", children: periods ? text : named[index] }, `m${index}`))), active !== null && (_jsxs("g", { className: "chart-bar-tip", "aria-hidden": "true", children: [_jsx("rect", { x: f1(tipLeft), y: f1(tipTop), width: f1(tipWide), height: 20 }), _jsx("text", { x: f1(tipLeft + tipWide / 2), y: f1(tipTop + 14), textAnchor: "middle", children: tip })] }))] }), _jsx("div", { className: "visually-hidden", children: _jsx("table", { className: "chart-data", children: _jsx("tbody", { children: bars.map((b, i) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: whole[i] }), _jsx("td", { children: say(b.value) })] }, i))) }) }) })] }));
498
+ }
499
+ /**
500
+ * Stacked columns: a column per period, divided by series — how much each day
501
+ * held and what it was made of. The bars' grammar (Bars, above): levels on the
502
+ * left in their own gutter, periods along the bottom with their empty buckets
503
+ * at zero, and one current column whose total and parts are said in a pill
504
+ * over it, with a guide across the levels; the last until the pointer names
505
+ * another. While the pointer is over the chart the pill rides with it, just
506
+ * above it, so it never sits over the column being read. Each series keeps one theme token in every column and in the
507
+ * legend, which says each series' total. Every column is also a row of a
508
+ * table assistive technology reads. Nothing moves (motion rule 8).
509
+ */
510
+ export function StackedColumns({ rows, series, say = String, wide = 600, high, }) {
511
+ const columns = rows
512
+ .map((r) => ({ key: r.key, parts: series.map((s) => Math.max(0, Number(r.values[s.key]) || 0)) }))
513
+ .map((c) => ({ ...c, total: c.parts.reduce((n, v) => n + v, 0) }));
514
+ const svg = useRef(null);
515
+ const [near, setNear] = useState(null);
516
+ const [pointer, setPointer] = useState(null);
517
+ const [measured, setMeasured] = useState(0);
518
+ useLayoutEffect(() => {
519
+ const element = svg.current?.parentElement;
520
+ if (!element || typeof ResizeObserver === 'undefined')
521
+ return;
522
+ const measure = () => setMeasured(Math.max(0, Math.round(viewportBox(element).width)));
523
+ measure();
524
+ const observer = new ResizeObserver(measure);
525
+ observer.observe(element);
526
+ return () => observer.disconnect();
527
+ }, [columns.length > 0]); // eslint-disable-line react-hooks/exhaustive-deps
528
+ if (!columns.length)
529
+ return _jsx("p", { className: "note", children: sayCopy('nothingToDraw') });
530
+ const periods = columns.every((c) => PERIOD.test(c.key));
531
+ const named = columns.map((c) => (periods ? periodTick(c.key) : c.key));
532
+ const W = measured > 0 ? measured : wide;
533
+ const H = high ? Math.max(120, Math.round(high)) : Math.max(160, Math.min(Math.round(W / 3.5), 220));
534
+ const max = Math.max(...columns.map((c) => c.total), 1);
535
+ const scale = niceScale(0, max, 2, say.tick?.steps);
536
+ const levels = scale.levels;
537
+ const gutter = Math.max(...levels.map((v) => tickWidth(tickSay(say)(v)))) + 6;
538
+ const PAD = { top: 30, right: 6, bottom: 24, left: gutter };
539
+ const band = (W - PAD.left - PAD.right) / columns.length;
540
+ const colWide = Math.max(2, Math.min(40, band * 0.64));
541
+ const x = (i) => PAD.left + band * i + (band - colWide) / 2;
542
+ const mid = (i) => PAD.left + band * (i + 0.5);
543
+ const y = (v) => PAD.top + (1 - v / scale.max) * (H - PAD.top - PAD.bottom);
544
+ const marks = periods
545
+ ? axisMarks(columns.map((c) => c.key), mid, { centered: true })
546
+ : columns.map((c, index) => ({ index, text: c.key }));
547
+ const markAt = (index, text) => Math.min(Math.max(mid(index), tickWidth(text) / 2), W - tickWidth(text) / 2);
548
+ const active = near ?? columns.length - 1;
549
+ const parts = (i) => series.map((s, k) => `${s.label} ${say(columns[i].parts[k])}`).join(' · ');
550
+ const tip = `${named[active]} · ${parts(active)}`;
551
+ const tipWide = tickWidth(tip) + 12;
552
+ const tipLeft = Math.min(Math.max((pointer?.x ?? mid(active)) - tipWide / 2, PAD.left), W - PAD.right - tipWide);
553
+ const top = y(columns[active].total);
554
+ const tipTop = pointer ? Math.min(Math.max(2, pointer.y - 30), H - PAD.bottom - 22) : Math.max(2, top - 26);
555
+ const color = (k) => `var(--chart-${k + 1}, var(--accent))`;
556
+ const at = (e) => {
557
+ // screen-px: clientX is a screen-pixel ruler too; the ratio maps it into viewBox units.
558
+ const box = svg.current.getBoundingClientRect();
559
+ if (!box.width || !box.height)
560
+ return;
561
+ const px = ((e.clientX - box.left) / box.width) * W;
562
+ setPointer({ x: px, y: ((e.clientY - box.top) / box.height) * H });
563
+ setNear(Math.min(columns.length - 1, Math.max(0, Math.floor((px - PAD.left) / band))));
564
+ };
565
+ const totals = series.map((_, k) => columns.reduce((n, c) => n + c.parts[k], 0));
566
+ return (_jsxs("div", { className: "chart-columns", children: [_jsxs("svg", { ref: svg, className: "chart-bars", viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": sayCopy('barsSummary', {
567
+ count: columns.length,
568
+ highest: say(max),
569
+ last: named[columns.length - 1],
570
+ value: say(columns[columns.length - 1].total),
571
+ }), onPointerMove: at, onPointerLeave: () => {
572
+ setNear(null);
573
+ setPointer(null);
574
+ }, children: [levels.map((v) => (_jsx("line", { className: "chart-grid", x1: PAD.left, x2: W - PAD.right, y1: f1(y(v)), y2: f1(y(v)) }, `g${v}`))), levels.map((v) => (_jsx("text", { className: "chart-tick chart-y-tick", x: f1(PAD.left - 6), y: f1(y(v) + 4), textAnchor: "end", children: tickSay(say)(v) }, `t${v}`))), _jsx("line", { className: "chart-bar-guide", x1: PAD.left, x2: W - PAD.right, y1: f1(top), y2: f1(top) }), columns.map((c, i) => {
575
+ let base = 0;
576
+ return (_jsxs("g", { className: `chart-column${i === active ? ' is-active' : ''}`, children: [_jsx("title", { children: `${named[i]}: ${parts(i)}` }), c.parts.map((v, k) => {
577
+ const from = base;
578
+ base += v;
579
+ if (!v)
580
+ return null;
581
+ return (_jsx("rect", { className: "chart-column-part", x: f1(x(i)), y: f1(y(base)), width: f1(colWide), height: f1(Math.max(1, y(from) - y(base))), style: { fill: color(k) } }, k));
582
+ })] }, c.key));
583
+ }), marks.map(({ index, text }) => (_jsx("text", { className: `chart-tick chart-x-tick${index === active ? ' is-active' : ''}`, x: f1(markAt(index, text)), y: H - 6, textAnchor: "middle", children: text }, `m${index}`))), _jsxs("g", { className: "chart-bar-tip", "aria-hidden": "true", children: [_jsx("rect", { x: f1(tipLeft), y: f1(tipTop), width: f1(tipWide), height: 20 }), _jsx("text", { x: f1(tipLeft + tipWide / 2), y: f1(tipTop + 14), textAnchor: "middle", children: tip })] })] }), _jsx("ul", { className: "chart-legend chart-columns-legend", children: series.map((s, k) => (_jsxs("li", { children: [_jsx("span", { className: "chart-swatch", style: { background: color(k) } }), _jsx("span", { className: "chart-legend-key", children: s.label }), _jsx("span", { className: "chart-legend-value", children: say(totals[k]) })] }, s.key))) }), _jsx("div", { className: "visually-hidden", children: _jsx("table", { className: "chart-data", children: _jsx("tbody", { children: columns.map((c, i) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: named[i] }), _jsx("td", { children: parts(i) })] }, c.key))) }) }) })] }));
584
+ }
585
+ /**
586
+ * The house ring round a donut's slice (design.md, Access): a shape takes no outline, so the ring is the outline of
587
+ * the slice's own arc, `from` and `length` in hundredths of the circle from 3 o'clock, drawn 2px off its stroke, `width`
588
+ * units wide as the look draws it (7, Lumen's line charts 4.5; the donut is 120px over 42 units; the ring's own 2px is a
589
+ * non-scaling stroke). A widened stroke was the ring once: the drawing's edge cut it, and on a pale slice it could not
590
+ * be told from the slice. Drawn off a 7-unit stroke round a 4.5-unit one, it stood 6px off the slice.
591
+ */
592
+ export function sliceRing(center, radius, from, length, width = 7) {
593
+ const off = width / 2 + 1.05;
594
+ const outer = radius + off;
595
+ const inner = radius - off;
596
+ const past = (100 * (1.05 / radius)) / (2 * Math.PI);
597
+ const n = (value) => Number(value.toFixed(3));
598
+ const point = (r, at) => {
599
+ const angle = (2 * Math.PI * at) / 100;
600
+ return `${n(center + r * Math.cos(angle))} ${n(center + r * Math.sin(angle))}`;
601
+ };
602
+ const circle = (r) => `M ${n(center + r)} ${center} A ${n(r)} ${n(r)} 0 1 1 ${n(center - r)} ${center} A ${n(r)} ${n(r)} 0 1 1 ${n(center + r)} ${center} Z`;
603
+ /* A slice that is (nearly) the whole circle has no ends: its ring is two circles. */
604
+ if (length + 2 * past >= 100)
605
+ return `${circle(outer)} ${circle(inner)}`;
606
+ const start = from - past;
607
+ const end = from + length + past;
608
+ const large = end - start > 50 ? 1 : 0;
609
+ return `M ${point(outer, start)} A ${n(outer)} ${n(outer)} 0 ${large} 1 ${point(outer, end)} L ${point(inner, end)} A ${n(inner)} ${n(inner)} 0 ${large} 0 ${point(inner, start)} Z`;
610
+ }
611
+ /**
612
+ * A donut with its legend: how the whole divides, said twice — arc length
613
+ * and a labelled figure. Past six slices the tail is gathered into "others".
614
+ */
615
+ export function DonutChart({ rows, say = String, label = String, onPick, total, ordered, tone, }) {
616
+ /* The slice's stroke as the look draws it (.chart-slice: 7 units, 4.5 in Lumen's line charts), read as a slice takes
617
+ the keyboard, the moment its ring is drawn: a look is picked while the page is open, and a stylesheet says it. */
618
+ const [sliceWidth, setSliceWidth] = useState(7);
619
+ const all = rows
620
+ .map((r) => ({ key: r.key == null ? '—' : label(r.key), raw: r.key, value: Number(r.value) }))
621
+ .filter((p) => Number.isFinite(p.value) && p.value > 0);
622
+ if (!all.length)
623
+ return _jsx("p", { className: "note", children: sayCopy('nothingToDivide') });
624
+ const MAX_SLICES = 6;
625
+ const slices = all.slice(0, MAX_SLICES);
626
+ const rest = all.slice(MAX_SLICES);
627
+ if (rest.length)
628
+ slices.push({ key: `others (${rest.length})`, value: rest.reduce((n, p) => n + p.value, 0) });
629
+ const whole = slices.reduce((n, p) => n + p.value, 0);
630
+ const R = 15.9155; /* circumference 100, so dasharray speaks percent. */
631
+ const C = 21;
632
+ /* A step of the ramp rides in a property of its own, which the slice and its swatch both paint with. */
633
+ /* A legend that names two slices in one ink says nothing, so slices wear their tones only where each is distinct. */
634
+ const inks = ordered || rest.length || !tone ? undefined : slices.map((p) => TONE_INK[tone(p.raw) ?? '']);
635
+ const toned = !!inks && inks.every(Boolean) && new Set(inks).size === inks.length;
636
+ const color = (i) => (ordered ? 'var(--ramp)' : toned ? inks[i] : `var(--chart-${i + 1}, var(--accent))`);
637
+ const ramp = (i) => (ordered ? { ['--ramp']: rampInk(i, slices.length) } : {});
638
+ const opacity = (i) => ordered || toned ? '1' : `var(--chart-series-opacity, ${(1 - i * (0.75 / Math.max(slices.length - 1, 1))).toFixed(2)})`;
639
+ let at = 25; /* Start at 12 o'clock: dasharray's zero is 3 o'clock. */
640
+ /* A hairline of the ground between slices, so neighbours of one hue read as two; a slice too thin to spare it keeps
641
+ its whole arc. One slice is a ring, with nothing to part. */
642
+ const GAP = slices.length > 1 ? 0.8 : 0;
643
+ const rings = slices.map((p, i) => {
644
+ const share = (100 * p.value) / whole;
645
+ const drawn = share > GAP * 2 ? share - GAP : share;
646
+ /* A slice is a door where the legend's button is: the same raw value,
647
+ the same "others" exclusion. A circle is not a button by itself, so
648
+ a drillable slice carries the button's role, name and keyboard
649
+ behaviour, and the legend button stays as the second way in. */
650
+ const drillable = onPick && p.raw != null && !(rest.length && i === slices.length - 1);
651
+ const said = `${p.key}: ${say(p.value)} (${formatPercent(share, { maximumFractionDigits: 0 })})`;
652
+ const arc = (_jsx("circle", { className: `chart-slice${drillable ? ' chart-slice-drill' : ''}`, cx: C, cy: C, r: R, strokeDasharray: `${drawn.toFixed(2)} ${(100 - drawn).toFixed(2)}`, strokeDashoffset: at.toFixed(2), style: { ...ramp(i), stroke: color(i), opacity: opacity(i) }, children: !drillable && _jsx("title", { children: said }) }, i));
653
+ /* The door is the slice and its ring together: the ring is drawn (and read by grade) only while the door holds the
654
+ keyboard's focus. The dash starts at -offset along a path that begins at 3 o'clock. */
655
+ const door = drillable ? (_jsxs("g", { className: "chart-slice-door", role: "button", tabIndex: 0, "aria-label": said, onClick: () => onPick(p.raw), onFocus: (event) => {
656
+ const slice = event.currentTarget.querySelector('.chart-slice');
657
+ const width = slice ? parseFloat(getComputedStyle(slice).strokeWidth) : NaN;
658
+ if (width > 0 && width !== sliceWidth)
659
+ setSliceWidth(width);
660
+ }, onKeyDown: (event) => {
661
+ if (event.key === 'Enter' || event.key === ' ') {
662
+ event.preventDefault();
663
+ onPick(p.raw);
664
+ }
665
+ }, children: [_jsx("title", { children: said }), arc, _jsx("path", { className: "chart-slice-ring", "data-focus-ring": "", d: sliceRing(C, R, -at, drawn, sliceWidth) })] }, i)) : (arc);
666
+ at -= share;
667
+ return door;
668
+ });
669
+ /* A picture must not hold buttons: where any slice drills, the figure
670
+ is a group holding buttons, not an image — axe's nested-interactive
671
+ fails a button inside role="img", and a screen reader would meet the
672
+ slices as the picture's unnamed parts. Where nothing drills it stays
673
+ an image, as before. */
674
+ const anyDrillable = onPick && slices.some((p, i) => p.raw != null && !(rest.length && i === slices.length - 1));
675
+ return (_jsxs("div", { className: `chart-donut-wrap${ordered ? ' is-ordered' : ''}`, children: [_jsxs("svg", { className: "chart-donut", viewBox: `0 0 ${C * 2} ${C * 2}`, role: anyDrillable ? 'group' : 'img', "aria-label": sayCopy('inAll', { whole: say(whole), map: slices.map((p) => `${p.key} ${say(p.value)}`).join(', ') }), children: [rings, _jsx("text", { className: "chart-donut-total", x: C, y: total ? C : C + 1.5, textAnchor: "middle", children: say(whole) }), total && (_jsx("text", { className: "chart-donut-caption", x: C, y: C + 4.5, textAnchor: "middle", children: total }))] }), _jsx("ul", { className: "chart-legend", children: slices.map((p, i) => {
676
+ const parts = (_jsxs(_Fragment, { children: [_jsx("span", { className: "chart-swatch", style: { ...ramp(i), background: color(i), opacity: opacity(i) } }), _jsx("span", { className: "chart-legend-key", children: p.key }), _jsx("span", { className: "chart-legend-value", children: say(p.value) }), _jsx("span", { className: "chart-legend-share", children: formatPercent((100 * p.value) / whole, { maximumFractionDigits: 0 }) })] }));
677
+ const drillable = onPick && p.raw != null && !(rest.length && i === slices.length - 1);
678
+ return (_jsx("li", { children: drillable ? (_jsx("button", { type: "button", className: "chart-legend-drill", onClick: () => onPick(p.raw), children: parts })) : (parts) }, i));
679
+ }) })] }));
680
+ }
681
+ /** A display tone as the ink it is drawn in (the status tokens, so a look's and a dark mode's own are worn). */
682
+ export const TONE_INK = {
683
+ good: 'var(--status-good)',
684
+ warn: 'var(--status-warning)',
685
+ bad: 'var(--status-critical)',
686
+ info: 'var(--status-info)',
687
+ neutral: 'var(--ink-subtle)',
688
+ };
689
+ /**
690
+ * Stacked bars: each group of the first key a bar, divided by the second —
691
+ * how each of several wholes divides, where a donut says how one does. The
692
+ * bars share one scale (the longest total, or the target when it is past
693
+ * it), each series keeps one theme token in every bar and in the legend,
694
+ * and past seven series the tail is gathered into "others", the eighth
695
+ * token. A target is a rule across every track and a word in the legend.
696
+ */
697
+ export function StackedBars({ rows, say = String, label = String, seriesLabel = String, target, limit = 10, onPick, seriesVocabulary, seriesOrdered, seriesTone, sayLegend, }) {
698
+ const MAX_SERIES = 7;
699
+ const name = (v) => (v == null ? '—' : String(v));
700
+ const bars = new Map();
701
+ const seriesTotals = new Map();
702
+ for (const row of rows) {
703
+ const value = Number(row.value);
704
+ if (!Number.isFinite(value) || value <= 0)
705
+ continue;
706
+ const bar = bars.get(name(row.key)) ?? { raw: row.key, total: 0, parts: new Map() };
707
+ bar.total += value;
708
+ bar.parts.set(name(row.series), (bar.parts.get(name(row.series)) ?? 0) + value);
709
+ bars.set(name(row.key), bar);
710
+ const series = seriesTotals.get(name(row.series)) ?? { raw: row.series, total: 0 };
711
+ series.total += value;
712
+ seriesTotals.set(name(row.series), series);
713
+ }
714
+ if (!bars.size)
715
+ return _jsx("p", { className: "note", children: sayCopy('nothingToStack') });
716
+ const ranked = [...seriesTotals.entries()].sort((a, b) => b[1].total - a[1].total);
717
+ /* The largest series are kept; where the second key declares an order, they stand in it — Urgent to Planning, a
718
+ week to a month — rather than by their totals. */
719
+ const rank = new Map((seriesVocabulary ?? []).map((word, at) => [word, at]));
720
+ const place = (key) => rank.get(key) ?? Number.POSITIVE_INFINITY;
721
+ const step = (a, b) => {
722
+ const x = Number(a), y = Number(b);
723
+ return Number.isFinite(x) && Number.isFinite(y) ? x - y : a < b ? -1 : a > b ? 1 : 0;
724
+ };
725
+ const declared = rank.size > 0 || seriesOrdered;
726
+ const kept = ranked
727
+ .slice(0, MAX_SERIES)
728
+ .sort(([a, x], [b, y]) => (declared ? place(a) - place(b) || (seriesOrdered ? step(a, b) : 0) : 0) || y.total - x.total)
729
+ .map(([key, s]) => ({ key, label: seriesLabel(s.raw), total: s.total }));
730
+ const rest = ranked.slice(MAX_SERIES);
731
+ const series = rest.length
732
+ ? [...kept, { key: 'others', label: sayCopy('others', { restCount: rest.length }), total: rest.reduce((n, [, s]) => n + s.total, 0) }]
733
+ : kept;
734
+ const slot = (key) => {
735
+ const at = kept.findIndex((s) => s.key === key);
736
+ return at === -1 ? series.length - 1 : at;
737
+ };
738
+ /* Colour that means something where the column says what each value is; the palette's series colours, which are
739
+ only distinct, stay for categories with no such tone. */
740
+ const tones = seriesOrdered || rest.length ? undefined : series.map((s) => TONE_INK[seriesTone?.(s.key) ?? '']);
741
+ const toned = !!tones && tones.every(Boolean) && new Set(tones).size === tones.length;
742
+ const color = (i) => (seriesOrdered ? 'var(--ramp)' : toned ? tones[i] : `var(--chart-${i + 1}, var(--accent))`);
743
+ const ramp = (i) => (seriesOrdered ? { ['--ramp']: rampInk(i, series.length) } : {});
744
+ const opacity = (i) => seriesOrdered || toned ? '1' : `var(--chart-series-opacity, ${(1 - i * (0.75 / Math.max(series.length - 1, 1))).toFixed(2)})`;
745
+ /* Bars over periods stand in time order, the latest `limit` of them, as a
746
+ bar chart's do; ranking them by total put Sep 10 over Aug 27 over Sep 14. */
747
+ const timed = isPeriodRun([...bars.values()].map((bar) => bar.raw));
748
+ const shown = timed
749
+ ? [...bars.values()].sort((a, b) => (String(a.raw) < String(b.raw) ? -1 : 1)).slice(-limit)
750
+ : [...bars.values()].sort((a, b) => b.total - a.total).slice(0, limit);
751
+ const barLabel = (bar, i) => timed ? periodTick(String(bar.raw), i ? String(shown[i - 1].raw) : undefined) : label(bar.raw);
752
+ const goal = target !== undefined && Number.isFinite(target) && target > 0 ? target : undefined;
753
+ const scale = Math.max(...shown.map((bar) => bar.total), goal ?? 0);
754
+ const share = (v) => `${((100 * v) / scale).toFixed(2)}%`;
755
+ const sayTotal = sayLegend
756
+ ? sayLegend([...series.map((s) => s.total), ...shown.map((bar) => bar.total), ...(goal === undefined ? [] : [goal])])
757
+ : say;
758
+ return (_jsxs("div", { className: "chart-stacked", children: [_jsxs("ul", { className: "chart-legend chart-stacked-legend", children: [series.map((s, i) => (_jsxs("li", { children: [_jsx("span", { className: "chart-swatch", style: { ...ramp(i), background: color(i), opacity: opacity(i) } }), _jsx("span", { className: "chart-legend-key", children: s.label }), _jsx("span", { className: "chart-legend-value", children: sayTotal(s.total) })] }, s.key))), goal !== undefined && (_jsxs("li", { className: "chart-stacked-goal", children: [_jsx("span", { className: "chart-target-swatch", "aria-hidden": "true" }), _jsx("span", { className: "chart-legend-key", children: sayCopy('targetLabel') }), _jsx("span", { className: "chart-legend-value", children: sayTotal(goal) })] }))] }), _jsx("ul", { className: "chart-stacked-rows", "aria-label": `${sayCopy('barsBySeries', { count: shown.length, series: series.map((s) => s.label).join(', ') })}${goal === undefined ? '' : sayCopy('targetAfter', { goal: say(goal) })}`, children: shown.map((bar, at) => {
759
+ /* Each series in legend order, so a colour sits in the same place in every bar. */
760
+ const parts = series
761
+ .map((s, i) => ({
762
+ s,
763
+ i,
764
+ value: s.key === 'others'
765
+ ? [...bar.parts.entries()]
766
+ .filter(([key]) => slot(key) === series.length - 1 && !kept.some((k) => k.key === key))
767
+ .reduce((n, [, v]) => n + v, 0)
768
+ : (bar.parts.get(s.key) ?? 0),
769
+ }))
770
+ .filter((part) => part.value > 0);
771
+ const words = (_jsxs(_Fragment, { children: [_jsx("span", { className: "chart-stacked-label", children: barLabel(bar, at) }), _jsxs("span", { className: "chart-stacked-track", children: [_jsx("span", { className: "chart-stacked-fill", style: { width: share(bar.total) }, children: parts.map(({ s, i, value }) => (_jsx("span", { className: "chart-stacked-part", title: `${s.label}: ${say(value)}`, style: { ...ramp(i), flexGrow: value, background: color(i), opacity: opacity(i) } }, s.key))) }), goal !== undefined && _jsx("span", { className: "chart-stacked-target", style: { left: share(goal) }, "aria-hidden": "true" })] }), _jsx("span", { className: "chart-stacked-total", children: sayTotal(bar.total) }), _jsx("span", { className: "visually-hidden", children: `: ${parts.map(({ s, value }) => `${s.label} ${say(value)}`).join(', ')}` })] }));
772
+ /* A bar that goes somewhere is a button; a null group, or no drill, stays text. */
773
+ return (_jsx("li", { children: onPick && bar.raw != null ? (_jsx("button", { type: "button", className: "chart-stacked-row chart-stacked-drill", onClick: () => onPick(bar.raw), children: words })) : (_jsx("div", { className: "chart-stacked-row", children: words })) }, name(bar.raw)));
774
+ }) })] }));
775
+ }
776
+ /**
777
+ * A spark: the measure's shape inside a KPI card. No axes; the card's own
778
+ * number is the label. It spans the card's width, stretched rather than
779
+ * scaled, so a wide card draws a long trend instead of a 110px stub in its
780
+ * corner; the stroke and the last point's dot keep their own size however
781
+ * far it stretches (`non-scaling-stroke`, and the dot is a round cap on a
782
+ * zero-length stroke). Under four points there is no shape to read, so
783
+ * there is no spark.
784
+ */
785
+ export function Sparkline({ rows, say = String }) {
786
+ const points = rows
787
+ .map((r) => ({ key: r.key == null ? '' : String(r.key), value: Number(r.value) }))
788
+ .filter((p) => Number.isFinite(p.value));
789
+ if (points.length < 4)
790
+ return null;
791
+ const W = 100;
792
+ const H = 28;
793
+ const max = Math.max(...points.map((p) => p.value), 0);
794
+ const min = Math.min(...points.map((p) => p.value), 0);
795
+ const span = max - min || 1;
796
+ const x = (i) => 1 + (i * (W - 2)) / (points.length - 1);
797
+ const y = (v) => 3 + (1 - (v - min) / span) * (H - 6);
798
+ const d = points.map((p, i) => `${i ? 'L' : 'M'}${f1(x(i))},${f1(y(p.value))}`).join(' ');
799
+ const last = points[points.length - 1];
800
+ return (_jsxs("svg", { className: "spark", viewBox: `0 0 ${W} ${H}`, preserveAspectRatio: "none", role: "img", "aria-label": `trend: ${points.map((p) => say(p.value)).join(', ')}`, children: [_jsx("title", { children: `${points[0].key} → ${last.key}` }), _jsx("path", { className: "spark-area", d: `${d} L${f1(x(points.length - 1))},${H} L${f1(x(0))},${H} Z` }), _jsx("path", { className: "spark-stroke", d: d, vectorEffect: "non-scaling-stroke" }), _jsx("path", { className: "spark-dot", d: `M${f1(x(points.length - 1))},${f1(y(last.value))} h0`, vectorEffect: "non-scaling-stroke" })] }));
801
+ }