@e-llm-studio/federated-dashboard-components 2.2.12 → 2.2.13-rca-alpha-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/README.md +3 -0
  2. package/dist/ExecutiveDashboard/ExecutiveDashboardWrapper.js +1 -1
  3. package/dist/ExecutiveDashboard/api/dashboardApi.js +1 -1
  4. package/dist/ExecutiveDashboard/api/insightsApi.js +2 -0
  5. package/dist/ExecutiveDashboard/api/insightsApi.js.map +1 -0
  6. package/dist/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.js +1 -1
  7. package/dist/ExecutiveDashboard/components/DashboardDateFilter/QuarterPicker.js +2 -0
  8. package/dist/ExecutiveDashboard/components/DashboardDateFilter/QuarterPicker.js.map +1 -0
  9. package/dist/ExecutiveDashboard/components/DashboardDateFilter/datePreset.js +1 -1
  10. package/dist/ExecutiveDashboard/components/DashboardDateFilter/dateRanges.js +2 -0
  11. package/dist/ExecutiveDashboard/components/DashboardDateFilter/dateRanges.js.map +1 -0
  12. package/dist/ExecutiveDashboard/components/DashboardGrid/buildDashboardWidgets.js +1 -1
  13. package/dist/ExecutiveDashboard/components/DashboardGrid/kpiCollapse.js +2 -0
  14. package/dist/ExecutiveDashboard/components/DashboardGrid/kpiCollapse.js.map +1 -0
  15. package/dist/ExecutiveDashboard/components/DashboardHeader/DashboardHeader.js +2 -0
  16. package/dist/ExecutiveDashboard/components/DashboardHeader/DashboardHeader.js.map +1 -0
  17. package/dist/ExecutiveDashboard/components/DataAccess/DataAccessMessage.js +2 -0
  18. package/dist/ExecutiveDashboard/components/DataAccess/DataAccessMessage.js.map +1 -0
  19. package/dist/ExecutiveDashboard/components/DataAccess/DataAccessScopeChip.js +2 -0
  20. package/dist/ExecutiveDashboard/components/DataAccess/DataAccessScopeChip.js.map +1 -0
  21. package/dist/ExecutiveDashboard/components/ExecutiveDashboard.js +1 -1
  22. package/dist/ExecutiveDashboard/components/FiltersSidebar/FiltersSidebar.js +1 -1
  23. package/dist/ExecutiveDashboard/components/Graph/Graph.js +1 -1
  24. package/dist/ExecutiveDashboard/components/Graph/LineChart.js +1 -1
  25. package/dist/ExecutiveDashboard/components/Graph/axisDomain.js +2 -0
  26. package/dist/ExecutiveDashboard/components/Graph/axisDomain.js.map +1 -0
  27. package/dist/ExecutiveDashboard/components/Graph/inlineLabels.js +2 -0
  28. package/dist/ExecutiveDashboard/components/Graph/inlineLabels.js.map +1 -0
  29. package/dist/ExecutiveDashboard/components/Insights/AgCharts.js +2 -0
  30. package/dist/ExecutiveDashboard/components/Insights/AgCharts.js.map +1 -0
  31. package/dist/ExecutiveDashboard/components/Insights/AgReport.js +2 -0
  32. package/dist/ExecutiveDashboard/components/Insights/AgReport.js.map +1 -0
  33. package/dist/ExecutiveDashboard/components/Insights/CommentsThread.js +2 -0
  34. package/dist/ExecutiveDashboard/components/Insights/CommentsThread.js.map +1 -0
  35. package/dist/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.js +2 -0
  36. package/dist/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.js.map +1 -0
  37. package/dist/ExecutiveDashboard/components/Insights/DrillLevel.js +2 -0
  38. package/dist/ExecutiveDashboard/components/Insights/DrillLevel.js.map +1 -0
  39. package/dist/ExecutiveDashboard/components/Insights/DrillTable.js +2 -0
  40. package/dist/ExecutiveDashboard/components/Insights/DrillTable.js.map +1 -0
  41. package/dist/ExecutiveDashboard/components/Insights/DriverActivity.js +2 -0
  42. package/dist/ExecutiveDashboard/components/Insights/DriverActivity.js.map +1 -0
  43. package/dist/ExecutiveDashboard/components/Insights/FilterNotice.js +2 -0
  44. package/dist/ExecutiveDashboard/components/Insights/FilterNotice.js.map +1 -0
  45. package/dist/ExecutiveDashboard/components/Insights/InsightTabs.js +2 -0
  46. package/dist/ExecutiveDashboard/components/Insights/InsightTabs.js.map +1 -0
  47. package/dist/ExecutiveDashboard/components/Insights/InsightsContext.js +2 -0
  48. package/dist/ExecutiveDashboard/components/Insights/InsightsContext.js.map +1 -0
  49. package/dist/ExecutiveDashboard/components/Insights/KpiChart.js +2 -0
  50. package/dist/ExecutiveDashboard/components/Insights/KpiChart.js.map +1 -0
  51. package/dist/ExecutiveDashboard/components/Insights/L1Report.js +2 -0
  52. package/dist/ExecutiveDashboard/components/Insights/L1Report.js.map +1 -0
  53. package/dist/ExecutiveDashboard/components/Insights/NeedsAttention.js +2 -0
  54. package/dist/ExecutiveDashboard/components/Insights/NeedsAttention.js.map +1 -0
  55. package/dist/ExecutiveDashboard/components/Insights/ReportDrawer.js +2 -0
  56. package/dist/ExecutiveDashboard/components/Insights/ReportDrawer.js.map +1 -0
  57. package/dist/ExecutiveDashboard/components/Insights/RowDetail.js +2 -0
  58. package/dist/ExecutiveDashboard/components/Insights/RowDetail.js.map +1 -0
  59. package/dist/ExecutiveDashboard/components/Insights/agPrimitives.js +2 -0
  60. package/dist/ExecutiveDashboard/components/Insights/agPrimitives.js.map +1 -0
  61. package/dist/ExecutiveDashboard/components/Insights/drillDay.js +2 -0
  62. package/dist/ExecutiveDashboard/components/Insights/drillDay.js.map +1 -0
  63. package/dist/ExecutiveDashboard/components/Insights/insightsContextCore.js +2 -0
  64. package/dist/ExecutiveDashboard/components/Insights/insightsContextCore.js.map +1 -0
  65. package/dist/ExecutiveDashboard/components/Insights/insightsErrors.js +2 -0
  66. package/dist/ExecutiveDashboard/components/Insights/insightsErrors.js.map +1 -0
  67. package/dist/ExecutiveDashboard/components/Insights/insightsFilters.js +2 -0
  68. package/dist/ExecutiveDashboard/components/Insights/insightsFilters.js.map +1 -0
  69. package/dist/ExecutiveDashboard/components/Insights/insightsFormat.js +2 -0
  70. package/dist/ExecutiveDashboard/components/Insights/insightsFormat.js.map +1 -0
  71. package/dist/ExecutiveDashboard/components/Insights/insightsUtils.js +2 -0
  72. package/dist/ExecutiveDashboard/components/Insights/insightsUtils.js.map +1 -0
  73. package/dist/ExecutiveDashboard/components/IntegrationTracking/ MarkdownDocsModal.js +2 -0
  74. package/dist/ExecutiveDashboard/components/IntegrationTracking/ MarkdownDocsModal.js.map +1 -0
  75. package/dist/ExecutiveDashboard/components/IntegrationTracking/ useModeTrackingStatus.js +2 -0
  76. package/dist/ExecutiveDashboard/components/IntegrationTracking/ useModeTrackingStatus.js.map +1 -0
  77. package/dist/ExecutiveDashboard/components/IntegrationTracking/TrackingBanner.js +2 -0
  78. package/dist/ExecutiveDashboard/components/IntegrationTracking/TrackingBanner.js.map +1 -0
  79. package/dist/ExecutiveDashboard/components/IntegrationTracking/trackingIntegrationApi.js +2 -0
  80. package/dist/ExecutiveDashboard/components/IntegrationTracking/trackingIntegrationApi.js.map +1 -0
  81. package/dist/ExecutiveDashboard/components/RcaDecisionComponent/CitationMarkdown.js +2 -0
  82. package/dist/ExecutiveDashboard/components/RcaDecisionComponent/CitationMarkdown.js.map +1 -0
  83. package/dist/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.js +1 -1
  84. package/dist/ExecutiveDashboard/components/Table/FTable.js +1 -1
  85. package/dist/ExecutiveDashboard/utils/sectionOrder.js +1 -1
  86. package/dist/cjs/ExecutiveDashboard/ExecutiveDashboardWrapper.js +1 -1
  87. package/dist/cjs/ExecutiveDashboard/api/dashboardApi.js +1 -1
  88. package/dist/cjs/ExecutiveDashboard/api/insightsApi.js +2 -0
  89. package/dist/cjs/ExecutiveDashboard/api/insightsApi.js.map +1 -0
  90. package/dist/cjs/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.js +1 -1
  91. package/dist/cjs/ExecutiveDashboard/components/DashboardDateFilter/QuarterPicker.js +2 -0
  92. package/dist/cjs/ExecutiveDashboard/components/DashboardDateFilter/QuarterPicker.js.map +1 -0
  93. package/dist/cjs/ExecutiveDashboard/components/DashboardDateFilter/datePreset.js +1 -1
  94. package/dist/cjs/ExecutiveDashboard/components/DashboardDateFilter/dateRanges.js +2 -0
  95. package/dist/cjs/ExecutiveDashboard/components/DashboardDateFilter/dateRanges.js.map +1 -0
  96. package/dist/cjs/ExecutiveDashboard/components/DashboardGrid/buildDashboardWidgets.js +1 -1
  97. package/dist/cjs/ExecutiveDashboard/components/DashboardGrid/kpiCollapse.js +2 -0
  98. package/dist/cjs/ExecutiveDashboard/components/DashboardGrid/kpiCollapse.js.map +1 -0
  99. package/dist/cjs/ExecutiveDashboard/components/DashboardHeader/DashboardHeader.js +2 -0
  100. package/dist/cjs/ExecutiveDashboard/components/DashboardHeader/DashboardHeader.js.map +1 -0
  101. package/dist/cjs/ExecutiveDashboard/components/DataAccess/DataAccessMessage.js +2 -0
  102. package/dist/cjs/ExecutiveDashboard/components/DataAccess/DataAccessMessage.js.map +1 -0
  103. package/dist/cjs/ExecutiveDashboard/components/DataAccess/DataAccessScopeChip.js +2 -0
  104. package/dist/cjs/ExecutiveDashboard/components/DataAccess/DataAccessScopeChip.js.map +1 -0
  105. package/dist/cjs/ExecutiveDashboard/components/ExecutiveDashboard.js +1 -1
  106. package/dist/cjs/ExecutiveDashboard/components/FiltersSidebar/FiltersSidebar.js +1 -1
  107. package/dist/cjs/ExecutiveDashboard/components/Graph/Graph.js +1 -1
  108. package/dist/cjs/ExecutiveDashboard/components/Graph/LineChart.js +1 -1
  109. package/dist/cjs/ExecutiveDashboard/components/Graph/axisDomain.js +2 -0
  110. package/dist/cjs/ExecutiveDashboard/components/Graph/axisDomain.js.map +1 -0
  111. package/dist/cjs/ExecutiveDashboard/components/Graph/inlineLabels.js +2 -0
  112. package/dist/cjs/ExecutiveDashboard/components/Graph/inlineLabels.js.map +1 -0
  113. package/dist/cjs/ExecutiveDashboard/components/Insights/AgCharts.js +2 -0
  114. package/dist/cjs/ExecutiveDashboard/components/Insights/AgCharts.js.map +1 -0
  115. package/dist/cjs/ExecutiveDashboard/components/Insights/AgReport.js +2 -0
  116. package/dist/cjs/ExecutiveDashboard/components/Insights/AgReport.js.map +1 -0
  117. package/dist/cjs/ExecutiveDashboard/components/Insights/CommentsThread.js +2 -0
  118. package/dist/cjs/ExecutiveDashboard/components/Insights/CommentsThread.js.map +1 -0
  119. package/dist/cjs/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.js +2 -0
  120. package/dist/cjs/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.js.map +1 -0
  121. package/dist/cjs/ExecutiveDashboard/components/Insights/DrillLevel.js +2 -0
  122. package/dist/cjs/ExecutiveDashboard/components/Insights/DrillLevel.js.map +1 -0
  123. package/dist/cjs/ExecutiveDashboard/components/Insights/DrillTable.js +2 -0
  124. package/dist/cjs/ExecutiveDashboard/components/Insights/DrillTable.js.map +1 -0
  125. package/dist/cjs/ExecutiveDashboard/components/Insights/DriverActivity.js +2 -0
  126. package/dist/cjs/ExecutiveDashboard/components/Insights/DriverActivity.js.map +1 -0
  127. package/dist/cjs/ExecutiveDashboard/components/Insights/FilterNotice.js +2 -0
  128. package/dist/cjs/ExecutiveDashboard/components/Insights/FilterNotice.js.map +1 -0
  129. package/dist/cjs/ExecutiveDashboard/components/Insights/InsightTabs.js +2 -0
  130. package/dist/cjs/ExecutiveDashboard/components/Insights/InsightTabs.js.map +1 -0
  131. package/dist/cjs/ExecutiveDashboard/components/Insights/InsightsContext.js +2 -0
  132. package/dist/cjs/ExecutiveDashboard/components/Insights/InsightsContext.js.map +1 -0
  133. package/dist/cjs/ExecutiveDashboard/components/Insights/KpiChart.js +2 -0
  134. package/dist/cjs/ExecutiveDashboard/components/Insights/KpiChart.js.map +1 -0
  135. package/dist/cjs/ExecutiveDashboard/components/Insights/L1Report.js +2 -0
  136. package/dist/cjs/ExecutiveDashboard/components/Insights/L1Report.js.map +1 -0
  137. package/dist/cjs/ExecutiveDashboard/components/Insights/NeedsAttention.js +2 -0
  138. package/dist/cjs/ExecutiveDashboard/components/Insights/NeedsAttention.js.map +1 -0
  139. package/dist/cjs/ExecutiveDashboard/components/Insights/ReportDrawer.js +2 -0
  140. package/dist/cjs/ExecutiveDashboard/components/Insights/ReportDrawer.js.map +1 -0
  141. package/dist/cjs/ExecutiveDashboard/components/Insights/RowDetail.js +2 -0
  142. package/dist/cjs/ExecutiveDashboard/components/Insights/RowDetail.js.map +1 -0
  143. package/dist/cjs/ExecutiveDashboard/components/Insights/agPrimitives.js +2 -0
  144. package/dist/cjs/ExecutiveDashboard/components/Insights/agPrimitives.js.map +1 -0
  145. package/dist/cjs/ExecutiveDashboard/components/Insights/drillDay.js +2 -0
  146. package/dist/cjs/ExecutiveDashboard/components/Insights/drillDay.js.map +1 -0
  147. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsContextCore.js +2 -0
  148. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsContextCore.js.map +1 -0
  149. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsErrors.js +2 -0
  150. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsErrors.js.map +1 -0
  151. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsFilters.js +2 -0
  152. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsFilters.js.map +1 -0
  153. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsFormat.js +2 -0
  154. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsFormat.js.map +1 -0
  155. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsUtils.js +2 -0
  156. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsUtils.js.map +1 -0
  157. package/dist/cjs/ExecutiveDashboard/components/IntegrationTracking/ MarkdownDocsModal.js +2 -0
  158. package/dist/cjs/ExecutiveDashboard/components/IntegrationTracking/ MarkdownDocsModal.js.map +1 -0
  159. package/dist/cjs/ExecutiveDashboard/components/IntegrationTracking/ useModeTrackingStatus.js +2 -0
  160. package/dist/cjs/ExecutiveDashboard/components/IntegrationTracking/ useModeTrackingStatus.js.map +1 -0
  161. package/dist/cjs/ExecutiveDashboard/components/IntegrationTracking/TrackingBanner.js +2 -0
  162. package/dist/cjs/ExecutiveDashboard/components/IntegrationTracking/TrackingBanner.js.map +1 -0
  163. package/dist/cjs/ExecutiveDashboard/components/IntegrationTracking/trackingIntegrationApi.js +2 -0
  164. package/dist/cjs/ExecutiveDashboard/components/IntegrationTracking/trackingIntegrationApi.js.map +1 -0
  165. package/dist/cjs/ExecutiveDashboard/components/RcaDecisionComponent/CitationMarkdown.js +2 -0
  166. package/dist/cjs/ExecutiveDashboard/components/RcaDecisionComponent/CitationMarkdown.js.map +1 -0
  167. package/dist/cjs/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.js +1 -1
  168. package/dist/cjs/ExecutiveDashboard/components/Table/FTable.js +1 -1
  169. package/dist/cjs/ExecutiveDashboard/utils/sectionOrder.js +1 -1
  170. package/dist/cjs/index.js +1 -1
  171. package/dist/cjs/styles.css +1 -1
  172. package/dist/index.js +1 -1
  173. package/dist/styles.css +1 -1
  174. package/dist/types/ExecutiveDashboard/ExecutiveDashboardWrapper.d.ts +1 -1
  175. package/dist/types/ExecutiveDashboard/ExecutiveDashboardWrapper.d.ts.map +1 -1
  176. package/dist/types/ExecutiveDashboard/TestExecutiveDashboard.d.ts.map +1 -1
  177. package/dist/types/ExecutiveDashboard/api/dashboardApi.d.ts +10 -2
  178. package/dist/types/ExecutiveDashboard/api/dashboardApi.d.ts.map +1 -1
  179. package/dist/types/ExecutiveDashboard/api/insightsApi.d.ts +200 -0
  180. package/dist/types/ExecutiveDashboard/api/insightsApi.d.ts.map +1 -0
  181. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.d.ts +5 -1
  182. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.d.ts.map +1 -1
  183. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/QuarterPicker.d.ts +9 -0
  184. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/QuarterPicker.d.ts.map +1 -0
  185. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/datePreset.d.ts +47 -2
  186. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/datePreset.d.ts.map +1 -1
  187. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/dateRanges.d.ts +7 -0
  188. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/dateRanges.d.ts.map +1 -0
  189. package/dist/types/ExecutiveDashboard/components/DashboardGrid/buildDashboardWidgets.d.ts +12 -1
  190. package/dist/types/ExecutiveDashboard/components/DashboardGrid/buildDashboardWidgets.d.ts.map +1 -1
  191. package/dist/types/ExecutiveDashboard/components/DashboardGrid/kpiCollapse.d.ts +10 -0
  192. package/dist/types/ExecutiveDashboard/components/DashboardGrid/kpiCollapse.d.ts.map +1 -0
  193. package/dist/types/ExecutiveDashboard/components/DashboardHeader/DashboardHeader.d.ts +17 -0
  194. package/dist/types/ExecutiveDashboard/components/DashboardHeader/DashboardHeader.d.ts.map +1 -0
  195. package/dist/types/ExecutiveDashboard/components/DataAccess/DataAccessMessage.d.ts +18 -0
  196. package/dist/types/ExecutiveDashboard/components/DataAccess/DataAccessMessage.d.ts.map +1 -0
  197. package/dist/types/ExecutiveDashboard/components/DataAccess/DataAccessScopeChip.d.ts +16 -0
  198. package/dist/types/ExecutiveDashboard/components/DataAccess/DataAccessScopeChip.d.ts.map +1 -0
  199. package/dist/types/ExecutiveDashboard/components/ExecutiveDashboard.d.ts +45 -2
  200. package/dist/types/ExecutiveDashboard/components/ExecutiveDashboard.d.ts.map +1 -1
  201. package/dist/types/ExecutiveDashboard/components/FiltersSidebar/FiltersSidebar.d.ts +11 -1
  202. package/dist/types/ExecutiveDashboard/components/FiltersSidebar/FiltersSidebar.d.ts.map +1 -1
  203. package/dist/types/ExecutiveDashboard/components/Graph/Graph.d.ts.map +1 -1
  204. package/dist/types/ExecutiveDashboard/components/Graph/LineChart.d.ts +6 -1
  205. package/dist/types/ExecutiveDashboard/components/Graph/LineChart.d.ts.map +1 -1
  206. package/dist/types/ExecutiveDashboard/components/Graph/axisDomain.d.ts +24 -0
  207. package/dist/types/ExecutiveDashboard/components/Graph/axisDomain.d.ts.map +1 -0
  208. package/dist/types/ExecutiveDashboard/components/Graph/inlineLabels.d.ts +49 -0
  209. package/dist/types/ExecutiveDashboard/components/Graph/inlineLabels.d.ts.map +1 -0
  210. package/dist/types/ExecutiveDashboard/components/Graph/types.d.ts +85 -0
  211. package/dist/types/ExecutiveDashboard/components/Graph/types.d.ts.map +1 -1
  212. package/dist/types/ExecutiveDashboard/components/Insights/AgCharts.d.ts +74 -0
  213. package/dist/types/ExecutiveDashboard/components/Insights/AgCharts.d.ts.map +1 -0
  214. package/dist/types/ExecutiveDashboard/components/Insights/AgReport.d.ts +160 -0
  215. package/dist/types/ExecutiveDashboard/components/Insights/AgReport.d.ts.map +1 -0
  216. package/dist/types/ExecutiveDashboard/components/Insights/CommentsThread.d.ts +6 -0
  217. package/dist/types/ExecutiveDashboard/components/Insights/CommentsThread.d.ts.map +1 -0
  218. package/dist/types/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.d.ts +65 -0
  219. package/dist/types/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.d.ts.map +1 -0
  220. package/dist/types/ExecutiveDashboard/components/Insights/DrillLevel.d.ts +35 -0
  221. package/dist/types/ExecutiveDashboard/components/Insights/DrillLevel.d.ts.map +1 -0
  222. package/dist/types/ExecutiveDashboard/components/Insights/DrillTable.d.ts +29 -0
  223. package/dist/types/ExecutiveDashboard/components/Insights/DrillTable.d.ts.map +1 -0
  224. package/dist/types/ExecutiveDashboard/components/Insights/DriverActivity.d.ts +10 -0
  225. package/dist/types/ExecutiveDashboard/components/Insights/DriverActivity.d.ts.map +1 -0
  226. package/dist/types/ExecutiveDashboard/components/Insights/FilterNotice.d.ts +7 -0
  227. package/dist/types/ExecutiveDashboard/components/Insights/FilterNotice.d.ts.map +1 -0
  228. package/dist/types/ExecutiveDashboard/components/Insights/InsightTabs.d.ts +17 -0
  229. package/dist/types/ExecutiveDashboard/components/Insights/InsightTabs.d.ts.map +1 -0
  230. package/dist/types/ExecutiveDashboard/components/Insights/InsightsContext.d.ts +73 -0
  231. package/dist/types/ExecutiveDashboard/components/Insights/InsightsContext.d.ts.map +1 -0
  232. package/dist/types/ExecutiveDashboard/components/Insights/KpiChart.d.ts +128 -0
  233. package/dist/types/ExecutiveDashboard/components/Insights/KpiChart.d.ts.map +1 -0
  234. package/dist/types/ExecutiveDashboard/components/Insights/L1Report.d.ts +41 -0
  235. package/dist/types/ExecutiveDashboard/components/Insights/L1Report.d.ts.map +1 -0
  236. package/dist/types/ExecutiveDashboard/components/Insights/NeedsAttention.d.ts +27 -0
  237. package/dist/types/ExecutiveDashboard/components/Insights/NeedsAttention.d.ts.map +1 -0
  238. package/dist/types/ExecutiveDashboard/components/Insights/ReportDrawer.d.ts +13 -0
  239. package/dist/types/ExecutiveDashboard/components/Insights/ReportDrawer.d.ts.map +1 -0
  240. package/dist/types/ExecutiveDashboard/components/Insights/RowDetail.d.ts +21 -0
  241. package/dist/types/ExecutiveDashboard/components/Insights/RowDetail.d.ts.map +1 -0
  242. package/dist/types/ExecutiveDashboard/components/Insights/agPrimitives.d.ts +176 -0
  243. package/dist/types/ExecutiveDashboard/components/Insights/agPrimitives.d.ts.map +1 -0
  244. package/dist/types/ExecutiveDashboard/components/Insights/drillDay.d.ts +17 -0
  245. package/dist/types/ExecutiveDashboard/components/Insights/drillDay.d.ts.map +1 -0
  246. package/dist/types/ExecutiveDashboard/components/Insights/insightsContextCore.d.ts +128 -0
  247. package/dist/types/ExecutiveDashboard/components/Insights/insightsContextCore.d.ts.map +1 -0
  248. package/dist/types/ExecutiveDashboard/components/Insights/insightsErrors.d.ts +11 -0
  249. package/dist/types/ExecutiveDashboard/components/Insights/insightsErrors.d.ts.map +1 -0
  250. package/dist/types/ExecutiveDashboard/components/Insights/insightsFilters.d.ts +9 -0
  251. package/dist/types/ExecutiveDashboard/components/Insights/insightsFilters.d.ts.map +1 -0
  252. package/dist/types/ExecutiveDashboard/components/Insights/insightsFormat.d.ts +92 -0
  253. package/dist/types/ExecutiveDashboard/components/Insights/insightsFormat.d.ts.map +1 -0
  254. package/dist/types/ExecutiveDashboard/components/Insights/insightsUtils.d.ts +85 -0
  255. package/dist/types/ExecutiveDashboard/components/Insights/insightsUtils.d.ts.map +1 -0
  256. package/dist/types/ExecutiveDashboard/components/IntegrationTracking/ MarkdownDocsModal.d.ts +24 -0
  257. package/dist/types/ExecutiveDashboard/components/IntegrationTracking/ MarkdownDocsModal.d.ts.map +1 -0
  258. package/dist/types/ExecutiveDashboard/components/IntegrationTracking/ useModeTrackingStatus.d.ts +9 -0
  259. package/dist/types/ExecutiveDashboard/components/IntegrationTracking/ useModeTrackingStatus.d.ts.map +1 -0
  260. package/dist/types/ExecutiveDashboard/components/IntegrationTracking/TrackingBanner.d.ts +25 -0
  261. package/dist/types/ExecutiveDashboard/components/IntegrationTracking/TrackingBanner.d.ts.map +1 -0
  262. package/dist/types/ExecutiveDashboard/components/IntegrationTracking/index.d.ts +5 -0
  263. package/dist/types/ExecutiveDashboard/components/IntegrationTracking/index.d.ts.map +1 -0
  264. package/dist/types/ExecutiveDashboard/components/IntegrationTracking/trackingIntegrationApi.d.ts +17 -0
  265. package/dist/types/ExecutiveDashboard/components/IntegrationTracking/trackingIntegrationApi.d.ts.map +1 -0
  266. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/CitationMarkdown.d.ts +54 -0
  267. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/CitationMarkdown.d.ts.map +1 -0
  268. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.d.ts +13 -2
  269. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.d.ts.map +1 -1
  270. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/index.d.ts +1 -1
  271. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/index.d.ts.map +1 -1
  272. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/types.d.ts +46 -2
  273. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/types.d.ts.map +1 -1
  274. package/dist/types/ExecutiveDashboard/components/Table/FTable.d.ts +2 -0
  275. package/dist/types/ExecutiveDashboard/components/Table/FTable.d.ts.map +1 -1
  276. package/dist/types/ExecutiveDashboard/types/index.d.ts +122 -2
  277. package/dist/types/ExecutiveDashboard/types/index.d.ts.map +1 -1
  278. package/dist/types/ExecutiveDashboard/types/insights.d.ts +893 -0
  279. package/dist/types/ExecutiveDashboard/types/insights.d.ts.map +1 -0
  280. package/dist/types/ExecutiveDashboard/utils/sectionOrder.d.ts.map +1 -1
  281. package/dist/types/index.d.ts +20 -2
  282. package/dist/types/index.d.ts.map +1 -1
  283. package/package.json +4 -3
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),i=require("react"),l=require("recharts"),r=require("../ui/chart.js"),o=require("./types.js"),t=require("../../utils/index.js"),a=require("./Seperator.js"),u=function(e){return"number"==typeof e&&!Number.isNaN(e)},s=function(e){switch(e){case"linear":return"linear";case"step":return"stepAfter";default:return"monotone"}};exports.default=function(d){var c,v,f,h,x,y,g,p,m,k=d.tier,b=d.series,_=d.hiddenKeys,j=d.onToggleSeries,C=d.xAxis,A=d.yAxis,w=d.tooltip,L=d.legend,T=d.style,S=d.syncId,M=d.reference;d.scrollable;var F=d.onPointClick,N=d.activeThreshold,R=d.onThresholdViewChange,D=null!==(c=null==T?void 0:T.chartHeight)&&void 0!==c?c:300,E=null!==(v=null==T?void 0:T.gridColor)&&void 0!==v?v:"#eef0f4",I=null!==(f=null==T?void 0:T.axisColor)&&void 0!==f?f:"#d7dbe3",K=null!==(h=null==T?void 0:T.axisLabelColor)&&void 0!==h?h:"#6b7280",P=null!==(x=null==T?void 0:T.tickColor)&&void 0!==x?x:"#9ca3af",W=null!==(y=null==T?void 0:T.fontFamily)&&void 0!==y?y:"Inter, system-ui, -apple-system, sans-serif",q=i.useState(null),z=q[0],B=q[1],O=i.useMemo(function(){var n,i,l;if(null===(n=null==C?void 0:C.categories)||void 0===n?void 0:n.length)return{categories:C.categories,xType:null!==(i=C.type)&&void 0!==i?i:"category"};var r=new Set,o=[];b.forEach(function(e){return e.data.forEach(function(e){r.has(e.x)||(r.add(e.x),o.push(e.x))})});var t=o.every(u),a=null!==(l=null==C?void 0:C.type)&&void 0!==l?l:t?"number":"category";return{categories:"number"===a?e.__spreadArray([],o,!0).sort(function(e,n){return Number(e)-Number(n)}):o,xType:a}},[b,null==C?void 0:C.categories,null==C?void 0:C.type]),G=O.categories,H=O.xType,V=i.useMemo(function(){var e=new Map;return b.forEach(function(n){var i=new Map;n.data.forEach(function(e){return i.set(e.x,e.y)}),e.set(n.key,i)}),G.map(function(n){var i={x:n};return b.forEach(function(l){var r,o=null===(r=e.get(l.key))||void 0===r?void 0:r.get(n);i[l.key]=null==o?null:o}),i})},[b,G]),U=i.useMemo(function(){var e={},n=b.map(function(n,i){var l,r=null!==(l=n.color)&&void 0!==l?l:o.colorForIndex(null==T?void 0:T.colors,i);return e[n.key]={label:n.label,color:r,threshold:n.threshold,thresholdUnit:n.thresholdUnit},{series:n,color:r,index:i}});return{chartConfig:e,resolved:n}},[b,null==T?void 0:T.colors]),X=U.chartConfig,Y=U.resolved,Z=i.useMemo(function(){var e={};return b.forEach(function(n){n.valueFormatter&&(e[n.key]=function(e,i){var l;return n.valueFormatter(e,null!==(l=null==i?void 0:i.payload)&&void 0!==l?l:{x:null==i?void 0:i.x,y:e})})}),e},[b]),J=!1!==(null==w?void 0:w.enabled),Q=(null==w?void 0:w.seriesKeys)?new Set(w.seriesKeys):null,$=!1!==(null==L?void 0:L.show),ee="top"===(null==L?void 0:L.position)?"top":"bottom",ne="start"===(null==L?void 0:L.align)?"left":"end"===(null==L?void 0:L.align)?"right":"center",ie=!1!==(null==C?void 0:C.show),le=!1!==(null==A?void 0:A.show),re=!1!==(null==T?void 0:T.showGrid),oe=!!(null==T?void 0:T.showVerticalGrid),te=i.useMemo(function(){var n,i=b.filter(function(e){return!_.has(e.key)}),l=Math.max.apply(Math,e.__spreadArray([0],V.flatMap(function(e){return i.map(function(n){return Number(e[n.key])||0})}),!1)),r=null==N?void 0:N[k],o=r?null===(n=X[r])||void 0===n?void 0:n.threshold:void 0;return void 0!==o&&o>l&&(l=o),l},[V,b,_,N,k,X]),ae=i.useMemo(function(){return Math.ceil(1.1*te)},[te]),ue=[null!=(null==A?void 0:A.min)?A.min:!1!==(null==A?void 0:A.beginAtZero)?0:"auto",null!=(null==A?void 0:A.max)?A.max:ae],se=null!==(g=null==T?void 0:T.yAxisWidth)&&void 0!==g?g:(null==A?void 0:A.label)?64:48,de={top:12,right:16,bottom:8,left:null!=(null==T?void 0:T.yAxisWidth)?0:(null==A?void 0:A.label)?16:0},ce=null!==(p=null==C?void 0:C.enableScroll)&&void 0!==p&&p,ve=null!==(m=null==C?void 0:C.minTickGap)&&void 0!==m?m:2;return i.useMemo(function(){if(!ce||!z||G.length<=1)return"100%";var e=(G.length-1)*ve+200;return e>z-se-de.left-de.right?"".concat(e,"px"):"100%"},[ce,z,G.length,ve,se,de]),n.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",width:"100%"}},{children:n.jsx(r.ChartContainer,e.__assign({config:X,style:{height:D,fontFamily:W},ref:function(e){e&&null===z&&B(e.clientWidth)}},{children:function(){var i,o;return n.jsxs(l.ComposedChart,e.__assign({data:V,margin:de,syncId:S},{children:[n.jsx(l.CartesianGrid,{vertical:oe,horizontal:re,stroke:E}),n.jsx(l.XAxis,{dataKey:"x",type:"number"===H?"number":"category",hide:!ie,height:(null==C?void 0:C.label)?52:void 0,tickLine:!1,axisLine:!(null==C?void 0:C.hideLine)&&{stroke:I},tickMargin:8,interval:"preserveStartEnd",tick:{fill:P,fontSize:11},tickFormatter:(null==C?void 0:C.formatTick)?function(e,n){return C.formatTick(e,n)}:void 0,label:(null==M?void 0:M.showReferenceAreaLabel)?function(i){return function(i){var l=i.viewBox;i.startTick,i.endTick;var r=l.x,o=l.y,t=l.width,u=1;if((null==M?void 0:M.showReferenceArea)&&null!=(null==M?void 0:M.referencePoint)&&G.length>1){var s=G.indexOf(M.referencePoint);-1!==s&&(u=s/(G.length-1))}var d=100*u,c=100-d;return n.jsx("foreignObject",e.__assign({x:r,y:o+24,width:t,height:40},{children:n.jsxs("div",e.__assign({className:"ellm-graph__liveLabelContainer"},{children:[(null==M?void 0:M.referenceAreaLabel)&&n.jsxs("div",e.__assign({style:{flex:d,display:"flex",alignItems:"center"}},{children:[n.jsx(a.default,{}),n.jsx("span",e.__assign({style:{padding:"0 12px",color:"#6b7280",fontSize:"12px"}},{children:null==M?void 0:M.referenceAreaLabel})),n.jsx(a.default,{})]})),c>0&&n.jsxs("div",e.__assign({style:{flex:c,display:"flex",alignItems:"center"}},{children:[n.jsx(a.default,{style:{backgroundColor:"#DC2626"}}),n.jsxs("div",e.__assign({className:"ellm-graph__liveLabel"},{children:[n.jsx(a.default,{style:{width:"8px",height:"8px",borderRadius:"100%",backgroundColor:"#DC2626",flex:"auto"},pulse:!0}),"LIVE - ",null==M?void 0:M.referenceAreaLiveLabel]})),n.jsx(a.default,{style:{backgroundColor:"#DC2626"}})]}))]}))}))}(e.__assign(e.__assign({},i),{startTick:G[0],endTick:G[G.length-1]}))}:(null==C?void 0:C.label)?{value:C.label,position:"insideBottom",offset:4,fill:K,fontSize:12,fontWeight:500}:void 0}),n.jsx(l.YAxis,{hide:!le,domain:ue,tickLine:!1,axisLine:!1===(null==A?void 0:A.hideLine)&&{stroke:I},tickCount:null==A?void 0:A.tickCount,width:se,tick:{fill:P,fontSize:11},tickFormatter:(null==A?void 0:A.formatTick)?function(e,n){return A.formatTick(e,n)}:function(e){return"number"==typeof e?t.compactNumber(e):String(e)},label:(null==A?void 0:A.label)?{value:A.label,angle:-90,position:"insideLeft",style:{textAnchor:"middle"},fill:K,fontSize:12,fontWeight:500}:void 0}),J&&n.jsx(r.ChartTooltip,{cursor:{stroke:I,strokeDasharray:"4 4"},content:function(i){var l,o=(null!==(l=i.payload)&&void 0!==l?l:[]).filter(function(e){var n=b.find(function(n){return n.key===e.dataKey});return!1!==(null==n?void 0:n.showInTooltip)&&!(Q&&!Q.has(String(e.dataKey)))});return(null==w?void 0:w.render)?w.render({x:i.label,points:o.map(function(e){var n;return{series:b.find(function(n){return n.key===e.dataKey}),value:null!==(n=e.value)&&void 0!==n?n:null,point:{x:i.label,y:e.value},color:e.color}})}):n.jsx(r.ChartTooltipContent,e.__assign({},i,{payload:o,hideLabel:!1===(null==w?void 0:w.showHeading),valueFormatters:Z,labelFormatter:(null==w?void 0:w.formatHeading)?function(e){return w.formatHeading(e)}:void 0}))}}),$&&n.jsx(r.ChartLegend,{verticalAlign:ee,content:function(i){return n.jsx(r.ChartLegendContent,e.__assign({},i,{tier:k,verticalAlign:ee,align:ne,hiddenKeys:_,activeThreshold:N,onThresholdViewChange:R,onItemClick:!1!==(null==L?void 0:L.toggle)&&j?j:void 0}))}}),(null==M?void 0:M.showReferenceArea)&&null!=(null==M?void 0:M.referencePoint)&&n.jsx(l.ReferenceArea,{x1:M.referencePoint,fill:null!==(i=M.referenceAreaFill)&&void 0!==i?i:"#2563EB1A"}),(null==M?void 0:M.showReferenceArea)&&null!=M.referencePoint&&n.jsx(l.ReferenceLine,{x:M.referencePoint,stroke:null!==(o=M.referenceLineStroke)&&void 0!==o?o:"#3B82F6",strokeDasharray:"4 4"}),(null==N?void 0:N[k])&&void 0!==X[null==N?void 0:N[k]].threshold&&n.jsx(l.ReferenceLine,{y:X[null==N?void 0:N[k]].threshold,stroke:"red",strokeWidth:1.5,strokeDasharray:"4 4",label:function(i){var l=i.viewBox;return n.jsx("text",e.__assign({x:l.x-8,y:l.y,textAnchor:"end",dominantBaseline:"middle",fill:"red",fontSize:11},{children:X[null==N?void 0:N[k]].threshold}))}}),Y.map(function(i){var r,o,t,a,u=i.series,d=_.has(u.key),c="var(--color-".concat(u.key,")"),v=!0===u.dashed?"6 5":"string"==typeof u.dashed?u.dashed:void 0,f=!1!==u.showPoints&&{r:null!==(r=u.pointRadius)&&void 0!==r?r:3,fill:"#fff",stroke:c,strokeWidth:2},h=e.__assign({r:(null!==(o=u.pointRadius)&&void 0!==o?o:3)+2},F&&{onClick:function(e,n){var i,l;return function(e,n,i){if(F){var l=b.find(function(n){return n.key===e});l&&F({series:l,point:{x:null==n?void 0:n.x,y:null==n?void 0:n[e]},index:i})}}(u.key,null!==(i=null==n?void 0:n.payload)&&void 0!==i?i:n,null!==(l=null==n?void 0:n.index)&&void 0!==l?l:0)}}),x={key:u.key,dataKey:u.key,name:u.key,type:s(u.curve),stroke:c,strokeWidth:null!==(t=u.strokeWidth)&&void 0!==t?t:2,strokeDasharray:v,connectNulls:!1,isAnimationActive:!1,hide:d,dot:f,activeDot:h};return u.area?n.jsx(l.Area,e.__assign({},x,{fill:c,fillOpacity:null!==(a=u.areaOpacity)&&void 0!==a?a:.12})):n.jsx(l.Line,e.__assign({},x))})]}))}()}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n=require("../../../_virtual/_tslib.js"),i=require("react"),l=require("react/jsx-runtime"),t=require("recharts"),r=require("../ui/chart.js"),o=require("./types.js"),u=require("../../utils/index.js"),a=require("./axisDomain.js"),d=require("./inlineLabels.js"),s=require("./Seperator.js"),v={K:1e3,M:1e6,B:1e9,T:1e12},c=function(e){if(null==e||"string"==typeof e&&""===e.trim())return null;var n=Number(e);return Number.isFinite(n)?n:null},f=function(e,n,i){return e.valueFormatter?e.valueFormatter(n,{x:i,y:n}):u.compactNumber(n)},h=function(e,n,i){var l;return null!==(l=function(e){var n,i,l;if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"!=typeof e||e.includes("%"))return null;var t=e.replace(/\s/g,"").match(/[-+]?(?:\d[\d,]*(?:\.\d*)?|\.\d+)([KMBT])?/i);if(!t)return null;var r=Number(t[0].replace(/[KMBT,]/gi,"")),o=null!==(l=v[null!==(i=null===(n=t[1])||void 0===n?void 0:n.toUpperCase())&&void 0!==i?i:""])&&void 0!==l?l:1;return Number.isFinite(r)?r*o:null}(f(e,n,i)))&&void 0!==l?l:n},g=function(e){var i=e.render,t=n.__rest(e,["render"]);return l.jsx(l.Fragment,{children:i(t)})},y=function(e){return"number"==typeof e&&!Number.isNaN(e)},x=function(n,i,l,t){return void 0===e&&(e="undefined"!=typeof document?document.createElement("canvas").getContext("2d"):null),e?(e.font="".concat(l," ").concat(i,"px ").concat(t),e.measureText(n).width):n.length*i*.58},p=function(e){switch(e){case"linear":return"linear";case"step":return"stepAfter";default:return"monotone"}};exports.default=function(e){var v,m,k,_,b,j,C,L,A,w,M,S,T,N,W,F,O,R,P,z,E,D,I,K,H,B,q,V,Z,G=e.tier,U=e.series,Y=e.hiddenKeys,X=e.onToggleSeries,J=e.xAxis,Q=e.yAxis,$=e.tooltip,ee=e.legend,ne=e.style,ie=e.syncId,le=e.syncMethod,te=e.reference;e.scrollable;var re=e.onPointClick,oe=e.activeThreshold,ue=e.onThresholdViewChange,ae=null!==(v=null==ne?void 0:ne.chartHeight)&&void 0!==v?v:300,de=null!==(m=null==ne?void 0:ne.gridColor)&&void 0!==m?m:"#eef0f4",se=null!==(k=null==ne?void 0:ne.axisColor)&&void 0!==k?k:"#d7dbe3",ve=null!==(_=null==ne?void 0:ne.axisLabelColor)&&void 0!==_?_:"#6b7280",ce=null!==(b=null==ne?void 0:ne.tickColor)&&void 0!==b?b:"#9ca3af",fe=null!==(j=null==ne?void 0:ne.fontFamily)&&void 0!==j?j:"Inter, system-ui, -apple-system, sans-serif",he=Boolean(null==ne?void 0:ne.modern),ge=null!==(L=null===(C=null==ne?void 0:ne.text)||void 0===C?void 0:C.tickSize)&&void 0!==L?L:11,ye=null===(A=null==ne?void 0:ne.text)||void 0===A?void 0:A.axisTitleSize,xe=null===(w=null==ne?void 0:ne.text)||void 0===w?void 0:w.axisTitleWeight,pe=null!==(S=null===(M=null==ne?void 0:ne.text)||void 0===M?void 0:M.valueLabelSize)&&void 0!==S?S:11,me=null!==(N=null===(T=null==ne?void 0:ne.text)||void 0===T?void 0:T.valueLabelWeight)&&void 0!==N?N:600,ke=null!==(F=null===(W=null==ne?void 0:ne.text)||void 0===W?void 0:W.seriesLabelSize)&&void 0!==F?F:11,_e=null!==(R=null===(O=null==ne?void 0:ne.text)||void 0===O?void 0:O.seriesLabelWeight)&&void 0!==R?R:500,be="ellm-grad-".concat(i.useId().replace(/[^a-zA-Z0-9_-]/g,"")),je=function(e){return"".concat(be,"-").concat(e.replace(/[^a-zA-Z0-9_-]/g,"_"))},Ce=i.useState(null),Le=Ce[0],Ae=Ce[1],we=i.useState(null),Me=we[0],Se=we[1],Te=i.useMemo(function(){var e,i,l;if(null===(e=null==J?void 0:J.categories)||void 0===e?void 0:e.length)return{categories:J.categories,xType:null!==(i=J.type)&&void 0!==i?i:"category"};var t=new Set,r=[];U.forEach(function(e){return e.data.forEach(function(e){t.has(e.x)||(t.add(e.x),r.push(e.x))})});var o=r.every(y),u=null!==(l=null==J?void 0:J.type)&&void 0!==l?l:o?"number":"category";return{categories:"number"===u?n.__spreadArray([],r,!0).sort(function(e,n){return Number(e)-Number(n)}):r,xType:u}},[U,null==J?void 0:J.categories,null==J?void 0:J.type]),Ne=Te.categories,We=Te.xType,Fe=i.useMemo(function(){var e=new Map;return U.forEach(function(n){var i=new Map;n.data.forEach(function(e){var l=c(e.y);i.set(e.x,null==l?null:h(n,l,e.x))}),e.set(n.key,i)}),Ne.map(function(n){var i={x:n};return U.forEach(function(l){var t,r=null===(t=e.get(l.key))||void 0===t?void 0:t.get(n);i[l.key]=null==r?null:r}),i})},[U,Ne]),Oe=i.useMemo(function(){var e={},n=U.map(function(n,i){var l,t=null!==(l=n.color)&&void 0!==l?l:o.colorForIndex(null==ne?void 0:ne.colors,i);return e[n.key]={label:n.label,color:t,threshold:n.threshold,thresholdUnit:n.thresholdUnit},{series:n,color:t,index:i}});return{chartConfig:e,resolved:n}},[U,null==ne?void 0:ne.colors]),Re=Oe.chartConfig,Pe=Oe.resolved,ze=i.useMemo(function(){var e={};return U.forEach(function(n){n.valueFormatter&&(e[n.key]=function(e,i){var l;return n.valueFormatter(e,null!==(l=null==i?void 0:i.payload)&&void 0!==l?l:{x:null==i?void 0:i.x,y:e})})}),e},[U]),Ee=!1!==(null==$?void 0:$.enabled),De=(null==$?void 0:$.seriesKeys)?new Set($.seriesKeys):null,Ie=!1!==(null==ee?void 0:ee.show),Ke="top"===(null==ee?void 0:ee.position)?"top":"bottom",He="start"===(null==ee?void 0:ee.align)?"left":"end"===(null==ee?void 0:ee.align)?"right":"center",Be=!1!==(null==J?void 0:J.show),qe=!1!==(null==Q?void 0:Q.show),Ve=!1!==(null==ne?void 0:ne.showGrid),Ze=!!(null==ne?void 0:ne.showVerticalGrid),Ge=i.useMemo(function(){var e,i=U.filter(function(e){return!Y.has(e.key)}),l=Math.max.apply(Math,n.__spreadArray([0],Fe.flatMap(function(e){return i.map(function(n){return Number(e[n.key])||0})}),!1)),t=null==oe?void 0:oe[G],r=t?null===(e=Re[t])||void 0===e?void 0:e.threshold:void 0;return void 0!==r&&r>l&&(l=r),l},[Fe,U,Y,oe,G,Re]),Ue=i.useMemo(function(){return Math.ceil(1.1*Ge)},[Ge]),Ye=[null!=(null==Q?void 0:Q.min)?Q.min:!1!==(null==Q?void 0:Q.beginAtZero)?0:"auto",null!=(null==Q?void 0:Q.max)?Q.max:Ue],Xe=U.some(function(e){return"right"===e.yAxis&&!Y.has(e.key)}),Je=i.useMemo(function(){if(!Xe&&!(null==Q?void 0:Q.tickCount))return null;var e=function(e){var i=U.filter(function(n){var i;return(null!==(i=n.yAxis)&&void 0!==i?i:"left")===e&&!Y.has(n.key)}).map(function(e){return e.key}),l=Fe.flatMap(function(e){return i.map(function(n){return e[n]})}).filter(function(e){return"number"==typeof e&&Number.isFinite(e)}),t="left"===e?Q:null==Q?void 0:Q.right,r=(null==t?void 0:t.tickCount)?Math.max(1,t.tickCount-1):void 0;return a.axisDomain(l,n.__assign(n.__assign({fromZero:!0===(null==t?void 0:t.beginAtZero)},r?{steps:r}:{}),void 0!==(null==t?void 0:t.domainPadding)?{paddingRatio:t.domainPadding}:{}))};return{left:e("left"),right:Xe?e("right"):null}},[Xe,U,Y,Fe,null==Q?void 0:Q.beginAtZero,null===(P=null==Q?void 0:Q.right)||void 0===P?void 0:P.beginAtZero,null==Q?void 0:Q.tickCount,null===(z=null==Q?void 0:Q.right)||void 0===z?void 0:z.tickCount,null==Q?void 0:Q.domainPadding,null===(E=null==Q?void 0:Q.right)||void 0===E?void 0:E.domainPadding]),Qe=function(e){return void 0===e&&(e="left"),Xe?{yAxisId:e}:{}},$e=!Xe||U.some(function(e){var n;return"left"===(null!==(n=e.yAxis)&&void 0!==n?n:"left")&&!Y.has(e.key)}),en=Xe&&(null==Q?void 0:Q.highlightOnHover)?Me:null;i.useEffect(function(){var e;null!==Me&&null===en&&(Se(null),null===(e=null==Q?void 0:Q.onHoverSide)||void 0===e||e.call(Q,null))},[en,Me]);var nn=function(e){var n;return null!==en&&(null!==(n=e.yAxis)&&void 0!==n?n:"left")!==en},ln=.15,tn=function(e){var n;Se(e),null===(n=null==Q?void 0:Q.onHoverSide)||void 0===n||n.call(Q,e)},rn=function(e){return null===en?{}:en===e?{fontWeight:600}:{opacity:.35}},on=function(e){return e?{style:{fill:e}}:{}},un=function(e,n,i,l,t){var r,o=f(e,n,i),u=null!==(r=e.pointRadius)&&void 0!==r?r:3;return{text:o,y:("below"===e.valueLabelPosition?t+u+16<ae-40:t-u-7<14)?t+u+14:t-u-7}},an=function(e,n,i){var l,t,r,o;if("string"!=typeof e)return n;var u=(null!=i?i:[]).map(function(e){return null==e?void 0:e.x}).filter(y);if(!u.length)return n;var a=x(e,pe,me,fe)/2+2,d=Math.min.apply(Math,u)-(null!==(t=null===(l=null==J?void 0:J.padding)||void 0===l?void 0:l.left)&&void 0!==t?t:0)+a,s=Math.max.apply(Math,u)+(null!==(o=null===(r=null==J?void 0:J.padding)||void 0===r?void 0:r.right)&&void 0!==o?o:0)-a;return d>s?n:Math.min(Math.max(n,d),s)},dn=function(e,i,l){var t=e.filter(Number.isFinite).map(function(e,n){return String(i?i(e,n):u.compactNumber(e))}),r=Math.max.apply(Math,n.__spreadArray([0],t.map(function(e){return x(e,ge,400,fe)}),!1));return Math.ceil(r+12+(l?(null!=ye?ye:he?11:12)+12:0))},sn="number"==typeof Ye[1]?Ye[1]:Ge,vn="number"==typeof Ye[0]?Ye[0]:0,cn=(null==Q?void 0:Q.fitWidth)?Xe&&Je?{left:dn(null!==(I=null===(D=Je.left)||void 0===D?void 0:D.ticks)&&void 0!==I?I:[],Q.formatTick,Q.label),right:dn(null!==(H=null===(K=Je.right)||void 0===K?void 0:K.ticks)&&void 0!==H?H:[],null===(B=Q.right)||void 0===B?void 0:B.formatTick,null===(q=Q.right)||void 0===q?void 0:q.label)}:{left:dn(Array.from({length:9},function(e,n){return vn+(sn-vn)*n/8}),Q.formatTick,Q.label),right:0}:{left:0,right:0},fn=null!==(V=null==ne?void 0:ne.yAxisWidth)&&void 0!==V?V:(null==Q?void 0:Q.label)?64:48,hn=Math.max(fn,cn.left),gn=Math.max(fn,cn.right),yn={top:12,right:Xe&&(null===(Z=null==Q?void 0:Q.right)||void 0===Z?void 0:Z.label)?8:16,bottom:8,left:null!=(null==ne?void 0:ne.yAxisWidth)?0:(null==Q?void 0:Q.label)?16:0},xn=function(e,n,i){if(re){var l=U.find(function(n){return n.key===e});l&&re({series:l,point:{x:null==n?void 0:n.x,y:null==n?void 0:n[e]},index:i})}},pn=i.useRef(null),mn=function(e){var n;return pn.current=null!==(n=null==e?void 0:e.offset)&&void 0!==n?n:null,null},kn=Xe&&(null==Q?void 0:Q.highlightOnHover)?{onMouseMove:function(e){var n=function(e){var n=pn.current,i=e.currentTarget.querySelector("svg.recharts-surface");if(!n||!i)return null;var l=i.getBoundingClientRect(),t=l.width/(Number(i.getAttribute("width"))||l.width||1)||1,r=(e.clientX-l.left)/t,o=(e.clientY-l.top)/t;return r<0||o<n.top-8||o>n.top+n.height+8?null:r<n.left?"left":r>n.left+n.width?"right":null}(e);n!==Me&&tn(n)},onMouseLeave:function(){null!==Me&&tn(null)}}:{},_n=i.useRef({signature:"",placed:[]}),bn=U.some(function(e){return e.inlineLabel&&!Y.has(e.key)}),jn=function(e){var i,t=null==e?void 0:e.offset,r=null!==(i=null==e?void 0:e.formattedGraphicalItems)&&void 0!==i?i:[];if(!t||!r.length)return null;var o=Pe.filter(function(e){var n=e.series;return!Y.has(n.key)}),u=function(e){var n,i,l;return null!==(l=null===(i=null===(n=r.find(function(n){var i,l;return(null===(l=null===(i=null==n?void 0:n.item)||void 0===i?void 0:i.props)||void 0===l?void 0:l.dataKey)===e}))||void 0===n?void 0:n.props)||void 0===i?void 0:i.points)&&void 0!==l?l:[]},a=[];o.forEach(function(e){var n=e.series;u(n.key).forEach(function(e){var i,l,t=Array.isArray(null==e?void 0:e.value)?e.value[1]:null==e?void 0:e.value;if(e&&y(e.x)&&y(e.y)&&null!=t){if(!1!==n.showPoints){var r=(null!==(i=n.pointRadius)&&void 0!==i?i:3)+2;a.push({x:e.x-r,y:e.y-r,w:2*r,h:2*r,kind:"point"})}if(n.showValueLabels){var o=un(n,Number(t),null===(l=e.payload)||void 0===l?void 0:l.x,e.x,e.y);if("string"!=typeof o.text)return;var d=x(o.text,pe,me,fe),s=an(o.text,e.x,u(n.key));a.push({x:s-d/2,y:o.y-.85*pe,w:d,h:1.1*pe,kind:"number"})}}})});var s=o.map(function(e){var n,i=e.series,l="string"==typeof i.inlineLabel?i.inlineLabel:i.label;return{key:i.key,text:i.inlineLabel?l:"",points:(n=i.key,u(n).map(function(e){return e&&y(e.x)&&y(e.y)?{x:e.x,y:e.y}:null})),width:i.inlineLabel?x(l,ke,_e,fe):0,height:ke,curve:"linear"===i.curve?"linear":"step"===i.curve?"step":"monotone"}}),v=function(e){return Math.round(e)},c=JSON.stringify([[t.left,t.top,t.width,t.height].map(v),s.map(function(e){return[e.key,e.text,e.curve,e.points.map(function(e){return e?[v(e.x),v(e.y)]:0})]}),a.map(function(e){return[e.x,e.y,e.w].map(v)})]);return _n.current.signature!==c&&(_n.current={signature:c,placed:d.placeLineLabels(s,a,{x:t.left,y:t.top,w:t.width,h:t.height})}),l.jsx("g",n.__assign({className:"ellm-graph__series-names",pointerEvents:"none"},{children:_n.current.placed.map(function(e){var i=Pe.find(function(n){return n.series.key===e.key});return i?l.jsx("text",n.__assign({x:e.x,y:e.y,transform:"rotate(".concat(e.angle.toFixed(2)," ").concat(e.x," ").concat(e.y,")"),textAnchor:"middle",dominantBaseline:"central",fill:i.color,fontSize:ke,fontWeight:_e,opacity:nn(i.series)?ln:1,stroke:"#fff",strokeWidth:4,strokeLinejoin:"round",paintOrder:"stroke"},{children:e.text}),e.key):null})}))};return l.jsx("div",n.__assign({style:{display:"flex",flexDirection:"column",width:"100%"}},kn,{children:l.jsx(r.ChartContainer,n.__assign({config:Re,style:{height:ae,fontFamily:fe}},{children:function(){var e,o,a,d,v,f,x,m,k,_,b,j,C,L;return l.jsxs(t.ComposedChart,n.__assign({data:Fe,margin:yn,syncId:ie},le?{syncMethod:le}:{},{onMouseMove:function(e){var n;return Ae(null!==(n=null==e?void 0:e.activeLabel)&&void 0!==n?n:null)},onMouseLeave:function(){return Ae(null)}},{children:[l.jsx(t.CartesianGrid,n.__assign({vertical:Ze,horizontal:Ve,stroke:de},he?{strokeDasharray:"4 4"}:{})),Pe.some(function(e){var n=e.series;return n.area&&n.gradient})?l.jsx("defs",{children:Pe.filter(function(e){var n=e.series;return n.area&&n.gradient}).map(function(e){var i,t=e.series,r=e.color;return l.jsxs("linearGradient",n.__assign({id:je(t.key),x1:"0",y1:"0",x2:"0",y2:"1"},{children:[l.jsx("stop",{offset:"0%",stopColor:r,stopOpacity:null!==(i=t.areaOpacity)&&void 0!==i?i:.18}),l.jsx("stop",{offset:"100%",stopColor:r,stopOpacity:0})]}),t.key)})}):null,l.jsx(t.XAxis,n.__assign({dataKey:"x",type:"number"===We?"number":"category",hide:!Be,height:(null==J?void 0:J.label)?52:void 0,tickLine:!1,axisLine:!(null==J?void 0:J.hideLine)&&{stroke:he?de:se},tickMargin:8},(null==J?void 0:J.padding)?{padding:{left:null!==(e=J.padding.left)&&void 0!==e?e:0,right:null!==(o=J.padding.right)&&void 0!==o?o:0}}:{},{interval:"preserveStartEnd",tick:{fill:ce,fontSize:ge},tickFormatter:(null==J?void 0:J.formatTick)?function(e,n){return J.formatTick(e,n)}:void 0,label:(null==te?void 0:te.showReferenceAreaLabel)?function(e){return function(e){var i=e.viewBox;e.startTick,e.endTick;var t=i.x,r=i.y,o=i.width,u=1;if((null==te?void 0:te.showReferenceArea)&&null!=(null==te?void 0:te.referencePoint)&&Ne.length>1){var a=Ne.indexOf(te.referencePoint);-1!==a&&(u=a/(Ne.length-1))}var d=100*u,v=100-d;return l.jsx("foreignObject",n.__assign({x:t,y:r+24,width:o,height:40},{children:l.jsxs("div",n.__assign({className:"ellm-graph__liveLabelContainer"},{children:[(null==te?void 0:te.referenceAreaLabel)&&l.jsxs("div",n.__assign({style:{flex:d,display:"flex",alignItems:"center"}},{children:[l.jsx(s.default,{}),l.jsx("span",n.__assign({style:{padding:"0 12px",color:"#6b7280",fontSize:"12px"}},{children:null==te?void 0:te.referenceAreaLabel})),l.jsx(s.default,{})]})),v>0&&l.jsxs("div",n.__assign({style:{flex:v,display:"flex",alignItems:"center"}},{children:[l.jsx(s.default,{style:{backgroundColor:"#DC2626"}}),l.jsxs("div",n.__assign({className:"ellm-graph__liveLabel"},{children:[l.jsx(s.default,{style:{width:"8px",height:"8px",borderRadius:"100%",backgroundColor:"#DC2626",flex:"auto"},pulse:!0}),"LIVE - ",null==te?void 0:te.referenceAreaLiveLabel]})),l.jsx(s.default,{style:{backgroundColor:"#DC2626"}})]}))]}))}))}(n.__assign(n.__assign({},e),{startTick:Ne[0],endTick:Ne[Ne.length-1]}))}:(null==J?void 0:J.label)?{value:J.label,position:"insideBottom",offset:4,fill:ve,fontSize:null!=ye?ye:12,fontWeight:500}:void 0})),l.jsx(t.YAxis,n.__assign({},Qe("left"),{hide:!qe||!$e,domain:(null==Je?void 0:Je.left)?[Je.left.lo,Je.left.hi]:Ye},(null==Je?void 0:Je.left)?{ticks:Je.left.ticks,interval:0}:{},{tickLine:!1,axisLine:!1===(null==Q?void 0:Q.hideLine)&&{stroke:se},tickCount:null==Q?void 0:Q.tickCount,width:hn,tick:n.__assign(n.__assign({fill:null!==(a=null==Q?void 0:Q.color)&&void 0!==a?a:ce,fontSize:ge},on(null==Q?void 0:Q.color)),rn("left")),tickFormatter:(null==Q?void 0:Q.formatTick)?function(e,n){return Q.formatTick(e,n)}:function(e){return"number"==typeof e?u.compactNumber(e):String(e)},label:(null==Q?void 0:Q.label)?n.__assign(n.__assign({value:Q.label,angle:-90,position:"insideLeft",style:{textAnchor:"middle"},fill:null!==(d=null==Q?void 0:Q.color)&&void 0!==d?d:ve,fontSize:null!=ye?ye:he?11:12,fontWeight:null!=xe?xe:he?600:500},he?{letterSpacing:"0.02em"}:{}),rn("left")):void 0})),Xe?l.jsx(t.YAxis,n.__assign({yAxisId:"right",orientation:"right",hide:!1===(null===(v=null==Q?void 0:Q.right)||void 0===v?void 0:v.show),width:gn,domain:(null==Je?void 0:Je.right)?[Je.right.lo,Je.right.hi]:["auto","auto"]},(null==Je?void 0:Je.right)?{ticks:Je.right.ticks,interval:0}:{},{tickLine:!1,axisLine:!1,tickCount:null===(f=null==Q?void 0:Q.right)||void 0===f?void 0:f.tickCount,tick:n.__assign(n.__assign({fill:null!==(m=null===(x=null==Q?void 0:Q.right)||void 0===x?void 0:x.color)&&void 0!==m?m:ce,fontSize:ge},on(null===(k=null==Q?void 0:Q.right)||void 0===k?void 0:k.color)),rn("right")),tickFormatter:(null===(_=null==Q?void 0:Q.right)||void 0===_?void 0:_.formatTick)?function(e,n){return Q.right.formatTick(e,n)}:function(e){return"number"==typeof e?u.compactNumber(e):String(e)},label:(null===(b=null==Q?void 0:Q.right)||void 0===b?void 0:b.label)?n.__assign(n.__assign({value:Q.right.label,angle:90,position:"insideRight",style:{textAnchor:"middle"},fill:null!==(j=Q.right.color)&&void 0!==j?j:ve,fontSize:null!=ye?ye:he?11:12,fontWeight:null!=xe?xe:he?600:500},he?{letterSpacing:"0.02em"}:{}),rn("right")):void 0})):null,Ee&&l.jsx(r.ChartTooltip,{cursor:he?{stroke:"#94a3b8",strokeOpacity:.55,strokeWidth:1}:{stroke:se,strokeDasharray:"4 4"},content:function(e){var i,t=(null!==(i=e.payload)&&void 0!==i?i:[]).filter(function(e){var n=U.find(function(n){return n.key===e.dataKey});return!1!==(null==n?void 0:n.showInTooltip)&&!(De&&!De.has(String(e.dataKey)))});return(null==$?void 0:$.render)?$.render({x:e.label,points:t.map(function(n){var i;return{series:U.find(function(e){return e.key===n.dataKey}),value:null!==(i=n.value)&&void 0!==i?i:null,point:{x:e.label,y:n.value},color:n.color}})}):l.jsx(r.ChartTooltipContent,n.__assign({},e,{payload:t,hideLabel:!1===(null==$?void 0:$.showHeading),valueFormatters:ze,labelFormatter:(null==$?void 0:$.formatHeading)?function(e){return $.formatHeading(e)}:void 0}))}}),Ie&&l.jsx(r.ChartLegend,{verticalAlign:Ke,content:function(e){var i;return l.jsx(r.ChartLegendContent,n.__assign({},e,{payload:null===(i=e.payload)||void 0===i?void 0:i.filter(function(e){var n;return!1!==(null===(n=U.find(function(n){return n.key===e.dataKey}))||void 0===n?void 0:n.showInLegend)}),tier:G,verticalAlign:Ke,align:He,hiddenKeys:Y,activeThreshold:oe,onThresholdViewChange:ue,onItemClick:!1!==(null==ee?void 0:ee.toggle)&&X?X:void 0}))}}),(null==te?void 0:te.showReferenceArea)&&null!=(null==te?void 0:te.referencePoint)&&l.jsx(t.ReferenceArea,n.__assign({},Qe("left"),{x1:te.referencePoint,fill:null!==(C=te.referenceAreaFill)&&void 0!==C?C:"#2563EB1A"})),(null==te?void 0:te.showReferenceArea)&&null!=te.referencePoint&&l.jsx(t.ReferenceLine,n.__assign({},Qe("left"),{x:te.referencePoint,stroke:null!==(L=te.referenceLineStroke)&&void 0!==L?L:"#3B82F6",strokeDasharray:"4 4"})),(null==oe?void 0:oe[G])&&void 0!==Re[null==oe?void 0:oe[G]].threshold&&l.jsx(t.ReferenceLine,n.__assign({},Qe("left"),{y:Re[null==oe?void 0:oe[G]].threshold,stroke:"red",strokeWidth:1.5,strokeDasharray:"4 4",label:function(e){var i=e.viewBox;return l.jsx("text",n.__assign({x:i.x-8,y:i.y,textAnchor:"end",dominantBaseline:"middle",fill:"red",fontSize:11},{children:Re[null==oe?void 0:oe[G]].threshold}))}})),Pe.map(function(e){var i,r,o,u,a,d=e.series,s=Y.has(d.key),v="var(--color-".concat(d.key,")"),c=nn(d)?ln:1,f=!0===d.dashed?"6 5":"string"==typeof d.dashed?d.dashed:void 0,h=!1!==d.showPoints&&(d.fillPointsOnHover||re||d.showValueLabels||d.pointColor?function(e){var i,t,r,o,u,a,s,f=null===(i=e.payload)||void 0===i?void 0:i[d.key];if(null==f||!Number.isFinite(Number(f)))return l.jsx("g",{});var h=un(d,Number(f),null===(t=e.payload)||void 0===t?void 0:t.x,e.cx,e.cy),g=h.text,y=d.pointColor?d.pointColor({x:null===(r=e.payload)||void 0===r?void 0:r.x,y:Number(f)},null!==(o=e.index)&&void 0!==o?o:0):v;return l.jsxs("g",n.__assign({style:{cursor:re?"pointer":"default"},opacity:c,onClick:re?function(){var n;return xn(d.key,e.payload,null!==(n=e.index)&&void 0!==n?n:0)}:void 0},{children:[d.showValueLabels&&"string"==typeof g?l.jsx("text",n.__assign({x:an(g,e.cx,e.points),y:h.y,textAnchor:"middle",fill:null!==(u=d.valueLabelColor)&&void 0!==u?u:y,fontSize:pe,fontWeight:me},he?{stroke:"#fff",strokeWidth:3,strokeLinejoin:"round",paintOrder:"stroke"}:{},{children:g})):null,l.jsx("circle",{cx:e.cx,cy:e.cy,r:null!==(a=d.pointRadius)&&void 0!==a?a:3,fill:d.fillPointsOnHover&&Le===(null===(s=e.payload)||void 0===s?void 0:s.x)?y:"#fff",stroke:y,strokeWidth:2})]}))}:{r:null!==(i=d.pointRadius)&&void 0!==i?i:3,fill:"#fff",stroke:v,strokeWidth:2,opacity:c}),g=null!==(r=d.activePointRadius)&&void 0!==r?r:(null!==(o=d.pointRadius)&&void 0!==o?o:3)+2,x=!d.fillPointsOnHover&&(re?function(e){return y(e.cx)&&y(e.cy)?l.jsx("circle",{cx:e.cx,cy:e.cy,r:g,fill:he?v:e.fill,stroke:"#fff",strokeWidth:he?2.5:2,className:"recharts-dot",style:{cursor:"pointer"},onClick:function(){var n;return xn(d.key,e.payload,null!==(n=e.index)&&void 0!==n?n:0)}}):l.jsx("g",{})}:n.__assign({r:g},he?{fill:v,stroke:"#fff",strokeWidth:2.5}:{})),m=n.__assign(n.__assign(n.__assign(n.__assign({},Qe(d.yAxis)),{key:d.key,dataKey:d.key,name:d.key,type:p(d.curve),stroke:v,strokeWidth:null!==(u=d.strokeWidth)&&void 0!==u?u:2,strokeDasharray:f,strokeOpacity:c}),he?{strokeLinecap:"round",strokeLinejoin:"round"}:{}),{connectNulls:!1,isAnimationActive:!1,hide:s,dot:h,activeDot:x});return d.area?l.jsx(t.Area,n.__assign({},m,{fill:d.gradient?"url(#".concat(je(d.key),")"):v,fillOpacity:(d.gradient?1:null!==(a=d.areaOpacity)&&void 0!==a?a:.12)*c})):l.jsx(t.Line,n.__assign({},m))}),Pe.flatMap(function(e){var r,o=e.series,u=e.color;if(Y.has(o.key)||!(null===(r=o.markers)||void 0===r?void 0:r.length))return[];var a=new Map(o.data.map(function(e){var n=c(e.y);return[e.x,null==n?null:h(o,n,e.x)]}));return o.markers.map(function(e){var r,d=a.get(e.x);if(null==d)return null;var s=null!==(r=e.color)&&void 0!==r?r:u;return i.createElement(t.ReferenceDot,n.__assign({},Qe(o.yAxis),{key:"marker-".concat(o.key,"-").concat(e.x),x:e.x,y:d,ifOverflow:"extendDomain",shape:function(i){var t,r;return l.jsxs("g",n.__assign({style:{cursor:e.onClick?"pointer":"default"},opacity:nn(o)?ln:1,onClick:e.onClick,role:e.onClick?"button":void 0,"aria-label":e.label},{children:[e.label?l.jsx("title",{children:e.label}):null,l.jsx("circle",{cx:i.cx,cy:i.cy,r:null!==(t=e.haloRadius)&&void 0!==t?t:9,fill:s,fillOpacity:.16}),l.jsx("circle",{cx:i.cx,cy:i.cy,r:null!==(r=e.radius)&&void 0!==r?r:5,fill:o.fillPointsOnHover&&Le===e.x?s:"#fff",stroke:s,strokeWidth:2.5})]}))}}))})}),bn?l.jsx(t.Customized,{component:l.jsx(g,{render:jn})}):null,Xe&&(null==Q?void 0:Q.highlightOnHover)?l.jsx(t.Customized,{component:l.jsx(g,{render:mn})}):null]}))}()}))}))};
2
2
  //# sourceMappingURL=LineChart.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=[1,2,2.5,5,10],t=[1,2,2.5,4,5,10];function e(t,e){if(void 0===e&&(e=r),!(t>0&&Number.isFinite(t)))return 1;for(var a=Math.pow(10,Math.floor(Math.log10(t))),i=0,n=e;i<n.length;i++){var o=n[i];if(o*a>=t-1e-12)return o*a}return 10*a}var a=function(r,t){var e=Math.max(0,2-Math.floor(Math.log10(t)));return Number(r.toFixed(Math.min(e,10)))};exports.AXIS_STEPS=5,exports.axisDomain=function(r,i){var n=void 0===i?{}:i,o=n.fromZero,u=void 0!==o&&o,f=n.steps,h=void 0===f?5:f,l=n.paddingRatio,s=void 0===l?.25:l,M=r.filter(function(r){return Number.isFinite(r)});if(!M.length)return null;var v=Math.min.apply(Math,M),p=Math.max.apply(Math,M),m=function(r,t){return{lo:r,step:t,hi:r+t*h,ticks:Array.from({length:h+1},function(e,i){return a(r+t*i,t)})}};if(u&&v>=0)return m(0,e(1.08*p/h||1,t));p===v&&(p+=.1*Math.abs(p)||1,v-=.1*Math.abs(v)||1);for(var c=(p-v)*Math.max(0,s),d=e((p-v+2*c)/h),x=0;x<20;x++){var b=Math.floor((v-.5*c)/d)*d;if(v>=0&&b<0&&(b=0),b+d*h>=p+.5*c)return m(b,d);d=e(1.01*d)}return m(v,(p-v)/h)},exports.niceStep=e;
2
+ //# sourceMappingURL=axisDomain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axisDomain.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../_virtual/_tslib.js");function t(n,t,r,e){var a=Math.cos(e),u=Math.sin(e);return[[-t/2,-r/2],[t/2,-r/2],[t/2,r/2],[-t/2,r/2]].map(function(t){var r=t[0],e=t[1];return{x:n.x+r*a-e*u,y:n.y+r*u+e*a}})}var r=function(n){return{x0:Math.min.apply(Math,n.map(function(n){return n.x})),y0:Math.min.apply(Math,n.map(function(n){return n.y})),x1:Math.max.apply(Math,n.map(function(n){return n.x})),y1:Math.max.apply(Math,n.map(function(n){return n.y}))}},e=function(n,t){return n.x0<=t.x1&&t.x0<=n.x1&&n.y0<=t.y1&&t.y0<=n.y1};function a(n,t){for(var r=0,e=[n,t];r<e.length;r++)for(var a=e[r],u=0;u<a.length;u++){for(var o=a[u],i=a[(u+1)%a.length],l=i.y-o.y,s=o.x-i.x,f=1/0,x=-1/0,p=1/0,y=-1/0,h=0,c=n;h<c.length;h++){var v=(d=c[h]).x*l+d.y*s;f=Math.min(f,v),x=Math.max(x,v)}for(var m=0,M=t;m<M.length;m++){var d;v=(d=M[m]).x*l+d.y*s;p=Math.min(p,v),y=Math.max(y,v)}if(x<p||y<f)return!1}return!0}function u(n,t,r){return a([n,t],r)}var o=function(n){return n<0?-1:1};function i(n){var t=n.length,r=function(t){return(n[t+1].y-n[t].y)/(n[t+1].x-n[t].x||1)};if(t<3)return n.map(function(){return 2===t?r(0):0});for(var e=n.map(function(){return 0}),a=1;a<t-1;a++){var u=n[a].x-n[a-1].x,i=n[a+1].x-n[a].x,l=r(a-1),s=r(a),f=(l*i+s*u)/(u+i);e[a]=(o(l)+o(s))*Math.min(Math.abs(l),Math.abs(s),.5*Math.abs(f))||0}return e[0]=(3*r(0)-e[1])/2,e[t-1]=(3*r(t-2)-e[t-2])/2,e}function l(n){for(var t,r=null!==(t=n.curve)&&void 0!==t?t:"monotone",e=[],a=[],u=function(){a.length>=2&&e.push({pts:a,tangents:"monotone"===r?i(a):[],curve:r}),a=[]},o=0,l=n.points;o<l.length;o++){var s=l[o];s?a.push(s):u()}return u(),e}function s(n,t){var r=n.pts;if(t<r[0].x||t>r[r.length-1].x)return null;for(var e=0;e<r.length-2&&t>r[e+1].x;)e++;var a=r[e],u=r[e+1],o=u.x-a.x||1,i=(t-a.x)/o;if("linear"===n.curve)return a.y+(u.y-a.y)*i;if("step"===n.curve)return i<1?a.y:u.y;var l=o/3,s=a.y+l*n.tangents[e],f=u.y-l*n.tangents[e+1],x=1-i;return x*x*x*a.y+3*x*x*i*s+3*x*i*i*f+i*i*i*u.y}function f(n){for(var t=[],r=Math.max(2,.3*n.height),e=function(e){for(var a=function(n){return s(e,n)},u=0;u<e.pts.length-1;u++)for(var o=e.pts[u],i=e.pts[u+1],l=(o.x+i.x)/2,f=0;f<=(i.x-o.x)/2;f+=4)for(var x=0,p=f?[l-f,l+f]:[l];x<p.length;x++){var y=p[x],h=a(y),c=n.width/2,v=a(y-c),m=a(y+c);if(null!=h&&null!=v&&null!=m){var M=Math.atan2(m-v,2*c);if(v=a(y-(c=n.width/2*Math.cos(M))),m=a(y+c),null!=v&&null!=m){M=Math.atan2(m-v,2*c);for(var d=Math.sin(M),b=Math.cos(M),g=!0,w=0;w<=8&&g;w++){var _=y-c+2*c*w/8,P=a(_);(null==P||Math.abs(-(_-y)*d+(P-h)*b)>r)&&(g=!1)}g&&t.push({c:{x:y,y:h},rad:M,steep:Math.abs(180*M/Math.PI)>40})}}}},a=0,u=l(n);a<u.length;a++){e(u[a])}return t.map(function(n,t){return{s:n,n:t}}).sort(function(n,t){return Number(n.s.steep)-Number(t.s.steep)||n.n-t.n}).map(function(n){return n.s})}exports.labelPoly=t,exports.placeLineLabels=function(o,i,x){var p=[],y=i.map(function(n){var t=function(n){return[{x:n.x,y:n.y},{x:n.x+n.w,y:n.y},{x:n.x+n.w,y:n.y+n.h},{x:n.x,y:n.y+n.h}]}(n);return{poly:t,bounds:r(t),point:"point"===n.kind}}),h=o.map(function(n){return l(n).flatMap(function(n){for(var t,e=[],a=0;a<n.pts.length-1;a++)for(var u=n.pts[a].x,o=n.pts[a+1].x,i="linear"===n.curve?1:8,l=n.pts[a],f=1;f<=i;f++){var x=f===i?o:u+(o-u)*f/i,p=f===i?n.pts[a+1]:{x:x,y:null!==(t=s(n,x))&&void 0!==t?t:l.y};if("step"===n.curve&&f===i){var y={x:o,y:l.y};e.push({a:l,b:y,bounds:r([l,y])}),l=y}e.push({a:l,b:p,bounds:r([l,p])}),l=p}return e})}),c=function(n,t){var o=r(n);if(!function(n){return n.x0>=x.x&&n.x1<=x.x+x.w&&n.y0>=x.y&&n.y1<=x.y+x.h}(o))return null;if(p.some(function(t){return e(t.bounds,o)&&a(t.poly,n)}))return null;if(h.some(function(r,a){return a!==t&&r.some(function(t){return e(t.bounds,o)&&u(t.a,t.b,n)})}))return null;for(var i=0,l=0,s=y;l<s.length;l++){var f=s[l];if(e(f.bounds,o)&&a(f.poly,n)){var c=Math.max(1,(Math.min(f.bounds.x1,o.x1)-Math.max(f.bounds.x0,o.x0))*(Math.min(f.bounds.y1,o.y1)-Math.max(f.bounds.y0,o.y0)));i+=f.point?1e6:c}}return i},v=o.map(function(n,r){var e=n.width+6,a=n.height+3;return{line:n,index:r,options:n.text?f(n).map(function(n){return{spot:n,poly:t(n.c,e,a,n.rad)}}):[]}}).filter(function(n){return n.line.text}),m=new Map(v.map(function(n){var t=n.index,r=n.options;return[t,r.filter(function(n){var r=n.poly;return 0===c(r,t)}).length]}));return n.__spreadArray([],v,!0).sort(function(n,t){return m.get(n.index)-m.get(t.index)||n.index-t.index}).forEach(function(n){var t=n.line,e=n.index,a=function(n,t){for(var r=null,e=0,a=n;e<a.length;e++){var u=a[e],o=u.spot,i=u.poly,l=c(i,t);if(!(null==l||r&&l>=r.cost)&&(r={spot:o,poly:i,cost:l},0===l))break}return r}(n.options,e);if(a){var u=a.spot,o=a.poly,i={key:t.key,text:t.text,x:u.c.x,y:u.c.y,angle:180*u.rad/Math.PI};p.push({label:i,poly:o,bounds:r(o)})}}),p.map(function(n){return n.label})},exports.polysOverlap=a,exports.segmentHitsPoly=u;
2
+ //# sourceMappingURL=inlineLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inlineLabels.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../_virtual/_tslib.js"),e=require("react/jsx-runtime"),t=require("react"),i=require("../Graph/LineChart.js"),a=require("./insightsUtils.js"),o=require("./insightsFormat.js"),r=require("./insightsContextCore.js"),l=require("../RcaDecisionComponent/CitationMarkdown.js"),s=require("./agPrimitives.js"),u=function(n,e,t){return null==n||null==e||e===n?"#0F172A":(e>n?"up":"down")===t?"#10B981":"#F43F5E"},d="daily_colored_",c={chartHeight:260,yAxisWidth:70,gridColor:"#e2e8f0",axisColor:"#cbd5e1",axisLabelColor:"#64748b",tickColor:"#64748b"};var v=function(n,e){return null!=n&&null!=e&&0!==e?(n-e)/Math.abs(e)*100:null};function g(t){var i=t.pct,a=t.good;if(null==i||!Number.isFinite(i)||0===i)return null;var o=s.toneOf(i,a);return e.jsxs("span",n.__assign({className:"ag-tip__badge ag-tip__badge--".concat("good"===o?"good":"bad")},{children:[i<0?"↓":"↑"," ",Math.abs(i).toFixed(1),"%"]}))}function m(t){var i=t.series,a=t.hidden,o=t.onToggle;return i.length?e.jsx("div",n.__assign({className:"ellm-graph__legend ellm-chart__legend--bottom ellm-chart__legend--center"},{children:i.map(function(t){var i,r=null!==(i=t.color)&&void 0!==i?i:"#64748b",l=a.has(t.key);return e.jsxs("label",n.__assign({className:"ellm-graph__legend-item".concat(l?" ellm-graph__legend-item--off":""),style:{cursor:"pointer","--checkbox-color":r,color:r}},{children:[e.jsx("input",{type:"checkbox",className:"ellm-graph__legend-checkbox",checked:!l,onChange:function(){return o(t.key)},style:{borderColor:r,accentColor:r}}),t.label]}),t.key)})})):null}var p=["#06B6D4","#F59E0B","#3B82F6","#A855F7","#10B981","#EC4899","#64748B","#F04444","#14B8A6","#84CC16"],_=function(n){var e=n.slice(0,10).split("-").map(Number),t=e[0],i=e[1],a=e[2];return t?new Date(t,i-1,a).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}):n};exports.ActivityChart=function(l){var u,d=l.items,g=l.labelOf,f=l.goodOf,h=l.syncId,y=l.syncMethod,x=t.useMemo(function(){return Array.from(new Set(d.flatMap(function(n){return n.points.map(function(n){return n.x})}))).sort()},[d]),b=r.useInsights(),k=null!==(u=null==b?void 0:b.period.grain)&&void 0!==u?u:"day",j=function(n,e){return b?b.formatKpi(n,e):a.formatValue(e)},C=t.useMemo(function(){return d.map(function(n,e){var t=new Map(n.points.map(function(n){return[n.x,n.y]}));return{key:"act_".concat(n.kpiId.replace(/[^a-zA-Z0-9_]/g,"_"),"_").concat(e),label:g(n.kpiId),color:p[e%p.length],curve:"smooth",area:!1,data:x.map(function(n){var e;return{x:n,y:null!==(e=t.get(n))&&void 0!==e?e:null}}),valueFormatter:function(e){return j(n.kpiId,e)}}})},[d,x,g,b]),w=t.useState(function(){return new Set(C.slice(3).map(function(n){return n.key}))}),N=w[0],A=w[1],M=function(n){return A(function(e){var t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t})},F=t.useMemo(function(){var e=1===C.filter(function(n){return!N.has(n.key)}).length;return C.map(function(t){return n.__assign(n.__assign({},t),{showValueLabels:e})})},[C,N]);return x.length?e.jsx("div",n.__assign({className:"ag-chart"},{children:e.jsxs("div",n.__assign({className:"ellm-graph"},{children:[e.jsx(i.default,{tier:"decision-advantage-activity",series:F,hiddenKeys:N,onToggleSeries:M,syncId:h,syncMethod:y,onPointClick:function(){},xAxis:{label:"day"===k?"Date":o.longPeriod.axisTitle(k),categories:x,tickCount:8,minTickGap:24,formatTick:function(n){return o.shortPeriod(n,k)}},yAxis:{label:"Activity",beginAtZero:!0,fitWidth:!0,formatTick:function(n){var e;return b?b.formatKpiAxis(null===(e=d[0])||void 0===e?void 0:e.kpiId,Number(n)):a.formatValue(Number(n))}},tooltip:{render:function(t){var i=t.x,r=t.points,l=String(i),u=x.indexOf(l),c=r.filter(function(n){return!N.has(n.series.key)&&null!==n.value});return e.jsxs("div",n.__assign({className:"ag-tip ag-tip--wide"},{children:[e.jsx("div",n.__assign({className:"ag-tip__head"},{children:"day"===k?_(l):o.longPeriod(l,k)})),c.map(function(t){var i,o,r,c,g,m=d[C.findIndex(function(n){return n.key===t.series.key})],p=u>0&&null!==(r=null===(o=null===(i=C.find(function(n){return n.key===t.series.key}))||void 0===i?void 0:i.data[u-1])||void 0===o?void 0:o.y)&&void 0!==r?r:null,_=v(null!==(c=t.value)&&void 0!==c?c:null,p),h=m?s.toneOf(_,f(m.kpiId)):null;return e.jsxs("div",n.__assign({className:"ag-tip__metric"},{children:[e.jsxs("div",n.__assign({className:"ag-tip__line"},{children:[e.jsxs("span",{children:[e.jsx("i",{style:{background:t.color}}),t.series.label]}),e.jsx("strong",{children:j(null==m?void 0:m.kpiId,t.value)})]})),e.jsxs("div",n.__assign({className:"ag-tip__sub"},{children:[e.jsxs("span",{children:["Change ","day"===k?a.previousDayLabel(l):"vs previous ".concat(null!==(g=null==b?void 0:b.period.unit)&&void 0!==g?g:k)]}),e.jsx("span",n.__assign({className:"good"===h?"ag-tip__sub--good":"bad"===h?"ag-tip__sub--bad":void 0},{children:null==_?"—":"".concat(_<0?"↓":_>0?"↑":"→"," ").concat(Math.abs(_).toFixed(1),"%")}))]}))]}),t.series.key)})]}))}},legend:{show:!1},style:c}),e.jsx(m,{series:C,hidden:N,onToggle:M})]}))})):e.jsx("div",n.__assign({className:"ag-empty"},{children:"Activity is not available for this selection"}))},exports.TrendChart=function(p){var _,f,h=p.points,y=p.label,x=p.good,b=p.windows,k=p.extraLines,j=void 0===k?[]:k;p.highlightDay;var C=p.onOpenDay,w=p.onOpenAttention,N=p.syncId,A=p.syncMethod,M=p.kpiId,F=t.useState(function(){return new Set(["avg_fast","avg_long"])}),T=F[0],I=F[1],S=t.useMemo(function(){return h.map(function(n){return n.day})},[h]),D=r.useInsights(),L=null!==(_=null==D?void 0:D.period.grain)&&void 0!==_?_:"day",P=function(n,e){return void 0===e&&(e=M),D?D.formatKpi(e,n):a.formatValue(n)},B=null!==(f=null==D?void 0:D.period.adjective)&&void 0!==f?f:"Daily",q=t.useMemo(function(){var e=h.map(function(n){return n.substituted?"#94A3B8":s.movementColorHex(n.movementType,n.direction,x)}),t={curve:"smooth",area:!1,showInLegend:!1,showInTooltip:!1},i=h.slice(1).map(function(e,i){var a=i+1;return n.__assign(n.__assign({},t),{key:"".concat(d,"seg_").concat(a),label:"Daily segment ".concat(a),color:h[a].substituted||h[a-1].substituted?"#94A3B8":u(h[a-1].value,h[a].value,x),strokeWidth:2,showPoints:!1,pointRadius:0,data:h.map(function(n,e){return{x:n.day,y:e===a-1||e===a?n.value:null}})})}),a=Array.from(new Set(e)).map(function(i){return n.__assign(n.__assign({},t),{key:"".concat(d,"pts_").concat(i.slice(1)),label:"Daily points ".concat(i),color:i,strokeWidth:0,showPoints:!0,pointRadius:3,showValueLabels:!0,valueFormatter:function(n){return P(n)},data:h.map(function(n,t){return{x:n.day,y:e[t]===i?n.value:null}})})}),r=function(n,e,t,i){return{key:n,label:e,color:t,curve:"smooth",strokeWidth:1.5,dashed:!0,pointRadius:0,showPoints:!1,data:h.map(function(n){return{x:n.day,y:i(n)}}),valueFormatter:function(n){return P(n)}}};return n.__spreadArray(n.__spreadArray(n.__spreadArray(n.__spreadArray([{key:"daily_value",label:"".concat(B," ").concat(y),color:"#7549F2",curve:"smooth",strokeWidth:0,showPoints:!1,pointRadius:0,data:h.map(function(n){return{x:n.day,y:n.value}}),valueFormatter:function(n){return P(n)}}],i,!0),a,!0),[r("avg_fast",o.averageLineLabel(b.fast,b.unit),"#0B8043",function(n){return n.fast}),r("avg_slow",o.averageLineLabel(b.slow,b.unit),"#F5A623",function(n){return n.slow}),r("avg_long",o.averageLineLabel(b.long,b.unit),"#94A3B8",function(n){return n.long})],!1),j.map(function(n){return{key:"extra_".concat(n.key.replace(/[^a-zA-Z0-9_]/g,"_")),label:n.label,color:n.color,curve:"smooth",strokeWidth:2,pointRadius:3,data:n.data,valueFormatter:function(e){return P(e,n.key)}}}),!0)},[h,y,x,b,j,D,M,B]),W=t.useMemo(function(){return new Map(j.map(function(n){return["extra_".concat(n.key.replace(/[^a-zA-Z0-9_]/g,"_")),n.key]}))},[j]),E=function(e){return I(function(t){var i=new Set(t),a=!i.has(e);return("daily_value"===e?n.__spreadArray([e],q.filter(function(n){return n.key.startsWith(d)}).map(function(n){return n.key}),!0):[e]).forEach(function(n){return a?i.add(n):i.delete(n)}),i})},O=t.useMemo(function(){return q.filter(function(n){return!1!==n.showInLegend})},[q]);return h.filter(function(n){return null!=n.value}).length<2?e.jsx("div",n.__assign({className:"ag-empty"},{children:"Not enough history yet for a trend chart."})):e.jsxs("div",n.__assign({className:"ag-chart"},{children:[e.jsx("div",n.__assign({className:"ag-chart__movement"},{children:[["up"===x?"#10B981":"#F43F5E","Up"],["up"===x?"#F43F5E":"#10B981","Down"],["#5928ED","Trend"],["#0F172A","Same"],["#2563EB","Historic (no classification)"]].map(function(n){var t=n[0],i=n[1];return e.jsxs("span",{children:[e.jsx("i",{style:{background:t}})," ",i]},i)})})),e.jsxs("div",n.__assign({className:"ellm-graph"},{children:[e.jsx(i.default,{tier:"decision-advantage-trend",series:q,hiddenKeys:T,onToggleSeries:E,syncId:N,syncMethod:A,xAxis:{label:"day"===L?"Date":o.longPeriod.axisTitle(L),categories:S,tickCount:8,minTickGap:24,formatTick:function(n){return o.shortPeriod(n,L)}},yAxis:{label:y,beginAtZero:!0,fitWidth:!0,formatTick:function(n){return function(n){return D?D.formatKpiAxis(M,n):a.formatValue(n)}(Number(n))}},tooltip:{render:function(t){var i=t.x,a=h.find(function(n){return n.day===String(i)});if(!a)return null;var r=s.tooltipSafeColorHex(s.movementColorHex(a.movementType,a.direction,x)),u=a.headline?s.splitVerdict(function(n){var e,t,i=null!==(e=l.stripMarkup(n).trim().split(/\r?\n/,1)[0])&&void 0!==e?e:"",a=Array.from(i.matchAll(/[.!?](?=\s|$)/g));return a.length>=2?i.slice(0,(null!==(t=a[1].index)&&void 0!==t?t:i.length)+1):i}(a.headline)):null,d=q.filter(function(n){return!1!==n.showInTooltip&&!T.has(n.key)}).map(function(n){var e,t,i;return[n.label,null!==(t=null===(e=n.data.find(function(n){return n.x===a.day}))||void 0===e?void 0:e.y)&&void 0!==t?t:null,null!==(i=W.get(n.key))&&void 0!==i?i:M]});return e.jsxs("div",n.__assign({className:"ag-tip",style:{cursor:C?"pointer":void 0},onMouseDown:C?function(){return C(a)}:void 0},{children:[e.jsxs("div",n.__assign({className:"ag-tip__head"},{children:[e.jsx("span",{children:o.longPeriod(a.day,L)}),e.jsx(g,{pct:v(a.value,a.previous),good:x})]})),e.jsx("div",n.__assign({className:"ag-tip__rows"},{children:d.map(function(t){var i=t[0],a=t[1],o=t[2];return e.jsxs("div",n.__assign({className:"ag-tip__row"},{children:[e.jsx("span",{children:i}),e.jsx("span",{children:P(a,o)})]}),i)})})),e.jsxs("div",n.__assign({className:"ag-tip__verdict"},{children:[e.jsx("strong",n.__assign({style:{color:r}},{children:s.movementVerdictLabel(a.movementType,a.direction)})),a.criticality?e.jsxs("span",{children:[" · ",a.criticality]}):null,u?e.jsxs("div",n.__assign({className:"ag-tip__narrative"},{children:[u.prefix?e.jsxs(e.Fragment,{children:[e.jsx("span",n.__assign({className:"Good news"===u.prefix?"ag-verdict--good":"ag-verdict--bad"},{children:u.prefix}))," - "]}):null,u.rest]})):null,a.substituted?e.jsx("div",n.__assign({className:"ag-tip__narrative"},{children:a.substitutionMessage||"Substituted value"})):null,a.commentCount?e.jsxs("div",n.__assign({className:"ag-tip__narrative"},{children:[a.commentCount," comment",1===a.commentCount?"":"s"]})):null]})),a.excludedCount+a.flaggedCount>0?e.jsxs("button",n.__assign({type:"button",className:"ag-tip__cta",onMouseDown:function(n){n.stopPropagation(),null==w||w(a)}},{children:[a.excludedCount+a.flaggedCount," data point",a.excludedCount+a.flaggedCount===1?"":"s"," not included"]})):null,C?e.jsx("div",n.__assign({className:"ag-tip__cta"},{children:"Click point for full details →"})):null]}))}},legend:{show:!1},style:c,onPointClick:function(n){var e=n.index,t=h[e];t&&(null==C||C(t))}}),e.jsx(m,{series:O,hidden:T,onToggle:E})]}))]}))},exports.toTrendPoints=function(n){return n?n.points.map(function(e,t){var i,a,o,r,l,s,u,d,c,v,g,m,p,_,f,h,y,x,b,k,j,C,w,N,A,M,F,T=null!==(a=null===(i=n.points[t-1])||void 0===i?void 0:i.y)&&void 0!==a?a:null,I=null!==(r=null===(o=e.meta)||void 0===o?void 0:o.marker)&&void 0!==r?r:null,S=null!=e.y&&null!=T&&e.y!==T?e.y>T?"up":"down":null;return{day:e.x,value:e.y,previous:T,fast:null!==(s=null===(l=e.meta)||void 0===l?void 0:l.fastMa)&&void 0!==s?s:null,slow:null!==(d=null===(u=e.meta)||void 0===u?void 0:u.slowMa)&&void 0!==d?d:null,long:null!==(v=null===(c=e.meta)||void 0===c?void 0:c.longMa)&&void 0!==v?v:null,movementType:null!==(g=null==I?void 0:I.movementType)&&void 0!==g?g:null==e.y?null:"stable",direction:null!==(m=null!=S?S:null==I?void 0:I.direction)&&void 0!==m?m:null,headline:null!==(p=null==I?void 0:I.headline)&&void 0!==p?p:null,reportId:null!==(_=null==I?void 0:I.reportId)&&void 0!==_?_:null,criticality:null!==(f=null==I?void 0:I.criticality)&&void 0!==f?f:null,substituted:Boolean(null===(h=e.meta)||void 0===h?void 0:h.substituted),substitutionMessage:null!==(b=null===(x=null===(y=e.meta)||void 0===y?void 0:y.substitution)||void 0===x?void 0:x.message)&&void 0!==b?b:null,commentCount:null!==(j=null===(k=e.meta)||void 0===k?void 0:k.commentCount)&&void 0!==j?j:0,excludedCount:null!==(w=null===(C=e.meta)||void 0===C?void 0:C.excludedCount)&&void 0!==w?w:0,pendingCount:null!==(A=null===(N=e.meta)||void 0===N?void 0:N.pendingCount)&&void 0!==A?A:0,flaggedCount:null!==(F=null===(M=e.meta)||void 0===M?void 0:M.flaggedCount)&&void 0!==F?F:0}}):[]};
2
+ //# sourceMappingURL=AgCharts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgCharts.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),i=require("react"),a=require("lucide-react"),t=require("../RcaDecisionComponent/RcaDecisionComponent.js"),r=require("../Graph/LineChart.js"),o=require("../Graph/PlotBySelector.js"),l=require("../../api/insightsApi.js"),s=require("./insightsContextCore.js"),d=require("./insightsErrors.js"),u=require("./insightsUtils.js"),c=require("./insightsFormat.js"),g=require("./DrillTable.js"),v=require("./DriverActivity.js"),p=require("./drillDay.js"),h=require("./FilterNotice.js"),_=require("./agPrimitives.js"),m=require("./KpiChart.js"),f=require("./NeedsAttention.js"),y=10;function x(a){var t,r=this,o=a.entityKey,g=a.dataDay,v=s.useInsights(),p=i.useState(null),h=p[0],_=p[1],m=i.useState(null),f=m[0],y=m[1];if(u.useJob(h,null!==(t=null==v?void 0:v.api)&&void 0!==t?t:null,function(){_(null),null==v||v.refresh()}),!(null==v?void 0:v.viewer.isAdmin))return null;return n.jsxs("span",{children:[n.jsx("button",e.__assign({type:"button",className:"ins-link",disabled:Boolean(h),onClick:function(){return e.__awaiter(r,void 0,void 0,function(){var n,i,a,t;return e.__generator(this,function(e){switch(e.label){case 0:y(null),e.label=1;case 1:return e.trys.push([1,6,,7]),n={dataDay:g||c.periodStart(l.toIsoDay(v.range.endDate),v.period.grain),window:"both"},o?[4,l.generateLevelSummary(v.api,o,n)]:[3,3];case 2:return a=e.sent(),[3,5];case 3:return[4,l.generateInsightsSummary(v.api,n)];case 4:a=e.sent(),e.label=5;case 5:return(i=a).jobId?_(i.jobId):v.refresh(),[3,7];case 6:return t=e.sent(),y(d.insightsErrorText(t,"The summary couldn't be regenerated.")),[3,7];case 7:return[2]}})})}},{children:h?"Regenerating…":"Regenerate summary"})),f?n.jsx("span",e.__assign({className:"ins-error"},{children:f})):null]})}var b=function(e){return e.replace(/\b\w/g,function(e){return e.toUpperCase()})};function j(e,n){return n?"Decision Advantage is unavailable right now: ".concat(n.message):e?"waiting"===e.status?"The first morning run hasn't finished yet. This fills in after it.":"running"===e.status?"The AI is writing this report. It usually takes a minute or two.":"generated"!==e.status?"No report generated for this day.":null:null}function k(e,n,i){return i?null:j(e,n)}function w(e){return e.replace(/\{\{([^|}]*)\|[^}]*\}\}/g,"$1")}function N(a){var r,o,l,s=a.report,d=a.movementType,c=a.direction,g=a.good,v=a.loading,p=a.error,h=a.emptyText,m=i.useState(!1),f=m[0],y=m[1],x=i.useMemo(function(){return u.reportDecisioning(s)},[s]);if(i.useEffect(function(){return y(!1)},[null==s?void 0:s.reportId]),v)return n.jsx("div",e.__assign({className:"ag-summary"},{children:n.jsx(_.SkeletonLines,{widths:[28,96,72],label:"Loading summary"})}));var b=null==s?void 0:s.summary,k=null!==(r=null==b?void 0:b.headline)&&void 0!==r?r:"",w=Boolean(k),N=_.splitVerdict(k).prefix,D=Boolean(null==b?void 0:b.eyebrow)&&"Movement unavailable"!==(null==b?void 0:b.eyebrow),I=void 0!==d,C=D?b.eyebrow:I?_.movementVerdictLabel(d,c):N||"Summary",S=D?"good"===b.tone||"bad"===b.tone?_.verdictToneHex(b.tone):_.movementColorHex(b.movementType,b.movementDirection,g):I?_.movementColorHex(d,c,g):"Good news"===N?"#15803D":"Bad news"===N?"#E11D48":"#5928ED";return n.jsxs("div",e.__assign({className:"ag-summary"},{children:[n.jsx("p",e.__assign({className:"ag-summary__title",style:{color:w?S:"#64748b"}},{children:w?C:"No summary yet"})),n.jsxs("div",e.__assign({className:"ag-summary__text"},{children:[w?n.jsx(_.VerdictSentence,{text:k,good:g,citations:null===(o=null==b?void 0:b.cited)||void 0===o?void 0:o.citation,excelDisplay:"popup",excelHover:!0}):null!==(l=null!=h?h:j(s,p))&&void 0!==l?l:"Reports are written after each morning run.",w&&x?n.jsx("span",e.__assign({className:"ag-summary__brain"},{children:n.jsx(t.ReasoningTrigger,{open:f,onToggle:function(){return y(function(e){return!e})},label:"how the AI reached this summary"})})):null]})),f&&x?n.jsx("div",e.__assign({className:"ag-summary__reasoning"},{children:n.jsx(t.ReasoningPanel,{decisioning:x})})):null]}))}function D(e){var a,r,o,l,d,c=e.report,g=e.error,v=e.loading,p=e.emptyText,h=s.useInsights(),m=!v&&"generated"===(null==c?void 0:c.status),f=i.useMemo(function(){return m?u.reportDecisioning(c,null==c?void 0:c.footer):null},[m,c]),y=u.useOpenRow();return n.jsx(t.RcaDecisionComponent,{className:"ag-decision",title:null!==(a=null==h?void 0:h.labels.decisionAdvantageTitle)&&void 0!==a?a:"Decision Advantage",score:m?null==c?void 0:c.score:null,decisioning:f,notice:v||c||!p?k(c,g,v):p,afterSections:v?n.jsx(_.SkeletonLines,{widths:[22,92,84,66,22,88,74],label:"Loading Decision Advantage"}):null,rootCause:m?u.toRcaItems(null==c?void 0:c.rootCause,y,null===(r=null==h?void 0:h.decisionAdvantage)||void 0===r?void 0:r.rootCauseTags):[],rootCauseLayout:null===(o=null==h?void 0:h.decisionAdvantage)||void 0===o?void 0:o.rootCauseLayout,nextSteps:m?u.toRcaItems(null==c?void 0:c.nextSteps,y):[],excelHover:!0,autoScrollToCitedCell:!0,width:"100%",maxWidth:"none"},"".concat(null!==(l=null==c?void 0:c.reportId)&&void 0!==l?l:"pending",":").concat(null!==(d=null==c?void 0:c.generatedAt)&&void 0!==d?d:""))}var I=[{key:"drivers",label:"driversTab",info:"What moved the day's number the same way."},{key:"headwinds",label:"headwindsTab",info:"What moved against the day's number."},{key:"attention",label:"attentionTab",info:"The number moved, but activity doesn't explain it."}],C={drivers:"Nothing moved the day's way.",headwinds:"Nothing ran against the day.",attention:"No drivers for this day."},S={high:"High correlation",medium:"Medium correlation",low:"Low correlation",none:"No correlation"};function K(i){var t=i.on,r=i.onClick,o=i.disabled,l=void 0!==o&&o;return n.jsxs("button",e.__assign({type:"button",className:"ag-graph-pill".concat(t?" is-on":""),disabled:l,title:l?"A graph can show up to ".concat(y," rows"):void 0,onClick:function(e){e.stopPropagation(),r()}},{children:[n.jsx(a.TrendingUp,{"aria-hidden":"true"}),t?"In graph":l?"Graph full":"Add to graph"]}))}function A(i){var t=i.rank,r=i.category,o=i.name,l=i.chips,s=i.alignActivity,d=void 0!==s&&s,u=i.action,c=i.lines,g=i.cell,v=i.onOpen;return n.jsx("li",{children:n.jsxs("div",e.__assign({className:"ag-driver".concat(d?" ag-driver--aligned":"").concat(v?" is-clickable":""),role:v?"button":void 0,tabIndex:v?0:void 0,onClick:v,onKeyDown:v?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),v())}:void 0},{children:[n.jsxs("div",e.__assign({className:"ag-driver__main"},{children:[n.jsxs("span",e.__assign({className:"ag-driver__rank"},{children:[t,"."]})),n.jsxs("div",e.__assign({className:"ag-driver__body"},{children:[n.jsxs("div",e.__assign({className:"ag-driver__heading"},{children:[r?n.jsxs("span",e.__assign({className:"ag-driver__category"},{children:[r," >"]})):null,n.jsxs("div",e.__assign({className:"ag-driver__identity"},{children:[n.jsx("span",e.__assign({className:"ag-driver__name"},{children:o})),n.jsxs("div",e.__assign({className:"ag-driver__chips"},{children:[l,u]}))]}))]})),c]}))]})),n.jsxs("div",e.__assign({className:"ag-driver__cell"},{children:[g,v?n.jsx("span",e.__assign({className:"ag-driver__open","aria-hidden":"true"},{children:n.jsx(a.ArrowUpRight,{})})):null]}))]}))})}function T(i){var a,t=i.label,r=i.rightLabel,o=i.children,l=s.useInsights();return n.jsxs("div",e.__assign({className:"ag-drivers"},{children:[n.jsxs("div",e.__assign({className:"ag-drivers__head"},{children:[n.jsx("span",{children:t}),n.jsx("span",{children:null!==(a=null!=r?r:null==l?void 0:l.labels.activityColumn)&&void 0!==a?a:"User Activity"})]})),n.jsx("ol",{children:o})]}))}var L=["#4F46E5","#64748B","#0F766E","#7C3AED","#475569","#818CF8","#94A3B8"],P=function(e,n){void 0===n&&(n="en-GB");var i=e.slice(0,10).split("-").map(Number),a=i[0],t=i[1],r=i[2];return Number.isFinite(a)&&Number.isFinite(t)&&Number.isFinite(r)?new Intl.DateTimeFormat(n,{day:"numeric",month:"short"}).format(new Date(a,t-1,r)):e};function R(t){var o,g,v,p,h,f,y,x,b,j,k,w,N,D,I,C=this,K=t.dataDay,A=t.nodeKey,T=void 0===A?"root":A,R=t.kpiId,F=t.dayGroup,M=s.useInsights(),B=null!==(o=null!=R?R:null==M?void 0:M.headlineKpi)&&void 0!==o?o:void 0,O=i.useMemo(function(){var e,n;return m.chartColors(null===(e=null==M?void 0:M.decisionAdvantage)||void 0===e?void 0:e.trendChart,Object.keys(null!==(n=null==M?void 0:M.kpis)&&void 0!==n?n:{}))},[null===(g=null==M?void 0:M.decisionAdvantage)||void 0===g?void 0:g.trendChart,null==M?void 0:M.kpis]),E=O.configured||Boolean(null===(p=null===(v=null==M?void 0:M.decisionAdvantage)||void 0===v?void 0:v.trendChart)||void 0===p?void 0:p.dualAxis),q=i.useCallback(function(e,n){return E?O.kpi(e):L[Math.max(0,n)%L.length]},[E,O]),G=i.useState(""),H=G[0],W=G[1],U=i.useState([]),z=U[0],V=U[1],Z=i.useState({}),$=Z[0],J=Z[1],X=i.useState(""),Q=X[0],Y=X[1],ee=i.useState(null),ne=ee[0],ie=ee[1],ae=i.useState(null),te=ae[0],re=ae[1],oe=i.useState(!1),le=oe[0],se=oe[1],de=i.useState(!1),ue=de[0],ce=de[1],ge=i.useRef(null),ve=M?l.toIsoDay(M.range.startDate):"",pe=K&&ve>K?K:ve,he=u.useInsightsFetch(M&&B&&K?function(n){return l.fetchInsightsCorrelation(M.api,T,e.__assign({kpiId:B,dataDay:K,startDate:pe,endDate:l.toIsoDay(M.range.endDate),filters:M.range.filters},$),n)}:null,[null==M?void 0:M.api.configId,null==M?void 0:M.rangeKey,K,B,T,$.disregardBefore,null===(h=$.disregardDates)||void 0===h?void 0:h.join(","),null==M?void 0:M.revision]),_e=he.data,me=he.error,fe=he.loading,ye=u.useInsightsFetch(M&&B&&K?function(n){return l.fetchInsightsCorrelationTrend(M.api,T,e.__assign({kpiId:B,startDate:l.toIsoDay(M.range.startDate),endDate:l.toIsoDay(M.range.endDate),filters:M.range.filters},$),n)}:null,[null==M?void 0:M.api.configId,null==M?void 0:M.rangeKey,K,B,T,$.disregardBefore,null===(f=$.disregardDates)||void 0===f?void 0:f.join(","),null==M?void 0:M.revision]);u.useJob(te,null!==(y=null==M?void 0:M.api)&&void 0!==y?y:null,function(){re(null),Y(""),null==M||M.refresh()}),i.useEffect(function(){if(le){var e=function(e){ge.current&&!ge.current.contains(e.target)&&se(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}}},[le]);var xe=i.useState(new Set),be=xe[0],je=xe[1],ke=i.useMemo(function(){if(!_e)return[];return _e.series.filter(function(e){return!(null==F?void 0:F.length)||F.map(Number).includes((n=e.x,new Date("".concat(n.slice(0,10),"T00:00:00")).getDay()||7));var n})},[_e,F]),we=i.useMemo(function(){return _e?e.__spreadArray([_e.kpiId],_e.drivers.map(function(e){return e.kpiId}).filter(function(e){return e!==_e.kpiId}),!0):[]},[_e]),Ne=i.useMemo(function(){return _e&&M?we.map(function(e,n){var i=ke.map(function(n){var i,a;return n.disregarded?null:null!==(a=null===(i=n.values)||void 0===i?void 0:i[e])&&void 0!==a?a:null}),a=i.find(function(e){return"number"==typeof e&&0!==e});return{key:"corr_".concat(e.replace(/[^a-zA-Z0-9_]/g,"_")),label:M.kpiLabel(e),color:q(e,n),curve:"smooth",strokeWidth:2,pointRadius:2,data:ke.map(function(e,n){return{x:e.x,y:null==i[n]||null==a?null:Math.round((i[n]-a)/Math.abs(a)*1e3)/10}}),valueFormatter:function(e){return"".concat(e,"%")}}}):[]},[_e,M,ke,we,q]),De=Boolean(null===(b=null===(x=null==M?void 0:M.decisionAdvantage)||void 0===x?void 0:x.trendChart)||void 0===b?void 0:b.dualAxis),Ie=null===(k=null===(j=null==M?void 0:M.decisionAdvantage)||void 0===j?void 0:j.trendChart)||void 0===k?void 0:k.correlation,Ce=Math.max(1,Math.min(8,Number(null==Ie?void 0:Ie.maxKpis)||5)),Se=i.useState(null),Ke=Se[0],Ae=Se[1],Te=i.useState(new Set),Le=Te[0],Pe=Te[1],Re=i.useMemo(function(){var n,i;if(Ke)return Ke.filter(function(e){return we.includes(e)});var a=(null!==(n=null==Ie?void 0:Ie.defaultKpis)&&void 0!==n?n:[]).filter(function(e){return we.includes(e)});return(a.length?e.__spreadArray([null!==(i=null==_e?void 0:_e.kpiId)&&void 0!==i?i:""],a.filter(function(e){return e!==(null==_e?void 0:_e.kpiId)}),!0):we.slice(0,2)).filter(Boolean).slice(0,Ce)},[Ke,we,null==Ie?void 0:Ie.defaultKpis,null==_e?void 0:_e.kpiId,Ce]);i.useEffect(function(){return je(new Set(Ne.slice(2).map(function(e){return e.key})))},[Ne]);if(!M||!K||"no_drivers"===(null==_e?void 0:_e.state)||_e&&!_e.verdictText)return null;if(me)return n.jsxs("div",e.__assign({className:"ag-empty"},{children:["Correlation is unavailable right now: ",me.message]}));if(fe&&!_e)return n.jsx(_.ChartSkeleton,{height:220,label:"Loading correlation"});if(!_e)return null;var Fe=null!==(w=_e.strength)&&void 0!==w?w:"none",Me="day"===M.period.grain?"today":"this ".concat(M.period.unit),Be=M.kpiLabel(_e.kpiId);return n.jsx(_.CollapsibleVisualSection,e.__assign({title:"Correlation",meta:M.labels.correlationTitle.replace("{kpi}",Be),className:"ag-visual--card",defaultExpanded:!1,action:M.viewer.isAdmin&&!De?n.jsxs("div",e.__assign({ref:ge,className:"ag-corr__settings"},{children:[n.jsx("button",e.__assign({type:"button",className:"ag-icon-button","aria-label":"Correlation settings","aria-expanded":le,onClick:function(){return se(function(e){return!e})}},{children:n.jsx(a.Settings2,{"aria-hidden":"true"})})),le?n.jsx("div",e.__assign({className:"ag-corr__settings-menu",role:"menu"},{children:n.jsxs("label",{children:[n.jsx("input",{type:"checkbox",checked:ue,onChange:function(e){return ce(e.target.checked)}}),"Show date controls"]})})):null]})):null},{children:n.jsxs("div",e.__assign({className:"ag-corr"},{children:[n.jsx("p",e.__assign({className:"ag-corr__banner ag-corr__banner--".concat(Fe)},{children:_e.verdictText})),n.jsx("span",e.__assign({className:"ag-driver__badge ag-driver__badge--".concat(Fe)},{children:S[Fe]})),n.jsx("p",e.__assign({className:"ag-corr__caption"},{children:M.labels.correlationSubtitle.replace("{kpi}",Be)})),(null===(N=_e.window)||void 0===N?void 0:N.source)?n.jsx("p",e.__assign({className:"ag-muted"},{children:"default"===_e.window.source?_e.window.startDate?"Using all ".concat(M.period.unit,"s since ").concat("day"===M.period.grain?P(_e.window.startDate,"en-US"):c.longPeriod(_e.window.startDate,M.period.grain)):"Using all available ".concat(M.period.unit,"s"):"row"===_e.window.source?"Saved window".concat(_e.window.startDate?" since ".concat(P(_e.window.startDate,"en-US")):"").concat((null===(D=_e.window.excludedDates)||void 0===D?void 0:D.length)?" · ".concat(_e.window.excludedDates.length," left out"):""):"Preview window".concat((null===(I=_e.window.excludedDates)||void 0===I?void 0:I.length)?" · ".concat(_e.window.excludedDates.length," left out"):"")})):null,n.jsxs("div",e.__assign({className:"ag-chart"},{children:[n.jsx("div",e.__assign({className:"ellm-graph"},{children:n.jsx(r.default,{tier:"decision-advantage-correlation",series:De?Ne.filter(function(e){return Re.some(function(n){return e.key==="corr_".concat(n.replace(/[^a-zA-Z0-9_]/g,"_"))})}):Ne,hiddenKeys:De?Le:be,onToggleSeries:function(e){return je(function(n){var i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},onPointClick:function(){},xAxis:{label:"day"===M.period.grain?"Date":c.longPeriod.axisTitle(M.period.grain),categories:ke.map(function(e){return e.x}),formatTick:function(e){return c.shortPeriod(e,M.period.grain)}},yAxis:{label:"% change",beginAtZero:!1,formatTick:function(e){return"".concat(Math.round(Number(e)).toLocaleString("en-US"),"%")}},tooltip:{render:function(i){var a,t=i.x,r=i.points,o=String(t),l=null===(a=ye.data)||void 0===a?void 0:a.series.find(function(e){return e.x===o});return n.jsxs("div",e.__assign({className:"ag-tip ag-tip--wide"},{children:[n.jsx("div",e.__assign({className:"ag-tip__head"},{children:"day"===M.period.grain?P(o):c.longPeriod(o,M.period.grain)})),r.filter(function(e){return null!=e.value}).map(function(i){return n.jsxs("div",e.__assign({className:"ag-tip__line"},{children:[n.jsxs("span",{children:[n.jsx("i",{style:{background:i.color}}),i.series.label]}),n.jsxs("strong",{children:[i.value,"%"]})]}),i.series.key)}),l?Object.keys(l.r).map(function(i){var a,t;return n.jsxs("div",e.__assign({className:"ag-tip__sub"},{children:[n.jsx("span",{children:M.kpiLabel(i)}),n.jsx("span",{children:null==l.r[i]?"No correlation":"r ".concat(l.r[i]," · ").concat(null!==(a=l.strength[i])&&void 0!==a?a:"none"," · ").concat(null!==(t=l.nObs[i])&&void 0!==t?t:0," ").concat(M.period.unit,"s")})]}),i)}):null]}))}},legend:De?{show:!1}:{position:"bottom",toggle:!0},style:{chartHeight:220,yAxisWidth:De?84:60,gridColor:"#e2e8f0",axisColor:"#cbd5e1",axisLabelColor:"#64748b",tickColor:"#64748b"}})})),De?n.jsxs("div",e.__assign({className:"kc__foot"},{children:[n.jsx("div",e.__assign({className:"kc__legend"},{children:Re.map(function(i){var a="corr_".concat(i.replace(/[^a-zA-Z0-9_]/g,"_")),t=Le.has(a);return n.jsxs("label",e.__assign({className:"kc__legend-item".concat(t?" is-off":""),style:{"--kc-color":q(i,we.indexOf(i))}},{children:[n.jsx("input",{type:"checkbox",checked:!t,onChange:function(){return Pe(function(e){var n=new Set(e);return n.has(a)?n.delete(a):n.add(a),n})}}),M.kpiLabel(i)]}),i)})})),n.jsx(m.KpiPicker,{oneAxis:!0,selected:Re,onChange:function(e){return Ae(e.slice(0,Ce))},groups:[{label:"Correlated KPIs",kpis:we}],averageKpis:[],max:Ce,insights:M,colorOf:function(e){return q(e,we.indexOf(e))}})]})):null]})),n.jsx("div",e.__assign({className:"ag-corr__metrics"},{children:_e.drivers.map(function(i){var a,t=null!==(a=i.strength)&&void 0!==a?a:"none";return n.jsxs("div",e.__assign({className:"ag-corr__metric"},{children:[n.jsx("span",e.__assign({className:"ag-corr__name"},{children:i.label||M.kpiLabel(i.kpiId)})),i.kpiId!==_e.kpiId?n.jsx("span",e.__assign({className:"ag-driver__badge ag-driver__badge--".concat(t)},{children:S[t]})):null,n.jsx("strong",{children:M.formatKpi(i.kpiId,i.value)}),n.jsx("span",e.__assign({className:"ag-corr__delta"},{children:null!=i.deltaPct?n.jsxs(n.Fragment,{children:[n.jsxs("span",e.__assign({className:"ag-dod__value ag-dod__value--".concat(i.tone||"flat")},{children:["up"===i.direction?"↑":"down"===i.direction?"↓":"→"," ",Math.abs(i.deltaPct),"%"]}))," vs. ",M.formatKpi(i.kpiId,i.previous)]}):"—"})),i.kpiId!==_e.kpiId?n.jsxs("span",e.__assign({className:"ag-corr__r"},{children:[i.nObs," ",M.period.unit,"s used",i.lowHistory?" · Low history":"",n.jsx("br",{}),null==i.movedWithToday?"No comparison for ".concat(Me):i.movedWithToday?"Moved together with the headline ".concat(Me):"Moved opposite the headline ".concat(Me)]})):null]}),i.kpiId)})})),M.viewer.isAdmin&&ue?n.jsxs("div",e.__assign({className:"ag-corr__window"},{children:[n.jsxs("label",e.__assign({className:"ag-corr__start"},{children:["Ignore data before ",n.jsx("input",{type:"date",value:H,onChange:function(e){return W(e.target.value)}})]})),n.jsxs("div",e.__assign({className:"ag-corr__days-label"},{children:["Or leave out individual dates (",z.length," selected)"]})),n.jsx("div",e.__assign({className:"ag-corr__days","aria-label":"Days to leave out"},{children:_e.series.map(function(i){return n.jsx("button",e.__assign({type:"button","aria-pressed":z.includes(i.x),className:z.includes(i.x)?"is-selected":void 0,onClick:function(){return n=i.x,V(function(i){return i.includes(n)?i.filter(function(e){return e!==n}):e.__spreadArray(e.__spreadArray([],i,!0),[n],!1)});var n}},{children:P(i.x)}),i.x)})})),n.jsx("input",{className:"ag-corr__reason",value:Q,onChange:function(e){return Y(e.target.value)},placeholder:"Reason required to apply"}),ne?n.jsx("p",e.__assign({className:"ins-error"},{children:ne})):null,n.jsxs("div",e.__assign({className:"ag-corr__actions"},{children:[n.jsx("button",e.__assign({type:"button",className:"ins-link",onClick:function(){return J({disregardBefore:H||void 0,disregardDates:z})}},{children:"Preview"})),n.jsx("button",e.__assign({type:"button",className:"ins-button",disabled:Boolean(te),onClick:function(){return e.__awaiter(C,void 0,void 0,function(){var n,i;return e.__generator(this,function(e){switch(e.label){case 0:if(!M||!B||!Q.trim())return ie("A reason is required."),[2];ie(null),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,l.saveCorrelationWindow(M.api,T,{kpiId:B,startDate:H||null,excludedDates:z,dataDay:K,changeReason:Q.trim(),regenerate:!0})];case 2:return n=e.sent(),re(n.jobId),[3,4];case 3:return i=e.sent(),ie(d.insightsErrorText(i,"The correlation window couldn't be saved.")),[3,4];case 4:return[2]}})})}},{children:"Apply"})),n.jsx("button",e.__assign({type:"button",className:"ins-link",onClick:function(){W(""),V([]),J({})}},{children:"Clear"}))]}))]})):null]}))}))}var F=function(e){var n;return(null===(n=null==e?void 0:e.period)||void 0===n?void 0:n.end)||null};function M(e,n){var i,a;return"day"!==n.period.grain&&(!("generated"!==(null===(i=null==e?void 0:e.report)||void 0===i?void 0:i.status)||!(null===(a=e.context)||void 0===a?void 0:a.period))&&!c.periodInRange(e.context.period,l.toIsoDay(n.range.startDate),l.toIsoDay(n.range.endDate),n.period.grain))}function B(e,n){var i,a,t=(null===(i=null==e?void 0:e.period)||void 0===i?void 0:i.label)||_.periodHeading(null===(a=null==e?void 0:e.period)||void 0===a?void 0:a.end,n);return t?"No report in the selected dates. The latest one is for ".concat(t,"."):"No report in the selected dates."}function O(i){var a=i.kpis,t=i.value,r=i.onChange,l=s.useInsights();return l&&a.length?n.jsx("div",e.__assign({className:"ag-plotby"},{children:n.jsx(o.default,{config:{options:a.map(function(e){return{label:l.kpiLabel(e),value:e}}),label:"Plot By",hideWhenSingle:!1,triggerIcon:null},value:t,onChange:r})})):null}var E=["#06B6D4","#10A66A","#8650FF","#F59E0B","#E94BBD","#4285FF","#64748B","#F04444","#14B8A6","#84CC16"];function q(a){var t,o,d=a.entityKey,g=a.kpis,v=a.nodeKeys,p=a.workingDays,h=a.group,f=a.onOpenPoint,x=a.syncId,b=a.kpi,j=s.useInsights(),k=i.useState(null!==(t=g[0])&&void 0!==t?t:""),w=k[0],N=k[1];i.useEffect(function(){var e;g.includes(w)||N(null!==(e=g[0])&&void 0!==e?e:"")},[g,w]);var D=void 0!==b&&g.includes(b)?b:w,I=u.useInsightsFetch(j&&D&&null!==h&&0!==(null==v?void 0:v.length)?function(n){return l.fetchInsightsSeries(j.api,e.__assign(e.__assign({},j.range),{workingDaysOnly:p,group:h||void 0}),v?{kpiIds:[D],nodeKeys:v.slice(0,y)}:{kpiIds:[D],entityKey:d,topN:3},n)}:null,[null==j?void 0:j.api.configId,null==j?void 0:j.rangeKey,d,D,null==v?void 0:v.join(","),p,h,null==j?void 0:j.revision]),C=I.data,S=I.loading,K=I.error,A=i.useMemo(function(){var e;return 0===(null==v?void 0:v.length)?[]:(null!==(e=null==C?void 0:C.series)&&void 0!==e?e:[]).filter(function(e){return e.kpiId===D&&e.points.some(function(e){return Number.isFinite(e.y)})})},[C,v,D]),T=i.useState(new Set),L=T[0],P=T[1],R=i.useState({}),F=R[0],M=R[1];i.useEffect(function(){P(new Set),M({})},[A]);var B=function(e){return P(function(n){var i=new Set(n);return i.has(e)?i.delete(e):i.size<A.length-1&&i.add(e),i})},O=i.useMemo(function(){return Array.from(new Set(A.flatMap(function(e){return e.points.map(function(e){return e.x})}))).sort()},[A]),q=i.useMemo(function(){var e,n;return m.chartColors(null===(e=null==j?void 0:j.decisionAdvantage)||void 0===e?void 0:e.trendChart,Object.keys(null!==(n=null==j?void 0:j.kpis)&&void 0!==n?n:{}))},[null===(o=null==j?void 0:j.decisionAdvantage)||void 0===o?void 0:o.trendChart,null==j?void 0:j.kpis]),G=q.configured?q.rows:E,H=i.useMemo(function(){return A.map(function(e,n){var i,a,t=new Map(e.points.map(function(e){return[e.x,e.y]})),r=null!==(i=null==j?void 0:j.goodDirection(e.kpiId))&&void 0!==i?i:"up",o="row_".concat(n,"_").concat(e.nodeKey.replace(/[^a-zA-Z0-9_]/g,"_")),l=G[n%G.length];return{key:o,label:e.label||e.nodeKey,color:l,curve:"smooth",pointRadius:3,activePointRadius:3,fillPointsOnHover:!0,showValueLabels:null!==(a=F[o])&&void 0!==a&&a,valueLabelColor:l,data:O.map(function(e){var n;return{x:e,y:null!==(n=t.get(e))&&void 0!==n?n:null}}),valueFormatter:function(n){return j?j.formatKpi(e.kpiId,n):String(n)},markers:e.points.filter(function(e){var n;return null===(n=e.meta)||void 0===n?void 0:n.marker}).map(function(n){return{x:n.x,color:_.movementColorHex(n.meta.marker.movementType,n.meta.marker.direction,r),label:[n.meta.marker.criticality,n.meta.marker.headline].filter(Boolean).join(" · "),radius:3,haloRadius:3,onClick:function(){var i,a=null!==(i=e.label)&&void 0!==i?i:e.nodeKey;f?f({nodeKey:e.nodeKey,label:a,kpiId:e.kpiId,dataDay:n.x,reportId:n.meta.marker.reportId}):null==j||j.openReport(n.meta.marker.reportId?{reportId:n.meta.marker.reportId,title:"".concat(a," · ").concat(c.shortPeriod(n.x,null==j?void 0:j.period.grain))}:{nodeKey:e.nodeKey,kpiId:e.kpiId,dataDay:n.x,title:"".concat(a," · ").concat(c.shortPeriod(n.x,null==j?void 0:j.period.grain))})}}})}})},[A,O,j,f,G,F]);if(!j)return null;var W=j.kpiLabel(D);return n.jsxs("div",e.__assign({className:"ag-row-trend"},{children:[g.length>1&&void 0===b?n.jsx("div",e.__assign({className:"ag-chart__switch",role:"group","aria-label":"Number"},{children:g.map(function(i){return n.jsx("button",e.__assign({type:"button","aria-pressed":i===D,className:i===D?"is-active":void 0,onClick:function(){return N(i)}},{children:j.kpiLabel(i)}),i)})})):null,K?n.jsx("div",e.__assign({className:"ag-empty"},{children:"This chart is unavailable right now."})):S||null===h&&0!==(null==v?void 0:v.length)?n.jsx(_.ChartSkeleton,{height:240,label:"Loading trend"}):0===(null==v?void 0:v.length)?n.jsx("div",e.__assign({className:"ag-empty"},{children:"Use “Add to graph” on a row to draw it here."})):O.length?n.jsx("div",e.__assign({className:"ag-chart"},{children:n.jsxs("div",e.__assign({className:"ellm-graph"},{children:[n.jsx(r.default,{tier:"decision-advantage-".concat(d),syncId:x,syncMethod:"value",series:H,hiddenKeys:L,onToggleSeries:B,onPointClick:function(e){var n,i,a,t,r,o,l=e.series,s=e.point,d=e.index,u=H.findIndex(function(e){return e.key===l.key}),g=A[u],v=null!==(n=s.x)&&void 0!==n?n:null===(i=l.data[d])||void 0===i?void 0:i.x,p=null==g?void 0:g.points.find(function(e){return e.x===String(v)});if(g&&p){var h=null!==(a=g.label)&&void 0!==a?a:g.nodeKey,_=null!==(o=null===(r=null===(t=p.meta)||void 0===t?void 0:t.marker)||void 0===r?void 0:r.reportId)&&void 0!==o?o:null;f?f({nodeKey:g.nodeKey,label:h,kpiId:g.kpiId,dataDay:p.x,reportId:_}):j.openReport(_?{reportId:_,title:"".concat(h," · ").concat(c.shortPeriod(p.x,j.period.grain))}:{nodeKey:g.nodeKey,kpiId:g.kpiId,dataDay:p.x,title:"".concat(h," · ").concat(c.shortPeriod(p.x,j.period.grain))})}},xAxis:{label:"day"===j.period.grain?"Date":c.longPeriod.axisTitle(j.period.grain),categories:O,tickCount:8,minTickGap:24,formatTick:function(e){return c.shortPeriod(e,j.period.grain)}},yAxis:{label:W,beginAtZero:!0,fitWidth:!0,formatTick:function(e){var n;return j.formatKpiAxis(null===(n=A[0])||void 0===n?void 0:n.kpiId,Number(e))}},tooltip:{formatHeading:function(e){return c.longPeriod(e,j.period.grain)}},legend:{show:!1},style:{chartHeight:240,yAxisWidth:70,gridColor:"#e2e8f0",axisColor:"#cbd5e1",axisLabelColor:"#64748b",tickColor:"#64748b"}}),n.jsx("div",e.__assign({className:"kc__foot"},{children:n.jsx("div",e.__assign({className:"kc__legend"},{children:H.map(function(i){var a=L.has(i.key),t=Boolean(i.showValueLabels);return n.jsxs("div",e.__assign({className:"kc__legend-item ag-legend-item".concat(a?" is-off":""),style:{"--kc-color":i.color}},{children:[n.jsx("input",{type:"checkbox",checked:t&&!a,disabled:a,onChange:function(){return M(function(n){var a;return e.__assign(e.__assign({},n),((a={})[i.key]=!t,a))})},"aria-label":"Numbers on ".concat(i.label),title:t?"Hide the numbers on this line":"Show the numbers on this line"}),n.jsxs("button",e.__assign({type:"button",className:"kc__legend-series","aria-pressed":!a,onClick:function(){return B(i.key)},title:a?"Show ".concat(i.label):"Hide ".concat(i.label)},{children:[n.jsx("i",{className:"kc__legend-line","aria-hidden":"true"}),n.jsx("span",{children:i.label})]}))]}),i.key)})}))}))]}))})):n.jsx("div",e.__assign({className:"ag-empty"},{children:"No data in the selected dates."}))]}))}function G(a){var t,r=this,o=a.tab,d=a.partName,u=a.kpiIds,g=a.rankBy,v=a.search,p=a.graphed,m=a.onToggleGraph,f=a.onOpenRow,x=a.onFirstRow,j=a.onInitialGraph,k=a.fallbackDay,w=s.useInsights(),N=Math.min(200,Math.max(1,Number(o.pageSize)||5)),D=i.useState([]),I=D[0],C=D[1],S=i.useState(null),L=S[0],P=S[1],R=i.useState(!1),F=R[0],M=R[1],B=i.useState({loading:!0,error:null}),O=B[0],E=B[1],q=i.useState(),G=q[0],H=q[1],W=function(n,i){return e.__awaiter(r,void 0,void 0,function(){var a,t;return e.__generator(this,function(r){switch(r.label){case 0:if(!w)return[2];E({loading:!0,error:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,l.fetchLevelRows(w.api,o.entityKey,w.range,{sort:g,order:"desc",search:v||void 0,pageSize:N,cursor:null!=n?n:void 0,includeChildren:3},i)];case 2:return a=r.sent(),(null==i?void 0:i.aborted)?[2]:(H(a.context),C(function(i){return n?e.__spreadArray(e.__spreadArray([],i,!0),a.rows,!0):a.rows}),P(a.nextCursor),M(a.hasNext),E({loading:!1,error:null}),[3,4]);case 3:return t=r.sent(),(null==i?void 0:i.aborted)||"AbortError"===(null==t?void 0:t.name)?[2]:(E({loading:!1,error:t.message||"Couldn't load the rows."}),[3,4]);case 4:return[2]}})})},U=null===(t=I[0])||void 0===t?void 0:t.nodeKey;i.useEffect(function(){return null==x?void 0:x(U)},[U]);var z=I.slice(0,3).map(function(e){return e.nodeKey}),V=z.join("\0");if(i.useEffect(function(){O.loading||O.error||!z.length||null==j||j(z)},[O.loading,O.error,V]),i.useEffect(function(){var e=new AbortController;return W(null,e.signal),function(){return e.abort()}},[null==w?void 0:w.api.configId,null==w?void 0:w.rangeKey,o.entityKey,g,v,N,null==w?void 0:w.revision]),!w)return null;var Z,$=w.goodDirection(g),J=u.filter(function(e){return e!==g}).slice(0,2),X=(Z=d.trim().toLowerCase())?/(s|x|ch|sh)$/.test(Z)?"".concat(Z,"es"):/[^aeiou]y$/.test(Z)?"".concat(Z.slice(0,-1),"ies"):"".concat(Z,"s"):"rows";return n.jsx(_.ReportAccordion,e.__assign({title:"Top Drivers for ".concat(b(X))},{children:O.error?n.jsx("p",e.__assign({className:"ag-muted"},{children:"Top drivers are unavailable right now."})):O.loading&&!I.length?n.jsx(_.SkeletonLines,{widths:[80,60,85,55,75],label:"Loading drivers"}):I.length?n.jsxs(n.Fragment,{children:[n.jsx(h.default,{context:G}),n.jsx(T,e.__assign({label:b(d),rightLabel:"User Activity · selected dates"},{children:I.map(function(i){var a,t,r,o,s=null===(a=i.metrics)||void 0===a?void 0:a[g],d=i.label||i.nodeKey,u=p.includes(i.nodeKey);return n.jsx(A,{rank:i.rank,name:d,chips:n.jsxs(n.Fragment,{children:[n.jsx(_.CriticalityChip,{criticality:null===(t=i.chip)||void 0===t?void 0:t.criticality}),n.jsx(_.MovementChip,{movementType:null===(r=i.chip)||void 0===r?void 0:r.movementType,direction:null===(o=i.chip)||void 0===o?void 0:o.direction,good:$})]}),action:n.jsx(K,{on:u,disabled:!u&&p.length>=y,onClick:function(){return m(i.nodeKey)}}),lines:n.jsxs("span",e.__assign({className:"ag-driver__cost"},{children:[n.jsxs("span",e.__assign({className:"ag-driver__total"},{children:[w.formatKpi(g,null==s?void 0:s.value)," ",w.kpiLabel(g).toLowerCase()]})),null!=(null==s?void 0:s.deltaPct)?n.jsx("span",e.__assign({className:"ag-driver__sep"},{children:"|"})):null,n.jsx(_.DayOverDayChange,{deltaPct:null==s?void 0:s.deltaPct,good:$,direction:null==s?void 0:s.direction,tone:null==s?void 0:s.tone,suffix:"vs previous period"})]})),cell:J.map(function(a){var t,r,o=null===(t=i.metrics)||void 0===t?void 0:t[a],l=null!==(r=null==o?void 0:o.tone)&&void 0!==r?r:_.toneOf(null==o?void 0:o.deltaPct,w.goodDirection(a)),s="up"===(null==o?void 0:o.direction)?"↑":"down"===(null==o?void 0:o.direction)?"↓":"flat"===(null==o?void 0:o.direction)?"→":null!=(null==o?void 0:o.deltaPct)&&o.deltaPct>0?"↑":null!=(null==o?void 0:o.deltaPct)&&o.deltaPct<0?"↓":"→";return n.jsxs("span",e.__assign({className:"ag-driver__activity"},{children:[n.jsx("strong",e.__assign({className:"good"===l?"ag-text--good":"bad"===l?"ag-text--bad":void 0},{children:null==(null==o?void 0:o.deltaPct)?w.formatKpi(a,null==o?void 0:o.value):"".concat(s).concat(Math.abs(o.deltaPct),"%")})),n.jsx("span",{children:w.kpiLabel(a)})]}),a)}),onOpen:function(){var e;return f(i,g,k||(null===(e=i.chip)||void 0===e?void 0:e.dataDay)||c.periodStart(l.toIsoDay(w.range.endDate),w.period.grain))}},i.nodeKey)})})),F?n.jsx("div",e.__assign({className:"ag-more"},{children:n.jsx("button",e.__assign({type:"button",disabled:O.loading,onClick:function(){return W(L)}},{children:O.loading?"Loading...":"Show more"}))})):null]}):n.jsx("p",e.__assign({className:"ag-muted"},{children:v?"No ".concat(X," match “").concat(v,"”."):"No ".concat(X," for this period yet.")}))}))}exports.AddToGraph=K,exports.CorrelationSection=R,exports.DecisionCard=D,exports.DriverList=T,exports.DriverRow=A,exports.L2Report=function(t){var r,o,d,c,v,m,f,b,j,k,w,I,C,S,K,A,T,L,P,E,H=t.tab,W=t.title,U=t.partName,z=t.partKpis,V=t.search,Z=t.dataDay,$=t.onOpenRow,J=t.headerAction,X=s.useInsights(),Q="decision-advantage-l2-".concat(i.useId()),Y=i.useState(null),ee=Y[0],ne=Y[1],ie=i.useState(null),ae=ie[0],te=ie[1],re=i.useState(Boolean(null==X?void 0:X.defaultWorkingDays)),oe=re[0],le=re[1],se=u.useInsightsFetch(X?function(e){return l.fetchGraphGroups(X.api,e)}:null,[null==X?void 0:X.api.configId,null==X?void 0:X.revision]),de=i.useState(null),ue=de[0],ce=de[1];i.useEffect(function(){var e,n;null===ue&&((null===(e=se.data)||void 0===e?void 0:e.groups.length)?ce((null!==(n=se.data.groups.find(function(e){return e.isDefault}))&&void 0!==n?n:se.data.groups[0]).groupKey):se.loading||ce(""))},[ue,se.data,se.loading]);var ge=i.useState(null),ve=ge[0],pe=ge[1],he=i.useState(),_e=he[0],me=he[1],fe=!1!==H.showSummary,ye=null===(o=null===(r=se.data)||void 0===r?void 0:r.groups.find(function(e){return e.groupKey===ue}))||void 0===o?void 0:o.days.map(Number),xe=null!==(d=null==X?void 0:X.period.grain)&&void 0!==d?d:"day",be="day"===xe&&((null==ye?void 0:ye.length)?ye.every(function(e){return e>=1&&e<=5}):oe||Boolean(null==X?void 0:X.range.workingDaysOnly)),je=X?p.resolveL2SummaryRange(X.range,be,Z,void 0,xe):null,ke="".concat(null==X?void 0:X.api.configId,":").concat(null==X?void 0:X.rangeKey,":").concat(H.entityKey,":").concat(ue,":").concat(null==je?void 0:je.startDate.getTime(),":").concat(null==je?void 0:je.endDate.getTime(),":").concat(null==je?void 0:je.workingDaysOnly),we=u.useInsightsFetch(X&&je&&fe&&null!==ue?function(e){return l.fetchLevelSummary(X.api,H.entityKey,je,e)}:null,[ke,fe,null==X?void 0:X.revision],ke);if(!X)return null;var Ne=(null===(c=H.listKpis)||void 0===c?void 0:c.length)?H.listKpis:z,De=H.rankBy&&Ne.includes(H.rankBy)?H.rankBy:null!==(v=Ne[0])&&void 0!==v?v:"",Ie=!Z&&M(we.data,X),Ce=Ie||null===(m=we.data)||void 0===m?void 0:m.report,Se=Ie?null:F(null===(f=we.data)||void 0===f?void 0:f.context),Ke=Ie?B(null===(b=we.data)||void 0===b?void 0:b.context,xe):null,Ae=p.resolveDrillDay({endDate:X.range.endDate,workingDays:be,selectedDay:Z,reportDay:Se,grain:xe}),Te=function(n){return Z||be?e.__assign(e.__assign({},n),{report:e.__assign(e.__assign({},n.report),{reportId:null})}):n},Le=X.goodDirection(De),Pe=null!==(j=H.tier1Kpis)&&void 0!==j?j:X.tierKpis[1],Re=null!==(k=H.tier2Kpis)&&void 0!==k?k:X.tierKpis[2],Fe=ee&&Pe.includes(ee)?ee:null!==(w=Pe[0])&&void 0!==w?w:"",Me=ae&&Re.includes(ae)?ae:null!==(I=Re[0])&&void 0!==I?I:"",Be=X.headlineKpi||De||Pe[0]||"",Oe=function(e){var n=e.nodeKey,i=e.label,a=e.dataDay;return $({rank:0,nodeKey:n,label:i,parent:null,metrics:{},barPct:null,chip:null,report:{reportId:null,status:"none",kpiId:Be},action:null,children:[]},Be,a)},Ee=X.drill.tabTables[H.entityKey],qe=Ee?n.jsx(g.default,{table:e.__assign(e.__assign({},Ee),{pageSize:null!==(S=null!==(C=Ee.pageSize)&&void 0!==C?C:H.pageSize)&&void 0!==S?S:void 0}),tabEntityKey:H.entityKey,context:{trail:[],day:Ae},onRowClick:function(e,n){var i;return"report"===n?X.openReport({reportId:Te(e).report.reportId,nodeKey:e.nodeKey,kpiId:De,dataDay:Ae,title:null!==(i=e.label)&&void 0!==i?i:e.nodeKey}):"drill"===n?$(Te(e),De,Ae):void 0}}):null;return n.jsxs("section",e.__assign({className:"ag-report","aria-label":"L2 Report · ".concat(W)},{children:[n.jsxs("div",e.__assign({className:"ag-report__header"},{children:[n.jsxs("h2",e.__assign({className:"ag-report__title"},{children:[n.jsx(a.Sparkles,{"aria-hidden":"true"}),"L2 Report"]})),n.jsx("span",e.__assign({className:"ag-report__scope"},{children:W})),Se?n.jsx("span",e.__assign({className:"ag-report__date"},{children:_.periodHeading(Se,xe)})):null,J?n.jsx("div",e.__assign({className:"ag-report__header-action"},{children:J})):null]})),n.jsxs("div",e.__assign({className:"ag-report__grid ag-report__grid--l2"},{children:[n.jsx("div",e.__assign({className:"ag-report__analysis-scroll",role:"region","aria-label":"".concat(W," analysis"),tabIndex:0},{children:n.jsxs("div",e.__assign({className:"ag-stack"},{children:[fe?n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx(_.SectionHeader,{title:"Summary",action:n.jsx(x,{entityKey:H.entityKey,dataDay:Se})}),n.jsx(N,{report:Ce,loading:we.loading,error:we.error,good:Le,emptyText:Ke})]}),n.jsx(D,{report:Ce,error:we.error,loading:we.loading,emptyText:Ke}),n.jsx(h.default,{context:null===(K=we.data)||void 0===K?void 0:K.context})]}):null,Ne.length?n.jsx(G,{tab:H,partName:U,kpiIds:Ne,rankBy:De,search:V,graphed:null!=ve?ve:[],onToggleGraph:function(n){return pe(function(i){var a=null!=i?i:[];return a.includes(n)?a.filter(function(e){return e!==n}):a.length<y?e.__spreadArray(e.__spreadArray([],a,!0),[n],!1):a})},onOpenRow:function(e,n,i){return $(Te(e),n,i)},onFirstRow:me,onInitialGraph:function(e){return pe(function(n){return null!=n?n:e})},fallbackDay:Ae}):null]}))})),n.jsxs("div",e.__assign({className:"ag-stack"},{children:[Pe.length?n.jsx(_.CollapsibleVisualSection,e.__assign({title:"Trend",action:n.jsxs("div",e.__assign({className:"ag-visual__actions"},{children:[n.jsx(O,{kpis:Pe,value:Fe,onChange:ne}),n.jsx(_.DaysDropdown,{value:oe,onChange:le,groups:se.error||null===(A=se.data)||void 0===A?void 0:A.groups,group:ue,onGroupChange:ce})]}))},{children:n.jsx(q,{entityKey:H.entityKey,kpis:Pe,kpi:Fe,nodeKeys:ve,workingDays:oe,group:ue,onOpenPoint:Oe,syncId:Q})})):null,Re.length?n.jsx(_.CollapsibleVisualSection,e.__assign({title:X.labels.activityTitle,action:n.jsx("div",e.__assign({className:"ag-visual__actions"},{children:n.jsx(O,{kpis:Re,value:Me,onChange:te})}))},{children:n.jsx(q,{entityKey:H.entityKey,kpis:Re,kpi:Me,nodeKeys:ve,workingDays:oe,group:ue,onOpenPoint:Oe,syncId:Q})})):null,n.jsx(R,{dataDay:Se,nodeKey:null!==(T=null==ve?void 0:ve[0])&&void 0!==T?T:_e,dayGroup:null===(P=null===(L=se.data)||void 0===L?void 0:L.groups.find(function(e){return e.groupKey===ue}))||void 0===P?void 0:P.days}),"column"===(null==Ee?void 0:Ee.width)?qe:null]}))]})),Ee&&"full"===(null!==(E=Ee.width)&&void 0!==E?E:"full")?qe:null]}))},exports.MAX_SERIES=y,exports.PlotByKpi=O,exports.RegenerateSummary=x,exports.RowDrivers=G,exports.RowTrend=q,exports.SummaryCard=N,exports.TopDriversSection=function(t){var r,o,d,c,g,p,h,m,x,b,j,k,N,D=t.dataDay,S=t.entityKey,L=t.parentNodeKey,P=t.kpiId,R=t.title,F=t.graphed,M=t.onToggleGraph,B=t.onOpenDriver,O=t.onDecisionSettled,E=t.initialTab,q=void 0===E?"drivers":E,G=s.useInsights(),H=i.useState(q),W=H[0],U=H[1],z=i.useState({drivers:1,headwinds:1,attention:1}),V=z[0],Z=z[1],$=null!==(r=null!=P?P:null==G?void 0:G.headlineKpi)&&void 0!==r?r:void 0,J=S||L||null===(c=null===(d=null===(o=null==G?void 0:G.decisionAdvantage)||void 0===o?void 0:o.topDrivers)||void 0===d?void 0:d.parts)||void 0===c?void 0:c.filter(Boolean),X=null!==(g=null==J?void 0:J.join(","))&&void 0!==g?g:"",Q=function(e){return G&&$&&e===W?function(n){return l.fetchInsightsDrivers(G.api,{dataDay:D,kpiId:$,entityKey:S,parentNodeKey:L,tab:e,limit:Math.min(10,(L?10:3)*V[e]),offset:0,filters:G.range.filters,parts:(null==J?void 0:J.length)?J:void 0},n)}:null},Y=function(e){return[null==G?void 0:G.api.configId,null==G?void 0:G.rangeKey,D,$,S,L,e,W,V[e],null==G?void 0:G.revision,X]},ee={drivers:u.useInsightsFetch(Q("drivers"),Y("drivers")),headwinds:u.useInsightsFetch(Q("headwinds"),Y("headwinds")),attention:u.useInsightsFetch(Q("attention"),Y("attention"))},ne=ee[W],ie=ne.data,ae=ne.error,te=ne.loading,re=null!==(x=null!==(h=null===(p=ee.drivers.data)||void 0===p?void 0:p.tabs)&&void 0!==h?h:null===(m=ee.headwinds.data)||void 0===m?void 0:m.tabs)&&void 0!==x?x:null===(b=ee.attention.data)||void 0===b?void 0:b.tabs,oe=f.useNeedsAttention(D,L,$),le=null!==(k=null===(j=oe.data)||void 0===j?void 0:j.counts.pending)&&void 0!==k?k:0;if(i.useEffect(function(){return Z({drivers:1,headwinds:1,attention:1})},[D]),i.useEffect(function(){return U(q)},[q]),!G)return null;var se=G.goodDirection(null!=$?$:""),de=null!==(N=null==ie?void 0:ie.rows)&&void 0!==N?N:[];return n.jsxs(_.ReportAccordion,e.__assign({title:R},{children:[n.jsx("div",e.__assign({className:"ag-driver-tabs",role:"tablist","aria-label":"Driver views"},{children:I.map(function(i){return n.jsx("button",e.__assign({type:"button",role:"tab","aria-selected":W===i.key,className:W===i.key?"is-active":void 0,onClick:function(){return U(i.key)},title:i.info},{children:n.jsxs(n.Fragment,{children:[G.labels[i.label],(null==re?void 0:re[i.key])?" (".concat(re[i.key].total,")"):"","attention"===i.key&&le?n.jsxs("span",e.__assign({className:"ag-na__tab-badge",title:"".concat(le," data points need a decision")},{children:[le,n.jsx("span",e.__assign({className:"ins-visually-hidden"},{children:" data points need a decision"}))]})):null,n.jsx(a.Info,{"aria-hidden":"true"})]})}),i.key)})})),"attention"===W?n.jsx(f.default,{dataDay:D,nodeKey:L,kpiId:$,attention:oe,onDecisionSettled:O}):null,"attention"===W&&de.length?n.jsx("h4",e.__assign({className:"ag-na__subhead"},{children:"Rows that moved without a clear cause"})):null,ae?n.jsxs("p",e.__assign({className:"ag-muted"},{children:["Top drivers are unavailable right now: ",ae.message]})):te&&!ie?n.jsx("p",e.__assign({className:"ag-muted"},{children:"Loading drivers..."})):de.length?n.jsxs(n.Fragment,{children:[n.jsx(T,e.__assign({label:"Driver",rightLabel:G.labels.activityColumn},{children:de.map(function(i){var a,t,r,o,l=i.deltaContributionPct,s=F.includes(i.nodeKey),d=(null===(a=i.decisionAdvantage)||void 0===a?void 0:a.correlationSentence)||(null===(t=i.decisionAdvantage)||void 0===t?void 0:t.firstCause)||(null===(r=i.decisionAdvantage)||void 0===r?void 0:r.headline);return n.jsx(A,{alignActivity:!0,rank:i.rank,category:G.labels.driverCategory.replace("{plural}",i.entityKey?G.entityPluralName(i.entityKey):"").replace("{name}",i.entityKey?G.entityName(i.entityKey):""),name:i.label,chips:n.jsxs(n.Fragment,{children:[n.jsx(_.CriticalityChip,{criticality:i.criticality}),n.jsx(_.MovementChip,{movementType:i.movementType,direction:i.changeDirection,good:se})]}),action:M?n.jsx(K,{on:s,disabled:!s&&F.length>=y,onClick:function(){return M(i)}}):void 0,lines:n.jsxs(n.Fragment,{children:[null!=l?n.jsxs("span",e.__assign({className:"ag-driver__share"},{children:[G.labels.shareLine.replace("{share}",String(Math.abs(l))).replace("{period}",u.periodName(D,G.period.grain))," · ","opposite"===i.direction?G.labels.movedOpposite:G.labels.movedWith]})):null,n.jsxs("span",e.__assign({className:"ag-driver__cost"},{children:[n.jsx("span",e.__assign({className:"ag-driver__total"},{children:G.formatKpi($,i.value)})),null!=i.deltaPct?n.jsx("span",e.__assign({className:"ag-driver__sep"},{children:"|"})):null,n.jsx(_.DayOverDayChange,{deltaPct:i.deltaPct,good:se,direction:i.changeDirection,tone:i.tone,suffix:u.previousPeriodLabel(D,G.period.grain)})]})),d?n.jsx("p",e.__assign({className:"ag-driver__brief"},{children:n.jsx(_.VerdictSentence,{text:w(d),good:se,arrowsFollowVerdict:!0})})):null,(null===(o=i.decisionAdvantage)||void 0===o?void 0:o.nextStep)?n.jsxs("p",e.__assign({className:"ag-driver__brief"},{children:[n.jsx("strong",{children:"Next:"})," ",w(i.decisionAdvantage.nextStep)]})):null]}),cell:n.jsx(v.default,{driver:i,kpiId:null!=$?$:"",kpiLabel:G.kpiLabel,formatKpi:G.formatKpi}),onOpen:function(){var e;return B?B(i):G.openReport({reportId:null===(e=i.report)||void 0===e?void 0:e.reportId,nodeKey:i.nodeKey,kpiId:$,dataDay:D,title:i.label})}},i.nodeKey)})})),(null==ie?void 0:ie.hasMore)?n.jsx("div",e.__assign({className:"ag-more"},{children:n.jsx("button",e.__assign({type:"button",disabled:te,onClick:function(){return Z(function(n){var i;return e.__assign(e.__assign({},n),((i={})[W]=n[W]+1,i))})}},{children:te?"Loading...":"Show more"}))})):null]}):n.jsx("p",e.__assign({className:"ag-muted"},{children:C[W]}))]}))},exports.decisionCardNotice=k,exports.outsideRangeText=B,exports.reportDayOf=F,exports.reportOutsideRange=M,exports.stripRowTags=w,exports.titleCase=b;
2
+ //# sourceMappingURL=AgReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgReport.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),t=require("react"),s=require("lucide-react"),i=require("../../api/insightsApi.js"),r=require("./insightsContextCore.js"),a=require("./insightsErrors.js"),l=require("./insightsUtils.js"),o=function(e){if(!e)return"";var n=new Date(e);return Number.isNaN(n.getTime())?"":n.toLocaleString(void 0,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})};function u(s){var i=this,r=s.placeholder,l=s.submitLabel,o=s.onSubmit,u=s.onCancel,c=s.initialValue,m=void 0===c?"":c,d=t.useState(m),_=d[0],h=d[1],g=t.useState(!1),p=g[0],x=g[1],v=t.useState(null),b=v[0],j=v[1];return n.jsxs("div",e.__assign({className:"ins-comment-box"},{children:[n.jsx("textarea",{value:_,maxLength:4e3,placeholder:r,"aria-label":r,onChange:function(e){return h(e.target.value)},rows:2}),b?n.jsx("p",e.__assign({className:"ins-error"},{children:b})):null,n.jsxs("div",e.__assign({className:"ins-comment-box__actions"},{children:[u?n.jsx("button",e.__assign({type:"button",className:"ins-link",onClick:u},{children:"Cancel"})):null,n.jsx("button",e.__assign({type:"button",className:"ins-button",disabled:p||!_.trim(),onClick:function(){return e.__awaiter(i,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:if(!_.trim())return[2];x(!0),j(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,o(_.trim())];case 2:return e.sent(),h(""),[3,5];case 3:return n=e.sent(),j(a.insightsErrorText(n,"Couldn't post the comment.")),[3,5];case 4:return x(!1),[7];case 5:return[2]}})})}},{children:p?"Posting…":l}))]}))]}))}exports.default=function(c){var m=this,d=c.reportId,_=r.useInsights(),h=t.useState(null),g=h[0],p=h[1],x=t.useState(null),v=x[0],b=x[1],j=t.useState(null),f=j[0],C=j[1],N=l.useInsightsFetch(_?function(e){return i.fetchReportComments(_.api,d,e)}:null,[d,null==_?void 0:_.api.configId,null==_?void 0:_.revision]),y=N.data,w=N.loading,S=N.error,k=N.reload;if(!_)return null;var L=_.viewer,q=function(t){var r,l,c=Boolean(L.email&&t.createdByEmail&&L.email.toLowerCase()===t.createdByEmail.toLowerCase());return n.jsxs("li",e.__assign({className:"ins-comment"},{children:[t.isDeleted?n.jsx("p",e.__assign({className:"ins-comment__deleted"},{children:"Comment deleted"})):n.jsxs(n.Fragment,{children:[n.jsxs("div",e.__assign({className:"ins-comment__meta"},{children:[n.jsx("strong",{children:t.createdByName||t.createdByEmail||"Someone"}),n.jsxs("span",{children:[o(t.createdAt),t.edited?" · edited":""]})]})),v===t.id?n.jsx(u,{placeholder:"Edit comment",submitLabel:"Save",initialValue:null!==(r=t.commentText)&&void 0!==r?r:"",onCancel:function(){return b(null)},onSubmit:function(n){return e.__awaiter(m,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,i.updateReportComment(_.api,t.id,n)];case 1:return e.sent(),b(null),k(),[2]}})})}}):n.jsx("p",e.__assign({className:"ins-comment__text"},{children:t.commentText})),n.jsxs("div",e.__assign({className:"ins-comment__actions"},{children:[n.jsx("button",e.__assign({type:"button",className:"ins-link",onClick:function(){return p(g===t.id?null:t.id)}},{children:"Reply"})),c?n.jsxs("button",e.__assign({type:"button",className:"ins-link",onClick:function(){return b(t.id)}},{children:[n.jsx(s.PenLine,{"aria-hidden":"true"})," Edit"]})):null,c||L.isAdmin?n.jsxs("button",e.__assign({type:"button",className:"ins-link ins-link--danger",onClick:function(){return n=t.id,e.__awaiter(m,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:C(null),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.deleteReportComment(_.api,n)];case 2:return e.sent(),k(),[3,4];case 3:return t=e.sent(),C(a.insightsErrorText(t,"Couldn't delete the comment.")),[3,4];case 4:return[2]}})});var n}},{children:[n.jsx(s.Trash2,{"aria-hidden":"true"})," Delete"]})):null]}))]}),g===t.id?n.jsx(u,{placeholder:"Write a reply",submitLabel:"Reply",onCancel:function(){return p(null)},onSubmit:function(n){return e.__awaiter(m,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,i.postReportComment(_.api,d,n,t.id)];case 1:return e.sent(),p(null),k(),[2]}})})}}):null,(null===(l=t.replies)||void 0===l?void 0:l.length)?n.jsx("ul",e.__assign({className:"ins-comments ins-comments--replies"},{children:t.replies.map(q)})):null]}),t.id)};return n.jsxs("section",e.__assign({className:"ins-thread","aria-label":"Comments"},{children:[n.jsxs("h3",{children:[n.jsx(s.MessageSquare,{"aria-hidden":"true"})," Comments",(null==y?void 0:y.count)?" (".concat(y.count,")"):""]}),S?n.jsx("p",e.__assign({className:"ins-error"},{children:S.message})):null,f?n.jsx("p",e.__assign({className:"ins-error"},{children:f})):null,w&&!y?n.jsx("p",e.__assign({className:"ins-muted"},{children:"Loading comments…"})):null,y&&!y.comments.length?n.jsx("p",e.__assign({className:"ins-muted"},{children:"No comments yet."})):null,(null==y?void 0:y.comments.length)?n.jsx("ul",e.__assign({className:"ins-comments"},{children:y.comments.map(q)})):null,n.jsx(u,{placeholder:"Add a comment",submitLabel:"Comment",onSubmit:function(n){return e.__awaiter(m,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,i.postReportComment(_.api,d,n)];case 1:return e.sent(),k(),[2]}})})}})]}))};
2
+ //# sourceMappingURL=CommentsThread.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentsThread.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),i=require("lucide-react"),t=require("../RcaDecisionComponent/RcaDecisionComponent.js"),s=require("../RcaDecisionComponent/CitationMarkdown.js"),a=require("../../api/insightsApi.js"),o=require("./insightsContextCore.js"),r=require("./insightsUtils.js"),l=require("./FilterNotice.js");function d(e){var n,i=[];return e&&!e.matchesRange&&(null===(n=e.period)||void 0===n?void 0:n.end)&&i.push("Latest report: ".concat(r.formatReportDate(e.period),".")),"preliminary"===(null==e?void 0:e.runType)&&i.push("Preliminary: late data can still change it."),i.length?i.join(" "):null}function u(t){var s=t.title,a=t.icon,o=t.heading,r=t.text,l=t.action;return n.jsxs("article",e.__assign({className:"ins-state"},{children:[n.jsx("header",e.__assign({className:"ins-state__header"},{children:n.jsx("span",{children:s})})),n.jsxs("div",e.__assign({className:"ins-state__body"},{children:[n.jsx("span",e.__assign({className:"ins-state__icon"},{children:null!=a?a:n.jsx(i.Sparkles,{"aria-hidden":"true"})})),n.jsxs("div",{children:[n.jsx("p",e.__assign({className:"ins-state__heading"},{children:o})),r?n.jsx("p",e.__assign({className:"ins-state__text"},{children:r})):null,l]})]}))]}))}function c(t){var a,o=t.summary,r=t.onOpen,l="good"===o.tone?"#15803D":"bad"===o.tone?"#E11D48":void 0;return n.jsxs("div",e.__assign({className:"ins-summary","aria-label":"Significant change summary"},{children:[n.jsx("div",e.__assign({className:"ins-summary__title",style:{color:l}},{children:o.eyebrow||"Significant change"})),n.jsx("div",e.__assign({className:"ins-summary__text"},{children:o.headline?n.jsx("span",e.__assign({className:"ins-summary__lead",style:{color:l}},{children:s.hasCitationLink(o.headline)?n.jsx(s.CitationMarkdown,{text:o.headline,citations:null===(a=o.cited)||void 0===a?void 0:a.citation,excelDisplay:"popup",excelHover:!0,autoScrollToCitedCell:!0}):o.headline})):"No summary yet"})),r?n.jsx("button",e.__assign({type:"button",className:"ins-summary__open",onClick:r,"aria-label":"Open the full report and comments"},{children:n.jsx(i.MessageSquare,{"aria-hidden":"true"})})):null]}))}function h(s){var a,l,u,h,v,m,p,g,x=s.title,_=void 0===x?"Decision Advantage":x,y=s.report,j=s.context,f=s.loading,C=s.error,N=s.onRetry,w=s.children,b=o.useInsights(),I=r.useOpenRow(),R="generated"===(null==y?void 0:y.status),k=(null==y?void 0:y.reportId)&&b?function(){return b.openReport({reportId:y.reportId,title:_})}:void 0,S=null;return S=C?n.jsxs(n.Fragment,{children:["Couldn't load Decision Advantage: ",C.message," ",N?n.jsxs("button",e.__assign({type:"button",className:"ins-link ins-link--inline",onClick:N},{children:[n.jsx(i.RefreshCw,{"aria-hidden":"true"})," Try again"]})):null]}):f&&!y?"Loading…":null!==(a=function(e,n){var i;return e?"waiting"===e.status?"The first morning run hasn't finished yet. This fills in after it.":"running"===e.status?"The AI is writing this report. It usually takes a minute or two.":"generated"!==e.status?(null===(i=null==n?void 0:n.period)||void 0===i?void 0:i.start)?"No report was written for ".concat(r.formatPeriod(n.period),". Reports are written after each morning run."):"No report yet. Reports are written after each morning run.":null:null}(y,j))&&void 0!==a?a:d(j),n.jsxs("div",e.__assign({className:"ins-dcol"},{children:[(null===(l=null==y?void 0:y.summary)||void 0===l?void 0:l.headline)?n.jsxs(n.Fragment,{children:[n.jsx("div",e.__assign({className:"ins-dcol__heading"},{children:"Summary"})),n.jsx(c,{summary:y.summary,onOpen:k})]}):null,n.jsx(t.RcaDecisionComponent,{className:"ins-dcol__card",title:_,score:R?null==y?void 0:y.score:null,notice:S,headerActions:R&&k?n.jsxs("button",e.__assign({type:"button",className:"ins-chip-button",onClick:k,"aria-label":"Open the full report and comments"},{children:[n.jsx(i.MessageSquare,{"aria-hidden":"true"}),(null==y?void 0:y.commentCount)||""]})):null,rootCause:R?r.toRcaItems(null==y?void 0:y.rootCause,I,null===(u=null==b?void 0:b.decisionAdvantage)||void 0===u?void 0:u.rootCauseTags):[],rootCauseLayout:null===(h=null==b?void 0:b.decisionAdvantage)||void 0===h?void 0:h.rootCauseLayout,nextSteps:R?r.toRcaItems(null==y?void 0:y.nextSteps,I):[],afterSections:w,autoScrollToCitedCell:!0,excelHover:!0,width:"100%",maxWidth:"none"},"".concat(null!==(v=null==y?void 0:y.reportId)&&void 0!==v?v:_,":").concat(null!==(g=null!==(m=null==y?void 0:y.generatedAt)&&void 0!==m?m:null===(p=null==j?void 0:j.period)||void 0===p?void 0:p.end)&&void 0!==g?g:""))]}))}function v(i){var t=i.children,s=i.minHeight,a=void 0===s?520:s;return n.jsx("div",e.__assign({className:"ins-fill",style:{minHeight:a}},{children:n.jsx("div",e.__assign({className:"ins-fill__inner"},{children:t}))}))}exports.DecisionColumn=h,exports.FillHeight=v,exports.InsightsSkeleton=function(i){var t=i.title;return n.jsxs("article",e.__assign({className:"ins-state","aria-busy":"true","aria-label":"Loading ".concat(t)},{children:[n.jsx("header",e.__assign({className:"ins-state__header"},{children:n.jsx("span",{children:t})})),n.jsxs("div",e.__assign({className:"ins-skeleton"},{children:[n.jsx("span",{style:{width:"40%"}}),n.jsx("span",{style:{width:"85%"}}),n.jsx("span",{style:{width:"70%"}}),n.jsx("span",{style:{width:"78%"}})]}))]}))},exports.InsightsStateCard=u,exports.ReportView=function(s){var a,l,c,h,v,m,p,g,x,_=s.report,y=s.title,j=s.context,f=s.onComments,C=s.onRetry,N=o.useInsights(),w=r.useOpenRow(),b=_.title||y;return"waiting"===_.status?n.jsx(u,{title:b,icon:n.jsx(i.Clock3,{"aria-hidden":"true"}),heading:"The first run hasn't finished yet",text:"The AI checks yesterday's numbers every morning. This card fills in after its first run."}):"running"===_.status?n.jsx(u,{title:b,icon:n.jsx(i.Clock3,{"aria-hidden":"true"}),heading:"Being written",text:"The AI is writing this report. It usually takes a minute or two.",action:C?n.jsxs("button",e.__assign({type:"button",className:"ins-link",onClick:C},{children:[n.jsx(i.RefreshCw,{"aria-hidden":"true"})," Check again"]})):null}):"generated"!==_.status?n.jsx(u,{title:b,heading:"No report for this period",text:(null===(a=null==j?void 0:j.period)||void 0===a?void 0:a.start)?"Nothing was written for ".concat(r.formatPeriod(j.period),". Reports are written after each morning run."):"Reports are written after each morning run."}):n.jsx(t.RcaDecisionComponent,{title:b,score:_.score,summary:_.summary?e.__assign(e.__assign({},_.summary),{citations:null!==(c=null===(l=_.summary.cited)||void 0===l?void 0:l.citation)&&void 0!==c?c:void 0}):null,notice:d(j),headerActions:f&&_.reportId?n.jsxs("button",e.__assign({type:"button",className:"ins-chip-button",onClick:f,"aria-label":"Open report and comments"},{children:[n.jsx(i.MessageSquare,{"aria-hidden":"true"}),_.commentCount||""]})):null,rootCause:r.toRcaItems(_.rootCause,w,null===(h=null==N?void 0:N.decisionAdvantage)||void 0===h?void 0:h.rootCauseTags),rootCauseLayout:null===(v=null==N?void 0:N.decisionAdvantage)||void 0===v?void 0:v.rootCauseLayout,nextSteps:r.toRcaItems(_.nextSteps,w),autoScrollToCitedCell:!0,excelHover:!0,width:"100%",maxWidth:"none"},"".concat(null!==(m=_.reportId)&&void 0!==m?m:b,":").concat(null!==(x=null!==(p=_.generatedAt)&&void 0!==p?p:null===(g=null==j?void 0:j.period)||void 0===g?void 0:g.end)&&void 0!==x?x:""))},exports.SummaryBox=c,exports.default=function(e){var i,t,s,d,u=e.entityKey,c=e.title,m=void 0===c?"Decision Advantage":c,p=o.useInsights(),g=r.useInsightsFetch(p?function(e){return u?a.fetchLevelSummary(p.api,u,p.range,e):a.fetchInsightsSummary(p.api,p.range,e)}:null,[null==p?void 0:p.api.configId,null==p?void 0:p.api.baseUrl,null==p?void 0:p.api.accessToken,null==p?void 0:p.rangeKey,u,null==p?void 0:p.revision],"".concat(null!==(i=null==p?void 0:p.api.configId)&&void 0!==i?i:"",":").concat(null!==(t=null==p?void 0:p.api.baseUrl)&&void 0!==t?t:"",":").concat(null!==(s=null==p?void 0:p.api.accessToken)&&void 0!==s?s:"",":").concat(null!==(d=null==p?void 0:p.rangeKey)&&void 0!==d?d:"",":").concat(null!=u?u:"root")),x=g.data,_=g.error,y=g.loading,j=g.reload;return p?_&&"InsightsDisabled"===_.errorType?null:n.jsxs(v,{children:[n.jsx(l.default,{context:null==x?void 0:x.context}),n.jsx(h,{title:m,report:null==x?void 0:x.report,context:null==x?void 0:x.context,loading:y,error:_,onRetry:j})]}):null},exports.reportNotice=d;
2
+ //# sourceMappingURL=DecisionAdvantageCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecisionAdvantageCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),i=require("../../api/insightsApi.js"),t=require("./agPrimitives.js"),l=require("./DrillTable.js"),a=require("./L1Report.js"),r=require("./RowDetail.js"),s=require("./insightsContextCore.js"),o=require("./insightsUtils.js"),d=function(e,n){var i,t;return{nodeKey:n.nodeKey,label:n.label||n.nodeKey,entityKey:n.entityKey||"",partName:(null==e?void 0:e.entityName(n.entityKey||""))||n.entityKey||"",reportId:null!==(t=null===(i=n.report)||void 0===i?void 0:i.reportId)&&void 0!==t?t:null,metrics:n.metrics}},u=function(e,n,i){var t,l,a,r,s;return{nodeKey:n.nodeKey,label:n.label,entityKey:null!==(l=n.entityKey)&&void 0!==l?l:"",partName:(null==e?void 0:e.entityName(null!==(a=n.entityKey)&&void 0!==a?a:""))||n.entityKey||"",reportId:null!==(s=null===(r=n.report)||void 0===r?void 0:r.reportId)&&void 0!==s?s:null,metrics:(t={},t[i]={value:n.value,previous:n.previous,deltaPct:n.deltaPct,direction:n.changeDirection,tone:n.tone},t)}};function c(l){var a,r,d,u,c=l.row,p=l.dataDay,y=l.kpiId,v=s.useInsights(),m=o.useInsightsFetch(v&&!c.metrics?function(e){return i.fetchRowDetail(v.api,c.nodeKey,{kpiId:y,dataDay:p},e)}:null,[null==v?void 0:v.api.configId,c.nodeKey,y,p,Boolean(c.metrics),null==v?void 0:v.revision],"".concat(null!==(a=null==v?void 0:v.api.configId)&&void 0!==a?a:"",":").concat(c.nodeKey,":").concat(y,":").concat(p));if(!v)return null;var g=null!==(u=null!==(r=c.metrics)&&void 0!==r?r:null===(d=m.data)||void 0===d?void 0:d.metrics)&&void 0!==u?u:{},_=Object.entries(g).filter(function(e){var n=e[1];return n&&null!=n.value});return n.jsxs("section",{children:[n.jsx(t.SectionHeader,{title:"Headline numbers"}),m.loading&&!_.length?n.jsx("p",e.__assign({className:"ag-muted"},{children:"Loading numbers…"})):null,m.loading||_.length?null:n.jsx("div",e.__assign({className:"ag-empty"},{children:"No numbers for this selection."})),_.length?n.jsx("dl",e.__assign({className:"ag-row-detail__metrics"},{children:_.map(function(e){var i=e[0],l=e[1];return n.jsxs("div",{children:[n.jsx("dt",{children:v.kpiLabel(i)}),n.jsxs("dd",{children:[v.formatKpi(i,l.value)," ",n.jsx(t.DayOverDayChange,{deltaPct:l.deltaPct,direction:l.direction,tone:l.tone,good:v.goodDirection(i)})]})]},i)})})):null]})}exports.DEFAULT_LEVEL={id:"default",match:{entityKey:""},panels:["summary","decision","topDrivers","trend","activity","correlation"],tables:[]},exports.default=function(i){var t,o,p=i.trail,y=i.level,v=i.kpiId,m=i.dataDay,g=i.reportDay,_=i.onReportDay,h=i.tier2Kpis,j=i.onOpen,f=s.useInsights();if(!f||!p.length)return null;var x=p[p.length-1],K=g||m,b=new Set(null!==(t=y.panels)&&void 0!==t?t:[]),D=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.some(function(e){return b.has(e)})},N=p.map(function(e){return e.entityKey}),I=function(e,n){"drill"===n&&f.matchDrillLevel(e.entityKey,N)?j(e):f.openReport({reportId:e.reportId,nodeKey:e.nodeKey,kpiId:v,dataDay:K,title:e.label})},w=null!==(o=y.tables)&&void 0!==o?o:[],k=w.filter(function(e){return"column"===e.width}),q=w.filter(function(e){return"column"!==e.width}),R={trail:p,day:K},L=function(e,i,t){var a;return n.jsx(l.default,{table:e,context:R,className:t,onRowClick:function(e,n){return"none"===n?void 0:I(d(f,e),n)}},"".concat(x.nodeKey,":").concat(null!==(a=e.id)&&void 0!==a?a:i))},O=D("summary","decision","topDrivers"),P=D("trend","activity","correlation"),T=P||D("numbers")||k.length>0,C=O&&T;return n.jsxs("div",e.__assign({className:"ag-popup"},{children:[O?n.jsxs("section",e.__assign({className:"ag-popup__section".concat(C?" ag-popup__section--capped":"")},{children:[n.jsxs("div",e.__assign({className:"ag-popup__head"},{children:[n.jsx("p",e.__assign({className:"ag-popup__eyebrow"},{children:"Analysis"})),n.jsx("h3",e.__assign({className:"ag-popup__title"},{children:f.labels.analysisTitle}))]})),n.jsx("div",e.__assign({className:"ag-popup__scroll",role:"region","aria-label":"".concat(x.label," analysis"),tabIndex:C?0:void 0},{children:n.jsx(r.default,{embedded:!0,nodeKey:x.nodeKey,kpiId:v,dataDay:m,reportId:null,onReportDay:_,show:{summary:D("summary"),decision:D("decision"),topDrivers:D("topDrivers")},onOpenDriver:function(e){return I(u(f,e,v),"drill")}},x.nodeKey)}))]})):null,T?n.jsxs("section",e.__assign({className:"ag-popup__section"},{children:[P||D("numbers")?n.jsxs("div",e.__assign({className:"ag-popup__head"},{children:[n.jsx("p",e.__assign({className:"ag-popup__eyebrow"},{children:"Visuals"})),n.jsx("h3",e.__assign({className:"ag-popup__title"},{children:f.labels.visualsTitle}))]})):null,n.jsxs("div",e.__assign({className:"ag-stack"},{children:[D("numbers")?n.jsx(c,{row:x,dataDay:K,kpiId:v}):null,P?g||!O?n.jsx(a.EntityDetailVisuals,{nodeKey:x.nodeKey,label:x.label,kpiId:v,dataDay:K,tier2Kpis:h,show:{trend:D("trend"),activity:D("activity"),correlation:D("correlation")},onOpenDay:_},x.nodeKey):n.jsx("p",e.__assign({className:"ag-muted"},{children:"Loading report…"})):null,k.map(function(e,n){return L(e,n,O?void 0:"ag-drill--wide")})]}))]})):null,q.map(function(e,n){return L(e,k.length+n,"ag-drill--full")})]}))},exports.popupRowFromDriver=u,exports.popupRowFromTable=d;
2
+ //# sourceMappingURL=DrillLevel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrillLevel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),t=require("lucide-react"),l=require("react"),r=require("../../api/insightsApi.js"),i=require("./agPrimitives.js"),o=require("./insightsContextCore.js"),a=require("./insightsFormat.js"),s=/\{([^{}]+)\}/g;function u(t){var r=t.range,i=t.dashboardRange,o=t.onApply,a=l.useState(r),s=a[0],u=a[1],c=!s.start||!s.end||s.start>s.end;return n.jsxs("form",e.__assign({className:"ag-drill__dates","aria-label":"Table date range",onSubmit:function(e){e.preventDefault(),c||o(s)}},{children:[n.jsxs("label",{children:["From",n.jsx("input",{type:"date",required:!0,value:s.start,max:s.end||void 0,onChange:function(n){var t=n.target.value;u(function(n){return e.__assign(e.__assign({},n),{start:t})})}})]}),n.jsxs("label",{children:["To",n.jsx("input",{type:"date",required:!0,value:s.end,min:s.start||void 0,onChange:function(n){var t=n.target.value;u(function(n){return e.__assign(e.__assign({},n),{end:t})})}})]}),n.jsx("button",e.__assign({type:"submit",disabled:c},{children:"Apply"})),n.jsx("button",e.__assign({type:"button",onClick:function(){u(i),o(i)}},{children:"Use dashboard range"})),s.start&&s.end&&s.start>s.end?n.jsx("span",e.__assign({role:"alert"},{children:"From must be on or before To."})):null]}))}var c=function(e){return e.replace(/[_-]+/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()})},d=function(e,n){return n.split(".").reduce(function(e,n){return e&&"object"==typeof e?e[n]:void 0},e)};function v(e,n){if(null==e||""===e)return"—";if("date"===n&&"string"==typeof e){var t=new Date("".concat(e.slice(0,10),"T00:00:00"));return Number.isNaN(t.getTime())?e:t.toLocaleDateString()}var l="number"==typeof e?e:"string"==typeof e&&""!==e.trim()&&!Number.isNaN(Number(e))&&n&&"text"!==n&&"chip"!==n?Number(e):null;return null!==l?"percent"===n?"".concat(new Intl.NumberFormat(void 0,{maximumFractionDigits:1}).format(l),"%"):new Intl.NumberFormat(void 0,{maximumFractionDigits:"rating"===n?2:1}).format(l):"object"==typeof e?JSON.stringify(e):String(e)}function y(e,n,t){var l,i,o,a,s,u=n.trail;return{record:t.record,context:{row:null!==(i=null===(l=u[u.length-1])||void 0===l?void 0:l.label)&&void 0!==i?i:"",parent:null!==(a=null===(o=u[u.length-2])||void 0===o?void 0:o.label)&&void 0!==a?a:"",day:null!==(s=n.day)&&void 0!==s?s:"",startDate:r.toIsoDay(e.range.startDate),endDate:r.toIsoDay(e.range.endDate),trail:Object.fromEntries(u.map(function(e){return[e.entityKey,e.label]}))}}}var f=function(e,n,t,l){return e.replace(s,function(e,r){var i=function(e,n,t){var l=t.trim();return l.startsWith("context.")?d(e.context,l.slice(8)):l.startsWith("input.")?n[l.slice(6)]:d(e.record,l)}(n,t,r),o=null==i?"":"object"==typeof i?JSON.stringify(i):String(i);return l?encodeURIComponent(o):o})},g=function(e,n,t){return"string"==typeof e?f(e,n,t,!1):Array.isArray(e)?e.map(function(e){return g(e,n,t)}):e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(function(e){var l=e[0],r=e[1];return[l,g(r,n,t)]})):e},h=new Set,p=["good","warning","bad","info","neutral"],_=function(e){return String(null!=e?e:"").trim().toLowerCase().replace(/[\s_-]+/g," ")};function b(t){var l,r=t.text,i=t.value,o=t.colors,a=o?null===(l=Object.entries(o).find(function(e){var n=e[0];return _(n)===_(i)}))||void 0===l?void 0:l[1]:void 0;if(a&&"object"==typeof a)return n.jsx("span",e.__assign({className:"ag-drill__chip",style:e.__assign({background:a.background,color:a.color},a.border?{boxShadow:"inset 0 0 0 1px ".concat(a.border)}:{})},{children:r}));var s="string"==typeof a&&p.includes(a)?a:"neutral";return n.jsx("span",e.__assign({className:"ag-drill__chip ag-drill__chip--".concat(s)},{children:r}))}function m(r){var i,o=r.button,a=r.question,s=r.onCancel,u=r.onSubmit,c=l.useState({}),d=c[0],v=c[1],y=l.useRef(null);l.useEffect(function(){var e;return null===(e=y.current)||void 0===e?void 0:e.focus()},[]);var f=null!==(i=o.ask)&&void 0!==i?i:[],g=f.some(function(e){var n;return!(null===(n=d[e.key])||void 0===n?void 0:n.trim())});return n.jsx("div",e.__assign({className:"ag-drill__dialog",role:"presentation",onMouseDown:function(e){return e.target===e.currentTarget&&s()}},{children:n.jsxs("form",e.__assign({className:"ag-drill__dialog-box",role:"dialog","aria-modal":"true","aria-label":o.label,onSubmit:function(e){e.preventDefault(),g||u(d)},onKeyDown:function(e){"Escape"===e.key&&(e.stopPropagation(),s())}},{children:[n.jsxs("header",{children:[n.jsx("strong",{children:o.label}),n.jsx("button",e.__assign({type:"button","aria-label":"Cancel",onClick:s},{children:n.jsx(t.X,{"aria-hidden":"true"})}))]}),a?n.jsx("p",{children:a}):null,f.map(function(t,l){var r;return n.jsxs("label",{children:[n.jsx("span",{children:t.label}),n.jsx("input",{ref:0===l?function(e){y.current=e}:void 0,value:null!==(r=d[t.key])&&void 0!==r?r:"",onChange:function(n){return v(function(l){var r;return e.__assign(e.__assign({},l),((r={})[t.key]=n.target.value,r))})},required:!0})]},t.key)}),n.jsxs("footer",{children:[n.jsx("button",e.__assign({type:"button",onClick:s},{children:"Cancel"})),n.jsx("button",e.__assign({ref:f.length?void 0:function(e){y.current=e},type:"submit",disabled:g},{children:o.label}))]})]}))}))}exports.default=function(s){var p,_,x,j,w,k,K,N,S,C,D,T,E,I,A,O,R,B=this,M=s.table,P=s.tabEntityKey,q=s.context,L=s.onRowClick,F=s.className,z=o.useInsights(),H=q.trail.length>0,J=l.useMemo(function(){return function(n,t,l){var r,i,o,a,s,u={filterBy:l?"trail":"none",period:l?"day":"range"};return(null===(r=n.views)||void 0===r?void 0:r.length)?n.views.map(function(t){var l,r,i,o,a,s;return e.__assign(e.__assign({},t),{source:null!==(l=t.source)&&void 0!==l?l:"insights",filterBy:null!==(r=t.filterBy)&&void 0!==r?r:"row"===t.scope?"row":u.filterBy,period:null!==(i=t.period)&&void 0!==i?i:u.period,onRowClick:null!==(o=t.onRowClick)&&void 0!==o?o:n.onRowClick,buttons:null!==(s=null!==(a=t.buttons)&&void 0!==a?a:n.buttons)&&void 0!==s?s:[]})}):[{source:null!==(i=n.source)&&void 0!==i?i:"insights",entityKey:t,tableKey:n.tableKey,columns:n.columns,onRowClick:n.onRowClick,filterBy:l?null!==(o=n.filterBy)&&void 0!==o?o:u.filterBy:"none",period:l?null!==(a=n.period)&&void 0!==a?a:u.period:"range",buttons:null!==(s=n.buttons)&&void 0!==s?s:[]}]}(M,P,H)},[M,P,H]),U=J.map(function(e){var n;return"".concat(e.source,":").concat(null!==(n=e.entityKey)&&void 0!==n?n:e.tableKey)}).join("|"),W=l.useState(0),X=W[0],G=W[1],Q=l.useState(""),V=Q[0],Y=Q[1],Z=l.useState(""),$=Z[0],ee=Z[1],ne=l.useState(M.defaultSort),te=ne[0],le=ne[1],re=l.useState([]),ie=re[0],oe=re[1],ae=l.useState(null),se=ae[0],ue=ae[1],ce=l.useState(0),de=ce[0],ve=ce[1],ye=l.useState(!1),fe=ye[0],ge=ye[1],he=l.useState(0),pe=he[0],_e=he[1],be=l.useState(!1),me=be[0],xe=be[1],je=l.useState(null),we=je[0],ke=je[1],Ke=l.useState(null),Ne=Ke[0],Se=Ke[1],Ce=l.useState(null),De=Ce[0],Te=Ce[1],Ee=l.useState(null),Ie=Ee[0],Ae=Ee[1],Oe=l.useState(null),Re=Oe[0],Be=Oe[1],Me=l.useRef(null);l.useEffect(function(){return G(0)},[U]),l.useEffect(function(){var e=setTimeout(function(){return ee(V.trim())},300);return function(){return clearTimeout(e)}},[V]);var Pe=J[Math.min(X,J.length-1)],qe=q.trail,Le=qe[qe.length-1],Fe=null!==(p=M.pageSize)&&void 0!==p?p:10,ze=Pe&&"table"!==Pe.source?Le&&Pe.entityKey&&!(null==z?void 0:z.isChildOf(Pe.entityKey,Le.entityKey))?"movers":"rows":"table",He="rows"===ze&&Le?Le.nodeKey:void 0,Je=l.useMemo(function(){var n,t,l;if(!z||!Pe||"table"===Pe.source)return[];if(null===(n=Pe.columns)||void 0===n?void 0:n.length)return Pe.columns;var r=z.entityKpis(null!==(t=Pe.entityKey)&&void 0!==t?t:"").slice(0,4);return e.__spreadArray([{key:"label",source:"field",label:z.entityName(null!==(l=Pe.entityKey)&&void 0!==l?l:"")}],r.map(function(e){return{key:e,source:"kpi",show:"both"}}),!0)},[z,Pe]),Ue=Je.find(function(e){return"children"===e.source}),We=null!==(_=null==z?void 0:z.headlineKpi)&&void 0!==_?_:"",Xe=qe.map(function(e){return"".concat(e.entityKey,":").concat(e.nodeKey)}).join("|"),Ge=JSON.stringify([null==z?void 0:z.rangeKey,null==z?void 0:z.api.configId,U,Xe,q.day]),Qe=H&&"table"===ze,Ve=l.useMemo(function(){return z?"day"===(null==Pe?void 0:Pe.period)&&q.day?{start:q.day,end:q.day}:{start:r.toIsoDay(z.range.startDate),end:r.toIsoDay(z.range.endDate)}:{start:"",end:""}},[z,null==Pe?void 0:Pe.period,q.day]),Ye=Qe&&(null==Re?void 0:Re.scope)===Ge?Re.range:Ve,Ze=l.useMemo(function(){if(!z||!Pe)return{};var n=e.__assign({},z.sidebarFilters);return("trail"===Pe.filterBy?qe:"row"===Pe.filterBy?qe.slice(-1):[]).forEach(function(e){var t=z.labelColumnOf(e.entityKey);t&&e.label&&(n[t]=[e.label])}),n},[z,Pe,Xe]),$e=JSON.stringify(Ze),en="table"===ze?void 0:"chip.criticality"===(null==te?void 0:te.key)?"criticality":null==te?void 0:te.key,nn="table"===ze||null==te?void 0:te.order,tn="table"===ze?"":$,ln=function(n,t){return e.__awaiter(B,void 0,void 0,function(){var l,i,o,a,s,u,c,d,v,y,f;return e.__generator(this,function(g){switch(g.label){case 0:if(!z||!Pe)return[2,void 0];if("table"!==ze)return[3,2];if(!Pe.tableKey)throw new Error("Pick a Table Builder table for this list.");return[4,r.fetchDrillTableRows(z.api,{tableKey:Pe.tableKey,startDay:Ye.start,endDay:Ye.end,filters:Ze,pageSize:Fe,cursor:n?se:null},t)];case 1:return l=g.sent(),i=n?ie.length:0,[2,{rows:l.rows.map(function(e,n){return{id:"t".concat(i+n),record:e}}),count:l.count,hasMore:l.hasNext,cursor:l.nextCursor,offset:0}];case 2:return"movers"!==ze?[3,4]:(o=n?de:0,[4,r.fetchInsightsDrivers(z.api,{dataDay:null!==(d=q.day)&&void 0!==d?d:void 0,kpiId:We,parentNodeKey:null==Le?void 0:Le.nodeKey,entityKey:Pe.entityKey,tab:"drivers",limit:Fe,offset:o,filters:z.range.filters},t)]);case 3:return a=g.sent(),s=a.rows.map(function(e){return function(e,n){var t,l,r,i,o;return{rank:e.rank,nodeKey:e.nodeKey,label:e.label,parent:null,metrics:(t={},t[n]={value:e.value,previous:e.previous,deltaPct:e.deltaPct,direction:e.changeDirection,tone:e.tone},t),barPct:null,chip:{criticality:e.criticality,movementType:e.movementType},report:{reportId:null!==(r=null===(l=e.report)||void 0===l?void 0:l.reportId)&&void 0!==r?r:null,status:(null===(i=e.report)||void 0===i?void 0:i.reportId)?"generated":"none",kpiId:n},action:null,children:[],entityKey:null!==(o=e.entityKey)&&void 0!==o?o:null}}(e,We)}),u=a,[2,{rows:s.map(function(e){return{id:e.nodeKey,record:e,insights:e}}),count:null!==(v=u.total)&&void 0!==v?v:o+s.length,hasMore:Boolean(u.hasMore),cursor:null,offset:o+s.length}];case 4:return[4,r.fetchLevelRows(z.api,null!==(y=Pe.entityKey)&&void 0!==y?y:"",e.__assign({},z.range),{sort:en,order:nn,search:tn||void 0,pageSize:Fe,parentNodeKey:He,includeChildren:Ue?null!==(f=Ue.max)&&void 0!==f?f:3:void 0,childEntityKey:null==Ue?void 0:Ue.childEntityKey,cursor:n&&null!=se?se:void 0},t)];case 5:return[2,{rows:(c=g.sent()).rows.map(function(n){var t,l;return{id:n.nodeKey,record:n,insights:e.__assign(e.__assign({},n),{entityKey:null!==(l=null!==(t=n.entityKey)&&void 0!==t?t:Pe.entityKey)&&void 0!==l?l:null})}}),count:c.count,hasMore:c.hasNext,cursor:c.nextCursor,offset:0}]}})})};if(l.useEffect(function(){if(z&&Pe){var e=new AbortController;return Me.current=e,xe(!0),ke(null),oe([]),ue(null),ve(0),Se(null),ln(!1,e.signal).then(function(n){var t;n&&!e.signal.aborted&&(oe(n.rows),_e(n.count),ge(n.hasMore),ue(null!==(t=n.cursor)&&void 0!==t?t:null),ve(n.offset))}).catch(function(n){e.signal.aborted||"AbortError"===(null==n?void 0:n.name)||ke(n instanceof Error?n.message:"The rows couldn't be loaded.")}).finally(function(){e.signal.aborted||xe(!1)}),function(){return e.abort()}}},[null==z?void 0:z.api,null==z?void 0:z.revision,null==z?void 0:z.rangeKey,U,X,ze,He,Xe,q.day,Ye.start,Ye.end,$e,tn,en,nn,Fe,null==Ue?void 0:Ue.childEntityKey]),!z||!Pe)return null;var rn="table"===ze?function(n,t,l){var r,i,o=t.tableKey?n.tableSource(t.tableKey):void 0,a=(null===(r=null==o?void 0:o.columns)||void 0===r?void 0:r.length)?o.columns:Object.keys(null!=l?l:{}).map(function(e){return{key:e,label:c(e)}}),s=null!==(i=t.columns)&&void 0!==i?i:[];return e.__spreadArray(e.__spreadArray([],s.filter(function(e){return e.key&&a.some(function(n){return n.key===e.key})}),!0),a.filter(function(e){return!s.some(function(n){return n.key===e.key})}).map(function(n){return e.__assign(e.__assign({},n),{source:"field"})}),!0).filter(function(e){return!e.hidden}).map(function(n){var t,l,r,i,o,s;return e.__assign(e.__assign({},n),{source:"field",sortable:null!==(t=n.sortable)&&void 0!==t?t:null===(l=a.find(function(e){return e.key===n.key}))||void 0===l?void 0:l.sortable,label:null!==(o=null!==(r=n.label)&&void 0!==r?r:null===(i=a.find(function(e){return e.key===n.key}))||void 0===i?void 0:i.label)&&void 0!==o?o:c(null!==(s=n.key)&&void 0!==s?s:"")})})}(z,Pe,null===(x=ie[0])||void 0===x?void 0:x.record):Je,on=z.hostTables["table"===Pe.source?null!==(j=Pe.tableKey)&&void 0!==j?j:"":"insights.".concat(null!==(w=Pe.entityKey)&&void 0!==w?w:"")],an=(null===(k=null==on?void 0:on.columns)||void 0===k?void 0:k.length)?on.columns:null,sn=function(n){return n.insights?function(e){var n,t,l,r,i,o,a,s,u,c,d,v,y,f,g,h,p,_={id:e.nodeKey,nodeKey:e.nodeKey,label:null!==(n=e.label)&&void 0!==n?n:e.nodeKey,entityKey:null!==(t=e.entityKey)&&void 0!==t?t:null,parent:null!==(r=null===(l=e.parent)||void 0===l?void 0:l.label)&&void 0!==r?r:null,criticality:null!==(o=null===(i=e.chip)||void 0===i?void 0:i.criticality)&&void 0!==o?o:null,movementType:null!==(s=null===(a=e.chip)||void 0===a?void 0:a.movementType)&&void 0!==s?s:null,reportId:null!==(c=null===(u=e.report)||void 0===u?void 0:u.reportId)&&void 0!==c?c:null,reportStatus:null!==(v=null===(d=e.report)||void 0===d?void 0:d.status)&&void 0!==v?v:null,actionStatus:null!==(f=null===(y=e.action)||void 0===y?void 0:y.status)&&void 0!==f?f:null,assignee:null!==(h=null===(g=e.action)||void 0===g?void 0:g.assigneeName)&&void 0!==h?h:null,children:e.children.map(function(e){return e.label}).filter(Boolean),__row:e};return Object.entries(null!==(p=e.metrics)&&void 0!==p?p:{}).forEach(function(e){var n,t,l,r=e[0],i=e[1];_[r]=null!==(n=null==i?void 0:i.value)&&void 0!==n?n:null,_["".concat(r,"_delta")]=null!==(t=null==i?void 0:i.deltaPct)&&void 0!==t?t:null,_["".concat(r,"_previous")]=null!==(l=null==i?void 0:i.previous)&&void 0!==l?l:null}),_}(n.insights):e.__assign({id:n.id},n.record)},un="table"===ze?"none":null!==(K=Pe.onRowClick)&&void 0!==K?K:"none",cn="none"!==un,dn="table"===ze?e.__spreadArray([],ie,!0).filter(function(e){return!$||(an?an.map(function(e){return e.key}):rn.map(function(e){var n;return null!==(n=e.key)&&void 0!==n?n:""})).some(function(n){var t;return String(null!==(t=e.record[n])&&void 0!==t?t:"").toLowerCase().includes($.toLowerCase())})}).sort(function(e,n){if(!(null==te?void 0:te.key))return 0;var t=e.record[te.key],l=n.record[te.key],r=Number(t),i=Number(l),o=null==t||null==l||""===t||""===l||Number.isNaN(r)||Number.isNaN(i)?String(null!=t?t:"").localeCompare(String(null!=l?l:"")):r-i;return"asc"===te.order?o:-o}):ie,vn=function(e){return"movers"!==ze&&!0===e.sortable},yn=function(e){var n;if(vn(e)){var t=null!==(n=e.key)&&void 0!==n?n:"";le(function(e){return{key:t,order:(null==e?void 0:e.key)===t&&"desc"===e.order?"asc":"desc"}})}},fn=function(e){var n;return(null===(n=z.tableSource(null!=e?e:""))||void 0===n?void 0:n.title)||c(null!=e?e:"")},gn="table"===Pe.source?fn(Pe.tableKey):z.entityName(null!==(N=Pe.entityKey)&&void 0!==N?N:""),hn="table"===Pe.source?gn:z.entityPluralName(null!==(S=Pe.entityKey)&&void 0!==S?S:""),pn=function(e){var n;return e.title||("table"===e.source?fn(e.tableKey):z.entityPluralName(null!==(n=e.entityKey)&&void 0!==n?n:""))},_n=J.length>1?"Drill down in {row}":H?"table"===Pe.source?"{part}":z.labels.drillTableTitle:"{parts}",bn=(null!==(C=M.title)&&void 0!==C?C:_n).replace(/\{row\}/g,null!==(D=null==Le?void 0:Le.label)&&void 0!==D?D:"").replace(/\{parent\}/g,null!==(E=null===(T=qe[qe.length-2])||void 0===T?void 0:T.label)&&void 0!==E?E:"").replace(/\{day\}/g,q.day?i.formatHeaderDate(q.day):"").replace(/\{parts\}|\{plural\}/g,hn).replace(/\{part\}/g,gn).replace(/\s+/g," ").trim(),mn=function(e){return Pe.buttons.filter(function(n){var t,l,r;if(n.adminOnly&&!z.viewer.isAdmin)return!1;if(!("host"!==n.type||n.handler&&z.actionHandlers[n.handler]))return h.has(null!==(t=n.handler)&&void 0!==t?t:"")||(h.add(null!==(l=n.handler)&&void 0!==l?l:""),console.warn('Decision Advantage: no host handler named "'.concat(null!==(r=n.handler)&&void 0!==r?r:"",'" is registered, so its button is hidden.'))),!1;if(n.when){var i=d(e.record,n.when);if(null==i||""===i)return!1}return!0})},xn=function(n,t,l){return e.__awaiter(B,void 0,void 0,function(){var r,i,o,a,s,u,c,d,v,h,p,_,b,m,x,j,w,k,K,N,S,C;return e.__generator(this,function(e){switch(e.label){case 0:r=y(z,q,t),i="".concat(t.id,":").concat(null!==(m=n.id)&&void 0!==m?m:n.label),Se(null),e.label=1;case 1:if(e.trys.push([1,9,10,11]),"open"===n.type){if(o=f(null!==(x=n.url)&&void 0!==x?x:"",r,l,!0),/^https:\/\//i.test(o))window.open(o,"_blank","noopener,noreferrer");else{if(!/^mailto:/i.test(o))throw new Error("This link isn't allowed: only https and mailto links open.");window.location.href=o}return[2]}return Ae(i),"host"!==n.type?[3,3]:[4,(0,z.actionHandlers[null!==(j=n.handler)&&void 0!==j?j:""])({button:n,row:t.record,context:r.context,inputs:l})];case 2:return a=e.sent(),Se({tone:"ok",text:a&&a.message||"".concat(n.label,": done.")}),[2];case 3:if("https:"!==(s=new URL(f(null!==(w=n.url)&&void 0!==w?w:"",r,l,!0))).protocol)throw new Error("Only https APIs can be called.");return u=null!==(k=n.method)&&void 0!==k?k:"POST",c={Accept:"application/json"},Object.entries(null!==(K=n.headers)&&void 0!==K?K:{}).forEach(function(e){var n=e[0],t=e[1];c[n]=f(String(t),r,l,!1)}),z.api.accessToken&&z.approvedApiHosts.includes(s.host.toLowerCase())&&(c.Authorization="Bearer ".concat(z.api.accessToken)),(d="GET"!==u&&void 0!==n.body&&null!==n.body)&&(c["Content-Type"]="application/json"),[4,fetch(s.toString(),{method:u,headers:c,body:d?JSON.stringify(g(n.body,r,l)):void 0})];case 4:v=e.sent(),h="",e.label=5;case 5:return e.trys.push([5,7,,8]),[4,v.json()];case 6:return p=e.sent(),_=null==p?void 0:p.error,h=String(null!==(C=null!==(S=null!==(N=null==p?void 0:p.message)&&void 0!==N?N:null==_?void 0:_.errorMessage)&&void 0!==S?S:null==p?void 0:p.detail)&&void 0!==C?C:""),[3,8];case 7:return e.sent(),h="",[3,8];case 8:if(!v.ok)throw new Error(h||"".concat(n.label," failed (status ").concat(v.status,")."));return Se({tone:"ok",text:h||"".concat(n.label,": done.")}),[3,11];case 9:return b=e.sent(),Se({tone:"error",text:b instanceof Error?b.message:"".concat(n.label," failed.")}),[3,11];case 10:return Ae(null),[7];case 11:return[2]}})})},jn=function(e){var n,t,l,r=null!==(t=null!==(n=e.key)&&void 0!==n?n:e.id)&&void 0!==t?t:"",i="table"===Pe.source?Pe.tableKey:Pe.entityKey;return null!==(l=i?z.cellRenderers["".concat(i,".").concat(r)]:void 0)&&void 0!==l?l:z.cellRenderers[r]},wn=function(t,l){var r,o,s,u,c,y,f,g,h,p,_=null!==(r=l.key)&&void 0!==r?r:"",m=jn(l),x="kpi"===l.source&&t.insights?null===(o=t.insights.metrics[_])||void 0===o?void 0:o.value:"children"===l.source&&t.insights?t.insights.children.map(function(e){return e.label}).filter(Boolean):"label"===_&&t.insights?t.insights.label||t.insights.nodeKey:d(t.record,_);if(null==m?void 0:m.render){var j=m.render({column:l,value:x,record:t.record,row:t.insights,entityKey:Pe.entityKey,tableKey:Pe.tableKey});if(void 0!==j)return j}if(t.insights){var w=null===(s=z.renderInsightsCell)||void 0===s?void 0:s.call(z,{column:l,row:t.insights,entityKey:null!==(u=Pe.entityKey)&&void 0!==u?u:""});if(void 0!==w)return w}if("custom"===l.source)return null!==(c=l.emptyText)&&void 0!==c?c:"—";var k=null===(y=t.insights)||void 0===y?void 0:y.chip;if("label"===_&&t.insights&&!(null==m?void 0:m.as)&&((null==k?void 0:k.criticality)||(null==k?void 0:k.movementType))){var K=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return rn.some(function(n){var t;return e.includes(null!==(t=n.key)&&void 0!==t?t:"")})};return n.jsxs("span",e.__assign({className:"ag-drill__name"},{children:[n.jsx("span",{children:v(x,l.format)}),K("criticality","chip.criticality")?null:n.jsx(i.CriticalityChip,{criticality:k.criticality}),K("movementType","chip.movementType")?null:n.jsx(i.MovementChip,{movementType:k.movementType,direction:k.direction,good:z.goodDirection(k.kpiId||We)})]}))}if("kpi"===l.source&&t.insights&&!(null==m?void 0:m.as)){var N=t.insights.metrics[_],S=l.format&&"number"!==l.format?null:a.formatFigure(null==N?void 0:N.value,null===(f=z.kpis[_])||void 0===f?void 0:f.format),C=null!=S?S:v(null==N?void 0:N.value,l.format),D=null==(null==N?void 0:N.deltaPct)?"—":"".concat(N.deltaPct>0?"↑":N.deltaPct<0?"↓":""," ").concat(Math.abs(N.deltaPct),"%");return"delta"===l.show?n.jsx("span",e.__assign({className:(null==N?void 0:N.tone)?"ag-drill__change--".concat(N.tone):void 0},{children:D})):"value"===l.show?C:n.jsxs("span",e.__assign({className:"ag-drill__metric"},{children:[n.jsx("strong",{children:C}),n.jsx("small",e.__assign({className:(null==N?void 0:N.tone)?"ag-drill__change--".concat(N.tone):void 0},{children:D}))]}))}if("children"===l.source&&t.insights&&!(null==m?void 0:m.as)){var T=Array.from(new Set(x)),E=null!==(g=l.max)&&void 0!==g?g:3,I=T.length?"".concat(T.slice(0,E).join(", ")).concat(T.length>E?" +".concat(T.length-E):""):null!==(h=l.emptyText)&&void 0!==h?h:"—";return n.jsx("span",e.__assign({className:"ag-drill__contributors",title:T.join(", ")||void 0},{children:I}))}var A=null!==(p=null==m?void 0:m.as)&&void 0!==p?p:l.format;if("link"===A){var O="string"==typeof x?x:"";return/^https:\/\//i.test(O)?n.jsx("a",e.__assign({href:O,target:"_blank",rel:"noopener noreferrer"},{children:O})):v(x,"text")}var R=v(x,"chip"===A?"text":A);return"—"===R&&l.emptyText?l.emptyText:"chip"!==A&&!(null==m?void 0:m.colors)||"—"===R?R:n.jsx(b,{text:R.replace(/_/g," "),value:x,colors:null==m?void 0:m.colors})},kn=function(e){e.insights&&(null==L||L(e.insights,un))},Kn=Pe.buttons.length>0,Nn=function(e){var n;return null!==(n=e.align)&&void 0!==n?n:"kpi"===e.source?"right":"left"},Sn="ag-drill-".concat(String(null!==(I=M.id)&&void 0!==I?I:bn).replace(/[^a-z0-9]+/gi,"-")),Cn=!1!==M.search&&"movers"!==ze;return n.jsxs("section",e.__assign({className:"ag-drill".concat(F?" ".concat(F):""),"aria-labelledby":Sn,style:null===(A=null==on?void 0:on.card)||void 0===A?void 0:A.root},{children:[n.jsxs("header",e.__assign({className:"ag-drill__header",style:null===(O=null==on?void 0:on.card)||void 0===O?void 0:O.header},{children:[n.jsxs("div",{children:[n.jsx("h3",e.__assign({id:Sn,style:null===(R=null==on?void 0:on.card)||void 0===R?void 0:R.title},{children:bn})),"movers"===ze?n.jsxs("span",{children:["Rows that moved",q.day?" on ".concat(i.formatHeaderDate(q.day)):""]}):null]}),Cn?n.jsxs("label",e.__assign({className:"ag-drill__search"},{children:[n.jsx(t.Search,{"aria-hidden":"true"}),n.jsx("input",{type:"search",value:V,onChange:function(e){return Y(e.target.value)},placeholder:"Search ".concat(hn.toLowerCase(),"…"),"aria-label":"Search ".concat(hn)})]})):null]})),Qe?n.jsx(u,{range:Ye,dashboardRange:{start:r.toIsoDay(z.range.startDate),end:r.toIsoDay(z.range.endDate)},onApply:function(e){return Be({scope:Ge,range:e})}},"".concat(Ge,":").concat(Ye.start,":").concat(Ye.end)):null,J.length>1?n.jsx("div",e.__assign({className:"ag-drill__tabs",role:"tablist","aria-label":"What this table lists"},{children:J.map(function(t,l){var r;return n.jsx("button",e.__assign({type:"button",role:"tab","aria-selected":l===X,className:l===X?"is-active":void 0,onClick:function(){G(l),Y(""),ee(""),le(M.defaultSort)}},{children:pn(t)}),"".concat(t.source,":").concat(null!==(r=t.entityKey)&&void 0!==r?r:t.tableKey,":").concat(l))})})):null,Ne?n.jsxs("p",e.__assign({className:"ag-drill__notice ag-drill__notice--".concat(Ne.tone),role:"status"},{children:[Ne.text,n.jsx("button",e.__assign({type:"button","aria-label":"Dismiss",onClick:function(){return Se(null)}},{children:n.jsx(t.X,{"aria-hidden":"true"})}))]})):null,n.jsxs("div",e.__assign({className:"ag-drill__table-wrap","aria-live":"polite"},{children:[n.jsxs("table",e.__assign({className:"ag-drill__table"},{children:[n.jsx("thead",{children:n.jsxs("tr",{children:[an?an.map(function(t){var l,r,i=rn.find(function(e){return e.key===t.key}),o=e.__assign(e.__assign({},i),{key:t.key,source:null!==(l=null==i?void 0:i.source)&&void 0!==l?l:"field",sortable:null!==(r=t.sortable)&&void 0!==r?r:null==i?void 0:i.sortable});return n.jsx("th",e.__assign({className:t.headerClassName,style:e.__assign(e.__assign({},t.style),t.headerStyle),"aria-sort":(null==te?void 0:te.key)===t.key?"asc"===te.order?"ascending":"descending":void 0},{children:vn(o)?n.jsxs("button",e.__assign({type:"button",onClick:function(){return yn(o)}},{children:[t.header,n.jsx("span",e.__assign({"aria-hidden":"true"},{children:(null==te?void 0:te.key)===t.key?"asc"===te.order?"↑":"↓":"↕"}))]})):t.header}),t.key)}):rn.map(function(t){var l,r,i,o,a,s=null!==(r=null!==(l=t.key)&&void 0!==l?l:t.id)&&void 0!==r?r:"",u=null!==(i=t.label)&&void 0!==i?i:"kpi"===t.source?z.kpiLabel(s):"children"===t.source?z.entityPluralName(null!==(o=t.childEntityKey)&&void 0!==o?o:""):c(null!==(a=s.split(".").pop())&&void 0!==a?a:s);return n.jsx("th",e.__assign({className:"ag-drill__col--".concat(Nn(t)," ").concat(t.hideBelow?"ag-drill__hide--".concat(t.hideBelow):""),style:{width:t.width},"aria-sort":(null==te?void 0:te.key)===s?"asc"===te.order?"ascending":"descending":void 0},{children:vn(t)?n.jsxs("button",e.__assign({type:"button",onClick:function(){return yn(t)}},{children:[u,n.jsx("span",e.__assign({"aria-hidden":"true"},{children:(null==te?void 0:te.key)===s?"asc"===te.order?"↑":"↓":"↕"}))]})):u}),"".concat(t.source,":").concat(s))}),Kn?n.jsx("th",{children:n.jsx("span",e.__assign({className:"ins-visually-hidden"},{children:"Actions"}))}):null,cn?n.jsx("th",{children:n.jsx("span",e.__assign({className:"ins-visually-hidden"},{children:"Open"}))}):null]})}),n.jsx("tbody",{children:dn.map(function(l){return n.jsxs("tr",e.__assign({className:cn?void 0:"is-static",tabIndex:cn?0:void 0,onClick:cn?function(e){e.target.closest("a,button,input,select,textarea")||kn(l)}:void 0,onKeyDown:cn?function(e){return function(e,n){cn&&e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),kn(n)))}(e,l)}:void 0},{children:[an?(r=sn(l),an.map(function(t){return n.jsx("td",e.__assign({className:t.bodyClassName,style:e.__assign(e.__assign({},t.style),t.bodyStyle)},{children:t.body(r)}),t.key)})):rn.map(function(t,r){var i,o,a=0===r?"th":"td",s=null===(i=jn(t))||void 0===i?void 0:i.className;return n.jsx(a,e.__assign({scope:0===r?"row":void 0,className:"ag-drill__col--".concat(Nn(t)," ").concat(t.hideBelow?"ag-drill__hide--".concat(t.hideBelow):"").concat(s?" ".concat(s):"")},{children:wn(l,t)}),"".concat(t.source,":").concat(null!==(o=t.key)&&void 0!==o?o:t.id))}),Kn?n.jsx("td",e.__assign({className:"ag-drill__buttons"},{children:mn(l).map(function(t){var r,i,o=Ie==="".concat(l.id,":").concat(null!==(r=t.id)&&void 0!==r?r:t.label);return n.jsx("button",e.__assign({type:"button",disabled:o,"aria-busy":o||void 0,onClick:function(){return function(e,n){var t,l=e.confirm?f(e.confirm,y(z,q,n),{},!1):"";"call"!==e.type||!(null!==(t=e.ask)&&void 0!==t?t:[]).length&&!l?l&&!window.confirm(l)||xn(e,n,{}):Te({button:e,row:n,question:l})}(t,l)}},{children:o?"…":t.label}),null!==(i=t.id)&&void 0!==i?i:t.label)})})):null,cn?n.jsx("td",{children:n.jsx(t.ChevronRight,{className:"ag-drill__open","aria-hidden":"true"})}):null]}),l.id);var r})})]})),me&&!ie.length?n.jsx("p",e.__assign({className:"ag-drill__state"},{children:"Loading rows…"})):null,me||dn.length||we?null:n.jsx("p",e.__assign({className:"ag-drill__state"},{children:"No rows found."})),we?n.jsx("p",e.__assign({className:"ag-drill__state ag-drill__state--error"},{children:we})):null]})),n.jsxs("footer",e.__assign({className:"ag-drill__footer"},{children:[n.jsx("span",{children:"rows"===ze&&pe?"".concat(ie.length," of ").concat(pe):""}),fe?n.jsx("button",e.__assign({type:"button",onClick:function(){return e.__awaiter(B,void 0,void 0,function(){var n,t,l,r;return e.__generator(this,function(i){switch(i.label){case 0:if(me||!fe)return[2];n=Me.current,xe(!0),ke(null),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,ln(!0,null==n?void 0:n.signal)];case 2:return!(t=i.sent())||(null==n?void 0:n.signal.aborted)?[2]:(oe(function(n){return e.__spreadArray(e.__spreadArray([],n,!0),t.rows,!0)}),ge(t.hasMore),ue(null!==(r=t.cursor)&&void 0!==r?r:null),ve(t.offset),[3,5]);case 3:return l=i.sent(),(null==n?void 0:n.signal.aborted)||ke(l instanceof Error?l.message:"More rows couldn't be loaded."),[3,5];case 4:return(null==n?void 0:n.signal.aborted)||xe(!1),[7];case 5:return[2]}})})},disabled:me},{children:me?"Loading…":"Show more"})):null]})),De?n.jsx(m,{button:De.button,question:De.question,onCancel:function(){return Te(null)},onSubmit:function(e){var n=De.button,t=De.row;Te(null),xn(n,t,e)}}):null]}))};
2
+ //# sourceMappingURL=DrillTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrillTable.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),i=require("react/jsx-runtime"),n={high:"High correlation",medium:"Medium correlation",low:"Low correlation",none:"No correlation"};exports.default=function(r){var t,o,l=r.driver,a=r.kpiId,s=r.kpiLabel,c=r.formatKpi,d=null===(t=l.correlation)||void 0===t?void 0:t.strength,u="string"==typeof d?[["",d]]:Object.entries(null!=d?d:{}).filter(function(e){return null!=e[1]}),v=null!==(o=["high","medium","low","none"].find(function(e){return u.some(function(i){return i[1]===e})}))&&void 0!==o?o:d&&"object"==typeof d?"none":void 0,p=u.map(function(e){var i=e[0],r=e[1];return r&&n[r]?"".concat(i?"".concat(s(i)," · "):"").concat(n[r]):""}).filter(Boolean).join("\n"),g=l.drivingMetric,_="string"==typeof g?g:null==g?void 0:g.kpiId,h="object"==typeof g?null==g?void 0:g.value:null;return i.jsxs("span",e.__assign({className:"ag-driver__activity ag-driver__activity--aligned"},{children:[i.jsx("span",e.__assign({className:"ag-driver__correlations"},{children:v?i.jsx("span",e.__assign({title:p||void 0,className:"ag-driver__badge ag-driver__badge--".concat(v)},{children:n[v]})):null})),i.jsx("span",e.__assign({className:"ag-driver__activity-value"},{children:_&&null!=h?i.jsxs(i.Fragment,{children:[i.jsx("strong",{children:c(_,h)}),i.jsx("span",{children:"object"==typeof g&&(null==g?void 0:g.label)?g.label:s(_)})]}):i.jsxs(i.Fragment,{children:[i.jsx("strong",{children:null!=l.previous?c(a,l.previous):"—"})," ",i.jsx("span",{children:"with"===l.direction?"Moved with":"opposite"===l.direction?"Moved opposite":"Previous"})]})}))]}))};
2
+ //# sourceMappingURL=DriverActivity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DriverActivity.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),t=require("./insightsContextCore.js");exports.default=function(n){var i=n.context,s=t.useInsights(),l=null==i?void 0:i.filters;if(!l)return null;var u=(Array.isArray(l.ignored)?l.ignored:[]).map(function(e){return"string"==typeof e?e:e.key}).filter(function(e){return Boolean(e)}).map(function(e){return(null==s?void 0:s.sidebarFilterLabel(e))||e});return u.length?r.jsx("p",e.__assign({className:"ag-muted",role:"status"},{children:"Not filtered by ".concat(u.join(", "),": showing all data.")})):null};
2
+ //# sourceMappingURL=FilterNotice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterNotice.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),t=require("react"),a=require("lucide-react"),i=require("./AgReport.js"),r=require("./L1Report.js"),l=require("./DrillLevel.js"),s=require("./agPrimitives.js"),o=require("./insightsFormat.js"),d=require("../../api/insightsApi.js"),u=require("./insightsContextCore.js"),c=require("./insightsUtils.js");require("react-markdown"),require("remark-gfm"),require("rehype-raw");var p=require("../IntegrationTracking/TrackingBanner.js"),_=require("../IntegrationTracking/ useModeTrackingStatus.js");function g(i){var r,o,d,g,y=i.target,v=i.onClose,m=i.onOpenL1,h=i.onOpenL2,f=t.useRef(null),b=t.useRef(null),K=u.useInsights(),j=y.kpiId,N=t.useState([]),x=N[0],I=N[1];t.useEffect(function(){return I([])},[y.row.nodeKey]);var k=e.__assign(e.__assign({},l.popupRowFromTable(K,e.__assign(e.__assign({},y.row),{entityKey:null!==(r=y.row.entityKey)&&void 0!==r?r:y.l2.tab.entityKey}))),{reportId:y.row.report.kpiId===j?y.row.report.reportId:null}),D=e.__spreadArray([k],x,!0),E=D[D.length-1];c.useScrollToTopOnStep(b,D.map(function(e){return e.nodeKey}).join(">"));var w=t.useState(y.dataDay),C=w[0],T=w[1],R=t.useState(E.reportId?null:y.dataDay),O=R[0],S=R[1];t.useEffect(function(){return T(y.dataDay)},[y.dataDay,y.row.nodeKey]),t.useEffect(function(){return S(k.reportId?null:y.dataDay)},[k.reportId,y.dataDay,y.row.nodeKey]),c.useInsightsModal(v,f);var L=k.label,q=null!==(o=null==K?void 0:K.matchDrillLevel(E.entityKey,D.slice(0,-1).map(function(e){return e.entityKey})))&&void 0!==o?o:l.DEFAULT_LEVEL,A=E.label||E.nodeKey||L,M=t.useState(!1),P=M[0],F=M[1],G=_.useModeTrackingStatus(A,"InsightTableModal",null===(d=null==K?void 0:K.api)||void 0===d?void 0:d.accessToken,null==K?void 0:K.eventsBaseUrl,null==K?void 0:K.intervalDays),X=G.isChecking,B=G.showBanner;return t.useEffect(function(){F(!1)},[A]),n.jsxs("div",e.__assign({className:"ag-modal",role:"presentation",onMouseDown:function(e){return e.target===e.currentTarget&&v()}},{children:[n.jsxs("div",e.__assign({className:"ag-modal__dialog",role:"dialog","aria-modal":"true","aria-labelledby":"ag-l2-row-modal-title"},{children:[n.jsxs("header",e.__assign({className:"ag-modal__head"},{children:[n.jsxs("div",e.__assign({className:"ag-modal__detail-title"},{children:[n.jsxs("div",e.__assign({className:"ag-modal__breadcrumb"},{children:[n.jsx("button",e.__assign({type:"button",onClick:m},{children:"L1"})),n.jsx(a.ChevronRight,{"aria-hidden":"true"}),n.jsxs("button",e.__assign({type:"button",onClick:h},{children:["Top ",null!==(g=null==K?void 0:K.entityPluralName(y.l2.tab.entityKey))&&void 0!==g?g:y.partName]})),n.jsx(a.ChevronRight,{"aria-hidden":"true"}),x.length?n.jsx("button",e.__assign({type:"button",onClick:function(){return I([])}},{children:L})):n.jsx("strong",e.__assign({id:"ag-l2-row-modal-title"},{children:L})),x.map(function(t,i){return n.jsxs("span",e.__assign({className:"ag-modal__crumb"},{children:[n.jsx(a.ChevronRight,{"aria-hidden":"true"}),i===x.length-1?n.jsxs("strong",e.__assign({id:"ag-l2-row-modal-title",title:t.partName},{children:[t.partName?"".concat(t.partName,": "):"",t.label]})):n.jsxs("button",e.__assign({type:"button",title:t.partName,onClick:function(){return I(function(e){return e.slice(0,i+1)})}},{children:[t.partName?"".concat(t.partName,": "):"",t.label]}))]}),"".concat(t.nodeKey,"-").concat(i))})]})),n.jsx("span",e.__assign({className:"ag-modal__date"},{children:s.periodHeading(O||C,null==K?void 0:K.period.grain)}))]})),n.jsx("button",e.__assign({ref:f,type:"button",className:"ag-modal__close","aria-label":"Close",onClick:v},{children:n.jsx(a.X,{"aria-hidden":"true"})}))]})),n.jsx("div",e.__assign({className:"ag-modal__body"},{children:n.jsx(l.default,{trail:D,level:q,kpiId:j,dataDay:C,reportDay:O,onReportDay:function(e){T(e),S(e)},tier2Kpis:y.tier2Kpis,onOpen:function(n){return I(function(t){return e.__spreadArray(e.__spreadArray([],t,!0),[n],!1)})}})}))]})),n.jsx(p.IntegrationRequiredModal,{open:!P&&(B||X),loading:X,onClose:function(){return F(!0)},mode:A,integrationDocs:null==K?void 0:K.integrationDocs})]}))}function y(r){var l=r.target,o=r.onClose,d=r.onOpenL1,p=r.onOpenRow,_=t.useRef(null),g=u.useInsights(),y=c.useInsightsModal(o,_);return g?n.jsx("div",e.__assign({className:y,role:"presentation",onMouseDown:function(e){return e.target===e.currentTarget&&o()}},{children:n.jsxs("div",e.__assign({className:"ag-modal__dialog",role:"dialog","aria-modal":"true","aria-labelledby":"ag-l2-overview-modal-title"},{children:[n.jsxs("header",e.__assign({className:"ag-modal__head"},{children:[n.jsxs("div",e.__assign({className:"ag-modal__detail-title"},{children:[n.jsxs("div",e.__assign({className:"ag-modal__breadcrumb"},{children:[n.jsx("button",e.__assign({type:"button",onClick:d},{children:"L1"})),n.jsx(a.ChevronRight,{"aria-hidden":"true"}),n.jsxs("strong",e.__assign({id:"ag-l2-overview-modal-title"},{children:["Top ",g.entityPluralName(l.tab.entityKey)]}))]})),n.jsx("span",e.__assign({className:"ag-modal__date"},{children:s.periodHeading(l.dataDay,g.period.grain)}))]})),n.jsx("button",e.__assign({ref:_,type:"button",className:"ag-modal__close","aria-label":"Close",onClick:o},{children:n.jsx(a.X,{"aria-hidden":"true"})}))]})),n.jsx("div",e.__assign({className:"ag-modal__body"},{children:n.jsx(i.L2Report,{tab:l.tab,title:l.title,partName:l.partName,partKpis:l.partKpis,search:"",dataDay:l.dataDay,onOpenRow:function(e,n,t){var a;return p({row:e,partName:l.partName,kpiId:g.headlineKpi||n,dataDay:t,tier2Kpis:null!==(a=l.tab.tier2Kpis)&&void 0!==a?a:g.tierKpis[2],l2:l})}})}))]}))})):null}exports.default=function(l){var s,p,_,v=l.tabs,m=l.insightsConfig,h=u.useInsights(),f=t.useState(0),b=f[0],K=f[1],j=t.useState(!1),N=j[0],x=j[1],I=t.useState(""),k=I[0],D=I[1],E=t.useState(""),w=E[0],C=E[1],T=t.useState(null),R=T[0],O=T[1],S=t.useState(null),L=S[0],q=S[1],A=t.useState(null),M=A[0],P=A[1];t.useEffect(function(){var e=setTimeout(function(){return C(k.trim())},300);return function(){return clearTimeout(e)}},[k]),t.useEffect(function(){D(""),C("")},[b]);var F=t.useMemo(function(){var e,n={};return(null!==(e=null==m?void 0:m.hierarchy)&&void 0!==e?e:[]).forEach(function(e){var t;return(null!==(t=e.entities)&&void 0!==t?t:[]).forEach(function(e){var t,a;(null==e?void 0:e.entityKey)&&(n[e.entityKey]={name:null!==(t=e.name)&&void 0!==t?t:"",kpis:null!==(a=e.kpis)&&void 0!==a?a:[]})})}),n},[m]);if(t.useEffect(function(){if(h){var n=h.entityOrder.length?e.__spreadArray([],v,!0).sort(function(e,n){var t=h.entityOrder.indexOf(e.entityKey),a=h.entityOrder.indexOf(n.entityKey);return(t<0?Number.MAX_SAFE_INTEGER:t)-(a<0?Number.MAX_SAFE_INTEGER:a)}):v,t=function(e){var t,a,i,r,l,s,u=e,c=u.detail,p=(null==c?void 0:c.entityKey)?n.findIndex(function(e){return e.entityKey===c.entityKey}):-1;if(c&&!(p<0)){var _=n[p],g=(null===(t=F[_.entityKey])||void 0===t?void 0:t.name)||_.title||h.entityName(_.entityKey)||_.entityKey,y=h.headlineKpi||_.rankBy||(null===(a=_.listKpis)||void 0===a?void 0:a[0])||(null===(i=F[_.entityKey])||void 0===i?void 0:i.kpis[0])||"",v=c.dataDay||o.periodStart(d.toIsoDay(h.range.endDate),h.period.grain),m={tab:_,title:_.title||g,partName:g,partKpis:null!==(l=null===(r=F[_.entityKey])||void 0===r?void 0:r.kpis)&&void 0!==l?l:[],dataDay:v};u.preventDefault(),P(null),q(null),K(p),O({row:{rank:0,nodeKey:c.nodeKey,label:c.label,parent:null,metrics:{},barPct:null,chip:null,report:{reportId:null,status:"none",kpiId:y},action:null,children:[]},partName:g,kpiId:y,dataDay:v,tier2Kpis:null!==(s=_.tier2Kpis)&&void 0!==s?s:h.tierKpis[2],l2:m})}};return window.addEventListener(c.OPEN_INSIGHTS_ENTITY_REPORT,t),function(){return window.removeEventListener(c.OPEN_INSIGHTS_ENTITY_REPORT,t)}}},[h,v,F]),!h||!v.length)return null;var G=h.entityOrder.length?e.__spreadArray([],v,!0).sort(function(e,n){var t=h.entityOrder.indexOf(e.entityKey),a=h.entityOrder.indexOf(n.entityKey);return(t<0?Number.MAX_SAFE_INTEGER:t)-(a<0?Number.MAX_SAFE_INTEGER:a)}):v,X=Math.min(b,G.length-1),B=G[X],H=function(e){var n;return e.title||h.entityName(e.entityKey)||(null===(n=F[e.entityKey])||void 0===n?void 0:n.name)||e.entityKey},U=(null===(s=F[B.entityKey])||void 0===s?void 0:s.name)||H(B);return n.jsxs("div",e.__assign({className:"ag-tabs"},{children:[n.jsx("div",e.__assign({className:"ag-tabs__head"},{children:n.jsxs("div",e.__assign({className:"ag-tabs__bar"},{children:[n.jsx("div",e.__assign({className:"ag-tabs__list",role:"tablist","aria-label":"Insights"},{children:G.map(function(t,a){return n.jsx("button",e.__assign({id:"ag-tab-".concat(a),type:"button",role:"tab","aria-selected":a===X,"aria-controls":"ag-tabpanel",className:a===X?"is-active":void 0,onClick:function(){O(null),K(a)}},{children:H(t)}),"".concat(t.entityKey,"-").concat(a))})})),n.jsx("button",e.__assign({type:"button",className:"ag-icon-button","aria-label":N?"Expand insights":"Collapse insights","aria-expanded":!N,onClick:function(){return x(function(e){return!e})}},{children:n.jsx(a.ChevronDown,{"aria-hidden":"true",className:N?"is-closed":"is-open"})}))]}))})),N?null:n.jsxs("div",e.__assign({className:"ag-tabs__body",role:"tabpanel",id:"ag-tabpanel","aria-labelledby":"ag-tab-".concat(X)},{children:[n.jsx(i.L2Report,{tab:B,title:H(B),partName:U,partKpis:null!==(_=null===(p=F[B.entityKey])||void 0===p?void 0:p.kpis)&&void 0!==_?_:[],search:w,headerAction:n.jsxs("label",e.__assign({className:"ag-search"},{children:[n.jsx(a.Search,{"aria-hidden":"true"}),n.jsx("input",{type:"search",value:k,onChange:function(e){return D(e.target.value)},placeholder:"Search ".concat(U.toLowerCase(),"..."),"aria-label":"Search ".concat(h.entityPluralName(B.entityKey))})]})),onOpenRow:function(n,t,a){var i,r,l,s,o,d,u=null!==(i=n.entityKey)&&void 0!==i?i:B.entityKey;h.matchDrillLevel(u,[])?O({row:e.__assign(e.__assign({},n),{entityKey:u}),partName:U,kpiId:h.headlineKpi||t,dataDay:a,tier2Kpis:null!==(s=B.tier2Kpis)&&void 0!==s?s:h.tierKpis[2],l2:{tab:B,title:H(B),partName:U,partKpis:null!==(d=null===(o=F[B.entityKey])||void 0===o?void 0:o.kpis)&&void 0!==d?d:[],dataDay:a}}):h.openReport({reportId:null===(r=n.report)||void 0===r?void 0:r.reportId,nodeKey:n.nodeKey,kpiId:h.headlineKpi||t,dataDay:a,title:null!==(l=n.label)&&void 0!==l?l:n.nodeKey})}},X),R?n.jsx(g,{target:R,onClose:function(){return O(null)},onOpenL1:function(){P(R.dataDay),O(null)},onOpenL2:function(){q(R.l2),O(null)}}):null,L?n.jsx(y,{target:L,onClose:function(){return q(null)},onOpenL1:function(){P(L.dataDay),q(null)},onOpenRow:function(e){O(e),q(null)}}):null,M?n.jsx(r.L1ReportModal,{day:M,workingDays:Boolean(h.defaultWorkingDays),onClose:function(){return P(null)}}):null]}))]}))};
2
+ //# sourceMappingURL=InsightTabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InsightTabs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),i=require("react/jsx-runtime"),n=require("react"),t=require("./ReportDrawer.js"),l=require("./insightsUtils.js"),r=require("./insightsContextCore.js"),o=require("../../api/insightsApi.js"),a=require("./insightsFilters.js"),s=require("../RcaDecisionComponent/CitationMarkdown.js"),u=require("./insightsFormat.js");function d(e){var i,n,t=null!==(n=null===(i=null==e?void 0:e.analysis)||void 0===i?void 0:i.movingAverageDays)&&void 0!==n?n:{},l=function(e,i){return Number.isFinite(Number(e))&&Number(e)>0?Number(e):i};return{fast:l(t.fast,3),slow:l(t.slow,7),long:l(t.long,30),unit:u.periodWordsOf(null==e?void 0:e.grain).unit}}exports.useInsights=r.useInsights,exports.InsightsProvider=function(v){var c,f,y,p,g=v.dashboardKpiCards,h=v.baseUrl,m=v.configId,b=v.accessToken,D=v.eventsBaseUrl,T=v.intervalDays,k=v.integrationDocs,K=v.startDate,w=v.endDate,_=v.workingDaysOnly,C=v.filtersActive,I=v.insights,A=v.decisionAdvantage,j=v.insightsDrill,x=v.insightsLabels,F=v.renderInsightsCell,O=v.sidebarFilters,N=v.sidebarFilterConfig,E=v.tableBuilder,R=v.approvedApiHosts,M=v.actionHandlers,U=v.cellRenderers,q=v.tables,L=v.headlineKpiId,S=v.areaFills,B=v.defaultWorkingDays,H=void 0!==B&&B,P=v.reportTarget,W=v.onReportTargetChange,G=v.refreshRevision,V=void 0===G?0:G,J=v.resolveExcelCitationGcsUrl,z=v.children,Q=n.useState(0),X=Q[0],Y=Q[1],Z=n.useMemo(function(){return{baseUrl:h,configId:null!=m?m:"",accessToken:b}},[h,m,b]),$=n.useMemo(function(){return null!=J?J:s.createCwGcsResolver(h,b)},[J,h,b]),ee=l.useInsightsFetch(m?function(e){return o.fetchHierarchy(Z,e)}:null,[Z,X,V]),ie=o.toIsoDay(K),ne=o.toIsoDay(w),te=n.useMemo(function(){var i,n,t,r,o,s,v,c,f,y,p,h,m,K,w,B,P,G,J,z,Q,$,te,le,re,oe={},ae={},se={},ue={},de={},ve={};(null!==(i=null==I?void 0:I.hierarchy)&&void 0!==i?i:[]).forEach(function(e,i){var n;return(null!==(n=e.entities)&&void 0!==n?n:[]).forEach(function(n){var t,l,r,o,a;if(null==n?void 0:n.entityKey){oe[n.entityKey]=Number(e.level)||i+1,ue[n.entityKey]=null!==(t=n.parentEntityKeys)&&void 0!==t?t:[],de[n.entityKey]=null!==(l=n.kpis)&&void 0!==l?l:[],ae[n.entityKey]=null!==(r=n.name)&&void 0!==r?r:n.entityKey,se[n.entityKey]=null!==(a=null!==(o=n.pluralName)&&void 0!==o?o:n.name)&&void 0!==a?a:n.entityKey;var s=n.labelColumn||n.splitBy;s&&(ve[n.entityKey]=s)}})}),null===(n=ee.data)||void 0===n||n.levels.forEach(function(e,i){e.entities.forEach(function(n){var t;oe[n.entityKey]=Number(e.level)||i+1,ae[n.entityKey]=n.name,se[n.entityKey]=null!==(t=n.pluralName)&&void 0!==t?t:n.name,n.parentEntityKeys&&(ue[n.entityKey]=n.parentEntityKeys),n.kpis&&(de[n.entityKey]=n.kpis)})});var ce={};(null!==(t=null==I?void 0:I.kpis)&&void 0!==t?t:[]).forEach(function(e){(null==e?void 0:e.kpiId)&&(ce[e.kpiId]=e)});var fe={1:[],2:[]};(null!==(r=null==I?void 0:I.kpis)&&void 0!==r?r:[]).forEach(function(e){!(null==e?void 0:e.kpiId)||1!==e.tier&&2!==e.tier||fe[e.tier].push(e.kpiId)});var ye=null!==(v=null!==(s=null!==(o=L&&ce[L]?L:null)&&void 0!==o?o:fe[1][0])&&void 0!==s?s:fe[2][0])&&void 0!==v?v:null,pe=null!==(f=null===(c=ee.data)||void 0===c?void 0:c.levels.flatMap(function(e){return e.entities.map(function(e){return e.entityKey})}))&&void 0!==f?f:(null!==(y=null==I?void 0:I.hierarchy)&&void 0!==y?y:[]).flatMap(function(e){var i;return(null!==(i=e.entities)&&void 0!==i?i:[]).map(function(e){return e.entityKey})}),ge={trendTitle:"Trend",trendCardTitle:"{kpi} trend",trendCardSubtitle:"{kpi} movement across the selected date range.",trendChartTitle:"",activityTitle:"User Activity",activityColumn:"User Activity",platformScope:"Platform-wide",correlationTitle:"Usage vs. {kpi}",correlationSubtitle:"{kpi} vs. usage - % change from the first day shown",visualsTitle:"Trend & Usage Signals",analysisTitle:"Summary, Drivers & RCA",driverCategory:"Top {plural}",driversTab:"Top Drivers",headwindsTab:"Headwinds",attentionTab:"Needs attention",shareLine:"{share}% of today's movement",movedWith:"Moved with",movedOpposite:"Moved opposite",previousDay:{working:"vs previous working day",weekend:"vs previous weekend day"},drillTableTitle:"{plural} in {row}",decisionAdvantageTitle:"Decision Advantage"},he={tabTables:Object.fromEntries((null!==(h=null===(p=null==A?void 0:A.tabs)||void 0===p?void 0:p.items)&&void 0!==h?h:[]).map(function(e){return[e.entityKey,e.table]})),levels:null!==(m=null==A?void 0:A.drillLevels)&&void 0!==m?m:[]},me="function"==typeof j?j(he):e.__assign(e.__assign({},he),null!=j?j:{}),be=null!==(K=me.levels)&&void 0!==K?K:[],De=a.resolveInsightsSidebarFilters(O,N),Te=De.filters,ke=De.labels,Ke=new Map((null!=E?E:[]).filter(function(e){return null==e?void 0:e.key}).map(function(e){return[e.key,e]}));return{dashboardKpiCards:g,api:Z,headlineKpi:ye,tierKpis:fe,defaultWorkingDays:H,range:{startDate:new Date("".concat(ie,"T00:00:00")),endDate:new Date("".concat(ne,"T00:00:00")),workingDaysOnly:_,filters:Te},rangeKey:"".concat(ie,":").concat(ne,":").concat(_?1:0,":").concat(JSON.stringify(Te)),filtersActive:Boolean(C)&&Object.keys(Te).length>0,kpis:ce,kpiLabel:function(e){var i;return(null===(i=ce[e])||void 0===i?void 0:i.label)||e},formatKpi:function(e,i){var n,t;return null!==(t=u.formatFigure(i,e?null===(n=ce[e])||void 0===n?void 0:n.format:null))&&void 0!==t?t:l.formatValue(i)},formatKpiAxis:function(e,i){var n,t;return null!==(t=u.formatAxisFigure(i,e?null===(n=ce[e])||void 0===n?void 0:n.format:null))&&void 0!==t?t:l.formatValue(i)},period:u.periodWordsOf(null==I?void 0:I.grain),goodDirection:function(e){var i;return"down"===(null===(i=ce[e])||void 0===i?void 0:i.goodDirection)?"down":"up"},levelOf:function(e){return e&&oe[e]||1},entityName:function(e){return ae[e]||e},entityPluralName:function(e){return se[e]||ae[e]||e},entityKpis:function(e){var i;return null!==(i=de[e])&&void 0!==i?i:[]},entityOrder:pe,isChildOf:function(e,i){var n;return(null!==(n=ue[e])&&void 0!==n?n:[]).includes(i)},decisionAdvantage:A,labels:e.__assign(e.__assign(e.__assign(e.__assign({},ge),null!==(w=null==A?void 0:A.labels)&&void 0!==w?w:{}),null!=x?x:{}),{previousDay:e.__assign(e.__assign(e.__assign({},ge.previousDay),null!==(P=null===(B=null==A?void 0:A.labels)||void 0===B?void 0:B.previousDay)&&void 0!==P?P:{}),null!==(G=null==x?void 0:x.previousDay)&&void 0!==G?G:{})}),tierTitles:{1:null!==(z=null===(J=null==A?void 0:A.tierTitles)||void 0===J?void 0:J[1])&&void 0!==z?z:"Trend",2:null!==($=null===(Q=null==A?void 0:A.tierTitles)||void 0===Q?void 0:Q[2])&&void 0!==$?$:"User Activity"},drill:{tabTables:null!==(te=me.tabTables)&&void 0!==te?te:{},levels:be},matchDrillLevel:function(e,i){return be.filter(function(n){var t;return n.match.entityKey===e&&(null!==(t=n.match.within)&&void 0!==t?t:[]).every(function(e){return i.includes(e)})}).sort(function(e,i){var n,t,l,r;return(null!==(t=null===(n=i.match.within)||void 0===n?void 0:n.length)&&void 0!==t?t:0)-(null!==(r=null===(l=e.match.within)||void 0===l?void 0:l.length)&&void 0!==r?r:0)})[0]},labelColumnOf:function(e){var i;return null!==(i=ve[e])&&void 0!==i?i:null},sidebarFilters:Te,sidebarFilterLabel:function(e){return(null==ke?void 0:ke[e])||e},tableSource:function(e){return Ke.get(e)},approvedApiHosts:(null!=R?R:[]).map(function(e){return e.trim().toLowerCase()}).filter(Boolean),actionHandlers:null!=M?M:{},cellRenderers:null!=U?U:{},hostTables:null!=q?q:{},renderInsightsCell:F,windows:d(I),openReport:W,viewer:l.viewerFromToken(b),minReasonLength:Math.max(1,Number(null===(re=null===(le=null==I?void 0:I.analysis)||void 0===le?void 0:le.outliers)||void 0===re?void 0:re.minReasonLength)||10),revision:X+V,refresh:function(){return Y(function(e){return e+1})},eventsBaseUrl:D,intervalDays:T,integrationDocs:k,areaFillOf:function(e){return S&&e in S?{opacity:S[e]}:null}}},[g,Z,ie,ne,_,C,I,A,j,x,F,O,N,E,R,M,U,q,L,S,H,W,X,V,ee.data,D,T,k]);return i.jsx(r.InsightsContext.Provider,e.__assign({value:te},{children:i.jsxs(s.ExcelGcsResolverContext.Provider,e.__assign({value:$},{children:[z,P?i.jsx(t.default,{target:P,onClose:function(){return W(null)}},"".concat(null!==(c=P.reportId)&&void 0!==c?c:"",":").concat(null!==(f=P.nodeKey)&&void 0!==f?f:"",":").concat(null!==(y=P.kpiId)&&void 0!==y?y:"",":").concat(null!==(p=P.dataDay)&&void 0!==p?p:"")):null]}))}))};
2
+ //# sourceMappingURL=InsightsContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InsightsContext.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}