@mx-cartographer/experiences 7.10.34 → 7.10.35

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 (56) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/{AccountDetailsHeader-B3EIxwA1.mjs → AccountDetailsHeader-DEgT29Bs.mjs} +3 -3
  3. package/dist/{AccountFields-9vXdZkDs.mjs → AccountFields-DcRpcZX7.mjs} +1 -1
  4. package/dist/{AccountListItem-DCAz4UyZ.mjs → AccountListItem-BSWdNVzS.mjs} +3 -3
  5. package/dist/{BudgetUtil-CHDuDNhl.mjs → BudgetUtil-C71e-szt.mjs} +1 -1
  6. package/dist/{CategorySelectorDrawer-CW0bCdqR.mjs → CategorySelectorDrawer-DpC8T96X.mjs} +1 -1
  7. package/dist/{ConnectionsDrawer-uWuM7QfF.mjs → ConnectionsDrawer-CEfYXsP_.mjs} +2 -2
  8. package/dist/{CurrencyInput-6U2Ln1bK.mjs → CurrencyInput-PMOAH5R3.mjs} +1 -1
  9. package/dist/{ExportCsvAction-BqNTIBjm.mjs → ExportCsvAction-B5Ra5duE.mjs} +3 -3
  10. package/dist/{GlobalAccountFilter-CjTLppI0.mjs → GlobalAccountFilter-Cun09DE7.mjs} +1 -1
  11. package/dist/{GoalStore-ZZir5h81.mjs → GoalStore-dGCnbRfR.mjs} +1 -1
  12. package/dist/{Help-CFklNYUZ.mjs → Help-HjHBZzI9.mjs} +1 -1
  13. package/dist/{LineChart-BDTOgWUr.mjs → LineChart-Dlp9RAJz.mjs} +1 -1
  14. package/dist/{ListItemAction-DrDDQgt7.mjs → ListItemAction-Dq1lMdxh.mjs} +1 -1
  15. package/dist/{ManageIncome-CWQoWlbs.mjs → ManageIncome-B9Vn7R6W.mjs} +4 -4
  16. package/dist/{MicroWidgetContainer-Cg0wb2gg.mjs → MicroWidgetContainer-jvYZ5bb6.mjs} +1 -1
  17. package/dist/{MiniWidgetContainer-BPuE3cfO.mjs → MiniWidgetContainer-B4gbUTJ2.mjs} +1 -1
  18. package/dist/{NotificationSettings-LGpq5WOf.mjs → NotificationSettings-CgtRBUXP.mjs} +4 -4
  19. package/dist/{OriginalBalanceAction-DPz07HNS.mjs → OriginalBalanceAction-CBZ_YHmB.mjs} +3 -3
  20. package/dist/{RecurringSettings-BapZfEnY.mjs → RecurringSettings-DnNTBGD7.mjs} +2 -2
  21. package/dist/{SpendingLegend-Ck4J3XvH.mjs → SpendingLegend-D91UDDIu.mjs} +1 -1
  22. package/dist/{Transaction-BiOMLCAA.mjs → Transaction-BNO5Yz-B.mjs} +1 -1
  23. package/dist/{TransactionDetails-c7ncR7HI.mjs → TransactionDetails-9cwzBxvP.mjs} +5 -5
  24. package/dist/{TransactionList-CmZSDhKW.mjs → TransactionList-DrtItQUk.mjs} +2 -2
  25. package/dist/{TransactionStore-DoBXsvqm.mjs → TransactionStore-DYXYuq5s.mjs} +2 -2
  26. package/dist/{ViewMoreMicroCard-DTZOxZ6a.mjs → ViewMoreMicroCard-BCYgXtiG.mjs} +1 -1
  27. package/dist/{WidgetContainer-W9s0Jt3H.mjs → WidgetContainer-BSrpqh6M.mjs} +2 -2
  28. package/dist/accounts/index.es.js +15 -15
  29. package/dist/analytics/index.es.js +2 -2
  30. package/dist/budgets/index.es.js +12 -12
  31. package/dist/cashflow/index.es.js +8 -8
  32. package/dist/categories/index.es.js +1 -1
  33. package/dist/common/index.es.js +18 -18
  34. package/dist/dashboard/index.es.js +3 -3
  35. package/dist/debts/index.es.js +8 -8
  36. package/dist/{exportTransactionsToCSV-YO3xewit.mjs → exportTransactionsToCSV-DC2YMFft.mjs} +1 -1
  37. package/dist/finstrong/index.es.js +11 -11
  38. package/dist/goals/index.es.js +10 -10
  39. package/dist/help/index.es.js +4 -4
  40. package/dist/{hooks-DWJQ4phS.mjs → hooks-0kWPTHNb.mjs} +7 -7
  41. package/dist/insights/index.es.js +3 -3
  42. package/dist/investments/index.es.js +4 -4
  43. package/dist/merchants/index.es.js +1 -1
  44. package/dist/microinsights/index.es.js +1 -1
  45. package/dist/networth/index.es.js +6 -6
  46. package/dist/notifications/index.es.js +2 -2
  47. package/dist/recurringtransactions/index.es.js +9 -9
  48. package/dist/settings/index.es.js +7 -7
  49. package/dist/spending/index.es.js +8 -8
  50. package/dist/transactions/index.es.js +16 -16
  51. package/dist/trends/components/trendstable/AccessibleSortIcon.d.ts +13 -0
  52. package/dist/trends/index.es.js +465 -426
  53. package/dist/{useAccountDisplayName-Ces0fqkF.mjs → useAccountDisplayName-BQfelpG3.mjs} +1 -1
  54. package/dist/{useInsightsEnabled-B4AlxgOP.mjs → useInsightsEnabled-bDCTNOJS.mjs} +1 -1
  55. package/dist/{useWidgetLoadTimer-BbV8q0k6.mjs → useWidgetLoadTimer-yzSfT9dS.mjs} +1 -1
  56. package/package.json +1 -1
@@ -1,66 +1,68 @@
1
1
  import { jsxs as C, jsx as e, Fragment as St } from "react/jsx-runtime";
2
2
  import g, { useRef as wt, useState as xt, useEffect as vt } from "react";
3
3
  import { observer as M } from "mobx-react-lite";
4
- import { CategoryIcon as ve, Text as Q, Icon as He, H3 as Oe, P as ye, ChevronRightIcon as Dt } from "@mxenabled/mxui";
4
+ import { CategoryIcon as ve, Text as Q, Icon as Ne, H3 as Oe, P as ye, ChevronRightIcon as Dt } from "@mxenabled/mxui";
5
5
  import W from "@mui/material/Box";
6
- import w from "@mui/material/Stack";
6
+ import x from "@mui/material/Stack";
7
7
  import Se from "@mui/material/Button";
8
8
  import { addSeconds as qe } from "date-fns/addSeconds";
9
9
  import { differenceInCalendarMonths as we } from "date-fns/differenceInCalendarMonths";
10
- import Lt from "numeral";
11
- import { useTheme as de } from "@mui/material/styles";
12
- import { useItemTooltip as It, ChartsTooltipContainer as Et } from "@mui/x-charts/ChartsTooltip";
13
- import { LineChart as Mt } from "@mui/x-charts/LineChart";
10
+ import It from "numeral";
11
+ import { useTheme as de, styled as Lt } from "@mui/material/styles";
12
+ import { useItemTooltip as Et, ChartsTooltipContainer as Mt } from "@mui/x-charts/ChartsTooltip";
13
+ import { LineChart as At } from "@mui/x-charts/LineChart";
14
14
  import { u as q } from "../useScreenSize-B6JyS_Lj.mjs";
15
- import { u as At } from "../useDimensions-CeDR9V8N.mjs";
15
+ import { u as Rt } from "../useDimensions-CeDR9V8N.mjs";
16
16
  import Je from "@mui/material/Card";
17
17
  import et from "@mui/material/CardContent";
18
- import Ne from "@mui/material/Divider";
18
+ import He from "@mui/material/Divider";
19
19
  import Ve from "@mui/material/Grid";
20
- import { u as A, m as J, g as z, b as Ce, h as De, d as Le, v as _e, p as tt, f as Ge, a as ot } from "../hooks-DWJQ4phS.mjs";
20
+ import { u as A, m as J, g as $, b as Ce, h as De, d as Ie, B as _e, p as tt, f as Ge, a as ot } from "../hooks-0kWPTHNb.mjs";
21
21
  import { b as nt } from "../Localization-2MODESHW.mjs";
22
22
  import { C as xe } from "../CurrencyText-C-85TnUF.mjs";
23
- import { C as Re, b as Fe, c as Rt } from "../Category-CevNQ03n.mjs";
23
+ import { C as Re, b as Fe, c as kt } from "../Category-CevNQ03n.mjs";
24
24
  import { f as Z, D as B } from "../DateFormats-Cs-NbEZ7.mjs";
25
- import { f as oe, a as kt } from "../NumberFormatting-DjTD0t3W.mjs";
26
- import { c as Ht, a as ze, g as Nt, L as st } from "../TrendsStore-Ys6BY_Uo.mjs";
27
- import { T as es } from "../TrendsStore-Ys6BY_Uo.mjs";
28
- import { c as Wt, i as Ot, d as Gt, e as Bt, b as rt, g as at, f as $e } from "../SpendingData-C3bN-37j.mjs";
29
- import Pt from "@mui/material/ToggleButton";
30
- import Vt from "@mui/material/ToggleButtonGroup";
25
+ import { f as oe, a as Nt } from "../NumberFormatting-DjTD0t3W.mjs";
26
+ import { c as Ht, a as $e, g as Wt, L as st } from "../TrendsStore-Ys6BY_Uo.mjs";
27
+ import { T as ds } from "../TrendsStore-Ys6BY_Uo.mjs";
28
+ import { c as Ot, i as Gt, d as Bt, e as Pt, b as rt, g as at, f as ze } from "../SpendingData-C3bN-37j.mjs";
29
+ import Vt from "@mui/material/ToggleButton";
30
+ import Ft from "@mui/material/ToggleButtonGroup";
31
31
  import { parseISO as it } from "date-fns/parseISO";
32
32
  import { H as ke } from "../HeaderCell-DjuifqHJ.mjs";
33
- import { T as G, b as Ft } from "../ViewMoreMicroCard-DTZOxZ6a.mjs";
34
- import { DataGridPro as zt } from "@mui/x-data-grid-pro";
33
+ import { T as G, b as $t } from "../ViewMoreMicroCard-BCYgXtiG.mjs";
34
+ import { useGridApiContext as zt, useGridRootProps as Kt, DataGridPro as Yt } from "@mui/x-data-grid-pro";
35
+ import jt from "@mui/material/Badge";
36
+ import Ut from "@mui/material/IconButton";
35
37
  import { A as v } from "../Analytics-i5h6BxR1.mjs";
36
- import { T as lt } from "../TransactionList-CmZSDhKW.mjs";
37
- import { T as ct } from "../TransactionDetails-c7ncR7HI.mjs";
38
+ import { T as lt } from "../TransactionList-DrtItQUk.mjs";
39
+ import { T as ct } from "../TransactionDetails-9cwzBxvP.mjs";
38
40
  import { D as We } from "../Drawer-DV4NTsFg.mjs";
39
- import { u as Ie } from "../useWidgetLoadTimer-BbV8q0k6.mjs";
41
+ import { u as Le } from "../useWidgetLoadTimer-yzSfT9dS.mjs";
40
42
  import { L as Ee } from "../Loader-D3rjKx72.mjs";
41
- import { W as dt } from "../WidgetContainer-W9s0Jt3H.mjs";
42
- import { L as Be } from "../LineChart-BDTOgWUr.mjs";
43
- import { M as $t } from "../MiniWidgetContainer-BPuE3cfO.mjs";
44
- import { subMonths as Kt } from "date-fns";
45
- import { TrendingUp as Yt, TrendingDown as jt, MultilineChart as Ut, ExpandLess as Xt, ExpandMore as Zt, ArrowBack as Qt } from "@mxenabled/mx-icons";
46
- import { M as qt } from "../MicroWidgetContainer-Cg0wb2gg.mjs";
47
- import Jt from "@mui/material/Collapse";
48
- import eo from "@mui/material/List";
49
- import to from "@mui/material/ListItem";
50
- import oo from "@mui/material/ListItemButton";
51
- import no from "@mui/material/ListItemIcon";
52
- import so from "@mui/material/ListItemText";
43
+ import { W as dt } from "../WidgetContainer-BSrpqh6M.mjs";
44
+ import { L as Be } from "../LineChart-Dlp9RAJz.mjs";
45
+ import { M as Xt } from "../MiniWidgetContainer-B4gbUTJ2.mjs";
46
+ import { subMonths as Zt } from "date-fns";
47
+ import { TrendingUp as Qt, TrendingDown as qt, MultilineChart as Jt, ExpandLess as eo, ExpandMore as to, ArrowBack as oo } from "@mxenabled/mx-icons";
48
+ import { M as no } from "../MicroWidgetContainer-jvYZ5bb6.mjs";
49
+ import so from "@mui/material/Collapse";
50
+ import ro from "@mui/material/List";
51
+ import ao from "@mui/material/ListItem";
52
+ import io from "@mui/material/ListItemButton";
53
+ import lo from "@mui/material/ListItemIcon";
54
+ import co from "@mui/material/ListItemText";
53
55
  import ut from "@mui/material/styles/useTheme";
54
- import { Stack as ro } from "@mui/material";
55
- import ao from "@mui/material/Paper";
56
- import { b as io } from "../CategoryUtil-Cufq3fxg.mjs";
57
- import { E as lo } from "../ExportCsvAction-BqNTIBjm.mjs";
58
- import { u as co } from "../useInsightsEnabled-B4AlxgOP.mjs";
59
- import { E as uo } from "../EmptyState-DHAkGsjk.mjs";
60
- import { b as ho } from "../GlobalAccountFilter-CjTLppI0.mjs";
61
- const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
56
+ import { Stack as uo } from "@mui/material";
57
+ import mo from "@mui/material/Paper";
58
+ import { b as go } from "../CategoryUtil-Cufq3fxg.mjs";
59
+ import { E as ho } from "../ExportCsvAction-B5Ra5duE.mjs";
60
+ import { u as po } from "../useInsightsEnabled-bDCTNOJS.mjs";
61
+ import { E as fo } from "../EmptyState-DHAkGsjk.mjs";
62
+ import { b as yo } from "../GlobalAccountFilter-Cun09DE7.mjs";
63
+ const mt = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
62
64
  const { categories: n } = A(), { getCategoryName: o } = J(), s = o(t);
63
- return /* @__PURE__ */ C(w, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
65
+ return /* @__PURE__ */ C(x, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
64
66
  /* @__PURE__ */ e(
65
67
  W,
66
68
  {
@@ -72,23 +74,23 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
72
74
  ),
73
75
  /* @__PURE__ */ e(Q, { variant: "Body", children: s })
74
76
  ] });
75
- }, go = ({
77
+ }, Co = ({
76
78
  categoryGuids: { guid: t, topLevelGuid: r },
77
79
  hoveredAreaData: n,
78
80
  cursorPosition: o,
79
81
  chartContainerRef: s
80
82
  }) => {
81
- const c = de(), a = wt(null), [u, d] = xt({ x: o.x, y: o.y });
83
+ const l = de(), a = wt(null), [u, d] = xt({ x: o.x, y: o.y });
82
84
  if (vt(() => {
83
85
  (() => {
84
- const m = a.current, _ = s.current;
85
- if (!m || !_) return;
86
- const h = m.getBoundingClientRect(), p = _.getBoundingClientRect();
87
- let f = o.x, x = o.y;
88
- f + h.width * 2 > p.right ? f = o.x - h.width : f - h.width < p.left && (f = o.x), x + h.height * 2 > p.bottom && (x = o.y - h.height), d({ x: f, y: x });
86
+ const h = a.current, _ = s.current;
87
+ if (!h || !_) return;
88
+ const m = h.getBoundingClientRect(), p = _.getBoundingClientRect();
89
+ let f = o.x, T = o.y;
90
+ f + m.width * 2 > p.right ? f = o.x - m.width : f - m.width < p.left && (f = o.x), T + m.height * 2 > p.bottom && (T = o.y - m.height), d({ x: f, y: T });
89
91
  })();
90
92
  }, [o, s]), !n) return null;
91
- const i = n.reduce((y, m) => y + m.y, 0);
93
+ const i = n.reduce((y, h) => y + h.y, 0);
92
94
  return /* @__PURE__ */ e(
93
95
  Je,
94
96
  {
@@ -102,15 +104,15 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
102
104
  },
103
105
  children: /* @__PURE__ */ C(et, { children: [
104
106
  /* @__PURE__ */ C(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
105
- /* @__PURE__ */ e(ht, { categoryGuid: t, topLevelCategoryGuid: r }),
107
+ /* @__PURE__ */ e(mt, { categoryGuid: t, topLevelCategoryGuid: r }),
106
108
  /* @__PURE__ */ e(Q, { variant: "Small", children: `${n.length}-month total` }),
107
109
  /* @__PURE__ */ e(xe, { amount: i, bold: !0, formatString: "0,0", variant: "body2" })
108
110
  ] }),
109
- /* @__PURE__ */ e(Ne, { sx: { my: 16, width: "100%" } }),
110
- /* @__PURE__ */ e(Ve, { container: !0, children: n.map((y, m) => /* @__PURE__ */ C(g.Fragment, { children: [
111
- m > 0 && m % 3 === 0 && /* @__PURE__ */ e(Ne, { sx: { my: 16, width: "100%" } }),
111
+ /* @__PURE__ */ e(He, { sx: { my: 16, width: "100%" } }),
112
+ /* @__PURE__ */ e(Ve, { container: !0, children: n.map((y, h) => /* @__PURE__ */ C(g.Fragment, { children: [
113
+ h > 0 && h % 3 === 0 && /* @__PURE__ */ e(He, { sx: { my: 16, width: "100%" } }),
112
114
  /* @__PURE__ */ e(Ve, { item: !0, xs: 4, children: /* @__PURE__ */ C(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
113
- /* @__PURE__ */ e(Q, { color: c.palette.text.secondary, variant: "XSmall", children: y.x }),
115
+ /* @__PURE__ */ e(Q, { color: l.palette.text.secondary, variant: "XSmall", children: y.x }),
114
116
  /* @__PURE__ */ e(
115
117
  xe,
116
118
  {
@@ -121,21 +123,21 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
121
123
  }
122
124
  )
123
125
  ] }) })
124
- ] }, m)) })
126
+ ] }, h)) })
125
127
  ] })
126
128
  }
127
129
  );
128
- }, mo = M(go), po = ({
130
+ }, _o = M(Co), bo = ({
129
131
  sx: t,
130
132
  categoryGuids: r,
131
133
  hoveredLegend: n,
132
134
  legendRef: o,
133
135
  onHoverLegend: s,
134
- onClickLegend: c
136
+ onClickLegend: l
135
137
  }) => {
136
138
  const { isMobile: a } = q(), { getCategoryName: u } = J();
137
139
  return /* @__PURE__ */ e(
138
- w,
140
+ x,
139
141
  {
140
142
  direction: "row",
141
143
  flexWrap: "wrap",
@@ -144,11 +146,11 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
144
146
  ref: o,
145
147
  sx: t,
146
148
  children: r.map(({ guid: d, top_level_guid: i }) => {
147
- const y = n === d, m = Re[d], _ = Re[i], h = m ?? _ ?? Re.default, p = h + "33";
149
+ const y = n === d, h = Re[d], _ = Re[i], m = h ?? _ ?? Re.default, p = m + "33";
148
150
  return /* @__PURE__ */ C(
149
151
  Se,
150
152
  {
151
- onClick: () => c(d),
153
+ onClick: () => l(d),
152
154
  onMouseEnter: () => s(d),
153
155
  onMouseLeave: () => s(null),
154
156
  sx: {
@@ -171,7 +173,7 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
171
173
  height: 16,
172
174
  marginRight: a ? 5 : 10,
173
175
  borderRadius: "2px",
174
- backgroundColor: n ? y ? h : p : h
176
+ backgroundColor: n ? y ? m : p : m
175
177
  }
176
178
  }
177
179
  ),
@@ -183,125 +185,125 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
183
185
  })
184
186
  }
185
187
  );
186
- }, fo = ({
188
+ }, To = ({
187
189
  categoryGuids: { guid: t, topLevelGuid: r },
188
190
  series: n,
189
191
  xData: o
190
192
  }) => {
191
- const s = It(), c = de();
193
+ const s = Et(), l = de();
192
194
  if (!s?.identifier) return null;
193
195
  const { dataIndex: a, seriesId: u } = s.identifier;
194
196
  if (a == null || !u) return null;
195
- const i = n.find((m) => m.id === u)?.data?.[a], y = o?.[a];
197
+ const i = n.find((h) => h.id === u)?.data?.[a], y = o?.[a];
196
198
  return i === void 0 || !y ? null : /* @__PURE__ */ e(Je, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(et, { children: /* @__PURE__ */ C(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
197
- /* @__PURE__ */ e(ht, { categoryGuid: t, topLevelCategoryGuid: r }),
198
- /* @__PURE__ */ e(Q, { color: c.palette.text.secondary, variant: "Small", children: Z(y, B.MONTH_SHORT_YEAR) }),
199
+ /* @__PURE__ */ e(mt, { categoryGuid: t, topLevelCategoryGuid: r }),
200
+ /* @__PURE__ */ e(Q, { color: l.palette.text.secondary, variant: "Small", children: Z(y, B.MONTH_SHORT_YEAR) }),
199
201
  /* @__PURE__ */ e(xe, { amount: String(i), bold: !0, formatString: "0,0", variant: "Body" })
200
202
  ] }) }) });
201
- }, yo = ({
203
+ }, So = ({
202
204
  onHoverArea: t,
203
205
  onHoverPoint: r,
204
206
  onHoverLegend: n,
205
207
  onClickLegend: o,
206
208
  stackedDatasets: s,
207
- unstackedDatasets: c = [],
209
+ unstackedDatasets: l = [],
208
210
  availableHeight: a = 0,
209
211
  minimumHeight: u = 350
210
212
  }) => {
211
- const d = de(), { isMobile: i } = q(), [y, { height: m }] = At(), _ = g.useRef(null), [h, p] = g.useState(0);
213
+ const d = de(), { isMobile: i } = q(), [y, { height: h }] = Rt(), _ = g.useRef(null), [m, p] = g.useState(0);
212
214
  g.useEffect(() => {
213
- const l = Math.max(a - m, u);
214
- p(l);
215
- }, [a, m]);
216
- const [f, x] = g.useState(null), [b, R] = g.useState({
215
+ const c = Math.max(a - h, u);
216
+ p(c);
217
+ }, [a, h]);
218
+ const [f, T] = g.useState(null), [S, R] = g.useState({
217
219
  hoveredSeriesId: null,
218
220
  hoveredAreaData: null,
219
221
  isAreaHovered: !1,
220
222
  cursorPos: { x: 0, y: 0 }
221
- }), { hoveredSeriesId: E, hoveredAreaData: S, isAreaHovered: k, cursorPos: H } = b, $ = k && E && S, P = !$, K = [...s, ...c], I = K[0]?.dataset.length ?? 0, te = K.flatMap((l) => l.dataset.map((T) => T.x)), O = K.flatMap((l) => l.dataset.map((T) => T.y)), ne = s[0]?.dataset?.map(
222
- (l, T) => s.reduce((L, U) => L + U.dataset[T]?.y || 0, 0)
223
+ }), { hoveredSeriesId: E, hoveredAreaData: w, isAreaHovered: k, cursorPos: N } = S, z = k && E && w, P = !z, K = [...s, ...l], L = K[0]?.dataset.length ?? 0, te = K.flatMap((c) => c.dataset.map((b) => b.x)), O = K.flatMap((c) => c.dataset.map((b) => b.y)), ne = s[0]?.dataset?.map(
224
+ (c, b) => s.reduce((I, U) => I + U.dataset[b]?.y || 0, 0)
223
225
  ) ?? [0], se = Math.max(...ne), X = Math.max(
224
- ...c.flatMap((l) => l.dataset.map((T) => T.y))
225
- ), ue = Math.floor(Math.min(...O) / 100) * 100, he = Math.ceil(Math.max(se, X) / 100) * 100, V = s.map((l, T) => ({
226
- id: `stacked-${T}`,
227
- guid: l.category_guid,
228
- top_level_guid: l.top_level_category_guid,
226
+ ...l.flatMap((c) => c.dataset.map((b) => b.y))
227
+ ), ue = Math.floor(Math.min(...O) / 100) * 100, me = Math.ceil(Math.max(se, X) / 100) * 100, V = s.map((c, b) => ({
228
+ id: `stacked-${b}`,
229
+ guid: c.category_guid,
230
+ top_level_guid: c.top_level_category_guid,
229
231
  area: !0,
230
- color: s[T].category_color ?? d.palette.primary.main,
231
- data: l.dataset.map((L) => L.y),
232
- label: s[T].category_name,
232
+ color: s[b].category_color ?? d.palette.primary.main,
233
+ data: c.dataset.map((I) => I.y),
234
+ label: s[b].category_name,
233
235
  stack: "total",
234
236
  type: "line",
235
237
  highlightScope: { highlight: "item" },
236
- valueFormatter: (L) => oe(L, "0,0")
237
- })), re = c.map((l, T) => ({
238
- id: `unstacked-${T}`,
239
- guid: l.category_guid,
240
- top_level_guid: l.top_level_category_guid,
238
+ valueFormatter: (I) => oe(I, "0,0")
239
+ })), re = l.map((c, b) => ({
240
+ id: `unstacked-${b}`,
241
+ guid: c.category_guid,
242
+ top_level_guid: c.top_level_category_guid,
241
243
  area: !1,
242
- color: l.category_color,
243
- data: l.dataset.map((L) => L.y),
244
- label: l.category_name,
244
+ color: c.category_color,
245
+ data: c.dataset.map((I) => I.y),
246
+ label: c.category_name,
245
247
  type: "line",
246
- valueFormatter: (L) => oe(L, "0,0")
248
+ valueFormatter: (I) => oe(I, "0,0")
247
249
  })), Y = [...V, ...re], ge = [
248
- ...V.map(({ guid: l, top_level_guid: T }) => ({
249
- guid: l,
250
- top_level_guid: T
250
+ ...V.map(({ guid: c, top_level_guid: b }) => ({
251
+ guid: c,
252
+ top_level_guid: b
251
253
  })),
252
- ...re.map(({ guid: l, top_level_guid: T }) => ({
253
- guid: l,
254
- top_level_guid: T
254
+ ...re.map(({ guid: c, top_level_guid: b }) => ({
255
+ guid: c,
256
+ top_level_guid: b
255
257
  }))
256
- ], j = (l) => {
257
- const L = l.startsWith("stacked-") ? s[parseInt(l.split("-")[1])] : c[parseInt(l.split("-")[1])];
258
+ ], j = (c) => {
259
+ const I = c.startsWith("stacked-") ? s[parseInt(c.split("-")[1])] : l[parseInt(c.split("-")[1])];
258
260
  return {
259
- guid: L?.category_guid,
260
- topLevelGuid: L?.top_level_category_guid
261
+ guid: I?.category_guid,
262
+ topLevelGuid: I?.top_level_category_guid
261
263
  };
262
- }, ae = (l) => {
263
- x(l), n?.(l ?? "");
264
- }, me = (l) => {
265
- o?.(l ?? "");
264
+ }, ae = (c) => {
265
+ T(c), n?.(c ?? "");
266
+ }, he = (c) => {
267
+ o?.(c ?? "");
266
268
  }, ie = () => {
267
- const l = j(String(E)).guid;
268
- l && o?.(l);
269
- }, le = (l) => {
270
- const T = String(l?.seriesId), L = j(T).guid, U = Y.find((pe) => pe.id === T), ce = U && l?.dataIndex !== void 0, Te = U && l?.dataIndex === void 0;
269
+ const c = j(String(E)).guid;
270
+ c && o?.(c);
271
+ }, le = (c) => {
272
+ const b = String(c?.seriesId), I = j(b).guid, U = Y.find((pe) => pe.id === b), ce = U && c?.dataIndex !== void 0, be = U && c?.dataIndex === void 0;
271
273
  if (ce)
272
274
  R({
273
- hoveredSeriesId: T,
275
+ hoveredSeriesId: b,
274
276
  hoveredAreaData: null,
275
277
  isAreaHovered: !1,
276
- cursorPos: H
277
- }), r?.(L);
278
- else if (Te) {
278
+ cursorPos: N
279
+ }), r?.(I);
280
+ else if (be) {
279
281
  const pe = U?.data.map((Me, Ae) => ({
280
282
  x: te[Ae],
281
283
  y: Me
282
284
  })) ?? [];
283
285
  R({
284
- hoveredSeriesId: T,
286
+ hoveredSeriesId: b,
285
287
  hoveredAreaData: pe,
286
288
  isAreaHovered: !0,
287
- cursorPos: H
288
- }), t?.(L);
289
+ cursorPos: N
290
+ }), t?.(I);
289
291
  } else
290
292
  R({
291
293
  hoveredSeriesId: null,
292
294
  hoveredAreaData: null,
293
295
  isAreaHovered: !1,
294
- cursorPos: H
296
+ cursorPos: N
295
297
  });
296
- }, D = (l) => {
297
- if (l.target instanceof Element && l.target.classList[0]?.includes("MuiMarkElement-root"))
298
+ }, D = (c) => {
299
+ if (c.target instanceof Element && c.target.classList[0]?.includes("MuiMarkElement-root"))
298
300
  return;
299
- const T = l.currentTarget.getBoundingClientRect();
300
- R((L) => ({
301
- ...L,
301
+ const b = c.currentTarget.getBoundingClientRect();
302
+ R((I) => ({
303
+ ...I,
302
304
  cursorPos: {
303
- x: l.clientX - T.left,
304
- y: l.clientY - T.top
305
+ x: c.clientX - b.left,
306
+ y: c.clientY - b.top
305
307
  }
306
308
  }));
307
309
  }, F = {
@@ -320,11 +322,11 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
320
322
  '& [class*="MuiLineElement-series-unstacked-"]': {
321
323
  strokeWidth: 3
322
324
  },
323
- ...f && V.reduce((l, T, L) => {
324
- const U = `.MuiAreaElement-series-stacked-${L}`;
325
- return l[U] = {
326
- opacity: V[L].guid === f ? 0.9 : 0.2
327
- }, l;
325
+ ...f && V.reduce((c, b, I) => {
326
+ const U = `.MuiAreaElement-series-stacked-${I}`;
327
+ return c[U] = {
328
+ opacity: V[I].guid === f ? 0.9 : 0.2
329
+ }, c;
328
330
  }, {})
329
331
  };
330
332
  return /* @__PURE__ */ e(
@@ -344,16 +346,16 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
344
346
  }
345
347
  },
346
348
  children: /* @__PURE__ */ C(
347
- w,
349
+ x,
348
350
  {
349
351
  direction: { xs: "column", md: "column" },
350
352
  spacing: { xs: 0, md: 4 },
351
353
  sx: { width: "100%", position: "relative" },
352
354
  children: [
353
355
  /* @__PURE__ */ e(
354
- Mt,
356
+ At,
355
357
  {
356
- height: h,
358
+ height: m,
357
359
  hideLegend: !0,
358
360
  margin: { bottom: 24, left: 12, right: 54, top: 48 },
359
361
  onAreaClick: ie,
@@ -364,10 +366,10 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
364
366
  tooltip: { trigger: P ? "item" : "none" }
365
367
  },
366
368
  slots: {
367
- tooltip: P && E ? (l) => /* @__PURE__ */ e(Et, { children: /* @__PURE__ */ e(
368
- fo,
369
+ tooltip: P && E ? (c) => /* @__PURE__ */ e(Mt, { children: /* @__PURE__ */ e(
370
+ To,
369
371
  {
370
- ...l,
372
+ ...c,
371
373
  categoryGuids: j(E),
372
374
  series: Y,
373
375
  xData: te
@@ -379,40 +381,40 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
379
381
  {
380
382
  data: te,
381
383
  scaleType: "time",
382
- valueFormatter: (l) => Z(l, B.MONTH_SHORT_YEAR),
383
- tickNumber: I
384
+ valueFormatter: (c) => Z(c, B.MONTH_SHORT_YEAR),
385
+ tickNumber: L
384
386
  // How many ticks to show on the x-axis
385
387
  }
386
388
  ],
387
389
  yAxis: [
388
390
  {
389
391
  min: ue,
390
- max: he || 100,
391
- valueFormatter: (l) => Lt(l).format("0a")
392
+ max: me || 100,
393
+ valueFormatter: (c) => It(c).format("0a")
392
394
  }
393
395
  ]
394
396
  }
395
397
  ),
396
398
  /* @__PURE__ */ e(
397
- po,
399
+ bo,
398
400
  {
399
401
  categoryGuids: ge,
400
402
  hoveredLegend: f,
401
403
  legendRef: y,
402
- onClickLegend: me,
404
+ onClickLegend: he,
403
405
  onHoverLegend: ae,
404
406
  sx: { px: i ? 0 : 24 }
405
407
  }
406
408
  ),
407
- $ && /* @__PURE__ */ e(
408
- mo,
409
+ z && /* @__PURE__ */ e(
410
+ _o,
409
411
  {
410
412
  categoryGuids: j(E),
411
413
  chartContainerRef: _,
412
- cursorPosition: H,
413
- hoveredAreaData: S.map((l) => ({
414
- ...l,
415
- x: Z(l.x, B.MONTH_SHORT_YEAR)
414
+ cursorPosition: N,
415
+ hoveredAreaData: w.map((c) => ({
416
+ ...c,
417
+ x: Z(c.x, B.MONTH_SHORT_YEAR)
416
418
  }))
417
419
  }
418
420
  )
@@ -424,7 +426,7 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
424
426
  }, gt = ({ selectedTab: t, onTabChange: r }) => {
425
427
  const { common: n } = A();
426
428
  return /* @__PURE__ */ e(
427
- Vt,
429
+ Ft,
428
430
  {
429
431
  "aria-label": n.view_toggle,
430
432
  exclusive: !0,
@@ -432,21 +434,21 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
432
434
  orientation: "horizontal",
433
435
  value: t,
434
436
  children: ["Chart", "Table"].map((o) => /* @__PURE__ */ e(
435
- Pt,
437
+ Vt,
436
438
  {
437
439
  "aria-label": o === "Chart" ? n.view_chart : n.view_table,
438
440
  "aria-pressed": t === o,
439
441
  color: "primary",
440
442
  sx: { width: 56 },
441
443
  value: o,
442
- children: o === "Chart" ? /* @__PURE__ */ e(He, { name: "table_chart_view" }) : /* @__PURE__ */ e(He, { name: "format_list_bulleted" })
444
+ children: o === "Chart" ? /* @__PURE__ */ e(Ne, { name: "table_chart_view" }) : /* @__PURE__ */ e(Ne, { name: "format_list_bulleted" })
443
445
  },
444
446
  o
445
447
  ))
446
448
  }
447
449
  );
448
- }, mt = ({ selectedDateRange: t, selectedCategoryGuid: r }) => {
449
- const { trends: n } = A(), { isMobile: o, isDesktop: s } = q(), { getCategoryName: c } = J(), a = g.useMemo(() => {
450
+ }, ht = ({ selectedDateRange: t, selectedCategoryGuid: r }) => {
451
+ const { trends: n } = A(), { isMobile: o, isDesktop: s } = q(), { getCategoryName: l } = J(), a = g.useMemo(() => {
450
452
  const i = t.start.getFullYear() === t.end.getFullYear() ? Z(
451
453
  t.start,
452
454
  o ? B.MONTH_SHORT : B.MONTH_LONG
@@ -458,7 +460,7 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
458
460
  o ? B.MONTH_SHORT_YEAR : B.MONTH_YEAR
459
461
  );
460
462
  return `${i} - ${y}`;
461
- }, [t, o]), d = c(r) || (o ? n.sub_title : n.sub_title_by_category);
463
+ }, [t, o]), d = l(r) || (o ? n.sub_title : n.sub_title_by_category);
462
464
  return /* @__PURE__ */ C(W, { children: [
463
465
  /* @__PURE__ */ e(
464
466
  Oe,
@@ -474,20 +476,20 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
474
476
  ),
475
477
  /* @__PURE__ */ e(Q, { variant: s ? "subtitle1" : "body2", children: a })
476
478
  ] });
477
- }, Co = (t) => {
479
+ }, wo = (t) => {
478
480
  const r = t.id === "total";
479
- return /* @__PURE__ */ C(w, { alignItems: "center", direction: "row", role: "rowheader", tabIndex: t.tabIndex, children: [
481
+ return /* @__PURE__ */ C(x, { alignItems: "center", direction: "row", role: "rowheader", tabIndex: t.tabIndex, children: [
480
482
  !r && /* @__PURE__ */ e(W, { "aria-hidden": !0, children: /* @__PURE__ */ e(ve, { categoryGuid: t.row.top_level_category_guid, variant: "twotone" }) }),
481
483
  /* @__PURE__ */ e(Q, { bold: r, sx: { ml: 12 }, variant: r ? "body1" : "body2", children: t.row.category })
482
484
  ] });
483
485
  }, Ke = (t) => {
484
- const r = t.row.category_guid, n = t.row.top_level_category_guid, o = r === Fe.INCOME || n === Fe.INCOME, s = t.id === "total", c = t.field === "total", a = c ? t.row[t.field] : t.row.monthlyAmounts[t.field];
485
- return /* @__PURE__ */ e(w, { alignItems: "flex-end", direction: "row", tabIndex: t.tabIndex, children: /* @__PURE__ */ e(
486
+ const r = t.row.category_guid, n = t.row.top_level_category_guid, o = r === Fe.INCOME || n === Fe.INCOME, s = t.id === "total", l = t.field === "total", a = l ? t.row[t.field] : t.row.monthlyAmounts[t.field];
487
+ return /* @__PURE__ */ e(x, { alignItems: "flex-end", direction: "row", tabIndex: t.tabIndex, children: /* @__PURE__ */ e(
486
488
  xe,
487
489
  {
488
490
  amount: o ? Math.abs(a) : a,
489
491
  isIncome: o,
490
- sx: { fontWeight: o || c || s ? 600 : 500 },
492
+ sx: { fontWeight: o || l || s ? 600 : 500 },
491
493
  symbol: o ? "+" : void 0,
492
494
  variant: s ? "body1" : "body2"
493
495
  }
@@ -498,14 +500,14 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
498
500
  }, je = (t) => (r, n) => {
499
501
  const o = Z(it(n.isoDate), B.MONTH_LONG);
500
502
  return r + (t.includes(o) ? n.amount : 0);
501
- }, _o = (t, r) => {
503
+ }, xo = (t, r) => {
502
504
  const n = [], o = new Date(t);
503
505
  for (; o <= r; ) {
504
506
  const s = Z(o, B.MONTH_LONG);
505
507
  n.push(s), o.setMonth(o.getMonth() + 1);
506
508
  }
507
509
  return n;
508
- }, To = (t, r) => {
510
+ }, vo = (t, r) => {
509
511
  const n = {
510
512
  field: "category",
511
513
  flex: 1,
@@ -513,15 +515,15 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
513
515
  headerName: r.category_title,
514
516
  minWidth: 210,
515
517
  renderHeader: ke,
516
- renderCell: Co,
518
+ renderCell: wo,
517
519
  sortable: !0,
518
520
  sortComparator: Ht,
519
521
  type: "string"
520
- }, o = t.map((c) => ({
521
- field: c,
522
+ }, o = t.map((l) => ({
523
+ field: l,
522
524
  flex: 1,
523
525
  headerClassName: "trends-table-header",
524
- headerName: c,
526
+ headerName: l,
525
527
  minWidth: 100,
526
528
  renderHeader: ke,
527
529
  renderCell: Ke,
@@ -530,7 +532,8 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
530
532
  sortable: !0,
531
533
  hideSortIcons: !1,
532
534
  type: "number",
533
- sortComparator: ze
535
+ sortComparator: $e,
536
+ valueGetter: (a, u) => u.monthlyAmounts?.[l] ?? 0
534
537
  })), s = {
535
538
  field: "total",
536
539
  flex: 1,
@@ -544,11 +547,11 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
544
547
  sortable: !0,
545
548
  hideSortIcons: !1,
546
549
  type: "number",
547
- sortComparator: ze
550
+ sortComparator: $e
548
551
  };
549
552
  return [n, ...o, s];
550
553
  }, Ue = (t, r, n, o, s) => {
551
- const c = t.filter((a) => a.is_income === n).map((a) => {
554
+ const l = t.filter((a) => a.is_income === n).map((a) => {
552
555
  let u = a.totalMonthlyAmounts;
553
556
  return s && (u = a.monthlyAmounts), {
554
557
  id: a.guid,
@@ -562,7 +565,7 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
562
565
  });
563
566
  if (s && s.is_income === n) {
564
567
  const a = s.monthlyAmounts.reduce(je(o), 0);
565
- a !== 0 && c.push({
568
+ a !== 0 && l.push({
566
569
  id: `sub-${s.guid}`,
567
570
  category: nt(r.category_general, s.name),
568
571
  category_guid: s.guid,
@@ -572,17 +575,52 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
572
575
  monthlyAmounts: s.monthlyAmounts.reduce(Ye, {})
573
576
  });
574
577
  }
575
- return c;
576
- }, Xe = ({
578
+ return l;
579
+ }, Do = Lt("div")({
580
+ display: "flex",
581
+ visibility: "hidden",
582
+ width: 0
583
+ });
584
+ function Io({
585
+ direction: t,
586
+ index: r,
587
+ sortingOrder: n,
588
+ disabled: o,
589
+ className: s,
590
+ field: l
591
+ }) {
592
+ const a = zt(), u = Kt();
593
+ let d = null;
594
+ const i = {};
595
+ if (t === "asc" ? d = u.slots.columnSortedAscendingIcon : t === "desc" ? d = u.slots.columnSortedDescendingIcon : (d = u.slots.columnUnsortedIcon ?? null, i.sortingOrder = n), !d) return null;
596
+ const h = a.current.getColumn(l)?.headerName ?? l;
597
+ let _ = "";
598
+ t === "asc" ? _ = ", sorted ascending" : t === "desc" && (_ = ", sorted descending");
599
+ const m = ["Total", "Category"].includes(h) ? "" : " category totals", p = `Sort by ${h}${m}${_}`, f = /* @__PURE__ */ e(d, { className: "MuiDataGrid-sortIcon", fontSize: "small", ...i }), T = /* @__PURE__ */ e(
600
+ Ut,
601
+ {
602
+ disabled: o,
603
+ size: "small",
604
+ tabIndex: -1,
605
+ ...u.slotProps?.baseIconButton,
606
+ "aria-label": p,
607
+ className: `MuiDataGrid-sortButton${s ? ` ${s}` : ""}`,
608
+ title: p,
609
+ children: f
610
+ }
611
+ );
612
+ return /* @__PURE__ */ e(Do, { className: "MuiDataGrid-iconButtonContainer", children: r != null ? /* @__PURE__ */ e(jt, { badgeContent: r, color: "default", overlap: "circular", children: T }) : T });
613
+ }
614
+ const Lo = g.memo(Io), Xe = ({
577
615
  columns: t,
578
616
  onRowClick: r,
579
617
  parentCategory: n,
580
618
  rows: o,
581
619
  totalRow: s
582
620
  }) => {
583
- const c = de(), { onEvent: a } = z(), u = c.palette.mode === "light";
621
+ const l = de(), { onEvent: a } = $(), u = l.palette.mode === "light";
584
622
  return /* @__PURE__ */ e(
585
- zt,
623
+ Yt,
586
624
  {
587
625
  columns: t,
588
626
  disableColumnFilter: !0,
@@ -592,7 +630,7 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
592
630
  onRowClick: (d) => {
593
631
  n || r?.(d.row.category_guid), a(v.TRENDS_CLICK_LIST_ITEM, {
594
632
  ...G,
595
- listItem: Rt[d.row.category_guid]
633
+ listItem: kt[d.row.category_guid]
596
634
  });
597
635
  },
598
636
  pinnedRows: {
@@ -601,6 +639,7 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
601
639
  rowHeight: 64,
602
640
  rows: o,
603
641
  slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
642
+ slots: { columnHeaderSortIcon: Lo },
604
643
  sortingOrder: ["asc", "desc"],
605
644
  sx: {
606
645
  borderColor: "divider",
@@ -624,33 +663,33 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
624
663
  height: o = "100%",
625
664
  sx: s = {}
626
665
  }) => {
627
- const { trends: c } = A(), { trendsCategories: a } = J(), u = g.useMemo(() => _o(t.start, t.end), [t]), d = g.useMemo(() => To(u, c), [u, c]), i = g.useMemo(() => {
666
+ const { trends: l } = A(), { trendsCategories: a } = J(), u = g.useMemo(() => xo(t.start, t.end), [t]), d = g.useMemo(() => vo(u, l), [u, l]), i = g.useMemo(() => {
628
667
  if (r)
629
- return a.find((h) => h.guid === r);
630
- }, [r, a]), [y, m] = g.useMemo(() => {
631
- let h = a;
632
- return i && (h = i.subCategories.filter(
668
+ return a.find((m) => m.guid === r);
669
+ }, [r, a]), [y, h] = g.useMemo(() => {
670
+ let m = a;
671
+ return i && (m = i.subCategories.filter(
633
672
  (p) => p.monthlyAmounts.some((f) => f.amount !== 0)
634
673
  )), [
635
- Ue(h, c, !0, u, i),
636
- Ue(h, c, !1, u, i)
674
+ Ue(m, l, !0, u, i),
675
+ Ue(m, l, !1, u, i)
637
676
  ];
638
- }, [a, u, i, c]), _ = {
677
+ }, [a, u, i, l]), _ = {
639
678
  id: "total",
640
- category: c.table_column_total,
679
+ category: l.table_column_total,
641
680
  category_guid: "total",
642
681
  isParent: !1,
643
682
  top_level_category_guid: "total",
644
- total: m.reduce((h, p) => h + p.total, 0),
645
- monthlyAmounts: m.reduce(
646
- (h, p) => (Object.entries(p.monthlyAmounts).forEach(([f, x]) => {
647
- h[f] = (h[f] || 0) + x;
648
- }), h),
683
+ total: h.reduce((m, p) => m + p.total, 0),
684
+ monthlyAmounts: h.reduce(
685
+ (m, p) => (Object.entries(p.monthlyAmounts).forEach(([f, T]) => {
686
+ m[f] = (m[f] || 0) + T;
687
+ }), m),
649
688
  {}
650
689
  )
651
690
  };
652
691
  return /* @__PURE__ */ C(
653
- w,
692
+ x,
654
693
  {
655
694
  gap: 24,
656
695
  sx: { height: o, width: "100%", overflowX: "auto", boxShadow: "none", ...s },
@@ -670,33 +709,33 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
670
709
  columns: d,
671
710
  onRowClick: n,
672
711
  parentCategory: i,
673
- rows: m,
712
+ rows: h,
674
713
  totalRow: _
675
714
  }
676
715
  )
677
716
  ]
678
717
  }
679
718
  );
680
- }, bo = {
719
+ }, Eo = {
681
720
  title: "Transaction List"
682
- }, So = ({
721
+ }, Mo = ({
683
722
  categoryGuid: t,
684
723
  dateRange: r,
685
724
  isOpen: n,
686
725
  onClose: o
687
726
  }) => {
688
- const { onEvent: s } = z(), { selectedAccountGuids: c } = Ce(), { common: a } = A(), { setFilter: u, sortedTransactions: d } = De(), [i, y] = g.useState(""), m = g.useMemo(
689
- () => d.find((h) => h.guid === i),
727
+ const { onEvent: s } = $(), { selectedAccountGuids: l } = Ce(), { common: a } = A(), { setFilter: u, sortedTransactions: d } = De(), [i, y] = g.useState(""), h = g.useMemo(
728
+ () => d.find((m) => m.guid === i),
690
729
  [i, d]
691
730
  );
692
731
  g.useEffect(() => {
693
732
  u({
694
- accounts: c,
733
+ accounts: l,
695
734
  dateRange: r,
696
- custom: (h) => t === "" || t === h.category_guid || t === h.top_level_category_guid,
735
+ custom: (m) => t === "" || t === m.category_guid || t === m.top_level_category_guid,
697
736
  showSplits: !!t
698
737
  });
699
- }, [c, t, r]), g.useEffect(() => s(v.TRENDS_VIEW_TRANSACTIONS), []);
738
+ }, [l, t, r]), g.useEffect(() => s(v.TRENDS_VIEW_TRANSACTIONS), []);
700
739
  const _ = () => {
701
740
  y(""), o();
702
741
  };
@@ -706,84 +745,84 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
706
745
  ariaLabelClose: a.close_aria,
707
746
  isOpen: n,
708
747
  onClose: _,
709
- title: bo.title,
748
+ title: Eo.title,
710
749
  children: [
711
- m && /* @__PURE__ */ e(ct, { transaction: m }),
712
- !m && /* @__PURE__ */ e(lt, { onClick: y })
750
+ h && /* @__PURE__ */ e(ct, { transaction: h }),
751
+ !h && /* @__PURE__ */ e(lt, { onClick: y })
713
752
  ]
714
753
  }
715
754
  );
716
- }, wo = M(So), xo = ({ onBackClick: t, sx: r }) => {
717
- const { onEvent: n } = z(), { isDesktop: o, isTablet: s, isMobile: c } = q(), { isAccountDataLoaded: a, loadAccountData: u } = Le(), {
755
+ }, Ao = M(Mo), Ro = ({ onBackClick: t, sx: r }) => {
756
+ const { onEvent: n } = $(), { isDesktop: o, isTablet: s, isMobile: l } = q(), { isAccountDataLoaded: a, loadAccountData: u } = Ie(), {
718
757
  categoriesLoaded: d,
719
758
  loadCategories: i,
720
759
  loadDateRangeCategoryTotals: y,
721
- loadMonthlyCategoryTotals: m,
760
+ loadMonthlyCategoryTotals: h,
722
761
  monthlyCategoryTotals: _,
723
- getCategoryName: h
762
+ getCategoryName: m
724
763
  } = J(), {
725
764
  isTransactionDataLoaded: p,
726
765
  loadTransactionData: f,
727
- sortedTransactions: x
728
- } = De(), { selectedDateRange: b, setSelectedDateRange: R } = _e(), { isInitialized: E, selectedAccounts: S } = Ce(), { trends: k } = A(), [H, $] = g.useState(!1), [P, K] = g.useState(!1), [I, te] = g.useState("Chart"), [O, ne] = g.useState(""), [se, X] = g.useState(window.innerHeight), he = se - (c ? 315 : 345);
729
- Ie({
766
+ sortedTransactions: T
767
+ } = De(), { selectedDateRange: S, setSelectedDateRange: R } = _e(), { isInitialized: E, selectedAccounts: w } = Ce(), { trends: k } = A(), [N, z] = g.useState(!1), [P, K] = g.useState(!1), [L, te] = g.useState("Chart"), [O, ne] = g.useState(""), [se, X] = g.useState(window.innerHeight), me = se - (l ? 315 : 345);
768
+ Le({
730
769
  widgetName: "TrendsFullWidget",
731
- isLoaded: H
770
+ isLoaded: N
732
771
  }), g.useEffect(() => {
733
772
  const D = () => X(window.innerHeight);
734
773
  return window.addEventListener("resize", D), a || u().finally(), d || i().finally(), p || f().finally(), () => window.removeEventListener("resize", D);
735
774
  }, []), g.useEffect(() => {
736
- E && y(S, b.start, b.end).then(() => {
737
- m(
738
- S,
739
- b.start,
740
- b.end
775
+ E && y(w, S.start, S.end).then(() => {
776
+ h(
777
+ w,
778
+ S.start,
779
+ S.end
741
780
  );
742
781
  }).finally(() => {
743
- $(!0), n(v.TRENDS_LOAD_WIDGET, {
782
+ z(!0), n(v.TRENDS_LOAD_WIDGET, {
744
783
  ...G,
745
- time_period: `${we(b.end, b.start)}M`
784
+ time_period: `${we(S.end, S.start)}M`
746
785
  });
747
786
  });
748
- }, [E, S, b]);
787
+ }, [E, w, S]);
749
788
  const V = g.useMemo(() => {
750
- if (!H) return { stackedDatasets: [], unstackedDatasets: [] };
751
- const D = Nt(
789
+ if (!N) return { stackedDatasets: [], unstackedDatasets: [] };
790
+ const D = Wt(
752
791
  _,
753
- b.start,
754
- b.end
792
+ S.start,
793
+ S.end
755
794
  ), F = O.length ? D.filter(
756
- (l) => l.top_level_category_guid === O || l.category_guid === O
757
- ) : Wt(D);
795
+ (c) => c.top_level_category_guid === O || c.category_guid === O
796
+ ) : Ot(D);
758
797
  return {
759
- stackedDatasets: F.filter(Ot),
760
- unstackedDatasets: F.filter(Gt)
798
+ stackedDatasets: F.filter(Gt),
799
+ unstackedDatasets: F.filter(Bt)
761
800
  };
762
- }, [_, O, b]), re = (D, F) => {
763
- te(F ?? I), n(v.TRENDS_CLICK_TOGGLE_VIEW);
801
+ }, [_, O, S]), re = (D, F) => {
802
+ te(F ?? L), n(v.TRENDS_CLICK_TOGGLE_VIEW);
764
803
  }, Y = (D) => {
765
- const F = qe(D?.[0], 1), l = D?.[1], T = we(l, F);
766
- R({ start: F, end: l }), n(v.TRENDS_CLICK_TIME_WINDOW, {
767
- time_period: T + "M"
804
+ const F = qe(D?.[0], 1), c = D?.[1], b = we(c, F);
805
+ R({ start: F, end: c }), n(v.TRENDS_CLICK_TIME_WINDOW, {
806
+ time_period: b + "M"
768
807
  });
769
808
  }, ge = () => {
770
809
  n(v.TRENDS_CLICK_FILTER);
771
810
  }, j = (D) => {
772
811
  ne(D);
773
812
  }, ae = (D) => {
774
- ne(D), n(v.TRENDS_CLICK_LEGEND, { category: h(D) });
775
- }, me = (D) => {
776
- n(v.TRENDS_HOVER_LEGEND, { category: h(D) });
813
+ ne(D), n(v.TRENDS_CLICK_LEGEND, { category: m(D) });
814
+ }, he = (D) => {
815
+ n(v.TRENDS_HOVER_LEGEND, { category: m(D) });
777
816
  }, ie = (D) => {
778
817
  n(v.TRENDS_HOVER_AREA, { category: D });
779
818
  }, le = (D) => {
780
819
  n(v.TRENDS_HOVER_POINT, { category: D });
781
820
  };
782
- return !E || !H ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ C(
821
+ return !E || !N ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ C(
783
822
  dt,
784
823
  {
785
824
  calendarActions: { onRangeChanged: Y },
786
- dateRange: b,
825
+ dateRange: S,
787
826
  dateRangeVariant: "timeframebuttons",
788
827
  onAccountsFilterClick: ge,
789
828
  onBackClick: t,
@@ -791,7 +830,7 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
791
830
  title: k.title,
792
831
  children: [
793
832
  /* @__PURE__ */ C(
794
- w,
833
+ x,
795
834
  {
796
835
  sx: {
797
836
  // eslint-disable-next-line no-nested-ternary
@@ -799,49 +838,49 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
799
838
  },
800
839
  children: [
801
840
  /* @__PURE__ */ C(
802
- w,
841
+ x,
803
842
  {
804
843
  flexDirection: "row",
805
844
  justifyContent: "space-between",
806
- sx: { pb: c ? 12 : 24, pt: c ? 24 : 48 },
845
+ sx: { pb: l ? 12 : 24, pt: l ? 24 : 48 },
807
846
  children: [
808
847
  /* @__PURE__ */ e(
809
- mt,
848
+ ht,
810
849
  {
811
850
  selectedCategoryGuid: O,
812
- selectedDateRange: b
851
+ selectedDateRange: S
813
852
  }
814
853
  ),
815
- /* @__PURE__ */ e(gt, { onTabChange: re, selectedTab: I })
854
+ /* @__PURE__ */ e(gt, { onTabChange: re, selectedTab: L })
816
855
  ]
817
856
  }
818
857
  ),
819
- /* @__PURE__ */ C(w, { alignItems: "center", flexDirection: "row", width: "100%", children: [
858
+ /* @__PURE__ */ C(x, { alignItems: "center", flexDirection: "row", width: "100%", children: [
820
859
  /* @__PURE__ */ e(W, { flexGrow: 1, children: O && /* @__PURE__ */ C(Se, { onClick: () => ne(""), sx: { p: 0, pr: 5 }, children: [
821
- /* @__PURE__ */ e(He, { name: "arrow_back" }),
860
+ /* @__PURE__ */ e(Ne, { name: "arrow_back" }),
822
861
  k.all_categories
823
862
  ] }) }),
824
- /* @__PURE__ */ e(Se, { onClick: () => K(!0), sx: { px: 5 }, children: `${k.view_transactions} (${x.length})` })
863
+ /* @__PURE__ */ e(Se, { onClick: () => K(!0), sx: { px: 5 }, children: `${k.view_transactions} (${T.length})` })
825
864
  ] }),
826
865
  /* @__PURE__ */ C(W, { children: [
827
- I === "Chart" && /* @__PURE__ */ e(
828
- yo,
866
+ L === "Chart" && /* @__PURE__ */ e(
867
+ So,
829
868
  {
830
- availableHeight: he,
869
+ availableHeight: me,
831
870
  onClickLegend: ae,
832
871
  onHoverArea: ie,
833
- onHoverLegend: me,
872
+ onHoverLegend: he,
834
873
  onHoverPoint: le,
835
874
  stackedDatasets: V.stackedDatasets,
836
875
  unstackedDatasets: V.unstackedDatasets
837
876
  }
838
877
  ),
839
- I === "Table" && /* @__PURE__ */ e(
878
+ L === "Table" && /* @__PURE__ */ e(
840
879
  pt,
841
880
  {
842
881
  onClickRow: j,
843
882
  selectedCategory: O,
844
- selectedDateRange: b
883
+ selectedDateRange: S
845
884
  }
846
885
  )
847
886
  ] })
@@ -849,10 +888,10 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
849
888
  }
850
889
  ),
851
890
  /* @__PURE__ */ e(
852
- wo,
891
+ Ao,
853
892
  {
854
893
  categoryGuid: O,
855
- dateRange: b,
894
+ dateRange: S,
856
895
  isOpen: P,
857
896
  onClose: () => K(!1)
858
897
  }
@@ -860,8 +899,8 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
860
899
  ]
861
900
  }
862
901
  );
863
- }, Un = M(xo), vo = () => {
864
- const { monthlyCategoryTotals: t } = J(), { trends: r } = A(), n = de(), { availableHeight: o = 300 } = tt(), s = g.useMemo(() => Bt(t), [t]);
902
+ }, ss = M(Ro), ko = () => {
903
+ const { monthlyCategoryTotals: t } = J(), { trends: r } = A(), n = de(), { availableHeight: o = 300 } = tt(), s = g.useMemo(() => Pt(t), [t]);
865
904
  return /* @__PURE__ */ e(
866
905
  Be,
867
906
  {
@@ -878,17 +917,17 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
878
917
  valueFormatterString: "0,0"
879
918
  }
880
919
  );
881
- }, Do = M(vo), Lo = ({ onPrimaryCtaClick: t, sx: r }) => {
882
- const { isAccountDataLoaded: n, loadAccountData: o } = Le(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: c } = J(), { isInitialized: a } = Ge(), { trends: u } = A(), { selectedAccounts: d } = Ce();
920
+ }, No = M(ko), Ho = ({ onPrimaryCtaClick: t, sx: r }) => {
921
+ const { isAccountDataLoaded: n, loadAccountData: o } = Ie(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: l } = J(), { isInitialized: a } = Ge(), { trends: u } = A(), { selectedAccounts: d } = Ce();
883
922
  return g.useEffect(() => {
884
923
  n || o().finally();
885
- }, []), Ie({
924
+ }, []), Le({
886
925
  widgetName: "TrendsMiniWidget",
887
- isLoaded: c
926
+ isLoaded: l
888
927
  }), g.useEffect(() => {
889
928
  a && n && s(d).finally();
890
- }, [n, a, d]), !n || !a || !c ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ e(
891
- $t,
929
+ }, [n, a, d]), !n || !a || !l ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ e(
930
+ Xt,
892
931
  {
893
932
  contentStyles: { height: "calc(100% - 72px)", minHeight: 300, ":last-child": { pb: 0 } },
894
933
  onPrimaryCtaClick: t,
@@ -896,23 +935,23 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
896
935
  subTitle: u.sub_title,
897
936
  sx: { height: "100%", ...r },
898
937
  title: u.mini_title,
899
- children: /* @__PURE__ */ e(Do, {})
938
+ children: /* @__PURE__ */ e(No, {})
900
939
  }
901
940
  );
902
- }, Xn = M(Lo), Io = 70, Ze = ({
941
+ }, rs = M(Ho), Wo = 70, Ze = ({
903
942
  title: t,
904
943
  totalAmount: r,
905
944
  transactionType: n,
906
945
  percentage: o,
907
946
  secondaryLabel: s,
908
- shouldDisplayPercentage: c
947
+ shouldDisplayPercentage: l
909
948
  }) => {
910
- const { availableWidth: a } = tt(), u = g.useRef(null), d = g.useRef(null), i = kt(Number(Math.abs(o)), {
949
+ const { availableWidth: a } = tt(), u = g.useRef(null), d = g.useRef(null), i = Nt(Number(Math.abs(o)), {
911
950
  style: "percent",
912
951
  minimumIntegerDigits: 1
913
- }), y = a === 288 && oe(r, "0,0.00").length > 10 ? oe(r, "0,0") : oe(r, "0,0.00"), m = n === "spending" ? o > 0 : o >= 0, _ = n === "spending" ? "error.main" : "success.main", h = n === "spending" ? "success.main" : "text.secondary", p = u?.current, f = d?.current, x = p && f ? p.scrollWidth > f.clientWidth - Io : !1;
952
+ }), y = a === 288 && oe(r, "0,0.00").length > 10 ? oe(r, "0,0") : oe(r, "0,0.00"), h = n === "spending" ? o > 0 : o >= 0, _ = n === "spending" ? "error.main" : "success.main", m = n === "spending" ? "success.main" : "text.secondary", p = u?.current, f = d?.current, T = p && f ? p.scrollWidth > f.clientWidth - Wo : !1;
914
953
  return /* @__PURE__ */ C(
915
- w,
954
+ x,
916
955
  {
917
956
  sx: {
918
957
  border: 1,
@@ -925,7 +964,7 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
925
964
  },
926
965
  children: [
927
966
  /* @__PURE__ */ C(
928
- w,
967
+ x,
929
968
  {
930
969
  sx: {
931
970
  alignItems: "center",
@@ -934,13 +973,13 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
934
973
  },
935
974
  children: [
936
975
  /* @__PURE__ */ e(ye, { color: "text.secondary", variant: "caption", children: t }),
937
- c && /* @__PURE__ */ C(w, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
938
- m ? /* @__PURE__ */ e(Yt, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e(jt, { size: 20, sx: { color: h } }),
976
+ l && /* @__PURE__ */ C(x, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
977
+ h ? /* @__PURE__ */ e(Qt, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e(qt, { size: 20, sx: { color: m } }),
939
978
  /* @__PURE__ */ e(
940
979
  ye,
941
980
  {
942
981
  sx: {
943
- color: m ? _ : h,
982
+ color: h ? _ : m,
944
983
  fontWeight: 600
945
984
  },
946
985
  variant: "body2",
@@ -952,7 +991,7 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
952
991
  }
953
992
  ),
954
993
  /* @__PURE__ */ C(
955
- w,
994
+ x,
956
995
  {
957
996
  ref: d,
958
997
  sx: {
@@ -969,10 +1008,10 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
969
1008
  children: /* @__PURE__ */ e(Oe, { children: y })
970
1009
  }
971
1010
  ),
972
- c && a >= 450 && !x && /* @__PURE__ */ e(
1011
+ l && a >= 450 && !T && /* @__PURE__ */ e(
973
1012
  ye,
974
1013
  {
975
- color: m ? _ : h,
1014
+ color: h ? _ : m,
976
1015
  variant: "caption",
977
1016
  children: s
978
1017
  }
@@ -983,55 +1022,55 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
983
1022
  ]
984
1023
  }
985
1024
  );
986
- }, Eo = M(() => {
1025
+ }, Oo = M(() => {
987
1026
  const { trends: t } = A();
988
- return /* @__PURE__ */ C(w, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
989
- /* @__PURE__ */ e(Ut, { size: 32 }),
990
- /* @__PURE__ */ C(w, { children: [
1027
+ return /* @__PURE__ */ C(x, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
1028
+ /* @__PURE__ */ e(Jt, { size: 32 }),
1029
+ /* @__PURE__ */ C(x, { children: [
991
1030
  /* @__PURE__ */ e(ye, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
992
1031
  /* @__PURE__ */ e(ye, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
993
1032
  ] })
994
1033
  ] });
995
- }), Zn = M(({ onCtaClick: t }) => {
996
- const { isAccountDataLoaded: r, loadAccountData: n, visibleAccounts: o } = Le();
1034
+ }), as = M(({ onCtaClick: t }) => {
1035
+ const { isAccountDataLoaded: r, loadAccountData: n, visibleAccounts: o } = Ie();
997
1036
  g.useEffect(() => {
998
1037
  r || n().finally();
999
1038
  }, []);
1000
- const { onEvent: s } = z(), { monthlyCategoryTotals: c, loadMonthlyCategoryTotals: a, monthlyTotalsLoaded: u } = J(), d = {
1001
- start: Kt(/* @__PURE__ */ new Date(), 1),
1039
+ const { onEvent: s } = $(), { monthlyCategoryTotals: l, loadMonthlyCategoryTotals: a, monthlyTotalsLoaded: u } = J(), d = {
1040
+ start: Zt(/* @__PURE__ */ new Date(), 1),
1002
1041
  end: /* @__PURE__ */ new Date()
1003
- }, { trends: i } = A(), { selectedAccounts: y, isInitialized: m } = Ce();
1004
- Ie({
1042
+ }, { trends: i } = A(), { selectedAccounts: y, isInitialized: h } = Ce();
1043
+ Le({
1005
1044
  widgetName: "TrendsMicroWidget",
1006
1045
  isLoaded: u
1007
1046
  }), g.useEffect(() => {
1008
- m && a(y, d.start).then(() => {
1047
+ h && a(y, d.start).then(() => {
1009
1048
  s(v.TRENDS_LOAD_WIDGET, {
1010
1049
  state: o?.length ? "default" : "zeroState"
1011
1050
  });
1012
1051
  });
1013
- }, [m, y]);
1014
- const { spendingData: _, incomeData: h } = g.useMemo(
1052
+ }, [h, y]);
1053
+ const { spendingData: _, incomeData: m } = g.useMemo(
1015
1054
  () => ({
1016
- spendingData: rt(c, d),
1017
- incomeData: at(c, d)
1055
+ spendingData: rt(l, d),
1056
+ incomeData: at(l, d)
1018
1057
  }),
1019
- [c, d]
1020
- ), [p, f] = _, [x, b] = h, R = $e(f.y, p.y), E = $e(b.y, x.y), S = m && !o?.length, k = () => {
1058
+ [l, d]
1059
+ ), [p, f] = _, [T, S] = m, R = ze(f.y, p.y), E = ze(S.y, T.y), w = h && !o?.length, k = () => {
1021
1060
  s(
1022
- S ? v.TRENDS_CLICK_GET_STARTED : v.TRENDS_CLICK_VIEW_MORE
1061
+ w ? v.TRENDS_CLICK_GET_STARTED : v.TRENDS_CLICK_VIEW_MORE
1023
1062
  ), t();
1024
1063
  };
1025
- return !u || !m ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ e(
1026
- qt,
1064
+ return !u || !h ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ e(
1065
+ no,
1027
1066
  {
1028
1067
  className: "mx-trends-microwidget",
1029
1068
  ctaLabel: i.micro_primary_cta_label,
1030
1069
  onCTAClick: k,
1031
- subHeader: S ? void 0 : i.micro_subheader,
1070
+ subHeader: w ? void 0 : i.micro_subheader,
1032
1071
  title: i.title,
1033
- children: S ? /* @__PURE__ */ e(Eo, {}) : /* @__PURE__ */ C(
1034
- w,
1072
+ children: w ? /* @__PURE__ */ e(Oo, {}) : /* @__PURE__ */ C(
1073
+ x,
1035
1074
  {
1036
1075
  sx: {
1037
1076
  alignItems: "stretch",
@@ -1055,9 +1094,9 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1055
1094
  {
1056
1095
  percentage: E,
1057
1096
  secondaryLabel: i.micro_secondary_label,
1058
- shouldDisplayPercentage: b.y !== 0 && x.y !== 0,
1097
+ shouldDisplayPercentage: S.y !== 0 && T.y !== 0,
1059
1098
  title: i.income_label,
1060
- totalAmount: b.y,
1099
+ totalAmount: S.y,
1061
1100
  transactionType: "income"
1062
1101
  }
1063
1102
  )
@@ -1066,17 +1105,17 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1066
1105
  )
1067
1106
  }
1068
1107
  );
1069
- }), Mo = M(
1108
+ }), Go = M(
1070
1109
  ({ isExpanded: t, onClick: r }) => {
1071
1110
  const n = ut();
1072
- return /* @__PURE__ */ e(to, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(oo, { onClick: r, sx: { justifyContent: "center" }, children: /* @__PURE__ */ C(
1073
- w,
1111
+ return /* @__PURE__ */ e(ao, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(io, { onClick: r, sx: { justifyContent: "center" }, children: /* @__PURE__ */ C(
1112
+ x,
1074
1113
  {
1075
1114
  sx: { color: n.palette.primary.main, flexDirection: "row", alignItems: "center" },
1076
1115
  children: [
1077
- /* @__PURE__ */ e(so, { children: /* @__PURE__ */ e(Q, { bold: !0, variant: "body2", children: t ? "View less" : "View more" }) }),
1078
- /* @__PURE__ */ e(no, { sx: { color: n.palette.primary.main }, children: t ? /* @__PURE__ */ e(Xt, {}) : /* @__PURE__ */ e(
1079
- Zt,
1116
+ /* @__PURE__ */ e(co, { children: /* @__PURE__ */ e(Q, { bold: !0, variant: "body2", children: t ? "View less" : "View more" }) }),
1117
+ /* @__PURE__ */ e(lo, { sx: { color: n.palette.primary.main }, children: t ? /* @__PURE__ */ e(eo, {}) : /* @__PURE__ */ e(
1118
+ to,
1080
1119
  {
1081
1120
  sx: {
1082
1121
  transition: "transform 0.3s ease-in-out",
@@ -1095,10 +1134,10 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1095
1134
  name: n,
1096
1135
  transactions: o,
1097
1136
  onClick: s,
1098
- isLastItem: c = !1,
1137
+ isLastItem: l = !1,
1099
1138
  showDivider: a = !0
1100
1139
  }) => {
1101
- const { trends: u } = A(), { onEvent: d } = z(), i = `${o.length} ${o.length === 1 ? u.transaction : u.transactions}`, y = () => {
1140
+ const { trends: u } = A(), { onEvent: d } = $(), i = `${o.length} ${o.length === 1 ? u.transaction : u.transactions}`, y = () => {
1102
1141
  s?.(), d(v.TRENDS_CLICK_LIST_ITEM, {
1103
1142
  ...G,
1104
1143
  listItem: n
@@ -1116,45 +1155,45 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1116
1155
  title: n
1117
1156
  }
1118
1157
  ),
1119
- a && /* @__PURE__ */ e(Ne, { sx: { ml: c ? 24 : 68 } })
1158
+ a && /* @__PURE__ */ e(He, { sx: { ml: l ? 24 : 68 } })
1120
1159
  ] }, r);
1121
1160
  }
1122
- ), Ao = M(
1161
+ ), Bo = M(
1123
1162
  ({ availableHeight: t = 0, onCategoryClick: r }) => {
1124
- const { collapsedCategories: n, visibleCategories: o, setVisibleListLength: s } = _e(), { isLargeDesktop: c, isDesktop: a } = q(), { trends: u } = A(), { onEvent: d } = z(), [i, y] = g.useState(!1), m = a || c;
1163
+ const { collapsedCategories: n, visibleCategories: o, setVisibleListLength: s } = _e(), { isLargeDesktop: l, isDesktop: a } = q(), { trends: u } = A(), { onEvent: d } = $(), [i, y] = g.useState(!1), h = a || l;
1125
1164
  g.useEffect(() => {
1126
1165
  const p = Math.floor(t / 64) - 1, f = o.length + n.length;
1127
- p !== o.length && (s(m ? Math.max(p, 5) : 5), y(p >= f));
1166
+ p !== o.length && (s(h ? Math.max(p, 5) : 5), y(p >= f));
1128
1167
  }, [t]);
1129
1168
  const _ = () => {
1130
1169
  y(!i), d(v.TRENDS_CLICK_VIEW_MORE, {
1131
1170
  ...G
1132
1171
  });
1133
- }, h = o.length + (i ? n.length : 0);
1134
- return /* @__PURE__ */ e(w, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ C(eo, { children: [
1135
- /* @__PURE__ */ e(w, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Oe, { children: u.categories }) }),
1172
+ }, m = o.length + (i ? n.length : 0);
1173
+ return /* @__PURE__ */ e(x, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ C(ro, { children: [
1174
+ /* @__PURE__ */ e(x, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Oe, { children: u.categories }) }),
1136
1175
  o.map((p, f) => /* @__PURE__ */ e(
1137
1176
  Qe,
1138
1177
  {
1139
1178
  ...p,
1140
- isLastItem: f === h - 1,
1179
+ isLastItem: f === m - 1,
1141
1180
  onClick: p.transactions.length > 0 ? () => r(p) : void 0,
1142
1181
  showDivider: !0
1143
1182
  },
1144
1183
  p.guid
1145
1184
  )),
1146
1185
  /* @__PURE__ */ e(
1147
- Jt,
1186
+ so,
1148
1187
  {
1149
1188
  in: i,
1150
1189
  sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
1151
1190
  children: n.map((p, f) => {
1152
- const x = o.length + f;
1191
+ const T = o.length + f;
1153
1192
  return /* @__PURE__ */ e(
1154
1193
  Qe,
1155
1194
  {
1156
1195
  ...p,
1157
- isLastItem: x === h - 1,
1196
+ isLastItem: T === m - 1,
1158
1197
  onClick: p.transactions.length > 0 ? () => r(p) : void 0,
1159
1198
  showDivider: !0
1160
1199
  },
@@ -1163,21 +1202,21 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1163
1202
  })
1164
1203
  }
1165
1204
  ),
1166
- n.length > 0 && /* @__PURE__ */ e(Mo, { isExpanded: i, onClick: _ })
1205
+ n.length > 0 && /* @__PURE__ */ e(Go, { isExpanded: i, onClick: _ })
1167
1206
  ] }) });
1168
1207
  }
1169
- ), Ro = ({ beats: t, onInsightCardClick: r }) => {
1170
- const { onEvent: n } = z(), { isMobile: o, isDesktop: s, isLargeDesktop: c } = q(), { beatStore: a, endpoint: u, sessionToken: d } = Ge(), i = s || c, y = i || o ? 1 : 2, m = () => null, _ = (b) => {
1171
- r?.(b), n(v.TRENDS_CLICK_INSIGHT, G);
1172
- }, h = i ? 200 : 170, p = i ? 170 : 124, f = i ? 56 : 0, x = t.length > 0 ? h + f : p;
1173
- return /* @__PURE__ */ e(ro, { sx: { height: x }, children: /* @__PURE__ */ e(
1174
- Ft,
1208
+ ), Po = ({ beats: t, onInsightCardClick: r }) => {
1209
+ const { onEvent: n } = $(), { isMobile: o, isDesktop: s, isLargeDesktop: l } = q(), { beatStore: a, endpoint: u, sessionToken: d } = Ge(), i = s || l, y = i || o ? 1 : 2, h = () => null, _ = (S) => {
1210
+ r?.(S), n(v.TRENDS_CLICK_INSIGHT, G);
1211
+ }, m = i ? 200 : 170, p = i ? 170 : 124, f = i ? 56 : 0, T = t.length > 0 ? m + f : p;
1212
+ return /* @__PURE__ */ e(uo, { sx: { height: T }, children: /* @__PURE__ */ e(
1213
+ $t,
1175
1214
  {
1176
1215
  areBeatsLoading: a.isLoading,
1177
1216
  beats: t,
1178
1217
  endpoint: u,
1179
1218
  headerSx: { p: 0 },
1180
- logOutUser: m,
1219
+ logOutUser: h,
1181
1220
  onCardClick: _,
1182
1221
  showBorder: !0,
1183
1222
  showCTAColocatedWithText: !1,
@@ -1191,11 +1230,11 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1191
1230
  visibleCardsCount: y
1192
1231
  }
1193
1232
  ) });
1194
- }, ko = M(Ro), Ho = M(({ chartLabel: t, chartColor: r }) => {
1195
- const { onEvent: n } = z(), {
1233
+ }, Vo = M(Po), Fo = M(({ chartLabel: t, chartColor: r }) => {
1234
+ const { onEvent: n } = $(), {
1196
1235
  categoryDetailsChartData: { monthlyAmounts: o, tooltipLabels: s }
1197
1236
  } = _e();
1198
- return /* @__PURE__ */ e(w, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
1237
+ return /* @__PURE__ */ e(x, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
1199
1238
  Be,
1200
1239
  {
1201
1240
  baseline: "min",
@@ -1224,14 +1263,14 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1224
1263
  valueFormatterString: "0,0"
1225
1264
  }
1226
1265
  ) });
1227
- }), No = M(({ onClose: t }) => {
1228
- const r = ut(), { is_mobile_webview: n } = ot(), { isDesktop: o, isSmallTablet: s, isTablet: c } = q(), { onEvent: a } = z(), { common: u, trends: d } = A(), { selectedCategoryData: i, selectedDateRangeMonthRange: y } = _e(), { sortedTransactions: m } = De(), [_, h] = g.useState(null);
1266
+ }), $o = M(({ onClose: t }) => {
1267
+ const r = ut(), { is_mobile_webview: n } = ot(), { isDesktop: o, isSmallTablet: s, isTablet: l } = q(), { onEvent: a } = $(), { common: u, trends: d } = A(), { selectedCategoryData: i, selectedDateRangeMonthRange: y } = _e(), { sortedTransactions: h } = De(), [_, m] = g.useState(null);
1229
1268
  if (!i)
1230
1269
  return null;
1231
- const { guid: p, name: f, is_income: x, totalAmount: b } = i, R = x ? d.category_income : d.category_spending, E = io(p, r), S = x ? d.income_label : d.spending_label, k = ` ${i.transactions.length === 1 ? d.transaction : d.transactions} (${i.transactions.length})`, H = g.useMemo(
1232
- () => m.find((I) => I.guid === _),
1233
- [_, m]
1234
- ), $ = m.length > 0 && !n && (o || c && !s), P = (I) => I.category_guid === p || I.top_level_category_guid === p, K = () => {
1270
+ const { guid: p, name: f, is_income: T, totalAmount: S } = i, R = T ? d.category_income : d.category_spending, E = go(p, r), w = T ? d.income_label : d.spending_label, k = ` ${i.transactions.length === 1 ? d.transaction : d.transactions} (${i.transactions.length})`, N = g.useMemo(
1271
+ () => h.find((L) => L.guid === _),
1272
+ [_, h]
1273
+ ), z = h.length > 0 && !n && (o || l && !s), P = (L) => L.category_guid === p || L.top_level_category_guid === p, K = () => {
1235
1274
  t?.(), a(v.TRENDS_CLICK_BACK, G);
1236
1275
  };
1237
1276
  return /* @__PURE__ */ C(
@@ -1243,21 +1282,21 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1243
1282
  shouldShowHeaderShadow: !0,
1244
1283
  title: R,
1245
1284
  children: [
1246
- /* @__PURE__ */ C(w, { sx: { alignItems: "center", height: "100%" }, children: [
1247
- /* @__PURE__ */ C(ao, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
1285
+ /* @__PURE__ */ C(x, { sx: { alignItems: "center", height: "100%" }, children: [
1286
+ /* @__PURE__ */ C(mo, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
1248
1287
  /* @__PURE__ */ e(
1249
1288
  st,
1250
1289
  {
1251
1290
  leftIcon: /* @__PURE__ */ e(ve, { categoryGuid: p }),
1252
- rightContent: oe(Math.abs(b), "0,0.00"),
1291
+ rightContent: oe(Math.abs(S), "0,0.00"),
1253
1292
  subtitle: y,
1254
1293
  title: f
1255
1294
  }
1256
1295
  ),
1257
- /* @__PURE__ */ e(Ho, { chartColor: E, chartLabel: S }),
1258
- /* @__PURE__ */ C(w, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
1296
+ /* @__PURE__ */ e(Fo, { chartColor: E, chartLabel: w }),
1297
+ /* @__PURE__ */ C(x, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
1259
1298
  /* @__PURE__ */ e(Q, { bold: !0, variant: "body1", children: k }),
1260
- $ && /* @__PURE__ */ e(lo, { filter: P })
1299
+ z && /* @__PURE__ */ e(ho, { filter: P })
1261
1300
  ] })
1262
1301
  ] }),
1263
1302
  /* @__PURE__ */ e(
@@ -1266,7 +1305,7 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1266
1305
  bgcolor: "transparent",
1267
1306
  filter: P,
1268
1307
  height: "calc(100vh - 475px)",
1269
- onClick: h
1308
+ onClick: m
1270
1309
  }
1271
1310
  )
1272
1311
  ] }),
@@ -1274,36 +1313,36 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1274
1313
  We,
1275
1314
  {
1276
1315
  ariaLabelClose: u.close_aria,
1277
- isOpen: !!H,
1278
- onClose: () => h(""),
1316
+ isOpen: !!N,
1317
+ onClose: () => m(""),
1279
1318
  title: d.transaction,
1280
- children: H && /* @__PURE__ */ e(ct, { transaction: H })
1319
+ children: N && /* @__PURE__ */ e(ct, { transaction: N })
1281
1320
  }
1282
1321
  )
1283
1322
  ]
1284
1323
  }
1285
1324
  );
1286
- }), Wo = (t, r) => {
1325
+ }), zo = (t, r) => {
1287
1326
  const n = at(t, r), o = rt(t, r);
1288
1327
  return [n, o].filter((s) => s.length > 0);
1289
- }, Oo = (t, r) => {
1290
- const [n, o] = t, s = n, c = o ?? n, a = [];
1328
+ }, Ko = (t, r) => {
1329
+ const [n, o] = t, s = n, l = o ?? n, a = [];
1291
1330
  if (s) {
1292
1331
  const u = s.reduce((d, i) => d + i.y, 0);
1293
1332
  a.push({ label: r.income_label, amount: u });
1294
1333
  }
1295
- if (c) {
1296
- const u = c.reduce((d, i) => d + i.y, 0);
1334
+ if (l) {
1335
+ const u = l.reduce((d, i) => d + i.y, 0);
1297
1336
  a.push({ label: r.spending_label, amount: u });
1298
1337
  }
1299
1338
  return a;
1300
- }, Go = ({
1339
+ }, Yo = ({
1301
1340
  availableHeight: t = 0,
1302
1341
  minHeight: r = 500,
1303
1342
  selectedDateRange: n,
1304
1343
  totals: o
1305
1344
  }) => {
1306
- const s = de(), { onEvent: c } = z(), { trends: a } = A(), { isSmallMobile: u, isMobile: d, isSmallTablet: i, isTablet: y } = q(), m = [s.palette.chart?.chart1, s.palette.chart?.chart2], _ = Wo(o, n), h = Oo(_, a), [p, f] = g.useState(0), x = 458, b = 195, R = 56, E = d || u ? b : i || y ? x : p;
1345
+ const s = de(), { onEvent: l } = $(), { trends: a } = A(), { isSmallMobile: u, isMobile: d, isSmallTablet: i, isTablet: y } = q(), h = [s.palette.chart?.chart1, s.palette.chart?.chart2], _ = zo(o, n), m = Ko(_, a), [p, f] = g.useState(0), T = 458, S = 195, R = 56, E = d || u ? S : i || y ? T : p;
1307
1346
  return g.useEffect(() => {
1308
1347
  const k = Math.max(t - R, r);
1309
1348
  f(k);
@@ -1311,13 +1350,13 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1311
1350
  Be,
1312
1351
  {
1313
1352
  baseline: "min",
1314
- colors: m,
1353
+ colors: h,
1315
1354
  curveType: "bump",
1316
1355
  datasets: _,
1317
1356
  height: E,
1318
- labels: h,
1357
+ labels: m,
1319
1358
  onItemClick: () => {
1320
- c(v.TRENDS_CLICK_CHART, G);
1359
+ l(v.TRENDS_CLICK_CHART, G);
1321
1360
  },
1322
1361
  showArea: !0,
1323
1362
  showAxisHighlight: !0,
@@ -1330,7 +1369,7 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1330
1369
  valueFormatterString: "0.0a"
1331
1370
  }
1332
1371
  );
1333
- }, Bo = M(Go), Po = [
1372
+ }, jo = M(Yo), Uo = [
1334
1373
  "BillAmountNotStandard",
1335
1374
  "CategorySpendingV2",
1336
1375
  "CostOfLivingToIncome",
@@ -1364,158 +1403,158 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1364
1403
  "WeeklyNewMerchantsV2",
1365
1404
  "WeeklyNoSpendDays",
1366
1405
  "WeeklySmallPurchasesSummary"
1367
- ], Vo = ({ onBackClick: t, onInsightCardClick: r, sx: n }) => {
1368
- const { onEvent: o } = z(), { config: s } = ot(), { isDesktop: c, isLargeDesktop: a, isMobile: u } = q(), { isAccountDataLoaded: d, loadAccountData: i, visibleAccounts: y } = Le(), {
1369
- categoriesLoaded: m,
1406
+ ], Xo = ({ onBackClick: t, onInsightCardClick: r, sx: n }) => {
1407
+ const { onEvent: o } = $(), { config: s } = ot(), { isDesktop: l, isLargeDesktop: a, isMobile: u } = q(), { isAccountDataLoaded: d, loadAccountData: i, visibleAccounts: y } = Ie(), {
1408
+ categoriesLoaded: h,
1370
1409
  loadCategories: _,
1371
- loadDateRangeCategoryTotals: h,
1410
+ loadDateRangeCategoryTotals: m,
1372
1411
  loadMonthlyCategoryTotals: p,
1373
1412
  monthlyCategoryTotals: f,
1374
- monthlyTotalsLoaded: x
1375
- } = J(), { isTransactionDataLoaded: b, loadTransactionData: R, setFilter: E } = De(), { selectedDateRange: S, setSelectedCategoryData: k, setSelectedDateRange: H } = _e(), { isInitialized: $, selectedAccounts: P, selectedAccountGuids: K } = Ce(), { trends: I, connect: te } = A(), { beatStore: O } = Ge(), se = co() && s.show_insights_widget_in_master, X = c || a, [ue, he] = g.useState(!1), [V, re] = g.useState(!1), [Y, ge] = g.useState("Chart"), [j, ae] = g.useState(""), [me, ie] = g.useState(!1), [le, D] = g.useState(window.innerHeight), F = X ? 56 : 0, l = le - 208, T = le - (se ? 550 + F : 266), [L, U] = g.useState(!1), ce = s.show_connections_widget_in_master;
1376
- Ie({
1413
+ monthlyTotalsLoaded: T
1414
+ } = J(), { isTransactionDataLoaded: S, loadTransactionData: R, setFilter: E } = De(), { selectedDateRange: w, setSelectedCategoryData: k, setSelectedDateRange: N } = _e(), { isInitialized: z, selectedAccounts: P, selectedAccountGuids: K } = Ce(), { trends: L, connect: te } = A(), { beatStore: O } = Ge(), se = po() && s.show_insights_widget_in_master, X = l || a, [ue, me] = g.useState(!1), [V, re] = g.useState(!1), [Y, ge] = g.useState("Chart"), [j, ae] = g.useState(""), [he, ie] = g.useState(!1), [le, D] = g.useState(window.innerHeight), F = X ? 56 : 0, c = le - 208, b = le - (se ? 550 + F : 266), [I, U] = g.useState(!1), ce = s.show_connections_widget_in_master;
1415
+ Le({
1377
1416
  widgetName: "TrendsWidget",
1378
1417
  isLoaded: ue
1379
1418
  });
1380
- const Te = g.useMemo(() => V ? O.getFilteredBeats({ templates: Po }) : [], [V]);
1419
+ const be = g.useMemo(() => V ? O.getFilteredBeats({ templates: Uo }) : [], [V]);
1381
1420
  g.useEffect(() => {
1382
- const N = () => D(window.innerHeight);
1383
- return window.addEventListener("resize", N), d || i().finally(), m || _().finally(), b || R().finally(), () => window.removeEventListener("resize", N);
1421
+ const H = () => D(window.innerHeight);
1422
+ return window.addEventListener("resize", H), d || i().finally(), h || _().finally(), S || R().finally(), () => window.removeEventListener("resize", H);
1384
1423
  }, []), g.useEffect(() => {
1385
- $ && (O.loadBeats().finally(() => re(!0)), h(P, S.start, S.end).then(() => {
1424
+ z && (O.loadBeats().finally(() => re(!0)), m(P, w.start, w.end).then(() => {
1386
1425
  p(
1387
1426
  P,
1388
- S.start,
1389
- S.end
1427
+ w.start,
1428
+ w.end
1390
1429
  );
1391
1430
  }).finally(() => {
1392
- he(!0), o(v.TRENDS_LOAD_WIDGET, {
1431
+ me(!0), o(v.TRENDS_LOAD_WIDGET, {
1393
1432
  ...G,
1394
- time_period: `${we(S.end, S.start)}M`
1433
+ time_period: `${we(w.end, w.start)}M`
1395
1434
  });
1396
1435
  }));
1397
- }, [$, P, S]), g.useEffect(() => {
1436
+ }, [z, P, w]), g.useEffect(() => {
1398
1437
  if (f.length !== 0) {
1399
- const N = {
1438
+ const H = {
1400
1439
  accounts: K,
1401
- dateRange: { start: S.start, end: S.end }
1440
+ dateRange: { start: w.start, end: w.end }
1402
1441
  };
1403
1442
  E({
1404
- ...N,
1443
+ ...H,
1405
1444
  custom: (ee) => !!f.find(
1406
1445
  (fe) => fe.top_level_category_guid === ee.top_level_category_guid || fe.category_guid === ee.category_guid
1407
1446
  )
1408
1447
  });
1409
1448
  }
1410
1449
  }, [f]);
1411
- const pe = (N) => {
1412
- k(N), ie(!0);
1450
+ const pe = (H) => {
1451
+ k(H), ie(!0);
1413
1452
  }, Me = () => {
1414
1453
  k(null), ie(!1);
1415
1454
  }, Ae = () => {
1416
1455
  U(!0), o(v.TRENDS_CLICK_CONNECT_ACCOUNTS);
1417
- }, ft = (N, ee) => {
1456
+ }, ft = (H, ee) => {
1418
1457
  ge(ee ?? Y), o(v.TRENDS_CLICK_TOGGLE_VIEW, {
1419
1458
  ...G,
1420
1459
  toggleView: ee
1421
1460
  });
1422
- }, yt = (N) => {
1423
- const ee = qe(N?.[0], 1), fe = N?.[1], bt = we(fe, ee);
1424
- H({ start: ee, end: fe }), o(v.TRENDS_CLICK_TIME_WINDOW, {
1461
+ }, yt = (H) => {
1462
+ const ee = qe(H?.[0], 1), fe = H?.[1], Tt = we(fe, ee);
1463
+ N({ start: ee, end: fe }), o(v.TRENDS_CLICK_TIME_WINDOW, {
1425
1464
  ...G,
1426
- time_period: bt + "M"
1465
+ time_period: Tt + "M"
1427
1466
  });
1428
- }, Ct = (N) => {
1467
+ }, Ct = (H) => {
1429
1468
  o(v.TRENDS_CLICK_FILTER, {
1430
1469
  ...G,
1431
- filterValue: N
1470
+ filterValue: H
1432
1471
  });
1433
- }, _t = (N) => {
1434
- ae(N);
1435
- }, Tt = () => {
1472
+ }, _t = (H) => {
1473
+ ae(H);
1474
+ }, bt = () => {
1436
1475
  ae(""), o(v.TRENDS_CLICK_ALL_CATEGORIES, G);
1437
1476
  };
1438
- if (!$ || !ue || !x) return /* @__PURE__ */ e(Ee, {});
1439
- const Pe = y && y.length === 0 || f.length === 0, be = {
1440
- description: ce ? I.empty_state_sub_text : I.empty_state_sub_text_no_aggregation,
1441
- header: ce ? I.zero_state_content_header : I.zero_state_content_header_no_aggregation,
1477
+ if (!z || !ue || !T) return /* @__PURE__ */ e(Ee, {});
1478
+ const Pe = y && y.length === 0 || f.length === 0, Te = {
1479
+ description: ce ? L.empty_state_sub_text : L.empty_state_sub_text_no_aggregation,
1480
+ header: ce ? L.zero_state_content_header : L.zero_state_content_header_no_aggregation,
1442
1481
  onClick: ce ? Ae : void 0,
1443
- primaryButton: ce ? I.empty_state_primary : void 0
1482
+ primaryButton: ce ? L.empty_state_primary : void 0
1444
1483
  };
1445
1484
  return /* @__PURE__ */ C(
1446
1485
  dt,
1447
1486
  {
1448
1487
  calendarActions: { onRangeChanged: yt },
1449
- dateRange: S,
1488
+ dateRange: w,
1450
1489
  dateRangeVariant: u ? "timeframetabs" : "timeframebuttons",
1451
1490
  onAccountsFilterClick: Ct,
1452
1491
  onBackClick: t,
1453
1492
  sx: n,
1454
- title: I.title,
1493
+ title: L.title,
1455
1494
  children: [
1456
1495
  /* @__PURE__ */ C(
1457
- w,
1496
+ x,
1458
1497
  {
1459
1498
  sx: {
1460
1499
  px: u ? 0 : 48
1461
1500
  },
1462
1501
  children: [
1463
1502
  /* @__PURE__ */ C(
1464
- w,
1503
+ x,
1465
1504
  {
1466
1505
  flexDirection: "row",
1467
1506
  justifyContent: "space-between",
1468
1507
  sx: { px: u ? 16 : 0, py: 16 },
1469
1508
  children: [
1470
1509
  /* @__PURE__ */ e(
1471
- mt,
1510
+ ht,
1472
1511
  {
1473
1512
  selectedCategoryGuid: j,
1474
- selectedDateRange: S
1513
+ selectedDateRange: w
1475
1514
  }
1476
1515
  ),
1477
1516
  /* @__PURE__ */ e(gt, { onTabChange: ft, selectedTab: Y })
1478
1517
  ]
1479
1518
  }
1480
1519
  ),
1481
- /* @__PURE__ */ e(w, { alignItems: "center", flexDirection: "row", sx: { pb: 8 }, width: "100%", children: /* @__PURE__ */ e(W, { flexGrow: 1, children: j && /* @__PURE__ */ C(Se, { onClick: Tt, sx: { p: 0, pr: 5 }, children: [
1482
- /* @__PURE__ */ e(Qt, {}),
1483
- I.all_categories
1520
+ /* @__PURE__ */ e(x, { alignItems: "center", flexDirection: "row", sx: { pb: 8 }, width: "100%", children: /* @__PURE__ */ e(W, { flexGrow: 1, children: j && /* @__PURE__ */ C(Se, { onClick: bt, sx: { p: 0, pr: 5 }, children: [
1521
+ /* @__PURE__ */ e(oo, {}),
1522
+ L.all_categories
1484
1523
  ] }) }) }),
1485
1524
  Pe && /* @__PURE__ */ e(
1486
- uo,
1525
+ fo,
1487
1526
  {
1488
- header: be.header,
1527
+ header: Te.header,
1489
1528
  icon: "multiline_chart",
1490
- onClick: be.onClick,
1491
- primaryButton: be.primaryButton,
1492
- subText: be.description,
1493
- sx: { height: l, maxWidth: 432 }
1529
+ onClick: Te.onClick,
1530
+ primaryButton: Te.primaryButton,
1531
+ subText: Te.description,
1532
+ sx: { height: c, maxWidth: 432 }
1494
1533
  }
1495
1534
  ),
1496
- !Pe && /* @__PURE__ */ C(w, { flexDirection: X ? "row" : "column", gap: X ? 48 : 16, children: [
1535
+ !Pe && /* @__PURE__ */ C(x, { flexDirection: X ? "row" : "column", gap: X ? 48 : 16, children: [
1497
1536
  Y === "Chart" && /* @__PURE__ */ C(St, { children: [
1498
1537
  /* @__PURE__ */ e(W, { sx: { width: X ? "68%" : "100%" }, children: /* @__PURE__ */ e(
1499
- Bo,
1538
+ jo,
1500
1539
  {
1501
- availableHeight: l,
1540
+ availableHeight: c,
1502
1541
  minHeight: 450,
1503
- selectedDateRange: S,
1542
+ selectedDateRange: w,
1504
1543
  totals: f
1505
1544
  }
1506
1545
  ) }),
1507
- /* @__PURE__ */ C(w, { gap: 16, sx: { width: X ? "32%" : "100%" }, children: [
1508
- se && V && Te.length > 0 && /* @__PURE__ */ e(
1509
- ko,
1546
+ /* @__PURE__ */ C(x, { gap: 16, sx: { width: X ? "32%" : "100%" }, children: [
1547
+ se && V && be.length > 0 && /* @__PURE__ */ e(
1548
+ Vo,
1510
1549
  {
1511
- beats: Te,
1550
+ beats: be,
1512
1551
  onInsightCardClick: r
1513
1552
  }
1514
1553
  ),
1515
1554
  /* @__PURE__ */ e(
1516
- Ao,
1555
+ Bo,
1517
1556
  {
1518
- availableHeight: T,
1557
+ availableHeight: b,
1519
1558
  onCategoryClick: pe
1520
1559
  }
1521
1560
  )
@@ -1527,30 +1566,30 @@ const ht = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
1527
1566
  height: "unset",
1528
1567
  onClickRow: _t,
1529
1568
  selectedCategory: j,
1530
- selectedDateRange: S
1569
+ selectedDateRange: w
1531
1570
  }
1532
1571
  ) })
1533
1572
  ] }),
1534
- me && /* @__PURE__ */ e(No, { onClose: Me })
1573
+ he && /* @__PURE__ */ e($o, { onClose: Me })
1535
1574
  ]
1536
1575
  }
1537
1576
  ),
1538
1577
  /* @__PURE__ */ e(
1539
- ho,
1578
+ yo,
1540
1579
  {
1541
1580
  onClose: () => U(!1),
1542
- showConnectWidget: L,
1581
+ showConnectWidget: I,
1543
1582
  title: te.mini_title
1544
1583
  }
1545
1584
  )
1546
1585
  ]
1547
1586
  }
1548
1587
  );
1549
- }, Qn = M(Vo);
1588
+ }, is = M(Xo);
1550
1589
  export {
1551
- Un as TrendsFullWidget,
1552
- Zn as TrendsMicroWidget,
1553
- Xn as TrendsMiniWidget,
1554
- es as TrendsStore,
1555
- Qn as TrendsWidget
1590
+ ss as TrendsFullWidget,
1591
+ as as TrendsMicroWidget,
1592
+ rs as TrendsMiniWidget,
1593
+ ds as TrendsStore,
1594
+ is as TrendsWidget
1556
1595
  };