@mx-cartographer/experiences 7.6.4 → 7.6.5
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
CHANGED
package/dist/trends/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as y, jsx as e, Fragment as dt } from "react/jsx-runtime";
|
|
2
2
|
import u, { useRef as ut, useState as ht, useEffect as gt } from "react";
|
|
3
|
-
import { observer as
|
|
3
|
+
import { observer as H } from "mobx-react-lite";
|
|
4
4
|
import { CategoryIcon as Se, Text as P, Icon as _e, P as ge, H3 as Ye, ChevronRightIcon as mt } from "@mxenabled/mxui";
|
|
5
|
-
import
|
|
5
|
+
import R from "@mui/material/Box";
|
|
6
6
|
import S from "@mui/material/Stack";
|
|
7
7
|
import be from "@mui/material/Button";
|
|
8
8
|
import { addSeconds as je } from "date-fns/addSeconds";
|
|
@@ -17,7 +17,7 @@ import Ue from "@mui/material/Card";
|
|
|
17
17
|
import Xe from "@mui/material/CardContent";
|
|
18
18
|
import He from "@mui/material/Divider";
|
|
19
19
|
import Ge from "@mui/material/Grid";
|
|
20
|
-
import { u as
|
|
20
|
+
import { u as A, m as $, g as V, b as pe, h as xe, d as ve, v as Ce, p as Ze, f as We, a as bt } from "../hooks-ZMp65DFz.mjs";
|
|
21
21
|
import { b as Tt } from "../Localization-2MODESHW.mjs";
|
|
22
22
|
import { C as Te } from "../CurrencyText-Dr0EZ7bp.mjs";
|
|
23
23
|
import { C as Ae, b as Be, c as St } from "../Category-CevNQ03n.mjs";
|
|
@@ -56,11 +56,11 @@ import { E as Qt } from "../ExportCsvAction-Col0j3VJ.mjs";
|
|
|
56
56
|
import { u as qt } from "../useInsightsEnabled-B7dxpDrX.mjs";
|
|
57
57
|
import { E as Jt } from "../EmptyState-DoxNUae-.mjs";
|
|
58
58
|
import { l as eo } from "../ConnectDrawer-DJV-yWGN.mjs";
|
|
59
|
-
const st = ({ categoryGuid:
|
|
60
|
-
const { categories: n } =
|
|
59
|
+
const st = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
60
|
+
const { categories: n } = A(), { getCategoryName: t } = $(), s = t(o);
|
|
61
61
|
return /* @__PURE__ */ y(S, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
|
|
62
62
|
/* @__PURE__ */ e(
|
|
63
|
-
|
|
63
|
+
R,
|
|
64
64
|
{
|
|
65
65
|
"aria-label": Tt(n.category_icon_label_aria, s),
|
|
66
66
|
mb: 4,
|
|
@@ -71,21 +71,21 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
71
71
|
/* @__PURE__ */ e(P, { variant: "Body", children: s })
|
|
72
72
|
] });
|
|
73
73
|
}, to = ({
|
|
74
|
-
categoryGuids: { guid:
|
|
74
|
+
categoryGuids: { guid: o, topLevelGuid: r },
|
|
75
75
|
hoveredAreaData: n,
|
|
76
|
-
cursorPosition:
|
|
76
|
+
cursorPosition: t,
|
|
77
77
|
chartContainerRef: s
|
|
78
78
|
}) => {
|
|
79
|
-
const h = ce(), g = ut(null), [d, l] = ht({ x:
|
|
79
|
+
const h = ce(), g = ut(null), [d, l] = ht({ x: t.x, y: t.y });
|
|
80
80
|
if (gt(() => {
|
|
81
81
|
(() => {
|
|
82
82
|
const i = g.current, b = s.current;
|
|
83
83
|
if (!i || !b) return;
|
|
84
84
|
const c = i.getBoundingClientRect(), f = b.getBoundingClientRect();
|
|
85
|
-
let C =
|
|
86
|
-
C + c.width * 2 > f.right ? C =
|
|
85
|
+
let C = t.x, _ = t.y;
|
|
86
|
+
C + c.width * 2 > f.right ? C = t.x - c.width : C - c.width < f.left && (C = t.x), _ + c.height * 2 > f.bottom && (_ = t.y - c.height), l({ x: C, y: _ });
|
|
87
87
|
})();
|
|
88
|
-
}, [
|
|
88
|
+
}, [t, s]), !n) return null;
|
|
89
89
|
const m = n.reduce((p, i) => p + i.y, 0);
|
|
90
90
|
return /* @__PURE__ */ e(
|
|
91
91
|
Ue,
|
|
@@ -99,15 +99,15 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
99
99
|
pointerEvents: "none"
|
|
100
100
|
},
|
|
101
101
|
children: /* @__PURE__ */ y(Xe, { children: [
|
|
102
|
-
/* @__PURE__ */ y(
|
|
103
|
-
/* @__PURE__ */ e(st, { categoryGuid:
|
|
102
|
+
/* @__PURE__ */ y(R, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
103
|
+
/* @__PURE__ */ e(st, { categoryGuid: o, topLevelCategoryGuid: r }),
|
|
104
104
|
/* @__PURE__ */ e(P, { variant: "Small", children: `${n.length}-month total` }),
|
|
105
105
|
/* @__PURE__ */ e(Te, { amount: m, bold: !0, formatString: "0,0", variant: "body2" })
|
|
106
106
|
] }),
|
|
107
107
|
/* @__PURE__ */ e(He, { sx: { my: 16, width: "100%" } }),
|
|
108
108
|
/* @__PURE__ */ e(Ge, { container: !0, children: n.map((p, i) => /* @__PURE__ */ y(u.Fragment, { children: [
|
|
109
109
|
i > 0 && i % 3 === 0 && /* @__PURE__ */ e(He, { sx: { my: 16, width: "100%" } }),
|
|
110
|
-
/* @__PURE__ */ e(Ge, { item: !0, xs: 4, children: /* @__PURE__ */ y(
|
|
110
|
+
/* @__PURE__ */ e(Ge, { item: !0, xs: 4, children: /* @__PURE__ */ y(R, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
111
111
|
/* @__PURE__ */ e(P, { color: h.palette.text.secondary, variant: "XSmall", children: p.x }),
|
|
112
112
|
/* @__PURE__ */ e(
|
|
113
113
|
Te,
|
|
@@ -123,11 +123,11 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
123
123
|
] })
|
|
124
124
|
}
|
|
125
125
|
);
|
|
126
|
-
}, oo =
|
|
127
|
-
sx:
|
|
126
|
+
}, oo = H(to), no = ({
|
|
127
|
+
sx: o,
|
|
128
128
|
categoryGuids: r,
|
|
129
129
|
hoveredLegend: n,
|
|
130
|
-
legendRef:
|
|
130
|
+
legendRef: t,
|
|
131
131
|
onHoverLegend: s,
|
|
132
132
|
onClickLegend: h
|
|
133
133
|
}) => {
|
|
@@ -139,8 +139,8 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
139
139
|
flexWrap: "wrap",
|
|
140
140
|
gap: g ? 2 : 6,
|
|
141
141
|
justifyContent: "start",
|
|
142
|
-
ref:
|
|
143
|
-
sx:
|
|
142
|
+
ref: t,
|
|
143
|
+
sx: o,
|
|
144
144
|
children: r.map(({ guid: l, top_level_guid: m }) => {
|
|
145
145
|
const p = n === l, i = Ae[l], b = Ae[m], c = i ?? b ?? Ae.default, f = c + "33";
|
|
146
146
|
return /* @__PURE__ */ y(
|
|
@@ -162,7 +162,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
162
162
|
},
|
|
163
163
|
children: [
|
|
164
164
|
/* @__PURE__ */ e(
|
|
165
|
-
|
|
165
|
+
R,
|
|
166
166
|
{
|
|
167
167
|
sx: {
|
|
168
168
|
width: 16,
|
|
@@ -182,25 +182,25 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
182
182
|
}
|
|
183
183
|
);
|
|
184
184
|
}, so = ({
|
|
185
|
-
categoryGuids: { guid:
|
|
185
|
+
categoryGuids: { guid: o, topLevelGuid: r },
|
|
186
186
|
series: n,
|
|
187
|
-
xData:
|
|
187
|
+
xData: t
|
|
188
188
|
}) => {
|
|
189
189
|
const s = Ct(), h = ce();
|
|
190
190
|
if (!s?.identifier) return null;
|
|
191
191
|
const { dataIndex: g, seriesId: d } = s.identifier;
|
|
192
192
|
if (g == null || !d) return null;
|
|
193
|
-
const m = n.find((i) => i.id === d)?.data?.[g], p =
|
|
194
|
-
return m === void 0 || !p ? null : /* @__PURE__ */ e(Ue, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(Xe, { children: /* @__PURE__ */ y(
|
|
195
|
-
/* @__PURE__ */ e(st, { categoryGuid:
|
|
193
|
+
const m = n.find((i) => i.id === d)?.data?.[g], p = t?.[g];
|
|
194
|
+
return m === void 0 || !p ? null : /* @__PURE__ */ e(Ue, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(Xe, { children: /* @__PURE__ */ y(R, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
195
|
+
/* @__PURE__ */ e(st, { categoryGuid: o, topLevelCategoryGuid: r }),
|
|
196
196
|
/* @__PURE__ */ e(P, { color: h.palette.text.secondary, variant: "Small", children: U(p, G.MONTH_SHORT_YEAR) }),
|
|
197
197
|
/* @__PURE__ */ e(Te, { amount: String(m), bold: !0, formatString: "0,0", variant: "Body" })
|
|
198
198
|
] }) }) });
|
|
199
199
|
}, ro = ({
|
|
200
|
-
onHoverArea:
|
|
200
|
+
onHoverArea: o,
|
|
201
201
|
onHoverPoint: r,
|
|
202
202
|
onHoverLegend: n,
|
|
203
|
-
onClickLegend:
|
|
203
|
+
onClickLegend: t,
|
|
204
204
|
stackedDatasets: s,
|
|
205
205
|
unstackedDatasets: h = [],
|
|
206
206
|
availableHeight: g = 0,
|
|
@@ -216,7 +216,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
216
216
|
hoveredAreaData: null,
|
|
217
217
|
isAreaHovered: !1,
|
|
218
218
|
cursorPos: { x: 0, y: 0 }
|
|
219
|
-
}), { hoveredSeriesId: D, hoveredAreaData: M, isAreaHovered: L, cursorPos:
|
|
219
|
+
}), { hoveredSeriesId: D, hoveredAreaData: M, isAreaHovered: L, cursorPos: k } = x, te = L && D && M, W = !te, F = [...s, ...h], z = F[0]?.dataset.length ?? 0, X = F.flatMap((a) => a.dataset.map((T) => T.x)), fe = F.flatMap((a) => a.dataset.map((T) => T.y)), oe = s[0]?.dataset?.map(
|
|
220
220
|
(a, T) => s.reduce((E, j) => E + j.dataset[T]?.y || 0, 0)
|
|
221
221
|
) ?? [0], re = Math.max(...oe), Z = Math.max(
|
|
222
222
|
...h.flatMap((a) => a.dataset.map((T) => T.y))
|
|
@@ -260,10 +260,10 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
260
260
|
}, w = (a) => {
|
|
261
261
|
_(a), n?.(a ?? "");
|
|
262
262
|
}, O = (a) => {
|
|
263
|
-
|
|
263
|
+
t?.(a ?? "");
|
|
264
264
|
}, Y = () => {
|
|
265
265
|
const a = q(String(D)).guid;
|
|
266
|
-
a &&
|
|
266
|
+
a && t?.(a);
|
|
267
267
|
}, de = (a) => {
|
|
268
268
|
const T = String(a?.seriesId), E = q(T).guid, j = Q.find((ue) => ue.id === T), Le = j && a?.dataIndex !== void 0, Ee = j && a?.dataIndex === void 0;
|
|
269
269
|
if (Le)
|
|
@@ -271,7 +271,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
271
271
|
hoveredSeriesId: T,
|
|
272
272
|
hoveredAreaData: null,
|
|
273
273
|
isAreaHovered: !1,
|
|
274
|
-
cursorPos:
|
|
274
|
+
cursorPos: k
|
|
275
275
|
}), r?.(E);
|
|
276
276
|
else if (Ee) {
|
|
277
277
|
const ue = j?.data.map((De, Me) => ({
|
|
@@ -282,14 +282,14 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
282
282
|
hoveredSeriesId: T,
|
|
283
283
|
hoveredAreaData: ue,
|
|
284
284
|
isAreaHovered: !0,
|
|
285
|
-
cursorPos:
|
|
286
|
-
}),
|
|
285
|
+
cursorPos: k
|
|
286
|
+
}), o?.(E);
|
|
287
287
|
} else
|
|
288
288
|
v({
|
|
289
289
|
hoveredSeriesId: null,
|
|
290
290
|
hoveredAreaData: null,
|
|
291
291
|
isAreaHovered: !1,
|
|
292
|
-
cursorPos:
|
|
292
|
+
cursorPos: k
|
|
293
293
|
});
|
|
294
294
|
}, ye = (a) => {
|
|
295
295
|
if (a.target instanceof Element && a.target.classList[0]?.includes("MuiMarkElement-root"))
|
|
@@ -326,7 +326,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
326
326
|
}, {})
|
|
327
327
|
};
|
|
328
328
|
return /* @__PURE__ */ e(
|
|
329
|
-
|
|
329
|
+
R,
|
|
330
330
|
{
|
|
331
331
|
onMouseMove: ye,
|
|
332
332
|
ref: b,
|
|
@@ -407,7 +407,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
407
407
|
{
|
|
408
408
|
categoryGuids: q(D),
|
|
409
409
|
chartContainerRef: b,
|
|
410
|
-
cursorPosition:
|
|
410
|
+
cursorPosition: k,
|
|
411
411
|
hoveredAreaData: M.map((a) => ({
|
|
412
412
|
...a,
|
|
413
413
|
x: U(a.x, G.MONTH_SHORT_YEAR)
|
|
@@ -419,30 +419,45 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
419
419
|
)
|
|
420
420
|
}
|
|
421
421
|
);
|
|
422
|
-
}, rt = ({ selectedTab:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
422
|
+
}, rt = ({ selectedTab: o, onTabChange: r }) => {
|
|
423
|
+
const { common: n } = A();
|
|
424
|
+
return /* @__PURE__ */ e(
|
|
425
|
+
At,
|
|
426
|
+
{
|
|
427
|
+
"aria-label": n.view_toggle,
|
|
428
|
+
exclusive: !0,
|
|
429
|
+
onChange: r,
|
|
430
|
+
orientation: "horizontal",
|
|
431
|
+
value: o,
|
|
432
|
+
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(
|
|
433
|
+
Mt,
|
|
434
|
+
{
|
|
435
|
+
"aria-label": t === "Chart" ? n.view_chart : n.view_table,
|
|
436
|
+
"aria-pressed": o === t,
|
|
437
|
+
color: "primary",
|
|
438
|
+
sx: { width: 56 },
|
|
439
|
+
value: t,
|
|
440
|
+
children: t === "Chart" ? /* @__PURE__ */ e(_e, { name: "table_chart_view" }) : /* @__PURE__ */ e(_e, { name: "format_list_bulleted" })
|
|
441
|
+
},
|
|
442
|
+
t
|
|
443
|
+
))
|
|
444
|
+
}
|
|
445
|
+
);
|
|
446
|
+
}, at = ({ selectedDateRange: o, selectedCategoryGuid: r }) => {
|
|
447
|
+
const { trends: n } = A(), { isMobile: t, isDesktop: s } = ee(), { getCategoryName: h } = $(), g = u.useMemo(() => {
|
|
448
|
+
const d = o.start.getFullYear() === o.end.getFullYear() ? U(
|
|
449
|
+
o.start,
|
|
450
|
+
t ? G.MONTH_SHORT : G.MONTH_LONG
|
|
436
451
|
) : U(
|
|
437
|
-
|
|
438
|
-
|
|
452
|
+
o.start,
|
|
453
|
+
t ? G.MONTH_SHORT_YEAR : G.MONTH_YEAR
|
|
439
454
|
), l = U(
|
|
440
|
-
|
|
441
|
-
|
|
455
|
+
o.end,
|
|
456
|
+
t ? G.MONTH_SHORT_YEAR : G.MONTH_YEAR
|
|
442
457
|
);
|
|
443
458
|
return `${d} - ${l}`;
|
|
444
|
-
}, [
|
|
445
|
-
return /* @__PURE__ */ y(
|
|
459
|
+
}, [o, t]);
|
|
460
|
+
return /* @__PURE__ */ y(R, { sx: { mr: 10, minWidth: "60%" }, children: [
|
|
446
461
|
/* @__PURE__ */ e(
|
|
447
462
|
P,
|
|
448
463
|
{
|
|
@@ -459,45 +474,45 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
459
474
|
),
|
|
460
475
|
/* @__PURE__ */ e(P, { variant: s ? "subtitle1" : "body2", children: g })
|
|
461
476
|
] });
|
|
462
|
-
}, $e = (
|
|
463
|
-
const r =
|
|
464
|
-
return /* @__PURE__ */ e(S, { alignItems: "flex-end", direction: "row", tabIndex:
|
|
477
|
+
}, $e = (o) => {
|
|
478
|
+
const r = o.row.category_guid, n = o.row.top_level_category_guid, t = r === Be.INCOME || n === Be.INCOME, s = o.row[o.field];
|
|
479
|
+
return /* @__PURE__ */ e(S, { alignItems: "flex-end", direction: "row", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(
|
|
465
480
|
Te,
|
|
466
481
|
{
|
|
467
482
|
amount: s,
|
|
468
|
-
isIncome:
|
|
469
|
-
sx: { fontWeight:
|
|
470
|
-
symbol:
|
|
483
|
+
isIncome: t,
|
|
484
|
+
sx: { fontWeight: t ? 600 : 500 },
|
|
485
|
+
symbol: t ? "+" : void 0,
|
|
471
486
|
variant: "body2"
|
|
472
487
|
}
|
|
473
488
|
) });
|
|
474
|
-
}, ao = ({ categoryGuid:
|
|
475
|
-
const { getCategoryName: n } = $(), { categories:
|
|
489
|
+
}, ao = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
490
|
+
const { getCategoryName: n } = $(), { categories: t } = A(), s = t.default_categories[o]?.replace(/&/g, "&") ?? n(o);
|
|
476
491
|
return /* @__PURE__ */ y(S, { alignItems: "center", direction: "row", justifyContent: "center", children: [
|
|
477
|
-
/* @__PURE__ */ e(
|
|
492
|
+
/* @__PURE__ */ e(R, { "aria-hidden": !0, children: /* @__PURE__ */ e(Se, { categoryGuid: r, variant: "twotone" }) }),
|
|
478
493
|
/* @__PURE__ */ e(P, { sx: { ml: 12 }, variant: "body2", children: s })
|
|
479
494
|
] });
|
|
480
|
-
}, io = (
|
|
495
|
+
}, io = (o) => /* @__PURE__ */ e(S, { alignItems: "center", direction: "row", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(
|
|
481
496
|
ao,
|
|
482
497
|
{
|
|
483
|
-
categoryGuid:
|
|
484
|
-
topLevelCategoryGuid:
|
|
498
|
+
categoryGuid: o.row.category,
|
|
499
|
+
topLevelCategoryGuid: o.row.top_level_category_guid
|
|
485
500
|
}
|
|
486
|
-
) }), co = (
|
|
487
|
-
const n = [],
|
|
488
|
-
for (;
|
|
489
|
-
const s = U(
|
|
490
|
-
n.push(s),
|
|
501
|
+
) }), co = (o, r) => {
|
|
502
|
+
const n = [], t = new Date(o);
|
|
503
|
+
for (; t <= r; ) {
|
|
504
|
+
const s = U(t, G.MONTH_LONG);
|
|
505
|
+
n.push(s), t.setMonth(t.getMonth() + 1);
|
|
491
506
|
}
|
|
492
507
|
return n;
|
|
493
508
|
}, it = ({
|
|
494
|
-
selectedDateRange:
|
|
509
|
+
selectedDateRange: o,
|
|
495
510
|
selectedCategory: r,
|
|
496
511
|
onClickRow: n,
|
|
497
|
-
height:
|
|
512
|
+
height: t = "100%",
|
|
498
513
|
sx: s = {}
|
|
499
514
|
}) => {
|
|
500
|
-
const h = ce(), { onEvent: g } = V(), { transactions: d, spending: l } =
|
|
515
|
+
const h = ce(), { onEvent: g } = V(), { transactions: d, spending: l } = A(), { trendsCategories: m } = $(), p = u.useMemo(() => co(o.start, o.end), [o]), i = h.palette.mode === "light", b = [
|
|
501
516
|
{
|
|
502
517
|
field: "category",
|
|
503
518
|
flex: 1,
|
|
@@ -554,13 +569,13 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
554
569
|
c && (x = _.monthlyAmounts);
|
|
555
570
|
const v = x.reduce(
|
|
556
571
|
(M, L) => {
|
|
557
|
-
const
|
|
558
|
-
return M[
|
|
572
|
+
const k = U(Pe(L.isoDate), G.MONTH_LONG);
|
|
573
|
+
return M[k] = L.amount, M;
|
|
559
574
|
},
|
|
560
575
|
{}
|
|
561
576
|
), D = x.reduce((M, L) => {
|
|
562
|
-
const
|
|
563
|
-
return M + (p.includes(
|
|
577
|
+
const k = U(Pe(L.isoDate), G.MONTH_LONG);
|
|
578
|
+
return M + (p.includes(k) ? L.amount : 0);
|
|
564
579
|
}, 0);
|
|
565
580
|
return {
|
|
566
581
|
id: _.guid,
|
|
@@ -571,7 +586,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
571
586
|
};
|
|
572
587
|
});
|
|
573
588
|
}, [m]);
|
|
574
|
-
return /* @__PURE__ */ e(
|
|
589
|
+
return /* @__PURE__ */ e(R, { sx: { height: t, width: "100%", overflowX: "auto", boxShadow: "none", ...s }, children: /* @__PURE__ */ e(
|
|
575
590
|
kt,
|
|
576
591
|
{
|
|
577
592
|
columns: b,
|
|
@@ -607,12 +622,12 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
607
622
|
}, lo = {
|
|
608
623
|
title: "Transaction List"
|
|
609
624
|
}, uo = ({
|
|
610
|
-
categoryGuid:
|
|
625
|
+
categoryGuid: o,
|
|
611
626
|
dateRange: r,
|
|
612
627
|
isOpen: n,
|
|
613
|
-
onClose:
|
|
628
|
+
onClose: t
|
|
614
629
|
}) => {
|
|
615
|
-
const { onEvent: s } = V(), { selectedAccountGuids: h } = pe(), { common: g } =
|
|
630
|
+
const { onEvent: s } = V(), { selectedAccountGuids: h } = pe(), { common: g } = A(), { setFilter: d, sortedTransactions: l } = xe(), [m, p] = u.useState(""), i = u.useMemo(
|
|
616
631
|
() => l.find((c) => c.guid === m),
|
|
617
632
|
[m, l]
|
|
618
633
|
);
|
|
@@ -620,12 +635,12 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
620
635
|
d({
|
|
621
636
|
accounts: h,
|
|
622
637
|
dateRange: r,
|
|
623
|
-
custom: (c) =>
|
|
624
|
-
showSplits: !!
|
|
638
|
+
custom: (c) => o === "" || o === c.category_guid || o === c.top_level_category_guid,
|
|
639
|
+
showSplits: !!o
|
|
625
640
|
});
|
|
626
|
-
}, [h,
|
|
641
|
+
}, [h, o, r]), u.useEffect(() => s(I.TRENDS_VIEW_TRANSACTIONS), []);
|
|
627
642
|
const b = () => {
|
|
628
|
-
p(""),
|
|
643
|
+
p(""), t();
|
|
629
644
|
};
|
|
630
645
|
return /* @__PURE__ */ y(
|
|
631
646
|
Ne,
|
|
@@ -640,8 +655,8 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
640
655
|
]
|
|
641
656
|
}
|
|
642
657
|
);
|
|
643
|
-
}, ho =
|
|
644
|
-
const { onEvent: n } = V(), { isDesktop:
|
|
658
|
+
}, ho = H(uo), go = ({ onBackClick: o, sx: r }) => {
|
|
659
|
+
const { onEvent: n } = V(), { isDesktop: t, isTablet: s, isMobile: h } = ee(), { visibleAccounts: g } = ve(), { loadMonthlyCategoryTotals: d, monthlyCategoryTotals: l, getCategoryName: m } = $(), { sortedTransactions: p } = xe(), { selectedDateRange: i, setSelectedDateRange: b } = Ce(), { isCopyLoaded: c, isInitialized: f, selectedAccounts: C, setSelectedAccounts: _ } = pe(), { trends: x } = A(), [v, D] = u.useState(!1), [M, L] = u.useState(!1), [k, te] = u.useState("Chart"), [W, F] = u.useState(""), [z, X] = u.useState(window.innerHeight), oe = z - (h ? 315 : 345);
|
|
645
660
|
we({
|
|
646
661
|
widgetName: "TrendsFullWidget",
|
|
647
662
|
isLoaded: v
|
|
@@ -673,7 +688,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
673
688
|
unstackedDatasets: O.filter(Et)
|
|
674
689
|
};
|
|
675
690
|
}, [l, W, i]), Z = (w, O) => {
|
|
676
|
-
te(O ??
|
|
691
|
+
te(O ?? k), n(I.TRENDS_CLICK_TOGGLE_VIEW);
|
|
677
692
|
}, le = (w) => {
|
|
678
693
|
const O = je(w?.[0], 1), Y = w?.[1], de = Re(Y, O);
|
|
679
694
|
b({ start: O, end: Y }), n(I.TRENDS_CLICK_TIME_WINDOW, {
|
|
@@ -700,7 +715,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
700
715
|
dateRange: i,
|
|
701
716
|
dateRangeVariant: "timeframebuttons",
|
|
702
717
|
onAccountsFilterClick: ne,
|
|
703
|
-
onBackClick:
|
|
718
|
+
onBackClick: o,
|
|
704
719
|
sx: r,
|
|
705
720
|
title: x.title,
|
|
706
721
|
children: [
|
|
@@ -709,7 +724,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
709
724
|
{
|
|
710
725
|
sx: {
|
|
711
726
|
// eslint-disable-next-line no-nested-ternary
|
|
712
|
-
px:
|
|
727
|
+
px: t ? 48 : s ? 24 : 12
|
|
713
728
|
},
|
|
714
729
|
children: [
|
|
715
730
|
/* @__PURE__ */ y(
|
|
@@ -726,19 +741,19 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
726
741
|
selectedDateRange: i
|
|
727
742
|
}
|
|
728
743
|
),
|
|
729
|
-
/* @__PURE__ */ e(rt, { onTabChange: Z, selectedTab:
|
|
744
|
+
/* @__PURE__ */ e(rt, { onTabChange: Z, selectedTab: k })
|
|
730
745
|
]
|
|
731
746
|
}
|
|
732
747
|
),
|
|
733
748
|
/* @__PURE__ */ y(S, { alignItems: "center", flexDirection: "row", width: "100%", children: [
|
|
734
|
-
/* @__PURE__ */ e(
|
|
749
|
+
/* @__PURE__ */ e(R, { flexGrow: 1, children: W && /* @__PURE__ */ y(be, { onClick: () => F(""), sx: { p: 0, pr: 5 }, children: [
|
|
735
750
|
/* @__PURE__ */ e(_e, { name: "arrow_back" }),
|
|
736
751
|
x.all_categories
|
|
737
752
|
] }) }),
|
|
738
753
|
/* @__PURE__ */ e(be, { onClick: () => L(!0), sx: { px: 5 }, children: `${x.view_transactions} (${p.length})` })
|
|
739
754
|
] }),
|
|
740
|
-
/* @__PURE__ */ y(
|
|
741
|
-
|
|
755
|
+
/* @__PURE__ */ y(R, { children: [
|
|
756
|
+
k === "Chart" && /* @__PURE__ */ e(
|
|
742
757
|
ro,
|
|
743
758
|
{
|
|
744
759
|
availableHeight: oe,
|
|
@@ -750,7 +765,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
750
765
|
unstackedDatasets: re.unstackedDatasets
|
|
751
766
|
}
|
|
752
767
|
),
|
|
753
|
-
|
|
768
|
+
k === "Table" && /* @__PURE__ */ e(
|
|
754
769
|
it,
|
|
755
770
|
{
|
|
756
771
|
onClickRow: K,
|
|
@@ -774,15 +789,15 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
774
789
|
]
|
|
775
790
|
}
|
|
776
791
|
);
|
|
777
|
-
}, Nn =
|
|
778
|
-
const { monthlyCategoryTotals:
|
|
792
|
+
}, Nn = H(go), mo = () => {
|
|
793
|
+
const { monthlyCategoryTotals: o } = $(), { trends: r } = A(), n = ce(), { availableHeight: t = 300 } = Ze(), s = Dt(o);
|
|
779
794
|
return /* @__PURE__ */ e(
|
|
780
795
|
Oe,
|
|
781
796
|
{
|
|
782
797
|
baseline: "min",
|
|
783
798
|
colors: [n.palette.primary.main],
|
|
784
799
|
datasets: [s],
|
|
785
|
-
height:
|
|
800
|
+
height: t,
|
|
786
801
|
labels: [r.spending_label],
|
|
787
802
|
showArea: !0,
|
|
788
803
|
showAverage: !0,
|
|
@@ -792,20 +807,20 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
792
807
|
valueFormatterString: "0,0"
|
|
793
808
|
}
|
|
794
809
|
);
|
|
795
|
-
}, po =
|
|
796
|
-
const { visibleAccounts: n } = ve(), { loadMonthlyCategoryTotals:
|
|
810
|
+
}, po = H(mo), Co = ({ onPrimaryCtaClick: o, sx: r }) => {
|
|
811
|
+
const { visibleAccounts: n } = ve(), { loadMonthlyCategoryTotals: t, monthlyTotalsLoaded: s } = $(), { isInitialized: h } = We(), { trends: g } = A(), { isCopyLoaded: d, selectedAccounts: l, setSelectedAccounts: m } = pe();
|
|
797
812
|
return we({
|
|
798
813
|
widgetName: "TrendsMiniWidget",
|
|
799
814
|
isLoaded: s
|
|
800
815
|
}), u.useEffect(() => {
|
|
801
816
|
m(n);
|
|
802
817
|
}, [n]), u.useEffect(() => {
|
|
803
|
-
h &&
|
|
818
|
+
h && t(l).finally();
|
|
804
819
|
}, [h, l]), !d || !h ? /* @__PURE__ */ e(me, {}) : /* @__PURE__ */ e(
|
|
805
820
|
Ht,
|
|
806
821
|
{
|
|
807
822
|
contentStyles: { height: "calc(100% - 72px)", ":last-child": { pb: 0 } },
|
|
808
|
-
onPrimaryCtaClick:
|
|
823
|
+
onPrimaryCtaClick: o,
|
|
809
824
|
primaryCtaLabel: g.primary_cta,
|
|
810
825
|
subTitle: g.sub_title,
|
|
811
826
|
sx: { height: "100%", ...r },
|
|
@@ -813,18 +828,18 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
813
828
|
children: s ? /* @__PURE__ */ e(po, {}) : /* @__PURE__ */ e(me, {})
|
|
814
829
|
}
|
|
815
830
|
);
|
|
816
|
-
}, Wn =
|
|
817
|
-
title:
|
|
831
|
+
}, Wn = H(Co), fo = 70, ze = ({
|
|
832
|
+
title: o,
|
|
818
833
|
totalAmount: r,
|
|
819
834
|
transactionType: n,
|
|
820
|
-
percentage:
|
|
835
|
+
percentage: t,
|
|
821
836
|
secondaryLabel: s,
|
|
822
837
|
shouldDisplayPercentage: h
|
|
823
838
|
}) => {
|
|
824
|
-
const { availableWidth: g } = Ze(), d = u.useRef(null), l = u.useRef(null), m = xt(Number(Math.abs(
|
|
839
|
+
const { availableWidth: g } = Ze(), d = u.useRef(null), l = u.useRef(null), m = xt(Number(Math.abs(t)), {
|
|
825
840
|
style: "percent",
|
|
826
841
|
minimumIntegerDigits: 1
|
|
827
|
-
}), p = g === 288 && se(r, "0,0.00").length > 10 ? se(r, "0,0") : se(r, "0,0.00"), i = n === "spending" ?
|
|
842
|
+
}), p = g === 288 && se(r, "0,0.00").length > 10 ? se(r, "0,0") : se(r, "0,0.00"), i = n === "spending" ? t > 0 : t >= 0, b = n === "spending" ? "error.main" : "success.main", c = n === "spending" ? "success.main" : "text.secondary", f = d?.current, C = l?.current, _ = f && C ? f.scrollWidth > C.clientWidth - fo : !1;
|
|
828
843
|
return /* @__PURE__ */ y(
|
|
829
844
|
S,
|
|
830
845
|
{
|
|
@@ -847,7 +862,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
847
862
|
justifyContent: "space-between"
|
|
848
863
|
},
|
|
849
864
|
children: [
|
|
850
|
-
/* @__PURE__ */ e(ge, { color: "text.secondary", variant: "caption", children:
|
|
865
|
+
/* @__PURE__ */ e(ge, { color: "text.secondary", variant: "caption", children: o }),
|
|
851
866
|
h && /* @__PURE__ */ y(S, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
852
867
|
i ? /* @__PURE__ */ e(Wt, { size: 20, sx: { color: b } }) : /* @__PURE__ */ e(Ot, { size: 20, sx: { color: c } }),
|
|
853
868
|
/* @__PURE__ */ e(
|
|
@@ -876,7 +891,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
876
891
|
},
|
|
877
892
|
children: [
|
|
878
893
|
/* @__PURE__ */ e(
|
|
879
|
-
|
|
894
|
+
R,
|
|
880
895
|
{
|
|
881
896
|
ref: d,
|
|
882
897
|
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
@@ -897,20 +912,20 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
897
912
|
]
|
|
898
913
|
}
|
|
899
914
|
);
|
|
900
|
-
}, yo =
|
|
901
|
-
const { trends:
|
|
915
|
+
}, yo = H(() => {
|
|
916
|
+
const { trends: o } = A();
|
|
902
917
|
return /* @__PURE__ */ y(S, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
|
|
903
918
|
/* @__PURE__ */ e(Gt, { size: 32 }),
|
|
904
919
|
/* @__PURE__ */ y(S, { children: [
|
|
905
|
-
/* @__PURE__ */ e(ge, { fontWeight: 600, variant: "body1", children:
|
|
906
|
-
/* @__PURE__ */ e(ge, { color: "text.secondary", variant: "subtitle2", children:
|
|
920
|
+
/* @__PURE__ */ e(ge, { fontWeight: 600, variant: "body1", children: o.zero_state_content_header }),
|
|
921
|
+
/* @__PURE__ */ e(ge, { color: "text.secondary", variant: "subtitle2", children: o.zero_state_content_description })
|
|
907
922
|
] })
|
|
908
923
|
] });
|
|
909
|
-
}), On =
|
|
910
|
-
const { visibleAccounts: r } = ve(), { onEvent: n } = V(), { monthlyCategoryTotals:
|
|
924
|
+
}), On = H(({ onCtaClick: o }) => {
|
|
925
|
+
const { visibleAccounts: r } = ve(), { onEvent: n } = V(), { monthlyCategoryTotals: t, loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: h } = $(), g = {
|
|
911
926
|
start: Nt(/* @__PURE__ */ new Date(), 1),
|
|
912
927
|
end: /* @__PURE__ */ new Date()
|
|
913
|
-
}, { trends: d } =
|
|
928
|
+
}, { trends: d } = A(), { selectedAccounts: l, setSelectedAccounts: m, isInitialized: p } = pe();
|
|
914
929
|
we({
|
|
915
930
|
widgetName: "TrendsMicroWidget",
|
|
916
931
|
isLoaded: h
|
|
@@ -925,14 +940,14 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
925
940
|
}, [p, l]);
|
|
926
941
|
const { spendingData: i, incomeData: b } = u.useMemo(
|
|
927
942
|
() => ({
|
|
928
|
-
spendingData: qe(
|
|
929
|
-
incomeData: Je(
|
|
943
|
+
spendingData: qe(t, g),
|
|
944
|
+
incomeData: Je(t, g)
|
|
930
945
|
}),
|
|
931
|
-
[
|
|
946
|
+
[t, g]
|
|
932
947
|
), [c, f] = i, [C, _] = b, x = Fe(f.y, c.y), v = Fe(_.y, C.y), D = p && !r?.length, M = () => {
|
|
933
948
|
n(
|
|
934
949
|
D ? I.TRENDS_CLICK_GET_STARTED : I.TRENDS_CLICK_VIEW_MORE
|
|
935
|
-
),
|
|
950
|
+
), o();
|
|
936
951
|
};
|
|
937
952
|
return !h || !p ? /* @__PURE__ */ e(me, {}) : /* @__PURE__ */ e(
|
|
938
953
|
Ft,
|
|
@@ -978,21 +993,21 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
978
993
|
)
|
|
979
994
|
}
|
|
980
995
|
);
|
|
981
|
-
}), _o =
|
|
982
|
-
({ isExpanded:
|
|
996
|
+
}), _o = H(
|
|
997
|
+
({ isExpanded: o, onClick: r }) => {
|
|
983
998
|
const n = nt();
|
|
984
999
|
return /* @__PURE__ */ e(zt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Kt, { onClick: r, sx: { justifyContent: "center" }, children: /* @__PURE__ */ y(
|
|
985
1000
|
S,
|
|
986
1001
|
{
|
|
987
1002
|
sx: { color: n.palette.primary.main, flexDirection: "row", alignItems: "center" },
|
|
988
1003
|
children: [
|
|
989
|
-
/* @__PURE__ */ e(jt, { children: /* @__PURE__ */ e(P, { bold: !0, variant: "body2", children:
|
|
990
|
-
/* @__PURE__ */ e(Yt, { sx: { color: n.palette.primary.main }, children:
|
|
1004
|
+
/* @__PURE__ */ e(jt, { children: /* @__PURE__ */ e(P, { bold: !0, variant: "body2", children: o ? "View less" : "View more" }) }),
|
|
1005
|
+
/* @__PURE__ */ e(Yt, { sx: { color: n.palette.primary.main }, children: o ? /* @__PURE__ */ e(Bt, {}) : /* @__PURE__ */ e(
|
|
991
1006
|
Vt,
|
|
992
1007
|
{
|
|
993
1008
|
sx: {
|
|
994
1009
|
transition: "transform 0.3s ease-in-out",
|
|
995
|
-
transform:
|
|
1010
|
+
transform: o ? "rotate(180deg)" : "rotate(0deg)"
|
|
996
1011
|
}
|
|
997
1012
|
}
|
|
998
1013
|
) })
|
|
@@ -1000,17 +1015,17 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1000
1015
|
}
|
|
1001
1016
|
) }) });
|
|
1002
1017
|
}
|
|
1003
|
-
), Ke =
|
|
1018
|
+
), Ke = H(
|
|
1004
1019
|
({
|
|
1005
|
-
totalAmount:
|
|
1020
|
+
totalAmount: o,
|
|
1006
1021
|
guid: r,
|
|
1007
1022
|
name: n,
|
|
1008
|
-
transactions:
|
|
1023
|
+
transactions: t,
|
|
1009
1024
|
onClick: s,
|
|
1010
1025
|
isLastItem: h = !1,
|
|
1011
1026
|
showDivider: g = !0
|
|
1012
1027
|
}) => {
|
|
1013
|
-
const { trends: d } =
|
|
1028
|
+
const { trends: d } = A(), { onEvent: l } = V(), m = `${t.length} ${t.length === 1 ? d.transaction : d.transactions}`, p = () => {
|
|
1014
1029
|
s?.(), l(I.TRENDS_CLICK_LIST_ITEM, {
|
|
1015
1030
|
...B,
|
|
1016
1031
|
listItem: n
|
|
@@ -1022,7 +1037,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1022
1037
|
{
|
|
1023
1038
|
leftIcon: r ? /* @__PURE__ */ e(Se, { categoryGuid: r }) : void 0,
|
|
1024
1039
|
onClick: p,
|
|
1025
|
-
rightContent: se(Math.abs(
|
|
1040
|
+
rightContent: se(Math.abs(o), "0,0.00"),
|
|
1026
1041
|
rightIcon: s ? /* @__PURE__ */ e(mt, {}) : void 0,
|
|
1027
1042
|
subtitle: m,
|
|
1028
1043
|
title: n
|
|
@@ -1031,21 +1046,21 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1031
1046
|
g && /* @__PURE__ */ e(He, { sx: { ml: h ? 24 : 68 } })
|
|
1032
1047
|
] }, r);
|
|
1033
1048
|
}
|
|
1034
|
-
), bo =
|
|
1035
|
-
({ availableHeight:
|
|
1036
|
-
const { collapsedCategories: n, visibleCategories:
|
|
1049
|
+
), bo = H(
|
|
1050
|
+
({ availableHeight: o = 0, onCategoryClick: r }) => {
|
|
1051
|
+
const { collapsedCategories: n, visibleCategories: t, setVisibleListLength: s } = Ce(), { isLargeDesktop: h, isDesktop: g } = ee(), { trends: d } = A(), { onEvent: l } = V(), [m, p] = u.useState(!1), i = g || h;
|
|
1037
1052
|
u.useEffect(() => {
|
|
1038
|
-
const f = Math.floor(
|
|
1039
|
-
f !==
|
|
1040
|
-
}, [
|
|
1053
|
+
const f = Math.floor(o / 64) - 1, C = t.length + n.length;
|
|
1054
|
+
f !== t.length && (s(i ? Math.max(f, 5) : 5), p(f >= C));
|
|
1055
|
+
}, [o]);
|
|
1041
1056
|
const b = () => {
|
|
1042
1057
|
p(!m), l(I.TRENDS_CLICK_VIEW_MORE, {
|
|
1043
1058
|
...B
|
|
1044
1059
|
});
|
|
1045
|
-
}, c =
|
|
1060
|
+
}, c = t.length + (m ? n.length : 0);
|
|
1046
1061
|
return /* @__PURE__ */ e(S, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ y($t, { children: [
|
|
1047
1062
|
/* @__PURE__ */ e(S, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Ye, { children: d.categories }) }),
|
|
1048
|
-
|
|
1063
|
+
t.map((f, C) => /* @__PURE__ */ e(
|
|
1049
1064
|
Ke,
|
|
1050
1065
|
{
|
|
1051
1066
|
...f,
|
|
@@ -1061,7 +1076,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1061
1076
|
in: m,
|
|
1062
1077
|
sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
|
|
1063
1078
|
children: n.map((f, C) => {
|
|
1064
|
-
const _ =
|
|
1079
|
+
const _ = t.length + C;
|
|
1065
1080
|
return /* @__PURE__ */ e(
|
|
1066
1081
|
Ke,
|
|
1067
1082
|
{
|
|
@@ -1078,15 +1093,15 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1078
1093
|
n.length > 0 && /* @__PURE__ */ e(_o, { isExpanded: m, onClick: b })
|
|
1079
1094
|
] }) });
|
|
1080
1095
|
}
|
|
1081
|
-
), To = ({ beats:
|
|
1082
|
-
const { onEvent: n } = V(), { isMobile:
|
|
1096
|
+
), To = ({ beats: o, onInsightCardClick: r }) => {
|
|
1097
|
+
const { onEvent: n } = V(), { isMobile: t, isDesktop: s, isLargeDesktop: h } = ee(), { beatStore: g, endpoint: d, sessionToken: l } = We(), m = s || h, p = m || t ? 1 : 2, i = () => null, b = (v) => {
|
|
1083
1098
|
r?.(v), n(I.TRENDS_CLICK_INSIGHT, B);
|
|
1084
|
-
}, c = m ? 200 : 170, f = m ? 170 : 124, C = m ? 56 : 0, _ =
|
|
1099
|
+
}, c = m ? 200 : 170, f = m ? 170 : 124, C = m ? 56 : 0, _ = o.length > 0 ? c + C : f, x = m && o.length > 0 ? c : void 0;
|
|
1085
1100
|
return /* @__PURE__ */ e(Ut, { sx: { height: _ }, children: /* @__PURE__ */ e(
|
|
1086
1101
|
Rt,
|
|
1087
1102
|
{
|
|
1088
1103
|
areBeatsLoading: g.isLoading,
|
|
1089
|
-
beats:
|
|
1104
|
+
beats: o,
|
|
1090
1105
|
endpoint: d,
|
|
1091
1106
|
heightOverrides: x,
|
|
1092
1107
|
logOutUser: i,
|
|
@@ -1103,9 +1118,9 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1103
1118
|
visibleCardsCount: p
|
|
1104
1119
|
}
|
|
1105
1120
|
) });
|
|
1106
|
-
}, So =
|
|
1121
|
+
}, So = H(To), xo = H(({ chartLabel: o, chartColor: r }) => {
|
|
1107
1122
|
const { onEvent: n } = V(), {
|
|
1108
|
-
categoryDetailsChartData: { monthlyAmounts:
|
|
1123
|
+
categoryDetailsChartData: { monthlyAmounts: t, tooltipLabels: s }
|
|
1109
1124
|
} = Ce();
|
|
1110
1125
|
return /* @__PURE__ */ e(S, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
|
|
1111
1126
|
Oe,
|
|
@@ -1114,9 +1129,9 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1114
1129
|
colors: [r],
|
|
1115
1130
|
curveType: "bump",
|
|
1116
1131
|
customTooltipLabels: s,
|
|
1117
|
-
datasets: [
|
|
1132
|
+
datasets: [t],
|
|
1118
1133
|
height: 265,
|
|
1119
|
-
labels: [
|
|
1134
|
+
labels: [o],
|
|
1120
1135
|
markStyles: () => ({
|
|
1121
1136
|
stroke: r
|
|
1122
1137
|
}),
|
|
@@ -1136,15 +1151,15 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1136
1151
|
valueFormatterString: "0,0"
|
|
1137
1152
|
}
|
|
1138
1153
|
) });
|
|
1139
|
-
}), vo =
|
|
1140
|
-
const r = nt(), { onEvent: n } = V(), { common:
|
|
1154
|
+
}), vo = H(({ onClose: o }) => {
|
|
1155
|
+
const r = nt(), { onEvent: n } = V(), { common: t, trends: s } = A(), { selectedCategoryData: h, selectedDateRangeMonthRange: g } = Ce(), { sortedTransactions: d } = xe(), [l, m] = u.useState(null);
|
|
1141
1156
|
if (!h)
|
|
1142
1157
|
return null;
|
|
1143
1158
|
const { guid: p, name: i, is_income: b, totalAmount: c } = h, f = b ? s.category_income : s.category_spending, C = Zt(p, r), _ = b ? s.income_label : s.spending_label, x = ` ${h.transactions.length === 1 ? s.transaction : s.transactions} (${h.transactions.length})`, v = u.useMemo(
|
|
1144
1159
|
() => d.find((L) => L.guid === l),
|
|
1145
1160
|
[l, d]
|
|
1146
1161
|
), D = (L) => L.category_guid === p || L.top_level_category_guid === p, M = () => {
|
|
1147
|
-
|
|
1162
|
+
o?.(), n(I.TRENDS_CLICK_BACK, B);
|
|
1148
1163
|
};
|
|
1149
1164
|
return /* @__PURE__ */ y(
|
|
1150
1165
|
Ne,
|
|
@@ -1185,7 +1200,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1185
1200
|
/* @__PURE__ */ e(
|
|
1186
1201
|
Ne,
|
|
1187
1202
|
{
|
|
1188
|
-
ariaLabelClose:
|
|
1203
|
+
ariaLabelClose: t.close_aria,
|
|
1189
1204
|
isOpen: !!v,
|
|
1190
1205
|
onClose: () => m(""),
|
|
1191
1206
|
title: s.transaction,
|
|
@@ -1195,11 +1210,11 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1195
1210
|
]
|
|
1196
1211
|
}
|
|
1197
1212
|
);
|
|
1198
|
-
}), wo = (
|
|
1199
|
-
const n = Je(
|
|
1200
|
-
return [n,
|
|
1201
|
-
}, Io = (
|
|
1202
|
-
const [n,
|
|
1213
|
+
}), wo = (o, r) => {
|
|
1214
|
+
const n = Je(o, r), t = qe(o, r);
|
|
1215
|
+
return [n, t].filter((s) => s.length > 0);
|
|
1216
|
+
}, Io = (o, r) => {
|
|
1217
|
+
const [n, t] = o, s = n, h = t ?? n, g = [];
|
|
1203
1218
|
if (s) {
|
|
1204
1219
|
const d = s.reduce((l, m) => l + m.y, 0);
|
|
1205
1220
|
g.push({ label: r.income_label, amount: d });
|
|
@@ -1210,16 +1225,16 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1210
1225
|
}
|
|
1211
1226
|
return g;
|
|
1212
1227
|
}, Lo = ({
|
|
1213
|
-
availableHeight:
|
|
1228
|
+
availableHeight: o = 0,
|
|
1214
1229
|
minHeight: r = 500,
|
|
1215
1230
|
selectedDateRange: n,
|
|
1216
|
-
totals:
|
|
1231
|
+
totals: t
|
|
1217
1232
|
}) => {
|
|
1218
|
-
const s = ce(), { onEvent: h } = V(), { trends: g } =
|
|
1233
|
+
const s = ce(), { onEvent: h } = V(), { trends: g } = A(), { isSmallMobile: d, isMobile: l, isSmallTablet: m, isTablet: p } = ee(), i = [s.palette.chart?.chart1, s.palette.chart?.chart2], b = wo(t, n), c = Io(b, g), [f, C] = u.useState(0), _ = 458, x = 195, v = 56, D = l || d ? x : m || p ? _ : f;
|
|
1219
1234
|
return u.useEffect(() => {
|
|
1220
|
-
const L = Math.max(
|
|
1235
|
+
const L = Math.max(o - v, r);
|
|
1221
1236
|
C(L);
|
|
1222
|
-
}, [
|
|
1237
|
+
}, [o]), /* @__PURE__ */ e(
|
|
1223
1238
|
Oe,
|
|
1224
1239
|
{
|
|
1225
1240
|
baseline: "min",
|
|
@@ -1242,7 +1257,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1242
1257
|
valueFormatterString: "0.0a"
|
|
1243
1258
|
}
|
|
1244
1259
|
);
|
|
1245
|
-
}, Eo =
|
|
1260
|
+
}, Eo = H(Lo), Do = [
|
|
1246
1261
|
"BillAmountNotStandard",
|
|
1247
1262
|
"CategorySpendingV2",
|
|
1248
1263
|
"CostOfLivingToIncome",
|
|
@@ -1276,14 +1291,14 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1276
1291
|
"WeeklyNewMerchantsV2",
|
|
1277
1292
|
"WeeklyNoSpendDays",
|
|
1278
1293
|
"WeeklySmallPurchasesSummary"
|
|
1279
|
-
], Mo = ({ onBackClick:
|
|
1280
|
-
const { onEvent:
|
|
1294
|
+
], Mo = ({ onBackClick: o, onInsightCardClick: r, sx: n }) => {
|
|
1295
|
+
const { onEvent: t } = V(), { config: s } = bt(), { isLargeDesktop: h, isDesktop: g, isMobile: d } = ee(), { visibleAccounts: l } = ve(), { loadDateRangeCategoryTotals: m, loadMonthlyCategoryTotals: p, monthlyCategoryTotals: i } = $(), { setFilter: b } = xe(), { selectedDateRange: c, setSelectedCategoryData: f, setSelectedDateRange: C } = Ce(), {
|
|
1281
1296
|
isCopyLoaded: _,
|
|
1282
1297
|
isInitialized: x,
|
|
1283
1298
|
selectedAccounts: v,
|
|
1284
1299
|
selectedAccountGuids: D,
|
|
1285
1300
|
setSelectedAccounts: M
|
|
1286
|
-
} = pe(), { trends: L, connect:
|
|
1301
|
+
} = pe(), { trends: L, connect: k } = A(), { beatStore: te } = We(), F = qt() && s.show_insights_widget_in_master, z = g || h, [X, fe] = u.useState(!1), [oe, re] = u.useState(!1), [Z, le] = u.useState("Chart"), [ne, K] = u.useState(""), [ae, Q] = u.useState(!1), [ie, q] = u.useState(window.innerHeight), w = z ? 56 : 0, O = ie - 208, Y = ie - (F ? 550 + w : 266), [de, ye] = u.useState(!1), Ie = s.show_connections_widget_in_master ? "buttons" : "no-buttons", a = u.useMemo(
|
|
1287
1302
|
() => l && l.length === 0 || i.length === 0,
|
|
1288
1303
|
[l, i]
|
|
1289
1304
|
);
|
|
@@ -1308,7 +1323,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1308
1323
|
),
|
|
1309
1324
|
p(v, c.start, c.end)
|
|
1310
1325
|
]).finally(() => {
|
|
1311
|
-
fe(!0),
|
|
1326
|
+
fe(!0), t(I.TRENDS_LOAD_WIDGET, {
|
|
1312
1327
|
...B,
|
|
1313
1328
|
time_period: `${Re(c.end, c.start)}M`
|
|
1314
1329
|
});
|
|
@@ -1332,27 +1347,27 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1332
1347
|
}, j = () => {
|
|
1333
1348
|
f(null), Q(!1);
|
|
1334
1349
|
}, Le = () => {
|
|
1335
|
-
ye(!0),
|
|
1350
|
+
ye(!0), t(I.TRENDS_CLICK_CONNECT_ACCOUNTS);
|
|
1336
1351
|
}, Ee = (N, J) => {
|
|
1337
|
-
le(J ?? Z),
|
|
1352
|
+
le(J ?? Z), t(I.TRENDS_CLICK_TOGGLE_VIEW, {
|
|
1338
1353
|
...B,
|
|
1339
1354
|
toggleView: J
|
|
1340
1355
|
});
|
|
1341
1356
|
}, ue = (N) => {
|
|
1342
1357
|
const J = je(N?.[0], 1), he = N?.[1], lt = Re(he, J);
|
|
1343
|
-
C({ start: J, end: he }),
|
|
1358
|
+
C({ start: J, end: he }), t(I.TRENDS_CLICK_TIME_WINDOW, {
|
|
1344
1359
|
...B,
|
|
1345
1360
|
time_period: lt + "M"
|
|
1346
1361
|
});
|
|
1347
1362
|
}, De = (N) => {
|
|
1348
|
-
|
|
1363
|
+
t(I.TRENDS_CLICK_FILTER, {
|
|
1349
1364
|
...B,
|
|
1350
1365
|
filterValue: N
|
|
1351
1366
|
});
|
|
1352
1367
|
}, Me = (N) => {
|
|
1353
1368
|
K(N);
|
|
1354
1369
|
}, ct = () => {
|
|
1355
|
-
K(""),
|
|
1370
|
+
K(""), t(I.TRENDS_CLICK_ALL_CATEGORIES, B);
|
|
1356
1371
|
};
|
|
1357
1372
|
return !_ || !X ? /* @__PURE__ */ e(me, {}) : /* @__PURE__ */ y(
|
|
1358
1373
|
et,
|
|
@@ -1362,7 +1377,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1362
1377
|
dateRange: c,
|
|
1363
1378
|
dateRangeVariant: d ? "timeframetabs" : "timeframebuttons",
|
|
1364
1379
|
onAccountsFilterClick: De,
|
|
1365
|
-
onBackClick:
|
|
1380
|
+
onBackClick: o,
|
|
1366
1381
|
sx: n,
|
|
1367
1382
|
title: L.title,
|
|
1368
1383
|
children: [
|
|
@@ -1403,13 +1418,13 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1403
1418
|
]
|
|
1404
1419
|
}
|
|
1405
1420
|
),
|
|
1406
|
-
/* @__PURE__ */ e(S, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(
|
|
1421
|
+
/* @__PURE__ */ e(S, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(R, { flexGrow: 1, children: ne && /* @__PURE__ */ y(be, { onClick: ct, sx: { p: 0, pr: 5 }, children: [
|
|
1407
1422
|
/* @__PURE__ */ e(_e, { name: "arrow_back" }),
|
|
1408
1423
|
L.all_categories
|
|
1409
1424
|
] }) }) }),
|
|
1410
1425
|
/* @__PURE__ */ y(S, { flexDirection: z ? "row" : "column", gap: z ? 48 : 16, children: [
|
|
1411
1426
|
Z === "Chart" && /* @__PURE__ */ y(dt, { children: [
|
|
1412
|
-
/* @__PURE__ */ e(
|
|
1427
|
+
/* @__PURE__ */ e(R, { sx: { width: z ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
1413
1428
|
Eo,
|
|
1414
1429
|
{
|
|
1415
1430
|
availableHeight: O,
|
|
@@ -1435,7 +1450,7 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1435
1450
|
)
|
|
1436
1451
|
] })
|
|
1437
1452
|
] }),
|
|
1438
|
-
Z === "Table" && /* @__PURE__ */ e(
|
|
1453
|
+
Z === "Table" && /* @__PURE__ */ e(R, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1439
1454
|
it,
|
|
1440
1455
|
{
|
|
1441
1456
|
height: "unset",
|
|
@@ -1454,13 +1469,13 @@ const st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
|
|
|
1454
1469
|
{
|
|
1455
1470
|
onClose: () => ye(!1),
|
|
1456
1471
|
showConnectWidget: de,
|
|
1457
|
-
title:
|
|
1472
|
+
title: k.mini_title
|
|
1458
1473
|
}
|
|
1459
1474
|
)
|
|
1460
1475
|
]
|
|
1461
1476
|
}
|
|
1462
1477
|
);
|
|
1463
|
-
}, Gn =
|
|
1478
|
+
}, Gn = H(Mo);
|
|
1464
1479
|
export {
|
|
1465
1480
|
Nn as TrendsFullWidget,
|
|
1466
1481
|
On as TrendsMicroWidget,
|