@mx-cartographer/experiences 7.7.2 → 7.8.0-alpha-ram-goal-bug
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/Account-BiB1F8lL.mjs +118 -0
- package/dist/{Account-BfkKlfsW.mjs → Account-DuOz1a27.mjs} +1 -1
- package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
- package/dist/{AccountDetailsHeader-DqYIuhOs.mjs → AccountDetailsHeader-Cf2TUJnM.mjs} +4 -4
- package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
- package/dist/{AccountFields-yP8QdgPd.mjs → AccountFields-UdOvbQ5H.mjs} +7 -6
- package/dist/{AccountListItem-DMbu9ehd.mjs → AccountListItem-BPVxmNT_.mjs} +7 -7
- package/dist/AccountStore-BbPWe2C9.mjs +244 -0
- package/dist/Accounts-M-LTzStv.mjs +27 -0
- package/dist/{CategoryStore-Cnw9yUys.mjs → CategoryStore-BYICdb9m.mjs} +73 -73
- package/dist/CategoryUtil-meuejJqP.mjs +80 -0
- package/dist/{ConnectionsDrawer-BqR6FWJO.mjs → ConnectionsDrawer-BDpVTTSe.mjs} +1 -1
- package/dist/{DebtsStore-DuSdXM1k.mjs → DebtsStore-BIbOVCPe.mjs} +12 -12
- package/dist/{ExportCsvAction-HK5CeZWR.mjs → ExportCsvAction-CDuzTva1.mjs} +2 -2
- package/dist/GlobalAccountFilter-DQCPNc95.mjs +316 -0
- package/dist/GoalStore-B4LVt_kH.mjs +422 -0
- package/dist/{ManageIncome-BrTrlplL.mjs → ManageIncome-CL3hv8i9.mjs} +44 -44
- package/dist/NetWorthStore-yV43kJro.mjs +168 -0
- package/dist/{NotificationSettings-D4Vh3z8I.mjs → NotificationSettings-SPg3pwbX.mjs} +171 -169
- package/dist/{NotificationStore-CDX_kqHa.mjs → NotificationStore-Ck2KdNmT.mjs} +22 -14
- package/dist/{RecurringSettings-D2V6l77l.mjs → RecurringSettings-Bmnnpb48.mjs} +16 -16
- package/dist/{RecurringTransactionsStore-Caf1cq4v.mjs → RecurringTransactionsStore-BQBEJOPP.mjs} +91 -81
- package/dist/{RecurringTransactions-Bf4lX0Cn.mjs → RepeatingTransaction-miZVnk_A.mjs} +4 -4
- package/dist/{SettingsStore-krIRNwHK.mjs → SettingsStore-BHpuyujx.mjs} +1 -1
- package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
- package/dist/{SpendingLegend-gTCJLLkV.mjs → SpendingLegend-CD60HCYS.mjs} +33 -33
- package/dist/{TransactionDetails-7MHOshKQ.mjs → TransactionDetails-BDhz3DLT.mjs} +2 -2
- package/dist/TransactionStore-BSp5bOKg.mjs +705 -0
- package/dist/{User-LJpEwPtn.mjs → User-B0LnmiKO.mjs} +21 -20
- package/dist/WidgetContainer-BbPS3Yxz.mjs +555 -0
- package/dist/accounts/index.es.js +421 -391
- package/dist/accounts/stores/AccountStore.d.ts +30 -23
- package/dist/accounts/utils/Accounts.d.ts +2 -1
- package/dist/budgets/index.es.js +546 -540
- package/dist/budgets/store/BudgetsStore.d.ts +1 -0
- package/dist/cashflow/index.es.js +444 -457
- package/dist/categories/index.es.js +1 -1
- package/dist/categories/stores/CategoryStore.d.ts +10 -5
- package/dist/categories/util/CategoryUtil.d.ts +3 -2
- package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
- package/dist/common/components/SkeletonLoader.d.ts +7 -0
- package/dist/common/components/WidgetContainer.d.ts +7 -6
- package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
- package/dist/common/components/index.d.ts +2 -2
- package/dist/common/hooks/useAriaLive.d.ts +1 -1
- package/dist/common/index.es.js +459 -445
- package/dist/common/stores/AppDataStore.d.ts +3 -1
- package/dist/common/stores/GlobalCopyStore.d.ts +0 -1
- package/dist/common/stores/GlobalStore.d.ts +3 -3
- package/dist/common/stores/GlobalUiStore.d.ts +10 -6
- package/dist/common/stores/UserStore.d.ts +3 -2
- package/dist/common/types/Account.d.ts +9 -6
- package/dist/dashboard/index.es.js +84 -116
- package/dist/debts/index.es.js +417 -413
- package/dist/{exportTransactionsToCSV-BrTYdSgJ.mjs → exportTransactionsToCSV-DtQ7ovAR.mjs} +1 -1
- package/dist/finstrong/index.es.js +1167 -1110
- package/dist/goals/index.es.js +618 -598
- package/dist/goals/stores/GoalStore.d.ts +19 -4
- package/dist/help/index.es.js +13 -13
- package/dist/investments/index.es.js +330 -325
- package/dist/investments/stores/HoldingStore.d.ts +1 -0
- package/dist/networth/components/NetWorthChart.d.ts +3 -2
- package/dist/networth/components/NetWorthList.d.ts +3 -3
- package/dist/networth/index.es.js +423 -433
- package/dist/networth/stores/NetWorthStore.d.ts +20 -9
- package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
- package/dist/notifications/index.es.js +90 -91
- package/dist/notifications/stores/NotificationStore.d.ts +3 -1
- package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
- package/dist/recurringtransactions/index.es.js +543 -562
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +4 -2
- package/dist/settings/index.es.js +253 -248
- package/dist/spending/index.es.js +282 -301
- package/dist/transactions/index.es.js +269 -263
- package/dist/transactions/stores/TransactionStore.d.ts +26 -77
- package/dist/transactions/stores/UiStore.d.ts +0 -2
- package/dist/trends/index.es.js +708 -699
- package/dist/{useAccountDisplayName-BTvP_pw6.mjs → useAccountDisplayName-Bot2tb4n.mjs} +1 -1
- package/package.json +3 -3
- package/dist/AccountStore-CWFzg8-E.mjs +0 -260
- package/dist/Accounts-CWt-NRq8.mjs +0 -9
- package/dist/CategoryUtil-DZflYFam.mjs +0 -78
- package/dist/ConnectDrawer-BOjfI6rz.mjs +0 -563
- package/dist/GoalStore-C7ahxxLi.mjs +0 -364
- package/dist/NetWorthStore-xWIo9CYU.mjs +0 -150
- package/dist/TransactionStore-DJwPaZuM.mjs +0 -677
- package/dist/WidgetContainer-CrK6tyHr.mjs +0 -572
- package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
- package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
- package/dist/common/components/accountfilter/index.d.ts +0 -1
- package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-cartographer/experiences",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.8.0-alpha-ram-goal-bug",
|
|
4
4
|
"description": "Library containing experience widgets",
|
|
5
5
|
"author": "MX",
|
|
6
6
|
"license": "MIT",
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
"storybook-dark-mode": "4.0.1",
|
|
253
253
|
"typescript": "^5.8.2",
|
|
254
254
|
"vi-canvas-mock": "^1.0.0",
|
|
255
|
-
"vite": "^5.4.
|
|
255
|
+
"vite": "^5.4.21",
|
|
256
256
|
"vite-plugin-dts": "^4.5.3",
|
|
257
257
|
"vite-tsconfig-paths": "^5.1.4",
|
|
258
258
|
"vitest": "^3.0.8"
|
|
@@ -272,5 +272,5 @@
|
|
|
272
272
|
"CHANGELOG.md",
|
|
273
273
|
"README.md"
|
|
274
274
|
],
|
|
275
|
-
"packageManager": "yarn@4.
|
|
275
|
+
"packageManager": "yarn@4.11.0"
|
|
276
276
|
}
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { makeAutoObservable as _, runInAction as a } from "mobx";
|
|
2
|
-
import { i as f } from "./User-LJpEwPtn.mjs";
|
|
3
|
-
import { F as p, A as i } from "./Fetch-DecPFeGU.mjs";
|
|
4
|
-
import { A as c, h as d, d as h, E as y, i as I, j as b } from "./ConnectDrawer-BOjfI6rz.mjs";
|
|
5
|
-
class A {
|
|
6
|
-
fetchInstance;
|
|
7
|
-
constructor(t, e, n) {
|
|
8
|
-
this.fetchInstance = new p(t, e, void 0, n);
|
|
9
|
-
}
|
|
10
|
-
createAccount = async (t) => this.fetchInstance.post(i.ACCOUNTS, t).then((e) => e.account).catch((e) => e);
|
|
11
|
-
deleteAccount = async (t) => this.fetchInstance.delete(`${i.ACCOUNTS}/${t}`).catch((e) => e);
|
|
12
|
-
getAccounts = async () => this.fetchInstance.get(i.ACCOUNTS).then((t) => t.accounts).catch((t) => t);
|
|
13
|
-
getInstitutions = async () => this.fetchInstance.get(i.INSTITUTIONS).then((t) => t).catch((t) => t);
|
|
14
|
-
getMembers = async () => this.fetchInstance.get(i.MEMBERS).then((t) => t.members).catch((t) => t);
|
|
15
|
-
getMonthlyAccountBalances = async (t) => this.fetchInstance.get(`${i.ACCOUNTS}/${t}/monthly_account_balances`).then((e) => e.monthly_account_balances).catch((e) => e);
|
|
16
|
-
mergeAccounts = async (t) => this.fetchInstance.put(`${i.ACCOUNTS}/merge`, { accounts: t }).then((e) => e).catch((e) => e);
|
|
17
|
-
refreshAllMembers = async () => this.fetchInstance.get(`${i.MEMBERS}/refresh_all`).then((t) => t).catch((t) => t);
|
|
18
|
-
updateAccount = async (t) => this.fetchInstance.put(`${i.ACCOUNTS}/${t.guid}`, t).then((e) => e.account).catch((e) => e);
|
|
19
|
-
}
|
|
20
|
-
class C {
|
|
21
|
-
isLoading = !1;
|
|
22
|
-
selectedAccount = {};
|
|
23
|
-
selectedMember = {};
|
|
24
|
-
constructor() {
|
|
25
|
-
_(this);
|
|
26
|
-
}
|
|
27
|
-
setIsLoading = (t) => this.isLoading = t;
|
|
28
|
-
setSelectedAccount = (t) => this.selectedAccount = t;
|
|
29
|
-
setSelectedMember = (t) => this.selectedMember = t;
|
|
30
|
-
}
|
|
31
|
-
class w {
|
|
32
|
-
globalStore;
|
|
33
|
-
api = new A("/", "");
|
|
34
|
-
accounts = [];
|
|
35
|
-
institutions = [];
|
|
36
|
-
members = [];
|
|
37
|
-
uiStore;
|
|
38
|
-
constructor(t) {
|
|
39
|
-
this.globalStore = t, this.uiStore = new C(), this.api = new A(t.endpoint, t.sessionToken, t.onError), _(this);
|
|
40
|
-
}
|
|
41
|
-
loadAccountData = async ({
|
|
42
|
-
accounts: t,
|
|
43
|
-
institutions: e
|
|
44
|
-
} = {}) => {
|
|
45
|
-
await Promise.all([this.loadAccounts(t), this.loadInstitutions(e)]);
|
|
46
|
-
};
|
|
47
|
-
get cashAccounts() {
|
|
48
|
-
return this.accounts.filter(
|
|
49
|
-
(t) => t.account_type === c.CASH || t.account_type === c.CHECKING || t.account_type === c.PREPAID || t.account_type === c.SAVINGS || t.account_type === c.CHECKING_LINE_OF_CREDIT
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
get cashBalance() {
|
|
53
|
-
return this.cashAccounts.reduce((t, e) => t + (e?.balance || 0), 0);
|
|
54
|
-
}
|
|
55
|
-
get checkingAccounts() {
|
|
56
|
-
return this.accounts.filter((t) => t.account_type === c.CHECKING);
|
|
57
|
-
}
|
|
58
|
-
get debtAccounts() {
|
|
59
|
-
return this.accounts.filter(
|
|
60
|
-
(t) => t.account_type === c.CREDIT_CARD || t.account_type === c.LOAN || t.account_type === c.MORTGAGE || t.account_type === c.LINE_OF_CREDIT || t.account_type === c.CHECKING_LINE_OF_CREDIT
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
get finstrongAccounts() {
|
|
64
|
-
const t = /* @__PURE__ */ new Set([
|
|
65
|
-
c.CHECKING,
|
|
66
|
-
c.SAVINGS,
|
|
67
|
-
c.CREDIT_CARD,
|
|
68
|
-
c.INVESTMENT
|
|
69
|
-
]);
|
|
70
|
-
return this.accounts.filter((e) => t.has(e.account_type));
|
|
71
|
-
}
|
|
72
|
-
get investmentAccounts() {
|
|
73
|
-
return this.accounts.filter(
|
|
74
|
-
(t) => t.account_type === c.INVESTMENT
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
get savingsAccounts() {
|
|
78
|
-
return this.accounts.filter((t) => t.account_type === c.SAVINGS);
|
|
79
|
-
}
|
|
80
|
-
get retirementAccounts() {
|
|
81
|
-
return this.accounts.filter(
|
|
82
|
-
(t) => t.account_type === c.INVESTMENT || t.account_type === c.SAVINGS || t.account_type === c.CHECKING || t.account_type === c.CASH || t.account_type === c.PROPERTY || t.account_type === c.INSURANCE && (t.account_subtype === d.WHOLE_LIFE || t.account_subtype === d.UNIVERSAL_LIFE || t.account_subtype === d.VARIABLE_UNIVERSAL_LIFE)
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
get visibleAccounts() {
|
|
86
|
-
return this.accounts.filter((t) => !t.is_hidden);
|
|
87
|
-
}
|
|
88
|
-
get visibleCashAccounts() {
|
|
89
|
-
return this.cashAccounts.filter((t) => !t.is_hidden);
|
|
90
|
-
}
|
|
91
|
-
get visibleCashBalance() {
|
|
92
|
-
return this.visibleCashAccounts.reduce((t, e) => t + (e?.balance || 0), 0);
|
|
93
|
-
}
|
|
94
|
-
get visibleCheckingAccounts() {
|
|
95
|
-
return this.checkingAccounts.filter((t) => !t.is_hidden);
|
|
96
|
-
}
|
|
97
|
-
get visibleDebtAccounts() {
|
|
98
|
-
return this.debtAccounts.filter((t) => !t.is_hidden);
|
|
99
|
-
}
|
|
100
|
-
get visibleFinstrongAccounts() {
|
|
101
|
-
return this.finstrongAccounts.filter(
|
|
102
|
-
(t) => !(t.is_closed || t.is_deleted || t.is_hidden)
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
get visibleRetirementAccounts() {
|
|
106
|
-
return this.retirementAccounts.filter((t) => !t.is_hidden);
|
|
107
|
-
}
|
|
108
|
-
get visibleInvestmentAccounts() {
|
|
109
|
-
return this.investmentAccounts.filter((t) => !t.is_hidden);
|
|
110
|
-
}
|
|
111
|
-
get visibleSavingsAccounts() {
|
|
112
|
-
return this.savingsAccounts.filter((t) => !t.is_hidden);
|
|
113
|
-
}
|
|
114
|
-
get savingsAndCheckingAccountsBalance() {
|
|
115
|
-
return this.savingsAndCheckingAccounts.reduce(
|
|
116
|
-
(e, n) => e + (n?.balance || 0),
|
|
117
|
-
0
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
get savingsAndCheckingAccounts() {
|
|
121
|
-
return this.accounts.filter(
|
|
122
|
-
(e) => e.account_type === c.SAVINGS || e.account_type === c.CHECKING
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
addAccount = async (t) => {
|
|
126
|
-
try {
|
|
127
|
-
const e = await this.api.createAccount(t);
|
|
128
|
-
a(() => {
|
|
129
|
-
this.accounts = [...this.accounts, e];
|
|
130
|
-
});
|
|
131
|
-
} catch (e) {
|
|
132
|
-
console.error(`Error occurred while adding an account: ${e}`);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
augmentAccounts = (t = this.accounts) => {
|
|
136
|
-
const e = [], n = this.globalStore.userStore.userFeatures, s = f(
|
|
137
|
-
n,
|
|
138
|
-
"MD_EXCLUDE_EXTERNAL_ACCOUNTS"
|
|
139
|
-
);
|
|
140
|
-
for (const o of t) {
|
|
141
|
-
if (s && o.member_is_managed_by_user) continue;
|
|
142
|
-
const r = this.members.find((m) => m.guid === o.member_guid);
|
|
143
|
-
if (!r) continue;
|
|
144
|
-
let u = h.Connected;
|
|
145
|
-
y.includes(r.connection_status) ? u = h.Error : I.includes(r.connection_status) ? u = h.Processing : b.includes(r.connection_status) && (u = h.RequiresMfa);
|
|
146
|
-
const g = [
|
|
147
|
-
o.user_name || o.feed_name || "",
|
|
148
|
-
o.account_number ? `*${o.account_number}` : ""
|
|
149
|
-
].join(" ").trim();
|
|
150
|
-
e.push({
|
|
151
|
-
...o,
|
|
152
|
-
connectionStatus: u,
|
|
153
|
-
institutionName: g,
|
|
154
|
-
memberName: r.name
|
|
155
|
-
}), r.connectionStatus = u;
|
|
156
|
-
}
|
|
157
|
-
return e;
|
|
158
|
-
};
|
|
159
|
-
loadAccounts = async (t) => {
|
|
160
|
-
await this.loadMembers();
|
|
161
|
-
try {
|
|
162
|
-
const e = t || await this.api.getAccounts();
|
|
163
|
-
a(() => {
|
|
164
|
-
this.accounts = this.sortAccounts(this.augmentAccounts(e));
|
|
165
|
-
});
|
|
166
|
-
} catch (e) {
|
|
167
|
-
console.error(`Error occurred while loading accounts: ${e}`);
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
loadInstitutions = async (t) => {
|
|
171
|
-
try {
|
|
172
|
-
const e = t || await this.api.getInstitutions();
|
|
173
|
-
a(() => {
|
|
174
|
-
this.institutions = e;
|
|
175
|
-
});
|
|
176
|
-
} catch (e) {
|
|
177
|
-
console.error(`Error occurred while loading institutions: ${e}`);
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
loadMembers = async () => {
|
|
181
|
-
try {
|
|
182
|
-
const t = await this.api.getMembers();
|
|
183
|
-
a(() => {
|
|
184
|
-
this.members = t;
|
|
185
|
-
});
|
|
186
|
-
} catch (t) {
|
|
187
|
-
console.error(`Error occurred while loading members: ${t}`);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
mergeAccounts = async (t) => {
|
|
191
|
-
try {
|
|
192
|
-
const e = await this.api.mergeAccounts(t), n = e[Object.keys(e)[0]];
|
|
193
|
-
a(() => {
|
|
194
|
-
const s = this.accounts.findIndex((r) => r.guid === t[1]);
|
|
195
|
-
this.accounts.splice(s, 1);
|
|
196
|
-
const o = this.accounts.findIndex((r) => r.guid === t[0]);
|
|
197
|
-
this.accounts.splice(o, 1, n);
|
|
198
|
-
});
|
|
199
|
-
} catch (e) {
|
|
200
|
-
console.error(`Error occurred while merging accounts: ${e}`);
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
sortAccounts = (t = this.accounts) => t.sort((e, n) => e.account_type > n.account_type ? 1 : e.account_type < n.account_type ? -1 : (e.name || "") > (n.name || "") ? 1 : (e.name || "") < (n.name || "") ? -1 : 0);
|
|
204
|
-
refreshAccounts = async () => {
|
|
205
|
-
this.uiStore.setIsLoading(!0), await Promise.all([this.loadAccounts(), this.loadInstitutions()]), this.uiStore.setIsLoading(!1);
|
|
206
|
-
};
|
|
207
|
-
refreshMembers = async () => {
|
|
208
|
-
try {
|
|
209
|
-
await this.api.refreshAllMembers(), await this.loadMembers();
|
|
210
|
-
} catch (t) {
|
|
211
|
-
console.error(`Error occurredwhile refreshing members: ${t}`);
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
removeAccount = async (t) => {
|
|
215
|
-
try {
|
|
216
|
-
await this.api.deleteAccount(t), a(() => {
|
|
217
|
-
const e = this.accounts.findIndex((n) => n.guid === t);
|
|
218
|
-
this.accounts.splice(e, 1);
|
|
219
|
-
});
|
|
220
|
-
} catch (e) {
|
|
221
|
-
console.error(`Error occurred while removing an account: ${e}`);
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
updateAccount = async (t) => {
|
|
225
|
-
try {
|
|
226
|
-
const e = await this.api.updateAccount(t);
|
|
227
|
-
a(() => {
|
|
228
|
-
const n = this.accounts.findIndex(
|
|
229
|
-
(s) => s.guid === e.guid
|
|
230
|
-
);
|
|
231
|
-
this.accounts.splice(n, 1, e), this.accounts = this.augmentAccounts(this.accounts);
|
|
232
|
-
});
|
|
233
|
-
} catch (e) {
|
|
234
|
-
console.error(`Error occurred while updating account: ${e}`);
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
updateAccountBalance = (t, e) => {
|
|
238
|
-
const n = this.accounts.find((s) => s.guid === t);
|
|
239
|
-
n && a(() => {
|
|
240
|
-
n.balance = (n.balance || 0) + e;
|
|
241
|
-
});
|
|
242
|
-
};
|
|
243
|
-
updateAccountFiltering = async (t, e) => {
|
|
244
|
-
for (const n of t) {
|
|
245
|
-
const s = this.accounts.find((o) => o.guid === n);
|
|
246
|
-
if (s) {
|
|
247
|
-
s.is_excluded_from_accounts = e, s.is_excluded_from_budgets = e, s.is_excluded_from_cash_flow = e, s.is_excluded_from_debts = e, s.is_excluded_from_goals = e, s.is_excluded_from_investments = e, s.is_excluded_from_net_worth = e, s.is_excluded_from_spending = e, s.is_excluded_from_transactions = e, s.is_excluded_from_trends = e;
|
|
248
|
-
try {
|
|
249
|
-
this.updateAccount(s);
|
|
250
|
-
} catch (o) {
|
|
251
|
-
console.error(`Failed to update account ${n} (added):`, o);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
export {
|
|
258
|
-
A,
|
|
259
|
-
w as a
|
|
260
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { A as _ } from "./ConnectDrawer-BOjfI6rz.mjs";
|
|
2
|
-
const s = (t) => t && (t.account_type === _.CREDIT_CARD || t.account_type === _.LOAN || t.account_type === _.MORTGAGE || t.account_type === _.LINE_OF_CREDIT || t.account_type === _.CHECKING_LINE_OF_CREDIT), p = (t) => t.is_manual || !t.guid, E = (t) => t.account_type === _.LINE_OF_CREDIT || t.account_type === _.CREDIT_CARD || t.account_type === _.CHECKING_LINE_OF_CREDIT, a = (t) => t.account_type === _.SAVINGS || t.account_type === _.CHECKING || t.account_type === _.LINE_OF_CREDIT || t.account_type === _.CREDIT_CARD || t.account_type === _.LOAN || t.account_type === _.MORTGAGE, y = (t) => t.account_type === _.LOAN || t.account_type === _.MORTGAGE;
|
|
3
|
-
export {
|
|
4
|
-
s as a,
|
|
5
|
-
E as b,
|
|
6
|
-
y as c,
|
|
7
|
-
p as i,
|
|
8
|
-
a as u
|
|
9
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { format as l } from "date-fns/format";
|
|
2
|
-
import { startOfMonth as h } from "date-fns/startOfMonth";
|
|
3
|
-
import { startOfToday as M } from "date-fns/startOfToday";
|
|
4
|
-
import { subMonths as T } from "date-fns/subMonths";
|
|
5
|
-
import { CategoryIconList as C } from "@mxenabled/mxui";
|
|
6
|
-
import { C as N, a as O, b } from "./Category-CevNQ03n.mjs";
|
|
7
|
-
import { f as D, D as E } from "./Dialog-B4PI-_bL.mjs";
|
|
8
|
-
const R = 3, d = 12, Y = (n, r, t) => n.filter((e) => !e.parent_guid).map(
|
|
9
|
-
(e) => _(
|
|
10
|
-
e,
|
|
11
|
-
r,
|
|
12
|
-
t,
|
|
13
|
-
n.filter((o) => o.parent_guid === e.guid)
|
|
14
|
-
)
|
|
15
|
-
), x = (n, r) => {
|
|
16
|
-
const t = C.find((e) => e.guid === n);
|
|
17
|
-
return t ? r.palette.categories[t.colorName] || "" : r.palette.categories.uncategorized || "";
|
|
18
|
-
}, _ = (n, r, t, e = []) => {
|
|
19
|
-
const o = n.guid, i = n.parent_guid || o, u = o === i, s = r.find((a) => a.category_guid === o)?.total || 0, c = f(
|
|
20
|
-
t.filter((a) => a.category_guid === o)
|
|
21
|
-
), g = f(
|
|
22
|
-
t.filter(
|
|
23
|
-
(a) => a.category_guid === o || a.top_level_category_guid === o
|
|
24
|
-
)
|
|
25
|
-
), m = e.map(
|
|
26
|
-
(a) => _(a, r, t)
|
|
27
|
-
), p = m.reduce(
|
|
28
|
-
(a, A) => a + A.currentAmount,
|
|
29
|
-
s
|
|
30
|
-
);
|
|
31
|
-
return {
|
|
32
|
-
...n,
|
|
33
|
-
currentAmount: s,
|
|
34
|
-
averageAmount: y(c),
|
|
35
|
-
color: N[i],
|
|
36
|
-
icon: O[i],
|
|
37
|
-
isTransfer: i === b.TRANSFER,
|
|
38
|
-
monthlyAmounts: c,
|
|
39
|
-
subCategories: m,
|
|
40
|
-
totalAmount: u ? p : 0,
|
|
41
|
-
totalAverageAmount: y(g),
|
|
42
|
-
totalMonthlyAmounts: u ? g : []
|
|
43
|
-
};
|
|
44
|
-
}, k = (n, r) => n.map((t) => {
|
|
45
|
-
const e = r.filter(
|
|
46
|
-
(o) => o.category_guid === t.guid || o.top_level_category_guid === t.guid
|
|
47
|
-
);
|
|
48
|
-
return {
|
|
49
|
-
...t,
|
|
50
|
-
transactions: e
|
|
51
|
-
};
|
|
52
|
-
}), y = (n, r = R) => {
|
|
53
|
-
const t = r > history.length ? history.length : r;
|
|
54
|
-
return Math.ceil(
|
|
55
|
-
Math.max(
|
|
56
|
-
0,
|
|
57
|
-
n.slice(-t).reduce((e, o) => e + o.amount, 0) / t
|
|
58
|
-
)
|
|
59
|
-
);
|
|
60
|
-
}, f = (n) => {
|
|
61
|
-
const r = [], t = M();
|
|
62
|
-
for (let e = 0; e <= d; e++) {
|
|
63
|
-
const o = h(T(t, d - e)), u = n.filter(
|
|
64
|
-
(s) => s.year_month === Number(l(o, "yyyyMM"))
|
|
65
|
-
).reduce((s, c) => s + c.total, 0);
|
|
66
|
-
r.push({
|
|
67
|
-
amount: u,
|
|
68
|
-
isoDate: l(o, "yyyy-MM-dd"),
|
|
69
|
-
label: D(o, E.MONTH_YEAR)
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return r;
|
|
73
|
-
};
|
|
74
|
-
export {
|
|
75
|
-
Y as a,
|
|
76
|
-
x as b,
|
|
77
|
-
k as g
|
|
78
|
-
};
|