@mx-cartographer/experiences 7.0.29-alpha.mega2 → 7.0.30
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 +6 -1
- package/dist/{AccountDetailsContent-B8BSf9Bj.mjs → AccountDetailsContent-CHtXOmHC.mjs} +5 -5
- package/dist/{AccountDetailsHeader-DXTi1p0V.mjs → AccountDetailsHeader-Dwk01nsY.mjs} +1 -1
- package/dist/{AccountFields-Bxvi1C4Z.mjs → AccountFields-5i77eFJ6.mjs} +31 -27
- package/dist/{AccountListItem-CnE3rCVZ.mjs → AccountListItem-BiST9IgK.mjs} +1 -1
- package/dist/{ManageIncome-BFy5tz8l.mjs → ManageIncome-CFh-N0KK.mjs} +2 -2
- package/dist/{RecurringSettings-FbiLpjT5.mjs → RecurringSettings-C9TjSuS_.mjs} +2 -2
- package/dist/{TransactionDetails-D7Nx839i.mjs → TransactionDetails-C2gYzV0z.mjs} +1 -1
- package/dist/{WidgetContainer-D3Y1NrBT.mjs → WidgetContainer-Bn6JPnY3.mjs} +139 -150
- package/dist/accounts/index.es.js +66 -68
- package/dist/accounts/utils/AccountFields.d.ts +1 -0
- package/dist/budgets/index.es.js +3 -3
- package/dist/cashflow/index.es.js +5 -5
- package/dist/common/index.es.js +531 -566
- package/dist/common/utils/Theme.d.ts +24 -102
- package/dist/debts/components/DebtDrawer.d.ts +1 -2
- package/dist/debts/components/PaydownDrawer.d.ts +1 -2
- package/dist/debts/components/SnowballDrawer.d.ts +1 -2
- package/dist/debts/index.es.js +280 -283
- package/dist/finstrong/index.es.js +2 -2
- package/dist/goals/index.es.js +3 -3
- package/dist/help/index.es.js +1 -1
- package/dist/investments/index.es.js +1 -1
- package/dist/networth/index.es.js +1 -1
- package/dist/recurringtransactions/index.es.js +5 -5
- package/dist/settings/index.es.js +1 -1
- package/dist/spending/index.es.js +2 -2
- package/dist/transactions/index.es.js +3 -3
- package/dist/trends/index.es.js +2 -2
- package/package.json +1 -1
package/dist/debts/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as L } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import g from "react";
|
|
3
3
|
import { observer as S } from "mobx-react-lite";
|
|
4
|
-
import
|
|
4
|
+
import x from "@mui/material/Stack";
|
|
5
5
|
import { useTheme as j, Card as be, Stack as _, Box as O } from "@mui/material";
|
|
6
6
|
import { Text as l, H3 as De, InstitutionLogo as ve, Icon as ee } from "@mxenabled/mxui";
|
|
7
7
|
import { intervalToDuration as Te, formatDuration as Ae } from "date-fns";
|
|
@@ -16,14 +16,14 @@ import { G as Me, x as q, u as C, k as z, f as k, c as Z, a as Pe } from "../hoo
|
|
|
16
16
|
import { u as X } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
17
|
import { D as te } from "../Drawer-kEE73B87.mjs";
|
|
18
18
|
import { b as A } from "../Localization-2MODESHW.mjs";
|
|
19
|
-
import { A as ke, u as Fe } from "../AccountDetailsHeader-
|
|
19
|
+
import { A as ke, u as Fe } from "../AccountDetailsHeader-Dwk01nsY.mjs";
|
|
20
20
|
import Ne from "@mui/material/Card";
|
|
21
21
|
import Re from "@mui/material/CardContent";
|
|
22
22
|
import Le from "@mui/material/CardHeader";
|
|
23
23
|
import { LineChart as $e } from "@mui/x-charts";
|
|
24
24
|
import re from "@mui/material/Box";
|
|
25
25
|
import { useTheme as He } from "@mui/material/styles";
|
|
26
|
-
import { A as T, W as Oe } from "../WidgetContainer-
|
|
26
|
+
import { A as T, W as Oe } from "../WidgetContainer-Bn6JPnY3.mjs";
|
|
27
27
|
import de from "@mui/material/Tab";
|
|
28
28
|
import We from "@mui/material/Tabs";
|
|
29
29
|
import _e from "@mui/material/List";
|
|
@@ -45,27 +45,27 @@ import Ue from "@mui/material/IconButton";
|
|
|
45
45
|
import qe from "@mui/material/ListItem";
|
|
46
46
|
import Ze from "@mui/material/Popover";
|
|
47
47
|
import { L as Je } from "../Loader-DUaFpDGv.mjs";
|
|
48
|
-
const Qe = (a, o = 0,
|
|
49
|
-
if (
|
|
50
|
-
const
|
|
48
|
+
const Qe = (a, o = 0, r = 0) => {
|
|
49
|
+
if (r === 0) return 0;
|
|
50
|
+
const t = o / (Ee * Ie);
|
|
51
51
|
return Math.ceil(
|
|
52
|
-
|
|
52
|
+
t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
|
|
53
53
|
);
|
|
54
|
-
}, et = (a, o,
|
|
54
|
+
}, et = (a, o, r, t, n) => {
|
|
55
55
|
const i = [];
|
|
56
|
-
if (
|
|
57
|
-
for (let
|
|
58
|
-
const
|
|
56
|
+
if (r === 0) {
|
|
57
|
+
for (let d = 0; d < a; d++) {
|
|
58
|
+
const c = o - t * (d + 1), h = o - t * d, m = c >= 0 ? t : h;
|
|
59
59
|
i.push({
|
|
60
|
-
balance:
|
|
61
|
-
interest:
|
|
60
|
+
balance: c >= 0 ? c : 0,
|
|
61
|
+
interest: r,
|
|
62
62
|
payment: m,
|
|
63
63
|
principal: m,
|
|
64
64
|
timestamp: ce(
|
|
65
65
|
le(
|
|
66
|
-
se(
|
|
66
|
+
se(n),
|
|
67
67
|
// convert seconds → Date
|
|
68
|
-
|
|
68
|
+
d + 1
|
|
69
69
|
// add (index + 1) months
|
|
70
70
|
)
|
|
71
71
|
)
|
|
@@ -73,123 +73,123 @@ const Qe = (a, o = 0, n = 0) => {
|
|
|
73
73
|
}
|
|
74
74
|
return i;
|
|
75
75
|
}
|
|
76
|
-
const
|
|
77
|
-
for (let
|
|
78
|
-
const
|
|
76
|
+
const p = r / 1200;
|
|
77
|
+
for (let d = 0; d < a; d++) {
|
|
78
|
+
const c = ce(le(se(n), d + 1)), h = Math.pow(1 + p, d), m = o * h - t * ((h - 1) / p), y = Math.pow(1 + p, d + 1), f = o * y - t * ((y - 1) / p), D = t + Math.min(f, 0), E = m * p;
|
|
79
79
|
i.push({
|
|
80
80
|
balance: Math.max(0, f),
|
|
81
81
|
interest: E,
|
|
82
82
|
payment: D,
|
|
83
83
|
principal: D - E,
|
|
84
|
-
timestamp:
|
|
84
|
+
timestamp: c
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
return i;
|
|
88
88
|
}, tt = (a) => (a[a.length - 1] || {}).timestamp, rt = (a) => {
|
|
89
|
-
const { monthly_payment: o, interest_rate:
|
|
89
|
+
const { monthly_payment: o, interest_rate: r, balance: t, payment_due_date: n } = a, i = Qe(t, r ?? 0, o ?? 0), p = et(
|
|
90
90
|
i,
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
t,
|
|
92
|
+
r ?? 0,
|
|
93
93
|
o ?? 0,
|
|
94
|
-
|
|
95
|
-
),
|
|
94
|
+
n
|
|
95
|
+
), d = tt(p);
|
|
96
96
|
return {
|
|
97
97
|
...a,
|
|
98
|
-
minimumFinalPayment:
|
|
99
|
-
minimumPayments:
|
|
98
|
+
minimumFinalPayment: d,
|
|
99
|
+
minimumPayments: p
|
|
100
100
|
};
|
|
101
|
-
},
|
|
102
|
-
const [
|
|
103
|
-
([
|
|
101
|
+
}, ge = (a, o) => {
|
|
102
|
+
const [r, t] = a.reduce(
|
|
103
|
+
([n, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : n.push(rt(p)), [n, i]),
|
|
104
104
|
[[], []]
|
|
105
105
|
);
|
|
106
106
|
switch (o) {
|
|
107
107
|
case M.FASTEST_PAYOFF_FIRST:
|
|
108
|
-
|
|
108
|
+
r.sort((n, i) => (n.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
|
|
109
109
|
break;
|
|
110
110
|
case M.HIGHEST_INTEREST:
|
|
111
|
-
|
|
111
|
+
r.sort((n, i) => (i.interest_rate ?? 0) - (n.interest_rate ?? 0));
|
|
112
112
|
break;
|
|
113
113
|
case M.LOWEST_BALANCE:
|
|
114
|
-
|
|
114
|
+
r.sort((n, i) => n.balance - i.balance);
|
|
115
115
|
break;
|
|
116
116
|
case M.HIGHEST_BALANCE:
|
|
117
|
-
|
|
117
|
+
r.sort((n, i) => i.balance - n.balance);
|
|
118
118
|
break;
|
|
119
119
|
default:
|
|
120
|
-
|
|
120
|
+
r.sort((n, i) => n.balance - i.balance);
|
|
121
121
|
}
|
|
122
|
-
a.splice(0, a.length, ...
|
|
122
|
+
a.splice(0, a.length, ...r, ...t);
|
|
123
123
|
};
|
|
124
|
-
function at(a, o,
|
|
125
|
-
const
|
|
124
|
+
function at(a, o, r = 0) {
|
|
125
|
+
const t = a.map((m) => ({ ...m })).filter(
|
|
126
126
|
(m) => m.interest_rate !== void 0 && m.monthly_payment !== void 0 && !m.is_paid_off
|
|
127
127
|
);
|
|
128
|
-
|
|
129
|
-
let
|
|
130
|
-
const
|
|
131
|
-
for (;
|
|
128
|
+
ge(t, o);
|
|
129
|
+
let n = 0, i = 0;
|
|
130
|
+
const p = /* @__PURE__ */ new Date(), d = /* @__PURE__ */ new Date();
|
|
131
|
+
for (; t.some((m) => m.balance >= 0.01 && !m.is_impossible); ) {
|
|
132
132
|
let m = !1;
|
|
133
|
-
for (const [y, f] of
|
|
133
|
+
for (const [y, f] of t.entries()) {
|
|
134
134
|
if (f.balance <= 0.01 || f.is_impossible) continue;
|
|
135
135
|
const E = (f.interest_rate ?? 0) / 100 / 12, v = f.balance * E;
|
|
136
136
|
let u = f.monthly_payment ?? 0;
|
|
137
|
-
y === 0 &&
|
|
137
|
+
y === 0 && r && (u += r), f.balance += v;
|
|
138
138
|
const I = Math.min(f.balance, u + i);
|
|
139
139
|
if (I <= v) {
|
|
140
140
|
f.is_impossible = !0;
|
|
141
141
|
continue;
|
|
142
142
|
}
|
|
143
|
-
f.balance -= I, f.balance = f.balance < 0.01 ? 0 : f.balance,
|
|
143
|
+
f.balance -= I, f.balance = f.balance < 0.01 ? 0 : f.balance, n += v, f.balance <= 0 && (i += u), I > 0 && (m = !0);
|
|
144
144
|
}
|
|
145
|
-
m &&
|
|
145
|
+
m && d.setMonth(d.getMonth() + 1);
|
|
146
146
|
}
|
|
147
|
-
const
|
|
147
|
+
const c = t.some((m) => m.is_impossible && m.balance > 0), h = Te({ start: p, end: d });
|
|
148
148
|
return {
|
|
149
|
-
payoffSavings:
|
|
150
|
-
payoffDate:
|
|
151
|
-
payoffDuration:
|
|
149
|
+
payoffSavings: c ? "N/A" : P(n, "0,0.00"),
|
|
150
|
+
payoffDate: c ? "Never" : K(d, U.MONTH_YEAR),
|
|
151
|
+
payoffDuration: c ? "Stagnant" : Ae(h, { format: ["years", "months"] }) || "0 months"
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
const R = () => {
|
|
155
|
-
if (!
|
|
155
|
+
if (!g.useContext(Me))
|
|
156
156
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
157
157
|
return q().uiStore;
|
|
158
|
-
}, ot = ({ debts: a, onClickCta: o, sx:
|
|
159
|
-
const
|
|
160
|
-
const y =
|
|
161
|
-
return at(a,
|
|
162
|
-
}, [a,
|
|
158
|
+
}, ot = ({ debts: a, onClickCta: o, sx: r }) => {
|
|
159
|
+
const t = j(), { isMobile: n } = X(), { debts: i } = C(), { selectedDebtPriority: p } = R(), { monthlyCashFlowProfile: d } = z(), { payoffDate: c, payoffSavings: h, payoffDuration: m } = g.useMemo(() => {
|
|
160
|
+
const y = d?.extra_payment ?? 0;
|
|
161
|
+
return at(a, p, y);
|
|
162
|
+
}, [a, p, d]);
|
|
163
163
|
return /* @__PURE__ */ e(
|
|
164
164
|
be,
|
|
165
165
|
{
|
|
166
166
|
sx: {
|
|
167
|
-
boxShadow:
|
|
168
|
-
width:
|
|
167
|
+
boxShadow: t.shadows[2],
|
|
168
|
+
width: n ? "100%" : "186px",
|
|
169
169
|
minWidth: "186px",
|
|
170
|
-
...
|
|
170
|
+
...r
|
|
171
171
|
},
|
|
172
172
|
children: /* @__PURE__ */ s(_, { sx: { gap: "12px", p: "16px" }, children: [
|
|
173
173
|
/* @__PURE__ */ s(
|
|
174
174
|
_,
|
|
175
175
|
{
|
|
176
|
-
gap:
|
|
176
|
+
gap: n ? "4px" : "0",
|
|
177
177
|
sx: {
|
|
178
178
|
borderBottom: "1px solid",
|
|
179
|
-
borderBottomColor:
|
|
179
|
+
borderBottomColor: t.palette.grey[300],
|
|
180
180
|
pb: "8px"
|
|
181
181
|
},
|
|
182
182
|
children: [
|
|
183
183
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_date_description }),
|
|
184
|
-
/* @__PURE__ */ e(l, { bold: !0, color:
|
|
184
|
+
/* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "Small", children: c })
|
|
185
185
|
]
|
|
186
186
|
}
|
|
187
187
|
),
|
|
188
|
-
/* @__PURE__ */ s(_, { gap:
|
|
188
|
+
/* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
|
|
189
189
|
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: h }),
|
|
190
190
|
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
|
|
191
191
|
] }),
|
|
192
|
-
/* @__PURE__ */ s(_, { gap:
|
|
192
|
+
/* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
|
|
193
193
|
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: m }),
|
|
194
194
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
|
|
195
195
|
] }),
|
|
@@ -197,7 +197,7 @@ const R = () => {
|
|
|
197
197
|
l,
|
|
198
198
|
{
|
|
199
199
|
bold: !0,
|
|
200
|
-
color:
|
|
200
|
+
color: t.palette.primary.main,
|
|
201
201
|
onClick: o,
|
|
202
202
|
sx: { cursor: "pointer" },
|
|
203
203
|
variant: "Small",
|
|
@@ -207,15 +207,14 @@ const R = () => {
|
|
|
207
207
|
] })
|
|
208
208
|
}
|
|
209
209
|
);
|
|
210
|
-
}, nt = S(ot), it = ({ isOpen: a, onClose: o
|
|
211
|
-
const r = j(), { debts: t } = C(), [
|
|
210
|
+
}, nt = S(ot), it = ({ isOpen: a, onClose: o }) => {
|
|
211
|
+
const r = j(), { debts: t } = C(), [n, i] = g.useState(!1);
|
|
212
212
|
return /* @__PURE__ */ e(
|
|
213
213
|
te,
|
|
214
214
|
{
|
|
215
215
|
ariaLabelClose: "",
|
|
216
216
|
isOpen: a,
|
|
217
217
|
onClose: o,
|
|
218
|
-
sx: { ...n },
|
|
219
218
|
title: t.snowball_drawer_title,
|
|
220
219
|
children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
|
|
221
220
|
/* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
|
|
@@ -232,7 +231,7 @@ const R = () => {
|
|
|
232
231
|
{
|
|
233
232
|
color: r.palette.secondary.main,
|
|
234
233
|
mb: 8,
|
|
235
|
-
sx: { whiteSpace:
|
|
234
|
+
sx: { whiteSpace: n ? "normal" : "nowrap" },
|
|
236
235
|
variant: "ParagraphSmall",
|
|
237
236
|
children: t.snowball_drawer_answer
|
|
238
237
|
}
|
|
@@ -242,10 +241,10 @@ const R = () => {
|
|
|
242
241
|
{
|
|
243
242
|
bold: !0,
|
|
244
243
|
color: r.palette.primary.main,
|
|
245
|
-
onClick: () =>
|
|
244
|
+
onClick: () => i(!n),
|
|
246
245
|
sx: { cursor: "pointer" },
|
|
247
246
|
variant: "Small",
|
|
248
|
-
children:
|
|
247
|
+
children: n ? t.snowball_drawer_less : t.snowball_drawer_more
|
|
249
248
|
}
|
|
250
249
|
)
|
|
251
250
|
] })
|
|
@@ -571,23 +570,23 @@ const R = () => {
|
|
|
571
570
|
);
|
|
572
571
|
}, lt = S(it), st = "#FF7B08";
|
|
573
572
|
function ct(a, o) {
|
|
574
|
-
const [
|
|
575
|
-
Math.max(0, Math.min(255, Math.round(n * o))),
|
|
573
|
+
const [r, t, n] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
|
|
576
574
|
Math.max(0, Math.min(255, Math.round(r * o))),
|
|
577
|
-
Math.max(0, Math.min(255, Math.round(t * o)))
|
|
575
|
+
Math.max(0, Math.min(255, Math.round(t * o))),
|
|
576
|
+
Math.max(0, Math.min(255, Math.round(n * o)))
|
|
578
577
|
];
|
|
579
578
|
return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
|
|
580
579
|
}
|
|
581
|
-
const
|
|
580
|
+
const xe = ({
|
|
582
581
|
sx: a,
|
|
583
582
|
height: o = 500,
|
|
584
|
-
width:
|
|
585
|
-
debts:
|
|
586
|
-
hoveredDebtGuid:
|
|
583
|
+
width: r,
|
|
584
|
+
debts: t,
|
|
585
|
+
hoveredDebtGuid: n,
|
|
587
586
|
onClickArea: i,
|
|
588
|
-
onHoverArea:
|
|
587
|
+
onHoverArea: p
|
|
589
588
|
}) => {
|
|
590
|
-
const
|
|
589
|
+
const d = He(), { onEvent: c } = k(), h = t.filter((b) => !b.is_impossible), m = [
|
|
591
590
|
...new Set(
|
|
592
591
|
h.flatMap((b) => b.dataset.map((w) => new Date(w.x).getTime()))
|
|
593
592
|
)
|
|
@@ -624,7 +623,7 @@ const ge = ({
|
|
|
624
623
|
id: "payoff-line",
|
|
625
624
|
label: "Payoff Line",
|
|
626
625
|
data: D.map((b) => b.y),
|
|
627
|
-
color:
|
|
626
|
+
color: d.palette.grey[700],
|
|
628
627
|
curve: "linear",
|
|
629
628
|
type: "line",
|
|
630
629
|
stack: void 0,
|
|
@@ -656,11 +655,11 @@ const ge = ({
|
|
|
656
655
|
onAreaClick: (b, w) => {
|
|
657
656
|
i?.();
|
|
658
657
|
const B = u.find((F) => F.id === w.seriesId);
|
|
659
|
-
|
|
658
|
+
c(T.DEBTS_CLICK_CHART_AREA, { account_guid: B?.guid });
|
|
660
659
|
},
|
|
661
660
|
onHighlightChange: (b) => {
|
|
662
661
|
const w = u.find((B) => B.id === b?.seriesId)?.guid;
|
|
663
|
-
|
|
662
|
+
p?.(w ?? "");
|
|
664
663
|
},
|
|
665
664
|
series: u,
|
|
666
665
|
skipAnimation: !0,
|
|
@@ -686,16 +685,16 @@ const ge = ({
|
|
|
686
685
|
strokeDasharray: "10 5",
|
|
687
686
|
strokeWidth: 1
|
|
688
687
|
},
|
|
689
|
-
[`& .MuiLineElement-series-debt-${I(
|
|
688
|
+
[`& .MuiLineElement-series-debt-${I(n ?? "0")}`]: {
|
|
690
689
|
opacity: 1
|
|
691
690
|
},
|
|
692
|
-
[`& .MuiAreaElement-series-debt-${I(
|
|
691
|
+
[`& .MuiAreaElement-series-debt-${I(n ?? "0")}`]: {
|
|
693
692
|
opacity: 1
|
|
694
693
|
},
|
|
695
694
|
...a
|
|
696
695
|
},
|
|
697
696
|
tooltip: { trigger: "none" },
|
|
698
|
-
width:
|
|
697
|
+
width: r,
|
|
699
698
|
xAxis: [
|
|
700
699
|
{
|
|
701
700
|
data: v,
|
|
@@ -718,7 +717,7 @@ const ge = ({
|
|
|
718
717
|
}
|
|
719
718
|
);
|
|
720
719
|
}, dt = () => {
|
|
721
|
-
const a = j(), { debts: o } = C(), { selectedDebtChartData:
|
|
720
|
+
const a = j(), { debts: o } = C(), { selectedDebtChartData: r } = R();
|
|
722
721
|
return /* @__PURE__ */ s(L, { children: [
|
|
723
722
|
/* @__PURE__ */ s(
|
|
724
723
|
Ne,
|
|
@@ -730,7 +729,7 @@ const ge = ({
|
|
|
730
729
|
},
|
|
731
730
|
children: [
|
|
732
731
|
/* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(De, { sx: { pb: 4 }, children: o.details_chart_title }) }),
|
|
733
|
-
/* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(
|
|
732
|
+
/* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(xe, { debts: [r], height: 250 }) })
|
|
734
733
|
]
|
|
735
734
|
}
|
|
736
735
|
),
|
|
@@ -745,23 +744,23 @@ const ge = ({
|
|
|
745
744
|
)
|
|
746
745
|
] });
|
|
747
746
|
}, pt = S(dt), mt = () => {
|
|
748
|
-
const a = j(), { onEvent: o } = k(), { debts:
|
|
749
|
-
return
|
|
747
|
+
const a = j(), { onEvent: o } = k(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: n, showError: i } = R();
|
|
748
|
+
return g.useEffect(() => o(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || n ? /* @__PURE__ */ e(
|
|
750
749
|
l,
|
|
751
750
|
{
|
|
752
751
|
color: a.palette.secondary.main,
|
|
753
752
|
component: "div",
|
|
754
753
|
sx: { p: 32, textAlign: "center", whiteSpace: "normal" },
|
|
755
754
|
variant: "Small",
|
|
756
|
-
children: i ?
|
|
755
|
+
children: i ? r.schedule_error_message : r.schedule_complete_message
|
|
757
756
|
}
|
|
758
757
|
) : /* @__PURE__ */ s(L, { children: [
|
|
759
|
-
/* @__PURE__ */ s(
|
|
760
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children:
|
|
761
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children:
|
|
758
|
+
/* @__PURE__ */ s(x, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
759
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_month_heading }),
|
|
760
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_amount_heading })
|
|
762
761
|
] }),
|
|
763
|
-
|
|
764
|
-
|
|
762
|
+
t.dataset.slice(1).map(({ x: p, y: d, payment: c }) => /* @__PURE__ */ e(x, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(x, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
|
|
763
|
+
x,
|
|
765
764
|
{
|
|
766
765
|
sx: {
|
|
767
766
|
borderBottom: `1px solid ${a.palette.border.light}`,
|
|
@@ -771,12 +770,12 @@ const ge = ({
|
|
|
771
770
|
pr: 24
|
|
772
771
|
},
|
|
773
772
|
children: [
|
|
774
|
-
/* @__PURE__ */ s(
|
|
775
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: K(
|
|
776
|
-
/* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children:
|
|
773
|
+
/* @__PURE__ */ s(x, { flexGrow: 1, children: [
|
|
774
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: K(p, U.MONTH_YEAR) }),
|
|
775
|
+
/* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
|
|
777
776
|
] }),
|
|
778
|
-
/* @__PURE__ */ s(
|
|
779
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: P(
|
|
777
|
+
/* @__PURE__ */ s(x, { children: [
|
|
778
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: P(d, "0,0.00") }),
|
|
780
779
|
/* @__PURE__ */ e(
|
|
781
780
|
l,
|
|
782
781
|
{
|
|
@@ -784,15 +783,15 @@ const ge = ({
|
|
|
784
783
|
color: a.palette.success.main,
|
|
785
784
|
textAlign: "end",
|
|
786
785
|
variant: "Tiny",
|
|
787
|
-
children: `+${P(
|
|
786
|
+
children: `+${P(c, "0,0")}`
|
|
788
787
|
}
|
|
789
788
|
)
|
|
790
789
|
] })
|
|
791
790
|
]
|
|
792
791
|
}
|
|
793
|
-
) }) }, String(
|
|
794
|
-
/* @__PURE__ */ e(
|
|
795
|
-
|
|
792
|
+
) }) }, String(p))),
|
|
793
|
+
/* @__PURE__ */ e(x, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
|
|
794
|
+
x,
|
|
796
795
|
{
|
|
797
796
|
sx: {
|
|
798
797
|
alignItems: "center",
|
|
@@ -802,16 +801,16 @@ const ge = ({
|
|
|
802
801
|
px: 24
|
|
803
802
|
},
|
|
804
803
|
children: [
|
|
805
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children:
|
|
804
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: r.schedule_payoff_label }),
|
|
806
805
|
/* @__PURE__ */ e(l, { variant: "Body", children: "-" })
|
|
807
806
|
]
|
|
808
807
|
}
|
|
809
808
|
) })
|
|
810
809
|
] }) });
|
|
811
810
|
}, ht = S(mt), ut = S(({ debt: a }) => {
|
|
812
|
-
const { debts: o } = C(), { updateAccount:
|
|
813
|
-
await
|
|
814
|
-
},
|
|
811
|
+
const { debts: o } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [n, i] = g.useState(a.interest_rate ?? 0), p = n < 0, d = async () => {
|
|
812
|
+
await r({ ...a.account, interest_rate: n }), a.interest_rate = n, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
|
|
813
|
+
}, c = () => {
|
|
815
814
|
setTimeout(() => {
|
|
816
815
|
i(a.interest_rate ?? 0);
|
|
817
816
|
}, 250);
|
|
@@ -819,29 +818,29 @@ const ge = ({
|
|
|
819
818
|
return /* @__PURE__ */ e(
|
|
820
819
|
J,
|
|
821
820
|
{
|
|
822
|
-
isSaveDisabled:
|
|
821
|
+
isSaveDisabled: p,
|
|
823
822
|
label: `${o.details_interest_rate} (%)`,
|
|
824
|
-
onCancel:
|
|
825
|
-
onSave:
|
|
823
|
+
onCancel: c,
|
|
824
|
+
onSave: d,
|
|
826
825
|
primaryText: o.details_interest_rate,
|
|
827
826
|
secondaryText: Be(Number(a.interest_rate) / 100),
|
|
828
827
|
zeroStateText: a.interest_rate ? void 0 : o.add_interest_rate,
|
|
829
828
|
children: /* @__PURE__ */ e(
|
|
830
829
|
Xe,
|
|
831
830
|
{
|
|
832
|
-
error:
|
|
831
|
+
error: p,
|
|
833
832
|
fullWidth: !0,
|
|
834
833
|
onChange: (h) => i(isNaN(parseFloat(h.target.value)) ? 0 : parseFloat(h.target.value)),
|
|
835
834
|
type: "number",
|
|
836
|
-
value:
|
|
835
|
+
value: n
|
|
837
836
|
}
|
|
838
837
|
)
|
|
839
838
|
}
|
|
840
839
|
);
|
|
841
840
|
}), bt = S(({ debt: a }) => {
|
|
842
|
-
const { debts: o } = C(), { updateAccount:
|
|
843
|
-
await
|
|
844
|
-
},
|
|
841
|
+
const { debts: o } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [n, i] = g.useState(a.monthly_payment ?? 0), p = n < 0 || n > 9999999999e-2, d = async () => {
|
|
842
|
+
await r({ ...a.account, minimum_payment: n }), a.monthly_payment = n, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
|
|
843
|
+
}, c = () => {
|
|
845
844
|
setTimeout(() => {
|
|
846
845
|
i(a.monthly_payment ?? 0);
|
|
847
846
|
}, 250);
|
|
@@ -849,31 +848,31 @@ const ge = ({
|
|
|
849
848
|
return /* @__PURE__ */ e(
|
|
850
849
|
J,
|
|
851
850
|
{
|
|
852
|
-
isSaveDisabled:
|
|
851
|
+
isSaveDisabled: p,
|
|
853
852
|
label: o.details_monthly_payment,
|
|
854
|
-
onCancel:
|
|
855
|
-
onSave:
|
|
853
|
+
onCancel: c,
|
|
854
|
+
onSave: d,
|
|
856
855
|
primaryText: o.details_monthly_payment,
|
|
857
856
|
secondaryText: P(a.monthly_payment, "0,0"),
|
|
858
857
|
zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
|
|
859
858
|
children: /* @__PURE__ */ e(
|
|
860
859
|
ae,
|
|
861
860
|
{
|
|
862
|
-
amount:
|
|
861
|
+
amount: n,
|
|
863
862
|
autoFocus: !0,
|
|
864
|
-
error:
|
|
863
|
+
error: p,
|
|
865
864
|
fullWidth: !0,
|
|
866
865
|
minAmount: 0,
|
|
867
|
-
setAmount: (h) => i(isNaN(Number(h)) ?
|
|
866
|
+
setAmount: (h) => i(isNaN(Number(h)) ? n : Number(h)),
|
|
868
867
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
869
868
|
}
|
|
870
869
|
)
|
|
871
870
|
}
|
|
872
871
|
);
|
|
873
872
|
}), _t = S(({ debt: a }) => {
|
|
874
|
-
const { debts: o } = C(), { updateAccount:
|
|
875
|
-
await
|
|
876
|
-
},
|
|
873
|
+
const { debts: o } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [n, i] = g.useState(a.original_balance ?? 0), p = n < 0 || n > 9999999999e-2, d = async () => {
|
|
874
|
+
await r({ ...a.account, original_balance: n }), a.original_balance = n, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
|
|
875
|
+
}, c = () => {
|
|
877
876
|
setTimeout(() => {
|
|
878
877
|
i(a.original_balance ?? 0);
|
|
879
878
|
}, 250);
|
|
@@ -881,22 +880,22 @@ const ge = ({
|
|
|
881
880
|
return /* @__PURE__ */ e(
|
|
882
881
|
J,
|
|
883
882
|
{
|
|
884
|
-
isSaveDisabled:
|
|
883
|
+
isSaveDisabled: p,
|
|
885
884
|
label: o.details_original_balance,
|
|
886
|
-
onCancel:
|
|
887
|
-
onSave:
|
|
885
|
+
onCancel: c,
|
|
886
|
+
onSave: d,
|
|
888
887
|
primaryText: o.details_original_balance,
|
|
889
888
|
secondaryText: P(a.original_balance, "0,0"),
|
|
890
889
|
zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
|
|
891
890
|
children: /* @__PURE__ */ e(
|
|
892
891
|
ae,
|
|
893
892
|
{
|
|
894
|
-
amount:
|
|
893
|
+
amount: n,
|
|
895
894
|
autoFocus: !0,
|
|
896
|
-
error:
|
|
895
|
+
error: p,
|
|
897
896
|
fullWidth: !0,
|
|
898
897
|
minAmount: 0,
|
|
899
|
-
setAmount: (h) => i(isNaN(Number(h)) ?
|
|
898
|
+
setAmount: (h) => i(isNaN(Number(h)) ? n : Number(h)),
|
|
900
899
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
901
900
|
}
|
|
902
901
|
)
|
|
@@ -904,7 +903,7 @@ const ge = ({
|
|
|
904
903
|
);
|
|
905
904
|
}), yt = () => {
|
|
906
905
|
const { onEvent: a } = k(), { selectedDebtChartData: o } = R();
|
|
907
|
-
return
|
|
906
|
+
return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(x, { bgcolor: "background.paper", children: [
|
|
908
907
|
o?.goal && /* @__PURE__ */ s(L, { children: [
|
|
909
908
|
/* @__PURE__ */ e(Ge, { goal: o.goal }),
|
|
910
909
|
/* @__PURE__ */ e(W, {}),
|
|
@@ -922,33 +921,33 @@ const ge = ({
|
|
|
922
921
|
/* @__PURE__ */ e(W, {})
|
|
923
922
|
] })
|
|
924
923
|
] });
|
|
925
|
-
}, ft = S(yt),
|
|
926
|
-
const { debts:
|
|
927
|
-
return
|
|
928
|
-
|
|
929
|
-
}, [
|
|
924
|
+
}, ft = S(yt), gt = ({ setTabValue: a, sx: o }) => {
|
|
925
|
+
const { debts: r } = C(), { showError: t, showCompleted: n } = R();
|
|
926
|
+
return g.useEffect(() => {
|
|
927
|
+
t && a(1);
|
|
928
|
+
}, [t]), !t && !n ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ s(x, { gap: 16, children: [
|
|
930
929
|
/* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
|
|
931
930
|
pe,
|
|
932
931
|
{
|
|
933
|
-
icon:
|
|
932
|
+
icon: t ? /* @__PURE__ */ e(Ve, { filled: !0 }) : /* @__PURE__ */ e(ye, { color: "success", filled: !0 }),
|
|
934
933
|
severity: "error",
|
|
935
934
|
sx: {
|
|
936
935
|
alignItems: "start",
|
|
937
936
|
borderLeft: 5,
|
|
938
937
|
borderRadius: 1,
|
|
939
|
-
borderColor:
|
|
938
|
+
borderColor: t ? "error.main" : "success.main",
|
|
940
939
|
color: "text.primary",
|
|
941
940
|
"&.MuiPaper-root": {
|
|
942
941
|
backgroundColor: "background.paper"
|
|
943
942
|
}
|
|
944
943
|
},
|
|
945
944
|
children: [
|
|
946
|
-
/* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children:
|
|
947
|
-
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children:
|
|
945
|
+
/* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: t ? r.status_error_title : r.status_complete_title }),
|
|
946
|
+
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: t ? r.status_error_description : r.status_complete_description })
|
|
948
947
|
]
|
|
949
948
|
}
|
|
950
949
|
) }),
|
|
951
|
-
|
|
950
|
+
t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
|
|
952
951
|
pe,
|
|
953
952
|
{
|
|
954
953
|
icon: /* @__PURE__ */ e(L, {}),
|
|
@@ -961,24 +960,24 @@ const ge = ({
|
|
|
961
960
|
}
|
|
962
961
|
},
|
|
963
962
|
children: [
|
|
964
|
-
/* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children:
|
|
965
|
-
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children:
|
|
963
|
+
/* @__PURE__ */ e(me, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: r.status_info_title }),
|
|
964
|
+
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: r.status_info_description })
|
|
966
965
|
]
|
|
967
966
|
}
|
|
968
967
|
) })
|
|
969
968
|
] });
|
|
970
|
-
},
|
|
971
|
-
const { debts: a } = C(), { showError: o, showCompleted:
|
|
969
|
+
}, xt = S(gt), wt = () => {
|
|
970
|
+
const { debts: a } = C(), { showError: o, showCompleted: r } = R(), [t, n] = g.useState(0);
|
|
972
971
|
return /* @__PURE__ */ s(L, { children: [
|
|
973
|
-
(o ||
|
|
972
|
+
(o || r) && /* @__PURE__ */ e(xt, { setTabValue: n, sx: { mt: -24 } }),
|
|
974
973
|
/* @__PURE__ */ s(
|
|
975
974
|
We,
|
|
976
975
|
{
|
|
977
976
|
"aria-label": a.details_tabs_aria_label,
|
|
978
977
|
centered: !0,
|
|
979
|
-
onChange: (i,
|
|
978
|
+
onChange: (i, p) => n(p),
|
|
980
979
|
textColor: "primary",
|
|
981
|
-
value:
|
|
980
|
+
value: t,
|
|
982
981
|
variant: "fullWidth",
|
|
983
982
|
children: [
|
|
984
983
|
/* @__PURE__ */ e(
|
|
@@ -1000,31 +999,30 @@ const ge = ({
|
|
|
1000
999
|
]
|
|
1001
1000
|
}
|
|
1002
1001
|
),
|
|
1003
|
-
/* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value:
|
|
1004
|
-
/* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value:
|
|
1002
|
+
/* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ht, {}) }),
|
|
1003
|
+
/* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(ft, {}) })
|
|
1005
1004
|
] });
|
|
1006
|
-
}, Ct = S(wt), St = ({ isOpen: a, onClose: o
|
|
1007
|
-
const { debts: r } = C(), { showError: t, showCompleted:
|
|
1005
|
+
}, Ct = S(wt), St = ({ isOpen: a, onClose: o }) => {
|
|
1006
|
+
const { debts: r } = C(), { showError: t, showCompleted: n } = R(), i = t || n ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ e(pt, {});
|
|
1008
1007
|
return /* @__PURE__ */ e(
|
|
1009
1008
|
te,
|
|
1010
1009
|
{
|
|
1011
1010
|
ariaLabelClose: r.details_close_aria,
|
|
1012
1011
|
isOpen: a,
|
|
1013
1012
|
onClose: o,
|
|
1014
|
-
sx: { ...n },
|
|
1015
1013
|
title: r.details_title,
|
|
1016
|
-
children: /* @__PURE__ */ s(
|
|
1017
|
-
/* @__PURE__ */ e(ke, { customDetailsChart:
|
|
1014
|
+
children: /* @__PURE__ */ s(x, { bgcolor: "background.default", children: [
|
|
1015
|
+
/* @__PURE__ */ e(ke, { customDetailsChart: i }),
|
|
1018
1016
|
/* @__PURE__ */ e(Ct, {})
|
|
1019
1017
|
] })
|
|
1020
1018
|
}
|
|
1021
1019
|
);
|
|
1022
1020
|
}, Dt = S(() => {
|
|
1023
|
-
const { debts: a } = C(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile:
|
|
1024
|
-
o && (await
|
|
1021
|
+
const { debts: a } = C(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: r } = z(), { onEvent: t } = k(), [n, i] = g.useState(o?.extra_payment ?? 0), p = n < 0 || n > 9999999999e-2, d = async () => {
|
|
1022
|
+
o && (await r({ ...o, extra_payment: n }), o.extra_payment = n, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
|
|
1025
1023
|
user_guid: o?.user_guid
|
|
1026
1024
|
}));
|
|
1027
|
-
},
|
|
1025
|
+
}, c = () => {
|
|
1028
1026
|
setTimeout(() => {
|
|
1029
1027
|
i(o?.extra_payment ?? 0);
|
|
1030
1028
|
}, 250);
|
|
@@ -1032,48 +1030,48 @@ const ge = ({
|
|
|
1032
1030
|
return /* @__PURE__ */ e(
|
|
1033
1031
|
J,
|
|
1034
1032
|
{
|
|
1035
|
-
isSaveDisabled:
|
|
1033
|
+
isSaveDisabled: p,
|
|
1036
1034
|
label: a.paydown_drawer_extra_payment,
|
|
1037
|
-
onCancel:
|
|
1038
|
-
onSave:
|
|
1035
|
+
onCancel: c,
|
|
1036
|
+
onSave: d,
|
|
1039
1037
|
primaryText: a.paydown_drawer_extra_payment,
|
|
1040
1038
|
secondaryText: P(o?.extra_payment, "0,0"),
|
|
1041
1039
|
zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
|
|
1042
1040
|
children: /* @__PURE__ */ e(
|
|
1043
1041
|
ae,
|
|
1044
1042
|
{
|
|
1045
|
-
amount:
|
|
1043
|
+
amount: n,
|
|
1046
1044
|
autoFocus: !0,
|
|
1047
|
-
error:
|
|
1045
|
+
error: p,
|
|
1048
1046
|
fullWidth: !0,
|
|
1049
1047
|
minAmount: 0,
|
|
1050
|
-
setAmount: (h) => i(isNaN(Number(h)) ?
|
|
1048
|
+
setAmount: (h) => i(isNaN(Number(h)) ? n : Number(h)),
|
|
1051
1049
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
1052
1050
|
}
|
|
1053
1051
|
)
|
|
1054
1052
|
}
|
|
1055
1053
|
);
|
|
1056
1054
|
}), vt = () => {
|
|
1057
|
-
const { debts: a } = C(), { totalMonthlyPayments: o } = q(), { monthlyCashFlowProfile:
|
|
1058
|
-
return /* @__PURE__ */ s(
|
|
1059
|
-
/* @__PURE__ */ s(
|
|
1060
|
-
/* @__PURE__ */ s(
|
|
1055
|
+
const { debts: a } = C(), { totalMonthlyPayments: o } = q(), { monthlyCashFlowProfile: r } = z(), t = o + Number(r?.extra_payment);
|
|
1056
|
+
return /* @__PURE__ */ s(x, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
1057
|
+
/* @__PURE__ */ s(x, { p: 24, children: [
|
|
1058
|
+
/* @__PURE__ */ s(x, { alignItems: "center", gap: 4, mb: 24, children: [
|
|
1061
1059
|
/* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
|
|
1062
1060
|
/* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: P(o, "0,0") }),
|
|
1063
1061
|
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
|
|
1064
1062
|
] }),
|
|
1065
|
-
/* @__PURE__ */ s(
|
|
1063
|
+
/* @__PURE__ */ s(x, { children: [
|
|
1066
1064
|
/* @__PURE__ */ e(l, { variant: "H3", children: a.paydown_drawer_subtitle }),
|
|
1067
1065
|
/* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
|
|
1068
1066
|
] })
|
|
1069
1067
|
] }),
|
|
1070
|
-
/* @__PURE__ */ e(
|
|
1071
|
-
/* @__PURE__ */ e(
|
|
1068
|
+
/* @__PURE__ */ e(x, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Dt, {}) }),
|
|
1069
|
+
/* @__PURE__ */ e(x, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(x, { gap: 4, children: [
|
|
1072
1070
|
/* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
|
|
1073
|
-
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: P(
|
|
1071
|
+
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: P(t, "0,0") })
|
|
1074
1072
|
] }) })
|
|
1075
1073
|
] });
|
|
1076
|
-
}, Tt = S(vt), At = ({ isOpen: a, onClose: o
|
|
1074
|
+
}, Tt = S(vt), At = ({ isOpen: a, onClose: o }) => {
|
|
1077
1075
|
const { debts: r } = C();
|
|
1078
1076
|
return /* @__PURE__ */ e(
|
|
1079
1077
|
te,
|
|
@@ -1081,19 +1079,18 @@ const ge = ({
|
|
|
1081
1079
|
ariaLabelClose: r.paydown_drawer_close_aria,
|
|
1082
1080
|
isOpen: a,
|
|
1083
1081
|
onClose: o,
|
|
1084
|
-
sx: { ...n },
|
|
1085
1082
|
title: r.paydown_drawer_title,
|
|
1086
1083
|
children: /* @__PURE__ */ e(Tt, {})
|
|
1087
1084
|
}
|
|
1088
1085
|
);
|
|
1089
1086
|
};
|
|
1090
1087
|
function Et(a, o) {
|
|
1091
|
-
const
|
|
1092
|
-
if (typeof
|
|
1093
|
-
if (
|
|
1088
|
+
const r = (t) => {
|
|
1089
|
+
if (typeof t == "number") return t;
|
|
1090
|
+
if (t === "!" || t === "✓") return 1 / 0;
|
|
1094
1091
|
throw new Error("Unsupported value");
|
|
1095
1092
|
};
|
|
1096
|
-
return
|
|
1093
|
+
return r(a) - r(o);
|
|
1097
1094
|
}
|
|
1098
1095
|
function It(a) {
|
|
1099
1096
|
return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
|
|
@@ -1105,7 +1102,7 @@ const Bt = (a) => {
|
|
|
1105
1102
|
};
|
|
1106
1103
|
return a === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), a === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
|
|
1107
1104
|
}, Mt = (a) => {
|
|
1108
|
-
const o = String(a.formattedValue),
|
|
1105
|
+
const o = String(a.formattedValue), r = Bt(o);
|
|
1109
1106
|
return /* @__PURE__ */ e(
|
|
1110
1107
|
re,
|
|
1111
1108
|
{
|
|
@@ -1117,15 +1114,15 @@ const Bt = (a) => {
|
|
|
1117
1114
|
// Adjust the size as needed
|
|
1118
1115
|
height: 20,
|
|
1119
1116
|
borderRadius: "50%",
|
|
1120
|
-
backgroundColor:
|
|
1117
|
+
backgroundColor: r.background,
|
|
1121
1118
|
marginLeft: "10px"
|
|
1122
1119
|
},
|
|
1123
|
-
children: /* @__PURE__ */ e(l, { color:
|
|
1120
|
+
children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: o })
|
|
1124
1121
|
}
|
|
1125
1122
|
);
|
|
1126
1123
|
}, Pt = (a) => {
|
|
1127
|
-
const o = a.row.account,
|
|
1128
|
-
return /* @__PURE__ */ s(
|
|
1124
|
+
const o = a.row.account, r = Ke[o.account_type];
|
|
1125
|
+
return /* @__PURE__ */ s(x, { alignItems: "center", flexDirection: "row", children: [
|
|
1129
1126
|
/* @__PURE__ */ e(
|
|
1130
1127
|
ve,
|
|
1131
1128
|
{
|
|
@@ -1133,24 +1130,24 @@ const Bt = (a) => {
|
|
|
1133
1130
|
institutionGuid: o.institution_guid || ""
|
|
1134
1131
|
}
|
|
1135
1132
|
),
|
|
1136
|
-
/* @__PURE__ */ s(
|
|
1133
|
+
/* @__PURE__ */ s(x, { ml: 12, children: [
|
|
1137
1134
|
/* @__PURE__ */ e(l, { variant: "Small", children: o.name }),
|
|
1138
|
-
/* @__PURE__ */ e(l, { variant: "XSmall", children:
|
|
1135
|
+
/* @__PURE__ */ e(l, { variant: "XSmall", children: r })
|
|
1139
1136
|
] })
|
|
1140
1137
|
] });
|
|
1141
1138
|
}, kt = ({
|
|
1142
1139
|
sx: a = {},
|
|
1143
1140
|
debts: o,
|
|
1144
|
-
hoveredDebtGuid:
|
|
1145
|
-
onHoverRow:
|
|
1146
|
-
onClickRow:
|
|
1141
|
+
hoveredDebtGuid: r,
|
|
1142
|
+
onHoverRow: t,
|
|
1143
|
+
onClickRow: n
|
|
1147
1144
|
}) => {
|
|
1148
|
-
const i = j(), { onEvent:
|
|
1145
|
+
const i = j(), { onEvent: p } = k(), { isMobile: d } = X(), { debts: c } = C(), [h, m] = g.useState([
|
|
1149
1146
|
{ field: "priority", sort: "asc" }
|
|
1150
1147
|
]), y = [
|
|
1151
1148
|
{
|
|
1152
1149
|
field: "priority",
|
|
1153
|
-
headerName:
|
|
1150
|
+
headerName: c.table_column_priority,
|
|
1154
1151
|
renderHeader: G,
|
|
1155
1152
|
renderCell: Mt,
|
|
1156
1153
|
sortComparator: Et,
|
|
@@ -1159,41 +1156,41 @@ const Bt = (a) => {
|
|
|
1159
1156
|
type: "custom",
|
|
1160
1157
|
align: "left",
|
|
1161
1158
|
headerAlign: "left",
|
|
1162
|
-
minWidth:
|
|
1163
|
-
flex:
|
|
1159
|
+
minWidth: d ? 67 : 72,
|
|
1160
|
+
flex: d ? 0.2 : 0.4
|
|
1164
1161
|
},
|
|
1165
1162
|
{
|
|
1166
1163
|
field: "account",
|
|
1167
|
-
headerName:
|
|
1164
|
+
headerName: c.table_column_account,
|
|
1168
1165
|
renderHeader: G,
|
|
1169
1166
|
renderCell: Pt,
|
|
1170
1167
|
sortable: !1,
|
|
1171
1168
|
type: "custom",
|
|
1172
1169
|
align: "left",
|
|
1173
1170
|
headerAlign: "left",
|
|
1174
|
-
minWidth:
|
|
1171
|
+
minWidth: d ? 180 : 225,
|
|
1175
1172
|
flex: 1
|
|
1176
1173
|
},
|
|
1177
1174
|
{
|
|
1178
1175
|
field: "balance",
|
|
1179
|
-
headerName:
|
|
1176
|
+
headerName: c.table_column_balance,
|
|
1180
1177
|
renderHeader: G,
|
|
1181
1178
|
valueFormatter: (u) => P(u, "0,0"),
|
|
1182
1179
|
sortable: !0,
|
|
1183
|
-
hideSortIcons:
|
|
1180
|
+
hideSortIcons: d,
|
|
1184
1181
|
type: "number",
|
|
1185
|
-
align:
|
|
1186
|
-
headerAlign:
|
|
1187
|
-
minWidth:
|
|
1188
|
-
flex:
|
|
1182
|
+
align: d ? "right" : "left",
|
|
1183
|
+
headerAlign: d ? "right" : "left",
|
|
1184
|
+
minWidth: d ? 70 : 122,
|
|
1185
|
+
flex: d ? 0.4 : 0.6
|
|
1189
1186
|
},
|
|
1190
1187
|
{
|
|
1191
1188
|
field: "interest_rate",
|
|
1192
|
-
headerName:
|
|
1189
|
+
headerName: c.table_column_interest_rate,
|
|
1193
1190
|
renderHeader: G,
|
|
1194
1191
|
valueFormatter: (u) => isNaN(u) ? "---" : `${Number(u).toFixed(2)}%`,
|
|
1195
1192
|
sortable: !0,
|
|
1196
|
-
hideSortIcons:
|
|
1193
|
+
hideSortIcons: d,
|
|
1197
1194
|
type: "number",
|
|
1198
1195
|
align: "left",
|
|
1199
1196
|
headerAlign: "left",
|
|
@@ -1202,11 +1199,11 @@ const Bt = (a) => {
|
|
|
1202
1199
|
},
|
|
1203
1200
|
{
|
|
1204
1201
|
field: "projected_payoff_date",
|
|
1205
|
-
headerName:
|
|
1202
|
+
headerName: c.table_column_payoff_date,
|
|
1206
1203
|
renderHeader: G,
|
|
1207
1204
|
valueFormatter: (u) => u ? K(u, U.MONTH_SHORT_YEAR) : "---",
|
|
1208
1205
|
sortable: !0,
|
|
1209
|
-
hideSortIcons:
|
|
1206
|
+
hideSortIcons: d,
|
|
1210
1207
|
type: "number",
|
|
1211
1208
|
align: "left",
|
|
1212
1209
|
headerAlign: "left",
|
|
@@ -1215,11 +1212,11 @@ const Bt = (a) => {
|
|
|
1215
1212
|
},
|
|
1216
1213
|
{
|
|
1217
1214
|
field: "monthly_payment",
|
|
1218
|
-
headerName:
|
|
1215
|
+
headerName: c.table_column_amount_due,
|
|
1219
1216
|
renderHeader: G,
|
|
1220
1217
|
valueFormatter: (u) => typeof u == "number" ? P(u, "0,0") : "---",
|
|
1221
1218
|
sortable: !0,
|
|
1222
|
-
hideSortIcons:
|
|
1219
|
+
hideSortIcons: d,
|
|
1223
1220
|
type: "number",
|
|
1224
1221
|
align: "left",
|
|
1225
1222
|
headerAlign: "left",
|
|
@@ -1240,13 +1237,13 @@ const Bt = (a) => {
|
|
|
1240
1237
|
headerAlign: "right",
|
|
1241
1238
|
width: 20
|
|
1242
1239
|
}
|
|
1243
|
-
], D =
|
|
1240
|
+
], D = g.useMemo(() => o.map((u, I) => ({
|
|
1244
1241
|
...u,
|
|
1245
1242
|
id: I,
|
|
1246
1243
|
priority: It(u)
|
|
1247
1244
|
})), [o]), E = (u) => {
|
|
1248
1245
|
const Y = u.target.closest("[data-id]")?.getAttribute("data-id"), b = o[Number(Y)];
|
|
1249
|
-
|
|
1246
|
+
t?.(b?.guid ?? "");
|
|
1250
1247
|
}, v = (u) => D.find((I) => I.guid === u)?.id;
|
|
1251
1248
|
return /* @__PURE__ */ e(
|
|
1252
1249
|
re,
|
|
@@ -1262,29 +1259,29 @@ const Bt = (a) => {
|
|
|
1262
1259
|
children: /* @__PURE__ */ e(
|
|
1263
1260
|
Ye,
|
|
1264
1261
|
{
|
|
1265
|
-
columns:
|
|
1262
|
+
columns: d ? f : y,
|
|
1266
1263
|
disableColumnFilter: !0,
|
|
1267
1264
|
disableColumnMenu: !0,
|
|
1268
1265
|
hideFooter: !0,
|
|
1269
1266
|
initialState: { sorting: { sortModel: h } },
|
|
1270
1267
|
onRowClick: (u) => {
|
|
1271
|
-
|
|
1268
|
+
n(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: u.row.guid });
|
|
1272
1269
|
},
|
|
1273
1270
|
onSortModelChange: (u) => {
|
|
1274
|
-
m(u),
|
|
1271
|
+
m(u), p(T.DEBTS_CLICK_TABLE_SORT);
|
|
1275
1272
|
},
|
|
1276
1273
|
rows: D,
|
|
1277
1274
|
slotProps: {
|
|
1278
1275
|
baseIconButton: { color: "secondary", sx: { ml: 8 } },
|
|
1279
1276
|
row: {
|
|
1280
1277
|
onMouseEnter: E,
|
|
1281
|
-
onMouseLeave: () =>
|
|
1278
|
+
onMouseLeave: () => t?.("")
|
|
1282
1279
|
}
|
|
1283
1280
|
},
|
|
1284
1281
|
sortModel: h,
|
|
1285
1282
|
sortingOrder: ["asc", "desc"],
|
|
1286
1283
|
sx: {
|
|
1287
|
-
[`& .MuiDataGrid-row[data-id="${v(
|
|
1284
|
+
[`& .MuiDataGrid-row[data-id="${v(r)}"]`]: {
|
|
1288
1285
|
backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
|
|
1289
1286
|
filter: "brightness(98%)"
|
|
1290
1287
|
}
|
|
@@ -1293,16 +1290,16 @@ const Bt = (a) => {
|
|
|
1293
1290
|
)
|
|
1294
1291
|
}
|
|
1295
1292
|
);
|
|
1296
|
-
}, Ft = ({ buttonText: a, isOpen: o, onClick:
|
|
1297
|
-
const { isDesktop:
|
|
1298
|
-
return
|
|
1293
|
+
}, Ft = ({ buttonText: a, isOpen: o, onClick: r }) => {
|
|
1294
|
+
const { isDesktop: t, isTablet: n } = X(), i = o ? "unfold_less" : "unfold_more";
|
|
1295
|
+
return t || n ? /* @__PURE__ */ e(
|
|
1299
1296
|
fe,
|
|
1300
1297
|
{
|
|
1301
1298
|
"aria-controls": "prioritize-debts",
|
|
1302
1299
|
"aria-describedby": "prioritize-debts",
|
|
1303
1300
|
"aria-haspopup": !0,
|
|
1304
1301
|
"aria-label": "prioritize-debts",
|
|
1305
|
-
onClick:
|
|
1302
|
+
onClick: r,
|
|
1306
1303
|
startIcon: /* @__PURE__ */ e(ee, { name: i }),
|
|
1307
1304
|
sx: { justifyContent: "start", minWidth: 214, mx: 4 },
|
|
1308
1305
|
children: a
|
|
@@ -1314,30 +1311,30 @@ const Bt = (a) => {
|
|
|
1314
1311
|
"aria-describedby": "prioritize-debts",
|
|
1315
1312
|
"aria-haspopup": !0,
|
|
1316
1313
|
"aria-label": "prioritize-debts",
|
|
1317
|
-
onClick:
|
|
1314
|
+
onClick: r,
|
|
1318
1315
|
children: /* @__PURE__ */ e(ee, { name: i })
|
|
1319
1316
|
}
|
|
1320
1317
|
);
|
|
1321
1318
|
}, Nt = S(({ buttonEl: a, onClose: o }) => {
|
|
1322
|
-
const { onEvent:
|
|
1319
|
+
const { onEvent: r } = k(), { debts: t } = C(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = R(), p = !!a, d = [
|
|
1323
1320
|
{
|
|
1324
1321
|
priority: M.FASTEST_PAYOFF_FIRST,
|
|
1325
|
-
text:
|
|
1322
|
+
text: t.priority_sort_fastest_payoff
|
|
1326
1323
|
},
|
|
1327
1324
|
{
|
|
1328
1325
|
priority: M.HIGHEST_INTEREST,
|
|
1329
|
-
text:
|
|
1326
|
+
text: t.priority_sort_highest_interest
|
|
1330
1327
|
},
|
|
1331
1328
|
{
|
|
1332
1329
|
priority: M.LOWEST_BALANCE,
|
|
1333
|
-
text:
|
|
1330
|
+
text: t.priority_sort_lowest_balance
|
|
1334
1331
|
},
|
|
1335
1332
|
{
|
|
1336
1333
|
priority: M.HIGHEST_BALANCE,
|
|
1337
|
-
text:
|
|
1334
|
+
text: t.priority_sort_highest_balance
|
|
1338
1335
|
}
|
|
1339
|
-
],
|
|
1340
|
-
i(h),
|
|
1336
|
+
], c = (h) => {
|
|
1337
|
+
i(h), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: h });
|
|
1341
1338
|
};
|
|
1342
1339
|
return /* @__PURE__ */ e(
|
|
1343
1340
|
Ze,
|
|
@@ -1349,18 +1346,18 @@ const Bt = (a) => {
|
|
|
1349
1346
|
},
|
|
1350
1347
|
id: "prioritize-debts",
|
|
1351
1348
|
onClose: o,
|
|
1352
|
-
open:
|
|
1349
|
+
open: p,
|
|
1353
1350
|
transformOrigin: {
|
|
1354
1351
|
vertical: "top",
|
|
1355
1352
|
horizontal: "left"
|
|
1356
1353
|
},
|
|
1357
|
-
children: /* @__PURE__ */ e(_e, { children:
|
|
1354
|
+
children: /* @__PURE__ */ e(_e, { children: d.map(({ priority: h, text: m }) => /* @__PURE__ */ s(
|
|
1358
1355
|
qe,
|
|
1359
1356
|
{
|
|
1360
|
-
onClick: () =>
|
|
1357
|
+
onClick: () => c(h),
|
|
1361
1358
|
sx: {
|
|
1362
|
-
bgcolor:
|
|
1363
|
-
color:
|
|
1359
|
+
bgcolor: n === h ? "primary.main" : void 0,
|
|
1360
|
+
color: n === h ? "#fff" : void 0,
|
|
1364
1361
|
justifyContent: "space-between",
|
|
1365
1362
|
minHeight: 44,
|
|
1366
1363
|
minWidth: 268,
|
|
@@ -1374,7 +1371,7 @@ const Bt = (a) => {
|
|
|
1374
1371
|
},
|
|
1375
1372
|
children: [
|
|
1376
1373
|
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: m }),
|
|
1377
|
-
|
|
1374
|
+
n === h && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
|
|
1378
1375
|
]
|
|
1379
1376
|
},
|
|
1380
1377
|
h
|
|
@@ -1382,59 +1379,59 @@ const Bt = (a) => {
|
|
|
1382
1379
|
}
|
|
1383
1380
|
);
|
|
1384
1381
|
}), Rt = S(() => {
|
|
1385
|
-
const { onEvent: a } = k(), { debts: o } = C(), { selectedDebtPriority:
|
|
1386
|
-
|
|
1387
|
-
},
|
|
1388
|
-
|
|
1389
|
-
},
|
|
1382
|
+
const { onEvent: a } = k(), { debts: o } = C(), { selectedDebtPriority: r } = R(), [t, n] = g.useState(null), i = (h) => {
|
|
1383
|
+
n(h.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
|
|
1384
|
+
}, p = () => {
|
|
1385
|
+
n(null);
|
|
1386
|
+
}, d = !!t, c = g.useMemo(() => ({
|
|
1390
1387
|
[M.FASTEST_PAYOFF_FIRST]: o.priority_sort_fastest_payoff,
|
|
1391
1388
|
[M.HIGHEST_INTEREST]: o.priority_sort_highest_interest,
|
|
1392
1389
|
[M.HIGHEST_BALANCE]: o.priority_sort_highest_balance,
|
|
1393
1390
|
[M.LOWEST_BALANCE]: o.priority_sort_lowest_balance
|
|
1394
|
-
})[
|
|
1391
|
+
})[r] ?? o.priority_sort_lowest_balance, [r]);
|
|
1395
1392
|
return /* @__PURE__ */ s(_, { children: [
|
|
1396
|
-
/* @__PURE__ */ e(Ft, { buttonText:
|
|
1397
|
-
/* @__PURE__ */ e(Nt, { buttonEl:
|
|
1393
|
+
/* @__PURE__ */ e(Ft, { buttonText: c, isOpen: d, onClick: i }),
|
|
1394
|
+
/* @__PURE__ */ e(Nt, { buttonEl: t, onClose: p })
|
|
1398
1395
|
] });
|
|
1399
|
-
}), Lt = (a, o,
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1402
|
-
const
|
|
1403
|
-
let
|
|
1404
|
-
for (const
|
|
1396
|
+
}), Lt = (a, o, r = 0) => {
|
|
1397
|
+
const t = a.map((c) => ({ ...c }));
|
|
1398
|
+
ge(t, o);
|
|
1399
|
+
const n = /* @__PURE__ */ new Date(), i = [];
|
|
1400
|
+
let p = 0, d = 1;
|
|
1401
|
+
for (const c of t)
|
|
1405
1402
|
i.push({
|
|
1406
|
-
...
|
|
1403
|
+
...c,
|
|
1407
1404
|
// Start with the initial balance
|
|
1408
|
-
dataset: [{ x: new Date(
|
|
1405
|
+
dataset: [{ x: new Date(n), y: c.balance }]
|
|
1409
1406
|
});
|
|
1410
|
-
for (;
|
|
1411
|
-
let
|
|
1412
|
-
for (const [h, m] of
|
|
1407
|
+
for (; t.some((c) => c.balance >= 0.01 && !c.is_impossible); ) {
|
|
1408
|
+
let c = !1;
|
|
1409
|
+
for (const [h, m] of t.entries()) {
|
|
1413
1410
|
if (m.balance <= 0.01) continue;
|
|
1414
1411
|
const y = i[h].dataset, D = (m.interest_rate ?? 0) / 100 / 12, E = m.balance * D;
|
|
1415
1412
|
let v = m.monthly_payment ?? 0;
|
|
1416
|
-
h === 0 && (v +=
|
|
1417
|
-
const u = Math.min(m.balance, v +
|
|
1413
|
+
h === 0 && (v += r), m.balance += E;
|
|
1414
|
+
const u = Math.min(m.balance, v + p);
|
|
1418
1415
|
if (u <= E) {
|
|
1419
|
-
m.is_impossible = !0, i[h].is_impossible = !0, i[h].priority = void 0, y.push({ x: new Date(
|
|
1416
|
+
m.is_impossible = !0, i[h].is_impossible = !0, i[h].priority = void 0, y.push({ x: new Date(n), y: m.balance });
|
|
1420
1417
|
continue;
|
|
1421
1418
|
}
|
|
1422
1419
|
m.balance -= u, m.balance = m.balance < 0.01 ? 0 : m.balance, y.push({
|
|
1423
|
-
x: new Date(
|
|
1420
|
+
x: new Date(n),
|
|
1424
1421
|
y: Math.max(0, m.balance),
|
|
1425
1422
|
payment: u,
|
|
1426
|
-
extra:
|
|
1427
|
-
}), m.balance <= 0 && (
|
|
1423
|
+
extra: p
|
|
1424
|
+
}), m.balance <= 0 && (p += v, i[h].projected_payoff_date = new Date(n)), u > 0 && (c = !0);
|
|
1428
1425
|
}
|
|
1429
|
-
|
|
1426
|
+
c && n.setMonth(n.getMonth() + 1);
|
|
1430
1427
|
}
|
|
1431
|
-
return i.forEach((
|
|
1432
|
-
(
|
|
1433
|
-
}), i.forEach((
|
|
1434
|
-
|
|
1428
|
+
return i.forEach((c) => {
|
|
1429
|
+
(c.interest_rate === void 0 || c.interest_rate === void 0) && (c.projected_payoff_date = void 0);
|
|
1430
|
+
}), i.forEach((c) => {
|
|
1431
|
+
c.priority = !c.is_paid_off && !c.is_impossible ? d++ : void 0;
|
|
1435
1432
|
}), i;
|
|
1436
1433
|
}, $t = S(({ onClick: a }) => {
|
|
1437
|
-
const { debts: o } = C(), { isDesktop:
|
|
1434
|
+
const { debts: o } = C(), { isDesktop: r } = X(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: n } = z(), i = t + Number(n?.extra_payment), p = r ? o.paydown_button_long : o.paydown_button_short;
|
|
1438
1435
|
return /* @__PURE__ */ e(
|
|
1439
1436
|
fe,
|
|
1440
1437
|
{
|
|
@@ -1444,26 +1441,26 @@ const Bt = (a) => {
|
|
|
1444
1441
|
"aria-label": "extra-paydown",
|
|
1445
1442
|
onClick: a,
|
|
1446
1443
|
sx: { justifyContent: "start", minWidth: 100, mx: 4 },
|
|
1447
|
-
children: A(
|
|
1444
|
+
children: A(p, P(i, "0,0"))
|
|
1448
1445
|
}
|
|
1449
1446
|
);
|
|
1450
1447
|
}), Ht = ({ onBackClick: a, sx: o }) => {
|
|
1451
|
-
const [
|
|
1448
|
+
const [r, t] = g.useState(!1), [n, i] = g.useState(!1), [p, d] = g.useState(!1), [c, h] = g.useState(""), { isDesktop: m, isMobile: y } = X(), { debts: f } = C(), { onEvent: D } = k(), { isCopyLoaded: E, isInitialized: v, setSelectedAccounts: u } = Pe(), { setSelectedAccount: I } = Fe(), { selectedDebtPriority: V, setSelectedDebtChartData: Y } = R(), { visibleDebtAccounts: b } = Z(), { goalsLoaded: w, loadGoals: B, monthlyCashFlowProfile: F } = z(), { debts: N } = q(), $ = g.useMemo(() => {
|
|
1452
1449
|
const H = F?.extra_payment ?? 0;
|
|
1453
1450
|
return Lt(N, V, H);
|
|
1454
1451
|
}, [N, V, F]);
|
|
1455
|
-
|
|
1452
|
+
g.useEffect(() => {
|
|
1456
1453
|
u(b), D(T.DEBTS_VIEW);
|
|
1457
|
-
}, []),
|
|
1454
|
+
}, []), g.useEffect(() => {
|
|
1458
1455
|
u(b);
|
|
1459
|
-
}, [b]),
|
|
1456
|
+
}, [b]), g.useEffect(() => {
|
|
1460
1457
|
v && B().finally();
|
|
1461
1458
|
}, [v]);
|
|
1462
1459
|
const oe = (H) => h(H), ne = () => {
|
|
1463
|
-
const H = b.find((Q) => Q.guid ===
|
|
1464
|
-
H && I(H), ie && Y(ie),
|
|
1460
|
+
const H = b.find((Q) => Q.guid === c), ie = $.find((Q) => Q.guid === c);
|
|
1461
|
+
H && I(H), ie && Y(ie), t(!0);
|
|
1465
1462
|
}, we = () => D(T.DEBTS_CLICK_FILTER), Ce = () => {
|
|
1466
|
-
|
|
1463
|
+
d(!0), D(T.DEBTS_CLICK_SNOWBALL_CTA);
|
|
1467
1464
|
}, Se = () => {
|
|
1468
1465
|
i(!0), D(T.DEBTS_CLICK_PAYDOWN);
|
|
1469
1466
|
};
|
|
@@ -1480,9 +1477,9 @@ const Bt = (a) => {
|
|
|
1480
1477
|
sx: o,
|
|
1481
1478
|
title: f.title,
|
|
1482
1479
|
children: [
|
|
1483
|
-
/* @__PURE__ */ s(
|
|
1480
|
+
/* @__PURE__ */ s(x, { sx: { px: m ? "48px" : "24px" }, children: [
|
|
1484
1481
|
/* @__PURE__ */ s(
|
|
1485
|
-
|
|
1482
|
+
x,
|
|
1486
1483
|
{
|
|
1487
1484
|
sx: {
|
|
1488
1485
|
alignItems: y ? "flex-start" : "flex-end",
|
|
@@ -1491,11 +1488,11 @@ const Bt = (a) => {
|
|
|
1491
1488
|
},
|
|
1492
1489
|
children: [
|
|
1493
1490
|
/* @__PURE__ */ e(
|
|
1494
|
-
|
|
1491
|
+
xe,
|
|
1495
1492
|
{
|
|
1496
1493
|
debts: $,
|
|
1497
1494
|
height: y ? 250 : void 0,
|
|
1498
|
-
hoveredDebtGuid:
|
|
1495
|
+
hoveredDebtGuid: c,
|
|
1499
1496
|
onClickArea: ne,
|
|
1500
1497
|
onHoverArea: oe,
|
|
1501
1498
|
sx: { mr: y ? "4px" : "-48px" }
|
|
@@ -1512,11 +1509,11 @@ const Bt = (a) => {
|
|
|
1512
1509
|
]
|
|
1513
1510
|
}
|
|
1514
1511
|
),
|
|
1515
|
-
/* @__PURE__ */ e(
|
|
1512
|
+
/* @__PURE__ */ e(x, { sx: { mx: y ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1516
1513
|
kt,
|
|
1517
1514
|
{
|
|
1518
1515
|
debts: $,
|
|
1519
|
-
hoveredDebtGuid:
|
|
1516
|
+
hoveredDebtGuid: c,
|
|
1520
1517
|
onClickRow: ne,
|
|
1521
1518
|
onHoverRow: oe
|
|
1522
1519
|
}
|
|
@@ -1525,18 +1522,18 @@ const Bt = (a) => {
|
|
|
1525
1522
|
/* @__PURE__ */ e(
|
|
1526
1523
|
lt,
|
|
1527
1524
|
{
|
|
1528
|
-
isOpen:
|
|
1529
|
-
onClose: () =>
|
|
1525
|
+
isOpen: p,
|
|
1526
|
+
onClose: () => d(!1)
|
|
1530
1527
|
}
|
|
1531
1528
|
),
|
|
1532
|
-
/* @__PURE__ */ e(St, { isOpen:
|
|
1533
|
-
/* @__PURE__ */ e(At, { isOpen:
|
|
1529
|
+
/* @__PURE__ */ e(St, { isOpen: r, onClose: () => t(!1) }),
|
|
1530
|
+
/* @__PURE__ */ e(At, { isOpen: n, onClose: () => i(!1) })
|
|
1534
1531
|
]
|
|
1535
1532
|
}
|
|
1536
1533
|
);
|
|
1537
1534
|
}, Pr = S(Ht);
|
|
1538
1535
|
export {
|
|
1539
|
-
|
|
1536
|
+
xe as DebtsChart,
|
|
1540
1537
|
Nr as DebtsStore,
|
|
1541
1538
|
kt as DebtsTable,
|
|
1542
1539
|
Pr as DebtsWidget
|