@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.mega1
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 +178 -1
- package/dist/{Account-Bxw0_4FU.mjs → Account-CvR2-dSR.mjs} +1 -1
- package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-CitErkuS.mjs} +89 -82
- package/dist/AccountDetailsHeader-BkG3MNYo.mjs +87 -0
- package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-zCMqet85.mjs} +6 -6
- package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-DHrz8Mml.mjs} +9 -9
- package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-LgfBcYMe.mjs} +112 -75
- package/dist/Accounts-Bzy1_REQ.mjs +9 -0
- 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-BmZXkL0C.mjs} +2 -2
- package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +23 -21
- package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
- package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
- package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-BkvlItWx.mjs} +11 -11
- package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
- package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-itK0R3wV.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-Bq-aPy-5.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-By9V-B5L.mjs +178 -0
- package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
- package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-Cglo8Mca.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-1P19goZ7.mjs} +112 -152
- package/dist/{Help-B6dIcujh.mjs → Help-Ea3BlXQp.mjs} +2 -2
- package/dist/LineChart-KpPw1phO.mjs +580 -0
- package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BxTkF6Tz.mjs} +10 -10
- package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-CaoQl609.mjs} +91 -88
- package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
- package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
- package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
- package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-rC0q7P7t.mjs} +2 -2
- package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-uzM8tCoH.mjs} +236 -231
- package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-CDX_kqHa.mjs} +7 -15
- package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
- package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +4 -4
- package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-B4ybrS0B.mjs} +4 -4
- package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-BqijW_8S.mjs} +49 -48
- package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +26 -29
- package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
- package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DQ1b9uqq.mjs} +11 -13
- package/dist/SpendingLegend-CDO060GT.mjs +193 -0
- package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
- package/dist/TransactionApi-CjBoLleL.mjs +86 -0
- package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
- package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
- package/dist/TrendsStore-yO7qYv97.mjs +186 -0
- package/dist/{User-BQUxBeZV.mjs → User-Cnlegl1N.mjs} +2 -2
- package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +711 -728
- package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CoFDmQRE.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 +245 -235
- package/dist/accounts/stores/AccountStore.d.ts +24 -25
- package/dist/accounts/utils/Accounts.d.ts +1 -2
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/components/AddBudgets.d.ts +2 -1
- package/dist/budgets/index.es.js +611 -580
- package/dist/budgets/store/BudgetsStore.d.ts +0 -1
- package/dist/cashflow/index.es.js +187 -180
- package/dist/categories/index.es.js +2 -2
- package/dist/categories/stores/CategoryStore.d.ts +2 -5
- package/dist/categories/util/CategoryUtil.d.ts +2 -3
- 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/charts/linechart/CustomTooltip.d.ts +6 -1
- package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
- 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 +1 -0
- package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
- package/dist/common/index.es.js +397 -387
- package/dist/common/stores/AppDataStore.d.ts +1 -3
- package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
- package/dist/common/stores/GlobalStore.d.ts +10 -4
- package/dist/common/stores/GlobalUiStore.d.ts +2 -3
- package/dist/common/stores/UserStore.d.ts +2 -3
- package/dist/common/types/Account.d.ts +6 -9
- 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/common/types/localization/TransactionsCopy.d.ts +1 -0
- package/dist/dashboard/index.es.js +90 -88
- package/dist/debts/index.es.js +458 -448
- package/dist/exportTransactionsToCSV-DuAaI5XA.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 +24 -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 +3190 -1073
- package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
- package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
- package/dist/goals/index.es.js +302 -291
- package/dist/goals/stores/GoalStore.d.ts +4 -17
- package/dist/help/index.es.js +13 -9
- package/dist/{hooks-D6XlXHf4.mjs → hooks-ZMp65DFz.mjs} +12 -12
- package/dist/insights/index.es.js +1 -1
- package/dist/investments/index.es.js +108 -104
- package/dist/investments/stores/HoldingStore.d.ts +0 -1
- package/dist/merchants/index.es.js +2 -2
- package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
- 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 +4 -3
- package/dist/microinsights/index.es.js +101 -14
- package/dist/microinsights/interfaces.d.ts +0 -6
- package/dist/networth/index.es.js +197 -190
- package/dist/notifications/index.es.js +25 -25
- package/dist/notifications/stores/NotificationStore.d.ts +1 -3
- package/dist/recurringtransactions/index.es.js +395 -351
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -3
- package/dist/settings/index.es.js +307 -298
- package/dist/spending/index.es.js +299 -438
- 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 +115 -112
- package/dist/transactions/stores/TransactionStore.d.ts +77 -21
- package/dist/trends/components/TrendsTable.d.ts +0 -2
- package/dist/trends/index.es.js +1025 -604
- package/dist/trends/utils/TrendsData.d.ts +1 -0
- package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
- package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
- package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
- package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
- package/package.json +4 -4
- package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
- package/dist/Accounts-BRf_YeTf.mjs +0 -27
- package/dist/CategoryStore-yHI0hWmK.mjs +0 -174
- package/dist/CategoryUtil-pZRIYOgN.mjs +0 -80
- package/dist/Drawer-kEE73B87.mjs +0 -113
- package/dist/FinstrongStore-F2c607dj.mjs +0 -101
- package/dist/LineChart-D4GI7nVh.mjs +0 -541
- package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
- package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
- package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
- package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
- package/dist/TransactionStore-ai3uII_r.mjs +0 -690
- package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
- package/dist/common/components/SkeletonLoader.d.ts +0 -7
- 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/budgets/index.es.js
CHANGED
|
@@ -1,126 +1,127 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as e, Fragment as We } from "react/jsx-runtime";
|
|
2
2
|
import l from "react";
|
|
3
3
|
import { observer as I } from "mobx-react-lite";
|
|
4
4
|
import { endOfMonth as ge } from "date-fns/endOfMonth";
|
|
5
|
-
import { startOfMonth as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { Text as y, CategoryIcon as
|
|
5
|
+
import { startOfMonth as Q } from "date-fns/startOfMonth";
|
|
6
|
+
import W from "@mui/material/Box";
|
|
7
|
+
import C from "@mui/material/Stack";
|
|
8
|
+
import te from "@mui/material/styles/useTheme";
|
|
9
|
+
import { Text as y, CategoryIcon as H, Icon as G, H1 as He, H3 as Ae } from "@mxenabled/mxui";
|
|
10
10
|
import K from "@mui/material/List";
|
|
11
|
-
import { u as w, i as D, j as
|
|
12
|
-
import { f as T } from "../NumberFormatting-
|
|
11
|
+
import { u as w, i as D, j as ne, m as F, p as oe, g as X, b as ae, h as re, a as Ke, d as ve } from "../hooks-ZMp65DFz.mjs";
|
|
12
|
+
import { f as T } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
13
13
|
import Te from "@mui/material/Button";
|
|
14
|
-
import
|
|
14
|
+
import se from "@mui/material/Divider";
|
|
15
15
|
import V from "@mui/material/ListItem";
|
|
16
|
-
import
|
|
16
|
+
import ie from "@mui/material/ListItemAvatar";
|
|
17
17
|
import Y from "@mui/material/ListItemButton";
|
|
18
18
|
import Z from "@mui/material/ListItemText";
|
|
19
|
-
import { b as
|
|
20
|
-
import { D as
|
|
21
|
-
import
|
|
22
|
-
import { C as
|
|
23
|
-
import {
|
|
24
|
-
import { C as
|
|
25
|
-
import * as
|
|
26
|
-
import
|
|
27
|
-
import { useTheme as
|
|
28
|
-
import { u as
|
|
29
|
-
import { L as
|
|
30
|
-
import { E as ue } from "../EmptyState-
|
|
31
|
-
import { A as
|
|
32
|
-
import { u as
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import
|
|
37
|
-
import
|
|
19
|
+
import { b as L } from "../Localization-2MODESHW.mjs";
|
|
20
|
+
import { D as P } from "../Drawer-By9V-B5L.mjs";
|
|
21
|
+
import Xe from "@mui/material/ListItemSecondaryAction";
|
|
22
|
+
import { C as Ve } from "../CurrencyInput-itK0R3wV.mjs";
|
|
23
|
+
import { D as z } from "../Dialog-BPTr3qHE.mjs";
|
|
24
|
+
import { C as Ye } from "../ConnectionsDrawer-VmuVFHbL.mjs";
|
|
25
|
+
import * as E from "d3";
|
|
26
|
+
import Ze from "@mui/material/Tooltip";
|
|
27
|
+
import { useTheme as qe } from "@mui/material/styles";
|
|
28
|
+
import { u as ce } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
29
|
+
import { L as U } from "../Loader-DUaFpDGv.mjs";
|
|
30
|
+
import { E as ue } from "../EmptyState-DoxNUae-.mjs";
|
|
31
|
+
import { A as $, W as Je } from "../WidgetContainer-CoFDmQRE.mjs";
|
|
32
|
+
import { u as Qe } from "../BudgetUtil-BmZXkL0C.mjs";
|
|
33
|
+
import { u as we } from "../useWidgetLoadTimer-hIOioiKx.mjs";
|
|
34
|
+
import { M as et } from "../MiniWidgetContainer-Bg02sF1Y.mjs";
|
|
35
|
+
import { isAfter as tt } from "date-fns/isAfter";
|
|
36
|
+
import { startOfToday as J } from "date-fns/startOfToday";
|
|
37
|
+
import De from "@mui/material/Alert";
|
|
38
|
+
import Ie from "@mui/material/Snackbar";
|
|
38
39
|
import _e from "@mui/material/Tab";
|
|
39
|
-
import
|
|
40
|
-
import { e as
|
|
41
|
-
import { T as
|
|
40
|
+
import nt from "@mui/material/Tabs";
|
|
41
|
+
import { e as ot } from "../exportTransactionsToCSV-DuAaI5XA.mjs";
|
|
42
|
+
import { T as Ee, a as at } from "../TransactionDetails-m5PddMQn.mjs";
|
|
42
43
|
import he from "@mui/material/Card";
|
|
43
44
|
import fe from "@mui/material/CardContent";
|
|
44
45
|
import { S as pe } from "../StatusBar-BK_uYHAB.mjs";
|
|
45
|
-
import { S as
|
|
46
|
-
import { u as
|
|
47
|
-
import
|
|
48
|
-
import { subDays as
|
|
49
|
-
import
|
|
50
|
-
import { M as
|
|
51
|
-
const
|
|
52
|
-
const { budgets: t } = w(), { totalBudgeted:
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
46
|
+
import { S as Oe } from "../SingleSegmentDonut-BgbLgwHi.mjs";
|
|
47
|
+
import { u as rt, b as st } from "../CategorySelectorDrawer-B-I3kajA.mjs";
|
|
48
|
+
import Me from "@mui/material/CardHeader";
|
|
49
|
+
import { subDays as it } from "date-fns/subDays";
|
|
50
|
+
import ct from "@mui/material/IconButton";
|
|
51
|
+
import { M as lt } from "../ManageIncome-CaoQl609.mjs";
|
|
52
|
+
const dt = I(() => {
|
|
53
|
+
const { budgets: t } = w(), { totalBudgeted: n } = D(), { incomeTotal: i } = ne(), s = i - n;
|
|
54
|
+
return /* @__PURE__ */ m(C, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
|
|
55
|
+
/* @__PURE__ */ m(C, { alignItems: "center", children: [
|
|
55
56
|
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: T(i, "0,0") }),
|
|
56
57
|
/* @__PURE__ */ e(y, { color: "secondary", variant: "Small", children: t.projected_income })
|
|
57
58
|
] }),
|
|
58
59
|
/* @__PURE__ */ e(y, { bold: !0, justifyContent: "center", variant: "Body", children: "-" }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: T(
|
|
60
|
+
/* @__PURE__ */ m(C, { alignItems: "center", children: [
|
|
61
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: T(n, "0,0") }),
|
|
61
62
|
/* @__PURE__ */ e(y, { color: "secondary", variant: "Small", children: t.budgeted })
|
|
62
63
|
] }),
|
|
63
64
|
/* @__PURE__ */ e(y, { bold: !0, justifyContent: "center", variant: "Body", children: "=" }),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ m(C, { alignItems: "center", children: [
|
|
65
66
|
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: T(s, "0,0") }),
|
|
66
67
|
/* @__PURE__ */ e(y, { color: "secondary", variant: "Small", children: t.remaining })
|
|
67
68
|
] })
|
|
68
69
|
] });
|
|
69
|
-
}),
|
|
70
|
+
}), ut = I(
|
|
70
71
|
({ category: t }) => {
|
|
71
|
-
const { budgets:
|
|
72
|
-
const
|
|
73
|
-
return `${
|
|
74
|
-
}, [
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */ e(V, { children: /* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */ e(
|
|
72
|
+
const { budgets: n } = w(), { budgets: i } = D(), s = l.useMemo(() => {
|
|
73
|
+
const o = i.find((c) => c.category_guid === t.guid), r = T(t.totalAverageAmount, "0,0"), a = o ? L(n.recalculate_previous_budget, T(o.amount, "0,0")) : n.recalculate_new_budget;
|
|
74
|
+
return `${r} - ${a}`;
|
|
75
|
+
}, [n, i]);
|
|
76
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
77
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ m(Y, { children: [
|
|
78
|
+
/* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid, variant: "filled" }) }),
|
|
78
79
|
/* @__PURE__ */ e(Z, { primary: t.name, secondary: s })
|
|
79
80
|
] }) }),
|
|
80
|
-
/* @__PURE__ */ e(
|
|
81
|
+
/* @__PURE__ */ e(se, {})
|
|
81
82
|
] }, t.guid);
|
|
82
83
|
}
|
|
83
|
-
),
|
|
84
|
-
const { budgets:
|
|
85
|
-
await
|
|
84
|
+
), mt = ({ onRecalculateBudgets: t }) => {
|
|
85
|
+
const { budgets: n, common: i } = w(), { spendCategories: s } = F(), { recalculateBudgets: o, setAlert: r } = D(), [a, c] = l.useState(!1), d = s.filter((u) => u.totalAverageAmount > 0), g = async () => {
|
|
86
|
+
await o(d), c(!1), r(n.alert_recalculated_budgets), t?.();
|
|
86
87
|
};
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */ e(Te, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children:
|
|
89
|
-
/* @__PURE__ */ e(y, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children:
|
|
88
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
89
|
+
/* @__PURE__ */ e(Te, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: n.recalculate_button }),
|
|
90
|
+
/* @__PURE__ */ e(y, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children: n.recalculate_help }),
|
|
90
91
|
/* @__PURE__ */ e(
|
|
91
|
-
|
|
92
|
+
P,
|
|
92
93
|
{
|
|
93
94
|
ariaLabelClose: i.close_aria,
|
|
94
|
-
isOpen:
|
|
95
|
+
isOpen: a,
|
|
95
96
|
onClose: () => c(!1),
|
|
96
|
-
onPrimaryAction:
|
|
97
|
-
title:
|
|
98
|
-
children: /* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children:
|
|
101
|
-
/* @__PURE__ */ e(y, { variant: "ParagraphSmall", children:
|
|
97
|
+
onPrimaryAction: g,
|
|
98
|
+
title: n.recalculate_title,
|
|
99
|
+
children: /* @__PURE__ */ m(C, { children: [
|
|
100
|
+
/* @__PURE__ */ m(C, { mx: 24, my: 16, children: [
|
|
101
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: n.recalculate_description_top }),
|
|
102
|
+
/* @__PURE__ */ e(y, { variant: "ParagraphSmall", children: n.recalculate_description_bottom })
|
|
102
103
|
] }),
|
|
103
|
-
/* @__PURE__ */ e(
|
|
104
|
+
/* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(K, { children: d.map((u) => /* @__PURE__ */ e(ut, { category: u }, u.guid)) }) })
|
|
104
105
|
] })
|
|
105
106
|
}
|
|
106
107
|
)
|
|
107
108
|
] });
|
|
108
|
-
},
|
|
109
|
+
}, le = ({
|
|
109
110
|
amount: t,
|
|
110
|
-
categoryName:
|
|
111
|
+
categoryName: n,
|
|
111
112
|
onAmountChanged: i
|
|
112
113
|
}) => {
|
|
113
|
-
const { budgets: s } = w(), { totalBudgeted:
|
|
114
|
-
return /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */ e(y, { children:
|
|
114
|
+
const { budgets: s } = w(), { totalBudgeted: o } = D(), { incomeTotal: r } = ne(), a = r - o;
|
|
115
|
+
return /* @__PURE__ */ m(C, { gap: 16, children: [
|
|
116
|
+
/* @__PURE__ */ m(C, { children: [
|
|
117
|
+
/* @__PURE__ */ e(y, { children: L(
|
|
117
118
|
s.add_description_top,
|
|
118
|
-
T(
|
|
119
|
+
T(a, "0,0")
|
|
119
120
|
) }),
|
|
120
|
-
/* @__PURE__ */ e(y, { children:
|
|
121
|
+
/* @__PURE__ */ e(y, { children: L(s.add_description_bottom, n) })
|
|
121
122
|
] }),
|
|
122
123
|
/* @__PURE__ */ e(
|
|
123
|
-
|
|
124
|
+
Ve,
|
|
124
125
|
{
|
|
125
126
|
amount: t,
|
|
126
127
|
autoFocus: !0,
|
|
@@ -131,13 +132,13 @@ const ct = I(() => {
|
|
|
131
132
|
}
|
|
132
133
|
)
|
|
133
134
|
] });
|
|
134
|
-
},
|
|
135
|
-
const { budgets: i, common: s } = w(), [
|
|
135
|
+
}, gt = I(({ category: t, onAddBudget: n }) => {
|
|
136
|
+
const { budgets: i, common: s } = w(), [o, r] = l.useState(!1), [a, c] = l.useState(
|
|
136
137
|
`${t.totalAmount === 0 ? "" : t.totalAmount}`
|
|
137
138
|
);
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */ e(V, { children: /* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */ e(
|
|
139
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
140
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ m(Y, { onClick: () => r(!0), children: [
|
|
141
|
+
/* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid }) }),
|
|
141
142
|
/* @__PURE__ */ e(
|
|
142
143
|
Z,
|
|
143
144
|
{
|
|
@@ -145,122 +146,122 @@ const ct = I(() => {
|
|
|
145
146
|
secondary: T(t.totalAmount, "0,0")
|
|
146
147
|
}
|
|
147
148
|
),
|
|
148
|
-
/* @__PURE__ */ e(
|
|
149
|
+
/* @__PURE__ */ e(Xe, { children: /* @__PURE__ */ e(G, { name: "add", size: 20 }) })
|
|
149
150
|
] }) }, t.guid),
|
|
150
151
|
/* @__PURE__ */ e(
|
|
151
|
-
|
|
152
|
+
z,
|
|
152
153
|
{
|
|
153
154
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
154
|
-
disablePrimaryButton: Number(
|
|
155
|
-
isOpen:
|
|
156
|
-
onClose: () =>
|
|
157
|
-
onPrimaryAction: () =>
|
|
155
|
+
disablePrimaryButton: Number(a) <= 0,
|
|
156
|
+
isOpen: o,
|
|
157
|
+
onClose: () => r(!1),
|
|
158
|
+
onPrimaryAction: () => n(t, Number(a)),
|
|
158
159
|
primaryText: i.add_save_button,
|
|
159
|
-
children: /* @__PURE__ */ e(
|
|
160
|
+
children: /* @__PURE__ */ e(le, { amount: a, categoryName: t.name, onAmountChanged: c })
|
|
160
161
|
}
|
|
161
162
|
)
|
|
162
163
|
] });
|
|
163
|
-
}),
|
|
164
|
-
const { budgets:
|
|
165
|
-
await
|
|
164
|
+
}), Re = I(({ onAddBudget: t, onRecalculateBudgets: n }) => {
|
|
165
|
+
const { budgets: i } = w(), { addBudget: s, setAlert: o, unbudgetedCategories: r } = D(), a = async (c, d) => {
|
|
166
|
+
await s(c, d), t?.(), o(L(i.alert_budget_created, c.name));
|
|
166
167
|
};
|
|
167
|
-
return /* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */ e(
|
|
169
|
-
/* @__PURE__ */ e(
|
|
170
|
-
|
|
168
|
+
return /* @__PURE__ */ m(C, { children: [
|
|
169
|
+
/* @__PURE__ */ e(dt, {}),
|
|
170
|
+
/* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(K, { children: r.map((c) => /* @__PURE__ */ e(
|
|
171
|
+
gt,
|
|
171
172
|
{
|
|
172
|
-
category:
|
|
173
|
-
onAddBudget:
|
|
173
|
+
category: c,
|
|
174
|
+
onAddBudget: a
|
|
174
175
|
},
|
|
175
|
-
|
|
176
|
+
c.guid
|
|
176
177
|
)) }) }),
|
|
177
|
-
/* @__PURE__ */ e(
|
|
178
|
+
/* @__PURE__ */ e(mt, { onRecalculateBudgets: n })
|
|
178
179
|
] });
|
|
179
|
-
}), Ce = 5,
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
}, i = (
|
|
183
|
-
|
|
184
|
-
}, s = (
|
|
185
|
-
|
|
180
|
+
}), Ce = 5, Le = 100, ee = 25, pt = (t) => {
|
|
181
|
+
const n = (o) => {
|
|
182
|
+
o.active || t.alphaTarget(0.3).restart(), o.subject.fx = o.subject.x, o.subject.fy = o.subject.y;
|
|
183
|
+
}, i = (o) => {
|
|
184
|
+
o.subject.fx = o.x, o.subject.fy = o.y;
|
|
185
|
+
}, s = (o) => {
|
|
186
|
+
o.active || t.alphaTarget(0), o.subject.fx = null, o.subject.fy = null;
|
|
186
187
|
};
|
|
187
|
-
return
|
|
188
|
-
},
|
|
189
|
-
let
|
|
190
|
-
|
|
191
|
-
const i =
|
|
192
|
-
return (
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
}, Be = (t,
|
|
188
|
+
return E.drag().on("start", n).on("drag", i).on("end", s);
|
|
189
|
+
}, ht = (t) => {
|
|
190
|
+
let n = t.transaction_total / t.amount;
|
|
191
|
+
n < 0 ? n = 0 : n > 1 && (n = 1);
|
|
192
|
+
const i = n * 2 * Math.PI, s = E.interpolate(0, i), o = E.arc().cornerRadius(5).innerRadius(t.radius - Ce * 2).outerRadius(t.radius - Ce).startAngle(0).endAngle(0);
|
|
193
|
+
return (r) => (o.endAngle(s(r)), o(t) || "");
|
|
194
|
+
}, ft = (t) => {
|
|
195
|
+
E.selectAll(".bubble").call(pt(t));
|
|
196
|
+
}, Be = (t, n, i) => Math.min(Math.max(t, n), i), bt = (t, n, i) => {
|
|
196
197
|
t.alpha(1).restart().force(
|
|
197
198
|
"x",
|
|
198
|
-
|
|
199
|
+
E.forceX().x(i / 2).strength(0.01)
|
|
199
200
|
).force(
|
|
200
201
|
"y",
|
|
201
|
-
|
|
202
|
+
E.forceY().y(n / 2).strength(0.02)
|
|
202
203
|
).on("tick", () => {
|
|
203
204
|
const s = t.nodes();
|
|
204
|
-
s.forEach((
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
}),
|
|
205
|
+
s.forEach((o) => {
|
|
206
|
+
const r = o.radius ?? ee;
|
|
207
|
+
o.x = Be(o.x ?? 0, r, i - r), o.y = Be(o.y ?? 0, r, n - r);
|
|
208
|
+
}), E.selectAll(".bubble").data(s).attr("transform", (o) => `translate(${o.x},${o.y})`);
|
|
208
209
|
});
|
|
209
|
-
},
|
|
210
|
-
const
|
|
211
|
-
const c = Math.max(
|
|
212
|
-
return c >
|
|
213
|
-
}, 0), i = t.reduce((
|
|
214
|
-
const c = Math.max(
|
|
215
|
-
return c <
|
|
216
|
-
},
|
|
217
|
-
const
|
|
210
|
+
}, ke = (t, n) => E.scaleLinear().domain([t, n]).range([ee, Le]), yt = (t) => {
|
|
211
|
+
const n = t.reduce((r, a) => {
|
|
212
|
+
const c = Math.max(a.transaction_total, a.amount);
|
|
213
|
+
return c > r ? c : r;
|
|
214
|
+
}, 0), i = t.reduce((r, a) => {
|
|
215
|
+
const c = Math.max(a.transaction_total, a.amount);
|
|
216
|
+
return c < r ? c : r;
|
|
217
|
+
}, n), s = ke(i, n), o = t.map((r) => {
|
|
218
|
+
const a = s(Math.max(r.transaction_total, r.amount)) || 25;
|
|
218
219
|
return {
|
|
219
|
-
...
|
|
220
|
-
radius:
|
|
220
|
+
...r,
|
|
221
|
+
radius: a
|
|
221
222
|
};
|
|
222
223
|
});
|
|
223
|
-
return
|
|
224
|
-
},
|
|
225
|
-
const
|
|
226
|
-
let u =
|
|
227
|
-
if (
|
|
228
|
-
const f = Math.sqrt(
|
|
229
|
-
u = Math.min(
|
|
224
|
+
return E.forceSimulation(o).velocityDecay(0.05).force("collide", E.forceCollide((r) => r.radius + 2).strength(0.7));
|
|
225
|
+
}, _t = (t, n, i) => {
|
|
226
|
+
const o = Math.PI * ee ** 2 * t, r = i < 400 || n < 300, a = r ? 40 : 20, c = Math.max(100, i - a), d = Math.max(100, n - a), g = c * d;
|
|
227
|
+
let u = ee;
|
|
228
|
+
if (o < g) {
|
|
229
|
+
const f = Math.sqrt(g / (t * Math.PI)), h = Math.min(c, d) / 4;
|
|
230
|
+
u = Math.min(Le, f, h);
|
|
230
231
|
}
|
|
231
|
-
return
|
|
232
|
-
},
|
|
233
|
-
const { maxRadius:
|
|
234
|
-
return
|
|
235
|
-
},
|
|
236
|
-
const
|
|
237
|
-
return t.map((
|
|
238
|
-
...
|
|
239
|
-
radius: d(Math.max(
|
|
232
|
+
return r && t <= 3 && (u = Math.min(u, 45)), { minRadius: Math.max(20, u * 0.6), maxRadius: u };
|
|
233
|
+
}, Ct = (t, n, i, s, o) => {
|
|
234
|
+
const { maxRadius: r, minRadius: a } = _t(t, n, o);
|
|
235
|
+
return E.scaleLinear().domain([s, i]).range([a, r]);
|
|
236
|
+
}, Bt = (t, n, i = !1, s, o) => {
|
|
237
|
+
const r = n.map((g) => Math.max(g.transaction_total, g.amount)), a = Math.min(...r), c = Math.max(...r), d = i ? Ct(t.length, s, c, a, o) : ke(a, c);
|
|
238
|
+
return t.map((g) => ({
|
|
239
|
+
...g,
|
|
240
|
+
radius: d(Math.max(g.transaction_total, g.amount))
|
|
240
241
|
}));
|
|
241
|
-
}, Se = 5,
|
|
242
|
-
const
|
|
242
|
+
}, Se = 5, St = 2e3, xt = ({ bubble: t }) => {
|
|
243
|
+
const n = te(), {
|
|
243
244
|
amount: i,
|
|
244
245
|
guid: s,
|
|
245
|
-
budgetColors: { mercury:
|
|
246
|
-
radius:
|
|
247
|
-
transaction_total:
|
|
246
|
+
budgetColors: { mercury: o },
|
|
247
|
+
radius: r,
|
|
248
|
+
transaction_total: a
|
|
248
249
|
} = t, c = `mercury-${s}`;
|
|
249
250
|
l.useEffect(() => {
|
|
250
|
-
|
|
251
|
-
}, [i,
|
|
252
|
-
const d =
|
|
251
|
+
E.select(`.${c}`).selectAll(".status").remove(), E.select(`.${c}`).append("path").transition().duration(St).delay(0).attr("class", "status").attr("style", `fill: ${o}; fill-opacity: 1;`).attrTween("d", () => ht(t));
|
|
252
|
+
}, [i, r, a]);
|
|
253
|
+
const d = E.arc().innerRadius((g) => g - 2 * Se).outerRadius((g) => g - Se).startAngle(0).endAngle(2 * Math.PI);
|
|
253
254
|
return /* @__PURE__ */ e("g", { className: c, children: /* @__PURE__ */ e(
|
|
254
255
|
"path",
|
|
255
256
|
{
|
|
256
|
-
d: d(
|
|
257
|
-
style: { fill:
|
|
257
|
+
d: d(r) || "",
|
|
258
|
+
style: { fill: n.palette.common.white, fillOpacity: 0.35 }
|
|
258
259
|
}
|
|
259
260
|
) });
|
|
260
|
-
},
|
|
261
|
-
function
|
|
261
|
+
}, At = l.memo(xt), j = 75, me = 50;
|
|
262
|
+
function vt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
262
263
|
} }) {
|
|
263
|
-
const [s,
|
|
264
|
+
const [s, o] = l.useState(!1), r = qe(), { availableWidth: a } = oe(), c = l.useMemo(() => {
|
|
264
265
|
if (t)
|
|
265
266
|
return {
|
|
266
267
|
amount: t.amount,
|
|
@@ -272,49 +273,49 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
|
272
273
|
}, [t.amount, t.budgetColors, t.guid, t.radius, t.transaction_total]);
|
|
273
274
|
if (!t) return;
|
|
274
275
|
const {
|
|
275
|
-
budgetColors: { background: d, text:
|
|
276
|
+
budgetColors: { background: d, text: g },
|
|
276
277
|
category: { icon: u, name: _ },
|
|
277
278
|
guid: f,
|
|
278
279
|
description: h,
|
|
279
280
|
radius: p,
|
|
280
|
-
x:
|
|
281
|
+
x: B,
|
|
281
282
|
y: b
|
|
282
|
-
} = t,
|
|
283
|
-
let
|
|
284
|
-
p >
|
|
283
|
+
} = t, S = a < 400 ? -8 : -12;
|
|
284
|
+
let A = S, v = S;
|
|
285
|
+
p > j ? (A = -14, v = -45) : p > me && (v = -32);
|
|
285
286
|
let x = 32;
|
|
286
|
-
p <=
|
|
287
|
-
const
|
|
287
|
+
p <= j && (x = a < 400 ? 16 : 24);
|
|
288
|
+
const O = `${t.category.name}: ${h}`, M = {
|
|
288
289
|
modifiers: [
|
|
289
290
|
{
|
|
290
291
|
name: "offset",
|
|
291
292
|
options: { offset: [0, 15] }
|
|
292
293
|
}
|
|
293
294
|
]
|
|
294
|
-
},
|
|
295
|
-
(
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
},
|
|
299
|
-
|
|
295
|
+
}, R = (k) => {
|
|
296
|
+
(k.key === "Enter" || k.key === " ") && (k.preventDefault(), i(t));
|
|
297
|
+
}, N = () => {
|
|
298
|
+
o(!0);
|
|
299
|
+
}, de = () => {
|
|
300
|
+
o(!1);
|
|
300
301
|
};
|
|
301
|
-
return /* @__PURE__ */
|
|
302
|
+
return /* @__PURE__ */ m(
|
|
302
303
|
"g",
|
|
303
304
|
{
|
|
304
305
|
"aria-label": `${_} - ${h}`,
|
|
305
306
|
className: "bubble",
|
|
306
307
|
id: `bubble-${f}`,
|
|
307
|
-
onBlur:
|
|
308
|
+
onBlur: de,
|
|
308
309
|
onClick: () => i(t),
|
|
309
|
-
onFocus:
|
|
310
|
-
onKeyDown:
|
|
311
|
-
onMouseEnter: () =>
|
|
312
|
-
onMouseLeave: () =>
|
|
310
|
+
onFocus: N,
|
|
311
|
+
onKeyDown: R,
|
|
312
|
+
onMouseEnter: () => o(!0),
|
|
313
|
+
onMouseLeave: () => o(!1),
|
|
313
314
|
role: "button",
|
|
314
|
-
style: { cursor:
|
|
315
|
+
style: { cursor: n ? "pointer" : "default" },
|
|
315
316
|
tabIndex: 0,
|
|
316
317
|
textAnchor: "middle",
|
|
317
|
-
x:
|
|
318
|
+
x: B,
|
|
318
319
|
y: b,
|
|
319
320
|
children: [
|
|
320
321
|
/* @__PURE__ */ e("style", { children: `
|
|
@@ -324,29 +325,20 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
|
324
325
|
}
|
|
325
326
|
.bubble:focus circle,
|
|
326
327
|
.bubble:focus-visible circle {
|
|
327
|
-
stroke: ${
|
|
328
|
+
stroke: ${r.palette.primary.main};
|
|
328
329
|
stroke-width: 3;
|
|
329
330
|
stroke-opacity: 0.8;
|
|
330
331
|
}
|
|
331
332
|
` }),
|
|
332
|
-
/* @__PURE__ */ e(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
followCursor: !0,
|
|
336
|
-
open: s,
|
|
337
|
-
slotProps: { popper: M },
|
|
338
|
-
title: E,
|
|
339
|
-
children: /* @__PURE__ */ e("circle", { fill: d, id: `circle-${f}`, r: p })
|
|
340
|
-
}
|
|
341
|
-
),
|
|
342
|
-
/* @__PURE__ */ e("svg", { x: v, y: A, children: /* @__PURE__ */ e(P, { name: u, size: x, sx: { fill: m } }) }),
|
|
343
|
-
p > G && /* @__PURE__ */ e(
|
|
333
|
+
/* @__PURE__ */ e(Ze, { open: s, slotProps: { popper: M }, title: O, children: /* @__PURE__ */ e("circle", { fill: d, id: `circle-${f}`, r: p }) }),
|
|
334
|
+
/* @__PURE__ */ e("svg", { x: A, y: v, children: /* @__PURE__ */ e(G, { name: u, size: x, sx: { fill: g } }) }),
|
|
335
|
+
p > j && /* @__PURE__ */ e(
|
|
344
336
|
y,
|
|
345
337
|
{
|
|
346
338
|
bold: !0,
|
|
347
339
|
component: "text",
|
|
348
340
|
id: `budget-category-${f}`,
|
|
349
|
-
sx: { fill:
|
|
341
|
+
sx: { fill: g },
|
|
350
342
|
variant: "Small",
|
|
351
343
|
y: 4,
|
|
352
344
|
children: _
|
|
@@ -358,43 +350,43 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
|
358
350
|
bold: !0,
|
|
359
351
|
component: "text",
|
|
360
352
|
id: `budget-description-${f}-1`,
|
|
361
|
-
sx: { fill:
|
|
353
|
+
sx: { fill: g },
|
|
362
354
|
variant: "Body",
|
|
363
|
-
y: p <=
|
|
364
|
-
children: p <=
|
|
355
|
+
y: p <= j ? 12 : 24,
|
|
356
|
+
children: p <= j ? h.split(" ")[0] : h
|
|
365
357
|
}
|
|
366
358
|
),
|
|
367
|
-
p <=
|
|
359
|
+
p <= j && p > me && /* @__PURE__ */ e(
|
|
368
360
|
y,
|
|
369
361
|
{
|
|
370
362
|
component: "text",
|
|
371
363
|
id: `budget-description-${f}-2`,
|
|
372
|
-
sx: { fill:
|
|
364
|
+
sx: { fill: g },
|
|
373
365
|
variant: "XSmall",
|
|
374
366
|
y: 28,
|
|
375
367
|
children: h.split(" ")[1]
|
|
376
368
|
}
|
|
377
369
|
),
|
|
378
|
-
/* @__PURE__ */ e(
|
|
370
|
+
/* @__PURE__ */ e(At, { bubble: c })
|
|
379
371
|
]
|
|
380
372
|
},
|
|
381
373
|
f
|
|
382
374
|
);
|
|
383
375
|
}
|
|
384
|
-
const
|
|
376
|
+
const Tt = ({
|
|
385
377
|
height: t,
|
|
386
|
-
width:
|
|
378
|
+
width: n,
|
|
387
379
|
isDraggable: i = !1,
|
|
388
380
|
onClick: s = () => {
|
|
389
381
|
}
|
|
390
382
|
}) => {
|
|
391
|
-
const [
|
|
392
|
-
const u =
|
|
383
|
+
const [o, r] = l.useState([]), a = l.useRef(null), c = l.useRef(!1), { detailedBudgets: d } = D(), g = l.useCallback(() => {
|
|
384
|
+
const u = a.current, _ = yt(d), f = _.nodes();
|
|
393
385
|
if (u) {
|
|
394
|
-
const h = u.nodes(), p = new Map(h.map((
|
|
395
|
-
f.forEach((
|
|
396
|
-
const b = p.get(
|
|
397
|
-
b && Object.assign(
|
|
386
|
+
const h = u.nodes(), p = new Map(h.map((B) => [B.guid, B]));
|
|
387
|
+
f.forEach((B) => {
|
|
388
|
+
const b = p.get(B.guid);
|
|
389
|
+
b && Object.assign(B, {
|
|
398
390
|
vx: b.vx,
|
|
399
391
|
vy: b.vy,
|
|
400
392
|
x: b.x,
|
|
@@ -402,42 +394,42 @@ const vt = ({
|
|
|
402
394
|
});
|
|
403
395
|
});
|
|
404
396
|
}
|
|
405
|
-
|
|
397
|
+
a.current = _, c.current = !1, r(f);
|
|
406
398
|
}, [d]);
|
|
407
399
|
return l.useEffect(() => {
|
|
408
|
-
|
|
409
|
-
}, [
|
|
410
|
-
|
|
400
|
+
g();
|
|
401
|
+
}, [g]), l.useEffect(() => () => {
|
|
402
|
+
a.current && (a.current.stop(), a.current = null);
|
|
411
403
|
}, []), l.useEffect(() => {
|
|
412
|
-
const u =
|
|
404
|
+
const u = a.current;
|
|
413
405
|
if (!u) return;
|
|
414
|
-
const _ = u.nodes(), f =
|
|
415
|
-
u.nodes(h),
|
|
416
|
-
|
|
417
|
-
}, 0),
|
|
418
|
-
}, [t,
|
|
419
|
-
},
|
|
406
|
+
const _ = u.nodes(), f = n > 0 && n < 450 || t > 0 && t < 300, h = Bt(_, d, f, t, n);
|
|
407
|
+
u.nodes(h), bt(u, t, n), i && setTimeout(() => {
|
|
408
|
+
ft(u);
|
|
409
|
+
}, 0), r([...h]);
|
|
410
|
+
}, [t, n, i, d]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(n), children: o.map((u) => /* @__PURE__ */ e(vt, { bubble: u, isDraggable: i, onClick: s }, u.guid)) });
|
|
411
|
+
}, wt = I(Tt), Dt = ({
|
|
420
412
|
isMiniWidget: t = !1,
|
|
421
|
-
onConnectAccountsClick:
|
|
413
|
+
onConnectAccountsClick: n,
|
|
422
414
|
createBudgetOnClick: i
|
|
423
415
|
}) => {
|
|
424
|
-
const { recalculateBudgets: s } = D(), { spendCategories:
|
|
416
|
+
const { recalculateBudgets: s } = D(), { spendCategories: o } = F(), { budgets: r } = w(), { availableWidth: a } = oe(), { isMobile: c } = ce(a), d = t && c, [g, u] = l.useState(!1), [_, f] = l.useState(!1), [h, p] = l.useState(!1), B = l.useMemo(() => [...o.filter((S) => S.totalAverageAmount > 0)], [o]), b = async () => {
|
|
425
417
|
p(!0);
|
|
426
|
-
const { data:
|
|
427
|
-
p(!1),
|
|
418
|
+
const { data: S, isSuccess: A } = await s(B);
|
|
419
|
+
p(!1), A ? (S.length === 0 && f(!0), u(!1)) : u(!0);
|
|
428
420
|
};
|
|
429
|
-
return h ? /* @__PURE__ */ e(
|
|
421
|
+
return h ? /* @__PURE__ */ e(U, {}) : g ? /* @__PURE__ */ e(
|
|
430
422
|
ue,
|
|
431
423
|
{
|
|
432
|
-
header:
|
|
424
|
+
header: r.autogenerate_budgets_error_header,
|
|
433
425
|
icon: "error",
|
|
434
426
|
iconColor: "#4D4D4D",
|
|
435
|
-
onClick: (
|
|
436
|
-
|
|
427
|
+
onClick: (S) => {
|
|
428
|
+
S === "primary" ? b() : i();
|
|
437
429
|
},
|
|
438
|
-
primaryButton:
|
|
439
|
-
secondaryButton:
|
|
440
|
-
subText:
|
|
430
|
+
primaryButton: r.autogenerate_budgets_error_primary_button,
|
|
431
|
+
secondaryButton: r.zero_state_generate_budgets_secondary_button,
|
|
432
|
+
subText: r.autogenerate_budgets_error_subheader,
|
|
441
433
|
sx: {
|
|
442
434
|
width: { sm: 468 },
|
|
443
435
|
".buttons-footer": {
|
|
@@ -447,18 +439,18 @@ const vt = ({
|
|
|
447
439
|
...d && { justifyContent: "center", mt: 0, svg: { height: 32, width: 32 } }
|
|
448
440
|
}
|
|
449
441
|
}
|
|
450
|
-
) : /* @__PURE__ */ e(
|
|
442
|
+
) : /* @__PURE__ */ e(We, { children: _ ? /* @__PURE__ */ e(
|
|
451
443
|
ue,
|
|
452
444
|
{
|
|
453
|
-
header:
|
|
445
|
+
header: r.zero_state_generate_budgets_header,
|
|
454
446
|
icon: "error",
|
|
455
447
|
iconColor: "#4D4D4D",
|
|
456
|
-
onClick: (
|
|
457
|
-
|
|
448
|
+
onClick: (S) => {
|
|
449
|
+
S === "primary" ? n() : i();
|
|
458
450
|
},
|
|
459
|
-
primaryButton:
|
|
460
|
-
secondaryButton:
|
|
461
|
-
subText:
|
|
451
|
+
primaryButton: r.zero_state_generate_budgets_primary_button,
|
|
452
|
+
secondaryButton: r.zero_state_generate_budgets_secondary_button,
|
|
453
|
+
subText: r.zero_state_generate_budgets_subheader,
|
|
462
454
|
sx: {
|
|
463
455
|
width: t ? "100%" : { sm: 500 },
|
|
464
456
|
height: t ? "100%" : { sm: 468 },
|
|
@@ -475,15 +467,15 @@ const vt = ({
|
|
|
475
467
|
) : /* @__PURE__ */ e(
|
|
476
468
|
ue,
|
|
477
469
|
{
|
|
478
|
-
header:
|
|
470
|
+
header: r.create_budgets_title,
|
|
479
471
|
icon: "bubble_chart",
|
|
480
472
|
iconColor: "#1A1A1A",
|
|
481
|
-
onClick: (
|
|
482
|
-
|
|
473
|
+
onClick: (S) => {
|
|
474
|
+
S === "primary" ? b() : i();
|
|
483
475
|
},
|
|
484
|
-
primaryButton:
|
|
485
|
-
secondaryButton: t ? void 0 :
|
|
486
|
-
subText:
|
|
476
|
+
primaryButton: r.empty_state_primary_button,
|
|
477
|
+
secondaryButton: t ? void 0 : r.empty_state_secondary_button,
|
|
478
|
+
subText: r.empty_state_subheader,
|
|
487
479
|
sx: {
|
|
488
480
|
width: t ? "100%" : { sm: 432 },
|
|
489
481
|
height: t ? "100%" : { sm: 468 },
|
|
@@ -498,48 +490,48 @@ const vt = ({
|
|
|
498
490
|
}
|
|
499
491
|
}
|
|
500
492
|
) });
|
|
501
|
-
},
|
|
493
|
+
}, Ne = I(
|
|
502
494
|
({
|
|
503
495
|
createBudgetOnClick: t = () => {
|
|
504
496
|
},
|
|
505
|
-
height:
|
|
497
|
+
height: n,
|
|
506
498
|
isDraggable: i = !1,
|
|
507
499
|
isMiniWidget: s = !1,
|
|
508
|
-
shouldShowZeroState:
|
|
509
|
-
unavailableWidth:
|
|
500
|
+
shouldShowZeroState: o,
|
|
501
|
+
unavailableWidth: r = 24
|
|
510
502
|
}) => {
|
|
511
|
-
const { onEvent:
|
|
512
|
-
c(
|
|
513
|
-
budget_category:
|
|
503
|
+
const { onEvent: a } = X(), { setSelectedBudget: c } = D(), { isLoadingCategoryTotals: d } = F(), { isInitialized: g } = ae(), { accounts: u } = w(), { availableWidth: _ } = oe(), { isMobile: f } = ce(), [h, p] = l.useState(!1), B = l.useMemo(() => _ - r, [_]), b = (A) => {
|
|
504
|
+
c(A), a($.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
505
|
+
budget_category: A.category.name,
|
|
514
506
|
click_type: "bubble"
|
|
515
507
|
});
|
|
516
|
-
},
|
|
517
|
-
p(!0),
|
|
508
|
+
}, S = () => {
|
|
509
|
+
p(!0), a($.ACCOUNTS_CLICK_CONNECT);
|
|
518
510
|
};
|
|
519
|
-
return d ? /* @__PURE__ */ e(
|
|
520
|
-
|
|
511
|
+
return d ? /* @__PURE__ */ e(C, { alignItems: "center", height: n, justifyContent: "center", width: Math.abs(B), children: /* @__PURE__ */ e(U, {}) }) : /* @__PURE__ */ m(
|
|
512
|
+
W,
|
|
521
513
|
{
|
|
522
|
-
ml:
|
|
514
|
+
ml: o || f ? 0 : 24,
|
|
523
515
|
sx: { alignSelf: "center", ...s && { height: "100%" } },
|
|
524
516
|
children: [
|
|
525
|
-
|
|
526
|
-
|
|
517
|
+
o || !g ? /* @__PURE__ */ e(
|
|
518
|
+
Dt,
|
|
527
519
|
{
|
|
528
520
|
createBudgetOnClick: t,
|
|
529
521
|
isMiniWidget: s,
|
|
530
|
-
onConnectAccountsClick:
|
|
522
|
+
onConnectAccountsClick: S
|
|
531
523
|
}
|
|
532
524
|
) : /* @__PURE__ */ e(
|
|
533
|
-
|
|
525
|
+
wt,
|
|
534
526
|
{
|
|
535
|
-
height:
|
|
527
|
+
height: n,
|
|
536
528
|
isDraggable: i,
|
|
537
529
|
onClick: b,
|
|
538
|
-
width:
|
|
530
|
+
width: B
|
|
539
531
|
}
|
|
540
532
|
),
|
|
541
533
|
/* @__PURE__ */ e(
|
|
542
|
-
|
|
534
|
+
Ye,
|
|
543
535
|
{
|
|
544
536
|
onClose: () => p(!1),
|
|
545
537
|
showConnectionsWidget: h,
|
|
@@ -550,49 +542,54 @@ const vt = ({
|
|
|
550
542
|
}
|
|
551
543
|
);
|
|
552
544
|
}
|
|
553
|
-
),
|
|
545
|
+
), It = ({
|
|
554
546
|
budgetsCopy: t,
|
|
555
|
-
difference:
|
|
547
|
+
difference: n,
|
|
556
548
|
handleAddClick: i,
|
|
557
549
|
shouldShowZeroState: s
|
|
558
550
|
}) => {
|
|
559
|
-
const { availableHeight:
|
|
551
|
+
const { availableHeight: o = 0 } = oe(), r = l.useRef(null);
|
|
560
552
|
l.useEffect(() => {
|
|
561
|
-
|
|
562
|
-
}, [
|
|
563
|
-
const
|
|
564
|
-
const c =
|
|
553
|
+
o > 0 && r.current === null && (r.current = o);
|
|
554
|
+
}, [o]);
|
|
555
|
+
const a = l.useMemo(() => {
|
|
556
|
+
const c = r.current ?? o;
|
|
565
557
|
return c > 0 ? Math.round(Math.max(120, Math.min(450, c * 0.8))) - 40 : 450;
|
|
566
|
-
}, [
|
|
567
|
-
return /* @__PURE__ */
|
|
558
|
+
}, [o]);
|
|
559
|
+
return /* @__PURE__ */ m(C, { sx: { height: "100%", justifyContent: "space-between" }, children: [
|
|
568
560
|
/* @__PURE__ */ e(
|
|
569
|
-
|
|
561
|
+
Ne,
|
|
570
562
|
{
|
|
571
563
|
createBudgetOnClick: i,
|
|
572
|
-
height:
|
|
564
|
+
height: a,
|
|
573
565
|
isMiniWidget: !0,
|
|
574
566
|
shouldShowZeroState: s
|
|
575
567
|
}
|
|
576
568
|
),
|
|
577
|
-
!s && /* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */ e(y, { bold: !0, color:
|
|
579
|
-
/* @__PURE__ */ e(y, { children:
|
|
569
|
+
!s && /* @__PURE__ */ m(W, { ml: 16, children: [
|
|
570
|
+
/* @__PURE__ */ e(y, { bold: !0, color: n < 0 ? "error.main" : "success.main", children: T(Math.abs(n), "0,0") }),
|
|
571
|
+
/* @__PURE__ */ e(y, { children: n < 0 ? t.overspent_in_budgets : t.left_in_budgets })
|
|
580
572
|
] })
|
|
581
573
|
] });
|
|
582
|
-
},
|
|
583
|
-
const
|
|
584
|
-
b(!0), i(
|
|
574
|
+
}, Et = (t) => {
|
|
575
|
+
const n = te(), { onEvent: i } = X(), { detailedBudgets: s, isDataLoaded: o, loadBudgetData: r, setTheme: a } = D(), { budgets: c, common: d } = w(), { isCopyLoaded: g, isInitialized: u, selectedAccounts: _ } = ae(), { reloadCategoryTotals: f } = F(), h = Qe(), p = s.length === 0, [B, b] = l.useState(!1), S = () => {
|
|
576
|
+
b(!0), i($.BUDGETS_CLICK_ADD);
|
|
577
|
+
}, A = () => {
|
|
578
|
+
b(!1);
|
|
585
579
|
}, v = () => b(!1);
|
|
586
|
-
return
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
580
|
+
return we({
|
|
581
|
+
widgetName: "BubbleBudgetsMiniWidget",
|
|
582
|
+
isLoaded: o
|
|
583
|
+
}), l.useEffect(() => {
|
|
584
|
+
a(n);
|
|
585
|
+
}, [n]), l.useEffect(() => {
|
|
586
|
+
u && !o && f(_, Q(/* @__PURE__ */ new Date()), ge(/* @__PURE__ */ new Date())).then(
|
|
590
587
|
() => {
|
|
591
|
-
|
|
588
|
+
r().finally();
|
|
592
589
|
}
|
|
593
590
|
);
|
|
594
|
-
}, [u, _]),
|
|
595
|
-
|
|
591
|
+
}, [u, _]), g ? /* @__PURE__ */ m(
|
|
592
|
+
et,
|
|
596
593
|
{
|
|
597
594
|
contentStyles: { height: "calc(100% - 66px)", ":last-child": { pb: 0 } },
|
|
598
595
|
primaryCtaLabel: p ? c.get_started_cta : c.details_cta,
|
|
@@ -600,119 +597,125 @@ const vt = ({
|
|
|
600
597
|
title: c.budgets_title,
|
|
601
598
|
...t,
|
|
602
599
|
children: [
|
|
603
|
-
|
|
604
|
-
|
|
600
|
+
o ? /* @__PURE__ */ e(
|
|
601
|
+
It,
|
|
605
602
|
{
|
|
606
603
|
budgetsCopy: c,
|
|
607
604
|
difference: h,
|
|
608
|
-
handleAddClick:
|
|
605
|
+
handleAddClick: S,
|
|
609
606
|
shouldShowZeroState: p
|
|
610
607
|
}
|
|
611
|
-
) : /* @__PURE__ */ e(
|
|
608
|
+
) : /* @__PURE__ */ e(U, {}),
|
|
612
609
|
/* @__PURE__ */ e(
|
|
613
|
-
|
|
610
|
+
P,
|
|
614
611
|
{
|
|
615
612
|
ariaLabelClose: d.close_aria,
|
|
616
|
-
isOpen:
|
|
613
|
+
isOpen: B,
|
|
617
614
|
onClose: () => b(!1),
|
|
618
615
|
title: c.add_new_title,
|
|
619
|
-
children: /* @__PURE__ */ e(
|
|
616
|
+
children: /* @__PURE__ */ e(
|
|
617
|
+
Re,
|
|
618
|
+
{
|
|
619
|
+
onAddBudget: A,
|
|
620
|
+
onRecalculateBudgets: v
|
|
621
|
+
}
|
|
622
|
+
)
|
|
620
623
|
}
|
|
621
624
|
)
|
|
622
625
|
]
|
|
623
626
|
}
|
|
624
|
-
) : /* @__PURE__ */ e(
|
|
625
|
-
},
|
|
627
|
+
) : /* @__PURE__ */ e(U, {});
|
|
628
|
+
}, $n = I(Et), $e = ({ budget: t }) => {
|
|
626
629
|
const {
|
|
627
|
-
amount:
|
|
630
|
+
amount: n,
|
|
628
631
|
budgetColors: { background: i },
|
|
629
632
|
category: { name: s },
|
|
630
|
-
category_guid:
|
|
631
|
-
percentage:
|
|
632
|
-
transaction_total:
|
|
633
|
+
category_guid: o,
|
|
634
|
+
percentage: r,
|
|
635
|
+
transaction_total: a
|
|
633
636
|
} = t, c = [
|
|
634
637
|
{
|
|
635
638
|
color: i,
|
|
636
|
-
percentage: `${
|
|
639
|
+
percentage: `${r}%`
|
|
637
640
|
}
|
|
638
641
|
];
|
|
639
|
-
return /* @__PURE__ */ e(he, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(fe, { children: /* @__PURE__ */
|
|
640
|
-
/* @__PURE__ */ e(
|
|
641
|
-
/* @__PURE__ */ e(
|
|
642
|
+
return /* @__PURE__ */ e(he, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(fe, { children: /* @__PURE__ */ m(C, { alignItems: "center", gap: 16, children: [
|
|
643
|
+
/* @__PURE__ */ e(H, { categoryGuid: o, size: 56 }),
|
|
644
|
+
/* @__PURE__ */ e(He, { children: `${T(a, "0,0")} / ${T(n, "0,0")}` }),
|
|
642
645
|
/* @__PURE__ */ e(y, { bold: !0, variant: "XSmall", children: s }),
|
|
643
646
|
/* @__PURE__ */ e(pe, { data: c, height: 10 })
|
|
644
647
|
] }) }) });
|
|
645
|
-
},
|
|
648
|
+
}, Ot = I(() => {
|
|
646
649
|
const { budgets: t } = w();
|
|
647
|
-
return /* @__PURE__ */
|
|
648
|
-
/* @__PURE__ */ e(
|
|
650
|
+
return /* @__PURE__ */ m(C, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
|
|
651
|
+
/* @__PURE__ */ e(G, { color: "secondary", name: "bubble_chart", sx: { fontSize: 32 } }),
|
|
649
652
|
/* @__PURE__ */ e(y, { bold: !0, color: "secondary", variant: "Small", children: t.zero_state_no_sub_budgets }),
|
|
650
653
|
/* @__PURE__ */ e(y, { color: "text.secondary", variant: "XSmall", children: t.zero_state_no_sub_budgets_description })
|
|
651
654
|
] });
|
|
652
|
-
}),
|
|
655
|
+
}), Mt = I(({ budget: t }) => {
|
|
653
656
|
const {
|
|
654
|
-
amount:
|
|
657
|
+
amount: n,
|
|
655
658
|
budgetColors: { background: i },
|
|
656
659
|
category: s,
|
|
657
|
-
percentage:
|
|
658
|
-
transaction_total:
|
|
659
|
-
} = t, { setSelectedSubBudget:
|
|
660
|
-
return /* @__PURE__ */ e(V, { children: /* @__PURE__ */
|
|
661
|
-
/* @__PURE__ */ e(
|
|
660
|
+
percentage: o,
|
|
661
|
+
transaction_total: r
|
|
662
|
+
} = t, { setSelectedSubBudget: a } = D();
|
|
663
|
+
return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ m(Y, { onClick: () => a(t), children: [
|
|
664
|
+
/* @__PURE__ */ e(ie, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Oe, { color: i, percent: o, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
|
|
662
665
|
/* @__PURE__ */ e(
|
|
663
666
|
Z,
|
|
664
667
|
{
|
|
665
|
-
primary: /* @__PURE__ */ e(
|
|
666
|
-
secondary: /* @__PURE__ */ e(
|
|
667
|
-
${T(
|
|
668
|
-
${T(
|
|
668
|
+
primary: /* @__PURE__ */ e(C, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: t.category.name }) }),
|
|
669
|
+
secondary: /* @__PURE__ */ e(C, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(y, { fontWeight: 400, variant: "Body", children: `
|
|
670
|
+
${T(r, "0,0")} /
|
|
671
|
+
${T(n, "0,0")}
|
|
669
672
|
` }) })
|
|
670
673
|
}
|
|
671
674
|
)
|
|
672
675
|
] }) });
|
|
673
|
-
}),
|
|
674
|
-
const { budgets: i, common: s } = w(), { setExpandedGuid:
|
|
676
|
+
}), Rt = I(({ category: t, parentBudget: n }) => {
|
|
677
|
+
const { budgets: i, common: s } = w(), { setExpandedGuid: o, setOnSelect: r } = rt(), { addBudget: a } = D(), [c, d] = l.useState(!1), [g, u] = l.useState(!1), [_, f] = l.useState(""), [h, p] = l.useState(void 0);
|
|
675
678
|
l.useEffect(() => {
|
|
676
|
-
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
+
r((S) => {
|
|
680
|
+
const A = t.subCategories.find((v) => v.guid === S);
|
|
681
|
+
A && (p(A), f(`${A.currentAmount === 0 ? "" : A.currentAmount}`), u(!0));
|
|
679
682
|
});
|
|
680
683
|
}, []);
|
|
681
|
-
const
|
|
682
|
-
|
|
684
|
+
const B = () => {
|
|
685
|
+
o(t.guid), d(!0);
|
|
683
686
|
}, b = async () => {
|
|
684
|
-
h && Number(_) > 0 && (await
|
|
687
|
+
h && Number(_) > 0 && (await a(h, Number(_), n.guid), u(!1), d(!1), p(void 0));
|
|
685
688
|
};
|
|
686
|
-
return /* @__PURE__ */
|
|
687
|
-
/* @__PURE__ */ e(V, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Y, { onClick:
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */ e(
|
|
689
|
+
return /* @__PURE__ */ m(W, { children: [
|
|
690
|
+
/* @__PURE__ */ e(V, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Y, { onClick: B, children: /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ m(C, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
691
|
+
/* @__PURE__ */ m(C, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
692
|
+
/* @__PURE__ */ e(G, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.light" } }),
|
|
690
693
|
/* @__PURE__ */ e(y, { bold: !0, sx: { color: "primary.light" }, variant: "Body", children: i.add_sub_budget_button })
|
|
691
694
|
] }),
|
|
692
|
-
/* @__PURE__ */ e(
|
|
695
|
+
/* @__PURE__ */ e(G, { name: "chevron_right", size: 24, sx: { color: "primary.light" } })
|
|
693
696
|
] }) }) }) }),
|
|
694
|
-
/* @__PURE__ */ e(
|
|
697
|
+
/* @__PURE__ */ e(se, {}),
|
|
695
698
|
/* @__PURE__ */ e(
|
|
696
|
-
|
|
699
|
+
P,
|
|
697
700
|
{
|
|
698
701
|
ariaLabelClose: s.close_aria,
|
|
699
702
|
isOpen: c,
|
|
700
703
|
onClose: () => d(!1),
|
|
701
704
|
title: i.add_sub_budget_title,
|
|
702
|
-
children: /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(
|
|
705
|
+
children: /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(st, { category: t, subCategories: t.subCategories }) })
|
|
703
706
|
}
|
|
704
707
|
),
|
|
705
708
|
/* @__PURE__ */ e(
|
|
706
|
-
|
|
709
|
+
z,
|
|
707
710
|
{
|
|
708
711
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
709
712
|
disablePrimaryButton: Number(_) <= 0,
|
|
710
|
-
isOpen:
|
|
713
|
+
isOpen: g,
|
|
711
714
|
onClose: () => u(!1),
|
|
712
715
|
onPrimaryAction: b,
|
|
713
716
|
primaryText: i.add_save_button,
|
|
714
717
|
children: /* @__PURE__ */ e(
|
|
715
|
-
|
|
718
|
+
le,
|
|
716
719
|
{
|
|
717
720
|
amount: _,
|
|
718
721
|
categoryName: h?.name || "",
|
|
@@ -722,107 +725,107 @@ const vt = ({
|
|
|
722
725
|
}
|
|
723
726
|
)
|
|
724
727
|
] });
|
|
725
|
-
}),
|
|
726
|
-
const { category:
|
|
728
|
+
}), Lt = I(({ budget: t }) => {
|
|
729
|
+
const { category: n, subBudgets: i } = t, { budgets: s, common: o } = w(), { deleteBudget: r, selectedSubBudget: a, setSelectedSubBudget: c, updateBudget: d } = D(), { filter: g, setFilter: u } = re(), [_, f] = l.useState(!1), [h, p] = l.useState(!1), [B, b] = l.useState("");
|
|
727
730
|
l.useEffect(() => {
|
|
728
|
-
|
|
729
|
-
...
|
|
730
|
-
custom: (x) => x.category_guid ===
|
|
731
|
+
a && (b(`${a.amount}`), u({
|
|
732
|
+
...g,
|
|
733
|
+
custom: (x) => x.category_guid === a.category_guid
|
|
731
734
|
}));
|
|
732
|
-
}, [
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
...
|
|
736
|
-
amount: Number(
|
|
735
|
+
}, [a]);
|
|
736
|
+
const S = async () => {
|
|
737
|
+
a && await d({
|
|
738
|
+
...a,
|
|
739
|
+
amount: Number(B)
|
|
737
740
|
});
|
|
738
|
-
},
|
|
739
|
-
|
|
740
|
-
},
|
|
741
|
+
}, A = async () => {
|
|
742
|
+
a && await r(a.guid), p(!1), v();
|
|
743
|
+
}, v = () => {
|
|
741
744
|
u({
|
|
742
|
-
...
|
|
745
|
+
...g,
|
|
743
746
|
custom: (x) => x.category_guid === t.category_guid || x.top_level_category_guid === t.category_guid
|
|
744
747
|
}), c(void 0);
|
|
745
748
|
};
|
|
746
|
-
return /* @__PURE__ */
|
|
747
|
-
/* @__PURE__ */
|
|
748
|
-
i.length === 0 ? /* @__PURE__ */ e(
|
|
749
|
-
/* @__PURE__ */ e(
|
|
750
|
-
/* @__PURE__ */ e(
|
|
749
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
750
|
+
/* @__PURE__ */ m(K, { sx: { bgcolor: "background.paper" }, children: [
|
|
751
|
+
i.length === 0 ? /* @__PURE__ */ e(Ot, {}) : i.map((x) => /* @__PURE__ */ m(l.Fragment, { children: [
|
|
752
|
+
/* @__PURE__ */ e(Mt, { budget: x }),
|
|
753
|
+
/* @__PURE__ */ e(se, {})
|
|
751
754
|
] }, x.guid)),
|
|
752
|
-
/* @__PURE__ */ e(
|
|
755
|
+
/* @__PURE__ */ e(Rt, { category: n, parentBudget: t })
|
|
753
756
|
] }),
|
|
754
757
|
/* @__PURE__ */ e(
|
|
755
|
-
|
|
758
|
+
P,
|
|
756
759
|
{
|
|
757
|
-
ariaLabelClose:
|
|
758
|
-
isOpen: !!
|
|
759
|
-
onClose:
|
|
760
|
+
ariaLabelClose: o.close_aria,
|
|
761
|
+
isOpen: !!a,
|
|
762
|
+
onClose: v,
|
|
760
763
|
onPrimaryAction: () => f(!0),
|
|
761
764
|
onSecondaryAction: () => p(!0),
|
|
762
765
|
primaryText: s.details_edit_button,
|
|
763
766
|
secondaryText: s.details_delete_button,
|
|
764
767
|
title: s.details_title,
|
|
765
|
-
children:
|
|
766
|
-
/* @__PURE__ */ e(
|
|
767
|
-
/* @__PURE__ */ e(
|
|
768
|
+
children: a && /* @__PURE__ */ m(C, { gap: 24, children: [
|
|
769
|
+
/* @__PURE__ */ e($e, { budget: a }),
|
|
770
|
+
/* @__PURE__ */ e(Ee, { height: "100%" })
|
|
768
771
|
] })
|
|
769
772
|
}
|
|
770
773
|
),
|
|
771
|
-
|
|
774
|
+
a && /* @__PURE__ */ m(l.Fragment, { children: [
|
|
772
775
|
/* @__PURE__ */ e(
|
|
773
|
-
|
|
776
|
+
z,
|
|
774
777
|
{
|
|
775
|
-
copy: { close_aria:
|
|
776
|
-
disablePrimaryButton: Number(
|
|
778
|
+
copy: { close_aria: o.close_aria, title: s.details_edit_title },
|
|
779
|
+
disablePrimaryButton: Number(B) <= 0,
|
|
777
780
|
isOpen: _,
|
|
778
781
|
onClose: () => f(!1),
|
|
779
|
-
onPrimaryAction:
|
|
782
|
+
onPrimaryAction: S,
|
|
780
783
|
primaryText: s.edit_save_button,
|
|
781
784
|
children: /* @__PURE__ */ e(
|
|
782
|
-
|
|
785
|
+
le,
|
|
783
786
|
{
|
|
784
|
-
amount:
|
|
785
|
-
categoryName:
|
|
787
|
+
amount: B,
|
|
788
|
+
categoryName: a.category.name,
|
|
786
789
|
onAmountChanged: b
|
|
787
790
|
}
|
|
788
791
|
)
|
|
789
792
|
}
|
|
790
793
|
),
|
|
791
794
|
/* @__PURE__ */ e(
|
|
792
|
-
|
|
795
|
+
z,
|
|
793
796
|
{
|
|
794
|
-
copy: { close_aria:
|
|
797
|
+
copy: { close_aria: o.close_aria, title: s.delete_title },
|
|
795
798
|
isOpen: h,
|
|
796
799
|
onClose: () => p(!1),
|
|
797
|
-
onPrimaryAction:
|
|
800
|
+
onPrimaryAction: A,
|
|
798
801
|
primaryColor: "error",
|
|
799
802
|
primaryText: "Delete",
|
|
800
803
|
secondaryColor: "secondary",
|
|
801
|
-
children: /* @__PURE__ */ e(y, { variant: "Paragraph", children:
|
|
804
|
+
children: /* @__PURE__ */ e(y, { variant: "Paragraph", children: L(s.delete_description, a.category.name) })
|
|
802
805
|
}
|
|
803
806
|
)
|
|
804
807
|
] })
|
|
805
808
|
] });
|
|
806
|
-
}),
|
|
807
|
-
const { is_mobile_webview:
|
|
808
|
-
sortedTransactions:
|
|
809
|
+
}), kt = I(({ budget: t }) => {
|
|
810
|
+
const { is_mobile_webview: n } = Ke(), { setAlert: i } = D(), { budgets: s, common: o, transactions: r } = w(), { isDesktop: a, isSmallTablet: c, isTablet: d } = ce(), {
|
|
811
|
+
sortedTransactions: g,
|
|
809
812
|
sortedTransactionsWithSplits: u,
|
|
810
813
|
tags: _
|
|
811
|
-
} =
|
|
812
|
-
() =>
|
|
813
|
-
[p,
|
|
814
|
-
),
|
|
815
|
-
h(
|
|
816
|
-
},
|
|
817
|
-
|
|
818
|
-
},
|
|
819
|
-
return /* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */ e(
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
|
|
814
|
+
} = re(), [f, h] = l.useState(0), [p, B] = l.useState(""), b = l.useMemo(
|
|
815
|
+
() => g.find((x) => x.guid === p),
|
|
816
|
+
[p, g]
|
|
817
|
+
), S = (x, O) => {
|
|
818
|
+
h(O);
|
|
819
|
+
}, A = () => {
|
|
820
|
+
ot(u, _), i(s.alert_csv_downloaded);
|
|
821
|
+
}, v = g.length > 0 && !n && (a || d && !c);
|
|
822
|
+
return /* @__PURE__ */ m(C, { gap: 24, children: [
|
|
823
|
+
/* @__PURE__ */ e($e, { budget: t }),
|
|
824
|
+
/* @__PURE__ */ m(C, { children: [
|
|
825
|
+
/* @__PURE__ */ m(
|
|
826
|
+
nt,
|
|
824
827
|
{
|
|
825
|
-
onChange:
|
|
828
|
+
onChange: S,
|
|
826
829
|
sx: { width: "100%" },
|
|
827
830
|
textColor: "primary",
|
|
828
831
|
value: f,
|
|
@@ -833,218 +836,234 @@ const vt = ({
|
|
|
833
836
|
]
|
|
834
837
|
}
|
|
835
838
|
),
|
|
836
|
-
f === 0 && /* @__PURE__ */
|
|
837
|
-
|
|
839
|
+
f === 0 && /* @__PURE__ */ m(C, { children: [
|
|
840
|
+
v && /* @__PURE__ */ e(C, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
|
|
838
841
|
Te,
|
|
839
842
|
{
|
|
840
|
-
onClick:
|
|
841
|
-
startIcon: /* @__PURE__ */ e(
|
|
843
|
+
onClick: A,
|
|
844
|
+
startIcon: /* @__PURE__ */ e(G, { name: "ios_share" }),
|
|
842
845
|
variant: "text",
|
|
843
|
-
children:
|
|
846
|
+
children: r.export_csv_btn
|
|
844
847
|
}
|
|
845
848
|
) }),
|
|
846
|
-
/* @__PURE__ */ e(
|
|
849
|
+
/* @__PURE__ */ e(Ee, { height: "100%", onClick: B })
|
|
847
850
|
] }),
|
|
848
|
-
f === 1 && /* @__PURE__ */ e(
|
|
851
|
+
f === 1 && /* @__PURE__ */ e(Lt, { budget: t }),
|
|
849
852
|
/* @__PURE__ */ e(
|
|
850
|
-
|
|
853
|
+
P,
|
|
851
854
|
{
|
|
852
|
-
ariaLabelClose:
|
|
855
|
+
ariaLabelClose: o.close_aria,
|
|
853
856
|
isOpen: !!b,
|
|
854
|
-
onClose: () =>
|
|
857
|
+
onClose: () => B(""),
|
|
855
858
|
title: s.details_transaction_drawer,
|
|
856
|
-
children: b && /* @__PURE__ */ e(
|
|
859
|
+
children: b && /* @__PURE__ */ e(at, { transaction: b })
|
|
857
860
|
}
|
|
858
861
|
)
|
|
859
862
|
] })
|
|
860
863
|
] });
|
|
861
|
-
}),
|
|
862
|
-
const { selectedAccountGuids: t } =
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
864
|
+
}), Nt = I(() => {
|
|
865
|
+
const { selectedAccountGuids: t } = ae(), { budgets: n, common: i } = w(), {
|
|
866
|
+
alert: s,
|
|
867
|
+
dateRange: o,
|
|
868
|
+
deleteBudget: r,
|
|
869
|
+
selectedBudget: a,
|
|
870
|
+
selectedSubBudget: c,
|
|
871
|
+
setAlert: d,
|
|
872
|
+
setSelectedBudget: g,
|
|
873
|
+
updateBudget: u
|
|
874
|
+
} = D(), { setFilter: _ } = re(), [f, h] = l.useState(!1), [p, B] = l.useState(!1), [b, S] = l.useState(!1), [A, v] = l.useState("");
|
|
871
875
|
l.useEffect(() => {
|
|
872
|
-
|
|
876
|
+
a && !c && (v(`${a.amount}`), h(!0), _({
|
|
873
877
|
accounts: t,
|
|
874
|
-
dateRange:
|
|
875
|
-
custom: (
|
|
878
|
+
dateRange: o,
|
|
879
|
+
custom: (N) => N.category_guid === a.category_guid || N.top_level_category_guid === a.category_guid,
|
|
876
880
|
showSplits: !0
|
|
877
881
|
}));
|
|
878
|
-
}, [
|
|
879
|
-
const
|
|
880
|
-
|
|
881
|
-
...
|
|
882
|
-
amount: Number(
|
|
883
|
-
percentage:
|
|
884
|
-
}),
|
|
885
|
-
},
|
|
886
|
-
|
|
887
|
-
},
|
|
888
|
-
|
|
889
|
-
|
|
882
|
+
}, [a]);
|
|
883
|
+
const x = async () => {
|
|
884
|
+
a && (await u({
|
|
885
|
+
...a,
|
|
886
|
+
amount: Number(A),
|
|
887
|
+
percentage: a.category.totalAmount / Number(A) * 100
|
|
888
|
+
}), d(L(n.alert_budget_updated, a.category.name)));
|
|
889
|
+
}, O = async () => {
|
|
890
|
+
a && (await r(a.guid), d(L(n.alert_budget_deleted, a.category.name))), M();
|
|
891
|
+
}, M = () => {
|
|
892
|
+
h(!1), setTimeout(() => {
|
|
893
|
+
g(void 0);
|
|
890
894
|
}, 250);
|
|
895
|
+
}, R = () => {
|
|
896
|
+
d(""), B(!1);
|
|
891
897
|
};
|
|
892
|
-
if (
|
|
893
|
-
return /* @__PURE__ */
|
|
898
|
+
if (a)
|
|
899
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
894
900
|
/* @__PURE__ */ e(
|
|
895
|
-
|
|
901
|
+
P,
|
|
896
902
|
{
|
|
897
903
|
ariaLabelClose: i.close_aria,
|
|
898
|
-
isOpen:
|
|
899
|
-
onClose:
|
|
900
|
-
onPrimaryAction: () =>
|
|
901
|
-
onSecondaryAction: () =>
|
|
902
|
-
primaryText:
|
|
904
|
+
isOpen: f,
|
|
905
|
+
onClose: M,
|
|
906
|
+
onPrimaryAction: () => B(!0),
|
|
907
|
+
onSecondaryAction: () => S(!0),
|
|
908
|
+
primaryText: n.details_edit_button,
|
|
903
909
|
secondaryColor: "error",
|
|
904
|
-
secondaryText:
|
|
905
|
-
title:
|
|
906
|
-
children: /* @__PURE__ */ e(
|
|
910
|
+
secondaryText: n.details_delete_button,
|
|
911
|
+
title: n.details_title,
|
|
912
|
+
children: /* @__PURE__ */ e(kt, { budget: a })
|
|
907
913
|
}
|
|
908
914
|
),
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
|
|
915
|
+
/* @__PURE__ */ m(
|
|
916
|
+
z,
|
|
911
917
|
{
|
|
912
|
-
copy: { close_aria: i.close_aria, title:
|
|
913
|
-
disablePrimaryButton: Number(
|
|
914
|
-
isOpen:
|
|
915
|
-
onClose: () =>
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
918
|
+
copy: { close_aria: i.close_aria, title: n.details_edit_title },
|
|
919
|
+
disablePrimaryButton: Number(A) <= 0,
|
|
920
|
+
isOpen: p,
|
|
921
|
+
onClose: () => {
|
|
922
|
+
},
|
|
923
|
+
onPrimaryAction: x,
|
|
924
|
+
primaryText: n.edit_save_button,
|
|
925
|
+
children: [
|
|
926
|
+
/* @__PURE__ */ e(
|
|
927
|
+
le,
|
|
928
|
+
{
|
|
929
|
+
amount: A,
|
|
930
|
+
categoryName: a.category.name,
|
|
931
|
+
onAmountChanged: v
|
|
932
|
+
}
|
|
933
|
+
),
|
|
934
|
+
/* @__PURE__ */ e(
|
|
935
|
+
Ie,
|
|
936
|
+
{
|
|
937
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
938
|
+
autoHideDuration: 3500,
|
|
939
|
+
onClose: R,
|
|
940
|
+
open: !!s,
|
|
941
|
+
children: /* @__PURE__ */ e(De, { closeText: "", onClose: R, severity: "success", variant: "filled", children: s })
|
|
942
|
+
}
|
|
943
|
+
)
|
|
944
|
+
]
|
|
926
945
|
}
|
|
927
946
|
),
|
|
928
947
|
/* @__PURE__ */ e(
|
|
929
|
-
|
|
948
|
+
z,
|
|
930
949
|
{
|
|
931
|
-
copy: { close_aria: i.close_aria, title:
|
|
932
|
-
isOpen:
|
|
933
|
-
onClose: () =>
|
|
934
|
-
onPrimaryAction:
|
|
950
|
+
copy: { close_aria: i.close_aria, title: n.delete_title },
|
|
951
|
+
isOpen: b,
|
|
952
|
+
onClose: () => S(!1),
|
|
953
|
+
onPrimaryAction: O,
|
|
935
954
|
primaryColor: "error",
|
|
936
|
-
primaryText:
|
|
955
|
+
primaryText: n.details_delete_button,
|
|
937
956
|
secondaryColor: "secondary",
|
|
938
|
-
children: /* @__PURE__ */ e(y, { variant: "Paragraph", children:
|
|
957
|
+
children: /* @__PURE__ */ e(y, { variant: "Paragraph", children: L(n.delete_description, a.category.name) })
|
|
939
958
|
}
|
|
940
959
|
)
|
|
941
960
|
] });
|
|
942
|
-
}),
|
|
961
|
+
}), $t = ({ budget: t, onClick: n }) => {
|
|
943
962
|
const {
|
|
944
963
|
amount: i,
|
|
945
|
-
budgetColors: { background: s, description:
|
|
946
|
-
category_guid:
|
|
947
|
-
description:
|
|
964
|
+
budgetColors: { background: s, description: o },
|
|
965
|
+
category_guid: r,
|
|
966
|
+
description: a,
|
|
948
967
|
percentage: c,
|
|
949
968
|
subBudgets: d,
|
|
950
|
-
transaction_total:
|
|
969
|
+
transaction_total: g
|
|
951
970
|
} = t;
|
|
952
|
-
return /* @__PURE__ */ e(V, { children: /* @__PURE__ */
|
|
953
|
-
/* @__PURE__ */ e(
|
|
971
|
+
return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ m(Y, { onClick: () => n?.(t), children: [
|
|
972
|
+
/* @__PURE__ */ e(ie, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Oe, { color: s, percent: c, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: r, variant: "basic" }) }) }),
|
|
954
973
|
/* @__PURE__ */ e(
|
|
955
974
|
Z,
|
|
956
975
|
{
|
|
957
|
-
primary: /* @__PURE__ */
|
|
976
|
+
primary: /* @__PURE__ */ m(C, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
958
977
|
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: t.category.name }),
|
|
959
978
|
/* @__PURE__ */ e(y, { fontWeight: 400, variant: "Body", children: `
|
|
960
|
-
${T(
|
|
979
|
+
${T(g, "0,0")} /
|
|
961
980
|
${T(i, "0,0")}
|
|
962
981
|
` })
|
|
963
982
|
] }),
|
|
964
|
-
secondary: /* @__PURE__ */
|
|
983
|
+
secondary: /* @__PURE__ */ m(C, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
965
984
|
/* @__PURE__ */ e(y, { variant: "XSmall", children: `${d.length} Sub-budgets` }),
|
|
966
|
-
/* @__PURE__ */ e(y, { bold: c > 100, color:
|
|
985
|
+
/* @__PURE__ */ e(y, { bold: c > 100, color: o, variant: "XSmall", children: a })
|
|
967
986
|
] })
|
|
968
987
|
}
|
|
969
988
|
)
|
|
970
989
|
] }) });
|
|
971
|
-
},
|
|
972
|
-
const { onEvent: t } = X(), { budgets:
|
|
973
|
-
s(
|
|
974
|
-
budget_category:
|
|
990
|
+
}, Pt = I(() => {
|
|
991
|
+
const { onEvent: t } = X(), { budgets: n } = w(), { detailedBudgets: i, setSelectedBudget: s } = D(), o = (r) => {
|
|
992
|
+
s(r), t($.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
993
|
+
budget_category: r.category.name,
|
|
975
994
|
click_type: "list"
|
|
976
995
|
});
|
|
977
996
|
};
|
|
978
|
-
return /* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */ e(
|
|
980
|
-
/* @__PURE__ */ e(fe, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(K, { children: i.map((
|
|
981
|
-
/* @__PURE__ */ e(
|
|
982
|
-
/* @__PURE__ */ e(
|
|
983
|
-
] },
|
|
997
|
+
return /* @__PURE__ */ m(he, { elevation: 2, children: [
|
|
998
|
+
/* @__PURE__ */ e(Me, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Ae, { children: n.budget_categories_title }) }),
|
|
999
|
+
/* @__PURE__ */ e(fe, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(K, { children: i.map((r) => /* @__PURE__ */ m(l.Fragment, { children: [
|
|
1000
|
+
/* @__PURE__ */ e($t, { budget: r, onClick: o }),
|
|
1001
|
+
/* @__PURE__ */ e(se, {})
|
|
1002
|
+
] }, r.guid)) }) })
|
|
984
1003
|
] });
|
|
985
|
-
}),
|
|
986
|
-
const t =
|
|
987
|
-
const
|
|
988
|
-
let x =
|
|
1004
|
+
}), Gt = I(() => {
|
|
1005
|
+
const t = te(), { onEvent: n } = X(), { visibleAccounts: i } = ve(), { budgets: s, common: o, recurring: r } = w(), { incomeCategories: a, spendCategories: c } = F(), { detailedBudgets: d, totalBudgeted: g } = D(), { incomeTotal: u } = ne(), { setFilter: _ } = re(), [f, h] = l.useState(!1), [p, B] = l.useMemo(() => {
|
|
1006
|
+
const v = c.reduce((R, N) => R + N.totalAmount, 0);
|
|
1007
|
+
let x = v / g;
|
|
989
1008
|
x > 1 && (x = 1);
|
|
990
|
-
let
|
|
991
|
-
x > 0.8 && x < 1 ?
|
|
1009
|
+
let O = t.palette.success.main;
|
|
1010
|
+
x > 0.8 && x < 1 ? O = t.palette.warning.main : x >= 1 && (O = t.palette.error.main);
|
|
992
1011
|
const M = [
|
|
993
1012
|
{
|
|
994
|
-
color:
|
|
1013
|
+
color: O,
|
|
995
1014
|
percentage: `${x}`
|
|
996
1015
|
}
|
|
997
1016
|
];
|
|
998
|
-
return [
|
|
999
|
-
}, [d, c]), [b,
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1017
|
+
return [v, M];
|
|
1018
|
+
}, [d, c]), [b, S] = l.useMemo(() => {
|
|
1019
|
+
const v = Math.abs(
|
|
1020
|
+
a.reduce((M, R) => M + R.totalAmount, 0)
|
|
1002
1021
|
);
|
|
1003
|
-
let x =
|
|
1022
|
+
let x = v / u;
|
|
1004
1023
|
x > 1 && (x = 1);
|
|
1005
|
-
const
|
|
1024
|
+
const O = [
|
|
1006
1025
|
{
|
|
1007
1026
|
color: t.palette.secondary.main,
|
|
1008
1027
|
percentage: `${x}`
|
|
1009
1028
|
}
|
|
1010
1029
|
];
|
|
1011
|
-
return [
|
|
1012
|
-
}, [
|
|
1030
|
+
return [v, O];
|
|
1031
|
+
}, [a, u]), A = () => {
|
|
1013
1032
|
_({
|
|
1014
|
-
accounts: i.map((
|
|
1033
|
+
accounts: i.map((v) => v.guid),
|
|
1015
1034
|
dateRange: {
|
|
1016
|
-
start:
|
|
1035
|
+
start: it(/* @__PURE__ */ new Date(), 90),
|
|
1017
1036
|
end: /* @__PURE__ */ new Date()
|
|
1018
1037
|
}
|
|
1019
|
-
}), h(!0),
|
|
1038
|
+
}), h(!0), n($.BUDGETS_CLICK_EDIT_INCOME);
|
|
1020
1039
|
};
|
|
1021
|
-
return /* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */ e(
|
|
1023
|
-
/* @__PURE__ */ e(fe, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */
|
|
1024
|
-
/* @__PURE__ */
|
|
1040
|
+
return /* @__PURE__ */ m(he, { elevation: 2, sx: { overflow: "visible" }, children: [
|
|
1041
|
+
/* @__PURE__ */ e(Me, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Ae, { children: s.overview_title }) }),
|
|
1042
|
+
/* @__PURE__ */ e(fe, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ m(C, { gap: 24, children: [
|
|
1043
|
+
/* @__PURE__ */ m(C, { gap: 8, children: [
|
|
1025
1044
|
/* @__PURE__ */ e(y, { bold: !0, sx: { mb: 8 }, variant: "Body", children: s.spending_title }),
|
|
1026
|
-
/* @__PURE__ */ e(pe, { data:
|
|
1027
|
-
/* @__PURE__ */ e(y, { variant: "Small", children:
|
|
1045
|
+
/* @__PURE__ */ e(pe, { data: B, height: 16 }),
|
|
1046
|
+
/* @__PURE__ */ e(y, { variant: "Small", children: L(
|
|
1028
1047
|
s.spending_description,
|
|
1029
1048
|
T(p, "0,0"),
|
|
1030
|
-
T(
|
|
1049
|
+
T(g, "0,0")
|
|
1031
1050
|
) })
|
|
1032
1051
|
] }),
|
|
1033
|
-
/* @__PURE__ */
|
|
1034
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ m(C, { gap: 8, children: [
|
|
1053
|
+
/* @__PURE__ */ m(C, { alignItems: "center", direction: "row", gap: 4, mb: -4, children: [
|
|
1035
1054
|
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: s.income_title }),
|
|
1036
1055
|
/* @__PURE__ */ e(
|
|
1037
|
-
|
|
1056
|
+
ct,
|
|
1038
1057
|
{
|
|
1039
|
-
"aria-label":
|
|
1040
|
-
onClick:
|
|
1058
|
+
"aria-label": r.manage_income,
|
|
1059
|
+
onClick: A,
|
|
1041
1060
|
sx: { p: 0 },
|
|
1042
|
-
children: /* @__PURE__ */ e(
|
|
1061
|
+
children: /* @__PURE__ */ e(G, { color: "primary", name: "edit" })
|
|
1043
1062
|
}
|
|
1044
1063
|
)
|
|
1045
1064
|
] }),
|
|
1046
|
-
/* @__PURE__ */ e(pe, { data:
|
|
1047
|
-
/* @__PURE__ */ e(y, { variant: "Small", children:
|
|
1065
|
+
/* @__PURE__ */ e(pe, { data: S, height: 16 }),
|
|
1066
|
+
/* @__PURE__ */ e(y, { variant: "Small", children: L(
|
|
1048
1067
|
s.income_description,
|
|
1049
1068
|
T(b, "0,0"),
|
|
1050
1069
|
T(u, "0,0")
|
|
@@ -1052,124 +1071,136 @@ const vt = ({
|
|
|
1052
1071
|
] })
|
|
1053
1072
|
] }) }),
|
|
1054
1073
|
/* @__PURE__ */ e(
|
|
1055
|
-
|
|
1074
|
+
P,
|
|
1056
1075
|
{
|
|
1057
|
-
ariaLabelClose:
|
|
1076
|
+
ariaLabelClose: o.close_aria,
|
|
1058
1077
|
isOpen: f,
|
|
1059
1078
|
onClose: () => h(!1),
|
|
1060
|
-
title:
|
|
1061
|
-
children: /* @__PURE__ */ e(
|
|
1079
|
+
title: r.manage_income,
|
|
1080
|
+
children: /* @__PURE__ */ e(lt, { forOverview: !0 })
|
|
1062
1081
|
}
|
|
1063
1082
|
)
|
|
1064
1083
|
] });
|
|
1065
|
-
}), xe = 480,
|
|
1066
|
-
const i =
|
|
1084
|
+
}), xe = 480, Pn = I(({ onBackClick: t, sx: n }) => {
|
|
1085
|
+
const i = te(), { onEvent: s } = X(), { visibleAccounts: o } = ve(), { budgets: r, common: a } = w(), { isCopyLoaded: c, isInitialized: d, selectedAccounts: g, setDisplayedDate: u, setSelectedAccounts: _ } = ae(), {
|
|
1067
1086
|
alert: f,
|
|
1068
1087
|
dateRange: h,
|
|
1069
1088
|
isDataLoaded: p,
|
|
1070
|
-
loadBudgetData:
|
|
1089
|
+
loadBudgetData: B,
|
|
1071
1090
|
setDateRange: b,
|
|
1072
|
-
setAlert:
|
|
1073
|
-
setTheme:
|
|
1074
|
-
detailedBudgets:
|
|
1075
|
-
} = D(), { loadRepeatingTransactions: x, setDateRange:
|
|
1076
|
-
l.useEffect(() => (
|
|
1077
|
-
b({ start: J(
|
|
1091
|
+
setAlert: S,
|
|
1092
|
+
setTheme: A,
|
|
1093
|
+
detailedBudgets: v
|
|
1094
|
+
} = D(), { loadRepeatingTransactions: x, setDateRange: O } = ne(), { reloadCategoryTotals: M } = F(), { isSmallTablet: R, isMobile: N, isSmallMobile: de } = ce(), k = R || N || de, [Pe, q] = l.useState(!1);
|
|
1095
|
+
l.useEffect(() => (A(i), _(o), b({ start: Q(J()), end: ge(J()) }), s($.BUDGETS_VIEW), () => {
|
|
1096
|
+
b({ start: Q(J()), end: ge(J()) });
|
|
1078
1097
|
}), []), l.useEffect(() => {
|
|
1079
|
-
_(
|
|
1080
|
-
}, [
|
|
1081
|
-
d && (u(h.start, h.end), M(
|
|
1082
|
-
}, [d,
|
|
1083
|
-
|
|
1098
|
+
_(o);
|
|
1099
|
+
}, [o]), l.useEffect(() => {
|
|
1100
|
+
d && (u(h.start, h.end), M(g, h.start, h.end).finally(), O(h), p || (x().finally(), B().finally()));
|
|
1101
|
+
}, [d, g, h]), we({
|
|
1102
|
+
widgetName: "BubbleBudgetsWidget",
|
|
1103
|
+
isLoaded: p
|
|
1104
|
+
});
|
|
1105
|
+
const Ge = (ye) => {
|
|
1084
1106
|
b({ start: ye[0] || /* @__PURE__ */ new Date(), end: ye[1] || /* @__PURE__ */ new Date() });
|
|
1085
|
-
},
|
|
1086
|
-
s(
|
|
1107
|
+
}, je = () => {
|
|
1108
|
+
s($.BUDGETS_CLICK_FILTER);
|
|
1087
1109
|
}, be = () => {
|
|
1088
|
-
|
|
1089
|
-
},
|
|
1090
|
-
|
|
1091
|
-
},
|
|
1092
|
-
|
|
1093
|
-
|
|
1110
|
+
q(!0), s($.BUDGETS_CLICK_ADD);
|
|
1111
|
+
}, ze = () => {
|
|
1112
|
+
q(!1);
|
|
1113
|
+
}, Ue = () => {
|
|
1114
|
+
q(!1);
|
|
1115
|
+
}, Fe = tt(h.end, Q(/* @__PURE__ */ new Date()));
|
|
1116
|
+
return !c || !d || !p ? /* @__PURE__ */ e(U, {}) : /* @__PURE__ */ m(
|
|
1117
|
+
Je,
|
|
1094
1118
|
{
|
|
1095
|
-
accountOptions:
|
|
1119
|
+
accountOptions: o,
|
|
1096
1120
|
actions: [
|
|
1097
1121
|
{
|
|
1098
1122
|
iconName: "add",
|
|
1099
|
-
label:
|
|
1123
|
+
label: r.add_title,
|
|
1100
1124
|
onClick: be
|
|
1101
1125
|
}
|
|
1102
1126
|
],
|
|
1103
1127
|
calendarActions: {
|
|
1104
|
-
onRangeChanged:
|
|
1105
|
-
shouldDisableNext:
|
|
1128
|
+
onRangeChanged: Ge,
|
|
1129
|
+
shouldDisableNext: Fe,
|
|
1106
1130
|
shouldDisablePicker: !0
|
|
1107
1131
|
},
|
|
1108
|
-
onAccountsFilterClick:
|
|
1132
|
+
onAccountsFilterClick: je,
|
|
1109
1133
|
onBackClick: t,
|
|
1110
|
-
sx:
|
|
1111
|
-
title:
|
|
1134
|
+
sx: n,
|
|
1135
|
+
title: r.budgets_title,
|
|
1112
1136
|
children: [
|
|
1113
|
-
(!d || !p) && /* @__PURE__ */ e(
|
|
1114
|
-
d && p && /* @__PURE__ */
|
|
1115
|
-
|
|
1137
|
+
(!d || !p) && /* @__PURE__ */ e(U, {}),
|
|
1138
|
+
d && p && /* @__PURE__ */ m(
|
|
1139
|
+
C,
|
|
1116
1140
|
{
|
|
1117
|
-
direction:
|
|
1141
|
+
direction: k ? "column" : "row",
|
|
1118
1142
|
height: "100%",
|
|
1119
1143
|
sx: { justifyContent: "center" },
|
|
1120
1144
|
width: "100%",
|
|
1121
1145
|
children: [
|
|
1122
|
-
/* @__PURE__ */ e(
|
|
1123
|
-
|
|
1146
|
+
/* @__PURE__ */ e(C, { height: k ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
|
|
1147
|
+
Ne,
|
|
1124
1148
|
{
|
|
1125
1149
|
createBudgetOnClick: be,
|
|
1126
|
-
height:
|
|
1150
|
+
height: k ? 450 : 800,
|
|
1127
1151
|
isDraggable: !0,
|
|
1128
|
-
shouldShowZeroState:
|
|
1129
|
-
unavailableWidth:
|
|
1152
|
+
shouldShowZeroState: v.length === 0,
|
|
1153
|
+
unavailableWidth: k ? 0 : xe
|
|
1130
1154
|
}
|
|
1131
1155
|
) }),
|
|
1132
|
-
|
|
1133
|
-
|
|
1156
|
+
v.length !== 0 && /* @__PURE__ */ m(
|
|
1157
|
+
C,
|
|
1134
1158
|
{
|
|
1135
1159
|
gap: 24,
|
|
1136
1160
|
height: "100%",
|
|
1137
1161
|
sx: { mr: 24, mt: 48 },
|
|
1138
|
-
width:
|
|
1162
|
+
width: k ? "100%" : xe,
|
|
1139
1163
|
children: [
|
|
1140
|
-
/* @__PURE__ */ e(
|
|
1141
|
-
/* @__PURE__ */ e(
|
|
1164
|
+
/* @__PURE__ */ e(Gt, {}),
|
|
1165
|
+
/* @__PURE__ */ e(Pt, {})
|
|
1142
1166
|
]
|
|
1143
1167
|
}
|
|
1144
1168
|
)
|
|
1145
1169
|
]
|
|
1146
1170
|
}
|
|
1147
1171
|
),
|
|
1148
|
-
/* @__PURE__ */ e(
|
|
1172
|
+
/* @__PURE__ */ e(Nt, {}),
|
|
1149
1173
|
/* @__PURE__ */ e(
|
|
1150
|
-
|
|
1174
|
+
P,
|
|
1151
1175
|
{
|
|
1152
|
-
ariaLabelClose:
|
|
1153
|
-
isOpen:
|
|
1154
|
-
onClose: () =>
|
|
1155
|
-
title:
|
|
1156
|
-
children: /* @__PURE__ */ e(
|
|
1176
|
+
ariaLabelClose: a.close_aria,
|
|
1177
|
+
isOpen: Pe,
|
|
1178
|
+
onClose: () => q(!1),
|
|
1179
|
+
title: r.add_new_title,
|
|
1180
|
+
children: /* @__PURE__ */ e(
|
|
1181
|
+
Re,
|
|
1182
|
+
{
|
|
1183
|
+
onAddBudget: ze,
|
|
1184
|
+
onRecalculateBudgets: Ue
|
|
1185
|
+
}
|
|
1186
|
+
)
|
|
1157
1187
|
}
|
|
1158
1188
|
),
|
|
1159
1189
|
/* @__PURE__ */ e(
|
|
1160
|
-
|
|
1190
|
+
Ie,
|
|
1161
1191
|
{
|
|
1162
1192
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1163
1193
|
autoHideDuration: 3500,
|
|
1164
1194
|
onClose: () => {
|
|
1165
|
-
|
|
1195
|
+
S("");
|
|
1166
1196
|
},
|
|
1167
1197
|
open: !!f,
|
|
1168
1198
|
children: /* @__PURE__ */ e(
|
|
1169
|
-
|
|
1199
|
+
De,
|
|
1170
1200
|
{
|
|
1201
|
+
closeText: "",
|
|
1171
1202
|
onClose: () => {
|
|
1172
|
-
|
|
1203
|
+
S("");
|
|
1173
1204
|
},
|
|
1174
1205
|
severity: "success",
|
|
1175
1206
|
variant: "filled",
|
|
@@ -1183,6 +1214,6 @@ const vt = ({
|
|
|
1183
1214
|
);
|
|
1184
1215
|
});
|
|
1185
1216
|
export {
|
|
1186
|
-
|
|
1187
|
-
|
|
1217
|
+
$n as BubbleBudgetsMiniWidget,
|
|
1218
|
+
Pn as BubbleBudgetsWidget
|
|
1188
1219
|
};
|