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