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