@mx-cartographer/experiences 7.2.15-alpha.sms4 → 7.3.0-alpha.sms1

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 (62) hide show
  1. package/dist/{Account-vp_TAbGt.mjs → Account-Bxw0_4FU.mjs} +1 -1
  2. package/dist/{AccountDetailsContent-Vj4LO6cx.mjs → AccountDetailsContent-CAM9y39M.mjs} +6 -6
  3. package/dist/{AccountDetailsHeader-Df1JkzYi.mjs → AccountDetailsHeader-JtSX6Uf9.mjs} +4 -4
  4. package/dist/{AccountFields-DUToRRqW.mjs → AccountFields-C9FlatNb.mjs} +2 -2
  5. package/dist/{AccountListItem-CeY_WIpj.mjs → AccountListItem-JFMZROh7.mjs} +7 -7
  6. package/dist/{AccountStore-BkoLK9Tq.mjs → AccountStore-BgNOyMdp.mjs} +74 -100
  7. package/dist/Accounts-BRf_YeTf.mjs +27 -0
  8. package/dist/CategoryStore-yHI0hWmK.mjs +174 -0
  9. package/dist/CategoryUtil-pZRIYOgN.mjs +80 -0
  10. package/dist/{ConnectDrawer-Bw5s6Dw1.mjs → ConnectDrawer-BQNs-hjk.mjs} +9 -9
  11. package/dist/{ConnectionsDrawer-BDvVuJQf.mjs → ConnectionsDrawer-ByGQE7D5.mjs} +3 -3
  12. package/dist/{DebtsStore-BD_XwsI7.mjs → DebtsStore-C9bblOgW.mjs} +1 -1
  13. package/dist/{GoalStore-DZ_Jvsa_.mjs → GoalStore-D-aB35SY.mjs} +151 -111
  14. package/dist/{ManageIncome-B9yGuahc.mjs → ManageIncome-1s_q5W4X.mjs} +3 -3
  15. package/dist/{NetWorthStore-D1NiDUcc.mjs → NetWorthStore-DCsTZpuS.mjs} +2 -2
  16. package/dist/{NotificationStore-C6PH6MKm.mjs → NotificationStore-BxP_P2dA.mjs} +23 -15
  17. package/dist/{RecurringSettings-D9GFcsXV.mjs → RecurringSettings-A_rAGCTP.mjs} +3 -3
  18. package/dist/{RecurringTransactions-ej39mgA6.mjs → RecurringTransactions-DK8dWldr.mjs} +3 -3
  19. package/dist/{RecurringTransactionsStore-DrzS1LmF.mjs → RecurringTransactionsStore-C4YOD7_D.mjs} +29 -26
  20. package/dist/{TransactionDetails-BqCr2FTh.mjs → TransactionDetails-oP1eSuiS.mjs} +43 -43
  21. package/dist/TransactionStore-ai3uII_r.mjs +690 -0
  22. package/dist/{WidgetContainer-EbrN1oIo.mjs → WidgetContainer-BHWANqT4.mjs} +1 -1
  23. package/dist/accounts/index.es.js +29 -29
  24. package/dist/accounts/stores/AccountStore.d.ts +25 -22
  25. package/dist/accounts/utils/Accounts.d.ts +2 -1
  26. package/dist/budgets/index.es.js +4 -4
  27. package/dist/budgets/store/BudgetsStore.d.ts +1 -0
  28. package/dist/cashflow/index.es.js +6 -6
  29. package/dist/categories/index.es.js +1 -1
  30. package/dist/categories/stores/CategoryStore.d.ts +5 -1
  31. package/dist/categories/util/CategoryUtil.d.ts +3 -2
  32. package/dist/common/index.es.js +206 -219
  33. package/dist/common/stores/AppDataStore.d.ts +3 -1
  34. package/dist/common/stores/GlobalCopyStore.d.ts +0 -1
  35. package/dist/common/stores/GlobalStore.d.ts +3 -6
  36. package/dist/common/stores/UserStore.d.ts +3 -2
  37. package/dist/common/types/Account.d.ts +9 -6
  38. package/dist/dashboard/index.es.js +1 -1
  39. package/dist/debts/index.es.js +5 -5
  40. package/dist/finstrong/index.es.js +4 -4
  41. package/dist/goals/index.es.js +7 -7
  42. package/dist/goals/stores/GoalStore.d.ts +17 -4
  43. package/dist/help/index.es.js +1 -1
  44. package/dist/investments/index.es.js +2 -2
  45. package/dist/investments/stores/HoldingStore.d.ts +1 -0
  46. package/dist/networth/index.es.js +4 -4
  47. package/dist/notifications/index.es.js +2 -2
  48. package/dist/notifications/stores/NotificationStore.d.ts +3 -1
  49. package/dist/recurringtransactions/index.es.js +8 -8
  50. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +3 -2
  51. package/dist/settings/index.es.js +1 -1
  52. package/dist/spending/index.es.js +3 -3
  53. package/dist/transactions/components/shared/transactiondetails/actions/DateAction.d.ts +2 -2
  54. package/dist/transactions/index.es.js +6 -6
  55. package/dist/transactions/stores/TransactionStore.d.ts +21 -77
  56. package/dist/trends/index.es.js +4 -4
  57. package/dist/{useAccountDisplayName-jS05A6-6.mjs → useAccountDisplayName-BUAApBIb.mjs} +1 -1
  58. package/package.json +4 -4
  59. package/dist/Accounts-C1QxUB-e.mjs +0 -9
  60. package/dist/CategoryStore-BCcpI3oJ.mjs +0 -183
  61. package/dist/CategoryUtil-BR3H5i6n.mjs +0 -78
  62. package/dist/TransactionStore-RGu9PZK8.mjs +0 -677
@@ -0,0 +1,80 @@
1
+ import { format as d } from "date-fns/format";
2
+ import { startOfMonth as T } from "date-fns/startOfMonth";
3
+ import { startOfToday as C } from "date-fns/startOfToday";
4
+ import { subMonths as N } from "date-fns/subMonths";
5
+ import { CategoryIconList as O } from "@mxenabled/mxui";
6
+ import { C as b, a as D, b as E } from "./Category-CevNQ03n.mjs";
7
+ import { f as R, D as v } from "./Dialog-CWW597AF.mjs";
8
+ const H = 3, f = 12, k = (t, o, e, r) => t.filter((n) => !n.parent_guid).map(
9
+ (n) => p(
10
+ n,
11
+ o,
12
+ e,
13
+ r,
14
+ t.filter((s) => s.parent_guid === n.guid)
15
+ )
16
+ ), z = (t, o) => {
17
+ const e = O.find((r) => r.guid === t);
18
+ return e ? o.palette.categories[e.colorName] || "" : o.palette.categories.uncategorized || "";
19
+ }, p = (t, o, e, r, n = []) => {
20
+ const s = t.guid, i = t.parent_guid || s, u = s === i, c = e.find((a) => a.category_guid === s)?.total || 0, m = y(
21
+ r.filter((a) => a.category_guid === s)
22
+ ), g = y(
23
+ r.filter(
24
+ (a) => a.category_guid === s || a.top_level_category_guid === s
25
+ )
26
+ ), l = n.map(
27
+ (a) => p(a, o, e, r)
28
+ ), A = l.reduce(
29
+ (a, M) => a + M.currentAmount,
30
+ c
31
+ ), h = o.default_categories[t.guid] ? o.default_categories[t.guid].replace(/&/g, "&") : t.name;
32
+ return {
33
+ ...t,
34
+ currentAmount: c,
35
+ averageAmount: _(m),
36
+ color: b[i],
37
+ icon: D[i],
38
+ isTransfer: i === E.TRANSFER,
39
+ monthlyAmounts: m,
40
+ name: h,
41
+ subCategories: l,
42
+ totalAmount: u ? A : 0,
43
+ totalAverageAmount: _(g),
44
+ totalMonthlyAmounts: u ? g : []
45
+ };
46
+ }, B = (t, o) => t.map((e) => {
47
+ const r = o.filter(
48
+ (n) => n.category_guid === e.guid || n.top_level_category_guid === e.guid
49
+ );
50
+ return {
51
+ ...e,
52
+ transactions: r
53
+ };
54
+ }), _ = (t, o = H) => {
55
+ const e = o > history.length ? history.length : o;
56
+ return Math.ceil(
57
+ Math.max(
58
+ 0,
59
+ t.slice(-e).reduce((r, n) => r + n.amount, 0) / e
60
+ )
61
+ );
62
+ }, y = (t) => {
63
+ const o = [], e = C();
64
+ for (let r = 0; r <= f; r++) {
65
+ const n = T(N(e, f - r)), i = t.filter(
66
+ (u) => u.year_month === Number(d(n, "yyyyMM"))
67
+ ).reduce((u, c) => u + c.total, 0);
68
+ o.push({
69
+ amount: i,
70
+ isoDate: d(n, "yyyy-MM-dd"),
71
+ label: R(n, v.MONTH_YEAR)
72
+ });
73
+ }
74
+ return o;
75
+ };
76
+ export {
77
+ k as a,
78
+ z as b,
79
+ B as g
80
+ };
@@ -520,23 +520,23 @@ const j = "connect_widget", rI = "connections_widget", HE = ({
520
520
  }, RI = Q(HE);
521
521
  export {
522
522
  T as A,
523
- rI as C,
523
+ dE as C,
524
524
  CE as E,
525
525
  tE as F,
526
- t as M,
526
+ DE as M,
527
527
  pE as N,
528
528
  LE as P,
529
529
  cE as S,
530
530
  yE as a,
531
531
  II as b,
532
- J as c,
533
- dE as d,
534
- uE as e,
535
- PE as f,
532
+ bE as c,
533
+ rI as d,
534
+ J as e,
535
+ t as f,
536
536
  AE as g,
537
- sE as h,
538
- bE as i,
539
- DE as j,
537
+ uE as h,
538
+ PE as i,
539
+ sE as j,
540
540
  NI as k,
541
541
  RI as l,
542
542
  _I as m,
@@ -3,7 +3,7 @@ import s from "react";
3
3
  import { observer as E } from "mobx-react-lite";
4
4
  import { useTheme as b } from "@mui/material/styles";
5
5
  import { ConnectionsWidget as D } from "@mxenabled/web-widget-sdk";
6
- import { C as a, c, M as i } from "./ConnectDrawer-Bw5s6Dw1.mjs";
6
+ import { d as a, e as c, f as i } from "./ConnectDrawer-BQNs-hjk.mjs";
7
7
  import { d as L, e as w, u as _ } from "./hooks-D6XlXHf4.mjs";
8
8
  import { D as x } from "./Drawer-kEE73B87.mjs";
9
9
  const I = ({
@@ -47,7 +47,7 @@ const I = ({
47
47
  ] })
48
48
  }
49
49
  );
50
- }, M = E(I);
50
+ }, W = E(I);
51
51
  export {
52
- M as C
52
+ W as C
53
53
  };
@@ -1,6 +1,6 @@
1
1
  import { makeAutoObservable as l } from "mobx";
2
2
  import { getDate as r, fromUnixTime as _, startOfMonth as m } from "date-fns";
3
- import { A as p } from "./ConnectDrawer-Bw5s6Dw1.mjs";
3
+ import { A as p } from "./ConnectDrawer-BQNs-hjk.mjs";
4
4
  const E = 12, T = 100;
5
5
  var c = /* @__PURE__ */ ((a) => (a[a.FASTEST_PAYOFF_FIRST = 1] = "FASTEST_PAYOFF_FIRST", a[a.HIGHEST_INTEREST = 2] = "HIGHEST_INTEREST", a[a.LOWEST_BALANCE = 3] = "LOWEST_BALANCE", a[a.HIGHEST_BALANCE = 4] = "HIGHEST_BALANCE", a))(c || {});
6
6
  const b = {
@@ -1,41 +1,41 @@
1
- import { jsxs as g, jsx as _ } from "react/jsx-runtime";
1
+ import { jsxs as _, jsx as l } from "react/jsx-runtime";
2
2
  import u from "react";
3
3
  import T from "@mui/material/Button";
4
4
  import I from "@mui/material/Card";
5
5
  import N from "@mui/material/CardContent";
6
6
  import O from "@mui/material/CardHeader";
7
- import S from "@mui/material/Stack";
8
- import { AccountBalance as w, ChevronRight as L } from "@mxenabled/mx-icons";
9
- import { Text as A } from "@mxenabled/mxui";
10
- import { l as b } from "./ConnectDrawer-Bw5s6Dw1.mjs";
11
- import { a as y } from "./hooks-D6XlXHf4.mjs";
12
- import { makeAutoObservable as D, runInAction as c } from "mobx";
7
+ import w from "@mui/material/Stack";
8
+ import { AccountBalance as S, ChevronRight as L } from "@mxenabled/mx-icons";
9
+ import { Text as g } from "@mxenabled/mxui";
10
+ import { l as y } from "./ConnectDrawer-BQNs-hjk.mjs";
11
+ import { a as b } from "./hooks-D6XlXHf4.mjs";
12
+ import { makeAutoObservable as D, runInAction as E } from "mobx";
13
13
  import { F as v, A as i } from "./Fetch-87LIQbEA.mjs";
14
14
  import { fromUnixTime as G } from "date-fns/fromUnixTime";
15
- import { addYears as x } from "date-fns/addYears";
16
- import { getUnixTime as K } from "date-fns/getUnixTime";
17
- import { b as E } from "./Localization-2MODESHW.mjs";
18
- import { a as F } from "./NumberFormatting-Buh7u8Oi.mjs";
19
- import { f as B, D as U } from "./Dialog-CWW597AF.mjs";
20
- var a = /* @__PURE__ */ ((e) => (e[e.DEBT_TRACK = 1] = "DEBT_TRACK", e[e.SAVINGS_TRACK = 2] = "SAVINGS_TRACK", e[e.RETIREMENT_TRACK = 3] = "RETIREMENT_TRACK", e[e.EMERGENCY_FUND_TRACK = 4] = "EMERGENCY_FUND_TRACK", e))(a || {}), $ = /* @__PURE__ */ ((e) => (e[e.SAVE_AMOUNT = 1] = "SAVE_AMOUNT", e[e.KEEP_BALANCE_BELOW = 2] = "KEEP_BALANCE_BELOW", e[e.KEEP_BALANCE_ABOVE = 3] = "KEEP_BALANCE_ABOVE", e[e.ACTION = 4] = "ACTION", e))($ || {}), l = /* @__PURE__ */ ((e) => (e[e.AUTOMOBILE = 1] = "AUTOMOBILE", e[e.COLLEGE = 2] = "COLLEGE", e[e.HOUSE = 3] = "HOUSE", e[e.RECREATIONAL_VEHICLE = 4] = "RECREATIONAL_VEHICLE", e[e.VACATION = 5] = "VACATION", e[e.ELECTRONIC = 6] = "ELECTRONIC", e[e.OTHER = 7] = "OTHER", e[e.RETIREMENT = 8] = "RETIREMENT", e[e.EMERGENCY_FUND = 9] = "EMERGENCY_FUND", e[e.SETUP_BUDGETS = 10] = "SETUP_BUDGETS", e[e.START_MONEY_MANAGEMENT = 11] = "START_MONEY_MANAGEMENT", e[e.CREDIT_CARD = 12] = "CREDIT_CARD", e[e.LINE_OF_CREDIT = 13] = "LINE_OF_CREDIT", e[e.LOANS = 14] = "LOANS", e))(l || {});
15
+ import { addYears as F } from "date-fns/addYears";
16
+ import { getUnixTime as x } from "date-fns/getUnixTime";
17
+ import { b as d } from "./Localization-2MODESHW.mjs";
18
+ import { a as K } from "./NumberFormatting-Buh7u8Oi.mjs";
19
+ import { f as B, D as P } from "./Dialog-CWW597AF.mjs";
20
+ var a = /* @__PURE__ */ ((e) => (e[e.DEBT_TRACK = 1] = "DEBT_TRACK", e[e.SAVINGS_TRACK = 2] = "SAVINGS_TRACK", e[e.RETIREMENT_TRACK = 3] = "RETIREMENT_TRACK", e[e.EMERGENCY_FUND_TRACK = 4] = "EMERGENCY_FUND_TRACK", e))(a || {}), $ = /* @__PURE__ */ ((e) => (e[e.SAVE_AMOUNT = 1] = "SAVE_AMOUNT", e[e.KEEP_BALANCE_BELOW = 2] = "KEEP_BALANCE_BELOW", e[e.KEEP_BALANCE_ABOVE = 3] = "KEEP_BALANCE_ABOVE", e[e.ACTION = 4] = "ACTION", e))($ || {}), c = /* @__PURE__ */ ((e) => (e[e.AUTOMOBILE = 1] = "AUTOMOBILE", e[e.COLLEGE = 2] = "COLLEGE", e[e.HOUSE = 3] = "HOUSE", e[e.RECREATIONAL_VEHICLE = 4] = "RECREATIONAL_VEHICLE", e[e.VACATION = 5] = "VACATION", e[e.ELECTRONIC = 6] = "ELECTRONIC", e[e.OTHER = 7] = "OTHER", e[e.RETIREMENT = 8] = "RETIREMENT", e[e.EMERGENCY_FUND = 9] = "EMERGENCY_FUND", e[e.SETUP_BUDGETS = 10] = "SETUP_BUDGETS", e[e.START_MONEY_MANAGEMENT = 11] = "START_MONEY_MANAGEMENT", e[e.CREDIT_CARD = 12] = "CREDIT_CARD", e[e.LINE_OF_CREDIT = 13] = "LINE_OF_CREDIT", e[e.LOANS = 14] = "LOANS", e))(c || {});
21
21
  const at = ({ description: e, label: t, title: o }) => {
22
- const { config: r } = y(), [n, s] = u.useState(!1);
23
- return /* @__PURE__ */ g(u.Fragment, { children: [
24
- /* @__PURE__ */ g(I, { sx: { m: 24 }, children: [
25
- /* @__PURE__ */ _(
22
+ const { config: r } = b(), [n, s] = u.useState(!1);
23
+ return /* @__PURE__ */ _(u.Fragment, { children: [
24
+ /* @__PURE__ */ _(I, { sx: { m: 24 }, children: [
25
+ /* @__PURE__ */ l(
26
26
  O,
27
27
  {
28
- avatar: /* @__PURE__ */ _(w, {}),
28
+ avatar: /* @__PURE__ */ l(S, {}),
29
29
  sx: { ".MuiCardHeader-avatar": { mr: 8 } },
30
- title: /* @__PURE__ */ _(A, { bold: !0, variant: "Body", children: o })
30
+ title: /* @__PURE__ */ l(g, { bold: !0, variant: "Body", children: o })
31
31
  }
32
32
  ),
33
- /* @__PURE__ */ _(N, { sx: { ":last-child": { pb: 4 }, ml: 28, py: 0 }, children: /* @__PURE__ */ g(S, { alignItems: "flex-start", spacing: 2, children: [
34
- /* @__PURE__ */ _(A, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "ParagraphSmall", children: e }),
35
- r.show_connections_widget_in_master && /* @__PURE__ */ _(
33
+ /* @__PURE__ */ l(N, { sx: { ":last-child": { pb: 4 }, ml: 28, py: 0 }, children: /* @__PURE__ */ _(w, { alignItems: "flex-start", spacing: 2, children: [
34
+ /* @__PURE__ */ l(g, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "ParagraphSmall", children: e }),
35
+ r.show_connections_widget_in_master && /* @__PURE__ */ l(
36
36
  T,
37
37
  {
38
- endIcon: /* @__PURE__ */ _(L, {}),
38
+ endIcon: /* @__PURE__ */ l(L, {}),
39
39
  onClick: () => s(!0),
40
40
  sx: {
41
41
  pl: 0,
@@ -49,8 +49,8 @@ const at = ({ description: e, label: t, title: o }) => {
49
49
  )
50
50
  ] }) })
51
51
  ] }),
52
- /* @__PURE__ */ _(
53
- b,
52
+ /* @__PURE__ */ l(
53
+ y,
54
54
  {
55
55
  onClose: () => s(!1),
56
56
  showConnectWidget: n,
@@ -59,7 +59,7 @@ const at = ({ description: e, label: t, title: o }) => {
59
59
  )
60
60
  ] });
61
61
  };
62
- class R {
62
+ class A {
63
63
  fetchInstance;
64
64
  constructor(t, o, r) {
65
65
  this.fetchInstance = new v(t, o, void 0, r);
@@ -90,12 +90,12 @@ function it(e, t) {
90
90
  style: "percent",
91
91
  minimumFractionDigits: 0,
92
92
  maximumFractionDigits: 0
93
- }, d = t.is_complete ? t.completed_at : t.projected_to_complete_at, m = d ? G(d) : /* @__PURE__ */ new Date(), f = E(
93
+ }, m = t.is_complete ? t.completed_at : t.projected_to_complete_at, C = m ? G(m) : /* @__PURE__ */ new Date(), f = d(
94
94
  e.goal_percentage,
95
- F(r, h)
96
- ), p = E(
95
+ K(r, h)
96
+ ), p = d(
97
97
  t.is_complete ? e.completed_label : e.goal_projection,
98
- B(m, U.MONTH_SHORT_YEAR)
98
+ B(C, P.MONTH_SHORT_YEAR)
99
99
  );
100
100
  return {
101
101
  backgroundColor: n,
@@ -116,27 +116,27 @@ function st(e) {
116
116
  {
117
117
  icon: "ecg_heart",
118
118
  label: e.saving_goal_emergency_fund,
119
- metaType: l.EMERGENCY_FUND
119
+ metaType: c.EMERGENCY_FUND
120
120
  },
121
121
  {
122
122
  icon: "directions_car",
123
123
  label: e.saving_gaol_automobile,
124
- metaType: l.AUTOMOBILE
124
+ metaType: c.AUTOMOBILE
125
125
  },
126
- { icon: "school", label: e.saving_goal_college, metaType: l.COLLEGE },
127
- { icon: "home", label: e.saving_goal_home, metaType: l.HOUSE },
126
+ { icon: "school", label: e.saving_goal_college, metaType: c.COLLEGE },
127
+ { icon: "home", label: e.saving_goal_home, metaType: c.HOUSE },
128
128
  {
129
129
  icon: "mountain_flag",
130
130
  label: e.saving_goal_recreational,
131
- metaType: l.RECREATIONAL_VEHICLE
131
+ metaType: c.RECREATIONAL_VEHICLE
132
132
  },
133
- { icon: "airplane_ticket", label: e.saving_goal_vacation, metaType: l.VACATION },
133
+ { icon: "airplane_ticket", label: e.saving_goal_vacation, metaType: c.VACATION },
134
134
  {
135
135
  icon: "desktop_windows",
136
136
  label: e.saving_goal_electronic,
137
- metaType: l.ELECTRONIC
137
+ metaType: c.ELECTRONIC
138
138
  },
139
- { icon: "payments", label: e.saving_goal_other, metaType: l.OTHER }
139
+ { icon: "payments", label: e.saving_goal_other, metaType: c.OTHER }
140
140
  ],
141
141
  type: a.SAVINGS_TRACK
142
142
  },
@@ -161,31 +161,48 @@ function st(e) {
161
161
  const ct = (e, t) => {
162
162
  switch (e) {
163
163
  case a.DEBT_TRACK:
164
- return E(t.zero_state_ongoing, "debt");
164
+ return d(t.zero_state_ongoing, "debt");
165
165
  case a.SAVINGS_TRACK:
166
- return E(t.zero_state_ongoing, "saving");
166
+ return d(t.zero_state_ongoing, "saving");
167
167
  default:
168
- return E(t.zero_state_ongoing, "retirement");
168
+ return d(t.zero_state_ongoing, "retirement");
169
169
  }
170
- }, C = (e, t) => {
171
- const o = G(t), r = x(o, e);
172
- return K(r);
170
+ }, R = (e, t) => {
171
+ const o = G(t), r = F(o, e);
172
+ return x(r);
173
173
  };
174
174
  class lt {
175
175
  globalStore;
176
- api = new R("/", "");
177
- alert = "";
176
+ api = new A("/", "");
178
177
  goals = [];
178
+ goalsLoaded = !1;
179
+ retirementGoals = [];
180
+ retirementGoalsLoaded = !1;
179
181
  retirementGoalAccounts = [];
182
+ retirementGoalAccountsLoaded = !1;
183
+ monthlyCashFlowProfile = void 0;
184
+ monthlyCashFlowProfileLoaded = !1;
180
185
  newRetirementGoalAccounts = [];
186
+ alert = "";
181
187
  selectedGoal = void 0;
182
- monthlyCashFlowProfile = void 0;
183
- goalsLoaded = !1;
184
188
  constructor(t) {
185
- this.globalStore = t, this.api = new R(t.endpoint, t.sessionToken, t.onError), D(this);
189
+ this.globalStore = t, this.api = new A(t.endpoint, t.sessionToken, t.onError), D(this);
190
+ }
191
+ get allGoals() {
192
+ const t = this.globalStore.copyStore.copy.goals, o = this.globalStore.userStore.user.birthday;
193
+ return [
194
+ ...this.goals,
195
+ ...this.retirementGoals.map((r) => ({
196
+ ...r,
197
+ amount: r.target_amount,
198
+ name: t.retirement,
199
+ track_type: a.RETIREMENT_TRACK,
200
+ projected_to_complete_at: r.retirement_age && o ? R(r.retirement_age, o) : void 0
201
+ }))
202
+ ];
186
203
  }
187
204
  get orderedGoals() {
188
- return this.goals.slice().sort((t, o) => t.position - o.position);
205
+ return this.allGoals.slice().sort((t, o) => t.position - o.position);
189
206
  }
190
207
  get debtGoals() {
191
208
  return this.orderedGoals.filter((t) => t.track_type === a.DEBT_TRACK);
@@ -197,7 +214,7 @@ class lt {
197
214
  return this.orderedGoals.filter((t) => t.track_type === a.SAVINGS_TRACK);
198
215
  }
199
216
  get ongoingGoalsForMicroWidget() {
200
- const t = this.goals.filter(
217
+ const t = this.allGoals.filter(
201
218
  (r) => !r.is_complete && r.track_type !== a.EMERGENCY_FUND_TRACK && r.track_type !== null
202
219
  ), o = [
203
220
  a.SAVINGS_TRACK,
@@ -209,12 +226,62 @@ class lt {
209
226
  return s - h;
210
227
  }).slice(0, 3);
211
228
  }
229
+ setGoals = (t) => {
230
+ this.goals = t, this.goalsLoaded = !0;
231
+ };
232
+ setRetirementGoals = (t) => {
233
+ this.retirementGoals = t, this.retirementGoalsLoaded = !0;
234
+ };
235
+ setRetirementGoalAccounts = (t) => {
236
+ this.retirementGoalAccounts = t, this.retirementGoalAccountsLoaded = !0;
237
+ };
238
+ setMonthlyCashFlowProfile = (t) => {
239
+ this.monthlyCashFlowProfile = t, this.monthlyCashFlowProfileLoaded = !0;
240
+ };
241
+ loadGoalData = async () => {
242
+ await Promise.all([
243
+ this.loadGoals(),
244
+ this.loadRetirementGoals(),
245
+ this.loadRetirementGoalAccounts(),
246
+ this.loadMonthlyCashFlowProfile()
247
+ ]);
248
+ };
249
+ loadGoals = async () => {
250
+ try {
251
+ const t = await this.api.getGoals();
252
+ this.setGoals(t);
253
+ } catch (t) {
254
+ console.error(`Error occured while getting goals: ${t}`);
255
+ }
256
+ };
257
+ loadRetirementGoals = async () => {
258
+ try {
259
+ const t = await this.api.getRetirementGoals();
260
+ this.setRetirementGoals(t);
261
+ } catch (t) {
262
+ console.error(`Error occurred while loading retirement goals: ${t}`);
263
+ }
264
+ };
265
+ loadRetirementGoalAccounts = async () => {
266
+ try {
267
+ const t = await this.api.getRetirementGoalAccounts();
268
+ this.setRetirementGoalAccounts(t);
269
+ } catch (t) {
270
+ console.error(`Error occurred while loading retirement goal accounts: ${t}`);
271
+ }
272
+ };
273
+ loadMonthlyCashFlowProfile = async () => {
274
+ try {
275
+ const t = await this.api.getMonthlyCashFlowProfile();
276
+ this.setMonthlyCashFlowProfile(t);
277
+ } catch (t) {
278
+ console.error(`Error occurred while loading monthly cash flow profile: ${t}`);
279
+ }
280
+ };
212
281
  addGoal = async (t) => {
213
282
  try {
214
283
  const o = await this.api.addGoal(t);
215
- c(() => {
216
- this.goals = [...this.goals, o];
217
- });
284
+ this.setGoals([...this.goals, o]);
218
285
  } catch (o) {
219
286
  console.error(`Error occurred while adding goal: ${o}`);
220
287
  }
@@ -224,24 +291,22 @@ class lt {
224
291
  try {
225
292
  const r = await this.api.addRetirementGoal(t), n = [], s = this.globalStore.userStore.user.birthday;
226
293
  for (const h of this.newRetirementGoalAccounts) {
227
- const d = await this.api.addRetirementGoalAccount({
294
+ const m = await this.api.addRetirementGoalAccount({
228
295
  ...h,
229
296
  retirement_goal_guid: r.guid
230
297
  });
231
- n.push(d);
298
+ n.push(m);
232
299
  }
233
- this.setNewRetirementGoalAccounts([]), c(() => {
234
- this.goals = [
235
- ...this.goals,
236
- {
237
- ...r,
238
- amount: r.target_amount,
239
- name: o.retirement,
240
- track_type: a.RETIREMENT_TRACK,
241
- projected_to_complete_at: r.retirement_age && s ? C(r.retirement_age, s) : void 0
242
- }
243
- ], this.retirementGoalAccounts = [...this.retirementGoalAccounts, ...n];
244
- });
300
+ this.setNewRetirementGoalAccounts([]), this.retirementGoals = [
301
+ ...this.retirementGoals,
302
+ {
303
+ ...r,
304
+ amount: r.target_amount,
305
+ name: o.retirement,
306
+ track_type: a.RETIREMENT_TRACK,
307
+ projected_to_complete_at: r.retirement_age && s ? R(r.retirement_age, s) : void 0
308
+ }
309
+ ], this.setRetirementGoalAccounts([...this.retirementGoalAccounts, ...n]);
245
310
  } catch (r) {
246
311
  console.error(`Error occurred while adding retirement goal: ${r}`);
247
312
  }
@@ -249,39 +314,18 @@ class lt {
249
314
  addRetirementGoalAccount = async (t) => {
250
315
  try {
251
316
  const o = await this.api.addRetirementGoalAccount(t);
252
- c(() => {
317
+ E(() => {
253
318
  this.retirementGoalAccounts = [...this.retirementGoalAccounts, o];
254
319
  });
255
320
  } catch (o) {
256
321
  console.error(`Error occurred while adding retirement goal account: ${o}`);
257
322
  }
258
323
  };
259
- loadGoals = async () => {
260
- const t = this.globalStore.copyStore.copy.goals;
261
- try {
262
- const o = await this.api.getGoals(), r = await this.api.getRetirementGoals(), n = await this.api.getRetirementGoalAccounts(), s = await this.api.getMonthlyCashFlowProfile(), h = this.globalStore.userStore.user.birthday, d = [
263
- ...o,
264
- ...r.map((m) => ({
265
- ...m,
266
- amount: m.target_amount,
267
- name: t.retirement,
268
- track_type: a.RETIREMENT_TRACK,
269
- projected_to_complete_at: m.retirement_age && h ? C(m.retirement_age, h) : void 0
270
- }))
271
- ];
272
- c(() => {
273
- this.goals = d, this.retirementGoalAccounts = n, this.monthlyCashFlowProfile = s, this.goalsLoaded = !0;
274
- });
275
- } catch (o) {
276
- console.error(`Error occured while getting goals: ${o}`);
277
- }
278
- };
279
324
  deleteGoal = async (t) => {
280
325
  try {
281
- await this.api.removeGoal(t), c(() => {
282
- const o = this.goals.findIndex((r) => r.guid === t);
283
- o >= 0 && this.goals.splice(o, 1);
284
- });
326
+ await this.api.removeGoal(t);
327
+ const o = this.goals.findIndex((r) => r.guid === t);
328
+ o >= 0 && this.goals.splice(o, 1);
285
329
  } catch (o) {
286
330
  console.error(`Error occured while deleting goal: ${o}`);
287
331
  }
@@ -289,24 +333,22 @@ class lt {
289
333
  deleteRetirementGoal = async (t) => {
290
334
  try {
291
335
  const o = this.retirementGoalAccounts.filter(
292
- (r) => r.retirement_goal_guid === t.guid
336
+ (n) => n.retirement_goal_guid === t.guid
293
337
  );
294
- for (const r of o)
295
- await this.deleteRetirementGoalAccount(r.guid);
296
- await this.api.removeRetirementGoal(t.guid), c(() => {
297
- const r = this.goals.findIndex((n) => n.guid === t.guid);
298
- r >= 0 && this.goals.splice(r, 1);
299
- });
338
+ for (const n of o)
339
+ await this.deleteRetirementGoalAccount(n.guid);
340
+ await this.api.removeRetirementGoal(t.guid);
341
+ const r = this.retirementGoals.findIndex((n) => n.guid === t.guid);
342
+ r >= 0 && this.retirementGoals.splice(r, 1);
300
343
  } catch (o) {
301
344
  console.error(`Error deleting retirement goal: ${o}`);
302
345
  }
303
346
  };
304
347
  deleteRetirementGoalAccount = async (t) => {
305
348
  try {
306
- await this.api.removeRetirementGoalAccount(t), c(() => {
307
- const o = this.retirementGoalAccounts.findIndex((r) => r.guid === t);
308
- o >= 0 && this.retirementGoalAccounts.splice(o, 1);
309
- });
349
+ await this.api.removeRetirementGoalAccount(t);
350
+ const o = this.retirementGoalAccounts.findIndex((r) => r.guid === t);
351
+ o >= 0 && this.retirementGoalAccounts.splice(o, 1);
310
352
  } catch (o) {
311
353
  console.error(`Error deleting retirement goal account: ${o}`);
312
354
  }
@@ -314,7 +356,7 @@ class lt {
314
356
  reorderGoals = async (t) => {
315
357
  try {
316
358
  const o = await this.api.reorderGoals(t);
317
- c(() => {
359
+ E(() => {
318
360
  for (const r of o) {
319
361
  const n = this.goals.findIndex((s) => s.guid === r.guid);
320
362
  n >= 0 && (this.goals[n].position = r.position);
@@ -332,7 +374,7 @@ class lt {
332
374
  updateGoal = async (t) => {
333
375
  try {
334
376
  const o = await this.api.updateGoal(t);
335
- c(() => {
377
+ E(() => {
336
378
  const r = this.goals.findIndex((n) => n.guid === t.guid);
337
379
  r >= 0 && (this.goals[r] = o), this.selectedGoal?.guid === t.guid && this.setSelectedGoal(o);
338
380
  });
@@ -343,9 +385,7 @@ class lt {
343
385
  updateMonthlyCashFlowProfile = async (t) => {
344
386
  try {
345
387
  const o = await this.api.updateMonthlyCashFlowProfile(t);
346
- c(() => {
347
- this.monthlyCashFlowProfile = o;
348
- });
388
+ this.setMonthlyCashFlowProfile(o);
349
389
  } catch (o) {
350
390
  console.error(`Error occurred while updating monthly Cash Flow profile: ${o}`);
351
391
  }
@@ -354,11 +394,11 @@ class lt {
354
394
  export {
355
395
  at as C,
356
396
  $ as G,
357
- l as M,
397
+ c as M,
358
398
  a as T,
359
399
  ct as a,
360
400
  st as b,
361
- R as c,
401
+ A as c,
362
402
  lt as d,
363
403
  it as g
364
404
  };
@@ -10,13 +10,13 @@ import ie from "@mui/material/ListItem";
10
10
  import se from "@mui/material/ListItemAvatar";
11
11
  import ce from "@mui/material/ListItemButton";
12
12
  import le from "@mui/material/ListItemText";
13
- import { F as d, S as N, D as Y, g as Q, R as E, e as de } from "./RecurringTransactions-ej39mgA6.mjs";
13
+ import { F as d, S as N, D as Y, g as Q, R as E, e as de } from "./RecurringTransactions-DK8dWldr.mjs";
14
14
  import { subDays as ue } from "date-fns/subDays";
15
15
  import { startOfToday as z } from "date-fns/startOfToday";
16
16
  import { endOfMonth as _e } from "date-fns/endOfMonth";
17
17
  import $ from "@mui/material/Button";
18
18
  import { Delete as me, Add as pe, ReceiptLong as he } from "@mxenabled/mx-icons";
19
- import { T as X, a as ye, u as ge, S as fe, b as Ce } from "./TransactionDetails-BqCr2FTh.mjs";
19
+ import { T as X, a as ye, u as ge, S as fe, b as Ce } from "./TransactionDetails-oP1eSuiS.mjs";
20
20
  import { getDayOfYear as be } from "date-fns/getDayOfYear";
21
21
  import { setDayOfYear as xe } from "date-fns/setDayOfYear";
22
22
  import { AdapterDateFns as Se } from "@mui/x-date-pickers/AdapterDateFnsV3";
@@ -25,7 +25,7 @@ import { LocalizationProvider as we } from "@mui/x-date-pickers/LocalizationProv
25
25
  import { u as w, j as M, g as F, b as Ae, h as Z, p as De } from "./hooks-D6XlXHf4.mjs";
26
26
  import { b as Ie, f as J } from "./NumberFormatting-Buh7u8Oi.mjs";
27
27
  import { D as O } from "./Drawer-kEE73B87.mjs";
28
- import { A as R } from "./WidgetContainer-EbrN1oIo.mjs";
28
+ import { A as R } from "./WidgetContainer-BHWANqT4.mjs";
29
29
  import { f as Ee, D as Re, a as Te } from "./Dialog-CWW597AF.mjs";
30
30
  import { formatISO as Le } from "date-fns/formatISO";
31
31
  import { fromUnixTime as Oe } from "date-fns/fromUnixTime";
@@ -3,8 +3,8 @@ import { format as A } from "date-fns/format";
3
3
  import { fromUnixTime as W } from "date-fns/fromUnixTime";
4
4
  import { startOfMonth as _ } from "date-fns/startOfMonth";
5
5
  import { subMonths as B } from "date-fns/subMonths";
6
- import { a as b } from "./Accounts-C1QxUB-e.mjs";
7
- import { e as N, a as M, f as v } from "./ConnectDrawer-Bw5s6Dw1.mjs";
6
+ import { a as b } from "./Accounts-BRf_YeTf.mjs";
7
+ import { h as N, a as M, i as v } from "./ConnectDrawer-BQNs-hjk.mjs";
8
8
  const f = 13, L = (n, t) => n.filter((e) => {
9
9
  const { is_closed: r, is_deleted: s, is_hidden: a, is_manual: i } = e;
10
10
  return r || s || a ? !1 : i || !e.guid ? !0 : t.some((l) => n.some((g) => l.guid === g.member_guid));