@mx-cartographer/experiences 7.0.41 → 7.0.43-alpha.san1

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.
@@ -1,29 +1,29 @@
1
1
  import { jsx as e, jsxs as s, Fragment as L } from "react/jsx-runtime";
2
- import g from "react";
2
+ import x from "react";
3
3
  import { observer as S } from "mobx-react-lite";
4
- import x from "@mui/material/Stack";
4
+ import g from "@mui/material/Stack";
5
5
  import { useTheme as j, Card as be, Stack as _, Box as O } from "@mui/material";
6
- import { Text as l, H3 as De, InstitutionLogo as ve, Icon as ee } from "@mxenabled/mxui";
6
+ import { Text as l, H3 as ve, InstitutionLogo as De, Icon as ee } from "@mxenabled/mxui";
7
7
  import { intervalToDuration as Te, formatDuration as Ae } from "date-fns";
8
8
  import { addMonths as le } from "date-fns/addMonths";
9
9
  import { fromUnixTime as se } from "date-fns/fromUnixTime";
10
10
  import { getUnixTime as ce } from "date-fns/getUnixTime";
11
11
  import { D as M, M as Ee, I as Ie } from "../DebtsStore-3kGPnxRQ.mjs";
12
- import { a as Nr } from "../DebtsStore-3kGPnxRQ.mjs";
12
+ import { a as Fr } from "../DebtsStore-3kGPnxRQ.mjs";
13
13
  import { f as P, a as Be } from "../NumberFormatting-CtWHhyBX.mjs";
14
14
  import { f as K, D as U } from "../Dialog-CWW597AF.mjs";
15
15
  import { G as Me, x as q, u as C, k as z, f as k, c as Z, a as Pe } from "../hooks-BAAimqdq.mjs";
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-Bt8O2raZ.mjs";
20
- import Ne from "@mui/material/Card";
19
+ import { A as ke, u as Ne } from "../AccountDetailsHeader-B3DiwvB7.mjs";
20
+ import Fe 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-ztkGgdIH.mjs";
26
+ import { A as T, W as Oe } from "../WidgetContainer-Beedl3IT.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,17 +45,17 @@ 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, r = 0) => {
48
+ const Qe = (a, n = 0, r = 0) => {
49
49
  if (r === 0) return 0;
50
- const t = o / (Ee * Ie);
50
+ const t = n / (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, r, t, n) => {
54
+ }, et = (a, n, r, t, o) => {
55
55
  const i = [];
56
56
  if (r === 0) {
57
57
  for (let d = 0; d < a; d++) {
58
- const c = o - t * (d + 1), h = o - t * d, m = c >= 0 ? t : h;
58
+ const c = n - t * (d + 1), h = n - t * d, m = c >= 0 ? t : h;
59
59
  i.push({
60
60
  balance: c >= 0 ? c : 0,
61
61
  interest: r,
@@ -63,7 +63,7 @@ const Qe = (a, o = 0, r = 0) => {
63
63
  principal: m,
64
64
  timestamp: ce(
65
65
  le(
66
- se(n),
66
+ se(o),
67
67
  // convert seconds → Date
68
68
  d + 1
69
69
  // add (index + 1) months
@@ -75,88 +75,88 @@ const Qe = (a, o = 0, r = 0) => {
75
75
  }
76
76
  const p = r / 1200;
77
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;
78
+ const c = ce(le(se(o), d + 1)), h = Math.pow(1 + p, d), m = n * h - t * ((h - 1) / p), y = Math.pow(1 + p, d + 1), f = n * y - t * ((y - 1) / p), v = t + Math.min(f, 0), E = m * p;
79
79
  i.push({
80
80
  balance: Math.max(0, f),
81
81
  interest: E,
82
- payment: D,
83
- principal: D - E,
82
+ payment: v,
83
+ principal: v - E,
84
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: r, balance: t, payment_due_date: n } = a, i = Qe(t, r ?? 0, o ?? 0), p = et(
89
+ const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i = Qe(t, r ?? 0, n ?? 0), p = et(
90
90
  i,
91
91
  t,
92
92
  r ?? 0,
93
- o ?? 0,
94
- n
93
+ n ?? 0,
94
+ o
95
95
  ), d = tt(p);
96
96
  return {
97
97
  ...a,
98
98
  minimumFinalPayment: d,
99
99
  minimumPayments: p
100
100
  };
101
- }, ge = (a, o) => {
101
+ }, xe = (a, n) => {
102
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]),
103
+ ([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(rt(p)), [o, i]),
104
104
  [[], []]
105
105
  );
106
- switch (o) {
106
+ switch (n) {
107
107
  case M.FASTEST_PAYOFF_FIRST:
108
- r.sort((n, i) => (n.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
108
+ r.sort((o, i) => (o.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
109
109
  break;
110
110
  case M.HIGHEST_INTEREST:
111
- r.sort((n, i) => (i.interest_rate ?? 0) - (n.interest_rate ?? 0));
111
+ r.sort((o, i) => (i.interest_rate ?? 0) - (o.interest_rate ?? 0));
112
112
  break;
113
113
  case M.LOWEST_BALANCE:
114
- r.sort((n, i) => n.balance - i.balance);
114
+ r.sort((o, i) => o.balance - i.balance);
115
115
  break;
116
116
  case M.HIGHEST_BALANCE:
117
- r.sort((n, i) => i.balance - n.balance);
117
+ r.sort((o, i) => i.balance - o.balance);
118
118
  break;
119
119
  default:
120
- r.sort((n, i) => n.balance - i.balance);
120
+ r.sort((o, i) => o.balance - i.balance);
121
121
  }
122
122
  a.splice(0, a.length, ...r, ...t);
123
123
  };
124
- function at(a, o, r = 0) {
124
+ function at(a, n, r = 0) {
125
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
- ge(t, o);
129
- let n = 0, i = 0;
128
+ xe(t, n);
129
+ let o = 0, i = 0;
130
130
  const p = /* @__PURE__ */ new Date(), d = /* @__PURE__ */ new Date();
131
131
  for (; t.some((m) => m.balance >= 0.01 && !m.is_impossible); ) {
132
132
  let m = !1;
133
133
  for (const [y, f] of t.entries()) {
134
134
  if (f.balance <= 0.01 || f.is_impossible) continue;
135
- const E = (f.interest_rate ?? 0) / 100 / 12, v = f.balance * E;
135
+ const E = (f.interest_rate ?? 0) / 100 / 12, D = f.balance * E;
136
136
  let u = f.monthly_payment ?? 0;
137
- y === 0 && r && (u += r), f.balance += v;
137
+ y === 0 && r && (u += r), f.balance += D;
138
138
  const I = Math.min(f.balance, u + i);
139
- if (I <= v) {
139
+ if (I <= D) {
140
140
  f.is_impossible = !0;
141
141
  continue;
142
142
  }
143
- f.balance -= I, f.balance = f.balance < 0.01 ? 0 : f.balance, n += v, f.balance <= 0 && (i += u), I > 0 && (m = !0);
143
+ f.balance -= I, f.balance = f.balance < 0.01 ? 0 : f.balance, o += D, f.balance <= 0 && (i += u), I > 0 && (m = !0);
144
144
  }
145
145
  m && d.setMonth(d.getMonth() + 1);
146
146
  }
147
147
  const c = t.some((m) => m.is_impossible && m.balance > 0), h = Te({ start: p, end: d });
148
148
  return {
149
- payoffSavings: c ? "N/A" : P(n, "0,0.00"),
149
+ payoffSavings: c ? "N/A" : P(o, "0,0.00"),
150
150
  payoffDate: c ? "Never" : K(d, U.MONTH_YEAR),
151
151
  payoffDuration: c ? "Stagnant" : Ae(h, { format: ["years", "months"] }) || "0 months"
152
152
  };
153
153
  }
154
154
  const R = () => {
155
- if (!g.useContext(Me))
155
+ if (!x.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: 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(() => {
158
+ }, nt = ({ debts: a, onClickCta: n, sx: r }) => {
159
+ const t = j(), { isMobile: o } = X(), { debts: i } = C(), { selectedDebtPriority: p } = R(), { monthlyCashFlowProfile: d } = z(), { payoffDate: c, payoffSavings: h, payoffDuration: m } = x.useMemo(() => {
160
160
  const y = d?.extra_payment ?? 0;
161
161
  return at(a, p, y);
162
162
  }, [a, p, d]);
@@ -165,7 +165,7 @@ const R = () => {
165
165
  {
166
166
  sx: {
167
167
  boxShadow: t.shadows[2],
168
- width: n ? "100%" : "186px",
168
+ width: o ? "100%" : "186px",
169
169
  minWidth: "186px",
170
170
  ...r
171
171
  },
@@ -173,7 +173,7 @@ const R = () => {
173
173
  /* @__PURE__ */ s(
174
174
  _,
175
175
  {
176
- gap: n ? "4px" : "0",
176
+ gap: o ? "4px" : "0",
177
177
  sx: {
178
178
  borderBottom: "1px solid",
179
179
  borderBottomColor: t.palette.grey[300],
@@ -185,11 +185,11 @@ const R = () => {
185
185
  ]
186
186
  }
187
187
  ),
188
- /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
188
+ /* @__PURE__ */ s(_, { gap: o ? "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: n ? "4px" : "0", children: [
192
+ /* @__PURE__ */ s(_, { gap: o ? "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
  ] }),
@@ -198,7 +198,7 @@ const R = () => {
198
198
  {
199
199
  bold: !0,
200
200
  color: t.palette.primary.main,
201
- onClick: o,
201
+ onClick: n,
202
202
  sx: { cursor: "pointer" },
203
203
  variant: "Small",
204
204
  children: i.snowball_card_cta
@@ -207,14 +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(), [n, i] = g.useState(!1);
210
+ }, ot = S(nt), it = ({ isOpen: a, onClose: n }) => {
211
+ const r = j(), { debts: t } = C(), [o, i] = x.useState(!1);
212
212
  return /* @__PURE__ */ e(
213
213
  te,
214
214
  {
215
215
  ariaLabelClose: "",
216
216
  isOpen: a,
217
- onClose: o,
217
+ onClose: n,
218
218
  title: t.snowball_drawer_title,
219
219
  children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
220
220
  /* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
@@ -231,7 +231,7 @@ const R = () => {
231
231
  {
232
232
  color: r.palette.secondary.main,
233
233
  mb: 8,
234
- sx: { whiteSpace: n ? "normal" : "nowrap" },
234
+ sx: { whiteSpace: o ? "normal" : "nowrap" },
235
235
  variant: "ParagraphSmall",
236
236
  children: t.snowball_drawer_answer
237
237
  }
@@ -241,10 +241,10 @@ const R = () => {
241
241
  {
242
242
  bold: !0,
243
243
  color: r.palette.primary.main,
244
- onClick: () => i(!n),
244
+ onClick: () => i(!o),
245
245
  sx: { cursor: "pointer" },
246
246
  variant: "Small",
247
- children: n ? t.snowball_drawer_less : t.snowball_drawer_more
247
+ children: o ? t.snowball_drawer_less : t.snowball_drawer_more
248
248
  }
249
249
  )
250
250
  ] })
@@ -569,20 +569,20 @@ const R = () => {
569
569
  }
570
570
  );
571
571
  }, lt = S(it), st = "#FF7B08";
572
- function ct(a, o) {
573
- const [r, t, n] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
574
- Math.max(0, Math.min(255, Math.round(r * o))),
575
- Math.max(0, Math.min(255, Math.round(t * o))),
576
- Math.max(0, Math.min(255, Math.round(n * o)))
572
+ function ct(a, n) {
573
+ const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
574
+ Math.max(0, Math.min(255, Math.round(r * n))),
575
+ Math.max(0, Math.min(255, Math.round(t * n))),
576
+ Math.max(0, Math.min(255, Math.round(o * n)))
577
577
  ];
578
578
  return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
579
579
  }
580
- const xe = ({
580
+ const ge = ({
581
581
  sx: a,
582
- height: o = 500,
582
+ height: n = 500,
583
583
  width: r,
584
584
  debts: t,
585
- hoveredDebtGuid: n,
585
+ hoveredDebtGuid: o,
586
586
  onClickArea: i,
587
587
  onHoverArea: p
588
588
  }) => {
@@ -591,27 +591,27 @@ const xe = ({
591
591
  h.flatMap((b) => b.dataset.map((w) => new Date(w.x).getTime()))
592
592
  )
593
593
  ].sort((b, w) => b - w).map((b) => new Date(b)), y = h.map((b) => {
594
- const w = new Map(b.dataset.map((N) => [new Date(N.x).getTime(), N.y]));
594
+ const w = new Map(b.dataset.map((F) => [new Date(F.x).getTime(), F.y]));
595
595
  let B = w.get(m[0].getTime()) ?? 0;
596
- const F = m.map((N) => {
597
- const $ = w.get(N.getTime()) ?? B;
598
- return B = $, { x: N, y: $ };
596
+ const N = m.map((F) => {
597
+ const $ = w.get(F.getTime()) ?? B;
598
+ return B = $, { x: F, y: $ };
599
599
  });
600
- return { ...b, dataset: F };
600
+ return { ...b, dataset: N };
601
601
  }), f = y.reduce(
602
602
  (b, w) => b + (w.dataset[0]?.y ?? 0),
603
603
  0
604
- ), D = m.map((b, w) => {
605
- const B = w / (m.length - 1), F = f * (1 - B);
606
- return { x: b, y: F };
607
- }), E = Math.ceil(f / 100) * 100, v = m, u = y.map((b, w) => {
608
- const B = 1 - w / y.length * 0.5, F = ct(st, B);
604
+ ), v = m.map((b, w) => {
605
+ const B = w / (m.length - 1), N = f * (1 - B);
606
+ return { x: b, y: N };
607
+ }), E = Math.ceil(f / 100) * 100, D = m, u = y.map((b, w) => {
608
+ const B = 1 - w / y.length * 0.5, N = ct(st, B);
609
609
  return {
610
610
  id: `debt-${w}`,
611
611
  guid: b.guid,
612
612
  label: b.name,
613
- data: b.dataset.map((N) => N.y),
614
- color: F,
613
+ data: b.dataset.map((F) => F.y),
614
+ color: N,
615
615
  curve: "linear",
616
616
  type: "line",
617
617
  area: !0,
@@ -622,7 +622,7 @@ const xe = ({
622
622
  u.push({
623
623
  id: "payoff-line",
624
624
  label: "Payoff Line",
625
- data: D.map((b) => b.y),
625
+ data: v.map((b) => b.y),
626
626
  color: d.palette.grey[700],
627
627
  curve: "linear",
628
628
  type: "line",
@@ -651,10 +651,10 @@ const xe = ({
651
651
  {
652
652
  axisHighlight: { x: "none" },
653
653
  disableLineItemHighlight: !0,
654
- height: o,
654
+ height: n,
655
655
  onAreaClick: (b, w) => {
656
656
  i?.();
657
- const B = u.find((F) => F.id === w.seriesId);
657
+ const B = u.find((N) => N.id === w.seriesId);
658
658
  c(T.DEBTS_CLICK_CHART_AREA, { account_guid: B?.guid });
659
659
  },
660
660
  onHighlightChange: (b) => {
@@ -685,19 +685,22 @@ const xe = ({
685
685
  strokeDasharray: "10 5",
686
686
  strokeWidth: 1
687
687
  },
688
- [`& .MuiLineElement-series-debt-${I(n ?? "0")}`]: {
688
+ [`& .MuiLineElement-series-debt-${I(o ?? "0")}`]: {
689
689
  opacity: 1
690
690
  },
691
- [`& .MuiAreaElement-series-debt-${I(n ?? "0")}`]: {
691
+ [`& .MuiAreaElement-series-debt-${I(o ?? "0")}`]: {
692
692
  opacity: 1
693
693
  },
694
+ "& .MuiChartsAxis-tickLabel > tspan": {
695
+ fontFamily: d.typography.Small.fontFamily
696
+ },
694
697
  ...a
695
698
  },
696
699
  tooltip: { trigger: "none" },
697
700
  width: r,
698
701
  xAxis: [
699
702
  {
700
- data: v,
703
+ data: D,
701
704
  scaleType: "time",
702
705
  min: m[0],
703
706
  disableTicks: !0,
@@ -717,10 +720,10 @@ const xe = ({
717
720
  }
718
721
  );
719
722
  }, dt = () => {
720
- const a = j(), { debts: o } = C(), { selectedDebtChartData: r } = R();
723
+ const a = j(), { debts: n } = C(), { selectedDebtChartData: r } = R();
721
724
  return /* @__PURE__ */ s(L, { children: [
722
725
  /* @__PURE__ */ s(
723
- Ne,
726
+ Fe,
724
727
  {
725
728
  sx: {
726
729
  "& .MuiCardContent-root:last-child": {
@@ -728,8 +731,8 @@ const xe = ({
728
731
  }
729
732
  },
730
733
  children: [
731
- /* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(De, { sx: { pb: 4 }, children: o.details_chart_title }) }),
732
- /* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(xe, { debts: [r], height: 250 }) })
734
+ /* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children: n.details_chart_title }) }),
735
+ /* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(ge, { debts: [r], height: 250 }) })
733
736
  ]
734
737
  }
735
738
  ),
@@ -739,13 +742,13 @@ const xe = ({
739
742
  color: a.palette.text.secondary,
740
743
  sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
741
744
  variant: "Small",
742
- children: o.details_chart_description
745
+ children: n.details_chart_description
743
746
  }
744
747
  )
745
748
  ] });
746
749
  }, pt = S(dt), mt = () => {
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
+ const a = j(), { onEvent: n } = k(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: o, showError: i } = R();
751
+ return x.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || o ? /* @__PURE__ */ e(
749
752
  l,
750
753
  {
751
754
  color: a.palette.secondary.main,
@@ -755,12 +758,12 @@ const xe = ({
755
758
  children: i ? r.schedule_error_message : r.schedule_complete_message
756
759
  }
757
760
  ) : /* @__PURE__ */ s(L, { children: [
758
- /* @__PURE__ */ s(x, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
761
+ /* @__PURE__ */ s(g, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
759
762
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_month_heading }),
760
763
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_amount_heading })
761
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
+ t.dataset.slice(1).map(({ x: p, y: d, payment: c }) => /* @__PURE__ */ e(g, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(g, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
766
+ g,
764
767
  {
765
768
  sx: {
766
769
  borderBottom: `1px solid ${a.palette.border.light}`,
@@ -770,11 +773,11 @@ const xe = ({
770
773
  pr: 24
771
774
  },
772
775
  children: [
773
- /* @__PURE__ */ s(x, { flexGrow: 1, children: [
776
+ /* @__PURE__ */ s(g, { flexGrow: 1, children: [
774
777
  /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: K(p, U.MONTH_YEAR) }),
775
778
  /* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
776
779
  ] }),
777
- /* @__PURE__ */ s(x, { children: [
780
+ /* @__PURE__ */ s(g, { children: [
778
781
  /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: P(d, "0,0.00") }),
779
782
  /* @__PURE__ */ e(
780
783
  l,
@@ -790,8 +793,8 @@ const xe = ({
790
793
  ]
791
794
  }
792
795
  ) }) }, String(p))),
793
- /* @__PURE__ */ e(x, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
794
- x,
796
+ /* @__PURE__ */ e(g, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
797
+ g,
795
798
  {
796
799
  sx: {
797
800
  alignItems: "center",
@@ -808,8 +811,8 @@ const xe = ({
808
811
  ) })
809
812
  ] }) });
810
813
  }, ht = S(mt), ut = S(({ debt: a }) => {
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 });
814
+ const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.interest_rate ?? 0), p = o < 0, d = async () => {
815
+ await r({ ...a.account, interest_rate: o }), a.interest_rate = o, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
813
816
  }, c = () => {
814
817
  setTimeout(() => {
815
818
  i(a.interest_rate ?? 0);
@@ -819,12 +822,12 @@ const xe = ({
819
822
  J,
820
823
  {
821
824
  isSaveDisabled: p,
822
- label: `${o.details_interest_rate} (%)`,
825
+ label: `${n.details_interest_rate} (%)`,
823
826
  onCancel: c,
824
827
  onSave: d,
825
- primaryText: o.details_interest_rate,
828
+ primaryText: n.details_interest_rate,
826
829
  secondaryText: Be(Number(a.interest_rate) / 100),
827
- zeroStateText: a.interest_rate ? void 0 : o.add_interest_rate,
830
+ zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
828
831
  children: /* @__PURE__ */ e(
829
832
  Xe,
830
833
  {
@@ -832,14 +835,14 @@ const xe = ({
832
835
  fullWidth: !0,
833
836
  onChange: (h) => i(isNaN(parseFloat(h.target.value)) ? 0 : parseFloat(h.target.value)),
834
837
  type: "number",
835
- value: n
838
+ value: o
836
839
  }
837
840
  )
838
841
  }
839
842
  );
840
843
  }), bt = S(({ debt: a }) => {
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 });
844
+ const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
845
+ await r({ ...a.account, minimum_payment: o }), a.monthly_payment = o, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
843
846
  }, c = () => {
844
847
  setTimeout(() => {
845
848
  i(a.monthly_payment ?? 0);
@@ -849,29 +852,29 @@ const xe = ({
849
852
  J,
850
853
  {
851
854
  isSaveDisabled: p,
852
- label: o.details_monthly_payment,
855
+ label: n.details_monthly_payment,
853
856
  onCancel: c,
854
857
  onSave: d,
855
- primaryText: o.details_monthly_payment,
858
+ primaryText: n.details_monthly_payment,
856
859
  secondaryText: P(a.monthly_payment, "0,0"),
857
- zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
860
+ zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
858
861
  children: /* @__PURE__ */ e(
859
862
  ae,
860
863
  {
861
- amount: n,
864
+ amount: o,
862
865
  autoFocus: !0,
863
866
  error: p,
864
867
  fullWidth: !0,
865
868
  minAmount: 0,
866
- setAmount: (h) => i(isNaN(Number(h)) ? n : Number(h)),
869
+ setAmount: (h) => i(isNaN(Number(h)) ? o : Number(h)),
867
870
  sx: { ".MuiTypography-Body": { p: 0 } }
868
871
  }
869
872
  )
870
873
  }
871
874
  );
872
875
  }), _t = S(({ debt: a }) => {
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 });
876
+ const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
877
+ await r({ ...a.account, original_balance: o }), a.original_balance = o, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
875
878
  }, c = () => {
876
879
  setTimeout(() => {
877
880
  i(a.original_balance ?? 0);
@@ -881,52 +884,52 @@ const xe = ({
881
884
  J,
882
885
  {
883
886
  isSaveDisabled: p,
884
- label: o.details_original_balance,
887
+ label: n.details_original_balance,
885
888
  onCancel: c,
886
889
  onSave: d,
887
- primaryText: o.details_original_balance,
890
+ primaryText: n.details_original_balance,
888
891
  secondaryText: P(a.original_balance, "0,0"),
889
- zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
892
+ zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
890
893
  children: /* @__PURE__ */ e(
891
894
  ae,
892
895
  {
893
- amount: n,
896
+ amount: o,
894
897
  autoFocus: !0,
895
898
  error: p,
896
899
  fullWidth: !0,
897
900
  minAmount: 0,
898
- setAmount: (h) => i(isNaN(Number(h)) ? n : Number(h)),
901
+ setAmount: (h) => i(isNaN(Number(h)) ? o : Number(h)),
899
902
  sx: { ".MuiTypography-Body": { p: 0 } }
900
903
  }
901
904
  )
902
905
  }
903
906
  );
904
907
  }), yt = () => {
905
- const { onEvent: a } = k(), { selectedDebtChartData: o } = R();
906
- return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(x, { bgcolor: "background.paper", children: [
907
- o?.goal && /* @__PURE__ */ s(L, { children: [
908
- /* @__PURE__ */ e(Ge, { goal: o.goal }),
908
+ const { onEvent: a } = k(), { selectedDebtChartData: n } = R();
909
+ return x.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(g, { bgcolor: "background.paper", children: [
910
+ n?.goal && /* @__PURE__ */ s(L, { children: [
911
+ /* @__PURE__ */ e(Ge, { goal: n.goal }),
909
912
  /* @__PURE__ */ e(W, {}),
910
- /* @__PURE__ */ e(je, { goal: o.goal }),
913
+ /* @__PURE__ */ e(je, { goal: n.goal }),
911
914
  /* @__PURE__ */ e(W, {}),
912
- /* @__PURE__ */ e(ze, { goal: o.goal }),
915
+ /* @__PURE__ */ e(ze, { goal: n.goal }),
913
916
  /* @__PURE__ */ e(W, {})
914
917
  ] }),
915
- !o?.goal && o?.account && /* @__PURE__ */ s(L, { children: [
916
- /* @__PURE__ */ e(bt, { debt: o }),
918
+ !n?.goal && n?.account && /* @__PURE__ */ s(L, { children: [
919
+ /* @__PURE__ */ e(bt, { debt: n }),
917
920
  /* @__PURE__ */ e(W, {}),
918
- /* @__PURE__ */ e(ut, { debt: o }),
921
+ /* @__PURE__ */ e(ut, { debt: n }),
919
922
  /* @__PURE__ */ e(W, {}),
920
- /* @__PURE__ */ e(_t, { debt: o }),
923
+ /* @__PURE__ */ e(_t, { debt: n }),
921
924
  /* @__PURE__ */ e(W, {})
922
925
  ] })
923
926
  ] });
924
- }, ft = S(yt), gt = ({ setTabValue: a, sx: o }) => {
925
- const { debts: r } = C(), { showError: t, showCompleted: n } = R();
926
- return g.useEffect(() => {
927
+ }, ft = S(yt), xt = ({ setTabValue: a, sx: n }) => {
928
+ const { debts: r } = C(), { showError: t, showCompleted: o } = R();
929
+ return x.useEffect(() => {
927
930
  t && a(1);
928
- }, [t]), !t && !n ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ s(x, { gap: 16, children: [
929
- /* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
931
+ }, [t]), !t && !o ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ s(g, { gap: 16, children: [
932
+ /* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
930
933
  pe,
931
934
  {
932
935
  icon: t ? /* @__PURE__ */ e(Ve, { filled: !0 }) : /* @__PURE__ */ e(ye, { color: "success", filled: !0 }),
@@ -947,7 +950,7 @@ const xe = ({
947
950
  ]
948
951
  }
949
952
  ) }),
950
- t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
953
+ t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
951
954
  pe,
952
955
  {
953
956
  icon: /* @__PURE__ */ e(L, {}),
@@ -966,16 +969,16 @@ const xe = ({
966
969
  }
967
970
  ) })
968
971
  ] });
969
- }, xt = S(gt), wt = () => {
970
- const { debts: a } = C(), { showError: o, showCompleted: r } = R(), [t, n] = g.useState(0);
972
+ }, gt = S(xt), wt = () => {
973
+ const { debts: a } = C(), { showError: n, showCompleted: r } = R(), [t, o] = x.useState(0);
971
974
  return /* @__PURE__ */ s(L, { children: [
972
- (o || r) && /* @__PURE__ */ e(xt, { setTabValue: n, sx: { mt: -24 } }),
975
+ (n || r) && /* @__PURE__ */ e(gt, { setTabValue: o, sx: { mt: -24 } }),
973
976
  /* @__PURE__ */ s(
974
977
  We,
975
978
  {
976
979
  "aria-label": a.details_tabs_aria_label,
977
980
  centered: !0,
978
- onChange: (i, p) => n(p),
981
+ onChange: (i, p) => o(p),
979
982
  textColor: "primary",
980
983
  value: t,
981
984
  variant: "fullWidth",
@@ -1002,29 +1005,29 @@ const xe = ({
1002
1005
  /* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ht, {}) }),
1003
1006
  /* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(ft, {}) })
1004
1007
  ] });
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
+ }, Ct = S(wt), St = ({ isOpen: a, onClose: n }) => {
1009
+ const { debts: r } = C(), { showError: t, showCompleted: o } = R(), i = t || o ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ e(pt, {});
1007
1010
  return /* @__PURE__ */ e(
1008
1011
  te,
1009
1012
  {
1010
1013
  ariaLabelClose: r.details_close_aria,
1011
1014
  isOpen: a,
1012
- onClose: o,
1015
+ onClose: n,
1013
1016
  title: r.details_title,
1014
- children: /* @__PURE__ */ s(x, { bgcolor: "background.default", children: [
1017
+ children: /* @__PURE__ */ s(g, { bgcolor: "background.default", children: [
1015
1018
  /* @__PURE__ */ e(ke, { customDetailsChart: i }),
1016
1019
  /* @__PURE__ */ e(Ct, {})
1017
1020
  ] })
1018
1021
  }
1019
1022
  );
1020
- }, Dt = S(() => {
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, {
1023
- user_guid: o?.user_guid
1023
+ }, vt = S(() => {
1024
+ const { debts: a } = C(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = z(), { onEvent: t } = k(), [o, i] = x.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
1025
+ n && (await r({ ...n, extra_payment: o }), n.extra_payment = o, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1026
+ user_guid: n?.user_guid
1024
1027
  }));
1025
1028
  }, c = () => {
1026
1029
  setTimeout(() => {
1027
- i(o?.extra_payment ?? 0);
1030
+ i(n?.extra_payment ?? 0);
1028
1031
  }, 250);
1029
1032
  };
1030
1033
  return /* @__PURE__ */ e(
@@ -1035,74 +1038,74 @@ const xe = ({
1035
1038
  onCancel: c,
1036
1039
  onSave: d,
1037
1040
  primaryText: a.paydown_drawer_extra_payment,
1038
- secondaryText: P(o?.extra_payment, "0,0"),
1039
- zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
1041
+ secondaryText: P(n?.extra_payment, "0,0"),
1042
+ zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
1040
1043
  children: /* @__PURE__ */ e(
1041
1044
  ae,
1042
1045
  {
1043
- amount: n,
1046
+ amount: o,
1044
1047
  autoFocus: !0,
1045
1048
  error: p,
1046
1049
  fullWidth: !0,
1047
1050
  minAmount: 0,
1048
- setAmount: (h) => i(isNaN(Number(h)) ? n : Number(h)),
1051
+ setAmount: (h) => i(isNaN(Number(h)) ? o : Number(h)),
1049
1052
  sx: { ".MuiTypography-Body": { p: 0 } }
1050
1053
  }
1051
1054
  )
1052
1055
  }
1053
1056
  );
1054
- }), vt = () => {
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: [
1057
+ }), Dt = () => {
1058
+ const { debts: a } = C(), { totalMonthlyPayments: n } = q(), { monthlyCashFlowProfile: r } = z(), t = n + Number(r?.extra_payment);
1059
+ return /* @__PURE__ */ s(g, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1060
+ /* @__PURE__ */ s(g, { p: 24, children: [
1061
+ /* @__PURE__ */ s(g, { alignItems: "center", gap: 4, mb: 24, children: [
1059
1062
  /* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
1060
- /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: P(o, "0,0") }),
1063
+ /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: P(n, "0,0") }),
1061
1064
  /* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
1062
1065
  ] }),
1063
- /* @__PURE__ */ s(x, { children: [
1066
+ /* @__PURE__ */ s(g, { children: [
1064
1067
  /* @__PURE__ */ e(l, { variant: "H3", children: a.paydown_drawer_subtitle }),
1065
1068
  /* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
1066
1069
  ] })
1067
1070
  ] }),
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: [
1071
+ /* @__PURE__ */ e(g, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(vt, {}) }),
1072
+ /* @__PURE__ */ e(g, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(g, { gap: 4, children: [
1070
1073
  /* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
1071
1074
  /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: P(t, "0,0") })
1072
1075
  ] }) })
1073
1076
  ] });
1074
- }, Tt = S(vt), At = ({ isOpen: a, onClose: o }) => {
1077
+ }, Tt = S(Dt), At = ({ isOpen: a, onClose: n }) => {
1075
1078
  const { debts: r } = C();
1076
1079
  return /* @__PURE__ */ e(
1077
1080
  te,
1078
1081
  {
1079
1082
  ariaLabelClose: r.paydown_drawer_close_aria,
1080
1083
  isOpen: a,
1081
- onClose: o,
1084
+ onClose: n,
1082
1085
  title: r.paydown_drawer_title,
1083
1086
  children: /* @__PURE__ */ e(Tt, {})
1084
1087
  }
1085
1088
  );
1086
1089
  };
1087
- function Et(a, o) {
1090
+ function Et(a, n) {
1088
1091
  const r = (t) => {
1089
1092
  if (typeof t == "number") return t;
1090
1093
  if (t === "!" || t === "✓") return 1 / 0;
1091
1094
  throw new Error("Unsupported value");
1092
1095
  };
1093
- return r(a) - r(o);
1096
+ return r(a) - r(n);
1094
1097
  }
1095
1098
  function It(a) {
1096
1099
  return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
1097
1100
  }
1098
1101
  const Bt = (a) => {
1099
- const o = {
1102
+ const n = {
1100
1103
  text: "#121417",
1101
1104
  background: "#FFB252"
1102
1105
  };
1103
- return a === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), a === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
1106
+ return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
1104
1107
  }, Mt = (a) => {
1105
- const o = String(a.formattedValue), r = Bt(o);
1108
+ const n = String(a.formattedValue), r = Bt(n);
1106
1109
  return /* @__PURE__ */ e(
1107
1110
  re,
1108
1111
  {
@@ -1117,32 +1120,32 @@ const Bt = (a) => {
1117
1120
  backgroundColor: r.background,
1118
1121
  marginLeft: "10px"
1119
1122
  },
1120
- children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: o })
1123
+ children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: n })
1121
1124
  }
1122
1125
  );
1123
1126
  }, Pt = (a) => {
1124
- const o = a.row.account, r = Ke[o.account_type];
1125
- return /* @__PURE__ */ s(x, { alignItems: "center", flexDirection: "row", children: [
1127
+ const n = a.row.account, r = Ke[n.account_type];
1128
+ return /* @__PURE__ */ s(g, { alignItems: "center", flexDirection: "row", children: [
1126
1129
  /* @__PURE__ */ e(
1127
- ve,
1130
+ De,
1128
1131
  {
1129
- alt: `${o.institutionName}`,
1130
- institutionGuid: o.institution_guid || ""
1132
+ alt: `${n.institutionName}`,
1133
+ institutionGuid: n.institution_guid || ""
1131
1134
  }
1132
1135
  ),
1133
- /* @__PURE__ */ s(x, { ml: 12, children: [
1134
- /* @__PURE__ */ e(l, { variant: "Small", children: o.name }),
1136
+ /* @__PURE__ */ s(g, { ml: 12, children: [
1137
+ /* @__PURE__ */ e(l, { variant: "Small", children: n.name }),
1135
1138
  /* @__PURE__ */ e(l, { variant: "XSmall", children: r })
1136
1139
  ] })
1137
1140
  ] });
1138
1141
  }, kt = ({
1139
1142
  sx: a = {},
1140
- debts: o,
1143
+ debts: n,
1141
1144
  hoveredDebtGuid: r,
1142
1145
  onHoverRow: t,
1143
- onClickRow: n
1146
+ onClickRow: o
1144
1147
  }) => {
1145
- const i = j(), { onEvent: p } = k(), { isMobile: d } = X(), { debts: c } = C(), [h, m] = g.useState([
1148
+ const i = j(), { onEvent: p } = k(), { isMobile: d } = X(), { debts: c } = C(), [h, m] = x.useState([
1146
1149
  { field: "priority", sort: "asc" }
1147
1150
  ]), y = [
1148
1151
  {
@@ -1175,7 +1178,7 @@ const Bt = (a) => {
1175
1178
  field: "balance",
1176
1179
  headerName: c.table_column_balance,
1177
1180
  renderHeader: G,
1178
- valueFormatter: (u) => P(u, "0,0"),
1181
+ renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: P(u.value, "0,0") }),
1179
1182
  sortable: !0,
1180
1183
  hideSortIcons: d,
1181
1184
  type: "number",
@@ -1188,7 +1191,7 @@ const Bt = (a) => {
1188
1191
  field: "interest_rate",
1189
1192
  headerName: c.table_column_interest_rate,
1190
1193
  renderHeader: G,
1191
- valueFormatter: (u) => isNaN(u) ? "---" : `${Number(u).toFixed(2)}%`,
1194
+ renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(u.value) ? "---" : `${Number(u.value).toFixed(2)}%` }),
1192
1195
  sortable: !0,
1193
1196
  hideSortIcons: d,
1194
1197
  type: "number",
@@ -1201,7 +1204,7 @@ const Bt = (a) => {
1201
1204
  field: "projected_payoff_date",
1202
1205
  headerName: c.table_column_payoff_date,
1203
1206
  renderHeader: G,
1204
- valueFormatter: (u) => u ? K(u, U.MONTH_SHORT_YEAR) : "---",
1207
+ renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: u.value ? K(u.value, U.MONTH_SHORT_YEAR) : "---" }),
1205
1208
  sortable: !0,
1206
1209
  hideSortIcons: d,
1207
1210
  type: "number",
@@ -1214,7 +1217,7 @@ const Bt = (a) => {
1214
1217
  field: "monthly_payment",
1215
1218
  headerName: c.table_column_amount_due,
1216
1219
  renderHeader: G,
1217
- valueFormatter: (u) => typeof u == "number" ? P(u, "0,0") : "---",
1220
+ renderCell: (u) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof u.value == "number" ? P(u.value, "0,0") : "---" }),
1218
1221
  sortable: !0,
1219
1222
  hideSortIcons: d,
1220
1223
  type: "number",
@@ -1237,14 +1240,14 @@ const Bt = (a) => {
1237
1240
  headerAlign: "right",
1238
1241
  width: 20
1239
1242
  }
1240
- ], D = g.useMemo(() => o.map((u, I) => ({
1243
+ ], v = x.useMemo(() => n.map((u, I) => ({
1241
1244
  ...u,
1242
1245
  id: I,
1243
1246
  priority: It(u)
1244
- })), [o]), E = (u) => {
1245
- const Y = u.target.closest("[data-id]")?.getAttribute("data-id"), b = o[Number(Y)];
1247
+ })), [n]), E = (u) => {
1248
+ const Y = u.target.closest("[data-id]")?.getAttribute("data-id"), b = n[Number(Y)];
1246
1249
  t?.(b?.guid ?? "");
1247
- }, v = (u) => D.find((I) => I.guid === u)?.id;
1250
+ }, D = (u) => v.find((I) => I.guid === u)?.id;
1248
1251
  return /* @__PURE__ */ e(
1249
1252
  re,
1250
1253
  {
@@ -1265,12 +1268,12 @@ const Bt = (a) => {
1265
1268
  hideFooter: !0,
1266
1269
  initialState: { sorting: { sortModel: h } },
1267
1270
  onRowClick: (u) => {
1268
- n(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: u.row.guid });
1271
+ o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: u.row.guid });
1269
1272
  },
1270
1273
  onSortModelChange: (u) => {
1271
1274
  m(u), p(T.DEBTS_CLICK_TABLE_SORT);
1272
1275
  },
1273
- rows: D,
1276
+ rows: v,
1274
1277
  slotProps: {
1275
1278
  baseIconButton: { color: "secondary", sx: { ml: 8 } },
1276
1279
  row: {
@@ -1281,7 +1284,7 @@ const Bt = (a) => {
1281
1284
  sortModel: h,
1282
1285
  sortingOrder: ["asc", "desc"],
1283
1286
  sx: {
1284
- [`& .MuiDataGrid-row[data-id="${v(r)}"]`]: {
1287
+ [`& .MuiDataGrid-row[data-id="${D(r)}"]`]: {
1285
1288
  backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
1286
1289
  filter: "brightness(98%)"
1287
1290
  }
@@ -1290,9 +1293,9 @@ const Bt = (a) => {
1290
1293
  )
1291
1294
  }
1292
1295
  );
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(
1296
+ }, Nt = ({ buttonText: a, isOpen: n, onClick: r }) => {
1297
+ const { isDesktop: t, isTablet: o } = X(), i = n ? "unfold_less" : "unfold_more";
1298
+ return t || o ? /* @__PURE__ */ e(
1296
1299
  fe,
1297
1300
  {
1298
1301
  "aria-controls": "prioritize-debts",
@@ -1315,8 +1318,8 @@ const Bt = (a) => {
1315
1318
  children: /* @__PURE__ */ e(ee, { name: i })
1316
1319
  }
1317
1320
  );
1318
- }, Nt = S(({ buttonEl: a, onClose: o }) => {
1319
- const { onEvent: r } = k(), { debts: t } = C(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = R(), p = !!a, d = [
1321
+ }, Ft = S(({ buttonEl: a, onClose: n }) => {
1322
+ const { onEvent: r } = k(), { debts: t } = C(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = R(), p = !!a, d = [
1320
1323
  {
1321
1324
  priority: M.FASTEST_PAYOFF_FIRST,
1322
1325
  text: t.priority_sort_fastest_payoff
@@ -1345,7 +1348,7 @@ const Bt = (a) => {
1345
1348
  horizontal: "left"
1346
1349
  },
1347
1350
  id: "prioritize-debts",
1348
- onClose: o,
1351
+ onClose: n,
1349
1352
  open: p,
1350
1353
  transformOrigin: {
1351
1354
  vertical: "top",
@@ -1356,8 +1359,8 @@ const Bt = (a) => {
1356
1359
  {
1357
1360
  onClick: () => c(h),
1358
1361
  sx: {
1359
- bgcolor: n === h ? "primary.main" : void 0,
1360
- color: n === h ? "#fff" : void 0,
1362
+ bgcolor: o === h ? "primary.main" : void 0,
1363
+ color: o === h ? "#fff" : void 0,
1361
1364
  justifyContent: "space-between",
1362
1365
  minHeight: 44,
1363
1366
  minWidth: 268,
@@ -1371,7 +1374,7 @@ const Bt = (a) => {
1371
1374
  },
1372
1375
  children: [
1373
1376
  /* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: m }),
1374
- n === h && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
1377
+ o === h && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
1375
1378
  ]
1376
1379
  },
1377
1380
  h
@@ -1379,51 +1382,51 @@ const Bt = (a) => {
1379
1382
  }
1380
1383
  );
1381
1384
  }), Rt = S(() => {
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);
1385
+ const { onEvent: a } = k(), { debts: n } = C(), { selectedDebtPriority: r } = R(), [t, o] = x.useState(null), i = (h) => {
1386
+ o(h.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1384
1387
  }, p = () => {
1385
- n(null);
1386
- }, d = !!t, c = g.useMemo(() => ({
1387
- [M.FASTEST_PAYOFF_FIRST]: o.priority_sort_fastest_payoff,
1388
- [M.HIGHEST_INTEREST]: o.priority_sort_highest_interest,
1389
- [M.HIGHEST_BALANCE]: o.priority_sort_highest_balance,
1390
- [M.LOWEST_BALANCE]: o.priority_sort_lowest_balance
1391
- })[r] ?? o.priority_sort_lowest_balance, [r]);
1388
+ o(null);
1389
+ }, d = !!t, c = x.useMemo(() => ({
1390
+ [M.FASTEST_PAYOFF_FIRST]: n.priority_sort_fastest_payoff,
1391
+ [M.HIGHEST_INTEREST]: n.priority_sort_highest_interest,
1392
+ [M.HIGHEST_BALANCE]: n.priority_sort_highest_balance,
1393
+ [M.LOWEST_BALANCE]: n.priority_sort_lowest_balance
1394
+ })[r] ?? n.priority_sort_lowest_balance, [r]);
1392
1395
  return /* @__PURE__ */ s(_, { children: [
1393
- /* @__PURE__ */ e(Ft, { buttonText: c, isOpen: d, onClick: i }),
1394
- /* @__PURE__ */ e(Nt, { buttonEl: t, onClose: p })
1396
+ /* @__PURE__ */ e(Nt, { buttonText: c, isOpen: d, onClick: i }),
1397
+ /* @__PURE__ */ e(Ft, { buttonEl: t, onClose: p })
1395
1398
  ] });
1396
- }), Lt = (a, o, r = 0) => {
1399
+ }), Lt = (a, n, r = 0) => {
1397
1400
  const t = a.map((c) => ({ ...c }));
1398
- ge(t, o);
1399
- const n = /* @__PURE__ */ new Date(), i = [];
1401
+ xe(t, n);
1402
+ const o = /* @__PURE__ */ new Date(), i = [];
1400
1403
  let p = 0, d = 1;
1401
1404
  for (const c of t)
1402
1405
  i.push({
1403
1406
  ...c,
1404
1407
  // Start with the initial balance
1405
- dataset: [{ x: new Date(n), y: c.balance }]
1408
+ dataset: [{ x: new Date(o), y: c.balance }]
1406
1409
  });
1407
1410
  for (; t.some((c) => c.balance >= 0.01 && !c.is_impossible); ) {
1408
1411
  let c = !1;
1409
1412
  for (const [h, m] of t.entries()) {
1410
1413
  if (m.balance <= 0.01) continue;
1411
- const y = i[h].dataset, D = (m.interest_rate ?? 0) / 100 / 12, E = m.balance * D;
1412
- let v = m.monthly_payment ?? 0;
1413
- h === 0 && (v += r), m.balance += E;
1414
- const u = Math.min(m.balance, v + p);
1414
+ const y = i[h].dataset, v = (m.interest_rate ?? 0) / 100 / 12, E = m.balance * v;
1415
+ let D = m.monthly_payment ?? 0;
1416
+ h === 0 && (D += r), m.balance += E;
1417
+ const u = Math.min(m.balance, D + p);
1415
1418
  if (u <= E) {
1416
- m.is_impossible = !0, i[h].is_impossible = !0, i[h].priority = void 0, y.push({ x: new Date(n), y: m.balance });
1419
+ m.is_impossible = !0, i[h].is_impossible = !0, i[h].priority = void 0, y.push({ x: new Date(o), y: m.balance });
1417
1420
  continue;
1418
1421
  }
1419
1422
  m.balance -= u, m.balance = m.balance < 0.01 ? 0 : m.balance, y.push({
1420
- x: new Date(n),
1423
+ x: new Date(o),
1421
1424
  y: Math.max(0, m.balance),
1422
1425
  payment: u,
1423
1426
  extra: p
1424
- }), m.balance <= 0 && (p += v, i[h].projected_payoff_date = new Date(n)), u > 0 && (c = !0);
1427
+ }), m.balance <= 0 && (p += D, i[h].projected_payoff_date = new Date(o)), u > 0 && (c = !0);
1425
1428
  }
1426
- c && n.setMonth(n.getMonth() + 1);
1429
+ c && o.setMonth(o.getMonth() + 1);
1427
1430
  }
1428
1431
  return i.forEach((c) => {
1429
1432
  (c.interest_rate === void 0 || c.interest_rate === void 0) && (c.projected_payoff_date = void 0);
@@ -1431,7 +1434,7 @@ const Bt = (a) => {
1431
1434
  c.priority = !c.is_paid_off && !c.is_impossible ? d++ : void 0;
1432
1435
  }), i;
1433
1436
  }, $t = S(({ onClick: a }) => {
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;
1437
+ const { debts: n } = C(), { isDesktop: r } = X(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: o } = z(), i = t + Number(o?.extra_payment), p = r ? n.paydown_button_long : n.paydown_button_short;
1435
1438
  return /* @__PURE__ */ e(
1436
1439
  fe,
1437
1440
  {
@@ -1444,27 +1447,27 @@ const Bt = (a) => {
1444
1447
  children: A(p, P(i, "0,0"))
1445
1448
  }
1446
1449
  );
1447
- }), Ht = ({ onBackClick: a, sx: o }) => {
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(() => {
1449
- const H = F?.extra_payment ?? 0;
1450
- return Lt(N, V, H);
1451
- }, [N, V, F]);
1452
- g.useEffect(() => {
1453
- u(b), D(T.DEBTS_VIEW);
1454
- }, []), g.useEffect(() => {
1450
+ }), Ht = ({ onBackClick: a, sx: n }) => {
1451
+ const [r, t] = x.useState(!1), [o, i] = x.useState(!1), [p, d] = x.useState(!1), [c, h] = x.useState(""), { isDesktop: m, isMobile: y } = X(), { debts: f } = C(), { onEvent: v } = k(), { isCopyLoaded: E, isInitialized: D, setSelectedAccounts: u } = Pe(), { setSelectedAccount: I } = Ne(), { selectedDebtPriority: V, setSelectedDebtChartData: Y } = R(), { visibleDebtAccounts: b } = Z(), { goalsLoaded: w, loadGoals: B, monthlyCashFlowProfile: N } = z(), { debts: F } = q(), $ = x.useMemo(() => {
1452
+ const H = N?.extra_payment ?? 0;
1453
+ return Lt(F, V, H);
1454
+ }, [F, V, N]);
1455
+ x.useEffect(() => {
1456
+ u(b), v(T.DEBTS_VIEW);
1457
+ }, []), x.useEffect(() => {
1455
1458
  u(b);
1456
- }, [b]), g.useEffect(() => {
1457
- v && B().finally();
1458
- }, [v]);
1459
- const oe = (H) => h(H), ne = () => {
1459
+ }, [b]), x.useEffect(() => {
1460
+ D && B().finally();
1461
+ }, [D]);
1462
+ const ne = (H) => h(H), oe = () => {
1460
1463
  const H = b.find((Q) => Q.guid === c), ie = $.find((Q) => Q.guid === c);
1461
1464
  H && I(H), ie && Y(ie), t(!0);
1462
- }, we = () => D(T.DEBTS_CLICK_FILTER), Ce = () => {
1463
- d(!0), D(T.DEBTS_CLICK_SNOWBALL_CTA);
1465
+ }, we = () => v(T.DEBTS_CLICK_FILTER), Ce = () => {
1466
+ d(!0), v(T.DEBTS_CLICK_SNOWBALL_CTA);
1464
1467
  }, Se = () => {
1465
- i(!0), D(T.DEBTS_CLICK_PAYDOWN);
1468
+ i(!0), v(T.DEBTS_CLICK_PAYDOWN);
1466
1469
  };
1467
- return !w || !E || !v ? /* @__PURE__ */ e(Je, {}) : /* @__PURE__ */ s(
1470
+ return !w || !E || !D ? /* @__PURE__ */ e(Je, {}) : /* @__PURE__ */ s(
1468
1471
  Oe,
1469
1472
  {
1470
1473
  accountOptions: b,
@@ -1474,12 +1477,12 @@ const Bt = (a) => {
1474
1477
  ],
1475
1478
  onAccountsFilterClick: we,
1476
1479
  onBackClick: a,
1477
- sx: o,
1480
+ sx: n,
1478
1481
  title: f.title,
1479
1482
  children: [
1480
- /* @__PURE__ */ s(x, { sx: { px: m ? "48px" : "24px" }, children: [
1483
+ /* @__PURE__ */ s(g, { sx: { px: m ? "48px" : "24px" }, children: [
1481
1484
  /* @__PURE__ */ s(
1482
- x,
1485
+ g,
1483
1486
  {
1484
1487
  sx: {
1485
1488
  alignItems: y ? "flex-start" : "flex-end",
@@ -1488,18 +1491,18 @@ const Bt = (a) => {
1488
1491
  },
1489
1492
  children: [
1490
1493
  /* @__PURE__ */ e(
1491
- xe,
1494
+ ge,
1492
1495
  {
1493
1496
  debts: $,
1494
1497
  height: y ? 250 : void 0,
1495
1498
  hoveredDebtGuid: c,
1496
- onClickArea: ne,
1497
- onHoverArea: oe,
1499
+ onClickArea: oe,
1500
+ onHoverArea: ne,
1498
1501
  sx: { mr: y ? "4px" : "-48px" }
1499
1502
  }
1500
1503
  ),
1501
1504
  /* @__PURE__ */ e(
1502
- nt,
1505
+ ot,
1503
1506
  {
1504
1507
  debts: $,
1505
1508
  onClickCta: Ce,
@@ -1509,13 +1512,13 @@ const Bt = (a) => {
1509
1512
  ]
1510
1513
  }
1511
1514
  ),
1512
- /* @__PURE__ */ e(x, { sx: { mx: y ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1515
+ /* @__PURE__ */ e(g, { sx: { mx: y ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1513
1516
  kt,
1514
1517
  {
1515
1518
  debts: $,
1516
1519
  hoveredDebtGuid: c,
1517
- onClickRow: ne,
1518
- onHoverRow: oe
1520
+ onClickRow: oe,
1521
+ onHoverRow: ne
1519
1522
  }
1520
1523
  ) })
1521
1524
  ] }),
@@ -1527,14 +1530,14 @@ const Bt = (a) => {
1527
1530
  }
1528
1531
  ),
1529
1532
  /* @__PURE__ */ e(St, { isOpen: r, onClose: () => t(!1) }),
1530
- /* @__PURE__ */ e(At, { isOpen: n, onClose: () => i(!1) })
1533
+ /* @__PURE__ */ e(At, { isOpen: o, onClose: () => i(!1) })
1531
1534
  ]
1532
1535
  }
1533
1536
  );
1534
1537
  }, Pr = S(Ht);
1535
1538
  export {
1536
- xe as DebtsChart,
1537
- Nr as DebtsStore,
1539
+ ge as DebtsChart,
1540
+ Fr as DebtsStore,
1538
1541
  kt as DebtsTable,
1539
1542
  Pr as DebtsWidget
1540
1543
  };