@mx-cartographer/experiences 7.3.0-alpha.sms1 → 7.3.0

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 (104) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-YwUMFz93.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-BgCST7mK.mjs} +8 -8
  4. package/dist/AccountDetailsHeader-jAFWoHj7.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-DPxMPBF0.mjs} +2 -2
  6. package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-D6rWAreC.mjs} +8 -8
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-B5E98oM1.mjs} +100 -74
  8. package/dist/Accounts-UIlYCmHb.mjs +9 -0
  9. package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
  10. package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
  11. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-CXvenbdN.mjs} +1 -1
  12. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-Buy70Y3V.mjs} +21 -19
  13. package/dist/CategoryStore-BEdFs69_.mjs +183 -0
  14. package/dist/CategoryUtil-BR3H5i6n.mjs +78 -0
  15. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-CbxHKlRv.mjs} +10 -10
  16. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-C6kanU7I.mjs} +4 -4
  17. package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-lSC7oPDg.mjs} +1 -1
  18. package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-DgIcphe_.mjs} +1 -1
  19. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-DZ10CbWd.mjs} +3 -3
  20. package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
  21. package/dist/{FinstrongStore-F2c607dj.mjs → FinstrongStore-CL7t5lBL.mjs} +1 -1
  22. package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-CAlmSu4U.mjs} +112 -152
  23. package/dist/{Help-B6dIcujh.mjs → Help-hi9I9EYP.mjs} +1 -1
  24. package/dist/{LineChart-D4GI7nVh.mjs → LineChart-eK4IQImU.mjs} +2 -2
  25. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BmL5buOf.mjs} +1 -1
  26. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-Cypo9qY4.mjs} +66 -65
  27. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  28. package/dist/{MicroWidgetContainer-DpeqN9n3.mjs → MicroWidgetContainer-CFdMGJKg.mjs} +1 -1
  29. package/dist/{MiniWidgetContainer-D0gfmbaF.mjs → MiniWidgetContainer-BdgBvpga.mjs} +1 -1
  30. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-CxqIxAgN.mjs} +2 -2
  31. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-DxytNHlN.mjs} +240 -237
  32. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-CDX_kqHa.mjs} +7 -15
  33. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-V6FEoIDe.mjs} +3 -3
  34. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-iIupYxJW.mjs} +4 -4
  35. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-ej39mgA6.mjs} +3 -3
  36. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-BiwCzScZ.mjs} +26 -29
  37. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
  38. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  39. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  40. package/dist/{TransactionDetails-oP1eSuiS.mjs → TransactionDetails-BUoNbsu-.mjs} +402 -367
  41. package/dist/TransactionStore-C1oyQCZK.mjs +677 -0
  42. package/dist/TrendsStore-5PvDT_o6.mjs +182 -0
  43. package/dist/{User-BQUxBeZV.mjs → User-Bj34_i8g.mjs} +1 -1
  44. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-lihSDk2J.mjs} +517 -493
  45. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-BnTgAfQn.mjs} +2 -2
  46. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  47. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  48. package/dist/accounts/index.es.js +241 -203
  49. package/dist/accounts/stores/AccountStore.d.ts +22 -25
  50. package/dist/accounts/utils/Accounts.d.ts +1 -2
  51. package/dist/analytics/index.es.js +2 -2
  52. package/dist/budgets/index.es.js +500 -507
  53. package/dist/budgets/store/BudgetsStore.d.ts +0 -1
  54. package/dist/cashflow/index.es.js +384 -382
  55. package/dist/categories/index.es.js +2 -2
  56. package/dist/categories/stores/CategoryStore.d.ts +1 -5
  57. package/dist/categories/util/CategoryUtil.d.ts +2 -3
  58. package/dist/common/components/charts/index.d.ts +0 -2
  59. package/dist/common/index.es.js +391 -376
  60. package/dist/common/stores/AppDataStore.d.ts +1 -3
  61. package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
  62. package/dist/common/stores/GlobalStore.d.ts +10 -4
  63. package/dist/common/stores/UserStore.d.ts +2 -3
  64. package/dist/common/types/Account.d.ts +6 -9
  65. package/dist/common/types/Global.d.ts +1 -0
  66. package/dist/dashboard/index.es.js +2 -2
  67. package/dist/debts/index.es.js +506 -498
  68. package/dist/{exportTransactionsToCSV-7bVS7KXf.mjs → exportTransactionsToCSV-B8qpk5MU.mjs} +14 -13
  69. package/dist/finstrong/index.es.js +417 -415
  70. package/dist/goals/index.es.js +559 -557
  71. package/dist/goals/stores/GoalStore.d.ts +4 -17
  72. package/dist/help/index.es.js +3 -3
  73. package/dist/{hooks-D6XlXHf4.mjs → hooks-Cy8JnjCg.mjs} +2 -2
  74. package/dist/insights/index.es.js +1 -1
  75. package/dist/investments/index.es.js +437 -435
  76. package/dist/investments/stores/HoldingStore.d.ts +0 -1
  77. package/dist/merchants/index.es.js +2 -2
  78. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  79. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -1
  80. package/dist/microinsights/index.es.js +1 -1
  81. package/dist/microinsights/interfaces.d.ts +0 -1
  82. package/dist/networth/index.es.js +176 -174
  83. package/dist/notifications/index.es.js +23 -23
  84. package/dist/notifications/stores/NotificationStore.d.ts +1 -3
  85. package/dist/recurringtransactions/index.es.js +175 -173
  86. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -3
  87. package/dist/settings/index.es.js +285 -279
  88. package/dist/spending/index.es.js +282 -281
  89. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  90. package/dist/transactions/index.es.js +63 -64
  91. package/dist/transactions/stores/TransactionStore.d.ts +77 -21
  92. package/dist/trends/index.es.js +948 -583
  93. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-D6sQsNNQ.mjs} +2 -2
  94. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
  95. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-BxytCjq5.mjs} +1 -1
  96. package/package.json +4 -4
  97. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  98. package/dist/Accounts-BRf_YeTf.mjs +0 -27
  99. package/dist/CategoryStore-yHI0hWmK.mjs +0 -174
  100. package/dist/CategoryUtil-pZRIYOgN.mjs +0 -80
  101. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  102. package/dist/TransactionStore-ai3uII_r.mjs +0 -690
  103. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  104. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -1,559 +0,0 @@
1
- import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
- import M, { useRef as Ct, useState as bt, useEffect as vt } from "react";
3
- import L from "@mui/material/Box";
4
- import T from "@mui/material/Stack";
5
- import { useTheme as J } from "@mui/material/styles";
6
- import { LineChart as St } from "@mui/x-charts";
7
- import { u as K } from "./useScreenSize-B6JyS_Lj.mjs";
8
- import { u as _t } from "./useDimensions-27p2evRx.mjs";
9
- import { observer as Mt } from "mobx-react-lite";
10
- import Tt from "@mui/material/Card";
11
- import Dt from "@mui/material/CardContent";
12
- import P from "@mui/material/Divider";
13
- import X from "@mui/material/Grid";
14
- import { CategoryIcon as At, Text as S } from "@mxenabled/mxui";
15
- import { u as Lt, m as Q } from "./hooks-D6XlXHf4.mjs";
16
- import { b as Rt } from "./Localization-2MODESHW.mjs";
17
- import { C as O } from "./CurrencyText-kyC1aseI.mjs";
18
- import { useTheme as wt, Card as Ht, CardContent as It, Box as kt } from "@mui/material";
19
- import { f as R, D as w } from "./Dialog-CWW597AF.mjs";
20
- import Et from "@mui/material/Button";
21
- import { C as A, b as Gt, c as Nt } from "./Category-CevNQ03n.mjs";
22
- import { f as V } from "./NumberFormatting-Buh7u8Oi.mjs";
23
- import Bt from "@mui/material/ListItem";
24
- import Ot from "@mui/material/ListItemButton";
25
- import z from "@mui/material/ListItemIcon";
26
- import $t from "@mui/material/ListItemText";
27
- import { makeAutoObservable as Wt } from "mobx";
28
- import { addSeconds as jt } from "date-fns/addSeconds";
29
- import { differenceInCalendarMonths as Ft } from "date-fns/differenceInCalendarMonths";
30
- import { endOfMonth as q } from "date-fns/endOfMonth";
31
- import { subMonths as Yt } from "date-fns/subMonths";
32
- const U = ({ categoryGuid: r, topLevelCategoryGuid: e }) => {
33
- const { categories: o } = Lt(), { getCategoryName: a } = Q(), n = a(r);
34
- return /* @__PURE__ */ f(T, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
35
- /* @__PURE__ */ s(
36
- L,
37
- {
38
- "aria-label": Rt(o.category_icon_label_aria, n),
39
- mb: 4,
40
- role: "img",
41
- children: /* @__PURE__ */ s(At, { categoryGuid: e })
42
- }
43
- ),
44
- /* @__PURE__ */ s(S, { variant: "Body", children: n })
45
- ] });
46
- }, Pt = ({
47
- categoryGuids: { guid: r, topLevelGuid: e },
48
- hoveredAreaData: o,
49
- cursorPosition: a,
50
- chartContainerRef: n
51
- }) => {
52
- const i = J(), l = Ct(null), [h, g] = bt({ x: a.x, y: a.y });
53
- if (vt(() => {
54
- (() => {
55
- const u = l.current, x = n.current;
56
- if (!u || !x) return;
57
- const y = u.getBoundingClientRect(), b = x.getBoundingClientRect();
58
- let p = a.x, v = a.y;
59
- p + y.width * 2 > b.right ? p = a.x - y.width : p - y.width < b.left && (p = a.x), v + y.height * 2 > b.bottom && (v = a.y - y.height), g({ x: p, y: v });
60
- })();
61
- }, [a, n]), !o) return null;
62
- const C = o.reduce((d, u) => d + u.y, 0);
63
- return /* @__PURE__ */ s(
64
- Tt,
65
- {
66
- ref: l,
67
- sx: {
68
- position: "absolute",
69
- top: h.y,
70
- left: h.x,
71
- width: 250,
72
- pointerEvents: "none"
73
- },
74
- children: /* @__PURE__ */ f(Dt, { children: [
75
- /* @__PURE__ */ f(L, { alignItems: "center", display: "flex", flexDirection: "column", children: [
76
- /* @__PURE__ */ s(U, { categoryGuid: r, topLevelCategoryGuid: e }),
77
- /* @__PURE__ */ s(S, { variant: "Small", children: `${o.length}-month total` }),
78
- /* @__PURE__ */ s(O, { amount: C, bold: !0, formatString: "0,0", variant: "body2" })
79
- ] }),
80
- /* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
81
- /* @__PURE__ */ s(X, { container: !0, children: o.map((d, u) => /* @__PURE__ */ f(M.Fragment, { children: [
82
- u > 0 && u % 3 === 0 && /* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
83
- /* @__PURE__ */ s(X, { item: !0, xs: 4, children: /* @__PURE__ */ f(L, { alignItems: "center", display: "flex", flexDirection: "column", children: [
84
- /* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "XSmall", children: d.x }),
85
- /* @__PURE__ */ s(
86
- O,
87
- {
88
- amount: d.y,
89
- bold: !0,
90
- formatString: "0,0",
91
- variant: "Body"
92
- }
93
- )
94
- ] }) })
95
- ] }, u)) })
96
- ] })
97
- }
98
- );
99
- }, Xt = Mt(Pt), Vt = ({
100
- categoryGuids: { guid: r, topLevelGuid: e },
101
- itemData: { dataIndex: o },
102
- series: a,
103
- xData: n
104
- }) => {
105
- const i = wt(), l = a.data[o], h = n[o];
106
- return l === void 0 || !h ? null : /* @__PURE__ */ s(Ht, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ s(It, { children: /* @__PURE__ */ f(kt, { alignItems: "center", display: "flex", flexDirection: "column", children: [
107
- /* @__PURE__ */ s(U, { categoryGuid: r, topLevelCategoryGuid: e }),
108
- /* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "Small", children: R(h, w.MONTH_SHORT_YEAR) }),
109
- /* @__PURE__ */ s(O, { amount: String(l), bold: !0, formatString: "0,0", variant: "Body" })
110
- ] }) }) });
111
- }, zt = ({
112
- sx: r,
113
- categoryGuids: e,
114
- hoveredLegend: o,
115
- legendRef: a,
116
- onHoverLegend: n,
117
- onClickLegend: i
118
- }) => {
119
- const { isMobile: l } = K(), { getCategoryName: h } = Q();
120
- return /* @__PURE__ */ s(
121
- T,
122
- {
123
- direction: "row",
124
- flexWrap: "wrap",
125
- gap: l ? 2 : 6,
126
- justifyContent: "start",
127
- ref: a,
128
- sx: r,
129
- children: e.map(({ guid: g, top_level_guid: C }) => {
130
- const d = o === g, u = A[g], x = A[C], y = u ?? x ?? A.default, b = y + "33";
131
- return /* @__PURE__ */ f(
132
- Et,
133
- {
134
- onClick: () => i(g),
135
- onMouseEnter: () => n(g),
136
- onMouseLeave: () => n(null),
137
- sx: {
138
- color: "text.primary",
139
- fontWeight: "normal",
140
- display: "flex",
141
- justifyContent: "center",
142
- alignItems: "center",
143
- paddingX: 8,
144
- paddingY: 4,
145
- borderRadius: 1,
146
- opacity: d ? 1 : 0.7
147
- },
148
- children: [
149
- /* @__PURE__ */ s(
150
- L,
151
- {
152
- sx: {
153
- width: 16,
154
- height: 16,
155
- marginRight: l ? 5 : 10,
156
- borderRadius: "2px",
157
- backgroundColor: o ? d ? y : b : y
158
- }
159
- }
160
- ),
161
- /* @__PURE__ */ s(S, { variant: "Body", children: h(g) })
162
- ]
163
- },
164
- g
165
- );
166
- })
167
- }
168
- );
169
- }, Ie = ({
170
- onHoverArea: r,
171
- onHoverPoint: e,
172
- onHoverLegend: o,
173
- onClickLegend: a,
174
- stackedDatasets: n,
175
- unstackedDatasets: i = [],
176
- availableHeight: l = 0,
177
- minimumHeight: h = 350
178
- }) => {
179
- const g = J(), { isMobile: C } = K(), [d, { height: u }] = _t(), x = M.useRef(null), [y, b] = M.useState(0);
180
- M.useEffect(() => {
181
- const t = Math.max(l - u, h);
182
- b(t);
183
- }, [l, u]);
184
- const [p, v] = M.useState(null), [Z, H] = M.useState({
185
- hoveredSeriesId: null,
186
- hoveredAreaData: null,
187
- isAreaHovered: !1,
188
- cursorPos: { x: 0, y: 0 }
189
- }), { hoveredSeriesId: D, hoveredAreaData: $, isAreaHovered: tt, cursorPos: I } = Z, W = tt && D && $, j = !W, G = [...n, ...i], et = G[0]?.dataset.length ?? 0, N = G.flatMap((t) => t.dataset.map((c) => c.x)), ot = G.flatMap((t) => t.dataset.map((c) => c.y)), rt = n[0]?.dataset?.map(
190
- (t, c) => n.reduce((m, _) => m + _.dataset[c]?.y || 0, 0)
191
- ) ?? [0], at = Math.max(...rt), nt = Math.max(
192
- ...i.flatMap((t) => t.dataset.map((c) => c.y))
193
- ), st = Math.floor(Math.min(...ot) / 100) * 100, it = Math.ceil(Math.max(at, nt) / 100) * 100, k = n.map((t, c) => ({
194
- id: `stacked-${c}`,
195
- guid: t.category_guid,
196
- top_level_guid: t.top_level_category_guid,
197
- area: !0,
198
- color: n[c].category_color ?? g.palette.primary.main,
199
- data: t.dataset.map((m) => m.y),
200
- label: n[c].category_name,
201
- stack: "total",
202
- type: "line",
203
- highlightScope: { highlight: "item" },
204
- valueFormatter: (m) => V(m, "0,0")
205
- })), F = i.map((t, c) => ({
206
- id: `unstacked-${c}`,
207
- guid: t.category_guid,
208
- top_level_guid: t.top_level_category_guid,
209
- area: !1,
210
- color: t.category_color,
211
- data: t.dataset.map((m) => m.y),
212
- label: t.category_name,
213
- type: "line",
214
- valueFormatter: (m) => V(m, "0,0")
215
- })), Y = [...k, ...F], ct = [
216
- ...k.map(({ guid: t, top_level_guid: c }) => ({
217
- guid: t,
218
- top_level_guid: c
219
- })),
220
- ...F.map(({ guid: t, top_level_guid: c }) => ({
221
- guid: t,
222
- top_level_guid: c
223
- }))
224
- ], E = (t) => {
225
- const m = t.startsWith("stacked-") ? n[parseInt(t.split("-")[1])] : i[parseInt(t.split("-")[1])];
226
- return {
227
- guid: m?.category_guid,
228
- topLevelGuid: m?.top_level_category_guid
229
- };
230
- }, lt = (t) => {
231
- v(t), o?.(t ?? "");
232
- }, dt = (t) => {
233
- a?.(t ?? "");
234
- }, ut = () => {
235
- const t = E(String(D)).guid;
236
- t && a?.(t);
237
- }, mt = (t) => {
238
- const c = String(t?.seriesId), m = E(c).guid, _ = Y.find((B) => B.id === c), pt = _ && t?.dataIndex !== void 0, yt = _ && t?.dataIndex === void 0;
239
- if (pt)
240
- H({
241
- hoveredSeriesId: c,
242
- hoveredAreaData: null,
243
- isAreaHovered: !1,
244
- cursorPos: I
245
- }), e?.(m);
246
- else if (yt) {
247
- const B = _?.data.map((ft, xt) => ({
248
- x: N[xt],
249
- y: ft
250
- })) ?? [];
251
- H({
252
- hoveredSeriesId: c,
253
- hoveredAreaData: B,
254
- isAreaHovered: !0,
255
- cursorPos: I
256
- }), r?.(m);
257
- } else
258
- H({
259
- hoveredSeriesId: null,
260
- hoveredAreaData: null,
261
- isAreaHovered: !1,
262
- cursorPos: I
263
- });
264
- }, gt = (t) => {
265
- const c = t.currentTarget.getBoundingClientRect();
266
- H((m) => ({
267
- ...m,
268
- cursorPos: {
269
- x: t.clientX - c.left,
270
- y: t.clientY - c.top
271
- }
272
- }));
273
- }, ht = {
274
- p: 4,
275
- "& .MuiBarLabel-root": {
276
- fontSize: 10,
277
- fontWeight: 600
278
- },
279
- "& .MuiAreaElement-root": {
280
- opacity: 0.4,
281
- transition: "opacity 0.3s ease"
282
- },
283
- "& .MuiAreaElement-root:hover": {
284
- opacity: 1
285
- },
286
- '& [class*="MuiLineElement-series-unstacked-"]': {
287
- strokeWidth: 3
288
- },
289
- ...p && k.reduce((t, c, m) => {
290
- const _ = `.MuiAreaElement-series-stacked-${m}`;
291
- return t[_] = {
292
- opacity: k[m].guid === p ? 0.9 : 0.2
293
- }, t;
294
- }, {})
295
- };
296
- return /* @__PURE__ */ s(
297
- L,
298
- {
299
- onMouseMove: gt,
300
- ref: x,
301
- sx: {
302
- position: "relative",
303
- touchAction: "pan-y",
304
- "& svg": {
305
- touchAction: "pan-y",
306
- userSelect: "none"
307
- },
308
- "& .recharts-wrapper": {
309
- touchAction: "pan-y"
310
- }
311
- },
312
- children: /* @__PURE__ */ f(
313
- T,
314
- {
315
- direction: { xs: "column", md: "column" },
316
- spacing: { xs: 0, md: 4 },
317
- sx: { width: "100%", position: "relative" },
318
- children: [
319
- /* @__PURE__ */ s(
320
- St,
321
- {
322
- height: y,
323
- margin: { bottom: 50 },
324
- onAreaClick: ut,
325
- onHighlightChange: mt,
326
- series: Y,
327
- skipAnimation: !0,
328
- slotProps: {
329
- legend: {
330
- hidden: !0
331
- }
332
- },
333
- slots: {
334
- itemContent: (t) => j && D ? /* @__PURE__ */ s(
335
- Vt,
336
- {
337
- categoryGuids: E(D),
338
- xData: N,
339
- ...t
340
- }
341
- ) : null
342
- },
343
- sx: ht,
344
- tooltip: {
345
- trigger: j ? "item" : "none"
346
- },
347
- xAxis: [
348
- {
349
- data: N,
350
- scaleType: "time",
351
- valueFormatter: (t) => R(t, w.MONTH_SHORT_YEAR),
352
- tickNumber: et
353
- // How many ticks to show on the x-axis
354
- }
355
- ],
356
- yAxis: [
357
- {
358
- min: st,
359
- max: it || 100
360
- }
361
- ]
362
- }
363
- ),
364
- /* @__PURE__ */ s(
365
- zt,
366
- {
367
- categoryGuids: ct,
368
- hoveredLegend: p,
369
- legendRef: d,
370
- onClickLegend: dt,
371
- onHoverLegend: lt,
372
- sx: { px: C ? 0 : 24 }
373
- }
374
- ),
375
- W && /* @__PURE__ */ s(
376
- Xt,
377
- {
378
- categoryGuids: E(D),
379
- chartContainerRef: x,
380
- cursorPosition: I,
381
- hoveredAreaData: $.map((t) => ({
382
- ...t,
383
- x: R(t.x, w.MONTH_SHORT_YEAR)
384
- }))
385
- }
386
- )
387
- ]
388
- }
389
- )
390
- }
391
- );
392
- }, ke = ({
393
- onClick: r,
394
- leftIcon: e,
395
- rightIcon: o,
396
- title: a,
397
- subtitle: n,
398
- rightContent: i,
399
- titleBold: l = !0,
400
- rightContentBold: h = !0
401
- }) => {
402
- const g = /* @__PURE__ */ f(M.Fragment, { children: [
403
- e && /* @__PURE__ */ s(z, { sx: { ml: 0 }, children: e }),
404
- /* @__PURE__ */ s($t, { children: /* @__PURE__ */ f(
405
- T,
406
- {
407
- sx: {
408
- alignItems: "center",
409
- flexDirection: "row",
410
- marginLeft: 12
411
- },
412
- children: [
413
- /* @__PURE__ */ f(T, { sx: { flex: 1, minWidth: 0 }, children: [
414
- /* @__PURE__ */ s(S, { bold: l, variant: "body1", children: a }),
415
- n && /* @__PURE__ */ s(S, { variant: "caption", children: n })
416
- ] }),
417
- /* @__PURE__ */ f(T, { sx: { flexDirection: "row", alignItems: "center", gap: 1 }, children: [
418
- i && /* @__PURE__ */ s(S, { bold: h, display: "flex", variant: "body1", children: i }),
419
- o && /* @__PURE__ */ s(z, { children: o })
420
- ] })
421
- ]
422
- }
423
- ) })
424
- ] });
425
- return /* @__PURE__ */ s(Bt, { sx: { bgcolor: "background.paper" }, children: r ? /* @__PURE__ */ s(
426
- Ot,
427
- {
428
- onClick: r,
429
- sx: {
430
- py: 14
431
- },
432
- children: g
433
- }
434
- ) : /* @__PURE__ */ s(
435
- T,
436
- {
437
- sx: {
438
- py: 14,
439
- px: 24,
440
- width: "100%",
441
- flexDirection: "row",
442
- alignItems: "center"
443
- },
444
- children: g
445
- }
446
- ) });
447
- }, qt = (r) => A[r] ?? A.default, Jt = (r) => Nt[r];
448
- function Kt(r, e) {
449
- const o = [], a = new Date(r);
450
- for (; a <= e; ) {
451
- const n = a.getFullYear(), i = String(a.getMonth() + 1).padStart(2, "0");
452
- o.push(+`${n}${i}`), a.setMonth(a.getMonth() + 1);
453
- }
454
- return o;
455
- }
456
- const Qt = (r) => r.reduce((o, a) => {
457
- const n = {
458
- top_level_category_guid: a.top_level_category_guid,
459
- category_guid: a.category_guid,
460
- amount: a.total,
461
- year_month: a.year_month
462
- }, { top_level_category_guid: i, category_guid: l } = n;
463
- return o[l] || (o[l] = []), o[l].push(n), i !== l && (o[i] || (o[i] = []), o[i].push(n)), o;
464
- }, {}), Ee = (r, e, o) => {
465
- const a = Qt(r), n = Kt(e, o);
466
- return Object.entries(a).map(([l, h]) => {
467
- const g = h[0].top_level_category_guid, C = n.map((d) => {
468
- const u = h.filter((p) => p.year_month === d).reduce((p, v) => p + Math.abs(v.amount), 0), x = Number(String(d).slice(0, 4)), y = Number(String(d).slice(4));
469
- return { x: new Date(x, y - 1), y: u };
470
- }).sort((d, u) => d.x.getTime() - u.x.getTime());
471
- return {
472
- top_level_category_guid: g,
473
- category_guid: l,
474
- category_name: Jt(l),
475
- category_color: qt(g),
476
- dataset: C
477
- };
478
- });
479
- }, Ge = (r, e) => {
480
- const o = typeof r == "string" ? parseFloat(r.replace(/[^0-9.-]+/g, "")) : r, a = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e;
481
- return (o || 0) - (a || 0);
482
- }, Ut = (r, e) => {
483
- const o = r.subCategories.filter((i) => i.currentAmount !== 0), a = r.totalMonthlyAmounts.slice(-e), n = (i) => i.substring(0, 3) + " " + i.slice(-4);
484
- return a.map((i) => {
485
- const l = n(i.label), h = o.map((d) => {
486
- const u = d.monthlyAmounts.slice(-e).find((x) => n(x.label) === l);
487
- return {
488
- label: d.name,
489
- amount: Math.abs(u?.amount || 0),
490
- header: l
491
- };
492
- }), g = r.monthlyAmounts.slice(-e).find((d) => n(d.label) === l);
493
- return [{
494
- label: r.name,
495
- amount: Math.abs(g?.amount || 0),
496
- header: l
497
- }, ...h].sort((d, u) => u.amount - d.amount);
498
- });
499
- }, Zt = (r, e) => {
500
- const o = r ? r.totalMonthlyAmounts.slice(-e).map((n) => ({
501
- x: n.label.substring(0, 3),
502
- y: Math.abs(n.amount)
503
- })) : [], a = r ? Ut(r, e) : [];
504
- return { monthlyAmounts: o, tooltipLabels: a };
505
- }, te = (r) => r.slice().filter(
506
- (e) => e.totalAmount !== 0 && e.isTransfer === !1 && e.guid !== Gt.INVESTMENTS
507
- ).sort((e, o) => Math.abs(o.totalAmount) - Math.abs(e.totalAmount));
508
- class Ne {
509
- globalStore;
510
- selectedCategoryData = null;
511
- selectedDateRange;
512
- visibleListLength = 5;
513
- constructor(e) {
514
- this.globalStore = e, this.selectedDateRange = {
515
- start: jt(q(Yt(/* @__PURE__ */ new Date(), 6)), 1),
516
- end: q(/* @__PURE__ */ new Date())
517
- }, Wt(this);
518
- }
519
- setSelectedCategoryData = (e) => {
520
- this.selectedCategoryData = e;
521
- };
522
- setSelectedDateRange = (e) => {
523
- this.selectedDateRange = e;
524
- };
525
- setVisibleListLength = (e) => {
526
- this.visibleListLength = e;
527
- };
528
- get sortedDetailedCategoriesWithTransactions() {
529
- return te(
530
- this.globalStore.categoryStore.detailedCategoriesWithTransactions
531
- );
532
- }
533
- get selectedDateRangeMonthCount() {
534
- return Ft(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
535
- }
536
- get selectedDateRangeMonthRange() {
537
- const e = R(this.selectedDateRange.start, w.MONTH_LONG), o = R(this.selectedDateRange.end, w.MONTH_LONG);
538
- return `${e} - ${o}`;
539
- }
540
- get visibleCategories() {
541
- return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
542
- }
543
- get collapsedCategories() {
544
- return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
545
- }
546
- get categoryDetailsChartData() {
547
- return Zt(
548
- this.selectedCategoryData,
549
- this.selectedDateRangeMonthCount
550
- );
551
- }
552
- }
553
- export {
554
- ke as L,
555
- Ie as S,
556
- Ne as T,
557
- Ge as a,
558
- Ee as g
559
- };
@@ -1,35 +0,0 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import e from "react";
3
- import u from "@mui/material/Box";
4
- const x = (a = "polite") => {
5
- const [s, o] = e.useState(""), [t, r] = e.useState(a), n = e.useCallback((c, i) => {
6
- i && r(i), o(c);
7
- }, []), p = e.useMemo(
8
- () => /* @__PURE__ */ l(
9
- u,
10
- {
11
- "aria-atomic": "true",
12
- "aria-live": t,
13
- role: t === "assertive" ? "alert" : "status",
14
- sx: {
15
- position: "absolute",
16
- width: "1px",
17
- height: "1px",
18
- padding: 0,
19
- margin: "-1px",
20
- overflow: "hidden",
21
- clip: "rect(0 0 0 0)",
22
- clipPath: "inset(50%)",
23
- whiteSpace: "nowrap",
24
- border: 0
25
- },
26
- children: s
27
- }
28
- ),
29
- [s, t]
30
- );
31
- return { announce: n, ariaLive: p };
32
- };
33
- export {
34
- x as u
35
- };