@mx-cartographer/experiences 8.0.0-alpha.bb4 → 8.0.0-alpha.sms1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Account-B4CDD-zq.mjs → Account-BDXA6PWh.mjs} +1 -1
- package/dist/AccountDetailsContent-CUztd3-b.mjs +683 -0
- package/dist/{AccountDetailsHeader-DRjFuyJT.mjs → AccountDetailsHeader-i3KFhNuo.mjs} +18 -18
- package/dist/{AccountFields-Cl4KHoSj.mjs → AccountFields-QZspYAji.mjs} +10 -12
- package/dist/AccountListItem-DX5upmCS.mjs +90 -0
- package/dist/{AccountStore-HbVblv86.mjs → AccountStore-BcnDpyLL.mjs} +3 -3
- package/dist/{Accounts-CRUehOiy.mjs → Accounts-DXfZotRC.mjs} +1 -1
- package/dist/{BudgetUtil-Jv8h9H9l.mjs → BudgetUtil-Df2nII9u.mjs} +31 -31
- package/dist/{CashflowStore-CA190BPF.mjs → CashflowStore-D9Dpuz7X.mjs} +25 -18
- package/dist/{Category-Ccoew_sA.mjs → Category-CevNQ03n.mjs} +2 -2
- package/dist/{CategorySelectorDrawer-Dl006GKy.mjs → CategorySelectorDrawer-DqJK_rrL.mjs} +27 -27
- package/dist/{CategoryStore-MUwRWH9e.mjs → CategoryStore-DTgyAMM7.mjs} +2 -2
- package/dist/{CategoryUtil-DfVKKkRf.mjs → CategoryUtil-C5cR-nfQ.mjs} +4 -4
- package/dist/{ConnectDrawer-DVp54lUH.mjs → ConnectDrawer-BIbTqYOH.mjs} +47 -48
- package/dist/{ConnectionsDrawer-Dsc04-4Z.mjs → ConnectionsDrawer-BFfY3_zB.mjs} +2 -2
- package/dist/CurrencyInput-BFKcs-_K.mjs +85 -0
- package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CBdcsyuk.mjs} +1 -1
- package/dist/{DebtsStore-pL63fmdT.mjs → DebtsStore-BbJB0nmu.mjs} +3 -3
- package/dist/{Dialog-CDV0kKxj.mjs → Dialog-BPTr3qHE.mjs} +24 -24
- package/dist/{Drawer-BF40nbsH.mjs → Drawer-BEtCk82g.mjs} +17 -17
- package/dist/{ExportCsvAction-QhQK4_FU.mjs → ExportCsvAction-DzTrtPzk.mjs} +3 -3
- package/dist/{FinstrongStore-BGf36b0z.mjs → FinstrongStore-BIrX0Xg2.mjs} +56 -56
- package/dist/{GoalStore-C1-w3Y1E.mjs → GoalStore-DpWY3gVb.mjs} +4 -4
- package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
- package/dist/{Help-DBfsTkAi.mjs → Help-BnPXM_N2.mjs} +145 -124
- package/dist/{Help-c-zHlDbv.mjs → Help-DhcC-C05.mjs} +8 -8
- package/dist/{IconBacking-DgT8DCeh.mjs → IconBacking-B9oC6uL2.mjs} +11 -11
- package/dist/{LineChart-C1PxNf7P.mjs → LineChart-bc1D9xBE.mjs} +78 -78
- package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-uobBrm_a.mjs} +1 -1
- package/dist/Loader-DUaFpDGv.mjs +24 -0
- package/dist/{ManageIncome-8EsStyIQ.mjs → ManageIncome-NpXHhO1n.mjs} +46 -46
- package/dist/MicroWidgetContainer-DEiRnYVa.mjs +45 -0
- package/dist/MiniWidgetContainer-CmXpTylX.mjs +56 -0
- package/dist/{NetWorthStore-Bti6u-d9.mjs → NetWorthStore-lsuhEpn6.mjs} +4 -4
- package/dist/{NotificationSettings-B74rQVYC.mjs → NotificationSettings-CNmJWVeI.mjs} +77 -77
- package/dist/{OriginalBalanceAction-2Y_3U_mg.mjs → OriginalBalanceAction-DK8_LkPz.mjs} +8 -8
- package/dist/{RecurringSettings-DAncu--R.mjs → RecurringSettings-CqZh1SQa.mjs} +3 -3
- package/dist/{RecurringTransactions-CxcSL1dY.mjs → RecurringTransactions-BKcYmpv3.mjs} +77 -77
- package/dist/{RecurringTransactionsStore-CNFxyGB6.mjs → RecurringTransactionsStore-Ni5tSQIO.mjs} +1 -1
- package/dist/{ResponsiveButton-Cn6-R7ue.mjs → ResponsiveButton-DZFp78fJ.mjs} +10 -10
- package/dist/SearchBox-B2_zLv8-.mjs +42 -0
- package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-krIRNwHK.mjs} +1 -1
- package/dist/{SingleSegmentDonut-7Uy6VEld.mjs → SingleSegmentDonut-BgbLgwHi.mjs} +6 -6
- package/dist/{SpendingData-DPQ96k3x.mjs → SpendingData-BuJ03S9d.mjs} +4 -4
- package/dist/{SpendingLegend-6FqtMcBV.mjs → SpendingLegend-CjX-hX2O.mjs} +12 -12
- package/dist/{StatusBar-CPfSXe80.mjs → StatusBar-BK_uYHAB.mjs} +6 -6
- package/dist/{TabContentContainer-CnMXkVqr.mjs → TabContentContainer-j01JYR_7.mjs} +8 -8
- package/dist/TransactionDetails-5M2vfr59.mjs +1379 -0
- package/dist/{TransactionStore-DbwAutwC.mjs → TransactionStore-D-Q3BU9Z.mjs} +58 -41
- package/dist/{TrendsStore-_mRaFUdf.mjs → TrendsStore-BW9FGQeE.mjs} +37 -37
- package/dist/{User-BklmOUSd.mjs → User-wXzDI4M8.mjs} +107 -107
- package/dist/{ViewMoreMicroCard-DAkyNRlD.mjs → ViewMoreMicroCard-C0832BMe.mjs} +233 -231
- package/dist/{WidgetContainer-CDh9fjpR.mjs → WidgetContainer-BhQ1Kx2z.mjs} +36 -36
- package/dist/accounts/index.es.js +94 -94
- package/dist/analytics/index.es.js +27 -27
- package/dist/budgets/index.es.js +251 -250
- package/dist/cashflow/index.es.js +158 -157
- package/dist/categories/index.es.js +2 -2
- package/dist/common/components/Loader.d.ts +2 -1
- package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
- package/dist/common/components/barchart/Bar.d.ts +25 -0
- package/dist/common/components/barchart/BarChart.d.ts +34 -0
- package/dist/common/components/barchart/BarColumn.d.ts +37 -0
- package/dist/common/components/barchart/Legend.d.ts +8 -0
- package/dist/common/components/barchart/Util.d.ts +42 -0
- package/dist/common/components/barchart/index.d.ts +1 -0
- package/dist/common/components/charts/linechart/CustomMark.d.ts +1 -1
- package/dist/common/components/index.d.ts +1 -0
- package/dist/common/index.es.js +660 -395
- package/dist/common/utils/Theme.d.ts +3 -1
- package/dist/dashboard/index.es.js +21 -21
- package/dist/debts/components/DebtsChart.d.ts +2 -1
- package/dist/debts/index.es.js +440 -440
- package/dist/{exportTransactionsToCSV-BgV_wTLT.mjs → exportTransactionsToCSV-Cz2t0lmA.mjs} +3 -3
- package/dist/finstrong/index.es.js +118 -118
- package/dist/goals/index.es.js +380 -386
- package/dist/help/components/content/BottomImageContent.d.ts +1 -1
- package/dist/help/components/content/LeftImageContent.d.ts +1 -1
- package/dist/help/components/content/RightImageContent.d.ts +1 -1
- package/dist/help/components/content/TopImageContent.d.ts +1 -1
- package/dist/help/index.es.js +6 -6
- package/dist/investments/index.es.js +279 -278
- package/dist/merchants/index.es.js +7 -7
- package/dist/microinsights/index.es.js +1 -1
- package/dist/networth/components/NetWorthChange.d.ts +1 -3
- package/dist/networth/index.es.js +185 -191
- package/dist/notifications/index.es.js +30 -30
- package/dist/recurringtransactions/index.es.js +85 -85
- package/dist/settings/index.es.js +270 -270
- package/dist/spending/index.es.js +44 -44
- package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +7 -0
- package/dist/transactions/index.es.js +169 -168
- package/dist/trends/index.es.js +318 -317
- package/dist/{useAccountDisplayName-CcIp09Xc.mjs → useAccountDisplayName-CFNF8766.mjs} +1 -1
- package/dist/{useCombineEvents-kNzLTWCp.mjs → useCombineEvents-CRwX-qWE.mjs} +2 -2
- package/dist/{useScreenSize-B5afALev.mjs → useScreenSize-B6JyS_Lj.mjs} +1 -1
- package/package.json +50 -45
- package/dist/AccountDetailsContent-adZTkM52.mjs +0 -683
- package/dist/AccountListItem-wgmlex-_.mjs +0 -90
- package/dist/CurrencyInput-D1cjbdCI.mjs +0 -85
- package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
- package/dist/Loader-Ckqi9Rx6.mjs +0 -21
- package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +0 -45
- package/dist/MiniWidgetContainer-CKzf_Ira.mjs +0 -56
- package/dist/SearchBox-B7km148n.mjs +0 -39
- package/dist/TransactionDetails-Bn0qY5Hw.mjs +0 -1336
package/dist/debts/index.es.js
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { jsx as e, jsxs as s, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as s, Fragment as H } from "react/jsx-runtime";
|
|
2
2
|
import g from "react";
|
|
3
|
-
import { observer as
|
|
3
|
+
import { observer as D } from "mobx-react-lite";
|
|
4
4
|
import w from "@mui/material/Stack";
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import { Text as l, H3 as
|
|
5
|
+
import { useTheme as X, Card as _e, Stack as _, Box as W } from "@mui/material";
|
|
6
|
+
import { Text as l, H3 as De, InstitutionLogo as Te, Icon as te } from "@mxenabled/mxui";
|
|
7
7
|
import { intervalToDuration as Ae, formatDuration as Ee } from "date-fns";
|
|
8
8
|
import { addMonths as se } from "date-fns/addMonths";
|
|
9
9
|
import { fromUnixTime as ce } from "date-fns/fromUnixTime";
|
|
10
10
|
import { getUnixTime as de } from "date-fns/getUnixTime";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { f as
|
|
14
|
-
import { f as
|
|
15
|
-
import { G as Pe, x as Z, u as
|
|
16
|
-
import { u as
|
|
17
|
-
import { D as re } from "../Drawer-
|
|
11
|
+
import { D as P, M as Ie, I as Be } from "../DebtsStore-BbJB0nmu.mjs";
|
|
12
|
+
import { a as Lr } from "../DebtsStore-BbJB0nmu.mjs";
|
|
13
|
+
import { f as k, a as Me } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
14
|
+
import { f as U, a as q } from "../Dialog-BPTr3qHE.mjs";
|
|
15
|
+
import { G as Pe, x as Z, u as S, l as V, g as F, d as J, n as ke, b as Ne } from "../hooks-C41HAxM5.mjs";
|
|
16
|
+
import { u as Y } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
|
+
import { D as re } from "../Drawer-BEtCk82g.mjs";
|
|
18
18
|
import { b as I } from "../Localization-2MODESHW.mjs";
|
|
19
|
-
import { A as
|
|
19
|
+
import { A as Fe, u as Re } from "../AccountDetailsHeader-i3KFhNuo.mjs";
|
|
20
20
|
import Le from "@mui/material/Card";
|
|
21
21
|
import $e from "@mui/material/CardContent";
|
|
22
|
-
import
|
|
23
|
-
import { LineChart as
|
|
24
|
-
import
|
|
22
|
+
import He from "@mui/material/CardHeader";
|
|
23
|
+
import { LineChart as Oe } from "@mui/x-charts";
|
|
24
|
+
import ae from "@mui/material/Box";
|
|
25
25
|
import { useTheme as We } from "@mui/material/styles";
|
|
26
|
-
import { A as T, W as Ge } from "../WidgetContainer-
|
|
26
|
+
import { A as T, W as Ge } from "../WidgetContainer-BhQ1Kx2z.mjs";
|
|
27
27
|
import pe from "@mui/material/Tab";
|
|
28
28
|
import je from "@mui/material/Tabs";
|
|
29
29
|
import ye from "@mui/material/List";
|
|
30
30
|
import G from "@mui/material/Divider";
|
|
31
|
-
import { M as ze, I as
|
|
32
|
-
import
|
|
33
|
-
import { L as Q } from "../ListItemAction-
|
|
34
|
-
import { C as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import { Error as
|
|
39
|
-
import { T as be } from "../TabContentContainer-
|
|
40
|
-
import { DataGridPro as
|
|
41
|
-
import { H as j } from "../HeaderCell-
|
|
42
|
-
import {
|
|
31
|
+
import { M as ze, I as Xe, O as Ve } from "../OriginalBalanceAction-DK8_LkPz.mjs";
|
|
32
|
+
import Ye from "@mui/material/TextField";
|
|
33
|
+
import { L as Q } from "../ListItemAction-uobBrm_a.mjs";
|
|
34
|
+
import { C as ne } from "../CurrencyInput-BFKcs-_K.mjs";
|
|
35
|
+
import me from "@mui/material/Alert";
|
|
36
|
+
import he from "@mui/material/AlertTitle";
|
|
37
|
+
import ue from "@mui/material/Paper";
|
|
38
|
+
import { Error as Ke, CheckCircle as fe } from "@mxenabled/mx-icons";
|
|
39
|
+
import { T as be } from "../TabContentContainer-j01JYR_7.mjs";
|
|
40
|
+
import { DataGridPro as Ue } from "@mui/x-data-grid-pro";
|
|
41
|
+
import { H as j } from "../HeaderCell-DjuifqHJ.mjs";
|
|
42
|
+
import { i as qe } from "../ConnectDrawer-BIbTqYOH.mjs";
|
|
43
43
|
import xe from "@mui/material/Button";
|
|
44
44
|
import Ze from "@mui/material/IconButton";
|
|
45
45
|
import Je from "@mui/material/ListItem";
|
|
46
46
|
import Qe from "@mui/material/Popover";
|
|
47
|
-
import { L as et } from "../Loader-
|
|
48
|
-
const tt = (
|
|
47
|
+
import { L as et } from "../Loader-DUaFpDGv.mjs";
|
|
48
|
+
const tt = (a, n = 0, r = 0) => {
|
|
49
49
|
if (r === 0) return 0;
|
|
50
|
-
const t =
|
|
50
|
+
const t = n / (Ie * Be);
|
|
51
51
|
return Math.ceil(
|
|
52
|
-
t === 0 ?
|
|
52
|
+
t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
|
|
53
53
|
);
|
|
54
|
-
}, rt = (
|
|
54
|
+
}, rt = (a, n, r, t, o) => {
|
|
55
55
|
const i = [];
|
|
56
56
|
if (r === 0) {
|
|
57
|
-
for (let c = 0; c <
|
|
58
|
-
const d =
|
|
57
|
+
for (let c = 0; c < a; c++) {
|
|
58
|
+
const d = n - t * (c + 1), m = n - t * c, u = d >= 0 ? t : m;
|
|
59
59
|
i.push({
|
|
60
60
|
balance: d >= 0 ? d : 0,
|
|
61
61
|
interest: r,
|
|
62
|
-
payment:
|
|
63
|
-
principal:
|
|
62
|
+
payment: u,
|
|
63
|
+
principal: u,
|
|
64
64
|
timestamp: de(
|
|
65
65
|
se(
|
|
66
|
-
ce(
|
|
66
|
+
ce(o),
|
|
67
67
|
// convert seconds → Date
|
|
68
68
|
c + 1
|
|
69
69
|
// add (index + 1) months
|
|
@@ -74,98 +74,98 @@ const tt = (n, o = 0, r = 0) => {
|
|
|
74
74
|
return i;
|
|
75
75
|
}
|
|
76
76
|
const p = r / 1200;
|
|
77
|
-
for (let c = 0; c <
|
|
78
|
-
const d = de(se(ce(
|
|
77
|
+
for (let c = 0; c < a; c++) {
|
|
78
|
+
const d = de(se(ce(o), c + 1)), m = Math.pow(1 + p, c), u = n * m - t * ((m - 1) / p), x = Math.pow(1 + p, c + 1), h = n * x - t * ((x - 1) / p), v = t + Math.min(h, 0), B = u * p;
|
|
79
79
|
i.push({
|
|
80
|
-
balance: Math.max(0,
|
|
81
|
-
interest:
|
|
82
|
-
payment:
|
|
83
|
-
principal:
|
|
80
|
+
balance: Math.max(0, h),
|
|
81
|
+
interest: B,
|
|
82
|
+
payment: v,
|
|
83
|
+
principal: v - B,
|
|
84
84
|
timestamp: d
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
return i;
|
|
88
|
-
},
|
|
89
|
-
const { monthly_payment:
|
|
88
|
+
}, at = (a) => (a[a.length - 1] || {}).timestamp, nt = (a) => {
|
|
89
|
+
const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i = tt(t, r ?? 0, n ?? 0), p = rt(
|
|
90
90
|
i,
|
|
91
91
|
t,
|
|
92
92
|
r ?? 0,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
), c =
|
|
93
|
+
n ?? 0,
|
|
94
|
+
o
|
|
95
|
+
), c = at(p);
|
|
96
96
|
return {
|
|
97
|
-
...
|
|
97
|
+
...a,
|
|
98
98
|
minimumFinalPayment: c,
|
|
99
99
|
minimumPayments: p
|
|
100
100
|
};
|
|
101
|
-
}, ge = (
|
|
102
|
-
const [r, t] =
|
|
103
|
-
([
|
|
101
|
+
}, ge = (a, n) => {
|
|
102
|
+
const [r, t] = a.reduce(
|
|
103
|
+
([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(nt(p)), [o, i]),
|
|
104
104
|
[[], []]
|
|
105
105
|
);
|
|
106
|
-
switch (
|
|
106
|
+
switch (n) {
|
|
107
107
|
case P.FASTEST_PAYOFF_FIRST:
|
|
108
|
-
r.sort((
|
|
108
|
+
r.sort((o, i) => (o.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
|
|
109
109
|
break;
|
|
110
110
|
case P.HIGHEST_INTEREST:
|
|
111
|
-
r.sort((
|
|
111
|
+
r.sort((o, i) => (i.interest_rate ?? 0) - (o.interest_rate ?? 0));
|
|
112
112
|
break;
|
|
113
113
|
case P.LOWEST_BALANCE:
|
|
114
|
-
r.sort((
|
|
114
|
+
r.sort((o, i) => o.balance - i.balance);
|
|
115
115
|
break;
|
|
116
116
|
case P.HIGHEST_BALANCE:
|
|
117
|
-
r.sort((
|
|
117
|
+
r.sort((o, i) => i.balance - o.balance);
|
|
118
118
|
break;
|
|
119
119
|
default:
|
|
120
|
-
r.sort((
|
|
120
|
+
r.sort((o, i) => o.balance - i.balance);
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
a.splice(0, a.length, ...r, ...t);
|
|
123
123
|
};
|
|
124
|
-
function
|
|
125
|
-
const t =
|
|
126
|
-
(
|
|
124
|
+
function ot(a, n, r = 0) {
|
|
125
|
+
const t = a.map((u) => ({ ...u })).filter(
|
|
126
|
+
(u) => u.interest_rate !== void 0 && u.monthly_payment !== void 0 && !u.is_paid_off
|
|
127
127
|
);
|
|
128
|
-
ge(t,
|
|
129
|
-
let
|
|
128
|
+
ge(t, n);
|
|
129
|
+
let o = 0, i = 0;
|
|
130
130
|
const p = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
|
|
131
|
-
for (; t.some((
|
|
132
|
-
let
|
|
133
|
-
for (const [x,
|
|
134
|
-
if (
|
|
135
|
-
const
|
|
136
|
-
let C =
|
|
137
|
-
x === 0 && r && (C += r),
|
|
138
|
-
const A = Math.min(
|
|
139
|
-
if (A <=
|
|
140
|
-
|
|
131
|
+
for (; t.some((u) => u.balance >= 0.01 && !u.is_impossible); ) {
|
|
132
|
+
let u = !1;
|
|
133
|
+
for (const [x, h] of t.entries()) {
|
|
134
|
+
if (h.balance <= 0.01 || h.is_impossible) continue;
|
|
135
|
+
const B = (h.interest_rate ?? 0) / 100 / 12, N = h.balance * B;
|
|
136
|
+
let C = h.monthly_payment ?? 0;
|
|
137
|
+
x === 0 && r && (C += r), h.balance += N;
|
|
138
|
+
const A = Math.min(h.balance, C + i);
|
|
139
|
+
if (A <= N) {
|
|
140
|
+
h.is_impossible = !0;
|
|
141
141
|
continue;
|
|
142
142
|
}
|
|
143
|
-
|
|
143
|
+
h.balance -= A, h.balance = h.balance < 0.01 ? 0 : h.balance, o += N, h.balance <= 0 && (i += C), A > 0 && (u = !0);
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
u && c.setMonth(c.getMonth() + 1);
|
|
146
146
|
}
|
|
147
|
-
const d = t.some((
|
|
147
|
+
const d = t.some((u) => u.is_impossible && u.balance > 0), m = Ae({ start: p, end: c });
|
|
148
148
|
return {
|
|
149
|
-
payoffSavings: d ? "N/A" :
|
|
150
|
-
payoffDate: d ? "Never" :
|
|
151
|
-
payoffDuration: d ? "Stagnant" : Ee(
|
|
149
|
+
payoffSavings: d ? "N/A" : k(o, "0,0.00"),
|
|
150
|
+
payoffDate: d ? "Never" : U(c, q.MONTH_YEAR),
|
|
151
|
+
payoffDuration: d ? "Stagnant" : Ee(m, { format: ["years", "months"] }) || "0 months"
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
const L = () => {
|
|
155
155
|
if (!g.useContext(Pe))
|
|
156
156
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
157
157
|
return Z().uiStore;
|
|
158
|
-
}, it = ({ debts:
|
|
159
|
-
const t =
|
|
158
|
+
}, it = ({ debts: a, onClickCta: n, sx: r }) => {
|
|
159
|
+
const t = X(), { isMobile: o } = Y(), { debts: i } = S(), { selectedDebtPriority: p } = L(), { monthlyCashFlowProfile: c } = V(), { payoffDate: d, payoffSavings: m, payoffDuration: u } = g.useMemo(() => {
|
|
160
160
|
const x = c?.extra_payment ?? 0;
|
|
161
|
-
return
|
|
162
|
-
}, [
|
|
161
|
+
return ot(a, p, x);
|
|
162
|
+
}, [a, p, c]);
|
|
163
163
|
return /* @__PURE__ */ e(
|
|
164
164
|
_e,
|
|
165
165
|
{
|
|
166
166
|
sx: {
|
|
167
167
|
boxShadow: t.shadows[2],
|
|
168
|
-
width:
|
|
168
|
+
width: o ? "100%" : "186px",
|
|
169
169
|
minWidth: "186px",
|
|
170
170
|
...r
|
|
171
171
|
},
|
|
@@ -173,66 +173,66 @@ const L = () => {
|
|
|
173
173
|
/* @__PURE__ */ s(
|
|
174
174
|
_,
|
|
175
175
|
{
|
|
176
|
-
gap:
|
|
176
|
+
gap: o ? "4px" : "0",
|
|
177
177
|
sx: {
|
|
178
178
|
borderBottom: "1px solid",
|
|
179
179
|
borderBottomColor: t.palette.grey[300],
|
|
180
180
|
pb: "8px"
|
|
181
181
|
},
|
|
182
182
|
children: [
|
|
183
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
184
|
-
/* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "
|
|
183
|
+
/* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_date_description }),
|
|
184
|
+
/* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "Small", children: d })
|
|
185
185
|
]
|
|
186
186
|
}
|
|
187
187
|
),
|
|
188
|
-
/* @__PURE__ */ s(_, { gap:
|
|
189
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
190
|
-
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "
|
|
188
|
+
/* @__PURE__ */ s(_, { gap: o ? "4px" : "0", children: [
|
|
189
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: m }),
|
|
190
|
+
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
|
|
191
191
|
] }),
|
|
192
|
-
/* @__PURE__ */ s(_, { gap:
|
|
193
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
194
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
192
|
+
/* @__PURE__ */ s(_, { gap: o ? "4px" : "0", children: [
|
|
193
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: u }),
|
|
194
|
+
/* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
|
|
195
195
|
] }),
|
|
196
196
|
/* @__PURE__ */ e(
|
|
197
197
|
l,
|
|
198
198
|
{
|
|
199
199
|
bold: !0,
|
|
200
200
|
color: t.palette.primary.main,
|
|
201
|
-
onClick:
|
|
201
|
+
onClick: n,
|
|
202
202
|
sx: { cursor: "pointer" },
|
|
203
|
-
variant: "
|
|
203
|
+
variant: "Small",
|
|
204
204
|
children: i.snowball_card_cta
|
|
205
205
|
}
|
|
206
206
|
)
|
|
207
207
|
] })
|
|
208
208
|
}
|
|
209
209
|
);
|
|
210
|
-
}, lt =
|
|
211
|
-
const r =
|
|
210
|
+
}, lt = D(it), st = ({ isOpen: a, onClose: n }) => {
|
|
211
|
+
const r = X(), { debts: t } = S(), [o, i] = g.useState(!1);
|
|
212
212
|
return /* @__PURE__ */ e(
|
|
213
213
|
re,
|
|
214
214
|
{
|
|
215
215
|
ariaLabelClose: "",
|
|
216
|
-
isOpen:
|
|
217
|
-
onClose:
|
|
216
|
+
isOpen: a,
|
|
217
|
+
onClose: n,
|
|
218
218
|
title: t.snowball_drawer_title,
|
|
219
219
|
children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
|
|
220
220
|
/* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
|
|
221
221
|
/* @__PURE__ */ s(_, { alignItems: "center", pb: 24, children: [
|
|
222
|
-
/* @__PURE__ */ e(l, { mb: 12, variant: "
|
|
223
|
-
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "
|
|
224
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
225
|
-
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "
|
|
222
|
+
/* @__PURE__ */ e(l, { mb: 12, variant: "H3", children: t.snowball_drawer_subtitle }),
|
|
223
|
+
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_amount_description }),
|
|
224
|
+
/* @__PURE__ */ e(l, { variant: "H1", children: t.snowball_drawer_savings }),
|
|
225
|
+
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_duration_description })
|
|
226
226
|
] }),
|
|
227
227
|
/* @__PURE__ */ s(_e, { sx: { display: "grid", py: 16, px: 24 }, children: [
|
|
228
|
-
/* @__PURE__ */ e(l, { mb: 4, variant: "
|
|
228
|
+
/* @__PURE__ */ e(l, { mb: 4, variant: "H3", children: t.snowball_drawer_question }),
|
|
229
229
|
/* @__PURE__ */ e(
|
|
230
230
|
l,
|
|
231
231
|
{
|
|
232
232
|
color: r.palette.secondary.main,
|
|
233
233
|
mb: 8,
|
|
234
|
-
sx: { whiteSpace:
|
|
235
|
-
variant: "
|
|
234
|
+
sx: { whiteSpace: o ? "normal" : "nowrap" },
|
|
235
|
+
variant: "ParagraphSmall",
|
|
236
236
|
children: t.snowball_drawer_answer
|
|
237
237
|
}
|
|
238
238
|
),
|
|
@@ -241,10 +241,10 @@ const L = () => {
|
|
|
241
241
|
{
|
|
242
242
|
bold: !0,
|
|
243
243
|
color: r.palette.primary.main,
|
|
244
|
-
onClick: () => i(!
|
|
244
|
+
onClick: () => i(!o),
|
|
245
245
|
sx: { cursor: "pointer" },
|
|
246
|
-
variant: "
|
|
247
|
-
children:
|
|
246
|
+
variant: "Small",
|
|
247
|
+
children: o ? t.snowball_drawer_less : t.snowball_drawer_more
|
|
248
248
|
}
|
|
249
249
|
)
|
|
250
250
|
] })
|
|
@@ -256,13 +256,13 @@ const L = () => {
|
|
|
256
256
|
color: r.palette.secondary.main,
|
|
257
257
|
px: 24,
|
|
258
258
|
sx: { textAlign: "center", whiteSpace: "normal" },
|
|
259
|
-
variant: "
|
|
259
|
+
variant: "Small",
|
|
260
260
|
children: t.snowball_drawer_disclaimer
|
|
261
261
|
}
|
|
262
262
|
),
|
|
263
263
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
264
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
265
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
264
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 1) }),
|
|
265
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
266
266
|
] }),
|
|
267
267
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
268
268
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
@@ -279,14 +279,14 @@ const L = () => {
|
|
|
279
279
|
backgroundColor: r.palette.success.main,
|
|
280
280
|
marginRight: 12
|
|
281
281
|
},
|
|
282
|
-
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "
|
|
282
|
+
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "Small", children: "✓" })
|
|
283
283
|
}
|
|
284
284
|
),
|
|
285
285
|
/* @__PURE__ */ s(
|
|
286
286
|
_,
|
|
287
287
|
{
|
|
288
288
|
sx: {
|
|
289
|
-
borderBottom: `1px solid ${r.palette.
|
|
289
|
+
borderBottom: `1px solid ${r.palette.border.light}`,
|
|
290
290
|
flexDirection: "row",
|
|
291
291
|
flexGrow: 1,
|
|
292
292
|
py: 14,
|
|
@@ -294,8 +294,8 @@ const L = () => {
|
|
|
294
294
|
},
|
|
295
295
|
children: [
|
|
296
296
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
297
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
298
|
-
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "
|
|
297
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "A") }),
|
|
298
|
+
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
|
299
299
|
I(
|
|
300
300
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
301
301
|
"$100"
|
|
@@ -305,14 +305,14 @@ const L = () => {
|
|
|
305
305
|
] })
|
|
306
306
|
] }),
|
|
307
307
|
/* @__PURE__ */ s(_, { children: [
|
|
308
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
308
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: "$100.00" }),
|
|
309
309
|
/* @__PURE__ */ e(
|
|
310
310
|
l,
|
|
311
311
|
{
|
|
312
312
|
bold: !0,
|
|
313
313
|
color: r.palette.success.main,
|
|
314
314
|
textAlign: "end",
|
|
315
|
-
variant: "
|
|
315
|
+
variant: "Tiny",
|
|
316
316
|
children: t.snowball_drawer_paid_label
|
|
317
317
|
}
|
|
318
318
|
)
|
|
@@ -330,7 +330,7 @@ const L = () => {
|
|
|
330
330
|
height: 20,
|
|
331
331
|
marginRight: 12,
|
|
332
332
|
borderRadius: "50%",
|
|
333
|
-
border: `3px solid ${r.palette.
|
|
333
|
+
border: `3px solid ${r.palette.border.darker}`
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
),
|
|
@@ -338,15 +338,15 @@ const L = () => {
|
|
|
338
338
|
_,
|
|
339
339
|
{
|
|
340
340
|
sx: {
|
|
341
|
-
borderBottom: `1px solid ${r.palette.
|
|
341
|
+
borderBottom: `1px solid ${r.palette.border.light}`,
|
|
342
342
|
flexDirection: "row",
|
|
343
343
|
flexGrow: 1,
|
|
344
344
|
py: 14,
|
|
345
345
|
pr: 24
|
|
346
346
|
},
|
|
347
347
|
children: [
|
|
348
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "
|
|
349
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
348
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "B") }),
|
|
349
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: "$400.00" })
|
|
350
350
|
]
|
|
351
351
|
}
|
|
352
352
|
)
|
|
@@ -360,13 +360,13 @@ const L = () => {
|
|
|
360
360
|
height: 20,
|
|
361
361
|
marginRight: 12,
|
|
362
362
|
borderRadius: "50%",
|
|
363
|
-
border: `3px solid ${r.palette.
|
|
363
|
+
border: `3px solid ${r.palette.border.darker}`
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
),
|
|
367
367
|
/* @__PURE__ */ s(_, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
|
|
368
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "
|
|
369
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
368
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }),
|
|
369
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
|
|
370
370
|
] })
|
|
371
371
|
] }),
|
|
372
372
|
/* @__PURE__ */ s(
|
|
@@ -377,19 +377,19 @@ const L = () => {
|
|
|
377
377
|
px: 24,
|
|
378
378
|
flexDirection: "row",
|
|
379
379
|
justifyContent: "space-between",
|
|
380
|
-
borderTop: `1px solid ${r.palette.
|
|
381
|
-
borderBottom: `1px solid ${r.palette.
|
|
380
|
+
borderTop: `1px solid ${r.palette.border.light}`,
|
|
381
|
+
borderBottom: `1px solid ${r.palette.border.light}`
|
|
382
382
|
},
|
|
383
383
|
children: [
|
|
384
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
385
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
384
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: t.snowball_drawer_total_label }),
|
|
385
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: "$1,500.00" })
|
|
386
386
|
]
|
|
387
387
|
}
|
|
388
388
|
)
|
|
389
389
|
] }),
|
|
390
390
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
391
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
392
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
391
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 2) }),
|
|
392
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
393
393
|
] }),
|
|
394
394
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
395
395
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
@@ -406,14 +406,14 @@ const L = () => {
|
|
|
406
406
|
backgroundColor: r.palette.success.main,
|
|
407
407
|
marginRight: 12
|
|
408
408
|
},
|
|
409
|
-
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "
|
|
409
|
+
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "Small", children: "✓" })
|
|
410
410
|
}
|
|
411
411
|
),
|
|
412
412
|
/* @__PURE__ */ s(
|
|
413
413
|
_,
|
|
414
414
|
{
|
|
415
415
|
sx: {
|
|
416
|
-
borderBottom: `1px solid ${r.palette.
|
|
416
|
+
borderBottom: `1px solid ${r.palette.border.light}`,
|
|
417
417
|
flexDirection: "row",
|
|
418
418
|
flexGrow: 1,
|
|
419
419
|
py: 14,
|
|
@@ -421,8 +421,8 @@ const L = () => {
|
|
|
421
421
|
},
|
|
422
422
|
children: [
|
|
423
423
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
424
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
425
|
-
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "
|
|
424
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "B") }),
|
|
425
|
+
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
|
426
426
|
I(
|
|
427
427
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
428
428
|
"$500"
|
|
@@ -432,14 +432,14 @@ const L = () => {
|
|
|
432
432
|
] })
|
|
433
433
|
] }),
|
|
434
434
|
/* @__PURE__ */ s(_, { children: [
|
|
435
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
435
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: "$500.00" }),
|
|
436
436
|
/* @__PURE__ */ e(
|
|
437
437
|
l,
|
|
438
438
|
{
|
|
439
439
|
bold: !0,
|
|
440
440
|
color: r.palette.success.main,
|
|
441
441
|
textAlign: "end",
|
|
442
|
-
variant: "
|
|
442
|
+
variant: "Tiny",
|
|
443
443
|
children: t.snowball_drawer_paid_label
|
|
444
444
|
}
|
|
445
445
|
)
|
|
@@ -457,7 +457,7 @@ const L = () => {
|
|
|
457
457
|
height: 20,
|
|
458
458
|
marginRight: 12,
|
|
459
459
|
borderRadius: "50%",
|
|
460
|
-
border: `3px solid ${r.palette.
|
|
460
|
+
border: `3px solid ${r.palette.border.darker}`
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
),
|
|
@@ -471,8 +471,8 @@ const L = () => {
|
|
|
471
471
|
pr: 24
|
|
472
472
|
},
|
|
473
473
|
children: [
|
|
474
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "
|
|
475
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
474
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }),
|
|
475
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
|
|
476
476
|
]
|
|
477
477
|
}
|
|
478
478
|
)
|
|
@@ -485,19 +485,19 @@ const L = () => {
|
|
|
485
485
|
px: 24,
|
|
486
486
|
flexDirection: "row",
|
|
487
487
|
justifyContent: "space-between",
|
|
488
|
-
borderTop: `1px solid ${r.palette.
|
|
489
|
-
borderBottom: `1px solid ${r.palette.
|
|
488
|
+
borderTop: `1px solid ${r.palette.border.light}`,
|
|
489
|
+
borderBottom: `1px solid ${r.palette.border.light}`
|
|
490
490
|
},
|
|
491
491
|
children: [
|
|
492
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
493
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
492
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: t.snowball_drawer_total_label }),
|
|
493
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: "$1,500.00" })
|
|
494
494
|
]
|
|
495
495
|
}
|
|
496
496
|
)
|
|
497
497
|
] }),
|
|
498
498
|
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
499
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
500
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
499
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 3) }),
|
|
500
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
501
501
|
] }),
|
|
502
502
|
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
503
503
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
@@ -514,7 +514,7 @@ const L = () => {
|
|
|
514
514
|
backgroundColor: r.palette.success.main,
|
|
515
515
|
marginRight: 12
|
|
516
516
|
},
|
|
517
|
-
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "
|
|
517
|
+
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "Small", children: "✓" })
|
|
518
518
|
}
|
|
519
519
|
),
|
|
520
520
|
/* @__PURE__ */ s(
|
|
@@ -528,16 +528,16 @@ const L = () => {
|
|
|
528
528
|
pr: 24
|
|
529
529
|
},
|
|
530
530
|
children: [
|
|
531
|
-
/* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "
|
|
531
|
+
/* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }) }),
|
|
532
532
|
/* @__PURE__ */ s(_, { children: [
|
|
533
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
533
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,500.00" }),
|
|
534
534
|
/* @__PURE__ */ e(
|
|
535
535
|
l,
|
|
536
536
|
{
|
|
537
537
|
bold: !0,
|
|
538
538
|
color: r.palette.success.main,
|
|
539
539
|
textAlign: "end",
|
|
540
|
-
variant: "
|
|
540
|
+
variant: "Tiny",
|
|
541
541
|
children: t.snowball_drawer_paid_label
|
|
542
542
|
}
|
|
543
543
|
)
|
|
@@ -554,12 +554,12 @@ const L = () => {
|
|
|
554
554
|
px: 24,
|
|
555
555
|
flexDirection: "row",
|
|
556
556
|
justifyContent: "space-between",
|
|
557
|
-
borderTop: `1px solid ${r.palette.
|
|
558
|
-
borderBottom: `1px solid ${r.palette.
|
|
557
|
+
borderTop: `1px solid ${r.palette.border.light}`,
|
|
558
|
+
borderBottom: `1px solid ${r.palette.border.light}`
|
|
559
559
|
},
|
|
560
560
|
children: [
|
|
561
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
562
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
561
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: t.snowball_drawer_total_label }),
|
|
562
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: "$1,500.00" })
|
|
563
563
|
]
|
|
564
564
|
}
|
|
565
565
|
)
|
|
@@ -568,43 +568,43 @@ const L = () => {
|
|
|
568
568
|
] })
|
|
569
569
|
}
|
|
570
570
|
);
|
|
571
|
-
}, ct =
|
|
572
|
-
function pt(
|
|
573
|
-
const [r, t,
|
|
574
|
-
Math.max(0, Math.min(255, Math.round(r *
|
|
575
|
-
Math.max(0, Math.min(255, Math.round(t *
|
|
576
|
-
Math.max(0, Math.min(255, Math.round(
|
|
571
|
+
}, ct = D(st), dt = "#FF7B08";
|
|
572
|
+
function pt(a, n) {
|
|
573
|
+
const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
|
|
574
|
+
Math.max(0, Math.min(255, Math.round(r * n))),
|
|
575
|
+
Math.max(0, Math.min(255, Math.round(t * n))),
|
|
576
|
+
Math.max(0, Math.min(255, Math.round(o * n)))
|
|
577
577
|
];
|
|
578
578
|
return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
|
|
579
579
|
}
|
|
580
580
|
const we = ({
|
|
581
|
-
sx:
|
|
582
|
-
height:
|
|
581
|
+
sx: a,
|
|
582
|
+
height: n = 500,
|
|
583
583
|
width: r,
|
|
584
584
|
debts: t,
|
|
585
|
-
hoveredDebtGuid:
|
|
585
|
+
hoveredDebtGuid: o,
|
|
586
586
|
onClickArea: i,
|
|
587
587
|
onHoverArea: p
|
|
588
588
|
}) => {
|
|
589
|
-
const c = We(), { onEvent: d } =
|
|
589
|
+
const c = We(), { onEvent: d } = F(), m = t.filter((b) => !b.is_impossible), u = [
|
|
590
590
|
...new Set(
|
|
591
|
-
|
|
591
|
+
m.flatMap((b) => b.dataset.map((f) => new Date(f.x).getTime()))
|
|
592
592
|
)
|
|
593
|
-
].sort((b, f) => b - f).map((b) => new Date(b)), x =
|
|
593
|
+
].sort((b, f) => b - f).map((b) => new Date(b)), x = m.map((b) => {
|
|
594
594
|
const f = new Map(b.dataset.map((R) => [new Date(R.x).getTime(), R.y]));
|
|
595
|
-
let E = f.get(
|
|
596
|
-
const $ =
|
|
595
|
+
let E = f.get(u[0].getTime()) ?? 0;
|
|
596
|
+
const $ = u.map((R) => {
|
|
597
597
|
const z = f.get(R.getTime()) ?? E;
|
|
598
598
|
return E = z, { x: R, y: z };
|
|
599
599
|
});
|
|
600
600
|
return { ...b, dataset: $ };
|
|
601
|
-
}),
|
|
601
|
+
}), h = x.reduce(
|
|
602
602
|
(b, f) => b + (f.dataset[0]?.y ?? 0),
|
|
603
603
|
0
|
|
604
|
-
),
|
|
605
|
-
const E = f / (
|
|
604
|
+
), v = u.map((b, f) => {
|
|
605
|
+
const E = f / (u.length - 1), $ = h * (1 - E);
|
|
606
606
|
return { x: b, y: $ };
|
|
607
|
-
}),
|
|
607
|
+
}), B = Math.ceil(h / 100) * 100, N = u, C = x.map((b, f) => {
|
|
608
608
|
const E = 1 - f / x.length * 0.5, $ = pt(dt, E);
|
|
609
609
|
return {
|
|
610
610
|
id: `debt-${f}`,
|
|
@@ -622,7 +622,7 @@ const we = ({
|
|
|
622
622
|
C.push({
|
|
623
623
|
id: "payoff-line",
|
|
624
624
|
label: "Payoff Line",
|
|
625
|
-
data:
|
|
625
|
+
data: v.map((b) => b.y),
|
|
626
626
|
color: c.palette.grey[700],
|
|
627
627
|
curve: "linear",
|
|
628
628
|
type: "line",
|
|
@@ -632,7 +632,7 @@ const we = ({
|
|
|
632
632
|
});
|
|
633
633
|
const A = (b) => C.findIndex((f) => f?.guid === b);
|
|
634
634
|
return /* @__PURE__ */ e(
|
|
635
|
-
|
|
635
|
+
ae,
|
|
636
636
|
{
|
|
637
637
|
sx: {
|
|
638
638
|
width: "100%",
|
|
@@ -647,11 +647,11 @@ const we = ({
|
|
|
647
647
|
}
|
|
648
648
|
},
|
|
649
649
|
children: /* @__PURE__ */ e(
|
|
650
|
-
|
|
650
|
+
Oe,
|
|
651
651
|
{
|
|
652
652
|
axisHighlight: { x: "none" },
|
|
653
653
|
disableLineItemHighlight: !0,
|
|
654
|
-
height:
|
|
654
|
+
height: n,
|
|
655
655
|
onAreaClick: (b, f) => {
|
|
656
656
|
i?.();
|
|
657
657
|
const E = C.find(($) => $.id === f.seriesId);
|
|
@@ -685,43 +685,43 @@ const we = ({
|
|
|
685
685
|
strokeDasharray: "10 5",
|
|
686
686
|
strokeWidth: 1
|
|
687
687
|
},
|
|
688
|
-
[`& .MuiLineElement-series-debt-${A(
|
|
688
|
+
[`& .MuiLineElement-series-debt-${A(o ?? "0")}`]: {
|
|
689
689
|
opacity: 1
|
|
690
690
|
},
|
|
691
|
-
[`& .MuiAreaElement-series-debt-${A(
|
|
691
|
+
[`& .MuiAreaElement-series-debt-${A(o ?? "0")}`]: {
|
|
692
692
|
opacity: 1
|
|
693
693
|
},
|
|
694
694
|
"& .MuiChartsAxis-tickLabel > tspan": {
|
|
695
|
-
fontFamily: c.typography.
|
|
695
|
+
fontFamily: c.typography.Small.fontFamily
|
|
696
696
|
},
|
|
697
|
-
...
|
|
697
|
+
...a
|
|
698
698
|
},
|
|
699
699
|
tooltip: { trigger: "none" },
|
|
700
700
|
width: r,
|
|
701
701
|
xAxis: [
|
|
702
702
|
{
|
|
703
|
-
data:
|
|
703
|
+
data: N,
|
|
704
704
|
scaleType: "time",
|
|
705
|
-
min:
|
|
705
|
+
min: u[0],
|
|
706
706
|
disableTicks: !0,
|
|
707
|
-
valueFormatter: (b) =>
|
|
707
|
+
valueFormatter: (b) => U(b, q.MONTH_SHORT_YEAR)
|
|
708
708
|
}
|
|
709
709
|
],
|
|
710
710
|
yAxis: [
|
|
711
711
|
{
|
|
712
712
|
min: 0,
|
|
713
|
-
max:
|
|
713
|
+
max: B,
|
|
714
714
|
disableTicks: !0,
|
|
715
|
-
valueFormatter: (b) =>
|
|
715
|
+
valueFormatter: (b) => k(b, "0a")
|
|
716
716
|
}
|
|
717
717
|
]
|
|
718
718
|
}
|
|
719
719
|
)
|
|
720
720
|
}
|
|
721
721
|
);
|
|
722
|
-
},
|
|
723
|
-
const
|
|
724
|
-
return /* @__PURE__ */ s(
|
|
722
|
+
}, mt = () => {
|
|
723
|
+
const a = X(), { debts: n } = S(), { selectedDebtChartData: r } = L();
|
|
724
|
+
return /* @__PURE__ */ s(H, { children: [
|
|
725
725
|
/* @__PURE__ */ s(
|
|
726
726
|
Le,
|
|
727
727
|
{
|
|
@@ -731,7 +731,7 @@ const we = ({
|
|
|
731
731
|
}
|
|
732
732
|
},
|
|
733
733
|
children: [
|
|
734
|
-
/* @__PURE__ */ e(
|
|
734
|
+
/* @__PURE__ */ e(He, { sx: { pb: 0 }, title: /* @__PURE__ */ e(De, { sx: { pb: 4 }, children: n.details_chart_title }) }),
|
|
735
735
|
/* @__PURE__ */ e($e, { sx: { p: 0 }, children: /* @__PURE__ */ e(we, { debts: [r], height: 250 }) })
|
|
736
736
|
]
|
|
737
737
|
}
|
|
@@ -739,34 +739,34 @@ const we = ({
|
|
|
739
739
|
/* @__PURE__ */ e(
|
|
740
740
|
l,
|
|
741
741
|
{
|
|
742
|
-
color:
|
|
742
|
+
color: a.palette.text.secondary,
|
|
743
743
|
sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
|
|
744
|
-
variant: "
|
|
745
|
-
children:
|
|
744
|
+
variant: "Small",
|
|
745
|
+
children: n.details_chart_description
|
|
746
746
|
}
|
|
747
747
|
)
|
|
748
748
|
] });
|
|
749
|
-
},
|
|
750
|
-
const
|
|
751
|
-
return g.useEffect(() =>
|
|
749
|
+
}, ht = D(mt), ut = () => {
|
|
750
|
+
const a = X(), { onEvent: n } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: o, showError: i } = L();
|
|
751
|
+
return g.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(ye, { children: i || o ? /* @__PURE__ */ e(
|
|
752
752
|
l,
|
|
753
753
|
{
|
|
754
|
-
color:
|
|
754
|
+
color: a.palette.secondary.main,
|
|
755
755
|
component: "div",
|
|
756
756
|
sx: { p: 32, textAlign: "center", whiteSpace: "normal" },
|
|
757
|
-
variant: "
|
|
757
|
+
variant: "Small",
|
|
758
758
|
children: i ? r.schedule_error_message : r.schedule_complete_message
|
|
759
759
|
}
|
|
760
|
-
) : /* @__PURE__ */ s(
|
|
760
|
+
) : /* @__PURE__ */ s(H, { children: [
|
|
761
761
|
/* @__PURE__ */ s(w, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
762
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
763
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
762
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_month_heading }),
|
|
763
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_amount_heading })
|
|
764
764
|
] }),
|
|
765
|
-
t.dataset.slice(1).map(({ x: p, y: c, payment: d }) => /* @__PURE__ */ e(w, { bgcolor:
|
|
765
|
+
t.dataset.slice(1).map(({ x: p, y: c, payment: d }) => /* @__PURE__ */ e(w, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(w, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
|
|
766
766
|
w,
|
|
767
767
|
{
|
|
768
768
|
sx: {
|
|
769
|
-
borderBottom: `1px solid ${
|
|
769
|
+
borderBottom: `1px solid ${a.palette.border.light}`,
|
|
770
770
|
flexDirection: "row",
|
|
771
771
|
flexGrow: 1,
|
|
772
772
|
py: 14,
|
|
@@ -774,19 +774,19 @@ const we = ({
|
|
|
774
774
|
},
|
|
775
775
|
children: [
|
|
776
776
|
/* @__PURE__ */ s(w, { flexGrow: 1, children: [
|
|
777
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
778
|
-
/* @__PURE__ */ e(l, { color:
|
|
777
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: U(p, q.MONTH_YEAR) }),
|
|
778
|
+
/* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
|
|
779
779
|
] }),
|
|
780
780
|
/* @__PURE__ */ s(w, { children: [
|
|
781
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
781
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: k(c, "0,0.00") }),
|
|
782
782
|
/* @__PURE__ */ e(
|
|
783
783
|
l,
|
|
784
784
|
{
|
|
785
785
|
bold: !0,
|
|
786
|
-
color:
|
|
786
|
+
color: a.palette.success.main,
|
|
787
787
|
textAlign: "end",
|
|
788
|
-
variant: "
|
|
789
|
-
children: `+${
|
|
788
|
+
variant: "Tiny",
|
|
789
|
+
children: `+${k(d, "0,0")}`
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
] })
|
|
@@ -804,135 +804,135 @@ const we = ({
|
|
|
804
804
|
px: 24
|
|
805
805
|
},
|
|
806
806
|
children: [
|
|
807
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "
|
|
808
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
807
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: r.schedule_payoff_label }),
|
|
808
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: "-" })
|
|
809
809
|
]
|
|
810
810
|
}
|
|
811
811
|
) })
|
|
812
812
|
] }) });
|
|
813
|
-
}, bt =
|
|
814
|
-
const { debts:
|
|
815
|
-
await r({ ...
|
|
813
|
+
}, bt = D(ut), _t = D(({ debt: a }) => {
|
|
814
|
+
const { debts: n } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [o, i] = g.useState(a.interest_rate ?? 0), p = o < 0, c = async () => {
|
|
815
|
+
await r({ ...a.account, interest_rate: o }), a.interest_rate = o, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
|
|
816
816
|
}, d = () => {
|
|
817
817
|
setTimeout(() => {
|
|
818
|
-
i(
|
|
818
|
+
i(a.interest_rate ?? 0);
|
|
819
819
|
}, 250);
|
|
820
820
|
};
|
|
821
821
|
return /* @__PURE__ */ e(
|
|
822
822
|
Q,
|
|
823
823
|
{
|
|
824
824
|
isSaveDisabled: p,
|
|
825
|
-
label: `${
|
|
825
|
+
label: `${n.details_interest_rate} (%)`,
|
|
826
826
|
onCancel: d,
|
|
827
827
|
onSave: c,
|
|
828
|
-
primaryText:
|
|
829
|
-
secondaryText:
|
|
830
|
-
zeroStateText:
|
|
828
|
+
primaryText: n.details_interest_rate,
|
|
829
|
+
secondaryText: Me(Number(a.interest_rate) / 100),
|
|
830
|
+
zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
|
|
831
831
|
children: /* @__PURE__ */ e(
|
|
832
|
-
|
|
832
|
+
Ye,
|
|
833
833
|
{
|
|
834
834
|
error: p,
|
|
835
835
|
fullWidth: !0,
|
|
836
|
-
onChange: (
|
|
836
|
+
onChange: (m) => i(isNaN(parseFloat(m.target.value)) ? 0 : parseFloat(m.target.value)),
|
|
837
837
|
type: "number",
|
|
838
|
-
value:
|
|
838
|
+
value: o
|
|
839
839
|
}
|
|
840
840
|
)
|
|
841
841
|
}
|
|
842
842
|
);
|
|
843
|
-
}), yt =
|
|
844
|
-
const { debts:
|
|
845
|
-
await r({ ...
|
|
843
|
+
}), yt = D(({ debt: a }) => {
|
|
844
|
+
const { debts: n } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [o, i] = g.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
|
|
845
|
+
await r({ ...a.account, minimum_payment: o }), a.monthly_payment = o, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
|
|
846
846
|
}, d = () => {
|
|
847
847
|
setTimeout(() => {
|
|
848
|
-
i(
|
|
848
|
+
i(a.monthly_payment ?? 0);
|
|
849
849
|
}, 250);
|
|
850
850
|
};
|
|
851
851
|
return /* @__PURE__ */ e(
|
|
852
852
|
Q,
|
|
853
853
|
{
|
|
854
854
|
isSaveDisabled: p,
|
|
855
|
-
label:
|
|
855
|
+
label: n.details_monthly_payment,
|
|
856
856
|
onCancel: d,
|
|
857
857
|
onSave: c,
|
|
858
|
-
primaryText:
|
|
859
|
-
secondaryText:
|
|
860
|
-
zeroStateText:
|
|
858
|
+
primaryText: n.details_monthly_payment,
|
|
859
|
+
secondaryText: k(a.monthly_payment, "0,0"),
|
|
860
|
+
zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
|
|
861
861
|
children: /* @__PURE__ */ e(
|
|
862
|
-
|
|
862
|
+
ne,
|
|
863
863
|
{
|
|
864
|
-
amount:
|
|
864
|
+
amount: o,
|
|
865
865
|
autoFocus: !0,
|
|
866
866
|
error: p,
|
|
867
867
|
fullWidth: !0,
|
|
868
868
|
minAmount: 0,
|
|
869
|
-
setAmount: (
|
|
870
|
-
sx: { ".MuiTypography-
|
|
869
|
+
setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
|
|
870
|
+
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
871
871
|
}
|
|
872
872
|
)
|
|
873
873
|
}
|
|
874
874
|
);
|
|
875
|
-
}), ft =
|
|
876
|
-
const { debts:
|
|
877
|
-
await r({ ...
|
|
875
|
+
}), ft = D(({ debt: a }) => {
|
|
876
|
+
const { debts: n } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [o, i] = g.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
|
|
877
|
+
await r({ ...a.account, original_balance: o }), a.original_balance = o, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
|
|
878
878
|
}, d = () => {
|
|
879
879
|
setTimeout(() => {
|
|
880
|
-
i(
|
|
880
|
+
i(a.original_balance ?? 0);
|
|
881
881
|
}, 250);
|
|
882
882
|
};
|
|
883
883
|
return /* @__PURE__ */ e(
|
|
884
884
|
Q,
|
|
885
885
|
{
|
|
886
886
|
isSaveDisabled: p,
|
|
887
|
-
label:
|
|
887
|
+
label: n.details_original_balance,
|
|
888
888
|
onCancel: d,
|
|
889
889
|
onSave: c,
|
|
890
|
-
primaryText:
|
|
891
|
-
secondaryText:
|
|
892
|
-
zeroStateText:
|
|
890
|
+
primaryText: n.details_original_balance,
|
|
891
|
+
secondaryText: k(a.original_balance, "0,0"),
|
|
892
|
+
zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
|
|
893
893
|
children: /* @__PURE__ */ e(
|
|
894
|
-
|
|
894
|
+
ne,
|
|
895
895
|
{
|
|
896
|
-
amount:
|
|
896
|
+
amount: o,
|
|
897
897
|
autoFocus: !0,
|
|
898
898
|
error: p,
|
|
899
899
|
fullWidth: !0,
|
|
900
900
|
minAmount: 0,
|
|
901
|
-
setAmount: (
|
|
902
|
-
sx: { ".MuiTypography-
|
|
901
|
+
setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
|
|
902
|
+
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
903
903
|
}
|
|
904
904
|
)
|
|
905
905
|
}
|
|
906
906
|
);
|
|
907
907
|
}), xt = () => {
|
|
908
|
-
const { onEvent:
|
|
909
|
-
return g.useEffect(() =>
|
|
910
|
-
|
|
911
|
-
/* @__PURE__ */ e(ze, { goal:
|
|
908
|
+
const { onEvent: a } = F(), { selectedDebtChartData: n } = L();
|
|
909
|
+
return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
|
|
910
|
+
n?.goal && /* @__PURE__ */ s(H, { children: [
|
|
911
|
+
/* @__PURE__ */ e(ze, { goal: n.goal }),
|
|
912
912
|
/* @__PURE__ */ e(G, {}),
|
|
913
|
-
/* @__PURE__ */ e(
|
|
913
|
+
/* @__PURE__ */ e(Xe, { goal: n.goal }),
|
|
914
914
|
/* @__PURE__ */ e(G, {}),
|
|
915
|
-
/* @__PURE__ */ e(
|
|
915
|
+
/* @__PURE__ */ e(Ve, { goal: n.goal }),
|
|
916
916
|
/* @__PURE__ */ e(G, {})
|
|
917
917
|
] }),
|
|
918
|
-
!
|
|
919
|
-
/* @__PURE__ */ e(yt, { debt:
|
|
918
|
+
!n?.goal && n?.account && /* @__PURE__ */ s(H, { children: [
|
|
919
|
+
/* @__PURE__ */ e(yt, { debt: n }),
|
|
920
920
|
/* @__PURE__ */ e(G, {}),
|
|
921
|
-
/* @__PURE__ */ e(_t, { debt:
|
|
921
|
+
/* @__PURE__ */ e(_t, { debt: n }),
|
|
922
922
|
/* @__PURE__ */ e(G, {}),
|
|
923
|
-
/* @__PURE__ */ e(ft, { debt:
|
|
923
|
+
/* @__PURE__ */ e(ft, { debt: n }),
|
|
924
924
|
/* @__PURE__ */ e(G, {})
|
|
925
925
|
] })
|
|
926
926
|
] });
|
|
927
|
-
}, gt =
|
|
928
|
-
const { debts: r } =
|
|
927
|
+
}, gt = D(xt), wt = ({ setTabValue: a, sx: n }) => {
|
|
928
|
+
const { debts: r } = S(), { showError: t, showCompleted: o } = L();
|
|
929
929
|
return g.useEffect(() => {
|
|
930
|
-
t &&
|
|
931
|
-
}, [t]), !t && !
|
|
932
|
-
/* @__PURE__ */ e(
|
|
933
|
-
|
|
930
|
+
t && a(1);
|
|
931
|
+
}, [t]), !t && !o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
|
|
932
|
+
/* @__PURE__ */ e(ue, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
|
933
|
+
me,
|
|
934
934
|
{
|
|
935
|
-
icon: t ? /* @__PURE__ */ e(
|
|
935
|
+
icon: t ? /* @__PURE__ */ e(Ke, { filled: !0 }) : /* @__PURE__ */ e(fe, { color: "success", filled: !0 }),
|
|
936
936
|
severity: "error",
|
|
937
937
|
sx: {
|
|
938
938
|
alignItems: "start",
|
|
@@ -945,15 +945,15 @@ const we = ({
|
|
|
945
945
|
}
|
|
946
946
|
},
|
|
947
947
|
children: [
|
|
948
|
-
/* @__PURE__ */ e(
|
|
949
|
-
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "
|
|
948
|
+
/* @__PURE__ */ e(he, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: t ? r.status_error_title : r.status_complete_title }),
|
|
949
|
+
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: t ? r.status_error_description : r.status_complete_description })
|
|
950
950
|
]
|
|
951
951
|
}
|
|
952
952
|
) }),
|
|
953
|
-
t && /* @__PURE__ */ e(
|
|
954
|
-
|
|
953
|
+
t && /* @__PURE__ */ e(ue, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
|
|
954
|
+
me,
|
|
955
955
|
{
|
|
956
|
-
icon: /* @__PURE__ */ e(
|
|
956
|
+
icon: /* @__PURE__ */ e(H, {}),
|
|
957
957
|
severity: "error",
|
|
958
958
|
sx: {
|
|
959
959
|
borderRadius: 2,
|
|
@@ -963,22 +963,22 @@ const we = ({
|
|
|
963
963
|
}
|
|
964
964
|
},
|
|
965
965
|
children: [
|
|
966
|
-
/* @__PURE__ */ e(
|
|
967
|
-
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "
|
|
966
|
+
/* @__PURE__ */ e(he, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r.status_info_title }),
|
|
967
|
+
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: r.status_info_description })
|
|
968
968
|
]
|
|
969
969
|
}
|
|
970
970
|
) })
|
|
971
971
|
] });
|
|
972
|
-
}, Ct =
|
|
973
|
-
const { debts:
|
|
974
|
-
return /* @__PURE__ */ s(
|
|
975
|
-
(
|
|
972
|
+
}, Ct = D(wt), St = () => {
|
|
973
|
+
const { debts: a } = S(), { showError: n, showCompleted: r } = L(), [t, o] = g.useState(0);
|
|
974
|
+
return /* @__PURE__ */ s(H, { children: [
|
|
975
|
+
(n || r) && /* @__PURE__ */ e(Ct, { setTabValue: o, sx: { mt: -24 } }),
|
|
976
976
|
/* @__PURE__ */ s(
|
|
977
977
|
je,
|
|
978
978
|
{
|
|
979
|
-
"aria-label":
|
|
979
|
+
"aria-label": a.details_tabs_aria_label,
|
|
980
980
|
centered: !0,
|
|
981
|
-
onChange: (i, p) =>
|
|
981
|
+
onChange: (i, p) => o(p),
|
|
982
982
|
textColor: "primary",
|
|
983
983
|
value: t,
|
|
984
984
|
variant: "fullWidth",
|
|
@@ -988,7 +988,7 @@ const we = ({
|
|
|
988
988
|
{
|
|
989
989
|
"aria-controls": "debt-schedule-tabpanel-0",
|
|
990
990
|
id: "debt-schedule-tab-0",
|
|
991
|
-
label:
|
|
991
|
+
label: a.schedule_tab_label
|
|
992
992
|
}
|
|
993
993
|
),
|
|
994
994
|
/* @__PURE__ */ e(
|
|
@@ -996,7 +996,7 @@ const we = ({
|
|
|
996
996
|
{
|
|
997
997
|
"aria-controls": "debt-details-tabpanel-1",
|
|
998
998
|
id: "debt-details-tab-1",
|
|
999
|
-
label:
|
|
999
|
+
label: a.details_tab_label
|
|
1000
1000
|
}
|
|
1001
1001
|
)
|
|
1002
1002
|
]
|
|
@@ -1005,109 +1005,109 @@ const we = ({
|
|
|
1005
1005
|
/* @__PURE__ */ e(be, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(bt, {}) }),
|
|
1006
1006
|
/* @__PURE__ */ e(be, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(gt, {}) })
|
|
1007
1007
|
] });
|
|
1008
|
-
},
|
|
1009
|
-
const { debts: r } =
|
|
1008
|
+
}, vt = D(St), Dt = ({ isOpen: a, onClose: n }) => {
|
|
1009
|
+
const { debts: r } = S(), { showError: t, showCompleted: o } = L(), i = t || o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ e(ht, {});
|
|
1010
1010
|
return /* @__PURE__ */ e(
|
|
1011
1011
|
re,
|
|
1012
1012
|
{
|
|
1013
1013
|
ariaLabelClose: r.details_close_aria,
|
|
1014
|
-
isOpen:
|
|
1015
|
-
onClose:
|
|
1014
|
+
isOpen: a,
|
|
1015
|
+
onClose: n,
|
|
1016
1016
|
title: r.details_title,
|
|
1017
1017
|
children: /* @__PURE__ */ s(w, { bgcolor: "background.default", children: [
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
1019
|
-
/* @__PURE__ */ e(
|
|
1018
|
+
/* @__PURE__ */ e(Fe, { customDetailsChart: i }),
|
|
1019
|
+
/* @__PURE__ */ e(vt, {})
|
|
1020
1020
|
] })
|
|
1021
1021
|
}
|
|
1022
1022
|
);
|
|
1023
|
-
}, Tt =
|
|
1024
|
-
const { debts:
|
|
1025
|
-
|
|
1026
|
-
user_guid:
|
|
1023
|
+
}, Tt = D(() => {
|
|
1024
|
+
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
|
+
n && (await r({ ...n, extra_payment: o }), n.extra_payment = o, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
|
|
1026
|
+
user_guid: n?.user_guid
|
|
1027
1027
|
}));
|
|
1028
1028
|
}, d = () => {
|
|
1029
1029
|
setTimeout(() => {
|
|
1030
|
-
i(
|
|
1030
|
+
i(n?.extra_payment ?? 0);
|
|
1031
1031
|
}, 250);
|
|
1032
1032
|
};
|
|
1033
1033
|
return /* @__PURE__ */ e(
|
|
1034
1034
|
Q,
|
|
1035
1035
|
{
|
|
1036
1036
|
isSaveDisabled: p,
|
|
1037
|
-
label:
|
|
1037
|
+
label: a.paydown_drawer_extra_payment,
|
|
1038
1038
|
onCancel: d,
|
|
1039
1039
|
onSave: c,
|
|
1040
|
-
primaryText:
|
|
1041
|
-
secondaryText:
|
|
1042
|
-
zeroStateText:
|
|
1040
|
+
primaryText: a.paydown_drawer_extra_payment,
|
|
1041
|
+
secondaryText: k(n?.extra_payment, "0,0"),
|
|
1042
|
+
zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
|
|
1043
1043
|
children: /* @__PURE__ */ e(
|
|
1044
|
-
|
|
1044
|
+
ne,
|
|
1045
1045
|
{
|
|
1046
|
-
amount:
|
|
1046
|
+
amount: o,
|
|
1047
1047
|
autoFocus: !0,
|
|
1048
1048
|
error: p,
|
|
1049
1049
|
fullWidth: !0,
|
|
1050
1050
|
minAmount: 0,
|
|
1051
|
-
setAmount: (
|
|
1052
|
-
sx: { ".MuiTypography-
|
|
1051
|
+
setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
|
|
1052
|
+
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
1053
1053
|
}
|
|
1054
1054
|
)
|
|
1055
1055
|
}
|
|
1056
1056
|
);
|
|
1057
1057
|
}), At = () => {
|
|
1058
|
-
const { debts:
|
|
1058
|
+
const { debts: a } = S(), { totalMonthlyPayments: n } = Z(), { monthlyCashFlowProfile: r } = V(), t = n + Number(r?.extra_payment);
|
|
1059
1059
|
return /* @__PURE__ */ s(w, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
1060
1060
|
/* @__PURE__ */ s(w, { p: 24, children: [
|
|
1061
1061
|
/* @__PURE__ */ s(w, { alignItems: "center", gap: 4, mb: 24, children: [
|
|
1062
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
1063
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "
|
|
1064
|
-
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "
|
|
1062
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
|
|
1063
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: k(n, "0,0") }),
|
|
1064
|
+
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
|
|
1065
1065
|
] }),
|
|
1066
1066
|
/* @__PURE__ */ s(w, { children: [
|
|
1067
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
1068
|
-
/* @__PURE__ */ e(l, { truncate: !1, variant: "
|
|
1067
|
+
/* @__PURE__ */ e(l, { variant: "H3", children: a.paydown_drawer_subtitle }),
|
|
1068
|
+
/* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
|
|
1069
1069
|
] })
|
|
1070
1070
|
] }),
|
|
1071
1071
|
/* @__PURE__ */ e(w, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Tt, {}) }),
|
|
1072
1072
|
/* @__PURE__ */ e(w, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(w, { gap: 4, children: [
|
|
1073
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
1074
|
-
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "
|
|
1073
|
+
/* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
|
|
1074
|
+
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: k(t, "0,0") })
|
|
1075
1075
|
] }) })
|
|
1076
1076
|
] });
|
|
1077
|
-
}, Et =
|
|
1078
|
-
const { debts: r } =
|
|
1077
|
+
}, Et = D(At), It = ({ isOpen: a, onClose: n }) => {
|
|
1078
|
+
const { debts: r } = S();
|
|
1079
1079
|
return /* @__PURE__ */ e(
|
|
1080
1080
|
re,
|
|
1081
1081
|
{
|
|
1082
1082
|
ariaLabelClose: r.paydown_drawer_close_aria,
|
|
1083
|
-
isOpen:
|
|
1084
|
-
onClose:
|
|
1083
|
+
isOpen: a,
|
|
1084
|
+
onClose: n,
|
|
1085
1085
|
title: r.paydown_drawer_title,
|
|
1086
1086
|
children: /* @__PURE__ */ e(Et, {})
|
|
1087
1087
|
}
|
|
1088
1088
|
);
|
|
1089
1089
|
};
|
|
1090
|
-
function
|
|
1090
|
+
function Bt(a, n) {
|
|
1091
1091
|
const r = (t) => {
|
|
1092
1092
|
if (typeof t == "number") return t;
|
|
1093
1093
|
if (t === "!" || t === "✓") return 1 / 0;
|
|
1094
1094
|
throw new Error("Unsupported value");
|
|
1095
1095
|
};
|
|
1096
|
-
return r(
|
|
1096
|
+
return r(a) - r(n);
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1099
|
-
return
|
|
1098
|
+
function Mt(a) {
|
|
1099
|
+
return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
|
|
1100
1100
|
}
|
|
1101
|
-
const Pt = (
|
|
1102
|
-
const
|
|
1101
|
+
const Pt = (a) => {
|
|
1102
|
+
const n = {
|
|
1103
1103
|
text: "#121417",
|
|
1104
1104
|
background: "#FFB252"
|
|
1105
1105
|
};
|
|
1106
|
-
return
|
|
1107
|
-
},
|
|
1108
|
-
const
|
|
1106
|
+
return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
|
|
1107
|
+
}, kt = (a) => {
|
|
1108
|
+
const n = String(a.formattedValue), r = Pt(n);
|
|
1109
1109
|
return /* @__PURE__ */ e(
|
|
1110
|
-
|
|
1110
|
+
ae,
|
|
1111
1111
|
{
|
|
1112
1112
|
sx: {
|
|
1113
1113
|
display: "flex",
|
|
@@ -1120,40 +1120,40 @@ const Pt = (n) => {
|
|
|
1120
1120
|
backgroundColor: r.background,
|
|
1121
1121
|
marginLeft: "10px"
|
|
1122
1122
|
},
|
|
1123
|
-
children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "
|
|
1123
|
+
children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: n })
|
|
1124
1124
|
}
|
|
1125
1125
|
);
|
|
1126
|
-
},
|
|
1127
|
-
const
|
|
1126
|
+
}, Nt = (a) => {
|
|
1127
|
+
const n = a.row.account, r = qe[n.account_type];
|
|
1128
1128
|
return /* @__PURE__ */ s(w, { alignItems: "center", flexDirection: "row", children: [
|
|
1129
1129
|
/* @__PURE__ */ e(
|
|
1130
1130
|
Te,
|
|
1131
1131
|
{
|
|
1132
|
-
alt: `${
|
|
1133
|
-
institutionGuid:
|
|
1132
|
+
alt: `${n.institutionName}`,
|
|
1133
|
+
institutionGuid: n.institution_guid || ""
|
|
1134
1134
|
}
|
|
1135
1135
|
),
|
|
1136
1136
|
/* @__PURE__ */ s(w, { ml: 12, children: [
|
|
1137
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
1138
|
-
/* @__PURE__ */ e(l, { variant: "
|
|
1137
|
+
/* @__PURE__ */ e(l, { variant: "Small", children: n.name }),
|
|
1138
|
+
/* @__PURE__ */ e(l, { variant: "XSmall", children: r })
|
|
1139
1139
|
] })
|
|
1140
1140
|
] });
|
|
1141
|
-
},
|
|
1142
|
-
sx:
|
|
1143
|
-
debts:
|
|
1141
|
+
}, Ft = ({
|
|
1142
|
+
sx: a = {},
|
|
1143
|
+
debts: n,
|
|
1144
1144
|
hoveredDebtGuid: r,
|
|
1145
1145
|
onHoverRow: t,
|
|
1146
|
-
onClickRow:
|
|
1146
|
+
onClickRow: o
|
|
1147
1147
|
}) => {
|
|
1148
|
-
const i =
|
|
1148
|
+
const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, u] = g.useState([
|
|
1149
1149
|
{ field: "priority", sort: "asc" }
|
|
1150
1150
|
]), x = [
|
|
1151
1151
|
{
|
|
1152
1152
|
field: "priority",
|
|
1153
1153
|
headerName: d.table_column_priority,
|
|
1154
1154
|
renderHeader: j,
|
|
1155
|
-
renderCell:
|
|
1156
|
-
sortComparator:
|
|
1155
|
+
renderCell: kt,
|
|
1156
|
+
sortComparator: Bt,
|
|
1157
1157
|
sortable: !0,
|
|
1158
1158
|
hideSortIcons: !0,
|
|
1159
1159
|
type: "custom",
|
|
@@ -1166,7 +1166,7 @@ const Pt = (n) => {
|
|
|
1166
1166
|
field: "account",
|
|
1167
1167
|
headerName: d.table_column_account,
|
|
1168
1168
|
renderHeader: j,
|
|
1169
|
-
renderCell:
|
|
1169
|
+
renderCell: Nt,
|
|
1170
1170
|
sortable: !1,
|
|
1171
1171
|
type: "custom",
|
|
1172
1172
|
align: "left",
|
|
@@ -1178,7 +1178,7 @@ const Pt = (n) => {
|
|
|
1178
1178
|
field: "balance",
|
|
1179
1179
|
headerName: d.table_column_balance,
|
|
1180
1180
|
renderHeader: j,
|
|
1181
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "
|
|
1181
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: k(y.value, "0,0") }),
|
|
1182
1182
|
sortable: !0,
|
|
1183
1183
|
hideSortIcons: c,
|
|
1184
1184
|
type: "number",
|
|
@@ -1191,7 +1191,7 @@ const Pt = (n) => {
|
|
|
1191
1191
|
field: "interest_rate",
|
|
1192
1192
|
headerName: d.table_column_interest_rate,
|
|
1193
1193
|
renderHeader: j,
|
|
1194
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "
|
|
1194
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(y.value) ? "---" : `${Number(y.value).toFixed(2)}%` }),
|
|
1195
1195
|
sortable: !0,
|
|
1196
1196
|
hideSortIcons: c,
|
|
1197
1197
|
type: "number",
|
|
@@ -1204,7 +1204,7 @@ const Pt = (n) => {
|
|
|
1204
1204
|
field: "projected_payoff_date",
|
|
1205
1205
|
headerName: d.table_column_payoff_date,
|
|
1206
1206
|
renderHeader: j,
|
|
1207
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "
|
|
1207
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: y.value ? U(y.value, q.MONTH_SHORT_YEAR) : "---" }),
|
|
1208
1208
|
sortable: !0,
|
|
1209
1209
|
hideSortIcons: c,
|
|
1210
1210
|
type: "number",
|
|
@@ -1217,7 +1217,7 @@ const Pt = (n) => {
|
|
|
1217
1217
|
field: "monthly_payment",
|
|
1218
1218
|
headerName: d.table_column_amount_due,
|
|
1219
1219
|
renderHeader: j,
|
|
1220
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "
|
|
1220
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof y.value == "number" ? k(y.value, "0,0") : "---" }),
|
|
1221
1221
|
sortable: !0,
|
|
1222
1222
|
hideSortIcons: c,
|
|
1223
1223
|
type: "number",
|
|
@@ -1226,7 +1226,7 @@ const Pt = (n) => {
|
|
|
1226
1226
|
minWidth: 122,
|
|
1227
1227
|
flex: 0.6
|
|
1228
1228
|
}
|
|
1229
|
-
],
|
|
1229
|
+
], h = [
|
|
1230
1230
|
...x.slice(0, 3),
|
|
1231
1231
|
{
|
|
1232
1232
|
field: "chevron",
|
|
@@ -1240,20 +1240,20 @@ const Pt = (n) => {
|
|
|
1240
1240
|
headerAlign: "right",
|
|
1241
1241
|
width: 20
|
|
1242
1242
|
}
|
|
1243
|
-
],
|
|
1243
|
+
], v = g.useMemo(() => n.map((y, M) => ({
|
|
1244
1244
|
...y,
|
|
1245
|
-
id:
|
|
1246
|
-
priority:
|
|
1247
|
-
})), [
|
|
1248
|
-
const f = y.target.closest("[data-id]")?.getAttribute("data-id"), E =
|
|
1245
|
+
id: M,
|
|
1246
|
+
priority: Mt(y)
|
|
1247
|
+
})), [n]), B = (y) => {
|
|
1248
|
+
const f = y.target.closest("[data-id]")?.getAttribute("data-id"), E = n[Number(f)];
|
|
1249
1249
|
t?.(E?.guid ?? "");
|
|
1250
|
-
},
|
|
1251
|
-
c ||
|
|
1250
|
+
}, N = (y) => {
|
|
1251
|
+
c || B(y);
|
|
1252
1252
|
}, C = (y) => {
|
|
1253
|
-
c &&
|
|
1254
|
-
}, A = (y) =>
|
|
1253
|
+
c && B(y);
|
|
1254
|
+
}, A = (y) => v.find((M) => M.guid === y)?.id;
|
|
1255
1255
|
return /* @__PURE__ */ e(
|
|
1256
|
-
|
|
1256
|
+
ae,
|
|
1257
1257
|
{
|
|
1258
1258
|
sx: {
|
|
1259
1259
|
height: "100dvh",
|
|
@@ -1261,33 +1261,33 @@ const Pt = (n) => {
|
|
|
1261
1261
|
mt: "15px",
|
|
1262
1262
|
overflowX: "auto",
|
|
1263
1263
|
boxShadow: "none",
|
|
1264
|
-
...
|
|
1264
|
+
...a
|
|
1265
1265
|
},
|
|
1266
1266
|
children: /* @__PURE__ */ e(
|
|
1267
|
-
|
|
1267
|
+
Ue,
|
|
1268
1268
|
{
|
|
1269
|
-
columns: c ?
|
|
1269
|
+
columns: c ? h : x,
|
|
1270
1270
|
disableColumnFilter: !0,
|
|
1271
1271
|
disableColumnMenu: !0,
|
|
1272
1272
|
hideFooter: !0,
|
|
1273
|
-
initialState: { sorting: { sortModel:
|
|
1273
|
+
initialState: { sorting: { sortModel: m } },
|
|
1274
1274
|
onRowClick: (y) => {
|
|
1275
|
-
|
|
1275
|
+
o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
|
|
1276
1276
|
},
|
|
1277
1277
|
onSortModelChange: (y) => {
|
|
1278
|
-
|
|
1278
|
+
u(y), p(T.DEBTS_CLICK_TABLE_SORT);
|
|
1279
1279
|
},
|
|
1280
|
-
rows:
|
|
1280
|
+
rows: v,
|
|
1281
1281
|
slotProps: {
|
|
1282
1282
|
baseIconButton: { color: "secondary", sx: { ml: 8 } },
|
|
1283
1283
|
row: {
|
|
1284
|
-
onMouseEnter:
|
|
1284
|
+
onMouseEnter: N,
|
|
1285
1285
|
onMouseLeave: () => !c && t?.(""),
|
|
1286
1286
|
onTouchStart: C,
|
|
1287
1287
|
onClick: c ? C : void 0
|
|
1288
1288
|
}
|
|
1289
1289
|
},
|
|
1290
|
-
sortModel:
|
|
1290
|
+
sortModel: m,
|
|
1291
1291
|
sortingOrder: ["asc", "desc"],
|
|
1292
1292
|
sx: {
|
|
1293
1293
|
[`& .MuiDataGrid-row[data-id="${A(r)}"]`]: {
|
|
@@ -1299,9 +1299,9 @@ const Pt = (n) => {
|
|
|
1299
1299
|
)
|
|
1300
1300
|
}
|
|
1301
1301
|
);
|
|
1302
|
-
}, Rt = ({ buttonText:
|
|
1303
|
-
const { isDesktop: t, isTablet:
|
|
1304
|
-
return t ||
|
|
1302
|
+
}, Rt = ({ buttonText: a, isOpen: n, onClick: r }) => {
|
|
1303
|
+
const { isDesktop: t, isTablet: o } = Y(), i = n ? "unfold_less" : "unfold_more";
|
|
1304
|
+
return t || o ? /* @__PURE__ */ e(
|
|
1305
1305
|
xe,
|
|
1306
1306
|
{
|
|
1307
1307
|
"aria-controls": "prioritize-debts",
|
|
@@ -1311,7 +1311,7 @@ const Pt = (n) => {
|
|
|
1311
1311
|
onClick: r,
|
|
1312
1312
|
startIcon: /* @__PURE__ */ e(te, { name: i }),
|
|
1313
1313
|
sx: { justifyContent: "start", minWidth: 214, mx: 4 },
|
|
1314
|
-
children:
|
|
1314
|
+
children: a
|
|
1315
1315
|
}
|
|
1316
1316
|
) : /* @__PURE__ */ e(
|
|
1317
1317
|
Ze,
|
|
@@ -1324,8 +1324,8 @@ const Pt = (n) => {
|
|
|
1324
1324
|
children: /* @__PURE__ */ e(te, { name: i })
|
|
1325
1325
|
}
|
|
1326
1326
|
);
|
|
1327
|
-
}, Lt =
|
|
1328
|
-
const { onEvent: r } =
|
|
1327
|
+
}, Lt = D(({ buttonEl: a, onClose: n }) => {
|
|
1328
|
+
const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = L(), p = !!a, c = [
|
|
1329
1329
|
{
|
|
1330
1330
|
priority: P.FASTEST_PAYOFF_FIRST,
|
|
1331
1331
|
text: t.priority_sort_fastest_payoff
|
|
@@ -1342,31 +1342,31 @@ const Pt = (n) => {
|
|
|
1342
1342
|
priority: P.HIGHEST_BALANCE,
|
|
1343
1343
|
text: t.priority_sort_highest_balance
|
|
1344
1344
|
}
|
|
1345
|
-
], d = (
|
|
1346
|
-
i(
|
|
1345
|
+
], d = (m) => {
|
|
1346
|
+
i(m), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: m });
|
|
1347
1347
|
};
|
|
1348
1348
|
return /* @__PURE__ */ e(
|
|
1349
1349
|
Qe,
|
|
1350
1350
|
{
|
|
1351
|
-
anchorEl:
|
|
1351
|
+
anchorEl: a,
|
|
1352
1352
|
anchorOrigin: {
|
|
1353
1353
|
vertical: "bottom",
|
|
1354
1354
|
horizontal: "left"
|
|
1355
1355
|
},
|
|
1356
1356
|
id: "prioritize-debts",
|
|
1357
|
-
onClose:
|
|
1357
|
+
onClose: n,
|
|
1358
1358
|
open: p,
|
|
1359
1359
|
transformOrigin: {
|
|
1360
1360
|
vertical: "top",
|
|
1361
1361
|
horizontal: "left"
|
|
1362
1362
|
},
|
|
1363
|
-
children: /* @__PURE__ */ e(ye, { children: c.map(({ priority:
|
|
1363
|
+
children: /* @__PURE__ */ e(ye, { children: c.map(({ priority: m, text: u }) => /* @__PURE__ */ s(
|
|
1364
1364
|
Je,
|
|
1365
1365
|
{
|
|
1366
|
-
onClick: () => d(
|
|
1366
|
+
onClick: () => d(m),
|
|
1367
1367
|
sx: {
|
|
1368
|
-
bgcolor:
|
|
1369
|
-
color:
|
|
1368
|
+
bgcolor: o === m ? "primary.main" : void 0,
|
|
1369
|
+
color: o === m ? "#fff" : void 0,
|
|
1370
1370
|
justifyContent: "space-between",
|
|
1371
1371
|
minHeight: 44,
|
|
1372
1372
|
minWidth: 268,
|
|
@@ -1379,68 +1379,68 @@ const Pt = (n) => {
|
|
|
1379
1379
|
}
|
|
1380
1380
|
},
|
|
1381
1381
|
children: [
|
|
1382
|
-
/* @__PURE__ */ e(l, { color: "inherit", variant: "
|
|
1383
|
-
|
|
1382
|
+
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: u }),
|
|
1383
|
+
o === m && /* @__PURE__ */ e(fe, { color: "inherit", filled: !0, fontSize: "small" })
|
|
1384
1384
|
]
|
|
1385
1385
|
},
|
|
1386
|
-
|
|
1386
|
+
m
|
|
1387
1387
|
)) })
|
|
1388
1388
|
}
|
|
1389
1389
|
);
|
|
1390
|
-
}), $t =
|
|
1391
|
-
const { onEvent:
|
|
1392
|
-
|
|
1390
|
+
}), $t = D(() => {
|
|
1391
|
+
const { onEvent: a } = F(), { debts: n } = S(), { selectedDebtPriority: r } = L(), [t, o] = g.useState(null), i = (m) => {
|
|
1392
|
+
o(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
|
|
1393
1393
|
}, p = () => {
|
|
1394
|
-
|
|
1394
|
+
o(null);
|
|
1395
1395
|
}, c = !!t, d = g.useMemo(() => ({
|
|
1396
|
-
[P.FASTEST_PAYOFF_FIRST]:
|
|
1397
|
-
[P.HIGHEST_INTEREST]:
|
|
1398
|
-
[P.HIGHEST_BALANCE]:
|
|
1399
|
-
[P.LOWEST_BALANCE]:
|
|
1400
|
-
})[r] ??
|
|
1396
|
+
[P.FASTEST_PAYOFF_FIRST]: n.priority_sort_fastest_payoff,
|
|
1397
|
+
[P.HIGHEST_INTEREST]: n.priority_sort_highest_interest,
|
|
1398
|
+
[P.HIGHEST_BALANCE]: n.priority_sort_highest_balance,
|
|
1399
|
+
[P.LOWEST_BALANCE]: n.priority_sort_lowest_balance
|
|
1400
|
+
})[r] ?? n.priority_sort_lowest_balance, [r]);
|
|
1401
1401
|
return /* @__PURE__ */ s(_, { children: [
|
|
1402
1402
|
/* @__PURE__ */ e(Rt, { buttonText: d, isOpen: c, onClick: i }),
|
|
1403
1403
|
/* @__PURE__ */ e(Lt, { buttonEl: t, onClose: p })
|
|
1404
1404
|
] });
|
|
1405
|
-
}),
|
|
1406
|
-
const t =
|
|
1407
|
-
ge(t,
|
|
1408
|
-
const
|
|
1405
|
+
}), Ht = (a, n, r = 0) => {
|
|
1406
|
+
const t = a.map((d) => ({ ...d }));
|
|
1407
|
+
ge(t, n);
|
|
1408
|
+
const o = /* @__PURE__ */ new Date(), i = [];
|
|
1409
1409
|
let p = 0, c = 1;
|
|
1410
1410
|
for (const d of t)
|
|
1411
1411
|
i.push({
|
|
1412
1412
|
...d,
|
|
1413
1413
|
// Start with the initial balance
|
|
1414
|
-
dataset: [{ x: new Date(
|
|
1414
|
+
dataset: [{ x: new Date(o), y: d.balance }]
|
|
1415
1415
|
});
|
|
1416
1416
|
for (; t.some((d) => d.balance >= 0.01 && !d.is_impossible); ) {
|
|
1417
|
-
let d = !1,
|
|
1418
|
-
for (const [x,
|
|
1419
|
-
if (
|
|
1420
|
-
const
|
|
1421
|
-
let y = A,
|
|
1422
|
-
!
|
|
1423
|
-
const b = Math.min(
|
|
1417
|
+
let d = !1, m = !1, u = !1;
|
|
1418
|
+
for (const [x, h] of t.entries()) {
|
|
1419
|
+
if (h.balance <= 0.01) continue;
|
|
1420
|
+
const v = i[x].dataset, N = (h.interest_rate ?? 0) / 100 / 12, C = h.balance * N, A = h.monthly_payment ?? 0;
|
|
1421
|
+
let y = A, M = 0;
|
|
1422
|
+
!u && r > 0 && (y += r, u = !0), !m && p > 0 && (M = p, m = !0), h.balance += C;
|
|
1423
|
+
const b = Math.min(h.balance, y + M);
|
|
1424
1424
|
if (b <= C) {
|
|
1425
|
-
|
|
1425
|
+
h.is_impossible = !0, i[x].is_impossible = !0, i[x].priority = void 0, v.push({ x: new Date(o), y: h.balance });
|
|
1426
1426
|
continue;
|
|
1427
1427
|
}
|
|
1428
|
-
|
|
1429
|
-
x: new Date(
|
|
1430
|
-
y: Math.max(0,
|
|
1428
|
+
h.balance -= b, h.balance = h.balance < 0.01 ? 0 : h.balance, v.push({
|
|
1429
|
+
x: new Date(o),
|
|
1430
|
+
y: Math.max(0, h.balance),
|
|
1431
1431
|
payment: b,
|
|
1432
|
-
extra:
|
|
1433
|
-
}),
|
|
1432
|
+
extra: M
|
|
1433
|
+
}), h.balance <= 0 && (p += A, i[x].projected_payoff_date = new Date(o)), b > 0 && (d = !0);
|
|
1434
1434
|
}
|
|
1435
|
-
d &&
|
|
1435
|
+
d && o.setMonth(o.getMonth() + 1);
|
|
1436
1436
|
}
|
|
1437
1437
|
return i.forEach((d) => {
|
|
1438
1438
|
(d.interest_rate === void 0 || d.monthly_payment === void 0) && (d.projected_payoff_date = void 0);
|
|
1439
1439
|
}), i.forEach((d) => {
|
|
1440
1440
|
d.priority = !d.is_paid_off && !d.is_impossible ? c++ : void 0;
|
|
1441
1441
|
}), i;
|
|
1442
|
-
},
|
|
1443
|
-
const { debts:
|
|
1442
|
+
}, Ot = D(({ onClick: a }) => {
|
|
1443
|
+
const { debts: n } = S(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = Z(), { monthlyCashFlowProfile: o } = V(), i = t + Number(o?.extra_payment), p = r ? n.paydown_button_long : n.paydown_button_short;
|
|
1444
1444
|
return /* @__PURE__ */ e(
|
|
1445
1445
|
xe,
|
|
1446
1446
|
{
|
|
@@ -1448,47 +1448,47 @@ const Pt = (n) => {
|
|
|
1448
1448
|
"aria-describedby": "extra-paydown",
|
|
1449
1449
|
"aria-haspopup": !0,
|
|
1450
1450
|
"aria-label": "extra-paydown",
|
|
1451
|
-
onClick:
|
|
1451
|
+
onClick: a,
|
|
1452
1452
|
sx: { justifyContent: "start", minWidth: 100, mx: 4 },
|
|
1453
|
-
children: I(p,
|
|
1453
|
+
children: I(p, k(i, "0,0"))
|
|
1454
1454
|
}
|
|
1455
1455
|
);
|
|
1456
|
-
}), Wt = ({ onBackClick:
|
|
1457
|
-
const [r, t] = g.useState(!1), [
|
|
1458
|
-
const
|
|
1459
|
-
return
|
|
1460
|
-
}, [z,
|
|
1456
|
+
}), Wt = ({ onBackClick: a, sx: n }) => {
|
|
1457
|
+
const [r, t] = g.useState(!1), [o, i] = g.useState(!1), [p, c] = g.useState(!1), [d, m] = g.useState(""), { isDesktop: u, isMobile: x } = Y(), { debts: h } = S(), { onEvent: v } = F(), { onLoad: B } = ke(), { isCopyLoaded: N, isInitialized: C, setSelectedAccounts: A } = Ne(), { setSelectedAccount: y } = Re(), { selectedDebtPriority: M, setSelectedDebtChartData: b } = L(), { visibleDebtAccounts: f } = J(), { goalsLoaded: E, loadGoals: $, monthlyCashFlowProfile: R } = V(), { debts: z } = Z(), K = g.useMemo(() => {
|
|
1458
|
+
const O = R?.extra_payment ?? 0;
|
|
1459
|
+
return Ht(z, M, O);
|
|
1460
|
+
}, [z, M, R]);
|
|
1461
1461
|
g.useEffect(() => {
|
|
1462
|
-
A(f),
|
|
1462
|
+
A(f), v(T.DEBTS_VIEW);
|
|
1463
1463
|
}, []), g.useEffect(() => {
|
|
1464
1464
|
A(f);
|
|
1465
1465
|
}, [f]), g.useEffect(() => {
|
|
1466
1466
|
C && $().finally(() => {
|
|
1467
|
-
|
|
1467
|
+
B?.("DebtsWidget");
|
|
1468
1468
|
});
|
|
1469
1469
|
}, [C]);
|
|
1470
|
-
const
|
|
1471
|
-
const
|
|
1472
|
-
|
|
1473
|
-
}, Ce = () =>
|
|
1474
|
-
c(!0),
|
|
1475
|
-
},
|
|
1476
|
-
i(!0),
|
|
1470
|
+
const oe = (O) => m(O), ie = () => {
|
|
1471
|
+
const O = f.find((ee) => ee.guid === d), le = K.find((ee) => ee.guid === d);
|
|
1472
|
+
O && y(O), le && b(le), t(!0);
|
|
1473
|
+
}, Ce = () => v(T.DEBTS_CLICK_FILTER), Se = () => {
|
|
1474
|
+
c(!0), v(T.DEBTS_CLICK_SNOWBALL_CTA);
|
|
1475
|
+
}, ve = () => {
|
|
1476
|
+
i(!0), v(T.DEBTS_CLICK_PAYDOWN);
|
|
1477
1477
|
};
|
|
1478
|
-
return !E || !
|
|
1478
|
+
return !E || !N || !C ? /* @__PURE__ */ e(et, {}) : /* @__PURE__ */ s(
|
|
1479
1479
|
Ge,
|
|
1480
1480
|
{
|
|
1481
1481
|
accountOptions: f,
|
|
1482
1482
|
actions: [
|
|
1483
1483
|
/* @__PURE__ */ e($t, {}, "prioritize-debts"),
|
|
1484
|
-
/* @__PURE__ */ e(
|
|
1484
|
+
/* @__PURE__ */ e(Ot, { onClick: ve }, "extra-paydown")
|
|
1485
1485
|
],
|
|
1486
1486
|
onAccountsFilterClick: Ce,
|
|
1487
|
-
onBackClick:
|
|
1488
|
-
sx:
|
|
1489
|
-
title:
|
|
1487
|
+
onBackClick: a,
|
|
1488
|
+
sx: n,
|
|
1489
|
+
title: h.title,
|
|
1490
1490
|
children: [
|
|
1491
|
-
/* @__PURE__ */ s(w, { sx: { px:
|
|
1491
|
+
/* @__PURE__ */ s(w, { sx: { px: u ? "48px" : "24px" }, children: [
|
|
1492
1492
|
/* @__PURE__ */ s(
|
|
1493
1493
|
w,
|
|
1494
1494
|
{
|
|
@@ -1501,19 +1501,19 @@ const Pt = (n) => {
|
|
|
1501
1501
|
/* @__PURE__ */ e(
|
|
1502
1502
|
we,
|
|
1503
1503
|
{
|
|
1504
|
-
debts:
|
|
1504
|
+
debts: K,
|
|
1505
1505
|
height: x ? 250 : void 0,
|
|
1506
1506
|
hoveredDebtGuid: d,
|
|
1507
1507
|
onClickArea: ie,
|
|
1508
|
-
onHoverArea:
|
|
1508
|
+
onHoverArea: oe,
|
|
1509
1509
|
sx: { mr: x ? "4px" : "-48px" }
|
|
1510
1510
|
}
|
|
1511
1511
|
),
|
|
1512
1512
|
/* @__PURE__ */ e(
|
|
1513
1513
|
lt,
|
|
1514
1514
|
{
|
|
1515
|
-
debts:
|
|
1516
|
-
onClickCta:
|
|
1515
|
+
debts: K,
|
|
1516
|
+
onClickCta: Se,
|
|
1517
1517
|
sx: { mb: x ? "0px" : "64px" }
|
|
1518
1518
|
}
|
|
1519
1519
|
)
|
|
@@ -1521,12 +1521,12 @@ const Pt = (n) => {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
),
|
|
1523
1523
|
/* @__PURE__ */ e(w, { sx: { mx: x ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1524
|
-
|
|
1524
|
+
Ft,
|
|
1525
1525
|
{
|
|
1526
|
-
debts:
|
|
1526
|
+
debts: K,
|
|
1527
1527
|
hoveredDebtGuid: d,
|
|
1528
1528
|
onClickRow: ie,
|
|
1529
|
-
onHoverRow:
|
|
1529
|
+
onHoverRow: oe
|
|
1530
1530
|
}
|
|
1531
1531
|
) })
|
|
1532
1532
|
] }),
|
|
@@ -1537,15 +1537,15 @@ const Pt = (n) => {
|
|
|
1537
1537
|
onClose: () => c(!1)
|
|
1538
1538
|
}
|
|
1539
1539
|
),
|
|
1540
|
-
/* @__PURE__ */ e(
|
|
1541
|
-
/* @__PURE__ */ e(It, { isOpen:
|
|
1540
|
+
/* @__PURE__ */ e(Dt, { isOpen: r, onClose: () => t(!1) }),
|
|
1541
|
+
/* @__PURE__ */ e(It, { isOpen: o, onClose: () => i(!1) })
|
|
1542
1542
|
]
|
|
1543
1543
|
}
|
|
1544
1544
|
);
|
|
1545
|
-
},
|
|
1545
|
+
}, Nr = D(Wt);
|
|
1546
1546
|
export {
|
|
1547
1547
|
we as DebtsChart,
|
|
1548
1548
|
Lr as DebtsStore,
|
|
1549
|
-
|
|
1550
|
-
|
|
1549
|
+
Ft as DebtsTable,
|
|
1550
|
+
Nr as DebtsWidget
|
|
1551
1551
|
};
|