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