@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,25 +1,25 @@
1
- import { makeAutoObservable as c, observable as f, runInAction as h } from "mobx";
2
- import { fromUnixTime as o, isSameDay as d } from "date-fns";
3
- import { F as l, A as a } from "./Fetch-DecPFeGU.mjs";
1
+ import { makeAutoObservable as c, observable as f, runInAction as d } from "mobx";
2
+ import { fromUnixTime as a, isSameDay as h } from "date-fns";
3
+ import { F as l, A as o } from "./Fetch-DecPFeGU.mjs";
4
4
  class s {
5
5
  fetchInstance;
6
6
  constructor(t, i, n) {
7
7
  this.fetchInstance = new l(t, i, void 0, n);
8
8
  }
9
- getNotifications = () => this.fetchInstance.get(a.NOTIFICATIONS).then(
9
+ getNotifications = () => this.fetchInstance.get(o.NOTIFICATIONS).then(
10
10
  (t) => t.notifications.map((i) => i.notification)
11
11
  ).finally();
12
- updateNotification = (t) => this.fetchInstance.put(`${a.NOTIFICATIONS}/${t.guid}`, {
12
+ updateNotification = (t) => this.fetchInstance.put(`${o.NOTIFICATIONS}/${t.guid}`, {
13
13
  guid: t.guid,
14
14
  has_been_viewed: t.has_been_viewed
15
15
  }).then((i) => i.notification).finally();
16
16
  // Note: The notifications/mark_all_as_viewed endpoint is broken, but still returns 202.
17
17
  // A bug ticket has been filed to fix it, but should not require any changes here.
18
- markAllAsViewed = (t) => this.fetchInstance.put(`${a.NOTIFICATIONS}/mark_all_as_viewed`, { channel: t }).finally();
18
+ markAllAsViewed = (t) => this.fetchInstance.put(`${o.NOTIFICATIONS}/mark_all_as_viewed`, { channel: t }).finally();
19
19
  }
20
20
  const w = (e, t) => {
21
- const i = o(t[e].delivered_at), n = o(t[e - 1]?.delivered_at);
22
- return !d(i, n);
21
+ const i = a(t[e].delivered_at), n = a(t[e - 1]?.delivered_at);
22
+ return !h(i, n);
23
23
  };
24
24
  function u(e) {
25
25
  const i = Math.floor(Date.now() / 1e3);
@@ -33,7 +33,7 @@ class A {
33
33
  api = new s("/", "");
34
34
  isLoading = !0;
35
35
  notifications = [];
36
- recentNotifications = [];
36
+ notificationsLoaded = !1;
37
37
  constructor(t) {
38
38
  this.globalStore = t, this.api = new s(
39
39
  t.endpoint,
@@ -45,19 +45,27 @@ class A {
45
45
  get newNotifications() {
46
46
  return this.recentNotifications.filter((t) => !t.has_been_viewed);
47
47
  }
48
+ get recentNotifications() {
49
+ return u(this.notifications);
50
+ }
51
+ setNotifications = (t) => {
52
+ this.notifications = t, this.notificationsLoaded = !0;
53
+ };
48
54
  loadNotifications = async () => {
55
+ this.isLoading = !0;
49
56
  try {
50
- this.isLoading = !0;
51
57
  const t = await this.api.getNotifications();
52
- h(() => {
53
- this.notifications = t, this.recentNotifications = u(t), this.isLoading = !1;
54
- });
58
+ this.setNotifications(t);
55
59
  } catch (t) {
56
60
  console.error(`Error occurred while loading notifications: ${t}`);
61
+ } finally {
62
+ d(() => {
63
+ this.isLoading = !1;
64
+ });
57
65
  }
58
66
  };
59
67
  markAllAsViewed = async () => {
60
- this.notifications.forEach((t) => t.has_been_viewed = !0), await this.api.markAllAsViewed();
68
+ await this.api.markAllAsViewed();
61
69
  };
62
70
  updateNotification = async (t) => {
63
71
  t.has_been_viewed = !0, await this.api.updateNotification(t);
@@ -3,21 +3,21 @@ import u from "react";
3
3
  import { observer as h } from "mobx-react-lite";
4
4
  import c from "@mui/material/Box";
5
5
  import p from "@mui/material/Tab";
6
- import b from "@mui/material/Tabs";
6
+ import R from "@mui/material/Tabs";
7
7
  import d from "@mui/material/Divider";
8
- import R from "@mui/material/List";
8
+ import b from "@mui/material/List";
9
9
  import T from "@mui/material/Stack";
10
- import { R as C, A as S, a as E, M as v } from "./ManageIncome-BrTrlplL.mjs";
10
+ import { R as C, A as S, a as E, M as v } from "./ManageIncome-CL3hv8i9.mjs";
11
11
  import { u as _, j as A, g as f } from "./hooks-ZMp65DFz.mjs";
12
- import { R as y, F as N } from "./RecurringTransactions-Bf4lX0Cn.mjs";
13
- import { A as m } from "./WidgetContainer-CrK6tyHr.mjs";
12
+ import { R as y, F as N } from "./RepeatingTransaction-miZVnk_A.mjs";
13
+ import { A as m } from "./WidgetContainer-BbPS3Yxz.mjs";
14
14
  const I = h(() => {
15
- const { recurring: g } = _(), { repeatingTransactions: n } = A(), { onEvent: o } = f(), l = (r) => {
16
- o(m.RECURRING_TRANSACTIONS_CLICK_EXPENSE, {
15
+ const { recurring: g } = _(), { detailedRepeatingTransactions: n } = A(), { onEvent: a } = f(), l = (r) => {
16
+ a(m.RECURRING_TRANSACTIONS_CLICK_EXPENSE, {
17
17
  repeating_transaction_guid: r.guid
18
18
  });
19
- }, a = () => {
20
- o(m.RECURRING_TRANSACTIONS_CLICK_ADD_EXPENSE);
19
+ }, o = () => {
20
+ a(m.RECURRING_TRANSACTIONS_CLICK_ADD_EXPENSE);
21
21
  }, i = n.filter(
22
22
  (r) => r.repeating_transaction_type !== y.Income && (r.transactions.length > 0 || r.recurrence_type === N.EveryYear)
23
23
  );
@@ -29,7 +29,7 @@ const I = h(() => {
29
29
  maxHeight: "calc(100vh - 109px)"
30
30
  },
31
31
  children: [
32
- /* @__PURE__ */ e(c, { sx: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ e(R, { sx: { bgcolor: "background.paper" }, children: i.map((r, s) => /* @__PURE__ */ t(u.Fragment, { children: [
32
+ /* @__PURE__ */ e(c, { sx: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ e(b, { sx: { bgcolor: "background.paper" }, children: i.map((r, s) => /* @__PURE__ */ t(u.Fragment, { children: [
33
33
  /* @__PURE__ */ e(C, { onClick: l, repeatingTransaction: r }),
34
34
  /* @__PURE__ */ e(
35
35
  d,
@@ -51,7 +51,7 @@ const I = h(() => {
51
51
  py: 12,
52
52
  textAlign: "right"
53
53
  },
54
- children: /* @__PURE__ */ e(S, { label: g.add_expense, onAddRecurringTransaction: a })
54
+ children: /* @__PURE__ */ e(S, { label: g.add_expense, onAddRecurringTransaction: o })
55
55
  }
56
56
  )
57
57
  ] })
@@ -59,13 +59,13 @@ const I = h(() => {
59
59
  }
60
60
  ) : /* @__PURE__ */ e(E, { zeroStateFor: "expenses" }) });
61
61
  }), X = h(({ defaultSelectedTab: g = 0 }) => {
62
- const [n, o] = u.useState(g), { onEvent: l } = f(), { recurring: a } = _();
62
+ const [n, a] = u.useState(g), { onEvent: l } = f(), { recurring: o } = _();
63
63
  return /* @__PURE__ */ t(c, { bgcolor: "background.default", height: "100%", children: [
64
64
  /* @__PURE__ */ t(
65
- b,
65
+ R,
66
66
  {
67
67
  onChange: (r, s) => {
68
- o(s), l(
68
+ a(s), l(
69
69
  s === 0 ? "recurring_transactions_widget_manage_expenses" : "recurring_transactions_widget_edit_income"
70
70
  );
71
71
  },
@@ -73,8 +73,8 @@ const I = h(() => {
73
73
  value: n,
74
74
  variant: "fullWidth",
75
75
  children: [
76
- /* @__PURE__ */ e(p, { label: a.expenses }),
77
- /* @__PURE__ */ e(p, { label: a.income })
76
+ /* @__PURE__ */ e(p, { label: o.expenses }),
77
+ /* @__PURE__ */ e(p, { label: o.income })
78
78
  ]
79
79
  }
80
80
  ),
@@ -1,58 +1,64 @@
1
- import { makeAutoObservable as f, runInAction as i } from "mobx";
2
- import { endOfMonth as R } from "date-fns/endOfMonth";
3
- import { isAfter as p } from "date-fns/isAfter";
4
- import { isBefore as I } from "date-fns/isBefore";
5
- import { isSameDay as g } from "date-fns/isSameDay";
6
- import { isWithinInterval as m } from "date-fns/isWithinInterval";
7
- import { startOfMonth as S } from "date-fns/startOfMonth";
8
- import { startOfToday as c } from "date-fns/startOfToday";
9
- import { subDays as y } from "date-fns/subDays";
1
+ import { makeAutoObservable as R, runInAction as c } from "mobx";
2
+ import { endOfMonth as f } from "date-fns/endOfMonth";
3
+ import { isAfter as g } from "date-fns/isAfter";
4
+ import { isBefore as S } from "date-fns/isBefore";
5
+ import { isSameDay as p } from "date-fns/isSameDay";
6
+ import { isWithinInterval as T } from "date-fns/isWithinInterval";
7
+ import { startOfMonth as y } from "date-fns/startOfMonth";
8
+ import { startOfToday as i } from "date-fns/startOfToday";
9
+ import { subDays as I } from "date-fns/subDays";
10
10
  import { F as x, A as o } from "./Fetch-DecPFeGU.mjs";
11
- import { b as E, a, c as d, d as u } from "./RecurringTransactions-Bf4lX0Cn.mjs";
12
- var A = /* @__PURE__ */ ((r) => (r.Small = "small", r.Medium = "medium", r.Large = "large", r))(A || {});
13
- const U = 44;
11
+ import { a as u, b as A, c as r, d } from "./RepeatingTransaction-miZVnk_A.mjs";
12
+ var E = /* @__PURE__ */ ((a) => (a.Small = "small", a.Medium = "medium", a.Large = "large", a))(E || {});
13
+ const G = 44;
14
14
  class h {
15
15
  fetchInstance;
16
- constructor(e, t, n) {
17
- this.fetchInstance = new x(e, t, void 0, n);
16
+ constructor(t, e, n) {
17
+ this.fetchInstance = new x(t, e, void 0, n);
18
18
  }
19
- addRepeatingTransaction = async (e) => this.fetchInstance.post(o.REPEATING_TRANSACTIONS, e).then((t) => t.repeating_transaction);
20
- getRepeatingTransactions = async () => this.fetchInstance.get(o.REPEATING_TRANSACTIONS).then((e) => e.repeating_transactions);
21
- updateRepeatingTransaction = async (e) => this.fetchInstance.put(
22
- `${o.REPEATING_TRANSACTIONS}/${e.guid}`,
23
- e
24
- ).then((t) => t.repeating_transaction);
25
- deleteRepeatingTransaction = async (e) => this.fetchInstance.delete(`${o.REPEATING_TRANSACTIONS}/${e}`).then((t) => t);
19
+ addRepeatingTransaction = async (t) => this.fetchInstance.post(o.REPEATING_TRANSACTIONS, t).then((e) => e.repeating_transaction);
20
+ getRepeatingTransactions = async () => this.fetchInstance.get(o.REPEATING_TRANSACTIONS).then((t) => t.repeating_transactions);
21
+ updateRepeatingTransaction = async (t) => this.fetchInstance.put(
22
+ `${o.REPEATING_TRANSACTIONS}/${t.guid}`,
23
+ t
24
+ ).then((e) => e.repeating_transaction);
25
+ deleteRepeatingTransaction = async (t) => this.fetchInstance.delete(`${o.REPEATING_TRANSACTIONS}/${t}`).then((e) => e);
26
26
  }
27
- const l = (r, e) => m(e.expectedDate, r), s = (r, e) => r + e.amount;
28
- class C {
27
+ const l = (a, t) => T(t.expectedDate, a), s = (a, t) => a + t.amount;
28
+ class U {
29
29
  globalStore;
30
30
  api = new h("/", "");
31
- transactions = [];
32
31
  repeatingTransactions = [];
33
- selectedDay;
34
- dateRange = { start: S(c()), end: R(c()) };
35
32
  isDataLoaded = !1;
36
- constructor(e) {
37
- this.globalStore = e, this.api = new h(
38
- e.endpoint,
39
- e.sessionToken,
40
- e.onError
41
- ), f(this);
33
+ selectedDay;
34
+ dateRange = { start: y(i()), end: f(i()) };
35
+ constructor(t) {
36
+ this.globalStore = t, this.api = new h(
37
+ t.endpoint,
38
+ t.sessionToken,
39
+ t.onError
40
+ ), R(this);
41
+ }
42
+ get detailedRepeatingTransactions() {
43
+ return u(
44
+ this.globalStore.accountStore.visibleAccounts,
45
+ this.repeatingTransactions,
46
+ this.globalStore.transactionStore.transactions
47
+ );
42
48
  }
43
49
  /**
44
50
  * Returns all recurrences built from repeating transactions and filtered by accounts.
45
51
  */
46
52
  get recurrences() {
47
- const e = this.globalStore.accountStore.visibleAccounts;
48
- return E(this.repeatingTransactions, this.dateRange).filter((t) => e.some((n) => n.guid === t.accountGuid && !n.is_excluded_from_accounts)).filter((t) => m(t.expectedDate, this.dateRange));
53
+ const t = this.globalStore.accountStore.visibleAccounts;
54
+ return A(this.detailedRepeatingTransactions, this.dateRange).filter((e) => t.some((n) => n.guid === e.accountGuid && !n.is_excluded_from_accounts)).filter((e) => T(e.expectedDate, this.dateRange));
49
55
  }
50
56
  /**
51
57
  * Returns all recurrences that have occurred in the past, including those that are paid or missed
52
58
  */
53
59
  get pastRecurrences() {
54
60
  return this.recurrences.filter(
55
- (e) => e.status === a.Paid || e.status === a.Missed
61
+ (t) => t.status === r.Paid || t.status === r.Missed
56
62
  );
57
63
  }
58
64
  /**
@@ -61,7 +67,7 @@ class C {
61
67
  */
62
68
  get upcomingRecurrences() {
63
69
  return this.recurrences.filter(
64
- (e) => p(e.expectedDate, y(c(), 3)) && I(e.expectedDate, this.dateRange.end) && e.status === a.Upcoming
70
+ (t) => g(t.expectedDate, I(i(), 3)) && S(t.expectedDate, this.dateRange.end) && t.status === r.Upcoming
65
71
  );
66
72
  }
67
73
  /**
@@ -69,7 +75,7 @@ class C {
69
75
  */
70
76
  get expenses() {
71
77
  return this.recurrences.filter(
72
- (e) => e.type === d.Expense
78
+ (t) => t.type === d.Expense
73
79
  );
74
80
  }
75
81
  /**
@@ -77,7 +83,7 @@ class C {
77
83
  */
78
84
  get upcomingExpenses() {
79
85
  return this.expenses.filter(
80
- (e) => e.status === a.Upcoming
86
+ (t) => t.status === r.Upcoming
81
87
  );
82
88
  }
83
89
  /**
@@ -85,7 +91,7 @@ class C {
85
91
  */
86
92
  get income() {
87
93
  return this.recurrences.filter(
88
- (e) => e.type === d.Income
94
+ (t) => t.type === d.Income
89
95
  );
90
96
  }
91
97
  /**
@@ -93,18 +99,18 @@ class C {
93
99
  */
94
100
  get upcomingIncome() {
95
101
  return this.income.filter(
96
- (e) => e.status === a.Upcoming
102
+ (t) => t.status === r.Upcoming
97
103
  );
98
104
  }
99
105
  get nextIncomeRecurrence() {
100
- return this.upcomingIncome.find((e) => p(e.expectedDate, c()));
106
+ return this.upcomingIncome.find((t) => g(t.expectedDate, i()));
101
107
  }
102
108
  /**
103
109
  * Returns the expense recurrences for the current month.
104
110
  */
105
111
  get currentMonthExpenses() {
106
112
  return this.expenses.filter(
107
- (e) => l(this.dateRange, e)
113
+ (t) => l(this.dateRange, t)
108
114
  );
109
115
  }
110
116
  /**
@@ -112,7 +118,7 @@ class C {
112
118
  */
113
119
  get currentMonthIncome() {
114
120
  return this.income.filter(
115
- (e) => l(this.dateRange, e)
121
+ (t) => l(this.dateRange, t)
116
122
  );
117
123
  }
118
124
  /**
@@ -125,19 +131,19 @@ class C {
125
131
  * Calculates the total amount of all paid expenses for the current month.
126
132
  */
127
133
  get paidExpenseTotal() {
128
- return this.currentMonthExpenses.filter((e) => e.status === a.Paid).reduce(s, 0);
134
+ return this.currentMonthExpenses.filter((t) => t.status === r.Paid).reduce(s, 0);
129
135
  }
130
136
  /**
131
137
  * Calculates the total amount of all missed expenses for the current month.
132
138
  */
133
139
  get missedExpenseTotal() {
134
- return this.currentMonthExpenses.filter((e) => e.status === a.Missed).reduce(s, 0);
140
+ return this.currentMonthExpenses.filter((t) => t.status === r.Missed).reduce(s, 0);
135
141
  }
136
142
  /**
137
143
  * Calculates the total amount of all upcoming expenses for the current month.
138
144
  */
139
145
  get upcomingExpenseTotal() {
140
- return this.currentMonthExpenses.filter((e) => e.status === a.Upcoming).reduce(s, 0);
146
+ return this.currentMonthExpenses.filter((t) => t.status === r.Upcoming).reduce(s, 0);
141
147
  }
142
148
  /**
143
149
  * Calculates the total amount of all income for the current month.
@@ -149,49 +155,53 @@ class C {
149
155
  * Calculates the total amount of all paid income for the current month.
150
156
  */
151
157
  get paidIncomeTotal() {
152
- return this.currentMonthIncome.filter((e) => e.status === a.Paid).reduce(s, 0);
158
+ return this.currentMonthIncome.filter((t) => t.status === r.Paid).reduce(s, 0);
153
159
  }
154
160
  /**
155
161
  * Calculates the total amount of all upcoming income for the current month.
156
162
  */
157
163
  get upcomingIncomeTotal() {
158
- return this.currentMonthIncome.filter((e) => e.status === a.Upcoming).reduce(s, 0);
164
+ return this.currentMonthIncome.filter((t) => t.status === r.Upcoming).reduce(s, 0);
159
165
  }
160
166
  /**
161
167
  * Get the recurrences for the currently selected day.
162
168
  */
163
169
  get selectedDayRecurrences() {
164
170
  return this.selectedDay && this.recurrences.filter(
165
- (e) => this.selectedDay && g(e.occurredOnDate || e.expectedDate, this.selectedDay)
171
+ (t) => this.selectedDay && p(t.occurredOnDate || t.expectedDate, this.selectedDay)
166
172
  );
167
173
  }
174
+ setRepeatingTransactions = (t) => {
175
+ this.repeatingTransactions = t, this.isDataLoaded = !0;
176
+ };
168
177
  /**
169
178
  * Set the date range for filtering recurrences.
170
179
  * @param dateRange - The date range to set.
171
180
  */
172
- setDateRange = (e) => this.dateRange = e;
181
+ setDateRange = (t) => this.dateRange = t;
173
182
  /**
174
183
  * Set the currently selected day.
175
184
  * @param day - The day to select.
176
185
  */
177
- setSelectedDay = (e) => {
178
- this.selectedDay = this.selectedDay && g(e, this.selectedDay) ? void 0 : e;
186
+ setSelectedDay = (t) => {
187
+ this.selectedDay = this.selectedDay && p(t, this.selectedDay) ? void 0 : t;
188
+ };
189
+ loadRepeatingTransactionData = async () => {
190
+ await Promise.all([
191
+ this.globalStore.accountStore.loadAccountData(),
192
+ this.globalStore.categoryStore.loadCategories(),
193
+ this.globalStore.transactionStore.loadTransactionData()
194
+ ]), await this.loadRepeatingTransactions();
179
195
  };
180
196
  /**
181
197
  * Load repeating transactions and augment them with additional data.
182
198
  */
183
199
  loadRepeatingTransactions = async () => {
184
200
  try {
185
- const e = await this.api.getRepeatingTransactions();
186
- i(() => {
187
- this.repeatingTransactions = u(
188
- this.globalStore.accountStore.visibleAccounts,
189
- e,
190
- this.globalStore.transactionStore.transactions
191
- ), this.isDataLoaded = !0;
192
- });
193
- } catch (e) {
194
- console.error(`Error occurred while getting repeating transactions: ${e}`);
201
+ const t = await this.api.getRepeatingTransactions();
202
+ this.setRepeatingTransactions(t);
203
+ } catch (t) {
204
+ console.error(`Error occurred while getting repeating transactions: ${t}`);
195
205
  }
196
206
  };
197
207
  /**
@@ -199,13 +209,13 @@ class C {
199
209
  * @param repeatingTransaction - The repeating transaction to add.
200
210
  * @param transaction - The transaction associated with the repeating transaction.
201
211
  */
202
- addRepeatingTransaction = async (e, t) => {
212
+ addRepeatingTransaction = async (t, e) => {
203
213
  try {
204
- const n = await this.api.addRepeatingTransaction(e);
214
+ const n = await this.api.addRepeatingTransaction(t);
205
215
  await this.globalStore.transactionStore.updateTransaction({
206
- ...t,
216
+ ...e,
207
217
  repeating_transaction_guid: n.guid
208
- }), i(() => {
218
+ }), c(() => {
209
219
  this.repeatingTransactions = [
210
220
  ...this.repeatingTransactions,
211
221
  ...u(
@@ -223,45 +233,45 @@ class C {
223
233
  * Delete a repeating transaction by its GUID.
224
234
  * @param guid - The GUID of the repeating transaction to delete.
225
235
  */
226
- deleteRepeatingTransaction = async (e) => {
236
+ deleteRepeatingTransaction = async (t) => {
227
237
  try {
228
- await this.api.deleteRepeatingTransaction(e), i(() => {
238
+ await this.api.deleteRepeatingTransaction(t), c(() => {
229
239
  this.repeatingTransactions = [
230
- ...this.repeatingTransactions.filter((t) => t.guid !== e)
240
+ ...this.repeatingTransactions.filter((e) => e.guid !== t)
231
241
  ];
232
242
  });
233
- } catch (t) {
234
- console.error(`Error occurred while deleting repeating transaction: ${t}`);
243
+ } catch (e) {
244
+ console.error(`Error occurred while deleting repeating transaction: ${e}`);
235
245
  }
236
246
  };
237
247
  /**
238
248
  * Update an existing repeating transaction.
239
249
  * @param transaction - The repeating transaction to update.
240
250
  */
241
- updateRepeatingTransaction = async (e) => {
251
+ updateRepeatingTransaction = async (t) => {
242
252
  try {
243
- const t = await this.api.updateRepeatingTransaction(e), n = this.repeatingTransactions.findIndex(
244
- (T) => T.guid === t.guid
253
+ const e = await this.api.updateRepeatingTransaction(t), n = this.repeatingTransactions.findIndex(
254
+ (m) => m.guid === e.guid
245
255
  );
246
256
  if (n < 0) return;
247
- i(() => {
257
+ c(() => {
248
258
  this.repeatingTransactions = [
249
259
  ...this.repeatingTransactions.slice(0, n),
250
260
  ...u(
251
261
  this.globalStore.accountStore.visibleAccounts,
252
- [t],
262
+ [e],
253
263
  this.globalStore.transactionStore.transactions
254
264
  ),
255
265
  ...this.repeatingTransactions.slice(n + 1)
256
266
  ];
257
267
  });
258
- } catch (t) {
259
- console.error(`Error occurred while updating repeating transaction: ${t}`);
268
+ } catch (e) {
269
+ console.error(`Error occurred while updating repeating transaction: ${e}`);
260
270
  }
261
271
  };
262
272
  }
263
273
  export {
264
- C as R,
265
- A as S,
266
- U as T
274
+ U as R,
275
+ E as S,
276
+ G as T
267
277
  };
@@ -33,7 +33,6 @@ import { g as R, a as ee, b as te, c as re, d as oe, e as ae, f as ne } from "./
33
33
  import { b as W } from "./NumberFormatting-DjTD0t3W.mjs";
34
34
  import { f as v, D as k } from "./Dialog-B4PI-_bL.mjs";
35
35
  import { b as l } from "./Localization-2MODESHW.mjs";
36
- var s = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.EveryWeek = 1] = "EveryWeek", e[e.EveryOtherWeek = 2] = "EveryOtherWeek", e[e.EveryMonth = 3] = "EveryMonth", e[e.EveryOtherMonth = 4] = "EveryOtherMonth", e[e.EveryQuarter = 5] = "EveryQuarter", e[e.EveryOtherQuarter = 6] = "EveryOtherQuarter", e[e.EveryYear = 7] = "EveryYear", e[e.TwiceAMonth = 8] = "TwiceAMonth", e))(s || {}), p = /* @__PURE__ */ ((e) => (e[e.Paid = 0] = "Paid", e[e.Missed = 1] = "Missed", e[e.Upcoming = 2] = "Upcoming", e))(p || {}), O = /* @__PURE__ */ ((e) => (e[e.Expense = 0] = "Expense", e[e.Income = 1] = "Income", e))(O || {}), Y = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Subscription = 1] = "Subscription", e[e.Bill = 2] = "Bill", e[e.Income = 3] = "Income", e[e.Transfer = 4] = "Transfer", e))(Y || {});
37
36
  const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
38
37
  const o = /* @__PURE__ */ M(B, { children: [
39
38
  /* @__PURE__ */ d(L, { children: /* @__PURE__ */ d(P, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ d(I, { name: e, sx: { color: "text.primary" }, weight: S.Dark }) }) }),
@@ -277,15 +276,16 @@ const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
277
276
  }
278
277
  return t;
279
278
  };
279
+ var s = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.EveryWeek = 1] = "EveryWeek", e[e.EveryOtherWeek = 2] = "EveryOtherWeek", e[e.EveryMonth = 3] = "EveryMonth", e[e.EveryOtherMonth = 4] = "EveryOtherMonth", e[e.EveryQuarter = 5] = "EveryQuarter", e[e.EveryOtherQuarter = 6] = "EveryOtherQuarter", e[e.EveryYear = 7] = "EveryYear", e[e.TwiceAMonth = 8] = "TwiceAMonth", e))(s || {}), p = /* @__PURE__ */ ((e) => (e[e.Paid = 0] = "Paid", e[e.Missed = 1] = "Missed", e[e.Upcoming = 2] = "Upcoming", e))(p || {}), O = /* @__PURE__ */ ((e) => (e[e.Expense = 0] = "Expense", e[e.Income = 1] = "Income", e))(O || {}), Y = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Subscription = 1] = "Subscription", e[e.Bill = 2] = "Bill", e[e.Income = 3] = "Income", e[e.Transfer = 4] = "Transfer", e))(Y || {});
280
280
  export {
281
281
  Fe as D,
282
282
  s as F,
283
283
  Y as R,
284
284
  Re as S,
285
- p as a,
285
+ tt as a,
286
286
  et as b,
287
- O as c,
288
- tt as d,
287
+ p as c,
288
+ O as d,
289
289
  at as e,
290
290
  rt as f,
291
291
  ot as g
@@ -1,6 +1,6 @@
1
1
  import { makeAutoObservable as N, runInAction as l } from "mobx";
2
2
  import { F as D, A as r } from "./Fetch-DecPFeGU.mjs";
3
- import { B as f, A as n, I as i } from "./ToggleListItem-ciFTiqRS.mjs";
3
+ import { B as f, A as n, I as i } from "./Notification-Bs1fdbzI.mjs";
4
4
  import { T as m } from "./TransactionApi-CjBoLleL.mjs";
5
5
  class y {
6
6
  fetchInstance;
@@ -0,0 +1,38 @@
1
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
+ import t from "@mui/material/Stack";
3
+ import i from "@mui/material/Skeleton";
4
+ const g = ({ sx: e = {}, variant: h = "list" }) => /* @__PURE__ */ d(t, { sx: [...Array.isArray(e) ? e : [e]], children: [
5
+ h === "list" && /* @__PURE__ */ d(t, { gap: 24, children: [
6
+ /* @__PURE__ */ r(i, { height: 25, variant: "rounded", width: 150 }),
7
+ /* @__PURE__ */ r(i, { height: 50, variant: "rounded" }),
8
+ /* @__PURE__ */ r(i, { height: 50, variant: "rounded" }),
9
+ /* @__PURE__ */ r(i, { height: 50, variant: "rounded" })
10
+ ] }),
11
+ h === "card" && /* @__PURE__ */ d(t, { gap: 24, children: [
12
+ /* @__PURE__ */ r(i, { height: 50, variant: "rounded" }),
13
+ /* @__PURE__ */ d(t, { direction: "row", gap: 24, children: [
14
+ /* @__PURE__ */ r(i, { height: 300, variant: "rounded", width: "20%" }),
15
+ /* @__PURE__ */ r(i, { height: 300, variant: "rounded", width: "80%" })
16
+ ] })
17
+ ] }),
18
+ h === "dashboard" && /* @__PURE__ */ d(t, { gap: 24, children: [
19
+ /* @__PURE__ */ r(i, { height: 75, variant: "rounded" }),
20
+ /* @__PURE__ */ d(t, { gap: 24, children: [
21
+ /* @__PURE__ */ d(t, { direction: "row", gap: 24, children: [
22
+ /* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "75%" }),
23
+ /* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "25%" })
24
+ ] }),
25
+ /* @__PURE__ */ d(t, { direction: "row", gap: 24, children: [
26
+ /* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "75%" }),
27
+ /* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "25%" })
28
+ ] }),
29
+ /* @__PURE__ */ d(t, { direction: "row", gap: 24, children: [
30
+ /* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "75%" }),
31
+ /* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "25%" })
32
+ ] })
33
+ ] })
34
+ ] })
35
+ ] });
36
+ export {
37
+ g as S
38
+ };