@mx-cartographer/experiences 7.0.53-alpha.mega3 → 7.0.53-alpha.mega4
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 +5 -1
- package/dist/budgets/index.es.js +4 -5
- package/dist/debts/index.es.js +263 -263
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
## [7.0.
|
1
|
+
## [7.0.53] - 10-15-2025
|
2
2
|
|
3
3
|
- **FIXED** - Resolved `BubbleChart` overflow issue on compact devices
|
4
4
|
- **FIXED** - Made `BubbleChart` responsive to screen size changes
|
5
5
|
- **FIXED** - Prevented full re-render of bubble budgets when adding a new budget
|
6
6
|
|
7
|
+
## [7.0.52] - 10-09-2025
|
8
|
+
|
9
|
+
- **FIXED** - `Debt Widget` | Snowball method payment math fix
|
10
|
+
|
7
11
|
## [7.0.51] - 10-09-2025
|
8
12
|
|
9
13
|
- **ADDED** - Add style font name to the client config
|
package/dist/budgets/index.es.js
CHANGED
@@ -387,11 +387,10 @@ const xt = ({
|
|
387
387
|
const d = r.current;
|
388
388
|
if (!d) return;
|
389
389
|
const f = d.nodes(), _ = a > 0 && a < 450 || t > 0 && t < 300, p = yt(f, m, _, t, a);
|
390
|
-
d.nodes(p), pt(d, t, a),
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
}, [i, n.length]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(a), children: n.map((d) => /* @__PURE__ */ e(Bt, { bubble: d, isDraggable: i, onClick: s }, d.guid)) });
|
390
|
+
d.nodes(p), pt(d, t, a), i && setTimeout(() => {
|
391
|
+
gt(d);
|
392
|
+
}, 0), o([...p]);
|
393
|
+
}, [t, a, i, m]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(a), children: n.map((d) => /* @__PURE__ */ e(Bt, { bubble: d, isDraggable: i, onClick: s }, d.guid)) });
|
395
394
|
}, vt = I(xt), At = ({
|
396
395
|
isMiniWidget: t = !1,
|
397
396
|
onConnectAccountsClick: a,
|
package/dist/debts/index.es.js
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
import { jsx as e, jsxs as s, Fragment as
|
1
|
+
import { jsx as e, jsxs as s, Fragment as $ } from "react/jsx-runtime";
|
2
2
|
import x from "react";
|
3
|
-
import { observer as
|
3
|
+
import { observer as D } from "mobx-react-lite";
|
4
4
|
import g from "@mui/material/Stack";
|
5
|
-
import { useTheme as
|
5
|
+
import { useTheme as X, Card as be, Stack as y, Box as G } from "@mui/material";
|
6
6
|
import { Text as l, H3 as ve, InstitutionLogo as De, Icon as ee } from "@mxenabled/mxui";
|
7
7
|
import { intervalToDuration as Te, formatDuration as Ae } from "date-fns";
|
8
8
|
import { addMonths as le } from "date-fns/addMonths";
|
9
9
|
import { fromUnixTime as se } from "date-fns/fromUnixTime";
|
10
10
|
import { getUnixTime as ce } from "date-fns/getUnixTime";
|
11
|
-
import { D as
|
11
|
+
import { D as B, M as Ee, I as Ie } from "../DebtsStore-nxnF_bZi.mjs";
|
12
12
|
import { a as Fr } from "../DebtsStore-nxnF_bZi.mjs";
|
13
|
-
import { f as
|
13
|
+
import { f as M, a as Be } from "../NumberFormatting-CtWHhyBX.mjs";
|
14
14
|
import { f as K, D as U } from "../Dialog-CWW597AF.mjs";
|
15
|
-
import { G as Me, x as q, u as C, l as
|
16
|
-
import { u as
|
15
|
+
import { G as Me, x as q, u as C, l as V, g as k, d as Z, b as Pe } from "../hooks-CE2TKk4a.mjs";
|
16
|
+
import { u as Y } from "../useScreenSize-B6JyS_Lj.mjs";
|
17
17
|
import { D as te } from "../Drawer-kEE73B87.mjs";
|
18
18
|
import { b as A } from "../Localization-2MODESHW.mjs";
|
19
19
|
import { A as ke, u as Ne } from "../AccountDetailsHeader-eh13XhXN.mjs";
|
@@ -27,7 +27,7 @@ import { A as T, W as Oe } from "../WidgetContainer-hsbxZmZB.mjs";
|
|
27
27
|
import de from "@mui/material/Tab";
|
28
28
|
import We from "@mui/material/Tabs";
|
29
29
|
import _e from "@mui/material/List";
|
30
|
-
import
|
30
|
+
import j from "@mui/material/Divider";
|
31
31
|
import { M as Ge, I as je, O as ze } from "../OriginalBalanceAction-CEuIYsc_.mjs";
|
32
32
|
import Xe from "@mui/material/TextField";
|
33
33
|
import { L as J } from "../ListItemAction-DSrYDGAP.mjs";
|
@@ -38,7 +38,7 @@ import he from "@mui/material/Paper";
|
|
38
38
|
import { Error as Ve, CheckCircle as ye } from "@mxenabled/mx-icons";
|
39
39
|
import { T as ue } from "../TabContentContainer-j01JYR_7.mjs";
|
40
40
|
import { DataGridPro as Ye } from "@mui/x-data-grid-pro";
|
41
|
-
import { H as
|
41
|
+
import { H as z } from "../HeaderCell-DjuifqHJ.mjs";
|
42
42
|
import { f as Ke } from "../ConnectDrawer-SHjB2fpB.mjs";
|
43
43
|
import fe from "@mui/material/Button";
|
44
44
|
import Ue from "@mui/material/IconButton";
|
@@ -55,12 +55,12 @@ const Qe = (a, n = 0, r = 0) => {
|
|
55
55
|
const i = [];
|
56
56
|
if (r === 0) {
|
57
57
|
for (let d = 0; d < a; d++) {
|
58
|
-
const c = n - t * (d + 1),
|
58
|
+
const c = n - t * (d + 1), m = n - t * d, b = c >= 0 ? t : m;
|
59
59
|
i.push({
|
60
60
|
balance: c >= 0 ? c : 0,
|
61
61
|
interest: r,
|
62
|
-
payment:
|
63
|
-
principal:
|
62
|
+
payment: b,
|
63
|
+
principal: b,
|
64
64
|
timestamp: ce(
|
65
65
|
le(
|
66
66
|
se(o),
|
@@ -75,12 +75,12 @@ const Qe = (a, n = 0, r = 0) => {
|
|
75
75
|
}
|
76
76
|
const p = r / 1200;
|
77
77
|
for (let d = 0; d < a; d++) {
|
78
|
-
const c = ce(le(se(o), d + 1)),
|
78
|
+
const c = ce(le(se(o), d + 1)), m = Math.pow(1 + p, d), b = n * m - t * ((m - 1) / p), f = Math.pow(1 + p, d + 1), u = n * f - t * ((f - 1) / p), S = t + Math.min(u, 0), P = b * p;
|
79
79
|
i.push({
|
80
|
-
balance: Math.max(0,
|
81
|
-
interest:
|
82
|
-
payment:
|
83
|
-
principal:
|
80
|
+
balance: Math.max(0, u),
|
81
|
+
interest: P,
|
82
|
+
payment: S,
|
83
|
+
principal: S - P,
|
84
84
|
timestamp: c
|
85
85
|
});
|
86
86
|
}
|
@@ -104,16 +104,16 @@ const Qe = (a, n = 0, r = 0) => {
|
|
104
104
|
[[], []]
|
105
105
|
);
|
106
106
|
switch (n) {
|
107
|
-
case
|
107
|
+
case B.FASTEST_PAYOFF_FIRST:
|
108
108
|
r.sort((o, i) => (o.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
|
109
109
|
break;
|
110
|
-
case
|
110
|
+
case B.HIGHEST_INTEREST:
|
111
111
|
r.sort((o, i) => (i.interest_rate ?? 0) - (o.interest_rate ?? 0));
|
112
112
|
break;
|
113
|
-
case
|
113
|
+
case B.LOWEST_BALANCE:
|
114
114
|
r.sort((o, i) => o.balance - i.balance);
|
115
115
|
break;
|
116
|
-
case
|
116
|
+
case B.HIGHEST_BALANCE:
|
117
117
|
r.sort((o, i) => i.balance - o.balance);
|
118
118
|
break;
|
119
119
|
default:
|
@@ -122,33 +122,33 @@ const Qe = (a, n = 0, r = 0) => {
|
|
122
122
|
a.splice(0, a.length, ...r, ...t);
|
123
123
|
};
|
124
124
|
function at(a, n, r = 0) {
|
125
|
-
const t = a.map((
|
126
|
-
(
|
125
|
+
const t = a.map((b) => ({ ...b })).filter(
|
126
|
+
(b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
|
127
127
|
);
|
128
128
|
xe(t, n);
|
129
129
|
let o = 0, i = 0;
|
130
130
|
const p = /* @__PURE__ */ new Date(), d = /* @__PURE__ */ new Date();
|
131
|
-
for (; t.some((
|
132
|
-
let
|
133
|
-
for (const [
|
134
|
-
if (
|
135
|
-
const
|
136
|
-
let
|
137
|
-
|
138
|
-
const
|
139
|
-
if (
|
140
|
-
|
131
|
+
for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
|
132
|
+
let b = !1;
|
133
|
+
for (const [f, u] of t.entries()) {
|
134
|
+
if (u.balance <= 0.01 || u.is_impossible) continue;
|
135
|
+
const P = (u.interest_rate ?? 0) / 100 / 12, E = u.balance * P;
|
136
|
+
let _ = u.monthly_payment ?? 0;
|
137
|
+
f === 0 && r && (_ += r), u.balance += E;
|
138
|
+
const v = Math.min(u.balance, _ + i);
|
139
|
+
if (v <= E) {
|
140
|
+
u.is_impossible = !0;
|
141
141
|
continue;
|
142
142
|
}
|
143
|
-
|
143
|
+
u.balance -= v, u.balance = u.balance < 0.01 ? 0 : u.balance, o += E, u.balance <= 0 && (i += _), v > 0 && (b = !0);
|
144
144
|
}
|
145
|
-
|
145
|
+
b && d.setMonth(d.getMonth() + 1);
|
146
146
|
}
|
147
|
-
const c = t.some((
|
147
|
+
const c = t.some((b) => b.is_impossible && b.balance > 0), m = Te({ start: p, end: d });
|
148
148
|
return {
|
149
|
-
payoffSavings: c ? "N/A" :
|
149
|
+
payoffSavings: c ? "N/A" : M(o, "0,0.00"),
|
150
150
|
payoffDate: c ? "Never" : K(d, U.MONTH_YEAR),
|
151
|
-
payoffDuration: c ? "Stagnant" : Ae(
|
151
|
+
payoffDuration: c ? "Stagnant" : Ae(m, { format: ["years", "months"] }) || "0 months"
|
152
152
|
};
|
153
153
|
}
|
154
154
|
const R = () => {
|
@@ -156,9 +156,9 @@ const R = () => {
|
|
156
156
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
157
157
|
return q().uiStore;
|
158
158
|
}, nt = ({ debts: a, onClickCta: n, sx: r }) => {
|
159
|
-
const t =
|
160
|
-
const
|
161
|
-
return at(a, p,
|
159
|
+
const t = X(), { isMobile: o } = Y(), { debts: i } = C(), { selectedDebtPriority: p } = R(), { monthlyCashFlowProfile: d } = V(), { payoffDate: c, payoffSavings: m, payoffDuration: b } = x.useMemo(() => {
|
160
|
+
const f = d?.extra_payment ?? 0;
|
161
|
+
return at(a, p, f);
|
162
162
|
}, [a, p, d]);
|
163
163
|
return /* @__PURE__ */ e(
|
164
164
|
be,
|
@@ -169,9 +169,9 @@ const R = () => {
|
|
169
169
|
minWidth: "186px",
|
170
170
|
...r
|
171
171
|
},
|
172
|
-
children: /* @__PURE__ */ s(
|
172
|
+
children: /* @__PURE__ */ s(y, { sx: { gap: "12px", p: "16px" }, children: [
|
173
173
|
/* @__PURE__ */ s(
|
174
|
-
|
174
|
+
y,
|
175
175
|
{
|
176
176
|
gap: o ? "4px" : "0",
|
177
177
|
sx: {
|
@@ -185,12 +185,12 @@ const R = () => {
|
|
185
185
|
]
|
186
186
|
}
|
187
187
|
),
|
188
|
-
/* @__PURE__ */ s(
|
189
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children:
|
188
|
+
/* @__PURE__ */ s(y, { gap: o ? "4px" : "0", children: [
|
189
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: m }),
|
190
190
|
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
|
191
191
|
] }),
|
192
|
-
/* @__PURE__ */ s(
|
193
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children:
|
192
|
+
/* @__PURE__ */ s(y, { gap: o ? "4px" : "0", children: [
|
193
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: b }),
|
194
194
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
|
195
195
|
] }),
|
196
196
|
/* @__PURE__ */ e(
|
@@ -207,8 +207,8 @@ const R = () => {
|
|
207
207
|
] })
|
208
208
|
}
|
209
209
|
);
|
210
|
-
}, ot =
|
211
|
-
const r =
|
210
|
+
}, ot = D(nt), it = ({ isOpen: a, onClose: n }) => {
|
211
|
+
const r = X(), { debts: t } = C(), [o, i] = x.useState(!1);
|
212
212
|
return /* @__PURE__ */ e(
|
213
213
|
te,
|
214
214
|
{
|
@@ -216,9 +216,9 @@ const R = () => {
|
|
216
216
|
isOpen: a,
|
217
217
|
onClose: n,
|
218
218
|
title: t.snowball_drawer_title,
|
219
|
-
children: /* @__PURE__ */ s(
|
220
|
-
/* @__PURE__ */ s(
|
221
|
-
/* @__PURE__ */ s(
|
219
|
+
children: /* @__PURE__ */ s(y, { bgcolor: r.palette.background.default, height: "100%", children: [
|
220
|
+
/* @__PURE__ */ s(y, { alignItems: "center", px: 24, py: 24, children: [
|
221
|
+
/* @__PURE__ */ s(y, { alignItems: "center", pb: 24, children: [
|
222
222
|
/* @__PURE__ */ e(l, { mb: 12, variant: "H3", children: t.snowball_drawer_subtitle }),
|
223
223
|
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_amount_description }),
|
224
224
|
/* @__PURE__ */ e(l, { variant: "H1", children: t.snowball_drawer_savings }),
|
@@ -249,7 +249,7 @@ const R = () => {
|
|
249
249
|
)
|
250
250
|
] })
|
251
251
|
] }),
|
252
|
-
/* @__PURE__ */ s(
|
252
|
+
/* @__PURE__ */ s(y, { children: [
|
253
253
|
/* @__PURE__ */ e(
|
254
254
|
l,
|
255
255
|
{
|
@@ -260,14 +260,14 @@ const R = () => {
|
|
260
260
|
children: t.snowball_drawer_disclaimer
|
261
261
|
}
|
262
262
|
),
|
263
|
-
/* @__PURE__ */ s(
|
263
|
+
/* @__PURE__ */ s(y, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
264
264
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: A(t.snowball_drawer_month_header, 1) }),
|
265
265
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
266
266
|
] }),
|
267
|
-
/* @__PURE__ */ s(
|
268
|
-
/* @__PURE__ */ s(
|
267
|
+
/* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
268
|
+
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
269
269
|
/* @__PURE__ */ e(
|
270
|
-
|
270
|
+
G,
|
271
271
|
{
|
272
272
|
sx: {
|
273
273
|
display: "flex",
|
@@ -283,7 +283,7 @@ const R = () => {
|
|
283
283
|
}
|
284
284
|
),
|
285
285
|
/* @__PURE__ */ s(
|
286
|
-
|
286
|
+
y,
|
287
287
|
{
|
288
288
|
sx: {
|
289
289
|
borderBottom: `1px solid ${r.palette.border.light}`,
|
@@ -293,7 +293,7 @@ const R = () => {
|
|
293
293
|
pr: 24
|
294
294
|
},
|
295
295
|
children: [
|
296
|
-
/* @__PURE__ */ s(
|
296
|
+
/* @__PURE__ */ s(y, { flexGrow: 1, children: [
|
297
297
|
/* @__PURE__ */ e(l, { variant: "Body", children: A(t.snowball_drawer_debt_label, "A") }),
|
298
298
|
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
299
299
|
A(
|
@@ -304,7 +304,7 @@ const R = () => {
|
|
304
304
|
t.snowball_drawer_rollover_explainer_pt2
|
305
305
|
] })
|
306
306
|
] }),
|
307
|
-
/* @__PURE__ */ s(
|
307
|
+
/* @__PURE__ */ s(y, { children: [
|
308
308
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$100.00" }),
|
309
309
|
/* @__PURE__ */ e(
|
310
310
|
l,
|
@@ -321,9 +321,9 @@ const R = () => {
|
|
321
321
|
}
|
322
322
|
)
|
323
323
|
] }),
|
324
|
-
/* @__PURE__ */ s(
|
324
|
+
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
325
325
|
/* @__PURE__ */ e(
|
326
|
-
|
326
|
+
G,
|
327
327
|
{
|
328
328
|
sx: {
|
329
329
|
width: 20,
|
@@ -335,7 +335,7 @@ const R = () => {
|
|
335
335
|
}
|
336
336
|
),
|
337
337
|
/* @__PURE__ */ s(
|
338
|
-
|
338
|
+
y,
|
339
339
|
{
|
340
340
|
sx: {
|
341
341
|
borderBottom: `1px solid ${r.palette.border.light}`,
|
@@ -351,9 +351,9 @@ const R = () => {
|
|
351
351
|
}
|
352
352
|
)
|
353
353
|
] }),
|
354
|
-
/* @__PURE__ */ s(
|
354
|
+
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, py: 14, children: [
|
355
355
|
/* @__PURE__ */ e(
|
356
|
-
|
356
|
+
G,
|
357
357
|
{
|
358
358
|
sx: {
|
359
359
|
width: 20,
|
@@ -364,13 +364,13 @@ const R = () => {
|
|
364
364
|
}
|
365
365
|
}
|
366
366
|
),
|
367
|
-
/* @__PURE__ */ s(
|
367
|
+
/* @__PURE__ */ s(y, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
|
368
368
|
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: A(t.snowball_drawer_debt_label, "C") }),
|
369
369
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
|
370
370
|
] })
|
371
371
|
] }),
|
372
372
|
/* @__PURE__ */ s(
|
373
|
-
|
373
|
+
y,
|
374
374
|
{
|
375
375
|
sx: {
|
376
376
|
py: 8,
|
@@ -387,14 +387,14 @@ const R = () => {
|
|
387
387
|
}
|
388
388
|
)
|
389
389
|
] }),
|
390
|
-
/* @__PURE__ */ s(
|
390
|
+
/* @__PURE__ */ s(y, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
391
391
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: A(t.snowball_drawer_month_header, 2) }),
|
392
392
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
393
393
|
] }),
|
394
|
-
/* @__PURE__ */ s(
|
395
|
-
/* @__PURE__ */ s(
|
394
|
+
/* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
395
|
+
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
396
396
|
/* @__PURE__ */ e(
|
397
|
-
|
397
|
+
G,
|
398
398
|
{
|
399
399
|
sx: {
|
400
400
|
display: "flex",
|
@@ -410,7 +410,7 @@ const R = () => {
|
|
410
410
|
}
|
411
411
|
),
|
412
412
|
/* @__PURE__ */ s(
|
413
|
-
|
413
|
+
y,
|
414
414
|
{
|
415
415
|
sx: {
|
416
416
|
borderBottom: `1px solid ${r.palette.border.light}`,
|
@@ -420,7 +420,7 @@ const R = () => {
|
|
420
420
|
pr: 24
|
421
421
|
},
|
422
422
|
children: [
|
423
|
-
/* @__PURE__ */ s(
|
423
|
+
/* @__PURE__ */ s(y, { flexGrow: 1, children: [
|
424
424
|
/* @__PURE__ */ e(l, { variant: "Body", children: A(t.snowball_drawer_debt_label, "B") }),
|
425
425
|
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
426
426
|
A(
|
@@ -431,7 +431,7 @@ const R = () => {
|
|
431
431
|
t.snowball_drawer_rollover_explainer_pt2
|
432
432
|
] })
|
433
433
|
] }),
|
434
|
-
/* @__PURE__ */ s(
|
434
|
+
/* @__PURE__ */ s(y, { children: [
|
435
435
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$500.00" }),
|
436
436
|
/* @__PURE__ */ e(
|
437
437
|
l,
|
@@ -448,9 +448,9 @@ const R = () => {
|
|
448
448
|
}
|
449
449
|
)
|
450
450
|
] }),
|
451
|
-
/* @__PURE__ */ s(
|
451
|
+
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
452
452
|
/* @__PURE__ */ e(
|
453
|
-
|
453
|
+
G,
|
454
454
|
{
|
455
455
|
sx: {
|
456
456
|
width: 20,
|
@@ -462,7 +462,7 @@ const R = () => {
|
|
462
462
|
}
|
463
463
|
),
|
464
464
|
/* @__PURE__ */ s(
|
465
|
-
|
465
|
+
y,
|
466
466
|
{
|
467
467
|
sx: {
|
468
468
|
flexDirection: "row",
|
@@ -478,7 +478,7 @@ const R = () => {
|
|
478
478
|
)
|
479
479
|
] }),
|
480
480
|
/* @__PURE__ */ s(
|
481
|
-
|
481
|
+
y,
|
482
482
|
{
|
483
483
|
sx: {
|
484
484
|
py: 8,
|
@@ -495,14 +495,14 @@ const R = () => {
|
|
495
495
|
}
|
496
496
|
)
|
497
497
|
] }),
|
498
|
-
/* @__PURE__ */ s(
|
498
|
+
/* @__PURE__ */ s(y, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
499
499
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: A(t.snowball_drawer_month_header, 3) }),
|
500
500
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
501
501
|
] }),
|
502
|
-
/* @__PURE__ */ s(
|
503
|
-
/* @__PURE__ */ s(
|
502
|
+
/* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
503
|
+
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
504
504
|
/* @__PURE__ */ e(
|
505
|
-
|
505
|
+
G,
|
506
506
|
{
|
507
507
|
sx: {
|
508
508
|
display: "flex",
|
@@ -518,7 +518,7 @@ const R = () => {
|
|
518
518
|
}
|
519
519
|
),
|
520
520
|
/* @__PURE__ */ s(
|
521
|
-
|
521
|
+
y,
|
522
522
|
{
|
523
523
|
sx: {
|
524
524
|
alignItems: "center",
|
@@ -528,8 +528,8 @@ const R = () => {
|
|
528
528
|
pr: 24
|
529
529
|
},
|
530
530
|
children: [
|
531
|
-
/* @__PURE__ */ e(
|
532
|
-
/* @__PURE__ */ s(
|
531
|
+
/* @__PURE__ */ e(y, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children: A(t.snowball_drawer_debt_label, "C") }) }),
|
532
|
+
/* @__PURE__ */ s(y, { children: [
|
533
533
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,500.00" }),
|
534
534
|
/* @__PURE__ */ e(
|
535
535
|
l,
|
@@ -547,7 +547,7 @@ const R = () => {
|
|
547
547
|
)
|
548
548
|
] }),
|
549
549
|
/* @__PURE__ */ s(
|
550
|
-
|
550
|
+
y,
|
551
551
|
{
|
552
552
|
sx: {
|
553
553
|
py: 8,
|
@@ -568,7 +568,7 @@ const R = () => {
|
|
568
568
|
] })
|
569
569
|
}
|
570
570
|
);
|
571
|
-
}, lt =
|
571
|
+
}, lt = D(it), st = "#FF7B08";
|
572
572
|
function ct(a, n) {
|
573
573
|
const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
|
574
574
|
Math.max(0, Math.min(255, Math.round(r * n))),
|
@@ -586,31 +586,31 @@ const ge = ({
|
|
586
586
|
onClickArea: i,
|
587
587
|
onHoverArea: p
|
588
588
|
}) => {
|
589
|
-
const d = He(), { onEvent: c } = k(),
|
589
|
+
const d = He(), { onEvent: c } = k(), m = t.filter((h) => !h.is_impossible), b = [
|
590
590
|
...new Set(
|
591
|
-
|
591
|
+
m.flatMap((h) => h.dataset.map((w) => new Date(w.x).getTime()))
|
592
592
|
)
|
593
|
-
].sort((
|
594
|
-
const w = new Map(
|
595
|
-
let
|
596
|
-
const N =
|
597
|
-
const
|
598
|
-
return
|
593
|
+
].sort((h, w) => h - w).map((h) => new Date(h)), f = m.map((h) => {
|
594
|
+
const w = new Map(h.dataset.map((F) => [new Date(F.x).getTime(), F.y]));
|
595
|
+
let I = w.get(b[0].getTime()) ?? 0;
|
596
|
+
const N = b.map((F) => {
|
597
|
+
const O = w.get(F.getTime()) ?? I;
|
598
|
+
return I = O, { x: F, y: O };
|
599
599
|
});
|
600
|
-
return { ...
|
601
|
-
}),
|
602
|
-
(
|
600
|
+
return { ...h, dataset: N };
|
601
|
+
}), u = f.reduce(
|
602
|
+
(h, w) => h + (w.dataset[0]?.y ?? 0),
|
603
603
|
0
|
604
|
-
),
|
605
|
-
const
|
606
|
-
return { x:
|
607
|
-
}),
|
608
|
-
const
|
604
|
+
), S = b.map((h, w) => {
|
605
|
+
const I = w / (b.length - 1), N = u * (1 - I);
|
606
|
+
return { x: h, y: N };
|
607
|
+
}), P = Math.ceil(u / 100) * 100, E = b, _ = f.map((h, w) => {
|
608
|
+
const I = 1 - w / f.length * 0.5, N = ct(st, I);
|
609
609
|
return {
|
610
610
|
id: `debt-${w}`,
|
611
|
-
guid:
|
612
|
-
label:
|
613
|
-
data:
|
611
|
+
guid: h.guid,
|
612
|
+
label: h.name,
|
613
|
+
data: h.dataset.map((F) => F.y),
|
614
614
|
color: N,
|
615
615
|
curve: "linear",
|
616
616
|
type: "line",
|
@@ -619,10 +619,10 @@ const ge = ({
|
|
619
619
|
showMark: !1
|
620
620
|
};
|
621
621
|
});
|
622
|
-
|
622
|
+
_.push({
|
623
623
|
id: "payoff-line",
|
624
624
|
label: "Payoff Line",
|
625
|
-
data:
|
625
|
+
data: S.map((h) => h.y),
|
626
626
|
color: d.palette.grey[700],
|
627
627
|
curve: "linear",
|
628
628
|
type: "line",
|
@@ -630,7 +630,7 @@ const ge = ({
|
|
630
630
|
showMark: !1,
|
631
631
|
disableHighlight: !0
|
632
632
|
});
|
633
|
-
const
|
633
|
+
const v = (h) => _.findIndex((w) => w?.guid === h);
|
634
634
|
return /* @__PURE__ */ e(
|
635
635
|
re,
|
636
636
|
{
|
@@ -652,16 +652,16 @@ const ge = ({
|
|
652
652
|
axisHighlight: { x: "none" },
|
653
653
|
disableLineItemHighlight: !0,
|
654
654
|
height: n,
|
655
|
-
onAreaClick: (
|
655
|
+
onAreaClick: (h, w) => {
|
656
656
|
i?.();
|
657
|
-
const
|
658
|
-
c(T.DEBTS_CLICK_CHART_AREA, { account_guid:
|
657
|
+
const I = _.find((N) => N.id === w.seriesId);
|
658
|
+
c(T.DEBTS_CLICK_CHART_AREA, { account_guid: I?.guid });
|
659
659
|
},
|
660
|
-
onHighlightChange: (
|
661
|
-
const w =
|
660
|
+
onHighlightChange: (h) => {
|
661
|
+
const w = _.find((I) => I.id === h?.seriesId)?.guid;
|
662
662
|
p?.(w ?? "");
|
663
663
|
},
|
664
|
-
series:
|
664
|
+
series: _,
|
665
665
|
skipAnimation: !0,
|
666
666
|
slotProps: {
|
667
667
|
legend: {
|
@@ -685,10 +685,10 @@ const ge = ({
|
|
685
685
|
strokeDasharray: "10 5",
|
686
686
|
strokeWidth: 1
|
687
687
|
},
|
688
|
-
[`& .MuiLineElement-series-debt-${
|
688
|
+
[`& .MuiLineElement-series-debt-${v(o ?? "0")}`]: {
|
689
689
|
opacity: 1
|
690
690
|
},
|
691
|
-
[`& .MuiAreaElement-series-debt-${
|
691
|
+
[`& .MuiAreaElement-series-debt-${v(o ?? "0")}`]: {
|
692
692
|
opacity: 1
|
693
693
|
},
|
694
694
|
"& .MuiChartsAxis-tickLabel > tspan": {
|
@@ -700,19 +700,19 @@ const ge = ({
|
|
700
700
|
width: r,
|
701
701
|
xAxis: [
|
702
702
|
{
|
703
|
-
data:
|
703
|
+
data: E,
|
704
704
|
scaleType: "time",
|
705
|
-
min:
|
705
|
+
min: b[0],
|
706
706
|
disableTicks: !0,
|
707
|
-
valueFormatter: (
|
707
|
+
valueFormatter: (h) => K(h, U.MONTH_SHORT_YEAR)
|
708
708
|
}
|
709
709
|
],
|
710
710
|
yAxis: [
|
711
711
|
{
|
712
712
|
min: 0,
|
713
|
-
max:
|
713
|
+
max: P,
|
714
714
|
disableTicks: !0,
|
715
|
-
valueFormatter: (
|
715
|
+
valueFormatter: (h) => M(h, "0a")
|
716
716
|
}
|
717
717
|
]
|
718
718
|
}
|
@@ -720,8 +720,8 @@ const ge = ({
|
|
720
720
|
}
|
721
721
|
);
|
722
722
|
}, dt = () => {
|
723
|
-
const a =
|
724
|
-
return /* @__PURE__ */ s(
|
723
|
+
const a = X(), { debts: n } = C(), { selectedDebtChartData: r } = R();
|
724
|
+
return /* @__PURE__ */ s($, { children: [
|
725
725
|
/* @__PURE__ */ s(
|
726
726
|
Fe,
|
727
727
|
{
|
@@ -746,8 +746,8 @@ const ge = ({
|
|
746
746
|
}
|
747
747
|
)
|
748
748
|
] });
|
749
|
-
}, pt =
|
750
|
-
const a =
|
749
|
+
}, pt = D(dt), mt = () => {
|
750
|
+
const a = X(), { onEvent: n } = k(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: o, showError: i } = R();
|
751
751
|
return x.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || o ? /* @__PURE__ */ e(
|
752
752
|
l,
|
753
753
|
{
|
@@ -757,7 +757,7 @@ const ge = ({
|
|
757
757
|
variant: "Small",
|
758
758
|
children: i ? r.schedule_error_message : r.schedule_complete_message
|
759
759
|
}
|
760
|
-
) : /* @__PURE__ */ s(
|
760
|
+
) : /* @__PURE__ */ s($, { children: [
|
761
761
|
/* @__PURE__ */ s(g, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
762
762
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_month_heading }),
|
763
763
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_amount_heading })
|
@@ -778,7 +778,7 @@ const ge = ({
|
|
778
778
|
/* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
|
779
779
|
] }),
|
780
780
|
/* @__PURE__ */ s(g, { children: [
|
781
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children:
|
781
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: M(d, "0,0.00") }),
|
782
782
|
/* @__PURE__ */ e(
|
783
783
|
l,
|
784
784
|
{
|
@@ -786,7 +786,7 @@ const ge = ({
|
|
786
786
|
color: a.palette.success.main,
|
787
787
|
textAlign: "end",
|
788
788
|
variant: "Tiny",
|
789
|
-
children: `+${
|
789
|
+
children: `+${M(c, "0,0")}`
|
790
790
|
}
|
791
791
|
)
|
792
792
|
] })
|
@@ -810,7 +810,7 @@ const ge = ({
|
|
810
810
|
}
|
811
811
|
) })
|
812
812
|
] }) });
|
813
|
-
}, ht =
|
813
|
+
}, ht = D(mt), ut = D(({ debt: a }) => {
|
814
814
|
const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.interest_rate ?? 0), p = o < 0, d = async () => {
|
815
815
|
await r({ ...a.account, interest_rate: o }), a.interest_rate = o, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
|
816
816
|
}, c = () => {
|
@@ -833,14 +833,14 @@ const ge = ({
|
|
833
833
|
{
|
834
834
|
error: p,
|
835
835
|
fullWidth: !0,
|
836
|
-
onChange: (
|
836
|
+
onChange: (m) => i(isNaN(parseFloat(m.target.value)) ? 0 : parseFloat(m.target.value)),
|
837
837
|
type: "number",
|
838
838
|
value: o
|
839
839
|
}
|
840
840
|
)
|
841
841
|
}
|
842
842
|
);
|
843
|
-
}), bt =
|
843
|
+
}), bt = D(({ debt: a }) => {
|
844
844
|
const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
|
845
845
|
await r({ ...a.account, minimum_payment: o }), a.monthly_payment = o, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
|
846
846
|
}, c = () => {
|
@@ -856,7 +856,7 @@ const ge = ({
|
|
856
856
|
onCancel: c,
|
857
857
|
onSave: d,
|
858
858
|
primaryText: n.details_monthly_payment,
|
859
|
-
secondaryText:
|
859
|
+
secondaryText: M(a.monthly_payment, "0,0"),
|
860
860
|
zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
|
861
861
|
children: /* @__PURE__ */ e(
|
862
862
|
ae,
|
@@ -866,13 +866,13 @@ const ge = ({
|
|
866
866
|
error: p,
|
867
867
|
fullWidth: !0,
|
868
868
|
minAmount: 0,
|
869
|
-
setAmount: (
|
869
|
+
setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
|
870
870
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
871
871
|
}
|
872
872
|
)
|
873
873
|
}
|
874
874
|
);
|
875
|
-
}), _t =
|
875
|
+
}), _t = D(({ debt: a }) => {
|
876
876
|
const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
|
877
877
|
await r({ ...a.account, original_balance: o }), a.original_balance = o, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
|
878
878
|
}, c = () => {
|
@@ -888,7 +888,7 @@ const ge = ({
|
|
888
888
|
onCancel: c,
|
889
889
|
onSave: d,
|
890
890
|
primaryText: n.details_original_balance,
|
891
|
-
secondaryText:
|
891
|
+
secondaryText: M(a.original_balance, "0,0"),
|
892
892
|
zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
|
893
893
|
children: /* @__PURE__ */ e(
|
894
894
|
ae,
|
@@ -898,7 +898,7 @@ const ge = ({
|
|
898
898
|
error: p,
|
899
899
|
fullWidth: !0,
|
900
900
|
minAmount: 0,
|
901
|
-
setAmount: (
|
901
|
+
setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
|
902
902
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
903
903
|
}
|
904
904
|
)
|
@@ -907,28 +907,28 @@ const ge = ({
|
|
907
907
|
}), yt = () => {
|
908
908
|
const { onEvent: a } = k(), { selectedDebtChartData: n } = R();
|
909
909
|
return x.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(g, { bgcolor: "background.paper", children: [
|
910
|
-
n?.goal && /* @__PURE__ */ s(
|
910
|
+
n?.goal && /* @__PURE__ */ s($, { children: [
|
911
911
|
/* @__PURE__ */ e(Ge, { goal: n.goal }),
|
912
|
-
/* @__PURE__ */ e(
|
912
|
+
/* @__PURE__ */ e(j, {}),
|
913
913
|
/* @__PURE__ */ e(je, { goal: n.goal }),
|
914
|
-
/* @__PURE__ */ e(
|
914
|
+
/* @__PURE__ */ e(j, {}),
|
915
915
|
/* @__PURE__ */ e(ze, { goal: n.goal }),
|
916
|
-
/* @__PURE__ */ e(
|
916
|
+
/* @__PURE__ */ e(j, {})
|
917
917
|
] }),
|
918
|
-
!n?.goal && n?.account && /* @__PURE__ */ s(
|
918
|
+
!n?.goal && n?.account && /* @__PURE__ */ s($, { children: [
|
919
919
|
/* @__PURE__ */ e(bt, { debt: n }),
|
920
|
-
/* @__PURE__ */ e(
|
920
|
+
/* @__PURE__ */ e(j, {}),
|
921
921
|
/* @__PURE__ */ e(ut, { debt: n }),
|
922
|
-
/* @__PURE__ */ e(
|
922
|
+
/* @__PURE__ */ e(j, {}),
|
923
923
|
/* @__PURE__ */ e(_t, { debt: n }),
|
924
|
-
/* @__PURE__ */ e(
|
924
|
+
/* @__PURE__ */ e(j, {})
|
925
925
|
] })
|
926
926
|
] });
|
927
|
-
}, ft =
|
927
|
+
}, ft = D(yt), xt = ({ setTabValue: a, sx: n }) => {
|
928
928
|
const { debts: r } = C(), { showError: t, showCompleted: o } = R();
|
929
929
|
return x.useEffect(() => {
|
930
930
|
t && a(1);
|
931
|
-
}, [t]), !t && !o ? /* @__PURE__ */ e(
|
931
|
+
}, [t]), !t && !o ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ s(g, { gap: 16, children: [
|
932
932
|
/* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
933
933
|
pe,
|
934
934
|
{
|
@@ -953,7 +953,7 @@ const ge = ({
|
|
953
953
|
t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
954
954
|
pe,
|
955
955
|
{
|
956
|
-
icon: /* @__PURE__ */ e(
|
956
|
+
icon: /* @__PURE__ */ e($, {}),
|
957
957
|
severity: "error",
|
958
958
|
sx: {
|
959
959
|
borderRadius: 2,
|
@@ -969,9 +969,9 @@ const ge = ({
|
|
969
969
|
}
|
970
970
|
) })
|
971
971
|
] });
|
972
|
-
}, gt =
|
972
|
+
}, gt = D(xt), wt = () => {
|
973
973
|
const { debts: a } = C(), { showError: n, showCompleted: r } = R(), [t, o] = x.useState(0);
|
974
|
-
return /* @__PURE__ */ s(
|
974
|
+
return /* @__PURE__ */ s($, { children: [
|
975
975
|
(n || r) && /* @__PURE__ */ e(gt, { setTabValue: o, sx: { mt: -24 } }),
|
976
976
|
/* @__PURE__ */ s(
|
977
977
|
We,
|
@@ -1005,8 +1005,8 @@ const ge = ({
|
|
1005
1005
|
/* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ht, {}) }),
|
1006
1006
|
/* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(ft, {}) })
|
1007
1007
|
] });
|
1008
|
-
}, Ct =
|
1009
|
-
const { debts: r } = C(), { showError: t, showCompleted: o } = R(), i = t || o ? /* @__PURE__ */ e(
|
1008
|
+
}, Ct = D(wt), St = ({ isOpen: a, onClose: n }) => {
|
1009
|
+
const { debts: r } = C(), { showError: t, showCompleted: o } = R(), i = t || o ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(pt, {});
|
1010
1010
|
return /* @__PURE__ */ e(
|
1011
1011
|
te,
|
1012
1012
|
{
|
@@ -1020,8 +1020,8 @@ const ge = ({
|
|
1020
1020
|
] })
|
1021
1021
|
}
|
1022
1022
|
);
|
1023
|
-
}, vt =
|
1024
|
-
const { debts: a } = C(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } =
|
1023
|
+
}, vt = D(() => {
|
1024
|
+
const { debts: a } = C(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = k(), [o, i] = x.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
|
1025
1025
|
n && (await r({ ...n, extra_payment: o }), n.extra_payment = o, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
|
1026
1026
|
user_guid: n?.user_guid
|
1027
1027
|
}));
|
@@ -1038,7 +1038,7 @@ const ge = ({
|
|
1038
1038
|
onCancel: c,
|
1039
1039
|
onSave: d,
|
1040
1040
|
primaryText: a.paydown_drawer_extra_payment,
|
1041
|
-
secondaryText:
|
1041
|
+
secondaryText: M(n?.extra_payment, "0,0"),
|
1042
1042
|
zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
|
1043
1043
|
children: /* @__PURE__ */ e(
|
1044
1044
|
ae,
|
@@ -1048,19 +1048,19 @@ const ge = ({
|
|
1048
1048
|
error: p,
|
1049
1049
|
fullWidth: !0,
|
1050
1050
|
minAmount: 0,
|
1051
|
-
setAmount: (
|
1051
|
+
setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
|
1052
1052
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
1053
1053
|
}
|
1054
1054
|
)
|
1055
1055
|
}
|
1056
1056
|
);
|
1057
1057
|
}), Dt = () => {
|
1058
|
-
const { debts: a } = C(), { totalMonthlyPayments: n } = q(), { monthlyCashFlowProfile: r } =
|
1058
|
+
const { debts: a } = C(), { totalMonthlyPayments: n } = q(), { monthlyCashFlowProfile: r } = V(), t = n + Number(r?.extra_payment);
|
1059
1059
|
return /* @__PURE__ */ s(g, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
1060
1060
|
/* @__PURE__ */ s(g, { p: 24, children: [
|
1061
1061
|
/* @__PURE__ */ s(g, { alignItems: "center", gap: 4, mb: 24, children: [
|
1062
1062
|
/* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
|
1063
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "H1", children:
|
1063
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: M(n, "0,0") }),
|
1064
1064
|
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
|
1065
1065
|
] }),
|
1066
1066
|
/* @__PURE__ */ s(g, { children: [
|
@@ -1071,10 +1071,10 @@ const ge = ({
|
|
1071
1071
|
/* @__PURE__ */ e(g, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(vt, {}) }),
|
1072
1072
|
/* @__PURE__ */ e(g, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(g, { gap: 4, children: [
|
1073
1073
|
/* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
|
1074
|
-
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children:
|
1074
|
+
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: M(t, "0,0") })
|
1075
1075
|
] }) })
|
1076
1076
|
] });
|
1077
|
-
}, Tt =
|
1077
|
+
}, Tt = D(Dt), At = ({ isOpen: a, onClose: n }) => {
|
1078
1078
|
const { debts: r } = C();
|
1079
1079
|
return /* @__PURE__ */ e(
|
1080
1080
|
te,
|
@@ -1145,13 +1145,13 @@ const Bt = (a) => {
|
|
1145
1145
|
onHoverRow: t,
|
1146
1146
|
onClickRow: o
|
1147
1147
|
}) => {
|
1148
|
-
const i =
|
1148
|
+
const i = X(), { onEvent: p } = k(), { isMobile: d } = Y(), { debts: c } = C(), [m, b] = x.useState([
|
1149
1149
|
{ field: "priority", sort: "asc" }
|
1150
|
-
]),
|
1150
|
+
]), f = [
|
1151
1151
|
{
|
1152
1152
|
field: "priority",
|
1153
1153
|
headerName: c.table_column_priority,
|
1154
|
-
renderHeader:
|
1154
|
+
renderHeader: z,
|
1155
1155
|
renderCell: Mt,
|
1156
1156
|
sortComparator: Et,
|
1157
1157
|
sortable: !0,
|
@@ -1165,7 +1165,7 @@ const Bt = (a) => {
|
|
1165
1165
|
{
|
1166
1166
|
field: "account",
|
1167
1167
|
headerName: c.table_column_account,
|
1168
|
-
renderHeader:
|
1168
|
+
renderHeader: z,
|
1169
1169
|
renderCell: Pt,
|
1170
1170
|
sortable: !1,
|
1171
1171
|
type: "custom",
|
@@ -1177,8 +1177,8 @@ const Bt = (a) => {
|
|
1177
1177
|
{
|
1178
1178
|
field: "balance",
|
1179
1179
|
headerName: c.table_column_balance,
|
1180
|
-
renderHeader:
|
1181
|
-
renderCell: (
|
1180
|
+
renderHeader: z,
|
1181
|
+
renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: M(_.value, "0,0") }),
|
1182
1182
|
sortable: !0,
|
1183
1183
|
hideSortIcons: d,
|
1184
1184
|
type: "number",
|
@@ -1190,8 +1190,8 @@ const Bt = (a) => {
|
|
1190
1190
|
{
|
1191
1191
|
field: "interest_rate",
|
1192
1192
|
headerName: c.table_column_interest_rate,
|
1193
|
-
renderHeader:
|
1194
|
-
renderCell: (
|
1193
|
+
renderHeader: z,
|
1194
|
+
renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(_.value) ? "---" : `${Number(_.value).toFixed(2)}%` }),
|
1195
1195
|
sortable: !0,
|
1196
1196
|
hideSortIcons: d,
|
1197
1197
|
type: "number",
|
@@ -1203,8 +1203,8 @@ const Bt = (a) => {
|
|
1203
1203
|
{
|
1204
1204
|
field: "projected_payoff_date",
|
1205
1205
|
headerName: c.table_column_payoff_date,
|
1206
|
-
renderHeader:
|
1207
|
-
renderCell: (
|
1206
|
+
renderHeader: z,
|
1207
|
+
renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: _.value ? K(_.value, U.MONTH_SHORT_YEAR) : "---" }),
|
1208
1208
|
sortable: !0,
|
1209
1209
|
hideSortIcons: d,
|
1210
1210
|
type: "number",
|
@@ -1216,8 +1216,8 @@ const Bt = (a) => {
|
|
1216
1216
|
{
|
1217
1217
|
field: "monthly_payment",
|
1218
1218
|
headerName: c.table_column_amount_due,
|
1219
|
-
renderHeader:
|
1220
|
-
renderCell: (
|
1219
|
+
renderHeader: z,
|
1220
|
+
renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof _.value == "number" ? M(_.value, "0,0") : "---" }),
|
1221
1221
|
sortable: !0,
|
1222
1222
|
hideSortIcons: d,
|
1223
1223
|
type: "number",
|
@@ -1226,8 +1226,8 @@ const Bt = (a) => {
|
|
1226
1226
|
minWidth: 122,
|
1227
1227
|
flex: 0.6
|
1228
1228
|
}
|
1229
|
-
],
|
1230
|
-
...
|
1229
|
+
], u = [
|
1230
|
+
...f.slice(0, 3),
|
1231
1231
|
{
|
1232
1232
|
field: "chevron",
|
1233
1233
|
headerName: "",
|
@@ -1240,14 +1240,14 @@ const Bt = (a) => {
|
|
1240
1240
|
headerAlign: "right",
|
1241
1241
|
width: 20
|
1242
1242
|
}
|
1243
|
-
],
|
1244
|
-
...
|
1245
|
-
id:
|
1246
|
-
priority: It(
|
1247
|
-
})), [n]),
|
1248
|
-
const
|
1249
|
-
t?.(
|
1250
|
-
},
|
1243
|
+
], S = x.useMemo(() => n.map((_, v) => ({
|
1244
|
+
..._,
|
1245
|
+
id: v,
|
1246
|
+
priority: It(_)
|
1247
|
+
})), [n]), P = (_) => {
|
1248
|
+
const L = _.target.closest("[data-id]")?.getAttribute("data-id"), h = n[Number(L)];
|
1249
|
+
t?.(h?.guid ?? "");
|
1250
|
+
}, E = (_) => S.find((v) => v.guid === _)?.id;
|
1251
1251
|
return /* @__PURE__ */ e(
|
1252
1252
|
re,
|
1253
1253
|
{
|
@@ -1262,29 +1262,29 @@ const Bt = (a) => {
|
|
1262
1262
|
children: /* @__PURE__ */ e(
|
1263
1263
|
Ye,
|
1264
1264
|
{
|
1265
|
-
columns: d ?
|
1265
|
+
columns: d ? u : f,
|
1266
1266
|
disableColumnFilter: !0,
|
1267
1267
|
disableColumnMenu: !0,
|
1268
1268
|
hideFooter: !0,
|
1269
|
-
initialState: { sorting: { sortModel:
|
1270
|
-
onRowClick: (
|
1271
|
-
o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid:
|
1269
|
+
initialState: { sorting: { sortModel: m } },
|
1270
|
+
onRowClick: (_) => {
|
1271
|
+
o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: _.row.guid });
|
1272
1272
|
},
|
1273
|
-
onSortModelChange: (
|
1274
|
-
|
1273
|
+
onSortModelChange: (_) => {
|
1274
|
+
b(_), p(T.DEBTS_CLICK_TABLE_SORT);
|
1275
1275
|
},
|
1276
|
-
rows:
|
1276
|
+
rows: S,
|
1277
1277
|
slotProps: {
|
1278
1278
|
baseIconButton: { color: "secondary", sx: { ml: 8 } },
|
1279
1279
|
row: {
|
1280
|
-
onMouseEnter:
|
1280
|
+
onMouseEnter: P,
|
1281
1281
|
onMouseLeave: () => t?.("")
|
1282
1282
|
}
|
1283
1283
|
},
|
1284
|
-
sortModel:
|
1284
|
+
sortModel: m,
|
1285
1285
|
sortingOrder: ["asc", "desc"],
|
1286
1286
|
sx: {
|
1287
|
-
[`& .MuiDataGrid-row[data-id="${
|
1287
|
+
[`& .MuiDataGrid-row[data-id="${E(r)}"]`]: {
|
1288
1288
|
backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
|
1289
1289
|
filter: "brightness(98%)"
|
1290
1290
|
}
|
@@ -1294,7 +1294,7 @@ const Bt = (a) => {
|
|
1294
1294
|
}
|
1295
1295
|
);
|
1296
1296
|
}, Nt = ({ buttonText: a, isOpen: n, onClick: r }) => {
|
1297
|
-
const { isDesktop: t, isTablet: o } =
|
1297
|
+
const { isDesktop: t, isTablet: o } = Y(), i = n ? "unfold_less" : "unfold_more";
|
1298
1298
|
return t || o ? /* @__PURE__ */ e(
|
1299
1299
|
fe,
|
1300
1300
|
{
|
@@ -1318,26 +1318,26 @@ const Bt = (a) => {
|
|
1318
1318
|
children: /* @__PURE__ */ e(ee, { name: i })
|
1319
1319
|
}
|
1320
1320
|
);
|
1321
|
-
}, Ft =
|
1321
|
+
}, Ft = D(({ buttonEl: a, onClose: n }) => {
|
1322
1322
|
const { onEvent: r } = k(), { debts: t } = C(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = R(), p = !!a, d = [
|
1323
1323
|
{
|
1324
|
-
priority:
|
1324
|
+
priority: B.FASTEST_PAYOFF_FIRST,
|
1325
1325
|
text: t.priority_sort_fastest_payoff
|
1326
1326
|
},
|
1327
1327
|
{
|
1328
|
-
priority:
|
1328
|
+
priority: B.HIGHEST_INTEREST,
|
1329
1329
|
text: t.priority_sort_highest_interest
|
1330
1330
|
},
|
1331
1331
|
{
|
1332
|
-
priority:
|
1332
|
+
priority: B.LOWEST_BALANCE,
|
1333
1333
|
text: t.priority_sort_lowest_balance
|
1334
1334
|
},
|
1335
1335
|
{
|
1336
|
-
priority:
|
1336
|
+
priority: B.HIGHEST_BALANCE,
|
1337
1337
|
text: t.priority_sort_highest_balance
|
1338
1338
|
}
|
1339
|
-
], c = (
|
1340
|
-
i(
|
1339
|
+
], c = (m) => {
|
1340
|
+
i(m), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: m });
|
1341
1341
|
};
|
1342
1342
|
return /* @__PURE__ */ e(
|
1343
1343
|
Ze,
|
@@ -1354,13 +1354,13 @@ const Bt = (a) => {
|
|
1354
1354
|
vertical: "top",
|
1355
1355
|
horizontal: "left"
|
1356
1356
|
},
|
1357
|
-
children: /* @__PURE__ */ e(_e, { children: d.map(({ priority:
|
1357
|
+
children: /* @__PURE__ */ e(_e, { children: d.map(({ priority: m, text: b }) => /* @__PURE__ */ s(
|
1358
1358
|
qe,
|
1359
1359
|
{
|
1360
|
-
onClick: () => c(
|
1360
|
+
onClick: () => c(m),
|
1361
1361
|
sx: {
|
1362
|
-
bgcolor: o ===
|
1363
|
-
color: o ===
|
1362
|
+
bgcolor: o === m ? "primary.main" : void 0,
|
1363
|
+
color: o === m ? "#fff" : void 0,
|
1364
1364
|
justifyContent: "space-between",
|
1365
1365
|
minHeight: 44,
|
1366
1366
|
minWidth: 268,
|
@@ -1373,26 +1373,26 @@ const Bt = (a) => {
|
|
1373
1373
|
}
|
1374
1374
|
},
|
1375
1375
|
children: [
|
1376
|
-
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children:
|
1377
|
-
o ===
|
1376
|
+
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: b }),
|
1377
|
+
o === m && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
|
1378
1378
|
]
|
1379
1379
|
},
|
1380
|
-
|
1380
|
+
m
|
1381
1381
|
)) })
|
1382
1382
|
}
|
1383
1383
|
);
|
1384
|
-
}), Rt =
|
1385
|
-
const { onEvent: a } = k(), { debts: n } = C(), { selectedDebtPriority: r } = R(), [t, o] = x.useState(null), i = (
|
1386
|
-
o(
|
1384
|
+
}), Rt = D(() => {
|
1385
|
+
const { onEvent: a } = k(), { debts: n } = C(), { selectedDebtPriority: r } = R(), [t, o] = x.useState(null), i = (m) => {
|
1386
|
+
o(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
|
1387
1387
|
}, p = () => {
|
1388
1388
|
o(null);
|
1389
1389
|
}, d = !!t, c = x.useMemo(() => ({
|
1390
|
-
[
|
1391
|
-
[
|
1392
|
-
[
|
1393
|
-
[
|
1390
|
+
[B.FASTEST_PAYOFF_FIRST]: n.priority_sort_fastest_payoff,
|
1391
|
+
[B.HIGHEST_INTEREST]: n.priority_sort_highest_interest,
|
1392
|
+
[B.HIGHEST_BALANCE]: n.priority_sort_highest_balance,
|
1393
|
+
[B.LOWEST_BALANCE]: n.priority_sort_lowest_balance
|
1394
1394
|
})[r] ?? n.priority_sort_lowest_balance, [r]);
|
1395
|
-
return /* @__PURE__ */ s(
|
1395
|
+
return /* @__PURE__ */ s(y, { children: [
|
1396
1396
|
/* @__PURE__ */ e(Nt, { buttonText: c, isOpen: d, onClick: i }),
|
1397
1397
|
/* @__PURE__ */ e(Ft, { buttonEl: t, onClose: p })
|
1398
1398
|
] });
|
@@ -1408,33 +1408,33 @@ const Bt = (a) => {
|
|
1408
1408
|
dataset: [{ x: new Date(o), y: c.balance }]
|
1409
1409
|
});
|
1410
1410
|
for (; t.some((c) => c.balance >= 0.01 && !c.is_impossible); ) {
|
1411
|
-
let c = !1;
|
1412
|
-
for (const [
|
1413
|
-
if (
|
1414
|
-
const
|
1415
|
-
let
|
1416
|
-
|
1417
|
-
const
|
1418
|
-
if (
|
1419
|
-
|
1411
|
+
let c = !1, m = !1, b = !1;
|
1412
|
+
for (const [f, u] of t.entries()) {
|
1413
|
+
if (u.balance <= 0.01) continue;
|
1414
|
+
const S = i[f].dataset, E = (u.interest_rate ?? 0) / 100 / 12, _ = u.balance * E, v = u.monthly_payment ?? 0;
|
1415
|
+
let H = v, L = 0;
|
1416
|
+
!b && r > 0 && (H += r, b = !0), !m && p > 0 && (L = p, m = !0), u.balance += _;
|
1417
|
+
const h = Math.min(u.balance, H + L);
|
1418
|
+
if (h <= _) {
|
1419
|
+
u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, S.push({ x: new Date(o), y: u.balance });
|
1420
1420
|
continue;
|
1421
1421
|
}
|
1422
|
-
|
1422
|
+
u.balance -= h, u.balance = u.balance < 0.01 ? 0 : u.balance, S.push({
|
1423
1423
|
x: new Date(o),
|
1424
|
-
y: Math.max(0,
|
1425
|
-
payment:
|
1426
|
-
extra:
|
1427
|
-
}),
|
1424
|
+
y: Math.max(0, u.balance),
|
1425
|
+
payment: h,
|
1426
|
+
extra: L
|
1427
|
+
}), u.balance <= 0 && (p += v, i[f].projected_payoff_date = new Date(o)), h > 0 && (c = !0);
|
1428
1428
|
}
|
1429
1429
|
c && o.setMonth(o.getMonth() + 1);
|
1430
1430
|
}
|
1431
1431
|
return i.forEach((c) => {
|
1432
|
-
(c.interest_rate === void 0 || c.
|
1432
|
+
(c.interest_rate === void 0 || c.monthly_payment === void 0) && (c.projected_payoff_date = void 0);
|
1433
1433
|
}), i.forEach((c) => {
|
1434
1434
|
c.priority = !c.is_paid_off && !c.is_impossible ? d++ : void 0;
|
1435
1435
|
}), i;
|
1436
|
-
}, $t =
|
1437
|
-
const { debts: n } = C(), { isDesktop: r } =
|
1436
|
+
}, $t = D(({ onClick: a }) => {
|
1437
|
+
const { debts: n } = C(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: o } = V(), i = t + Number(o?.extra_payment), p = r ? n.paydown_button_long : n.paydown_button_short;
|
1438
1438
|
return /* @__PURE__ */ e(
|
1439
1439
|
fe,
|
1440
1440
|
{
|
@@ -1444,33 +1444,33 @@ const Bt = (a) => {
|
|
1444
1444
|
"aria-label": "extra-paydown",
|
1445
1445
|
onClick: a,
|
1446
1446
|
sx: { justifyContent: "start", minWidth: 100, mx: 4 },
|
1447
|
-
children: A(p,
|
1447
|
+
children: A(p, M(i, "0,0"))
|
1448
1448
|
}
|
1449
1449
|
);
|
1450
1450
|
}), Ht = ({ onBackClick: a, sx: n }) => {
|
1451
|
-
const [r, t] = x.useState(!1), [o, i] = x.useState(!1), [p, d] = x.useState(!1), [c,
|
1452
|
-
const
|
1453
|
-
return Lt(F,
|
1454
|
-
}, [F,
|
1451
|
+
const [r, t] = x.useState(!1), [o, i] = x.useState(!1), [p, d] = x.useState(!1), [c, m] = x.useState(""), { isDesktop: b, isMobile: f } = Y(), { debts: u } = C(), { onEvent: S } = k(), { isCopyLoaded: P, isInitialized: E, setSelectedAccounts: _ } = Pe(), { setSelectedAccount: v } = Ne(), { selectedDebtPriority: H, setSelectedDebtChartData: L } = R(), { visibleDebtAccounts: h } = Z(), { goalsLoaded: w, loadGoals: I, monthlyCashFlowProfile: N } = V(), { debts: F } = q(), O = x.useMemo(() => {
|
1452
|
+
const W = N?.extra_payment ?? 0;
|
1453
|
+
return Lt(F, H, W);
|
1454
|
+
}, [F, H, N]);
|
1455
1455
|
x.useEffect(() => {
|
1456
|
-
|
1456
|
+
_(h), S(T.DEBTS_VIEW);
|
1457
1457
|
}, []), x.useEffect(() => {
|
1458
|
-
|
1459
|
-
}, [
|
1460
|
-
|
1461
|
-
}, [
|
1462
|
-
const ne = (
|
1463
|
-
const
|
1464
|
-
|
1465
|
-
}, we = () =>
|
1466
|
-
d(!0),
|
1458
|
+
_(h);
|
1459
|
+
}, [h]), x.useEffect(() => {
|
1460
|
+
E && I().finally();
|
1461
|
+
}, [E]);
|
1462
|
+
const ne = (W) => m(W), oe = () => {
|
1463
|
+
const W = h.find((Q) => Q.guid === c), ie = O.find((Q) => Q.guid === c);
|
1464
|
+
W && v(W), ie && L(ie), t(!0);
|
1465
|
+
}, we = () => S(T.DEBTS_CLICK_FILTER), Ce = () => {
|
1466
|
+
d(!0), S(T.DEBTS_CLICK_SNOWBALL_CTA);
|
1467
1467
|
}, Se = () => {
|
1468
|
-
i(!0),
|
1468
|
+
i(!0), S(T.DEBTS_CLICK_PAYDOWN);
|
1469
1469
|
};
|
1470
|
-
return !w || !
|
1470
|
+
return !w || !P || !E ? /* @__PURE__ */ e(Je, {}) : /* @__PURE__ */ s(
|
1471
1471
|
Oe,
|
1472
1472
|
{
|
1473
|
-
accountOptions:
|
1473
|
+
accountOptions: h,
|
1474
1474
|
actions: [
|
1475
1475
|
/* @__PURE__ */ e(Rt, {}, "prioritize-debts"),
|
1476
1476
|
/* @__PURE__ */ e($t, { onClick: Se }, "extra-paydown")
|
@@ -1478,44 +1478,44 @@ const Bt = (a) => {
|
|
1478
1478
|
onAccountsFilterClick: we,
|
1479
1479
|
onBackClick: a,
|
1480
1480
|
sx: n,
|
1481
|
-
title:
|
1481
|
+
title: u.title,
|
1482
1482
|
children: [
|
1483
|
-
/* @__PURE__ */ s(g, { sx: { px:
|
1483
|
+
/* @__PURE__ */ s(g, { sx: { px: b ? "48px" : "24px" }, children: [
|
1484
1484
|
/* @__PURE__ */ s(
|
1485
1485
|
g,
|
1486
1486
|
{
|
1487
1487
|
sx: {
|
1488
|
-
alignItems:
|
1489
|
-
flexDirection:
|
1490
|
-
mx:
|
1488
|
+
alignItems: f ? "flex-start" : "flex-end",
|
1489
|
+
flexDirection: f ? "column" : "row",
|
1490
|
+
mx: f ? "-12px" : 0
|
1491
1491
|
},
|
1492
1492
|
children: [
|
1493
1493
|
/* @__PURE__ */ e(
|
1494
1494
|
ge,
|
1495
1495
|
{
|
1496
|
-
debts:
|
1497
|
-
height:
|
1496
|
+
debts: O,
|
1497
|
+
height: f ? 250 : void 0,
|
1498
1498
|
hoveredDebtGuid: c,
|
1499
1499
|
onClickArea: oe,
|
1500
1500
|
onHoverArea: ne,
|
1501
|
-
sx: { mr:
|
1501
|
+
sx: { mr: f ? "4px" : "-48px" }
|
1502
1502
|
}
|
1503
1503
|
),
|
1504
1504
|
/* @__PURE__ */ e(
|
1505
1505
|
ot,
|
1506
1506
|
{
|
1507
|
-
debts:
|
1507
|
+
debts: O,
|
1508
1508
|
onClickCta: Ce,
|
1509
|
-
sx: { mb:
|
1509
|
+
sx: { mb: f ? "0px" : "64px" }
|
1510
1510
|
}
|
1511
1511
|
)
|
1512
1512
|
]
|
1513
1513
|
}
|
1514
1514
|
),
|
1515
|
-
/* @__PURE__ */ e(g, { sx: { mx:
|
1515
|
+
/* @__PURE__ */ e(g, { sx: { mx: f ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
1516
1516
|
kt,
|
1517
1517
|
{
|
1518
|
-
debts:
|
1518
|
+
debts: O,
|
1519
1519
|
hoveredDebtGuid: c,
|
1520
1520
|
onClickRow: oe,
|
1521
1521
|
onHoverRow: ne
|
@@ -1534,7 +1534,7 @@ const Bt = (a) => {
|
|
1534
1534
|
]
|
1535
1535
|
}
|
1536
1536
|
);
|
1537
|
-
}, Pr =
|
1537
|
+
}, Pr = D(Ht);
|
1538
1538
|
export {
|
1539
1539
|
ge as DebtsChart,
|
1540
1540
|
Fr as DebtsStore,
|