@mx-cartographer/experiences 7.12.16 → 7.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/{AccountDetailsHeader-DkBNsLsI.mjs → AccountDetailsHeader-D9gbTbUt.mjs} +31 -31
- package/dist/{AccountFields-DeZSQOuM.mjs → AccountFields-CxqONzjY.mjs} +7 -7
- package/dist/AccountListItem-LcJVJysf.mjs +90 -0
- package/dist/{AccountStore-Brc0MNSF.mjs → AccountStore-BNlTuxWN.mjs} +12 -6
- package/dist/Accounts-o7ohkngR.mjs +27 -0
- package/dist/{BudgetUtil--_QXyszn.mjs → BudgetUtil-CLhRnCoX.mjs} +75 -75
- package/dist/{CashflowStore-DEdQJU5i.mjs → CashflowStore-D3MKniVM.mjs} +11 -11
- package/dist/{CategorySelectorDrawer-wfUTIbLR.mjs → CategorySelectorDrawer-DYHNBd2v.mjs} +31 -31
- package/dist/{ConnectDrawer-CioFo6Wy.mjs → ConnectDrawer-C0wjwcJt.mjs} +1 -1
- package/dist/{ConnectionsDrawer-DqhSaMrJ.mjs → ConnectionsDrawer-IA7vnv1J.mjs} +1 -1
- package/dist/{Drawer-DV4NTsFg.mjs → Drawer-Bbe4AMB1.mjs} +5 -5
- package/dist/{GoalStore-0bd-Upkc.mjs → GoalStore-DB58sKTC.mjs} +8 -8
- package/dist/HeaderCell-P8w6CmfO.mjs +6 -0
- package/dist/{Help-CDu1Fvrc.mjs → Help-CpLfyvPv.mjs} +24 -24
- package/dist/{LineChart-B1qbKR8q.mjs → LineChart-DBSlRSEm.mjs} +102 -102
- package/dist/{ManageIncome-BnWWjP2g.mjs → ManageIncome-QvqN555q.mjs} +62 -62
- package/dist/{MiniWidgetContainer-Cu72GNsE.mjs → MiniWidgetContainer-xLWSV6Wz.mjs} +13 -13
- package/dist/{NetWorthStore-DP78lgZ0.mjs → NetWorthStore-BqZ44-4M.mjs} +1 -1
- package/dist/{NotificationSettings-BH2yOwTB.mjs → NotificationSettings-DU3vJh5J.mjs} +139 -139
- package/dist/{OriginalBalanceAction-BM6rT_Cn.mjs → OriginalBalanceAction-DjpvVVFz.mjs} +6 -6
- package/dist/{RecurringSettings-BmXtfHtK.mjs → RecurringSettings-DdOcok2e.mjs} +2 -2
- package/dist/{RecurringTransactions-CYNpe_RS.mjs → RecurringTransactions-BOzBqfdg.mjs} +11 -11
- package/dist/{RecurringTransactionsStore-BD-OfVZ-.mjs → RecurringTransactionsStore-CcfPS0d3.mjs} +1 -1
- package/dist/{SpendingLegend-Bq6aXMNh.mjs → SpendingLegend-CJjjTGBw.mjs} +76 -76
- package/dist/{StatusIndicator-BV3oFzxo.mjs → StatusIndicator-CIKUOoN_.mjs} +53 -53
- package/dist/{TransactionDetails-DYlTwSDt.mjs → TransactionDetails-BpcWeXNU.mjs} +350 -350
- package/dist/{WidgetContainer-B0ncgABX.mjs → WidgetContainer-D_iaToWJ.mjs} +12 -12
- package/dist/accounts/index.es.js +107 -107
- package/dist/accounts/utils/Accounts.d.ts +1 -1
- package/dist/analytics/index.es.js +18 -18
- package/dist/budgets/index.es.js +182 -182
- package/dist/cashflow/index.es.js +223 -223
- package/dist/categories/index.es.js +1 -1
- package/dist/common/index.es.js +54 -64
- package/dist/dashboard/index.es.js +9 -9
- package/dist/debts/index.es.js +469 -469
- package/dist/finstrong/index.es.js +68 -68
- package/dist/goals/index.es.js +437 -437
- package/dist/help/index.es.js +2 -2
- package/dist/insights/index.es.js +159 -159
- package/dist/investments/index.es.js +292 -292
- package/dist/merchants/index.es.js +12 -12
- package/dist/networth/index.es.js +175 -168
- package/dist/notifications/index.es.js +13 -13
- package/dist/recurringtransactions/index.es.js +69 -69
- package/dist/settings/index.es.js +187 -187
- package/dist/spending/index.es.js +58 -58
- package/dist/transactions/index.es.js +70 -70
- package/dist/trends/index.es.js +15 -15
- package/package.json +1 -1
- package/dist/AccountListItem-BIVhda6q.mjs +0 -90
- package/dist/Accounts-M-LTzStv.mjs +0 -27
- package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
package/dist/debts/index.es.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import { Text as l, P as Ce, H3 as Fe, InstitutionLogo as Le, Icon as
|
|
7
|
-
import { intervalToDuration as $e, formatDuration as
|
|
8
|
-
import { addMonths as
|
|
2
|
+
import x from "react";
|
|
3
|
+
import { observer as D } from "mobx-react-lite";
|
|
4
|
+
import g from "@mui/material/Stack";
|
|
5
|
+
import { useTheme as V, Card as we, Stack as _, Box as W } from "@mui/material";
|
|
6
|
+
import { Text as l, P as Ce, H3 as Fe, InstitutionLogo as Le, Icon as ae } from "@mxenabled/mxui";
|
|
7
|
+
import { intervalToDuration as $e, formatDuration as Oe } from "date-fns";
|
|
8
|
+
import { addMonths as me } from "date-fns/addMonths";
|
|
9
9
|
import { fromUnixTime as ue } from "date-fns/fromUnixTime";
|
|
10
10
|
import { getUnixTime as be } from "date-fns/getUnixTime";
|
|
11
|
-
import { a as P, M as
|
|
12
|
-
import { D as
|
|
13
|
-
import { f as
|
|
11
|
+
import { a as P, M as He, I as We } from "../DebtsStore-BZqNLaqd.mjs";
|
|
12
|
+
import { D as ro } from "../DebtsStore-BZqNLaqd.mjs";
|
|
13
|
+
import { f as R, a as Ge } from "../NumberFormatting-QCaNwbjv.mjs";
|
|
14
14
|
import { f as Q, D as ee } from "../DateFormats-BMpMrZpW.mjs";
|
|
15
|
-
import { G as je, v as te, u as C, k as
|
|
16
|
-
import { u as
|
|
17
|
-
import { D as ie } from "../Drawer-
|
|
15
|
+
import { G as je, v as te, u as C, k as K, g as B, d as re, a as ze, b as Ye } from "../hooks-BxkfR-Ff.mjs";
|
|
16
|
+
import { u as U } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
|
+
import { D as ie } from "../Drawer-Bbe4AMB1.mjs";
|
|
18
18
|
import { b as E } from "../Localization-CPkpIwIx.mjs";
|
|
19
|
-
import { A as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
19
|
+
import { A as Ve, u as Ke } from "../AccountDetailsHeader-D9gbTbUt.mjs";
|
|
20
|
+
import Ue from "@mui/material/Card";
|
|
21
|
+
import qe from "@mui/material/CardContent";
|
|
22
|
+
import Xe from "@mui/material/CardHeader";
|
|
23
23
|
import le from "@mui/material/Box";
|
|
24
24
|
import { useTheme as Ze } from "@mui/material/styles";
|
|
25
25
|
import { LineChart as Je } from "@mui/x-charts/LineChart";
|
|
26
|
-
import { A as
|
|
26
|
+
import { A as S } from "../Analytics-BYItVAe-.mjs";
|
|
27
27
|
import _e from "@mui/material/Tab";
|
|
28
28
|
import Qe from "@mui/material/Tabs";
|
|
29
|
-
import
|
|
29
|
+
import ve from "@mui/material/List";
|
|
30
30
|
import G from "@mui/material/Divider";
|
|
31
|
-
import { M as et, I as tt, O as rt } from "../OriginalBalanceAction-
|
|
32
|
-
import
|
|
33
|
-
import { L as
|
|
31
|
+
import { M as et, I as tt, O as rt } from "../OriginalBalanceAction-DjpvVVFz.mjs";
|
|
32
|
+
import ot from "@mui/material/TextField";
|
|
33
|
+
import { L as oe } from "../ListItemAction-4KB7P75M.mjs";
|
|
34
34
|
import { C as se } from "../CurrencyInput-DuMktPu3.mjs";
|
|
35
35
|
import ye from "@mui/material/Alert";
|
|
36
36
|
import fe from "@mui/material/AlertTitle";
|
|
37
|
-
import
|
|
38
|
-
import { Error as
|
|
39
|
-
import { T as
|
|
40
|
-
import { DataGridPro as
|
|
41
|
-
import { H as j } from "../HeaderCell-
|
|
42
|
-
import { f as it, A as
|
|
43
|
-
import
|
|
37
|
+
import xe from "@mui/material/Paper";
|
|
38
|
+
import { Error as nt, CheckCircle as De } from "@mxenabled/mx-icons";
|
|
39
|
+
import { T as ge } from "../TabContentContainer-j01JYR_7.mjs";
|
|
40
|
+
import { DataGridPro as at } from "@mui/x-data-grid-pro";
|
|
41
|
+
import { H as j } from "../HeaderCell-P8w6CmfO.mjs";
|
|
42
|
+
import { f as it, A as Y } from "../Account-BiB1F8lL.mjs";
|
|
43
|
+
import Se from "@mui/material/Button";
|
|
44
44
|
import lt from "@mui/material/IconButton";
|
|
45
45
|
import st from "@mui/material/ListItem";
|
|
46
46
|
import ct from "@mui/material/Popover";
|
|
47
|
-
import { C as dt } from "../ConnectDrawer-
|
|
47
|
+
import { C as dt } from "../ConnectDrawer-C0wjwcJt.mjs";
|
|
48
48
|
import { u as pt } from "../useWidgetLoadTimer-DgN1bTyu.mjs";
|
|
49
|
-
import { L as
|
|
50
|
-
import { W as
|
|
49
|
+
import { L as ht } from "../Loader-D3rjKx72.mjs";
|
|
50
|
+
import { W as mt } from "../WidgetContainer-D_iaToWJ.mjs";
|
|
51
51
|
import { E as ut } from "../EmptyState-DHAkGsjk.mjs";
|
|
52
|
-
const bt = (
|
|
52
|
+
const bt = (o, n = 0, r = 0) => {
|
|
53
53
|
if (r === 0) return 0;
|
|
54
|
-
const t =
|
|
54
|
+
const t = n / (He * We);
|
|
55
55
|
return Math.ceil(
|
|
56
|
-
t === 0 ?
|
|
56
|
+
t === 0 ? o / r : -Math.log(1 - t * o / r) / Math.log(1 + t)
|
|
57
57
|
);
|
|
58
|
-
}, _t = (
|
|
58
|
+
}, _t = (o, n, r, t, a) => {
|
|
59
59
|
const i = [];
|
|
60
60
|
if (r === 0) {
|
|
61
|
-
for (let d = 0; d <
|
|
62
|
-
const p =
|
|
61
|
+
for (let d = 0; d < o; d++) {
|
|
62
|
+
const p = n - t * (d + 1), m = n - t * d, h = p >= 0 ? t : m;
|
|
63
63
|
i.push({
|
|
64
64
|
balance: p >= 0 ? p : 0,
|
|
65
65
|
interest: r,
|
|
66
|
-
payment:
|
|
67
|
-
principal:
|
|
66
|
+
payment: h,
|
|
67
|
+
principal: h,
|
|
68
68
|
timestamp: be(
|
|
69
|
-
|
|
70
|
-
ue(
|
|
69
|
+
me(
|
|
70
|
+
ue(a),
|
|
71
71
|
// convert seconds → Date
|
|
72
72
|
d + 1
|
|
73
73
|
// add (index + 1) months
|
|
@@ -78,98 +78,98 @@ const bt = (a, o = 0, r = 0) => {
|
|
|
78
78
|
return i;
|
|
79
79
|
}
|
|
80
80
|
const c = r / 1200;
|
|
81
|
-
for (let d = 0; d <
|
|
82
|
-
const p = be(
|
|
81
|
+
for (let d = 0; d < o; d++) {
|
|
82
|
+
const p = be(me(ue(a), d + 1)), m = Math.pow(1 + c, d), h = n * m - t * ((m - 1) / c), w = Math.pow(1 + c, d + 1), b = n * w - t * ((w - 1) / c), M = t + Math.min(b, 0), k = h * c;
|
|
83
83
|
i.push({
|
|
84
84
|
balance: Math.max(0, b),
|
|
85
|
-
interest:
|
|
86
|
-
payment:
|
|
87
|
-
principal:
|
|
85
|
+
interest: k,
|
|
86
|
+
payment: M,
|
|
87
|
+
principal: M - k,
|
|
88
88
|
timestamp: p
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
return i;
|
|
92
|
-
}, yt = (
|
|
93
|
-
const { monthly_payment:
|
|
92
|
+
}, yt = (o) => (o[o.length - 1] || {}).timestamp, ft = (o) => {
|
|
93
|
+
const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: a } = o, i = bt(t, r ?? 0, n ?? 0), c = _t(
|
|
94
94
|
i,
|
|
95
95
|
t,
|
|
96
96
|
r ?? 0,
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
n ?? 0,
|
|
98
|
+
a
|
|
99
99
|
), d = yt(c);
|
|
100
100
|
return {
|
|
101
|
-
...
|
|
101
|
+
...o,
|
|
102
102
|
minimumFinalPayment: d,
|
|
103
103
|
minimumPayments: c
|
|
104
104
|
};
|
|
105
|
-
}, Te = (
|
|
106
|
-
const [r, t] =
|
|
107
|
-
([
|
|
105
|
+
}, Te = (o, n) => {
|
|
106
|
+
const [r, t] = o.reduce(
|
|
107
|
+
([a, i], c) => (c.is_paid_off || c.is_impossible ? i.push({ ...c, minimumPayments: [] }) : a.push(ft(c)), [a, i]),
|
|
108
108
|
[[], []]
|
|
109
109
|
);
|
|
110
|
-
switch (
|
|
110
|
+
switch (n) {
|
|
111
111
|
case P.FASTEST_PAYOFF_FIRST:
|
|
112
|
-
r.sort((
|
|
112
|
+
r.sort((a, i) => (a.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
|
|
113
113
|
break;
|
|
114
114
|
case P.HIGHEST_INTEREST:
|
|
115
|
-
r.sort((
|
|
115
|
+
r.sort((a, i) => (i.interest_rate ?? 0) - (a.interest_rate ?? 0));
|
|
116
116
|
break;
|
|
117
117
|
case P.LOWEST_BALANCE:
|
|
118
|
-
r.sort((
|
|
118
|
+
r.sort((a, i) => a.balance - i.balance);
|
|
119
119
|
break;
|
|
120
120
|
case P.HIGHEST_BALANCE:
|
|
121
|
-
r.sort((
|
|
121
|
+
r.sort((a, i) => i.balance - a.balance);
|
|
122
122
|
break;
|
|
123
123
|
default:
|
|
124
|
-
r.sort((
|
|
124
|
+
r.sort((a, i) => a.balance - i.balance);
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
o.splice(0, o.length, ...r, ...t);
|
|
127
127
|
};
|
|
128
|
-
function
|
|
129
|
-
const t =
|
|
130
|
-
(
|
|
128
|
+
function xt(o, n, r = 0) {
|
|
129
|
+
const t = o.map((h) => ({ ...h })).filter(
|
|
130
|
+
(h) => h.interest_rate !== void 0 && h.monthly_payment !== void 0 && !h.is_paid_off
|
|
131
131
|
);
|
|
132
|
-
Te(t,
|
|
133
|
-
let
|
|
132
|
+
Te(t, n);
|
|
133
|
+
let a = 0, i = 0;
|
|
134
134
|
const c = /* @__PURE__ */ new Date(), d = /* @__PURE__ */ new Date();
|
|
135
|
-
for (; t.some((
|
|
136
|
-
let
|
|
135
|
+
for (; t.some((h) => h.balance >= 0.01 && !h.is_impossible); ) {
|
|
136
|
+
let h = !1;
|
|
137
137
|
for (const [w, b] of t.entries()) {
|
|
138
138
|
if (b.balance <= 0.01 || b.is_impossible) continue;
|
|
139
|
-
const
|
|
140
|
-
let
|
|
141
|
-
w === 0 && r && (
|
|
142
|
-
const T = Math.min(b.balance,
|
|
139
|
+
const k = (b.interest_rate ?? 0) / 100 / 12, I = b.balance * k;
|
|
140
|
+
let v = b.monthly_payment ?? 0;
|
|
141
|
+
w === 0 && r && (v += r), b.balance += I;
|
|
142
|
+
const T = Math.min(b.balance, v + i);
|
|
143
143
|
if (T <= I) {
|
|
144
144
|
b.is_impossible = !0;
|
|
145
145
|
continue;
|
|
146
146
|
}
|
|
147
|
-
b.balance -= T, b.balance = b.balance < 0.01 ? 0 : b.balance,
|
|
147
|
+
b.balance -= T, b.balance = b.balance < 0.01 ? 0 : b.balance, a += I, b.balance <= 0 && (i += v), T > 0 && (h = !0);
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
h && d.setMonth(d.getMonth() + 1);
|
|
150
150
|
}
|
|
151
|
-
const p = t.some((
|
|
151
|
+
const p = t.some((h) => h.is_impossible && h.balance > 0), m = $e({ start: c, end: d });
|
|
152
152
|
return {
|
|
153
|
-
payoffSavings: p ? "N/A" :
|
|
153
|
+
payoffSavings: p ? "N/A" : R(a, "0,0.00"),
|
|
154
154
|
payoffDate: p ? "Never" : Q(d, ee.MONTH_YEAR),
|
|
155
|
-
payoffDuration: p ? "Stagnant" :
|
|
155
|
+
payoffDuration: p ? "Stagnant" : Oe(m, { format: ["years", "months"] }) || "0 months"
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
const F = () => {
|
|
159
|
-
if (!
|
|
159
|
+
if (!x.useContext(je))
|
|
160
160
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
161
161
|
return te().uiStore;
|
|
162
|
-
},
|
|
163
|
-
const t =
|
|
162
|
+
}, gt = ({ debts: o, onClickCta: n, sx: r }) => {
|
|
163
|
+
const t = V(), { isMobile: a } = U(), { debts: i } = C(), { selectedDebtPriority: c } = F(), { monthlyCashFlowProfile: d } = K(), { payoffDate: p, payoffSavings: m, payoffDuration: h } = x.useMemo(() => {
|
|
164
164
|
const w = d?.extra_payment ?? 0;
|
|
165
|
-
return
|
|
166
|
-
}, [
|
|
165
|
+
return xt(o, c, w);
|
|
166
|
+
}, [o, c, d]);
|
|
167
167
|
return /* @__PURE__ */ e(
|
|
168
168
|
we,
|
|
169
169
|
{
|
|
170
170
|
sx: {
|
|
171
171
|
boxShadow: t.shadows[2],
|
|
172
|
-
width:
|
|
172
|
+
width: a ? "100%" : "186px",
|
|
173
173
|
minWidth: "186px",
|
|
174
174
|
...r
|
|
175
175
|
},
|
|
@@ -177,66 +177,66 @@ const F = () => {
|
|
|
177
177
|
/* @__PURE__ */ s(
|
|
178
178
|
_,
|
|
179
179
|
{
|
|
180
|
-
gap:
|
|
180
|
+
gap: a ? "4px" : "0",
|
|
181
181
|
sx: {
|
|
182
182
|
borderBottom: "1px solid",
|
|
183
183
|
borderBottomColor: t.palette.grey[300],
|
|
184
184
|
pb: "8px"
|
|
185
185
|
},
|
|
186
186
|
children: [
|
|
187
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
188
|
-
/* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "
|
|
187
|
+
/* @__PURE__ */ e(l, { variant: "caption", children: i.snowball_card_date_description }),
|
|
188
|
+
/* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "body2", children: p })
|
|
189
189
|
]
|
|
190
190
|
}
|
|
191
191
|
),
|
|
192
|
-
/* @__PURE__ */ s(_, { gap:
|
|
193
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
194
|
-
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "
|
|
192
|
+
/* @__PURE__ */ s(_, { gap: a ? "4px" : "0", children: [
|
|
193
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body2", children: m }),
|
|
194
|
+
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "caption", children: i.snowball_card_amount_description })
|
|
195
195
|
] }),
|
|
196
|
-
/* @__PURE__ */ s(_, { gap:
|
|
197
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
198
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
196
|
+
/* @__PURE__ */ s(_, { gap: a ? "4px" : "0", children: [
|
|
197
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body2", children: h }),
|
|
198
|
+
/* @__PURE__ */ e(l, { variant: "caption", children: i.snowball_card_duration_description })
|
|
199
199
|
] }),
|
|
200
200
|
/* @__PURE__ */ e(
|
|
201
201
|
l,
|
|
202
202
|
{
|
|
203
203
|
bold: !0,
|
|
204
204
|
color: t.palette.primary.main,
|
|
205
|
-
onClick:
|
|
205
|
+
onClick: n,
|
|
206
206
|
sx: { cursor: "pointer" },
|
|
207
|
-
variant: "
|
|
207
|
+
variant: "body2",
|
|
208
208
|
children: i.snowball_card_cta
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
211
|
] })
|
|
212
212
|
}
|
|
213
213
|
);
|
|
214
|
-
}, wt =
|
|
215
|
-
const r =
|
|
214
|
+
}, wt = D(gt), Ct = ({ isOpen: o, onClose: n }) => {
|
|
215
|
+
const r = V(), { debts: t } = C(), [a, i] = x.useState(!1);
|
|
216
216
|
return /* @__PURE__ */ e(
|
|
217
217
|
ie,
|
|
218
218
|
{
|
|
219
219
|
ariaLabelClose: "",
|
|
220
|
-
isOpen:
|
|
221
|
-
onClose:
|
|
220
|
+
isOpen: o,
|
|
221
|
+
onClose: n,
|
|
222
222
|
title: t.snowball_drawer_title,
|
|
223
223
|
children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
|
|
224
224
|
/* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
|
|
225
225
|
/* @__PURE__ */ s(_, { alignItems: "center", pb: 24, children: [
|
|
226
|
-
/* @__PURE__ */ e(l, { mb: 12, variant: "
|
|
227
|
-
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "
|
|
228
|
-
/* @__PURE__ */ e(Ce, { variant: "
|
|
229
|
-
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "
|
|
226
|
+
/* @__PURE__ */ e(l, { mb: 12, variant: "h3", children: t.snowball_drawer_subtitle }),
|
|
227
|
+
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "body2", children: t.snowball_drawer_amount_description }),
|
|
228
|
+
/* @__PURE__ */ e(Ce, { variant: "h1", children: t.snowball_drawer_savings }),
|
|
229
|
+
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "body2", children: t.snowball_drawer_duration_description })
|
|
230
230
|
] }),
|
|
231
231
|
/* @__PURE__ */ s(we, { sx: { display: "grid", py: 16, px: 24 }, children: [
|
|
232
|
-
/* @__PURE__ */ e(l, { mb: 4, variant: "
|
|
232
|
+
/* @__PURE__ */ e(l, { mb: 4, variant: "h3", children: t.snowball_drawer_question }),
|
|
233
233
|
/* @__PURE__ */ e(
|
|
234
234
|
l,
|
|
235
235
|
{
|
|
236
236
|
color: r.palette.secondary.main,
|
|
237
237
|
mb: 8,
|
|
238
|
-
sx: { whiteSpace:
|
|
239
|
-
variant: "
|
|
238
|
+
sx: { whiteSpace: a ? "normal" : "nowrap" },
|
|
239
|
+
variant: "subtitle2",
|
|
240
240
|
children: t.snowball_drawer_answer
|
|
241
241
|
}
|
|
242
242
|
),
|
|
@@ -245,10 +245,10 @@ const F = () => {
|
|
|
245
245
|
{
|
|
246
246
|
bold: !0,
|
|
247
247
|
color: r.palette.primary.main,
|
|
248
|
-
onClick: () => i(!
|
|
248
|
+
onClick: () => i(!a),
|
|
249
249
|
sx: { cursor: "pointer" },
|
|
250
|
-
variant: "
|
|
251
|
-
children:
|
|
250
|
+
variant: "body2",
|
|
251
|
+
children: a ? t.snowball_drawer_less : t.snowball_drawer_more
|
|
252
252
|
}
|
|
253
253
|
)
|
|
254
254
|
] })
|
|
@@ -260,13 +260,13 @@ const F = () => {
|
|
|
260
260
|
color: r.palette.secondary.main,
|
|
261
261
|
px: 24,
|
|
262
262
|
sx: { textAlign: "center", whiteSpace: "normal" },
|
|
263
|
-
variant: "
|
|
263
|
+
variant: "body2",
|
|
264
264
|
children: t.snowball_drawer_disclaimer
|
|
265
265
|
}
|
|
266
266
|
),
|
|
267
267
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
268
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
269
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
268
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: E(t.snowball_drawer_month_header, 1) }),
|
|
269
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
|
|
270
270
|
] }),
|
|
271
271
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
272
272
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
@@ -283,7 +283,7 @@ const F = () => {
|
|
|
283
283
|
backgroundColor: r.palette.success.main,
|
|
284
284
|
marginRight: 12
|
|
285
285
|
},
|
|
286
|
-
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "
|
|
286
|
+
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
|
|
287
287
|
}
|
|
288
288
|
),
|
|
289
289
|
/* @__PURE__ */ s(
|
|
@@ -298,8 +298,8 @@ const F = () => {
|
|
|
298
298
|
},
|
|
299
299
|
children: [
|
|
300
300
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
301
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
302
|
-
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "
|
|
301
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: E(t.snowball_drawer_debt_label, "A") }),
|
|
302
|
+
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "caption", children: [
|
|
303
303
|
E(
|
|
304
304
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
305
305
|
"$100"
|
|
@@ -309,14 +309,14 @@ const F = () => {
|
|
|
309
309
|
] })
|
|
310
310
|
] }),
|
|
311
311
|
/* @__PURE__ */ s(_, { children: [
|
|
312
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
312
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: "$100.00" }),
|
|
313
313
|
/* @__PURE__ */ e(
|
|
314
314
|
l,
|
|
315
315
|
{
|
|
316
316
|
bold: !0,
|
|
317
317
|
color: r.palette.success.main,
|
|
318
318
|
textAlign: "end",
|
|
319
|
-
variant: "
|
|
319
|
+
variant: "tiny",
|
|
320
320
|
children: t.snowball_drawer_paid_label
|
|
321
321
|
}
|
|
322
322
|
)
|
|
@@ -349,8 +349,8 @@ const F = () => {
|
|
|
349
349
|
pr: 24
|
|
350
350
|
},
|
|
351
351
|
children: [
|
|
352
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "
|
|
353
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
352
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "body1", children: E(t.snowball_drawer_debt_label, "B") }),
|
|
353
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: "$400.00" })
|
|
354
354
|
]
|
|
355
355
|
}
|
|
356
356
|
)
|
|
@@ -369,8 +369,8 @@ const F = () => {
|
|
|
369
369
|
}
|
|
370
370
|
),
|
|
371
371
|
/* @__PURE__ */ s(_, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
|
|
372
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "
|
|
373
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
372
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "body1", children: E(t.snowball_drawer_debt_label, "C") }),
|
|
373
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: "$1,000.00" })
|
|
374
374
|
] })
|
|
375
375
|
] }),
|
|
376
376
|
/* @__PURE__ */ s(
|
|
@@ -385,15 +385,15 @@ const F = () => {
|
|
|
385
385
|
borderBottom: `1px solid ${r.palette.border.light}`
|
|
386
386
|
},
|
|
387
387
|
children: [
|
|
388
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
389
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
388
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
|
|
389
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: "$1,500.00" })
|
|
390
390
|
]
|
|
391
391
|
}
|
|
392
392
|
)
|
|
393
393
|
] }),
|
|
394
394
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
395
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
396
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
395
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: E(t.snowball_drawer_month_header, 2) }),
|
|
396
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
|
|
397
397
|
] }),
|
|
398
398
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
399
399
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
@@ -410,7 +410,7 @@ const F = () => {
|
|
|
410
410
|
backgroundColor: r.palette.success.main,
|
|
411
411
|
marginRight: 12
|
|
412
412
|
},
|
|
413
|
-
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "
|
|
413
|
+
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
|
|
414
414
|
}
|
|
415
415
|
),
|
|
416
416
|
/* @__PURE__ */ s(
|
|
@@ -425,8 +425,8 @@ const F = () => {
|
|
|
425
425
|
},
|
|
426
426
|
children: [
|
|
427
427
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
428
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
429
|
-
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "
|
|
428
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: E(t.snowball_drawer_debt_label, "B") }),
|
|
429
|
+
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "caption", children: [
|
|
430
430
|
E(
|
|
431
431
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
432
432
|
"$500"
|
|
@@ -436,14 +436,14 @@ const F = () => {
|
|
|
436
436
|
] })
|
|
437
437
|
] }),
|
|
438
438
|
/* @__PURE__ */ s(_, { children: [
|
|
439
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
439
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: "$500.00" }),
|
|
440
440
|
/* @__PURE__ */ e(
|
|
441
441
|
l,
|
|
442
442
|
{
|
|
443
443
|
bold: !0,
|
|
444
444
|
color: r.palette.success.main,
|
|
445
445
|
textAlign: "end",
|
|
446
|
-
variant: "
|
|
446
|
+
variant: "tiny",
|
|
447
447
|
children: t.snowball_drawer_paid_label
|
|
448
448
|
}
|
|
449
449
|
)
|
|
@@ -475,8 +475,8 @@ const F = () => {
|
|
|
475
475
|
pr: 24
|
|
476
476
|
},
|
|
477
477
|
children: [
|
|
478
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "
|
|
479
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
478
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "body1", children: E(t.snowball_drawer_debt_label, "C") }),
|
|
479
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: "$1,000.00" })
|
|
480
480
|
]
|
|
481
481
|
}
|
|
482
482
|
)
|
|
@@ -493,15 +493,15 @@ const F = () => {
|
|
|
493
493
|
borderBottom: `1px solid ${r.palette.border.light}`
|
|
494
494
|
},
|
|
495
495
|
children: [
|
|
496
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
497
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
496
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
|
|
497
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: "$1,500.00" })
|
|
498
498
|
]
|
|
499
499
|
}
|
|
500
500
|
)
|
|
501
501
|
] }),
|
|
502
502
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
503
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
504
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
503
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: E(t.snowball_drawer_month_header, 3) }),
|
|
504
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
|
|
505
505
|
] }),
|
|
506
506
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
507
507
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
@@ -518,7 +518,7 @@ const F = () => {
|
|
|
518
518
|
backgroundColor: r.palette.success.main,
|
|
519
519
|
marginRight: 12
|
|
520
520
|
},
|
|
521
|
-
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "
|
|
521
|
+
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
|
|
522
522
|
}
|
|
523
523
|
),
|
|
524
524
|
/* @__PURE__ */ s(
|
|
@@ -532,16 +532,16 @@ const F = () => {
|
|
|
532
532
|
pr: 24
|
|
533
533
|
},
|
|
534
534
|
children: [
|
|
535
|
-
/* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "
|
|
535
|
+
/* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "body1", children: E(t.snowball_drawer_debt_label, "C") }) }),
|
|
536
536
|
/* @__PURE__ */ s(_, { children: [
|
|
537
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
537
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: "$1,500.00" }),
|
|
538
538
|
/* @__PURE__ */ e(
|
|
539
539
|
l,
|
|
540
540
|
{
|
|
541
541
|
bold: !0,
|
|
542
542
|
color: r.palette.success.main,
|
|
543
543
|
textAlign: "end",
|
|
544
|
-
variant: "
|
|
544
|
+
variant: "tiny",
|
|
545
545
|
children: t.snowball_drawer_paid_label
|
|
546
546
|
}
|
|
547
547
|
)
|
|
@@ -562,8 +562,8 @@ const F = () => {
|
|
|
562
562
|
borderBottom: `1px solid ${r.palette.border.light}`
|
|
563
563
|
},
|
|
564
564
|
children: [
|
|
565
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
566
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
565
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
|
|
566
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: "$1,500.00" })
|
|
567
567
|
]
|
|
568
568
|
}
|
|
569
569
|
)
|
|
@@ -572,50 +572,50 @@ const F = () => {
|
|
|
572
572
|
] })
|
|
573
573
|
}
|
|
574
574
|
);
|
|
575
|
-
},
|
|
576
|
-
function
|
|
577
|
-
const [r, t,
|
|
578
|
-
Math.max(0, Math.min(255, Math.round(r *
|
|
579
|
-
Math.max(0, Math.min(255, Math.round(t *
|
|
580
|
-
Math.max(0, Math.min(255, Math.round(
|
|
575
|
+
}, vt = D(Ct), Dt = "#FF7B08";
|
|
576
|
+
function St(o, n) {
|
|
577
|
+
const [r, t, a] = o.replace(/^#/, "").match(/.{1,2}/g).map((c) => parseInt(c, 16)), i = [
|
|
578
|
+
Math.max(0, Math.min(255, Math.round(r * n))),
|
|
579
|
+
Math.max(0, Math.min(255, Math.round(t * n))),
|
|
580
|
+
Math.max(0, Math.min(255, Math.round(a * n)))
|
|
581
581
|
];
|
|
582
582
|
return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
|
|
583
583
|
}
|
|
584
584
|
const Ae = ({
|
|
585
|
-
sx:
|
|
586
|
-
height:
|
|
585
|
+
sx: o,
|
|
586
|
+
height: n = 500,
|
|
587
587
|
width: r,
|
|
588
588
|
debts: t,
|
|
589
|
-
hoveredDebtGuid:
|
|
589
|
+
hoveredDebtGuid: a,
|
|
590
590
|
onClickArea: i,
|
|
591
591
|
onHoverArea: c
|
|
592
592
|
}) => {
|
|
593
|
-
const d = Ze(), { onEvent: p } =
|
|
593
|
+
const d = Ze(), { onEvent: p } = B(), m = t.filter((u) => !u.is_impossible), h = [
|
|
594
594
|
...new Set(
|
|
595
|
-
|
|
595
|
+
m.flatMap((u) => u.dataset.map((f) => new Date(f.x).getTime()))
|
|
596
596
|
)
|
|
597
|
-
].sort((u, f) => u - f).map((u) => new Date(u)), w =
|
|
597
|
+
].sort((u, f) => u - f).map((u) => new Date(u)), w = m.map((u) => {
|
|
598
598
|
const f = new Map(u.dataset.map((L) => [new Date(L.x).getTime(), L.y]));
|
|
599
|
-
let A = f.get(
|
|
600
|
-
const
|
|
599
|
+
let A = f.get(h[0].getTime()) ?? 0;
|
|
600
|
+
const N = h.map((L) => {
|
|
601
601
|
const z = f.get(L.getTime()) ?? A;
|
|
602
602
|
return A = z, { x: L, y: z };
|
|
603
603
|
});
|
|
604
|
-
return { ...u, dataset:
|
|
604
|
+
return { ...u, dataset: N };
|
|
605
605
|
}), b = w.reduce(
|
|
606
606
|
(u, f) => u + (f.dataset[0]?.y ?? 0),
|
|
607
607
|
0
|
|
608
|
-
),
|
|
609
|
-
const A = f / (
|
|
610
|
-
return { x: u, y:
|
|
611
|
-
}),
|
|
612
|
-
const A = 1 - f / w.length * 0.5,
|
|
608
|
+
), M = h.map((u, f) => {
|
|
609
|
+
const A = f / (h.length - 1), N = b * (1 - A);
|
|
610
|
+
return { x: u, y: N };
|
|
611
|
+
}), k = Math.ceil(b / 100) * 100, I = h, v = w.map((u, f) => {
|
|
612
|
+
const A = 1 - f / w.length * 0.5, N = St(Dt, A);
|
|
613
613
|
return {
|
|
614
614
|
id: `debt-${f}`,
|
|
615
615
|
guid: u.guid,
|
|
616
616
|
label: u.name,
|
|
617
617
|
data: u.dataset.map((L) => L.y),
|
|
618
|
-
color:
|
|
618
|
+
color: N,
|
|
619
619
|
curve: "linear",
|
|
620
620
|
type: "line",
|
|
621
621
|
area: !0,
|
|
@@ -623,10 +623,10 @@ const Ae = ({
|
|
|
623
623
|
showMark: !1
|
|
624
624
|
};
|
|
625
625
|
});
|
|
626
|
-
|
|
626
|
+
v.push({
|
|
627
627
|
id: "payoff-line",
|
|
628
628
|
label: "Payoff Line",
|
|
629
|
-
data:
|
|
629
|
+
data: M.map((u) => u.y),
|
|
630
630
|
color: d.palette.grey[700],
|
|
631
631
|
curve: "linear",
|
|
632
632
|
type: "line",
|
|
@@ -634,7 +634,7 @@ const Ae = ({
|
|
|
634
634
|
showMark: !1,
|
|
635
635
|
disableHighlight: !0
|
|
636
636
|
});
|
|
637
|
-
const T = (u) =>
|
|
637
|
+
const T = (u) => v.findIndex((f) => f?.guid === u);
|
|
638
638
|
return /* @__PURE__ */ e(
|
|
639
639
|
le,
|
|
640
640
|
{
|
|
@@ -655,19 +655,19 @@ const Ae = ({
|
|
|
655
655
|
{
|
|
656
656
|
axisHighlight: { x: "none" },
|
|
657
657
|
disableLineItemHighlight: !0,
|
|
658
|
-
height:
|
|
658
|
+
height: n,
|
|
659
659
|
hideLegend: !0,
|
|
660
660
|
margin: { bottom: 24, left: 32, right: 72, top: 48 },
|
|
661
661
|
onAreaClick: (u, f) => {
|
|
662
662
|
i?.();
|
|
663
|
-
const A =
|
|
664
|
-
p(
|
|
663
|
+
const A = v.find((N) => N.id === f.seriesId);
|
|
664
|
+
p(S.DEBTS_CLICK_CHART_AREA, { account_guid: A?.guid });
|
|
665
665
|
},
|
|
666
666
|
onHighlightChange: (u) => {
|
|
667
|
-
const f =
|
|
667
|
+
const f = v.find((A) => A.id === u?.seriesId)?.guid;
|
|
668
668
|
c?.(f ?? "");
|
|
669
669
|
},
|
|
670
|
-
series:
|
|
670
|
+
series: v,
|
|
671
671
|
skipAnimation: !0,
|
|
672
672
|
slotProps: { tooltip: { trigger: "none" } },
|
|
673
673
|
sx: {
|
|
@@ -687,23 +687,23 @@ const Ae = ({
|
|
|
687
687
|
strokeDasharray: "10 5",
|
|
688
688
|
strokeWidth: 1
|
|
689
689
|
},
|
|
690
|
-
[`& .MuiLineElement-series-debt-${T(
|
|
690
|
+
[`& .MuiLineElement-series-debt-${T(a ?? "0")}`]: {
|
|
691
691
|
opacity: 1
|
|
692
692
|
},
|
|
693
|
-
[`& .MuiAreaElement-series-debt-${T(
|
|
693
|
+
[`& .MuiAreaElement-series-debt-${T(a ?? "0")}`]: {
|
|
694
694
|
opacity: 1
|
|
695
695
|
},
|
|
696
696
|
"& .MuiChartsAxis-tickLabel > tspan": {
|
|
697
|
-
fontFamily: d.typography.
|
|
697
|
+
fontFamily: d.typography.body2.fontFamily
|
|
698
698
|
},
|
|
699
|
-
...
|
|
699
|
+
...o
|
|
700
700
|
},
|
|
701
701
|
width: r,
|
|
702
702
|
xAxis: [
|
|
703
703
|
{
|
|
704
704
|
data: I,
|
|
705
705
|
disableTicks: !0,
|
|
706
|
-
min:
|
|
706
|
+
min: h[0],
|
|
707
707
|
scaleType: "time",
|
|
708
708
|
tickLabelMinGap: 24,
|
|
709
709
|
valueFormatter: (u) => Q(u, ee.MONTH_SHORT_YEAR)
|
|
@@ -712,9 +712,9 @@ const Ae = ({
|
|
|
712
712
|
yAxis: [
|
|
713
713
|
{
|
|
714
714
|
min: 0,
|
|
715
|
-
max:
|
|
715
|
+
max: k,
|
|
716
716
|
disableTicks: !0,
|
|
717
|
-
valueFormatter: (u) =>
|
|
717
|
+
valueFormatter: (u) => R(u, "0a")
|
|
718
718
|
}
|
|
719
719
|
]
|
|
720
720
|
}
|
|
@@ -722,10 +722,10 @@ const Ae = ({
|
|
|
722
722
|
}
|
|
723
723
|
);
|
|
724
724
|
}, Tt = () => {
|
|
725
|
-
const
|
|
725
|
+
const o = V(), { debts: n } = C(), { selectedDebtChartData: r } = F();
|
|
726
726
|
return /* @__PURE__ */ s($, { children: [
|
|
727
727
|
/* @__PURE__ */ s(
|
|
728
|
-
|
|
728
|
+
Ue,
|
|
729
729
|
{
|
|
730
730
|
sx: {
|
|
731
731
|
"& .MuiCardContent-root:last-child": {
|
|
@@ -733,70 +733,70 @@ const Ae = ({
|
|
|
733
733
|
}
|
|
734
734
|
},
|
|
735
735
|
children: [
|
|
736
|
-
/* @__PURE__ */ e(
|
|
737
|
-
/* @__PURE__ */ e(
|
|
736
|
+
/* @__PURE__ */ e(Xe, { sx: { pb: 0 }, title: /* @__PURE__ */ e(Fe, { sx: { pb: 4 }, children: n.details_chart_title }) }),
|
|
737
|
+
/* @__PURE__ */ e(qe, { sx: { p: 0 }, children: /* @__PURE__ */ e(Ae, { debts: [r], height: 250 }) })
|
|
738
738
|
]
|
|
739
739
|
}
|
|
740
740
|
),
|
|
741
741
|
/* @__PURE__ */ e(
|
|
742
742
|
l,
|
|
743
743
|
{
|
|
744
|
-
color:
|
|
744
|
+
color: o.palette.text.secondary,
|
|
745
745
|
sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
|
|
746
|
-
variant: "
|
|
747
|
-
children:
|
|
746
|
+
variant: "body2",
|
|
747
|
+
children: n.details_chart_description
|
|
748
748
|
}
|
|
749
749
|
)
|
|
750
750
|
] });
|
|
751
|
-
}, At =
|
|
752
|
-
const
|
|
753
|
-
return
|
|
751
|
+
}, At = D(Tt), Et = () => {
|
|
752
|
+
const o = V(), { onEvent: n } = B(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: a, showError: i } = F();
|
|
753
|
+
return x.useEffect(() => n(S.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(ve, { children: i || a ? /* @__PURE__ */ e(
|
|
754
754
|
l,
|
|
755
755
|
{
|
|
756
|
-
color:
|
|
756
|
+
color: o.palette.secondary.main,
|
|
757
757
|
component: "div",
|
|
758
758
|
sx: { p: 32, textAlign: "center", whiteSpace: "normal" },
|
|
759
|
-
variant: "
|
|
759
|
+
variant: "body2",
|
|
760
760
|
children: i ? r.schedule_error_message : r.schedule_complete_message
|
|
761
761
|
}
|
|
762
762
|
) : /* @__PURE__ */ s($, { children: [
|
|
763
|
-
/* @__PURE__ */ s(
|
|
764
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
765
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
763
|
+
/* @__PURE__ */ s(g, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
764
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: r.schedule_month_heading }),
|
|
765
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: r.schedule_amount_heading })
|
|
766
766
|
] }),
|
|
767
|
-
t.dataset.slice(1).map(({ x: c, y: d, payment: p }) => /* @__PURE__ */ e(
|
|
768
|
-
|
|
767
|
+
t.dataset.slice(1).map(({ x: c, y: d, payment: p }) => /* @__PURE__ */ e(g, { bgcolor: o.palette.background.paper, children: /* @__PURE__ */ e(g, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
|
|
768
|
+
g,
|
|
769
769
|
{
|
|
770
770
|
sx: {
|
|
771
|
-
borderBottom: `1px solid ${
|
|
771
|
+
borderBottom: `1px solid ${o.palette.border.light}`,
|
|
772
772
|
flexDirection: "row",
|
|
773
773
|
flexGrow: 1,
|
|
774
774
|
py: 14,
|
|
775
775
|
pr: 24
|
|
776
776
|
},
|
|
777
777
|
children: [
|
|
778
|
-
/* @__PURE__ */ s(
|
|
779
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
780
|
-
/* @__PURE__ */ e(l, { color:
|
|
778
|
+
/* @__PURE__ */ s(g, { flexGrow: 1, children: [
|
|
779
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: Q(c, ee.MONTH_YEAR) }),
|
|
780
|
+
/* @__PURE__ */ e(l, { color: o.palette.secondary.main, variant: "caption", children: r.schedule_month_label })
|
|
781
781
|
] }),
|
|
782
|
-
/* @__PURE__ */ s(
|
|
783
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
782
|
+
/* @__PURE__ */ s(g, { children: [
|
|
783
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: R(d, "0,0.00") }),
|
|
784
784
|
/* @__PURE__ */ e(
|
|
785
785
|
l,
|
|
786
786
|
{
|
|
787
787
|
bold: !0,
|
|
788
|
-
color:
|
|
788
|
+
color: o.palette.success.main,
|
|
789
789
|
textAlign: "end",
|
|
790
|
-
variant: "
|
|
791
|
-
children: `+${
|
|
790
|
+
variant: "tiny",
|
|
791
|
+
children: `+${R(p, "0,0")}`
|
|
792
792
|
}
|
|
793
793
|
)
|
|
794
794
|
] })
|
|
795
795
|
]
|
|
796
796
|
}
|
|
797
797
|
) }) }, String(c))),
|
|
798
|
-
/* @__PURE__ */ e(
|
|
799
|
-
|
|
798
|
+
/* @__PURE__ */ e(g, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
|
|
799
|
+
g,
|
|
800
800
|
{
|
|
801
801
|
sx: {
|
|
802
802
|
alignItems: "center",
|
|
@@ -806,135 +806,135 @@ const Ae = ({
|
|
|
806
806
|
px: 24
|
|
807
807
|
},
|
|
808
808
|
children: [
|
|
809
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "
|
|
810
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
809
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "body1", children: r.schedule_payoff_label }),
|
|
810
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: "-" })
|
|
811
811
|
]
|
|
812
812
|
}
|
|
813
813
|
) })
|
|
814
814
|
] }) });
|
|
815
|
-
}, It =
|
|
816
|
-
const { debts:
|
|
817
|
-
await r({ ...
|
|
815
|
+
}, It = D(Et), Mt = D(({ debt: o }) => {
|
|
816
|
+
const { debts: n } = C(), { updateAccount: r } = re(), { onEvent: t } = B(), [a, i] = x.useState(o.interest_rate ?? 0), c = a < 0, d = async () => {
|
|
817
|
+
await r({ ...o.account, interest_rate: a }), o.interest_rate = a, t(S.DEBTS_SAVE_RATE_ACTION, { account_guid: o.guid });
|
|
818
818
|
}, p = () => {
|
|
819
819
|
setTimeout(() => {
|
|
820
|
-
i(
|
|
820
|
+
i(o.interest_rate ?? 0);
|
|
821
821
|
}, 250);
|
|
822
822
|
};
|
|
823
823
|
return /* @__PURE__ */ e(
|
|
824
|
-
|
|
824
|
+
oe,
|
|
825
825
|
{
|
|
826
826
|
isSaveDisabled: c,
|
|
827
|
-
label: `${
|
|
827
|
+
label: `${n.details_interest_rate} (%)`,
|
|
828
828
|
onCancel: p,
|
|
829
829
|
onSave: d,
|
|
830
|
-
primaryText:
|
|
831
|
-
secondaryText: Ge(Number(
|
|
832
|
-
zeroStateText:
|
|
830
|
+
primaryText: n.details_interest_rate,
|
|
831
|
+
secondaryText: Ge(Number(o.interest_rate) / 100),
|
|
832
|
+
zeroStateText: o.interest_rate ? void 0 : n.add_interest_rate,
|
|
833
833
|
children: /* @__PURE__ */ e(
|
|
834
|
-
|
|
834
|
+
ot,
|
|
835
835
|
{
|
|
836
836
|
error: c,
|
|
837
837
|
fullWidth: !0,
|
|
838
|
-
onChange: (
|
|
838
|
+
onChange: (m) => i(isNaN(parseFloat(m.target.value)) ? 0 : parseFloat(m.target.value)),
|
|
839
839
|
type: "number",
|
|
840
|
-
value:
|
|
840
|
+
value: a
|
|
841
841
|
}
|
|
842
842
|
)
|
|
843
843
|
}
|
|
844
844
|
);
|
|
845
|
-
}),
|
|
846
|
-
const { debts:
|
|
847
|
-
await r({ ...
|
|
845
|
+
}), kt = D(({ debt: o }) => {
|
|
846
|
+
const { debts: n } = C(), { updateAccount: r } = re(), { onEvent: t } = B(), [a, i] = x.useState(o.monthly_payment ?? 0), c = a < 0 || a > 9999999999e-2, d = async () => {
|
|
847
|
+
await r({ ...o.account, minimum_payment: a }), o.monthly_payment = a, t(S.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: o.guid });
|
|
848
848
|
}, p = () => {
|
|
849
849
|
setTimeout(() => {
|
|
850
|
-
i(
|
|
850
|
+
i(o.monthly_payment ?? 0);
|
|
851
851
|
}, 250);
|
|
852
852
|
};
|
|
853
853
|
return /* @__PURE__ */ e(
|
|
854
|
-
|
|
854
|
+
oe,
|
|
855
855
|
{
|
|
856
856
|
isSaveDisabled: c,
|
|
857
|
-
label:
|
|
857
|
+
label: n.details_monthly_payment,
|
|
858
858
|
onCancel: p,
|
|
859
859
|
onSave: d,
|
|
860
|
-
primaryText:
|
|
861
|
-
secondaryText:
|
|
862
|
-
zeroStateText:
|
|
860
|
+
primaryText: n.details_monthly_payment,
|
|
861
|
+
secondaryText: R(o.monthly_payment, "0,0"),
|
|
862
|
+
zeroStateText: o.monthly_payment ? void 0 : n.add_monthly_payment,
|
|
863
863
|
children: /* @__PURE__ */ e(
|
|
864
864
|
se,
|
|
865
865
|
{
|
|
866
|
-
amount:
|
|
866
|
+
amount: a,
|
|
867
867
|
autoFocus: !0,
|
|
868
868
|
error: c,
|
|
869
869
|
fullWidth: !0,
|
|
870
870
|
minAmount: 0,
|
|
871
|
-
setAmount: (
|
|
872
|
-
sx: { ".MuiTypography-
|
|
871
|
+
setAmount: (m) => i(isNaN(Number(m)) ? a : Number(m)),
|
|
872
|
+
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
873
873
|
}
|
|
874
874
|
)
|
|
875
875
|
}
|
|
876
876
|
);
|
|
877
|
-
}),
|
|
878
|
-
const { debts:
|
|
879
|
-
await r({ ...
|
|
877
|
+
}), Nt = D(({ debt: o }) => {
|
|
878
|
+
const { debts: n } = C(), { updateAccount: r } = re(), { onEvent: t } = B(), [a, i] = x.useState(o.original_balance ?? 0), c = a < 0 || a > 9999999999e-2, d = async () => {
|
|
879
|
+
await r({ ...o.account, original_balance: a }), o.original_balance = a, t(S.DEBTS_SAVE_BALANCE_ACTION, { account_guid: o.guid });
|
|
880
880
|
}, p = () => {
|
|
881
881
|
setTimeout(() => {
|
|
882
|
-
i(
|
|
882
|
+
i(o.original_balance ?? 0);
|
|
883
883
|
}, 250);
|
|
884
884
|
};
|
|
885
885
|
return /* @__PURE__ */ e(
|
|
886
|
-
|
|
886
|
+
oe,
|
|
887
887
|
{
|
|
888
888
|
isSaveDisabled: c,
|
|
889
|
-
label:
|
|
889
|
+
label: n.details_original_balance,
|
|
890
890
|
onCancel: p,
|
|
891
891
|
onSave: d,
|
|
892
|
-
primaryText:
|
|
893
|
-
secondaryText:
|
|
894
|
-
zeroStateText:
|
|
892
|
+
primaryText: n.details_original_balance,
|
|
893
|
+
secondaryText: R(o.original_balance, "0,0"),
|
|
894
|
+
zeroStateText: o.original_balance ? void 0 : n.add_original_balance,
|
|
895
895
|
children: /* @__PURE__ */ e(
|
|
896
896
|
se,
|
|
897
897
|
{
|
|
898
|
-
amount:
|
|
898
|
+
amount: a,
|
|
899
899
|
autoFocus: !0,
|
|
900
900
|
error: c,
|
|
901
901
|
fullWidth: !0,
|
|
902
902
|
minAmount: 0,
|
|
903
|
-
setAmount: (
|
|
904
|
-
sx: { ".MuiTypography-
|
|
903
|
+
setAmount: (m) => i(isNaN(Number(m)) ? a : Number(m)),
|
|
904
|
+
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
905
905
|
}
|
|
906
906
|
)
|
|
907
907
|
}
|
|
908
908
|
);
|
|
909
909
|
}), Pt = () => {
|
|
910
|
-
const { onEvent:
|
|
911
|
-
return
|
|
912
|
-
|
|
913
|
-
/* @__PURE__ */ e(et, { goal:
|
|
910
|
+
const { onEvent: o } = B(), { selectedDebtChartData: n } = F();
|
|
911
|
+
return x.useEffect(() => o(S.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(g, { bgcolor: "background.paper", children: [
|
|
912
|
+
n?.goal && /* @__PURE__ */ s($, { children: [
|
|
913
|
+
/* @__PURE__ */ e(et, { goal: n.goal }),
|
|
914
914
|
/* @__PURE__ */ e(G, {}),
|
|
915
|
-
/* @__PURE__ */ e(tt, { goal:
|
|
915
|
+
/* @__PURE__ */ e(tt, { goal: n.goal }),
|
|
916
916
|
/* @__PURE__ */ e(G, {}),
|
|
917
|
-
/* @__PURE__ */ e(rt, { goal:
|
|
917
|
+
/* @__PURE__ */ e(rt, { goal: n.goal }),
|
|
918
918
|
/* @__PURE__ */ e(G, {})
|
|
919
919
|
] }),
|
|
920
|
-
!
|
|
921
|
-
/* @__PURE__ */ e(
|
|
920
|
+
!n?.goal && n?.account && /* @__PURE__ */ s($, { children: [
|
|
921
|
+
/* @__PURE__ */ e(kt, { debt: n }),
|
|
922
922
|
/* @__PURE__ */ e(G, {}),
|
|
923
|
-
/* @__PURE__ */ e(
|
|
923
|
+
/* @__PURE__ */ e(Mt, { debt: n }),
|
|
924
924
|
/* @__PURE__ */ e(G, {}),
|
|
925
|
-
/* @__PURE__ */ e(
|
|
925
|
+
/* @__PURE__ */ e(Nt, { debt: n }),
|
|
926
926
|
/* @__PURE__ */ e(G, {})
|
|
927
927
|
] })
|
|
928
928
|
] });
|
|
929
|
-
},
|
|
930
|
-
const { debts: r } = C(), { showError: t, showCompleted:
|
|
931
|
-
return
|
|
932
|
-
t &&
|
|
933
|
-
}, [t]), !t && !
|
|
934
|
-
/* @__PURE__ */ e(
|
|
929
|
+
}, Rt = D(Pt), Bt = ({ setTabValue: o, sx: n }) => {
|
|
930
|
+
const { debts: r } = C(), { showError: t, showCompleted: a } = F();
|
|
931
|
+
return x.useEffect(() => {
|
|
932
|
+
t && o(1);
|
|
933
|
+
}, [t]), !t && !a ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ s(g, { gap: 16, children: [
|
|
934
|
+
/* @__PURE__ */ e(xe, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
|
935
935
|
ye,
|
|
936
936
|
{
|
|
937
|
-
icon: t ? /* @__PURE__ */ e(
|
|
937
|
+
icon: t ? /* @__PURE__ */ e(nt, { filled: !0 }) : /* @__PURE__ */ e(De, { color: "success", filled: !0 }),
|
|
938
938
|
severity: "error",
|
|
939
939
|
sx: {
|
|
940
940
|
alignItems: "start",
|
|
@@ -947,12 +947,12 @@ const Ae = ({
|
|
|
947
947
|
}
|
|
948
948
|
},
|
|
949
949
|
children: [
|
|
950
|
-
/* @__PURE__ */ e(fe, { sx: { fontWeight: 600, marginTop: 2 }, variant: "
|
|
951
|
-
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "
|
|
950
|
+
/* @__PURE__ */ e(fe, { sx: { fontWeight: 600, marginTop: 2 }, variant: "body1", children: t ? r.status_error_title : r.status_complete_title }),
|
|
951
|
+
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "subtitle2", children: t ? r.status_error_description : r.status_complete_description })
|
|
952
952
|
]
|
|
953
953
|
}
|
|
954
954
|
) }),
|
|
955
|
-
t && /* @__PURE__ */ e(
|
|
955
|
+
t && /* @__PURE__ */ e(xe, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
|
956
956
|
ye,
|
|
957
957
|
{
|
|
958
958
|
icon: /* @__PURE__ */ e($, {}),
|
|
@@ -965,22 +965,22 @@ const Ae = ({
|
|
|
965
965
|
}
|
|
966
966
|
},
|
|
967
967
|
children: [
|
|
968
|
-
/* @__PURE__ */ e(fe, { sx: { fontWeight: 600, marginTop: 2 }, variant: "
|
|
969
|
-
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "
|
|
968
|
+
/* @__PURE__ */ e(fe, { sx: { fontWeight: 600, marginTop: 2 }, variant: "body1", children: r.status_info_title }),
|
|
969
|
+
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "subtitle2", children: r.status_info_description })
|
|
970
970
|
]
|
|
971
971
|
}
|
|
972
972
|
) })
|
|
973
973
|
] });
|
|
974
|
-
}, Ft =
|
|
975
|
-
const { debts:
|
|
974
|
+
}, Ft = D(Bt), Lt = () => {
|
|
975
|
+
const { debts: o } = C(), { showError: n, showCompleted: r } = F(), [t, a] = x.useState(0);
|
|
976
976
|
return /* @__PURE__ */ s($, { children: [
|
|
977
|
-
(
|
|
977
|
+
(n || r) && /* @__PURE__ */ e(Ft, { setTabValue: a, sx: { mt: -24 } }),
|
|
978
978
|
/* @__PURE__ */ s(
|
|
979
979
|
Qe,
|
|
980
980
|
{
|
|
981
|
-
"aria-label":
|
|
981
|
+
"aria-label": o.details_tabs_aria_label,
|
|
982
982
|
centered: !0,
|
|
983
|
-
onChange: (i, c) =>
|
|
983
|
+
onChange: (i, c) => a(c),
|
|
984
984
|
textColor: "primary",
|
|
985
985
|
value: t,
|
|
986
986
|
variant: "fullWidth",
|
|
@@ -990,7 +990,7 @@ const Ae = ({
|
|
|
990
990
|
{
|
|
991
991
|
"aria-controls": "debt-schedule-tabpanel-0",
|
|
992
992
|
id: "debt-schedule-tab-0",
|
|
993
|
-
label:
|
|
993
|
+
label: o.schedule_tab_label
|
|
994
994
|
}
|
|
995
995
|
),
|
|
996
996
|
/* @__PURE__ */ e(
|
|
@@ -998,116 +998,116 @@ const Ae = ({
|
|
|
998
998
|
{
|
|
999
999
|
"aria-controls": "debt-details-tabpanel-1",
|
|
1000
1000
|
id: "debt-details-tab-1",
|
|
1001
|
-
label:
|
|
1001
|
+
label: o.details_tab_label
|
|
1002
1002
|
}
|
|
1003
1003
|
)
|
|
1004
1004
|
]
|
|
1005
1005
|
}
|
|
1006
1006
|
),
|
|
1007
|
-
/* @__PURE__ */ e(
|
|
1008
|
-
/* @__PURE__ */ e(
|
|
1007
|
+
/* @__PURE__ */ e(ge, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(It, {}) }),
|
|
1008
|
+
/* @__PURE__ */ e(ge, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(Rt, {}) })
|
|
1009
1009
|
] });
|
|
1010
|
-
}, $t =
|
|
1011
|
-
const { debts: r } = C(), { showError: t, showCompleted:
|
|
1010
|
+
}, $t = D(Lt), Ot = ({ isOpen: o, onClose: n }) => {
|
|
1011
|
+
const { debts: r } = C(), { showError: t, showCompleted: a } = F(), i = t || a ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(At, {});
|
|
1012
1012
|
return /* @__PURE__ */ e(
|
|
1013
1013
|
ie,
|
|
1014
1014
|
{
|
|
1015
1015
|
ariaLabelClose: r.details_close_aria,
|
|
1016
|
-
isOpen:
|
|
1017
|
-
onClose:
|
|
1016
|
+
isOpen: o,
|
|
1017
|
+
onClose: n,
|
|
1018
1018
|
title: r.details_title,
|
|
1019
|
-
children: /* @__PURE__ */ s(
|
|
1020
|
-
/* @__PURE__ */ e(
|
|
1019
|
+
children: /* @__PURE__ */ s(g, { bgcolor: "background.default", children: [
|
|
1020
|
+
/* @__PURE__ */ e(Ve, { customDetailsChart: i }),
|
|
1021
1021
|
/* @__PURE__ */ e($t, {})
|
|
1022
1022
|
] })
|
|
1023
1023
|
}
|
|
1024
1024
|
);
|
|
1025
|
-
},
|
|
1026
|
-
const { debts:
|
|
1027
|
-
|
|
1028
|
-
user_guid:
|
|
1025
|
+
}, Ht = D(() => {
|
|
1026
|
+
const { debts: o } = C(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = K(), { onEvent: t } = B(), [a, i] = x.useState(n?.extra_payment ?? 0), c = a < 0 || a > 9999999999e-2, d = async () => {
|
|
1027
|
+
n && (await r({ ...n, extra_payment: a }), n.extra_payment = a, t(S.DEBTS_SAVE_PAYDOWN_ACTION, {
|
|
1028
|
+
user_guid: n?.user_guid
|
|
1029
1029
|
}));
|
|
1030
1030
|
}, p = () => {
|
|
1031
1031
|
setTimeout(() => {
|
|
1032
|
-
i(
|
|
1032
|
+
i(n?.extra_payment ?? 0);
|
|
1033
1033
|
}, 250);
|
|
1034
1034
|
};
|
|
1035
1035
|
return /* @__PURE__ */ e(
|
|
1036
|
-
|
|
1036
|
+
oe,
|
|
1037
1037
|
{
|
|
1038
1038
|
isSaveDisabled: c,
|
|
1039
|
-
label:
|
|
1039
|
+
label: o.paydown_drawer_extra_payment,
|
|
1040
1040
|
onCancel: p,
|
|
1041
1041
|
onSave: d,
|
|
1042
|
-
primaryText:
|
|
1043
|
-
secondaryText:
|
|
1044
|
-
zeroStateText:
|
|
1042
|
+
primaryText: o.paydown_drawer_extra_payment,
|
|
1043
|
+
secondaryText: R(n?.extra_payment, "0,0"),
|
|
1044
|
+
zeroStateText: n?.extra_payment ? void 0 : o.add_extra_payment,
|
|
1045
1045
|
children: /* @__PURE__ */ e(
|
|
1046
1046
|
se,
|
|
1047
1047
|
{
|
|
1048
|
-
amount:
|
|
1048
|
+
amount: a,
|
|
1049
1049
|
autoFocus: !0,
|
|
1050
1050
|
error: c,
|
|
1051
1051
|
fullWidth: !0,
|
|
1052
1052
|
minAmount: 0,
|
|
1053
|
-
setAmount: (
|
|
1054
|
-
sx: { ".MuiTypography-
|
|
1053
|
+
setAmount: (m) => i(isNaN(Number(m)) ? a : Number(m)),
|
|
1054
|
+
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
1055
1055
|
}
|
|
1056
1056
|
)
|
|
1057
1057
|
}
|
|
1058
1058
|
);
|
|
1059
1059
|
}), Wt = () => {
|
|
1060
|
-
const { debts:
|
|
1061
|
-
return /* @__PURE__ */ s(
|
|
1062
|
-
/* @__PURE__ */ s(
|
|
1063
|
-
/* @__PURE__ */ s(
|
|
1064
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
1065
|
-
/* @__PURE__ */ e(Ce, { bold: !0, variant: "
|
|
1066
|
-
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "
|
|
1060
|
+
const { debts: o } = C(), { totalMonthlyPayments: n } = te(), { monthlyCashFlowProfile: r } = K(), t = n + Number(r?.extra_payment);
|
|
1061
|
+
return /* @__PURE__ */ s(g, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
1062
|
+
/* @__PURE__ */ s(g, { p: 24, children: [
|
|
1063
|
+
/* @__PURE__ */ s(g, { alignItems: "center", gap: 4, mb: 24, children: [
|
|
1064
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: o.paydown_drawer_mimimum_label }),
|
|
1065
|
+
/* @__PURE__ */ e(Ce, { bold: !0, variant: "h1", children: R(n, "0,0") }),
|
|
1066
|
+
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "body2", width: 208, children: o.paydown_drawer_minimum_info })
|
|
1067
1067
|
] }),
|
|
1068
|
-
/* @__PURE__ */ s(
|
|
1069
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
1070
|
-
/* @__PURE__ */ e(l, { truncate: !1, variant: "
|
|
1068
|
+
/* @__PURE__ */ s(g, { children: [
|
|
1069
|
+
/* @__PURE__ */ e(l, { variant: "h3", children: o.paydown_drawer_subtitle }),
|
|
1070
|
+
/* @__PURE__ */ e(l, { truncate: !1, variant: "subtitle2", children: o.paydown_drawer_description })
|
|
1071
1071
|
] })
|
|
1072
1072
|
] }),
|
|
1073
|
-
/* @__PURE__ */ e(
|
|
1074
|
-
/* @__PURE__ */ e(
|
|
1075
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
1076
|
-
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "
|
|
1073
|
+
/* @__PURE__ */ e(g, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Ht, {}) }),
|
|
1074
|
+
/* @__PURE__ */ e(g, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(g, { gap: 4, children: [
|
|
1075
|
+
/* @__PURE__ */ e(l, { variant: "body2", children: o.paydown_drawer_total_payment }),
|
|
1076
|
+
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "body1", children: R(t, "0,0") })
|
|
1077
1077
|
] }) })
|
|
1078
1078
|
] });
|
|
1079
|
-
}, Gt =
|
|
1079
|
+
}, Gt = D(Wt), jt = ({ isOpen: o, onClose: n }) => {
|
|
1080
1080
|
const { debts: r } = C();
|
|
1081
1081
|
return /* @__PURE__ */ e(
|
|
1082
1082
|
ie,
|
|
1083
1083
|
{
|
|
1084
1084
|
ariaLabelClose: r.paydown_drawer_close_aria,
|
|
1085
|
-
isOpen:
|
|
1086
|
-
onClose:
|
|
1085
|
+
isOpen: o,
|
|
1086
|
+
onClose: n,
|
|
1087
1087
|
title: r.paydown_drawer_title,
|
|
1088
1088
|
children: /* @__PURE__ */ e(Gt, {})
|
|
1089
1089
|
}
|
|
1090
1090
|
);
|
|
1091
1091
|
};
|
|
1092
|
-
function zt(
|
|
1092
|
+
function zt(o, n) {
|
|
1093
1093
|
const r = (t) => {
|
|
1094
1094
|
if (typeof t == "number") return t;
|
|
1095
1095
|
if (t === "!" || t === "✓") return 1 / 0;
|
|
1096
1096
|
throw new Error("Unsupported value");
|
|
1097
1097
|
};
|
|
1098
|
-
return r(
|
|
1098
|
+
return r(o) - r(n);
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1101
|
-
return
|
|
1100
|
+
function Yt(o) {
|
|
1101
|
+
return o.is_paid_off ? "✓" : o.priority === void 0 || o.is_impossible ? "!" : o.priority;
|
|
1102
1102
|
}
|
|
1103
|
-
const
|
|
1104
|
-
const
|
|
1103
|
+
const Vt = (o) => {
|
|
1104
|
+
const n = {
|
|
1105
1105
|
text: "#121417",
|
|
1106
1106
|
background: "#FFB252"
|
|
1107
1107
|
};
|
|
1108
|
-
return
|
|
1109
|
-
},
|
|
1110
|
-
const
|
|
1108
|
+
return o === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), o === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
|
|
1109
|
+
}, Kt = (o) => {
|
|
1110
|
+
const n = String(o.formattedValue), r = Vt(n);
|
|
1111
1111
|
return /* @__PURE__ */ e(
|
|
1112
1112
|
le,
|
|
1113
1113
|
{
|
|
@@ -1122,39 +1122,39 @@ const Yt = (a) => {
|
|
|
1122
1122
|
backgroundColor: r.background,
|
|
1123
1123
|
marginLeft: "10px"
|
|
1124
1124
|
},
|
|
1125
|
-
children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "
|
|
1125
|
+
children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "body2", children: n })
|
|
1126
1126
|
}
|
|
1127
1127
|
);
|
|
1128
|
-
},
|
|
1129
|
-
const
|
|
1130
|
-
return /* @__PURE__ */ s(
|
|
1128
|
+
}, Ut = (o) => {
|
|
1129
|
+
const n = o.row.account, r = it[n.account_type];
|
|
1130
|
+
return /* @__PURE__ */ s(g, { alignItems: "center", flexDirection: "row", children: [
|
|
1131
1131
|
/* @__PURE__ */ e(
|
|
1132
1132
|
Le,
|
|
1133
1133
|
{
|
|
1134
|
-
alt: `${
|
|
1135
|
-
institutionGuid:
|
|
1134
|
+
alt: `${n.institutionName}`,
|
|
1135
|
+
institutionGuid: n.institution_guid || ""
|
|
1136
1136
|
}
|
|
1137
1137
|
),
|
|
1138
|
-
/* @__PURE__ */ s(
|
|
1139
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
1140
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
1138
|
+
/* @__PURE__ */ s(g, { ml: 12, children: [
|
|
1139
|
+
/* @__PURE__ */ e(l, { variant: "body2", children: n.name }),
|
|
1140
|
+
/* @__PURE__ */ e(l, { variant: "caption", children: r })
|
|
1141
1141
|
] })
|
|
1142
1142
|
] });
|
|
1143
|
-
},
|
|
1144
|
-
sx:
|
|
1145
|
-
debts:
|
|
1143
|
+
}, qt = ({
|
|
1144
|
+
sx: o = {},
|
|
1145
|
+
debts: n,
|
|
1146
1146
|
hoveredDebtGuid: r,
|
|
1147
1147
|
onHoverRow: t,
|
|
1148
|
-
onClickRow:
|
|
1148
|
+
onClickRow: a
|
|
1149
1149
|
}) => {
|
|
1150
|
-
const i =
|
|
1150
|
+
const i = V(), { onEvent: c } = B(), { isMobile: d } = U(), { debts: p, common: m } = C(), [h, w] = x.useState([
|
|
1151
1151
|
{ field: "priority", sort: "asc" }
|
|
1152
1152
|
]), b = [
|
|
1153
1153
|
{
|
|
1154
1154
|
field: "priority",
|
|
1155
1155
|
headerName: p.table_column_priority,
|
|
1156
1156
|
renderHeader: j,
|
|
1157
|
-
renderCell:
|
|
1157
|
+
renderCell: Kt,
|
|
1158
1158
|
sortComparator: zt,
|
|
1159
1159
|
sortable: !0,
|
|
1160
1160
|
hideSortIcons: !0,
|
|
@@ -1168,7 +1168,7 @@ const Yt = (a) => {
|
|
|
1168
1168
|
field: "account",
|
|
1169
1169
|
headerName: p.table_column_account,
|
|
1170
1170
|
renderHeader: j,
|
|
1171
|
-
renderCell:
|
|
1171
|
+
renderCell: Ut,
|
|
1172
1172
|
sortable: !1,
|
|
1173
1173
|
type: "custom",
|
|
1174
1174
|
align: "left",
|
|
@@ -1180,7 +1180,7 @@ const Yt = (a) => {
|
|
|
1180
1180
|
field: "balance",
|
|
1181
1181
|
headerName: p.table_column_balance,
|
|
1182
1182
|
renderHeader: j,
|
|
1183
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "
|
|
1183
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "body2", children: R(y.value, "0,0") }),
|
|
1184
1184
|
sortable: !0,
|
|
1185
1185
|
hideSortIcons: d,
|
|
1186
1186
|
type: "number",
|
|
@@ -1193,7 +1193,7 @@ const Yt = (a) => {
|
|
|
1193
1193
|
field: "interest_rate",
|
|
1194
1194
|
headerName: p.table_column_interest_rate,
|
|
1195
1195
|
renderHeader: j,
|
|
1196
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "
|
|
1196
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "body2", children: isNaN(y.value) ? "---" : `${Number(y.value).toFixed(2)}%` }),
|
|
1197
1197
|
sortable: !0,
|
|
1198
1198
|
hideSortIcons: d,
|
|
1199
1199
|
type: "number",
|
|
@@ -1206,7 +1206,7 @@ const Yt = (a) => {
|
|
|
1206
1206
|
field: "projected_payoff_date",
|
|
1207
1207
|
headerName: p.table_column_payoff_date,
|
|
1208
1208
|
renderHeader: j,
|
|
1209
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "
|
|
1209
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "body2", children: y.value ? Q(y.value, ee.MONTH_SHORT_YEAR) : "---" }),
|
|
1210
1210
|
sortable: !0,
|
|
1211
1211
|
hideSortIcons: d,
|
|
1212
1212
|
type: "number",
|
|
@@ -1219,7 +1219,7 @@ const Yt = (a) => {
|
|
|
1219
1219
|
field: "monthly_payment",
|
|
1220
1220
|
headerName: p.table_column_amount_due,
|
|
1221
1221
|
renderHeader: j,
|
|
1222
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "
|
|
1222
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "body2", children: typeof y.value == "number" ? R(y.value, "0,0") : "---" }),
|
|
1223
1223
|
sortable: !0,
|
|
1224
1224
|
hideSortIcons: d,
|
|
1225
1225
|
type: "number",
|
|
@@ -1228,13 +1228,13 @@ const Yt = (a) => {
|
|
|
1228
1228
|
minWidth: 122,
|
|
1229
1229
|
flex: 0.6
|
|
1230
1230
|
}
|
|
1231
|
-
],
|
|
1231
|
+
], M = [
|
|
1232
1232
|
...b.slice(0, 3),
|
|
1233
1233
|
{
|
|
1234
1234
|
field: "chevron",
|
|
1235
1235
|
headerClassName: "chevron-header",
|
|
1236
1236
|
headerName: "",
|
|
1237
|
-
renderCell: () => /* @__PURE__ */ e(_, { "aria-label":
|
|
1237
|
+
renderCell: () => /* @__PURE__ */ e(_, { "aria-label": m.see_details, role: "button", children: /* @__PURE__ */ e(ae, { name: "chevron_right" }) }),
|
|
1238
1238
|
sortable: !1,
|
|
1239
1239
|
hideSortIcons: !0,
|
|
1240
1240
|
type: "custom",
|
|
@@ -1242,18 +1242,18 @@ const Yt = (a) => {
|
|
|
1242
1242
|
headerAlign: "right",
|
|
1243
1243
|
width: 20
|
|
1244
1244
|
}
|
|
1245
|
-
],
|
|
1245
|
+
], k = x.useMemo(() => n.map((y, u) => ({
|
|
1246
1246
|
...y,
|
|
1247
1247
|
id: u,
|
|
1248
|
-
priority:
|
|
1249
|
-
})), [
|
|
1250
|
-
const A = y.target.closest("[data-id]")?.getAttribute("data-id"),
|
|
1251
|
-
t?.(
|
|
1252
|
-
},
|
|
1248
|
+
priority: Yt(y)
|
|
1249
|
+
})), [n]), I = (y) => {
|
|
1250
|
+
const A = y.target.closest("[data-id]")?.getAttribute("data-id"), N = n[Number(A)];
|
|
1251
|
+
t?.(N?.guid ?? "");
|
|
1252
|
+
}, v = (y) => {
|
|
1253
1253
|
d || I(y);
|
|
1254
1254
|
}, T = (y) => {
|
|
1255
1255
|
d && I(y);
|
|
1256
|
-
},
|
|
1256
|
+
}, O = (y) => k.find((u) => u.guid === y)?.id;
|
|
1257
1257
|
return /* @__PURE__ */ e(
|
|
1258
1258
|
le,
|
|
1259
1259
|
{
|
|
@@ -1264,37 +1264,37 @@ const Yt = (a) => {
|
|
|
1264
1264
|
overflowX: "auto",
|
|
1265
1265
|
overflowY: "visible",
|
|
1266
1266
|
boxShadow: "none",
|
|
1267
|
-
...
|
|
1267
|
+
...o
|
|
1268
1268
|
},
|
|
1269
1269
|
children: /* @__PURE__ */ e(
|
|
1270
|
-
|
|
1270
|
+
at,
|
|
1271
1271
|
{
|
|
1272
|
-
columns: d ?
|
|
1272
|
+
columns: d ? M : b,
|
|
1273
1273
|
disableColumnFilter: !0,
|
|
1274
1274
|
disableColumnMenu: !0,
|
|
1275
1275
|
hideFooter: !0,
|
|
1276
|
-
initialState: { sorting: { sortModel:
|
|
1276
|
+
initialState: { sorting: { sortModel: h } },
|
|
1277
1277
|
onRowClick: (y) => {
|
|
1278
|
-
|
|
1278
|
+
a(), c(S.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
|
|
1279
1279
|
},
|
|
1280
1280
|
onSortModelChange: (y) => {
|
|
1281
|
-
w(y), c(
|
|
1281
|
+
w(y), c(S.DEBTS_CLICK_TABLE_SORT);
|
|
1282
1282
|
},
|
|
1283
|
-
rows:
|
|
1283
|
+
rows: k,
|
|
1284
1284
|
slotProps: {
|
|
1285
1285
|
baseIconButton: { color: "secondary", sx: { ml: 8 } },
|
|
1286
1286
|
row: {
|
|
1287
|
-
onMouseEnter:
|
|
1287
|
+
onMouseEnter: v,
|
|
1288
1288
|
onMouseLeave: () => !d && t?.(""),
|
|
1289
1289
|
onTouchStart: T,
|
|
1290
1290
|
onClick: d ? T : void 0
|
|
1291
1291
|
}
|
|
1292
1292
|
},
|
|
1293
|
-
sortModel:
|
|
1293
|
+
sortModel: h,
|
|
1294
1294
|
sortingOrder: ["asc", "desc"],
|
|
1295
1295
|
sx: {
|
|
1296
1296
|
"& .chevron-header": { display: "none" },
|
|
1297
|
-
[`& .MuiDataGrid-row[data-id="${
|
|
1297
|
+
[`& .MuiDataGrid-row[data-id="${O(r)}"]`]: {
|
|
1298
1298
|
backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
|
|
1299
1299
|
filter: "brightness(98%)"
|
|
1300
1300
|
}
|
|
@@ -1303,25 +1303,25 @@ const Yt = (a) => {
|
|
|
1303
1303
|
)
|
|
1304
1304
|
}
|
|
1305
1305
|
);
|
|
1306
|
-
},
|
|
1307
|
-
buttonText:
|
|
1308
|
-
disabled:
|
|
1306
|
+
}, Xt = ({
|
|
1307
|
+
buttonText: o,
|
|
1308
|
+
disabled: n,
|
|
1309
1309
|
isOpen: r,
|
|
1310
1310
|
onClick: t
|
|
1311
1311
|
}) => {
|
|
1312
|
-
const { isDesktop:
|
|
1313
|
-
return
|
|
1314
|
-
|
|
1312
|
+
const { isDesktop: a, isTablet: i } = U(), c = r ? "unfold_less" : "unfold_more";
|
|
1313
|
+
return a || i ? /* @__PURE__ */ e(
|
|
1314
|
+
Se,
|
|
1315
1315
|
{
|
|
1316
1316
|
"aria-controls": "prioritize-debts",
|
|
1317
1317
|
"aria-describedby": "prioritize-debts",
|
|
1318
1318
|
"aria-haspopup": !0,
|
|
1319
1319
|
"aria-label": "prioritize-debts",
|
|
1320
|
-
disabled:
|
|
1320
|
+
disabled: n,
|
|
1321
1321
|
onClick: t,
|
|
1322
|
-
startIcon: /* @__PURE__ */ e(
|
|
1322
|
+
startIcon: /* @__PURE__ */ e(ae, { name: c }),
|
|
1323
1323
|
sx: { justifyContent: "start", minWidth: 214, mx: 4 },
|
|
1324
|
-
children:
|
|
1324
|
+
children: o
|
|
1325
1325
|
}
|
|
1326
1326
|
) : /* @__PURE__ */ e(
|
|
1327
1327
|
lt,
|
|
@@ -1330,13 +1330,13 @@ const Yt = (a) => {
|
|
|
1330
1330
|
"aria-describedby": "prioritize-debts",
|
|
1331
1331
|
"aria-haspopup": !0,
|
|
1332
1332
|
"aria-label": "prioritize-debts",
|
|
1333
|
-
disabled:
|
|
1333
|
+
disabled: n,
|
|
1334
1334
|
onClick: t,
|
|
1335
|
-
children: /* @__PURE__ */ e(
|
|
1335
|
+
children: /* @__PURE__ */ e(ae, { name: c })
|
|
1336
1336
|
}
|
|
1337
1337
|
);
|
|
1338
|
-
}, Zt =
|
|
1339
|
-
const { onEvent: r } =
|
|
1338
|
+
}, Zt = D(({ buttonEl: o, onClose: n }) => {
|
|
1339
|
+
const { onEvent: r } = B(), { debts: t } = C(), { selectedDebtPriority: a, setSelectedDebtPriority: i } = F(), c = !!o, d = [
|
|
1340
1340
|
{
|
|
1341
1341
|
priority: P.FASTEST_PAYOFF_FIRST,
|
|
1342
1342
|
text: t.priority_sort_fastest_payoff
|
|
@@ -1353,31 +1353,31 @@ const Yt = (a) => {
|
|
|
1353
1353
|
priority: P.HIGHEST_BALANCE,
|
|
1354
1354
|
text: t.priority_sort_highest_balance
|
|
1355
1355
|
}
|
|
1356
|
-
], p = (
|
|
1357
|
-
i(
|
|
1356
|
+
], p = (m) => {
|
|
1357
|
+
i(m), r(S.DEBTS_CLICK_PRIORITY, { debts_priority: m });
|
|
1358
1358
|
};
|
|
1359
1359
|
return /* @__PURE__ */ e(
|
|
1360
1360
|
ct,
|
|
1361
1361
|
{
|
|
1362
|
-
anchorEl:
|
|
1362
|
+
anchorEl: o,
|
|
1363
1363
|
anchorOrigin: {
|
|
1364
1364
|
vertical: "bottom",
|
|
1365
1365
|
horizontal: "left"
|
|
1366
1366
|
},
|
|
1367
1367
|
id: "prioritize-debts",
|
|
1368
|
-
onClose:
|
|
1368
|
+
onClose: n,
|
|
1369
1369
|
open: c,
|
|
1370
1370
|
transformOrigin: {
|
|
1371
1371
|
vertical: "top",
|
|
1372
1372
|
horizontal: "left"
|
|
1373
1373
|
},
|
|
1374
|
-
children: /* @__PURE__ */ e(
|
|
1374
|
+
children: /* @__PURE__ */ e(ve, { children: d.map(({ priority: m, text: h }) => /* @__PURE__ */ s(
|
|
1375
1375
|
st,
|
|
1376
1376
|
{
|
|
1377
|
-
onClick: () => p(
|
|
1377
|
+
onClick: () => p(m),
|
|
1378
1378
|
sx: {
|
|
1379
|
-
bgcolor:
|
|
1380
|
-
color:
|
|
1379
|
+
bgcolor: a === m ? "primary.main" : void 0,
|
|
1380
|
+
color: a === m ? "#fff" : void 0,
|
|
1381
1381
|
justifyContent: "space-between",
|
|
1382
1382
|
minHeight: 44,
|
|
1383
1383
|
minWidth: 268,
|
|
@@ -1390,20 +1390,20 @@ const Yt = (a) => {
|
|
|
1390
1390
|
}
|
|
1391
1391
|
},
|
|
1392
1392
|
children: [
|
|
1393
|
-
/* @__PURE__ */ e(l, { color: "inherit", variant: "
|
|
1394
|
-
|
|
1393
|
+
/* @__PURE__ */ e(l, { color: "inherit", variant: "body2", children: h }),
|
|
1394
|
+
a === m && /* @__PURE__ */ e(De, { color: "inherit", filled: !0, fontSize: "small" })
|
|
1395
1395
|
]
|
|
1396
1396
|
},
|
|
1397
|
-
|
|
1397
|
+
m
|
|
1398
1398
|
)) })
|
|
1399
1399
|
}
|
|
1400
1400
|
);
|
|
1401
|
-
}), Jt =
|
|
1402
|
-
const { onEvent:
|
|
1403
|
-
i(
|
|
1401
|
+
}), Jt = D(({ disabled: o }) => {
|
|
1402
|
+
const { onEvent: n } = B(), { debts: r } = C(), { selectedDebtPriority: t } = F(), [a, i] = x.useState(null), c = (h) => {
|
|
1403
|
+
i(h.currentTarget), n(S.DEBTS_CLICK_PRIORITIZE);
|
|
1404
1404
|
}, d = () => {
|
|
1405
1405
|
i(null);
|
|
1406
|
-
}, p = !!
|
|
1406
|
+
}, p = !!a, m = x.useMemo(() => ({
|
|
1407
1407
|
[P.FASTEST_PAYOFF_FIRST]: r.priority_sort_fastest_payoff,
|
|
1408
1408
|
[P.HIGHEST_INTEREST]: r.priority_sort_highest_interest,
|
|
1409
1409
|
[P.HIGHEST_BALANCE]: r.priority_sort_highest_balance,
|
|
@@ -1411,130 +1411,130 @@ const Yt = (a) => {
|
|
|
1411
1411
|
})[t] ?? r.priority_sort_lowest_balance, [t]);
|
|
1412
1412
|
return /* @__PURE__ */ s(_, { children: [
|
|
1413
1413
|
/* @__PURE__ */ e(
|
|
1414
|
-
|
|
1414
|
+
Xt,
|
|
1415
1415
|
{
|
|
1416
|
-
buttonText:
|
|
1417
|
-
disabled:
|
|
1416
|
+
buttonText: m,
|
|
1417
|
+
disabled: o,
|
|
1418
1418
|
isOpen: p,
|
|
1419
1419
|
onClick: c
|
|
1420
1420
|
}
|
|
1421
1421
|
),
|
|
1422
|
-
/* @__PURE__ */ e(Zt, { buttonEl:
|
|
1422
|
+
/* @__PURE__ */ e(Zt, { buttonEl: a, onClose: d })
|
|
1423
1423
|
] });
|
|
1424
|
-
}), Qt = (
|
|
1425
|
-
const t =
|
|
1426
|
-
Te(t,
|
|
1427
|
-
const
|
|
1424
|
+
}), Qt = (o, n, r = 0) => {
|
|
1425
|
+
const t = o.map((p) => ({ ...p }));
|
|
1426
|
+
Te(t, n);
|
|
1427
|
+
const a = /* @__PURE__ */ new Date(), i = [];
|
|
1428
1428
|
let c = 0, d = 1;
|
|
1429
1429
|
for (const p of t)
|
|
1430
1430
|
i.push({
|
|
1431
1431
|
...p,
|
|
1432
1432
|
// Start with the initial balance
|
|
1433
|
-
dataset: [{ x: new Date(
|
|
1433
|
+
dataset: [{ x: new Date(a), y: p.balance }]
|
|
1434
1434
|
});
|
|
1435
1435
|
for (; t.some((p) => p.balance >= 0.01 && !p.is_impossible); ) {
|
|
1436
|
-
let p = !1,
|
|
1436
|
+
let p = !1, m = !1, h = !1;
|
|
1437
1437
|
for (const [w, b] of t.entries()) {
|
|
1438
1438
|
if (b.balance <= 0.01) continue;
|
|
1439
|
-
const
|
|
1440
|
-
let
|
|
1441
|
-
!
|
|
1442
|
-
const u = Math.min(b.balance,
|
|
1443
|
-
if (u <=
|
|
1444
|
-
b.is_impossible = !0, i[w].is_impossible = !0, i[w].priority = void 0,
|
|
1439
|
+
const M = i[w].dataset, I = (b.interest_rate ?? 0) / 100 / 12, v = b.balance * I, T = b.monthly_payment ?? 0;
|
|
1440
|
+
let O = T, y = 0;
|
|
1441
|
+
!h && r > 0 && (O += r, h = !0), !m && c > 0 && (y = c, m = !0), b.balance += v;
|
|
1442
|
+
const u = Math.min(b.balance, O + y);
|
|
1443
|
+
if (u <= v) {
|
|
1444
|
+
b.is_impossible = !0, i[w].is_impossible = !0, i[w].priority = void 0, M.push({ x: new Date(a), y: b.balance });
|
|
1445
1445
|
continue;
|
|
1446
1446
|
}
|
|
1447
|
-
b.balance -= u, b.balance = b.balance < 0.01 ? 0 : b.balance,
|
|
1448
|
-
x: new Date(
|
|
1447
|
+
b.balance -= u, b.balance = b.balance < 0.01 ? 0 : b.balance, M.push({
|
|
1448
|
+
x: new Date(a),
|
|
1449
1449
|
y: Math.max(0, b.balance),
|
|
1450
1450
|
payment: u,
|
|
1451
1451
|
extra: y
|
|
1452
|
-
}), b.balance <= 0 && (c += T, i[w].projected_payoff_date = new Date(
|
|
1452
|
+
}), b.balance <= 0 && (c += T, i[w].projected_payoff_date = new Date(a)), u > 0 && (p = !0);
|
|
1453
1453
|
}
|
|
1454
|
-
p &&
|
|
1454
|
+
p && a.setMonth(a.getMonth() + 1);
|
|
1455
1455
|
}
|
|
1456
1456
|
return i.forEach((p) => {
|
|
1457
1457
|
(p.interest_rate === void 0 || p.monthly_payment === void 0) && (p.projected_payoff_date = void 0);
|
|
1458
1458
|
}), i.forEach((p) => {
|
|
1459
1459
|
p.priority = !p.is_paid_off && !p.is_impossible ? d++ : void 0;
|
|
1460
1460
|
}), i;
|
|
1461
|
-
}, er = (
|
|
1462
|
-
description:
|
|
1463
|
-
header:
|
|
1464
|
-
onClickHandler:
|
|
1465
|
-
primaryButton:
|
|
1466
|
-
}), tr =
|
|
1467
|
-
const { debts: r } = C(), { isDesktop: t } =
|
|
1461
|
+
}, er = (o, n, r) => ({
|
|
1462
|
+
description: n ? o.empty_state_description : o.empty_state_description_no_aggregation,
|
|
1463
|
+
header: n ? o.empty_state_header : o.empty_state_header_no_aggregation,
|
|
1464
|
+
onClickHandler: n ? r : void 0,
|
|
1465
|
+
primaryButton: n ? o.connect_accounts : void 0
|
|
1466
|
+
}), tr = D(({ disabled: o, onClick: n }) => {
|
|
1467
|
+
const { debts: r } = C(), { isDesktop: t } = U(), { totalMonthlyPayments: a } = te(), { monthlyCashFlowProfile: i } = K(), c = a + Number(i?.extra_payment), d = t ? r.paydown_button_long : r.paydown_button_short;
|
|
1468
1468
|
return /* @__PURE__ */ e(
|
|
1469
|
-
|
|
1469
|
+
Se,
|
|
1470
1470
|
{
|
|
1471
1471
|
"aria-controls": "extra-paydown",
|
|
1472
1472
|
"aria-describedby": "extra-paydown",
|
|
1473
1473
|
"aria-haspopup": !0,
|
|
1474
1474
|
"aria-label": "extra-paydown",
|
|
1475
|
-
disabled:
|
|
1476
|
-
onClick:
|
|
1475
|
+
disabled: o,
|
|
1476
|
+
onClick: n,
|
|
1477
1477
|
sx: { justifyContent: "start", minWidth: 100, mx: 4 },
|
|
1478
|
-
children: E(d,
|
|
1478
|
+
children: E(d, R(c, "0,0"))
|
|
1479
1479
|
}
|
|
1480
1480
|
);
|
|
1481
|
-
}), rr = ({ onBackClick:
|
|
1482
|
-
const { isDesktop: r, isMobile: t } =
|
|
1481
|
+
}), rr = ({ onBackClick: o, sx: n }) => {
|
|
1482
|
+
const { isDesktop: r, isMobile: t } = U(), { connect: a, debts: i } = C(), { onEvent: c } = B(), {
|
|
1483
1483
|
config: { show_connections_widget_in_master: d }
|
|
1484
|
-
} = ze(), { isInitialized: p } =
|
|
1484
|
+
} = ze(), { isInitialized: p } = Ye(), { setSelectedAccount: m } = Ke(), { selectedDebtPriority: h, setSelectedDebtChartData: w } = F(), {
|
|
1485
1485
|
isAccountDataLoaded: b,
|
|
1486
|
-
loadAccountData:
|
|
1487
|
-
detailedAccounts:
|
|
1486
|
+
loadAccountData: M,
|
|
1487
|
+
detailedAccounts: k,
|
|
1488
1488
|
visibleDebtAccounts: I
|
|
1489
|
-
} = re(), { isAllGoalDataLoaded:
|
|
1489
|
+
} = re(), { isAllGoalDataLoaded: v, loadGoalData: T, monthlyCashFlowProfile: O } = K(), { debts: y } = te(), [u, f] = x.useState(!1), [A, N] = x.useState(!1), [L, z] = x.useState(!1), [q, Ee] = x.useState(""), [Ie, ce] = x.useState(!1);
|
|
1490
1490
|
pt({
|
|
1491
1491
|
widgetName: "DebtsWidget",
|
|
1492
|
-
isLoaded:
|
|
1492
|
+
isLoaded: v
|
|
1493
1493
|
});
|
|
1494
|
-
const
|
|
1495
|
-
const
|
|
1496
|
-
return Qt(y,
|
|
1497
|
-
}, [y,
|
|
1498
|
-
|
|
1499
|
-
b ||
|
|
1500
|
-
}, []),
|
|
1494
|
+
const X = x.useMemo(() => {
|
|
1495
|
+
const H = O?.extra_payment ?? 0;
|
|
1496
|
+
return Qt(y, h, H);
|
|
1497
|
+
}, [y, h, O]);
|
|
1498
|
+
x.useEffect(() => {
|
|
1499
|
+
b || M().finally(), c(S.DEBTS_VIEW);
|
|
1500
|
+
}, []), x.useEffect(() => {
|
|
1501
1501
|
p && T().finally();
|
|
1502
1502
|
}, [p]);
|
|
1503
|
-
const de = (
|
|
1504
|
-
const
|
|
1505
|
-
|
|
1506
|
-
},
|
|
1507
|
-
z(!0), c(
|
|
1508
|
-
},
|
|
1509
|
-
|
|
1503
|
+
const de = (H) => Ee(H), pe = () => {
|
|
1504
|
+
const H = I.find((ne) => ne.guid === q), he = X.find((ne) => ne.guid === q);
|
|
1505
|
+
H && m(H), he && w(he), f(!0);
|
|
1506
|
+
}, Me = () => c(S.DEBTS_CLICK_FILTER), ke = () => {
|
|
1507
|
+
z(!0), c(S.DEBTS_CLICK_SNOWBALL_CTA);
|
|
1508
|
+
}, Ne = () => {
|
|
1509
|
+
N(!0), c(S.DEBTS_CLICK_PAYDOWN);
|
|
1510
1510
|
};
|
|
1511
|
-
if (!p || !
|
|
1512
|
-
return /* @__PURE__ */ e(
|
|
1513
|
-
const Pe =
|
|
1511
|
+
if (!p || !v)
|
|
1512
|
+
return /* @__PURE__ */ e(ht, {});
|
|
1513
|
+
const Pe = k.length === 0, Re = I.length === 0, Be = y.length === 0, Z = Pe || Re || Be, J = er(
|
|
1514
1514
|
i,
|
|
1515
1515
|
d,
|
|
1516
1516
|
() => ce(!0)
|
|
1517
1517
|
);
|
|
1518
1518
|
return /* @__PURE__ */ s(
|
|
1519
|
-
|
|
1519
|
+
mt,
|
|
1520
1520
|
{
|
|
1521
1521
|
actions: [
|
|
1522
1522
|
/* @__PURE__ */ e(Jt, { disabled: Z }, "prioritize-debts"),
|
|
1523
|
-
/* @__PURE__ */ e(tr, { disabled: Z, onClick:
|
|
1523
|
+
/* @__PURE__ */ e(tr, { disabled: Z, onClick: Ne }, "extra-paydown")
|
|
1524
1524
|
],
|
|
1525
1525
|
allowedAccountTypes: [
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1526
|
+
Y.CREDIT_CARD,
|
|
1527
|
+
Y.LOAN,
|
|
1528
|
+
Y.MORTGAGE,
|
|
1529
|
+
Y.LINE_OF_CREDIT,
|
|
1530
|
+
Y.CHECKING_LINE_OF_CREDIT
|
|
1531
1531
|
],
|
|
1532
|
-
onAccountsFilterClick:
|
|
1533
|
-
onBackClick:
|
|
1534
|
-
sx:
|
|
1532
|
+
onAccountsFilterClick: Me,
|
|
1533
|
+
onBackClick: o,
|
|
1534
|
+
sx: n,
|
|
1535
1535
|
title: i.title,
|
|
1536
1536
|
children: [
|
|
1537
|
-
/* @__PURE__ */ s(
|
|
1537
|
+
/* @__PURE__ */ s(g, { sx: { pt: 48, px: r ? "48px" : "24px" }, children: [
|
|
1538
1538
|
Z && /* @__PURE__ */ e(
|
|
1539
1539
|
ut,
|
|
1540
1540
|
{
|
|
@@ -1548,7 +1548,7 @@ const Yt = (a) => {
|
|
|
1548
1548
|
),
|
|
1549
1549
|
!Z && /* @__PURE__ */ s($, { children: [
|
|
1550
1550
|
/* @__PURE__ */ s(
|
|
1551
|
-
|
|
1551
|
+
g,
|
|
1552
1552
|
{
|
|
1553
1553
|
sx: {
|
|
1554
1554
|
alignItems: t ? "flex-start" : "flex-end",
|
|
@@ -1559,9 +1559,9 @@ const Yt = (a) => {
|
|
|
1559
1559
|
/* @__PURE__ */ e(
|
|
1560
1560
|
Ae,
|
|
1561
1561
|
{
|
|
1562
|
-
debts:
|
|
1562
|
+
debts: X,
|
|
1563
1563
|
height: t ? 250 : void 0,
|
|
1564
|
-
hoveredDebtGuid:
|
|
1564
|
+
hoveredDebtGuid: q,
|
|
1565
1565
|
onClickArea: pe,
|
|
1566
1566
|
onHoverArea: de,
|
|
1567
1567
|
sx: { mr: t ? "4px" : "-48px" }
|
|
@@ -1570,19 +1570,19 @@ const Yt = (a) => {
|
|
|
1570
1570
|
/* @__PURE__ */ e(
|
|
1571
1571
|
wt,
|
|
1572
1572
|
{
|
|
1573
|
-
debts:
|
|
1574
|
-
onClickCta:
|
|
1573
|
+
debts: X,
|
|
1574
|
+
onClickCta: ke,
|
|
1575
1575
|
sx: { mb: t ? "0px" : "64px" }
|
|
1576
1576
|
}
|
|
1577
1577
|
)
|
|
1578
1578
|
]
|
|
1579
1579
|
}
|
|
1580
1580
|
),
|
|
1581
|
-
/* @__PURE__ */ e(
|
|
1582
|
-
|
|
1581
|
+
/* @__PURE__ */ e(g, { sx: { mx: t ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1582
|
+
qt,
|
|
1583
1583
|
{
|
|
1584
|
-
debts:
|
|
1585
|
-
hoveredDebtGuid:
|
|
1584
|
+
debts: X,
|
|
1585
|
+
hoveredDebtGuid: q,
|
|
1586
1586
|
onClickRow: pe,
|
|
1587
1587
|
onHoverRow: de
|
|
1588
1588
|
}
|
|
@@ -1590,29 +1590,29 @@ const Yt = (a) => {
|
|
|
1590
1590
|
] })
|
|
1591
1591
|
] }),
|
|
1592
1592
|
/* @__PURE__ */ e(
|
|
1593
|
-
|
|
1593
|
+
vt,
|
|
1594
1594
|
{
|
|
1595
1595
|
isOpen: L,
|
|
1596
1596
|
onClose: () => z(!1)
|
|
1597
1597
|
}
|
|
1598
1598
|
),
|
|
1599
|
-
/* @__PURE__ */ e(
|
|
1600
|
-
/* @__PURE__ */ e(jt, { isOpen: A, onClose: () =>
|
|
1599
|
+
/* @__PURE__ */ e(Ot, { isOpen: u, onClose: () => f(!1) }),
|
|
1600
|
+
/* @__PURE__ */ e(jt, { isOpen: A, onClose: () => N(!1) }),
|
|
1601
1601
|
/* @__PURE__ */ e(
|
|
1602
1602
|
dt,
|
|
1603
1603
|
{
|
|
1604
1604
|
onClose: () => ce(!1),
|
|
1605
1605
|
showConnectWidget: Ie,
|
|
1606
|
-
title:
|
|
1606
|
+
title: a.mini_title
|
|
1607
1607
|
}
|
|
1608
1608
|
)
|
|
1609
1609
|
]
|
|
1610
1610
|
}
|
|
1611
1611
|
);
|
|
1612
|
-
}, Qr =
|
|
1612
|
+
}, Qr = D(rr);
|
|
1613
1613
|
export {
|
|
1614
1614
|
Ae as DebtsChart,
|
|
1615
|
-
|
|
1616
|
-
|
|
1615
|
+
ro as DebtsStore,
|
|
1616
|
+
qt as DebtsTable,
|
|
1617
1617
|
Qr as DebtsWidget
|
|
1618
1618
|
};
|