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