@mx-cartographer/experiences 8.0.19 → 8.0.21
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 +12 -4
- package/dist/{AccountStore-DpYvNnql.mjs → AccountStore-B7zfcad7.mjs} +1 -1
- package/dist/{BudgetUtil-CLhRnCoX.mjs → BudgetUtil-DZpOoZQa.mjs} +1 -1
- package/dist/{EmbeddedCard-xngm4vLT.mjs → EmbeddedCard-D0Pgpiuq.mjs} +89 -81
- package/dist/{GlobalAccountFilter-B73Pw1hJ.mjs → GlobalAccountFilter-CmnaZDS6.mjs} +27 -27
- package/dist/{Help-DBAosGjO.mjs → Help-BkmSY96v.mjs} +1 -1
- package/dist/{ManageIncome-CvfRTf-j.mjs → ManageIncome-DfKQ48km.mjs} +2 -2
- package/dist/{NotificationSettings-D7VqsrZy.mjs → NotificationSettings-DBT37CVB.mjs} +1 -1
- package/dist/{RecurringSettings-DJIUgK5A.mjs → RecurringSettings-CpFfjTIL.mjs} +1 -1
- package/dist/{SpendingLegend-BCnXkPCD.mjs → SpendingLegend-CypdabwS.mjs} +1 -1
- package/dist/{TransactionDetails-KklNHa-s.mjs → TransactionDetails-D57Cfnwh.mjs} +2 -2
- package/dist/WidgetContainer-DYKMArWw.mjs +468 -0
- package/dist/accounts/index.es.js +96 -94
- package/dist/budgets/index.es.js +448 -444
- package/dist/cashflow/index.es.js +234 -232
- package/dist/common/components/GlobalAccountFilter.d.ts +2 -1
- package/dist/common/components/WidgetContainer.d.ts +2 -1
- package/dist/common/components/WidgetDateRangeSelector.d.ts +12 -0
- package/dist/common/hooks/index.d.ts +1 -0
- package/dist/common/hooks/useWidgetHeaderStyles.d.ts +32 -0
- package/dist/common/index.es.js +133 -132
- package/dist/common/utils/PostMessage.d.ts +1 -0
- package/dist/core/types/Widgets.d.ts +1 -0
- package/dist/dashboard/index.es.js +3 -3
- package/dist/debts/components/actions/DebtsPriorityAction.d.ts +2 -1
- package/dist/debts/components/debtspriority/DebtsPriorityButton.d.ts +2 -1
- package/dist/debts/index.es.js +589 -587
- package/dist/finstrong/FinstrongWidget.d.ts +1 -1
- package/dist/finstrong/index.es.js +738 -746
- package/dist/goals/GoalsWidget.d.ts +1 -1
- package/dist/goals/index.es.js +439 -438
- package/dist/help/HelpWidget.d.ts +1 -1
- package/dist/help/index.es.js +21 -12
- package/dist/insights/components/index.d.ts +1 -0
- package/dist/insights/components/shared/InsightsCard/ClientConfigurableCta.d.ts +5 -0
- package/dist/insights/components/shared/InsightsCard/ContentAndDescription.d.ts +0 -2
- package/dist/insights/components/shared/InsightsCard/ContentAndDescriptionMUI.d.ts +0 -2
- package/dist/insights/components/shared/InsightsCard/Description.d.ts +0 -2
- package/dist/insights/components/shared/InsightsCard/DescriptionMUI.d.ts +0 -2
- package/dist/insights/index.es.js +562 -579
- package/dist/insights/types/CommonBeat.d.ts +0 -1
- package/dist/investments/InvestmentsWidget.d.ts +1 -1
- package/dist/investments/index.es.js +418 -417
- package/dist/networth/index.es.js +265 -278
- package/dist/notifications/index.es.js +1 -1
- package/dist/recurringtransactions/RecurringTransactionsWidget.d.ts +1 -1
- package/dist/recurringtransactions/index.es.js +235 -232
- package/dist/settings/SettingsWidget.d.ts +1 -1
- package/dist/settings/index.es.js +283 -282
- package/dist/spending/index.es.js +110 -109
- package/dist/transactions/index.es.js +280 -277
- package/dist/trends/index.es.js +623 -616
- package/dist/{useScreenSize-B6JyS_Lj.mjs → useScreenSize-CUcpY7aJ.mjs} +1 -1
- package/package.json +2 -2
- package/dist/WidgetContainer-D-pbSa7L.mjs +0 -441
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsxs as o, Fragment as B, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import h, { useState as
|
|
3
|
-
import { observer as
|
|
2
|
+
import h, { useState as X } from "react";
|
|
3
|
+
import { observer as E } from "mobx-react-lite";
|
|
4
4
|
import { addMonths as Ve } from "date-fns/addMonths";
|
|
5
5
|
import { startOfToday as W } from "date-fns/startOfToday";
|
|
6
6
|
import D from "@mui/material/Box";
|
|
7
7
|
import v from "@mui/material/Divider";
|
|
8
8
|
import s from "@mui/material/Stack";
|
|
9
|
-
import
|
|
10
|
-
import { Text as m, P as
|
|
11
|
-
import { G as Qe, t as
|
|
9
|
+
import re from "@mui/material/styles/useTheme";
|
|
10
|
+
import { Text as m, P as k, Icon as M, InstitutionLogo as ye, H2 as me, H3 as Ye } from "@mxenabled/mxui";
|
|
11
|
+
import { G as Qe, t as ue, u as L, p as se, d as Ne, b as q, i as U, g as ke, a as Ke, h as Oe, o as Xe } from "../hooks-BxkfR-Ff.mjs";
|
|
12
12
|
import { C as R } from "../CurrencyText-CA-E5N_y.mjs";
|
|
13
|
-
import { I as
|
|
13
|
+
import { I as pe } from "../CashflowStore-CeAzChyD.mjs";
|
|
14
14
|
import { C as Vn } from "../CashflowStore-CeAzChyD.mjs";
|
|
15
|
-
import { u as
|
|
16
|
-
import { L as
|
|
15
|
+
import { u as he } from "../useScreenSize-CUcpY7aJ.mjs";
|
|
16
|
+
import { L as te } from "../Loader-D3rjKx72.mjs";
|
|
17
17
|
import { b as $ } from "../Localization-CPkpIwIx.mjs";
|
|
18
18
|
import { M as Je } from "../MiniWidgetContainer-Bhkv-hpz.mjs";
|
|
19
19
|
import { E as Ze } from "../EmptyState-DHAkGsjk.mjs";
|
|
20
20
|
import { u as Fe } from "../useWidgetLoadTimer-DgN1bTyu.mjs";
|
|
21
|
-
import { R as et } from "../RecurringSettings-
|
|
21
|
+
import { R as et } from "../RecurringSettings-CpFfjTIL.mjs";
|
|
22
22
|
import tt from "@mui/material/Tabs";
|
|
23
23
|
import Ce from "@mui/material/Tab";
|
|
24
24
|
import { getUnixTime as z } from "date-fns/getUnixTime";
|
|
25
|
-
import
|
|
26
|
-
import
|
|
25
|
+
import ee from "@mui/material/List";
|
|
26
|
+
import ne from "@mui/material/ListItem";
|
|
27
27
|
import { A as nt } from "../AccountListItem-D9WJDbZ1.mjs";
|
|
28
|
-
import { f as
|
|
28
|
+
import { f as V, D as Y } from "../DateFormats-BMpMrZpW.mjs";
|
|
29
29
|
import ot from "@mui/material/ListSubheader";
|
|
30
|
-
import { f as
|
|
30
|
+
import { f as Z } from "../NumberFormatting-QCaNwbjv.mjs";
|
|
31
31
|
import { isAfter as He } from "date-fns/isAfter";
|
|
32
32
|
import { isBefore as We } from "date-fns/isBefore";
|
|
33
33
|
import { isToday as $e } from "date-fns/isToday";
|
|
@@ -36,25 +36,25 @@ import { alpha as it, keyframes as at } from "@mui/material/styles";
|
|
|
36
36
|
import { DataGridPro as rt } from "@mui/x-data-grid-pro";
|
|
37
37
|
import { T as we } from "../TabContentContainer-j01JYR_7.mjs";
|
|
38
38
|
import G from "@mui/material/Button";
|
|
39
|
-
import { M as st, S as ct, i as lt, d as Se, c as dt } from "../ManageIncome-
|
|
39
|
+
import { M as st, S as ct, i as lt, d as Se, c as dt } from "../ManageIncome-DfKQ48km.mjs";
|
|
40
40
|
import { D as Ge } from "../Drawer-Bbe4AMB1.mjs";
|
|
41
41
|
import { subDays as Me } from "date-fns/subDays";
|
|
42
42
|
import { endOfToday as mt } from "date-fns/endOfToday";
|
|
43
|
-
import { W as ut } from "../WidgetContainer-
|
|
43
|
+
import { W as ut } from "../WidgetContainer-DYKMArWw.mjs";
|
|
44
44
|
import { A as Ie } from "../Analytics-0Xm_BjHU.mjs";
|
|
45
|
-
import { A as
|
|
45
|
+
import { A as J } from "../Account-BiB1F8lL.mjs";
|
|
46
46
|
import { formatISO as pt } from "date-fns/formatISO";
|
|
47
47
|
import { fromUnixTime as De } from "date-fns/fromUnixTime";
|
|
48
48
|
import { startOfMonth as ht } from "date-fns/startOfMonth";
|
|
49
|
-
import { S as ft, a as gt } from "../EmbeddedCard-
|
|
49
|
+
import { S as ft, a as gt } from "../EmbeddedCard-D0Pgpiuq.mjs";
|
|
50
50
|
import { c as ve } from "../RecurringTransactions-BbZ6MQsX.mjs";
|
|
51
51
|
import { h as bt } from "../DateUtil-wcYTmDRD.mjs";
|
|
52
52
|
import { F as xt, R as Ae } from "../RepeatingTransaction-DF4vJn_v.mjs";
|
|
53
53
|
import { F as yt, A as j } from "../Fetch-B6tMJC1r.mjs";
|
|
54
|
-
const
|
|
54
|
+
const Q = () => {
|
|
55
55
|
if (!h.useContext(Qe))
|
|
56
56
|
throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
|
|
57
|
-
return
|
|
57
|
+
return ue().uiStore;
|
|
58
58
|
}, Ct = ({ remaining: i }) => {
|
|
59
59
|
const { cashflow: n } = L();
|
|
60
60
|
return /* @__PURE__ */ o(B, { children: [
|
|
@@ -72,31 +72,31 @@ const Y = () => {
|
|
|
72
72
|
/* @__PURE__ */ e(m, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: n.remaining_cash }),
|
|
73
73
|
/* @__PURE__ */ e(R, { amount: i, bold: !0, sx: { fontSize: 12 } })
|
|
74
74
|
] });
|
|
75
|
-
},
|
|
76
|
-
const i =
|
|
75
|
+
}, fe = E(Ct), _t = () => {
|
|
76
|
+
const i = re(), { availableWidth: n } = se(), { isMobile: t } = he(), { visibleCashAccounts: a, visibleCashBalance: f } = Ne(), { selectedAccountGuids: u } = q(), { cashflow: c } = L(), {
|
|
77
77
|
daysUntilNextIncome: l,
|
|
78
|
-
expensesTilNextIncome:
|
|
78
|
+
expensesTilNextIncome: b,
|
|
79
79
|
selectedCashAccounts: r,
|
|
80
|
-
setNextIncome:
|
|
80
|
+
setNextIncome: g,
|
|
81
81
|
setSelectedCashAccounts: d,
|
|
82
82
|
setUpcomingExpenses: x
|
|
83
|
-
} =
|
|
83
|
+
} = Q(), { isDataLoaded: _, nextIncomeRecurrence: w, upcomingExpenses: T } = U();
|
|
84
84
|
h.useEffect(() => {
|
|
85
85
|
d(
|
|
86
|
-
a.filter((
|
|
86
|
+
a.filter((C) => u.includes(C.guid))
|
|
87
87
|
);
|
|
88
88
|
}, [a, u]), h.useEffect(() => {
|
|
89
|
-
w &&
|
|
90
|
-
}, [w,
|
|
91
|
-
const
|
|
92
|
-
() => a.filter((
|
|
93
|
-
[u,
|
|
94
|
-
),
|
|
95
|
-
() =>
|
|
96
|
-
[u,
|
|
97
|
-
),
|
|
98
|
-
() =>
|
|
99
|
-
[
|
|
89
|
+
w && g(w), x(T);
|
|
90
|
+
}, [w, T]);
|
|
91
|
+
const I = h.useMemo(
|
|
92
|
+
() => a.filter((C) => u.includes(C.guid)).reduce((C, S) => C + (S?.balance || 0), 0),
|
|
93
|
+
[u, T]
|
|
94
|
+
), N = h.useMemo(
|
|
95
|
+
() => b.filter((C) => u.includes(C.accountGuid || "")).reduce((C, S) => C + S.amount, 0),
|
|
96
|
+
[u, b]
|
|
97
|
+
), p = h.useMemo(
|
|
98
|
+
() => I - N,
|
|
99
|
+
[I, N]
|
|
100
100
|
);
|
|
101
101
|
return _ ? /* @__PURE__ */ e(D, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: n > 710 ? /* @__PURE__ */ o(
|
|
102
102
|
s,
|
|
@@ -108,28 +108,28 @@ const Y = () => {
|
|
|
108
108
|
px: 24,
|
|
109
109
|
children: [
|
|
110
110
|
/* @__PURE__ */ o(s, { pb: 14, pt: 12, children: [
|
|
111
|
-
/* @__PURE__ */ e(R, { amount:
|
|
112
|
-
/* @__PURE__ */ e(
|
|
111
|
+
/* @__PURE__ */ e(R, { amount: I, variant: "h2" }),
|
|
112
|
+
/* @__PURE__ */ e(k, { variant: "caption", whiteSpace: "nowrap", children: $(
|
|
113
113
|
c.total_cash_accounts,
|
|
114
114
|
r.length
|
|
115
115
|
) })
|
|
116
116
|
] }),
|
|
117
117
|
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(M, { name: "remove" }) }),
|
|
118
118
|
/* @__PURE__ */ o(s, { pb: 14, pt: 12, children: [
|
|
119
|
-
/* @__PURE__ */ e(R, { amount:
|
|
120
|
-
/* @__PURE__ */ e(
|
|
119
|
+
/* @__PURE__ */ e(R, { amount: N, variant: "h2" }),
|
|
120
|
+
/* @__PURE__ */ e(k, { variant: "caption", whiteSpace: "nowrap", children: $(c.expenses_due, b.length) })
|
|
121
121
|
] }),
|
|
122
122
|
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(M, { name: "equal" }) }),
|
|
123
123
|
/* @__PURE__ */ o(s, { pb: 14, pr: 24, pt: 12, children: [
|
|
124
|
-
/* @__PURE__ */ e(R, { amount:
|
|
124
|
+
/* @__PURE__ */ e(R, { amount: p, variant: "h2" }),
|
|
125
125
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
126
|
-
/* @__PURE__ */ e(
|
|
127
|
-
/* @__PURE__ */ e(
|
|
126
|
+
/* @__PURE__ */ e(k, { variant: "caption", whiteSpace: "nowrap", children: c.available_to_spend }),
|
|
127
|
+
/* @__PURE__ */ e(pe, { body: c.tooltip_body, title: c.tooltip_title })
|
|
128
128
|
] })
|
|
129
129
|
] }),
|
|
130
130
|
/* @__PURE__ */ e(s, { borderLeft: `1px solid ${i.palette.divider}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ o(B, { children: [
|
|
131
131
|
/* @__PURE__ */ e(m, { variant: "h2", children: $(c.days, l) }),
|
|
132
|
-
/* @__PURE__ */ e(
|
|
132
|
+
/* @__PURE__ */ e(k, { variant: "caption", whiteSpace: "nowrap", children: c.next_paycheck })
|
|
133
133
|
] }) })
|
|
134
134
|
]
|
|
135
135
|
}
|
|
@@ -143,8 +143,8 @@ const Y = () => {
|
|
|
143
143
|
] }),
|
|
144
144
|
/* @__PURE__ */ e(v, {}),
|
|
145
145
|
/* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
146
|
-
/* @__PURE__ */ e(m, { variant: "body2", children: $(c.expenses_due,
|
|
147
|
-
/* @__PURE__ */ e(R, { amount:
|
|
146
|
+
/* @__PURE__ */ e(m, { variant: "body2", children: $(c.expenses_due, b.length) }),
|
|
147
|
+
/* @__PURE__ */ e(R, { amount: N, bold: !0, symbol: "-", variant: "caption" })
|
|
148
148
|
] }),
|
|
149
149
|
/* @__PURE__ */ e(v, {}),
|
|
150
150
|
/* @__PURE__ */ e(
|
|
@@ -158,7 +158,7 @@ const Y = () => {
|
|
|
158
158
|
justifyContent: "space-between",
|
|
159
159
|
px: 16,
|
|
160
160
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
161
|
-
children: /* @__PURE__ */ e(
|
|
161
|
+
children: /* @__PURE__ */ e(fe, { remaining: p })
|
|
162
162
|
}
|
|
163
163
|
),
|
|
164
164
|
/* @__PURE__ */ e(v, {}),
|
|
@@ -166,15 +166,15 @@ const Y = () => {
|
|
|
166
166
|
/* @__PURE__ */ e(m, { variant: "body2", children: c.next_paycheck }),
|
|
167
167
|
/* @__PURE__ */ e(m, { bold: !0, variant: "caption", children: $(c.days, l) })
|
|
168
168
|
] })
|
|
169
|
-
] }) }) : /* @__PURE__ */ e(
|
|
170
|
-
}, wt =
|
|
169
|
+
] }) }) : /* @__PURE__ */ e(te, { height: t ? 210 : 120 });
|
|
170
|
+
}, wt = E(_t), St = ({
|
|
171
171
|
onPrimaryCtaClick: i,
|
|
172
172
|
onSecondaryCtaClick: n,
|
|
173
173
|
sx: t = {}
|
|
174
174
|
}) => {
|
|
175
|
-
const { cashflow: a } = L(), { isInitialized: f } =
|
|
175
|
+
const { cashflow: a } = L(), { isInitialized: f } = q(), { loadRepeatingTransactionData: u, income: c, isDataLoaded: l, setDateRange: b } = U();
|
|
176
176
|
h.useEffect(() => {
|
|
177
|
-
|
|
177
|
+
b({ start: W(), end: Ve(W(), 1) }), l || u().finally();
|
|
178
178
|
}, []), Fe({
|
|
179
179
|
widgetName: "CashflowMiniWidget",
|
|
180
180
|
isLoaded: l
|
|
@@ -191,7 +191,7 @@ const Y = () => {
|
|
|
191
191
|
sx: { height: "100%", ...t },
|
|
192
192
|
title: a.title,
|
|
193
193
|
children: [
|
|
194
|
-
!l && /* @__PURE__ */ e(
|
|
194
|
+
!l && /* @__PURE__ */ e(te, {}),
|
|
195
195
|
l && (r ? /* @__PURE__ */ e(
|
|
196
196
|
Ze,
|
|
197
197
|
{
|
|
@@ -205,9 +205,9 @@ const Y = () => {
|
|
|
205
205
|
) : /* @__PURE__ */ e(wt, {}))
|
|
206
206
|
]
|
|
207
207
|
}
|
|
208
|
-
) : /* @__PURE__ */ e(
|
|
209
|
-
}, jn =
|
|
210
|
-
|
|
208
|
+
) : /* @__PURE__ */ e(te, {});
|
|
209
|
+
}, jn = E(St), It = ({ remaining: i }) => /* @__PURE__ */ e(
|
|
210
|
+
ne,
|
|
211
211
|
{
|
|
212
212
|
sx: {
|
|
213
213
|
alignItems: "center",
|
|
@@ -219,15 +219,15 @@ const Y = () => {
|
|
|
219
219
|
borderBottomRightRadius: "3px",
|
|
220
220
|
minHeight: "auto"
|
|
221
221
|
},
|
|
222
|
-
children: /* @__PURE__ */ e(
|
|
222
|
+
children: /* @__PURE__ */ e(fe, { remaining: i })
|
|
223
223
|
}
|
|
224
224
|
);
|
|
225
|
-
var
|
|
225
|
+
var oe = /* @__PURE__ */ ((i) => (i.EXPENSE = "expense", i.INCOME = "income", i))(oe || {});
|
|
226
226
|
const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
227
|
-
/* @__PURE__ */ o(
|
|
227
|
+
/* @__PURE__ */ o(ne, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
|
|
228
228
|
/* @__PURE__ */ o(s, { alignItems: "center", height: 32, width: 32, children: [
|
|
229
|
-
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children:
|
|
230
|
-
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children:
|
|
229
|
+
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children: V(i.expectedDate, Y.MONTH) }),
|
|
230
|
+
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children: V(i.expectedDate, Y.DAY) })
|
|
231
231
|
] }),
|
|
232
232
|
/* @__PURE__ */ e(m, { sx: { flexGrow: 1, fontSize: 13 }, children: i.name }),
|
|
233
233
|
/* @__PURE__ */ e(
|
|
@@ -240,7 +240,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
240
240
|
)
|
|
241
241
|
] }),
|
|
242
242
|
/* @__PURE__ */ e(v, {})
|
|
243
|
-
] }), Ee =
|
|
243
|
+
] }), Ee = E(Dt), vt = ({ total: i, type: n }) => {
|
|
244
244
|
const { cashflow: t } = L();
|
|
245
245
|
return /* @__PURE__ */ o(B, { children: [
|
|
246
246
|
/* @__PURE__ */ o(
|
|
@@ -256,40 +256,40 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
256
256
|
px: 24
|
|
257
257
|
},
|
|
258
258
|
children: [
|
|
259
|
-
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 12 }, children: n ===
|
|
259
|
+
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 12 }, children: n === oe.EXPENSE ? t.expenses : t.income }),
|
|
260
260
|
/* @__PURE__ */ o(m, { bold: !0, sx: { fontSize: 13 }, children: [
|
|
261
|
-
n ===
|
|
262
|
-
|
|
261
|
+
n === oe.EXPENSE ? "-" : "+",
|
|
262
|
+
Z(i, "0,0.00")
|
|
263
263
|
] })
|
|
264
264
|
]
|
|
265
265
|
}
|
|
266
266
|
),
|
|
267
267
|
/* @__PURE__ */ e(v, {})
|
|
268
268
|
] });
|
|
269
|
-
}, Te =
|
|
270
|
-
const { availableWidth: i } =
|
|
269
|
+
}, Te = E(vt), ae = (i, n) => (t) => t.accountGuid === i.guid && ($e(t.expectedDate) || He(t.expectedDate, n.start)) && We(t.expectedDate, n.end), At = () => {
|
|
270
|
+
const { availableWidth: i } = se(), { cashflow: n } = L(), { upcomingExpenses: t, upcomingIncome: a } = U(), { dateRange: f, selectedCashAccounts: u } = Q();
|
|
271
271
|
return /* @__PURE__ */ o(s, { children: [
|
|
272
272
|
/* @__PURE__ */ o(s, { direction: i < 400 ? "column" : "row", justifyContent: "space-between", children: [
|
|
273
273
|
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: n.accounts_breakdown }),
|
|
274
274
|
/* @__PURE__ */ o(m, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: [
|
|
275
|
-
|
|
275
|
+
V(f.start, Y.FULL_MONTH_DAY),
|
|
276
276
|
" -",
|
|
277
277
|
" ",
|
|
278
|
-
|
|
278
|
+
V(f.end, Y.FULL_MONTH_DAY)
|
|
279
279
|
] })
|
|
280
280
|
] }),
|
|
281
281
|
/* @__PURE__ */ e(s, { children: u.map((c) => {
|
|
282
|
-
const l = a.filter(
|
|
283
|
-
|
|
282
|
+
const l = a.filter(ae(c, f)).sort((d, x) => z(d.expectedDate) - z(x.expectedDate)), b = t.filter(
|
|
283
|
+
ae(c, f)
|
|
284
284
|
), r = l.reduce(
|
|
285
285
|
(d, x) => d + x.amount,
|
|
286
286
|
0
|
|
287
|
-
),
|
|
287
|
+
), g = b.reduce(
|
|
288
288
|
(d, x) => d + x.amount,
|
|
289
289
|
0
|
|
290
290
|
);
|
|
291
291
|
return /* @__PURE__ */ o(
|
|
292
|
-
|
|
292
|
+
ee,
|
|
293
293
|
{
|
|
294
294
|
sx: {
|
|
295
295
|
border: "1px solid",
|
|
@@ -310,26 +310,26 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
310
310
|
}
|
|
311
311
|
),
|
|
312
312
|
/* @__PURE__ */ e(v, {}),
|
|
313
|
-
l.length > 0 && /* @__PURE__ */ e(
|
|
314
|
-
|
|
313
|
+
l.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
|
314
|
+
ee,
|
|
315
315
|
{
|
|
316
|
-
subheader: /* @__PURE__ */ e(Te, { total: r, type:
|
|
316
|
+
subheader: /* @__PURE__ */ e(Te, { total: r, type: oe.INCOME }),
|
|
317
317
|
sx: { width: "100%" },
|
|
318
318
|
children: l.map((d) => /* @__PURE__ */ e(Ee, { recurrence: d }, d.repeatingTransactionGuid))
|
|
319
319
|
}
|
|
320
320
|
) }),
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
b.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
|
322
|
+
ee,
|
|
323
323
|
{
|
|
324
|
-
subheader: /* @__PURE__ */ e(Te, { total:
|
|
324
|
+
subheader: /* @__PURE__ */ e(Te, { total: g, type: oe.EXPENSE }),
|
|
325
325
|
sx: { width: "100%" },
|
|
326
|
-
children:
|
|
326
|
+
children: b.map((d) => /* @__PURE__ */ e(Ee, { recurrence: d }, d.repeatingTransactionGuid))
|
|
327
327
|
}
|
|
328
328
|
) }),
|
|
329
329
|
/* @__PURE__ */ e(
|
|
330
330
|
It,
|
|
331
331
|
{
|
|
332
|
-
remaining: (c.available_balance || c.balance || 0) + r -
|
|
332
|
+
remaining: (c.available_balance || c.balance || 0) + r - g
|
|
333
333
|
}
|
|
334
334
|
)
|
|
335
335
|
]
|
|
@@ -338,14 +338,14 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
338
338
|
);
|
|
339
339
|
}) })
|
|
340
340
|
] });
|
|
341
|
-
}, Et =
|
|
342
|
-
const { availableWidth: i } =
|
|
341
|
+
}, Et = E(At), Tt = () => {
|
|
342
|
+
const { availableWidth: i } = se(), n = re(), { cashflow: t } = L(), { upcomingExpenses: a, upcomingIncome: f } = U(), { dateRange: u, selectedCashAccounts: c } = Q(), l = [
|
|
343
343
|
{
|
|
344
344
|
field: "account",
|
|
345
345
|
flex: 1.5,
|
|
346
346
|
headerName: t.accounts,
|
|
347
|
-
renderCell: ({ value: { name: r, nickname:
|
|
348
|
-
const _ =
|
|
347
|
+
renderCell: ({ value: { name: r, nickname: g, institution_guid: d, account_number: x } }) => {
|
|
348
|
+
const _ = g || r;
|
|
349
349
|
return /* @__PURE__ */ o(s, { alignItems: "center", flexDirection: "row", gap: 12, children: [
|
|
350
350
|
/* @__PURE__ */ e(
|
|
351
351
|
ye,
|
|
@@ -364,21 +364,21 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
364
364
|
flex: 1,
|
|
365
365
|
headerName: t.balance,
|
|
366
366
|
type: "number",
|
|
367
|
-
renderCell: (r) => /* @__PURE__ */ e(m, { color: n.palette.text.primary, variant: "body2", children:
|
|
367
|
+
renderCell: (r) => /* @__PURE__ */ e(m, { color: n.palette.text.primary, variant: "body2", children: Z(r.value, "0,0.00") })
|
|
368
368
|
},
|
|
369
369
|
{
|
|
370
370
|
field: "income",
|
|
371
371
|
flex: 1,
|
|
372
372
|
headerName: t.projected_income,
|
|
373
373
|
type: "number",
|
|
374
|
-
renderCell: (r) => /* @__PURE__ */ e(m, { color: n.palette.text.primary, variant: "body2", children: `+${
|
|
374
|
+
renderCell: (r) => /* @__PURE__ */ e(m, { color: n.palette.text.primary, variant: "body2", children: `+${Z(r.value, "0,0.00")}` })
|
|
375
375
|
},
|
|
376
376
|
{
|
|
377
377
|
field: "expenses",
|
|
378
378
|
flex: 1.1,
|
|
379
379
|
headerName: t.projected_expenses,
|
|
380
380
|
type: "number",
|
|
381
|
-
renderCell: (r) => /* @__PURE__ */ e(m, { color: n.palette.text.primary, variant: "body2", children: `-${
|
|
381
|
+
renderCell: (r) => /* @__PURE__ */ e(m, { color: n.palette.text.primary, variant: "body2", children: `-${Z(r.value, "0,0.00")}` })
|
|
382
382
|
},
|
|
383
383
|
{
|
|
384
384
|
field: "remaining",
|
|
@@ -386,29 +386,29 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
386
386
|
headerName: t.remaining,
|
|
387
387
|
type: "number",
|
|
388
388
|
renderCell: (r) => {
|
|
389
|
-
const
|
|
389
|
+
const g = r.row.balance + r.row.income - r.row.expenses;
|
|
390
390
|
return /* @__PURE__ */ e(
|
|
391
391
|
m,
|
|
392
392
|
{
|
|
393
|
-
color: Math.sign(
|
|
393
|
+
color: Math.sign(g) === -1 ? n.palette.error.main : n.palette.text.primary,
|
|
394
394
|
variant: "body2",
|
|
395
|
-
children:
|
|
395
|
+
children: Z(g, "0,0.00")
|
|
396
396
|
}
|
|
397
397
|
);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
],
|
|
401
|
-
const
|
|
402
|
-
|
|
400
|
+
], b = h.useMemo(() => c.map((r) => {
|
|
401
|
+
const g = a.filter(
|
|
402
|
+
ae(r, { start: W(), end: _e(W(), 30) })
|
|
403
403
|
).reduce((_, w) => _ + w.amount, 0), d = f.filter(
|
|
404
|
-
|
|
405
|
-
).reduce((_, w) => _ + w.amount, 0), x = (r.balance || 0) + d -
|
|
404
|
+
ae(r, { start: W(), end: _e(W(), 30) })
|
|
405
|
+
).reduce((_, w) => _ + w.amount, 0), x = (r.balance || 0) + d - g;
|
|
406
406
|
return {
|
|
407
407
|
account: r,
|
|
408
408
|
balance: r.balance || 0,
|
|
409
409
|
id: r.guid,
|
|
410
410
|
income: d,
|
|
411
|
-
expenses:
|
|
411
|
+
expenses: g,
|
|
412
412
|
remaining: x
|
|
413
413
|
};
|
|
414
414
|
}), [c, a, f]);
|
|
@@ -439,7 +439,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
439
439
|
}
|
|
440
440
|
),
|
|
441
441
|
/* @__PURE__ */ e(
|
|
442
|
-
|
|
442
|
+
pe,
|
|
443
443
|
{
|
|
444
444
|
body: t.table_tooltip_body,
|
|
445
445
|
title: t.table_tooltip_title
|
|
@@ -447,10 +447,10 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
447
447
|
)
|
|
448
448
|
] }),
|
|
449
449
|
/* @__PURE__ */ o(m, { bold: !0, sx: { fontSize: 15, whiteSpace: "normal" }, children: [
|
|
450
|
-
|
|
450
|
+
V(u.start, Y.FULL_MONTH_DAY),
|
|
451
451
|
" -",
|
|
452
452
|
" ",
|
|
453
|
-
|
|
453
|
+
V(u.end, Y.FULL_MONTH_DAY)
|
|
454
454
|
] })
|
|
455
455
|
]
|
|
456
456
|
}
|
|
@@ -465,7 +465,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
465
465
|
disableRowSelectionOnClick: !0,
|
|
466
466
|
hideFooter: !0,
|
|
467
467
|
rowHeight: 48,
|
|
468
|
-
rows:
|
|
468
|
+
rows: b,
|
|
469
469
|
sx: {
|
|
470
470
|
border: "1px solid",
|
|
471
471
|
borderColor: "neutral.light",
|
|
@@ -485,10 +485,10 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
) :
|
|
489
|
-
const { name:
|
|
488
|
+
) : b.map((r) => {
|
|
489
|
+
const { name: g, nickname: d, institution_guid: x, account_number: _ } = r.account, w = d || g;
|
|
490
490
|
return /* @__PURE__ */ e(
|
|
491
|
-
|
|
491
|
+
ee,
|
|
492
492
|
{
|
|
493
493
|
sx: {
|
|
494
494
|
border: "1px solid",
|
|
@@ -496,7 +496,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
496
496
|
borderRadius: 1,
|
|
497
497
|
marginBottom: 24
|
|
498
498
|
},
|
|
499
|
-
children: /* @__PURE__ */ e(
|
|
499
|
+
children: /* @__PURE__ */ e(ne, { sx: { minHeight: "auto" }, children: /* @__PURE__ */ o(s, { width: "100%", children: [
|
|
500
500
|
/* @__PURE__ */ o(
|
|
501
501
|
s,
|
|
502
502
|
{
|
|
@@ -563,7 +563,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
563
563
|
px: 16,
|
|
564
564
|
py: 12,
|
|
565
565
|
sx: { borderBottomLeftRadius: "4px", borderBottomRightRadius: "4px" },
|
|
566
|
-
children: /* @__PURE__ */ e(
|
|
566
|
+
children: /* @__PURE__ */ e(fe, { remaining: r.remaining })
|
|
567
567
|
}
|
|
568
568
|
)
|
|
569
569
|
] }) })
|
|
@@ -574,8 +574,8 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
574
574
|
]
|
|
575
575
|
}
|
|
576
576
|
);
|
|
577
|
-
}, Rt =
|
|
578
|
-
const { cashflow: i } = L(), { isDesktop: n } =
|
|
577
|
+
}, Rt = E(Tt), Lt = () => {
|
|
578
|
+
const { cashflow: i } = L(), { isDesktop: n } = he(), { onEvent: t } = ke(), [a, f] = h.useState(0), u = (c, l) => {
|
|
579
579
|
f(l);
|
|
580
580
|
};
|
|
581
581
|
return h.useEffect(() => {
|
|
@@ -620,7 +620,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
620
620
|
/* @__PURE__ */ e(we, { index: 0, name: "cashflow", value: a, children: /* @__PURE__ */ e(D, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(Rt, {}) }) }),
|
|
621
621
|
/* @__PURE__ */ e(we, { index: 1, name: "cashflow", value: a, children: /* @__PURE__ */ e(D, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(Et, {}) }) })
|
|
622
622
|
] });
|
|
623
|
-
}, Nt =
|
|
623
|
+
}, Nt = E(Lt), ie = ({
|
|
624
624
|
amount: i,
|
|
625
625
|
isMobile: n = !1,
|
|
626
626
|
isTotal: t = !1,
|
|
@@ -645,76 +645,76 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
645
645
|
]
|
|
646
646
|
}
|
|
647
647
|
), Re = (i, n) => (t) => t.accountGuid && i.includes(t.accountGuid) && ($e(t.expectedDate) || He(t.expectedDate, n.start)) && We(t.expectedDate, n.end), kt = () => {
|
|
648
|
-
const { availableWidth: i } =
|
|
648
|
+
const { availableWidth: i } = se(), { cashflow: n } = L(), { income: t, isDataLoaded: a, upcomingExpenses: f, upcomingIncome: u } = U(), { selectedAccountGuids: c } = q(), { dateRange: l, selectedCashAccounts: b } = Q(), [r, g] = h.useState(!1), d = h.useMemo(
|
|
649
649
|
() => f.filter(Re(c, l)),
|
|
650
650
|
[l, c, f]
|
|
651
651
|
), x = h.useMemo(
|
|
652
652
|
() => u.filter(Re(c, l)),
|
|
653
653
|
[l, c, u]
|
|
654
654
|
), _ = h.useMemo(
|
|
655
|
-
() =>
|
|
656
|
-
[
|
|
657
|
-
), w = d.reduce((
|
|
658
|
-
return /* @__PURE__ */ o(s, { sx: { mx:
|
|
655
|
+
() => b.reduce((C, S) => C + (S?.balance || 0), 0),
|
|
656
|
+
[b]
|
|
657
|
+
), w = d.reduce((C, S) => C + S.amount, 0), T = x.reduce((C, S) => C + S.amount, 0), I = _ - w + T, N = a && t.length > 0, p = i < 725;
|
|
658
|
+
return /* @__PURE__ */ o(s, { sx: { mx: p ? 16 : 0, my: p ? 24 : 42 }, children: [
|
|
659
659
|
/* @__PURE__ */ o(
|
|
660
660
|
s,
|
|
661
661
|
{
|
|
662
|
-
border:
|
|
662
|
+
border: p ? "1px solid" : "none",
|
|
663
663
|
borderColor: "neutral.light",
|
|
664
664
|
borderRadius: 2,
|
|
665
|
-
flexDirection:
|
|
666
|
-
gap:
|
|
665
|
+
flexDirection: p ? "column" : "row",
|
|
666
|
+
gap: p ? 0 : 24,
|
|
667
667
|
justifyContent: "center",
|
|
668
668
|
children: [
|
|
669
669
|
/* @__PURE__ */ e(
|
|
670
|
-
|
|
670
|
+
ie,
|
|
671
671
|
{
|
|
672
672
|
amount: _,
|
|
673
|
-
isMobile:
|
|
674
|
-
label: $(n.cash_and_bank,
|
|
673
|
+
isMobile: p,
|
|
674
|
+
label: $(n.cash_and_bank, b.length)
|
|
675
675
|
}
|
|
676
676
|
),
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
!
|
|
677
|
+
p && /* @__PURE__ */ e(v, {}),
|
|
678
|
+
N ? /* @__PURE__ */ o(B, { children: [
|
|
679
|
+
!p && /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
|
|
680
680
|
/* @__PURE__ */ e(
|
|
681
|
-
|
|
681
|
+
ie,
|
|
682
682
|
{
|
|
683
|
-
amount:
|
|
684
|
-
isMobile:
|
|
683
|
+
amount: T,
|
|
684
|
+
isMobile: p,
|
|
685
685
|
label: n.to_be_received,
|
|
686
|
-
symbol:
|
|
686
|
+
symbol: p ? "+" : void 0
|
|
687
687
|
}
|
|
688
688
|
)
|
|
689
689
|
] }) : /* @__PURE__ */ e(
|
|
690
690
|
G,
|
|
691
691
|
{
|
|
692
|
-
onClick: () =>
|
|
692
|
+
onClick: () => g(!0),
|
|
693
693
|
startIcon: /* @__PURE__ */ e(M, { name: "add" }),
|
|
694
694
|
sx: { fontSize: 13 },
|
|
695
695
|
children: n.add_income
|
|
696
696
|
}
|
|
697
697
|
),
|
|
698
|
-
|
|
698
|
+
p ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
|
|
699
699
|
/* @__PURE__ */ e(
|
|
700
|
-
|
|
700
|
+
ie,
|
|
701
701
|
{
|
|
702
702
|
amount: w,
|
|
703
|
-
isMobile:
|
|
703
|
+
isMobile: p,
|
|
704
704
|
label: $(n.to_be_paid_out, d.length),
|
|
705
|
-
symbol:
|
|
705
|
+
symbol: p ? "-" : void 0
|
|
706
706
|
}
|
|
707
707
|
),
|
|
708
|
-
|
|
708
|
+
p ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
|
|
709
709
|
/* @__PURE__ */ e(
|
|
710
|
-
|
|
710
|
+
ie,
|
|
711
711
|
{
|
|
712
|
-
amount:
|
|
713
|
-
isMobile:
|
|
714
|
-
isTotal:
|
|
712
|
+
amount: I,
|
|
713
|
+
isMobile: p,
|
|
714
|
+
isTotal: p,
|
|
715
715
|
label: n.remaining_cash,
|
|
716
716
|
tooltip: /* @__PURE__ */ e(
|
|
717
|
-
|
|
717
|
+
pe,
|
|
718
718
|
{
|
|
719
719
|
body: n.remaining_income_tooltip_body,
|
|
720
720
|
title: n.remaining_income_tooltip_title
|
|
@@ -730,81 +730,83 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
730
730
|
{
|
|
731
731
|
ariaLabelClose: n.close_manage_income_aria,
|
|
732
732
|
isOpen: r,
|
|
733
|
-
onClose: () =>
|
|
733
|
+
onClose: () => g(!1),
|
|
734
734
|
shouldShowHeaderBorders: !1,
|
|
735
735
|
title: n.manage_income,
|
|
736
736
|
children: /* @__PURE__ */ e(st, {})
|
|
737
737
|
}
|
|
738
738
|
)
|
|
739
739
|
] });
|
|
740
|
-
}, Ot =
|
|
741
|
-
const { selectedAccounts:
|
|
740
|
+
}, Ot = E(kt), Ft = ({ onBackClick: i, onMenuClick: n, sx: t = {} }) => {
|
|
741
|
+
const { selectedAccounts: a, selectedAccountGuids: f, shouldDisableNextDate: u, shouldDisablePrevDate: c } = q(), { onEvent: l } = ke(), { clientConfig: b } = Ke(), { visibleCashAccounts: r } = Ne(), { setFilter: g } = Oe(), { dateRange: d, setSelectedCashAccounts: x } = Q(), { loadRepeatingTransactionData: _, isDataLoaded: w, setDateRange: T } = U(), { cashflow: I, recurring: N } = L(), { isInitialized: p } = q(), S = b?.master?.deep_link_params?.view === "manage_income", [ce, K] = h.useState(S);
|
|
742
742
|
return h.useEffect(() => {
|
|
743
|
-
|
|
743
|
+
T(d), w || _().finally();
|
|
744
744
|
}, []), h.useEffect(() => {
|
|
745
|
-
const
|
|
746
|
-
(
|
|
745
|
+
const le = r.map((F) => F.guid), P = a.filter(
|
|
746
|
+
(F) => f.includes(F.guid) && le.includes(F.guid)
|
|
747
747
|
);
|
|
748
|
-
|
|
748
|
+
x(P), g({
|
|
749
749
|
dateRange: { start: Me(W(), 90), end: mt() },
|
|
750
|
-
accounts:
|
|
750
|
+
accounts: P.map((F) => F.guid)
|
|
751
751
|
});
|
|
752
|
-
}, [
|
|
752
|
+
}, [r, a]), Fe({
|
|
753
753
|
widgetName: "CashflowWidget",
|
|
754
|
-
isLoaded:
|
|
755
|
-
}),
|
|
754
|
+
isLoaded: w
|
|
755
|
+
}), p ? /* @__PURE__ */ o(
|
|
756
756
|
ut,
|
|
757
757
|
{
|
|
758
758
|
actions: [
|
|
759
759
|
{
|
|
760
|
-
label:
|
|
760
|
+
label: N.action_title,
|
|
761
761
|
iconName: "credit_card_gear",
|
|
762
762
|
onClick: () => {
|
|
763
|
-
|
|
763
|
+
K(!0), l(Ie.CASH_FLOW_CLICK_SETTINGS);
|
|
764
764
|
}
|
|
765
765
|
}
|
|
766
766
|
],
|
|
767
767
|
allowedAccountTypes: [
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
768
|
+
J.CASH,
|
|
769
|
+
J.CHECKING,
|
|
770
|
+
J.PREPAID,
|
|
771
|
+
J.SAVINGS,
|
|
772
|
+
J.CHECKING_LINE_OF_CREDIT
|
|
773
773
|
],
|
|
774
774
|
calendarActions: {
|
|
775
|
-
shouldDisableNext:
|
|
776
|
-
shouldDisablePrevious:
|
|
775
|
+
shouldDisableNext: u,
|
|
776
|
+
shouldDisablePrevious: c,
|
|
777
777
|
shouldDisablePicker: !0,
|
|
778
778
|
onRangeChanged: () => {
|
|
779
779
|
}
|
|
780
780
|
},
|
|
781
|
-
dateRange:
|
|
781
|
+
dateRange: d,
|
|
782
782
|
dateRangeVariant: "readonly",
|
|
783
|
-
|
|
783
|
+
hasDivider: !0,
|
|
784
|
+
onAccountsFilterClick: () => l(Ie.CASH_FLOW_CLICK_FILTER),
|
|
784
785
|
onBackClick: i,
|
|
785
|
-
|
|
786
|
-
|
|
786
|
+
onMenuClick: n,
|
|
787
|
+
sx: t,
|
|
788
|
+
title: I.title,
|
|
787
789
|
children: [
|
|
788
790
|
/* @__PURE__ */ e(Ot, {}),
|
|
789
791
|
/* @__PURE__ */ e(Nt, {}),
|
|
790
792
|
/* @__PURE__ */ e(
|
|
791
793
|
Ge,
|
|
792
794
|
{
|
|
793
|
-
ariaLabelClose:
|
|
794
|
-
isOpen:
|
|
795
|
-
onClose: () =>
|
|
795
|
+
ariaLabelClose: I.close_settings_aria,
|
|
796
|
+
isOpen: ce,
|
|
797
|
+
onClose: () => K(!1),
|
|
796
798
|
shouldShowHeaderBorders: !1,
|
|
797
|
-
title:
|
|
798
|
-
children: /* @__PURE__ */ e(et, { defaultSelectedTab:
|
|
799
|
+
title: N.action_title,
|
|
800
|
+
children: /* @__PURE__ */ e(et, { defaultSelectedTab: S ? 1 : 0 })
|
|
799
801
|
}
|
|
800
802
|
)
|
|
801
803
|
]
|
|
802
804
|
}
|
|
803
|
-
) : /* @__PURE__ */ e(
|
|
804
|
-
}, zn =
|
|
805
|
-
const { completeOnboarding: n } =
|
|
805
|
+
) : /* @__PURE__ */ e(te, {});
|
|
806
|
+
}, zn = E(Ft), Ht = ({ handleNextStep: i }) => {
|
|
807
|
+
const { completeOnboarding: n } = ue(), { cashflow: t } = L(), a = re();
|
|
806
808
|
return /* @__PURE__ */ o(s, { children: [
|
|
807
|
-
/* @__PURE__ */ e(
|
|
809
|
+
/* @__PURE__ */ e(me, { pb: 12, variant: "h1", children: t.welcome_title }),
|
|
808
810
|
/* @__PURE__ */ e(
|
|
809
811
|
Ye,
|
|
810
812
|
{
|
|
@@ -814,9 +816,9 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
814
816
|
children: t.welcome_sub_title
|
|
815
817
|
}
|
|
816
818
|
),
|
|
817
|
-
/* @__PURE__ */ e(
|
|
819
|
+
/* @__PURE__ */ e(k, { pb: 32, children: t.welcome_description }),
|
|
818
820
|
/* @__PURE__ */ o(s, { direction: "column", mb: 32, spacing: 32, children: [
|
|
819
|
-
/* @__PURE__ */ o(
|
|
821
|
+
/* @__PURE__ */ o(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
820
822
|
/* @__PURE__ */ e(
|
|
821
823
|
D,
|
|
822
824
|
{
|
|
@@ -832,7 +834,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
832
834
|
),
|
|
833
835
|
t.bullet_one
|
|
834
836
|
] }),
|
|
835
|
-
/* @__PURE__ */ o(
|
|
837
|
+
/* @__PURE__ */ o(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
836
838
|
/* @__PURE__ */ e(
|
|
837
839
|
D,
|
|
838
840
|
{
|
|
@@ -848,7 +850,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
848
850
|
),
|
|
849
851
|
t.bullet_two
|
|
850
852
|
] }),
|
|
851
|
-
/* @__PURE__ */ o(
|
|
853
|
+
/* @__PURE__ */ o(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
852
854
|
/* @__PURE__ */ e(
|
|
853
855
|
D,
|
|
854
856
|
{
|
|
@@ -870,17 +872,17 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
870
872
|
/* @__PURE__ */ e(G, { onClick: n, variant: "outlined", children: t.skip_button })
|
|
871
873
|
] })
|
|
872
874
|
] });
|
|
873
|
-
}, Wt =
|
|
875
|
+
}, Wt = E(Ht), Le = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", je = {
|
|
874
876
|
CASHFLOW_ONBOARDING: `${Le}/cashflow-onboarding.png`,
|
|
875
877
|
CASHFLOW_LOADING_ANIMATION: `${Le}/loading-animation.gif`
|
|
876
878
|
}, $t = () => {
|
|
877
879
|
const { cashflow: i } = L();
|
|
878
880
|
return /* @__PURE__ */ o(h.Fragment, { children: [
|
|
879
881
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: je.CASHFLOW_LOADING_ANIMATION }) }),
|
|
880
|
-
/* @__PURE__ */ e(
|
|
881
|
-
/* @__PURE__ */ e(
|
|
882
|
+
/* @__PURE__ */ e(me, { pb: 12, variant: "h1", children: i.loading_title }),
|
|
883
|
+
/* @__PURE__ */ e(k, { children: i.loading_description })
|
|
882
884
|
] });
|
|
883
|
-
}, Gt =
|
|
885
|
+
}, Gt = E($t), Mt = at`
|
|
884
886
|
from {
|
|
885
887
|
transform: rotate(0deg);
|
|
886
888
|
}
|
|
@@ -888,42 +890,42 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
888
890
|
transform: rotate(360deg);
|
|
889
891
|
}
|
|
890
892
|
`, jt = () => {
|
|
891
|
-
const { addRepeatingTransaction: i, repeatingTransactions: n } = U(), { cashflow: t, common: a } = L(), { user: f } = Xe(), { completeOnboarding: u } =
|
|
892
|
-
() => x.find((
|
|
893
|
+
const { addRepeatingTransaction: i, repeatingTransactions: n } = U(), { cashflow: t, common: a } = L(), { user: f } = Xe(), { completeOnboarding: u } = ue(), { isDirty: c } = Q(), { isMobile: l } = he(), { isCopyLoaded: b, setDisplayedDate: r } = q(), { filter: g, setFilter: d, transactions: x } = Oe(), _ = re(), [w, T] = X(!0), [I, N] = h.useState(xt.EveryMonth), [p, C] = h.useState(1), [S, ce] = h.useState(15), [K, le] = X(!1), [P, F] = X(1), [O, ze] = X([]), [ge, de] = X(""), H = h.useMemo(
|
|
894
|
+
() => x.find((y) => y.guid === ge),
|
|
893
895
|
[ge, x]
|
|
894
896
|
), Be = !!n.filter(
|
|
895
|
-
(
|
|
897
|
+
(y) => y.repeating_transaction_type === Ae.Income
|
|
896
898
|
).length, be = async () => {
|
|
897
|
-
|
|
899
|
+
F(2), r(
|
|
898
900
|
// Beginning of the month, 90 days before today
|
|
899
901
|
ht(Me(W(), 90)),
|
|
900
902
|
W()
|
|
901
|
-
), d({ ...
|
|
903
|
+
), d({ ...g, custom: Se }), F(3);
|
|
902
904
|
}, Ue = async () => {
|
|
903
|
-
if (!(
|
|
904
|
-
|
|
905
|
-
for (let
|
|
906
|
-
const
|
|
907
|
-
account_guid:
|
|
908
|
-
amount:
|
|
905
|
+
if (!(O.length < 1)) {
|
|
906
|
+
le(!0);
|
|
907
|
+
for (let y = 0; y < O.length; y++) {
|
|
908
|
+
const A = O[y], xe = ve(I, De(A.date)), qe = {
|
|
909
|
+
account_guid: A.account_guid,
|
|
910
|
+
amount: A.amount,
|
|
909
911
|
created_by: 0,
|
|
910
912
|
//user
|
|
911
|
-
merchant_guid:
|
|
912
|
-
description:
|
|
913
|
+
merchant_guid: A.merchant_guid,
|
|
914
|
+
description: A.feed_description || A.description,
|
|
913
915
|
predicted_occurs_on: pt(xe, { representation: "date" }),
|
|
914
916
|
recurrence_day: xe.getDay(),
|
|
915
|
-
recurrence_type:
|
|
917
|
+
recurrence_type: I,
|
|
916
918
|
repeating_transaction_type: Ae.Income,
|
|
917
|
-
second_recurrence_day:
|
|
918
|
-
transaction_type:
|
|
919
|
+
second_recurrence_day: S,
|
|
920
|
+
transaction_type: A.transaction_type,
|
|
919
921
|
user_guid: f.guid
|
|
920
922
|
};
|
|
921
|
-
await i(qe,
|
|
923
|
+
await i(qe, A);
|
|
922
924
|
}
|
|
923
925
|
await u();
|
|
924
926
|
}
|
|
925
|
-
}, Pe = !H && w || !H &&
|
|
926
|
-
return
|
|
927
|
+
}, Pe = !H && w || !H && O.length < 1;
|
|
928
|
+
return b ? /* @__PURE__ */ o(
|
|
927
929
|
D,
|
|
928
930
|
{
|
|
929
931
|
sx: {
|
|
@@ -937,7 +939,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
937
939
|
py: 24
|
|
938
940
|
},
|
|
939
941
|
children: [
|
|
940
|
-
|
|
942
|
+
P === 1 && /* @__PURE__ */ e(
|
|
941
943
|
D,
|
|
942
944
|
{
|
|
943
945
|
sx: {
|
|
@@ -946,7 +948,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
946
948
|
children: /* @__PURE__ */ e(Wt, { handleNextStep: be })
|
|
947
949
|
}
|
|
948
950
|
),
|
|
949
|
-
|
|
951
|
+
P === 2 && /* @__PURE__ */ e(
|
|
950
952
|
D,
|
|
951
953
|
{
|
|
952
954
|
sx: {
|
|
@@ -955,29 +957,29 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
955
957
|
children: /* @__PURE__ */ e(Gt, {})
|
|
956
958
|
}
|
|
957
959
|
),
|
|
958
|
-
|
|
960
|
+
P === 3 && /* @__PURE__ */ o(
|
|
959
961
|
D,
|
|
960
962
|
{
|
|
961
963
|
sx: {
|
|
962
964
|
...l ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
963
965
|
},
|
|
964
966
|
children: [
|
|
965
|
-
/* @__PURE__ */ e(
|
|
966
|
-
/* @__PURE__ */ e(
|
|
967
|
-
|
|
968
|
-
/* @__PURE__ */ e(
|
|
967
|
+
/* @__PURE__ */ e(me, { pb: 12, variant: "h1", children: t.add_income_title }),
|
|
968
|
+
/* @__PURE__ */ e(k, { mb: 24, children: t.add_income_description }),
|
|
969
|
+
O.length > 0 && !H && /* @__PURE__ */ o(B, { children: [
|
|
970
|
+
/* @__PURE__ */ e(ee, { children: O.map((y, A) => /* @__PURE__ */ o(h.Fragment, { children: [
|
|
969
971
|
/* @__PURE__ */ e(ft, { bgcolor: "background.paper", children: bt(
|
|
970
|
-
z(
|
|
972
|
+
z(y.nextDate || y.date)
|
|
971
973
|
) }),
|
|
972
|
-
/* @__PURE__ */ e(gt, { transaction:
|
|
973
|
-
|
|
974
|
-
] },
|
|
974
|
+
/* @__PURE__ */ e(gt, { transaction: y }),
|
|
975
|
+
A !== O.length - 1 && /* @__PURE__ */ e(v, {})
|
|
976
|
+
] }, y.guid)) }),
|
|
975
977
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", children: [
|
|
976
978
|
/* @__PURE__ */ e(v, { sx: { flexGrow: 1 } }),
|
|
977
979
|
/* @__PURE__ */ e(
|
|
978
980
|
G,
|
|
979
981
|
{
|
|
980
|
-
onClick: () =>
|
|
982
|
+
onClick: () => T(!0),
|
|
981
983
|
startIcon: /* @__PURE__ */ e(M, { name: "add", size: 20 }),
|
|
982
984
|
children: t.add_income
|
|
983
985
|
}
|
|
@@ -988,27 +990,27 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
988
990
|
ct,
|
|
989
991
|
{
|
|
990
992
|
bgcolor: "background.paper",
|
|
991
|
-
onSearch: (
|
|
992
|
-
...
|
|
993
|
-
custom: (
|
|
993
|
+
onSearch: (y) => d({
|
|
994
|
+
...g,
|
|
995
|
+
custom: (A) => y ? lt(A, y) : Se(A)
|
|
994
996
|
}),
|
|
995
|
-
onSelected: (
|
|
996
|
-
|
|
997
|
+
onSelected: (y) => {
|
|
998
|
+
de(y), T(!1);
|
|
997
999
|
}
|
|
998
1000
|
}
|
|
999
1001
|
),
|
|
1000
|
-
!Be && c && /* @__PURE__ */ e(
|
|
1002
|
+
!Be && c && /* @__PURE__ */ e(k, { color: "error", mt: 16, children: t.confirm_error }),
|
|
1001
1003
|
H && /* @__PURE__ */ o(B, { children: [
|
|
1002
1004
|
/* @__PURE__ */ e(
|
|
1003
1005
|
dt,
|
|
1004
1006
|
{
|
|
1005
1007
|
bgcolor: "background.paper",
|
|
1006
|
-
firstDay:
|
|
1007
|
-
frequency:
|
|
1008
|
-
onFirstDayChange:
|
|
1009
|
-
onFrequencyChange:
|
|
1010
|
-
onSecondDayChange:
|
|
1011
|
-
secondDay:
|
|
1008
|
+
firstDay: p,
|
|
1009
|
+
frequency: I,
|
|
1010
|
+
onFirstDayChange: C,
|
|
1011
|
+
onFrequencyChange: N,
|
|
1012
|
+
onSecondDayChange: ce,
|
|
1013
|
+
secondDay: S,
|
|
1012
1014
|
transaction: H
|
|
1013
1015
|
}
|
|
1014
1016
|
),
|
|
@@ -1018,12 +1020,12 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
1018
1020
|
{
|
|
1019
1021
|
"aria-disabled": !H,
|
|
1020
1022
|
onClick: () => {
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1023
|
+
const y = [...O];
|
|
1024
|
+
y.push({
|
|
1023
1025
|
...H,
|
|
1024
|
-
nextDate: ve(
|
|
1025
|
-
frequency:
|
|
1026
|
-
}), ze(
|
|
1026
|
+
nextDate: ve(I, De(H.date)),
|
|
1027
|
+
frequency: I
|
|
1028
|
+
}), ze(y), de("");
|
|
1027
1029
|
},
|
|
1028
1030
|
variant: "contained",
|
|
1029
1031
|
children: a.confirm_button
|
|
@@ -1033,7 +1035,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
1033
1035
|
G,
|
|
1034
1036
|
{
|
|
1035
1037
|
onClick: () => {
|
|
1036
|
-
|
|
1038
|
+
de(""), T(!0), be().finally();
|
|
1037
1039
|
},
|
|
1038
1040
|
variant: "outlined",
|
|
1039
1041
|
children: a.cancel_button
|
|
@@ -1041,13 +1043,13 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
1041
1043
|
)
|
|
1042
1044
|
] })
|
|
1043
1045
|
] }),
|
|
1044
|
-
|
|
1046
|
+
O.length > 0 && !H && /* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
1045
1047
|
/* @__PURE__ */ e(
|
|
1046
1048
|
G,
|
|
1047
1049
|
{
|
|
1048
|
-
"aria-disabled":
|
|
1050
|
+
"aria-disabled": O.length < 1 || K,
|
|
1049
1051
|
onClick: Ue,
|
|
1050
|
-
startIcon:
|
|
1052
|
+
startIcon: K ? /* @__PURE__ */ e(
|
|
1051
1053
|
M,
|
|
1052
1054
|
{
|
|
1053
1055
|
name: "progress_activity",
|
|
@@ -1067,8 +1069,8 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
1067
1069
|
)
|
|
1068
1070
|
]
|
|
1069
1071
|
}
|
|
1070
|
-
) : /* @__PURE__ */ e(
|
|
1071
|
-
}, Bn =
|
|
1072
|
+
) : /* @__PURE__ */ e(te, {});
|
|
1073
|
+
}, Bn = E(jt);
|
|
1072
1074
|
class Un {
|
|
1073
1075
|
fetchInstance;
|
|
1074
1076
|
constructor(n, t, a) {
|