@mx-cartographer/experiences 7.4.7 → 7.4.8-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/CHANGELOG.md +2 -2
- package/dist/{Account-01wOyrH1.mjs → Account-BrOTlmeK.mjs} +1 -1
- package/dist/{AccountDetailsContent-COMjOzwr.mjs → AccountDetailsContent-B7FqH05C.mjs} +8 -8
- package/dist/{AccountDetailsHeader-Cbi5G6fJ.mjs → AccountDetailsHeader-C8MxsxhN.mjs} +4 -4
- package/dist/{AccountFields-Cd_nOWmf.mjs → AccountFields-BQZ-o6Kj.mjs} +2 -2
- package/dist/{AccountListItem-DxY4cCF1.mjs → AccountListItem-aIE9WWTO.mjs} +4 -4
- package/dist/{AccountStore-C1zMBzHq.mjs → AccountStore-DqO84Aer.mjs} +2 -2
- package/dist/{Accounts-D7QljYas.mjs → Accounts-DC_A4UCa.mjs} +1 -1
- package/dist/{BudgetUtil-Df2nII9u.mjs → BudgetUtil-BmZXkL0C.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-DqJK_rrL.mjs → CategorySelectorDrawer-SUgfE5GN.mjs} +1 -1
- package/dist/{ConnectDrawer-CuUj16NH.mjs → ConnectDrawer-KL8t1qSC.mjs} +1 -1
- package/dist/{ConnectionsDrawer-Bz4uwdFE.mjs → ConnectionsDrawer-DaK5uIL5.mjs} +2 -2
- package/dist/{CurrencyInput-BFKcs-_K.mjs → CurrencyInput-itK0R3wV.mjs} +1 -1
- package/dist/{DebtsStore-Bu8rRRSL.mjs → DebtsStore-DVPZbv2C.mjs} +1 -1
- package/dist/{ExportCsvAction-DzTrtPzk.mjs → ExportCsvAction-Cglo8Mca.mjs} +3 -3
- package/dist/{GoalStore-CrNhjvNc.mjs → GoalStore-o4rrjGSJ.mjs} +2 -2
- package/dist/{Help-BnPXM_N2.mjs → Help-BjLMsuMS.mjs} +1 -1
- package/dist/{LineChart-bc1D9xBE.mjs → LineChart-BQRxZF3p.mjs} +1 -1
- package/dist/{ListItemAction-uobBrm_a.mjs → ListItemAction-BxTkF6Tz.mjs} +1 -1
- package/dist/{ManageIncome-A69EUO5u.mjs → ManageIncome-rcnDYsBJ.mjs} +75 -75
- package/dist/{MicroWidgetContainer-DEiRnYVa.mjs → MicroWidgetContainer-B2hO9rOG.mjs} +1 -1
- package/dist/{MiniWidgetContainer-CmXpTylX.mjs → MiniWidgetContainer-98-hKFqm.mjs} +1 -1
- package/dist/{NetWorthStore-CpL_kqvx.mjs → NetWorthStore-DG2X69jG.mjs} +2 -2
- package/dist/{NotificationSettings-CNmJWVeI.mjs → NotificationSettings-C7FYNM7I.mjs} +250 -248
- package/dist/{OriginalBalanceAction-DK8_LkPz.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +3 -3
- package/dist/{RecurringSettings-B0uObPlD.mjs → RecurringSettings-C81H1l38.mjs} +3 -3
- package/dist/{SpendingLegend-Bf-wbJvb.mjs → SpendingLegend-DqZxN_BZ.mjs} +2 -2
- package/dist/{TransactionDetails-COH0OKNG.mjs → TransactionDetails-BA_E5nQ-.mjs} +5 -5
- package/dist/{TransactionStore-Dz-G8Wd0.mjs → TransactionStore-PRlwE-TF.mjs} +2 -2
- package/dist/{User-wXzDI4M8.mjs → User-Cnlegl1N.mjs} +1 -1
- package/dist/{ViewMoreMicroCard-C0832BMe.mjs → ViewMoreMicroCard-DfPXJzbv.mjs} +105 -101
- package/dist/{WidgetContainer-6dsjtOVg.mjs → WidgetContainer-CaPjoWeE.mjs} +2 -2
- package/dist/accounts/index.es.js +148 -140
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +483 -478
- package/dist/cashflow/index.es.js +367 -362
- package/dist/categories/index.es.js +1 -1
- package/dist/common/hooks/index.d.ts +1 -0
- package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
- package/dist/common/index.es.js +35 -33
- package/dist/dashboard/index.es.js +90 -88
- package/dist/debts/index.es.js +346 -342
- package/dist/{exportTransactionsToCSV-Cz2t0lmA.mjs → exportTransactionsToCSV-DuAaI5XA.mjs} +1 -1
- package/dist/finstrong/index.es.js +352 -350
- package/dist/goals/index.es.js +518 -511
- package/dist/help/index.es.js +13 -9
- package/dist/{hooks-C41HAxM5.mjs → hooks-ZMp65DFz.mjs} +11 -11
- package/dist/investments/index.es.js +395 -393
- package/dist/merchants/index.es.js +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/networth/index.es.js +245 -240
- package/dist/notifications/index.es.js +2 -2
- package/dist/recurringtransactions/index.es.js +293 -285
- package/dist/settings/index.es.js +252 -249
- package/dist/spending/index.es.js +136 -124
- package/dist/transactions/index.es.js +77 -73
- package/dist/trends/index.es.js +601 -588
- package/dist/{useAccountDisplayName-CMMlIOXF.mjs → useAccountDisplayName-Cjx8YmKK.mjs} +2 -2
- package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
- package/dist/useWidgetLoadTimer-C1NBkyLd.mjs +23 -0
- package/package.json +1 -1
package/dist/debts/index.es.js
CHANGED
|
@@ -2,68 +2,69 @@ import { jsx as e, jsxs as s, Fragment as H } from "react/jsx-runtime";
|
|
|
2
2
|
import g from "react";
|
|
3
3
|
import { observer as D } from "mobx-react-lite";
|
|
4
4
|
import w from "@mui/material/Stack";
|
|
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 P, M as
|
|
12
|
-
import { a as Lr } from "../DebtsStore-
|
|
13
|
-
import { f as k, a as
|
|
14
|
-
import { f as
|
|
15
|
-
import { G as
|
|
5
|
+
import { useTheme as X, Card as be, Stack as _, Box as G } from "@mui/material";
|
|
6
|
+
import { Text as l, H3 as ve, InstitutionLogo as De, Icon as ee } from "@mxenabled/mxui";
|
|
7
|
+
import { intervalToDuration as Te, formatDuration as Ae } from "date-fns";
|
|
8
|
+
import { addMonths as le } from "date-fns/addMonths";
|
|
9
|
+
import { fromUnixTime as se } from "date-fns/fromUnixTime";
|
|
10
|
+
import { getUnixTime as ce } from "date-fns/getUnixTime";
|
|
11
|
+
import { D as P, M as Ee, I as Ie } from "../DebtsStore-DVPZbv2C.mjs";
|
|
12
|
+
import { a as Lr } from "../DebtsStore-DVPZbv2C.mjs";
|
|
13
|
+
import { f as k, a as Be } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
14
|
+
import { f as K, a as U } from "../Dialog-BPTr3qHE.mjs";
|
|
15
|
+
import { G as Me, w as q, u as S, l as V, g as F, d as Z, b as Pe } from "../hooks-ZMp65DFz.mjs";
|
|
16
16
|
import { u as Y } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
|
-
import { D as
|
|
18
|
-
import { b as
|
|
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 {
|
|
48
|
-
|
|
17
|
+
import { D as te } from "../Drawer-BEtCk82g.mjs";
|
|
18
|
+
import { b as E } from "../Localization-2MODESHW.mjs";
|
|
19
|
+
import { A as ke, u as Ne } from "../AccountDetailsHeader-C8MxsxhN.mjs";
|
|
20
|
+
import Fe from "@mui/material/Card";
|
|
21
|
+
import Re from "@mui/material/CardContent";
|
|
22
|
+
import Le from "@mui/material/CardHeader";
|
|
23
|
+
import { LineChart as $e } from "@mui/x-charts";
|
|
24
|
+
import re from "@mui/material/Box";
|
|
25
|
+
import { useTheme as He } from "@mui/material/styles";
|
|
26
|
+
import { A as T, W as Oe } from "../WidgetContainer-CaPjoWeE.mjs";
|
|
27
|
+
import de from "@mui/material/Tab";
|
|
28
|
+
import We from "@mui/material/Tabs";
|
|
29
|
+
import _e from "@mui/material/List";
|
|
30
|
+
import j from "@mui/material/Divider";
|
|
31
|
+
import { M as Ge, I as je, O as ze } from "../OriginalBalanceAction-C6jdS4ws.mjs";
|
|
32
|
+
import Xe from "@mui/material/TextField";
|
|
33
|
+
import { L as J } from "../ListItemAction-BxTkF6Tz.mjs";
|
|
34
|
+
import { C as ae } from "../CurrencyInput-itK0R3wV.mjs";
|
|
35
|
+
import pe from "@mui/material/Alert";
|
|
36
|
+
import me from "@mui/material/AlertTitle";
|
|
37
|
+
import he from "@mui/material/Paper";
|
|
38
|
+
import { Error as Ve, CheckCircle as ye } from "@mxenabled/mx-icons";
|
|
39
|
+
import { T as ue } from "../TabContentContainer-j01JYR_7.mjs";
|
|
40
|
+
import { DataGridPro as Ye } from "@mui/x-data-grid-pro";
|
|
41
|
+
import { H as z } from "../HeaderCell-DjuifqHJ.mjs";
|
|
42
|
+
import { f as Ke } from "../ConnectDrawer-KL8t1qSC.mjs";
|
|
43
|
+
import fe from "@mui/material/Button";
|
|
44
|
+
import Ue from "@mui/material/IconButton";
|
|
45
|
+
import qe from "@mui/material/ListItem";
|
|
46
|
+
import Ze from "@mui/material/Popover";
|
|
47
|
+
import { u as Je } from "../useWidgetLoadTimer-C1NBkyLd.mjs";
|
|
48
|
+
import { L as Qe } from "../Loader-DUaFpDGv.mjs";
|
|
49
|
+
const et = (a, n = 0, r = 0) => {
|
|
49
50
|
if (r === 0) return 0;
|
|
50
|
-
const t = n / (
|
|
51
|
+
const t = n / (Ee * Ie);
|
|
51
52
|
return Math.ceil(
|
|
52
53
|
t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
|
|
53
54
|
);
|
|
54
|
-
},
|
|
55
|
+
}, tt = (a, n, r, t, o) => {
|
|
55
56
|
const i = [];
|
|
56
57
|
if (r === 0) {
|
|
57
58
|
for (let c = 0; c < a; c++) {
|
|
58
|
-
const d = n - t * (c + 1), m = n - t * c,
|
|
59
|
+
const d = n - t * (c + 1), m = n - t * c, b = d >= 0 ? t : m;
|
|
59
60
|
i.push({
|
|
60
61
|
balance: d >= 0 ? d : 0,
|
|
61
62
|
interest: r,
|
|
62
|
-
payment:
|
|
63
|
-
principal:
|
|
64
|
-
timestamp:
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
payment: b,
|
|
64
|
+
principal: b,
|
|
65
|
+
timestamp: ce(
|
|
66
|
+
le(
|
|
67
|
+
se(o),
|
|
67
68
|
// convert seconds → Date
|
|
68
69
|
c + 1
|
|
69
70
|
// add (index + 1) months
|
|
@@ -75,32 +76,32 @@ const tt = (a, n = 0, r = 0) => {
|
|
|
75
76
|
}
|
|
76
77
|
const p = r / 1200;
|
|
77
78
|
for (let c = 0; c < a; c++) {
|
|
78
|
-
const d =
|
|
79
|
+
const d = ce(le(se(o), c + 1)), m = Math.pow(1 + p, c), b = n * m - t * ((m - 1) / p), f = Math.pow(1 + p, c + 1), u = n * f - t * ((f - 1) / p), v = t + Math.min(u, 0), M = b * p;
|
|
79
80
|
i.push({
|
|
80
|
-
balance: Math.max(0,
|
|
81
|
-
interest:
|
|
81
|
+
balance: Math.max(0, u),
|
|
82
|
+
interest: M,
|
|
82
83
|
payment: v,
|
|
83
|
-
principal: v -
|
|
84
|
+
principal: v - M,
|
|
84
85
|
timestamp: d
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
return i;
|
|
88
|
-
},
|
|
89
|
-
const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i =
|
|
89
|
+
}, rt = (a) => (a[a.length - 1] || {}).timestamp, at = (a) => {
|
|
90
|
+
const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i = et(t, r ?? 0, n ?? 0), p = tt(
|
|
90
91
|
i,
|
|
91
92
|
t,
|
|
92
93
|
r ?? 0,
|
|
93
94
|
n ?? 0,
|
|
94
95
|
o
|
|
95
|
-
), c =
|
|
96
|
+
), c = rt(p);
|
|
96
97
|
return {
|
|
97
98
|
...a,
|
|
98
99
|
minimumFinalPayment: c,
|
|
99
100
|
minimumPayments: p
|
|
100
101
|
};
|
|
101
|
-
},
|
|
102
|
+
}, xe = (a, n) => {
|
|
102
103
|
const [r, t] = a.reduce(
|
|
103
|
-
([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(
|
|
104
|
+
([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(at(p)), [o, i]),
|
|
104
105
|
[[], []]
|
|
105
106
|
);
|
|
106
107
|
switch (n) {
|
|
@@ -121,47 +122,47 @@ const tt = (a, n = 0, r = 0) => {
|
|
|
121
122
|
}
|
|
122
123
|
a.splice(0, a.length, ...r, ...t);
|
|
123
124
|
};
|
|
124
|
-
function
|
|
125
|
-
const t = a.map((
|
|
126
|
-
(
|
|
125
|
+
function nt(a, n, r = 0) {
|
|
126
|
+
const t = a.map((b) => ({ ...b })).filter(
|
|
127
|
+
(b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
|
|
127
128
|
);
|
|
128
|
-
|
|
129
|
+
xe(t, n);
|
|
129
130
|
let o = 0, i = 0;
|
|
130
131
|
const p = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
|
|
131
|
-
for (; t.some((
|
|
132
|
-
let
|
|
133
|
-
for (const [
|
|
134
|
-
if (
|
|
135
|
-
const
|
|
136
|
-
let C =
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
|
|
132
|
+
for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
|
|
133
|
+
let b = !1;
|
|
134
|
+
for (const [f, u] of t.entries()) {
|
|
135
|
+
if (u.balance <= 0.01 || u.is_impossible) continue;
|
|
136
|
+
const M = (u.interest_rate ?? 0) / 100 / 12, I = u.balance * M;
|
|
137
|
+
let C = u.monthly_payment ?? 0;
|
|
138
|
+
f === 0 && r && (C += r), u.balance += I;
|
|
139
|
+
const B = Math.min(u.balance, C + i);
|
|
140
|
+
if (B <= I) {
|
|
141
|
+
u.is_impossible = !0;
|
|
141
142
|
continue;
|
|
142
143
|
}
|
|
143
|
-
|
|
144
|
+
u.balance -= B, u.balance = u.balance < 0.01 ? 0 : u.balance, o += I, u.balance <= 0 && (i += C), B > 0 && (b = !0);
|
|
144
145
|
}
|
|
145
|
-
|
|
146
|
+
b && c.setMonth(c.getMonth() + 1);
|
|
146
147
|
}
|
|
147
|
-
const d = t.some((
|
|
148
|
+
const d = t.some((b) => b.is_impossible && b.balance > 0), m = Te({ start: p, end: c });
|
|
148
149
|
return {
|
|
149
150
|
payoffSavings: d ? "N/A" : k(o, "0,0.00"),
|
|
150
|
-
payoffDate: d ? "Never" :
|
|
151
|
-
payoffDuration: d ? "Stagnant" :
|
|
151
|
+
payoffDate: d ? "Never" : K(c, U.MONTH_YEAR),
|
|
152
|
+
payoffDuration: d ? "Stagnant" : Ae(m, { format: ["years", "months"] }) || "0 months"
|
|
152
153
|
};
|
|
153
154
|
}
|
|
154
|
-
const
|
|
155
|
-
if (!g.useContext(
|
|
155
|
+
const $ = () => {
|
|
156
|
+
if (!g.useContext(Me))
|
|
156
157
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
157
|
-
return
|
|
158
|
-
},
|
|
159
|
-
const t = X(), { isMobile: o } = Y(), { debts: i } = S(), { selectedDebtPriority: p } =
|
|
160
|
-
const
|
|
161
|
-
return
|
|
158
|
+
return q().uiStore;
|
|
159
|
+
}, ot = ({ debts: a, onClickCta: n, sx: r }) => {
|
|
160
|
+
const t = X(), { isMobile: o } = Y(), { debts: i } = S(), { selectedDebtPriority: p } = $(), { monthlyCashFlowProfile: c } = V(), { payoffDate: d, payoffSavings: m, payoffDuration: b } = g.useMemo(() => {
|
|
161
|
+
const f = c?.extra_payment ?? 0;
|
|
162
|
+
return nt(a, p, f);
|
|
162
163
|
}, [a, p, c]);
|
|
163
164
|
return /* @__PURE__ */ e(
|
|
164
|
-
|
|
165
|
+
be,
|
|
165
166
|
{
|
|
166
167
|
sx: {
|
|
167
168
|
boxShadow: t.shadows[2],
|
|
@@ -190,7 +191,7 @@ const L = () => {
|
|
|
190
191
|
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
|
|
191
192
|
] }),
|
|
192
193
|
/* @__PURE__ */ s(_, { gap: o ? "4px" : "0", children: [
|
|
193
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children:
|
|
194
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: b }),
|
|
194
195
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
|
|
195
196
|
] }),
|
|
196
197
|
/* @__PURE__ */ e(
|
|
@@ -207,10 +208,10 @@ const L = () => {
|
|
|
207
208
|
] })
|
|
208
209
|
}
|
|
209
210
|
);
|
|
210
|
-
},
|
|
211
|
+
}, it = D(ot), lt = ({ isOpen: a, onClose: n }) => {
|
|
211
212
|
const r = X(), { debts: t } = S(), [o, i] = g.useState(!1);
|
|
212
213
|
return /* @__PURE__ */ e(
|
|
213
|
-
|
|
214
|
+
te,
|
|
214
215
|
{
|
|
215
216
|
ariaLabelClose: "",
|
|
216
217
|
isOpen: a,
|
|
@@ -224,7 +225,7 @@ const L = () => {
|
|
|
224
225
|
/* @__PURE__ */ e(l, { variant: "H1", children: t.snowball_drawer_savings }),
|
|
225
226
|
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_duration_description })
|
|
226
227
|
] }),
|
|
227
|
-
/* @__PURE__ */ s(
|
|
228
|
+
/* @__PURE__ */ s(be, { sx: { display: "grid", py: 16, px: 24 }, children: [
|
|
228
229
|
/* @__PURE__ */ e(l, { mb: 4, variant: "H3", children: t.snowball_drawer_question }),
|
|
229
230
|
/* @__PURE__ */ e(
|
|
230
231
|
l,
|
|
@@ -261,13 +262,13 @@ const L = () => {
|
|
|
261
262
|
}
|
|
262
263
|
),
|
|
263
264
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
264
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children:
|
|
265
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 1) }),
|
|
265
266
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
266
267
|
] }),
|
|
267
268
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
268
269
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
269
270
|
/* @__PURE__ */ e(
|
|
270
|
-
|
|
271
|
+
G,
|
|
271
272
|
{
|
|
272
273
|
sx: {
|
|
273
274
|
display: "flex",
|
|
@@ -294,13 +295,13 @@ const L = () => {
|
|
|
294
295
|
},
|
|
295
296
|
children: [
|
|
296
297
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
297
|
-
/* @__PURE__ */ e(l, { variant: "Body", children:
|
|
298
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "A") }),
|
|
298
299
|
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
|
299
|
-
|
|
300
|
+
E(
|
|
300
301
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
301
302
|
"$100"
|
|
302
303
|
),
|
|
303
|
-
/* @__PURE__ */ e("strong", { children:
|
|
304
|
+
/* @__PURE__ */ e("strong", { children: E(t.snowball_drawer_debt_label, "B") }),
|
|
304
305
|
t.snowball_drawer_rollover_explainer_pt2
|
|
305
306
|
] })
|
|
306
307
|
] }),
|
|
@@ -323,7 +324,7 @@ const L = () => {
|
|
|
323
324
|
] }),
|
|
324
325
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
325
326
|
/* @__PURE__ */ e(
|
|
326
|
-
|
|
327
|
+
G,
|
|
327
328
|
{
|
|
328
329
|
sx: {
|
|
329
330
|
width: 20,
|
|
@@ -345,7 +346,7 @@ const L = () => {
|
|
|
345
346
|
pr: 24
|
|
346
347
|
},
|
|
347
348
|
children: [
|
|
348
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children:
|
|
349
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "B") }),
|
|
349
350
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$400.00" })
|
|
350
351
|
]
|
|
351
352
|
}
|
|
@@ -353,7 +354,7 @@ const L = () => {
|
|
|
353
354
|
] }),
|
|
354
355
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, py: 14, children: [
|
|
355
356
|
/* @__PURE__ */ e(
|
|
356
|
-
|
|
357
|
+
G,
|
|
357
358
|
{
|
|
358
359
|
sx: {
|
|
359
360
|
width: 20,
|
|
@@ -365,7 +366,7 @@ const L = () => {
|
|
|
365
366
|
}
|
|
366
367
|
),
|
|
367
368
|
/* @__PURE__ */ s(_, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
|
|
368
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children:
|
|
369
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }),
|
|
369
370
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
|
|
370
371
|
] })
|
|
371
372
|
] }),
|
|
@@ -388,13 +389,13 @@ const L = () => {
|
|
|
388
389
|
)
|
|
389
390
|
] }),
|
|
390
391
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
391
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children:
|
|
392
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 2) }),
|
|
392
393
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
393
394
|
] }),
|
|
394
395
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
395
396
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
396
397
|
/* @__PURE__ */ e(
|
|
397
|
-
|
|
398
|
+
G,
|
|
398
399
|
{
|
|
399
400
|
sx: {
|
|
400
401
|
display: "flex",
|
|
@@ -421,13 +422,13 @@ const L = () => {
|
|
|
421
422
|
},
|
|
422
423
|
children: [
|
|
423
424
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
424
|
-
/* @__PURE__ */ e(l, { variant: "Body", children:
|
|
425
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "B") }),
|
|
425
426
|
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
|
426
|
-
|
|
427
|
+
E(
|
|
427
428
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
428
429
|
"$500"
|
|
429
430
|
),
|
|
430
|
-
/* @__PURE__ */ e("strong", { children:
|
|
431
|
+
/* @__PURE__ */ e("strong", { children: E(t.snowball_drawer_debt_label, "C") }),
|
|
431
432
|
t.snowball_drawer_rollover_explainer_pt2
|
|
432
433
|
] })
|
|
433
434
|
] }),
|
|
@@ -450,7 +451,7 @@ const L = () => {
|
|
|
450
451
|
] }),
|
|
451
452
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
452
453
|
/* @__PURE__ */ e(
|
|
453
|
-
|
|
454
|
+
G,
|
|
454
455
|
{
|
|
455
456
|
sx: {
|
|
456
457
|
width: 20,
|
|
@@ -471,7 +472,7 @@ const L = () => {
|
|
|
471
472
|
pr: 24
|
|
472
473
|
},
|
|
473
474
|
children: [
|
|
474
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children:
|
|
475
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }),
|
|
475
476
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
|
|
476
477
|
]
|
|
477
478
|
}
|
|
@@ -496,13 +497,13 @@ const L = () => {
|
|
|
496
497
|
)
|
|
497
498
|
] }),
|
|
498
499
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
499
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children:
|
|
500
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 3) }),
|
|
500
501
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
501
502
|
] }),
|
|
502
503
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
503
504
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
504
505
|
/* @__PURE__ */ e(
|
|
505
|
-
|
|
506
|
+
G,
|
|
506
507
|
{
|
|
507
508
|
sx: {
|
|
508
509
|
display: "flex",
|
|
@@ -528,7 +529,7 @@ const L = () => {
|
|
|
528
529
|
pr: 24
|
|
529
530
|
},
|
|
530
531
|
children: [
|
|
531
|
-
/* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children:
|
|
532
|
+
/* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }) }),
|
|
532
533
|
/* @__PURE__ */ s(_, { children: [
|
|
533
534
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,500.00" }),
|
|
534
535
|
/* @__PURE__ */ e(
|
|
@@ -568,8 +569,8 @@ const L = () => {
|
|
|
568
569
|
] })
|
|
569
570
|
}
|
|
570
571
|
);
|
|
571
|
-
},
|
|
572
|
-
function
|
|
572
|
+
}, st = D(lt), ct = "#FF7B08";
|
|
573
|
+
function dt(a, n) {
|
|
573
574
|
const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
|
|
574
575
|
Math.max(0, Math.min(255, Math.round(r * n))),
|
|
575
576
|
Math.max(0, Math.min(255, Math.round(t * n))),
|
|
@@ -577,7 +578,7 @@ function pt(a, n) {
|
|
|
577
578
|
];
|
|
578
579
|
return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
|
|
579
580
|
}
|
|
580
|
-
const
|
|
581
|
+
const ge = ({
|
|
581
582
|
sx: a,
|
|
582
583
|
height: n = 500,
|
|
583
584
|
width: r,
|
|
@@ -586,32 +587,32 @@ const we = ({
|
|
|
586
587
|
onClickArea: i,
|
|
587
588
|
onHoverArea: p
|
|
588
589
|
}) => {
|
|
589
|
-
const c =
|
|
590
|
+
const c = He(), { onEvent: d } = F(), m = t.filter((h) => !h.is_impossible), b = [
|
|
590
591
|
...new Set(
|
|
591
|
-
m.flatMap((
|
|
592
|
+
m.flatMap((h) => h.dataset.map((x) => new Date(x.x).getTime()))
|
|
592
593
|
)
|
|
593
|
-
].sort((
|
|
594
|
-
const
|
|
595
|
-
let
|
|
596
|
-
const
|
|
597
|
-
const
|
|
598
|
-
return
|
|
594
|
+
].sort((h, x) => h - x).map((h) => new Date(h)), f = m.map((h) => {
|
|
595
|
+
const x = new Map(h.dataset.map((L) => [new Date(L.x).getTime(), L.y]));
|
|
596
|
+
let A = x.get(b[0].getTime()) ?? 0;
|
|
597
|
+
const R = b.map((L) => {
|
|
598
|
+
const O = x.get(L.getTime()) ?? A;
|
|
599
|
+
return A = O, { x: L, y: O };
|
|
599
600
|
});
|
|
600
|
-
return { ...
|
|
601
|
-
}),
|
|
602
|
-
(
|
|
601
|
+
return { ...h, dataset: R };
|
|
602
|
+
}), u = f.reduce(
|
|
603
|
+
(h, x) => h + (x.dataset[0]?.y ?? 0),
|
|
603
604
|
0
|
|
604
|
-
), v =
|
|
605
|
-
const
|
|
606
|
-
return { x:
|
|
607
|
-
}),
|
|
608
|
-
const
|
|
605
|
+
), v = b.map((h, x) => {
|
|
606
|
+
const A = x / (b.length - 1), R = u * (1 - A);
|
|
607
|
+
return { x: h, y: R };
|
|
608
|
+
}), M = Math.ceil(u / 100) * 100, I = b, C = f.map((h, x) => {
|
|
609
|
+
const A = 1 - x / f.length * 0.5, R = dt(ct, A);
|
|
609
610
|
return {
|
|
610
|
-
id: `debt-${
|
|
611
|
-
guid:
|
|
612
|
-
label:
|
|
613
|
-
data:
|
|
614
|
-
color:
|
|
611
|
+
id: `debt-${x}`,
|
|
612
|
+
guid: h.guid,
|
|
613
|
+
label: h.name,
|
|
614
|
+
data: h.dataset.map((L) => L.y),
|
|
615
|
+
color: R,
|
|
615
616
|
curve: "linear",
|
|
616
617
|
type: "line",
|
|
617
618
|
area: !0,
|
|
@@ -622,7 +623,7 @@ const we = ({
|
|
|
622
623
|
C.push({
|
|
623
624
|
id: "payoff-line",
|
|
624
625
|
label: "Payoff Line",
|
|
625
|
-
data: v.map((
|
|
626
|
+
data: v.map((h) => h.y),
|
|
626
627
|
color: c.palette.grey[700],
|
|
627
628
|
curve: "linear",
|
|
628
629
|
type: "line",
|
|
@@ -630,9 +631,9 @@ const we = ({
|
|
|
630
631
|
showMark: !1,
|
|
631
632
|
disableHighlight: !0
|
|
632
633
|
});
|
|
633
|
-
const
|
|
634
|
+
const B = (h) => C.findIndex((x) => x?.guid === h);
|
|
634
635
|
return /* @__PURE__ */ e(
|
|
635
|
-
|
|
636
|
+
re,
|
|
636
637
|
{
|
|
637
638
|
sx: {
|
|
638
639
|
width: "100%",
|
|
@@ -647,19 +648,19 @@ const we = ({
|
|
|
647
648
|
}
|
|
648
649
|
},
|
|
649
650
|
children: /* @__PURE__ */ e(
|
|
650
|
-
|
|
651
|
+
$e,
|
|
651
652
|
{
|
|
652
653
|
axisHighlight: { x: "none" },
|
|
653
654
|
disableLineItemHighlight: !0,
|
|
654
655
|
height: n,
|
|
655
|
-
onAreaClick: (
|
|
656
|
+
onAreaClick: (h, x) => {
|
|
656
657
|
i?.();
|
|
657
|
-
const
|
|
658
|
-
d(T.DEBTS_CLICK_CHART_AREA, { account_guid:
|
|
658
|
+
const A = C.find((R) => R.id === x.seriesId);
|
|
659
|
+
d(T.DEBTS_CLICK_CHART_AREA, { account_guid: A?.guid });
|
|
659
660
|
},
|
|
660
|
-
onHighlightChange: (
|
|
661
|
-
const
|
|
662
|
-
p?.(
|
|
661
|
+
onHighlightChange: (h) => {
|
|
662
|
+
const x = C.find((A) => A.id === h?.seriesId)?.guid;
|
|
663
|
+
p?.(x ?? "");
|
|
663
664
|
},
|
|
664
665
|
series: C,
|
|
665
666
|
skipAnimation: !0,
|
|
@@ -685,10 +686,10 @@ const we = ({
|
|
|
685
686
|
strokeDasharray: "10 5",
|
|
686
687
|
strokeWidth: 1
|
|
687
688
|
},
|
|
688
|
-
[`& .MuiLineElement-series-debt-${
|
|
689
|
+
[`& .MuiLineElement-series-debt-${B(o ?? "0")}`]: {
|
|
689
690
|
opacity: 1
|
|
690
691
|
},
|
|
691
|
-
[`& .MuiAreaElement-series-debt-${
|
|
692
|
+
[`& .MuiAreaElement-series-debt-${B(o ?? "0")}`]: {
|
|
692
693
|
opacity: 1
|
|
693
694
|
},
|
|
694
695
|
"& .MuiChartsAxis-tickLabel > tspan": {
|
|
@@ -700,30 +701,30 @@ const we = ({
|
|
|
700
701
|
width: r,
|
|
701
702
|
xAxis: [
|
|
702
703
|
{
|
|
703
|
-
data:
|
|
704
|
+
data: I,
|
|
704
705
|
scaleType: "time",
|
|
705
|
-
min:
|
|
706
|
+
min: b[0],
|
|
706
707
|
disableTicks: !0,
|
|
707
|
-
valueFormatter: (
|
|
708
|
+
valueFormatter: (h) => K(h, U.MONTH_SHORT_YEAR)
|
|
708
709
|
}
|
|
709
710
|
],
|
|
710
711
|
yAxis: [
|
|
711
712
|
{
|
|
712
713
|
min: 0,
|
|
713
|
-
max:
|
|
714
|
+
max: M,
|
|
714
715
|
disableTicks: !0,
|
|
715
|
-
valueFormatter: (
|
|
716
|
+
valueFormatter: (h) => k(h, "0a")
|
|
716
717
|
}
|
|
717
718
|
]
|
|
718
719
|
}
|
|
719
720
|
)
|
|
720
721
|
}
|
|
721
722
|
);
|
|
722
|
-
},
|
|
723
|
-
const a = X(), { debts: n } = S(), { selectedDebtChartData: r } =
|
|
723
|
+
}, pt = () => {
|
|
724
|
+
const a = X(), { debts: n } = S(), { selectedDebtChartData: r } = $();
|
|
724
725
|
return /* @__PURE__ */ s(H, { children: [
|
|
725
726
|
/* @__PURE__ */ s(
|
|
726
|
-
|
|
727
|
+
Fe,
|
|
727
728
|
{
|
|
728
729
|
sx: {
|
|
729
730
|
"& .MuiCardContent-root:last-child": {
|
|
@@ -731,8 +732,8 @@ const we = ({
|
|
|
731
732
|
}
|
|
732
733
|
},
|
|
733
734
|
children: [
|
|
734
|
-
/* @__PURE__ */ e(
|
|
735
|
-
/* @__PURE__ */ e(
|
|
735
|
+
/* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children: n.details_chart_title }) }),
|
|
736
|
+
/* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(ge, { debts: [r], height: 250 }) })
|
|
736
737
|
]
|
|
737
738
|
}
|
|
738
739
|
),
|
|
@@ -746,9 +747,9 @@ const we = ({
|
|
|
746
747
|
}
|
|
747
748
|
)
|
|
748
749
|
] });
|
|
749
|
-
},
|
|
750
|
-
const a = X(), { onEvent: n } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: o, showError: i } =
|
|
751
|
-
return g.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(
|
|
750
|
+
}, mt = D(pt), ht = () => {
|
|
751
|
+
const a = X(), { onEvent: n } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: o, showError: i } = $();
|
|
752
|
+
return g.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || o ? /* @__PURE__ */ e(
|
|
752
753
|
l,
|
|
753
754
|
{
|
|
754
755
|
color: a.palette.secondary.main,
|
|
@@ -774,7 +775,7 @@ const we = ({
|
|
|
774
775
|
},
|
|
775
776
|
children: [
|
|
776
777
|
/* @__PURE__ */ s(w, { flexGrow: 1, children: [
|
|
777
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children:
|
|
778
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: K(p, U.MONTH_YEAR) }),
|
|
778
779
|
/* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
|
|
779
780
|
] }),
|
|
780
781
|
/* @__PURE__ */ s(w, { children: [
|
|
@@ -810,8 +811,8 @@ const we = ({
|
|
|
810
811
|
}
|
|
811
812
|
) })
|
|
812
813
|
] }) });
|
|
813
|
-
},
|
|
814
|
-
const { debts: n } = S(), { updateAccount: r } =
|
|
814
|
+
}, ut = D(ht), bt = D(({ debt: a }) => {
|
|
815
|
+
const { debts: n } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [o, i] = g.useState(a.interest_rate ?? 0), p = o < 0, c = async () => {
|
|
815
816
|
await r({ ...a.account, interest_rate: o }), a.interest_rate = o, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
|
|
816
817
|
}, d = () => {
|
|
817
818
|
setTimeout(() => {
|
|
@@ -819,17 +820,17 @@ const we = ({
|
|
|
819
820
|
}, 250);
|
|
820
821
|
};
|
|
821
822
|
return /* @__PURE__ */ e(
|
|
822
|
-
|
|
823
|
+
J,
|
|
823
824
|
{
|
|
824
825
|
isSaveDisabled: p,
|
|
825
826
|
label: `${n.details_interest_rate} (%)`,
|
|
826
827
|
onCancel: d,
|
|
827
828
|
onSave: c,
|
|
828
829
|
primaryText: n.details_interest_rate,
|
|
829
|
-
secondaryText:
|
|
830
|
+
secondaryText: Be(Number(a.interest_rate) / 100),
|
|
830
831
|
zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
|
|
831
832
|
children: /* @__PURE__ */ e(
|
|
832
|
-
|
|
833
|
+
Xe,
|
|
833
834
|
{
|
|
834
835
|
error: p,
|
|
835
836
|
fullWidth: !0,
|
|
@@ -840,8 +841,8 @@ const we = ({
|
|
|
840
841
|
)
|
|
841
842
|
}
|
|
842
843
|
);
|
|
843
|
-
}),
|
|
844
|
-
const { debts: n } = S(), { updateAccount: r } =
|
|
844
|
+
}), _t = D(({ debt: a }) => {
|
|
845
|
+
const { debts: n } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [o, i] = g.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
|
|
845
846
|
await r({ ...a.account, minimum_payment: o }), a.monthly_payment = o, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
|
|
846
847
|
}, d = () => {
|
|
847
848
|
setTimeout(() => {
|
|
@@ -849,7 +850,7 @@ const we = ({
|
|
|
849
850
|
}, 250);
|
|
850
851
|
};
|
|
851
852
|
return /* @__PURE__ */ e(
|
|
852
|
-
|
|
853
|
+
J,
|
|
853
854
|
{
|
|
854
855
|
isSaveDisabled: p,
|
|
855
856
|
label: n.details_monthly_payment,
|
|
@@ -859,7 +860,7 @@ const we = ({
|
|
|
859
860
|
secondaryText: k(a.monthly_payment, "0,0"),
|
|
860
861
|
zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
|
|
861
862
|
children: /* @__PURE__ */ e(
|
|
862
|
-
|
|
863
|
+
ae,
|
|
863
864
|
{
|
|
864
865
|
amount: o,
|
|
865
866
|
autoFocus: !0,
|
|
@@ -872,8 +873,8 @@ const we = ({
|
|
|
872
873
|
)
|
|
873
874
|
}
|
|
874
875
|
);
|
|
875
|
-
}),
|
|
876
|
-
const { debts: n } = S(), { updateAccount: r } =
|
|
876
|
+
}), yt = D(({ debt: a }) => {
|
|
877
|
+
const { debts: n } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [o, i] = g.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
|
|
877
878
|
await r({ ...a.account, original_balance: o }), a.original_balance = o, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
|
|
878
879
|
}, d = () => {
|
|
879
880
|
setTimeout(() => {
|
|
@@ -881,7 +882,7 @@ const we = ({
|
|
|
881
882
|
}, 250);
|
|
882
883
|
};
|
|
883
884
|
return /* @__PURE__ */ e(
|
|
884
|
-
|
|
885
|
+
J,
|
|
885
886
|
{
|
|
886
887
|
isSaveDisabled: p,
|
|
887
888
|
label: n.details_original_balance,
|
|
@@ -891,7 +892,7 @@ const we = ({
|
|
|
891
892
|
secondaryText: k(a.original_balance, "0,0"),
|
|
892
893
|
zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
|
|
893
894
|
children: /* @__PURE__ */ e(
|
|
894
|
-
|
|
895
|
+
ae,
|
|
895
896
|
{
|
|
896
897
|
amount: o,
|
|
897
898
|
autoFocus: !0,
|
|
@@ -904,35 +905,35 @@ const we = ({
|
|
|
904
905
|
)
|
|
905
906
|
}
|
|
906
907
|
);
|
|
907
|
-
}),
|
|
908
|
-
const { onEvent: a } = F(), { selectedDebtChartData: n } =
|
|
908
|
+
}), ft = () => {
|
|
909
|
+
const { onEvent: a } = F(), { selectedDebtChartData: n } = $();
|
|
909
910
|
return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
|
|
910
911
|
n?.goal && /* @__PURE__ */ s(H, { children: [
|
|
912
|
+
/* @__PURE__ */ e(Ge, { goal: n.goal }),
|
|
913
|
+
/* @__PURE__ */ e(j, {}),
|
|
914
|
+
/* @__PURE__ */ e(je, { goal: n.goal }),
|
|
915
|
+
/* @__PURE__ */ e(j, {}),
|
|
911
916
|
/* @__PURE__ */ e(ze, { goal: n.goal }),
|
|
912
|
-
/* @__PURE__ */ e(
|
|
913
|
-
/* @__PURE__ */ e(Xe, { goal: n.goal }),
|
|
914
|
-
/* @__PURE__ */ e(G, {}),
|
|
915
|
-
/* @__PURE__ */ e(Ve, { goal: n.goal }),
|
|
916
|
-
/* @__PURE__ */ e(G, {})
|
|
917
|
+
/* @__PURE__ */ e(j, {})
|
|
917
918
|
] }),
|
|
918
919
|
!n?.goal && n?.account && /* @__PURE__ */ s(H, { children: [
|
|
919
|
-
/* @__PURE__ */ e(yt, { debt: n }),
|
|
920
|
-
/* @__PURE__ */ e(G, {}),
|
|
921
920
|
/* @__PURE__ */ e(_t, { debt: n }),
|
|
922
|
-
/* @__PURE__ */ e(
|
|
923
|
-
/* @__PURE__ */ e(
|
|
924
|
-
/* @__PURE__ */ e(
|
|
921
|
+
/* @__PURE__ */ e(j, {}),
|
|
922
|
+
/* @__PURE__ */ e(bt, { debt: n }),
|
|
923
|
+
/* @__PURE__ */ e(j, {}),
|
|
924
|
+
/* @__PURE__ */ e(yt, { debt: n }),
|
|
925
|
+
/* @__PURE__ */ e(j, {})
|
|
925
926
|
] })
|
|
926
927
|
] });
|
|
927
|
-
},
|
|
928
|
-
const { debts: r } = S(), { showError: t, showCompleted: o } =
|
|
928
|
+
}, xt = D(ft), gt = ({ setTabValue: a, sx: n }) => {
|
|
929
|
+
const { debts: r } = S(), { showError: t, showCompleted: o } = $();
|
|
929
930
|
return g.useEffect(() => {
|
|
930
931
|
t && a(1);
|
|
931
932
|
}, [t]), !t && !o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
|
|
932
|
-
/* @__PURE__ */ e(
|
|
933
|
-
|
|
933
|
+
/* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
|
934
|
+
pe,
|
|
934
935
|
{
|
|
935
|
-
icon: t ? /* @__PURE__ */ e(
|
|
936
|
+
icon: t ? /* @__PURE__ */ e(Ve, { filled: !0 }) : /* @__PURE__ */ e(ye, { color: "success", filled: !0 }),
|
|
936
937
|
severity: "error",
|
|
937
938
|
sx: {
|
|
938
939
|
alignItems: "start",
|
|
@@ -945,13 +946,13 @@ const we = ({
|
|
|
945
946
|
}
|
|
946
947
|
},
|
|
947
948
|
children: [
|
|
948
|
-
/* @__PURE__ */ e(
|
|
949
|
+
/* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: t ? r.status_error_title : r.status_complete_title }),
|
|
949
950
|
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: t ? r.status_error_description : r.status_complete_description })
|
|
950
951
|
]
|
|
951
952
|
}
|
|
952
953
|
) }),
|
|
953
|
-
t && /* @__PURE__ */ e(
|
|
954
|
-
|
|
954
|
+
t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
|
955
|
+
pe,
|
|
955
956
|
{
|
|
956
957
|
icon: /* @__PURE__ */ e(H, {}),
|
|
957
958
|
severity: "error",
|
|
@@ -963,18 +964,18 @@ const we = ({
|
|
|
963
964
|
}
|
|
964
965
|
},
|
|
965
966
|
children: [
|
|
966
|
-
/* @__PURE__ */ e(
|
|
967
|
+
/* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r.status_info_title }),
|
|
967
968
|
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: r.status_info_description })
|
|
968
969
|
]
|
|
969
970
|
}
|
|
970
971
|
) })
|
|
971
972
|
] });
|
|
972
|
-
},
|
|
973
|
-
const { debts: a } = S(), { showError: n, showCompleted: r } =
|
|
973
|
+
}, wt = D(gt), Ct = () => {
|
|
974
|
+
const { debts: a } = S(), { showError: n, showCompleted: r } = $(), [t, o] = g.useState(0);
|
|
974
975
|
return /* @__PURE__ */ s(H, { children: [
|
|
975
|
-
(n || r) && /* @__PURE__ */ e(
|
|
976
|
+
(n || r) && /* @__PURE__ */ e(wt, { setTabValue: o, sx: { mt: -24 } }),
|
|
976
977
|
/* @__PURE__ */ s(
|
|
977
|
-
|
|
978
|
+
We,
|
|
978
979
|
{
|
|
979
980
|
"aria-label": a.details_tabs_aria_label,
|
|
980
981
|
centered: !0,
|
|
@@ -984,7 +985,7 @@ const we = ({
|
|
|
984
985
|
variant: "fullWidth",
|
|
985
986
|
children: [
|
|
986
987
|
/* @__PURE__ */ e(
|
|
987
|
-
|
|
988
|
+
de,
|
|
988
989
|
{
|
|
989
990
|
"aria-controls": "debt-schedule-tabpanel-0",
|
|
990
991
|
id: "debt-schedule-tab-0",
|
|
@@ -992,7 +993,7 @@ const we = ({
|
|
|
992
993
|
}
|
|
993
994
|
),
|
|
994
995
|
/* @__PURE__ */ e(
|
|
995
|
-
|
|
996
|
+
de,
|
|
996
997
|
{
|
|
997
998
|
"aria-controls": "debt-details-tabpanel-1",
|
|
998
999
|
id: "debt-details-tab-1",
|
|
@@ -1002,25 +1003,25 @@ const we = ({
|
|
|
1002
1003
|
]
|
|
1003
1004
|
}
|
|
1004
1005
|
),
|
|
1005
|
-
/* @__PURE__ */ e(
|
|
1006
|
-
/* @__PURE__ */ e(
|
|
1006
|
+
/* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ut, {}) }),
|
|
1007
|
+
/* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(xt, {}) })
|
|
1007
1008
|
] });
|
|
1008
|
-
},
|
|
1009
|
-
const { debts: r } = S(), { showError: t, showCompleted: o } =
|
|
1009
|
+
}, St = D(Ct), vt = ({ isOpen: a, onClose: n }) => {
|
|
1010
|
+
const { debts: r } = S(), { showError: t, showCompleted: o } = $(), i = t || o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ e(mt, {});
|
|
1010
1011
|
return /* @__PURE__ */ e(
|
|
1011
|
-
|
|
1012
|
+
te,
|
|
1012
1013
|
{
|
|
1013
1014
|
ariaLabelClose: r.details_close_aria,
|
|
1014
1015
|
isOpen: a,
|
|
1015
1016
|
onClose: n,
|
|
1016
1017
|
title: r.details_title,
|
|
1017
1018
|
children: /* @__PURE__ */ s(w, { bgcolor: "background.default", children: [
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
1019
|
-
/* @__PURE__ */ e(
|
|
1019
|
+
/* @__PURE__ */ e(ke, { customDetailsChart: i }),
|
|
1020
|
+
/* @__PURE__ */ e(St, {})
|
|
1020
1021
|
] })
|
|
1021
1022
|
}
|
|
1022
1023
|
);
|
|
1023
|
-
},
|
|
1024
|
+
}, Dt = D(() => {
|
|
1024
1025
|
const { debts: a } = S(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = F(), [o, i] = g.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
|
|
1025
1026
|
n && (await r({ ...n, extra_payment: o }), n.extra_payment = o, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
|
|
1026
1027
|
user_guid: n?.user_guid
|
|
@@ -1031,7 +1032,7 @@ const we = ({
|
|
|
1031
1032
|
}, 250);
|
|
1032
1033
|
};
|
|
1033
1034
|
return /* @__PURE__ */ e(
|
|
1034
|
-
|
|
1035
|
+
J,
|
|
1035
1036
|
{
|
|
1036
1037
|
isSaveDisabled: p,
|
|
1037
1038
|
label: a.paydown_drawer_extra_payment,
|
|
@@ -1041,7 +1042,7 @@ const we = ({
|
|
|
1041
1042
|
secondaryText: k(n?.extra_payment, "0,0"),
|
|
1042
1043
|
zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
|
|
1043
1044
|
children: /* @__PURE__ */ e(
|
|
1044
|
-
|
|
1045
|
+
ae,
|
|
1045
1046
|
{
|
|
1046
1047
|
amount: o,
|
|
1047
1048
|
autoFocus: !0,
|
|
@@ -1054,8 +1055,8 @@ const we = ({
|
|
|
1054
1055
|
)
|
|
1055
1056
|
}
|
|
1056
1057
|
);
|
|
1057
|
-
}),
|
|
1058
|
-
const { debts: a } = S(), { totalMonthlyPayments: n } =
|
|
1058
|
+
}), Tt = () => {
|
|
1059
|
+
const { debts: a } = S(), { totalMonthlyPayments: n } = q(), { monthlyCashFlowProfile: r } = V(), t = n + Number(r?.extra_payment);
|
|
1059
1060
|
return /* @__PURE__ */ s(w, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
1060
1061
|
/* @__PURE__ */ s(w, { p: 24, children: [
|
|
1061
1062
|
/* @__PURE__ */ s(w, { alignItems: "center", gap: 4, mb: 24, children: [
|
|
@@ -1068,26 +1069,26 @@ const we = ({
|
|
|
1068
1069
|
/* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
|
|
1069
1070
|
] })
|
|
1070
1071
|
] }),
|
|
1071
|
-
/* @__PURE__ */ e(w, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(
|
|
1072
|
+
/* @__PURE__ */ e(w, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Dt, {}) }),
|
|
1072
1073
|
/* @__PURE__ */ e(w, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(w, { gap: 4, children: [
|
|
1073
1074
|
/* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
|
|
1074
1075
|
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: k(t, "0,0") })
|
|
1075
1076
|
] }) })
|
|
1076
1077
|
] });
|
|
1077
|
-
},
|
|
1078
|
+
}, At = D(Tt), Et = ({ isOpen: a, onClose: n }) => {
|
|
1078
1079
|
const { debts: r } = S();
|
|
1079
1080
|
return /* @__PURE__ */ e(
|
|
1080
|
-
|
|
1081
|
+
te,
|
|
1081
1082
|
{
|
|
1082
1083
|
ariaLabelClose: r.paydown_drawer_close_aria,
|
|
1083
1084
|
isOpen: a,
|
|
1084
1085
|
onClose: n,
|
|
1085
1086
|
title: r.paydown_drawer_title,
|
|
1086
|
-
children: /* @__PURE__ */ e(
|
|
1087
|
+
children: /* @__PURE__ */ e(At, {})
|
|
1087
1088
|
}
|
|
1088
1089
|
);
|
|
1089
1090
|
};
|
|
1090
|
-
function
|
|
1091
|
+
function It(a, n) {
|
|
1091
1092
|
const r = (t) => {
|
|
1092
1093
|
if (typeof t == "number") return t;
|
|
1093
1094
|
if (t === "!" || t === "✓") return 1 / 0;
|
|
@@ -1095,19 +1096,19 @@ function Bt(a, n) {
|
|
|
1095
1096
|
};
|
|
1096
1097
|
return r(a) - r(n);
|
|
1097
1098
|
}
|
|
1098
|
-
function
|
|
1099
|
+
function Bt(a) {
|
|
1099
1100
|
return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
|
|
1100
1101
|
}
|
|
1101
|
-
const
|
|
1102
|
+
const Mt = (a) => {
|
|
1102
1103
|
const n = {
|
|
1103
1104
|
text: "#121417",
|
|
1104
1105
|
background: "#FFB252"
|
|
1105
1106
|
};
|
|
1106
1107
|
return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
|
|
1107
|
-
},
|
|
1108
|
-
const n = String(a.formattedValue), r =
|
|
1108
|
+
}, Pt = (a) => {
|
|
1109
|
+
const n = String(a.formattedValue), r = Mt(n);
|
|
1109
1110
|
return /* @__PURE__ */ e(
|
|
1110
|
-
|
|
1111
|
+
re,
|
|
1111
1112
|
{
|
|
1112
1113
|
sx: {
|
|
1113
1114
|
display: "flex",
|
|
@@ -1123,11 +1124,11 @@ const Pt = (a) => {
|
|
|
1123
1124
|
children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: n })
|
|
1124
1125
|
}
|
|
1125
1126
|
);
|
|
1126
|
-
},
|
|
1127
|
-
const n = a.row.account, r =
|
|
1127
|
+
}, kt = (a) => {
|
|
1128
|
+
const n = a.row.account, r = Ke[n.account_type];
|
|
1128
1129
|
return /* @__PURE__ */ s(w, { alignItems: "center", flexDirection: "row", children: [
|
|
1129
1130
|
/* @__PURE__ */ e(
|
|
1130
|
-
|
|
1131
|
+
De,
|
|
1131
1132
|
{
|
|
1132
1133
|
alt: `${n.institutionName}`,
|
|
1133
1134
|
institutionGuid: n.institution_guid || ""
|
|
@@ -1138,22 +1139,22 @@ const Pt = (a) => {
|
|
|
1138
1139
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: r })
|
|
1139
1140
|
] })
|
|
1140
1141
|
] });
|
|
1141
|
-
},
|
|
1142
|
+
}, Nt = ({
|
|
1142
1143
|
sx: a = {},
|
|
1143
1144
|
debts: n,
|
|
1144
1145
|
hoveredDebtGuid: r,
|
|
1145
1146
|
onHoverRow: t,
|
|
1146
1147
|
onClickRow: o
|
|
1147
1148
|
}) => {
|
|
1148
|
-
const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m,
|
|
1149
|
+
const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, b] = g.useState([
|
|
1149
1150
|
{ field: "priority", sort: "asc" }
|
|
1150
|
-
]),
|
|
1151
|
+
]), f = [
|
|
1151
1152
|
{
|
|
1152
1153
|
field: "priority",
|
|
1153
1154
|
headerName: d.table_column_priority,
|
|
1154
|
-
renderHeader:
|
|
1155
|
-
renderCell:
|
|
1156
|
-
sortComparator:
|
|
1155
|
+
renderHeader: z,
|
|
1156
|
+
renderCell: Pt,
|
|
1157
|
+
sortComparator: It,
|
|
1157
1158
|
sortable: !0,
|
|
1158
1159
|
hideSortIcons: !0,
|
|
1159
1160
|
type: "custom",
|
|
@@ -1165,8 +1166,8 @@ const Pt = (a) => {
|
|
|
1165
1166
|
{
|
|
1166
1167
|
field: "account",
|
|
1167
1168
|
headerName: d.table_column_account,
|
|
1168
|
-
renderHeader:
|
|
1169
|
-
renderCell:
|
|
1169
|
+
renderHeader: z,
|
|
1170
|
+
renderCell: kt,
|
|
1170
1171
|
sortable: !1,
|
|
1171
1172
|
type: "custom",
|
|
1172
1173
|
align: "left",
|
|
@@ -1177,7 +1178,7 @@ const Pt = (a) => {
|
|
|
1177
1178
|
{
|
|
1178
1179
|
field: "balance",
|
|
1179
1180
|
headerName: d.table_column_balance,
|
|
1180
|
-
renderHeader:
|
|
1181
|
+
renderHeader: z,
|
|
1181
1182
|
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: k(y.value, "0,0") }),
|
|
1182
1183
|
sortable: !0,
|
|
1183
1184
|
hideSortIcons: c,
|
|
@@ -1190,7 +1191,7 @@ const Pt = (a) => {
|
|
|
1190
1191
|
{
|
|
1191
1192
|
field: "interest_rate",
|
|
1192
1193
|
headerName: d.table_column_interest_rate,
|
|
1193
|
-
renderHeader:
|
|
1194
|
+
renderHeader: z,
|
|
1194
1195
|
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(y.value) ? "---" : `${Number(y.value).toFixed(2)}%` }),
|
|
1195
1196
|
sortable: !0,
|
|
1196
1197
|
hideSortIcons: c,
|
|
@@ -1203,8 +1204,8 @@ const Pt = (a) => {
|
|
|
1203
1204
|
{
|
|
1204
1205
|
field: "projected_payoff_date",
|
|
1205
1206
|
headerName: d.table_column_payoff_date,
|
|
1206
|
-
renderHeader:
|
|
1207
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: y.value ?
|
|
1207
|
+
renderHeader: z,
|
|
1208
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: y.value ? K(y.value, U.MONTH_SHORT_YEAR) : "---" }),
|
|
1208
1209
|
sortable: !0,
|
|
1209
1210
|
hideSortIcons: c,
|
|
1210
1211
|
type: "number",
|
|
@@ -1216,7 +1217,7 @@ const Pt = (a) => {
|
|
|
1216
1217
|
{
|
|
1217
1218
|
field: "monthly_payment",
|
|
1218
1219
|
headerName: d.table_column_amount_due,
|
|
1219
|
-
renderHeader:
|
|
1220
|
+
renderHeader: z,
|
|
1220
1221
|
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof y.value == "number" ? k(y.value, "0,0") : "---" }),
|
|
1221
1222
|
sortable: !0,
|
|
1222
1223
|
hideSortIcons: c,
|
|
@@ -1226,13 +1227,13 @@ const Pt = (a) => {
|
|
|
1226
1227
|
minWidth: 122,
|
|
1227
1228
|
flex: 0.6
|
|
1228
1229
|
}
|
|
1229
|
-
],
|
|
1230
|
-
...
|
|
1230
|
+
], u = [
|
|
1231
|
+
...f.slice(0, 3),
|
|
1231
1232
|
{
|
|
1232
1233
|
field: "chevron",
|
|
1233
1234
|
headerName: "",
|
|
1234
1235
|
renderHeader: void 0,
|
|
1235
|
-
renderCell: () => /* @__PURE__ */ e(
|
|
1236
|
+
renderCell: () => /* @__PURE__ */ e(ee, { name: "chevron_right'" }),
|
|
1236
1237
|
sortable: !0,
|
|
1237
1238
|
hideSortIcons: !0,
|
|
1238
1239
|
type: "custom",
|
|
@@ -1240,20 +1241,20 @@ const Pt = (a) => {
|
|
|
1240
1241
|
headerAlign: "right",
|
|
1241
1242
|
width: 20
|
|
1242
1243
|
}
|
|
1243
|
-
], v = g.useMemo(() => n.map((y,
|
|
1244
|
+
], v = g.useMemo(() => n.map((y, N) => ({
|
|
1244
1245
|
...y,
|
|
1245
|
-
id:
|
|
1246
|
-
priority:
|
|
1247
|
-
})), [n]),
|
|
1248
|
-
const
|
|
1249
|
-
t?.(
|
|
1250
|
-
},
|
|
1251
|
-
c ||
|
|
1246
|
+
id: N,
|
|
1247
|
+
priority: Bt(y)
|
|
1248
|
+
})), [n]), M = (y) => {
|
|
1249
|
+
const x = y.target.closest("[data-id]")?.getAttribute("data-id"), A = n[Number(x)];
|
|
1250
|
+
t?.(A?.guid ?? "");
|
|
1251
|
+
}, I = (y) => {
|
|
1252
|
+
c || M(y);
|
|
1252
1253
|
}, C = (y) => {
|
|
1253
|
-
c &&
|
|
1254
|
-
},
|
|
1254
|
+
c && M(y);
|
|
1255
|
+
}, B = (y) => v.find((N) => N.guid === y)?.id;
|
|
1255
1256
|
return /* @__PURE__ */ e(
|
|
1256
|
-
|
|
1257
|
+
re,
|
|
1257
1258
|
{
|
|
1258
1259
|
sx: {
|
|
1259
1260
|
height: "100dvh",
|
|
@@ -1264,9 +1265,9 @@ const Pt = (a) => {
|
|
|
1264
1265
|
...a
|
|
1265
1266
|
},
|
|
1266
1267
|
children: /* @__PURE__ */ e(
|
|
1267
|
-
|
|
1268
|
+
Ye,
|
|
1268
1269
|
{
|
|
1269
|
-
columns: c ?
|
|
1270
|
+
columns: c ? u : f,
|
|
1270
1271
|
disableColumnFilter: !0,
|
|
1271
1272
|
disableColumnMenu: !0,
|
|
1272
1273
|
hideFooter: !0,
|
|
@@ -1275,13 +1276,13 @@ const Pt = (a) => {
|
|
|
1275
1276
|
o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
|
|
1276
1277
|
},
|
|
1277
1278
|
onSortModelChange: (y) => {
|
|
1278
|
-
|
|
1279
|
+
b(y), p(T.DEBTS_CLICK_TABLE_SORT);
|
|
1279
1280
|
},
|
|
1280
1281
|
rows: v,
|
|
1281
1282
|
slotProps: {
|
|
1282
1283
|
baseIconButton: { color: "secondary", sx: { ml: 8 } },
|
|
1283
1284
|
row: {
|
|
1284
|
-
onMouseEnter:
|
|
1285
|
+
onMouseEnter: I,
|
|
1285
1286
|
onMouseLeave: () => !c && t?.(""),
|
|
1286
1287
|
onTouchStart: C,
|
|
1287
1288
|
onClick: c ? C : void 0
|
|
@@ -1290,7 +1291,7 @@ const Pt = (a) => {
|
|
|
1290
1291
|
sortModel: m,
|
|
1291
1292
|
sortingOrder: ["asc", "desc"],
|
|
1292
1293
|
sx: {
|
|
1293
|
-
[`& .MuiDataGrid-row[data-id="${
|
|
1294
|
+
[`& .MuiDataGrid-row[data-id="${B(r)}"]`]: {
|
|
1294
1295
|
backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
|
|
1295
1296
|
filter: "brightness(98%)"
|
|
1296
1297
|
}
|
|
@@ -1299,33 +1300,33 @@ const Pt = (a) => {
|
|
|
1299
1300
|
)
|
|
1300
1301
|
}
|
|
1301
1302
|
);
|
|
1302
|
-
},
|
|
1303
|
+
}, Ft = ({ buttonText: a, isOpen: n, onClick: r }) => {
|
|
1303
1304
|
const { isDesktop: t, isTablet: o } = Y(), i = n ? "unfold_less" : "unfold_more";
|
|
1304
1305
|
return t || o ? /* @__PURE__ */ e(
|
|
1305
|
-
|
|
1306
|
+
fe,
|
|
1306
1307
|
{
|
|
1307
1308
|
"aria-controls": "prioritize-debts",
|
|
1308
1309
|
"aria-describedby": "prioritize-debts",
|
|
1309
1310
|
"aria-haspopup": !0,
|
|
1310
1311
|
"aria-label": "prioritize-debts",
|
|
1311
1312
|
onClick: r,
|
|
1312
|
-
startIcon: /* @__PURE__ */ e(
|
|
1313
|
+
startIcon: /* @__PURE__ */ e(ee, { name: i }),
|
|
1313
1314
|
sx: { justifyContent: "start", minWidth: 214, mx: 4 },
|
|
1314
1315
|
children: a
|
|
1315
1316
|
}
|
|
1316
1317
|
) : /* @__PURE__ */ e(
|
|
1317
|
-
|
|
1318
|
+
Ue,
|
|
1318
1319
|
{
|
|
1319
1320
|
"aria-controls": "prioritize-debts",
|
|
1320
1321
|
"aria-describedby": "prioritize-debts",
|
|
1321
1322
|
"aria-haspopup": !0,
|
|
1322
1323
|
"aria-label": "prioritize-debts",
|
|
1323
1324
|
onClick: r,
|
|
1324
|
-
children: /* @__PURE__ */ e(
|
|
1325
|
+
children: /* @__PURE__ */ e(ee, { name: i })
|
|
1325
1326
|
}
|
|
1326
1327
|
);
|
|
1327
|
-
},
|
|
1328
|
-
const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: o, setSelectedDebtPriority: i } =
|
|
1328
|
+
}, Rt = D(({ buttonEl: a, onClose: n }) => {
|
|
1329
|
+
const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = $(), p = !!a, c = [
|
|
1329
1330
|
{
|
|
1330
1331
|
priority: P.FASTEST_PAYOFF_FIRST,
|
|
1331
1332
|
text: t.priority_sort_fastest_payoff
|
|
@@ -1346,7 +1347,7 @@ const Pt = (a) => {
|
|
|
1346
1347
|
i(m), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: m });
|
|
1347
1348
|
};
|
|
1348
1349
|
return /* @__PURE__ */ e(
|
|
1349
|
-
|
|
1350
|
+
Ze,
|
|
1350
1351
|
{
|
|
1351
1352
|
anchorEl: a,
|
|
1352
1353
|
anchorOrigin: {
|
|
@@ -1360,8 +1361,8 @@ const Pt = (a) => {
|
|
|
1360
1361
|
vertical: "top",
|
|
1361
1362
|
horizontal: "left"
|
|
1362
1363
|
},
|
|
1363
|
-
children: /* @__PURE__ */ e(
|
|
1364
|
-
|
|
1364
|
+
children: /* @__PURE__ */ e(_e, { children: c.map(({ priority: m, text: b }) => /* @__PURE__ */ s(
|
|
1365
|
+
qe,
|
|
1365
1366
|
{
|
|
1366
1367
|
onClick: () => d(m),
|
|
1367
1368
|
sx: {
|
|
@@ -1379,16 +1380,16 @@ const Pt = (a) => {
|
|
|
1379
1380
|
}
|
|
1380
1381
|
},
|
|
1381
1382
|
children: [
|
|
1382
|
-
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children:
|
|
1383
|
-
o === m && /* @__PURE__ */ e(
|
|
1383
|
+
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: b }),
|
|
1384
|
+
o === m && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
|
|
1384
1385
|
]
|
|
1385
1386
|
},
|
|
1386
1387
|
m
|
|
1387
1388
|
)) })
|
|
1388
1389
|
}
|
|
1389
1390
|
);
|
|
1390
|
-
}),
|
|
1391
|
-
const { onEvent: a } = F(), { debts: n } = S(), { selectedDebtPriority: r } =
|
|
1391
|
+
}), Lt = D(() => {
|
|
1392
|
+
const { onEvent: a } = F(), { debts: n } = S(), { selectedDebtPriority: r } = $(), [t, o] = g.useState(null), i = (m) => {
|
|
1392
1393
|
o(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
|
|
1393
1394
|
}, p = () => {
|
|
1394
1395
|
o(null);
|
|
@@ -1399,12 +1400,12 @@ const Pt = (a) => {
|
|
|
1399
1400
|
[P.LOWEST_BALANCE]: n.priority_sort_lowest_balance
|
|
1400
1401
|
})[r] ?? n.priority_sort_lowest_balance, [r]);
|
|
1401
1402
|
return /* @__PURE__ */ s(_, { children: [
|
|
1402
|
-
/* @__PURE__ */ e(
|
|
1403
|
-
/* @__PURE__ */ e(
|
|
1403
|
+
/* @__PURE__ */ e(Ft, { buttonText: d, isOpen: c, onClick: i }),
|
|
1404
|
+
/* @__PURE__ */ e(Rt, { buttonEl: t, onClose: p })
|
|
1404
1405
|
] });
|
|
1405
|
-
}),
|
|
1406
|
+
}), $t = (a, n, r = 0) => {
|
|
1406
1407
|
const t = a.map((d) => ({ ...d }));
|
|
1407
|
-
|
|
1408
|
+
xe(t, n);
|
|
1408
1409
|
const o = /* @__PURE__ */ new Date(), i = [];
|
|
1409
1410
|
let p = 0, c = 1;
|
|
1410
1411
|
for (const d of t)
|
|
@@ -1414,23 +1415,23 @@ const Pt = (a) => {
|
|
|
1414
1415
|
dataset: [{ x: new Date(o), y: d.balance }]
|
|
1415
1416
|
});
|
|
1416
1417
|
for (; t.some((d) => d.balance >= 0.01 && !d.is_impossible); ) {
|
|
1417
|
-
let d = !1, m = !1,
|
|
1418
|
-
for (const [
|
|
1419
|
-
if (
|
|
1420
|
-
const v = i[
|
|
1421
|
-
let y =
|
|
1422
|
-
!
|
|
1423
|
-
const
|
|
1424
|
-
if (
|
|
1425
|
-
|
|
1418
|
+
let d = !1, m = !1, b = !1;
|
|
1419
|
+
for (const [f, u] of t.entries()) {
|
|
1420
|
+
if (u.balance <= 0.01) continue;
|
|
1421
|
+
const v = i[f].dataset, I = (u.interest_rate ?? 0) / 100 / 12, C = u.balance * I, B = u.monthly_payment ?? 0;
|
|
1422
|
+
let y = B, N = 0;
|
|
1423
|
+
!b && r > 0 && (y += r, b = !0), !m && p > 0 && (N = p, m = !0), u.balance += C;
|
|
1424
|
+
const h = Math.min(u.balance, y + N);
|
|
1425
|
+
if (h <= C) {
|
|
1426
|
+
u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, v.push({ x: new Date(o), y: u.balance });
|
|
1426
1427
|
continue;
|
|
1427
1428
|
}
|
|
1428
|
-
|
|
1429
|
+
u.balance -= h, u.balance = u.balance < 0.01 ? 0 : u.balance, v.push({
|
|
1429
1430
|
x: new Date(o),
|
|
1430
|
-
y: Math.max(0,
|
|
1431
|
-
payment:
|
|
1432
|
-
extra:
|
|
1433
|
-
}),
|
|
1431
|
+
y: Math.max(0, u.balance),
|
|
1432
|
+
payment: h,
|
|
1433
|
+
extra: N
|
|
1434
|
+
}), u.balance <= 0 && (p += B, i[f].projected_payoff_date = new Date(o)), h > 0 && (d = !0);
|
|
1434
1435
|
}
|
|
1435
1436
|
d && o.setMonth(o.getMonth() + 1);
|
|
1436
1437
|
}
|
|
@@ -1439,10 +1440,10 @@ const Pt = (a) => {
|
|
|
1439
1440
|
}), i.forEach((d) => {
|
|
1440
1441
|
d.priority = !d.is_paid_off && !d.is_impossible ? c++ : void 0;
|
|
1441
1442
|
}), i;
|
|
1442
|
-
},
|
|
1443
|
-
const { debts: n } = S(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } =
|
|
1443
|
+
}, Ht = D(({ onClick: a }) => {
|
|
1444
|
+
const { debts: n } = S(), { 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;
|
|
1444
1445
|
return /* @__PURE__ */ e(
|
|
1445
|
-
|
|
1446
|
+
fe,
|
|
1446
1447
|
{
|
|
1447
1448
|
"aria-controls": "extra-paydown",
|
|
1448
1449
|
"aria-describedby": "extra-paydown",
|
|
@@ -1450,102 +1451,105 @@ const Pt = (a) => {
|
|
|
1450
1451
|
"aria-label": "extra-paydown",
|
|
1451
1452
|
onClick: a,
|
|
1452
1453
|
sx: { justifyContent: "start", minWidth: 100, mx: 4 },
|
|
1453
|
-
children:
|
|
1454
|
+
children: E(p, k(i, "0,0"))
|
|
1454
1455
|
}
|
|
1455
1456
|
);
|
|
1456
|
-
}),
|
|
1457
|
-
const [r, t] = g.useState(!1), [o, i] = g.useState(!1), [p, c] = g.useState(!1), [d, m] = g.useState(""), { isDesktop:
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1457
|
+
}), Ot = ({ onBackClick: a, sx: n }) => {
|
|
1458
|
+
const [r, t] = g.useState(!1), [o, i] = g.useState(!1), [p, c] = g.useState(!1), [d, m] = g.useState(""), { isDesktop: b, isMobile: f } = Y(), { debts: u } = S(), { onEvent: v } = F(), { isCopyLoaded: M, isInitialized: I, setSelectedAccounts: C } = Pe(), { setSelectedAccount: B } = Ne(), { selectedDebtPriority: y, setSelectedDebtChartData: N } = $(), { visibleDebtAccounts: h } = Z(), { goalsLoaded: x, loadGoals: A, monthlyCashFlowProfile: R } = V(), { debts: L } = q();
|
|
1459
|
+
Je({
|
|
1460
|
+
widgetName: "DebtsWidget",
|
|
1461
|
+
isLoaded: x
|
|
1462
|
+
});
|
|
1463
|
+
const O = g.useMemo(() => {
|
|
1464
|
+
const W = R?.extra_payment ?? 0;
|
|
1465
|
+
return $t(L, y, W);
|
|
1466
|
+
}, [L, y, R]);
|
|
1461
1467
|
g.useEffect(() => {
|
|
1462
|
-
|
|
1468
|
+
C(h), v(T.DEBTS_VIEW);
|
|
1463
1469
|
}, []), g.useEffect(() => {
|
|
1464
|
-
|
|
1465
|
-
}, [
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
O && y(O), le && b(le), t(!0);
|
|
1473
|
-
}, Ce = () => v(T.DEBTS_CLICK_FILTER), Se = () => {
|
|
1470
|
+
C(h);
|
|
1471
|
+
}, [h]), g.useEffect(() => {
|
|
1472
|
+
I && A().finally();
|
|
1473
|
+
}, [I]);
|
|
1474
|
+
const ne = (W) => m(W), oe = () => {
|
|
1475
|
+
const W = h.find((Q) => Q.guid === d), ie = O.find((Q) => Q.guid === d);
|
|
1476
|
+
W && B(W), ie && N(ie), t(!0);
|
|
1477
|
+
}, we = () => v(T.DEBTS_CLICK_FILTER), Ce = () => {
|
|
1474
1478
|
c(!0), v(T.DEBTS_CLICK_SNOWBALL_CTA);
|
|
1475
|
-
},
|
|
1479
|
+
}, Se = () => {
|
|
1476
1480
|
i(!0), v(T.DEBTS_CLICK_PAYDOWN);
|
|
1477
1481
|
};
|
|
1478
|
-
return !
|
|
1479
|
-
|
|
1482
|
+
return !x || !M || !I ? /* @__PURE__ */ e(Qe, {}) : /* @__PURE__ */ s(
|
|
1483
|
+
Oe,
|
|
1480
1484
|
{
|
|
1481
|
-
accountOptions:
|
|
1485
|
+
accountOptions: h,
|
|
1482
1486
|
actions: [
|
|
1483
|
-
/* @__PURE__ */ e(
|
|
1484
|
-
/* @__PURE__ */ e(
|
|
1487
|
+
/* @__PURE__ */ e(Lt, {}, "prioritize-debts"),
|
|
1488
|
+
/* @__PURE__ */ e(Ht, { onClick: Se }, "extra-paydown")
|
|
1485
1489
|
],
|
|
1486
|
-
onAccountsFilterClick:
|
|
1490
|
+
onAccountsFilterClick: we,
|
|
1487
1491
|
onBackClick: a,
|
|
1488
1492
|
sx: n,
|
|
1489
|
-
title:
|
|
1493
|
+
title: u.title,
|
|
1490
1494
|
children: [
|
|
1491
|
-
/* @__PURE__ */ s(w, { sx: { px:
|
|
1495
|
+
/* @__PURE__ */ s(w, { sx: { px: b ? "48px" : "24px" }, children: [
|
|
1492
1496
|
/* @__PURE__ */ s(
|
|
1493
1497
|
w,
|
|
1494
1498
|
{
|
|
1495
1499
|
sx: {
|
|
1496
|
-
alignItems:
|
|
1497
|
-
flexDirection:
|
|
1498
|
-
mx:
|
|
1500
|
+
alignItems: f ? "flex-start" : "flex-end",
|
|
1501
|
+
flexDirection: f ? "column" : "row",
|
|
1502
|
+
mx: f ? "-12px" : 0
|
|
1499
1503
|
},
|
|
1500
1504
|
children: [
|
|
1501
1505
|
/* @__PURE__ */ e(
|
|
1502
|
-
|
|
1506
|
+
ge,
|
|
1503
1507
|
{
|
|
1504
|
-
debts:
|
|
1505
|
-
height:
|
|
1508
|
+
debts: O,
|
|
1509
|
+
height: f ? 250 : void 0,
|
|
1506
1510
|
hoveredDebtGuid: d,
|
|
1507
|
-
onClickArea:
|
|
1508
|
-
onHoverArea:
|
|
1509
|
-
sx: { mr:
|
|
1511
|
+
onClickArea: oe,
|
|
1512
|
+
onHoverArea: ne,
|
|
1513
|
+
sx: { mr: f ? "4px" : "-48px" }
|
|
1510
1514
|
}
|
|
1511
1515
|
),
|
|
1512
1516
|
/* @__PURE__ */ e(
|
|
1513
|
-
|
|
1517
|
+
it,
|
|
1514
1518
|
{
|
|
1515
|
-
debts:
|
|
1516
|
-
onClickCta:
|
|
1517
|
-
sx: { mb:
|
|
1519
|
+
debts: O,
|
|
1520
|
+
onClickCta: Ce,
|
|
1521
|
+
sx: { mb: f ? "0px" : "64px" }
|
|
1518
1522
|
}
|
|
1519
1523
|
)
|
|
1520
1524
|
]
|
|
1521
1525
|
}
|
|
1522
1526
|
),
|
|
1523
|
-
/* @__PURE__ */ e(w, { sx: { mx:
|
|
1524
|
-
|
|
1527
|
+
/* @__PURE__ */ e(w, { sx: { mx: f ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1528
|
+
Nt,
|
|
1525
1529
|
{
|
|
1526
|
-
debts:
|
|
1530
|
+
debts: O,
|
|
1527
1531
|
hoveredDebtGuid: d,
|
|
1528
|
-
onClickRow:
|
|
1529
|
-
onHoverRow:
|
|
1532
|
+
onClickRow: oe,
|
|
1533
|
+
onHoverRow: ne
|
|
1530
1534
|
}
|
|
1531
1535
|
) })
|
|
1532
1536
|
] }),
|
|
1533
1537
|
/* @__PURE__ */ e(
|
|
1534
|
-
|
|
1538
|
+
st,
|
|
1535
1539
|
{
|
|
1536
1540
|
isOpen: p,
|
|
1537
1541
|
onClose: () => c(!1)
|
|
1538
1542
|
}
|
|
1539
1543
|
),
|
|
1540
|
-
/* @__PURE__ */ e(
|
|
1541
|
-
/* @__PURE__ */ e(
|
|
1544
|
+
/* @__PURE__ */ e(vt, { isOpen: r, onClose: () => t(!1) }),
|
|
1545
|
+
/* @__PURE__ */ e(Et, { isOpen: o, onClose: () => i(!1) })
|
|
1542
1546
|
]
|
|
1543
1547
|
}
|
|
1544
1548
|
);
|
|
1545
|
-
}, Nr = D(
|
|
1549
|
+
}, Nr = D(Ot);
|
|
1546
1550
|
export {
|
|
1547
|
-
|
|
1551
|
+
ge as DebtsChart,
|
|
1548
1552
|
Lr as DebtsStore,
|
|
1549
|
-
|
|
1553
|
+
Nt as DebtsTable,
|
|
1550
1554
|
Nr as DebtsWidget
|
|
1551
1555
|
};
|