@mx-cartographer/experiences 7.2.16 → 7.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-5i3IywCi.mjs} +238 -236
- package/dist/accounts/index.es.js +117 -115
- package/dist/budgets/index.es.js +501 -499
- package/dist/cashflow/index.es.js +383 -381
- package/dist/debts/index.es.js +377 -375
- package/dist/finstrong/index.es.js +417 -415
- package/dist/goals/index.es.js +559 -557
- package/dist/investments/index.es.js +436 -434
- package/dist/networth/index.es.js +173 -171
- package/dist/notifications/index.es.js +1 -1
- package/dist/recurringtransactions/index.es.js +173 -171
- package/dist/settings/index.es.js +284 -278
- package/dist/spending/index.es.js +282 -280
- package/package.json +1 -1
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
import { jsxs as h, jsx as t, Fragment as
|
|
1
|
+
import { jsxs as h, jsx as t, Fragment as ht } from "react/jsx-runtime";
|
|
2
2
|
import p from "react";
|
|
3
|
-
import { observer as
|
|
4
|
-
import { startOfMonth as
|
|
5
|
-
import { endOfMonth as
|
|
6
|
-
import
|
|
3
|
+
import { observer as I } from "mobx-react-lite";
|
|
4
|
+
import { startOfMonth as ot } from "date-fns/startOfMonth";
|
|
5
|
+
import { endOfMonth as at } from "date-fns/endOfMonth";
|
|
6
|
+
import w from "@mui/material/Box";
|
|
7
7
|
import C from "@mui/material/Stack";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import L from "@mui/material/Tab";
|
|
9
|
+
import it from "@mui/material/Tabs";
|
|
10
|
+
import ft from "@mui/material/styles/useTheme";
|
|
11
11
|
import { b as V } from "../CategoryUtil-BR3H5i6n.mjs";
|
|
12
|
-
import { b as
|
|
13
|
-
import { Text as y, CategoryIcon as
|
|
14
|
-
import { f as
|
|
15
|
-
import { u as
|
|
16
|
-
import
|
|
17
|
-
import { useTheme as
|
|
18
|
-
import { u as
|
|
19
|
-
import { u as
|
|
20
|
-
import { D as
|
|
12
|
+
import { b as _ } from "../Category-CevNQ03n.mjs";
|
|
13
|
+
import { Text as y, CategoryIcon as yt, CategoryIconVariants as bt } from "@mxenabled/mxui";
|
|
14
|
+
import { f as v } from "../NumberFormatting-Buh7u8Oi.mjs";
|
|
15
|
+
import { u as Ct } from "../useAriaLive-B3_pRUio.mjs";
|
|
16
|
+
import _t from "@mui/material/Button";
|
|
17
|
+
import { useTheme as rt } from "@mui/material";
|
|
18
|
+
import { u as E, b as O, m as z, d as st, n as St, a as lt, h as Tt, g as Mt } from "../hooks-D6XlXHf4.mjs";
|
|
19
|
+
import { u as ct } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
20
|
+
import { D as Dt } from "../Donut-oaQFlbit.mjs";
|
|
21
21
|
import { L as F } from "../Loader-DUaFpDGv.mjs";
|
|
22
|
-
import { M as
|
|
23
|
-
import { startOfToday as
|
|
24
|
-
import { T as
|
|
25
|
-
import
|
|
22
|
+
import { M as xt } from "../MiniWidgetContainer-D0gfmbaF.mjs";
|
|
23
|
+
import { startOfToday as q } from "date-fns/startOfToday";
|
|
24
|
+
import { T as wt, a as vt } from "../TransactionDetails-CDtya0KS.mjs";
|
|
25
|
+
import It from "@mui/material/Collapse";
|
|
26
26
|
import B from "@mui/material/Divider";
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import { D as
|
|
31
|
-
import { A as
|
|
32
|
-
const j = 5,
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
const
|
|
27
|
+
import J from "@mui/material/List";
|
|
28
|
+
import Q from "@mui/material/ListItem";
|
|
29
|
+
import Et from "@mui/material/ListItemButton";
|
|
30
|
+
import { D as Z } from "../Drawer-kEE73B87.mjs";
|
|
31
|
+
import { A as tt, W as At } from "../WidgetContainer-EbrN1oIo.mjs";
|
|
32
|
+
const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
|
|
33
|
+
if (n.total > 0) {
|
|
34
|
+
const a = o.find((s) => s.guid === n.category_guid);
|
|
35
|
+
if (!a) return l;
|
|
36
|
+
const i = a.parent_guid ?? a.guid, e = o.find((s) => s.guid === i);
|
|
37
37
|
if (!e) return l;
|
|
38
|
-
const
|
|
39
|
-
guid:
|
|
40
|
-
name:
|
|
41
|
-
color: V(e.guid,
|
|
42
|
-
amount:
|
|
43
|
-
}, u = l.find((s) => s.guid ===
|
|
44
|
-
u ? (u.amount +=
|
|
45
|
-
guid:
|
|
38
|
+
const c = {
|
|
39
|
+
guid: a.guid,
|
|
40
|
+
name: a.guid === i ? `General ${a.name}` : a.name,
|
|
41
|
+
color: V(e.guid, d),
|
|
42
|
+
amount: n.total
|
|
43
|
+
}, u = l.find((s) => s.guid === i);
|
|
44
|
+
u ? (u.amount += n.total, u.categoryTotals?.push(c)) : l.push({
|
|
45
|
+
guid: i,
|
|
46
46
|
name: e.name,
|
|
47
|
-
color: V(e.guid,
|
|
48
|
-
categoryTotals: [
|
|
49
|
-
amount:
|
|
47
|
+
color: V(e.guid, d),
|
|
48
|
+
categoryTotals: [c],
|
|
49
|
+
amount: n.total
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
return l;
|
|
53
|
-
}, []),
|
|
54
|
-
const
|
|
55
|
-
(s) => s.guid !==
|
|
56
|
-
).sort((s, m) => m.amount - s.amount),
|
|
53
|
+
}, []), dt = (o, d, r, l) => {
|
|
54
|
+
const n = Lt(o, r, l), a = n.filter(
|
|
55
|
+
(s) => s.guid !== _.INCOME && s.guid !== _.INVESTMENTS && s.guid !== _.TRANSFER
|
|
56
|
+
).sort((s, m) => m.amount - s.amount), i = a.reduce(
|
|
57
57
|
(s, m) => s + m.amount,
|
|
58
58
|
0
|
|
59
|
-
), e =
|
|
59
|
+
), e = a.length > j ? j : a.length, c = a.slice(0, e), u = c.map((s) => ({
|
|
60
60
|
id: s.guid,
|
|
61
61
|
color: V(s.guid, r),
|
|
62
62
|
label: s.name,
|
|
63
|
-
value: s.amount /
|
|
63
|
+
value: s.amount / i * 100
|
|
64
64
|
}));
|
|
65
|
-
if (
|
|
66
|
-
const s =
|
|
67
|
-
(
|
|
65
|
+
if (a.length > 5) {
|
|
66
|
+
const s = a.slice(j, n.length), m = s.reduce(
|
|
67
|
+
(S, g) => S + g.amount,
|
|
68
68
|
0
|
|
69
69
|
);
|
|
70
|
-
|
|
70
|
+
c.push({
|
|
71
71
|
guid: "other",
|
|
72
72
|
color: r.palette.categories.others || "",
|
|
73
|
-
name:
|
|
73
|
+
name: d.saving_goal_other,
|
|
74
74
|
categoryTotals: s,
|
|
75
75
|
amount: m
|
|
76
76
|
}), u.push({
|
|
77
77
|
id: "other",
|
|
78
78
|
color: r.palette.categories.others || "",
|
|
79
|
-
label:
|
|
80
|
-
value: m /
|
|
79
|
+
label: d.saving_goal_other,
|
|
80
|
+
value: m / i * 100
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
return {
|
|
84
|
-
categoryData:
|
|
84
|
+
categoryData: c,
|
|
85
85
|
donutData: u,
|
|
86
|
-
totalAmount:
|
|
86
|
+
totalAmount: i
|
|
87
87
|
};
|
|
88
|
-
},
|
|
89
|
-
const l =
|
|
90
|
-
(e) => e.guid ===
|
|
91
|
-
),
|
|
88
|
+
}, gt = (o, d, r) => {
|
|
89
|
+
const l = o.filter(
|
|
90
|
+
(e) => e.guid === _.INCOME || e.parent_guid === _.INCOME
|
|
91
|
+
), n = d.filter((e) => l.some((c) => c.guid === e.category_guid)).sort((e, c) => e.total - c.total).map((e, c) => ({
|
|
92
92
|
guid: e.category_guid,
|
|
93
|
-
name:
|
|
94
|
-
color: r[
|
|
93
|
+
name: o.find((u) => u.guid === e.category_guid)?.name,
|
|
94
|
+
color: r[c],
|
|
95
95
|
categoryTotals: [],
|
|
96
96
|
amount: Math.abs(e.total)
|
|
97
|
-
})),
|
|
98
|
-
(e,
|
|
97
|
+
})), a = n.reduce(
|
|
98
|
+
(e, c) => e + c.amount,
|
|
99
99
|
0
|
|
100
|
-
),
|
|
100
|
+
), i = n.map((e) => ({
|
|
101
101
|
id: e.guid,
|
|
102
102
|
color: e.color,
|
|
103
103
|
label: e.name,
|
|
104
|
-
value: e.amount /
|
|
104
|
+
value: e.amount / a * 100
|
|
105
105
|
}));
|
|
106
106
|
return {
|
|
107
|
-
categoryData:
|
|
108
|
-
donutData:
|
|
109
|
-
totalAmount:
|
|
107
|
+
categoryData: n,
|
|
108
|
+
donutData: i,
|
|
109
|
+
totalAmount: a
|
|
110
110
|
};
|
|
111
|
-
},
|
|
112
|
-
/* @__PURE__ */ t(y, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children:
|
|
113
|
-
/* @__PURE__ */ t(y, { variant: "XSmall", children:
|
|
114
|
-
] }),
|
|
115
|
-
data:
|
|
116
|
-
isIncome:
|
|
111
|
+
}, N = ({ amount: o, label: d }) => /* @__PURE__ */ h(C, { direction: "column", children: [
|
|
112
|
+
/* @__PURE__ */ t(y, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
|
|
113
|
+
/* @__PURE__ */ t(y, { variant: "XSmall", children: v(o, "0,0") })
|
|
114
|
+
] }), Nt = ({
|
|
115
|
+
data: o,
|
|
116
|
+
isIncome: d = !1,
|
|
117
117
|
onSelected: r,
|
|
118
118
|
onViewTransactions: l,
|
|
119
|
-
selectedId:
|
|
120
|
-
size:
|
|
121
|
-
totalLabel:
|
|
119
|
+
selectedId: n,
|
|
120
|
+
size: a = 150,
|
|
121
|
+
totalLabel: i,
|
|
122
122
|
variant: e = "mini"
|
|
123
123
|
}) => {
|
|
124
|
-
const { spending:
|
|
125
|
-
() =>
|
|
126
|
-
[
|
|
124
|
+
const { spending: c } = E(), u = rt(), { isTablet: s } = ct(), { announce: m, ariaLive: S } = Ct(), g = p.useMemo(
|
|
125
|
+
() => n ? o.categoryData.find((b) => b.guid === n) : void 0,
|
|
126
|
+
[n]
|
|
127
127
|
);
|
|
128
128
|
p.useEffect(() => {
|
|
129
129
|
if (g) {
|
|
130
|
-
const
|
|
131
|
-
m(`${g.name}: ${
|
|
130
|
+
const b = v(g.amount, "0,0");
|
|
131
|
+
m(`${g.name}: ${b}`);
|
|
132
132
|
}
|
|
133
133
|
}, [g, m]);
|
|
134
|
-
const
|
|
135
|
-
l?.(
|
|
136
|
-
},
|
|
137
|
-
return /* @__PURE__ */ h(
|
|
138
|
-
|
|
139
|
-
/* @__PURE__ */ t(
|
|
134
|
+
const T = p.useMemo(() => o.donutData.length > 0 ? o.donutData : [{ id: "0", color: u.palette.divider, value: 100 }], [o, u]), x = () => {
|
|
135
|
+
l?.(n);
|
|
136
|
+
}, D = s ? 32 : 48;
|
|
137
|
+
return /* @__PURE__ */ h(ht, { children: [
|
|
138
|
+
S,
|
|
139
|
+
/* @__PURE__ */ t(Dt, { data: T, onClick: r, selectedId: n, size: a, children: /* @__PURE__ */ t(C, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ h(C, { alignItems: "center", justifyContent: "center", minHeight: a, minWidth: a, children: [
|
|
140
140
|
g && /* @__PURE__ */ h(
|
|
141
141
|
C,
|
|
142
142
|
{
|
|
@@ -147,11 +147,11 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
147
147
|
sx: e === "mini" ? { gap: 0, mb: 0 } : { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } },
|
|
148
148
|
children: [
|
|
149
149
|
/* @__PURE__ */ t(
|
|
150
|
-
|
|
150
|
+
yt,
|
|
151
151
|
{
|
|
152
|
-
categoryGuid:
|
|
153
|
-
size: e === "mini" ? 24 :
|
|
154
|
-
variant:
|
|
152
|
+
categoryGuid: d ? _.INCOME : g.guid,
|
|
153
|
+
size: e === "mini" ? 24 : D,
|
|
154
|
+
variant: bt.Transparent
|
|
155
155
|
}
|
|
156
156
|
),
|
|
157
157
|
/* @__PURE__ */ t(
|
|
@@ -160,103 +160,103 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
160
160
|
color: "secondary",
|
|
161
161
|
noWrap: !0,
|
|
162
162
|
variant: e === "mini" ? "Tiny" : "Body",
|
|
163
|
-
children: g ? g.name :
|
|
163
|
+
children: g ? g.name : i
|
|
164
164
|
}
|
|
165
165
|
)
|
|
166
166
|
]
|
|
167
167
|
}
|
|
168
168
|
),
|
|
169
|
-
!g && e === "full" && /* @__PURE__ */ t(y, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children:
|
|
170
|
-
/* @__PURE__ */ t(y, { variant: e === "mini" ? "H2" : "H1", children: g ?
|
|
171
|
-
!g && e === "mini" && /* @__PURE__ */ t(y, { color: "secondary", noWrap: !0, variant: "Tiny", children:
|
|
169
|
+
!g && e === "full" && /* @__PURE__ */ t(y, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: i }),
|
|
170
|
+
/* @__PURE__ */ t(y, { variant: e === "mini" ? "H2" : "H1", children: g ? v(g.amount, "0,0") : v(o.totalAmount, "0,0") }),
|
|
171
|
+
!g && e === "mini" && /* @__PURE__ */ t(y, { color: "secondary", noWrap: !0, variant: "Tiny", children: i }),
|
|
172
172
|
e === "full" && /* @__PURE__ */ t(
|
|
173
|
-
|
|
173
|
+
_t,
|
|
174
174
|
{
|
|
175
175
|
"aria-label": `View ${g?.name || ""} Transactions`,
|
|
176
|
-
disabled:
|
|
177
|
-
onClick:
|
|
176
|
+
disabled: o.categoryData.length === 0,
|
|
177
|
+
onClick: x,
|
|
178
178
|
sx: { mt: { xl: 4, xs: 0 }, zIndex: 1 },
|
|
179
179
|
variant: "text",
|
|
180
|
-
children:
|
|
180
|
+
children: c.view_transactions
|
|
181
181
|
}
|
|
182
182
|
)
|
|
183
183
|
] }) }) })
|
|
184
184
|
] });
|
|
185
|
-
},
|
|
186
|
-
const l = (
|
|
187
|
-
(
|
|
185
|
+
}, W = I(Nt), et = ({ data: o, onSelected: d, selectedId: r }) => {
|
|
186
|
+
const l = (n, a) => {
|
|
187
|
+
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), d(a));
|
|
188
188
|
};
|
|
189
|
-
return /* @__PURE__ */ t(C, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children:
|
|
189
|
+
return /* @__PURE__ */ t(C, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: o.categoryData.map((n) => /* @__PURE__ */ h(
|
|
190
190
|
C,
|
|
191
191
|
{
|
|
192
192
|
alignItems: "center",
|
|
193
|
-
"aria-label":
|
|
194
|
-
"aria-pressed":
|
|
193
|
+
"aria-label": n.name,
|
|
194
|
+
"aria-pressed": n.guid === r,
|
|
195
195
|
direction: "row",
|
|
196
196
|
gap: 8,
|
|
197
|
-
onClick: () =>
|
|
198
|
-
onKeyDown: (
|
|
197
|
+
onClick: () => d(n.guid),
|
|
198
|
+
onKeyDown: (a) => l(a, n.guid),
|
|
199
199
|
role: "button",
|
|
200
200
|
sx: { cursor: "pointer" },
|
|
201
201
|
tabIndex: 0,
|
|
202
202
|
children: [
|
|
203
|
-
/* @__PURE__ */ t(
|
|
204
|
-
/* @__PURE__ */ t(y, { bold:
|
|
203
|
+
/* @__PURE__ */ t(w, { borderRadius: 4, height: 8, sx: { backgroundColor: n.color }, width: 8 }),
|
|
204
|
+
/* @__PURE__ */ t(y, { bold: n.guid === r, variant: "XSmall", children: n.name })
|
|
205
205
|
]
|
|
206
206
|
},
|
|
207
|
-
|
|
207
|
+
n.guid
|
|
208
208
|
)) });
|
|
209
|
-
},
|
|
210
|
-
const
|
|
211
|
-
categories:
|
|
212
|
-
dateRangeCategoryTotals:
|
|
213
|
-
dataRangeTotalsLoaded:
|
|
209
|
+
}, Wt = () => {
|
|
210
|
+
const o = ft(), { goals: d, spending: r } = E(), { selectedAccounts: l } = O(), {
|
|
211
|
+
categories: n,
|
|
212
|
+
dateRangeCategoryTotals: a,
|
|
213
|
+
dataRangeTotalsLoaded: i,
|
|
214
214
|
loadDateRangeCategoryTotals: e
|
|
215
|
-
} = z(),
|
|
215
|
+
} = z(), c = p.useMemo(
|
|
216
216
|
() => [
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
217
|
+
o.palette.chartMono.chartMono5,
|
|
218
|
+
o.palette.chartMono.chartMono4,
|
|
219
|
+
o.palette.chartMono.chartMono3,
|
|
220
|
+
o.palette.chartMono.chartMono2,
|
|
221
|
+
o.palette.chartMono.chartMono1,
|
|
222
|
+
o.palette.chartMono.chartMono6
|
|
223
223
|
],
|
|
224
|
-
[
|
|
224
|
+
[o]
|
|
225
225
|
);
|
|
226
226
|
p.useEffect(() => {
|
|
227
227
|
e(
|
|
228
228
|
l,
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
ot(/* @__PURE__ */ new Date()),
|
|
230
|
+
at(/* @__PURE__ */ new Date())
|
|
231
231
|
).finally();
|
|
232
232
|
}, [l]);
|
|
233
|
-
const [u, s] = p.useState(""), [m,
|
|
234
|
-
() =>
|
|
235
|
-
[
|
|
236
|
-
),
|
|
237
|
-
() =>
|
|
238
|
-
[
|
|
239
|
-
),
|
|
240
|
-
|
|
241
|
-
},
|
|
242
|
-
s(u ===
|
|
233
|
+
const [u, s] = p.useState(""), [m, S] = p.useState(0), g = p.useMemo(
|
|
234
|
+
() => dt(n, d, o, a),
|
|
235
|
+
[n, a]
|
|
236
|
+
), T = p.useMemo(
|
|
237
|
+
() => gt(n, a, c),
|
|
238
|
+
[n, a, c]
|
|
239
|
+
), x = (b, R) => {
|
|
240
|
+
S(R), s("");
|
|
241
|
+
}, D = (b) => {
|
|
242
|
+
s(u === b ? "" : b);
|
|
243
243
|
};
|
|
244
|
-
return
|
|
244
|
+
return i ? /* @__PURE__ */ h(w, { width: "100%", children: [
|
|
245
245
|
/* @__PURE__ */ h(
|
|
246
|
-
|
|
246
|
+
it,
|
|
247
247
|
{
|
|
248
248
|
"aria-label": r.mini_title,
|
|
249
|
-
onChange:
|
|
249
|
+
onChange: x,
|
|
250
250
|
value: m,
|
|
251
251
|
variant: "fullWidth",
|
|
252
252
|
children: [
|
|
253
253
|
/* @__PURE__ */ t(
|
|
254
|
-
|
|
254
|
+
L,
|
|
255
255
|
{
|
|
256
256
|
"aria-controls": "spending-tabpanel",
|
|
257
257
|
id: "spending-tab",
|
|
258
258
|
label: /* @__PURE__ */ t(
|
|
259
|
-
|
|
259
|
+
N,
|
|
260
260
|
{
|
|
261
261
|
amount: g.totalAmount,
|
|
262
262
|
label: r.spend_tab_title
|
|
@@ -266,14 +266,14 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
266
266
|
}
|
|
267
267
|
),
|
|
268
268
|
/* @__PURE__ */ t(
|
|
269
|
-
|
|
269
|
+
L,
|
|
270
270
|
{
|
|
271
271
|
"aria-controls": "income-tabpanel",
|
|
272
272
|
id: "income-tab",
|
|
273
273
|
label: /* @__PURE__ */ t(
|
|
274
|
-
|
|
274
|
+
N,
|
|
275
275
|
{
|
|
276
|
-
amount:
|
|
276
|
+
amount: T.totalAmount,
|
|
277
277
|
label: r.income_tab_title
|
|
278
278
|
}
|
|
279
279
|
),
|
|
@@ -284,7 +284,7 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
284
284
|
}
|
|
285
285
|
),
|
|
286
286
|
/* @__PURE__ */ t(
|
|
287
|
-
|
|
287
|
+
w,
|
|
288
288
|
{
|
|
289
289
|
"aria-labelledby": "spending-tab",
|
|
290
290
|
hidden: m !== 0,
|
|
@@ -292,20 +292,20 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
292
292
|
role: "tabpanel",
|
|
293
293
|
children: /* @__PURE__ */ h(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
294
294
|
/* @__PURE__ */ t(
|
|
295
|
-
|
|
295
|
+
W,
|
|
296
296
|
{
|
|
297
297
|
data: g,
|
|
298
|
-
onSelected:
|
|
298
|
+
onSelected: D,
|
|
299
299
|
selectedId: u,
|
|
300
300
|
totalLabel: r.total_spending
|
|
301
301
|
}
|
|
302
302
|
),
|
|
303
|
-
/* @__PURE__ */ t(
|
|
303
|
+
/* @__PURE__ */ t(et, { data: g, onSelected: D, selectedId: u })
|
|
304
304
|
] })
|
|
305
305
|
}
|
|
306
306
|
),
|
|
307
307
|
/* @__PURE__ */ t(
|
|
308
|
-
|
|
308
|
+
w,
|
|
309
309
|
{
|
|
310
310
|
"aria-labelledby": "income-tab",
|
|
311
311
|
hidden: m !== 1,
|
|
@@ -313,48 +313,48 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
313
313
|
role: "tabpanel",
|
|
314
314
|
children: /* @__PURE__ */ h(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
315
315
|
/* @__PURE__ */ t(
|
|
316
|
-
|
|
316
|
+
W,
|
|
317
317
|
{
|
|
318
|
-
data:
|
|
318
|
+
data: T,
|
|
319
319
|
isIncome: !0,
|
|
320
|
-
onSelected:
|
|
320
|
+
onSelected: D,
|
|
321
321
|
selectedId: u,
|
|
322
322
|
totalLabel: r.total_income
|
|
323
323
|
}
|
|
324
324
|
),
|
|
325
|
-
/* @__PURE__ */ t(
|
|
325
|
+
/* @__PURE__ */ t(et, { data: T, onSelected: D, selectedId: u })
|
|
326
326
|
] })
|
|
327
327
|
}
|
|
328
328
|
)
|
|
329
329
|
] }) : /* @__PURE__ */ t(F, { height: 250 });
|
|
330
|
-
},
|
|
331
|
-
const { visibleAccounts: r } =
|
|
330
|
+
}, Ot = I(Wt), Rt = ({ onPrimaryCtaClick: o, sx: d = {} }) => {
|
|
331
|
+
const { visibleAccounts: r } = st(), { spending: l } = E(), { isCopyLoaded: n, isInitialized: a, setSelectedAccounts: i } = O();
|
|
332
332
|
return p.useEffect(() => {
|
|
333
|
-
|
|
334
|
-
}, [r]), !
|
|
335
|
-
|
|
333
|
+
i(r);
|
|
334
|
+
}, [r]), !n || !a ? /* @__PURE__ */ t(F, {}) : /* @__PURE__ */ t(
|
|
335
|
+
xt,
|
|
336
336
|
{
|
|
337
337
|
className: "mx-exp-spending-miniwidget",
|
|
338
|
-
onPrimaryCtaClick:
|
|
338
|
+
onPrimaryCtaClick: o,
|
|
339
339
|
primaryCtaLabel: l.primary_cta,
|
|
340
|
-
sx:
|
|
340
|
+
sx: d,
|
|
341
341
|
title: l.mini_title,
|
|
342
|
-
children: /* @__PURE__ */ t(
|
|
342
|
+
children: /* @__PURE__ */ t(Ot, {})
|
|
343
343
|
}
|
|
344
344
|
);
|
|
345
|
-
},
|
|
346
|
-
data:
|
|
347
|
-
onSelected:
|
|
345
|
+
}, _e = I(Rt), kt = ({
|
|
346
|
+
data: o,
|
|
347
|
+
onSelected: d,
|
|
348
348
|
selectedId: r = "",
|
|
349
349
|
title: l
|
|
350
350
|
}) => {
|
|
351
|
-
const { spending:
|
|
351
|
+
const { spending: n } = E(), a = o.categoryData.find((i) => i.guid === r);
|
|
352
352
|
return /* @__PURE__ */ h(C, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
|
|
353
|
-
/* @__PURE__ */ t(y, { bold: !0, sx: { py: 12 }, children: `${l} ${
|
|
353
|
+
/* @__PURE__ */ t(y, { bold: !0, sx: { py: 12 }, children: `${l} ${n.by_category}` }),
|
|
354
354
|
/* @__PURE__ */ t(B, { "aria-hidden": "true" }),
|
|
355
|
-
/* @__PURE__ */ t(
|
|
355
|
+
/* @__PURE__ */ t(J, { children: o.categoryData.map((i) => /* @__PURE__ */ h(p.Fragment, { children: [
|
|
356
356
|
/* @__PURE__ */ t(
|
|
357
|
-
|
|
357
|
+
Q,
|
|
358
358
|
{
|
|
359
359
|
disableGutters: !0,
|
|
360
360
|
disablePadding: !0,
|
|
@@ -362,19 +362,19 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
362
362
|
minHeight: 44
|
|
363
363
|
},
|
|
364
364
|
children: /* @__PURE__ */ h(
|
|
365
|
-
|
|
365
|
+
Et,
|
|
366
366
|
{
|
|
367
|
-
"aria-expanded":
|
|
368
|
-
onClick: () =>
|
|
367
|
+
"aria-expanded": a?.guid === i.guid,
|
|
368
|
+
onClick: () => d(i.guid),
|
|
369
369
|
sx: { minHeight: 44, px: 8, py: 0 },
|
|
370
370
|
children: [
|
|
371
371
|
/* @__PURE__ */ t(
|
|
372
|
-
|
|
372
|
+
w,
|
|
373
373
|
{
|
|
374
374
|
borderRadius: 4,
|
|
375
375
|
flexShrink: 0,
|
|
376
376
|
height: 8,
|
|
377
|
-
sx: { backgroundColor:
|
|
377
|
+
sx: { backgroundColor: i.color, mr: 8 },
|
|
378
378
|
width: 8
|
|
379
379
|
}
|
|
380
380
|
),
|
|
@@ -386,8 +386,8 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
386
386
|
justifyContent: "space-between",
|
|
387
387
|
width: "100%",
|
|
388
388
|
children: [
|
|
389
|
-
/* @__PURE__ */ t(y, { bold: r ===
|
|
390
|
-
/* @__PURE__ */ t(y, { bold: r ===
|
|
389
|
+
/* @__PURE__ */ t(y, { bold: r === i.guid, children: i.name }),
|
|
390
|
+
/* @__PURE__ */ t(y, { bold: r === i.guid, variant: "Body", children: v(i.amount, "0,0") })
|
|
391
391
|
]
|
|
392
392
|
}
|
|
393
393
|
)
|
|
@@ -397,9 +397,9 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
397
397
|
}
|
|
398
398
|
),
|
|
399
399
|
/* @__PURE__ */ t(B, {}),
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
400
|
+
i.categoryTotals && i.categoryTotals.length > 0 && /* @__PURE__ */ t(It, { in: a?.guid === i.guid, unmountOnExit: !0, children: /* @__PURE__ */ h(J, { children: [
|
|
401
|
+
a?.categoryTotals?.map((e) => /* @__PURE__ */ t(
|
|
402
|
+
Q,
|
|
403
403
|
{
|
|
404
404
|
sx: {
|
|
405
405
|
pl: 24,
|
|
@@ -411,36 +411,36 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
411
411
|
e.name,
|
|
412
412
|
" "
|
|
413
413
|
] }),
|
|
414
|
-
/* @__PURE__ */ t(y, { children:
|
|
414
|
+
/* @__PURE__ */ t(y, { children: v(e.amount, "0,0") })
|
|
415
415
|
] })
|
|
416
416
|
},
|
|
417
417
|
e.guid
|
|
418
418
|
)),
|
|
419
419
|
/* @__PURE__ */ t(B, {})
|
|
420
420
|
] }) })
|
|
421
|
-
] },
|
|
422
|
-
/* @__PURE__ */ t(y, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${
|
|
421
|
+
] }, i.guid)) }),
|
|
422
|
+
/* @__PURE__ */ t(y, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${n.total}: ${v(o.totalAmount, "0,0")}` })
|
|
423
423
|
] });
|
|
424
|
-
},
|
|
425
|
-
data:
|
|
426
|
-
onSelected:
|
|
424
|
+
}, $t = I(kt), Gt = ({
|
|
425
|
+
data: o,
|
|
426
|
+
onSelected: d,
|
|
427
427
|
onViewTransactions: r,
|
|
428
428
|
selectedId: l,
|
|
429
|
-
title:
|
|
429
|
+
title: n
|
|
430
430
|
}) => {
|
|
431
|
-
const { isDesktop:
|
|
431
|
+
const { isDesktop: a, isMobile: i } = ct(), { isLoadingCategoryTotals: e } = z(), { spending: c } = E();
|
|
432
432
|
return /* @__PURE__ */ h(
|
|
433
433
|
C,
|
|
434
434
|
{
|
|
435
|
-
alignItems:
|
|
436
|
-
direction:
|
|
435
|
+
alignItems: i ? "center" : "flex-start",
|
|
436
|
+
direction: i ? "column" : "row",
|
|
437
437
|
gap: { xs: 16, md: 64, xl: 100 },
|
|
438
438
|
justifyContent: "center",
|
|
439
439
|
pt: 50,
|
|
440
440
|
px: 8,
|
|
441
441
|
children: [
|
|
442
442
|
e && /* @__PURE__ */ t(
|
|
443
|
-
|
|
443
|
+
W,
|
|
444
444
|
{
|
|
445
445
|
data: {
|
|
446
446
|
categoryData: [],
|
|
@@ -450,173 +450,175 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
450
450
|
onSelected: () => {
|
|
451
451
|
},
|
|
452
452
|
selectedId: "",
|
|
453
|
-
size:
|
|
453
|
+
size: a ? 400 : 300,
|
|
454
454
|
totalLabel: "Loading ...",
|
|
455
455
|
variant: "full"
|
|
456
456
|
}
|
|
457
457
|
),
|
|
458
458
|
!e && /* @__PURE__ */ t(
|
|
459
|
-
|
|
459
|
+
W,
|
|
460
460
|
{
|
|
461
|
-
data:
|
|
462
|
-
onSelected:
|
|
461
|
+
data: o,
|
|
462
|
+
onSelected: d,
|
|
463
463
|
onViewTransactions: r,
|
|
464
464
|
selectedId: l,
|
|
465
|
-
size:
|
|
466
|
-
totalLabel:
|
|
465
|
+
size: a ? 400 : 300,
|
|
466
|
+
totalLabel: c.total_amount,
|
|
467
467
|
variant: "full"
|
|
468
468
|
}
|
|
469
469
|
),
|
|
470
|
-
/* @__PURE__ */ t(
|
|
470
|
+
/* @__PURE__ */ t($t, { data: o, onSelected: d, selectedId: l, title: n })
|
|
471
471
|
]
|
|
472
472
|
}
|
|
473
473
|
);
|
|
474
|
-
},
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
],
|
|
482
|
-
const
|
|
474
|
+
}, nt = I(Gt), Bt = (o) => [
|
|
475
|
+
o.palette.chartMono.chartMono5,
|
|
476
|
+
o.palette.chartMono.chartMono4,
|
|
477
|
+
o.palette.chartMono.chartMono3,
|
|
478
|
+
o.palette.chartMono.chartMono2,
|
|
479
|
+
o.palette.chartMono.chartMono1,
|
|
480
|
+
o.palette.chartMono.chartMono6
|
|
481
|
+
], jt = () => {
|
|
482
|
+
const o = rt(), { onLoad: d } = St(), { clientConfig: r } = lt(), { categories: l, dateRangeCategoryTotals: n, loadDateRangeCategoryTotals: a } = z(), { goals: i, spending: e } = E(), { displayedDateRange: c, selectedAccounts: u, selectedAccountGuids: s } = O(), { setFilter: m, sortedTransactions: S } = Tt(), g = r?.master?.deep_link_params?.account_guids, T = r?.master?.deep_link_params?.view, [x, D] = p.useState(""), [b, R] = p.useState(T === "income" ? 1 : 0), [H, P] = p.useState(""), [ut, K] = p.useState(!1);
|
|
483
483
|
p.useEffect(() => {
|
|
484
484
|
a(
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
).finally()
|
|
489
|
-
|
|
485
|
+
u,
|
|
486
|
+
c.start,
|
|
487
|
+
c.end
|
|
488
|
+
).finally(() => {
|
|
489
|
+
d?.("SpendingWidget");
|
|
490
|
+
});
|
|
491
|
+
}, [u, c]);
|
|
490
492
|
const k = p.useMemo(
|
|
491
|
-
() =>
|
|
492
|
-
[
|
|
493
|
-
),
|
|
494
|
-
() =>
|
|
495
|
-
[
|
|
493
|
+
() => dt(l, i, o, n),
|
|
494
|
+
[l, n]
|
|
495
|
+
), X = p.useMemo(
|
|
496
|
+
() => gt(l, n, Bt(o)),
|
|
497
|
+
[l, n]
|
|
496
498
|
), $ = p.useMemo(
|
|
497
|
-
() =>
|
|
498
|
-
[
|
|
499
|
-
),
|
|
500
|
-
|
|
501
|
-
}, X = (f) => {
|
|
502
|
-
E(b === f || f === "0" ? "" : f);
|
|
499
|
+
() => S.find((f) => f.guid === H),
|
|
500
|
+
[H, S]
|
|
501
|
+
), pt = (f, A) => {
|
|
502
|
+
R(A), D("");
|
|
503
503
|
}, Y = (f) => {
|
|
504
|
+
D(x === f || f === "0" ? "" : f);
|
|
505
|
+
}, U = (f) => {
|
|
504
506
|
const A = {
|
|
505
|
-
accounts:
|
|
506
|
-
dateRange:
|
|
507
|
+
accounts: g || s,
|
|
508
|
+
dateRange: c
|
|
507
509
|
};
|
|
508
|
-
if (
|
|
510
|
+
if (b === 0)
|
|
509
511
|
if (f === "other") {
|
|
510
512
|
const M = k.categoryData.find((G) => G.guid === "other");
|
|
511
|
-
|
|
513
|
+
m({
|
|
512
514
|
...A,
|
|
513
|
-
custom: (G) => !!M?.categoryTotals?.find((
|
|
515
|
+
custom: (G) => !!M?.categoryTotals?.find((mt) => mt.guid === G.top_level_category_guid)
|
|
514
516
|
});
|
|
515
517
|
} else
|
|
516
|
-
|
|
518
|
+
m({
|
|
517
519
|
...A,
|
|
518
|
-
custom: (M) => f ? M.top_level_category_guid === f : M.top_level_category_guid !==
|
|
520
|
+
custom: (M) => f ? M.top_level_category_guid === f : M.top_level_category_guid !== _.INCOME && M.top_level_category_guid !== _.INVESTMENTS && M.top_level_category_guid !== _.TRANSFER,
|
|
519
521
|
showSplits: !!f
|
|
520
522
|
});
|
|
521
523
|
else
|
|
522
|
-
|
|
524
|
+
m({
|
|
523
525
|
...A,
|
|
524
|
-
custom: (M) => f ? M.category_guid === f : M.category_guid ===
|
|
526
|
+
custom: (M) => f ? M.category_guid === f : M.category_guid === _.INCOME || M.top_level_category_guid === _.INCOME
|
|
525
527
|
});
|
|
526
|
-
|
|
528
|
+
K(!0);
|
|
527
529
|
};
|
|
528
|
-
return /* @__PURE__ */ h(
|
|
529
|
-
/* @__PURE__ */ h(
|
|
530
|
+
return /* @__PURE__ */ h(w, { children: [
|
|
531
|
+
/* @__PURE__ */ h(it, { onChange: pt, value: b, variant: "fullWidth", children: [
|
|
530
532
|
/* @__PURE__ */ t(
|
|
531
|
-
|
|
533
|
+
L,
|
|
532
534
|
{
|
|
533
535
|
label: /* @__PURE__ */ t(
|
|
534
|
-
|
|
536
|
+
N,
|
|
535
537
|
{
|
|
536
538
|
amount: k.totalAmount,
|
|
537
|
-
label:
|
|
539
|
+
label: e.spend_tab_title
|
|
538
540
|
}
|
|
539
541
|
)
|
|
540
542
|
}
|
|
541
543
|
),
|
|
542
544
|
/* @__PURE__ */ t(
|
|
543
|
-
|
|
545
|
+
L,
|
|
544
546
|
{
|
|
545
547
|
label: /* @__PURE__ */ t(
|
|
546
|
-
|
|
548
|
+
N,
|
|
547
549
|
{
|
|
548
|
-
amount:
|
|
549
|
-
label:
|
|
550
|
+
amount: X.totalAmount,
|
|
551
|
+
label: e.income_tab_title
|
|
550
552
|
}
|
|
551
553
|
)
|
|
552
554
|
}
|
|
553
555
|
)
|
|
554
556
|
] }),
|
|
555
|
-
|
|
556
|
-
|
|
557
|
+
b === 0 && /* @__PURE__ */ t(
|
|
558
|
+
nt,
|
|
557
559
|
{
|
|
558
560
|
data: k,
|
|
559
|
-
onSelected:
|
|
560
|
-
onViewTransactions:
|
|
561
|
-
selectedId:
|
|
562
|
-
title:
|
|
561
|
+
onSelected: Y,
|
|
562
|
+
onViewTransactions: U,
|
|
563
|
+
selectedId: x,
|
|
564
|
+
title: e.spend_tab_title
|
|
563
565
|
}
|
|
564
566
|
),
|
|
565
|
-
|
|
566
|
-
|
|
567
|
+
b === 1 && /* @__PURE__ */ t(
|
|
568
|
+
nt,
|
|
567
569
|
{
|
|
568
|
-
data:
|
|
569
|
-
onSelected:
|
|
570
|
-
onViewTransactions:
|
|
571
|
-
selectedId:
|
|
572
|
-
title:
|
|
570
|
+
data: X,
|
|
571
|
+
onSelected: Y,
|
|
572
|
+
onViewTransactions: U,
|
|
573
|
+
selectedId: x,
|
|
574
|
+
title: e.income_tab_title
|
|
573
575
|
}
|
|
574
576
|
),
|
|
575
577
|
/* @__PURE__ */ t(
|
|
576
|
-
|
|
578
|
+
Z,
|
|
577
579
|
{
|
|
578
|
-
ariaLabelClose:
|
|
579
|
-
isOpen:
|
|
580
|
-
onClose: () =>
|
|
581
|
-
title:
|
|
582
|
-
children: /* @__PURE__ */ t(
|
|
580
|
+
ariaLabelClose: e.close_drawer_aria,
|
|
581
|
+
isOpen: ut,
|
|
582
|
+
onClose: () => K(!1),
|
|
583
|
+
title: e.transactions_drawer_title,
|
|
584
|
+
children: /* @__PURE__ */ t(wt, { onClick: P })
|
|
583
585
|
}
|
|
584
586
|
),
|
|
585
587
|
/* @__PURE__ */ t(
|
|
586
|
-
|
|
588
|
+
Z,
|
|
587
589
|
{
|
|
588
|
-
ariaLabelClose:
|
|
590
|
+
ariaLabelClose: e.close_drawer_aria,
|
|
589
591
|
isOpen: !!$,
|
|
590
|
-
onClose: () =>
|
|
591
|
-
title:
|
|
592
|
-
children: $ && /* @__PURE__ */ t(
|
|
592
|
+
onClose: () => P(""),
|
|
593
|
+
title: e.transaction_details_drawer_title,
|
|
594
|
+
children: $ && /* @__PURE__ */ t(vt, { transaction: $ })
|
|
593
595
|
}
|
|
594
596
|
)
|
|
595
597
|
] });
|
|
596
|
-
},
|
|
597
|
-
const { visibleAccounts: r } =
|
|
598
|
+
}, Vt = I(jt), zt = ({ onBackClick: o, sx: d = {} }) => {
|
|
599
|
+
const { visibleAccounts: r } = st(), { spending: l } = E(), { isCopyLoaded: n, isInitialized: a, setDisplayedDate: i, setSelectedAccounts: e } = O(), { onEvent: c } = Mt(), { clientConfig: u } = lt(), s = u?.master?.deep_link_params?.date_range, [m, S] = p.useState(!1);
|
|
598
600
|
p.useEffect(() => {
|
|
599
601
|
e(r);
|
|
600
602
|
}, [r]), p.useEffect(() => {
|
|
601
|
-
s && Array.isArray(s) && s.length === 2 ?
|
|
603
|
+
s && Array.isArray(s) && s.length === 2 ? i(s[0], s[1]) : i(ot(q()), at(q())), S(!0), c(tt.SPENDING_VIEW);
|
|
602
604
|
}, []);
|
|
603
|
-
const g = (
|
|
604
|
-
|
|
605
|
+
const g = (T) => {
|
|
606
|
+
i(T[0], T[1]);
|
|
605
607
|
};
|
|
606
|
-
return !
|
|
607
|
-
|
|
608
|
+
return !n || !a || !m ? /* @__PURE__ */ t(F, {}) : /* @__PURE__ */ t(
|
|
609
|
+
At,
|
|
608
610
|
{
|
|
609
611
|
accountOptions: r,
|
|
610
612
|
calendarActions: { onRangeChanged: g },
|
|
611
|
-
onAccountsFilterClick: () =>
|
|
612
|
-
onBackClick:
|
|
613
|
-
sx:
|
|
613
|
+
onAccountsFilterClick: () => c(tt.SPENDING_CLICK_FILTER),
|
|
614
|
+
onBackClick: o,
|
|
615
|
+
sx: d,
|
|
614
616
|
title: l.title,
|
|
615
|
-
children: /* @__PURE__ */ t(
|
|
617
|
+
children: /* @__PURE__ */ t(w, { height: "calc(100dvh - 150px)", overflow: "scroll", width: "100%", children: /* @__PURE__ */ t(Vt, {}) })
|
|
616
618
|
}
|
|
617
619
|
);
|
|
618
|
-
},
|
|
620
|
+
}, Se = I(zt);
|
|
619
621
|
export {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
+
_e as SpendingMiniWidget,
|
|
623
|
+
Se as SpendingWidget
|
|
622
624
|
};
|