@mx-cartographer/experiences 9.0.0-alpha.al1 → 9.0.0-alpha.al2
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/debts/index.es.js +204 -204
- 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 $ } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import x from "react";
|
|
3
3
|
import { observer as D } from "mobx-react-lite";
|
|
4
|
-
import
|
|
4
|
+
import f from "@mui/material/Stack";
|
|
5
5
|
import { useTheme as Y, Card as Ce, Stack as _, Box as W } from "@mui/material";
|
|
6
6
|
import { Text as l, P as ve, H3 as Le, InstitutionLogo as $e, Icon as ae } from "@mxenabled/mxui";
|
|
7
7
|
import { intervalToDuration as Oe, formatDuration as He } from "date-fns";
|
|
@@ -9,7 +9,7 @@ import { addMonths as ue } from "date-fns/addMonths";
|
|
|
9
9
|
import { fromUnixTime as be } from "date-fns/fromUnixTime";
|
|
10
10
|
import { getUnixTime as _e } from "date-fns/getUnixTime";
|
|
11
11
|
import { a as N, M as We, I as Ge } from "../DebtsStore-BZqNLaqd.mjs";
|
|
12
|
-
import { D as
|
|
12
|
+
import { D as nn } from "../DebtsStore-BZqNLaqd.mjs";
|
|
13
13
|
import { f as P, a as je } from "../NumberFormatting-QCaNwbjv.mjs";
|
|
14
14
|
import { f as J, D as Q } from "../DateFormats-BMpMrZpW.mjs";
|
|
15
15
|
import { G as ze, v as ee, u as C, k as V, g as B, d as te, a as Ye, b as Ve } from "../hooks-BxkfR-Ff.mjs";
|
|
@@ -28,9 +28,9 @@ import ye from "@mui/material/Tab";
|
|
|
28
28
|
import et from "@mui/material/Tabs";
|
|
29
29
|
import De from "@mui/material/List";
|
|
30
30
|
import G from "@mui/material/Divider";
|
|
31
|
-
import { M as tt, I as rt, O as
|
|
32
|
-
import
|
|
33
|
-
import { L as
|
|
31
|
+
import { M as tt, I as rt, O as nt } from "../OriginalBalanceAction-DjpvVVFz.mjs";
|
|
32
|
+
import ot from "@mui/material/TextField";
|
|
33
|
+
import { L as ne } from "../ListItemAction-4KB7P75M.mjs";
|
|
34
34
|
import { C as se } from "../CurrencyInput-DuMktPu3.mjs";
|
|
35
35
|
import fe from "@mui/material/Alert";
|
|
36
36
|
import xe from "@mui/material/AlertTitle";
|
|
@@ -49,17 +49,17 @@ import { u as ht } from "../useWidgetLoadTimer-DgN1bTyu.mjs";
|
|
|
49
49
|
import { L as mt } from "../Loader-D3rjKx72.mjs";
|
|
50
50
|
import { W as ut } from "../WidgetContainer-BOehD4AH.mjs";
|
|
51
51
|
import { E as bt } from "../EmptyState-DHAkGsjk.mjs";
|
|
52
|
-
const _t = (
|
|
52
|
+
const _t = (n, o = 0, t = 0) => {
|
|
53
53
|
if (t === 0) return 0;
|
|
54
|
-
const r =
|
|
54
|
+
const r = o / (We * Ge);
|
|
55
55
|
return Math.ceil(
|
|
56
|
-
r === 0 ?
|
|
56
|
+
r === 0 ? n / t : -Math.log(1 - r * n / t) / Math.log(1 + r)
|
|
57
57
|
);
|
|
58
|
-
}, yt = (
|
|
58
|
+
}, yt = (n, o, t, r, a) => {
|
|
59
59
|
const i = [];
|
|
60
60
|
if (t === 0) {
|
|
61
|
-
for (let c = 0; c <
|
|
62
|
-
const p =
|
|
61
|
+
for (let c = 0; c < n; c++) {
|
|
62
|
+
const p = o - r * (c + 1), h = o - r * c, u = p >= 0 ? r : h;
|
|
63
63
|
i.push({
|
|
64
64
|
balance: p >= 0 ? p : 0,
|
|
65
65
|
interest: t,
|
|
@@ -78,8 +78,8 @@ const _t = (o, n = 0, t = 0) => {
|
|
|
78
78
|
return i;
|
|
79
79
|
}
|
|
80
80
|
const d = t / 1200;
|
|
81
|
-
for (let c = 0; c <
|
|
82
|
-
const p = _e(ue(be(a), c + 1)), h = Math.pow(1 + d, c), u =
|
|
81
|
+
for (let c = 0; c < n; c++) {
|
|
82
|
+
const p = _e(ue(be(a), c + 1)), h = Math.pow(1 + d, c), u = o * h - r * ((h - 1) / d), w = Math.pow(1 + d, c + 1), b = o * w - r * ((w - 1) / d), I = r + Math.min(b, 0), M = u * d;
|
|
83
83
|
i.push({
|
|
84
84
|
balance: Math.max(0, b),
|
|
85
85
|
interest: M,
|
|
@@ -89,25 +89,25 @@ const _t = (o, n = 0, t = 0) => {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
return i;
|
|
92
|
-
}, ft = (
|
|
93
|
-
const { monthly_payment:
|
|
92
|
+
}, ft = (n) => (n[n.length - 1] || {}).timestamp, xt = (n) => {
|
|
93
|
+
const { monthly_payment: o, interest_rate: t, balance: r, payment_due_date: a } = n, i = _t(r, t ?? 0, o ?? 0), d = yt(
|
|
94
94
|
i,
|
|
95
95
|
r,
|
|
96
96
|
t ?? 0,
|
|
97
|
-
|
|
97
|
+
o ?? 0,
|
|
98
98
|
a
|
|
99
99
|
), c = ft(d);
|
|
100
100
|
return {
|
|
101
|
-
...
|
|
101
|
+
...n,
|
|
102
102
|
minimumFinalPayment: c,
|
|
103
103
|
minimumPayments: d
|
|
104
104
|
};
|
|
105
|
-
}, Ae = (
|
|
106
|
-
const [t, r] =
|
|
105
|
+
}, Ae = (n, o) => {
|
|
106
|
+
const [t, r] = n.reduce(
|
|
107
107
|
([a, i], d) => (d.is_paid_off || d.is_impossible ? i.push({ ...d, minimumPayments: [] }) : a.push(xt(d)), [a, i]),
|
|
108
108
|
[[], []]
|
|
109
109
|
);
|
|
110
|
-
switch (
|
|
110
|
+
switch (o) {
|
|
111
111
|
case N.FASTEST_PAYOFF_FIRST:
|
|
112
112
|
t.sort((a, i) => (a.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
|
|
113
113
|
break;
|
|
@@ -123,13 +123,13 @@ const _t = (o, n = 0, t = 0) => {
|
|
|
123
123
|
default:
|
|
124
124
|
t.sort((a, i) => a.balance - i.balance);
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
n.splice(0, n.length, ...t, ...r);
|
|
127
127
|
};
|
|
128
|
-
function gt(
|
|
129
|
-
const r =
|
|
128
|
+
function gt(n, o, t = 0) {
|
|
129
|
+
const r = n.map((u) => ({ ...u })).filter(
|
|
130
130
|
(u) => u.interest_rate !== void 0 && u.monthly_payment !== void 0 && !u.is_paid_off
|
|
131
131
|
);
|
|
132
|
-
Ae(r,
|
|
132
|
+
Ae(r, o);
|
|
133
133
|
let a = 0, i = 0;
|
|
134
134
|
const d = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
|
|
135
135
|
for (; r.some((u) => u.balance >= 0.01 && !u.is_impossible); ) {
|
|
@@ -156,14 +156,14 @@ function gt(o, n, t = 0) {
|
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
const L = () => {
|
|
159
|
-
if (!
|
|
159
|
+
if (!x.useContext(ze))
|
|
160
160
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
161
161
|
return ee().uiStore;
|
|
162
|
-
}, wt = ({ debts:
|
|
163
|
-
const r = Y(), { isMobile: a } = re(), { debts: i } = C(), { selectedDebtPriority: d } = L(), { monthlyCashFlowProfile: c } = V(), { payoffDate: p, payoffSavings: h, payoffDuration: u } =
|
|
162
|
+
}, wt = ({ debts: n, onClickCta: o, sx: t }) => {
|
|
163
|
+
const r = Y(), { isMobile: a } = re(), { debts: i } = C(), { selectedDebtPriority: d } = L(), { monthlyCashFlowProfile: c } = V(), { payoffDate: p, payoffSavings: h, payoffDuration: u } = x.useMemo(() => {
|
|
164
164
|
const w = c?.extra_payment ?? 0;
|
|
165
|
-
return gt(
|
|
166
|
-
}, [
|
|
165
|
+
return gt(n, d, w);
|
|
166
|
+
}, [n, d, c]);
|
|
167
167
|
return /* @__PURE__ */ e(
|
|
168
168
|
Ce,
|
|
169
169
|
{
|
|
@@ -202,7 +202,7 @@ const L = () => {
|
|
|
202
202
|
{
|
|
203
203
|
bold: !0,
|
|
204
204
|
color: r.palette.primary.main,
|
|
205
|
-
onClick:
|
|
205
|
+
onClick: o,
|
|
206
206
|
sx: { cursor: "pointer" },
|
|
207
207
|
variant: "body2",
|
|
208
208
|
children: i.snowball_card_cta
|
|
@@ -211,14 +211,14 @@ const L = () => {
|
|
|
211
211
|
] })
|
|
212
212
|
}
|
|
213
213
|
);
|
|
214
|
-
}, Ct = D(wt), vt = ({ isOpen:
|
|
215
|
-
const t = Y(), { debts: r } = C(), [a, i] =
|
|
214
|
+
}, Ct = D(wt), vt = ({ isOpen: n, onClose: o }) => {
|
|
215
|
+
const t = Y(), { debts: r } = C(), [a, i] = x.useState(!1);
|
|
216
216
|
return /* @__PURE__ */ e(
|
|
217
217
|
ie,
|
|
218
218
|
{
|
|
219
219
|
ariaLabelClose: "",
|
|
220
|
-
isOpen:
|
|
221
|
-
onClose:
|
|
220
|
+
isOpen: n,
|
|
221
|
+
onClose: o,
|
|
222
222
|
title: r.snowball_drawer_title,
|
|
223
223
|
children: /* @__PURE__ */ s(_, { bgcolor: t.palette.background.default, height: "100%", children: [
|
|
224
224
|
/* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
|
|
@@ -573,17 +573,17 @@ const L = () => {
|
|
|
573
573
|
}
|
|
574
574
|
);
|
|
575
575
|
}, Dt = D(vt), St = "#FF7B08";
|
|
576
|
-
function Tt(
|
|
577
|
-
const [t, r, a] =
|
|
578
|
-
Math.max(0, Math.min(255, Math.round(t *
|
|
579
|
-
Math.max(0, Math.min(255, Math.round(r *
|
|
580
|
-
Math.max(0, Math.min(255, Math.round(a *
|
|
576
|
+
function Tt(n, o) {
|
|
577
|
+
const [t, r, a] = n.replace(/^#/, "").match(/.{1,2}/g).map((d) => parseInt(d, 16)), i = [
|
|
578
|
+
Math.max(0, Math.min(255, Math.round(t * o))),
|
|
579
|
+
Math.max(0, Math.min(255, Math.round(r * o))),
|
|
580
|
+
Math.max(0, Math.min(255, Math.round(a * o)))
|
|
581
581
|
];
|
|
582
582
|
return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
|
|
583
583
|
}
|
|
584
584
|
const Ee = ({
|
|
585
|
-
sx:
|
|
586
|
-
height:
|
|
585
|
+
sx: n,
|
|
586
|
+
height: o = 500,
|
|
587
587
|
width: t,
|
|
588
588
|
debts: r,
|
|
589
589
|
hoveredDebtGuid: a,
|
|
@@ -655,7 +655,7 @@ const Ee = ({
|
|
|
655
655
|
{
|
|
656
656
|
axisHighlight: { x: "none" },
|
|
657
657
|
disableLineItemHighlight: !0,
|
|
658
|
-
height:
|
|
658
|
+
height: o,
|
|
659
659
|
hideLegend: !0,
|
|
660
660
|
margin: { bottom: 24, left: 32, right: 72, top: 48 },
|
|
661
661
|
onAreaClick: (m, g) => {
|
|
@@ -696,7 +696,7 @@ const Ee = ({
|
|
|
696
696
|
"& .MuiChartsAxis-tickLabel > tspan": {
|
|
697
697
|
fontFamily: c.typography.body2.fontFamily
|
|
698
698
|
},
|
|
699
|
-
...
|
|
699
|
+
...n
|
|
700
700
|
},
|
|
701
701
|
width: t,
|
|
702
702
|
xAxis: [
|
|
@@ -722,7 +722,7 @@ const Ee = ({
|
|
|
722
722
|
}
|
|
723
723
|
);
|
|
724
724
|
}, At = () => {
|
|
725
|
-
const
|
|
725
|
+
const n = Y(), { debts: o } = C(), { selectedDebtChartData: t } = L();
|
|
726
726
|
return /* @__PURE__ */ s($, { children: [
|
|
727
727
|
/* @__PURE__ */ s(
|
|
728
728
|
qe,
|
|
@@ -733,7 +733,7 @@ const Ee = ({
|
|
|
733
733
|
}
|
|
734
734
|
},
|
|
735
735
|
children: [
|
|
736
|
-
/* @__PURE__ */ e(Ze, { sx: { pb: 0 }, title: /* @__PURE__ */ e(Le, { sx: { pb: 4 }, children:
|
|
736
|
+
/* @__PURE__ */ e(Ze, { sx: { pb: 0 }, title: /* @__PURE__ */ e(Le, { sx: { pb: 4 }, children: o.details_chart_title }) }),
|
|
737
737
|
/* @__PURE__ */ e(Xe, { sx: { p: 0 }, children: /* @__PURE__ */ e(Ee, { debts: [t], height: 250 }) })
|
|
738
738
|
]
|
|
739
739
|
}
|
|
@@ -741,51 +741,51 @@ const Ee = ({
|
|
|
741
741
|
/* @__PURE__ */ e(
|
|
742
742
|
l,
|
|
743
743
|
{
|
|
744
|
-
color:
|
|
744
|
+
color: n.palette.text.secondary,
|
|
745
745
|
sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
|
|
746
746
|
variant: "body2",
|
|
747
|
-
children:
|
|
747
|
+
children: o.details_chart_description
|
|
748
748
|
}
|
|
749
749
|
)
|
|
750
750
|
] });
|
|
751
751
|
}, Et = D(At), It = () => {
|
|
752
|
-
const
|
|
753
|
-
return
|
|
752
|
+
const n = Y(), { onEvent: o } = B(), { debts: t } = C(), { selectedDebtChartData: r, showCompleted: a, showError: i } = L();
|
|
753
|
+
return x.useEffect(() => o(A.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(De, { children: i || a ? /* @__PURE__ */ e(
|
|
754
754
|
l,
|
|
755
755
|
{
|
|
756
|
-
color:
|
|
756
|
+
color: n.palette.secondary.main,
|
|
757
757
|
component: "div",
|
|
758
758
|
sx: { p: 32, textAlign: "center", whiteSpace: "normal" },
|
|
759
759
|
variant: "body2",
|
|
760
760
|
children: i ? t.schedule_error_message : t.schedule_complete_message
|
|
761
761
|
}
|
|
762
762
|
) : /* @__PURE__ */ s($, { children: [
|
|
763
|
-
/* @__PURE__ */ s(
|
|
763
|
+
/* @__PURE__ */ s(f, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
764
764
|
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: t.schedule_month_heading }),
|
|
765
765
|
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: t.schedule_amount_heading })
|
|
766
766
|
] }),
|
|
767
|
-
r.dataset.slice(1).map(({ x: d, y: c, payment: p }) => /* @__PURE__ */ e(
|
|
768
|
-
|
|
767
|
+
r.dataset.slice(1).map(({ x: d, y: c, payment: p }) => /* @__PURE__ */ e(f, { bgcolor: n.palette.background.paper, children: /* @__PURE__ */ e(f, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
|
|
768
|
+
f,
|
|
769
769
|
{
|
|
770
770
|
sx: {
|
|
771
|
-
borderBottom: `1px solid ${
|
|
771
|
+
borderBottom: `1px solid ${n.palette.divider}`,
|
|
772
772
|
flexDirection: "row",
|
|
773
773
|
flexGrow: 1,
|
|
774
774
|
py: 14,
|
|
775
775
|
pr: 24
|
|
776
776
|
},
|
|
777
777
|
children: [
|
|
778
|
-
/* @__PURE__ */ s(
|
|
778
|
+
/* @__PURE__ */ s(f, { flexGrow: 1, children: [
|
|
779
779
|
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: J(d, Q.MONTH_YEAR) }),
|
|
780
|
-
/* @__PURE__ */ e(l, { color:
|
|
780
|
+
/* @__PURE__ */ e(l, { color: n.palette.secondary.main, variant: "caption", children: t.schedule_month_label })
|
|
781
781
|
] }),
|
|
782
|
-
/* @__PURE__ */ s(
|
|
782
|
+
/* @__PURE__ */ s(f, { children: [
|
|
783
783
|
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: P(c, "0,0.00") }),
|
|
784
784
|
/* @__PURE__ */ e(
|
|
785
785
|
l,
|
|
786
786
|
{
|
|
787
787
|
bold: !0,
|
|
788
|
-
color:
|
|
788
|
+
color: n.palette.success.main,
|
|
789
789
|
textAlign: "end",
|
|
790
790
|
variant: "tiny",
|
|
791
791
|
children: `+${P(p, "0,0")}`
|
|
@@ -795,8 +795,8 @@ const Ee = ({
|
|
|
795
795
|
]
|
|
796
796
|
}
|
|
797
797
|
) }) }, String(d))),
|
|
798
|
-
/* @__PURE__ */ e(
|
|
799
|
-
|
|
798
|
+
/* @__PURE__ */ e(f, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
|
|
799
|
+
f,
|
|
800
800
|
{
|
|
801
801
|
sx: {
|
|
802
802
|
alignItems: "center",
|
|
@@ -812,26 +812,26 @@ const Ee = ({
|
|
|
812
812
|
}
|
|
813
813
|
) })
|
|
814
814
|
] }) });
|
|
815
|
-
}, Mt = D(It), kt = D(({ debt:
|
|
816
|
-
const { debts:
|
|
817
|
-
await t({ ...
|
|
815
|
+
}, Mt = D(It), kt = D(({ debt: n }) => {
|
|
816
|
+
const { debts: o } = C(), { updateAccount: t } = te(), { onEvent: r } = B(), [a, i] = x.useState(n.interest_rate ?? 0), d = a < 0, c = async () => {
|
|
817
|
+
await t({ ...n.account, interest_rate: a }), n.interest_rate = a, r(A.DEBTS_SAVE_RATE_ACTION, { account_guid: n.guid });
|
|
818
818
|
}, p = () => {
|
|
819
819
|
setTimeout(() => {
|
|
820
|
-
i(
|
|
820
|
+
i(n.interest_rate ?? 0);
|
|
821
821
|
}, 250);
|
|
822
822
|
};
|
|
823
823
|
return /* @__PURE__ */ e(
|
|
824
|
-
|
|
824
|
+
ne,
|
|
825
825
|
{
|
|
826
826
|
isSaveDisabled: d,
|
|
827
|
-
label: `${
|
|
827
|
+
label: `${o.details_interest_rate} (%)`,
|
|
828
828
|
onCancel: p,
|
|
829
829
|
onSave: c,
|
|
830
|
-
primaryText:
|
|
831
|
-
secondaryText: je(Number(
|
|
832
|
-
zeroStateText:
|
|
830
|
+
primaryText: o.details_interest_rate,
|
|
831
|
+
secondaryText: je(Number(n.interest_rate) / 100),
|
|
832
|
+
zeroStateText: n.interest_rate ? void 0 : o.add_interest_rate,
|
|
833
833
|
children: /* @__PURE__ */ e(
|
|
834
|
-
|
|
834
|
+
ot,
|
|
835
835
|
{
|
|
836
836
|
error: d,
|
|
837
837
|
fullWidth: !0,
|
|
@@ -842,24 +842,24 @@ const Ee = ({
|
|
|
842
842
|
)
|
|
843
843
|
}
|
|
844
844
|
);
|
|
845
|
-
}), Nt = D(({ debt:
|
|
846
|
-
const { debts:
|
|
847
|
-
await t({ ...
|
|
845
|
+
}), Nt = D(({ debt: n }) => {
|
|
846
|
+
const { debts: o } = C(), { updateAccount: t } = te(), { onEvent: r } = B(), [a, i] = x.useState(n.monthly_payment ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
|
|
847
|
+
await t({ ...n.account, minimum_payment: a }), n.monthly_payment = a, r(A.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: n.guid });
|
|
848
848
|
}, p = () => {
|
|
849
849
|
setTimeout(() => {
|
|
850
|
-
i(
|
|
850
|
+
i(n.monthly_payment ?? 0);
|
|
851
851
|
}, 250);
|
|
852
852
|
};
|
|
853
853
|
return /* @__PURE__ */ e(
|
|
854
|
-
|
|
854
|
+
ne,
|
|
855
855
|
{
|
|
856
856
|
isSaveDisabled: d,
|
|
857
|
-
label:
|
|
857
|
+
label: o.details_monthly_payment,
|
|
858
858
|
onCancel: p,
|
|
859
859
|
onSave: c,
|
|
860
|
-
primaryText:
|
|
861
|
-
secondaryText: P(
|
|
862
|
-
zeroStateText:
|
|
860
|
+
primaryText: o.details_monthly_payment,
|
|
861
|
+
secondaryText: P(n.monthly_payment, "0,0"),
|
|
862
|
+
zeroStateText: n.monthly_payment ? void 0 : o.add_monthly_payment,
|
|
863
863
|
children: /* @__PURE__ */ e(
|
|
864
864
|
se,
|
|
865
865
|
{
|
|
@@ -874,24 +874,24 @@ const Ee = ({
|
|
|
874
874
|
)
|
|
875
875
|
}
|
|
876
876
|
);
|
|
877
|
-
}), Pt = D(({ debt:
|
|
878
|
-
const { debts:
|
|
879
|
-
await t({ ...
|
|
877
|
+
}), Pt = D(({ debt: n }) => {
|
|
878
|
+
const { debts: o } = C(), { updateAccount: t } = te(), { onEvent: r } = B(), [a, i] = x.useState(n.original_balance ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
|
|
879
|
+
await t({ ...n.account, original_balance: a }), n.original_balance = a, r(A.DEBTS_SAVE_BALANCE_ACTION, { account_guid: n.guid });
|
|
880
880
|
}, p = () => {
|
|
881
881
|
setTimeout(() => {
|
|
882
|
-
i(
|
|
882
|
+
i(n.original_balance ?? 0);
|
|
883
883
|
}, 250);
|
|
884
884
|
};
|
|
885
885
|
return /* @__PURE__ */ e(
|
|
886
|
-
|
|
886
|
+
ne,
|
|
887
887
|
{
|
|
888
888
|
isSaveDisabled: d,
|
|
889
|
-
label:
|
|
889
|
+
label: o.details_original_balance,
|
|
890
890
|
onCancel: p,
|
|
891
891
|
onSave: c,
|
|
892
|
-
primaryText:
|
|
893
|
-
secondaryText: P(
|
|
894
|
-
zeroStateText:
|
|
892
|
+
primaryText: o.details_original_balance,
|
|
893
|
+
secondaryText: P(n.original_balance, "0,0"),
|
|
894
|
+
zeroStateText: n.original_balance ? void 0 : o.add_original_balance,
|
|
895
895
|
children: /* @__PURE__ */ e(
|
|
896
896
|
se,
|
|
897
897
|
{
|
|
@@ -907,31 +907,31 @@ const Ee = ({
|
|
|
907
907
|
}
|
|
908
908
|
);
|
|
909
909
|
}), Rt = () => {
|
|
910
|
-
const { onEvent:
|
|
911
|
-
return
|
|
912
|
-
|
|
913
|
-
/* @__PURE__ */ e(tt, { goal:
|
|
910
|
+
const { onEvent: n } = B(), { selectedDebtChartData: o } = L();
|
|
911
|
+
return x.useEffect(() => n(A.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(f, { bgcolor: "background.paper", children: [
|
|
912
|
+
o?.goal && /* @__PURE__ */ s($, { children: [
|
|
913
|
+
/* @__PURE__ */ e(tt, { goal: o.goal }),
|
|
914
914
|
/* @__PURE__ */ e(G, {}),
|
|
915
|
-
/* @__PURE__ */ e(rt, { goal:
|
|
915
|
+
/* @__PURE__ */ e(rt, { goal: o.goal }),
|
|
916
916
|
/* @__PURE__ */ e(G, {}),
|
|
917
|
-
/* @__PURE__ */ e(
|
|
917
|
+
/* @__PURE__ */ e(nt, { goal: o.goal }),
|
|
918
918
|
/* @__PURE__ */ e(G, {})
|
|
919
919
|
] }),
|
|
920
|
-
!
|
|
921
|
-
/* @__PURE__ */ e(Nt, { debt:
|
|
920
|
+
!o?.goal && o?.account && /* @__PURE__ */ s($, { children: [
|
|
921
|
+
/* @__PURE__ */ e(Nt, { debt: o }),
|
|
922
922
|
/* @__PURE__ */ e(G, {}),
|
|
923
|
-
/* @__PURE__ */ e(kt, { debt:
|
|
923
|
+
/* @__PURE__ */ e(kt, { debt: o }),
|
|
924
924
|
/* @__PURE__ */ e(G, {}),
|
|
925
|
-
/* @__PURE__ */ e(Pt, { debt:
|
|
925
|
+
/* @__PURE__ */ e(Pt, { debt: o }),
|
|
926
926
|
/* @__PURE__ */ e(G, {})
|
|
927
927
|
] })
|
|
928
928
|
] });
|
|
929
|
-
}, Bt = D(Rt), Ft = ({ setTabValue:
|
|
929
|
+
}, Bt = D(Rt), Ft = ({ setTabValue: n, sx: o }) => {
|
|
930
930
|
const { debts: t } = C(), { showError: r, showCompleted: a } = L();
|
|
931
|
-
return
|
|
932
|
-
r &&
|
|
933
|
-
}, [r]), !r && !a ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ s(
|
|
934
|
-
/* @__PURE__ */ e(ge, { sx: { my: 16, mx: 24, ...
|
|
931
|
+
return x.useEffect(() => {
|
|
932
|
+
r && n(1);
|
|
933
|
+
}, [r]), !r && !a ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ s(f, { gap: 16, children: [
|
|
934
|
+
/* @__PURE__ */ e(ge, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
|
|
935
935
|
fe,
|
|
936
936
|
{
|
|
937
937
|
icon: r ? /* @__PURE__ */ e(at, { filled: !0 }) : /* @__PURE__ */ e(Se, { color: "success", filled: !0 }),
|
|
@@ -952,7 +952,7 @@ const Ee = ({
|
|
|
952
952
|
]
|
|
953
953
|
}
|
|
954
954
|
) }),
|
|
955
|
-
r && /* @__PURE__ */ e(ge, { sx: { mb: 16, mt: 100, mx: 24, ...
|
|
955
|
+
r && /* @__PURE__ */ e(ge, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
|
|
956
956
|
fe,
|
|
957
957
|
{
|
|
958
958
|
icon: /* @__PURE__ */ e($, {}),
|
|
@@ -972,13 +972,13 @@ const Ee = ({
|
|
|
972
972
|
) })
|
|
973
973
|
] });
|
|
974
974
|
}, Lt = D(Ft), $t = () => {
|
|
975
|
-
const { debts:
|
|
975
|
+
const { debts: n } = C(), { showError: o, showCompleted: t } = L(), [r, a] = x.useState(0);
|
|
976
976
|
return /* @__PURE__ */ s($, { children: [
|
|
977
|
-
(
|
|
977
|
+
(o || t) && /* @__PURE__ */ e(Lt, { setTabValue: a, sx: { mt: -24 } }),
|
|
978
978
|
/* @__PURE__ */ s(
|
|
979
979
|
et,
|
|
980
980
|
{
|
|
981
|
-
"aria-label":
|
|
981
|
+
"aria-label": n.details_tabs_aria_label,
|
|
982
982
|
centered: !0,
|
|
983
983
|
onChange: (i, d) => a(d),
|
|
984
984
|
textColor: "primary",
|
|
@@ -990,7 +990,7 @@ const Ee = ({
|
|
|
990
990
|
{
|
|
991
991
|
"aria-controls": "debt-schedule-tabpanel-0",
|
|
992
992
|
id: "debt-schedule-tab-0",
|
|
993
|
-
label:
|
|
993
|
+
label: n.schedule_tab_label
|
|
994
994
|
}
|
|
995
995
|
),
|
|
996
996
|
/* @__PURE__ */ e(
|
|
@@ -998,7 +998,7 @@ const Ee = ({
|
|
|
998
998
|
{
|
|
999
999
|
"aria-controls": "debt-details-tabpanel-1",
|
|
1000
1000
|
id: "debt-details-tab-1",
|
|
1001
|
-
label:
|
|
1001
|
+
label: n.details_tab_label
|
|
1002
1002
|
}
|
|
1003
1003
|
)
|
|
1004
1004
|
]
|
|
@@ -1007,41 +1007,41 @@ const Ee = ({
|
|
|
1007
1007
|
/* @__PURE__ */ e(we, { index: 0, name: "debt-schedule", value: r, children: /* @__PURE__ */ e(Mt, {}) }),
|
|
1008
1008
|
/* @__PURE__ */ e(we, { index: 1, name: "debt-details", value: r, children: /* @__PURE__ */ e(Bt, {}) })
|
|
1009
1009
|
] });
|
|
1010
|
-
}, Ot = D($t), Ht = ({ isOpen:
|
|
1010
|
+
}, Ot = D($t), Ht = ({ isOpen: n, onClose: o }) => {
|
|
1011
1011
|
const { debts: t } = C(), { showError: r, showCompleted: a } = L(), i = r || a ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(Et, {});
|
|
1012
1012
|
return /* @__PURE__ */ e(
|
|
1013
1013
|
ie,
|
|
1014
1014
|
{
|
|
1015
1015
|
ariaLabelClose: t.details_close_aria,
|
|
1016
|
-
isOpen:
|
|
1017
|
-
onClose:
|
|
1016
|
+
isOpen: n,
|
|
1017
|
+
onClose: o,
|
|
1018
1018
|
title: t.details_title,
|
|
1019
|
-
children: /* @__PURE__ */ s(
|
|
1019
|
+
children: /* @__PURE__ */ s(f, { bgcolor: "background.default", children: [
|
|
1020
1020
|
/* @__PURE__ */ e(Ke, { customDetailsChart: i }),
|
|
1021
1021
|
/* @__PURE__ */ e(Ot, {})
|
|
1022
1022
|
] })
|
|
1023
1023
|
}
|
|
1024
1024
|
);
|
|
1025
1025
|
}, Wt = D(() => {
|
|
1026
|
-
const { debts:
|
|
1027
|
-
|
|
1028
|
-
user_guid:
|
|
1026
|
+
const { debts: n } = C(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: t } = V(), { onEvent: r } = B(), [a, i] = x.useState(o?.extra_payment ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
|
|
1027
|
+
o && (await t({ ...o, extra_payment: a }), o.extra_payment = a, r(A.DEBTS_SAVE_PAYDOWN_ACTION, {
|
|
1028
|
+
user_guid: o?.user_guid
|
|
1029
1029
|
}));
|
|
1030
1030
|
}, p = () => {
|
|
1031
1031
|
setTimeout(() => {
|
|
1032
|
-
i(
|
|
1032
|
+
i(o?.extra_payment ?? 0);
|
|
1033
1033
|
}, 250);
|
|
1034
1034
|
};
|
|
1035
1035
|
return /* @__PURE__ */ e(
|
|
1036
|
-
|
|
1036
|
+
ne,
|
|
1037
1037
|
{
|
|
1038
1038
|
isSaveDisabled: d,
|
|
1039
|
-
label:
|
|
1039
|
+
label: n.paydown_drawer_extra_payment,
|
|
1040
1040
|
onCancel: p,
|
|
1041
1041
|
onSave: c,
|
|
1042
|
-
primaryText:
|
|
1043
|
-
secondaryText: P(
|
|
1044
|
-
zeroStateText:
|
|
1042
|
+
primaryText: n.paydown_drawer_extra_payment,
|
|
1043
|
+
secondaryText: P(o?.extra_payment, "0,0"),
|
|
1044
|
+
zeroStateText: o?.extra_payment ? void 0 : n.add_extra_payment,
|
|
1045
1045
|
children: /* @__PURE__ */ e(
|
|
1046
1046
|
se,
|
|
1047
1047
|
{
|
|
@@ -1057,57 +1057,57 @@ const Ee = ({
|
|
|
1057
1057
|
}
|
|
1058
1058
|
);
|
|
1059
1059
|
}), Gt = () => {
|
|
1060
|
-
const { debts:
|
|
1061
|
-
return /* @__PURE__ */ s(
|
|
1062
|
-
/* @__PURE__ */ s(
|
|
1063
|
-
/* @__PURE__ */ s(
|
|
1064
|
-
/* @__PURE__ */ e(l, { variant: "body1", children:
|
|
1065
|
-
/* @__PURE__ */ e(ve, { bold: !0, variant: "h1", children: P(
|
|
1066
|
-
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "body2", width: 208, children:
|
|
1060
|
+
const { debts: n } = C(), { totalMonthlyPayments: o } = ee(), { monthlyCashFlowProfile: t } = V(), r = o + Number(t?.extra_payment);
|
|
1061
|
+
return /* @__PURE__ */ s(f, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
1062
|
+
/* @__PURE__ */ s(f, { p: 24, children: [
|
|
1063
|
+
/* @__PURE__ */ s(f, { alignItems: "center", gap: 4, mb: 24, children: [
|
|
1064
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: n.paydown_drawer_mimimum_label }),
|
|
1065
|
+
/* @__PURE__ */ e(ve, { bold: !0, variant: "h1", children: P(o, "0,0") }),
|
|
1066
|
+
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "body2", width: 208, children: n.paydown_drawer_minimum_info })
|
|
1067
1067
|
] }),
|
|
1068
|
-
/* @__PURE__ */ s(
|
|
1069
|
-
/* @__PURE__ */ e(l, { variant: "h3", children:
|
|
1070
|
-
/* @__PURE__ */ e(l, { truncate: !1, variant: "subtitle2", children:
|
|
1068
|
+
/* @__PURE__ */ s(f, { children: [
|
|
1069
|
+
/* @__PURE__ */ e(l, { variant: "h3", children: n.paydown_drawer_subtitle }),
|
|
1070
|
+
/* @__PURE__ */ e(l, { truncate: !1, variant: "subtitle2", children: n.paydown_drawer_description })
|
|
1071
1071
|
] })
|
|
1072
1072
|
] }),
|
|
1073
|
-
/* @__PURE__ */ e(
|
|
1074
|
-
/* @__PURE__ */ e(
|
|
1075
|
-
/* @__PURE__ */ e(l, { variant: "body2", children:
|
|
1073
|
+
/* @__PURE__ */ e(f, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Wt, {}) }),
|
|
1074
|
+
/* @__PURE__ */ e(f, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(f, { gap: 4, children: [
|
|
1075
|
+
/* @__PURE__ */ e(l, { variant: "body2", children: n.paydown_drawer_total_payment }),
|
|
1076
1076
|
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "body1", children: P(r, "0,0") })
|
|
1077
1077
|
] }) })
|
|
1078
1078
|
] });
|
|
1079
|
-
}, jt = D(Gt), zt = ({ isOpen:
|
|
1079
|
+
}, jt = D(Gt), zt = ({ isOpen: n, onClose: o }) => {
|
|
1080
1080
|
const { debts: t } = C();
|
|
1081
1081
|
return /* @__PURE__ */ e(
|
|
1082
1082
|
ie,
|
|
1083
1083
|
{
|
|
1084
1084
|
ariaLabelClose: t.paydown_drawer_close_aria,
|
|
1085
|
-
isOpen:
|
|
1086
|
-
onClose:
|
|
1085
|
+
isOpen: n,
|
|
1086
|
+
onClose: o,
|
|
1087
1087
|
title: t.paydown_drawer_title,
|
|
1088
1088
|
children: /* @__PURE__ */ e(jt, {})
|
|
1089
1089
|
}
|
|
1090
1090
|
);
|
|
1091
1091
|
};
|
|
1092
|
-
function Yt(
|
|
1092
|
+
function Yt(n, o) {
|
|
1093
1093
|
const t = (r) => {
|
|
1094
1094
|
if (typeof r == "number") return r;
|
|
1095
1095
|
if (r === "!" || r === "✓") return 1 / 0;
|
|
1096
1096
|
throw new Error("Unsupported value");
|
|
1097
1097
|
};
|
|
1098
|
-
return t(
|
|
1098
|
+
return t(n) - t(o);
|
|
1099
1099
|
}
|
|
1100
|
-
function Vt(
|
|
1101
|
-
return
|
|
1100
|
+
function Vt(n) {
|
|
1101
|
+
return n.is_paid_off ? "✓" : n.priority === void 0 || n.is_impossible ? "!" : n.priority;
|
|
1102
1102
|
}
|
|
1103
|
-
const Kt = (
|
|
1104
|
-
const
|
|
1103
|
+
const Kt = (n) => {
|
|
1104
|
+
const o = {
|
|
1105
1105
|
text: "#121417",
|
|
1106
1106
|
background: "#FFB252"
|
|
1107
1107
|
};
|
|
1108
|
-
return
|
|
1109
|
-
}, Ut = (
|
|
1110
|
-
const
|
|
1108
|
+
return n === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), n === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
|
|
1109
|
+
}, Ut = (n) => {
|
|
1110
|
+
const o = String(n.formattedValue), t = Kt(o);
|
|
1111
1111
|
return /* @__PURE__ */ e(
|
|
1112
1112
|
le,
|
|
1113
1113
|
{
|
|
@@ -1122,32 +1122,32 @@ const Kt = (o) => {
|
|
|
1122
1122
|
backgroundColor: t.background,
|
|
1123
1123
|
marginLeft: "10px"
|
|
1124
1124
|
},
|
|
1125
|
-
children: /* @__PURE__ */ e(l, { color: t.text, fontWeight: 700, variant: "body2", children:
|
|
1125
|
+
children: /* @__PURE__ */ e(l, { color: t.text, fontWeight: 700, variant: "body2", children: o })
|
|
1126
1126
|
}
|
|
1127
1127
|
);
|
|
1128
|
-
}, qt = (
|
|
1129
|
-
const
|
|
1130
|
-
return /* @__PURE__ */ s(
|
|
1128
|
+
}, qt = (n) => {
|
|
1129
|
+
const o = n.row.account, t = lt[o.account_type];
|
|
1130
|
+
return /* @__PURE__ */ s(f, { alignItems: "center", flexDirection: "row", children: [
|
|
1131
1131
|
/* @__PURE__ */ e(
|
|
1132
1132
|
$e,
|
|
1133
1133
|
{
|
|
1134
|
-
alt: `${
|
|
1135
|
-
institutionGuid:
|
|
1134
|
+
alt: `${o.institutionName}`,
|
|
1135
|
+
institutionGuid: o.institution_guid || ""
|
|
1136
1136
|
}
|
|
1137
1137
|
),
|
|
1138
|
-
/* @__PURE__ */ s(
|
|
1139
|
-
/* @__PURE__ */ e(l, { variant: "body2", children:
|
|
1138
|
+
/* @__PURE__ */ s(f, { ml: 12, children: [
|
|
1139
|
+
/* @__PURE__ */ e(l, { variant: "body2", children: o.name }),
|
|
1140
1140
|
/* @__PURE__ */ e(l, { variant: "caption", children: t })
|
|
1141
1141
|
] })
|
|
1142
1142
|
] });
|
|
1143
1143
|
}, Xt = ({
|
|
1144
|
-
sx:
|
|
1145
|
-
debts:
|
|
1144
|
+
sx: n = {},
|
|
1145
|
+
debts: o,
|
|
1146
1146
|
hoveredDebtGuid: t,
|
|
1147
1147
|
onHoverRow: r,
|
|
1148
1148
|
onClickRow: a
|
|
1149
1149
|
}) => {
|
|
1150
|
-
const i = Y(), { onEvent: d } = B(), { isMobile: c } = re(), { debts: p, common: h } = C(), [u, w] =
|
|
1150
|
+
const i = Y(), { onEvent: d } = B(), { isMobile: c } = re(), { debts: p, common: h } = C(), [u, w] = x.useState([
|
|
1151
1151
|
{ field: "priority", sort: "asc" }
|
|
1152
1152
|
]), b = [
|
|
1153
1153
|
{
|
|
@@ -1242,12 +1242,12 @@ const Kt = (o) => {
|
|
|
1242
1242
|
headerAlign: "right",
|
|
1243
1243
|
width: 20
|
|
1244
1244
|
}
|
|
1245
|
-
], M =
|
|
1245
|
+
], M = x.useMemo(() => o.map((y, m) => ({
|
|
1246
1246
|
...y,
|
|
1247
1247
|
id: m,
|
|
1248
1248
|
priority: Vt(y)
|
|
1249
|
-
})), [
|
|
1250
|
-
const T = y.target.closest("[data-id]")?.getAttribute("data-id"), R =
|
|
1249
|
+
})), [o]), k = (y) => {
|
|
1250
|
+
const T = y.target.closest("[data-id]")?.getAttribute("data-id"), R = o[Number(T)];
|
|
1251
1251
|
r?.(R?.guid ?? "");
|
|
1252
1252
|
}, v = (y) => {
|
|
1253
1253
|
c || k(y);
|
|
@@ -1264,7 +1264,7 @@ const Kt = (o) => {
|
|
|
1264
1264
|
overflowX: "auto",
|
|
1265
1265
|
overflowY: "visible",
|
|
1266
1266
|
boxShadow: "none",
|
|
1267
|
-
...
|
|
1267
|
+
...n
|
|
1268
1268
|
},
|
|
1269
1269
|
children: /* @__PURE__ */ e(
|
|
1270
1270
|
it,
|
|
@@ -1304,8 +1304,8 @@ const Kt = (o) => {
|
|
|
1304
1304
|
}
|
|
1305
1305
|
);
|
|
1306
1306
|
}, Zt = ({
|
|
1307
|
-
buttonText:
|
|
1308
|
-
disabled:
|
|
1307
|
+
buttonText: n,
|
|
1308
|
+
disabled: o,
|
|
1309
1309
|
isOpen: t,
|
|
1310
1310
|
onClick: r
|
|
1311
1311
|
}) => {
|
|
@@ -1317,11 +1317,11 @@ const Kt = (o) => {
|
|
|
1317
1317
|
"aria-describedby": "prioritize-debts",
|
|
1318
1318
|
"aria-haspopup": !0,
|
|
1319
1319
|
"aria-label": "prioritize-debts",
|
|
1320
|
-
disabled:
|
|
1320
|
+
disabled: o,
|
|
1321
1321
|
onClick: r,
|
|
1322
1322
|
startIcon: /* @__PURE__ */ e(ae, { name: i }),
|
|
1323
1323
|
sx: { justifyContent: "start" },
|
|
1324
|
-
children:
|
|
1324
|
+
children: n
|
|
1325
1325
|
}
|
|
1326
1326
|
) : /* @__PURE__ */ e(
|
|
1327
1327
|
st,
|
|
@@ -1330,13 +1330,13 @@ const Kt = (o) => {
|
|
|
1330
1330
|
"aria-describedby": "prioritize-debts",
|
|
1331
1331
|
"aria-haspopup": !0,
|
|
1332
1332
|
"aria-label": "prioritize-debts",
|
|
1333
|
-
disabled:
|
|
1333
|
+
disabled: o,
|
|
1334
1334
|
onClick: r,
|
|
1335
1335
|
children: /* @__PURE__ */ e(ae, { name: i })
|
|
1336
1336
|
}
|
|
1337
1337
|
);
|
|
1338
|
-
}, Jt = D(({ buttonEl:
|
|
1339
|
-
const { onEvent: t } = B(), { debts: r } = C(), { selectedDebtPriority: a, setSelectedDebtPriority: i } = L(), d = !!
|
|
1338
|
+
}, Jt = D(({ buttonEl: n, onClose: o }) => {
|
|
1339
|
+
const { onEvent: t } = B(), { debts: r } = C(), { selectedDebtPriority: a, setSelectedDebtPriority: i } = L(), d = !!n, c = [
|
|
1340
1340
|
{
|
|
1341
1341
|
priority: N.FASTEST_PAYOFF_FIRST,
|
|
1342
1342
|
text: r.priority_sort_fastest_payoff
|
|
@@ -1359,13 +1359,13 @@ const Kt = (o) => {
|
|
|
1359
1359
|
return /* @__PURE__ */ e(
|
|
1360
1360
|
dt,
|
|
1361
1361
|
{
|
|
1362
|
-
anchorEl:
|
|
1362
|
+
anchorEl: n,
|
|
1363
1363
|
anchorOrigin: {
|
|
1364
1364
|
vertical: "bottom",
|
|
1365
1365
|
horizontal: "left"
|
|
1366
1366
|
},
|
|
1367
1367
|
id: "prioritize-debts",
|
|
1368
|
-
onClose:
|
|
1368
|
+
onClose: o,
|
|
1369
1369
|
open: d,
|
|
1370
1370
|
transformOrigin: {
|
|
1371
1371
|
vertical: "top",
|
|
@@ -1398,12 +1398,12 @@ const Kt = (o) => {
|
|
|
1398
1398
|
)) })
|
|
1399
1399
|
}
|
|
1400
1400
|
);
|
|
1401
|
-
}), Qt = D(({ disabled:
|
|
1402
|
-
const { onEvent:
|
|
1403
|
-
i(u.currentTarget),
|
|
1401
|
+
}), Qt = D(({ disabled: n }) => {
|
|
1402
|
+
const { onEvent: o } = B(), { debts: t } = C(), { selectedDebtPriority: r } = L(), [a, i] = x.useState(null), d = (u) => {
|
|
1403
|
+
i(u.currentTarget), o(A.DEBTS_CLICK_PRIORITIZE);
|
|
1404
1404
|
}, c = () => {
|
|
1405
1405
|
i(null);
|
|
1406
|
-
}, p = !!a, h =
|
|
1406
|
+
}, p = !!a, h = x.useMemo(() => ({
|
|
1407
1407
|
[N.FASTEST_PAYOFF_FIRST]: t.priority_sort_fastest_payoff,
|
|
1408
1408
|
[N.HIGHEST_INTEREST]: t.priority_sort_highest_interest,
|
|
1409
1409
|
[N.HIGHEST_BALANCE]: t.priority_sort_highest_balance,
|
|
@@ -1414,16 +1414,16 @@ const Kt = (o) => {
|
|
|
1414
1414
|
Zt,
|
|
1415
1415
|
{
|
|
1416
1416
|
buttonText: h,
|
|
1417
|
-
disabled:
|
|
1417
|
+
disabled: n,
|
|
1418
1418
|
isOpen: p,
|
|
1419
1419
|
onClick: d
|
|
1420
1420
|
}
|
|
1421
1421
|
),
|
|
1422
1422
|
/* @__PURE__ */ e(Jt, { buttonEl: a, onClose: c })
|
|
1423
1423
|
] });
|
|
1424
|
-
}), er = (
|
|
1425
|
-
const r =
|
|
1426
|
-
Ae(r,
|
|
1424
|
+
}), er = (n, o, t = 0) => {
|
|
1425
|
+
const r = n.map((p) => ({ ...p }));
|
|
1426
|
+
Ae(r, o);
|
|
1427
1427
|
const a = /* @__PURE__ */ new Date(), i = [];
|
|
1428
1428
|
let d = 0, c = 1;
|
|
1429
1429
|
for (const p of r)
|
|
@@ -1458,27 +1458,27 @@ const Kt = (o) => {
|
|
|
1458
1458
|
}), i.forEach((p) => {
|
|
1459
1459
|
p.priority = !p.is_paid_off && !p.is_impossible ? c++ : void 0;
|
|
1460
1460
|
}), i;
|
|
1461
|
-
}, tr = (
|
|
1462
|
-
description:
|
|
1463
|
-
header:
|
|
1464
|
-
onClickHandler:
|
|
1465
|
-
primaryButton:
|
|
1466
|
-
}), rr = D(({ disabled:
|
|
1461
|
+
}, tr = (n, o, t) => ({
|
|
1462
|
+
description: o ? n.empty_state_description : n.empty_state_description_no_aggregation,
|
|
1463
|
+
header: o ? n.empty_state_header : n.empty_state_header_no_aggregation,
|
|
1464
|
+
onClickHandler: o ? t : void 0,
|
|
1465
|
+
primaryButton: o ? n.connect_accounts : void 0
|
|
1466
|
+
}), rr = D(({ disabled: n, onClick: o }) => {
|
|
1467
1467
|
const { debts: t } = C(), { totalMonthlyPayments: r } = ee(), { monthlyCashFlowProfile: a } = V(), i = r + Number(a?.extra_payment), d = t.paydown_button_long;
|
|
1468
|
-
return /* @__PURE__ */ e(
|
|
1468
|
+
return /* @__PURE__ */ e(f, { alignItems: "center", sx: { flex: 1, flexShrink: 0 }, children: /* @__PURE__ */ e(
|
|
1469
1469
|
Te,
|
|
1470
1470
|
{
|
|
1471
1471
|
"aria-controls": "extra-paydown",
|
|
1472
1472
|
"aria-describedby": "extra-paydown",
|
|
1473
1473
|
"aria-haspopup": !0,
|
|
1474
1474
|
"aria-label": "extra-paydown",
|
|
1475
|
-
disabled:
|
|
1476
|
-
onClick:
|
|
1475
|
+
disabled: n,
|
|
1476
|
+
onClick: o,
|
|
1477
1477
|
sx: { justifyContent: "start" },
|
|
1478
1478
|
children: E(d, P(i, "0,0"))
|
|
1479
1479
|
}
|
|
1480
|
-
);
|
|
1481
|
-
}),
|
|
1480
|
+
) });
|
|
1481
|
+
}), nr = ({ onBackClick: n, onMenuClick: o, sx: t }) => {
|
|
1482
1482
|
const { isDesktop: r, isMobile: a } = re(), { connect: i, debts: d } = C(), { onEvent: c } = B(), {
|
|
1483
1483
|
config: { show_connections_widget_in_master: p }
|
|
1484
1484
|
} = Ye(), { isInitialized: h } = Ve(), { setSelectedAccount: u } = Ue(), { selectedDebtPriority: w, setSelectedDebtChartData: b } = L(), {
|
|
@@ -1486,22 +1486,22 @@ const Kt = (o) => {
|
|
|
1486
1486
|
loadAccountData: M,
|
|
1487
1487
|
detailedAccounts: k,
|
|
1488
1488
|
visibleDebtAccounts: v
|
|
1489
|
-
} = te(), { isAllGoalDataLoaded: S, loadGoalData: O, monthlyCashFlowProfile: y } = V(), { debts: m } = ee(), [g, T] =
|
|
1489
|
+
} = te(), { isAllGoalDataLoaded: S, loadGoalData: O, monthlyCashFlowProfile: y } = V(), { debts: m } = ee(), [g, T] = x.useState(!1), [R, F] = x.useState(!1), [K, ce] = x.useState(!1), [U, Ie] = x.useState(""), [Me, de] = x.useState(!1);
|
|
1490
1490
|
ht({
|
|
1491
1491
|
widgetName: "DebtsWidget",
|
|
1492
1492
|
isLoaded: S
|
|
1493
1493
|
});
|
|
1494
|
-
const q =
|
|
1494
|
+
const q = x.useMemo(() => {
|
|
1495
1495
|
const H = y?.extra_payment ?? 0;
|
|
1496
1496
|
return er(m, w, H);
|
|
1497
1497
|
}, [m, w, y]);
|
|
1498
|
-
|
|
1498
|
+
x.useEffect(() => {
|
|
1499
1499
|
I || M().finally(), c(A.DEBTS_VIEW);
|
|
1500
|
-
}, []),
|
|
1500
|
+
}, []), x.useEffect(() => {
|
|
1501
1501
|
h && O().finally();
|
|
1502
1502
|
}, [h]);
|
|
1503
1503
|
const pe = (H) => Ie(H), he = () => {
|
|
1504
|
-
const H = v.find((
|
|
1504
|
+
const H = v.find((oe) => oe.guid === U), me = q.find((oe) => oe.guid === U);
|
|
1505
1505
|
H && u(H), me && b(me), T(!0);
|
|
1506
1506
|
}, ke = () => c(A.DEBTS_CLICK_FILTER), Ne = () => {
|
|
1507
1507
|
ce(!0), c(A.DEBTS_CLICK_SNOWBALL_CTA);
|
|
@@ -1528,13 +1528,13 @@ const Kt = (o) => {
|
|
|
1528
1528
|
],
|
|
1529
1529
|
hasDivider: !0,
|
|
1530
1530
|
onAccountsFilterClick: ke,
|
|
1531
|
-
onBackClick:
|
|
1532
|
-
onMenuClick:
|
|
1531
|
+
onBackClick: n,
|
|
1532
|
+
onMenuClick: o,
|
|
1533
1533
|
slotComponent: /* @__PURE__ */ e(rr, { disabled: X, onClick: Pe }, "extra-paydown"),
|
|
1534
1534
|
sx: t,
|
|
1535
1535
|
title: d.title,
|
|
1536
1536
|
children: [
|
|
1537
|
-
/* @__PURE__ */ s(
|
|
1537
|
+
/* @__PURE__ */ s(f, { sx: { pt: 48, px: r ? "48px" : "24px" }, children: [
|
|
1538
1538
|
X && /* @__PURE__ */ e(
|
|
1539
1539
|
bt,
|
|
1540
1540
|
{
|
|
@@ -1548,7 +1548,7 @@ const Kt = (o) => {
|
|
|
1548
1548
|
),
|
|
1549
1549
|
!X && /* @__PURE__ */ s($, { children: [
|
|
1550
1550
|
/* @__PURE__ */ s(
|
|
1551
|
-
|
|
1551
|
+
f,
|
|
1552
1552
|
{
|
|
1553
1553
|
sx: {
|
|
1554
1554
|
alignItems: a ? "flex-start" : "flex-end",
|
|
@@ -1578,7 +1578,7 @@ const Kt = (o) => {
|
|
|
1578
1578
|
]
|
|
1579
1579
|
}
|
|
1580
1580
|
),
|
|
1581
|
-
/* @__PURE__ */ e(
|
|
1581
|
+
/* @__PURE__ */ e(f, { sx: { mx: a ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1582
1582
|
Xt,
|
|
1583
1583
|
{
|
|
1584
1584
|
debts: q,
|
|
@@ -1609,10 +1609,10 @@ const Kt = (o) => {
|
|
|
1609
1609
|
]
|
|
1610
1610
|
}
|
|
1611
1611
|
);
|
|
1612
|
-
},
|
|
1612
|
+
}, en = D(nr);
|
|
1613
1613
|
export {
|
|
1614
1614
|
Ee as DebtsChart,
|
|
1615
|
-
|
|
1615
|
+
nn as DebtsStore,
|
|
1616
1616
|
Xt as DebtsTable,
|
|
1617
|
-
|
|
1617
|
+
en as DebtsWidget
|
|
1618
1618
|
};
|