@mx-cartographer/experiences 7.10.0 → 7.10.1-alpha-bugtesting-debtstable-ram
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 +4 -0
- package/dist/debts/index.es.js +106 -120
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/debts/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as O } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import
|
|
2
|
+
import g from "react";
|
|
3
|
+
import { observer as D } from "mobx-react-lite";
|
|
4
|
+
import x from "@mui/material/Stack";
|
|
5
5
|
import { useTheme as V, Card as _e, Stack as _, Box as W } from "@mui/material";
|
|
6
|
-
import { Text as l, P as ye, H3 as Te, InstitutionLogo as Ae, Icon as
|
|
6
|
+
import { Text as l, P as ye, H3 as Te, InstitutionLogo as Ae, Icon as le } from "@mxenabled/mxui";
|
|
7
7
|
import { intervalToDuration as Ee, formatDuration as Ie } from "date-fns";
|
|
8
8
|
import { addMonths as se } from "date-fns/addMonths";
|
|
9
9
|
import { fromUnixTime as ce } from "date-fns/fromUnixTime";
|
|
@@ -14,13 +14,13 @@ import { f as N, a as Pe } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
|
14
14
|
import { f as U, D as q } from "../Dialog-CwiqpTGe.mjs";
|
|
15
15
|
import { G as ke, w as Z, u as S, l as Y, g as F, d as J, b as Ne } from "../hooks-BUCn6FeJ.mjs";
|
|
16
16
|
import { u as K } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
|
-
import { D as
|
|
17
|
+
import { D as te } from "../Drawer-DV4NTsFg.mjs";
|
|
18
18
|
import { b as E } from "../Localization-2MODESHW.mjs";
|
|
19
19
|
import { A as Re, u as Fe } from "../AccountDetailsHeader-3ZD1Of4i.mjs";
|
|
20
20
|
import Le from "@mui/material/Card";
|
|
21
21
|
import $e from "@mui/material/CardContent";
|
|
22
22
|
import Oe from "@mui/material/CardHeader";
|
|
23
|
-
import
|
|
23
|
+
import re from "@mui/material/Box";
|
|
24
24
|
import { useTheme as He } from "@mui/material/styles";
|
|
25
25
|
import { LineChart as Ge } from "@mui/x-charts/LineChart";
|
|
26
26
|
import { A as T, W as We } from "../WidgetContainer-BNltq9UG.mjs";
|
|
@@ -31,16 +31,16 @@ import j from "@mui/material/Divider";
|
|
|
31
31
|
import { M as ze, I as Xe, O as Ve } from "../OriginalBalanceAction-CQzvRZ7u.mjs";
|
|
32
32
|
import Ye from "@mui/material/TextField";
|
|
33
33
|
import { L as Q } from "../ListItemAction-pvmKK9RU.mjs";
|
|
34
|
-
import { C as
|
|
34
|
+
import { C as ae } from "../CurrencyInput-BBifPjuC.mjs";
|
|
35
35
|
import me from "@mui/material/Alert";
|
|
36
36
|
import he from "@mui/material/AlertTitle";
|
|
37
37
|
import ue from "@mui/material/Paper";
|
|
38
|
-
import { Error as Ke, CheckCircle as
|
|
38
|
+
import { Error as Ke, CheckCircle as xe } from "@mxenabled/mx-icons";
|
|
39
39
|
import { T as be } from "../TabContentContainer-j01JYR_7.mjs";
|
|
40
40
|
import { DataGridPro as Ue } from "@mui/x-data-grid-pro";
|
|
41
41
|
import { H as z } from "../HeaderCell-DjuifqHJ.mjs";
|
|
42
42
|
import { f as qe, A as X } from "../Account-BiB1F8lL.mjs";
|
|
43
|
-
import
|
|
43
|
+
import ge from "@mui/material/Button";
|
|
44
44
|
import Ze from "@mui/material/IconButton";
|
|
45
45
|
import Je from "@mui/material/ListItem";
|
|
46
46
|
import Qe from "@mui/material/Popover";
|
|
@@ -153,11 +153,11 @@ function it(a, o, r = 0) {
|
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
const L = () => {
|
|
156
|
-
if (!
|
|
156
|
+
if (!g.useContext(ke))
|
|
157
157
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
158
158
|
return Z().uiStore;
|
|
159
159
|
}, lt = ({ debts: a, onClickCta: o, sx: r }) => {
|
|
160
|
-
const t = V(), { isMobile: n } = K(), { debts: i } = S(), { selectedDebtPriority: d } = L(), { monthlyCashFlowProfile: c } = Y(), { payoffDate: p, payoffSavings: m, payoffDuration: b } =
|
|
160
|
+
const t = V(), { isMobile: n } = K(), { debts: i } = S(), { selectedDebtPriority: d } = L(), { monthlyCashFlowProfile: c } = Y(), { payoffDate: p, payoffSavings: m, payoffDuration: b } = g.useMemo(() => {
|
|
161
161
|
const w = c?.extra_payment ?? 0;
|
|
162
162
|
return it(a, d, w);
|
|
163
163
|
}, [a, d, c]);
|
|
@@ -208,10 +208,10 @@ const L = () => {
|
|
|
208
208
|
] })
|
|
209
209
|
}
|
|
210
210
|
);
|
|
211
|
-
}, st =
|
|
212
|
-
const r = V(), { debts: t } = S(), [n, i] =
|
|
211
|
+
}, st = D(lt), ct = ({ isOpen: a, onClose: o }) => {
|
|
212
|
+
const r = V(), { debts: t } = S(), [n, i] = g.useState(!1);
|
|
213
213
|
return /* @__PURE__ */ e(
|
|
214
|
-
|
|
214
|
+
te,
|
|
215
215
|
{
|
|
216
216
|
ariaLabelClose: "",
|
|
217
217
|
isOpen: a,
|
|
@@ -569,7 +569,7 @@ const L = () => {
|
|
|
569
569
|
] })
|
|
570
570
|
}
|
|
571
571
|
);
|
|
572
|
-
}, dt =
|
|
572
|
+
}, dt = D(ct), pt = "#FF7B08";
|
|
573
573
|
function mt(a, o) {
|
|
574
574
|
const [r, t, n] = a.replace(/^#/, "").match(/.{1,2}/g).map((d) => parseInt(d, 16)), i = [
|
|
575
575
|
Math.max(0, Math.min(255, Math.round(r * o))),
|
|
@@ -593,20 +593,20 @@ const Ce = ({
|
|
|
593
593
|
)
|
|
594
594
|
].sort((u, f) => u - f).map((u) => new Date(u)), w = m.map((u) => {
|
|
595
595
|
const f = new Map(u.dataset.map(($) => [new Date($.x).getTime(), $.y]));
|
|
596
|
-
let
|
|
596
|
+
let v = f.get(b[0].getTime()) ?? 0;
|
|
597
597
|
const P = b.map(($) => {
|
|
598
|
-
const H = f.get($.getTime()) ??
|
|
599
|
-
return
|
|
598
|
+
const H = f.get($.getTime()) ?? v;
|
|
599
|
+
return v = H, { x: $, y: H };
|
|
600
600
|
});
|
|
601
601
|
return { ...u, dataset: P };
|
|
602
602
|
}), h = w.reduce(
|
|
603
603
|
(u, f) => u + (f.dataset[0]?.y ?? 0),
|
|
604
604
|
0
|
|
605
605
|
), A = b.map((u, f) => {
|
|
606
|
-
const
|
|
606
|
+
const v = f / (b.length - 1), P = h * (1 - v);
|
|
607
607
|
return { x: u, y: P };
|
|
608
608
|
}), B = Math.ceil(h / 100) * 100, M = b, C = w.map((u, f) => {
|
|
609
|
-
const
|
|
609
|
+
const v = 1 - f / w.length * 0.5, P = mt(pt, v);
|
|
610
610
|
return {
|
|
611
611
|
id: `debt-${f}`,
|
|
612
612
|
guid: u.guid,
|
|
@@ -633,7 +633,7 @@ const Ce = ({
|
|
|
633
633
|
});
|
|
634
634
|
const I = (u) => C.findIndex((f) => f?.guid === u);
|
|
635
635
|
return /* @__PURE__ */ e(
|
|
636
|
-
|
|
636
|
+
re,
|
|
637
637
|
{
|
|
638
638
|
sx: {
|
|
639
639
|
width: "100%",
|
|
@@ -657,11 +657,11 @@ const Ce = ({
|
|
|
657
657
|
margin: { bottom: 24, left: 32, right: 72, top: 48 },
|
|
658
658
|
onAreaClick: (u, f) => {
|
|
659
659
|
i?.();
|
|
660
|
-
const
|
|
661
|
-
p(T.DEBTS_CLICK_CHART_AREA, { account_guid:
|
|
660
|
+
const v = C.find((P) => P.id === f.seriesId);
|
|
661
|
+
p(T.DEBTS_CLICK_CHART_AREA, { account_guid: v?.guid });
|
|
662
662
|
},
|
|
663
663
|
onHighlightChange: (u) => {
|
|
664
|
-
const f = C.find((
|
|
664
|
+
const f = C.find((v) => v.id === u?.seriesId)?.guid;
|
|
665
665
|
d?.(f ?? "");
|
|
666
666
|
},
|
|
667
667
|
series: C,
|
|
@@ -745,9 +745,9 @@ const Ce = ({
|
|
|
745
745
|
}
|
|
746
746
|
)
|
|
747
747
|
] });
|
|
748
|
-
}, ut =
|
|
748
|
+
}, ut = D(ht), bt = () => {
|
|
749
749
|
const a = V(), { onEvent: o } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: n, showError: i } = L();
|
|
750
|
-
return
|
|
750
|
+
return g.useEffect(() => o(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(fe, { children: i || n ? /* @__PURE__ */ e(
|
|
751
751
|
l,
|
|
752
752
|
{
|
|
753
753
|
color: a.palette.secondary.main,
|
|
@@ -757,12 +757,12 @@ const Ce = ({
|
|
|
757
757
|
children: i ? r.schedule_error_message : r.schedule_complete_message
|
|
758
758
|
}
|
|
759
759
|
) : /* @__PURE__ */ s(O, { children: [
|
|
760
|
-
/* @__PURE__ */ s(
|
|
760
|
+
/* @__PURE__ */ s(x, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
761
761
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_month_heading }),
|
|
762
762
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_amount_heading })
|
|
763
763
|
] }),
|
|
764
|
-
t.dataset.slice(1).map(({ x: d, y: c, payment: p }) => /* @__PURE__ */ e(
|
|
765
|
-
|
|
764
|
+
t.dataset.slice(1).map(({ x: d, y: c, payment: p }) => /* @__PURE__ */ e(x, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(x, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
|
|
765
|
+
x,
|
|
766
766
|
{
|
|
767
767
|
sx: {
|
|
768
768
|
borderBottom: `1px solid ${a.palette.border.light}`,
|
|
@@ -772,11 +772,11 @@ const Ce = ({
|
|
|
772
772
|
pr: 24
|
|
773
773
|
},
|
|
774
774
|
children: [
|
|
775
|
-
/* @__PURE__ */ s(
|
|
775
|
+
/* @__PURE__ */ s(x, { flexGrow: 1, children: [
|
|
776
776
|
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: U(d, q.MONTH_YEAR) }),
|
|
777
777
|
/* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
|
|
778
778
|
] }),
|
|
779
|
-
/* @__PURE__ */ s(
|
|
779
|
+
/* @__PURE__ */ s(x, { children: [
|
|
780
780
|
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: N(c, "0,0.00") }),
|
|
781
781
|
/* @__PURE__ */ e(
|
|
782
782
|
l,
|
|
@@ -792,8 +792,8 @@ const Ce = ({
|
|
|
792
792
|
]
|
|
793
793
|
}
|
|
794
794
|
) }) }, String(d))),
|
|
795
|
-
/* @__PURE__ */ e(
|
|
796
|
-
|
|
795
|
+
/* @__PURE__ */ e(x, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
|
|
796
|
+
x,
|
|
797
797
|
{
|
|
798
798
|
sx: {
|
|
799
799
|
alignItems: "center",
|
|
@@ -809,8 +809,8 @@ const Ce = ({
|
|
|
809
809
|
}
|
|
810
810
|
) })
|
|
811
811
|
] }) });
|
|
812
|
-
}, _t =
|
|
813
|
-
const { debts: o } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [n, i] =
|
|
812
|
+
}, _t = D(bt), yt = D(({ debt: a }) => {
|
|
813
|
+
const { debts: o } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [n, i] = g.useState(a.interest_rate ?? 0), d = n < 0, c = async () => {
|
|
814
814
|
await r({ ...a.account, interest_rate: n }), a.interest_rate = n, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
|
|
815
815
|
}, p = () => {
|
|
816
816
|
setTimeout(() => {
|
|
@@ -839,8 +839,8 @@ const Ce = ({
|
|
|
839
839
|
)
|
|
840
840
|
}
|
|
841
841
|
);
|
|
842
|
-
}), ft =
|
|
843
|
-
const { debts: o } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [n, i] =
|
|
842
|
+
}), ft = D(({ debt: a }) => {
|
|
843
|
+
const { debts: o } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [n, i] = g.useState(a.monthly_payment ?? 0), d = n < 0 || n > 9999999999e-2, c = async () => {
|
|
844
844
|
await r({ ...a.account, minimum_payment: n }), a.monthly_payment = n, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
|
|
845
845
|
}, p = () => {
|
|
846
846
|
setTimeout(() => {
|
|
@@ -858,7 +858,7 @@ const Ce = ({
|
|
|
858
858
|
secondaryText: N(a.monthly_payment, "0,0"),
|
|
859
859
|
zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
|
|
860
860
|
children: /* @__PURE__ */ e(
|
|
861
|
-
|
|
861
|
+
ae,
|
|
862
862
|
{
|
|
863
863
|
amount: n,
|
|
864
864
|
autoFocus: !0,
|
|
@@ -871,8 +871,8 @@ const Ce = ({
|
|
|
871
871
|
)
|
|
872
872
|
}
|
|
873
873
|
);
|
|
874
|
-
}),
|
|
875
|
-
const { debts: o } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [n, i] =
|
|
874
|
+
}), xt = D(({ debt: a }) => {
|
|
875
|
+
const { debts: o } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [n, i] = g.useState(a.original_balance ?? 0), d = n < 0 || n > 9999999999e-2, c = async () => {
|
|
876
876
|
await r({ ...a.account, original_balance: n }), a.original_balance = n, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
|
|
877
877
|
}, p = () => {
|
|
878
878
|
setTimeout(() => {
|
|
@@ -890,7 +890,7 @@ const Ce = ({
|
|
|
890
890
|
secondaryText: N(a.original_balance, "0,0"),
|
|
891
891
|
zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
|
|
892
892
|
children: /* @__PURE__ */ e(
|
|
893
|
-
|
|
893
|
+
ae,
|
|
894
894
|
{
|
|
895
895
|
amount: n,
|
|
896
896
|
autoFocus: !0,
|
|
@@ -903,9 +903,9 @@ const Ce = ({
|
|
|
903
903
|
)
|
|
904
904
|
}
|
|
905
905
|
);
|
|
906
|
-
}),
|
|
906
|
+
}), gt = () => {
|
|
907
907
|
const { onEvent: a } = F(), { selectedDebtChartData: o } = L();
|
|
908
|
-
return
|
|
908
|
+
return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(x, { bgcolor: "background.paper", children: [
|
|
909
909
|
o?.goal && /* @__PURE__ */ s(O, { children: [
|
|
910
910
|
/* @__PURE__ */ e(ze, { goal: o.goal }),
|
|
911
911
|
/* @__PURE__ */ e(j, {}),
|
|
@@ -919,19 +919,19 @@ const Ce = ({
|
|
|
919
919
|
/* @__PURE__ */ e(j, {}),
|
|
920
920
|
/* @__PURE__ */ e(yt, { debt: o }),
|
|
921
921
|
/* @__PURE__ */ e(j, {}),
|
|
922
|
-
/* @__PURE__ */ e(
|
|
922
|
+
/* @__PURE__ */ e(xt, { debt: o }),
|
|
923
923
|
/* @__PURE__ */ e(j, {})
|
|
924
924
|
] })
|
|
925
925
|
] });
|
|
926
|
-
}, wt =
|
|
926
|
+
}, wt = D(gt), Ct = ({ setTabValue: a, sx: o }) => {
|
|
927
927
|
const { debts: r } = S(), { showError: t, showCompleted: n } = L();
|
|
928
|
-
return
|
|
928
|
+
return g.useEffect(() => {
|
|
929
929
|
t && a(1);
|
|
930
|
-
}, [t]), !t && !n ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ s(
|
|
930
|
+
}, [t]), !t && !n ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ s(x, { gap: 16, children: [
|
|
931
931
|
/* @__PURE__ */ e(ue, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
|
|
932
932
|
me,
|
|
933
933
|
{
|
|
934
|
-
icon: t ? /* @__PURE__ */ e(Ke, { filled: !0 }) : /* @__PURE__ */ e(
|
|
934
|
+
icon: t ? /* @__PURE__ */ e(Ke, { filled: !0 }) : /* @__PURE__ */ e(xe, { color: "success", filled: !0 }),
|
|
935
935
|
severity: "error",
|
|
936
936
|
sx: {
|
|
937
937
|
alignItems: "start",
|
|
@@ -968,8 +968,8 @@ const Ce = ({
|
|
|
968
968
|
}
|
|
969
969
|
) })
|
|
970
970
|
] });
|
|
971
|
-
}, St =
|
|
972
|
-
const { debts: a } = S(), { showError: o, showCompleted: r } = L(), [t, n] =
|
|
971
|
+
}, St = D(Ct), Dt = () => {
|
|
972
|
+
const { debts: a } = S(), { showError: o, showCompleted: r } = L(), [t, n] = g.useState(0);
|
|
973
973
|
return /* @__PURE__ */ s(O, { children: [
|
|
974
974
|
(o || r) && /* @__PURE__ */ e(St, { setTabValue: n, sx: { mt: -24 } }),
|
|
975
975
|
/* @__PURE__ */ s(
|
|
@@ -1004,23 +1004,23 @@ const Ce = ({
|
|
|
1004
1004
|
/* @__PURE__ */ e(be, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(_t, {}) }),
|
|
1005
1005
|
/* @__PURE__ */ e(be, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(wt, {}) })
|
|
1006
1006
|
] });
|
|
1007
|
-
},
|
|
1007
|
+
}, vt = D(Dt), Tt = ({ isOpen: a, onClose: o }) => {
|
|
1008
1008
|
const { debts: r } = S(), { showError: t, showCompleted: n } = L(), i = t || n ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ e(ut, {});
|
|
1009
1009
|
return /* @__PURE__ */ e(
|
|
1010
|
-
|
|
1010
|
+
te,
|
|
1011
1011
|
{
|
|
1012
1012
|
ariaLabelClose: r.details_close_aria,
|
|
1013
1013
|
isOpen: a,
|
|
1014
1014
|
onClose: o,
|
|
1015
1015
|
title: r.details_title,
|
|
1016
|
-
children: /* @__PURE__ */ s(
|
|
1016
|
+
children: /* @__PURE__ */ s(x, { bgcolor: "background.default", children: [
|
|
1017
1017
|
/* @__PURE__ */ e(Re, { customDetailsChart: i }),
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
1018
|
+
/* @__PURE__ */ e(vt, {})
|
|
1019
1019
|
] })
|
|
1020
1020
|
}
|
|
1021
1021
|
);
|
|
1022
|
-
}, At =
|
|
1023
|
-
const { debts: a } = S(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: r } = Y(), { onEvent: t } = F(), [n, i] =
|
|
1022
|
+
}, At = D(() => {
|
|
1023
|
+
const { debts: a } = S(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: r } = Y(), { onEvent: t } = F(), [n, i] = g.useState(o?.extra_payment ?? 0), d = n < 0 || n > 9999999999e-2, c = async () => {
|
|
1024
1024
|
o && (await r({ ...o, extra_payment: n }), o.extra_payment = n, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
|
|
1025
1025
|
user_guid: o?.user_guid
|
|
1026
1026
|
}));
|
|
@@ -1040,7 +1040,7 @@ const Ce = ({
|
|
|
1040
1040
|
secondaryText: N(o?.extra_payment, "0,0"),
|
|
1041
1041
|
zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
|
|
1042
1042
|
children: /* @__PURE__ */ e(
|
|
1043
|
-
|
|
1043
|
+
ae,
|
|
1044
1044
|
{
|
|
1045
1045
|
amount: n,
|
|
1046
1046
|
autoFocus: !0,
|
|
@@ -1055,28 +1055,28 @@ const Ce = ({
|
|
|
1055
1055
|
);
|
|
1056
1056
|
}), Et = () => {
|
|
1057
1057
|
const { debts: a } = S(), { totalMonthlyPayments: o } = Z(), { monthlyCashFlowProfile: r } = Y(), t = o + Number(r?.extra_payment);
|
|
1058
|
-
return /* @__PURE__ */ s(
|
|
1059
|
-
/* @__PURE__ */ s(
|
|
1060
|
-
/* @__PURE__ */ s(
|
|
1058
|
+
return /* @__PURE__ */ s(x, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
1059
|
+
/* @__PURE__ */ s(x, { p: 24, children: [
|
|
1060
|
+
/* @__PURE__ */ s(x, { alignItems: "center", gap: 4, mb: 24, children: [
|
|
1061
1061
|
/* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
|
|
1062
1062
|
/* @__PURE__ */ e(ye, { bold: !0, variant: "H1", children: N(o, "0,0") }),
|
|
1063
1063
|
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
|
|
1064
1064
|
] }),
|
|
1065
|
-
/* @__PURE__ */ s(
|
|
1065
|
+
/* @__PURE__ */ s(x, { children: [
|
|
1066
1066
|
/* @__PURE__ */ e(l, { variant: "H3", children: a.paydown_drawer_subtitle }),
|
|
1067
1067
|
/* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
|
|
1068
1068
|
] })
|
|
1069
1069
|
] }),
|
|
1070
|
-
/* @__PURE__ */ e(
|
|
1071
|
-
/* @__PURE__ */ e(
|
|
1070
|
+
/* @__PURE__ */ e(x, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(At, {}) }),
|
|
1071
|
+
/* @__PURE__ */ e(x, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(x, { gap: 4, children: [
|
|
1072
1072
|
/* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
|
|
1073
1073
|
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: N(t, "0,0") })
|
|
1074
1074
|
] }) })
|
|
1075
1075
|
] });
|
|
1076
|
-
}, It =
|
|
1076
|
+
}, It = D(Et), Bt = ({ isOpen: a, onClose: o }) => {
|
|
1077
1077
|
const { debts: r } = S();
|
|
1078
1078
|
return /* @__PURE__ */ e(
|
|
1079
|
-
|
|
1079
|
+
te,
|
|
1080
1080
|
{
|
|
1081
1081
|
ariaLabelClose: r.paydown_drawer_close_aria,
|
|
1082
1082
|
isOpen: a,
|
|
@@ -1106,7 +1106,7 @@ const kt = (a) => {
|
|
|
1106
1106
|
}, Nt = (a) => {
|
|
1107
1107
|
const o = String(a.formattedValue), r = kt(o);
|
|
1108
1108
|
return /* @__PURE__ */ e(
|
|
1109
|
-
|
|
1109
|
+
re,
|
|
1110
1110
|
{
|
|
1111
1111
|
sx: {
|
|
1112
1112
|
display: "flex",
|
|
@@ -1124,7 +1124,7 @@ const kt = (a) => {
|
|
|
1124
1124
|
);
|
|
1125
1125
|
}, Rt = (a) => {
|
|
1126
1126
|
const o = a.row.account, r = qe[o.account_type];
|
|
1127
|
-
return /* @__PURE__ */ s(
|
|
1127
|
+
return /* @__PURE__ */ s(x, { alignItems: "center", flexDirection: "row", children: [
|
|
1128
1128
|
/* @__PURE__ */ e(
|
|
1129
1129
|
Ae,
|
|
1130
1130
|
{
|
|
@@ -1132,7 +1132,7 @@ const kt = (a) => {
|
|
|
1132
1132
|
institutionGuid: o.institution_guid || ""
|
|
1133
1133
|
}
|
|
1134
1134
|
),
|
|
1135
|
-
/* @__PURE__ */ s(
|
|
1135
|
+
/* @__PURE__ */ s(x, { ml: 12, children: [
|
|
1136
1136
|
/* @__PURE__ */ e(l, { variant: "Small", children: o.name }),
|
|
1137
1137
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: r })
|
|
1138
1138
|
] })
|
|
@@ -1144,7 +1144,7 @@ const kt = (a) => {
|
|
|
1144
1144
|
onHoverRow: t,
|
|
1145
1145
|
onClickRow: n
|
|
1146
1146
|
}) => {
|
|
1147
|
-
const i = V(), { onEvent: d } = F(), { isMobile: c } = K(), { debts: p } = S(), [m, b] =
|
|
1147
|
+
const i = V(), { onEvent: d } = F(), { isMobile: c } = K(), { debts: p } = S(), [m, b] = g.useState([
|
|
1148
1148
|
{ field: "priority", sort: "asc" }
|
|
1149
1149
|
]), w = [
|
|
1150
1150
|
{
|
|
@@ -1181,8 +1181,8 @@ const kt = (a) => {
|
|
|
1181
1181
|
sortable: !0,
|
|
1182
1182
|
hideSortIcons: c,
|
|
1183
1183
|
type: "number",
|
|
1184
|
-
align:
|
|
1185
|
-
headerAlign:
|
|
1184
|
+
align: "left",
|
|
1185
|
+
headerAlign: "left",
|
|
1186
1186
|
minWidth: c ? 70 : 122,
|
|
1187
1187
|
flex: c ? 0.4 : 0.6
|
|
1188
1188
|
},
|
|
@@ -1225,34 +1225,20 @@ const kt = (a) => {
|
|
|
1225
1225
|
minWidth: 122,
|
|
1226
1226
|
flex: 0.6
|
|
1227
1227
|
}
|
|
1228
|
-
], h = [
|
|
1229
|
-
...w.slice(0, 3),
|
|
1230
|
-
{
|
|
1231
|
-
field: "chevron",
|
|
1232
|
-
headerName: "",
|
|
1233
|
-
renderHeader: void 0,
|
|
1234
|
-
renderCell: () => /* @__PURE__ */ e(te, { name: "chevron_right'" }),
|
|
1235
|
-
sortable: !0,
|
|
1236
|
-
hideSortIcons: !0,
|
|
1237
|
-
type: "custom",
|
|
1238
|
-
align: "right",
|
|
1239
|
-
headerAlign: "right",
|
|
1240
|
-
width: 20
|
|
1241
|
-
}
|
|
1242
|
-
], A = x.useMemo(() => o.map((y, R) => ({
|
|
1228
|
+
], h = [...w.slice(0, 3)], A = g.useMemo(() => o.map((y, R) => ({
|
|
1243
1229
|
...y,
|
|
1244
1230
|
id: R,
|
|
1245
1231
|
priority: Pt(y)
|
|
1246
1232
|
})), [o]), B = (y) => {
|
|
1247
|
-
const f = y.target.closest("[data-id]")?.getAttribute("data-id"),
|
|
1248
|
-
t?.(
|
|
1233
|
+
const f = y.target.closest("[data-id]")?.getAttribute("data-id"), v = o[Number(f)];
|
|
1234
|
+
t?.(v?.guid ?? "");
|
|
1249
1235
|
}, M = (y) => {
|
|
1250
1236
|
c || B(y);
|
|
1251
1237
|
}, C = (y) => {
|
|
1252
1238
|
c && B(y);
|
|
1253
1239
|
}, I = (y) => A.find((R) => R.guid === y)?.id;
|
|
1254
1240
|
return /* @__PURE__ */ e(
|
|
1255
|
-
|
|
1241
|
+
re,
|
|
1256
1242
|
{
|
|
1257
1243
|
sx: {
|
|
1258
1244
|
height: "100dvh",
|
|
@@ -1301,14 +1287,14 @@ const kt = (a) => {
|
|
|
1301
1287
|
}, Lt = ({ buttonText: a, isOpen: o, onClick: r }) => {
|
|
1302
1288
|
const { isDesktop: t, isTablet: n } = K(), i = o ? "unfold_less" : "unfold_more";
|
|
1303
1289
|
return t || n ? /* @__PURE__ */ e(
|
|
1304
|
-
|
|
1290
|
+
ge,
|
|
1305
1291
|
{
|
|
1306
1292
|
"aria-controls": "prioritize-debts",
|
|
1307
1293
|
"aria-describedby": "prioritize-debts",
|
|
1308
1294
|
"aria-haspopup": !0,
|
|
1309
1295
|
"aria-label": "prioritize-debts",
|
|
1310
1296
|
onClick: r,
|
|
1311
|
-
startIcon: /* @__PURE__ */ e(
|
|
1297
|
+
startIcon: /* @__PURE__ */ e(le, { name: i }),
|
|
1312
1298
|
sx: { justifyContent: "start", minWidth: 214, mx: 4 },
|
|
1313
1299
|
children: a
|
|
1314
1300
|
}
|
|
@@ -1320,10 +1306,10 @@ const kt = (a) => {
|
|
|
1320
1306
|
"aria-haspopup": !0,
|
|
1321
1307
|
"aria-label": "prioritize-debts",
|
|
1322
1308
|
onClick: r,
|
|
1323
|
-
children: /* @__PURE__ */ e(
|
|
1309
|
+
children: /* @__PURE__ */ e(le, { name: i })
|
|
1324
1310
|
}
|
|
1325
1311
|
);
|
|
1326
|
-
}, $t =
|
|
1312
|
+
}, $t = D(({ buttonEl: a, onClose: o }) => {
|
|
1327
1313
|
const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = L(), d = !!a, c = [
|
|
1328
1314
|
{
|
|
1329
1315
|
priority: k.FASTEST_PAYOFF_FIRST,
|
|
@@ -1379,19 +1365,19 @@ const kt = (a) => {
|
|
|
1379
1365
|
},
|
|
1380
1366
|
children: [
|
|
1381
1367
|
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: b }),
|
|
1382
|
-
n === m && /* @__PURE__ */ e(
|
|
1368
|
+
n === m && /* @__PURE__ */ e(xe, { color: "inherit", filled: !0, fontSize: "small" })
|
|
1383
1369
|
]
|
|
1384
1370
|
},
|
|
1385
1371
|
m
|
|
1386
1372
|
)) })
|
|
1387
1373
|
}
|
|
1388
1374
|
);
|
|
1389
|
-
}), Ot =
|
|
1390
|
-
const { onEvent: a } = F(), { debts: o } = S(), { selectedDebtPriority: r } = L(), [t, n] =
|
|
1375
|
+
}), Ot = D(() => {
|
|
1376
|
+
const { onEvent: a } = F(), { debts: o } = S(), { selectedDebtPriority: r } = L(), [t, n] = g.useState(null), i = (m) => {
|
|
1391
1377
|
n(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
|
|
1392
1378
|
}, d = () => {
|
|
1393
1379
|
n(null);
|
|
1394
|
-
}, c = !!t, p =
|
|
1380
|
+
}, c = !!t, p = g.useMemo(() => ({
|
|
1395
1381
|
[k.FASTEST_PAYOFF_FIRST]: o.priority_sort_fastest_payoff,
|
|
1396
1382
|
[k.HIGHEST_INTEREST]: o.priority_sort_highest_interest,
|
|
1397
1383
|
[k.HIGHEST_BALANCE]: o.priority_sort_highest_balance,
|
|
@@ -1438,10 +1424,10 @@ const kt = (a) => {
|
|
|
1438
1424
|
}), i.forEach((p) => {
|
|
1439
1425
|
p.priority = !p.is_paid_off && !p.is_impossible ? c++ : void 0;
|
|
1440
1426
|
}), i;
|
|
1441
|
-
}, Gt =
|
|
1427
|
+
}, Gt = D(({ onClick: a }) => {
|
|
1442
1428
|
const { debts: o } = S(), { isDesktop: r } = K(), { totalMonthlyPayments: t } = Z(), { monthlyCashFlowProfile: n } = Y(), i = t + Number(n?.extra_payment), d = r ? o.paydown_button_long : o.paydown_button_short;
|
|
1443
1429
|
return /* @__PURE__ */ e(
|
|
1444
|
-
|
|
1430
|
+
ge,
|
|
1445
1431
|
{
|
|
1446
1432
|
"aria-controls": "extra-paydown",
|
|
1447
1433
|
"aria-describedby": "extra-paydown",
|
|
@@ -1453,26 +1439,26 @@ const kt = (a) => {
|
|
|
1453
1439
|
}
|
|
1454
1440
|
);
|
|
1455
1441
|
}), Wt = ({ onBackClick: a, sx: o }) => {
|
|
1456
|
-
const { isDesktop: r, isMobile: t } = K(), { debts: n } = S(), { onEvent: i } = F(), { isInitialized: d } = Ne(), { setSelectedAccount: c } = Fe(), { selectedDebtPriority: p, setSelectedDebtChartData: m } = L(), { isAccountDataLoaded: b, loadAccountData: w, visibleDebtAccounts: h } = J(), { isAllGoalDataLoaded: A, loadGoalData: B, monthlyCashFlowProfile: M } = Y(), { debts: C } = Z(), [I, y] =
|
|
1442
|
+
const { isDesktop: r, isMobile: t } = K(), { debts: n } = S(), { onEvent: i } = F(), { isInitialized: d } = Ne(), { setSelectedAccount: c } = Fe(), { selectedDebtPriority: p, setSelectedDebtChartData: m } = L(), { isAccountDataLoaded: b, loadAccountData: w, visibleDebtAccounts: h } = J(), { isAllGoalDataLoaded: A, loadGoalData: B, monthlyCashFlowProfile: M } = Y(), { debts: C } = Z(), [I, y] = g.useState(!1), [R, u] = g.useState(!1), [f, v] = g.useState(!1), [P, $] = g.useState("");
|
|
1457
1443
|
et({
|
|
1458
1444
|
widgetName: "DebtsWidget",
|
|
1459
1445
|
isLoaded: A
|
|
1460
1446
|
});
|
|
1461
|
-
const H =
|
|
1447
|
+
const H = g.useMemo(() => {
|
|
1462
1448
|
const G = M?.extra_payment ?? 0;
|
|
1463
1449
|
return Ht(C, p, G);
|
|
1464
1450
|
}, [C, p, M]);
|
|
1465
|
-
|
|
1451
|
+
g.useEffect(() => {
|
|
1466
1452
|
b || w().finally(), i(T.DEBTS_VIEW);
|
|
1467
|
-
}, []),
|
|
1453
|
+
}, []), g.useEffect(() => {
|
|
1468
1454
|
d && B().finally();
|
|
1469
1455
|
}, [d]);
|
|
1470
|
-
const
|
|
1471
|
-
const G = h.find((ee) => ee.guid === P),
|
|
1472
|
-
G && c(G),
|
|
1473
|
-
}, Se = () => i(T.DEBTS_CLICK_FILTER),
|
|
1474
|
-
|
|
1475
|
-
},
|
|
1456
|
+
const oe = (G) => $(G), ne = () => {
|
|
1457
|
+
const G = h.find((ee) => ee.guid === P), ie = H.find((ee) => ee.guid === P);
|
|
1458
|
+
G && c(G), ie && m(ie), y(!0);
|
|
1459
|
+
}, Se = () => i(T.DEBTS_CLICK_FILTER), De = () => {
|
|
1460
|
+
v(!0), i(T.DEBTS_CLICK_SNOWBALL_CTA);
|
|
1461
|
+
}, ve = () => {
|
|
1476
1462
|
u(!0), i(T.DEBTS_CLICK_PAYDOWN);
|
|
1477
1463
|
};
|
|
1478
1464
|
return !d || !A ? /* @__PURE__ */ e(tt, {}) : /* @__PURE__ */ s(
|
|
@@ -1480,7 +1466,7 @@ const kt = (a) => {
|
|
|
1480
1466
|
{
|
|
1481
1467
|
actions: [
|
|
1482
1468
|
/* @__PURE__ */ e(Ot, {}, "prioritize-debts"),
|
|
1483
|
-
/* @__PURE__ */ e(Gt, { onClick:
|
|
1469
|
+
/* @__PURE__ */ e(Gt, { onClick: ve }, "extra-paydown")
|
|
1484
1470
|
],
|
|
1485
1471
|
allowedAccountTypes: [
|
|
1486
1472
|
X.CREDIT_CARD,
|
|
@@ -1494,9 +1480,9 @@ const kt = (a) => {
|
|
|
1494
1480
|
sx: o,
|
|
1495
1481
|
title: n.title,
|
|
1496
1482
|
children: [
|
|
1497
|
-
/* @__PURE__ */ s(
|
|
1483
|
+
/* @__PURE__ */ s(x, { sx: { px: r ? "48px" : "24px" }, children: [
|
|
1498
1484
|
/* @__PURE__ */ s(
|
|
1499
|
-
|
|
1485
|
+
x,
|
|
1500
1486
|
{
|
|
1501
1487
|
sx: {
|
|
1502
1488
|
alignItems: t ? "flex-start" : "flex-end",
|
|
@@ -1510,8 +1496,8 @@ const kt = (a) => {
|
|
|
1510
1496
|
debts: H,
|
|
1511
1497
|
height: t ? 250 : void 0,
|
|
1512
1498
|
hoveredDebtGuid: P,
|
|
1513
|
-
onClickArea:
|
|
1514
|
-
onHoverArea:
|
|
1499
|
+
onClickArea: ne,
|
|
1500
|
+
onHoverArea: oe,
|
|
1515
1501
|
sx: { mr: t ? "4px" : "-48px" }
|
|
1516
1502
|
}
|
|
1517
1503
|
),
|
|
@@ -1519,20 +1505,20 @@ const kt = (a) => {
|
|
|
1519
1505
|
st,
|
|
1520
1506
|
{
|
|
1521
1507
|
debts: H,
|
|
1522
|
-
onClickCta:
|
|
1508
|
+
onClickCta: De,
|
|
1523
1509
|
sx: { mb: t ? "0px" : "64px" }
|
|
1524
1510
|
}
|
|
1525
1511
|
)
|
|
1526
1512
|
]
|
|
1527
1513
|
}
|
|
1528
1514
|
),
|
|
1529
|
-
/* @__PURE__ */ e(
|
|
1515
|
+
/* @__PURE__ */ e(x, { sx: { mx: t ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1530
1516
|
Ft,
|
|
1531
1517
|
{
|
|
1532
1518
|
debts: H,
|
|
1533
1519
|
hoveredDebtGuid: P,
|
|
1534
|
-
onClickRow:
|
|
1535
|
-
onHoverRow:
|
|
1520
|
+
onClickRow: ne,
|
|
1521
|
+
onHoverRow: oe
|
|
1536
1522
|
}
|
|
1537
1523
|
) })
|
|
1538
1524
|
] }),
|
|
@@ -1540,7 +1526,7 @@ const kt = (a) => {
|
|
|
1540
1526
|
dt,
|
|
1541
1527
|
{
|
|
1542
1528
|
isOpen: f,
|
|
1543
|
-
onClose: () =>
|
|
1529
|
+
onClose: () => v(!1)
|
|
1544
1530
|
}
|
|
1545
1531
|
),
|
|
1546
1532
|
/* @__PURE__ */ e(Tt, { isOpen: I, onClose: () => y(!1) }),
|
|
@@ -1548,7 +1534,7 @@ const kt = (a) => {
|
|
|
1548
1534
|
]
|
|
1549
1535
|
}
|
|
1550
1536
|
);
|
|
1551
|
-
}, Fr =
|
|
1537
|
+
}, Fr = D(Wt);
|
|
1552
1538
|
export {
|
|
1553
1539
|
Ce as DebtsChart,
|
|
1554
1540
|
Or as DebtsStore,
|