@mx-cartographer/experiences 9.1.5 → 9.2.0
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.
- package/CHANGELOG.md +8 -0
- package/dist/{Analytics-CkYXKvco.mjs → Analytics-B8AaC22u.mjs} +2 -2
- package/dist/{Analytics-CkYXKvco.mjs.map → Analytics-B8AaC22u.mjs.map} +1 -1
- package/dist/ErrorBoundary-C7BlHx04.mjs +27 -0
- package/dist/ErrorBoundary-C7BlHx04.mjs.map +1 -0
- package/dist/GlobalCopyApi-CLhyon-B.mjs +145 -0
- package/dist/GlobalCopyApi-CLhyon-B.mjs.map +1 -0
- package/dist/{Help-zVZdcmlk.mjs → Help-D4sOpItq.mjs} +2 -2
- package/dist/{Help-zVZdcmlk.mjs.map → Help-D4sOpItq.mjs.map} +1 -1
- package/dist/{UserStore-DApsX4aO.mjs → UserStore-BBceqFxh.mjs} +676 -612
- package/dist/UserStore-BBceqFxh.mjs.map +1 -0
- package/dist/{ViewMoreMicroCard-fnwE0hqd.mjs → ViewMoreMicroCard-B4oeGrbE.mjs} +3 -3
- package/dist/{ViewMoreMicroCard-fnwE0hqd.mjs.map → ViewMoreMicroCard-B4oeGrbE.mjs.map} +1 -1
- package/dist/common/components/ErrorBoundary.d.ts +2 -0
- package/dist/common/index.es.js +3 -3
- package/dist/core/index.es.js +3 -3
- package/dist/core/stores/GlobalStore.d.ts +4 -2
- package/dist/core/types/Handlers.d.ts +1 -0
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/utils/Fetch.d.ts +4 -0
- package/dist/help/index.es.js +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/settings/index.es.js +1 -1
- package/dist/trends/index.es.js +1 -1
- package/package.json +5 -2
- package/dist/ErrorBoundary-CsdOcnJ9.mjs +0 -24
- package/dist/ErrorBoundary-CsdOcnJ9.mjs.map +0 -1
- package/dist/GlobalCopyApi-wcnDUzMV.mjs +0 -129
- package/dist/GlobalCopyApi-wcnDUzMV.mjs.map +0 -1
- package/dist/UserStore-DApsX4aO.mjs.map +0 -1
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { makeAutoObservable as
|
|
2
|
-
import { d as
|
|
3
|
-
import { i as
|
|
4
|
-
import { c as
|
|
5
|
-
import { F as
|
|
6
|
-
import { A as
|
|
7
|
-
import
|
|
8
|
-
import { endOfMonth as
|
|
9
|
-
import { startOfMonth as
|
|
10
|
-
import { startOfToday as
|
|
1
|
+
import { makeAutoObservable as h, runInAction as c, reaction as gt, autorun as mt, observable as Tt } from "mobx";
|
|
2
|
+
import { d as bt, g as At } from "./AccountUtils-Cbh8r9cP.mjs";
|
|
3
|
+
import { i as wt, f as Et, b as It, c as V } from "./BudgetUtil-Bg2AQJpQ.mjs";
|
|
4
|
+
import { c as d, d as $ } from "./Account-DR7Plrqy.mjs";
|
|
5
|
+
import { F as p, B as G, G as z } from "./GlobalCopyApi-CLhyon-B.mjs";
|
|
6
|
+
import { A as n } from "./ApiEndpoints-DXwIYNUV.mjs";
|
|
7
|
+
import Ct from "posthog-js";
|
|
8
|
+
import { endOfMonth as b } from "date-fns/endOfMonth";
|
|
9
|
+
import { startOfMonth as C } from "date-fns/startOfMonth";
|
|
10
|
+
import { startOfToday as f } from "date-fns/startOfToday";
|
|
11
11
|
import { C as w, b as Rt } from "./Category-DEKZGLYe.mjs";
|
|
12
12
|
import { addDays as Dt } from "date-fns/addDays";
|
|
13
|
-
import { differenceInDays as
|
|
14
|
-
import { isBefore as
|
|
13
|
+
import { differenceInDays as xt } from "date-fns/differenceInDays";
|
|
14
|
+
import { isBefore as W } from "date-fns/isBefore";
|
|
15
15
|
import { getUnixTime as m } from "date-fns/getUnixTime";
|
|
16
|
-
import { subMonths as
|
|
17
|
-
import { c as
|
|
16
|
+
import { subMonths as N } from "date-fns/subMonths";
|
|
17
|
+
import { c as Lt, d as vt, C as Gt, h as Nt, i as Bt, s as Mt, j as Ot, T as Pt, D as $t } from "./TransactionUtils-BphBJBbU.mjs";
|
|
18
18
|
import { l as Ft, D as Ut } from "./DebtUtils-i4pI2Uoe.mjs";
|
|
19
19
|
import { format as kt } from "date-fns/format";
|
|
20
20
|
import { fromUnixTime as Ht } from "date-fns/fromUnixTime";
|
|
21
|
-
import { f as
|
|
22
|
-
import { T
|
|
21
|
+
import { f as k, D as H } from "./DateFormats-HudZ3Bjs.mjs";
|
|
22
|
+
import { T, c as K } from "./GoalsUtil-C9EnLWvC.mjs";
|
|
23
23
|
import { A as Wt, m as Vt, a as zt, b as Kt } from "./InvestmentUtil-BItV7uEs.mjs";
|
|
24
|
-
import { f as Qt, b as qt, a as
|
|
24
|
+
import { f as Qt, b as qt, a as Q, c as Yt, d as jt, e as Xt, s as Jt } from "./NetWorthUtils-Dj7CgAg2.mjs";
|
|
25
25
|
import { f as Zt } from "./NotificationUtils-BRGFTePr.mjs";
|
|
26
|
-
import { isAfter as
|
|
27
|
-
import { isSameDay as
|
|
28
|
-
import { isWithinInterval as
|
|
29
|
-
import { subDays as
|
|
30
|
-
import { f as
|
|
31
|
-
import { I as u, A as _, B
|
|
32
|
-
import { endOfToday as
|
|
26
|
+
import { isAfter as F } from "date-fns/isAfter";
|
|
27
|
+
import { isSameDay as q } from "date-fns/isSameDay";
|
|
28
|
+
import { isWithinInterval as pt } from "date-fns/isWithinInterval";
|
|
29
|
+
import { subDays as _t } from "date-fns/subDays";
|
|
30
|
+
import { f as U, h as te, b as L, a as S } from "./RecurringTransactionsUtil-CfWviBh1.mjs";
|
|
31
|
+
import { I as u, A as _, B } from "./Notification-DTNYSd8P.mjs";
|
|
32
|
+
import { endOfToday as Y } from "date-fns/endOfToday";
|
|
33
33
|
import { formatISO as ee } from "date-fns/formatISO";
|
|
34
34
|
import { addSeconds as se } from "date-fns/addSeconds";
|
|
35
35
|
import { differenceInCalendarMonths as ae } from "date-fns/differenceInCalendarMonths";
|
|
36
|
-
import { f as
|
|
37
|
-
import { addMonths as
|
|
36
|
+
import { f as re, b as ne } from "./TrendsUtil-D9z3kIj_.mjs";
|
|
37
|
+
import { addMonths as ie } from "date-fns/addMonths";
|
|
38
38
|
import { getMonth as v } from "date-fns/getMonth";
|
|
39
39
|
import { a as oe } from "./Help-CkQTjORd.mjs";
|
|
40
|
-
class
|
|
40
|
+
class M {
|
|
41
41
|
fetchInstance;
|
|
42
42
|
constructor(t, e, s) {
|
|
43
|
-
this.fetchInstance = new
|
|
44
|
-
}
|
|
45
|
-
createAccount = async (t) => this.fetchInstance.post(
|
|
46
|
-
deleteAccount = async (t) => this.fetchInstance.delete(`${
|
|
47
|
-
getAccounts = async () => this.fetchInstance.get(
|
|
48
|
-
getInstitutions = async () => this.fetchInstance.get(
|
|
49
|
-
getMembers = async () => this.fetchInstance.get(
|
|
50
|
-
getMonthlyAccountBalances = async (t) => this.fetchInstance.get(`${
|
|
51
|
-
mergeAccounts = async (t) => this.fetchInstance.put(`${
|
|
52
|
-
refreshAllMembers = async () => this.fetchInstance.get(`${
|
|
53
|
-
updateAccount = async (t) => this.fetchInstance.put(`${
|
|
43
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
44
|
+
}
|
|
45
|
+
createAccount = async (t) => this.fetchInstance.post(n.ACCOUNTS, t).then((e) => e.account);
|
|
46
|
+
deleteAccount = async (t) => this.fetchInstance.delete(`${n.ACCOUNTS}/${t}`);
|
|
47
|
+
getAccounts = async () => this.fetchInstance.get(n.ACCOUNTS).then((t) => t.accounts);
|
|
48
|
+
getInstitutions = async () => this.fetchInstance.get(n.INSTITUTIONS).then((t) => t);
|
|
49
|
+
getMembers = async () => this.fetchInstance.get(n.MEMBERS).then((t) => t.members);
|
|
50
|
+
getMonthlyAccountBalances = async (t) => this.fetchInstance.get(`${n.ACCOUNTS}/${t}/monthly_account_balances`).then((e) => e.monthly_account_balances);
|
|
51
|
+
mergeAccounts = async (t) => this.fetchInstance.put(`${n.ACCOUNTS}/merge`, { accounts: t }).then((e) => e);
|
|
52
|
+
refreshAllMembers = async () => this.fetchInstance.get(`${n.MEMBERS}/refresh_all`).then((t) => t);
|
|
53
|
+
updateAccount = async (t) => this.fetchInstance.put(`${n.ACCOUNTS}/${t.guid}`, t).then((e) => e.account);
|
|
54
54
|
}
|
|
55
|
-
class
|
|
55
|
+
class j {
|
|
56
56
|
fetchInstance;
|
|
57
57
|
constructor(t, e, s) {
|
|
58
|
-
this.fetchInstance = new
|
|
58
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
59
59
|
}
|
|
60
|
-
getAppData = async () => this.fetchInstance.get(
|
|
60
|
+
getAppData = async () => this.fetchInstance.get(n.APP_DATA).then((t) => t);
|
|
61
61
|
}
|
|
62
|
-
class
|
|
62
|
+
class X {
|
|
63
63
|
fetchInstance;
|
|
64
64
|
constructor(t) {
|
|
65
|
-
this.fetchInstance = new
|
|
65
|
+
this.fetchInstance = new p(t, "", {
|
|
66
66
|
Accept: "application/json",
|
|
67
67
|
"Content-Type": "application/json"
|
|
68
68
|
});
|
|
@@ -76,54 +76,42 @@ class j {
|
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
class
|
|
79
|
+
class J {
|
|
80
80
|
fetchInstance;
|
|
81
81
|
constructor(t, e, s) {
|
|
82
|
-
this.fetchInstance = new
|
|
82
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
83
83
|
}
|
|
84
|
-
addBudget = async (t, e, s = null) => this.fetchInstance.post(
|
|
84
|
+
addBudget = async (t, e, s = null) => this.fetchInstance.post(n.BUDGETS, {
|
|
85
85
|
amount: e,
|
|
86
86
|
category_guid: t.guid,
|
|
87
87
|
category_name: t.name,
|
|
88
88
|
parent_guid: s
|
|
89
|
-
}).then((a) => a.budget)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
});
|
|
95
|
-
getBudgets = async () => this.fetchInstance.get(i.BUDGETS).then((t) => t.budgets).catch((t) => t);
|
|
96
|
-
updateBudget = async (t) => this.fetchInstance.put(`${i.BUDGETS}/${t.guid}`, t).then((e) => e.budget).catch((e) => {
|
|
97
|
-
throw e;
|
|
98
|
-
});
|
|
99
|
-
addMerchantBudget = async (t, e) => this.fetchInstance.post(i.MERCHANT_BUDGETS, {
|
|
89
|
+
}).then((a) => a.budget);
|
|
90
|
+
deleteBudget = async (t) => this.fetchInstance.delete(`${n.BUDGETS}/${t}`).then((e) => e);
|
|
91
|
+
getBudgets = async () => this.fetchInstance.get(n.BUDGETS).then((t) => t.budgets);
|
|
92
|
+
updateBudget = async (t) => this.fetchInstance.put(`${n.BUDGETS}/${t.guid}`, t).then((e) => e.budget);
|
|
93
|
+
addMerchantBudget = async (t, e) => this.fetchInstance.post(n.MERCHANT_BUDGETS, {
|
|
100
94
|
amount: e,
|
|
101
95
|
merchant_guid: t
|
|
102
|
-
}).then((s) => s.merchant_budget)
|
|
103
|
-
|
|
104
|
-
});
|
|
105
|
-
updateMerchantBudget = async (t, e) => this.fetchInstance.put(`${i.MERCHANT_BUDGETS}/${t}`, {
|
|
96
|
+
}).then((s) => s.merchant_budget);
|
|
97
|
+
updateMerchantBudget = async (t, e) => this.fetchInstance.put(`${n.MERCHANT_BUDGETS}/${t}`, {
|
|
106
98
|
amount: e
|
|
107
|
-
}).then((s) => s.merchant_budget)
|
|
108
|
-
|
|
109
|
-
});
|
|
110
|
-
deleteMerchantBudget = async (t) => this.fetchInstance.delete(`${i.MERCHANT_BUDGETS}/${t}`).then((e) => e).catch((e) => {
|
|
111
|
-
throw e;
|
|
112
|
-
});
|
|
99
|
+
}).then((s) => s.merchant_budget);
|
|
100
|
+
deleteMerchantBudget = async (t) => this.fetchInstance.delete(`${n.MERCHANT_BUDGETS}/${t}`).then((e) => e);
|
|
113
101
|
}
|
|
114
|
-
class
|
|
102
|
+
class Z {
|
|
115
103
|
fetchInstance;
|
|
116
104
|
constructor(t, e, s) {
|
|
117
|
-
this.fetchInstance = new
|
|
105
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
118
106
|
}
|
|
119
|
-
addCategory = async (t) => this.fetchInstance.post(
|
|
120
|
-
getCategories = async () => this.fetchInstance.get(
|
|
121
|
-
getDateRangeCategoryTotals = async (t, e, s) => s.length === 0 ? [] : this.fetchInstance.post(`${
|
|
107
|
+
addCategory = async (t) => this.fetchInstance.post(n.CATEGORIES, t).then((e) => e.category);
|
|
108
|
+
getCategories = async () => this.fetchInstance.get(n.CATEGORIES).then((t) => t.categories);
|
|
109
|
+
getDateRangeCategoryTotals = async (t, e, s) => s.length === 0 ? [] : this.fetchInstance.post(`${n.DATE_RANGE_CATEGORY_TOTALS}/from/${t}/to/${e}`, {
|
|
122
110
|
account_guid: s.map((a) => a.guid)
|
|
123
111
|
}).then((a) => a.date_range_category_totals);
|
|
124
112
|
getMonthlyCategoryTotals = async (t, e, s) => {
|
|
125
113
|
try {
|
|
126
|
-
const a = `${
|
|
114
|
+
const a = `${n.MONTHLY_CATEGORY_TOTALS}/from/${t}/to/${e}`;
|
|
127
115
|
if (s) {
|
|
128
116
|
const o = s.length === 0 ? [""] : s.map((l) => l.guid);
|
|
129
117
|
return (await this.fetchInstance.post(a, { account_guid: o })).monthly_category_totals;
|
|
@@ -133,169 +121,169 @@ class J {
|
|
|
133
121
|
throw console.error("Error fetching monthly category totals:", a), a;
|
|
134
122
|
}
|
|
135
123
|
};
|
|
136
|
-
removeCategory = async (t) => this.fetchInstance.delete(`${
|
|
137
|
-
updateCategory = async (t) => this.fetchInstance.put(`${
|
|
138
|
-
}
|
|
139
|
-
class Z {
|
|
140
|
-
fetchInstance;
|
|
141
|
-
constructor(t, e, s) {
|
|
142
|
-
this.fetchInstance = new g(t, e, void 0, s);
|
|
143
|
-
}
|
|
144
|
-
calculateHealthScore = async () => this.fetchInstance.post(`${i.HEALTH_SCORES}/calculate`).then((t) => t.health_score);
|
|
145
|
-
getAverageHealthScores = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/monthly_averages`).then((t) => t);
|
|
146
|
-
getDebtSpend = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/transactions/debt_spend`).then((t) => t);
|
|
147
|
-
getIncome = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/transactions/income`).then((t) => t);
|
|
148
|
-
getMonthlySummaries = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/monthly_summaries`).then((t) => t);
|
|
149
|
-
getHealthScoreChangeReports = async (t, e) => this.fetchInstance.get(`${i.HEALTH_SCORES}/change_report/from/${t}/to/${e}`).then((s) => s);
|
|
150
|
-
getPeerScore = async (t) => this.fetchInstance.get(`${i.HEALTH_SCORES}/average/${t}`).then((e) => e);
|
|
151
|
-
getSpendingFeeTransactions = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/transactions/spending_fee`).then((t) => t);
|
|
152
|
-
getStandardSpend = async () => this.fetchInstance.get(`${i.HEALTH_SCORES}/transactions/standard_spend`).then((t) => t);
|
|
124
|
+
removeCategory = async (t) => this.fetchInstance.delete(`${n.CATEGORIES}/${t}`);
|
|
125
|
+
updateCategory = async (t) => this.fetchInstance.put(`${n.CATEGORIES}/${t.guid}`, t).then((e) => e.category);
|
|
153
126
|
}
|
|
154
127
|
class tt {
|
|
155
128
|
fetchInstance;
|
|
156
129
|
constructor(t, e, s) {
|
|
157
|
-
this.fetchInstance = new
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
removeRetirementGoal = async (t) => this.fetchInstance.delete(`${i.RETIREMENT_GOALS}/${t}`).then((e) => e);
|
|
169
|
-
removeRetirementGoalAccount = async (t) => this.fetchInstance.delete(`${i.RETIREMENT_GOAL_ACCOUNTS}/${t}`).then((e) => e);
|
|
170
|
-
reorderGoals = async (t) => this.fetchInstance.post(`${i.GOALS}/reposition`, { goals: t }).then((e) => e.goals);
|
|
171
|
-
updateGoal = async (t) => this.fetchInstance.put(`${i.GOALS}/${t.guid}`, t).then((e) => e.goal);
|
|
172
|
-
updateMonthlyCashFlowProfile = async (t) => this.fetchInstance.put(`${i.MONTHLY_CASH_FLOW_PROFILE}`, t).then((e) => e.monthly_cash_flow_profile);
|
|
173
|
-
updateRetirementGoal = async (t) => this.fetchInstance.put(`${i.RETIREMENT_GOALS}/${t.guid}`, t).then((e) => e.retirement_goal);
|
|
130
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
131
|
+
}
|
|
132
|
+
calculateHealthScore = async () => this.fetchInstance.post(`${n.HEALTH_SCORES}/calculate`).then((t) => t.health_score);
|
|
133
|
+
getAverageHealthScores = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/monthly_averages`).then((t) => t);
|
|
134
|
+
getDebtSpend = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/transactions/debt_spend`).then((t) => t);
|
|
135
|
+
getIncome = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/transactions/income`).then((t) => t);
|
|
136
|
+
getMonthlySummaries = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/monthly_summaries`).then((t) => t);
|
|
137
|
+
getHealthScoreChangeReports = async (t, e) => this.fetchInstance.get(`${n.HEALTH_SCORES}/change_report/from/${t}/to/${e}`).then((s) => s);
|
|
138
|
+
getPeerScore = async (t) => this.fetchInstance.get(`${n.HEALTH_SCORES}/average/${t}`).then((e) => e);
|
|
139
|
+
getSpendingFeeTransactions = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/transactions/spending_fee`).then((t) => t);
|
|
140
|
+
getStandardSpend = async () => this.fetchInstance.get(`${n.HEALTH_SCORES}/transactions/standard_spend`).then((t) => t);
|
|
174
141
|
}
|
|
175
142
|
class et {
|
|
176
143
|
fetchInstance;
|
|
177
144
|
constructor(t, e, s) {
|
|
178
|
-
this.fetchInstance = new
|
|
179
|
-
}
|
|
180
|
-
|
|
145
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
146
|
+
}
|
|
147
|
+
addGoal = async (t) => this.fetchInstance.post(n.GOALS, t).then((e) => e.goal);
|
|
148
|
+
addRetirementGoal = async (t) => this.fetchInstance.post(n.RETIREMENT_GOALS, t).then((e) => e.retirement_goal);
|
|
149
|
+
addRetirementGoalAccount = async (t) => this.fetchInstance.post(n.RETIREMENT_GOAL_ACCOUNTS, t).then((e) => e.retirement_goal_account);
|
|
150
|
+
getGoalByGuid = async (t) => this.fetchInstance.get(`${n.GOALS}/${t}`).then((e) => e.goal);
|
|
151
|
+
getGoals = async () => this.fetchInstance.get(n.GOALS).then((t) => t.goals);
|
|
152
|
+
getMonthlyCashFlowProfile = async () => this.fetchInstance.get(n.MONTHLY_CASH_FLOW_PROFILE).then((t) => t.monthly_cash_flow_profile);
|
|
153
|
+
getRetirementGoals = async () => this.fetchInstance.get(n.RETIREMENT_GOALS).then((t) => t.retirement_goals);
|
|
154
|
+
getRetirementGoalAccounts = async () => this.fetchInstance.get(n.RETIREMENT_GOAL_ACCOUNTS).then((t) => t.retirement_goal_accounts);
|
|
155
|
+
removeGoal = async (t) => this.fetchInstance.delete(`${n.GOALS}/${t}`).then((e) => e);
|
|
156
|
+
removeRetirementGoal = async (t) => this.fetchInstance.delete(`${n.RETIREMENT_GOALS}/${t}`).then((e) => e);
|
|
157
|
+
removeRetirementGoalAccount = async (t) => this.fetchInstance.delete(`${n.RETIREMENT_GOAL_ACCOUNTS}/${t}`).then((e) => e);
|
|
158
|
+
reorderGoals = async (t) => this.fetchInstance.post(`${n.GOALS}/reposition`, { goals: t }).then((e) => e.goals);
|
|
159
|
+
updateGoal = async (t) => this.fetchInstance.put(`${n.GOALS}/${t.guid}`, t).then((e) => e.goal);
|
|
160
|
+
updateMonthlyCashFlowProfile = async (t) => this.fetchInstance.put(`${n.MONTHLY_CASH_FLOW_PROFILE}`, t).then((e) => e.monthly_cash_flow_profile);
|
|
161
|
+
updateRetirementGoal = async (t) => this.fetchInstance.put(`${n.RETIREMENT_GOALS}/${t.guid}`, t).then((e) => e.retirement_goal);
|
|
181
162
|
}
|
|
182
163
|
class st {
|
|
183
164
|
fetchInstance;
|
|
184
165
|
constructor(t, e, s) {
|
|
185
|
-
this.fetchInstance = new
|
|
166
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
186
167
|
}
|
|
187
|
-
|
|
188
|
-
updateHoldings = async (t) => this.fetchInstance.put(`${i.HOLDINGS}/${t.guid}`, t).then((e) => e.holding);
|
|
168
|
+
createSupportTicket = async (t) => this.fetchInstance.post(n.SUPPORT_TICKETS, t).then((e) => e);
|
|
189
169
|
}
|
|
190
170
|
class at {
|
|
191
171
|
fetchInstance;
|
|
192
172
|
constructor(t, e, s) {
|
|
193
|
-
this.fetchInstance = new
|
|
173
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
174
|
+
}
|
|
175
|
+
getHoldings = async () => this.fetchInstance.get(n.HOLDINGS).then((t) => t.holdings);
|
|
176
|
+
updateHoldings = async (t) => this.fetchInstance.put(`${n.HOLDINGS}/${t.guid}`, t).then((e) => e.holding);
|
|
177
|
+
}
|
|
178
|
+
class rt {
|
|
179
|
+
fetchInstance;
|
|
180
|
+
constructor(t, e, s) {
|
|
181
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
194
182
|
}
|
|
195
183
|
getMerchants = async (t = [], e = [], s = 1, a = 25) => {
|
|
196
|
-
let o =
|
|
197
|
-
return o += `?page=${s}&per_page=${a}`, t.length && t.forEach((
|
|
184
|
+
let o = n.MERCHANTS;
|
|
185
|
+
return o += `?page=${s}&per_page=${a}`, t.length && t.forEach((i) => o += `&fuzzy_name[]=${i}`), e.length && e.forEach((i) => o += `&guid[]=${i}`), this.fetchInstance.get(o).then((i) => i.merchants);
|
|
198
186
|
};
|
|
199
|
-
getMerchantByGuid = async (t) => this.fetchInstance.get(`${
|
|
187
|
+
getMerchantByGuid = async (t) => this.fetchInstance.get(`${n.MERCHANTS}/${t}`).then((e) => e.merchant);
|
|
200
188
|
}
|
|
201
189
|
class nt {
|
|
202
190
|
fetchInstance;
|
|
203
191
|
constructor(t, e, s) {
|
|
204
|
-
this.fetchInstance = new
|
|
192
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
205
193
|
}
|
|
206
|
-
getNotifications = () => this.fetchInstance.get(
|
|
194
|
+
getNotifications = () => this.fetchInstance.get(n.NOTIFICATIONS).then(
|
|
207
195
|
(t) => t.notifications.map((e) => e.notification)
|
|
208
196
|
).finally();
|
|
209
|
-
updateNotification = (t) => this.fetchInstance.put(`${
|
|
197
|
+
updateNotification = (t) => this.fetchInstance.put(`${n.NOTIFICATIONS}/${t.guid}`, {
|
|
210
198
|
guid: t.guid,
|
|
211
199
|
has_been_viewed: t.has_been_viewed
|
|
212
200
|
}).then((e) => e.notification).finally();
|
|
213
201
|
// Note: The notifications/mark_all_as_viewed endpoint is broken, but still returns 202.
|
|
214
202
|
// A bug ticket has been filed to fix it, but should not require any changes here.
|
|
215
|
-
markAllAsViewed = (t) => this.fetchInstance.put(`${
|
|
203
|
+
markAllAsViewed = (t) => this.fetchInstance.put(`${n.NOTIFICATIONS}/mark_all_as_viewed`, { channel: t }).finally();
|
|
216
204
|
}
|
|
217
205
|
class it {
|
|
218
206
|
fetchInstance;
|
|
219
207
|
constructor(t, e, s) {
|
|
220
|
-
this.fetchInstance = new
|
|
208
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
221
209
|
}
|
|
222
|
-
addRepeatingTransaction = async (t) => this.fetchInstance.post(
|
|
223
|
-
getRepeatingTransactions = async () => this.fetchInstance.get(
|
|
210
|
+
addRepeatingTransaction = async (t) => this.fetchInstance.post(n.REPEATING_TRANSACTIONS, t).then((e) => e.repeating_transaction);
|
|
211
|
+
getRepeatingTransactions = async () => this.fetchInstance.get(n.REPEATING_TRANSACTIONS).then((t) => t.repeating_transactions);
|
|
224
212
|
updateRepeatingTransaction = async (t) => this.fetchInstance.put(
|
|
225
|
-
`${
|
|
213
|
+
`${n.REPEATING_TRANSACTIONS}/${t.guid}`,
|
|
226
214
|
t
|
|
227
215
|
).then((e) => e.repeating_transaction);
|
|
228
|
-
deleteRepeatingTransaction = async (t) => this.fetchInstance.delete(`${
|
|
216
|
+
deleteRepeatingTransaction = async (t) => this.fetchInstance.delete(`${n.REPEATING_TRANSACTIONS}/${t}`).then((e) => e);
|
|
229
217
|
}
|
|
230
|
-
class
|
|
218
|
+
class ot {
|
|
231
219
|
fetchInstance;
|
|
232
220
|
constructor(t, e, s) {
|
|
233
|
-
this.fetchInstance = new
|
|
221
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
234
222
|
}
|
|
235
|
-
deleteDevice = async (t) => this.fetchInstance.delete(`${
|
|
236
|
-
generateDeviceToken = async () => this.fetchInstance.get(`${
|
|
237
|
-
getDevices = async () => this.fetchInstance.get(
|
|
238
|
-
getNotificationProfiles = async () => this.fetchInstance.get(
|
|
223
|
+
deleteDevice = async (t) => this.fetchInstance.delete(`${n.DEVICES}/${t}`).then((e) => e);
|
|
224
|
+
generateDeviceToken = async () => this.fetchInstance.get(`${n.USER}/mobile_token`).then((t) => t.mobile_token);
|
|
225
|
+
getDevices = async () => this.fetchInstance.get(n.DEVICES).then((t) => t.map((e) => e.device));
|
|
226
|
+
getNotificationProfiles = async () => this.fetchInstance.get(n.NOTIFICATION_PROFILES).then((t) => t.notification_profiles);
|
|
239
227
|
// verifications endpoints respond with HTTP status codes; they error otherwise
|
|
240
|
-
sendEmailVerification = async () => this.fetchInstance.post(
|
|
241
|
-
sendPhoneVerification = async () => this.fetchInstance.post(
|
|
242
|
-
verifyPhoneToken = async (t) => this.fetchInstance.post(
|
|
243
|
-
updateDevice = async (t) => this.fetchInstance.put(`${
|
|
244
|
-
updateNotificationProfile = async (t) => this.fetchInstance.put(`${
|
|
245
|
-
updateUserCommunicationProfile = async (t) => this.fetchInstance.put(
|
|
246
|
-
getInsightsNotificationProfiles = async () => this.fetchInstance.get(`${
|
|
228
|
+
sendEmailVerification = async () => this.fetchInstance.post(n.EMAIL_VERIFICATIONS);
|
|
229
|
+
sendPhoneVerification = async () => this.fetchInstance.post(n.PHONE_VERIFICATIONS + "/deliver");
|
|
230
|
+
verifyPhoneToken = async (t) => this.fetchInstance.post(n.PHONE_VERIFICATIONS + "/verify", { sms_verification_token: t }).then((e) => ({ verified: e.verified }));
|
|
231
|
+
updateDevice = async (t) => this.fetchInstance.put(`${n.DEVICES}/${t.guid}`, t).then((e) => e.device);
|
|
232
|
+
updateNotificationProfile = async (t) => this.fetchInstance.put(`${n.NOTIFICATION_PROFILES}/${t.guid}`, t).then((e) => e.notification_profile);
|
|
233
|
+
updateUserCommunicationProfile = async (t) => this.fetchInstance.put(n.USER_COMMUNICATION_PROFILE, t).then((e) => e.user_communication_profile);
|
|
234
|
+
getInsightsNotificationProfiles = async () => this.fetchInstance.get(`${n.NOTIFICATION_PROFILES}/${n.INSIGHTS_NOTIFICATION_PROFILES}`).then((t) => t);
|
|
247
235
|
}
|
|
248
|
-
class
|
|
236
|
+
class O {
|
|
249
237
|
fetchInstance;
|
|
250
238
|
constructor(t, e, s) {
|
|
251
|
-
this.fetchInstance = new
|
|
252
|
-
}
|
|
253
|
-
addTag = async (t) => this.fetchInstance.post(
|
|
254
|
-
addTagging = async (t) => this.fetchInstance.post(
|
|
255
|
-
addTransaction = async (t) => this.fetchInstance.post(
|
|
256
|
-
addTransactionRule = async (t) => this.fetchInstance.post(
|
|
257
|
-
getTaggings = async () => this.fetchInstance.get(
|
|
258
|
-
getTags = async () => this.fetchInstance.get(
|
|
259
|
-
getTransactionRules = async () => this.fetchInstance.get(
|
|
260
|
-
getTransactionsByDateRange = async (t, e) => this.fetchInstance.get(`${
|
|
239
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
240
|
+
}
|
|
241
|
+
addTag = async (t) => this.fetchInstance.post(n.TAGS, t).then((e) => e.tag);
|
|
242
|
+
addTagging = async (t) => this.fetchInstance.post(n.TAGGINGS, t).then((e) => e.tagging);
|
|
243
|
+
addTransaction = async (t) => this.fetchInstance.post(n.TRANSACTIONS, t).then((e) => e.transaction);
|
|
244
|
+
addTransactionRule = async (t) => this.fetchInstance.post(n.TRANSACTION_RULES, t).then((e) => e);
|
|
245
|
+
getTaggings = async () => this.fetchInstance.get(n.TAGGINGS).then((t) => t.map((e) => e.tagging));
|
|
246
|
+
getTags = async () => this.fetchInstance.get(n.TAGS).then((t) => t.map((e) => e.tag));
|
|
247
|
+
getTransactionRules = async () => this.fetchInstance.get(n.TRANSACTION_RULES).then((t) => t.transaction_rules);
|
|
248
|
+
getTransactionsByDateRange = async (t, e) => this.fetchInstance.get(`${n.TRANSACTIONS}/by_date/${t}/${e}`).then((s) => s.map((a) => a.transaction));
|
|
261
249
|
// DEPRECATED
|
|
262
250
|
getTransactionsByAccountsAndDateRange = async (t, e, s) => {
|
|
263
251
|
console.warn("DEPRECATED: getTransactionsByAccountsAndDateRange will be removed");
|
|
264
252
|
const a = t.reduce(
|
|
265
|
-
(o,
|
|
253
|
+
(o, i, l) => `${o}account_guids[]=${i}${l !== t.length - 1 ? "&" : ""}`,
|
|
266
254
|
""
|
|
267
255
|
);
|
|
268
|
-
return this.fetchInstance.get(`${
|
|
256
|
+
return this.fetchInstance.get(`${n.TRANSACTIONS}/by_date/${e}/${s}?${a}`).then((o) => o.map((i) => i.transaction));
|
|
269
257
|
};
|
|
270
258
|
// DEPRECATED
|
|
271
|
-
getTransactionsByGuids = async (t) => (console.warn("DEPRECATED: getTransactionsByGuids will be removed"), this.fetchInstance.post(`${
|
|
259
|
+
getTransactionsByGuids = async (t) => (console.warn("DEPRECATED: getTransactionsByGuids will be removed"), this.fetchInstance.post(`${n.TRANSACTIONS}/by_guids`, { guids: t.join("+") }).then((e) => e.map((s) => s.transaction)));
|
|
272
260
|
// DEPRECATED
|
|
273
261
|
getTransactionsByCategoryAndDate = async (t, e, s) => (console.warn("DEPRECATED: getTransactionsByCategoryAndDate will be removed"), this.fetchInstance.get(
|
|
274
|
-
`${
|
|
262
|
+
`${n.TRANSACTIONS}/by_category_guid/${t}/by_date/${e}/${s}`
|
|
275
263
|
).then((a) => a.map((o) => o.transaction)));
|
|
276
264
|
// DEPRECATED
|
|
277
265
|
getTransactionsByCategoryDateAndAccounts = async (t, e, s, a) => {
|
|
278
266
|
console.warn("DEPRECATED: getTransactionsByCategoryDateAndAccounts will be removed");
|
|
279
267
|
const o = a.reduce(
|
|
280
|
-
(
|
|
268
|
+
(i, l, g) => `${i}account_guids[]=${l}${g !== a.length - 1 ? "&" : ""}`,
|
|
281
269
|
""
|
|
282
270
|
);
|
|
283
271
|
return this.fetchInstance.get(
|
|
284
|
-
`${
|
|
285
|
-
).then((
|
|
272
|
+
`${n.TRANSACTIONS}/by_category_guid/${t}/by_date/${e}/${s}?${o}`
|
|
273
|
+
).then((i) => i.map((l) => l.transaction));
|
|
286
274
|
};
|
|
287
275
|
// DEPRECATED
|
|
288
276
|
getTransactionsByCategoriesDateAndAccounts = async (t, e, s, a) => {
|
|
289
277
|
console.warn("DEPRECATED: getTransactionsByCategoriesDateAndAccounts will be removed");
|
|
290
278
|
const o = a.reduce(
|
|
291
|
-
(
|
|
279
|
+
(i, l, g) => `${i}account_guids[]=${l}${g !== a.length - 1 ? "&" : ""}`,
|
|
292
280
|
""
|
|
293
281
|
);
|
|
294
282
|
return this.fetchInstance.get(
|
|
295
|
-
`${
|
|
283
|
+
`${n.TRANSACTIONS}/by_category_guids/${t.join(
|
|
296
284
|
"+"
|
|
297
285
|
)}/by_date/${e}/${s}?${o}`
|
|
298
|
-
).then((
|
|
286
|
+
).then((i) => i.map((l) => l.transaction));
|
|
299
287
|
};
|
|
300
288
|
/**
|
|
301
289
|
* DEPRECATED
|
|
@@ -308,44 +296,44 @@ class x {
|
|
|
308
296
|
*/
|
|
309
297
|
getTransactionsByTopLevelCategoryAndDate = async (t, e, s, a = []) => {
|
|
310
298
|
console.warn("DEPRECATED: getTransactionsByTopLevelCategoryAndDate will be removed");
|
|
311
|
-
let o = `${
|
|
299
|
+
let o = `${n.TRANSACTIONS}/by_top_level_category_guid/${t}/by_date/${e}/${s}`;
|
|
312
300
|
if (a.length > 0) {
|
|
313
|
-
const
|
|
314
|
-
(l,
|
|
301
|
+
const i = a.reduce(
|
|
302
|
+
(l, g, y) => `${l}account_guids[]=${g}${y !== a.length - 1 ? "&" : ""}`,
|
|
315
303
|
""
|
|
316
304
|
);
|
|
317
|
-
o += `?${
|
|
318
|
-
}
|
|
319
|
-
return this.fetchInstance.get(o).then((
|
|
320
|
-
};
|
|
321
|
-
removeTag = async (t) => this.fetchInstance.delete(`${
|
|
322
|
-
removeTagging = async (t) => this.fetchInstance.delete(`${
|
|
323
|
-
removeTransaction = async (t) => this.fetchInstance.delete(`${
|
|
324
|
-
removeTransactionRule = async (t) => this.fetchInstance.delete(`${
|
|
325
|
-
removeTransactionSplit = async (t) => this.fetchInstance.delete(`${
|
|
326
|
-
updateTransactionRule = async (t) => this.fetchInstance.put(`${
|
|
327
|
-
updateTag = async (t) => this.fetchInstance.put(`${
|
|
328
|
-
updateTransaction = async (t) => this.fetchInstance.put(`${
|
|
305
|
+
o += `?${i}`;
|
|
306
|
+
}
|
|
307
|
+
return this.fetchInstance.get(o).then((i) => i.map((l) => l.transaction));
|
|
308
|
+
};
|
|
309
|
+
removeTag = async (t) => this.fetchInstance.delete(`${n.TAGS}/${t}`).then((e) => e);
|
|
310
|
+
removeTagging = async (t) => this.fetchInstance.delete(`${n.TAGGINGS}/${t}`).then((e) => e);
|
|
311
|
+
removeTransaction = async (t) => this.fetchInstance.delete(`${n.TRANSACTIONS}/${t}`).then((e) => e);
|
|
312
|
+
removeTransactionRule = async (t) => this.fetchInstance.delete(`${n.TRANSACTION_RULES}/${t}`);
|
|
313
|
+
removeTransactionSplit = async (t) => this.fetchInstance.delete(`${n.TRANSACTIONS}/${t}/unsplit`).then((e) => e);
|
|
314
|
+
updateTransactionRule = async (t) => this.fetchInstance.put(`${n.TRANSACTION_RULES}/${t.guid}`, t).then((e) => e);
|
|
315
|
+
updateTag = async (t) => this.fetchInstance.put(`${n.TAGS}/${t.guid}`, t).then((e) => e.tag);
|
|
316
|
+
updateTransaction = async (t) => this.fetchInstance.put(`${n.TRANSACTIONS}/${t.guid}`, t).then((e) => e.transaction);
|
|
329
317
|
}
|
|
330
|
-
class
|
|
318
|
+
class ct {
|
|
331
319
|
fetchInstance;
|
|
332
320
|
constructor(t, e, s) {
|
|
333
|
-
this.fetchInstance = new
|
|
321
|
+
this.fetchInstance = new p(t, e, void 0, s);
|
|
334
322
|
}
|
|
335
|
-
getUserFeatures = async () => this.fetchInstance.get(
|
|
336
|
-
updateUser = async (t) => this.fetchInstance.put(
|
|
337
|
-
updateUserProfile = async (t) => this.fetchInstance.put(`${
|
|
323
|
+
getUserFeatures = async () => this.fetchInstance.get(n.USER_FEATURES).then((t) => t.user_features);
|
|
324
|
+
updateUser = async (t) => this.fetchInstance.put(n.USER, t).then((e) => e.user);
|
|
325
|
+
updateUserProfile = async (t) => this.fetchInstance.put(`${n.USER_PROFILES}/${t.guid}`, t).then((e) => e.user_profile);
|
|
338
326
|
}
|
|
339
|
-
class
|
|
327
|
+
class lt {
|
|
340
328
|
fetchInstance;
|
|
341
329
|
constructor(t, e) {
|
|
342
|
-
this.fetchInstance = new
|
|
330
|
+
this.fetchInstance = new p(t, e);
|
|
343
331
|
}
|
|
344
|
-
requestWidgetUrl = async (t) => this.fetchInstance.post(
|
|
332
|
+
requestWidgetUrl = async (t) => this.fetchInstance.post(n.WIDGET_URLS, t).then((e) => e.widget_url);
|
|
345
333
|
}
|
|
346
334
|
class ce {
|
|
347
335
|
globalStore;
|
|
348
|
-
api = new
|
|
336
|
+
api = new M("/", "");
|
|
349
337
|
accounts = [];
|
|
350
338
|
accountsLoaded = !1;
|
|
351
339
|
accountsLoading = !1;
|
|
@@ -357,7 +345,7 @@ class ce {
|
|
|
357
345
|
membersLoading = !1;
|
|
358
346
|
uiStore;
|
|
359
347
|
constructor(t) {
|
|
360
|
-
this.globalStore = t, this.uiStore = new le(), this.api = new
|
|
348
|
+
this.globalStore = t, this.uiStore = new le(), this.api = new M(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
361
349
|
}
|
|
362
350
|
loadAccountData = async () => {
|
|
363
351
|
await Promise.all([this.loadAccounts(), this.loadMembers(), this.loadInstitutions()]);
|
|
@@ -366,8 +354,8 @@ class ce {
|
|
|
366
354
|
return this.accountsLoaded && this.membersLoaded && this.institutionsLoaded;
|
|
367
355
|
}
|
|
368
356
|
get detailedAccounts() {
|
|
369
|
-
const t = this.globalStore.userStore.userFeatures, e =
|
|
370
|
-
return
|
|
357
|
+
const t = this.globalStore.userStore.userFeatures, e = wt(t, "MD_EXCLUDE_EXTERNAL_ACCOUNTS"), s = this.globalStore.appConfig.config.display_only_external_accounts_in_accounts && this.globalStore.appConfig.options.subtype === "accounts";
|
|
358
|
+
return bt(
|
|
371
359
|
this.accounts,
|
|
372
360
|
this.institutions,
|
|
373
361
|
this.members,
|
|
@@ -384,43 +372,43 @@ class ce {
|
|
|
384
372
|
}
|
|
385
373
|
get cashAccounts() {
|
|
386
374
|
return this.detailedAccounts.filter(
|
|
387
|
-
(t) => t.account_type ===
|
|
375
|
+
(t) => t.account_type === d.CASH || t.account_type === d.CHECKING || t.account_type === d.PREPAID || t.account_type === d.SAVINGS || t.account_type === d.CHECKING_LINE_OF_CREDIT
|
|
388
376
|
);
|
|
389
377
|
}
|
|
390
378
|
get cashBalance() {
|
|
391
379
|
return this.cashAccounts.reduce((t, e) => t + (e?.balance || 0), 0);
|
|
392
380
|
}
|
|
393
381
|
get checkingAccounts() {
|
|
394
|
-
return this.detailedAccounts.filter((t) => t.account_type ===
|
|
382
|
+
return this.detailedAccounts.filter((t) => t.account_type === d.CHECKING);
|
|
395
383
|
}
|
|
396
384
|
get debtAccounts() {
|
|
397
385
|
return this.detailedAccounts.filter(
|
|
398
|
-
(t) => t.account_type ===
|
|
386
|
+
(t) => t.account_type === d.CREDIT_CARD || t.account_type === d.LOAN || t.account_type === d.MORTGAGE || t.account_type === d.LINE_OF_CREDIT || t.account_type === d.CHECKING_LINE_OF_CREDIT
|
|
399
387
|
);
|
|
400
388
|
}
|
|
401
389
|
get finstrongAccounts() {
|
|
402
390
|
const t = /* @__PURE__ */ new Set([
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
391
|
+
d.CHECKING,
|
|
392
|
+
d.SAVINGS,
|
|
393
|
+
d.CREDIT_CARD,
|
|
394
|
+
d.INVESTMENT
|
|
407
395
|
]);
|
|
408
396
|
return this.detailedAccounts.filter((e) => t.has(e.account_type));
|
|
409
397
|
}
|
|
410
398
|
get investmentAccounts() {
|
|
411
399
|
return this.detailedAccounts.filter(
|
|
412
|
-
(t) => t.account_type ===
|
|
400
|
+
(t) => t.account_type === d.INVESTMENT
|
|
413
401
|
);
|
|
414
402
|
}
|
|
415
403
|
get manualAccounts() {
|
|
416
404
|
return this.detailedAccounts.filter((t) => t.is_manual);
|
|
417
405
|
}
|
|
418
406
|
get savingsAccounts() {
|
|
419
|
-
return this.detailedAccounts.filter((t) => t.account_type ===
|
|
407
|
+
return this.detailedAccounts.filter((t) => t.account_type === d.SAVINGS);
|
|
420
408
|
}
|
|
421
409
|
get retirementAccounts() {
|
|
422
410
|
return this.detailedAccounts.filter(
|
|
423
|
-
(t) => t.account_type ===
|
|
411
|
+
(t) => t.account_type === d.INVESTMENT || t.account_type === d.SAVINGS || t.account_type === d.CHECKING || t.account_type === d.CASH || t.account_type === d.PROPERTY || t.account_type === d.INSURANCE && (t.account_subtype === $.WHOLE_LIFE || t.account_subtype === $.UNIVERSAL_LIFE || t.account_subtype === $.VARIABLE_UNIVERSAL_LIFE)
|
|
424
412
|
);
|
|
425
413
|
}
|
|
426
414
|
get visibleAccounts() {
|
|
@@ -460,7 +448,7 @@ class ce {
|
|
|
460
448
|
}
|
|
461
449
|
get savingsAndCheckingAccounts() {
|
|
462
450
|
return this.accounts.filter(
|
|
463
|
-
(e) => e.account_type ===
|
|
451
|
+
(e) => e.account_type === d.SAVINGS || e.account_type === d.CHECKING
|
|
464
452
|
);
|
|
465
453
|
}
|
|
466
454
|
setAccounts = (t) => {
|
|
@@ -479,7 +467,7 @@ class ce {
|
|
|
479
467
|
this.accounts = [...this.accounts, e];
|
|
480
468
|
});
|
|
481
469
|
} catch (e) {
|
|
482
|
-
console.error(
|
|
470
|
+
console.error("Error occurred while adding an account:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
483
471
|
}
|
|
484
472
|
};
|
|
485
473
|
loadAccounts = async () => {
|
|
@@ -489,7 +477,7 @@ class ce {
|
|
|
489
477
|
const t = await this.api.getAccounts();
|
|
490
478
|
this.setAccounts(t);
|
|
491
479
|
} catch (t) {
|
|
492
|
-
console.error(
|
|
480
|
+
console.error("Error occurred while loading accounts:", t), this.globalStore.captureException(t, { store: "AccountStore" }), this.setAccounts([]);
|
|
493
481
|
}
|
|
494
482
|
}
|
|
495
483
|
};
|
|
@@ -500,7 +488,7 @@ class ce {
|
|
|
500
488
|
const t = await this.api.getInstitutions();
|
|
501
489
|
this.setInstitutions(t);
|
|
502
490
|
} catch (t) {
|
|
503
|
-
console.error(
|
|
491
|
+
console.error("Error occurred while loading institutions:", t), this.globalStore.captureException(t, { store: "AccountStore" }), this.setInstitutions([]);
|
|
504
492
|
}
|
|
505
493
|
}
|
|
506
494
|
};
|
|
@@ -511,7 +499,7 @@ class ce {
|
|
|
511
499
|
const t = await this.api.getMembers();
|
|
512
500
|
this.setMembers(t);
|
|
513
501
|
} catch (t) {
|
|
514
|
-
console.error(
|
|
502
|
+
console.error("Error occurred while loading members:", t), this.globalStore.captureException(t, { store: "AccountStore" }), this.setMembers([]);
|
|
515
503
|
}
|
|
516
504
|
}
|
|
517
505
|
};
|
|
@@ -519,13 +507,13 @@ class ce {
|
|
|
519
507
|
try {
|
|
520
508
|
const e = await this.api.mergeAccounts(t), s = e[Object.keys(e)[0]];
|
|
521
509
|
c(() => {
|
|
522
|
-
const a = this.accounts.findIndex((
|
|
510
|
+
const a = this.accounts.findIndex((i) => i.guid === t[1]);
|
|
523
511
|
this.accounts.splice(a, 1);
|
|
524
|
-
const o = this.accounts.findIndex((
|
|
512
|
+
const o = this.accounts.findIndex((i) => i.guid === t[0]);
|
|
525
513
|
this.accounts.splice(o, 1, s);
|
|
526
514
|
});
|
|
527
515
|
} catch (e) {
|
|
528
|
-
console.error(
|
|
516
|
+
console.error("Error occurred while merging accounts:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
529
517
|
}
|
|
530
518
|
};
|
|
531
519
|
/**
|
|
@@ -538,7 +526,7 @@ class ce {
|
|
|
538
526
|
try {
|
|
539
527
|
await this.api.refreshAllMembers();
|
|
540
528
|
} catch (t) {
|
|
541
|
-
console.error(
|
|
529
|
+
console.error("Error occurred while refreshing members:", t), this.globalStore.captureException(t, { store: "AccountStore" });
|
|
542
530
|
}
|
|
543
531
|
};
|
|
544
532
|
removeAccount = async (t) => {
|
|
@@ -547,7 +535,7 @@ class ce {
|
|
|
547
535
|
const e = this.accounts.findIndex((s) => s.guid === t);
|
|
548
536
|
this.accounts.splice(e, 1);
|
|
549
537
|
} catch (e) {
|
|
550
|
-
console.error(
|
|
538
|
+
console.error("Error occurred while removing an account:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
551
539
|
}
|
|
552
540
|
};
|
|
553
541
|
updateAccount = async (t) => {
|
|
@@ -557,7 +545,7 @@ class ce {
|
|
|
557
545
|
);
|
|
558
546
|
this.accounts.splice(s, 1, e);
|
|
559
547
|
} catch (e) {
|
|
560
|
-
console.error(
|
|
548
|
+
console.error("Error occurred while updating account:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
561
549
|
}
|
|
562
550
|
};
|
|
563
551
|
updateAccountBalance = (t, e) => {
|
|
@@ -567,37 +555,46 @@ class ce {
|
|
|
567
555
|
});
|
|
568
556
|
};
|
|
569
557
|
updateAccountFilter = async (t) => {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
const l
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
558
|
+
try {
|
|
559
|
+
const e = [];
|
|
560
|
+
for (const [i, l] of t.entries()) {
|
|
561
|
+
const g = this.accounts.find((y) => y.guid === i);
|
|
562
|
+
if (g && g.is_excluded_from_accounts === l) {
|
|
563
|
+
const y = { ...g, is_excluded_from_accounts: !l };
|
|
564
|
+
e.push(
|
|
565
|
+
this.api.updateAccount(y).catch((R) => (console.error("Error occurred while updating account filter:", R), this.globalStore.captureException(R, { store: "AccountStore" }), null))
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
const a = (await Promise.all(e)).filter((i) => i !== null), o = [...this.accounts];
|
|
570
|
+
for (const i of a) {
|
|
571
|
+
const l = o.findIndex((g) => g.guid === i.guid);
|
|
572
|
+
l !== -1 && o.splice(l, 1, i);
|
|
573
|
+
}
|
|
574
|
+
this.setAccounts(o);
|
|
575
|
+
} catch (e) {
|
|
576
|
+
console.error("Error occurred while updating account filter:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
579
577
|
}
|
|
580
|
-
this.setAccounts(a);
|
|
581
578
|
};
|
|
582
579
|
}
|
|
583
580
|
let le = class {
|
|
584
581
|
selectedAccount = {};
|
|
585
582
|
selectedMember = {};
|
|
586
583
|
constructor() {
|
|
587
|
-
|
|
584
|
+
h(this);
|
|
588
585
|
}
|
|
589
586
|
setSelectedAccount = (t) => this.selectedAccount = t;
|
|
590
587
|
setSelectedMember = (t) => this.selectedMember = t;
|
|
591
588
|
};
|
|
592
|
-
class
|
|
589
|
+
class he {
|
|
593
590
|
globalStore;
|
|
594
|
-
api = new
|
|
595
|
-
bannerApi = new
|
|
591
|
+
api = new j("/", "");
|
|
592
|
+
bannerApi = new X("/");
|
|
596
593
|
appData = {};
|
|
597
594
|
isAppDataLoaded = !1;
|
|
598
595
|
banner = {};
|
|
599
596
|
constructor(t) {
|
|
600
|
-
this.globalStore = t, this.api = new
|
|
597
|
+
this.globalStore = t, this.api = new j(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
601
598
|
}
|
|
602
599
|
get appConfig() {
|
|
603
600
|
return this.globalStore.appConfig;
|
|
@@ -618,14 +615,14 @@ class de {
|
|
|
618
615
|
return this.appData.user_profile;
|
|
619
616
|
}
|
|
620
617
|
setAppData = (t) => {
|
|
621
|
-
this.appData = t, this.bannerApi = new
|
|
618
|
+
this.appData = t, this.bannerApi = new X(t.address?.bullseye || "/"), this.isAppDataLoaded = !0;
|
|
622
619
|
};
|
|
623
620
|
loadAppData = async () => {
|
|
624
621
|
try {
|
|
625
622
|
const t = await this.api.getAppData();
|
|
626
623
|
this.setAppData(t);
|
|
627
624
|
} catch (t) {
|
|
628
|
-
console.error(
|
|
625
|
+
console.error("Error loading app data:", t), this.globalStore.captureException(t, { store: "AppDataStore" });
|
|
629
626
|
}
|
|
630
627
|
};
|
|
631
628
|
loadBanner = async () => {
|
|
@@ -635,14 +632,14 @@ class de {
|
|
|
635
632
|
this.banner = e;
|
|
636
633
|
});
|
|
637
634
|
} catch (t) {
|
|
638
|
-
console.error(
|
|
635
|
+
console.error("Error loading banner:", t), this.globalStore.captureException(t, { store: "AppDataStore" });
|
|
639
636
|
}
|
|
640
637
|
};
|
|
641
638
|
setUser = (t) => this.appData.user = t;
|
|
642
639
|
setUserCommunicationProfile = (t) => this.appData.user_communication_profile = t;
|
|
643
640
|
setUserProfile = (t) => this.appData.user_profile = t;
|
|
644
641
|
}
|
|
645
|
-
class
|
|
642
|
+
class de {
|
|
646
643
|
globalStore;
|
|
647
644
|
survey = null;
|
|
648
645
|
currentQuestionIndex = 0;
|
|
@@ -650,7 +647,7 @@ class he {
|
|
|
650
647
|
response = null;
|
|
651
648
|
responses = {};
|
|
652
649
|
constructor(t) {
|
|
653
|
-
this.globalStore = t,
|
|
650
|
+
this.globalStore = t, h(this);
|
|
654
651
|
}
|
|
655
652
|
get isLastQuestion() {
|
|
656
653
|
return this.currentQuestionIndex === this.surveyQuestions.length - 1;
|
|
@@ -672,7 +669,7 @@ class he {
|
|
|
672
669
|
return this.survey ? this.survey.questions : [];
|
|
673
670
|
}
|
|
674
671
|
loadSurvey = (t = !1) => {
|
|
675
|
-
|
|
672
|
+
Ct.getActiveMatchingSurveys((e) => {
|
|
676
673
|
c(() => {
|
|
677
674
|
if (e.length > 0) {
|
|
678
675
|
const s = e.find((a) => a.id === this.surveyId);
|
|
@@ -691,36 +688,36 @@ class he {
|
|
|
691
688
|
this.response = t, this.question && (this.responses[`$survey_response_${this.question.id}`] = t);
|
|
692
689
|
};
|
|
693
690
|
}
|
|
694
|
-
function ue(
|
|
691
|
+
function ue(r, t, e, s = "asc") {
|
|
695
692
|
const a = s === "desc" ? -1 : 1;
|
|
696
|
-
return [...
|
|
693
|
+
return [...r, ...t].sort((o, i) => o[e] < i[e] ? -1 * a : o[e] > i[e] ? 1 * a : 0);
|
|
697
694
|
}
|
|
698
|
-
const ge = (
|
|
699
|
-
...
|
|
695
|
+
const ge = (r) => ({
|
|
696
|
+
...r,
|
|
700
697
|
//fields that are offer specific, adding here for visibility
|
|
701
|
-
image_url:
|
|
702
|
-
guid:
|
|
703
|
-
created_at:
|
|
704
|
-
dismissed_at:
|
|
705
|
-
active_at:
|
|
706
|
-
displayed_at:
|
|
707
|
-
post_message_secondary:
|
|
698
|
+
image_url: r.image_url,
|
|
699
|
+
guid: r.guid,
|
|
700
|
+
created_at: r.created_at,
|
|
701
|
+
dismissed_at: r.dismissed_at,
|
|
702
|
+
active_at: r.campaign_activated_at,
|
|
703
|
+
displayed_at: r.has_been_viewed,
|
|
704
|
+
post_message_secondary: r.pulse_post_message_secondary,
|
|
708
705
|
//offer fields mapped to beat fields for functionality
|
|
709
|
-
title:
|
|
710
|
-
html_title:
|
|
711
|
-
short_title:
|
|
712
|
-
html_short_title:
|
|
713
|
-
micro_title:
|
|
714
|
-
html_micro_title:
|
|
715
|
-
supporting_action:
|
|
716
|
-
description:
|
|
717
|
-
html_description:
|
|
718
|
-
micro_description:
|
|
719
|
-
html_micro_description:
|
|
720
|
-
call_to_action:
|
|
721
|
-
html_micro_call_to_action:
|
|
722
|
-
micro_call_to_action:
|
|
723
|
-
is_dismissed:
|
|
706
|
+
title: r.pulse_title || r.campaign_name,
|
|
707
|
+
html_title: r.pulse_title || r.campaign_name,
|
|
708
|
+
short_title: r.pulse_title || r.campaign_name,
|
|
709
|
+
html_short_title: r.pulse_title || r.campaign_name,
|
|
710
|
+
micro_title: r.pulse_title || r.campaign_name,
|
|
711
|
+
html_micro_title: r.pulse_title || r.campaign_name,
|
|
712
|
+
supporting_action: r.pulse_call_to_action_text_secondary,
|
|
713
|
+
description: r.pulse_body,
|
|
714
|
+
html_description: r.pulse_body,
|
|
715
|
+
micro_description: r.pulse_body,
|
|
716
|
+
html_micro_description: r.pulse_body,
|
|
717
|
+
call_to_action: r.pulse_call_to_action_text,
|
|
718
|
+
html_micro_call_to_action: r.pulse_call_to_action_text,
|
|
719
|
+
micro_call_to_action: r.pulse_call_to_action_text,
|
|
720
|
+
is_dismissed: r.has_been_dismissed,
|
|
724
721
|
icon_type: 5,
|
|
725
722
|
template: "MarketingOffer",
|
|
726
723
|
//beat fields we null out
|
|
@@ -732,7 +729,7 @@ const ge = (n) => ({
|
|
|
732
729
|
is_sampled: !1,
|
|
733
730
|
merchant_guids: [],
|
|
734
731
|
payload: {},
|
|
735
|
-
pulse_campaign_name:
|
|
732
|
+
pulse_campaign_name: r.campaign_name,
|
|
736
733
|
scheduled_payment_guids: [],
|
|
737
734
|
transaction_guids: [],
|
|
738
735
|
user_guid: "",
|
|
@@ -740,18 +737,26 @@ const ge = (n) => ({
|
|
|
740
737
|
});
|
|
741
738
|
class pe {
|
|
742
739
|
globalStore;
|
|
743
|
-
api = new
|
|
740
|
+
api = new G("/", "");
|
|
744
741
|
beats = [];
|
|
745
742
|
isLoading = !1;
|
|
746
743
|
constructor(t) {
|
|
747
|
-
this.globalStore = t, this.api = new
|
|
744
|
+
this.globalStore = t, this.api = new G(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
748
745
|
}
|
|
749
746
|
loadBeats = async () => {
|
|
750
747
|
this.isLoading = !0;
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
748
|
+
try {
|
|
749
|
+
const t = await this.api.getBeats(), s = (await this.api.getOffers()).map((a) => ge(a));
|
|
750
|
+
c(() => {
|
|
751
|
+
this.beats = ue(t, s, "active_at", "desc");
|
|
752
|
+
});
|
|
753
|
+
} catch (t) {
|
|
754
|
+
console.error("Error occurred while loading beats:", t), this.globalStore.captureException(t, { store: "BeatStore" });
|
|
755
|
+
} finally {
|
|
756
|
+
c(() => {
|
|
757
|
+
this.isLoading = !1;
|
|
758
|
+
});
|
|
759
|
+
}
|
|
755
760
|
};
|
|
756
761
|
getFilteredBeats(t) {
|
|
757
762
|
const { categoryGuids: e, templates: s } = t;
|
|
@@ -768,10 +773,10 @@ class pe {
|
|
|
768
773
|
}
|
|
769
774
|
}
|
|
770
775
|
class _e {
|
|
771
|
-
api = new
|
|
776
|
+
api = new J("/", "");
|
|
772
777
|
globalStore;
|
|
773
778
|
alert = "";
|
|
774
|
-
dateRange = { start:
|
|
779
|
+
dateRange = { start: C(f()), end: b(f()) };
|
|
775
780
|
budgets = [];
|
|
776
781
|
selectedBudget;
|
|
777
782
|
selectedSubBudget;
|
|
@@ -779,17 +784,17 @@ class _e {
|
|
|
779
784
|
theme = {};
|
|
780
785
|
merchantBudgets = [];
|
|
781
786
|
constructor(t) {
|
|
782
|
-
this.globalStore = t, this.api = new
|
|
787
|
+
this.globalStore = t, this.api = new J(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
783
788
|
}
|
|
784
789
|
loadBudgetData = async () => {
|
|
785
|
-
this.globalStore.recurringTransactionsStore.isDataLoaded || await this.globalStore.recurringTransactionsStore.loadRepeatingTransactionData(), await this.loadBudgets(),
|
|
790
|
+
this.globalStore.recurringTransactionsStore.isDataLoaded || await this.globalStore.recurringTransactionsStore.loadRepeatingTransactionData(), await this.loadBudgets(), gt(
|
|
786
791
|
() => this.detailedBudgets,
|
|
787
792
|
(t) => {
|
|
788
793
|
if (t) {
|
|
789
794
|
const e = this.selectedBudget;
|
|
790
|
-
e && (this.selectedBudget =
|
|
795
|
+
e && (this.selectedBudget = Et(t, e.guid));
|
|
791
796
|
const s = this.selectedSubBudget;
|
|
792
|
-
s && s.parent_guid && (this.selectedSubBudget =
|
|
797
|
+
s && s.parent_guid && (this.selectedSubBudget = It(
|
|
793
798
|
t,
|
|
794
799
|
s.guid,
|
|
795
800
|
s.parent_guid
|
|
@@ -799,7 +804,7 @@ class _e {
|
|
|
799
804
|
);
|
|
800
805
|
};
|
|
801
806
|
get detailedBudgets() {
|
|
802
|
-
return
|
|
807
|
+
return V(
|
|
803
808
|
this.budgets.filter(
|
|
804
809
|
(t) => t.category_guid !== w.INCOME && t.category_guid !== w.TRANSFER && t.category_guid !== w.INVESTMENTS
|
|
805
810
|
),
|
|
@@ -810,7 +815,7 @@ class _e {
|
|
|
810
815
|
}
|
|
811
816
|
// TODO: Replace this with income from recurring transactions. Income budgets are deprecated.
|
|
812
817
|
get incomeBudget() {
|
|
813
|
-
return
|
|
818
|
+
return V(
|
|
814
819
|
this.budgets.filter((s) => !s.parent_guid),
|
|
815
820
|
this.globalStore.categoryStore.detailedCategories,
|
|
816
821
|
this.globalStore.copyStore.copy.budgets,
|
|
@@ -835,7 +840,7 @@ class _e {
|
|
|
835
840
|
this.budgets.push(a);
|
|
836
841
|
});
|
|
837
842
|
} catch (a) {
|
|
838
|
-
console.error(
|
|
843
|
+
console.error("Error adding budget:", a), this.globalStore.captureException(a, { store: "BudgetsStore" });
|
|
839
844
|
}
|
|
840
845
|
};
|
|
841
846
|
deleteBudget = async (t) => {
|
|
@@ -845,7 +850,7 @@ class _e {
|
|
|
845
850
|
e >= 0 && this.budgets.splice(e, 1);
|
|
846
851
|
});
|
|
847
852
|
} catch (e) {
|
|
848
|
-
console.error(
|
|
853
|
+
console.error("Error deleting budget:", e), this.globalStore.captureException(e, { store: "BudgetsStore" });
|
|
849
854
|
}
|
|
850
855
|
};
|
|
851
856
|
loadBudgets = async () => {
|
|
@@ -853,7 +858,7 @@ class _e {
|
|
|
853
858
|
const t = await this.api.getBudgets();
|
|
854
859
|
this.setBudgets(t);
|
|
855
860
|
} catch (t) {
|
|
856
|
-
throw console.error(
|
|
861
|
+
throw console.error("Error occurred while loading budgets:", t), this.globalStore.captureException(t, { store: "BudgetsStore" }), t;
|
|
857
862
|
}
|
|
858
863
|
};
|
|
859
864
|
setAlert = (t) => this.alert = t;
|
|
@@ -884,7 +889,7 @@ class _e {
|
|
|
884
889
|
await this.api.deleteBudget(s.guid);
|
|
885
890
|
return await this.loadBudgets(), { data: this.budgets, isSuccess: !0 };
|
|
886
891
|
} catch (e) {
|
|
887
|
-
return console.error("
|
|
892
|
+
return console.error("Error recalculating budgets:", e), this.globalStore.captureException(e, { store: "BudgetsStore" }), { data: [], isSuccess: !1 };
|
|
888
893
|
}
|
|
889
894
|
};
|
|
890
895
|
updateBudget = async (t) => {
|
|
@@ -895,7 +900,7 @@ class _e {
|
|
|
895
900
|
s >= 0 && (this.budgets[s] = e);
|
|
896
901
|
});
|
|
897
902
|
} catch (e) {
|
|
898
|
-
console.error(
|
|
903
|
+
console.error("Error updating budget:", e), this.globalStore.captureException(e, { store: "BudgetsStore" });
|
|
899
904
|
}
|
|
900
905
|
};
|
|
901
906
|
getMerchantBudgetByMerchantGuid = (t) => this.merchantBudgets.find(
|
|
@@ -911,18 +916,18 @@ class _e {
|
|
|
911
916
|
this.merchantBudgets.push(s);
|
|
912
917
|
}), { isSuccess: !0 };
|
|
913
918
|
} catch (s) {
|
|
914
|
-
return console.error(
|
|
919
|
+
return console.error("Error adding merchant budget:", s), this.globalStore.captureException(s, { store: "BudgetsStore" }), { isSuccess: !1 };
|
|
915
920
|
}
|
|
916
921
|
};
|
|
917
922
|
updateMerchantBudget = async (t) => {
|
|
918
923
|
try {
|
|
919
924
|
const { guid: e, amount: s } = t, a = await this.api.updateMerchantBudget(e, s);
|
|
920
925
|
return c(() => {
|
|
921
|
-
const o = this.merchantBudgets.findIndex((
|
|
926
|
+
const o = this.merchantBudgets.findIndex((i) => i.guid === t.guid);
|
|
922
927
|
o >= 0 && (this.merchantBudgets[o] = a);
|
|
923
928
|
}), { isSuccess: !0 };
|
|
924
929
|
} catch (e) {
|
|
925
|
-
return console.error(
|
|
930
|
+
return console.error("Error updating merchant budget:", e), this.globalStore.captureException(e, { store: "BudgetsStore" }), { isSuccess: !1 };
|
|
926
931
|
}
|
|
927
932
|
};
|
|
928
933
|
deleteMerchantBudget = async (t) => {
|
|
@@ -931,15 +936,15 @@ class _e {
|
|
|
931
936
|
this.merchantBudgets = this.merchantBudgets.filter((e) => e.guid !== t);
|
|
932
937
|
}), { isSuccess: !0 };
|
|
933
938
|
} catch (e) {
|
|
934
|
-
return console.error(
|
|
939
|
+
return console.error("Error deleting merchant budget:", e), this.globalStore.captureException(e, { store: "BudgetsStore" }), { isSuccess: !1 };
|
|
935
940
|
}
|
|
936
941
|
};
|
|
937
942
|
}
|
|
938
|
-
class
|
|
943
|
+
class Se {
|
|
939
944
|
globalStore;
|
|
940
945
|
uiStore;
|
|
941
946
|
constructor(t) {
|
|
942
|
-
this.globalStore = t, this.uiStore = new
|
|
947
|
+
this.globalStore = t, this.uiStore = new fe(t), h(this);
|
|
943
948
|
}
|
|
944
949
|
completeOnboarding = async () => {
|
|
945
950
|
const t = {
|
|
@@ -949,16 +954,16 @@ class fe {
|
|
|
949
954
|
await this.globalStore.userStore.updateUserProfile(t);
|
|
950
955
|
};
|
|
951
956
|
}
|
|
952
|
-
let
|
|
957
|
+
let fe = class {
|
|
953
958
|
globalStore;
|
|
954
959
|
// Cashflow is hard-coded to display 30 days starting from today. This is the
|
|
955
960
|
// single source of truth for Cash Flow's window; it intentionally does NOT
|
|
956
961
|
// mutate RecurringTransactionsStore.dateRange, so Cash Flow stays decoupled
|
|
957
962
|
// from other widgets (e.g. Recurring Transactions) that drive that shared range.
|
|
958
|
-
dateRange = { start:
|
|
963
|
+
dateRange = { start: f(), end: Dt(f(), 30) };
|
|
959
964
|
isDirty = !1;
|
|
960
965
|
constructor(t) {
|
|
961
|
-
this.globalStore = t,
|
|
966
|
+
this.globalStore = t, h(this);
|
|
962
967
|
}
|
|
963
968
|
// Recurrence data scoped to Cash Flow's own dateRange, sourced from the
|
|
964
969
|
// range-parameterized helpers on RecurringTransactionsStore. Computeds (not
|
|
@@ -989,26 +994,26 @@ let ye = class {
|
|
|
989
994
|
get selectedCashBalance() {
|
|
990
995
|
const t = this.globalStore.appConfig.config.display_available_balance_in_accounts;
|
|
991
996
|
return this.selectedCashAccounts.reduce(
|
|
992
|
-
(e, s) => e +
|
|
997
|
+
(e, s) => e + At(s, t),
|
|
993
998
|
0
|
|
994
999
|
);
|
|
995
1000
|
}
|
|
996
1001
|
// Returns the number of days until the next income activity or 0 if there is no income activity
|
|
997
1002
|
get daysUntilNextIncome() {
|
|
998
|
-
return this.nextIncome ? Math.abs(
|
|
1003
|
+
return this.nextIncome ? Math.abs(xt(f(), this.nextIncome.expectedDate)) : 0;
|
|
999
1004
|
}
|
|
1000
1005
|
// Returns the expenses (Activities) until the next income activity or the end of the month
|
|
1001
1006
|
// if there is no income activity
|
|
1002
1007
|
get expensesTilNextIncome() {
|
|
1003
1008
|
return this.upcomingExpenses.filter(
|
|
1004
|
-
(t) =>
|
|
1009
|
+
(t) => W(t.expectedDate, this.nextIncome?.expectedDate || b(/* @__PURE__ */ new Date()))
|
|
1005
1010
|
);
|
|
1006
1011
|
}
|
|
1007
1012
|
};
|
|
1008
|
-
class
|
|
1013
|
+
class ye {
|
|
1009
1014
|
globalStore;
|
|
1010
1015
|
uiStore;
|
|
1011
|
-
api = new
|
|
1016
|
+
api = new Z("/", "");
|
|
1012
1017
|
categories = [];
|
|
1013
1018
|
categoriesLoaded = !1;
|
|
1014
1019
|
categoriesLoading = !1;
|
|
@@ -1019,10 +1024,10 @@ class me {
|
|
|
1019
1024
|
monthlyTotalsLoaded = !1;
|
|
1020
1025
|
monthlyTotalsLoading = !1;
|
|
1021
1026
|
constructor(t) {
|
|
1022
|
-
this.globalStore = t, this.uiStore = new
|
|
1027
|
+
this.globalStore = t, this.uiStore = new me(), this.api = new Z(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1023
1028
|
}
|
|
1024
1029
|
get detailedCategories() {
|
|
1025
|
-
return this.globalStore.isInitialized ?
|
|
1030
|
+
return this.globalStore.isInitialized ? Lt(
|
|
1026
1031
|
this.categories,
|
|
1027
1032
|
this.globalStore.copyStore.copy.categories,
|
|
1028
1033
|
this.dateRangeCategoryTotals,
|
|
@@ -1030,7 +1035,7 @@ class me {
|
|
|
1030
1035
|
) : [];
|
|
1031
1036
|
}
|
|
1032
1037
|
get detailedCategoriesWithTransactions() {
|
|
1033
|
-
return
|
|
1038
|
+
return vt(
|
|
1034
1039
|
this.detailedCategories,
|
|
1035
1040
|
this.globalStore.transactionStore.sortedTransactions
|
|
1036
1041
|
);
|
|
@@ -1063,7 +1068,7 @@ class me {
|
|
|
1063
1068
|
try {
|
|
1064
1069
|
await this.api.addCategory(s), await this.loadCategories();
|
|
1065
1070
|
} catch (a) {
|
|
1066
|
-
console.error(
|
|
1071
|
+
console.error("Error occurred while adding category:", a), this.globalStore.captureException(a, { store: "CategoryStore" });
|
|
1067
1072
|
}
|
|
1068
1073
|
};
|
|
1069
1074
|
loadCategories = async () => {
|
|
@@ -1073,7 +1078,7 @@ class me {
|
|
|
1073
1078
|
const t = await this.api.getCategories();
|
|
1074
1079
|
this.setCategories(t);
|
|
1075
1080
|
} catch (t) {
|
|
1076
|
-
console.error(
|
|
1081
|
+
console.error("Error occurred while getting categories:", t), this.globalStore.captureException(t, { store: "CategoryStore" }), c(() => {
|
|
1077
1082
|
this.categoriesLoading = !1;
|
|
1078
1083
|
});
|
|
1079
1084
|
}
|
|
@@ -1090,50 +1095,50 @@ class me {
|
|
|
1090
1095
|
);
|
|
1091
1096
|
this.setDateRangeCategoryTotals(a);
|
|
1092
1097
|
} catch (a) {
|
|
1093
|
-
console.error(
|
|
1098
|
+
console.error("Error occurred while getting date range category totals:", a), this.globalStore.captureException(a, { store: "CategoryStore" }), this.setDateRangeCategoryTotals([]);
|
|
1094
1099
|
}
|
|
1095
1100
|
}
|
|
1096
1101
|
};
|
|
1097
1102
|
loadMonthlyCategoryTotals = async (t = this.globalStore.globalUiStore.selectedAccounts, e, s) => {
|
|
1098
1103
|
if (this.monthlyTotalsLoading) return;
|
|
1099
1104
|
this.monthlyTotalsLoading = !0;
|
|
1100
|
-
const a = m(
|
|
1105
|
+
const a = m(C(e ?? N(/* @__PURE__ */ new Date(), 11))), o = m(b(s ?? /* @__PURE__ */ new Date()));
|
|
1101
1106
|
try {
|
|
1102
|
-
const
|
|
1103
|
-
this.setMonthlyCategoryTotals(
|
|
1104
|
-
} catch (
|
|
1105
|
-
console.error(
|
|
1107
|
+
const i = await this.api.getMonthlyCategoryTotals(a, o, t);
|
|
1108
|
+
this.setMonthlyCategoryTotals(i);
|
|
1109
|
+
} catch (i) {
|
|
1110
|
+
console.error("Error occurred while getting monthly category totals:", i), this.globalStore.captureException(i, { store: "CategoryStore" }), this.setMonthlyCategoryTotals([]);
|
|
1106
1111
|
}
|
|
1107
1112
|
};
|
|
1108
1113
|
reloadCategoryTotals = async (t, e, s) => {
|
|
1109
|
-
const a = e ??
|
|
1114
|
+
const a = e ?? N(/* @__PURE__ */ new Date(), 11), o = s ?? b(/* @__PURE__ */ new Date());
|
|
1110
1115
|
try {
|
|
1111
1116
|
await Promise.all([
|
|
1112
1117
|
this.loadMonthlyCategoryTotals(t, a, o),
|
|
1113
1118
|
this.loadDateRangeCategoryTotals(t, a, o)
|
|
1114
1119
|
]);
|
|
1115
|
-
} catch (
|
|
1116
|
-
console.error(
|
|
1120
|
+
} catch (i) {
|
|
1121
|
+
console.error("Error occurred while getting category totals:", i), this.globalStore.captureException(i, { store: "CategoryStore" });
|
|
1117
1122
|
}
|
|
1118
1123
|
};
|
|
1119
1124
|
removeCategory = async (t) => {
|
|
1120
1125
|
try {
|
|
1121
1126
|
await this.api.removeCategory(t), await this.loadCategories();
|
|
1122
1127
|
} catch (e) {
|
|
1123
|
-
console.error(
|
|
1128
|
+
console.error("Error occurred while removing category:", e), this.globalStore.captureException(e, { store: "CategoryStore" });
|
|
1124
1129
|
}
|
|
1125
1130
|
};
|
|
1126
1131
|
updateCategory = async (t) => {
|
|
1127
1132
|
try {
|
|
1128
1133
|
await this.api.updateCategory(t), await this.loadCategories();
|
|
1129
1134
|
} catch (e) {
|
|
1130
|
-
console.error(
|
|
1135
|
+
console.error("Error occurred while updating category:", e), this.globalStore.captureException(e, { store: "CategoryStore" });
|
|
1131
1136
|
}
|
|
1132
1137
|
};
|
|
1133
1138
|
// TODO: Remove this after refactoring Trends components to use detailedCategories
|
|
1134
1139
|
getCategoryName = (t) => this.categories.find((s) => s.guid === t)?.name ?? Rt[t];
|
|
1135
1140
|
}
|
|
1136
|
-
let
|
|
1141
|
+
let me = class {
|
|
1137
1142
|
expandedGuid = null;
|
|
1138
1143
|
selectedGuid = null;
|
|
1139
1144
|
searchValue = "";
|
|
@@ -1144,7 +1149,7 @@ let Se = class {
|
|
|
1144
1149
|
savedOnSelect;
|
|
1145
1150
|
// todo
|
|
1146
1151
|
constructor() {
|
|
1147
|
-
|
|
1152
|
+
h(this);
|
|
1148
1153
|
}
|
|
1149
1154
|
setExpandedGuid = (t) => this.expandedGuid = t;
|
|
1150
1155
|
setSelectedGuid = (t) => this.selectedGuid = t;
|
|
@@ -1158,19 +1163,19 @@ let Se = class {
|
|
|
1158
1163
|
};
|
|
1159
1164
|
class Te {
|
|
1160
1165
|
globalStore;
|
|
1161
|
-
widgetApi = new
|
|
1166
|
+
widgetApi = new lt("/", "");
|
|
1162
1167
|
constructor(t) {
|
|
1163
|
-
this.globalStore = t, this.widgetApi = new
|
|
1168
|
+
this.globalStore = t, this.widgetApi = new lt(t.endpoint, t.sessionToken), h(this);
|
|
1164
1169
|
}
|
|
1165
1170
|
loadWidget = async ({ widget: t = "connect_widget", mode: e = "light", ...s }) => await this.widgetApi.requestWidgetUrl({
|
|
1166
1171
|
widget_url: { widget_type: t, color_scheme: e, ...s }
|
|
1167
1172
|
});
|
|
1168
1173
|
}
|
|
1169
|
-
class
|
|
1174
|
+
class be {
|
|
1170
1175
|
globalStore;
|
|
1171
1176
|
uiStore;
|
|
1172
1177
|
constructor(t) {
|
|
1173
|
-
this.globalStore = t, this.uiStore = new
|
|
1178
|
+
this.globalStore = t, this.uiStore = new Ae(), h(this);
|
|
1174
1179
|
}
|
|
1175
1180
|
get debts() {
|
|
1176
1181
|
const { visibleDebtAccounts: t } = this.globalStore.accountStore, { selectedAccountGuids: e } = this.globalStore.globalUiStore, { debtGoals: s } = this.globalStore.goalStore, a = e.length ? t.filter((o) => e.includes(o.guid)) : t;
|
|
@@ -1180,12 +1185,12 @@ class Ae {
|
|
|
1180
1185
|
return this.debts.map((e) => Number(e.monthly_payment)).filter((e) => !isNaN(e)).reduce((e, s) => e + s, 0);
|
|
1181
1186
|
}
|
|
1182
1187
|
}
|
|
1183
|
-
let
|
|
1188
|
+
let Ae = class {
|
|
1184
1189
|
isLoading = !1;
|
|
1185
1190
|
selectedDebtChartData = {};
|
|
1186
1191
|
selectedDebtPriority = Ut.LOWEST_BALANCE;
|
|
1187
1192
|
constructor() {
|
|
1188
|
-
|
|
1193
|
+
h(this);
|
|
1189
1194
|
}
|
|
1190
1195
|
get showError() {
|
|
1191
1196
|
const { interest_rate: t, monthly_payment: e } = this.selectedDebtChartData;
|
|
@@ -1198,17 +1203,17 @@ let we = class {
|
|
|
1198
1203
|
setSelectedDebtChartData = (t) => this.selectedDebtChartData = t;
|
|
1199
1204
|
setSelectedDebtPriority = (t) => this.selectedDebtPriority = t;
|
|
1200
1205
|
};
|
|
1201
|
-
const
|
|
1202
|
-
x:
|
|
1206
|
+
const we = (r) => r.sort((t, e) => t.monthly_health_score_average.year !== e.monthly_health_score_average.year ? t.monthly_health_score_average.year - e.monthly_health_score_average.year : t.monthly_health_score_average.month - e.monthly_health_score_average.month).map((t) => ({
|
|
1207
|
+
x: k(
|
|
1203
1208
|
new Date(0, t.monthly_health_score_average.month - 1, 1),
|
|
1204
|
-
|
|
1209
|
+
H.MONTH_SHORT
|
|
1205
1210
|
),
|
|
1206
1211
|
y: Math.round(t.monthly_health_score_average.average_health_score)
|
|
1207
|
-
})),
|
|
1212
|
+
})), Ee = (r) => r.map(({ transaction: e }) => ({
|
|
1208
1213
|
...e
|
|
1209
1214
|
})).sort((e, s) => s.date - e.date);
|
|
1210
|
-
class
|
|
1211
|
-
api = new
|
|
1215
|
+
class Ie {
|
|
1216
|
+
api = new tt("/", "");
|
|
1212
1217
|
augmentedChartData = [];
|
|
1213
1218
|
averageHealthScores = [];
|
|
1214
1219
|
monthlySummaries = [];
|
|
@@ -1224,7 +1229,7 @@ class Ce {
|
|
|
1224
1229
|
isSpendingInitialized = !1;
|
|
1225
1230
|
isIncomeInitialized = !1;
|
|
1226
1231
|
constructor(t) {
|
|
1227
|
-
this.globalStore = t, this.api = new
|
|
1232
|
+
this.globalStore = t, this.api = new tt(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1228
1233
|
}
|
|
1229
1234
|
setSpendingInitialized = (t) => {
|
|
1230
1235
|
this.isSpendingInitialized = t;
|
|
@@ -1242,7 +1247,7 @@ class Ce {
|
|
|
1242
1247
|
this.healthScore = e, this.healthScoreChange = s;
|
|
1243
1248
|
});
|
|
1244
1249
|
} catch (e) {
|
|
1245
|
-
console.error("Error calculating health score:", e);
|
|
1250
|
+
console.error("Error calculating health score:", e), this.globalStore.captureException(e, { store: "FinstrongStore" });
|
|
1246
1251
|
}
|
|
1247
1252
|
};
|
|
1248
1253
|
loadAverageHealthScores = async () => {
|
|
@@ -1252,7 +1257,7 @@ class Ce {
|
|
|
1252
1257
|
this.averageHealthScores = t;
|
|
1253
1258
|
});
|
|
1254
1259
|
} catch (t) {
|
|
1255
|
-
console.error("Error loading average health scores:", t);
|
|
1260
|
+
console.error("Error loading average health scores:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1256
1261
|
}
|
|
1257
1262
|
};
|
|
1258
1263
|
loadMonthlySummaries = async () => {
|
|
@@ -1262,7 +1267,7 @@ class Ce {
|
|
|
1262
1267
|
this.monthlySummaries = t;
|
|
1263
1268
|
});
|
|
1264
1269
|
} catch (t) {
|
|
1265
|
-
console.error("Error loading monthly summaries:", t);
|
|
1270
|
+
console.error("Error loading monthly summaries:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1266
1271
|
}
|
|
1267
1272
|
};
|
|
1268
1273
|
loadDebtSpend = async () => {
|
|
@@ -1272,7 +1277,7 @@ class Ce {
|
|
|
1272
1277
|
this.debtSpendTransactions = t;
|
|
1273
1278
|
});
|
|
1274
1279
|
} catch (t) {
|
|
1275
|
-
console.error("Error loading debt spend:", t);
|
|
1280
|
+
console.error("Error loading debt spend:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1276
1281
|
}
|
|
1277
1282
|
};
|
|
1278
1283
|
loadIncome = async () => {
|
|
@@ -1283,11 +1288,11 @@ class Ce {
|
|
|
1283
1288
|
this.incomeTransactions = t, this.setIncomeInitialized(!0);
|
|
1284
1289
|
});
|
|
1285
1290
|
} catch (t) {
|
|
1286
|
-
console.error("Error loading income:", t);
|
|
1291
|
+
console.error("Error loading income:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1287
1292
|
}
|
|
1288
1293
|
};
|
|
1289
1294
|
loadHealthScoreChangeReports = async () => {
|
|
1290
|
-
const t = m(
|
|
1295
|
+
const t = m(N(/* @__PURE__ */ new Date(), 2)), e = m(/* @__PURE__ */ new Date());
|
|
1291
1296
|
try {
|
|
1292
1297
|
const s = await this.api.getHealthScoreChangeReports(
|
|
1293
1298
|
t,
|
|
@@ -1297,7 +1302,7 @@ class Ce {
|
|
|
1297
1302
|
this.healthScoreChangeReports = s;
|
|
1298
1303
|
});
|
|
1299
1304
|
} catch (s) {
|
|
1300
|
-
console.error("Error loading health score change reports:", s);
|
|
1305
|
+
console.error("Error loading health score change reports:", s), this.globalStore.captureException(s, { store: "FinstrongStore" });
|
|
1301
1306
|
}
|
|
1302
1307
|
};
|
|
1303
1308
|
loadPeerScore = async () => {
|
|
@@ -1308,27 +1313,27 @@ class Ce {
|
|
|
1308
1313
|
this.peerScore = e;
|
|
1309
1314
|
});
|
|
1310
1315
|
} catch (e) {
|
|
1311
|
-
console.error("Error loading peer score:", e);
|
|
1316
|
+
console.error("Error loading peer score:", e), this.globalStore.captureException(e, { store: "FinstrongStore" });
|
|
1312
1317
|
}
|
|
1313
1318
|
};
|
|
1314
1319
|
loadAugmentedChartData = async () => {
|
|
1315
1320
|
try {
|
|
1316
1321
|
const t = await this.api.getAverageHealthScores();
|
|
1317
1322
|
c(() => {
|
|
1318
|
-
this.augmentedChartData =
|
|
1323
|
+
this.augmentedChartData = we(t);
|
|
1319
1324
|
});
|
|
1320
1325
|
} catch (t) {
|
|
1321
|
-
console.error(
|
|
1326
|
+
console.error("Error occurred while getting augmented chart data:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1322
1327
|
}
|
|
1323
1328
|
};
|
|
1324
1329
|
getSpendingFeeTransactions = async () => {
|
|
1325
1330
|
try {
|
|
1326
|
-
const t = await this.api.getSpendingFeeTransactions(), e =
|
|
1331
|
+
const t = await this.api.getSpendingFeeTransactions(), e = Ee(t);
|
|
1327
1332
|
c(() => {
|
|
1328
1333
|
this.spendingFeeTransactions = e;
|
|
1329
1334
|
});
|
|
1330
1335
|
} catch (t) {
|
|
1331
|
-
console.error(
|
|
1336
|
+
console.error("Error occurred while getting spending fee transactions:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1332
1337
|
}
|
|
1333
1338
|
};
|
|
1334
1339
|
loadSpendTransactions = async () => {
|
|
@@ -1339,7 +1344,7 @@ class Ce {
|
|
|
1339
1344
|
this.spendTransactions = [...t], this.setSpendingInitialized(!0);
|
|
1340
1345
|
});
|
|
1341
1346
|
} catch (t) {
|
|
1342
|
-
console.error("Error loading spend transactions:", t);
|
|
1347
|
+
console.error("Error loading spend transactions:", t), this.globalStore.captureException(t, { store: "FinstrongStore" });
|
|
1343
1348
|
}
|
|
1344
1349
|
};
|
|
1345
1350
|
get spendAndDebtTransactions() {
|
|
@@ -1356,7 +1361,7 @@ class Ce {
|
|
|
1356
1361
|
handleFinstrongWidgetPrimaryCtaClick = (t) => () => {
|
|
1357
1362
|
};
|
|
1358
1363
|
}
|
|
1359
|
-
const
|
|
1364
|
+
const ht = {
|
|
1360
1365
|
clientConfig: {},
|
|
1361
1366
|
clientStyleProfile: {},
|
|
1362
1367
|
config: {
|
|
@@ -1462,9 +1467,10 @@ const lt = {
|
|
|
1462
1467
|
};
|
|
1463
1468
|
class Ns {
|
|
1464
1469
|
// Global properties
|
|
1465
|
-
appConfig =
|
|
1470
|
+
appConfig = ht;
|
|
1466
1471
|
endpoint = "/";
|
|
1467
1472
|
sessionToken = "";
|
|
1473
|
+
onCaptureException;
|
|
1468
1474
|
onError;
|
|
1469
1475
|
onStoreUpdate;
|
|
1470
1476
|
// Data Stores
|
|
@@ -1492,17 +1498,20 @@ class Ns {
|
|
|
1492
1498
|
userStore;
|
|
1493
1499
|
// UI Stores
|
|
1494
1500
|
globalUiStore;
|
|
1495
|
-
constructor(t =
|
|
1496
|
-
this.appConfig = t, this.endpoint = e, this.sessionToken = t.options.session_token ?? "", this.onError = s, this.onStoreUpdate = a, this.accountStore = new ce(this), this.appDataStore = new
|
|
1497
|
-
const { transactions:
|
|
1501
|
+
constructor(t = ht, e = "/", s, a, o) {
|
|
1502
|
+
this.appConfig = t, this.endpoint = e, this.sessionToken = t.options.session_token ?? "", this.onCaptureException = o, this.onError = s, this.onStoreUpdate = a, this.accountStore = new ce(this), this.appDataStore = new he(this), this.analyticsStore = new de(this), this.beatStore = new pe(this), this.budgetsStore = new _e(this), this.cashflowStore = new Se(this), this.categoryStore = new ye(this), this.connectStore = new Te(this), this.copyStore = new Re(this), this.debtsStore = new be(this), this.finstrongStore = new Ie(this), this.goalStore = new De(this), this.helpStore = new ve(this), this.holdingStore = new Ge(this), this.merchantStore = new Ne(this), this.netWorthStore = new Be(this), this.notificationStore = new Me(this), this.recurringTransactionsStore = new Oe(this), this.settingsStore = new Fe(this), this.transactionStore = new Ue(this), this.trendsStore = new He(this), this.userStore = new We(this), this.globalUiStore = new Ce(this), h(this), mt(() => {
|
|
1503
|
+
const { transactions: i } = this.transactionStore;
|
|
1498
1504
|
this.emitUpdate({
|
|
1499
|
-
transactions:
|
|
1505
|
+
transactions: i
|
|
1500
1506
|
});
|
|
1501
1507
|
});
|
|
1502
1508
|
}
|
|
1503
1509
|
get isInitialized() {
|
|
1504
1510
|
return this.globalUiStore.isInitialized;
|
|
1505
1511
|
}
|
|
1512
|
+
captureException = (t, e) => {
|
|
1513
|
+
this.onCaptureException?.(t, e);
|
|
1514
|
+
};
|
|
1506
1515
|
// emits change triggered in the autorun
|
|
1507
1516
|
emitUpdate = (t) => {
|
|
1508
1517
|
this.onStoreUpdate?.(t);
|
|
@@ -1522,24 +1531,24 @@ class Ns {
|
|
|
1522
1531
|
associatedBeats: s,
|
|
1523
1532
|
categories: a,
|
|
1524
1533
|
institutions: o,
|
|
1525
|
-
transactionRules:
|
|
1534
|
+
transactionRules: i,
|
|
1526
1535
|
transactions: l,
|
|
1527
|
-
userFeatures:
|
|
1528
|
-
merchantBudgets:
|
|
1536
|
+
userFeatures: g,
|
|
1537
|
+
merchantBudgets: y
|
|
1529
1538
|
} = {}) => {
|
|
1530
|
-
(!e || !
|
|
1539
|
+
(!e || !g) && await this.loadConfigData(), e && this.appDataStore.setAppData(e), g && this.userStore.setUserFeatures(g), t && (await this.accountStore.loadMembers(), o && this.accountStore.setInstitutions(o), this.accountStore.setAccounts(t)), s && this.transactionStore.setAssociatedBeats(s), a && this.categoryStore.setCategories(a), l && this.transactionStore.setTransactions(l), i && this.transactionStore.setTransactionRules(i), y && this.budgetsStore.setMerchantBudgets(y);
|
|
1531
1540
|
};
|
|
1532
1541
|
}
|
|
1533
|
-
class
|
|
1542
|
+
class Ce {
|
|
1534
1543
|
globalStore;
|
|
1535
1544
|
accountFilterMap = /* @__PURE__ */ new Map();
|
|
1536
1545
|
displayedDate = /* @__PURE__ */ new Date();
|
|
1537
1546
|
displayedDateRange = {
|
|
1538
|
-
start:
|
|
1539
|
-
end:
|
|
1547
|
+
start: C(this.displayedDate),
|
|
1548
|
+
end: b(this.displayedDate)
|
|
1540
1549
|
};
|
|
1541
1550
|
constructor(t) {
|
|
1542
|
-
|
|
1551
|
+
h(this), this.globalStore = t, gt(
|
|
1543
1552
|
() => this.globalStore.accountStore.visibleAccounts,
|
|
1544
1553
|
(e) => {
|
|
1545
1554
|
this.populateAccountFilterMap(e);
|
|
@@ -1589,7 +1598,7 @@ class Ee {
|
|
|
1589
1598
|
};
|
|
1590
1599
|
};
|
|
1591
1600
|
get shouldDisableNextDate() {
|
|
1592
|
-
const t = v(this.displayedDate), e = v(
|
|
1601
|
+
const t = v(this.displayedDate), e = v(ie(/* @__PURE__ */ new Date(), 1));
|
|
1593
1602
|
return t === e;
|
|
1594
1603
|
}
|
|
1595
1604
|
get shouldDisablePrevDate() {
|
|
@@ -1599,16 +1608,16 @@ class Ee {
|
|
|
1599
1608
|
}
|
|
1600
1609
|
class Re {
|
|
1601
1610
|
globalStore;
|
|
1602
|
-
api = new
|
|
1611
|
+
api = new z("/", "");
|
|
1603
1612
|
copy = {};
|
|
1604
1613
|
featureNamespace = "experiences";
|
|
1605
1614
|
isInitialized = !1;
|
|
1606
1615
|
constructor(t) {
|
|
1607
|
-
this.globalStore = t, this.api = new
|
|
1616
|
+
this.globalStore = t, this.api = new z(
|
|
1608
1617
|
t.endpoint,
|
|
1609
1618
|
t.sessionToken,
|
|
1610
1619
|
t.onError
|
|
1611
|
-
),
|
|
1620
|
+
), h(this);
|
|
1612
1621
|
}
|
|
1613
1622
|
loadCopy = async () => {
|
|
1614
1623
|
await this.getCopy(this.featureNamespace), c(() => {
|
|
@@ -1622,13 +1631,13 @@ class Re {
|
|
|
1622
1631
|
this.copy = s[t];
|
|
1623
1632
|
});
|
|
1624
1633
|
} catch (s) {
|
|
1625
|
-
console.error(
|
|
1634
|
+
console.error("Error occurred while fetching copy:", s), this.globalStore.captureException(s, { store: "GlobalCopyStore" });
|
|
1626
1635
|
}
|
|
1627
1636
|
};
|
|
1628
1637
|
}
|
|
1629
1638
|
class De {
|
|
1630
1639
|
globalStore;
|
|
1631
|
-
api = new
|
|
1640
|
+
api = new et("/", "");
|
|
1632
1641
|
goals = [];
|
|
1633
1642
|
goalsLoaded = !1;
|
|
1634
1643
|
retirementGoals = [];
|
|
@@ -1641,7 +1650,7 @@ class De {
|
|
|
1641
1650
|
alert = "";
|
|
1642
1651
|
selectedGoal = void 0;
|
|
1643
1652
|
constructor(t) {
|
|
1644
|
-
this.globalStore = t, this.api = new
|
|
1653
|
+
this.globalStore = t, this.api = new et(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1645
1654
|
}
|
|
1646
1655
|
get allGoals() {
|
|
1647
1656
|
if (!this.isAllGoalDataLoaded) return [];
|
|
@@ -1652,8 +1661,8 @@ class De {
|
|
|
1652
1661
|
...s,
|
|
1653
1662
|
amount: s.target_amount,
|
|
1654
1663
|
name: t.retirement,
|
|
1655
|
-
track_type:
|
|
1656
|
-
projected_to_complete_at: s.retirement_age && e ?
|
|
1664
|
+
track_type: T.RETIREMENT_TRACK,
|
|
1665
|
+
projected_to_complete_at: s.retirement_age && e ? K(s.retirement_age, e) : void 0
|
|
1657
1666
|
}))
|
|
1658
1667
|
];
|
|
1659
1668
|
}
|
|
@@ -1661,25 +1670,25 @@ class De {
|
|
|
1661
1670
|
return this.allGoals.slice().sort((t, e) => t.position - e.position);
|
|
1662
1671
|
}
|
|
1663
1672
|
get debtGoals() {
|
|
1664
|
-
return this.orderedGoals.filter((t) => t.track_type ===
|
|
1673
|
+
return this.orderedGoals.filter((t) => t.track_type === T.DEBT_TRACK);
|
|
1665
1674
|
}
|
|
1666
1675
|
get retirmentGoals() {
|
|
1667
|
-
return this.orderedGoals.filter((t) => t.track_type ===
|
|
1676
|
+
return this.orderedGoals.filter((t) => t.track_type === T.RETIREMENT_TRACK);
|
|
1668
1677
|
}
|
|
1669
1678
|
get savingGoals() {
|
|
1670
|
-
return this.orderedGoals.filter((t) => t.track_type ===
|
|
1679
|
+
return this.orderedGoals.filter((t) => t.track_type === T.SAVINGS_TRACK);
|
|
1671
1680
|
}
|
|
1672
1681
|
get ongoingGoalsForMicroWidget() {
|
|
1673
1682
|
const t = this.allGoals.filter(
|
|
1674
|
-
(s) => !s.is_complete && s.track_type !==
|
|
1683
|
+
(s) => !s.is_complete && s.track_type !== T.EMERGENCY_FUND_TRACK && s.track_type !== null
|
|
1675
1684
|
), e = [
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1685
|
+
T.SAVINGS_TRACK,
|
|
1686
|
+
T.DEBT_TRACK,
|
|
1687
|
+
T.RETIREMENT_TRACK
|
|
1679
1688
|
];
|
|
1680
1689
|
return t.sort((s, a) => {
|
|
1681
|
-
const o = s.track_type ? e.indexOf(s.track_type) : -1,
|
|
1682
|
-
return o -
|
|
1690
|
+
const o = s.track_type ? e.indexOf(s.track_type) : -1, i = a.track_type ? e.indexOf(a.track_type) : -1;
|
|
1691
|
+
return o - i;
|
|
1683
1692
|
}).slice(0, 3);
|
|
1684
1693
|
}
|
|
1685
1694
|
get isAllGoalDataLoaded() {
|
|
@@ -1710,7 +1719,7 @@ class De {
|
|
|
1710
1719
|
const t = await this.api.getGoals();
|
|
1711
1720
|
this.setGoals(t);
|
|
1712
1721
|
} catch (t) {
|
|
1713
|
-
console.error(
|
|
1722
|
+
console.error("Error occurred while getting goals:", t), this.globalStore.captureException(t, { store: "GoalStore" });
|
|
1714
1723
|
}
|
|
1715
1724
|
};
|
|
1716
1725
|
loadRetirementGoals = async () => {
|
|
@@ -1718,7 +1727,7 @@ class De {
|
|
|
1718
1727
|
const t = await this.api.getRetirementGoals();
|
|
1719
1728
|
this.setRetirementGoals(t);
|
|
1720
1729
|
} catch (t) {
|
|
1721
|
-
console.error(
|
|
1730
|
+
console.error("Error occurred while loading retirement goals:", t), this.globalStore.captureException(t, { store: "GoalStore" });
|
|
1722
1731
|
}
|
|
1723
1732
|
};
|
|
1724
1733
|
loadRetirementGoalAccounts = async () => {
|
|
@@ -1726,7 +1735,7 @@ class De {
|
|
|
1726
1735
|
const t = await this.api.getRetirementGoalAccounts();
|
|
1727
1736
|
this.setRetirementGoalAccounts(t);
|
|
1728
1737
|
} catch (t) {
|
|
1729
|
-
console.error(
|
|
1738
|
+
console.error("Error occurred while loading retirement goal accounts:", t), this.globalStore.captureException(t, { store: "GoalStore" });
|
|
1730
1739
|
}
|
|
1731
1740
|
};
|
|
1732
1741
|
loadMonthlyCashFlowProfile = async () => {
|
|
@@ -1734,7 +1743,7 @@ class De {
|
|
|
1734
1743
|
const t = await this.api.getMonthlyCashFlowProfile();
|
|
1735
1744
|
this.setMonthlyCashFlowProfile(t);
|
|
1736
1745
|
} catch (t) {
|
|
1737
|
-
console.error(
|
|
1746
|
+
console.error("Error occurred while loading monthly cash flow profile:", t), this.globalStore.captureException(t, { store: "GoalStore" });
|
|
1738
1747
|
}
|
|
1739
1748
|
};
|
|
1740
1749
|
addGoal = async (t) => {
|
|
@@ -1742,16 +1751,16 @@ class De {
|
|
|
1742
1751
|
const e = await this.api.addGoal(t);
|
|
1743
1752
|
this.setGoals([...this.goals, e]);
|
|
1744
1753
|
} catch (e) {
|
|
1745
|
-
console.error(
|
|
1754
|
+
console.error("Error occurred while adding goal:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1746
1755
|
}
|
|
1747
1756
|
};
|
|
1748
1757
|
addRetirementGoal = async (t) => {
|
|
1749
1758
|
const e = this.globalStore.copyStore.copy.goals;
|
|
1750
1759
|
try {
|
|
1751
1760
|
const s = await this.api.addRetirementGoal(t), a = [], o = this.globalStore.userStore.user.birthday;
|
|
1752
|
-
for (const
|
|
1761
|
+
for (const i of this.newRetirementGoalAccounts) {
|
|
1753
1762
|
const l = await this.api.addRetirementGoalAccount({
|
|
1754
|
-
...
|
|
1763
|
+
...i,
|
|
1755
1764
|
retirement_goal_guid: s.guid
|
|
1756
1765
|
});
|
|
1757
1766
|
a.push(l);
|
|
@@ -1762,12 +1771,12 @@ class De {
|
|
|
1762
1771
|
...s,
|
|
1763
1772
|
amount: s.target_amount,
|
|
1764
1773
|
name: e.retirement,
|
|
1765
|
-
track_type:
|
|
1766
|
-
projected_to_complete_at: s.retirement_age && o ?
|
|
1774
|
+
track_type: T.RETIREMENT_TRACK,
|
|
1775
|
+
projected_to_complete_at: s.retirement_age && o ? K(s.retirement_age, o) : void 0
|
|
1767
1776
|
}
|
|
1768
1777
|
], this.setRetirementGoalAccounts([...this.retirementGoalAccounts, ...a]);
|
|
1769
1778
|
} catch (s) {
|
|
1770
|
-
console.error(
|
|
1779
|
+
console.error("Error occurred while adding retirement goal:", s), this.globalStore.captureException(s, { store: "GoalStore" });
|
|
1771
1780
|
}
|
|
1772
1781
|
};
|
|
1773
1782
|
addRetirementGoalAccount = async (t) => {
|
|
@@ -1777,7 +1786,7 @@ class De {
|
|
|
1777
1786
|
this.retirementGoalAccounts = [...this.retirementGoalAccounts, e];
|
|
1778
1787
|
});
|
|
1779
1788
|
} catch (e) {
|
|
1780
|
-
console.error(
|
|
1789
|
+
console.error("Error occurred while adding retirement goal account:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1781
1790
|
}
|
|
1782
1791
|
};
|
|
1783
1792
|
deleteGoal = async (t) => {
|
|
@@ -1786,7 +1795,7 @@ class De {
|
|
|
1786
1795
|
const e = this.goals.findIndex((s) => s.guid === t);
|
|
1787
1796
|
e >= 0 && this.goals.splice(e, 1);
|
|
1788
1797
|
} catch (e) {
|
|
1789
|
-
console.error(
|
|
1798
|
+
console.error("Error occurred while deleting goal:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1790
1799
|
}
|
|
1791
1800
|
};
|
|
1792
1801
|
deleteRetirementGoal = async (t) => {
|
|
@@ -1800,7 +1809,7 @@ class De {
|
|
|
1800
1809
|
const s = this.retirementGoals.findIndex((a) => a.guid === t.guid);
|
|
1801
1810
|
s >= 0 && this.retirementGoals.splice(s, 1);
|
|
1802
1811
|
} catch (e) {
|
|
1803
|
-
console.error(
|
|
1812
|
+
console.error("Error deleting retirement goal:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1804
1813
|
}
|
|
1805
1814
|
};
|
|
1806
1815
|
deleteRetirementGoalAccount = async (t) => {
|
|
@@ -1809,7 +1818,7 @@ class De {
|
|
|
1809
1818
|
const e = this.retirementGoalAccounts.findIndex((s) => s.guid === t);
|
|
1810
1819
|
e >= 0 && this.retirementGoalAccounts.splice(e, 1);
|
|
1811
1820
|
} catch (e) {
|
|
1812
|
-
console.error(
|
|
1821
|
+
console.error("Error deleting retirement goal account:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1813
1822
|
}
|
|
1814
1823
|
};
|
|
1815
1824
|
reorderGoals = async (t) => {
|
|
@@ -1822,7 +1831,7 @@ class De {
|
|
|
1822
1831
|
}
|
|
1823
1832
|
});
|
|
1824
1833
|
} catch (e) {
|
|
1825
|
-
console.error(
|
|
1834
|
+
console.error("Error reordering goals:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1826
1835
|
}
|
|
1827
1836
|
};
|
|
1828
1837
|
setAlert = (t) => this.alert = t;
|
|
@@ -1838,7 +1847,7 @@ class De {
|
|
|
1838
1847
|
s >= 0 && (this.goals[s] = e), this.selectedGoal?.guid === t.guid && this.setSelectedGoal(e);
|
|
1839
1848
|
});
|
|
1840
1849
|
} catch (e) {
|
|
1841
|
-
console.error(
|
|
1850
|
+
console.error("Error occurred while updating goal:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1842
1851
|
}
|
|
1843
1852
|
};
|
|
1844
1853
|
updateRetirementGoal = async (t) => {
|
|
@@ -1852,7 +1861,7 @@ class De {
|
|
|
1852
1861
|
s >= 0 && (this.retirementGoals[s] = e), this.selectedGoal?.guid === t.guid && this.setSelectedGoal(this.allGoals.find((a) => a.guid === t.guid));
|
|
1853
1862
|
});
|
|
1854
1863
|
} catch (e) {
|
|
1855
|
-
console.error(
|
|
1864
|
+
console.error("Error occurred while updating retirement goal:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1856
1865
|
}
|
|
1857
1866
|
};
|
|
1858
1867
|
updateMonthlyCashFlowProfile = async (t) => {
|
|
@@ -1860,11 +1869,11 @@ class De {
|
|
|
1860
1869
|
const e = await this.api.updateMonthlyCashFlowProfile(t);
|
|
1861
1870
|
this.setMonthlyCashFlowProfile(e);
|
|
1862
1871
|
} catch (e) {
|
|
1863
|
-
console.error(
|
|
1872
|
+
console.error("Error occurred while updating monthly cash flow profile:", e), this.globalStore.captureException(e, { store: "GoalStore" });
|
|
1864
1873
|
}
|
|
1865
1874
|
};
|
|
1866
1875
|
}
|
|
1867
|
-
const
|
|
1876
|
+
const xe = (r, t) => r.guid === "general" || r.guid === "insights" ? !0 : r.flags ? r.flags.every((e) => t[e]) : !1, Le = (r, t) => {
|
|
1868
1877
|
const e = [];
|
|
1869
1878
|
for (const s of oe) {
|
|
1870
1879
|
const a = t[s.guid];
|
|
@@ -1872,29 +1881,29 @@ const Le = (n, t) => n.guid === "general" || n.guid === "insights" ? !0 : n.flag
|
|
|
1872
1881
|
const o = {
|
|
1873
1882
|
...s,
|
|
1874
1883
|
title: a.label,
|
|
1875
|
-
topics: s.topics.map(({ topicKey:
|
|
1876
|
-
topicKey:
|
|
1884
|
+
topics: s.topics.map(({ topicKey: i }, l) => ({
|
|
1885
|
+
topicKey: i,
|
|
1877
1886
|
label: a.topics[l]
|
|
1878
1887
|
}))
|
|
1879
1888
|
};
|
|
1880
|
-
|
|
1889
|
+
xe(o, r) && e.push(o);
|
|
1881
1890
|
}
|
|
1882
1891
|
return e;
|
|
1883
1892
|
};
|
|
1884
|
-
class
|
|
1893
|
+
class ve {
|
|
1885
1894
|
alert = { message: "", severity: void 0 };
|
|
1886
|
-
api = new
|
|
1895
|
+
api = new st("/", "");
|
|
1887
1896
|
appConfig;
|
|
1888
1897
|
globalStore;
|
|
1889
1898
|
isLoading = !1;
|
|
1890
1899
|
constructor(t) {
|
|
1891
|
-
this.globalStore = t, this.api = new
|
|
1900
|
+
this.globalStore = t, this.api = new st(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1892
1901
|
}
|
|
1893
1902
|
createSupportTicket = async (t) => {
|
|
1894
1903
|
try {
|
|
1895
1904
|
this.isLoading = !0, await this.api.createSupportTicket(t), this.setAlert(this.copy.request_support_submit_success_message, "success");
|
|
1896
1905
|
} catch (e) {
|
|
1897
|
-
|
|
1906
|
+
console.error("Error occurred while submitting support ticket:", e), this.globalStore.captureException(e, { store: "HelpStore" }), this.setAlert(this.copy.request_support_submit_failure_message, "error");
|
|
1898
1907
|
} finally {
|
|
1899
1908
|
this.isLoading = !1;
|
|
1900
1909
|
}
|
|
@@ -1907,7 +1916,7 @@ class $e {
|
|
|
1907
1916
|
const { client_communication_profile: t, client_profile: e } = this.globalStore.appDataStore.appData, {
|
|
1908
1917
|
help: { category_list: s }
|
|
1909
1918
|
} = this.globalStore.copyStore.copy;
|
|
1910
|
-
return
|
|
1919
|
+
return Le(
|
|
1911
1920
|
{
|
|
1912
1921
|
...t,
|
|
1913
1922
|
...e,
|
|
@@ -1919,13 +1928,13 @@ class $e {
|
|
|
1919
1928
|
}
|
|
1920
1929
|
class Ge {
|
|
1921
1930
|
analysisType = Wt.Stocks;
|
|
1922
|
-
api = new
|
|
1931
|
+
api = new at("/", "");
|
|
1923
1932
|
holdings = [];
|
|
1924
1933
|
holdingsLoaded = !1;
|
|
1925
1934
|
globalStore;
|
|
1926
1935
|
showConnectionsWidget = !1;
|
|
1927
1936
|
constructor(t) {
|
|
1928
|
-
this.globalStore = t, this.api = new
|
|
1937
|
+
this.globalStore = t, this.api = new at(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1929
1938
|
}
|
|
1930
1939
|
get analysisChartData() {
|
|
1931
1940
|
return Vt(zt(this.visibleHoldings), this.analysisType);
|
|
@@ -1949,7 +1958,7 @@ class Ge {
|
|
|
1949
1958
|
const t = await this.api.getHoldings();
|
|
1950
1959
|
this.setHoldings(t);
|
|
1951
1960
|
} catch (t) {
|
|
1952
|
-
console.error(
|
|
1961
|
+
console.error("Error occurred while getting holdings:", t), this.globalStore.captureException(t, { store: "HoldingStore" });
|
|
1953
1962
|
}
|
|
1954
1963
|
};
|
|
1955
1964
|
setAnalysisType = (t) => {
|
|
@@ -1966,18 +1975,18 @@ class Ge {
|
|
|
1966
1975
|
});
|
|
1967
1976
|
}
|
|
1968
1977
|
} catch (e) {
|
|
1969
|
-
console.error(
|
|
1978
|
+
console.error("Error occurred while updating holding:", e), this.globalStore.captureException(e, { store: "HoldingStore" });
|
|
1970
1979
|
}
|
|
1971
1980
|
};
|
|
1972
1981
|
}
|
|
1973
1982
|
class Ne {
|
|
1974
1983
|
globalStore;
|
|
1975
|
-
api = new
|
|
1984
|
+
api = new rt("/", "");
|
|
1976
1985
|
merchant = null;
|
|
1977
1986
|
merchants = [];
|
|
1978
1987
|
isLoading = !1;
|
|
1979
1988
|
constructor(t) {
|
|
1980
|
-
this.globalStore = t, this.api = new
|
|
1989
|
+
this.globalStore = t, this.api = new rt(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
1981
1990
|
}
|
|
1982
1991
|
loadMerchants = async (t = "") => {
|
|
1983
1992
|
this.isLoading = !0;
|
|
@@ -1993,7 +2002,7 @@ class Ne {
|
|
|
1993
2002
|
}
|
|
1994
2003
|
class Be {
|
|
1995
2004
|
globalStore;
|
|
1996
|
-
accountsApi = new
|
|
2005
|
+
accountsApi = new M("/", "");
|
|
1997
2006
|
monthlyAccountBalances = [];
|
|
1998
2007
|
monthlyAccountBalancesLoaded = !1;
|
|
1999
2008
|
hoveredIndex = -1;
|
|
@@ -2001,11 +2010,11 @@ class Be {
|
|
|
2001
2010
|
timeframe = 6;
|
|
2002
2011
|
// default timeframe is 6 months
|
|
2003
2012
|
constructor(t) {
|
|
2004
|
-
this.globalStore = t, this.accountsApi = new
|
|
2013
|
+
this.globalStore = t, this.accountsApi = new M(
|
|
2005
2014
|
t.endpoint,
|
|
2006
2015
|
t.sessionToken,
|
|
2007
2016
|
t.onError
|
|
2008
|
-
),
|
|
2017
|
+
), h(this);
|
|
2009
2018
|
}
|
|
2010
2019
|
get isNetWorthDataLoaded() {
|
|
2011
2020
|
return this.globalStore.accountStore.isAccountDataLoaded && this.monthlyAccountBalancesLoaded;
|
|
@@ -2027,7 +2036,7 @@ class Be {
|
|
|
2027
2036
|
}
|
|
2028
2037
|
get selectedData() {
|
|
2029
2038
|
if (!(!this.netWorthChartData || this.netWorthChartData.length === 0))
|
|
2030
|
-
return this.selectedIndex === -1 ?
|
|
2039
|
+
return this.selectedIndex === -1 ? Q(this.netWorthChartData) : this.netWorthChartData[this.selectedIndex];
|
|
2031
2040
|
}
|
|
2032
2041
|
get hoveredData() {
|
|
2033
2042
|
return this.hoveredIndex >= 0 ? this.netWorthChartData[this.hoveredIndex] : void 0;
|
|
@@ -2040,7 +2049,7 @@ class Be {
|
|
|
2040
2049
|
this.netWorthData.accounts
|
|
2041
2050
|
);
|
|
2042
2051
|
return {
|
|
2043
|
-
netWorth:
|
|
2052
|
+
netWorth: Q(this.netWorthChartData),
|
|
2044
2053
|
assets: t,
|
|
2045
2054
|
liabilities: e,
|
|
2046
2055
|
totalAssets: s,
|
|
@@ -2058,7 +2067,7 @@ class Be {
|
|
|
2058
2067
|
try {
|
|
2059
2068
|
return await this.accountsApi.getMonthlyAccountBalances(t);
|
|
2060
2069
|
} catch (e) {
|
|
2061
|
-
return console.error(
|
|
2070
|
+
return console.error("Error occurred while fetching monthly account balances:", e), this.globalStore.captureException(e, { store: "NetWorthStore" }), [];
|
|
2062
2071
|
}
|
|
2063
2072
|
};
|
|
2064
2073
|
setHoveredIndex = (t) => this.hoveredIndex = t;
|
|
@@ -2068,7 +2077,7 @@ class Be {
|
|
|
2068
2077
|
setSelectedIndex = (t) => this.selectedIndex = t;
|
|
2069
2078
|
setTimeframe = (t) => this.timeframe = t;
|
|
2070
2079
|
}
|
|
2071
|
-
class
|
|
2080
|
+
class Me {
|
|
2072
2081
|
globalStore;
|
|
2073
2082
|
api = new nt("/", "");
|
|
2074
2083
|
isLoading = !0;
|
|
@@ -2079,7 +2088,7 @@ class xe {
|
|
|
2079
2088
|
t.endpoint,
|
|
2080
2089
|
t.sessionToken,
|
|
2081
2090
|
t.onError
|
|
2082
|
-
),
|
|
2091
|
+
), h(this, { notifications: Tt });
|
|
2083
2092
|
}
|
|
2084
2093
|
// Used in Money Dashboard
|
|
2085
2094
|
get newNotifications() {
|
|
@@ -2097,7 +2106,7 @@ class xe {
|
|
|
2097
2106
|
const t = await this.api.getNotifications();
|
|
2098
2107
|
this.setNotifications(t);
|
|
2099
2108
|
} catch (t) {
|
|
2100
|
-
console.error(
|
|
2109
|
+
console.error("Error occurred while loading notifications:", t), this.globalStore.captureException(t, { store: "NotificationStore" });
|
|
2101
2110
|
} finally {
|
|
2102
2111
|
c(() => {
|
|
2103
2112
|
this.isLoading = !1;
|
|
@@ -2111,14 +2120,14 @@ class xe {
|
|
|
2111
2120
|
t.has_been_viewed = !0, await this.api.updateNotification(t);
|
|
2112
2121
|
};
|
|
2113
2122
|
}
|
|
2114
|
-
const dt = (
|
|
2115
|
-
class
|
|
2123
|
+
const dt = (r, t) => pt(t.expectedDate, r), A = (r, t) => r + t.amount;
|
|
2124
|
+
class Oe {
|
|
2116
2125
|
globalStore;
|
|
2117
2126
|
api = new it("/", "");
|
|
2118
2127
|
repeatingTransactions = [];
|
|
2119
2128
|
isDataLoaded = !1;
|
|
2120
2129
|
selectedDay;
|
|
2121
|
-
dateRange = { start:
|
|
2130
|
+
dateRange = { start: C(f()), end: b(f()) };
|
|
2122
2131
|
selectedRepeatingTransactionGuid = null;
|
|
2123
2132
|
selectedRecurrence = null;
|
|
2124
2133
|
alert = { message: "", severity: void 0 };
|
|
@@ -2127,7 +2136,7 @@ class Me {
|
|
|
2127
2136
|
t.endpoint,
|
|
2128
2137
|
t.sessionToken,
|
|
2129
2138
|
t.onError
|
|
2130
|
-
),
|
|
2139
|
+
), h(this, {
|
|
2131
2140
|
recurrencesForRange: !1,
|
|
2132
2141
|
upcomingExpensesForRange: !1,
|
|
2133
2142
|
upcomingIncomeForRange: !1,
|
|
@@ -2139,7 +2148,7 @@ class Me {
|
|
|
2139
2148
|
return this.globalStore.copyStore.copy.recurring;
|
|
2140
2149
|
}
|
|
2141
2150
|
get detailedRepeatingTransactions() {
|
|
2142
|
-
return
|
|
2151
|
+
return U(
|
|
2143
2152
|
this.globalStore.accountStore.visibleAccounts,
|
|
2144
2153
|
this.repeatingTransactions,
|
|
2145
2154
|
this.globalStore.transactionStore.transactions
|
|
@@ -2154,13 +2163,13 @@ class Me {
|
|
|
2154
2163
|
*/
|
|
2155
2164
|
recurrencesForRange = (t) => {
|
|
2156
2165
|
const e = this.globalStore.accountStore.visibleAccounts;
|
|
2157
|
-
return te(this.detailedRepeatingTransactions, t).filter((s) => e.some((a) => a.guid === s.accountGuid && !a.is_excluded_from_accounts)).filter((s) =>
|
|
2166
|
+
return te(this.detailedRepeatingTransactions, t).filter((s) => e.some((a) => a.guid === s.accountGuid && !a.is_excluded_from_accounts)).filter((s) => pt(s.expectedDate, t));
|
|
2158
2167
|
};
|
|
2159
2168
|
/**
|
|
2160
2169
|
* Returns the upcoming expense recurrences scoped to the supplied date range.
|
|
2161
2170
|
*/
|
|
2162
2171
|
upcomingExpensesForRange = (t) => this.recurrencesForRange(t).filter(
|
|
2163
|
-
(e) => e.type === L.Expense && e.status ===
|
|
2172
|
+
(e) => e.type === L.Expense && e.status === S.Upcoming
|
|
2164
2173
|
);
|
|
2165
2174
|
/**
|
|
2166
2175
|
* Returns the income recurrences scoped to the supplied date range.
|
|
@@ -2172,13 +2181,13 @@ class Me {
|
|
|
2172
2181
|
* Returns the upcoming income recurrences scoped to the supplied date range.
|
|
2173
2182
|
*/
|
|
2174
2183
|
upcomingIncomeForRange = (t) => this.incomeForRange(t).filter(
|
|
2175
|
-
(e) => e.status ===
|
|
2184
|
+
(e) => e.status === S.Upcoming
|
|
2176
2185
|
);
|
|
2177
2186
|
/**
|
|
2178
2187
|
* Returns the next upcoming income recurrence scoped to the supplied range.
|
|
2179
2188
|
*/
|
|
2180
2189
|
nextIncomeForRange = (t) => this.upcomingIncomeForRange(t).find(
|
|
2181
|
-
(e) =>
|
|
2190
|
+
(e) => F(e.expectedDate, f())
|
|
2182
2191
|
);
|
|
2183
2192
|
/**
|
|
2184
2193
|
* Returns all recurrences built from repeating transactions and filtered by accounts.
|
|
@@ -2191,7 +2200,7 @@ class Me {
|
|
|
2191
2200
|
*/
|
|
2192
2201
|
get pastRecurrences() {
|
|
2193
2202
|
return this.recurrences.filter(
|
|
2194
|
-
(t) => t.status ===
|
|
2203
|
+
(t) => t.status === S.Paid || t.status === S.Missed
|
|
2195
2204
|
);
|
|
2196
2205
|
}
|
|
2197
2206
|
/**
|
|
@@ -2200,7 +2209,7 @@ class Me {
|
|
|
2200
2209
|
*/
|
|
2201
2210
|
get upcomingRecurrences() {
|
|
2202
2211
|
return this.recurrences.filter(
|
|
2203
|
-
(t) =>
|
|
2212
|
+
(t) => F(t.expectedDate, _t(f(), 3)) && W(t.expectedDate, this.dateRange.end) && t.status === S.Upcoming
|
|
2204
2213
|
);
|
|
2205
2214
|
}
|
|
2206
2215
|
/**
|
|
@@ -2216,7 +2225,7 @@ class Me {
|
|
|
2216
2225
|
*/
|
|
2217
2226
|
get upcomingExpenses() {
|
|
2218
2227
|
return this.expenses.filter(
|
|
2219
|
-
(t) => t.status ===
|
|
2228
|
+
(t) => t.status === S.Upcoming
|
|
2220
2229
|
);
|
|
2221
2230
|
}
|
|
2222
2231
|
/**
|
|
@@ -2232,11 +2241,11 @@ class Me {
|
|
|
2232
2241
|
*/
|
|
2233
2242
|
get upcomingIncome() {
|
|
2234
2243
|
return this.income.filter(
|
|
2235
|
-
(t) => t.status ===
|
|
2244
|
+
(t) => t.status === S.Upcoming
|
|
2236
2245
|
);
|
|
2237
2246
|
}
|
|
2238
2247
|
get nextIncomeRecurrence() {
|
|
2239
|
-
return this.upcomingIncome.find((t) =>
|
|
2248
|
+
return this.upcomingIncome.find((t) => F(t.expectedDate, f()));
|
|
2240
2249
|
}
|
|
2241
2250
|
/**
|
|
2242
2251
|
* Returns the expense recurrences for the current month.
|
|
@@ -2264,19 +2273,19 @@ class Me {
|
|
|
2264
2273
|
* Calculates the total amount of all paid expenses for the current month.
|
|
2265
2274
|
*/
|
|
2266
2275
|
get paidExpenseTotal() {
|
|
2267
|
-
return this.currentMonthExpenses.filter((t) => t.status ===
|
|
2276
|
+
return this.currentMonthExpenses.filter((t) => t.status === S.Paid).reduce(A, 0);
|
|
2268
2277
|
}
|
|
2269
2278
|
/**
|
|
2270
2279
|
* Calculates the total amount of all missed expenses for the current month.
|
|
2271
2280
|
*/
|
|
2272
2281
|
get missedExpenseTotal() {
|
|
2273
|
-
return this.currentMonthExpenses.filter((t) => t.status ===
|
|
2282
|
+
return this.currentMonthExpenses.filter((t) => t.status === S.Missed).reduce(A, 0);
|
|
2274
2283
|
}
|
|
2275
2284
|
/**
|
|
2276
2285
|
* Calculates the total amount of all upcoming expenses for the current month.
|
|
2277
2286
|
*/
|
|
2278
2287
|
get upcomingExpenseTotal() {
|
|
2279
|
-
return this.currentMonthExpenses.filter((t) => t.status ===
|
|
2288
|
+
return this.currentMonthExpenses.filter((t) => t.status === S.Upcoming).reduce(A, 0);
|
|
2280
2289
|
}
|
|
2281
2290
|
/**
|
|
2282
2291
|
* Calculates the total amount of all income for the current month.
|
|
@@ -2288,20 +2297,20 @@ class Me {
|
|
|
2288
2297
|
* Calculates the total amount of all paid income for the current month.
|
|
2289
2298
|
*/
|
|
2290
2299
|
get paidIncomeTotal() {
|
|
2291
|
-
return this.currentMonthIncome.filter((t) => t.status ===
|
|
2300
|
+
return this.currentMonthIncome.filter((t) => t.status === S.Paid).reduce(A, 0);
|
|
2292
2301
|
}
|
|
2293
2302
|
/**
|
|
2294
2303
|
* Calculates the total amount of all upcoming income for the current month.
|
|
2295
2304
|
*/
|
|
2296
2305
|
get upcomingIncomeTotal() {
|
|
2297
|
-
return this.currentMonthIncome.filter((t) => t.status ===
|
|
2306
|
+
return this.currentMonthIncome.filter((t) => t.status === S.Upcoming).reduce(A, 0);
|
|
2298
2307
|
}
|
|
2299
2308
|
/**
|
|
2300
2309
|
* Get the recurrences for the currently selected day.
|
|
2301
2310
|
*/
|
|
2302
2311
|
get selectedDayRecurrences() {
|
|
2303
2312
|
return this.selectedDay && this.recurrences.filter(
|
|
2304
|
-
(t) => this.selectedDay &&
|
|
2313
|
+
(t) => this.selectedDay && q(t.occurredOnDate || t.expectedDate, this.selectedDay)
|
|
2305
2314
|
);
|
|
2306
2315
|
}
|
|
2307
2316
|
get selectedRepeatingTransaction() {
|
|
@@ -2324,7 +2333,7 @@ class Me {
|
|
|
2324
2333
|
* @param day - The day to select.
|
|
2325
2334
|
*/
|
|
2326
2335
|
setSelectedDay = (t) => {
|
|
2327
|
-
this.selectedDay = this.selectedDay &&
|
|
2336
|
+
this.selectedDay = this.selectedDay && q(t, this.selectedDay) ? void 0 : t;
|
|
2328
2337
|
};
|
|
2329
2338
|
loadRepeatingTransactionData = async () => {
|
|
2330
2339
|
await Promise.all([
|
|
@@ -2341,7 +2350,7 @@ class Me {
|
|
|
2341
2350
|
const t = await this.api.getRepeatingTransactions();
|
|
2342
2351
|
this.setRepeatingTransactions(t);
|
|
2343
2352
|
} catch (t) {
|
|
2344
|
-
console.error(
|
|
2353
|
+
console.error("Error occurred while getting repeating transactions:", t), this.globalStore.captureException(t, { store: "RecurringTransactionsStore" });
|
|
2345
2354
|
}
|
|
2346
2355
|
};
|
|
2347
2356
|
/**
|
|
@@ -2358,7 +2367,7 @@ class Me {
|
|
|
2358
2367
|
}), c(() => {
|
|
2359
2368
|
this.repeatingTransactions = [
|
|
2360
2369
|
...this.repeatingTransactions,
|
|
2361
|
-
...
|
|
2370
|
+
...U(
|
|
2362
2371
|
this.globalStore.accountStore.visibleAccounts,
|
|
2363
2372
|
[s],
|
|
2364
2373
|
this.globalStore.transactionStore.transactions
|
|
@@ -2366,7 +2375,7 @@ class Me {
|
|
|
2366
2375
|
];
|
|
2367
2376
|
});
|
|
2368
2377
|
} catch (s) {
|
|
2369
|
-
console.error(
|
|
2378
|
+
console.error("Error occurred while adding repeating transaction:", s), this.globalStore.captureException(s, { store: "RecurringTransactionsStore" });
|
|
2370
2379
|
}
|
|
2371
2380
|
};
|
|
2372
2381
|
/**
|
|
@@ -2381,7 +2390,7 @@ class Me {
|
|
|
2381
2390
|
];
|
|
2382
2391
|
});
|
|
2383
2392
|
} catch (e) {
|
|
2384
|
-
console.error(
|
|
2393
|
+
console.error("Error occurred while deleting repeating transaction:", e), this.globalStore.captureException(e, { store: "RecurringTransactionsStore" });
|
|
2385
2394
|
}
|
|
2386
2395
|
};
|
|
2387
2396
|
/**
|
|
@@ -2397,7 +2406,7 @@ class Me {
|
|
|
2397
2406
|
c(() => {
|
|
2398
2407
|
this.repeatingTransactions = [
|
|
2399
2408
|
...this.repeatingTransactions.slice(0, s),
|
|
2400
|
-
...
|
|
2409
|
+
...U(
|
|
2401
2410
|
this.globalStore.accountStore.visibleAccounts,
|
|
2402
2411
|
[e],
|
|
2403
2412
|
this.globalStore.transactionStore.transactions
|
|
@@ -2406,7 +2415,7 @@ class Me {
|
|
|
2406
2415
|
];
|
|
2407
2416
|
});
|
|
2408
2417
|
} catch (e) {
|
|
2409
|
-
console.error(
|
|
2418
|
+
console.error("Error occurred while updating repeating transaction:", e), this.globalStore.captureException(e, { store: "RecurringTransactionsStore" });
|
|
2410
2419
|
}
|
|
2411
2420
|
};
|
|
2412
2421
|
/**
|
|
@@ -2421,7 +2430,7 @@ class Me {
|
|
|
2421
2430
|
repeating_transaction_guid: t
|
|
2422
2431
|
}), await this.loadRepeatingTransactions(), this.setSelectedRecurrence(null), this.setAlert(this.copy.link_transaction_success, "success");
|
|
2423
2432
|
} catch (s) {
|
|
2424
|
-
console.error(
|
|
2433
|
+
console.error("Error occurred while marking recurrence as paid:", s), this.globalStore.captureException(s, { store: "RecurringTransactionsStore" }), this.setAlert(this.copy.link_transaction_error, "error");
|
|
2425
2434
|
}
|
|
2426
2435
|
};
|
|
2427
2436
|
/**
|
|
@@ -2435,14 +2444,14 @@ class Me {
|
|
|
2435
2444
|
repeating_transaction_guid: null
|
|
2436
2445
|
}), await this.loadRepeatingTransactions(), this.setSelectedRecurrence(null), this.setAlert(this.copy.unlink_transaction_success, "success");
|
|
2437
2446
|
} catch (e) {
|
|
2438
|
-
console.error(
|
|
2447
|
+
console.error("Error occurred while marking recurrence as unpaid:", e), this.globalStore.captureException(e, { store: "RecurringTransactionsStore" }), this.setAlert(this.copy.unlink_transaction_error, "error");
|
|
2439
2448
|
}
|
|
2440
2449
|
};
|
|
2441
2450
|
setAlert = (t, e = void 0) => this.alert = { message: t, severity: e };
|
|
2442
2451
|
}
|
|
2443
|
-
const
|
|
2444
|
-
[
|
|
2445
|
-
[
|
|
2452
|
+
const ut = "PARENT-ENTITY", Pe = (r, t) => ({
|
|
2453
|
+
[B.BudgetExceeded]: t.notification_budget_exceeded,
|
|
2454
|
+
[B.BudgetOffTarget]: t.notification_budget_off_target,
|
|
2446
2455
|
[_.DebtPaymentReminder]: t.notification_debt_payment_reminder,
|
|
2447
2456
|
[_.AccountBalanceLow]: t.notification_low_balance,
|
|
2448
2457
|
[_.AccountDepositLargePosted]: t.notification_large_deposit,
|
|
@@ -2473,48 +2482,48 @@ const ht = "PARENT-ENTITY", Oe = (n, t) => ({
|
|
|
2473
2482
|
[u.TransactionExpenseLarge]: t.large_transaction,
|
|
2474
2483
|
[u.PromotionalCampaignMessages]: t.promotional_campaign_messages,
|
|
2475
2484
|
[u.TransparentOverdraft]: t.transparent_overdraft
|
|
2476
|
-
})[
|
|
2477
|
-
const
|
|
2485
|
+
})[r] || "", $e = (r, t, e, s, a, o) => {
|
|
2486
|
+
const i = [], {
|
|
2478
2487
|
email_notifications_enabled: l,
|
|
2479
|
-
sms_notifications_enabled:
|
|
2480
|
-
push_notifications_enabled:
|
|
2488
|
+
sms_notifications_enabled: g,
|
|
2489
|
+
push_notifications_enabled: y
|
|
2481
2490
|
} = t, {
|
|
2482
|
-
opted_out_of_email_notifications:
|
|
2483
|
-
opted_out_of_sms_notifications:
|
|
2484
|
-
opted_out_of_push_notifications:
|
|
2491
|
+
opted_out_of_email_notifications: R,
|
|
2492
|
+
opted_out_of_sms_notifications: St,
|
|
2493
|
+
opted_out_of_push_notifications: ft
|
|
2485
2494
|
} = a;
|
|
2486
|
-
for (const
|
|
2487
|
-
const
|
|
2488
|
-
(
|
|
2489
|
-
),
|
|
2490
|
-
l && !
|
|
2491
|
-
...
|
|
2492
|
-
children:
|
|
2493
|
-
...
|
|
2494
|
-
account:
|
|
2495
|
-
label:
|
|
2495
|
+
for (const E of s.filter((D) => D.entity_guid === ut)) {
|
|
2496
|
+
const D = Pe(E.notification_type, e), yt = s.filter(
|
|
2497
|
+
(I) => I.entity_guid !== ut && I.notification_type === E.notification_type && r.some((P) => P.guid === I.entity_guid)
|
|
2498
|
+
), x = [];
|
|
2499
|
+
l && !R && E.email_channel && o.email && x.push(e.delivery_method_email_label), g && !St && E.sms_channel && o.phone && x.push(e.delivery_method_sms_label), y && !ft && E.push_channel && x.push(e.delivery_method_push_label), i.push({
|
|
2500
|
+
...E,
|
|
2501
|
+
children: yt.map((I) => ({
|
|
2502
|
+
...I,
|
|
2503
|
+
account: r.find((P) => P.guid === I.entity_guid),
|
|
2504
|
+
label: D
|
|
2496
2505
|
})),
|
|
2497
|
-
deliveryMethodsLabel:
|
|
2498
|
-
label:
|
|
2506
|
+
deliveryMethodsLabel: x.join(", "),
|
|
2507
|
+
label: D
|
|
2499
2508
|
});
|
|
2500
2509
|
}
|
|
2501
|
-
return
|
|
2510
|
+
return i;
|
|
2502
2511
|
};
|
|
2503
2512
|
class Fe {
|
|
2504
2513
|
globalStore;
|
|
2505
|
-
api = new
|
|
2506
|
-
transactionApi = new
|
|
2514
|
+
api = new ot("/", "");
|
|
2515
|
+
transactionApi = new O("/", "");
|
|
2507
2516
|
alert = { message: "", severity: void 0 };
|
|
2508
2517
|
devices = [];
|
|
2509
2518
|
notificationProfiles = [];
|
|
2510
2519
|
selectedRule = void 0;
|
|
2511
2520
|
transactionRules = [];
|
|
2512
2521
|
constructor(t) {
|
|
2513
|
-
this.globalStore = t, this.api = new
|
|
2522
|
+
this.globalStore = t, this.api = new ot(t.endpoint, t.sessionToken, t.onError), this.transactionApi = new O(
|
|
2514
2523
|
t.endpoint,
|
|
2515
2524
|
t.sessionToken,
|
|
2516
2525
|
t.onError
|
|
2517
|
-
),
|
|
2526
|
+
), h(this);
|
|
2518
2527
|
}
|
|
2519
2528
|
get accountProfiles() {
|
|
2520
2529
|
const t = this.globalStore.appDataStore.clientCommunicationProfile;
|
|
@@ -2525,7 +2534,7 @@ class Fe {
|
|
|
2525
2534
|
get budgetProfiles() {
|
|
2526
2535
|
const t = this.globalStore.appDataStore.clientCommunicationProfile;
|
|
2527
2536
|
return this.detailedNotificationProfiles.filter(
|
|
2528
|
-
(e) => e.notification_type ===
|
|
2537
|
+
(e) => e.notification_type === B.BudgetExceeded && t.budget_exceeded_notifications_enabled || e.notification_type === B.BudgetOffTarget && t.budget_off_target_notifications_enabled
|
|
2529
2538
|
);
|
|
2530
2539
|
}
|
|
2531
2540
|
get insightsProfiles() {
|
|
@@ -2540,7 +2549,7 @@ class Fe {
|
|
|
2540
2549
|
return this.globalStore.copyStore.copy.settings;
|
|
2541
2550
|
}
|
|
2542
2551
|
get detailedNotificationProfiles() {
|
|
2543
|
-
return this.globalStore.isInitialized ?
|
|
2552
|
+
return this.globalStore.isInitialized ? $e(
|
|
2544
2553
|
this.globalStore.accountStore.accounts,
|
|
2545
2554
|
this.clientCommunicationProfile,
|
|
2546
2555
|
this.copy,
|
|
@@ -2559,22 +2568,23 @@ class Fe {
|
|
|
2559
2568
|
return e >= 0 && c(() => {
|
|
2560
2569
|
this.devices.splice(e, 1);
|
|
2561
2570
|
}), { success: !0 };
|
|
2562
|
-
} catch {
|
|
2563
|
-
return console.error(
|
|
2571
|
+
} catch (e) {
|
|
2572
|
+
return console.error("Error deleting device:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), { success: !1 };
|
|
2564
2573
|
}
|
|
2565
2574
|
};
|
|
2566
2575
|
deleteTransactionRule = async () => {
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2576
|
+
if (this.selectedRule)
|
|
2577
|
+
try {
|
|
2578
|
+
await this.transactionApi.removeTransactionRule(this.selectedRule?.guid), this.setAlert(this.copy.delete_rule_success, "success"), await this.loadTransactionRules();
|
|
2579
|
+
} catch (t) {
|
|
2580
|
+
console.error("Error deleting transaction rule:", t), this.globalStore.captureException(t, { store: "SettingsStore" }), this.setAlert(this.copy.delete_rule_error, "error");
|
|
2581
|
+
}
|
|
2572
2582
|
};
|
|
2573
2583
|
generateDeviceToken = async () => {
|
|
2574
2584
|
try {
|
|
2575
2585
|
return await this.api.generateDeviceToken();
|
|
2576
2586
|
} catch (t) {
|
|
2577
|
-
console.error(
|
|
2587
|
+
console.error("Error generating device token:", t), this.globalStore.captureException(t, { store: "SettingsStore" });
|
|
2578
2588
|
}
|
|
2579
2589
|
};
|
|
2580
2590
|
loadDevices = async () => {
|
|
@@ -2584,7 +2594,7 @@ class Fe {
|
|
|
2584
2594
|
this.devices = t;
|
|
2585
2595
|
});
|
|
2586
2596
|
} catch (t) {
|
|
2587
|
-
console.error(
|
|
2597
|
+
console.error("Error loading devices:", t), this.globalStore.captureException(t, { store: "SettingsStore" });
|
|
2588
2598
|
}
|
|
2589
2599
|
};
|
|
2590
2600
|
loadNotificationProfiles = async () => {
|
|
@@ -2594,7 +2604,7 @@ class Fe {
|
|
|
2594
2604
|
this.notificationProfiles = t;
|
|
2595
2605
|
});
|
|
2596
2606
|
} catch (t) {
|
|
2597
|
-
console.error(
|
|
2607
|
+
console.error("Error loading notification profiles:", t), this.globalStore.captureException(t, { store: "SettingsStore" });
|
|
2598
2608
|
}
|
|
2599
2609
|
};
|
|
2600
2610
|
loadTransactionRules = async () => {
|
|
@@ -2604,21 +2614,21 @@ class Fe {
|
|
|
2604
2614
|
this.transactionRules = t;
|
|
2605
2615
|
});
|
|
2606
2616
|
} catch (t) {
|
|
2607
|
-
console.error(
|
|
2617
|
+
console.error("Error loading transaction rules:", t), this.globalStore.captureException(t, { store: "SettingsStore" });
|
|
2608
2618
|
}
|
|
2609
2619
|
};
|
|
2610
2620
|
sendEmailVerification = async () => {
|
|
2611
2621
|
try {
|
|
2612
2622
|
await this.api.sendEmailVerification(), this.setAlert(this.copy.verification_sent_success, "success");
|
|
2613
2623
|
} catch (t) {
|
|
2614
|
-
console.error(
|
|
2624
|
+
console.error("Error sending email verification:", t), this.globalStore.captureException(t, { store: "SettingsStore" }), this.setAlert(this.copy.verification_sent_error, "error");
|
|
2615
2625
|
}
|
|
2616
2626
|
};
|
|
2617
2627
|
sendPhoneVerification = async () => {
|
|
2618
2628
|
try {
|
|
2619
2629
|
await this.api.sendPhoneVerification(), this.setAlert(this.copy.verification_sent_success, "success");
|
|
2620
2630
|
} catch (t) {
|
|
2621
|
-
console.error(
|
|
2631
|
+
console.error("Error sending phone verification:", t), this.globalStore.captureException(t, { store: "SettingsStore" }), this.setAlert(this.copy.verification_sent_error, "error");
|
|
2622
2632
|
}
|
|
2623
2633
|
};
|
|
2624
2634
|
setAlert = (t, e = void 0) => this.alert = { message: t, severity: e };
|
|
@@ -2632,7 +2642,7 @@ class Fe {
|
|
|
2632
2642
|
this.devices[s] = e;
|
|
2633
2643
|
}), { success: !0 };
|
|
2634
2644
|
} catch (e) {
|
|
2635
|
-
return console.error(
|
|
2645
|
+
return console.error("Error updating device:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), { success: !1 };
|
|
2636
2646
|
}
|
|
2637
2647
|
};
|
|
2638
2648
|
updateNotificationProfile = async (t) => {
|
|
@@ -2642,34 +2652,36 @@ class Fe {
|
|
|
2642
2652
|
this.notificationProfiles[s] = e;
|
|
2643
2653
|
});
|
|
2644
2654
|
} catch (e) {
|
|
2645
|
-
console.error(
|
|
2655
|
+
console.error("Error updating notification profile:", e), this.globalStore.captureException(e, { store: "SettingsStore" });
|
|
2646
2656
|
}
|
|
2647
2657
|
};
|
|
2648
2658
|
updateRuleCategory = async (t) => {
|
|
2649
|
-
|
|
2650
|
-
this.loadTransactionRules();
|
|
2651
|
-
})
|
|
2659
|
+
try {
|
|
2660
|
+
await this.transactionApi.updateTransactionRule(t), await this.loadTransactionRules();
|
|
2661
|
+
} catch (e) {
|
|
2662
|
+
console.error("Error updating rule category:", e), this.globalStore.captureException(e, { store: "SettingsStore" });
|
|
2663
|
+
}
|
|
2652
2664
|
};
|
|
2653
2665
|
updateRulePayee = async (t) => {
|
|
2654
|
-
|
|
2655
|
-
this.setAlert(this.copy.edit_payee_success, "success"), this.loadTransactionRules();
|
|
2656
|
-
}
|
|
2657
|
-
this.setAlert(this.copy.edit_payee_error, "error");
|
|
2658
|
-
}
|
|
2666
|
+
try {
|
|
2667
|
+
await this.transactionApi.updateTransactionRule(t), this.setAlert(this.copy.edit_payee_success, "success"), await this.loadTransactionRules();
|
|
2668
|
+
} catch (e) {
|
|
2669
|
+
console.error("Error updating rule payee:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), this.setAlert(this.copy.edit_payee_error, "error");
|
|
2670
|
+
}
|
|
2659
2671
|
};
|
|
2660
2672
|
updateUser = async (t) => {
|
|
2661
|
-
|
|
2662
|
-
this.setAlert(this.copy.information_updated_success, "success");
|
|
2663
|
-
}
|
|
2673
|
+
try {
|
|
2674
|
+
await this.globalStore.userStore.updateUser(t), this.setAlert(this.copy.information_updated_success, "success");
|
|
2675
|
+
} catch {
|
|
2664
2676
|
this.setAlert(this.copy.information_updated_error, "error");
|
|
2665
|
-
}
|
|
2677
|
+
}
|
|
2666
2678
|
};
|
|
2667
2679
|
updateUserCommunicationProfile = async (t) => {
|
|
2668
2680
|
try {
|
|
2669
2681
|
const e = await this.api.updateUserCommunicationProfile(t);
|
|
2670
2682
|
this.globalStore.appDataStore.setUserCommunicationProfile(e);
|
|
2671
2683
|
} catch (e) {
|
|
2672
|
-
console.error(
|
|
2684
|
+
console.error("Error occurred while updating user communication profile:", e), this.globalStore.captureException(e, { store: "SettingsStore" });
|
|
2673
2685
|
}
|
|
2674
2686
|
};
|
|
2675
2687
|
verifyPhoneToken = async (t) => {
|
|
@@ -2679,15 +2691,15 @@ class Fe {
|
|
|
2679
2691
|
throw new Error();
|
|
2680
2692
|
this.setAlert(this.copy.verified_phone_success, "success");
|
|
2681
2693
|
} catch (e) {
|
|
2682
|
-
console.error(
|
|
2694
|
+
console.error("Error verifying phone token:", e), this.globalStore.captureException(e, { store: "SettingsStore" }), this.setAlert(this.copy.verified_phone_error, "error");
|
|
2683
2695
|
}
|
|
2684
2696
|
};
|
|
2685
2697
|
}
|
|
2686
2698
|
class Ue {
|
|
2687
2699
|
globalStore;
|
|
2688
2700
|
uiStore;
|
|
2689
|
-
api = new
|
|
2690
|
-
beatApi = new
|
|
2701
|
+
api = new O("/", "");
|
|
2702
|
+
beatApi = new G("/", "");
|
|
2691
2703
|
associatedBeats = [];
|
|
2692
2704
|
associatedBeatsLoaded = !1;
|
|
2693
2705
|
associatedBeatsLoading = !1;
|
|
@@ -2704,22 +2716,22 @@ class Ue {
|
|
|
2704
2716
|
transactionRulesLoaded = !1;
|
|
2705
2717
|
transactionRulesLoading = !1;
|
|
2706
2718
|
transactionSplitting = !1;
|
|
2707
|
-
cachedStartDate =
|
|
2719
|
+
cachedStartDate = _t(f(), 90);
|
|
2708
2720
|
filter = {};
|
|
2709
2721
|
isLoading = !0;
|
|
2710
2722
|
alert = "";
|
|
2711
2723
|
sortColumn = Gt.DATE;
|
|
2712
2724
|
sortDirection = Nt.DESC;
|
|
2713
2725
|
constructor(t) {
|
|
2714
|
-
this.globalStore = t, this.uiStore = new ke(), this.api = new
|
|
2726
|
+
this.globalStore = t, this.uiStore = new ke(), this.api = new O(
|
|
2715
2727
|
t.endpoint,
|
|
2716
2728
|
t.sessionToken,
|
|
2717
2729
|
t.onError
|
|
2718
|
-
), this.beatApi = new
|
|
2730
|
+
), this.beatApi = new G(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
2719
2731
|
}
|
|
2720
2732
|
loadTransactionData = async () => {
|
|
2721
2733
|
this.globalStore.accountStore.isAccountDataLoaded || await this.globalStore.accountStore.loadAccountData(), this.globalStore.categoryStore.categoriesLoaded || await this.globalStore.categoryStore.loadCategories(), await Promise.all([
|
|
2722
|
-
this.loadAssociatedBeats(
|
|
2734
|
+
this.loadAssociatedBeats(C(/* @__PURE__ */ new Date())),
|
|
2723
2735
|
this.loadTags(),
|
|
2724
2736
|
this.loadTaggings(),
|
|
2725
2737
|
this.loadTransactionRules(),
|
|
@@ -2739,7 +2751,7 @@ class Ue {
|
|
|
2739
2751
|
) : [];
|
|
2740
2752
|
}
|
|
2741
2753
|
get sortedTransactions() {
|
|
2742
|
-
return
|
|
2754
|
+
return Mt(
|
|
2743
2755
|
this.filter,
|
|
2744
2756
|
this.uiStore.expandedSplits,
|
|
2745
2757
|
this.sortColumn,
|
|
@@ -2749,7 +2761,7 @@ class Ue {
|
|
|
2749
2761
|
);
|
|
2750
2762
|
}
|
|
2751
2763
|
get sortedTransactionsWithSplits() {
|
|
2752
|
-
return
|
|
2764
|
+
return Ot(this.sortedTransactions, this.detailedTransactions);
|
|
2753
2765
|
}
|
|
2754
2766
|
setAssociatedBeats = (t) => {
|
|
2755
2767
|
this.associatedBeats = t, this.associatedBeatsLoading = !1, this.associatedBeatsLoaded = !0;
|
|
@@ -2770,34 +2782,53 @@ class Ue {
|
|
|
2770
2782
|
this.alert = t;
|
|
2771
2783
|
};
|
|
2772
2784
|
addTag = async (t) => {
|
|
2773
|
-
|
|
2785
|
+
try {
|
|
2786
|
+
await this.api.addTag({ name: t }), await this.loadTags();
|
|
2787
|
+
} catch (e) {
|
|
2788
|
+
console.error("Error occurred while adding tag:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2789
|
+
}
|
|
2774
2790
|
};
|
|
2775
2791
|
addTagging = async (t, e) => {
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2792
|
+
try {
|
|
2793
|
+
await this.api.addTagging({
|
|
2794
|
+
tag_guid: t,
|
|
2795
|
+
transaction_guid: e
|
|
2796
|
+
});
|
|
2797
|
+
} catch (s) {
|
|
2798
|
+
console.error("Error occurred while adding tagging:", s), this.globalStore.captureException(s, { store: "TransactionStore" });
|
|
2799
|
+
}
|
|
2780
2800
|
};
|
|
2781
2801
|
addOrUpdateTransactionRule = async (t, e) => {
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2802
|
+
try {
|
|
2803
|
+
const s = this.transactionRules.find(
|
|
2804
|
+
(a) => a.guid === e.user_transaction_rule_guid
|
|
2805
|
+
);
|
|
2806
|
+
s ? await this.api.updateTransactionRule({
|
|
2807
|
+
...s,
|
|
2808
|
+
category_guid: t,
|
|
2809
|
+
description: e.description
|
|
2810
|
+
}) : await this.api.addTransactionRule({
|
|
2811
|
+
category_guid: t,
|
|
2812
|
+
description: e.description,
|
|
2813
|
+
match_description: e.description
|
|
2814
|
+
}), await this.loadTransactionRules();
|
|
2815
|
+
} catch (s) {
|
|
2816
|
+
console.error("Error occurred while adding/updating transaction rule:", s), this.globalStore.captureException(s, { store: "TransactionStore" });
|
|
2817
|
+
}
|
|
2794
2818
|
};
|
|
2795
2819
|
addTransaction = async (t) => {
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2820
|
+
try {
|
|
2821
|
+
const e = await this.api.addTransaction(t);
|
|
2822
|
+
if (e) {
|
|
2823
|
+
this.setTransactions([e, ...this.transactions]);
|
|
2824
|
+
const s = e.transaction_type === Pt.CREDIT ? e.amount : -e.amount;
|
|
2825
|
+
this.globalStore.accountStore.updateAccountBalance(
|
|
2826
|
+
e.account_guid,
|
|
2827
|
+
s
|
|
2828
|
+
);
|
|
2829
|
+
}
|
|
2830
|
+
} catch (e) {
|
|
2831
|
+
console.error("Error occurred while adding transaction:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2801
2832
|
}
|
|
2802
2833
|
};
|
|
2803
2834
|
loadAssociatedBeats = async (t) => {
|
|
@@ -2808,7 +2839,7 @@ class Ue {
|
|
|
2808
2839
|
const s = await this.beatApi.getBeatsWithAssociatedTransaction(e);
|
|
2809
2840
|
this.setAssociatedBeats(s);
|
|
2810
2841
|
} catch (s) {
|
|
2811
|
-
console.error(
|
|
2842
|
+
console.error("Error occurred while loading associated beats:", s), this.globalStore.captureException(s, { store: "TransactionStore" }), this.setAssociatedBeats([]);
|
|
2812
2843
|
} finally {
|
|
2813
2844
|
c(() => {
|
|
2814
2845
|
this.associatedBeatsLoading = !1;
|
|
@@ -2822,7 +2853,7 @@ class Ue {
|
|
|
2822
2853
|
const t = await this.api.getTags();
|
|
2823
2854
|
this.setTags(t);
|
|
2824
2855
|
} catch (t) {
|
|
2825
|
-
console.error(
|
|
2856
|
+
console.error("Error occurred while loading tags:", t), this.globalStore.captureException(t, { store: "TransactionStore" });
|
|
2826
2857
|
} finally {
|
|
2827
2858
|
c(() => {
|
|
2828
2859
|
this.tagsLoading = !1;
|
|
@@ -2837,7 +2868,7 @@ class Ue {
|
|
|
2837
2868
|
const t = await this.api.getTaggings();
|
|
2838
2869
|
this.setTaggings(t);
|
|
2839
2870
|
} catch (t) {
|
|
2840
|
-
console.error(
|
|
2871
|
+
console.error("Error occurred while loading taggings:", t), this.globalStore.captureException(t, { store: "TransactionStore" }), this.setTaggings([]);
|
|
2841
2872
|
} finally {
|
|
2842
2873
|
c(() => {
|
|
2843
2874
|
this.taggingsLoading = !1;
|
|
@@ -2852,7 +2883,7 @@ class Ue {
|
|
|
2852
2883
|
const t = await this.api.getTransactionRules();
|
|
2853
2884
|
this.setTransactionRules(t);
|
|
2854
2885
|
} catch (t) {
|
|
2855
|
-
console.error(
|
|
2886
|
+
console.error("Error occurred while loading transaction rules:", t), this.globalStore.captureException(t, { store: "TransactionStore" }), this.setTransactionRules([]);
|
|
2856
2887
|
} finally {
|
|
2857
2888
|
c(() => {
|
|
2858
2889
|
this.transactionRulesLoading = !1;
|
|
@@ -2866,13 +2897,13 @@ class Ue {
|
|
|
2866
2897
|
try {
|
|
2867
2898
|
const e = await this.api.getTransactionsByDateRange(
|
|
2868
2899
|
m(t),
|
|
2869
|
-
m(
|
|
2900
|
+
m(Y())
|
|
2870
2901
|
);
|
|
2871
2902
|
this.setTransactions(e), c(() => {
|
|
2872
2903
|
this.cachedStartDate = t;
|
|
2873
2904
|
});
|
|
2874
2905
|
} catch (e) {
|
|
2875
|
-
console.error(
|
|
2906
|
+
console.error("Error occurred while loading transactions:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2876
2907
|
} finally {
|
|
2877
2908
|
c(() => {
|
|
2878
2909
|
this.transactionsLoading = !1;
|
|
@@ -2886,21 +2917,33 @@ class Ue {
|
|
|
2886
2917
|
);
|
|
2887
2918
|
};
|
|
2888
2919
|
removeTag = async (t) => {
|
|
2889
|
-
|
|
2920
|
+
try {
|
|
2921
|
+
await this.api.removeTag(t), await this.loadTags();
|
|
2922
|
+
} catch (e) {
|
|
2923
|
+
console.error("Error occurred while removing tag:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2924
|
+
}
|
|
2890
2925
|
};
|
|
2891
2926
|
removeTagging = async (t) => {
|
|
2892
|
-
|
|
2927
|
+
try {
|
|
2928
|
+
await this.api.removeTagging(t);
|
|
2929
|
+
} catch (e) {
|
|
2930
|
+
console.error("Error occurred while removing tagging:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2931
|
+
}
|
|
2893
2932
|
};
|
|
2894
2933
|
removeTransaction = async (t) => {
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2934
|
+
try {
|
|
2935
|
+
await this.api.removeTransaction(t);
|
|
2936
|
+
const e = this.transactions.findIndex((s) => s.guid === t);
|
|
2937
|
+
if (e >= 0) {
|
|
2938
|
+
const s = [...this.transactions];
|
|
2939
|
+
s.splice(e, 1), this.setTransactions(s);
|
|
2940
|
+
}
|
|
2941
|
+
} catch (e) {
|
|
2942
|
+
console.error("Error occurred while removing transaction:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2900
2943
|
}
|
|
2901
2944
|
};
|
|
2902
2945
|
setFilter = (t) => {
|
|
2903
|
-
this.filter = t, t.dateRange &&
|
|
2946
|
+
this.filter = t, t.dateRange && W(t.dateRange.start, this.cachedStartDate) && this.loadTransactions(t.dateRange.start);
|
|
2904
2947
|
};
|
|
2905
2948
|
setIsLoading = (t) => this.isLoading = t;
|
|
2906
2949
|
splitTransaction = async (t, e) => {
|
|
@@ -2908,88 +2951,109 @@ class Ue {
|
|
|
2908
2951
|
this.transactionSplitting = !0;
|
|
2909
2952
|
try {
|
|
2910
2953
|
const s = await this.api.updateTransaction(t), a = [];
|
|
2911
|
-
for (let
|
|
2912
|
-
const l = await this.api.addTransaction(e[
|
|
2954
|
+
for (let i = 0; i < e.length; i++) {
|
|
2955
|
+
const l = await this.api.addTransaction(e[i]);
|
|
2913
2956
|
a.push(l);
|
|
2914
2957
|
}
|
|
2915
|
-
const o = this.transactions.findIndex((
|
|
2958
|
+
const o = this.transactions.findIndex((i) => i.guid === t.guid);
|
|
2916
2959
|
if (o >= 0) {
|
|
2917
|
-
const
|
|
2960
|
+
const i = this.transactions.filter(
|
|
2918
2961
|
(l) => l.guid !== t.guid && l.parent_guid !== t.guid
|
|
2919
2962
|
);
|
|
2920
2963
|
this.setTransactions([
|
|
2921
|
-
...
|
|
2964
|
+
...i.slice(0, o),
|
|
2922
2965
|
s,
|
|
2923
2966
|
...a,
|
|
2924
|
-
...
|
|
2967
|
+
...i.slice(o)
|
|
2925
2968
|
]);
|
|
2926
2969
|
}
|
|
2970
|
+
} catch (s) {
|
|
2971
|
+
throw console.error("Error occurred while splitting transaction:", s), this.globalStore.captureException(s, { store: "TransactionStore" }), s;
|
|
2927
2972
|
} finally {
|
|
2928
2973
|
this.transactionSplitting = !1;
|
|
2929
2974
|
}
|
|
2930
2975
|
}
|
|
2931
2976
|
};
|
|
2932
2977
|
unSplitTransaction = async (t) => {
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2978
|
+
try {
|
|
2979
|
+
const e = this.transactions.filter((o) => o.parent_guid === t);
|
|
2980
|
+
await this.api.removeTransactionSplit(t);
|
|
2981
|
+
const s = [...this.transactions];
|
|
2982
|
+
e.forEach((o) => {
|
|
2983
|
+
const i = s.findIndex((l) => l.guid === o.guid);
|
|
2984
|
+
i >= 0 && s.splice(i, 1);
|
|
2985
|
+
});
|
|
2986
|
+
const a = s.findIndex((o) => o.guid === t);
|
|
2987
|
+
c(() => {
|
|
2988
|
+
const o = s[a];
|
|
2989
|
+
o && (o.has_been_split = !1), a >= 0 && this.setTransactions([
|
|
2990
|
+
...s.slice(0, a),
|
|
2991
|
+
o,
|
|
2992
|
+
...s.slice(a + 1)
|
|
2993
|
+
]);
|
|
2994
|
+
});
|
|
2995
|
+
} catch (e) {
|
|
2996
|
+
console.error("Error occurred while unsplitting transaction:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2997
|
+
}
|
|
2946
2998
|
};
|
|
2947
2999
|
updateTaggings = async (t, e) => {
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
3000
|
+
try {
|
|
3001
|
+
const s = this.taggings.filter((i) => i.transaction_guid === e), a = new Set(s.map((i) => i.tag_guid)), o = new Set(t);
|
|
3002
|
+
for (const i of t)
|
|
3003
|
+
a.has(i) || await this.addTagging(i, e);
|
|
3004
|
+
for (const i of s)
|
|
3005
|
+
o.has(i.tag_guid) || await this.removeTagging(i.guid);
|
|
3006
|
+
await this.loadTaggings();
|
|
3007
|
+
} catch (s) {
|
|
3008
|
+
console.error("Error occurred while updating taggings:", s), this.globalStore.captureException(s, { store: "TransactionStore" });
|
|
3009
|
+
}
|
|
2954
3010
|
};
|
|
2955
3011
|
updateTag = async (t) => {
|
|
2956
|
-
|
|
3012
|
+
try {
|
|
3013
|
+
await this.api.updateTag(t), await this.loadTags();
|
|
3014
|
+
} catch (e) {
|
|
3015
|
+
console.error("Error occurred while updating tag:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
3016
|
+
}
|
|
2957
3017
|
};
|
|
2958
3018
|
updateTransaction = async (t) => {
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
3019
|
+
try {
|
|
3020
|
+
const e = await this.api.updateTransaction(t), s = this.transactions.findIndex((a) => a.guid === t.guid);
|
|
3021
|
+
s >= 0 && this.setTransactions([
|
|
3022
|
+
...this.transactions.slice(0, s),
|
|
3023
|
+
e,
|
|
3024
|
+
...this.transactions.slice(s + 1)
|
|
3025
|
+
]);
|
|
3026
|
+
} catch (e) {
|
|
3027
|
+
console.error("Error occurred while updating transaction:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
3028
|
+
}
|
|
2965
3029
|
};
|
|
2966
3030
|
// This is used for loading the transactions list on demand, on clicking the different transactions of the insightful beats.
|
|
2967
3031
|
loadEmbeddedInstanceTransactions = async (t) => {
|
|
2968
3032
|
try {
|
|
2969
3033
|
const e = await this.api.getTransactionsByDateRange(
|
|
2970
3034
|
m(t),
|
|
2971
|
-
m(
|
|
3035
|
+
m(Y())
|
|
2972
3036
|
);
|
|
2973
3037
|
this.cachedStartDate = t, this.transactions = e;
|
|
2974
3038
|
} catch (e) {
|
|
2975
|
-
console.error(
|
|
3039
|
+
console.error("Error occurred while loading embedded instance transactions:", e), this.globalStore.captureException(e, { store: "TransactionStore" });
|
|
2976
3040
|
}
|
|
2977
3041
|
};
|
|
2978
3042
|
}
|
|
2979
3043
|
class ke {
|
|
2980
|
-
beginDate =
|
|
2981
|
-
endDate =
|
|
3044
|
+
beginDate = C(/* @__PURE__ */ new Date());
|
|
3045
|
+
endDate = b(/* @__PURE__ */ new Date());
|
|
2982
3046
|
expandedSplits = [];
|
|
2983
3047
|
height = 550;
|
|
2984
3048
|
width = 1e3;
|
|
2985
3049
|
shouldDisableDrawerScroll = !1;
|
|
2986
3050
|
searchValue = "";
|
|
2987
3051
|
selectedAccountGuids = [];
|
|
2988
|
-
manualTransaction =
|
|
3052
|
+
manualTransaction = $t;
|
|
2989
3053
|
isAmountValid = !1;
|
|
2990
3054
|
showInsights = !1;
|
|
2991
3055
|
constructor() {
|
|
2992
|
-
|
|
3056
|
+
h(this);
|
|
2993
3057
|
}
|
|
2994
3058
|
setDateRange = (t, e) => {
|
|
2995
3059
|
this.beginDate = t, this.endDate = e;
|
|
@@ -3022,9 +3086,9 @@ class He {
|
|
|
3022
3086
|
visibleListLength = 5;
|
|
3023
3087
|
constructor(t) {
|
|
3024
3088
|
this.globalStore = t, this.selectedDateRange = {
|
|
3025
|
-
start: se(
|
|
3026
|
-
end:
|
|
3027
|
-
},
|
|
3089
|
+
start: se(b(N(/* @__PURE__ */ new Date(), 6)), 1),
|
|
3090
|
+
end: b(/* @__PURE__ */ new Date())
|
|
3091
|
+
}, h(this);
|
|
3028
3092
|
}
|
|
3029
3093
|
setSelectedCategoryData = (t) => {
|
|
3030
3094
|
this.selectedCategoryData = t;
|
|
@@ -3036,7 +3100,7 @@ class He {
|
|
|
3036
3100
|
this.visibleListLength = t;
|
|
3037
3101
|
};
|
|
3038
3102
|
get sortedDetailedCategoriesWithTransactions() {
|
|
3039
|
-
return
|
|
3103
|
+
return re(
|
|
3040
3104
|
this.globalStore.categoryStore.detailedCategoriesWithTransactions
|
|
3041
3105
|
);
|
|
3042
3106
|
}
|
|
@@ -3044,7 +3108,7 @@ class He {
|
|
|
3044
3108
|
return ae(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
|
|
3045
3109
|
}
|
|
3046
3110
|
get selectedDateRangeMonthRange() {
|
|
3047
|
-
const t =
|
|
3111
|
+
const t = k(this.selectedDateRange.start, H.MONTH_LONG), e = k(this.selectedDateRange.end, H.MONTH_LONG);
|
|
3048
3112
|
return `${t} - ${e}`;
|
|
3049
3113
|
}
|
|
3050
3114
|
get visibleCategories() {
|
|
@@ -3054,7 +3118,7 @@ class He {
|
|
|
3054
3118
|
return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
|
|
3055
3119
|
}
|
|
3056
3120
|
get categoryDetailsChartData() {
|
|
3057
|
-
return
|
|
3121
|
+
return ne(
|
|
3058
3122
|
this.selectedCategoryData,
|
|
3059
3123
|
this.selectedDateRangeMonthCount
|
|
3060
3124
|
);
|
|
@@ -3062,11 +3126,11 @@ class He {
|
|
|
3062
3126
|
}
|
|
3063
3127
|
class We {
|
|
3064
3128
|
globalStore;
|
|
3065
|
-
api = new
|
|
3129
|
+
api = new ct("/", "");
|
|
3066
3130
|
userFeatures = [];
|
|
3067
3131
|
userFeaturesLoaded = !1;
|
|
3068
3132
|
constructor(t) {
|
|
3069
|
-
this.globalStore = t, this.api = new
|
|
3133
|
+
this.globalStore = t, this.api = new ct(t.endpoint, t.sessionToken, t.onError), h(this);
|
|
3070
3134
|
}
|
|
3071
3135
|
get userProfile() {
|
|
3072
3136
|
return this.globalStore.appDataStore.userProfile;
|
|
@@ -3082,7 +3146,7 @@ class We {
|
|
|
3082
3146
|
const t = await this.api.getUserFeatures();
|
|
3083
3147
|
this.setUserFeatures(t);
|
|
3084
3148
|
} catch (t) {
|
|
3085
|
-
console.error(
|
|
3149
|
+
console.error("Error occurred while loading user features:", t), this.globalStore.captureException(t, { store: "UserStore" }), this.setUserFeatures([]);
|
|
3086
3150
|
}
|
|
3087
3151
|
};
|
|
3088
3152
|
updateUser = async (t) => {
|
|
@@ -3090,7 +3154,7 @@ class We {
|
|
|
3090
3154
|
const e = await this.api.updateUser(t);
|
|
3091
3155
|
this.globalStore.appDataStore.setUser(e);
|
|
3092
3156
|
} catch (e) {
|
|
3093
|
-
console.error(
|
|
3157
|
+
throw console.error("Error updating User:", e), this.globalStore.captureException(e, { store: "UserStore" }), e;
|
|
3094
3158
|
}
|
|
3095
3159
|
};
|
|
3096
3160
|
updateUserProfile = async (t) => {
|
|
@@ -3098,50 +3162,50 @@ class We {
|
|
|
3098
3162
|
const e = await this.api.updateUserProfile(t);
|
|
3099
3163
|
this.globalStore.appDataStore.setUserProfile(e);
|
|
3100
3164
|
} catch (e) {
|
|
3101
|
-
console.error(
|
|
3165
|
+
console.error("Error occurred while updating user profile:", e), this.globalStore.captureException(e, { store: "UserStore" });
|
|
3102
3166
|
}
|
|
3103
3167
|
};
|
|
3104
3168
|
}
|
|
3105
3169
|
export {
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3170
|
+
M as A,
|
|
3171
|
+
X as B,
|
|
3172
|
+
Se as C,
|
|
3173
|
+
be as D,
|
|
3174
|
+
tt as F,
|
|
3111
3175
|
Re as G,
|
|
3112
|
-
|
|
3113
|
-
|
|
3176
|
+
st as H,
|
|
3177
|
+
rt as M,
|
|
3114
3178
|
Be as N,
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3179
|
+
Oe as R,
|
|
3180
|
+
ot as S,
|
|
3181
|
+
O as T,
|
|
3182
|
+
ct as U,
|
|
3183
|
+
lt as W,
|
|
3120
3184
|
ce as a,
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3185
|
+
de as b,
|
|
3186
|
+
j as c,
|
|
3187
|
+
he as d,
|
|
3124
3188
|
pe as e,
|
|
3125
|
-
|
|
3189
|
+
J as f,
|
|
3126
3190
|
_e as g,
|
|
3127
|
-
|
|
3128
|
-
|
|
3191
|
+
Z as h,
|
|
3192
|
+
ye as i,
|
|
3129
3193
|
Te as j,
|
|
3130
|
-
|
|
3194
|
+
Ie as k,
|
|
3131
3195
|
Ns as l,
|
|
3132
|
-
|
|
3133
|
-
|
|
3196
|
+
Ce as m,
|
|
3197
|
+
et as n,
|
|
3134
3198
|
De as o,
|
|
3135
|
-
|
|
3136
|
-
|
|
3199
|
+
ve as p,
|
|
3200
|
+
at as q,
|
|
3137
3201
|
Ge as r,
|
|
3138
3202
|
Ne as s,
|
|
3139
3203
|
nt as t,
|
|
3140
|
-
|
|
3204
|
+
Me as u,
|
|
3141
3205
|
it as v,
|
|
3142
3206
|
Fe as w,
|
|
3143
3207
|
Ue as x,
|
|
3144
3208
|
He as y,
|
|
3145
3209
|
We as z
|
|
3146
3210
|
};
|
|
3147
|
-
//# sourceMappingURL=UserStore-
|
|
3211
|
+
//# sourceMappingURL=UserStore-BBceqFxh.mjs.map
|