@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
package/dist/trends/index.es.js
CHANGED
|
@@ -1,75 +1,440 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as C, jsx as e, Fragment as dt } from "react/jsx-runtime";
|
|
2
|
+
import c, { useRef as ut, useState as ht, useEffect as gt } from "react";
|
|
3
|
+
import { observer as R } from "mobx-react-lite";
|
|
4
|
+
import { CategoryIcon as ve, Text as F, Icon as Se, P as me, H3 as Pe, ChevronRightIcon as mt } from "@mxenabled/mxui";
|
|
5
|
+
import W from "@mui/material/Box";
|
|
6
6
|
import b from "@mui/material/Stack";
|
|
7
|
-
import
|
|
8
|
-
import { addSeconds as
|
|
9
|
-
import { differenceInCalendarMonths as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { a as
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
|
|
51
|
-
|
|
7
|
+
import be from "@mui/material/Button";
|
|
8
|
+
import { addSeconds as $e } from "date-fns/addSeconds";
|
|
9
|
+
import { differenceInCalendarMonths as Ae } from "date-fns/differenceInCalendarMonths";
|
|
10
|
+
import { useTheme as we } from "@mui/material/styles";
|
|
11
|
+
import { LineChart as pt } from "@mui/x-charts";
|
|
12
|
+
import { u as J } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
13
|
+
import { u as ft } from "../useDimensions-27p2evRx.mjs";
|
|
14
|
+
import Ct from "@mui/material/Card";
|
|
15
|
+
import yt from "@mui/material/CardContent";
|
|
16
|
+
import Re from "@mui/material/Divider";
|
|
17
|
+
import We from "@mui/material/Grid";
|
|
18
|
+
import { u as O, m as Y, g as P, b as fe, h as De, d as Le, w as Ce, q as Fe, f as He, n as _t, a as Tt } from "../hooks-C41HAxM5.mjs";
|
|
19
|
+
import { b as ze } from "../Localization-2MODESHW.mjs";
|
|
20
|
+
import { C as xe } from "../CurrencyText-Dr0EZ7bp.mjs";
|
|
21
|
+
import { useTheme as St, Card as bt, CardContent as xt, Box as vt, Stack as wt } from "@mui/material";
|
|
22
|
+
import { f as Q, a as $ } from "../Dialog-BPTr3qHE.mjs";
|
|
23
|
+
import { C as Me, c as Dt } from "../Category-CevNQ03n.mjs";
|
|
24
|
+
import { f as oe, a as Lt } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
25
|
+
import { a as Et, g as It, L as Ke } from "../TrendsStore-BW9FGQeE.mjs";
|
|
26
|
+
import { T as Fn } from "../TrendsStore-BW9FGQeE.mjs";
|
|
27
|
+
import { i as Mt, c as At, d as Rt, e as kt, f as Ht, h as Nt, b as je, g as Ye, j as Oe } from "../SpendingData-BuJ03S9d.mjs";
|
|
28
|
+
import Wt from "@mui/material/ToggleButton";
|
|
29
|
+
import Ot from "@mui/material/ToggleButtonGroup";
|
|
30
|
+
import { DataGridPro as Gt } from "@mui/x-data-grid-pro";
|
|
31
|
+
import { H as Ge } from "../HeaderCell-DjuifqHJ.mjs";
|
|
32
|
+
import { T as V, b as Bt } from "../ViewMoreMicroCard-C0832BMe.mjs";
|
|
33
|
+
import { A as w, W as Ue } from "../WidgetContainer-BhQ1Kx2z.mjs";
|
|
34
|
+
import { a as Xe, T as Ze } from "../TransactionDetails-5M2vfr59.mjs";
|
|
35
|
+
import { D as ke } from "../Drawer-BEtCk82g.mjs";
|
|
36
|
+
import { L as pe } from "../Loader-DUaFpDGv.mjs";
|
|
37
|
+
import { L as Ne } from "../LineChart-bc1D9xBE.mjs";
|
|
38
|
+
import { M as Vt } from "../MiniWidgetContainer-CmXpTylX.mjs";
|
|
39
|
+
import { subMonths as Pt } from "date-fns";
|
|
40
|
+
import { TrendingUp as $t, TrendingDown as Ft, MultilineChart as zt, ExpandLess as Kt, ExpandMore as jt } from "@mxenabled/mx-icons";
|
|
41
|
+
import { M as Yt } from "../MicroWidgetContainer-DEiRnYVa.mjs";
|
|
42
|
+
import Ut from "@mui/material/Collapse";
|
|
43
|
+
import Xt from "@mui/material/List";
|
|
44
|
+
import Zt from "@mui/material/ListItem";
|
|
45
|
+
import qt from "@mui/material/ListItemButton";
|
|
46
|
+
import Qt from "@mui/material/ListItemIcon";
|
|
47
|
+
import Jt from "@mui/material/ListItemText";
|
|
48
|
+
import qe from "@mui/material/styles/useTheme";
|
|
49
|
+
import eo from "@mui/material/Paper";
|
|
50
|
+
import { b as to } from "../CategoryUtil-C5cR-nfQ.mjs";
|
|
51
|
+
import { E as oo } from "../ExportCsvAction-DzTrtPzk.mjs";
|
|
52
|
+
import { u as no } from "../useInsightsEnabled-CNjP5cfR.mjs";
|
|
53
|
+
import { E as so } from "../EmptyState-DoxNUae-.mjs";
|
|
54
|
+
import { l as ao } from "../ConnectDrawer-BIbTqYOH.mjs";
|
|
55
|
+
const Qe = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
|
|
56
|
+
const { categories: t } = O(), { getCategoryName: n } = Y(), s = n(o);
|
|
57
|
+
return /* @__PURE__ */ C(b, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
|
|
58
|
+
/* @__PURE__ */ e(
|
|
59
|
+
W,
|
|
60
|
+
{
|
|
61
|
+
"aria-label": ze(t.category_icon_label_aria, s),
|
|
62
|
+
mb: 4,
|
|
63
|
+
role: "img",
|
|
64
|
+
children: /* @__PURE__ */ e(ve, { categoryGuid: a })
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ e(F, { variant: "Body", children: s })
|
|
68
|
+
] });
|
|
69
|
+
}, ro = ({
|
|
70
|
+
categoryGuids: { guid: o, topLevelGuid: a },
|
|
71
|
+
hoveredAreaData: t,
|
|
72
|
+
cursorPosition: n,
|
|
73
|
+
chartContainerRef: s
|
|
74
|
+
}) => {
|
|
75
|
+
const l = we(), m = ut(null), [h, i] = ht({ x: n.x, y: n.y });
|
|
76
|
+
if (gt(() => {
|
|
77
|
+
(() => {
|
|
78
|
+
const p = m.current, _ = s.current;
|
|
79
|
+
if (!p || !_) return;
|
|
80
|
+
const u = p.getBoundingClientRect(), y = _.getBoundingClientRect();
|
|
81
|
+
let S = n.x, g = n.y;
|
|
82
|
+
S + u.width * 2 > y.right ? S = n.x - u.width : S - u.width < y.left && (S = n.x), g + u.height * 2 > y.bottom && (g = n.y - u.height), i({ x: S, y: g });
|
|
83
|
+
})();
|
|
84
|
+
}, [n, s]), !t) return null;
|
|
85
|
+
const d = t.reduce((f, p) => f + p.y, 0);
|
|
86
|
+
return /* @__PURE__ */ e(
|
|
87
|
+
Ct,
|
|
88
|
+
{
|
|
89
|
+
ref: m,
|
|
90
|
+
sx: {
|
|
91
|
+
position: "absolute",
|
|
92
|
+
top: h.y,
|
|
93
|
+
left: h.x,
|
|
94
|
+
width: 250,
|
|
95
|
+
pointerEvents: "none"
|
|
96
|
+
},
|
|
97
|
+
children: /* @__PURE__ */ C(yt, { children: [
|
|
98
|
+
/* @__PURE__ */ C(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
99
|
+
/* @__PURE__ */ e(Qe, { categoryGuid: o, topLevelCategoryGuid: a }),
|
|
100
|
+
/* @__PURE__ */ e(F, { variant: "Small", children: `${t.length}-month total` }),
|
|
101
|
+
/* @__PURE__ */ e(xe, { amount: d, bold: !0, formatString: "0,0", variant: "body2" })
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
|
|
104
|
+
/* @__PURE__ */ e(We, { container: !0, children: t.map((f, p) => /* @__PURE__ */ C(c.Fragment, { children: [
|
|
105
|
+
p > 0 && p % 3 === 0 && /* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
|
|
106
|
+
/* @__PURE__ */ e(We, { item: !0, xs: 4, children: /* @__PURE__ */ C(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
107
|
+
/* @__PURE__ */ e(F, { color: l.palette.text.secondary, variant: "XSmall", children: f.x }),
|
|
108
|
+
/* @__PURE__ */ e(
|
|
109
|
+
xe,
|
|
110
|
+
{
|
|
111
|
+
amount: f.y,
|
|
112
|
+
bold: !0,
|
|
113
|
+
formatString: "0,0",
|
|
114
|
+
variant: "Body"
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] }) })
|
|
118
|
+
] }, p)) })
|
|
119
|
+
] })
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}, io = R(ro), co = ({
|
|
123
|
+
categoryGuids: { guid: o, topLevelGuid: a },
|
|
124
|
+
itemData: { dataIndex: t },
|
|
125
|
+
series: n,
|
|
126
|
+
xData: s
|
|
127
|
+
}) => {
|
|
128
|
+
const l = St(), m = n.data[t], h = s[t];
|
|
129
|
+
return m === void 0 || !h ? null : /* @__PURE__ */ e(bt, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(xt, { children: /* @__PURE__ */ C(vt, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
130
|
+
/* @__PURE__ */ e(Qe, { categoryGuid: o, topLevelCategoryGuid: a }),
|
|
131
|
+
/* @__PURE__ */ e(F, { color: l.palette.text.secondary, variant: "Small", children: Q(h, $.MONTH_SHORT_YEAR) }),
|
|
132
|
+
/* @__PURE__ */ e(xe, { amount: String(m), bold: !0, formatString: "0,0", variant: "Body" })
|
|
133
|
+
] }) }) });
|
|
134
|
+
}, lo = ({
|
|
135
|
+
sx: o,
|
|
136
|
+
categoryGuids: a,
|
|
137
|
+
hoveredLegend: t,
|
|
138
|
+
legendRef: n,
|
|
139
|
+
onHoverLegend: s,
|
|
140
|
+
onClickLegend: l
|
|
141
|
+
}) => {
|
|
142
|
+
const { isMobile: m } = J(), { getCategoryName: h } = Y();
|
|
143
|
+
return /* @__PURE__ */ e(
|
|
144
|
+
b,
|
|
145
|
+
{
|
|
146
|
+
direction: "row",
|
|
147
|
+
flexWrap: "wrap",
|
|
148
|
+
gap: m ? 2 : 6,
|
|
149
|
+
justifyContent: "start",
|
|
150
|
+
ref: n,
|
|
151
|
+
sx: o,
|
|
152
|
+
children: a.map(({ guid: i, top_level_guid: d }) => {
|
|
153
|
+
const f = t === i, p = Me[i], _ = Me[d], u = p ?? _ ?? Me.default, y = u + "33";
|
|
154
|
+
return /* @__PURE__ */ C(
|
|
155
|
+
be,
|
|
156
|
+
{
|
|
157
|
+
onClick: () => l(i),
|
|
158
|
+
onMouseEnter: () => s(i),
|
|
159
|
+
onMouseLeave: () => s(null),
|
|
160
|
+
sx: {
|
|
161
|
+
color: "text.primary",
|
|
162
|
+
fontWeight: "normal",
|
|
163
|
+
display: "flex",
|
|
164
|
+
justifyContent: "center",
|
|
165
|
+
alignItems: "center",
|
|
166
|
+
paddingX: 8,
|
|
167
|
+
paddingY: 4,
|
|
168
|
+
borderRadius: 1,
|
|
169
|
+
opacity: f ? 1 : 0.7
|
|
170
|
+
},
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ e(
|
|
173
|
+
W,
|
|
174
|
+
{
|
|
175
|
+
sx: {
|
|
176
|
+
width: 16,
|
|
177
|
+
height: 16,
|
|
178
|
+
marginRight: m ? 5 : 10,
|
|
179
|
+
borderRadius: "2px",
|
|
180
|
+
backgroundColor: t ? f ? u : y : u
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
/* @__PURE__ */ e(F, { variant: "Body", children: h(i) })
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
i
|
|
188
|
+
);
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
}, uo = ({
|
|
193
|
+
onHoverArea: o,
|
|
194
|
+
onHoverPoint: a,
|
|
195
|
+
onHoverLegend: t,
|
|
196
|
+
onClickLegend: n,
|
|
197
|
+
stackedDatasets: s,
|
|
198
|
+
unstackedDatasets: l = [],
|
|
199
|
+
availableHeight: m = 0,
|
|
200
|
+
minimumHeight: h = 350
|
|
201
|
+
}) => {
|
|
202
|
+
const i = we(), { isMobile: d } = J(), [f, { height: p }] = ft(), _ = c.useRef(null), [u, y] = c.useState(0);
|
|
203
|
+
c.useEffect(() => {
|
|
204
|
+
const r = Math.max(m - p, h);
|
|
205
|
+
y(r);
|
|
206
|
+
}, [m, p]);
|
|
207
|
+
const [S, g] = c.useState(null), [v, E] = c.useState({
|
|
208
|
+
hoveredSeriesId: null,
|
|
209
|
+
hoveredAreaData: null,
|
|
210
|
+
isAreaHovered: !1,
|
|
211
|
+
cursorPos: { x: 0, y: 0 }
|
|
212
|
+
}), { hoveredSeriesId: I, hoveredAreaData: x, isAreaHovered: M, cursorPos: k } = v, A = M && I && x, G = !A, ee = [...s, ...l], ne = ee[0]?.dataset.length ?? 0, H = ee.flatMap((r) => r.dataset.map((T) => T.x)), ue = ee.flatMap((r) => r.dataset.map((T) => T.y)), B = s[0]?.dataset?.map(
|
|
213
|
+
(r, T) => s.reduce((L, j) => L + j.dataset[T]?.y || 0, 0)
|
|
214
|
+
) ?? [0], se = Math.max(...B), ae = Math.max(
|
|
215
|
+
...l.flatMap((r) => r.dataset.map((T) => T.y))
|
|
216
|
+
), z = Math.floor(Math.min(...ue) / 100) * 100, ye = Math.ceil(Math.max(se, ae) / 100) * 100, U = s.map((r, T) => ({
|
|
217
|
+
id: `stacked-${T}`,
|
|
218
|
+
guid: r.category_guid,
|
|
219
|
+
top_level_guid: r.top_level_category_guid,
|
|
220
|
+
area: !0,
|
|
221
|
+
color: s[T].category_color ?? i.palette.primary.main,
|
|
222
|
+
data: r.dataset.map((L) => L.y),
|
|
223
|
+
label: s[T].category_name,
|
|
224
|
+
stack: "total",
|
|
225
|
+
type: "line",
|
|
226
|
+
highlightScope: { highlight: "item" },
|
|
227
|
+
valueFormatter: (L) => oe(L, "0,0")
|
|
228
|
+
})), K = l.map((r, T) => ({
|
|
229
|
+
id: `unstacked-${T}`,
|
|
230
|
+
guid: r.category_guid,
|
|
231
|
+
top_level_guid: r.top_level_category_guid,
|
|
232
|
+
area: !1,
|
|
233
|
+
color: r.category_color,
|
|
234
|
+
data: r.dataset.map((L) => L.y),
|
|
235
|
+
label: r.category_name,
|
|
236
|
+
type: "line",
|
|
237
|
+
valueFormatter: (L) => oe(L, "0,0")
|
|
238
|
+
})), re = [...U, ...K], X = [
|
|
239
|
+
...U.map(({ guid: r, top_level_guid: T }) => ({
|
|
240
|
+
guid: r,
|
|
241
|
+
top_level_guid: T
|
|
242
|
+
})),
|
|
243
|
+
...K.map(({ guid: r, top_level_guid: T }) => ({
|
|
244
|
+
guid: r,
|
|
245
|
+
top_level_guid: T
|
|
246
|
+
}))
|
|
247
|
+
], Z = (r) => {
|
|
248
|
+
const L = r.startsWith("stacked-") ? s[parseInt(r.split("-")[1])] : l[parseInt(r.split("-")[1])];
|
|
249
|
+
return {
|
|
250
|
+
guid: L?.category_guid,
|
|
251
|
+
topLevelGuid: L?.top_level_category_guid
|
|
252
|
+
};
|
|
253
|
+
}, te = (r) => {
|
|
254
|
+
g(r), t?.(r ?? "");
|
|
255
|
+
}, ie = (r) => {
|
|
256
|
+
n?.(r ?? "");
|
|
257
|
+
}, he = () => {
|
|
258
|
+
const r = Z(String(I)).guid;
|
|
259
|
+
r && n?.(r);
|
|
260
|
+
}, ce = (r) => {
|
|
261
|
+
const T = String(r?.seriesId), L = Z(T).guid, j = re.find((de) => de.id === T), _e = j && r?.dataIndex !== void 0, Ee = j && r?.dataIndex === void 0;
|
|
262
|
+
if (_e)
|
|
263
|
+
E({
|
|
264
|
+
hoveredSeriesId: T,
|
|
265
|
+
hoveredAreaData: null,
|
|
266
|
+
isAreaHovered: !1,
|
|
267
|
+
cursorPos: k
|
|
268
|
+
}), a?.(L);
|
|
269
|
+
else if (Ee) {
|
|
270
|
+
const de = j?.data.map((Te, Ie) => ({
|
|
271
|
+
x: H[Ie],
|
|
272
|
+
y: Te
|
|
273
|
+
})) ?? [];
|
|
274
|
+
E({
|
|
275
|
+
hoveredSeriesId: T,
|
|
276
|
+
hoveredAreaData: de,
|
|
277
|
+
isAreaHovered: !0,
|
|
278
|
+
cursorPos: k
|
|
279
|
+
}), o?.(L);
|
|
280
|
+
} else
|
|
281
|
+
E({
|
|
282
|
+
hoveredSeriesId: null,
|
|
283
|
+
hoveredAreaData: null,
|
|
284
|
+
isAreaHovered: !1,
|
|
285
|
+
cursorPos: k
|
|
286
|
+
});
|
|
287
|
+
}, le = (r) => {
|
|
288
|
+
const T = r.currentTarget.getBoundingClientRect();
|
|
289
|
+
E((L) => ({
|
|
290
|
+
...L,
|
|
291
|
+
cursorPos: {
|
|
292
|
+
x: r.clientX - T.left,
|
|
293
|
+
y: r.clientY - T.top
|
|
294
|
+
}
|
|
295
|
+
}));
|
|
296
|
+
}, D = {
|
|
297
|
+
p: 4,
|
|
298
|
+
"& .MuiBarLabel-root": {
|
|
299
|
+
fontSize: 10,
|
|
300
|
+
fontWeight: 600
|
|
301
|
+
},
|
|
302
|
+
"& .MuiAreaElement-root": {
|
|
303
|
+
opacity: 0.4,
|
|
304
|
+
transition: "opacity 0.3s ease"
|
|
305
|
+
},
|
|
306
|
+
"& .MuiAreaElement-root:hover": {
|
|
307
|
+
opacity: 1
|
|
308
|
+
},
|
|
309
|
+
'& [class*="MuiLineElement-series-unstacked-"]': {
|
|
310
|
+
strokeWidth: 3
|
|
311
|
+
},
|
|
312
|
+
...S && U.reduce((r, T, L) => {
|
|
313
|
+
const j = `.MuiAreaElement-series-stacked-${L}`;
|
|
314
|
+
return r[j] = {
|
|
315
|
+
opacity: U[L].guid === S ? 0.9 : 0.2
|
|
316
|
+
}, r;
|
|
317
|
+
}, {})
|
|
318
|
+
};
|
|
319
|
+
return /* @__PURE__ */ e(
|
|
320
|
+
W,
|
|
321
|
+
{
|
|
322
|
+
onMouseMove: le,
|
|
323
|
+
ref: _,
|
|
324
|
+
sx: {
|
|
325
|
+
position: "relative",
|
|
326
|
+
touchAction: "pan-y",
|
|
327
|
+
"& svg": {
|
|
328
|
+
touchAction: "pan-y",
|
|
329
|
+
userSelect: "none"
|
|
330
|
+
},
|
|
331
|
+
"& .recharts-wrapper": {
|
|
332
|
+
touchAction: "pan-y"
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
children: /* @__PURE__ */ C(
|
|
336
|
+
b,
|
|
337
|
+
{
|
|
338
|
+
direction: { xs: "column", md: "column" },
|
|
339
|
+
spacing: { xs: 0, md: 4 },
|
|
340
|
+
sx: { width: "100%", position: "relative" },
|
|
341
|
+
children: [
|
|
342
|
+
/* @__PURE__ */ e(
|
|
343
|
+
pt,
|
|
344
|
+
{
|
|
345
|
+
height: u,
|
|
346
|
+
margin: { bottom: 50 },
|
|
347
|
+
onAreaClick: he,
|
|
348
|
+
onHighlightChange: ce,
|
|
349
|
+
series: re,
|
|
350
|
+
skipAnimation: !0,
|
|
351
|
+
slotProps: {
|
|
352
|
+
legend: {
|
|
353
|
+
hidden: !0
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
slots: {
|
|
357
|
+
itemContent: (r) => G && I ? /* @__PURE__ */ e(
|
|
358
|
+
co,
|
|
359
|
+
{
|
|
360
|
+
categoryGuids: Z(I),
|
|
361
|
+
xData: H,
|
|
362
|
+
...r
|
|
363
|
+
}
|
|
364
|
+
) : null
|
|
365
|
+
},
|
|
366
|
+
sx: D,
|
|
367
|
+
tooltip: {
|
|
368
|
+
trigger: G ? "item" : "none"
|
|
369
|
+
},
|
|
370
|
+
xAxis: [
|
|
371
|
+
{
|
|
372
|
+
data: H,
|
|
373
|
+
scaleType: "time",
|
|
374
|
+
valueFormatter: (r) => Q(r, $.MONTH_SHORT_YEAR),
|
|
375
|
+
tickNumber: ne
|
|
376
|
+
// How many ticks to show on the x-axis
|
|
377
|
+
}
|
|
378
|
+
],
|
|
379
|
+
yAxis: [
|
|
380
|
+
{
|
|
381
|
+
min: z,
|
|
382
|
+
max: ye || 100
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
),
|
|
387
|
+
/* @__PURE__ */ e(
|
|
388
|
+
lo,
|
|
389
|
+
{
|
|
390
|
+
categoryGuids: X,
|
|
391
|
+
hoveredLegend: S,
|
|
392
|
+
legendRef: f,
|
|
393
|
+
onClickLegend: ie,
|
|
394
|
+
onHoverLegend: te,
|
|
395
|
+
sx: { px: d ? 0 : 24 }
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
A && /* @__PURE__ */ e(
|
|
399
|
+
io,
|
|
400
|
+
{
|
|
401
|
+
categoryGuids: Z(I),
|
|
402
|
+
chartContainerRef: _,
|
|
403
|
+
cursorPosition: k,
|
|
404
|
+
hoveredAreaData: x.map((r) => ({
|
|
405
|
+
...r,
|
|
406
|
+
x: Q(r.x, $.MONTH_SHORT_YEAR)
|
|
407
|
+
}))
|
|
408
|
+
}
|
|
409
|
+
)
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
)
|
|
413
|
+
}
|
|
414
|
+
);
|
|
415
|
+
}, Je = ({ selectedTab: o, onTabChange: a }) => /* @__PURE__ */ e(
|
|
416
|
+
Ot,
|
|
52
417
|
{
|
|
53
418
|
exclusive: !0,
|
|
54
|
-
onChange:
|
|
419
|
+
onChange: a,
|
|
55
420
|
orientation: "horizontal",
|
|
56
|
-
value:
|
|
57
|
-
children: ["Chart", "Table"].map((
|
|
421
|
+
value: o,
|
|
422
|
+
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(Wt, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(Se, { name: "table_chart_view" }) : /* @__PURE__ */ e(Se, { name: "format_list_bulleted" }) }, t))
|
|
58
423
|
}
|
|
59
|
-
),
|
|
60
|
-
const { trends:
|
|
61
|
-
const h =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
),
|
|
65
|
-
|
|
66
|
-
|
|
424
|
+
), et = ({ selectedDateRange: o, selectedCategoryGuid: a }) => {
|
|
425
|
+
const { trends: t } = O(), { isMobile: n, isDesktop: s } = J(), { getCategoryName: l } = Y(), m = c.useMemo(() => {
|
|
426
|
+
const h = Q(
|
|
427
|
+
o.start,
|
|
428
|
+
n ? $.MONTH_SHORT_YEAR : $.MONTH_YEAR
|
|
429
|
+
), i = Q(
|
|
430
|
+
o.end,
|
|
431
|
+
n ? $.MONTH_SHORT_YEAR : $.MONTH_YEAR
|
|
67
432
|
);
|
|
68
|
-
return `${h} - ${
|
|
69
|
-
}, [
|
|
70
|
-
return /* @__PURE__ */ C(
|
|
433
|
+
return `${h} - ${i}`;
|
|
434
|
+
}, [o, n]);
|
|
435
|
+
return /* @__PURE__ */ C(W, { sx: { mr: 10, minWidth: "60%" }, children: [
|
|
71
436
|
/* @__PURE__ */ e(
|
|
72
|
-
|
|
437
|
+
F,
|
|
73
438
|
{
|
|
74
439
|
display: "block",
|
|
75
440
|
fontWeight: 700,
|
|
@@ -78,225 +443,235 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
78
443
|
overflow: "visible",
|
|
79
444
|
textOverflow: "unset"
|
|
80
445
|
},
|
|
81
|
-
variant:
|
|
82
|
-
children: l(
|
|
446
|
+
variant: s ? "H3" : "Body",
|
|
447
|
+
children: l(a) || t.sub_title
|
|
83
448
|
}
|
|
84
449
|
),
|
|
85
|
-
/* @__PURE__ */ e(
|
|
450
|
+
/* @__PURE__ */ e(F, { variant: s ? "Body" : "Small", children: m })
|
|
86
451
|
] });
|
|
87
|
-
},
|
|
88
|
-
const
|
|
89
|
-
return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex:
|
|
90
|
-
},
|
|
91
|
-
const { getCategoryName:
|
|
452
|
+
}, ho = (o) => {
|
|
453
|
+
const a = o.row[o.field];
|
|
454
|
+
return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(xe, { amount: a, variant: "Small" }) });
|
|
455
|
+
}, go = ({ categoryGuid: o, topLevelCategoryGuid: a }) => {
|
|
456
|
+
const { getCategoryName: t } = Y(), { categories: n } = O(), s = n.default_categories[o]?.replace(/&/g, "&") ?? t(o);
|
|
92
457
|
return /* @__PURE__ */ C(b, { alignItems: "center", direction: "row", justifyContent: "center", children: [
|
|
93
458
|
/* @__PURE__ */ e(
|
|
94
|
-
|
|
459
|
+
W,
|
|
95
460
|
{
|
|
96
|
-
"aria-label":
|
|
461
|
+
"aria-label": ze(n.category_icon_label_aria, s),
|
|
97
462
|
role: "img",
|
|
98
|
-
children: /* @__PURE__ */ e(
|
|
463
|
+
children: /* @__PURE__ */ e(ve, { categoryGuid: a })
|
|
99
464
|
}
|
|
100
465
|
),
|
|
101
|
-
/* @__PURE__ */ e(
|
|
466
|
+
/* @__PURE__ */ e(F, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
|
|
102
467
|
] });
|
|
103
|
-
},
|
|
104
|
-
|
|
468
|
+
}, mo = (o) => /* @__PURE__ */ e(b, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
|
|
469
|
+
go,
|
|
105
470
|
{
|
|
106
|
-
categoryGuid:
|
|
107
|
-
topLevelCategoryGuid:
|
|
471
|
+
categoryGuid: o.row.category,
|
|
472
|
+
topLevelCategoryGuid: o.row.top_level_category_guid
|
|
108
473
|
}
|
|
109
|
-
) }),
|
|
110
|
-
const
|
|
111
|
-
for (;
|
|
112
|
-
const
|
|
113
|
-
|
|
474
|
+
) }), po = (o, a) => {
|
|
475
|
+
const t = [], n = new Date(o);
|
|
476
|
+
for (; n <= a; ) {
|
|
477
|
+
const s = Q(n, $.MONTH);
|
|
478
|
+
t.push(s), n.setMonth(n.getMonth() + 1);
|
|
114
479
|
}
|
|
115
|
-
return
|
|
116
|
-
},
|
|
117
|
-
monthlyCategoryTotals:
|
|
118
|
-
selectedDateRange:
|
|
119
|
-
selectedCategory:
|
|
120
|
-
onClickRow:
|
|
121
|
-
height:
|
|
480
|
+
return t;
|
|
481
|
+
}, tt = ({
|
|
482
|
+
monthlyCategoryTotals: o,
|
|
483
|
+
selectedDateRange: a,
|
|
484
|
+
selectedCategory: t,
|
|
485
|
+
onClickRow: n,
|
|
486
|
+
height: s = "100dvh",
|
|
122
487
|
sx: l = {}
|
|
123
488
|
}) => {
|
|
124
|
-
const { onEvent:
|
|
489
|
+
const { onEvent: m } = P(), h = Q(/* @__PURE__ */ new Date(), $.MONTH_SHORT), [i, d] = c.useState([
|
|
125
490
|
{ field: h, sort: "desc" }
|
|
126
|
-
]), f =
|
|
491
|
+
]), f = c.useMemo(() => po(a.start, a.end), [a]), p = [
|
|
127
492
|
{
|
|
128
493
|
field: "category",
|
|
129
494
|
flex: 1,
|
|
130
495
|
headerName: "Category",
|
|
131
496
|
minWidth: 175,
|
|
132
|
-
renderHeader:
|
|
133
|
-
renderCell:
|
|
497
|
+
renderHeader: Ge,
|
|
498
|
+
renderCell: mo,
|
|
134
499
|
sortable: !0,
|
|
135
500
|
type: "string"
|
|
136
501
|
},
|
|
137
502
|
...f.map(
|
|
138
|
-
(
|
|
139
|
-
field:
|
|
503
|
+
(u) => ({
|
|
504
|
+
field: u,
|
|
140
505
|
flex: 1,
|
|
141
|
-
headerName:
|
|
506
|
+
headerName: u,
|
|
142
507
|
minWidth: 100,
|
|
143
|
-
renderHeader:
|
|
144
|
-
renderCell:
|
|
508
|
+
renderHeader: Ge,
|
|
509
|
+
renderCell: ho,
|
|
145
510
|
align: "right",
|
|
146
511
|
headerAlign: "right",
|
|
147
512
|
sortable: !0,
|
|
148
513
|
hideSortIcons: !1,
|
|
149
514
|
type: "number",
|
|
150
|
-
sortComparator:
|
|
515
|
+
sortComparator: Et
|
|
151
516
|
})
|
|
152
517
|
)
|
|
153
|
-
],
|
|
154
|
-
const
|
|
155
|
-
(
|
|
156
|
-
),
|
|
157
|
-
(
|
|
158
|
-
) :
|
|
159
|
-
(
|
|
160
|
-
const { category_guid:
|
|
161
|
-
|
|
162
|
-
id:
|
|
163
|
-
category:
|
|
164
|
-
category_guid:
|
|
165
|
-
top_level_category_guid:
|
|
518
|
+
], _ = c.useMemo(() => {
|
|
519
|
+
const u = o.filter(
|
|
520
|
+
(g) => !Mt(g) && !At(g)
|
|
521
|
+
), S = (t ? u.filter(
|
|
522
|
+
(g) => g.category_guid === t || g.top_level_category_guid === t
|
|
523
|
+
) : u).reduce(
|
|
524
|
+
(g, v) => {
|
|
525
|
+
const { category_guid: E, top_level_category_guid: I, month: x, total: M, year: k } = v, A = t ? E : I;
|
|
526
|
+
g[A] || (g[A] = {
|
|
527
|
+
id: A,
|
|
528
|
+
category: A,
|
|
529
|
+
category_guid: E,
|
|
530
|
+
top_level_category_guid: I
|
|
166
531
|
});
|
|
167
|
-
const
|
|
168
|
-
return
|
|
532
|
+
const G = Q(new Date(k, x - 1), $.MONTH_SHORT);
|
|
533
|
+
return g[A][G] || (g[A][G] = 0), g[A][G] = g[A][G] + Math.abs(M), g;
|
|
169
534
|
},
|
|
170
535
|
{}
|
|
171
536
|
);
|
|
172
|
-
return Object.values(
|
|
173
|
-
}, [
|
|
174
|
-
return /* @__PURE__ */ e(
|
|
175
|
-
|
|
537
|
+
return Object.values(S);
|
|
538
|
+
}, [o, t]);
|
|
539
|
+
return /* @__PURE__ */ e(W, { sx: { height: s, width: "100%", overflowX: "auto", boxShadow: "none", ...l }, children: /* @__PURE__ */ e(
|
|
540
|
+
Gt,
|
|
176
541
|
{
|
|
177
|
-
columns:
|
|
542
|
+
columns: p,
|
|
178
543
|
disableColumnFilter: !0,
|
|
179
544
|
disableColumnMenu: !0,
|
|
180
545
|
hideFooter: !0,
|
|
181
|
-
initialState: { sorting: { sortModel:
|
|
182
|
-
onRowClick: (
|
|
183
|
-
|
|
184
|
-
...
|
|
185
|
-
listItem:
|
|
546
|
+
initialState: { sorting: { sortModel: i } },
|
|
547
|
+
onRowClick: (u) => {
|
|
548
|
+
n?.(u.row.category), m(w.TRENDS_CLICK_LIST_ITEM, {
|
|
549
|
+
...V,
|
|
550
|
+
listItem: Dt[u.row.category]
|
|
186
551
|
});
|
|
187
552
|
},
|
|
188
|
-
onSortModelChange: (
|
|
189
|
-
u
|
|
553
|
+
onSortModelChange: (u) => {
|
|
554
|
+
d(u), m(w.TRENDS_CLICK_TABLE_SORT, V);
|
|
190
555
|
},
|
|
191
|
-
rows:
|
|
556
|
+
rows: _,
|
|
192
557
|
slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
|
|
193
|
-
sortModel:
|
|
558
|
+
sortModel: i,
|
|
194
559
|
sortingOrder: ["asc", "desc"]
|
|
195
560
|
}
|
|
196
561
|
) });
|
|
197
|
-
},
|
|
562
|
+
}, fo = {
|
|
198
563
|
title: "Transaction List"
|
|
199
|
-
},
|
|
200
|
-
categoryGuid:
|
|
201
|
-
dateRange:
|
|
202
|
-
isOpen:
|
|
203
|
-
onClose:
|
|
564
|
+
}, Co = ({
|
|
565
|
+
categoryGuid: o,
|
|
566
|
+
dateRange: a,
|
|
567
|
+
isOpen: t,
|
|
568
|
+
onClose: n
|
|
204
569
|
}) => {
|
|
205
|
-
const { onEvent:
|
|
206
|
-
() =>
|
|
207
|
-
[
|
|
570
|
+
const { onEvent: s } = P(), { selectedAccountGuids: l } = fe(), { common: m } = O(), { setFilter: h, sortedTransactions: i } = De(), [d, f] = c.useState(""), p = c.useMemo(
|
|
571
|
+
() => i.find((u) => u.guid === d),
|
|
572
|
+
[d, i]
|
|
208
573
|
);
|
|
209
|
-
|
|
574
|
+
c.useEffect(() => {
|
|
210
575
|
h({
|
|
211
576
|
accounts: l,
|
|
212
|
-
dateRange:
|
|
213
|
-
custom: (
|
|
214
|
-
showSplits: !!
|
|
577
|
+
dateRange: a,
|
|
578
|
+
custom: (u) => o === "" || o === u.category_guid || o === u.top_level_category_guid,
|
|
579
|
+
showSplits: !!o
|
|
215
580
|
});
|
|
216
|
-
}, [l,
|
|
217
|
-
const
|
|
218
|
-
f(""),
|
|
581
|
+
}, [l, o, a]), c.useEffect(() => s(w.TRENDS_VIEW_TRANSACTIONS), []);
|
|
582
|
+
const _ = () => {
|
|
583
|
+
f(""), n();
|
|
219
584
|
};
|
|
220
585
|
return /* @__PURE__ */ C(
|
|
221
|
-
|
|
586
|
+
ke,
|
|
222
587
|
{
|
|
223
|
-
ariaLabelClose:
|
|
224
|
-
isOpen:
|
|
225
|
-
onClose:
|
|
226
|
-
title:
|
|
588
|
+
ariaLabelClose: m.close_aria,
|
|
589
|
+
isOpen: t,
|
|
590
|
+
onClose: _,
|
|
591
|
+
title: fo.title,
|
|
227
592
|
children: [
|
|
228
|
-
|
|
229
|
-
!
|
|
593
|
+
p && /* @__PURE__ */ e(Xe, { transaction: p }),
|
|
594
|
+
!p && /* @__PURE__ */ e(Ze, { onClick: f })
|
|
230
595
|
]
|
|
231
596
|
}
|
|
232
597
|
);
|
|
233
|
-
},
|
|
234
|
-
const { onEvent:
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
598
|
+
}, yo = R(Co), _o = ({ onBackClick: o, sx: a }) => {
|
|
599
|
+
const { onEvent: t } = P(), { isDesktop: n, isTablet: s, isMobile: l } = J(), { isAccountDataLoaded: m, loadAccountData: h, visibleAccounts: i } = Le(), {
|
|
600
|
+
categoriesLoaded: d,
|
|
601
|
+
loadCategories: f,
|
|
602
|
+
loadMonthlyCategoryTotals: p,
|
|
603
|
+
monthlyCategoryTotals: _,
|
|
604
|
+
getCategoryName: u
|
|
605
|
+
} = Y(), {
|
|
606
|
+
isTransactionDataLoaded: y,
|
|
607
|
+
loadTransactionData: S,
|
|
608
|
+
sortedTransactions: g
|
|
609
|
+
} = De(), { selectedDateRange: v, setSelectedDateRange: E } = Ce(), { isInitialized: I, selectedAccounts: x, setSelectedAccounts: M } = fe(), { trends: k } = O(), [A, G] = c.useState(!1), [ee, ne] = c.useState(!1), [H, ue] = c.useState("Chart"), [B, se] = c.useState(""), [ae, z] = c.useState(window.innerHeight), U = ae - (l ? 315 : 345);
|
|
610
|
+
c.useEffect(() => {
|
|
611
|
+
const D = () => z(window.innerHeight);
|
|
612
|
+
return window.addEventListener("resize", D), m || h().finally(), d || f().finally(), y || S().finally(), () => window.removeEventListener("resize", D);
|
|
613
|
+
}, []), c.useEffect(() => {
|
|
614
|
+
M(i);
|
|
615
|
+
}, [i]), c.useEffect(() => {
|
|
616
|
+
I && p(
|
|
617
|
+
x,
|
|
618
|
+
v.start,
|
|
619
|
+
v.end
|
|
245
620
|
).finally(() => {
|
|
246
|
-
|
|
621
|
+
G(!0);
|
|
247
622
|
});
|
|
248
|
-
}, [
|
|
249
|
-
const
|
|
250
|
-
if (!
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
),
|
|
256
|
-
(
|
|
257
|
-
) :
|
|
623
|
+
}, [I, x, v]);
|
|
624
|
+
const K = c.useMemo(() => {
|
|
625
|
+
if (!A) return { stackedDatasets: [], unstackedDatasets: [] };
|
|
626
|
+
const D = It(
|
|
627
|
+
_,
|
|
628
|
+
v.start,
|
|
629
|
+
v.end
|
|
630
|
+
), r = B.length ? D.filter(
|
|
631
|
+
(T) => T.top_level_category_guid === B || T.category_guid === B
|
|
632
|
+
) : Rt(D);
|
|
258
633
|
return {
|
|
259
|
-
stackedDatasets:
|
|
260
|
-
unstackedDatasets:
|
|
634
|
+
stackedDatasets: r.filter(kt),
|
|
635
|
+
unstackedDatasets: r.filter(Ht)
|
|
261
636
|
};
|
|
262
|
-
}, [
|
|
263
|
-
|
|
264
|
-
},
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
time_period:
|
|
637
|
+
}, [_, B, v]), re = (D, r) => {
|
|
638
|
+
ue(r ?? H), t(w.TRENDS_CLICK_TOGGLE_VIEW);
|
|
639
|
+
}, X = (D) => {
|
|
640
|
+
const r = $e(D?.[0], 1), T = D?.[1], L = Ae(T, r);
|
|
641
|
+
E({ start: r, end: T }), t(w.TRENDS_CLICK_TIME_WINDOW, {
|
|
642
|
+
time_period: L + "M"
|
|
268
643
|
});
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
},
|
|
278
|
-
|
|
279
|
-
},
|
|
280
|
-
|
|
644
|
+
}, Z = () => {
|
|
645
|
+
t(w.TRENDS_CLICK_FILTER);
|
|
646
|
+
}, te = (D) => {
|
|
647
|
+
se(D);
|
|
648
|
+
}, ie = (D) => {
|
|
649
|
+
se(D), t(w.TRENDS_CLICK_LEGEND, { category: u(D) });
|
|
650
|
+
}, he = (D) => {
|
|
651
|
+
t(w.TRENDS_HOVER_LEGEND, { category: u(D) });
|
|
652
|
+
}, ce = (D) => {
|
|
653
|
+
t(w.TRENDS_HOVER_AREA, { category: D });
|
|
654
|
+
}, le = (D) => {
|
|
655
|
+
t(w.TRENDS_HOVER_POINT, { category: D });
|
|
281
656
|
};
|
|
282
|
-
return !
|
|
283
|
-
|
|
657
|
+
return !I || !A ? /* @__PURE__ */ e(pe, {}) : /* @__PURE__ */ C(
|
|
658
|
+
Ue,
|
|
284
659
|
{
|
|
285
|
-
accountOptions:
|
|
286
|
-
calendarActions: { onRangeChanged:
|
|
287
|
-
dateRange:
|
|
660
|
+
accountOptions: i,
|
|
661
|
+
calendarActions: { onRangeChanged: X },
|
|
662
|
+
dateRange: v,
|
|
288
663
|
dateRangeVariant: "timeframebuttons",
|
|
289
|
-
onAccountsFilterClick:
|
|
290
|
-
onBackClick:
|
|
291
|
-
sx:
|
|
292
|
-
title:
|
|
664
|
+
onAccountsFilterClick: Z,
|
|
665
|
+
onBackClick: o,
|
|
666
|
+
sx: a,
|
|
667
|
+
title: k.title,
|
|
293
668
|
children: [
|
|
294
669
|
/* @__PURE__ */ C(
|
|
295
670
|
b,
|
|
296
671
|
{
|
|
297
672
|
sx: {
|
|
298
673
|
// eslint-disable-next-line no-nested-ternary
|
|
299
|
-
px:
|
|
674
|
+
px: n ? 48 : s ? 24 : 12
|
|
300
675
|
},
|
|
301
676
|
children: [
|
|
302
677
|
/* @__PURE__ */ C(
|
|
@@ -307,43 +682,43 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
307
682
|
sx: { pb: l ? 12 : 24, pt: l ? 24 : 48 },
|
|
308
683
|
children: [
|
|
309
684
|
/* @__PURE__ */ e(
|
|
310
|
-
|
|
685
|
+
et,
|
|
311
686
|
{
|
|
312
|
-
selectedCategoryGuid:
|
|
313
|
-
selectedDateRange:
|
|
687
|
+
selectedCategoryGuid: B,
|
|
688
|
+
selectedDateRange: v
|
|
314
689
|
}
|
|
315
690
|
),
|
|
316
|
-
/* @__PURE__ */ e(
|
|
691
|
+
/* @__PURE__ */ e(Je, { onTabChange: re, selectedTab: H })
|
|
317
692
|
]
|
|
318
693
|
}
|
|
319
694
|
),
|
|
320
695
|
/* @__PURE__ */ C(b, { alignItems: "center", flexDirection: "row", width: "100%", children: [
|
|
321
|
-
/* @__PURE__ */ e(
|
|
322
|
-
/* @__PURE__ */ e(
|
|
323
|
-
|
|
696
|
+
/* @__PURE__ */ e(W, { flexGrow: 1, children: B && /* @__PURE__ */ C(be, { onClick: () => se(""), sx: { p: 0, pr: 5 }, children: [
|
|
697
|
+
/* @__PURE__ */ e(Se, { name: "arrow_back" }),
|
|
698
|
+
k.all_categories
|
|
324
699
|
] }) }),
|
|
325
|
-
/* @__PURE__ */ e(
|
|
700
|
+
/* @__PURE__ */ e(be, { onClick: () => ne(!0), sx: { px: 5 }, children: `${k.view_transactions} (${g.length})` })
|
|
326
701
|
] }),
|
|
327
|
-
/* @__PURE__ */ C(
|
|
328
|
-
|
|
329
|
-
|
|
702
|
+
/* @__PURE__ */ C(W, { children: [
|
|
703
|
+
H === "Chart" && /* @__PURE__ */ e(
|
|
704
|
+
uo,
|
|
330
705
|
{
|
|
331
|
-
availableHeight:
|
|
332
|
-
onClickLegend:
|
|
333
|
-
onHoverArea:
|
|
334
|
-
onHoverLegend:
|
|
335
|
-
onHoverPoint:
|
|
336
|
-
stackedDatasets:
|
|
337
|
-
unstackedDatasets:
|
|
706
|
+
availableHeight: U,
|
|
707
|
+
onClickLegend: ie,
|
|
708
|
+
onHoverArea: ce,
|
|
709
|
+
onHoverLegend: he,
|
|
710
|
+
onHoverPoint: le,
|
|
711
|
+
stackedDatasets: K.stackedDatasets,
|
|
712
|
+
unstackedDatasets: K.unstackedDatasets
|
|
338
713
|
}
|
|
339
714
|
),
|
|
340
|
-
|
|
341
|
-
|
|
715
|
+
H === "Table" && /* @__PURE__ */ e(
|
|
716
|
+
tt,
|
|
342
717
|
{
|
|
343
|
-
monthlyCategoryTotals:
|
|
344
|
-
onClickRow:
|
|
345
|
-
selectedCategory:
|
|
346
|
-
selectedDateRange:
|
|
718
|
+
monthlyCategoryTotals: _,
|
|
719
|
+
onClickRow: te,
|
|
720
|
+
selectedCategory: B,
|
|
721
|
+
selectedDateRange: v
|
|
347
722
|
}
|
|
348
723
|
)
|
|
349
724
|
] })
|
|
@@ -351,27 +726,27 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
351
726
|
}
|
|
352
727
|
),
|
|
353
728
|
/* @__PURE__ */ e(
|
|
354
|
-
|
|
729
|
+
yo,
|
|
355
730
|
{
|
|
356
|
-
categoryGuid:
|
|
357
|
-
dateRange:
|
|
358
|
-
isOpen:
|
|
359
|
-
onClose: () =>
|
|
731
|
+
categoryGuid: B,
|
|
732
|
+
dateRange: v,
|
|
733
|
+
isOpen: ee,
|
|
734
|
+
onClose: () => ne(!1)
|
|
360
735
|
}
|
|
361
736
|
)
|
|
362
737
|
]
|
|
363
738
|
}
|
|
364
739
|
);
|
|
365
|
-
},
|
|
366
|
-
const
|
|
740
|
+
}, On = R(_o), To = () => {
|
|
741
|
+
const { monthlyCategoryTotals: o } = Y(), { trends: a } = O(), t = we(), { availableHeight: n = 300 } = Fe(), s = Nt(o);
|
|
367
742
|
return /* @__PURE__ */ e(
|
|
368
|
-
|
|
743
|
+
Ne,
|
|
369
744
|
{
|
|
370
745
|
baseline: "min",
|
|
371
746
|
colors: [t.palette.primary.main],
|
|
372
747
|
datasets: [s],
|
|
373
|
-
height:
|
|
374
|
-
labels: [
|
|
748
|
+
height: n,
|
|
749
|
+
labels: [a.spending_label],
|
|
375
750
|
showArea: !0,
|
|
376
751
|
showAverage: !0,
|
|
377
752
|
showLegend: !0,
|
|
@@ -380,35 +755,38 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
380
755
|
valueFormatterString: "0,0"
|
|
381
756
|
}
|
|
382
757
|
);
|
|
383
|
-
},
|
|
384
|
-
const {
|
|
385
|
-
return
|
|
386
|
-
|
|
387
|
-
}, [
|
|
388
|
-
|
|
389
|
-
}, [
|
|
390
|
-
|
|
758
|
+
}, So = R(To), bo = ({ onPrimaryCtaClick: o, sx: a }) => {
|
|
759
|
+
const { isAccountDataLoaded: t, loadAccountData: n, visibleAccounts: s } = Le(), { loadMonthlyCategoryTotals: l, monthlyTotalsLoaded: m } = Y(), { isInitialized: h } = He(), { trends: i } = O(), { selectedAccounts: d, setSelectedAccounts: f } = fe();
|
|
760
|
+
return c.useEffect(() => {
|
|
761
|
+
t || n().finally();
|
|
762
|
+
}, []), c.useEffect(() => {
|
|
763
|
+
f(s);
|
|
764
|
+
}, [s]), c.useEffect(() => {
|
|
765
|
+
h && l(d).finally();
|
|
766
|
+
}, [h, d]), h ? /* @__PURE__ */ e(
|
|
767
|
+
Vt,
|
|
391
768
|
{
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
769
|
+
contentStyles: { height: "calc(100% - 72px)", ":last-child": { pb: 0 } },
|
|
770
|
+
onPrimaryCtaClick: o,
|
|
771
|
+
primaryCtaLabel: i.primary_cta,
|
|
772
|
+
subTitle: i.sub_title,
|
|
773
|
+
sx: { height: "100%", ...a },
|
|
774
|
+
title: i.mini_title,
|
|
775
|
+
children: m ? /* @__PURE__ */ e(So, {}) : /* @__PURE__ */ e(pe, {})
|
|
398
776
|
}
|
|
399
|
-
);
|
|
400
|
-
},
|
|
401
|
-
title:
|
|
402
|
-
totalAmount:
|
|
403
|
-
transactionType:
|
|
404
|
-
percentage:
|
|
405
|
-
secondaryLabel:
|
|
777
|
+
) : /* @__PURE__ */ e(pe, {});
|
|
778
|
+
}, Gn = R(bo), xo = 70, Be = ({
|
|
779
|
+
title: o,
|
|
780
|
+
totalAmount: a,
|
|
781
|
+
transactionType: t,
|
|
782
|
+
percentage: n,
|
|
783
|
+
secondaryLabel: s,
|
|
406
784
|
shouldDisplayPercentage: l
|
|
407
785
|
}) => {
|
|
408
|
-
const { availableWidth:
|
|
786
|
+
const { availableWidth: m } = Fe(), h = c.useRef(null), i = c.useRef(null), d = Lt(Number(Math.abs(n)), {
|
|
409
787
|
style: "percent",
|
|
410
788
|
minimumIntegerDigits: 1
|
|
411
|
-
}), f =
|
|
789
|
+
}), f = m === 288 && oe(a, "0,0.00").length > 10 ? oe(a, "0,0") : oe(a, "0,0.00"), p = t === "spending" ? n > 0 : n >= 0, _ = t === "spending" ? "error.main" : "success.main", u = t === "spending" ? "success.main" : "text.secondary", y = h?.current, S = i?.current, g = y && S ? y.scrollWidth > S.clientWidth - xo : !1;
|
|
412
790
|
return /* @__PURE__ */ C(
|
|
413
791
|
b,
|
|
414
792
|
{
|
|
@@ -431,18 +809,18 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
431
809
|
justifyContent: "space-between"
|
|
432
810
|
},
|
|
433
811
|
children: [
|
|
434
|
-
/* @__PURE__ */ e(
|
|
812
|
+
/* @__PURE__ */ e(me, { color: "text.secondary", variant: "caption", children: o }),
|
|
435
813
|
l && /* @__PURE__ */ C(b, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
436
|
-
|
|
814
|
+
p ? /* @__PURE__ */ e($t, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e(Ft, { size: 20, sx: { color: u } }),
|
|
437
815
|
/* @__PURE__ */ e(
|
|
438
|
-
|
|
816
|
+
me,
|
|
439
817
|
{
|
|
440
818
|
sx: {
|
|
441
|
-
color:
|
|
819
|
+
color: p ? _ : u,
|
|
442
820
|
fontWeight: 600
|
|
443
821
|
},
|
|
444
822
|
variant: "body2",
|
|
445
|
-
children:
|
|
823
|
+
children: d
|
|
446
824
|
}
|
|
447
825
|
)
|
|
448
826
|
] })
|
|
@@ -452,7 +830,7 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
452
830
|
/* @__PURE__ */ C(
|
|
453
831
|
b,
|
|
454
832
|
{
|
|
455
|
-
ref:
|
|
833
|
+
ref: i,
|
|
456
834
|
sx: {
|
|
457
835
|
alignItems: "center",
|
|
458
836
|
flexDirection: "row",
|
|
@@ -460,19 +838,19 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
460
838
|
},
|
|
461
839
|
children: [
|
|
462
840
|
/* @__PURE__ */ e(
|
|
463
|
-
|
|
841
|
+
W,
|
|
464
842
|
{
|
|
465
843
|
ref: h,
|
|
466
844
|
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
467
|
-
children: /* @__PURE__ */ e(
|
|
845
|
+
children: /* @__PURE__ */ e(Pe, { children: f })
|
|
468
846
|
}
|
|
469
847
|
),
|
|
470
|
-
l &&
|
|
471
|
-
|
|
848
|
+
l && m >= 450 && !g && /* @__PURE__ */ e(
|
|
849
|
+
me,
|
|
472
850
|
{
|
|
473
|
-
color:
|
|
851
|
+
color: p ? _ : u,
|
|
474
852
|
variant: "caption",
|
|
475
|
-
children:
|
|
853
|
+
children: s
|
|
476
854
|
}
|
|
477
855
|
)
|
|
478
856
|
]
|
|
@@ -481,49 +859,53 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
481
859
|
]
|
|
482
860
|
}
|
|
483
861
|
);
|
|
484
|
-
},
|
|
485
|
-
const { trends:
|
|
862
|
+
}, vo = R(() => {
|
|
863
|
+
const { trends: o } = O();
|
|
486
864
|
return /* @__PURE__ */ C(b, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
|
|
487
|
-
/* @__PURE__ */ e(
|
|
865
|
+
/* @__PURE__ */ e(zt, { size: 32 }),
|
|
488
866
|
/* @__PURE__ */ C(b, { children: [
|
|
489
|
-
/* @__PURE__ */ e(
|
|
490
|
-
/* @__PURE__ */ e(
|
|
867
|
+
/* @__PURE__ */ e(me, { fontWeight: 600, variant: "body1", children: o.zero_state_content_header }),
|
|
868
|
+
/* @__PURE__ */ e(me, { color: "text.secondary", variant: "subtitle2", children: o.zero_state_content_description })
|
|
491
869
|
] })
|
|
492
870
|
] });
|
|
493
|
-
}),
|
|
494
|
-
const {
|
|
495
|
-
|
|
871
|
+
}), Bn = R(({ onCtaClick: o }) => {
|
|
872
|
+
const { isAccountDataLoaded: a, loadAccountData: t, visibleAccounts: n } = Le();
|
|
873
|
+
c.useEffect(() => {
|
|
874
|
+
a || t().finally();
|
|
875
|
+
}, []);
|
|
876
|
+
const { onEvent: s } = P(), { monthlyCategoryTotals: l, loadMonthlyCategoryTotals: m, monthlyTotalsLoaded: h } = Y(), i = {
|
|
877
|
+
start: Pt(/* @__PURE__ */ new Date(), 1),
|
|
496
878
|
end: /* @__PURE__ */ new Date()
|
|
497
|
-
}, { trends:
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}, [
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
state:
|
|
879
|
+
}, { trends: d } = O(), { selectedAccounts: f, setSelectedAccounts: p, isInitialized: _ } = fe();
|
|
880
|
+
c.useEffect(() => {
|
|
881
|
+
p(n);
|
|
882
|
+
}, [n]), c.useEffect(() => {
|
|
883
|
+
_ && m(f, i.start).then(() => {
|
|
884
|
+
s(w.TRENDS_LOAD_WIDGET, {
|
|
885
|
+
state: n?.length ? "default" : "zeroState"
|
|
504
886
|
});
|
|
505
887
|
});
|
|
506
|
-
}, [
|
|
507
|
-
const { spendingData:
|
|
888
|
+
}, [_, f]);
|
|
889
|
+
const { spendingData: u, incomeData: y } = c.useMemo(
|
|
508
890
|
() => ({
|
|
509
|
-
spendingData:
|
|
510
|
-
incomeData:
|
|
891
|
+
spendingData: je(l, i),
|
|
892
|
+
incomeData: Ye(l, i)
|
|
511
893
|
}),
|
|
512
|
-
[
|
|
513
|
-
), [
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
),
|
|
894
|
+
[l, i]
|
|
895
|
+
), [S, g] = u, [v, E] = y, I = Oe(g.y, S.y), x = Oe(E.y, v.y), M = _ && !n?.length, k = () => {
|
|
896
|
+
s(
|
|
897
|
+
M ? w.TRENDS_CLICK_GET_STARTED : w.TRENDS_CLICK_VIEW_MORE
|
|
898
|
+
), o();
|
|
517
899
|
};
|
|
518
|
-
return !
|
|
519
|
-
|
|
900
|
+
return !h || !_ ? /* @__PURE__ */ e(pe, {}) : /* @__PURE__ */ e(
|
|
901
|
+
Yt,
|
|
520
902
|
{
|
|
521
903
|
className: "mx-trends-microwidget",
|
|
522
|
-
ctaLabel:
|
|
523
|
-
onCTAClick:
|
|
524
|
-
subHeader:
|
|
525
|
-
title:
|
|
526
|
-
children:
|
|
904
|
+
ctaLabel: d.micro_primary_cta_label,
|
|
905
|
+
onCTAClick: k,
|
|
906
|
+
subHeader: M ? void 0 : d.micro_subheader,
|
|
907
|
+
title: d.title,
|
|
908
|
+
children: M ? /* @__PURE__ */ e(vo, {}) : /* @__PURE__ */ C(
|
|
527
909
|
b,
|
|
528
910
|
{
|
|
529
911
|
sx: {
|
|
@@ -533,24 +915,24 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
533
915
|
},
|
|
534
916
|
children: [
|
|
535
917
|
/* @__PURE__ */ e(
|
|
536
|
-
|
|
918
|
+
Be,
|
|
537
919
|
{
|
|
538
|
-
percentage:
|
|
539
|
-
secondaryLabel:
|
|
540
|
-
shouldDisplayPercentage:
|
|
541
|
-
title:
|
|
542
|
-
totalAmount:
|
|
920
|
+
percentage: I,
|
|
921
|
+
secondaryLabel: d.micro_secondary_label,
|
|
922
|
+
shouldDisplayPercentage: g.y !== 0 && S.y !== 0,
|
|
923
|
+
title: d.spending_label,
|
|
924
|
+
totalAmount: g.y,
|
|
543
925
|
transactionType: "spending"
|
|
544
926
|
}
|
|
545
927
|
),
|
|
546
928
|
/* @__PURE__ */ e(
|
|
547
|
-
|
|
929
|
+
Be,
|
|
548
930
|
{
|
|
549
|
-
percentage:
|
|
550
|
-
secondaryLabel:
|
|
551
|
-
shouldDisplayPercentage:
|
|
552
|
-
title:
|
|
553
|
-
totalAmount:
|
|
931
|
+
percentage: x,
|
|
932
|
+
secondaryLabel: d.micro_secondary_label,
|
|
933
|
+
shouldDisplayPercentage: E.y !== 0 && v.y !== 0,
|
|
934
|
+
title: d.income_label,
|
|
935
|
+
totalAmount: E.y,
|
|
554
936
|
transactionType: "income"
|
|
555
937
|
}
|
|
556
938
|
)
|
|
@@ -559,21 +941,21 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
559
941
|
)
|
|
560
942
|
}
|
|
561
943
|
);
|
|
562
|
-
}),
|
|
563
|
-
({ isExpanded:
|
|
564
|
-
const
|
|
565
|
-
return /* @__PURE__ */ e(
|
|
944
|
+
}), wo = R(
|
|
945
|
+
({ isExpanded: o, onClick: a }) => {
|
|
946
|
+
const t = qe();
|
|
947
|
+
return /* @__PURE__ */ e(Zt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(qt, { onClick: a, sx: { justifyContent: "center" }, children: /* @__PURE__ */ C(
|
|
566
948
|
b,
|
|
567
949
|
{
|
|
568
|
-
sx: { color:
|
|
950
|
+
sx: { color: t.palette.primary.main, flexDirection: "row", alignItems: "center" },
|
|
569
951
|
children: [
|
|
570
|
-
/* @__PURE__ */ e(
|
|
571
|
-
/* @__PURE__ */ e(
|
|
572
|
-
|
|
952
|
+
/* @__PURE__ */ e(Jt, { children: /* @__PURE__ */ e(F, { bold: !0, variant: "body2", children: o ? "View less" : "View more" }) }),
|
|
953
|
+
/* @__PURE__ */ e(Qt, { sx: { color: t.palette.primary.main }, children: o ? /* @__PURE__ */ e(Kt, {}) : /* @__PURE__ */ e(
|
|
954
|
+
jt,
|
|
573
955
|
{
|
|
574
956
|
sx: {
|
|
575
957
|
transition: "transform 0.3s ease-in-out",
|
|
576
|
-
transform:
|
|
958
|
+
transform: o ? "rotate(180deg)" : "rotate(0deg)"
|
|
577
959
|
}
|
|
578
960
|
}
|
|
579
961
|
) })
|
|
@@ -581,129 +963,128 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
581
963
|
}
|
|
582
964
|
) }) });
|
|
583
965
|
}
|
|
584
|
-
),
|
|
966
|
+
), Ve = R(
|
|
585
967
|
({
|
|
586
|
-
totalAmount:
|
|
587
|
-
guid:
|
|
588
|
-
name:
|
|
589
|
-
transactions:
|
|
590
|
-
onClick:
|
|
968
|
+
totalAmount: o,
|
|
969
|
+
guid: a,
|
|
970
|
+
name: t,
|
|
971
|
+
transactions: n,
|
|
972
|
+
onClick: s,
|
|
591
973
|
isLastItem: l = !1,
|
|
592
|
-
showDivider:
|
|
974
|
+
showDivider: m = !0
|
|
593
975
|
}) => {
|
|
594
|
-
const { trends: h } =
|
|
595
|
-
|
|
596
|
-
...
|
|
597
|
-
listItem:
|
|
976
|
+
const { trends: h } = O(), { onEvent: i } = P(), d = `${n.length} ${n.length === 1 ? h.transaction : h.transactions}`, f = () => {
|
|
977
|
+
s?.(), i(w.TRENDS_CLICK_LIST_ITEM, {
|
|
978
|
+
...V,
|
|
979
|
+
listItem: t
|
|
598
980
|
});
|
|
599
981
|
};
|
|
600
|
-
return /* @__PURE__ */ C(
|
|
982
|
+
return /* @__PURE__ */ C(c.Fragment, { children: [
|
|
601
983
|
/* @__PURE__ */ e(
|
|
602
|
-
|
|
984
|
+
Ke,
|
|
603
985
|
{
|
|
604
|
-
leftIcon:
|
|
986
|
+
leftIcon: a ? /* @__PURE__ */ e(ve, { categoryGuid: a }) : void 0,
|
|
605
987
|
onClick: f,
|
|
606
|
-
rightContent:
|
|
607
|
-
rightIcon:
|
|
608
|
-
subtitle:
|
|
609
|
-
title:
|
|
988
|
+
rightContent: oe(Math.abs(o), "0,0.00"),
|
|
989
|
+
rightIcon: s ? /* @__PURE__ */ e(mt, {}) : void 0,
|
|
990
|
+
subtitle: d,
|
|
991
|
+
title: t
|
|
610
992
|
}
|
|
611
993
|
),
|
|
612
|
-
|
|
613
|
-
] },
|
|
994
|
+
m && /* @__PURE__ */ e(Re, { sx: { ml: l ? 24 : 68 } })
|
|
995
|
+
] }, a);
|
|
614
996
|
}
|
|
615
|
-
),
|
|
616
|
-
({ availableHeight:
|
|
617
|
-
const { collapsedCategories:
|
|
618
|
-
|
|
619
|
-
const
|
|
620
|
-
|
|
621
|
-
}, [
|
|
622
|
-
const
|
|
623
|
-
f(!
|
|
624
|
-
...
|
|
997
|
+
), Do = R(
|
|
998
|
+
({ availableHeight: o = 0, onCategoryClick: a }) => {
|
|
999
|
+
const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: s } = Ce(), { isLargeDesktop: l, isDesktop: m } = J(), { trends: h } = O(), { onEvent: i } = P(), [d, f] = c.useState(!1), p = m || l;
|
|
1000
|
+
c.useEffect(() => {
|
|
1001
|
+
const y = Math.floor(o / 64) - 1, S = n.length + t.length;
|
|
1002
|
+
y !== n.length && (s(p ? Math.max(y, 5) : 5), f(y >= S));
|
|
1003
|
+
}, [o]);
|
|
1004
|
+
const _ = () => {
|
|
1005
|
+
f(!d), i(w.TRENDS_CLICK_VIEW_MORE, {
|
|
1006
|
+
...V
|
|
625
1007
|
});
|
|
626
|
-
},
|
|
627
|
-
return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ C(
|
|
628
|
-
/* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(
|
|
629
|
-
|
|
630
|
-
|
|
1008
|
+
}, u = n.length + (d ? t.length : 0);
|
|
1009
|
+
return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ C(Xt, { children: [
|
|
1010
|
+
/* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Pe, { children: h.categories }) }),
|
|
1011
|
+
n.map((y, S) => /* @__PURE__ */ e(
|
|
1012
|
+
Ve,
|
|
631
1013
|
{
|
|
632
|
-
...
|
|
633
|
-
isLastItem:
|
|
634
|
-
onClick:
|
|
1014
|
+
...y,
|
|
1015
|
+
isLastItem: S === u - 1,
|
|
1016
|
+
onClick: y.transactions.length > 0 ? () => a(y) : void 0,
|
|
635
1017
|
showDivider: !0
|
|
636
1018
|
},
|
|
637
|
-
|
|
1019
|
+
y.guid
|
|
638
1020
|
)),
|
|
639
1021
|
/* @__PURE__ */ e(
|
|
640
|
-
|
|
1022
|
+
Ut,
|
|
641
1023
|
{
|
|
642
|
-
in:
|
|
1024
|
+
in: d,
|
|
643
1025
|
sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
|
|
644
|
-
children:
|
|
645
|
-
const
|
|
1026
|
+
children: t.map((y, S) => {
|
|
1027
|
+
const g = n.length + S;
|
|
646
1028
|
return /* @__PURE__ */ e(
|
|
647
|
-
|
|
1029
|
+
Ve,
|
|
648
1030
|
{
|
|
649
|
-
...
|
|
650
|
-
isLastItem:
|
|
651
|
-
onClick:
|
|
1031
|
+
...y,
|
|
1032
|
+
isLastItem: g === u - 1,
|
|
1033
|
+
onClick: y.transactions.length > 0 ? () => a(y) : void 0,
|
|
652
1034
|
showDivider: !0
|
|
653
1035
|
},
|
|
654
|
-
|
|
1036
|
+
y.guid
|
|
655
1037
|
);
|
|
656
1038
|
})
|
|
657
1039
|
}
|
|
658
1040
|
),
|
|
659
|
-
|
|
1041
|
+
t.length > 0 && /* @__PURE__ */ e(wo, { isExpanded: d, onClick: _ })
|
|
660
1042
|
] }) });
|
|
661
1043
|
}
|
|
662
|
-
),
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
},
|
|
666
|
-
return /* @__PURE__ */ e(
|
|
667
|
-
|
|
1044
|
+
), Lo = ({ beats: o, onInsightCardClick: a }) => {
|
|
1045
|
+
const { onEvent: t } = P(), { isMobile: n, isDesktop: s, isLargeDesktop: l } = J(), { beatStore: m, endpoint: h, sessionToken: i } = He(), d = s || l, f = d || n ? 1 : 2, p = () => null, _ = (E) => {
|
|
1046
|
+
a?.(E), t(w.TRENDS_CLICK_INSIGHT, V);
|
|
1047
|
+
}, u = d ? 200 : 170, y = d ? 170 : 124, S = d ? 56 : 0, g = o.length > 0 ? u + S : y, v = d && o.length > 0 ? u : void 0;
|
|
1048
|
+
return /* @__PURE__ */ e(wt, { sx: { height: g }, children: /* @__PURE__ */ e(
|
|
1049
|
+
Bt,
|
|
668
1050
|
{
|
|
669
|
-
areBeatsLoading:
|
|
670
|
-
beats:
|
|
671
|
-
endpoint:
|
|
672
|
-
heightOverrides:
|
|
673
|
-
logOutUser:
|
|
674
|
-
onCardClick:
|
|
1051
|
+
areBeatsLoading: m.isLoading,
|
|
1052
|
+
beats: o,
|
|
1053
|
+
endpoint: h,
|
|
1054
|
+
heightOverrides: v,
|
|
1055
|
+
logOutUser: p,
|
|
1056
|
+
onCardClick: _,
|
|
675
1057
|
showBorder: !0,
|
|
676
1058
|
showCTAColocatedWithText: !1,
|
|
677
1059
|
showCarouselControls: !0,
|
|
678
|
-
showHeader:
|
|
1060
|
+
showHeader: d,
|
|
679
1061
|
showIcon: !0,
|
|
680
1062
|
showWithMargin: !1,
|
|
681
|
-
token:
|
|
682
|
-
useDarkMode: f,
|
|
1063
|
+
token: i,
|
|
683
1064
|
userHasFullInsightFeedBeats: !1,
|
|
684
1065
|
variant: "outlined",
|
|
685
|
-
visibleCardsCount:
|
|
1066
|
+
visibleCardsCount: f
|
|
686
1067
|
}
|
|
687
1068
|
) });
|
|
688
|
-
},
|
|
689
|
-
const { onEvent:
|
|
690
|
-
categoryDetailsChartData: { monthlyAmounts:
|
|
691
|
-
} =
|
|
1069
|
+
}, Eo = R(Lo), Io = R(({ chartLabel: o, chartColor: a }) => {
|
|
1070
|
+
const { onEvent: t } = P(), {
|
|
1071
|
+
categoryDetailsChartData: { monthlyAmounts: n, tooltipLabels: s }
|
|
1072
|
+
} = Ce();
|
|
692
1073
|
return /* @__PURE__ */ e(b, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
|
|
693
|
-
|
|
1074
|
+
Ne,
|
|
694
1075
|
{
|
|
695
1076
|
baseline: "min",
|
|
696
|
-
colors: [
|
|
1077
|
+
colors: [a],
|
|
697
1078
|
curveType: "bump",
|
|
698
|
-
customTooltipLabels:
|
|
699
|
-
datasets: [
|
|
1079
|
+
customTooltipLabels: s,
|
|
1080
|
+
datasets: [n],
|
|
700
1081
|
height: 265,
|
|
701
|
-
labels: [
|
|
1082
|
+
labels: [o],
|
|
702
1083
|
markStyles: () => ({
|
|
703
|
-
stroke:
|
|
1084
|
+
stroke: a
|
|
704
1085
|
}),
|
|
705
1086
|
onItemClick: () => {
|
|
706
|
-
|
|
1087
|
+
t(w.TRENDS_CLICK_CHART, V);
|
|
707
1088
|
},
|
|
708
1089
|
showArea: !0,
|
|
709
1090
|
showAverage: !0,
|
|
@@ -718,100 +1099,100 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
718
1099
|
valueFormatterString: "0,0"
|
|
719
1100
|
}
|
|
720
1101
|
) });
|
|
721
|
-
}),
|
|
722
|
-
const
|
|
1102
|
+
}), Mo = R(({ onClose: o }) => {
|
|
1103
|
+
const a = qe(), { onEvent: t } = P(), { common: n, trends: s } = O(), { selectedCategoryData: l, selectedDateRangeMonthRange: m } = Ce(), { sortedTransactions: h } = De(), [i, d] = c.useState(null);
|
|
723
1104
|
if (!l)
|
|
724
1105
|
return null;
|
|
725
|
-
const { guid: f, name:
|
|
726
|
-
() => h.find((
|
|
727
|
-
[
|
|
728
|
-
),
|
|
729
|
-
|
|
1106
|
+
const { guid: f, name: p, is_income: _, totalAmount: u } = l, y = _ ? s.category_income : s.category_spending, S = to(f, a), g = _ ? s.income_label : s.spending_label, v = ` ${l.transactions.length === 1 ? s.transaction : s.transactions} (${l.transactions.length})`, E = c.useMemo(
|
|
1107
|
+
() => h.find((M) => M.guid === i),
|
|
1108
|
+
[i, h]
|
|
1109
|
+
), I = (M) => M.category_guid === f || M.top_level_category_guid === f, x = () => {
|
|
1110
|
+
o?.(), t(w.TRENDS_CLICK_BACK, V);
|
|
730
1111
|
};
|
|
731
1112
|
return /* @__PURE__ */ C(
|
|
732
|
-
|
|
1113
|
+
ke,
|
|
733
1114
|
{
|
|
734
|
-
ariaLabelClose:
|
|
1115
|
+
ariaLabelClose: s.close_category_details,
|
|
735
1116
|
isOpen: !0,
|
|
736
|
-
onClose:
|
|
1117
|
+
onClose: x,
|
|
737
1118
|
shouldShowHeaderShadow: !0,
|
|
738
|
-
title:
|
|
1119
|
+
title: y,
|
|
739
1120
|
children: [
|
|
740
1121
|
/* @__PURE__ */ C(b, { sx: { alignItems: "center", height: "100%" }, children: [
|
|
741
|
-
/* @__PURE__ */ C(
|
|
1122
|
+
/* @__PURE__ */ C(eo, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
|
|
742
1123
|
/* @__PURE__ */ e(
|
|
743
|
-
|
|
1124
|
+
Ke,
|
|
744
1125
|
{
|
|
745
|
-
leftIcon: /* @__PURE__ */ e(
|
|
746
|
-
rightContent:
|
|
747
|
-
subtitle:
|
|
748
|
-
title:
|
|
1126
|
+
leftIcon: /* @__PURE__ */ e(ve, { categoryGuid: f }),
|
|
1127
|
+
rightContent: oe(Math.abs(u), "0,0.00"),
|
|
1128
|
+
subtitle: m,
|
|
1129
|
+
title: p
|
|
749
1130
|
}
|
|
750
1131
|
),
|
|
751
|
-
/* @__PURE__ */ e(
|
|
1132
|
+
/* @__PURE__ */ e(Io, { chartColor: S, chartLabel: g }),
|
|
752
1133
|
/* @__PURE__ */ C(b, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
|
|
753
|
-
/* @__PURE__ */ e(
|
|
754
|
-
/* @__PURE__ */ e(
|
|
1134
|
+
/* @__PURE__ */ e(F, { bold: !0, variant: "body1", children: v }),
|
|
1135
|
+
/* @__PURE__ */ e(oo, { filter: I })
|
|
755
1136
|
] })
|
|
756
1137
|
] }),
|
|
757
1138
|
/* @__PURE__ */ e(
|
|
758
|
-
|
|
1139
|
+
Ze,
|
|
759
1140
|
{
|
|
760
1141
|
bgcolor: "transparent",
|
|
761
|
-
filter:
|
|
1142
|
+
filter: I,
|
|
762
1143
|
height: "calc(100vh - 475px)",
|
|
763
|
-
onClick:
|
|
1144
|
+
onClick: d
|
|
764
1145
|
}
|
|
765
1146
|
)
|
|
766
1147
|
] }),
|
|
767
1148
|
/* @__PURE__ */ e(
|
|
768
|
-
|
|
1149
|
+
ke,
|
|
769
1150
|
{
|
|
770
|
-
ariaLabelClose:
|
|
771
|
-
isOpen: !!
|
|
772
|
-
onClose: () =>
|
|
773
|
-
title:
|
|
774
|
-
children:
|
|
1151
|
+
ariaLabelClose: n.close_aria,
|
|
1152
|
+
isOpen: !!E,
|
|
1153
|
+
onClose: () => d(""),
|
|
1154
|
+
title: s.transaction,
|
|
1155
|
+
children: E && /* @__PURE__ */ e(Xe, { transaction: E })
|
|
775
1156
|
}
|
|
776
1157
|
)
|
|
777
1158
|
]
|
|
778
1159
|
}
|
|
779
1160
|
);
|
|
780
|
-
}),
|
|
781
|
-
const
|
|
782
|
-
return [
|
|
783
|
-
},
|
|
784
|
-
const [
|
|
785
|
-
if (
|
|
786
|
-
const h =
|
|
787
|
-
|
|
1161
|
+
}), Ao = (o, a) => {
|
|
1162
|
+
const t = Ye(o, a), n = je(o, a);
|
|
1163
|
+
return [t, n].filter((s) => s.length > 0);
|
|
1164
|
+
}, Ro = (o, a) => {
|
|
1165
|
+
const [t, n] = o, s = t, l = n ?? t, m = [];
|
|
1166
|
+
if (s) {
|
|
1167
|
+
const h = s.reduce((i, d) => i + d.y, 0);
|
|
1168
|
+
m.push({ label: a.income_label, amount: h });
|
|
788
1169
|
}
|
|
789
1170
|
if (l) {
|
|
790
|
-
const h = l.reduce((
|
|
791
|
-
|
|
1171
|
+
const h = l.reduce((i, d) => i + d.y, 0);
|
|
1172
|
+
m.push({ label: a.spending_label, amount: h });
|
|
792
1173
|
}
|
|
793
|
-
return
|
|
794
|
-
},
|
|
795
|
-
availableHeight:
|
|
796
|
-
minHeight:
|
|
797
|
-
selectedDateRange:
|
|
798
|
-
totals:
|
|
1174
|
+
return m;
|
|
1175
|
+
}, ko = ({
|
|
1176
|
+
availableHeight: o = 0,
|
|
1177
|
+
minHeight: a = 500,
|
|
1178
|
+
selectedDateRange: t,
|
|
1179
|
+
totals: n
|
|
799
1180
|
}) => {
|
|
800
|
-
const
|
|
801
|
-
return
|
|
802
|
-
const
|
|
803
|
-
|
|
804
|
-
}, [
|
|
805
|
-
|
|
1181
|
+
const s = we(), { onEvent: l } = P(), { trends: m } = O(), { isSmallMobile: h, isMobile: i, isSmallTablet: d, isTablet: f } = J(), p = [s.palette.chart?.chart1, s.palette.chart?.chart2], _ = Ao(n, t), u = Ro(_, m), [y, S] = c.useState(0), g = 458, v = 195, E = 56, I = i || h ? v : d || f ? g : y;
|
|
1182
|
+
return c.useEffect(() => {
|
|
1183
|
+
const M = Math.max(o - E, a);
|
|
1184
|
+
S(M);
|
|
1185
|
+
}, [o]), /* @__PURE__ */ e(
|
|
1186
|
+
Ne,
|
|
806
1187
|
{
|
|
807
1188
|
baseline: "min",
|
|
808
|
-
colors:
|
|
1189
|
+
colors: p,
|
|
809
1190
|
curveType: "bump",
|
|
810
|
-
datasets:
|
|
811
|
-
height:
|
|
812
|
-
labels:
|
|
1191
|
+
datasets: _,
|
|
1192
|
+
height: I,
|
|
1193
|
+
labels: u,
|
|
813
1194
|
onItemClick: () => {
|
|
814
|
-
l(
|
|
1195
|
+
l(w.TRENDS_CLICK_CHART, V);
|
|
815
1196
|
},
|
|
816
1197
|
showArea: !0,
|
|
817
1198
|
showAxisHighlight: !0,
|
|
@@ -824,7 +1205,7 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
824
1205
|
valueFormatterString: "0.0a"
|
|
825
1206
|
}
|
|
826
1207
|
);
|
|
827
|
-
},
|
|
1208
|
+
}, Ho = R(ko), No = [
|
|
828
1209
|
"BillAmountNotStandard",
|
|
829
1210
|
"CategorySpendingV2",
|
|
830
1211
|
"CostOfLivingToIncome",
|
|
@@ -858,109 +1239,105 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
858
1239
|
"WeeklyNewMerchantsV2",
|
|
859
1240
|
"WeeklyNoSpendDays",
|
|
860
1241
|
"WeeklySmallPurchasesSummary"
|
|
861
|
-
],
|
|
862
|
-
const { onEvent:
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
} =
|
|
869
|
-
() =>
|
|
870
|
-
[
|
|
871
|
-
);
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
g(
|
|
884
|
-
D,
|
|
885
|
-
a.start,
|
|
886
|
-
a.end
|
|
1242
|
+
], Wo = ({ onBackClick: o, onInsightCardClick: a, sx: t }) => {
|
|
1243
|
+
const { onEvent: n } = P(), { onLoad: s } = _t(), { config: l } = Tt(), { isLargeDesktop: m, isDesktop: h, isMobile: i } = J(), { isAccountDataLoaded: d, loadAccountData: f, visibleAccounts: p } = Le(), {
|
|
1244
|
+
categoriesLoaded: _,
|
|
1245
|
+
loadCategories: u,
|
|
1246
|
+
loadDateRangeCategoryTotals: y,
|
|
1247
|
+
loadMonthlyCategoryTotals: S,
|
|
1248
|
+
monthlyCategoryTotals: g
|
|
1249
|
+
} = Y(), { isTransactionDataLoaded: v, loadTransactionData: E, setFilter: I } = De(), { selectedDateRange: x, setSelectedCategoryData: M, setSelectedDateRange: k } = Ce(), { isInitialized: A, selectedAccounts: G, selectedAccountGuids: ee, setSelectedAccounts: ne } = fe(), { trends: H, connect: ue } = O(), { beatStore: B } = He(), ae = no() && l.show_insights_widget_in_master, z = h || m, [ye, U] = c.useState(!1), [K, re] = c.useState(!1), [X, Z] = c.useState("Chart"), [te, ie] = c.useState(""), [he, ce] = c.useState(!1), [le, D] = c.useState(window.innerHeight), r = z ? 56 : 0, T = le - 208, L = le - (ae ? 550 + r : 266), [j, _e] = c.useState(!1), Ee = l.show_connections_widget_in_master ? "buttons" : "no-buttons", de = c.useMemo(
|
|
1250
|
+
() => p && p.length === 0 || g.length === 0,
|
|
1251
|
+
[p, g]
|
|
1252
|
+
), Te = c.useMemo(() => K ? B.getFilteredBeats({ templates: No }) : [], [K]);
|
|
1253
|
+
c.useEffect(() => {
|
|
1254
|
+
const N = () => D(window.innerHeight);
|
|
1255
|
+
return window.addEventListener("resize", N), d || f().finally(), _ || u().finally(), v || E().finally(), () => window.removeEventListener("resize", N);
|
|
1256
|
+
}, []), c.useEffect(() => {
|
|
1257
|
+
ne(p);
|
|
1258
|
+
}, [p]), c.useEffect(() => {
|
|
1259
|
+
A && (B.loadBeats().finally(() => re(!0)), y(G, x.start, x.end).then(() => {
|
|
1260
|
+
S(
|
|
1261
|
+
G,
|
|
1262
|
+
x.start,
|
|
1263
|
+
x.end
|
|
887
1264
|
);
|
|
888
1265
|
}).finally(() => {
|
|
889
|
-
|
|
890
|
-
...
|
|
891
|
-
time_period: `${
|
|
892
|
-
}),
|
|
893
|
-
});
|
|
894
|
-
}, [
|
|
895
|
-
if (
|
|
896
|
-
const
|
|
897
|
-
accounts:
|
|
898
|
-
dateRange: { start:
|
|
1266
|
+
U(!0), n(w.TRENDS_LOAD_WIDGET, {
|
|
1267
|
+
...V,
|
|
1268
|
+
time_period: `${Ae(x.end, x.start)}M`
|
|
1269
|
+
}), s?.("TrendsWidget");
|
|
1270
|
+
}));
|
|
1271
|
+
}, [A, G, x]), c.useEffect(() => {
|
|
1272
|
+
if (g.length !== 0) {
|
|
1273
|
+
const N = {
|
|
1274
|
+
accounts: ee,
|
|
1275
|
+
dateRange: { start: x.start, end: x.end }
|
|
899
1276
|
};
|
|
900
|
-
|
|
901
|
-
...
|
|
902
|
-
custom: (
|
|
903
|
-
(
|
|
1277
|
+
I({
|
|
1278
|
+
...N,
|
|
1279
|
+
custom: (q) => !!g.find(
|
|
1280
|
+
(ge) => ge.top_level_category_guid === q.top_level_category_guid || ge.category_guid === q.category_guid
|
|
904
1281
|
)
|
|
905
1282
|
});
|
|
906
1283
|
}
|
|
907
|
-
}, [
|
|
908
|
-
const
|
|
909
|
-
|
|
910
|
-
},
|
|
911
|
-
|
|
912
|
-
},
|
|
913
|
-
|
|
914
|
-
},
|
|
915
|
-
|
|
916
|
-
...
|
|
917
|
-
toggleView:
|
|
1284
|
+
}, [g]);
|
|
1285
|
+
const Ie = (N) => {
|
|
1286
|
+
M(N), ce(!0);
|
|
1287
|
+
}, ot = () => {
|
|
1288
|
+
M(null), ce(!1);
|
|
1289
|
+
}, nt = () => {
|
|
1290
|
+
_e(!0), n(w.TRENDS_CLICK_CONNECT_ACCOUNTS);
|
|
1291
|
+
}, st = (N, q) => {
|
|
1292
|
+
Z(q ?? X), n(w.TRENDS_CLICK_TOGGLE_VIEW, {
|
|
1293
|
+
...V,
|
|
1294
|
+
toggleView: q
|
|
918
1295
|
});
|
|
919
|
-
},
|
|
920
|
-
const
|
|
921
|
-
|
|
922
|
-
...
|
|
923
|
-
time_period:
|
|
1296
|
+
}, at = (N) => {
|
|
1297
|
+
const q = $e(N?.[0], 1), ge = N?.[1], lt = Ae(ge, q);
|
|
1298
|
+
k({ start: q, end: ge }), n(w.TRENDS_CLICK_TIME_WINDOW, {
|
|
1299
|
+
...V,
|
|
1300
|
+
time_period: lt + "M"
|
|
924
1301
|
});
|
|
925
|
-
},
|
|
926
|
-
|
|
927
|
-
...
|
|
928
|
-
filterValue:
|
|
1302
|
+
}, rt = (N) => {
|
|
1303
|
+
n(w.TRENDS_CLICK_FILTER, {
|
|
1304
|
+
...V,
|
|
1305
|
+
filterValue: N
|
|
929
1306
|
});
|
|
930
|
-
},
|
|
931
|
-
|
|
932
|
-
},
|
|
933
|
-
|
|
1307
|
+
}, it = (N) => {
|
|
1308
|
+
ie(N);
|
|
1309
|
+
}, ct = () => {
|
|
1310
|
+
ie(""), n(w.TRENDS_CLICK_ALL_CATEGORIES, V);
|
|
934
1311
|
};
|
|
935
|
-
return !
|
|
936
|
-
|
|
1312
|
+
return !A || !ye ? /* @__PURE__ */ e(pe, {}) : /* @__PURE__ */ C(
|
|
1313
|
+
Ue,
|
|
937
1314
|
{
|
|
938
|
-
accountOptions:
|
|
939
|
-
calendarActions: { onRangeChanged:
|
|
940
|
-
dateRange:
|
|
941
|
-
dateRangeVariant:
|
|
942
|
-
onAccountsFilterClick:
|
|
943
|
-
onBackClick:
|
|
944
|
-
sx:
|
|
945
|
-
title:
|
|
1315
|
+
accountOptions: p,
|
|
1316
|
+
calendarActions: { onRangeChanged: at },
|
|
1317
|
+
dateRange: x,
|
|
1318
|
+
dateRangeVariant: i ? "timeframetabs" : "timeframebuttons",
|
|
1319
|
+
onAccountsFilterClick: rt,
|
|
1320
|
+
onBackClick: o,
|
|
1321
|
+
sx: t,
|
|
1322
|
+
title: H.title,
|
|
946
1323
|
children: [
|
|
947
|
-
|
|
948
|
-
|
|
1324
|
+
de && /* @__PURE__ */ e(
|
|
1325
|
+
so,
|
|
949
1326
|
{
|
|
950
|
-
header:
|
|
1327
|
+
header: H.zero_state_content_header,
|
|
951
1328
|
icon: "",
|
|
952
|
-
onClick:
|
|
953
|
-
primaryButton:
|
|
954
|
-
subText:
|
|
955
|
-
sx: { height:
|
|
956
|
-
variant:
|
|
1329
|
+
onClick: nt,
|
|
1330
|
+
primaryButton: H.empty_state_primary,
|
|
1331
|
+
subText: H.empty_state_sub_text,
|
|
1332
|
+
sx: { height: T },
|
|
1333
|
+
variant: Ee
|
|
957
1334
|
}
|
|
958
1335
|
),
|
|
959
|
-
!
|
|
1336
|
+
!de && /* @__PURE__ */ C(
|
|
960
1337
|
b,
|
|
961
1338
|
{
|
|
962
1339
|
sx: {
|
|
963
|
-
px:
|
|
1340
|
+
px: i ? 0 : 48
|
|
964
1341
|
},
|
|
965
1342
|
children: [
|
|
966
1343
|
/* @__PURE__ */ C(
|
|
@@ -968,82 +1345,82 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
968
1345
|
{
|
|
969
1346
|
flexDirection: "row",
|
|
970
1347
|
justifyContent: "space-between",
|
|
971
|
-
sx: { pb:
|
|
1348
|
+
sx: { pb: i ? 12 : 24, pt: i ? 24 : 48 },
|
|
972
1349
|
children: [
|
|
973
1350
|
/* @__PURE__ */ e(
|
|
974
|
-
|
|
1351
|
+
et,
|
|
975
1352
|
{
|
|
976
|
-
selectedCategoryGuid:
|
|
977
|
-
selectedDateRange:
|
|
1353
|
+
selectedCategoryGuid: te,
|
|
1354
|
+
selectedDateRange: x
|
|
978
1355
|
}
|
|
979
1356
|
),
|
|
980
|
-
/* @__PURE__ */ e(
|
|
1357
|
+
/* @__PURE__ */ e(Je, { onTabChange: st, selectedTab: X })
|
|
981
1358
|
]
|
|
982
1359
|
}
|
|
983
1360
|
),
|
|
984
|
-
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(
|
|
985
|
-
/* @__PURE__ */ e(
|
|
986
|
-
|
|
1361
|
+
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(W, { flexGrow: 1, children: te && /* @__PURE__ */ C(be, { onClick: ct, sx: { p: 0, pr: 5 }, children: [
|
|
1362
|
+
/* @__PURE__ */ e(Se, { name: "arrow_back" }),
|
|
1363
|
+
H.all_categories
|
|
987
1364
|
] }) }) }),
|
|
988
|
-
/* @__PURE__ */ C(b, { flexDirection:
|
|
989
|
-
|
|
990
|
-
/* @__PURE__ */ e(
|
|
991
|
-
|
|
1365
|
+
/* @__PURE__ */ C(b, { flexDirection: z ? "row" : "column", gap: z ? 48 : 16, children: [
|
|
1366
|
+
X === "Chart" && /* @__PURE__ */ C(dt, { children: [
|
|
1367
|
+
/* @__PURE__ */ e(W, { sx: { width: z ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
1368
|
+
Ho,
|
|
992
1369
|
{
|
|
993
|
-
availableHeight:
|
|
1370
|
+
availableHeight: T,
|
|
994
1371
|
minHeight: 450,
|
|
995
|
-
selectedDateRange:
|
|
996
|
-
totals:
|
|
1372
|
+
selectedDateRange: x,
|
|
1373
|
+
totals: g
|
|
997
1374
|
}
|
|
998
1375
|
) }),
|
|
999
|
-
/* @__PURE__ */ C(b, { gap: 16, sx: { width:
|
|
1000
|
-
|
|
1001
|
-
|
|
1376
|
+
/* @__PURE__ */ C(b, { gap: 16, sx: { width: z ? "32%" : "100%" }, children: [
|
|
1377
|
+
ae && K && Te.length > 0 && /* @__PURE__ */ e(
|
|
1378
|
+
Eo,
|
|
1002
1379
|
{
|
|
1003
|
-
beats:
|
|
1004
|
-
onInsightCardClick:
|
|
1380
|
+
beats: Te,
|
|
1381
|
+
onInsightCardClick: a
|
|
1005
1382
|
}
|
|
1006
1383
|
),
|
|
1007
1384
|
/* @__PURE__ */ e(
|
|
1008
|
-
|
|
1385
|
+
Do,
|
|
1009
1386
|
{
|
|
1010
|
-
availableHeight:
|
|
1011
|
-
onCategoryClick:
|
|
1387
|
+
availableHeight: L,
|
|
1388
|
+
onCategoryClick: Ie
|
|
1012
1389
|
}
|
|
1013
1390
|
)
|
|
1014
1391
|
] })
|
|
1015
1392
|
] }),
|
|
1016
|
-
|
|
1017
|
-
|
|
1393
|
+
X === "Table" && /* @__PURE__ */ e(W, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1394
|
+
tt,
|
|
1018
1395
|
{
|
|
1019
1396
|
height: "unset",
|
|
1020
|
-
monthlyCategoryTotals:
|
|
1021
|
-
onClickRow:
|
|
1022
|
-
selectedCategory:
|
|
1023
|
-
selectedDateRange:
|
|
1397
|
+
monthlyCategoryTotals: g,
|
|
1398
|
+
onClickRow: it,
|
|
1399
|
+
selectedCategory: te,
|
|
1400
|
+
selectedDateRange: x
|
|
1024
1401
|
}
|
|
1025
1402
|
) })
|
|
1026
1403
|
] }),
|
|
1027
|
-
|
|
1404
|
+
he && /* @__PURE__ */ e(Mo, { onClose: ot })
|
|
1028
1405
|
]
|
|
1029
1406
|
}
|
|
1030
1407
|
),
|
|
1031
1408
|
/* @__PURE__ */ e(
|
|
1032
|
-
|
|
1409
|
+
ao,
|
|
1033
1410
|
{
|
|
1034
|
-
onClose: () =>
|
|
1035
|
-
showConnectWidget:
|
|
1036
|
-
title:
|
|
1411
|
+
onClose: () => _e(!1),
|
|
1412
|
+
showConnectWidget: j,
|
|
1413
|
+
title: ue.mini_title
|
|
1037
1414
|
}
|
|
1038
1415
|
)
|
|
1039
1416
|
]
|
|
1040
1417
|
}
|
|
1041
1418
|
);
|
|
1042
|
-
},
|
|
1419
|
+
}, Vn = R(Wo);
|
|
1043
1420
|
export {
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1421
|
+
On as TrendsFullWidget,
|
|
1422
|
+
Bn as TrendsMicroWidget,
|
|
1423
|
+
Gn as TrendsMiniWidget,
|
|
1424
|
+
Fn as TrendsStore,
|
|
1425
|
+
Vn as TrendsWidget
|
|
1049
1426
|
};
|