@mx-cartographer/experiences 9.1.0 → 9.1.2

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