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