@mx-cartographer/experiences 7.4.5 → 7.4.6
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.
- package/CHANGELOG.md +4 -0
- package/dist/cashflow/index.es.js +1 -1
- package/dist/spending/index.es.js +1 -1
- package/dist/trends/index.es.js +165 -164
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -162,7 +162,7 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ c(C, { direction: "column
|
|
|
162
162
|
className: "mx-exp-spending-miniwidget",
|
|
163
163
|
onPrimaryCtaClick: e,
|
|
164
164
|
primaryCtaLabel: l.primary_cta,
|
|
165
|
-
sx: d,
|
|
165
|
+
sx: { height: "100%", ...d },
|
|
166
166
|
title: l.mini_title,
|
|
167
167
|
children: /* @__PURE__ */ t(Wt, {})
|
|
168
168
|
}
|
package/dist/trends/index.es.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { jsxs as f, jsx as e, Fragment as
|
|
2
|
-
import l, { useRef as
|
|
1
|
+
import { jsxs as f, jsx as e, Fragment as rt } from "react/jsx-runtime";
|
|
2
|
+
import l, { useRef as at, useState as it, useEffect as ct } from "react";
|
|
3
3
|
import { observer as k } from "mobx-react-lite";
|
|
4
|
-
import { CategoryIcon as Se, Text as K, Icon as fe, P as he, H3 as Pe, ChevronRightIcon as
|
|
4
|
+
import { CategoryIcon as Se, Text as K, Icon as fe, P as he, H3 as Pe, ChevronRightIcon as lt } from "@mxenabled/mxui";
|
|
5
5
|
import N from "@mui/material/Box";
|
|
6
6
|
import b from "@mui/material/Stack";
|
|
7
7
|
import _e from "@mui/material/Button";
|
|
8
8
|
import { addSeconds as $e } from "date-fns/addSeconds";
|
|
9
9
|
import { differenceInCalendarMonths as Ae } from "date-fns/differenceInCalendarMonths";
|
|
10
10
|
import { useTheme as be } from "@mui/material/styles";
|
|
11
|
-
import { LineChart as
|
|
11
|
+
import { LineChart as dt } from "@mui/x-charts";
|
|
12
12
|
import { u as ee } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
13
|
-
import { u as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
13
|
+
import { u as ut } from "../useDimensions-27p2evRx.mjs";
|
|
14
|
+
import ht from "@mui/material/Card";
|
|
15
|
+
import gt from "@mui/material/CardContent";
|
|
16
16
|
import Re from "@mui/material/Divider";
|
|
17
17
|
import We from "@mui/material/Grid";
|
|
18
|
-
import { u as W, m as U, g as P, b as me, h as xe, d as ve, w as pe,
|
|
19
|
-
import { b as
|
|
18
|
+
import { u as W, m as U, g as P, b as me, h as xe, d as ve, w as pe, q as Fe, f as He, n as mt, a as pt } from "../hooks-C41HAxM5.mjs";
|
|
19
|
+
import { b as ze } from "../Localization-2MODESHW.mjs";
|
|
20
20
|
import { C as Te } from "../CurrencyText-Dr0EZ7bp.mjs";
|
|
21
21
|
import { useTheme as Ct, Card as yt, CardContent as ft, Box as _t, Stack as Tt } from "@mui/material";
|
|
22
22
|
import { f as J, a as z } from "../Dialog-BPTr3qHE.mjs";
|
|
23
23
|
import { C as Me, c as St } from "../Category-CevNQ03n.mjs";
|
|
24
24
|
import { f as oe, a as bt } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
25
|
-
import { a as xt, g as vt, L as
|
|
25
|
+
import { a as xt, g as vt, L as Ke } from "../TrendsStore-BW9FGQeE.mjs";
|
|
26
26
|
import { T as Gn } from "../TrendsStore-BW9FGQeE.mjs";
|
|
27
|
-
import { i as wt, c as Dt, d as It, e as Et, f as Lt, h as Mt, b as
|
|
27
|
+
import { i as wt, c as Dt, d as It, e as Et, f as Lt, h as Mt, b as je, g as Ye, j as Oe } from "../SpendingData-BuJ03S9d.mjs";
|
|
28
28
|
import At from "@mui/material/ToggleButton";
|
|
29
29
|
import Rt from "@mui/material/ToggleButtonGroup";
|
|
30
30
|
import { DataGridPro as kt } from "@mui/x-data-grid-pro";
|
|
31
31
|
import { H as Ge } from "../HeaderCell-DjuifqHJ.mjs";
|
|
32
32
|
import { T as G, b as Ht } from "../ViewMoreMicroCard-C0832BMe.mjs";
|
|
33
|
-
import { A as v, W as
|
|
34
|
-
import { a as
|
|
33
|
+
import { A as v, W as Ue } from "../WidgetContainer-6dsjtOVg.mjs";
|
|
34
|
+
import { a as Xe, T as Ze } from "../TransactionDetails-COH0OKNG.mjs";
|
|
35
35
|
import { D as ke } from "../Drawer-BEtCk82g.mjs";
|
|
36
36
|
import { L as ge } from "../Loader-DUaFpDGv.mjs";
|
|
37
37
|
import { L as Ne } from "../LineChart-bc1D9xBE.mjs";
|
|
@@ -45,46 +45,46 @@ import Kt from "@mui/material/ListItem";
|
|
|
45
45
|
import jt from "@mui/material/ListItemButton";
|
|
46
46
|
import Yt from "@mui/material/ListItemIcon";
|
|
47
47
|
import Ut from "@mui/material/ListItemText";
|
|
48
|
-
import
|
|
48
|
+
import qe from "@mui/material/styles/useTheme";
|
|
49
49
|
import Xt from "@mui/material/Paper";
|
|
50
50
|
import { b as Zt } from "../CategoryUtil-DUM8NuGO.mjs";
|
|
51
51
|
import { E as qt } from "../ExportCsvAction-DzTrtPzk.mjs";
|
|
52
52
|
import { u as Qt } from "../useInsightsEnabled-CNjP5cfR.mjs";
|
|
53
53
|
import { E as Jt } from "../EmptyState-DoxNUae-.mjs";
|
|
54
54
|
import { l as eo } from "../ConnectDrawer-CuUj16NH.mjs";
|
|
55
|
-
const
|
|
56
|
-
const { categories: t } = W(), { getCategoryName: n } = U(),
|
|
55
|
+
const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
56
|
+
const { categories: t } = W(), { getCategoryName: n } = U(), s = n(o);
|
|
57
57
|
return /* @__PURE__ */ f(b, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
|
|
58
58
|
/* @__PURE__ */ e(
|
|
59
59
|
N,
|
|
60
60
|
{
|
|
61
|
-
"aria-label":
|
|
61
|
+
"aria-label": ze(t.category_icon_label_aria, s),
|
|
62
62
|
mb: 4,
|
|
63
63
|
role: "img",
|
|
64
|
-
children: /* @__PURE__ */ e(Se, { categoryGuid:
|
|
64
|
+
children: /* @__PURE__ */ e(Se, { categoryGuid: r })
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
|
-
/* @__PURE__ */ e(K, { variant: "Body", children:
|
|
67
|
+
/* @__PURE__ */ e(K, { variant: "Body", children: s })
|
|
68
68
|
] });
|
|
69
69
|
}, to = ({
|
|
70
|
-
categoryGuids: { guid: o, topLevelGuid:
|
|
70
|
+
categoryGuids: { guid: o, topLevelGuid: r },
|
|
71
71
|
hoveredAreaData: t,
|
|
72
72
|
cursorPosition: n,
|
|
73
|
-
chartContainerRef:
|
|
73
|
+
chartContainerRef: s
|
|
74
74
|
}) => {
|
|
75
|
-
const d = be(), u =
|
|
76
|
-
if (
|
|
75
|
+
const d = be(), u = at(null), [g, c] = it({ x: n.x, y: n.y });
|
|
76
|
+
if (ct(() => {
|
|
77
77
|
(() => {
|
|
78
|
-
const p = u.current, _ =
|
|
78
|
+
const p = u.current, _ = s.current;
|
|
79
79
|
if (!p || !_) return;
|
|
80
80
|
const m = p.getBoundingClientRect(), i = _.getBoundingClientRect();
|
|
81
81
|
let T = n.x, y = n.y;
|
|
82
82
|
T + m.width * 2 > i.right ? T = n.x - m.width : T - m.width < i.left && (T = n.x), y + m.height * 2 > i.bottom && (y = n.y - m.height), c({ x: T, y });
|
|
83
83
|
})();
|
|
84
|
-
}, [n,
|
|
84
|
+
}, [n, s]), !t) return null;
|
|
85
85
|
const h = t.reduce((C, p) => C + p.y, 0);
|
|
86
86
|
return /* @__PURE__ */ e(
|
|
87
|
-
|
|
87
|
+
ht,
|
|
88
88
|
{
|
|
89
89
|
ref: u,
|
|
90
90
|
sx: {
|
|
@@ -94,9 +94,9 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
94
94
|
width: 250,
|
|
95
95
|
pointerEvents: "none"
|
|
96
96
|
},
|
|
97
|
-
children: /* @__PURE__ */ f(
|
|
97
|
+
children: /* @__PURE__ */ f(gt, { children: [
|
|
98
98
|
/* @__PURE__ */ f(N, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
99
|
-
/* @__PURE__ */ e(
|
|
99
|
+
/* @__PURE__ */ e(Qe, { categoryGuid: o, topLevelCategoryGuid: r }),
|
|
100
100
|
/* @__PURE__ */ e(K, { variant: "Small", children: `${t.length}-month total` }),
|
|
101
101
|
/* @__PURE__ */ e(Te, { amount: h, bold: !0, formatString: "0,0", variant: "body2" })
|
|
102
102
|
] }),
|
|
@@ -120,23 +120,23 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
122
|
}, oo = k(to), no = ({
|
|
123
|
-
categoryGuids: { guid: o, topLevelGuid:
|
|
123
|
+
categoryGuids: { guid: o, topLevelGuid: r },
|
|
124
124
|
itemData: { dataIndex: t },
|
|
125
125
|
series: n,
|
|
126
|
-
xData:
|
|
126
|
+
xData: s
|
|
127
127
|
}) => {
|
|
128
|
-
const d = Ct(), u = n.data[t], g =
|
|
128
|
+
const d = Ct(), u = n.data[t], g = s[t];
|
|
129
129
|
return u === void 0 || !g ? null : /* @__PURE__ */ e(yt, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ f(_t, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
130
|
-
/* @__PURE__ */ e(
|
|
130
|
+
/* @__PURE__ */ e(Qe, { categoryGuid: o, topLevelCategoryGuid: r }),
|
|
131
131
|
/* @__PURE__ */ e(K, { color: d.palette.text.secondary, variant: "Small", children: J(g, z.MONTH_SHORT_YEAR) }),
|
|
132
132
|
/* @__PURE__ */ e(Te, { amount: String(u), bold: !0, formatString: "0,0", variant: "Body" })
|
|
133
133
|
] }) }) });
|
|
134
134
|
}, so = ({
|
|
135
135
|
sx: o,
|
|
136
|
-
categoryGuids:
|
|
136
|
+
categoryGuids: r,
|
|
137
137
|
hoveredLegend: t,
|
|
138
138
|
legendRef: n,
|
|
139
|
-
onHoverLegend:
|
|
139
|
+
onHoverLegend: s,
|
|
140
140
|
onClickLegend: d
|
|
141
141
|
}) => {
|
|
142
142
|
const { isMobile: u } = ee(), { getCategoryName: g } = U();
|
|
@@ -149,14 +149,14 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
149
149
|
justifyContent: "start",
|
|
150
150
|
ref: n,
|
|
151
151
|
sx: o,
|
|
152
|
-
children:
|
|
152
|
+
children: r.map(({ guid: c, top_level_guid: h }) => {
|
|
153
153
|
const C = t === c, p = Me[c], _ = Me[h], m = p ?? _ ?? Me.default, i = m + "33";
|
|
154
154
|
return /* @__PURE__ */ f(
|
|
155
155
|
_e,
|
|
156
156
|
{
|
|
157
157
|
onClick: () => d(c),
|
|
158
|
-
onMouseEnter: () =>
|
|
159
|
-
onMouseLeave: () =>
|
|
158
|
+
onMouseEnter: () => s(c),
|
|
159
|
+
onMouseLeave: () => s(null),
|
|
160
160
|
sx: {
|
|
161
161
|
color: "text.primary",
|
|
162
162
|
fontWeight: "normal",
|
|
@@ -191,15 +191,15 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
191
191
|
);
|
|
192
192
|
}, ro = ({
|
|
193
193
|
onHoverArea: o,
|
|
194
|
-
onHoverPoint:
|
|
194
|
+
onHoverPoint: r,
|
|
195
195
|
onHoverLegend: t,
|
|
196
196
|
onClickLegend: n,
|
|
197
|
-
stackedDatasets:
|
|
197
|
+
stackedDatasets: s,
|
|
198
198
|
unstackedDatasets: d = [],
|
|
199
199
|
availableHeight: u = 0,
|
|
200
200
|
minimumHeight: g = 350
|
|
201
201
|
}) => {
|
|
202
|
-
const c = be(), { isMobile: h } = ee(), [C, { height: p }] =
|
|
202
|
+
const c = be(), { isMobile: h } = ee(), [C, { height: p }] = ut(), _ = l.useRef(null), [m, i] = l.useState(0);
|
|
203
203
|
l.useEffect(() => {
|
|
204
204
|
const a = Math.max(u - p, g);
|
|
205
205
|
i(a);
|
|
@@ -209,18 +209,18 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
209
209
|
hoveredAreaData: null,
|
|
210
210
|
isAreaHovered: !1,
|
|
211
211
|
cursorPos: { x: 0, y: 0 }
|
|
212
|
-
}), { hoveredSeriesId: D, hoveredAreaData: O, isAreaHovered: A, cursorPos: M } = L, R = A && D && O, E = !R, X = [...
|
|
213
|
-
(a, S) =>
|
|
212
|
+
}), { hoveredSeriesId: D, hoveredAreaData: O, isAreaHovered: A, cursorPos: M } = L, R = A && D && O, E = !R, X = [...s, ...d], ne = X[0]?.dataset.length ?? 0, B = X.flatMap((a) => a.dataset.map((S) => S.x)), Ce = X.flatMap((a) => a.dataset.map((S) => S.y)), ae = s[0]?.dataset?.map(
|
|
213
|
+
(a, S) => s.reduce((I, Y) => I + Y.dataset[S]?.y || 0, 0)
|
|
214
214
|
) ?? [0], Z = Math.max(...ae), ie = Math.max(
|
|
215
215
|
...d.flatMap((a) => a.dataset.map((S) => S.y))
|
|
216
|
-
), q = Math.floor(Math.min(...Ce) / 100) * 100, ce = Math.ceil(Math.max(Z, ie) / 100) * 100, $ =
|
|
216
|
+
), q = Math.floor(Math.min(...Ce) / 100) * 100, ce = Math.ceil(Math.max(Z, ie) / 100) * 100, $ = s.map((a, S) => ({
|
|
217
217
|
id: `stacked-${S}`,
|
|
218
218
|
guid: a.category_guid,
|
|
219
219
|
top_level_guid: a.top_level_category_guid,
|
|
220
220
|
area: !0,
|
|
221
|
-
color:
|
|
221
|
+
color: s[S].category_color ?? c.palette.primary.main,
|
|
222
222
|
data: a.dataset.map((I) => I.y),
|
|
223
|
-
label:
|
|
223
|
+
label: s[S].category_name,
|
|
224
224
|
stack: "total",
|
|
225
225
|
type: "line",
|
|
226
226
|
highlightScope: { highlight: "item" },
|
|
@@ -245,7 +245,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
245
245
|
top_level_guid: S
|
|
246
246
|
}))
|
|
247
247
|
], j = (a) => {
|
|
248
|
-
const I = a.startsWith("stacked-") ?
|
|
248
|
+
const I = a.startsWith("stacked-") ? s[parseInt(a.split("-")[1])] : d[parseInt(a.split("-")[1])];
|
|
249
249
|
return {
|
|
250
250
|
guid: I?.category_guid,
|
|
251
251
|
topLevelGuid: I?.top_level_category_guid
|
|
@@ -265,7 +265,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
265
265
|
hoveredAreaData: null,
|
|
266
266
|
isAreaHovered: !1,
|
|
267
267
|
cursorPos: M
|
|
268
|
-
}),
|
|
268
|
+
}), r?.(I);
|
|
269
269
|
else if (Ie) {
|
|
270
270
|
const de = Y?.data.map((Ee, Le) => ({
|
|
271
271
|
x: B[Le],
|
|
@@ -340,7 +340,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
340
340
|
sx: { width: "100%", position: "relative" },
|
|
341
341
|
children: [
|
|
342
342
|
/* @__PURE__ */ e(
|
|
343
|
-
|
|
343
|
+
dt,
|
|
344
344
|
{
|
|
345
345
|
height: m,
|
|
346
346
|
margin: { bottom: 50 },
|
|
@@ -412,17 +412,17 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
412
412
|
)
|
|
413
413
|
}
|
|
414
414
|
);
|
|
415
|
-
},
|
|
415
|
+
}, Je = ({ selectedTab: o, onTabChange: r }) => /* @__PURE__ */ e(
|
|
416
416
|
Rt,
|
|
417
417
|
{
|
|
418
418
|
exclusive: !0,
|
|
419
|
-
onChange:
|
|
419
|
+
onChange: r,
|
|
420
420
|
orientation: "horizontal",
|
|
421
421
|
value: o,
|
|
422
422
|
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(At, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(fe, { name: "table_chart_view" }) : /* @__PURE__ */ e(fe, { name: "format_list_bulleted" }) }, t))
|
|
423
423
|
}
|
|
424
|
-
),
|
|
425
|
-
const { trends: t } = W(), { isMobile: n, isDesktop:
|
|
424
|
+
), et = ({ selectedDateRange: o, selectedCategoryGuid: r }) => {
|
|
425
|
+
const { trends: t } = W(), { isMobile: n, isDesktop: s } = ee(), { getCategoryName: d } = U(), u = l.useMemo(() => {
|
|
426
426
|
const g = J(
|
|
427
427
|
o.start,
|
|
428
428
|
n ? z.MONTH_SHORT_YEAR : z.MONTH_YEAR
|
|
@@ -443,27 +443,27 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
443
443
|
overflow: "visible",
|
|
444
444
|
textOverflow: "unset"
|
|
445
445
|
},
|
|
446
|
-
variant:
|
|
447
|
-
children: d(
|
|
446
|
+
variant: s ? "H3" : "Body",
|
|
447
|
+
children: d(r) || t.sub_title
|
|
448
448
|
}
|
|
449
449
|
),
|
|
450
|
-
/* @__PURE__ */ e(K, { variant:
|
|
450
|
+
/* @__PURE__ */ e(K, { variant: s ? "Body" : "Small", children: u })
|
|
451
451
|
] });
|
|
452
452
|
}, ao = (o) => {
|
|
453
|
-
const
|
|
454
|
-
return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(Te, { amount:
|
|
455
|
-
}, io = ({ categoryGuid: o, topLevelCategoryGuid:
|
|
456
|
-
const { getCategoryName: t } = U(), { categories: n } = W(),
|
|
453
|
+
const r = o.row[o.field];
|
|
454
|
+
return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(Te, { amount: r, variant: "Small" }) });
|
|
455
|
+
}, io = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
456
|
+
const { getCategoryName: t } = U(), { categories: n } = W(), s = n.default_categories[o]?.replace(/&/g, "&") ?? t(o);
|
|
457
457
|
return /* @__PURE__ */ f(b, { alignItems: "center", direction: "row", justifyContent: "center", children: [
|
|
458
458
|
/* @__PURE__ */ e(
|
|
459
459
|
N,
|
|
460
460
|
{
|
|
461
|
-
"aria-label":
|
|
461
|
+
"aria-label": ze(n.category_icon_label_aria, s),
|
|
462
462
|
role: "img",
|
|
463
|
-
children: /* @__PURE__ */ e(Se, { categoryGuid:
|
|
463
|
+
children: /* @__PURE__ */ e(Se, { categoryGuid: r })
|
|
464
464
|
}
|
|
465
465
|
),
|
|
466
|
-
/* @__PURE__ */ e(K, { sx: { ml: 12, pb: 6 }, variant: "Small", children:
|
|
466
|
+
/* @__PURE__ */ e(K, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
|
|
467
467
|
] });
|
|
468
468
|
}, co = (o) => /* @__PURE__ */ e(b, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
|
|
469
469
|
io,
|
|
@@ -471,24 +471,24 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
471
471
|
categoryGuid: o.row.category,
|
|
472
472
|
topLevelCategoryGuid: o.row.top_level_category_guid
|
|
473
473
|
}
|
|
474
|
-
) }), lo = (o,
|
|
474
|
+
) }), lo = (o, r) => {
|
|
475
475
|
const t = [], n = new Date(o);
|
|
476
|
-
for (; n <=
|
|
477
|
-
const
|
|
478
|
-
t.push(
|
|
476
|
+
for (; n <= r; ) {
|
|
477
|
+
const s = J(n, z.MONTH);
|
|
478
|
+
t.push(s), n.setMonth(n.getMonth() + 1);
|
|
479
479
|
}
|
|
480
480
|
return t;
|
|
481
|
-
},
|
|
481
|
+
}, tt = ({
|
|
482
482
|
monthlyCategoryTotals: o,
|
|
483
|
-
selectedDateRange:
|
|
483
|
+
selectedDateRange: r,
|
|
484
484
|
selectedCategory: t,
|
|
485
485
|
onClickRow: n,
|
|
486
|
-
height:
|
|
486
|
+
height: s = "100dvh",
|
|
487
487
|
sx: d = {}
|
|
488
488
|
}) => {
|
|
489
489
|
const { onEvent: u } = P(), g = J(/* @__PURE__ */ new Date(), z.MONTH_SHORT), [c, h] = l.useState([
|
|
490
490
|
{ field: g, sort: "desc" }
|
|
491
|
-
]), C = l.useMemo(() => lo(
|
|
491
|
+
]), C = l.useMemo(() => lo(r.start, r.end), [r]), p = [
|
|
492
492
|
{
|
|
493
493
|
field: "category",
|
|
494
494
|
flex: 1,
|
|
@@ -536,7 +536,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
536
536
|
);
|
|
537
537
|
return Object.values(T);
|
|
538
538
|
}, [o, t]);
|
|
539
|
-
return /* @__PURE__ */ e(N, { sx: { height:
|
|
539
|
+
return /* @__PURE__ */ e(N, { sx: { height: s, width: "100%", overflowX: "auto", boxShadow: "none", ...d }, children: /* @__PURE__ */ e(
|
|
540
540
|
kt,
|
|
541
541
|
{
|
|
542
542
|
columns: p,
|
|
@@ -563,22 +563,22 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
563
563
|
title: "Transaction List"
|
|
564
564
|
}, ho = ({
|
|
565
565
|
categoryGuid: o,
|
|
566
|
-
dateRange:
|
|
566
|
+
dateRange: r,
|
|
567
567
|
isOpen: t,
|
|
568
568
|
onClose: n
|
|
569
569
|
}) => {
|
|
570
|
-
const { onEvent:
|
|
570
|
+
const { onEvent: s } = P(), { selectedAccountGuids: d } = me(), { common: u } = W(), { setFilter: g, sortedTransactions: c } = xe(), [h, C] = l.useState(""), p = l.useMemo(
|
|
571
571
|
() => c.find((m) => m.guid === h),
|
|
572
572
|
[h, c]
|
|
573
573
|
);
|
|
574
574
|
l.useEffect(() => {
|
|
575
575
|
g({
|
|
576
576
|
accounts: d,
|
|
577
|
-
dateRange:
|
|
577
|
+
dateRange: r,
|
|
578
578
|
custom: (m) => o === "" || o === m.category_guid || o === m.top_level_category_guid,
|
|
579
579
|
showSplits: !!o
|
|
580
580
|
});
|
|
581
|
-
}, [d, o,
|
|
581
|
+
}, [d, o, r]), l.useEffect(() => s(v.TRENDS_VIEW_TRANSACTIONS), []);
|
|
582
582
|
const _ = () => {
|
|
583
583
|
C(""), n();
|
|
584
584
|
};
|
|
@@ -590,13 +590,13 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
590
590
|
onClose: _,
|
|
591
591
|
title: uo.title,
|
|
592
592
|
children: [
|
|
593
|
-
p && /* @__PURE__ */ e(
|
|
594
|
-
!p && /* @__PURE__ */ e(
|
|
593
|
+
p && /* @__PURE__ */ e(Xe, { transaction: p }),
|
|
594
|
+
!p && /* @__PURE__ */ e(Ze, { onClick: C })
|
|
595
595
|
]
|
|
596
596
|
}
|
|
597
597
|
);
|
|
598
|
-
}, go = k(ho), mo = ({ onBackClick: o, sx:
|
|
599
|
-
const { onEvent: t } = P(), { isDesktop: n, isTablet:
|
|
598
|
+
}, go = k(ho), mo = ({ onBackClick: o, sx: r }) => {
|
|
599
|
+
const { onEvent: t } = P(), { isDesktop: n, isTablet: s, isMobile: d } = ee(), { visibleAccounts: u } = ve(), { loadMonthlyCategoryTotals: g, monthlyCategoryTotals: c, getCategoryName: h } = U(), { sortedTransactions: C } = xe(), { selectedDateRange: p, setSelectedDateRange: _ } = pe(), { isCopyLoaded: m, isInitialized: i, selectedAccounts: T, setSelectedAccounts: y } = me(), { trends: L } = W(), [x, D] = l.useState(!1), [O, A] = l.useState(!1), [M, R] = l.useState("Chart"), [E, X] = l.useState(""), [ne, B] = l.useState(window.innerHeight), ae = ne - (d ? 315 : 345);
|
|
600
600
|
l.useEffect(() => {
|
|
601
601
|
const w = () => B(window.innerHeight);
|
|
602
602
|
return window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
|
|
@@ -645,7 +645,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
645
645
|
t(v.TRENDS_HOVER_POINT, { category: w });
|
|
646
646
|
};
|
|
647
647
|
return !m || !i || !x ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
|
|
648
|
-
|
|
648
|
+
Ue,
|
|
649
649
|
{
|
|
650
650
|
accountOptions: u,
|
|
651
651
|
calendarActions: { onRangeChanged: q },
|
|
@@ -653,7 +653,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
653
653
|
dateRangeVariant: "timeframebuttons",
|
|
654
654
|
onAccountsFilterClick: ce,
|
|
655
655
|
onBackClick: o,
|
|
656
|
-
sx:
|
|
656
|
+
sx: r,
|
|
657
657
|
title: L.title,
|
|
658
658
|
children: [
|
|
659
659
|
/* @__PURE__ */ f(
|
|
@@ -661,7 +661,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
661
661
|
{
|
|
662
662
|
sx: {
|
|
663
663
|
// eslint-disable-next-line no-nested-ternary
|
|
664
|
-
px: n ? 48 :
|
|
664
|
+
px: n ? 48 : s ? 24 : 12
|
|
665
665
|
},
|
|
666
666
|
children: [
|
|
667
667
|
/* @__PURE__ */ f(
|
|
@@ -672,13 +672,13 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
672
672
|
sx: { pb: d ? 12 : 24, pt: d ? 24 : 48 },
|
|
673
673
|
children: [
|
|
674
674
|
/* @__PURE__ */ e(
|
|
675
|
-
|
|
675
|
+
et,
|
|
676
676
|
{
|
|
677
677
|
selectedCategoryGuid: E,
|
|
678
678
|
selectedDateRange: p
|
|
679
679
|
}
|
|
680
680
|
),
|
|
681
|
-
/* @__PURE__ */ e(
|
|
681
|
+
/* @__PURE__ */ e(Je, { onTabChange: ie, selectedTab: M })
|
|
682
682
|
]
|
|
683
683
|
}
|
|
684
684
|
),
|
|
@@ -703,7 +703,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
703
703
|
}
|
|
704
704
|
),
|
|
705
705
|
M === "Table" && /* @__PURE__ */ e(
|
|
706
|
-
|
|
706
|
+
tt,
|
|
707
707
|
{
|
|
708
708
|
monthlyCategoryTotals: c,
|
|
709
709
|
onClickRow: $,
|
|
@@ -728,15 +728,15 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
728
728
|
}
|
|
729
729
|
);
|
|
730
730
|
}, Rn = k(mo), po = () => {
|
|
731
|
-
const o =
|
|
731
|
+
const { monthlyCategoryTotals: o } = U(), { trends: r } = W(), t = be(), { availableHeight: n = 300 } = Fe(), s = Mt(o);
|
|
732
732
|
return /* @__PURE__ */ e(
|
|
733
733
|
Ne,
|
|
734
734
|
{
|
|
735
735
|
baseline: "min",
|
|
736
|
-
colors: [
|
|
737
|
-
datasets: [
|
|
738
|
-
height:
|
|
739
|
-
labels: [
|
|
736
|
+
colors: [t.palette.primary.main],
|
|
737
|
+
datasets: [s],
|
|
738
|
+
height: n,
|
|
739
|
+
labels: [r.spending_label],
|
|
740
740
|
showArea: !0,
|
|
741
741
|
showAverage: !0,
|
|
742
742
|
showLegend: !0,
|
|
@@ -745,8 +745,8 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
745
745
|
valueFormatterString: "0,0"
|
|
746
746
|
}
|
|
747
747
|
);
|
|
748
|
-
}, Co = k(po), yo = ({ onPrimaryCtaClick: o, sx:
|
|
749
|
-
const { visibleAccounts: t } = ve(), { loadMonthlyCategoryTotals: n, monthlyTotalsLoaded:
|
|
748
|
+
}, Co = k(po), yo = ({ onPrimaryCtaClick: o, sx: r }) => {
|
|
749
|
+
const { visibleAccounts: t } = ve(), { loadMonthlyCategoryTotals: n, monthlyTotalsLoaded: s } = U(), { isInitialized: d } = He(), { trends: u } = W(), { isCopyLoaded: g, selectedAccounts: c, setSelectedAccounts: h } = me();
|
|
750
750
|
return l.useEffect(() => {
|
|
751
751
|
h(t);
|
|
752
752
|
}, [t]), l.useEffect(() => {
|
|
@@ -754,26 +754,27 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
754
754
|
}, [d, c]), !g || !d ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
|
|
755
755
|
Nt,
|
|
756
756
|
{
|
|
757
|
+
contentStyles: { height: "calc(100% - 72px)", ":last-child": { pb: 0 } },
|
|
757
758
|
onPrimaryCtaClick: o,
|
|
758
759
|
primaryCtaLabel: u.primary_cta,
|
|
759
760
|
subTitle: u.sub_title,
|
|
760
|
-
sx:
|
|
761
|
+
sx: { height: "100%", ...r },
|
|
761
762
|
title: u.mini_title,
|
|
762
|
-
children:
|
|
763
|
+
children: s ? /* @__PURE__ */ e(Co, {}) : /* @__PURE__ */ e(ge, {})
|
|
763
764
|
}
|
|
764
765
|
);
|
|
765
766
|
}, kn = k(yo), fo = 70, Be = ({
|
|
766
767
|
title: o,
|
|
767
|
-
totalAmount:
|
|
768
|
+
totalAmount: r,
|
|
768
769
|
transactionType: t,
|
|
769
770
|
percentage: n,
|
|
770
|
-
secondaryLabel:
|
|
771
|
+
secondaryLabel: s,
|
|
771
772
|
shouldDisplayPercentage: d
|
|
772
773
|
}) => {
|
|
773
|
-
const { availableWidth: u } =
|
|
774
|
+
const { availableWidth: u } = Fe(), g = l.useRef(null), c = l.useRef(null), h = bt(Number(Math.abs(n)), {
|
|
774
775
|
style: "percent",
|
|
775
776
|
minimumIntegerDigits: 1
|
|
776
|
-
}), C = u === 288 && oe(
|
|
777
|
+
}), C = u === 288 && oe(r, "0,0.00").length > 10 ? oe(r, "0,0") : oe(r, "0,0.00"), p = t === "spending" ? n > 0 : n >= 0, _ = t === "spending" ? "error.main" : "success.main", m = t === "spending" ? "success.main" : "text.secondary", i = g?.current, T = c?.current, y = i && T ? i.scrollWidth > T.clientWidth - fo : !1;
|
|
777
778
|
return /* @__PURE__ */ f(
|
|
778
779
|
b,
|
|
779
780
|
{
|
|
@@ -837,7 +838,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
837
838
|
{
|
|
838
839
|
color: p ? _ : m,
|
|
839
840
|
variant: "caption",
|
|
840
|
-
children:
|
|
841
|
+
children: s
|
|
841
842
|
}
|
|
842
843
|
)
|
|
843
844
|
]
|
|
@@ -856,26 +857,26 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
856
857
|
] })
|
|
857
858
|
] });
|
|
858
859
|
}), Hn = k(({ onCtaClick: o }) => {
|
|
859
|
-
const { visibleAccounts:
|
|
860
|
+
const { visibleAccounts: r } = ve(), { onEvent: t } = P(), { monthlyCategoryTotals: n, loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: d } = U(), u = {
|
|
860
861
|
start: Wt(/* @__PURE__ */ new Date(), 1),
|
|
861
862
|
end: /* @__PURE__ */ new Date()
|
|
862
863
|
}, { trends: g } = W(), { selectedAccounts: c, setSelectedAccounts: h, isInitialized: C } = me();
|
|
863
864
|
l.useEffect(() => {
|
|
864
|
-
h(
|
|
865
|
-
}, [
|
|
866
|
-
C &&
|
|
865
|
+
h(r);
|
|
866
|
+
}, [r]), l.useEffect(() => {
|
|
867
|
+
C && s(c, u.start).then(() => {
|
|
867
868
|
t(v.TRENDS_LOAD_WIDGET, {
|
|
868
|
-
state:
|
|
869
|
+
state: r?.length ? "default" : "zeroState"
|
|
869
870
|
});
|
|
870
871
|
});
|
|
871
872
|
}, [C, c]);
|
|
872
873
|
const { spendingData: p, incomeData: _ } = l.useMemo(
|
|
873
874
|
() => ({
|
|
874
|
-
spendingData:
|
|
875
|
-
incomeData:
|
|
875
|
+
spendingData: je(n, u),
|
|
876
|
+
incomeData: Ye(n, u)
|
|
876
877
|
}),
|
|
877
878
|
[n, u]
|
|
878
|
-
), [m, i] = p, [T, y] = _, L = Oe(i.y, m.y), x = Oe(y.y, T.y), D = C && !
|
|
879
|
+
), [m, i] = p, [T, y] = _, L = Oe(i.y, m.y), x = Oe(y.y, T.y), D = C && !r?.length, O = () => {
|
|
879
880
|
t(
|
|
880
881
|
D ? v.TRENDS_CLICK_GET_STARTED : v.TRENDS_CLICK_VIEW_MORE
|
|
881
882
|
), o();
|
|
@@ -925,9 +926,9 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
925
926
|
}
|
|
926
927
|
);
|
|
927
928
|
}), To = k(
|
|
928
|
-
({ isExpanded: o, onClick:
|
|
929
|
-
const t =
|
|
930
|
-
return /* @__PURE__ */ e(Kt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(jt, { onClick:
|
|
929
|
+
({ isExpanded: o, onClick: r }) => {
|
|
930
|
+
const t = qe();
|
|
931
|
+
return /* @__PURE__ */ e(Kt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(jt, { onClick: r, sx: { justifyContent: "center" }, children: /* @__PURE__ */ f(
|
|
931
932
|
b,
|
|
932
933
|
{
|
|
933
934
|
sx: { color: t.palette.primary.main, flexDirection: "row", alignItems: "center" },
|
|
@@ -949,40 +950,40 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
949
950
|
), Ve = k(
|
|
950
951
|
({
|
|
951
952
|
totalAmount: o,
|
|
952
|
-
guid:
|
|
953
|
+
guid: r,
|
|
953
954
|
name: t,
|
|
954
955
|
transactions: n,
|
|
955
|
-
onClick:
|
|
956
|
+
onClick: s,
|
|
956
957
|
isLastItem: d = !1,
|
|
957
958
|
showDivider: u = !0
|
|
958
959
|
}) => {
|
|
959
960
|
const { trends: g } = W(), { onEvent: c } = P(), h = `${n.length} ${n.length === 1 ? g.transaction : g.transactions}`, C = () => {
|
|
960
|
-
|
|
961
|
+
s?.(), c(v.TRENDS_CLICK_LIST_ITEM, {
|
|
961
962
|
...G,
|
|
962
963
|
listItem: t
|
|
963
964
|
});
|
|
964
965
|
};
|
|
965
966
|
return /* @__PURE__ */ f(l.Fragment, { children: [
|
|
966
967
|
/* @__PURE__ */ e(
|
|
967
|
-
|
|
968
|
+
Ke,
|
|
968
969
|
{
|
|
969
|
-
leftIcon:
|
|
970
|
+
leftIcon: r ? /* @__PURE__ */ e(Se, { categoryGuid: r }) : void 0,
|
|
970
971
|
onClick: C,
|
|
971
972
|
rightContent: oe(Math.abs(o), "0,0.00"),
|
|
972
|
-
rightIcon:
|
|
973
|
+
rightIcon: s ? /* @__PURE__ */ e(lt, {}) : void 0,
|
|
973
974
|
subtitle: h,
|
|
974
975
|
title: t
|
|
975
976
|
}
|
|
976
977
|
),
|
|
977
978
|
u && /* @__PURE__ */ e(Re, { sx: { ml: d ? 24 : 68 } })
|
|
978
|
-
] },
|
|
979
|
+
] }, r);
|
|
979
980
|
}
|
|
980
981
|
), So = k(
|
|
981
|
-
({ availableHeight: o = 0, onCategoryClick:
|
|
982
|
-
const { collapsedCategories: t, visibleCategories: n, setVisibleListLength:
|
|
982
|
+
({ availableHeight: o = 0, onCategoryClick: r }) => {
|
|
983
|
+
const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: s } = pe(), { isLargeDesktop: d, isDesktop: u } = ee(), { trends: g } = W(), { onEvent: c } = P(), [h, C] = l.useState(!1), p = u || d;
|
|
983
984
|
l.useEffect(() => {
|
|
984
985
|
const i = Math.floor(o / 64) - 1, T = n.length + t.length;
|
|
985
|
-
i !== n.length && (
|
|
986
|
+
i !== n.length && (s(p ? Math.max(i, 5) : 5), C(i >= T));
|
|
986
987
|
}, [o]);
|
|
987
988
|
const _ = () => {
|
|
988
989
|
C(!h), c(v.TRENDS_CLICK_VIEW_MORE, {
|
|
@@ -996,7 +997,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
996
997
|
{
|
|
997
998
|
...i,
|
|
998
999
|
isLastItem: T === m - 1,
|
|
999
|
-
onClick: i.transactions.length > 0 ? () =>
|
|
1000
|
+
onClick: i.transactions.length > 0 ? () => r(i) : void 0,
|
|
1000
1001
|
showDivider: !0
|
|
1001
1002
|
},
|
|
1002
1003
|
i.guid
|
|
@@ -1013,7 +1014,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1013
1014
|
{
|
|
1014
1015
|
...i,
|
|
1015
1016
|
isLastItem: y === m - 1,
|
|
1016
|
-
onClick: i.transactions.length > 0 ? () =>
|
|
1017
|
+
onClick: i.transactions.length > 0 ? () => r(i) : void 0,
|
|
1017
1018
|
showDivider: !0
|
|
1018
1019
|
},
|
|
1019
1020
|
i.guid
|
|
@@ -1024,9 +1025,9 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1024
1025
|
t.length > 0 && /* @__PURE__ */ e(To, { isExpanded: h, onClick: _ })
|
|
1025
1026
|
] }) });
|
|
1026
1027
|
}
|
|
1027
|
-
), bo = ({ beats: o, onInsightCardClick:
|
|
1028
|
-
const { onEvent: t } = P(), { isMobile: n, isDesktop:
|
|
1029
|
-
|
|
1028
|
+
), bo = ({ beats: o, onInsightCardClick: r }) => {
|
|
1029
|
+
const { onEvent: t } = P(), { isMobile: n, isDesktop: s, isLargeDesktop: d } = ee(), { beatStore: u, endpoint: g, sessionToken: c } = He(), h = s || d, C = h || n ? 1 : 2, p = () => null, _ = (x) => {
|
|
1030
|
+
r?.(x), t(v.TRENDS_CLICK_INSIGHT, G);
|
|
1030
1031
|
}, m = h ? 200 : 170, i = h ? 170 : 124, T = h ? 56 : 0, y = o.length > 0 ? m + T : i, L = h && o.length > 0 ? m : void 0;
|
|
1031
1032
|
return /* @__PURE__ */ e(Tt, { sx: { height: y }, children: /* @__PURE__ */ e(
|
|
1032
1033
|
Ht,
|
|
@@ -1049,22 +1050,22 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1049
1050
|
visibleCardsCount: C
|
|
1050
1051
|
}
|
|
1051
1052
|
) });
|
|
1052
|
-
}, xo = k(bo), vo = k(({ chartLabel: o, chartColor:
|
|
1053
|
+
}, xo = k(bo), vo = k(({ chartLabel: o, chartColor: r }) => {
|
|
1053
1054
|
const { onEvent: t } = P(), {
|
|
1054
|
-
categoryDetailsChartData: { monthlyAmounts: n, tooltipLabels:
|
|
1055
|
+
categoryDetailsChartData: { monthlyAmounts: n, tooltipLabels: s }
|
|
1055
1056
|
} = pe();
|
|
1056
1057
|
return /* @__PURE__ */ e(b, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
|
|
1057
1058
|
Ne,
|
|
1058
1059
|
{
|
|
1059
1060
|
baseline: "min",
|
|
1060
|
-
colors: [
|
|
1061
|
+
colors: [r],
|
|
1061
1062
|
curveType: "bump",
|
|
1062
|
-
customTooltipLabels:
|
|
1063
|
+
customTooltipLabels: s,
|
|
1063
1064
|
datasets: [n],
|
|
1064
1065
|
height: 265,
|
|
1065
1066
|
labels: [o],
|
|
1066
1067
|
markStyles: () => ({
|
|
1067
|
-
stroke:
|
|
1068
|
+
stroke: r
|
|
1068
1069
|
}),
|
|
1069
1070
|
onItemClick: () => {
|
|
1070
1071
|
t(v.TRENDS_CLICK_CHART, G);
|
|
@@ -1083,10 +1084,10 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1083
1084
|
}
|
|
1084
1085
|
) });
|
|
1085
1086
|
}), wo = k(({ onClose: o }) => {
|
|
1086
|
-
const
|
|
1087
|
+
const r = qe(), { onEvent: t } = P(), { common: n, trends: s } = W(), { selectedCategoryData: d, selectedDateRangeMonthRange: u } = pe(), { sortedTransactions: g } = xe(), [c, h] = l.useState(null);
|
|
1087
1088
|
if (!d)
|
|
1088
1089
|
return null;
|
|
1089
|
-
const { guid: C, name: p, is_income: _, totalAmount: m } = d, i = _ ?
|
|
1090
|
+
const { guid: C, name: p, is_income: _, totalAmount: m } = d, i = _ ? s.category_income : s.category_spending, T = Zt(C, r), y = _ ? s.income_label : s.spending_label, L = ` ${d.transactions.length === 1 ? s.transaction : s.transactions} (${d.transactions.length})`, x = l.useMemo(
|
|
1090
1091
|
() => g.find((A) => A.guid === c),
|
|
1091
1092
|
[c, g]
|
|
1092
1093
|
), D = (A) => A.category_guid === C || A.top_level_category_guid === C, O = () => {
|
|
@@ -1095,7 +1096,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1095
1096
|
return /* @__PURE__ */ f(
|
|
1096
1097
|
ke,
|
|
1097
1098
|
{
|
|
1098
|
-
ariaLabelClose:
|
|
1099
|
+
ariaLabelClose: s.close_category_details,
|
|
1099
1100
|
isOpen: !0,
|
|
1100
1101
|
onClose: O,
|
|
1101
1102
|
shouldShowHeaderShadow: !0,
|
|
@@ -1104,7 +1105,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1104
1105
|
/* @__PURE__ */ f(b, { sx: { alignItems: "center", height: "100%" }, children: [
|
|
1105
1106
|
/* @__PURE__ */ f(Xt, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
|
|
1106
1107
|
/* @__PURE__ */ e(
|
|
1107
|
-
|
|
1108
|
+
Ke,
|
|
1108
1109
|
{
|
|
1109
1110
|
leftIcon: /* @__PURE__ */ e(Se, { categoryGuid: C }),
|
|
1110
1111
|
rightContent: oe(Math.abs(m), "0,0.00"),
|
|
@@ -1119,7 +1120,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1119
1120
|
] })
|
|
1120
1121
|
] }),
|
|
1121
1122
|
/* @__PURE__ */ e(
|
|
1122
|
-
|
|
1123
|
+
Ze,
|
|
1123
1124
|
{
|
|
1124
1125
|
bgcolor: "transparent",
|
|
1125
1126
|
filter: D,
|
|
@@ -1134,36 +1135,36 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1134
1135
|
ariaLabelClose: n.close_aria,
|
|
1135
1136
|
isOpen: !!x,
|
|
1136
1137
|
onClose: () => h(""),
|
|
1137
|
-
title:
|
|
1138
|
-
children: x && /* @__PURE__ */ e(
|
|
1138
|
+
title: s.transaction,
|
|
1139
|
+
children: x && /* @__PURE__ */ e(Xe, { transaction: x })
|
|
1139
1140
|
}
|
|
1140
1141
|
)
|
|
1141
1142
|
]
|
|
1142
1143
|
}
|
|
1143
1144
|
);
|
|
1144
|
-
}), Do = (o,
|
|
1145
|
-
const t =
|
|
1146
|
-
return [t, n].filter((
|
|
1147
|
-
}, Io = (o,
|
|
1148
|
-
const [t, n] = o,
|
|
1149
|
-
if (
|
|
1150
|
-
const g =
|
|
1151
|
-
u.push({ label:
|
|
1145
|
+
}), Do = (o, r) => {
|
|
1146
|
+
const t = Ye(o, r), n = je(o, r);
|
|
1147
|
+
return [t, n].filter((s) => s.length > 0);
|
|
1148
|
+
}, Io = (o, r) => {
|
|
1149
|
+
const [t, n] = o, s = t, d = n ?? t, u = [];
|
|
1150
|
+
if (s) {
|
|
1151
|
+
const g = s.reduce((c, h) => c + h.y, 0);
|
|
1152
|
+
u.push({ label: r.income_label, amount: g });
|
|
1152
1153
|
}
|
|
1153
1154
|
if (d) {
|
|
1154
1155
|
const g = d.reduce((c, h) => c + h.y, 0);
|
|
1155
|
-
u.push({ label:
|
|
1156
|
+
u.push({ label: r.spending_label, amount: g });
|
|
1156
1157
|
}
|
|
1157
1158
|
return u;
|
|
1158
1159
|
}, Eo = ({
|
|
1159
1160
|
availableHeight: o = 0,
|
|
1160
|
-
minHeight:
|
|
1161
|
+
minHeight: r = 500,
|
|
1161
1162
|
selectedDateRange: t,
|
|
1162
1163
|
totals: n
|
|
1163
1164
|
}) => {
|
|
1164
|
-
const
|
|
1165
|
+
const s = be(), { onEvent: d } = P(), { trends: u } = W(), { isSmallMobile: g, isMobile: c, isSmallTablet: h, isTablet: C } = ee(), p = [s.palette.chart?.chart1, s.palette.chart?.chart2], _ = Do(n, t), m = Io(_, u), [i, T] = l.useState(0), y = 458, L = 195, x = 56, D = c || g ? L : h || C ? y : i;
|
|
1165
1166
|
return l.useEffect(() => {
|
|
1166
|
-
const A = Math.max(o - x,
|
|
1167
|
+
const A = Math.max(o - x, r);
|
|
1167
1168
|
T(A);
|
|
1168
1169
|
}, [o]), /* @__PURE__ */ e(
|
|
1169
1170
|
Ne,
|
|
@@ -1222,8 +1223,8 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1222
1223
|
"WeeklyNewMerchantsV2",
|
|
1223
1224
|
"WeeklyNoSpendDays",
|
|
1224
1225
|
"WeeklySmallPurchasesSummary"
|
|
1225
|
-
], Ao = ({ onBackClick: o, onInsightCardClick:
|
|
1226
|
-
const { onEvent: n } = P(), { onLoad:
|
|
1226
|
+
], Ao = ({ onBackClick: o, onInsightCardClick: r, sx: t }) => {
|
|
1227
|
+
const { onEvent: n } = P(), { onLoad: s } = mt(), { config: d } = pt(), { isLargeDesktop: u, isDesktop: g, isMobile: c } = ee(), { visibleAccounts: h } = ve(), { loadDateRangeCategoryTotals: C, loadMonthlyCategoryTotals: p, monthlyCategoryTotals: _ } = U(), { setFilter: m } = xe(), { selectedDateRange: i, setSelectedCategoryData: T, setSelectedDateRange: y } = pe(), {
|
|
1227
1228
|
isCopyLoaded: L,
|
|
1228
1229
|
isInitialized: x,
|
|
1229
1230
|
selectedAccounts: D,
|
|
@@ -1253,7 +1254,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1253
1254
|
ae(!0), n(v.TRENDS_LOAD_WIDGET, {
|
|
1254
1255
|
...G,
|
|
1255
1256
|
time_period: `${Ae(i.end, i.start)}M`
|
|
1256
|
-
}),
|
|
1257
|
+
}), s?.("TrendsWidget");
|
|
1257
1258
|
});
|
|
1258
1259
|
}, [x, D, i]), l.useEffect(() => {
|
|
1259
1260
|
if (_.length !== 0) {
|
|
@@ -1281,23 +1282,23 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1281
1282
|
toggleView: Q
|
|
1282
1283
|
});
|
|
1283
1284
|
}, Ee = (H) => {
|
|
1284
|
-
const Q = $e(H?.[0], 1), ue = H?.[1],
|
|
1285
|
+
const Q = $e(H?.[0], 1), ue = H?.[1], st = Ae(ue, Q);
|
|
1285
1286
|
y({ start: Q, end: ue }), n(v.TRENDS_CLICK_TIME_WINDOW, {
|
|
1286
1287
|
...G,
|
|
1287
|
-
time_period:
|
|
1288
|
+
time_period: st + "M"
|
|
1288
1289
|
});
|
|
1289
1290
|
}, Le = (H) => {
|
|
1290
1291
|
n(v.TRENDS_CLICK_FILTER, {
|
|
1291
1292
|
...G,
|
|
1292
1293
|
filterValue: H
|
|
1293
1294
|
});
|
|
1294
|
-
},
|
|
1295
|
+
}, ot = (H) => {
|
|
1295
1296
|
te(H);
|
|
1296
|
-
},
|
|
1297
|
+
}, nt = () => {
|
|
1297
1298
|
te(""), n(v.TRENDS_CLICK_ALL_CATEGORIES, G);
|
|
1298
1299
|
};
|
|
1299
1300
|
return !L || !Ce ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
|
|
1300
|
-
|
|
1301
|
+
Ue,
|
|
1301
1302
|
{
|
|
1302
1303
|
accountOptions: h,
|
|
1303
1304
|
calendarActions: { onRangeChanged: Ee },
|
|
@@ -1335,22 +1336,22 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1335
1336
|
sx: { pb: c ? 12 : 24, pt: c ? 24 : 48 },
|
|
1336
1337
|
children: [
|
|
1337
1338
|
/* @__PURE__ */ e(
|
|
1338
|
-
|
|
1339
|
+
et,
|
|
1339
1340
|
{
|
|
1340
1341
|
selectedCategoryGuid: $,
|
|
1341
1342
|
selectedDateRange: i
|
|
1342
1343
|
}
|
|
1343
1344
|
),
|
|
1344
|
-
/* @__PURE__ */ e(
|
|
1345
|
+
/* @__PURE__ */ e(Je, { onTabChange: de, selectedTab: q })
|
|
1345
1346
|
]
|
|
1346
1347
|
}
|
|
1347
1348
|
),
|
|
1348
|
-
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(N, { flexGrow: 1, children: $ && /* @__PURE__ */ f(_e, { onClick:
|
|
1349
|
+
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(N, { flexGrow: 1, children: $ && /* @__PURE__ */ f(_e, { onClick: nt, sx: { p: 0, pr: 5 }, children: [
|
|
1349
1350
|
/* @__PURE__ */ e(fe, { name: "arrow_back" }),
|
|
1350
1351
|
M.all_categories
|
|
1351
1352
|
] }) }) }),
|
|
1352
1353
|
/* @__PURE__ */ f(b, { flexDirection: B ? "row" : "column", gap: B ? 48 : 16, children: [
|
|
1353
|
-
q === "Chart" && /* @__PURE__ */ f(
|
|
1354
|
+
q === "Chart" && /* @__PURE__ */ f(rt, { children: [
|
|
1354
1355
|
/* @__PURE__ */ e(N, { sx: { width: B ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
1355
1356
|
Lo,
|
|
1356
1357
|
{
|
|
@@ -1365,7 +1366,7 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1365
1366
|
xo,
|
|
1366
1367
|
{
|
|
1367
1368
|
beats: I,
|
|
1368
|
-
onInsightCardClick:
|
|
1369
|
+
onInsightCardClick: r
|
|
1369
1370
|
}
|
|
1370
1371
|
),
|
|
1371
1372
|
/* @__PURE__ */ e(
|
|
@@ -1378,11 +1379,11 @@ const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1378
1379
|
] })
|
|
1379
1380
|
] }),
|
|
1380
1381
|
q === "Table" && /* @__PURE__ */ e(N, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1381
|
-
|
|
1382
|
+
tt,
|
|
1382
1383
|
{
|
|
1383
1384
|
height: "unset",
|
|
1384
1385
|
monthlyCategoryTotals: _,
|
|
1385
|
-
onClickRow:
|
|
1386
|
+
onClickRow: ot,
|
|
1386
1387
|
selectedCategory: $,
|
|
1387
1388
|
selectedDateRange: i
|
|
1388
1389
|
}
|