@mx-cartographer/experiences 8.1.12 → 8.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 +4 -0
- package/dist/{Account-CMjOp7S2.mjs → Account-BaJmiJAG.mjs} +4 -4
- package/dist/{Account-BIKn4XEZ.mjs → Account-BxHMlV9R.mjs} +1 -1
- package/dist/{AccountDetailsHeader-CzefHTWU.mjs → AccountDetailsHeader-CfdnKyJK.mjs} +21 -21
- package/dist/{AccountFields-BWmpVsS3.mjs → AccountFields-CAy0x_4i.mjs} +6 -6
- package/dist/{AccountListItem-DRDxaRBe.mjs → AccountListItem-BYyeeCf6.mjs} +7 -7
- package/dist/{Accounts-DX3xJE97.mjs → AccountUtils-T5_Odvos.mjs} +1 -1
- package/dist/{Analytics-CxK7O19c.mjs → Analytics-CkYXKvco.mjs} +1 -1
- package/dist/ApiEndpoints-DXwIYNUV.mjs +49 -0
- package/dist/BudgetUtil-Bg2AQJpQ.mjs +74 -0
- package/dist/{Category-Ccoew_sA.mjs → Category-DEKZGLYe.mjs} +3 -3
- package/dist/{CategorySelectorDrawer-hhDdSFHO.mjs → CategorySelectorDrawer-Cu1ohxeM.mjs} +2 -2
- package/dist/{Connect-CBBTL1HJ.mjs → Connect-Dk6GZEsA.mjs} +1 -1
- package/dist/ConnectCard-Dix8BoV_.mjs +54 -0
- package/dist/{ConnectDrawer-DNnuF80E.mjs → ConnectDrawer-DgfsTpyW.mjs} +2 -2
- package/dist/{ConnectionsDrawer-DX6d7uwJ.mjs → ConnectionsDrawer-D7IXAza2.mjs} +2 -2
- package/dist/CurrencyDialog-d4dL7vA5.mjs +371 -0
- package/dist/{CurrencyInput-BMbUVSvz.mjs → CurrencyInput-B59ugxPN.mjs} +15 -16
- package/dist/{CurrencyText-oqd6cX3M.mjs → CurrencyText-CCbE6MmF.mjs} +1 -1
- package/dist/{DateFormats-CaOj_4eI.mjs → DateFormats-HudZ3Bjs.mjs} +6 -7
- package/dist/{DateUtil-D0TO0DaZ.mjs → DateUtil-Bhq59ZVg.mjs} +1 -1
- package/dist/DebtUtils-DD3186U-.mjs +153 -0
- package/dist/EmbeddedCard-BNl3quCs.mjs +856 -0
- package/dist/Error-Dogaw2jO.mjs +84 -0
- package/dist/ErrorBoundary-CsdOcnJ9.mjs +23 -0
- package/dist/{ExportCsvAction-BDFu6YIe.mjs → ExportCsvAction-hDprC41l.mjs} +6 -5
- package/dist/{GlobalAccountFilter-jkFxqPg6.mjs → GlobalAccountFilter-DrhtwPqh.mjs} +1 -1
- package/dist/GlobalCopyApi-wcnDUzMV.mjs +128 -0
- package/dist/GoalsUtil-C9EnLWvC.mjs +107 -0
- package/dist/{Help-C_CM4gpK.mjs → Help-BSQm9o29.mjs} +68 -67
- package/dist/{Help-CgpJK03Q.mjs → Help-CkQTjORd.mjs} +6 -27
- package/dist/InformationTooltip-4su8bn1e.mjs +41 -0
- package/dist/{LineChart-CeZnCZ7j.mjs → LineChart-CejWS_rh.mjs} +2 -2
- package/dist/{ListItemAction-CNpknVvo.mjs → ListItemAction-DGjHxNDJ.mjs} +1 -1
- package/dist/ListItemRow-kH1rn8Xu.mjs +67 -0
- package/dist/ListItemWrapper-B5r-YQQ_.mjs +42 -0
- package/dist/Localization-DnoVyBNK.mjs +38 -0
- package/dist/{ManageIncome-BX2IqW57.mjs → ManageIncome-DwylSiWs.mjs} +51 -51
- package/dist/{MicroWidgetContainer-DAesImQ6.mjs → MicroWidgetContainer-CfKdQfhi.mjs} +1 -1
- package/dist/{MiniWidgetContainer-BOv3n4iw.mjs → MiniWidgetContainer-BdPiUU-u.mjs} +1 -1
- package/dist/NetWorthUtils-DilGN1nW.mjs +95 -0
- package/dist/{NotificationSettings-DatCL2Ej.mjs → NotificationSettings-CCg-Tml2.mjs} +13 -13
- package/dist/NotificationUtils-BRGFTePr.mjs +23 -0
- package/dist/{NumberFormatting-CyrvFgfd.mjs → NumberFormatting--XMeeBfr.mjs} +2 -1
- package/dist/{OriginalBalanceAction-CWQ0CK-T.mjs → OriginalBalanceAction-CvDx0K6k.mjs} +4 -4
- package/dist/{RecurringSettings-DCplGEv_.mjs → RecurringSettings-CPXLW6AR.mjs} +9 -9
- package/dist/RecurringTransactionsUtil-B3rLEx_g.mjs +253 -0
- package/dist/Select-BZRUpOib.mjs +51 -0
- package/dist/SelectionBox-Bx2a5rh4.mjs +48 -0
- package/dist/Sizes-DISGrlUg.mjs +6 -0
- package/dist/{SpendingData-Dj85XEUp.mjs → SpendingData-PKlh8caU.mjs} +6 -6
- package/dist/{SpendingLegend-BS8mHUbu.mjs → SpendingLegend-BmkEr9Nh.mjs} +4 -4
- package/dist/{TransactionDetails-C_skrQk8.mjs → TransactionDetails-CbBSxdOi.mjs} +33 -33
- package/dist/TransactionUtils-BphBJBbU.mjs +234 -0
- package/dist/TrendsUtil-D9z3kIj_.mjs +69 -0
- package/dist/UserStore-CRpKQjpP.mjs +3002 -0
- package/dist/{ViewMoreMicroCard-D1j0w64K.mjs → ViewMoreMicroCard-K69RRs_b.mjs} +28 -30
- package/dist/{WidgetContainer-BPJoDkhL.mjs → WidgetContainer-DalWyz5A.mjs} +3 -3
- package/dist/accounts/hooks/useUiStore.d.ts +6 -1
- package/dist/accounts/index.d.ts +0 -1
- package/dist/accounts/index.es.js +62 -64
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +18 -18
- package/dist/cashflow/context/hooks.d.ts +15 -1
- package/dist/cashflow/index.d.ts +0 -1
- package/dist/cashflow/index.es.js +28 -31
- package/dist/categories/context/hooks.d.ts +19 -1
- package/dist/categories/index.d.ts +0 -1
- package/dist/categories/index.es.js +4 -6
- package/dist/common/constants/ScheduledPayment.d.ts +1 -1
- package/dist/common/constants/index.d.ts +0 -3
- package/dist/common/context/GlobalDataProvider.d.ts +1 -1
- package/dist/common/context/hooks.d.ts +20 -20
- package/dist/common/index.d.ts +3 -1
- package/dist/common/index.es.js +215 -961
- package/dist/common/utils/AccountFilter.d.ts +1 -1
- package/dist/common/utils/index.d.ts +0 -4
- package/dist/{common → core}/constants/DefaultConfig.d.ts +1 -1
- package/dist/core/constants/Transaction.d.ts +10 -0
- package/dist/core/constants/index.d.ts +2 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.es.js +94 -79
- package/dist/{accounts → core}/stores/AccountStore.d.ts +14 -4
- package/dist/{analytics → core}/stores/AnalyticsStore.d.ts +1 -1
- package/dist/{common → core}/stores/AppDataStore.d.ts +4 -5
- package/dist/{insights/store → core/stores}/BeatStore.d.ts +3 -3
- package/dist/{budgets/store → core/stores}/BudgetsStore.d.ts +3 -4
- package/dist/{cashflow/stores/UiStore.d.ts → core/stores/CashflowStore.d.ts} +10 -2
- package/dist/{categories → core}/stores/CategoryStore.d.ts +24 -4
- package/dist/{common → core}/stores/ConnectStore.d.ts +2 -2
- package/dist/core/stores/DebtsStore.d.ts +22 -0
- package/dist/{finstrong → core}/stores/FinstrongStore.d.ts +4 -4
- package/dist/{common → core}/stores/GlobalCopyStore.d.ts +2 -2
- package/dist/{common → core}/stores/GlobalStore.d.ts +2 -25
- package/dist/{common → core}/stores/GlobalUiStore.d.ts +3 -3
- package/dist/{goals → core}/stores/GoalStore.d.ts +3 -3
- package/dist/{help/store → core/stores}/HelpStore.d.ts +4 -6
- package/dist/{investments → core}/stores/HoldingStore.d.ts +4 -4
- package/dist/{merchants → core}/stores/MerchantStore.d.ts +3 -3
- package/dist/{networth → core}/stores/NetWorthStore.d.ts +3 -4
- package/dist/{notifications → core}/stores/NotificationStore.d.ts +3 -3
- package/dist/{recurringtransactions → core}/stores/RecurringTransactionsStore.d.ts +3 -3
- package/dist/{settings → core}/stores/SettingsStore.d.ts +4 -5
- package/dist/{transactions → core}/stores/TransactionStore.d.ts +27 -6
- package/dist/{trends → core}/stores/TrendsStore.d.ts +11 -5
- package/dist/{common → core}/stores/UserStore.d.ts +2 -2
- package/dist/core/stores/index.d.ts +24 -0
- package/dist/{networth → core}/types/NetWorth.d.ts +1 -10
- package/dist/core/types/Offer.d.ts +32 -0
- package/dist/core/types/index.d.ts +3 -1
- package/dist/{accounts/utils/Accounts.d.ts → core/utils/AccountUtils.d.ts} +1 -1
- package/dist/{microinsights/utils/beatUtils.d.ts → core/utils/BeatUtils.d.ts} +1 -1
- package/dist/{budgets → core}/utils/BudgetUtil.d.ts +2 -2
- package/dist/{categories/util → core/utils}/CategoryUtil.d.ts +6 -1
- package/dist/core/utils/DebtUtils.d.ts +31 -0
- package/dist/core/utils/FinstrongUtils.d.ts +7 -0
- package/dist/{goals/util → core/utils}/GoalsUtil.d.ts +1 -1
- package/dist/core/utils/HelpUtil.d.ts +3 -0
- package/dist/{investments/util → core/utils}/InvestmentUtil.d.ts +2 -2
- package/dist/core/utils/Localization.d.ts +3 -0
- package/dist/{networth → core}/utils/NetWorthUtils.d.ts +1 -2
- package/dist/{notifications → core}/utils/NotificationUtils.d.ts +1 -1
- package/dist/{common → core}/utils/NumberFormatting.d.ts +1 -1
- package/dist/{recurringtransactions/util/RecurringTransactions.d.ts → core/utils/RecurringTransactionsUtil.d.ts} +1 -1
- package/dist/{settings/util/Notifications.d.ts → core/utils/SettingsUtil.d.ts} +1 -1
- package/dist/{transactions/utils/buildDetailedTransactions.d.ts → core/utils/TransactionUtils.d.ts} +12 -2
- package/dist/{trends/utils/TrendsData.d.ts → core/utils/TrendsUtil.d.ts} +1 -1
- package/dist/{common/utils/User.d.ts → core/utils/UserUtils.d.ts} +1 -1
- package/dist/core/utils/index.d.ts +1 -1
- package/dist/dashboard/index.es.js +4 -4
- package/dist/debts/components/DebtsChart.d.ts +1 -1
- package/dist/debts/components/DebtsTable.d.ts +1 -1
- package/dist/debts/components/SnowballCard.d.ts +1 -1
- package/dist/debts/components/actions/InterestRateAction.d.ts +1 -1
- package/dist/debts/components/actions/MonthlyPaymentAction.d.ts +1 -1
- package/dist/debts/components/actions/OriginalBalanceAction.d.ts +1 -1
- package/dist/debts/hooks/useDebtsUiStore.d.ts +1 -1
- package/dist/debts/index.d.ts +0 -1
- package/dist/debts/index.es.js +568 -691
- package/dist/debts/utils/DebtsTable.d.ts +1 -1
- package/dist/debts/utils/SnowballCard.d.ts +2 -2
- package/dist/finstrong/index.d.ts +0 -1
- package/dist/finstrong/index.es.js +1565 -1342
- package/dist/finstrong/util/finstrongUtils.d.ts +1 -7
- package/dist/goals/components/addgoal/AddGoalListItem.d.ts +1 -1
- package/dist/goals/index.d.ts +0 -1
- package/dist/goals/index.es.js +71 -73
- package/dist/help/index.es.js +4 -4
- package/dist/help/utils/index.d.ts +0 -1
- package/dist/{hooks-RzCoiTd0.mjs → hooks-BaO_gOI6.mjs} +17 -17
- package/dist/insights/index.d.ts +0 -1
- package/dist/insights/index.es.js +52 -54
- package/dist/investments/components/AnalysisDetails.d.ts +1 -1
- package/dist/investments/index.es.js +6 -6
- package/dist/merchants/index.d.ts +0 -1
- package/dist/merchants/index.es.js +12 -14
- package/dist/microinsights/index.es.js +1 -1
- package/dist/microinsights/interfaces.d.ts +1 -33
- package/dist/networth/components/AssetsLiabilitiesDetail.d.ts +1 -1
- package/dist/networth/components/GainsLossesDetail.d.ts +1 -1
- package/dist/networth/components/NetWorthChange.d.ts +1 -1
- package/dist/networth/components/NetWorthListItem.d.ts +1 -1
- package/dist/networth/components/NetWorthSummary.d.ts +1 -1
- package/dist/networth/index.d.ts +0 -4
- package/dist/networth/index.es.js +232 -237
- package/dist/notifications/index.d.ts +0 -2
- package/dist/notifications/index.es.js +23 -26
- package/dist/recurringtransactions/index.d.ts +0 -1
- package/dist/recurringtransactions/index.es.js +92 -96
- package/dist/settings/index.d.ts +0 -1
- package/dist/settings/index.es.js +11 -13
- package/dist/spending/index.es.js +10 -10
- package/dist/transactions/context/hooks.d.ts +1 -1
- package/dist/transactions/index.d.ts +0 -4
- package/dist/transactions/index.es.js +102 -109
- package/dist/trends/index.d.ts +0 -1
- package/dist/trends/index.es.js +67 -68
- package/dist/trends/utils/shared.d.ts +1 -1
- package/dist/{useAccountDisplayName-pliH6hz0.mjs → useAccountDisplayName-CFa_MrS6.mjs} +1 -1
- package/dist/{useInsightsEnabled-CzJoG8xi.mjs → useInsightsEnabled-DaNLPmUU.mjs} +1 -1
- package/dist/{useWidgetLoadTimer-BZjr-BiE.mjs → useWidgetLoadTimer-CJb-RELP.mjs} +1 -1
- package/package.json +1 -1
- package/dist/AccountApi-WEM2M9tg.mjs +0 -19
- package/dist/AccountStore-CGrjC2Oe.mjs +0 -253
- package/dist/ApiEndpoints-C5IA97i7.mjs +0 -118
- package/dist/BeatApi-C6pBa0Rb.mjs +0 -21
- package/dist/BeatStore-C7-PIhpB.mjs +0 -163
- package/dist/BudgetUtil-H9igoNVm.mjs +0 -479
- package/dist/CashflowStore-BEi92kJg.mjs +0 -91
- package/dist/CategoryApi-CogDFScz.mjs +0 -29
- package/dist/CategoryStore-CA4NTaKH.mjs +0 -160
- package/dist/CategoryUtil-BJOHgYKS.mjs +0 -80
- package/dist/DebtsStore-BJlC2-yO.mjs +0 -63
- package/dist/EmbeddedCard-B9JoBaan.mjs +0 -811
- package/dist/FinstrongApi-FpmsS_sy.mjs +0 -19
- package/dist/FinstrongStore-DYawCv1d.mjs +0 -435
- package/dist/GlobalCopyApi-DkS-2Zf_.mjs +0 -41
- package/dist/Goal-MFBpoOIC.mjs +0 -29
- package/dist/GoalStore-BBAEbf43.mjs +0 -395
- package/dist/Localization-C_HZg9tJ.mjs +0 -15
- package/dist/Localization-CkQ49EKr.mjs +0 -26
- package/dist/MerchantApi-D8ahYxiG.mjs +0 -15
- package/dist/MerchantStore-CyZTv-BM.mjs +0 -26
- package/dist/NetWorthStore-BY-B_hxy.mjs +0 -168
- package/dist/NotificationApi-DF0obHoR.mjs +0 -20
- package/dist/NotificationStore-DlAM5Ue0.mjs +0 -69
- package/dist/RecurringTransactions-DCt94TN4.mjs +0 -297
- package/dist/RecurringTransactionsStore-CFJYC7lI.mjs +0 -264
- package/dist/RepeatingTransaction-D2gmBTd0.mjs +0 -7
- package/dist/RepeatingTransactionsApi-BNZgZPLs.mjs +0 -17
- package/dist/SettingsApi-D9d7SLhB.mjs +0 -22
- package/dist/SettingsStore-BcbuKfFO.mjs +0 -250
- package/dist/Transaction-Cn5_iFm0.mjs +0 -5
- package/dist/TransactionApi-CLG2eSNe.mjs +0 -86
- package/dist/TransactionStore-amPYxHnA.mjs +0 -710
- package/dist/TrendsStore-bYjIGqyR.mjs +0 -183
- package/dist/WidgetApi-C0BA2cFX.mjs +0 -102
- package/dist/accounts/stores/UiStore.d.ts +0 -10
- package/dist/accounts/utils/index.d.ts +0 -1
- package/dist/cashflow/stores/CashflowStore.d.ts +0 -8
- package/dist/categories/stores/UiStore.d.ts +0 -20
- package/dist/common/stores/index.d.ts +0 -3
- package/dist/common/utils/Categories.d.ts +0 -6
- package/dist/common/utils/Localization.d.ts +0 -3
- package/dist/debts/store/DebtsStore.d.ts +0 -10
- package/dist/debts/store/DebtsUiStore.d.ts +0 -13
- package/dist/debts/utils/DebtStore.d.ts +0 -4
- package/dist/debts/utils/DebtsWidget.d.ts +0 -20
- package/dist/debts/utils/shared.d.ts +0 -12
- package/dist/exportTransactionsToCSV-CSvbZrvL.mjs +0 -133
- package/dist/help/constants/index.d.ts +0 -1
- package/dist/help/utils/getAccessibleHelpCategories.d.ts +0 -3
- package/dist/transactions/analytics.d.ts +0 -3
- package/dist/transactions/constants/Transaction.d.ts +0 -2
- package/dist/transactions/constants/TransactionsTable.d.ts +0 -17
- package/dist/transactions/stores/UiStore.d.ts +0 -25
- package/dist/transactions/utils/exportTransactionsToCSV.d.ts +0 -9
- package/dist/transactions/utils/sortAndFilterTransactions.d.ts +0 -3
- /package/dist/{common → core}/constants/Category.d.ts +0 -0
- /package/dist/{common → core}/constants/DateFormats.d.ts +0 -0
- /package/dist/{debts/constants/index.d.ts → core/constants/Debts.d.ts} +0 -0
- /package/dist/{help → core}/constants/Help.d.ts +0 -0
- /package/dist/{investments/constants/index.d.ts → core/constants/Investments.d.ts} +0 -0
- /package/dist/{common → core}/constants/Numbers.d.ts +0 -0
- /package/dist/{common → core}/constants/Table.d.ts +0 -0
- /package/dist/{common → core}/utils/DateUtil.d.ts +0 -0
|
@@ -1,395 +0,0 @@
|
|
|
1
|
-
import { jsxs as u, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import g from "react";
|
|
3
|
-
import A from "@mui/material/Button";
|
|
4
|
-
import w from "@mui/material/Card";
|
|
5
|
-
import C from "@mui/material/CardContent";
|
|
6
|
-
import E from "@mui/material/CardHeader";
|
|
7
|
-
import b from "@mui/material/Stack";
|
|
8
|
-
import { AccountBalance as x, ChevronRight as v } from "@mxenabled/mx-icons";
|
|
9
|
-
import { Text as p } from "@mxenabled/mxui";
|
|
10
|
-
import { C as I } from "./ConnectDrawer-DNnuF80E.mjs";
|
|
11
|
-
import { makeAutoObservable as S, runInAction as h } from "mobx";
|
|
12
|
-
import { T as i, M as l, G as _ } from "./Goal-MFBpoOIC.mjs";
|
|
13
|
-
import { fromUnixTime as f } from "date-fns/fromUnixTime";
|
|
14
|
-
import { addYears as D } from "date-fns/addYears";
|
|
15
|
-
import { getUnixTime as k } from "date-fns/getUnixTime";
|
|
16
|
-
import { b as d } from "./Localization-CkQ49EKr.mjs";
|
|
17
|
-
import { a as M } from "./NumberFormatting-CyrvFgfd.mjs";
|
|
18
|
-
import { f as N, D as F } from "./DateFormats-CaOj_4eI.mjs";
|
|
19
|
-
const ee = ({ description: a, label: e, title: t }) => {
|
|
20
|
-
const [o, r] = g.useState(!1);
|
|
21
|
-
return /* @__PURE__ */ u(g.Fragment, { children: [
|
|
22
|
-
/* @__PURE__ */ u(w, { sx: { m: 24 }, children: [
|
|
23
|
-
/* @__PURE__ */ s(
|
|
24
|
-
E,
|
|
25
|
-
{
|
|
26
|
-
avatar: /* @__PURE__ */ s(x, {}),
|
|
27
|
-
sx: { ".MuiCardHeader-avatar": { mr: 8 } },
|
|
28
|
-
title: /* @__PURE__ */ s(p, { bold: !0, variant: "body1", children: t })
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
/* @__PURE__ */ s(C, { sx: { ":last-child": { pb: 4 }, ml: 28, py: 0 }, children: /* @__PURE__ */ u(b, { alignItems: "flex-start", spacing: 2, children: [
|
|
32
|
-
/* @__PURE__ */ s(p, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "subtitle2", children: a }),
|
|
33
|
-
/* @__PURE__ */ s(
|
|
34
|
-
A,
|
|
35
|
-
{
|
|
36
|
-
endIcon: /* @__PURE__ */ s(v, {}),
|
|
37
|
-
onClick: () => r(!0),
|
|
38
|
-
sx: {
|
|
39
|
-
pl: 0,
|
|
40
|
-
":hover": {
|
|
41
|
-
bgcolor: "unset"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
variant: "text",
|
|
45
|
-
children: e
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
] }) })
|
|
49
|
-
] }),
|
|
50
|
-
/* @__PURE__ */ s(
|
|
51
|
-
I,
|
|
52
|
-
{
|
|
53
|
-
onClose: () => r(!1),
|
|
54
|
-
showConnectWidget: o,
|
|
55
|
-
title: e
|
|
56
|
-
}
|
|
57
|
-
)
|
|
58
|
-
] });
|
|
59
|
-
};
|
|
60
|
-
function te(a, e) {
|
|
61
|
-
const t = e.track_type === i.DEBT_TRACK ? e.initial_amount : e.amount;
|
|
62
|
-
let o = e.current_amount / t;
|
|
63
|
-
o > 1 && (o = 1), o = e.track_type === i.DEBT_TRACK ? 1 - o : o, isNaN(o) && (o = 1);
|
|
64
|
-
let r = "chart.chart1", n = "common.black";
|
|
65
|
-
e.track_type === i.DEBT_TRACK ? (n = "common.white", r = "chart.chart5") : e.track_type === i.RETIREMENT_TRACK && (r = "chart.chart6");
|
|
66
|
-
const c = {
|
|
67
|
-
style: "percent",
|
|
68
|
-
minimumFractionDigits: 0,
|
|
69
|
-
maximumFractionDigits: 0
|
|
70
|
-
}, m = e.is_complete ? e.completed_at : e.projected_to_complete_at, y = m ? f(m) : /* @__PURE__ */ new Date(), R = d(
|
|
71
|
-
a.goal_percentage,
|
|
72
|
-
M(o, c)
|
|
73
|
-
), T = d(
|
|
74
|
-
e.is_complete ? a.completed_label : a.goal_projection,
|
|
75
|
-
N(y, F.MONTH_SHORT_YEAR)
|
|
76
|
-
);
|
|
77
|
-
return {
|
|
78
|
-
backgroundColor: r,
|
|
79
|
-
color: n,
|
|
80
|
-
percentage: o,
|
|
81
|
-
percentageText: R,
|
|
82
|
-
projectedText: T
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
function oe(a) {
|
|
86
|
-
return [
|
|
87
|
-
{
|
|
88
|
-
bgcolor: "chart.chart1",
|
|
89
|
-
icon: "attach_money",
|
|
90
|
-
label: a.saving_goal_label,
|
|
91
|
-
description: a.saving_goal_description,
|
|
92
|
-
subTypes: [
|
|
93
|
-
{
|
|
94
|
-
icon: "ecg_heart",
|
|
95
|
-
label: a.saving_goal_emergency_fund,
|
|
96
|
-
metaType: l.EMERGENCY_FUND
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
icon: "directions_car",
|
|
100
|
-
label: a.saving_gaol_automobile,
|
|
101
|
-
metaType: l.AUTOMOBILE
|
|
102
|
-
},
|
|
103
|
-
{ icon: "school", label: a.saving_goal_college, metaType: l.COLLEGE },
|
|
104
|
-
{ icon: "home", label: a.saving_goal_home, metaType: l.HOUSE },
|
|
105
|
-
{
|
|
106
|
-
icon: "mountain_flag",
|
|
107
|
-
label: a.saving_goal_recreational,
|
|
108
|
-
metaType: l.RECREATIONAL_VEHICLE
|
|
109
|
-
},
|
|
110
|
-
{ icon: "airplane_ticket", label: a.saving_goal_vacation, metaType: l.VACATION },
|
|
111
|
-
{
|
|
112
|
-
icon: "desktop_windows",
|
|
113
|
-
label: a.saving_goal_electronic,
|
|
114
|
-
metaType: l.ELECTRONIC
|
|
115
|
-
},
|
|
116
|
-
{ icon: "payments", label: a.saving_goal_other, metaType: l.OTHER }
|
|
117
|
-
],
|
|
118
|
-
type: i.SAVINGS_TRACK
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
bgcolor: "chart.chart5",
|
|
122
|
-
icon: "note_stack",
|
|
123
|
-
label: a.debt_goal_label,
|
|
124
|
-
description: a.debt_goal_description,
|
|
125
|
-
subTypes: [],
|
|
126
|
-
type: i.DEBT_TRACK
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
bgcolor: "chart.chart6",
|
|
130
|
-
icon: "person",
|
|
131
|
-
label: a.retirement_goal_label,
|
|
132
|
-
description: a.retirement_goal_description,
|
|
133
|
-
subTypes: [],
|
|
134
|
-
type: i.RETIREMENT_TRACK
|
|
135
|
-
}
|
|
136
|
-
];
|
|
137
|
-
}
|
|
138
|
-
const re = (a, e) => {
|
|
139
|
-
switch (a) {
|
|
140
|
-
case i.DEBT_TRACK:
|
|
141
|
-
return d(e.zero_state_ongoing, "debt");
|
|
142
|
-
case i.SAVINGS_TRACK:
|
|
143
|
-
return d(e.zero_state_ongoing, "saving");
|
|
144
|
-
default:
|
|
145
|
-
return d(e.zero_state_ongoing, "retirement");
|
|
146
|
-
}
|
|
147
|
-
}, G = (a, e) => {
|
|
148
|
-
const t = f(e), o = D(t, a);
|
|
149
|
-
return k(o);
|
|
150
|
-
};
|
|
151
|
-
class ae {
|
|
152
|
-
globalStore;
|
|
153
|
-
api = new _("/", "");
|
|
154
|
-
goals = [];
|
|
155
|
-
goalsLoaded = !1;
|
|
156
|
-
retirementGoals = [];
|
|
157
|
-
retirementGoalsLoaded = !1;
|
|
158
|
-
retirementGoalAccounts = [];
|
|
159
|
-
retirementGoalAccountsLoaded = !1;
|
|
160
|
-
monthlyCashFlowProfile = void 0;
|
|
161
|
-
monthlyCashFlowProfileLoaded = !1;
|
|
162
|
-
newRetirementGoalAccounts = [];
|
|
163
|
-
alert = "";
|
|
164
|
-
selectedGoal = void 0;
|
|
165
|
-
constructor(e) {
|
|
166
|
-
this.globalStore = e, this.api = new _(e.endpoint, e.sessionToken, e.onError), S(this);
|
|
167
|
-
}
|
|
168
|
-
get allGoals() {
|
|
169
|
-
if (!this.isAllGoalDataLoaded) return [];
|
|
170
|
-
const e = this.globalStore.copyStore.copy.goals, t = this.globalStore.userStore.user.birthday;
|
|
171
|
-
return [
|
|
172
|
-
...this.goals,
|
|
173
|
-
...this.retirementGoals.map((o) => ({
|
|
174
|
-
...o,
|
|
175
|
-
amount: o.target_amount,
|
|
176
|
-
name: e.retirement,
|
|
177
|
-
track_type: i.RETIREMENT_TRACK,
|
|
178
|
-
projected_to_complete_at: o.retirement_age && t ? G(o.retirement_age, t) : void 0
|
|
179
|
-
}))
|
|
180
|
-
];
|
|
181
|
-
}
|
|
182
|
-
get orderedGoals() {
|
|
183
|
-
return this.allGoals.slice().sort((e, t) => e.position - t.position);
|
|
184
|
-
}
|
|
185
|
-
get debtGoals() {
|
|
186
|
-
return this.orderedGoals.filter((e) => e.track_type === i.DEBT_TRACK);
|
|
187
|
-
}
|
|
188
|
-
get retirmentGoals() {
|
|
189
|
-
return this.orderedGoals.filter((e) => e.track_type === i.RETIREMENT_TRACK);
|
|
190
|
-
}
|
|
191
|
-
get savingGoals() {
|
|
192
|
-
return this.orderedGoals.filter((e) => e.track_type === i.SAVINGS_TRACK);
|
|
193
|
-
}
|
|
194
|
-
get ongoingGoalsForMicroWidget() {
|
|
195
|
-
const e = this.allGoals.filter(
|
|
196
|
-
(o) => !o.is_complete && o.track_type !== i.EMERGENCY_FUND_TRACK && o.track_type !== null
|
|
197
|
-
), t = [
|
|
198
|
-
i.SAVINGS_TRACK,
|
|
199
|
-
i.DEBT_TRACK,
|
|
200
|
-
i.RETIREMENT_TRACK
|
|
201
|
-
];
|
|
202
|
-
return e.sort((o, r) => {
|
|
203
|
-
const n = o.track_type ? t.indexOf(o.track_type) : -1, c = r.track_type ? t.indexOf(r.track_type) : -1;
|
|
204
|
-
return n - c;
|
|
205
|
-
}).slice(0, 3);
|
|
206
|
-
}
|
|
207
|
-
get isAllGoalDataLoaded() {
|
|
208
|
-
return this.goalsLoaded && this.retirementGoalsLoaded && this.retirementGoalAccountsLoaded && this.monthlyCashFlowProfileLoaded;
|
|
209
|
-
}
|
|
210
|
-
setGoals = (e) => {
|
|
211
|
-
this.goals = e, this.goalsLoaded = !0;
|
|
212
|
-
};
|
|
213
|
-
setRetirementGoals = (e) => {
|
|
214
|
-
this.retirementGoals = e, this.retirementGoalsLoaded = !0;
|
|
215
|
-
};
|
|
216
|
-
setRetirementGoalAccounts = (e) => {
|
|
217
|
-
this.retirementGoalAccounts = e, this.retirementGoalAccountsLoaded = !0;
|
|
218
|
-
};
|
|
219
|
-
setMonthlyCashFlowProfile = (e) => {
|
|
220
|
-
this.monthlyCashFlowProfile = e, this.monthlyCashFlowProfileLoaded = !0;
|
|
221
|
-
};
|
|
222
|
-
loadGoalData = async () => {
|
|
223
|
-
await Promise.all([
|
|
224
|
-
this.loadGoals(),
|
|
225
|
-
this.loadRetirementGoals(),
|
|
226
|
-
this.loadRetirementGoalAccounts(),
|
|
227
|
-
this.loadMonthlyCashFlowProfile()
|
|
228
|
-
]);
|
|
229
|
-
};
|
|
230
|
-
loadGoals = async () => {
|
|
231
|
-
try {
|
|
232
|
-
const e = await this.api.getGoals();
|
|
233
|
-
this.setGoals(e);
|
|
234
|
-
} catch (e) {
|
|
235
|
-
console.error(`Error occured while getting goals: ${e}`);
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
loadRetirementGoals = async () => {
|
|
239
|
-
try {
|
|
240
|
-
const e = await this.api.getRetirementGoals();
|
|
241
|
-
this.setRetirementGoals(e);
|
|
242
|
-
} catch (e) {
|
|
243
|
-
console.error(`Error occurred while loading retirement goals: ${e}`);
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
loadRetirementGoalAccounts = async () => {
|
|
247
|
-
try {
|
|
248
|
-
const e = await this.api.getRetirementGoalAccounts();
|
|
249
|
-
this.setRetirementGoalAccounts(e);
|
|
250
|
-
} catch (e) {
|
|
251
|
-
console.error(`Error occurred while loading retirement goal accounts: ${e}`);
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
loadMonthlyCashFlowProfile = async () => {
|
|
255
|
-
try {
|
|
256
|
-
const e = await this.api.getMonthlyCashFlowProfile();
|
|
257
|
-
this.setMonthlyCashFlowProfile(e);
|
|
258
|
-
} catch (e) {
|
|
259
|
-
console.error(`Error occurred while loading monthly cash flow profile: ${e}`);
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
addGoal = async (e) => {
|
|
263
|
-
try {
|
|
264
|
-
const t = await this.api.addGoal(e);
|
|
265
|
-
this.setGoals([...this.goals, t]);
|
|
266
|
-
} catch (t) {
|
|
267
|
-
console.error(`Error occurred while adding goal: ${t}`);
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
addRetirementGoal = async (e) => {
|
|
271
|
-
const t = this.globalStore.copyStore.copy.goals;
|
|
272
|
-
try {
|
|
273
|
-
const o = await this.api.addRetirementGoal(e), r = [], n = this.globalStore.userStore.user.birthday;
|
|
274
|
-
for (const c of this.newRetirementGoalAccounts) {
|
|
275
|
-
const m = await this.api.addRetirementGoalAccount({
|
|
276
|
-
...c,
|
|
277
|
-
retirement_goal_guid: o.guid
|
|
278
|
-
});
|
|
279
|
-
r.push(m);
|
|
280
|
-
}
|
|
281
|
-
this.setNewRetirementGoalAccounts([]), this.retirementGoals = [
|
|
282
|
-
...this.retirementGoals,
|
|
283
|
-
{
|
|
284
|
-
...o,
|
|
285
|
-
amount: o.target_amount,
|
|
286
|
-
name: t.retirement,
|
|
287
|
-
track_type: i.RETIREMENT_TRACK,
|
|
288
|
-
projected_to_complete_at: o.retirement_age && n ? G(o.retirement_age, n) : void 0
|
|
289
|
-
}
|
|
290
|
-
], this.setRetirementGoalAccounts([...this.retirementGoalAccounts, ...r]);
|
|
291
|
-
} catch (o) {
|
|
292
|
-
console.error(`Error occurred while adding retirement goal: ${o}`);
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
addRetirementGoalAccount = async (e) => {
|
|
296
|
-
try {
|
|
297
|
-
const t = await this.api.addRetirementGoalAccount(e);
|
|
298
|
-
h(() => {
|
|
299
|
-
this.retirementGoalAccounts = [...this.retirementGoalAccounts, t];
|
|
300
|
-
});
|
|
301
|
-
} catch (t) {
|
|
302
|
-
console.error(`Error occurred while adding retirement goal account: ${t}`);
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
deleteGoal = async (e) => {
|
|
306
|
-
try {
|
|
307
|
-
await this.api.removeGoal(e);
|
|
308
|
-
const t = this.goals.findIndex((o) => o.guid === e);
|
|
309
|
-
t >= 0 && this.goals.splice(t, 1);
|
|
310
|
-
} catch (t) {
|
|
311
|
-
console.error(`Error occured while deleting goal: ${t}`);
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
deleteRetirementGoal = async (e) => {
|
|
315
|
-
try {
|
|
316
|
-
const t = this.retirementGoalAccounts.filter(
|
|
317
|
-
(r) => r.retirement_goal_guid === e.guid
|
|
318
|
-
);
|
|
319
|
-
for (const r of t)
|
|
320
|
-
await this.deleteRetirementGoalAccount(r.guid);
|
|
321
|
-
await this.api.removeRetirementGoal(e.guid);
|
|
322
|
-
const o = this.retirementGoals.findIndex((r) => r.guid === e.guid);
|
|
323
|
-
o >= 0 && this.retirementGoals.splice(o, 1);
|
|
324
|
-
} catch (t) {
|
|
325
|
-
console.error(`Error deleting retirement goal: ${t}`);
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
deleteRetirementGoalAccount = async (e) => {
|
|
329
|
-
try {
|
|
330
|
-
await this.api.removeRetirementGoalAccount(e);
|
|
331
|
-
const t = this.retirementGoalAccounts.findIndex((o) => o.guid === e);
|
|
332
|
-
t >= 0 && this.retirementGoalAccounts.splice(t, 1);
|
|
333
|
-
} catch (t) {
|
|
334
|
-
console.error(`Error deleting retirement goal account: ${t}`);
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
reorderGoals = async (e) => {
|
|
338
|
-
try {
|
|
339
|
-
const t = await this.api.reorderGoals(e);
|
|
340
|
-
h(() => {
|
|
341
|
-
for (const o of t) {
|
|
342
|
-
const r = this.goals.findIndex((n) => n.guid === o.guid);
|
|
343
|
-
r >= 0 && (this.goals[r].position = o.position);
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
} catch (t) {
|
|
347
|
-
console.error(`Error reordering goals: ${t}`);
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
setAlert = (e) => this.alert = e;
|
|
351
|
-
setNewRetirementGoalAccounts = (e) => {
|
|
352
|
-
this.newRetirementGoalAccounts = e;
|
|
353
|
-
};
|
|
354
|
-
setSelectedGoal = (e) => this.selectedGoal = e;
|
|
355
|
-
updateGoal = async (e) => {
|
|
356
|
-
try {
|
|
357
|
-
const t = await this.api.updateGoal(e);
|
|
358
|
-
h(() => {
|
|
359
|
-
const o = this.goals.findIndex((r) => r.guid === e.guid);
|
|
360
|
-
o >= 0 && (this.goals[o] = t), this.selectedGoal?.guid === e.guid && this.setSelectedGoal(t);
|
|
361
|
-
});
|
|
362
|
-
} catch (t) {
|
|
363
|
-
console.error(`Error occurred while updating goal: ${t}`);
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
updateRetirementGoal = async (e) => {
|
|
367
|
-
try {
|
|
368
|
-
const t = await this.api.updateRetirementGoal({
|
|
369
|
-
...e,
|
|
370
|
-
target_amount: e.amount
|
|
371
|
-
});
|
|
372
|
-
h(() => {
|
|
373
|
-
const o = this.retirementGoals.findIndex((r) => r.guid === e.guid);
|
|
374
|
-
o >= 0 && (this.retirementGoals[o] = t), this.selectedGoal?.guid === e.guid && this.setSelectedGoal(this.allGoals.find((r) => r.guid === e.guid));
|
|
375
|
-
});
|
|
376
|
-
} catch (t) {
|
|
377
|
-
console.error(`Error occurred while updating goal: ${t}`);
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
updateMonthlyCashFlowProfile = async (e) => {
|
|
381
|
-
try {
|
|
382
|
-
const t = await this.api.updateMonthlyCashFlowProfile(e);
|
|
383
|
-
this.setMonthlyCashFlowProfile(t);
|
|
384
|
-
} catch (t) {
|
|
385
|
-
console.error(`Error occurred while updating monthly Cash Flow profile: ${t}`);
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
export {
|
|
390
|
-
ee as C,
|
|
391
|
-
ae as G,
|
|
392
|
-
re as a,
|
|
393
|
-
oe as b,
|
|
394
|
-
te as g
|
|
395
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const s = {
|
|
2
|
-
EN_US: "en-us",
|
|
3
|
-
EN_CA: "en-ca",
|
|
4
|
-
FR: "fr",
|
|
5
|
-
FR_CA: "fr-ca",
|
|
6
|
-
ES: "es"
|
|
7
|
-
}, o = Object.values(s), r = () => {
|
|
8
|
-
const n = s.EN_US, e = window?.app?.options?.language?.toLowerCase() ?? "", a = window.navigator.language.toLowerCase();
|
|
9
|
-
return e === "browser" && o.includes(a) ? a : o.includes(e) ? e : n;
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
s as L,
|
|
13
|
-
o as V,
|
|
14
|
-
r as g
|
|
15
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import d from "react";
|
|
2
|
-
const h = /(?<static>.*?)(?<dynamic>(?:_\d+{(?:.*?)}))|(?<staticEnd>.+)/g, b = (n, ...e) => {
|
|
3
|
-
if (!n) return "";
|
|
4
|
-
const s = e.some((o) => typeof o != "string"), i = [...n.matchAll(h)].reduce(
|
|
5
|
-
(o, u, l) => {
|
|
6
|
-
const c = [...o], t = u.groups;
|
|
7
|
-
if (t?.static && c.push(t.static), t?.dynamic) {
|
|
8
|
-
const m = t.dynamic.indexOf("{"), p = t.dynamic.substring(m + 1, t.dynamic.length - 1), a = Number(t.dynamic.substring(1, m));
|
|
9
|
-
if (d.isValidElement(e[a - 1])) {
|
|
10
|
-
const y = e[a - 1], f = d.cloneElement(y, {
|
|
11
|
-
key: `${p}-${l}`
|
|
12
|
-
});
|
|
13
|
-
c.push(f);
|
|
14
|
-
} else
|
|
15
|
-
c.push(e[a - 1]);
|
|
16
|
-
}
|
|
17
|
-
return t?.staticEnd && c.push(t.staticEnd), c;
|
|
18
|
-
},
|
|
19
|
-
[]
|
|
20
|
-
);
|
|
21
|
-
return s ? i : i.join("");
|
|
22
|
-
}, g = (n, e, s, ...r) => !n || !e ? "" : b(s === 1 ? n : e, ...r);
|
|
23
|
-
export {
|
|
24
|
-
g as a,
|
|
25
|
-
b
|
|
26
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { F as s, A as h } from "./ApiEndpoints-C5IA97i7.mjs";
|
|
2
|
-
class o {
|
|
3
|
-
fetchInstance;
|
|
4
|
-
constructor(t, e, a) {
|
|
5
|
-
this.fetchInstance = new s(t, e, void 0, a);
|
|
6
|
-
}
|
|
7
|
-
getMerchants = async (t = [], e = [], a = 1, r = 25) => {
|
|
8
|
-
let c = h.MERCHANTS;
|
|
9
|
-
return c += `?page=${a}&per_page=${r}`, t.length && t.forEach((n) => c += `&fuzzy_name[]=${n}`), e.length && e.forEach((n) => c += `&guid[]=${n}`), this.fetchInstance.get(c).then((n) => n.merchants);
|
|
10
|
-
};
|
|
11
|
-
getMerchantByGuid = async (t) => this.fetchInstance.get(`${h.MERCHANTS}/${t}`).then((e) => e.merchant);
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
o as M
|
|
15
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { makeAutoObservable as i, runInAction as s } from "mobx";
|
|
2
|
-
import { M as n } from "./MerchantApi-D8ahYxiG.mjs";
|
|
3
|
-
class c {
|
|
4
|
-
globalStore;
|
|
5
|
-
api = new n("/", "");
|
|
6
|
-
merchant = null;
|
|
7
|
-
merchants = [];
|
|
8
|
-
isLoading = !1;
|
|
9
|
-
constructor(t) {
|
|
10
|
-
this.globalStore = t, this.api = new n(t.endpoint, t.sessionToken, t.onError), i(this);
|
|
11
|
-
}
|
|
12
|
-
loadMerchants = async (t = "") => {
|
|
13
|
-
this.isLoading = !0;
|
|
14
|
-
const a = await this.api.getMerchants([t]);
|
|
15
|
-
s(() => {
|
|
16
|
-
this.merchants = a, this.isLoading = !1;
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
loadMerchantByGuid = async (t) => {
|
|
20
|
-
const a = await this.api.getMerchantByGuid(t);
|
|
21
|
-
s(() => this.merchant = a);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
c as M
|
|
26
|
-
};
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { makeAutoObservable as p } from "mobx";
|
|
2
|
-
import { A as m } from "./AccountApi-WEM2M9tg.mjs";
|
|
3
|
-
import { format as B } from "date-fns/format";
|
|
4
|
-
import { fromUnixTime as W } from "date-fns/fromUnixTime";
|
|
5
|
-
import { startOfMonth as D } from "date-fns/startOfMonth";
|
|
6
|
-
import { subMonths as _ } from "date-fns/subMonths";
|
|
7
|
-
import { a as f } from "./Accounts-DX3xJE97.mjs";
|
|
8
|
-
import { e as L, f as M, a as v } from "./Account-CMjOp7S2.mjs";
|
|
9
|
-
const A = 13, I = (n, t) => n.filter((e) => {
|
|
10
|
-
const { is_closed: o, is_deleted: s, is_hidden: a, is_manual: c } = e;
|
|
11
|
-
return o || s || a ? !1 : c || !e.guid ? !0 : t.some((l) => n.some((u) => l.guid === u.member_guid));
|
|
12
|
-
}), N = (n, t) => [...n, ...t], g = (n) => {
|
|
13
|
-
if (n && n.length > 0)
|
|
14
|
-
return n[n.length - 1];
|
|
15
|
-
}, S = (n, t) => n.year_month - t.year_month, x = () => Array.from({ length: A }, (n, t) => Math.floor(D(_(/* @__PURE__ */ new Date(), t)).getTime() / 1e3)).sort(), T = (n, t, e) => !n.length || !t.length ? [] : x().reduceRight((s, a) => {
|
|
16
|
-
const c = t.filter(
|
|
17
|
-
({ year_month: r }) => r === parseInt(B(W(a), "yyyyMM"))
|
|
18
|
-
), l = n.map((r) => {
|
|
19
|
-
const i = c.find((h) => h.account_guid === r.guid), d = {
|
|
20
|
-
change: 0,
|
|
21
|
-
guid: r.guid,
|
|
22
|
-
name: r.name,
|
|
23
|
-
type: r.account_type,
|
|
24
|
-
balance: 0
|
|
25
|
-
};
|
|
26
|
-
if (!i && s.length === 0 && !r.balance) return d;
|
|
27
|
-
if (!i && s.length === 0)
|
|
28
|
-
return {
|
|
29
|
-
...d,
|
|
30
|
-
value: f(r) ? -(r.balance ?? 0) : r.balance ?? 0
|
|
31
|
-
};
|
|
32
|
-
if (!i) {
|
|
33
|
-
const h = s[0].accounts.find((b) => b.guid === r.guid);
|
|
34
|
-
return h || d;
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
change: i.transaction_total,
|
|
38
|
-
guid: r.guid,
|
|
39
|
-
name: r.name,
|
|
40
|
-
type: r.account_type,
|
|
41
|
-
value: i.balance
|
|
42
|
-
};
|
|
43
|
-
}), { y: u, change: y } = l.reduce(
|
|
44
|
-
(r, i) => ({
|
|
45
|
-
y: r.y + (i.value || 0),
|
|
46
|
-
change: r.change + (i.change || 0)
|
|
47
|
-
}),
|
|
48
|
-
{ y: 0, change: 0 }
|
|
49
|
-
);
|
|
50
|
-
return [
|
|
51
|
-
{
|
|
52
|
-
accounts: l,
|
|
53
|
-
x: a,
|
|
54
|
-
y: u,
|
|
55
|
-
change: y
|
|
56
|
-
},
|
|
57
|
-
...s
|
|
58
|
-
];
|
|
59
|
-
}, []).slice(A - e), C = (n) => {
|
|
60
|
-
const t = [], e = [];
|
|
61
|
-
let o = 0, s = 0;
|
|
62
|
-
return n?.accounts.forEach((a) => {
|
|
63
|
-
a.change > 0 && (t.push({ accountName: a.name, gain: a.change }), o += a.change), a.change < 0 && (e.push({ accountName: a.name, loss: a.change }), s += a.change);
|
|
64
|
-
}), { netWorth: n, gains: t, losses: e, totalGains: o, totalLosses: s };
|
|
65
|
-
}, w = (n) => {
|
|
66
|
-
const t = [], e = [];
|
|
67
|
-
let o = 0, s = 0;
|
|
68
|
-
return n.forEach((a) => {
|
|
69
|
-
if (f(a)) {
|
|
70
|
-
const c = a.balance ?? 0;
|
|
71
|
-
e.push({ accountName: a.name, accountType: a.account_type, balance: c }), s += c;
|
|
72
|
-
} else {
|
|
73
|
-
const c = a.balance ?? 0;
|
|
74
|
-
t.push({ accountName: a.name, accountType: a.account_type, balance: c }), o += c;
|
|
75
|
-
}
|
|
76
|
-
}), { assets: t, liabilities: e, totalAssets: o, totalLiabilities: s };
|
|
77
|
-
}, z = (n) => {
|
|
78
|
-
const t = n.reduce((e, o) => {
|
|
79
|
-
const s = o.accountType;
|
|
80
|
-
return e[s] || (e[s] = []), e[s].push(o), e;
|
|
81
|
-
}, {});
|
|
82
|
-
return Object.entries(t).map(([e, o]) => ({
|
|
83
|
-
icon: M[+e] || v[+e],
|
|
84
|
-
name: L[+e],
|
|
85
|
-
accounts: o
|
|
86
|
-
}));
|
|
87
|
-
};
|
|
88
|
-
class P {
|
|
89
|
-
globalStore;
|
|
90
|
-
accountsApi = new m("/", "");
|
|
91
|
-
monthlyAccountBalances = [];
|
|
92
|
-
monthlyAccountBalancesLoaded = !1;
|
|
93
|
-
hoveredIndex = -1;
|
|
94
|
-
selectedIndex = -1;
|
|
95
|
-
timeframe = 6;
|
|
96
|
-
// default timeframe is 6 months
|
|
97
|
-
constructor(t) {
|
|
98
|
-
this.globalStore = t, this.accountsApi = new m(
|
|
99
|
-
t.endpoint,
|
|
100
|
-
t.sessionToken,
|
|
101
|
-
t.onError
|
|
102
|
-
), p(this);
|
|
103
|
-
}
|
|
104
|
-
get isNetWorthDataLoaded() {
|
|
105
|
-
return this.globalStore.accountStore.isAccountDataLoaded && this.monthlyAccountBalancesLoaded;
|
|
106
|
-
}
|
|
107
|
-
get netWorthAccounts() {
|
|
108
|
-
return I(
|
|
109
|
-
this.globalStore.globalUiStore.selectedAccounts,
|
|
110
|
-
this.globalStore.accountStore.members
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
get netWorthData() {
|
|
114
|
-
return {
|
|
115
|
-
accounts: this.netWorthAccounts,
|
|
116
|
-
monthlyAccountBalances: this.monthlyAccountBalances
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
get netWorthChartData() {
|
|
120
|
-
return T(this.netWorthAccounts, this.monthlyAccountBalances, this.timeframe);
|
|
121
|
-
}
|
|
122
|
-
get selectedData() {
|
|
123
|
-
if (!(!this.netWorthChartData || this.netWorthChartData.length === 0))
|
|
124
|
-
return this.selectedIndex === -1 ? g(this.netWorthChartData) : this.netWorthChartData[this.selectedIndex];
|
|
125
|
-
}
|
|
126
|
-
get hoveredData() {
|
|
127
|
-
return this.hoveredIndex >= 0 ? this.netWorthChartData[this.hoveredIndex] : void 0;
|
|
128
|
-
}
|
|
129
|
-
get gainsLosses() {
|
|
130
|
-
return C(this.selectedData);
|
|
131
|
-
}
|
|
132
|
-
get assetsLiabilities() {
|
|
133
|
-
const { assets: t, liabilities: e, totalAssets: o, totalLiabilities: s } = w(
|
|
134
|
-
this.netWorthData.accounts
|
|
135
|
-
);
|
|
136
|
-
return {
|
|
137
|
-
netWorth: g(this.netWorthChartData),
|
|
138
|
-
assets: t,
|
|
139
|
-
liabilities: e,
|
|
140
|
-
totalAssets: o,
|
|
141
|
-
totalLiabilities: s
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
loadNetWorthData = async () => {
|
|
145
|
-
this.globalStore.accountStore.isAccountDataLoaded || await this.globalStore.accountStore.loadAccountData();
|
|
146
|
-
const e = (await Promise.all(
|
|
147
|
-
this.netWorthAccounts.map((o) => this.getMonthlyAccountBalances(o.guid))
|
|
148
|
-
)).reduce(N, []).sort(S);
|
|
149
|
-
this.setMonthlyAccountBalances(e);
|
|
150
|
-
};
|
|
151
|
-
getMonthlyAccountBalances = async (t) => {
|
|
152
|
-
try {
|
|
153
|
-
return await this.accountsApi.getMonthlyAccountBalances(t);
|
|
154
|
-
} catch (e) {
|
|
155
|
-
return console.error(`Error occured while fetching monthly account balances: ${e}`), [];
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
setHoveredIndex = (t) => this.hoveredIndex = t;
|
|
159
|
-
setMonthlyAccountBalances = (t) => {
|
|
160
|
-
this.monthlyAccountBalances = t, this.monthlyAccountBalancesLoaded = !0;
|
|
161
|
-
};
|
|
162
|
-
setSelectedIndex = (t) => this.selectedIndex = t;
|
|
163
|
-
setTimeframe = (t) => this.timeframe = t;
|
|
164
|
-
}
|
|
165
|
-
export {
|
|
166
|
-
P as N,
|
|
167
|
-
z as g
|
|
168
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { F as a, A as i } from "./ApiEndpoints-C5IA97i7.mjs";
|
|
2
|
-
class o {
|
|
3
|
-
fetchInstance;
|
|
4
|
-
constructor(t, e, n) {
|
|
5
|
-
this.fetchInstance = new a(t, e, void 0, n);
|
|
6
|
-
}
|
|
7
|
-
getNotifications = () => this.fetchInstance.get(i.NOTIFICATIONS).then(
|
|
8
|
-
(t) => t.notifications.map((e) => e.notification)
|
|
9
|
-
).finally();
|
|
10
|
-
updateNotification = (t) => this.fetchInstance.put(`${i.NOTIFICATIONS}/${t.guid}`, {
|
|
11
|
-
guid: t.guid,
|
|
12
|
-
has_been_viewed: t.has_been_viewed
|
|
13
|
-
}).then((e) => e.notification).finally();
|
|
14
|
-
// Note: The notifications/mark_all_as_viewed endpoint is broken, but still returns 202.
|
|
15
|
-
// A bug ticket has been filed to fix it, but should not require any changes here.
|
|
16
|
-
markAllAsViewed = (t) => this.fetchInstance.put(`${i.NOTIFICATIONS}/mark_all_as_viewed`, { channel: t }).finally();
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
o as N
|
|
20
|
-
};
|