@mx-cartographer/experiences 7.2.10 → 7.2.12-alpha-ram1-finstrong-testing

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 (124) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{Account-B-CuHOYf.mjs → Account-CBQnFO6w.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-DfzPOeMI.mjs → AccountDetailsContent-BkurfGCr.mjs} +48 -44
  4. package/dist/{AccountDetailsHeader-vcy67tuH.mjs → AccountDetailsHeader-CaIoP_2Q.mjs} +8 -8
  5. package/dist/{AccountFields-cUP-9Hm6.mjs → AccountFields-CLbLAhLf.mjs} +5 -5
  6. package/dist/{AccountListItem-DChcf3SN.mjs → AccountListItem-CPm3572e.mjs} +4 -4
  7. package/dist/{AccountStore-D6KiXA1B.mjs → AccountStore-DttEGFeu.mjs} +40 -29
  8. package/dist/{Accounts-IeEtQjzA.mjs → Accounts-B5Yr0e_o.mjs} +1 -1
  9. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-wjoNuj7B.mjs} +1 -1
  10. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-ZO9N26Kx.mjs} +3 -3
  11. package/dist/{CategoryStore-BCcpI3oJ.mjs → CategoryStore-C1IfDPCE.mjs} +1 -1
  12. package/dist/{CategoryUtil-BR3H5i6n.mjs → CategoryUtil-DUM8NuGO.mjs} +1 -1
  13. package/dist/{ConnectDrawer-DaFRU5st.mjs → ConnectDrawer-FyY0AWYQ.mjs} +2 -2
  14. package/dist/{ConnectionsDrawer-DHJ7qdWL.mjs → ConnectionsDrawer-Cd_rztVC.mjs} +3 -3
  15. package/dist/CurrencyInput-xH-hqry9.mjs +85 -0
  16. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
  17. package/dist/{DebtsStore-z3VARSO6.mjs → DebtsStore-DB5U2WMC.mjs} +1 -1
  18. package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
  19. package/dist/Drawer-BEtCk82g.mjs +163 -0
  20. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-DlGZfm4y.mjs} +3 -3
  21. package/dist/FinstrongStore-CJBV4K5Y.mjs +432 -0
  22. package/dist/{GoalStore-TD0BfzWX.mjs → GoalStore-deVLYr7n.mjs} +3 -3
  23. package/dist/{Help-B6dIcujh.mjs → Help-BnPXM_N2.mjs} +2 -2
  24. package/dist/{LineChart-D4GI7nVh.mjs → LineChart-Ct9DNmhS.mjs} +209 -181
  25. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-uobBrm_a.mjs} +10 -10
  26. package/dist/{ManageIncome-D3n1EWxe.mjs → ManageIncome-CqNstpx_.mjs} +63 -61
  27. package/dist/{MicroWidgetContainer-DpeqN9n3.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
  28. package/dist/{MiniWidgetContainer-D0gfmbaF.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
  29. package/dist/{NetWorthStore-B_1oulrt.mjs → NetWorthStore-CUz0bwVm.mjs} +2 -2
  30. package/dist/{NotificationSettings-BRm_EJZV.mjs → NotificationSettings-BKKuULAd.mjs} +5 -5
  31. package/dist/{OriginalBalanceAction-CAaVbVMO.mjs → OriginalBalanceAction-CCmnsd7y.mjs} +3 -3
  32. package/dist/{RecurringSettings-C28GrQcP.mjs → RecurringSettings-DfAMEAuh.mjs} +4 -4
  33. package/dist/{RecurringTransactions-ej39mgA6.mjs → RecurringTransactions-CngsRZ3K.mjs} +45 -44
  34. package/dist/{RecurringTransactionsStore-DrzS1LmF.mjs → RecurringTransactionsStore-C4RVULF8.mjs} +1 -1
  35. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-BuJ03S9d.mjs} +16 -16
  36. package/dist/SpendingLegend-squvjEhu.mjs +170 -0
  37. package/dist/{TransactionDetails-BWffqew4.mjs → TransactionDetails-CabNHK_I.mjs} +12 -12
  38. package/dist/{TransactionStore-DxPLdF3B.mjs → TransactionStore-DvOEbOzL.mjs} +3 -3
  39. package/dist/{TrendsStore-DCYbpXPO.mjs → TrendsStore-BVNxGsE4.mjs} +14 -14
  40. package/dist/{User-BQUxBeZV.mjs → User-wXzDI4M8.mjs} +2 -2
  41. package/dist/{WidgetContainer-C88Ecu2W.mjs → WidgetContainer-GoNq8wwm.mjs} +4 -4
  42. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  43. package/dist/accounts/index.es.js +14 -14
  44. package/dist/accounts/stores/AccountStore.d.ts +2 -0
  45. package/dist/analytics/index.es.js +2 -2
  46. package/dist/budgets/index.es.js +12 -12
  47. package/dist/cashflow/index.es.js +44 -44
  48. package/dist/categories/index.es.js +2 -2
  49. package/dist/common/components/Select.d.ts +4 -2
  50. package/dist/common/components/charts/LineChart.d.ts +8 -2
  51. package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
  52. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  53. package/dist/common/components/drawer/Footer.d.ts +17 -0
  54. package/dist/common/index.es.js +33 -33
  55. package/dist/common/types/Finstrong.d.ts +50 -0
  56. package/dist/common/types/index.d.ts +1 -1
  57. package/dist/common/types/localization/FinstrongCopy.d.ts +58 -1
  58. package/dist/dashboard/index.es.js +2 -2
  59. package/dist/debts/index.es.js +11 -11
  60. package/dist/{exportTransactionsToCSV-7bVS7KXf.mjs → exportTransactionsToCSV-hrNpJ77n.mjs} +2 -2
  61. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  62. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  63. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  64. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  65. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  66. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  67. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  68. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  69. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  70. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  71. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  72. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  73. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  74. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  75. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  76. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  77. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  78. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  79. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  80. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  81. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  82. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  83. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  84. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  85. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  86. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  87. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  88. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +11 -0
  89. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  90. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  91. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  92. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  93. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  94. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  95. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  96. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
  97. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  98. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  99. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  100. package/dist/finstrong/components/shared/TransactionList.d.ts +15 -0
  101. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  102. package/dist/finstrong/constants/index.d.ts +8 -0
  103. package/dist/finstrong/index.es.js +3119 -1044
  104. package/dist/finstrong/stores/FinstrongStore.d.ts +9 -1
  105. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  106. package/dist/goals/index.es.js +14 -14
  107. package/dist/help/index.es.js +3 -3
  108. package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
  109. package/dist/investments/index.es.js +4 -4
  110. package/dist/merchants/index.es.js +1 -1
  111. package/dist/networth/index.es.js +34 -34
  112. package/dist/notifications/index.es.js +4 -4
  113. package/dist/recurringtransactions/index.es.js +13 -13
  114. package/dist/settings/index.es.js +8 -8
  115. package/dist/spending/index.es.js +222 -373
  116. package/dist/transactions/index.es.js +103 -103
  117. package/dist/trends/index.es.js +94 -94
  118. package/dist/{useAccountDisplayName-BcRqfar8.mjs → useAccountDisplayName-B5O6hQ1B.mjs} +2 -2
  119. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  120. package/package.json +1 -1
  121. package/dist/CurrencyInput-CsCy7uaS.mjs +0 -83
  122. package/dist/Drawer-kEE73B87.mjs +0 -113
  123. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  124. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
@@ -0,0 +1,432 @@
1
+ import { makeAutoObservable as b, runInAction as l } from "mobx";
2
+ import { format as R } from "date-fns/format";
3
+ import { fromUnixTime as D } from "date-fns/fromUnixTime";
4
+ import { getUnixTime as I } from "date-fns/getUnixTime";
5
+ import { subMonths as H } from "date-fns/subMonths";
6
+ import { F as x, A as h } from "./Fetch-87LIQbEA.mjs";
7
+ import { jsx as i, jsxs as T } from "react/jsx-runtime";
8
+ import { addDays as v } from "date-fns/addDays";
9
+ import { addMonths as M } from "date-fns/addMonths";
10
+ import { addYears as G } from "date-fns/addYears";
11
+ import { differenceInDays as L } from "date-fns/differenceInDays";
12
+ import { differenceInMonths as w } from "date-fns/differenceInMonths";
13
+ import { differenceInWeeks as A } from "date-fns/differenceInWeeks";
14
+ import { startOfToday as N } from "date-fns/startOfToday";
15
+ import { ChevronRight as P, Check as k } from "@mxenabled/mx-icons";
16
+ import $ from "react";
17
+ import B from "@mui/material/Avatar";
18
+ import K from "@mui/material/Box";
19
+ import Y from "@mui/material/Divider";
20
+ import U from "@mui/material/List";
21
+ import X from "@mui/material/ListItem";
22
+ import V from "@mui/material/ListItemAvatar";
23
+ import j from "@mui/material/ListItemButton";
24
+ import z from "@mui/material/ListItemText";
25
+ import { Text as F } from "@mxenabled/mxui";
26
+ import { f as _, a as C } from "./Dialog-BPTr3qHE.mjs";
27
+ import { b as W } from "./Localization-2MODESHW.mjs";
28
+ const m = {
29
+ creditScore: {
30
+ poor: 600,
31
+ good: 720
32
+ },
33
+ daysOfCashOnHand: {
34
+ poor: 30,
35
+ good: 90
36
+ },
37
+ debtToIncomeRatio: {
38
+ poor: 40,
39
+ good: 30
40
+ },
41
+ emergencySavings: {
42
+ poor: 750,
43
+ good: 1e3
44
+ },
45
+ spendToIncomeRatio: {
46
+ poor: 110,
47
+ good: 100
48
+ }
49
+ }, S = {
50
+ GOOD: "Good",
51
+ FAIR: "Fair",
52
+ OFF_TRACK: "Off Track",
53
+ MISSING: "Missing"
54
+ };
55
+ var O = /* @__PURE__ */ ((e) => (e.Connections = "connections", e.CreditScore = "credit_score", e.DateOfBirth = "date_of_birth", e.MonthlyIncome = "monthly_income", e))(O || {});
56
+ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(K, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(
57
+ U,
58
+ {
59
+ sx: {
60
+ "& .MuiListItemSecondaryAction-root": {
61
+ color: "text.primary",
62
+ pr: 24
63
+ }
64
+ },
65
+ children: e.map((r, n) => /* @__PURE__ */ T($.Fragment, { children: [
66
+ /* @__PURE__ */ i(X, { secondaryAction: /* @__PURE__ */ i(P, {}), children: /* @__PURE__ */ T(j, { onClick: () => t(r.key), children: [
67
+ /* @__PURE__ */ i(V, { children: /* @__PURE__ */ i(
68
+ B,
69
+ {
70
+ sx: {
71
+ bgcolor: "primary.main",
72
+ ...!r.isComplete && {
73
+ bgcolor: "transparent",
74
+ borderColor: "action.active",
75
+ borderStyle: "solid",
76
+ borderWidth: 1,
77
+ color: "action.active"
78
+ }
79
+ },
80
+ children: r.icon
81
+ }
82
+ ) }),
83
+ /* @__PURE__ */ i(
84
+ z,
85
+ {
86
+ primary: /* @__PURE__ */ i(F, { sx: { color: "text.secondary" }, variant: "caption", children: r.primaryText }),
87
+ secondary: /* @__PURE__ */ i(F, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: r.secondaryText })
88
+ }
89
+ )
90
+ ] }) }),
91
+ n < e.length - 1 && /* @__PURE__ */ i(Y, { sx: { color: "divider", ml: 68 } })
92
+ ] }, r.key))
93
+ }
94
+ ) }), vt = q, Mt = (e) => e * (180 / Math.PI), Gt = (e, t) => [
95
+ {
96
+ description: t.vulnerable_description,
97
+ max: 25,
98
+ scoreContent: t.accordion_details_text.vulnerable,
99
+ status: t.vulnerable
100
+ },
101
+ {
102
+ description: t.building_description,
103
+ max: 50,
104
+ scoreContent: t.accordion_details_text.building,
105
+ status: t.building
106
+ },
107
+ {
108
+ description: t.stable_description,
109
+ max: 75,
110
+ scoreContent: t.accordion_details_text.stable,
111
+ status: t.stable
112
+ },
113
+ {
114
+ description: t.strong_description,
115
+ max: 100,
116
+ scoreContent: t.accordion_details_text.strong,
117
+ status: t.strong
118
+ }
119
+ ].find((o) => e > 0 && e <= o.max) || { status: t.insufficient_data, description: "", scoreContent: "" }, g = {
120
+ POOR: "#8C0E0E",
121
+ FAIR: "#E32727",
122
+ GOOD: "#FFB70D",
123
+ VERY_GOOD: "#0EA26C",
124
+ EXCEPTIONAL: "#005C3D"
125
+ }, u = {
126
+ POOR: "#B21C1C",
127
+ FAIR: "#FF3232",
128
+ GOOD: "#FFC02C",
129
+ VERY_GOOD: "#29C76B",
130
+ EXCEPTIONAL: "#008A5A"
131
+ }, Lt = (e, t, r) => e >= 300 && e < 580 ? {
132
+ status: r.poor,
133
+ color: t ? u.POOR : g.POOR
134
+ } : e >= 580 && e < 670 ? {
135
+ status: r.fair,
136
+ color: t ? u.FAIR : g.FAIR
137
+ } : e >= 670 && e < 740 ? {
138
+ status: r.good,
139
+ color: t ? u.GOOD : g.GOOD
140
+ } : e >= 740 && e < 800 ? {
141
+ status: r.very_good,
142
+ color: t ? u.VERY_GOOD : g.VERY_GOOD
143
+ } : e >= 800 && e <= 850 ? {
144
+ status: r.exceptional,
145
+ color: t ? u.EXCEPTIONAL : g.EXCEPTIONAL
146
+ } : { status: r.missing_data }, wt = (e, t, r, n) => {
147
+ const o = e.reduce((c, d) => c + d.value, 0);
148
+ let a = 0;
149
+ const s = e.map((c) => {
150
+ const d = c.value / o * t, p = r + a, f = p + d;
151
+ return a += d, {
152
+ ...c,
153
+ startAngle: p,
154
+ endAngle: f
155
+ };
156
+ });
157
+ return [s[n].startAngle, s[n].endAngle];
158
+ }, Nt = (e, t, r, n, o) => {
159
+ let a = 0, s = 0;
160
+ const c = Math.floor(n), d = n - c;
161
+ return c > r ? (a = e, s = t) : c === r && d > 0 && (a = e, s = o), [a, s];
162
+ }, Pt = (e, t, r = 0) => {
163
+ const n = e * Math.sin(t - r), o = -e * Math.cos(t - r);
164
+ return [n, o];
165
+ }, kt = ({
166
+ dynamicCopy: e,
167
+ fallbackLabel: t,
168
+ icon: r,
169
+ key: n,
170
+ label: o,
171
+ value: a
172
+ }) => {
173
+ const s = !!a, c = s ? J(n, a) : e && W(e, t) || t;
174
+ return {
175
+ icon: s ? /* @__PURE__ */ i(k, {}) : r,
176
+ isComplete: s,
177
+ key: n,
178
+ primaryText: o,
179
+ secondaryText: c
180
+ };
181
+ }, J = (e, t) => ({
182
+ [O.DateOfBirth]: (n) => R(new Date(Number(n) * 1e3), "MMM d, yyyy"),
183
+ [O.MonthlyIncome]: (n) => `$${n}`
184
+ })[e]?.(t) ?? String(t), $t = (e) => e !== null ? Math.round(e * 100) : null, Bt = (e) => {
185
+ const t = new Date((/* @__PURE__ */ new Date()).getFullYear(), e - 1, 1);
186
+ return _(t, C.MONTH_SHORT);
187
+ }, Kt = (e) => {
188
+ const { good: t, poor: r } = m.daysOfCashOnHand;
189
+ return e === null ? "MISSING" : e >= t ? "GOOD" : e >= r ? "FAIR" : "OFF_TRACK";
190
+ }, Yt = (e) => {
191
+ const { good: t, poor: r } = m.emergencySavings;
192
+ return e === null ? "MISSING" : e >= t ? "GOOD" : e >= r ? "FAIR" : "OFF_TRACK";
193
+ }, Ut = (e) => {
194
+ const { good: t, poor: r } = m.spendToIncomeRatio;
195
+ return e === null ? "MISSING" : e < t ? "GOOD" : e < r ? "FAIR" : "OFF_TRACK";
196
+ }, Xt = (e) => {
197
+ const { good: t, poor: r } = m.debtToIncomeRatio;
198
+ return e === null ? "MISSING" : e <= t ? "GOOD" : e <= r ? "FAIR" : "OFF_TRACK";
199
+ }, Vt = (e) => {
200
+ const { good: t, poor: r } = m.creditScore;
201
+ return e === null ? "MISSING" : e >= t ? "GOOD" : e >= r ? "FAIR" : "OFF_TRACK";
202
+ }, Q = (e) => e === null ? "MISSING" : e === 0 ? "GOOD" : "OFF_TRACK", jt = (e, t) => {
203
+ const r = Q(e), n = {
204
+ GOOD: t.count_good_description,
205
+ OFF_TRACK: t.count_off_track_description,
206
+ MISSING: t.count_missing_description
207
+ };
208
+ return {
209
+ cardState: r,
210
+ description: n[r],
211
+ title: t.count_card_title
212
+ };
213
+ }, zt = (e) => ({
214
+ [S.GOOD]: { backgroundColor: "success.lighter", color: "success.dark" },
215
+ [S.FAIR]: { backgroundColor: "warning.lighter", color: "warning.dark" },
216
+ [S.OFF_TRACK]: { backgroundColor: "error.lighter", color: "error.dark" },
217
+ [S.MISSING]: { backgroundColor: "divider", color: "text.secondary" }
218
+ })[e], Z = 1, tt = 1, et = {
219
+ 1: M,
220
+ 2: G,
221
+ 3: v
222
+ }, rt = {
223
+ 1: w,
224
+ 2: (e, t) => A(e, t) / 2,
225
+ 3: A,
226
+ 4: L
227
+ }, E = [
228
+ { contributionPeriodIndex: 3, targetAmount: 6, upperLimit: 500 },
229
+ { contributionPeriodIndex: 3, targetAmount: 3, upperLimit: 900 },
230
+ { contributionPeriodIndex: 2, targetAmount: 1, upperLimit: 1e3 }
231
+ ], Wt = ({
232
+ contribution: e,
233
+ goalAmount: t,
234
+ goalPeriod: r,
235
+ targetPeriod: n,
236
+ totalSaved: o
237
+ }) => {
238
+ const a = t - o;
239
+ if (a <= 0) return 0;
240
+ const s = N(), c = et[n], d = rt[e];
241
+ if (!c || !d) return a;
242
+ const p = c(s, r), f = d(p, s);
243
+ return Math.max(a / (f || 1), 1);
244
+ }, qt = (e) => !e || e <= 0 ? "0%" : e >= 1e3 ? "100%" : `${Math.round(e / 10)}%`, Jt = (e) => E.find((r) => e < r.upperLimit)?.targetAmount ?? tt, Qt = (e) => E.find((n) => e < n.upperLimit)?.contributionPeriodIndex ?? Z, Zt = (e, t) => e.map((n) => {
245
+ const o = new Date(0, n.month - 1, 1);
246
+ return { x: _(o, C.MONTH_SHORT), y: n[t] };
247
+ }).reverse(), nt = (e) => e.sort((t, r) => t.monthly_health_score_average.month - r.monthly_health_score_average.month).map((t) => ({
248
+ x: _(
249
+ new Date(0, t.monthly_health_score_average.month - 1, 1),
250
+ C.MONTH_SHORT
251
+ ),
252
+ y: Math.round(t.monthly_health_score_average.average_health_score * 10) / 10
253
+ })), ot = (e) => e.sort((r, n) => n.transaction.date - r.transaction.date).map(({ transaction: r }) => ({
254
+ ...r
255
+ }));
256
+ class y {
257
+ fetchInstance;
258
+ constructor(t, r, n) {
259
+ this.fetchInstance = new x(t, r, void 0, n);
260
+ }
261
+ calculateHealthScore = async () => this.fetchInstance.post(`${h.HEALTH_SCORES}/calculate`).then((t) => t.health_score);
262
+ getAverageHealthScores = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/monthly_averages`).then((t) => t);
263
+ getDebtSpend = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/transactions/debt_spend`).then((t) => t);
264
+ getIncome = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/transactions/income`).then((t) => t);
265
+ getMonthlySummaries = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/monthly_summaries`).then((t) => t);
266
+ getHealthScoreChangeReports = async (t, r) => this.fetchInstance.get(`${h.HEALTH_SCORES}/change_report/from/${t}/to/${r}`).then((n) => n);
267
+ getPeerScore = async (t) => this.fetchInstance.get(`${h.HEALTH_SCORES}/average/${t}`).then((r) => r.average_health_score);
268
+ getSpendingFeeTransactions = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/transactions/spending_fee`).then((t) => t);
269
+ getStandardSpend = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/transactions/standard_spend`).then((t) => t);
270
+ }
271
+ class te {
272
+ api = new y("/", "");
273
+ augmentedChartData = [];
274
+ averageHealthScores = [];
275
+ monthlySummaries = [];
276
+ allTransactions = {
277
+ income: [],
278
+ debtSpend: [],
279
+ spendingFee: [],
280
+ spend: []
281
+ };
282
+ globalStore;
283
+ healthScore = {};
284
+ healthScoreChange;
285
+ healthScoreChangeReports = [];
286
+ peerScore = null;
287
+ constructor(t) {
288
+ this.globalStore = t, this.api = new y(t.endpoint, t.sessionToken, t.onError), b(this);
289
+ }
290
+ calculateHealthScore = async () => {
291
+ try {
292
+ const t = await this.api.calculateHealthScore();
293
+ let r = 0;
294
+ await this.loadHealthScoreChangeReports();
295
+ const n = t?.health_score || 0, o = this.healthScoreChangeReports.at(-1)?.older_health_score || 0;
296
+ r = n - o, l(() => {
297
+ this.healthScore = t, this.healthScoreChange = r;
298
+ });
299
+ } catch (t) {
300
+ console.error("Error calculating health score:", t);
301
+ }
302
+ };
303
+ loadAverageHealthScores = async () => {
304
+ try {
305
+ const t = await this.api.getAverageHealthScores();
306
+ l(() => {
307
+ this.averageHealthScores = t;
308
+ });
309
+ } catch (t) {
310
+ console.error("Error loading average health scores:", t);
311
+ }
312
+ };
313
+ loadMonthlySummaries = async () => {
314
+ try {
315
+ const t = await this.api.getMonthlySummaries();
316
+ l(() => {
317
+ this.monthlySummaries = t;
318
+ });
319
+ } catch (t) {
320
+ console.error("Error loading monthly summaries:", t);
321
+ }
322
+ };
323
+ loadDebtSpend = async () => {
324
+ try {
325
+ const t = await this.api.getDebtSpend();
326
+ l(() => {
327
+ this.allTransactions.debtSpend = t;
328
+ });
329
+ } catch (t) {
330
+ console.error("Error loading debt spend:", t);
331
+ }
332
+ };
333
+ loadIncome = async () => {
334
+ try {
335
+ const t = await this.api.getIncome();
336
+ l(() => {
337
+ this.allTransactions.income = t;
338
+ });
339
+ } catch (t) {
340
+ console.error("Error loading income:", t);
341
+ }
342
+ };
343
+ loadHealthScoreChangeReports = async () => {
344
+ const t = I(H(/* @__PURE__ */ new Date(), 2)), r = I(/* @__PURE__ */ new Date());
345
+ try {
346
+ const n = await this.api.getHealthScoreChangeReports(
347
+ t,
348
+ r
349
+ );
350
+ l(() => {
351
+ this.healthScoreChangeReports = n;
352
+ });
353
+ } catch (n) {
354
+ console.error("Error loading health score change reports:", n);
355
+ }
356
+ };
357
+ loadPeerScore = async () => {
358
+ const t = R(D(this.globalStore.appDataStore.user.birthday), "yyyy");
359
+ try {
360
+ const r = await this.api.getPeerScore(t);
361
+ l(() => {
362
+ this.peerScore = r;
363
+ });
364
+ } catch (r) {
365
+ console.error("Error loading peer score:", r);
366
+ }
367
+ };
368
+ loadAugmentedChartData = async () => {
369
+ try {
370
+ const t = await this.api.getAverageHealthScores();
371
+ l(() => {
372
+ this.augmentedChartData = nt(t);
373
+ });
374
+ } catch (t) {
375
+ console.error(`Error occurred while getting augmented chart data: ${t}`);
376
+ }
377
+ };
378
+ getSpendingFeeTransactions = async () => {
379
+ try {
380
+ const t = await this.api.getSpendingFeeTransactions(), r = ot(t);
381
+ l(() => {
382
+ this.allTransactions.spendingFee = r;
383
+ });
384
+ } catch (t) {
385
+ console.error(`Error occurred while getting spending fee transactions: ${t}`);
386
+ }
387
+ };
388
+ loadSpendTransactions = async () => {
389
+ try {
390
+ const t = await this.api.getStandardSpend();
391
+ l(() => {
392
+ this.allTransactions.spend = [...t];
393
+ });
394
+ } catch (t) {
395
+ console.error("Error loading spend transactions:", t);
396
+ }
397
+ };
398
+ get spendAndDebtTransactions() {
399
+ return [...this.allTransactions.spend, ...this.allTransactions.debtSpend];
400
+ }
401
+ }
402
+ export {
403
+ O as A,
404
+ u as C,
405
+ te as F,
406
+ vt as P,
407
+ Nt as a,
408
+ Pt as b,
409
+ Gt as c,
410
+ Lt as d,
411
+ g as e,
412
+ Zt as f,
413
+ wt as g,
414
+ zt as h,
415
+ S as i,
416
+ Vt as j,
417
+ Qt as k,
418
+ Jt as l,
419
+ Wt as m,
420
+ qt as n,
421
+ Yt as o,
422
+ Q as p,
423
+ Kt as q,
424
+ Mt as r,
425
+ $t as s,
426
+ Bt as t,
427
+ jt as u,
428
+ Ut as v,
429
+ Xt as w,
430
+ kt as x,
431
+ y
432
+ };
@@ -7,8 +7,8 @@ import O from "@mui/material/CardHeader";
7
7
  import S from "@mui/material/Stack";
8
8
  import { AccountBalance as w, ChevronRight as L } from "@mxenabled/mx-icons";
9
9
  import { Text as A } from "@mxenabled/mxui";
10
- import { l as b } from "./ConnectDrawer-DaFRU5st.mjs";
11
- import { a as y } from "./hooks-D6XlXHf4.mjs";
10
+ import { l as b } from "./ConnectDrawer-FyY0AWYQ.mjs";
11
+ import { a as y } from "./hooks-C41HAxM5.mjs";
12
12
  import { makeAutoObservable as D, runInAction as c } 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";
@@ -16,7 +16,7 @@ import { addYears as x } from "date-fns/addYears";
16
16
  import { getUnixTime as K } from "date-fns/getUnixTime";
17
17
  import { b as E } from "./Localization-2MODESHW.mjs";
18
18
  import { a as F } from "./NumberFormatting-Buh7u8Oi.mjs";
19
- import { f as B, D as U } from "./Dialog-CWW597AF.mjs";
19
+ import { f as B, a as U } from "./Dialog-BPTr3qHE.mjs";
20
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 || {});
21
21
  const at = ({ description: e, label: t, title: o }) => {
22
22
  const { config: r } = y(), [n, s] = u.useState(!1);
@@ -13,7 +13,7 @@ import E from "@mui/material/Stack";
13
13
  import { H3 as y, P as H, Icon as X, Text as T, H2 as _t, InstitutionLogo as bt } from "@mxenabled/mxui";
14
14
  import { ExpandMore as ot, ChevronRight as wt } from "@mxenabled/mx-icons";
15
15
  import xt from "@mui/material/Breadcrumbs";
16
- import { u as V, A as tt, d as ft, p as St, b as It, a as Tt } from "./hooks-D6XlXHf4.mjs";
16
+ import { u as V, A as tt, d as ft, p as St, b as It, a as Tt } from "./hooks-C41HAxM5.mjs";
17
17
  import { useTheme as Z } from "@mui/material/styles";
18
18
  import { b as s } from "./Localization-2MODESHW.mjs";
19
19
  import { E as Et, a as Ct, P as At } from "./Help-DhcC-C05.mjs";
@@ -21,7 +21,7 @@ import { observer as rt } from "mobx-react-lite";
21
21
  import at from "@mui/material/Alert";
22
22
  import ct from "@mui/material/Snackbar";
23
23
  import lt from "@mui/material/TextField";
24
- import { D as U } from "./Drawer-kEE73B87.mjs";
24
+ import { D as U } from "./Drawer-BEtCk82g.mjs";
25
25
  import { L as dt } from "./Loader-DUaFpDGv.mjs";
26
26
  import Ot from "@mui/material/ListItemAvatar";
27
27
  import Nt from "@mui/material/ListItem";