@mx-cartographer/experiences 7.4.8-alpha.mm1 → 7.4.9
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 +8 -0
- package/dist/{Account-BrOTlmeK.mjs → Account-01wOyrH1.mjs} +1 -1
- package/dist/{AccountDetailsContent-B7FqH05C.mjs → AccountDetailsContent-COMjOzwr.mjs} +8 -8
- package/dist/{AccountDetailsHeader-C8MxsxhN.mjs → AccountDetailsHeader-Cbi5G6fJ.mjs} +4 -4
- package/dist/{AccountFields-BQZ-o6Kj.mjs → AccountFields-Cd_nOWmf.mjs} +2 -2
- package/dist/{AccountListItem-aIE9WWTO.mjs → AccountListItem-DxY4cCF1.mjs} +4 -4
- package/dist/{AccountStore-DqO84Aer.mjs → AccountStore-C1zMBzHq.mjs} +2 -2
- package/dist/{Accounts-DC_A4UCa.mjs → Accounts-D7QljYas.mjs} +1 -1
- package/dist/{BudgetUtil-BmZXkL0C.mjs → BudgetUtil-Df2nII9u.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-SUgfE5GN.mjs → CategorySelectorDrawer-DqJK_rrL.mjs} +1 -1
- package/dist/{ConnectDrawer-KL8t1qSC.mjs → ConnectDrawer-CuUj16NH.mjs} +1 -1
- package/dist/{ConnectionsDrawer-DaK5uIL5.mjs → ConnectionsDrawer-Bz4uwdFE.mjs} +2 -2
- package/dist/{CurrencyInput-itK0R3wV.mjs → CurrencyInput-BFKcs-_K.mjs} +1 -1
- package/dist/{DebtsStore-DVPZbv2C.mjs → DebtsStore-Bu8rRRSL.mjs} +1 -1
- package/dist/{ExportCsvAction-Cglo8Mca.mjs → ExportCsvAction-DzTrtPzk.mjs} +3 -3
- package/dist/{GoalStore-o4rrjGSJ.mjs → GoalStore-CrNhjvNc.mjs} +2 -2
- package/dist/{Help-BjLMsuMS.mjs → Help-BnPXM_N2.mjs} +1 -1
- package/dist/{LineChart-BQRxZF3p.mjs → LineChart-bc1D9xBE.mjs} +1 -1
- package/dist/{ListItemAction-BxTkF6Tz.mjs → ListItemAction-uobBrm_a.mjs} +1 -1
- package/dist/{ManageIncome-rcnDYsBJ.mjs → ManageIncome-A69EUO5u.mjs} +75 -75
- package/dist/{MicroWidgetContainer-B2hO9rOG.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
- package/dist/{MiniWidgetContainer-98-hKFqm.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
- package/dist/{NetWorthStore-DG2X69jG.mjs → NetWorthStore-CpL_kqvx.mjs} +2 -2
- package/dist/{NotificationSettings-C7FYNM7I.mjs → NotificationSettings-CNmJWVeI.mjs} +248 -250
- package/dist/{OriginalBalanceAction-C6jdS4ws.mjs → OriginalBalanceAction-DK8_LkPz.mjs} +3 -3
- package/dist/{RecurringSettings-C81H1l38.mjs → RecurringSettings-B0uObPlD.mjs} +3 -3
- package/dist/{SpendingLegend-DqZxN_BZ.mjs → SpendingLegend-Bf-wbJvb.mjs} +2 -2
- package/dist/{TransactionDetails-BA_E5nQ-.mjs → TransactionDetails-COH0OKNG.mjs} +5 -5
- package/dist/{TransactionStore-PRlwE-TF.mjs → TransactionStore-Dz-G8Wd0.mjs} +2 -2
- package/dist/{User-Cnlegl1N.mjs → User-wXzDI4M8.mjs} +1 -1
- package/dist/{ViewMoreMicroCard-DfPXJzbv.mjs → ViewMoreMicroCard-C0832BMe.mjs} +101 -105
- package/dist/{WidgetContainer-CaPjoWeE.mjs → WidgetContainer-6dsjtOVg.mjs} +2 -2
- package/dist/accounts/index.es.js +140 -148
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/components/AddBudgets.d.ts +2 -1
- package/dist/budgets/index.es.js +627 -599
- package/dist/cashflow/index.es.js +362 -367
- package/dist/categories/index.es.js +1 -1
- package/dist/common/hooks/index.d.ts +0 -1
- package/dist/common/index.es.js +33 -35
- package/dist/dashboard/index.es.js +88 -90
- package/dist/debts/index.es.js +342 -346
- package/dist/{exportTransactionsToCSV-DuAaI5XA.mjs → exportTransactionsToCSV-Cz2t0lmA.mjs} +1 -1
- package/dist/finstrong/index.es.js +350 -352
- package/dist/goals/index.es.js +511 -518
- package/dist/help/index.es.js +9 -13
- package/dist/{hooks-ZMp65DFz.mjs → hooks-C41HAxM5.mjs} +11 -11
- package/dist/investments/index.es.js +393 -395
- package/dist/merchants/index.es.js +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/networth/index.es.js +240 -245
- package/dist/notifications/index.es.js +2 -2
- package/dist/recurringtransactions/index.es.js +285 -293
- package/dist/settings/index.es.js +249 -252
- package/dist/spending/index.es.js +126 -138
- package/dist/transactions/index.es.js +73 -77
- package/dist/trends/index.es.js +588 -601
- package/dist/{useAccountDisplayName-Cjx8YmKK.mjs → useAccountDisplayName-CMMlIOXF.mjs} +2 -2
- package/dist/{useInsightsEnabled-B7dxpDrX.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
- package/package.json +1 -1
- package/dist/common/hooks/useWidgetLoadTimer.d.ts +0 -6
- package/dist/useWidgetLoadTimer-C1NBkyLd.mjs +0 -23
package/dist/trends/index.es.js
CHANGED
|
@@ -1,111 +1,110 @@
|
|
|
1
1
|
import { jsxs as f, jsx as e, Fragment as rt } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import { CategoryIcon as Se, Text as
|
|
5
|
-
import
|
|
2
|
+
import l, { useRef as at, useState as it, useEffect as ct } from "react";
|
|
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 lt } from "@mxenabled/mxui";
|
|
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
|
-
import { differenceInCalendarMonths as
|
|
9
|
+
import { differenceInCalendarMonths as Ae } from "date-fns/differenceInCalendarMonths";
|
|
10
10
|
import { useTheme as be } from "@mui/material/styles";
|
|
11
11
|
import { LineChart as dt } from "@mui/x-charts";
|
|
12
12
|
import { u as ee } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
13
13
|
import { u as ut } from "../useDimensions-27p2evRx.mjs";
|
|
14
14
|
import ht from "@mui/material/Card";
|
|
15
15
|
import gt from "@mui/material/CardContent";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { u as
|
|
19
|
-
import { b as
|
|
16
|
+
import Re from "@mui/material/Divider";
|
|
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, 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
|
-
import { useTheme as
|
|
22
|
-
import { f as J, a as
|
|
23
|
-
import { C as
|
|
24
|
-
import { f as
|
|
25
|
-
import { a as
|
|
21
|
+
import { useTheme as Ct, Card as yt, CardContent as ft, Box as _t, Stack as Tt } from "@mui/material";
|
|
22
|
+
import { f as J, a as z } from "../Dialog-BPTr3qHE.mjs";
|
|
23
|
+
import { C as Me, c as St } from "../Category-CevNQ03n.mjs";
|
|
24
|
+
import { f as oe, a as bt } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
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
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import { DataGridPro as
|
|
31
|
-
import { H as
|
|
32
|
-
import { T as G, b as
|
|
33
|
-
import { A as v, W as
|
|
34
|
-
import { a as
|
|
35
|
-
import { D as
|
|
36
|
-
import { u as we } from "../useWidgetLoadTimer-C1NBkyLd.mjs";
|
|
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
|
+
import At from "@mui/material/ToggleButton";
|
|
29
|
+
import Rt from "@mui/material/ToggleButtonGroup";
|
|
30
|
+
import { DataGridPro as kt } from "@mui/x-data-grid-pro";
|
|
31
|
+
import { H as Ge } from "../HeaderCell-DjuifqHJ.mjs";
|
|
32
|
+
import { T as G, b as Ht } from "../ViewMoreMicroCard-C0832BMe.mjs";
|
|
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
|
+
import { D as ke } from "../Drawer-BEtCk82g.mjs";
|
|
37
36
|
import { L as ge } from "../Loader-DUaFpDGv.mjs";
|
|
38
|
-
import { L as
|
|
39
|
-
import { M as
|
|
40
|
-
import { subMonths as
|
|
41
|
-
import { TrendingUp as
|
|
42
|
-
import { M as
|
|
37
|
+
import { L as Ne } from "../LineChart-bc1D9xBE.mjs";
|
|
38
|
+
import { M as Nt } from "../MiniWidgetContainer-CmXpTylX.mjs";
|
|
39
|
+
import { subMonths as Wt } from "date-fns";
|
|
40
|
+
import { TrendingUp as Ot, TrendingDown as Gt, MultilineChart as Bt, ExpandLess as Vt, ExpandMore as Pt } from "@mxenabled/mx-icons";
|
|
41
|
+
import { M as $t } from "../MicroWidgetContainer-DEiRnYVa.mjs";
|
|
43
42
|
import Ft from "@mui/material/Collapse";
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
43
|
+
import zt from "@mui/material/List";
|
|
44
|
+
import Kt from "@mui/material/ListItem";
|
|
45
|
+
import jt from "@mui/material/ListItemButton";
|
|
46
|
+
import Yt from "@mui/material/ListItemIcon";
|
|
47
|
+
import Ut from "@mui/material/ListItemText";
|
|
49
48
|
import qe from "@mui/material/styles/useTheme";
|
|
50
|
-
import
|
|
51
|
-
import { b as
|
|
52
|
-
import { E as
|
|
53
|
-
import { u as Qt } from "../useInsightsEnabled-
|
|
54
|
-
import { E as
|
|
55
|
-
import { l as
|
|
56
|
-
const
|
|
57
|
-
const { categories: t } =
|
|
49
|
+
import Xt from "@mui/material/Paper";
|
|
50
|
+
import { b as Zt } from "../CategoryUtil-DUM8NuGO.mjs";
|
|
51
|
+
import { E as qt } from "../ExportCsvAction-DzTrtPzk.mjs";
|
|
52
|
+
import { u as Qt } from "../useInsightsEnabled-CNjP5cfR.mjs";
|
|
53
|
+
import { E as Jt } from "../EmptyState-DoxNUae-.mjs";
|
|
54
|
+
import { l as eo } from "../ConnectDrawer-CuUj16NH.mjs";
|
|
55
|
+
const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
56
|
+
const { categories: t } = W(), { getCategoryName: n } = U(), s = n(o);
|
|
58
57
|
return /* @__PURE__ */ f(b, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
|
|
59
58
|
/* @__PURE__ */ e(
|
|
60
|
-
|
|
59
|
+
N,
|
|
61
60
|
{
|
|
62
|
-
"aria-label":
|
|
61
|
+
"aria-label": ze(t.category_icon_label_aria, s),
|
|
63
62
|
mb: 4,
|
|
64
63
|
role: "img",
|
|
65
64
|
children: /* @__PURE__ */ e(Se, { categoryGuid: r })
|
|
66
65
|
}
|
|
67
66
|
),
|
|
68
|
-
/* @__PURE__ */ e(
|
|
67
|
+
/* @__PURE__ */ e(K, { variant: "Body", children: s })
|
|
69
68
|
] });
|
|
70
|
-
},
|
|
69
|
+
}, to = ({
|
|
71
70
|
categoryGuids: { guid: o, topLevelGuid: r },
|
|
72
71
|
hoveredAreaData: t,
|
|
73
72
|
cursorPosition: n,
|
|
74
73
|
chartContainerRef: s
|
|
75
74
|
}) => {
|
|
76
|
-
const
|
|
75
|
+
const d = be(), u = at(null), [g, c] = it({ x: n.x, y: n.y });
|
|
77
76
|
if (ct(() => {
|
|
78
77
|
(() => {
|
|
79
|
-
const
|
|
80
|
-
if (!
|
|
81
|
-
const
|
|
82
|
-
let
|
|
83
|
-
|
|
78
|
+
const p = u.current, _ = s.current;
|
|
79
|
+
if (!p || !_) return;
|
|
80
|
+
const m = p.getBoundingClientRect(), i = _.getBoundingClientRect();
|
|
81
|
+
let T = n.x, y = n.y;
|
|
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 });
|
|
84
83
|
})();
|
|
85
84
|
}, [n, s]), !t) return null;
|
|
86
|
-
const
|
|
85
|
+
const h = t.reduce((C, p) => C + p.y, 0);
|
|
87
86
|
return /* @__PURE__ */ e(
|
|
88
87
|
ht,
|
|
89
88
|
{
|
|
90
|
-
ref:
|
|
89
|
+
ref: u,
|
|
91
90
|
sx: {
|
|
92
91
|
position: "absolute",
|
|
93
|
-
top:
|
|
94
|
-
left:
|
|
92
|
+
top: g.y,
|
|
93
|
+
left: g.x,
|
|
95
94
|
width: 250,
|
|
96
95
|
pointerEvents: "none"
|
|
97
96
|
},
|
|
98
97
|
children: /* @__PURE__ */ f(gt, { children: [
|
|
99
|
-
/* @__PURE__ */ f(
|
|
100
|
-
/* @__PURE__ */ e(
|
|
101
|
-
/* @__PURE__ */ e(
|
|
102
|
-
/* @__PURE__ */ e(Te, { amount:
|
|
98
|
+
/* @__PURE__ */ f(N, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
99
|
+
/* @__PURE__ */ e(Qe, { categoryGuid: o, topLevelCategoryGuid: r }),
|
|
100
|
+
/* @__PURE__ */ e(K, { variant: "Small", children: `${t.length}-month total` }),
|
|
101
|
+
/* @__PURE__ */ e(Te, { amount: h, bold: !0, formatString: "0,0", variant: "body2" })
|
|
103
102
|
] }),
|
|
104
|
-
/* @__PURE__ */ e(
|
|
105
|
-
/* @__PURE__ */ e(
|
|
106
|
-
|
|
107
|
-
/* @__PURE__ */ e(
|
|
108
|
-
/* @__PURE__ */ e(
|
|
103
|
+
/* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
|
|
104
|
+
/* @__PURE__ */ e(We, { container: !0, children: t.map((C, p) => /* @__PURE__ */ f(l.Fragment, { children: [
|
|
105
|
+
p > 0 && p % 3 === 0 && /* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
|
|
106
|
+
/* @__PURE__ */ e(We, { item: !0, xs: 4, children: /* @__PURE__ */ f(N, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
107
|
+
/* @__PURE__ */ e(K, { color: d.palette.text.secondary, variant: "XSmall", children: C.x }),
|
|
109
108
|
/* @__PURE__ */ e(
|
|
110
109
|
Te,
|
|
111
110
|
{
|
|
@@ -116,46 +115,46 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
116
115
|
}
|
|
117
116
|
)
|
|
118
117
|
] }) })
|
|
119
|
-
] },
|
|
118
|
+
] }, p)) })
|
|
120
119
|
] })
|
|
121
120
|
}
|
|
122
121
|
);
|
|
123
|
-
},
|
|
122
|
+
}, oo = k(to), no = ({
|
|
124
123
|
categoryGuids: { guid: o, topLevelGuid: r },
|
|
125
124
|
itemData: { dataIndex: t },
|
|
126
125
|
series: n,
|
|
127
126
|
xData: s
|
|
128
127
|
}) => {
|
|
129
|
-
const
|
|
130
|
-
return
|
|
131
|
-
/* @__PURE__ */ e(
|
|
132
|
-
/* @__PURE__ */ e(
|
|
133
|
-
/* @__PURE__ */ e(Te, { amount: String(
|
|
128
|
+
const d = Ct(), u = n.data[t], g = s[t];
|
|
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(Qe, { categoryGuid: o, topLevelCategoryGuid: r }),
|
|
131
|
+
/* @__PURE__ */ e(K, { color: d.palette.text.secondary, variant: "Small", children: J(g, z.MONTH_SHORT_YEAR) }),
|
|
132
|
+
/* @__PURE__ */ e(Te, { amount: String(u), bold: !0, formatString: "0,0", variant: "Body" })
|
|
134
133
|
] }) }) });
|
|
135
|
-
},
|
|
134
|
+
}, so = ({
|
|
136
135
|
sx: o,
|
|
137
136
|
categoryGuids: r,
|
|
138
137
|
hoveredLegend: t,
|
|
139
138
|
legendRef: n,
|
|
140
139
|
onHoverLegend: s,
|
|
141
|
-
onClickLegend:
|
|
140
|
+
onClickLegend: d
|
|
142
141
|
}) => {
|
|
143
|
-
const { isMobile:
|
|
142
|
+
const { isMobile: u } = ee(), { getCategoryName: g } = U();
|
|
144
143
|
return /* @__PURE__ */ e(
|
|
145
144
|
b,
|
|
146
145
|
{
|
|
147
146
|
direction: "row",
|
|
148
147
|
flexWrap: "wrap",
|
|
149
|
-
gap:
|
|
148
|
+
gap: u ? 2 : 6,
|
|
150
149
|
justifyContent: "start",
|
|
151
150
|
ref: n,
|
|
152
151
|
sx: o,
|
|
153
|
-
children: r.map(({ guid: c, top_level_guid:
|
|
154
|
-
const C = t === c,
|
|
152
|
+
children: r.map(({ guid: c, top_level_guid: h }) => {
|
|
153
|
+
const C = t === c, p = Me[c], _ = Me[h], m = p ?? _ ?? Me.default, i = m + "33";
|
|
155
154
|
return /* @__PURE__ */ f(
|
|
156
155
|
_e,
|
|
157
156
|
{
|
|
158
|
-
onClick: () =>
|
|
157
|
+
onClick: () => d(c),
|
|
159
158
|
onMouseEnter: () => s(c),
|
|
160
159
|
onMouseLeave: () => s(null),
|
|
161
160
|
sx: {
|
|
@@ -171,18 +170,18 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
171
170
|
},
|
|
172
171
|
children: [
|
|
173
172
|
/* @__PURE__ */ e(
|
|
174
|
-
|
|
173
|
+
N,
|
|
175
174
|
{
|
|
176
175
|
sx: {
|
|
177
176
|
width: 16,
|
|
178
177
|
height: 16,
|
|
179
|
-
marginRight:
|
|
178
|
+
marginRight: u ? 5 : 10,
|
|
180
179
|
borderRadius: "2px",
|
|
181
|
-
backgroundColor: t ? C ?
|
|
180
|
+
backgroundColor: t ? C ? m : i : m
|
|
182
181
|
}
|
|
183
182
|
}
|
|
184
183
|
),
|
|
185
|
-
/* @__PURE__ */ e(
|
|
184
|
+
/* @__PURE__ */ e(K, { variant: "Body", children: g(c) })
|
|
186
185
|
]
|
|
187
186
|
},
|
|
188
187
|
c
|
|
@@ -190,111 +189,111 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
190
189
|
})
|
|
191
190
|
}
|
|
192
191
|
);
|
|
193
|
-
},
|
|
192
|
+
}, ro = ({
|
|
194
193
|
onHoverArea: o,
|
|
195
194
|
onHoverPoint: r,
|
|
196
195
|
onHoverLegend: t,
|
|
197
196
|
onClickLegend: n,
|
|
198
197
|
stackedDatasets: s,
|
|
199
|
-
unstackedDatasets:
|
|
200
|
-
availableHeight:
|
|
201
|
-
minimumHeight:
|
|
198
|
+
unstackedDatasets: d = [],
|
|
199
|
+
availableHeight: u = 0,
|
|
200
|
+
minimumHeight: g = 350
|
|
202
201
|
}) => {
|
|
203
|
-
const c = be(), { isMobile:
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
}, [
|
|
208
|
-
const [
|
|
202
|
+
const c = be(), { isMobile: h } = ee(), [C, { height: p }] = ut(), _ = l.useRef(null), [m, i] = l.useState(0);
|
|
203
|
+
l.useEffect(() => {
|
|
204
|
+
const a = Math.max(u - p, g);
|
|
205
|
+
i(a);
|
|
206
|
+
}, [u, p]);
|
|
207
|
+
const [T, y] = l.useState(null), [L, x] = l.useState({
|
|
209
208
|
hoveredSeriesId: null,
|
|
210
209
|
hoveredAreaData: null,
|
|
211
210
|
isAreaHovered: !1,
|
|
212
211
|
cursorPos: { x: 0, y: 0 }
|
|
213
|
-
}), { hoveredSeriesId:
|
|
214
|
-
(
|
|
215
|
-
) ?? [0],
|
|
216
|
-
...
|
|
217
|
-
),
|
|
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
|
+
) ?? [0], Z = Math.max(...ae), ie = Math.max(
|
|
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, $ = s.map((a, S) => ({
|
|
218
217
|
id: `stacked-${S}`,
|
|
219
|
-
guid:
|
|
220
|
-
top_level_guid:
|
|
218
|
+
guid: a.category_guid,
|
|
219
|
+
top_level_guid: a.top_level_category_guid,
|
|
221
220
|
area: !0,
|
|
222
221
|
color: s[S].category_color ?? c.palette.primary.main,
|
|
223
|
-
data:
|
|
222
|
+
data: a.dataset.map((I) => I.y),
|
|
224
223
|
label: s[S].category_name,
|
|
225
224
|
stack: "total",
|
|
226
225
|
type: "line",
|
|
227
226
|
highlightScope: { highlight: "item" },
|
|
228
|
-
valueFormatter: (
|
|
229
|
-
})),
|
|
227
|
+
valueFormatter: (I) => oe(I, "0,0")
|
|
228
|
+
})), te = d.map((a, S) => ({
|
|
230
229
|
id: `unstacked-${S}`,
|
|
231
|
-
guid:
|
|
232
|
-
top_level_guid:
|
|
230
|
+
guid: a.category_guid,
|
|
231
|
+
top_level_guid: a.top_level_category_guid,
|
|
233
232
|
area: !1,
|
|
234
|
-
color:
|
|
235
|
-
data:
|
|
236
|
-
label:
|
|
233
|
+
color: a.category_color,
|
|
234
|
+
data: a.dataset.map((I) => I.y),
|
|
235
|
+
label: a.category_name,
|
|
237
236
|
type: "line",
|
|
238
|
-
valueFormatter: (
|
|
239
|
-
})),
|
|
240
|
-
|
|
241
|
-
guid:
|
|
237
|
+
valueFormatter: (I) => oe(I, "0,0")
|
|
238
|
+
})), se = [...$, ...te], re = [
|
|
239
|
+
...$.map(({ guid: a, top_level_guid: S }) => ({
|
|
240
|
+
guid: a,
|
|
242
241
|
top_level_guid: S
|
|
243
242
|
})),
|
|
244
|
-
...
|
|
245
|
-
guid:
|
|
243
|
+
...te.map(({ guid: a, top_level_guid: S }) => ({
|
|
244
|
+
guid: a,
|
|
246
245
|
top_level_guid: S
|
|
247
246
|
}))
|
|
248
|
-
],
|
|
249
|
-
const
|
|
247
|
+
], j = (a) => {
|
|
248
|
+
const I = a.startsWith("stacked-") ? s[parseInt(a.split("-")[1])] : d[parseInt(a.split("-")[1])];
|
|
250
249
|
return {
|
|
251
|
-
guid:
|
|
252
|
-
topLevelGuid:
|
|
250
|
+
guid: I?.category_guid,
|
|
251
|
+
topLevelGuid: I?.top_level_category_guid
|
|
253
252
|
};
|
|
254
|
-
}, w = (
|
|
255
|
-
y(
|
|
256
|
-
},
|
|
257
|
-
n?.(
|
|
258
|
-
},
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
}, le = (
|
|
262
|
-
const S = String(
|
|
263
|
-
if (
|
|
253
|
+
}, w = (a) => {
|
|
254
|
+
y(a), t?.(a ?? "");
|
|
255
|
+
}, V = (a) => {
|
|
256
|
+
n?.(a ?? "");
|
|
257
|
+
}, F = () => {
|
|
258
|
+
const a = j(String(D)).guid;
|
|
259
|
+
a && n?.(a);
|
|
260
|
+
}, le = (a) => {
|
|
261
|
+
const S = String(a?.seriesId), I = j(S).guid, Y = se.find((de) => de.id === S), De = Y && a?.dataIndex !== void 0, Ie = Y && a?.dataIndex === void 0;
|
|
262
|
+
if (De)
|
|
264
263
|
x({
|
|
265
264
|
hoveredSeriesId: S,
|
|
266
265
|
hoveredAreaData: null,
|
|
267
266
|
isAreaHovered: !1,
|
|
268
|
-
cursorPos:
|
|
269
|
-
}), r?.(
|
|
270
|
-
else if (
|
|
271
|
-
const de = Y?.data.map((
|
|
272
|
-
x:
|
|
273
|
-
y:
|
|
267
|
+
cursorPos: M
|
|
268
|
+
}), r?.(I);
|
|
269
|
+
else if (Ie) {
|
|
270
|
+
const de = Y?.data.map((Ee, Le) => ({
|
|
271
|
+
x: B[Le],
|
|
272
|
+
y: Ee
|
|
274
273
|
})) ?? [];
|
|
275
274
|
x({
|
|
276
275
|
hoveredSeriesId: S,
|
|
277
276
|
hoveredAreaData: de,
|
|
278
277
|
isAreaHovered: !0,
|
|
279
|
-
cursorPos:
|
|
280
|
-
}), o?.(
|
|
278
|
+
cursorPos: M
|
|
279
|
+
}), o?.(I);
|
|
281
280
|
} else
|
|
282
281
|
x({
|
|
283
282
|
hoveredSeriesId: null,
|
|
284
283
|
hoveredAreaData: null,
|
|
285
284
|
isAreaHovered: !1,
|
|
286
|
-
cursorPos:
|
|
285
|
+
cursorPos: M
|
|
287
286
|
});
|
|
288
|
-
},
|
|
289
|
-
const S =
|
|
290
|
-
x((
|
|
291
|
-
...
|
|
287
|
+
}, we = (a) => {
|
|
288
|
+
const S = a.currentTarget.getBoundingClientRect();
|
|
289
|
+
x((I) => ({
|
|
290
|
+
...I,
|
|
292
291
|
cursorPos: {
|
|
293
|
-
x:
|
|
294
|
-
y:
|
|
292
|
+
x: a.clientX - S.left,
|
|
293
|
+
y: a.clientY - S.top
|
|
295
294
|
}
|
|
296
295
|
}));
|
|
297
|
-
},
|
|
296
|
+
}, ye = {
|
|
298
297
|
p: 4,
|
|
299
298
|
"& .MuiBarLabel-root": {
|
|
300
299
|
fontSize: 10,
|
|
@@ -310,18 +309,18 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
310
309
|
'& [class*="MuiLineElement-series-unstacked-"]': {
|
|
311
310
|
strokeWidth: 3
|
|
312
311
|
},
|
|
313
|
-
...
|
|
314
|
-
const Y = `.MuiAreaElement-series-stacked-${
|
|
315
|
-
return
|
|
316
|
-
opacity:
|
|
317
|
-
},
|
|
312
|
+
...T && $.reduce((a, S, I) => {
|
|
313
|
+
const Y = `.MuiAreaElement-series-stacked-${I}`;
|
|
314
|
+
return a[Y] = {
|
|
315
|
+
opacity: $[I].guid === T ? 0.9 : 0.2
|
|
316
|
+
}, a;
|
|
318
317
|
}, {})
|
|
319
318
|
};
|
|
320
319
|
return /* @__PURE__ */ e(
|
|
321
|
-
|
|
320
|
+
N,
|
|
322
321
|
{
|
|
323
|
-
onMouseMove:
|
|
324
|
-
ref:
|
|
322
|
+
onMouseMove: we,
|
|
323
|
+
ref: _,
|
|
325
324
|
sx: {
|
|
326
325
|
position: "relative",
|
|
327
326
|
touchAction: "pan-y",
|
|
@@ -343,11 +342,11 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
343
342
|
/* @__PURE__ */ e(
|
|
344
343
|
dt,
|
|
345
344
|
{
|
|
346
|
-
height:
|
|
345
|
+
height: m,
|
|
347
346
|
margin: { bottom: 50 },
|
|
348
|
-
onAreaClick:
|
|
347
|
+
onAreaClick: F,
|
|
349
348
|
onHighlightChange: le,
|
|
350
|
-
series:
|
|
349
|
+
series: se,
|
|
351
350
|
skipAnimation: !0,
|
|
352
351
|
slotProps: {
|
|
353
352
|
legend: {
|
|
@@ -355,56 +354,56 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
355
354
|
}
|
|
356
355
|
},
|
|
357
356
|
slots: {
|
|
358
|
-
itemContent: (
|
|
359
|
-
|
|
357
|
+
itemContent: (a) => E && D ? /* @__PURE__ */ e(
|
|
358
|
+
no,
|
|
360
359
|
{
|
|
361
|
-
categoryGuids:
|
|
362
|
-
xData:
|
|
363
|
-
...
|
|
360
|
+
categoryGuids: j(D),
|
|
361
|
+
xData: B,
|
|
362
|
+
...a
|
|
364
363
|
}
|
|
365
364
|
) : null
|
|
366
365
|
},
|
|
367
|
-
sx:
|
|
366
|
+
sx: ye,
|
|
368
367
|
tooltip: {
|
|
369
|
-
trigger:
|
|
368
|
+
trigger: E ? "item" : "none"
|
|
370
369
|
},
|
|
371
370
|
xAxis: [
|
|
372
371
|
{
|
|
373
|
-
data:
|
|
372
|
+
data: B,
|
|
374
373
|
scaleType: "time",
|
|
375
|
-
valueFormatter: (
|
|
376
|
-
tickNumber:
|
|
374
|
+
valueFormatter: (a) => J(a, z.MONTH_SHORT_YEAR),
|
|
375
|
+
tickNumber: ne
|
|
377
376
|
// How many ticks to show on the x-axis
|
|
378
377
|
}
|
|
379
378
|
],
|
|
380
379
|
yAxis: [
|
|
381
380
|
{
|
|
382
|
-
min:
|
|
383
|
-
max:
|
|
381
|
+
min: q,
|
|
382
|
+
max: ce || 100
|
|
384
383
|
}
|
|
385
384
|
]
|
|
386
385
|
}
|
|
387
386
|
),
|
|
388
387
|
/* @__PURE__ */ e(
|
|
389
|
-
|
|
388
|
+
so,
|
|
390
389
|
{
|
|
391
|
-
categoryGuids:
|
|
392
|
-
hoveredLegend:
|
|
390
|
+
categoryGuids: re,
|
|
391
|
+
hoveredLegend: T,
|
|
393
392
|
legendRef: C,
|
|
394
|
-
onClickLegend:
|
|
393
|
+
onClickLegend: V,
|
|
395
394
|
onHoverLegend: w,
|
|
396
|
-
sx: { px:
|
|
395
|
+
sx: { px: h ? 0 : 24 }
|
|
397
396
|
}
|
|
398
397
|
),
|
|
399
|
-
|
|
400
|
-
|
|
398
|
+
R && /* @__PURE__ */ e(
|
|
399
|
+
oo,
|
|
401
400
|
{
|
|
402
|
-
categoryGuids:
|
|
403
|
-
chartContainerRef:
|
|
404
|
-
cursorPosition:
|
|
405
|
-
hoveredAreaData:
|
|
406
|
-
...
|
|
407
|
-
x: J(
|
|
401
|
+
categoryGuids: j(D),
|
|
402
|
+
chartContainerRef: _,
|
|
403
|
+
cursorPosition: M,
|
|
404
|
+
hoveredAreaData: O.map((a) => ({
|
|
405
|
+
...a,
|
|
406
|
+
x: J(a.x, z.MONTH_SHORT_YEAR)
|
|
408
407
|
}))
|
|
409
408
|
}
|
|
410
409
|
)
|
|
@@ -413,29 +412,29 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
413
412
|
)
|
|
414
413
|
}
|
|
415
414
|
);
|
|
416
|
-
},
|
|
417
|
-
|
|
415
|
+
}, Je = ({ selectedTab: o, onTabChange: r }) => /* @__PURE__ */ e(
|
|
416
|
+
Rt,
|
|
418
417
|
{
|
|
419
418
|
exclusive: !0,
|
|
420
419
|
onChange: r,
|
|
421
420
|
orientation: "horizontal",
|
|
422
421
|
value: o,
|
|
423
|
-
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(
|
|
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))
|
|
424
423
|
}
|
|
425
|
-
),
|
|
426
|
-
const { trends: t } =
|
|
427
|
-
const
|
|
424
|
+
), et = ({ selectedDateRange: o, selectedCategoryGuid: r }) => {
|
|
425
|
+
const { trends: t } = W(), { isMobile: n, isDesktop: s } = ee(), { getCategoryName: d } = U(), u = l.useMemo(() => {
|
|
426
|
+
const g = J(
|
|
428
427
|
o.start,
|
|
429
|
-
n ?
|
|
428
|
+
n ? z.MONTH_SHORT_YEAR : z.MONTH_YEAR
|
|
430
429
|
), c = J(
|
|
431
430
|
o.end,
|
|
432
|
-
n ?
|
|
431
|
+
n ? z.MONTH_SHORT_YEAR : z.MONTH_YEAR
|
|
433
432
|
);
|
|
434
|
-
return `${
|
|
433
|
+
return `${g} - ${c}`;
|
|
435
434
|
}, [o, n]);
|
|
436
|
-
return /* @__PURE__ */ f(
|
|
435
|
+
return /* @__PURE__ */ f(N, { sx: { mr: 10, minWidth: "60%" }, children: [
|
|
437
436
|
/* @__PURE__ */ e(
|
|
438
|
-
|
|
437
|
+
K,
|
|
439
438
|
{
|
|
440
439
|
display: "block",
|
|
441
440
|
fontWeight: 700,
|
|
@@ -445,220 +444,217 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
445
444
|
textOverflow: "unset"
|
|
446
445
|
},
|
|
447
446
|
variant: s ? "H3" : "Body",
|
|
448
|
-
children:
|
|
447
|
+
children: d(r) || t.sub_title
|
|
449
448
|
}
|
|
450
449
|
),
|
|
451
|
-
/* @__PURE__ */ e(
|
|
450
|
+
/* @__PURE__ */ e(K, { variant: s ? "Body" : "Small", children: u })
|
|
452
451
|
] });
|
|
453
|
-
},
|
|
452
|
+
}, ao = (o) => {
|
|
454
453
|
const r = o.row[o.field];
|
|
455
454
|
return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(Te, { amount: r, variant: "Small" }) });
|
|
456
|
-
},
|
|
457
|
-
const { getCategoryName: t } = U(), { categories: n } =
|
|
455
|
+
}, io = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
456
|
+
const { getCategoryName: t } = U(), { categories: n } = W(), s = n.default_categories[o]?.replace(/&/g, "&") ?? t(o);
|
|
458
457
|
return /* @__PURE__ */ f(b, { alignItems: "center", direction: "row", justifyContent: "center", children: [
|
|
459
458
|
/* @__PURE__ */ e(
|
|
460
|
-
|
|
459
|
+
N,
|
|
461
460
|
{
|
|
462
|
-
"aria-label":
|
|
461
|
+
"aria-label": ze(n.category_icon_label_aria, s),
|
|
463
462
|
role: "img",
|
|
464
463
|
children: /* @__PURE__ */ e(Se, { categoryGuid: r })
|
|
465
464
|
}
|
|
466
465
|
),
|
|
467
|
-
/* @__PURE__ */ e(
|
|
466
|
+
/* @__PURE__ */ e(K, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
|
|
468
467
|
] });
|
|
469
|
-
},
|
|
470
|
-
|
|
468
|
+
}, co = (o) => /* @__PURE__ */ e(b, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
|
|
469
|
+
io,
|
|
471
470
|
{
|
|
472
471
|
categoryGuid: o.row.category,
|
|
473
472
|
topLevelCategoryGuid: o.row.top_level_category_guid
|
|
474
473
|
}
|
|
475
|
-
) }),
|
|
474
|
+
) }), lo = (o, r) => {
|
|
476
475
|
const t = [], n = new Date(o);
|
|
477
476
|
for (; n <= r; ) {
|
|
478
|
-
const s = J(n,
|
|
477
|
+
const s = J(n, z.MONTH);
|
|
479
478
|
t.push(s), n.setMonth(n.getMonth() + 1);
|
|
480
479
|
}
|
|
481
480
|
return t;
|
|
482
|
-
},
|
|
481
|
+
}, tt = ({
|
|
483
482
|
monthlyCategoryTotals: o,
|
|
484
483
|
selectedDateRange: r,
|
|
485
484
|
selectedCategory: t,
|
|
486
485
|
onClickRow: n,
|
|
487
486
|
height: s = "100dvh",
|
|
488
|
-
sx:
|
|
487
|
+
sx: d = {}
|
|
489
488
|
}) => {
|
|
490
|
-
const { onEvent:
|
|
491
|
-
{ field:
|
|
492
|
-
]), C =
|
|
489
|
+
const { onEvent: u } = P(), g = J(/* @__PURE__ */ new Date(), z.MONTH_SHORT), [c, h] = l.useState([
|
|
490
|
+
{ field: g, sort: "desc" }
|
|
491
|
+
]), C = l.useMemo(() => lo(r.start, r.end), [r]), p = [
|
|
493
492
|
{
|
|
494
493
|
field: "category",
|
|
495
494
|
flex: 1,
|
|
496
495
|
headerName: "Category",
|
|
497
496
|
minWidth: 175,
|
|
498
|
-
renderHeader:
|
|
499
|
-
renderCell:
|
|
497
|
+
renderHeader: Ge,
|
|
498
|
+
renderCell: co,
|
|
500
499
|
sortable: !0,
|
|
501
500
|
type: "string"
|
|
502
501
|
},
|
|
503
502
|
...C.map(
|
|
504
|
-
(
|
|
505
|
-
field:
|
|
503
|
+
(m) => ({
|
|
504
|
+
field: m,
|
|
506
505
|
flex: 1,
|
|
507
|
-
headerName:
|
|
506
|
+
headerName: m,
|
|
508
507
|
minWidth: 100,
|
|
509
|
-
renderHeader:
|
|
510
|
-
renderCell:
|
|
508
|
+
renderHeader: Ge,
|
|
509
|
+
renderCell: ao,
|
|
511
510
|
align: "right",
|
|
512
511
|
headerAlign: "right",
|
|
513
512
|
sortable: !0,
|
|
514
513
|
hideSortIcons: !1,
|
|
515
514
|
type: "number",
|
|
516
|
-
sortComparator:
|
|
515
|
+
sortComparator: xt
|
|
517
516
|
})
|
|
518
517
|
)
|
|
519
|
-
],
|
|
520
|
-
const
|
|
521
|
-
(y) => !
|
|
522
|
-
),
|
|
518
|
+
], _ = l.useMemo(() => {
|
|
519
|
+
const m = o.filter(
|
|
520
|
+
(y) => !wt(y) && !Dt(y)
|
|
521
|
+
), T = (t ? m.filter(
|
|
523
522
|
(y) => y.category_guid === t || y.top_level_category_guid === t
|
|
524
|
-
) :
|
|
525
|
-
(y,
|
|
526
|
-
const { category_guid: x, top_level_category_guid:
|
|
527
|
-
y[
|
|
528
|
-
id:
|
|
529
|
-
category:
|
|
523
|
+
) : m).reduce(
|
|
524
|
+
(y, L) => {
|
|
525
|
+
const { category_guid: x, top_level_category_guid: D, month: O, total: A, year: M } = L, R = t ? x : D;
|
|
526
|
+
y[R] || (y[R] = {
|
|
527
|
+
id: R,
|
|
528
|
+
category: R,
|
|
530
529
|
category_guid: x,
|
|
531
|
-
top_level_category_guid:
|
|
530
|
+
top_level_category_guid: D
|
|
532
531
|
});
|
|
533
|
-
const
|
|
534
|
-
return y[
|
|
532
|
+
const E = J(new Date(M, O - 1), z.MONTH_SHORT);
|
|
533
|
+
return y[R][E] || (y[R][E] = 0), y[R][E] = y[R][E] + Math.abs(A), y;
|
|
535
534
|
},
|
|
536
535
|
{}
|
|
537
536
|
);
|
|
538
|
-
return Object.values(
|
|
537
|
+
return Object.values(T);
|
|
539
538
|
}, [o, t]);
|
|
540
|
-
return /* @__PURE__ */ e(
|
|
541
|
-
|
|
539
|
+
return /* @__PURE__ */ e(N, { sx: { height: s, width: "100%", overflowX: "auto", boxShadow: "none", ...d }, children: /* @__PURE__ */ e(
|
|
540
|
+
kt,
|
|
542
541
|
{
|
|
543
|
-
columns:
|
|
542
|
+
columns: p,
|
|
544
543
|
disableColumnFilter: !0,
|
|
545
544
|
disableColumnMenu: !0,
|
|
546
545
|
hideFooter: !0,
|
|
547
546
|
initialState: { sorting: { sortModel: c } },
|
|
548
|
-
onRowClick: (
|
|
549
|
-
n?.(
|
|
547
|
+
onRowClick: (m) => {
|
|
548
|
+
n?.(m.row.category), u(v.TRENDS_CLICK_LIST_ITEM, {
|
|
550
549
|
...G,
|
|
551
|
-
listItem:
|
|
550
|
+
listItem: St[m.row.category]
|
|
552
551
|
});
|
|
553
552
|
},
|
|
554
|
-
onSortModelChange: (
|
|
555
|
-
m
|
|
553
|
+
onSortModelChange: (m) => {
|
|
554
|
+
h(m), u(v.TRENDS_CLICK_TABLE_SORT, G);
|
|
556
555
|
},
|
|
557
|
-
rows:
|
|
556
|
+
rows: _,
|
|
558
557
|
slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
|
|
559
558
|
sortModel: c,
|
|
560
559
|
sortingOrder: ["asc", "desc"]
|
|
561
560
|
}
|
|
562
561
|
) });
|
|
563
|
-
},
|
|
562
|
+
}, uo = {
|
|
564
563
|
title: "Transaction List"
|
|
565
|
-
},
|
|
564
|
+
}, ho = ({
|
|
566
565
|
categoryGuid: o,
|
|
567
566
|
dateRange: r,
|
|
568
567
|
isOpen: t,
|
|
569
568
|
onClose: n
|
|
570
569
|
}) => {
|
|
571
|
-
const { onEvent: s } =
|
|
572
|
-
() => c.find((
|
|
573
|
-
[
|
|
570
|
+
const { onEvent: s } = P(), { selectedAccountGuids: d } = me(), { common: u } = W(), { setFilter: g, sortedTransactions: c } = xe(), [h, C] = l.useState(""), p = l.useMemo(
|
|
571
|
+
() => c.find((m) => m.guid === h),
|
|
572
|
+
[h, c]
|
|
574
573
|
);
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
accounts:
|
|
574
|
+
l.useEffect(() => {
|
|
575
|
+
g({
|
|
576
|
+
accounts: d,
|
|
578
577
|
dateRange: r,
|
|
579
|
-
custom: (
|
|
578
|
+
custom: (m) => o === "" || o === m.category_guid || o === m.top_level_category_guid,
|
|
580
579
|
showSplits: !!o
|
|
581
580
|
});
|
|
582
|
-
}, [
|
|
583
|
-
const
|
|
581
|
+
}, [d, o, r]), l.useEffect(() => s(v.TRENDS_VIEW_TRANSACTIONS), []);
|
|
582
|
+
const _ = () => {
|
|
584
583
|
C(""), n();
|
|
585
584
|
};
|
|
586
585
|
return /* @__PURE__ */ f(
|
|
587
|
-
|
|
586
|
+
ke,
|
|
588
587
|
{
|
|
589
|
-
ariaLabelClose:
|
|
588
|
+
ariaLabelClose: u.close_aria,
|
|
590
589
|
isOpen: t,
|
|
591
|
-
onClose:
|
|
592
|
-
title:
|
|
590
|
+
onClose: _,
|
|
591
|
+
title: uo.title,
|
|
593
592
|
children: [
|
|
594
|
-
|
|
595
|
-
!
|
|
593
|
+
p && /* @__PURE__ */ e(Xe, { transaction: p }),
|
|
594
|
+
!p && /* @__PURE__ */ e(Ze, { onClick: C })
|
|
596
595
|
]
|
|
597
596
|
}
|
|
598
597
|
);
|
|
599
|
-
},
|
|
600
|
-
const { onEvent: t } =
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
isLoaded: x
|
|
604
|
-
}), u.useEffect(() => {
|
|
605
|
-
const w = () => X(window.innerHeight);
|
|
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
|
+
l.useEffect(() => {
|
|
601
|
+
const w = () => B(window.innerHeight);
|
|
606
602
|
return window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
|
|
607
|
-
}, []),
|
|
608
|
-
y(
|
|
609
|
-
}, [
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
603
|
+
}, []), l.useEffect(() => {
|
|
604
|
+
y(u);
|
|
605
|
+
}, [u]), l.useEffect(() => {
|
|
606
|
+
i && g(
|
|
607
|
+
T,
|
|
608
|
+
p.start,
|
|
609
|
+
p.end
|
|
614
610
|
).finally(() => {
|
|
615
|
-
|
|
611
|
+
D(!0);
|
|
616
612
|
});
|
|
617
|
-
}, [
|
|
618
|
-
const
|
|
613
|
+
}, [i, T, p]);
|
|
614
|
+
const Z = l.useMemo(() => {
|
|
619
615
|
if (!x) return { stackedDatasets: [], unstackedDatasets: [] };
|
|
620
|
-
const w =
|
|
616
|
+
const w = vt(
|
|
621
617
|
c,
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
),
|
|
625
|
-
(
|
|
626
|
-
) :
|
|
618
|
+
p.start,
|
|
619
|
+
p.end
|
|
620
|
+
), V = E.length ? w.filter(
|
|
621
|
+
(F) => F.top_level_category_guid === E || F.category_guid === E
|
|
622
|
+
) : It(w);
|
|
627
623
|
return {
|
|
628
|
-
stackedDatasets:
|
|
629
|
-
unstackedDatasets:
|
|
624
|
+
stackedDatasets: V.filter(Et),
|
|
625
|
+
unstackedDatasets: V.filter(Lt)
|
|
630
626
|
};
|
|
631
|
-
}, [c,
|
|
632
|
-
|
|
633
|
-
},
|
|
634
|
-
const
|
|
635
|
-
|
|
627
|
+
}, [c, E, p]), ie = (w, V) => {
|
|
628
|
+
R(V ?? M), t(v.TRENDS_CLICK_TOGGLE_VIEW);
|
|
629
|
+
}, q = (w) => {
|
|
630
|
+
const V = $e(w?.[0], 1), F = w?.[1], le = Ae(F, V);
|
|
631
|
+
_({ start: V, end: F }), t(v.TRENDS_CLICK_TIME_WINDOW, {
|
|
636
632
|
time_period: le + "M"
|
|
637
633
|
});
|
|
638
|
-
},
|
|
634
|
+
}, ce = () => {
|
|
639
635
|
t(v.TRENDS_CLICK_FILTER);
|
|
640
|
-
},
|
|
641
|
-
|
|
642
|
-
},
|
|
643
|
-
|
|
644
|
-
},
|
|
645
|
-
t(v.TRENDS_HOVER_LEGEND, { category:
|
|
646
|
-
},
|
|
636
|
+
}, $ = (w) => {
|
|
637
|
+
X(w);
|
|
638
|
+
}, te = (w) => {
|
|
639
|
+
X(w), t(v.TRENDS_CLICK_LEGEND, { category: h(w) });
|
|
640
|
+
}, se = (w) => {
|
|
641
|
+
t(v.TRENDS_HOVER_LEGEND, { category: h(w) });
|
|
642
|
+
}, re = (w) => {
|
|
647
643
|
t(v.TRENDS_HOVER_AREA, { category: w });
|
|
648
|
-
},
|
|
644
|
+
}, j = (w) => {
|
|
649
645
|
t(v.TRENDS_HOVER_POINT, { category: w });
|
|
650
646
|
};
|
|
651
|
-
return !
|
|
652
|
-
|
|
647
|
+
return !m || !i || !x ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
|
|
648
|
+
Ue,
|
|
653
649
|
{
|
|
654
|
-
accountOptions:
|
|
655
|
-
calendarActions: { onRangeChanged:
|
|
656
|
-
dateRange:
|
|
650
|
+
accountOptions: u,
|
|
651
|
+
calendarActions: { onRangeChanged: q },
|
|
652
|
+
dateRange: p,
|
|
657
653
|
dateRangeVariant: "timeframebuttons",
|
|
658
|
-
onAccountsFilterClick:
|
|
654
|
+
onAccountsFilterClick: ce,
|
|
659
655
|
onBackClick: o,
|
|
660
656
|
sx: r,
|
|
661
|
-
title:
|
|
657
|
+
title: L.title,
|
|
662
658
|
children: [
|
|
663
659
|
/* @__PURE__ */ f(
|
|
664
660
|
b,
|
|
@@ -673,46 +669,46 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
673
669
|
{
|
|
674
670
|
flexDirection: "row",
|
|
675
671
|
justifyContent: "space-between",
|
|
676
|
-
sx: { pb:
|
|
672
|
+
sx: { pb: d ? 12 : 24, pt: d ? 24 : 48 },
|
|
677
673
|
children: [
|
|
678
674
|
/* @__PURE__ */ e(
|
|
679
|
-
|
|
675
|
+
et,
|
|
680
676
|
{
|
|
681
|
-
selectedCategoryGuid:
|
|
682
|
-
selectedDateRange:
|
|
677
|
+
selectedCategoryGuid: E,
|
|
678
|
+
selectedDateRange: p
|
|
683
679
|
}
|
|
684
680
|
),
|
|
685
|
-
/* @__PURE__ */ e(
|
|
681
|
+
/* @__PURE__ */ e(Je, { onTabChange: ie, selectedTab: M })
|
|
686
682
|
]
|
|
687
683
|
}
|
|
688
684
|
),
|
|
689
685
|
/* @__PURE__ */ f(b, { alignItems: "center", flexDirection: "row", width: "100%", children: [
|
|
690
|
-
/* @__PURE__ */ e(
|
|
686
|
+
/* @__PURE__ */ e(N, { flexGrow: 1, children: E && /* @__PURE__ */ f(_e, { onClick: () => X(""), sx: { p: 0, pr: 5 }, children: [
|
|
691
687
|
/* @__PURE__ */ e(fe, { name: "arrow_back" }),
|
|
692
|
-
|
|
688
|
+
L.all_categories
|
|
693
689
|
] }) }),
|
|
694
|
-
/* @__PURE__ */ e(_e, { onClick: () =>
|
|
690
|
+
/* @__PURE__ */ e(_e, { onClick: () => A(!0), sx: { px: 5 }, children: `${L.view_transactions} (${C.length})` })
|
|
695
691
|
] }),
|
|
696
|
-
/* @__PURE__ */ f(
|
|
697
|
-
|
|
698
|
-
|
|
692
|
+
/* @__PURE__ */ f(N, { children: [
|
|
693
|
+
M === "Chart" && /* @__PURE__ */ e(
|
|
694
|
+
ro,
|
|
699
695
|
{
|
|
700
|
-
availableHeight:
|
|
701
|
-
onClickLegend:
|
|
702
|
-
onHoverArea:
|
|
703
|
-
onHoverLegend:
|
|
704
|
-
onHoverPoint:
|
|
705
|
-
stackedDatasets:
|
|
706
|
-
unstackedDatasets:
|
|
696
|
+
availableHeight: ae,
|
|
697
|
+
onClickLegend: te,
|
|
698
|
+
onHoverArea: re,
|
|
699
|
+
onHoverLegend: se,
|
|
700
|
+
onHoverPoint: j,
|
|
701
|
+
stackedDatasets: Z.stackedDatasets,
|
|
702
|
+
unstackedDatasets: Z.unstackedDatasets
|
|
707
703
|
}
|
|
708
704
|
),
|
|
709
|
-
|
|
710
|
-
|
|
705
|
+
M === "Table" && /* @__PURE__ */ e(
|
|
706
|
+
tt,
|
|
711
707
|
{
|
|
712
708
|
monthlyCategoryTotals: c,
|
|
713
|
-
onClickRow:
|
|
714
|
-
selectedCategory:
|
|
715
|
-
selectedDateRange:
|
|
709
|
+
onClickRow: $,
|
|
710
|
+
selectedCategory: E,
|
|
711
|
+
selectedDateRange: p
|
|
716
712
|
}
|
|
717
713
|
)
|
|
718
714
|
] })
|
|
@@ -720,21 +716,21 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
720
716
|
}
|
|
721
717
|
),
|
|
722
718
|
/* @__PURE__ */ e(
|
|
723
|
-
|
|
719
|
+
go,
|
|
724
720
|
{
|
|
725
|
-
categoryGuid:
|
|
726
|
-
dateRange:
|
|
727
|
-
isOpen:
|
|
728
|
-
onClose: () =>
|
|
721
|
+
categoryGuid: E,
|
|
722
|
+
dateRange: p,
|
|
723
|
+
isOpen: O,
|
|
724
|
+
onClose: () => A(!1)
|
|
729
725
|
}
|
|
730
726
|
)
|
|
731
727
|
]
|
|
732
728
|
}
|
|
733
729
|
);
|
|
734
|
-
}, Rn =
|
|
735
|
-
const { monthlyCategoryTotals: o } = U(), { trends: r } =
|
|
730
|
+
}, Rn = k(mo), po = () => {
|
|
731
|
+
const { monthlyCategoryTotals: o } = U(), { trends: r } = W(), t = be(), { availableHeight: n = 300 } = Fe(), s = Mt(o);
|
|
736
732
|
return /* @__PURE__ */ e(
|
|
737
|
-
|
|
733
|
+
Ne,
|
|
738
734
|
{
|
|
739
735
|
baseline: "min",
|
|
740
736
|
colors: [t.palette.primary.main],
|
|
@@ -749,39 +745,36 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
749
745
|
valueFormatterString: "0,0"
|
|
750
746
|
}
|
|
751
747
|
);
|
|
752
|
-
},
|
|
753
|
-
const { visibleAccounts: t } = ve(), { loadMonthlyCategoryTotals: n, monthlyTotalsLoaded: s } = U(), { isInitialized:
|
|
754
|
-
return
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
h && n(c).finally();
|
|
761
|
-
}, [h, c]), !d || !h ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
|
|
762
|
-
Ht,
|
|
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
|
+
return l.useEffect(() => {
|
|
751
|
+
h(t);
|
|
752
|
+
}, [t]), l.useEffect(() => {
|
|
753
|
+
d && n(c).finally();
|
|
754
|
+
}, [d, c]), !g || !d ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
|
|
755
|
+
Nt,
|
|
763
756
|
{
|
|
764
757
|
contentStyles: { height: "calc(100% - 72px)", ":last-child": { pb: 0 } },
|
|
765
758
|
onPrimaryCtaClick: o,
|
|
766
|
-
primaryCtaLabel:
|
|
767
|
-
subTitle:
|
|
759
|
+
primaryCtaLabel: u.primary_cta,
|
|
760
|
+
subTitle: u.sub_title,
|
|
768
761
|
sx: { height: "100%", ...r },
|
|
769
|
-
title:
|
|
770
|
-
children: s ? /* @__PURE__ */ e(
|
|
762
|
+
title: u.mini_title,
|
|
763
|
+
children: s ? /* @__PURE__ */ e(Co, {}) : /* @__PURE__ */ e(ge, {})
|
|
771
764
|
}
|
|
772
765
|
);
|
|
773
|
-
}, kn =
|
|
766
|
+
}, kn = k(yo), fo = 70, Be = ({
|
|
774
767
|
title: o,
|
|
775
768
|
totalAmount: r,
|
|
776
769
|
transactionType: t,
|
|
777
770
|
percentage: n,
|
|
778
771
|
secondaryLabel: s,
|
|
779
|
-
shouldDisplayPercentage:
|
|
772
|
+
shouldDisplayPercentage: d
|
|
780
773
|
}) => {
|
|
781
|
-
const { availableWidth:
|
|
774
|
+
const { availableWidth: u } = Fe(), g = l.useRef(null), c = l.useRef(null), h = bt(Number(Math.abs(n)), {
|
|
782
775
|
style: "percent",
|
|
783
776
|
minimumIntegerDigits: 1
|
|
784
|
-
}), C =
|
|
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;
|
|
785
778
|
return /* @__PURE__ */ f(
|
|
786
779
|
b,
|
|
787
780
|
{
|
|
@@ -805,17 +798,17 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
805
798
|
},
|
|
806
799
|
children: [
|
|
807
800
|
/* @__PURE__ */ e(he, { color: "text.secondary", variant: "caption", children: o }),
|
|
808
|
-
|
|
809
|
-
|
|
801
|
+
d && /* @__PURE__ */ f(b, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
802
|
+
p ? /* @__PURE__ */ e(Ot, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e(Gt, { size: 20, sx: { color: m } }),
|
|
810
803
|
/* @__PURE__ */ e(
|
|
811
804
|
he,
|
|
812
805
|
{
|
|
813
806
|
sx: {
|
|
814
|
-
color:
|
|
807
|
+
color: p ? _ : m,
|
|
815
808
|
fontWeight: 600
|
|
816
809
|
},
|
|
817
810
|
variant: "body2",
|
|
818
|
-
children:
|
|
811
|
+
children: h
|
|
819
812
|
}
|
|
820
813
|
)
|
|
821
814
|
] })
|
|
@@ -833,17 +826,17 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
833
826
|
},
|
|
834
827
|
children: [
|
|
835
828
|
/* @__PURE__ */ e(
|
|
836
|
-
|
|
829
|
+
N,
|
|
837
830
|
{
|
|
838
|
-
ref:
|
|
831
|
+
ref: g,
|
|
839
832
|
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
840
|
-
children: /* @__PURE__ */ e(
|
|
833
|
+
children: /* @__PURE__ */ e(Pe, { children: C })
|
|
841
834
|
}
|
|
842
835
|
),
|
|
843
|
-
|
|
836
|
+
d && u >= 450 && !y && /* @__PURE__ */ e(
|
|
844
837
|
he,
|
|
845
838
|
{
|
|
846
|
-
color:
|
|
839
|
+
color: p ? _ : m,
|
|
847
840
|
variant: "caption",
|
|
848
841
|
children: s
|
|
849
842
|
}
|
|
@@ -854,52 +847,49 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
854
847
|
]
|
|
855
848
|
}
|
|
856
849
|
);
|
|
857
|
-
},
|
|
858
|
-
const { trends: o } =
|
|
850
|
+
}, _o = k(() => {
|
|
851
|
+
const { trends: o } = W();
|
|
859
852
|
return /* @__PURE__ */ f(b, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
|
|
860
|
-
/* @__PURE__ */ e(
|
|
853
|
+
/* @__PURE__ */ e(Bt, { size: 32 }),
|
|
861
854
|
/* @__PURE__ */ f(b, { children: [
|
|
862
855
|
/* @__PURE__ */ e(he, { fontWeight: 600, variant: "body1", children: o.zero_state_content_header }),
|
|
863
856
|
/* @__PURE__ */ e(he, { color: "text.secondary", variant: "subtitle2", children: o.zero_state_content_description })
|
|
864
857
|
] })
|
|
865
858
|
] });
|
|
866
|
-
}), Hn =
|
|
867
|
-
const { visibleAccounts: r } = ve(), { onEvent: t } =
|
|
868
|
-
start:
|
|
859
|
+
}), Hn = k(({ onCtaClick: o }) => {
|
|
860
|
+
const { visibleAccounts: r } = ve(), { onEvent: t } = P(), { monthlyCategoryTotals: n, loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: d } = U(), u = {
|
|
861
|
+
start: Wt(/* @__PURE__ */ new Date(), 1),
|
|
869
862
|
end: /* @__PURE__ */ new Date()
|
|
870
|
-
}, { trends:
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
m(r);
|
|
876
|
-
}, [r]), u.useEffect(() => {
|
|
877
|
-
C && s(c, g.start).then(() => {
|
|
863
|
+
}, { trends: g } = W(), { selectedAccounts: c, setSelectedAccounts: h, isInitialized: C } = me();
|
|
864
|
+
l.useEffect(() => {
|
|
865
|
+
h(r);
|
|
866
|
+
}, [r]), l.useEffect(() => {
|
|
867
|
+
C && s(c, u.start).then(() => {
|
|
878
868
|
t(v.TRENDS_LOAD_WIDGET, {
|
|
879
869
|
state: r?.length ? "default" : "zeroState"
|
|
880
870
|
});
|
|
881
871
|
});
|
|
882
872
|
}, [C, c]);
|
|
883
|
-
const { spendingData:
|
|
873
|
+
const { spendingData: p, incomeData: _ } = l.useMemo(
|
|
884
874
|
() => ({
|
|
885
|
-
spendingData:
|
|
886
|
-
incomeData:
|
|
875
|
+
spendingData: je(n, u),
|
|
876
|
+
incomeData: Ye(n, u)
|
|
887
877
|
}),
|
|
888
|
-
[n,
|
|
889
|
-
), [
|
|
878
|
+
[n, u]
|
|
879
|
+
), [m, i] = p, [T, y] = _, L = Oe(i.y, m.y), x = Oe(y.y, T.y), D = C && !r?.length, O = () => {
|
|
890
880
|
t(
|
|
891
|
-
|
|
881
|
+
D ? v.TRENDS_CLICK_GET_STARTED : v.TRENDS_CLICK_VIEW_MORE
|
|
892
882
|
), o();
|
|
893
883
|
};
|
|
894
|
-
return !
|
|
895
|
-
|
|
884
|
+
return !d || !C ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
|
|
885
|
+
$t,
|
|
896
886
|
{
|
|
897
887
|
className: "mx-trends-microwidget",
|
|
898
|
-
ctaLabel:
|
|
899
|
-
onCTAClick:
|
|
900
|
-
subHeader:
|
|
901
|
-
title:
|
|
902
|
-
children:
|
|
888
|
+
ctaLabel: g.micro_primary_cta_label,
|
|
889
|
+
onCTAClick: O,
|
|
890
|
+
subHeader: D ? void 0 : g.micro_subheader,
|
|
891
|
+
title: g.title,
|
|
892
|
+
children: D ? /* @__PURE__ */ e(_o, {}) : /* @__PURE__ */ f(
|
|
903
893
|
b,
|
|
904
894
|
{
|
|
905
895
|
sx: {
|
|
@@ -909,23 +899,23 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
909
899
|
},
|
|
910
900
|
children: [
|
|
911
901
|
/* @__PURE__ */ e(
|
|
912
|
-
|
|
902
|
+
Be,
|
|
913
903
|
{
|
|
914
|
-
percentage:
|
|
915
|
-
secondaryLabel:
|
|
916
|
-
shouldDisplayPercentage:
|
|
917
|
-
title:
|
|
918
|
-
totalAmount:
|
|
904
|
+
percentage: L,
|
|
905
|
+
secondaryLabel: g.micro_secondary_label,
|
|
906
|
+
shouldDisplayPercentage: i.y !== 0 && m.y !== 0,
|
|
907
|
+
title: g.spending_label,
|
|
908
|
+
totalAmount: i.y,
|
|
919
909
|
transactionType: "spending"
|
|
920
910
|
}
|
|
921
911
|
),
|
|
922
912
|
/* @__PURE__ */ e(
|
|
923
|
-
|
|
913
|
+
Be,
|
|
924
914
|
{
|
|
925
915
|
percentage: x,
|
|
926
|
-
secondaryLabel:
|
|
927
|
-
shouldDisplayPercentage: y.y !== 0 &&
|
|
928
|
-
title:
|
|
916
|
+
secondaryLabel: g.micro_secondary_label,
|
|
917
|
+
shouldDisplayPercentage: y.y !== 0 && T.y !== 0,
|
|
918
|
+
title: g.income_label,
|
|
929
919
|
totalAmount: y.y,
|
|
930
920
|
transactionType: "income"
|
|
931
921
|
}
|
|
@@ -935,17 +925,17 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
935
925
|
)
|
|
936
926
|
}
|
|
937
927
|
);
|
|
938
|
-
}),
|
|
928
|
+
}), To = k(
|
|
939
929
|
({ isExpanded: o, onClick: r }) => {
|
|
940
930
|
const t = qe();
|
|
941
|
-
return /* @__PURE__ */ e(
|
|
931
|
+
return /* @__PURE__ */ e(Kt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(jt, { onClick: r, sx: { justifyContent: "center" }, children: /* @__PURE__ */ f(
|
|
942
932
|
b,
|
|
943
933
|
{
|
|
944
934
|
sx: { color: t.palette.primary.main, flexDirection: "row", alignItems: "center" },
|
|
945
935
|
children: [
|
|
946
|
-
/* @__PURE__ */ e(
|
|
947
|
-
/* @__PURE__ */ e(
|
|
948
|
-
|
|
936
|
+
/* @__PURE__ */ e(Ut, { children: /* @__PURE__ */ e(K, { bold: !0, variant: "body2", children: o ? "View less" : "View more" }) }),
|
|
937
|
+
/* @__PURE__ */ e(Yt, { sx: { color: t.palette.primary.main }, children: o ? /* @__PURE__ */ e(Vt, {}) : /* @__PURE__ */ e(
|
|
938
|
+
Pt,
|
|
949
939
|
{
|
|
950
940
|
sx: {
|
|
951
941
|
transition: "transform 0.3s ease-in-out",
|
|
@@ -957,101 +947,101 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
957
947
|
}
|
|
958
948
|
) }) });
|
|
959
949
|
}
|
|
960
|
-
),
|
|
950
|
+
), Ve = k(
|
|
961
951
|
({
|
|
962
952
|
totalAmount: o,
|
|
963
953
|
guid: r,
|
|
964
954
|
name: t,
|
|
965
955
|
transactions: n,
|
|
966
956
|
onClick: s,
|
|
967
|
-
isLastItem:
|
|
968
|
-
showDivider:
|
|
957
|
+
isLastItem: d = !1,
|
|
958
|
+
showDivider: u = !0
|
|
969
959
|
}) => {
|
|
970
|
-
const { trends:
|
|
960
|
+
const { trends: g } = W(), { onEvent: c } = P(), h = `${n.length} ${n.length === 1 ? g.transaction : g.transactions}`, C = () => {
|
|
971
961
|
s?.(), c(v.TRENDS_CLICK_LIST_ITEM, {
|
|
972
962
|
...G,
|
|
973
963
|
listItem: t
|
|
974
964
|
});
|
|
975
965
|
};
|
|
976
|
-
return /* @__PURE__ */ f(
|
|
966
|
+
return /* @__PURE__ */ f(l.Fragment, { children: [
|
|
977
967
|
/* @__PURE__ */ e(
|
|
978
|
-
|
|
968
|
+
Ke,
|
|
979
969
|
{
|
|
980
970
|
leftIcon: r ? /* @__PURE__ */ e(Se, { categoryGuid: r }) : void 0,
|
|
981
971
|
onClick: C,
|
|
982
|
-
rightContent:
|
|
972
|
+
rightContent: oe(Math.abs(o), "0,0.00"),
|
|
983
973
|
rightIcon: s ? /* @__PURE__ */ e(lt, {}) : void 0,
|
|
984
|
-
subtitle:
|
|
974
|
+
subtitle: h,
|
|
985
975
|
title: t
|
|
986
976
|
}
|
|
987
977
|
),
|
|
988
|
-
|
|
978
|
+
u && /* @__PURE__ */ e(Re, { sx: { ml: d ? 24 : 68 } })
|
|
989
979
|
] }, r);
|
|
990
980
|
}
|
|
991
|
-
),
|
|
981
|
+
), So = k(
|
|
992
982
|
({ availableHeight: o = 0, onCategoryClick: r }) => {
|
|
993
|
-
const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: s } = pe(), { isLargeDesktop:
|
|
994
|
-
|
|
995
|
-
const
|
|
996
|
-
|
|
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;
|
|
984
|
+
l.useEffect(() => {
|
|
985
|
+
const i = Math.floor(o / 64) - 1, T = n.length + t.length;
|
|
986
|
+
i !== n.length && (s(p ? Math.max(i, 5) : 5), C(i >= T));
|
|
997
987
|
}, [o]);
|
|
998
|
-
const
|
|
999
|
-
C(!
|
|
988
|
+
const _ = () => {
|
|
989
|
+
C(!h), c(v.TRENDS_CLICK_VIEW_MORE, {
|
|
1000
990
|
...G
|
|
1001
991
|
});
|
|
1002
|
-
},
|
|
1003
|
-
return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ f(
|
|
1004
|
-
/* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(
|
|
1005
|
-
n.map((
|
|
1006
|
-
|
|
992
|
+
}, m = n.length + (h ? t.length : 0);
|
|
993
|
+
return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ f(zt, { children: [
|
|
994
|
+
/* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Pe, { children: g.categories }) }),
|
|
995
|
+
n.map((i, T) => /* @__PURE__ */ e(
|
|
996
|
+
Ve,
|
|
1007
997
|
{
|
|
1008
|
-
...
|
|
1009
|
-
isLastItem:
|
|
1010
|
-
onClick:
|
|
998
|
+
...i,
|
|
999
|
+
isLastItem: T === m - 1,
|
|
1000
|
+
onClick: i.transactions.length > 0 ? () => r(i) : void 0,
|
|
1011
1001
|
showDivider: !0
|
|
1012
1002
|
},
|
|
1013
|
-
|
|
1003
|
+
i.guid
|
|
1014
1004
|
)),
|
|
1015
1005
|
/* @__PURE__ */ e(
|
|
1016
1006
|
Ft,
|
|
1017
1007
|
{
|
|
1018
|
-
in:
|
|
1008
|
+
in: h,
|
|
1019
1009
|
sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
|
|
1020
|
-
children: t.map((
|
|
1021
|
-
const y = n.length +
|
|
1010
|
+
children: t.map((i, T) => {
|
|
1011
|
+
const y = n.length + T;
|
|
1022
1012
|
return /* @__PURE__ */ e(
|
|
1023
|
-
|
|
1013
|
+
Ve,
|
|
1024
1014
|
{
|
|
1025
|
-
...
|
|
1026
|
-
isLastItem: y ===
|
|
1027
|
-
onClick:
|
|
1015
|
+
...i,
|
|
1016
|
+
isLastItem: y === m - 1,
|
|
1017
|
+
onClick: i.transactions.length > 0 ? () => r(i) : void 0,
|
|
1028
1018
|
showDivider: !0
|
|
1029
1019
|
},
|
|
1030
|
-
|
|
1020
|
+
i.guid
|
|
1031
1021
|
);
|
|
1032
1022
|
})
|
|
1033
1023
|
}
|
|
1034
1024
|
),
|
|
1035
|
-
t.length > 0 && /* @__PURE__ */ e(
|
|
1025
|
+
t.length > 0 && /* @__PURE__ */ e(To, { isExpanded: h, onClick: _ })
|
|
1036
1026
|
] }) });
|
|
1037
1027
|
}
|
|
1038
|
-
),
|
|
1039
|
-
const { onEvent: t } =
|
|
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) => {
|
|
1040
1030
|
r?.(x), t(v.TRENDS_CLICK_INSIGHT, G);
|
|
1041
|
-
},
|
|
1042
|
-
return /* @__PURE__ */ e(
|
|
1043
|
-
|
|
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;
|
|
1032
|
+
return /* @__PURE__ */ e(Tt, { sx: { height: y }, children: /* @__PURE__ */ e(
|
|
1033
|
+
Ht,
|
|
1044
1034
|
{
|
|
1045
|
-
areBeatsLoading:
|
|
1035
|
+
areBeatsLoading: u.isLoading,
|
|
1046
1036
|
beats: o,
|
|
1047
|
-
endpoint:
|
|
1048
|
-
heightOverrides:
|
|
1049
|
-
logOutUser:
|
|
1050
|
-
onCardClick:
|
|
1037
|
+
endpoint: g,
|
|
1038
|
+
heightOverrides: L,
|
|
1039
|
+
logOutUser: p,
|
|
1040
|
+
onCardClick: _,
|
|
1051
1041
|
showBorder: !0,
|
|
1052
1042
|
showCTAColocatedWithText: !1,
|
|
1053
1043
|
showCarouselControls: !0,
|
|
1054
|
-
showHeader:
|
|
1044
|
+
showHeader: h,
|
|
1055
1045
|
showIcon: !0,
|
|
1056
1046
|
showWithMargin: !1,
|
|
1057
1047
|
token: c,
|
|
@@ -1060,12 +1050,12 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
1060
1050
|
visibleCardsCount: C
|
|
1061
1051
|
}
|
|
1062
1052
|
) });
|
|
1063
|
-
},
|
|
1064
|
-
const { onEvent: t } =
|
|
1053
|
+
}, xo = k(bo), vo = k(({ chartLabel: o, chartColor: r }) => {
|
|
1054
|
+
const { onEvent: t } = P(), {
|
|
1065
1055
|
categoryDetailsChartData: { monthlyAmounts: n, tooltipLabels: s }
|
|
1066
1056
|
} = pe();
|
|
1067
1057
|
return /* @__PURE__ */ e(b, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
|
|
1068
|
-
|
|
1058
|
+
Ne,
|
|
1069
1059
|
{
|
|
1070
1060
|
baseline: "min",
|
|
1071
1061
|
colors: [r],
|
|
@@ -1093,100 +1083,100 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
1093
1083
|
valueFormatterString: "0,0"
|
|
1094
1084
|
}
|
|
1095
1085
|
) });
|
|
1096
|
-
}),
|
|
1097
|
-
const r = qe(), { onEvent: t } =
|
|
1098
|
-
if (!
|
|
1086
|
+
}), wo = k(({ onClose: o }) => {
|
|
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);
|
|
1088
|
+
if (!d)
|
|
1099
1089
|
return null;
|
|
1100
|
-
const { guid: C, name:
|
|
1101
|
-
() =>
|
|
1102
|
-
[c,
|
|
1103
|
-
),
|
|
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(
|
|
1091
|
+
() => g.find((A) => A.guid === c),
|
|
1092
|
+
[c, g]
|
|
1093
|
+
), D = (A) => A.category_guid === C || A.top_level_category_guid === C, O = () => {
|
|
1104
1094
|
o?.(), t(v.TRENDS_CLICK_BACK, G);
|
|
1105
1095
|
};
|
|
1106
1096
|
return /* @__PURE__ */ f(
|
|
1107
|
-
|
|
1097
|
+
ke,
|
|
1108
1098
|
{
|
|
1109
1099
|
ariaLabelClose: s.close_category_details,
|
|
1110
1100
|
isOpen: !0,
|
|
1111
|
-
onClose:
|
|
1101
|
+
onClose: O,
|
|
1112
1102
|
shouldShowHeaderShadow: !0,
|
|
1113
|
-
title:
|
|
1103
|
+
title: i,
|
|
1114
1104
|
children: [
|
|
1115
1105
|
/* @__PURE__ */ f(b, { sx: { alignItems: "center", height: "100%" }, children: [
|
|
1116
|
-
/* @__PURE__ */ f(
|
|
1106
|
+
/* @__PURE__ */ f(Xt, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
|
|
1117
1107
|
/* @__PURE__ */ e(
|
|
1118
|
-
|
|
1108
|
+
Ke,
|
|
1119
1109
|
{
|
|
1120
1110
|
leftIcon: /* @__PURE__ */ e(Se, { categoryGuid: C }),
|
|
1121
|
-
rightContent:
|
|
1122
|
-
subtitle:
|
|
1123
|
-
title:
|
|
1111
|
+
rightContent: oe(Math.abs(m), "0,0.00"),
|
|
1112
|
+
subtitle: u,
|
|
1113
|
+
title: p
|
|
1124
1114
|
}
|
|
1125
1115
|
),
|
|
1126
|
-
/* @__PURE__ */ e(
|
|
1116
|
+
/* @__PURE__ */ e(vo, { chartColor: T, chartLabel: y }),
|
|
1127
1117
|
/* @__PURE__ */ f(b, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
|
|
1128
|
-
/* @__PURE__ */ e(
|
|
1129
|
-
/* @__PURE__ */ e(
|
|
1118
|
+
/* @__PURE__ */ e(K, { bold: !0, variant: "body1", children: L }),
|
|
1119
|
+
/* @__PURE__ */ e(qt, { filter: D })
|
|
1130
1120
|
] })
|
|
1131
1121
|
] }),
|
|
1132
1122
|
/* @__PURE__ */ e(
|
|
1133
|
-
|
|
1123
|
+
Ze,
|
|
1134
1124
|
{
|
|
1135
1125
|
bgcolor: "transparent",
|
|
1136
|
-
filter:
|
|
1126
|
+
filter: D,
|
|
1137
1127
|
height: "calc(100vh - 475px)",
|
|
1138
|
-
onClick:
|
|
1128
|
+
onClick: h
|
|
1139
1129
|
}
|
|
1140
1130
|
)
|
|
1141
1131
|
] }),
|
|
1142
1132
|
/* @__PURE__ */ e(
|
|
1143
|
-
|
|
1133
|
+
ke,
|
|
1144
1134
|
{
|
|
1145
1135
|
ariaLabelClose: n.close_aria,
|
|
1146
1136
|
isOpen: !!x,
|
|
1147
|
-
onClose: () =>
|
|
1137
|
+
onClose: () => h(""),
|
|
1148
1138
|
title: s.transaction,
|
|
1149
|
-
children: x && /* @__PURE__ */ e(
|
|
1139
|
+
children: x && /* @__PURE__ */ e(Xe, { transaction: x })
|
|
1150
1140
|
}
|
|
1151
1141
|
)
|
|
1152
1142
|
]
|
|
1153
1143
|
}
|
|
1154
1144
|
);
|
|
1155
|
-
}),
|
|
1156
|
-
const t =
|
|
1145
|
+
}), Do = (o, r) => {
|
|
1146
|
+
const t = Ye(o, r), n = je(o, r);
|
|
1157
1147
|
return [t, n].filter((s) => s.length > 0);
|
|
1158
|
-
},
|
|
1159
|
-
const [t, n] = o, s = t,
|
|
1148
|
+
}, Io = (o, r) => {
|
|
1149
|
+
const [t, n] = o, s = t, d = n ?? t, u = [];
|
|
1160
1150
|
if (s) {
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1151
|
+
const g = s.reduce((c, h) => c + h.y, 0);
|
|
1152
|
+
u.push({ label: r.income_label, amount: g });
|
|
1163
1153
|
}
|
|
1164
|
-
if (
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1154
|
+
if (d) {
|
|
1155
|
+
const g = d.reduce((c, h) => c + h.y, 0);
|
|
1156
|
+
u.push({ label: r.spending_label, amount: g });
|
|
1167
1157
|
}
|
|
1168
|
-
return
|
|
1169
|
-
},
|
|
1158
|
+
return u;
|
|
1159
|
+
}, Eo = ({
|
|
1170
1160
|
availableHeight: o = 0,
|
|
1171
1161
|
minHeight: r = 500,
|
|
1172
1162
|
selectedDateRange: t,
|
|
1173
1163
|
totals: n
|
|
1174
1164
|
}) => {
|
|
1175
|
-
const s = be(), { onEvent:
|
|
1176
|
-
return
|
|
1177
|
-
const
|
|
1178
|
-
|
|
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;
|
|
1166
|
+
return l.useEffect(() => {
|
|
1167
|
+
const A = Math.max(o - x, r);
|
|
1168
|
+
T(A);
|
|
1179
1169
|
}, [o]), /* @__PURE__ */ e(
|
|
1180
|
-
|
|
1170
|
+
Ne,
|
|
1181
1171
|
{
|
|
1182
1172
|
baseline: "min",
|
|
1183
|
-
colors:
|
|
1173
|
+
colors: p,
|
|
1184
1174
|
curveType: "bump",
|
|
1185
|
-
datasets:
|
|
1186
|
-
height:
|
|
1187
|
-
labels:
|
|
1175
|
+
datasets: _,
|
|
1176
|
+
height: D,
|
|
1177
|
+
labels: m,
|
|
1188
1178
|
onItemClick: () => {
|
|
1189
|
-
|
|
1179
|
+
d(v.TRENDS_CLICK_CHART, G);
|
|
1190
1180
|
},
|
|
1191
1181
|
showArea: !0,
|
|
1192
1182
|
showAxisHighlight: !0,
|
|
@@ -1199,7 +1189,7 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
1199
1189
|
valueFormatterString: "0.0a"
|
|
1200
1190
|
}
|
|
1201
1191
|
);
|
|
1202
|
-
},
|
|
1192
|
+
}, Lo = k(Eo), Mo = [
|
|
1203
1193
|
"BillAmountNotStandard",
|
|
1204
1194
|
"CategorySpendingV2",
|
|
1205
1195
|
"CostOfLivingToIncome",
|
|
@@ -1233,112 +1223,109 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
1233
1223
|
"WeeklyNewMerchantsV2",
|
|
1234
1224
|
"WeeklyNoSpendDays",
|
|
1235
1225
|
"WeeklySmallPurchasesSummary"
|
|
1236
|
-
],
|
|
1237
|
-
const { onEvent: n } =
|
|
1238
|
-
isCopyLoaded:
|
|
1239
|
-
isInitialized:
|
|
1240
|
-
selectedAccounts:
|
|
1241
|
-
selectedAccountGuids:
|
|
1242
|
-
setSelectedAccounts:
|
|
1243
|
-
} = me(), { trends:
|
|
1244
|
-
() =>
|
|
1245
|
-
[
|
|
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(), {
|
|
1228
|
+
isCopyLoaded: L,
|
|
1229
|
+
isInitialized: x,
|
|
1230
|
+
selectedAccounts: D,
|
|
1231
|
+
selectedAccountGuids: O,
|
|
1232
|
+
setSelectedAccounts: A
|
|
1233
|
+
} = me(), { trends: M, connect: R } = W(), { beatStore: E } = He(), ne = Qt() && d.show_insights_widget_in_master, B = g || u, [Ce, ae] = l.useState(!1), [Z, ie] = l.useState(!1), [q, ce] = l.useState("Chart"), [$, te] = l.useState(""), [se, re] = l.useState(!1), [j, w] = l.useState(window.innerHeight), V = B ? 56 : 0, F = j - 208, le = j - (ne ? 550 + V : 266), [we, ye] = l.useState(!1), a = d.show_connections_widget_in_master ? "buttons" : "no-buttons", S = l.useMemo(
|
|
1234
|
+
() => h && h.length === 0 || _.length === 0,
|
|
1235
|
+
[h, _]
|
|
1246
1236
|
);
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
x,
|
|
1263
|
-
a.start,
|
|
1264
|
-
a.end
|
|
1237
|
+
l.useEffect(() => {
|
|
1238
|
+
x && E.loadBeats().finally(() => ie(!0));
|
|
1239
|
+
}, [x]);
|
|
1240
|
+
const I = l.useMemo(() => Z ? E.getFilteredBeats({ templates: Mo }) : [], [Z]);
|
|
1241
|
+
l.useEffect(() => {
|
|
1242
|
+
const H = () => w(window.innerHeight);
|
|
1243
|
+
return window.addEventListener("resize", H), () => window.removeEventListener("resize", H);
|
|
1244
|
+
}, []), l.useEffect(() => {
|
|
1245
|
+
A(h);
|
|
1246
|
+
}, [h]), l.useEffect(() => {
|
|
1247
|
+
x && C(D, i.start, i.end).then(() => {
|
|
1248
|
+
p(
|
|
1249
|
+
D,
|
|
1250
|
+
i.start,
|
|
1251
|
+
i.end
|
|
1265
1252
|
);
|
|
1266
1253
|
}).finally(() => {
|
|
1267
|
-
|
|
1254
|
+
ae(!0), n(v.TRENDS_LOAD_WIDGET, {
|
|
1268
1255
|
...G,
|
|
1269
|
-
time_period: `${
|
|
1270
|
-
});
|
|
1256
|
+
time_period: `${Ae(i.end, i.start)}M`
|
|
1257
|
+
}), s?.("TrendsWidget");
|
|
1271
1258
|
});
|
|
1272
|
-
}, [
|
|
1273
|
-
if (
|
|
1274
|
-
const
|
|
1275
|
-
accounts:
|
|
1276
|
-
dateRange: { start:
|
|
1259
|
+
}, [x, D, i]), l.useEffect(() => {
|
|
1260
|
+
if (_.length !== 0) {
|
|
1261
|
+
const H = {
|
|
1262
|
+
accounts: O,
|
|
1263
|
+
dateRange: { start: i.start, end: i.end }
|
|
1277
1264
|
};
|
|
1278
|
-
|
|
1279
|
-
...
|
|
1280
|
-
custom: (
|
|
1281
|
-
(ue) => ue.top_level_category_guid ===
|
|
1265
|
+
m({
|
|
1266
|
+
...H,
|
|
1267
|
+
custom: (Q) => !!_.find(
|
|
1268
|
+
(ue) => ue.top_level_category_guid === Q.top_level_category_guid || ue.category_guid === Q.category_guid
|
|
1282
1269
|
)
|
|
1283
1270
|
});
|
|
1284
1271
|
}
|
|
1285
|
-
}, [
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1288
|
-
},
|
|
1289
|
-
|
|
1272
|
+
}, [_]);
|
|
1273
|
+
const Y = (H) => {
|
|
1274
|
+
T(H), re(!0);
|
|
1275
|
+
}, De = () => {
|
|
1276
|
+
T(null), re(!1);
|
|
1290
1277
|
}, Ie = () => {
|
|
1291
1278
|
ye(!0), n(v.TRENDS_CLICK_CONNECT_ACCOUNTS);
|
|
1292
|
-
},
|
|
1293
|
-
ce(
|
|
1279
|
+
}, de = (H, Q) => {
|
|
1280
|
+
ce(Q ?? q), n(v.TRENDS_CLICK_TOGGLE_VIEW, {
|
|
1294
1281
|
...G,
|
|
1295
|
-
toggleView:
|
|
1282
|
+
toggleView: Q
|
|
1296
1283
|
});
|
|
1297
|
-
},
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1284
|
+
}, Ee = (H) => {
|
|
1285
|
+
const Q = $e(H?.[0], 1), ue = H?.[1], st = Ae(ue, Q);
|
|
1286
|
+
y({ start: Q, end: ue }), n(v.TRENDS_CLICK_TIME_WINDOW, {
|
|
1300
1287
|
...G,
|
|
1301
1288
|
time_period: st + "M"
|
|
1302
1289
|
});
|
|
1303
|
-
}, Le = (
|
|
1290
|
+
}, Le = (H) => {
|
|
1304
1291
|
n(v.TRENDS_CLICK_FILTER, {
|
|
1305
1292
|
...G,
|
|
1306
|
-
filterValue:
|
|
1293
|
+
filterValue: H
|
|
1307
1294
|
});
|
|
1308
|
-
},
|
|
1309
|
-
|
|
1295
|
+
}, ot = (H) => {
|
|
1296
|
+
te(H);
|
|
1310
1297
|
}, nt = () => {
|
|
1311
|
-
|
|
1298
|
+
te(""), n(v.TRENDS_CLICK_ALL_CATEGORIES, G);
|
|
1312
1299
|
};
|
|
1313
|
-
return !
|
|
1314
|
-
|
|
1300
|
+
return !L || !Ce ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
|
|
1301
|
+
Ue,
|
|
1315
1302
|
{
|
|
1316
|
-
accountOptions:
|
|
1317
|
-
calendarActions: { onRangeChanged:
|
|
1318
|
-
dateRange:
|
|
1319
|
-
dateRangeVariant:
|
|
1303
|
+
accountOptions: h,
|
|
1304
|
+
calendarActions: { onRangeChanged: Ee },
|
|
1305
|
+
dateRange: i,
|
|
1306
|
+
dateRangeVariant: c ? "timeframetabs" : "timeframebuttons",
|
|
1320
1307
|
onAccountsFilterClick: Le,
|
|
1321
1308
|
onBackClick: o,
|
|
1322
1309
|
sx: t,
|
|
1323
|
-
title:
|
|
1310
|
+
title: M.title,
|
|
1324
1311
|
children: [
|
|
1325
|
-
|
|
1326
|
-
|
|
1312
|
+
S && /* @__PURE__ */ e(
|
|
1313
|
+
Jt,
|
|
1327
1314
|
{
|
|
1328
|
-
header:
|
|
1315
|
+
header: M.zero_state_content_header,
|
|
1329
1316
|
icon: "",
|
|
1330
1317
|
onClick: Ie,
|
|
1331
|
-
primaryButton:
|
|
1332
|
-
subText:
|
|
1333
|
-
sx: { height:
|
|
1334
|
-
variant:
|
|
1318
|
+
primaryButton: M.empty_state_primary,
|
|
1319
|
+
subText: M.empty_state_sub_text,
|
|
1320
|
+
sx: { height: F },
|
|
1321
|
+
variant: a
|
|
1335
1322
|
}
|
|
1336
1323
|
),
|
|
1337
|
-
!
|
|
1324
|
+
!S && /* @__PURE__ */ f(
|
|
1338
1325
|
b,
|
|
1339
1326
|
{
|
|
1340
1327
|
sx: {
|
|
1341
|
-
px:
|
|
1328
|
+
px: c ? 0 : 48
|
|
1342
1329
|
},
|
|
1343
1330
|
children: [
|
|
1344
1331
|
/* @__PURE__ */ f(
|
|
@@ -1346,78 +1333,78 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
1346
1333
|
{
|
|
1347
1334
|
flexDirection: "row",
|
|
1348
1335
|
justifyContent: "space-between",
|
|
1349
|
-
sx: { pb:
|
|
1336
|
+
sx: { pb: c ? 12 : 24, pt: c ? 24 : 48 },
|
|
1350
1337
|
children: [
|
|
1351
1338
|
/* @__PURE__ */ e(
|
|
1352
|
-
|
|
1339
|
+
et,
|
|
1353
1340
|
{
|
|
1354
|
-
selectedCategoryGuid:
|
|
1355
|
-
selectedDateRange:
|
|
1341
|
+
selectedCategoryGuid: $,
|
|
1342
|
+
selectedDateRange: i
|
|
1356
1343
|
}
|
|
1357
1344
|
),
|
|
1358
|
-
/* @__PURE__ */ e(
|
|
1345
|
+
/* @__PURE__ */ e(Je, { onTabChange: de, selectedTab: q })
|
|
1359
1346
|
]
|
|
1360
1347
|
}
|
|
1361
1348
|
),
|
|
1362
|
-
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(
|
|
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: [
|
|
1363
1350
|
/* @__PURE__ */ e(fe, { name: "arrow_back" }),
|
|
1364
|
-
|
|
1351
|
+
M.all_categories
|
|
1365
1352
|
] }) }) }),
|
|
1366
|
-
/* @__PURE__ */ f(b, { flexDirection:
|
|
1367
|
-
|
|
1368
|
-
/* @__PURE__ */ e(
|
|
1369
|
-
|
|
1353
|
+
/* @__PURE__ */ f(b, { flexDirection: B ? "row" : "column", gap: B ? 48 : 16, children: [
|
|
1354
|
+
q === "Chart" && /* @__PURE__ */ f(rt, { children: [
|
|
1355
|
+
/* @__PURE__ */ e(N, { sx: { width: B ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
1356
|
+
Lo,
|
|
1370
1357
|
{
|
|
1371
|
-
availableHeight:
|
|
1358
|
+
availableHeight: F,
|
|
1372
1359
|
minHeight: 450,
|
|
1373
|
-
selectedDateRange:
|
|
1374
|
-
totals:
|
|
1360
|
+
selectedDateRange: i,
|
|
1361
|
+
totals: _
|
|
1375
1362
|
}
|
|
1376
1363
|
) }),
|
|
1377
|
-
/* @__PURE__ */ f(b, { gap: 16, sx: { width:
|
|
1378
|
-
|
|
1379
|
-
|
|
1364
|
+
/* @__PURE__ */ f(b, { gap: 16, sx: { width: B ? "32%" : "100%" }, children: [
|
|
1365
|
+
ne && Z && I.length > 0 && /* @__PURE__ */ e(
|
|
1366
|
+
xo,
|
|
1380
1367
|
{
|
|
1381
|
-
beats:
|
|
1368
|
+
beats: I,
|
|
1382
1369
|
onInsightCardClick: r
|
|
1383
1370
|
}
|
|
1384
1371
|
),
|
|
1385
1372
|
/* @__PURE__ */ e(
|
|
1386
|
-
|
|
1373
|
+
So,
|
|
1387
1374
|
{
|
|
1388
|
-
availableHeight:
|
|
1389
|
-
onCategoryClick:
|
|
1375
|
+
availableHeight: le,
|
|
1376
|
+
onCategoryClick: Y
|
|
1390
1377
|
}
|
|
1391
1378
|
)
|
|
1392
1379
|
] })
|
|
1393
1380
|
] }),
|
|
1394
|
-
|
|
1395
|
-
|
|
1381
|
+
q === "Table" && /* @__PURE__ */ e(N, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1382
|
+
tt,
|
|
1396
1383
|
{
|
|
1397
1384
|
height: "unset",
|
|
1398
|
-
monthlyCategoryTotals:
|
|
1399
|
-
onClickRow:
|
|
1400
|
-
selectedCategory:
|
|
1401
|
-
selectedDateRange:
|
|
1385
|
+
monthlyCategoryTotals: _,
|
|
1386
|
+
onClickRow: ot,
|
|
1387
|
+
selectedCategory: $,
|
|
1388
|
+
selectedDateRange: i
|
|
1402
1389
|
}
|
|
1403
1390
|
) })
|
|
1404
1391
|
] }),
|
|
1405
|
-
|
|
1392
|
+
se && /* @__PURE__ */ e(wo, { onClose: De })
|
|
1406
1393
|
]
|
|
1407
1394
|
}
|
|
1408
1395
|
),
|
|
1409
1396
|
/* @__PURE__ */ e(
|
|
1410
|
-
|
|
1397
|
+
eo,
|
|
1411
1398
|
{
|
|
1412
1399
|
onClose: () => ye(!1),
|
|
1413
|
-
showConnectWidget:
|
|
1414
|
-
title:
|
|
1400
|
+
showConnectWidget: we,
|
|
1401
|
+
title: R.mini_title
|
|
1415
1402
|
}
|
|
1416
1403
|
)
|
|
1417
1404
|
]
|
|
1418
1405
|
}
|
|
1419
1406
|
);
|
|
1420
|
-
}, Nn =
|
|
1407
|
+
}, Nn = k(Ao);
|
|
1421
1408
|
export {
|
|
1422
1409
|
Rn as TrendsFullWidget,
|
|
1423
1410
|
Hn as TrendsMicroWidget,
|