@mx-cartographer/experiences 7.0.39 → 7.0.41

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.
@@ -17,7 +17,7 @@ import be from "@mui/material/Unstable_Grid2";
17
17
  import oe from "@mui/material/Avatar";
18
18
  import ze from "@mui/material/CardHeader";
19
19
  import { Payments as Se, NoteStack as Re, Person as Ee, ChevronRight as M, DragHandle as He, CheckCircle as $e, Icon as ge, ExpandLess as Xe, ExpandMore as Ue, AddBox as ve, Trophy as Ye } from "@mxenabled/mx-icons";
20
- import { u as T, k as x, c as V, o as xe, f as Ie, a as Ge } from "../hooks-BAAimqdq.mjs";
20
+ import { u as T, k as I, c as V, o as xe, f as Ie, a as Ge } from "../hooks-BAAimqdq.mjs";
21
21
  import { u as he } from "../useScreenSize-B6JyS_Lj.mjs";
22
22
  import { f as v } from "../NumberFormatting-CtWHhyBX.mjs";
23
23
  import { S as Ze } from "../StatusBar-BK_uYHAB.mjs";
@@ -32,16 +32,16 @@ import w from "@mui/material/ListItemText";
32
32
  import { DataGridPro as qe } from "@mui/x-data-grid-pro";
33
33
  import { D as j } from "../Drawer-kEE73B87.mjs";
34
34
  import { b as B } from "../Localization-2MODESHW.mjs";
35
- import { f as ae, D as re, a as Je } from "../Dialog-CWW597AF.mjs";
35
+ import { f as re, D as ae, a as Je } from "../Dialog-CWW597AF.mjs";
36
36
  import P from "@mui/material/ListItemAvatar";
37
37
  import Qe from "@mui/material/Collapse";
38
38
  import et from "@mui/material/ListItemIcon";
39
39
  import tt from "@mui/material/Checkbox";
40
40
  import { A as fe } from "../ConnectDrawer-L1_xPNYt.mjs";
41
41
  import { u as nt, A as ot } from "../AccountDetailsHeader-Bt8O2raZ.mjs";
42
- import { A as at } from "../AccountDetailsContent-B5HMpGeJ.mjs";
42
+ import { A as rt } from "../AccountDetailsContent-B5HMpGeJ.mjs";
43
43
  import ke from "@mui/material/TextField";
44
- import { M as rt, I as it, O as st } from "../OriginalBalanceAction-DSA8sk5b.mjs";
44
+ import { M as at, I as it, O as st } from "../OriginalBalanceAction-DSA8sk5b.mjs";
45
45
  import { getUnixTime as lt } from "date-fns/getUnixTime";
46
46
  import { isValid as ct } from "date-fns/isValid";
47
47
  import { AdapterDateFns as dt } from "@mui/x-date-pickers/AdapterDateFnsV3";
@@ -66,13 +66,13 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
66
66
  "$1$2$3"
67
67
  ) : v(t, "0,0.00"), Ke = K(
68
68
  ({ goal: t, isInDrawer: n = !1, onClick: s }) => {
69
- const { goals: l } = T(), { isMobile: u, isTablet: a } = he(), _ = u || a, {
69
+ const { goals: l } = T(), { isMobile: u, isTablet: r } = he(), _ = u || r, {
70
70
  backgroundColor: b,
71
71
  color: c,
72
72
  percentage: h,
73
73
  percentageText: o,
74
74
  projectedText: p
75
- } = _e(l, t), r = t.track_type === m.DEBT_TRACK ? t.initial_amount : t.amount, d = [
75
+ } = _e(l, t), a = t.track_type === m.DEBT_TRACK ? t.initial_amount : t.amount, d = [
76
76
  {
77
77
  color: b,
78
78
  percentage: `${h}`
@@ -85,7 +85,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
85
85
  {
86
86
  avatar: /* @__PURE__ */ e(oe, { sx: { bgcolor: b, color: c, height: 48, width: 48 }, variant: "rounded", children: f }),
87
87
  subheader: /* @__PURE__ */ e(A, { variant: n || _ ? "H3" : "H2", children: `${v(t.current_amount, _ ? "0,0" : "0,0.00")} / ${At(
88
- r,
88
+ a,
89
89
  _
90
90
  )}` }),
91
91
  title: /* @__PURE__ */ e(ue, { color: "text.secondary", fontWeight: 400, variant: "Body", children: t.name })
@@ -101,10 +101,10 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
101
101
  ] }) });
102
102
  }
103
103
  ), Tt = K(({ trackType: t }) => {
104
- const { goals: n } = T(), { setAlert: s, monthlyCashFlowProfile: l, updateMonthlyCashFlowProfile: u } = x(), a = y.useMemo(() => {
104
+ const { goals: n } = T(), { setAlert: s, monthlyCashFlowProfile: l, updateMonthlyCashFlowProfile: u } = I(), r = y.useMemo(() => {
105
105
  let h = 0;
106
106
  return t === m.SAVINGS_TRACK ? h = l?.amount_allocated_for_savings_goals || 0 : t === m.DEBT_TRACK ? h = l?.amount_allocated_for_debt_goals || 0 : t === m.RETIREMENT_TRACK && (h = l?.amount_allocated_for_retirement_goals || 0), h;
107
- }, [l]), [_, b] = y.useState(a), c = async () => {
107
+ }, [l]), [_, b] = y.useState(r), c = async () => {
108
108
  if (l) {
109
109
  const h = { ...l };
110
110
  t === m.SAVINGS_TRACK ? h.amount_allocated_for_savings_goals = _ : t === m.DEBT_TRACK ? h.amount_allocated_for_debt_goals = _ : t === m.RETIREMENT_TRACK && (h.amount_allocated_for_retirement_goals = _), await u(h), s(n.alert_contribution_updated);
@@ -115,10 +115,10 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
115
115
  {
116
116
  isSaveDisabled: !_ || isNaN(_),
117
117
  label: n.contribution_label,
118
- onCancel: () => b(a),
118
+ onCancel: () => b(r),
119
119
  onSave: c,
120
120
  primaryText: n.contribution_label,
121
- secondaryText: v(a, "0,0.00"),
121
+ secondaryText: v(r, "0,0.00"),
122
122
  children: /* @__PURE__ */ e(
123
123
  Ne,
124
124
  {
@@ -134,10 +134,10 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
134
134
  }
135
135
  ) });
136
136
  }), Ct = ({ goals: t }) => {
137
- const { goals: n, common: s } = T(), { reorderGoals: l, setAlert: u } = x(), [a, _] = y.useState(!1), [b, c] = y.useState(t.map((d) => ({ ...d })));
137
+ const { goals: n, common: s } = T(), { reorderGoals: l, setAlert: u } = I(), [r, _] = y.useState(!1), [b, c] = y.useState(t.map((d) => ({ ...d })));
138
138
  y.useEffect(() => {
139
- a && c(t.map((d) => ({ ...d })));
140
- }, [a]);
139
+ r && c(t.map((d) => ({ ...d })));
140
+ }, [r]);
141
141
  const h = [
142
142
  {
143
143
  field: "name",
@@ -148,9 +148,9 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
148
148
  /* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: f.name }),
149
149
  /* @__PURE__ */ e(A, { variant: "XSmall", children: B(
150
150
  n.goal_projection,
151
- ae(
151
+ re(
152
152
  Q(f.projected_to_complete_at || 0),
153
- re.MONTH_SHORT_YEAR
153
+ ae.MONTH_SHORT_YEAR
154
154
  )
155
155
  ) })
156
156
  ] });
@@ -178,7 +178,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
178
178
  for (let C = 0; C < E.length; C += 1)
179
179
  E[C].position = C + 1;
180
180
  c(E);
181
- }, r = async () => {
181
+ }, a = async () => {
182
182
  await l(b), u(n.alert_goals_reordered), _(!1);
183
183
  };
184
184
  return /* @__PURE__ */ i(g, { children: [
@@ -199,9 +199,9 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
199
199
  j,
200
200
  {
201
201
  ariaLabelClose: s.close_aria,
202
- isOpen: a,
202
+ isOpen: r,
203
203
  onClose: () => _(!1),
204
- onPrimaryAction: r,
204
+ onPrimaryAction: a,
205
205
  title: n.reorder_goals_title,
206
206
  children: /* @__PURE__ */ i(g, { children: [
207
207
  /* @__PURE__ */ e(W, { sx: { my: 12, mx: 24 }, children: n.reorder_goals_description }),
@@ -251,9 +251,9 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
251
251
  /* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: t.name }),
252
252
  /* @__PURE__ */ e(A, { variant: "XSmall", children: t.is_complete ? u : B(
253
253
  s.goal_projection,
254
- ae(
254
+ re(
255
255
  Q(t.projected_to_complete_at || 0),
256
- re.MONTH_SHORT_YEAR
256
+ ae.MONTH_SHORT_YEAR
257
257
  )
258
258
  ) })
259
259
  ] }),
@@ -269,9 +269,9 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
269
269
  /* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: t.name }),
270
270
  /* @__PURE__ */ e(A, { variant: "XSmall", children: B(
271
271
  n.completed_label,
272
- ae(
272
+ re(
273
273
  Q(t.completed_at || 0),
274
- re.MONTH_SHORT_YEAR
274
+ ae.MONTH_SHORT_YEAR
275
275
  )
276
276
  ) })
277
277
  ] }),
@@ -279,13 +279,13 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
279
279
  ] }) })
280
280
  ] }) }, t.guid);
281
281
  }, Et = ({ trackType: t }) => {
282
- const { goals: n, common: s } = T(), { orderedGoals: l } = x(), u = l.filter((d) => d.track_type === t), a = u.filter(
282
+ const { goals: n, common: s } = T(), { orderedGoals: l } = I(), u = l.filter((d) => d.track_type === t), r = u.filter(
283
283
  (d) => d.track_type === m.SAVINGS_TRACK && !d.has_been_spent || d.track_type !== m.SAVINGS_TRACK && !d.is_complete
284
284
  ), _ = u.filter(
285
285
  (d) => d.track_type === m.SAVINGS_TRACK && d.has_been_spent || d.track_type !== m.SAVINGS_TRACK && d.is_complete
286
286
  ), [b, c] = y.useState(!1);
287
- let h = n.manage_saving_goals, o = n.manage_saving_drawer_title, p = n.manage_saving_title, r = n.manage_saving_description;
288
- return t === m.DEBT_TRACK ? (h = n.manage_debt_goals, o = n.manage_debt_drawer_title, p = n.manage_debt_title, r = n.manage_debt_description) : t === m.RETIREMENT_TRACK && (h = n.manage_retirement_goals, o = n.manage_retirement_drawer_title, p = n.manage_retirement_title, r = n.manage_retirement_description), /* @__PURE__ */ i(g, { children: [
287
+ let h = n.manage_saving_goals, o = n.manage_saving_drawer_title, p = n.manage_saving_title, a = n.manage_saving_description;
288
+ return t === m.DEBT_TRACK ? (h = n.manage_debt_goals, o = n.manage_debt_drawer_title, p = n.manage_debt_title, a = n.manage_debt_description) : t === m.RETIREMENT_TRACK && (h = n.manage_retirement_goals, o = n.manage_retirement_drawer_title, p = n.manage_retirement_title, a = n.manage_retirement_description), /* @__PURE__ */ i(g, { children: [
289
289
  /* @__PURE__ */ e(pe, { endIcon: /* @__PURE__ */ e(M, {}), onClick: () => c(!0), children: h }),
290
290
  /* @__PURE__ */ e(
291
291
  j,
@@ -297,13 +297,13 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
297
297
  children: /* @__PURE__ */ i(g, { children: [
298
298
  /* @__PURE__ */ i(g, { m: 24, children: [
299
299
  /* @__PURE__ */ e(je, { children: p }),
300
- /* @__PURE__ */ e(W, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "ParagraphSmall", children: r })
300
+ /* @__PURE__ */ e(W, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "ParagraphSmall", children: a })
301
301
  ] }),
302
302
  /* @__PURE__ */ e(Tt, { trackType: t }),
303
303
  /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "XSmall", children: n.goal_priority }),
304
304
  /* @__PURE__ */ i(L, { sx: { bgcolor: "background.paper" }, children: [
305
- a.map((d, f) => {
306
- const E = f >= a.length - 1;
305
+ r.map((d, f) => {
306
+ const E = f >= r.length - 1;
307
307
  return /* @__PURE__ */ i(g, { children: [
308
308
  /* @__PURE__ */ e(St, { goal: d, index: f }),
309
309
  /* @__PURE__ */ e(
@@ -315,14 +315,14 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
315
315
  ] }, `ongoing-${d.guid}`);
316
316
  }),
317
317
  t !== m.RETIREMENT_TRACK && /* @__PURE__ */ i(g, { children: [
318
- /* @__PURE__ */ e(Ct, { goals: a }),
318
+ /* @__PURE__ */ e(Ct, { goals: r }),
319
319
  /* @__PURE__ */ e(R, {})
320
320
  ] })
321
321
  ] }),
322
322
  t !== m.RETIREMENT_TRACK && _.length > 0 && /* @__PURE__ */ i(g, { children: [
323
323
  /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "XSmall", children: n.complete_title }),
324
324
  /* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: _.map((d, f) => {
325
- const E = f > a.length - 1;
325
+ const E = f > r.length - 1;
326
326
  return /* @__PURE__ */ i(g, { children: [
327
327
  /* @__PURE__ */ e(Rt, { goal: d }),
328
328
  /* @__PURE__ */ e(R, { variant: E ? "fullWidth" : "inset" })
@@ -334,7 +334,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
334
334
  )
335
335
  ] });
336
336
  }, de = K(({ trackType: t, onAddGoals: n }) => {
337
- const { isMobile: s } = he(), { goals: l } = T(), { orderedGoals: u, setSelectedGoal: a } = x(), _ = u.filter((o) => o.track_type === t), b = _.filter(
337
+ const { isMobile: s } = he(), { goals: l } = T(), { orderedGoals: u, setSelectedGoal: r } = I(), _ = u.filter((o) => o.track_type === t), b = _.filter(
338
338
  (o) => o.track_type === m.SAVINGS_TRACK && !o.has_been_spent || o.track_type !== m.SAVINGS_TRACK && !o.is_complete
339
339
  ), c = _.filter(
340
340
  (o) => o.track_type === m.SAVINGS_TRACK && o.has_been_spent || o.track_type !== m.SAVINGS_TRACK && o.is_complete
@@ -344,9 +344,9 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
344
344
  /* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children: l.ongoing_title }),
345
345
  /* @__PURE__ */ e(Et, { trackType: t })
346
346
  ] }),
347
- b.length > 0 ? /* @__PURE__ */ e(be, { container: !0, spacing: 24, children: b.map((o, p, r) => (
347
+ b.length > 0 ? /* @__PURE__ */ e(be, { container: !0, spacing: 24, children: b.map((o, p, a) => (
348
348
  // Goal should be full width in mobile or if it's the first goal (unless there are 2)
349
- /* @__PURE__ */ e(be, { xs: s || p === 0 && r.length !== 2 ? 12 : 6, children: /* @__PURE__ */ e(Ke, { goal: o, onClick: () => a(o) }, o.guid) }, p)
349
+ /* @__PURE__ */ e(be, { xs: s || p === 0 && a.length !== 2 ? 12 : 6, children: /* @__PURE__ */ e(Ke, { goal: o, onClick: () => r(o) }, o.guid) }, p)
350
350
  )) }) : /* @__PURE__ */ i(
351
351
  g,
352
352
  {
@@ -391,7 +391,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
391
391
  children: h
392
392
  }
393
393
  ) }),
394
- c.map((o) => /* @__PURE__ */ e(Ae, { elevation: 2, children: /* @__PURE__ */ e(Te, { onClick: () => a(o), children: /* @__PURE__ */ e(Ce, { sx: { ":last-child": { pb: 16 } }, children: /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
394
+ c.map((o) => /* @__PURE__ */ e(Ae, { elevation: 2, children: /* @__PURE__ */ e(Te, { onClick: () => r(o), children: /* @__PURE__ */ e(Ce, { sx: { ":last-child": { pb: 16 } }, children: /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
395
395
  /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", gap: 6, children: [
396
396
  /* @__PURE__ */ e(Fe, { color: "success", fill: !0, name: "check_circle", size: 20 }),
397
397
  /* @__PURE__ */ e(A, { color: "text.secondary", variant: "Body", children: o.name })
@@ -401,7 +401,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
401
401
  ] })
402
402
  ] });
403
403
  }), vt = ({ goalType: t, onClick: n }) => {
404
- const { goals: s } = T(), { bgcolor: l, icon: u, label: a, description: _, subTypes: b, type: c } = t, [h, o] = y.useState(!1), p = b.length > 0;
404
+ const { goals: s } = T(), { bgcolor: l, icon: u, label: r, description: _, subTypes: b, type: c } = t, [h, o] = y.useState(!1), p = b.length > 0;
405
405
  return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ i(L, { sx: { bgcolor: "background.paper" }, children: [
406
406
  /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(
407
407
  k,
@@ -413,19 +413,19 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
413
413
  ),
414
414
  children: [
415
415
  /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(oe, { sx: { bgcolor: l }, variant: "rounded", children: /* @__PURE__ */ e(ge, { name: u, sx: { color: "grey.900" } }) }) }),
416
- /* @__PURE__ */ e(w, { primary: a, secondary: _, sx: { mr: 24 } }),
416
+ /* @__PURE__ */ e(w, { primary: r, secondary: _, sx: { mr: 24 } }),
417
417
  !p && /* @__PURE__ */ e(M, {}),
418
418
  p && (h ? /* @__PURE__ */ e(Xe, {}) : /* @__PURE__ */ e(Ue, {}))
419
419
  ]
420
420
  }
421
421
  ) }),
422
422
  /* @__PURE__ */ e(R, { variant: "inset" }),
423
- p && /* @__PURE__ */ e(Qe, { in: h, children: /* @__PURE__ */ e(L, { sx: { bgcolor: "background.default" }, children: b.map((r, d) => /* @__PURE__ */ e(N, { sx: { pl: 48 }, children: /* @__PURE__ */ i(k, { onClick: () => n(r.label, r.metaType, c), children: [
424
- /* @__PURE__ */ e(et, { sx: { mr: 8 }, children: /* @__PURE__ */ e(ge, { name: r.icon }) }),
423
+ p && /* @__PURE__ */ e(Qe, { in: h, children: /* @__PURE__ */ e(L, { sx: { bgcolor: "background.default" }, children: b.map((a, d) => /* @__PURE__ */ e(N, { sx: { pl: 48 }, children: /* @__PURE__ */ i(k, { onClick: () => n(a.label, a.metaType, c), children: [
424
+ /* @__PURE__ */ e(et, { sx: { mr: 8 }, children: /* @__PURE__ */ e(ge, { name: a.icon }) }),
425
425
  /* @__PURE__ */ e(
426
426
  w,
427
427
  {
428
- primary: r.label,
428
+ primary: a.label,
429
429
  primaryTypographyProps: { variant: "Body" }
430
430
  }
431
431
  ),
@@ -439,9 +439,9 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
439
439
  onSave: l,
440
440
  title: u
441
441
  }) => {
442
- const { goals: a, common: _ } = T(), [b, c] = y.useState([]), h = (o) => {
443
- const p = b.findIndex((d) => d.guid === o.guid), r = [...b];
444
- p >= 0 ? r.splice(p, 1) : r.push(o), c(r);
442
+ const { goals: r, common: _ } = T(), [b, c] = y.useState([]), h = (o) => {
443
+ const p = b.findIndex((d) => d.guid === o.guid), a = [...b];
444
+ p >= 0 ? a.splice(p, 1) : a.push(o), c(a);
445
445
  };
446
446
  return /* @__PURE__ */ i(
447
447
  j,
@@ -452,7 +452,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
452
452
  onPrimaryAction: () => l(b),
453
453
  title: u,
454
454
  children: [
455
- /* @__PURE__ */ e(W, { color: "text.secondary", sx: { mx: 24, my: 12 }, children: a.select_debt_accounts_description }),
455
+ /* @__PURE__ */ e(W, { color: "text.secondary", sx: { mx: 24, my: 12 }, children: r.select_debt_accounts_description }),
456
456
  /* @__PURE__ */ i(L, { sx: { bgcolor: "background.white" }, children: [
457
457
  /* @__PURE__ */ e(R, { variant: "fullWidth" }),
458
458
  t.map((o, p) => /* @__PURE__ */ i(y.Fragment, { children: [
@@ -471,7 +471,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
471
471
  secondary: v(o.balance || 0, "0,0.00")
472
472
  }
473
473
  ),
474
- /* @__PURE__ */ e(tt, { checked: b.some((r) => r.guid === o.guid) })
474
+ /* @__PURE__ */ e(tt, { checked: b.some((a) => a.guid === o.guid) })
475
475
  ] }) }),
476
476
  /* @__PURE__ */ e(R, { variant: p < t.length - 1 ? "inset" : "fullWidth" })
477
477
  ] }, o.guid))
@@ -479,27 +479,27 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
479
479
  /* @__PURE__ */ e(
480
480
  ye,
481
481
  {
482
- description: a.connect_description,
483
- label: a.connect_button,
484
- title: a.connect_title
482
+ description: r.connect_description,
483
+ label: r.connect_button,
484
+ title: r.connect_title
485
485
  }
486
486
  )
487
487
  ]
488
488
  }
489
489
  );
490
490
  }, xt = ({ onClose: t }) => {
491
- const { goals: n } = T(), { addGoal: s, debtGoals: l, setAlert: u, setSelectedGoal: a } = x(), { visibleDebtAccounts: _ } = V(), [b, c] = y.useState(!1), h = Oe(n), o = (r, d, f) => {
492
- f === m.DEBT_TRACK ? c(!0) : a({
491
+ const { goals: n } = T(), { addGoal: s, debtGoals: l, setAlert: u, setSelectedGoal: r } = I(), { visibleDebtAccounts: _ } = V(), [b, c] = y.useState(!1), h = Oe(n), o = (a, d, f) => {
492
+ f === m.DEBT_TRACK ? c(!0) : r({
493
493
  amount: 0,
494
494
  current_amount: 0,
495
495
  goal_type: me.SAVE_AMOUNT,
496
496
  initial_amount: 0,
497
497
  meta_type: d,
498
- name: r,
498
+ name: a,
499
499
  track_type: f
500
500
  });
501
- }, p = async (r) => {
502
- for (const d of r) {
501
+ }, p = async (a) => {
502
+ for (const d of a) {
503
503
  let f = J.CREDIT_CARD;
504
504
  d.account_type === fe.LOAN ? f = J.LOANS : d.account_type === fe.LINE_OF_CREDIT && (f = J.LINE_OF_CREDIT), await s({
505
505
  account_guid: d.guid,
@@ -517,11 +517,11 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
517
517
  c(!1), t?.(m.DEBT_TRACK);
518
518
  };
519
519
  return /* @__PURE__ */ i(g, { children: [
520
- /* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: h.map((r, d) => /* @__PURE__ */ e(vt, { goalType: r, onClick: o }, d)) }),
520
+ /* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: h.map((a, d) => /* @__PURE__ */ e(vt, { goalType: a, onClick: o }, d)) }),
521
521
  /* @__PURE__ */ e(
522
522
  De,
523
523
  {
524
- accounts: _.filter((r) => !l.find((d) => d.account_guid === r.guid)),
524
+ accounts: _.filter((a) => !l.find((d) => d.account_guid === a.guid)),
525
525
  isOpen: b,
526
526
  onClose: () => c(!1),
527
527
  onSave: p,
@@ -553,13 +553,13 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
553
553
  ] }),
554
554
  /* @__PURE__ */ e(j, { isOpen: l, onClose: () => u(!1), title: n.account_details, children: /* @__PURE__ */ i(g, { children: [
555
555
  /* @__PURE__ */ e(ot, {}),
556
- /* @__PURE__ */ e(at, {})
556
+ /* @__PURE__ */ e(rt, {})
557
557
  ] }) })
558
558
  ] });
559
559
  }, It = K(({ goal: t }) => {
560
- const { goals: n } = T(), { setAlert: s, setSelectedGoal: l, updateGoal: u } = x(), [a, _] = y.useState(t.amount), b = !t.guid, c = a < 0 || a > 9999999999e-2, h = t.track_type === m.SAVINGS_TRACK && t.has_been_spent || t.track_type !== m.SAVINGS_TRACK && t.is_complete, o = async () => {
561
- const r = { ...t, amount: a };
562
- t.amount = a, b ? l(r) : (await u(r), s(n.alert_goal_updated_amount));
560
+ const { goals: n } = T(), { setAlert: s, setSelectedGoal: l, updateGoal: u } = I(), [r, _] = y.useState(t.amount), b = !t.guid, c = r < 0 || r > 9999999999e-2, h = t.track_type === m.SAVINGS_TRACK && t.has_been_spent || t.track_type !== m.SAVINGS_TRACK && t.is_complete, o = async () => {
561
+ const a = { ...t, amount: r };
562
+ t.amount = r, b ? l(a) : (await u(a), s(n.alert_goal_updated_amount));
563
563
  }, p = () => {
564
564
  setTimeout(() => {
565
565
  _(t.amount);
@@ -579,21 +579,21 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
579
579
  children: /* @__PURE__ */ e(
580
580
  Ne,
581
581
  {
582
- amount: a,
582
+ amount: r,
583
583
  autoFocus: !0,
584
584
  error: c,
585
585
  fullWidth: !0,
586
586
  minAmount: 0,
587
- setAmount: (r) => _(isNaN(Number(r)) ? a : Number(r)),
587
+ setAmount: (a) => _(isNaN(Number(a)) ? r : Number(a)),
588
588
  sx: { ".MuiTypography-Body": { p: 0 } }
589
589
  }
590
590
  )
591
591
  }
592
592
  );
593
593
  }), Gt = ({ goal: t }) => {
594
- const { visibleCheckingAccounts: n, visibleSavingsAccounts: s } = V(), { accounts: l, goals: u } = T(), { setAlert: a, setSelectedGoal: _, updateGoal: b } = x(), c = !t.guid, [h, o] = y.useState(!1), p = async ({ balance: r, guid: d }) => {
595
- const f = { ...t, account_guid: d, current_amount: r || 0 };
596
- c ? _(f) : (await b(f), a(u.alert_account_changed)), o(!1);
594
+ const { visibleCheckingAccounts: n, visibleSavingsAccounts: s } = V(), { accounts: l, goals: u } = T(), { setAlert: r, setSelectedGoal: _, updateGoal: b } = I(), c = !t.guid, [h, o] = y.useState(!1), p = async ({ balance: a, guid: d }) => {
595
+ const f = { ...t, account_guid: d, current_amount: a || 0 };
596
+ c ? _(f) : (await b(f), r(u.alert_account_changed)), o(!1);
597
597
  };
598
598
  return /* @__PURE__ */ i(g, { children: [
599
599
  c && !t.account_guid ? /* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () => o(!0), children: [
@@ -616,41 +616,41 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
616
616
  ] }),
617
617
  /* @__PURE__ */ e(j, { isOpen: h, onClose: () => o(!1), title: u.details_change_account, children: /* @__PURE__ */ i(g, { children: [
618
618
  n.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: l.account_types[1] }),
619
- /* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: n.map((r) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => p(r), children: [
619
+ /* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: n.map((a) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => p(a), children: [
620
620
  /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
621
621
  ne,
622
622
  {
623
- alt: r?.name || "",
624
- institutionGuid: r?.institution_guid || ""
623
+ alt: a?.name || "",
624
+ institutionGuid: a?.institution_guid || ""
625
625
  }
626
626
  ) }),
627
627
  /* @__PURE__ */ e(
628
628
  w,
629
629
  {
630
- primary: r?.name || r?.feed_name,
631
- secondary: v(r?.balance || 0, "0,0.00")
630
+ primary: a?.name || a?.feed_name,
631
+ secondary: v(a?.balance || 0, "0,0.00")
632
632
  }
633
633
  ),
634
634
  /* @__PURE__ */ e(M, {})
635
- ] }) }, r.guid)) }),
635
+ ] }) }, a.guid)) }),
636
636
  s.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: l.account_types[2] }),
637
- /* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: s.map((r) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => p(r), children: [
637
+ /* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: s.map((a) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => p(a), children: [
638
638
  /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
639
639
  ne,
640
640
  {
641
- alt: r?.name || "",
642
- institutionGuid: r?.institution_guid || ""
641
+ alt: a?.name || "",
642
+ institutionGuid: a?.institution_guid || ""
643
643
  }
644
644
  ) }),
645
645
  /* @__PURE__ */ e(
646
646
  w,
647
647
  {
648
- primary: r?.name || r?.feed_name,
649
- secondary: v(r?.balance || 0, "0,0.00")
648
+ primary: a?.name || a?.feed_name,
649
+ secondary: v(a?.balance || 0, "0,0.00")
650
650
  }
651
651
  ),
652
652
  /* @__PURE__ */ e(M, {})
653
- ] }) }, r.guid)) }),
653
+ ] }) }, a.guid)) }),
654
654
  /* @__PURE__ */ e(
655
655
  ye,
656
656
  {
@@ -662,9 +662,9 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
662
662
  ] }) })
663
663
  ] });
664
664
  }, Nt = K(({ goal: t }) => {
665
- const { goals: n } = T(), { setAlert: s, setSelectedGoal: l, updateGoal: u } = x(), [a, _] = y.useState(t.name), b = !t.guid, c = t.track_type === m.SAVINGS_TRACK && t.has_been_spent || t.track_type !== m.SAVINGS_TRACK && t.is_complete, h = async () => {
666
- const p = { ...t, name: a };
667
- t.name = a, b ? l(p) : (await u(p), s(n.alert_goal_updated_name));
665
+ const { goals: n } = T(), { setAlert: s, setSelectedGoal: l, updateGoal: u } = I(), [r, _] = y.useState(t.name), b = !t.guid, c = t.track_type === m.SAVINGS_TRACK && t.has_been_spent || t.track_type !== m.SAVINGS_TRACK && t.is_complete, h = async () => {
666
+ const p = { ...t, name: r };
667
+ t.name = r, b ? l(p) : (await u(p), s(n.alert_goal_updated_name));
668
668
  }, o = () => {
669
669
  setTimeout(() => {
670
670
  _(t.name);
@@ -674,7 +674,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
674
674
  ee,
675
675
  {
676
676
  isDisabled: c,
677
- isSaveDisabled: !a,
677
+ isSaveDisabled: !r,
678
678
  label: n.details_goal_name,
679
679
  onCancel: o,
680
680
  onSave: h,
@@ -683,26 +683,26 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
683
683
  children: /* @__PURE__ */ e(
684
684
  ke,
685
685
  {
686
- error: !a,
686
+ error: !r,
687
687
  fullWidth: !0,
688
688
  label: n.details_goal_name,
689
689
  onChange: (p) => _(p.target.value),
690
- value: a
690
+ value: r
691
691
  }
692
692
  )
693
693
  }
694
694
  );
695
695
  }), kt = ({ goal: t }) => {
696
- const { goals: n } = T(), { setAlert: s, setSelectedGoal: l, updateGoal: u } = x(), [a, _] = y.useState(t.retirement_age || 65), b = !t.guid, c = async () => {
697
- if (!isNaN(a)) {
698
- const p = { ...t, retirement_age: a };
699
- t.retirement_age = a, b ? l(p) : (await u(p), s(n.alert_goal_updated_retirement_age));
696
+ const { goals: n } = T(), { setAlert: s, setSelectedGoal: l, updateGoal: u } = I(), [r, _] = y.useState(t.retirement_age || 65), b = !t.guid, c = async () => {
697
+ if (!isNaN(r)) {
698
+ const p = { ...t, retirement_age: r };
699
+ t.retirement_age = r, b ? l(p) : (await u(p), s(n.alert_goal_updated_retirement_age));
700
700
  }
701
701
  }, h = () => {
702
702
  setTimeout(() => {
703
703
  _(t.retirement_age || 65);
704
704
  }, 250);
705
- }, o = !a || isNaN(a) || a < 20 || a >= 100;
705
+ }, o = !r || isNaN(r) || r < 20 || r >= 100;
706
706
  return /* @__PURE__ */ e(
707
707
  ee,
708
708
  {
@@ -721,14 +721,14 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
721
721
  fullWidth: !0,
722
722
  label: n.details_retirement_age,
723
723
  onChange: (p) => _(Number(p.target.value)),
724
- value: isNaN(a) ? "" : a
724
+ value: isNaN(r) ? "" : r
725
725
  }
726
726
  )
727
727
  }
728
728
  );
729
729
  }, wt = K(({ goal: t }) => {
730
- const { goals: n } = T(), { user: s, updateUser: l } = xe(), { setAlert: u } = x(), [a, _] = y.useState(Q(s.birthday ?? 0)), [b, c] = y.useState(null), h = t.is_complete, o = async () => {
731
- a && ct(a) && (await l({ ...s, birthday: lt(a) }), u(n.alert_goal_updated_birthday));
730
+ const { goals: n } = T(), { user: s, updateUser: l } = xe(), { setAlert: u } = I(), [r, _] = y.useState(Q(s.birthday ?? 0)), [b, c] = y.useState(null), h = t.is_complete, o = async () => {
731
+ r && ct(r) && (await l({ ...s, birthday: lt(r) }), u(n.alert_goal_updated_birthday));
732
732
  };
733
733
  return /* @__PURE__ */ e(
734
734
  ee,
@@ -738,7 +738,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
738
738
  label: n.details_birthday,
739
739
  onSave: o,
740
740
  primaryText: n.details_birthday,
741
- secondaryText: `${ae(Q(s.birthday ?? 0), re.MONTH_DAY_YEAR)}`,
741
+ secondaryText: `${re(Q(s.birthday ?? 0), ae.MONTH_DAY_YEAR)}`,
742
742
  zeroStateText: !t.guid && !s.birthday ? n.add_birthday : void 0,
743
743
  children: /* @__PURE__ */ e(_t, { dateAdapter: dt, children: /* @__PURE__ */ e(
744
744
  mt,
@@ -747,7 +747,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
747
747
  onChange: _,
748
748
  onError: (p) => c(p),
749
749
  sx: { width: "100%" },
750
- value: a
750
+ value: r
751
751
  }
752
752
  ) })
753
753
  }
@@ -756,28 +756,28 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
756
756
  const { goals: n } = T(), { visibleInvestmentAccounts: s } = V(), {
757
757
  addRetirementGoalAccount: l,
758
758
  newRetirementGoalAccounts: u,
759
- retirementGoalAccounts: a,
759
+ retirementGoalAccounts: r,
760
760
  selectedGoal: _,
761
761
  setAlert: b,
762
762
  setNewRetirementGoalAccounts: c,
763
763
  setSelectedGoal: h
764
- } = x(), [o, p] = y.useState(!1), r = !t.guid, d = s.filter(
765
- (C) => r ? u.find((S) => S.account_guid === C.guid) : a.find((S) => S.account_guid === C.guid)
764
+ } = I(), [o, p] = y.useState(!1), a = !t.guid, d = s.filter(
765
+ (C) => a ? u.find((S) => S.account_guid === C.guid) : r.find((S) => S.account_guid === C.guid)
766
766
  ), f = s.filter(
767
- (C) => !a.find((S) => S.account_guid === C.guid)
767
+ (C) => !r.find((S) => S.account_guid === C.guid)
768
768
  ), E = async (C) => {
769
- const S = C.map((I) => ({
770
- account_guid: I.guid,
769
+ const S = C.map((x) => ({
770
+ account_guid: x.guid,
771
771
  retirement_goal_guid: t.guid
772
772
  }));
773
- if (r)
773
+ if (a)
774
774
  c(S);
775
775
  else
776
- for (const I of S)
777
- await l(I), b(n.alert_account_added);
776
+ for (const x of S)
777
+ await l(x), b(n.alert_account_added);
778
778
  h({
779
779
  ..._,
780
- current_amount: C.reduce((I, F) => I + (F.balance || 0), 0)
780
+ current_amount: C.reduce((x, F) => x + (F.balance || 0), 0)
781
781
  }), p(!1);
782
782
  };
783
783
  return /* @__PURE__ */ i(g, { children: [
@@ -808,10 +808,10 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
808
808
  () => s.find((_) => _.guid === t.account_guid),
809
809
  [s, t]
810
810
  ), u = t.track_type;
811
- let a = n.details_save_title;
812
- return t.track_type === m.DEBT_TRACK ? a = n.details_debt_title : t.track_type === m.RETIREMENT_TRACK && (a = n.details_retirement_title), /* @__PURE__ */ i(g, { children: [
811
+ let r = n.details_save_title;
812
+ return t.track_type === m.DEBT_TRACK ? r = n.details_debt_title : t.track_type === m.RETIREMENT_TRACK && (r = n.details_retirement_title), /* @__PURE__ */ i(g, { children: [
813
813
  /* @__PURE__ */ i(g, { mx: 24, children: [
814
- /* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: a }),
814
+ /* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: r }),
815
815
  /* @__PURE__ */ e(Ke, { goal: t, isInDrawer: !0 }),
816
816
  /* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: n.details_title })
817
817
  ] }),
@@ -823,7 +823,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
823
823
  /* @__PURE__ */ e(R, { sx: { ml: u === m.RETIREMENT_TRACK ? 24 : 0 } })
824
824
  ] }),
825
825
  t.track_type === m.DEBT_TRACK && /* @__PURE__ */ i(U, { children: [
826
- /* @__PURE__ */ e(rt, { goal: t }),
826
+ /* @__PURE__ */ e(at, { goal: t }),
827
827
  /* @__PURE__ */ e(R, { sx: { ml: 24 } }),
828
828
  /* @__PURE__ */ e(it, { goal: t }),
829
829
  /* @__PURE__ */ e(R, { sx: { ml: 24 } }),
@@ -851,38 +851,39 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
851
851
  }), Mt = K(({ onClose: t }) => {
852
852
  const { visibleInvestmentAccounts: n } = V(), { goals: s, common: l } = T(), {
853
853
  addGoal: u,
854
- addRetirementGoal: a,
854
+ addRetirementGoal: r,
855
855
  deleteGoal: _,
856
856
  deleteRetirementGoal: b,
857
857
  newRetirementGoalAccounts: c,
858
858
  retirementGoalAccounts: h,
859
859
  selectedGoal: o,
860
860
  setAlert: p,
861
- setSelectedGoal: r,
861
+ setSelectedGoal: a,
862
862
  updateGoal: d
863
- } = x(), { user: f } = xe(), [E, C] = y.useState(!1), S = !o?.guid, I = o?.track_type === m.SAVINGS_TRACK && o.is_complete && !o.has_been_spent, F = y.useMemo(() => {
863
+ } = I(), { user: f } = xe(), [E, C] = y.useState(!1), S = !o?.guid, x = o?.track_type === m.SAVINGS_TRACK && o.is_complete && !o.has_been_spent, F = y.useMemo(() => {
864
864
  const G = S ? c : h;
865
865
  return n.filter(($) => G.some((D) => D.account_guid === $.guid));
866
866
  }, [S, n, c, h]), Z = y.useMemo(() => {
867
867
  if (!o) return !1;
868
+ if (!S && !x) return !0;
868
869
  const { account_guid: G, track_type: $, name: D, amount: q, retirement_age: O } = o;
869
870
  return $ === m.SAVINGS_TRACK ? G ? !!D && !!q : !1 : $ === m.RETIREMENT_TRACK ? F.length ? !!D && !!q && !!O && !!f.birthday : !1 : !0;
870
871
  }, [o, F, f.birthday]);
871
872
  let z = l.delete_button, H = () => C(!0);
872
- S ? (H = () => te(), z = l.save_button) : I && (H = () => se(), z = s.mark_as_complete_button);
873
+ S ? (H = () => te(), z = l.save_button) : x && (H = () => se(), z = s.mark_as_complete_button);
873
874
  const te = async () => {
874
875
  if (o) {
875
876
  const G = o.track_type;
876
- G !== m.RETIREMENT_TRACK ? await u(o) : G === m.RETIREMENT_TRACK && await a({ ...o, target_amount: o.amount }), p(s.alert_goal_added), r(void 0), G && t?.(G);
877
+ G !== m.RETIREMENT_TRACK ? await u(o) : G === m.RETIREMENT_TRACK && await r({ ...o, target_amount: o.amount }), p(s.alert_goal_added), a(void 0), G && t?.(G);
877
878
  }
878
879
  }, ie = async () => {
879
- o && (o.track_type !== m.RETIREMENT_TRACK ? await _(o.guid) : o.track_type === m.RETIREMENT_TRACK && await b(o), p(s.alert_goal_deleted), r(void 0));
880
+ o && (o.track_type !== m.RETIREMENT_TRACK ? await _(o.guid) : o.track_type === m.RETIREMENT_TRACK && await b(o), p(s.alert_goal_deleted), a(void 0));
880
881
  }, se = async () => {
881
882
  const G = {
882
883
  ...o,
883
884
  has_been_spent: !0
884
885
  };
885
- await d(G), p(s.alert_goal_completed), r(void 0);
886
+ await d(G), p(s.alert_goal_completed), a(void 0);
886
887
  };
887
888
  return /* @__PURE__ */ i(g, { children: [
888
889
  /* @__PURE__ */ e(
@@ -892,9 +893,9 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
892
893
  hasSecondaryAction: S,
893
894
  isOpen: !!o,
894
895
  isPrimaryDisabled: !Z,
895
- onClose: () => r(void 0),
896
+ onClose: () => a(void 0),
896
897
  onPrimaryAction: H,
897
- primaryColor: S || I ? "primary" : "error",
898
+ primaryColor: S || x ? "primary" : "error",
898
899
  primaryText: z,
899
900
  secondaryColor: "primary",
900
901
  title: s.goal_details,
@@ -916,13 +917,13 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
916
917
  )
917
918
  ] });
918
919
  }), Vn = K(({ onBackClick: t, sx: n }) => {
919
- const { onEvent: s } = Ie(), { isMobile: l } = he(), { visibleAccounts: u } = V(), { isCopyLoaded: a, isInitialized: _, setSelectedAccounts: b } = Ge(), { goals: c, common: h } = T(), { alert: o, goals: p, goalsLoaded: r, loadGoals: d, monthlyCashFlowProfile: f, setAlert: E, retirmentGoals: C } = x(), [S, I] = y.useState(0), [F, Z] = y.useState(!1), z = f?.amount_allocated_for_savings_goals || 0, H = f?.amount_allocated_for_debt_goals || 0, te = f?.amount_allocated_for_retirement_goals || 0, ie = a ? B(
920
+ const { onEvent: s } = Ie(), { isMobile: l } = he(), { visibleAccounts: u } = V(), { isCopyLoaded: r, isInitialized: _, setSelectedAccounts: b } = Ge(), { goals: c, common: h } = T(), { alert: o, goals: p, goalsLoaded: a, loadGoals: d, monthlyCashFlowProfile: f, setAlert: E, retirmentGoals: C } = I(), [S, x] = y.useState(0), [F, Z] = y.useState(!1), z = f?.amount_allocated_for_savings_goals || 0, H = f?.amount_allocated_for_debt_goals || 0, te = f?.amount_allocated_for_retirement_goals || 0, ie = r ? B(
920
921
  l ? c.tab_subtitle_mobile : c.tab_subtitle,
921
922
  v(z, "0,0")
922
- ) : "", se = a ? B(
923
+ ) : "", se = r ? B(
923
924
  l ? c.tab_subtitle_mobile : c.tab_subtitle,
924
925
  v(H, "0,0")
925
- ) : "", G = a ? B(
926
+ ) : "", G = r ? B(
926
927
  l ? c.tab_subtitle_mobile : c.tab_subtitle,
927
928
  v(te, "0,0")
928
929
  ) : "";
@@ -936,12 +937,12 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
936
937
  }, D = () => {
937
938
  Z(!0), s(Y.GOALS_CLICK_ADD);
938
939
  }, q = (X) => {
939
- Z(!1), X === m.SAVINGS_TRACK ? I(0) : X === m.DEBT_TRACK ? I(1) : X === m.RETIREMENT_TRACK && I(2);
940
+ Z(!1), X === m.SAVINGS_TRACK ? x(0) : X === m.DEBT_TRACK ? x(1) : X === m.RETIREMENT_TRACK && x(2);
940
941
  }, O = y.useMemo(
941
- () => r && (p.length === 0 || p.every(({ track_type: X }) => !X) && C.length === 0),
942
- [p, r, C]
942
+ () => a && (p.length === 0 || p.every(({ track_type: X }) => !X) && C.length === 0),
943
+ [p, a, C]
943
944
  );
944
- return !r || !a || !_ ? /* @__PURE__ */ e(we, {}) : /* @__PURE__ */ i(
945
+ return !a || !r || !_ ? /* @__PURE__ */ e(we, {}) : /* @__PURE__ */ i(
945
946
  pt,
946
947
  {
947
948
  accountOptions: u,
@@ -961,7 +962,7 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
961
962
  /* @__PURE__ */ i(
962
963
  Ve,
963
964
  {
964
- onChange: (X, Be) => I(Be),
965
+ onChange: (X, Be) => x(Be),
965
966
  sx: { bgcolor: "background.paper" },
966
967
  textColor: "primary",
967
968
  value: O ? !1 : S,
@@ -1031,9 +1032,9 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
1031
1032
  const { goals: n } = T(), s = gt(), {
1032
1033
  backgroundColor: l,
1033
1034
  color: u,
1034
- percentage: a,
1035
+ percentage: r,
1035
1036
  projectedText: _
1036
- } = _e(n, t), b = Math.round(a * 100);
1037
+ } = _e(n, t), b = Math.round(r * 100);
1037
1038
  let c = /* @__PURE__ */ e(Se, {});
1038
1039
  return t.track_type === m.DEBT_TRACK ? c = /* @__PURE__ */ e(Re, {}) : t.track_type === m.RETIREMENT_TRACK && (c = /* @__PURE__ */ e(Ee, {})), /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", spacing: 12, sx: { py: 12 }, children: [
1039
1040
  /* @__PURE__ */ e(oe, { sx: { bgcolor: l, color: u, height: 32, width: 32 }, variant: "rounded", children: c }),
@@ -1077,9 +1078,9 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
1077
1078
  ]
1078
1079
  }
1079
1080
  ), jn = K(({ onCTAClick: t }) => {
1080
- const { visibleAccounts: n } = V(), { onEvent: s } = Ie(), { goals: l } = T(), { isInitialized: u, setSelectedAccounts: a, isCopyLoaded: _ } = Ge(), { ongoingGoalsForMicroWidget: b, loadGoals: c, goalsLoaded: h } = x();
1081
+ const { visibleAccounts: n } = V(), { onEvent: s } = Ie(), { goals: l } = T(), { isInitialized: u, setSelectedAccounts: r, isCopyLoaded: _ } = Ge(), { ongoingGoalsForMicroWidget: b, loadGoals: c, goalsLoaded: h } = I();
1081
1082
  y.useEffect(() => {
1082
- a(n);
1083
+ r(n);
1083
1084
  }, []), y.useEffect(() => {
1084
1085
  u && (c().finally(), s(Y.GOALS_LOAD_WIDGET, {
1085
1086
  state: n?.length ? "default" : "zeroState"
@@ -1106,10 +1107,10 @@ const At = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
1106
1107
  header: l.create_goals_header,
1107
1108
  subText: l.micro_zero_state_description
1108
1109
  }
1109
- ) : /* @__PURE__ */ e(ht, { sx: { justifyContent: "space-between" }, children: b.map((r, d) => /* @__PURE__ */ i(y.Fragment, { children: [
1110
- /* @__PURE__ */ e(Bt, { goal: r }),
1110
+ ) : /* @__PURE__ */ e(ht, { sx: { justifyContent: "space-between" }, children: b.map((a, d) => /* @__PURE__ */ i(y.Fragment, { children: [
1111
+ /* @__PURE__ */ e(Bt, { goal: a }),
1111
1112
  d !== b.length - 1 && /* @__PURE__ */ e(R, {})
1112
- ] }, r.guid)) })
1113
+ ] }, a.guid)) })
1113
1114
  }
1114
1115
  );
1115
1116
  });