@mx-cartographer/experiences 8.0.0-alpha.bb4 → 8.0.0-alpha.mega1

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 (154) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/{Account-B4CDD-zq.mjs → Account-CvR2-dSR.mjs} +1 -1
  3. package/dist/AccountDetailsContent-CitErkuS.mjs +686 -0
  4. package/dist/{AccountDetailsHeader-DRjFuyJT.mjs → AccountDetailsHeader-BkG3MNYo.mjs} +19 -19
  5. package/dist/{AccountFields-Cl4KHoSj.mjs → AccountFields-zCMqet85.mjs} +10 -12
  6. package/dist/AccountListItem-DHrz8Mml.mjs +90 -0
  7. package/dist/{AccountStore-HbVblv86.mjs → AccountStore-LgfBcYMe.mjs} +101 -75
  8. package/dist/Accounts-Bzy1_REQ.mjs +9 -0
  9. package/dist/{BudgetUtil-Jv8h9H9l.mjs → BudgetUtil-BmZXkL0C.mjs} +32 -32
  10. package/dist/{CashflowStore-CA190BPF.mjs → CashflowStore-D9Dpuz7X.mjs} +25 -18
  11. package/dist/{Category-Ccoew_sA.mjs → Category-CevNQ03n.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-Dl006GKy.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +27 -27
  13. package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
  14. package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
  15. package/dist/{ConnectDrawer-DVp54lUH.mjs → ConnectDrawer-BkvlItWx.mjs} +55 -56
  16. package/dist/{ConnectionsDrawer-Dsc04-4Z.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
  17. package/dist/CurrencyInput-itK0R3wV.mjs +85 -0
  18. package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CBdcsyuk.mjs} +1 -1
  19. package/dist/{DebtsStore-pL63fmdT.mjs → DebtsStore-Bq-aPy-5.mjs} +3 -3
  20. package/dist/{Dialog-CDV0kKxj.mjs → Dialog-BPTr3qHE.mjs} +24 -24
  21. package/dist/Drawer-By9V-B5L.mjs +178 -0
  22. package/dist/{ExportCsvAction-QhQK4_FU.mjs → ExportCsvAction-Cglo8Mca.mjs} +4 -4
  23. package/dist/{FinstrongStore-BGf36b0z.mjs → FinstrongStore-BIrX0Xg2.mjs} +56 -56
  24. package/dist/{GoalStore-C1-w3Y1E.mjs → GoalStore-1P19goZ7.mjs} +111 -151
  25. package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
  26. package/dist/{Help-c-zHlDbv.mjs → Help-DhcC-C05.mjs} +8 -8
  27. package/dist/{Help-DBfsTkAi.mjs → Help-Ea3BlXQp.mjs} +146 -125
  28. package/dist/{IconBacking-DgT8DCeh.mjs → IconBacking-B9oC6uL2.mjs} +11 -11
  29. package/dist/LineChart-KpPw1phO.mjs +580 -0
  30. package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-BxTkF6Tz.mjs} +2 -2
  31. package/dist/Loader-DUaFpDGv.mjs +24 -0
  32. package/dist/{ManageIncome-8EsStyIQ.mjs → ManageIncome-CaoQl609.mjs} +142 -142
  33. package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
  34. package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
  35. package/dist/{NetWorthStore-Bti6u-d9.mjs → NetWorthStore-rC0q7P7t.mjs} +4 -4
  36. package/dist/NotificationSettings-uzM8tCoH.mjs +674 -0
  37. package/dist/{NotificationStore-Ck2KdNmT.mjs → NotificationStore-CDX_kqHa.mjs} +14 -22
  38. package/dist/{OriginalBalanceAction-2Y_3U_mg.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +9 -9
  39. package/dist/{RecurringSettings-DAncu--R.mjs → RecurringSettings-B4ybrS0B.mjs} +17 -17
  40. package/dist/{RecurringTransactions-CxcSL1dY.mjs → RecurringTransactions-BqijW_8S.mjs} +79 -79
  41. package/dist/{RecurringTransactionsStore-CNFxyGB6.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +81 -91
  42. package/dist/{ResponsiveButton-Cn6-R7ue.mjs → ResponsiveButton-DZFp78fJ.mjs} +10 -10
  43. package/dist/SearchBox-B2_zLv8-.mjs +42 -0
  44. package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-krIRNwHK.mjs} +1 -1
  45. package/dist/{SingleSegmentDonut-7Uy6VEld.mjs → SingleSegmentDonut-BgbLgwHi.mjs} +6 -6
  46. package/dist/SpendingData-DQ1b9uqq.mjs +53 -0
  47. package/dist/{SpendingLegend-6FqtMcBV.mjs → SpendingLegend-CDO060GT.mjs} +65 -65
  48. package/dist/{StatusBar-CPfSXe80.mjs → StatusBar-BK_uYHAB.mjs} +6 -6
  49. package/dist/{TabContentContainer-CnMXkVqr.mjs → TabContentContainer-j01JYR_7.mjs} +8 -8
  50. package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
  51. package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
  52. package/dist/TrendsStore-yO7qYv97.mjs +186 -0
  53. package/dist/{User-BklmOUSd.mjs → User-Cnlegl1N.mjs} +107 -107
  54. package/dist/{ViewMoreMicroCard-DAkyNRlD.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +211 -205
  55. package/dist/{WidgetContainer-CDh9fjpR.mjs → WidgetContainer-CoFDmQRE.mjs} +36 -36
  56. package/dist/accounts/index.es.js +200 -197
  57. package/dist/accounts/stores/AccountStore.d.ts +22 -25
  58. package/dist/accounts/utils/Accounts.d.ts +1 -2
  59. package/dist/analytics/index.es.js +27 -27
  60. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  61. package/dist/budgets/index.es.js +703 -669
  62. package/dist/budgets/store/BudgetsStore.d.ts +0 -1
  63. package/dist/cashflow/index.es.js +420 -404
  64. package/dist/categories/index.es.js +2 -2
  65. package/dist/categories/stores/CategoryStore.d.ts +3 -6
  66. package/dist/categories/util/CategoryUtil.d.ts +2 -3
  67. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  68. package/dist/common/components/Loader.d.ts +2 -1
  69. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
  70. package/dist/common/components/barchart/Bar.d.ts +25 -0
  71. package/dist/common/components/barchart/BarChart.d.ts +34 -0
  72. package/dist/common/components/barchart/BarColumn.d.ts +37 -0
  73. package/dist/common/components/barchart/Legend.d.ts +8 -0
  74. package/dist/common/components/barchart/Util.d.ts +42 -0
  75. package/dist/common/components/barchart/index.d.ts +1 -0
  76. package/dist/common/components/charts/linechart/CustomMark.d.ts +1 -1
  77. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  78. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  79. package/dist/common/components/index.d.ts +1 -0
  80. package/dist/common/hooks/index.d.ts +2 -0
  81. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  82. package/dist/common/hooks/usePrevious.d.ts +2 -0
  83. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  84. package/dist/common/index.es.js +712 -436
  85. package/dist/common/stores/AppDataStore.d.ts +1 -3
  86. package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
  87. package/dist/common/stores/GlobalStore.d.ts +3 -3
  88. package/dist/common/stores/GlobalUiStore.d.ts +2 -3
  89. package/dist/common/stores/UserStore.d.ts +2 -3
  90. package/dist/common/types/Account.d.ts +6 -9
  91. package/dist/common/types/localization/TransactionsCopy.d.ts +1 -0
  92. package/dist/common/utils/Theme.d.ts +3 -1
  93. package/dist/dashboard/index.es.js +93 -91
  94. package/dist/debts/components/DebtsChart.d.ts +2 -1
  95. package/dist/debts/index.es.js +529 -527
  96. package/dist/{exportTransactionsToCSV-BgV_wTLT.mjs → exportTransactionsToCSV-DuAaI5XA.mjs} +3 -3
  97. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
  98. package/dist/finstrong/index.es.js +876 -867
  99. package/dist/goals/index.es.js +526 -525
  100. package/dist/goals/stores/GoalStore.d.ts +4 -17
  101. package/dist/help/components/content/BottomImageContent.d.ts +1 -1
  102. package/dist/help/components/content/LeftImageContent.d.ts +1 -1
  103. package/dist/help/components/content/RightImageContent.d.ts +1 -1
  104. package/dist/help/components/content/TopImageContent.d.ts +1 -1
  105. package/dist/help/index.es.js +13 -9
  106. package/dist/{hooks-C41HAxM5.mjs → hooks-ZMp65DFz.mjs} +11 -11
  107. package/dist/investments/index.es.js +534 -531
  108. package/dist/investments/stores/HoldingStore.d.ts +0 -1
  109. package/dist/merchants/index.es.js +8 -8
  110. package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
  111. package/dist/microinsights/index.d.ts +1 -0
  112. package/dist/microinsights/index.es.js +101 -14
  113. package/dist/networth/components/NetWorthChange.d.ts +1 -3
  114. package/dist/networth/index.es.js +284 -285
  115. package/dist/notifications/index.es.js +95 -94
  116. package/dist/notifications/stores/NotificationStore.d.ts +1 -3
  117. package/dist/recurringtransactions/index.es.js +582 -562
  118. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -4
  119. package/dist/settings/index.es.js +340 -337
  120. package/dist/spending/index.es.js +281 -268
  121. package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +7 -0
  122. package/dist/transactions/index.es.js +253 -255
  123. package/dist/transactions/stores/TransactionStore.d.ts +77 -21
  124. package/dist/transactions/stores/UiStore.d.ts +2 -0
  125. package/dist/trends/components/TrendsTable.d.ts +0 -2
  126. package/dist/trends/index.es.js +838 -793
  127. package/dist/trends/utils/TrendsData.d.ts +1 -0
  128. package/dist/{useAccountDisplayName-CcIp09Xc.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
  129. package/dist/{useCombineEvents-kNzLTWCp.mjs → useCombineEvents-CRwX-qWE.mjs} +2 -2
  130. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
  131. package/dist/{useScreenSize-B5afALev.mjs → useScreenSize-B6JyS_Lj.mjs} +1 -1
  132. package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
  133. package/package.json +57 -52
  134. package/dist/AccountDetailsContent-adZTkM52.mjs +0 -683
  135. package/dist/AccountListItem-wgmlex-_.mjs +0 -90
  136. package/dist/Accounts-CRUehOiy.mjs +0 -27
  137. package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
  138. package/dist/CategoryUtil-DfVKKkRf.mjs +0 -80
  139. package/dist/CurrencyInput-D1cjbdCI.mjs +0 -85
  140. package/dist/Drawer-BF40nbsH.mjs +0 -163
  141. package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
  142. package/dist/LineChart-C1PxNf7P.mjs +0 -581
  143. package/dist/Loader-Ckqi9Rx6.mjs +0 -21
  144. package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +0 -45
  145. package/dist/MiniWidgetContainer-CKzf_Ira.mjs +0 -56
  146. package/dist/NotificationSettings-B74rQVYC.mjs +0 -672
  147. package/dist/SearchBox-B7km148n.mjs +0 -39
  148. package/dist/SkeletonLoader-BaNboJjD.mjs +0 -38
  149. package/dist/SpendingData-DPQ96k3x.mjs +0 -55
  150. package/dist/TransactionDetails-Bn0qY5Hw.mjs +0 -1336
  151. package/dist/TransactionStore-DbwAutwC.mjs +0 -671
  152. package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
  153. package/dist/common/components/SkeletonLoader.d.ts +0 -7
  154. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +0 -3
@@ -1,160 +1,153 @@
1
- import { jsxs as y, jsx as e, Fragment as lt } from "react/jsx-runtime";
2
- import c, { useRef as dt, useState as ut, useEffect as ht } from "react";
1
+ import { jsxs as y, jsx as e, Fragment as dt } from "react/jsx-runtime";
2
+ import u, { useRef as ut, useState as ht, useEffect as gt } from "react";
3
3
  import { observer as R } from "mobx-react-lite";
4
- import { CategoryIcon as we, Text as z, Icon as Se, P as pe, H3 as Pe } from "@mxenabled/mxui";
5
- import W from "@mui/material/Box";
4
+ import { CategoryIcon as Se, Text as P, Icon as _e, P as ge, H3 as Ye, ChevronRightIcon as mt } from "@mxenabled/mxui";
5
+ import k from "@mui/material/Box";
6
6
  import S from "@mui/material/Stack";
7
- import xe from "@mui/material/Button";
8
- import { addSeconds as Fe } from "date-fns/addSeconds";
9
- import { differenceInCalendarMonths as Ae } from "date-fns/differenceInCalendarMonths";
10
- import { useTheme as ue } from "@mui/material/styles";
11
- import { LineChart as gt } from "@mui/x-charts";
12
- import { u as J } from "../useScreenSize-B5afALev.mjs";
13
- import { u as mt } from "../useDimensions-27p2evRx.mjs";
14
- import pt from "@mui/material/Card";
15
- import ft from "@mui/material/CardContent";
16
- import Re from "@mui/material/Divider";
17
- import We from "@mui/material/Grid";
18
- import { u as O, m as Y, g as P, b as ye, h as De, d as Le, w as Ce, q as ze, f as He, n as yt, a as Ct } from "../hooks-C41HAxM5.mjs";
19
- import { b as $e } from "../Localization-2MODESHW.mjs";
20
- import { C as ve } from "../CurrencyText-Dr0EZ7bp.mjs";
21
- import { useTheme as _t, Card as Tt, CardContent as bt, Box as St, Stack as xt } from "@mui/material";
22
- import { f as Q, a as F } from "../Dialog-CDV0kKxj.mjs";
23
- import { a as Me, c as vt } from "../Category-Ccoew_sA.mjs";
24
- import { f as oe, a as wt } from "../NumberFormatting-DjTD0t3W.mjs";
25
- import { a as Dt, g as Lt, L as Ke } from "../TrendsStore-_mRaFUdf.mjs";
26
- import { T as Pn } from "../TrendsStore-_mRaFUdf.mjs";
27
- import { i as Et, c as It, d as Mt, e as At, f as Rt, h as kt, g as je, b as Ye, j as Oe } from "../SpendingData-DPQ96k3x.mjs";
28
- import Ht from "@mui/material/ToggleButton";
29
- import Nt from "@mui/material/ToggleButtonGroup";
30
- import { DataGridPro as Wt } from "@mui/x-data-grid-pro";
31
- import { H as Ge } from "../HeaderCell-P8w6CmfO.mjs";
32
- import { T as V, b as Ot } from "../ViewMoreMicroCard-DAkyNRlD.mjs";
33
- import { A as w, W as Ue } from "../WidgetContainer-CDh9fjpR.mjs";
34
- import { a as Xe, T as Ze } from "../TransactionDetails-Bn0qY5Hw.mjs";
35
- import { D as ke } from "../Drawer-BF40nbsH.mjs";
36
- import { L as fe } from "../Loader-Ckqi9Rx6.mjs";
37
- import { L as Ne } from "../LineChart-C1PxNf7P.mjs";
38
- import { M as Gt } from "../MiniWidgetContainer-CKzf_Ira.mjs";
39
- import { subMonths as Bt } from "date-fns";
40
- import { TrendingUp as Vt, TrendingDown as Pt, MultilineChart as Ft, ExpandLess as zt, ExpandMore as $t, ChevronRight as Kt } from "@mxenabled/mx-icons";
41
- import { M as jt } from "../MicroWidgetContainer-BGpNl5ZS.mjs";
42
- import Yt from "@mui/material/Collapse";
43
- import Ut from "@mui/material/List";
44
- import Xt from "@mui/material/ListItem";
45
- import Zt from "@mui/material/ListItemButton";
46
- import qt from "@mui/material/ListItemIcon";
47
- import Qt from "@mui/material/ListItemText";
48
- import Jt from "@mui/material/Paper";
49
- import { b as eo } from "../CategoryUtil-DfVKKkRf.mjs";
50
- import { E as to } from "../ExportCsvAction-QhQK4_FU.mjs";
51
- import { u as oo } from "../useInsightsEnabled-CNjP5cfR.mjs";
52
- import { E as no } from "../EmptyState-DoxNUae-.mjs";
53
- import { l as so } from "../ConnectDrawer-DVp54lUH.mjs";
54
- const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
55
- const { categories: t } = O(), { getCategoryName: n } = Y(), s = n(o);
7
+ import be from "@mui/material/Button";
8
+ import { addSeconds as je } from "date-fns/addSeconds";
9
+ import { differenceInCalendarMonths as Re } from "date-fns/differenceInCalendarMonths";
10
+ import pt from "numeral";
11
+ import { useTheme as ce } from "@mui/material/styles";
12
+ import { useItemTooltip as Ct, ChartsTooltipContainer as ft } from "@mui/x-charts/ChartsTooltip";
13
+ import { LineChart as yt } from "@mui/x-charts/LineChart";
14
+ import { u as ee } from "../useScreenSize-B6JyS_Lj.mjs";
15
+ import { u as _t } from "../useDimensions-27p2evRx.mjs";
16
+ import Ue from "@mui/material/Card";
17
+ import Xe from "@mui/material/CardContent";
18
+ import He from "@mui/material/Divider";
19
+ import Ge from "@mui/material/Grid";
20
+ import { u as H, m as $, g as V, b as pe, h as xe, d as ve, v as Ce, p as Ze, f as We, a as bt } from "../hooks-ZMp65DFz.mjs";
21
+ import { b as Tt } from "../Localization-2MODESHW.mjs";
22
+ import { C as Te } from "../CurrencyText-Dr0EZ7bp.mjs";
23
+ import { C as Ae, b as Be, c as St } from "../Category-CevNQ03n.mjs";
24
+ import { f as U, a as G } from "../Dialog-BPTr3qHE.mjs";
25
+ import { f as se, a as xt } from "../NumberFormatting-DjTD0t3W.mjs";
26
+ import { c as vt, a as Ve, g as wt, L as Qe } from "../TrendsStore-yO7qYv97.mjs";
27
+ import { T as Fn } from "../TrendsStore-yO7qYv97.mjs";
28
+ import { c as It, i as Lt, d as Et, e as Dt, b as qe, g as Je, f as Fe } from "../SpendingData-DQ1b9uqq.mjs";
29
+ import Mt from "@mui/material/ToggleButton";
30
+ import At from "@mui/material/ToggleButtonGroup";
31
+ import { parseISO as Pe } from "date-fns/parseISO";
32
+ import { DataGridPro as kt } from "@mui/x-data-grid-pro";
33
+ import { H as ke } from "../HeaderCell-DjuifqHJ.mjs";
34
+ import { T as B, b as Rt } from "../ViewMoreMicroCard-DwR0v_ll.mjs";
35
+ import { A as I, W as et } from "../WidgetContainer-CoFDmQRE.mjs";
36
+ import { a as tt, T as ot } from "../TransactionDetails-m5PddMQn.mjs";
37
+ import { D as Ne } from "../Drawer-By9V-B5L.mjs";
38
+ import { u as we } from "../useWidgetLoadTimer-hIOioiKx.mjs";
39
+ import { L as me } from "../Loader-DUaFpDGv.mjs";
40
+ import { L as Oe } from "../LineChart-KpPw1phO.mjs";
41
+ import { M as Ht } from "../MiniWidgetContainer-Bg02sF1Y.mjs";
42
+ import { subMonths as Nt } from "date-fns";
43
+ import { TrendingUp as Wt, TrendingDown as Ot, MultilineChart as Gt, ExpandLess as Bt, ExpandMore as Vt } from "@mxenabled/mx-icons";
44
+ import { M as Ft } from "../MicroWidgetContainer-r6mtxRer.mjs";
45
+ import Pt from "@mui/material/Collapse";
46
+ import $t from "@mui/material/List";
47
+ import zt from "@mui/material/ListItem";
48
+ import Kt from "@mui/material/ListItemButton";
49
+ import Yt from "@mui/material/ListItemIcon";
50
+ import jt from "@mui/material/ListItemText";
51
+ import nt from "@mui/material/styles/useTheme";
52
+ import { Stack as Ut } from "@mui/material";
53
+ import Xt from "@mui/material/Paper";
54
+ import { b as Zt } from "../CategoryUtil-DUM8NuGO.mjs";
55
+ import { E as Qt } from "../ExportCsvAction-Cglo8Mca.mjs";
56
+ import { u as qt } from "../useInsightsEnabled-B7dxpDrX.mjs";
57
+ import { E as Jt } from "../EmptyState-DoxNUae-.mjs";
58
+ import { l as eo } from "../ConnectDrawer-BkvlItWx.mjs";
59
+ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
60
+ const { categories: n } = H(), { getCategoryName: o } = $(), s = o(t);
56
61
  return /* @__PURE__ */ y(S, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
57
62
  /* @__PURE__ */ e(
58
- W,
63
+ k,
59
64
  {
60
- "aria-label": $e(t.category_icon_label_aria, s),
65
+ "aria-label": Tt(n.category_icon_label_aria, s),
61
66
  mb: 4,
62
67
  role: "img",
63
- children: /* @__PURE__ */ e(we, { categoryGuid: a })
68
+ children: /* @__PURE__ */ e(Se, { categoryGuid: r })
64
69
  }
65
70
  ),
66
- /* @__PURE__ */ e(z, { variant: "body1", children: s })
71
+ /* @__PURE__ */ e(P, { variant: "Body", children: s })
67
72
  ] });
68
- }, ao = ({
69
- categoryGuids: { guid: o, topLevelGuid: a },
70
- hoveredAreaData: t,
71
- cursorPosition: n,
73
+ }, to = ({
74
+ categoryGuids: { guid: t, topLevelGuid: r },
75
+ hoveredAreaData: n,
76
+ cursorPosition: o,
72
77
  chartContainerRef: s
73
78
  }) => {
74
- const l = ue(), m = dt(null), [h, i] = ut({ x: n.x, y: n.y });
75
- if (ht(() => {
79
+ const h = ce(), g = ut(null), [d, l] = ht({ x: o.x, y: o.y });
80
+ if (gt(() => {
76
81
  (() => {
77
- const p = m.current, _ = s.current;
78
- if (!p || !_) return;
79
- const u = p.getBoundingClientRect(), C = _.getBoundingClientRect();
80
- let b = n.x, g = n.y;
81
- b + u.width * 2 > C.right ? b = n.x - u.width : b - u.width < C.left && (b = n.x), g + u.height * 2 > C.bottom && (g = n.y - u.height), i({ x: b, y: g });
82
+ const i = g.current, b = s.current;
83
+ if (!i || !b) return;
84
+ const c = i.getBoundingClientRect(), f = b.getBoundingClientRect();
85
+ let C = o.x, _ = o.y;
86
+ C + c.width * 2 > f.right ? C = o.x - c.width : C - c.width < f.left && (C = o.x), _ + c.height * 2 > f.bottom && (_ = o.y - c.height), l({ x: C, y: _ });
82
87
  })();
83
- }, [n, s]), !t) return null;
84
- const d = t.reduce((f, p) => f + p.y, 0);
88
+ }, [o, s]), !n) return null;
89
+ const m = n.reduce((p, i) => p + i.y, 0);
85
90
  return /* @__PURE__ */ e(
86
- pt,
91
+ Ue,
87
92
  {
88
- ref: m,
93
+ ref: g,
89
94
  sx: {
90
95
  position: "absolute",
91
- top: h.y,
92
- left: h.x,
96
+ top: d.y,
97
+ left: d.x,
93
98
  width: 250,
94
99
  pointerEvents: "none"
95
100
  },
96
- children: /* @__PURE__ */ y(ft, { children: [
97
- /* @__PURE__ */ y(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
98
- /* @__PURE__ */ e(qe, { categoryGuid: o, topLevelCategoryGuid: a }),
99
- /* @__PURE__ */ e(z, { variant: "body2", children: `${t.length}-month total` }),
100
- /* @__PURE__ */ e(ve, { amount: d, bold: !0, formatString: "0,0", variant: "body2" })
101
+ children: /* @__PURE__ */ y(Xe, { children: [
102
+ /* @__PURE__ */ y(k, { alignItems: "center", display: "flex", flexDirection: "column", children: [
103
+ /* @__PURE__ */ e(st, { categoryGuid: t, topLevelCategoryGuid: r }),
104
+ /* @__PURE__ */ e(P, { variant: "Small", children: `${n.length}-month total` }),
105
+ /* @__PURE__ */ e(Te, { amount: m, bold: !0, formatString: "0,0", variant: "body2" })
101
106
  ] }),
102
- /* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
103
- /* @__PURE__ */ e(We, { container: !0, children: t.map((f, p) => /* @__PURE__ */ y(c.Fragment, { children: [
104
- p > 0 && p % 3 === 0 && /* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
105
- /* @__PURE__ */ e(We, { size: { xs: 4 }, children: /* @__PURE__ */ y(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
106
- /* @__PURE__ */ e(z, { color: l.palette.text.secondary, variant: "caption", children: f.x }),
107
+ /* @__PURE__ */ e(He, { sx: { my: 16, width: "100%" } }),
108
+ /* @__PURE__ */ e(Ge, { container: !0, children: n.map((p, i) => /* @__PURE__ */ y(u.Fragment, { children: [
109
+ i > 0 && i % 3 === 0 && /* @__PURE__ */ e(He, { sx: { my: 16, width: "100%" } }),
110
+ /* @__PURE__ */ e(Ge, { item: !0, xs: 4, children: /* @__PURE__ */ y(k, { alignItems: "center", display: "flex", flexDirection: "column", children: [
111
+ /* @__PURE__ */ e(P, { color: h.palette.text.secondary, variant: "XSmall", children: p.x }),
107
112
  /* @__PURE__ */ e(
108
- ve,
113
+ Te,
109
114
  {
110
- amount: f.y,
115
+ amount: p.y,
111
116
  bold: !0,
112
117
  formatString: "0,0",
113
- variant: "body1"
118
+ variant: "Body"
114
119
  }
115
120
  )
116
121
  ] }) })
117
- ] }, p)) })
122
+ ] }, i)) })
118
123
  ] })
119
124
  }
120
125
  );
121
- }, ro = R(ao), io = ({
122
- categoryGuids: { guid: o, topLevelGuid: a },
123
- itemData: { dataIndex: t },
124
- series: n,
125
- xData: s
126
- }) => {
127
- const l = _t(), m = n.data[t], h = s[t];
128
- return m === void 0 || !h ? null : /* @__PURE__ */ e(Tt, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ y(St, { alignItems: "center", display: "flex", flexDirection: "column", children: [
129
- /* @__PURE__ */ e(qe, { categoryGuid: o, topLevelCategoryGuid: a }),
130
- /* @__PURE__ */ e(z, { color: l.palette.text.secondary, variant: "body2", children: Q(h, F.MONTH_SHORT_YEAR) }),
131
- /* @__PURE__ */ e(ve, { amount: String(m), bold: !0, formatString: "0,0", variant: "body1" })
132
- ] }) }) });
133
- }, co = ({
134
- sx: o,
135
- categoryGuids: a,
136
- hoveredLegend: t,
137
- legendRef: n,
126
+ }, oo = R(to), no = ({
127
+ sx: t,
128
+ categoryGuids: r,
129
+ hoveredLegend: n,
130
+ legendRef: o,
138
131
  onHoverLegend: s,
139
- onClickLegend: l
132
+ onClickLegend: h
140
133
  }) => {
141
- const { isMobile: m } = J(), { getCategoryName: h } = Y();
134
+ const { isMobile: g } = ee(), { getCategoryName: d } = $();
142
135
  return /* @__PURE__ */ e(
143
136
  S,
144
137
  {
145
138
  direction: "row",
146
139
  flexWrap: "wrap",
147
- gap: m ? 2 : 6,
140
+ gap: g ? 2 : 6,
148
141
  justifyContent: "start",
149
- ref: n,
150
- sx: o,
151
- children: a.map(({ guid: i, top_level_guid: d }) => {
152
- const f = t === i, p = Me[i], _ = Me[d], u = p ?? _ ?? Me.default, C = u + "33";
142
+ ref: o,
143
+ sx: t,
144
+ children: r.map(({ guid: l, top_level_guid: m }) => {
145
+ const p = n === l, i = Ae[l], b = Ae[m], c = i ?? b ?? Ae.default, f = c + "33";
153
146
  return /* @__PURE__ */ y(
154
- xe,
147
+ be,
155
148
  {
156
- onClick: () => l(i),
157
- onMouseEnter: () => s(i),
149
+ onClick: () => h(l),
150
+ onMouseEnter: () => s(l),
158
151
  onMouseLeave: () => s(null),
159
152
  sx: {
160
153
  color: "text.primary",
@@ -165,134 +158,151 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
165
158
  paddingX: 8,
166
159
  paddingY: 4,
167
160
  borderRadius: 1,
168
- opacity: f ? 1 : 0.7
161
+ opacity: p ? 1 : 0.7
169
162
  },
170
163
  children: [
171
164
  /* @__PURE__ */ e(
172
- W,
165
+ k,
173
166
  {
174
167
  sx: {
175
168
  width: 16,
176
169
  height: 16,
177
- marginRight: m ? 5 : 10,
170
+ marginRight: g ? 5 : 10,
178
171
  borderRadius: "2px",
179
- backgroundColor: t ? f ? u : C : u
172
+ backgroundColor: n ? p ? c : f : c
180
173
  }
181
174
  }
182
175
  ),
183
- /* @__PURE__ */ e(z, { variant: "body1", children: h(i) })
176
+ /* @__PURE__ */ e(P, { variant: "Body", children: d(l) })
184
177
  ]
185
178
  },
186
- i
179
+ l
187
180
  );
188
181
  })
189
182
  }
190
183
  );
191
- }, lo = ({
192
- onHoverArea: o,
193
- onHoverPoint: a,
194
- onHoverLegend: t,
195
- onClickLegend: n,
184
+ }, so = ({
185
+ categoryGuids: { guid: t, topLevelGuid: r },
186
+ series: n,
187
+ xData: o
188
+ }) => {
189
+ const s = Ct(), h = ce();
190
+ if (!s?.identifier) return null;
191
+ const { dataIndex: g, seriesId: d } = s.identifier;
192
+ if (g == null || !d) return null;
193
+ const m = n.find((i) => i.id === d)?.data?.[g], p = o?.[g];
194
+ return m === void 0 || !p ? null : /* @__PURE__ */ e(Ue, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(Xe, { children: /* @__PURE__ */ y(k, { alignItems: "center", display: "flex", flexDirection: "column", children: [
195
+ /* @__PURE__ */ e(st, { categoryGuid: t, topLevelCategoryGuid: r }),
196
+ /* @__PURE__ */ e(P, { color: h.palette.text.secondary, variant: "Small", children: U(p, G.MONTH_SHORT_YEAR) }),
197
+ /* @__PURE__ */ e(Te, { amount: String(m), bold: !0, formatString: "0,0", variant: "Body" })
198
+ ] }) }) });
199
+ }, ro = ({
200
+ onHoverArea: t,
201
+ onHoverPoint: r,
202
+ onHoverLegend: n,
203
+ onClickLegend: o,
196
204
  stackedDatasets: s,
197
- unstackedDatasets: l = [],
198
- availableHeight: m = 0,
199
- minimumHeight: h = 350
205
+ unstackedDatasets: h = [],
206
+ availableHeight: g = 0,
207
+ minimumHeight: d = 350
200
208
  }) => {
201
- const i = ue(), { isMobile: d } = J(), [f, { height: p }] = mt(), _ = c.useRef(null), [u, C] = c.useState(0);
202
- c.useEffect(() => {
203
- const r = Math.max(m - p, h);
204
- C(r);
205
- }, [m, p]);
206
- const [b, g] = c.useState(null), [v, E] = c.useState({
209
+ const l = ce(), { isMobile: m } = ee(), [p, { height: i }] = _t(), b = u.useRef(null), [c, f] = u.useState(0);
210
+ u.useEffect(() => {
211
+ const a = Math.max(g - i, d);
212
+ f(a);
213
+ }, [g, i]);
214
+ const [C, _] = u.useState(null), [x, v] = u.useState({
207
215
  hoveredSeriesId: null,
208
216
  hoveredAreaData: null,
209
217
  isAreaHovered: !1,
210
218
  cursorPos: { x: 0, y: 0 }
211
- }), { hoveredSeriesId: I, hoveredAreaData: x, isAreaHovered: M, cursorPos: k } = v, A = M && I && x, G = !A, ee = [...s, ...l], ne = ee[0]?.dataset.length ?? 0, H = ee.flatMap((r) => r.dataset.map((T) => T.x)), he = ee.flatMap((r) => r.dataset.map((T) => T.y)), B = s[0]?.dataset?.map(
212
- (r, T) => s.reduce((L, j) => L + j.dataset[T]?.y || 0, 0)
213
- ) ?? [0], se = Math.max(...B), ae = Math.max(
214
- ...l.flatMap((r) => r.dataset.map((T) => T.y))
215
- ), $ = Math.floor(Math.min(...he) / 100) * 100, _e = Math.ceil(Math.max(se, ae) / 100) * 100, U = s.map((r, T) => ({
219
+ }), { hoveredSeriesId: D, hoveredAreaData: M, isAreaHovered: L, cursorPos: A } = x, te = L && D && M, W = !te, F = [...s, ...h], z = F[0]?.dataset.length ?? 0, X = F.flatMap((a) => a.dataset.map((T) => T.x)), fe = F.flatMap((a) => a.dataset.map((T) => T.y)), oe = s[0]?.dataset?.map(
220
+ (a, T) => s.reduce((E, j) => E + j.dataset[T]?.y || 0, 0)
221
+ ) ?? [0], re = Math.max(...oe), Z = Math.max(
222
+ ...h.flatMap((a) => a.dataset.map((T) => T.y))
223
+ ), le = Math.floor(Math.min(...fe) / 100) * 100, ne = Math.ceil(Math.max(re, Z) / 100) * 100, K = s.map((a, T) => ({
216
224
  id: `stacked-${T}`,
217
- guid: r.category_guid,
218
- top_level_guid: r.top_level_category_guid,
225
+ guid: a.category_guid,
226
+ top_level_guid: a.top_level_category_guid,
219
227
  area: !0,
220
- color: s[T].category_color ?? i.palette.primary.main,
221
- data: r.dataset.map((L) => L.y),
228
+ color: s[T].category_color ?? l.palette.primary.main,
229
+ data: a.dataset.map((E) => E.y),
222
230
  label: s[T].category_name,
223
231
  stack: "total",
224
232
  type: "line",
225
233
  highlightScope: { highlight: "item" },
226
- valueFormatter: (L) => oe(L, "0,0")
227
- })), K = l.map((r, T) => ({
234
+ valueFormatter: (E) => se(E, "0,0")
235
+ })), ae = h.map((a, T) => ({
228
236
  id: `unstacked-${T}`,
229
- guid: r.category_guid,
230
- top_level_guid: r.top_level_category_guid,
237
+ guid: a.category_guid,
238
+ top_level_guid: a.top_level_category_guid,
231
239
  area: !1,
232
- color: r.category_color,
233
- data: r.dataset.map((L) => L.y),
234
- label: r.category_name,
240
+ color: a.category_color,
241
+ data: a.dataset.map((E) => E.y),
242
+ label: a.category_name,
235
243
  type: "line",
236
- valueFormatter: (L) => oe(L, "0,0")
237
- })), re = [...U, ...K], X = [
238
- ...U.map(({ guid: r, top_level_guid: T }) => ({
239
- guid: r,
244
+ valueFormatter: (E) => se(E, "0,0")
245
+ })), Q = [...K, ...ae], ie = [
246
+ ...K.map(({ guid: a, top_level_guid: T }) => ({
247
+ guid: a,
240
248
  top_level_guid: T
241
249
  })),
242
- ...K.map(({ guid: r, top_level_guid: T }) => ({
243
- guid: r,
250
+ ...ae.map(({ guid: a, top_level_guid: T }) => ({
251
+ guid: a,
244
252
  top_level_guid: T
245
253
  }))
246
- ], Z = (r) => {
247
- const L = r.startsWith("stacked-") ? s[parseInt(r.split("-")[1])] : l[parseInt(r.split("-")[1])];
254
+ ], q = (a) => {
255
+ const E = a.startsWith("stacked-") ? s[parseInt(a.split("-")[1])] : h[parseInt(a.split("-")[1])];
248
256
  return {
249
- guid: L?.category_guid,
250
- topLevelGuid: L?.top_level_category_guid
257
+ guid: E?.category_guid,
258
+ topLevelGuid: E?.top_level_category_guid
251
259
  };
252
- }, te = (r) => {
253
- g(r), t?.(r ?? "");
254
- }, ie = (r) => {
255
- n?.(r ?? "");
256
- }, ge = () => {
257
- const r = Z(String(I)).guid;
258
- r && n?.(r);
259
- }, ce = (r) => {
260
- const T = String(r?.seriesId), L = Z(T).guid, j = re.find((de) => de.id === T), Te = j && r?.dataIndex !== void 0, Ee = j && r?.dataIndex === void 0;
261
- if (Te)
262
- E({
260
+ }, w = (a) => {
261
+ _(a), n?.(a ?? "");
262
+ }, O = (a) => {
263
+ o?.(a ?? "");
264
+ }, Y = () => {
265
+ const a = q(String(D)).guid;
266
+ a && o?.(a);
267
+ }, de = (a) => {
268
+ const T = String(a?.seriesId), E = q(T).guid, j = Q.find((ue) => ue.id === T), Le = j && a?.dataIndex !== void 0, Ee = j && a?.dataIndex === void 0;
269
+ if (Le)
270
+ v({
263
271
  hoveredSeriesId: T,
264
272
  hoveredAreaData: null,
265
273
  isAreaHovered: !1,
266
- cursorPos: k
267
- }), a?.(L);
274
+ cursorPos: A
275
+ }), r?.(E);
268
276
  else if (Ee) {
269
- const de = j?.data.map((be, Ie) => ({
270
- x: H[Ie],
271
- y: be
277
+ const ue = j?.data.map((De, Me) => ({
278
+ x: X[Me],
279
+ y: De
272
280
  })) ?? [];
273
- E({
281
+ v({
274
282
  hoveredSeriesId: T,
275
- hoveredAreaData: de,
283
+ hoveredAreaData: ue,
276
284
  isAreaHovered: !0,
277
- cursorPos: k
278
- }), o?.(L);
285
+ cursorPos: A
286
+ }), t?.(E);
279
287
  } else
280
- E({
288
+ v({
281
289
  hoveredSeriesId: null,
282
290
  hoveredAreaData: null,
283
291
  isAreaHovered: !1,
284
- cursorPos: k
292
+ cursorPos: A
285
293
  });
286
- }, le = (r) => {
287
- const T = r.currentTarget.getBoundingClientRect();
288
- E((L) => ({
289
- ...L,
294
+ }, ye = (a) => {
295
+ if (a.target instanceof Element && a.target.classList[0]?.includes("MuiMarkElement-root"))
296
+ return;
297
+ const T = a.currentTarget.getBoundingClientRect();
298
+ v((E) => ({
299
+ ...E,
290
300
  cursorPos: {
291
- x: r.clientX - T.left,
292
- y: r.clientY - T.top
301
+ x: a.clientX - T.left,
302
+ y: a.clientY - T.top
293
303
  }
294
304
  }));
295
- }, D = {
305
+ }, Ie = {
296
306
  p: 4,
297
307
  "& .MuiBarLabel-root": {
298
308
  fontSize: 10,
@@ -308,18 +318,18 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
308
318
  '& [class*="MuiLineElement-series-unstacked-"]': {
309
319
  strokeWidth: 3
310
320
  },
311
- ...b && U.reduce((r, T, L) => {
312
- const j = `.MuiAreaElement-series-stacked-${L}`;
313
- return r[j] = {
314
- opacity: U[L].guid === b ? 0.9 : 0.2
315
- }, r;
321
+ ...C && K.reduce((a, T, E) => {
322
+ const j = `.MuiAreaElement-series-stacked-${E}`;
323
+ return a[j] = {
324
+ opacity: K[E].guid === C ? 0.9 : 0.2
325
+ }, a;
316
326
  }, {})
317
327
  };
318
328
  return /* @__PURE__ */ e(
319
- W,
329
+ k,
320
330
  {
321
- onMouseMove: le,
322
- ref: _,
331
+ onMouseMove: ye,
332
+ ref: b,
323
333
  sx: {
324
334
  position: "relative",
325
335
  touchAction: "pan-y",
@@ -339,70 +349,68 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
339
349
  sx: { width: "100%", position: "relative" },
340
350
  children: [
341
351
  /* @__PURE__ */ e(
342
- gt,
352
+ yt,
343
353
  {
344
- height: u,
345
- margin: { bottom: 50 },
346
- onAreaClick: ge,
347
- onHighlightChange: ce,
348
- series: re,
354
+ height: c,
355
+ hideLegend: !0,
356
+ margin: { bottom: 24, left: 12, right: 54, top: 48 },
357
+ onAreaClick: Y,
358
+ onHighlightChange: de,
359
+ series: Q,
349
360
  skipAnimation: !0,
350
361
  slotProps: {
351
- legend: {
352
- hidden: !0
353
- }
362
+ tooltip: { trigger: W ? "item" : "none" }
354
363
  },
355
364
  slots: {
356
- itemContent: (r) => G && I ? /* @__PURE__ */ e(
357
- io,
365
+ tooltip: W && D ? (a) => /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(
366
+ so,
358
367
  {
359
- categoryGuids: Z(I),
360
- xData: H,
361
- ...r
368
+ ...a,
369
+ categoryGuids: q(D),
370
+ series: Q,
371
+ xData: X
362
372
  }
363
- ) : null
364
- },
365
- sx: D,
366
- tooltip: {
367
- trigger: G ? "item" : "none"
373
+ ) }) : void 0
368
374
  },
375
+ sx: Ie,
369
376
  xAxis: [
370
377
  {
371
- data: H,
378
+ data: X,
372
379
  scaleType: "time",
373
- valueFormatter: (r) => Q(r, F.MONTH_SHORT_YEAR),
374
- tickNumber: ne
380
+ valueFormatter: (a) => U(a, G.MONTH_SHORT_YEAR),
381
+ tickNumber: z
375
382
  // How many ticks to show on the x-axis
376
383
  }
377
384
  ],
378
385
  yAxis: [
379
386
  {
380
- min: $,
381
- max: _e || 100
387
+ min: le,
388
+ max: ne || 100,
389
+ valueFormatter: (a) => pt(a).format("0a")
382
390
  }
383
391
  ]
384
392
  }
385
393
  ),
386
394
  /* @__PURE__ */ e(
387
- co,
395
+ no,
388
396
  {
389
- categoryGuids: X,
390
- hoveredLegend: b,
391
- legendRef: f,
392
- onClickLegend: ie,
393
- onHoverLegend: te,
394
- sx: { px: d ? 0 : 24 }
397
+ categoryGuids: ie,
398
+ hoveredLegend: C,
399
+ legendRef: p,
400
+ onClickLegend: O,
401
+ onHoverLegend: w,
402
+ sx: { px: m ? 0 : 24 }
395
403
  }
396
404
  ),
397
- A && /* @__PURE__ */ e(
398
- ro,
405
+ te && /* @__PURE__ */ e(
406
+ oo,
399
407
  {
400
- categoryGuids: Z(I),
401
- chartContainerRef: _,
402
- cursorPosition: k,
403
- hoveredAreaData: x.map((r) => ({
404
- ...r,
405
- x: Q(r.x, F.MONTH_SHORT_YEAR)
408
+ categoryGuids: q(D),
409
+ chartContainerRef: b,
410
+ cursorPosition: A,
411
+ hoveredAreaData: M.map((a) => ({
412
+ ...a,
413
+ x: U(a.x, G.MONTH_SHORT_YEAR)
406
414
  }))
407
415
  }
408
416
  )
@@ -411,29 +419,32 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
411
419
  )
412
420
  }
413
421
  );
414
- }, Qe = ({ selectedTab: o, onTabChange: a }) => /* @__PURE__ */ e(
415
- Nt,
422
+ }, rt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
423
+ At,
416
424
  {
417
425
  exclusive: !0,
418
- onChange: a,
426
+ onChange: r,
419
427
  orientation: "horizontal",
420
- value: o,
421
- children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(Ht, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(Se, { name: "table_chart_view" }) : /* @__PURE__ */ e(Se, { name: "format_list_bulleted" }) }, t))
428
+ value: t,
429
+ children: ["Chart", "Table"].map((n) => /* @__PURE__ */ e(Mt, { color: "primary", sx: { width: 56 }, value: n, children: n === "Chart" ? /* @__PURE__ */ e(_e, { name: "table_chart_view" }) : /* @__PURE__ */ e(_e, { name: "format_list_bulleted" }) }, n))
422
430
  }
423
- ), Je = ({ selectedDateRange: o, selectedCategoryGuid: a }) => {
424
- const { trends: t } = O(), { isMobile: n, isDesktop: s } = J(), { getCategoryName: l } = Y(), m = c.useMemo(() => {
425
- const h = Q(
426
- o.start,
427
- n ? F.MONTH_SHORT_YEAR : F.MONTH_YEAR
428
- ), i = Q(
429
- o.end,
430
- n ? F.MONTH_SHORT_YEAR : F.MONTH_YEAR
431
+ ), at = ({ selectedDateRange: t, selectedCategoryGuid: r }) => {
432
+ const { trends: n } = H(), { isMobile: o, isDesktop: s } = ee(), { getCategoryName: h } = $(), g = u.useMemo(() => {
433
+ const d = t.start.getFullYear() === t.end.getFullYear() ? U(
434
+ t.start,
435
+ o ? G.MONTH_SHORT : G.MONTH_LONG
436
+ ) : U(
437
+ t.start,
438
+ o ? G.MONTH_SHORT_YEAR : G.MONTH_YEAR
439
+ ), l = U(
440
+ t.end,
441
+ o ? G.MONTH_SHORT_YEAR : G.MONTH_YEAR
431
442
  );
432
- return `${h} - ${i}`;
433
- }, [o, n]);
434
- return /* @__PURE__ */ y(W, { sx: { mr: 10, minWidth: "60%" }, children: [
443
+ return `${d} - ${l}`;
444
+ }, [t, o]);
445
+ return /* @__PURE__ */ y(k, { sx: { mr: 10, minWidth: "60%" }, children: [
435
446
  /* @__PURE__ */ e(
436
- z,
447
+ P,
437
448
  {
438
449
  display: "block",
439
450
  fontWeight: 700,
@@ -442,235 +453,263 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
442
453
  overflow: "visible",
443
454
  textOverflow: "unset"
444
455
  },
445
- variant: s ? "h3" : "body1",
446
- children: l(a) || t.sub_title
456
+ variant: s ? "H3" : "Body",
457
+ children: h(r) || n.sub_title
447
458
  }
448
459
  ),
449
- /* @__PURE__ */ e(z, { variant: s ? "body1" : "body2", children: m })
460
+ /* @__PURE__ */ e(P, { variant: s ? "subtitle1" : "body2", children: g })
450
461
  ] });
451
- }, uo = (o) => {
452
- const a = o.row[o.field];
453
- return /* @__PURE__ */ e(S, { alignItems: "flex-end", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(ve, { amount: a, variant: "body2" }) });
454
- }, ho = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
455
- const { getCategoryName: t } = Y(), { categories: n } = O(), s = n.default_categories[o]?.replace(/&amp;/g, "&") ?? t(o);
462
+ }, $e = (t) => {
463
+ const r = t.row.category_guid, n = t.row.top_level_category_guid, o = r === Be.INCOME || n === Be.INCOME, s = t.row[t.field];
464
+ return /* @__PURE__ */ e(S, { alignItems: "flex-end", direction: "row", tabIndex: t.tabIndex, children: /* @__PURE__ */ e(
465
+ Te,
466
+ {
467
+ amount: s,
468
+ isIncome: o,
469
+ sx: { fontWeight: o ? 600 : 500 },
470
+ symbol: o ? "+" : void 0,
471
+ variant: "body2"
472
+ }
473
+ ) });
474
+ }, ao = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
475
+ const { getCategoryName: n } = $(), { categories: o } = H(), s = o.default_categories[t]?.replace(/&amp;/g, "&") ?? n(t);
456
476
  return /* @__PURE__ */ y(S, { alignItems: "center", direction: "row", justifyContent: "center", children: [
457
- /* @__PURE__ */ e(
458
- W,
459
- {
460
- "aria-label": $e(n.category_icon_label_aria, s),
461
- role: "img",
462
- children: /* @__PURE__ */ e(we, { categoryGuid: a })
463
- }
464
- ),
465
- /* @__PURE__ */ e(z, { sx: { ml: 12, pb: 6 }, variant: "body2", children: s })
477
+ /* @__PURE__ */ e(k, { "aria-hidden": !0, children: /* @__PURE__ */ e(Se, { categoryGuid: r, variant: "twotone" }) }),
478
+ /* @__PURE__ */ e(P, { sx: { ml: 12 }, variant: "body2", children: s })
466
479
  ] });
467
- }, go = (o) => /* @__PURE__ */ e(S, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
468
- ho,
480
+ }, io = (t) => /* @__PURE__ */ e(S, { alignItems: "center", direction: "row", tabIndex: t.tabIndex, children: /* @__PURE__ */ e(
481
+ ao,
469
482
  {
470
- categoryGuid: o.row.category,
471
- topLevelCategoryGuid: o.row.top_level_category_guid
483
+ categoryGuid: t.row.category,
484
+ topLevelCategoryGuid: t.row.top_level_category_guid
472
485
  }
473
- ) }), mo = (o, a) => {
474
- const t = [], n = new Date(o);
475
- for (; n <= a; ) {
476
- const s = Q(n, F.MONTH);
477
- t.push(s), n.setMonth(n.getMonth() + 1);
486
+ ) }), co = (t, r) => {
487
+ const n = [], o = new Date(t);
488
+ for (; o <= r; ) {
489
+ const s = U(o, G.MONTH_LONG);
490
+ n.push(s), o.setMonth(o.getMonth() + 1);
478
491
  }
479
- return t;
480
- }, et = ({
481
- monthlyCategoryTotals: o,
482
- selectedDateRange: a,
483
- selectedCategory: t,
492
+ return n;
493
+ }, it = ({
494
+ selectedDateRange: t,
495
+ selectedCategory: r,
484
496
  onClickRow: n,
485
- height: s = "100dvh",
486
- sx: l = {}
497
+ height: o = "100%",
498
+ sx: s = {}
487
499
  }) => {
488
- const { onEvent: m } = P(), h = Q(/* @__PURE__ */ new Date(), F.MONTH_SHORT), [i, d] = c.useState([
489
- { field: h, sort: "desc" }
490
- ]), f = c.useMemo(() => mo(a.start, a.end), [a]), p = [
500
+ const h = ce(), { onEvent: g } = V(), { transactions: d, spending: l } = H(), { trendsCategories: m } = $(), p = u.useMemo(() => co(t.start, t.end), [t]), i = h.palette.mode === "light", b = [
491
501
  {
492
502
  field: "category",
493
503
  flex: 1,
494
- headerName: "Category",
504
+ headerClassName: "trends-table-header",
505
+ headerName: d.category_title,
495
506
  minWidth: 175,
496
- renderHeader: Ge,
497
- renderCell: go,
507
+ renderHeader: ke,
508
+ renderCell: io,
498
509
  sortable: !0,
510
+ sortComparator: vt,
499
511
  type: "string"
500
512
  },
501
- ...f.map(
502
- (u) => ({
503
- field: u,
513
+ ...p.map(
514
+ (C) => ({
515
+ field: C,
504
516
  flex: 1,
505
- headerName: u,
517
+ headerClassName: "trends-table-header",
518
+ headerName: C,
506
519
  minWidth: 100,
507
- renderHeader: Ge,
508
- renderCell: uo,
520
+ renderHeader: ke,
521
+ renderCell: $e,
509
522
  align: "right",
510
523
  headerAlign: "right",
511
524
  sortable: !0,
512
525
  hideSortIcons: !1,
513
526
  type: "number",
514
- sortComparator: Dt
527
+ sortComparator: Ve
515
528
  })
516
- )
517
- ], _ = c.useMemo(() => {
518
- const u = o.filter(
519
- (g) => !Et(g) && !It(g)
520
- ), b = (t ? u.filter(
521
- (g) => g.category_guid === t || g.top_level_category_guid === t
522
- ) : u).reduce(
523
- (g, v) => {
524
- const { category_guid: E, top_level_category_guid: I, month: x, total: M, year: k } = v, A = t ? E : I;
525
- g[A] || (g[A] = {
526
- id: A,
527
- category: A,
528
- category_guid: E,
529
- top_level_category_guid: I
530
- });
531
- const G = Q(new Date(k, x - 1), F.MONTH_SHORT);
532
- return g[A][G] || (g[A][G] = 0), g[A][G] = g[A][G] + Math.abs(M), g;
533
- },
534
- {}
535
- );
536
- return Object.values(b);
537
- }, [o, t]);
538
- return /* @__PURE__ */ e(W, { sx: { height: s, width: "100%", overflowX: "auto", boxShadow: "none", ...l }, children: /* @__PURE__ */ e(
539
- Wt,
529
+ ),
530
+ {
531
+ field: "total",
532
+ flex: 1,
533
+ headerClassName: "trends-table-header",
534
+ headerName: `${l.total[0].toUpperCase()}${l.total.slice(1)}`,
535
+ minWidth: 100,
536
+ renderHeader: ke,
537
+ renderCell: $e,
538
+ align: "right",
539
+ headerAlign: "right",
540
+ sortable: !0,
541
+ hideSortIcons: !1,
542
+ type: "number",
543
+ sortComparator: Ve
544
+ }
545
+ ], c = u.useMemo(() => {
546
+ if (r)
547
+ return m.find((C) => C.guid === r);
548
+ }, [r, m]), f = u.useMemo(() => {
549
+ let C = m;
550
+ return c && (C = c.subCategories.filter(
551
+ (_) => _.monthlyAmounts.some((x) => x.amount !== 0)
552
+ )), C.map((_) => {
553
+ let x = _.totalMonthlyAmounts;
554
+ c && (x = _.monthlyAmounts);
555
+ const v = x.reduce(
556
+ (M, L) => {
557
+ const A = U(Pe(L.isoDate), G.MONTH_LONG);
558
+ return M[A] = L.amount, M;
559
+ },
560
+ {}
561
+ ), D = x.reduce((M, L) => {
562
+ const A = U(Pe(L.isoDate), G.MONTH_LONG);
563
+ return M + (p.includes(A) ? L.amount : 0);
564
+ }, 0);
565
+ return {
566
+ id: _.guid,
567
+ category: _.guid,
568
+ top_level_category_guid: _.parent_guid || _.guid,
569
+ total: D,
570
+ ...v
571
+ };
572
+ });
573
+ }, [m]);
574
+ return /* @__PURE__ */ e(k, { sx: { height: o, width: "100%", overflowX: "auto", boxShadow: "none", ...s }, children: /* @__PURE__ */ e(
575
+ kt,
540
576
  {
541
- columns: p,
577
+ columns: b,
542
578
  disableColumnFilter: !0,
543
579
  disableColumnMenu: !0,
544
580
  hideFooter: !0,
545
- initialState: { sorting: { sortModel: i } },
546
- onRowClick: (u) => {
547
- n?.(u.row.category), m(w.TRENDS_CLICK_LIST_ITEM, {
548
- ...V,
549
- listItem: vt[u.row.category]
581
+ initialState: { sorting: { sortModel: [{ field: "category", sort: "asc" }] } },
582
+ onRowClick: (C) => {
583
+ c || n?.(C.row.category), g(I.TRENDS_CLICK_LIST_ITEM, {
584
+ ...B,
585
+ listItem: St[C.row.category]
550
586
  });
551
587
  },
552
- onSortModelChange: (u) => {
553
- d(u), m(w.TRENDS_CLICK_TABLE_SORT, V);
554
- },
555
- rows: _,
588
+ rowHeight: 64,
589
+ rows: f,
556
590
  slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
557
- sortModel: i,
558
- sortingOrder: ["asc", "desc"]
591
+ sortingOrder: ["asc", "desc"],
592
+ sx: {
593
+ borderColor: "divider",
594
+ borderWidth: 1,
595
+ borderStyle: "solid",
596
+ borderRadius: 2,
597
+ "& .MuiDataGrid-columnHeaders": {
598
+ bgcolor: i ? "neutral.50" : "neutral.800",
599
+ borderBottom: "none"
600
+ },
601
+ "& .trends-table-header": {
602
+ bgcolor: i ? "neutral.50" : "neutral.800"
603
+ }
604
+ }
559
605
  }
560
606
  ) });
561
- }, po = {
607
+ }, lo = {
562
608
  title: "Transaction List"
563
- }, fo = ({
564
- categoryGuid: o,
565
- dateRange: a,
566
- isOpen: t,
567
- onClose: n
609
+ }, uo = ({
610
+ categoryGuid: t,
611
+ dateRange: r,
612
+ isOpen: n,
613
+ onClose: o
568
614
  }) => {
569
- const { onEvent: s } = P(), { selectedAccountGuids: l } = ye(), { common: m } = O(), { setFilter: h, sortedTransactions: i } = De(), [d, f] = c.useState(""), p = c.useMemo(
570
- () => i.find((u) => u.guid === d),
571
- [d, i]
615
+ const { onEvent: s } = V(), { selectedAccountGuids: h } = pe(), { common: g } = H(), { setFilter: d, sortedTransactions: l } = xe(), [m, p] = u.useState(""), i = u.useMemo(
616
+ () => l.find((c) => c.guid === m),
617
+ [m, l]
572
618
  );
573
- c.useEffect(() => {
574
- h({
575
- accounts: l,
576
- dateRange: a,
577
- custom: (u) => o === "" || o === u.category_guid || o === u.top_level_category_guid,
578
- showSplits: !!o
619
+ u.useEffect(() => {
620
+ d({
621
+ accounts: h,
622
+ dateRange: r,
623
+ custom: (c) => t === "" || t === c.category_guid || t === c.top_level_category_guid,
624
+ showSplits: !!t
579
625
  });
580
- }, [l, o, a]), c.useEffect(() => s(w.TRENDS_VIEW_TRANSACTIONS), []);
581
- const _ = () => {
582
- f(""), n();
626
+ }, [h, t, r]), u.useEffect(() => s(I.TRENDS_VIEW_TRANSACTIONS), []);
627
+ const b = () => {
628
+ p(""), o();
583
629
  };
584
630
  return /* @__PURE__ */ y(
585
- ke,
631
+ Ne,
586
632
  {
587
- ariaLabelClose: m.close_aria,
588
- isOpen: t,
589
- onClose: _,
590
- title: po.title,
633
+ ariaLabelClose: g.close_aria,
634
+ isOpen: n,
635
+ onClose: b,
636
+ title: lo.title,
591
637
  children: [
592
- p && /* @__PURE__ */ e(Xe, { transaction: p }),
593
- !p && /* @__PURE__ */ e(Ze, { onClick: f })
638
+ i && /* @__PURE__ */ e(tt, { transaction: i }),
639
+ !i && /* @__PURE__ */ e(ot, { onClick: p })
594
640
  ]
595
641
  }
596
642
  );
597
- }, yo = R(fo), Co = ({ onBackClick: o, sx: a }) => {
598
- const { onEvent: t } = P(), { isDesktop: n, isTablet: s, isMobile: l } = J(), { isAccountDataLoaded: m, loadAccountData: h, visibleAccounts: i } = Le(), {
599
- categoriesLoaded: d,
600
- loadCategories: f,
601
- loadMonthlyCategoryTotals: p,
602
- monthlyCategoryTotals: _,
603
- getCategoryName: u
604
- } = Y(), {
605
- isTransactionDataLoaded: C,
606
- loadTransactionData: b,
607
- sortedTransactions: g
608
- } = De(), { selectedDateRange: v, setSelectedDateRange: E } = Ce(), { isInitialized: I, selectedAccounts: x, setSelectedAccounts: M } = ye(), { trends: k } = O(), [A, G] = c.useState(!1), [ee, ne] = c.useState(!1), [H, he] = c.useState("Chart"), [B, se] = c.useState(""), [ae, $] = c.useState(window.innerHeight), U = ae - (l ? 315 : 345);
609
- c.useEffect(() => {
610
- const D = () => $(window.innerHeight);
611
- return window.addEventListener("resize", D), m || h().finally(), d || f().finally(), C || b().finally(), () => window.removeEventListener("resize", D);
612
- }, []), c.useEffect(() => {
613
- M(i);
614
- }, [i]), c.useEffect(() => {
615
- I && p(
616
- x,
617
- v.start,
618
- v.end
643
+ }, ho = R(uo), go = ({ onBackClick: t, sx: r }) => {
644
+ const { onEvent: n } = V(), { isDesktop: o, isTablet: s, isMobile: h } = ee(), { visibleAccounts: g } = ve(), { loadMonthlyCategoryTotals: d, monthlyCategoryTotals: l, getCategoryName: m } = $(), { sortedTransactions: p } = xe(), { selectedDateRange: i, setSelectedDateRange: b } = Ce(), { isCopyLoaded: c, isInitialized: f, selectedAccounts: C, setSelectedAccounts: _ } = pe(), { trends: x } = H(), [v, D] = u.useState(!1), [M, L] = u.useState(!1), [A, te] = u.useState("Chart"), [W, F] = u.useState(""), [z, X] = u.useState(window.innerHeight), oe = z - (h ? 315 : 345);
645
+ we({
646
+ widgetName: "TrendsFullWidget",
647
+ isLoaded: v
648
+ }), u.useEffect(() => {
649
+ const w = () => X(window.innerHeight);
650
+ return window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
651
+ }, []), u.useEffect(() => {
652
+ _(g);
653
+ }, [g]), u.useEffect(() => {
654
+ f && d(
655
+ C,
656
+ i.start,
657
+ i.end
619
658
  ).finally(() => {
620
- G(!0);
659
+ D(!0);
621
660
  });
622
- }, [I, x, v]);
623
- const K = c.useMemo(() => {
624
- if (!A) return { stackedDatasets: [], unstackedDatasets: [] };
625
- const D = Lt(
626
- _,
627
- v.start,
628
- v.end
629
- ), r = B.length ? D.filter(
630
- (T) => T.top_level_category_guid === B || T.category_guid === B
631
- ) : Mt(D);
661
+ }, [f, C, i]);
662
+ const re = u.useMemo(() => {
663
+ if (!v) return { stackedDatasets: [], unstackedDatasets: [] };
664
+ const w = wt(
665
+ l,
666
+ i.start,
667
+ i.end
668
+ ), O = W.length ? w.filter(
669
+ (Y) => Y.top_level_category_guid === W || Y.category_guid === W
670
+ ) : It(w);
632
671
  return {
633
- stackedDatasets: r.filter(Rt),
634
- unstackedDatasets: r.filter(At)
672
+ stackedDatasets: O.filter(Lt),
673
+ unstackedDatasets: O.filter(Et)
635
674
  };
636
- }, [_, B, v]), re = (D, r) => {
637
- he(r ?? H), t(w.TRENDS_CLICK_TOGGLE_VIEW);
638
- }, X = (D) => {
639
- const r = Fe(D?.[0], 1), T = D?.[1], L = Ae(T, r);
640
- E({ start: r, end: T }), t(w.TRENDS_CLICK_TIME_WINDOW, {
641
- time_period: L + "M"
675
+ }, [l, W, i]), Z = (w, O) => {
676
+ te(O ?? A), n(I.TRENDS_CLICK_TOGGLE_VIEW);
677
+ }, le = (w) => {
678
+ const O = je(w?.[0], 1), Y = w?.[1], de = Re(Y, O);
679
+ b({ start: O, end: Y }), n(I.TRENDS_CLICK_TIME_WINDOW, {
680
+ time_period: de + "M"
642
681
  });
643
- }, Z = () => {
644
- t(w.TRENDS_CLICK_FILTER);
645
- }, te = (D) => {
646
- se(D);
647
- }, ie = (D) => {
648
- se(D), t(w.TRENDS_CLICK_LEGEND, { category: u(D) });
649
- }, ge = (D) => {
650
- t(w.TRENDS_HOVER_LEGEND, { category: u(D) });
651
- }, ce = (D) => {
652
- t(w.TRENDS_HOVER_AREA, { category: D });
653
- }, le = (D) => {
654
- t(w.TRENDS_HOVER_POINT, { category: D });
682
+ }, ne = () => {
683
+ n(I.TRENDS_CLICK_FILTER);
684
+ }, K = (w) => {
685
+ F(w);
686
+ }, ae = (w) => {
687
+ F(w), n(I.TRENDS_CLICK_LEGEND, { category: m(w) });
688
+ }, Q = (w) => {
689
+ n(I.TRENDS_HOVER_LEGEND, { category: m(w) });
690
+ }, ie = (w) => {
691
+ n(I.TRENDS_HOVER_AREA, { category: w });
692
+ }, q = (w) => {
693
+ n(I.TRENDS_HOVER_POINT, { category: w });
655
694
  };
656
- return !I || !A ? /* @__PURE__ */ e(fe, {}) : /* @__PURE__ */ y(
657
- Ue,
695
+ return !c || !f || !v ? /* @__PURE__ */ e(me, {}) : /* @__PURE__ */ y(
696
+ et,
658
697
  {
659
- accountOptions: i,
660
- calendarActions: { onRangeChanged: X },
661
- dateRange: v,
698
+ accountOptions: g,
699
+ calendarActions: { onRangeChanged: le },
700
+ dateRange: i,
662
701
  dateRangeVariant: "timeframebuttons",
663
- onAccountsFilterClick: Z,
664
- onBackClick: o,
665
- sx: a,
666
- title: k.title,
702
+ onAccountsFilterClick: ne,
703
+ onBackClick: t,
704
+ sx: r,
705
+ title: x.title,
667
706
  children: [
668
707
  /* @__PURE__ */ y(
669
708
  S,
670
709
  {
671
710
  sx: {
672
711
  // eslint-disable-next-line no-nested-ternary
673
- px: n ? 48 : s ? 24 : 12
712
+ px: o ? 48 : s ? 24 : 12
674
713
  },
675
714
  children: [
676
715
  /* @__PURE__ */ y(
@@ -678,46 +717,45 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
678
717
  {
679
718
  flexDirection: "row",
680
719
  justifyContent: "space-between",
681
- sx: { pb: l ? 12 : 24, pt: l ? 24 : 48 },
720
+ sx: { pb: h ? 12 : 24, pt: h ? 24 : 48 },
682
721
  children: [
683
722
  /* @__PURE__ */ e(
684
- Je,
723
+ at,
685
724
  {
686
- selectedCategoryGuid: B,
687
- selectedDateRange: v
725
+ selectedCategoryGuid: W,
726
+ selectedDateRange: i
688
727
  }
689
728
  ),
690
- /* @__PURE__ */ e(Qe, { onTabChange: re, selectedTab: H })
729
+ /* @__PURE__ */ e(rt, { onTabChange: Z, selectedTab: A })
691
730
  ]
692
731
  }
693
732
  ),
694
733
  /* @__PURE__ */ y(S, { alignItems: "center", flexDirection: "row", width: "100%", children: [
695
- /* @__PURE__ */ e(W, { flexGrow: 1, children: B && /* @__PURE__ */ y(xe, { onClick: () => se(""), sx: { p: 0, pr: 5 }, children: [
696
- /* @__PURE__ */ e(Se, { name: "arrow_back" }),
697
- k.all_categories
734
+ /* @__PURE__ */ e(k, { flexGrow: 1, children: W && /* @__PURE__ */ y(be, { onClick: () => F(""), sx: { p: 0, pr: 5 }, children: [
735
+ /* @__PURE__ */ e(_e, { name: "arrow_back" }),
736
+ x.all_categories
698
737
  ] }) }),
699
- /* @__PURE__ */ e(xe, { onClick: () => ne(!0), sx: { px: 5 }, children: `${k.view_transactions} (${g.length})` })
738
+ /* @__PURE__ */ e(be, { onClick: () => L(!0), sx: { px: 5 }, children: `${x.view_transactions} (${p.length})` })
700
739
  ] }),
701
- /* @__PURE__ */ y(W, { children: [
702
- H === "Chart" && /* @__PURE__ */ e(
703
- lo,
740
+ /* @__PURE__ */ y(k, { children: [
741
+ A === "Chart" && /* @__PURE__ */ e(
742
+ ro,
704
743
  {
705
- availableHeight: U,
706
- onClickLegend: ie,
707
- onHoverArea: ce,
708
- onHoverLegend: ge,
709
- onHoverPoint: le,
710
- stackedDatasets: K.stackedDatasets,
711
- unstackedDatasets: K.unstackedDatasets
744
+ availableHeight: oe,
745
+ onClickLegend: ae,
746
+ onHoverArea: ie,
747
+ onHoverLegend: Q,
748
+ onHoverPoint: q,
749
+ stackedDatasets: re.stackedDatasets,
750
+ unstackedDatasets: re.unstackedDatasets
712
751
  }
713
752
  ),
714
- H === "Table" && /* @__PURE__ */ e(
715
- et,
753
+ A === "Table" && /* @__PURE__ */ e(
754
+ it,
716
755
  {
717
- monthlyCategoryTotals: _,
718
- onClickRow: te,
719
- selectedCategory: B,
720
- selectedDateRange: v
756
+ onClickRow: K,
757
+ selectedCategory: W,
758
+ selectedDateRange: i
721
759
  }
722
760
  )
723
761
  ] })
@@ -725,27 +763,27 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
725
763
  }
726
764
  ),
727
765
  /* @__PURE__ */ e(
728
- yo,
766
+ ho,
729
767
  {
730
- categoryGuid: B,
731
- dateRange: v,
732
- isOpen: ee,
733
- onClose: () => ne(!1)
768
+ categoryGuid: W,
769
+ dateRange: i,
770
+ isOpen: M,
771
+ onClose: () => L(!1)
734
772
  }
735
773
  )
736
774
  ]
737
775
  }
738
776
  );
739
- }, Nn = R(Co), _o = () => {
740
- const { monthlyCategoryTotals: o } = Y(), { trends: a } = O(), t = ue(), { availableHeight: n = 300 } = ze(), s = kt(o);
777
+ }, Nn = R(go), mo = () => {
778
+ const { monthlyCategoryTotals: t } = $(), { trends: r } = H(), n = ce(), { availableHeight: o = 300 } = Ze(), s = Dt(t);
741
779
  return /* @__PURE__ */ e(
742
- Ne,
780
+ Oe,
743
781
  {
744
782
  baseline: "min",
745
- colors: [t.palette.primary.main],
783
+ colors: [n.palette.primary.main],
746
784
  datasets: [s],
747
- height: n,
748
- labels: [a.spending_label],
785
+ height: o,
786
+ labels: [r.spending_label],
749
787
  showArea: !0,
750
788
  showAverage: !0,
751
789
  showLegend: !0,
@@ -754,38 +792,39 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
754
792
  valueFormatterString: "0,0"
755
793
  }
756
794
  );
757
- }, To = R(_o), bo = ({ onPrimaryCtaClick: o, sx: a }) => {
758
- const { isAccountDataLoaded: t, loadAccountData: n, visibleAccounts: s } = Le(), { loadMonthlyCategoryTotals: l, monthlyTotalsLoaded: m } = Y(), { isInitialized: h } = He(), { trends: i } = O(), { selectedAccounts: d, setSelectedAccounts: f } = ye();
759
- return c.useEffect(() => {
760
- t || n().finally();
761
- }, []), c.useEffect(() => {
762
- f(s);
763
- }, [s]), c.useEffect(() => {
764
- h && l(d).finally();
765
- }, [h, d]), h ? /* @__PURE__ */ e(
766
- Gt,
795
+ }, po = R(mo), Co = ({ onPrimaryCtaClick: t, sx: r }) => {
796
+ const { visibleAccounts: n } = ve(), { loadMonthlyCategoryTotals: o, monthlyTotalsLoaded: s } = $(), { isInitialized: h } = We(), { trends: g } = H(), { isCopyLoaded: d, selectedAccounts: l, setSelectedAccounts: m } = pe();
797
+ return we({
798
+ widgetName: "TrendsMiniWidget",
799
+ isLoaded: s
800
+ }), u.useEffect(() => {
801
+ m(n);
802
+ }, [n]), u.useEffect(() => {
803
+ h && o(l).finally();
804
+ }, [h, l]), !d || !h ? /* @__PURE__ */ e(me, {}) : /* @__PURE__ */ e(
805
+ Ht,
767
806
  {
768
807
  contentStyles: { height: "calc(100% - 72px)", ":last-child": { pb: 0 } },
769
- onPrimaryCtaClick: o,
770
- primaryCtaLabel: i.primary_cta,
771
- subTitle: i.sub_title,
772
- sx: { height: "100%", ...a },
773
- title: i.mini_title,
774
- children: m ? /* @__PURE__ */ e(To, {}) : /* @__PURE__ */ e(fe, {})
808
+ onPrimaryCtaClick: t,
809
+ primaryCtaLabel: g.primary_cta,
810
+ subTitle: g.sub_title,
811
+ sx: { height: "100%", ...r },
812
+ title: g.mini_title,
813
+ children: s ? /* @__PURE__ */ e(po, {}) : /* @__PURE__ */ e(me, {})
775
814
  }
776
- ) : /* @__PURE__ */ e(fe, {});
777
- }, Wn = R(bo), So = 70, Be = ({
778
- title: o,
779
- totalAmount: a,
780
- transactionType: t,
781
- percentage: n,
815
+ );
816
+ }, Wn = R(Co), fo = 70, ze = ({
817
+ title: t,
818
+ totalAmount: r,
819
+ transactionType: n,
820
+ percentage: o,
782
821
  secondaryLabel: s,
783
- shouldDisplayPercentage: l
822
+ shouldDisplayPercentage: h
784
823
  }) => {
785
- const { availableWidth: m } = ze(), h = c.useRef(null), i = c.useRef(null), d = wt(Number(Math.abs(n)), {
824
+ const { availableWidth: g } = Ze(), d = u.useRef(null), l = u.useRef(null), m = xt(Number(Math.abs(o)), {
786
825
  style: "percent",
787
826
  minimumIntegerDigits: 1
788
- }), f = m === 288 && oe(a, "0,0.00").length > 10 ? oe(a, "0,0") : oe(a, "0,0.00"), p = t === "spending" ? n > 0 : n >= 0, _ = t === "spending" ? "error.main" : "success.main", u = t === "spending" ? "success.main" : "text.secondary", C = h?.current, b = i?.current, g = C && b ? C.scrollWidth > b.clientWidth - So : !1;
827
+ }), p = g === 288 && se(r, "0,0.00").length > 10 ? se(r, "0,0") : se(r, "0,0.00"), i = n === "spending" ? o > 0 : o >= 0, b = n === "spending" ? "error.main" : "success.main", c = n === "spending" ? "success.main" : "text.secondary", f = d?.current, C = l?.current, _ = f && C ? f.scrollWidth > C.clientWidth - fo : !1;
789
828
  return /* @__PURE__ */ y(
790
829
  S,
791
830
  {
@@ -808,18 +847,18 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
808
847
  justifyContent: "space-between"
809
848
  },
810
849
  children: [
811
- /* @__PURE__ */ e(pe, { color: "text.secondary", variant: "caption", children: o }),
812
- l && /* @__PURE__ */ y(S, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
813
- p ? /* @__PURE__ */ e(Vt, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e(Pt, { size: 20, sx: { color: u } }),
850
+ /* @__PURE__ */ e(ge, { color: "text.secondary", variant: "caption", children: t }),
851
+ h && /* @__PURE__ */ y(S, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
852
+ i ? /* @__PURE__ */ e(Wt, { size: 20, sx: { color: b } }) : /* @__PURE__ */ e(Ot, { size: 20, sx: { color: c } }),
814
853
  /* @__PURE__ */ e(
815
- pe,
854
+ ge,
816
855
  {
817
856
  sx: {
818
- color: p ? _ : u,
857
+ color: i ? b : c,
819
858
  fontWeight: 600
820
859
  },
821
860
  variant: "body2",
822
- children: d
861
+ children: m
823
862
  }
824
863
  )
825
864
  ] })
@@ -829,7 +868,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
829
868
  /* @__PURE__ */ y(
830
869
  S,
831
870
  {
832
- ref: i,
871
+ ref: l,
833
872
  sx: {
834
873
  alignItems: "center",
835
874
  flexDirection: "row",
@@ -837,17 +876,17 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
837
876
  },
838
877
  children: [
839
878
  /* @__PURE__ */ e(
840
- W,
879
+ k,
841
880
  {
842
- ref: h,
881
+ ref: d,
843
882
  sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
844
- children: /* @__PURE__ */ e(Pe, { children: f })
883
+ children: /* @__PURE__ */ e(Ye, { children: p })
845
884
  }
846
885
  ),
847
- l && m >= 450 && !g && /* @__PURE__ */ e(
848
- pe,
886
+ h && g >= 450 && !_ && /* @__PURE__ */ e(
887
+ ge,
849
888
  {
850
- color: p ? _ : u,
889
+ color: i ? b : c,
851
890
  variant: "caption",
852
891
  children: s
853
892
  }
@@ -858,53 +897,52 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
858
897
  ]
859
898
  }
860
899
  );
861
- }, xo = R(() => {
862
- const { trends: o } = O();
900
+ }, yo = R(() => {
901
+ const { trends: t } = H();
863
902
  return /* @__PURE__ */ y(S, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
864
- /* @__PURE__ */ e(Ft, { size: 32 }),
903
+ /* @__PURE__ */ e(Gt, { size: 32 }),
865
904
  /* @__PURE__ */ y(S, { children: [
866
- /* @__PURE__ */ e(pe, { fontWeight: 600, variant: "body1", children: o.zero_state_content_header }),
867
- /* @__PURE__ */ e(pe, { color: "text.secondary", variant: "subtitle2", children: o.zero_state_content_description })
905
+ /* @__PURE__ */ e(ge, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
906
+ /* @__PURE__ */ e(ge, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
868
907
  ] })
869
908
  ] });
870
- }), On = R(({ onCtaClick: o }) => {
871
- const { isAccountDataLoaded: a, loadAccountData: t, visibleAccounts: n } = Le();
872
- c.useEffect(() => {
873
- a || t().finally();
874
- }, []);
875
- const { onEvent: s } = P(), { monthlyCategoryTotals: l, loadMonthlyCategoryTotals: m, monthlyTotalsLoaded: h } = Y(), i = {
876
- start: Bt(/* @__PURE__ */ new Date(), 1),
909
+ }), On = R(({ onCtaClick: t }) => {
910
+ const { visibleAccounts: r } = ve(), { onEvent: n } = V(), { monthlyCategoryTotals: o, loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: h } = $(), g = {
911
+ start: Nt(/* @__PURE__ */ new Date(), 1),
877
912
  end: /* @__PURE__ */ new Date()
878
- }, { trends: d } = O(), { selectedAccounts: f, setSelectedAccounts: p, isInitialized: _ } = ye();
879
- c.useEffect(() => {
880
- p(n);
881
- }, [n]), c.useEffect(() => {
882
- _ && m(f, i.start).then(() => {
883
- s(w.TRENDS_LOAD_WIDGET, {
884
- state: n?.length ? "default" : "zeroState"
913
+ }, { trends: d } = H(), { selectedAccounts: l, setSelectedAccounts: m, isInitialized: p } = pe();
914
+ we({
915
+ widgetName: "TrendsMicroWidget",
916
+ isLoaded: h
917
+ }), u.useEffect(() => {
918
+ m(r);
919
+ }, [r]), u.useEffect(() => {
920
+ p && s(l, g.start).then(() => {
921
+ n(I.TRENDS_LOAD_WIDGET, {
922
+ state: r?.length ? "default" : "zeroState"
885
923
  });
886
924
  });
887
- }, [_, f]);
888
- const { spendingData: u, incomeData: C } = c.useMemo(
925
+ }, [p, l]);
926
+ const { spendingData: i, incomeData: b } = u.useMemo(
889
927
  () => ({
890
- spendingData: Ye(l, i),
891
- incomeData: je(l, i)
928
+ spendingData: qe(o, g),
929
+ incomeData: Je(o, g)
892
930
  }),
893
- [l, i]
894
- ), [b, g] = u, [v, E] = C, I = Oe(g.y, b.y), x = Oe(E.y, v.y), M = _ && !n?.length, k = () => {
895
- s(
896
- M ? w.TRENDS_CLICK_GET_STARTED : w.TRENDS_CLICK_VIEW_MORE
897
- ), o();
931
+ [o, g]
932
+ ), [c, f] = i, [C, _] = b, x = Fe(f.y, c.y), v = Fe(_.y, C.y), D = p && !r?.length, M = () => {
933
+ n(
934
+ D ? I.TRENDS_CLICK_GET_STARTED : I.TRENDS_CLICK_VIEW_MORE
935
+ ), t();
898
936
  };
899
- return !h || !_ ? /* @__PURE__ */ e(fe, {}) : /* @__PURE__ */ e(
900
- jt,
937
+ return !h || !p ? /* @__PURE__ */ e(me, {}) : /* @__PURE__ */ e(
938
+ Ft,
901
939
  {
902
940
  className: "mx-trends-microwidget",
903
941
  ctaLabel: d.micro_primary_cta_label,
904
- onCTAClick: k,
905
- subHeader: M ? void 0 : d.micro_subheader,
942
+ onCTAClick: M,
943
+ subHeader: D ? void 0 : d.micro_subheader,
906
944
  title: d.title,
907
- children: M ? /* @__PURE__ */ e(xo, {}) : /* @__PURE__ */ y(
945
+ children: D ? /* @__PURE__ */ e(yo, {}) : /* @__PURE__ */ y(
908
946
  S,
909
947
  {
910
948
  sx: {
@@ -914,24 +952,24 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
914
952
  },
915
953
  children: [
916
954
  /* @__PURE__ */ e(
917
- Be,
955
+ ze,
918
956
  {
919
- percentage: I,
957
+ percentage: x,
920
958
  secondaryLabel: d.micro_secondary_label,
921
- shouldDisplayPercentage: g.y !== 0 && b.y !== 0,
959
+ shouldDisplayPercentage: f.y !== 0 && c.y !== 0,
922
960
  title: d.spending_label,
923
- totalAmount: g.y,
961
+ totalAmount: f.y,
924
962
  transactionType: "spending"
925
963
  }
926
964
  ),
927
965
  /* @__PURE__ */ e(
928
- Be,
966
+ ze,
929
967
  {
930
- percentage: x,
968
+ percentage: v,
931
969
  secondaryLabel: d.micro_secondary_label,
932
- shouldDisplayPercentage: E.y !== 0 && v.y !== 0,
970
+ shouldDisplayPercentage: _.y !== 0 && C.y !== 0,
933
971
  title: d.income_label,
934
- totalAmount: E.y,
972
+ totalAmount: _.y,
935
973
  transactionType: "income"
936
974
  }
937
975
  )
@@ -940,21 +978,21 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
940
978
  )
941
979
  }
942
980
  );
943
- }), vo = R(
944
- ({ isExpanded: o, onClick: a }) => {
945
- const t = ue();
946
- return /* @__PURE__ */ e(Xt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Zt, { onClick: a, sx: { justifyContent: "center" }, children: /* @__PURE__ */ y(
981
+ }), _o = R(
982
+ ({ isExpanded: t, onClick: r }) => {
983
+ const n = nt();
984
+ return /* @__PURE__ */ e(zt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Kt, { onClick: r, sx: { justifyContent: "center" }, children: /* @__PURE__ */ y(
947
985
  S,
948
986
  {
949
- sx: { color: t.palette.primary.main, flexDirection: "row", alignItems: "center" },
987
+ sx: { color: n.palette.primary.main, flexDirection: "row", alignItems: "center" },
950
988
  children: [
951
- /* @__PURE__ */ e(Qt, { children: /* @__PURE__ */ e(z, { bold: !0, variant: "body2", children: o ? "View less" : "View more" }) }),
952
- /* @__PURE__ */ e(qt, { sx: { color: t.palette.primary.main }, children: o ? /* @__PURE__ */ e(zt, {}) : /* @__PURE__ */ e(
953
- $t,
989
+ /* @__PURE__ */ e(jt, { children: /* @__PURE__ */ e(P, { bold: !0, variant: "body2", children: t ? "View less" : "View more" }) }),
990
+ /* @__PURE__ */ e(Yt, { sx: { color: n.palette.primary.main }, children: t ? /* @__PURE__ */ e(Bt, {}) : /* @__PURE__ */ e(
991
+ Vt,
954
992
  {
955
993
  sx: {
956
994
  transition: "transform 0.3s ease-in-out",
957
- transform: o ? "rotate(180deg)" : "rotate(0deg)"
995
+ transform: t ? "rotate(180deg)" : "rotate(0deg)"
958
996
  }
959
997
  }
960
998
  ) })
@@ -962,128 +1000,128 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
962
1000
  }
963
1001
  ) }) });
964
1002
  }
965
- ), Ve = R(
1003
+ ), Ke = R(
966
1004
  ({
967
- totalAmount: o,
968
- guid: a,
969
- name: t,
970
- transactions: n,
1005
+ totalAmount: t,
1006
+ guid: r,
1007
+ name: n,
1008
+ transactions: o,
971
1009
  onClick: s,
972
- isLastItem: l = !1,
973
- showDivider: m = !0
1010
+ isLastItem: h = !1,
1011
+ showDivider: g = !0
974
1012
  }) => {
975
- const { trends: h } = O(), { onEvent: i } = P(), d = `${n.length} ${n.length === 1 ? h.transaction : h.transactions}`, f = () => {
976
- s?.(), i(w.TRENDS_CLICK_LIST_ITEM, {
977
- ...V,
978
- listItem: t
1013
+ const { trends: d } = H(), { onEvent: l } = V(), m = `${o.length} ${o.length === 1 ? d.transaction : d.transactions}`, p = () => {
1014
+ s?.(), l(I.TRENDS_CLICK_LIST_ITEM, {
1015
+ ...B,
1016
+ listItem: n
979
1017
  });
980
1018
  };
981
- return /* @__PURE__ */ y(c.Fragment, { children: [
1019
+ return /* @__PURE__ */ y(u.Fragment, { children: [
982
1020
  /* @__PURE__ */ e(
983
- Ke,
1021
+ Qe,
984
1022
  {
985
- leftIcon: a ? /* @__PURE__ */ e(we, { categoryGuid: a }) : void 0,
986
- onClick: f,
987
- rightContent: oe(Math.abs(o), "0,0.00"),
988
- rightIcon: s ? /* @__PURE__ */ e(Kt, {}) : void 0,
989
- subtitle: d,
990
- title: t
1023
+ leftIcon: r ? /* @__PURE__ */ e(Se, { categoryGuid: r }) : void 0,
1024
+ onClick: p,
1025
+ rightContent: se(Math.abs(t), "0,0.00"),
1026
+ rightIcon: s ? /* @__PURE__ */ e(mt, {}) : void 0,
1027
+ subtitle: m,
1028
+ title: n
991
1029
  }
992
1030
  ),
993
- m && /* @__PURE__ */ e(Re, { sx: { ml: l ? 24 : 68 } })
994
- ] }, a);
1031
+ g && /* @__PURE__ */ e(He, { sx: { ml: h ? 24 : 68 } })
1032
+ ] }, r);
995
1033
  }
996
- ), wo = R(
997
- ({ availableHeight: o = 0, onCategoryClick: a }) => {
998
- const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: s } = Ce(), { isLargeDesktop: l, isDesktop: m } = J(), { trends: h } = O(), { onEvent: i } = P(), [d, f] = c.useState(!1), p = m || l;
999
- c.useEffect(() => {
1000
- const C = Math.floor(o / 64) - 1, b = n.length + t.length;
1001
- C !== n.length && (s(p ? Math.max(C, 5) : 5), f(C >= b));
1002
- }, [o]);
1003
- const _ = () => {
1004
- f(!d), i(w.TRENDS_CLICK_VIEW_MORE, {
1005
- ...V
1034
+ ), bo = R(
1035
+ ({ availableHeight: t = 0, onCategoryClick: r }) => {
1036
+ const { collapsedCategories: n, visibleCategories: o, setVisibleListLength: s } = Ce(), { isLargeDesktop: h, isDesktop: g } = ee(), { trends: d } = H(), { onEvent: l } = V(), [m, p] = u.useState(!1), i = g || h;
1037
+ u.useEffect(() => {
1038
+ const f = Math.floor(t / 64) - 1, C = o.length + n.length;
1039
+ f !== o.length && (s(i ? Math.max(f, 5) : 5), p(f >= C));
1040
+ }, [t]);
1041
+ const b = () => {
1042
+ p(!m), l(I.TRENDS_CLICK_VIEW_MORE, {
1043
+ ...B
1006
1044
  });
1007
- }, u = n.length + (d ? t.length : 0);
1008
- return /* @__PURE__ */ e(S, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ y(Ut, { children: [
1009
- /* @__PURE__ */ e(S, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Pe, { children: h.categories }) }),
1010
- n.map((C, b) => /* @__PURE__ */ e(
1011
- Ve,
1045
+ }, c = o.length + (m ? n.length : 0);
1046
+ return /* @__PURE__ */ e(S, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ y($t, { children: [
1047
+ /* @__PURE__ */ e(S, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Ye, { children: d.categories }) }),
1048
+ o.map((f, C) => /* @__PURE__ */ e(
1049
+ Ke,
1012
1050
  {
1013
- ...C,
1014
- isLastItem: b === u - 1,
1015
- onClick: C.transactions.length > 0 ? () => a(C) : void 0,
1051
+ ...f,
1052
+ isLastItem: C === c - 1,
1053
+ onClick: f.transactions.length > 0 ? () => r(f) : void 0,
1016
1054
  showDivider: !0
1017
1055
  },
1018
- C.guid
1056
+ f.guid
1019
1057
  )),
1020
1058
  /* @__PURE__ */ e(
1021
- Yt,
1059
+ Pt,
1022
1060
  {
1023
- in: d,
1061
+ in: m,
1024
1062
  sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
1025
- children: t.map((C, b) => {
1026
- const g = n.length + b;
1063
+ children: n.map((f, C) => {
1064
+ const _ = o.length + C;
1027
1065
  return /* @__PURE__ */ e(
1028
- Ve,
1066
+ Ke,
1029
1067
  {
1030
- ...C,
1031
- isLastItem: g === u - 1,
1032
- onClick: C.transactions.length > 0 ? () => a(C) : void 0,
1068
+ ...f,
1069
+ isLastItem: _ === c - 1,
1070
+ onClick: f.transactions.length > 0 ? () => r(f) : void 0,
1033
1071
  showDivider: !0
1034
1072
  },
1035
- C.guid
1073
+ f.guid
1036
1074
  );
1037
1075
  })
1038
1076
  }
1039
1077
  ),
1040
- t.length > 0 && /* @__PURE__ */ e(vo, { isExpanded: d, onClick: _ })
1078
+ n.length > 0 && /* @__PURE__ */ e(_o, { isExpanded: m, onClick: b })
1041
1079
  ] }) });
1042
1080
  }
1043
- ), Do = ({ beats: o, onInsightCardClick: a }) => {
1044
- const { onEvent: t } = P(), { isMobile: n, isDesktop: s, isLargeDesktop: l } = J(), { beatStore: m, endpoint: h, sessionToken: i } = He(), d = s || l, f = d || n ? 1 : 2, p = () => null, _ = (E) => {
1045
- a?.(E), t(w.TRENDS_CLICK_INSIGHT, V);
1046
- }, u = d ? 200 : 170, C = d ? 170 : 124, b = d ? 56 : 0, g = o.length > 0 ? u + b : C, v = d && o.length > 0 ? u : void 0;
1047
- return /* @__PURE__ */ e(xt, { sx: { height: g }, children: /* @__PURE__ */ e(
1048
- Ot,
1081
+ ), To = ({ beats: t, onInsightCardClick: r }) => {
1082
+ const { onEvent: n } = V(), { isMobile: o, isDesktop: s, isLargeDesktop: h } = ee(), { beatStore: g, endpoint: d, sessionToken: l } = We(), m = s || h, p = m || o ? 1 : 2, i = () => null, b = (v) => {
1083
+ r?.(v), n(I.TRENDS_CLICK_INSIGHT, B);
1084
+ }, c = m ? 200 : 170, f = m ? 170 : 124, C = m ? 56 : 0, _ = t.length > 0 ? c + C : f, x = m && t.length > 0 ? c : void 0;
1085
+ return /* @__PURE__ */ e(Ut, { sx: { height: _ }, children: /* @__PURE__ */ e(
1086
+ Rt,
1049
1087
  {
1050
- areBeatsLoading: m.isLoading,
1051
- beats: o,
1052
- endpoint: h,
1053
- heightOverrides: v,
1054
- logOutUser: p,
1055
- onCardClick: _,
1088
+ areBeatsLoading: g.isLoading,
1089
+ beats: t,
1090
+ endpoint: d,
1091
+ heightOverrides: x,
1092
+ logOutUser: i,
1093
+ onCardClick: b,
1056
1094
  showBorder: !0,
1057
1095
  showCTAColocatedWithText: !1,
1058
1096
  showCarouselControls: !0,
1059
- showHeader: d,
1097
+ showHeader: m,
1060
1098
  showIcon: !0,
1061
1099
  showWithMargin: !1,
1062
- token: i,
1100
+ token: l,
1063
1101
  userHasFullInsightFeedBeats: !1,
1064
1102
  variant: "outlined",
1065
- visibleCardsCount: f
1103
+ visibleCardsCount: p
1066
1104
  }
1067
1105
  ) });
1068
- }, Lo = R(Do), Eo = R(({ chartLabel: o, chartColor: a }) => {
1069
- const { onEvent: t } = P(), {
1070
- categoryDetailsChartData: { monthlyAmounts: n, tooltipLabels: s }
1106
+ }, So = R(To), xo = R(({ chartLabel: t, chartColor: r }) => {
1107
+ const { onEvent: n } = V(), {
1108
+ categoryDetailsChartData: { monthlyAmounts: o, tooltipLabels: s }
1071
1109
  } = Ce();
1072
1110
  return /* @__PURE__ */ e(S, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
1073
- Ne,
1111
+ Oe,
1074
1112
  {
1075
1113
  baseline: "min",
1076
- colors: [a],
1114
+ colors: [r],
1077
1115
  curveType: "bump",
1078
1116
  customTooltipLabels: s,
1079
- datasets: [n],
1117
+ datasets: [o],
1080
1118
  height: 265,
1081
- labels: [o],
1119
+ labels: [t],
1082
1120
  markStyles: () => ({
1083
- stroke: a
1121
+ stroke: r
1084
1122
  }),
1085
1123
  onItemClick: () => {
1086
- t(w.TRENDS_CLICK_CHART, V);
1124
+ n(I.TRENDS_CLICK_CHART, B);
1087
1125
  },
1088
1126
  showArea: !0,
1089
1127
  showAverage: !0,
@@ -1098,100 +1136,100 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
1098
1136
  valueFormatterString: "0,0"
1099
1137
  }
1100
1138
  ) });
1101
- }), Io = R(({ onClose: o }) => {
1102
- const a = ue(), { onEvent: t } = P(), { common: n, trends: s } = O(), { selectedCategoryData: l, selectedDateRangeMonthRange: m } = Ce(), { sortedTransactions: h } = De(), [i, d] = c.useState(null);
1103
- if (!l)
1139
+ }), vo = R(({ onClose: t }) => {
1140
+ const r = nt(), { onEvent: n } = V(), { common: o, trends: s } = H(), { selectedCategoryData: h, selectedDateRangeMonthRange: g } = Ce(), { sortedTransactions: d } = xe(), [l, m] = u.useState(null);
1141
+ if (!h)
1104
1142
  return null;
1105
- const { guid: f, name: p, is_income: _, totalAmount: u } = l, C = _ ? s.category_income : s.category_spending, b = eo(f, a), g = _ ? s.income_label : s.spending_label, v = ` ${l.transactions.length === 1 ? s.transaction : s.transactions} (${l.transactions.length})`, E = c.useMemo(
1106
- () => h.find((M) => M.guid === i),
1107
- [i, h]
1108
- ), I = (M) => M.category_guid === f || M.top_level_category_guid === f, x = () => {
1109
- o?.(), t(w.TRENDS_CLICK_BACK, V);
1143
+ const { guid: p, name: i, is_income: b, totalAmount: c } = h, f = b ? s.category_income : s.category_spending, C = Zt(p, r), _ = b ? s.income_label : s.spending_label, x = ` ${h.transactions.length === 1 ? s.transaction : s.transactions} (${h.transactions.length})`, v = u.useMemo(
1144
+ () => d.find((L) => L.guid === l),
1145
+ [l, d]
1146
+ ), D = (L) => L.category_guid === p || L.top_level_category_guid === p, M = () => {
1147
+ t?.(), n(I.TRENDS_CLICK_BACK, B);
1110
1148
  };
1111
1149
  return /* @__PURE__ */ y(
1112
- ke,
1150
+ Ne,
1113
1151
  {
1114
1152
  ariaLabelClose: s.close_category_details,
1115
1153
  isOpen: !0,
1116
- onClose: x,
1154
+ onClose: M,
1117
1155
  shouldShowHeaderShadow: !0,
1118
- title: C,
1156
+ title: f,
1119
1157
  children: [
1120
1158
  /* @__PURE__ */ y(S, { sx: { alignItems: "center", height: "100%" }, children: [
1121
- /* @__PURE__ */ y(Jt, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
1159
+ /* @__PURE__ */ y(Xt, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
1122
1160
  /* @__PURE__ */ e(
1123
- Ke,
1161
+ Qe,
1124
1162
  {
1125
- leftIcon: /* @__PURE__ */ e(we, { categoryGuid: f }),
1126
- rightContent: oe(Math.abs(u), "0,0.00"),
1127
- subtitle: m,
1128
- title: p
1163
+ leftIcon: /* @__PURE__ */ e(Se, { categoryGuid: p }),
1164
+ rightContent: se(Math.abs(c), "0,0.00"),
1165
+ subtitle: g,
1166
+ title: i
1129
1167
  }
1130
1168
  ),
1131
- /* @__PURE__ */ e(Eo, { chartColor: b, chartLabel: g }),
1169
+ /* @__PURE__ */ e(xo, { chartColor: C, chartLabel: _ }),
1132
1170
  /* @__PURE__ */ y(S, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
1133
- /* @__PURE__ */ e(z, { bold: !0, variant: "body1", children: v }),
1134
- /* @__PURE__ */ e(to, { filter: I })
1171
+ /* @__PURE__ */ e(P, { bold: !0, variant: "body1", children: x }),
1172
+ /* @__PURE__ */ e(Qt, { filter: D })
1135
1173
  ] })
1136
1174
  ] }),
1137
1175
  /* @__PURE__ */ e(
1138
- Ze,
1176
+ ot,
1139
1177
  {
1140
1178
  bgcolor: "transparent",
1141
- filter: I,
1179
+ filter: D,
1142
1180
  height: "calc(100vh - 475px)",
1143
- onClick: d
1181
+ onClick: m
1144
1182
  }
1145
1183
  )
1146
1184
  ] }),
1147
1185
  /* @__PURE__ */ e(
1148
- ke,
1186
+ Ne,
1149
1187
  {
1150
- ariaLabelClose: n.close_aria,
1151
- isOpen: !!E,
1152
- onClose: () => d(""),
1188
+ ariaLabelClose: o.close_aria,
1189
+ isOpen: !!v,
1190
+ onClose: () => m(""),
1153
1191
  title: s.transaction,
1154
- children: E && /* @__PURE__ */ e(Xe, { transaction: E })
1192
+ children: v && /* @__PURE__ */ e(tt, { transaction: v })
1155
1193
  }
1156
1194
  )
1157
1195
  ]
1158
1196
  }
1159
1197
  );
1160
- }), Mo = (o, a) => {
1161
- const t = je(o, a), n = Ye(o, a);
1162
- return [t, n].filter((s) => s.length > 0);
1163
- }, Ao = (o, a) => {
1164
- const [t, n] = o, s = t, l = n ?? t, m = [];
1198
+ }), wo = (t, r) => {
1199
+ const n = Je(t, r), o = qe(t, r);
1200
+ return [n, o].filter((s) => s.length > 0);
1201
+ }, Io = (t, r) => {
1202
+ const [n, o] = t, s = n, h = o ?? n, g = [];
1165
1203
  if (s) {
1166
- const h = s.reduce((i, d) => i + d.y, 0);
1167
- m.push({ label: a.income_label, amount: h });
1204
+ const d = s.reduce((l, m) => l + m.y, 0);
1205
+ g.push({ label: r.income_label, amount: d });
1168
1206
  }
1169
- if (l) {
1170
- const h = l.reduce((i, d) => i + d.y, 0);
1171
- m.push({ label: a.spending_label, amount: h });
1207
+ if (h) {
1208
+ const d = h.reduce((l, m) => l + m.y, 0);
1209
+ g.push({ label: r.spending_label, amount: d });
1172
1210
  }
1173
- return m;
1174
- }, Ro = ({
1175
- availableHeight: o = 0,
1176
- minHeight: a = 500,
1177
- selectedDateRange: t,
1178
- totals: n
1211
+ return g;
1212
+ }, Lo = ({
1213
+ availableHeight: t = 0,
1214
+ minHeight: r = 500,
1215
+ selectedDateRange: n,
1216
+ totals: o
1179
1217
  }) => {
1180
- const s = ue(), { onEvent: l } = P(), { trends: m } = O(), { isSmallMobile: h, isMobile: i, isSmallTablet: d, isTablet: f } = J(), p = [s.palette.chart?.chart1, s.palette.chart?.chart2], _ = Mo(n, t), u = Ao(_, m), [C, b] = c.useState(0), g = 458, v = 195, E = 56, I = i || h ? v : d || f ? g : C;
1181
- return c.useEffect(() => {
1182
- const M = Math.max(o - E, a);
1183
- b(M);
1184
- }, [o]), /* @__PURE__ */ e(
1185
- Ne,
1218
+ const s = ce(), { onEvent: h } = V(), { trends: g } = H(), { isSmallMobile: d, isMobile: l, isSmallTablet: m, isTablet: p } = ee(), i = [s.palette.chart?.chart1, s.palette.chart?.chart2], b = wo(o, n), c = Io(b, g), [f, C] = u.useState(0), _ = 458, x = 195, v = 56, D = l || d ? x : m || p ? _ : f;
1219
+ return u.useEffect(() => {
1220
+ const L = Math.max(t - v, r);
1221
+ C(L);
1222
+ }, [t]), /* @__PURE__ */ e(
1223
+ Oe,
1186
1224
  {
1187
1225
  baseline: "min",
1188
- colors: p,
1226
+ colors: i,
1189
1227
  curveType: "bump",
1190
- datasets: _,
1191
- height: I,
1192
- labels: u,
1228
+ datasets: b,
1229
+ height: D,
1230
+ labels: c,
1193
1231
  onItemClick: () => {
1194
- l(w.TRENDS_CLICK_CHART, V);
1232
+ h(I.TRENDS_CLICK_CHART, B);
1195
1233
  },
1196
1234
  showArea: !0,
1197
1235
  showAxisHighlight: !0,
@@ -1204,7 +1242,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
1204
1242
  valueFormatterString: "0.0a"
1205
1243
  }
1206
1244
  );
1207
- }, ko = R(Ro), Ho = [
1245
+ }, Eo = R(Lo), Do = [
1208
1246
  "BillAmountNotStandard",
1209
1247
  "CategorySpendingV2",
1210
1248
  "CostOfLivingToIncome",
@@ -1238,105 +1276,113 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
1238
1276
  "WeeklyNewMerchantsV2",
1239
1277
  "WeeklyNoSpendDays",
1240
1278
  "WeeklySmallPurchasesSummary"
1241
- ], No = ({ onBackClick: o, onInsightCardClick: a, sx: t }) => {
1242
- const { onEvent: n } = P(), { onLoad: s } = yt(), { config: l } = Ct(), { isLargeDesktop: m, isDesktop: h, isMobile: i } = J(), { isAccountDataLoaded: d, loadAccountData: f, visibleAccounts: p } = Le(), {
1243
- categoriesLoaded: _,
1244
- loadCategories: u,
1245
- loadDateRangeCategoryTotals: C,
1246
- loadMonthlyCategoryTotals: b,
1247
- monthlyCategoryTotals: g
1248
- } = Y(), { isTransactionDataLoaded: v, loadTransactionData: E, setFilter: I } = De(), { selectedDateRange: x, setSelectedCategoryData: M, setSelectedDateRange: k } = Ce(), { isInitialized: A, selectedAccounts: G, selectedAccountGuids: ee, setSelectedAccounts: ne } = ye(), { trends: H, connect: he } = O(), { beatStore: B } = He(), ae = oo() && l.show_insights_widget_in_master, $ = h || m, [_e, U] = c.useState(!1), [K, re] = c.useState(!1), [X, Z] = c.useState("Chart"), [te, ie] = c.useState(""), [ge, ce] = c.useState(!1), [le, D] = c.useState(window.innerHeight), r = $ ? 56 : 0, T = le - 208, L = le - (ae ? 550 + r : 266), [j, Te] = c.useState(!1), Ee = l.show_connections_widget_in_master ? "buttons" : "no-buttons", de = c.useMemo(
1249
- () => p && p.length === 0 || g.length === 0,
1250
- [p, g]
1251
- ), be = c.useMemo(() => K ? B.getFilteredBeats({ templates: Ho }) : [], [K]);
1252
- c.useEffect(() => {
1253
- const N = () => D(window.innerHeight);
1254
- return window.addEventListener("resize", N), d || f().finally(), _ || u().finally(), v || E().finally(), () => window.removeEventListener("resize", N);
1255
- }, []), c.useEffect(() => {
1256
- ne(p);
1257
- }, [p]), c.useEffect(() => {
1258
- A && (B.loadBeats().finally(() => re(!0)), C(G, x.start, x.end).then(() => {
1259
- b(
1260
- G,
1261
- x.start,
1262
- x.end
1263
- );
1264
- }).finally(() => {
1265
- U(!0), n(w.TRENDS_LOAD_WIDGET, {
1266
- ...V,
1267
- time_period: `${Ae(x.end, x.start)}M`
1268
- }), s?.("TrendsWidget");
1269
- }));
1270
- }, [A, G, x]), c.useEffect(() => {
1271
- if (g.length !== 0) {
1279
+ ], Mo = ({ onBackClick: t, onInsightCardClick: r, sx: n }) => {
1280
+ const { onEvent: o } = V(), { config: s } = bt(), { isLargeDesktop: h, isDesktop: g, isMobile: d } = ee(), { visibleAccounts: l } = ve(), { loadDateRangeCategoryTotals: m, loadMonthlyCategoryTotals: p, monthlyCategoryTotals: i } = $(), { setFilter: b } = xe(), { selectedDateRange: c, setSelectedCategoryData: f, setSelectedDateRange: C } = Ce(), {
1281
+ isCopyLoaded: _,
1282
+ isInitialized: x,
1283
+ selectedAccounts: v,
1284
+ selectedAccountGuids: D,
1285
+ setSelectedAccounts: M
1286
+ } = pe(), { trends: L, connect: A } = H(), { beatStore: te } = We(), F = qt() && s.show_insights_widget_in_master, z = g || h, [X, fe] = u.useState(!1), [oe, re] = u.useState(!1), [Z, le] = u.useState("Chart"), [ne, K] = u.useState(""), [ae, Q] = u.useState(!1), [ie, q] = u.useState(window.innerHeight), w = z ? 56 : 0, O = ie - 208, Y = ie - (F ? 550 + w : 266), [de, ye] = u.useState(!1), Ie = s.show_connections_widget_in_master ? "buttons" : "no-buttons", a = u.useMemo(
1287
+ () => l && l.length === 0 || i.length === 0,
1288
+ [l, i]
1289
+ );
1290
+ we({
1291
+ widgetName: "TrendsWidget",
1292
+ isLoaded: X
1293
+ }), u.useEffect(() => {
1294
+ x && te.loadBeats().finally(() => re(!0));
1295
+ }, [x]);
1296
+ const T = u.useMemo(() => oe ? te.getFilteredBeats({ templates: Do }) : [], [oe]);
1297
+ u.useEffect(() => {
1298
+ const N = () => q(window.innerHeight);
1299
+ return window.addEventListener("resize", N), () => window.removeEventListener("resize", N);
1300
+ }, []), u.useEffect(() => {
1301
+ M(l);
1302
+ }, [l]), u.useEffect(() => {
1303
+ x && Promise.all([
1304
+ m(
1305
+ v,
1306
+ c.start,
1307
+ c.end
1308
+ ),
1309
+ p(v, c.start, c.end)
1310
+ ]).finally(() => {
1311
+ fe(!0), o(I.TRENDS_LOAD_WIDGET, {
1312
+ ...B,
1313
+ time_period: `${Re(c.end, c.start)}M`
1314
+ });
1315
+ });
1316
+ }, [x, v, c]), u.useEffect(() => {
1317
+ if (i.length !== 0) {
1272
1318
  const N = {
1273
- accounts: ee,
1274
- dateRange: { start: x.start, end: x.end }
1319
+ accounts: D,
1320
+ dateRange: { start: c.start, end: c.end }
1275
1321
  };
1276
- I({
1322
+ b({
1277
1323
  ...N,
1278
- custom: (q) => !!g.find(
1279
- (me) => me.top_level_category_guid === q.top_level_category_guid || me.category_guid === q.category_guid
1324
+ custom: (J) => !!i.find(
1325
+ (he) => he.top_level_category_guid === J.top_level_category_guid || he.category_guid === J.category_guid
1280
1326
  )
1281
1327
  });
1282
1328
  }
1283
- }, [g]);
1284
- const Ie = (N) => {
1285
- M(N), ce(!0);
1286
- }, tt = () => {
1287
- M(null), ce(!1);
1288
- }, ot = () => {
1289
- Te(!0), n(w.TRENDS_CLICK_CONNECT_ACCOUNTS);
1290
- }, nt = (N, q) => {
1291
- Z(q ?? X), n(w.TRENDS_CLICK_TOGGLE_VIEW, {
1292
- ...V,
1293
- toggleView: q
1329
+ }, [i]);
1330
+ const E = (N) => {
1331
+ f(N), Q(!0);
1332
+ }, j = () => {
1333
+ f(null), Q(!1);
1334
+ }, Le = () => {
1335
+ ye(!0), o(I.TRENDS_CLICK_CONNECT_ACCOUNTS);
1336
+ }, Ee = (N, J) => {
1337
+ le(J ?? Z), o(I.TRENDS_CLICK_TOGGLE_VIEW, {
1338
+ ...B,
1339
+ toggleView: J
1294
1340
  });
1295
- }, st = (N) => {
1296
- const q = Fe(N?.[0], 1), me = N?.[1], ct = Ae(me, q);
1297
- k({ start: q, end: me }), n(w.TRENDS_CLICK_TIME_WINDOW, {
1298
- ...V,
1299
- time_period: ct + "M"
1341
+ }, ue = (N) => {
1342
+ const J = je(N?.[0], 1), he = N?.[1], lt = Re(he, J);
1343
+ C({ start: J, end: he }), o(I.TRENDS_CLICK_TIME_WINDOW, {
1344
+ ...B,
1345
+ time_period: lt + "M"
1300
1346
  });
1301
- }, at = (N) => {
1302
- n(w.TRENDS_CLICK_FILTER, {
1303
- ...V,
1347
+ }, De = (N) => {
1348
+ o(I.TRENDS_CLICK_FILTER, {
1349
+ ...B,
1304
1350
  filterValue: N
1305
1351
  });
1306
- }, rt = (N) => {
1307
- ie(N);
1308
- }, it = () => {
1309
- ie(""), n(w.TRENDS_CLICK_ALL_CATEGORIES, V);
1352
+ }, Me = (N) => {
1353
+ K(N);
1354
+ }, ct = () => {
1355
+ K(""), o(I.TRENDS_CLICK_ALL_CATEGORIES, B);
1310
1356
  };
1311
- return !A || !_e ? /* @__PURE__ */ e(fe, {}) : /* @__PURE__ */ y(
1312
- Ue,
1357
+ return !_ || !X ? /* @__PURE__ */ e(me, {}) : /* @__PURE__ */ y(
1358
+ et,
1313
1359
  {
1314
- accountOptions: p,
1315
- calendarActions: { onRangeChanged: st },
1316
- dateRange: x,
1317
- dateRangeVariant: i ? "timeframetabs" : "timeframebuttons",
1318
- onAccountsFilterClick: at,
1319
- onBackClick: o,
1320
- sx: t,
1321
- title: H.title,
1360
+ accountOptions: l,
1361
+ calendarActions: { onRangeChanged: ue },
1362
+ dateRange: c,
1363
+ dateRangeVariant: d ? "timeframetabs" : "timeframebuttons",
1364
+ onAccountsFilterClick: De,
1365
+ onBackClick: t,
1366
+ sx: n,
1367
+ title: L.title,
1322
1368
  children: [
1323
- de && /* @__PURE__ */ e(
1324
- no,
1369
+ a && /* @__PURE__ */ e(
1370
+ Jt,
1325
1371
  {
1326
- header: H.zero_state_content_header,
1372
+ header: L.zero_state_content_header,
1327
1373
  icon: "",
1328
- onClick: ot,
1329
- primaryButton: H.empty_state_primary,
1330
- subText: H.empty_state_sub_text,
1331
- sx: { height: T },
1332
- variant: Ee
1374
+ onClick: Le,
1375
+ primaryButton: L.empty_state_primary,
1376
+ subText: L.empty_state_sub_text,
1377
+ sx: { height: O },
1378
+ variant: Ie
1333
1379
  }
1334
1380
  ),
1335
- !de && /* @__PURE__ */ y(
1381
+ !a && /* @__PURE__ */ y(
1336
1382
  S,
1337
1383
  {
1338
1384
  sx: {
1339
- px: i ? 0 : 48
1385
+ px: d ? 0 : 48
1340
1386
  },
1341
1387
  children: [
1342
1388
  /* @__PURE__ */ y(
@@ -1344,82 +1390,81 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
1344
1390
  {
1345
1391
  flexDirection: "row",
1346
1392
  justifyContent: "space-between",
1347
- sx: { pb: i ? 12 : 24, pt: i ? 24 : 48 },
1393
+ sx: { pb: d ? 12 : 24, pt: d ? 24 : 48 },
1348
1394
  children: [
1349
1395
  /* @__PURE__ */ e(
1350
- Je,
1396
+ at,
1351
1397
  {
1352
- selectedCategoryGuid: te,
1353
- selectedDateRange: x
1398
+ selectedCategoryGuid: ne,
1399
+ selectedDateRange: c
1354
1400
  }
1355
1401
  ),
1356
- /* @__PURE__ */ e(Qe, { onTabChange: nt, selectedTab: X })
1402
+ /* @__PURE__ */ e(rt, { onTabChange: Ee, selectedTab: Z })
1357
1403
  ]
1358
1404
  }
1359
1405
  ),
1360
- /* @__PURE__ */ e(S, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(W, { flexGrow: 1, children: te && /* @__PURE__ */ y(xe, { onClick: it, sx: { p: 0, pr: 5 }, children: [
1361
- /* @__PURE__ */ e(Se, { name: "arrow_back" }),
1362
- H.all_categories
1406
+ /* @__PURE__ */ e(S, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(k, { flexGrow: 1, children: ne && /* @__PURE__ */ y(be, { onClick: ct, sx: { p: 0, pr: 5 }, children: [
1407
+ /* @__PURE__ */ e(_e, { name: "arrow_back" }),
1408
+ L.all_categories
1363
1409
  ] }) }) }),
1364
- /* @__PURE__ */ y(S, { flexDirection: $ ? "row" : "column", gap: $ ? 48 : 16, children: [
1365
- X === "Chart" && /* @__PURE__ */ y(lt, { children: [
1366
- /* @__PURE__ */ e(W, { sx: { width: $ ? "68%" : "100%" }, children: /* @__PURE__ */ e(
1367
- ko,
1410
+ /* @__PURE__ */ y(S, { flexDirection: z ? "row" : "column", gap: z ? 48 : 16, children: [
1411
+ Z === "Chart" && /* @__PURE__ */ y(dt, { children: [
1412
+ /* @__PURE__ */ e(k, { sx: { width: z ? "68%" : "100%" }, children: /* @__PURE__ */ e(
1413
+ Eo,
1368
1414
  {
1369
- availableHeight: T,
1415
+ availableHeight: O,
1370
1416
  minHeight: 450,
1371
- selectedDateRange: x,
1372
- totals: g
1417
+ selectedDateRange: c,
1418
+ totals: i
1373
1419
  }
1374
1420
  ) }),
1375
- /* @__PURE__ */ y(S, { gap: 16, sx: { width: $ ? "32%" : "100%" }, children: [
1376
- ae && K && be.length > 0 && /* @__PURE__ */ e(
1377
- Lo,
1421
+ /* @__PURE__ */ y(S, { gap: 16, sx: { width: z ? "32%" : "100%" }, children: [
1422
+ F && oe && T.length > 0 && /* @__PURE__ */ e(
1423
+ So,
1378
1424
  {
1379
- beats: be,
1380
- onInsightCardClick: a
1425
+ beats: T,
1426
+ onInsightCardClick: r
1381
1427
  }
1382
1428
  ),
1383
1429
  /* @__PURE__ */ e(
1384
- wo,
1430
+ bo,
1385
1431
  {
1386
- availableHeight: L,
1387
- onCategoryClick: Ie
1432
+ availableHeight: Y,
1433
+ onCategoryClick: E
1388
1434
  }
1389
1435
  )
1390
1436
  ] })
1391
1437
  ] }),
1392
- X === "Table" && /* @__PURE__ */ e(W, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
1393
- et,
1438
+ Z === "Table" && /* @__PURE__ */ e(k, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
1439
+ it,
1394
1440
  {
1395
1441
  height: "unset",
1396
- monthlyCategoryTotals: g,
1397
- onClickRow: rt,
1398
- selectedCategory: te,
1399
- selectedDateRange: x
1442
+ onClickRow: Me,
1443
+ selectedCategory: ne,
1444
+ selectedDateRange: c
1400
1445
  }
1401
1446
  ) })
1402
1447
  ] }),
1403
- ge && /* @__PURE__ */ e(Io, { onClose: tt })
1448
+ ae && /* @__PURE__ */ e(vo, { onClose: j })
1404
1449
  ]
1405
1450
  }
1406
1451
  ),
1407
1452
  /* @__PURE__ */ e(
1408
- so,
1453
+ eo,
1409
1454
  {
1410
- onClose: () => Te(!1),
1411
- showConnectWidget: j,
1412
- title: he.mini_title
1455
+ onClose: () => ye(!1),
1456
+ showConnectWidget: de,
1457
+ title: A.mini_title
1413
1458
  }
1414
1459
  )
1415
1460
  ]
1416
1461
  }
1417
1462
  );
1418
- }, Gn = R(No);
1463
+ }, Gn = R(Mo);
1419
1464
  export {
1420
1465
  Nn as TrendsFullWidget,
1421
1466
  On as TrendsMicroWidget,
1422
1467
  Wn as TrendsMiniWidget,
1423
- Pn as TrendsStore,
1468
+ Fn as TrendsStore,
1424
1469
  Gn as TrendsWidget
1425
1470
  };