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