@mx-cartographer/experiences 7.0.24-alpha.sms1 → 7.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/goals/index.es.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { g as
|
|
1
|
+
import { g as ue, T as m, G as _e, a as We, M as q, C as Ae, b as Ve } from "../GoalStore-eSOkI6uE.mjs";
|
|
2
2
|
import { c as Un, d as Yn } from "../GoalStore-eSOkI6uE.mjs";
|
|
3
3
|
import { jsxs as i, jsx as e, Fragment as U } from "react/jsx-runtime";
|
|
4
4
|
import y from "react";
|
|
5
|
-
import { observer as
|
|
5
|
+
import { observer as K } from "mobx-react-lite";
|
|
6
6
|
import Pe from "@mui/material/Alert";
|
|
7
7
|
import je from "@mui/material/Snackbar";
|
|
8
8
|
import g from "@mui/material/Stack";
|
|
9
9
|
import ce from "@mui/material/Tab";
|
|
10
10
|
import Fe from "@mui/material/Tabs";
|
|
11
|
-
import { Text as A, H2 as
|
|
12
|
-
import
|
|
11
|
+
import { Text as A, H2 as pe, P as V, H3 as ze, Icon as He, InstitutionLogo as oe } from "@mxenabled/mxui";
|
|
12
|
+
import he from "@mui/material/Button";
|
|
13
13
|
import Te from "@mui/material/Card";
|
|
14
14
|
import Ce from "@mui/material/CardActionArea";
|
|
15
15
|
import Se from "@mui/material/CardContent";
|
|
16
|
-
import
|
|
16
|
+
import ge from "@mui/material/Unstable_Grid2";
|
|
17
17
|
import ae from "@mui/material/Avatar";
|
|
18
|
-
import
|
|
19
|
-
import { Payments as Re, NoteStack as
|
|
20
|
-
import { u as T, j as
|
|
21
|
-
import { u as
|
|
22
|
-
import { f as
|
|
18
|
+
import $e from "@mui/material/CardHeader";
|
|
19
|
+
import { Payments as Re, NoteStack as Ee, Person as ve, ChevronRight as M, DragHandle as Xe, CheckCircle as Ue, Icon as fe, ExpandLess as Ye, ExpandMore as Ze, AddBox as xe, Trophy as qe } from "@mxenabled/mx-icons";
|
|
20
|
+
import { u as T, j as x, c as j, o as Ie, e as Ge, m as Je, a as Ne } from "../hooks-DkUqN6JE.mjs";
|
|
21
|
+
import { u as be } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
22
|
+
import { f as v } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
23
23
|
import { S as Qe } from "../StatusBar-BK_uYHAB.mjs";
|
|
24
|
-
import
|
|
25
|
-
import
|
|
24
|
+
import E from "@mui/material/Divider";
|
|
25
|
+
import L from "@mui/material/List";
|
|
26
26
|
import { L as Q } from "../ListItemAction-DNZZ5fSa.mjs";
|
|
27
27
|
import { C as ke } from "../CurrencyInput-bEx2Mbd0.mjs";
|
|
28
28
|
import { fromUnixTime as J } from "date-fns/fromUnixTime";
|
|
@@ -31,25 +31,25 @@ import k from "@mui/material/ListItemButton";
|
|
|
31
31
|
import w from "@mui/material/ListItemText";
|
|
32
32
|
import { DataGridPro as et } from "@mui/x-data-grid-pro";
|
|
33
33
|
import { D as F } from "../Drawer-kEE73B87.mjs";
|
|
34
|
-
import { b as
|
|
34
|
+
import { b as B } from "../Localization-2MODESHW.mjs";
|
|
35
35
|
import { f as re, D as ie, a as tt } from "../Dialog-CWW597AF.mjs";
|
|
36
36
|
import P from "@mui/material/ListItemAvatar";
|
|
37
37
|
import nt from "@mui/material/Collapse";
|
|
38
38
|
import ot from "@mui/material/ListItemIcon";
|
|
39
39
|
import at from "@mui/material/Checkbox";
|
|
40
|
-
import { A as
|
|
40
|
+
import { A as ye } from "../ConnectDrawer-phFH6OHt.mjs";
|
|
41
41
|
import { u as rt, A as it } from "../AccountDetailsHeader-Eb3WvBGm.mjs";
|
|
42
42
|
import { A as st } from "../AccountDetailsContent-UxSEMBo_.mjs";
|
|
43
43
|
import we from "@mui/material/TextField";
|
|
44
44
|
import { M as lt, I as ct, O as dt } from "../OriginalBalanceAction-DepsKiJz.mjs";
|
|
45
45
|
import { getUnixTime as mt } from "date-fns/getUnixTime";
|
|
46
|
-
import { isValid as
|
|
47
|
-
import { AdapterDateFns as
|
|
46
|
+
import { isValid as _t } from "date-fns/isValid";
|
|
47
|
+
import { AdapterDateFns as ut } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
48
48
|
import { DatePicker as pt } from "@mui/x-date-pickers";
|
|
49
49
|
import { LocalizationProvider as ht } from "@mui/x-date-pickers/LocalizationProvider";
|
|
50
50
|
import { E as bt } from "../EmptyState-C0lr9E5T.mjs";
|
|
51
51
|
import { A as Y, W as gt } from "../WidgetContainer-CdBs9WOZ.mjs";
|
|
52
|
-
import { L as
|
|
52
|
+
import { L as Ke } from "../Loader-DUaFpDGv.mjs";
|
|
53
53
|
import ft from "@mui/material/Stack/Stack";
|
|
54
54
|
import yt from "@mui/material/Box";
|
|
55
55
|
import At from "@mui/material/styles/useTheme";
|
|
@@ -61,38 +61,38 @@ function de({ title: t, subtitle: n }) {
|
|
|
61
61
|
/* @__PURE__ */ e(A, { sx: { fontWeight: 400 }, variant: "Body", children: n })
|
|
62
62
|
] });
|
|
63
63
|
}
|
|
64
|
-
const St = (t, n) => n ?
|
|
64
|
+
const St = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
65
65
|
/(\d+)(?:\.0+|(\.\d*?[1-9])0*)([a-zA-Z]* ?\$?)/g,
|
|
66
66
|
"$1$2$3"
|
|
67
|
-
) :
|
|
68
|
-
({ goal: t, isInDrawer: n = !1, onClick:
|
|
69
|
-
const { goals:
|
|
67
|
+
) : v(t, "0,0.00"), De = K(
|
|
68
|
+
({ goal: t, isInDrawer: n = !1, onClick: l }) => {
|
|
69
|
+
const { goals: d } = T(), { isMobile: _, isTablet: a } = be(), u = _ || a, {
|
|
70
70
|
backgroundColor: p,
|
|
71
71
|
color: b,
|
|
72
72
|
percentage: s,
|
|
73
73
|
percentageText: o,
|
|
74
74
|
projectedText: h
|
|
75
|
-
} =
|
|
75
|
+
} = ue(d, t), r = t.track_type === m.DEBT_TRACK ? t.initial_amount : t.amount, c = [
|
|
76
76
|
{
|
|
77
77
|
color: p,
|
|
78
78
|
percentage: `${s}`
|
|
79
79
|
}
|
|
80
80
|
];
|
|
81
81
|
let f = /* @__PURE__ */ e(Re, {});
|
|
82
|
-
return t.track_type ===
|
|
82
|
+
return t.track_type === m.DEBT_TRACK ? f = /* @__PURE__ */ e(Ee, {}) : t.track_type === m.RETIREMENT_TRACK && (f = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ e(Te, { elevation: 2, children: /* @__PURE__ */ i(Ce, { disabled: !l, onClick: l, children: [
|
|
83
83
|
/* @__PURE__ */ e(
|
|
84
|
-
|
|
84
|
+
$e,
|
|
85
85
|
{
|
|
86
86
|
avatar: /* @__PURE__ */ e(ae, { sx: { bgcolor: p, color: b, height: 48, width: 48 }, variant: "rounded", children: f }),
|
|
87
|
-
subheader: /* @__PURE__ */ e(A, { variant: n || u ? "H3" : "H2", children: `${
|
|
87
|
+
subheader: /* @__PURE__ */ e(A, { variant: n || u ? "H3" : "H2", children: `${v(t.current_amount, u ? "0,0" : "0,0.00")} / ${St(
|
|
88
88
|
r,
|
|
89
89
|
u
|
|
90
90
|
)}` }),
|
|
91
|
-
title: /* @__PURE__ */ e(
|
|
91
|
+
title: /* @__PURE__ */ e(pe, { color: "text.secondary", fontWeight: 400, variant: "Body", children: t.name })
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
94
|
/* @__PURE__ */ e(Se, { sx: { pt: 0 }, children: /* @__PURE__ */ i(g, { gap: 6, children: [
|
|
95
|
-
/* @__PURE__ */ e(Qe, { data:
|
|
95
|
+
/* @__PURE__ */ e(Qe, { data: c, height: 24 }),
|
|
96
96
|
/* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
97
97
|
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: o }),
|
|
98
98
|
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: h })
|
|
@@ -100,14 +100,14 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
100
100
|
] }) })
|
|
101
101
|
] }) });
|
|
102
102
|
}
|
|
103
|
-
), Rt =
|
|
104
|
-
const { goals: n } = T(), { setAlert:
|
|
103
|
+
), Rt = K(({ trackType: t }) => {
|
|
104
|
+
const { goals: n } = T(), { setAlert: l, monthlyCashFlowProfile: d, updateMonthlyCashFlowProfile: _ } = x(), a = y.useMemo(() => {
|
|
105
105
|
let s = 0;
|
|
106
|
-
return t ===
|
|
107
|
-
}, [
|
|
108
|
-
if (
|
|
109
|
-
const s = { ...
|
|
110
|
-
t ===
|
|
106
|
+
return t === m.SAVINGS_TRACK ? s = d?.amount_allocated_for_savings_goals || 0 : t === m.DEBT_TRACK ? s = d?.amount_allocated_for_debt_goals || 0 : t === m.RETIREMENT_TRACK && (s = d?.amount_allocated_for_retirement_goals || 0), s;
|
|
107
|
+
}, [d]), [u, p] = y.useState(a), b = async () => {
|
|
108
|
+
if (d) {
|
|
109
|
+
const s = { ...d };
|
|
110
|
+
t === m.SAVINGS_TRACK ? s.amount_allocated_for_savings_goals = u : t === m.DEBT_TRACK ? s.amount_allocated_for_debt_goals = u : t === m.RETIREMENT_TRACK && (s.amount_allocated_for_retirement_goals = u), await _(s), l(n.alert_contribution_updated);
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
return /* @__PURE__ */ e(g, { bgcolor: "background.paper", children: /* @__PURE__ */ e(
|
|
@@ -118,7 +118,7 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
118
118
|
onCancel: () => p(a),
|
|
119
119
|
onSave: b,
|
|
120
120
|
primaryText: n.contribution_label,
|
|
121
|
-
secondaryText:
|
|
121
|
+
secondaryText: v(a, "0,0.00"),
|
|
122
122
|
children: /* @__PURE__ */ e(
|
|
123
123
|
ke,
|
|
124
124
|
{
|
|
@@ -133,20 +133,20 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
133
133
|
)
|
|
134
134
|
}
|
|
135
135
|
) });
|
|
136
|
-
}),
|
|
137
|
-
const { goals: n, common:
|
|
136
|
+
}), Et = ({ goals: t }) => {
|
|
137
|
+
const { goals: n, common: l } = T(), { reorderGoals: d, setAlert: _ } = x(), [a, u] = y.useState(!1), [p, b] = y.useState(t.map((c) => ({ ...c })));
|
|
138
138
|
y.useEffect(() => {
|
|
139
|
-
a && b(t.map((
|
|
139
|
+
a && b(t.map((c) => ({ ...c })));
|
|
140
140
|
}, [a]);
|
|
141
141
|
const s = [
|
|
142
142
|
{
|
|
143
143
|
field: "name",
|
|
144
144
|
flex: 1,
|
|
145
|
-
renderCell: (
|
|
146
|
-
const f =
|
|
145
|
+
renderCell: (c) => {
|
|
146
|
+
const f = c.row;
|
|
147
147
|
return /* @__PURE__ */ i(g, { children: [
|
|
148
148
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: f.name }),
|
|
149
|
-
/* @__PURE__ */ e(A, { variant: "XSmall", children:
|
|
149
|
+
/* @__PURE__ */ e(A, { variant: "XSmall", children: B(
|
|
150
150
|
n.goal_projection,
|
|
151
151
|
re(
|
|
152
152
|
J(f.projected_to_complete_at || 0),
|
|
@@ -161,25 +161,25 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
161
161
|
align: "right",
|
|
162
162
|
field: "amount",
|
|
163
163
|
minWidth: 140,
|
|
164
|
-
renderCell: (
|
|
165
|
-
const f =
|
|
166
|
-
return /* @__PURE__ */ e(A, { bold: !0, sx: { mr: 12 }, variant: "Body", children:
|
|
164
|
+
renderCell: (c) => {
|
|
165
|
+
const f = c.row;
|
|
166
|
+
return /* @__PURE__ */ e(A, { bold: !0, sx: { mr: 12 }, variant: "Body", children: v(f.amount, "0,0.00") });
|
|
167
167
|
},
|
|
168
168
|
sortable: !1
|
|
169
169
|
}
|
|
170
|
-
], o = p.map((
|
|
171
|
-
id:
|
|
170
|
+
], o = p.map((c) => ({
|
|
171
|
+
id: c.guid,
|
|
172
172
|
isHovering: !1,
|
|
173
|
-
__reorder__:
|
|
174
|
-
...
|
|
175
|
-
})), h = ({ oldIndex:
|
|
173
|
+
__reorder__: c.name,
|
|
174
|
+
...c
|
|
175
|
+
})), h = ({ oldIndex: c, targetIndex: f }) => {
|
|
176
176
|
const S = [...p];
|
|
177
|
-
S.splice(f, 0, S.splice(
|
|
177
|
+
S.splice(f, 0, S.splice(c, 1)[0]);
|
|
178
178
|
for (let C = 0; C < S.length; C += 1)
|
|
179
179
|
S[C].position = C + 1;
|
|
180
180
|
b(S);
|
|
181
181
|
}, r = async () => {
|
|
182
|
-
await
|
|
182
|
+
await d(p), _(n.alert_goals_reordered), u(!1);
|
|
183
183
|
};
|
|
184
184
|
return /* @__PURE__ */ i(g, { children: [
|
|
185
185
|
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(k, { onClick: () => u(!0), children: /* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(
|
|
@@ -198,7 +198,7 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
198
198
|
/* @__PURE__ */ e(
|
|
199
199
|
F,
|
|
200
200
|
{
|
|
201
|
-
ariaLabelClose:
|
|
201
|
+
ariaLabelClose: l.close_aria,
|
|
202
202
|
isOpen: a,
|
|
203
203
|
onClose: () => u(!1),
|
|
204
204
|
onPrimaryAction: r,
|
|
@@ -217,7 +217,7 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
217
217
|
rowReordering: !0,
|
|
218
218
|
rows: o,
|
|
219
219
|
slots: {
|
|
220
|
-
rowReorderIcon: () => /* @__PURE__ */ e(
|
|
220
|
+
rowReorderIcon: () => /* @__PURE__ */ e(Xe, { sx: { ml: 12 } })
|
|
221
221
|
//TODO: Add to mx-icons
|
|
222
222
|
},
|
|
223
223
|
sx: {
|
|
@@ -231,10 +231,10 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
231
231
|
}
|
|
232
232
|
)
|
|
233
233
|
] });
|
|
234
|
-
},
|
|
235
|
-
const { goals:
|
|
234
|
+
}, vt = ({ goal: t, index: n }) => {
|
|
235
|
+
const { goals: l } = T(), { percentage: d } = ue(l, t), _ = t.goal_type === _e.KEEP_BALANCE_BELOW || t.has_been_spent ? l.goal_completed : B(l.goal_percentage_reached, `${d * 100}`);
|
|
236
236
|
return /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { children: [
|
|
237
|
-
t.track_type !==
|
|
237
|
+
t.track_type !== m.RETIREMENT_TRACK && /* @__PURE__ */ e(
|
|
238
238
|
P,
|
|
239
239
|
{
|
|
240
240
|
sx: {
|
|
@@ -249,25 +249,25 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
249
249
|
/* @__PURE__ */ e(w, { primaryTypographyProps: { variant: "Body" }, children: /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
250
250
|
/* @__PURE__ */ i(g, { children: [
|
|
251
251
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: t.name }),
|
|
252
|
-
/* @__PURE__ */ e(A, { variant: "XSmall", children:
|
|
253
|
-
|
|
252
|
+
/* @__PURE__ */ e(A, { variant: "XSmall", children: t.is_complete ? _ : B(
|
|
253
|
+
l.goal_projection,
|
|
254
254
|
re(
|
|
255
255
|
J(t.projected_to_complete_at || 0),
|
|
256
256
|
ie.MONTH_SHORT_YEAR
|
|
257
257
|
)
|
|
258
258
|
) })
|
|
259
259
|
] }),
|
|
260
|
-
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children:
|
|
260
|
+
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: v(t.amount, "0,0.00") })
|
|
261
261
|
] }) })
|
|
262
262
|
] }) });
|
|
263
|
-
},
|
|
263
|
+
}, xt = ({ goal: t }) => {
|
|
264
264
|
const { goals: n } = T();
|
|
265
265
|
return /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { children: [
|
|
266
266
|
/* @__PURE__ */ e(P, { sx: { alignItems: "center", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ e(Ue, { color: "success", filled: !0, size: 20 }) }),
|
|
267
267
|
/* @__PURE__ */ e(w, { primaryTypographyProps: { variant: "Body" }, children: /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
268
268
|
/* @__PURE__ */ i(g, { children: [
|
|
269
269
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: t.name }),
|
|
270
|
-
/* @__PURE__ */ e(A, { variant: "XSmall", children:
|
|
270
|
+
/* @__PURE__ */ e(A, { variant: "XSmall", children: B(
|
|
271
271
|
n.completed_label,
|
|
272
272
|
re(
|
|
273
273
|
J(t.completed_at || 0),
|
|
@@ -275,22 +275,22 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
275
275
|
)
|
|
276
276
|
) })
|
|
277
277
|
] }),
|
|
278
|
-
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children:
|
|
278
|
+
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: v(t.amount, "0,0.00") })
|
|
279
279
|
] }) })
|
|
280
280
|
] }) }, t.guid);
|
|
281
281
|
}, It = ({ trackType: t }) => {
|
|
282
|
-
const { goals: n, common:
|
|
283
|
-
(
|
|
282
|
+
const { goals: n, common: l } = T(), { orderedGoals: d } = x(), _ = d.filter((c) => c.track_type === t), a = _.filter(
|
|
283
|
+
(c) => c.track_type === m.SAVINGS_TRACK && !c.has_been_spent || c.track_type !== m.SAVINGS_TRACK && !c.is_complete
|
|
284
284
|
), u = _.filter(
|
|
285
|
-
(
|
|
285
|
+
(c) => c.track_type === m.SAVINGS_TRACK && c.has_been_spent || c.track_type !== m.SAVINGS_TRACK && c.is_complete
|
|
286
286
|
), [p, b] = y.useState(!1);
|
|
287
287
|
let s = n.manage_saving_goals, o = n.manage_saving_drawer_title, h = n.manage_saving_title, r = n.manage_saving_description;
|
|
288
|
-
return t ===
|
|
289
|
-
/* @__PURE__ */ e(
|
|
288
|
+
return t === m.DEBT_TRACK ? (s = n.manage_debt_goals, o = n.manage_debt_drawer_title, h = n.manage_debt_title, r = n.manage_debt_description) : t === m.RETIREMENT_TRACK && (s = n.manage_retirement_goals, o = n.manage_retirement_drawer_title, h = n.manage_retirement_title, r = n.manage_retirement_description), /* @__PURE__ */ i(g, { children: [
|
|
289
|
+
/* @__PURE__ */ e(he, { endIcon: /* @__PURE__ */ e(M, {}), onClick: () => b(!0), children: s }),
|
|
290
290
|
/* @__PURE__ */ e(
|
|
291
291
|
F,
|
|
292
292
|
{
|
|
293
|
-
ariaLabelClose:
|
|
293
|
+
ariaLabelClose: l.close_aria,
|
|
294
294
|
isOpen: p,
|
|
295
295
|
onClose: () => b(!1),
|
|
296
296
|
title: o,
|
|
@@ -301,52 +301,52 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
301
301
|
] }),
|
|
302
302
|
/* @__PURE__ */ e(Rt, { trackType: t }),
|
|
303
303
|
/* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "XSmall", children: n.goal_priority }),
|
|
304
|
-
/* @__PURE__ */ i(
|
|
305
|
-
a.map((
|
|
304
|
+
/* @__PURE__ */ i(L, { sx: { bgcolor: "background.paper" }, children: [
|
|
305
|
+
a.map((c, f) => {
|
|
306
306
|
const S = f >= a.length - 1;
|
|
307
307
|
return /* @__PURE__ */ i(g, { children: [
|
|
308
|
-
/* @__PURE__ */ e(
|
|
308
|
+
/* @__PURE__ */ e(vt, { goal: c, index: f }),
|
|
309
309
|
/* @__PURE__ */ e(
|
|
310
|
-
|
|
310
|
+
E,
|
|
311
311
|
{
|
|
312
|
-
variant: S && t ===
|
|
312
|
+
variant: S && t === m.RETIREMENT_TRACK ? "fullWidth" : "inset"
|
|
313
313
|
}
|
|
314
314
|
)
|
|
315
|
-
] }, `ongoing-${
|
|
315
|
+
] }, `ongoing-${c.guid}`);
|
|
316
316
|
}),
|
|
317
|
-
t !==
|
|
318
|
-
/* @__PURE__ */ e(
|
|
319
|
-
/* @__PURE__ */ e(
|
|
317
|
+
t !== m.RETIREMENT_TRACK && /* @__PURE__ */ i(g, { children: [
|
|
318
|
+
/* @__PURE__ */ e(Et, { goals: a }),
|
|
319
|
+
/* @__PURE__ */ e(E, {})
|
|
320
320
|
] })
|
|
321
321
|
] }),
|
|
322
|
-
t !==
|
|
322
|
+
t !== m.RETIREMENT_TRACK && u.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
|
-
/* @__PURE__ */ e(
|
|
324
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: u.map((c, f) => {
|
|
325
325
|
const S = f > a.length - 1;
|
|
326
326
|
return /* @__PURE__ */ i(g, { children: [
|
|
327
|
-
/* @__PURE__ */ e(
|
|
328
|
-
/* @__PURE__ */ e(
|
|
329
|
-
] }, `complete-${
|
|
327
|
+
/* @__PURE__ */ e(xt, { goal: c }),
|
|
328
|
+
/* @__PURE__ */ e(E, { variant: S ? "fullWidth" : "inset" })
|
|
329
|
+
] }, `complete-${c.guid}`);
|
|
330
330
|
}) })
|
|
331
331
|
] })
|
|
332
332
|
] })
|
|
333
333
|
}
|
|
334
334
|
)
|
|
335
335
|
] });
|
|
336
|
-
}, me =
|
|
337
|
-
const { isMobile:
|
|
338
|
-
(o) => o.track_type ===
|
|
336
|
+
}, me = K(({ trackType: t, onAddGoals: n }) => {
|
|
337
|
+
const { isMobile: l } = be(), { goals: d } = T(), { orderedGoals: _, setSelectedGoal: a } = x(), u = _.filter((o) => o.track_type === t), p = u.filter(
|
|
338
|
+
(o) => o.track_type === m.SAVINGS_TRACK && !o.has_been_spent || o.track_type !== m.SAVINGS_TRACK && !o.is_complete
|
|
339
339
|
), b = u.filter(
|
|
340
|
-
(o) => o.track_type ===
|
|
341
|
-
), s = t ===
|
|
342
|
-
return /* @__PURE__ */ i(g, { mt: 16, mx:
|
|
340
|
+
(o) => o.track_type === m.SAVINGS_TRACK && o.has_been_spent || o.track_type !== m.SAVINGS_TRACK && o.is_complete
|
|
341
|
+
), s = t === m.DEBT_TRACK ? d.zero_state_complete_debt : d.zero_state_complete_savings;
|
|
342
|
+
return /* @__PURE__ */ i(g, { mt: 16, mx: l ? 24 : 0, children: [
|
|
343
343
|
/* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", mb: 8, children: [
|
|
344
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children:
|
|
344
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children: d.ongoing_title }),
|
|
345
345
|
/* @__PURE__ */ e(It, { trackType: t })
|
|
346
346
|
] }),
|
|
347
|
-
p.length > 0 ? /* @__PURE__ */ e(
|
|
347
|
+
p.length > 0 ? /* @__PURE__ */ e(ge, { container: !0, spacing: 24, children: p.map((o, h, r) => (
|
|
348
348
|
// Goal should be full width in mobile or if it's the first goal (unless there are 2)
|
|
349
|
-
/* @__PURE__ */ e(
|
|
349
|
+
/* @__PURE__ */ e(ge, { xs: l || h === 0 && r.length !== 2 ? 12 : 6, children: /* @__PURE__ */ e(De, { goal: o, onClick: () => a(o) }, o.guid) }, h)
|
|
350
350
|
)) }) : /* @__PURE__ */ i(
|
|
351
351
|
g,
|
|
352
352
|
{
|
|
@@ -368,15 +368,15 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
368
368
|
width: { sm: 381 }
|
|
369
369
|
}),
|
|
370
370
|
variant: "Small",
|
|
371
|
-
children: We(t,
|
|
371
|
+
children: We(t, d)
|
|
372
372
|
}
|
|
373
373
|
),
|
|
374
|
-
/* @__PURE__ */ e(
|
|
374
|
+
/* @__PURE__ */ e(he, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children: d.add_goals_button })
|
|
375
375
|
]
|
|
376
376
|
}
|
|
377
377
|
),
|
|
378
|
-
t !==
|
|
379
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children:
|
|
378
|
+
t !== m.RETIREMENT_TRACK && /* @__PURE__ */ i(g, { gap: 16, mt: 48, children: [
|
|
379
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children: d.complete_title }),
|
|
380
380
|
b.length === 0 && /* @__PURE__ */ e(g, { alignItems: "center", bgcolor: "background.default", borderRadius: 2, py: 18, children: /* @__PURE__ */ e(
|
|
381
381
|
V,
|
|
382
382
|
{
|
|
@@ -396,32 +396,32 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
396
396
|
/* @__PURE__ */ e(He, { color: "success", fill: !0, name: "check_circle", size: 20 }),
|
|
397
397
|
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Body", children: o.name })
|
|
398
398
|
] }),
|
|
399
|
-
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children:
|
|
399
|
+
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: v(o.amount, "0,0.00") })
|
|
400
400
|
] }) }) }) }, o.guid))
|
|
401
401
|
] })
|
|
402
402
|
] });
|
|
403
403
|
}), Gt = ({ goalType: t, onClick: n }) => {
|
|
404
|
-
const { goals:
|
|
405
|
-
return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ i(
|
|
404
|
+
const { goals: l } = T(), { bgcolor: d, icon: _, label: a, description: u, subTypes: p, type: b } = t, [s, o] = y.useState(!1), h = p.length > 0;
|
|
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,
|
|
408
408
|
{
|
|
409
409
|
onClick: h ? () => o(!s) : () => n(
|
|
410
|
-
b ===
|
|
411
|
-
b ===
|
|
410
|
+
b === m.RETIREMENT_TRACK ? l.retirement : "",
|
|
411
|
+
b === m.RETIREMENT_TRACK ? q.RETIREMENT : q.OTHER,
|
|
412
412
|
b
|
|
413
413
|
),
|
|
414
414
|
children: [
|
|
415
|
-
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(ae, { sx: { bgcolor:
|
|
415
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(ae, { sx: { bgcolor: d }, variant: "rounded", children: /* @__PURE__ */ e(fe, { name: _, sx: { color: "grey.900" } }) }) }),
|
|
416
416
|
/* @__PURE__ */ e(w, { primary: a, secondary: u, sx: { mr: 24 } }),
|
|
417
417
|
!h && /* @__PURE__ */ e(M, {}),
|
|
418
418
|
h && (s ? /* @__PURE__ */ e(Ye, {}) : /* @__PURE__ */ e(Ze, {}))
|
|
419
419
|
]
|
|
420
420
|
}
|
|
421
421
|
) }),
|
|
422
|
-
/* @__PURE__ */ e(
|
|
423
|
-
h && /* @__PURE__ */ e(nt, { in: s, children: /* @__PURE__ */ e(
|
|
424
|
-
/* @__PURE__ */ e(ot, { sx: { mr: 8 }, children: /* @__PURE__ */ e(
|
|
422
|
+
/* @__PURE__ */ e(E, { variant: "inset" }),
|
|
423
|
+
h && /* @__PURE__ */ e(nt, { in: s, children: /* @__PURE__ */ e(L, { sx: { bgcolor: "background.default" }, children: p.map((r, c) => /* @__PURE__ */ e(N, { sx: { pl: 48 }, children: /* @__PURE__ */ i(k, { onClick: () => n(r.label, r.metaType, b), children: [
|
|
424
|
+
/* @__PURE__ */ e(ot, { sx: { mr: 8 }, children: /* @__PURE__ */ e(fe, { name: r.icon }) }),
|
|
425
425
|
/* @__PURE__ */ e(
|
|
426
426
|
w,
|
|
427
427
|
{
|
|
@@ -430,17 +430,17 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
430
430
|
}
|
|
431
431
|
),
|
|
432
432
|
/* @__PURE__ */ e(M, {})
|
|
433
|
-
] }) },
|
|
433
|
+
] }) }, c)) }) })
|
|
434
434
|
] }) });
|
|
435
435
|
}, Me = ({
|
|
436
436
|
accounts: t,
|
|
437
437
|
isOpen: n,
|
|
438
|
-
onClose:
|
|
439
|
-
onSave:
|
|
438
|
+
onClose: l,
|
|
439
|
+
onSave: d,
|
|
440
440
|
title: _
|
|
441
441
|
}) => {
|
|
442
442
|
const { goals: a, common: u } = T(), [p, b] = y.useState([]), s = (o) => {
|
|
443
|
-
const h = p.findIndex((
|
|
443
|
+
const h = p.findIndex((c) => c.guid === o.guid), r = [...p];
|
|
444
444
|
h >= 0 ? r.splice(h, 1) : r.push(o), b(r);
|
|
445
445
|
};
|
|
446
446
|
return /* @__PURE__ */ i(
|
|
@@ -448,13 +448,13 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
448
448
|
{
|
|
449
449
|
ariaLabelClose: u.close_aria,
|
|
450
450
|
isOpen: n,
|
|
451
|
-
onClose:
|
|
452
|
-
onPrimaryAction: () =>
|
|
451
|
+
onClose: l,
|
|
452
|
+
onPrimaryAction: () => d(p),
|
|
453
453
|
title: _,
|
|
454
454
|
children: [
|
|
455
455
|
/* @__PURE__ */ e(V, { color: "text.secondary", sx: { mx: 24, my: 12 }, children: a.select_debt_accounts_description }),
|
|
456
|
-
/* @__PURE__ */ i(
|
|
457
|
-
/* @__PURE__ */ e(
|
|
456
|
+
/* @__PURE__ */ i(L, { sx: { bgcolor: "background.white" }, children: [
|
|
457
|
+
/* @__PURE__ */ e(E, { variant: "fullWidth" }),
|
|
458
458
|
t.map((o, h) => /* @__PURE__ */ i(y.Fragment, { children: [
|
|
459
459
|
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => s(o), children: [
|
|
460
460
|
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
@@ -468,12 +468,12 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
468
468
|
w,
|
|
469
469
|
{
|
|
470
470
|
primary: o.name || o.feed_name,
|
|
471
|
-
secondary:
|
|
471
|
+
secondary: v(o.balance || 0, "0,0.00")
|
|
472
472
|
}
|
|
473
473
|
),
|
|
474
474
|
/* @__PURE__ */ e(at, { checked: p.some((r) => r.guid === o.guid) })
|
|
475
475
|
] }) }),
|
|
476
|
-
/* @__PURE__ */ e(
|
|
476
|
+
/* @__PURE__ */ e(E, { variant: h < t.length - 1 ? "inset" : "fullWidth" })
|
|
477
477
|
] }, o.guid))
|
|
478
478
|
] }),
|
|
479
479
|
/* @__PURE__ */ e(
|
|
@@ -488,40 +488,40 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
488
488
|
}
|
|
489
489
|
);
|
|
490
490
|
}, Nt = ({ onClose: t }) => {
|
|
491
|
-
const { goals: n } = T(), { addGoal:
|
|
492
|
-
f ===
|
|
491
|
+
const { goals: n } = T(), { addGoal: l, debtGoals: d, setAlert: _, setSelectedGoal: a } = x(), { visibleDebtAccounts: u } = j(), [p, b] = y.useState(!1), s = Ve(n), o = (r, c, f) => {
|
|
492
|
+
f === m.DEBT_TRACK ? b(!0) : a({
|
|
493
493
|
amount: 0,
|
|
494
494
|
current_amount: 0,
|
|
495
|
-
goal_type:
|
|
495
|
+
goal_type: _e.SAVE_AMOUNT,
|
|
496
496
|
initial_amount: 0,
|
|
497
|
-
meta_type:
|
|
497
|
+
meta_type: c,
|
|
498
498
|
name: r,
|
|
499
499
|
track_type: f
|
|
500
500
|
});
|
|
501
501
|
}, h = async (r) => {
|
|
502
|
-
for (const
|
|
502
|
+
for (const c of r) {
|
|
503
503
|
let f = q.CREDIT_CARD;
|
|
504
|
-
|
|
505
|
-
account_guid:
|
|
504
|
+
c.account_type === ye.LOAN ? f = q.LOANS : c.account_type === ye.LINE_OF_CREDIT && (f = q.LINE_OF_CREDIT), await l({
|
|
505
|
+
account_guid: c.guid,
|
|
506
506
|
amount: 0,
|
|
507
507
|
current_amount: 0,
|
|
508
|
-
goal_type:
|
|
509
|
-
initial_amount:
|
|
510
|
-
interest_rate:
|
|
508
|
+
goal_type: _e.KEEP_BALANCE_BELOW,
|
|
509
|
+
initial_amount: c.balance || 0,
|
|
510
|
+
interest_rate: c.interest_rate || 0,
|
|
511
511
|
meta_type: f,
|
|
512
|
-
monthly_payment:
|
|
513
|
-
name:
|
|
514
|
-
track_type:
|
|
512
|
+
monthly_payment: c.minimum_payment || 0,
|
|
513
|
+
name: c.name || c.feed_name || "",
|
|
514
|
+
track_type: m.DEBT_TRACK
|
|
515
515
|
}), _(n.alert_goal_added);
|
|
516
516
|
}
|
|
517
|
-
b(!1), t?.(
|
|
517
|
+
b(!1), t?.(m.DEBT_TRACK);
|
|
518
518
|
};
|
|
519
519
|
return /* @__PURE__ */ i(g, { children: [
|
|
520
|
-
/* @__PURE__ */ e(
|
|
520
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: s.map((r, c) => /* @__PURE__ */ e(Gt, { goalType: r, onClick: o }, c)) }),
|
|
521
521
|
/* @__PURE__ */ e(
|
|
522
522
|
Me,
|
|
523
523
|
{
|
|
524
|
-
accounts: u.filter((r) => !
|
|
524
|
+
accounts: u.filter((r) => !d.find((c) => c.account_guid === r.guid)),
|
|
525
525
|
isOpen: p,
|
|
526
526
|
onClose: () => b(!1),
|
|
527
527
|
onSave: h,
|
|
@@ -530,10 +530,10 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
530
530
|
)
|
|
531
531
|
] });
|
|
532
532
|
}, Be = ({ account: t }) => {
|
|
533
|
-
const { accounts: n } = T(), { setSelectedAccount:
|
|
533
|
+
const { accounts: n } = T(), { setSelectedAccount: l } = rt(), [d, _] = y.useState(!1);
|
|
534
534
|
return /* @__PURE__ */ i(N, { sx: { bgcolor: "background.paper" }, children: [
|
|
535
535
|
/* @__PURE__ */ i(k, { onClick: () => {
|
|
536
|
-
|
|
536
|
+
l(t), _(!0);
|
|
537
537
|
}, children: [
|
|
538
538
|
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
539
539
|
oe,
|
|
@@ -546,20 +546,20 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
546
546
|
w,
|
|
547
547
|
{
|
|
548
548
|
primary: t.name || t.feed_name,
|
|
549
|
-
secondary:
|
|
549
|
+
secondary: v(t.balance || 0, "0,0.00")
|
|
550
550
|
}
|
|
551
551
|
),
|
|
552
552
|
/* @__PURE__ */ e(M, {})
|
|
553
553
|
] }),
|
|
554
|
-
/* @__PURE__ */ e(F, { isOpen:
|
|
554
|
+
/* @__PURE__ */ e(F, { isOpen: d, onClose: () => _(!1), title: n.account_details, children: /* @__PURE__ */ i(g, { children: [
|
|
555
555
|
/* @__PURE__ */ e(it, {}),
|
|
556
556
|
/* @__PURE__ */ e(st, {})
|
|
557
557
|
] }) })
|
|
558
558
|
] });
|
|
559
|
-
}, kt =
|
|
560
|
-
const { goals: n } = T(), { setAlert:
|
|
559
|
+
}, kt = K(({ goal: t }) => {
|
|
560
|
+
const { goals: n } = T(), { setAlert: l, setSelectedGoal: d, updateGoal: _ } = x(), [a, u] = y.useState(t.amount), p = !t.guid, b = a < 0 || a > 9999999999e-2, s = t.track_type === m.SAVINGS_TRACK && t.has_been_spent || t.track_type !== m.SAVINGS_TRACK && t.is_complete, o = async () => {
|
|
561
561
|
const r = { ...t, amount: a };
|
|
562
|
-
t.amount = a, p ?
|
|
562
|
+
t.amount = a, p ? d(r) : (await _(r), l(n.alert_goal_updated_amount));
|
|
563
563
|
}, h = () => {
|
|
564
564
|
setTimeout(() => {
|
|
565
565
|
u(t.amount);
|
|
@@ -574,7 +574,7 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
574
574
|
onCancel: h,
|
|
575
575
|
onSave: o,
|
|
576
576
|
primaryText: n.details_amount_to_save,
|
|
577
|
-
secondaryText:
|
|
577
|
+
secondaryText: v(t.amount, "0,0"),
|
|
578
578
|
zeroStateText: p && t.amount === 0 ? n.add_amount : void 0,
|
|
579
579
|
children: /* @__PURE__ */ e(
|
|
580
580
|
ke,
|
|
@@ -591,32 +591,32 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
591
591
|
}
|
|
592
592
|
);
|
|
593
593
|
}), wt = ({ goal: t }) => {
|
|
594
|
-
const { visibleCheckingAccounts: n, visibleSavingsAccounts:
|
|
595
|
-
const f = { ...t, account_guid:
|
|
594
|
+
const { visibleCheckingAccounts: n, visibleSavingsAccounts: l } = j(), { accounts: d, goals: _ } = T(), { setAlert: a, setSelectedGoal: u, updateGoal: p } = x(), b = !t.guid, [s, o] = y.useState(!1), h = async ({ balance: r, guid: c }) => {
|
|
595
|
+
const f = { ...t, account_guid: c, current_amount: r || 0 };
|
|
596
596
|
b ? u(f) : (await p(f), a(_.alert_account_changed)), o(!1);
|
|
597
597
|
};
|
|
598
598
|
return /* @__PURE__ */ i(g, { children: [
|
|
599
599
|
b && !t.account_guid ? /* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () => o(!0), children: [
|
|
600
600
|
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(g, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
601
|
-
/* @__PURE__ */ e(
|
|
601
|
+
/* @__PURE__ */ e(xe, { filled: !0 }),
|
|
602
602
|
_.details_add_account
|
|
603
603
|
] }) }),
|
|
604
604
|
/* @__PURE__ */ e(M, { color: "primary" })
|
|
605
605
|
] }) }) : /* @__PURE__ */ i(g, { sx: { gap: 8, my: 24, mx: 24 }, children: [
|
|
606
|
-
/* @__PURE__ */ e(
|
|
606
|
+
/* @__PURE__ */ e(he, { onClick: () => o(!0), variant: "text", children: _.details_change_account }),
|
|
607
607
|
/* @__PURE__ */ e(
|
|
608
608
|
A,
|
|
609
609
|
{
|
|
610
610
|
color: "text.secondary",
|
|
611
611
|
sx: { textAlign: "center", whiteSpace: "wrap" },
|
|
612
612
|
variant: "Paragraph",
|
|
613
|
-
children:
|
|
613
|
+
children: B(_.details_change_account_description, t.name)
|
|
614
614
|
}
|
|
615
615
|
)
|
|
616
616
|
] }),
|
|
617
617
|
/* @__PURE__ */ e(F, { isOpen: s, onClose: () => o(!1), title: _.details_change_account, children: /* @__PURE__ */ i(g, { children: [
|
|
618
|
-
n.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children:
|
|
619
|
-
/* @__PURE__ */ e(
|
|
618
|
+
n.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: d.account_types[1] }),
|
|
619
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: n.map((r) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => h(r), children: [
|
|
620
620
|
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
621
621
|
oe,
|
|
622
622
|
{
|
|
@@ -628,13 +628,13 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
628
628
|
w,
|
|
629
629
|
{
|
|
630
630
|
primary: r?.name || r?.feed_name,
|
|
631
|
-
secondary:
|
|
631
|
+
secondary: v(r?.balance || 0, "0,0.00")
|
|
632
632
|
}
|
|
633
633
|
),
|
|
634
634
|
/* @__PURE__ */ e(M, {})
|
|
635
635
|
] }) }, r.guid)) }),
|
|
636
|
-
|
|
637
|
-
/* @__PURE__ */ e(
|
|
636
|
+
l.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: d.account_types[2] }),
|
|
637
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: l.map((r) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => h(r), children: [
|
|
638
638
|
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
639
639
|
oe,
|
|
640
640
|
{
|
|
@@ -646,7 +646,7 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
646
646
|
w,
|
|
647
647
|
{
|
|
648
648
|
primary: r?.name || r?.feed_name,
|
|
649
|
-
secondary:
|
|
649
|
+
secondary: v(r?.balance || 0, "0,0.00")
|
|
650
650
|
}
|
|
651
651
|
),
|
|
652
652
|
/* @__PURE__ */ e(M, {})
|
|
@@ -661,10 +661,10 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
661
661
|
)
|
|
662
662
|
] }) })
|
|
663
663
|
] });
|
|
664
|
-
},
|
|
665
|
-
const { goals: n } = T(), { setAlert:
|
|
664
|
+
}, Kt = K(({ goal: t }) => {
|
|
665
|
+
const { goals: n } = T(), { setAlert: l, setSelectedGoal: d, updateGoal: _ } = x(), [a, u] = y.useState(t.name), p = !t.guid, b = t.track_type === m.SAVINGS_TRACK && t.has_been_spent || t.track_type !== m.SAVINGS_TRACK && t.is_complete, s = async () => {
|
|
666
666
|
const h = { ...t, name: a };
|
|
667
|
-
t.name = a, p ?
|
|
667
|
+
t.name = a, p ? d(h) : (await _(h), l(n.alert_goal_updated_name));
|
|
668
668
|
}, o = () => {
|
|
669
669
|
setTimeout(() => {
|
|
670
670
|
u(t.name);
|
|
@@ -692,11 +692,11 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
692
692
|
)
|
|
693
693
|
}
|
|
694
694
|
);
|
|
695
|
-
}),
|
|
696
|
-
const { goals: n } = T(), { setAlert:
|
|
695
|
+
}), Dt = ({ goal: t }) => {
|
|
696
|
+
const { goals: n } = T(), { setAlert: l, setSelectedGoal: d, updateGoal: _ } = x(), [a, u] = y.useState(t.retirement_age || 65), p = !t.guid, b = async () => {
|
|
697
697
|
if (!isNaN(a)) {
|
|
698
698
|
const h = { ...t, retirement_age: a };
|
|
699
|
-
t.retirement_age = a, p ?
|
|
699
|
+
t.retirement_age = a, p ? d(h) : (await _(h), l(n.alert_goal_updated_retirement_age));
|
|
700
700
|
}
|
|
701
701
|
}, s = () => {
|
|
702
702
|
setTimeout(() => {
|
|
@@ -726,9 +726,9 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
726
726
|
)
|
|
727
727
|
}
|
|
728
728
|
);
|
|
729
|
-
}, Mt =
|
|
730
|
-
const { goals: n } = T(), { user:
|
|
731
|
-
a &&
|
|
729
|
+
}, Mt = K(({ goal: t }) => {
|
|
730
|
+
const { goals: n } = T(), { user: l, updateUser: d } = Ie(), { setAlert: _ } = x(), [a, u] = y.useState(J(l.birthday ?? 0)), [p, b] = y.useState(null), s = t.is_complete, o = async () => {
|
|
731
|
+
a && _t(a) && (await d({ ...l, birthday: mt(a) }), _(n.alert_goal_updated_birthday));
|
|
732
732
|
};
|
|
733
733
|
return /* @__PURE__ */ e(
|
|
734
734
|
Q,
|
|
@@ -738,9 +738,9 @@ const St = (t, n) => n ? x(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: `${re(J(
|
|
742
|
-
zeroStateText: !t.guid && !
|
|
743
|
-
children: /* @__PURE__ */ e(ht, { dateAdapter:
|
|
741
|
+
secondaryText: `${re(J(l.birthday ?? 0), ie.MONTH_DAY_YEAR)}`,
|
|
742
|
+
zeroStateText: !t.guid && !l.birthday ? n.add_birthday : void 0,
|
|
743
|
+
children: /* @__PURE__ */ e(ht, { dateAdapter: ut, children: /* @__PURE__ */ e(
|
|
744
744
|
pt,
|
|
745
745
|
{
|
|
746
746
|
label: n.details_birthday,
|
|
@@ -753,17 +753,17 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
753
753
|
}
|
|
754
754
|
);
|
|
755
755
|
}), Bt = ({ goal: t }) => {
|
|
756
|
-
const { goals: n } = T(), { visibleInvestmentAccounts:
|
|
757
|
-
addRetirementGoalAccount:
|
|
756
|
+
const { goals: n } = T(), { visibleInvestmentAccounts: l } = j(), {
|
|
757
|
+
addRetirementGoalAccount: d,
|
|
758
758
|
newRetirementGoalAccounts: _,
|
|
759
759
|
retirementGoalAccounts: a,
|
|
760
760
|
selectedGoal: u,
|
|
761
761
|
setAlert: p,
|
|
762
762
|
setNewRetirementGoalAccounts: b,
|
|
763
763
|
setSelectedGoal: s
|
|
764
|
-
} =
|
|
764
|
+
} = x(), [o, h] = y.useState(!1), r = !t.guid, c = l.filter(
|
|
765
765
|
(C) => r ? _.find((R) => R.account_guid === C.guid) : a.find((R) => R.account_guid === C.guid)
|
|
766
|
-
), f =
|
|
766
|
+
), f = l.filter(
|
|
767
767
|
(C) => !a.find((R) => R.account_guid === C.guid)
|
|
768
768
|
), S = async (C) => {
|
|
769
769
|
const R = C.map((I) => ({
|
|
@@ -774,20 +774,20 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
774
774
|
b(R);
|
|
775
775
|
else
|
|
776
776
|
for (const I of R)
|
|
777
|
-
await
|
|
777
|
+
await d(I), p(n.alert_account_added);
|
|
778
778
|
s({
|
|
779
779
|
...u,
|
|
780
|
-
current_amount: C.reduce((I,
|
|
780
|
+
current_amount: C.reduce((I, D) => I + (D.balance || 0), 0)
|
|
781
781
|
}), h(!1);
|
|
782
782
|
};
|
|
783
783
|
return /* @__PURE__ */ i(g, { children: [
|
|
784
|
-
|
|
784
|
+
c.map((C) => /* @__PURE__ */ i(g, { children: [
|
|
785
785
|
/* @__PURE__ */ e(Be, { account: C }),
|
|
786
|
-
/* @__PURE__ */ e(
|
|
786
|
+
/* @__PURE__ */ e(E, {})
|
|
787
787
|
] }, C.guid)),
|
|
788
788
|
/* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () => h(!0), children: [
|
|
789
789
|
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(g, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
790
|
-
/* @__PURE__ */ e(
|
|
790
|
+
/* @__PURE__ */ e(xe, { filled: !0 }),
|
|
791
791
|
n.details_add_account
|
|
792
792
|
] }) }),
|
|
793
793
|
/* @__PURE__ */ e(M, { color: "primary" })
|
|
@@ -803,53 +803,53 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
803
803
|
}
|
|
804
804
|
)
|
|
805
805
|
] });
|
|
806
|
-
},
|
|
807
|
-
const { goals: n } = T(), { visibleAccounts:
|
|
808
|
-
() =>
|
|
809
|
-
[
|
|
806
|
+
}, Lt = K(({ goal: t }) => {
|
|
807
|
+
const { goals: n } = T(), { visibleAccounts: l } = j(), d = y.useMemo(
|
|
808
|
+
() => l.find((u) => u.guid === t.account_guid),
|
|
809
|
+
[l, t]
|
|
810
810
|
), _ = t.track_type;
|
|
811
811
|
let a = n.details_save_title;
|
|
812
|
-
return t.track_type ===
|
|
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: [
|
|
813
813
|
/* @__PURE__ */ i(g, { mx: 24, children: [
|
|
814
814
|
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: a }),
|
|
815
|
-
/* @__PURE__ */ e(
|
|
815
|
+
/* @__PURE__ */ e(De, { 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
|
] }),
|
|
818
|
-
/* @__PURE__ */ i(
|
|
819
|
-
/* @__PURE__ */ e(
|
|
820
|
-
/* @__PURE__ */ e(
|
|
821
|
-
(_ ===
|
|
818
|
+
/* @__PURE__ */ i(L, { sx: { bgcolor: "background.paper" }, children: [
|
|
819
|
+
/* @__PURE__ */ e(Kt, { goal: t }),
|
|
820
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
821
|
+
(_ === m.SAVINGS_TRACK || _ === m.RETIREMENT_TRACK) && /* @__PURE__ */ i(U, { children: [
|
|
822
822
|
/* @__PURE__ */ e(kt, { goal: t }),
|
|
823
|
-
/* @__PURE__ */ e(
|
|
823
|
+
/* @__PURE__ */ e(E, { sx: { ml: _ === m.RETIREMENT_TRACK ? 24 : 0 } })
|
|
824
824
|
] }),
|
|
825
|
-
t.track_type ===
|
|
825
|
+
t.track_type === m.DEBT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
826
826
|
/* @__PURE__ */ e(lt, { goal: t }),
|
|
827
|
-
/* @__PURE__ */ e(
|
|
827
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
828
828
|
/* @__PURE__ */ e(ct, { goal: t }),
|
|
829
|
-
/* @__PURE__ */ e(
|
|
829
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
830
830
|
/* @__PURE__ */ e(dt, { goal: t }),
|
|
831
|
-
/* @__PURE__ */ e(
|
|
831
|
+
/* @__PURE__ */ e(E, { variant: "fullWidth" })
|
|
832
832
|
] }),
|
|
833
|
-
t.track_type ===
|
|
834
|
-
/* @__PURE__ */ e(
|
|
835
|
-
/* @__PURE__ */ e(
|
|
833
|
+
t.track_type === m.RETIREMENT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
834
|
+
/* @__PURE__ */ e(Dt, { goal: t }),
|
|
835
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
836
836
|
/* @__PURE__ */ e(Mt, { goal: t }),
|
|
837
|
-
/* @__PURE__ */ e(
|
|
837
|
+
/* @__PURE__ */ e(E, { variant: "fullWidth" })
|
|
838
838
|
] })
|
|
839
839
|
] }),
|
|
840
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: t.track_type ===
|
|
841
|
-
t.track_type !==
|
|
842
|
-
/* @__PURE__ */ e(Be, { account:
|
|
843
|
-
/* @__PURE__ */ e(
|
|
840
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: t.track_type === m.RETIREMENT_TRACK ? n.details_accounts : n.details_account }),
|
|
841
|
+
t.track_type !== m.RETIREMENT_TRACK && d && /* @__PURE__ */ i(U, { children: [
|
|
842
|
+
/* @__PURE__ */ e(Be, { account: d }),
|
|
843
|
+
/* @__PURE__ */ e(E, {})
|
|
844
844
|
] }),
|
|
845
|
-
t.track_type ===
|
|
845
|
+
t.track_type === m.RETIREMENT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
846
846
|
/* @__PURE__ */ e(Bt, { goal: t }),
|
|
847
|
-
/* @__PURE__ */ e(
|
|
847
|
+
/* @__PURE__ */ e(E, {})
|
|
848
848
|
] }),
|
|
849
|
-
t.track_type ===
|
|
849
|
+
t.track_type === m.SAVINGS_TRACK && !t.is_complete && /* @__PURE__ */ e(wt, { goal: t })
|
|
850
850
|
] });
|
|
851
|
-
}),
|
|
852
|
-
const { visibleInvestmentAccounts: n } = j(), { goals:
|
|
851
|
+
}), Ot = K(({ onClose: t }) => {
|
|
852
|
+
const { visibleInvestmentAccounts: n } = j(), { goals: l, common: d } = T(), {
|
|
853
853
|
addGoal: _,
|
|
854
854
|
addRetirementGoal: a,
|
|
855
855
|
deleteGoal: u,
|
|
@@ -859,36 +859,36 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
859
859
|
selectedGoal: o,
|
|
860
860
|
setAlert: h,
|
|
861
861
|
setSelectedGoal: r,
|
|
862
|
-
updateGoal:
|
|
863
|
-
} =
|
|
862
|
+
updateGoal: c
|
|
863
|
+
} = x(), { user: f } = Ie(), [S, C] = y.useState(!1), R = !o?.guid, I = o?.track_type === m.SAVINGS_TRACK && o.is_complete && !o.has_been_spent, D = y.useMemo(() => {
|
|
864
864
|
const G = R ? b : s;
|
|
865
|
-
return n.filter((H) => G.some((
|
|
865
|
+
return n.filter((H) => G.some(($) => $.account_guid === H.guid));
|
|
866
866
|
}, [R, n, b, s]), se = y.useMemo(() => {
|
|
867
867
|
if (!o) return !1;
|
|
868
|
-
const { account_guid: G, track_type: H, name:
|
|
869
|
-
return H ===
|
|
870
|
-
}, [o,
|
|
871
|
-
let W =
|
|
872
|
-
R ? (z = () => ee(), W =
|
|
868
|
+
const { account_guid: G, track_type: H, name: $, amount: O, retirement_age: ne } = o;
|
|
869
|
+
return H === m.SAVINGS_TRACK ? G ? !!$ && !!O : !1 : H === m.RETIREMENT_TRACK ? D.length ? !!$ && !!O && !!ne && !!f.birthday : !1 : !0;
|
|
870
|
+
}, [o, D, f.birthday]);
|
|
871
|
+
let W = d.delete_button, z = () => C(!0);
|
|
872
|
+
R ? (z = () => ee(), W = d.save_button) : I && (z = () => le(), W = l.mark_as_complete_button);
|
|
873
873
|
const ee = async () => {
|
|
874
874
|
if (o) {
|
|
875
875
|
const G = o.track_type;
|
|
876
|
-
G !==
|
|
876
|
+
G !== m.RETIREMENT_TRACK ? await _(o) : G === m.RETIREMENT_TRACK && await a({ ...o, target_amount: o.amount }), h(l.alert_goal_added), r(void 0), G && t?.(G);
|
|
877
877
|
}
|
|
878
878
|
}, te = async () => {
|
|
879
|
-
o && (o.track_type !==
|
|
879
|
+
o && (o.track_type !== m.RETIREMENT_TRACK ? await u(o.guid) : o.track_type === m.RETIREMENT_TRACK && await p(o), h(l.alert_goal_deleted), r(void 0));
|
|
880
880
|
}, le = async () => {
|
|
881
881
|
const G = {
|
|
882
882
|
...o,
|
|
883
883
|
has_been_spent: !0
|
|
884
884
|
};
|
|
885
|
-
await
|
|
885
|
+
await c(G), h(l.alert_goal_completed), r(void 0);
|
|
886
886
|
};
|
|
887
887
|
return /* @__PURE__ */ i(g, { children: [
|
|
888
888
|
/* @__PURE__ */ e(
|
|
889
889
|
F,
|
|
890
890
|
{
|
|
891
|
-
ariaLabelClose:
|
|
891
|
+
ariaLabelClose: d.close_aria,
|
|
892
892
|
hasSecondaryAction: R,
|
|
893
893
|
isOpen: !!o,
|
|
894
894
|
isPrimaryDisabled: !se,
|
|
@@ -897,51 +897,51 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
897
897
|
primaryColor: R || I ? "primary" : "error",
|
|
898
898
|
primaryText: W,
|
|
899
899
|
secondaryColor: "primary",
|
|
900
|
-
title:
|
|
901
|
-
children: o && /* @__PURE__ */ e(
|
|
900
|
+
title: l.goal_details,
|
|
901
|
+
children: o && /* @__PURE__ */ e(Lt, { goal: o })
|
|
902
902
|
}
|
|
903
903
|
),
|
|
904
904
|
/* @__PURE__ */ e(
|
|
905
905
|
tt,
|
|
906
906
|
{
|
|
907
|
-
copy: { close_aria:
|
|
907
|
+
copy: { close_aria: d.close_aria, title: l.delete_goal },
|
|
908
908
|
isOpen: S,
|
|
909
909
|
maxWidth: "xs",
|
|
910
910
|
onClose: () => C(!1),
|
|
911
911
|
onPrimaryAction: te,
|
|
912
912
|
primaryColor: "error",
|
|
913
|
-
primaryText:
|
|
914
|
-
children: /* @__PURE__ */ e(A, { sx: { textWrap: "wrap" }, variant: "Paragraph", children:
|
|
913
|
+
primaryText: d.delete_button,
|
|
914
|
+
children: /* @__PURE__ */ e(A, { sx: { textWrap: "wrap" }, variant: "Paragraph", children: B(l.delete_description, o?.name || "") })
|
|
915
915
|
}
|
|
916
916
|
)
|
|
917
917
|
] });
|
|
918
|
-
}), zn =
|
|
919
|
-
const { onEvent:
|
|
918
|
+
}), zn = K(({ onBackClick: t, sx: n }) => {
|
|
919
|
+
const { onEvent: l } = Ge(), { config: d } = Je(), { isMobile: _ } = be(), { visibleAccounts: a } = j(), { isCopyLoaded: u, isInitialized: p, setSelectedAccounts: b } = Ne(), { goals: s, common: o } = T(), { alert: h, goals: r, goalsLoaded: c, loadGoals: f, monthlyCashFlowProfile: S, setAlert: C, retirmentGoals: R } = x(), [I, D] = y.useState(0), [se, W] = y.useState(!1), z = S?.amount_allocated_for_savings_goals || 0, ee = S?.amount_allocated_for_debt_goals || 0, te = S?.amount_allocated_for_retirement_goals || 0, le = u ? B(
|
|
920
920
|
_ ? s.tab_subtitle_mobile : s.tab_subtitle,
|
|
921
|
-
|
|
922
|
-
) : "", G = u ?
|
|
921
|
+
v(z, "0,0")
|
|
922
|
+
) : "", G = u ? B(
|
|
923
923
|
_ ? s.tab_subtitle_mobile : s.tab_subtitle,
|
|
924
|
-
|
|
925
|
-
) : "", H = u ?
|
|
924
|
+
v(ee, "0,0")
|
|
925
|
+
) : "", H = u ? B(
|
|
926
926
|
_ ? s.tab_subtitle_mobile : s.tab_subtitle,
|
|
927
|
-
|
|
927
|
+
v(te, "0,0")
|
|
928
928
|
) : "";
|
|
929
929
|
y.useEffect(() => {
|
|
930
|
-
b(a),
|
|
930
|
+
b(a), l(Y.GOALS_VIEW);
|
|
931
931
|
}, []), y.useEffect(() => {
|
|
932
932
|
p && f().finally();
|
|
933
933
|
}, [p, z, ee, te]);
|
|
934
|
-
const
|
|
935
|
-
|
|
934
|
+
const $ = () => {
|
|
935
|
+
l(Y.GOALS_CLICK_FILTER);
|
|
936
936
|
}, O = () => {
|
|
937
|
-
W(!0),
|
|
938
|
-
}, ne = (
|
|
939
|
-
W(!1),
|
|
937
|
+
W(!0), l(Y.GOALS_CLICK_ADD);
|
|
938
|
+
}, ne = (X) => {
|
|
939
|
+
W(!1), X === m.SAVINGS_TRACK ? D(0) : X === m.DEBT_TRACK ? D(1) : X === m.RETIREMENT_TRACK && D(2);
|
|
940
940
|
}, Z = y.useMemo(
|
|
941
|
-
() =>
|
|
942
|
-
[r,
|
|
943
|
-
),
|
|
944
|
-
return !
|
|
941
|
+
() => c && (r.length === 0 || r.every(({ track_type: X }) => !X) && R.length === 0),
|
|
942
|
+
[r, c, R]
|
|
943
|
+
), Le = d.show_connections_widget_in_master ? "buttons" : "no-buttons";
|
|
944
|
+
return !c || !u || !p ? /* @__PURE__ */ e(Ke, {}) : /* @__PURE__ */ i(
|
|
945
945
|
gt,
|
|
946
946
|
{
|
|
947
947
|
accountOptions: a,
|
|
@@ -952,7 +952,7 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
952
952
|
onClick: O
|
|
953
953
|
}
|
|
954
954
|
],
|
|
955
|
-
onAccountsFilterClick:
|
|
955
|
+
onAccountsFilterClick: $,
|
|
956
956
|
onBackClick: t,
|
|
957
957
|
sx: n,
|
|
958
958
|
title: s.title,
|
|
@@ -961,7 +961,7 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
961
961
|
/* @__PURE__ */ i(
|
|
962
962
|
Fe,
|
|
963
963
|
{
|
|
964
|
-
onChange: (
|
|
964
|
+
onChange: (X, Oe) => D(Oe),
|
|
965
965
|
sx: { bgcolor: "background.paper" },
|
|
966
966
|
textColor: "primary",
|
|
967
967
|
value: Z ? !1 : I,
|
|
@@ -1005,15 +1005,15 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1005
1005
|
width: 139
|
|
1006
1006
|
}
|
|
1007
1007
|
},
|
|
1008
|
-
variant:
|
|
1008
|
+
variant: Le
|
|
1009
1009
|
}
|
|
1010
1010
|
) : /* @__PURE__ */ i(U, { children: [
|
|
1011
|
-
I === 0 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType:
|
|
1012
|
-
I === 1 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType:
|
|
1013
|
-
I === 2 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType:
|
|
1011
|
+
I === 0 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType: m.SAVINGS_TRACK }),
|
|
1012
|
+
I === 1 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType: m.DEBT_TRACK }),
|
|
1013
|
+
I === 2 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType: m.RETIREMENT_TRACK })
|
|
1014
1014
|
] })
|
|
1015
1015
|
] }),
|
|
1016
|
-
/* @__PURE__ */ e(
|
|
1016
|
+
/* @__PURE__ */ e(Ot, { onClose: ne }),
|
|
1017
1017
|
/* @__PURE__ */ e(
|
|
1018
1018
|
F,
|
|
1019
1019
|
{
|
|
@@ -1028,25 +1028,25 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1028
1028
|
]
|
|
1029
1029
|
}
|
|
1030
1030
|
);
|
|
1031
|
-
}), Wt =
|
|
1032
|
-
const { goals: n } = T(),
|
|
1033
|
-
backgroundColor:
|
|
1031
|
+
}), Wt = K(({ goal: t }) => {
|
|
1032
|
+
const { goals: n } = T(), l = At(), {
|
|
1033
|
+
backgroundColor: d,
|
|
1034
1034
|
color: _,
|
|
1035
1035
|
percentage: a,
|
|
1036
1036
|
projectedText: u
|
|
1037
|
-
} =
|
|
1037
|
+
} = ue(n, t), p = Math.round(a * 100);
|
|
1038
1038
|
let b = /* @__PURE__ */ e(Re, {});
|
|
1039
|
-
return t.track_type ===
|
|
1040
|
-
/* @__PURE__ */ e(ae, { sx: { bgcolor:
|
|
1039
|
+
return t.track_type === m.DEBT_TRACK ? b = /* @__PURE__ */ e(Ee, {}) : t.track_type === m.RETIREMENT_TRACK && (b = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", spacing: 12, sx: { py: 12 }, children: [
|
|
1040
|
+
/* @__PURE__ */ e(ae, { sx: { bgcolor: d, color: _, height: 32, width: 32 }, variant: "rounded", children: b }),
|
|
1041
1041
|
/* @__PURE__ */ i(yt, { sx: { width: "100%" }, children: [
|
|
1042
|
-
/* @__PURE__ */ e(
|
|
1042
|
+
/* @__PURE__ */ e(pe, { fontSize: 15, fontWeight: 600, variant: "body1", children: t.name }),
|
|
1043
1043
|
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: u })
|
|
1044
1044
|
] }),
|
|
1045
1045
|
/* @__PURE__ */ e(
|
|
1046
1046
|
Tt,
|
|
1047
1047
|
{
|
|
1048
|
-
backgroundStrokeColor:
|
|
1049
|
-
color:
|
|
1048
|
+
backgroundStrokeColor: l.palette.border.lighter,
|
|
1049
|
+
color: l.palette.primary.main,
|
|
1050
1050
|
percent: p,
|
|
1051
1051
|
size: 40,
|
|
1052
1052
|
strokeWidth: 3,
|
|
@@ -1054,18 +1054,18 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1054
1054
|
}
|
|
1055
1055
|
)
|
|
1056
1056
|
] });
|
|
1057
|
-
}), Vt = ({ header: t, subText: n, sx:
|
|
1057
|
+
}), Vt = ({ header: t, subText: n, sx: l }) => /* @__PURE__ */ i(
|
|
1058
1058
|
g,
|
|
1059
1059
|
{
|
|
1060
1060
|
sx: {
|
|
1061
1061
|
alignItems: "center",
|
|
1062
1062
|
alignSelf: "center",
|
|
1063
1063
|
px: 24,
|
|
1064
|
-
...
|
|
1064
|
+
...l
|
|
1065
1065
|
},
|
|
1066
1066
|
children: [
|
|
1067
1067
|
/* @__PURE__ */ e(qe, { size: 32 }),
|
|
1068
|
-
/* @__PURE__ */ e(
|
|
1068
|
+
/* @__PURE__ */ e(pe, { fontSize: 15, fontWeight: 600, children: t }),
|
|
1069
1069
|
/* @__PURE__ */ e(
|
|
1070
1070
|
V,
|
|
1071
1071
|
{
|
|
@@ -1077,12 +1077,12 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1077
1077
|
)
|
|
1078
1078
|
]
|
|
1079
1079
|
}
|
|
1080
|
-
), Hn =
|
|
1081
|
-
const { visibleAccounts: n } = j(), { onEvent:
|
|
1080
|
+
), Hn = K(({ onCTAClick: t }) => {
|
|
1081
|
+
const { visibleAccounts: n } = j(), { onEvent: l } = Ge(), { goals: d } = T(), { isInitialized: _, setSelectedAccounts: a, isCopyLoaded: u } = Ne(), { ongoingGoalsForMicroWidget: p, loadGoals: b, goalsLoaded: s } = x();
|
|
1082
1082
|
y.useEffect(() => {
|
|
1083
1083
|
a(n);
|
|
1084
1084
|
}, []), y.useEffect(() => {
|
|
1085
|
-
_ && (b().finally(),
|
|
1085
|
+
_ && (b().finally(), l(Y.GOALS_LOAD_WIDGET, {
|
|
1086
1086
|
state: n?.length ? "default" : "zeroState"
|
|
1087
1087
|
}));
|
|
1088
1088
|
}, [_]);
|
|
@@ -1090,26 +1090,26 @@ const St = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1090
1090
|
() => s && p.length === 0,
|
|
1091
1091
|
[p, s]
|
|
1092
1092
|
), h = () => {
|
|
1093
|
-
|
|
1093
|
+
l(
|
|
1094
1094
|
o ? Y.GOALS_CLICK_GET_STARTED : Y.GOALS_CLICK_VIEW_DETAILS
|
|
1095
1095
|
), t();
|
|
1096
1096
|
};
|
|
1097
|
-
return !s || !u || !_ ? /* @__PURE__ */ e(
|
|
1097
|
+
return !s || !u || !_ ? /* @__PURE__ */ e(Ke, {}) : /* @__PURE__ */ e(
|
|
1098
1098
|
Ct,
|
|
1099
1099
|
{
|
|
1100
1100
|
className: "mx-goals-microwidget",
|
|
1101
|
-
ctaLabel: o ?
|
|
1101
|
+
ctaLabel: o ? d.get_started : d.view_details,
|
|
1102
1102
|
onCTAClick: h,
|
|
1103
|
-
title:
|
|
1103
|
+
title: d.title,
|
|
1104
1104
|
children: o ? /* @__PURE__ */ e(
|
|
1105
1105
|
Vt,
|
|
1106
1106
|
{
|
|
1107
|
-
header:
|
|
1108
|
-
subText:
|
|
1107
|
+
header: d.create_goals_header,
|
|
1108
|
+
subText: d.micro_zero_state_description
|
|
1109
1109
|
}
|
|
1110
|
-
) : /* @__PURE__ */ e(ft, { sx: { justifyContent: "space-between" }, children: p.map((r,
|
|
1110
|
+
) : /* @__PURE__ */ e(ft, { sx: { justifyContent: "space-between" }, children: p.map((r, c) => /* @__PURE__ */ i(y.Fragment, { children: [
|
|
1111
1111
|
/* @__PURE__ */ e(Wt, { goal: r }),
|
|
1112
|
-
|
|
1112
|
+
c !== p.length - 1 && /* @__PURE__ */ e(E, {})
|
|
1113
1113
|
] }, r.guid)) })
|
|
1114
1114
|
}
|
|
1115
1115
|
);
|