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