@mx-cartographer/experiences 8.0.24 → 8.1.0
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 +8 -9
- package/dist/{AccountApi-ChQr5PAZ.mjs → AccountApi-WEM2M9tg.mjs} +1 -1
- package/dist/{AccountDetailsHeader-D9gbTbUt.mjs → AccountDetailsHeader-IPRH6Wja.mjs} +2 -2
- package/dist/{AccountFields-CxqONzjY.mjs → AccountFields-BbPSfzru.mjs} +3 -3
- package/dist/{AccountListItem-D9WJDbZ1.mjs → AccountListItem-qpACFl6i.mjs} +2 -2
- package/dist/{AccountStore-B7zfcad7.mjs → AccountStore-BeEiLNhW.mjs} +2 -2
- package/dist/Analytics-CjZ0emfs.mjs +53 -0
- package/dist/{Fetch-B6tMJC1r.mjs → ApiEndpoints-C5IA97i7.mjs} +48 -50
- package/dist/{BeatApi-EFHXULDx.mjs → BeatApi-C6pBa0Rb.mjs} +1 -1
- package/dist/{BeatStore-C6CAT-ce.mjs → BeatStore-DuvvrljY.mjs} +1 -1
- package/dist/{BudgetUtil-DZpOoZQa.mjs → BudgetUtil-CLh4xtj4.mjs} +60 -60
- package/dist/CategoryApi-CogDFScz.mjs +29 -0
- package/dist/{CategorySelectorDrawer-Dc9Widy9.mjs → CategorySelectorDrawer-BG04ByUx.mjs} +1 -1
- package/dist/CategoryStore-Bp1kO9Z-.mjs +160 -0
- package/dist/{CategoryUtil-BVixr0d5.mjs → CategoryUtil-DKRCegQv.mjs} +1 -1
- package/dist/{CurrencyInput-DuMktPu3.mjs → CurrencyInput-BkNVHxSV.mjs} +14 -13
- package/dist/{CurrencyText-CA-E5N_y.mjs → CurrencyText-oqd6cX3M.mjs} +1 -1
- package/dist/{DateFormats-BMpMrZpW.mjs → DateFormats-CaOj_4eI.mjs} +1 -1
- package/dist/{DateUtil-wcYTmDRD.mjs → DateUtil-C57sqxn4.mjs} +1 -1
- package/dist/{EmbeddedCard-qwIhF1VP.mjs → EmbeddedCard-j7IGx3s1.mjs} +5 -5
- package/dist/{ExportCsvAction-CHCmCCqf.mjs → ExportCsvAction-7sjz7AXQ.mjs} +1 -1
- package/dist/FinstrongApi-FpmsS_sy.mjs +19 -0
- package/dist/{FinstrongStore-BQxXxxYD.mjs → FinstrongStore-DgyDJTEP.mjs} +121 -137
- package/dist/GlobalCopyApi-DkS-2Zf_.mjs +41 -0
- package/dist/Goal-MFBpoOIC.mjs +29 -0
- package/dist/{GoalStore-fgXt--2Y.mjs → GoalStore-DcaT4fM6.mjs} +81 -104
- package/dist/{Help-BkmSY96v.mjs → Help-cTsMzSQh.mjs} +1 -1
- package/dist/{LineChart-EAr5ox5U.mjs → LineChart-DkD_s9NN.mjs} +1 -1
- package/dist/Localization-C_HZg9tJ.mjs +15 -0
- package/dist/Localization-CkQ49EKr.mjs +26 -0
- package/dist/{ManageIncome-DqqI9HB1.mjs → ManageIncome-DwSE_a8L.mjs} +20 -20
- package/dist/MerchantApi-D8ahYxiG.mjs +15 -0
- package/dist/MerchantStore-CyZTv-BM.mjs +26 -0
- package/dist/{NetWorthStore-BqZ44-4M.mjs → NetWorthStore-Ba3q3VcH.mjs} +1 -1
- package/dist/NotificationApi-DF0obHoR.mjs +20 -0
- package/dist/{NotificationSettings-DBT37CVB.mjs → NotificationSettings-DB-eNgSv.mjs} +3 -3
- package/dist/NotificationStore-DlAM5Ue0.mjs +69 -0
- package/dist/{NumberFormatting-QCaNwbjv.mjs → NumberFormatting-CyrvFgfd.mjs} +1 -1
- package/dist/{OriginalBalanceAction-DjpvVVFz.mjs → OriginalBalanceAction-AB1TGb5P.mjs} +2 -2
- package/dist/{RecurringSettings-OBGLelZQ.mjs → RecurringSettings-CZKeZC4m.mjs} +8 -8
- package/dist/{RecurringTransactions-BbZ6MQsX.mjs → RecurringTransactions-kzlU8OFY.mjs} +5 -5
- package/dist/{RecurringTransactionsStore-BE_eUfTC.mjs → RecurringTransactionsStore-D62Dt2BF.mjs} +76 -90
- package/dist/{RepeatingTransaction-DF4vJn_v.mjs → RepeatingTransaction-D2gmBTd0.mjs} +3 -3
- package/dist/RepeatingTransactionsApi-BNZgZPLs.mjs +17 -0
- package/dist/SettingsApi-D9d7SLhB.mjs +22 -0
- package/dist/{SettingsStore-BoIoiRLj.mjs → SettingsStore-Dsz1mvd3.mjs} +41 -60
- package/dist/{SpendingData-Bz1bCWAs.mjs → SpendingData-CoZOmlZD.mjs} +1 -1
- package/dist/{SpendingLegend-CypdabwS.mjs → SpendingLegend-DljKEG69.mjs} +2 -2
- package/dist/{Transaction-C3Pg9TKf.mjs → Transaction-Cn5_iFm0.mjs} +2 -2
- package/dist/{TransactionApi-Ck5Ua-7F.mjs → TransactionApi-CLG2eSNe.mjs} +1 -1
- package/dist/{TransactionDetails-I1ny1ecc.mjs → TransactionDetails-CN-yZkin.mjs} +9 -9
- package/dist/{TransactionStore-BUsgGRL1.mjs → TransactionStore-6ovFO8P1.mjs} +10 -10
- package/dist/{TrendsStore-CYdTo7cN.mjs → TrendsStore-DZa6cyQC.mjs} +1 -1
- package/dist/{ViewMoreMicroCard-BJOZcYnB.mjs → ViewMoreMicroCard-BsEitNRJ.mjs} +10 -9
- package/dist/WidgetApi-C0BA2cFX.mjs +102 -0
- package/dist/{WidgetContainer-DYKMArWw.mjs → WidgetContainer-Bc75FqK7.mjs} +1 -1
- package/dist/accounts/index.d.ts +0 -1
- package/dist/accounts/index.es.js +63 -65
- package/dist/accounts/stores/AccountStore.d.ts +1 -1
- package/dist/budgets/index.es.js +11 -11
- package/dist/budgets/store/BudgetsStore.d.ts +1 -1
- package/dist/cashflow/index.d.ts +0 -1
- package/dist/cashflow/index.es.js +428 -449
- package/dist/categories/index.es.js +2 -2
- package/dist/categories/stores/CategoryStore.d.ts +2 -1
- package/dist/common/components/Error.d.ts +11 -0
- package/dist/common/components/index.d.ts +1 -0
- package/dist/common/constants/index.d.ts +0 -1
- package/dist/common/index.d.ts +0 -1
- package/dist/common/index.es.js +391 -492
- package/dist/common/stores/AppDataStore.d.ts +2 -2
- package/dist/common/stores/ConnectStore.d.ts +1 -1
- package/dist/common/stores/GlobalCopyStore.d.ts +1 -1
- package/dist/common/stores/UserStore.d.ts +1 -1
- package/dist/common/utils/Localization.d.ts +0 -9
- package/dist/common/utils/index.d.ts +1 -2
- package/dist/{accounts → core}/api/AccountApi.d.ts +2 -2
- package/dist/{common → core}/api/AnalyticsApi.d.ts +1 -1
- package/dist/{common → core}/api/AppDataApi.d.ts +2 -2
- package/dist/{common → core}/api/BannerApi.d.ts +1 -1
- package/dist/{common → core}/api/BeatApi.d.ts +2 -2
- package/dist/{budgets → core}/api/BudgetsApi.d.ts +2 -2
- package/dist/{common → core}/api/CategoryApi.d.ts +2 -2
- package/dist/{finstrong → core}/api/FinstrongApi.d.ts +2 -2
- package/dist/{common → core}/api/GlobalCopyApi.d.ts +2 -2
- package/dist/{goals → core}/api/GoalApi.d.ts +2 -2
- package/dist/{help → core}/api/HelpApi.d.ts +2 -2
- package/dist/{investments → core}/api/HoldingApi.d.ts +2 -2
- package/dist/{merchants → core}/api/MerchantApi.d.ts +2 -2
- package/dist/{common → core}/api/NotificationApi.d.ts +2 -2
- package/dist/{recurringtransactions → core}/api/RepeatingTransactionsApi.d.ts +2 -2
- package/dist/{common → core}/api/ScheduledPaymentsApi.d.ts +2 -2
- package/dist/{settings → core}/api/SettingsApi.d.ts +2 -2
- package/dist/{transactions → core}/api/TransactionApi.d.ts +2 -2
- package/dist/{common → core}/api/UserApi.d.ts +2 -2
- package/dist/{common → core}/api/WidgetApi.d.ts +1 -1
- package/dist/core/api/index.d.ts +20 -0
- package/dist/{common → core}/constants/ApiEndpoints.d.ts +0 -2
- package/dist/core/constants/index.d.ts +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.es.js +90 -38
- package/dist/{common → core}/utils/Fetch.d.ts +1 -1
- package/dist/core/utils/Localization.d.ts +9 -0
- package/dist/core/utils/index.d.ts +2 -0
- package/dist/debts/index.es.js +7 -7
- package/dist/{exportTransactionsToCSV-DgdB3TBt.mjs → exportTransactionsToCSV-Dnd5lVq7.mjs} +2 -2
- package/dist/finstrong/index.d.ts +0 -1
- package/dist/finstrong/index.es.js +16 -17
- package/dist/finstrong/stores/FinstrongStore.d.ts +1 -1
- package/dist/goals/index.d.ts +0 -1
- package/dist/goals/index.es.js +50 -51
- package/dist/goals/stores/GoalStore.d.ts +1 -1
- package/dist/help/index.es.js +2 -2
- package/dist/help/store/HelpStore.d.ts +1 -1
- package/dist/insights/index.es.js +6 -6
- package/dist/insights/store/BeatStore.d.ts +1 -1
- package/dist/investments/index.es.js +2 -2
- package/dist/investments/stores/HoldingStore.d.ts +1 -1
- package/dist/merchants/index.es.js +1 -1
- package/dist/merchants/stores/MerchantStore.d.ts +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/microinsights/stores/CopyStore.d.ts +1 -1
- package/dist/microinsights/stores/InsightsMicroWidgetStore.d.ts +1 -1
- package/dist/networth/index.es.js +8 -8
- package/dist/networth/stores/NetWorthStore.d.ts +1 -1
- package/dist/notifications/index.es.js +5 -5
- package/dist/notifications/stores/NotificationStore.d.ts +2 -1
- package/dist/recurringtransactions/index.es.js +26 -25
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +1 -1
- package/dist/settings/index.d.ts +0 -1
- package/dist/settings/index.es.js +65 -66
- package/dist/settings/stores/SettingsStore.d.ts +2 -2
- package/dist/spending/index.es.js +6 -6
- package/dist/transactions/index.d.ts +0 -1
- package/dist/transactions/index.es.js +22 -24
- package/dist/transactions/stores/TransactionStore.d.ts +3 -2
- package/dist/trends/index.es.js +14 -14
- package/package.json +1 -1
- package/dist/CategoryStore-FTxUbn0f.mjs +0 -186
- package/dist/Goal-0loDagc5.mjs +0 -6
- package/dist/Localization-CPkpIwIx.mjs +0 -37
- package/dist/MerchantStore-BzGi4JAZ.mjs +0 -37
- package/dist/NotificationStore-D_e8zo5M.mjs +0 -86
- package/dist/cashflow/api/CashflowApi.d.ts +0 -13
- package/dist/common/api/LocalizedCopyApi.d.ts +0 -8
- package/dist/common/api/index.d.ts +0 -10
- package/dist/repeatingTransactions-DHIG94pi.mjs +0 -4
- package/dist/useCombineEvents-Bqojlv8q.mjs +0 -92
|
@@ -1,65 +1,64 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import h, { useState as
|
|
3
|
-
import { observer as
|
|
4
|
-
import { addMonths as
|
|
5
|
-
import { startOfToday as
|
|
6
|
-
import
|
|
1
|
+
import { jsxs as n, Fragment as $, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import h, { useState as V } from "react";
|
|
3
|
+
import { observer as A } from "mobx-react-lite";
|
|
4
|
+
import { addMonths as Ye } from "date-fns/addMonths";
|
|
5
|
+
import { startOfToday as F } from "date-fns/startOfToday";
|
|
6
|
+
import I 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
|
|
12
|
-
import { C as
|
|
9
|
+
import ie from "@mui/material/styles/useTheme";
|
|
10
|
+
import { Text as m, P as N, Icon as z, InstitutionLogo as xe, H2 as de, H3 as qe } from "@mxenabled/mxui";
|
|
11
|
+
import { G as Ke, t as me, u as k, p as ae, d as ke, b as P, i as j, g as Le, a as Ve, h as Ne, o as Xe } from "../hooks-BxkfR-Ff.mjs";
|
|
12
|
+
import { C as E } from "../CurrencyText-oqd6cX3M.mjs";
|
|
13
13
|
import { I as pe } from "../CashflowStore-CeAzChyD.mjs";
|
|
14
|
-
import { C as
|
|
15
|
-
import { u as
|
|
16
|
-
import { L as
|
|
17
|
-
import { b as
|
|
14
|
+
import { C as Bn } from "../CashflowStore-CeAzChyD.mjs";
|
|
15
|
+
import { u as ue } from "../useScreenSize-CUcpY7aJ.mjs";
|
|
16
|
+
import { L as Z } from "../Loader-D3rjKx72.mjs";
|
|
17
|
+
import { b as H } from "../Localization-CkQ49EKr.mjs";
|
|
18
18
|
import { M as Je } from "../MiniWidgetContainer-Bhkv-hpz.mjs";
|
|
19
|
-
import { E as
|
|
20
|
-
import { u as
|
|
21
|
-
import { R as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import { getUnixTime as
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import { A as
|
|
28
|
-
import { f as
|
|
29
|
-
import
|
|
30
|
-
import { f as
|
|
31
|
-
import { isAfter as
|
|
32
|
-
import { isBefore as
|
|
33
|
-
import { isToday as
|
|
34
|
-
import { addDays as
|
|
35
|
-
import { alpha as
|
|
36
|
-
import { DataGridPro as
|
|
37
|
-
import { T as
|
|
38
|
-
import
|
|
39
|
-
import { M as
|
|
40
|
-
import { D as
|
|
41
|
-
import { subDays as
|
|
42
|
-
import { endOfToday as
|
|
43
|
-
import { W as
|
|
44
|
-
import { A as
|
|
45
|
-
import { A as
|
|
19
|
+
import { E as Qe } from "../EmptyState-DHAkGsjk.mjs";
|
|
20
|
+
import { u as Oe } from "../useWidgetLoadTimer-DgN1bTyu.mjs";
|
|
21
|
+
import { R as Ze } from "../RecurringSettings-CZKeZC4m.mjs";
|
|
22
|
+
import et from "@mui/material/Tabs";
|
|
23
|
+
import ye from "@mui/material/Tab";
|
|
24
|
+
import { getUnixTime as le } from "date-fns/getUnixTime";
|
|
25
|
+
import Q from "@mui/material/List";
|
|
26
|
+
import ee from "@mui/material/ListItem";
|
|
27
|
+
import { A as tt } from "../AccountListItem-qpACFl6i.mjs";
|
|
28
|
+
import { f as U, D as Y } from "../DateFormats-CaOj_4eI.mjs";
|
|
29
|
+
import nt from "@mui/material/ListSubheader";
|
|
30
|
+
import { f as J } from "../NumberFormatting-CyrvFgfd.mjs";
|
|
31
|
+
import { isAfter as Ge } from "date-fns/isAfter";
|
|
32
|
+
import { isBefore as Me } from "date-fns/isBefore";
|
|
33
|
+
import { isToday as Fe } from "date-fns/isToday";
|
|
34
|
+
import { addDays as Ce } from "date-fns/addDays";
|
|
35
|
+
import { alpha as ot, keyframes as it } from "@mui/material/styles";
|
|
36
|
+
import { DataGridPro as at } from "@mui/x-data-grid-pro";
|
|
37
|
+
import { T as _e } from "../TabContentContainer-j01JYR_7.mjs";
|
|
38
|
+
import W from "@mui/material/Button";
|
|
39
|
+
import { M as rt, S as st, i as ct, b as we, c as lt } from "../ManageIncome-DwSE_a8L.mjs";
|
|
40
|
+
import { D as He } from "../Drawer-Bbe4AMB1.mjs";
|
|
41
|
+
import { subDays as We } from "date-fns/subDays";
|
|
42
|
+
import { endOfToday as dt } from "date-fns/endOfToday";
|
|
43
|
+
import { W as mt } from "../WidgetContainer-Bc75FqK7.mjs";
|
|
44
|
+
import { A as Se } from "../Analytics-0Xm_BjHU.mjs";
|
|
45
|
+
import { A as X } 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
|
-
import { startOfMonth as
|
|
49
|
-
import { S as
|
|
50
|
-
import { c as
|
|
51
|
-
import { h as
|
|
52
|
-
import { F as
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (!h.useContext(Qe))
|
|
48
|
+
import { startOfMonth as ut } from "date-fns/startOfMonth";
|
|
49
|
+
import { S as ht, a as ft } from "../EmbeddedCard-j7IGx3s1.mjs";
|
|
50
|
+
import { c as Ie } from "../RecurringTransactions-kzlU8OFY.mjs";
|
|
51
|
+
import { h as gt } from "../DateUtil-C57sqxn4.mjs";
|
|
52
|
+
import { F as bt, b as ve } from "../RepeatingTransaction-D2gmBTd0.mjs";
|
|
53
|
+
const q = () => {
|
|
54
|
+
if (!h.useContext(Ke))
|
|
56
55
|
throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
|
|
57
|
-
return
|
|
58
|
-
},
|
|
59
|
-
const { cashflow:
|
|
60
|
-
return /* @__PURE__ */
|
|
56
|
+
return me().uiStore;
|
|
57
|
+
}, xt = ({ remaining: i }) => {
|
|
58
|
+
const { cashflow: o } = k();
|
|
59
|
+
return /* @__PURE__ */ n($, { children: [
|
|
61
60
|
/* @__PURE__ */ e(
|
|
62
|
-
|
|
61
|
+
I,
|
|
63
62
|
{
|
|
64
63
|
sx: {
|
|
65
64
|
borderRadius: "1px",
|
|
@@ -69,36 +68,36 @@ const Q = () => {
|
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
),
|
|
72
|
-
/* @__PURE__ */ e(m, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children:
|
|
73
|
-
/* @__PURE__ */ e(
|
|
71
|
+
/* @__PURE__ */ e(m, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: o.remaining_cash }),
|
|
72
|
+
/* @__PURE__ */ e(E, { amount: i, bold: !0, sx: { fontSize: 12 } })
|
|
74
73
|
] });
|
|
75
|
-
},
|
|
76
|
-
const i =
|
|
74
|
+
}, he = A(xt), yt = () => {
|
|
75
|
+
const i = ie(), { availableWidth: o } = ae(), { isMobile: t } = ue(), { visibleCashAccounts: r, visibleCashBalance: f } = ke(), { selectedAccountGuids: p } = P(), { cashflow: c } = k(), {
|
|
77
76
|
daysUntilNextIncome: l,
|
|
78
77
|
expensesTilNextIncome: b,
|
|
79
|
-
selectedCashAccounts:
|
|
78
|
+
selectedCashAccounts: a,
|
|
80
79
|
setNextIncome: g,
|
|
81
80
|
setSelectedCashAccounts: d,
|
|
82
81
|
setUpcomingExpenses: x
|
|
83
|
-
} =
|
|
82
|
+
} = q(), { isDataLoaded: _, nextIncomeRecurrence: w, upcomingExpenses: R } = j();
|
|
84
83
|
h.useEffect(() => {
|
|
85
84
|
d(
|
|
86
|
-
|
|
85
|
+
r.filter((C) => p.includes(C.guid))
|
|
87
86
|
);
|
|
88
|
-
}, [
|
|
89
|
-
w && g(w), x(
|
|
90
|
-
}, [w,
|
|
91
|
-
const
|
|
92
|
-
() =>
|
|
93
|
-
[
|
|
94
|
-
),
|
|
95
|
-
() => b.filter((C) =>
|
|
96
|
-
[
|
|
97
|
-
),
|
|
98
|
-
() =>
|
|
99
|
-
[
|
|
87
|
+
}, [r, p]), h.useEffect(() => {
|
|
88
|
+
w && g(w), x(R);
|
|
89
|
+
}, [w, R]);
|
|
90
|
+
const D = h.useMemo(
|
|
91
|
+
() => r.filter((C) => p.includes(C.guid)).reduce((C, S) => C + (S?.balance || 0), 0),
|
|
92
|
+
[p, R]
|
|
93
|
+
), L = h.useMemo(
|
|
94
|
+
() => b.filter((C) => p.includes(C.accountGuid || "")).reduce((C, S) => C + S.amount, 0),
|
|
95
|
+
[p, b]
|
|
96
|
+
), u = h.useMemo(
|
|
97
|
+
() => D - L,
|
|
98
|
+
[D, L]
|
|
100
99
|
);
|
|
101
|
-
return _ ? /* @__PURE__ */ e(
|
|
100
|
+
return _ ? /* @__PURE__ */ e(I, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: o > 710 ? /* @__PURE__ */ n(
|
|
102
101
|
s,
|
|
103
102
|
{
|
|
104
103
|
border: `1px solid ${i.palette.divider}`,
|
|
@@ -107,44 +106,44 @@ const Q = () => {
|
|
|
107
106
|
justifyContent: "space-between",
|
|
108
107
|
px: 24,
|
|
109
108
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */ e(
|
|
112
|
-
/* @__PURE__ */ e(
|
|
109
|
+
/* @__PURE__ */ n(s, { pb: 14, pt: 12, children: [
|
|
110
|
+
/* @__PURE__ */ e(E, { amount: D, variant: "h2" }),
|
|
111
|
+
/* @__PURE__ */ e(N, { variant: "caption", whiteSpace: "nowrap", children: H(
|
|
113
112
|
c.total_cash_accounts,
|
|
114
|
-
|
|
113
|
+
a.length
|
|
115
114
|
) })
|
|
116
115
|
] }),
|
|
117
|
-
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */ e(
|
|
120
|
-
/* @__PURE__ */ e(
|
|
116
|
+
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(z, { name: "remove" }) }),
|
|
117
|
+
/* @__PURE__ */ n(s, { pb: 14, pt: 12, children: [
|
|
118
|
+
/* @__PURE__ */ e(E, { amount: L, variant: "h2" }),
|
|
119
|
+
/* @__PURE__ */ e(N, { variant: "caption", whiteSpace: "nowrap", children: H(c.expenses_due, b.length) })
|
|
121
120
|
] }),
|
|
122
|
-
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */ e(
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */ e(
|
|
121
|
+
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(z, { name: "equal" }) }),
|
|
122
|
+
/* @__PURE__ */ n(s, { pb: 14, pr: 24, pt: 12, children: [
|
|
123
|
+
/* @__PURE__ */ e(E, { amount: u, variant: "h2" }),
|
|
124
|
+
/* @__PURE__ */ n(s, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
125
|
+
/* @__PURE__ */ e(N, { variant: "caption", whiteSpace: "nowrap", children: c.available_to_spend }),
|
|
127
126
|
/* @__PURE__ */ e(pe, { body: c.tooltip_body, title: c.tooltip_title })
|
|
128
127
|
] })
|
|
129
128
|
] }),
|
|
130
|
-
/* @__PURE__ */ e(s, { borderLeft: `1px solid ${i.palette.divider}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */ e(m, { variant: "h2", children:
|
|
132
|
-
/* @__PURE__ */ e(
|
|
129
|
+
/* @__PURE__ */ e(s, { borderLeft: `1px solid ${i.palette.divider}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ n($, { children: [
|
|
130
|
+
/* @__PURE__ */ e(m, { variant: "h2", children: H(c.days, l) }),
|
|
131
|
+
/* @__PURE__ */ e(N, { variant: "caption", whiteSpace: "nowrap", children: c.next_paycheck })
|
|
133
132
|
] }) })
|
|
134
133
|
]
|
|
135
134
|
}
|
|
136
|
-
) : /* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */ e(m, { variant: "body2", children:
|
|
135
|
+
) : /* @__PURE__ */ n(s, { border: `1px solid ${i.palette.divider}`, borderRadius: 1, children: [
|
|
136
|
+
/* @__PURE__ */ n(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
137
|
+
/* @__PURE__ */ e(m, { variant: "body2", children: H(
|
|
139
138
|
c.total_cash_accounts,
|
|
140
|
-
|
|
139
|
+
a.length
|
|
141
140
|
) }),
|
|
142
|
-
/* @__PURE__ */ e(
|
|
141
|
+
/* @__PURE__ */ e(E, { amount: f, bold: !0, variant: "caption" })
|
|
143
142
|
] }),
|
|
144
143
|
/* @__PURE__ */ e(v, {}),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */ e(m, { variant: "body2", children:
|
|
147
|
-
/* @__PURE__ */ e(
|
|
144
|
+
/* @__PURE__ */ n(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
145
|
+
/* @__PURE__ */ e(m, { variant: "body2", children: H(c.expenses_due, b.length) }),
|
|
146
|
+
/* @__PURE__ */ e(E, { amount: L, bold: !0, symbol: "-", variant: "caption" })
|
|
148
147
|
] }),
|
|
149
148
|
/* @__PURE__ */ e(v, {}),
|
|
150
149
|
/* @__PURE__ */ e(
|
|
@@ -158,56 +157,56 @@ const Q = () => {
|
|
|
158
157
|
justifyContent: "space-between",
|
|
159
158
|
px: 16,
|
|
160
159
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
161
|
-
children: /* @__PURE__ */ e(
|
|
160
|
+
children: /* @__PURE__ */ e(he, { remaining: u })
|
|
162
161
|
}
|
|
163
162
|
),
|
|
164
163
|
/* @__PURE__ */ e(v, {}),
|
|
165
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ n(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
166
165
|
/* @__PURE__ */ e(m, { variant: "body2", children: c.next_paycheck }),
|
|
167
|
-
/* @__PURE__ */ e(m, { bold: !0, variant: "caption", children:
|
|
166
|
+
/* @__PURE__ */ e(m, { bold: !0, variant: "caption", children: H(c.days, l) })
|
|
168
167
|
] })
|
|
169
|
-
] }) }) : /* @__PURE__ */ e(
|
|
170
|
-
},
|
|
168
|
+
] }) }) : /* @__PURE__ */ e(Z, { height: t ? 210 : 120 });
|
|
169
|
+
}, Ct = A(yt), _t = ({
|
|
171
170
|
onPrimaryCtaClick: i,
|
|
172
|
-
onSecondaryCtaClick:
|
|
171
|
+
onSecondaryCtaClick: o,
|
|
173
172
|
sx: t = {}
|
|
174
173
|
}) => {
|
|
175
|
-
const { cashflow:
|
|
174
|
+
const { cashflow: r } = k(), { isInitialized: f } = P(), { loadRepeatingTransactionData: p, income: c, isDataLoaded: l, setDateRange: b } = j();
|
|
176
175
|
h.useEffect(() => {
|
|
177
|
-
b({ start:
|
|
178
|
-
}, []),
|
|
176
|
+
b({ start: F(), end: Ye(F(), 1) }), l || p().finally();
|
|
177
|
+
}, []), Oe({
|
|
179
178
|
widgetName: "CashflowMiniWidget",
|
|
180
179
|
isLoaded: l
|
|
181
180
|
});
|
|
182
|
-
const
|
|
183
|
-
return f ? /* @__PURE__ */
|
|
181
|
+
const a = l && !c.length;
|
|
182
|
+
return f ? /* @__PURE__ */ n(
|
|
184
183
|
Je,
|
|
185
184
|
{
|
|
186
185
|
className: "mx-exp-cashflow-miniwidget",
|
|
187
186
|
onPrimaryCtaClick: i,
|
|
188
|
-
primaryCtaLabel:
|
|
189
|
-
primaryCtaLabelAria:
|
|
190
|
-
subTitle:
|
|
187
|
+
primaryCtaLabel: r.primary_cta,
|
|
188
|
+
primaryCtaLabelAria: r.primary_cta_aria,
|
|
189
|
+
subTitle: a || !l ? void 0 : r.sub_title,
|
|
191
190
|
sx: { height: "100%", ...t },
|
|
192
|
-
title:
|
|
191
|
+
title: r.title,
|
|
193
192
|
children: [
|
|
194
|
-
!l && /* @__PURE__ */ e(
|
|
195
|
-
l && (
|
|
196
|
-
|
|
193
|
+
!l && /* @__PURE__ */ e(Z, {}),
|
|
194
|
+
l && (a ? /* @__PURE__ */ e(
|
|
195
|
+
Qe,
|
|
197
196
|
{
|
|
198
|
-
header:
|
|
197
|
+
header: r.create,
|
|
199
198
|
icon: "local_atm",
|
|
200
|
-
onClick:
|
|
201
|
-
primaryButton:
|
|
199
|
+
onClick: o,
|
|
200
|
+
primaryButton: r.add_income,
|
|
202
201
|
primaryButtonStartIcon: "add",
|
|
203
|
-
subText:
|
|
202
|
+
subText: r.create_description
|
|
204
203
|
}
|
|
205
|
-
) : /* @__PURE__ */ e(
|
|
204
|
+
) : /* @__PURE__ */ e(Ct, {}))
|
|
206
205
|
]
|
|
207
206
|
}
|
|
208
|
-
) : /* @__PURE__ */ e(
|
|
209
|
-
},
|
|
210
|
-
|
|
207
|
+
) : /* @__PURE__ */ e(Z, {});
|
|
208
|
+
}, Hn = A(_t), wt = ({ remaining: i }) => /* @__PURE__ */ e(
|
|
209
|
+
ee,
|
|
211
210
|
{
|
|
212
211
|
sx: {
|
|
213
212
|
alignItems: "center",
|
|
@@ -219,19 +218,19 @@ const Q = () => {
|
|
|
219
218
|
borderBottomRightRadius: "3px",
|
|
220
219
|
minHeight: "auto"
|
|
221
220
|
},
|
|
222
|
-
children: /* @__PURE__ */ e(
|
|
221
|
+
children: /* @__PURE__ */ e(he, { remaining: i })
|
|
223
222
|
}
|
|
224
223
|
);
|
|
225
|
-
var
|
|
226
|
-
const
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children:
|
|
230
|
-
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children:
|
|
224
|
+
var te = /* @__PURE__ */ ((i) => (i.EXPENSE = "expense", i.INCOME = "income", i))(te || {});
|
|
225
|
+
const St = ({ recurrence: i }) => /* @__PURE__ */ n($, { children: [
|
|
226
|
+
/* @__PURE__ */ n(ee, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
|
|
227
|
+
/* @__PURE__ */ n(s, { alignItems: "center", height: 32, width: 32, children: [
|
|
228
|
+
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children: U(i.expectedDate, Y.MONTH) }),
|
|
229
|
+
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children: U(i.expectedDate, Y.DAY) })
|
|
231
230
|
] }),
|
|
232
231
|
/* @__PURE__ */ e(m, { sx: { flexGrow: 1, fontSize: 13 }, children: i.name }),
|
|
233
232
|
/* @__PURE__ */ e(
|
|
234
|
-
|
|
233
|
+
E,
|
|
235
234
|
{
|
|
236
235
|
amount: i.amount,
|
|
237
236
|
bold: !0,
|
|
@@ -240,11 +239,11 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
240
239
|
)
|
|
241
240
|
] }),
|
|
242
241
|
/* @__PURE__ */ e(v, {})
|
|
243
|
-
] }),
|
|
244
|
-
const { cashflow: t } =
|
|
245
|
-
return /* @__PURE__ */
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
|
|
242
|
+
] }), Te = A(St), Dt = ({ total: i, type: o }) => {
|
|
243
|
+
const { cashflow: t } = k();
|
|
244
|
+
return /* @__PURE__ */ n($, { children: [
|
|
245
|
+
/* @__PURE__ */ n(
|
|
246
|
+
nt,
|
|
248
247
|
{
|
|
249
248
|
sx: {
|
|
250
249
|
alignItems: "center",
|
|
@@ -256,40 +255,40 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
256
255
|
px: 24
|
|
257
256
|
},
|
|
258
257
|
children: [
|
|
259
|
-
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 12 }, children:
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
|
|
262
|
-
|
|
258
|
+
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 12 }, children: o === te.EXPENSE ? t.expenses : t.income }),
|
|
259
|
+
/* @__PURE__ */ n(m, { bold: !0, sx: { fontSize: 13 }, children: [
|
|
260
|
+
o === te.EXPENSE ? "-" : "+",
|
|
261
|
+
J(i, "0,0.00")
|
|
263
262
|
] })
|
|
264
263
|
]
|
|
265
264
|
}
|
|
266
265
|
),
|
|
267
266
|
/* @__PURE__ */ e(v, {})
|
|
268
267
|
] });
|
|
269
|
-
},
|
|
270
|
-
const { availableWidth: i } =
|
|
271
|
-
return /* @__PURE__ */
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children:
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
|
|
268
|
+
}, Ae = A(Dt), oe = (i, o) => (t) => t.accountGuid === i.guid && (Fe(t.expectedDate) || Ge(t.expectedDate, o.start)) && Me(t.expectedDate, o.end), It = () => {
|
|
269
|
+
const { availableWidth: i } = ae(), { cashflow: o } = k(), { upcomingExpenses: t, upcomingIncome: r } = j(), { dateRange: f, selectedCashAccounts: p } = q();
|
|
270
|
+
return /* @__PURE__ */ n(s, { children: [
|
|
271
|
+
/* @__PURE__ */ n(s, { direction: i < 400 ? "column" : "row", justifyContent: "space-between", children: [
|
|
272
|
+
/* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: o.accounts_breakdown }),
|
|
273
|
+
/* @__PURE__ */ n(m, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: [
|
|
274
|
+
U(f.start, Y.FULL_MONTH_DAY),
|
|
276
275
|
" -",
|
|
277
276
|
" ",
|
|
278
|
-
|
|
277
|
+
U(f.end, Y.FULL_MONTH_DAY)
|
|
279
278
|
] })
|
|
280
279
|
] }),
|
|
281
|
-
/* @__PURE__ */ e(s, { children:
|
|
282
|
-
const l =
|
|
283
|
-
|
|
284
|
-
),
|
|
280
|
+
/* @__PURE__ */ e(s, { children: p.map((c) => {
|
|
281
|
+
const l = r.filter(oe(c, f)).sort((d, x) => le(d.expectedDate) - le(x.expectedDate)), b = t.filter(
|
|
282
|
+
oe(c, f)
|
|
283
|
+
), a = l.reduce(
|
|
285
284
|
(d, x) => d + x.amount,
|
|
286
285
|
0
|
|
287
286
|
), g = b.reduce(
|
|
288
287
|
(d, x) => d + x.amount,
|
|
289
288
|
0
|
|
290
289
|
);
|
|
291
|
-
return /* @__PURE__ */
|
|
292
|
-
|
|
290
|
+
return /* @__PURE__ */ n(
|
|
291
|
+
Q,
|
|
293
292
|
{
|
|
294
293
|
sx: {
|
|
295
294
|
border: "1px solid",
|
|
@@ -299,7 +298,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
299
298
|
},
|
|
300
299
|
children: [
|
|
301
300
|
/* @__PURE__ */ e(
|
|
302
|
-
|
|
301
|
+
tt,
|
|
303
302
|
{
|
|
304
303
|
account: c,
|
|
305
304
|
listItemProps: {
|
|
@@ -310,26 +309,26 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
310
309
|
}
|
|
311
310
|
),
|
|
312
311
|
/* @__PURE__ */ e(v, {}),
|
|
313
|
-
l.length > 0 && /* @__PURE__ */ e(
|
|
314
|
-
|
|
312
|
+
l.length > 0 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(
|
|
313
|
+
Q,
|
|
315
314
|
{
|
|
316
|
-
subheader: /* @__PURE__ */ e(
|
|
315
|
+
subheader: /* @__PURE__ */ e(Ae, { total: a, type: te.INCOME }),
|
|
317
316
|
sx: { width: "100%" },
|
|
318
|
-
children: l.map((d) => /* @__PURE__ */ e(
|
|
317
|
+
children: l.map((d) => /* @__PURE__ */ e(Te, { recurrence: d }, d.repeatingTransactionGuid))
|
|
319
318
|
}
|
|
320
319
|
) }),
|
|
321
|
-
b.length > 0 && /* @__PURE__ */ e(
|
|
322
|
-
|
|
320
|
+
b.length > 0 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(
|
|
321
|
+
Q,
|
|
323
322
|
{
|
|
324
|
-
subheader: /* @__PURE__ */ e(
|
|
323
|
+
subheader: /* @__PURE__ */ e(Ae, { total: g, type: te.EXPENSE }),
|
|
325
324
|
sx: { width: "100%" },
|
|
326
|
-
children: b.map((d) => /* @__PURE__ */ e(
|
|
325
|
+
children: b.map((d) => /* @__PURE__ */ e(Te, { recurrence: d }, d.repeatingTransactionGuid))
|
|
327
326
|
}
|
|
328
327
|
) }),
|
|
329
328
|
/* @__PURE__ */ e(
|
|
330
|
-
|
|
329
|
+
wt,
|
|
331
330
|
{
|
|
332
|
-
remaining: (c.available_balance || c.balance || 0) +
|
|
331
|
+
remaining: (c.available_balance || c.balance || 0) + a - g
|
|
333
332
|
}
|
|
334
333
|
)
|
|
335
334
|
]
|
|
@@ -338,17 +337,17 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
338
337
|
);
|
|
339
338
|
}) })
|
|
340
339
|
] });
|
|
341
|
-
},
|
|
342
|
-
const { availableWidth: i } =
|
|
340
|
+
}, vt = A(It), Tt = () => {
|
|
341
|
+
const { availableWidth: i } = ae(), o = ie(), { cashflow: t } = k(), { upcomingExpenses: r, upcomingIncome: f } = j(), { dateRange: p, selectedCashAccounts: c } = q(), l = [
|
|
343
342
|
{
|
|
344
343
|
field: "account",
|
|
345
344
|
flex: 1.5,
|
|
346
345
|
headerName: t.accounts,
|
|
347
|
-
renderCell: ({ value: { name:
|
|
348
|
-
const _ = g ||
|
|
349
|
-
return /* @__PURE__ */
|
|
346
|
+
renderCell: ({ value: { name: a, nickname: g, institution_guid: d, account_number: x } }) => {
|
|
347
|
+
const _ = g || a;
|
|
348
|
+
return /* @__PURE__ */ n(s, { alignItems: "center", flexDirection: "row", gap: 12, children: [
|
|
350
349
|
/* @__PURE__ */ e(
|
|
351
|
-
|
|
350
|
+
xe,
|
|
352
351
|
{
|
|
353
352
|
alt: t.institution_logo,
|
|
354
353
|
institutionGuid: d || "",
|
|
@@ -364,69 +363,69 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
364
363
|
flex: 1,
|
|
365
364
|
headerName: t.balance,
|
|
366
365
|
type: "number",
|
|
367
|
-
renderCell: (
|
|
366
|
+
renderCell: (a) => /* @__PURE__ */ e(m, { color: o.palette.text.primary, variant: "body2", children: J(a.value, "0,0.00") })
|
|
368
367
|
},
|
|
369
368
|
{
|
|
370
369
|
field: "income",
|
|
371
370
|
flex: 1,
|
|
372
371
|
headerName: t.projected_income,
|
|
373
372
|
type: "number",
|
|
374
|
-
renderCell: (
|
|
373
|
+
renderCell: (a) => /* @__PURE__ */ e(m, { color: o.palette.text.primary, variant: "body2", children: `+${J(a.value, "0,0.00")}` })
|
|
375
374
|
},
|
|
376
375
|
{
|
|
377
376
|
field: "expenses",
|
|
378
377
|
flex: 1.1,
|
|
379
378
|
headerName: t.projected_expenses,
|
|
380
379
|
type: "number",
|
|
381
|
-
renderCell: (
|
|
380
|
+
renderCell: (a) => /* @__PURE__ */ e(m, { color: o.palette.text.primary, variant: "body2", children: `-${J(a.value, "0,0.00")}` })
|
|
382
381
|
},
|
|
383
382
|
{
|
|
384
383
|
field: "remaining",
|
|
385
384
|
flex: 1,
|
|
386
385
|
headerName: t.remaining,
|
|
387
386
|
type: "number",
|
|
388
|
-
renderCell: (
|
|
389
|
-
const g =
|
|
387
|
+
renderCell: (a) => {
|
|
388
|
+
const g = a.row.balance + a.row.income - a.row.expenses;
|
|
390
389
|
return /* @__PURE__ */ e(
|
|
391
390
|
m,
|
|
392
391
|
{
|
|
393
|
-
color: Math.sign(g) === -1 ?
|
|
392
|
+
color: Math.sign(g) === -1 ? o.palette.error.main : o.palette.text.primary,
|
|
394
393
|
variant: "body2",
|
|
395
|
-
children:
|
|
394
|
+
children: J(g, "0,0.00")
|
|
396
395
|
}
|
|
397
396
|
);
|
|
398
397
|
}
|
|
399
398
|
}
|
|
400
|
-
], b = h.useMemo(() => c.map((
|
|
401
|
-
const g =
|
|
402
|
-
|
|
399
|
+
], b = h.useMemo(() => c.map((a) => {
|
|
400
|
+
const g = r.filter(
|
|
401
|
+
oe(a, { start: F(), end: Ce(F(), 30) })
|
|
403
402
|
).reduce((_, w) => _ + w.amount, 0), d = f.filter(
|
|
404
|
-
|
|
405
|
-
).reduce((_, w) => _ + w.amount, 0), x = (
|
|
403
|
+
oe(a, { start: F(), end: Ce(F(), 30) })
|
|
404
|
+
).reduce((_, w) => _ + w.amount, 0), x = (a.balance || 0) + d - g;
|
|
406
405
|
return {
|
|
407
|
-
account:
|
|
408
|
-
balance:
|
|
409
|
-
id:
|
|
406
|
+
account: a,
|
|
407
|
+
balance: a.balance || 0,
|
|
408
|
+
id: a.guid,
|
|
410
409
|
income: d,
|
|
411
410
|
expenses: g,
|
|
412
411
|
remaining: x
|
|
413
412
|
};
|
|
414
|
-
}), [c,
|
|
415
|
-
return /* @__PURE__ */
|
|
416
|
-
|
|
413
|
+
}), [c, r, f]);
|
|
414
|
+
return /* @__PURE__ */ n(
|
|
415
|
+
I,
|
|
417
416
|
{
|
|
418
417
|
sx: {
|
|
419
418
|
width: "100%"
|
|
420
419
|
},
|
|
421
420
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ n(
|
|
423
422
|
s,
|
|
424
423
|
{
|
|
425
424
|
direction: i < 540 ? "column" : "row",
|
|
426
425
|
justifyContent: "space-between",
|
|
427
426
|
mb: 12,
|
|
428
427
|
children: [
|
|
429
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ n(s, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
430
429
|
/* @__PURE__ */ e(
|
|
431
430
|
m,
|
|
432
431
|
{
|
|
@@ -446,17 +445,17 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
446
445
|
}
|
|
447
446
|
)
|
|
448
447
|
] }),
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
|
|
448
|
+
/* @__PURE__ */ n(m, { bold: !0, sx: { fontSize: 15, whiteSpace: "normal" }, children: [
|
|
449
|
+
U(p.start, Y.FULL_MONTH_DAY),
|
|
451
450
|
" -",
|
|
452
451
|
" ",
|
|
453
|
-
|
|
452
|
+
U(p.end, Y.FULL_MONTH_DAY)
|
|
454
453
|
] })
|
|
455
454
|
]
|
|
456
455
|
}
|
|
457
456
|
),
|
|
458
457
|
i > 650 ? /* @__PURE__ */ e(
|
|
459
|
-
|
|
458
|
+
at,
|
|
460
459
|
{
|
|
461
460
|
columnHeaderHeight: 48,
|
|
462
461
|
columns: l,
|
|
@@ -471,24 +470,24 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
471
470
|
borderColor: "neutral.light",
|
|
472
471
|
borderRadius: 1,
|
|
473
472
|
"& .MuiDataGrid-columnHeader .MuiIconButton-root": {
|
|
474
|
-
color:
|
|
473
|
+
color: o.palette.primary.main,
|
|
475
474
|
"&:hover": {
|
|
476
|
-
backgroundColor:
|
|
475
|
+
backgroundColor: ot(o.palette.primary.main, 0.1)
|
|
477
476
|
}
|
|
478
477
|
},
|
|
479
478
|
"& .MuiDataGrid-columnHeaderTitle": {
|
|
480
|
-
fontFamily:
|
|
481
|
-
fontSize:
|
|
479
|
+
fontFamily: o.typography.h3.fontFamily,
|
|
480
|
+
fontSize: o.typography.body2.fontSize
|
|
482
481
|
},
|
|
483
482
|
"& .MuiDataGrid-sortIcon": {
|
|
484
|
-
color:
|
|
483
|
+
color: o.palette.primary.main
|
|
485
484
|
}
|
|
486
485
|
}
|
|
487
486
|
}
|
|
488
|
-
) : b.map((
|
|
489
|
-
const { name: g, nickname: d, institution_guid: x, account_number: _ } =
|
|
487
|
+
) : b.map((a) => {
|
|
488
|
+
const { name: g, nickname: d, institution_guid: x, account_number: _ } = a.account, w = d || g;
|
|
490
489
|
return /* @__PURE__ */ e(
|
|
491
|
-
|
|
490
|
+
Q,
|
|
492
491
|
{
|
|
493
492
|
sx: {
|
|
494
493
|
border: "1px solid",
|
|
@@ -496,8 +495,8 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
496
495
|
borderRadius: 1,
|
|
497
496
|
marginBottom: 24
|
|
498
497
|
},
|
|
499
|
-
children: /* @__PURE__ */ e(
|
|
500
|
-
/* @__PURE__ */
|
|
498
|
+
children: /* @__PURE__ */ e(ee, { sx: { minHeight: "auto" }, children: /* @__PURE__ */ n(s, { width: "100%", children: [
|
|
499
|
+
/* @__PURE__ */ n(
|
|
501
500
|
s,
|
|
502
501
|
{
|
|
503
502
|
alignItems: "center",
|
|
@@ -506,9 +505,9 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
506
505
|
px: 16,
|
|
507
506
|
py: 12,
|
|
508
507
|
children: [
|
|
509
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ n(s, { alignItems: "center", flexDirection: "row", gap: 8, width: "50%", children: [
|
|
510
509
|
/* @__PURE__ */ e(
|
|
511
|
-
|
|
510
|
+
xe,
|
|
512
511
|
{
|
|
513
512
|
alt: t.institution_logo,
|
|
514
513
|
institutionGuid: x || "",
|
|
@@ -517,12 +516,12 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
517
516
|
),
|
|
518
517
|
/* @__PURE__ */ e(m, { variant: "body2", children: `${w} ${_ ? `*${_}` : ""}` })
|
|
519
518
|
] }),
|
|
520
|
-
/* @__PURE__ */ e(
|
|
519
|
+
/* @__PURE__ */ e(E, { amount: a.balance, bold: !0, variant: "body2" })
|
|
521
520
|
]
|
|
522
521
|
}
|
|
523
522
|
),
|
|
524
523
|
/* @__PURE__ */ e(v, { sx: { width: "100%" } }),
|
|
525
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ n(
|
|
526
525
|
s,
|
|
527
526
|
{
|
|
528
527
|
alignItems: "center",
|
|
@@ -532,12 +531,12 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
532
531
|
py: 12,
|
|
533
532
|
children: [
|
|
534
533
|
/* @__PURE__ */ e(m, { variant: "body2", children: t.projected_income }),
|
|
535
|
-
/* @__PURE__ */ e(
|
|
534
|
+
/* @__PURE__ */ e(E, { amount: a.income, bold: !0, symbol: "+", variant: "body2" })
|
|
536
535
|
]
|
|
537
536
|
}
|
|
538
537
|
),
|
|
539
538
|
/* @__PURE__ */ e(v, { sx: { width: "100%" } }),
|
|
540
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ n(
|
|
541
540
|
s,
|
|
542
541
|
{
|
|
543
542
|
alignItems: "center",
|
|
@@ -547,7 +546,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
547
546
|
py: 12,
|
|
548
547
|
children: [
|
|
549
548
|
/* @__PURE__ */ e(m, { variant: "body2", children: t.projected_expenses }),
|
|
550
|
-
/* @__PURE__ */ e(
|
|
549
|
+
/* @__PURE__ */ e(E, { amount: a.expenses, bold: !0, symbol: "-", variant: "body2" })
|
|
551
550
|
]
|
|
552
551
|
}
|
|
553
552
|
),
|
|
@@ -563,36 +562,36 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
563
562
|
px: 16,
|
|
564
563
|
py: 12,
|
|
565
564
|
sx: { borderBottomLeftRadius: "4px", borderBottomRightRadius: "4px" },
|
|
566
|
-
children: /* @__PURE__ */ e(
|
|
565
|
+
children: /* @__PURE__ */ e(he, { remaining: a.remaining })
|
|
567
566
|
}
|
|
568
567
|
)
|
|
569
568
|
] }) })
|
|
570
569
|
},
|
|
571
|
-
|
|
570
|
+
a.id
|
|
572
571
|
);
|
|
573
572
|
})
|
|
574
573
|
]
|
|
575
574
|
}
|
|
576
575
|
);
|
|
577
|
-
},
|
|
578
|
-
const { cashflow: i } =
|
|
576
|
+
}, At = A(Tt), Rt = () => {
|
|
577
|
+
const { cashflow: i } = k(), { isDesktop: o } = ue(), { onEvent: t } = Le(), [r, f] = h.useState(0), p = (c, l) => {
|
|
579
578
|
f(l);
|
|
580
579
|
};
|
|
581
580
|
return h.useEffect(() => {
|
|
582
|
-
t(
|
|
583
|
-
}, [
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
|
|
581
|
+
t(r === 0 ? "cash_flow_summary" : "cash_flow_details");
|
|
582
|
+
}, [r]), /* @__PURE__ */ n(I, { children: [
|
|
583
|
+
/* @__PURE__ */ n(
|
|
584
|
+
et,
|
|
586
585
|
{
|
|
587
586
|
"aria-label": i.cashflow_summary_and_details,
|
|
588
587
|
centered: !0,
|
|
589
|
-
onChange:
|
|
588
|
+
onChange: p,
|
|
590
589
|
textColor: "primary",
|
|
591
|
-
value:
|
|
590
|
+
value: r,
|
|
592
591
|
variant: "fullWidth",
|
|
593
592
|
children: [
|
|
594
593
|
/* @__PURE__ */ e(
|
|
595
|
-
|
|
594
|
+
ye,
|
|
596
595
|
{
|
|
597
596
|
"aria-controls": "cashflow-tabpanel-0",
|
|
598
597
|
id: "cashflow-tab-0",
|
|
@@ -603,7 +602,7 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
603
602
|
}
|
|
604
603
|
),
|
|
605
604
|
/* @__PURE__ */ e(
|
|
606
|
-
|
|
605
|
+
ye,
|
|
607
606
|
{
|
|
608
607
|
"aria-controls": "cashflow-tabpanel-1",
|
|
609
608
|
id: "cashflow-tab-1",
|
|
@@ -616,108 +615,108 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
616
615
|
]
|
|
617
616
|
}
|
|
618
617
|
),
|
|
619
|
-
/* @__PURE__ */ e(
|
|
620
|
-
/* @__PURE__ */ e(
|
|
621
|
-
/* @__PURE__ */ e(
|
|
618
|
+
/* @__PURE__ */ e(I, { sx: { mb: 32 } }),
|
|
619
|
+
/* @__PURE__ */ e(_e, { index: 0, name: "cashflow", value: r, children: /* @__PURE__ */ e(I, { sx: { m: o ? 48 : 16 }, children: /* @__PURE__ */ e(At, {}) }) }),
|
|
620
|
+
/* @__PURE__ */ e(_e, { index: 1, name: "cashflow", value: r, children: /* @__PURE__ */ e(I, { sx: { m: o ? 48 : 16 }, children: /* @__PURE__ */ e(vt, {}) }) })
|
|
622
621
|
] });
|
|
623
|
-
},
|
|
622
|
+
}, Et = A(Rt), ne = ({
|
|
624
623
|
amount: i,
|
|
625
|
-
isMobile:
|
|
624
|
+
isMobile: o = !1,
|
|
626
625
|
isTotal: t = !1,
|
|
627
|
-
label:
|
|
626
|
+
label: r,
|
|
628
627
|
symbol: f,
|
|
629
|
-
tooltip:
|
|
630
|
-
}) => /* @__PURE__ */
|
|
628
|
+
tooltip: p
|
|
629
|
+
}) => /* @__PURE__ */ n(
|
|
631
630
|
s,
|
|
632
631
|
{
|
|
633
632
|
bgcolor: t ? "background.default" : "transparent",
|
|
634
|
-
direction:
|
|
635
|
-
justifyContent:
|
|
636
|
-
padding:
|
|
633
|
+
direction: o ? "row" : "column",
|
|
634
|
+
justifyContent: o ? "space-between" : "initial",
|
|
635
|
+
padding: o ? "14px 16px" : 0,
|
|
637
636
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
638
637
|
children: [
|
|
639
|
-
!
|
|
640
|
-
/* @__PURE__ */
|
|
641
|
-
/* @__PURE__ */ e(m, { bold: t, variant: "body2", children:
|
|
642
|
-
|
|
638
|
+
!o && /* @__PURE__ */ e(E, { amount: i, component: "h2", variant: "h2" }),
|
|
639
|
+
/* @__PURE__ */ n(s, { alignItems: "center", component: "span", direction: "row", gap: 8, mt: 2, children: [
|
|
640
|
+
/* @__PURE__ */ e(m, { bold: t, variant: "body2", children: r }),
|
|
641
|
+
p
|
|
643
642
|
] }),
|
|
644
|
-
|
|
643
|
+
o && /* @__PURE__ */ e(E, { amount: i, component: "h2", symbol: f, variant: "body2" })
|
|
645
644
|
]
|
|
646
645
|
}
|
|
647
|
-
), Re = (i,
|
|
648
|
-
const { availableWidth: i } =
|
|
646
|
+
), Re = (i, o) => (t) => t.accountGuid && i.includes(t.accountGuid) && (Fe(t.expectedDate) || Ge(t.expectedDate, o.start)) && Me(t.expectedDate, o.end), kt = () => {
|
|
647
|
+
const { availableWidth: i } = ae(), { cashflow: o } = k(), { income: t, isDataLoaded: r, upcomingExpenses: f, upcomingIncome: p } = j(), { selectedAccountGuids: c } = P(), { dateRange: l, selectedCashAccounts: b } = q(), [a, g] = h.useState(!1), d = h.useMemo(
|
|
649
648
|
() => f.filter(Re(c, l)),
|
|
650
649
|
[l, c, f]
|
|
651
650
|
), x = h.useMemo(
|
|
652
|
-
() =>
|
|
653
|
-
[l, c,
|
|
651
|
+
() => p.filter(Re(c, l)),
|
|
652
|
+
[l, c, p]
|
|
654
653
|
), _ = h.useMemo(
|
|
655
654
|
() => b.reduce((C, S) => C + (S?.balance || 0), 0),
|
|
656
655
|
[b]
|
|
657
|
-
), w = d.reduce((C, S) => C + S.amount, 0),
|
|
658
|
-
return /* @__PURE__ */
|
|
659
|
-
/* @__PURE__ */
|
|
656
|
+
), w = d.reduce((C, S) => C + S.amount, 0), R = x.reduce((C, S) => C + S.amount, 0), D = _ - w + R, L = r && t.length > 0, u = i < 725;
|
|
657
|
+
return /* @__PURE__ */ n(s, { sx: { mx: u ? 16 : 0, my: u ? 24 : 42 }, children: [
|
|
658
|
+
/* @__PURE__ */ n(
|
|
660
659
|
s,
|
|
661
660
|
{
|
|
662
|
-
border:
|
|
661
|
+
border: u ? "1px solid" : "none",
|
|
663
662
|
borderColor: "neutral.light",
|
|
664
663
|
borderRadius: 2,
|
|
665
|
-
flexDirection:
|
|
666
|
-
gap:
|
|
664
|
+
flexDirection: u ? "column" : "row",
|
|
665
|
+
gap: u ? 0 : 24,
|
|
667
666
|
justifyContent: "center",
|
|
668
667
|
children: [
|
|
669
668
|
/* @__PURE__ */ e(
|
|
670
|
-
|
|
669
|
+
ne,
|
|
671
670
|
{
|
|
672
671
|
amount: _,
|
|
673
|
-
isMobile:
|
|
674
|
-
label:
|
|
672
|
+
isMobile: u,
|
|
673
|
+
label: H(o.cash_and_bank, b.length)
|
|
675
674
|
}
|
|
676
675
|
),
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
!
|
|
676
|
+
u && /* @__PURE__ */ e(v, {}),
|
|
677
|
+
L ? /* @__PURE__ */ n($, { children: [
|
|
678
|
+
!u && /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
|
|
680
679
|
/* @__PURE__ */ e(
|
|
681
|
-
|
|
680
|
+
ne,
|
|
682
681
|
{
|
|
683
|
-
amount:
|
|
684
|
-
isMobile:
|
|
685
|
-
label:
|
|
686
|
-
symbol:
|
|
682
|
+
amount: R,
|
|
683
|
+
isMobile: u,
|
|
684
|
+
label: o.to_be_received,
|
|
685
|
+
symbol: u ? "+" : void 0
|
|
687
686
|
}
|
|
688
687
|
)
|
|
689
688
|
] }) : /* @__PURE__ */ e(
|
|
690
|
-
|
|
689
|
+
W,
|
|
691
690
|
{
|
|
692
691
|
onClick: () => g(!0),
|
|
693
|
-
startIcon: /* @__PURE__ */ e(
|
|
692
|
+
startIcon: /* @__PURE__ */ e(z, { name: "add" }),
|
|
694
693
|
sx: { fontSize: 13 },
|
|
695
|
-
children:
|
|
694
|
+
children: o.add_income
|
|
696
695
|
}
|
|
697
696
|
),
|
|
698
|
-
|
|
697
|
+
u ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
|
|
699
698
|
/* @__PURE__ */ e(
|
|
700
|
-
|
|
699
|
+
ne,
|
|
701
700
|
{
|
|
702
701
|
amount: w,
|
|
703
|
-
isMobile:
|
|
704
|
-
label:
|
|
705
|
-
symbol:
|
|
702
|
+
isMobile: u,
|
|
703
|
+
label: H(o.to_be_paid_out, d.length),
|
|
704
|
+
symbol: u ? "-" : void 0
|
|
706
705
|
}
|
|
707
706
|
),
|
|
708
|
-
|
|
707
|
+
u ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
|
|
709
708
|
/* @__PURE__ */ e(
|
|
710
|
-
|
|
709
|
+
ne,
|
|
711
710
|
{
|
|
712
|
-
amount:
|
|
713
|
-
isMobile:
|
|
714
|
-
isTotal:
|
|
715
|
-
label:
|
|
711
|
+
amount: D,
|
|
712
|
+
isMobile: u,
|
|
713
|
+
isTotal: u,
|
|
714
|
+
label: o.remaining_cash,
|
|
716
715
|
tooltip: /* @__PURE__ */ e(
|
|
717
716
|
pe,
|
|
718
717
|
{
|
|
719
|
-
body:
|
|
720
|
-
title:
|
|
718
|
+
body: o.remaining_income_tooltip_body,
|
|
719
|
+
title: o.remaining_income_tooltip_title
|
|
721
720
|
}
|
|
722
721
|
)
|
|
723
722
|
}
|
|
@@ -726,53 +725,53 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
726
725
|
}
|
|
727
726
|
),
|
|
728
727
|
/* @__PURE__ */ e(
|
|
729
|
-
|
|
728
|
+
He,
|
|
730
729
|
{
|
|
731
|
-
ariaLabelClose:
|
|
732
|
-
isOpen:
|
|
730
|
+
ariaLabelClose: o.close_manage_income_aria,
|
|
731
|
+
isOpen: a,
|
|
733
732
|
onClose: () => g(!1),
|
|
734
733
|
shouldShowHeaderBorders: !1,
|
|
735
|
-
title:
|
|
736
|
-
children: /* @__PURE__ */ e(
|
|
734
|
+
title: o.manage_income,
|
|
735
|
+
children: /* @__PURE__ */ e(rt, {})
|
|
737
736
|
}
|
|
738
737
|
)
|
|
739
738
|
] });
|
|
740
|
-
},
|
|
741
|
-
const { selectedAccounts:
|
|
739
|
+
}, Lt = A(kt), Nt = ({ onBackClick: i, onMenuClick: o, sx: t = {} }) => {
|
|
740
|
+
const { selectedAccounts: r, selectedAccountGuids: f, shouldDisableNextDate: p, shouldDisablePrevDate: c } = P(), { onEvent: l } = Le(), { clientConfig: b } = Ve(), { visibleCashAccounts: a } = ke(), { setFilter: g } = Ne(), { dateRange: d, setSelectedCashAccounts: x } = q(), { loadRepeatingTransactionData: _, isDataLoaded: w, setDateRange: R } = j(), { cashflow: D, recurring: L } = k(), { isInitialized: u } = P(), S = b?.master?.deep_link_params?.view === "manage_income", [re, K] = h.useState(S);
|
|
742
741
|
return h.useEffect(() => {
|
|
743
|
-
|
|
742
|
+
R(d), w || _().finally();
|
|
744
743
|
}, []), h.useEffect(() => {
|
|
745
|
-
const
|
|
746
|
-
(
|
|
744
|
+
const se = a.map((G) => G.guid), B = r.filter(
|
|
745
|
+
(G) => f.includes(G.guid) && se.includes(G.guid)
|
|
747
746
|
);
|
|
748
|
-
x(
|
|
749
|
-
dateRange: { start:
|
|
750
|
-
accounts:
|
|
747
|
+
x(B), g({
|
|
748
|
+
dateRange: { start: We(F(), 90), end: dt() },
|
|
749
|
+
accounts: B.map((G) => G.guid)
|
|
751
750
|
});
|
|
752
|
-
}, [
|
|
751
|
+
}, [a, r]), Oe({
|
|
753
752
|
widgetName: "CashflowWidget",
|
|
754
753
|
isLoaded: w
|
|
755
|
-
}),
|
|
756
|
-
|
|
754
|
+
}), u ? /* @__PURE__ */ n(
|
|
755
|
+
mt,
|
|
757
756
|
{
|
|
758
757
|
actions: [
|
|
759
758
|
{
|
|
760
|
-
label:
|
|
759
|
+
label: L.action_title,
|
|
761
760
|
iconName: "credit_card_gear",
|
|
762
761
|
onClick: () => {
|
|
763
|
-
K(!0), l(
|
|
762
|
+
K(!0), l(Se.CASH_FLOW_CLICK_SETTINGS);
|
|
764
763
|
}
|
|
765
764
|
}
|
|
766
765
|
],
|
|
767
766
|
allowedAccountTypes: [
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
767
|
+
X.CASH,
|
|
768
|
+
X.CHECKING,
|
|
769
|
+
X.PREPAID,
|
|
770
|
+
X.SAVINGS,
|
|
771
|
+
X.CHECKING_LINE_OF_CREDIT
|
|
773
772
|
],
|
|
774
773
|
calendarActions: {
|
|
775
|
-
shouldDisableNext:
|
|
774
|
+
shouldDisableNext: p,
|
|
776
775
|
shouldDisablePrevious: c,
|
|
777
776
|
shouldDisablePicker: !0,
|
|
778
777
|
onRangeChanged: () => {
|
|
@@ -781,280 +780,280 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
781
780
|
dateRange: d,
|
|
782
781
|
dateRangeVariant: "readonly",
|
|
783
782
|
hasDivider: !0,
|
|
784
|
-
onAccountsFilterClick: () => l(
|
|
783
|
+
onAccountsFilterClick: () => l(Se.CASH_FLOW_CLICK_FILTER),
|
|
785
784
|
onBackClick: i,
|
|
786
|
-
onMenuClick:
|
|
785
|
+
onMenuClick: o,
|
|
787
786
|
sx: t,
|
|
788
|
-
title:
|
|
787
|
+
title: D.title,
|
|
789
788
|
children: [
|
|
790
|
-
/* @__PURE__ */ e(
|
|
791
|
-
/* @__PURE__ */ e(
|
|
789
|
+
/* @__PURE__ */ e(Lt, {}),
|
|
790
|
+
/* @__PURE__ */ e(Et, {}),
|
|
792
791
|
/* @__PURE__ */ e(
|
|
793
|
-
|
|
792
|
+
He,
|
|
794
793
|
{
|
|
795
|
-
ariaLabelClose:
|
|
796
|
-
isOpen:
|
|
794
|
+
ariaLabelClose: D.close_settings_aria,
|
|
795
|
+
isOpen: re,
|
|
797
796
|
onClose: () => K(!1),
|
|
798
797
|
shouldShowHeaderBorders: !1,
|
|
799
|
-
title:
|
|
800
|
-
children: /* @__PURE__ */ e(
|
|
798
|
+
title: L.action_title,
|
|
799
|
+
children: /* @__PURE__ */ e(Ze, { defaultSelectedTab: S ? 1 : 0 })
|
|
801
800
|
}
|
|
802
801
|
)
|
|
803
802
|
]
|
|
804
803
|
}
|
|
805
|
-
) : /* @__PURE__ */ e(
|
|
806
|
-
},
|
|
807
|
-
const { completeOnboarding:
|
|
808
|
-
return /* @__PURE__ */
|
|
809
|
-
/* @__PURE__ */ e(
|
|
804
|
+
) : /* @__PURE__ */ e(Z, {});
|
|
805
|
+
}, Wn = A(Nt), Ot = ({ handleNextStep: i }) => {
|
|
806
|
+
const { completeOnboarding: o } = me(), { cashflow: t } = k(), r = ie();
|
|
807
|
+
return /* @__PURE__ */ n(s, { children: [
|
|
808
|
+
/* @__PURE__ */ e(de, { pb: 12, variant: "h1", children: t.welcome_title }),
|
|
810
809
|
/* @__PURE__ */ e(
|
|
811
|
-
|
|
810
|
+
qe,
|
|
812
811
|
{
|
|
813
|
-
color:
|
|
812
|
+
color: r.palette.primary.light,
|
|
814
813
|
pb: 8,
|
|
815
814
|
sx: { wordBreak: "break-word", whiteSpace: "initial" },
|
|
816
815
|
children: t.welcome_sub_title
|
|
817
816
|
}
|
|
818
817
|
),
|
|
819
|
-
/* @__PURE__ */ e(
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ e(N, { pb: 32, children: t.welcome_description }),
|
|
819
|
+
/* @__PURE__ */ n(s, { direction: "column", mb: 32, spacing: 32, children: [
|
|
820
|
+
/* @__PURE__ */ n(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
822
821
|
/* @__PURE__ */ e(
|
|
823
|
-
|
|
822
|
+
I,
|
|
824
823
|
{
|
|
825
|
-
bgcolor:
|
|
824
|
+
bgcolor: r.palette.primary.lighter,
|
|
826
825
|
borderRadius: 1,
|
|
827
826
|
component: "span",
|
|
828
827
|
height: 44,
|
|
829
828
|
mr: 24,
|
|
830
829
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
831
830
|
width: 44,
|
|
832
|
-
children: /* @__PURE__ */ e(
|
|
831
|
+
children: /* @__PURE__ */ e(z, { color: "primary", name: "currency_exchange" })
|
|
833
832
|
}
|
|
834
833
|
),
|
|
835
834
|
t.bullet_one
|
|
836
835
|
] }),
|
|
837
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ n(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
838
837
|
/* @__PURE__ */ e(
|
|
839
|
-
|
|
838
|
+
I,
|
|
840
839
|
{
|
|
841
|
-
bgcolor:
|
|
840
|
+
bgcolor: r.palette.primary.lighter,
|
|
842
841
|
borderRadius: 1,
|
|
843
842
|
component: "span",
|
|
844
843
|
height: 44,
|
|
845
844
|
mr: 24,
|
|
846
845
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
847
846
|
width: 44,
|
|
848
|
-
children: /* @__PURE__ */ e(
|
|
847
|
+
children: /* @__PURE__ */ e(z, { color: "primary", name: "cardiology" })
|
|
849
848
|
}
|
|
850
849
|
),
|
|
851
850
|
t.bullet_two
|
|
852
851
|
] }),
|
|
853
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ n(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
854
853
|
/* @__PURE__ */ e(
|
|
855
|
-
|
|
854
|
+
I,
|
|
856
855
|
{
|
|
857
|
-
bgcolor:
|
|
856
|
+
bgcolor: r.palette.primary.lighter,
|
|
858
857
|
borderRadius: 1,
|
|
859
858
|
component: "span",
|
|
860
859
|
height: 44,
|
|
861
860
|
mr: 24,
|
|
862
861
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
863
862
|
width: 44,
|
|
864
|
-
children: /* @__PURE__ */ e(
|
|
863
|
+
children: /* @__PURE__ */ e(z, { color: "primary", name: "flare" })
|
|
865
864
|
}
|
|
866
865
|
),
|
|
867
866
|
t.bullet_three
|
|
868
867
|
] })
|
|
869
868
|
] }),
|
|
870
|
-
/* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */ e(
|
|
872
|
-
/* @__PURE__ */ e(
|
|
869
|
+
/* @__PURE__ */ n(s, { direction: "row", spacing: 16, children: [
|
|
870
|
+
/* @__PURE__ */ e(W, { onClick: i, variant: "contained", children: t.get_started_button }),
|
|
871
|
+
/* @__PURE__ */ e(W, { onClick: o, variant: "outlined", children: t.skip_button })
|
|
873
872
|
] })
|
|
874
873
|
] });
|
|
875
|
-
},
|
|
876
|
-
CASHFLOW_ONBOARDING: `${
|
|
877
|
-
CASHFLOW_LOADING_ANIMATION: `${
|
|
878
|
-
},
|
|
879
|
-
const { cashflow: i } =
|
|
880
|
-
return /* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src:
|
|
882
|
-
/* @__PURE__ */ e(
|
|
883
|
-
/* @__PURE__ */ e(
|
|
874
|
+
}, Gt = A(Ot), Ee = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", ze = {
|
|
875
|
+
CASHFLOW_ONBOARDING: `${Ee}/cashflow-onboarding.png`,
|
|
876
|
+
CASHFLOW_LOADING_ANIMATION: `${Ee}/loading-animation.gif`
|
|
877
|
+
}, Mt = () => {
|
|
878
|
+
const { cashflow: i } = k();
|
|
879
|
+
return /* @__PURE__ */ n(h.Fragment, { children: [
|
|
880
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: ze.CASHFLOW_LOADING_ANIMATION }) }),
|
|
881
|
+
/* @__PURE__ */ e(de, { pb: 12, variant: "h1", children: i.loading_title }),
|
|
882
|
+
/* @__PURE__ */ e(N, { children: i.loading_description })
|
|
884
883
|
] });
|
|
885
|
-
},
|
|
884
|
+
}, Ft = A(Mt), Ht = it`
|
|
886
885
|
from {
|
|
887
886
|
transform: rotate(0deg);
|
|
888
887
|
}
|
|
889
888
|
to {
|
|
890
889
|
transform: rotate(360deg);
|
|
891
890
|
}
|
|
892
|
-
`,
|
|
893
|
-
const { addRepeatingTransaction: i, repeatingTransactions:
|
|
894
|
-
() => x.find((y) => y.guid ===
|
|
895
|
-
[
|
|
896
|
-
),
|
|
897
|
-
(y) => y.repeating_transaction_type ===
|
|
898
|
-
).length,
|
|
899
|
-
|
|
891
|
+
`, Wt = () => {
|
|
892
|
+
const { addRepeatingTransaction: i, repeatingTransactions: o } = j(), { cashflow: t, common: r } = k(), { user: f } = Xe(), { completeOnboarding: p } = me(), { isDirty: c } = q(), { isMobile: l } = ue(), { isCopyLoaded: b, setDisplayedDate: a } = P(), { filter: g, setFilter: d, transactions: x } = Ne(), _ = ie(), [w, R] = V(!0), [D, L] = h.useState(bt.EveryMonth), [u, C] = h.useState(1), [S, re] = h.useState(15), [K, se] = V(!1), [B, G] = V(1), [O, $e] = V([]), [fe, ce] = V(""), M = h.useMemo(
|
|
893
|
+
() => x.find((y) => y.guid === fe),
|
|
894
|
+
[fe, x]
|
|
895
|
+
), je = !!o.filter(
|
|
896
|
+
(y) => y.repeating_transaction_type === ve.Income
|
|
897
|
+
).length, ge = async () => {
|
|
898
|
+
G(2), a(
|
|
900
899
|
// Beginning of the month, 90 days before today
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
), d({ ...g, custom:
|
|
904
|
-
},
|
|
900
|
+
ut(We(F(), 90)),
|
|
901
|
+
F()
|
|
902
|
+
), d({ ...g, custom: we }), G(3);
|
|
903
|
+
}, Be = async () => {
|
|
905
904
|
if (!(O.length < 1)) {
|
|
906
|
-
|
|
905
|
+
se(!0);
|
|
907
906
|
for (let y = 0; y < O.length; y++) {
|
|
908
|
-
const
|
|
909
|
-
account_guid:
|
|
910
|
-
amount:
|
|
907
|
+
const T = O[y], be = Ie(D, De(T.date)), Ue = {
|
|
908
|
+
account_guid: T.account_guid,
|
|
909
|
+
amount: T.amount,
|
|
911
910
|
created_by: 0,
|
|
912
911
|
//user
|
|
913
|
-
merchant_guid:
|
|
914
|
-
description:
|
|
915
|
-
predicted_occurs_on: pt(
|
|
916
|
-
recurrence_day:
|
|
917
|
-
recurrence_type:
|
|
918
|
-
repeating_transaction_type:
|
|
912
|
+
merchant_guid: T.merchant_guid,
|
|
913
|
+
description: T.feed_description || T.description,
|
|
914
|
+
predicted_occurs_on: pt(be, { representation: "date" }),
|
|
915
|
+
recurrence_day: be.getDay(),
|
|
916
|
+
recurrence_type: D,
|
|
917
|
+
repeating_transaction_type: ve.Income,
|
|
919
918
|
second_recurrence_day: S,
|
|
920
|
-
transaction_type:
|
|
919
|
+
transaction_type: T.transaction_type,
|
|
921
920
|
user_guid: f.guid
|
|
922
921
|
};
|
|
923
|
-
await i(
|
|
922
|
+
await i(Ue, T);
|
|
924
923
|
}
|
|
925
|
-
await
|
|
924
|
+
await p();
|
|
926
925
|
}
|
|
927
|
-
}, Pe = !
|
|
928
|
-
return b ? /* @__PURE__ */
|
|
929
|
-
|
|
926
|
+
}, Pe = !M && w || !M && O.length < 1;
|
|
927
|
+
return b ? /* @__PURE__ */ n(
|
|
928
|
+
I,
|
|
930
929
|
{
|
|
931
930
|
sx: {
|
|
932
931
|
display: "flex",
|
|
933
932
|
alignItems: l ? "flex-start" : "center",
|
|
934
933
|
backgroundColor: _.palette.background.paper,
|
|
935
|
-
backgroundImage: l ? null : `url(${
|
|
934
|
+
backgroundImage: l ? null : `url(${ze.CASHFLOW_ONBOARDING})`,
|
|
936
935
|
backgroundRepeat: "no-repeat",
|
|
937
936
|
backgroundPosition: "left 100px",
|
|
938
937
|
backgroundSize: "35%",
|
|
939
938
|
py: 24
|
|
940
939
|
},
|
|
941
940
|
children: [
|
|
942
|
-
|
|
943
|
-
|
|
941
|
+
B === 1 && /* @__PURE__ */ e(
|
|
942
|
+
I,
|
|
944
943
|
{
|
|
945
944
|
sx: {
|
|
946
945
|
...l ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
947
946
|
},
|
|
948
|
-
children: /* @__PURE__ */ e(
|
|
947
|
+
children: /* @__PURE__ */ e(Gt, { handleNextStep: ge })
|
|
949
948
|
}
|
|
950
949
|
),
|
|
951
|
-
|
|
952
|
-
|
|
950
|
+
B === 2 && /* @__PURE__ */ e(
|
|
951
|
+
I,
|
|
953
952
|
{
|
|
954
953
|
sx: {
|
|
955
954
|
...l ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
956
955
|
},
|
|
957
|
-
children: /* @__PURE__ */ e(
|
|
956
|
+
children: /* @__PURE__ */ e(Ft, {})
|
|
958
957
|
}
|
|
959
958
|
),
|
|
960
|
-
|
|
961
|
-
|
|
959
|
+
B === 3 && /* @__PURE__ */ n(
|
|
960
|
+
I,
|
|
962
961
|
{
|
|
963
962
|
sx: {
|
|
964
963
|
...l ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
965
964
|
},
|
|
966
965
|
children: [
|
|
967
|
-
/* @__PURE__ */ e(
|
|
968
|
-
/* @__PURE__ */ e(
|
|
969
|
-
O.length > 0 && !
|
|
970
|
-
/* @__PURE__ */ e(
|
|
971
|
-
/* @__PURE__ */ e(
|
|
972
|
-
|
|
966
|
+
/* @__PURE__ */ e(de, { pb: 12, variant: "h1", children: t.add_income_title }),
|
|
967
|
+
/* @__PURE__ */ e(N, { mb: 24, children: t.add_income_description }),
|
|
968
|
+
O.length > 0 && !M && /* @__PURE__ */ n($, { children: [
|
|
969
|
+
/* @__PURE__ */ e(Q, { children: O.map((y, T) => /* @__PURE__ */ n(h.Fragment, { children: [
|
|
970
|
+
/* @__PURE__ */ e(ht, { bgcolor: "background.paper", children: gt(
|
|
971
|
+
le(y.nextDate || y.date)
|
|
973
972
|
) }),
|
|
974
|
-
/* @__PURE__ */ e(
|
|
975
|
-
|
|
973
|
+
/* @__PURE__ */ e(ft, { transaction: y }),
|
|
974
|
+
T !== O.length - 1 && /* @__PURE__ */ e(v, {})
|
|
976
975
|
] }, y.guid)) }),
|
|
977
|
-
/* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ n(s, { alignItems: "center", direction: "row", children: [
|
|
978
977
|
/* @__PURE__ */ e(v, { sx: { flexGrow: 1 } }),
|
|
979
978
|
/* @__PURE__ */ e(
|
|
980
|
-
|
|
979
|
+
W,
|
|
981
980
|
{
|
|
982
|
-
onClick: () =>
|
|
983
|
-
startIcon: /* @__PURE__ */ e(
|
|
981
|
+
onClick: () => R(!0),
|
|
982
|
+
startIcon: /* @__PURE__ */ e(z, { name: "add", size: 20 }),
|
|
984
983
|
children: t.add_income
|
|
985
984
|
}
|
|
986
985
|
)
|
|
987
986
|
] })
|
|
988
987
|
] }),
|
|
989
988
|
Pe && /* @__PURE__ */ e(
|
|
990
|
-
|
|
989
|
+
st,
|
|
991
990
|
{
|
|
992
991
|
bgcolor: "background.paper",
|
|
993
992
|
onSearch: (y) => d({
|
|
994
993
|
...g,
|
|
995
|
-
custom: (
|
|
994
|
+
custom: (T) => y ? ct(T, y) : we(T)
|
|
996
995
|
}),
|
|
997
996
|
onSelected: (y) => {
|
|
998
|
-
|
|
997
|
+
ce(y), R(!1);
|
|
999
998
|
}
|
|
1000
999
|
}
|
|
1001
1000
|
),
|
|
1002
|
-
!
|
|
1003
|
-
|
|
1001
|
+
!je && c && /* @__PURE__ */ e(N, { color: "error", mt: 16, children: t.confirm_error }),
|
|
1002
|
+
M && /* @__PURE__ */ n($, { children: [
|
|
1004
1003
|
/* @__PURE__ */ e(
|
|
1005
|
-
|
|
1004
|
+
lt,
|
|
1006
1005
|
{
|
|
1007
1006
|
bgcolor: "background.paper",
|
|
1008
|
-
firstDay:
|
|
1009
|
-
frequency:
|
|
1007
|
+
firstDay: u,
|
|
1008
|
+
frequency: D,
|
|
1010
1009
|
onFirstDayChange: C,
|
|
1011
|
-
onFrequencyChange:
|
|
1012
|
-
onSecondDayChange:
|
|
1010
|
+
onFrequencyChange: L,
|
|
1011
|
+
onSecondDayChange: re,
|
|
1013
1012
|
secondDay: S,
|
|
1014
|
-
transaction:
|
|
1013
|
+
transaction: M
|
|
1015
1014
|
}
|
|
1016
1015
|
),
|
|
1017
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ n(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
1018
1017
|
/* @__PURE__ */ e(
|
|
1019
|
-
|
|
1018
|
+
W,
|
|
1020
1019
|
{
|
|
1021
|
-
"aria-disabled": !
|
|
1020
|
+
"aria-disabled": !M,
|
|
1022
1021
|
onClick: () => {
|
|
1023
1022
|
const y = [...O];
|
|
1024
1023
|
y.push({
|
|
1025
|
-
...
|
|
1026
|
-
nextDate:
|
|
1027
|
-
frequency:
|
|
1028
|
-
}),
|
|
1024
|
+
...M,
|
|
1025
|
+
nextDate: Ie(D, De(M.date)),
|
|
1026
|
+
frequency: D
|
|
1027
|
+
}), $e(y), ce("");
|
|
1029
1028
|
},
|
|
1030
1029
|
variant: "contained",
|
|
1031
|
-
children:
|
|
1030
|
+
children: r.confirm_button
|
|
1032
1031
|
}
|
|
1033
1032
|
),
|
|
1034
1033
|
/* @__PURE__ */ e(
|
|
1035
|
-
|
|
1034
|
+
W,
|
|
1036
1035
|
{
|
|
1037
1036
|
onClick: () => {
|
|
1038
|
-
|
|
1037
|
+
ce(""), R(!0), ge().finally();
|
|
1039
1038
|
},
|
|
1040
1039
|
variant: "outlined",
|
|
1041
|
-
children:
|
|
1040
|
+
children: r.cancel_button
|
|
1042
1041
|
}
|
|
1043
1042
|
)
|
|
1044
1043
|
] })
|
|
1045
1044
|
] }),
|
|
1046
|
-
O.length > 0 && !
|
|
1045
|
+
O.length > 0 && !M && /* @__PURE__ */ n(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
1047
1046
|
/* @__PURE__ */ e(
|
|
1048
|
-
|
|
1047
|
+
W,
|
|
1049
1048
|
{
|
|
1050
1049
|
"aria-disabled": O.length < 1 || K,
|
|
1051
|
-
onClick:
|
|
1050
|
+
onClick: Be,
|
|
1052
1051
|
startIcon: K ? /* @__PURE__ */ e(
|
|
1053
|
-
|
|
1052
|
+
z,
|
|
1054
1053
|
{
|
|
1055
1054
|
name: "progress_activity",
|
|
1056
1055
|
sx: {
|
|
1057
|
-
animation: `${
|
|
1056
|
+
animation: `${Ht} 2s linear infinite`
|
|
1058
1057
|
}
|
|
1059
1058
|
}
|
|
1060
1059
|
) : null,
|
|
@@ -1062,38 +1061,18 @@ const Dt = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
1062
1061
|
children: t.confirm_income_button
|
|
1063
1062
|
}
|
|
1064
1063
|
),
|
|
1065
|
-
/* @__PURE__ */ e(
|
|
1064
|
+
/* @__PURE__ */ e(W, { onClick: p, variant: "outlined", children: t.skip_button })
|
|
1066
1065
|
] })
|
|
1067
1066
|
]
|
|
1068
1067
|
}
|
|
1069
1068
|
)
|
|
1070
1069
|
]
|
|
1071
1070
|
}
|
|
1072
|
-
) : /* @__PURE__ */ e(
|
|
1073
|
-
},
|
|
1074
|
-
class Un {
|
|
1075
|
-
fetchInstance;
|
|
1076
|
-
constructor(n, t, a) {
|
|
1077
|
-
this.fetchInstance = new yt(n, t, void 0, a);
|
|
1078
|
-
}
|
|
1079
|
-
addCashflowEvent = async (n) => this.fetchInstance.post(j.CASHFLOW_EVENTS, { ...n }).then((t) => t);
|
|
1080
|
-
addCashflowSequence = async (n) => this.fetchInstance.post(j.CASHFLOW_SEQUENCES, { ...n }).then((t) => t.cashflow_sequence);
|
|
1081
|
-
getCashflowSequences = async () => this.fetchInstance.get(j.CASHFLOW_SEQUENCES).then((n) => n.cashflow_sequences);
|
|
1082
|
-
getCashflowEventsByDateRange = async (n, t) => this.fetchInstance.get(
|
|
1083
|
-
`${j.CASHFLOW_EVENTS}/from/${z(n)}/to/${z(t)}`
|
|
1084
|
-
).then((a) => a.cashflow_events);
|
|
1085
|
-
deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${j.CASHFLOW_SEQUENCES}/${n}`).then((t) => t);
|
|
1086
|
-
getProjectedCashflowEvents = async (n, t) => this.fetchInstance.get(
|
|
1087
|
-
`${j.CASHFLOW_SEQUENCES}/projected_events/from/${z(
|
|
1088
|
-
n
|
|
1089
|
-
)}/to/${z(t)}`
|
|
1090
|
-
).then((a) => a.cashflow_events);
|
|
1091
|
-
updateCashflowSequence = async (n) => this.fetchInstance.put(`${j.CASHFLOW_SEQUENCES}/${n.guid}`, n).then((t) => t.cashflow_sequence);
|
|
1092
|
-
}
|
|
1071
|
+
) : /* @__PURE__ */ e(Z, {});
|
|
1072
|
+
}, zn = A(Wt);
|
|
1093
1073
|
export {
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
Bn as
|
|
1097
|
-
|
|
1098
|
-
zn as CashflowWidget
|
|
1074
|
+
Hn as CashflowMiniWidget,
|
|
1075
|
+
zn as CashflowOnboarding,
|
|
1076
|
+
Bn as CashflowStore,
|
|
1077
|
+
Wn as CashflowWidget
|
|
1099
1078
|
};
|