@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.sms1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +128 -1
- package/dist/{Account-Bxw0_4FU.mjs → Account-BDXA6PWh.mjs} +1 -1
- package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-CUztd3-b.mjs} +87 -83
- package/dist/AccountDetailsHeader-i3KFhNuo.mjs +87 -0
- package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-QZspYAji.mjs} +6 -6
- package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-DX5upmCS.mjs} +5 -5
- package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-BcnDpyLL.mjs} +19 -8
- package/dist/{Accounts-BRf_YeTf.mjs → Accounts-DXfZotRC.mjs} +1 -1
- package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
- package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
- package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-Df2nII9u.mjs} +2 -2
- package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-DqJK_rrL.mjs} +23 -21
- package/dist/{CategoryStore-yHI0hWmK.mjs → CategoryStore-DTgyAMM7.mjs} +12 -10
- package/dist/{CategoryUtil-pZRIYOgN.mjs → CategoryUtil-C5cR-nfQ.mjs} +1 -1
- package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-BIbTqYOH.mjs} +2 -2
- package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-BFfY3_zB.mjs} +3 -3
- package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-BFKcs-_K.mjs} +2 -2
- package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
- package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
- package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-BbJB0nmu.mjs} +1 -1
- package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
- package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
- package/dist/Drawer-BEtCk82g.mjs +163 -0
- package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
- package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-DzTrtPzk.mjs} +3 -3
- package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
- package/dist/FinstrongStore-BIrX0Xg2.mjs +451 -0
- package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-DpWY3gVb.mjs} +5 -5
- package/dist/{Help-B6dIcujh.mjs → Help-BnPXM_N2.mjs} +2 -2
- package/dist/LineChart-bc1D9xBE.mjs +581 -0
- package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-uobBrm_a.mjs} +10 -10
- package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-NpXHhO1n.mjs} +177 -174
- package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
- package/dist/{MicroWidgetContainer-DpeqN9n3.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
- package/dist/{MiniWidgetContainer-D0gfmbaF.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
- package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-lsuhEpn6.mjs} +2 -2
- package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-CNmJWVeI.mjs} +241 -238
- package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-Ck2KdNmT.mjs} +10 -10
- package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
- package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-DK8_LkPz.mjs} +4 -4
- package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-CqZh1SQa.mjs} +17 -17
- package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-BKcYmpv3.mjs} +46 -45
- package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-Ni5tSQIO.mjs} +80 -73
- package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
- package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
- package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-BuJ03S9d.mjs} +16 -16
- package/dist/SpendingLegend-CjX-hX2O.mjs +193 -0
- package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
- package/dist/TransactionApi-CjBoLleL.mjs +86 -0
- package/dist/TransactionDetails-5M2vfr59.mjs +1379 -0
- package/dist/{TransactionStore-ai3uII_r.mjs → TransactionStore-D-Q3BU9Z.mjs} +119 -121
- package/dist/TrendsStore-BW9FGQeE.mjs +182 -0
- package/dist/{User-BQUxBeZV.mjs → User-wXzDI4M8.mjs} +2 -2
- package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-C0832BMe.mjs} +702 -723
- package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-BhQ1Kx2z.mjs} +4 -4
- package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
- package/dist/accounts/index.es.js +229 -222
- package/dist/accounts/stores/AccountStore.d.ts +2 -0
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +380 -382
- package/dist/cashflow/index.es.js +405 -413
- package/dist/categories/index.es.js +2 -2
- package/dist/categories/stores/CategoryStore.d.ts +1 -1
- package/dist/common/components/ErrorBoundary.d.ts +1 -1
- package/dist/common/components/Select.d.ts +4 -2
- package/dist/common/components/charts/LineChart.d.ts +12 -2
- package/dist/common/components/charts/index.d.ts +0 -3
- package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
- package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
- package/dist/common/components/drawer/Drawer.d.ts +3 -0
- package/dist/common/components/drawer/Footer.d.ts +17 -0
- package/dist/common/hooks/index.d.ts +0 -1
- package/dist/common/hooks/useAriaLive.d.ts +1 -1
- package/dist/common/index.es.js +320 -321
- package/dist/common/stores/GlobalStore.d.ts +7 -1
- package/dist/common/types/Finstrong.d.ts +54 -0
- package/dist/common/types/Global.d.ts +1 -0
- package/dist/common/types/Widgets.d.ts +1 -0
- package/dist/common/types/index.d.ts +1 -1
- package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
- package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
- package/dist/dashboard/index.es.js +2 -2
- package/dist/debts/index.es.js +506 -498
- package/dist/exportTransactionsToCSV-Cz2t0lmA.mjs +48 -0
- package/dist/finstrong/FinstrongWidget.d.ts +1 -1
- package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
- package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
- package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
- package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
- package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
- package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
- package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
- package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
- package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
- package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
- package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
- package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
- package/dist/finstrong/components/ProgressBar.d.ts +15 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
- package/dist/finstrong/components/StatusChip.d.ts +5 -0
- package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
- package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
- package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
- package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
- package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
- package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
- package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
- package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
- package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
- package/dist/finstrong/constants/index.d.ts +9 -0
- package/dist/finstrong/index.es.js +3171 -1063
- package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
- package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
- package/dist/goals/index.es.js +566 -562
- package/dist/help/index.es.js +3 -3
- package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
- package/dist/insights/index.es.js +1 -1
- package/dist/investments/index.es.js +437 -435
- package/dist/merchants/index.es.js +2 -2
- package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
- package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
- package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
- package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
- package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
- package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
- package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
- package/dist/microinsights/carousel/BeatList.d.ts +10 -0
- package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
- package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
- package/dist/microinsights/constants/App.d.ts +0 -1
- package/dist/microinsights/index.d.ts +3 -3
- package/dist/microinsights/index.es.js +7 -7
- package/dist/microinsights/interfaces.d.ts +0 -6
- package/dist/networth/index.es.js +188 -186
- package/dist/notifications/index.es.js +95 -96
- package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
- package/dist/recurringtransactions/index.es.js +584 -560
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +1 -0
- package/dist/settings/index.es.js +286 -280
- package/dist/spending/index.es.js +269 -421
- package/dist/spending/utils/SpendingData.d.ts +2 -1
- package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
- package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
- package/dist/transactions/index.es.js +226 -220
- package/dist/transactions/stores/TransactionStore.d.ts +1 -1
- package/dist/transactions/stores/UiStore.d.ts +0 -2
- package/dist/trends/index.es.js +963 -586
- package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-CFNF8766.mjs} +2 -2
- package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
- package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
- package/package.json +7 -7
- package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
- package/dist/Drawer-kEE73B87.mjs +0 -113
- package/dist/FinstrongStore-F2c607dj.mjs +0 -101
- package/dist/LineChart-D4GI7nVh.mjs +0 -541
- package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
- package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
- package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
- package/dist/common/hooks/usePrevious.d.ts +0 -2
- package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
- package/dist/finstrong/utils/Finstrong.d.ts +0 -6
- package/dist/useAriaLive-B3_pRUio.mjs +0 -35
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
2
|
import M from "@mui/material/Box";
|
|
3
3
|
import H from "@mui/material/FormControlLabel";
|
|
4
4
|
import P from "@mui/material/Radio";
|
|
@@ -12,15 +12,15 @@ import { isBefore as v } from "date-fns/isBefore";
|
|
|
12
12
|
import { startOfMonth as h } from "date-fns/startOfMonth";
|
|
13
13
|
import { startOfToday as m } from "date-fns/startOfToday";
|
|
14
14
|
import { subDays as B } from "date-fns/subDays";
|
|
15
|
-
import { O as
|
|
16
|
-
import { T as
|
|
15
|
+
import { O as o, a as y, T as b } from "./User-wXzDI4M8.mjs";
|
|
16
|
+
import { T as L } from "./TransactionApi-CjBoLleL.mjs";
|
|
17
17
|
import { b as Y } from "./Category-CevNQ03n.mjs";
|
|
18
|
-
import { f as F } from "./exportTransactionsToCSV-
|
|
18
|
+
import { f as F } from "./exportTransactionsToCSV-Cz2t0lmA.mjs";
|
|
19
19
|
import { format as W } from "date-fns/format";
|
|
20
|
-
import { fromUnixTime as
|
|
21
|
-
import { f as
|
|
22
|
-
import { endOfMonth as
|
|
23
|
-
import { B as
|
|
20
|
+
import { fromUnixTime as $ } from "date-fns/fromUnixTime";
|
|
21
|
+
import { f as I, a as C, O as k } from "./Dialog-BPTr3qHE.mjs";
|
|
22
|
+
import { endOfMonth as z } from "date-fns/endOfMonth";
|
|
23
|
+
import { B as u } from "./BeatApi-De2IaqH2.mjs";
|
|
24
24
|
const X = ({
|
|
25
25
|
checked: l = !1,
|
|
26
26
|
label: t,
|
|
@@ -29,7 +29,7 @@ const X = ({
|
|
|
29
29
|
value: A
|
|
30
30
|
}) => {
|
|
31
31
|
const d = U(), s = d.palette.mode === "light" ? d.palette.grey[400] : d.palette.grey[700], c = l ? d.palette.action.active : s;
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ g(
|
|
33
33
|
M,
|
|
34
34
|
{
|
|
35
35
|
bgcolor: "background.paper",
|
|
@@ -41,10 +41,10 @@ const X = ({
|
|
|
41
41
|
pr: 8,
|
|
42
42
|
py: 4,
|
|
43
43
|
sx: { "&:hover": { borderColor: d.palette.action.active }, ...a },
|
|
44
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ g(K, { title: e, children: /* @__PURE__ */ g(
|
|
45
45
|
H,
|
|
46
46
|
{
|
|
47
|
-
control: /* @__PURE__ */
|
|
47
|
+
control: /* @__PURE__ */ g(
|
|
48
48
|
P,
|
|
49
49
|
{
|
|
50
50
|
disableRipple: !0,
|
|
@@ -71,7 +71,7 @@ const X = ({
|
|
|
71
71
|
left: "flex-start",
|
|
72
72
|
right: "flex-end"
|
|
73
73
|
}
|
|
74
|
-
},
|
|
74
|
+
}, n = {
|
|
75
75
|
ADD: "Add",
|
|
76
76
|
ADD_CATEGORY: "Add Category",
|
|
77
77
|
CHANGE_CATEGORY: "Change Category",
|
|
@@ -110,215 +110,215 @@ const X = ({
|
|
|
110
110
|
UNHIDE_TRANSACTION: "Unhide Transaction"
|
|
111
111
|
}, R = {
|
|
112
112
|
// splits
|
|
113
|
-
[
|
|
114
|
-
action:
|
|
113
|
+
[o.ON_TRANSACTION_SPLIT_CLICK]: {
|
|
114
|
+
action: n.SELECT,
|
|
115
115
|
category: T.TRANSACTION_DETAILS,
|
|
116
116
|
label: r.SPLITS
|
|
117
117
|
},
|
|
118
|
-
[
|
|
119
|
-
action:
|
|
118
|
+
[o.ON_TRANSACTION_SPLIT_CATEGORY_CLICK]: {
|
|
119
|
+
action: n.ADD_CATEGORY,
|
|
120
120
|
category: T.TRANSACTION_DETAILS,
|
|
121
121
|
label: r.SPLITS
|
|
122
122
|
},
|
|
123
|
-
[
|
|
124
|
-
action:
|
|
123
|
+
[o.ON_TRANSACTION_SPLIT_DELETE_CLICK]: {
|
|
124
|
+
action: n.DELETE,
|
|
125
125
|
category: T.TRANSACTION_DETAILS,
|
|
126
126
|
label: r.SPLITS
|
|
127
127
|
},
|
|
128
|
-
[
|
|
129
|
-
action:
|
|
128
|
+
[o.ON_TRANSACTION_SPLIT_SAVE_CLICK]: {
|
|
129
|
+
action: n.SPLIT,
|
|
130
130
|
category: T.TRANSACTION_DETAILS,
|
|
131
131
|
label: r.SPLITS
|
|
132
132
|
},
|
|
133
|
-
[
|
|
134
|
-
action:
|
|
133
|
+
[o.ON_TRANSACTION_UNSPLIT]: {
|
|
134
|
+
action: n.UNSPLIT,
|
|
135
135
|
category: T.TRANSACTION_DETAILS,
|
|
136
136
|
label: r.SPLITS
|
|
137
137
|
},
|
|
138
138
|
// category
|
|
139
|
-
[
|
|
140
|
-
action:
|
|
139
|
+
[o.ON_TRANSACTION_CATEGORY_CLICK]: {
|
|
140
|
+
action: n.SELECT,
|
|
141
141
|
category: T.TRANSACTIONS_LIST,
|
|
142
142
|
label: r.CATEGORY
|
|
143
143
|
},
|
|
144
|
-
[
|
|
145
|
-
action:
|
|
144
|
+
[o.ON_TRANSACTION_CATEGORY_CHANGED]: {
|
|
145
|
+
action: n.CHANGE_CATEGORY,
|
|
146
146
|
category: T.TRANSACTION_DETAILS,
|
|
147
147
|
label: r.CATEGORY
|
|
148
148
|
},
|
|
149
149
|
// date
|
|
150
|
-
[
|
|
151
|
-
action:
|
|
150
|
+
[o.ON_TRANSACTION_DATE_CHANGED]: {
|
|
151
|
+
action: n.SAVE,
|
|
152
152
|
category: T.TRANSACTION_DETAILS,
|
|
153
153
|
label: r.DATE
|
|
154
154
|
},
|
|
155
|
-
[
|
|
156
|
-
action:
|
|
155
|
+
[o.ON_TRANSACTION_DATE_CLICK]: {
|
|
156
|
+
action: n.SELECT,
|
|
157
157
|
category: T.TRANSACTION_DETAILS,
|
|
158
158
|
label: r.DATE
|
|
159
159
|
},
|
|
160
160
|
// merchant logo
|
|
161
|
-
[
|
|
162
|
-
action:
|
|
161
|
+
[o.ON_TRANSACTION_DELETE_LOGO_CANCEL]: {
|
|
162
|
+
action: n.CLOSE,
|
|
163
163
|
category: T.TRANSACTION_DETAILS,
|
|
164
164
|
label: r.DELETE_MERCHANT_LOGO
|
|
165
165
|
},
|
|
166
|
-
[
|
|
167
|
-
action:
|
|
166
|
+
[o.ON_TRANSACTION_DELETE_LOGO_CLICK]: {
|
|
167
|
+
action: n.SELECT,
|
|
168
168
|
category: T.TRANSACTION_DETAILS,
|
|
169
169
|
label: r.DELETE_MERCHANT_LOGO
|
|
170
170
|
},
|
|
171
|
-
[
|
|
172
|
-
action:
|
|
171
|
+
[o.ON_TRANSACTION_DELETE_LOGO_DELETED]: {
|
|
172
|
+
action: n.DELETE,
|
|
173
173
|
category: T.TRANSACTION_DETAILS,
|
|
174
174
|
label: r.DELETE_MERCHANT_LOGO
|
|
175
175
|
},
|
|
176
176
|
// description
|
|
177
|
-
[
|
|
178
|
-
action:
|
|
177
|
+
[o.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK]: {
|
|
178
|
+
action: n.EDIT,
|
|
179
179
|
category: T.TRANSACTION_DETAILS,
|
|
180
180
|
label: r.DESCRIPTION
|
|
181
181
|
},
|
|
182
|
-
[
|
|
183
|
-
action:
|
|
182
|
+
[o.ON_TRANSACTION_DESCRIPTION_SAVE_CLICK]: {
|
|
183
|
+
action: n.SAVE,
|
|
184
184
|
category: T.TRANSACTION_DETAILS,
|
|
185
185
|
label: r.DESCRIPTION
|
|
186
186
|
},
|
|
187
187
|
// hide transactions
|
|
188
|
-
[
|
|
189
|
-
action:
|
|
188
|
+
[o.ON_TRANSACTION_HIDDEN]: {
|
|
189
|
+
action: n.SAVE,
|
|
190
190
|
category: T.TRANSACTION_DETAILS,
|
|
191
191
|
label: r.HIDE_TRANSACTION
|
|
192
192
|
},
|
|
193
|
-
[
|
|
194
|
-
action:
|
|
193
|
+
[o.ON_TRANSACTION_HIDE_CLICK]: {
|
|
194
|
+
action: n.SELECT,
|
|
195
195
|
category: T.TRANSACTION_DETAILS,
|
|
196
196
|
label: r.HIDE_TRANSACTION
|
|
197
197
|
},
|
|
198
|
-
[
|
|
199
|
-
action:
|
|
198
|
+
[o.ON_TRANSACTION_HIDE_CANCEL_CLICK]: {
|
|
199
|
+
action: n.CLOSE,
|
|
200
200
|
category: T.TRANSACTION_DETAILS,
|
|
201
201
|
label: r.HIDE_TRANSACTION
|
|
202
202
|
},
|
|
203
203
|
// transaction list
|
|
204
|
-
[
|
|
205
|
-
action:
|
|
204
|
+
[o.ON_TRANSACTION_LIST_ITEM_CLICK]: {
|
|
205
|
+
action: n.SELECT,
|
|
206
206
|
category: T.TRANSACTIONS_LIST,
|
|
207
207
|
label: r.TRANSACTION
|
|
208
208
|
},
|
|
209
209
|
// memo
|
|
210
|
-
[
|
|
211
|
-
action:
|
|
210
|
+
[o.ON_TRANSACTION_MEMO_CHANGED]: {
|
|
211
|
+
action: n.SAVE,
|
|
212
212
|
category: T.TRANSACTION_DETAILS,
|
|
213
213
|
label: r.MEMO
|
|
214
214
|
},
|
|
215
|
-
[
|
|
216
|
-
action:
|
|
215
|
+
[o.ON_TRANSACTION_MEMO_CLICK]: {
|
|
216
|
+
action: n.SELECT,
|
|
217
217
|
category: T.TRANSACTION_DETAILS,
|
|
218
218
|
label: r.MEMO
|
|
219
219
|
},
|
|
220
220
|
// tags
|
|
221
|
-
[
|
|
222
|
-
action:
|
|
221
|
+
[o.ON_TRANSACTION_TAGS_CHANGED]: {
|
|
222
|
+
action: n.SAVE,
|
|
223
223
|
category: T.TRANSACTION_DETAILS,
|
|
224
224
|
label: r.TAGS
|
|
225
225
|
},
|
|
226
|
-
[
|
|
227
|
-
action:
|
|
226
|
+
[o.ON_TRANSACTION_TAGS_CLICK]: {
|
|
227
|
+
action: n.SELECT,
|
|
228
228
|
category: T.TRANSACTION_DETAILS,
|
|
229
229
|
label: r.TAGS
|
|
230
230
|
},
|
|
231
|
-
[
|
|
232
|
-
action:
|
|
231
|
+
[o.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK]: {
|
|
232
|
+
action: n.CLOSE,
|
|
233
233
|
category: T.TRANSACTION_DETAILS,
|
|
234
234
|
label: r.TAGS
|
|
235
235
|
},
|
|
236
|
-
[
|
|
237
|
-
action:
|
|
236
|
+
[o.ON_TRANSACTION_TAGS_TAG_ADD_CLICK]: {
|
|
237
|
+
action: n.ADD,
|
|
238
238
|
category: T.TRANSACTION_DETAILS,
|
|
239
239
|
label: r.TAG_ADD
|
|
240
240
|
},
|
|
241
|
-
[
|
|
242
|
-
action:
|
|
241
|
+
[o.ON_TRANSACTION_TAGS_TAG_ADDED]: {
|
|
242
|
+
action: n.SAVE,
|
|
243
243
|
category: T.TRANSACTION_DETAILS,
|
|
244
244
|
label: r.TAG_ADD
|
|
245
245
|
},
|
|
246
|
-
[
|
|
247
|
-
action:
|
|
246
|
+
[o.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK]: {
|
|
247
|
+
action: n.SELECT,
|
|
248
248
|
category: T.TRANSACTION_DETAILS,
|
|
249
249
|
label: r.TAG_DELETE
|
|
250
250
|
},
|
|
251
|
-
[
|
|
252
|
-
action:
|
|
251
|
+
[o.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK]: {
|
|
252
|
+
action: n.CLOSE,
|
|
253
253
|
category: T.TRANSACTION_DETAILS,
|
|
254
254
|
label: r.TAG_DELETE
|
|
255
255
|
},
|
|
256
|
-
[
|
|
257
|
-
action:
|
|
256
|
+
[o.ON_TRANSACTION_TAGS_TAG_DELETED]: {
|
|
257
|
+
action: n.SAVE,
|
|
258
258
|
category: T.TRANSACTION_DETAILS,
|
|
259
259
|
label: r.TAG_DELETE
|
|
260
260
|
},
|
|
261
|
-
[
|
|
262
|
-
action:
|
|
261
|
+
[o.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK]: {
|
|
262
|
+
action: n.EDIT,
|
|
263
263
|
category: T.TRANSACTION_DETAILS,
|
|
264
264
|
label: r.TAG_EDIT
|
|
265
265
|
},
|
|
266
|
-
[
|
|
267
|
-
action:
|
|
266
|
+
[o.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED]: {
|
|
267
|
+
action: n.SAVE,
|
|
268
268
|
category: T.TRANSACTION_DETAILS,
|
|
269
269
|
label: r.TAG_EDIT
|
|
270
270
|
},
|
|
271
271
|
// flag
|
|
272
|
-
[
|
|
273
|
-
action:
|
|
272
|
+
[o.ON_TRANSACTION_TOGGLE_FLAG_CLICK]: {
|
|
273
|
+
action: n.SELECT,
|
|
274
274
|
category: T.TRANSACTION_DETAILS,
|
|
275
275
|
label: r.FLAG
|
|
276
276
|
},
|
|
277
277
|
// hide
|
|
278
|
-
[
|
|
279
|
-
action:
|
|
278
|
+
[o.ON_TRANSACTION_UNHIDDEN]: {
|
|
279
|
+
action: n.SAVE,
|
|
280
280
|
category: T.TRANSACTION_DETAILS,
|
|
281
281
|
label: r.UNHIDE_TRANSACTION
|
|
282
282
|
},
|
|
283
|
-
[
|
|
284
|
-
action:
|
|
283
|
+
[o.ON_TRANSACTION_UNHIDE_CLICK]: {
|
|
284
|
+
action: n.SELECT,
|
|
285
285
|
category: T.TRANSACTION_DETAILS,
|
|
286
286
|
label: r.UNHIDE_TRANSACTION
|
|
287
287
|
},
|
|
288
|
-
[
|
|
289
|
-
action:
|
|
288
|
+
[o.ON_TRANSACTION_UNHIDE_CANCEL_CLICK]: {
|
|
289
|
+
action: n.CLOSE,
|
|
290
290
|
category: T.TRANSACTION_DETAILS,
|
|
291
291
|
label: r.UNHIDE_TRANSACTION
|
|
292
292
|
},
|
|
293
293
|
// export CSV
|
|
294
|
-
[
|
|
295
|
-
action:
|
|
294
|
+
[o.ON_TRANSACTION_EXPORT_CSV_CLICK]: {
|
|
295
|
+
action: n.SELECT,
|
|
296
296
|
category: T.TRANSACTIONS_WIDGET,
|
|
297
297
|
label: r.EXPORT_CSV
|
|
298
298
|
},
|
|
299
299
|
// add transaction
|
|
300
|
-
[
|
|
301
|
-
action:
|
|
300
|
+
[o.ON_TRANSACTION_MANUAL_ADD_CLICK]: {
|
|
301
|
+
action: n.SELECT,
|
|
302
302
|
category: T.TRANSACTIONS_WIDGET,
|
|
303
303
|
label: r.ADD_TRANSACTION
|
|
304
304
|
},
|
|
305
|
-
[
|
|
306
|
-
action:
|
|
305
|
+
[o.ON_TRANSACTION_MANUAL_ADD_ADDED]: {
|
|
306
|
+
action: n.ADD,
|
|
307
307
|
category: T.TRANSACTIONS_WIDGET,
|
|
308
308
|
label: r.ADD_TRANSACTION
|
|
309
309
|
},
|
|
310
|
-
[
|
|
311
|
-
action:
|
|
310
|
+
[o.ON_TRANSACTION_DELETE_CLICK]: {
|
|
311
|
+
action: n.SELECT,
|
|
312
312
|
category: T.TRANSACTIONS_WIDGET,
|
|
313
313
|
label: r.DELETE_TRANSACTION
|
|
314
314
|
},
|
|
315
|
-
[
|
|
316
|
-
action:
|
|
315
|
+
[o.ON_TRANSACTION_DELETE_CANCEL]: {
|
|
316
|
+
action: n.CLOSE,
|
|
317
317
|
category: T.TRANSACTIONS_WIDGET,
|
|
318
318
|
label: r.DELETE_TRANSACTION
|
|
319
319
|
},
|
|
320
|
-
[
|
|
321
|
-
action:
|
|
320
|
+
[o.ON_TRANSACTION_DELETE_DELETED]: {
|
|
321
|
+
action: n.DELETE,
|
|
322
322
|
category: T.TRANSACTIONS_WIDGET,
|
|
323
323
|
label: r.DELETE_TRANSACTION
|
|
324
324
|
}
|
|
@@ -331,26 +331,26 @@ const X = ({
|
|
|
331
331
|
AMOUNT: "amount"
|
|
332
332
|
}, Z = (l, t, a, e = []) => {
|
|
333
333
|
const A = t.reduce((c, i) => ({ ...c, [i.guid]: i }), {}), d = a.reduce((c, i) => ({ ...c, [i.guid]: i }), {}), s = e.reduce((c, i) => {
|
|
334
|
-
const { transaction_guid:
|
|
335
|
-
if (!c[
|
|
334
|
+
const { transaction_guid: S, tag_guid: E } = i;
|
|
335
|
+
if (!c[S])
|
|
336
336
|
return {
|
|
337
337
|
...c,
|
|
338
|
-
[
|
|
338
|
+
[S]: [E]
|
|
339
339
|
};
|
|
340
|
-
const
|
|
340
|
+
const N = [...c[S], E];
|
|
341
341
|
return {
|
|
342
342
|
...c,
|
|
343
|
-
[
|
|
343
|
+
[S]: N
|
|
344
344
|
};
|
|
345
345
|
}, {});
|
|
346
346
|
return l.map((c) => {
|
|
347
|
-
const i = A[c.account_guid],
|
|
347
|
+
const i = A[c.account_guid], S = c.category_guid ? d[c.category_guid] : null, E = s[c.guid] ?? [];
|
|
348
348
|
return {
|
|
349
349
|
...c,
|
|
350
350
|
account: i?.user_name || "Unknown",
|
|
351
351
|
accountIsClosed: i?.is_closed,
|
|
352
352
|
accountIsHidden: i?.is_hidden,
|
|
353
|
-
category:
|
|
353
|
+
category: S?.name || "Uncategorized",
|
|
354
354
|
isIncome: c.top_level_category_guid === Y.INCOME,
|
|
355
355
|
isPending: c.feed_status === y.PENDING,
|
|
356
356
|
number: i?.account_number || "",
|
|
@@ -361,8 +361,8 @@ const X = ({
|
|
|
361
361
|
}, q = "uncategorized", J = (l, t, a, e, A, d) => {
|
|
362
362
|
const s = Q(l, A, d), c = tt(s, a, e);
|
|
363
363
|
return t.forEach((i) => {
|
|
364
|
-
const
|
|
365
|
-
c.splice(
|
|
364
|
+
const S = c.findIndex((N) => N.guid === i), E = d.filter((N) => N.parent_guid === i);
|
|
365
|
+
c.splice(S + 1, 0, ...E);
|
|
366
366
|
}), c;
|
|
367
367
|
}, Q = (l, t, a) => {
|
|
368
368
|
const {
|
|
@@ -372,15 +372,15 @@ const X = ({
|
|
|
372
372
|
searchTerm: s = "",
|
|
373
373
|
showSplits: c = !1
|
|
374
374
|
} = l;
|
|
375
|
-
return a.filter((i) => c ? !i.has_been_split : !i.parent_guid).filter((i) => !!e.find((
|
|
375
|
+
return a.filter((i) => c ? !i.has_been_split : !i.parent_guid).filter((i) => !!e.find((S) => S === i.account_guid)).filter((i) => i.date >= O(A.start) && i.date <= O(A.end)).filter(d).filter((i) => {
|
|
376
376
|
if (s === q && i.has_been_split)
|
|
377
377
|
return !1;
|
|
378
378
|
if (/^spl/i.test(s) && (i.has_been_split || i.parent_guid))
|
|
379
379
|
return !0;
|
|
380
380
|
const E = i.tags.some(
|
|
381
381
|
(w) => _(s, t.find((x) => x.guid === w)?.name)
|
|
382
|
-
),
|
|
383
|
-
return _(s, i.payee) || _(s, i.feed_description) || _(s, i.category) || _(s,
|
|
382
|
+
), N = $(i.date);
|
|
383
|
+
return _(s, i.payee) || _(s, i.feed_description) || _(s, i.category) || _(s, I(N, C.MONTH)) || _(s, I(N, C.DAY)) || _(s, I(N, C.FULL_MONTH_DAY)) || _(s, I(N, C.MONTH_DAY_YEAR)) || _(s, W(N, k)) || _(s, i.account) || _(s, `${i.amount}`) || _(s, i.memo) || E;
|
|
384
384
|
});
|
|
385
385
|
}, tt = (l, t, a) => [...l].sort((e, A) => {
|
|
386
386
|
const d = t, s = (e[d] || "") > (A[d] || "");
|
|
@@ -420,9 +420,8 @@ const X = ({
|
|
|
420
420
|
};
|
|
421
421
|
class et {
|
|
422
422
|
beginDate = h(/* @__PURE__ */ new Date());
|
|
423
|
-
endDate =
|
|
423
|
+
endDate = z(/* @__PURE__ */ new Date());
|
|
424
424
|
expandedSplits = [];
|
|
425
|
-
isInitialized = !1;
|
|
426
425
|
height = 550;
|
|
427
426
|
width = 1e3;
|
|
428
427
|
shouldDisableDrawerScroll = !1;
|
|
@@ -437,7 +436,6 @@ class et {
|
|
|
437
436
|
setDateRange = (t, a) => {
|
|
438
437
|
this.beginDate = t, this.endDate = a;
|
|
439
438
|
};
|
|
440
|
-
setIsInitialized = (t) => this.isInitialized = t;
|
|
441
439
|
setIsAmountValid = (t) => this.isAmountValid = t;
|
|
442
440
|
setSearchValue = (t) => this.searchValue = t;
|
|
443
441
|
setSelectedAccountGuids = (t) => this.selectedAccountGuids = t;
|
|
@@ -462,8 +460,8 @@ class et {
|
|
|
462
460
|
class ft {
|
|
463
461
|
globalStore;
|
|
464
462
|
uiStore;
|
|
465
|
-
api = new
|
|
466
|
-
beatApi = new
|
|
463
|
+
api = new L("/", "");
|
|
464
|
+
beatApi = new u("/", "");
|
|
467
465
|
associatedBeats = [];
|
|
468
466
|
associatedBeatsLoaded = !1;
|
|
469
467
|
transactions = [];
|
|
@@ -481,25 +479,33 @@ class ft {
|
|
|
481
479
|
sortDirection = G.DESC;
|
|
482
480
|
onAnalyticEvent = j;
|
|
483
481
|
constructor(t) {
|
|
484
|
-
this.globalStore = t, this.uiStore = new et(), this.api = new
|
|
482
|
+
this.globalStore = t, this.uiStore = new et(), this.api = new L(
|
|
485
483
|
t.endpoint,
|
|
486
484
|
t.sessionToken,
|
|
487
485
|
t.onError
|
|
488
|
-
), this.beatApi = new
|
|
486
|
+
), this.beatApi = new u(t.endpoint, t.sessionToken, t.onError), p(this);
|
|
489
487
|
}
|
|
490
488
|
loadTransactionData = async () => {
|
|
491
|
-
await Promise.all([
|
|
489
|
+
this.globalStore.accountStore.isAccountDataLoaded || await this.globalStore.accountStore.loadAccountData(), this.globalStore.categoryStore.categoriesLoaded || await this.globalStore.categoryStore.loadCategories(), await Promise.all([
|
|
492
490
|
this.loadAssociatedBeats(h(/* @__PURE__ */ new Date())),
|
|
493
491
|
this.loadTags(),
|
|
494
492
|
this.loadTaggings(),
|
|
495
493
|
this.loadTransactionRules(),
|
|
496
494
|
// By default loads 90 days of transactions
|
|
497
495
|
this.loadTransactions(this.cachedStartDate)
|
|
498
|
-
])
|
|
496
|
+
]);
|
|
499
497
|
};
|
|
500
498
|
get isTransactionDataLoaded() {
|
|
501
499
|
return this.associatedBeatsLoaded && this.tagsLoaded && this.taggingsLoaded && this.transactionRulesLoaded && this.transactionsLoaded;
|
|
502
500
|
}
|
|
501
|
+
get detailedTransactions() {
|
|
502
|
+
return this.isTransactionDataLoaded ? Z(
|
|
503
|
+
this.transactions,
|
|
504
|
+
this.globalStore.accountStore.visibleAccounts,
|
|
505
|
+
this.globalStore.categoryStore.categories,
|
|
506
|
+
this.taggings
|
|
507
|
+
) : [];
|
|
508
|
+
}
|
|
503
509
|
get sortedTransactions() {
|
|
504
510
|
return J(
|
|
505
511
|
this.filter,
|
|
@@ -513,14 +519,6 @@ class ft {
|
|
|
513
519
|
get sortedTransactionsWithSplits() {
|
|
514
520
|
return F(this.sortedTransactions, this.transactions);
|
|
515
521
|
}
|
|
516
|
-
get detailedTransactions() {
|
|
517
|
-
return Z(
|
|
518
|
-
this.transactions,
|
|
519
|
-
this.globalStore.accountStore.visibleAccounts,
|
|
520
|
-
this.globalStore.categoryStore.categories,
|
|
521
|
-
this.taggings
|
|
522
|
-
);
|
|
523
|
-
}
|
|
524
522
|
setAssociatedBeats = (t) => {
|
|
525
523
|
this.associatedBeats = t, this.associatedBeatsLoaded = !0;
|
|
526
524
|
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { jsxs as d, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import x from "react";
|
|
3
|
+
import S from "@mui/material/ListItem";
|
|
4
|
+
import R from "@mui/material/ListItemButton";
|
|
5
|
+
import f from "@mui/material/ListItemIcon";
|
|
6
|
+
import A from "@mui/material/ListItemText";
|
|
7
|
+
import h from "@mui/material/Stack";
|
|
8
|
+
import { Text as y } from "@mxenabled/mxui";
|
|
9
|
+
import { makeAutoObservable as N } from "mobx";
|
|
10
|
+
import { addSeconds as v } from "date-fns/addSeconds";
|
|
11
|
+
import { differenceInCalendarMonths as w } from "date-fns/differenceInCalendarMonths";
|
|
12
|
+
import { endOfMonth as D } from "date-fns/endOfMonth";
|
|
13
|
+
import { subMonths as I } from "date-fns/subMonths";
|
|
14
|
+
import { b as E, C as _, c as O } from "./Category-CevNQ03n.mjs";
|
|
15
|
+
import { f as L, a as T } from "./Dialog-BPTr3qHE.mjs";
|
|
16
|
+
const at = ({
|
|
17
|
+
onClick: e,
|
|
18
|
+
leftIcon: t,
|
|
19
|
+
rightIcon: o,
|
|
20
|
+
title: r,
|
|
21
|
+
subtitle: a,
|
|
22
|
+
rightContent: n,
|
|
23
|
+
titleBold: s = !0,
|
|
24
|
+
rightContentBold: m = !0
|
|
25
|
+
}) => {
|
|
26
|
+
const c = /* @__PURE__ */ d(x.Fragment, { children: [
|
|
27
|
+
t && /* @__PURE__ */ l(f, { sx: { ml: 0 }, children: t }),
|
|
28
|
+
/* @__PURE__ */ l(A, { children: /* @__PURE__ */ d(
|
|
29
|
+
h,
|
|
30
|
+
{
|
|
31
|
+
sx: {
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
flexDirection: "row",
|
|
34
|
+
marginLeft: 12
|
|
35
|
+
},
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ d(h, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
38
|
+
/* @__PURE__ */ l(y, { bold: s, variant: "body1", children: r }),
|
|
39
|
+
a && /* @__PURE__ */ l(y, { variant: "caption", children: a })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ d(h, { sx: { flexDirection: "row", alignItems: "center", gap: 1 }, children: [
|
|
42
|
+
n && /* @__PURE__ */ l(y, { bold: m, display: "flex", variant: "body1", children: n }),
|
|
43
|
+
o && /* @__PURE__ */ l(f, { children: o })
|
|
44
|
+
] })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
) })
|
|
48
|
+
] });
|
|
49
|
+
return /* @__PURE__ */ l(S, { sx: { bgcolor: "background.paper" }, children: e ? /* @__PURE__ */ l(
|
|
50
|
+
R,
|
|
51
|
+
{
|
|
52
|
+
onClick: e,
|
|
53
|
+
sx: {
|
|
54
|
+
py: 14
|
|
55
|
+
},
|
|
56
|
+
children: c
|
|
57
|
+
}
|
|
58
|
+
) : /* @__PURE__ */ l(
|
|
59
|
+
h,
|
|
60
|
+
{
|
|
61
|
+
sx: {
|
|
62
|
+
py: 14,
|
|
63
|
+
px: 24,
|
|
64
|
+
width: "100%",
|
|
65
|
+
flexDirection: "row",
|
|
66
|
+
alignItems: "center"
|
|
67
|
+
},
|
|
68
|
+
children: c
|
|
69
|
+
}
|
|
70
|
+
) });
|
|
71
|
+
}, W = (e) => _[e] ?? _.default, F = (e) => O[e];
|
|
72
|
+
function G(e, t) {
|
|
73
|
+
const o = [], r = new Date(e);
|
|
74
|
+
for (; r <= t; ) {
|
|
75
|
+
const a = r.getFullYear(), n = String(r.getMonth() + 1).padStart(2, "0");
|
|
76
|
+
o.push(+`${a}${n}`), r.setMonth(r.getMonth() + 1);
|
|
77
|
+
}
|
|
78
|
+
return o;
|
|
79
|
+
}
|
|
80
|
+
const $ = (e) => e.reduce((o, r) => {
|
|
81
|
+
const a = {
|
|
82
|
+
top_level_category_guid: r.top_level_category_guid,
|
|
83
|
+
category_guid: r.category_guid,
|
|
84
|
+
amount: r.total,
|
|
85
|
+
year_month: r.year_month
|
|
86
|
+
}, { top_level_category_guid: n, category_guid: s } = a;
|
|
87
|
+
return o[s] || (o[s] = []), o[s].push(a), n !== s && (o[n] || (o[n] = []), o[n].push(a)), o;
|
|
88
|
+
}, {}), nt = (e, t, o) => {
|
|
89
|
+
const r = $(e), a = G(t, o);
|
|
90
|
+
return Object.entries(r).map(([s, m]) => {
|
|
91
|
+
const c = m[0].top_level_category_guid, b = a.map((i) => {
|
|
92
|
+
const g = m.filter((p) => p.year_month === i).reduce((p, M) => p + Math.abs(M.amount), 0), u = Number(String(i).slice(0, 4)), C = Number(String(i).slice(4));
|
|
93
|
+
return { x: new Date(u, C - 1), y: g };
|
|
94
|
+
}).sort((i, g) => i.x.getTime() - g.x.getTime());
|
|
95
|
+
return {
|
|
96
|
+
top_level_category_guid: c,
|
|
97
|
+
category_guid: s,
|
|
98
|
+
category_name: F(s),
|
|
99
|
+
category_color: W(c),
|
|
100
|
+
dataset: b
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
}, st = (e, t) => {
|
|
104
|
+
const o = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e, r = typeof t == "string" ? parseFloat(t.replace(/[^0-9.-]+/g, "")) : t;
|
|
105
|
+
return (o || 0) - (r || 0);
|
|
106
|
+
}, j = (e, t) => {
|
|
107
|
+
const o = e.subCategories.filter((n) => n.currentAmount !== 0), r = e.totalMonthlyAmounts.slice(-t), a = (n) => n.substring(0, 3) + " " + n.slice(-4);
|
|
108
|
+
return r.map((n) => {
|
|
109
|
+
const s = a(n.label), m = o.map((i) => {
|
|
110
|
+
const g = i.monthlyAmounts.slice(-t).find((u) => a(u.label) === s);
|
|
111
|
+
return {
|
|
112
|
+
label: i.name,
|
|
113
|
+
amount: Math.abs(g?.amount || 0),
|
|
114
|
+
header: s
|
|
115
|
+
};
|
|
116
|
+
}), c = e.monthlyAmounts.slice(-t).find((i) => a(i.label) === s);
|
|
117
|
+
return [{
|
|
118
|
+
label: e.name,
|
|
119
|
+
amount: Math.abs(c?.amount || 0),
|
|
120
|
+
header: s
|
|
121
|
+
}, ...m].sort((i, g) => g.amount - i.amount);
|
|
122
|
+
});
|
|
123
|
+
}, k = (e, t) => {
|
|
124
|
+
const o = e ? e.totalMonthlyAmounts.slice(-t).map((a) => ({
|
|
125
|
+
x: a.label.substring(0, 3),
|
|
126
|
+
y: Math.abs(a.amount)
|
|
127
|
+
})) : [], r = e ? j(e, t) : [];
|
|
128
|
+
return { monthlyAmounts: o, tooltipLabels: r };
|
|
129
|
+
}, H = (e) => e.slice().filter(
|
|
130
|
+
(t) => t.totalAmount !== 0 && t.isTransfer === !1 && t.guid !== E.INVESTMENTS
|
|
131
|
+
).sort((t, o) => Math.abs(o.totalAmount) - Math.abs(t.totalAmount));
|
|
132
|
+
class it {
|
|
133
|
+
globalStore;
|
|
134
|
+
selectedCategoryData = null;
|
|
135
|
+
selectedDateRange;
|
|
136
|
+
visibleListLength = 5;
|
|
137
|
+
constructor(t) {
|
|
138
|
+
this.globalStore = t, this.selectedDateRange = {
|
|
139
|
+
start: v(D(I(/* @__PURE__ */ new Date(), 6)), 1),
|
|
140
|
+
end: D(/* @__PURE__ */ new Date())
|
|
141
|
+
}, N(this);
|
|
142
|
+
}
|
|
143
|
+
setSelectedCategoryData = (t) => {
|
|
144
|
+
this.selectedCategoryData = t;
|
|
145
|
+
};
|
|
146
|
+
setSelectedDateRange = (t) => {
|
|
147
|
+
this.selectedDateRange = t;
|
|
148
|
+
};
|
|
149
|
+
setVisibleListLength = (t) => {
|
|
150
|
+
this.visibleListLength = t;
|
|
151
|
+
};
|
|
152
|
+
get sortedDetailedCategoriesWithTransactions() {
|
|
153
|
+
return H(
|
|
154
|
+
this.globalStore.categoryStore.detailedCategoriesWithTransactions
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
get selectedDateRangeMonthCount() {
|
|
158
|
+
return w(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
|
|
159
|
+
}
|
|
160
|
+
get selectedDateRangeMonthRange() {
|
|
161
|
+
const t = L(this.selectedDateRange.start, T.MONTH_LONG), o = L(this.selectedDateRange.end, T.MONTH_LONG);
|
|
162
|
+
return `${t} - ${o}`;
|
|
163
|
+
}
|
|
164
|
+
get visibleCategories() {
|
|
165
|
+
return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
|
|
166
|
+
}
|
|
167
|
+
get collapsedCategories() {
|
|
168
|
+
return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
|
|
169
|
+
}
|
|
170
|
+
get categoryDetailsChartData() {
|
|
171
|
+
return k(
|
|
172
|
+
this.selectedCategoryData,
|
|
173
|
+
this.selectedDateRangeMonthCount
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
export {
|
|
178
|
+
at as L,
|
|
179
|
+
it as T,
|
|
180
|
+
st as a,
|
|
181
|
+
nt as g
|
|
182
|
+
};
|