@mx-cartographer/experiences 7.7.2 → 7.8.0-alpha-ram-goal-bug

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/Account-BiB1F8lL.mjs +118 -0
  3. package/dist/{Account-BfkKlfsW.mjs → Account-DuOz1a27.mjs} +1 -1
  4. package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
  5. package/dist/{AccountDetailsHeader-DqYIuhOs.mjs → AccountDetailsHeader-Cf2TUJnM.mjs} +4 -4
  6. package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
  7. package/dist/{AccountFields-yP8QdgPd.mjs → AccountFields-UdOvbQ5H.mjs} +7 -6
  8. package/dist/{AccountListItem-DMbu9ehd.mjs → AccountListItem-BPVxmNT_.mjs} +7 -7
  9. package/dist/AccountStore-BbPWe2C9.mjs +244 -0
  10. package/dist/Accounts-M-LTzStv.mjs +27 -0
  11. package/dist/{CategoryStore-Cnw9yUys.mjs → CategoryStore-BYICdb9m.mjs} +73 -73
  12. package/dist/CategoryUtil-meuejJqP.mjs +80 -0
  13. package/dist/{ConnectionsDrawer-BqR6FWJO.mjs → ConnectionsDrawer-BDpVTTSe.mjs} +1 -1
  14. package/dist/{DebtsStore-DuSdXM1k.mjs → DebtsStore-BIbOVCPe.mjs} +12 -12
  15. package/dist/{ExportCsvAction-HK5CeZWR.mjs → ExportCsvAction-CDuzTva1.mjs} +2 -2
  16. package/dist/GlobalAccountFilter-DQCPNc95.mjs +316 -0
  17. package/dist/GoalStore-B4LVt_kH.mjs +422 -0
  18. package/dist/{ManageIncome-BrTrlplL.mjs → ManageIncome-CL3hv8i9.mjs} +44 -44
  19. package/dist/NetWorthStore-yV43kJro.mjs +168 -0
  20. package/dist/{NotificationSettings-D4Vh3z8I.mjs → NotificationSettings-SPg3pwbX.mjs} +171 -169
  21. package/dist/{NotificationStore-CDX_kqHa.mjs → NotificationStore-Ck2KdNmT.mjs} +22 -14
  22. package/dist/{RecurringSettings-D2V6l77l.mjs → RecurringSettings-Bmnnpb48.mjs} +16 -16
  23. package/dist/{RecurringTransactionsStore-Caf1cq4v.mjs → RecurringTransactionsStore-BQBEJOPP.mjs} +91 -81
  24. package/dist/{RecurringTransactions-Bf4lX0Cn.mjs → RepeatingTransaction-miZVnk_A.mjs} +4 -4
  25. package/dist/{SettingsStore-krIRNwHK.mjs → SettingsStore-BHpuyujx.mjs} +1 -1
  26. package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
  27. package/dist/{SpendingLegend-gTCJLLkV.mjs → SpendingLegend-CD60HCYS.mjs} +33 -33
  28. package/dist/{TransactionDetails-7MHOshKQ.mjs → TransactionDetails-BDhz3DLT.mjs} +2 -2
  29. package/dist/TransactionStore-BSp5bOKg.mjs +705 -0
  30. package/dist/{User-LJpEwPtn.mjs → User-B0LnmiKO.mjs} +21 -20
  31. package/dist/WidgetContainer-BbPS3Yxz.mjs +555 -0
  32. package/dist/accounts/index.es.js +421 -391
  33. package/dist/accounts/stores/AccountStore.d.ts +30 -23
  34. package/dist/accounts/utils/Accounts.d.ts +2 -1
  35. package/dist/budgets/index.es.js +546 -540
  36. package/dist/budgets/store/BudgetsStore.d.ts +1 -0
  37. package/dist/cashflow/index.es.js +444 -457
  38. package/dist/categories/index.es.js +1 -1
  39. package/dist/categories/stores/CategoryStore.d.ts +10 -5
  40. package/dist/categories/util/CategoryUtil.d.ts +3 -2
  41. package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
  42. package/dist/common/components/SkeletonLoader.d.ts +7 -0
  43. package/dist/common/components/WidgetContainer.d.ts +7 -6
  44. package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
  45. package/dist/common/components/index.d.ts +2 -2
  46. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  47. package/dist/common/index.es.js +459 -445
  48. package/dist/common/stores/AppDataStore.d.ts +3 -1
  49. package/dist/common/stores/GlobalCopyStore.d.ts +0 -1
  50. package/dist/common/stores/GlobalStore.d.ts +3 -3
  51. package/dist/common/stores/GlobalUiStore.d.ts +10 -6
  52. package/dist/common/stores/UserStore.d.ts +3 -2
  53. package/dist/common/types/Account.d.ts +9 -6
  54. package/dist/dashboard/index.es.js +84 -116
  55. package/dist/debts/index.es.js +417 -413
  56. package/dist/{exportTransactionsToCSV-BrTYdSgJ.mjs → exportTransactionsToCSV-DtQ7ovAR.mjs} +1 -1
  57. package/dist/finstrong/index.es.js +1167 -1110
  58. package/dist/goals/index.es.js +618 -598
  59. package/dist/goals/stores/GoalStore.d.ts +19 -4
  60. package/dist/help/index.es.js +13 -13
  61. package/dist/investments/index.es.js +330 -325
  62. package/dist/investments/stores/HoldingStore.d.ts +1 -0
  63. package/dist/networth/components/NetWorthChart.d.ts +3 -2
  64. package/dist/networth/components/NetWorthList.d.ts +3 -3
  65. package/dist/networth/index.es.js +423 -433
  66. package/dist/networth/stores/NetWorthStore.d.ts +20 -9
  67. package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
  68. package/dist/notifications/index.es.js +90 -91
  69. package/dist/notifications/stores/NotificationStore.d.ts +3 -1
  70. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
  71. package/dist/recurringtransactions/index.es.js +543 -562
  72. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +4 -2
  73. package/dist/settings/index.es.js +253 -248
  74. package/dist/spending/index.es.js +282 -301
  75. package/dist/transactions/index.es.js +269 -263
  76. package/dist/transactions/stores/TransactionStore.d.ts +26 -77
  77. package/dist/transactions/stores/UiStore.d.ts +0 -2
  78. package/dist/trends/index.es.js +708 -699
  79. package/dist/{useAccountDisplayName-BTvP_pw6.mjs → useAccountDisplayName-Bot2tb4n.mjs} +1 -1
  80. package/package.json +3 -3
  81. package/dist/AccountStore-CWFzg8-E.mjs +0 -260
  82. package/dist/Accounts-CWt-NRq8.mjs +0 -9
  83. package/dist/CategoryUtil-DZflYFam.mjs +0 -78
  84. package/dist/ConnectDrawer-BOjfI6rz.mjs +0 -563
  85. package/dist/GoalStore-C7ahxxLi.mjs +0 -364
  86. package/dist/NetWorthStore-xWIo9CYU.mjs +0 -150
  87. package/dist/TransactionStore-DJwPaZuM.mjs +0 -677
  88. package/dist/WidgetContainer-CrK6tyHr.mjs +0 -572
  89. package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
  90. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
  91. package/dist/common/components/accountfilter/index.d.ts +0 -1
  92. package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
@@ -1,92 +1,92 @@
1
- import { jsx as e, jsxs as o, Fragment as X } from "react/jsx-runtime";
2
- import f from "react";
3
- import { observer as T } from "mobx-react-lite";
4
- import { endOfMonth as F } from "date-fns/endOfMonth";
5
- import { endOfToday as de } from "date-fns/endOfToday";
6
- import { startOfMonth as k } from "date-fns/startOfMonth";
7
- import { startOfToday as ue } from "date-fns/startOfToday";
8
- import { subDays as me } from "date-fns/subDays";
9
- import ae from "@mui/material/Skeleton";
1
+ import { jsx as e, jsxs as a, Fragment as B } from "react/jsx-runtime";
2
+ import x from "react";
3
+ import { observer as C } from "mobx-react-lite";
4
+ import { endOfMonth as W } from "date-fns/endOfMonth";
5
+ import { endOfToday as Z } from "date-fns/endOfToday";
6
+ import { startOfMonth as G } from "date-fns/startOfMonth";
7
+ import { startOfToday as J } from "date-fns/startOfToday";
8
+ import { subDays as Q } from "date-fns/subDays";
9
+ import { R as Te } from "../RecurringSettings-Bmnnpb48.mjs";
10
+ import { M as vn } from "../RecurringSettings-Bmnnpb48.mjs";
11
+ import { addMonths as We } from "date-fns/addMonths";
12
+ import { subMonths as $e } from "date-fns/subMonths";
13
+ import { isBefore as Be } from "date-fns/isBefore";
14
+ import V from "@mui/material/Unstable_Grid2";
15
+ import ge from "@mui/material/IconButton";
10
16
  import l from "@mui/material/Stack";
11
- import { R as Ne } from "../RecurringSettings-D2V6l77l.mjs";
12
- import { M as Gn } from "../RecurringSettings-D2V6l77l.mjs";
13
- import { addMonths as Fe } from "date-fns/addMonths";
14
- import { subMonths as Ue } from "date-fns/subMonths";
15
- import { isBefore as je } from "date-fns/isBefore";
16
- import se from "@mui/material/Unstable_Grid2";
17
- import Se from "@mui/material/IconButton";
18
- import _e from "@mui/material/Tab";
19
- import Ke from "@mui/material/Tabs";
20
- import { Schedule as Ye, MonetizationOn as Ve, Cancel as Ge, CheckCircle as Oe, ChevronLeft as Xe, ChevronRight as qe, CurrencyExchange as Ze } from "@mxenabled/mx-icons";
21
- import { Text as g, MerchantLogo as pe, InstitutionLogo as Je, H3 as Qe, P as ce } from "@mxenabled/mxui";
22
- import { getWeeksInMonth as Ie } from "date-fns/getWeeksInMonth";
23
- import ge from "@mui/material/styles/useTheme";
24
- import { AdapterDateFns as et } from "@mui/x-date-pickers/AdapterDateFnsV3";
25
- import { DateCalendar as tt } from "@mui/x-date-pickers/DateCalendar";
26
- import { LocalizationProvider as nt } from "@mui/x-date-pickers/LocalizationProvider";
27
- import { isSameDay as it } from "date-fns/isSameDay";
28
- import rt from "@mui/material/Badge";
29
- import { PickersDay as ot } from "@mui/x-date-pickers/PickersDay";
30
- import { I as q } from "../IconBacking-B9oC6uL2.mjs";
31
- import { u as w, b as Z, j as I, g as J, p as ke, d as he, h as fe } from "../hooks-ZMp65DFz.mjs";
32
- import { c as v, a as D, g as Me, f as at } from "../RecurringTransactions-Bf4lX0Cn.mjs";
33
- import { T as z } from "../RecurringTransactionsStore-Caf1cq4v.mjs";
34
- import { R as kn } from "../RecurringTransactionsStore-Caf1cq4v.mjs";
35
- import { A as _, W as st } from "../WidgetContainer-CrK6tyHr.mjs";
36
- import ct from "@mui/material/Button";
37
- import le from "@mui/material/Divider";
38
- import ve from "@mui/material/List";
39
- import We from "@mui/material/ListItem";
40
- import lt from "@mui/material/ListSubheader";
41
- import dt from "@mui/material/ListItemAvatar";
42
- import ut from "@mui/material/ListItemButton";
43
- import mt from "@mui/material/ListItemText";
44
- import { b as pt } from "../ManageIncome-BrTrlplL.mjs";
45
- import { c as $n, M as Bn, S as Pn } from "../ManageIncome-BrTrlplL.mjs";
46
- import { f as L } from "../NumberFormatting-DjTD0t3W.mjs";
47
- import { D as xe } from "../Drawer-DV4NTsFg.mjs";
48
- import { b as G } from "../Localization-2MODESHW.mjs";
49
- import { f as A, D as E } from "../Dialog-B4PI-_bL.mjs";
50
- import O from "@mui/material/Box";
51
- import { S as $e } from "../StatusBar-BK_uYHAB.mjs";
52
- import { u as ye } from "../useScreenSize-B6JyS_Lj.mjs";
53
- import { u as be } from "../useWidgetLoadTimer-hIOioiKx.mjs";
54
- import { L as V } from "../Loader-DUaFpDGv.mjs";
55
- import { M as gt } from "../MiniWidgetContainer-98-hKFqm.mjs";
56
- import { u as ht } from "../useDimensions-27p2evRx.mjs";
57
- import { M as ft } from "../MicroWidgetContainer-B2hO9rOG.mjs";
58
- const Q = {
17
+ import he from "@mui/material/Tab";
18
+ import Pe from "@mui/material/Tabs";
19
+ import { Schedule as He, MonetizationOn as ze, Cancel as De, CheckCircle as we, ChevronLeft as Fe, ChevronRight as Ue, CurrencyExchange as je } from "@mxenabled/mx-icons";
20
+ import { Text as h, MerchantLogo as ee, InstitutionLogo as Ke, H3 as Ye, P as X } from "@mxenabled/mxui";
21
+ import { getWeeksInMonth as fe } from "date-fns/getWeeksInMonth";
22
+ import te from "@mui/material/styles/useTheme";
23
+ import { AdapterDateFns as Ve } from "@mui/x-date-pickers/AdapterDateFnsV3";
24
+ import { DateCalendar as Xe } from "@mui/x-date-pickers/DateCalendar";
25
+ import { LocalizationProvider as qe } from "@mui/x-date-pickers/LocalizationProvider";
26
+ import { isSameDay as Ze } from "date-fns/isSameDay";
27
+ import Je from "@mui/material/Badge";
28
+ import { PickersDay as Qe } from "@mui/x-date-pickers/PickersDay";
29
+ import { I as P } from "../IconBacking-B9oC6uL2.mjs";
30
+ import { u as R, b as H, j as _, g as z, p as _e, h as ne } from "../hooks-ZMp65DFz.mjs";
31
+ import { d as I, c as T, g as xe, f as et } from "../RepeatingTransaction-miZVnk_A.mjs";
32
+ import { T as O } from "../RecurringTransactionsStore-BQBEJOPP.mjs";
33
+ import { R as An } from "../RecurringTransactionsStore-BQBEJOPP.mjs";
34
+ import { A as S, W as tt } from "../WidgetContainer-BbPS3Yxz.mjs";
35
+ import nt from "@mui/material/Button";
36
+ import q from "@mui/material/Divider";
37
+ import be from "@mui/material/List";
38
+ import Se from "@mui/material/ListItem";
39
+ import it from "@mui/material/ListSubheader";
40
+ import rt from "@mui/material/ListItemAvatar";
41
+ import ot from "@mui/material/ListItemButton";
42
+ import at from "@mui/material/ListItemText";
43
+ import { b as st } from "../ManageIncome-CL3hv8i9.mjs";
44
+ import { c as Nn, M as Gn, S as On } from "../ManageIncome-CL3hv8i9.mjs";
45
+ import { f as M } from "../NumberFormatting-DjTD0t3W.mjs";
46
+ import { D as ie } from "../Drawer-DV4NTsFg.mjs";
47
+ import { b as E } from "../Localization-2MODESHW.mjs";
48
+ import { f as v, D as L } from "../Dialog-B4PI-_bL.mjs";
49
+ import N from "@mui/material/Box";
50
+ import { S as Ie } from "../StatusBar-BK_uYHAB.mjs";
51
+ import { u as re } from "../useScreenSize-B6JyS_Lj.mjs";
52
+ import { S as Me } from "../SkeletonLoader-BaNboJjD.mjs";
53
+ import { u as oe } from "../useWidgetLoadTimer-hIOioiKx.mjs";
54
+ import { L as ae } from "../Loader-DUaFpDGv.mjs";
55
+ import { M as ct } from "../MiniWidgetContainer-98-hKFqm.mjs";
56
+ import { u as lt } from "../useDimensions-27p2evRx.mjs";
57
+ import { M as dt } from "../MicroWidgetContainer-B2hO9rOG.mjs";
58
+ const F = {
59
59
  gridRow: 1,
60
60
  gridColumn: 1,
61
61
  zIndex: 2
62
- }, ee = (t) => t ? { margin: "0 0 -6px -4px" } : void 0, Ce = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(q, { size: n, sx: { ...ee(t) }, children: /* @__PURE__ */ e(Ye, { color: "primary", filled: !0, sx: { fontSize: n, ...Q } }) }), Re = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(q, { size: n, sx: { ...ee(t) }, children: /* @__PURE__ */ e(
63
- Ve,
62
+ }, U = (t) => t ? { margin: "0 0 -6px -4px" } : void 0, se = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(P, { size: n, sx: { ...U(t) }, children: /* @__PURE__ */ e(He, { color: "primary", filled: !0, sx: { fontSize: n, ...F } }) }), ce = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(P, { size: n, sx: { ...U(t) }, children: /* @__PURE__ */ e(
63
+ ze,
64
64
  {
65
65
  filled: !0,
66
- sx: { color: "categories.income", fontSize: n, ...Q }
66
+ sx: { color: "categories.income", fontSize: n, ...F }
67
67
  }
68
- ) }), Te = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(q, { size: n, sx: { ...ee(t) }, children: /* @__PURE__ */ e(Ge, { color: "error", filled: !0, sx: { fontSize: n, ...Q } }) }), we = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(q, { size: n, sx: { ...ee(t) }, children: /* @__PURE__ */ e(Oe, { color: "success", filled: !0, sx: { fontSize: n, ...Q } }) }), xt = T(
68
+ ) }), le = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(P, { size: n, sx: { ...U(t) }, children: /* @__PURE__ */ e(De, { color: "error", filled: !0, sx: { fontSize: n, ...F } }) }), de = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(P, { size: n, sx: { ...U(t) }, children: /* @__PURE__ */ e(we, { color: "success", filled: !0, sx: { fontSize: n, ...F } }) }), ut = C(
69
69
  ({ day: t, outsideCurrentMonth: n, ...i }) => {
70
- const { recurring: r } = w(), { selectedAccountGuids: a } = Z(), { recurrences: c, setSelectedDay: p } = I(), s = f.useMemo(
71
- () => c.filter((d) => a.includes(d.accountGuid)),
72
- [a, c]
70
+ const { recurring: o } = R(), { selectedAccountGuids: r } = H(), { recurrences: c, setSelectedDay: u } = _(), s = x.useMemo(
71
+ () => c.filter((f) => r.includes(f.accountGuid)),
72
+ [r, c]
73
73
  ).filter(
74
- (d) => it(d.occurredOnDate || d.expectedDate, t)
74
+ (f) => Ze(f.occurredOnDate || f.expectedDate, t)
75
+ ), d = s.some(
76
+ (f) => f.type !== I.Income && f.status === T.Upcoming
75
77
  ), m = s.some(
76
- (d) => d.type !== v.Income && d.status === D.Upcoming
77
- ), u = s.some(
78
- (d) => d.type !== v.Income && d.status === D.Missed
79
- ), x = s.some(
80
- (d) => d.type !== v.Income && d.status === D.Paid
81
- ), b = s.some((d) => d.type === v.Income), y = (m ? 1 : 0) + (u ? 1 : 0) + (x ? 1 : 0) + (b ? 1 : 0);
78
+ (f) => f.type !== I.Income && f.status === T.Missed
79
+ ), g = s.some(
80
+ (f) => f.type !== I.Income && f.status === T.Paid
81
+ ), b = s.some((f) => f.type === I.Income), y = (d ? 1 : 0) + (m ? 1 : 0) + (g ? 1 : 0) + (b ? 1 : 0);
82
82
  return /* @__PURE__ */ e(
83
- rt,
83
+ Je,
84
84
  {
85
- badgeContent: s.length > 0 && /* @__PURE__ */ o(X, { children: [
86
- u && /* @__PURE__ */ e(Te, { isOffset: !0 }),
87
- x && /* @__PURE__ */ e(we, { isOffset: !0 }),
88
- m && /* @__PURE__ */ e(Ce, { isOffset: !0 }),
89
- b && /* @__PURE__ */ e(Re, { isOffset: !0 })
85
+ badgeContent: s.length > 0 && /* @__PURE__ */ a(B, { children: [
86
+ m && /* @__PURE__ */ e(le, { isOffset: !0 }),
87
+ g && /* @__PURE__ */ e(de, { isOffset: !0 }),
88
+ d && /* @__PURE__ */ e(se, { isOffset: !0 }),
89
+ b && /* @__PURE__ */ e(ce, { isOffset: !0 })
90
90
  ] }),
91
91
  overlap: "circular",
92
92
  sx: {
@@ -97,15 +97,15 @@ const Q = {
97
97
  }
98
98
  },
99
99
  children: /* @__PURE__ */ e(
100
- ot,
100
+ Qe,
101
101
  {
102
102
  "aria-label": `
103
- ${x && r.paid},
104
- ${u && r.missed},
105
- ${m && r.upcoming},
106
- ${b && r.income}`,
103
+ ${g && o.paid},
104
+ ${m && o.missed},
105
+ ${d && o.upcoming},
106
+ ${b && o.income}`,
107
107
  day: t,
108
- onClick: () => p(t),
108
+ onClick: () => u(t),
109
109
  outsideCurrentMonth: n,
110
110
  sx: {
111
111
  "&.MuiPickersDay-root": {
@@ -120,12 +120,12 @@ const Q = {
120
120
  }
121
121
  );
122
122
  }
123
- ), Y = ({ icon: t, label: n }) => /* @__PURE__ */ o(l, { alignItems: "center", flexDirection: "row", sx: { gap: 6 }, children: [
123
+ ), $ = ({ icon: t, label: n }) => /* @__PURE__ */ a(l, { alignItems: "center", flexDirection: "row", sx: { gap: 6 }, children: [
124
124
  /* @__PURE__ */ e(t, {}),
125
- /* @__PURE__ */ e(g, { variant: "XSmall", children: n })
126
- ] }), yt = T(() => {
127
- const { recurring: t } = w();
128
- return /* @__PURE__ */ o(
125
+ /* @__PURE__ */ e(h, { variant: "XSmall", children: n })
126
+ ] }), mt = C(() => {
127
+ const { recurring: t } = R();
128
+ return /* @__PURE__ */ a(
129
129
  l,
130
130
  {
131
131
  alignItems: "center",
@@ -135,35 +135,35 @@ const Q = {
135
135
  justifyContent: "center",
136
136
  mt: 12,
137
137
  children: [
138
- /* @__PURE__ */ e(Y, { icon: Ce, label: t.expense }),
139
- /* @__PURE__ */ e(Y, { icon: Re, label: t.income }),
140
- /* @__PURE__ */ e(Y, { icon: Te, label: t.missed }),
141
- /* @__PURE__ */ e(Y, { icon: we, label: t.paid })
138
+ /* @__PURE__ */ e($, { icon: se, label: t.expense }),
139
+ /* @__PURE__ */ e($, { icon: ce, label: t.income }),
140
+ /* @__PURE__ */ e($, { icon: le, label: t.missed }),
141
+ /* @__PURE__ */ e($, { icon: de, label: t.paid })
142
142
  ]
143
143
  }
144
144
  );
145
- }), Le = 58, Be = T(() => {
146
- const t = ge(), { onEvent: n } = J(), { selectedDay: i, setDateRange: r } = I(), [a, c] = f.useState(
147
- Ie(/* @__PURE__ */ new Date()) * z + Le
148
- ), p = (u) => {
149
- c(Ie(u) * z + Le), r({
150
- start: k(u),
151
- end: F(u)
152
- }), h(u), n(_.RECURRING_TRANSACTIONS_CLICK_CALENDAR_RIGHT);
153
- }, h = (u) => {
154
- u && requestAnimationFrame(() => {
155
- const x = document.getElementById("recurrence-list");
156
- x?.setAttribute("tabindex", "-1"), x?.focus();
145
+ }), ye = 58, ve = C(() => {
146
+ const t = te(), { onEvent: n } = z(), { selectedDay: i, setDateRange: o } = _(), [r, c] = x.useState(
147
+ fe(/* @__PURE__ */ new Date()) * O + ye
148
+ ), u = (m) => {
149
+ c(fe(m) * O + ye), o({
150
+ start: G(m),
151
+ end: W(m)
152
+ }), p(m), n(S.RECURRING_TRANSACTIONS_CLICK_CALENDAR_RIGHT);
153
+ }, p = (m) => {
154
+ m && requestAnimationFrame(() => {
155
+ const g = document.getElementById("recurrence-list");
156
+ g?.setAttribute("tabindex", "-1"), g?.focus();
157
157
  });
158
158
  }, s = /* @__PURE__ */ e(
159
- tt,
159
+ Xe,
160
160
  {
161
- minDate: k(/* @__PURE__ */ new Date()),
162
- onChange: h,
163
- onMonthChange: p,
161
+ minDate: G(/* @__PURE__ */ new Date()),
162
+ onChange: p,
163
+ onMonthChange: u,
164
164
  showDaysOutsideCurrentMonth: !0,
165
165
  slots: {
166
- day: xt
166
+ day: ut
167
167
  },
168
168
  sx: {
169
169
  "& .MuiPickersArrowSwitcher-button": {
@@ -189,14 +189,14 @@ const Q = {
189
189
  fontWeight: 600
190
190
  },
191
191
  "& .MuiDayCalendar-slideTransition": {
192
- minHeight: a
192
+ minHeight: r
193
193
  },
194
194
  "&.MuiDateCalendar-root": {
195
- minHeight: a + z
195
+ minHeight: r + O
196
196
  },
197
197
  "& .MuiButtonBase-root, .MuiDayCalendar-weekDayLabel": {
198
- height: z,
199
- width: z,
198
+ height: O,
199
+ width: O,
200
200
  margin: 0
201
201
  },
202
202
  "& .MuiDayCalendar-weekDayLabel": {
@@ -208,7 +208,7 @@ const Q = {
208
208
  views: ["day"]
209
209
  }
210
210
  );
211
- return /* @__PURE__ */ o(
211
+ return /* @__PURE__ */ a(
212
212
  l,
213
213
  {
214
214
  "aria-describedby": "calendar-description",
@@ -233,102 +233,102 @@ const Q = {
233
233
  children: "Calendar filter for recurring transactions list. Filter by month or select specific date."
234
234
  }
235
235
  ),
236
- /* @__PURE__ */ o(nt, { dateAdapter: et, children: [
236
+ /* @__PURE__ */ a(qe, { dateAdapter: Ve, children: [
237
237
  i && s,
238
238
  !i && s,
239
- /* @__PURE__ */ e(yt, {})
239
+ /* @__PURE__ */ e(mt, {})
240
240
  ] })
241
241
  ]
242
242
  }
243
243
  );
244
- }), bt = (t) => {
245
- if (t.type === v.Income)
246
- return /* @__PURE__ */ e(Re, {});
244
+ }), pt = (t) => {
245
+ if (t.type === I.Income)
246
+ return /* @__PURE__ */ e(ce, {});
247
247
  switch (t.status) {
248
- case D.Missed:
249
- return /* @__PURE__ */ e(Te, {});
250
- case D.Paid:
251
- return /* @__PURE__ */ e(we, {});
248
+ case T.Missed:
249
+ return /* @__PURE__ */ e(le, {});
250
+ case T.Paid:
251
+ return /* @__PURE__ */ e(de, {});
252
252
  default:
253
- return /* @__PURE__ */ e(Ce, {});
253
+ return /* @__PURE__ */ e(se, {});
254
254
  }
255
- }, Ct = (t, n) => {
255
+ }, gt = (t, n) => {
256
256
  switch (t.status) {
257
- case D.Paid:
258
- return t.expectedDate ? G(
257
+ case T.Paid:
258
+ return t.expectedDate ? E(
259
259
  n.paid_on,
260
- A(
260
+ v(
261
261
  t.occurredOnDate || t.expectedDate,
262
- E.MONTH_DAY
262
+ L.MONTH_DAY
263
263
  )
264
264
  ) : n.paid;
265
- case D.Missed:
266
- return G(
265
+ case T.Missed:
266
+ return E(
267
267
  n.missed_on,
268
- A(t.expectedDate, E.MONTH_DAY)
268
+ v(t.expectedDate, L.MONTH_DAY)
269
269
  );
270
- case D.Upcoming:
271
- return G(
270
+ case T.Upcoming:
271
+ return E(
272
272
  n.upcoming_on,
273
- A(t.expectedDate, E.MONTH_DAY)
273
+ v(t.expectedDate, L.MONTH_DAY)
274
274
  );
275
275
  default:
276
276
  return n.unknown;
277
277
  }
278
- }, Ae = ({
278
+ }, Ce = ({
279
279
  recurrence: t,
280
280
  isMini: n = !1,
281
281
  onRecurrenceClick: i = () => {
282
282
  },
283
- showOrdinal: r = !1
283
+ showOrdinal: o = !1
284
284
  }) => {
285
- const { recurring: a } = w(), { repeatingTransactions: c } = I(), [p, h] = f.useState(!1), s = f.useMemo(
286
- () => c.find((C) => C.guid === t.repeatingTransactionGuid),
285
+ const { recurring: r } = R(), { detailedRepeatingTransactions: c } = _(), [u, p] = x.useState(!1), s = x.useMemo(
286
+ () => c.find((A) => A.guid === t.repeatingTransactionGuid),
287
287
  [t, c]
288
- ), m = t.type === v.Income, u = t.status === D.Paid, x = t.status === D.Missed, b = t.status === D.Upcoming;
289
- let y = a.paid?.toLowerCase();
290
- return x ? y = a.missed?.toLowerCase() : b && (y = r ? Me(a, s || {}, !0) : Me(a, s || {}, !1)), //TODO: implement common/components/ListItemRow.tsx
291
- /* @__PURE__ */ o(We, { disableGutters: !0, disablePadding: !0, children: [
292
- /* @__PURE__ */ o(ut, { onClick: () => {
293
- h(!0), i(t);
288
+ ), d = t.type === I.Income, m = t.status === T.Paid, g = t.status === T.Missed, b = t.status === T.Upcoming;
289
+ let y = r.paid?.toLowerCase();
290
+ return g ? y = r.missed?.toLowerCase() : b && (y = o ? xe(r, s || {}, !0) : xe(r, s || {}, !1)), //TODO: implement common/components/ListItemRow.tsx
291
+ /* @__PURE__ */ a(Se, { disableGutters: !0, disablePadding: !0, children: [
292
+ /* @__PURE__ */ a(ot, { onClick: () => {
293
+ p(!0), i(t);
294
294
  }, children: [
295
- /* @__PURE__ */ e(dt, { children: /* @__PURE__ */ e(
296
- pe,
295
+ /* @__PURE__ */ e(rt, { children: /* @__PURE__ */ e(
296
+ ee,
297
297
  {
298
298
  categoryGuid: t.categoryGuid,
299
299
  merchantGuid: t.merchantGuid
300
300
  }
301
301
  ) }),
302
- /* @__PURE__ */ e(mt, { children: /* @__PURE__ */ o(
302
+ /* @__PURE__ */ e(at, { children: /* @__PURE__ */ a(
303
303
  l,
304
304
  {
305
305
  direction: "row",
306
306
  gap: 4,
307
307
  sx: { justifyContent: "space-between", textOverflow: "ellipsis", textWrap: "nowrap" },
308
308
  children: [
309
- /* @__PURE__ */ o(l, { direction: "column", width: "50%", children: [
310
- /* @__PURE__ */ e(g, { bold: !0, variant: "body1", children: t.name }),
311
- /* @__PURE__ */ e(l, { alignItems: "center", direction: "row", gap: 6, children: n ? /* @__PURE__ */ o(l, { direction: "row", gap: 4, children: [
312
- bt(t),
313
- /* @__PURE__ */ e(g, { variant: "caption", children: Ct(t, a) })
314
- ] }) : /* @__PURE__ */ o(X, { children: [
309
+ /* @__PURE__ */ a(l, { direction: "column", width: "50%", children: [
310
+ /* @__PURE__ */ e(h, { bold: !0, variant: "body1", children: t.name }),
311
+ /* @__PURE__ */ e(l, { alignItems: "center", direction: "row", gap: 6, children: n ? /* @__PURE__ */ a(l, { direction: "row", gap: 4, children: [
312
+ pt(t),
313
+ /* @__PURE__ */ e(h, { variant: "caption", children: gt(t, r) })
314
+ ] }) : /* @__PURE__ */ a(B, { children: [
315
315
  t.institutionGuid && /* @__PURE__ */ e(
316
- Je,
316
+ Ke,
317
317
  {
318
318
  alt: `${t.institutionName} institution logo`,
319
319
  institutionGuid: t.institutionGuid,
320
320
  size: 12
321
321
  }
322
322
  ),
323
- /* @__PURE__ */ e(g, { sx: { maxWidth: 250 }, variant: "caption", children: t.institutionName })
323
+ /* @__PURE__ */ e(h, { sx: { maxWidth: 250 }, variant: "caption", children: t.institutionName })
324
324
  ] }) })
325
325
  ] }),
326
- /* @__PURE__ */ o(l, { alignItems: "flex-end", width: "100%", children: [
327
- /* @__PURE__ */ o(g, { bold: !0, color: m ? "success.main" : "text.primary", variant: "body1", children: [
328
- m ? "+" : "",
329
- L(t.amount, "0,0.00")
326
+ /* @__PURE__ */ a(l, { alignItems: "flex-end", width: "100%", children: [
327
+ /* @__PURE__ */ a(h, { bold: !0, color: d ? "success.main" : "text.primary", variant: "body1", children: [
328
+ d ? "+" : "",
329
+ M(t.amount, "0,0.00")
330
330
  ] }),
331
- !n && /* @__PURE__ */ o(
331
+ !n && /* @__PURE__ */ a(
332
332
  l,
333
333
  {
334
334
  direction: "row",
@@ -340,9 +340,9 @@ const Q = {
340
340
  width: "100%"
341
341
  },
342
342
  children: [
343
- u && /* @__PURE__ */ e(Oe, { color: "success", filled: !0, size: 12 }),
344
- x && /* @__PURE__ */ e(Ge, { color: "error", filled: !0, size: 12 }),
345
- /* @__PURE__ */ e(g, { bold: !0, color: "text.secondary", variant: "caption", children: y })
343
+ m && /* @__PURE__ */ e(we, { color: "success", filled: !0, size: 12 }),
344
+ g && /* @__PURE__ */ e(De, { color: "error", filled: !0, size: 12 }),
345
+ /* @__PURE__ */ e(h, { bold: !0, color: "text.secondary", variant: "caption", children: y })
346
346
  ]
347
347
  }
348
348
  )
@@ -352,34 +352,34 @@ const Q = {
352
352
  ) })
353
353
  ] }),
354
354
  /* @__PURE__ */ e(
355
- xe,
355
+ ie,
356
356
  {
357
- ariaLabelClose: a.close_drawer_aria,
358
- isOpen: p,
359
- onClose: () => h(!1),
360
- title: t.type === v.Income ? a.income_details : a.expense_details,
357
+ ariaLabelClose: r.close_drawer_aria,
358
+ isOpen: u,
359
+ onClose: () => p(!1),
360
+ title: t.type === I.Income ? r.income_details : r.expense_details,
361
361
  children: s && /* @__PURE__ */ e(
362
- pt,
362
+ st,
363
363
  {
364
- onDeleted: () => h(!1),
364
+ onDeleted: () => p(!1),
365
365
  recurringTransaction: s
366
366
  }
367
367
  )
368
368
  }
369
369
  )
370
370
  ] });
371
- }, H = T(
371
+ }, k = C(
372
372
  ({
373
373
  recurrences: t,
374
374
  isMini: n = !1,
375
375
  onResetClick: i,
376
- onRecurrenceClick: r,
377
- sx: a = {},
376
+ onRecurrenceClick: o,
377
+ sx: r = {},
378
378
  title: c
379
379
  }) => {
380
- const { recurring: p } = w(), h = f.useMemo(() => at(t), [t]);
381
- return /* @__PURE__ */ o(l, { id: "recurrence-list", sx: { gap: 8, mt: 4, ...a }, "tab-index": -1, children: [
382
- c && /* @__PURE__ */ o(
380
+ const { recurring: u } = R(), p = x.useMemo(() => et(t), [t]);
381
+ return /* @__PURE__ */ a(l, { id: "recurrence-list", sx: { gap: 8, mt: 4, ...r }, "tab-index": -1, children: [
382
+ c && /* @__PURE__ */ a(
383
383
  l,
384
384
  {
385
385
  sx: {
@@ -389,208 +389,208 @@ const Q = {
389
389
  px: 24
390
390
  },
391
391
  children: [
392
- /* @__PURE__ */ e(g, { bold: !0, variant: "body1", children: c }),
393
- i && /* @__PURE__ */ e(ct, { onClick: i, size: "small", variant: "text", children: p.reset })
392
+ /* @__PURE__ */ e(h, { bold: !0, variant: "body1", children: c }),
393
+ i && /* @__PURE__ */ e(nt, { onClick: i, size: "small", variant: "text", children: u.reset })
394
394
  ]
395
395
  }
396
396
  ),
397
- t.length === 0 ? /* @__PURE__ */ e(g, { fontStyle: "italic", sx: { py: 24, textAlign: "center" }, children: p.no_activities }) : /* @__PURE__ */ e(ve, { children: n ? t.map((s, m) => /* @__PURE__ */ o(f.Fragment, { children: [
397
+ t.length === 0 ? /* @__PURE__ */ e(h, { fontStyle: "italic", sx: { py: 24, textAlign: "center" }, children: u.no_activities }) : /* @__PURE__ */ e(be, { children: n ? t.map((s, d) => /* @__PURE__ */ a(x.Fragment, { children: [
398
398
  /* @__PURE__ */ e(
399
- Ae,
399
+ Ce,
400
400
  {
401
401
  isMini: n,
402
- onRecurrenceClick: r,
402
+ onRecurrenceClick: o,
403
403
  recurrence: s
404
404
  }
405
405
  ),
406
- /* @__PURE__ */ e(le, { sx: { mx: 24 } })
407
- ] }, `recurrence-${m}`)) : h.map((s, m) => /* @__PURE__ */ o(f.Fragment, { children: [
408
- /* @__PURE__ */ e(We, { children: /* @__PURE__ */ e(
409
- ve,
406
+ /* @__PURE__ */ e(q, { sx: { mx: 24 } })
407
+ ] }, `recurrence-${d}`)) : p.map((s, d) => /* @__PURE__ */ a(x.Fragment, { children: [
408
+ /* @__PURE__ */ e(Se, { children: /* @__PURE__ */ e(
409
+ be,
410
410
  {
411
- subheader: /* @__PURE__ */ e(lt, { sx: { bgcolor: "background.paper", ml: 8, pb: 4, pt: 12 }, children: /* @__PURE__ */ e(g, { bold: !0, variant: "caption", children: A(s.date, E.DAY_OF_WEEK_MONTH_DAY) }) }),
411
+ subheader: /* @__PURE__ */ e(it, { sx: { bgcolor: "background.paper", ml: 8, pb: 4, pt: 12 }, children: /* @__PURE__ */ e(h, { bold: !0, variant: "caption", children: v(s.date, L.DAY_OF_WEEK_MONTH_DAY) }) }),
412
412
  sx: { width: "100%" },
413
- children: s.recurrences.map((u, x) => /* @__PURE__ */ e(f.Fragment, { children: /* @__PURE__ */ e(
414
- Ae,
413
+ children: s.recurrences.map((m, g) => /* @__PURE__ */ e(x.Fragment, { children: /* @__PURE__ */ e(
414
+ Ce,
415
415
  {
416
416
  isMini: n,
417
- onRecurrenceClick: r,
418
- recurrence: u
417
+ onRecurrenceClick: o,
418
+ recurrence: m
419
419
  }
420
- ) }, `day-recurrence-${x}`))
420
+ ) }, `day-recurrence-${g}`))
421
421
  }
422
422
  ) }, s.id),
423
- /* @__PURE__ */ e(le, { sx: { mx: 24 } })
424
- ] }, `recurrence-${m}`)) })
423
+ /* @__PURE__ */ e(q, { sx: { mx: 24 } })
424
+ ] }, `recurrence-${d}`)) })
425
425
  ] });
426
426
  }
427
- ), Ee = T(
428
- ({ expected: t, isExpense: n = !0, missed: i, paid: r, title: a, total: c, upcoming: p }) => {
429
- const h = ge(), { isSmallMobile: s } = ye(), { recurring: m } = w(), u = f.useMemo(() => {
430
- const x = [{ color: h.palette.success.main, percentage: `${r / t}` }];
431
- return i && x.push({ color: h.palette.error.main, percentage: `${i / t}` }), x;
432
- }, [r, t, i]);
433
- return /* @__PURE__ */ o(l, { children: [
434
- /* @__PURE__ */ o(l, { sx: { flexDirection: "row", justifyContent: "space-between", pb: 12 }, children: [
435
- /* @__PURE__ */ e(g, { bold: !0, variant: "body1", children: `${a} (${c})` }),
436
- /* @__PURE__ */ e(g, { bold: !0, color: n ? "text.primary" : "success.main", variant: "body1", children: `${n ? "-" : "+"}${L(t, "0,0.00")}` })
427
+ ), Re = C(
428
+ ({ expected: t, isExpense: n = !0, missed: i, paid: o, title: r, total: c, upcoming: u }) => {
429
+ const p = te(), { isSmallMobile: s } = re(), { recurring: d } = R(), m = x.useMemo(() => {
430
+ const g = [{ color: p.palette.success.main, percentage: `${o / t}` }];
431
+ return i && g.push({ color: p.palette.error.main, percentage: `${i / t}` }), g;
432
+ }, [o, t, i]);
433
+ return /* @__PURE__ */ a(l, { children: [
434
+ /* @__PURE__ */ a(l, { sx: { flexDirection: "row", justifyContent: "space-between", pb: 12 }, children: [
435
+ /* @__PURE__ */ e(h, { bold: !0, variant: "body1", children: `${r} (${c})` }),
436
+ /* @__PURE__ */ e(h, { bold: !0, color: n ? "text.primary" : "success.main", variant: "body1", children: `${n ? "-" : "+"}${M(t, "0,0.00")}` })
437
437
  ] }),
438
- /* @__PURE__ */ e($e, { data: u, height: 12 }),
439
- /* @__PURE__ */ o(l, { sx: { alignItems: "center", flexDirection: "row", gap: 2, my: 8 }, children: [
440
- /* @__PURE__ */ e(O, { sx: { bgcolor: "success.main", height: 8, mr: 8, width: 8 } }),
441
- !s && /* @__PURE__ */ e(g, { bold: !0, variant: "body2", children: L(r, "0,0.00") }),
442
- /* @__PURE__ */ e(g, { variant: "caption", children: m.paid?.toLowerCase() }),
443
- i !== void 0 && /* @__PURE__ */ o(X, { children: [
444
- /* @__PURE__ */ e(O, { sx: { bgcolor: "error.main", height: 8, ml: 16, mr: 8, width: 8 } }),
445
- !s && /* @__PURE__ */ e(g, { bold: !0, variant: "body2", children: L(i, "0,0.00") }),
446
- /* @__PURE__ */ e(g, { variant: "caption", children: m.missed?.toLowerCase() })
438
+ /* @__PURE__ */ e(Ie, { data: m, height: 12 }),
439
+ /* @__PURE__ */ a(l, { sx: { alignItems: "center", flexDirection: "row", gap: 2, my: 8 }, children: [
440
+ /* @__PURE__ */ e(N, { sx: { bgcolor: "success.main", height: 8, mr: 8, width: 8 } }),
441
+ !s && /* @__PURE__ */ e(h, { bold: !0, variant: "body2", children: M(o, "0,0.00") }),
442
+ /* @__PURE__ */ e(h, { variant: "caption", children: d.paid?.toLowerCase() }),
443
+ i !== void 0 && /* @__PURE__ */ a(B, { children: [
444
+ /* @__PURE__ */ e(N, { sx: { bgcolor: "error.main", height: 8, ml: 16, mr: 8, width: 8 } }),
445
+ !s && /* @__PURE__ */ e(h, { bold: !0, variant: "body2", children: M(i, "0,0.00") }),
446
+ /* @__PURE__ */ e(h, { variant: "caption", children: d.missed?.toLowerCase() })
447
447
  ] }),
448
- /* @__PURE__ */ e(O, { sx: { bgcolor: "divider", height: 8, ml: 16, mr: 8, width: 8 } }),
449
- !s && /* @__PURE__ */ e(g, { bold: !0, variant: "body2", children: L(p, "0,0.00") }),
450
- /* @__PURE__ */ e(g, { variant: "caption", children: m.upcoming })
448
+ /* @__PURE__ */ e(N, { sx: { bgcolor: "divider", height: 8, ml: 16, mr: 8, width: 8 } }),
449
+ !s && /* @__PURE__ */ e(h, { bold: !0, variant: "body2", children: M(u, "0,0.00") }),
450
+ /* @__PURE__ */ e(h, { variant: "caption", children: d.upcoming })
451
451
  ] })
452
452
  ] });
453
453
  }
454
- ), Rt = T(() => {
455
- const { recurring: t } = w(), { availableWidth: n } = ke(), { isDesktop: i, isSmallMobile: r, isMobile: a } = ye(n), { onEvent: c } = J(), {
456
- currentMonthExpenses: p,
457
- currentMonthIncome: h,
454
+ ), ht = C(() => {
455
+ const { recurring: t } = R(), { availableWidth: n } = _e(), { isDesktop: i, isSmallMobile: o, isMobile: r } = re(n), { onEvent: c } = z(), {
456
+ currentMonthExpenses: u,
457
+ currentMonthIncome: p,
458
458
  dateRange: s,
459
- expenseTotal: m,
460
- incomeTotal: u,
461
- missedExpenseTotal: x,
459
+ expenseTotal: d,
460
+ incomeTotal: m,
461
+ missedExpenseTotal: g,
462
462
  pastRecurrences: b,
463
463
  paidExpenseTotal: y,
464
- paidIncomeTotal: d,
465
- selectedDay: C,
466
- selectedDayRecurrences: W,
467
- setDateRange: U,
468
- upcomingExpenseTotal: te,
469
- upcomingIncomeTotal: ne,
470
- upcomingRecurrences: $
471
- } = I(), [B, S] = f.useState(0), ie = je(s.start, /* @__PURE__ */ new Date()), M = (R, oe) => {
472
- S(oe);
473
- }, j = (R) => {
474
- c(_.RECURRING_TRANSACTIONS_CLICK_UPCOMING, {
475
- transaction_guid: R.transaction?.guid
464
+ paidIncomeTotal: f,
465
+ selectedDay: A,
466
+ selectedDayRecurrences: j,
467
+ setDateRange: w,
468
+ upcomingExpenseTotal: K,
469
+ upcomingIncomeTotal: Le,
470
+ upcomingRecurrences: ue
471
+ } = _(), [Y, Ae] = x.useState(0), Ee = Be(s.start, /* @__PURE__ */ new Date()), Ne = (D, ke) => {
472
+ Ae(ke);
473
+ }, me = (D) => {
474
+ c(S.RECURRING_TRANSACTIONS_CLICK_UPCOMING, {
475
+ transaction_guid: D.transaction?.guid
476
476
  });
477
- }, K = (R) => {
478
- c(_.RECURRING_TRANSACTIONS_CLICK_PAID, {
479
- transaction_guid: R.transaction?.guid
477
+ }, pe = (D) => {
478
+ c(S.RECURRING_TRANSACTIONS_CLICK_PAID, {
479
+ transaction_guid: D.transaction?.guid
480
480
  });
481
- }, P = () => {
482
- const R = Fe(s.start, 1);
483
- U({
484
- start: k(R),
485
- end: F(R)
481
+ }, Ge = () => {
482
+ const D = We(s.start, 1);
483
+ w({
484
+ start: G(D),
485
+ end: W(D)
486
486
  });
487
- }, re = () => {
488
- const R = Ue(s.start, 1);
489
- U({
490
- start: k(R),
491
- end: F(R)
487
+ }, Oe = () => {
488
+ const D = $e(s.start, 1);
489
+ w({
490
+ start: G(D),
491
+ end: W(D)
492
492
  });
493
493
  };
494
- return /* @__PURE__ */ o(
495
- se,
494
+ return /* @__PURE__ */ a(
495
+ V,
496
496
  {
497
497
  container: !0,
498
498
  sx: {
499
499
  pt: 16
500
500
  },
501
501
  children: [
502
- /* @__PURE__ */ o(se, { md: !0, sm: 12, width: "100%", children: [
503
- /* @__PURE__ */ o(l, { sx: { gap: 16, px: i ? 48 : 24 }, children: [
504
- /* @__PURE__ */ o(l, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
505
- /* @__PURE__ */ e(Qe, { children: G(
502
+ /* @__PURE__ */ a(V, { md: !0, sm: 12, width: "100%", children: [
503
+ /* @__PURE__ */ a(l, { sx: { gap: 16, px: i ? 48 : 24 }, children: [
504
+ /* @__PURE__ */ a(l, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
505
+ /* @__PURE__ */ e(Ye, { children: E(
506
506
  t.header_title,
507
- A(s.start, E.MONTH_LONG)
507
+ v(s.start, L.MONTH_LONG)
508
508
  ) }),
509
- !i && /* @__PURE__ */ o(l, { direction: "row", gap: 4, children: [
509
+ !i && /* @__PURE__ */ a(l, { direction: "row", gap: 4, children: [
510
510
  /* @__PURE__ */ e(
511
- Se,
511
+ ge,
512
512
  {
513
513
  color: "primary",
514
- disabled: ie,
515
- onClick: re,
516
- children: /* @__PURE__ */ e(Xe, {})
514
+ disabled: Ee,
515
+ onClick: Oe,
516
+ children: /* @__PURE__ */ e(Fe, {})
517
517
  }
518
518
  ),
519
- /* @__PURE__ */ e(Se, { color: "primary", onClick: P, children: /* @__PURE__ */ e(qe, {}) })
519
+ /* @__PURE__ */ e(ge, { color: "primary", onClick: Ge, children: /* @__PURE__ */ e(Ue, {}) })
520
520
  ] })
521
521
  ] }),
522
522
  /* @__PURE__ */ e(
523
- Ee,
523
+ Re,
524
524
  {
525
- expected: m,
526
- missed: x,
525
+ expected: d,
526
+ missed: g,
527
527
  paid: y,
528
528
  title: t.expenses,
529
- total: p.length,
530
- upcoming: te
529
+ total: u.length,
530
+ upcoming: K
531
531
  }
532
532
  ),
533
533
  /* @__PURE__ */ e(
534
- Ee,
534
+ Re,
535
535
  {
536
- expected: u,
536
+ expected: m,
537
537
  isExpense: !1,
538
- paid: d,
538
+ paid: f,
539
539
  title: t.deposits,
540
- total: h.length,
541
- upcoming: ne
540
+ total: p.length,
541
+ upcoming: Le
542
542
  }
543
543
  ),
544
544
  i && /* @__PURE__ */ e(
545
- H,
545
+ k,
546
546
  {
547
- onRecurrenceClick: j,
548
- recurrences: $,
547
+ onRecurrenceClick: me,
548
+ recurrences: ue,
549
549
  title: t.upcoming_activity
550
550
  }
551
551
  )
552
552
  ] }),
553
- !i && /* @__PURE__ */ o(l, { sx: { px: a ? 0 : 24 }, children: [
554
- /* @__PURE__ */ o(Ke, { onChange: M, value: B, variant: "fullWidth", children: [
553
+ !i && /* @__PURE__ */ a(l, { sx: { px: r ? 0 : 24 }, children: [
554
+ /* @__PURE__ */ a(Pe, { onChange: Ne, value: Y, variant: "fullWidth", children: [
555
555
  /* @__PURE__ */ e(
556
- _e,
556
+ he,
557
557
  {
558
- label: /* @__PURE__ */ e(g, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: r ? t.upcoming : t.upcoming_activity })
558
+ label: /* @__PURE__ */ e(h, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: o ? t.upcoming : t.upcoming_activity })
559
559
  }
560
560
  ),
561
561
  /* @__PURE__ */ e(
562
- _e,
562
+ he,
563
563
  {
564
- label: /* @__PURE__ */ e(g, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: r ? t.past : t.past_transactions })
564
+ label: /* @__PURE__ */ e(h, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: o ? t.past : t.past_transactions })
565
565
  }
566
566
  )
567
567
  ] }),
568
- B === 0 && /* @__PURE__ */ e(
569
- H,
568
+ Y === 0 && /* @__PURE__ */ e(
569
+ k,
570
570
  {
571
- onRecurrenceClick: j,
572
- recurrences: $
571
+ onRecurrenceClick: me,
572
+ recurrences: ue
573
573
  }
574
574
  ),
575
- B === 1 && /* @__PURE__ */ e(
576
- H,
575
+ Y === 1 && /* @__PURE__ */ e(
576
+ k,
577
577
  {
578
- onRecurrenceClick: K,
578
+ onRecurrenceClick: pe,
579
579
  recurrences: b
580
580
  }
581
581
  )
582
582
  ] })
583
583
  ] }),
584
- i && /* @__PURE__ */ e(se, { sx: { minWidth: 450 }, xs: "auto", children: /* @__PURE__ */ o(l, { gap: 24, children: [
585
- /* @__PURE__ */ e(Be, {}),
584
+ i && /* @__PURE__ */ e(V, { sx: { minWidth: 450 }, xs: "auto", children: /* @__PURE__ */ a(l, { gap: 24, children: [
585
+ /* @__PURE__ */ e(ve, {}),
586
586
  /* @__PURE__ */ e(
587
- H,
587
+ k,
588
588
  {
589
- onRecurrenceClick: K,
590
- recurrences: W || b,
591
- title: C ? G(
589
+ onRecurrenceClick: pe,
590
+ recurrences: j || b,
591
+ title: A ? E(
592
592
  t.day_transactions,
593
- A(C, E.MONTH_DAY)
593
+ v(A, L.MONTH_DAY)
594
594
  ) : t.past_transactions
595
595
  }
596
596
  )
@@ -598,359 +598,340 @@ const Q = {
598
598
  ]
599
599
  }
600
600
  );
601
- }), Mn = T(({ onBackClick: t, sx: n = {} }) => {
602
- const { accounts: i } = he(), { recurring: r } = w(), { isCopyLoaded: a, isInitialized: c, selectedAccountGuids: p, setSelectedAccounts: h } = Z(), { isDataLoaded: s, loadRepeatingTransactions: m, setDateRange: u } = I(), { setFilter: x } = fe(), { onEvent: b } = J(), { isMobile: y } = ye(), [d, C] = f.useState(!1);
603
- return be({
601
+ }), Dn = C(({ onBackClick: t, sx: n = {} }) => {
602
+ const { recurring: i } = R(), { isInitialized: o, selectedAccountGuids: r } = H(), { isDataLoaded: c, loadRepeatingTransactionData: u, setDateRange: p } = _(), { setFilter: s } = ne(), { onEvent: d } = z(), { isMobile: m } = re(), [g, b] = x.useState(!1);
603
+ return oe({
604
604
  widgetName: "RecurringTransactionsWidget",
605
- isLoaded: s
606
- }), f.useEffect(() => {
607
- h(i);
608
- }, [i]), f.useEffect(() => {
609
- c && (x({
610
- dateRange: { start: me(ue(), 90), end: de() },
611
- accounts: p
612
- }), u({ start: k(/* @__PURE__ */ new Date()), end: F(/* @__PURE__ */ new Date()) }), m().finally());
613
- }, [c]), a ? /* @__PURE__ */ o(
614
- st,
605
+ isLoaded: c
606
+ }), x.useEffect(() => {
607
+ c || u().finally();
608
+ }, []), x.useEffect(() => {
609
+ s({
610
+ dateRange: { start: Q(J(), 90), end: Z() },
611
+ accounts: r
612
+ }), p({ start: G(/* @__PURE__ */ new Date()), end: W(/* @__PURE__ */ new Date()) });
613
+ }, [r]), o ? /* @__PURE__ */ a(
614
+ tt,
615
615
  {
616
- accountOptions: i,
617
616
  actions: [
618
617
  {
619
- label: r.action_title,
618
+ label: i.action_title,
620
619
  iconName: "credit_card_gear",
621
620
  onClick: () => {
622
- C(!0), b(_.RECURRING_TRANSACTIONS_CLICK_SETTINGS);
621
+ b(!0), d(S.RECURRING_TRANSACTIONS_CLICK_SETTINGS);
623
622
  }
624
623
  }
625
624
  ],
626
- hasDivider: y,
627
- onAccountsFilterClick: () => b(_.RECURRING_TRANSACTIONS_CLICK_FILTER),
625
+ hasDivider: m,
626
+ onAccountsFilterClick: () => d(S.RECURRING_TRANSACTIONS_CLICK_FILTER),
628
627
  onBackClick: t,
629
628
  sx: n,
630
- title: r.title,
629
+ title: i.title,
631
630
  children: [
632
- c && s ? /* @__PURE__ */ e(Rt, {}) : /* @__PURE__ */ o(l, { direction: "column", p: 48, spacing: 24, children: [
633
- /* @__PURE__ */ e(ae, { height: 100, variant: "rounded", width: "100%" }),
634
- /* @__PURE__ */ e(ae, { height: 100, variant: "rounded", width: "100%" }),
635
- /* @__PURE__ */ e(ae, { height: 600, variant: "rounded", width: "100%" })
636
- ] }),
631
+ c ? /* @__PURE__ */ e(ht, {}) : /* @__PURE__ */ e(Me, { sx: { m: 48 }, variant: "list" }),
637
632
  /* @__PURE__ */ e(
638
- xe,
633
+ ie,
639
634
  {
640
- ariaLabelClose: r.close_drawer_aria,
641
- isOpen: d,
642
- onClose: () => C(!1),
635
+ ariaLabelClose: i.close_drawer_aria,
636
+ isOpen: g,
637
+ onClose: () => b(!1),
643
638
  shouldShowHeaderBorders: !1,
644
- title: r.action_title,
645
- children: /* @__PURE__ */ e(Ne, {})
639
+ title: i.action_title,
640
+ children: /* @__PURE__ */ e(Te, {})
646
641
  }
647
642
  )
648
643
  ]
649
644
  }
650
- ) : /* @__PURE__ */ e(V, {});
651
- }), Tt = T(() => {
652
- const { recurring: t } = w(), { availableWidth: n } = ke(), { selectedDay: i, selectedDayRecurrences: r, setSelectedDay: a, upcomingRecurrences: c } = I(), p = n < 750;
653
- return /* @__PURE__ */ o(l, { flexDirection: p ? "column" : "row", width: "100%", children: [
654
- /* @__PURE__ */ e(Be, {}),
655
- !p && /* @__PURE__ */ e(le, { flexItem: !0, orientation: "vertical", sx: { my: 16, ml: 16 } }),
645
+ ) : /* @__PURE__ */ e(ae, {});
646
+ }), ft = C(() => {
647
+ const { recurring: t } = R(), { availableWidth: n } = _e(), { selectedDay: i, selectedDayRecurrences: o, setSelectedDay: r, upcomingRecurrences: c } = _(), u = n < 750;
648
+ return /* @__PURE__ */ a(l, { flexDirection: u ? "column" : "row", width: "100%", children: [
649
+ /* @__PURE__ */ e(ve, {}),
650
+ !u && /* @__PURE__ */ e(q, { flexItem: !0, orientation: "vertical", sx: { my: 16, ml: 16 } }),
656
651
  /* @__PURE__ */ e(
657
- H,
652
+ k,
658
653
  {
659
654
  isMini: !0,
660
- onResetClick: i ? () => a(i) : void 0,
661
- recurrences: r || c.slice(0, 5),
662
- sx: { width: p ? "100%" : "calc(100% - 336px)", mt: 12 },
663
- title: i ? G(
655
+ onResetClick: i ? () => r(i) : void 0,
656
+ recurrences: o || c.slice(0, 5),
657
+ sx: { width: u ? "100%" : "calc(100% - 336px)", mt: 12 },
658
+ title: i ? E(
664
659
  t.day_transactions,
665
- A(i, E.MONTH_DAY)
660
+ v(i, L.MONTH_DAY)
666
661
  ) : t.upcoming_activity
667
662
  }
668
663
  )
669
664
  ] });
670
- }), vn = T(
665
+ }), wn = C(
671
666
  ({ onPrimaryCtaClick: t, sx: n }) => {
672
- const { accounts: i } = he(), { recurring: r } = w(), { setFilter: a } = fe(), { isDataLoaded: c, loadRepeatingTransactions: p } = I(), { isCopyLoaded: h, isInitialized: s, setSelectedAccounts: m, selectedAccountGuids: u } = Z();
673
- return be({
667
+ const { recurring: i } = R(), { setFilter: o } = ne(), { isDataLoaded: r, loadRepeatingTransactionData: c } = _(), { isInitialized: u, selectedAccountGuids: p } = H();
668
+ return oe({
674
669
  widgetName: "RecurringTransactionsMiniWidget",
675
- isLoaded: c
676
- }), f.useEffect(() => {
677
- s && m(i);
678
- }, [s]), f.useEffect(() => {
679
- u.length > 0 && (a({
680
- dateRange: { start: me(ue(), 90), end: de() },
681
- accounts: u
682
- }), p().finally());
683
- }, [u]), !h || !s ? /* @__PURE__ */ e(V, {}) : /* @__PURE__ */ e(
684
- gt,
670
+ isLoaded: r
671
+ }), x.useEffect(() => {
672
+ r || c().finally();
673
+ }, []), x.useEffect(() => {
674
+ p.length > 0 && o({
675
+ dateRange: { start: Q(J(), 90), end: Z() },
676
+ accounts: p
677
+ });
678
+ }, [p]), u ? /* @__PURE__ */ e(
679
+ ct,
685
680
  {
686
681
  className: "mx-exp-recurring-transactions-miniwidget",
687
682
  onPrimaryCtaClick: t,
688
- primaryCtaLabel: r.primary_cta,
689
- subTitle: r.sub_title,
683
+ primaryCtaLabel: i.primary_cta,
684
+ subTitle: i.sub_title,
690
685
  sx: n,
691
- title: r.mini_title,
692
- children: c ? /* @__PURE__ */ e(Tt, {}) : /* @__PURE__ */ e(V, {})
686
+ title: i.mini_title,
687
+ children: r ? /* @__PURE__ */ e(ft, {}) : /* @__PURE__ */ e(Me, { sx: { mx: 16 }, variant: "list" })
693
688
  }
694
- );
689
+ ) : /* @__PURE__ */ e(ae, {});
695
690
  }
696
- ), wt = ({
697
- upcomingRecurrences: t,
698
- maxLogos: n = 3
699
- }) => /* @__PURE__ */ e(l, { sx: { flexDirection: "row", gap: 4 }, children: t?.slice(0, n).map((i, r) => /* @__PURE__ */ e(
700
- pe,
701
- {
702
- categoryGuid: i.categoryGuid || "",
703
- merchantGuid: i.merchantGuid || ""
704
- },
705
- `${i.categoryGuid}-${i.merchantGuid}-${r}`
706
- )) }), Dt = ({
691
+ ), xt = C(() => {
692
+ const { recurring: t } = R();
693
+ return /* @__PURE__ */ a(l, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
694
+ /* @__PURE__ */ e(je, { size: 32 }),
695
+ /* @__PURE__ */ a(l, { children: [
696
+ /* @__PURE__ */ e(X, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
697
+ /* @__PURE__ */ e(X, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
698
+ ] })
699
+ ] });
700
+ }), bt = ({
701
+ amount: t,
702
+ bgcolor: n,
703
+ isLargeScreen: i,
704
+ isSmallScreen: o,
705
+ label: r
706
+ }) => /* @__PURE__ */ a(l, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
707
+ /* @__PURE__ */ e(
708
+ N,
709
+ {
710
+ sx: {
711
+ borderRadius: "2px",
712
+ bgcolor: n,
713
+ height: 8,
714
+ width: 8
715
+ }
716
+ }
717
+ ),
718
+ /* @__PURE__ */ a(l, { sx: { alignItems: "center", flexDirection: "row", gap: 2 }, children: [
719
+ !o && /* @__PURE__ */ e(h, { bold: !0, variant: "caption", children: M(t, t === 0 || !i ? "0,0" : "0,0.00") }),
720
+ /* @__PURE__ */ e(h, { variant: "caption", children: r })
721
+ ] })
722
+ ] }), yt = ({
707
723
  upcomingRecurrences: t,
708
724
  logoSize: n = 32,
709
725
  maxLogos: i = 3
710
726
  }) => {
711
- const r = (a) => a * (n / 2);
727
+ const o = (r) => r * (n / 2);
712
728
  return /* @__PURE__ */ e(
713
- O,
729
+ N,
714
730
  {
715
731
  sx: {
716
732
  position: "relative",
717
733
  width: 64
718
734
  },
719
- children: t.map((a, c) => c < i ? /* @__PURE__ */ e(
720
- O,
735
+ children: t.map((r, c) => c < i ? /* @__PURE__ */ e(
736
+ N,
721
737
  {
722
738
  sx: {
723
739
  borderRadius: "4px",
724
- left: r(c),
740
+ left: o(c),
725
741
  outlineColor: "common.white",
726
742
  outlineStyle: "solid",
727
743
  outlineWidth: 2,
728
744
  position: "absolute"
729
745
  },
730
746
  children: /* @__PURE__ */ e(
731
- pe,
747
+ ee,
732
748
  {
733
- categoryGuid: a.categoryGuid || "",
734
- merchantGuid: a.merchantGuid || "",
749
+ categoryGuid: r.categoryGuid || "",
750
+ merchantGuid: r.merchantGuid || "",
735
751
  size: n
736
752
  }
737
753
  )
738
754
  },
739
- `${a.categoryGuid}-${a.merchantGuid}-${c}`
755
+ `${r.categoryGuid}-${r.merchantGuid}-${c}`
740
756
  ) : null)
741
757
  }
742
758
  );
743
- }, St = ({
744
- amount: t,
745
- bgcolor: n,
746
- isLargeScreen: i,
747
- isSmallScreen: r,
748
- label: a
749
- }) => /* @__PURE__ */ o(l, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
750
- /* @__PURE__ */ e(
751
- O,
759
+ }, Ct = ({
760
+ upcomingRecurrences: t,
761
+ maxLogos: n = 3
762
+ }) => /* @__PURE__ */ e(l, { sx: { flexDirection: "row", gap: 4 }, children: t?.slice(0, n).map((i, o) => /* @__PURE__ */ e(
763
+ ee,
764
+ {
765
+ categoryGuid: i.categoryGuid || "",
766
+ merchantGuid: i.merchantGuid || ""
767
+ },
768
+ `${i.categoryGuid}-${i.merchantGuid}-${o}`
769
+ )) }), Rt = C(() => {
770
+ const t = te(), [n, { width: i }] = lt(), {
771
+ upcomingRecurrences: o,
772
+ expenseTotal: r,
773
+ missedExpenseTotal: c,
774
+ paidExpenseTotal: u,
775
+ upcomingExpenseTotal: p
776
+ } = _(), { recurring: s } = R(), d = i <= 288, m = i >= 450, g = 32, b = o.length > 0, y = x.useMemo(() => M(r, r === 0 ? "0,0" : "0,0.00"), [r]), f = x.useMemo(() => {
777
+ const w = [
778
+ { color: t.palette.success.main, percentage: `${u / r}` }
779
+ ];
780
+ return c && w.push({
781
+ color: t.palette.error.main,
782
+ percentage: `${c / r}`
783
+ }), w;
784
+ }, [
785
+ u,
786
+ r,
787
+ c,
788
+ t.palette.success.main,
789
+ t.palette.error.main
790
+ ]), A = () => b ? d ? /* @__PURE__ */ e(
791
+ yt,
752
792
  {
753
- sx: {
754
- borderRadius: "2px",
755
- bgcolor: n,
756
- height: 8,
757
- width: 8
758
- }
793
+ logoSize: g,
794
+ maxLogos: 3,
795
+ upcomingRecurrences: o.slice(0, 3)
759
796
  }
760
- ),
761
- /* @__PURE__ */ o(l, { sx: { alignItems: "center", flexDirection: "row", gap: 2 }, children: [
762
- !r && /* @__PURE__ */ e(g, { bold: !0, variant: "caption", children: L(t, t === 0 || !i ? "0,0" : "0,0.00") }),
763
- /* @__PURE__ */ e(g, { variant: "caption", children: a })
764
- ] })
765
- ] }), _t = T(() => {
766
- const { recurring: t } = w();
767
- return /* @__PURE__ */ o(l, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
768
- /* @__PURE__ */ e(Ze, { size: 32 }),
769
- /* @__PURE__ */ o(l, { children: [
770
- /* @__PURE__ */ e(ce, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
771
- /* @__PURE__ */ e(ce, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
797
+ ) : /* @__PURE__ */ e(Ct, { maxLogos: 3, upcomingRecurrences: o.slice(0, 3) }) : /* @__PURE__ */ e(l, { sx: { width: d ? 64 : 104 } }), j = [
798
+ {
799
+ amount: u,
800
+ bgColor: "success.main",
801
+ label: s.paid
802
+ },
803
+ {
804
+ amount: c,
805
+ bgColor: "error.main",
806
+ label: s.missed
807
+ },
808
+ {
809
+ amount: p,
810
+ bgColor: "border.light",
811
+ label: s.upcoming
812
+ }
813
+ ];
814
+ return /* @__PURE__ */ a(B, { children: [
815
+ /* @__PURE__ */ a(l, { ref: n, sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
816
+ /* @__PURE__ */ a(
817
+ l,
818
+ {
819
+ sx: [
820
+ y.length >= 10 && d ? { flexDirection: "column" } : { flexDirection: "row", gap: 2 },
821
+ {
822
+ alignItems: "baseline",
823
+ overflow: "hidden",
824
+ textOverflow: "ellipsis",
825
+ whiteSpace: "nowrap"
826
+ }
827
+ ],
828
+ children: [
829
+ /* @__PURE__ */ e(
830
+ h,
831
+ {
832
+ sx: { width: "100%" },
833
+ variant: y.length >= 10 && d ? "H3" : "H2",
834
+ children: y
835
+ }
836
+ ),
837
+ /* @__PURE__ */ e(X, { sx: { pr: 12 }, variant: "XSmall", children: s.expected })
838
+ ]
839
+ }
840
+ ),
841
+ A()
842
+ ] }),
843
+ /* @__PURE__ */ a(l, { sx: { pt: 12 }, children: [
844
+ /* @__PURE__ */ e(Ie, { data: f }),
845
+ /* @__PURE__ */ e(
846
+ l,
847
+ {
848
+ sx: {
849
+ alignItems: "center",
850
+ flexDirection: "row",
851
+ gap: 16,
852
+ mt: 4
853
+ },
854
+ children: j.map((w, K) => /* @__PURE__ */ e(
855
+ bt,
856
+ {
857
+ amount: w.amount,
858
+ bgcolor: w.bgColor,
859
+ isLargeScreen: m,
860
+ isSmallScreen: d,
861
+ label: w.label
862
+ },
863
+ `recurrence-legend-${K}`
864
+ ))
865
+ }
866
+ )
772
867
  ] })
773
868
  ] });
774
- }), Ln = T(
869
+ }), _n = C(
775
870
  ({ onCTAClick: t }) => {
776
- const [n, i] = f.useState(!1), { onEvent: r } = J(), a = ge(), { accounts: c } = he(), [p, { width: h }] = ht(), { isCopyLoaded: s, isInitialized: m, selectedAccountGuids: u, setSelectedAccounts: x } = Z(), {
777
- loadRepeatingTransactions: b,
778
- upcomingRecurrences: y,
779
- expenseTotal: d,
780
- missedExpenseTotal: C,
781
- paidExpenseTotal: W,
782
- repeatingTransactions: U,
783
- setDateRange: te,
784
- upcomingExpenseTotal: ne,
785
- isDataLoaded: $
786
- } = I(), { setFilter: B } = fe(), { recurring: S, budgets: ie } = w();
787
- be({
871
+ const { onEvent: n } = z(), { isInitialized: i, selectedAccountGuids: o } = H(), {
872
+ loadRepeatingTransactionData: r,
873
+ upcomingRecurrences: c,
874
+ repeatingTransactions: u,
875
+ setDateRange: p,
876
+ isDataLoaded: s
877
+ } = _(), { setFilter: d } = ne(), { recurring: m, budgets: g } = R();
878
+ oe({
788
879
  widgetName: "RecurringTransactionsMicroWidget",
789
- isLoaded: $
790
- }), f.useEffect(() => {
791
- x(c);
792
- }, [c]), f.useEffect(() => {
793
- m && (B({
794
- dateRange: { start: me(ue(), 90), end: de() },
795
- accounts: u
796
- }), te({ start: k(/* @__PURE__ */ new Date()), end: F(/* @__PURE__ */ new Date()) }), b().finally(), i(!0));
797
- }, [m]), f.useEffect(() => {
798
- n && r(_.RECURRING_TRANSACTIONS_LOAD_WIDGET, {
799
- state: y.length > 0 ? "default" : "zeroState"
880
+ isLoaded: s
881
+ }), x.useEffect(() => {
882
+ s || r().finally(() => {
883
+ n(S.RECURRING_TRANSACTIONS_LOAD_WIDGET, {
884
+ state: c.length > 0 ? "default" : "zeroState"
885
+ });
800
886
  });
801
- }, [n]);
802
- const M = h <= 288, j = h >= 450, K = f.useMemo(() => {
803
- const N = [
804
- { color: a.palette.success.main, percentage: `${W / d}` }
805
- ];
806
- return C && N.push({
807
- color: a.palette.error.main,
808
- percentage: `${C / d}`
809
- }), N;
810
- }, [
811
- W,
812
- d,
813
- C,
814
- a.palette.success.main,
815
- a.palette.error.main
816
- ]), P = f.useMemo(() => L(d, d === 0 ? "0,0" : "0,0.00"), [d]), re = () => {
817
- r(
818
- y.length > 0 ? _.RECURRING_TRANSACTIONS_CLICK_GET_STARTED : _.RECURRING_TRANSACTIONS_CLICK_VIEW_ALL
887
+ }, []), x.useEffect(() => {
888
+ i && (d({
889
+ dateRange: { start: Q(J(), 90), end: Z() },
890
+ accounts: o
891
+ }), p({ start: G(/* @__PURE__ */ new Date()), end: W(/* @__PURE__ */ new Date()) }));
892
+ }, [i, o]);
893
+ const b = () => {
894
+ n(
895
+ c.length > 0 ? S.RECURRING_TRANSACTIONS_CLICK_GET_STARTED : S.RECURRING_TRANSACTIONS_CLICK_VIEW_ALL
819
896
  ), t();
820
897
  };
821
- if (!s || !n || !$) return /* @__PURE__ */ e(V, { height: 100 });
822
- const R = 32, oe = y.length > 0, Pe = () => oe ? M ? /* @__PURE__ */ e(
823
- Dt,
824
- {
825
- logoSize: R,
826
- maxLogos: 3,
827
- upcomingRecurrences: y.slice(0, 3)
828
- }
829
- ) : /* @__PURE__ */ e(wt, { maxLogos: 3, upcomingRecurrences: y.slice(0, 3) }) : /* @__PURE__ */ e(l, { sx: { width: M ? 64 : 104 } }), ze = [
830
- {
831
- amount: W,
832
- bgColor: "success.main",
833
- label: S.paid
834
- },
835
- {
836
- amount: C,
837
- bgColor: "error.main",
838
- label: S.missed
839
- },
840
- {
841
- amount: ne,
842
- bgColor: "border.light",
843
- label: S.upcoming
844
- }
845
- ], De = !U?.length;
898
+ if (!i || !s) return /* @__PURE__ */ e(ae, { height: 100 });
899
+ const y = !u?.length;
846
900
  return /* @__PURE__ */ e(
847
- ft,
901
+ dt,
848
902
  {
849
903
  className: "mx-recurring-transaction-microwidget",
850
- ctaLabel: De ? ie.get_started_cta : S.primary_cta,
851
- onCTAClick: re,
852
- title: S.recurring_expenses,
853
- children: De ? /* @__PURE__ */ e(_t, {}) : /* @__PURE__ */ o(X, { children: [
854
- /* @__PURE__ */ o(
855
- l,
856
- {
857
- ref: p,
858
- sx: {
859
- flexDirection: "row",
860
- justifyContent: "space-between"
861
- },
862
- children: [
863
- /* @__PURE__ */ o(
864
- l,
865
- {
866
- sx: [
867
- P.length >= 10 && M ? { flexDirection: "column" } : { flexDirection: "row", gap: 2 },
868
- {
869
- alignItems: "baseline",
870
- overflow: "hidden",
871
- textOverflow: "ellipsis",
872
- whiteSpace: "nowrap"
873
- }
874
- ],
875
- children: [
876
- /* @__PURE__ */ e(
877
- g,
878
- {
879
- sx: { width: "100%" },
880
- variant: P.length >= 10 && M ? "H3" : "H2",
881
- children: P
882
- }
883
- ),
884
- /* @__PURE__ */ e(
885
- ce,
886
- {
887
- sx: {
888
- pr: 12
889
- },
890
- variant: "XSmall",
891
- children: S.expected
892
- }
893
- )
894
- ]
895
- }
896
- ),
897
- Pe()
898
- ]
899
- }
900
- ),
901
- /* @__PURE__ */ o(l, { sx: { pt: 12 }, children: [
902
- /* @__PURE__ */ e($e, { data: K }),
903
- /* @__PURE__ */ e(
904
- l,
905
- {
906
- sx: {
907
- alignItems: "center",
908
- flexDirection: "row",
909
- gap: 16,
910
- mt: 4
911
- },
912
- children: ze.map((N, He) => /* @__PURE__ */ e(
913
- St,
914
- {
915
- amount: N.amount,
916
- bgcolor: N.bgColor,
917
- isLargeScreen: j,
918
- isSmallScreen: M,
919
- label: N.label
920
- },
921
- `recurrence-legend-${He}`
922
- ))
923
- }
924
- )
925
- ] })
926
- ] })
904
+ ctaLabel: y ? g.get_started_cta : m.primary_cta,
905
+ onCTAClick: b,
906
+ title: m.recurring_expenses,
907
+ children: y ? /* @__PURE__ */ e(xt, {}) : /* @__PURE__ */ e(Rt, {})
927
908
  }
928
909
  );
929
910
  }
930
- ), An = T(
911
+ ), Sn = C(
931
912
  ({ isOpen: t, onClose: n, selectedTab: i }) => {
932
- const { cashflow: r } = w();
913
+ const { cashflow: o } = R();
933
914
  return /* @__PURE__ */ e(
934
- xe,
915
+ ie,
935
916
  {
936
- ariaLabelClose: r.close_settings_aria,
917
+ ariaLabelClose: o.close_settings_aria,
937
918
  isOpen: t,
938
919
  onClose: n,
939
- title: r.cashflow_settings,
940
- children: /* @__PURE__ */ e(Ne, { defaultSelectedTab: i })
920
+ title: o.cashflow_settings,
921
+ children: /* @__PURE__ */ e(Te, { defaultSelectedTab: i })
941
922
  }
942
923
  );
943
924
  }
944
925
  );
945
926
  export {
946
- $n as AddRecurringTransactionDetails,
947
- Gn as ManageExpenses,
948
- Bn as ManageIncome,
949
- Ne as RecurringSettings,
950
- An as RecurringSettingsDrawer,
951
- Ln as RecurringTransactionsMicroWidget,
952
- vn as RecurringTransactionsMiniWidget,
953
- kn as RecurringTransactionsStore,
954
- Mn as RecurringTransactionsWidget,
955
- Pn as SelectTransaction
927
+ Nn as AddRecurringTransactionDetails,
928
+ vn as ManageExpenses,
929
+ Gn as ManageIncome,
930
+ Te as RecurringSettings,
931
+ Sn as RecurringSettingsDrawer,
932
+ _n as RecurringTransactionsMicroWidget,
933
+ wn as RecurringTransactionsMiniWidget,
934
+ An as RecurringTransactionsStore,
935
+ Dn as RecurringTransactionsWidget,
936
+ On as SelectTransaction
956
937
  };