@mx-cartographer/experiences 9.0.3 → 9.1.0-alpha.bb1

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.
Files changed (121) hide show
  1. package/CHANGELOG.md +0 -4
  2. package/dist/Analytics-BKzTPees.mjs +61 -0
  3. package/dist/GlobalCopyApi-BeXzaDH9.mjs +487 -0
  4. package/dist/HeaderCell-EhCUSjvj.mjs +10 -0
  5. package/dist/Loader-BlVzRtUd.mjs +73 -0
  6. package/dist/MiniWidgetContainer-COwnjfy7.mjs +110 -0
  7. package/dist/OriginalBalanceAction-sbiqaxok.mjs +110 -0
  8. package/dist/SpendingLegend-D15ixlQ1.mjs +222 -0
  9. package/dist/accounts/index.es.js +12 -1598
  10. package/dist/accounts-DkyAiLpg.mjs +15632 -0
  11. package/dist/analytics/index.es.js +155 -139
  12. package/dist/budgets/index.es.js +1317 -1266
  13. package/dist/cashflow/index.es.js +1047 -942
  14. package/dist/categories/index.es.js +4 -4
  15. package/dist/common/index.es.js +101 -310
  16. package/dist/core/index.es.js +80 -104
  17. package/dist/core-BexP5oiV.mjs +4047 -0
  18. package/dist/dashboard/index.es.js +185 -141
  19. package/dist/debts/index.es.js +1384 -1272
  20. package/dist/finstrong/index.es.js +3366 -3471
  21. package/dist/goals/index.es.js +1103 -984
  22. package/dist/help/index.es.js +3 -25
  23. package/dist/help-CctDYrAH.mjs +2308 -0
  24. package/dist/insights/index.es.js +93 -4843
  25. package/dist/investments/index.es.js +1533 -1522
  26. package/dist/merchants/index.es.js +75 -64
  27. package/dist/microinsights/index.es.js +15 -824
  28. package/dist/microinsights-CRf3ChsJ.mjs +1814 -0
  29. package/dist/networth/index.es.js +550 -503
  30. package/dist/notifications/index.es.js +169 -161
  31. package/dist/recurringtransactions/index.es.js +10 -962
  32. package/dist/recurringtransactions-gbJ_NA8u.mjs +1564 -0
  33. package/dist/settings/index.es.js +13 -880
  34. package/dist/settings-ZMHe439l.mjs +1526 -0
  35. package/dist/spending/index.es.js +400 -456
  36. package/dist/transactions/index.es.js +10 -603
  37. package/dist/trends/index.es.js +1268 -1407
  38. package/package.json +28 -28
  39. package/dist/Account-BaJmiJAG.mjs +0 -118
  40. package/dist/Account-BxHMlV9R.mjs +0 -30
  41. package/dist/AccountDetailsHeader-DIysk_4w.mjs +0 -95
  42. package/dist/AccountDisplayName-CO7z3v99.mjs +0 -11
  43. package/dist/AccountFields-mwJ8NXsX.mjs +0 -141
  44. package/dist/AccountListItem-BDXHs4tV.mjs +0 -94
  45. package/dist/AccountUtils-T5_Odvos.mjs +0 -27
  46. package/dist/Accounts-CseLC3lL.mjs +0 -5
  47. package/dist/Analytics-CkYXKvco.mjs +0 -53
  48. package/dist/Analytics-CzGzz_sE.mjs +0 -136
  49. package/dist/ApiEndpoints-DXwIYNUV.mjs +0 -49
  50. package/dist/BudgetUtil-Bg2AQJpQ.mjs +0 -74
  51. package/dist/Category-DEKZGLYe.mjs +0 -301
  52. package/dist/CategorySelectorDrawer-8soGrhB8.mjs +0 -430
  53. package/dist/Connect-Dk6GZEsA.mjs +0 -39
  54. package/dist/ConnectCard-CCep7Zqe.mjs +0 -54
  55. package/dist/ConnectDrawer-Cnjr3Ddg.mjs +0 -58
  56. package/dist/ConnectionsDrawer-CtfPXk0M.mjs +0 -54
  57. package/dist/CurrencyDialog-DumQCTPO.mjs +0 -373
  58. package/dist/CurrencyInput-adTIRtL3.mjs +0 -87
  59. package/dist/CurrencyText-CCbE6MmF.mjs +0 -20
  60. package/dist/DateFormats-HudZ3Bjs.mjs +0 -64
  61. package/dist/DateUtil-Bhq59ZVg.mjs +0 -58
  62. package/dist/DebtUtils-DD3186U-.mjs +0 -153
  63. package/dist/Dialog-Bvd2n8hz.mjs +0 -66
  64. package/dist/Donut-SzzfZDHF.mjs +0 -88
  65. package/dist/Drawer-BXqqBMxg.mjs +0 -174
  66. package/dist/EmbeddedCard-DPwJjqMH.mjs +0 -856
  67. package/dist/EmptyState-CJUDc3kD.mjs +0 -84
  68. package/dist/Error-Dogaw2jO.mjs +0 -84
  69. package/dist/ErrorBoundary-CsdOcnJ9.mjs +0 -23
  70. package/dist/ExportCsvAction-Bw02ZJEj.mjs +0 -24
  71. package/dist/GlobalAccountFilter-7Cg2-9A5.mjs +0 -237
  72. package/dist/GlobalCopyApi-wcnDUzMV.mjs +0 -128
  73. package/dist/GoalsUtil-C9EnLWvC.mjs +0 -107
  74. package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
  75. package/dist/Help-CkQTjORd.mjs +0 -299
  76. package/dist/Help-DJ8PrVHX.mjs +0 -3209
  77. package/dist/IconBacking-DgT8DCeh.mjs +0 -39
  78. package/dist/InformationTooltip-4su8bn1e.mjs +0 -41
  79. package/dist/InvestmentUtil-BItV7uEs.mjs +0 -134
  80. package/dist/LineChart-CejWS_rh.mjs +0 -612
  81. package/dist/ListItemAction-CzZ8s39Z.mjs +0 -69
  82. package/dist/ListItemRow-kH1rn8Xu.mjs +0 -67
  83. package/dist/ListItemWrapper-B5r-YQQ_.mjs +0 -42
  84. package/dist/Loader-CxeBwuPG.mjs +0 -21
  85. package/dist/Localization-DnoVyBNK.mjs +0 -38
  86. package/dist/ManageIncome-D1yBODQi.mjs +0 -595
  87. package/dist/MicroWidgetContainer-CfKdQfhi.mjs +0 -45
  88. package/dist/MiniWidgetContainer-BdPiUU-u.mjs +0 -66
  89. package/dist/NetWorthUtils-DilGN1nW.mjs +0 -95
  90. package/dist/Notification-DTNYSd8P.mjs +0 -7
  91. package/dist/NotificationSettings-B4JA5IKE.mjs +0 -677
  92. package/dist/NotificationUtils-BRGFTePr.mjs +0 -23
  93. package/dist/NumberFormatting--XMeeBfr.mjs +0 -49
  94. package/dist/OriginalBalanceAction-BybTXDtO.mjs +0 -114
  95. package/dist/RecurringSettings-D2xbNb67.mjs +0 -88
  96. package/dist/RecurringTransactionsUtil-B3rLEx_g.mjs +0 -253
  97. package/dist/ResponsiveButton-CC9F_Ezk.mjs +0 -45
  98. package/dist/SearchBox-Cpgu_gdO.mjs +0 -50
  99. package/dist/Select-BFt-HD-L.mjs +0 -55
  100. package/dist/SelectionBox-B4xELRgp.mjs +0 -48
  101. package/dist/SingleSegmentDonut-7Uy6VEld.mjs +0 -69
  102. package/dist/Sizes-DISGrlUg.mjs +0 -6
  103. package/dist/SkeletonLoader-BaNboJjD.mjs +0 -38
  104. package/dist/SpendingData-Fii_xATx.mjs +0 -53
  105. package/dist/SpendingLegend-5Ct_FZ8o.mjs +0 -193
  106. package/dist/StatusBar-CPfSXe80.mjs +0 -30
  107. package/dist/TabContentContainer-CnMXkVqr.mjs +0 -21
  108. package/dist/ToggleListItem-Dl1lXNwj.mjs +0 -91
  109. package/dist/TransactionDetails-DctXr07p.mjs +0 -1714
  110. package/dist/TransactionUtils-BphBJBbU.mjs +0 -234
  111. package/dist/TrendsUtil-D9z3kIj_.mjs +0 -69
  112. package/dist/UserStore-CRpKQjpP.mjs +0 -3002
  113. package/dist/ViewMoreMicroCard-BD_MNc2z.mjs +0 -1295
  114. package/dist/WidgetContainer-CmbU4CBH.mjs +0 -482
  115. package/dist/hooks-BaO_gOI6.mjs +0 -77
  116. package/dist/useAccountDisplayName-CFa_MrS6.mjs +0 -15
  117. package/dist/useAriaLive-MkYebyUR.mjs +0 -35
  118. package/dist/useDimensions-CeDR9V8N.mjs +0 -36
  119. package/dist/useInsightsEnabled-DaNLPmUU.mjs +0 -11
  120. package/dist/useScreenSize-mWpmnh5w.mjs +0 -36
  121. package/dist/useWidgetLoadTimer-CJb-RELP.mjs +0 -19
@@ -1,190 +1,175 @@
1
- import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
- import c from "react";
3
- import { observer as I } from "mobx-react-lite";
4
- import { startOfMonth as at } from "date-fns/startOfMonth";
5
- import { endOfMonth as it } from "date-fns/endOfMonth";
1
+ import { f as w } from "../GlobalCopyApi-BeXzaDH9.mjs";
2
+ import { J as $, s as _e } from "../core-BexP5oiV.mjs";
3
+ import { $t as ye, Gn as be, c as Ce, lr as Y, mr as Se, sr as q } from "../accounts-DkyAiLpg.mjs";
4
+ import { n as oe } from "../Analytics-BKzTPees.mjs";
5
+ import { E as ie, d as Te, h as P, i as H, n as re, p as I, s as W, t as se } from "../Loader-BlVzRtUd.mjs";
6
+ import { t as ve } from "../MiniWidgetContainer-COwnjfy7.mjs";
7
+ import { i as le, n as k, r as de, t as Q } from "../SpendingLegend-D15ixlQ1.mjs";
8
+ import d from "react";
9
+ import { observer as A } from "mobx-react-lite";
10
+ import C from "@mui/material/Stack";
11
+ import { Icon as Me, Text as T } from "@mxenabled/mxui";
12
+ import { endOfMonth as ce } from "date-fns/endOfMonth";
13
+ import { startOfMonth as ge } from "date-fns/startOfMonth";
14
+ import { startOfToday as X } from "date-fns/startOfToday";
15
+ import xe from "@mui/material/Button";
16
+ import { jsx as e, jsxs as u } from "react/jsx-runtime";
17
+ import { useTheme as De } from "@mui/material/styles";
6
18
  import L from "@mui/material/Box";
7
- import y from "@mui/material/Stack";
8
- import $ from "@mui/material/Tab";
9
- import rt from "@mui/material/Tabs";
10
- import { useTheme as _t } from "@mui/material/styles";
11
- import { g as st, a as lt, S as B, b as q } from "../SpendingLegend-5Ct_FZ8o.mjs";
12
- import { Text as T, Icon as bt } from "@mxenabled/mxui";
13
- import { f as k } from "../NumberFormatting--XMeeBfr.mjs";
14
- import { u as A, l as R, d as ct, b as P, a as H, h as dt, g as yt } from "../hooks-BaO_gOI6.mjs";
15
- import { u as gt } from "../useWidgetLoadTimer-CJb-RELP.mjs";
16
- import { L as pt } from "../Loader-CxeBwuPG.mjs";
17
- import { M as Ct } from "../MiniWidgetContainer-BdPiUU-u.mjs";
18
- import { startOfToday as J } from "date-fns/startOfToday";
19
- import St from "@mui/material/Button";
20
- import { useTheme as Tt } from "@mui/material";
21
- import { e as Mt } from "../TransactionUtils-BphBJBbU.mjs";
22
- import { T as Dt } from "../EmbeddedCard-DPwJjqMH.mjs";
23
- import { T as xt } from "../TransactionDetails-DctXr07p.mjs";
24
- import vt from "@mui/material/Collapse";
25
- import wt from "@mui/material/Divider";
26
- import Q from "@mui/material/List";
27
- import X from "@mui/material/ListItem";
28
- import Z from "@mui/material/ListItemButton";
29
- import { u as Lt } from "../useScreenSize-mWpmnh5w.mjs";
30
- import { D as tt } from "../Drawer-BXqqBMxg.mjs";
31
- import { C as w } from "../Category-DEKZGLYe.mjs";
32
- import { parseISO as et } from "date-fns/parseISO";
33
- import { A as nt } from "../Analytics-CzGzz_sE.mjs";
34
- import { W as It } from "../WidgetContainer-CmbU4CBH.mjs";
35
- const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y, { direction: "column", children: [
36
- /* @__PURE__ */ t(T, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: d }),
37
- /* @__PURE__ */ t(T, { variant: "caption", children: k(n, o === "mini" ? "0,0" : "0,0.00") })
38
- ] }), At = () => {
39
- const n = _t(), { goals: d, spending: o } = A(), { categories: a, dateRangeCategoryTotals: i } = R(), g = c.useMemo(
40
- () => [
41
- n.palette.chartMono.chartMono5,
42
- n.palette.chartMono.chartMono4,
43
- n.palette.chartMono.chartMono3,
44
- n.palette.chartMono.chartMono2,
45
- n.palette.chartMono.chartMono1,
46
- n.palette.chartMono.chartMono6
47
- ],
48
- [n]
49
- ), [e, r] = c.useState(""), [s, b] = c.useState(0), u = c.useMemo(
50
- () => st(a, d, n, i),
51
- [a, i]
52
- ), h = c.useMemo(
53
- () => lt(a, i, g),
54
- [a, i, g]
55
- ), M = (_, D) => {
56
- b(D), r("");
57
- }, f = (_) => {
58
- r(e === _ ? "" : _);
19
+ import B from "@mui/material/Tab";
20
+ import pe from "@mui/material/Tabs";
21
+ import { parseISO as Z } from "date-fns/parseISO";
22
+ import { useTheme as we } from "@mui/material";
23
+ import Le from "@mui/material/Divider";
24
+ import ee from "@mui/material/List";
25
+ import te from "@mui/material/ListItem";
26
+ import ae from "@mui/material/ListItemButton";
27
+ import Ie from "@mui/material/Collapse";
28
+ var G = ({ amount: a, label: g, variant: n = "full" }) => /* @__PURE__ */ u(C, {
29
+ direction: "column",
30
+ children: [/* @__PURE__ */ e(T, {
31
+ bold: !0,
32
+ sx: { textTransform: "none" },
33
+ variant: "body1",
34
+ children: g
35
+ }), /* @__PURE__ */ e(T, {
36
+ variant: "caption",
37
+ children: $(a, n === "mini" ? "0,0" : "0,0.00")
38
+ })]
39
+ }), Ae = () => {
40
+ const a = De(), { goals: g, spending: n } = I(), { categories: o, dateRangeCategoryTotals: i } = W(), p = d.useMemo(() => [
41
+ a.palette.chartMono.chartMono5,
42
+ a.palette.chartMono.chartMono4,
43
+ a.palette.chartMono.chartMono3,
44
+ a.palette.chartMono.chartMono2,
45
+ a.palette.chartMono.chartMono1,
46
+ a.palette.chartMono.chartMono6
47
+ ], [a]), [t, r] = d.useState(""), [s, y] = d.useState(0), c = d.useMemo(() => le(o, g, a, i), [o, i]), b = d.useMemo(() => de(o, i, p), [
48
+ o,
49
+ i,
50
+ p
51
+ ]), v = (h, M) => {
52
+ y(M), r("");
53
+ }, m = (h) => {
54
+ r(t === h ? "" : h);
59
55
  };
60
- return /* @__PURE__ */ p(L, { width: "100%", children: [
61
- /* @__PURE__ */ p(
62
- rt,
63
- {
64
- "aria-label": o.mini_title,
65
- onChange: M,
56
+ return /* @__PURE__ */ u(L, {
57
+ width: "100%",
58
+ children: [
59
+ /* @__PURE__ */ u(pe, {
60
+ "aria-label": n.mini_title,
61
+ onChange: v,
66
62
  sx: { touchAction: "manipulation" },
67
63
  value: s,
68
64
  variant: "fullWidth",
69
- children: [
70
- /* @__PURE__ */ t(
71
- $,
72
- {
73
- "aria-controls": "spending-tabpanel",
74
- id: "spending-tab",
75
- label: /* @__PURE__ */ t(
76
- G,
77
- {
78
- amount: u.totalAmount,
79
- label: o.spend_tab_title,
80
- variant: "mini"
81
- }
82
- ),
83
- tabIndex: s === 0 ? 0 : -1
84
- }
85
- ),
86
- /* @__PURE__ */ t(
87
- $,
88
- {
89
- "aria-controls": "income-tabpanel",
90
- id: "income-tab",
91
- label: /* @__PURE__ */ t(
92
- G,
93
- {
94
- amount: h.totalAmount,
95
- label: o.income_tab_title,
96
- variant: "mini"
97
- }
98
- ),
99
- tabIndex: s === 1 ? 0 : -1
100
- }
101
- )
102
- ]
103
- }
104
- ),
105
- /* @__PURE__ */ t(
106
- L,
107
- {
65
+ children: [/* @__PURE__ */ e(B, {
66
+ "aria-controls": "spending-tabpanel",
67
+ id: "spending-tab",
68
+ label: /* @__PURE__ */ e(G, {
69
+ amount: c.totalAmount,
70
+ label: n.spend_tab_title,
71
+ variant: "mini"
72
+ }),
73
+ tabIndex: s === 0 ? 0 : -1
74
+ }), /* @__PURE__ */ e(B, {
75
+ "aria-controls": "income-tabpanel",
76
+ id: "income-tab",
77
+ label: /* @__PURE__ */ e(G, {
78
+ amount: b.totalAmount,
79
+ label: n.income_tab_title,
80
+ variant: "mini"
81
+ }),
82
+ tabIndex: s === 1 ? 0 : -1
83
+ })]
84
+ }),
85
+ /* @__PURE__ */ e(L, {
108
86
  "aria-labelledby": "spending-tab",
109
87
  hidden: s !== 0,
110
88
  id: "spending-tabpanel",
111
89
  role: "tabpanel",
112
- children: /* @__PURE__ */ p(y, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
113
- /* @__PURE__ */ t(
114
- B,
115
- {
116
- data: u,
117
- onSelected: f,
118
- selectedId: e,
119
- totalLabel: o.total_spending
120
- }
121
- ),
122
- /* @__PURE__ */ t(q, { data: u, onSelected: f, selectedId: e })
123
- ] })
124
- }
125
- ),
126
- /* @__PURE__ */ t(
127
- L,
128
- {
90
+ children: /* @__PURE__ */ u(C, {
91
+ direction: "row",
92
+ gap: 16,
93
+ justifyContent: "center",
94
+ p: 24,
95
+ children: [/* @__PURE__ */ e(k, {
96
+ data: c,
97
+ onSelected: m,
98
+ selectedId: t,
99
+ totalLabel: n.total_spending
100
+ }), /* @__PURE__ */ e(Q, {
101
+ data: c,
102
+ onSelected: m,
103
+ selectedId: t
104
+ })]
105
+ })
106
+ }),
107
+ /* @__PURE__ */ e(L, {
129
108
  "aria-labelledby": "income-tab",
130
109
  hidden: s !== 1,
131
110
  id: "income-tabpanel",
132
111
  role: "tabpanel",
133
- children: /* @__PURE__ */ p(y, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
134
- /* @__PURE__ */ t(
135
- B,
136
- {
137
- data: h,
138
- isIncome: !0,
139
- onSelected: f,
140
- selectedId: e,
141
- totalLabel: o.total_income
142
- }
143
- ),
144
- /* @__PURE__ */ t(q, { data: h, onSelected: f, selectedId: e })
145
- ] })
146
- }
147
- )
148
- ] });
149
- }, Et = I(At), Wt = ({ onPrimaryCtaClick: n, sx: d = {} }) => {
150
- const { isAccountDataLoaded: o, loadAccountData: a } = ct(), { dateRangeTotalsLoaded: i, categoriesLoaded: g, loadCategories: e, loadDateRangeCategoryTotals: r } = R(), { spending: s } = A(), { isInitialized: b, selectedAccounts: u } = P();
151
- return gt({
112
+ children: /* @__PURE__ */ u(C, {
113
+ direction: "row",
114
+ gap: 16,
115
+ justifyContent: "center",
116
+ p: 24,
117
+ children: [/* @__PURE__ */ e(k, {
118
+ data: b,
119
+ isIncome: !0,
120
+ onSelected: m,
121
+ selectedId: t,
122
+ totalLabel: n.total_income
123
+ }), /* @__PURE__ */ e(Q, {
124
+ data: b,
125
+ onSelected: m,
126
+ selectedId: t
127
+ })]
128
+ })
129
+ })
130
+ ]
131
+ });
132
+ }, Ee = A(Ae), Re = ({ onPrimaryCtaClick: a, sx: g = {} }) => {
133
+ const { isAccountDataLoaded: n, loadAccountData: o } = re(), { dateRangeTotalsLoaded: i, categoriesLoaded: p, loadCategories: t, loadDateRangeCategoryTotals: r } = W(), { spending: s } = I(), { isInitialized: y, selectedAccounts: c } = P();
134
+ return oe({
152
135
  widgetName: "SpendingMiniWidget",
153
136
  isLoaded: i
154
- }), c.useEffect(() => {
155
- o || a().finally(), g || e().finally();
156
- }, []), c.useEffect(() => {
157
- r(
158
- u,
159
- at(/* @__PURE__ */ new Date()),
160
- it(/* @__PURE__ */ new Date())
161
- ).finally();
162
- }, [u]), b ? /* @__PURE__ */ t(
163
- Ct,
164
- {
165
- className: "mx-exp-spending-miniwidget",
166
- onPrimaryCtaClick: n,
167
- primaryCtaLabel: s.primary_cta,
168
- primaryCtaLabelAria: s.primary_cta_aria,
169
- sx: { height: "100%", ...d },
170
- title: s.mini_title,
171
- children: /* @__PURE__ */ t(Et, {})
172
- }
173
- ) : /* @__PURE__ */ t(pt, {});
174
- }, Ce = I(Wt), Rt = ({
175
- data: n,
176
- onSelected: d,
177
- selectedId: o = "",
178
- title: a
179
- }) => {
180
- const { spending: i } = A(), g = n.categoryData.find((e) => e.guid === o);
181
- return /* @__PURE__ */ p(y, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
182
- /* @__PURE__ */ t(T, { bold: !0, id: "spending-list-title", sx: { py: 12 }, variant: "h3", children: `${a} ${i.by_category}` }),
183
- /* @__PURE__ */ t(wt, { "aria-hidden": "true" }),
184
- /* @__PURE__ */ t(Q, { "aria-labelledby": "spending-list-title", children: n.categoryData.map((e) => /* @__PURE__ */ p(c.Fragment, { children: [
185
- /* @__PURE__ */ t(
186
- X,
187
- {
137
+ }), d.useEffect(() => {
138
+ n || o().finally(), p || t().finally();
139
+ }, []), d.useEffect(() => {
140
+ r(c, ge(/* @__PURE__ */ new Date()), ce(/* @__PURE__ */ new Date())).finally();
141
+ }, [c]), y ? /* @__PURE__ */ e(ve, {
142
+ className: "mx-exp-spending-miniwidget",
143
+ onPrimaryCtaClick: a,
144
+ primaryCtaLabel: s.primary_cta,
145
+ primaryCtaLabelAria: s.primary_cta_aria,
146
+ sx: {
147
+ height: "100%",
148
+ ...g
149
+ },
150
+ title: s.mini_title,
151
+ children: /* @__PURE__ */ e(Ee, {})
152
+ }) : /* @__PURE__ */ e(se, {});
153
+ }, ut = A(Re), We = ({ data: a, onSelected: g, selectedId: n = "", title: o }) => {
154
+ const { spending: i } = I(), p = a.categoryData.find((t) => t.guid === n);
155
+ return /* @__PURE__ */ u(C, {
156
+ direction: "column",
157
+ justifyContent: "center",
158
+ maxWidth: 400,
159
+ minWidth: 275,
160
+ width: "100%",
161
+ children: [
162
+ /* @__PURE__ */ e(T, {
163
+ bold: !0,
164
+ id: "spending-list-title",
165
+ sx: { py: 12 },
166
+ variant: "h3",
167
+ children: `${o} ${i.by_category}`
168
+ }),
169
+ /* @__PURE__ */ e(Le, { "aria-hidden": "true" }),
170
+ /* @__PURE__ */ e(ee, {
171
+ "aria-labelledby": "spending-list-title",
172
+ children: a.categoryData.map((t) => /* @__PURE__ */ u(d.Fragment, { children: [/* @__PURE__ */ e(te, {
188
173
  disableGutters: !0,
189
174
  disablePadding: !0,
190
175
  sx: {
@@ -192,301 +177,260 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
192
177
  borderColor: "divider",
193
178
  minHeight: 44
194
179
  },
195
- children: /* @__PURE__ */ p(
196
- Z,
197
- {
198
- "aria-expanded": g?.guid === e.guid,
199
- id: `spending-list-category-${e.guid}`,
200
- onClick: () => d(e.guid),
201
- sx: { minHeight: 44, px: 8, py: 0 },
202
- children: [
203
- /* @__PURE__ */ t(
204
- L,
205
- {
206
- "aria-hidden": "true",
207
- borderRadius: 4,
208
- flexShrink: 0,
209
- height: 8,
210
- role: "presentation",
211
- sx: { backgroundColor: e.color, mr: 8 },
212
- width: 8
213
- }
214
- ),
215
- /* @__PURE__ */ p(
216
- y,
217
- {
218
- alignItems: "center",
219
- direction: "row",
220
- justifyContent: "space-between",
221
- width: "100%",
222
- children: [
223
- /* @__PURE__ */ t(T, { bold: o === e.guid, children: e.name }),
224
- /* @__PURE__ */ t(T, { bold: o === e.guid, variant: "body1", children: k(e.amount, "0,0.00") })
225
- ]
226
- }
227
- )
228
- ]
229
- }
230
- )
231
- }
232
- ),
233
- e.categoryTotals && e.categoryTotals.length > 0 && /* @__PURE__ */ t(vt, { in: g?.guid === e.guid, unmountOnExit: !0, children: /* @__PURE__ */ t(Q, { sx: { borderBottom: 1, borderColor: "divider" }, children: g?.categoryTotals?.map((r) => /* @__PURE__ */ t(
234
- X,
235
- {
236
- sx: {
237
- pl: 12,
238
- py: 0
239
- },
240
- children: /* @__PURE__ */ t(
241
- Z,
242
- {
243
- id: `spending-list-subcategory-${r.guid}`,
244
- onClick: () => d(r.guid, !0),
245
- sx: { minHeight: 44, px: 8, py: 0 },
246
- children: /* @__PURE__ */ p(y, { direction: "row", justifyContent: "space-between", width: "100%", children: [
247
- /* @__PURE__ */ p(T, { children: [
248
- r.name,
249
- " "
250
- ] }),
251
- /* @__PURE__ */ t(T, { children: k(r.amount, "0,0.00") })
252
- ] })
253
- }
254
- )
255
- },
256
- r.guid
257
- )) }) })
258
- ] }, e.guid)) }),
259
- /* @__PURE__ */ t(T, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${i.total}: ${k(n.totalAmount, "0,0.00")}` })
260
- ] });
261
- }, Nt = I(Rt), Ot = ({
262
- data: n,
263
- onSelected: d,
264
- onViewTransactions: o,
265
- selectedId: a,
266
- title: i
267
- }) => {
268
- const { isDesktop: g, isMobile: e } = Lt(), { dateRangeTotalsLoading: r } = R(), { spending: s } = A();
269
- return /* @__PURE__ */ p(
270
- y,
271
- {
272
- alignItems: e ? "center" : "flex-start",
273
- direction: e ? "column" : "row",
274
- gap: { xs: 16, md: 64, xl: 100 },
275
- justifyContent: "center",
276
- pt: 50,
277
- px: 8,
278
- children: [
279
- r && /* @__PURE__ */ t(
280
- B,
281
- {
282
- data: {
283
- categoryData: [],
284
- donutData: [],
285
- totalAmount: 0
180
+ children: /* @__PURE__ */ u(ae, {
181
+ "aria-expanded": p?.guid === t.guid,
182
+ id: `spending-list-category-${t.guid}`,
183
+ onClick: () => g(t.guid),
184
+ sx: {
185
+ minHeight: 44,
186
+ px: 8,
187
+ py: 0
286
188
  },
287
- onSelected: () => {
189
+ children: [/* @__PURE__ */ e(L, {
190
+ "aria-hidden": "true",
191
+ borderRadius: 4,
192
+ flexShrink: 0,
193
+ height: 8,
194
+ role: "presentation",
195
+ sx: {
196
+ backgroundColor: t.color,
197
+ mr: 8
198
+ },
199
+ width: 8
200
+ }), /* @__PURE__ */ u(C, {
201
+ alignItems: "center",
202
+ direction: "row",
203
+ justifyContent: "space-between",
204
+ width: "100%",
205
+ children: [/* @__PURE__ */ e(T, {
206
+ bold: n === t.guid,
207
+ children: t.name
208
+ }), /* @__PURE__ */ e(T, {
209
+ bold: n === t.guid,
210
+ variant: "body1",
211
+ children: $(t.amount, "0,0.00")
212
+ })]
213
+ })]
214
+ })
215
+ }), t.categoryTotals && t.categoryTotals.length > 0 && /* @__PURE__ */ e(Ie, {
216
+ in: p?.guid === t.guid,
217
+ unmountOnExit: !0,
218
+ children: /* @__PURE__ */ e(ee, {
219
+ sx: {
220
+ borderBottom: 1,
221
+ borderColor: "divider"
288
222
  },
289
- selectedId: "",
290
- size: g ? 400 : 300,
291
- totalLabel: "Loading ...",
292
- variant: "full"
293
- }
294
- ),
295
- !r && /* @__PURE__ */ t(
296
- B,
297
- {
298
- data: n,
299
- onSelected: (h) => {
300
- d(h), setTimeout(() => document.getElementById(`spending-list-category-${h}`)?.focus(), 0);
301
- },
302
- onViewTransactions: o,
303
- selectedId: a,
304
- size: g ? 400 : 300,
305
- totalLabel: s.total_amount,
306
- variant: "full"
307
- }
308
- ),
309
- /* @__PURE__ */ t(Nt, { data: n, onSelected: d, selectedId: a, title: i })
310
- ]
311
- }
312
- );
313
- }, ot = I(Ot), kt = (n) => [
314
- n.palette.chartMono.chartMono5,
315
- n.palette.chartMono.chartMono4,
316
- n.palette.chartMono.chartMono3,
317
- n.palette.chartMono.chartMono2,
318
- n.palette.chartMono.chartMono1,
319
- n.palette.chartMono.chartMono6
320
- ], $t = () => {
321
- const n = Tt(), { is_mobile_webview: d } = H(), { clientConfig: o } = H(), { categories: a, dateRangeCategoryTotals: i } = R(), {
322
- goals: g,
323
- spending: e,
324
- transactions: r
325
- } = A(), { displayedDateRange: s, selectedAccountGuids: b } = P(), {
326
- setFilter: u,
327
- sortedTransactions: h,
328
- sortedTransactionsWithSplits: M,
329
- tags: f
330
- } = dt(), _ = o?.master?.deep_link_params?.account_guids, D = o?.master?.deep_link_params?.view, [x, N] = c.useState(""), [v, C] = c.useState(D === "income" ? 1 : 0), [E, W] = c.useState(""), [O, j] = c.useState(!1), F = c.useMemo(
331
- () => st(a, g, n, i),
332
- [a, i]
333
- ), K = c.useMemo(
334
- () => lt(a, i, kt(n)),
335
- [a, i]
336
- ), V = c.useMemo(
337
- () => h.find((l) => l.guid === E),
338
- [E, h]
339
- ), ut = (l, S) => {
340
- C(S), N("");
341
- }, U = (l, S = !1) => {
342
- S ? mt(l) : N(x === l || l === "0" ? "" : l);
343
- }, mt = (l) => {
344
- u({
345
- ...{
346
- accounts: _ || b,
347
- dateRange: s
348
- },
349
- custom: (m) => x === "other" ? m.top_level_category_guid === l : m.category_guid === l,
223
+ children: p?.categoryTotals?.map((r) => /* @__PURE__ */ e(te, {
224
+ sx: {
225
+ pl: 12,
226
+ py: 0
227
+ },
228
+ children: /* @__PURE__ */ e(ae, {
229
+ id: `spending-list-subcategory-${r.guid}`,
230
+ onClick: () => g(r.guid, !0),
231
+ sx: {
232
+ minHeight: 44,
233
+ px: 8,
234
+ py: 0
235
+ },
236
+ children: /* @__PURE__ */ u(C, {
237
+ direction: "row",
238
+ justifyContent: "space-between",
239
+ width: "100%",
240
+ children: [/* @__PURE__ */ u(T, { children: [r.name, " "] }), /* @__PURE__ */ e(T, { children: $(r.amount, "0,0.00") })]
241
+ })
242
+ })
243
+ }, r.guid))
244
+ })
245
+ })] }, t.guid))
246
+ }),
247
+ /* @__PURE__ */ e(T, {
248
+ bold: !0,
249
+ sx: {
250
+ mt: 12,
251
+ pr: 8,
252
+ textAlign: "right"
253
+ },
254
+ children: `${i.total}: ${$(a.totalAmount, "0,0.00")}`
255
+ })
256
+ ]
257
+ });
258
+ }, Ne = A(We), Oe = ({ data: a, onSelected: g, onViewTransactions: n, selectedId: o, title: i }) => {
259
+ const { isDesktop: p, isMobile: t } = Se(), { dateRangeTotalsLoading: r } = W(), { spending: s } = I();
260
+ return /* @__PURE__ */ u(C, {
261
+ alignItems: t ? "center" : "flex-start",
262
+ direction: t ? "column" : "row",
263
+ gap: {
264
+ xs: 16,
265
+ md: 64,
266
+ xl: 100
267
+ },
268
+ justifyContent: "center",
269
+ pt: 50,
270
+ px: 8,
271
+ children: [
272
+ r && /* @__PURE__ */ e(k, {
273
+ data: {
274
+ categoryData: [],
275
+ donutData: [],
276
+ totalAmount: 0
277
+ },
278
+ onSelected: () => {
279
+ },
280
+ selectedId: "",
281
+ size: p ? 400 : 300,
282
+ totalLabel: "Loading ...",
283
+ variant: "full"
284
+ }),
285
+ !r && /* @__PURE__ */ e(k, {
286
+ data: a,
287
+ onSelected: (c) => {
288
+ g(c), setTimeout(() => document.getElementById(`spending-list-category-${c}`)?.focus(), 0);
289
+ },
290
+ onViewTransactions: n,
291
+ selectedId: o,
292
+ size: p ? 400 : 300,
293
+ totalLabel: s.total_amount,
294
+ variant: "full"
295
+ }),
296
+ /* @__PURE__ */ e(Ne, {
297
+ data: a,
298
+ onSelected: g,
299
+ selectedId: o,
300
+ title: i
301
+ })
302
+ ]
303
+ });
304
+ }, ne = A(Oe), $e = (a) => [
305
+ a.palette.chartMono.chartMono5,
306
+ a.palette.chartMono.chartMono4,
307
+ a.palette.chartMono.chartMono3,
308
+ a.palette.chartMono.chartMono2,
309
+ a.palette.chartMono.chartMono1,
310
+ a.palette.chartMono.chartMono6
311
+ ], ke = () => {
312
+ const a = we(), { is_mobile_webview: g } = H(), { clientConfig: n } = H(), { categories: o, dateRangeCategoryTotals: i } = W(), { goals: p, spending: t, transactions: r } = I(), { displayedDateRange: s, selectedAccountGuids: y } = P(), { setFilter: c, sortedTransactions: b, sortedTransactionsWithSplits: v, tags: m } = ie(), h = n?.master?.deep_link_params?.account_guids, M = n?.master?.deep_link_params?.view, [x, N] = d.useState(""), [D, S] = d.useState(M === "income" ? 1 : 0), [E, R] = d.useState(""), [O, j] = d.useState(!1), V = d.useMemo(() => le(o, p, a, i), [o, i]), J = d.useMemo(() => de(o, i, $e(a)), [o, i]), z = d.useMemo(() => b.find((l) => l.guid === E), [E, b]), ue = (l, _) => {
313
+ S(_), N("");
314
+ }, K = (l, _ = !1) => {
315
+ _ ? me(l) : N(x === l || l === "0" ? "" : l);
316
+ }, me = (l) => {
317
+ c({
318
+ accounts: h || y,
319
+ dateRange: s,
320
+ custom: (_) => x === "other" ? _.top_level_category_guid === l : _.category_guid === l,
350
321
  showSplits: !0
351
322
  }), j(!0);
352
- }, Y = (l) => {
353
- const S = {
354
- accounts: _ || b,
323
+ }, U = (l) => {
324
+ const _ = {
325
+ accounts: h || y,
355
326
  dateRange: s
356
327
  };
357
- if (v === 0)
358
- if (l === "other") {
359
- const m = F.categoryData.find((z) => z.guid === "other");
360
- u({
361
- ...S,
362
- custom: (z) => !!m?.categoryTotals?.find((ft) => ft.guid === z.top_level_category_guid)
363
- });
364
- } else
365
- u({
366
- ...S,
367
- custom: (m) => l ? m.top_level_category_guid === l : m.top_level_category_guid !== w.INCOME && m.category_guid !== w.INCOME && m.top_level_category_guid !== w.INVESTMENTS && m.top_level_category_guid !== w.TRANSFER,
368
- showSplits: !!l
369
- });
370
- else
371
- u({
372
- ...S,
373
- custom: (m) => l ? m.category_guid === l : m.category_guid === w.INCOME || m.top_level_category_guid === w.INCOME
328
+ if (D === 0) if (l === "other") {
329
+ const f = V.categoryData.find((F) => F.guid === "other");
330
+ c({
331
+ ..._,
332
+ custom: (F) => !!f?.categoryTotals?.find((fe) => fe.guid === F.top_level_category_guid)
374
333
  });
334
+ } else c({
335
+ ..._,
336
+ custom: (f) => l ? f.top_level_category_guid === l : f.top_level_category_guid !== w.INCOME && f.category_guid !== w.INCOME && f.top_level_category_guid !== w.INVESTMENTS && f.top_level_category_guid !== w.TRANSFER,
337
+ showSplits: !!l
338
+ });
339
+ else c({
340
+ ..._,
341
+ custom: (f) => l ? f.category_guid === l : f.category_guid === w.INCOME || f.top_level_category_guid === w.INCOME
342
+ });
375
343
  j(!0);
376
- }, ht = () => {
377
- Mt(M, f);
344
+ }, he = () => {
345
+ _e(v, m);
378
346
  };
379
- return /* @__PURE__ */ p(L, { children: [
380
- /* @__PURE__ */ p(rt, { onChange: ut, value: v, variant: "fullWidth", children: [
381
- /* @__PURE__ */ t(
382
- $,
383
- {
384
- label: /* @__PURE__ */ t(
385
- G,
386
- {
387
- amount: F.totalAmount,
388
- label: e.spend_tab_title
389
- }
390
- )
391
- }
392
- ),
393
- /* @__PURE__ */ t(
394
- $,
395
- {
396
- label: /* @__PURE__ */ t(
397
- G,
398
- {
399
- amount: K.totalAmount,
400
- label: e.income_tab_title
401
- }
402
- )
403
- }
404
- )
405
- ] }),
406
- v === 0 && /* @__PURE__ */ t(
407
- ot,
408
- {
409
- data: F,
410
- onSelected: U,
411
- onViewTransactions: Y,
412
- selectedId: x,
413
- title: e.spend_tab_title
414
- }
415
- ),
416
- v === 1 && /* @__PURE__ */ t(
417
- ot,
418
- {
419
- data: K,
420
- onSelected: U,
421
- onViewTransactions: Y,
422
- selectedId: x,
423
- title: e.income_tab_title
424
- }
425
- ),
426
- /* @__PURE__ */ t(
427
- tt,
428
- {
429
- ariaLabelClose: e.close_drawer_aria,
430
- isOpen: O,
431
- onClose: () => j(!1),
432
- title: e.transactions_drawer_title,
433
- children: /* @__PURE__ */ p(y, { children: [
434
- !d && h.length > 0 && /* @__PURE__ */ t(y, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
435
- St,
436
- {
437
- onClick: ht,
438
- startIcon: /* @__PURE__ */ t(bt, { name: "ios_share" }),
439
- variant: "text",
440
- children: r.export_csv_btn
441
- }
442
- ) }),
443
- /* @__PURE__ */ t(Dt, { onClick: W })
444
- ] })
445
- }
446
- ),
447
- /* @__PURE__ */ t(
448
- tt,
449
- {
450
- ariaLabelClose: e.close_drawer_aria,
451
- isOpen: !!V,
452
- onClose: () => W(""),
453
- title: e.transaction_details_drawer_title,
454
- children: V && /* @__PURE__ */ t(xt, { transaction: V })
455
- }
456
- )
347
+ return /* @__PURE__ */ u(L, { children: [
348
+ /* @__PURE__ */ u(pe, {
349
+ onChange: ue,
350
+ value: D,
351
+ variant: "fullWidth",
352
+ children: [/* @__PURE__ */ e(B, { label: /* @__PURE__ */ e(G, {
353
+ amount: V.totalAmount,
354
+ label: t.spend_tab_title
355
+ }) }), /* @__PURE__ */ e(B, { label: /* @__PURE__ */ e(G, {
356
+ amount: J.totalAmount,
357
+ label: t.income_tab_title
358
+ }) })]
359
+ }),
360
+ D === 0 && /* @__PURE__ */ e(ne, {
361
+ data: V,
362
+ onSelected: K,
363
+ onViewTransactions: U,
364
+ selectedId: x,
365
+ title: t.spend_tab_title
366
+ }),
367
+ D === 1 && /* @__PURE__ */ e(ne, {
368
+ data: J,
369
+ onSelected: K,
370
+ onViewTransactions: U,
371
+ selectedId: x,
372
+ title: t.income_tab_title
373
+ }),
374
+ /* @__PURE__ */ e(Y, {
375
+ ariaLabelClose: t.close_drawer_aria,
376
+ isOpen: O,
377
+ onClose: () => j(!1),
378
+ title: t.transactions_drawer_title,
379
+ children: /* @__PURE__ */ u(C, { children: [!g && b.length > 0 && /* @__PURE__ */ e(C, {
380
+ direction: "row",
381
+ justifyContent: "right",
382
+ mb: -24,
383
+ mr: 8,
384
+ mt: 8,
385
+ zIndex: 1,
386
+ children: /* @__PURE__ */ e(xe, {
387
+ onClick: he,
388
+ startIcon: /* @__PURE__ */ e(Me, { name: "ios_share" }),
389
+ variant: "text",
390
+ children: r.export_csv_btn
391
+ })
392
+ }), /* @__PURE__ */ e(ye, { onClick: R })] })
393
+ }),
394
+ /* @__PURE__ */ e(Y, {
395
+ ariaLabelClose: t.close_drawer_aria,
396
+ isOpen: !!z,
397
+ onClose: () => R(""),
398
+ title: t.transaction_details_drawer_title,
399
+ children: z && /* @__PURE__ */ e(Ce, { transaction: z })
400
+ })
457
401
  ] });
458
- }, Bt = I($t), Gt = ({ onBackClick: n, onMenuClick: d, sx: o = {} }) => {
459
- const { isAccountDataLoaded: a, loadAccountData: i } = ct(), { categoriesLoaded: g, dateRangeTotalsLoaded: e, loadCategories: r, loadDateRangeCategoryTotals: s } = R(), { isTransactionDataLoaded: b, loadTransactionData: u } = dt(), { spending: h } = A(), { displayedDateRange: M, isInitialized: f, setDisplayedDate: _, selectedAccounts: D } = P(), { onEvent: x } = yt(), { clientConfig: N } = H();
460
- gt({
402
+ }, Be = A(ke), Ge = ({ onBackClick: a, onMenuClick: g, sx: n = {} }) => {
403
+ const { isAccountDataLoaded: o, loadAccountData: i } = re(), { categoriesLoaded: p, dateRangeTotalsLoaded: t, loadCategories: r, loadDateRangeCategoryTotals: s } = W(), { isTransactionDataLoaded: y, loadTransactionData: c } = ie(), { spending: b } = I(), { displayedDateRange: v, isInitialized: m, setDisplayedDate: h, selectedAccounts: M } = P(), { onEvent: x } = Te(), { clientConfig: N } = H();
404
+ oe({
461
405
  widgetName: "SpendingWidget",
462
- isLoaded: e
463
- }), c.useEffect(() => {
464
- const C = N?.master?.deep_link_params, E = C?.date_range ? [et(C.date_range.from), et(C.date_range.to)] : [at(J()), it(J())], W = E[0], O = E[1];
465
- _(W, O), a || i().finally(), g || r().finally(), b || u().finally(), f && s(D, W, O).finally(), x(nt.SPENDING_VIEW);
466
- }, []), c.useEffect(() => {
467
- f && s(
468
- D,
469
- M.start,
470
- M.end
471
- ).finally();
472
- }, [M, f, D]);
473
- const v = (C) => {
474
- _(C[0], C[1]);
406
+ isLoaded: t
407
+ }), d.useEffect(() => {
408
+ const S = N?.master?.deep_link_params, E = S?.date_range ? [Z(S.date_range.from), Z(S.date_range.to)] : [ge(X()), ce(X())], R = E[0], O = E[1];
409
+ h(R, O), o || i().finally(), p || r().finally(), y || c().finally(), m && s(M, R, O).finally(), x(q.SPENDING_VIEW);
410
+ }, []), d.useEffect(() => {
411
+ m && s(M, v.start, v.end).finally();
412
+ }, [
413
+ v,
414
+ m,
415
+ M
416
+ ]);
417
+ const D = (S) => {
418
+ h(S[0], S[1]);
475
419
  };
476
- return f ? /* @__PURE__ */ t(
477
- It,
478
- {
479
- calendarActions: { onRangeChanged: v },
480
- onAccountsFilterClick: () => x(nt.SPENDING_CLICK_FILTER),
481
- onBackClick: n,
482
- onMenuClick: d,
483
- sx: o,
484
- title: h.title,
485
- children: /* @__PURE__ */ t(L, { width: "100%", children: /* @__PURE__ */ t(Bt, {}) })
486
- }
487
- ) : /* @__PURE__ */ t(pt, {});
488
- }, Se = I(Gt);
420
+ return m ? /* @__PURE__ */ e(be, {
421
+ calendarActions: { onRangeChanged: D },
422
+ onAccountsFilterClick: () => x(q.SPENDING_CLICK_FILTER),
423
+ onBackClick: a,
424
+ onMenuClick: g,
425
+ sx: n,
426
+ title: b.title,
427
+ children: /* @__PURE__ */ e(L, {
428
+ width: "100%",
429
+ children: /* @__PURE__ */ e(Be, {})
430
+ })
431
+ }) : /* @__PURE__ */ e(se, {});
432
+ }, mt = A(Ge);
489
433
  export {
490
- Ce as SpendingMiniWidget,
491
- Se as SpendingWidget
434
+ ut as SpendingMiniWidget,
435
+ mt as SpendingWidget
492
436
  };