@mx-cartographer/experiences 7.0.57 → 7.0.58-alpha.al1

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