@e-llm-studio/federated-dashboard-components 2.2.9-rca-test-3 → 2.2.10

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 (176) hide show
  1. package/dist/ExecutiveDashboard/ExecutiveDashboardWrapper.js +1 -1
  2. package/dist/ExecutiveDashboard/components/DashboardGrid/buildDashboardWidgets.js +1 -1
  3. package/dist/ExecutiveDashboard/components/ExecutiveDashboard.js +1 -1
  4. package/dist/ExecutiveDashboard/components/Graph/Graph.js +1 -1
  5. package/dist/ExecutiveDashboard/components/Graph/LineChart.js +1 -1
  6. package/dist/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.js +1 -1
  7. package/dist/ExecutiveDashboard/components/Table/TableCard.js +1 -1
  8. package/dist/ExecutiveDashboard/utils/sectionOrder.js +1 -1
  9. package/dist/HumanIntelligence/HumanChangesTableWrapper.js +1 -1
  10. package/dist/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.js +1 -1
  11. package/dist/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.js +1 -1
  12. package/dist/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.js +1 -1
  13. package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.js +2 -0
  14. package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.js.map +1 -0
  15. package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.module.css.js +2 -0
  16. package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.module.css.js.map +1 -0
  17. package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/parser.js +2 -0
  18. package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/parser.js.map +1 -0
  19. package/dist/HumanIntelligence/hooks/accessToken.js +2 -0
  20. package/dist/HumanIntelligence/hooks/accessToken.js.map +1 -0
  21. package/dist/HumanIntelligence/hooks/useHumanChangesData.js +1 -1
  22. package/dist/HumanIntelligence/utils/inlineMarkup.js +1 -1
  23. package/dist/cjs/ExecutiveDashboard/ExecutiveDashboardWrapper.js +1 -1
  24. package/dist/cjs/ExecutiveDashboard/components/DashboardGrid/buildDashboardWidgets.js +1 -1
  25. package/dist/cjs/ExecutiveDashboard/components/ExecutiveDashboard.js +1 -1
  26. package/dist/cjs/ExecutiveDashboard/components/Graph/Graph.js +1 -1
  27. package/dist/cjs/ExecutiveDashboard/components/Graph/LineChart.js +1 -1
  28. package/dist/cjs/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.js +1 -1
  29. package/dist/cjs/ExecutiveDashboard/components/Table/TableCard.js +1 -1
  30. package/dist/cjs/ExecutiveDashboard/utils/sectionOrder.js +1 -1
  31. package/dist/cjs/HumanIntelligence/HumanChangesTableWrapper.js +1 -1
  32. package/dist/cjs/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.js +1 -1
  33. package/dist/cjs/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.js +1 -1
  34. package/dist/cjs/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.js +1 -1
  35. package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.js +2 -0
  36. package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.js.map +1 -0
  37. package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.module.css.js +2 -0
  38. package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.module.css.js.map +1 -0
  39. package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/parser.js +2 -0
  40. package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/parser.js.map +1 -0
  41. package/dist/cjs/HumanIntelligence/hooks/accessToken.js +2 -0
  42. package/dist/cjs/HumanIntelligence/hooks/accessToken.js.map +1 -0
  43. package/dist/cjs/HumanIntelligence/hooks/useHumanChangesData.js +1 -1
  44. package/dist/cjs/HumanIntelligence/utils/inlineMarkup.js +1 -1
  45. package/dist/cjs/index.js +1 -1
  46. package/dist/cjs/styles.css +1 -1
  47. package/dist/index.js +1 -1
  48. package/dist/styles.css +1 -1
  49. package/dist/types/ExecutiveDashboard/ExecutiveDashboardWrapper.d.ts +1 -1
  50. package/dist/types/ExecutiveDashboard/ExecutiveDashboardWrapper.d.ts.map +1 -1
  51. package/dist/types/ExecutiveDashboard/TestExecutiveDashboard.d.ts.map +1 -1
  52. package/dist/types/ExecutiveDashboard/components/DashboardGrid/buildDashboardWidgets.d.ts +1 -12
  53. package/dist/types/ExecutiveDashboard/components/DashboardGrid/buildDashboardWidgets.d.ts.map +1 -1
  54. package/dist/types/ExecutiveDashboard/components/ExecutiveDashboard.d.ts +1 -12
  55. package/dist/types/ExecutiveDashboard/components/ExecutiveDashboard.d.ts.map +1 -1
  56. package/dist/types/ExecutiveDashboard/components/Graph/Graph.d.ts.map +1 -1
  57. package/dist/types/ExecutiveDashboard/components/Graph/LineChart.d.ts.map +1 -1
  58. package/dist/types/ExecutiveDashboard/components/Graph/types.d.ts +0 -23
  59. package/dist/types/ExecutiveDashboard/components/Graph/types.d.ts.map +1 -1
  60. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.d.ts +2 -12
  61. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.d.ts.map +1 -1
  62. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/index.d.ts +1 -1
  63. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/index.d.ts.map +1 -1
  64. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/types.d.ts +2 -20
  65. package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/types.d.ts.map +1 -1
  66. package/dist/types/ExecutiveDashboard/components/Table/TableCard.d.ts +6 -1
  67. package/dist/types/ExecutiveDashboard/components/Table/TableCard.d.ts.map +1 -1
  68. package/dist/types/ExecutiveDashboard/types/index.d.ts +0 -24
  69. package/dist/types/ExecutiveDashboard/types/index.d.ts.map +1 -1
  70. package/dist/types/ExecutiveDashboard/utils/sectionOrder.d.ts.map +1 -1
  71. package/dist/types/HumanIntelligence/HumanChangesTableWrapper.d.ts.map +1 -1
  72. package/dist/types/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.d.ts +2 -0
  73. package/dist/types/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.d.ts.map +1 -1
  74. package/dist/types/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.d.ts +2 -0
  75. package/dist/types/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.d.ts.map +1 -1
  76. package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.d.ts +5 -0
  77. package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.d.ts.map +1 -0
  78. package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/parser.d.ts +20 -0
  79. package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/parser.d.ts.map +1 -0
  80. package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/types.d.ts +45 -0
  81. package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/types.d.ts.map +1 -0
  82. package/dist/types/HumanIntelligence/hooks/accessToken.d.ts +13 -0
  83. package/dist/types/HumanIntelligence/hooks/accessToken.d.ts.map +1 -0
  84. package/dist/types/HumanIntelligence/hooks/useHumanChangesData.d.ts +12 -4
  85. package/dist/types/HumanIntelligence/hooks/useHumanChangesData.d.ts.map +1 -1
  86. package/dist/types/HumanIntelligence/utils/inlineMarkup.d.ts +2 -0
  87. package/dist/types/HumanIntelligence/utils/inlineMarkup.d.ts.map +1 -1
  88. package/dist/types/index.d.ts +0 -10
  89. package/dist/types/index.d.ts.map +1 -1
  90. package/package.json +3 -3
  91. package/dist/ExecutiveDashboard/api/insightsApi.js +0 -2
  92. package/dist/ExecutiveDashboard/api/insightsApi.js.map +0 -1
  93. package/dist/ExecutiveDashboard/components/Insights/AgCharts.js +0 -2
  94. package/dist/ExecutiveDashboard/components/Insights/AgCharts.js.map +0 -1
  95. package/dist/ExecutiveDashboard/components/Insights/AgReport.js +0 -2
  96. package/dist/ExecutiveDashboard/components/Insights/AgReport.js.map +0 -1
  97. package/dist/ExecutiveDashboard/components/Insights/CommentsThread.js +0 -2
  98. package/dist/ExecutiveDashboard/components/Insights/CommentsThread.js.map +0 -1
  99. package/dist/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.js +0 -2
  100. package/dist/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.js.map +0 -1
  101. package/dist/ExecutiveDashboard/components/Insights/InsightTabs.js +0 -2
  102. package/dist/ExecutiveDashboard/components/Insights/InsightTabs.js.map +0 -1
  103. package/dist/ExecutiveDashboard/components/Insights/InsightsContext.js +0 -2
  104. package/dist/ExecutiveDashboard/components/Insights/InsightsContext.js.map +0 -1
  105. package/dist/ExecutiveDashboard/components/Insights/L1Report.js +0 -2
  106. package/dist/ExecutiveDashboard/components/Insights/L1Report.js.map +0 -1
  107. package/dist/ExecutiveDashboard/components/Insights/NeedsAttention.js +0 -2
  108. package/dist/ExecutiveDashboard/components/Insights/NeedsAttention.js.map +0 -1
  109. package/dist/ExecutiveDashboard/components/Insights/ReportDrawer.js +0 -2
  110. package/dist/ExecutiveDashboard/components/Insights/ReportDrawer.js.map +0 -1
  111. package/dist/ExecutiveDashboard/components/Insights/RowDetail.js +0 -2
  112. package/dist/ExecutiveDashboard/components/Insights/RowDetail.js.map +0 -1
  113. package/dist/ExecutiveDashboard/components/Insights/agPrimitives.js +0 -2
  114. package/dist/ExecutiveDashboard/components/Insights/agPrimitives.js.map +0 -1
  115. package/dist/ExecutiveDashboard/components/Insights/insightsContextCore.js +0 -2
  116. package/dist/ExecutiveDashboard/components/Insights/insightsContextCore.js.map +0 -1
  117. package/dist/ExecutiveDashboard/components/Insights/insightsUtils.js +0 -2
  118. package/dist/ExecutiveDashboard/components/Insights/insightsUtils.js.map +0 -1
  119. package/dist/cjs/ExecutiveDashboard/api/insightsApi.js +0 -2
  120. package/dist/cjs/ExecutiveDashboard/api/insightsApi.js.map +0 -1
  121. package/dist/cjs/ExecutiveDashboard/components/Insights/AgCharts.js +0 -2
  122. package/dist/cjs/ExecutiveDashboard/components/Insights/AgCharts.js.map +0 -1
  123. package/dist/cjs/ExecutiveDashboard/components/Insights/AgReport.js +0 -2
  124. package/dist/cjs/ExecutiveDashboard/components/Insights/AgReport.js.map +0 -1
  125. package/dist/cjs/ExecutiveDashboard/components/Insights/CommentsThread.js +0 -2
  126. package/dist/cjs/ExecutiveDashboard/components/Insights/CommentsThread.js.map +0 -1
  127. package/dist/cjs/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.js +0 -2
  128. package/dist/cjs/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.js.map +0 -1
  129. package/dist/cjs/ExecutiveDashboard/components/Insights/InsightTabs.js +0 -2
  130. package/dist/cjs/ExecutiveDashboard/components/Insights/InsightTabs.js.map +0 -1
  131. package/dist/cjs/ExecutiveDashboard/components/Insights/InsightsContext.js +0 -2
  132. package/dist/cjs/ExecutiveDashboard/components/Insights/InsightsContext.js.map +0 -1
  133. package/dist/cjs/ExecutiveDashboard/components/Insights/L1Report.js +0 -2
  134. package/dist/cjs/ExecutiveDashboard/components/Insights/L1Report.js.map +0 -1
  135. package/dist/cjs/ExecutiveDashboard/components/Insights/NeedsAttention.js +0 -2
  136. package/dist/cjs/ExecutiveDashboard/components/Insights/NeedsAttention.js.map +0 -1
  137. package/dist/cjs/ExecutiveDashboard/components/Insights/ReportDrawer.js +0 -2
  138. package/dist/cjs/ExecutiveDashboard/components/Insights/ReportDrawer.js.map +0 -1
  139. package/dist/cjs/ExecutiveDashboard/components/Insights/RowDetail.js +0 -2
  140. package/dist/cjs/ExecutiveDashboard/components/Insights/RowDetail.js.map +0 -1
  141. package/dist/cjs/ExecutiveDashboard/components/Insights/agPrimitives.js +0 -2
  142. package/dist/cjs/ExecutiveDashboard/components/Insights/agPrimitives.js.map +0 -1
  143. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsContextCore.js +0 -2
  144. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsContextCore.js.map +0 -1
  145. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsUtils.js +0 -2
  146. package/dist/cjs/ExecutiveDashboard/components/Insights/insightsUtils.js.map +0 -1
  147. package/dist/types/ExecutiveDashboard/api/insightsApi.d.ts +0 -156
  148. package/dist/types/ExecutiveDashboard/api/insightsApi.d.ts.map +0 -1
  149. package/dist/types/ExecutiveDashboard/components/Insights/AgCharts.d.ts +0 -66
  150. package/dist/types/ExecutiveDashboard/components/Insights/AgCharts.d.ts.map +0 -1
  151. package/dist/types/ExecutiveDashboard/components/Insights/AgReport.d.ts +0 -117
  152. package/dist/types/ExecutiveDashboard/components/Insights/AgReport.d.ts.map +0 -1
  153. package/dist/types/ExecutiveDashboard/components/Insights/CommentsThread.d.ts +0 -6
  154. package/dist/types/ExecutiveDashboard/components/Insights/CommentsThread.d.ts.map +0 -1
  155. package/dist/types/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.d.ts +0 -65
  156. package/dist/types/ExecutiveDashboard/components/Insights/DecisionAdvantageCard.d.ts.map +0 -1
  157. package/dist/types/ExecutiveDashboard/components/Insights/InsightTabs.d.ts +0 -17
  158. package/dist/types/ExecutiveDashboard/components/Insights/InsightTabs.d.ts.map +0 -1
  159. package/dist/types/ExecutiveDashboard/components/Insights/InsightsContext.d.ts +0 -28
  160. package/dist/types/ExecutiveDashboard/components/Insights/InsightsContext.d.ts.map +0 -1
  161. package/dist/types/ExecutiveDashboard/components/Insights/L1Report.d.ts +0 -32
  162. package/dist/types/ExecutiveDashboard/components/Insights/L1Report.d.ts.map +0 -1
  163. package/dist/types/ExecutiveDashboard/components/Insights/NeedsAttention.d.ts +0 -26
  164. package/dist/types/ExecutiveDashboard/components/Insights/NeedsAttention.d.ts.map +0 -1
  165. package/dist/types/ExecutiveDashboard/components/Insights/ReportDrawer.d.ts +0 -13
  166. package/dist/types/ExecutiveDashboard/components/Insights/ReportDrawer.d.ts.map +0 -1
  167. package/dist/types/ExecutiveDashboard/components/Insights/RowDetail.d.ts +0 -12
  168. package/dist/types/ExecutiveDashboard/components/Insights/RowDetail.d.ts.map +0 -1
  169. package/dist/types/ExecutiveDashboard/components/Insights/agPrimitives.d.ts +0 -151
  170. package/dist/types/ExecutiveDashboard/components/Insights/agPrimitives.d.ts.map +0 -1
  171. package/dist/types/ExecutiveDashboard/components/Insights/insightsContextCore.d.ts +0 -61
  172. package/dist/types/ExecutiveDashboard/components/Insights/insightsContextCore.d.ts.map +0 -1
  173. package/dist/types/ExecutiveDashboard/components/Insights/insightsUtils.d.ts +0 -62
  174. package/dist/types/ExecutiveDashboard/components/Insights/insightsUtils.d.ts.map +0 -1
  175. package/dist/types/ExecutiveDashboard/types/insights.d.ts +0 -502
  176. package/dist/types/ExecutiveDashboard/types/insights.d.ts.map +0 -1
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * AppSec access token supplied by the host application. Provided by
4
+ * `HumanChangesTableWrapper` so components rendered inside it (e.g. a
5
+ * `HumanIntelligenceCard` from `renderExpandedRow`) authenticate their API
6
+ * calls without the host having to thread the token through every prop.
7
+ */
8
+ export declare const AccessTokenContext: import("react").Context<string | undefined>;
9
+ /** Returns the explicitly passed token, falling back to the context token. */
10
+ export declare function useAccessToken(accessToken?: string): string | undefined;
11
+ /** `Authorization` header for the given token, or nothing when absent. */
12
+ export declare function authHeader(accessToken?: string): Record<string, string>;
13
+ //# sourceMappingURL=accessToken.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessToken.d.ts","sourceRoot":"","sources":["../../../../src/HumanIntelligence/hooks/accessToken.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,6CAA+C,CAAC;AAE/E,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGvE;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEvE"}
@@ -89,13 +89,15 @@ export type HumanChangePatternRow = {
89
89
  type UseHumanChangesDataArgs = {
90
90
  baseUrl?: string;
91
91
  endpoint?: string;
92
+ /** AppSec token supplied by the host application. */
93
+ accessToken?: string;
92
94
  humanChangeConfigId: string;
93
95
  /** Optional analysis run to scope the request to (sent as `event_id`). */
94
96
  eventId?: string;
95
97
  filters: HumanChangesFilters;
96
98
  pageSize?: number;
97
99
  };
98
- export declare function useHumanChangesData({ baseUrl, endpoint, humanChangeConfigId, eventId, filters, pageSize, }: UseHumanChangesDataArgs): {
100
+ export declare function useHumanChangesData({ baseUrl, endpoint, accessToken: accessTokenProp, humanChangeConfigId, eventId, filters, pageSize, }: UseHumanChangesDataArgs): {
99
101
  rows: HumanChangePatternRow[];
100
102
  loading: boolean;
101
103
  loadingMore: boolean;
@@ -106,18 +108,22 @@ export declare function useHumanChangesData({ baseUrl, endpoint, humanChangeConf
106
108
  };
107
109
  type UseCitationSegmentsArgs = {
108
110
  baseUrl?: string;
111
+ /** AppSec token; falls back to the token provided by `HumanChangesTableWrapper`. */
112
+ accessToken?: string;
109
113
  humanIntelligentConfigId?: string;
110
114
  segmentIds?: string[];
111
115
  skip?: boolean;
112
116
  };
113
- export declare function useCitationSegments({ baseUrl, humanIntelligentConfigId, segmentIds, skip, }: UseCitationSegmentsArgs): {
117
+ export declare function useCitationSegments({ baseUrl, accessToken: accessTokenProp, humanIntelligentConfigId, segmentIds, skip, }: UseCitationSegmentsArgs): {
114
118
  data: any[];
115
119
  loading: boolean;
116
120
  error: string | null;
117
121
  refetch: () => void;
118
122
  };
119
- export declare function useCitationChangelogs({ baseUrl, configId, changeLogIds, skip, }: {
123
+ export declare function useCitationChangelogs({ baseUrl, accessToken: accessTokenProp, configId, changeLogIds, skip, }: {
120
124
  baseUrl?: string;
125
+ /** AppSec token; falls back to the token provided by `HumanChangesTableWrapper`. */
126
+ accessToken?: string;
121
127
  configId?: string;
122
128
  changeLogIds: string[];
123
129
  skip?: boolean;
@@ -131,8 +137,10 @@ export declare function useCitationChangelogs({ baseUrl, configId, changeLogIds,
131
137
  fetchNextPageError: string | null;
132
138
  refetch: () => void;
133
139
  };
134
- export declare function useBusinessContextData({ baseUrl, humanIntelligentConfigId, agentConfig, skip, }: {
140
+ export declare function useBusinessContextData({ baseUrl, accessToken: accessTokenProp, humanIntelligentConfigId, agentConfig, skip, }: {
135
141
  baseUrl?: string;
142
+ /** AppSec token; falls back to the token provided by `HumanChangesTableWrapper`. */
143
+ accessToken?: string;
136
144
  humanIntelligentConfigId?: string;
137
145
  agentConfig?: string;
138
146
  skip?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useHumanChangesData.d.ts","sourceRoot":"","sources":["../../../../src/HumanIntelligence/hooks/useHumanChangesData.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,sBAAsB,CAAC;AAErF,uDAAuD;AACvD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE/D,qDAAqD;AACrD,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,sBAAsB,GACtB,cAAc,GACd,iBAAiB,CAAC;AAEtB,MAAM,MAAM,kBAAkB,GAC1B,kBAAkB,GAClB,iBAAiB,CAAC;AAEtB,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,aAAa,EAA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;;;EAoFA"}
1
+ {"version":3,"file":"useHumanChangesData.d.ts","sourceRoot":"","sources":["../../../../src/HumanIntelligence/hooks/useHumanChangesData.ts"],"names":[],"mappings":"AAGA,2DAA2D;AAC3D,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,sBAAsB,CAAC;AAErF,uDAAuD;AACvD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE/D,qDAAqD;AACrD,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,sBAAsB,GACtB,cAAc,GACd,iBAAiB,CAAC;AAEtB,MAAM,MAAM,kBAAkB,GAC1B,kBAAkB,GAClB,iBAAiB,CAAC;AAEtB,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;IAC1C,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACh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B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,WAAW,EAAE,eAAe,EAC5B,wBAAwB,EACxB,UAAU,EACV,IAAY,GACb,EAAE,uBAAuB;;;;;EA8GzB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,OAAO,EACP,WAAW,EAAE,eAAe,EAC5B,QAAQ,EACR,YAAY,EACZ,IAAY,GACb,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;;;;;;;;;EAgJA;AAED,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,EACP,WAAW,EAAE,eAAe,EAC5B,wBAAwB,EACxB,WAAW,EACX,IAAY,GACb,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;;;;;EAsFA"}
@@ -2,6 +2,8 @@ import React from 'react';
2
2
  export interface InlineMarkupOptions {
3
3
  /** Extra class applied to every rendered tag of that name, e.g. `{ mark: styles.highlight }`. */
4
4
  classNames?: Record<string, string>;
5
+ /**Tags in STRIP_TAGS are always removed.*/
6
+ stripUnknownTags?: boolean;
5
7
  }
6
8
  /**
7
9
  * Turns a markup string into React nodes. Non-strings are returned untouched so
@@ -1 +1 @@
1
- {"version":3,"file":"inlineMarkup.d.ts","sourceRoot":"","sources":["../../../../src/HumanIntelligence/utils/inlineMarkup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoD1B,MAAM,WAAW,mBAAmB;IAClC,iGAAiG;IACjG,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,OAAO,GAAE,mBAAwB,GAChC,KAAK,CAAC,SAAS,CAqEjB"}
1
+ {"version":3,"file":"inlineMarkup.d.ts","sourceRoot":"","sources":["../../../../src/HumanIntelligence/utils/inlineMarkup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAwG1B,MAAM,WAAW,mBAAmB;IAClC,iGAAiG;IACjG,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,OAAO,GAAE,mBAAwB,GAChC,KAAK,CAAC,SAAS,CA+FjB"}
@@ -37,16 +37,6 @@ export { default as RcaDecisionComponent, } from './ExecutiveDashboard/component
37
37
  export type { RcaDecisionComponentProps, RcaDecisionItem, RcaDecisioning, } from './ExecutiveDashboard/components/RcaDecisionComponent';
38
38
  export { default as TopDriver } from './ExecutiveDashboard/components/TopDriver';
39
39
  export type { TopDriverCorrelationStrength, TopDriverItem, TopDriverMovement, TopDriverProps, } from './ExecutiveDashboard/components/TopDriver';
40
- export { InsightsProvider, useInsights } from './ExecutiveDashboard/components/Insights/InsightsContext';
41
- export type { InsightsProviderProps, InsightsReportTarget, InsightsContextValue, } from './ExecutiveDashboard/components/Insights/InsightsContext';
42
- export { default as DecisionAdvantageCard } from './ExecutiveDashboard/components/Insights/DecisionAdvantageCard';
43
- export { default as InsightTabs } from './ExecutiveDashboard/components/Insights/InsightTabs';
44
- export { default as L1Report, L1ReportModal } from './ExecutiveDashboard/components/Insights/L1Report';
45
- export { DECISION_WIDGET_KEY, INSIGHT_TABS_WIDGET_KEY, } from './ExecutiveDashboard/components/DashboardGrid/buildDashboardWidgets';
46
- export { InsightsApiError, fetchInsightsSummary, fetchLevelSummary, fetchLevelRows, fetchInsightsSeries, fetchInsightsReport, generateInsightsReport, fetchInsightsJob, fetchReportComments, postReportComment, deleteReportComment, saveInsightsAction, } from './ExecutiveDashboard/api/insightsApi';
47
- export type { InsightsRange } from './ExecutiveDashboard/api/insightsApi';
48
- export type { InsightsKpiConfig, InsightsEntityConfig, InsightsLevelConfig, InsightsUiConfig, InsightTabConfig, DecisionAdvantageUiConfig, InsightsCriticality, InsightsPeriod, InsightsReadContext, InsightsDecisionEvidence, InsightsDecisionReasoning, InsightsDecisionItem, InsightsDecisionSummary, InsightsReportStatus, InsightsReport, InsightsSummaryResponse, InsightsMovementType, InsightsSeriesMarker, InsightsSeriesPoint, InsightsSeriesItem, InsightsSeriesResponse, InsightsRowMetric, InsightsRowChip, InsightsAction, InsightsActionStatus, InsightsRowChild, InsightsRow, InsightsRowsResponse, InsightsRowsQuery, InsightsReportDetail, InsightsGenerateResult, InsightsJobStatus, InsightsComment, InsightsCommentList, InsightsActionInput, } from './ExecutiveDashboard/types/insights';
49
- export type { SeriesMarker } from './ExecutiveDashboard/components/Graph/types';
50
40
  export { default as MetricCard } from './ExecutiveDashboard/components/MetricCard/MetricCard';
51
41
  export { default as FiltersSidebar } from './ExecutiveDashboard/components/FiltersSidebar/FiltersSidebar';
52
42
  export { default as FTable } from './ExecutiveDashboard/components/Table/FTable';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,IAAI,yBAAyB,EACpC,yBAAyB,IAAI,4BAA4B,GAC1D,MAAM,gDAAgD,CAAC;AAGxD,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,gEAAgE,CAAC;AAC1G,YAAY,EAAE,yBAAyB,EAAE,MAAM,wEAAwE,CAAC;AACxH,YAAY,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,sEAAsE,CAAC;AAC3G,YAAY,EACV,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,GACb,MAAM,sEAAsE,CAAC;AAE9E,YAAa,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAC7G,YAAY,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AACnG,YAAY,EAAE,oBAAoB,EAAE,MAAM,qEAAqE,CAAC;AAChH,YAAa,EAAE,uBAAuB,EAAE,MAAM,wEAAwE,CAAA;AACtH,YAAY,EAAE,mBAAmB,EAAE,MAAM,mEAAmE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/federated-dashboard-components",
3
- "version": "2.2.9-rca-test-3",
3
+ "version": "2.2.10",
4
4
  "author": "Hitesh Rathi",
5
5
  "description": "Reusable React dashboard components for charts, metrics, filters, tables, and dashboard cards.",
6
6
  "license": "MIT",
@@ -47,8 +47,8 @@
47
47
  "./styles.css": "./dist/styles.css"
48
48
  },
49
49
  "dependencies": {
50
- "@e-llm-studio/instant-learning": "1.3.6",
51
- "@e-llm-studio/citation": "0.0.253"
50
+ "@e-llm-studio/citation": "0.0.253",
51
+ "@e-llm-studio/instant-learning": "1.3.11"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "chart.js": "^4.0.0",
@@ -1,2 +0,0 @@
1
- import{__extends as n,__assign as t,__awaiter as o,__generator as e}from"../../_virtual/_tslib.js";import{DashboardApiError as r}from"./dashboardApi.js";var c=function(t){function o(n,o,e,r){var c=t.call(this,n,o)||this;return c.name="InsightsApiError",c.errorType=e,c.data=r,c}return n(o,t),o}(r),i=function(n){var t=function(n){return String(n).padStart(2,"0")};return"".concat(n.getFullYear(),"-").concat(t(n.getMonth()+1),"-").concat(t(n.getDate()))},a=function(n){var t=n.baseUrl,o=void 0===t?"":t,e=n.configId;return"".concat(function(n){return n.replace(/\/+$/,"")}(o),"/federated/insights/").concat(encodeURIComponent(e))},s=function(n){var t=new URLSearchParams;Object.entries(n).forEach(function(n){var o=n[0],e=n[1];null!=e&&""!==e&&t.set(o,String(e))});var o=t.toString();return o?"?".concat(o):""},u=function(n){var t=n.startDate,o=n.endDate,e=n.workingDaysOnly;return{startDate:i(t),endDate:i(o),workingDaysOnly:!!e||void 0}};function d(n,r,i,a,s){var u,d;return o(this,void 0,void 0,function(){var o,l;return e(this,function(e){switch(e.label){case 0:return[4,fetch(r,{method:n,headers:t(t({accept:"application/json"},void 0!==a?{"Content-Type":"application/json"}:{}),i?{Authorization:"Bearer ".concat(i)}:{}),body:void 0!==a?JSON.stringify(a):void 0,signal:s})];case 1:o=e.sent(),l=null,e.label=2;case 2:return e.trys.push([2,4,,5]),[4,o.json()];case 3:return l=e.sent(),[3,5];case 4:return e.sent(),l=null,[3,5];case 5:if(!o.ok||!(null==l?void 0:l.success))throw new c((null===(u=null==l?void 0:l.error)||void 0===u?void 0:u.errorMessage)||"Request failed with status ".concat(o.status),o.status,null===(d=null==l?void 0:l.error)||void 0===d?void 0:d.errorType,null==l?void 0:l.data);return[2,{status:o.status,data:l.data}]}})})}var l=function(n,t,r){return o(void 0,void 0,void 0,function(){return e(this,function(o){switch(o.label){case 0:return[4,d("GET",n,t.accessToken,void 0,r)];case 1:return[2,o.sent().data]}})})},v=function(n,t,o){return l("".concat(a(n),"/summary").concat(s(u(t))),n,o)},f=function(n,t,o,e){return l("".concat(a(n),"/levels/").concat(encodeURIComponent(t),"/summary").concat(s(u(o))),n,e)},p=function(n,o,e,r,c){return void 0===r&&(r={}),l("".concat(a(n),"/levels/").concat(encodeURIComponent(o),"/rows").concat(s(t(t({},u(e)),r))),n,c)},h=function(n,o,e,r){var c;return l("".concat(a(n),"/series").concat(s(t(t({},u(o)),{workingDaysOnly:o.group?void 0:!!o.workingDaysOnly||void 0,group:o.group,kpiIds:e.kpiIds.join(","),nodeKeys:(null===(c=e.nodeKeys)||void 0===c?void 0:c.length)?e.nodeKeys.join(","):void 0,entityKey:e.entityKey,topN:e.topN}))),n,r)},m=function(n,t,o){return l("".concat(a(n),"/reports/").concat(encodeURIComponent(t)),n,o)};function y(n,t,r){var i;return o(this,void 0,void 0,function(){var o,s,u;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d("POST","".concat(a(n),"/reports/generate"),n.accessToken,t,r)];case 1:if(null==(o=e.sent().data)?void 0:o.report)return[2,{kind:"report",report:o.report}];if(null==o?void 0:o.jobId)return[2,{kind:"job",jobId:o.jobId}];throw new c("The report couldn't be started.");case 2:if(s=e.sent(),u="InsightsBusy"===(null==s?void 0:s.errorType)?null===(i=s.data)||void 0===i?void 0:i.jobId:void 0)return[2,{kind:"job",jobId:u}];throw s;case 3:return[2]}})})}var g=function(n,t,o){return l("".concat(a(n),"/jobs/").concat(encodeURIComponent(t)),n,o)},b=function(n,t,o){return l("".concat(a(n),"/reports/").concat(encodeURIComponent(t),"/comments"),n,o)},w=function(n,r,c,i){return o(void 0,void 0,void 0,function(){return e(this,function(o){switch(o.label){case 0:return[4,d("POST","".concat(a(n),"/reports/").concat(encodeURIComponent(r),"/comments"),n.accessToken,t({commentText:c},i?{parentCommentId:i}:{}))];case 1:return[2,o.sent().data]}})})},I=function(n,t){return o(void 0,void 0,void 0,function(){return e(this,function(o){switch(o.label){case 0:return[4,d("DELETE","".concat(a(n),"/comments/").concat(encodeURIComponent(t)),n.accessToken)];case 1:return[2,o.sent().data]}})})},T=function(n,t,r){return o(void 0,void 0,void 0,function(){return e(this,function(o){switch(o.label){case 0:return[4,d("PATCH","".concat(a(n),"/comments/").concat(encodeURIComponent(t)),n.accessToken,{commentText:r})];case 1:return[2,o.sent().data]}})})},j=function(n,t,r){return o(void 0,void 0,void 0,function(){return e(this,function(o){switch(o.label){case 0:return[4,d("PUT","".concat(a(n),"/actions/").concat(encodeURIComponent(t)),n.accessToken,r)];case 1:return[2,o.sent().data]}})})},U=function(n,o,e){var r;return l("".concat(a(n),"/top-drivers").concat(s(t(t({},o),{limit:Math.min(10,Math.max(1,null!==(r=o.limit)&&void 0!==r?r:10))}))),n,e).then(k)},k=function(n){var o,e,r,c=n;return t(t({},n),{rows:(null===(o=n.rows)||void 0===o?void 0:o.length)?n.rows:null!==(r=null!==(e=c.drivers)&&void 0!==e?e:c.items)&&void 0!==r?r:[]})},C=function(n,o,e,r){var c;return l("".concat(a(n),"/rows/").concat(encodeURIComponent(o),"/correlation").concat(s(t(t({},e),{disregardDates:null===(c=e.disregardDates)||void 0===c?void 0:c.join(",")}))),n,r).then(D)},R=function(n,o,e,r){var c;return l("".concat(a(n),"/rows/").concat(encodeURIComponent(o),"/correlation-trend").concat(s(t(t({},e),{disregardDates:null===(c=e.disregardDates)||void 0===c?void 0:c.join(",")}))),n,r)},D=function(n){var o,e,r=n;return t(t({},n),{drivers:(null!==(o=r.drivers)&&void 0!==o?o:[]).map(function(n){var o,e,r,c,i,a,s,u,d,l,v,f,p;return t(t({},n),{r:null!==(r=null!==(o=n.r)&&void 0!==o?o:null===(e=n.correlation)||void 0===e?void 0:e.r)&&void 0!==r?r:null,nObs:null!==(s=null!==(i=null!==(c=n.nObs)&&void 0!==c?c:n.daysUsed)&&void 0!==i?i:null===(a=n.correlation)||void 0===a?void 0:a.nObs)&&void 0!==s?s:0,strength:null!==(v=null!==(d=null!==(u=n.strength)&&void 0!==u?u:n.correlationStrength)&&void 0!==d?d:null===(l=n.correlation)||void 0===l?void 0:l.strength)&&void 0!==v?v:null,lowHistory:null!==(f=n.lowHistory)&&void 0!==f?f:null===(p=n.correlation)||void 0===p?void 0:p.lowHistory})}),series:(null!==(e=r.series)&&void 0!==e?e:[]).flatMap(function(t){var o,e,r,c,i=null!==(e=null!==(o=t.x)&&void 0!==o?o:t.date)&&void 0!==e?e:t.dataDay;if("string"!=typeof i||!i)return[];var a=null!==(r=t.values)&&void 0!==r?r:t.metrics,s=a&&"object"==typeof a&&!Array.isArray(a)?a:Object.entries(t).reduce(function(n,t){var o=t[0],e=t[1];return["x","date","dataDay","disregarded","isDisregarded","value"].includes(o)||"number"!=typeof e&&null!==e||(n[o]=e),n},{});return"number"!=typeof t.value&&null!==t.value||(s[n.kpiId]=t.value),t.drivers&&"object"==typeof t.drivers&&!Array.isArray(t.drivers)&&Object.entries(t.drivers).forEach(function(n){var t=n[0],o=n[1];"number"!=typeof o&&null!==o||(s[t]=o)}),[{x:i,values:s,disregarded:Boolean(null!==(c=t.disregarded)&&void 0!==c?c:t.isDisregarded)}]})})},O=function(n,t,r){return o(void 0,void 0,void 0,function(){return e(this,function(o){switch(o.label){case 0:return[4,d("PUT","".concat(a(n),"/rows/").concat(encodeURIComponent(t),"/correlation-window"),n.accessToken,r)];case 1:return[2,o.sent().data]}})})},S=function(n,t){return o(void 0,void 0,void 0,function(){var o;return e(this,function(e){switch(e.label){case 0:return[4,l("".concat(a(n),"/graph-groups"),n,t)];case 1:return o=e.sent(),[2,Array.isArray(o)?{groups:o}:o]}})})},A=function(n,t,o){return void 0===t&&(t={}),l("".concat(a(n),"/needs-attention").concat(s(t)),n,o)},P=function(n,r,c,i){return o(void 0,void 0,void 0,function(){return e(this,function(o){switch(o.label){case 0:return[4,d("POST","".concat(a(n),"/observations/").concat(encodeURIComponent(r),"/decision"),n.accessToken,t(t({decision:c},i?{reason:i}:{}),{regenerate:"dashboard"}))];case 1:return[2,o.sent().data]}})})},x=function(n,t,o){return void 0===t&&(t={}),l("".concat(a(n),"/observations").concat(s(t)),n,o)},E=function(n,t){return l("".concat(a(n),"/hierarchy"),n,t)},K=function(n,t,o,e){return l("".concat(a(n),"/rows/").concat(encodeURIComponent(t)).concat(s(o)),n,e)},M=function(n,t,o,e){return l("".concat(a(n),"/rows/").concat(encodeURIComponent(t),"/report").concat(s(o)),n,e)},B=function(n,t,o){return l("".concat(a(n),"/reports").concat(s(t)),n,o)};function H(n,t,r){var c;return o(this,void 0,void 0,function(){var o,i;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d("POST","".concat(a(n)).concat(t),n.accessToken,r)];case 1:return[2,e.sent().data];case 2:if(o=e.sent(),i="InsightsBusy"===(null==o?void 0:o.errorType)?null===(c=o.data)||void 0===c?void 0:c.jobId:void 0)return[2,{jobId:i}];throw o;case 3:return[2]}})})}var N=function(n,t){return H(n,"/summary/generate",t)},L=function(n,t,o){return H(n,"/levels/".concat(encodeURIComponent(t),"/generate"),o)};export{c as InsightsApiError,P as decideObservation,I as deleteReportComment,S as fetchGraphGroups,E as fetchHierarchy,C as fetchInsightsCorrelation,R as fetchInsightsCorrelationTrend,U as fetchInsightsDrivers,g as fetchInsightsJob,m as fetchInsightsReport,B as fetchInsightsReports,h as fetchInsightsSeries,v as fetchInsightsSummary,p as fetchLevelRows,f as fetchLevelSummary,A as fetchNeedsAttention,x as fetchObservations,b as fetchReportComments,K as fetchRowDetail,M as fetchRowReport,y as generateInsightsReport,N as generateInsightsSummary,L as generateLevelSummary,w as postReportComment,O as saveCorrelationWindow,j as saveInsightsAction,i as toIsoDay,T as updateReportComment};
2
- //# sourceMappingURL=insightsApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"insightsApi.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{__assign as n,__spreadArray as e}from"../../../_virtual/_tslib.js";import{jsx as t,jsxs as i,Fragment as l}from"react/jsx-runtime";import{useState as o,useMemo as a}from"react";import r from"../Graph/LineChart.js";import{formatValue as u,shortDay as c,previousDayLabel as d}from"./insightsUtils.js";import{movementColorHex as s,tooltipSafeColorHex as v,splitVerdict as m,movementVerdictLabel as g,toneOf as p}from"./agPrimitives.js";var f=function(n,e,t){return null==n||null==e||e===n?"#0F172A":(e>n?"up":"down")===t?"#10B981":"#F43F5E"},h="daily_colored_",y={chartHeight:260,yAxisWidth:70,gridColor:"#e2e8f0",axisColor:"#cbd5e1",axisLabelColor:"#64748b",tickColor:"#64748b"};function _(n){return n?n.points.map(function(e,t){var i,l,o,a,r,u,c,d,s,v,m,g,p,f,h,y,_,b,k,x,w,C,N,A,F,T,B,D=null!==(l=null===(i=n.points[t-1])||void 0===i?void 0:i.y)&&void 0!==l?l:null,I=null!==(a=null===(o=e.meta)||void 0===o?void 0:o.marker)&&void 0!==a?a:null;return{day:e.x,value:e.y,previous:D,fast:null!==(u=null===(r=e.meta)||void 0===r?void 0:r.fastMa)&&void 0!==u?u:null,slow:null!==(d=null===(c=e.meta)||void 0===c?void 0:c.slowMa)&&void 0!==d?d:null,long:null!==(v=null===(s=e.meta)||void 0===s?void 0:s.longMa)&&void 0!==v?v:null,movementType:null!==(m=null==I?void 0:I.movementType)&&void 0!==m?m:null==e.y?null:"stable",direction:null!==(g=null==I?void 0:I.direction)&&void 0!==g?g:null,headline:null!==(p=null==I?void 0:I.headline)&&void 0!==p?p:null,reportId:null!==(f=null==I?void 0:I.reportId)&&void 0!==f?f:null,criticality:null!==(h=null==I?void 0:I.criticality)&&void 0!==h?h:null,substituted:Boolean(null===(y=e.meta)||void 0===y?void 0:y.substituted),substitutionMessage:null!==(k=null===(b=null===(_=e.meta)||void 0===_?void 0:_.substitution)||void 0===b?void 0:b.message)&&void 0!==k?k:null,commentCount:null!==(w=null===(x=e.meta)||void 0===x?void 0:x.commentCount)&&void 0!==w?w:0,excludedCount:null!==(N=null===(C=e.meta)||void 0===C?void 0:C.excludedCount)&&void 0!==N?N:0,pendingCount:null!==(F=null===(A=e.meta)||void 0===A?void 0:A.pendingCount)&&void 0!==F?F:0,flaggedCount:null!==(B=null===(T=e.meta)||void 0===T?void 0:T.flaggedCount)&&void 0!==B?B:0}}):[]}var b=function(n,e){return null!=n&&null!=e&&0!==e?(n-e)/Math.abs(e)*100:null};function k(e){var t=e.pct,l=e.good;if(null==t||!Number.isFinite(t)||0===t)return null;var o=p(t,l);return i("span",n({className:"ag-tip__badge ag-tip__badge--".concat("good"===o?"good":"bad")},{children:[t<0?"↓":"↑"," ",Math.abs(t).toFixed(1),"%"]}))}function x(e){var l=e.series,o=e.hidden,a=e.onToggle;return l.length?t("div",n({className:"ellm-graph__legend ellm-chart__legend--bottom ellm-chart__legend--center"},{children:l.map(function(e){var l,r=null!==(l=e.color)&&void 0!==l?l:"#64748b",u=o.has(e.key);return i("label",n({className:"ellm-graph__legend-item".concat(u?" ellm-graph__legend-item--off":""),style:{cursor:"pointer","--checkbox-color":r,color:r}},{children:[t("input",{type:"checkbox",className:"ellm-graph__legend-checkbox",checked:!u,onChange:function(){return a(e.key)},style:{borderColor:r,accentColor:r}}),e.label]}),e.key)})})):null}function w(d){var p=d.points,_=d.label,w=d.good,C=d.windows,N=d.extraLines,A=void 0===N?[]:N,F=d.highlightDay,T=d.onOpenDay,B=d.onOpenAttention,D=d.syncId,I=o(function(){return new Set(["avg_fast","avg_long"])}),S=I[0],M=I[1],E=a(function(){return p.map(function(n){return n.day})},[p]),P=a(function(){var t=p.map(function(n){return n.substituted?"#94A3B8":s(n.movementType,n.direction,w)}),i={curve:"smooth",area:!1,showInLegend:!1,showInTooltip:!1},l=p.slice(1).map(function(e,t){var l=t+1;return n(n({},i),{key:"".concat(h,"seg_").concat(l),label:"Daily segment ".concat(l),color:p[l].substituted||p[l-1].substituted?"#94A3B8":f(p[l-1].value,p[l].value,w),strokeWidth:2,showPoints:!1,pointRadius:0,data:p.map(function(n,e){return{x:n.day,y:e===l-1||e===l?n.value:null}})})}),o=Array.from(new Set(t)).map(function(e){return n(n({},i),{key:"".concat(h,"pts_").concat(e.slice(1)),label:"Daily points ".concat(e),color:e,strokeWidth:0,showPoints:!0,pointRadius:3,data:p.map(function(n,i){return{x:n.day,y:t[i]===e?n.value:null}})})}),a=function(n,e,t,i){return{key:n,label:e,color:t,curve:"smooth",strokeWidth:1.5,dashed:!0,pointRadius:0,showPoints:!1,data:p.map(function(n){return{x:n.day,y:i(n)}}),valueFormatter:function(n){return u(n)}}};return e(e(e(e([{key:"daily_value",label:"Daily ".concat(_),color:"#7549F2",curve:"smooth",strokeWidth:0,showPoints:!1,pointRadius:0,data:p.map(function(n){return{x:n.day,y:n.value}}),valueFormatter:function(n){return u(n)}}],l,!0),o,!0),[a("avg_fast","".concat(C.fast,"-day Average"),"#0B8043",function(n){return n.fast}),a("avg_slow","".concat(C.slow,"-day Average"),"#F5A623",function(n){return n.slow}),a("avg_long","".concat(C.long,"-day Average"),"#94A3B8",function(n){return n.long})],!1),A.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(n){return u(n)}}}),!0)},[p,_,w,C,A]),W=function(n){return M(function(t){var i=new Set(t),l=!i.has(n);return("daily_value"===n?e([n],P.filter(function(n){return n.key.startsWith(h)}).map(function(n){return n.key}),!0):[n]).forEach(function(n){return l?i.add(n):i.delete(n)}),i})},L=a(function(){return P.filter(function(n){return!1!==n.showInLegend})},[P]);return p.filter(function(n){return null!=n.value}).length<2?t("div",n({className:"ag-empty"},{children:"Not enough history yet for a trend chart."})):i("div",n({className:"ag-chart"},{children:[i("div",n({className:"ellm-graph"},{children:[t(r,{tier:"decision-advantage-trend",series:P,hiddenKeys:S,onToggleSeries:W,syncId:D,xAxis:{label:"Date",categories:E,tickCount:8,minTickGap:24,formatTick:function(n){return c(n)}},yAxis:{label:_,beginAtZero:!0,formatTick:function(n){return u(Number(n))}},tooltip:{render:function(e){var o=e.x,a=p.find(function(n){return n.day===String(o)});if(!a)return null;var r=v(s(a.movementType,a.direction,w)),c=a.headline?m(function(n){var e,t,i=null!==(e=n.trim().split(/\r?\n/,1)[0])&&void 0!==e?e:"",l=Array.from(i.matchAll(/[.!?](?=\s|$)/g));return l.length>=2?i.slice(0,(null!==(t=l[1].index)&&void 0!==t?t:i.length)+1):i}(a.headline)):null,d=P.filter(function(n){return!1!==n.showInTooltip&&!S.has(n.key)}).map(function(n){var e,t;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]});return i("div",n({className:"ag-tip",style:{cursor:T?"pointer":void 0},onMouseDown:T?function(){return T(a)}:void 0},{children:[i("div",n({className:"ag-tip__head"},{children:[t("span",{children:a.day}),t(k,{pct:b(a.value,a.previous),good:w})]})),t("div",n({className:"ag-tip__rows"},{children:d.map(function(e){var l=e[0],o=e[1];return i("div",n({className:"ag-tip__row"},{children:[t("span",{children:l}),t("span",{children:u(o)})]}),l)})})),i("div",n({className:"ag-tip__verdict"},{children:[t("strong",n({style:{color:r}},{children:g(a.movementType,a.direction)})),a.criticality?i("span",{children:[" · ",a.criticality]}):null,c?i("div",n({className:"ag-tip__narrative"},{children:[c.prefix?i(l,{children:[t("span",n({className:"Good news"===c.prefix?"ag-verdict--good":"ag-verdict--bad"},{children:c.prefix}))," - "]}):null,c.rest]})):null,a.substituted?t("div",n({className:"ag-tip__narrative"},{children:a.substitutionMessage||"Substituted value"})):null,a.commentCount?i("div",n({className:"ag-tip__narrative"},{children:[a.commentCount," comment",1===a.commentCount?"":"s"]})):null]})),a.excludedCount+a.flaggedCount>0?i("button",n({type:"button",className:"ag-tip__cta",onMouseDown:function(n){n.stopPropagation(),null==B||B(a)}},{children:[a.excludedCount+a.flaggedCount," data point",a.excludedCount+a.flaggedCount===1?"":"s"," not included"]})):null,T?t("div",n({className:"ag-tip__cta"},{children:"Click point for full details →"})):null]}))}},legend:{show:!1},style:y,onPointClick:function(n){var e=n.index,t=p[e];t&&(null==T||T(t))}}),t(x,{series:L,hidden:S,onToggle:W})]})),F?i("p",n({className:"ag-chart__viewing"},{children:["Viewing ",F]})):null,t("div",n({className:"ag-chart__movement"},{children:[["up"===w?"#10B981":"#F43F5E","Up"],["up"===w?"#F43F5E":"#10B981","Down"],["#5928ED","Trend"],["#0F172A","Same"],["#2563EB","Historic (no classification)"]].map(function(n){var e=n[0],l=n[1];return i("span",{children:[t("i",{style:{background:e}})," ",l]},l)})}))]}))}var C=["#06B6D4","#F59E0B","#3B82F6","#A855F7","#10B981","#EC4899","#64748B","#F04444","#14B8A6","#84CC16"],N=function(n){var e=n.slice(0,10).split("-").map(Number),t=e[0],i=e[1],l=e[2];return t?new Date(t,i-1,l).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}):n};function A(e){var l=e.items,s=e.labelOf,v=e.goodOf,m=e.syncId,g=a(function(){return Array.from(new Set(l.flatMap(function(n){return n.points.map(function(n){return n.x})}))).sort()},[l]),f=a(function(){return l.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:s(n.kpiId),color:C[e%C.length],curve:"smooth",area:!1,data:g.map(function(n){var e;return{x:n,y:null!==(e=t.get(n))&&void 0!==e?e:null}}),valueFormatter:function(n){return u(n)}}})},[l,g,s]),h=o(function(){return new Set(f.slice(3).map(function(n){return n.key}))}),_=h[0],k=h[1],w=function(n){return k(function(e){var t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t})};return g.length?t("div",n({className:"ag-chart"},{children:i("div",n({className:"ellm-graph"},{children:[t(r,{tier:"decision-advantage-activity",series:f,hiddenKeys:_,onToggleSeries:w,syncId:m,onPointClick:function(){},xAxis:{label:"Date",categories:g,tickCount:8,minTickGap:24,formatTick:function(n){return c(n)}},yAxis:{label:"Activity",beginAtZero:!0,formatTick:function(n){return u(Number(n))}},tooltip:{render:function(e){var o=e.x,a=e.points,r=String(o),c=g.indexOf(r),s=a.filter(function(n){return!_.has(n.series.key)&&null!==n.value});return i("div",n({className:"ag-tip ag-tip--wide"},{children:[t("div",n({className:"ag-tip__head"},{children:N(r)})),s.map(function(e){var o,a,s,m,g=l[f.findIndex(function(n){return n.key===e.series.key})],h=c>0&&null!==(s=null===(a=null===(o=f.find(function(n){return n.key===e.series.key}))||void 0===o?void 0:o.data[c-1])||void 0===a?void 0:a.y)&&void 0!==s?s:null,y=b(null!==(m=e.value)&&void 0!==m?m:null,h),_=g?p(y,v(g.kpiId)):null;return i("div",n({className:"ag-tip__metric"},{children:[i("div",n({className:"ag-tip__line"},{children:[i("span",{children:[t("i",{style:{background:e.color}}),e.series.label]}),t("strong",{children:u(e.value)})]})),i("div",n({className:"ag-tip__sub"},{children:[i("span",{children:["Change ",d(r)]}),t("span",n({className:"good"===_?"ag-tip__sub--good":"bad"===_?"ag-tip__sub--bad":void 0},{children:null==y?"—":"".concat(y<0?"↓":y>0?"↑":"→"," ").concat(Math.abs(y).toFixed(1),"%")}))]}))]}),e.series.key)})]}))}},legend:{show:!1},style:y}),t(x,{series:f,hidden:_,onToggle:w})]}))})):t("div",n({className:"ag-empty"},{children:"Activity is not available for this selection"}))}export{A as ActivityChart,w as TrendChart,_ as toTrendPoints};
2
- //# sourceMappingURL=AgCharts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgCharts.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{__assign as e,__spreadArray as n,__awaiter as i,__generator as r}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as a,Fragment as o}from"react/jsx-runtime";import{useState as l,useRef as d,useEffect as c,useMemo as s}from"react";import{Settings2 as u,Sparkles as v,Info as g,TrendingUp as h,ArrowUpRight as p}from"lucide-react";import{ReasoningTrigger as m,ReasoningPanel as f,RcaDecisionComponent as y}from"../RcaDecisionComponent/RcaDecisionComponent.js";import b from"../Graph/LineChart.js";import{fetchInsightsCorrelation as _,toIsoDay as k,fetchInsightsCorrelationTrend as w,fetchGraphGroups as N,fetchLevelSummary as D,saveCorrelationWindow as x,fetchInsightsSeries as K,generateInsightsSummary as I,generateLevelSummary as C,fetchInsightsDrivers as A,fetchLevelRows as T}from"../../api/insightsApi.js";import{useInsights as S}from"./insightsContextCore.js";import{useInsightsFetch as L,useJob as P,shortDay as M,formatValue as B,reportDecisioning as R,useOpenRow as j,toRcaItems as F,previousDayLabel as O}from"./insightsUtils.js";import{ChartSkeleton as E,CollapsibleVisualSection as G,formatHeaderDate as U,SectionHeader as W,DaysDropdown as H,SkeletonLines as z,splitVerdict as Z,movementVerdictLabel as q,verdictToneHex as $,movementColorHex as V,VerdictSentence as J,ReportAccordion as Q,CriticalityChip as X,MovementChip as Y,DayOverDayChange as ee,MetricsSkeleton as ne,TrendMetricsSection as ie,toneOf as re}from"./agPrimitives.js";import te,{useNeedsAttention as ae}from"./NeedsAttention.js";var oe=10;function le(n){var o,d=this,c=n.entityKey,s=S(),u=l(null),v=u[0],g=u[1],h=l(null),p=h[0],m=h[1];if(P(v,null!==(o=null==s?void 0:s.api)&&void 0!==o?o:null,function(){g(null),null==s||s.refresh()}),!(null==s?void 0:s.viewer.isAdmin))return null;return t("span",{children:[a("button",e({type:"button",className:"ins-link",disabled:Boolean(v),onClick:function(){return i(d,void 0,void 0,function(){var e,n,i,t;return r(this,function(r){switch(r.label){case 0:m(null),r.label=1;case 1:return r.trys.push([1,6,,7]),e={dataDay:k(s.range.endDate),window:"both"},c?[4,C(s.api,c,e)]:[3,3];case 2:return i=r.sent(),[3,5];case 3:return[4,I(s.api,e)];case 4:i=r.sent(),r.label=5;case 5:return(n=i).jobId?g(n.jobId):s.refresh(),[3,7];case 6:return t=r.sent(),m(t.message||"The summary couldn't be regenerated."),[3,7];case 7:return[2]}})})}},{children:v?"Regenerating…":"Regenerate summary"})),p?a("span",e({className:"ins-error"},{children:p})):null]})}var de=function(e){var n=e.trim().toLowerCase();return n?/(s|x|ch|sh)$/.test(n)?"".concat(n,"es"):/[^aeiou]y$/.test(n)?"".concat(n.slice(0,-1),"ies"):"".concat(n,"s"):"rows"},ce=function(e){return e.replace(/\b\w/g,function(e){return e.toUpperCase()})};function se(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 AI report generated yet for this day.":null:null}function ue(n){var i,r,o=n.report,d=n.movementType,u=n.direction,v=n.good,g=n.loading,h=n.error,p=l(!1),y=p[0],b=p[1],_=s(function(){return R(o)},[o]);if(c(function(){return b(!1)},[null==o?void 0:o.reportId]),g)return a("div",e({className:"ag-summary"},{children:a(z,{widths:[28,96,72],label:"Loading summary"})}));var k=null==o?void 0:o.summary,w=null!==(i=null==k?void 0:k.headline)&&void 0!==i?i:"",N=Boolean(w),D=Z(w).prefix,x=Boolean(null==k?void 0:k.eyebrow)&&"Movement unavailable"!==(null==k?void 0:k.eyebrow),K=void 0!==d,I=x?k.eyebrow:K?q(d,u):D||"Summary",C=x?"good"===k.tone||"bad"===k.tone?$(k.tone):V(k.movementType,k.movementDirection,v):K?V(d,u,v):"Good news"===D?"#15803D":"Bad news"===D?"#E11D48":"#5928ED";return t("div",e({className:"ag-summary"},{children:[a("p",e({className:"ag-summary__title",style:{color:N?C:"#64748b"}},{children:N?I:"No summary yet"})),t("div",e({className:"ag-summary__text"},{children:[N?a(J,{text:w,good:v}):null!==(r=se(o,h))&&void 0!==r?r:"Reports are written after each morning run.",N&&_?a("span",e({className:"ag-summary__brain"},{children:a(m,{open:y,onToggle:function(){return b(function(e){return!e})},label:"how the AI reached this summary"})})):null]})),y&&_?a("div",e({className:"ag-summary__reasoning"},{children:a(f,{decisioning:_})})):null]}))}function ve(e){var n=e.report,i=e.error,r=e.loading,t=!r&&"generated"===(null==n?void 0:n.status),o=s(function(){return t?R(n,null==n?void 0:n.footer):null},[t,n]),l=j();return a(y,{className:"ag-decision",title:"Decision Advantage",score:t?null==n?void 0:n.score:null,decisioning:o,notice:r?null:se(n,i),afterSections:r?a(z,{widths:[22,92,84,66,22,88,74],label:"Loading Decision Advantage"}):null,rootCause:t?F(null==n?void 0:n.rootCause,l):[],nextSteps:t?F(null==n?void 0:n.nextSteps,l):[],width:"100%",maxWidth:"none"})}var ge=[{key:"drivers",label:"Top Drivers",info:"What moved the day's number the same way."},{key:"headwinds",label:"Headwinds",info:"What moved against the day's number."},{key:"attention",label:"Needs attention",info:"The number moved, but activity doesn't explain it."}],he={drivers:"Nothing moved the day's way.",headwinds:"Nothing ran against the day.",attention:"No drivers for this day."},pe={high:"High correlation",medium:"Medium correlation",low:"Low correlation",none:"No correlation"};function me(n){var i=n.on,r=n.onClick;return t("button",e({type:"button",className:"ag-graph-pill".concat(i?" is-on":""),onClick:function(e){e.stopPropagation(),r()}},{children:[a(h,{"aria-hidden":"true"}),i?"In graph":"Add to graph"]}))}function fe(n){var i=n.rank,r=n.category,o=n.name,l=n.chips,d=n.action,c=n.lines,s=n.cell,u=n.onOpen;return a("li",{children:t("div",e({className:"ag-driver".concat(u?" is-clickable":""),role:u?"button":void 0,tabIndex:u?0:void 0,onClick:u,onKeyDown:u?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u())}:void 0},{children:[t("div",e({className:"ag-driver__main"},{children:[t("span",e({className:"ag-driver__rank"},{children:[i,"."]})),t("div",e({className:"ag-driver__body"},{children:[r?t("span",e({className:"ag-driver__category"},{children:[r," >"]})):null,a("span",e({className:"ag-driver__name"},{children:o})),t("div",e({className:"ag-driver__chips"},{children:[l,d]})),c]}))]})),t("div",e({className:"ag-driver__cell"},{children:[s,u?a("span",e({className:"ag-driver__open","aria-hidden":"true"},{children:a(p,{})})):null]}))]}))})}function ye(n){var i=n.label,r=n.rightLabel,o=void 0===r?"User Activity":r,l=n.children;return t("div",e({className:"ag-drivers"},{children:[t("div",e({className:"ag-drivers__head"},{children:[a("span",{children:i}),a("span",{children:o})]})),a("ol",{children:l})]}))}function be(n){var i,r,d,s,u,v,h,p,m,f=n.dataDay,y=n.entityKey,b=n.parentNodeKey,_=n.kpiId,k=n.title,w=n.graphed,N=n.onToggleGraph,D=n.onOpenDriver,x=n.onDecisionSettled,K=n.initialTab,I=void 0===K?"drivers":K,C=S(),T=l(I),P=T[0],M=T[1],R=l({drivers:1,headwinds:1,attention:1}),j=R[0],F=R[1],E=null!==(i=null!=_?_:null==C?void 0:C.headlineKpi)&&void 0!==i?i:void 0,G=function(e){return C&&E&&e===P?function(n){return A(C.api,{dataDay:f,kpiId:E,entityKey:y,parentNodeKey:b,tab:e,limit:3*j[e],offset:0},n)}:null},U=function(e){return[null==C?void 0:C.api.configId,f,E,y,b,e,P,j[e],null==C?void 0:C.revision]},W={drivers:L(G("drivers"),U("drivers")),headwinds:L(G("headwinds"),U("headwinds")),attention:L(G("attention"),U("attention"))},H=W[P],z=H.data,Z=H.error,q=H.loading,$=null!==(u=null!==(d=null===(r=W.drivers.data)||void 0===r?void 0:r.tabs)&&void 0!==d?d:null===(s=W.headwinds.data)||void 0===s?void 0:s.tabs)&&void 0!==u?u:null===(v=W.attention.data)||void 0===v?void 0:v.tabs,V=ae(f,b,E),ne=null!==(p=null===(h=V.data)||void 0===h?void 0:h.counts.pending)&&void 0!==p?p:0;if(c(function(){return F({drivers:1,headwinds:1,attention:1})},[f]),c(function(){return M(I)},[I]),!C)return null;var ie=C.goodDirection(null!=E?E:""),re=null!==(m=null==z?void 0:z.rows)&&void 0!==m?m:[];return t(Q,e({title:k},{children:[a("div",e({className:"ag-driver-tabs",role:"tablist","aria-label":"Driver views"},{children:ge.map(function(n){return t("button",e({type:"button",role:"tab","aria-selected":P===n.key,className:P===n.key?"is-active":void 0,onClick:function(){return M(n.key)},title:n.info},{children:[n.label,(null==$?void 0:$[n.key])?" (".concat($[n.key].total,")"):"","attention"===n.key&&ne?t("span",e({className:"ag-na__tab-badge",title:"".concat(ne," data points need a decision")},{children:[ne,a("span",e({className:"ins-visually-hidden"},{children:" data points need a decision"}))]})):null,a(g,{"aria-hidden":"true"})]}),n.key)})})),"attention"===P?a(te,{dataDay:f,nodeKey:b,kpiId:E,attention:V,onDecisionSettled:x}):null,"attention"===P&&re.length?a("h4",e({className:"ag-na__subhead"},{children:"Rows that moved without a clear cause"})):null,Z?t("p",e({className:"ag-muted"},{children:["Top drivers are unavailable right now: ",Z.message]})):q&&!z?a("p",e({className:"ag-muted"},{children:"Loading drivers..."})):re.length?t(o,{children:[a(ye,e({label:"Driver"},{children:re.map(function(n){var i,r,l,d,c,s,u,v,g,h,p,m=n.deltaContributionPct,y=(null===(i=n.decisionAdvantage)||void 0===i?void 0:i.correlationSentence)||(null===(r=n.decisionAdvantage)||void 0===r?void 0:r.firstCause)||(null===(l=n.decisionAdvantage)||void 0===l?void 0:l.headline);return a(fe,{rank:n.rank,category:null===(d=n.path)||void 0===d?void 0:d.slice(0,-1).join(" › "),name:n.label,chips:t(o,{children:[a(X,{criticality:n.criticality}),a(Y,{movementType:n.movementType,direction:n.changeDirection}),(null===(c=n.correlation)||void 0===c?void 0:c.strength)?a("span",e({className:"ag-driver__badge ag-driver__badge--".concat(n.correlation.strength)},{children:pe[n.correlation.strength]})):null]}),action:N?a(me,{on:w.includes(n.nodeKey),onClick:function(){return N(n)}}):void 0,lines:t(o,{children:[null!=m?t("span",e({className:"ag-driver__share"},{children:[Math.abs(m),"% of today's movement ·"," ","opposite"===n.direction?"in the opposite direction":"driving the ".concat(null!==(s=null==z?void 0:z.headlineDirection)&&void 0!==s?s:"change")]})):null,t("span",e({className:"ag-driver__cost"},{children:[a("span",e({className:"ag-driver__total"},{children:B(n.value)})),null!=n.deltaPct?a("span",e({className:"ag-driver__sep"},{children:"|"})):null,a(ee,{deltaPct:n.deltaPct,good:ie,direction:n.changeDirection,tone:n.tone,suffix:O(f)})]})),y?a("p",e({className:"ag-driver__brief"},{children:a(J,{text:y,good:ie,arrowsFollowVerdict:!0})})):null,(null===(u=n.decisionAdvantage)||void 0===u?void 0:u.nextStep)?t("p",e({className:"ag-driver__brief"},{children:[a("strong",{children:"Next:"})," ",n.decisionAdvantage.nextStep]})):null]}),cell:t("span",e({className:"ag-driver__activity"},{children:[a("strong",{children:B(null!==(g=null===(v=n.drivingMetric)||void 0===v?void 0:v.value)&&void 0!==g?g:n.previous)}),a("span",{children:(null===(h=n.drivingMetric)||void 0===h?void 0:h.label)||((null===(p=n.drivingMetric)||void 0===p?void 0:p.kpiId)?C.kpiLabel(n.drivingMetric.kpiId):"opposite"===n.direction?"Moved opposite":"with"===n.direction?"Moved with":"Previous")})]})),onOpen:function(){var e;return D?D(n):C.openReport({reportId:null===(e=n.report)||void 0===e?void 0:e.reportId,nodeKey:n.nodeKey,kpiId:E,dataDay:f,title:n.label})}},n.nodeKey)})})),(null==z?void 0:z.hasMore)?a("div",e({className:"ag-more"},{children:a("button",e({type:"button",disabled:q,onClick:function(){return F(function(n){var i;return e(e({},n),((i={})[P]=n[P]+1,i))})}},{children:q?"Loading...":"Show more"}))})):null]}):a("p",e({className:"ag-muted"},{children:he[P]}))]}))}var _e=["#4F46E5","#64748B","#0F766E","#7C3AED","#475569","#818CF8","#94A3B8"],ke=function(e,n){void 0===n&&(n="en-GB");var i=e.slice(0,10).split("-").map(Number),r=i[0],t=i[1],a=i[2];return Number.isFinite(r)&&Number.isFinite(t)&&Number.isFinite(a)?new Intl.DateTimeFormat(n,{day:"numeric",month:"short"}).format(new Date(r,t-1,a)):e};function we(v){var g,h,p,m,f,y,N,D,K=this,I=v.dataDay,C=v.nodeKey,A=void 0===C?"root":C,T=v.kpiId,R=v.dayGroup,j=S(),F=null!==(g=null!=T?T:null==j?void 0:j.headlineKpi)&&void 0!==g?g:void 0,O=l(""),U=O[0],W=O[1],H=l([]),z=H[0],Z=H[1],q=l({}),$=q[0],V=q[1],J=l(""),Q=J[0],X=J[1],Y=l(null),ee=Y[0],ne=Y[1],ie=l(null),re=ie[0],te=ie[1],ae=l(!1),oe=ae[0],le=ae[1],de=l(!1),ce=de[0],se=de[1],ue=d(null),ve=L(j&&F&&I?function(n){return _(j.api,A,e({kpiId:F,dataDay:I,startDate:k(j.range.startDate),endDate:k(j.range.endDate)},$),n)}:null,[null==j?void 0:j.api.configId,null==j?void 0:j.rangeKey,I,F,A,$.disregardBefore,null===(h=$.disregardDates)||void 0===h?void 0:h.join(","),null==j?void 0:j.revision]),ge=ve.data,he=ve.error,me=ve.loading,fe=L(j&&F&&I?function(n){return w(j.api,A,e({kpiId:F,startDate:k(j.range.startDate),endDate:k(j.range.endDate)},$),n)}:null,[null==j?void 0:j.api.configId,null==j?void 0:j.rangeKey,I,F,A,$.disregardBefore,null===(p=$.disregardDates)||void 0===p?void 0:p.join(","),null==j?void 0:j.revision]);P(re,null!==(m=null==j?void 0:j.api)&&void 0!==m?m:null,function(){te(null),X(""),null==j||j.refresh()}),c(function(){if(oe){var e=function(e){ue.current&&!ue.current.contains(e.target)&&le(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}}},[oe]);var ye=l(new Set),be=ye[0],we=ye[1],Ne=s(function(){if(!ge)return[];return ge.series.filter(function(e){return!(null==R?void 0:R.length)||R.map(Number).includes((n=e.x,new Date("".concat(n.slice(0,10),"T00:00:00")).getDay()||7));var n})},[ge,R]),De=s(function(){return ge&&j?n([ge.kpiId],ge.drivers.map(function(e){return e.kpiId}).filter(function(e){return e!==ge.kpiId}),!0).map(function(e,n){return{key:"corr_".concat(e.replace(/[^a-zA-Z0-9_]/g,"_")),label:j.kpiLabel(e),color:_e[n%_e.length],curve:"smooth",strokeWidth:2,pointRadius:2,data:Ne.map(function(n){var i,r;return{x:n.x,y:n.disregarded?null:null!==(r=null===(i=n.values)||void 0===i?void 0:i[e])&&void 0!==r?r:null}}),valueFormatter:function(e){return"".concat(e,"%")}}}):[]},[ge,j,Ne]);c(function(){return we(new Set(De.slice(2).map(function(e){return e.key})))},[De]);if(!j||!I||"no_drivers"===(null==ge?void 0:ge.state)||ge&&!ge.verdictText)return null;if(he)return t("div",e({className:"ag-empty"},{children:["Correlation is unavailable right now: ",he.message]}));if(me&&!ge)return a(E,{height:220,label:"Loading correlation"});if(!ge)return null;var xe=null!==(f=ge.strength)&&void 0!==f?f:"none",Ke=j.kpiLabel(ge.kpiId);return a(G,e({title:"Correlation",meta:"Usage vs. ".concat(Ke),className:"ag-visual--card",action:j.viewer.isAdmin?t("div",e({ref:ue,className:"ag-corr__settings"},{children:[a("button",e({type:"button",className:"ag-icon-button","aria-label":"Correlation settings","aria-expanded":oe,onClick:function(){return le(function(e){return!e})}},{children:a(u,{"aria-hidden":"true"})})),oe?a("div",e({className:"ag-corr__settings-menu",role:"menu"},{children:t("label",{children:[a("input",{type:"checkbox",checked:ce,onChange:function(e){return se(e.target.checked)}}),"Show date controls"]})})):null]})):null},{children:t("div",e({className:"ag-corr"},{children:[a("p",e({className:"ag-corr__banner ag-corr__banner--".concat(xe)},{children:ge.verdictText})),a("span",e({className:"ag-driver__badge ag-driver__badge--".concat(xe)},{children:pe[xe]})),t("p",e({className:"ag-corr__caption"},{children:[Ke," vs. usage - % change from the first day shown"]})),(null===(y=ge.window)||void 0===y?void 0:y.source)?a("p",e({className:"ag-muted"},{children:"default"===ge.window.source?ge.window.startDate?"Using all days since ".concat(ke(ge.window.startDate,"en-US")):"Using all available days":"row"===ge.window.source?"Saved window".concat(ge.window.startDate?" since ".concat(ke(ge.window.startDate,"en-US")):"").concat((null===(N=ge.window.excludedDates)||void 0===N?void 0:N.length)?" · ".concat(ge.window.excludedDates.length," left out"):""):"Preview window".concat((null===(D=ge.window.excludedDates)||void 0===D?void 0:D.length)?" · ".concat(ge.window.excludedDates.length," left out"):"")})):null,a("div",e({className:"ag-chart"},{children:a("div",e({className:"ellm-graph"},{children:a(b,{tier:"decision-advantage-correlation",series:De,hiddenKeys:be,onToggleSeries:function(e){return we(function(n){var i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},onPointClick:function(){},xAxis:{label:"Date",categories:Ne.map(function(e){return e.x}),formatTick:function(e){return M(e)}},yAxis:{label:"% change",beginAtZero:!1,formatTick:function(e){return"".concat(Math.round(Number(e)),"%")}},tooltip:{render:function(n){var i,r=n.x,o=n.points,l=String(r),d=null===(i=fe.data)||void 0===i?void 0:i.series.find(function(e){return e.x===l});return t("div",e({className:"ag-tip ag-tip--wide"},{children:[a("div",e({className:"ag-tip__head"},{children:ke(l)})),o.filter(function(e){return null!=e.value}).map(function(n){return t("div",e({className:"ag-tip__line"},{children:[t("span",{children:[a("i",{style:{background:n.color}}),n.series.label]}),t("strong",{children:[n.value,"%"]})]}),n.series.key)}),d?Object.keys(d.r).map(function(n){var i,r;return t("div",e({className:"ag-tip__sub"},{children:[a("span",{children:j.kpiLabel(n)}),a("span",{children:null==d.r[n]?"No correlation":"r ".concat(d.r[n]," · ").concat(null!==(i=d.strength[n])&&void 0!==i?i:"none"," · ").concat(null!==(r=d.nObs[n])&&void 0!==r?r:0," days")})]}),n)}):null]}))}},legend:{position:"bottom",toggle:!0},style:{chartHeight:220,yAxisWidth:60,gridColor:"#e2e8f0",axisColor:"#cbd5e1",axisLabelColor:"#64748b",tickColor:"#64748b"}})}))})),a("div",e({className:"ag-corr__metrics"},{children:ge.drivers.map(function(n){var i,r=null!==(i=n.strength)&&void 0!==i?i:"none";return t("div",e({className:"ag-corr__metric"},{children:[a("span",e({className:"ag-corr__name"},{children:n.label||j.kpiLabel(n.kpiId)})),n.kpiId!==ge.kpiId?a("span",e({className:"ag-driver__badge ag-driver__badge--".concat(r)},{children:pe[r]})):null,a("strong",{children:B(n.value)}),a("span",e({className:"ag-corr__delta"},{children:null!=n.deltaPct?t(o,{children:[t("span",e({className:"ag-dod__value ag-dod__value--".concat(n.tone||"flat")},{children:["up"===n.direction?"↑":"down"===n.direction?"↓":"→"," ",Math.abs(n.deltaPct),"%"]}))," vs. ",B(n.previous)]}):"—"})),n.kpiId!==ge.kpiId?t("span",e({className:"ag-corr__r"},{children:[n.nObs," days used",n.lowHistory?" · Low history":"",a("br",{}),null==n.movedWithToday?"No comparison for today":n.movedWithToday?"Moved together with the headline today":"Moved opposite the headline today"]})):null]}),n.kpiId)})})),j.viewer.isAdmin&&ce?t("div",e({className:"ag-corr__window"},{children:[t("label",e({className:"ag-corr__start"},{children:["Ignore data before ",a("input",{type:"date",value:U,onChange:function(e){return W(e.target.value)}})]})),t("div",e({className:"ag-corr__days-label"},{children:["Or leave out individual dates (",z.length," selected)"]})),a("div",e({className:"ag-corr__days","aria-label":"Days to leave out"},{children:ge.series.map(function(i){return a("button",e({type:"button","aria-pressed":z.includes(i.x),className:z.includes(i.x)?"is-selected":void 0,onClick:function(){return e=i.x,Z(function(i){return i.includes(e)?i.filter(function(n){return n!==e}):n(n([],i,!0),[e],!1)});var e}},{children:ke(i.x)}),i.x)})})),a("input",{className:"ag-corr__reason",value:Q,onChange:function(e){return X(e.target.value)},placeholder:"Reason required to apply"}),ee?a("p",e({className:"ins-error"},{children:ee})):null,t("div",e({className:"ag-corr__actions"},{children:[a("button",e({type:"button",className:"ins-link",onClick:function(){return V({disregardBefore:U||void 0,disregardDates:z})}},{children:"Preview"})),a("button",e({type:"button",className:"ins-button",disabled:Boolean(re),onClick:function(){return i(K,void 0,void 0,function(){var e,n;return r(this,function(i){switch(i.label){case 0:if(!j||!F||!Q.trim())return ne("A reason is required."),[2];ne(null),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,x(j.api,A,{kpiId:F,startDate:U||null,excludedDates:z,dataDay:I,changeReason:Q.trim(),regenerate:!0})];case 2:return e=i.sent(),te(e.jobId),[3,4];case 3:return n=i.sent(),ne(n.message||"The correlation window couldn't be saved."),[3,4];case 4:return[2]}})})}},{children:"Apply"})),a("button",e({type:"button",className:"ins-link",onClick:function(){W(""),Z([]),V({})}},{children:"Clear"}))]}))]})):null]}))}))}var Ne=function(e){var n;return(null===(n=null==e?void 0:e.period)||void 0===n?void 0:n.end)||null};function De(i){var r,d,u,v,g,h,p,m,f=i.entityKey,y=i.kpis,_=i.nodeKeys,k=i.workingDays,w=i.showMetrics,N=i.group,D=i.onOpenPoint,x=S(),I=l(null!==(r=y[0])&&void 0!==r?r:""),C=I[0],A=I[1];c(function(){var e;y.includes(C)||A(null!==(e=y[0])&&void 0!==e?e:"")},[y,C]);var T=L(x&&C&&null!==N?function(n){return K(x.api,e(e({},x.range),{workingDaysOnly:k,group:N||void 0}),_.length?{kpiIds:[C],nodeKeys:_.slice(0,10)}:{kpiIds:[C],entityKey:f,topN:3},n)}:null,[null==x?void 0:x.api.configId,null==x?void 0:x.rangeKey,f,C,_.join(","),k,N,null==x?void 0:x.revision]),P=T.data,R=T.loading,j=T.error,F=s(function(){var e;return null!==(e=null==P?void 0:P.series)&&void 0!==e?e:[]},[P]),O=l(null),G=O[0],U=O[1];c(function(){return U(null)},[F]);var W=l(new Set),H=W[0],z=W[1];c(function(){return z(new Set)},[F]);var Z=s(function(){return Array.from(new Set(F.flatMap(function(e){return e.points.map(function(e){return e.x})}))).sort()},[F]),q=s(function(){return F.map(function(e,n){var i,r=new Map(e.points.map(function(e){return[e.x,e.y]})),t=null!==(i=null==x?void 0:x.goodDirection(e.kpiId))&&void 0!==i?i:"up";return{key:"row_".concat(n,"_").concat(e.nodeKey.replace(/[^a-zA-Z0-9_]/g,"_")),label:e.label||e.nodeKey,color:["#06B6D4","#10A66A","#8650FF","#F59E0B","#E94BBD","#4285FF","#64748B","#F04444","#14B8A6","#84CC16"][n%10],curve:"smooth",pointRadius:3,activePointRadius:3,fillPointsOnHover:!0,data:Z.map(function(e){var n;return{x:e,y:null!==(n=r.get(e))&&void 0!==n?n:null}}),valueFormatter:function(e){return B(e)},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:V(n.meta.marker.movementType,n.meta.marker.direction,t),label:[n.meta.marker.criticality,n.meta.marker.headline].filter(Boolean).join(" · "),radius:3,haloRadius:3,onClick:function(){var i,r=null!==(i=e.label)&&void 0!==i?i:e.nodeKey;D?D({nodeKey:e.nodeKey,label:r,kpiId:e.kpiId,dataDay:n.x,reportId:n.meta.marker.reportId}):null==x||x.openReport(n.meta.marker.reportId?{reportId:n.meta.marker.reportId,title:"".concat(r," · ").concat(M(n.x))}:{nodeKey:e.nodeKey,kpiId:e.kpiId,dataDay:n.x,title:"".concat(r," · ").concat(M(n.x))})}}})}})},[F,Z,x,D]);if(!x)return null;var $=x.kpiLabel(C),J=x.goodDirection(C),Q=null!==(d=F.find(function(e){return e.nodeKey===G}))&&void 0!==d?d:F[0],X=Q?n([],Q.points,!0).reverse().find(function(e){return null!=e.y}):void 0;return t("div",e({className:"ag-row-trend"},{children:[y.length>1?a("div",e({className:"ag-chart__switch",role:"group","aria-label":"Number"},{children:y.map(function(n){return a("button",e({type:"button","aria-pressed":n===C,className:n===C?"is-active":void 0,onClick:function(){return A(n)}},{children:x.kpiLabel(n)}),n)})})):null,w&&R?a(ne,{}):w&&X?t(o,{children:[F.length>1?t("label",e({className:"ag-row-trend__for"},{children:["Averages for",a("select",e({value:Q.nodeKey,onChange:function(e){return U(e.target.value)}},{children:F.map(function(n){return a("option",e({value:n.nodeKey},{children:n.label||n.nodeKey}),n.nodeKey)})}))]})):null,a(ie,{dailyLabel:"Daily ".concat($),daily:X.y,fast:null!==(v=null===(u=X.meta)||void 0===u?void 0:u.fastMa)&&void 0!==v?v:null,slow:null!==(h=null===(g=X.meta)||void 0===g?void 0:g.slowMa)&&void 0!==h?h:null,long:null!==(m=null===(p=X.meta)||void 0===p?void 0:p.longMa)&&void 0!==m?m:null,windows:x.windows,good:J,format:B})]}):null,j?a("div",e({className:"ag-empty"},{children:"This chart is unavailable right now."})):R?a(E,{height:240,label:"Loading trend"}):Z.length?a("div",e({className:"ag-chart"},{children:t("div",e({className:"ellm-graph"},{children:[a(b,{tier:"decision-advantage-".concat(f),series:q,hiddenKeys:H,onToggleSeries:function(e){return z(function(n){var i=new Set(n);return i.has(e)?i.delete(e):i.size<q.length-1&&i.add(e),i})},onPointClick:function(e){var n,i,r,t,a,o,l=e.series,d=e.point,c=e.index,s=q.findIndex(function(e){return e.key===l.key}),u=F[s],v=null!==(n=d.x)&&void 0!==n?n:null===(i=l.data[c])||void 0===i?void 0:i.x,g=null==u?void 0:u.points.find(function(e){return e.x===String(v)});if(u&&g){var h=null!==(r=u.label)&&void 0!==r?r:u.nodeKey,p=null!==(o=null===(a=null===(t=g.meta)||void 0===t?void 0:t.marker)||void 0===a?void 0:a.reportId)&&void 0!==o?o:null;D?D({nodeKey:u.nodeKey,label:h,kpiId:u.kpiId,dataDay:g.x,reportId:p}):x.openReport(p?{reportId:p,title:"".concat(h," · ").concat(M(g.x))}:{nodeKey:u.nodeKey,kpiId:u.kpiId,dataDay:g.x,title:"".concat(h," · ").concat(M(g.x))})}},xAxis:{label:"Date",categories:Z,tickCount:8,minTickGap:24,formatTick:function(e){return M(e)}},yAxis:{label:$,beginAtZero:!0,formatTick:function(e){return B(Number(e))}},tooltip:{formatHeading:function(e){return String(e)}},legend:{show:!1},style:{chartHeight:240,yAxisWidth:70,gridColor:"#e2e8f0",axisColor:"#cbd5e1",axisLabelColor:"#64748b",tickColor:"#64748b"}}),a("div",e({className:"ellm-graph__legend ellm-chart__legend--bottom ellm-chart__legend--center"},{children:q.map(function(n){var i=H.has(n.key);return t("label",e({title:n.label,className:"ellm-graph__legend-item ag-legend-item".concat(i?" ellm-graph__legend-item--off":""),style:{cursor:"pointer","--checkbox-color":n.color,color:n.color}},{children:[a("input",{type:"checkbox",className:"ellm-graph__legend-checkbox",checked:!i,onChange:function(){return z(function(e){var i=new Set(e);return i.has(n.key)?i.delete(n.key):i.size<q.length-1&&i.add(n.key),i})},style:{borderColor:n.color,accentColor:n.color}}),a("span",{children:n.label})]}),n.key)})}))]}))})):a("div",e({className:"ag-empty"},{children:"Not enough history yet for a trend chart."}))]}))}function xe(d){var s,u=this,v=d.tab,g=d.partName,h=d.kpiIds,p=d.rankBy,m=d.search,f=d.graphed,y=d.onToggleGraph,b=d.onOpenRow,_=d.onFirstRow,w=S(),N=Math.min(200,Math.max(1,Number(v.pageSize)||5)),D=l([]),x=D[0],K=D[1],I=l(null),C=I[0],A=I[1],L=l(!1),P=L[0],M=L[1],R=l({loading:!0,error:null}),j=R[0],F=R[1],O=function(e,t){return i(u,void 0,void 0,function(){var i,a;return r(this,function(r){switch(r.label){case 0:if(!w)return[2];F({loading:!0,error:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,T(w.api,v.entityKey,w.range,{sort:p,order:"desc",search:m||void 0,pageSize:N,cursor:null!=e?e:void 0,includeChildren:3},t)];case 2:return i=r.sent(),(null==t?void 0:t.aborted)?[2]:(K(function(r){return e?n(n([],r,!0),i.rows,!0):i.rows}),A(i.nextCursor),M(i.hasNext),F({loading:!1,error:null}),[3,4]);case 3:return a=r.sent(),(null==t?void 0:t.aborted)||"AbortError"===(null==a?void 0:a.name)?[2]:(F({loading:!1,error:a.message||"Couldn't load the rows."}),[3,4]);case 4:return[2]}})})},E=null===(s=x[0])||void 0===s?void 0:s.nodeKey;if(c(function(){return null==_?void 0:_(E)},[E]),c(function(){var e=new AbortController;return O(null,e.signal),function(){return e.abort()}},[null==w?void 0:w.api.configId,null==w?void 0:w.rangeKey,v.entityKey,p,m,N,null==w?void 0:w.revision]),!w)return null;var G=w.goodDirection(p),U=h.filter(function(e){return e!==p}).slice(0,2),W=de(g);return a(Q,e({title:"Top Drivers for ".concat(ce(W))},{children:j.error?a("p",e({className:"ag-muted"},{children:"Top drivers are unavailable right now."})):j.loading&&!x.length?a(z,{widths:[80,60,85,55,75],label:"Loading drivers"}):x.length?t(o,{children:[a(ye,e({label:ce(g),rightLabel:"User Activity · selected dates"},{children:x.map(function(n){var i,r,l,d,c=null===(i=n.metrics)||void 0===i?void 0:i[p],s=n.label||n.nodeKey;return a(fe,{rank:n.rank,name:s,chips:t(o,{children:[a(X,{criticality:null===(r=n.chip)||void 0===r?void 0:r.criticality}),a(Y,{movementType:null===(l=n.chip)||void 0===l?void 0:l.movementType,direction:null===(d=n.chip)||void 0===d?void 0:d.direction})]}),action:a(me,{on:f.includes(n.nodeKey),onClick:function(){return y(n.nodeKey)}}),lines:t("span",e({className:"ag-driver__cost"},{children:[t("span",e({className:"ag-driver__total"},{children:[B(null==c?void 0:c.value)," ",w.kpiLabel(p).toLowerCase()]})),null!=(null==c?void 0:c.deltaPct)?a("span",e({className:"ag-driver__sep"},{children:"|"})):null,a(ee,{deltaPct:null==c?void 0:c.deltaPct,good:G,direction:null==c?void 0:c.direction,tone:null==c?void 0:c.tone,suffix:"vs previous period"})]})),cell:U.map(function(i){var r,o,l=null===(r=n.metrics)||void 0===r?void 0:r[i],d=null!==(o=null==l?void 0:l.tone)&&void 0!==o?o:re(null==l?void 0:l.deltaPct,w.goodDirection(i)),c="up"===(null==l?void 0:l.direction)?"↑":"down"===(null==l?void 0:l.direction)?"↓":"flat"===(null==l?void 0:l.direction)?"→":null!=(null==l?void 0:l.deltaPct)&&l.deltaPct>0?"↑":null!=(null==l?void 0:l.deltaPct)&&l.deltaPct<0?"↓":"→";return t("span",e({className:"ag-driver__activity"},{children:[a("strong",e({className:"good"===d?"ag-text--good":"bad"===d?"ag-text--bad":void 0},{children:null==(null==l?void 0:l.deltaPct)?B(null==l?void 0:l.value):"".concat(c).concat(Math.abs(l.deltaPct),"%")})),a("span",{children:w.kpiLabel(i)})]}),i)}),onOpen:function(){var e;return b(n,p,(null===(e=n.chip)||void 0===e?void 0:e.dataDay)||k(w.range.endDate))}},n.nodeKey)})})),P?a("div",e({className:"ag-more"},{children:a("button",e({type:"button",disabled:j.loading,onClick:function(){return O(C)}},{children:j.loading?"Loading...":"Show more"}))})):null]}):a("p",e({className:"ag-muted"},{children:m?"No ".concat(W," match “").concat(m,"”."):"No ".concat(W," for this period yet.")}))}))}function Ke(i){var r,d,s,u,g,h,p,m,f,y,b=i.tab,_=i.title,k=i.partName,w=i.partKpis,x=i.search,K=i.onOpenRow,I=S(),C=l(Boolean(null==I?void 0:I.defaultWorkingDays)),A=C[0],T=C[1],P=L(I?function(e){return N(I.api,e)}:null,[null==I?void 0:I.api.configId,null==I?void 0:I.revision]),M=l(null),B=M[0],R=M[1];c(function(){var e,n;null===B&&((null===(e=P.data)||void 0===e?void 0:e.groups.length)?R((null!==(n=P.data.groups.find(function(e){return e.isDefault}))&&void 0!==n?n:P.data.groups[0]).groupKey):P.loading||R(""))},[B,P.data,P.loading]);var j=l([]),F=j[0],O=j[1],E=l(),z=E[0],Z=E[1],q=!1!==b.showSummary,$=L(I&&q?function(e){return D(I.api,b.entityKey,I.range,e)}:null,[null==I?void 0:I.api.configId,null==I?void 0:I.rangeKey,b.entityKey,q,null==I?void 0:I.revision]);if(!I)return null;var V=(null===(r=b.listKpis)||void 0===r?void 0:r.length)?b.listKpis:w,J=b.rankBy&&V.includes(b.rankBy)?b.rankBy:null!==(d=V[0])&&void 0!==d?d:"",Q=null===(s=$.data)||void 0===s?void 0:s.report,X=Ne(null===(u=$.data)||void 0===u?void 0:u.context),Y=I.goodDirection(J),ee=null!==(g=b.tier1Kpis)&&void 0!==g?g:I.tierKpis[1],ne=null!==(h=b.tier2Kpis)&&void 0!==h?h:I.tierKpis[2],ie=I.headlineKpi||J||ee[0]||"",re=function(e){var n=e.nodeKey,i=e.label,r=e.dataDay;return K({rank:0,nodeKey:n,label:i,parent:null,metrics:{},barPct:null,chip:null,report:{reportId:null,status:"none",kpiId:ie},action:null,children:[]},ie,r)};return t("section",e({className:"ag-report","aria-label":"L2 Report · ".concat(_)},{children:[t("div",e({className:"ag-report__header"},{children:[t("h2",e({className:"ag-report__title"},{children:[a(v,{"aria-hidden":"true"}),"L2 Report"]})),a("span",e({className:"ag-report__scope"},{children:_})),X?a("span",e({className:"ag-report__date"},{children:U(X)})):null]})),t("div",e({className:"ag-report__grid ag-report__grid--l2"},{children:[t("div",e({className:"ag-stack"},{children:[q?t(o,{children:[t("div",{children:[a(W,{title:"Summary",action:a(le,{entityKey:b.entityKey})}),a(ue,{report:Q,loading:$.loading,error:$.error,good:Y})]}),a(ve,{report:Q,error:$.error,loading:$.loading})]}):null,V.length?a(xe,{tab:b,partName:k,kpiIds:V,rankBy:J,search:x,graphed:F,onToggleGraph:function(e){return O(function(i){return i.includes(e)?i.filter(function(n){return n!==e}):n(n([],i,!0),[e],!1).slice(-3)})},onOpenRow:K,onFirstRow:Z}):null]})),t("div",e({className:"ag-stack"},{children:[ee.length?a(G,e({title:"Trend",action:a(H,{value:A,onChange:T,groups:P.error||null===(p=P.data)||void 0===p?void 0:p.groups,group:B,onGroupChange:R})},{children:a(De,{entityKey:b.entityKey,kpis:ee,nodeKeys:F,workingDays:A,showMetrics:!0,group:B,onOpenPoint:re})})):null,ne.length?a(G,e({title:"User Activity",meta:F.length?"Rows you added":"Top ".concat(3," ").concat(de(k))},{children:a(De,{entityKey:b.entityKey,kpis:ne,nodeKeys:F,workingDays:A,showMetrics:!1,group:B,onOpenPoint:re})})):null,a(we,{dataDay:X,nodeKey:null!==(m=F[0])&&void 0!==m?m:z,dayGroup:null===(y=null===(f=P.data)||void 0===f?void 0:f.groups.find(function(e){return e.groupKey===B}))||void 0===y?void 0:y.days})]}))]}))]}))}export{me as AddToGraph,we as CorrelationSection,ve as DecisionCard,ye as DriverList,fe as DriverRow,Ke as L2Report,oe as MAX_SERIES,le as RegenerateSummary,xe as RowDrivers,De as RowTrend,ue as SummaryCard,be as TopDriversSection,Ne as reportDayOf,ce as titleCase};
2
- //# sourceMappingURL=AgReport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgReport.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{__assign as e,__awaiter as n,__generator as t}from"../../../_virtual/_tslib.js";import{jsxs as i,jsx as l,Fragment as r}from"react/jsx-runtime";import{useState as a}from"react";import{MessageSquare as s,PenLine as o,Trash2 as c}from"lucide-react";import{fetchReportComments as u,updateReportComment as m,postReportComment as d,deleteReportComment as h}from"../../api/insightsApi.js";import{useInsights as p}from"./insightsContextCore.js";import{useInsightsFetch as v}from"./insightsUtils.js";var b=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 f(r){var s=this,o=r.placeholder,c=r.submitLabel,u=r.onSubmit,m=r.onCancel,d=r.initialValue,h=a(void 0===d?"":d),p=h[0],v=h[1],b=a(!1),f=b[0],N=b[1],g=a(null),C=g[0],y=g[1];return i("div",e({className:"ins-comment-box"},{children:[l("textarea",{value:p,maxLength:4e3,placeholder:o,"aria-label":o,onChange:function(e){return v(e.target.value)},rows:2}),C?l("p",e({className:"ins-error"},{children:C})):null,i("div",e({className:"ins-comment-box__actions"},{children:[m?l("button",e({type:"button",className:"ins-link",onClick:m},{children:"Cancel"})):null,l("button",e({type:"button",className:"ins-button",disabled:f||!p.trim(),onClick:function(){return n(s,void 0,void 0,function(){var e;return t(this,function(n){switch(n.label){case 0:if(!p.trim())return[2];N(!0),y(null),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,u(p.trim())];case 2:return n.sent(),v(""),[3,5];case 3:return e=n.sent(),y(e.message||"Couldn't post the comment."),[3,5];case 4:return N(!1),[7];case 5:return[2]}})})}},{children:f?"Posting…":c}))]}))]}))}function N(N){var g=this,C=N.reportId,y=p(),_=a(null),k=_[0],w=_[1],x=a(null),L=x[0],S=x[1],j=a(null),B=j[0],E=j[1],A=v(y?function(e){return u(y.api,C,e)}:null,[C,null==y?void 0:y.api.configId,null==y?void 0:y.revision]),D=A.data,T=A.loading,I=A.error,R=A.reload;if(!y)return null;var V=y.viewer,P=function(a){var s,u,p=Boolean(V.email&&a.createdByEmail&&V.email.toLowerCase()===a.createdByEmail.toLowerCase());return i("li",e({className:"ins-comment"},{children:[a.isDeleted?l("p",e({className:"ins-comment__deleted"},{children:"Comment deleted"})):i(r,{children:[i("div",e({className:"ins-comment__meta"},{children:[l("strong",{children:a.createdByName||a.createdByEmail||"Someone"}),i("span",{children:[b(a.createdAt),a.edited?" · edited":""]})]})),L===a.id?l(f,{placeholder:"Edit comment",submitLabel:"Save",initialValue:null!==(s=a.commentText)&&void 0!==s?s:"",onCancel:function(){return S(null)},onSubmit:function(e){return n(g,void 0,void 0,function(){return t(this,function(n){switch(n.label){case 0:return[4,m(y.api,a.id,e)];case 1:return n.sent(),S(null),R(),[2]}})})}}):l("p",e({className:"ins-comment__text"},{children:a.commentText})),i("div",e({className:"ins-comment__actions"},{children:[l("button",e({type:"button",className:"ins-link",onClick:function(){return w(k===a.id?null:a.id)}},{children:"Reply"})),p?i("button",e({type:"button",className:"ins-link",onClick:function(){return S(a.id)}},{children:[l(o,{"aria-hidden":"true"})," Edit"]})):null,p||V.isAdmin?i("button",e({type:"button",className:"ins-link ins-link--danger",onClick:function(){return e=a.id,n(g,void 0,void 0,function(){var n;return t(this,function(t){switch(t.label){case 0:E(null),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,h(y.api,e)];case 2:return t.sent(),R(),[3,4];case 3:return n=t.sent(),E(n.message||"Couldn't delete the comment."),[3,4];case 4:return[2]}})});var e}},{children:[l(c,{"aria-hidden":"true"})," Delete"]})):null]}))]}),k===a.id?l(f,{placeholder:"Write a reply",submitLabel:"Reply",onCancel:function(){return w(null)},onSubmit:function(e){return n(g,void 0,void 0,function(){return t(this,function(n){switch(n.label){case 0:return[4,d(y.api,C,e,a.id)];case 1:return n.sent(),w(null),R(),[2]}})})}}):null,(null===(u=a.replies)||void 0===u?void 0:u.length)?l("ul",e({className:"ins-comments ins-comments--replies"},{children:a.replies.map(P)})):null]}),a.id)};return i("section",e({className:"ins-thread","aria-label":"Comments"},{children:[i("h3",{children:[l(s,{"aria-hidden":"true"})," Comments",(null==D?void 0:D.count)?" (".concat(D.count,")"):""]}),I?l("p",e({className:"ins-error"},{children:I.message})):null,B?l("p",e({className:"ins-error"},{children:B})):null,T&&!D?l("p",e({className:"ins-muted"},{children:"Loading comments…"})):null,D&&!D.comments.length?l("p",e({className:"ins-muted"},{children:"No comments yet."})):null,(null==D?void 0:D.comments.length)?l("ul",e({className:"ins-comments"},{children:D.comments.map(P)})):null,l(f,{placeholder:"Add a comment",submitLabel:"Comment",onSubmit:function(e){return n(g,void 0,void 0,function(){return t(this,function(n){switch(n.label){case 0:return[4,d(y.api,C,e)];case 1:return n.sent(),R(),[2]}})})}})]}))}export{N as default};
2
- //# sourceMappingURL=CommentsThread.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommentsThread.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{__assign as e}from"../../../_virtual/_tslib.js";import{jsx as n,jsxs as t,Fragment as i}from"react/jsx-runtime";import{RefreshCw as r,MessageSquare as a,Sparkles as l,Clock3 as o}from"lucide-react";import{RcaDecisionComponent as s}from"../RcaDecisionComponent/RcaDecisionComponent.js";import{fetchLevelSummary as d,fetchInsightsSummary as c}from"../../api/insightsApi.js";import{useInsights as u}from"./insightsContextCore.js";import{useInsightsFetch as h,useOpenRow as m,toRcaItems as p,formatReportDate as v,formatPeriod as g}from"./insightsUtils.js";function y(e,n){var t,i=[];return e&&!e.matchesRange&&(null===(t=e.period)||void 0===t?void 0:t.end)&&i.push("Latest report: ".concat(v(e.period),".")),"preliminary"===(null==e?void 0:e.runType)&&i.push("Preliminary: late data can still change it."),n&&i.push("Insights cover all data; sidebar filters don't apply here."),i.length?i.join(" "):null}function f(i){var r=i.title,a=i.icon,o=i.heading,s=i.text,d=i.action;return t("article",e({className:"ins-state"},{children:[n("header",e({className:"ins-state__header"},{children:n("span",{children:r})})),t("div",e({className:"ins-state__body"},{children:[n("span",e({className:"ins-state__icon"},{children:null!=a?a:n(l,{"aria-hidden":"true"})})),t("div",{children:[n("p",e({className:"ins-state__heading"},{children:o})),s?n("p",e({className:"ins-state__text"},{children:s})):null,d]})]}))]}))}function N(i){var r=i.title;return t("article",e({className:"ins-state","aria-busy":"true","aria-label":"Loading ".concat(r)},{children:[n("header",e({className:"ins-state__header"},{children:n("span",{children:r})})),t("div",e({className:"ins-skeleton"},{children:[n("span",{style:{width:"40%"}}),n("span",{style:{width:"85%"}}),n("span",{style:{width:"70%"}}),n("span",{style:{width:"78%"}})]}))]}))}function _(i){var l,d=i.report,c=i.title,h=i.context,v=i.onComments,N=i.onRetry,_=u(),b=m(),w=d.title||c;return"waiting"===d.status?n(f,{title:w,icon:n(o,{"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"===d.status?n(f,{title:w,icon:n(o,{"aria-hidden":"true"}),heading:"Being written",text:"The AI is writing this report. It usually takes a minute or two.",action:N?t("button",e({type:"button",className:"ins-link",onClick:N},{children:[n(r,{"aria-hidden":"true"})," Check again"]})):null}):"generated"!==d.status?n(f,{title:w,heading:"No report for this period",text:(null===(l=null==h?void 0:h.period)||void 0===l?void 0:l.start)?"Nothing was written for ".concat(g(h.period),". Reports are written after each morning run."):"Reports are written after each morning run."}):n(s,{title:w,score:d.score,summary:d.summary,notice:y(h,null==_?void 0:_.filtersActive),headerActions:v&&d.reportId?t("button",e({type:"button",className:"ins-chip-button",onClick:v,"aria-label":"Open report and comments"},{children:[n(a,{"aria-hidden":"true"}),d.commentCount||""]})):null,rootCause:p(d.rootCause,b),nextSteps:p(d.nextSteps,b),width:"100%",maxWidth:"none"})}function b(i){var r=i.summary,l=i.onOpen,o="good"===r.tone?"#15803D":"bad"===r.tone?"#E11D48":void 0;return t("div",e({className:"ins-summary","aria-label":"Significant change summary"},{children:[n("div",e({className:"ins-summary__title",style:{color:o}},{children:r.eyebrow||"Significant change"})),n("div",e({className:"ins-summary__text"},{children:r.headline?n("span",e({className:"ins-summary__lead",style:{color:o}},{children:r.headline})):"No summary yet"})),l?n("button",e({type:"button",className:"ins-summary__open",onClick:l,"aria-label":"Open the full report and comments"},{children:n(a,{"aria-hidden":"true"})})):null]}))}function w(l){var o,d,c=l.title,h=void 0===c?"Decision Advantage":c,v=l.report,f=l.context,N=l.loading,_=l.error,w=l.onRetry,x=l.children,C=u(),k=m(),I="generated"===(null==v?void 0:v.status),A=(null==v?void 0:v.reportId)&&C?function(){return C.openReport({reportId:v.reportId,title:h})}:void 0,R=null;return R=_?t(i,{children:["Couldn't load Decision Advantage: ",_.message," ",w?t("button",e({type:"button",className:"ins-link ins-link--inline",onClick:w},{children:[n(r,{"aria-hidden":"true"})," Try again"]})):null]}):N&&!v?"Loading…":null!==(o=function(e,n){var t;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===(t=null==n?void 0:n.period)||void 0===t?void 0:t.start)?"No report was written for ".concat(g(n.period),". Reports are written after each morning run."):"No report yet. Reports are written after each morning run.":null:null}(v,f))&&void 0!==o?o:y(f,null==C?void 0:C.filtersActive),t("div",e({className:"ins-dcol"},{children:[(null===(d=null==v?void 0:v.summary)||void 0===d?void 0:d.headline)?t(i,{children:[n("div",e({className:"ins-dcol__heading"},{children:"Summary"})),n(b,{summary:v.summary,onOpen:A})]}):null,n(s,{className:"ins-dcol__card",title:h,score:I?null==v?void 0:v.score:null,notice:R,headerActions:I&&A?t("button",e({type:"button",className:"ins-chip-button",onClick:A,"aria-label":"Open the full report and comments"},{children:[n(a,{"aria-hidden":"true"}),(null==v?void 0:v.commentCount)||""]})):null,rootCause:I?p(null==v?void 0:v.rootCause,k):[],nextSteps:I?p(null==v?void 0:v.nextSteps,k):[],afterSections:x,width:"100%",maxWidth:"none"})]}))}function x(t){var i=t.children,r=t.minHeight;return n("div",e({className:"ins-fill",style:{minHeight:void 0===r?520:r}},{children:n("div",e({className:"ins-fill__inner"},{children:i}))}))}function C(e){var t=e.entityKey,i=e.title,r=void 0===i?"Decision Advantage":i,a=u(),l=h(a?function(e){return t?d(a.api,t,a.range,e):c(a.api,a.range,e)}:null,[null==a?void 0:a.api.configId,null==a?void 0:a.api.baseUrl,null==a?void 0:a.api.accessToken,null==a?void 0:a.rangeKey,t,null==a?void 0:a.revision]),o=l.data,s=l.error,m=l.loading,p=l.reload;return a?s&&"InsightsDisabled"===s.errorType?null:n(x,{children:n(w,{title:r,report:null==o?void 0:o.report,context:null==o?void 0:o.context,loading:m,error:s,onRetry:p})}):null}export{w as DecisionColumn,x as FillHeight,N as InsightsSkeleton,f as InsightsStateCard,_ as ReportView,b as SummaryBox,C as default,y as reportNotice};
2
- //# sourceMappingURL=DecisionAdvantageCard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DecisionAdvantageCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{__spreadArray as e,__assign as t}from"../../../_virtual/_tslib.js";import{jsxs as a,jsx as n,Fragment as i}from"react/jsx-runtime";import{useState as l,useEffect as r,useMemo as o,useRef as d}from"react";import{ChevronDown as s,Search as c,ChevronRight as u,X as p}from"lucide-react";import{L2Report as m}from"./AgReport.js";import{L1ReportModal as y,EntityDetailVisuals as v}from"./L1Report.js";import h from"./RowDetail.js";import{formatHeaderDate as g}from"./agPrimitives.js";import{useInsights as f}from"./insightsContextCore.js";import{OPEN_INSIGHTS_ENTITY_REPORT as b}from"./insightsUtils.js";function _(e){var i=e.target,o=e.onClose,s=e.onOpenL1,c=e.onOpenL2,m=d(null),y=i.kpiId,f=i.row.report.kpiId===y?i.row.report.reportId:null,b=l(f?null:i.dataDay),_=b[0],N=b[1];r(function(){return N(f?null:i.dataDay)},[f,i.dataDay]),r(function(){var e,t=document.activeElement,a=document.body.style.overflow;document.body.style.overflow="hidden",null===(e=m.current)||void 0===e||e.focus();var n=function(e){return"Escape"===e.key&&o()};return document.addEventListener("keydown",n),function(){var e;document.removeEventListener("keydown",n),document.body.style.overflow=a,null===(e=null==t?void 0:t.focus)||void 0===e||e.call(t)}},[o]);var w=i.row.label||i.row.nodeKey;return n("div",t({className:"ag-modal",role:"presentation",onMouseDown:function(e){return e.target===e.currentTarget&&o()}},{children:a("div",t({className:"ag-modal__dialog",role:"dialog","aria-modal":"true","aria-labelledby":"ag-l2-row-modal-title"},{children:[a("header",t({className:"ag-modal__head"},{children:[a("div",t({className:"ag-modal__detail-title"},{children:[a("div",t({className:"ag-modal__breadcrumb"},{children:[n("button",t({type:"button",onClick:s},{children:"L1"})),n(u,{"aria-hidden":"true"}),a("button",t({type:"button",onClick:c},{children:["Top ",K(i.partName)]})),n(u,{"aria-hidden":"true"}),n("strong",t({id:"ag-l2-row-modal-title"},{children:w}))]})),n("span",t({className:"ag-modal__date"},{children:g(_||i.dataDay)}))]})),n("button",t({ref:m,type:"button",className:"ag-modal__close","aria-label":"Close",onClick:o},{children:n(p,{"aria-hidden":"true"})}))]})),n("div",t({className:"ag-modal__body"},{children:a("div",t({className:"ag-popup"},{children:[a("section",t({className:"ag-popup__section"},{children:[a("div",t({className:"ag-popup__head"},{children:[n("p",t({className:"ag-popup__eyebrow"},{children:"Analysis"})),n("h3",t({className:"ag-popup__title"},{children:"Summary, Drivers & RCA"}))]})),n(h,{embedded:!0,nodeKey:i.row.nodeKey,kpiId:y,dataDay:i.dataDay,reportId:f,onReportDay:N})]})),a("section",t({className:"ag-popup__section"},{children:[a("div",t({className:"ag-popup__head"},{children:[n("p",t({className:"ag-popup__eyebrow"},{children:"Visuals"})),n("h3",t({className:"ag-popup__title"},{children:"Trend & Usage Signals"}))]})),_?n(v,{nodeKey:i.row.nodeKey,label:w,kpiId:y,dataDay:_,tier2Kpis:i.tier2Kpis}):n("p",t({className:"ag-muted"},{children:"Loading report…"}))]}))]}))}))]}))}))}function N(e){var i=e.target,l=e.onClose,o=e.onOpenL1,s=e.onOpenRow,c=d(null),y=f();return r(function(){var e,t=document.activeElement,a=document.body.style.overflow;document.body.style.overflow="hidden",null===(e=c.current)||void 0===e||e.focus();var n=function(e){return"Escape"===e.key&&l()};return document.addEventListener("keydown",n),function(){var e;document.removeEventListener("keydown",n),document.body.style.overflow=a,null===(e=null==t?void 0:t.focus)||void 0===e||e.call(t)}},[l]),y?n("div",t({className:"ag-modal",role:"presentation",onMouseDown:function(e){return e.target===e.currentTarget&&l()}},{children:a("div",t({className:"ag-modal__dialog",role:"dialog","aria-modal":"true","aria-labelledby":"ag-l2-overview-modal-title"},{children:[a("header",t({className:"ag-modal__head"},{children:[a("div",t({className:"ag-modal__detail-title"},{children:[a("div",t({className:"ag-modal__breadcrumb"},{children:[n("button",t({type:"button",onClick:o},{children:"L1"})),n(u,{"aria-hidden":"true"}),a("strong",t({id:"ag-l2-overview-modal-title"},{children:["Top ",K(i.partName)]}))]})),n("span",t({className:"ag-modal__date"},{children:g(i.dataDay)}))]})),n("button",t({ref:c,type:"button",className:"ag-modal__close","aria-label":"Close",onClick:l},{children:n(p,{"aria-hidden":"true"})}))]})),n("div",t({className:"ag-modal__body"},{children:n(m,{tab:i.tab,title:i.title,partName:i.partName,partKpis:i.partKpis,search:"",onOpenRow:function(e,t,a){var n;return s({row:e,partName:i.partName,kpiId:y.headlineKpi||t,dataDay:a,tier2Kpis:null!==(n=i.tab.tier2Kpis)&&void 0!==n?n:y.tierKpis[2],l2:i})}})}))]}))})):null}var K=function(e){var t=e.trim().toLowerCase();return t?/(s|x|ch|sh)$/.test(t)?"".concat(t,"es"):/[^aeiou]y$/.test(t)?"".concat(t.slice(0,-1),"ies"):"".concat(t,"s"):"rows"};function w(d){var u,p,v,h,g,w=d.tabs,k=d.insightsConfig,D=f(),E=l(0),C=E[0],O=E[1],L=l(!1),I=L[0],R=L[1],x=l(""),A=x[0],T=x[1],S=l(""),j=S[0],M=S[1],F=l(null),G=F[0],X=F[1],B=l(null),U=B[0],P=B[1],$=l(null),V=$[0],W=$[1];r(function(){var e=setTimeout(function(){return M(A.trim())},300);return function(){return clearTimeout(e)}},[A]),r(function(){T(""),M("")},[C]);var q=o(function(){var e,t={};return(null!==(e=null==k?void 0:k.hierarchy)&&void 0!==e?e:[]).forEach(function(e){var a;return(null!==(a=e.entities)&&void 0!==a?a:[]).forEach(function(e){var a,n;(null==e?void 0:e.entityKey)&&(t[e.entityKey]={name:null!==(a=e.name)&&void 0!==a?a:"",kpis:null!==(n=e.kpis)&&void 0!==n?n:[]})})}),t},[k]);if(r(function(){if(D){var t=D.entityOrder.length?e([],w,!0).sort(function(e,t){var a=D.entityOrder.indexOf(e.entityKey),n=D.entityOrder.indexOf(t.entityKey);return(a<0?Number.MAX_SAFE_INTEGER:a)-(n<0?Number.MAX_SAFE_INTEGER:n)}):w,a=function(e){var a,n,i,l,r,o,d=e,s=d.detail,c=(null==s?void 0:s.entityKey)?t.findIndex(function(e){return e.entityKey===s.entityKey}):-1;if(s&&!(c<0)){var u=t[c],p=(null===(a=q[u.entityKey])||void 0===a?void 0:a.name)||u.title||D.entityName(u.entityKey)||u.entityKey,m=D.headlineKpi||u.rankBy||(null===(n=u.listKpis)||void 0===n?void 0:n[0])||(null===(i=q[u.entityKey])||void 0===i?void 0:i.kpis[0])||"",y=s.dataDay||D.range.endDate.toISOString().slice(0,10),v={tab:u,title:u.title||p,partName:p,partKpis:null!==(r=null===(l=q[u.entityKey])||void 0===l?void 0:l.kpis)&&void 0!==r?r:[],dataDay:y};d.preventDefault(),W(null),P(null),O(c),X({row:{rank:0,nodeKey:s.nodeKey,label:s.label,parent:null,metrics:{},barPct:null,chip:null,report:{reportId:null,status:"none",kpiId:m},action:null,children:[]},partName:p,kpiId:m,dataDay:y,tier2Kpis:null!==(o=u.tier2Kpis)&&void 0!==o?o:D.tierKpis[2],l2:v})}};return window.addEventListener(b,a),function(){return window.removeEventListener(b,a)}}},[D,w,q]),!D||!w.length)return null;var z=D.entityOrder.length?e([],w,!0).sort(function(e,t){var a=D.entityOrder.indexOf(e.entityKey),n=D.entityOrder.indexOf(t.entityKey);return(a<0?Number.MAX_SAFE_INTEGER:a)-(n<0?Number.MAX_SAFE_INTEGER:n)}):w,H=Math.min(C,z.length-1),J=z[H],Q=function(e){var t;return e.title||D.entityName(e.entityKey)||(null===(t=q[e.entityKey])||void 0===t?void 0:t.name)||e.entityKey},Y=(null===(u=q[J.entityKey])||void 0===u?void 0:u.name)||Q(J),Z=J.rankBy||(null===(p=J.listKpis)||void 0===p?void 0:p[0])||(null===(v=q[J.entityKey])||void 0===v?void 0:v.kpis[0])||"",ee=Z?D.kpiLabel(Z).toLowerCase():"activity";return a("div",t({className:"ag-tabs"},{children:[a("div",t({className:"ag-tabs__head"},{children:[a("div",t({className:"ag-tabs__bar"},{children:[n("div",t({className:"ag-tabs__list",role:"tablist","aria-label":"Insights"},{children:z.map(function(e,a){return n("button",t({id:"ag-tab-".concat(a),type:"button",role:"tab","aria-selected":a===H,"aria-controls":"ag-tabpanel",className:a===H?"is-active":void 0,onClick:function(){X(null),O(a)}},{children:Q(e)}),"".concat(e.entityKey,"-").concat(a))})})),n("button",t({type:"button",className:"ag-icon-button","aria-label":I?"Expand insights":"Collapse insights","aria-expanded":!I,onClick:function(){return R(function(e){return!e})}},{children:n(s,{"aria-hidden":"true",className:I?"is-closed":"is-open"})}))]})),I?null:a(i,{children:[n("p",t({className:"ag-tabs__desc"},{children:Y?"".concat(K(Y).replace(/^\w/,function(e){return e.toUpperCase()})," with the highest ").concat(ee,"."):null})),n("div",t({className:"ag-tabs__tools"},{children:a("label",t({className:"ag-search"},{children:[n(c,{"aria-hidden":"true"}),n("input",{type:"search",value:A,onChange:function(e){return T(e.target.value)},placeholder:"Search ".concat(Y.toLowerCase(),"..."),"aria-label":"Search ".concat(K(Y))})]}))}))]})]})),I?null:a("div",t({className:"ag-tabs__body",role:"tabpanel",id:"ag-tabpanel","aria-labelledby":"ag-tab-".concat(H)},{children:[n(m,{tab:J,title:Q(J),partName:Y,partKpis:null!==(g=null===(h=q[J.entityKey])||void 0===h?void 0:h.kpis)&&void 0!==g?g:[],search:j,onOpenRow:function(e,t,a){var n,i,l;return X({row:e,partName:Y,kpiId:D.headlineKpi||t,dataDay:a,tier2Kpis:null!==(n=J.tier2Kpis)&&void 0!==n?n:D.tierKpis[2],l2:{tab:J,title:Q(J),partName:Y,partKpis:null!==(l=null===(i=q[J.entityKey])||void 0===i?void 0:i.kpis)&&void 0!==l?l:[],dataDay:a}})}},H),G?n(_,{target:G,onClose:function(){return X(null)},onOpenL1:function(){W(G.dataDay),X(null)},onOpenL2:function(){P(G.l2),X(null)}}):null,U?n(N,{target:U,onClose:function(){return P(null)},onOpenL1:function(){W(U.dataDay),P(null)},onOpenRow:function(e){X(e),P(null)}}):null,V?n(y,{day:V,workingDays:Boolean(D.defaultWorkingDays),onClose:function(){return W(null)}}):null]}))]}))}export{w as default};
2
- //# sourceMappingURL=InsightTabs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InsightTabs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{__assign as n}from"../../../_virtual/_tslib.js";import{jsxs as i,jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as o}from"react";import r from"./ReportDrawer.js";import{useInsightsFetch as l,viewerFromToken as u}from"./insightsUtils.js";import{InsightsContext as a}from"./insightsContextCore.js";export{useInsights}from"./insightsContextCore.js";import{fetchHierarchy as s,toIsoDay as d}from"../../api/insightsApi.js";function v(n){var i,e,t=null!==(e=null===(i=null==n?void 0:n.analysis)||void 0===i?void 0:i.movingAverageDays)&&void 0!==e?e:{},o=function(n,i){return Number.isFinite(Number(n))&&Number(n)>0?Number(n):i};return{fast:o(t.fast,3),slow:o(t.slow,7),long:o(t.long,30)}}function c(c){var f=c.baseUrl,p=c.configId,m=c.accessToken,g=c.startDate,h=c.endDate,y=c.workingDaysOnly,k=c.filtersActive,D=c.insights,b=c.headlineKpiId,w=c.defaultWorkingDays,K=void 0!==w&&w,I=c.reportTarget,N=c.onReportTargetChange,j=c.refreshRevision,x=void 0===j?0:j,C=c.children,E=t(0),R=E[0],T=E[1],A=o(function(){return{baseUrl:f,configId:null!=p?p:"",accessToken:m}},[f,p,m]),O=l(p?function(n){return s(A,n)}:null,[A,R,x]),L=d(g),U=d(h),M=o(function(){var n,i,e,t,o,r,l,a,s,d,c,f={},p={};(null!==(n=null==D?void 0:D.hierarchy)&&void 0!==n?n:[]).forEach(function(n,i){var e;return(null!==(e=n.entities)&&void 0!==e?e:[]).forEach(function(e){(null==e?void 0:e.entityKey)&&(f[e.entityKey]=Number(n.level)||i+1)})}),null===(i=O.data)||void 0===i||i.levels.forEach(function(n,i){n.entities.forEach(function(e){f[e.entityKey]=Number(n.level)||i+1,p[e.entityKey]=e.name})});var g={};(null!==(e=null==D?void 0:D.kpis)&&void 0!==e?e:[]).forEach(function(n){(null==n?void 0:n.kpiId)&&(g[n.kpiId]=n)});var h={1:[],2:[]};(null!==(t=null==D?void 0:D.kpis)&&void 0!==t?t:[]).forEach(function(n){!(null==n?void 0:n.kpiId)||1!==n.tier&&2!==n.tier||h[n.tier].push(n.kpiId)});var w=null!==(l=null!==(r=null!==(o=b&&g[b]?b:null)&&void 0!==o?o:h[1][0])&&void 0!==r?r:h[2][0])&&void 0!==l?l:null;return{api:A,headlineKpi:w,tierKpis:h,defaultWorkingDays:K,range:{startDate:new Date("".concat(L,"T00:00:00")),endDate:new Date("".concat(U,"T00:00:00")),workingDaysOnly:y},rangeKey:"".concat(L,":").concat(U,":").concat(y?1:0),filtersActive:Boolean(k),kpis:g,kpiLabel:function(n){var i;return(null===(i=g[n])||void 0===i?void 0:i.label)||n},goodDirection:function(n){var i;return"down"===(null===(i=g[n])||void 0===i?void 0:i.goodDirection)?"down":"up"},levelOf:function(n){return n&&f[n]||1},entityName:function(n){return p[n]||n},entityOrder:null!==(s=null===(a=O.data)||void 0===a?void 0:a.levels.flatMap(function(n){return n.entities.map(function(n){return n.entityKey})}))&&void 0!==s?s:[],windows:v(D),openReport:N,viewer:u(m),minReasonLength:Math.max(1,Number(null===(c=null===(d=null==D?void 0:D.analysis)||void 0===d?void 0:d.outliers)||void 0===c?void 0:c.minReasonLength)||10),revision:R+x,refresh:function(){return T(function(n){return n+1})}}},[A,L,U,y,k,D,b,K,N,R,x,O.data]);return i(a.Provider,n({value:M},{children:[C,I?e(r,{target:I,onClose:function(){return N(null)}}):null]}))}export{c as InsightsProvider};
2
- //# sourceMappingURL=InsightsContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InsightsContext.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{__assign as n,__spreadArray as e,__awaiter as i,__generator as t}from"../../../_virtual/_tslib.js";import{jsxs as r,jsx as l,Fragment as a}from"react/jsx-runtime";import{useState as o,useEffect as d,useMemo as u,useRef as s}from"react";import{Sparkles as c,TrendingUp as v,ChevronDown as g,ChevronRight as p,X as m}from"lucide-react";import{fetchGraphGroups as h,toIsoDay as y,fetchInsightsReports as f,fetchInsightsSummary as b,fetchInsightsSeries as w,generateInsightsReport as D}from"../../api/insightsApi.js";import{useInsights as _}from"./insightsContextCore.js";import{useInsightsFetch as N,formatValue as k,useJob as C}from"./insightsUtils.js";import{toTrendPoints as I,TrendChart as K,ActivityChart as x}from"./AgCharts.js";import{titleCase as L,CorrelationSection as T,reportDayOf as j,RegenerateSummary as O,SummaryCard as A,DecisionCard as G,TopDriversSection as E,MAX_SERIES as R}from"./AgReport.js";import B from"./CommentsThread.js";import P from"./RowDetail.js";import{formatHeaderDate as S,DaysDropdown as U,SectionHeader as F,MetricsSkeleton as M,TrendMetricsSection as V,ChartSkeleton as W,CriticalityChip as q,MovementChip as z,ReportAccordion as H,CollapsibleVisualSection as J,toneOf as Q}from"./agPrimitives.js";var X=["#4F46E5","#64748B","#0F766E","#7C3AED","#475569"],Y="decision-advantage-l1",Z=function(n,e,i){return void 0===i&&(i="root"),null==n?void 0:n.find(function(n){return n.kpiId===e&&n.nodeKey===i})},$=function(n){var e=n.split("-").map(Number),i=e[0],t=e[1],r=e[2];return new Date(i,t-1,r)};function nn(n){var e,i;if(!n)return null;var t=n,r="string"==typeof t.summary?t.summary:(null===(e=t.summary)||void 0===e?void 0:e.headline)||(null===(i=t.summary)||void 0===i?void 0:i.body)||t.executiveSummary||t.executive_summary||t.summaryText||t.summary_text;return(null==r?void 0:r.trim())||null}function en(n){var e,i,t=N(n?function(e){return h(n.api,e)}:null,[null==n?void 0:n.api.configId,null==n?void 0:n.revision]),r=o(null),l=r[0],a=r[1];d(function(){var n,e;null===l&&((null===(n=t.data)||void 0===n?void 0:n.groups.length)?a((null!==(e=t.data.groups.find(function(n){return n.isDefault}))&&void 0!==e?e:t.data.groups[0]).groupKey):t.loading||a(""))},[l,t.data,t.loading]);var u=t.error||null===(e=t.data)||void 0===e?void 0:e.groups;return{groups:u,group:l,setGroup:a,days:null===(i=null==u?void 0:u.find(function(n){return n.groupKey===l}))||void 0===i?void 0:i.days}}function tn(e,i,t,r,l){return void 0===r&&(r=[]),N(e&&i.length&&null!==l?function(a){var o=n(n({},e.range),{workingDaysOnly:t,group:l||void 0}),d=i.slice(0,R);return w(e.api,o,r.length?{kpiIds:d,nodeKeys:r}:{kpiIds:d},a)}:null,[null==e?void 0:e.api.configId,null==e?void 0:e.rangeKey,i.join(","),r.join(","),t,l,null==e?void 0:e.revision])}function rn(r,l,a){var d,s,c,v,g,p,m,h,w=this,D=_(),k=o([]),C=k[0],K=k[1],x=null!==(d=null==D?void 0:D.headlineKpi)&&void 0!==d?d:null,L=u(function(){var n,i=null!==(n=null==D?void 0:D.tierKpis[1])&&void 0!==n?n:[];return x?e([x],i.filter(function(n){return n!==x}),!0):i},[D,x]),T=u(function(){var n;return null!==(n=null==D?void 0:D.tierKpis[2].filter(function(n){return n!==x}))&&void 0!==n?n:[]},[D,x]),O=tn(D,L,l,[],a),A=tn(D,T,l,[],a),G=tn(D,x&&C.length?[x]:[],l,C.map(function(n){return n.nodeKey}),a),E=null!=r?r:D?y(D.range.endDate):null,R=N(D&&E?function(n){return function(n,e,r){return i(this,void 0,void 0,function(){var i,l,a,o;return t(this,function(t){switch(t.label){case 0:return i=$(e),[4,b(n,{startDate:i,endDate:i},r)];case 1:return"generated"===(l=t.sent()).report.status?[2,l]:((a=new Date(i)).setDate(a.getDate()-6),[4,b(n,{startDate:a,endDate:i},r)]);case 2:return[2,"generated"===(o=t.sent()).report.status?o:l]}})})}(D.api,E,n)}:null,[null==D?void 0:D.api.configId,E,null==D?void 0:D.revision]),B=N(D&&x?function(n){return f(D.api,{nodeKey:"root",kpiId:x,startDate:y(D.range.startDate),endDate:y(D.range.endDate)},n)}:null,[null==D?void 0:D.api.configId,null==D?void 0:D.rangeKey,x,null==D?void 0:D.revision]),P=u(function(){var n;return I(Z(null===(n=O.data)||void 0===n?void 0:n.series,x))},[O.data,x]),S=u(function(){return P.filter(function(n){return Boolean(n.reportId||n.criticality||n.movementType&&"stable"!==n.movementType)}).map(function(n){return n.day})},[P]),U=N(D&&S.length?function(n){return i(w,void 0,void 0,function(){var e,r=this;return t(this,function(l){switch(l.label){case 0:return[4,Promise.all(S.map(function(e){return i(r,void 0,void 0,function(){var i,r;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,b(D.api,{startDate:$(e),endDate:$(e)},n)];case 1:return[2,"generated"===(i=t.sent()).report.status&&i.context.period.end.slice(0,10)===e?[e,i.report]:null];case 2:if(r=t.sent(),n.aborted)throw r;return[2,null];case 3:return[2]}})})}))];case 1:return e=l.sent(),[2,Object.fromEntries(e.filter(function(n){return Boolean(n)}))]}})})}:null,[null==D?void 0:D.api.configId,S.join(","),null==D?void 0:D.revision]),F=u(function(){var e,i,t,r,l=null!==(r=null!==(i=null===(e=B.data)||void 0===e?void 0:e.reportsByDay)&&void 0!==i?i:null===(t=B.data)||void 0===t?void 0:t.reports_by_day)&&void 0!==r?r:{},a=new Map(Object.entries(l).map(function(n){var e=n[0],i=n[1];return[e.slice(0,10),i]}));return P.map(function(e){var i,t,r,l=null!==(t=null===(i=U.data)||void 0===i?void 0:i[e.day])&&void 0!==t?t:a.get(e.day),o="object"==typeof(null==l?void 0:l.summary)?l.summary:null;return l?n(n({},e),{headline:nn(l)||e.headline,reportId:l.reportId||e.reportId,criticality:(null==o?void 0:o.criticality)||e.criticality,commentCount:null!==(r=l.commentCount)&&void 0!==r?r:e.commentCount}):e})},[P,B.data,U.data]),M=u(function(){var n,i,t=L.slice(1).map(function(n,e){var i,t,r=Z(null===(i=O.data)||void 0===i?void 0:i.series,n);return r?{key:n,label:null!==(t=null==D?void 0:D.kpiLabel(n))&&void 0!==t?t:n,color:X[e%X.length],data:r.points.map(function(n){return{x:n.x,y:n.y}})}:null}),r=(null!==(i=null===(n=G.data)||void 0===n?void 0:n.series)&&void 0!==i?i:[]).map(function(n,e){var i;return{key:"row_".concat(n.nodeKey),label:null!==(i=n.label)&&void 0!==i?i:n.nodeKey,color:X[(e+2)%X.length],data:n.points.map(function(n){return{x:n.x,y:n.y}})}});return e(e([],t.filter(Boolean),!0),r,!0)},[L,O.data,G.data,D]),V=null===(s=R.data)||void 0===s?void 0:s.report,W="generated"===(null==V?void 0:V.status),q=null!==(m=null!==(g=null!==(v=W?j(null===(c=R.data)||void 0===c?void 0:c.context):null)&&void 0!==v?v:r)&&void 0!==g?g:null===(p=e([],F,!0).reverse().find(function(n){return null!=n.value}))||void 0===p?void 0:p.day)&&void 0!==m?m:null,z=null!==(h=F.find(function(n){return n.day===(null!=r?r:q)}))&&void 0!==h?h:r?void 0:e([],F,!0).reverse().find(function(n){return null!=n.value});return{insights:D,headline:x,tier2:T,trend:O,activity:A,summary:R,report:V,generated:W,reportDay:q,points:F,dayPoint:z,extraLines:M,graphed:C,toggleGraphed:function(n){return K(function(i){return i.some(function(e){return e.nodeKey===n.nodeKey})?i.filter(function(e){return e.nodeKey!==n.nodeKey}):e(e([],i,!0),[n],!1).slice(-5)})}}}function ln(e){var a,d=this,u=e.kpiId,s=e.dataDay,c=_(),v=o(null),g=v[0],p=v[1],m=o(null),h=m[0],y=m[1];if(C(g,null!==(a=null==c?void 0:c.api)&&void 0!==a?a:null,function(){p(null),null==c||c.refresh()}),!c)return null;return r("span",{children:[r("button",n({type:"button",className:"ins-link",disabled:Boolean(g),onClick:function(){return i(d,void 0,void 0,function(){var n,e;return t(this,function(i){switch(i.label){case 0:y(null),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,D(c.api,{nodeKey:"root",kpiId:u,dataDay:s,force:!0})];case 2:return"job"===(n=i.sent()).kind?p(n.jobId):c.refresh(),[3,4];case 3:return e=i.sent(),y(e.message||"The report couldn't be rerun."),[3,4];case 4:return[2]}})})}},{children:[l("span",n({"aria-hidden":"true"},{children:"↻"})),g?"Rerunning…":"Rerun RCA"]})),h?l("span",n({className:"ins-error"},{children:h})):null]})}function an(e){var i=e.l1,t=e.children,a=e.onOpenDriver,o=e.attention,d=void 0!==o&&o,u=i.insights,s=i.headline,c=i.summary,v=i.report,g=i.reportDay,p=i.dayPoint;if(!u)return null;var m=u.goodDirection(null!=s?s:""),h=c.loading&&!c.data;return r("div",n({className:"ag-stack"},{children:[r("div",{children:[l(F,{title:"Summary",action:l(O,{})}),l(A,{report:v,loading:h,error:c.error,movementType:p?p.movementType:void 0,direction:null==p?void 0:p.direction,good:m})]}),l(G,{report:v,error:c.error,loading:h}),g&&!h?l(E,{dataDay:g,title:"Top Drivers",graphed:i.graphed.map(function(n){return n.nodeKey}),onToggleGraph:i.toggleGraphed,onOpenDriver:a,onDecisionSettled:c.reload,initialTab:d?"attention":"drivers"}):null,t]}))}function on(n){var e=n.l1,i=e.insights,t=e.headline,r=e.trend,a=e.dayPoint;if(!i)return null;if(r.loading)return l(M,{});if(!a)return null;var o=t?i.kpiLabel(t):"Value";return l(V,{dailyLabel:"Daily ".concat(o),daily:a.value,fast:a.fast,slow:a.slow,long:a.long,windows:i.windows,good:i.goodDirection(null!=t?t:""),format:k})}function dn(e){var i=e.l1,t=e.highlightDay,r=e.onOpenDay,a=e.onOpenAttention,o=i.insights,d=i.headline,u=i.trend,s=i.points,c=i.extraLines;if(!o)return null;if(u.loading)return l(W,{height:300,label:"Loading trend"});if(u.error)return l("div",n({className:"ag-empty"},{children:"The trend is unavailable right now."}));var v=d?o.kpiLabel(d):"Value";return l(K,{points:s,label:v,good:o.goodDirection(null!=d?d:""),windows:o.windows,extraLines:c,highlightDay:t,syncId:Y,onOpenDay:d?r:void 0,onOpenAttention:a})}function un(e){var i,t,r=e.l1,a=r.insights,o=r.tier2,d=r.activity;return a&&o.length?d.loading?l(W,{height:220,label:"Loading user activity"}):d.error?l("div",n({className:"ag-empty"},{children:"User activity is unavailable right now."})):l(x,{items:(null!==(t=null===(i=d.data)||void 0===i?void 0:i.series)&&void 0!==t?t:[]).filter(function(n){return"root"===n.nodeKey}),labelOf:a.kpiLabel,goodOf:a.goodDirection,syncId:Y},o.join(",")):null}function sn(i){var t,a,d,s,c,v=i.nodeKey,g=i.label,p=i.kpiId,m=i.dataDay,h=i.tier2Kpis,y=_(),f=o(Boolean(null==y?void 0:y.defaultWorkingDays)),b=f[0],w=f[1],D=en(y),N=tn(y,[p],b,[v],D.group),C=null!==(t=null!=h?h:null==y?void 0:y.tierKpis[2])&&void 0!==t?t:[],L=tn(y,C,b,[v],D.group),j=Z(null===(a=N.data)||void 0===a?void 0:a.series,p,v),O=u(function(){return I(j)},[j]),A=null!==(d=O.find(function(n){return n.day===m}))&&void 0!==d?d:e([],O,!0).reverse().find(function(n){return null!=n.value});if(!y)return null;var G=y.goodDirection(p),E=null!=(null==A?void 0:A.fast)&&null!=A.slow&&0!==A.slow?(A.fast-A.slow)/Math.abs(A.slow)*100:null,R=null!=(null==A?void 0:A.slow)&&null!=A.long&&0!==A.long?(A.slow-A.long)/Math.abs(A.long)*100:null,B=Q(E,G),P=Q(R,G);return r("div",n({className:"ag-stack"},{children:[r("section",{children:[l(F,{title:"Averages"}),N.loading?l(M,{}):A?l(V,{fast:A.fast,slow:A.slow,long:A.long,windows:y.windows,good:G,format:k}):l("div",n({className:"ag-empty"},{children:"No averages are available for this selection."})),A?r("div",n({className:"ag-average-details"},{children:[r("span",{children:[l("i",n({className:"good"===B?"ag-text--good":"bad"===B?"ag-text--bad":void 0},{children:null==E?"—":E<0?"↓":"↑"}))," ",y.windows.fast,"d vs ",y.windows.slow,"d avg: ",l("b",{children:null==E?"—":"".concat(E>0?"+":"").concat(E.toFixed(1),"%")})]}),r("span",{children:[l("i",n({className:"good"===P?"ag-text--good":"bad"===P?"ag-text--bad":void 0},{children:null==R?"—":R<0?"↓":"↑"}))," ",y.windows.slow,"d vs ",y.windows.long,"d avg: ",l("b",{children:null==R?"—":"".concat(R>0?"+":"").concat(R.toFixed(1),"%")})]})]})):null]}),l(J,n({title:"Trend",action:l(U,{value:b,onChange:w,groups:D.groups,group:D.group,onGroupChange:D.setGroup})},{children:N.error?l("div",n({className:"ag-empty"},{children:"The trend is unavailable right now."})):N.loading?l(W,{height:300,label:"Loading trend"}):l(K,{points:O,label:y.kpiLabel(p),good:G,windows:y.windows,highlightDay:m})})),C.length?l(J,n({title:"User Activity",meta:g},{children:L.error?l("div",n({className:"ag-empty"},{children:"User activity is unavailable right now."})):L.loading?l(W,{height:220,label:"Loading user activity"}):l(x,{items:(null!==(c=null===(s=L.data)||void 0===s?void 0:s.series)&&void 0!==c?c:[]).filter(function(n){return n.nodeKey===v}),labelOf:y.kpiLabel,goodOf:y.goodDirection})})):null,l(T,{dataDay:m,nodeKey:v,kpiId:p,dayGroup:D.days})]}))}function cn(e){var i=e.eyebrow,t=e.title,a=e.children;return r("section",n({className:"ag-popup__section"},{children:[r("div",n({className:"ag-popup__head"},{children:[l("p",n({className:"ag-popup__eyebrow"},{children:i})),l("h3",n({className:"ag-popup__title"},{children:t}))]})),a]}))}function vn(e){var i,t,u,v,g,h,y=e.day,f=e.workingDays,b=e.initialAttention,w=void 0!==b&&b,D=e.initialDriver,N=void 0===D?null:D,k=e.onClose,C=o(y),I=C[0],K=C[1],x=o(f),L=x[0],j=x[1],O=o(N),A=O[0],G=O[1],E=o(w),R=E[0],F=E[1],M=en(_()),V=rn(I,L,M.group),W=s(null),Q=s(k);Q.current=k,d(function(){K(y),G(N),F(w)},[y,w,N]),d(function(){var n,e=document.activeElement,i=document.body.style.overflow;document.body.style.overflow="hidden",null===(n=W.current)||void 0===n||n.focus();var t=function(n){"Escape"===n.key&&Q.current()};return document.addEventListener("keydown",t),function(){var n;document.removeEventListener("keydown",t),document.body.style.overflow=i,null===(n=null==e?void 0:e.focus)||void 0===n||n.call(e)}},[]);var X=V.insights,Y=V.headline,Z=V.report,$=V.generated,nn=V.summary,tn=V.reportDay,vn=V.dayPoint;if(!X)return null;var gn=$?null==Z?void 0:Z.summary:null,pn=null!==(i=null==gn?void 0:gn.criticality)&&void 0!==i?i:null,mn=null!==(u=null!==(t=null==gn?void 0:gn.movementType)&&void 0!==t?t:null==vn?void 0:vn.movementType)&&void 0!==u?u:null,hn=null!==(g=null!==(v=null==gn?void 0:gn.movementDirection)&&void 0!==v?v:null==vn?void 0:vn.direction)&&void 0!==g?g:null,yn=$&&tn&&tn!==I;return l("div",n({className:"ag-modal",role:"presentation",onMouseDown:function(n){return n.target===n.currentTarget&&k()}},{children:r("div",n({className:"ag-modal__dialog",role:"dialog","aria-modal":"true","aria-labelledby":"ag-l1-modal-title"},{children:[r("header",n({className:"ag-modal__head"},{children:[r("div",A?n({className:"ag-modal__detail-title"},{children:[r("div",n({className:"ag-modal__breadcrumb"},{children:[l("button",n({type:"button",onClick:function(){return G(null)}},{children:"Top drivers"})),l(p,{"aria-hidden":"true"}),l("strong",n({id:"ag-l1-modal-title"},{children:A.label}))]})),l("span",n({className:"ag-modal__date"},{children:S(I)}))]}):n({className:"ag-modal__titles"},{children:[r("h2",n({id:"ag-l1-modal-title",className:"ag-modal__title"},{children:[l(c,{"aria-hidden":"true"}),"L1 Report"]})),l("span",n({className:"ag-modal__date"},{children:S(null!=tn?tn:I)})),!nn.loading||nn.data?r(a,{children:[l(q,{criticality:pn,compact:!1}),l(z,{movementType:mn,direction:hn})]}):null,Y?l(ln,{kpiId:Y,dataDay:null!=tn?tn:I}):null]})),l("button",n({ref:W,type:"button",className:"ag-modal__close","aria-label":"Close",onClick:k},{children:l(m,{"aria-hidden":"true"})}))]})),r("div",n({className:"ag-modal__body"},{children:[yn?r("p",n({className:"ag-modal__notice"},{children:["No report was written for ",S(I),". Showing the latest one before it, from ",S(tn),"."]})):null,r("div",n({className:"ag-popup"},{children:[l(cn,n({eyebrow:"Analysis",title:A?"Summary, Drivers & RCA":"Summary, Categories & RCA"},{children:A&&Y?l(P,{embedded:!0,nodeKey:A.nodeKey,kpiId:Y,dataDay:I,reportId:null===(h=A.report)||void 0===h?void 0:h.reportId,onReportDay:K}):l(an,n({l1:V,onOpenDriver:G,attention:R},{children:$&&(null==Z?void 0:Z.reportId)?l(H,n({title:"Comments".concat(Z.commentCount?" (".concat(Z.commentCount,")"):""),defaultExpanded:!1},{children:l(B,{reportId:Z.reportId})})):null}))})),l(cn,n({eyebrow:"Visuals",title:A?"Trend & Usage Signals":"L1 Trend"},{children:A&&Y?l(sn,{nodeKey:A.nodeKey,label:A.label,kpiId:Y,dataDay:I}):r("div",n({className:"ag-stack"},{children:[l(on,{l1:V}),l(J,n({title:"Trend",action:l(U,{value:L,onChange:j,groups:M.groups,group:M.group,onGroupChange:M.setGroup})},{children:l(dn,{l1:V,highlightDay:I,onOpenDay:function(n){K(n.day),G(null),F(!1)},onOpenAttention:function(n){K(n.day),G(null),F(!0)}})})),V.tier2.length?l(J,n({title:"User Activity",meta:"Platform-wide"},{children:l(un,{l1:V})})):null,l(T,{dataDay:I,dayGroup:M.days})]}))}))]}))]}))]}))}))}function gn(){var e=_(),i=o(Boolean(null==e?void 0:e.defaultWorkingDays)),t=i[0],a=i[1],d=en(e),u=o(!1),s=u[0],p=u[1],m=o(null),h=m[0],y=m[1],f=rn(null,t,d.group);if(!e)return null;var b=f.headline,w=f.reportDay,D=f.summary,N=b?e.kpiLabel(b):"Value";return r("section",n({className:"ag-report","aria-labelledby":"ag-l1-title"},{children:[r("div",n({className:"ag-report__header"},{children:[r("h2",n({id:"ag-l1-title",className:"ag-report__title"},{children:[l(c,{"aria-hidden":"true"}),"L1 Report"]})),D.loading&&!D.data?l("span",{className:"ag-skel__line ag-report__date-skel","aria-hidden":"true"}):w?l("span",n({className:"ag-report__date"},{children:S(w)})):null]})),r("div",n({className:"ag-report__grid"},{children:[l("div",n({className:"ag-report__analysis-scroll",role:"region","aria-label":"L1 report analysis",tabIndex:0},{children:l(an,{l1:f,onOpenDriver:function(n){return w&&y({day:w,attention:!1,driver:n})}})})),r("div",n({className:"ag-stack"},{children:[r("section",n({className:"ag-trend-card"},{children:[r("header",n({className:"ag-trend-card__head"},{children:[l("span",n({className:"ag-trend-card__icon"},{children:l(v,{"aria-hidden":"true"})})),r("div",n({className:"ag-trend-card__titles"},{children:[r("h3",{children:[L(N)," trend"]}),r("p",{children:[N," movement across the selected date range."]})]})),l("button",n({type:"button",className:"ag-icon-button","aria-label":s?"Expand trend":"Collapse trend","aria-expanded":!s,onClick:function(){return p(function(n){return!n})}},{children:l(g,{"aria-hidden":"true",className:s?"is-closed":"is-open"})}))]})),s?null:r("div",n({className:"ag-trend-card__body"},{children:[l("div",n({className:"ag-trend-card__tools"},{children:l(U,{value:t,onChange:a,groups:d.groups,group:d.group,onGroupChange:d.setGroup})})),l(on,{l1:f}),l(dn,{l1:f,highlightDay:w,onOpenDay:function(n){return y({day:n.day,attention:!1})},onOpenAttention:function(n){return y({day:n.day,attention:!0})}}),f.tier2.length?r("div",n({className:"ag-trend-card__activity"},{children:[l(F,{title:"User Activity",meta:"Platform-wide"}),l(un,{l1:f})]})):null]}))]})),l(T,{dataDay:w,dayGroup:d.days})]}))]})),h?l(vn,{day:h.day,workingDays:t,initialAttention:h.attention,initialDriver:h.driver,onClose:function(){return y(null)}}):null]}))}export{sn as EntityDetailVisuals,vn as L1ReportModal,gn as default};
2
- //# sourceMappingURL=L1Report.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"L1Report.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{__spreadArray as n,__assign as e,__awaiter as t,__generator as a}from"../../../_virtual/_tslib.js";import{jsxs as i,jsx as l,Fragment as o}from"react/jsx-runtime";import{useState as r,useMemo as c}from"react";import{Check as s,X as d,AlertTriangle as u,RotateCcw as h,ChevronDown as v}from"lucide-react";import{fetchObservations as g,fetchNeedsAttention as p,decideObservation as f}from"../../api/insightsApi.js";import{useInsights as m}from"./insightsContextCore.js";import{useInsightsFetch as _,useJob as b,formatValue as w}from"./insightsUtils.js";var y={pending:"Not counted",flagged:"Counted · flagged",accepted:"Accepted",rejected:"Rejected"};function N(t){var a,i,l,o,r,c="object"==typeof t.context&&t.context?t.context:{},s=Object.entries(e(e({},null!==(a=t.dimensions)&&void 0!==a?a:{}),c)).map(function(n){var e=n[0],t=n[1];return[e,null==t?"":String(t).trim()]}).filter(function(n){var e,t=n[0],a=n[1];return""!==a&&(e=a,!(/(^|_)id$/.test(t)||/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(e)))}),d=function(n,e){return s.find(function(t){var a=t[0];return!e.includes(a)&&n(a)})},u=d(function(n){return/user.*name|name.*user|reviewer|author/.test(n)},[]),h=d(function(n){return/email|user/.test(n)},u?[u[0]]:[]),v=null!=u?u:h,g=[null==v?void 0:v[0],null==u?void 0:u[0],null==h?void 0:h[0]].filter(Boolean),p=s.filter(function(n){var e=n[0];return!g.includes(e)&&/description|comment|feedback|reason|text|note|title/.test(e)}),f="string"==typeof t.context&&t.context?t.context:null!==(l=null===(i=n([],p,!0).sort(function(n,e){return e[1].length-n[1].length})[0])||void 0===i?void 0:i[1])&&void 0!==l?l:null,m=p.map(function(n){return n[0]}),_=d(function(n){return/_name$/.test(n)&&!m.includes(n)},g),b=s.filter(function(e){var t=e[0];return!n(n(n([],g,!0),m,!0),[null==_?void 0:_[0]],!1).includes(t)});return{who:null!==(o=null==v?void 0:v[1])&&void 0!==o?o:null,where:null!==(r=null==_?void 0:_[1])&&void 0!==r?r:null,text:f,rest:b}}function k(n,e,t){var a,i=m(),l=null!==(a=null!=t?t:null==i?void 0:i.headlineKpi)&&void 0!==a?a:void 0;return _(i?function(t){return p(i.api,{dataDay:n,kpiId:l,nodeKey:e},t)}:null,[null==i?void 0:i.api.configId,n,e,l,null==i?void 0:i.revision])}var j=["pending","flagged","accepted","rejected"],x=function(n){return j.some(function(e){return e===n})};function I(p){var k,j,I,C,S,D,R,A,U,B,L,E,F,K,M,T=this,q=p.dataDay,O=p.nodeKey,P=p.kpiId,W=p.attention,$=p.onDecisionSettled,z=m(),V=null===(k=W.data)||void 0===k?void 0:k.counts,Z=r(null),G=Z[0],H=Z[1],J=null!=G?G:V&&!V.pending&&V.flagged?"flagged":"review",Q=null!==(j=null!=P?P:null==z?void 0:z.headlineKpi)&&void 0!==j?j:void 0,X=_(z&&"decided"===J?function(n){return g(z.api,{dataDay:q,kpiId:Q,nodeKey:O,limit:500},n)}:null,[null==z?void 0:z.api.configId,q,O,Q,J,null==z?void 0:z.revision]),Y=r(new Set),nn=Y[0],en=Y[1],tn=r(null),an=tn[0],ln=tn[1],on=r(""),rn=on[0],cn=on[1],sn=r(!1),dn=sn[0],un=sn[1],hn=r(null),vn=hn[0],gn=hn[1],pn=r(null),fn=pn[0],mn=pn[1],_n=r({}),bn=_n[0],wn=_n[1];b(fn,null!==(I=null==z?void 0:z.api)&&void 0!==I?I:null,function(){mn(null),null==$||$()});var yn=c(function(){var n,e,t,a;if("decided"===J)return(null!==(e=null===(n=X.data)||void 0===n?void 0:n.observations)&&void 0!==e?e:[]).filter(function(n){return"accepted"===n.state||"rejected"===n.state});var i="review"===J?"pending":"flagged";return(null!==(a=null===(t=W.data)||void 0===t?void 0:t.observations)&&void 0!==a?a:[]).filter(function(n){return n.state===i})},[J,W.data,X.data]),Nn=c(function(){var e=new Map;return yn.forEach(function(n){var t=N(n).who,a=null!=t?t:"—";e.has(a)||e.set(a,{who:t,rows:[]}),e.get(a).rows.push(n)}),Array.from(e.entries()).map(function(e){var t=e[0],a=e[1];return{key:t,who:a.who,rows:n([],a.rows,!0).sort(function(n,e){var t,a;return(null!==(t=n.value)&&void 0!==t?t:0)-(null!==(a=e.value)&&void 0!==a?a:0)})}}).sort(function(n,e){return e.rows.length-n.rows.length})},[yn]);if(!z)return null;var kn=(null!==(C=null==V?void 0:V.pending)&&void 0!==C?C:0)+(null!==(S=null==V?void 0:V.flagged)&&void 0!==S?S:0)+(null!==(D=null==V?void 0:V.accepted)&&void 0!==D?D:0)+(null!==(R=null==V?void 0:V.rejected)&&void 0!==R?R:0),jn=null!==(U=null===(A=W.data)||void 0===A?void 0:A.filled)&&void 0!==U?U:[];if(W.data&&!kn&&!jn.length&&!W.error)return null;var xn=z.viewer.isAdmin,In=z.minReasonLength,Cn=Q?z.kpiLabel(Q):"Value",Sn=null!==(L=null===(B=yn.find(function(n){return null!=n.baseline}))||void 0===B?void 0:B.baseline)&&void 0!==L?L:null,Dn=[{key:"review",label:"Needs a decision",count:null!==(E=null==V?void 0:V.pending)&&void 0!==E?E:0},{key:"flagged",label:"Counted, flagged",count:null!==(F=null==V?void 0:V.flagged)&&void 0!==F?F:0},{key:"decided",label:"Decided",count:(null!==(K=null==V?void 0:V.accepted)&&void 0!==K?K:0)+(null!==(M=null==V?void 0:V.rejected)&&void 0!==M?M:0)}],Rn=null!=Sn?" ".concat(w(Sn)):"",An="review"===J?"Ratings far below the usual".concat(Rn," with no reason given. They are left out of the day's ").concat(Cn," until someone accepts them."):"flagged"===J?"Far below the usual".concat(Rn,", but a reason was given, so they count. Listed so someone can take a look."):"Every decision is kept with who made it and why. Undo puts a point back to what the check said.",Un=function(n,e){ln({ids:n,decision:e}),cn(""),gn(null)},Bn=function(i,l){return t(T,void 0,void 0,function(){var t,o,r,c,s,d,u,h;return a(this,function(v){switch(v.label){case 0:if("undo"!==l&&rn.trim().length<In)return[2];un(!0),gn(null),t=0,o=null,r=null,c=function(i){var c,s;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,f(z.api,i,l,"undo"===l?void 0:rn.trim())];case 1:return c=a.sent(),t+=1,W.updateData(function(t){return function(t,a){if(!t)return t;var i=t.observations.find(function(n){return n.observationId===a.observationId}),l=e({},t.counts);return i&&i.state!==a.state&&(x(i.state)&&(l[i.state]=Math.max(0,l[i.state]-1)),x(a.state)&&(l[a.state]+=1)),e(e({},t),{counts:l,observations:i?t.observations.map(function(n){return n.observationId===a.observationId?a:n}):n(n([],t.observations,!0),[a],!1)})}(t,c.observation)}),X.updateData(function(n){return n?e(e({},n),{observations:n.observations.map(function(n){return n.observationId===c.observation.observationId?c.observation:n})}):n}),c.jobId&&(o=c.jobId),[3,3];case 2:return s=a.sent(),r=s.message||"The decision couldn't be saved.",[2,"break"];case 3:return[2]}})},s=0,d=i,v.label=1;case 1:return s<d.length?(u=d[s],[5,c(u)]):[3,4];case 2:if("break"===v.sent())return[3,4];v.label=3;case 3:return s++,[3,1];case 4:return un(!1),t&&(ln(null),en(new Set),cn(""),o?mn(o):null==$||$()),h="accept"===l?"accepted":"reject"===l?"rejected":"put back",r?gn({tone:"error",text:t?"".concat(t," ").concat(h,". Then: ").concat(r):r}):t&&gn({tone:"info",text:o?"".concat(t," ").concat(1===t?"point":"points"," ").concat(h,". Recalculating the day and its summary…"):"".concat(t," ").concat(1===t?"point":"points"," ").concat(h,".")}),[2]}})})},Ln=function(n,t){return i("div",e({className:"ag-na__editor"},{children:[i("label",e({htmlFor:"ag-na-reason-".concat(n[0])},{children:["accept"===t?"Why should ":"Why leave ",n.length>1?"these ".concat(n.length," points"):"this point","accept"===t?" count?":" out?"]})),l("textarea",{id:"ag-na-reason-".concat(n[0]),value:rn,rows:2,autoFocus:!0,onChange:function(n){return cn(n.target.value)},placeholder:"accept"===t?"For example: verified with the user":"For example: test rating, nothing to act on"}),i("div",e({className:"ag-na__editor-foot"},{children:[i("span",e({className:rn.trim().length<In?"ag-na__count":"ag-na__count is-ok"},{children:[rn.trim().length," / ",In," characters"]})),l("button",e({type:"button",className:"ag-na__btn",onClick:function(){return ln(null)},disabled:dn},{children:"Cancel"})),l("button",e({type:"button",className:"ag-na__btn ag-na__btn--".concat(t),disabled:dn||rn.trim().length<In,onClick:function(){return Bn(n,t)}},{children:dn?"Saving…":"".concat("accept"===t?"Accept":"Reject").concat(n.length>1?" ".concat(n.length):"")}))]}))]}))},En="decided"===J?X.loading&&!X.data:W.loading&&!W.data,Fn="decided"===J?X.error:W.error,Kn=xn&&"decided"!==J,Mn=Array.from(nn).filter(function(n){return yn.some(function(e){return e.observationId===n})});return i("section",e({className:"ag-na","aria-label":"Data points needing review"},{children:[i("header",e({className:"ag-na__head"},{children:[l("h4",{children:"Data points needing review"}),fn?l("span",e({className:"ag-na__working"},{children:"Recalculating…"})):null]})),l("div",e({className:"ag-na__tabs",role:"tablist","aria-label":"Data point states"},{children:Dn.map(function(n){return i("button",e({type:"button",role:"tab","aria-selected":J===n.key,className:J===n.key?"is-active":void 0,onClick:function(){return e=n.key,H(e),en(new Set),ln(null),void gn(null);var e}},{children:[n.label,l("span",e({className:"ag-na__pill".concat("review"===n.key&&n.count?" is-alert":"")},{children:n.count}))]}),n.key)})})),l("p",e({className:"ag-na__explain"},{children:An})),vn?l("p",e({className:"ag-na__msg ag-na__msg--".concat(vn.tone),role:"error"===vn.tone?"alert":"status"},{children:vn.text})):null,Kn&&Mn.length?i("div",e({className:"ag-na__bulk"},{children:[i("div",e({className:"ag-na__bulk-bar"},{children:[i("span",{children:[Mn.length," selected"]}),i("button",e({type:"button",className:"ag-na__btn ag-na__btn--accept",onClick:function(){return Un(Mn,"accept")}},{children:[l(s,{"aria-hidden":"true"}),"Accept"]})),i("button",e({type:"button",className:"ag-na__btn ag-na__btn--reject",onClick:function(){return Un(Mn,"reject")}},{children:[l(d,{"aria-hidden":"true"}),"Reject"]})),l("button",e({type:"button",className:"ag-na__link",onClick:function(){return en(new Set)}},{children:"Clear"}))]})),an&&an.ids.length>1?Ln(an.ids,an.decision):null]})):null,En?i("div",e({className:"ag-na__skeleton","aria-busy":"true","aria-label":"Loading data points"},{children:[l("span",{}),l("span",{}),l("span",{})]})):Fn?l("p",e({className:"ag-na__msg ag-na__msg--error"},{children:Fn.message})):yn.length?l("div",e({className:"ag-na__groups"},{children:Nn.map(function(n){var t,a,r,c,g,p=null!==(t=bn[n.key])&&void 0!==t&&t,f=p?n.rows:n.rows.slice(0,3),m=n.rows.map(function(n){return n.value}).filter(function(n){return null!=n}),_=m.length?m.reduce(function(n,e){return n+e},0)/m.length:null,b=Boolean(n.who)&&n.rows.length>=3&&n.rows.length/yn.length>=.25,k=n.rows.map(function(n){return n.observationId}),j=k.every(function(n){return nn.has(n)});return i("div",e({className:"ag-na__group"},{children:[i("div",e({className:"ag-na__group-head"},{children:[Kn?l("input",{type:"checkbox",checked:j,"aria-label":"Select all ".concat(n.rows.length," from ").concat(null!==(a=n.who)&&void 0!==a?a:"this group"),onChange:function(){return en(function(n){var e=new Set(n);return k.forEach(function(n){return j?e.delete(n):e.add(n)}),e})}}):null,l("span",e({className:"ag-na__avatar","aria-hidden":"true"},{children:(null!==(r=n.who)&&void 0!==r?r:"?").replace(/[^A-Za-z]/g,"").slice(0,2).toUpperCase()||"?"})),i("span",e({className:"ag-na__who",title:null!==(c=n.who)&&void 0!==c?c:void 0},{children:[l("strong",{children:null!==(g=n.who)&&void 0!==g?g:"Unknown source"}),i("small",{children:[n.rows.length," ",1===n.rows.length?"rating":"ratings",null!=_?" · average ".concat(w(Math.round(100*_)/100)):""]})]})),b?i("span",e({className:"ag-na__warn",title:"One person gave a large share of this day's low ratings"},{children:[l(u,{"aria-hidden":"true"}),"Many from one person"]})):null]})),l("ul",e({className:"ag-na__rows"},{children:f.map(function(n){var t,a,r,c,u=N(n),v=1===(null==an?void 0:an.ids.length)&&an.ids[0]===n.observationId,g="accepted"===n.state||"rejected"===n.state;return i("li",e({className:"ag-na__row is-".concat(n.state)},{children:[i("div",e({className:"ag-na__row-main"},{children:[Kn?l("input",{type:"checkbox",checked:nn.has(n.observationId),onChange:function(){return e=n.observationId,en(function(n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t});var e},"aria-label":"Select ".concat(n.kpiLabel||Cn," ").concat(w(n.value)).concat(u.who?" from ".concat(u.who):"")}):null,i("span",e({className:"ag-na__score"},{children:[l("strong",{children:w(n.value)}),null!=n.deviationPct?i("small",{children:[Math.round(n.deviationPct),"%"]}):null]})),i("span",e({className:"ag-na__body"},{children:[i("span",e({className:"ag-na__line"},{children:[l("span",e({className:"ag-na__where"},{children:null!==(r=null!==(a=null!==(t=u.where)&&void 0!==t?t:n.label)&&void 0!==a?a:n.kpiLabel)&&void 0!==r?r:Cn})),l("span",e({className:"ag-na__state ag-na__state--".concat(n.state)},{children:null!==(c=y[n.state])&&void 0!==c?c:n.state}))]})),u.text?l("q",e({className:"ag-na__quote"},{children:u.text})):l("span",e({className:"ag-na__noreason"},{children:"No reason given"})),u.rest.length?l("span",e({className:"ag-na__meta"},{children:u.rest.map(function(n){var e,t=n[0],a=n[1];return i("span",{children:[(e=t,e.replace(/_/g," ").replace(/^./,function(n){return n.toUpperCase()})),": ",a]},t)})})):null,g?i("span",e({className:"ag-na__decided"},{children:[y[n.state],n.decidedByName||n.decidedByEmail?" by ".concat(n.decidedByName||n.decidedByEmail):"",n.decisionReason?": “".concat(n.decisionReason,"”"):""]})):null]})),xn?l("span",e({className:"ag-na__actions"},{children:g?l("button",e({type:"button",className:"ag-na__icon","aria-label":"Undo this decision",title:"Undo",disabled:dn,onClick:function(){return Bn([n.observationId],"undo")}},{children:l(h,{"aria-hidden":"true"})})):i(o,{children:[l("button",e({type:"button",className:"ag-na__icon ag-na__icon--accept","aria-label":"Accept: count this point",title:"Accept: count it","aria-pressed":v&&"accept"===(null==an?void 0:an.decision),onClick:function(){return Un([n.observationId],"accept")}},{children:l(s,{"aria-hidden":"true"})})),l("button",e({type:"button",className:"ag-na__icon ag-na__icon--reject","aria-label":"Reject: leave this point out",title:"Reject: leave it out","aria-pressed":v&&"reject"===(null==an?void 0:an.decision),onClick:function(){return Un([n.observationId],"reject")}},{children:l(d,{"aria-hidden":"true"})}))]})})):null]})),v&&an?Ln([n.observationId],an.decision):null]}),n.observationId)})})),n.rows.length>3?i("button",e({type:"button",className:"ag-na__more","aria-expanded":p,onClick:function(){return wn(function(t){var a;return e(e({},t),((a={})[n.key]=!p,a))})}},{children:[p?"Show less":"Show ".concat(n.rows.length-3," more"),l(v,{"aria-hidden":"true",className:p?"is-open":void 0})]})):null]}),n.key)})})):l("p",e({className:"ag-na__empty"},{children:"review"===J?"Nothing waiting for a decision on this day.":"flagged"===J?"No flagged points on this day.":"No decisions yet on this day."})),jn.length?i("div",e({className:"ag-na__filled"},{children:[l("strong",{children:"Shown with a stand-in"}),jn.map(function(n,e){return l("p",{children:n.message||"".concat(n.dataDay,": no data, a stand-in value is shown in gray.")},"".concat(n.dataDay,":").concat(e))})]})):null]}))}export{I as default,k as useNeedsAttention};
2
- //# sourceMappingURL=NeedsAttention.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NeedsAttention.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{__spreadArray as e,__assign as r,__awaiter as n,__generator as t}from"../../../_virtual/_tslib.js";import{jsx as i,jsxs as o,Fragment as a}from"react/jsx-runtime";import{useState as l,useRef as d,useEffect as s}from"react";import{PenLine as u,RefreshCw as c,ChevronUp as p,ChevronDown as h,X as m}from"lucide-react";import v from"react-markdown";import f from"remark-gfm";import{fetchInsightsReport as g,generateInsightsReport as b}from"../../api/insightsApi.js";import{InsightsSkeleton as k,InsightsStateCard as w,ReportView as y}from"./DecisionAdvantageCard.js";import I from"./CommentsThread.js";import{useInsights as _}from"./insightsContextCore.js";import{useInsightsFetch as N,useJob as C,shortDay as D,formatReportDate as j}from"./insightsUtils.js";function A(A){var T,x,R,L,K,B,E=this,U=A.target,W=A.onClose,F=_(),M=l(null!==(T=U.reportId)&&void 0!==T?T:null),O=M[0],P=M[1],Q=l(null),q=Q[0],z=Q[1],G=l(!1),H=G[0],J=G[1],S=l(null),V=S[0],X=S[1],Y=l(!1),Z=Y[0],$=Y[1],ee=d(null);s(function(){var e;P(null!==(e=U.reportId)&&void 0!==e?e:null),z(null),J(!1),X(null),$(!1)},[U]),s(function(){var e;null===(e=ee.current)||void 0===e||e.focus();var r=function(e){return"Escape"===e.key&&W()};return window.addEventListener("keydown",r),function(){return window.removeEventListener("keydown",r)}},[W]);var re=N(F&&O?function(e){return g(F.api,O,e)}:null,[O,null==F?void 0:F.api.configId,null==F?void 0:F.revision]),ne=C(q,null!==(x=null==F?void 0:F.api)&&void 0!==x?x:null,function(e){z(null),e&&P(e)});if(s(function(){ne.error&&X(ne.error)},[ne.error]),!F)return null;var te,ie=Boolean(U.nodeKey&&U.kpiId&&U.dataDay),oe=function(e){return void 0===e&&(e=!1),n(E,void 0,void 0,function(){var n,i;return t(this,function(t){switch(t.label){case 0:if(!ie)return[2];X(null),J(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,b(F.api,r({nodeKey:U.nodeKey,kpiId:U.kpiId,dataDay:U.dataDay},e?{force:!0}:{}))];case 2:return"report"===(n=t.sent()).kind?(z(null),P(n.report.reportId)):z(n.jobId),[3,5];case 3:return i=t.sent(),z(null),X(429===(null==(o=i)?void 0:o.status)?o.message:"RateLimited"===(null==o?void 0:o.errorType)?"This dashboard has asked for 20 reports this hour. Try again later.":"QueueUnavailable"===(null==o?void 0:o.errorType)?"Reports can't be written right now. Try again in a few minutes.":(null==o?void 0:o.message)||"The report couldn't be written."),[3,5];case 4:return J(!1),[7];case 5:return[2]}var o})})},ae=U.title||[U.kpiId?F.kpiLabel(U.kpiId):"",U.dataDay?D(U.dataDay):""].filter(Boolean).join(" · ")||"Decision Advantage",le=re.data,de=F.levelOf(null===(R=null==le?void 0:le.node)||void 0===R?void 0:R.entityKey),se=le?e(e(["L".concat(de," report")],de>1&&(null===(L=le.node)||void 0===L?void 0:L.label)?[le.node.label]:[],!0),U.kpiId?[F.kpiLabel(U.kpiId)]:[],!0).join(" · "):ae,ue=H||Boolean(q&&"failed"!==ne.status);return te=O?re.error?i(w,{title:"Decision Advantage",heading:"Couldn't load the report",text:re.error.message,action:o("button",r({type:"button",className:"ins-link",onClick:re.reload},{children:[i(c,{"aria-hidden":"true"})," Try again"]}))}):le?o(a,{children:[i(y,{report:le.report,title:"Decision Advantage",onRetry:re.reload}),ie?o("button",r({type:"button",className:"ins-link",disabled:ue,onClick:function(){return oe(!0)}},{children:[i(c,{"aria-hidden":"true"})," ",ue?"Rerunning…":"Rerun RCA"]})):null,le.markdown?o("section",r({className:"ins-drawer__text"},{children:[o("button",r({type:"button",className:"ins-drawer__text-toggle","aria-expanded":Z,onClick:function(){return $(function(e){return!e})}},{children:["Full report ",i(Z?p:h,{"aria-hidden":"true"})]})),Z?i("div",r({className:"ins-drawer__markdown"},{children:i(v,r({remarkPlugins:[f]},{children:le.markdown}))})):null]})):null,le.report.reportId&&"generated"===le.report.status?i(I,{reportId:le.report.reportId}):null]}):i(k,{title:"Decision Advantage"}):ue?i(k,{title:"Writing the report…"}):i(w,{title:"Decision Advantage",icon:i(u,{"aria-hidden":"true"}),heading:"No report for this change yet",text:ie?"Reports are written automatically for the biggest changes. Ask the AI to write one for this change now; it takes a minute or two.":"There's no report for this change.",action:ie?o("button",r({type:"button",className:"ins-button",onClick:function(){return oe()}},{children:[i(u,{"aria-hidden":"true"})," Write report"]})):null}),i("div",r({className:"ins-drawer",role:"presentation",onMouseDown:function(e){return e.target===e.currentTarget&&W()}},{children:o("aside",r({className:"ins-drawer__panel",role:"dialog","aria-modal":"true","aria-label":se},{children:[o("header",r({className:"ins-drawer__header"},{children:[o("div",r({className:"ins-drawer__titles"},{children:[i("h2",{children:se}),(null==le?void 0:le.period)?o("p",{children:[j(le.period),(null===(B=null===(K=le.node)||void 0===K?void 0:K.path)||void 0===B?void 0:B.length)?" · ".concat(le.node.path.join(" › ")):""]}):null]})),i("button",r({ref:ee,type:"button",className:"ins-icon-button",onClick:W,"aria-label":"Close report"},{children:i(m,{"aria-hidden":"true"})}))]})),o("div",r({className:"ins-drawer__body"},{children:[V?i("p",r({className:"ins-error"},{children:V})):null,te]}))]}))}))}export{A as default};
2
- //# sourceMappingURL=ReportDrawer.js.map