@mx-cartographer/experiences 7.0.2 → 7.0.4

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