@mx-cartographer/experiences 7.0.23-alpha.al10 → 7.0.23-alpha.al12

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 (58) hide show
  1. package/dist/{Account-CVVDlNDC.mjs → Account-BW3-oYEs.mjs} +1 -1
  2. package/dist/{AccountDetailsContent-bQKVSCZF.mjs → AccountDetailsContent-UxSEMBo_.mjs} +8 -8
  3. package/dist/{AccountDetailsHeader-BGQAu0Xm.mjs → AccountDetailsHeader-Eb3WvBGm.mjs} +8 -8
  4. package/dist/{AccountFields-CC7kzfPK.mjs → AccountFields-CIz-r3gP.mjs} +2 -2
  5. package/dist/{AccountListItem-wgvQjLxW.mjs → AccountListItem-B-ZjJ4Gp.mjs} +3 -3
  6. package/dist/{AccountStore-DpglOysH.mjs → AccountStore-DCDmxODy.mjs} +5 -5
  7. package/dist/{Accounts-ByViymVi.mjs → Accounts-CA-nqAjT.mjs} +1 -1
  8. package/dist/{BudgetUtil-gzgNEDE7.mjs → BudgetUtil-CeSLAcsl.mjs} +1 -1
  9. package/dist/{CategorySelectorDrawer-LpZcwQPa.mjs → CategorySelectorDrawer-BJ9jlCyt.mjs} +4 -4
  10. package/dist/{ConnectDrawer-C2minBK_.mjs → ConnectDrawer-phFH6OHt.mjs} +1 -1
  11. package/dist/{ConnectionsDrawer-Cd4dZuWL.mjs → ConnectionsDrawer-ihxkAi1P.mjs} +2 -2
  12. package/dist/{CurrencyInput-Dz4r9Rfe.mjs → CurrencyInput-bEx2Mbd0.mjs} +1 -1
  13. package/dist/{DebtsStore-B51DTXVj.mjs → DebtsStore-VkyMADzd.mjs} +1 -1
  14. package/dist/ExportCsvAction-CbMfQ2Wa.mjs +24 -0
  15. package/dist/{GoalStore-DqQ2FMx5.mjs → GoalStore-eSOkI6uE.mjs} +2 -2
  16. package/dist/{Help-DVPbIxMM.mjs → Help-KAAMEubC.mjs} +1 -1
  17. package/dist/{LineChart-DLk-bww5.mjs → LineChart-BWWmmJxV.mjs} +1 -1
  18. package/dist/{ListItemAction-DE6S0N5o.mjs → ListItemAction-DNZZ5fSa.mjs} +1 -1
  19. package/dist/{ManageIncome-BokhnWOn.mjs → ManageIncome-DbsiKUoO.mjs} +4 -4
  20. package/dist/{MicroWidgetContainer-5YscP1xa.mjs → MicroWidgetContainer-Dxz8uBN9.mjs} +1 -1
  21. package/dist/{MiniWidgetContainer-BlsgwNew.mjs → MiniWidgetContainer-CTyjmE1h.mjs} +1 -1
  22. package/dist/{NetWorthStore-C0hQSRzt.mjs → NetWorthStore-B6xF9eGH.mjs} +2 -2
  23. package/dist/{NotificationSettings-CWx6H-2z.mjs → NotificationSettings-BJFyyZYE.mjs} +2 -2
  24. package/dist/{OriginalBalanceAction-BKsSQVnI.mjs → OriginalBalanceAction-DepsKiJz.mjs} +3 -3
  25. package/dist/{RecurringSettings-CICRt51C.mjs → RecurringSettings-Dj29piAQ.mjs} +3 -3
  26. package/dist/ResponsiveButton-DZFp78fJ.mjs +45 -0
  27. package/dist/{TransactionDetails-BXl0m15s.mjs → TransactionDetails-C-z3HGTT.mjs} +37 -37
  28. package/dist/{TransactionStore-BElBVYfk.mjs → TransactionStore-0tLtBEIC.mjs} +209 -248
  29. package/dist/TrendsStore-WrHxzdbQ.mjs +565 -0
  30. package/dist/{User-DtwqVm3K.mjs → User-Dq9Qj764.mjs} +1 -1
  31. package/dist/ViewMoreMicroCard-DFAY0tA8.mjs +1974 -0
  32. package/dist/{WidgetContainer-DK8aZO5l.mjs → WidgetContainer-CdBs9WOZ.mjs} +2 -2
  33. package/dist/accounts/index.es.js +12 -12
  34. package/dist/analytics/index.es.js +8 -8
  35. package/dist/budgets/index.es.js +10 -10
  36. package/dist/cashflow/index.es.js +7 -7
  37. package/dist/categories/index.es.js +1 -1
  38. package/dist/common/index.es.js +518 -577
  39. package/dist/dashboard/index.es.js +9 -9
  40. package/dist/debts/index.es.js +9 -9
  41. package/dist/{exportTransactionsToCSV-Cf5VRYVr.mjs → exportTransactionsToCSV-BDlt8u0n.mjs} +1 -1
  42. package/dist/finstrong/index.es.js +6 -6
  43. package/dist/goals/index.es.js +11 -11
  44. package/dist/help/index.es.js +3 -3
  45. package/dist/{hooks-DUeXom8C.mjs → hooks-DkUqN6JE.mjs} +13 -13
  46. package/dist/investments/index.es.js +3 -3
  47. package/dist/merchants/index.es.js +1 -1
  48. package/dist/microinsights/index.es.js +14 -1969
  49. package/dist/networth/index.es.js +7 -7
  50. package/dist/notifications/index.es.js +2 -2
  51. package/dist/recurringtransactions/index.es.js +8 -8
  52. package/dist/settings/index.es.js +24 -24
  53. package/dist/spending/index.es.js +21 -21
  54. package/dist/transactions/index.es.js +259 -270
  55. package/dist/trends/index.es.js +784 -406
  56. package/package.json +1 -1
  57. package/dist/TrendsStore-DRuzsVVE.mjs +0 -505
  58. package/dist/TrendsWidget-CRi8EO04.mjs +0 -6
@@ -1,61 +1,73 @@
1
- import { jsx as e, jsxs as f } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as f, Fragment as Pe } from "react/jsx-runtime";
2
2
  import a from "react";
3
- import { observer as O } from "mobx-react-lite";
4
- import { Icon as ne, Text as oe, CategoryIcon as Se, P as V, H3 as be } from "@mxenabled/mxui";
5
- import z from "@mui/material/Box";
6
- import S from "@mui/material/Stack";
7
- import ce from "@mui/material/Button";
8
- import { addSeconds as ge } from "date-fns/addSeconds";
9
- import { differenceInCalendarMonths as se } from "date-fns/differenceInCalendarMonths";
10
- import { a as De, g as we, S as Ee, u as ve } from "../TrendsStore-DRuzsVVE.mjs";
11
- import { T as sn } from "../TrendsStore-DRuzsVVE.mjs";
12
- import { i as Ie, c as xe, d as Me, e as Re, f as Le, h as Ae, b as Ne, g as We, j as le } from "../SpendingData-D5vsfYKo.mjs";
13
- import He from "@mui/material/ToggleButton";
14
- import ke from "@mui/material/ToggleButtonGroup";
15
- import { u as R, j as G, g as j, a as Y, n as ae, c as q, s as he, k as Oe, p as ze, l as Ge } from "../hooks-DUeXom8C.mjs";
16
- import { u as re } from "../useScreenSize-B6JyS_Lj.mjs";
17
- import { f as K, D as k } from "../Dialog-CWW597AF.mjs";
18
- import { DataGridPro as Fe } from "@mui/x-data-grid-pro";
19
- import { C as Pe } from "../CurrencyText-YUhH2caW.mjs";
20
- import { c as fe } from "../Category-CevNQ03n.mjs";
21
- import { b as Ve } from "../Localization-2MODESHW.mjs";
22
- import { H as de } from "../HeaderCell-DjuifqHJ.mjs";
23
- import { T as B } from "../TrendsWidget-CRi8EO04.mjs";
24
- import { A as p, W as pe } from "../WidgetContainer-DK8aZO5l.mjs";
25
- import { a as Be, T as Ke } from "../TransactionDetails-BXl0m15s.mjs";
26
- import { D as $e } from "../Drawer-kEE73B87.mjs";
27
- import { L as $ } from "../Loader-DUaFpDGv.mjs";
28
- import { useTheme as je } from "@mui/material/styles";
29
- import { L as Ye } from "../LineChart-DLk-bww5.mjs";
30
- import { M as Ze } from "../MiniWidgetContainer-BlsgwNew.mjs";
31
- import { subMonths as Ue } from "date-fns";
32
- import { TrendingUp as Xe, TrendingDown as qe, MultilineChart as Je } from "@mxenabled/mx-icons";
33
- import { a as Qe, f as te } from "../NumberFormatting-CtWHhyBX.mjs";
34
- import { M as et } from "../MicroWidgetContainer-5YscP1xa.mjs";
35
- import { E as ue } from "../EmptyState-C0lr9E5T.mjs";
36
- const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
37
- ke,
3
+ import { observer as A } from "mobx-react-lite";
4
+ import { Icon as ae, Text as Q, CategoryIcon as Te, P as X, H3 as De, ChevronRightIcon as Ke } from "@mxenabled/mxui";
5
+ import O from "@mui/material/Box";
6
+ import _ from "@mui/material/Stack";
7
+ import Ce from "@mui/material/Button";
8
+ import { addSeconds as Ie } from "date-fns/addSeconds";
9
+ import { differenceInCalendarMonths as re } from "date-fns/differenceInCalendarMonths";
10
+ import { a as $e, g as je, S as Ye, L as Ee, u as Ue } from "../TrendsStore-WrHxzdbQ.mjs";
11
+ import { T as to } from "../TrendsStore-WrHxzdbQ.mjs";
12
+ import { i as Xe, c as Ze, d as Qe, e as qe, f as Je, h as et, b as Le, g as xe, j as _e } from "../SpendingData-D5vsfYKo.mjs";
13
+ import tt from "@mui/material/ToggleButton";
14
+ import nt from "@mui/material/ToggleButtonGroup";
15
+ import { u as R, k as K, e as N, a as $, f as ie, c as ce, v as ee, l as ve, p as ot, m as st } from "../hooks-DkUqN6JE.mjs";
16
+ import { u as j } from "../useScreenSize-B6JyS_Lj.mjs";
17
+ import { f as q, D as B } from "../Dialog-CWW597AF.mjs";
18
+ import { DataGridPro as rt } from "@mui/x-data-grid-pro";
19
+ import { C as at } from "../CurrencyText-YUhH2caW.mjs";
20
+ import { c as Me } from "../Category-CevNQ03n.mjs";
21
+ import { b as it } from "../Localization-2MODESHW.mjs";
22
+ import { H as be } from "../HeaderCell-DjuifqHJ.mjs";
23
+ import { T as M, b as ct } from "../ViewMoreMicroCard-DFAY0tA8.mjs";
24
+ import { A as y, W as Ae } from "../WidgetContainer-CdBs9WOZ.mjs";
25
+ import { a as Re, T as ke } from "../TransactionDetails-C-z3HGTT.mjs";
26
+ import { D as fe } from "../Drawer-kEE73B87.mjs";
27
+ import { L as J } from "../Loader-DUaFpDGv.mjs";
28
+ import { useTheme as Ne } from "@mui/material/styles";
29
+ import { L as ye } from "../LineChart-BWWmmJxV.mjs";
30
+ import { M as lt } from "../MiniWidgetContainer-CTyjmE1h.mjs";
31
+ import { subMonths as dt } from "date-fns";
32
+ import { TrendingUp as ht, TrendingDown as ut, MultilineChart as mt, ExpandLess as gt, ExpandMore as pt } from "@mxenabled/mx-icons";
33
+ import { a as Ct, f as Z } from "../NumberFormatting-CtWHhyBX.mjs";
34
+ import { M as ft } from "../MicroWidgetContainer-Dxz8uBN9.mjs";
35
+ import Tt from "@mui/material/Collapse";
36
+ import yt from "@mui/material/List";
37
+ import _t from "@mui/material/ListItem";
38
+ import bt from "@mui/material/ListItemButton";
39
+ import St from "@mui/material/ListItemIcon";
40
+ import wt from "@mui/material/ListItemText";
41
+ import He from "@mui/material/styles/useTheme";
42
+ import Dt from "@mui/material/Divider";
43
+ import { useTheme as It, Stack as Et } from "@mui/material";
44
+ import Lt from "@mui/material/Paper";
45
+ import { b as xt } from "../CategoryUtil-BR3H5i6n.mjs";
46
+ import { E as vt } from "../ExportCsvAction-CbMfQ2Wa.mjs";
47
+ import { E as Mt } from "../EmptyState-C0lr9E5T.mjs";
48
+ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
49
+ nt,
38
50
  {
39
51
  exclusive: !0,
40
- onChange: r,
52
+ onChange: o,
41
53
  orientation: "horizontal",
42
- value: t,
43
- children: ["Chart", "Table"].map((n) => /* @__PURE__ */ e(He, { color: "primary", sx: { width: 56 }, value: n, children: n === "Chart" ? /* @__PURE__ */ e(ne, { name: "table_chart_view" }) : /* @__PURE__ */ e(ne, { name: "format_list_bulleted" }) }, n))
54
+ value: n,
55
+ children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(tt, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(ae, { name: "table_chart_view" }) : /* @__PURE__ */ e(ae, { name: "format_list_bulleted" }) }, t))
44
56
  }
45
- ), nt = ({ selectedDateRange: t, selectedCategoryGuid: r }) => {
46
- const { trends: n } = R(), { isMobile: s, isDesktop: h } = re(), { getCategoryName: m } = G(), l = a.useMemo(() => {
47
- const u = K(
48
- t.start,
49
- s ? k.MONTH_SHORT_YEAR : k.MONTH_YEAR
50
- ), i = K(
51
- t.end,
52
- s ? k.MONTH_SHORT_YEAR : k.MONTH_YEAR
57
+ ), Oe = ({ selectedDateRange: n, selectedCategoryGuid: o }) => {
58
+ const { trends: t } = R(), { isMobile: s, isDesktop: i } = j(), { getCategoryName: h } = K(), d = a.useMemo(() => {
59
+ const l = q(
60
+ n.start,
61
+ s ? B.MONTH_SHORT_YEAR : B.MONTH_YEAR
62
+ ), c = q(
63
+ n.end,
64
+ s ? B.MONTH_SHORT_YEAR : B.MONTH_YEAR
53
65
  );
54
- return `${u} - ${i}`;
55
- }, [t, s]);
56
- return /* @__PURE__ */ f(z, { sx: { mr: 10, minWidth: "60%" }, children: [
66
+ return `${l} - ${c}`;
67
+ }, [n, s]);
68
+ return /* @__PURE__ */ f(O, { sx: { mr: 10, minWidth: "60%" }, children: [
57
69
  /* @__PURE__ */ e(
58
- oe,
70
+ Q,
59
71
  {
60
72
  display: "block",
61
73
  fontWeight: 700,
@@ -64,272 +76,272 @@ const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
64
76
  overflow: "visible",
65
77
  textOverflow: "unset"
66
78
  },
67
- variant: h ? "H3" : "Body",
68
- children: m(r) || n.sub_title
79
+ variant: i ? "H3" : "Body",
80
+ children: h(o) || t.sub_title
69
81
  }
70
82
  ),
71
- /* @__PURE__ */ e(oe, { variant: h ? "Body" : "Small", children: l })
83
+ /* @__PURE__ */ e(Q, { variant: i ? "Body" : "Small", children: d })
72
84
  ] });
73
- }, ot = (t) => {
74
- const r = t.row[t.field];
75
- return /* @__PURE__ */ e(S, { alignItems: "flex-end", tabIndex: t.tabIndex, children: /* @__PURE__ */ e(Pe, { amount: r, variant: "Small" }) });
76
- }, st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
77
- const { categories: n } = R(), s = n.default_categories[t]?.replace(/&/g, "&") ?? fe[t];
78
- return /* @__PURE__ */ f(S, { alignItems: "center", direction: "row", justifyContent: "center", children: [
85
+ }, At = (n) => {
86
+ const o = n.row[n.field];
87
+ return /* @__PURE__ */ e(_, { alignItems: "flex-end", tabIndex: n.tabIndex, children: /* @__PURE__ */ e(at, { amount: o, variant: "Small" }) });
88
+ }, Rt = ({ categoryGuid: n, topLevelCategoryGuid: o }) => {
89
+ const { categories: t } = R(), s = t.default_categories[n]?.replace(/&/g, "&") ?? Me[n];
90
+ return /* @__PURE__ */ f(_, { alignItems: "center", direction: "row", justifyContent: "center", children: [
79
91
  /* @__PURE__ */ e(
80
- z,
92
+ O,
81
93
  {
82
- "aria-label": Ve(n.category_icon_label_aria, s),
94
+ "aria-label": it(t.category_icon_label_aria, s),
83
95
  role: "img",
84
- children: /* @__PURE__ */ e(Se, { categoryGuid: r })
96
+ children: /* @__PURE__ */ e(Te, { categoryGuid: o })
85
97
  }
86
98
  ),
87
- /* @__PURE__ */ e(oe, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
99
+ /* @__PURE__ */ e(Q, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
88
100
  ] });
89
- }, at = (t) => /* @__PURE__ */ e(S, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
90
- st,
101
+ }, kt = (n) => /* @__PURE__ */ e(_, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
102
+ Rt,
91
103
  {
92
- categoryGuid: t.row.category,
93
- topLevelCategoryGuid: t.row.top_level_category_guid
104
+ categoryGuid: n.row.category,
105
+ topLevelCategoryGuid: n.row.top_level_category_guid
94
106
  }
95
- ) }), rt = (t, r) => {
96
- const n = [], s = new Date(t);
97
- for (; s <= r; ) {
98
- const h = K(s, k.MONTH);
99
- n.push(h), s.setMonth(s.getMonth() + 1);
107
+ ) }), Nt = (n, o) => {
108
+ const t = [], s = new Date(n);
109
+ for (; s <= o; ) {
110
+ const i = q(s, B.MONTH);
111
+ t.push(i), s.setMonth(s.getMonth() + 1);
100
112
  }
101
- return n;
102
- }, it = ({
103
- monthlyCategoryTotals: t,
104
- selectedDateRange: r,
105
- selectedCategory: n,
113
+ return t;
114
+ }, Ve = ({
115
+ monthlyCategoryTotals: n,
116
+ selectedDateRange: o,
117
+ selectedCategory: t,
106
118
  onClickRow: s,
107
- height: h = "100dvh",
108
- sx: m = {}
119
+ height: i = "100dvh",
120
+ sx: h = {}
109
121
  }) => {
110
- const { onEvent: l } = j(), u = K(/* @__PURE__ */ new Date(), k.MONTH_SHORT), [i, _] = a.useState([
111
- { field: u, sort: "desc" }
112
- ]), y = a.useMemo(() => rt(r.start, r.end), [r]), c = [
122
+ const { onEvent: d } = N(), l = q(/* @__PURE__ */ new Date(), B.MONTH_SHORT), [c, m] = a.useState([
123
+ { field: l, sort: "desc" }
124
+ ]), C = a.useMemo(() => Nt(o.start, o.end), [o]), u = [
113
125
  {
114
126
  field: "category",
115
127
  flex: 1,
116
128
  headerName: "Category",
117
129
  minWidth: 175,
118
- renderHeader: de,
119
- renderCell: at,
130
+ renderHeader: be,
131
+ renderCell: kt,
120
132
  sortable: !0,
121
133
  type: "string"
122
134
  },
123
- ...y.map(
124
- (o) => ({
125
- field: o,
135
+ ...C.map(
136
+ (r) => ({
137
+ field: r,
126
138
  flex: 1,
127
- headerName: o,
139
+ headerName: r,
128
140
  minWidth: 100,
129
- renderHeader: de,
130
- renderCell: ot,
141
+ renderHeader: be,
142
+ renderCell: At,
131
143
  align: "right",
132
144
  headerAlign: "right",
133
145
  sortable: !0,
134
146
  hideSortIcons: !1,
135
147
  type: "number",
136
- sortComparator: De
148
+ sortComparator: $e
137
149
  })
138
150
  )
139
- ], C = a.useMemo(() => {
140
- const o = t.filter(
141
- (d) => !Ie(d) && !xe(d)
142
- ), D = (n ? o.filter(
143
- (d) => d.category_guid === n || d.top_level_category_guid === n
144
- ) : o).reduce(
145
- (d, x) => {
146
- const { category_guid: v, top_level_category_guid: M, month: A, total: w, year: L } = x, E = n ? v : M;
147
- d[E] || (d[E] = {
148
- id: E,
149
- category: E,
150
- category_guid: v,
151
- top_level_category_guid: M
151
+ ], b = a.useMemo(() => {
152
+ const r = n.filter(
153
+ (p) => !Xe(p) && !Ze(p)
154
+ ), T = (t ? r.filter(
155
+ (p) => p.category_guid === t || p.top_level_category_guid === t
156
+ ) : r).reduce(
157
+ (p, w) => {
158
+ const { category_guid: D, top_level_category_guid: E, month: k, total: I, year: H } = w, L = t ? D : E;
159
+ p[L] || (p[L] = {
160
+ id: L,
161
+ category: L,
162
+ category_guid: D,
163
+ top_level_category_guid: E
152
164
  });
153
- const T = K(new Date(L, A - 1), k.MONTH_SHORT);
154
- return d[E][T] || (d[E][T] = 0), d[E][T] = d[E][T] + Math.abs(w), d;
165
+ const x = q(new Date(H, k - 1), B.MONTH_SHORT);
166
+ return p[L][x] || (p[L][x] = 0), p[L][x] = p[L][x] + Math.abs(I), p;
155
167
  },
156
168
  {}
157
169
  );
158
- return Object.values(D);
159
- }, [t, n]);
160
- return /* @__PURE__ */ e(z, { sx: { height: h, width: "100%", overflowX: "auto", boxShadow: "none", ...m }, children: /* @__PURE__ */ e(
161
- Fe,
170
+ return Object.values(T);
171
+ }, [n, t]);
172
+ return /* @__PURE__ */ e(O, { sx: { height: i, width: "100%", overflowX: "auto", boxShadow: "none", ...h }, children: /* @__PURE__ */ e(
173
+ rt,
162
174
  {
163
- columns: c,
175
+ columns: u,
164
176
  disableColumnFilter: !0,
165
177
  disableColumnMenu: !0,
166
178
  hideFooter: !0,
167
- initialState: { sorting: { sortModel: i } },
168
- onRowClick: (o) => {
169
- s?.(o.row.category), l(p.TRENDS_CLICK_LIST_ITEM, {
170
- ...B,
171
- listItem: fe[o.row.category]
179
+ initialState: { sorting: { sortModel: c } },
180
+ onRowClick: (r) => {
181
+ s?.(r.row.category), d(y.TRENDS_CLICK_LIST_ITEM, {
182
+ ...M,
183
+ listItem: Me[r.row.category]
172
184
  });
173
185
  },
174
- onSortModelChange: (o) => {
175
- _(o), l(p.TRENDS_CLICK_TABLE_SORT, B);
186
+ onSortModelChange: (r) => {
187
+ m(r), d(y.TRENDS_CLICK_TABLE_SORT, M);
176
188
  },
177
- rows: C,
189
+ rows: b,
178
190
  slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
179
- sortModel: i,
191
+ sortModel: c,
180
192
  sortingOrder: ["asc", "desc"]
181
193
  }
182
194
  ) });
183
- }, ct = {
195
+ }, Ht = {
184
196
  title: "Transaction List"
185
- }, lt = ({
186
- categoryGuid: t,
187
- dateRange: r,
188
- isOpen: n,
197
+ }, Wt = ({
198
+ categoryGuid: n,
199
+ dateRange: o,
200
+ isOpen: t,
189
201
  onClose: s
190
202
  }) => {
191
- const { onEvent: h } = j(), { selectedAccountGuids: m } = Y(), { common: l } = R(), { setFilter: u, sortedTransactions: i } = ae(), [_, y] = a.useState(""), c = a.useMemo(
192
- () => i.find((o) => o.guid === _),
193
- [_, i]
203
+ const { onEvent: i } = N(), { selectedAccountGuids: h } = $(), { common: d } = R(), { setFilter: l, sortedTransactions: c } = ie(), [m, C] = a.useState(""), u = a.useMemo(
204
+ () => c.find((r) => r.guid === m),
205
+ [m, c]
194
206
  );
195
207
  a.useEffect(() => {
196
- u({
197
- accounts: m,
198
- dateRange: r,
199
- custom: (o) => t === "" || t === o.category_guid || t === o.top_level_category_guid,
200
- showSplits: !!t
208
+ l({
209
+ accounts: h,
210
+ dateRange: o,
211
+ custom: (r) => n === "" || n === r.category_guid || n === r.top_level_category_guid,
212
+ showSplits: !!n
201
213
  });
202
- }, [m, t, r]), a.useEffect(() => h(p.TRENDS_VIEW_TRANSACTIONS), []);
203
- const C = () => {
204
- y(""), s();
214
+ }, [h, n, o]), a.useEffect(() => i(y.TRENDS_VIEW_TRANSACTIONS), []);
215
+ const b = () => {
216
+ C(""), s();
205
217
  };
206
218
  return /* @__PURE__ */ f(
207
- $e,
219
+ fe,
208
220
  {
209
- ariaLabelClose: l.close_aria,
210
- isOpen: n,
211
- onClose: C,
212
- title: ct.title,
221
+ ariaLabelClose: d.close_aria,
222
+ isOpen: t,
223
+ onClose: b,
224
+ title: Ht.title,
213
225
  children: [
214
- c && /* @__PURE__ */ e(Be, { transaction: c }),
215
- !c && /* @__PURE__ */ e(Ke, { onClick: y })
226
+ u && /* @__PURE__ */ e(Re, { transaction: u }),
227
+ !u && /* @__PURE__ */ e(ke, { onClick: C })
216
228
  ]
217
229
  }
218
230
  );
219
- }, dt = O(lt), ut = ({ onBackClick: t, sx: r }) => {
220
- const { onEvent: n } = j(), { isDesktop: s, isTablet: h, isMobile: m } = re(), { visibleAccounts: l } = q(), { loadMonthlyCategoryTotals: u, monthlyCategoryTotals: i, getCategoryName: _ } = G(), { sortedTransactions: y } = ae(), { selectedDateRange: c, setSelectedDateRange: C } = he(), { isCopyLoaded: o, isInitialized: b, selectedAccounts: D, setSelectedAccounts: d } = Y(), { trends: x } = R(), [v, M] = a.useState(!1), [A, w] = a.useState(!1), [L, E] = a.useState("Chart"), [T, F] = a.useState(""), [Z, J] = a.useState(window.innerHeight), U = Z - (m ? 315 : 345);
231
+ }, Ot = A(Wt), Vt = ({ onBackClick: n, sx: o }) => {
232
+ const { onEvent: t } = N(), { isDesktop: s, isTablet: i, isMobile: h } = j(), { visibleAccounts: d } = ce(), { loadMonthlyCategoryTotals: l, monthlyCategoryTotals: c, getCategoryName: m } = K(), { sortedTransactions: C } = ie(), { selectedDateRange: u, setSelectedDateRange: b } = ee(), { isCopyLoaded: r, isInitialized: g, selectedAccounts: T, setSelectedAccounts: p } = $(), { trends: w } = R(), [D, E] = a.useState(!1), [k, I] = a.useState(!1), [H, L] = a.useState("Chart"), [x, z] = a.useState(""), [le, F] = a.useState(window.innerHeight), de = le - (h ? 315 : 345);
221
233
  a.useEffect(() => {
222
- const g = () => J(window.innerHeight);
223
- return window.addEventListener("resize", g), () => window.removeEventListener("resize", g);
234
+ const S = () => F(window.innerHeight);
235
+ return window.addEventListener("resize", S), () => window.removeEventListener("resize", S);
224
236
  }, []), a.useEffect(() => {
225
- d(l);
226
- }, [l]), a.useEffect(() => {
227
- b && u(
228
- D,
229
- c.start,
230
- c.end
237
+ p(d);
238
+ }, [d]), a.useEffect(() => {
239
+ g && l(
240
+ T,
241
+ u.start,
242
+ u.end
231
243
  ).finally(() => {
232
- M(!0);
244
+ E(!0);
233
245
  });
234
- }, [b, D, c]);
235
- const X = a.useMemo(() => {
236
- if (!v) return { stackedDatasets: [], unstackedDatasets: [] };
237
- const g = we(
238
- i,
239
- c.start,
240
- c.end
241
- ), H = T.length ? g.filter(
242
- (P) => P.top_level_category_guid === T || P.category_guid === T
243
- ) : Me(g);
246
+ }, [g, T, u]);
247
+ const P = a.useMemo(() => {
248
+ if (!D) return { stackedDatasets: [], unstackedDatasets: [] };
249
+ const S = je(
250
+ c,
251
+ u.start,
252
+ u.end
253
+ ), W = x.length ? S.filter(
254
+ (G) => G.top_level_category_guid === x || G.category_guid === x
255
+ ) : Qe(S);
244
256
  return {
245
- stackedDatasets: H.filter(Re),
246
- unstackedDatasets: H.filter(Le)
257
+ stackedDatasets: W.filter(qe),
258
+ unstackedDatasets: W.filter(Je)
247
259
  };
248
- }, [i, T, c]), Q = (g, H) => {
249
- E(H ?? L), n(p.TRENDS_CLICK_TOGGLE_VIEW);
250
- }, I = (g) => {
251
- const H = ge(g?.[0], 1), P = g?.[1], Ce = se(P, H);
252
- C({ start: H, end: P }), n(p.TRENDS_CLICK_TIME_WINDOW, {
253
- time_period: Ce + "M"
260
+ }, [c, x, u]), te = (S, W) => {
261
+ L(W ?? H), t(y.TRENDS_CLICK_TOGGLE_VIEW);
262
+ }, he = (S) => {
263
+ const W = Ie(S?.[0], 1), G = S?.[1], pe = re(G, W);
264
+ b({ start: W, end: G }), t(y.TRENDS_CLICK_TIME_WINDOW, {
265
+ time_period: pe + "M"
254
266
  });
255
- }, N = () => {
256
- n(p.TRENDS_CLICK_FILTER);
257
- }, W = (g) => {
258
- F(g);
259
- }, ee = (g) => {
260
- F(g), n(p.TRENDS_CLICK_LEGEND, { category: _(g) });
261
- }, _e = (g) => {
262
- n(p.TRENDS_HOVER_LEGEND, { category: _(g) });
263
- }, ye = (g) => {
264
- n(p.TRENDS_HOVER_AREA, { category: g });
265
- }, Te = (g) => {
266
- n(p.TRENDS_HOVER_POINT, { category: g });
267
+ }, ne = () => {
268
+ t(y.TRENDS_CLICK_FILTER);
269
+ }, oe = (S) => {
270
+ z(S);
271
+ }, ue = (S) => {
272
+ z(S), t(y.TRENDS_CLICK_LEGEND, { category: m(S) });
273
+ }, se = (S) => {
274
+ t(y.TRENDS_HOVER_LEGEND, { category: m(S) });
275
+ }, me = (S) => {
276
+ t(y.TRENDS_HOVER_AREA, { category: S });
277
+ }, ge = (S) => {
278
+ t(y.TRENDS_HOVER_POINT, { category: S });
267
279
  };
268
- return !o || !b || !v ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ f(
269
- pe,
280
+ return !r || !g || !D ? /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ f(
281
+ Ae,
270
282
  {
271
- accountOptions: l,
272
- calendarActions: { onRangeChanged: I },
273
- dateRange: c,
283
+ accountOptions: d,
284
+ calendarActions: { onRangeChanged: he },
285
+ dateRange: u,
274
286
  dateRangeVariant: "timeframebuttons",
275
- onAccountsFilterClick: N,
276
- onBackClick: t,
277
- sx: r,
278
- title: x.title,
287
+ onAccountsFilterClick: ne,
288
+ onBackClick: n,
289
+ sx: o,
290
+ title: w.title,
279
291
  children: [
280
292
  /* @__PURE__ */ f(
281
- S,
293
+ _,
282
294
  {
283
295
  sx: {
284
296
  // eslint-disable-next-line no-nested-ternary
285
- px: s ? 48 : h ? 24 : 12
297
+ px: s ? 48 : i ? 24 : 12
286
298
  },
287
299
  children: [
288
300
  /* @__PURE__ */ f(
289
- S,
301
+ _,
290
302
  {
291
303
  flexDirection: "row",
292
304
  justifyContent: "space-between",
293
- sx: { pb: m ? 12 : 24, pt: m ? 24 : 48 },
305
+ sx: { pb: h ? 12 : 24, pt: h ? 24 : 48 },
294
306
  children: [
295
307
  /* @__PURE__ */ e(
296
- nt,
308
+ Oe,
297
309
  {
298
- selectedCategoryGuid: T,
299
- selectedDateRange: c
310
+ selectedCategoryGuid: x,
311
+ selectedDateRange: u
300
312
  }
301
313
  ),
302
- /* @__PURE__ */ e(tt, { onTabChange: Q, selectedTab: L })
314
+ /* @__PURE__ */ e(We, { onTabChange: te, selectedTab: H })
303
315
  ]
304
316
  }
305
317
  ),
306
- /* @__PURE__ */ f(S, { alignItems: "center", flexDirection: "row", width: "100%", children: [
307
- /* @__PURE__ */ e(z, { flexGrow: 1, children: T && /* @__PURE__ */ f(ce, { onClick: () => F(""), sx: { p: 0, pr: 5 }, children: [
308
- /* @__PURE__ */ e(ne, { name: "arrow_back" }),
309
- x.all_categories
318
+ /* @__PURE__ */ f(_, { alignItems: "center", flexDirection: "row", width: "100%", children: [
319
+ /* @__PURE__ */ e(O, { flexGrow: 1, children: x && /* @__PURE__ */ f(Ce, { onClick: () => z(""), sx: { p: 0, pr: 5 }, children: [
320
+ /* @__PURE__ */ e(ae, { name: "arrow_back" }),
321
+ w.all_categories
310
322
  ] }) }),
311
- /* @__PURE__ */ e(ce, { onClick: () => w(!0), sx: { px: 5 }, children: `${x.view_transactions} (${y.length})` })
323
+ /* @__PURE__ */ e(Ce, { onClick: () => I(!0), sx: { px: 5 }, children: `${w.view_transactions} (${C.length})` })
312
324
  ] }),
313
- /* @__PURE__ */ f(z, { children: [
314
- L === "Chart" && /* @__PURE__ */ e(
315
- Ee,
325
+ /* @__PURE__ */ f(O, { children: [
326
+ H === "Chart" && /* @__PURE__ */ e(
327
+ Ye,
316
328
  {
317
- availableHeight: U,
318
- onClickLegend: ee,
319
- onHoverArea: ye,
320
- onHoverLegend: _e,
321
- onHoverPoint: Te,
322
- stackedDatasets: X.stackedDatasets,
323
- unstackedDatasets: X.unstackedDatasets
329
+ availableHeight: de,
330
+ onClickLegend: ue,
331
+ onHoverArea: me,
332
+ onHoverLegend: se,
333
+ onHoverPoint: ge,
334
+ stackedDatasets: P.stackedDatasets,
335
+ unstackedDatasets: P.unstackedDatasets
324
336
  }
325
337
  ),
326
- L === "Table" && /* @__PURE__ */ e(
327
- it,
338
+ H === "Table" && /* @__PURE__ */ e(
339
+ Ve,
328
340
  {
329
- monthlyCategoryTotals: i,
330
- onClickRow: W,
331
- selectedCategory: T,
332
- selectedDateRange: c
341
+ monthlyCategoryTotals: c,
342
+ onClickRow: oe,
343
+ selectedCategory: x,
344
+ selectedDateRange: u
333
345
  }
334
346
  )
335
347
  ] })
@@ -337,27 +349,27 @@ const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
337
349
  }
338
350
  ),
339
351
  /* @__PURE__ */ e(
340
- dt,
352
+ Ot,
341
353
  {
342
- categoryGuid: T,
343
- dateRange: c,
344
- isOpen: A,
345
- onClose: () => w(!1)
354
+ categoryGuid: x,
355
+ dateRange: u,
356
+ isOpen: k,
357
+ onClose: () => I(!1)
346
358
  }
347
359
  )
348
360
  ]
349
361
  }
350
362
  );
351
- }, Jt = O(ut), mt = () => {
352
- const t = je(), { monthlyCategoryTotals: r } = G(), { trends: n } = R(), s = Ae(r);
363
+ }, Xn = A(Vt), Gt = () => {
364
+ const n = Ne(), { monthlyCategoryTotals: o } = K(), { trends: t } = R(), s = et(o);
353
365
  return /* @__PURE__ */ e(
354
- Ye,
366
+ ye,
355
367
  {
356
368
  baseline: "min",
357
- colors: [t.palette.primary.main],
369
+ colors: [n.palette.primary.main],
358
370
  datasets: [s],
359
371
  height: 300,
360
- labels: [n.spending_label],
372
+ labels: [t.spending_label],
361
373
  showArea: !0,
362
374
  showAverage: !0,
363
375
  showLegend: !0,
@@ -366,37 +378,37 @@ const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
366
378
  valueFormatterString: "0,0"
367
379
  }
368
380
  );
369
- }, gt = O(mt), ht = ({ onPrimaryCtaClick: t, sx: r }) => {
370
- const { visibleAccounts: n } = q(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: h } = G(), { isInitialized: m } = Oe(), { trends: l } = R(), { isCopyLoaded: u, selectedAccounts: i, setSelectedAccounts: _ } = Y();
381
+ }, Bt = A(Gt), zt = ({ onPrimaryCtaClick: n, sx: o }) => {
382
+ const { visibleAccounts: t } = ce(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: i } = K(), { isInitialized: h } = ve(), { trends: d } = R(), { isCopyLoaded: l, selectedAccounts: c, setSelectedAccounts: m } = $();
371
383
  return a.useEffect(() => {
372
- _(n);
373
- }, [n]), a.useEffect(() => {
374
- m && s(i).finally();
375
- }, [m, i]), !u || !m ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(
376
- Ze,
384
+ m(t);
385
+ }, [t]), a.useEffect(() => {
386
+ h && s(c).finally();
387
+ }, [h, c]), !l || !h ? /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ e(
388
+ lt,
377
389
  {
378
- onPrimaryCtaClick: t,
379
- primaryCtaLabel: l.primary_cta,
380
- subTitle: l.sub_title,
381
- sx: r,
382
- title: l.mini_title,
383
- children: h ? /* @__PURE__ */ e(gt, {}) : /* @__PURE__ */ e($, {})
390
+ onPrimaryCtaClick: n,
391
+ primaryCtaLabel: d.primary_cta,
392
+ subTitle: d.sub_title,
393
+ sx: o,
394
+ title: d.mini_title,
395
+ children: i ? /* @__PURE__ */ e(Bt, {}) : /* @__PURE__ */ e(J, {})
384
396
  }
385
397
  );
386
- }, Qt = O(ht), ft = 70, me = ({
387
- title: t,
388
- totalAmount: r,
389
- transactionType: n,
398
+ }, Zn = A(zt), Ft = 70, Se = ({
399
+ title: n,
400
+ totalAmount: o,
401
+ transactionType: t,
390
402
  percentage: s,
391
- secondaryLabel: h,
392
- shouldDisplayPercentage: m
403
+ secondaryLabel: i,
404
+ shouldDisplayPercentage: h
393
405
  }) => {
394
- const { availableWidth: l } = ze(), u = a.useRef(null), i = a.useRef(null), _ = Qe(Number(Math.abs(s)), {
406
+ const { availableWidth: d } = ot(), l = a.useRef(null), c = a.useRef(null), m = Ct(Number(Math.abs(s)), {
395
407
  style: "percent",
396
408
  minimumIntegerDigits: 1
397
- }), y = l === 288 && te(r, "0,0.00").length > 10 ? te(r, "0,0") : te(r, "0,0.00"), c = n === "spending" ? s > 0 : s >= 0, C = n === "spending" ? "error.main" : "success.main", o = n === "spending" ? "success.main" : "text.secondary", b = u?.current, D = i?.current, d = b && D ? b.scrollWidth > D.clientWidth - ft : !1;
409
+ }), C = d === 288 && Z(o, "0,0.00").length > 10 ? Z(o, "0,0") : Z(o, "0,0.00"), u = t === "spending" ? s > 0 : s >= 0, b = t === "spending" ? "error.main" : "success.main", r = t === "spending" ? "success.main" : "text.secondary", g = l?.current, T = c?.current, p = g && T ? g.scrollWidth > T.clientWidth - Ft : !1;
398
410
  return /* @__PURE__ */ f(
399
- S,
411
+ _,
400
412
  {
401
413
  sx: {
402
414
  border: 1,
@@ -409,7 +421,7 @@ const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
409
421
  },
410
422
  children: [
411
423
  /* @__PURE__ */ f(
412
- S,
424
+ _,
413
425
  {
414
426
  sx: {
415
427
  alignItems: "center",
@@ -417,18 +429,18 @@ const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
417
429
  justifyContent: "space-between"
418
430
  },
419
431
  children: [
420
- /* @__PURE__ */ e(V, { color: "text.secondary", variant: "caption", children: t }),
421
- m && /* @__PURE__ */ f(S, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
422
- c ? /* @__PURE__ */ e(Xe, { size: 20, sx: { color: C } }) : /* @__PURE__ */ e(qe, { size: 20, sx: { color: o } }),
432
+ /* @__PURE__ */ e(X, { color: "text.secondary", variant: "caption", children: n }),
433
+ h && /* @__PURE__ */ f(_, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
434
+ u ? /* @__PURE__ */ e(ht, { size: 20, sx: { color: b } }) : /* @__PURE__ */ e(ut, { size: 20, sx: { color: r } }),
423
435
  /* @__PURE__ */ e(
424
- V,
436
+ X,
425
437
  {
426
438
  sx: {
427
- color: c ? C : o,
439
+ color: u ? b : r,
428
440
  fontWeight: 600
429
441
  },
430
442
  variant: "body2",
431
- children: _
443
+ children: m
432
444
  }
433
445
  )
434
446
  ] })
@@ -436,9 +448,9 @@ const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
436
448
  }
437
449
  ),
438
450
  /* @__PURE__ */ f(
439
- S,
451
+ _,
440
452
  {
441
- ref: i,
453
+ ref: c,
442
454
  sx: {
443
455
  alignItems: "center",
444
456
  flexDirection: "row",
@@ -446,19 +458,19 @@ const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
446
458
  },
447
459
  children: [
448
460
  /* @__PURE__ */ e(
449
- z,
461
+ O,
450
462
  {
451
- ref: u,
463
+ ref: l,
452
464
  sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
453
- children: /* @__PURE__ */ e(be, { children: y })
465
+ children: /* @__PURE__ */ e(De, { children: C })
454
466
  }
455
467
  ),
456
- m && l >= 450 && !d && /* @__PURE__ */ e(
457
- V,
468
+ h && d >= 450 && !p && /* @__PURE__ */ e(
469
+ X,
458
470
  {
459
- color: c ? C : o,
471
+ color: u ? b : r,
460
472
  variant: "caption",
461
- children: h
473
+ children: i
462
474
  }
463
475
  )
464
476
  ]
@@ -467,50 +479,50 @@ const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
467
479
  ]
468
480
  }
469
481
  );
470
- }, pt = O(() => {
471
- const { trends: t } = R();
472
- return /* @__PURE__ */ f(S, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
473
- /* @__PURE__ */ e(Je, { size: 32 }),
474
- /* @__PURE__ */ f(S, { children: [
475
- /* @__PURE__ */ e(V, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
476
- /* @__PURE__ */ e(V, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
482
+ }, Pt = A(() => {
483
+ const { trends: n } = R();
484
+ return /* @__PURE__ */ f(_, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
485
+ /* @__PURE__ */ e(mt, { size: 32 }),
486
+ /* @__PURE__ */ f(_, { children: [
487
+ /* @__PURE__ */ e(X, { fontWeight: 600, variant: "body1", children: n.zero_state_content_header }),
488
+ /* @__PURE__ */ e(X, { color: "text.secondary", variant: "subtitle2", children: n.zero_state_content_description })
477
489
  ] })
478
490
  ] });
479
- }), en = O(({ onCtaClick: t }) => {
480
- const { visibleAccounts: r } = q(), { onEvent: n } = j(), { monthlyCategoryTotals: s, loadMonthlyCategoryTotals: h, monthlyTotalsLoaded: m } = G(), l = {
481
- start: Ue(/* @__PURE__ */ new Date(), 1),
491
+ }), Qn = A(({ onCtaClick: n }) => {
492
+ const { visibleAccounts: o } = ce(), { onEvent: t } = N(), { monthlyCategoryTotals: s, loadMonthlyCategoryTotals: i, monthlyTotalsLoaded: h } = K(), d = {
493
+ start: dt(/* @__PURE__ */ new Date(), 1),
482
494
  end: /* @__PURE__ */ new Date()
483
- }, { trends: u } = R(), { selectedAccounts: i, setSelectedAccounts: _, isInitialized: y } = Y();
495
+ }, { trends: l } = R(), { selectedAccounts: c, setSelectedAccounts: m, isInitialized: C } = $();
484
496
  a.useEffect(() => {
485
- _(r);
486
- }, [r]), a.useEffect(() => {
487
- y && h(i, l.start).then(() => {
488
- n(p.TRENDS_LOAD_WIDGET, {
489
- state: r?.length ? "default" : "zeroState"
497
+ m(o);
498
+ }, [o]), a.useEffect(() => {
499
+ C && i(c, d.start).then(() => {
500
+ t(y.TRENDS_LOAD_WIDGET, {
501
+ state: o?.length ? "default" : "zeroState"
490
502
  });
491
503
  });
492
- }, [y, i]);
493
- const { spendingData: c, incomeData: C } = a.useMemo(
504
+ }, [C, c]);
505
+ const { spendingData: u, incomeData: b } = a.useMemo(
494
506
  () => ({
495
- spendingData: Ne(s, l),
496
- incomeData: We(s, l)
507
+ spendingData: Le(s, d),
508
+ incomeData: xe(s, d)
497
509
  }),
498
- [s, l]
499
- ), [o, b] = c, [D, d] = C, x = le(b.y, o.y), v = le(d.y, D.y), M = y && !r?.length, A = () => {
500
- n(
501
- M ? p.TRENDS_CLICK_GET_STARTED : p.TRENDS_CLICK_VIEW_MORE
502
- ), t();
510
+ [s, d]
511
+ ), [r, g] = u, [T, p] = b, w = _e(g.y, r.y), D = _e(p.y, T.y), E = C && !o?.length, k = () => {
512
+ t(
513
+ E ? y.TRENDS_CLICK_GET_STARTED : y.TRENDS_CLICK_VIEW_MORE
514
+ ), n();
503
515
  };
504
- return !m || !y ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(
505
- et,
516
+ return !h || !C ? /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ e(
517
+ ft,
506
518
  {
507
519
  className: "mx-trends-microwidget",
508
- ctaLabel: u.micro_primary_cta_label,
509
- onCTAClick: A,
510
- subHeader: M ? void 0 : u.micro_subheader,
511
- title: u.title,
512
- children: M ? /* @__PURE__ */ e(pt, {}) : /* @__PURE__ */ f(
513
- S,
520
+ ctaLabel: l.micro_primary_cta_label,
521
+ onCTAClick: k,
522
+ subHeader: E ? void 0 : l.micro_subheader,
523
+ title: l.title,
524
+ children: E ? /* @__PURE__ */ e(Pt, {}) : /* @__PURE__ */ f(
525
+ _,
514
526
  {
515
527
  sx: {
516
528
  alignItems: "stretch",
@@ -519,24 +531,24 @@ const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
519
531
  },
520
532
  children: [
521
533
  /* @__PURE__ */ e(
522
- me,
534
+ Se,
523
535
  {
524
- percentage: x,
525
- secondaryLabel: u.micro_secondary_label,
526
- shouldDisplayPercentage: b.y !== 0 && o.y !== 0,
527
- title: u.spending_label,
528
- totalAmount: b.y,
536
+ percentage: w,
537
+ secondaryLabel: l.micro_secondary_label,
538
+ shouldDisplayPercentage: g.y !== 0 && r.y !== 0,
539
+ title: l.spending_label,
540
+ totalAmount: g.y,
529
541
  transactionType: "spending"
530
542
  }
531
543
  ),
532
544
  /* @__PURE__ */ e(
533
- me,
545
+ Se,
534
546
  {
535
- percentage: v,
536
- secondaryLabel: u.micro_secondary_label,
537
- shouldDisplayPercentage: d.y !== 0 && D.y !== 0,
538
- title: u.income_label,
539
- totalAmount: d.y,
547
+ percentage: D,
548
+ secondaryLabel: l.micro_secondary_label,
549
+ shouldDisplayPercentage: p.y !== 0 && T.y !== 0,
550
+ title: l.income_label,
551
+ totalAmount: p.y,
540
552
  transactionType: "income"
541
553
  }
542
554
  )
@@ -545,108 +557,474 @@ const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
545
557
  )
546
558
  }
547
559
  );
548
- }), _t = ({ onBackClick: t, onInsightCardClick: r, sx: n }) => {
549
- const { onEvent: s } = j(), { config: h } = Ge(), { isLargeDesktop: m, isDesktop: l, isMobile: u } = re(), { visibleAccounts: i } = q(), { loadDateRangeCategoryTotals: _, loadMonthlyCategoryTotals: y, monthlyCategoryTotals: c } = G(), { setFilter: C } = ae(), { selectedDateRange: o, setSelectedCategoryData: b, setSelectedDateRange: D } = he(), {
550
- isCopyLoaded: d,
551
- isInitialized: x,
552
- selectedAccounts: v,
553
- selectedAccountGuids: M,
554
- setSelectedAccounts: A
555
- } = Y(), { trends: w } = R();
556
- ve();
557
- const [L, E] = a.useState(!1);
558
- a.useState("Chart"), a.useState(""), a.useState(!1);
559
- const [T, F] = a.useState(window.innerHeight), Z = T - 208;
560
+ }), Kt = A(
561
+ ({ isExpanded: n, onClick: o }) => {
562
+ const t = He();
563
+ return /* @__PURE__ */ e(_t, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(bt, { onClick: o, sx: { justifyContent: "center" }, children: /* @__PURE__ */ f(
564
+ _,
565
+ {
566
+ sx: { color: t.palette.primary.main, flexDirection: "row", alignItems: "center" },
567
+ children: [
568
+ /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ e(Q, { bold: !0, variant: "body2", children: n ? "View less" : "View more" }) }),
569
+ /* @__PURE__ */ e(St, { sx: { color: t.palette.primary.main }, children: n ? /* @__PURE__ */ e(gt, {}) : /* @__PURE__ */ e(
570
+ pt,
571
+ {
572
+ sx: {
573
+ transition: "transform 0.3s ease-in-out",
574
+ transform: n ? "rotate(180deg)" : "rotate(0deg)"
575
+ }
576
+ }
577
+ ) })
578
+ ]
579
+ }
580
+ ) }) });
581
+ }
582
+ ), we = A(
583
+ ({
584
+ totalAmount: n,
585
+ guid: o,
586
+ name: t,
587
+ transactions: s,
588
+ onClick: i,
589
+ isLastItem: h = !1,
590
+ showDivider: d = !0
591
+ }) => {
592
+ const { trends: l } = R(), { onEvent: c } = N(), m = `${s.length} ${s.length === 1 ? l.transaction : l.transactions}`, C = () => {
593
+ i?.(), c(y.TRENDS_CLICK_LIST_ITEM, {
594
+ ...M,
595
+ listItem: t
596
+ });
597
+ };
598
+ return /* @__PURE__ */ f(a.Fragment, { children: [
599
+ /* @__PURE__ */ e(
600
+ Ee,
601
+ {
602
+ leftIcon: o ? /* @__PURE__ */ e(Te, { categoryGuid: o }) : void 0,
603
+ onClick: C,
604
+ rightContent: Z(Math.abs(n), "0,0.00"),
605
+ rightIcon: i ? /* @__PURE__ */ e(Ke, {}) : void 0,
606
+ subtitle: m,
607
+ title: t
608
+ }
609
+ ),
610
+ d && /* @__PURE__ */ e(Dt, { sx: { ml: h ? 24 : 68 } })
611
+ ] }, o);
612
+ }
613
+ ), $t = A(
614
+ ({ availableHeight: n = 0, onCategoryClick: o }) => {
615
+ const { collapsedCategories: t, visibleCategories: s, setVisibleListLength: i } = ee(), { isLargeDesktop: h, isDesktop: d } = j(), { trends: l } = R(), { onEvent: c } = N(), [m, C] = a.useState(!1), u = d || h;
616
+ a.useEffect(() => {
617
+ const g = Math.floor(n / 64) - 1, T = s.length + t.length;
618
+ g !== s.length && (i(u ? Math.max(g, 5) : 5), C(g >= T));
619
+ }, [n]);
620
+ const b = () => {
621
+ C(!m), c(y.TRENDS_CLICK_VIEW_MORE, {
622
+ ...M
623
+ });
624
+ }, r = s.length + (m ? t.length : 0);
625
+ return /* @__PURE__ */ e(_, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ f(yt, { children: [
626
+ /* @__PURE__ */ e(_, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(De, { children: l.categories }) }),
627
+ s.map((g, T) => /* @__PURE__ */ e(
628
+ we,
629
+ {
630
+ ...g,
631
+ isLastItem: T === r - 1,
632
+ onClick: g.transactions.length > 0 ? () => o(g) : void 0,
633
+ showDivider: !0
634
+ },
635
+ g.guid
636
+ )),
637
+ /* @__PURE__ */ e(
638
+ Tt,
639
+ {
640
+ in: m,
641
+ sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
642
+ children: t.map((g, T) => {
643
+ const p = s.length + T;
644
+ return /* @__PURE__ */ e(
645
+ we,
646
+ {
647
+ ...g,
648
+ isLastItem: p === r - 1,
649
+ onClick: g.transactions.length > 0 ? () => o(g) : void 0,
650
+ showDivider: !0
651
+ },
652
+ g.guid
653
+ );
654
+ })
655
+ }
656
+ ),
657
+ t.length > 0 && /* @__PURE__ */ e(Kt, { isExpanded: m, onClick: b })
658
+ ] }) });
659
+ }
660
+ ), jt = [
661
+ "BillAmountNotStandard",
662
+ "CategorySpendingV2",
663
+ "CostOfLivingToIncome",
664
+ "DebtPaymentReminderV2",
665
+ "DiscoveredAccounts",
666
+ "DuplicatePaymentV2",
667
+ "FeeDetected",
668
+ "GreenGasPurchasesSummary",
669
+ "LargeTransaction",
670
+ "LowAccountBalance",
671
+ "MonthlyDebtToIncomeComparisonV2",
672
+ "MonthlyDepositSummaryV2",
673
+ "MonthlyNonEssentialCategorySummaryV2",
674
+ "MonthlySavingsToIncomeComparison",
675
+ "MonthlySpendToIncomeComparisonV2",
676
+ "MonthlySubscriptionAggregateV2",
677
+ "MonthlyTopMerchantSpendingV3",
678
+ "MonthlyObligationsStatus",
679
+ "QuarterlySummary",
680
+ "SaveAnExtra100Dollars",
681
+ "SaveEnoughToLiveOn",
682
+ "SavingsOpportunityV2",
683
+ "SubscriptionDetected",
684
+ "SubscriptionPriceIncrease",
685
+ "SetUpDirectDeposit",
686
+ "SwitchDirectDeposit",
687
+ "UnexpectedSubscriptionPayment",
688
+ "UpcomingBill",
689
+ "UpcomingSubscription",
690
+ "WeekendSpendingSummaryV2",
691
+ "WeeklyNewMerchantsV2",
692
+ "WeeklyNoSpendDays",
693
+ "WeeklySmallPurchasesSummary"
694
+ ], Yt = ({ onInsightCardClick: n }) => {
695
+ const o = It(), { onEvent: t } = N(), { isMobile: s, isDesktop: i, isLargeDesktop: h } = j(), { beatStore: d, endpoint: l, sessionToken: c } = ve(), { isInitialized: m } = $(), [C, u] = a.useState(!1), b = o.palette.mode === "dark", r = i || h, g = r || s ? 1 : 2;
560
696
  a.useEffect(() => {
561
- const I = () => F(window.innerHeight);
562
- return window.addEventListener("resize", I), () => window.removeEventListener("resize", I);
697
+ m && d.loadBeats().finally(() => u(!0));
698
+ }, [m]);
699
+ const T = a.useMemo(() => C ? d.getFilteredBeats({ templates: jt }) : [], [C]), p = () => null, w = (I) => {
700
+ n?.(I), t(y.TRENDS_CLICK_INSIGHT, M);
701
+ }, D = r ? 200 : 170, E = r ? 170 : 124, k = T.length > 0 ? D : E;
702
+ return /* @__PURE__ */ e(Et, { sx: { height: k }, children: /* @__PURE__ */ e(
703
+ ct,
704
+ {
705
+ areBeatsLoading: d.isLoading,
706
+ beats: T,
707
+ endpoint: l,
708
+ logOutUser: p,
709
+ onCardClick: w,
710
+ showBorder: !0,
711
+ showCTAColocatedWithText: !1,
712
+ showCarouselControls: !0,
713
+ showHeader: r,
714
+ showIcon: !0,
715
+ showWithMargin: !1,
716
+ token: c,
717
+ useDarkMode: b,
718
+ userHasFullInsightFeedBeats: !1,
719
+ variant: "outlined",
720
+ visibleCardsCount: g
721
+ }
722
+ ) });
723
+ }, Ut = A(Yt), Xt = A(({ chartLabel: n, chartColor: o }) => {
724
+ const { onEvent: t } = N(), {
725
+ categoryDetailsChartData: { monthlyAmounts: s, tooltipLabels: i }
726
+ } = ee();
727
+ return /* @__PURE__ */ e(_, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
728
+ ye,
729
+ {
730
+ baseline: "min",
731
+ colors: [o],
732
+ curveType: "bump",
733
+ customTooltipLabels: i,
734
+ datasets: [s],
735
+ height: 265,
736
+ labels: [n],
737
+ markStyles: () => ({
738
+ stroke: o
739
+ }),
740
+ onItemClick: () => {
741
+ t(y.TRENDS_CLICK_CHART, M);
742
+ },
743
+ showArea: !0,
744
+ showAverage: !0,
745
+ showAxisHighlight: !0,
746
+ showLegend: !0,
747
+ showTooltip: !0,
748
+ showXAxis: !0,
749
+ showXAxisTicks: !0,
750
+ showYAxis: !0,
751
+ showYAxisTicks: !0,
752
+ useCustomMark: !0,
753
+ valueFormatterString: "0,0"
754
+ }
755
+ ) });
756
+ }), Zt = A(({ onClose: n }) => {
757
+ const o = He(), { onEvent: t } = N(), { common: s, trends: i } = R(), { selectedCategoryData: h, selectedDateRangeMonthRange: d } = ee(), { sortedTransactions: l } = ie(), [c, m] = a.useState(null);
758
+ if (!h)
759
+ return null;
760
+ const { guid: C, name: u, is_income: b, totalAmount: r } = h, g = b ? i.category_income : i.category_spending, T = xt(C, o), p = b ? i.income_label : i.spending_label, w = ` ${h.transactions.length === 1 ? i.transaction : i.transactions} (${h.transactions.length})`, D = a.useMemo(
761
+ () => l.find((I) => I.guid === c),
762
+ [c, l]
763
+ ), E = (I) => I.category_guid === C || I.top_level_category_guid === C, k = () => {
764
+ n?.(), t(y.TRENDS_CLICK_BACK, M);
765
+ };
766
+ return /* @__PURE__ */ f(
767
+ fe,
768
+ {
769
+ ariaLabelClose: i.close_category_details,
770
+ isOpen: !0,
771
+ onClose: k,
772
+ shouldShowHeaderShadow: !0,
773
+ title: g,
774
+ children: [
775
+ /* @__PURE__ */ f(_, { sx: { alignItems: "center", height: "100%" }, children: [
776
+ /* @__PURE__ */ f(Lt, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
777
+ /* @__PURE__ */ e(
778
+ Ee,
779
+ {
780
+ leftIcon: /* @__PURE__ */ e(Te, { categoryGuid: C }),
781
+ rightContent: Z(Math.abs(r), "0,0.00"),
782
+ subtitle: d,
783
+ title: u
784
+ }
785
+ ),
786
+ /* @__PURE__ */ e(Xt, { chartColor: T, chartLabel: p }),
787
+ /* @__PURE__ */ f(_, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
788
+ /* @__PURE__ */ e(Q, { bold: !0, variant: "body1", children: w }),
789
+ /* @__PURE__ */ e(vt, { filter: E })
790
+ ] })
791
+ ] }),
792
+ /* @__PURE__ */ e(
793
+ ke,
794
+ {
795
+ bgcolor: "transparent",
796
+ filter: E,
797
+ height: "calc(100vh - 475px)",
798
+ onClick: m
799
+ }
800
+ )
801
+ ] }),
802
+ /* @__PURE__ */ e(
803
+ fe,
804
+ {
805
+ ariaLabelClose: s.close_aria,
806
+ isOpen: !!D,
807
+ onClose: () => m(""),
808
+ title: i.transaction,
809
+ children: D && /* @__PURE__ */ e(Re, { transaction: D })
810
+ }
811
+ )
812
+ ]
813
+ }
814
+ );
815
+ }), Qt = (n, o) => {
816
+ const t = xe(n, o), s = Le(n, o);
817
+ return [t, s].filter((i) => i.length > 0);
818
+ }, qt = (n, o) => {
819
+ const [t, s] = n, i = t, h = s ?? t, d = [];
820
+ if (i) {
821
+ const l = i.reduce((c, m) => c + m.y, 0);
822
+ d.push({ label: o.income_label, amount: l });
823
+ }
824
+ if (h) {
825
+ const l = h.reduce((c, m) => c + m.y, 0);
826
+ d.push({ label: o.spending_label, amount: l });
827
+ }
828
+ return d;
829
+ }, Jt = ({
830
+ availableHeight: n = 0,
831
+ minHeight: o = 500,
832
+ selectedDateRange: t,
833
+ totals: s
834
+ }) => {
835
+ const i = Ne(), { onEvent: h } = N(), { trends: d } = R(), { isSmallMobile: l, isMobile: c, isSmallTablet: m, isTablet: C } = j(), u = [i.palette.chart?.chart1, i.palette.chart?.chart2], b = Qt(s, t), r = qt(b, d), [g, T] = a.useState(0), p = 458, w = 195, D = 56, E = c || l ? w : m || C ? p : g;
836
+ return a.useEffect(() => {
837
+ const I = Math.max(n - D, o);
838
+ T(I);
839
+ }, [n]), /* @__PURE__ */ e(
840
+ ye,
841
+ {
842
+ baseline: "min",
843
+ colors: u,
844
+ curveType: "bump",
845
+ datasets: b,
846
+ height: E,
847
+ labels: r,
848
+ onItemClick: () => {
849
+ h(y.TRENDS_CLICK_CHART, M);
850
+ },
851
+ showArea: !0,
852
+ showAxisHighlight: !0,
853
+ showLegend: !0,
854
+ showTooltip: !0,
855
+ showXAxis: !0,
856
+ showXAxisTicks: !0,
857
+ showYAxis: !0,
858
+ showYAxisTicks: !0,
859
+ valueFormatterString: "0,0"
860
+ }
861
+ );
862
+ }, en = A(Jt), tn = ({ onBackClick: n, onInsightCardClick: o, sx: t }) => {
863
+ const { onEvent: s } = N(), { config: i } = st(), { isLargeDesktop: h, isDesktop: d, isMobile: l } = j(), { visibleAccounts: c } = ce(), { loadDateRangeCategoryTotals: m, loadMonthlyCategoryTotals: C, monthlyCategoryTotals: u } = K(), { setFilter: b } = ie(), { selectedDateRange: r, setSelectedCategoryData: g, setSelectedDateRange: T } = ee(), {
864
+ isCopyLoaded: p,
865
+ isInitialized: w,
866
+ selectedAccounts: D,
867
+ selectedAccountGuids: E,
868
+ setSelectedAccounts: k
869
+ } = $(), { trends: I } = R(), H = Ue(), L = d || h, [x, z] = a.useState(!1), [le, F] = a.useState(!1), [Y, de] = a.useState("Chart"), [P, te] = a.useState(""), [he, ne] = a.useState(!1), [oe, ue] = a.useState(window.innerHeight), se = oe - 208, me = oe - (H ? 494 : 266);
870
+ a.useEffect(() => {
871
+ const v = () => ue(window.innerHeight);
872
+ return window.addEventListener("resize", v), () => window.removeEventListener("resize", v);
563
873
  }, []), a.useEffect(() => {
564
- A(i);
565
- }, [i]), a.useEffect(() => {
566
- x && _(v, o.start, o.end).then(() => {
567
- y(
568
- v,
569
- o.start,
570
- o.end
874
+ k(c);
875
+ }, [c]), a.useEffect(() => {
876
+ w && c?.length ? (F(!1), m(D, r.start, r.end).then(() => {
877
+ C(
878
+ D,
879
+ r.start,
880
+ r.end
571
881
  );
572
882
  }).finally(() => {
573
- E(!0), s(p.TRENDS_LOAD_WIDGET, {
574
- ...B,
575
- time_period: `${se(o.end, o.start)}M`
883
+ z(!0), s(y.TRENDS_LOAD_WIDGET, {
884
+ ...M,
885
+ time_period: `${re(r.end, r.start)}M`
576
886
  });
577
- });
578
- }, [x, v, o]), a.useEffect(() => {
579
- if (c.length !== 0) {
580
- const I = {
581
- accounts: M,
582
- dateRange: { start: o.start, end: o.end }
887
+ })) : w && !c?.length && (F(!0), z(!0), s(y.TRENDS_LOAD_WIDGET, {
888
+ ...M,
889
+ time_period: `${re(r.end, r.start)}M`
890
+ }));
891
+ }, [w, D, r]), a.useEffect(() => {
892
+ w && !c?.length ? F(!0) : c?.length && F(!1);
893
+ }, [w, c]), a.useEffect(() => {
894
+ if (u.length !== 0) {
895
+ const v = {
896
+ accounts: E,
897
+ dateRange: { start: r.start, end: r.end }
583
898
  };
584
- C({
585
- ...I,
586
- custom: (N) => !!c.find(
587
- (W) => W.top_level_category_guid === N.top_level_category_guid || W.category_guid === N.category_guid
899
+ b({
900
+ ...v,
901
+ custom: (V) => !!u.find(
902
+ (U) => U.top_level_category_guid === V.top_level_category_guid || U.category_guid === V.category_guid
588
903
  )
589
904
  });
590
905
  }
591
- }, [c]);
592
- const J = (I) => {
593
- const N = ge(I?.[0], 1), W = I?.[1], ee = se(W, N);
594
- D({ start: N, end: W }), s(p.TRENDS_CLICK_TIME_WINDOW, {
595
- ...B,
596
- time_period: ee + "M"
906
+ }, [u]);
907
+ const ge = (v) => {
908
+ g(v), ne(!0);
909
+ }, S = () => {
910
+ g(null), ne(!1);
911
+ }, W = (v, V) => {
912
+ de(V ?? Y), s(y.TRENDS_CLICK_TOGGLE_VIEW, {
913
+ ...M,
914
+ toggleView: V
915
+ });
916
+ }, G = (v) => {
917
+ const V = Ie(v?.[0], 1), U = v?.[1], Fe = re(U, V);
918
+ T({ start: V, end: U }), s(y.TRENDS_CLICK_TIME_WINDOW, {
919
+ ...M,
920
+ time_period: Fe + "M"
597
921
  });
598
- }, ie = (I) => {
599
- s(p.TRENDS_CLICK_FILTER, {
600
- ...B,
601
- filterValue: I
922
+ }, pe = (v) => {
923
+ s(y.TRENDS_CLICK_FILTER, {
924
+ ...M,
925
+ filterValue: v
602
926
  });
603
- }, U = h.show_connections_widget_in_master ? "buttons" : "no-buttons", X = !i?.length, Q = i.length > 0;
604
- return !d || !L ? /* @__PURE__ */ e($, {}) : (console.log("accounts: ", i), console.log("!accounts?.length: ", X), console.log("accounts.length > 0: ", Q), /* @__PURE__ */ f(
605
- pe,
927
+ }, Ge = (v) => {
928
+ te(v);
929
+ }, Be = () => {
930
+ te(""), s(y.TRENDS_CLICK_ALL_CATEGORIES, M);
931
+ }, ze = i.show_connections_widget_in_master ? "buttons" : "no-buttons";
932
+ return !p || !x ? /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ e(
933
+ Ae,
606
934
  {
607
- accountOptions: i,
608
- calendarActions: { onRangeChanged: J },
609
- dateRange: o,
610
- dateRangeVariant: u ? "timeframetabs" : "timeframebuttons",
611
- onAccountsFilterClick: ie,
612
- onBackClick: t,
613
- sx: n,
614
- title: w.title,
615
- children: [
616
- /* @__PURE__ */ e(
617
- ue,
618
- {
619
- header: w.zero_state_content_header,
620
- icon: "",
621
- onClick: () => {
622
- },
623
- primaryButton: w.empty_state_primary,
624
- subText: w.empty_state_sub_text,
625
- sx: { height: Z },
626
- variant: U
627
- }
628
- ),
629
- /* @__PURE__ */ e(
630
- ue,
631
- {
632
- header: w.zero_state_content_header,
633
- icon: "",
634
- onClick: () => {
635
- },
636
- primaryButton: w.empty_state_primary,
637
- subText: w.empty_state_sub_text,
638
- sx: { height: Z },
639
- variant: U
640
- }
641
- )
642
- ]
935
+ accountOptions: c,
936
+ calendarActions: { onRangeChanged: G },
937
+ dateRange: r,
938
+ dateRangeVariant: l ? "timeframetabs" : "timeframebuttons",
939
+ onAccountsFilterClick: pe,
940
+ onBackClick: n,
941
+ sx: t,
942
+ title: I.title,
943
+ children: le ? /* @__PURE__ */ e(
944
+ Mt,
945
+ {
946
+ header: I.zero_state_content_header,
947
+ icon: "",
948
+ onClick: () => {
949
+ },
950
+ primaryButton: I.empty_state_primary,
951
+ subText: I.empty_state_sub_text,
952
+ sx: { height: se },
953
+ variant: ze
954
+ }
955
+ ) : /* @__PURE__ */ f(
956
+ _,
957
+ {
958
+ sx: {
959
+ px: l ? 0 : 48
960
+ },
961
+ children: [
962
+ /* @__PURE__ */ f(
963
+ _,
964
+ {
965
+ flexDirection: "row",
966
+ justifyContent: "space-between",
967
+ sx: { pb: l ? 12 : 24, pt: l ? 24 : 48 },
968
+ children: [
969
+ /* @__PURE__ */ e(
970
+ Oe,
971
+ {
972
+ selectedCategoryGuid: P,
973
+ selectedDateRange: r
974
+ }
975
+ ),
976
+ /* @__PURE__ */ e(We, { onTabChange: W, selectedTab: Y })
977
+ ]
978
+ }
979
+ ),
980
+ /* @__PURE__ */ e(_, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(O, { flexGrow: 1, children: P && /* @__PURE__ */ f(Ce, { onClick: Be, sx: { p: 0, pr: 5 }, children: [
981
+ /* @__PURE__ */ e(ae, { name: "arrow_back" }),
982
+ I.all_categories
983
+ ] }) }) }),
984
+ /* @__PURE__ */ f(_, { flexDirection: L ? "row" : "column", gap: L ? 48 : 16, children: [
985
+ Y === "Chart" && /* @__PURE__ */ f(Pe, { children: [
986
+ /* @__PURE__ */ e(O, { sx: { width: L ? "68%" : "100%" }, children: /* @__PURE__ */ e(
987
+ en,
988
+ {
989
+ availableHeight: se,
990
+ minHeight: 450,
991
+ selectedDateRange: r,
992
+ totals: u
993
+ }
994
+ ) }),
995
+ /* @__PURE__ */ f(_, { gap: 16, sx: { width: L ? "32%" : "100%" }, children: [
996
+ H && /* @__PURE__ */ e(Ut, { onInsightCardClick: o }),
997
+ /* @__PURE__ */ e(
998
+ $t,
999
+ {
1000
+ availableHeight: me,
1001
+ onCategoryClick: ge
1002
+ }
1003
+ )
1004
+ ] })
1005
+ ] }),
1006
+ Y === "Table" && /* @__PURE__ */ e(O, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
1007
+ Ve,
1008
+ {
1009
+ height: "unset",
1010
+ monthlyCategoryTotals: u,
1011
+ onClickRow: Ge,
1012
+ selectedCategory: P,
1013
+ selectedDateRange: r
1014
+ }
1015
+ ) })
1016
+ ] }),
1017
+ he && /* @__PURE__ */ e(Zt, { onClose: S })
1018
+ ]
1019
+ }
1020
+ )
643
1021
  }
644
- ));
645
- }, tn = O(_t);
1022
+ );
1023
+ }, qn = A(tn);
646
1024
  export {
647
- Jt as TrendsFullWidget,
648
- en as TrendsMicroWidget,
649
- Qt as TrendsMiniWidget,
650
- sn as TrendsStore,
651
- tn as TrendsWidget
1025
+ Xn as TrendsFullWidget,
1026
+ Qn as TrendsMicroWidget,
1027
+ Zn as TrendsMiniWidget,
1028
+ to as TrendsStore,
1029
+ qn as TrendsWidget
652
1030
  };