@mx-cartographer/experiences 7.2.1 → 7.2.3
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 +11 -2
- package/dist/{Account-8IUM_CLv.mjs → Account-B-CuHOYf.mjs} +1 -1
- package/dist/{AccountDetailsContent-CuZSSAEc.mjs → AccountDetailsContent-DfzPOeMI.mjs} +8 -8
- package/dist/{AccountDetailsHeader-BZBsIKdF.mjs → AccountDetailsHeader-vcy67tuH.mjs} +6 -6
- package/dist/{AccountFields-BD_0GT68.mjs → AccountFields-cUP-9Hm6.mjs} +2 -2
- package/dist/{AccountListItem-CllIBCao.mjs → AccountListItem-DChcf3SN.mjs} +4 -4
- package/dist/{AccountStore-DeAQv-kI.mjs → AccountStore-D6KiXA1B.mjs} +2 -2
- package/dist/{Accounts-Bvc9TJaO.mjs → Accounts-IeEtQjzA.mjs} +1 -1
- package/dist/{BudgetUtil-psfk-Amb.mjs → BudgetUtil-B2ZXyw-g.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-BmenK5bu.mjs → CategorySelectorDrawer-DUe4lH5-.mjs} +1 -1
- package/dist/{ConnectDrawer-CPTXh70j.mjs → ConnectDrawer-DaFRU5st.mjs} +1 -1
- package/dist/{ConnectionsDrawer-Dkb4vBmt.mjs → ConnectionsDrawer-DHJ7qdWL.mjs} +2 -2
- package/dist/{CurrencyInput-C4xNRL2W.mjs → CurrencyInput-CsCy7uaS.mjs} +1 -1
- package/dist/{DebtsStore-D4grpB4m.mjs → DebtsStore-z3VARSO6.mjs} +1 -1
- package/dist/{ExportCsvAction-CBJAfyAw.mjs → ExportCsvAction-sX8Rg4Ov.mjs} +3 -3
- package/dist/{GoalStore-B5MZzPLZ.mjs → GoalStore-TD0BfzWX.mjs} +2 -2
- package/dist/{Help-CzBAsKA2.mjs → Help-B6dIcujh.mjs} +1 -1
- package/dist/{LineChart-B35qvXik.mjs → LineChart-D4GI7nVh.mjs} +1 -1
- package/dist/{ListItemAction-DSrYDGAP.mjs → ListItemAction-DHa3KJPs.mjs} +1 -1
- package/dist/{ManageIncome-DUuT-yMV.mjs → ManageIncome-D3n1EWxe.mjs} +34 -34
- package/dist/{MicroWidgetContainer-C4QQHfD7.mjs → MicroWidgetContainer-DpeqN9n3.mjs} +1 -1
- package/dist/{MiniWidgetContainer-DTQdRK-3.mjs → MiniWidgetContainer-D0gfmbaF.mjs} +1 -1
- package/dist/{NetWorthStore-Do1Gk8Te.mjs → NetWorthStore-B_1oulrt.mjs} +2 -2
- package/dist/{NotificationSettings-BuShgjn6.mjs → NotificationSettings-BRm_EJZV.mjs} +3 -3
- package/dist/{OriginalBalanceAction-BsxcvNEF.mjs → OriginalBalanceAction-CAaVbVMO.mjs} +3 -3
- package/dist/{RecurringSettings-BVOt46uV.mjs → RecurringSettings-C28GrQcP.mjs} +3 -3
- package/dist/{TransactionDetails-_cXLXTd3.mjs → TransactionDetails-BWffqew4.mjs} +5 -5
- package/dist/{TransactionStore-DUVfWzsI.mjs → TransactionStore-DxPLdF3B.mjs} +2 -2
- package/dist/{TrendsStore-ZZ8X36lJ.mjs → TrendsStore-DCYbpXPO.mjs} +1 -1
- package/dist/{User-DaJAQ09j.mjs → User-BQUxBeZV.mjs} +1 -1
- package/dist/{WidgetContainer-DtPnPQZY.mjs → WidgetContainer-C88Ecu2W.mjs} +2 -2
- package/dist/accounts/index.es.js +13 -13
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +10 -10
- package/dist/cashflow/index.es.js +440 -436
- package/dist/categories/index.es.js +1 -1
- package/dist/common/context/GlobalDataProvider.d.ts +1 -0
- package/dist/common/context/hooks.d.ts +3 -0
- package/dist/common/context/index.d.ts +1 -1
- package/dist/common/index.es.js +50 -49
- package/dist/dashboard/index.es.js +81 -79
- package/dist/debts/index.es.js +9 -9
- package/dist/{exportTransactionsToCSV-D8TTNrrE.mjs → exportTransactionsToCSV-7bVS7KXf.mjs} +1 -1
- package/dist/finstrong/index.es.js +6 -6
- package/dist/goals/index.es.js +12 -12
- package/dist/help/index.es.js +3 -3
- package/dist/hooks-D6XlXHf4.mjs +77 -0
- 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 +2 -2
- package/dist/recurringtransactions/index.es.js +19 -19
- package/dist/settings/index.es.js +6 -6
- package/dist/spending/index.es.js +4 -4
- package/dist/transactions/index.es.js +13 -13
- package/dist/trends/index.es.js +449 -449
- package/dist/{useAccountDisplayName-BXGkZN5B.mjs → useAccountDisplayName-BcRqfar8.mjs} +2 -2
- package/dist/{useInsightsEnabled-DSnpkUq0.mjs → useInsightsEnabled-DBpwEq10.mjs} +1 -1
- package/package.json +1 -1
- package/dist/hooks-CE2TKk4a.mjs +0 -74
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { jsxs as o, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as o, Fragment as P, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import f, { useState as ee } from "react";
|
|
3
3
|
import { observer as T } from "mobx-react-lite";
|
|
4
|
-
import { addMonths as
|
|
5
|
-
import { startOfToday as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import { addMonths as Xe } from "date-fns/addMonths";
|
|
5
|
+
import { startOfToday as $ } from "date-fns/startOfToday";
|
|
6
|
+
import I from "@mui/material/Box";
|
|
7
|
+
import D from "@mui/material/Divider";
|
|
8
8
|
import s from "@mui/material/Stack";
|
|
9
|
-
import
|
|
10
|
-
import { Text as u, P as
|
|
11
|
-
import { G as
|
|
12
|
-
import { C as
|
|
13
|
-
import { u as
|
|
14
|
-
import { L as
|
|
15
|
-
import { I as
|
|
16
|
-
import { C as
|
|
17
|
-
import { b as
|
|
18
|
-
import { M as
|
|
19
|
-
import { E as
|
|
20
|
-
import { R as
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { getUnixTime as
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import { A as
|
|
27
|
-
import { f as
|
|
28
|
-
import
|
|
29
|
-
import { f as
|
|
30
|
-
import { isAfter as
|
|
31
|
-
import { isBefore as
|
|
32
|
-
import { isToday as
|
|
33
|
-
import { addDays as
|
|
34
|
-
import { alpha as
|
|
35
|
-
import { DataGridPro as
|
|
36
|
-
import { T as
|
|
37
|
-
import
|
|
38
|
-
import { M as
|
|
39
|
-
import { D as
|
|
40
|
-
import { formatISO as
|
|
41
|
-
import { fromUnixTime as
|
|
42
|
-
import { startOfMonth as
|
|
43
|
-
import { subDays as
|
|
44
|
-
import { S as
|
|
45
|
-
import { F as
|
|
46
|
-
import { h as
|
|
47
|
-
import { endOfToday as
|
|
48
|
-
import { W as
|
|
49
|
-
import { F as
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
9
|
+
import le from "@mui/material/styles/useTheme";
|
|
10
|
+
import { Text as u, P as N, Icon as j, InstitutionLogo as ye, H1 as ue, H2 as Ye } from "@mxenabled/mxui";
|
|
11
|
+
import { G as Qe, v as he, u as O, q as de, d as Ne, b as X, j as q, g as ke, p as He, h as Fe, a as Ve } from "../hooks-D6XlXHf4.mjs";
|
|
12
|
+
import { C as L } from "../CurrencyText-kyC1aseI.mjs";
|
|
13
|
+
import { u as pe } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
14
|
+
import { L as oe } from "../Loader-DUaFpDGv.mjs";
|
|
15
|
+
import { I as fe } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
16
|
+
import { C as jn } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
17
|
+
import { b as M } from "../Localization-2MODESHW.mjs";
|
|
18
|
+
import { M as Ke } from "../MiniWidgetContainer-D0gfmbaF.mjs";
|
|
19
|
+
import { E as Je } from "../EmptyState-DA_lfRBv.mjs";
|
|
20
|
+
import { R as Ze } from "../RecurringSettings-C28GrQcP.mjs";
|
|
21
|
+
import et from "@mui/material/Tabs";
|
|
22
|
+
import Ce from "@mui/material/Tab";
|
|
23
|
+
import { getUnixTime as U } from "date-fns/getUnixTime";
|
|
24
|
+
import ne from "@mui/material/List";
|
|
25
|
+
import ae from "@mui/material/ListItem";
|
|
26
|
+
import { A as tt } from "../AccountListItem-DChcf3SN.mjs";
|
|
27
|
+
import { f as Y, D as Q } from "../Dialog-CWW597AF.mjs";
|
|
28
|
+
import nt from "@mui/material/ListSubheader";
|
|
29
|
+
import { f as te } from "../NumberFormatting-Buh7u8Oi.mjs";
|
|
30
|
+
import { isAfter as We } from "date-fns/isAfter";
|
|
31
|
+
import { isBefore as $e } from "date-fns/isBefore";
|
|
32
|
+
import { isToday as Me } from "date-fns/isToday";
|
|
33
|
+
import { addDays as Se } from "date-fns/addDays";
|
|
34
|
+
import { alpha as ot, keyframes as at } from "@mui/material/styles";
|
|
35
|
+
import { DataGridPro as it } from "@mui/x-data-grid-pro";
|
|
36
|
+
import { T as we } from "../TabContentContainer-j01JYR_7.mjs";
|
|
37
|
+
import G from "@mui/material/Button";
|
|
38
|
+
import { M as rt, S as st, i as ct, d as _e, c as lt } from "../ManageIncome-D3n1EWxe.mjs";
|
|
39
|
+
import { D as Ge } from "../Drawer-kEE73B87.mjs";
|
|
40
|
+
import { formatISO as dt } from "date-fns/formatISO";
|
|
41
|
+
import { fromUnixTime as Ie } from "date-fns/fromUnixTime";
|
|
42
|
+
import { startOfMonth as mt } from "date-fns/startOfMonth";
|
|
43
|
+
import { subDays as je } from "date-fns/subDays";
|
|
44
|
+
import { S as ut, b as ht } from "../TransactionDetails-BWffqew4.mjs";
|
|
45
|
+
import { F as pt, R as De, e as ve } from "../RecurringTransactions-ej39mgA6.mjs";
|
|
46
|
+
import { h as ft } from "../DateUtil-BcuH7ErC.mjs";
|
|
47
|
+
import { endOfToday as gt } from "date-fns/endOfToday";
|
|
48
|
+
import { W as Ae, A as Ee } from "../WidgetContainer-C88Ecu2W.mjs";
|
|
49
|
+
import { F as bt, A as B } from "../Fetch-87LIQbEA.mjs";
|
|
50
|
+
const V = () => {
|
|
51
|
+
if (!f.useContext(Qe))
|
|
52
52
|
throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
|
|
53
|
-
return
|
|
54
|
-
},
|
|
55
|
-
const { cashflow: n } =
|
|
56
|
-
return /* @__PURE__ */ o(
|
|
53
|
+
return he().uiStore;
|
|
54
|
+
}, xt = ({ remaining: a }) => {
|
|
55
|
+
const { cashflow: n } = O();
|
|
56
|
+
return /* @__PURE__ */ o(P, { children: [
|
|
57
57
|
/* @__PURE__ */ e(
|
|
58
|
-
|
|
58
|
+
I,
|
|
59
59
|
{
|
|
60
60
|
sx: {
|
|
61
61
|
borderRadius: "1px",
|
|
@@ -66,37 +66,37 @@ const K = () => {
|
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
68
|
/* @__PURE__ */ e(u, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: n.remaining_cash }),
|
|
69
|
-
/* @__PURE__ */ e(
|
|
69
|
+
/* @__PURE__ */ e(L, { amount: a, bold: !0, sx: { fontSize: 12 } })
|
|
70
70
|
] });
|
|
71
|
-
},
|
|
72
|
-
const a =
|
|
73
|
-
daysUntilNextIncome:
|
|
74
|
-
expensesTilNextIncome:
|
|
75
|
-
selectedCashAccounts:
|
|
71
|
+
}, ge = T(xt), yt = () => {
|
|
72
|
+
const a = le(), { availableWidth: n } = de(), { isMobile: t } = pe(), { visibleCashAccounts: i, visibleCashBalance: g } = Ne(), { selectedAccounts: x, selectedAccountGuids: m, setSelectedAccounts: p } = X(), { cashflow: c } = O(), {
|
|
73
|
+
daysUntilNextIncome: r,
|
|
74
|
+
expensesTilNextIncome: d,
|
|
75
|
+
selectedCashAccounts: l,
|
|
76
76
|
setNextIncome: b,
|
|
77
77
|
setSelectedCashAccounts: C,
|
|
78
|
-
setUpcomingExpenses:
|
|
79
|
-
} =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}, [
|
|
78
|
+
setUpcomingExpenses: _
|
|
79
|
+
} = V(), { isDataLoaded: k, nextIncomeRecurrence: v, upcomingExpenses: F } = q();
|
|
80
|
+
f.useEffect(() => {
|
|
81
|
+
p(i);
|
|
82
|
+
}, [i]), f.useEffect(() => {
|
|
83
83
|
C(
|
|
84
|
-
|
|
84
|
+
i.filter((w) => m.includes(w.guid))
|
|
85
85
|
);
|
|
86
|
-
}, [
|
|
87
|
-
|
|
88
|
-
}, [
|
|
89
|
-
const h =
|
|
90
|
-
() =>
|
|
91
|
-
[
|
|
92
|
-
),
|
|
93
|
-
() =>
|
|
94
|
-
[
|
|
95
|
-
),
|
|
96
|
-
() => h -
|
|
97
|
-
[h,
|
|
86
|
+
}, [i, x]), f.useEffect(() => {
|
|
87
|
+
v && b(v), _(F);
|
|
88
|
+
}, [v, F]);
|
|
89
|
+
const h = f.useMemo(
|
|
90
|
+
() => i.filter((w) => m.includes(w.guid)).reduce((w, z) => w + (z?.balance || 0), 0),
|
|
91
|
+
[m, F]
|
|
92
|
+
), S = f.useMemo(
|
|
93
|
+
() => d.filter((w) => m.includes(w.accountGuid || "")).reduce((w, z) => w + z.amount, 0),
|
|
94
|
+
[m, d]
|
|
95
|
+
), A = f.useMemo(
|
|
96
|
+
() => h - S,
|
|
97
|
+
[h, S]
|
|
98
98
|
);
|
|
99
|
-
return
|
|
99
|
+
return k ? /* @__PURE__ */ e(I, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: n > 710 ? /* @__PURE__ */ o(
|
|
100
100
|
s,
|
|
101
101
|
{
|
|
102
102
|
border: `1px solid ${a.palette.border.light}`,
|
|
@@ -106,45 +106,45 @@ const K = () => {
|
|
|
106
106
|
px: 24,
|
|
107
107
|
children: [
|
|
108
108
|
/* @__PURE__ */ o(s, { pb: 14, pt: 12, children: [
|
|
109
|
-
/* @__PURE__ */ e(
|
|
110
|
-
/* @__PURE__ */ e(
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
/* @__PURE__ */ e(L, { amount: h, variant: "H2" }),
|
|
110
|
+
/* @__PURE__ */ e(N, { variant: "XSmall", whiteSpace: "nowrap", children: M(
|
|
111
|
+
c.total_cash_accounts,
|
|
112
|
+
l.length
|
|
113
113
|
) })
|
|
114
114
|
] }),
|
|
115
|
-
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(
|
|
115
|
+
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(j, { name: "remove" }) }),
|
|
116
116
|
/* @__PURE__ */ o(s, { pb: 14, pt: 12, children: [
|
|
117
|
-
/* @__PURE__ */ e(
|
|
118
|
-
/* @__PURE__ */ e(
|
|
117
|
+
/* @__PURE__ */ e(L, { amount: S, variant: "H2" }),
|
|
118
|
+
/* @__PURE__ */ e(N, { variant: "XSmall", whiteSpace: "nowrap", children: M(c.expenses_due, d.length) })
|
|
119
119
|
] }),
|
|
120
|
-
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(
|
|
120
|
+
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(j, { name: "equal" }) }),
|
|
121
121
|
/* @__PURE__ */ o(s, { pb: 14, pr: 24, pt: 12, children: [
|
|
122
|
-
/* @__PURE__ */ e(
|
|
122
|
+
/* @__PURE__ */ e(L, { amount: A, variant: "H2" }),
|
|
123
123
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
124
|
-
/* @__PURE__ */ e(
|
|
125
|
-
/* @__PURE__ */ e(
|
|
124
|
+
/* @__PURE__ */ e(N, { variant: "XSmall", whiteSpace: "nowrap", children: c.available_to_spend }),
|
|
125
|
+
/* @__PURE__ */ e(fe, { body: c.tooltip_body, title: c.tooltip_title })
|
|
126
126
|
] })
|
|
127
127
|
] }),
|
|
128
|
-
/* @__PURE__ */ e(s, { borderLeft: `1px solid ${a.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ o(
|
|
129
|
-
/* @__PURE__ */ e(u, { variant: "H2", children:
|
|
130
|
-
/* @__PURE__ */ e(
|
|
128
|
+
/* @__PURE__ */ e(s, { borderLeft: `1px solid ${a.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ o(P, { children: [
|
|
129
|
+
/* @__PURE__ */ e(u, { variant: "H2", children: M(c.days, r) }),
|
|
130
|
+
/* @__PURE__ */ e(N, { variant: "XSmall", whiteSpace: "nowrap", children: c.next_paycheck })
|
|
131
131
|
] }) })
|
|
132
132
|
]
|
|
133
133
|
}
|
|
134
134
|
) : /* @__PURE__ */ o(s, { border: `1px solid ${a.palette.border.light}`, borderRadius: 1, children: [
|
|
135
135
|
/* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
136
|
-
/* @__PURE__ */ e(u, { variant: "Small", children:
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: M(
|
|
137
|
+
c.total_cash_accounts,
|
|
138
|
+
l.length
|
|
139
139
|
) }),
|
|
140
|
-
/* @__PURE__ */ e(
|
|
140
|
+
/* @__PURE__ */ e(L, { amount: g, bold: !0, variant: "XSmall" })
|
|
141
141
|
] }),
|
|
142
|
-
/* @__PURE__ */ e(
|
|
142
|
+
/* @__PURE__ */ e(D, {}),
|
|
143
143
|
/* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
144
|
-
/* @__PURE__ */ e(u, { variant: "Small", children:
|
|
145
|
-
/* @__PURE__ */ e(
|
|
144
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: M(c.expenses_due, d.length) }),
|
|
145
|
+
/* @__PURE__ */ e(L, { amount: S, bold: !0, symbol: "-", variant: "XSmall" })
|
|
146
146
|
] }),
|
|
147
|
-
/* @__PURE__ */ e(
|
|
147
|
+
/* @__PURE__ */ e(D, {}),
|
|
148
148
|
/* @__PURE__ */ e(
|
|
149
149
|
s,
|
|
150
150
|
{
|
|
@@ -156,52 +156,52 @@ const K = () => {
|
|
|
156
156
|
justifyContent: "space-between",
|
|
157
157
|
px: 16,
|
|
158
158
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
159
|
-
children: /* @__PURE__ */ e(
|
|
159
|
+
children: /* @__PURE__ */ e(ge, { remaining: A })
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
|
-
/* @__PURE__ */ e(
|
|
162
|
+
/* @__PURE__ */ e(D, {}),
|
|
163
163
|
/* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
164
|
-
/* @__PURE__ */ e(u, { variant: "Small", children:
|
|
165
|
-
/* @__PURE__ */ e(u, { bold: !0, variant: "XSmall", children:
|
|
164
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: c.next_paycheck }),
|
|
165
|
+
/* @__PURE__ */ e(u, { bold: !0, variant: "XSmall", children: M(c.days, r) })
|
|
166
166
|
] })
|
|
167
|
-
] }) }) : /* @__PURE__ */ e(
|
|
168
|
-
},
|
|
167
|
+
] }) }) : /* @__PURE__ */ e(oe, { height: t ? 210 : 120 });
|
|
168
|
+
}, Ct = T(yt), St = ({
|
|
169
169
|
onPrimaryCtaClick: a,
|
|
170
170
|
onSecondaryCtaClick: n,
|
|
171
171
|
sx: t = {}
|
|
172
172
|
}) => {
|
|
173
|
-
const { cashflow:
|
|
174
|
-
|
|
175
|
-
x && (
|
|
173
|
+
const { cashflow: i } = O(), { isCopyLoaded: g, isInitialized: x } = X(), { loadRepeatingTransactions: m, income: p, isDataLoaded: c, setDateRange: r } = q();
|
|
174
|
+
f.useEffect(() => {
|
|
175
|
+
x && (r({ start: $(), end: Xe($(), 1) }), m().finally());
|
|
176
176
|
}, [x]);
|
|
177
|
-
const
|
|
178
|
-
return
|
|
179
|
-
|
|
177
|
+
const d = c && !p.length;
|
|
178
|
+
return g ? /* @__PURE__ */ o(
|
|
179
|
+
Ke,
|
|
180
180
|
{
|
|
181
181
|
className: "mx-exp-cashflow-miniwidget",
|
|
182
182
|
onPrimaryCtaClick: a,
|
|
183
|
-
primaryCtaLabel:
|
|
184
|
-
subTitle:
|
|
183
|
+
primaryCtaLabel: i.primary_cta,
|
|
184
|
+
subTitle: d || !c ? void 0 : i.sub_title,
|
|
185
185
|
sx: t,
|
|
186
|
-
title:
|
|
186
|
+
title: i.title,
|
|
187
187
|
children: [
|
|
188
|
-
!
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
!c && /* @__PURE__ */ e(oe, {}),
|
|
189
|
+
c && (d ? /* @__PURE__ */ e(
|
|
190
|
+
Je,
|
|
191
191
|
{
|
|
192
|
-
header:
|
|
192
|
+
header: i.create,
|
|
193
193
|
icon: "local_atm",
|
|
194
194
|
onClick: n,
|
|
195
|
-
primaryButton:
|
|
195
|
+
primaryButton: i.add_income,
|
|
196
196
|
primaryButtonStartIcon: "add",
|
|
197
|
-
subText:
|
|
197
|
+
subText: i.create_description
|
|
198
198
|
}
|
|
199
|
-
) : /* @__PURE__ */ e(
|
|
199
|
+
) : /* @__PURE__ */ e(Ct, {}))
|
|
200
200
|
]
|
|
201
201
|
}
|
|
202
|
-
) : /* @__PURE__ */ e(
|
|
203
|
-
},
|
|
204
|
-
|
|
202
|
+
) : /* @__PURE__ */ e(oe, {});
|
|
203
|
+
}, Fn = T(St), wt = ({ remaining: a }) => /* @__PURE__ */ e(
|
|
204
|
+
ae,
|
|
205
205
|
{
|
|
206
206
|
sx: {
|
|
207
207
|
alignItems: "center",
|
|
@@ -213,19 +213,19 @@ const K = () => {
|
|
|
213
213
|
borderBottomRightRadius: "3px",
|
|
214
214
|
minHeight: "auto"
|
|
215
215
|
},
|
|
216
|
-
children: /* @__PURE__ */ e(
|
|
216
|
+
children: /* @__PURE__ */ e(ge, { remaining: a })
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
|
-
var
|
|
220
|
-
const
|
|
221
|
-
/* @__PURE__ */ o(
|
|
219
|
+
var ie = /* @__PURE__ */ ((a) => (a.EXPENSE = "expense", a.INCOME = "income", a))(ie || {});
|
|
220
|
+
const _t = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
221
|
+
/* @__PURE__ */ o(ae, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
|
|
222
222
|
/* @__PURE__ */ o(s, { alignItems: "center", height: 32, width: 32, children: [
|
|
223
|
-
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children:
|
|
224
|
-
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children:
|
|
223
|
+
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children: Y(a.expectedDate, Q.MONTH) }),
|
|
224
|
+
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children: Y(a.expectedDate, Q.DAY) })
|
|
225
225
|
] }),
|
|
226
226
|
/* @__PURE__ */ e(u, { sx: { flexGrow: 1, fontSize: 13 }, children: a.name }),
|
|
227
227
|
/* @__PURE__ */ e(
|
|
228
|
-
|
|
228
|
+
L,
|
|
229
229
|
{
|
|
230
230
|
amount: a.amount,
|
|
231
231
|
bold: !0,
|
|
@@ -233,12 +233,12 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
233
233
|
}
|
|
234
234
|
)
|
|
235
235
|
] }),
|
|
236
|
-
/* @__PURE__ */ e(
|
|
237
|
-
] }),
|
|
238
|
-
const { cashflow: t } =
|
|
239
|
-
return /* @__PURE__ */ o(
|
|
236
|
+
/* @__PURE__ */ e(D, {})
|
|
237
|
+
] }), Te = T(_t), It = ({ total: a, type: n }) => {
|
|
238
|
+
const { cashflow: t } = O();
|
|
239
|
+
return /* @__PURE__ */ o(P, { children: [
|
|
240
240
|
/* @__PURE__ */ o(
|
|
241
|
-
|
|
241
|
+
nt,
|
|
242
242
|
{
|
|
243
243
|
sx: {
|
|
244
244
|
alignItems: "center",
|
|
@@ -250,40 +250,40 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
250
250
|
px: 24
|
|
251
251
|
},
|
|
252
252
|
children: [
|
|
253
|
-
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 12 }, children: n ===
|
|
253
|
+
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 12 }, children: n === ie.EXPENSE ? t.expenses : t.income }),
|
|
254
254
|
/* @__PURE__ */ o(u, { bold: !0, sx: { fontSize: 13 }, children: [
|
|
255
|
-
n ===
|
|
256
|
-
|
|
255
|
+
n === ie.EXPENSE ? "-" : "+",
|
|
256
|
+
te(a, "0,0.00")
|
|
257
257
|
] })
|
|
258
258
|
]
|
|
259
259
|
}
|
|
260
260
|
),
|
|
261
|
-
/* @__PURE__ */ e(
|
|
261
|
+
/* @__PURE__ */ e(D, {})
|
|
262
262
|
] });
|
|
263
|
-
},
|
|
264
|
-
const { availableWidth: a } =
|
|
263
|
+
}, Re = T(It), ce = (a, n) => (t) => t.accountGuid === a.guid && (Me(t.expectedDate) || We(t.expectedDate, n.start)) && $e(t.expectedDate, n.end), Dt = () => {
|
|
264
|
+
const { availableWidth: a } = de(), { cashflow: n } = O(), { upcomingExpenses: t, upcomingIncome: i } = q(), { dateRange: g, selectedCashAccounts: x } = V();
|
|
265
265
|
return /* @__PURE__ */ o(s, { children: [
|
|
266
266
|
/* @__PURE__ */ o(s, { direction: a < 400 ? "column" : "row", justifyContent: "space-between", children: [
|
|
267
267
|
/* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: n.accounts_breakdown }),
|
|
268
268
|
/* @__PURE__ */ o(u, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: [
|
|
269
|
-
|
|
269
|
+
Y(g.start, Q.FULL_MONTH_DAY),
|
|
270
270
|
" -",
|
|
271
271
|
" ",
|
|
272
|
-
|
|
272
|
+
Y(g.end, Q.FULL_MONTH_DAY)
|
|
273
273
|
] })
|
|
274
274
|
] }),
|
|
275
|
-
/* @__PURE__ */ e(s, { children: x.map((
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
),
|
|
279
|
-
(
|
|
275
|
+
/* @__PURE__ */ e(s, { children: x.map((m) => {
|
|
276
|
+
const p = i.filter(ce(m, g)).sort((l, b) => U(l.expectedDate) - U(b.expectedDate)), c = t.filter(
|
|
277
|
+
ce(m, g)
|
|
278
|
+
), r = p.reduce(
|
|
279
|
+
(l, b) => l + b.amount,
|
|
280
280
|
0
|
|
281
|
-
),
|
|
282
|
-
(
|
|
281
|
+
), d = c.reduce(
|
|
282
|
+
(l, b) => l + b.amount,
|
|
283
283
|
0
|
|
284
284
|
);
|
|
285
285
|
return /* @__PURE__ */ o(
|
|
286
|
-
|
|
286
|
+
ne,
|
|
287
287
|
{
|
|
288
288
|
sx: {
|
|
289
289
|
border: "1px solid",
|
|
@@ -293,9 +293,9 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
293
293
|
},
|
|
294
294
|
children: [
|
|
295
295
|
/* @__PURE__ */ e(
|
|
296
|
-
|
|
296
|
+
tt,
|
|
297
297
|
{
|
|
298
|
-
account:
|
|
298
|
+
account: m,
|
|
299
299
|
listItemProps: {
|
|
300
300
|
disableGutters: !1,
|
|
301
301
|
disablePadding: !1,
|
|
@@ -303,49 +303,49 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
),
|
|
306
|
-
/* @__PURE__ */ e(
|
|
307
|
-
|
|
308
|
-
|
|
306
|
+
/* @__PURE__ */ e(D, {}),
|
|
307
|
+
p.length > 0 && /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
|
|
308
|
+
ne,
|
|
309
309
|
{
|
|
310
|
-
subheader: /* @__PURE__ */ e(
|
|
310
|
+
subheader: /* @__PURE__ */ e(Re, { total: r, type: ie.INCOME }),
|
|
311
311
|
sx: { width: "100%" },
|
|
312
|
-
children:
|
|
312
|
+
children: p.map((l) => /* @__PURE__ */ e(Te, { recurrence: l }, l.repeatingTransactionGuid))
|
|
313
313
|
}
|
|
314
314
|
) }),
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
c.length > 0 && /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
|
|
316
|
+
ne,
|
|
317
317
|
{
|
|
318
|
-
subheader: /* @__PURE__ */ e(
|
|
318
|
+
subheader: /* @__PURE__ */ e(Re, { total: d, type: ie.EXPENSE }),
|
|
319
319
|
sx: { width: "100%" },
|
|
320
|
-
children:
|
|
320
|
+
children: c.map((l) => /* @__PURE__ */ e(Te, { recurrence: l }, l.repeatingTransactionGuid))
|
|
321
321
|
}
|
|
322
322
|
) }),
|
|
323
323
|
/* @__PURE__ */ e(
|
|
324
|
-
|
|
324
|
+
wt,
|
|
325
325
|
{
|
|
326
|
-
remaining: (
|
|
326
|
+
remaining: (m.available_balance || m.balance || 0) + r - d
|
|
327
327
|
}
|
|
328
328
|
)
|
|
329
329
|
]
|
|
330
330
|
},
|
|
331
|
-
|
|
331
|
+
m.guid
|
|
332
332
|
);
|
|
333
333
|
}) })
|
|
334
334
|
] });
|
|
335
|
-
},
|
|
336
|
-
const { availableWidth: a } =
|
|
335
|
+
}, vt = T(Dt), At = () => {
|
|
336
|
+
const { availableWidth: a } = de(), n = le(), { cashflow: t } = O(), { upcomingExpenses: i, upcomingIncome: g } = q(), { dateRange: x, selectedCashAccounts: m } = V(), p = [
|
|
337
337
|
{
|
|
338
338
|
field: "account",
|
|
339
339
|
flex: 1.5,
|
|
340
340
|
headerName: t.accounts,
|
|
341
|
-
renderCell: ({ value: { name:
|
|
342
|
-
const C =
|
|
341
|
+
renderCell: ({ value: { name: r, nickname: d, institution_guid: l, account_number: b } }) => {
|
|
342
|
+
const C = d || r;
|
|
343
343
|
return /* @__PURE__ */ o(s, { alignItems: "center", flexDirection: "row", gap: 12, children: [
|
|
344
344
|
/* @__PURE__ */ e(
|
|
345
|
-
|
|
345
|
+
ye,
|
|
346
346
|
{
|
|
347
347
|
alt: t.institution_logo,
|
|
348
|
-
institutionGuid:
|
|
348
|
+
institutionGuid: l || "",
|
|
349
349
|
size: 16
|
|
350
350
|
}
|
|
351
351
|
),
|
|
@@ -358,56 +358,56 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
358
358
|
flex: 1,
|
|
359
359
|
headerName: t.balance,
|
|
360
360
|
type: "number",
|
|
361
|
-
renderCell: (
|
|
361
|
+
renderCell: (r) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: te(r.value, "0,0.00") })
|
|
362
362
|
},
|
|
363
363
|
{
|
|
364
364
|
field: "income",
|
|
365
365
|
flex: 1,
|
|
366
366
|
headerName: t.projected_income,
|
|
367
367
|
type: "number",
|
|
368
|
-
renderCell: (
|
|
368
|
+
renderCell: (r) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: `+${te(r.value, "0,0.00")}` })
|
|
369
369
|
},
|
|
370
370
|
{
|
|
371
371
|
field: "expenses",
|
|
372
372
|
flex: 1.1,
|
|
373
373
|
headerName: t.projected_expenses,
|
|
374
374
|
type: "number",
|
|
375
|
-
renderCell: (
|
|
375
|
+
renderCell: (r) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: `-${te(r.value, "0,0.00")}` })
|
|
376
376
|
},
|
|
377
377
|
{
|
|
378
378
|
field: "remaining",
|
|
379
379
|
flex: 1,
|
|
380
380
|
headerName: t.remaining,
|
|
381
381
|
type: "number",
|
|
382
|
-
renderCell: (
|
|
383
|
-
const
|
|
382
|
+
renderCell: (r) => {
|
|
383
|
+
const d = r.row.balance + r.row.income - r.row.expenses;
|
|
384
384
|
return /* @__PURE__ */ e(
|
|
385
385
|
u,
|
|
386
386
|
{
|
|
387
|
-
color: Math.sign(
|
|
387
|
+
color: Math.sign(d) === -1 ? n.palette.error.main : n.palette.text.primary,
|
|
388
388
|
variant: "Small",
|
|
389
|
-
children:
|
|
389
|
+
children: te(d, "0,0.00")
|
|
390
390
|
}
|
|
391
391
|
);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
],
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
).reduce((C,
|
|
398
|
-
|
|
399
|
-
).reduce((C,
|
|
394
|
+
], c = f.useMemo(() => m.map((r) => {
|
|
395
|
+
const d = i.filter(
|
|
396
|
+
ce(r, { start: $(), end: Se($(), 30) })
|
|
397
|
+
).reduce((C, _) => C + _.amount, 0), l = g.filter(
|
|
398
|
+
ce(r, { start: $(), end: Se($(), 30) })
|
|
399
|
+
).reduce((C, _) => C + _.amount, 0), b = (r.balance || 0) + l - d;
|
|
400
400
|
return {
|
|
401
|
-
account:
|
|
402
|
-
balance:
|
|
403
|
-
id:
|
|
404
|
-
income:
|
|
405
|
-
expenses:
|
|
401
|
+
account: r,
|
|
402
|
+
balance: r.balance || 0,
|
|
403
|
+
id: r.guid,
|
|
404
|
+
income: l,
|
|
405
|
+
expenses: d,
|
|
406
406
|
remaining: b
|
|
407
407
|
};
|
|
408
|
-
}), [
|
|
408
|
+
}), [m, i, g]);
|
|
409
409
|
return /* @__PURE__ */ o(
|
|
410
|
-
|
|
410
|
+
I,
|
|
411
411
|
{
|
|
412
412
|
sx: {
|
|
413
413
|
width: "100%"
|
|
@@ -433,7 +433,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
433
433
|
}
|
|
434
434
|
),
|
|
435
435
|
/* @__PURE__ */ e(
|
|
436
|
-
|
|
436
|
+
fe,
|
|
437
437
|
{
|
|
438
438
|
body: t.table_tooltip_body,
|
|
439
439
|
title: t.table_tooltip_title
|
|
@@ -441,25 +441,25 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
441
441
|
)
|
|
442
442
|
] }),
|
|
443
443
|
/* @__PURE__ */ o(u, { bold: !0, sx: { fontSize: 15, whiteSpace: "normal" }, children: [
|
|
444
|
-
|
|
444
|
+
Y(x.start, Q.FULL_MONTH_DAY),
|
|
445
445
|
" -",
|
|
446
446
|
" ",
|
|
447
|
-
|
|
447
|
+
Y(x.end, Q.FULL_MONTH_DAY)
|
|
448
448
|
] })
|
|
449
449
|
]
|
|
450
450
|
}
|
|
451
451
|
),
|
|
452
452
|
a > 650 ? /* @__PURE__ */ e(
|
|
453
|
-
|
|
453
|
+
it,
|
|
454
454
|
{
|
|
455
455
|
columnHeaderHeight: 48,
|
|
456
|
-
columns:
|
|
456
|
+
columns: p,
|
|
457
457
|
density: "standard",
|
|
458
458
|
disableColumnMenu: !0,
|
|
459
459
|
disableRowSelectionOnClick: !0,
|
|
460
460
|
hideFooter: !0,
|
|
461
461
|
rowHeight: 48,
|
|
462
|
-
rows:
|
|
462
|
+
rows: c,
|
|
463
463
|
sx: {
|
|
464
464
|
border: "1px solid",
|
|
465
465
|
borderColor: "border.light",
|
|
@@ -467,7 +467,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
467
467
|
"& .MuiDataGrid-columnHeader .MuiIconButton-root": {
|
|
468
468
|
color: n.palette.primary.main,
|
|
469
469
|
"&:hover": {
|
|
470
|
-
backgroundColor:
|
|
470
|
+
backgroundColor: ot(n.palette.primary.main, 0.1)
|
|
471
471
|
}
|
|
472
472
|
},
|
|
473
473
|
"& .MuiDataGrid-columnHeaderTitle": {
|
|
@@ -479,10 +479,10 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
) :
|
|
483
|
-
const { name:
|
|
482
|
+
) : c.map((r) => {
|
|
483
|
+
const { name: d, nickname: l, institution_guid: b, account_number: C } = r.account, _ = l || d;
|
|
484
484
|
return /* @__PURE__ */ e(
|
|
485
|
-
|
|
485
|
+
ne,
|
|
486
486
|
{
|
|
487
487
|
sx: {
|
|
488
488
|
border: "1px solid",
|
|
@@ -490,7 +490,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
490
490
|
borderRadius: 1,
|
|
491
491
|
marginBottom: 24
|
|
492
492
|
},
|
|
493
|
-
children: /* @__PURE__ */ e(
|
|
493
|
+
children: /* @__PURE__ */ e(ae, { sx: { minHeight: "auto" }, children: /* @__PURE__ */ o(s, { width: "100%", children: [
|
|
494
494
|
/* @__PURE__ */ o(
|
|
495
495
|
s,
|
|
496
496
|
{
|
|
@@ -502,20 +502,20 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
502
502
|
children: [
|
|
503
503
|
/* @__PURE__ */ o(s, { alignItems: "center", flexDirection: "row", gap: 8, width: "50%", children: [
|
|
504
504
|
/* @__PURE__ */ e(
|
|
505
|
-
|
|
505
|
+
ye,
|
|
506
506
|
{
|
|
507
507
|
alt: t.institution_logo,
|
|
508
508
|
institutionGuid: b || "",
|
|
509
509
|
size: 16
|
|
510
510
|
}
|
|
511
511
|
),
|
|
512
|
-
/* @__PURE__ */ e(u, { variant: "Small", children: `${
|
|
512
|
+
/* @__PURE__ */ e(u, { variant: "Small", children: `${_} ${C ? `*${C}` : ""}` })
|
|
513
513
|
] }),
|
|
514
|
-
/* @__PURE__ */ e(
|
|
514
|
+
/* @__PURE__ */ e(L, { amount: r.balance, bold: !0, variant: "Small" })
|
|
515
515
|
]
|
|
516
516
|
}
|
|
517
517
|
),
|
|
518
|
-
/* @__PURE__ */ e(
|
|
518
|
+
/* @__PURE__ */ e(D, { sx: { width: "100%" } }),
|
|
519
519
|
/* @__PURE__ */ o(
|
|
520
520
|
s,
|
|
521
521
|
{
|
|
@@ -526,11 +526,11 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
526
526
|
py: 12,
|
|
527
527
|
children: [
|
|
528
528
|
/* @__PURE__ */ e(u, { variant: "Small", children: t.projected_income }),
|
|
529
|
-
/* @__PURE__ */ e(
|
|
529
|
+
/* @__PURE__ */ e(L, { amount: r.income, bold: !0, symbol: "+", variant: "Small" })
|
|
530
530
|
]
|
|
531
531
|
}
|
|
532
532
|
),
|
|
533
|
-
/* @__PURE__ */ e(
|
|
533
|
+
/* @__PURE__ */ e(D, { sx: { width: "100%" } }),
|
|
534
534
|
/* @__PURE__ */ o(
|
|
535
535
|
s,
|
|
536
536
|
{
|
|
@@ -541,11 +541,11 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
541
541
|
py: 12,
|
|
542
542
|
children: [
|
|
543
543
|
/* @__PURE__ */ e(u, { variant: "Small", children: t.projected_expenses }),
|
|
544
|
-
/* @__PURE__ */ e(
|
|
544
|
+
/* @__PURE__ */ e(L, { amount: r.expenses, bold: !0, symbol: "-", variant: "Small" })
|
|
545
545
|
]
|
|
546
546
|
}
|
|
547
547
|
),
|
|
548
|
-
/* @__PURE__ */ e(
|
|
548
|
+
/* @__PURE__ */ e(D, { sx: { width: "100%" } }),
|
|
549
549
|
/* @__PURE__ */ e(
|
|
550
550
|
s,
|
|
551
551
|
{
|
|
@@ -557,36 +557,36 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
557
557
|
px: 16,
|
|
558
558
|
py: 12,
|
|
559
559
|
sx: { borderBottomLeftRadius: "4px", borderBottomRightRadius: "4px" },
|
|
560
|
-
children: /* @__PURE__ */ e(
|
|
560
|
+
children: /* @__PURE__ */ e(ge, { remaining: r.remaining })
|
|
561
561
|
}
|
|
562
562
|
)
|
|
563
563
|
] }) })
|
|
564
564
|
},
|
|
565
|
-
|
|
565
|
+
r.id
|
|
566
566
|
);
|
|
567
567
|
})
|
|
568
568
|
]
|
|
569
569
|
}
|
|
570
570
|
);
|
|
571
|
-
},
|
|
572
|
-
const { cashflow: a } =
|
|
573
|
-
|
|
571
|
+
}, Et = T(At), Tt = () => {
|
|
572
|
+
const { cashflow: a } = O(), { isDesktop: n } = pe(), { onEvent: t } = ke(), [i, g] = f.useState(0), x = (m, p) => {
|
|
573
|
+
g(p);
|
|
574
574
|
};
|
|
575
|
-
return
|
|
576
|
-
t(
|
|
577
|
-
}, [
|
|
575
|
+
return f.useEffect(() => {
|
|
576
|
+
t(i === 0 ? "cash_flow_summary" : "cash_flow_details");
|
|
577
|
+
}, [i]), /* @__PURE__ */ o(I, { children: [
|
|
578
578
|
/* @__PURE__ */ o(
|
|
579
|
-
|
|
579
|
+
et,
|
|
580
580
|
{
|
|
581
581
|
"aria-label": a.cashflow_summary_and_details,
|
|
582
582
|
centered: !0,
|
|
583
583
|
onChange: x,
|
|
584
584
|
textColor: "primary",
|
|
585
|
-
value:
|
|
585
|
+
value: i,
|
|
586
586
|
variant: "fullWidth",
|
|
587
587
|
children: [
|
|
588
588
|
/* @__PURE__ */ e(
|
|
589
|
-
|
|
589
|
+
Ce,
|
|
590
590
|
{
|
|
591
591
|
"aria-controls": "cashflow-tabpanel-0",
|
|
592
592
|
id: "cashflow-tab-0",
|
|
@@ -597,7 +597,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
597
597
|
}
|
|
598
598
|
),
|
|
599
599
|
/* @__PURE__ */ e(
|
|
600
|
-
|
|
600
|
+
Ce,
|
|
601
601
|
{
|
|
602
602
|
"aria-controls": "cashflow-tabpanel-1",
|
|
603
603
|
id: "cashflow-tab-1",
|
|
@@ -610,16 +610,16 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
610
610
|
]
|
|
611
611
|
}
|
|
612
612
|
),
|
|
613
|
-
/* @__PURE__ */ e(
|
|
614
|
-
/* @__PURE__ */ e(
|
|
615
|
-
/* @__PURE__ */ e(
|
|
613
|
+
/* @__PURE__ */ e(I, { sx: { mb: 32 } }),
|
|
614
|
+
/* @__PURE__ */ e(we, { index: 0, name: "cashflow", value: i, children: /* @__PURE__ */ e(I, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(Et, {}) }) }),
|
|
615
|
+
/* @__PURE__ */ e(we, { index: 1, name: "cashflow", value: i, children: /* @__PURE__ */ e(I, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(vt, {}) }) })
|
|
616
616
|
] });
|
|
617
|
-
},
|
|
617
|
+
}, Rt = T(Tt), se = ({
|
|
618
618
|
amount: a,
|
|
619
619
|
isMobile: n = !1,
|
|
620
620
|
isTotal: t = !1,
|
|
621
|
-
label:
|
|
622
|
-
symbol:
|
|
621
|
+
label: i,
|
|
622
|
+
symbol: g,
|
|
623
623
|
tooltip: x
|
|
624
624
|
}) => /* @__PURE__ */ o(
|
|
625
625
|
s,
|
|
@@ -630,25 +630,25 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
630
630
|
padding: n ? "14px 16px" : 0,
|
|
631
631
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
632
632
|
children: [
|
|
633
|
-
!n && /* @__PURE__ */ e(
|
|
633
|
+
!n && /* @__PURE__ */ e(L, { amount: a, component: "h2", variant: "H2" }),
|
|
634
634
|
/* @__PURE__ */ o(s, { alignItems: "center", component: "span", direction: "row", gap: 8, mt: 2, children: [
|
|
635
|
-
/* @__PURE__ */ e(u, { bold: t, variant: "Small", children:
|
|
635
|
+
/* @__PURE__ */ e(u, { bold: t, variant: "Small", children: i }),
|
|
636
636
|
x
|
|
637
637
|
] }),
|
|
638
|
-
n && /* @__PURE__ */ e(
|
|
638
|
+
n && /* @__PURE__ */ e(L, { amount: a, component: "h2", symbol: g, variant: "Small" })
|
|
639
639
|
]
|
|
640
640
|
}
|
|
641
|
-
),
|
|
642
|
-
const { availableWidth: a } =
|
|
643
|
-
() =>
|
|
644
|
-
[
|
|
645
|
-
), b =
|
|
646
|
-
() => x.filter(
|
|
647
|
-
[
|
|
648
|
-
), C =
|
|
649
|
-
() =>
|
|
650
|
-
[
|
|
651
|
-
),
|
|
641
|
+
), Le = (a, n) => (t) => t.accountGuid && a.includes(t.accountGuid) && (Me(t.expectedDate) || We(t.expectedDate, n.start)) && $e(t.expectedDate, n.end), Lt = () => {
|
|
642
|
+
const { availableWidth: a } = de(), { cashflow: n } = O(), { income: t, isDataLoaded: i, upcomingExpenses: g, upcomingIncome: x } = q(), { selectedAccountGuids: m } = X(), { dateRange: p, selectedCashAccounts: c } = V(), [r, d] = f.useState(!1), l = f.useMemo(
|
|
643
|
+
() => g.filter(Le(m, p)),
|
|
644
|
+
[p, m, g]
|
|
645
|
+
), b = f.useMemo(
|
|
646
|
+
() => x.filter(Le(m, p)),
|
|
647
|
+
[p, m, x]
|
|
648
|
+
), C = f.useMemo(
|
|
649
|
+
() => c.reduce((S, A) => S + (A?.balance || 0), 0),
|
|
650
|
+
[c]
|
|
651
|
+
), _ = l.reduce((S, A) => S + A.amount, 0), k = b.reduce((S, A) => S + A.amount, 0), v = C - _ + k, F = i && t.length > 0, h = a < 725;
|
|
652
652
|
return /* @__PURE__ */ o(s, { sx: { mx: h ? 16 : 0, my: h ? 24 : 42 }, children: [
|
|
653
653
|
/* @__PURE__ */ o(
|
|
654
654
|
s,
|
|
@@ -661,54 +661,54 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
661
661
|
justifyContent: "center",
|
|
662
662
|
children: [
|
|
663
663
|
/* @__PURE__ */ e(
|
|
664
|
-
|
|
664
|
+
se,
|
|
665
665
|
{
|
|
666
666
|
amount: C,
|
|
667
667
|
isMobile: h,
|
|
668
|
-
label:
|
|
668
|
+
label: M(n.cash_and_bank, c.length)
|
|
669
669
|
}
|
|
670
670
|
),
|
|
671
|
-
h && /* @__PURE__ */ e(
|
|
672
|
-
F ? /* @__PURE__ */ o(
|
|
671
|
+
h && /* @__PURE__ */ e(D, {}),
|
|
672
|
+
F ? /* @__PURE__ */ o(P, { children: [
|
|
673
673
|
!h && /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
|
|
674
674
|
/* @__PURE__ */ e(
|
|
675
|
-
|
|
675
|
+
se,
|
|
676
676
|
{
|
|
677
|
-
amount:
|
|
677
|
+
amount: k,
|
|
678
678
|
isMobile: h,
|
|
679
679
|
label: n.to_be_received,
|
|
680
680
|
symbol: h ? "+" : void 0
|
|
681
681
|
}
|
|
682
682
|
)
|
|
683
683
|
] }) : /* @__PURE__ */ e(
|
|
684
|
-
|
|
684
|
+
G,
|
|
685
685
|
{
|
|
686
|
-
onClick: () =>
|
|
687
|
-
startIcon: /* @__PURE__ */ e(
|
|
686
|
+
onClick: () => d(!0),
|
|
687
|
+
startIcon: /* @__PURE__ */ e(j, { name: "add" }),
|
|
688
688
|
sx: { fontSize: 13 },
|
|
689
689
|
children: n.add_income
|
|
690
690
|
}
|
|
691
691
|
),
|
|
692
|
-
h ? /* @__PURE__ */ e(
|
|
692
|
+
h ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
|
|
693
693
|
/* @__PURE__ */ e(
|
|
694
|
-
|
|
694
|
+
se,
|
|
695
695
|
{
|
|
696
|
-
amount:
|
|
696
|
+
amount: _,
|
|
697
697
|
isMobile: h,
|
|
698
|
-
label:
|
|
698
|
+
label: M(n.to_be_paid_out, l.length),
|
|
699
699
|
symbol: h ? "-" : void 0
|
|
700
700
|
}
|
|
701
701
|
),
|
|
702
|
-
h ? /* @__PURE__ */ e(
|
|
702
|
+
h ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
|
|
703
703
|
/* @__PURE__ */ e(
|
|
704
|
-
|
|
704
|
+
se,
|
|
705
705
|
{
|
|
706
|
-
amount:
|
|
706
|
+
amount: v,
|
|
707
707
|
isMobile: h,
|
|
708
708
|
isTotal: h,
|
|
709
709
|
label: n.remaining_cash,
|
|
710
710
|
tooltip: /* @__PURE__ */ e(
|
|
711
|
-
|
|
711
|
+
fe,
|
|
712
712
|
{
|
|
713
713
|
body: n.remaining_income_tooltip_body,
|
|
714
714
|
title: n.remaining_income_tooltip_title
|
|
@@ -720,266 +720,270 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
720
720
|
}
|
|
721
721
|
),
|
|
722
722
|
/* @__PURE__ */ e(
|
|
723
|
-
|
|
723
|
+
Ge,
|
|
724
724
|
{
|
|
725
725
|
ariaLabelClose: n.close_manage_income_aria,
|
|
726
|
-
isOpen:
|
|
727
|
-
onClose: () =>
|
|
726
|
+
isOpen: r,
|
|
727
|
+
onClose: () => d(!1),
|
|
728
728
|
shouldShowHeaderBorders: !1,
|
|
729
729
|
title: n.manage_income,
|
|
730
|
-
children: /* @__PURE__ */ e(
|
|
730
|
+
children: /* @__PURE__ */ e(rt, {})
|
|
731
731
|
}
|
|
732
732
|
)
|
|
733
733
|
] });
|
|
734
|
-
},
|
|
735
|
-
const { completeOnboarding: n } =
|
|
734
|
+
}, Ot = T(Lt), Nt = ({ handleNextStep: a }) => {
|
|
735
|
+
const { completeOnboarding: n } = he(), { cashflow: t } = O(), i = le();
|
|
736
736
|
return /* @__PURE__ */ o(s, { children: [
|
|
737
|
-
/* @__PURE__ */ e(
|
|
737
|
+
/* @__PURE__ */ e(ue, { pb: 12, children: t.welcome_title }),
|
|
738
738
|
/* @__PURE__ */ e(
|
|
739
|
-
|
|
739
|
+
Ye,
|
|
740
740
|
{
|
|
741
|
-
color:
|
|
741
|
+
color: i.palette.primary.light,
|
|
742
742
|
pb: 8,
|
|
743
743
|
sx: { wordBreak: "break-word", whiteSpace: "initial" },
|
|
744
744
|
variant: "H3",
|
|
745
745
|
children: t.welcome_sub_title
|
|
746
746
|
}
|
|
747
747
|
),
|
|
748
|
-
/* @__PURE__ */ e(
|
|
748
|
+
/* @__PURE__ */ e(N, { pb: 32, children: t.welcome_description }),
|
|
749
749
|
/* @__PURE__ */ o(s, { direction: "column", mb: 32, spacing: 32, children: [
|
|
750
|
-
/* @__PURE__ */ o(
|
|
750
|
+
/* @__PURE__ */ o(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
751
751
|
/* @__PURE__ */ e(
|
|
752
|
-
|
|
752
|
+
I,
|
|
753
753
|
{
|
|
754
|
-
bgcolor:
|
|
754
|
+
bgcolor: i.palette.primary.lighter,
|
|
755
755
|
borderRadius: 1,
|
|
756
756
|
component: "span",
|
|
757
757
|
height: 44,
|
|
758
758
|
mr: 24,
|
|
759
759
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
760
760
|
width: 44,
|
|
761
|
-
children: /* @__PURE__ */ e(
|
|
761
|
+
children: /* @__PURE__ */ e(j, { color: "primary", name: "currency_exchange" })
|
|
762
762
|
}
|
|
763
763
|
),
|
|
764
764
|
t.bullet_one
|
|
765
765
|
] }),
|
|
766
|
-
/* @__PURE__ */ o(
|
|
766
|
+
/* @__PURE__ */ o(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
767
767
|
/* @__PURE__ */ e(
|
|
768
|
-
|
|
768
|
+
I,
|
|
769
769
|
{
|
|
770
|
-
bgcolor:
|
|
770
|
+
bgcolor: i.palette.primary.lighter,
|
|
771
771
|
borderRadius: 1,
|
|
772
772
|
component: "span",
|
|
773
773
|
height: 44,
|
|
774
774
|
mr: 24,
|
|
775
775
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
776
776
|
width: 44,
|
|
777
|
-
children: /* @__PURE__ */ e(
|
|
777
|
+
children: /* @__PURE__ */ e(j, { color: "primary", name: "cardiology" })
|
|
778
778
|
}
|
|
779
779
|
),
|
|
780
780
|
t.bullet_two
|
|
781
781
|
] }),
|
|
782
|
-
/* @__PURE__ */ o(
|
|
782
|
+
/* @__PURE__ */ o(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
783
783
|
/* @__PURE__ */ e(
|
|
784
|
-
|
|
784
|
+
I,
|
|
785
785
|
{
|
|
786
|
-
bgcolor:
|
|
786
|
+
bgcolor: i.palette.primary.lighter,
|
|
787
787
|
borderRadius: 1,
|
|
788
788
|
component: "span",
|
|
789
789
|
height: 44,
|
|
790
790
|
mr: 24,
|
|
791
791
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
792
792
|
width: 44,
|
|
793
|
-
children: /* @__PURE__ */ e(
|
|
793
|
+
children: /* @__PURE__ */ e(j, { color: "primary", name: "flare" })
|
|
794
794
|
}
|
|
795
795
|
),
|
|
796
796
|
t.bullet_three
|
|
797
797
|
] })
|
|
798
798
|
] }),
|
|
799
799
|
/* @__PURE__ */ o(s, { direction: "row", spacing: 16, children: [
|
|
800
|
-
/* @__PURE__ */ e(
|
|
801
|
-
/* @__PURE__ */ e(
|
|
800
|
+
/* @__PURE__ */ e(G, { onClick: a, variant: "contained", children: t.get_started_button }),
|
|
801
|
+
/* @__PURE__ */ e(G, { onClick: n, variant: "outlined", children: t.skip_button })
|
|
802
802
|
] })
|
|
803
803
|
] });
|
|
804
|
-
},
|
|
805
|
-
CASHFLOW_ONBOARDING: `${
|
|
806
|
-
CASHFLOW_LOADING_ANIMATION: `${
|
|
807
|
-
},
|
|
808
|
-
const { cashflow: a } =
|
|
809
|
-
return /* @__PURE__ */ o(
|
|
810
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src:
|
|
811
|
-
/* @__PURE__ */ e(
|
|
812
|
-
/* @__PURE__ */ e(
|
|
804
|
+
}, kt = T(Nt), Oe = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", ze = {
|
|
805
|
+
CASHFLOW_ONBOARDING: `${Oe}/cashflow-onboarding.png`,
|
|
806
|
+
CASHFLOW_LOADING_ANIMATION: `${Oe}/loading-animation.gif`
|
|
807
|
+
}, Ht = () => {
|
|
808
|
+
const { cashflow: a } = O();
|
|
809
|
+
return /* @__PURE__ */ o(f.Fragment, { children: [
|
|
810
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: ze.CASHFLOW_LOADING_ANIMATION }) }),
|
|
811
|
+
/* @__PURE__ */ e(ue, { pb: 12, children: a.loading_title }),
|
|
812
|
+
/* @__PURE__ */ e(N, { children: a.loading_description })
|
|
813
813
|
] });
|
|
814
|
-
},
|
|
814
|
+
}, Ft = T(Ht), Wt = at`
|
|
815
815
|
from {
|
|
816
816
|
transform: rotate(0deg);
|
|
817
817
|
}
|
|
818
818
|
to {
|
|
819
819
|
transform: rotate(360deg);
|
|
820
820
|
}
|
|
821
|
-
`,
|
|
822
|
-
const { addRepeatingTransaction: a, repeatingTransactions: n } =
|
|
823
|
-
() =>
|
|
824
|
-
[
|
|
825
|
-
),
|
|
826
|
-
(y) => y.repeating_transaction_type ===
|
|
827
|
-
).length,
|
|
828
|
-
|
|
821
|
+
`, $t = () => {
|
|
822
|
+
const { addRepeatingTransaction: a, repeatingTransactions: n } = q(), { cashflow: t, common: i } = O(), { user: g } = He(), { completeOnboarding: x } = he(), { isDirty: m } = V(), { isMobile: p } = pe(), { isCopyLoaded: c, setDisplayedDate: r } = X(), { filter: d, setFilter: l, transactions: b } = Fe(), C = le(), [_, k] = ee(!0), [v, F] = f.useState(pt.EveryMonth), [h, S] = f.useState(1), [A, w] = f.useState(15), [z, re] = ee(!1), [K, J] = ee(1), [R, me] = ee([]), [Z, H] = ee(""), W = f.useMemo(
|
|
823
|
+
() => b.find((y) => y.guid === Z),
|
|
824
|
+
[Z, b]
|
|
825
|
+
), Be = !!n.filter(
|
|
826
|
+
(y) => y.repeating_transaction_type === De.Income
|
|
827
|
+
).length, be = async () => {
|
|
828
|
+
J(2), r(
|
|
829
829
|
// Beginning of the month, 90 days before today
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
),
|
|
833
|
-
},
|
|
834
|
-
if (!(
|
|
835
|
-
|
|
836
|
-
for (let y = 0; y <
|
|
837
|
-
const E =
|
|
830
|
+
mt(je($(), 90)),
|
|
831
|
+
$()
|
|
832
|
+
), l({ ...d, custom: _e }), J(3);
|
|
833
|
+
}, Ue = async () => {
|
|
834
|
+
if (!(R.length < 1)) {
|
|
835
|
+
re(!0);
|
|
836
|
+
for (let y = 0; y < R.length; y++) {
|
|
837
|
+
const E = R[y], xe = ve(v, Ie(E.date)), qe = {
|
|
838
838
|
account_guid: E.account_guid,
|
|
839
839
|
amount: E.amount,
|
|
840
|
+
created_by: 0,
|
|
841
|
+
//user
|
|
840
842
|
merchant_guid: E.merchant_guid,
|
|
841
843
|
description: E.feed_description || E.description,
|
|
842
|
-
predicted_occurs_on:
|
|
843
|
-
recurrence_day:
|
|
844
|
-
recurrence_type:
|
|
845
|
-
repeating_transaction_type:
|
|
846
|
-
|
|
844
|
+
predicted_occurs_on: dt(xe, { representation: "date" }),
|
|
845
|
+
recurrence_day: xe.getDay(),
|
|
846
|
+
recurrence_type: v,
|
|
847
|
+
repeating_transaction_type: De.Income,
|
|
848
|
+
second_recurrence_day: A,
|
|
849
|
+
transaction_type: E.transaction_type,
|
|
850
|
+
user_guid: g.guid
|
|
847
851
|
};
|
|
848
|
-
await a(
|
|
852
|
+
await a(qe, E);
|
|
849
853
|
}
|
|
850
|
-
await
|
|
854
|
+
await x();
|
|
851
855
|
}
|
|
852
|
-
},
|
|
853
|
-
return
|
|
854
|
-
|
|
856
|
+
}, Pe = !W && _ || !W && R.length < 1;
|
|
857
|
+
return c ? /* @__PURE__ */ o(
|
|
858
|
+
I,
|
|
855
859
|
{
|
|
856
860
|
sx: {
|
|
857
861
|
display: "flex",
|
|
858
|
-
alignItems:
|
|
859
|
-
backgroundColor:
|
|
860
|
-
backgroundImage:
|
|
862
|
+
alignItems: p ? "flex-start" : "center",
|
|
863
|
+
backgroundColor: C.palette.background.paper,
|
|
864
|
+
backgroundImage: p ? null : `url(${ze.CASHFLOW_ONBOARDING})`,
|
|
861
865
|
backgroundRepeat: "no-repeat",
|
|
862
866
|
backgroundPosition: "left 100px",
|
|
863
867
|
backgroundSize: "35%",
|
|
864
868
|
py: 24
|
|
865
869
|
},
|
|
866
870
|
children: [
|
|
867
|
-
|
|
868
|
-
|
|
871
|
+
K === 1 && /* @__PURE__ */ e(
|
|
872
|
+
I,
|
|
869
873
|
{
|
|
870
874
|
sx: {
|
|
871
|
-
...
|
|
875
|
+
...p ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
872
876
|
},
|
|
873
|
-
children: /* @__PURE__ */ e(
|
|
877
|
+
children: /* @__PURE__ */ e(kt, { handleNextStep: be })
|
|
874
878
|
}
|
|
875
879
|
),
|
|
876
|
-
|
|
877
|
-
|
|
880
|
+
K === 2 && /* @__PURE__ */ e(
|
|
881
|
+
I,
|
|
878
882
|
{
|
|
879
883
|
sx: {
|
|
880
|
-
...
|
|
884
|
+
...p ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
881
885
|
},
|
|
882
|
-
children: /* @__PURE__ */ e(
|
|
886
|
+
children: /* @__PURE__ */ e(Ft, {})
|
|
883
887
|
}
|
|
884
888
|
),
|
|
885
|
-
|
|
886
|
-
|
|
889
|
+
K === 3 && /* @__PURE__ */ o(
|
|
890
|
+
I,
|
|
887
891
|
{
|
|
888
892
|
sx: {
|
|
889
|
-
...
|
|
893
|
+
...p ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
890
894
|
},
|
|
891
895
|
children: [
|
|
892
|
-
/* @__PURE__ */ e(
|
|
893
|
-
/* @__PURE__ */ e(
|
|
894
|
-
|
|
895
|
-
/* @__PURE__ */ e(
|
|
896
|
-
/* @__PURE__ */ e(
|
|
897
|
-
|
|
896
|
+
/* @__PURE__ */ e(ue, { pb: 12, children: t.add_income_title }),
|
|
897
|
+
/* @__PURE__ */ e(N, { mb: 24, children: t.add_income_description }),
|
|
898
|
+
R.length > 0 && !W && /* @__PURE__ */ o(P, { children: [
|
|
899
|
+
/* @__PURE__ */ e(ne, { children: R.map((y, E) => /* @__PURE__ */ o(f.Fragment, { children: [
|
|
900
|
+
/* @__PURE__ */ e(ut, { bgcolor: "background.paper", children: ft(
|
|
901
|
+
U(y.nextDate || y.date)
|
|
898
902
|
) }),
|
|
899
|
-
/* @__PURE__ */ e(
|
|
900
|
-
E !==
|
|
903
|
+
/* @__PURE__ */ e(ht, { transaction: y }),
|
|
904
|
+
E !== R.length - 1 && /* @__PURE__ */ e(D, {})
|
|
901
905
|
] }, y.guid)) }),
|
|
902
906
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", children: [
|
|
903
|
-
/* @__PURE__ */ e(
|
|
907
|
+
/* @__PURE__ */ e(D, { sx: { flexGrow: 1 } }),
|
|
904
908
|
/* @__PURE__ */ e(
|
|
905
|
-
|
|
909
|
+
G,
|
|
906
910
|
{
|
|
907
|
-
onClick: () =>
|
|
908
|
-
startIcon: /* @__PURE__ */ e(
|
|
911
|
+
onClick: () => k(!0),
|
|
912
|
+
startIcon: /* @__PURE__ */ e(j, { name: "add", size: 20 }),
|
|
909
913
|
children: t.add_income
|
|
910
914
|
}
|
|
911
915
|
)
|
|
912
916
|
] })
|
|
913
917
|
] }),
|
|
914
|
-
|
|
915
|
-
|
|
918
|
+
Pe && /* @__PURE__ */ e(
|
|
919
|
+
st,
|
|
916
920
|
{
|
|
917
921
|
bgcolor: "background.paper",
|
|
918
|
-
onSearch: (y) =>
|
|
919
|
-
...
|
|
920
|
-
custom: (E) => y ?
|
|
922
|
+
onSearch: (y) => l({
|
|
923
|
+
...d,
|
|
924
|
+
custom: (E) => y ? ct(E, y) : _e(E)
|
|
921
925
|
}),
|
|
922
926
|
onSelected: (y) => {
|
|
923
|
-
|
|
927
|
+
H(y), k(!1);
|
|
924
928
|
}
|
|
925
929
|
}
|
|
926
930
|
),
|
|
927
|
-
!
|
|
928
|
-
|
|
931
|
+
!Be && m && /* @__PURE__ */ e(N, { color: "error", mt: 16, children: t.confirm_error }),
|
|
932
|
+
W && /* @__PURE__ */ o(P, { children: [
|
|
929
933
|
/* @__PURE__ */ e(
|
|
930
|
-
|
|
934
|
+
lt,
|
|
931
935
|
{
|
|
932
936
|
bgcolor: "background.paper",
|
|
933
|
-
firstDay:
|
|
934
|
-
frequency:
|
|
935
|
-
onFirstDayChange:
|
|
936
|
-
onFrequencyChange:
|
|
937
|
-
onSecondDayChange:
|
|
938
|
-
secondDay:
|
|
939
|
-
transaction:
|
|
937
|
+
firstDay: h,
|
|
938
|
+
frequency: v,
|
|
939
|
+
onFirstDayChange: S,
|
|
940
|
+
onFrequencyChange: F,
|
|
941
|
+
onSecondDayChange: w,
|
|
942
|
+
secondDay: A,
|
|
943
|
+
transaction: W
|
|
940
944
|
}
|
|
941
945
|
),
|
|
942
946
|
/* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
943
947
|
/* @__PURE__ */ e(
|
|
944
|
-
|
|
948
|
+
G,
|
|
945
949
|
{
|
|
946
|
-
"aria-disabled": !
|
|
950
|
+
"aria-disabled": !W,
|
|
947
951
|
onClick: () => {
|
|
948
|
-
const y = [...
|
|
952
|
+
const y = [...R];
|
|
949
953
|
y.push({
|
|
950
|
-
...
|
|
951
|
-
nextDate:
|
|
952
|
-
frequency:
|
|
953
|
-
}),
|
|
954
|
+
...W,
|
|
955
|
+
nextDate: ve(v, Ie(W.date)),
|
|
956
|
+
frequency: v
|
|
957
|
+
}), me(y), H("");
|
|
954
958
|
},
|
|
955
959
|
variant: "contained",
|
|
956
|
-
children:
|
|
960
|
+
children: i.confirm_button
|
|
957
961
|
}
|
|
958
962
|
),
|
|
959
963
|
/* @__PURE__ */ e(
|
|
960
|
-
|
|
964
|
+
G,
|
|
961
965
|
{
|
|
962
966
|
onClick: () => {
|
|
963
|
-
|
|
967
|
+
H(""), k(!0), be().finally();
|
|
964
968
|
},
|
|
965
969
|
variant: "outlined",
|
|
966
|
-
children:
|
|
970
|
+
children: i.cancel_button
|
|
967
971
|
}
|
|
968
972
|
)
|
|
969
973
|
] })
|
|
970
974
|
] }),
|
|
971
|
-
|
|
975
|
+
R.length > 0 && !W && /* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
972
976
|
/* @__PURE__ */ e(
|
|
973
|
-
|
|
977
|
+
G,
|
|
974
978
|
{
|
|
975
|
-
"aria-disabled":
|
|
976
|
-
onClick:
|
|
977
|
-
startIcon:
|
|
978
|
-
|
|
979
|
+
"aria-disabled": R.length < 1 || z,
|
|
980
|
+
onClick: Ue,
|
|
981
|
+
startIcon: z ? /* @__PURE__ */ e(
|
|
982
|
+
j,
|
|
979
983
|
{
|
|
980
984
|
name: "progress_activity",
|
|
981
985
|
sx: {
|
|
982
|
-
animation: `${
|
|
986
|
+
animation: `${Wt} 2s linear infinite`
|
|
983
987
|
}
|
|
984
988
|
}
|
|
985
989
|
) : null,
|
|
@@ -987,111 +991,111 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(B, { children: [
|
|
|
987
991
|
children: t.confirm_income_button
|
|
988
992
|
}
|
|
989
993
|
),
|
|
990
|
-
/* @__PURE__ */ e(
|
|
994
|
+
/* @__PURE__ */ e(G, { onClick: x, variant: "outlined", children: t.skip_button })
|
|
991
995
|
] })
|
|
992
996
|
]
|
|
993
997
|
}
|
|
994
998
|
)
|
|
995
999
|
]
|
|
996
1000
|
}
|
|
997
|
-
) : /* @__PURE__ */ e(
|
|
998
|
-
},
|
|
1001
|
+
) : /* @__PURE__ */ e(oe, {});
|
|
1002
|
+
}, Mt = T($t), Gt = ({ onBackClick: a, sx: n = {} }) => {
|
|
999
1003
|
const {
|
|
1000
1004
|
selectedAccounts: t,
|
|
1001
|
-
selectedAccountGuids:
|
|
1002
|
-
setSelectedAccounts:
|
|
1005
|
+
selectedAccountGuids: i,
|
|
1006
|
+
setSelectedAccounts: g,
|
|
1003
1007
|
shouldDisableNextDate: x,
|
|
1004
|
-
shouldDisablePrevDate:
|
|
1005
|
-
} =
|
|
1006
|
-
|
|
1007
|
-
w && (F(b),
|
|
1008
|
-
}, [w]),
|
|
1009
|
-
|
|
1010
|
-
}, [
|
|
1011
|
-
const
|
|
1012
|
-
(
|
|
1008
|
+
shouldDisablePrevDate: m
|
|
1009
|
+
} = X(), { onEvent: p } = ke(), { clientConfig: c } = Ve(), { visibleCashAccounts: r } = Ne(), { setFilter: d } = Fe(), { userProfile: l } = He(), { dateRange: b, setSelectedCashAccounts: C } = V(), { loadRepeatingTransactions: _, income: k, isDataLoaded: v, setDateRange: F } = q(), { cashflow: h, recurring: S } = O(), { isCopyLoaded: A, isInitialized: w } = X(), re = c?.master?.deep_link_params?.view === "manage_income", [K, J] = f.useState(re);
|
|
1010
|
+
f.useEffect(() => {
|
|
1011
|
+
w && (F(b), _().finally());
|
|
1012
|
+
}, [w]), f.useEffect(() => {
|
|
1013
|
+
g(r);
|
|
1014
|
+
}, [r]), f.useEffect(() => {
|
|
1015
|
+
const me = r.map((H) => H.guid), Z = t.filter(
|
|
1016
|
+
(H) => i.includes(H.guid) && me.includes(H.guid)
|
|
1013
1017
|
);
|
|
1014
|
-
C(
|
|
1015
|
-
dateRange: { start:
|
|
1016
|
-
accounts:
|
|
1018
|
+
C(Z), d({
|
|
1019
|
+
dateRange: { start: je($(), 90), end: gt() },
|
|
1020
|
+
accounts: Z.map((H) => H.guid)
|
|
1017
1021
|
});
|
|
1018
|
-
}, [
|
|
1019
|
-
const
|
|
1020
|
-
return !
|
|
1021
|
-
|
|
1022
|
+
}, [r, t]);
|
|
1023
|
+
const R = v && !l?.has_completed_cash_flow_onboarding && !k.length;
|
|
1024
|
+
return !A || !w ? /* @__PURE__ */ e(oe, {}) : R ? /* @__PURE__ */ e(
|
|
1025
|
+
Ae,
|
|
1022
1026
|
{
|
|
1023
1027
|
onBackClick: a,
|
|
1024
1028
|
sx: { height: "100%", overflow: "auto" },
|
|
1025
1029
|
title: h.title,
|
|
1026
|
-
children: /* @__PURE__ */ e(
|
|
1030
|
+
children: /* @__PURE__ */ e(Mt, {})
|
|
1027
1031
|
}
|
|
1028
1032
|
) : /* @__PURE__ */ o(
|
|
1029
|
-
|
|
1033
|
+
Ae,
|
|
1030
1034
|
{
|
|
1031
|
-
accountOptions:
|
|
1035
|
+
accountOptions: r,
|
|
1032
1036
|
actions: [
|
|
1033
1037
|
{
|
|
1034
|
-
label:
|
|
1038
|
+
label: S.action_title,
|
|
1035
1039
|
iconName: "credit_card_gear",
|
|
1036
1040
|
onClick: () => {
|
|
1037
|
-
|
|
1041
|
+
J(!0), p(Ee.CASH_FLOW_CLICK_SETTINGS);
|
|
1038
1042
|
}
|
|
1039
1043
|
}
|
|
1040
1044
|
],
|
|
1041
1045
|
calendarActions: {
|
|
1042
1046
|
shouldDisableNext: x,
|
|
1043
|
-
shouldDisablePrevious:
|
|
1047
|
+
shouldDisablePrevious: m,
|
|
1044
1048
|
shouldDisablePicker: !0,
|
|
1045
1049
|
onRangeChanged: () => {
|
|
1046
1050
|
}
|
|
1047
1051
|
},
|
|
1048
1052
|
dateRange: b,
|
|
1049
1053
|
dateRangeVariant: "readonly",
|
|
1050
|
-
onAccountsFilterClick: () =>
|
|
1054
|
+
onAccountsFilterClick: () => p(Ee.CASH_FLOW_CLICK_FILTER),
|
|
1051
1055
|
onBackClick: a,
|
|
1052
1056
|
sx: n,
|
|
1053
1057
|
title: h.title,
|
|
1054
1058
|
children: [
|
|
1055
|
-
/* @__PURE__ */ e(
|
|
1056
|
-
/* @__PURE__ */ e(
|
|
1059
|
+
/* @__PURE__ */ e(Ot, {}),
|
|
1060
|
+
/* @__PURE__ */ e(Rt, {}),
|
|
1057
1061
|
/* @__PURE__ */ e(
|
|
1058
|
-
|
|
1062
|
+
Ge,
|
|
1059
1063
|
{
|
|
1060
1064
|
ariaLabelClose: h.close_settings_aria,
|
|
1061
|
-
isOpen:
|
|
1062
|
-
onClose: () =>
|
|
1065
|
+
isOpen: K,
|
|
1066
|
+
onClose: () => J(!1),
|
|
1063
1067
|
shouldShowHeaderBorders: !1,
|
|
1064
|
-
title:
|
|
1065
|
-
children: /* @__PURE__ */ e(
|
|
1068
|
+
title: S.action_title,
|
|
1069
|
+
children: /* @__PURE__ */ e(Ze, { defaultSelectedTab: re ? 1 : 0 })
|
|
1066
1070
|
}
|
|
1067
1071
|
)
|
|
1068
1072
|
]
|
|
1069
1073
|
}
|
|
1070
1074
|
);
|
|
1071
|
-
},
|
|
1072
|
-
class
|
|
1075
|
+
}, Wn = T(Gt);
|
|
1076
|
+
class $n {
|
|
1073
1077
|
fetchInstance;
|
|
1074
|
-
constructor(n, t,
|
|
1075
|
-
this.fetchInstance = new
|
|
1078
|
+
constructor(n, t, i) {
|
|
1079
|
+
this.fetchInstance = new bt(n, t, void 0, i);
|
|
1076
1080
|
}
|
|
1077
|
-
addCashflowEvent = async (n) => this.fetchInstance.post(
|
|
1078
|
-
addCashflowSequence = async (n) => this.fetchInstance.post(
|
|
1079
|
-
getCashflowSequences = async () => this.fetchInstance.get(
|
|
1081
|
+
addCashflowEvent = async (n) => this.fetchInstance.post(B.CASHFLOW_EVENTS, { ...n }).then((t) => t);
|
|
1082
|
+
addCashflowSequence = async (n) => this.fetchInstance.post(B.CASHFLOW_SEQUENCES, { ...n }).then((t) => t.cashflow_sequence);
|
|
1083
|
+
getCashflowSequences = async () => this.fetchInstance.get(B.CASHFLOW_SEQUENCES).then((n) => n.cashflow_sequences);
|
|
1080
1084
|
getCashflowEventsByDateRange = async (n, t) => this.fetchInstance.get(
|
|
1081
|
-
`${
|
|
1082
|
-
).then((
|
|
1083
|
-
deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${
|
|
1085
|
+
`${B.CASHFLOW_EVENTS}/from/${U(n)}/to/${U(t)}`
|
|
1086
|
+
).then((i) => i.cashflow_events);
|
|
1087
|
+
deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${B.CASHFLOW_SEQUENCES}/${n}`).then((t) => t);
|
|
1084
1088
|
getProjectedCashflowEvents = async (n, t) => this.fetchInstance.get(
|
|
1085
|
-
`${
|
|
1089
|
+
`${B.CASHFLOW_SEQUENCES}/projected_events/from/${U(
|
|
1086
1090
|
n
|
|
1087
|
-
)}/to/${
|
|
1088
|
-
).then((
|
|
1089
|
-
updateCashflowSequence = async (n) => this.fetchInstance.put(`${
|
|
1091
|
+
)}/to/${U(t)}`
|
|
1092
|
+
).then((i) => i.cashflow_events);
|
|
1093
|
+
updateCashflowSequence = async (n) => this.fetchInstance.put(`${B.CASHFLOW_SEQUENCES}/${n.guid}`, n).then((t) => t.cashflow_sequence);
|
|
1090
1094
|
}
|
|
1091
1095
|
export {
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1096
|
+
$n as CashflowApi,
|
|
1097
|
+
Fn as CashflowMiniWidget,
|
|
1098
|
+
Mt as CashflowOnboarding,
|
|
1099
|
+
jn as CashflowStore,
|
|
1100
|
+
Wn as CashflowWidget
|
|
1097
1101
|
};
|