@mx-cartographer/experiences 7.8.2-alpha.bb6 → 7.8.2-alpha.mm0
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 +0 -4
- package/dist/{AccountStore-btBtMI9s.mjs → AccountStore-BbPWe2C9.mjs} +1 -4
- package/dist/{ManageIncome-CL3hv8i9.mjs → ManageIncome-Da1ktIdG.mjs} +83 -79
- package/dist/{RecurringSettings-Bmnnpb48.mjs → RecurringSettings-B4sByhIM.mjs} +2 -2
- package/dist/{TransactionDetails-BDhz3DLT.mjs → TransactionDetails-B9NQYa6j.mjs} +1 -1
- package/dist/{TransactionStore-DcBF3oIZ.mjs → TransactionStore-BSp5bOKg.mjs} +47 -47
- package/dist/{WidgetContainer-BbPS3Yxz.mjs → WidgetContainer-CYdQ0BSm.mjs} +151 -148
- package/dist/accounts/index.es.js +3 -3
- package/dist/accounts/stores/AccountStore.d.ts +0 -1
- package/dist/budgets/index.es.js +3 -3
- package/dist/cashflow/index.es.js +4 -4
- package/dist/common/index.es.js +5 -4
- package/dist/common/types/AppData.d.ts +1 -0
- package/dist/debts/index.es.js +1 -1
- package/dist/finstrong/index.es.js +4 -4
- package/dist/goals/components/managegoals/OngoingListItem.d.ts +1 -2
- package/dist/goals/index.es.js +639 -544
- package/dist/help/index.es.js +1 -1
- package/dist/investments/index.es.js +1 -1
- package/dist/networth/index.es.js +1 -1
- package/dist/recurringtransactions/index.es.js +5 -5
- package/dist/settings/index.es.js +1 -1
- package/dist/spending/index.es.js +2 -2
- package/dist/transactions/index.es.js +332 -321
- package/dist/trends/index.es.js +2 -2
- package/package.json +1 -1
package/dist/goals/index.es.js
CHANGED
|
@@ -1,86 +1,87 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { c as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import
|
|
1
|
+
import { g as _e, T as s, G as de, a as Pe, M as Z, C as Ae, b as Ve } from "../GoalStore-B4LVt_kH.mjs";
|
|
2
|
+
import { c as Un, d as Yn } from "../GoalStore-B4LVt_kH.mjs";
|
|
3
|
+
import { jsxs as i, jsx as e, Fragment as H } from "react/jsx-runtime";
|
|
4
|
+
import A from "react";
|
|
5
5
|
import { observer as D } from "mobx-react-lite";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import je from "@mui/material/Alert";
|
|
7
|
+
import Fe from "@mui/material/Snackbar";
|
|
8
8
|
import g from "@mui/material/Stack";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { Text as
|
|
12
|
-
import
|
|
9
|
+
import se from "@mui/material/Tab";
|
|
10
|
+
import ze from "@mui/material/Tabs";
|
|
11
|
+
import { Text as T, H2 as ue, P, H3 as me, Icon as He, InstitutionLogo as te } from "@mxenabled/mxui";
|
|
12
|
+
import pe 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
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { Payments as Re, NoteStack as Ee, Person as xe,
|
|
20
|
-
import { u as
|
|
21
|
-
import { u as
|
|
22
|
-
import { f as
|
|
16
|
+
import ge from "@mui/material/Unstable_Grid2";
|
|
17
|
+
import ne from "@mui/material/Avatar";
|
|
18
|
+
import $e from "@mui/material/CardHeader";
|
|
19
|
+
import { Payments as Re, NoteStack as Ee, Person as xe, ChevronRight as O, DragHandle as Xe, CheckCircle as Ue, Icon as ye, ExpandLess as Ye, ExpandMore as Ze, AddBox as ve, Trophy as qe } from "@mxenabled/mx-icons";
|
|
20
|
+
import { u as R, l as G, b as he, a as Ge, d as j, o as Ie, g as Ne } from "../hooks-ZMp65DFz.mjs";
|
|
21
|
+
import { u as be } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
22
|
+
import { f as v } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
23
23
|
import { S as Je } from "../StatusBar-BK_uYHAB.mjs";
|
|
24
|
-
import
|
|
24
|
+
import E from "@mui/material/Divider";
|
|
25
25
|
import L from "@mui/material/List";
|
|
26
|
-
import { L as
|
|
27
|
-
import { C as
|
|
28
|
-
import { fromUnixTime as
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import { D as
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import nt from "@mui/material/
|
|
40
|
-
import at from "@mui/material/
|
|
26
|
+
import { L as J } from "../ListItemAction-CU42h39I.mjs";
|
|
27
|
+
import { C as we } from "../CurrencyInput-itK0R3wV.mjs";
|
|
28
|
+
import { fromUnixTime as q } from "date-fns/fromUnixTime";
|
|
29
|
+
import w from "@mui/material/ListItem";
|
|
30
|
+
import K from "@mui/material/ListItemButton";
|
|
31
|
+
import k from "@mui/material/ListItemText";
|
|
32
|
+
import { DataGridPro as Qe } from "@mui/x-data-grid-pro";
|
|
33
|
+
import { u as et } from "../useAriaLive-B3_pRUio.mjs";
|
|
34
|
+
import { D as X } from "../Drawer-DV4NTsFg.mjs";
|
|
35
|
+
import { b as M } from "../Localization-2MODESHW.mjs";
|
|
36
|
+
import { f as ae, D as oe, a as tt } from "../Dialog-B4PI-_bL.mjs";
|
|
37
|
+
import V from "@mui/material/ListItemAvatar";
|
|
38
|
+
import { g as ke } from "../AccountDisplayName-CO7z3v99.mjs";
|
|
39
|
+
import nt from "@mui/material/Collapse";
|
|
40
|
+
import at from "@mui/material/ListItemIcon";
|
|
41
|
+
import ot from "@mui/material/Checkbox";
|
|
41
42
|
import { A as fe } from "../Account-BiB1F8lL.mjs";
|
|
42
|
-
import { u as
|
|
43
|
+
import { u as rt } from "../useAccountDisplayName-Bot2tb4n.mjs";
|
|
43
44
|
import De from "@mui/material/TextField";
|
|
44
|
-
import { M as
|
|
45
|
-
import { getUnixTime as
|
|
46
|
-
import { isValid as
|
|
47
|
-
import { AdapterDateFns as
|
|
48
|
-
import { DatePicker as
|
|
45
|
+
import { M as it, I as st, O as lt } from "../OriginalBalanceAction-ChGGq5AH.mjs";
|
|
46
|
+
import { getUnixTime as ct } from "date-fns/getUnixTime";
|
|
47
|
+
import { isValid as dt } from "date-fns/isValid";
|
|
48
|
+
import { AdapterDateFns as mt } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
49
|
+
import { DatePicker as _t } from "@mui/x-date-pickers";
|
|
49
50
|
import { LocalizationProvider as ut } from "@mui/x-date-pickers/LocalizationProvider";
|
|
50
51
|
import { u as Ke } from "../useWidgetLoadTimer-hIOioiKx.mjs";
|
|
51
|
-
import { A as
|
|
52
|
+
import { A as $, W as pt } from "../WidgetContainer-CYdQ0BSm.mjs";
|
|
52
53
|
import { L as Me } from "../Loader-DUaFpDGv.mjs";
|
|
53
|
-
import { E as
|
|
54
|
-
import
|
|
55
|
-
import
|
|
54
|
+
import { E as ht } from "../EmptyState-DoxNUae-.mjs";
|
|
55
|
+
import bt from "@mui/material/Stack/Stack";
|
|
56
|
+
import gt from "@mui/material/Box";
|
|
56
57
|
import yt from "@mui/material/styles/useTheme";
|
|
57
|
-
import { S as
|
|
58
|
-
import { M as
|
|
59
|
-
function
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */ e(
|
|
62
|
-
/* @__PURE__ */ e(
|
|
58
|
+
import { S as ft } from "../SingleSegmentDonut-BgbLgwHi.mjs";
|
|
59
|
+
import { M as At } from "../MicroWidgetContainer-B2hO9rOG.mjs";
|
|
60
|
+
function le({ title: t, subtitle: n }) {
|
|
61
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
62
|
+
/* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: t }),
|
|
63
|
+
/* @__PURE__ */ e(T, { sx: { fontWeight: 400 }, variant: "Body", children: n })
|
|
63
64
|
] });
|
|
64
65
|
}
|
|
65
|
-
const
|
|
66
|
+
const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
66
67
|
/(\d+)(?:\.0+|(\.\d*?[1-9])0*)([a-zA-Z]* ?\$?)/g,
|
|
67
68
|
"$1$2$3"
|
|
68
|
-
) :
|
|
69
|
-
({ goal: t, isInDrawer: n = !1, onClick:
|
|
70
|
-
const { goals:
|
|
71
|
-
backgroundColor:
|
|
72
|
-
color:
|
|
69
|
+
) : v(t, "0,0.00"), Le = D(
|
|
70
|
+
({ goal: t, isInDrawer: n = !1, onClick: c }) => {
|
|
71
|
+
const { goals: m } = R(), { isMobile: h, isTablet: r } = be(), d = h || r, {
|
|
72
|
+
backgroundColor: l,
|
|
73
|
+
color: p,
|
|
73
74
|
percentage: b,
|
|
74
75
|
percentageText: o,
|
|
75
76
|
projectedText: a
|
|
76
|
-
} =
|
|
77
|
+
} = _e(m, t), u = t.track_type === s.DEBT_TRACK ? t.initial_amount : t.amount, _ = [
|
|
77
78
|
{
|
|
78
|
-
color:
|
|
79
|
+
color: l,
|
|
79
80
|
percentage: `${b}`
|
|
80
81
|
}
|
|
81
82
|
];
|
|
82
|
-
let
|
|
83
|
-
return t.track_type ===
|
|
83
|
+
let y = /* @__PURE__ */ e(Re, {});
|
|
84
|
+
return t.track_type === s.DEBT_TRACK ? y = /* @__PURE__ */ e(Ee, {}) : t.track_type === s.RETIREMENT_TRACK && (y = /* @__PURE__ */ e(xe, {})), /* @__PURE__ */ e(
|
|
84
85
|
Te,
|
|
85
86
|
{
|
|
86
87
|
elevation: 2,
|
|
@@ -90,197 +91,291 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
90
91
|
outlineColor: "primary.main"
|
|
91
92
|
}
|
|
92
93
|
},
|
|
93
|
-
children: /* @__PURE__ */
|
|
94
|
+
children: /* @__PURE__ */ i(Ce, { disabled: !c, onClick: c, children: [
|
|
94
95
|
/* @__PURE__ */ e(
|
|
95
|
-
|
|
96
|
+
$e,
|
|
96
97
|
{
|
|
97
|
-
avatar: /* @__PURE__ */ e(
|
|
98
|
-
subheader: /* @__PURE__ */ e(
|
|
98
|
+
avatar: /* @__PURE__ */ e(ne, { sx: { bgcolor: l, color: p, height: 48, width: 48 }, variant: "rounded", children: y }),
|
|
99
|
+
subheader: /* @__PURE__ */ e(T, { variant: n || d ? "H3" : "H2", children: `${v(t.current_amount, d ? "0,0" : "0,0.00")} / ${Tt(
|
|
99
100
|
u,
|
|
100
101
|
d
|
|
101
102
|
)}` }),
|
|
102
|
-
title: /* @__PURE__ */ e(
|
|
103
|
+
title: /* @__PURE__ */ e(ue, { color: "text.secondary", fontWeight: 400, variant: "Body", children: t.name })
|
|
103
104
|
}
|
|
104
105
|
),
|
|
105
|
-
/* @__PURE__ */ e(Se, { sx: { pt: 0 }, children: /* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */ e(Je, { data:
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */ e(
|
|
109
|
-
t.projected_to_complete_at && /* @__PURE__ */ e(
|
|
106
|
+
/* @__PURE__ */ e(Se, { sx: { pt: 0 }, children: /* @__PURE__ */ i(g, { gap: 6, children: [
|
|
107
|
+
/* @__PURE__ */ e(Je, { data: _, height: 24 }),
|
|
108
|
+
/* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
109
|
+
/* @__PURE__ */ e(T, { color: "text.secondary", variant: "XSmall", children: o }),
|
|
110
|
+
t.projected_to_complete_at && /* @__PURE__ */ e(T, { color: "text.secondary", variant: "XSmall", children: a })
|
|
110
111
|
] })
|
|
111
112
|
] }) })
|
|
112
113
|
] })
|
|
113
114
|
}
|
|
114
115
|
);
|
|
115
116
|
}
|
|
116
|
-
),
|
|
117
|
-
const { goals: n } =
|
|
117
|
+
), Ct = D(({ trackType: t }) => {
|
|
118
|
+
const { goals: n } = R(), { setAlert: c, monthlyCashFlowProfile: m, updateMonthlyCashFlowProfile: h } = G(), r = A.useMemo(() => {
|
|
118
119
|
let o = 0;
|
|
119
|
-
return t ===
|
|
120
|
-
}, [
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
return t === s.SAVINGS_TRACK ? o = m?.amount_allocated_for_savings_goals || 0 : t === s.DEBT_TRACK ? o = m?.amount_allocated_for_debt_goals || 0 : t === s.RETIREMENT_TRACK && (o = m?.amount_allocated_for_retirement_goals || 0), o;
|
|
121
|
+
}, [m]);
|
|
122
|
+
A.useEffect(() => {
|
|
123
|
+
l(r);
|
|
123
124
|
}, [r]);
|
|
124
|
-
const [d,
|
|
125
|
-
if (
|
|
126
|
-
const o = { ...
|
|
127
|
-
t ===
|
|
125
|
+
const [d, l] = A.useState(r), p = d < 0 || d > 99999999, b = async () => {
|
|
126
|
+
if (m) {
|
|
127
|
+
const o = { ...m };
|
|
128
|
+
t === s.SAVINGS_TRACK ? o.amount_allocated_for_savings_goals = d : t === s.DEBT_TRACK ? o.amount_allocated_for_debt_goals = d : t === s.RETIREMENT_TRACK && (o.amount_allocated_for_retirement_goals = d), await h(o), c(n.alert_contribution_updated);
|
|
128
129
|
}
|
|
129
130
|
};
|
|
130
131
|
return /* @__PURE__ */ e(g, { bgcolor: "background.paper", children: /* @__PURE__ */ e(
|
|
131
|
-
|
|
132
|
+
J,
|
|
132
133
|
{
|
|
133
134
|
isSaveDisabled: !d || isNaN(d),
|
|
134
135
|
label: n.contribution_label,
|
|
135
|
-
onCancel: () =>
|
|
136
|
+
onCancel: () => l(r),
|
|
136
137
|
onSave: b,
|
|
137
138
|
primaryText: n.contribution_label,
|
|
138
|
-
secondaryText:
|
|
139
|
+
secondaryText: v(r, "0,0.00"),
|
|
139
140
|
children: /* @__PURE__ */ e(
|
|
140
|
-
|
|
141
|
+
we,
|
|
141
142
|
{
|
|
142
143
|
amount: d,
|
|
143
144
|
autoFocus: !0,
|
|
144
|
-
error:
|
|
145
|
+
error: p,
|
|
145
146
|
fullWidth: !0,
|
|
146
147
|
minAmount: 0,
|
|
147
|
-
setAmount: (o) =>
|
|
148
|
+
setAmount: (o) => l(isNaN(Number(o)) ? d : Number(o)),
|
|
148
149
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
149
150
|
}
|
|
150
151
|
)
|
|
151
152
|
}
|
|
152
153
|
) });
|
|
153
|
-
}),
|
|
154
|
-
const { goals: c } =
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
}), St = ({ goals: t }) => {
|
|
155
|
+
const { goals: n, common: c } = R(), { reorderGoals: m, setAlert: h } = G(), { announce: r, ariaLive: d } = et(), [l, p] = A.useState(!1), [b, o] = A.useState(t.map((f) => ({ ...f })));
|
|
156
|
+
A.useEffect(() => {
|
|
157
|
+
l && o(t.map((f) => ({ ...f })));
|
|
158
|
+
}, [l]);
|
|
159
|
+
const a = [
|
|
157
160
|
{
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
{
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
/* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: t.name }),
|
|
176
|
-
/* @__PURE__ */ e(C, { variant: "XSmall", children: t.is_complete ? r : O(
|
|
177
|
-
c.goal_projection,
|
|
178
|
-
he(
|
|
179
|
-
ne(t.projected_to_complete_at || 0),
|
|
180
|
-
be.MONTH_SHORT_YEAR
|
|
181
|
-
)
|
|
182
|
-
) })
|
|
183
|
-
] }),
|
|
184
|
-
/* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: I(t.amount, "0,0.00") })
|
|
185
|
-
] }) })
|
|
186
|
-
]
|
|
187
|
-
}
|
|
188
|
-
) });
|
|
189
|
-
}, St = ({ goal: t }) => {
|
|
190
|
-
const { goals: n } = S();
|
|
191
|
-
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ l(
|
|
192
|
-
M,
|
|
161
|
+
field: "name",
|
|
162
|
+
flex: 1,
|
|
163
|
+
renderCell: (f) => {
|
|
164
|
+
const S = f.row;
|
|
165
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
166
|
+
/* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: S.name }),
|
|
167
|
+
/* @__PURE__ */ e(T, { variant: "XSmall", children: M(
|
|
168
|
+
n.goal_projection,
|
|
169
|
+
ae(
|
|
170
|
+
q(S.projected_to_complete_at || 0),
|
|
171
|
+
oe.MONTH_SHORT_YEAR
|
|
172
|
+
)
|
|
173
|
+
) })
|
|
174
|
+
] });
|
|
175
|
+
},
|
|
176
|
+
sortable: !1
|
|
177
|
+
},
|
|
193
178
|
{
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
n.completed_label,
|
|
203
|
-
he(
|
|
204
|
-
ne(t.completed_at || 0),
|
|
205
|
-
be.MONTH_SHORT_YEAR
|
|
206
|
-
)
|
|
207
|
-
) })
|
|
208
|
-
] }),
|
|
209
|
-
/* @__PURE__ */ e(C, { bold: !0, variant: "Body", children: I(t.amount, "0,0.00") })
|
|
210
|
-
] }) })
|
|
211
|
-
]
|
|
179
|
+
align: "right",
|
|
180
|
+
field: "amount",
|
|
181
|
+
minWidth: 140,
|
|
182
|
+
renderCell: (f) => {
|
|
183
|
+
const S = f.row;
|
|
184
|
+
return /* @__PURE__ */ e(T, { bold: !0, sx: { mr: 12 }, variant: "Body", children: v(S.amount, "0,0.00") });
|
|
185
|
+
},
|
|
186
|
+
sortable: !1
|
|
212
187
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
188
|
+
], u = b.map((f) => ({
|
|
189
|
+
id: f.guid,
|
|
190
|
+
isHovering: !1,
|
|
191
|
+
__reorder__: f.name,
|
|
192
|
+
...f
|
|
193
|
+
})), _ = ({ oldIndex: f, targetIndex: S }) => {
|
|
194
|
+
const C = [...b], I = C[f];
|
|
195
|
+
C.splice(S, 0, C.splice(f, 1)[0]);
|
|
196
|
+
for (let N = 0; N < C.length; N += 1)
|
|
197
|
+
C[N].position = N + 1;
|
|
198
|
+
o(C), r(
|
|
199
|
+
M(
|
|
200
|
+
n.reorder_goals_announcement,
|
|
201
|
+
I.name,
|
|
202
|
+
f + 1,
|
|
203
|
+
S + 1
|
|
204
|
+
)
|
|
205
|
+
);
|
|
206
|
+
}, y = async () => {
|
|
207
|
+
await m(b), h(n.alert_goals_reordered), p(!1);
|
|
229
208
|
};
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
-
/* @__PURE__ */ e(
|
|
209
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
210
|
+
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(K, { onClick: () => p(!0), children: /* @__PURE__ */ e(k, { children: /* @__PURE__ */ i(
|
|
211
|
+
g,
|
|
212
|
+
{
|
|
213
|
+
alignItems: "center",
|
|
214
|
+
color: "action.active",
|
|
215
|
+
direction: "row",
|
|
216
|
+
justifyContent: "space-between",
|
|
217
|
+
children: [
|
|
218
|
+
/* @__PURE__ */ e(T, { color: "primary.light", variant: "Body", children: n.reorder_goals_title }),
|
|
219
|
+
/* @__PURE__ */ e(O, { color: "primary" })
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
) }) }) }),
|
|
232
223
|
/* @__PURE__ */ e(
|
|
233
|
-
|
|
224
|
+
X,
|
|
234
225
|
{
|
|
235
|
-
ariaLabelClose:
|
|
236
|
-
isOpen:
|
|
237
|
-
onClose: () =>
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
226
|
+
ariaLabelClose: c.close_aria,
|
|
227
|
+
isOpen: l,
|
|
228
|
+
onClose: () => p(!1),
|
|
229
|
+
onPrimaryAction: y,
|
|
230
|
+
title: n.reorder_goals_title,
|
|
231
|
+
children: /* @__PURE__ */ i(g, { children: [
|
|
232
|
+
d,
|
|
233
|
+
/* @__PURE__ */ e(P, { id: "reorder-instructions", sx: { my: 12, mx: 24 }, children: n.reorder_goals_description }),
|
|
234
|
+
/* @__PURE__ */ e(
|
|
235
|
+
Qe,
|
|
236
|
+
{
|
|
237
|
+
"aria-describedby": "reorder-instructions",
|
|
238
|
+
columnHeaderHeight: 0,
|
|
239
|
+
columns: a,
|
|
240
|
+
disableColumnFilter: !0,
|
|
241
|
+
disableColumnMenu: !0,
|
|
242
|
+
hideFooter: !0,
|
|
243
|
+
onRowOrderChange: _,
|
|
244
|
+
rowReordering: !0,
|
|
245
|
+
rows: u,
|
|
246
|
+
slots: {
|
|
247
|
+
rowReorderIcon: () => /* @__PURE__ */ e(Xe, { "aria-label": n.reorder_goals_drag_aria_label, sx: { ml: 12 } })
|
|
248
|
+
},
|
|
249
|
+
sx: {
|
|
250
|
+
"& .MuiDataGrid-columnHeaders": {
|
|
251
|
+
borderBottomWidth: 0
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
] })
|
|
257
|
+
}
|
|
258
|
+
)
|
|
259
|
+
] });
|
|
260
|
+
}, Rt = ({ goal: t, index: n }) => {
|
|
261
|
+
const { goals: c } = R(), { percentage: m } = _e(c, t), h = t.goal_type === de.KEEP_BALANCE_BELOW || t.has_been_spent ? c.goal_completed : M(c.goal_percentage_reached, `${m * 100}`);
|
|
262
|
+
return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(K, { children: [
|
|
263
|
+
t.track_type !== s.RETIREMENT_TRACK && /* @__PURE__ */ e(
|
|
264
|
+
V,
|
|
265
|
+
{
|
|
266
|
+
sx: {
|
|
267
|
+
alignItems: "center",
|
|
268
|
+
display: "flex",
|
|
269
|
+
justifyContent: "center",
|
|
270
|
+
".MuiAvatar-root": { height: "16px", width: "16px" }
|
|
271
|
+
},
|
|
272
|
+
children: /* @__PURE__ */ e(ne, { sx: { bgcolor: "text.primary", height: "16px", width: "16px" }, children: /* @__PURE__ */ e(T, { bold: !0, variant: "XSmall", children: n + 1 }) })
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
/* @__PURE__ */ e(k, { primaryTypographyProps: { variant: "Body" }, children: /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
276
|
+
/* @__PURE__ */ i(g, { children: [
|
|
277
|
+
/* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: t.name }),
|
|
278
|
+
/* @__PURE__ */ e(T, { variant: "XSmall", children: t.is_complete ? h : M(
|
|
279
|
+
c.goal_projection,
|
|
280
|
+
ae(
|
|
281
|
+
q(t.projected_to_complete_at || 0),
|
|
282
|
+
oe.MONTH_SHORT_YEAR
|
|
283
|
+
)
|
|
284
|
+
) })
|
|
285
|
+
] }),
|
|
286
|
+
/* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: v(t.amount, "0,0.00") })
|
|
287
|
+
] }) })
|
|
288
|
+
] }) });
|
|
289
|
+
}, Et = ({ goal: t }) => {
|
|
290
|
+
const { goals: n } = R();
|
|
291
|
+
return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(K, { children: [
|
|
292
|
+
/* @__PURE__ */ e(V, { sx: { alignItems: "center", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ e(Ue, { color: "success", filled: !0, size: 20 }) }),
|
|
293
|
+
/* @__PURE__ */ e(k, { primaryTypographyProps: { variant: "Body" }, children: /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
294
|
+
/* @__PURE__ */ i(g, { children: [
|
|
295
|
+
/* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: t.name }),
|
|
296
|
+
/* @__PURE__ */ e(T, { variant: "XSmall", children: M(
|
|
297
|
+
n.completed_label,
|
|
298
|
+
ae(
|
|
299
|
+
q(t.completed_at || 0),
|
|
300
|
+
oe.MONTH_SHORT_YEAR
|
|
301
|
+
)
|
|
302
|
+
) })
|
|
303
|
+
] }),
|
|
304
|
+
/* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: v(t.amount, "0,0.00") })
|
|
305
|
+
] }) })
|
|
306
|
+
] }) }, t.guid);
|
|
307
|
+
}, xt = ({ trackType: t }) => {
|
|
308
|
+
const { goals: n, common: c } = R(), { orderedGoals: m } = G(), h = m.filter((_) => _.track_type === t), r = h.filter(
|
|
309
|
+
(_) => _.track_type === s.SAVINGS_TRACK && !_.has_been_spent || _.track_type !== s.SAVINGS_TRACK && !_.is_complete
|
|
310
|
+
), d = h.filter(
|
|
311
|
+
(_) => _.track_type === s.SAVINGS_TRACK && _.has_been_spent || _.track_type !== s.SAVINGS_TRACK && _.is_complete
|
|
312
|
+
), [l, p] = A.useState(!1);
|
|
313
|
+
let b = n.manage_saving_goals, o = n.manage_saving_drawer_title, a = n.manage_saving_title, u = n.manage_saving_description;
|
|
314
|
+
return t === s.DEBT_TRACK ? (b = n.manage_debt_goals, o = n.manage_debt_drawer_title, a = n.manage_debt_title, u = n.manage_debt_description) : t === s.RETIREMENT_TRACK && (b = n.manage_retirement_goals, o = n.manage_retirement_drawer_title, a = n.manage_retirement_title, u = n.manage_retirement_description), /* @__PURE__ */ i(g, { children: [
|
|
315
|
+
/* @__PURE__ */ e(pe, { endIcon: /* @__PURE__ */ e(O, {}), onClick: () => p(!0), children: b }),
|
|
316
|
+
/* @__PURE__ */ e(
|
|
317
|
+
X,
|
|
318
|
+
{
|
|
319
|
+
ariaLabelClose: c.close_aria,
|
|
320
|
+
isOpen: l,
|
|
321
|
+
onClose: () => p(!1),
|
|
322
|
+
title: o,
|
|
323
|
+
children: /* @__PURE__ */ i(g, { children: [
|
|
324
|
+
/* @__PURE__ */ i(g, { m: 24, children: [
|
|
325
|
+
/* @__PURE__ */ e(me, { children: a }),
|
|
326
|
+
/* @__PURE__ */ e(P, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "ParagraphSmall", children: u })
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ e(Ct, { trackType: t }),
|
|
329
|
+
/* @__PURE__ */ e(T, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "XSmall", children: n.goal_priority }),
|
|
330
|
+
/* @__PURE__ */ i(L, { sx: { bgcolor: "background.paper" }, children: [
|
|
331
|
+
r.map((_, y) => {
|
|
332
|
+
const f = y >= r.length - 1;
|
|
333
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
334
|
+
/* @__PURE__ */ e(Rt, { goal: _, index: y }),
|
|
335
|
+
/* @__PURE__ */ e(
|
|
336
|
+
E,
|
|
337
|
+
{
|
|
338
|
+
variant: f && t === s.RETIREMENT_TRACK ? "fullWidth" : "inset"
|
|
339
|
+
}
|
|
340
|
+
)
|
|
341
|
+
] }, `ongoing-${_.guid}`);
|
|
342
|
+
}),
|
|
343
|
+
t !== s.RETIREMENT_TRACK && /* @__PURE__ */ i(g, { children: [
|
|
344
|
+
/* @__PURE__ */ e(St, { goals: r }),
|
|
345
|
+
/* @__PURE__ */ e(E, {})
|
|
346
|
+
] })
|
|
243
347
|
] }),
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}) }),
|
|
253
|
-
t !== i.RETIREMENT_TRACK && _.length > 0 && /* @__PURE__ */ l(g, { children: [
|
|
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: _.map((y, A) => {
|
|
256
|
-
const R = A > s.length - 1;
|
|
257
|
-
return /* @__PURE__ */ l(g, { children: [
|
|
258
|
-
/* @__PURE__ */ e(St, { goal: y }),
|
|
259
|
-
/* @__PURE__ */ e(x, { variant: R ? "fullWidth" : "inset" })
|
|
260
|
-
] }, `complete-${y.guid}`);
|
|
348
|
+
t !== s.RETIREMENT_TRACK && d.length > 0 && /* @__PURE__ */ i(g, { children: [
|
|
349
|
+
/* @__PURE__ */ e(T, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "XSmall", children: n.complete_title }),
|
|
350
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: d.map((_, y) => {
|
|
351
|
+
const f = y > r.length - 1;
|
|
352
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
353
|
+
/* @__PURE__ */ e(Et, { goal: _ }),
|
|
354
|
+
/* @__PURE__ */ e(E, { variant: f ? "fullWidth" : "inset" })
|
|
355
|
+
] }, `complete-${_.guid}`);
|
|
261
356
|
}) })
|
|
262
357
|
] })
|
|
263
358
|
] })
|
|
264
359
|
}
|
|
265
360
|
)
|
|
266
361
|
] });
|
|
267
|
-
},
|
|
268
|
-
const { isMobile:
|
|
269
|
-
(a) => a.track_type === t && (a.track_type !==
|
|
270
|
-
),
|
|
271
|
-
(a) => a.track_type ===
|
|
272
|
-
), b =
|
|
273
|
-
(a) => a.track_type ===
|
|
274
|
-
), o = t ===
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */ e(
|
|
278
|
-
/* @__PURE__ */ e(
|
|
362
|
+
}, ce = D(({ trackType: t, onAddGoals: n }) => {
|
|
363
|
+
const { isMobile: c } = be(), { goals: m } = R(), { selectedAccountGuids: h } = he(), { orderedGoals: r, setSelectedGoal: d } = G(), l = r.filter(
|
|
364
|
+
(a) => a.track_type === t && (a.track_type !== s.RETIREMENT_TRACK && h.includes(a.account_guid) || a.track_type === s.RETIREMENT_TRACK)
|
|
365
|
+
), p = l.filter(
|
|
366
|
+
(a) => a.track_type === s.SAVINGS_TRACK && !a.has_been_spent || a.track_type !== s.SAVINGS_TRACK && !a.is_complete
|
|
367
|
+
), b = l.filter(
|
|
368
|
+
(a) => a.track_type === s.SAVINGS_TRACK && a.has_been_spent || a.track_type !== s.SAVINGS_TRACK && a.is_complete
|
|
369
|
+
), o = t === s.DEBT_TRACK ? m.zero_state_complete_debt : m.zero_state_complete_savings;
|
|
370
|
+
return /* @__PURE__ */ i(g, { mt: 16, mx: c ? 24 : 0, children: [
|
|
371
|
+
/* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", mb: 8, children: [
|
|
372
|
+
/* @__PURE__ */ e(me, { color: "text.secondary", variant: "Small", children: m.ongoing_title }),
|
|
373
|
+
/* @__PURE__ */ e(xt, { trackType: t })
|
|
279
374
|
] }),
|
|
280
|
-
|
|
375
|
+
p.length > 0 ? /* @__PURE__ */ e(ge, { container: !0, spacing: 24, children: p.map((a, u, _) => (
|
|
281
376
|
// Goal should be full width in mobile or if it's the first goal (unless there are 2)
|
|
282
|
-
/* @__PURE__ */ e(
|
|
283
|
-
)) }) : /* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ e(ge, { xs: c || u === 0 && _.length !== 2 ? 12 : 6, children: /* @__PURE__ */ e(Le, { goal: a, onClick: () => d(a) }, a.guid) }, u)
|
|
378
|
+
)) }) : /* @__PURE__ */ i(
|
|
284
379
|
g,
|
|
285
380
|
{
|
|
286
381
|
alignItems: "center",
|
|
@@ -291,7 +386,7 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
291
386
|
py: 18,
|
|
292
387
|
children: [
|
|
293
388
|
/* @__PURE__ */ e(
|
|
294
|
-
|
|
389
|
+
P,
|
|
295
390
|
{
|
|
296
391
|
sx: (a) => ({
|
|
297
392
|
color: "text.secondary",
|
|
@@ -301,17 +396,17 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
301
396
|
width: { sm: 381 }
|
|
302
397
|
}),
|
|
303
398
|
variant: "Small",
|
|
304
|
-
children:
|
|
399
|
+
children: Pe(t, m)
|
|
305
400
|
}
|
|
306
401
|
),
|
|
307
|
-
/* @__PURE__ */ e(
|
|
402
|
+
/* @__PURE__ */ e(pe, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children: m.add_goals_button })
|
|
308
403
|
]
|
|
309
404
|
}
|
|
310
405
|
),
|
|
311
|
-
t !==
|
|
312
|
-
/* @__PURE__ */ e(
|
|
406
|
+
t !== s.RETIREMENT_TRACK && /* @__PURE__ */ i(g, { gap: 16, mt: 48, children: [
|
|
407
|
+
/* @__PURE__ */ e(me, { color: "text.secondary", variant: "Small", children: m.complete_title }),
|
|
313
408
|
b.length === 0 && /* @__PURE__ */ e(g, { alignItems: "center", bgcolor: "background.default", borderRadius: 2, py: 18, children: /* @__PURE__ */ e(
|
|
314
|
-
|
|
409
|
+
P,
|
|
315
410
|
{
|
|
316
411
|
sx: (a) => ({
|
|
317
412
|
color: "text.secondary",
|
|
@@ -324,73 +419,73 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
324
419
|
children: o
|
|
325
420
|
}
|
|
326
421
|
) }),
|
|
327
|
-
b.map((a) => /* @__PURE__ */ e(Te, { elevation: 2, children: /* @__PURE__ */ e(Ce, { onClick: () => d(a), children: /* @__PURE__ */ e(Se, { sx: { ":last-child": { pb: 16 } }, children: /* @__PURE__ */
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
/* @__PURE__ */ e(
|
|
330
|
-
/* @__PURE__ */ e(
|
|
422
|
+
b.map((a) => /* @__PURE__ */ e(Te, { elevation: 2, children: /* @__PURE__ */ e(Ce, { onClick: () => d(a), children: /* @__PURE__ */ e(Se, { sx: { ":last-child": { pb: 16 } }, children: /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
423
|
+
/* @__PURE__ */ i(g, { alignItems: "center", direction: "row", gap: 6, children: [
|
|
424
|
+
/* @__PURE__ */ e(He, { color: "success", fill: !0, name: "check_circle", size: 20 }),
|
|
425
|
+
/* @__PURE__ */ e(T, { color: "text.secondary", variant: "Body", children: a.name })
|
|
331
426
|
] }),
|
|
332
|
-
/* @__PURE__ */ e(
|
|
427
|
+
/* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: v(a.amount, "0,0.00") })
|
|
333
428
|
] }) }) }) }, a.guid))
|
|
334
429
|
] })
|
|
335
430
|
] });
|
|
336
|
-
}),
|
|
337
|
-
const { goals:
|
|
338
|
-
return /* @__PURE__ */ e(g, { children: /* @__PURE__ */
|
|
339
|
-
/* @__PURE__ */ e(
|
|
340
|
-
|
|
431
|
+
}), vt = ({ goalType: t, onClick: n }) => {
|
|
432
|
+
const { goals: c } = R(), { bgcolor: m, icon: h, label: r, description: d, subTypes: l, type: p } = t, [b, o] = A.useState(!1), a = l.length > 0;
|
|
433
|
+
return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ i(L, { sx: { bgcolor: "background.paper" }, children: [
|
|
434
|
+
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(
|
|
435
|
+
K,
|
|
341
436
|
{
|
|
342
437
|
onClick: a ? () => o(!b) : () => n(
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
438
|
+
p === s.RETIREMENT_TRACK ? c.retirement : "",
|
|
439
|
+
p === s.RETIREMENT_TRACK ? Z.RETIREMENT : Z.OTHER,
|
|
440
|
+
p
|
|
346
441
|
),
|
|
347
442
|
children: [
|
|
348
|
-
/* @__PURE__ */ e(
|
|
349
|
-
/* @__PURE__ */ e(
|
|
350
|
-
!a && /* @__PURE__ */ e(
|
|
443
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(ne, { sx: { bgcolor: m }, variant: "rounded", children: /* @__PURE__ */ e(ye, { name: h, sx: { color: "grey.900" } }) }) }),
|
|
444
|
+
/* @__PURE__ */ e(k, { primary: r, secondary: d, sx: { mr: 24 } }),
|
|
445
|
+
!a && /* @__PURE__ */ e(O, {}),
|
|
351
446
|
a && (b ? /* @__PURE__ */ e(Ye, {}) : /* @__PURE__ */ e(Ze, {}))
|
|
352
447
|
]
|
|
353
448
|
}
|
|
354
449
|
) }),
|
|
355
|
-
/* @__PURE__ */ e(
|
|
356
|
-
a && /* @__PURE__ */ e(
|
|
357
|
-
/* @__PURE__ */ e(
|
|
450
|
+
/* @__PURE__ */ e(E, { variant: "inset" }),
|
|
451
|
+
a && /* @__PURE__ */ e(nt, { in: b, children: /* @__PURE__ */ e(L, { sx: { bgcolor: "background.default" }, children: l.map((u, _) => /* @__PURE__ */ e(w, { sx: { pl: 48 }, children: /* @__PURE__ */ i(K, { onClick: () => n(u.label, u.metaType, p), children: [
|
|
452
|
+
/* @__PURE__ */ e(at, { sx: { mr: 8 }, children: /* @__PURE__ */ e(ye, { name: u.icon }) }),
|
|
358
453
|
/* @__PURE__ */ e(
|
|
359
|
-
|
|
454
|
+
k,
|
|
360
455
|
{
|
|
361
456
|
primary: u.label,
|
|
362
457
|
primaryTypographyProps: { variant: "Body" }
|
|
363
458
|
}
|
|
364
459
|
),
|
|
365
|
-
/* @__PURE__ */ e(
|
|
366
|
-
] }) },
|
|
460
|
+
/* @__PURE__ */ e(O, {})
|
|
461
|
+
] }) }, _)) }) })
|
|
367
462
|
] }) });
|
|
368
463
|
}, Be = ({
|
|
369
464
|
accounts: t,
|
|
370
465
|
isOpen: n,
|
|
371
|
-
onClose:
|
|
372
|
-
onSave:
|
|
373
|
-
title:
|
|
466
|
+
onClose: c,
|
|
467
|
+
onSave: m,
|
|
468
|
+
title: h
|
|
374
469
|
}) => {
|
|
375
|
-
const { goals: r, common: d } =
|
|
376
|
-
const u =
|
|
377
|
-
u >= 0 ?
|
|
470
|
+
const { goals: r, common: d } = R(), { config: l } = Ge(), [p, b] = A.useState([]), o = (a) => {
|
|
471
|
+
const u = p.findIndex((y) => y.guid === a.guid), _ = [...p];
|
|
472
|
+
u >= 0 ? _.splice(u, 1) : _.push(a), b(_);
|
|
378
473
|
};
|
|
379
|
-
return /* @__PURE__ */
|
|
380
|
-
|
|
474
|
+
return /* @__PURE__ */ i(
|
|
475
|
+
X,
|
|
381
476
|
{
|
|
382
477
|
ariaLabelClose: d.close_aria,
|
|
383
478
|
isOpen: n,
|
|
384
|
-
onClose:
|
|
385
|
-
onPrimaryAction: () =>
|
|
386
|
-
title:
|
|
479
|
+
onClose: c,
|
|
480
|
+
onPrimaryAction: () => m(p),
|
|
481
|
+
title: h,
|
|
387
482
|
children: [
|
|
388
|
-
/* @__PURE__ */ e(
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */ e(
|
|
391
|
-
t.map((a, u) => /* @__PURE__ */
|
|
392
|
-
/* @__PURE__ */ e(
|
|
393
|
-
/* @__PURE__ */ e(
|
|
483
|
+
/* @__PURE__ */ e(P, { color: "text.secondary", sx: { mx: 24, my: 12 }, children: r.select_debt_accounts_description }),
|
|
484
|
+
/* @__PURE__ */ i(L, { sx: { bgcolor: "background.white" }, children: [
|
|
485
|
+
/* @__PURE__ */ e(E, { variant: "fullWidth" }),
|
|
486
|
+
t.map((a, u) => /* @__PURE__ */ i(A.Fragment, { children: [
|
|
487
|
+
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(K, { onClick: () => o(a), children: [
|
|
488
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
394
489
|
te,
|
|
395
490
|
{
|
|
396
491
|
alt: a?.name || "",
|
|
@@ -398,17 +493,17 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
398
493
|
}
|
|
399
494
|
) }),
|
|
400
495
|
/* @__PURE__ */ e(
|
|
401
|
-
|
|
496
|
+
k,
|
|
402
497
|
{
|
|
403
|
-
primary:
|
|
404
|
-
allowNickname:
|
|
498
|
+
primary: ke(a, {
|
|
499
|
+
allowNickname: l?.show_account_nicknames_in_master
|
|
405
500
|
}),
|
|
406
|
-
secondary:
|
|
501
|
+
secondary: v(a.balance || 0, "0,0.00")
|
|
407
502
|
}
|
|
408
503
|
),
|
|
409
|
-
/* @__PURE__ */ e(
|
|
504
|
+
/* @__PURE__ */ e(ot, { checked: p.some((_) => _.guid === a.guid) })
|
|
410
505
|
] }) }),
|
|
411
|
-
/* @__PURE__ */ e(
|
|
506
|
+
/* @__PURE__ */ e(E, { variant: u < t.length - 1 ? "inset" : "fullWidth" })
|
|
412
507
|
] }, a.guid))
|
|
413
508
|
] }),
|
|
414
509
|
/* @__PURE__ */ e(
|
|
@@ -422,44 +517,44 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
422
517
|
]
|
|
423
518
|
}
|
|
424
519
|
);
|
|
425
|
-
},
|
|
426
|
-
const { goals: n } =
|
|
427
|
-
|
|
520
|
+
}, Gt = ({ onClose: t }) => {
|
|
521
|
+
const { goals: n } = R(), { addGoal: c, debtGoals: m, setAlert: h, setSelectedGoal: r } = G(), { config: d } = Ge(), { visibleDebtAccounts: l } = j(), [p, b] = A.useState(!1), o = Ve(n), a = (_, y, f) => {
|
|
522
|
+
f === s.DEBT_TRACK ? b(!0) : r({
|
|
428
523
|
amount: 0,
|
|
429
524
|
current_amount: 0,
|
|
430
|
-
goal_type:
|
|
525
|
+
goal_type: de.SAVE_AMOUNT,
|
|
431
526
|
initial_amount: 0,
|
|
432
|
-
meta_type:
|
|
433
|
-
name:
|
|
434
|
-
track_type:
|
|
527
|
+
meta_type: y,
|
|
528
|
+
name: _,
|
|
529
|
+
track_type: f
|
|
435
530
|
});
|
|
436
|
-
}, u = async (
|
|
437
|
-
for (const
|
|
438
|
-
let
|
|
439
|
-
|
|
440
|
-
account_guid:
|
|
531
|
+
}, u = async (_) => {
|
|
532
|
+
for (const y of _) {
|
|
533
|
+
let f = Z.CREDIT_CARD;
|
|
534
|
+
y.account_type === fe.LOAN ? f = Z.LOANS : y.account_type === fe.LINE_OF_CREDIT && (f = Z.LINE_OF_CREDIT), await c({
|
|
535
|
+
account_guid: y.guid,
|
|
441
536
|
amount: 0,
|
|
442
537
|
current_amount: 0,
|
|
443
|
-
goal_type:
|
|
444
|
-
initial_amount:
|
|
445
|
-
interest_rate:
|
|
446
|
-
meta_type:
|
|
447
|
-
monthly_payment:
|
|
448
|
-
name:
|
|
538
|
+
goal_type: de.KEEP_BALANCE_BELOW,
|
|
539
|
+
initial_amount: y.balance || 0,
|
|
540
|
+
interest_rate: y.interest_rate || 0,
|
|
541
|
+
meta_type: f,
|
|
542
|
+
monthly_payment: y.minimum_payment || 0,
|
|
543
|
+
name: ke(y, {
|
|
449
544
|
allowNickname: d?.show_account_nicknames_in_master
|
|
450
545
|
}),
|
|
451
|
-
track_type:
|
|
452
|
-
}),
|
|
546
|
+
track_type: s.DEBT_TRACK
|
|
547
|
+
}), h(n.alert_goal_added);
|
|
453
548
|
}
|
|
454
|
-
b(!1), t?.(
|
|
549
|
+
b(!1), t?.(s.DEBT_TRACK);
|
|
455
550
|
};
|
|
456
|
-
return /* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: o.map((
|
|
551
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
552
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: o.map((_, y) => /* @__PURE__ */ e(vt, { goalType: _, onClick: a }, y)) }),
|
|
458
553
|
/* @__PURE__ */ e(
|
|
459
554
|
Be,
|
|
460
555
|
{
|
|
461
|
-
accounts:
|
|
462
|
-
isOpen:
|
|
556
|
+
accounts: l.filter((_) => !m.find((y) => y.account_guid === _.guid)),
|
|
557
|
+
isOpen: p,
|
|
463
558
|
onClose: () => b(!1),
|
|
464
559
|
onSave: u,
|
|
465
560
|
title: n.select_debt_accounts_title
|
|
@@ -467,9 +562,9 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
467
562
|
)
|
|
468
563
|
] });
|
|
469
564
|
}, Oe = ({ account: t }) => {
|
|
470
|
-
const n =
|
|
471
|
-
return /* @__PURE__ */
|
|
472
|
-
/* @__PURE__ */ e(
|
|
565
|
+
const n = rt(t);
|
|
566
|
+
return /* @__PURE__ */ i(w, { sx: { bgcolor: "background.paper", p: 24 }, children: [
|
|
567
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
473
568
|
te,
|
|
474
569
|
{
|
|
475
570
|
alt: t.name || "",
|
|
@@ -477,24 +572,24 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
477
572
|
}
|
|
478
573
|
) }),
|
|
479
574
|
/* @__PURE__ */ e(
|
|
480
|
-
|
|
575
|
+
k,
|
|
481
576
|
{
|
|
482
577
|
primary: n,
|
|
483
|
-
secondary:
|
|
578
|
+
secondary: v(t.balance || 0, "0,0.00")
|
|
484
579
|
}
|
|
485
580
|
)
|
|
486
581
|
] });
|
|
487
|
-
},
|
|
488
|
-
const { goals: n } =
|
|
489
|
-
const
|
|
490
|
-
t.amount = d,
|
|
582
|
+
}, It = D(({ goal: t }) => {
|
|
583
|
+
const { goals: n } = R(), { setAlert: c, setSelectedGoal: m, updateGoal: h, updateRetirementGoal: r } = G(), [d, l] = A.useState(t.amount), p = !t.guid, b = d < 0 || d > 9999999999e-2, o = t.track_type === s.SAVINGS_TRACK && t.has_been_spent || t.track_type !== s.SAVINGS_TRACK && t.is_complete, a = async () => {
|
|
584
|
+
const _ = { ...t, amount: d };
|
|
585
|
+
t.amount = d, p ? m(_) : (t.track_type !== s.RETIREMENT_TRACK ? await h(_) : await r(_), c(n.alert_goal_updated_amount));
|
|
491
586
|
}, u = () => {
|
|
492
587
|
setTimeout(() => {
|
|
493
|
-
|
|
588
|
+
l(t.amount);
|
|
494
589
|
}, 250);
|
|
495
590
|
};
|
|
496
591
|
return /* @__PURE__ */ e(
|
|
497
|
-
|
|
592
|
+
J,
|
|
498
593
|
{
|
|
499
594
|
isDisabled: o,
|
|
500
595
|
isSaveDisabled: b,
|
|
@@ -502,50 +597,50 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
502
597
|
onCancel: u,
|
|
503
598
|
onSave: a,
|
|
504
599
|
primaryText: n.details_amount_to_save,
|
|
505
|
-
secondaryText:
|
|
506
|
-
zeroStateText:
|
|
600
|
+
secondaryText: v(t.amount, "0,0"),
|
|
601
|
+
zeroStateText: p && t.amount === 0 ? n.add_amount : void 0,
|
|
507
602
|
children: /* @__PURE__ */ e(
|
|
508
|
-
|
|
603
|
+
we,
|
|
509
604
|
{
|
|
510
605
|
amount: d,
|
|
511
606
|
autoFocus: !0,
|
|
512
607
|
error: b,
|
|
513
608
|
fullWidth: !0,
|
|
514
609
|
minAmount: 0,
|
|
515
|
-
setAmount: (
|
|
610
|
+
setAmount: (_) => l(isNaN(Number(_)) ? d : Number(_)),
|
|
516
611
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
517
612
|
}
|
|
518
613
|
)
|
|
519
614
|
}
|
|
520
615
|
);
|
|
521
|
-
}),
|
|
522
|
-
const { visibleCheckingAccounts: n, visibleSavingsAccounts:
|
|
523
|
-
const
|
|
524
|
-
|
|
616
|
+
}), Nt = ({ goal: t }) => {
|
|
617
|
+
const { visibleCheckingAccounts: n, visibleSavingsAccounts: c } = j(), { accounts: m, goals: h } = R(), { setAlert: r, setSelectedGoal: d, updateGoal: l } = G(), p = !t.guid, [b, o] = A.useState(!1), a = async ({ balance: u, guid: _ }) => {
|
|
618
|
+
const y = { ...t, account_guid: _, current_amount: u || 0 };
|
|
619
|
+
p ? d(y) : (await l(y), r(h.alert_account_changed)), o(!1);
|
|
525
620
|
};
|
|
526
|
-
return /* @__PURE__ */
|
|
527
|
-
|
|
528
|
-
/* @__PURE__ */ e(
|
|
621
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
622
|
+
p && !t.account_guid ? /* @__PURE__ */ e(w, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(K, { onClick: () => o(!0), children: [
|
|
623
|
+
/* @__PURE__ */ e(k, { children: /* @__PURE__ */ i(g, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
529
624
|
/* @__PURE__ */ e(ve, { filled: !0 }),
|
|
530
|
-
|
|
625
|
+
h.details_add_account
|
|
531
626
|
] }) }),
|
|
532
|
-
/* @__PURE__ */ e(
|
|
533
|
-
] }) }) : /* @__PURE__ */
|
|
534
|
-
/* @__PURE__ */ e(
|
|
627
|
+
/* @__PURE__ */ e(O, { color: "primary" })
|
|
628
|
+
] }) }) : /* @__PURE__ */ i(g, { sx: { gap: 8, my: 24, mx: 24 }, children: [
|
|
629
|
+
/* @__PURE__ */ e(pe, { onClick: () => o(!0), variant: "text", children: h.details_change_account }),
|
|
535
630
|
/* @__PURE__ */ e(
|
|
536
|
-
|
|
631
|
+
T,
|
|
537
632
|
{
|
|
538
633
|
color: "text.secondary",
|
|
539
634
|
sx: { textAlign: "center", whiteSpace: "wrap" },
|
|
540
635
|
variant: "Paragraph",
|
|
541
|
-
children:
|
|
636
|
+
children: M(h.details_change_account_description, t.name)
|
|
542
637
|
}
|
|
543
638
|
)
|
|
544
639
|
] }),
|
|
545
|
-
/* @__PURE__ */ e(
|
|
546
|
-
n.length > 0 && /* @__PURE__ */ e(
|
|
547
|
-
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: n.map((u) => /* @__PURE__ */ e(
|
|
548
|
-
/* @__PURE__ */ e(
|
|
640
|
+
/* @__PURE__ */ e(X, { isOpen: b, onClose: () => o(!1), title: h.details_change_account, children: /* @__PURE__ */ i(g, { children: [
|
|
641
|
+
n.length > 0 && /* @__PURE__ */ e(T, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: m.account_types[1] }),
|
|
642
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: n.map((u) => /* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(K, { onClick: () => a(u), children: [
|
|
643
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
549
644
|
te,
|
|
550
645
|
{
|
|
551
646
|
alt: u?.name || "",
|
|
@@ -553,17 +648,17 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
553
648
|
}
|
|
554
649
|
) }),
|
|
555
650
|
/* @__PURE__ */ e(
|
|
556
|
-
|
|
651
|
+
k,
|
|
557
652
|
{
|
|
558
653
|
primary: u?.name || u?.feed_name,
|
|
559
|
-
secondary:
|
|
654
|
+
secondary: v(u?.balance || 0, "0,0.00")
|
|
560
655
|
}
|
|
561
656
|
),
|
|
562
|
-
/* @__PURE__ */ e(
|
|
657
|
+
/* @__PURE__ */ e(O, {})
|
|
563
658
|
] }) }, u.guid)) }),
|
|
564
|
-
|
|
565
|
-
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children:
|
|
566
|
-
/* @__PURE__ */ e(
|
|
659
|
+
c.length > 0 && /* @__PURE__ */ e(T, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: m.account_types[2] }),
|
|
660
|
+
/* @__PURE__ */ e(L, { sx: { bgcolor: "background.paper" }, children: c.map((u) => /* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(K, { onClick: () => a(u), children: [
|
|
661
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
567
662
|
te,
|
|
568
663
|
{
|
|
569
664
|
alt: u?.name || "",
|
|
@@ -571,37 +666,37 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
571
666
|
}
|
|
572
667
|
) }),
|
|
573
668
|
/* @__PURE__ */ e(
|
|
574
|
-
|
|
669
|
+
k,
|
|
575
670
|
{
|
|
576
671
|
primary: u?.name || u?.feed_name,
|
|
577
|
-
secondary:
|
|
672
|
+
secondary: v(u?.balance || 0, "0,0.00")
|
|
578
673
|
}
|
|
579
674
|
),
|
|
580
|
-
/* @__PURE__ */ e(
|
|
675
|
+
/* @__PURE__ */ e(O, {})
|
|
581
676
|
] }) }, u.guid)) }),
|
|
582
677
|
/* @__PURE__ */ e(
|
|
583
678
|
Ae,
|
|
584
679
|
{
|
|
585
|
-
description:
|
|
586
|
-
label:
|
|
587
|
-
title:
|
|
680
|
+
description: h.connect_description,
|
|
681
|
+
label: h.connect_button,
|
|
682
|
+
title: h.connect_title
|
|
588
683
|
}
|
|
589
684
|
)
|
|
590
685
|
] }) })
|
|
591
686
|
] });
|
|
592
|
-
},
|
|
593
|
-
const { goals: n } =
|
|
687
|
+
}, wt = D(({ goal: t }) => {
|
|
688
|
+
const { goals: n } = R(), { setAlert: c, setSelectedGoal: m, updateGoal: h } = G(), [r, d] = A.useState(t.name), l = !t.guid, p = t.track_type === s.SAVINGS_TRACK && t.has_been_spent || t.track_type !== s.SAVINGS_TRACK && t.is_complete, b = async () => {
|
|
594
689
|
const a = { ...t, name: r };
|
|
595
|
-
t.name = r,
|
|
690
|
+
t.name = r, l ? m(a) : (await h(a), c(n.alert_goal_updated_name));
|
|
596
691
|
}, o = () => {
|
|
597
692
|
setTimeout(() => {
|
|
598
693
|
d(t.name);
|
|
599
694
|
}, 250);
|
|
600
695
|
};
|
|
601
696
|
return /* @__PURE__ */ e(
|
|
602
|
-
|
|
697
|
+
J,
|
|
603
698
|
{
|
|
604
|
-
isDisabled:
|
|
699
|
+
isDisabled: p,
|
|
605
700
|
isSaveDisabled: !r,
|
|
606
701
|
label: n.details_goal_name,
|
|
607
702
|
onCancel: o,
|
|
@@ -620,11 +715,11 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
620
715
|
)
|
|
621
716
|
}
|
|
622
717
|
);
|
|
623
|
-
}),
|
|
624
|
-
const { goals: n } =
|
|
718
|
+
}), kt = ({ goal: t }) => {
|
|
719
|
+
const { goals: n } = R(), { setAlert: c, setSelectedGoal: m, updateRetirementGoal: h } = G(), [r, d] = A.useState(t.retirement_age || 65), l = !t.guid, p = async () => {
|
|
625
720
|
if (!isNaN(r)) {
|
|
626
721
|
const a = { ...t, retirement_age: r };
|
|
627
|
-
t.retirement_age = r,
|
|
722
|
+
t.retirement_age = r, l ? m(a) : (await h(a), c(n.alert_goal_updated_retirement_age));
|
|
628
723
|
}
|
|
629
724
|
}, b = () => {
|
|
630
725
|
setTimeout(() => {
|
|
@@ -632,16 +727,16 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
632
727
|
}, 250);
|
|
633
728
|
}, o = !r || isNaN(r) || r < 20 || r >= 100;
|
|
634
729
|
return /* @__PURE__ */ e(
|
|
635
|
-
|
|
730
|
+
J,
|
|
636
731
|
{
|
|
637
732
|
isDisabled: t.is_complete,
|
|
638
733
|
isSaveDisabled: o,
|
|
639
734
|
label: n.details_retirement_age,
|
|
640
735
|
onCancel: b,
|
|
641
|
-
onSave:
|
|
736
|
+
onSave: p,
|
|
642
737
|
primaryText: n.details_retirement_age,
|
|
643
738
|
secondaryText: `${t.retirement_age}`,
|
|
644
|
-
zeroStateText:
|
|
739
|
+
zeroStateText: l && !t.retirement_age ? n.add_age : void 0,
|
|
645
740
|
children: /* @__PURE__ */ e(
|
|
646
741
|
De,
|
|
647
742
|
{
|
|
@@ -654,302 +749,302 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
654
749
|
)
|
|
655
750
|
}
|
|
656
751
|
);
|
|
657
|
-
},
|
|
658
|
-
const { goals: n } =
|
|
659
|
-
r &&
|
|
752
|
+
}, Dt = D(({ goal: t }) => {
|
|
753
|
+
const { goals: n } = R(), { user: c, updateUser: m } = Ie(), { setAlert: h } = G(), [r, d] = A.useState(q(c.birthday ?? 0)), [l, p] = A.useState(null), b = t.is_complete, o = async () => {
|
|
754
|
+
r && dt(r) && (await m({ ...c, birthday: ct(r) }), h(n.alert_goal_updated_birthday));
|
|
660
755
|
};
|
|
661
756
|
return /* @__PURE__ */ e(
|
|
662
|
-
|
|
757
|
+
J,
|
|
663
758
|
{
|
|
664
759
|
isDisabled: b,
|
|
665
|
-
isSaveDisabled: !!
|
|
760
|
+
isSaveDisabled: !!l,
|
|
666
761
|
label: n.details_birthday,
|
|
667
762
|
onSave: o,
|
|
668
763
|
primaryText: n.details_birthday,
|
|
669
|
-
secondaryText: `${
|
|
670
|
-
zeroStateText: !t.guid && !
|
|
671
|
-
children: /* @__PURE__ */ e(ut, { dateAdapter:
|
|
672
|
-
|
|
764
|
+
secondaryText: `${ae(q(c.birthday ?? 0), oe.MONTH_DAY_YEAR)}`,
|
|
765
|
+
zeroStateText: !t.guid && !c.birthday ? n.add_birthday : void 0,
|
|
766
|
+
children: /* @__PURE__ */ e(ut, { dateAdapter: mt, children: /* @__PURE__ */ e(
|
|
767
|
+
_t,
|
|
673
768
|
{
|
|
674
769
|
label: n.details_birthday,
|
|
675
770
|
onChange: d,
|
|
676
|
-
onError: (a) =>
|
|
771
|
+
onError: (a) => p(a),
|
|
677
772
|
sx: { width: "100%" },
|
|
678
773
|
value: r
|
|
679
774
|
}
|
|
680
775
|
) })
|
|
681
776
|
}
|
|
682
777
|
);
|
|
683
|
-
}),
|
|
684
|
-
const { goals: n } =
|
|
685
|
-
addRetirementGoalAccount:
|
|
686
|
-
newRetirementGoalAccounts:
|
|
778
|
+
}), Kt = ({ goal: t }) => {
|
|
779
|
+
const { goals: n } = R(), { visibleRetirementAccounts: c } = j(), {
|
|
780
|
+
addRetirementGoalAccount: m,
|
|
781
|
+
newRetirementGoalAccounts: h,
|
|
687
782
|
retirementGoalAccounts: r,
|
|
688
783
|
selectedGoal: d,
|
|
689
|
-
setAlert:
|
|
690
|
-
setNewRetirementGoalAccounts:
|
|
784
|
+
setAlert: l,
|
|
785
|
+
setNewRetirementGoalAccounts: p,
|
|
691
786
|
setSelectedGoal: b
|
|
692
|
-
} = G(), [o, a] =
|
|
693
|
-
(
|
|
694
|
-
),
|
|
695
|
-
(
|
|
696
|
-
),
|
|
697
|
-
const
|
|
698
|
-
account_guid:
|
|
787
|
+
} = G(), [o, a] = A.useState(!1), u = !t.guid, _ = c.filter(
|
|
788
|
+
(S) => u ? h.find((C) => C.account_guid === S.guid) : r.find((C) => C.account_guid === S.guid)
|
|
789
|
+
), y = c.filter(
|
|
790
|
+
(S) => !r.find((C) => C.account_guid === S.guid)
|
|
791
|
+
), f = async (S) => {
|
|
792
|
+
const C = S.map((I) => ({
|
|
793
|
+
account_guid: I.guid,
|
|
699
794
|
retirement_goal_guid: t.guid
|
|
700
795
|
}));
|
|
701
796
|
if (u)
|
|
702
|
-
|
|
797
|
+
p(C);
|
|
703
798
|
else
|
|
704
|
-
for (const
|
|
705
|
-
await
|
|
799
|
+
for (const I of C)
|
|
800
|
+
await m(I), l(n.alert_account_added);
|
|
706
801
|
b({
|
|
707
802
|
...d,
|
|
708
|
-
current_amount:
|
|
803
|
+
current_amount: S.reduce((I, N) => I + (N.balance || 0), 0)
|
|
709
804
|
}), a(!1);
|
|
710
805
|
};
|
|
711
|
-
return /* @__PURE__ */
|
|
712
|
-
|
|
713
|
-
/* @__PURE__ */ e(Oe, { account:
|
|
714
|
-
/* @__PURE__ */ e(
|
|
715
|
-
] },
|
|
716
|
-
/* @__PURE__ */ e(
|
|
717
|
-
/* @__PURE__ */ e(
|
|
806
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
807
|
+
_.map((S) => /* @__PURE__ */ i(g, { children: [
|
|
808
|
+
/* @__PURE__ */ e(Oe, { account: S }),
|
|
809
|
+
/* @__PURE__ */ e(E, {})
|
|
810
|
+
] }, S.guid)),
|
|
811
|
+
/* @__PURE__ */ e(w, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(K, { onClick: () => a(!0), children: [
|
|
812
|
+
/* @__PURE__ */ e(k, { children: /* @__PURE__ */ i(g, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
718
813
|
/* @__PURE__ */ e(ve, { filled: !0 }),
|
|
719
814
|
n.details_add_account
|
|
720
815
|
] }) }),
|
|
721
|
-
/* @__PURE__ */ e(
|
|
816
|
+
/* @__PURE__ */ e(O, { color: "primary" })
|
|
722
817
|
] }) }),
|
|
723
818
|
/* @__PURE__ */ e(
|
|
724
819
|
Be,
|
|
725
820
|
{
|
|
726
|
-
accounts:
|
|
821
|
+
accounts: y,
|
|
727
822
|
isOpen: o,
|
|
728
823
|
onClose: () => a(!1),
|
|
729
|
-
onSave:
|
|
824
|
+
onSave: f,
|
|
730
825
|
title: n.add_select_accounts
|
|
731
826
|
}
|
|
732
827
|
)
|
|
733
828
|
] });
|
|
734
|
-
},
|
|
735
|
-
const { goals: n } =
|
|
736
|
-
() =>
|
|
737
|
-
[
|
|
738
|
-
),
|
|
829
|
+
}, Mt = D(({ goal: t }) => {
|
|
830
|
+
const { goals: n } = R(), { visibleAccounts: c } = j(), m = A.useMemo(
|
|
831
|
+
() => c.find((d) => d.guid === t.account_guid),
|
|
832
|
+
[c, t]
|
|
833
|
+
), h = t.track_type;
|
|
739
834
|
let r = n.details_save_title;
|
|
740
|
-
return t.track_type ===
|
|
741
|
-
/* @__PURE__ */
|
|
742
|
-
/* @__PURE__ */ e(
|
|
835
|
+
return t.track_type === s.DEBT_TRACK ? r = n.details_debt_title : t.track_type === s.RETIREMENT_TRACK && (r = n.details_retirement_title), /* @__PURE__ */ i(g, { children: [
|
|
836
|
+
/* @__PURE__ */ i(g, { mx: 24, children: [
|
|
837
|
+
/* @__PURE__ */ e(T, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: r }),
|
|
743
838
|
/* @__PURE__ */ e(Le, { goal: t, isInDrawer: !0 }),
|
|
744
|
-
/* @__PURE__ */ e(
|
|
839
|
+
/* @__PURE__ */ e(T, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: n.details_title })
|
|
745
840
|
] }),
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
|
|
748
|
-
|
|
841
|
+
/* @__PURE__ */ i(L, { sx: { bgcolor: "background.paper" }, children: [
|
|
842
|
+
h !== s.RETIREMENT_TRACK ? /* @__PURE__ */ e(wt, { goal: t }) : /* @__PURE__ */ e(w, { sx: { px: 24 }, children: /* @__PURE__ */ e(
|
|
843
|
+
k,
|
|
749
844
|
{
|
|
750
|
-
primary: /* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */ e(
|
|
752
|
-
/* @__PURE__ */ e(
|
|
845
|
+
primary: /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
846
|
+
/* @__PURE__ */ e(T, { variant: "body1", children: n.details_goal_name }),
|
|
847
|
+
/* @__PURE__ */ e(T, { bold: !0, color: "text.primary", sx: { mr: 4 }, variant: "body1", children: n.retirement })
|
|
753
848
|
] }),
|
|
754
849
|
primaryTypographyProps: { variant: "body1" }
|
|
755
850
|
}
|
|
756
851
|
) }),
|
|
757
|
-
/* @__PURE__ */ e(
|
|
758
|
-
(
|
|
759
|
-
/* @__PURE__ */ e(
|
|
760
|
-
/* @__PURE__ */ e(
|
|
852
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
853
|
+
(h === s.SAVINGS_TRACK || h === s.RETIREMENT_TRACK) && /* @__PURE__ */ i(H, { children: [
|
|
854
|
+
/* @__PURE__ */ e(It, { goal: t }),
|
|
855
|
+
/* @__PURE__ */ e(E, { sx: { ml: h === s.RETIREMENT_TRACK ? 24 : 0 } })
|
|
761
856
|
] }),
|
|
762
|
-
t.track_type ===
|
|
763
|
-
/* @__PURE__ */ e(rt, { goal: t }),
|
|
764
|
-
/* @__PURE__ */ e(x, { sx: { ml: 24 } }),
|
|
857
|
+
t.track_type === s.DEBT_TRACK && /* @__PURE__ */ i(H, { children: [
|
|
765
858
|
/* @__PURE__ */ e(it, { goal: t }),
|
|
766
|
-
/* @__PURE__ */ e(
|
|
859
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
767
860
|
/* @__PURE__ */ e(st, { goal: t }),
|
|
768
|
-
/* @__PURE__ */ e(
|
|
861
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
862
|
+
/* @__PURE__ */ e(lt, { goal: t }),
|
|
863
|
+
/* @__PURE__ */ e(E, { variant: "fullWidth" })
|
|
769
864
|
] }),
|
|
770
|
-
t.track_type ===
|
|
771
|
-
/* @__PURE__ */ e(Nt, { goal: t }),
|
|
772
|
-
/* @__PURE__ */ e(x, { sx: { ml: 24 } }),
|
|
865
|
+
t.track_type === s.RETIREMENT_TRACK && /* @__PURE__ */ i(H, { children: [
|
|
773
866
|
/* @__PURE__ */ e(kt, { goal: t }),
|
|
774
|
-
/* @__PURE__ */ e(
|
|
867
|
+
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
868
|
+
/* @__PURE__ */ e(Dt, { goal: t }),
|
|
869
|
+
/* @__PURE__ */ e(E, { variant: "fullWidth" })
|
|
775
870
|
] })
|
|
776
871
|
] }),
|
|
777
|
-
/* @__PURE__ */ e(
|
|
778
|
-
t.track_type !==
|
|
779
|
-
/* @__PURE__ */ e(Oe, { account:
|
|
780
|
-
/* @__PURE__ */ e(
|
|
872
|
+
/* @__PURE__ */ e(T, { color: "text.secondary", sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: t.track_type === s.RETIREMENT_TRACK ? n.details_accounts : n.details_account }),
|
|
873
|
+
t.track_type !== s.RETIREMENT_TRACK && m && /* @__PURE__ */ i(H, { children: [
|
|
874
|
+
/* @__PURE__ */ e(Oe, { account: m }),
|
|
875
|
+
/* @__PURE__ */ e(E, {})
|
|
781
876
|
] }),
|
|
782
|
-
t.track_type ===
|
|
783
|
-
/* @__PURE__ */ e(
|
|
784
|
-
/* @__PURE__ */ e(
|
|
877
|
+
t.track_type === s.RETIREMENT_TRACK && /* @__PURE__ */ i(H, { children: [
|
|
878
|
+
/* @__PURE__ */ e(Kt, { goal: t }),
|
|
879
|
+
/* @__PURE__ */ e(E, {})
|
|
785
880
|
] }),
|
|
786
|
-
t.track_type ===
|
|
881
|
+
t.track_type === s.SAVINGS_TRACK && !t.is_complete && /* @__PURE__ */ e(Nt, { goal: t })
|
|
787
882
|
] });
|
|
788
|
-
}),
|
|
789
|
-
const { visibleRetirementAccounts: n } =
|
|
790
|
-
addGoal:
|
|
883
|
+
}), Lt = D(({ onClose: t }) => {
|
|
884
|
+
const { visibleRetirementAccounts: n } = j(), { goals: c, common: m } = R(), {
|
|
885
|
+
addGoal: h,
|
|
791
886
|
addRetirementGoal: r,
|
|
792
887
|
deleteGoal: d,
|
|
793
|
-
deleteRetirementGoal:
|
|
794
|
-
newRetirementGoalAccounts:
|
|
888
|
+
deleteRetirementGoal: l,
|
|
889
|
+
newRetirementGoalAccounts: p,
|
|
795
890
|
retirementGoalAccounts: b,
|
|
796
891
|
selectedGoal: o,
|
|
797
892
|
setAlert: a,
|
|
798
893
|
setSelectedGoal: u,
|
|
799
|
-
updateGoal:
|
|
800
|
-
} = G(), { user:
|
|
801
|
-
const
|
|
802
|
-
return n.filter((
|
|
803
|
-
}, [
|
|
894
|
+
updateGoal: _
|
|
895
|
+
} = G(), { user: y } = Ie(), [f, S] = A.useState(!1), C = !o?.guid, I = o?.track_type === s.SAVINGS_TRACK && o.is_complete && !o.has_been_spent, N = A.useMemo(() => {
|
|
896
|
+
const x = C ? p : b;
|
|
897
|
+
return n.filter((F) => x.some((z) => z.account_guid === F.guid));
|
|
898
|
+
}, [C, n, p, b]), re = A.useMemo(() => {
|
|
804
899
|
if (!o) return !1;
|
|
805
|
-
if (!
|
|
806
|
-
const { account_guid:
|
|
807
|
-
return
|
|
808
|
-
}, [o, N,
|
|
809
|
-
let U =
|
|
810
|
-
|
|
811
|
-
const
|
|
900
|
+
if (!C && !I) return !0;
|
|
901
|
+
const { account_guid: x, track_type: F, name: z, amount: ee, retirement_age: B } = o;
|
|
902
|
+
return F === s.SAVINGS_TRACK ? x ? !!z && !!ee : !1 : F === s.RETIREMENT_TRACK ? N.length ? !!z && !!ee && !!B && !!y.birthday : !1 : !0;
|
|
903
|
+
}, [o, N, y.birthday]);
|
|
904
|
+
let U = m.delete_button, Y = () => S(!0);
|
|
905
|
+
C ? (Y = () => ie(), U = m.save_button) : I && (Y = () => Q(), U = c.mark_as_complete_button);
|
|
906
|
+
const ie = async () => {
|
|
812
907
|
if (o) {
|
|
813
|
-
const
|
|
814
|
-
|
|
908
|
+
const x = o.track_type;
|
|
909
|
+
x !== s.RETIREMENT_TRACK ? await h(o) : x === s.RETIREMENT_TRACK && await r({ ...o, target_amount: o.amount }), a(c.alert_goal_added), u(void 0), x && t?.(x);
|
|
815
910
|
}
|
|
816
911
|
}, W = async () => {
|
|
817
|
-
o && (o.track_type !==
|
|
912
|
+
o && (o.track_type !== s.RETIREMENT_TRACK ? await d(o.guid) : o.track_type === s.RETIREMENT_TRACK && await l(o), a(c.alert_goal_deleted), u(void 0));
|
|
818
913
|
}, Q = async () => {
|
|
819
|
-
const
|
|
914
|
+
const x = {
|
|
820
915
|
...o,
|
|
821
916
|
has_been_spent: !0
|
|
822
917
|
};
|
|
823
|
-
await
|
|
918
|
+
await _(x), a(c.alert_goal_completed), u(void 0);
|
|
824
919
|
};
|
|
825
|
-
return /* @__PURE__ */
|
|
920
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
826
921
|
/* @__PURE__ */ e(
|
|
827
|
-
|
|
922
|
+
X,
|
|
828
923
|
{
|
|
829
|
-
ariaLabelClose:
|
|
830
|
-
hasSecondaryAction:
|
|
924
|
+
ariaLabelClose: m.close_aria,
|
|
925
|
+
hasSecondaryAction: C,
|
|
831
926
|
isOpen: !!o,
|
|
832
|
-
isPrimaryDisabled: !
|
|
927
|
+
isPrimaryDisabled: !re,
|
|
833
928
|
onClose: () => u(void 0),
|
|
834
929
|
onPrimaryAction: Y,
|
|
835
|
-
primaryColor:
|
|
930
|
+
primaryColor: C || I ? "primary" : "error",
|
|
836
931
|
primaryText: U,
|
|
837
932
|
secondaryColor: "primary",
|
|
838
|
-
title:
|
|
839
|
-
children: o && /* @__PURE__ */ e(
|
|
933
|
+
title: c.goal_details,
|
|
934
|
+
children: o && /* @__PURE__ */ e(Mt, { goal: o })
|
|
840
935
|
}
|
|
841
936
|
),
|
|
842
937
|
/* @__PURE__ */ e(
|
|
843
|
-
|
|
938
|
+
tt,
|
|
844
939
|
{
|
|
845
|
-
copy: { close_aria:
|
|
846
|
-
isOpen:
|
|
940
|
+
copy: { close_aria: m.close_aria, title: c.delete_goal },
|
|
941
|
+
isOpen: f,
|
|
847
942
|
maxWidth: "xs",
|
|
848
|
-
onClose: () =>
|
|
943
|
+
onClose: () => S(!1),
|
|
849
944
|
onPrimaryAction: W,
|
|
850
945
|
primaryColor: "error",
|
|
851
|
-
primaryText:
|
|
852
|
-
children: /* @__PURE__ */ e(
|
|
946
|
+
primaryText: m.delete_button,
|
|
947
|
+
children: /* @__PURE__ */ e(T, { sx: { textWrap: "wrap" }, variant: "Paragraph", children: M(c.delete_description, o?.name || "") })
|
|
853
948
|
}
|
|
854
949
|
)
|
|
855
950
|
] });
|
|
856
|
-
}),
|
|
857
|
-
const { onEvent:
|
|
951
|
+
}), zn = D(({ onBackClick: t, sx: n }) => {
|
|
952
|
+
const { onEvent: c } = Ne(), { isMobile: m } = be(), { isAccountDataLoaded: h, loadAccountData: r } = j(), { isInitialized: d } = he(), { goals: l, common: p } = R(), {
|
|
858
953
|
alert: b,
|
|
859
954
|
goals: o,
|
|
860
955
|
isAllGoalDataLoaded: a,
|
|
861
956
|
loadGoalData: u,
|
|
862
|
-
monthlyCashFlowProfile:
|
|
863
|
-
setAlert:
|
|
864
|
-
retirmentGoals:
|
|
865
|
-
} = G(), [
|
|
957
|
+
monthlyCashFlowProfile: _,
|
|
958
|
+
setAlert: y,
|
|
959
|
+
retirmentGoals: f
|
|
960
|
+
} = G(), [S, C] = A.useState(0), [I, N] = A.useState(!1), re = _?.amount_allocated_for_savings_goals || 0, U = _?.amount_allocated_for_debt_goals || 0, Y = _?.amount_allocated_for_retirement_goals || 0;
|
|
866
961
|
Ke({
|
|
867
962
|
widgetName: "GoalsWidget",
|
|
868
963
|
isLoaded: a
|
|
869
|
-
}),
|
|
870
|
-
|
|
871
|
-
}, []),
|
|
964
|
+
}), A.useEffect(() => {
|
|
965
|
+
h || r().finally(), c($.GOALS_VIEW);
|
|
966
|
+
}, []), A.useEffect(() => {
|
|
872
967
|
d && u().finally();
|
|
873
968
|
}, [d]);
|
|
874
|
-
const
|
|
875
|
-
|
|
969
|
+
const ie = () => {
|
|
970
|
+
c($.GOALS_CLICK_FILTER);
|
|
876
971
|
}, W = () => {
|
|
877
|
-
N(!0),
|
|
972
|
+
N(!0), c($.GOALS_CLICK_ADD);
|
|
878
973
|
}, Q = (B) => {
|
|
879
|
-
N(!1), B ===
|
|
880
|
-
},
|
|
881
|
-
() => a && (o.length === 0 || o.every(({ track_type: B }) => !B) &&
|
|
882
|
-
[o, a,
|
|
974
|
+
N(!1), B === s.SAVINGS_TRACK ? C(0) : B === s.DEBT_TRACK ? C(1) : B === s.RETIREMENT_TRACK && C(2);
|
|
975
|
+
}, x = A.useMemo(
|
|
976
|
+
() => a && (o.length === 0 || o.every(({ track_type: B }) => !B) && f.length === 0),
|
|
977
|
+
[o, a, f]
|
|
883
978
|
);
|
|
884
979
|
if (!d || !a)
|
|
885
980
|
return /* @__PURE__ */ e(Me, {});
|
|
886
|
-
const
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
),
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
), ee =
|
|
893
|
-
|
|
894
|
-
|
|
981
|
+
const F = M(
|
|
982
|
+
m ? l.tab_subtitle_mobile : l.tab_subtitle,
|
|
983
|
+
v(re, "0,0")
|
|
984
|
+
), z = M(
|
|
985
|
+
m ? l.tab_subtitle_mobile : l.tab_subtitle,
|
|
986
|
+
v(U, "0,0")
|
|
987
|
+
), ee = M(
|
|
988
|
+
m ? l.tab_subtitle_mobile : l.tab_subtitle,
|
|
989
|
+
v(Y, "0,0")
|
|
895
990
|
);
|
|
896
|
-
return /* @__PURE__ */
|
|
897
|
-
|
|
991
|
+
return /* @__PURE__ */ i(
|
|
992
|
+
pt,
|
|
898
993
|
{
|
|
899
994
|
actions: [
|
|
900
995
|
{
|
|
901
996
|
iconName: "add",
|
|
902
|
-
label:
|
|
997
|
+
label: l.add_title,
|
|
903
998
|
onClick: W
|
|
904
999
|
}
|
|
905
1000
|
],
|
|
906
|
-
onAccountsFilterClick:
|
|
1001
|
+
onAccountsFilterClick: ie,
|
|
907
1002
|
onBackClick: t,
|
|
908
1003
|
sx: n,
|
|
909
|
-
title:
|
|
1004
|
+
title: l.title,
|
|
910
1005
|
children: [
|
|
911
|
-
/* @__PURE__ */
|
|
912
|
-
/* @__PURE__ */
|
|
913
|
-
|
|
1006
|
+
/* @__PURE__ */ i(g, { mx: m ? 0 : 48, my: 24, children: [
|
|
1007
|
+
/* @__PURE__ */ i(
|
|
1008
|
+
ze,
|
|
914
1009
|
{
|
|
915
|
-
onChange: (B, We) =>
|
|
1010
|
+
onChange: (B, We) => C(We),
|
|
916
1011
|
sx: { bgcolor: "background.paper" },
|
|
917
1012
|
textColor: "primary",
|
|
918
|
-
value:
|
|
1013
|
+
value: x ? !1 : S,
|
|
919
1014
|
variant: "fullWidth",
|
|
920
1015
|
children: [
|
|
921
1016
|
/* @__PURE__ */ e(
|
|
922
|
-
|
|
1017
|
+
se,
|
|
923
1018
|
{
|
|
924
|
-
disabled:
|
|
925
|
-
label: /* @__PURE__ */ e(
|
|
1019
|
+
disabled: x,
|
|
1020
|
+
label: /* @__PURE__ */ e(le, { subtitle: F, title: l.tab_saving_title })
|
|
926
1021
|
}
|
|
927
1022
|
),
|
|
928
1023
|
/* @__PURE__ */ e(
|
|
929
|
-
|
|
1024
|
+
se,
|
|
930
1025
|
{
|
|
931
|
-
disabled:
|
|
932
|
-
label: /* @__PURE__ */ e(
|
|
1026
|
+
disabled: x,
|
|
1027
|
+
label: /* @__PURE__ */ e(le, { subtitle: z, title: l.tab_debt_title })
|
|
933
1028
|
}
|
|
934
1029
|
),
|
|
935
1030
|
/* @__PURE__ */ e(
|
|
936
|
-
|
|
1031
|
+
se,
|
|
937
1032
|
{
|
|
938
|
-
disabled:
|
|
939
|
-
label: /* @__PURE__ */ e(
|
|
1033
|
+
disabled: x,
|
|
1034
|
+
label: /* @__PURE__ */ e(le, { subtitle: ee, title: l.tab_retirement_title })
|
|
940
1035
|
}
|
|
941
1036
|
)
|
|
942
1037
|
]
|
|
943
1038
|
}
|
|
944
1039
|
),
|
|
945
|
-
|
|
946
|
-
|
|
1040
|
+
x ? /* @__PURE__ */ e(
|
|
1041
|
+
ht,
|
|
947
1042
|
{
|
|
948
|
-
header:
|
|
1043
|
+
header: l.create_goals_header,
|
|
949
1044
|
icon: "trophy",
|
|
950
1045
|
onClick: W,
|
|
951
|
-
primaryButton:
|
|
952
|
-
subText:
|
|
1046
|
+
primaryButton: l.add_goals_button,
|
|
1047
|
+
subText: l.empty_state_subheader,
|
|
953
1048
|
sx: {
|
|
954
1049
|
width: { sm: 432 },
|
|
955
1050
|
".buttons-footer": {
|
|
@@ -957,67 +1052,67 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
957
1052
|
}
|
|
958
1053
|
}
|
|
959
1054
|
}
|
|
960
|
-
) : /* @__PURE__ */
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
1055
|
+
) : /* @__PURE__ */ i(H, { children: [
|
|
1056
|
+
S === 0 && /* @__PURE__ */ e(ce, { onAddGoals: W, trackType: s.SAVINGS_TRACK }),
|
|
1057
|
+
S === 1 && /* @__PURE__ */ e(ce, { onAddGoals: W, trackType: s.DEBT_TRACK }),
|
|
1058
|
+
S === 2 && /* @__PURE__ */ e(ce, { onAddGoals: W, trackType: s.RETIREMENT_TRACK })
|
|
964
1059
|
] })
|
|
965
1060
|
] }),
|
|
966
|
-
/* @__PURE__ */ e(
|
|
1061
|
+
/* @__PURE__ */ e(Lt, { onClose: Q }),
|
|
967
1062
|
/* @__PURE__ */ e(
|
|
968
|
-
|
|
1063
|
+
X,
|
|
969
1064
|
{
|
|
970
|
-
ariaLabelClose:
|
|
971
|
-
isOpen:
|
|
1065
|
+
ariaLabelClose: p.close_aria,
|
|
1066
|
+
isOpen: I,
|
|
972
1067
|
onClose: () => N(!1),
|
|
973
|
-
title:
|
|
974
|
-
children: /* @__PURE__ */ e(
|
|
1068
|
+
title: l.add_goal_title,
|
|
1069
|
+
children: /* @__PURE__ */ e(Gt, { onClose: Q })
|
|
975
1070
|
}
|
|
976
1071
|
),
|
|
977
|
-
/* @__PURE__ */ e(
|
|
1072
|
+
/* @__PURE__ */ e(Fe, { onClose: () => y(""), open: !!b, children: /* @__PURE__ */ e(je, { onClose: () => y(""), severity: "success", variant: "filled", children: b }) })
|
|
978
1073
|
]
|
|
979
1074
|
}
|
|
980
1075
|
);
|
|
981
|
-
}),
|
|
982
|
-
const { goals: n } =
|
|
983
|
-
backgroundColor:
|
|
984
|
-
color:
|
|
1076
|
+
}), Bt = D(({ goal: t }) => {
|
|
1077
|
+
const { goals: n } = R(), c = yt(), {
|
|
1078
|
+
backgroundColor: m,
|
|
1079
|
+
color: h,
|
|
985
1080
|
percentage: r,
|
|
986
1081
|
projectedText: d
|
|
987
|
-
} =
|
|
988
|
-
let
|
|
989
|
-
return t.track_type ===
|
|
990
|
-
/* @__PURE__ */ e(
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */ e(
|
|
993
|
-
t.projected_to_complete_at && /* @__PURE__ */ e(
|
|
1082
|
+
} = _e(n, t), l = Math.round(r * 100);
|
|
1083
|
+
let p = /* @__PURE__ */ e(Re, {});
|
|
1084
|
+
return t.track_type === s.DEBT_TRACK ? p = /* @__PURE__ */ e(Ee, {}) : t.track_type === s.RETIREMENT_TRACK && (p = /* @__PURE__ */ e(xe, {})), /* @__PURE__ */ i(g, { alignItems: "center", direction: "row", spacing: 12, sx: { py: 12 }, children: [
|
|
1085
|
+
/* @__PURE__ */ e(ne, { sx: { bgcolor: m, color: h, height: 32, width: 32 }, variant: "rounded", children: p }),
|
|
1086
|
+
/* @__PURE__ */ i(gt, { sx: { width: "100%" }, children: [
|
|
1087
|
+
/* @__PURE__ */ e(ue, { fontSize: 15, fontWeight: 600, variant: "body1", children: t.name }),
|
|
1088
|
+
t.projected_to_complete_at && /* @__PURE__ */ e(T, { color: "text.secondary", variant: "XSmall", children: d })
|
|
994
1089
|
] }),
|
|
995
1090
|
/* @__PURE__ */ e(
|
|
996
|
-
|
|
1091
|
+
ft,
|
|
997
1092
|
{
|
|
998
|
-
backgroundStrokeColor:
|
|
999
|
-
color:
|
|
1000
|
-
percent:
|
|
1093
|
+
backgroundStrokeColor: c.palette.border.lighter,
|
|
1094
|
+
color: c.palette.primary.main,
|
|
1095
|
+
percent: l,
|
|
1001
1096
|
size: 40,
|
|
1002
1097
|
strokeWidth: 3,
|
|
1003
|
-
children: /* @__PURE__ */ e(
|
|
1098
|
+
children: /* @__PURE__ */ e(P, { fontWeight: 700, variant: "caption", children: `${l}%` })
|
|
1004
1099
|
}
|
|
1005
1100
|
)
|
|
1006
1101
|
] });
|
|
1007
|
-
}),
|
|
1102
|
+
}), Ot = ({ header: t, subText: n, sx: c }) => /* @__PURE__ */ i(
|
|
1008
1103
|
g,
|
|
1009
1104
|
{
|
|
1010
1105
|
sx: {
|
|
1011
1106
|
alignItems: "center",
|
|
1012
1107
|
alignSelf: "center",
|
|
1013
1108
|
px: 24,
|
|
1014
|
-
...
|
|
1109
|
+
...c
|
|
1015
1110
|
},
|
|
1016
1111
|
children: [
|
|
1017
1112
|
/* @__PURE__ */ e(qe, { size: 32 }),
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
1113
|
+
/* @__PURE__ */ e(ue, { fontSize: 15, fontWeight: 600, children: t }),
|
|
1019
1114
|
/* @__PURE__ */ e(
|
|
1020
|
-
|
|
1115
|
+
P,
|
|
1021
1116
|
{
|
|
1022
1117
|
color: "text.secondary",
|
|
1023
1118
|
sx: { fontWeight: 400, maxWidth: { sm: 424 }, textAlign: "center" },
|
|
@@ -1027,49 +1122,49 @@ const At = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1027
1122
|
)
|
|
1028
1123
|
]
|
|
1029
1124
|
}
|
|
1030
|
-
),
|
|
1031
|
-
const { isAccountDataLoaded: n, loadAccountData:
|
|
1125
|
+
), Hn = D(({ onCTAClick: t }) => {
|
|
1126
|
+
const { isAccountDataLoaded: n, loadAccountData: c, visibleAccounts: m } = j(), { onEvent: h } = Ne(), { goals: r } = R(), { isInitialized: d } = he(), { ongoingGoalsForMicroWidget: l, isAllGoalDataLoaded: p, loadGoalData: b } = G();
|
|
1032
1127
|
Ke({
|
|
1033
1128
|
widgetName: "GoalsMicroWidget",
|
|
1034
|
-
isLoaded:
|
|
1035
|
-
}),
|
|
1036
|
-
n ||
|
|
1037
|
-
}, []),
|
|
1038
|
-
d && (b().finally(),
|
|
1039
|
-
state:
|
|
1129
|
+
isLoaded: p
|
|
1130
|
+
}), A.useEffect(() => {
|
|
1131
|
+
n || c().finally();
|
|
1132
|
+
}, []), A.useEffect(() => {
|
|
1133
|
+
d && (b().finally(), h($.GOALS_LOAD_WIDGET, {
|
|
1134
|
+
state: m?.length ? "default" : "zeroState"
|
|
1040
1135
|
}));
|
|
1041
1136
|
}, [d]);
|
|
1042
|
-
const o =
|
|
1043
|
-
() =>
|
|
1044
|
-
[
|
|
1137
|
+
const o = A.useMemo(
|
|
1138
|
+
() => p && l.length === 0,
|
|
1139
|
+
[l, p]
|
|
1045
1140
|
), a = () => {
|
|
1046
|
-
|
|
1047
|
-
o ?
|
|
1141
|
+
h(
|
|
1142
|
+
o ? $.GOALS_CLICK_GET_STARTED : $.GOALS_CLICK_VIEW_DETAILS
|
|
1048
1143
|
), t();
|
|
1049
1144
|
};
|
|
1050
|
-
return !d || !
|
|
1051
|
-
|
|
1145
|
+
return !d || !p ? /* @__PURE__ */ e(Me, {}) : /* @__PURE__ */ e(
|
|
1146
|
+
At,
|
|
1052
1147
|
{
|
|
1053
1148
|
className: "mx-goals-microwidget",
|
|
1054
1149
|
ctaLabel: o ? r.get_started : r.view_details,
|
|
1055
1150
|
onCTAClick: a,
|
|
1056
1151
|
title: r.title,
|
|
1057
1152
|
children: o ? /* @__PURE__ */ e(
|
|
1058
|
-
|
|
1153
|
+
Ot,
|
|
1059
1154
|
{
|
|
1060
1155
|
header: r.create_goals_header,
|
|
1061
1156
|
subText: r.micro_zero_state_description
|
|
1062
1157
|
}
|
|
1063
|
-
) : /* @__PURE__ */ e(
|
|
1064
|
-
/* @__PURE__ */ e(
|
|
1065
|
-
|
|
1158
|
+
) : /* @__PURE__ */ e(bt, { sx: { justifyContent: "space-between" }, children: l.map((u, _) => /* @__PURE__ */ i(A.Fragment, { children: [
|
|
1159
|
+
/* @__PURE__ */ e(Bt, { goal: u }),
|
|
1160
|
+
_ !== l.length - 1 && /* @__PURE__ */ e(E, {})
|
|
1066
1161
|
] }, u.guid)) })
|
|
1067
1162
|
}
|
|
1068
1163
|
);
|
|
1069
1164
|
});
|
|
1070
1165
|
export {
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1166
|
+
Un as GoalApi,
|
|
1167
|
+
Yn as GoalStore,
|
|
1168
|
+
Hn as GoalsMicroWidget,
|
|
1169
|
+
zn as GoalsWidget
|
|
1075
1170
|
};
|