@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.
Files changed (154) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/{Account-B4CDD-zq.mjs → Account-CvR2-dSR.mjs} +1 -1
  3. package/dist/AccountDetailsContent-CitErkuS.mjs +686 -0
  4. package/dist/{AccountDetailsHeader-DRjFuyJT.mjs → AccountDetailsHeader-BkG3MNYo.mjs} +19 -19
  5. package/dist/{AccountFields-Cl4KHoSj.mjs → AccountFields-zCMqet85.mjs} +10 -12
  6. package/dist/AccountListItem-DHrz8Mml.mjs +90 -0
  7. package/dist/{AccountStore-HbVblv86.mjs → AccountStore-LgfBcYMe.mjs} +101 -75
  8. package/dist/Accounts-Bzy1_REQ.mjs +9 -0
  9. package/dist/{BudgetUtil-Jv8h9H9l.mjs → BudgetUtil-BmZXkL0C.mjs} +32 -32
  10. package/dist/{CashflowStore-CA190BPF.mjs → CashflowStore-D9Dpuz7X.mjs} +25 -18
  11. package/dist/{Category-Ccoew_sA.mjs → Category-CevNQ03n.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-Dl006GKy.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +27 -27
  13. package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
  14. package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
  15. package/dist/{ConnectDrawer-DVp54lUH.mjs → ConnectDrawer-BkvlItWx.mjs} +55 -56
  16. package/dist/{ConnectionsDrawer-Dsc04-4Z.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
  17. package/dist/CurrencyInput-itK0R3wV.mjs +85 -0
  18. package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CBdcsyuk.mjs} +1 -1
  19. package/dist/{DebtsStore-pL63fmdT.mjs → DebtsStore-Bq-aPy-5.mjs} +3 -3
  20. package/dist/{Dialog-CDV0kKxj.mjs → Dialog-BPTr3qHE.mjs} +24 -24
  21. package/dist/Drawer-By9V-B5L.mjs +178 -0
  22. package/dist/{ExportCsvAction-QhQK4_FU.mjs → ExportCsvAction-Cglo8Mca.mjs} +4 -4
  23. package/dist/{FinstrongStore-BGf36b0z.mjs → FinstrongStore-BIrX0Xg2.mjs} +56 -56
  24. package/dist/{GoalStore-C1-w3Y1E.mjs → GoalStore-1P19goZ7.mjs} +111 -151
  25. package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
  26. package/dist/{Help-c-zHlDbv.mjs → Help-DhcC-C05.mjs} +8 -8
  27. package/dist/{Help-DBfsTkAi.mjs → Help-Ea3BlXQp.mjs} +146 -125
  28. package/dist/{IconBacking-DgT8DCeh.mjs → IconBacking-B9oC6uL2.mjs} +11 -11
  29. package/dist/LineChart-BF4QA-Lx.mjs +580 -0
  30. package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-BxTkF6Tz.mjs} +2 -2
  31. package/dist/Loader-DUaFpDGv.mjs +24 -0
  32. package/dist/{ManageIncome-8EsStyIQ.mjs → ManageIncome-CaoQl609.mjs} +142 -142
  33. package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
  34. package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
  35. package/dist/{NetWorthStore-Bti6u-d9.mjs → NetWorthStore-rC0q7P7t.mjs} +4 -4
  36. package/dist/NotificationSettings-uzM8tCoH.mjs +674 -0
  37. package/dist/{NotificationStore-Ck2KdNmT.mjs → NotificationStore-CDX_kqHa.mjs} +14 -22
  38. package/dist/{OriginalBalanceAction-2Y_3U_mg.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +9 -9
  39. package/dist/{RecurringSettings-DAncu--R.mjs → RecurringSettings-B4ybrS0B.mjs} +17 -17
  40. package/dist/{RecurringTransactions-CxcSL1dY.mjs → RecurringTransactions-BqijW_8S.mjs} +79 -79
  41. package/dist/{RecurringTransactionsStore-CNFxyGB6.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +81 -91
  42. package/dist/{ResponsiveButton-Cn6-R7ue.mjs → ResponsiveButton-DZFp78fJ.mjs} +10 -10
  43. package/dist/SearchBox-B2_zLv8-.mjs +42 -0
  44. package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-krIRNwHK.mjs} +1 -1
  45. package/dist/{SingleSegmentDonut-7Uy6VEld.mjs → SingleSegmentDonut-BgbLgwHi.mjs} +6 -6
  46. package/dist/SpendingData-DQ1b9uqq.mjs +53 -0
  47. package/dist/{SpendingLegend-6FqtMcBV.mjs → SpendingLegend-CDO060GT.mjs} +65 -65
  48. package/dist/{StatusBar-CPfSXe80.mjs → StatusBar-BK_uYHAB.mjs} +6 -6
  49. package/dist/{TabContentContainer-CnMXkVqr.mjs → TabContentContainer-j01JYR_7.mjs} +8 -8
  50. package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
  51. package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
  52. package/dist/TrendsStore-yO7qYv97.mjs +186 -0
  53. package/dist/{User-BklmOUSd.mjs → User-Cnlegl1N.mjs} +107 -107
  54. package/dist/{ViewMoreMicroCard-DAkyNRlD.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +211 -205
  55. package/dist/{WidgetContainer-CDh9fjpR.mjs → WidgetContainer-CoFDmQRE.mjs} +36 -36
  56. package/dist/accounts/index.es.js +200 -197
  57. package/dist/accounts/stores/AccountStore.d.ts +22 -25
  58. package/dist/accounts/utils/Accounts.d.ts +1 -2
  59. package/dist/analytics/index.es.js +27 -27
  60. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  61. package/dist/budgets/index.es.js +703 -669
  62. package/dist/budgets/store/BudgetsStore.d.ts +0 -1
  63. package/dist/cashflow/index.es.js +420 -404
  64. package/dist/categories/index.es.js +2 -2
  65. package/dist/categories/stores/CategoryStore.d.ts +3 -6
  66. package/dist/categories/util/CategoryUtil.d.ts +2 -3
  67. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  68. package/dist/common/components/Loader.d.ts +2 -1
  69. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
  70. package/dist/common/components/barchart/Bar.d.ts +25 -0
  71. package/dist/common/components/barchart/BarChart.d.ts +34 -0
  72. package/dist/common/components/barchart/BarColumn.d.ts +37 -0
  73. package/dist/common/components/barchart/Legend.d.ts +8 -0
  74. package/dist/common/components/barchart/Util.d.ts +42 -0
  75. package/dist/common/components/barchart/index.d.ts +1 -0
  76. package/dist/common/components/charts/linechart/CustomMark.d.ts +1 -1
  77. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  78. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  79. package/dist/common/components/index.d.ts +1 -0
  80. package/dist/common/hooks/index.d.ts +2 -0
  81. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  82. package/dist/common/hooks/usePrevious.d.ts +2 -0
  83. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  84. package/dist/common/index.es.js +712 -436
  85. package/dist/common/stores/AppDataStore.d.ts +1 -3
  86. package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
  87. package/dist/common/stores/GlobalStore.d.ts +3 -3
  88. package/dist/common/stores/GlobalUiStore.d.ts +2 -3
  89. package/dist/common/stores/UserStore.d.ts +2 -3
  90. package/dist/common/types/Account.d.ts +6 -9
  91. package/dist/common/types/localization/TransactionsCopy.d.ts +1 -0
  92. package/dist/common/utils/Theme.d.ts +3 -1
  93. package/dist/dashboard/index.es.js +93 -91
  94. package/dist/debts/components/DebtsChart.d.ts +2 -1
  95. package/dist/debts/index.es.js +529 -527
  96. package/dist/{exportTransactionsToCSV-BgV_wTLT.mjs → exportTransactionsToCSV-DuAaI5XA.mjs} +3 -3
  97. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
  98. package/dist/finstrong/index.es.js +876 -867
  99. package/dist/goals/index.es.js +526 -525
  100. package/dist/goals/stores/GoalStore.d.ts +4 -17
  101. package/dist/help/components/content/BottomImageContent.d.ts +1 -1
  102. package/dist/help/components/content/LeftImageContent.d.ts +1 -1
  103. package/dist/help/components/content/RightImageContent.d.ts +1 -1
  104. package/dist/help/components/content/TopImageContent.d.ts +1 -1
  105. package/dist/help/index.es.js +13 -9
  106. package/dist/{hooks-C41HAxM5.mjs → hooks-ZMp65DFz.mjs} +11 -11
  107. package/dist/investments/index.es.js +534 -531
  108. package/dist/investments/stores/HoldingStore.d.ts +0 -1
  109. package/dist/merchants/index.es.js +8 -8
  110. package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
  111. package/dist/microinsights/index.d.ts +1 -0
  112. package/dist/microinsights/index.es.js +101 -14
  113. package/dist/networth/components/NetWorthChange.d.ts +1 -3
  114. package/dist/networth/index.es.js +284 -285
  115. package/dist/notifications/index.es.js +95 -94
  116. package/dist/notifications/stores/NotificationStore.d.ts +1 -3
  117. package/dist/recurringtransactions/index.es.js +582 -562
  118. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -4
  119. package/dist/settings/index.es.js +340 -337
  120. package/dist/spending/index.es.js +281 -268
  121. package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +7 -0
  122. package/dist/transactions/index.es.js +253 -255
  123. package/dist/transactions/stores/TransactionStore.d.ts +77 -21
  124. package/dist/transactions/stores/UiStore.d.ts +2 -0
  125. package/dist/trends/components/TrendsTable.d.ts +0 -2
  126. package/dist/trends/index.es.js +838 -793
  127. package/dist/trends/utils/TrendsData.d.ts +1 -0
  128. package/dist/{useAccountDisplayName-CcIp09Xc.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
  129. package/dist/{useCombineEvents-kNzLTWCp.mjs → useCombineEvents-CRwX-qWE.mjs} +2 -2
  130. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
  131. package/dist/{useScreenSize-B5afALev.mjs → useScreenSize-B6JyS_Lj.mjs} +1 -1
  132. package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
  133. package/package.json +57 -52
  134. package/dist/AccountDetailsContent-adZTkM52.mjs +0 -683
  135. package/dist/AccountListItem-wgmlex-_.mjs +0 -90
  136. package/dist/Accounts-CRUehOiy.mjs +0 -27
  137. package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
  138. package/dist/CategoryUtil-DfVKKkRf.mjs +0 -80
  139. package/dist/CurrencyInput-D1cjbdCI.mjs +0 -85
  140. package/dist/Drawer-BF40nbsH.mjs +0 -163
  141. package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
  142. package/dist/LineChart-C1PxNf7P.mjs +0 -581
  143. package/dist/Loader-Ckqi9Rx6.mjs +0 -21
  144. package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +0 -45
  145. package/dist/MiniWidgetContainer-CKzf_Ira.mjs +0 -56
  146. package/dist/NotificationSettings-B74rQVYC.mjs +0 -672
  147. package/dist/SearchBox-B7km148n.mjs +0 -39
  148. package/dist/SkeletonLoader-BaNboJjD.mjs +0 -38
  149. package/dist/SpendingData-DPQ96k3x.mjs +0 -55
  150. package/dist/TransactionDetails-Bn0qY5Hw.mjs +0 -1336
  151. package/dist/TransactionStore-DbwAutwC.mjs +0 -671
  152. package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
  153. package/dist/common/components/SkeletonLoader.d.ts +0 -7
  154. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +0 -3
@@ -1,58 +1,60 @@
1
- import { jsxs as o, Fragment as U, jsx as e } from "react/jsx-runtime";
2
- import f, { useState as J } from "react";
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 Pe } from "date-fns/addMonths";
5
- import { startOfToday as H } from "date-fns/startOfToday";
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 { useTheme as se, alpha as qe, keyframes as Ye } from "@mui/material/styles";
10
- import { Text as h, P as N, Icon as j, InstitutionLogo as xe, H1 as de, H2 as Qe } from "@mxenabled/mxui";
11
- import { G as Ve, v as me, u as k, q as ce, d as Le, b as q, j as P, g as ke, n as Xe, a as Ke, h as Ne, p as Je } from "../hooks-C41HAxM5.mjs";
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 ue } from "../useScreenSize-B5afALev.mjs";
14
- import { L as te } from "../Loader-Ckqi9Rx6.mjs";
15
- import { I as he } from "../CashflowStore-CA190BPF.mjs";
16
- import { C as jn } from "../CashflowStore-CA190BPF.mjs";
17
- import { b as $ } from "../Localization-2MODESHW.mjs";
18
- import { M as Ze } from "../MiniWidgetContainer-CKzf_Ira.mjs";
19
- import { E as et } from "../EmptyState-DoxNUae-.mjs";
20
- import { R as tt } from "../RecurringSettings-DAncu--R.mjs";
21
- import nt from "@mui/material/Tabs";
22
- import ye from "@mui/material/Tab";
23
- import { getUnixTime as B } from "date-fns/getUnixTime";
24
- import ee from "@mui/material/List";
25
- import ne from "@mui/material/ListItem";
26
- import { A as ot } from "../AccountListItem-wgmlex-_.mjs";
27
- import { f as Y, a as Q } from "../Dialog-CDV0kKxj.mjs";
28
- import at from "@mui/material/ListSubheader";
29
- import { f as Z } from "../NumberFormatting-DjTD0t3W.mjs";
30
- import { isAfter as Oe } from "date-fns/isAfter";
31
- import { isBefore as Fe } from "date-fns/isBefore";
32
- import { isToday as We } from "date-fns/isToday";
33
- import { addDays as Ce } from "date-fns/addDays";
34
- import { DataGridPro as it } from "@mui/x-data-grid-pro";
35
- import { T as _e } from "../TabContentContainer-CnMXkVqr.mjs";
13
+ import { u as pe } from "../useScreenSize-B6JyS_Lj.mjs";
14
+ import { L as oe } from "../Loader-DUaFpDGv.mjs";
15
+ import { I as fe } from "../CashflowStore-D9Dpuz7X.mjs";
16
+ import { C as Bn } from "../CashflowStore-D9Dpuz7X.mjs";
17
+ 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 rt, S as st, i as ct, d as we, c as lt } from "../ManageIncome-8EsStyIQ.mjs";
38
- import { D as He } from "../Drawer-BF40nbsH.mjs";
39
- import { subDays as Me } from "date-fns/subDays";
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 ht } from "date-fns/startOfMonth";
45
- import { S as pt, c as ft } from "../TransactionDetails-Bn0qY5Hw.mjs";
46
- import { F as gt, R as De, e as ve } from "../RecurringTransactions-CxcSL1dY.mjs";
47
- import { h as bt } from "../DateUtil-CDPZw_-m.mjs";
48
- import { F as xt, A as z } from "../Fetch-DecPFeGU.mjs";
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 me().uiStore;
54
+ return he().uiStore;
53
55
  }, yt = ({ remaining: a }) => {
54
- const { cashflow: n } = k();
55
- return /* @__PURE__ */ o(U, { children: [
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(h, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: n.remaining_cash }),
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
- }, pe = T(yt), Ct = () => {
71
- const a = se(), { availableWidth: n } = ce(), { isMobile: t } = ue(), { visibleCashAccounts: i, visibleCashBalance: g } = Le(), { selectedAccounts: x, selectedAccountGuids: u, setSelectedAccounts: c } = q(), { cashflow: m } = k(), {
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: l,
74
- selectedCashAccounts: d,
75
+ expensesTilNextIncome: d,
76
+ selectedCashAccounts: l,
75
77
  setNextIncome: b,
76
78
  setSelectedCashAccounts: C,
77
- setUpcomingExpenses: w
78
- } = V(), { isDataLoaded: O, nextIncomeRecurrence: A, upcomingExpenses: F } = P();
79
+ setUpcomingExpenses: _
80
+ } = V(), { isDataLoaded: k, nextIncomeRecurrence: I, upcomingExpenses: F } = q();
79
81
  f.useEffect(() => {
80
- c(i);
82
+ p(i);
81
83
  }, [i]), f.useEffect(() => {
82
84
  C(
83
- i.filter((I) => u.includes(I.guid))
85
+ i.filter((S) => m.includes(S.guid))
84
86
  );
85
87
  }, [i, x]), f.useEffect(() => {
86
- A && b(A), w(F);
87
- }, [A, F]);
88
- const p = f.useMemo(
89
- () => i.filter((I) => u.includes(I.guid)).reduce((I, M) => I + (M?.balance || 0), 0),
90
- [u, F]
91
- ), S = f.useMemo(
92
- () => l.filter((I) => u.includes(I.accountGuid || "")).reduce((I, M) => I + M.amount, 0),
93
- [u, l]
94
- ), R = f.useMemo(
95
- () => p - S,
96
- [p, S]
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 O ? /* @__PURE__ */ e(D, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: n > 710 ? /* @__PURE__ */ o(
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.neutral.light}`,
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: p, variant: "h2" }),
109
- /* @__PURE__ */ e(N, { variant: "caption", whiteSpace: "nowrap", children: $(
110
- m.total_cash_accounts,
111
- d.length
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: S, variant: "h2" }),
117
- /* @__PURE__ */ e(N, { variant: "caption", whiteSpace: "nowrap", children: $(m.expenses_due, l.length) })
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: R, variant: "h2" }),
123
+ /* @__PURE__ */ e(L, { amount: A, variant: "H2" }),
122
124
  /* @__PURE__ */ o(s, { alignItems: "center", direction: "row", gap: 8, children: [
123
- /* @__PURE__ */ e(N, { variant: "caption", whiteSpace: "nowrap", children: m.available_to_spend }),
124
- /* @__PURE__ */ e(he, { body: m.tooltip_body, title: m.tooltip_title })
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.neutral.light}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ o(U, { children: [
128
- /* @__PURE__ */ e(h, { variant: "h2", children: $(m.days, r) }),
129
- /* @__PURE__ */ e(N, { variant: "caption", whiteSpace: "nowrap", children: m.next_paycheck })
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.neutral.light}`, borderRadius: 1, children: [
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(h, { variant: "body2", children: $(
136
- m.total_cash_accounts,
137
- d.length
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: "caption" })
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(h, { variant: "body2", children: $(m.expenses_due, l.length) }),
144
- /* @__PURE__ */ e(L, { amount: S, bold: !0, symbol: "-", variant: "caption" })
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(pe, { remaining: R })
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(h, { variant: "body2", children: m.next_paycheck }),
164
- /* @__PURE__ */ e(h, { bold: !0, variant: "caption", children: $(m.days, r) })
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(te, { height: t ? 210 : 120 });
167
- }, _t = T(Ct), wt = ({
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 } = k(), { isInitialized: g } = q(), { loadRepeatingTransactionData: x, income: u, isDataLoaded: c, setDateRange: m } = P();
174
+ const { cashflow: i } = N(), { isCopyLoaded: g, isInitialized: x } = X(), { loadRepeatingTransactions: m, income: p, isDataLoaded: c, setDateRange: r } = q();
173
175
  f.useEffect(() => {
174
- m({ start: H(), end: Pe(H(), 1) }), c || x().finally();
175
- }, []);
176
- const r = c && !u.length;
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
- Ze,
183
+ Je,
179
184
  {
180
185
  className: "mx-exp-cashflow-miniwidget",
181
186
  onPrimaryCtaClick: a,
182
187
  primaryCtaLabel: i.primary_cta,
183
- subTitle: r || !c ? void 0 : i.sub_title,
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(te, {}),
188
- c && (r ? /* @__PURE__ */ e(
189
- et,
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(_t, {}))
203
+ ) : /* @__PURE__ */ e(wt, {}))
199
204
  ]
200
205
  }
201
- ) : /* @__PURE__ */ e(te, {});
202
- }, Fn = T(wt), St = ({ remaining: a }) => /* @__PURE__ */ e(
203
- ne,
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(pe, { remaining: a })
220
+ children: /* @__PURE__ */ e(ge, { remaining: a })
216
221
  }
217
222
  );
218
- var oe = /* @__PURE__ */ ((a) => (a.EXPENSE = "expense", a.INCOME = "income", a))(oe || {});
219
- const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
220
- /* @__PURE__ */ o(ne, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
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(h, { bold: !0, sx: { fontSize: 11 }, children: Y(a.expectedDate, Q.MONTH) }),
223
- /* @__PURE__ */ e(h, { bold: !0, sx: { fontSize: 11 }, children: Y(a.expectedDate, Q.DAY) })
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(h, { sx: { flexGrow: 1, fontSize: 13 }, children: a.name }),
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
- ] }), Ae = T(It), Dt = ({ total: a, type: n }) => {
237
- const { cashflow: t } = k();
238
- return /* @__PURE__ */ o(U, { children: [
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
- at,
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(h, { bold: !0, sx: { fontSize: 12 }, children: n === oe.EXPENSE ? t.expenses : t.income }),
253
- /* @__PURE__ */ o(h, { bold: !0, sx: { fontSize: 13 }, children: [
254
- n === oe.EXPENSE ? "-" : "+",
255
- Z(a, "0,0.00")
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
- }, Ee = T(Dt), re = (a, n) => (t) => t.accountGuid === a.guid && (We(t.expectedDate) || Oe(t.expectedDate, n.start)) && Fe(t.expectedDate, n.end), vt = () => {
263
- const { availableWidth: a } = ce(), { cashflow: n } = k(), { upcomingExpenses: t, upcomingIncome: i } = P(), { dateRange: g, selectedCashAccounts: x } = V();
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(h, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: n.accounts_breakdown }),
267
- /* @__PURE__ */ o(h, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: [
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((u) => {
275
- const c = i.filter(re(u, g)).sort((d, b) => B(d.expectedDate) - B(b.expectedDate)), m = t.filter(
276
- re(u, g)
277
- ), r = c.reduce(
278
- (d, b) => d + b.amount,
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
- ), l = m.reduce(
281
- (d, b) => d + b.amount,
285
+ ), d = c.reduce(
286
+ (l, b) => l + b.amount,
282
287
  0
283
288
  );
284
289
  return /* @__PURE__ */ o(
285
- ee,
290
+ ne,
286
291
  {
287
292
  sx: {
288
293
  border: "1px solid",
289
- borderColor: "neutral.light",
294
+ borderColor: "border.light",
290
295
  mb: 24,
291
296
  borderRadius: 1
292
297
  },
293
298
  children: [
294
299
  /* @__PURE__ */ e(
295
- ot,
300
+ nt,
296
301
  {
297
- account: u,
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
- c.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
307
- ee,
311
+ p.length > 0 && /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
312
+ ne,
308
313
  {
309
- subheader: /* @__PURE__ */ e(Ee, { total: r, type: oe.INCOME }),
314
+ subheader: /* @__PURE__ */ e(Re, { total: r, type: ie.INCOME }),
310
315
  sx: { width: "100%" },
311
- children: c.map((d) => /* @__PURE__ */ e(Ae, { recurrence: d }, d.repeatingTransactionGuid))
316
+ children: p.map((l) => /* @__PURE__ */ e(Te, { recurrence: l }, l.repeatingTransactionGuid))
312
317
  }
313
318
  ) }),
314
- m.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
315
- ee,
319
+ c.length > 0 && /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
320
+ ne,
316
321
  {
317
- subheader: /* @__PURE__ */ e(Ee, { total: l, type: oe.EXPENSE }),
322
+ subheader: /* @__PURE__ */ e(Re, { total: d, type: ie.EXPENSE }),
318
323
  sx: { width: "100%" },
319
- children: m.map((d) => /* @__PURE__ */ e(Ae, { recurrence: d }, d.repeatingTransactionGuid))
324
+ children: c.map((l) => /* @__PURE__ */ e(Te, { recurrence: l }, l.repeatingTransactionGuid))
320
325
  }
321
326
  ) }),
322
327
  /* @__PURE__ */ e(
323
- St,
328
+ _t,
324
329
  {
325
- remaining: (u.available_balance || u.balance || 0) + r - l
330
+ remaining: (m.available_balance || m.balance || 0) + r - d
326
331
  }
327
332
  )
328
333
  ]
329
334
  },
330
- u.guid
335
+ m.guid
331
336
  );
332
337
  }) })
333
338
  ] });
334
339
  }, At = T(vt), Et = () => {
335
- const { availableWidth: a } = ce(), n = se(), { cashflow: t } = k(), { upcomingExpenses: i, upcomingIncome: g } = P(), { dateRange: x, selectedCashAccounts: u } = V(), c = [
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: l, institution_guid: d, account_number: b } }) => {
341
- const C = l || r;
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
- xe,
349
+ ye,
345
350
  {
346
351
  alt: t.institution_logo,
347
- institutionGuid: d || "",
352
+ institutionGuid: l || "",
348
353
  size: 16
349
354
  }
350
355
  ),
351
- /* @__PURE__ */ e(h, { variant: "body2", children: `${C} ${b ? `*${b}` : ""}` })
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(h, { color: n.palette.text.primary, variant: "body2", children: Z(r.value, "0,0.00") })
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(h, { color: n.palette.text.primary, variant: "body2", children: `+${Z(r.value, "0,0.00")}` })
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(h, { color: n.palette.text.primary, variant: "body2", children: `-${Z(r.value, "0,0.00")}` })
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 l = r.row.balance + r.row.income - r.row.expenses;
387
+ const d = r.row.balance + r.row.income - r.row.expenses;
383
388
  return /* @__PURE__ */ e(
384
- h,
389
+ u,
385
390
  {
386
- color: Math.sign(l) === -1 ? n.palette.error.main : n.palette.text.primary,
387
- variant: "body2",
388
- children: Z(l, "0,0.00")
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
- ], m = f.useMemo(() => u.map((r) => {
394
- const l = i.filter(
395
- re(r, { start: H(), end: Ce(H(), 30) })
396
- ).reduce((C, w) => C + w.amount, 0), d = g.filter(
397
- re(r, { start: H(), end: Ce(H(), 30) })
398
- ).reduce((C, w) => C + w.amount, 0), b = (r.balance || 0) + d - l;
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: d,
404
- expenses: l,
408
+ income: l,
409
+ expenses: d,
405
410
  remaining: b
406
411
  };
407
- }), [u, i, g]);
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
- h,
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
- he,
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(h, { bold: !0, sx: { fontSize: 15, whiteSpace: "normal" }, children: [
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
- it,
457
+ rt,
453
458
  {
454
459
  columnHeaderHeight: 48,
455
- columns: c,
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: m,
466
+ rows: c,
462
467
  sx: {
463
468
  border: "1px solid",
464
- borderColor: "neutral.light",
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: qe(n.palette.primary.main, 0.1)
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
- ) : m.map((r) => {
482
- const { name: l, nickname: d, institution_guid: b, account_number: C } = r.account, w = d || l;
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
- ee,
489
+ ne,
485
490
  {
486
491
  sx: {
487
492
  border: "1px solid",
488
- borderColor: "neutral.light",
493
+ borderColor: "border.light",
489
494
  borderRadius: 1,
490
495
  marginBottom: 24
491
496
  },
492
- children: /* @__PURE__ */ e(ne, { sx: { minHeight: "auto" }, children: /* @__PURE__ */ o(s, { width: "100%", children: [
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
- xe,
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(h, { variant: "body2", children: `${w} ${C ? `*${C}` : ""}` })
516
+ /* @__PURE__ */ e(u, { variant: "Small", children: `${_} ${C ? `*${C}` : ""}` })
512
517
  ] }),
513
- /* @__PURE__ */ e(L, { amount: r.balance, bold: !0, variant: "body2" })
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(h, { variant: "body2", children: t.projected_income }),
528
- /* @__PURE__ */ e(L, { amount: r.income, bold: !0, symbol: "+", variant: "body2" })
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(h, { variant: "body2", children: t.projected_expenses }),
543
- /* @__PURE__ */ e(L, { amount: r.expenses, bold: !0, symbol: "-", variant: "body2" })
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(pe, { remaining: r.remaining })
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 } = k(), { isDesktop: n } = ue(), { onEvent: t } = ke(), [i, g] = f.useState(0), x = (u, c) => {
572
- g(c);
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
- nt,
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
- ye,
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
- ye,
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(_e, { index: 0, name: "cashflow", value: i, children: /* @__PURE__ */ e(D, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(Tt, {}) }) }),
614
- /* @__PURE__ */ e(_e, { index: 1, name: "cashflow", value: i, children: /* @__PURE__ */ e(D, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(At, {}) }) })
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), ie = ({
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: "h2" }),
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(h, { bold: t, variant: "body2", children: i }),
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: "body2" })
642
+ n && /* @__PURE__ */ e(L, { amount: a, component: "h2", symbol: g, variant: "Small" })
638
643
  ]
639
644
  }
640
- ), Te = (a, n) => (t) => t.accountGuid && a.includes(t.accountGuid) && (We(t.expectedDate) || Oe(t.expectedDate, n.start)) && Fe(t.expectedDate, n.end), kt = () => {
641
- const { availableWidth: a } = ce(), { cashflow: n } = k(), { income: t, isDataLoaded: i, upcomingExpenses: g, upcomingIncome: x } = P(), { selectedAccountGuids: u } = q(), { dateRange: c, selectedCashAccounts: m } = V(), [r, l] = f.useState(!1), d = f.useMemo(
642
- () => g.filter(Te(u, c)),
643
- [c, u, g]
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(Te(u, c)),
646
- [c, u, x]
650
+ () => x.filter(Le(m, p)),
651
+ [p, m, x]
647
652
  ), C = f.useMemo(
648
- () => m.reduce((S, R) => S + (R?.balance || 0), 0),
649
- [m]
650
- ), w = d.reduce((S, R) => S + R.amount, 0), O = b.reduce((S, R) => S + R.amount, 0), A = C - w + O, F = i && t.length > 0, p = a < 725;
651
- return /* @__PURE__ */ o(s, { sx: { mx: p ? 16 : 0, my: p ? 24 : 42 }, children: [
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: p ? "1px solid" : "none",
656
- borderColor: "neutral.light",
660
+ border: h ? "1px solid" : "none",
661
+ borderColor: "border.light",
657
662
  borderRadius: 2,
658
- flexDirection: p ? "column" : "row",
659
- gap: p ? 0 : 24,
663
+ flexDirection: h ? "column" : "row",
664
+ gap: h ? 0 : 24,
660
665
  justifyContent: "center",
661
666
  children: [
662
667
  /* @__PURE__ */ e(
663
- ie,
668
+ se,
664
669
  {
665
670
  amount: C,
666
- isMobile: p,
667
- label: $(n.cash_and_bank, m.length)
671
+ isMobile: h,
672
+ label: M(n.cash_and_bank, c.length)
668
673
  }
669
674
  ),
670
- p && /* @__PURE__ */ e(v, {}),
671
- F ? /* @__PURE__ */ o(U, { children: [
672
- !p && /* @__PURE__ */ e(h, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
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
- ie,
679
+ se,
675
680
  {
676
- amount: O,
677
- isMobile: p,
681
+ amount: k,
682
+ isMobile: h,
678
683
  label: n.to_be_received,
679
- symbol: p ? "+" : void 0
684
+ symbol: h ? "+" : void 0
680
685
  }
681
686
  )
682
687
  ] }) : /* @__PURE__ */ e(
683
688
  G,
684
689
  {
685
- onClick: () => l(!0),
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
- p ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(h, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
696
+ h ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
692
697
  /* @__PURE__ */ e(
693
- ie,
698
+ se,
694
699
  {
695
- amount: w,
696
- isMobile: p,
697
- label: $(n.to_be_paid_out, d.length),
698
- symbol: p ? "-" : void 0
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
- p ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(h, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
706
+ h ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
702
707
  /* @__PURE__ */ e(
703
- ie,
708
+ se,
704
709
  {
705
- amount: A,
706
- isMobile: p,
707
- isTotal: p,
710
+ amount: I,
711
+ isMobile: h,
712
+ isTotal: h,
708
713
  label: n.remaining_cash,
709
714
  tooltip: /* @__PURE__ */ e(
710
- he,
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
- He,
727
+ je,
723
728
  {
724
729
  ariaLabelClose: n.close_manage_income_aria,
725
730
  isOpen: r,
726
- onClose: () => l(!1),
731
+ onClose: () => d(!1),
727
732
  shouldShowHeaderBorders: !1,
728
733
  title: n.manage_income,
729
- children: /* @__PURE__ */ e(rt, {})
734
+ children: /* @__PURE__ */ e(st, {})
730
735
  }
731
736
  )
732
737
  ] });
733
- }, Nt = T(kt), Ot = ({ onBackClick: a, sx: n = {} }) => {
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(de, { pb: 12, children: t.welcome_title }),
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: "h3",
748
+ variant: "H3",
809
749
  children: t.welcome_sub_title
810
750
  }
811
751
  ),
812
- /* @__PURE__ */ e(N, { pb: 32, children: t.welcome_description }),
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(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
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.light,
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(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
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.light,
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(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
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.light,
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
- }, Wt = T(Ft), Re = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", $e = {
869
- CASHFLOW_ONBOARDING: `${Re}/cashflow-onboarding.png`,
870
- CASHFLOW_LOADING_ANIMATION: `${Re}/loading-animation.gif`
871
- }, Ht = () => {
872
- const { cashflow: a } = k();
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: $e.CASHFLOW_LOADING_ANIMATION }) }),
875
- /* @__PURE__ */ e(de, { pb: 12, children: a.loading_title }),
876
- /* @__PURE__ */ e(N, { children: a.loading_description })
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
- }, Mt = T(Ht), $t = Ye`
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
- `, Gt = () => {
886
- const { addRepeatingTransaction: a, repeatingTransactions: n } = P(), { cashflow: t, common: i } = k(), { user: g } = Je(), { completeOnboarding: x } = me(), { isDirty: u } = V(), { isMobile: c } = ue(), { isCopyLoaded: m, setDisplayedDate: r } = q(), { filter: l, setFilter: d, transactions: b } = Ne(), C = se(), [w, O] = J(!0), [A, F] = f.useState(gt.EveryMonth), [p, S] = f.useState(1), [R, I] = f.useState(15), [M, ae] = J(!1), [X, K] = J(1), [_, Ge] = J([]), [fe, le] = J(""), W = f.useMemo(
887
- () => b.find((y) => y.guid === fe),
888
- [fe, b]
889
- ), je = !!n.filter(
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, ge = async () => {
892
- K(2), r(
831
+ ).length, be = async () => {
832
+ J(2), r(
893
833
  // Beginning of the month, 90 days before today
894
- ht(Me(H(), 90)),
895
- H()
896
- ), d({ ...l, custom: we }), K(3);
897
- }, ze = async () => {
898
- if (!(_.length < 1)) {
899
- ae(!0);
900
- for (let y = 0; y < _.length; y++) {
901
- const E = _[y], be = ve(A, Ie(E.date)), Ue = {
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: ut(be, { representation: "date" }),
909
- recurrence_day: be.getDay(),
910
- recurrence_type: A,
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: R,
852
+ second_recurrence_day: A,
913
853
  transaction_type: E.transaction_type,
914
854
  user_guid: g.guid
915
855
  };
916
- await a(Ue, E);
856
+ await a(Xe, E);
917
857
  }
918
858
  await x();
919
859
  }
920
- }, Be = !W && w || !W && _.length < 1;
921
- return m ? /* @__PURE__ */ o(
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: c ? "flex-start" : "center",
866
+ alignItems: p ? "flex-start" : "center",
927
867
  backgroundColor: C.palette.background.paper,
928
- backgroundImage: c ? null : `url(${$e.CASHFLOW_ONBOARDING})`,
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
- X === 1 && /* @__PURE__ */ e(
875
+ K === 1 && /* @__PURE__ */ e(
936
876
  D,
937
877
  {
938
878
  sx: {
939
- ...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
879
+ ...p ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
940
880
  },
941
- children: /* @__PURE__ */ e(Wt, { handleNextStep: ge })
881
+ children: /* @__PURE__ */ e(Ht, { handleNextStep: be })
942
882
  }
943
883
  ),
944
- X === 2 && /* @__PURE__ */ e(
884
+ K === 2 && /* @__PURE__ */ e(
945
885
  D,
946
886
  {
947
887
  sx: {
948
- ...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
888
+ ...p ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
949
889
  },
950
- children: /* @__PURE__ */ e(Mt, {})
890
+ children: /* @__PURE__ */ e(Wt, {})
951
891
  }
952
892
  ),
953
- X === 3 && /* @__PURE__ */ o(
893
+ K === 3 && /* @__PURE__ */ o(
954
894
  D,
955
895
  {
956
896
  sx: {
957
- ...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
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(de, { pb: 12, children: t.add_income_title }),
961
- /* @__PURE__ */ e(N, { mb: 24, children: t.add_income_description }),
962
- _.length > 0 && !W && /* @__PURE__ */ o(U, { children: [
963
- /* @__PURE__ */ e(ee, { children: _.map((y, E) => /* @__PURE__ */ o(f.Fragment, { children: [
964
- /* @__PURE__ */ e(pt, { bgcolor: "background.paper", children: bt(
965
- B(y.nextDate || y.date)
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(ft, { transaction: y }),
968
- E !== _.length - 1 && /* @__PURE__ */ e(v, {})
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: () => O(!0),
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
- Be && /* @__PURE__ */ e(
983
- st,
922
+ qe && /* @__PURE__ */ e(
923
+ ct,
984
924
  {
985
925
  bgcolor: "background.paper",
986
- onSearch: (y) => d({
987
- ...l,
988
- custom: (E) => y ? ct(E, y) : we(E)
926
+ onSearch: (y) => l({
927
+ ...d,
928
+ custom: (E) => y ? lt(E, y) : _e(E)
989
929
  }),
990
930
  onSelected: (y) => {
991
- le(y), O(!1);
931
+ H(y), k(!1);
992
932
  }
993
933
  }
994
934
  ),
995
- !je && u && /* @__PURE__ */ e(N, { color: "error", mt: 16, children: t.confirm_error }),
996
- W && /* @__PURE__ */ o(U, { children: [
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
- lt,
938
+ dt,
999
939
  {
1000
940
  bgcolor: "background.paper",
1001
- firstDay: p,
1002
- frequency: A,
1003
- onFirstDayChange: S,
941
+ firstDay: h,
942
+ frequency: I,
943
+ onFirstDayChange: w,
1004
944
  onFrequencyChange: F,
1005
- onSecondDayChange: I,
1006
- secondDay: R,
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(A, Ie(W.date)),
1020
- frequency: A
1021
- }), Ge(y), le("");
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
- le(""), O(!0), ge().finally();
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
- _.length > 0 && !W && /* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
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": _.length < 1 || M,
1044
- onClick: ze,
1045
- startIcon: M ? /* @__PURE__ */ e(
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(te, {});
1066
- }, Hn = T(Gt);
1067
- class Mn {
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(z.CASHFLOW_EVENTS, { ...n }).then((t) => t);
1073
- addCashflowSequence = async (n) => this.fetchInstance.post(z.CASHFLOW_SEQUENCES, { ...n }).then((t) => t.cashflow_sequence);
1074
- getCashflowSequences = async () => this.fetchInstance.get(z.CASHFLOW_SEQUENCES).then((n) => n.cashflow_sequences);
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
- `${z.CASHFLOW_EVENTS}/from/${B(n)}/to/${B(t)}`
1092
+ `${B.CASHFLOW_EVENTS}/from/${U(n)}/to/${U(t)}`
1077
1093
  ).then((i) => i.cashflow_events);
1078
- deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${z.CASHFLOW_SEQUENCES}/${n}`).then((t) => t);
1094
+ deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${B.CASHFLOW_SEQUENCES}/${n}`).then((t) => t);
1079
1095
  getProjectedCashflowEvents = async (n, t) => this.fetchInstance.get(
1080
- `${z.CASHFLOW_SEQUENCES}/projected_events/from/${B(
1096
+ `${B.CASHFLOW_SEQUENCES}/projected_events/from/${U(
1081
1097
  n
1082
- )}/to/${B(t)}`
1098
+ )}/to/${U(t)}`
1083
1099
  ).then((i) => i.cashflow_events);
1084
- updateCashflowSequence = async (n) => this.fetchInstance.put(`${z.CASHFLOW_SEQUENCES}/${n.guid}`, n).then((t) => t.cashflow_sequence);
1100
+ updateCashflowSequence = async (n) => this.fetchInstance.put(`${B.CASHFLOW_SEQUENCES}/${n.guid}`, n).then((t) => t.cashflow_sequence);
1085
1101
  }
1086
1102
  export {
1087
- Mn as CashflowApi,
1088
- Fn as CashflowMiniWidget,
1089
- Hn as CashflowOnboarding,
1090
- jn as CashflowStore,
1091
- Wn as CashflowWidget
1103
+ Gn as CashflowApi,
1104
+ $n as CashflowMiniWidget,
1105
+ Gt as CashflowOnboarding,
1106
+ Bn as CashflowStore,
1107
+ Mn as CashflowWidget
1092
1108
  };