@mx-cartographer/experiences 7.4.17-alpha.mega1 → 7.4.17

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,5 +1,5 @@
1
1
  import { jsx as e, jsxs as s, Fragment as H } from "react/jsx-runtime";
2
- import x from "react";
2
+ import g from "react";
3
3
  import { observer as D } from "mobx-react-lite";
4
4
  import w from "@mui/material/Stack";
5
5
  import { useTheme as X, Card as be, Stack as _, Box as G } from "@mui/material";
@@ -20,9 +20,9 @@ import { A as ke, u as Ne } from "../AccountDetailsHeader-BkG3MNYo.mjs";
20
20
  import Fe from "@mui/material/Card";
21
21
  import Re from "@mui/material/CardContent";
22
22
  import Le from "@mui/material/CardHeader";
23
+ import { LineChart as $e } from "@mui/x-charts";
23
24
  import re from "@mui/material/Box";
24
- import { useTheme as $e } from "@mui/material/styles";
25
- import { LineChart as He } from "@mui/x-charts/LineChart";
25
+ import { useTheme as He } from "@mui/material/styles";
26
26
  import { A as T, W as Oe } from "../WidgetContainer-CoFDmQRE.mjs";
27
27
  import de from "@mui/material/Tab";
28
28
  import We from "@mui/material/Tabs";
@@ -46,17 +46,17 @@ import qe from "@mui/material/ListItem";
46
46
  import Ze from "@mui/material/Popover";
47
47
  import { u as Je } from "../useWidgetLoadTimer-hIOioiKx.mjs";
48
48
  import { L as Qe } from "../Loader-DUaFpDGv.mjs";
49
- const et = (a, o = 0, r = 0) => {
49
+ const et = (a, n = 0, r = 0) => {
50
50
  if (r === 0) return 0;
51
- const t = o / (Ee * Ie);
51
+ const t = n / (Ee * Ie);
52
52
  return Math.ceil(
53
53
  t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
54
54
  );
55
- }, tt = (a, o, r, t, n) => {
55
+ }, tt = (a, n, r, t, o) => {
56
56
  const i = [];
57
57
  if (r === 0) {
58
58
  for (let c = 0; c < a; c++) {
59
- const d = o - t * (c + 1), m = o - t * c, b = d >= 0 ? t : m;
59
+ const d = n - t * (c + 1), m = n - t * c, b = d >= 0 ? t : m;
60
60
  i.push({
61
61
  balance: d >= 0 ? d : 0,
62
62
  interest: r,
@@ -64,7 +64,7 @@ const et = (a, o = 0, r = 0) => {
64
64
  principal: b,
65
65
  timestamp: ce(
66
66
  le(
67
- se(n),
67
+ se(o),
68
68
  // convert seconds → Date
69
69
  c + 1
70
70
  // add (index + 1) months
@@ -76,7 +76,7 @@ const et = (a, o = 0, r = 0) => {
76
76
  }
77
77
  const p = r / 1200;
78
78
  for (let c = 0; c < a; c++) {
79
- const d = ce(le(se(n), c + 1)), m = Math.pow(1 + p, c), b = o * m - t * ((m - 1) / p), f = Math.pow(1 + p, c + 1), u = o * f - t * ((f - 1) / p), v = t + Math.min(u, 0), M = b * p;
79
+ const d = ce(le(se(o), c + 1)), m = Math.pow(1 + p, c), b = n * m - t * ((m - 1) / p), f = Math.pow(1 + p, c + 1), u = n * f - t * ((f - 1) / p), v = t + Math.min(u, 0), M = b * p;
80
80
  i.push({
81
81
  balance: Math.max(0, u),
82
82
  interest: M,
@@ -87,47 +87,47 @@ const et = (a, o = 0, r = 0) => {
87
87
  }
88
88
  return i;
89
89
  }, rt = (a) => (a[a.length - 1] || {}).timestamp, at = (a) => {
90
- const { monthly_payment: o, interest_rate: r, balance: t, payment_due_date: n } = a, i = et(t, r ?? 0, o ?? 0), p = tt(
90
+ const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i = et(t, r ?? 0, n ?? 0), p = tt(
91
91
  i,
92
92
  t,
93
93
  r ?? 0,
94
- o ?? 0,
95
- n
94
+ n ?? 0,
95
+ o
96
96
  ), c = rt(p);
97
97
  return {
98
98
  ...a,
99
99
  minimumFinalPayment: c,
100
100
  minimumPayments: p
101
101
  };
102
- }, ge = (a, o) => {
102
+ }, xe = (a, n) => {
103
103
  const [r, t] = a.reduce(
104
- ([n, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : n.push(at(p)), [n, i]),
104
+ ([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(at(p)), [o, i]),
105
105
  [[], []]
106
106
  );
107
- switch (o) {
107
+ switch (n) {
108
108
  case P.FASTEST_PAYOFF_FIRST:
109
- r.sort((n, i) => (n.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
109
+ r.sort((o, i) => (o.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
110
110
  break;
111
111
  case P.HIGHEST_INTEREST:
112
- r.sort((n, i) => (i.interest_rate ?? 0) - (n.interest_rate ?? 0));
112
+ r.sort((o, i) => (i.interest_rate ?? 0) - (o.interest_rate ?? 0));
113
113
  break;
114
114
  case P.LOWEST_BALANCE:
115
- r.sort((n, i) => n.balance - i.balance);
115
+ r.sort((o, i) => o.balance - i.balance);
116
116
  break;
117
117
  case P.HIGHEST_BALANCE:
118
- r.sort((n, i) => i.balance - n.balance);
118
+ r.sort((o, i) => i.balance - o.balance);
119
119
  break;
120
120
  default:
121
- r.sort((n, i) => n.balance - i.balance);
121
+ r.sort((o, i) => o.balance - i.balance);
122
122
  }
123
123
  a.splice(0, a.length, ...r, ...t);
124
124
  };
125
- function ot(a, o, r = 0) {
125
+ function nt(a, n, r = 0) {
126
126
  const t = a.map((b) => ({ ...b })).filter(
127
127
  (b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
128
128
  );
129
- ge(t, o);
130
- let n = 0, i = 0;
129
+ xe(t, n);
130
+ let o = 0, i = 0;
131
131
  const p = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
132
132
  for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
133
133
  let b = !1;
@@ -141,32 +141,32 @@ function ot(a, o, r = 0) {
141
141
  u.is_impossible = !0;
142
142
  continue;
143
143
  }
144
- u.balance -= B, u.balance = u.balance < 0.01 ? 0 : u.balance, n += I, u.balance <= 0 && (i += C), B > 0 && (b = !0);
144
+ u.balance -= B, u.balance = u.balance < 0.01 ? 0 : u.balance, o += I, u.balance <= 0 && (i += C), B > 0 && (b = !0);
145
145
  }
146
146
  b && c.setMonth(c.getMonth() + 1);
147
147
  }
148
148
  const d = t.some((b) => b.is_impossible && b.balance > 0), m = Te({ start: p, end: c });
149
149
  return {
150
- payoffSavings: d ? "N/A" : k(n, "0,0.00"),
150
+ payoffSavings: d ? "N/A" : k(o, "0,0.00"),
151
151
  payoffDate: d ? "Never" : K(c, U.MONTH_YEAR),
152
152
  payoffDuration: d ? "Stagnant" : Ae(m, { format: ["years", "months"] }) || "0 months"
153
153
  };
154
154
  }
155
155
  const $ = () => {
156
- if (!x.useContext(Me))
156
+ if (!g.useContext(Me))
157
157
  throw new Error("useCateUiStore() must be used within the GlobalDataContext");
158
158
  return q().uiStore;
159
- }, nt = ({ debts: a, onClickCta: o, sx: r }) => {
160
- const t = X(), { isMobile: n } = Y(), { debts: i } = S(), { selectedDebtPriority: p } = $(), { monthlyCashFlowProfile: c } = V(), { payoffDate: d, payoffSavings: m, payoffDuration: b } = x.useMemo(() => {
159
+ }, ot = ({ debts: a, onClickCta: n, sx: r }) => {
160
+ const t = X(), { isMobile: o } = Y(), { debts: i } = S(), { selectedDebtPriority: p } = $(), { monthlyCashFlowProfile: c } = V(), { payoffDate: d, payoffSavings: m, payoffDuration: b } = g.useMemo(() => {
161
161
  const f = c?.extra_payment ?? 0;
162
- return ot(a, p, f);
162
+ return nt(a, p, f);
163
163
  }, [a, p, c]);
164
164
  return /* @__PURE__ */ e(
165
165
  be,
166
166
  {
167
167
  sx: {
168
168
  boxShadow: t.shadows[2],
169
- width: n ? "100%" : "186px",
169
+ width: o ? "100%" : "186px",
170
170
  minWidth: "186px",
171
171
  ...r
172
172
  },
@@ -174,7 +174,7 @@ const $ = () => {
174
174
  /* @__PURE__ */ s(
175
175
  _,
176
176
  {
177
- gap: n ? "4px" : "0",
177
+ gap: o ? "4px" : "0",
178
178
  sx: {
179
179
  borderBottom: "1px solid",
180
180
  borderBottomColor: t.palette.grey[300],
@@ -186,11 +186,11 @@ const $ = () => {
186
186
  ]
187
187
  }
188
188
  ),
189
- /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
189
+ /* @__PURE__ */ s(_, { gap: o ? "4px" : "0", children: [
190
190
  /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: m }),
191
191
  /* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
192
192
  ] }),
193
- /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
193
+ /* @__PURE__ */ s(_, { gap: o ? "4px" : "0", children: [
194
194
  /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: b }),
195
195
  /* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
196
196
  ] }),
@@ -199,7 +199,7 @@ const $ = () => {
199
199
  {
200
200
  bold: !0,
201
201
  color: t.palette.primary.main,
202
- onClick: o,
202
+ onClick: n,
203
203
  sx: { cursor: "pointer" },
204
204
  variant: "Small",
205
205
  children: i.snowball_card_cta
@@ -208,14 +208,14 @@ const $ = () => {
208
208
  ] })
209
209
  }
210
210
  );
211
- }, it = D(nt), lt = ({ isOpen: a, onClose: o }) => {
212
- const r = X(), { debts: t } = S(), [n, i] = x.useState(!1);
211
+ }, it = D(ot), lt = ({ isOpen: a, onClose: n }) => {
212
+ const r = X(), { debts: t } = S(), [o, i] = g.useState(!1);
213
213
  return /* @__PURE__ */ e(
214
214
  te,
215
215
  {
216
216
  ariaLabelClose: "",
217
217
  isOpen: a,
218
- onClose: o,
218
+ onClose: n,
219
219
  title: t.snowball_drawer_title,
220
220
  children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
221
221
  /* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
@@ -232,7 +232,7 @@ const $ = () => {
232
232
  {
233
233
  color: r.palette.secondary.main,
234
234
  mb: 8,
235
- sx: { whiteSpace: n ? "normal" : "nowrap" },
235
+ sx: { whiteSpace: o ? "normal" : "nowrap" },
236
236
  variant: "ParagraphSmall",
237
237
  children: t.snowball_drawer_answer
238
238
  }
@@ -242,10 +242,10 @@ const $ = () => {
242
242
  {
243
243
  bold: !0,
244
244
  color: r.palette.primary.main,
245
- onClick: () => i(!n),
245
+ onClick: () => i(!o),
246
246
  sx: { cursor: "pointer" },
247
247
  variant: "Small",
248
- children: n ? t.snowball_drawer_less : t.snowball_drawer_more
248
+ children: o ? t.snowball_drawer_less : t.snowball_drawer_more
249
249
  }
250
250
  )
251
251
  ] })
@@ -570,45 +570,45 @@ const $ = () => {
570
570
  }
571
571
  );
572
572
  }, st = D(lt), ct = "#FF7B08";
573
- function dt(a, o) {
574
- const [r, t, n] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
575
- Math.max(0, Math.min(255, Math.round(r * o))),
576
- Math.max(0, Math.min(255, Math.round(t * o))),
577
- Math.max(0, Math.min(255, Math.round(n * o)))
573
+ function dt(a, n) {
574
+ const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
575
+ Math.max(0, Math.min(255, Math.round(r * n))),
576
+ Math.max(0, Math.min(255, Math.round(t * n))),
577
+ Math.max(0, Math.min(255, Math.round(o * n)))
578
578
  ];
579
579
  return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
580
580
  }
581
- const xe = ({
581
+ const ge = ({
582
582
  sx: a,
583
- height: o = 500,
583
+ height: n = 500,
584
584
  width: r,
585
585
  debts: t,
586
- hoveredDebtGuid: n,
586
+ hoveredDebtGuid: o,
587
587
  onClickArea: i,
588
588
  onHoverArea: p
589
589
  }) => {
590
- const c = $e(), { onEvent: d } = F(), m = t.filter((h) => !h.is_impossible), b = [
590
+ const c = He(), { onEvent: d } = F(), m = t.filter((h) => !h.is_impossible), b = [
591
591
  ...new Set(
592
- m.flatMap((h) => h.dataset.map((g) => new Date(g.x).getTime()))
592
+ m.flatMap((h) => h.dataset.map((x) => new Date(x.x).getTime()))
593
593
  )
594
- ].sort((h, g) => h - g).map((h) => new Date(h)), f = m.map((h) => {
595
- const g = new Map(h.dataset.map((L) => [new Date(L.x).getTime(), L.y]));
596
- let A = g.get(b[0].getTime()) ?? 0;
594
+ ].sort((h, x) => h - x).map((h) => new Date(h)), f = m.map((h) => {
595
+ const x = new Map(h.dataset.map((L) => [new Date(L.x).getTime(), L.y]));
596
+ let A = x.get(b[0].getTime()) ?? 0;
597
597
  const R = b.map((L) => {
598
- const O = g.get(L.getTime()) ?? A;
598
+ const O = x.get(L.getTime()) ?? A;
599
599
  return A = O, { x: L, y: O };
600
600
  });
601
601
  return { ...h, dataset: R };
602
602
  }), u = f.reduce(
603
- (h, g) => h + (g.dataset[0]?.y ?? 0),
603
+ (h, x) => h + (x.dataset[0]?.y ?? 0),
604
604
  0
605
- ), v = b.map((h, g) => {
606
- const A = g / (b.length - 1), R = u * (1 - A);
605
+ ), v = b.map((h, x) => {
606
+ const A = x / (b.length - 1), R = u * (1 - A);
607
607
  return { x: h, y: R };
608
- }), M = Math.ceil(u / 100) * 100, I = b, C = f.map((h, g) => {
609
- const A = 1 - g / f.length * 0.5, R = dt(ct, A);
608
+ }), M = Math.ceil(u / 100) * 100, I = b, C = f.map((h, x) => {
609
+ const A = 1 - x / f.length * 0.5, R = dt(ct, A);
610
610
  return {
611
- id: `debt-${g}`,
611
+ id: `debt-${x}`,
612
612
  guid: h.guid,
613
613
  label: h.name,
614
614
  data: h.dataset.map((L) => L.y),
@@ -631,7 +631,7 @@ const xe = ({
631
631
  showMark: !1,
632
632
  disableHighlight: !0
633
633
  });
634
- const B = (h) => C.findIndex((g) => g?.guid === h);
634
+ const B = (h) => C.findIndex((x) => x?.guid === h);
635
635
  return /* @__PURE__ */ e(
636
636
  re,
637
637
  {
@@ -648,25 +648,27 @@ const xe = ({
648
648
  }
649
649
  },
650
650
  children: /* @__PURE__ */ e(
651
- He,
651
+ $e,
652
652
  {
653
653
  axisHighlight: { x: "none" },
654
654
  disableLineItemHighlight: !0,
655
- height: o,
656
- hideLegend: !0,
657
- margin: { bottom: 24, left: 32, right: 72, top: 48 },
658
- onAreaClick: (h, g) => {
655
+ height: n,
656
+ onAreaClick: (h, x) => {
659
657
  i?.();
660
- const A = C.find((R) => R.id === g.seriesId);
658
+ const A = C.find((R) => R.id === x.seriesId);
661
659
  d(T.DEBTS_CLICK_CHART_AREA, { account_guid: A?.guid });
662
660
  },
663
661
  onHighlightChange: (h) => {
664
- const g = C.find((A) => A.id === h?.seriesId)?.guid;
665
- p?.(g ?? "");
662
+ const x = C.find((A) => A.id === h?.seriesId)?.guid;
663
+ p?.(x ?? "");
666
664
  },
667
665
  series: C,
668
666
  skipAnimation: !0,
669
- slotProps: { tooltip: { trigger: "none" } },
667
+ slotProps: {
668
+ legend: {
669
+ hidden: !0
670
+ }
671
+ },
670
672
  sx: {
671
673
  p: 4,
672
674
  "& .MuiBarLabel-root": {
@@ -684,10 +686,10 @@ const xe = ({
684
686
  strokeDasharray: "10 5",
685
687
  strokeWidth: 1
686
688
  },
687
- [`& .MuiLineElement-series-debt-${B(n ?? "0")}`]: {
689
+ [`& .MuiLineElement-series-debt-${B(o ?? "0")}`]: {
688
690
  opacity: 1
689
691
  },
690
- [`& .MuiAreaElement-series-debt-${B(n ?? "0")}`]: {
692
+ [`& .MuiAreaElement-series-debt-${B(o ?? "0")}`]: {
691
693
  opacity: 1
692
694
  },
693
695
  "& .MuiChartsAxis-tickLabel > tspan": {
@@ -695,6 +697,7 @@ const xe = ({
695
697
  },
696
698
  ...a
697
699
  },
700
+ tooltip: { trigger: "none" },
698
701
  width: r,
699
702
  xAxis: [
700
703
  {
@@ -718,7 +721,7 @@ const xe = ({
718
721
  }
719
722
  );
720
723
  }, pt = () => {
721
- const a = X(), { debts: o } = S(), { selectedDebtChartData: r } = $();
724
+ const a = X(), { debts: n } = S(), { selectedDebtChartData: r } = $();
722
725
  return /* @__PURE__ */ s(H, { children: [
723
726
  /* @__PURE__ */ s(
724
727
  Fe,
@@ -729,8 +732,8 @@ const xe = ({
729
732
  }
730
733
  },
731
734
  children: [
732
- /* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children: o.details_chart_title }) }),
733
- /* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(xe, { debts: [r], height: 250 }) })
735
+ /* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children: n.details_chart_title }) }),
736
+ /* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(ge, { debts: [r], height: 250 }) })
734
737
  ]
735
738
  }
736
739
  ),
@@ -740,13 +743,13 @@ const xe = ({
740
743
  color: a.palette.text.secondary,
741
744
  sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
742
745
  variant: "Small",
743
- children: o.details_chart_description
746
+ children: n.details_chart_description
744
747
  }
745
748
  )
746
749
  ] });
747
750
  }, mt = D(pt), ht = () => {
748
- const a = X(), { onEvent: o } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: n, showError: i } = $();
749
- return x.useEffect(() => o(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || n ? /* @__PURE__ */ e(
751
+ const a = X(), { onEvent: n } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: o, showError: i } = $();
752
+ return g.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || o ? /* @__PURE__ */ e(
750
753
  l,
751
754
  {
752
755
  color: a.palette.secondary.main,
@@ -809,8 +812,8 @@ const xe = ({
809
812
  ) })
810
813
  ] }) });
811
814
  }, ut = D(ht), bt = D(({ debt: a }) => {
812
- const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.interest_rate ?? 0), p = n < 0, c = async () => {
813
- await r({ ...a.account, interest_rate: n }), a.interest_rate = n, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
815
+ const { debts: n } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [o, i] = g.useState(a.interest_rate ?? 0), p = o < 0, c = async () => {
816
+ await r({ ...a.account, interest_rate: o }), a.interest_rate = o, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
814
817
  }, d = () => {
815
818
  setTimeout(() => {
816
819
  i(a.interest_rate ?? 0);
@@ -820,12 +823,12 @@ const xe = ({
820
823
  J,
821
824
  {
822
825
  isSaveDisabled: p,
823
- label: `${o.details_interest_rate} (%)`,
826
+ label: `${n.details_interest_rate} (%)`,
824
827
  onCancel: d,
825
828
  onSave: c,
826
- primaryText: o.details_interest_rate,
829
+ primaryText: n.details_interest_rate,
827
830
  secondaryText: Be(Number(a.interest_rate) / 100),
828
- zeroStateText: a.interest_rate ? void 0 : o.add_interest_rate,
831
+ zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
829
832
  children: /* @__PURE__ */ e(
830
833
  Xe,
831
834
  {
@@ -833,14 +836,14 @@ const xe = ({
833
836
  fullWidth: !0,
834
837
  onChange: (m) => i(isNaN(parseFloat(m.target.value)) ? 0 : parseFloat(m.target.value)),
835
838
  type: "number",
836
- value: n
839
+ value: o
837
840
  }
838
841
  )
839
842
  }
840
843
  );
841
844
  }), _t = D(({ debt: a }) => {
842
- const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.monthly_payment ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
843
- await r({ ...a.account, minimum_payment: n }), a.monthly_payment = n, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
845
+ const { debts: n } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [o, i] = g.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
846
+ await r({ ...a.account, minimum_payment: o }), a.monthly_payment = o, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
844
847
  }, d = () => {
845
848
  setTimeout(() => {
846
849
  i(a.monthly_payment ?? 0);
@@ -850,29 +853,29 @@ const xe = ({
850
853
  J,
851
854
  {
852
855
  isSaveDisabled: p,
853
- label: o.details_monthly_payment,
856
+ label: n.details_monthly_payment,
854
857
  onCancel: d,
855
858
  onSave: c,
856
- primaryText: o.details_monthly_payment,
859
+ primaryText: n.details_monthly_payment,
857
860
  secondaryText: k(a.monthly_payment, "0,0"),
858
- zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
861
+ zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
859
862
  children: /* @__PURE__ */ e(
860
863
  ae,
861
864
  {
862
- amount: n,
865
+ amount: o,
863
866
  autoFocus: !0,
864
867
  error: p,
865
868
  fullWidth: !0,
866
869
  minAmount: 0,
867
- setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
870
+ setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
868
871
  sx: { ".MuiTypography-Body": { p: 0 } }
869
872
  }
870
873
  )
871
874
  }
872
875
  );
873
876
  }), yt = D(({ debt: a }) => {
874
- const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.original_balance ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
875
- await r({ ...a.account, original_balance: n }), a.original_balance = n, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
877
+ const { debts: n } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [o, i] = g.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
878
+ await r({ ...a.account, original_balance: o }), a.original_balance = o, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
876
879
  }, d = () => {
877
880
  setTimeout(() => {
878
881
  i(a.original_balance ?? 0);
@@ -882,52 +885,52 @@ const xe = ({
882
885
  J,
883
886
  {
884
887
  isSaveDisabled: p,
885
- label: o.details_original_balance,
888
+ label: n.details_original_balance,
886
889
  onCancel: d,
887
890
  onSave: c,
888
- primaryText: o.details_original_balance,
891
+ primaryText: n.details_original_balance,
889
892
  secondaryText: k(a.original_balance, "0,0"),
890
- zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
893
+ zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
891
894
  children: /* @__PURE__ */ e(
892
895
  ae,
893
896
  {
894
- amount: n,
897
+ amount: o,
895
898
  autoFocus: !0,
896
899
  error: p,
897
900
  fullWidth: !0,
898
901
  minAmount: 0,
899
- setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
902
+ setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
900
903
  sx: { ".MuiTypography-Body": { p: 0 } }
901
904
  }
902
905
  )
903
906
  }
904
907
  );
905
908
  }), ft = () => {
906
- const { onEvent: a } = F(), { selectedDebtChartData: o } = $();
907
- return x.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
908
- o?.goal && /* @__PURE__ */ s(H, { children: [
909
- /* @__PURE__ */ e(Ge, { goal: o.goal }),
909
+ const { onEvent: a } = F(), { selectedDebtChartData: n } = $();
910
+ return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
911
+ n?.goal && /* @__PURE__ */ s(H, { children: [
912
+ /* @__PURE__ */ e(Ge, { goal: n.goal }),
910
913
  /* @__PURE__ */ e(j, {}),
911
- /* @__PURE__ */ e(je, { goal: o.goal }),
914
+ /* @__PURE__ */ e(je, { goal: n.goal }),
912
915
  /* @__PURE__ */ e(j, {}),
913
- /* @__PURE__ */ e(ze, { goal: o.goal }),
916
+ /* @__PURE__ */ e(ze, { goal: n.goal }),
914
917
  /* @__PURE__ */ e(j, {})
915
918
  ] }),
916
- !o?.goal && o?.account && /* @__PURE__ */ s(H, { children: [
917
- /* @__PURE__ */ e(_t, { debt: o }),
919
+ !n?.goal && n?.account && /* @__PURE__ */ s(H, { children: [
920
+ /* @__PURE__ */ e(_t, { debt: n }),
918
921
  /* @__PURE__ */ e(j, {}),
919
- /* @__PURE__ */ e(bt, { debt: o }),
922
+ /* @__PURE__ */ e(bt, { debt: n }),
920
923
  /* @__PURE__ */ e(j, {}),
921
- /* @__PURE__ */ e(yt, { debt: o }),
924
+ /* @__PURE__ */ e(yt, { debt: n }),
922
925
  /* @__PURE__ */ e(j, {})
923
926
  ] })
924
927
  ] });
925
- }, gt = D(ft), xt = ({ setTabValue: a, sx: o }) => {
926
- const { debts: r } = S(), { showError: t, showCompleted: n } = $();
927
- return x.useEffect(() => {
928
+ }, xt = D(ft), gt = ({ setTabValue: a, sx: n }) => {
929
+ const { debts: r } = S(), { showError: t, showCompleted: o } = $();
930
+ return g.useEffect(() => {
928
931
  t && a(1);
929
- }, [t]), !t && !n ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
930
- /* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
932
+ }, [t]), !t && !o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
933
+ /* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
931
934
  pe,
932
935
  {
933
936
  icon: t ? /* @__PURE__ */ e(Ve, { filled: !0 }) : /* @__PURE__ */ e(ye, { color: "success", filled: !0 }),
@@ -948,7 +951,7 @@ const xe = ({
948
951
  ]
949
952
  }
950
953
  ) }),
951
- t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
954
+ t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
952
955
  pe,
953
956
  {
954
957
  icon: /* @__PURE__ */ e(H, {}),
@@ -967,16 +970,16 @@ const xe = ({
967
970
  }
968
971
  ) })
969
972
  ] });
970
- }, wt = D(xt), Ct = () => {
971
- const { debts: a } = S(), { showError: o, showCompleted: r } = $(), [t, n] = x.useState(0);
973
+ }, wt = D(gt), Ct = () => {
974
+ const { debts: a } = S(), { showError: n, showCompleted: r } = $(), [t, o] = g.useState(0);
972
975
  return /* @__PURE__ */ s(H, { children: [
973
- (o || r) && /* @__PURE__ */ e(wt, { setTabValue: n, sx: { mt: -24 } }),
976
+ (n || r) && /* @__PURE__ */ e(wt, { setTabValue: o, sx: { mt: -24 } }),
974
977
  /* @__PURE__ */ s(
975
978
  We,
976
979
  {
977
980
  "aria-label": a.details_tabs_aria_label,
978
981
  centered: !0,
979
- onChange: (i, p) => n(p),
982
+ onChange: (i, p) => o(p),
980
983
  textColor: "primary",
981
984
  value: t,
982
985
  variant: "fullWidth",
@@ -1001,16 +1004,16 @@ const xe = ({
1001
1004
  }
1002
1005
  ),
1003
1006
  /* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ut, {}) }),
1004
- /* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(gt, {}) })
1007
+ /* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(xt, {}) })
1005
1008
  ] });
1006
- }, St = D(Ct), vt = ({ isOpen: a, onClose: o }) => {
1007
- const { debts: r } = S(), { showError: t, showCompleted: n } = $(), i = t || n ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ e(mt, {});
1009
+ }, St = D(Ct), vt = ({ isOpen: a, onClose: n }) => {
1010
+ const { debts: r } = S(), { showError: t, showCompleted: o } = $(), i = t || o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ e(mt, {});
1008
1011
  return /* @__PURE__ */ e(
1009
1012
  te,
1010
1013
  {
1011
1014
  ariaLabelClose: r.details_close_aria,
1012
1015
  isOpen: a,
1013
- onClose: o,
1016
+ onClose: n,
1014
1017
  title: r.details_title,
1015
1018
  children: /* @__PURE__ */ s(w, { bgcolor: "background.default", children: [
1016
1019
  /* @__PURE__ */ e(ke, { customDetailsChart: i }),
@@ -1019,13 +1022,13 @@ const xe = ({
1019
1022
  }
1020
1023
  );
1021
1024
  }, Dt = D(() => {
1022
- const { debts: a } = S(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = F(), [n, i] = x.useState(o?.extra_payment ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
1023
- o && (await r({ ...o, extra_payment: n }), o.extra_payment = n, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1024
- user_guid: o?.user_guid
1025
+ const { debts: a } = S(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = F(), [o, i] = g.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
1026
+ n && (await r({ ...n, extra_payment: o }), n.extra_payment = o, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1027
+ user_guid: n?.user_guid
1025
1028
  }));
1026
1029
  }, d = () => {
1027
1030
  setTimeout(() => {
1028
- i(o?.extra_payment ?? 0);
1031
+ i(n?.extra_payment ?? 0);
1029
1032
  }, 250);
1030
1033
  };
1031
1034
  return /* @__PURE__ */ e(
@@ -1036,29 +1039,29 @@ const xe = ({
1036
1039
  onCancel: d,
1037
1040
  onSave: c,
1038
1041
  primaryText: a.paydown_drawer_extra_payment,
1039
- secondaryText: k(o?.extra_payment, "0,0"),
1040
- zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
1042
+ secondaryText: k(n?.extra_payment, "0,0"),
1043
+ zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
1041
1044
  children: /* @__PURE__ */ e(
1042
1045
  ae,
1043
1046
  {
1044
- amount: n,
1047
+ amount: o,
1045
1048
  autoFocus: !0,
1046
1049
  error: p,
1047
1050
  fullWidth: !0,
1048
1051
  minAmount: 0,
1049
- setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
1052
+ setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
1050
1053
  sx: { ".MuiTypography-Body": { p: 0 } }
1051
1054
  }
1052
1055
  )
1053
1056
  }
1054
1057
  );
1055
1058
  }), Tt = () => {
1056
- const { debts: a } = S(), { totalMonthlyPayments: o } = q(), { monthlyCashFlowProfile: r } = V(), t = o + Number(r?.extra_payment);
1059
+ const { debts: a } = S(), { totalMonthlyPayments: n } = q(), { monthlyCashFlowProfile: r } = V(), t = n + Number(r?.extra_payment);
1057
1060
  return /* @__PURE__ */ s(w, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1058
1061
  /* @__PURE__ */ s(w, { p: 24, children: [
1059
1062
  /* @__PURE__ */ s(w, { alignItems: "center", gap: 4, mb: 24, children: [
1060
1063
  /* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
1061
- /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: k(o, "0,0") }),
1064
+ /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: k(n, "0,0") }),
1062
1065
  /* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
1063
1066
  ] }),
1064
1067
  /* @__PURE__ */ s(w, { children: [
@@ -1072,38 +1075,38 @@ const xe = ({
1072
1075
  /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: k(t, "0,0") })
1073
1076
  ] }) })
1074
1077
  ] });
1075
- }, At = D(Tt), Et = ({ isOpen: a, onClose: o }) => {
1078
+ }, At = D(Tt), Et = ({ isOpen: a, onClose: n }) => {
1076
1079
  const { debts: r } = S();
1077
1080
  return /* @__PURE__ */ e(
1078
1081
  te,
1079
1082
  {
1080
1083
  ariaLabelClose: r.paydown_drawer_close_aria,
1081
1084
  isOpen: a,
1082
- onClose: o,
1085
+ onClose: n,
1083
1086
  title: r.paydown_drawer_title,
1084
1087
  children: /* @__PURE__ */ e(At, {})
1085
1088
  }
1086
1089
  );
1087
1090
  };
1088
- function It(a, o) {
1091
+ function It(a, n) {
1089
1092
  const r = (t) => {
1090
1093
  if (typeof t == "number") return t;
1091
1094
  if (t === "!" || t === "✓") return 1 / 0;
1092
1095
  throw new Error("Unsupported value");
1093
1096
  };
1094
- return r(a) - r(o);
1097
+ return r(a) - r(n);
1095
1098
  }
1096
1099
  function Bt(a) {
1097
1100
  return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
1098
1101
  }
1099
1102
  const Mt = (a) => {
1100
- const o = {
1103
+ const n = {
1101
1104
  text: "#121417",
1102
1105
  background: "#FFB252"
1103
1106
  };
1104
- return a === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), a === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
1107
+ return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
1105
1108
  }, Pt = (a) => {
1106
- const o = String(a.formattedValue), r = Mt(o);
1109
+ const n = String(a.formattedValue), r = Mt(n);
1107
1110
  return /* @__PURE__ */ e(
1108
1111
  re,
1109
1112
  {
@@ -1118,32 +1121,32 @@ const Mt = (a) => {
1118
1121
  backgroundColor: r.background,
1119
1122
  marginLeft: "10px"
1120
1123
  },
1121
- children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: o })
1124
+ children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: n })
1122
1125
  }
1123
1126
  );
1124
1127
  }, kt = (a) => {
1125
- const o = a.row.account, r = Ke[o.account_type];
1128
+ const n = a.row.account, r = Ke[n.account_type];
1126
1129
  return /* @__PURE__ */ s(w, { alignItems: "center", flexDirection: "row", children: [
1127
1130
  /* @__PURE__ */ e(
1128
1131
  De,
1129
1132
  {
1130
- alt: `${o.institutionName}`,
1131
- institutionGuid: o.institution_guid || ""
1133
+ alt: `${n.institutionName}`,
1134
+ institutionGuid: n.institution_guid || ""
1132
1135
  }
1133
1136
  ),
1134
1137
  /* @__PURE__ */ s(w, { ml: 12, children: [
1135
- /* @__PURE__ */ e(l, { variant: "Small", children: o.name }),
1138
+ /* @__PURE__ */ e(l, { variant: "Small", children: n.name }),
1136
1139
  /* @__PURE__ */ e(l, { variant: "XSmall", children: r })
1137
1140
  ] })
1138
1141
  ] });
1139
1142
  }, Nt = ({
1140
1143
  sx: a = {},
1141
- debts: o,
1144
+ debts: n,
1142
1145
  hoveredDebtGuid: r,
1143
1146
  onHoverRow: t,
1144
- onClickRow: n
1147
+ onClickRow: o
1145
1148
  }) => {
1146
- const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, b] = x.useState([
1149
+ const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, b] = g.useState([
1147
1150
  { field: "priority", sort: "asc" }
1148
1151
  ]), f = [
1149
1152
  {
@@ -1238,12 +1241,12 @@ const Mt = (a) => {
1238
1241
  headerAlign: "right",
1239
1242
  width: 20
1240
1243
  }
1241
- ], v = x.useMemo(() => o.map((y, N) => ({
1244
+ ], v = g.useMemo(() => n.map((y, N) => ({
1242
1245
  ...y,
1243
1246
  id: N,
1244
1247
  priority: Bt(y)
1245
- })), [o]), M = (y) => {
1246
- const g = y.target.closest("[data-id]")?.getAttribute("data-id"), A = o[Number(g)];
1248
+ })), [n]), M = (y) => {
1249
+ const x = y.target.closest("[data-id]")?.getAttribute("data-id"), A = n[Number(x)];
1247
1250
  t?.(A?.guid ?? "");
1248
1251
  }, I = (y) => {
1249
1252
  c || M(y);
@@ -1270,7 +1273,7 @@ const Mt = (a) => {
1270
1273
  hideFooter: !0,
1271
1274
  initialState: { sorting: { sortModel: m } },
1272
1275
  onRowClick: (y) => {
1273
- n(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
1276
+ o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
1274
1277
  },
1275
1278
  onSortModelChange: (y) => {
1276
1279
  b(y), p(T.DEBTS_CLICK_TABLE_SORT);
@@ -1297,9 +1300,9 @@ const Mt = (a) => {
1297
1300
  )
1298
1301
  }
1299
1302
  );
1300
- }, Ft = ({ buttonText: a, isOpen: o, onClick: r }) => {
1301
- const { isDesktop: t, isTablet: n } = Y(), i = o ? "unfold_less" : "unfold_more";
1302
- return t || n ? /* @__PURE__ */ e(
1303
+ }, Ft = ({ buttonText: a, isOpen: n, onClick: r }) => {
1304
+ const { isDesktop: t, isTablet: o } = Y(), i = n ? "unfold_less" : "unfold_more";
1305
+ return t || o ? /* @__PURE__ */ e(
1303
1306
  fe,
1304
1307
  {
1305
1308
  "aria-controls": "prioritize-debts",
@@ -1322,8 +1325,8 @@ const Mt = (a) => {
1322
1325
  children: /* @__PURE__ */ e(ee, { name: i })
1323
1326
  }
1324
1327
  );
1325
- }, Rt = D(({ buttonEl: a, onClose: o }) => {
1326
- const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = $(), p = !!a, c = [
1328
+ }, Rt = D(({ buttonEl: a, onClose: n }) => {
1329
+ const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = $(), p = !!a, c = [
1327
1330
  {
1328
1331
  priority: P.FASTEST_PAYOFF_FIRST,
1329
1332
  text: t.priority_sort_fastest_payoff
@@ -1352,7 +1355,7 @@ const Mt = (a) => {
1352
1355
  horizontal: "left"
1353
1356
  },
1354
1357
  id: "prioritize-debts",
1355
- onClose: o,
1358
+ onClose: n,
1356
1359
  open: p,
1357
1360
  transformOrigin: {
1358
1361
  vertical: "top",
@@ -1363,8 +1366,8 @@ const Mt = (a) => {
1363
1366
  {
1364
1367
  onClick: () => d(m),
1365
1368
  sx: {
1366
- bgcolor: n === m ? "primary.main" : void 0,
1367
- color: n === m ? "#fff" : void 0,
1369
+ bgcolor: o === m ? "primary.main" : void 0,
1370
+ color: o === m ? "#fff" : void 0,
1368
1371
  justifyContent: "space-between",
1369
1372
  minHeight: 44,
1370
1373
  minWidth: 268,
@@ -1378,7 +1381,7 @@ const Mt = (a) => {
1378
1381
  },
1379
1382
  children: [
1380
1383
  /* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: b }),
1381
- n === m && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
1384
+ o === m && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
1382
1385
  ]
1383
1386
  },
1384
1387
  m
@@ -1386,30 +1389,30 @@ const Mt = (a) => {
1386
1389
  }
1387
1390
  );
1388
1391
  }), Lt = D(() => {
1389
- const { onEvent: a } = F(), { debts: o } = S(), { selectedDebtPriority: r } = $(), [t, n] = x.useState(null), i = (m) => {
1390
- n(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1392
+ const { onEvent: a } = F(), { debts: n } = S(), { selectedDebtPriority: r } = $(), [t, o] = g.useState(null), i = (m) => {
1393
+ o(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1391
1394
  }, p = () => {
1392
- n(null);
1393
- }, c = !!t, d = x.useMemo(() => ({
1394
- [P.FASTEST_PAYOFF_FIRST]: o.priority_sort_fastest_payoff,
1395
- [P.HIGHEST_INTEREST]: o.priority_sort_highest_interest,
1396
- [P.HIGHEST_BALANCE]: o.priority_sort_highest_balance,
1397
- [P.LOWEST_BALANCE]: o.priority_sort_lowest_balance
1398
- })[r] ?? o.priority_sort_lowest_balance, [r]);
1395
+ o(null);
1396
+ }, c = !!t, d = g.useMemo(() => ({
1397
+ [P.FASTEST_PAYOFF_FIRST]: n.priority_sort_fastest_payoff,
1398
+ [P.HIGHEST_INTEREST]: n.priority_sort_highest_interest,
1399
+ [P.HIGHEST_BALANCE]: n.priority_sort_highest_balance,
1400
+ [P.LOWEST_BALANCE]: n.priority_sort_lowest_balance
1401
+ })[r] ?? n.priority_sort_lowest_balance, [r]);
1399
1402
  return /* @__PURE__ */ s(_, { children: [
1400
1403
  /* @__PURE__ */ e(Ft, { buttonText: d, isOpen: c, onClick: i }),
1401
1404
  /* @__PURE__ */ e(Rt, { buttonEl: t, onClose: p })
1402
1405
  ] });
1403
- }), $t = (a, o, r = 0) => {
1406
+ }), $t = (a, n, r = 0) => {
1404
1407
  const t = a.map((d) => ({ ...d }));
1405
- ge(t, o);
1406
- const n = /* @__PURE__ */ new Date(), i = [];
1408
+ xe(t, n);
1409
+ const o = /* @__PURE__ */ new Date(), i = [];
1407
1410
  let p = 0, c = 1;
1408
1411
  for (const d of t)
1409
1412
  i.push({
1410
1413
  ...d,
1411
1414
  // Start with the initial balance
1412
- dataset: [{ x: new Date(n), y: d.balance }]
1415
+ dataset: [{ x: new Date(o), y: d.balance }]
1413
1416
  });
1414
1417
  for (; t.some((d) => d.balance >= 0.01 && !d.is_impossible); ) {
1415
1418
  let d = !1, m = !1, b = !1;
@@ -1420,17 +1423,17 @@ const Mt = (a) => {
1420
1423
  !b && r > 0 && (y += r, b = !0), !m && p > 0 && (N = p, m = !0), u.balance += C;
1421
1424
  const h = Math.min(u.balance, y + N);
1422
1425
  if (h <= C) {
1423
- u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, v.push({ x: new Date(n), y: u.balance });
1426
+ u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, v.push({ x: new Date(o), y: u.balance });
1424
1427
  continue;
1425
1428
  }
1426
1429
  u.balance -= h, u.balance = u.balance < 0.01 ? 0 : u.balance, v.push({
1427
- x: new Date(n),
1430
+ x: new Date(o),
1428
1431
  y: Math.max(0, u.balance),
1429
1432
  payment: h,
1430
1433
  extra: N
1431
- }), u.balance <= 0 && (p += B, i[f].projected_payoff_date = new Date(n)), h > 0 && (d = !0);
1434
+ }), u.balance <= 0 && (p += B, i[f].projected_payoff_date = new Date(o)), h > 0 && (d = !0);
1432
1435
  }
1433
- d && n.setMonth(n.getMonth() + 1);
1436
+ d && o.setMonth(o.getMonth() + 1);
1434
1437
  }
1435
1438
  return i.forEach((d) => {
1436
1439
  (d.interest_rate === void 0 || d.monthly_payment === void 0) && (d.projected_payoff_date = void 0);
@@ -1438,7 +1441,7 @@ const Mt = (a) => {
1438
1441
  d.priority = !d.is_paid_off && !d.is_impossible ? c++ : void 0;
1439
1442
  }), i;
1440
1443
  }, Ht = D(({ onClick: a }) => {
1441
- const { debts: o } = S(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: n } = V(), i = t + Number(n?.extra_payment), p = r ? o.paydown_button_long : o.paydown_button_short;
1444
+ const { debts: n } = S(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: o } = V(), i = t + Number(o?.extra_payment), p = r ? n.paydown_button_long : n.paydown_button_short;
1442
1445
  return /* @__PURE__ */ e(
1443
1446
  fe,
1444
1447
  {
@@ -1451,24 +1454,24 @@ const Mt = (a) => {
1451
1454
  children: E(p, k(i, "0,0"))
1452
1455
  }
1453
1456
  );
1454
- }), Ot = ({ onBackClick: a, sx: o }) => {
1455
- const [r, t] = x.useState(!1), [n, i] = x.useState(!1), [p, c] = x.useState(!1), [d, m] = x.useState(""), { isDesktop: b, isMobile: f } = Y(), { debts: u } = S(), { onEvent: v } = F(), { isCopyLoaded: M, isInitialized: I, setSelectedAccounts: C } = Pe(), { setSelectedAccount: B } = Ne(), { selectedDebtPriority: y, setSelectedDebtChartData: N } = $(), { visibleDebtAccounts: h } = Z(), { goalsLoaded: g, loadGoals: A, monthlyCashFlowProfile: R } = V(), { debts: L } = q();
1457
+ }), Ot = ({ onBackClick: a, sx: n }) => {
1458
+ const [r, t] = g.useState(!1), [o, i] = g.useState(!1), [p, c] = g.useState(!1), [d, m] = g.useState(""), { isDesktop: b, isMobile: f } = Y(), { debts: u } = S(), { onEvent: v } = F(), { isCopyLoaded: M, isInitialized: I, setSelectedAccounts: C } = Pe(), { setSelectedAccount: B } = Ne(), { selectedDebtPriority: y, setSelectedDebtChartData: N } = $(), { visibleDebtAccounts: h } = Z(), { goalsLoaded: x, loadGoals: A, monthlyCashFlowProfile: R } = V(), { debts: L } = q();
1456
1459
  Je({
1457
1460
  widgetName: "DebtsWidget",
1458
- isLoaded: g
1461
+ isLoaded: x
1459
1462
  });
1460
- const O = x.useMemo(() => {
1463
+ const O = g.useMemo(() => {
1461
1464
  const W = R?.extra_payment ?? 0;
1462
1465
  return $t(L, y, W);
1463
1466
  }, [L, y, R]);
1464
- x.useEffect(() => {
1467
+ g.useEffect(() => {
1465
1468
  C(h), v(T.DEBTS_VIEW);
1466
- }, []), x.useEffect(() => {
1469
+ }, []), g.useEffect(() => {
1467
1470
  C(h);
1468
- }, [h]), x.useEffect(() => {
1471
+ }, [h]), g.useEffect(() => {
1469
1472
  I && A().finally();
1470
1473
  }, [I]);
1471
- const oe = (W) => m(W), ne = () => {
1474
+ const ne = (W) => m(W), oe = () => {
1472
1475
  const W = h.find((Q) => Q.guid === d), ie = O.find((Q) => Q.guid === d);
1473
1476
  W && B(W), ie && N(ie), t(!0);
1474
1477
  }, we = () => v(T.DEBTS_CLICK_FILTER), Ce = () => {
@@ -1476,7 +1479,7 @@ const Mt = (a) => {
1476
1479
  }, Se = () => {
1477
1480
  i(!0), v(T.DEBTS_CLICK_PAYDOWN);
1478
1481
  };
1479
- return !g || !M || !I ? /* @__PURE__ */ e(Qe, {}) : /* @__PURE__ */ s(
1482
+ return !x || !M || !I ? /* @__PURE__ */ e(Qe, {}) : /* @__PURE__ */ s(
1480
1483
  Oe,
1481
1484
  {
1482
1485
  accountOptions: h,
@@ -1486,7 +1489,7 @@ const Mt = (a) => {
1486
1489
  ],
1487
1490
  onAccountsFilterClick: we,
1488
1491
  onBackClick: a,
1489
- sx: o,
1492
+ sx: n,
1490
1493
  title: u.title,
1491
1494
  children: [
1492
1495
  /* @__PURE__ */ s(w, { sx: { px: b ? "48px" : "24px" }, children: [
@@ -1500,13 +1503,13 @@ const Mt = (a) => {
1500
1503
  },
1501
1504
  children: [
1502
1505
  /* @__PURE__ */ e(
1503
- xe,
1506
+ ge,
1504
1507
  {
1505
1508
  debts: O,
1506
1509
  height: f ? 250 : void 0,
1507
1510
  hoveredDebtGuid: d,
1508
- onClickArea: ne,
1509
- onHoverArea: oe,
1511
+ onClickArea: oe,
1512
+ onHoverArea: ne,
1510
1513
  sx: { mr: f ? "4px" : "-48px" }
1511
1514
  }
1512
1515
  ),
@@ -1526,8 +1529,8 @@ const Mt = (a) => {
1526
1529
  {
1527
1530
  debts: O,
1528
1531
  hoveredDebtGuid: d,
1529
- onClickRow: ne,
1530
- onHoverRow: oe
1532
+ onClickRow: oe,
1533
+ onHoverRow: ne
1531
1534
  }
1532
1535
  ) })
1533
1536
  ] }),
@@ -1539,13 +1542,13 @@ const Mt = (a) => {
1539
1542
  }
1540
1543
  ),
1541
1544
  /* @__PURE__ */ e(vt, { isOpen: r, onClose: () => t(!1) }),
1542
- /* @__PURE__ */ e(Et, { isOpen: n, onClose: () => i(!1) })
1545
+ /* @__PURE__ */ e(Et, { isOpen: o, onClose: () => i(!1) })
1543
1546
  ]
1544
1547
  }
1545
1548
  );
1546
1549
  }, Nr = D(Ot);
1547
1550
  export {
1548
- xe as DebtsChart,
1551
+ ge as DebtsChart,
1549
1552
  Lr as DebtsStore,
1550
1553
  Nt as DebtsTable,
1551
1554
  Nr as DebtsWidget