@mx-cartographer/experiences 7.9.3 → 7.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{GoalStore-B4LVt_kH.mjs → GoalStore-qiNsUwJa.mjs} +40 -41
- package/dist/budgets/index.es.js +293 -293
- package/dist/common/index.es.js +2 -2
- package/dist/goals/index.es.js +341 -341
- package/package.json +1 -1
package/dist/goals/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as de, T as i, G as
|
|
2
|
-
import { c as $n, d as Xn } from "../GoalStore-
|
|
3
|
-
import { jsxs as
|
|
1
|
+
import { g as de, T as i, G as ce, a as Ve, M as Z, C as Te, b as Pe } from "../GoalStore-qiNsUwJa.mjs";
|
|
2
|
+
import { c as $n, d as Xn } from "../GoalStore-qiNsUwJa.mjs";
|
|
3
|
+
import { jsxs as c, jsx as e, Fragment as $ } from "react/jsx-runtime";
|
|
4
4
|
import T from "react";
|
|
5
5
|
import { observer as D } from "mobx-react-lite";
|
|
6
6
|
import ze from "@mui/material/Alert";
|
|
@@ -8,20 +8,20 @@ import je from "@mui/material/Snackbar";
|
|
|
8
8
|
import g from "@mui/material/Stack";
|
|
9
9
|
import re from "@mui/material/Tab";
|
|
10
10
|
import Fe from "@mui/material/Tabs";
|
|
11
|
-
import { Text as C, H2 as me, H3 as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
11
|
+
import { Text as C, H2 as me, H3 as le, P as H, Icon as $e, InstitutionLogo as te } from "@mxenabled/mxui";
|
|
12
|
+
import _e from "@mui/material/Button";
|
|
13
|
+
import Ce from "@mui/material/Card";
|
|
14
|
+
import Se from "@mui/material/CardActionArea";
|
|
15
|
+
import Re from "@mui/material/CardContent";
|
|
16
|
+
import ge from "@mui/material/Unstable_Grid2";
|
|
17
17
|
import ae from "@mui/material/Avatar";
|
|
18
18
|
import Xe from "@mui/material/CardHeader";
|
|
19
|
-
import { Payments as
|
|
20
|
-
import { u as S, l as G, b as
|
|
21
|
-
import { u as
|
|
19
|
+
import { Payments as Ee, NoteStack as xe, Person as ve, ArrowUpwardAlt as He, CheckCircle as Ue, ChevronRight as V, Icon as fe, ExpandLess as Ye, ExpandMore as Ze, AddBox as Ie, Trophy as qe } from "@mxenabled/mx-icons";
|
|
20
|
+
import { u as S, l as G, b as ue, a as pe, d as z, o as Ge, g as Ne } from "../hooks-ZMp65DFz.mjs";
|
|
21
|
+
import { u as he } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
22
22
|
import { f as I } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
23
23
|
import { S as Je } from "../StatusBar-BK_uYHAB.mjs";
|
|
24
|
-
import
|
|
24
|
+
import v from "@mui/material/Divider";
|
|
25
25
|
import L from "@mui/material/List";
|
|
26
26
|
import { L as q } from "../ListItemAction-CU42h39I.mjs";
|
|
27
27
|
import { C as ke } from "../CurrencyInput-itK0R3wV.mjs";
|
|
@@ -32,23 +32,23 @@ import P from "@mui/material/ListItemAvatar";
|
|
|
32
32
|
import M from "@mui/material/ListItemButton";
|
|
33
33
|
import w from "@mui/material/ListItemText";
|
|
34
34
|
import { b as O } from "../Localization-2MODESHW.mjs";
|
|
35
|
-
import { f as
|
|
35
|
+
import { f as be, D as ye, a as et } from "../Dialog-B4PI-_bL.mjs";
|
|
36
36
|
import { D as J } from "../Drawer-DV4NTsFg.mjs";
|
|
37
37
|
import { g as we } from "../AccountDisplayName-CO7z3v99.mjs";
|
|
38
38
|
import tt from "@mui/material/Collapse";
|
|
39
39
|
import nt from "@mui/material/ListItemIcon";
|
|
40
40
|
import at from "@mui/material/Checkbox";
|
|
41
|
-
import { A as
|
|
41
|
+
import { A as Ae } from "../Account-BiB1F8lL.mjs";
|
|
42
42
|
import { u as ot } from "../useAccountDisplayName-Bot2tb4n.mjs";
|
|
43
43
|
import De from "@mui/material/TextField";
|
|
44
44
|
import { M as rt, I as it, O as st } from "../OriginalBalanceAction-ChGGq5AH.mjs";
|
|
45
|
-
import { getUnixTime as
|
|
46
|
-
import { isValid as
|
|
45
|
+
import { getUnixTime as ct } from "date-fns/getUnixTime";
|
|
46
|
+
import { isValid as lt } from "date-fns/isValid";
|
|
47
47
|
import { AdapterDateFns as dt } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
48
48
|
import { DatePicker as mt } from "@mui/x-date-pickers";
|
|
49
|
-
import { LocalizationProvider as
|
|
49
|
+
import { LocalizationProvider as _t } from "@mui/x-date-pickers/LocalizationProvider";
|
|
50
50
|
import { u as Ke } from "../useWidgetLoadTimer-hIOioiKx.mjs";
|
|
51
|
-
import { A as X, W as
|
|
51
|
+
import { A as X, W as ut } from "../WidgetContainer-BbPS3Yxz.mjs";
|
|
52
52
|
import { L as Me } from "../Loader-DUaFpDGv.mjs";
|
|
53
53
|
import { E as pt } from "../EmptyState-DoxNUae-.mjs";
|
|
54
54
|
import ht from "@mui/material/Stack/Stack";
|
|
@@ -57,7 +57,7 @@ import yt from "@mui/material/styles/useTheme";
|
|
|
57
57
|
import { S as gt } from "../SingleSegmentDonut-BgbLgwHi.mjs";
|
|
58
58
|
import { M as ft } from "../MicroWidgetContainer-B2hO9rOG.mjs";
|
|
59
59
|
function ie({ title: t, subtitle: n }) {
|
|
60
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ c(g, { children: [
|
|
61
61
|
/* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: t }),
|
|
62
62
|
/* @__PURE__ */ e(C, { sx: { fontWeight: 400 }, variant: "Body", children: n })
|
|
63
63
|
] });
|
|
@@ -66,22 +66,22 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
66
66
|
/(\d+)(?:\.0+|(\.\d*?[1-9])0*)([a-zA-Z]* ?\$?)/g,
|
|
67
67
|
"$1$2$3"
|
|
68
68
|
) : I(t, "0,0.00"), Le = D(
|
|
69
|
-
({ goal: t, isInDrawer: n = !1, onClick:
|
|
70
|
-
const { goals:
|
|
69
|
+
({ goal: t, isInDrawer: n = !1, onClick: _ }) => {
|
|
70
|
+
const { goals: l } = S(), { isMobile: u, isTablet: r } = he(), d = u || r, {
|
|
71
71
|
backgroundColor: s,
|
|
72
|
-
color:
|
|
73
|
-
percentage:
|
|
72
|
+
color: p,
|
|
73
|
+
percentage: h,
|
|
74
74
|
percentageText: o,
|
|
75
75
|
projectedText: a
|
|
76
|
-
} = de(
|
|
76
|
+
} = de(l, t), b = t.track_type === i.DEBT_TRACK ? t.initial_amount : t.amount, m = [
|
|
77
77
|
{
|
|
78
78
|
color: s,
|
|
79
|
-
percentage: `${
|
|
79
|
+
percentage: `${h}`
|
|
80
80
|
}
|
|
81
81
|
];
|
|
82
|
-
let f = /* @__PURE__ */ e(
|
|
83
|
-
return t.track_type === i.DEBT_TRACK ? f = /* @__PURE__ */ e(
|
|
84
|
-
|
|
82
|
+
let f = /* @__PURE__ */ e(Ee, {});
|
|
83
|
+
return t.track_type === i.DEBT_TRACK ? f = /* @__PURE__ */ e(xe, {}) : t.track_type === i.RETIREMENT_TRACK && (f = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ e(
|
|
84
|
+
Ce,
|
|
85
85
|
{
|
|
86
86
|
elevation: 2,
|
|
87
87
|
sx: {
|
|
@@ -90,21 +90,21 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
90
90
|
outlineColor: "primary.main"
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
|
-
children: /* @__PURE__ */
|
|
93
|
+
children: /* @__PURE__ */ c(Se, { disabled: !_, onClick: _, children: [
|
|
94
94
|
/* @__PURE__ */ e(
|
|
95
95
|
Xe,
|
|
96
96
|
{
|
|
97
|
-
avatar: /* @__PURE__ */ e(ae, { sx: { bgcolor: s, color:
|
|
97
|
+
avatar: /* @__PURE__ */ e(ae, { sx: { bgcolor: s, color: p, height: 48, width: 48 }, variant: "rounded", children: f }),
|
|
98
98
|
subheader: /* @__PURE__ */ e(C, { variant: n || d ? "H3" : "H2", children: `${I(t.current_amount, d ? "0,0" : "0,0.00")} / ${At(
|
|
99
|
-
|
|
99
|
+
b,
|
|
100
100
|
d
|
|
101
101
|
)}` }),
|
|
102
102
|
title: /* @__PURE__ */ e(me, { color: "text.secondary", fontWeight: 400, variant: "Body", children: t.name })
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
|
-
/* @__PURE__ */ e(
|
|
106
|
-
/* @__PURE__ */ e(Je, { data:
|
|
107
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ e(Re, { sx: { pt: 0 }, children: /* @__PURE__ */ c(g, { gap: 6, children: [
|
|
106
|
+
/* @__PURE__ */ e(Je, { data: m, height: 24 }),
|
|
107
|
+
/* @__PURE__ */ c(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
108
108
|
/* @__PURE__ */ e(C, { color: "text.secondary", variant: "XSmall", children: o }),
|
|
109
109
|
t.projected_to_complete_at && /* @__PURE__ */ e(C, { color: "text.secondary", variant: "XSmall", children: a })
|
|
110
110
|
] })
|
|
@@ -114,17 +114,17 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
), Tt = D(({ trackType: t }) => {
|
|
117
|
-
const { goals: n } = S(), { setAlert:
|
|
117
|
+
const { goals: n } = S(), { setAlert: _, monthlyCashFlowProfile: l, updateMonthlyCashFlowProfile: u } = G(), r = T.useMemo(() => {
|
|
118
118
|
let o = 0;
|
|
119
|
-
return t === i.SAVINGS_TRACK ? o =
|
|
120
|
-
}, [
|
|
119
|
+
return t === i.SAVINGS_TRACK ? o = l?.amount_allocated_for_savings_goals || 0 : t === i.DEBT_TRACK ? o = l?.amount_allocated_for_debt_goals || 0 : t === i.RETIREMENT_TRACK && (o = l?.amount_allocated_for_retirement_goals || 0), o;
|
|
120
|
+
}, [l]);
|
|
121
121
|
T.useEffect(() => {
|
|
122
122
|
s(r);
|
|
123
123
|
}, [r]);
|
|
124
|
-
const [d, s] = T.useState(r),
|
|
125
|
-
if (
|
|
126
|
-
const o = { ...
|
|
127
|
-
t === i.SAVINGS_TRACK ? o.amount_allocated_for_savings_goals = d : t === i.DEBT_TRACK ? o.amount_allocated_for_debt_goals = d : t === i.RETIREMENT_TRACK && (o.amount_allocated_for_retirement_goals = d), await
|
|
124
|
+
const [d, s] = T.useState(r), p = d < 0 || d > 99999999, h = async () => {
|
|
125
|
+
if (l) {
|
|
126
|
+
const o = { ...l };
|
|
127
|
+
t === i.SAVINGS_TRACK ? o.amount_allocated_for_savings_goals = d : t === i.DEBT_TRACK ? o.amount_allocated_for_debt_goals = d : t === i.RETIREMENT_TRACK && (o.amount_allocated_for_retirement_goals = d), await u(o), _(n.alert_contribution_updated);
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
return /* @__PURE__ */ e(g, { bgcolor: "background.paper", children: /* @__PURE__ */ e(
|
|
@@ -133,7 +133,7 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
133
133
|
isSaveDisabled: !d || isNaN(d),
|
|
134
134
|
label: n.contribution_label,
|
|
135
135
|
onCancel: () => s(r),
|
|
136
|
-
onSave:
|
|
136
|
+
onSave: h,
|
|
137
137
|
primaryText: n.contribution_label,
|
|
138
138
|
secondaryText: I(r, "0,0.00"),
|
|
139
139
|
children: /* @__PURE__ */ e(
|
|
@@ -141,7 +141,7 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
141
141
|
{
|
|
142
142
|
amount: d,
|
|
143
143
|
autoFocus: !0,
|
|
144
|
-
error:
|
|
144
|
+
error: p,
|
|
145
145
|
fullWidth: !0,
|
|
146
146
|
minAmount: 0,
|
|
147
147
|
setAmount: (o) => s(isNaN(Number(o)) ? d : Number(o)),
|
|
@@ -150,9 +150,9 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
150
150
|
)
|
|
151
151
|
}
|
|
152
152
|
) });
|
|
153
|
-
}), Ct = ({ goal: t, index: n, onUpClick:
|
|
154
|
-
const { goals:
|
|
155
|
-
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */
|
|
153
|
+
}), Ct = ({ goal: t, index: n, onUpClick: _ }) => {
|
|
154
|
+
const { goals: l } = S(), { percentage: u } = de(l, t), r = t.goal_type === ce.KEEP_BALANCE_BELOW || t.has_been_spent ? l.goal_completed : O(l.goal_percentage_reached, `${u * 100}`);
|
|
155
|
+
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(
|
|
156
156
|
M,
|
|
157
157
|
{
|
|
158
158
|
disableRipple: !0,
|
|
@@ -167,17 +167,17 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
167
167
|
justifyContent: "center",
|
|
168
168
|
".MuiAvatar-root": { height: "16px", width: "16px" }
|
|
169
169
|
},
|
|
170
|
-
children: t.track_type === i.SAVINGS_TRACK ? /* @__PURE__ */ e(Qe, { onClick: () =>
|
|
170
|
+
children: t.track_type === i.SAVINGS_TRACK ? /* @__PURE__ */ e(Qe, { onClick: () => _?.(t), children: /* @__PURE__ */ e(He, { color: "primary", size: 24 }) }) : /* @__PURE__ */ e(ae, { sx: { bgcolor: "text.primary", height: "16px", width: "16px" }, children: /* @__PURE__ */ e(C, { bold: !0, variant: "XSmall", children: n + 1 }) })
|
|
171
171
|
}
|
|
172
172
|
),
|
|
173
|
-
/* @__PURE__ */ e(w, { primaryTypographyProps: { variant: "Body" }, children: /* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ e(w, { primaryTypographyProps: { variant: "Body" }, children: /* @__PURE__ */ c(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
174
|
+
/* @__PURE__ */ c(g, { sx: { maxWidth: "70%" }, children: [
|
|
175
175
|
/* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: t.name }),
|
|
176
176
|
/* @__PURE__ */ e(C, { variant: "XSmall", children: t.is_complete ? r : O(
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
l.goal_projection,
|
|
178
|
+
be(
|
|
179
179
|
ne(t.projected_to_complete_at || 0),
|
|
180
|
-
|
|
180
|
+
ye.MONTH_SHORT_YEAR
|
|
181
181
|
)
|
|
182
182
|
) })
|
|
183
183
|
] }),
|
|
@@ -188,21 +188,21 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
188
188
|
) });
|
|
189
189
|
}, St = ({ goal: t }) => {
|
|
190
190
|
const { goals: n } = S();
|
|
191
|
-
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */
|
|
191
|
+
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(
|
|
192
192
|
M,
|
|
193
193
|
{
|
|
194
194
|
disableRipple: !0,
|
|
195
195
|
sx: { ":hover": { backgroundColor: "unset" }, cursor: "default" },
|
|
196
196
|
children: [
|
|
197
197
|
/* @__PURE__ */ e(P, { sx: { alignItems: "center", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ e(Ue, { color: "success", filled: !0, size: 20 }) }),
|
|
198
|
-
/* @__PURE__ */ e(w, { primaryTypographyProps: { variant: "Body" }, children: /* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ e(w, { primaryTypographyProps: { variant: "Body" }, children: /* @__PURE__ */ c(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
199
|
+
/* @__PURE__ */ c(g, { children: [
|
|
200
200
|
/* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: t.name }),
|
|
201
201
|
/* @__PURE__ */ e(C, { variant: "XSmall", children: O(
|
|
202
202
|
n.completed_label,
|
|
203
|
-
|
|
203
|
+
be(
|
|
204
204
|
ne(t.completed_at || 0),
|
|
205
|
-
|
|
205
|
+
ye.MONTH_SHORT_YEAR
|
|
206
206
|
)
|
|
207
207
|
) })
|
|
208
208
|
] }),
|
|
@@ -212,51 +212,51 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
212
212
|
}
|
|
213
213
|
) }, t.guid);
|
|
214
214
|
}, Rt = ({ trackType: t }) => {
|
|
215
|
-
const { goals: n, common:
|
|
215
|
+
const { goals: n, common: _ } = S(), { loadGoals: l, orderedGoals: u, reorderGoals: r } = G(), d = u.filter((y) => y.track_type === t), s = d.filter(
|
|
216
216
|
(y) => y.track_type === i.SAVINGS_TRACK && !y.has_been_spent || y.track_type !== i.SAVINGS_TRACK && !y.is_complete
|
|
217
|
-
),
|
|
217
|
+
), p = d.filter(
|
|
218
218
|
(y) => y.track_type === i.SAVINGS_TRACK && y.has_been_spent || y.track_type !== i.SAVINGS_TRACK && y.is_complete
|
|
219
|
-
), [
|
|
220
|
-
let a = n.manage_saving_goals,
|
|
221
|
-
t === i.DEBT_TRACK ? (a = n.manage_debt_goals,
|
|
222
|
-
const
|
|
223
|
-
const A = [...s],
|
|
224
|
-
let N =
|
|
225
|
-
N < 0 && (N = A.length - 1), A.splice(N, 0, A.splice(
|
|
219
|
+
), [h, o] = T.useState(!1);
|
|
220
|
+
let a = n.manage_saving_goals, b = n.manage_saving_drawer_title, m = n.manage_saving_title, f = n.manage_saving_description;
|
|
221
|
+
t === i.DEBT_TRACK ? (a = n.manage_debt_goals, b = n.manage_debt_drawer_title, m = n.manage_debt_title, f = n.manage_debt_description) : t === i.RETIREMENT_TRACK && (a = n.manage_retirement_goals, b = n.manage_retirement_drawer_title, m = n.manage_retirement_title, f = n.manage_retirement_description);
|
|
222
|
+
const R = async (y) => {
|
|
223
|
+
const A = [...s], E = A.findIndex((K) => K.guid === y.guid);
|
|
224
|
+
let N = E - 1;
|
|
225
|
+
N < 0 && (N = A.length - 1), A.splice(N, 0, A.splice(E, 1)[0]);
|
|
226
226
|
for (let K = 0; K < A.length; K++)
|
|
227
227
|
A[K].position = K + 1;
|
|
228
|
-
await r(A), await
|
|
228
|
+
await r(A), await l();
|
|
229
229
|
};
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
-
/* @__PURE__ */ e(
|
|
230
|
+
return /* @__PURE__ */ c(g, { children: [
|
|
231
|
+
/* @__PURE__ */ e(_e, { endIcon: /* @__PURE__ */ e(V, {}), onClick: () => o(!0), children: a }),
|
|
232
232
|
/* @__PURE__ */ e(
|
|
233
233
|
J,
|
|
234
234
|
{
|
|
235
|
-
ariaLabelClose:
|
|
236
|
-
isOpen:
|
|
235
|
+
ariaLabelClose: _.close_aria,
|
|
236
|
+
isOpen: h,
|
|
237
237
|
onClose: () => o(!1),
|
|
238
|
-
title:
|
|
239
|
-
children: /* @__PURE__ */
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
/* @__PURE__ */ e(
|
|
238
|
+
title: b,
|
|
239
|
+
children: /* @__PURE__ */ c(g, { children: [
|
|
240
|
+
/* @__PURE__ */ c(g, { m: 24, children: [
|
|
241
|
+
/* @__PURE__ */ e(le, { children: m }),
|
|
242
242
|
/* @__PURE__ */ e(H, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "ParagraphSmall", children: f })
|
|
243
243
|
] }),
|
|
244
244
|
/* @__PURE__ */ e(Tt, { trackType: t }),
|
|
245
245
|
/* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "XSmall", children: n.goal_priority }),
|
|
246
246
|
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: s.map((y, A) => {
|
|
247
|
-
const
|
|
248
|
-
return /* @__PURE__ */
|
|
249
|
-
/* @__PURE__ */ e(Ct, { goal: y, index: A, onUpClick:
|
|
250
|
-
/* @__PURE__ */ e(
|
|
247
|
+
const E = A >= s.length - 1;
|
|
248
|
+
return /* @__PURE__ */ c(g, { children: [
|
|
249
|
+
/* @__PURE__ */ e(Ct, { goal: y, index: A, onUpClick: R }),
|
|
250
|
+
/* @__PURE__ */ e(v, { variant: E ? "fullWidth" : "inset" })
|
|
251
251
|
] }, `ongoing-${y.guid}`);
|
|
252
252
|
}) }),
|
|
253
|
-
t !== i.RETIREMENT_TRACK &&
|
|
253
|
+
t !== i.RETIREMENT_TRACK && p.length > 0 && /* @__PURE__ */ c(g, { children: [
|
|
254
254
|
/* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "XSmall", children: n.complete_title }),
|
|
255
|
-
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children:
|
|
256
|
-
const
|
|
257
|
-
return /* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: p.map((y, A) => {
|
|
256
|
+
const E = A > s.length - 1;
|
|
257
|
+
return /* @__PURE__ */ c(g, { children: [
|
|
258
258
|
/* @__PURE__ */ e(St, { goal: y }),
|
|
259
|
-
/* @__PURE__ */ e(
|
|
259
|
+
/* @__PURE__ */ e(v, { variant: E ? "fullWidth" : "inset" })
|
|
260
260
|
] }, `complete-${y.guid}`);
|
|
261
261
|
}) })
|
|
262
262
|
] })
|
|
@@ -265,22 +265,22 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
265
265
|
)
|
|
266
266
|
] });
|
|
267
267
|
}, se = D(({ trackType: t, onAddGoals: n }) => {
|
|
268
|
-
const { isMobile:
|
|
269
|
-
(a) => a.track_type === t && (a.track_type !== i.RETIREMENT_TRACK &&
|
|
270
|
-
),
|
|
268
|
+
const { isMobile: _ } = he(), { goals: l } = S(), { selectedAccountGuids: u } = ue(), { orderedGoals: r, setSelectedGoal: d } = G(), s = r.filter(
|
|
269
|
+
(a) => a.track_type === t && (a.track_type !== i.RETIREMENT_TRACK && u.includes(a.account_guid) || a.track_type === i.RETIREMENT_TRACK)
|
|
270
|
+
), p = s.filter(
|
|
271
271
|
(a) => a.track_type === i.SAVINGS_TRACK && !a.has_been_spent || a.track_type !== i.SAVINGS_TRACK && !a.is_complete
|
|
272
|
-
),
|
|
272
|
+
), h = s.filter(
|
|
273
273
|
(a) => a.track_type === i.SAVINGS_TRACK && a.has_been_spent || a.track_type !== i.SAVINGS_TRACK && a.is_complete
|
|
274
|
-
), o = t === i.DEBT_TRACK ?
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */ e(
|
|
274
|
+
), o = t === i.DEBT_TRACK ? l.zero_state_complete_debt : l.zero_state_complete_savings;
|
|
275
|
+
return /* @__PURE__ */ c(g, { mt: 16, mx: _ ? 24 : 0, children: [
|
|
276
|
+
/* @__PURE__ */ c(g, { alignItems: "center", direction: "row", justifyContent: "space-between", mb: 8, children: [
|
|
277
|
+
/* @__PURE__ */ e(le, { color: "text.secondary", variant: "Small", children: l.ongoing_title }),
|
|
278
278
|
/* @__PURE__ */ e(Rt, { trackType: t })
|
|
279
279
|
] }),
|
|
280
|
-
|
|
280
|
+
p.length > 0 ? /* @__PURE__ */ e(ge, { container: !0, spacing: 24, children: p.map((a, b, m) => (
|
|
281
281
|
// Goal should be full width in mobile or if it's the first goal (unless there are 2)
|
|
282
|
-
/* @__PURE__ */ e(
|
|
283
|
-
)) }) : /* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ e(ge, { xs: _ || b === 0 && m.length !== 2 ? 12 : 6, children: /* @__PURE__ */ e(Le, { goal: a, onClick: () => d(a) }, a.guid) }, b)
|
|
283
|
+
)) }) : /* @__PURE__ */ c(
|
|
284
284
|
g,
|
|
285
285
|
{
|
|
286
286
|
alignItems: "center",
|
|
@@ -301,16 +301,16 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
301
301
|
width: { sm: 381 }
|
|
302
302
|
}),
|
|
303
303
|
variant: "Small",
|
|
304
|
-
children: Ve(t,
|
|
304
|
+
children: Ve(t, l)
|
|
305
305
|
}
|
|
306
306
|
),
|
|
307
|
-
/* @__PURE__ */ e(
|
|
307
|
+
/* @__PURE__ */ e(_e, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children: l.add_goals_button })
|
|
308
308
|
]
|
|
309
309
|
}
|
|
310
310
|
),
|
|
311
|
-
t !== i.RETIREMENT_TRACK && /* @__PURE__ */
|
|
312
|
-
/* @__PURE__ */ e(
|
|
313
|
-
|
|
311
|
+
t !== i.RETIREMENT_TRACK && /* @__PURE__ */ c(g, { gap: 16, mt: 48, children: [
|
|
312
|
+
/* @__PURE__ */ e(le, { color: "text.secondary", variant: "Small", children: l.complete_title }),
|
|
313
|
+
h.length === 0 && /* @__PURE__ */ e(g, { alignItems: "center", bgcolor: "background.default", borderRadius: 2, py: 18, children: /* @__PURE__ */ e(
|
|
314
314
|
H,
|
|
315
315
|
{
|
|
316
316
|
sx: (a) => ({
|
|
@@ -324,8 +324,8 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
324
324
|
children: o
|
|
325
325
|
}
|
|
326
326
|
) }),
|
|
327
|
-
|
|
328
|
-
/* @__PURE__ */
|
|
327
|
+
h.map((a) => /* @__PURE__ */ e(Ce, { elevation: 2, children: /* @__PURE__ */ e(Se, { onClick: () => d(a), children: /* @__PURE__ */ e(Re, { sx: { ":last-child": { pb: 16 } }, children: /* @__PURE__ */ c(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
328
|
+
/* @__PURE__ */ c(g, { alignItems: "center", direction: "row", gap: 6, children: [
|
|
329
329
|
/* @__PURE__ */ e($e, { color: "success", fill: !0, name: "check_circle", size: 20 }),
|
|
330
330
|
/* @__PURE__ */ e(C, { color: "text.secondary", variant: "Body", children: a.name })
|
|
331
331
|
] }),
|
|
@@ -334,62 +334,62 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
334
334
|
] })
|
|
335
335
|
] });
|
|
336
336
|
}), Et = ({ goalType: t, onClick: n }) => {
|
|
337
|
-
const { goals:
|
|
338
|
-
return /* @__PURE__ */ e(g, { children: /* @__PURE__ */
|
|
339
|
-
/* @__PURE__ */ e(k, { children: /* @__PURE__ */
|
|
337
|
+
const { goals: _ } = S(), { bgcolor: l, icon: u, label: r, description: d, subTypes: s, type: p } = t, [h, o] = T.useState(!1), a = s.length > 0;
|
|
338
|
+
return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ c(L, { sx: { bgcolor: "background.paper" }, children: [
|
|
339
|
+
/* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(
|
|
340
340
|
M,
|
|
341
341
|
{
|
|
342
|
-
onClick: a ? () => o(!
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
342
|
+
onClick: a ? () => o(!h) : () => n(
|
|
343
|
+
p === i.RETIREMENT_TRACK ? _.retirement : "",
|
|
344
|
+
p === i.RETIREMENT_TRACK ? Z.RETIREMENT : Z.OTHER,
|
|
345
|
+
p
|
|
346
346
|
),
|
|
347
347
|
children: [
|
|
348
|
-
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(ae, { sx: { bgcolor:
|
|
348
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(ae, { sx: { bgcolor: l }, variant: "rounded", children: /* @__PURE__ */ e(fe, { name: u, sx: { color: "grey.900" } }) }) }),
|
|
349
349
|
/* @__PURE__ */ e(w, { primary: r, secondary: d, sx: { mr: 24 } }),
|
|
350
350
|
!a && /* @__PURE__ */ e(V, {}),
|
|
351
|
-
a && (
|
|
351
|
+
a && (h ? /* @__PURE__ */ e(Ye, {}) : /* @__PURE__ */ e(Ze, {}))
|
|
352
352
|
]
|
|
353
353
|
}
|
|
354
354
|
) }),
|
|
355
|
-
/* @__PURE__ */ e(
|
|
356
|
-
a && /* @__PURE__ */ e(tt, { in:
|
|
357
|
-
/* @__PURE__ */ e(nt, { sx: { mr: 8 }, children: /* @__PURE__ */ e(
|
|
355
|
+
/* @__PURE__ */ e(v, { variant: "inset" }),
|
|
356
|
+
a && /* @__PURE__ */ e(tt, { in: h, children: /* @__PURE__ */ e(L, { sx: { bgcolor: "background.default" }, children: s.map((b, m) => /* @__PURE__ */ e(k, { sx: { pl: 48 }, children: /* @__PURE__ */ c(M, { onClick: () => n(b.label, b.metaType, p), children: [
|
|
357
|
+
/* @__PURE__ */ e(nt, { sx: { mr: 8 }, children: /* @__PURE__ */ e(fe, { name: b.icon }) }),
|
|
358
358
|
/* @__PURE__ */ e(
|
|
359
359
|
w,
|
|
360
360
|
{
|
|
361
|
-
primary:
|
|
361
|
+
primary: b.label,
|
|
362
362
|
primaryTypographyProps: { variant: "Body" }
|
|
363
363
|
}
|
|
364
364
|
),
|
|
365
365
|
/* @__PURE__ */ e(V, {})
|
|
366
|
-
] }) },
|
|
366
|
+
] }) }, m)) }) })
|
|
367
367
|
] }) });
|
|
368
368
|
}, Be = ({
|
|
369
369
|
accounts: t,
|
|
370
370
|
isOpen: n,
|
|
371
|
-
onClose:
|
|
372
|
-
onSave:
|
|
373
|
-
title:
|
|
371
|
+
onClose: _,
|
|
372
|
+
onSave: l,
|
|
373
|
+
title: u
|
|
374
374
|
}) => {
|
|
375
|
-
const { goals: r, common: d } = S(), { config: s } =
|
|
376
|
-
const
|
|
377
|
-
|
|
375
|
+
const { goals: r, common: d } = S(), { config: s } = pe(), [p, h] = T.useState([]), o = (a) => {
|
|
376
|
+
const b = p.findIndex((f) => f.guid === a.guid), m = [...p];
|
|
377
|
+
b >= 0 ? m.splice(b, 1) : m.push(a), h(m);
|
|
378
378
|
};
|
|
379
|
-
return /* @__PURE__ */
|
|
379
|
+
return /* @__PURE__ */ c(
|
|
380
380
|
J,
|
|
381
381
|
{
|
|
382
382
|
ariaLabelClose: d.close_aria,
|
|
383
383
|
isOpen: n,
|
|
384
|
-
onClose:
|
|
385
|
-
onPrimaryAction: () =>
|
|
386
|
-
title:
|
|
384
|
+
onClose: _,
|
|
385
|
+
onPrimaryAction: () => l(p),
|
|
386
|
+
title: u,
|
|
387
387
|
children: [
|
|
388
388
|
/* @__PURE__ */ e(H, { color: "text.secondary", sx: { mx: 24, my: 12 }, children: r.select_debt_accounts_description }),
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */ e(
|
|
391
|
-
t.map((a,
|
|
392
|
-
/* @__PURE__ */ e(k, { children: /* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ c(L, { sx: { bgcolor: "background.white" }, children: [
|
|
390
|
+
/* @__PURE__ */ e(v, { variant: "fullWidth" }),
|
|
391
|
+
t.map((a, b) => /* @__PURE__ */ c(T.Fragment, { children: [
|
|
392
|
+
/* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(M, { onClick: () => o(a), children: [
|
|
393
393
|
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
394
394
|
te,
|
|
395
395
|
{
|
|
@@ -406,13 +406,13 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
406
406
|
secondary: I(a.balance || 0, "0,0.00")
|
|
407
407
|
}
|
|
408
408
|
),
|
|
409
|
-
/* @__PURE__ */ e(at, { checked:
|
|
409
|
+
/* @__PURE__ */ e(at, { checked: p.some((m) => m.guid === a.guid) })
|
|
410
410
|
] }) }),
|
|
411
|
-
/* @__PURE__ */ e(
|
|
411
|
+
/* @__PURE__ */ e(v, { variant: b < t.length - 1 ? "inset" : "fullWidth" })
|
|
412
412
|
] }, a.guid))
|
|
413
413
|
] }),
|
|
414
|
-
/* @__PURE__ */ e(
|
|
415
|
-
|
|
414
|
+
s.show_connections_widget_in_master && /* @__PURE__ */ e(
|
|
415
|
+
Te,
|
|
416
416
|
{
|
|
417
417
|
description: r.connect_description,
|
|
418
418
|
label: r.connect_button,
|
|
@@ -423,52 +423,52 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
423
423
|
}
|
|
424
424
|
);
|
|
425
425
|
}, xt = ({ onClose: t }) => {
|
|
426
|
-
const { goals: n } = S(), { addGoal:
|
|
427
|
-
|
|
426
|
+
const { goals: n } = S(), { addGoal: _, debtGoals: l, setAlert: u, setSelectedGoal: r } = G(), { config: d } = pe(), { visibleDebtAccounts: s } = z(), [p, h] = T.useState(!1), o = Pe(n), a = (m, f, R) => {
|
|
427
|
+
R === i.DEBT_TRACK ? h(!0) : r({
|
|
428
428
|
amount: 0,
|
|
429
429
|
current_amount: 0,
|
|
430
|
-
goal_type:
|
|
430
|
+
goal_type: ce.SAVE_AMOUNT,
|
|
431
431
|
initial_amount: 0,
|
|
432
432
|
meta_type: f,
|
|
433
|
-
name:
|
|
434
|
-
track_type:
|
|
433
|
+
name: m,
|
|
434
|
+
track_type: R
|
|
435
435
|
});
|
|
436
|
-
},
|
|
437
|
-
for (const f of
|
|
438
|
-
let
|
|
439
|
-
f.account_type ===
|
|
436
|
+
}, b = async (m) => {
|
|
437
|
+
for (const f of m) {
|
|
438
|
+
let R = Z.CREDIT_CARD;
|
|
439
|
+
f.account_type === Ae.LOAN ? R = Z.LOANS : f.account_type === Ae.LINE_OF_CREDIT && (R = Z.LINE_OF_CREDIT), await _({
|
|
440
440
|
account_guid: f.guid,
|
|
441
441
|
amount: 0,
|
|
442
442
|
current_amount: 0,
|
|
443
|
-
goal_type:
|
|
443
|
+
goal_type: ce.KEEP_BALANCE_BELOW,
|
|
444
444
|
initial_amount: f.balance || 0,
|
|
445
445
|
interest_rate: f.interest_rate || 0,
|
|
446
|
-
meta_type:
|
|
446
|
+
meta_type: R,
|
|
447
447
|
monthly_payment: f.minimum_payment || 0,
|
|
448
448
|
name: we(f, {
|
|
449
449
|
allowNickname: d?.show_account_nicknames_in_master
|
|
450
450
|
}),
|
|
451
451
|
track_type: i.DEBT_TRACK
|
|
452
|
-
}),
|
|
452
|
+
}), u(n.alert_goal_added);
|
|
453
453
|
}
|
|
454
|
-
|
|
454
|
+
h(!1), t?.(i.DEBT_TRACK);
|
|
455
455
|
};
|
|
456
|
-
return /* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: o.map((
|
|
456
|
+
return /* @__PURE__ */ c(g, { children: [
|
|
457
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: o.map((m, f) => /* @__PURE__ */ e(Et, { goalType: m, onClick: a }, f)) }),
|
|
458
458
|
/* @__PURE__ */ e(
|
|
459
459
|
Be,
|
|
460
460
|
{
|
|
461
|
-
accounts: s.filter((
|
|
462
|
-
isOpen:
|
|
463
|
-
onClose: () =>
|
|
464
|
-
onSave:
|
|
461
|
+
accounts: s.filter((m) => !l.find((f) => f.account_guid === m.guid)),
|
|
462
|
+
isOpen: p,
|
|
463
|
+
onClose: () => h(!1),
|
|
464
|
+
onSave: b,
|
|
465
465
|
title: n.select_debt_accounts_title
|
|
466
466
|
}
|
|
467
467
|
)
|
|
468
468
|
] });
|
|
469
469
|
}, Oe = ({ account: t }) => {
|
|
470
470
|
const n = ot(t);
|
|
471
|
-
return /* @__PURE__ */
|
|
471
|
+
return /* @__PURE__ */ c(k, { sx: { bgcolor: "background.paper", p: 24 }, children: [
|
|
472
472
|
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
473
473
|
te,
|
|
474
474
|
{
|
|
@@ -485,10 +485,10 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
485
485
|
)
|
|
486
486
|
] });
|
|
487
487
|
}, vt = D(({ goal: t }) => {
|
|
488
|
-
const { goals: n } = S(), { setAlert:
|
|
489
|
-
const
|
|
490
|
-
t.amount = d,
|
|
491
|
-
},
|
|
488
|
+
const { goals: n } = S(), { setAlert: _, setSelectedGoal: l, updateGoal: u, updateRetirementGoal: r } = G(), [d, s] = T.useState(t.amount), p = !t.guid, h = d < 0 || d > 9999999999e-2, o = t.track_type === i.SAVINGS_TRACK && t.has_been_spent || t.track_type !== i.SAVINGS_TRACK && t.is_complete, a = async () => {
|
|
489
|
+
const m = { ...t, amount: d };
|
|
490
|
+
t.amount = d, p ? l(m) : (t.track_type !== i.RETIREMENT_TRACK ? await u(m) : await r(m), _(n.alert_goal_updated_amount));
|
|
491
|
+
}, b = () => {
|
|
492
492
|
setTimeout(() => {
|
|
493
493
|
s(t.amount);
|
|
494
494
|
}, 250);
|
|
@@ -497,102 +497,102 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
497
497
|
q,
|
|
498
498
|
{
|
|
499
499
|
isDisabled: o,
|
|
500
|
-
isSaveDisabled:
|
|
500
|
+
isSaveDisabled: h,
|
|
501
501
|
label: n.details_amount_to_save,
|
|
502
|
-
onCancel:
|
|
502
|
+
onCancel: b,
|
|
503
503
|
onSave: a,
|
|
504
504
|
primaryText: n.details_amount_to_save,
|
|
505
505
|
secondaryText: I(t.amount, "0,0"),
|
|
506
|
-
zeroStateText:
|
|
506
|
+
zeroStateText: p && t.amount === 0 ? n.add_amount : void 0,
|
|
507
507
|
children: /* @__PURE__ */ e(
|
|
508
508
|
ke,
|
|
509
509
|
{
|
|
510
510
|
amount: d,
|
|
511
511
|
autoFocus: !0,
|
|
512
|
-
error:
|
|
512
|
+
error: h,
|
|
513
513
|
fullWidth: !0,
|
|
514
514
|
minAmount: 0,
|
|
515
|
-
setAmount: (
|
|
515
|
+
setAmount: (m) => s(isNaN(Number(m)) ? d : Number(m)),
|
|
516
516
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
517
517
|
}
|
|
518
518
|
)
|
|
519
519
|
}
|
|
520
520
|
);
|
|
521
521
|
}), It = ({ goal: t }) => {
|
|
522
|
-
const { visibleCheckingAccounts: n, visibleSavingsAccounts:
|
|
523
|
-
const
|
|
524
|
-
|
|
522
|
+
const { visibleCheckingAccounts: n, visibleSavingsAccounts: _ } = z(), { accounts: l, goals: u } = S(), { config: r } = pe(), { setAlert: d, setSelectedGoal: s, updateGoal: p } = G(), h = !t.guid, [o, a] = T.useState(!1), b = async ({ balance: m, guid: f }) => {
|
|
523
|
+
const R = { ...t, account_guid: f, current_amount: m || 0 };
|
|
524
|
+
h ? s(R) : (await p(R), d(u.alert_account_changed)), a(!1);
|
|
525
525
|
};
|
|
526
|
-
return /* @__PURE__ */
|
|
527
|
-
|
|
528
|
-
/* @__PURE__ */ e(w, { children: /* @__PURE__ */
|
|
529
|
-
/* @__PURE__ */ e(
|
|
530
|
-
|
|
526
|
+
return /* @__PURE__ */ c(g, { children: [
|
|
527
|
+
h && !t.account_guid ? /* @__PURE__ */ e(k, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ c(M, { onClick: () => a(!0), children: [
|
|
528
|
+
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ c(g, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
529
|
+
/* @__PURE__ */ e(Ie, { filled: !0 }),
|
|
530
|
+
u.details_add_account
|
|
531
531
|
] }) }),
|
|
532
532
|
/* @__PURE__ */ e(V, { color: "primary" })
|
|
533
|
-
] }) }) : /* @__PURE__ */
|
|
534
|
-
/* @__PURE__ */ e(
|
|
533
|
+
] }) }) : /* @__PURE__ */ c(g, { sx: { gap: 8, my: 24, mx: 24 }, children: [
|
|
534
|
+
/* @__PURE__ */ e(_e, { onClick: () => a(!0), variant: "text", children: u.details_change_account }),
|
|
535
535
|
/* @__PURE__ */ e(
|
|
536
536
|
C,
|
|
537
537
|
{
|
|
538
538
|
color: "text.secondary",
|
|
539
539
|
sx: { textAlign: "center", whiteSpace: "wrap" },
|
|
540
540
|
variant: "Paragraph",
|
|
541
|
-
children: O(
|
|
541
|
+
children: O(u.details_change_account_description, t.name)
|
|
542
542
|
}
|
|
543
543
|
)
|
|
544
544
|
] }),
|
|
545
|
-
/* @__PURE__ */ e(J, { isOpen:
|
|
546
|
-
n.length > 0 && /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children:
|
|
547
|
-
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: n.map((
|
|
545
|
+
/* @__PURE__ */ e(J, { isOpen: o, onClose: () => a(!1), title: u.details_change_account, children: /* @__PURE__ */ c(g, { children: [
|
|
546
|
+
n.length > 0 && /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: l.account_types[1] }),
|
|
547
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: n.map((m) => /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(M, { onClick: () => b(m), children: [
|
|
548
548
|
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
549
549
|
te,
|
|
550
550
|
{
|
|
551
|
-
alt:
|
|
552
|
-
institutionGuid:
|
|
551
|
+
alt: m?.name || "",
|
|
552
|
+
institutionGuid: m?.institution_guid || ""
|
|
553
553
|
}
|
|
554
554
|
) }),
|
|
555
555
|
/* @__PURE__ */ e(
|
|
556
556
|
w,
|
|
557
557
|
{
|
|
558
|
-
primary:
|
|
559
|
-
secondary: I(
|
|
558
|
+
primary: m?.name || m?.feed_name,
|
|
559
|
+
secondary: I(m?.balance || 0, "0,0.00")
|
|
560
560
|
}
|
|
561
561
|
),
|
|
562
562
|
/* @__PURE__ */ e(V, {})
|
|
563
|
-
] }) },
|
|
564
|
-
|
|
565
|
-
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children:
|
|
563
|
+
] }) }, m.guid)) }),
|
|
564
|
+
_.length > 0 && /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: l.account_types[2] }),
|
|
565
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: _.map((m) => /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(M, { onClick: () => b(m), children: [
|
|
566
566
|
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
567
567
|
te,
|
|
568
568
|
{
|
|
569
|
-
alt:
|
|
570
|
-
institutionGuid:
|
|
569
|
+
alt: m?.name || "",
|
|
570
|
+
institutionGuid: m?.institution_guid || ""
|
|
571
571
|
}
|
|
572
572
|
) }),
|
|
573
573
|
/* @__PURE__ */ e(
|
|
574
574
|
w,
|
|
575
575
|
{
|
|
576
|
-
primary:
|
|
577
|
-
secondary: I(
|
|
576
|
+
primary: m?.name || m?.feed_name,
|
|
577
|
+
secondary: I(m?.balance || 0, "0,0.00")
|
|
578
578
|
}
|
|
579
579
|
),
|
|
580
580
|
/* @__PURE__ */ e(V, {})
|
|
581
|
-
] }) },
|
|
582
|
-
/* @__PURE__ */ e(
|
|
583
|
-
|
|
581
|
+
] }) }, m.guid)) }),
|
|
582
|
+
r.show_connections_widget_in_master && /* @__PURE__ */ e(
|
|
583
|
+
Te,
|
|
584
584
|
{
|
|
585
|
-
description:
|
|
586
|
-
label:
|
|
587
|
-
title:
|
|
585
|
+
description: u.connect_description,
|
|
586
|
+
label: u.connect_button,
|
|
587
|
+
title: u.connect_title
|
|
588
588
|
}
|
|
589
589
|
)
|
|
590
590
|
] }) })
|
|
591
591
|
] });
|
|
592
592
|
}, Gt = D(({ goal: t }) => {
|
|
593
|
-
const { goals: n } = S(), { setAlert:
|
|
593
|
+
const { goals: n } = S(), { setAlert: _, setSelectedGoal: l, updateGoal: u } = G(), [r, d] = T.useState(t.name), s = !t.guid, p = t.track_type === i.SAVINGS_TRACK && t.has_been_spent || t.track_type !== i.SAVINGS_TRACK && t.is_complete, h = async () => {
|
|
594
594
|
const a = { ...t, name: r };
|
|
595
|
-
t.name = r, s ?
|
|
595
|
+
t.name = r, s ? l(a) : (await u(a), _(n.alert_goal_updated_name));
|
|
596
596
|
}, o = () => {
|
|
597
597
|
setTimeout(() => {
|
|
598
598
|
d(t.name);
|
|
@@ -601,11 +601,11 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
601
601
|
return /* @__PURE__ */ e(
|
|
602
602
|
q,
|
|
603
603
|
{
|
|
604
|
-
isDisabled:
|
|
604
|
+
isDisabled: p,
|
|
605
605
|
isSaveDisabled: !r,
|
|
606
606
|
label: n.details_goal_name,
|
|
607
607
|
onCancel: o,
|
|
608
|
-
onSave:
|
|
608
|
+
onSave: h,
|
|
609
609
|
primaryText: n.details_goal_name,
|
|
610
610
|
secondaryText: t.name,
|
|
611
611
|
children: /* @__PURE__ */ e(
|
|
@@ -621,12 +621,12 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
621
621
|
}
|
|
622
622
|
);
|
|
623
623
|
}), Nt = ({ goal: t }) => {
|
|
624
|
-
const { goals: n } = S(), { setAlert:
|
|
624
|
+
const { goals: n } = S(), { setAlert: _, setSelectedGoal: l, updateRetirementGoal: u } = G(), [r, d] = T.useState(t.retirement_age || 65), s = !t.guid, p = async () => {
|
|
625
625
|
if (!isNaN(r)) {
|
|
626
626
|
const a = { ...t, retirement_age: r };
|
|
627
|
-
t.retirement_age = r, s ?
|
|
627
|
+
t.retirement_age = r, s ? l(a) : (await u(a), _(n.alert_goal_updated_retirement_age));
|
|
628
628
|
}
|
|
629
|
-
},
|
|
629
|
+
}, h = () => {
|
|
630
630
|
setTimeout(() => {
|
|
631
631
|
d(t.retirement_age || 65);
|
|
632
632
|
}, 250);
|
|
@@ -637,8 +637,8 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
637
637
|
isDisabled: t.is_complete,
|
|
638
638
|
isSaveDisabled: o,
|
|
639
639
|
label: n.details_retirement_age,
|
|
640
|
-
onCancel:
|
|
641
|
-
onSave:
|
|
640
|
+
onCancel: h,
|
|
641
|
+
onSave: p,
|
|
642
642
|
primaryText: n.details_retirement_age,
|
|
643
643
|
secondaryText: `${t.retirement_age}`,
|
|
644
644
|
zeroStateText: s && !t.retirement_age ? n.add_age : void 0,
|
|
@@ -655,25 +655,25 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
655
655
|
}
|
|
656
656
|
);
|
|
657
657
|
}, kt = D(({ goal: t }) => {
|
|
658
|
-
const { goals: n } = S(), { user:
|
|
659
|
-
r &&
|
|
658
|
+
const { goals: n } = S(), { user: _, updateUser: l } = Ge(), { setAlert: u } = G(), [r, d] = T.useState(ne(_.birthday ?? 0)), [s, p] = T.useState(null), h = t.is_complete, o = async () => {
|
|
659
|
+
r && lt(r) && (await l({ ..._, birthday: ct(r) }), u(n.alert_goal_updated_birthday));
|
|
660
660
|
};
|
|
661
661
|
return /* @__PURE__ */ e(
|
|
662
662
|
q,
|
|
663
663
|
{
|
|
664
|
-
isDisabled:
|
|
664
|
+
isDisabled: h,
|
|
665
665
|
isSaveDisabled: !!s,
|
|
666
666
|
label: n.details_birthday,
|
|
667
667
|
onSave: o,
|
|
668
668
|
primaryText: n.details_birthday,
|
|
669
|
-
secondaryText: `${
|
|
670
|
-
zeroStateText: !t.guid && !
|
|
671
|
-
children: /* @__PURE__ */ e(
|
|
669
|
+
secondaryText: `${be(ne(_.birthday ?? 0), ye.MONTH_DAY_YEAR)}`,
|
|
670
|
+
zeroStateText: !t.guid && !_.birthday ? n.add_birthday : void 0,
|
|
671
|
+
children: /* @__PURE__ */ e(_t, { dateAdapter: dt, children: /* @__PURE__ */ e(
|
|
672
672
|
mt,
|
|
673
673
|
{
|
|
674
674
|
label: n.details_birthday,
|
|
675
675
|
onChange: d,
|
|
676
|
-
onError: (a) =>
|
|
676
|
+
onError: (a) => p(a),
|
|
677
677
|
sx: { width: "100%" },
|
|
678
678
|
value: r
|
|
679
679
|
}
|
|
@@ -681,41 +681,41 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
681
681
|
}
|
|
682
682
|
);
|
|
683
683
|
}), wt = ({ goal: t }) => {
|
|
684
|
-
const { goals: n } = S(), { visibleRetirementAccounts:
|
|
685
|
-
addRetirementGoalAccount:
|
|
686
|
-
newRetirementGoalAccounts:
|
|
684
|
+
const { goals: n } = S(), { visibleRetirementAccounts: _ } = z(), {
|
|
685
|
+
addRetirementGoalAccount: l,
|
|
686
|
+
newRetirementGoalAccounts: u,
|
|
687
687
|
retirementGoalAccounts: r,
|
|
688
688
|
selectedGoal: d,
|
|
689
689
|
setAlert: s,
|
|
690
|
-
setNewRetirementGoalAccounts:
|
|
691
|
-
setSelectedGoal:
|
|
692
|
-
} = G(), [o, a] = T.useState(!1),
|
|
693
|
-
(y) =>
|
|
694
|
-
), f =
|
|
690
|
+
setNewRetirementGoalAccounts: p,
|
|
691
|
+
setSelectedGoal: h
|
|
692
|
+
} = G(), [o, a] = T.useState(!1), b = !t.guid, m = _.filter(
|
|
693
|
+
(y) => b ? u.find((A) => A.account_guid === y.guid) : r.find((A) => A.account_guid === y.guid)
|
|
694
|
+
), f = _.filter(
|
|
695
695
|
(y) => !r.find((A) => A.account_guid === y.guid)
|
|
696
|
-
),
|
|
697
|
-
const A = y.map((
|
|
698
|
-
account_guid:
|
|
696
|
+
), R = async (y) => {
|
|
697
|
+
const A = y.map((E) => ({
|
|
698
|
+
account_guid: E.guid,
|
|
699
699
|
retirement_goal_guid: t.guid
|
|
700
700
|
}));
|
|
701
|
-
if (
|
|
702
|
-
|
|
701
|
+
if (b)
|
|
702
|
+
p(A);
|
|
703
703
|
else
|
|
704
|
-
for (const
|
|
705
|
-
await
|
|
706
|
-
|
|
704
|
+
for (const E of A)
|
|
705
|
+
await l(E), s(n.alert_account_added);
|
|
706
|
+
h({
|
|
707
707
|
...d,
|
|
708
|
-
current_amount: y.reduce((
|
|
708
|
+
current_amount: y.reduce((E, N) => E + (N.balance || 0), 0)
|
|
709
709
|
}), a(!1);
|
|
710
710
|
};
|
|
711
|
-
return /* @__PURE__ */
|
|
712
|
-
|
|
711
|
+
return /* @__PURE__ */ c(g, { children: [
|
|
712
|
+
m.map((y) => /* @__PURE__ */ c(g, { children: [
|
|
713
713
|
/* @__PURE__ */ e(Oe, { account: y }),
|
|
714
|
-
/* @__PURE__ */ e(
|
|
714
|
+
/* @__PURE__ */ e(v, {})
|
|
715
715
|
] }, y.guid)),
|
|
716
|
-
/* @__PURE__ */ e(k, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */
|
|
717
|
-
/* @__PURE__ */ e(w, { children: /* @__PURE__ */
|
|
718
|
-
/* @__PURE__ */ e(
|
|
716
|
+
/* @__PURE__ */ e(k, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ c(M, { onClick: () => a(!0), children: [
|
|
717
|
+
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ c(g, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
718
|
+
/* @__PURE__ */ e(Ie, { filled: !0 }),
|
|
719
719
|
n.details_add_account
|
|
720
720
|
] }) }),
|
|
721
721
|
/* @__PURE__ */ e(V, { color: "primary" })
|
|
@@ -726,175 +726,175 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
726
726
|
accounts: f,
|
|
727
727
|
isOpen: o,
|
|
728
728
|
onClose: () => a(!1),
|
|
729
|
-
onSave:
|
|
729
|
+
onSave: R,
|
|
730
730
|
title: n.add_select_accounts
|
|
731
731
|
}
|
|
732
732
|
)
|
|
733
733
|
] });
|
|
734
734
|
}, Dt = D(({ goal: t }) => {
|
|
735
|
-
const { goals: n } = S(), { visibleAccounts:
|
|
736
|
-
() =>
|
|
737
|
-
[
|
|
738
|
-
),
|
|
735
|
+
const { goals: n } = S(), { visibleAccounts: _ } = z(), l = T.useMemo(
|
|
736
|
+
() => _.find((d) => d.guid === t.account_guid),
|
|
737
|
+
[_, t]
|
|
738
|
+
), u = t.track_type;
|
|
739
739
|
let r = n.details_save_title;
|
|
740
|
-
return t.track_type === i.DEBT_TRACK ? r = n.details_debt_title : t.track_type === i.RETIREMENT_TRACK && (r = n.details_retirement_title), /* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
740
|
+
return t.track_type === i.DEBT_TRACK ? r = n.details_debt_title : t.track_type === i.RETIREMENT_TRACK && (r = n.details_retirement_title), /* @__PURE__ */ c(g, { children: [
|
|
741
|
+
/* @__PURE__ */ c(g, { mx: 24, children: [
|
|
742
742
|
/* @__PURE__ */ e(C, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: r }),
|
|
743
743
|
/* @__PURE__ */ e(Le, { goal: t, isInDrawer: !0 }),
|
|
744
744
|
/* @__PURE__ */ e(C, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: n.details_title })
|
|
745
745
|
] }),
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
|
|
746
|
+
/* @__PURE__ */ c(L, { sx: { bgcolor: "background.paper" }, children: [
|
|
747
|
+
u !== i.RETIREMENT_TRACK ? /* @__PURE__ */ e(Gt, { goal: t }) : /* @__PURE__ */ e(k, { sx: { px: 24 }, children: /* @__PURE__ */ e(
|
|
748
748
|
w,
|
|
749
749
|
{
|
|
750
|
-
primary: /* @__PURE__ */
|
|
750
|
+
primary: /* @__PURE__ */ c(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
751
751
|
/* @__PURE__ */ e(C, { variant: "body1", children: n.details_goal_name }),
|
|
752
752
|
/* @__PURE__ */ e(C, { bold: !0, color: "text.primary", sx: { mr: 4 }, variant: "body1", children: n.retirement })
|
|
753
753
|
] }),
|
|
754
754
|
primaryTypographyProps: { variant: "body1" }
|
|
755
755
|
}
|
|
756
756
|
) }),
|
|
757
|
-
/* @__PURE__ */ e(
|
|
758
|
-
(
|
|
757
|
+
/* @__PURE__ */ e(v, { sx: { ml: 24 } }),
|
|
758
|
+
(u === i.SAVINGS_TRACK || u === i.RETIREMENT_TRACK) && /* @__PURE__ */ c($, { children: [
|
|
759
759
|
/* @__PURE__ */ e(vt, { goal: t }),
|
|
760
|
-
/* @__PURE__ */ e(
|
|
760
|
+
/* @__PURE__ */ e(v, { sx: { ml: u === i.RETIREMENT_TRACK ? 24 : 0 } })
|
|
761
761
|
] }),
|
|
762
|
-
t.track_type === i.DEBT_TRACK && /* @__PURE__ */
|
|
762
|
+
t.track_type === i.DEBT_TRACK && /* @__PURE__ */ c($, { children: [
|
|
763
763
|
/* @__PURE__ */ e(rt, { goal: t }),
|
|
764
|
-
/* @__PURE__ */ e(
|
|
764
|
+
/* @__PURE__ */ e(v, { sx: { ml: 24 } }),
|
|
765
765
|
/* @__PURE__ */ e(it, { goal: t }),
|
|
766
|
-
/* @__PURE__ */ e(
|
|
766
|
+
/* @__PURE__ */ e(v, { sx: { ml: 24 } }),
|
|
767
767
|
/* @__PURE__ */ e(st, { goal: t }),
|
|
768
|
-
/* @__PURE__ */ e(
|
|
768
|
+
/* @__PURE__ */ e(v, { variant: "fullWidth" })
|
|
769
769
|
] }),
|
|
770
|
-
t.track_type === i.RETIREMENT_TRACK && /* @__PURE__ */
|
|
770
|
+
t.track_type === i.RETIREMENT_TRACK && /* @__PURE__ */ c($, { children: [
|
|
771
771
|
/* @__PURE__ */ e(Nt, { goal: t }),
|
|
772
|
-
/* @__PURE__ */ e(
|
|
772
|
+
/* @__PURE__ */ e(v, { sx: { ml: 24 } }),
|
|
773
773
|
/* @__PURE__ */ e(kt, { goal: t }),
|
|
774
|
-
/* @__PURE__ */ e(
|
|
774
|
+
/* @__PURE__ */ e(v, { variant: "fullWidth" })
|
|
775
775
|
] })
|
|
776
776
|
] }),
|
|
777
777
|
/* @__PURE__ */ e(C, { color: "text.secondary", sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: t.track_type === i.RETIREMENT_TRACK ? n.details_accounts : n.details_account }),
|
|
778
|
-
t.track_type !== i.RETIREMENT_TRACK &&
|
|
779
|
-
/* @__PURE__ */ e(Oe, { account:
|
|
780
|
-
/* @__PURE__ */ e(
|
|
778
|
+
t.track_type !== i.RETIREMENT_TRACK && l && /* @__PURE__ */ c($, { children: [
|
|
779
|
+
/* @__PURE__ */ e(Oe, { account: l }),
|
|
780
|
+
/* @__PURE__ */ e(v, {})
|
|
781
781
|
] }),
|
|
782
|
-
t.track_type === i.RETIREMENT_TRACK && /* @__PURE__ */
|
|
782
|
+
t.track_type === i.RETIREMENT_TRACK && /* @__PURE__ */ c($, { children: [
|
|
783
783
|
/* @__PURE__ */ e(wt, { goal: t }),
|
|
784
|
-
/* @__PURE__ */ e(
|
|
784
|
+
/* @__PURE__ */ e(v, {})
|
|
785
785
|
] }),
|
|
786
786
|
t.track_type === i.SAVINGS_TRACK && !t.is_complete && /* @__PURE__ */ e(It, { goal: t })
|
|
787
787
|
] });
|
|
788
788
|
}), Kt = D(({ onClose: t }) => {
|
|
789
|
-
const { visibleRetirementAccounts: n } = z(), { goals:
|
|
790
|
-
addGoal:
|
|
789
|
+
const { visibleRetirementAccounts: n } = z(), { goals: _, common: l } = S(), {
|
|
790
|
+
addGoal: u,
|
|
791
791
|
addRetirementGoal: r,
|
|
792
792
|
deleteGoal: d,
|
|
793
793
|
deleteRetirementGoal: s,
|
|
794
|
-
newRetirementGoalAccounts:
|
|
795
|
-
retirementGoalAccounts:
|
|
794
|
+
newRetirementGoalAccounts: p,
|
|
795
|
+
retirementGoalAccounts: h,
|
|
796
796
|
selectedGoal: o,
|
|
797
797
|
setAlert: a,
|
|
798
|
-
setSelectedGoal:
|
|
799
|
-
updateGoal:
|
|
800
|
-
} = G(), { user: f } = Ge(), [
|
|
801
|
-
const
|
|
802
|
-
return n.filter((j) =>
|
|
803
|
-
}, [A, n,
|
|
798
|
+
setSelectedGoal: b,
|
|
799
|
+
updateGoal: m
|
|
800
|
+
} = G(), { user: f } = Ge(), [R, y] = T.useState(!1), A = !o?.guid, E = o?.track_type === i.SAVINGS_TRACK && o.is_complete && !o.has_been_spent, N = T.useMemo(() => {
|
|
801
|
+
const x = A ? p : h;
|
|
802
|
+
return n.filter((j) => x.some((F) => F.account_guid === j.guid));
|
|
803
|
+
}, [A, n, p, h]), K = T.useMemo(() => {
|
|
804
804
|
if (!o) return !1;
|
|
805
|
-
if (!A && !
|
|
806
|
-
const { account_guid:
|
|
807
|
-
return j === i.SAVINGS_TRACK ?
|
|
805
|
+
if (!A && !E) return !0;
|
|
806
|
+
const { account_guid: x, track_type: j, name: F, amount: ee, retirement_age: B } = o;
|
|
807
|
+
return j === i.SAVINGS_TRACK ? x ? !!F && !!ee : !1 : j === i.RETIREMENT_TRACK ? N.length ? !!F && !!ee && !!B && !!f.birthday : !1 : !0;
|
|
808
808
|
}, [o, N, f.birthday]);
|
|
809
|
-
let U =
|
|
810
|
-
A ? (Y = () => oe(), U =
|
|
809
|
+
let U = l.delete_button, Y = () => y(!0);
|
|
810
|
+
A ? (Y = () => oe(), U = l.save_button) : E && (Y = () => Q(), U = _.mark_as_complete_button);
|
|
811
811
|
const oe = async () => {
|
|
812
812
|
if (o) {
|
|
813
|
-
const
|
|
814
|
-
|
|
813
|
+
const x = o.track_type;
|
|
814
|
+
x !== i.RETIREMENT_TRACK ? await u(o) : x === i.RETIREMENT_TRACK && await r({ ...o, target_amount: o.amount }), a(_.alert_goal_added), b(void 0), x && t?.(x);
|
|
815
815
|
}
|
|
816
816
|
}, W = async () => {
|
|
817
|
-
o && (o.track_type !== i.RETIREMENT_TRACK ? await d(o.guid) : o.track_type === i.RETIREMENT_TRACK && await s(o), a(
|
|
817
|
+
o && (o.track_type !== i.RETIREMENT_TRACK ? await d(o.guid) : o.track_type === i.RETIREMENT_TRACK && await s(o), a(_.alert_goal_deleted), b(void 0));
|
|
818
818
|
}, Q = async () => {
|
|
819
|
-
const
|
|
819
|
+
const x = {
|
|
820
820
|
...o,
|
|
821
821
|
has_been_spent: !0
|
|
822
822
|
};
|
|
823
|
-
await
|
|
823
|
+
await m(x), a(_.alert_goal_completed), b(void 0);
|
|
824
824
|
};
|
|
825
|
-
return /* @__PURE__ */
|
|
825
|
+
return /* @__PURE__ */ c(g, { children: [
|
|
826
826
|
/* @__PURE__ */ e(
|
|
827
827
|
J,
|
|
828
828
|
{
|
|
829
|
-
ariaLabelClose:
|
|
829
|
+
ariaLabelClose: l.close_aria,
|
|
830
830
|
hasSecondaryAction: A,
|
|
831
831
|
isOpen: !!o,
|
|
832
832
|
isPrimaryDisabled: !K,
|
|
833
|
-
onClose: () =>
|
|
833
|
+
onClose: () => b(void 0),
|
|
834
834
|
onPrimaryAction: Y,
|
|
835
|
-
primaryColor: A ||
|
|
835
|
+
primaryColor: A || E ? "primary" : "error",
|
|
836
836
|
primaryText: U,
|
|
837
837
|
secondaryColor: "primary",
|
|
838
|
-
title:
|
|
838
|
+
title: _.goal_details,
|
|
839
839
|
children: o && /* @__PURE__ */ e(Dt, { goal: o })
|
|
840
840
|
}
|
|
841
841
|
),
|
|
842
842
|
/* @__PURE__ */ e(
|
|
843
843
|
et,
|
|
844
844
|
{
|
|
845
|
-
copy: { close_aria:
|
|
846
|
-
isOpen:
|
|
845
|
+
copy: { close_aria: l.close_aria, title: _.delete_goal },
|
|
846
|
+
isOpen: R,
|
|
847
847
|
maxWidth: "xs",
|
|
848
848
|
onClose: () => y(!1),
|
|
849
849
|
onPrimaryAction: W,
|
|
850
850
|
primaryColor: "error",
|
|
851
|
-
primaryText:
|
|
852
|
-
children: /* @__PURE__ */ e(C, { sx: { textWrap: "wrap" }, variant: "Paragraph", children: O(
|
|
851
|
+
primaryText: l.delete_button,
|
|
852
|
+
children: /* @__PURE__ */ e(C, { sx: { textWrap: "wrap" }, variant: "Paragraph", children: O(_.delete_description, o?.name || "") })
|
|
853
853
|
}
|
|
854
854
|
)
|
|
855
855
|
] });
|
|
856
856
|
}), Pn = D(({ onBackClick: t, sx: n }) => {
|
|
857
|
-
const { onEvent:
|
|
858
|
-
alert:
|
|
857
|
+
const { onEvent: _ } = Ne(), { isMobile: l } = he(), { isAccountDataLoaded: u, loadAccountData: r } = z(), { isInitialized: d } = ue(), { goals: s, common: p } = S(), {
|
|
858
|
+
alert: h,
|
|
859
859
|
goals: o,
|
|
860
860
|
isAllGoalDataLoaded: a,
|
|
861
|
-
loadGoalData:
|
|
862
|
-
monthlyCashFlowProfile:
|
|
861
|
+
loadGoalData: b,
|
|
862
|
+
monthlyCashFlowProfile: m,
|
|
863
863
|
setAlert: f,
|
|
864
|
-
retirmentGoals:
|
|
865
|
-
} = G(), [y, A] = T.useState(0), [
|
|
864
|
+
retirmentGoals: R
|
|
865
|
+
} = G(), [y, A] = T.useState(0), [E, N] = T.useState(!1), K = m?.amount_allocated_for_savings_goals || 0, U = m?.amount_allocated_for_debt_goals || 0, Y = m?.amount_allocated_for_retirement_goals || 0;
|
|
866
866
|
Ke({
|
|
867
867
|
widgetName: "GoalsWidget",
|
|
868
868
|
isLoaded: a
|
|
869
869
|
}), T.useEffect(() => {
|
|
870
|
-
|
|
870
|
+
u || r().finally(), _(X.GOALS_VIEW);
|
|
871
871
|
}, []), T.useEffect(() => {
|
|
872
|
-
d &&
|
|
872
|
+
d && b().finally();
|
|
873
873
|
}, [d]);
|
|
874
874
|
const oe = () => {
|
|
875
|
-
|
|
875
|
+
_(X.GOALS_CLICK_FILTER);
|
|
876
876
|
}, W = () => {
|
|
877
|
-
N(!0),
|
|
877
|
+
N(!0), _(X.GOALS_CLICK_ADD);
|
|
878
878
|
}, Q = (B) => {
|
|
879
879
|
N(!1), B === i.SAVINGS_TRACK ? A(0) : B === i.DEBT_TRACK ? A(1) : B === i.RETIREMENT_TRACK && A(2);
|
|
880
|
-
},
|
|
881
|
-
() => a && (o.length === 0 || o.every(({ track_type: B }) => !B) &&
|
|
882
|
-
[o, a,
|
|
880
|
+
}, x = T.useMemo(
|
|
881
|
+
() => a && (o.length === 0 || o.every(({ track_type: B }) => !B) && R.length === 0),
|
|
882
|
+
[o, a, R]
|
|
883
883
|
);
|
|
884
884
|
if (!d || !a)
|
|
885
885
|
return /* @__PURE__ */ e(Me, {});
|
|
886
886
|
const j = O(
|
|
887
|
-
|
|
887
|
+
l ? s.tab_subtitle_mobile : s.tab_subtitle,
|
|
888
888
|
I(K, "0,0")
|
|
889
889
|
), F = O(
|
|
890
|
-
|
|
890
|
+
l ? s.tab_subtitle_mobile : s.tab_subtitle,
|
|
891
891
|
I(U, "0,0")
|
|
892
892
|
), ee = O(
|
|
893
|
-
|
|
893
|
+
l ? s.tab_subtitle_mobile : s.tab_subtitle,
|
|
894
894
|
I(Y, "0,0")
|
|
895
895
|
);
|
|
896
|
-
return /* @__PURE__ */
|
|
897
|
-
|
|
896
|
+
return /* @__PURE__ */ c(
|
|
897
|
+
ut,
|
|
898
898
|
{
|
|
899
899
|
actions: [
|
|
900
900
|
{
|
|
@@ -908,41 +908,41 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
908
908
|
sx: n,
|
|
909
909
|
title: s.title,
|
|
910
910
|
children: [
|
|
911
|
-
/* @__PURE__ */
|
|
912
|
-
/* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ c(g, { mx: l ? 0 : 48, my: 24, children: [
|
|
912
|
+
/* @__PURE__ */ c(
|
|
913
913
|
Fe,
|
|
914
914
|
{
|
|
915
915
|
onChange: (B, We) => A(We),
|
|
916
916
|
sx: { bgcolor: "background.paper" },
|
|
917
917
|
textColor: "primary",
|
|
918
|
-
value:
|
|
918
|
+
value: x ? !1 : y,
|
|
919
919
|
variant: "fullWidth",
|
|
920
920
|
children: [
|
|
921
921
|
/* @__PURE__ */ e(
|
|
922
922
|
re,
|
|
923
923
|
{
|
|
924
|
-
disabled:
|
|
924
|
+
disabled: x,
|
|
925
925
|
label: /* @__PURE__ */ e(ie, { subtitle: j, title: s.tab_saving_title })
|
|
926
926
|
}
|
|
927
927
|
),
|
|
928
928
|
/* @__PURE__ */ e(
|
|
929
929
|
re,
|
|
930
930
|
{
|
|
931
|
-
disabled:
|
|
931
|
+
disabled: x,
|
|
932
932
|
label: /* @__PURE__ */ e(ie, { subtitle: F, title: s.tab_debt_title })
|
|
933
933
|
}
|
|
934
934
|
),
|
|
935
935
|
/* @__PURE__ */ e(
|
|
936
936
|
re,
|
|
937
937
|
{
|
|
938
|
-
disabled:
|
|
938
|
+
disabled: x,
|
|
939
939
|
label: /* @__PURE__ */ e(ie, { subtitle: ee, title: s.tab_retirement_title })
|
|
940
940
|
}
|
|
941
941
|
)
|
|
942
942
|
]
|
|
943
943
|
}
|
|
944
944
|
),
|
|
945
|
-
|
|
945
|
+
x ? /* @__PURE__ */ e(
|
|
946
946
|
pt,
|
|
947
947
|
{
|
|
948
948
|
header: s.create_goals_header,
|
|
@@ -957,7 +957,7 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
) : /* @__PURE__ */
|
|
960
|
+
) : /* @__PURE__ */ c($, { children: [
|
|
961
961
|
y === 0 && /* @__PURE__ */ e(se, { onAddGoals: W, trackType: i.SAVINGS_TRACK }),
|
|
962
962
|
y === 1 && /* @__PURE__ */ e(se, { onAddGoals: W, trackType: i.DEBT_TRACK }),
|
|
963
963
|
y === 2 && /* @__PURE__ */ e(se, { onAddGoals: W, trackType: i.RETIREMENT_TRACK })
|
|
@@ -967,36 +967,36 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
967
967
|
/* @__PURE__ */ e(
|
|
968
968
|
J,
|
|
969
969
|
{
|
|
970
|
-
ariaLabelClose:
|
|
971
|
-
isOpen:
|
|
970
|
+
ariaLabelClose: p.close_aria,
|
|
971
|
+
isOpen: E,
|
|
972
972
|
onClose: () => N(!1),
|
|
973
973
|
title: s.add_goal_title,
|
|
974
974
|
children: /* @__PURE__ */ e(xt, { onClose: Q })
|
|
975
975
|
}
|
|
976
976
|
),
|
|
977
|
-
/* @__PURE__ */ e(je, { onClose: () => f(""), open: !!
|
|
977
|
+
/* @__PURE__ */ e(je, { onClose: () => f(""), open: !!h, children: /* @__PURE__ */ e(ze, { onClose: () => f(""), severity: "success", variant: "filled", children: h }) })
|
|
978
978
|
]
|
|
979
979
|
}
|
|
980
980
|
);
|
|
981
981
|
}), Mt = D(({ goal: t }) => {
|
|
982
|
-
const { goals: n } = S(),
|
|
983
|
-
backgroundColor:
|
|
984
|
-
color:
|
|
982
|
+
const { goals: n } = S(), _ = yt(), {
|
|
983
|
+
backgroundColor: l,
|
|
984
|
+
color: u,
|
|
985
985
|
percentage: r,
|
|
986
986
|
projectedText: d
|
|
987
987
|
} = de(n, t), s = Math.round(r * 100);
|
|
988
|
-
let
|
|
989
|
-
return t.track_type === i.DEBT_TRACK ?
|
|
990
|
-
/* @__PURE__ */ e(ae, { sx: { bgcolor:
|
|
991
|
-
/* @__PURE__ */
|
|
988
|
+
let p = /* @__PURE__ */ e(Ee, {});
|
|
989
|
+
return t.track_type === i.DEBT_TRACK ? p = /* @__PURE__ */ e(xe, {}) : t.track_type === i.RETIREMENT_TRACK && (p = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ c(g, { alignItems: "center", direction: "row", spacing: 12, sx: { py: 12 }, children: [
|
|
990
|
+
/* @__PURE__ */ e(ae, { sx: { bgcolor: l, color: u, height: 32, width: 32 }, variant: "rounded", children: p }),
|
|
991
|
+
/* @__PURE__ */ c(bt, { sx: { width: "100%" }, children: [
|
|
992
992
|
/* @__PURE__ */ e(me, { fontSize: 15, fontWeight: 600, variant: "body1", children: t.name }),
|
|
993
993
|
t.projected_to_complete_at && /* @__PURE__ */ e(C, { color: "text.secondary", variant: "XSmall", children: d })
|
|
994
994
|
] }),
|
|
995
995
|
/* @__PURE__ */ e(
|
|
996
996
|
gt,
|
|
997
997
|
{
|
|
998
|
-
backgroundStrokeColor:
|
|
999
|
-
color:
|
|
998
|
+
backgroundStrokeColor: _.palette.border.lighter,
|
|
999
|
+
color: _.palette.primary.main,
|
|
1000
1000
|
percent: s,
|
|
1001
1001
|
size: 40,
|
|
1002
1002
|
strokeWidth: 3,
|
|
@@ -1004,14 +1004,14 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1004
1004
|
}
|
|
1005
1005
|
)
|
|
1006
1006
|
] });
|
|
1007
|
-
}), Lt = ({ header: t, subText: n, sx:
|
|
1007
|
+
}), Lt = ({ header: t, subText: n, sx: _ }) => /* @__PURE__ */ c(
|
|
1008
1008
|
g,
|
|
1009
1009
|
{
|
|
1010
1010
|
sx: {
|
|
1011
1011
|
alignItems: "center",
|
|
1012
1012
|
alignSelf: "center",
|
|
1013
1013
|
px: 24,
|
|
1014
|
-
...
|
|
1014
|
+
..._
|
|
1015
1015
|
},
|
|
1016
1016
|
children: [
|
|
1017
1017
|
/* @__PURE__ */ e(qe, { size: 32 }),
|
|
@@ -1028,26 +1028,26 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1028
1028
|
]
|
|
1029
1029
|
}
|
|
1030
1030
|
), zn = D(({ onCTAClick: t }) => {
|
|
1031
|
-
const { isAccountDataLoaded: n, loadAccountData:
|
|
1031
|
+
const { isAccountDataLoaded: n, loadAccountData: _, visibleAccounts: l } = z(), { onEvent: u } = Ne(), { goals: r } = S(), { isInitialized: d } = ue(), { ongoingGoalsForMicroWidget: s, isAllGoalDataLoaded: p, loadGoalData: h } = G();
|
|
1032
1032
|
Ke({
|
|
1033
1033
|
widgetName: "GoalsMicroWidget",
|
|
1034
|
-
isLoaded:
|
|
1034
|
+
isLoaded: p
|
|
1035
1035
|
}), T.useEffect(() => {
|
|
1036
|
-
n ||
|
|
1036
|
+
n || _().finally();
|
|
1037
1037
|
}, []), T.useEffect(() => {
|
|
1038
|
-
d && (
|
|
1039
|
-
state:
|
|
1038
|
+
d && (h().finally(), u(X.GOALS_LOAD_WIDGET, {
|
|
1039
|
+
state: l?.length ? "default" : "zeroState"
|
|
1040
1040
|
}));
|
|
1041
1041
|
}, [d]);
|
|
1042
1042
|
const o = T.useMemo(
|
|
1043
|
-
() =>
|
|
1044
|
-
[s,
|
|
1043
|
+
() => p && s.length === 0,
|
|
1044
|
+
[s, p]
|
|
1045
1045
|
), a = () => {
|
|
1046
|
-
|
|
1046
|
+
u(
|
|
1047
1047
|
o ? X.GOALS_CLICK_GET_STARTED : X.GOALS_CLICK_VIEW_DETAILS
|
|
1048
1048
|
), t();
|
|
1049
1049
|
};
|
|
1050
|
-
return !d || !
|
|
1050
|
+
return !d || !p ? /* @__PURE__ */ e(Me, {}) : /* @__PURE__ */ e(
|
|
1051
1051
|
ft,
|
|
1052
1052
|
{
|
|
1053
1053
|
className: "mx-goals-microwidget",
|
|
@@ -1060,10 +1060,10 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1060
1060
|
header: r.create_goals_header,
|
|
1061
1061
|
subText: r.micro_zero_state_description
|
|
1062
1062
|
}
|
|
1063
|
-
) : /* @__PURE__ */ e(ht, { sx: { justifyContent: "space-between" }, children: s.map((
|
|
1064
|
-
/* @__PURE__ */ e(Mt, { goal:
|
|
1065
|
-
|
|
1066
|
-
] },
|
|
1063
|
+
) : /* @__PURE__ */ e(ht, { sx: { justifyContent: "space-between" }, children: s.map((b, m) => /* @__PURE__ */ c(T.Fragment, { children: [
|
|
1064
|
+
/* @__PURE__ */ e(Mt, { goal: b }),
|
|
1065
|
+
m !== s.length - 1 && /* @__PURE__ */ e(v, {})
|
|
1066
|
+
] }, b.guid)) })
|
|
1067
1067
|
}
|
|
1068
1068
|
);
|
|
1069
1069
|
});
|