@mx-cartographer/experiences 7.2.15-alpha.sms3 → 7.2.16-alpha.mm0
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/dist/{AccountDetailsContent-Vj4LO6cx.mjs → AccountDetailsContent-CsH1w_GZ.mjs} +1 -1
- package/dist/{ManageIncome-B9yGuahc.mjs → ManageIncome-CV-bGuR-.mjs} +1 -1
- package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-5i3IywCi.mjs} +238 -236
- package/dist/{RecurringSettings-D9GFcsXV.mjs → RecurringSettings-G6_BbsIF.mjs} +1 -1
- package/dist/{TransactionDetails-BqCr2FTh.mjs → TransactionDetails-CDtya0KS.mjs} +42 -42
- package/dist/{TransactionStore-Dx8hFybD.mjs → TransactionStore-DxPLdF3B.mjs} +57 -57
- package/dist/accounts/index.es.js +118 -116
- package/dist/budgets/index.es.js +501 -499
- package/dist/cashflow/index.es.js +383 -381
- package/dist/common/index.es.js +2 -2
- 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 +174 -172
- package/dist/settings/index.es.js +284 -278
- package/dist/spending/index.es.js +282 -280
- package/dist/transactions/components/shared/transactiondetails/actions/DateAction.d.ts +2 -2
- package/dist/transactions/index.es.js +4 -4
- package/dist/trends/index.es.js +1 -1
- package/package.json +1 -1
package/dist/debts/index.es.js
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import g from "react";
|
|
3
3
|
import { observer as D } from "mobx-react-lite";
|
|
4
|
-
import
|
|
5
|
-
import { useTheme as X, Card as
|
|
6
|
-
import { Text as l, H3 as
|
|
7
|
-
import { intervalToDuration as
|
|
8
|
-
import { addMonths as
|
|
9
|
-
import { fromUnixTime as
|
|
10
|
-
import { getUnixTime as
|
|
11
|
-
import { D as
|
|
12
|
-
import { a as
|
|
13
|
-
import { f as
|
|
14
|
-
import { f as
|
|
15
|
-
import { G as
|
|
4
|
+
import w from "@mui/material/Stack";
|
|
5
|
+
import { useTheme as X, Card as _e, Stack as y, Box as W } from "@mui/material";
|
|
6
|
+
import { Text as l, H3 as De, InstitutionLogo as Te, Icon as te } from "@mxenabled/mxui";
|
|
7
|
+
import { intervalToDuration as Ae, formatDuration as Ee } from "date-fns";
|
|
8
|
+
import { addMonths as se } from "date-fns/addMonths";
|
|
9
|
+
import { fromUnixTime as ce } from "date-fns/fromUnixTime";
|
|
10
|
+
import { getUnixTime as de } from "date-fns/getUnixTime";
|
|
11
|
+
import { D as I, M as Ie, I as Be } from "../DebtsStore-BD_XwsI7.mjs";
|
|
12
|
+
import { a as Lr } from "../DebtsStore-BD_XwsI7.mjs";
|
|
13
|
+
import { f as B, a as Me } from "../NumberFormatting-Buh7u8Oi.mjs";
|
|
14
|
+
import { f as U, D as q } from "../Dialog-CWW597AF.mjs";
|
|
15
|
+
import { G as Pe, y as Z, u as C, l as V, g as k, d as J, n as ke, b as Ne } from "../hooks-D6XlXHf4.mjs";
|
|
16
16
|
import { u as Y } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
|
-
import { D as
|
|
17
|
+
import { D as re } from "../Drawer-kEE73B87.mjs";
|
|
18
18
|
import { b as A } from "../Localization-2MODESHW.mjs";
|
|
19
|
-
import { A as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { LineChart as
|
|
24
|
-
import
|
|
25
|
-
import { useTheme as
|
|
26
|
-
import { A as T, W as
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import { M as
|
|
32
|
-
import
|
|
33
|
-
import { L as
|
|
34
|
-
import { C as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import { Error as
|
|
39
|
-
import { T as
|
|
40
|
-
import { DataGridPro as
|
|
41
|
-
import { H as
|
|
42
|
-
import { f as
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import { L as
|
|
48
|
-
const
|
|
19
|
+
import { A as Fe, u as Re } from "../AccountDetailsHeader-Df1JkzYi.mjs";
|
|
20
|
+
import Le from "@mui/material/Card";
|
|
21
|
+
import $e from "@mui/material/CardContent";
|
|
22
|
+
import He from "@mui/material/CardHeader";
|
|
23
|
+
import { LineChart as Oe } from "@mui/x-charts";
|
|
24
|
+
import ae from "@mui/material/Box";
|
|
25
|
+
import { useTheme as We } from "@mui/material/styles";
|
|
26
|
+
import { A as T, W as Ge } from "../WidgetContainer-EbrN1oIo.mjs";
|
|
27
|
+
import pe from "@mui/material/Tab";
|
|
28
|
+
import je from "@mui/material/Tabs";
|
|
29
|
+
import ye from "@mui/material/List";
|
|
30
|
+
import G from "@mui/material/Divider";
|
|
31
|
+
import { M as ze, I as Xe, O as Ve } from "../OriginalBalanceAction-CWuVvRq9.mjs";
|
|
32
|
+
import Ye from "@mui/material/TextField";
|
|
33
|
+
import { L as Q } from "../ListItemAction-DHa3KJPs.mjs";
|
|
34
|
+
import { C as ne } from "../CurrencyInput-DUsQbkXb.mjs";
|
|
35
|
+
import me from "@mui/material/Alert";
|
|
36
|
+
import he from "@mui/material/AlertTitle";
|
|
37
|
+
import ue from "@mui/material/Paper";
|
|
38
|
+
import { Error as Ke, CheckCircle as fe } from "@mxenabled/mx-icons";
|
|
39
|
+
import { T as be } from "../TabContentContainer-j01JYR_7.mjs";
|
|
40
|
+
import { DataGridPro as Ue } from "@mui/x-data-grid-pro";
|
|
41
|
+
import { H as j } from "../HeaderCell-DjuifqHJ.mjs";
|
|
42
|
+
import { f as qe } from "../ConnectDrawer-Bw5s6Dw1.mjs";
|
|
43
|
+
import xe from "@mui/material/Button";
|
|
44
|
+
import Ze from "@mui/material/IconButton";
|
|
45
|
+
import Je from "@mui/material/ListItem";
|
|
46
|
+
import Qe from "@mui/material/Popover";
|
|
47
|
+
import { L as et } from "../Loader-DUaFpDGv.mjs";
|
|
48
|
+
const tt = (a, n = 0, r = 0) => {
|
|
49
49
|
if (r === 0) return 0;
|
|
50
|
-
const t = n / (
|
|
50
|
+
const t = n / (Ie * Be);
|
|
51
51
|
return Math.ceil(
|
|
52
52
|
t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
|
|
53
53
|
);
|
|
54
|
-
},
|
|
54
|
+
}, rt = (a, n, r, t, o) => {
|
|
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), m = n - t * d,
|
|
58
|
+
const c = n - t * (d + 1), m = n - t * d, _ = c >= 0 ? t : m;
|
|
59
59
|
i.push({
|
|
60
60
|
balance: c >= 0 ? c : 0,
|
|
61
61
|
interest: r,
|
|
62
|
-
payment:
|
|
63
|
-
principal:
|
|
64
|
-
timestamp:
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
payment: _,
|
|
63
|
+
principal: _,
|
|
64
|
+
timestamp: de(
|
|
65
|
+
se(
|
|
66
|
+
ce(o),
|
|
67
67
|
// convert seconds → Date
|
|
68
68
|
d + 1
|
|
69
69
|
// add (index + 1) months
|
|
@@ -75,45 +75,45 @@ 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 =
|
|
78
|
+
const c = de(se(ce(o), d + 1)), m = Math.pow(1 + p, d), _ = n * m - t * ((m - 1) / p), f = Math.pow(1 + p, d + 1), h = n * f - t * ((f - 1) / p), v = t + Math.min(h, 0), M = _ * p;
|
|
79
79
|
i.push({
|
|
80
|
-
balance: Math.max(0,
|
|
81
|
-
interest:
|
|
82
|
-
payment:
|
|
83
|
-
principal:
|
|
80
|
+
balance: Math.max(0, h),
|
|
81
|
+
interest: M,
|
|
82
|
+
payment: v,
|
|
83
|
+
principal: v - M,
|
|
84
84
|
timestamp: c
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
return i;
|
|
88
|
-
},
|
|
89
|
-
const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i =
|
|
88
|
+
}, at = (a) => (a[a.length - 1] || {}).timestamp, nt = (a) => {
|
|
89
|
+
const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i = tt(t, r ?? 0, n ?? 0), p = rt(
|
|
90
90
|
i,
|
|
91
91
|
t,
|
|
92
92
|
r ?? 0,
|
|
93
93
|
n ?? 0,
|
|
94
94
|
o
|
|
95
|
-
), d =
|
|
95
|
+
), d = at(p);
|
|
96
96
|
return {
|
|
97
97
|
...a,
|
|
98
98
|
minimumFinalPayment: d,
|
|
99
99
|
minimumPayments: p
|
|
100
100
|
};
|
|
101
|
-
},
|
|
101
|
+
}, ge = (a, n) => {
|
|
102
102
|
const [r, t] = a.reduce(
|
|
103
|
-
([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(
|
|
103
|
+
([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(nt(p)), [o, i]),
|
|
104
104
|
[[], []]
|
|
105
105
|
);
|
|
106
106
|
switch (n) {
|
|
107
|
-
case
|
|
107
|
+
case I.FASTEST_PAYOFF_FIRST:
|
|
108
108
|
r.sort((o, i) => (o.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
|
|
109
109
|
break;
|
|
110
|
-
case
|
|
110
|
+
case I.HIGHEST_INTEREST:
|
|
111
111
|
r.sort((o, i) => (i.interest_rate ?? 0) - (o.interest_rate ?? 0));
|
|
112
112
|
break;
|
|
113
|
-
case
|
|
113
|
+
case I.LOWEST_BALANCE:
|
|
114
114
|
r.sort((o, i) => o.balance - i.balance);
|
|
115
115
|
break;
|
|
116
|
-
case
|
|
116
|
+
case I.HIGHEST_BALANCE:
|
|
117
117
|
r.sort((o, i) => i.balance - o.balance);
|
|
118
118
|
break;
|
|
119
119
|
default:
|
|
@@ -121,47 +121,47 @@ const Qe = (a, n = 0, r = 0) => {
|
|
|
121
121
|
}
|
|
122
122
|
a.splice(0, a.length, ...r, ...t);
|
|
123
123
|
};
|
|
124
|
-
function
|
|
125
|
-
const t = a.map((
|
|
126
|
-
(
|
|
124
|
+
function ot(a, n, r = 0) {
|
|
125
|
+
const t = a.map((_) => ({ ..._ })).filter(
|
|
126
|
+
(_) => _.interest_rate !== void 0 && _.monthly_payment !== void 0 && !_.is_paid_off
|
|
127
127
|
);
|
|
128
|
-
|
|
128
|
+
ge(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 [f,
|
|
134
|
-
if (
|
|
135
|
-
const
|
|
136
|
-
let
|
|
137
|
-
f === 0 && r && (
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
|
|
131
|
+
for (; t.some((_) => _.balance >= 0.01 && !_.is_impossible); ) {
|
|
132
|
+
let _ = !1;
|
|
133
|
+
for (const [f, h] of t.entries()) {
|
|
134
|
+
if (h.balance <= 0.01 || h.is_impossible) continue;
|
|
135
|
+
const M = (h.interest_rate ?? 0) / 100 / 12, P = h.balance * M;
|
|
136
|
+
let u = h.monthly_payment ?? 0;
|
|
137
|
+
f === 0 && r && (u += r), h.balance += P;
|
|
138
|
+
const S = Math.min(h.balance, u + i);
|
|
139
|
+
if (S <= P) {
|
|
140
|
+
h.is_impossible = !0;
|
|
141
141
|
continue;
|
|
142
142
|
}
|
|
143
|
-
|
|
143
|
+
h.balance -= S, h.balance = h.balance < 0.01 ? 0 : h.balance, o += P, h.balance <= 0 && (i += u), S > 0 && (_ = !0);
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
_ && d.setMonth(d.getMonth() + 1);
|
|
146
146
|
}
|
|
147
|
-
const c = t.some((
|
|
147
|
+
const c = t.some((_) => _.is_impossible && _.balance > 0), m = Ae({ start: p, end: d });
|
|
148
148
|
return {
|
|
149
|
-
payoffSavings: c ? "N/A" :
|
|
150
|
-
payoffDate: c ? "Never" :
|
|
151
|
-
payoffDuration: c ? "Stagnant" :
|
|
149
|
+
payoffSavings: c ? "N/A" : B(o, "0,0.00"),
|
|
150
|
+
payoffDate: c ? "Never" : U(d, q.MONTH_YEAR),
|
|
151
|
+
payoffDuration: c ? "Stagnant" : Ee(m, { format: ["years", "months"] }) || "0 months"
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
const
|
|
155
|
-
if (!
|
|
154
|
+
const F = () => {
|
|
155
|
+
if (!g.useContext(Pe))
|
|
156
156
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
157
|
-
return
|
|
158
|
-
},
|
|
159
|
-
const t = X(), { isMobile: o } = Y(), { debts: i } = C(), { selectedDebtPriority: p } =
|
|
157
|
+
return Z().uiStore;
|
|
158
|
+
}, it = ({ debts: a, onClickCta: n, sx: r }) => {
|
|
159
|
+
const t = X(), { isMobile: o } = Y(), { debts: i } = C(), { selectedDebtPriority: p } = F(), { monthlyCashFlowProfile: d } = V(), { payoffDate: c, payoffSavings: m, payoffDuration: _ } = g.useMemo(() => {
|
|
160
160
|
const f = d?.extra_payment ?? 0;
|
|
161
|
-
return
|
|
161
|
+
return ot(a, p, f);
|
|
162
162
|
}, [a, p, d]);
|
|
163
163
|
return /* @__PURE__ */ e(
|
|
164
|
-
|
|
164
|
+
_e,
|
|
165
165
|
{
|
|
166
166
|
sx: {
|
|
167
167
|
boxShadow: t.shadows[2],
|
|
@@ -190,7 +190,7 @@ const R = () => {
|
|
|
190
190
|
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
|
|
191
191
|
] }),
|
|
192
192
|
/* @__PURE__ */ s(y, { gap: o ? "4px" : "0", children: [
|
|
193
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children:
|
|
193
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: _ }),
|
|
194
194
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
|
|
195
195
|
] }),
|
|
196
196
|
/* @__PURE__ */ e(
|
|
@@ -207,10 +207,10 @@ const R = () => {
|
|
|
207
207
|
] })
|
|
208
208
|
}
|
|
209
209
|
);
|
|
210
|
-
},
|
|
211
|
-
const r = X(), { debts: t } = C(), [o, i] =
|
|
210
|
+
}, lt = D(it), st = ({ isOpen: a, onClose: n }) => {
|
|
211
|
+
const r = X(), { debts: t } = C(), [o, i] = g.useState(!1);
|
|
212
212
|
return /* @__PURE__ */ e(
|
|
213
|
-
|
|
213
|
+
re,
|
|
214
214
|
{
|
|
215
215
|
ariaLabelClose: "",
|
|
216
216
|
isOpen: a,
|
|
@@ -224,7 +224,7 @@ const R = () => {
|
|
|
224
224
|
/* @__PURE__ */ e(l, { variant: "H1", children: t.snowball_drawer_savings }),
|
|
225
225
|
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_duration_description })
|
|
226
226
|
] }),
|
|
227
|
-
/* @__PURE__ */ s(
|
|
227
|
+
/* @__PURE__ */ s(_e, { sx: { display: "grid", py: 16, px: 24 }, children: [
|
|
228
228
|
/* @__PURE__ */ e(l, { mb: 4, variant: "H3", children: t.snowball_drawer_question }),
|
|
229
229
|
/* @__PURE__ */ e(
|
|
230
230
|
l,
|
|
@@ -267,7 +267,7 @@ const R = () => {
|
|
|
267
267
|
/* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
268
268
|
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
269
269
|
/* @__PURE__ */ e(
|
|
270
|
-
|
|
270
|
+
W,
|
|
271
271
|
{
|
|
272
272
|
sx: {
|
|
273
273
|
display: "flex",
|
|
@@ -323,7 +323,7 @@ const R = () => {
|
|
|
323
323
|
] }),
|
|
324
324
|
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
325
325
|
/* @__PURE__ */ e(
|
|
326
|
-
|
|
326
|
+
W,
|
|
327
327
|
{
|
|
328
328
|
sx: {
|
|
329
329
|
width: 20,
|
|
@@ -353,7 +353,7 @@ const R = () => {
|
|
|
353
353
|
] }),
|
|
354
354
|
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, py: 14, children: [
|
|
355
355
|
/* @__PURE__ */ e(
|
|
356
|
-
|
|
356
|
+
W,
|
|
357
357
|
{
|
|
358
358
|
sx: {
|
|
359
359
|
width: 20,
|
|
@@ -394,7 +394,7 @@ const R = () => {
|
|
|
394
394
|
/* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
395
395
|
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
396
396
|
/* @__PURE__ */ e(
|
|
397
|
-
|
|
397
|
+
W,
|
|
398
398
|
{
|
|
399
399
|
sx: {
|
|
400
400
|
display: "flex",
|
|
@@ -450,7 +450,7 @@ const R = () => {
|
|
|
450
450
|
] }),
|
|
451
451
|
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
452
452
|
/* @__PURE__ */ e(
|
|
453
|
-
|
|
453
|
+
W,
|
|
454
454
|
{
|
|
455
455
|
sx: {
|
|
456
456
|
width: 20,
|
|
@@ -502,7 +502,7 @@ const R = () => {
|
|
|
502
502
|
/* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
503
503
|
/* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
504
504
|
/* @__PURE__ */ e(
|
|
505
|
-
|
|
505
|
+
W,
|
|
506
506
|
{
|
|
507
507
|
sx: {
|
|
508
508
|
display: "flex",
|
|
@@ -568,8 +568,8 @@ const R = () => {
|
|
|
568
568
|
] })
|
|
569
569
|
}
|
|
570
570
|
);
|
|
571
|
-
},
|
|
572
|
-
function
|
|
571
|
+
}, ct = D(st), dt = "#FF7B08";
|
|
572
|
+
function pt(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))),
|
|
575
575
|
Math.max(0, Math.min(255, Math.round(t * n))),
|
|
@@ -577,7 +577,7 @@ function ct(a, n) {
|
|
|
577
577
|
];
|
|
578
578
|
return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
|
|
579
579
|
}
|
|
580
|
-
const
|
|
580
|
+
const we = ({
|
|
581
581
|
sx: a,
|
|
582
582
|
height: n = 500,
|
|
583
583
|
width: r,
|
|
@@ -586,32 +586,32 @@ const ge = ({
|
|
|
586
586
|
onClickArea: i,
|
|
587
587
|
onHoverArea: p
|
|
588
588
|
}) => {
|
|
589
|
-
const d =
|
|
589
|
+
const d = We(), { onEvent: c } = k(), m = t.filter((b) => !b.is_impossible), _ = [
|
|
590
590
|
...new Set(
|
|
591
|
-
m.flatMap((
|
|
591
|
+
m.flatMap((b) => b.dataset.map((x) => new Date(x.x).getTime()))
|
|
592
592
|
)
|
|
593
|
-
].sort((
|
|
594
|
-
const
|
|
595
|
-
let
|
|
596
|
-
const
|
|
597
|
-
const
|
|
598
|
-
return
|
|
593
|
+
].sort((b, x) => b - x).map((b) => new Date(b)), f = m.map((b) => {
|
|
594
|
+
const x = new Map(b.dataset.map((N) => [new Date(N.x).getTime(), N.y]));
|
|
595
|
+
let E = x.get(_[0].getTime()) ?? 0;
|
|
596
|
+
const L = _.map((N) => {
|
|
597
|
+
const z = x.get(N.getTime()) ?? E;
|
|
598
|
+
return E = z, { x: N, y: z };
|
|
599
599
|
});
|
|
600
|
-
return { ...
|
|
601
|
-
}),
|
|
602
|
-
(
|
|
600
|
+
return { ...b, dataset: L };
|
|
601
|
+
}), h = f.reduce(
|
|
602
|
+
(b, x) => b + (x.dataset[0]?.y ?? 0),
|
|
603
603
|
0
|
|
604
|
-
),
|
|
605
|
-
const
|
|
606
|
-
return { x:
|
|
607
|
-
}),
|
|
608
|
-
const
|
|
604
|
+
), v = _.map((b, x) => {
|
|
605
|
+
const E = x / (_.length - 1), L = h * (1 - E);
|
|
606
|
+
return { x: b, y: L };
|
|
607
|
+
}), M = Math.ceil(h / 100) * 100, P = _, u = f.map((b, x) => {
|
|
608
|
+
const E = 1 - x / f.length * 0.5, L = pt(dt, E);
|
|
609
609
|
return {
|
|
610
|
-
id: `debt-${
|
|
611
|
-
guid:
|
|
612
|
-
label:
|
|
613
|
-
data:
|
|
614
|
-
color:
|
|
610
|
+
id: `debt-${x}`,
|
|
611
|
+
guid: b.guid,
|
|
612
|
+
label: b.name,
|
|
613
|
+
data: b.dataset.map((N) => N.y),
|
|
614
|
+
color: L,
|
|
615
615
|
curve: "linear",
|
|
616
616
|
type: "line",
|
|
617
617
|
area: !0,
|
|
@@ -619,10 +619,10 @@ const ge = ({
|
|
|
619
619
|
showMark: !1
|
|
620
620
|
};
|
|
621
621
|
});
|
|
622
|
-
|
|
622
|
+
u.push({
|
|
623
623
|
id: "payoff-line",
|
|
624
624
|
label: "Payoff Line",
|
|
625
|
-
data:
|
|
625
|
+
data: v.map((b) => b.y),
|
|
626
626
|
color: d.palette.grey[700],
|
|
627
627
|
curve: "linear",
|
|
628
628
|
type: "line",
|
|
@@ -630,9 +630,9 @@ const ge = ({
|
|
|
630
630
|
showMark: !1,
|
|
631
631
|
disableHighlight: !0
|
|
632
632
|
});
|
|
633
|
-
const
|
|
633
|
+
const S = (b) => u.findIndex((x) => x?.guid === b);
|
|
634
634
|
return /* @__PURE__ */ e(
|
|
635
|
-
|
|
635
|
+
ae,
|
|
636
636
|
{
|
|
637
637
|
sx: {
|
|
638
638
|
width: "100%",
|
|
@@ -647,21 +647,21 @@ const ge = ({
|
|
|
647
647
|
}
|
|
648
648
|
},
|
|
649
649
|
children: /* @__PURE__ */ e(
|
|
650
|
-
|
|
650
|
+
Oe,
|
|
651
651
|
{
|
|
652
652
|
axisHighlight: { x: "none" },
|
|
653
653
|
disableLineItemHighlight: !0,
|
|
654
654
|
height: n,
|
|
655
|
-
onAreaClick: (
|
|
655
|
+
onAreaClick: (b, x) => {
|
|
656
656
|
i?.();
|
|
657
|
-
const
|
|
658
|
-
c(T.DEBTS_CLICK_CHART_AREA, { account_guid:
|
|
657
|
+
const E = u.find((L) => L.id === x.seriesId);
|
|
658
|
+
c(T.DEBTS_CLICK_CHART_AREA, { account_guid: E?.guid });
|
|
659
659
|
},
|
|
660
|
-
onHighlightChange: (
|
|
661
|
-
const
|
|
662
|
-
p?.(
|
|
660
|
+
onHighlightChange: (b) => {
|
|
661
|
+
const x = u.find((E) => E.id === b?.seriesId)?.guid;
|
|
662
|
+
p?.(x ?? "");
|
|
663
663
|
},
|
|
664
|
-
series:
|
|
664
|
+
series: u,
|
|
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-${S(o ?? "0")}`]: {
|
|
689
689
|
opacity: 1
|
|
690
690
|
},
|
|
691
|
-
[`& .MuiAreaElement-series-debt-${
|
|
691
|
+
[`& .MuiAreaElement-series-debt-${S(o ?? "0")}`]: {
|
|
692
692
|
opacity: 1
|
|
693
693
|
},
|
|
694
694
|
"& .MuiChartsAxis-tickLabel > tspan": {
|
|
@@ -700,30 +700,30 @@ const ge = ({
|
|
|
700
700
|
width: r,
|
|
701
701
|
xAxis: [
|
|
702
702
|
{
|
|
703
|
-
data:
|
|
703
|
+
data: P,
|
|
704
704
|
scaleType: "time",
|
|
705
|
-
min:
|
|
705
|
+
min: _[0],
|
|
706
706
|
disableTicks: !0,
|
|
707
|
-
valueFormatter: (
|
|
707
|
+
valueFormatter: (b) => U(b, q.MONTH_SHORT_YEAR)
|
|
708
708
|
}
|
|
709
709
|
],
|
|
710
710
|
yAxis: [
|
|
711
711
|
{
|
|
712
712
|
min: 0,
|
|
713
|
-
max:
|
|
713
|
+
max: M,
|
|
714
714
|
disableTicks: !0,
|
|
715
|
-
valueFormatter: (
|
|
715
|
+
valueFormatter: (b) => B(b, "0a")
|
|
716
716
|
}
|
|
717
717
|
]
|
|
718
718
|
}
|
|
719
719
|
)
|
|
720
720
|
}
|
|
721
721
|
);
|
|
722
|
-
},
|
|
723
|
-
const a = X(), { debts: n } = C(), { selectedDebtChartData: r } =
|
|
722
|
+
}, mt = () => {
|
|
723
|
+
const a = X(), { debts: n } = C(), { selectedDebtChartData: r } = F();
|
|
724
724
|
return /* @__PURE__ */ s($, { children: [
|
|
725
725
|
/* @__PURE__ */ s(
|
|
726
|
-
|
|
726
|
+
Le,
|
|
727
727
|
{
|
|
728
728
|
sx: {
|
|
729
729
|
"& .MuiCardContent-root:last-child": {
|
|
@@ -731,8 +731,8 @@ const ge = ({
|
|
|
731
731
|
}
|
|
732
732
|
},
|
|
733
733
|
children: [
|
|
734
|
-
/* @__PURE__ */ e(
|
|
735
|
-
/* @__PURE__ */ e(
|
|
734
|
+
/* @__PURE__ */ e(He, { sx: { pb: 0 }, title: /* @__PURE__ */ e(De, { sx: { pb: 4 }, children: n.details_chart_title }) }),
|
|
735
|
+
/* @__PURE__ */ e($e, { sx: { p: 0 }, children: /* @__PURE__ */ e(we, { debts: [r], height: 250 }) })
|
|
736
736
|
]
|
|
737
737
|
}
|
|
738
738
|
),
|
|
@@ -746,9 +746,9 @@ const ge = ({
|
|
|
746
746
|
}
|
|
747
747
|
)
|
|
748
748
|
] });
|
|
749
|
-
},
|
|
750
|
-
const a = X(), { onEvent: n } = k(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: o, showError: i } =
|
|
751
|
-
return
|
|
749
|
+
}, ht = D(mt), ut = () => {
|
|
750
|
+
const a = X(), { onEvent: n } = k(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: o, showError: i } = F();
|
|
751
|
+
return g.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(ye, { children: i || o ? /* @__PURE__ */ e(
|
|
752
752
|
l,
|
|
753
753
|
{
|
|
754
754
|
color: a.palette.secondary.main,
|
|
@@ -758,12 +758,12 @@ const ge = ({
|
|
|
758
758
|
children: i ? r.schedule_error_message : r.schedule_complete_message
|
|
759
759
|
}
|
|
760
760
|
) : /* @__PURE__ */ s($, { children: [
|
|
761
|
-
/* @__PURE__ */ s(
|
|
761
|
+
/* @__PURE__ */ s(w, { 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 })
|
|
764
764
|
] }),
|
|
765
|
-
t.dataset.slice(1).map(({ x: p, y: d, payment: c }) => /* @__PURE__ */ e(
|
|
766
|
-
|
|
765
|
+
t.dataset.slice(1).map(({ x: p, y: d, payment: c }) => /* @__PURE__ */ e(w, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(w, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
|
|
766
|
+
w,
|
|
767
767
|
{
|
|
768
768
|
sx: {
|
|
769
769
|
borderBottom: `1px solid ${a.palette.border.light}`,
|
|
@@ -773,12 +773,12 @@ const ge = ({
|
|
|
773
773
|
pr: 24
|
|
774
774
|
},
|
|
775
775
|
children: [
|
|
776
|
-
/* @__PURE__ */ s(
|
|
777
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children:
|
|
776
|
+
/* @__PURE__ */ s(w, { flexGrow: 1, children: [
|
|
777
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: U(p, q.MONTH_YEAR) }),
|
|
778
778
|
/* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
|
|
779
779
|
] }),
|
|
780
|
-
/* @__PURE__ */ s(
|
|
781
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children:
|
|
780
|
+
/* @__PURE__ */ s(w, { children: [
|
|
781
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: B(d, "0,0.00") }),
|
|
782
782
|
/* @__PURE__ */ e(
|
|
783
783
|
l,
|
|
784
784
|
{
|
|
@@ -786,15 +786,15 @@ const ge = ({
|
|
|
786
786
|
color: a.palette.success.main,
|
|
787
787
|
textAlign: "end",
|
|
788
788
|
variant: "Tiny",
|
|
789
|
-
children: `+${
|
|
789
|
+
children: `+${B(c, "0,0")}`
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
] })
|
|
793
793
|
]
|
|
794
794
|
}
|
|
795
795
|
) }) }, String(p))),
|
|
796
|
-
/* @__PURE__ */ e(
|
|
797
|
-
|
|
796
|
+
/* @__PURE__ */ e(w, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
|
|
797
|
+
w,
|
|
798
798
|
{
|
|
799
799
|
sx: {
|
|
800
800
|
alignItems: "center",
|
|
@@ -810,8 +810,8 @@ const ge = ({
|
|
|
810
810
|
}
|
|
811
811
|
) })
|
|
812
812
|
] }) });
|
|
813
|
-
},
|
|
814
|
-
const { debts: n } = C(), { updateAccount: r } =
|
|
813
|
+
}, bt = D(ut), _t = D(({ debt: a }) => {
|
|
814
|
+
const { debts: n } = C(), { updateAccount: r } = J(), { onEvent: t } = k(), [o, i] = g.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 = () => {
|
|
817
817
|
setTimeout(() => {
|
|
@@ -819,17 +819,17 @@ const ge = ({
|
|
|
819
819
|
}, 250);
|
|
820
820
|
};
|
|
821
821
|
return /* @__PURE__ */ e(
|
|
822
|
-
|
|
822
|
+
Q,
|
|
823
823
|
{
|
|
824
824
|
isSaveDisabled: p,
|
|
825
825
|
label: `${n.details_interest_rate} (%)`,
|
|
826
826
|
onCancel: c,
|
|
827
827
|
onSave: d,
|
|
828
828
|
primaryText: n.details_interest_rate,
|
|
829
|
-
secondaryText:
|
|
829
|
+
secondaryText: Me(Number(a.interest_rate) / 100),
|
|
830
830
|
zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
|
|
831
831
|
children: /* @__PURE__ */ e(
|
|
832
|
-
|
|
832
|
+
Ye,
|
|
833
833
|
{
|
|
834
834
|
error: p,
|
|
835
835
|
fullWidth: !0,
|
|
@@ -840,8 +840,8 @@ const ge = ({
|
|
|
840
840
|
)
|
|
841
841
|
}
|
|
842
842
|
);
|
|
843
|
-
}),
|
|
844
|
-
const { debts: n } = C(), { updateAccount: r } =
|
|
843
|
+
}), yt = D(({ debt: a }) => {
|
|
844
|
+
const { debts: n } = C(), { updateAccount: r } = J(), { onEvent: t } = k(), [o, i] = g.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 = () => {
|
|
847
847
|
setTimeout(() => {
|
|
@@ -849,17 +849,17 @@ const ge = ({
|
|
|
849
849
|
}, 250);
|
|
850
850
|
};
|
|
851
851
|
return /* @__PURE__ */ e(
|
|
852
|
-
|
|
852
|
+
Q,
|
|
853
853
|
{
|
|
854
854
|
isSaveDisabled: p,
|
|
855
855
|
label: n.details_monthly_payment,
|
|
856
856
|
onCancel: c,
|
|
857
857
|
onSave: d,
|
|
858
858
|
primaryText: n.details_monthly_payment,
|
|
859
|
-
secondaryText:
|
|
859
|
+
secondaryText: B(a.monthly_payment, "0,0"),
|
|
860
860
|
zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
|
|
861
861
|
children: /* @__PURE__ */ e(
|
|
862
|
-
|
|
862
|
+
ne,
|
|
863
863
|
{
|
|
864
864
|
amount: o,
|
|
865
865
|
autoFocus: !0,
|
|
@@ -872,8 +872,8 @@ const ge = ({
|
|
|
872
872
|
)
|
|
873
873
|
}
|
|
874
874
|
);
|
|
875
|
-
}),
|
|
876
|
-
const { debts: n } = C(), { updateAccount: r } =
|
|
875
|
+
}), ft = D(({ debt: a }) => {
|
|
876
|
+
const { debts: n } = C(), { updateAccount: r } = J(), { onEvent: t } = k(), [o, i] = g.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 = () => {
|
|
879
879
|
setTimeout(() => {
|
|
@@ -881,17 +881,17 @@ const ge = ({
|
|
|
881
881
|
}, 250);
|
|
882
882
|
};
|
|
883
883
|
return /* @__PURE__ */ e(
|
|
884
|
-
|
|
884
|
+
Q,
|
|
885
885
|
{
|
|
886
886
|
isSaveDisabled: p,
|
|
887
887
|
label: n.details_original_balance,
|
|
888
888
|
onCancel: c,
|
|
889
889
|
onSave: d,
|
|
890
890
|
primaryText: n.details_original_balance,
|
|
891
|
-
secondaryText:
|
|
891
|
+
secondaryText: B(a.original_balance, "0,0"),
|
|
892
892
|
zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
|
|
893
893
|
children: /* @__PURE__ */ e(
|
|
894
|
-
|
|
894
|
+
ne,
|
|
895
895
|
{
|
|
896
896
|
amount: o,
|
|
897
897
|
autoFocus: !0,
|
|
@@ -904,35 +904,35 @@ const ge = ({
|
|
|
904
904
|
)
|
|
905
905
|
}
|
|
906
906
|
);
|
|
907
|
-
}),
|
|
908
|
-
const { onEvent: a } = k(), { selectedDebtChartData: n } =
|
|
909
|
-
return
|
|
907
|
+
}), xt = () => {
|
|
908
|
+
const { onEvent: a } = k(), { selectedDebtChartData: n } = F();
|
|
909
|
+
return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
|
|
910
910
|
n?.goal && /* @__PURE__ */ s($, { children: [
|
|
911
|
-
/* @__PURE__ */ e(Ge, { goal: n.goal }),
|
|
912
|
-
/* @__PURE__ */ e(j, {}),
|
|
913
|
-
/* @__PURE__ */ e(je, { goal: n.goal }),
|
|
914
|
-
/* @__PURE__ */ e(j, {}),
|
|
915
911
|
/* @__PURE__ */ e(ze, { goal: n.goal }),
|
|
916
|
-
/* @__PURE__ */ e(
|
|
912
|
+
/* @__PURE__ */ e(G, {}),
|
|
913
|
+
/* @__PURE__ */ e(Xe, { goal: n.goal }),
|
|
914
|
+
/* @__PURE__ */ e(G, {}),
|
|
915
|
+
/* @__PURE__ */ e(Ve, { goal: n.goal }),
|
|
916
|
+
/* @__PURE__ */ e(G, {})
|
|
917
917
|
] }),
|
|
918
918
|
!n?.goal && n?.account && /* @__PURE__ */ s($, { children: [
|
|
919
|
-
/* @__PURE__ */ e(
|
|
920
|
-
/* @__PURE__ */ e(
|
|
921
|
-
/* @__PURE__ */ e(ut, { debt: n }),
|
|
922
|
-
/* @__PURE__ */ e(j, {}),
|
|
919
|
+
/* @__PURE__ */ e(yt, { debt: n }),
|
|
920
|
+
/* @__PURE__ */ e(G, {}),
|
|
923
921
|
/* @__PURE__ */ e(_t, { debt: n }),
|
|
924
|
-
/* @__PURE__ */ e(
|
|
922
|
+
/* @__PURE__ */ e(G, {}),
|
|
923
|
+
/* @__PURE__ */ e(ft, { debt: n }),
|
|
924
|
+
/* @__PURE__ */ e(G, {})
|
|
925
925
|
] })
|
|
926
926
|
] });
|
|
927
|
-
},
|
|
928
|
-
const { debts: r } = C(), { showError: t, showCompleted: o } =
|
|
929
|
-
return
|
|
927
|
+
}, gt = D(xt), wt = ({ setTabValue: a, sx: n }) => {
|
|
928
|
+
const { debts: r } = C(), { showError: t, showCompleted: o } = F();
|
|
929
|
+
return g.useEffect(() => {
|
|
930
930
|
t && a(1);
|
|
931
|
-
}, [t]), !t && !o ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ s(
|
|
932
|
-
/* @__PURE__ */ e(
|
|
933
|
-
|
|
931
|
+
}, [t]), !t && !o ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
|
|
932
|
+
/* @__PURE__ */ e(ue, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
|
933
|
+
me,
|
|
934
934
|
{
|
|
935
|
-
icon: t ? /* @__PURE__ */ e(
|
|
935
|
+
icon: t ? /* @__PURE__ */ e(Ke, { filled: !0 }) : /* @__PURE__ */ e(fe, { color: "success", filled: !0 }),
|
|
936
936
|
severity: "error",
|
|
937
937
|
sx: {
|
|
938
938
|
alignItems: "start",
|
|
@@ -945,13 +945,13 @@ const ge = ({
|
|
|
945
945
|
}
|
|
946
946
|
},
|
|
947
947
|
children: [
|
|
948
|
-
/* @__PURE__ */ e(
|
|
948
|
+
/* @__PURE__ */ e(he, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: t ? r.status_error_title : r.status_complete_title }),
|
|
949
949
|
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: t ? r.status_error_description : r.status_complete_description })
|
|
950
950
|
]
|
|
951
951
|
}
|
|
952
952
|
) }),
|
|
953
|
-
t && /* @__PURE__ */ e(
|
|
954
|
-
|
|
953
|
+
t && /* @__PURE__ */ e(ue, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
|
954
|
+
me,
|
|
955
955
|
{
|
|
956
956
|
icon: /* @__PURE__ */ e($, {}),
|
|
957
957
|
severity: "error",
|
|
@@ -963,18 +963,18 @@ const ge = ({
|
|
|
963
963
|
}
|
|
964
964
|
},
|
|
965
965
|
children: [
|
|
966
|
-
/* @__PURE__ */ e(
|
|
966
|
+
/* @__PURE__ */ e(he, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r.status_info_title }),
|
|
967
967
|
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: r.status_info_description })
|
|
968
968
|
]
|
|
969
969
|
}
|
|
970
970
|
) })
|
|
971
971
|
] });
|
|
972
|
-
},
|
|
973
|
-
const { debts: a } = C(), { showError: n, showCompleted: r } =
|
|
972
|
+
}, Ct = D(wt), St = () => {
|
|
973
|
+
const { debts: a } = C(), { showError: n, showCompleted: r } = F(), [t, o] = g.useState(0);
|
|
974
974
|
return /* @__PURE__ */ s($, { children: [
|
|
975
|
-
(n || r) && /* @__PURE__ */ e(
|
|
975
|
+
(n || r) && /* @__PURE__ */ e(Ct, { setTabValue: o, sx: { mt: -24 } }),
|
|
976
976
|
/* @__PURE__ */ s(
|
|
977
|
-
|
|
977
|
+
je,
|
|
978
978
|
{
|
|
979
979
|
"aria-label": a.details_tabs_aria_label,
|
|
980
980
|
centered: !0,
|
|
@@ -984,7 +984,7 @@ const ge = ({
|
|
|
984
984
|
variant: "fullWidth",
|
|
985
985
|
children: [
|
|
986
986
|
/* @__PURE__ */ e(
|
|
987
|
-
|
|
987
|
+
pe,
|
|
988
988
|
{
|
|
989
989
|
"aria-controls": "debt-schedule-tabpanel-0",
|
|
990
990
|
id: "debt-schedule-tab-0",
|
|
@@ -992,7 +992,7 @@ const ge = ({
|
|
|
992
992
|
}
|
|
993
993
|
),
|
|
994
994
|
/* @__PURE__ */ e(
|
|
995
|
-
|
|
995
|
+
pe,
|
|
996
996
|
{
|
|
997
997
|
"aria-controls": "debt-details-tabpanel-1",
|
|
998
998
|
id: "debt-details-tab-1",
|
|
@@ -1002,26 +1002,26 @@ const ge = ({
|
|
|
1002
1002
|
]
|
|
1003
1003
|
}
|
|
1004
1004
|
),
|
|
1005
|
-
/* @__PURE__ */ e(
|
|
1006
|
-
/* @__PURE__ */ e(
|
|
1005
|
+
/* @__PURE__ */ e(be, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(bt, {}) }),
|
|
1006
|
+
/* @__PURE__ */ e(be, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(gt, {}) })
|
|
1007
1007
|
] });
|
|
1008
|
-
},
|
|
1009
|
-
const { debts: r } = C(), { showError: t, showCompleted: o } =
|
|
1008
|
+
}, vt = D(St), Dt = ({ isOpen: a, onClose: n }) => {
|
|
1009
|
+
const { debts: r } = C(), { showError: t, showCompleted: o } = F(), i = t || o ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(ht, {});
|
|
1010
1010
|
return /* @__PURE__ */ e(
|
|
1011
|
-
|
|
1011
|
+
re,
|
|
1012
1012
|
{
|
|
1013
1013
|
ariaLabelClose: r.details_close_aria,
|
|
1014
1014
|
isOpen: a,
|
|
1015
1015
|
onClose: n,
|
|
1016
1016
|
title: r.details_title,
|
|
1017
|
-
children: /* @__PURE__ */ s(
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
1019
|
-
/* @__PURE__ */ e(
|
|
1017
|
+
children: /* @__PURE__ */ s(w, { bgcolor: "background.default", children: [
|
|
1018
|
+
/* @__PURE__ */ e(Fe, { customDetailsChart: i }),
|
|
1019
|
+
/* @__PURE__ */ e(vt, {})
|
|
1020
1020
|
] })
|
|
1021
1021
|
}
|
|
1022
1022
|
);
|
|
1023
|
-
},
|
|
1024
|
-
const { debts: a } = C(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = k(), [o, i] =
|
|
1023
|
+
}, Tt = D(() => {
|
|
1024
|
+
const { debts: a } = C(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = k(), [o, i] = g.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
|
}));
|
|
@@ -1031,17 +1031,17 @@ const ge = ({
|
|
|
1031
1031
|
}, 250);
|
|
1032
1032
|
};
|
|
1033
1033
|
return /* @__PURE__ */ e(
|
|
1034
|
-
|
|
1034
|
+
Q,
|
|
1035
1035
|
{
|
|
1036
1036
|
isSaveDisabled: p,
|
|
1037
1037
|
label: a.paydown_drawer_extra_payment,
|
|
1038
1038
|
onCancel: c,
|
|
1039
1039
|
onSave: d,
|
|
1040
1040
|
primaryText: a.paydown_drawer_extra_payment,
|
|
1041
|
-
secondaryText:
|
|
1041
|
+
secondaryText: B(n?.extra_payment, "0,0"),
|
|
1042
1042
|
zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
|
|
1043
1043
|
children: /* @__PURE__ */ e(
|
|
1044
|
-
|
|
1044
|
+
ne,
|
|
1045
1045
|
{
|
|
1046
1046
|
amount: o,
|
|
1047
1047
|
autoFocus: !0,
|
|
@@ -1054,40 +1054,40 @@ const ge = ({
|
|
|
1054
1054
|
)
|
|
1055
1055
|
}
|
|
1056
1056
|
);
|
|
1057
|
-
}),
|
|
1058
|
-
const { debts: a } = C(), { totalMonthlyPayments: n } =
|
|
1059
|
-
return /* @__PURE__ */ s(
|
|
1060
|
-
/* @__PURE__ */ s(
|
|
1061
|
-
/* @__PURE__ */ s(
|
|
1057
|
+
}), At = () => {
|
|
1058
|
+
const { debts: a } = C(), { totalMonthlyPayments: n } = Z(), { monthlyCashFlowProfile: r } = V(), t = n + Number(r?.extra_payment);
|
|
1059
|
+
return /* @__PURE__ */ s(w, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
1060
|
+
/* @__PURE__ */ s(w, { p: 24, children: [
|
|
1061
|
+
/* @__PURE__ */ s(w, { 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: B(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
|
-
/* @__PURE__ */ s(
|
|
1066
|
+
/* @__PURE__ */ s(w, { children: [
|
|
1067
1067
|
/* @__PURE__ */ e(l, { variant: "H3", children: a.paydown_drawer_subtitle }),
|
|
1068
1068
|
/* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
|
|
1069
1069
|
] })
|
|
1070
1070
|
] }),
|
|
1071
|
-
/* @__PURE__ */ e(
|
|
1072
|
-
/* @__PURE__ */ e(
|
|
1071
|
+
/* @__PURE__ */ e(w, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Tt, {}) }),
|
|
1072
|
+
/* @__PURE__ */ e(w, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(w, { 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: B(t, "0,0") })
|
|
1075
1075
|
] }) })
|
|
1076
1076
|
] });
|
|
1077
|
-
},
|
|
1077
|
+
}, Et = D(At), It = ({ isOpen: a, onClose: n }) => {
|
|
1078
1078
|
const { debts: r } = C();
|
|
1079
1079
|
return /* @__PURE__ */ e(
|
|
1080
|
-
|
|
1080
|
+
re,
|
|
1081
1081
|
{
|
|
1082
1082
|
ariaLabelClose: r.paydown_drawer_close_aria,
|
|
1083
1083
|
isOpen: a,
|
|
1084
1084
|
onClose: n,
|
|
1085
1085
|
title: r.paydown_drawer_title,
|
|
1086
|
-
children: /* @__PURE__ */ e(
|
|
1086
|
+
children: /* @__PURE__ */ e(Et, {})
|
|
1087
1087
|
}
|
|
1088
1088
|
);
|
|
1089
1089
|
};
|
|
1090
|
-
function
|
|
1090
|
+
function Bt(a, n) {
|
|
1091
1091
|
const r = (t) => {
|
|
1092
1092
|
if (typeof t == "number") return t;
|
|
1093
1093
|
if (t === "!" || t === "✓") return 1 / 0;
|
|
@@ -1095,19 +1095,19 @@ function Et(a, n) {
|
|
|
1095
1095
|
};
|
|
1096
1096
|
return r(a) - r(n);
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function Mt(a) {
|
|
1099
1099
|
return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
|
|
1100
1100
|
}
|
|
1101
|
-
const
|
|
1101
|
+
const Pt = (a) => {
|
|
1102
1102
|
const n = {
|
|
1103
1103
|
text: "#121417",
|
|
1104
1104
|
background: "#FFB252"
|
|
1105
1105
|
};
|
|
1106
1106
|
return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
|
|
1107
|
-
},
|
|
1108
|
-
const n = String(a.formattedValue), r =
|
|
1107
|
+
}, kt = (a) => {
|
|
1108
|
+
const n = String(a.formattedValue), r = Pt(n);
|
|
1109
1109
|
return /* @__PURE__ */ e(
|
|
1110
|
-
|
|
1110
|
+
ae,
|
|
1111
1111
|
{
|
|
1112
1112
|
sx: {
|
|
1113
1113
|
display: "flex",
|
|
@@ -1123,37 +1123,37 @@ const Bt = (a) => {
|
|
|
1123
1123
|
children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: n })
|
|
1124
1124
|
}
|
|
1125
1125
|
);
|
|
1126
|
-
},
|
|
1127
|
-
const n = a.row.account, r =
|
|
1128
|
-
return /* @__PURE__ */ s(
|
|
1126
|
+
}, Nt = (a) => {
|
|
1127
|
+
const n = a.row.account, r = qe[n.account_type];
|
|
1128
|
+
return /* @__PURE__ */ s(w, { alignItems: "center", flexDirection: "row", children: [
|
|
1129
1129
|
/* @__PURE__ */ e(
|
|
1130
|
-
|
|
1130
|
+
Te,
|
|
1131
1131
|
{
|
|
1132
1132
|
alt: `${n.institutionName}`,
|
|
1133
1133
|
institutionGuid: n.institution_guid || ""
|
|
1134
1134
|
}
|
|
1135
1135
|
),
|
|
1136
|
-
/* @__PURE__ */ s(
|
|
1136
|
+
/* @__PURE__ */ s(w, { ml: 12, children: [
|
|
1137
1137
|
/* @__PURE__ */ e(l, { variant: "Small", children: n.name }),
|
|
1138
1138
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: r })
|
|
1139
1139
|
] })
|
|
1140
1140
|
] });
|
|
1141
|
-
},
|
|
1141
|
+
}, Ft = ({
|
|
1142
1142
|
sx: a = {},
|
|
1143
1143
|
debts: n,
|
|
1144
1144
|
hoveredDebtGuid: r,
|
|
1145
1145
|
onHoverRow: t,
|
|
1146
1146
|
onClickRow: o
|
|
1147
1147
|
}) => {
|
|
1148
|
-
const i = X(), { onEvent: p } = k(), { isMobile: d } = Y(), { debts: c } = C(), [m,
|
|
1148
|
+
const i = X(), { onEvent: p } = k(), { isMobile: d } = Y(), { debts: c } = C(), [m, _] = g.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:
|
|
1155
|
-
renderCell:
|
|
1156
|
-
sortComparator:
|
|
1154
|
+
renderHeader: j,
|
|
1155
|
+
renderCell: kt,
|
|
1156
|
+
sortComparator: Bt,
|
|
1157
1157
|
sortable: !0,
|
|
1158
1158
|
hideSortIcons: !0,
|
|
1159
1159
|
type: "custom",
|
|
@@ -1165,8 +1165,8 @@ const Bt = (a) => {
|
|
|
1165
1165
|
{
|
|
1166
1166
|
field: "account",
|
|
1167
1167
|
headerName: c.table_column_account,
|
|
1168
|
-
renderHeader:
|
|
1169
|
-
renderCell:
|
|
1168
|
+
renderHeader: j,
|
|
1169
|
+
renderCell: Nt,
|
|
1170
1170
|
sortable: !1,
|
|
1171
1171
|
type: "custom",
|
|
1172
1172
|
align: "left",
|
|
@@ -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: j,
|
|
1181
|
+
renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: B(u.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: j,
|
|
1194
|
+
renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(u.value) ? "---" : `${Number(u.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: j,
|
|
1207
|
+
renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: u.value ? U(u.value, q.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: j,
|
|
1220
|
+
renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof u.value == "number" ? B(u.value, "0,0") : "---" }),
|
|
1221
1221
|
sortable: !0,
|
|
1222
1222
|
hideSortIcons: d,
|
|
1223
1223
|
type: "number",
|
|
@@ -1226,13 +1226,13 @@ const Bt = (a) => {
|
|
|
1226
1226
|
minWidth: 122,
|
|
1227
1227
|
flex: 0.6
|
|
1228
1228
|
}
|
|
1229
|
-
],
|
|
1229
|
+
], h = [
|
|
1230
1230
|
...f.slice(0, 3),
|
|
1231
1231
|
{
|
|
1232
1232
|
field: "chevron",
|
|
1233
1233
|
headerName: "",
|
|
1234
1234
|
renderHeader: void 0,
|
|
1235
|
-
renderCell: () => /* @__PURE__ */ e(
|
|
1235
|
+
renderCell: () => /* @__PURE__ */ e(te, { name: "chevron_right'" }),
|
|
1236
1236
|
sortable: !0,
|
|
1237
1237
|
hideSortIcons: !0,
|
|
1238
1238
|
type: "custom",
|
|
@@ -1240,16 +1240,16 @@ const Bt = (a) => {
|
|
|
1240
1240
|
headerAlign: "right",
|
|
1241
1241
|
width: 20
|
|
1242
1242
|
}
|
|
1243
|
-
],
|
|
1244
|
-
...
|
|
1245
|
-
id:
|
|
1246
|
-
priority:
|
|
1247
|
-
})), [n]),
|
|
1248
|
-
const
|
|
1249
|
-
t?.(
|
|
1250
|
-
},
|
|
1243
|
+
], v = g.useMemo(() => n.map((u, S) => ({
|
|
1244
|
+
...u,
|
|
1245
|
+
id: S,
|
|
1246
|
+
priority: Mt(u)
|
|
1247
|
+
})), [n]), M = (u) => {
|
|
1248
|
+
const R = u.target.closest("[data-id]")?.getAttribute("data-id"), b = n[Number(R)];
|
|
1249
|
+
t?.(b?.guid ?? "");
|
|
1250
|
+
}, P = (u) => v.find((S) => S.guid === u)?.id;
|
|
1251
1251
|
return /* @__PURE__ */ e(
|
|
1252
|
-
|
|
1252
|
+
ae,
|
|
1253
1253
|
{
|
|
1254
1254
|
sx: {
|
|
1255
1255
|
height: "100dvh",
|
|
@@ -1260,31 +1260,31 @@ const Bt = (a) => {
|
|
|
1260
1260
|
...a
|
|
1261
1261
|
},
|
|
1262
1262
|
children: /* @__PURE__ */ e(
|
|
1263
|
-
|
|
1263
|
+
Ue,
|
|
1264
1264
|
{
|
|
1265
|
-
columns: d ?
|
|
1265
|
+
columns: d ? h : f,
|
|
1266
1266
|
disableColumnFilter: !0,
|
|
1267
1267
|
disableColumnMenu: !0,
|
|
1268
1268
|
hideFooter: !0,
|
|
1269
1269
|
initialState: { sorting: { sortModel: m } },
|
|
1270
|
-
onRowClick: (
|
|
1271
|
-
o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid:
|
|
1270
|
+
onRowClick: (u) => {
|
|
1271
|
+
o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: u.row.guid });
|
|
1272
1272
|
},
|
|
1273
|
-
onSortModelChange: (
|
|
1274
|
-
|
|
1273
|
+
onSortModelChange: (u) => {
|
|
1274
|
+
_(u), p(T.DEBTS_CLICK_TABLE_SORT);
|
|
1275
1275
|
},
|
|
1276
|
-
rows:
|
|
1276
|
+
rows: v,
|
|
1277
1277
|
slotProps: {
|
|
1278
1278
|
baseIconButton: { color: "secondary", sx: { ml: 8 } },
|
|
1279
1279
|
row: {
|
|
1280
|
-
onMouseEnter:
|
|
1280
|
+
onMouseEnter: M,
|
|
1281
1281
|
onMouseLeave: () => t?.("")
|
|
1282
1282
|
}
|
|
1283
1283
|
},
|
|
1284
1284
|
sortModel: m,
|
|
1285
1285
|
sortingOrder: ["asc", "desc"],
|
|
1286
1286
|
sx: {
|
|
1287
|
-
[`& .MuiDataGrid-row[data-id="${
|
|
1287
|
+
[`& .MuiDataGrid-row[data-id="${P(r)}"]`]: {
|
|
1288
1288
|
backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
|
|
1289
1289
|
filter: "brightness(98%)"
|
|
1290
1290
|
}
|
|
@@ -1293,54 +1293,54 @@ const Bt = (a) => {
|
|
|
1293
1293
|
)
|
|
1294
1294
|
}
|
|
1295
1295
|
);
|
|
1296
|
-
},
|
|
1296
|
+
}, Rt = ({ buttonText: a, isOpen: n, onClick: r }) => {
|
|
1297
1297
|
const { isDesktop: t, isTablet: o } = Y(), i = n ? "unfold_less" : "unfold_more";
|
|
1298
1298
|
return t || o ? /* @__PURE__ */ e(
|
|
1299
|
-
|
|
1299
|
+
xe,
|
|
1300
1300
|
{
|
|
1301
1301
|
"aria-controls": "prioritize-debts",
|
|
1302
1302
|
"aria-describedby": "prioritize-debts",
|
|
1303
1303
|
"aria-haspopup": !0,
|
|
1304
1304
|
"aria-label": "prioritize-debts",
|
|
1305
1305
|
onClick: r,
|
|
1306
|
-
startIcon: /* @__PURE__ */ e(
|
|
1306
|
+
startIcon: /* @__PURE__ */ e(te, { name: i }),
|
|
1307
1307
|
sx: { justifyContent: "start", minWidth: 214, mx: 4 },
|
|
1308
1308
|
children: a
|
|
1309
1309
|
}
|
|
1310
1310
|
) : /* @__PURE__ */ e(
|
|
1311
|
-
|
|
1311
|
+
Ze,
|
|
1312
1312
|
{
|
|
1313
1313
|
"aria-controls": "prioritize-debts",
|
|
1314
1314
|
"aria-describedby": "prioritize-debts",
|
|
1315
1315
|
"aria-haspopup": !0,
|
|
1316
1316
|
"aria-label": "prioritize-debts",
|
|
1317
1317
|
onClick: r,
|
|
1318
|
-
children: /* @__PURE__ */ e(
|
|
1318
|
+
children: /* @__PURE__ */ e(te, { name: i })
|
|
1319
1319
|
}
|
|
1320
1320
|
);
|
|
1321
|
-
},
|
|
1322
|
-
const { onEvent: r } = k(), { debts: t } = C(), { selectedDebtPriority: o, setSelectedDebtPriority: i } =
|
|
1321
|
+
}, Lt = D(({ buttonEl: a, onClose: n }) => {
|
|
1322
|
+
const { onEvent: r } = k(), { debts: t } = C(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = F(), p = !!a, d = [
|
|
1323
1323
|
{
|
|
1324
|
-
priority:
|
|
1324
|
+
priority: I.FASTEST_PAYOFF_FIRST,
|
|
1325
1325
|
text: t.priority_sort_fastest_payoff
|
|
1326
1326
|
},
|
|
1327
1327
|
{
|
|
1328
|
-
priority:
|
|
1328
|
+
priority: I.HIGHEST_INTEREST,
|
|
1329
1329
|
text: t.priority_sort_highest_interest
|
|
1330
1330
|
},
|
|
1331
1331
|
{
|
|
1332
|
-
priority:
|
|
1332
|
+
priority: I.LOWEST_BALANCE,
|
|
1333
1333
|
text: t.priority_sort_lowest_balance
|
|
1334
1334
|
},
|
|
1335
1335
|
{
|
|
1336
|
-
priority:
|
|
1336
|
+
priority: I.HIGHEST_BALANCE,
|
|
1337
1337
|
text: t.priority_sort_highest_balance
|
|
1338
1338
|
}
|
|
1339
1339
|
], c = (m) => {
|
|
1340
1340
|
i(m), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: m });
|
|
1341
1341
|
};
|
|
1342
1342
|
return /* @__PURE__ */ e(
|
|
1343
|
-
|
|
1343
|
+
Qe,
|
|
1344
1344
|
{
|
|
1345
1345
|
anchorEl: a,
|
|
1346
1346
|
anchorOrigin: {
|
|
@@ -1354,8 +1354,8 @@ const Bt = (a) => {
|
|
|
1354
1354
|
vertical: "top",
|
|
1355
1355
|
horizontal: "left"
|
|
1356
1356
|
},
|
|
1357
|
-
children: /* @__PURE__ */ e(
|
|
1358
|
-
|
|
1357
|
+
children: /* @__PURE__ */ e(ye, { children: d.map(({ priority: m, text: _ }) => /* @__PURE__ */ s(
|
|
1358
|
+
Je,
|
|
1359
1359
|
{
|
|
1360
1360
|
onClick: () => c(m),
|
|
1361
1361
|
sx: {
|
|
@@ -1373,32 +1373,32 @@ const Bt = (a) => {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
},
|
|
1375
1375
|
children: [
|
|
1376
|
-
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children:
|
|
1377
|
-
o === m && /* @__PURE__ */ e(
|
|
1376
|
+
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: _ }),
|
|
1377
|
+
o === m && /* @__PURE__ */ e(fe, { color: "inherit", filled: !0, fontSize: "small" })
|
|
1378
1378
|
]
|
|
1379
1379
|
},
|
|
1380
1380
|
m
|
|
1381
1381
|
)) })
|
|
1382
1382
|
}
|
|
1383
1383
|
);
|
|
1384
|
-
}),
|
|
1385
|
-
const { onEvent: a } = k(), { debts: n } = C(), { selectedDebtPriority: r } =
|
|
1384
|
+
}), $t = D(() => {
|
|
1385
|
+
const { onEvent: a } = k(), { debts: n } = C(), { selectedDebtPriority: r } = F(), [t, o] = g.useState(null), i = (m) => {
|
|
1386
1386
|
o(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
|
|
1387
1387
|
}, p = () => {
|
|
1388
1388
|
o(null);
|
|
1389
|
-
}, d = !!t, c =
|
|
1390
|
-
[
|
|
1391
|
-
[
|
|
1392
|
-
[
|
|
1393
|
-
[
|
|
1389
|
+
}, d = !!t, c = g.useMemo(() => ({
|
|
1390
|
+
[I.FASTEST_PAYOFF_FIRST]: n.priority_sort_fastest_payoff,
|
|
1391
|
+
[I.HIGHEST_INTEREST]: n.priority_sort_highest_interest,
|
|
1392
|
+
[I.HIGHEST_BALANCE]: n.priority_sort_highest_balance,
|
|
1393
|
+
[I.LOWEST_BALANCE]: n.priority_sort_lowest_balance
|
|
1394
1394
|
})[r] ?? n.priority_sort_lowest_balance, [r]);
|
|
1395
1395
|
return /* @__PURE__ */ s(y, { children: [
|
|
1396
|
-
/* @__PURE__ */ e(
|
|
1397
|
-
/* @__PURE__ */ e(
|
|
1396
|
+
/* @__PURE__ */ e(Rt, { buttonText: c, isOpen: d, onClick: i }),
|
|
1397
|
+
/* @__PURE__ */ e(Lt, { buttonEl: t, onClose: p })
|
|
1398
1398
|
] });
|
|
1399
|
-
}),
|
|
1399
|
+
}), Ht = (a, n, r = 0) => {
|
|
1400
1400
|
const t = a.map((c) => ({ ...c }));
|
|
1401
|
-
|
|
1401
|
+
ge(t, n);
|
|
1402
1402
|
const o = /* @__PURE__ */ new Date(), i = [];
|
|
1403
1403
|
let p = 0, d = 1;
|
|
1404
1404
|
for (const c of t)
|
|
@@ -1408,23 +1408,23 @@ 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, m = !1,
|
|
1412
|
-
for (const [f,
|
|
1413
|
-
if (
|
|
1414
|
-
const
|
|
1415
|
-
let H =
|
|
1416
|
-
!
|
|
1417
|
-
const
|
|
1418
|
-
if (
|
|
1419
|
-
|
|
1411
|
+
let c = !1, m = !1, _ = !1;
|
|
1412
|
+
for (const [f, h] of t.entries()) {
|
|
1413
|
+
if (h.balance <= 0.01) continue;
|
|
1414
|
+
const v = i[f].dataset, P = (h.interest_rate ?? 0) / 100 / 12, u = h.balance * P, S = h.monthly_payment ?? 0;
|
|
1415
|
+
let H = S, R = 0;
|
|
1416
|
+
!_ && r > 0 && (H += r, _ = !0), !m && p > 0 && (R = p, m = !0), h.balance += u;
|
|
1417
|
+
const b = Math.min(h.balance, H + R);
|
|
1418
|
+
if (b <= u) {
|
|
1419
|
+
h.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, v.push({ x: new Date(o), y: h.balance });
|
|
1420
1420
|
continue;
|
|
1421
1421
|
}
|
|
1422
|
-
|
|
1422
|
+
h.balance -= b, h.balance = h.balance < 0.01 ? 0 : h.balance, v.push({
|
|
1423
1423
|
x: new Date(o),
|
|
1424
|
-
y: Math.max(0,
|
|
1425
|
-
payment:
|
|
1426
|
-
extra:
|
|
1427
|
-
}),
|
|
1424
|
+
y: Math.max(0, h.balance),
|
|
1425
|
+
payment: b,
|
|
1426
|
+
extra: R
|
|
1427
|
+
}), h.balance <= 0 && (p += S, i[f].projected_payoff_date = new Date(o)), b > 0 && (c = !0);
|
|
1428
1428
|
}
|
|
1429
1429
|
c && o.setMonth(o.getMonth() + 1);
|
|
1430
1430
|
}
|
|
@@ -1433,10 +1433,10 @@ const Bt = (a) => {
|
|
|
1433
1433
|
}), i.forEach((c) => {
|
|
1434
1434
|
c.priority = !c.is_paid_off && !c.is_impossible ? d++ : void 0;
|
|
1435
1435
|
}), i;
|
|
1436
|
-
},
|
|
1437
|
-
const { debts: n } = C(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } =
|
|
1436
|
+
}, Ot = D(({ onClick: a }) => {
|
|
1437
|
+
const { debts: n } = C(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = Z(), { 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
|
+
xe,
|
|
1440
1440
|
{
|
|
1441
1441
|
"aria-controls": "extra-paydown",
|
|
1442
1442
|
"aria-describedby": "extra-paydown",
|
|
@@ -1444,45 +1444,47 @@ 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, B(i, "0,0"))
|
|
1448
1448
|
}
|
|
1449
1449
|
);
|
|
1450
|
-
}),
|
|
1451
|
-
const [r, t] =
|
|
1452
|
-
const
|
|
1453
|
-
return
|
|
1454
|
-
}, [
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
}, []),
|
|
1458
|
-
|
|
1459
|
-
}, [
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
}, Se = () => {
|
|
1468
|
-
|
|
1450
|
+
}), Wt = ({ onBackClick: a, sx: n }) => {
|
|
1451
|
+
const [r, t] = g.useState(!1), [o, i] = g.useState(!1), [p, d] = g.useState(!1), [c, m] = g.useState(""), { isDesktop: _, isMobile: f } = Y(), { debts: h } = C(), { onEvent: v } = k(), { onLoad: M } = ke(), { isCopyLoaded: P, isInitialized: u, setSelectedAccounts: S } = Ne(), { setSelectedAccount: H } = Re(), { selectedDebtPriority: R, setSelectedDebtChartData: b } = F(), { visibleDebtAccounts: x } = J(), { goalsLoaded: E, loadGoals: L, monthlyCashFlowProfile: N } = V(), { debts: z } = Z(), K = g.useMemo(() => {
|
|
1452
|
+
const O = N?.extra_payment ?? 0;
|
|
1453
|
+
return Ht(z, R, O);
|
|
1454
|
+
}, [z, R, N]);
|
|
1455
|
+
g.useEffect(() => {
|
|
1456
|
+
S(x), v(T.DEBTS_VIEW);
|
|
1457
|
+
}, []), g.useEffect(() => {
|
|
1458
|
+
S(x);
|
|
1459
|
+
}, [x]), g.useEffect(() => {
|
|
1460
|
+
u && L().finally(() => {
|
|
1461
|
+
M?.("DebtsWidget");
|
|
1462
|
+
});
|
|
1463
|
+
}, [u]);
|
|
1464
|
+
const oe = (O) => m(O), ie = () => {
|
|
1465
|
+
const O = x.find((ee) => ee.guid === c), le = K.find((ee) => ee.guid === c);
|
|
1466
|
+
O && H(O), le && b(le), t(!0);
|
|
1467
|
+
}, Ce = () => v(T.DEBTS_CLICK_FILTER), Se = () => {
|
|
1468
|
+
d(!0), v(T.DEBTS_CLICK_SNOWBALL_CTA);
|
|
1469
|
+
}, ve = () => {
|
|
1470
|
+
i(!0), v(T.DEBTS_CLICK_PAYDOWN);
|
|
1469
1471
|
};
|
|
1470
|
-
return !
|
|
1471
|
-
|
|
1472
|
+
return !E || !P || !u ? /* @__PURE__ */ e(et, {}) : /* @__PURE__ */ s(
|
|
1473
|
+
Ge,
|
|
1472
1474
|
{
|
|
1473
|
-
accountOptions:
|
|
1475
|
+
accountOptions: x,
|
|
1474
1476
|
actions: [
|
|
1475
|
-
/* @__PURE__ */ e(
|
|
1476
|
-
/* @__PURE__ */ e(
|
|
1477
|
+
/* @__PURE__ */ e($t, {}, "prioritize-debts"),
|
|
1478
|
+
/* @__PURE__ */ e(Ot, { onClick: ve }, "extra-paydown")
|
|
1477
1479
|
],
|
|
1478
|
-
onAccountsFilterClick:
|
|
1480
|
+
onAccountsFilterClick: Ce,
|
|
1479
1481
|
onBackClick: a,
|
|
1480
1482
|
sx: n,
|
|
1481
|
-
title:
|
|
1483
|
+
title: h.title,
|
|
1482
1484
|
children: [
|
|
1483
|
-
/* @__PURE__ */ s(
|
|
1485
|
+
/* @__PURE__ */ s(w, { sx: { px: _ ? "48px" : "24px" }, children: [
|
|
1484
1486
|
/* @__PURE__ */ s(
|
|
1485
|
-
|
|
1487
|
+
w,
|
|
1486
1488
|
{
|
|
1487
1489
|
sx: {
|
|
1488
1490
|
alignItems: f ? "flex-start" : "flex-end",
|
|
@@ -1491,53 +1493,53 @@ const Bt = (a) => {
|
|
|
1491
1493
|
},
|
|
1492
1494
|
children: [
|
|
1493
1495
|
/* @__PURE__ */ e(
|
|
1494
|
-
|
|
1496
|
+
we,
|
|
1495
1497
|
{
|
|
1496
|
-
debts:
|
|
1498
|
+
debts: K,
|
|
1497
1499
|
height: f ? 250 : void 0,
|
|
1498
1500
|
hoveredDebtGuid: c,
|
|
1499
|
-
onClickArea:
|
|
1500
|
-
onHoverArea:
|
|
1501
|
+
onClickArea: ie,
|
|
1502
|
+
onHoverArea: oe,
|
|
1501
1503
|
sx: { mr: f ? "4px" : "-48px" }
|
|
1502
1504
|
}
|
|
1503
1505
|
),
|
|
1504
1506
|
/* @__PURE__ */ e(
|
|
1505
|
-
|
|
1507
|
+
lt,
|
|
1506
1508
|
{
|
|
1507
|
-
debts:
|
|
1508
|
-
onClickCta:
|
|
1509
|
+
debts: K,
|
|
1510
|
+
onClickCta: Se,
|
|
1509
1511
|
sx: { mb: f ? "0px" : "64px" }
|
|
1510
1512
|
}
|
|
1511
1513
|
)
|
|
1512
1514
|
]
|
|
1513
1515
|
}
|
|
1514
1516
|
),
|
|
1515
|
-
/* @__PURE__ */ e(
|
|
1516
|
-
|
|
1517
|
+
/* @__PURE__ */ e(w, { sx: { mx: f ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1518
|
+
Ft,
|
|
1517
1519
|
{
|
|
1518
|
-
debts:
|
|
1520
|
+
debts: K,
|
|
1519
1521
|
hoveredDebtGuid: c,
|
|
1520
|
-
onClickRow:
|
|
1521
|
-
onHoverRow:
|
|
1522
|
+
onClickRow: ie,
|
|
1523
|
+
onHoverRow: oe
|
|
1522
1524
|
}
|
|
1523
1525
|
) })
|
|
1524
1526
|
] }),
|
|
1525
1527
|
/* @__PURE__ */ e(
|
|
1526
|
-
|
|
1528
|
+
ct,
|
|
1527
1529
|
{
|
|
1528
1530
|
isOpen: p,
|
|
1529
1531
|
onClose: () => d(!1)
|
|
1530
1532
|
}
|
|
1531
1533
|
),
|
|
1532
|
-
/* @__PURE__ */ e(
|
|
1533
|
-
/* @__PURE__ */ e(
|
|
1534
|
+
/* @__PURE__ */ e(Dt, { isOpen: r, onClose: () => t(!1) }),
|
|
1535
|
+
/* @__PURE__ */ e(It, { isOpen: o, onClose: () => i(!1) })
|
|
1534
1536
|
]
|
|
1535
1537
|
}
|
|
1536
1538
|
);
|
|
1537
|
-
},
|
|
1539
|
+
}, Nr = D(Wt);
|
|
1538
1540
|
export {
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1541
|
+
we as DebtsChart,
|
|
1542
|
+
Lr as DebtsStore,
|
|
1543
|
+
Ft as DebtsTable,
|
|
1544
|
+
Nr as DebtsWidget
|
|
1543
1545
|
};
|