@mx-cartographer/experiences 7.3.0 → 7.3.1

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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## [7.3.1] - 12-09-2025
2
+
3
+ - **UPDATED** `SpendingWidget` to have an export csv button on transactions list
4
+
1
5
  ## [7.3.0] - 12-09-2025
2
6
 
3
7
  - **UPDATED** - Improved `X-Charts` chunk loading for better performance.
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { observer as c } from "mobx-react-lite";
3
3
  import { Icon as i } from "@mxenabled/mxui";
4
- import { e as p } from "./exportTransactionsToCSV-B8qpk5MU.mjs";
4
+ import { e as p } from "./exportTransactionsToCSV-C4PkIYP6.mjs";
5
5
  import { O as m } from "./User-Bj34_i8g.mjs";
6
6
  import { R as x } from "./ResponsiveButton-DZFp78fJ.mjs";
7
7
  import { g as _, h as C, u as l } from "./hooks-Cy8JnjCg.mjs";
@@ -16,7 +16,7 @@ import { subDays as F } from "date-fns/subDays";
16
16
  import { O as n, a as G, T as w } from "./User-Bj34_i8g.mjs";
17
17
  import { T as p } from "./TransactionApi-CjBoLleL.mjs";
18
18
  import { b as W } from "./Category-CevNQ03n.mjs";
19
- import { f as z } from "./exportTransactionsToCSV-B8qpk5MU.mjs";
19
+ import { f as z } from "./exportTransactionsToCSV-C4PkIYP6.mjs";
20
20
  import { format as k } from "date-fns/format";
21
21
  import { f as g, D as O, O as $ } from "./Dialog-CWW597AF.mjs";
22
22
  import { endOfMonth as X } from "date-fns/endOfMonth";
@@ -37,7 +37,7 @@ import et from "@mui/material/Alert";
37
37
  import tt from "@mui/material/Snackbar";
38
38
  import Ce from "@mui/material/Tab";
39
39
  import nt from "@mui/material/Tabs";
40
- import { e as ot } from "../exportTransactionsToCSV-B8qpk5MU.mjs";
40
+ import { e as ot } from "../exportTransactionsToCSV-C4PkIYP6.mjs";
41
41
  import { T as De, a as at } from "../TransactionDetails-BUoNbsu-.mjs";
42
42
  import fe from "@mui/material/Card";
43
43
  import be from "@mui/material/CardContent";
@@ -18,8 +18,8 @@ import { C as Qs } from "../CurrencyInput-lSC7oPDg.mjs";
18
18
  import { L as Xs } from "../Loader-DUaFpDGv.mjs";
19
19
  import { R as Ks } from "../ResponsiveButton-DZFp78fJ.mjs";
20
20
  import { S as Zs } from "../SearchBox-B2_zLv8-.mjs";
21
- import { T as at } from "../TransactionStore-C1oyQCZK.mjs";
22
- import { S as tr } from "../TransactionStore-C1oyQCZK.mjs";
21
+ import { T as at } from "../TransactionStore-CtGTg0XS.mjs";
22
+ import { S as tr } from "../TransactionStore-CtGTg0XS.mjs";
23
23
  import { T as sr } from "../TabContentContainer-j01JYR_7.mjs";
24
24
  import { I as or } from "../IconBacking-B9oC6uL2.mjs";
25
25
  import { D as nr, F as ir, a as cr, c as dr, R as lr, S as ur } from "../RecurringTransactions-ej39mgA6.mjs";
@@ -0,0 +1,48 @@
1
+ import { fromUnixTime as d } from "date-fns/fromUnixTime";
2
+ import { c as u } from "./Category-CevNQ03n.mjs";
3
+ import { f as p, D as g } from "./Dialog-CWW597AF.mjs";
4
+ import { T as m } from "./User-Bj34_i8g.mjs";
5
+ function f(t) {
6
+ return new Set(
7
+ t.filter((n) => n.parent_guid !== void 0).map((n) => n.parent_guid)
8
+ );
9
+ }
10
+ function T(t) {
11
+ return t.reduce((n, e) => (e.parent_guid && (n[e.parent_guid] || (n[e.parent_guid] = []), n[e.parent_guid].push(e)), n), {});
12
+ }
13
+ function j(t, n) {
14
+ const e = f(n), o = T(n), r = /* @__PURE__ */ new Set(), a = [];
15
+ for (const i of t)
16
+ e.has(i.guid) ? (o[i.guid] ?? []).slice().sort((s, c) => Math.abs(c.amount) - Math.abs(s.amount)).forEach((s) => {
17
+ r.has(s.guid) || (a.push(s), r.add(s.guid));
18
+ }) : r.has(i.guid) || (a.push(i), r.add(i.guid));
19
+ return a;
20
+ }
21
+ const A = (t, n) => {
22
+ const e = _(l(t, n)), o = new Blob([e], { type: "text/csv;charset=utf-8;" }), r = document.createElement("a");
23
+ r.href = URL.createObjectURL(o), r.setAttribute("download", "transactions.csv"), document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(r.href);
24
+ }, l = (t, n) => t.map((e) => ({
25
+ Date: p(d(e.date), g.YEAR_MONTH_DAY),
26
+ Description: y(e),
27
+ "Original Description": e.feed_description,
28
+ Amount: `${e.amount}`,
29
+ Type: e.transaction_type === m.CREDIT ? "Credit" : "Debit",
30
+ "Parent Category": u[e.top_level_category_guid || ""],
31
+ Category: e.category,
32
+ Account: e.account,
33
+ Tags: C(e, n),
34
+ Memo: e.memo,
35
+ Pending: e.isPending ? "TRUE" : "FALSE"
36
+ })), h = (t) => t ? /[,"\n\r]/.test(t) ? `"${t.replace(/"/g, '""')}"` : t : "", _ = (t) => {
37
+ const n = Object.keys(t[0]).join(",").concat(`\r
38
+ `), e = t.map((o) => Object.values(o).map(h).join(",")).join(`\r
39
+ `);
40
+ return n + e;
41
+ }, y = (t) => {
42
+ let n = t.parent_guid ? "Split: " : "";
43
+ return n += t.is_hidden ? "(Excluded) " : "", n += t.description, n;
44
+ }, C = (t, n) => t.tags.map((e) => n.filter((r) => r.guid === e)[0]?.name ?? "").join(" ");
45
+ export {
46
+ A as e,
47
+ j as f
48
+ };
@@ -1,80 +1,81 @@
1
- import { jsxs as h, jsx as t, Fragment as ht } from "react/jsx-runtime";
1
+ import { jsxs as h, jsx as t, Fragment as St } from "react/jsx-runtime";
2
2
  import p from "react";
3
- import { observer as I } from "mobx-react-lite";
4
- import { startOfMonth as ot } from "date-fns/startOfMonth";
5
- import { endOfMonth as at } from "date-fns/endOfMonth";
6
- import w from "@mui/material/Box";
7
- import C from "@mui/material/Stack";
8
- import L from "@mui/material/Tab";
9
- import it from "@mui/material/Tabs";
10
- import ft from "@mui/material/styles/useTheme";
11
- import { b as V } from "../CategoryUtil-BR3H5i6n.mjs";
3
+ import { observer as v } from "mobx-react-lite";
4
+ import { startOfMonth as st } from "date-fns/startOfMonth";
5
+ import { endOfMonth as ct } from "date-fns/endOfMonth";
6
+ import D from "@mui/material/Box";
7
+ import f from "@mui/material/Stack";
8
+ import N from "@mui/material/Tab";
9
+ import lt from "@mui/material/Tabs";
10
+ import Tt from "@mui/material/styles/useTheme";
11
+ import { b as F } from "../CategoryUtil-BR3H5i6n.mjs";
12
12
  import { b as _ } from "../Category-CevNQ03n.mjs";
13
- import { Text as y, CategoryIcon as yt, CategoryIconVariants as bt } from "@mxenabled/mxui";
14
- import { f as v } from "../NumberFormatting-Buh7u8Oi.mjs";
15
- import { c as Ct, T as _t, a as St } from "../TransactionDetails-BUoNbsu-.mjs";
16
- import Tt from "@mui/material/Button";
17
- import { useTheme as rt } from "@mui/material";
18
- import { u as E, b as O, m as z, d as st, n as Mt, a as lt, h as Dt, g as xt } from "../hooks-Cy8JnjCg.mjs";
19
- import { u as ct } from "../useScreenSize-B6JyS_Lj.mjs";
20
- import { D as wt } from "../Donut-oaQFlbit.mjs";
21
- import { L as F } from "../Loader-DUaFpDGv.mjs";
22
- import { M as vt } from "../MiniWidgetContainer-BdgBvpga.mjs";
23
- import { startOfToday as q } from "date-fns/startOfToday";
24
- import It from "@mui/material/Collapse";
25
- import B from "@mui/material/Divider";
26
- import J from "@mui/material/List";
27
- import Q from "@mui/material/ListItem";
28
- import Et from "@mui/material/ListItemButton";
29
- import { D as Z } from "../Drawer-kEE73B87.mjs";
30
- import { A as tt, W as At } from "../WidgetContainer-BnTgAfQn.mjs";
31
- const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
32
- if (n.total > 0) {
33
- const a = o.find((s) => s.guid === n.category_guid);
13
+ import { Text as C, CategoryIcon as Mt, CategoryIconVariants as xt, Icon as Dt } from "@mxenabled/mxui";
14
+ import { f as w } from "../NumberFormatting-Buh7u8Oi.mjs";
15
+ import { c as wt, T as vt, a as It } from "../TransactionDetails-BUoNbsu-.mjs";
16
+ import dt from "@mui/material/Button";
17
+ import { useTheme as gt } from "@mui/material";
18
+ import { u as I, b as k, m as P, d as ut, n as Et, a as H, h as At, g as Lt } from "../hooks-Cy8JnjCg.mjs";
19
+ import { u as pt } from "../useScreenSize-B6JyS_Lj.mjs";
20
+ import { D as Nt } from "../Donut-oaQFlbit.mjs";
21
+ import { L as K } from "../Loader-DUaFpDGv.mjs";
22
+ import { M as Wt } from "../MiniWidgetContainer-BdgBvpga.mjs";
23
+ import { startOfToday as tt } from "date-fns/startOfToday";
24
+ import { e as Ot } from "../exportTransactionsToCSV-C4PkIYP6.mjs";
25
+ import kt from "@mui/material/Collapse";
26
+ import V from "@mui/material/Divider";
27
+ import et from "@mui/material/List";
28
+ import nt from "@mui/material/ListItem";
29
+ import Rt from "@mui/material/ListItemButton";
30
+ import { D as ot } from "../Drawer-kEE73B87.mjs";
31
+ import { A as at, W as $t } from "../WidgetContainer-BnTgAfQn.mjs";
32
+ const z = 5, Gt = (n, d, s) => s.reduce((l, e) => {
33
+ if (e.total > 0) {
34
+ const a = n.find((r) => r.guid === e.category_guid);
34
35
  if (!a) return l;
35
- const i = a.parent_guid ?? a.guid, e = o.find((s) => s.guid === i);
36
- if (!e) return l;
36
+ const i = a.parent_guid ?? a.guid, o = n.find((r) => r.guid === i);
37
+ if (!o) return l;
37
38
  const c = {
38
39
  guid: a.guid,
39
40
  name: a.guid === i ? `General ${a.name}` : a.name,
40
- color: V(e.guid, d),
41
- amount: n.total
42
- }, u = l.find((s) => s.guid === i);
43
- u ? (u.amount += n.total, u.categoryTotals?.push(c)) : l.push({
41
+ color: F(o.guid, d),
42
+ amount: e.total
43
+ }, u = l.find((r) => r.guid === i);
44
+ u ? (u.amount += e.total, u.categoryTotals?.push(c)) : l.push({
44
45
  guid: i,
45
- name: e.name,
46
- color: V(e.guid, d),
46
+ name: o.name,
47
+ color: F(o.guid, d),
47
48
  categoryTotals: [c],
48
- amount: n.total
49
+ amount: e.total
49
50
  });
50
51
  }
51
52
  return l;
52
- }, []), dt = (o, d, r, l) => {
53
- const n = Lt(o, r, l), a = n.filter(
54
- (s) => s.guid !== _.INCOME && s.guid !== _.INVESTMENTS && s.guid !== _.TRANSFER
55
- ).sort((s, m) => m.amount - s.amount), i = a.reduce(
56
- (s, m) => s + m.amount,
53
+ }, []), mt = (n, d, s, l) => {
54
+ const e = Gt(n, s, l), a = e.filter(
55
+ (r) => r.guid !== _.INCOME && r.guid !== _.INVESTMENTS && r.guid !== _.TRANSFER
56
+ ).sort((r, m) => m.amount - r.amount), i = a.reduce(
57
+ (r, m) => r + m.amount,
57
58
  0
58
- ), e = a.length > j ? j : a.length, c = a.slice(0, e), u = c.map((s) => ({
59
- id: s.guid,
60
- color: V(s.guid, r),
61
- label: s.name,
62
- value: s.amount / i * 100
59
+ ), o = a.length > z ? z : a.length, c = a.slice(0, o), u = c.map((r) => ({
60
+ id: r.guid,
61
+ color: F(r.guid, s),
62
+ label: r.name,
63
+ value: r.amount / i * 100
63
64
  }));
64
65
  if (a.length > 5) {
65
- const s = a.slice(j, n.length), m = s.reduce(
66
- (S, g) => S + g.amount,
66
+ const r = a.slice(z, e.length), m = r.reduce(
67
+ (M, g) => M + g.amount,
67
68
  0
68
69
  );
69
70
  c.push({
70
71
  guid: "other",
71
- color: r.palette.categories.others || "",
72
+ color: s.palette.categories.others || "",
72
73
  name: d.saving_goal_other,
73
- categoryTotals: s,
74
+ categoryTotals: r,
74
75
  amount: m
75
76
  }), u.push({
76
77
  id: "other",
77
- color: r.palette.categories.others || "",
78
+ color: s.palette.categories.others || "",
78
79
  label: d.saving_goal_other,
79
80
  value: m / i * 100
80
81
  });
@@ -84,96 +85,96 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
84
85
  donutData: u,
85
86
  totalAmount: i
86
87
  };
87
- }, gt = (o, d, r) => {
88
- const l = o.filter(
89
- (e) => e.guid === _.INCOME || e.parent_guid === _.INCOME
90
- ), n = d.filter((e) => l.some((c) => c.guid === e.category_guid)).sort((e, c) => e.total - c.total).map((e, c) => ({
91
- guid: e.category_guid,
92
- name: o.find((u) => u.guid === e.category_guid)?.name,
93
- color: r[c],
88
+ }, ht = (n, d, s) => {
89
+ const l = n.filter(
90
+ (o) => o.guid === _.INCOME || o.parent_guid === _.INCOME
91
+ ), e = d.filter((o) => l.some((c) => c.guid === o.category_guid)).sort((o, c) => o.total - c.total).map((o, c) => ({
92
+ guid: o.category_guid,
93
+ name: n.find((u) => u.guid === o.category_guid)?.name,
94
+ color: s[c],
94
95
  categoryTotals: [],
95
- amount: Math.abs(e.total)
96
- })), a = n.reduce(
97
- (e, c) => e + c.amount,
96
+ amount: Math.abs(o.total)
97
+ })), a = e.reduce(
98
+ (o, c) => o + c.amount,
98
99
  0
99
- ), i = n.map((e) => ({
100
- id: e.guid,
101
- color: e.color,
102
- label: e.name,
103
- value: e.amount / a * 100
100
+ ), i = e.map((o) => ({
101
+ id: o.guid,
102
+ color: o.color,
103
+ label: o.name,
104
+ value: o.amount / a * 100
104
105
  }));
105
106
  return {
106
- categoryData: n,
107
+ categoryData: e,
107
108
  donutData: i,
108
109
  totalAmount: a
109
110
  };
110
- }, N = ({ amount: o, label: d }) => /* @__PURE__ */ h(C, { direction: "column", children: [
111
- /* @__PURE__ */ t(y, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
112
- /* @__PURE__ */ t(y, { variant: "XSmall", children: v(o, "0,0") })
113
- ] }), Nt = ({
114
- data: o,
111
+ }, W = ({ amount: n, label: d }) => /* @__PURE__ */ h(f, { direction: "column", children: [
112
+ /* @__PURE__ */ t(C, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
113
+ /* @__PURE__ */ t(C, { variant: "XSmall", children: w(n, "0,0") })
114
+ ] }), jt = ({
115
+ data: n,
115
116
  isIncome: d = !1,
116
- onSelected: r,
117
+ onSelected: s,
117
118
  onViewTransactions: l,
118
- selectedId: n,
119
+ selectedId: e,
119
120
  size: a = 150,
120
121
  totalLabel: i,
121
- variant: e = "mini"
122
+ variant: o = "mini"
122
123
  }) => {
123
- const { spending: c } = E(), u = rt(), { isTablet: s } = ct(), { announce: m, ariaLive: S } = Ct(), g = p.useMemo(
124
- () => n ? o.categoryData.find((b) => b.guid === n) : void 0,
125
- [n]
124
+ const { spending: c } = I(), u = gt(), { isTablet: r } = pt(), { announce: m, ariaLive: M } = wt(), g = p.useMemo(
125
+ () => e ? n.categoryData.find((S) => S.guid === e) : void 0,
126
+ [e]
126
127
  );
127
128
  p.useEffect(() => {
128
129
  if (g) {
129
- const b = v(g.amount, "0,0");
130
- m(`${g.name}: ${b}`);
130
+ const S = w(g.amount, "0,0");
131
+ m(`${g.name}: ${S}`);
131
132
  }
132
133
  }, [g, m]);
133
- const T = p.useMemo(() => o.donutData.length > 0 ? o.donutData : [{ id: "0", color: u.palette.divider, value: 100 }], [o, u]), x = () => {
134
- l?.(n);
135
- }, D = s ? 32 : 48;
136
- return /* @__PURE__ */ h(ht, { children: [
137
- S,
138
- /* @__PURE__ */ t(wt, { data: T, onClick: r, selectedId: n, size: a, children: /* @__PURE__ */ t(C, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ h(C, { alignItems: "center", justifyContent: "center", minHeight: a, minWidth: a, children: [
134
+ const b = p.useMemo(() => n.donutData.length > 0 ? n.donutData : [{ id: "0", color: u.palette.divider, value: 100 }], [n, u]), E = () => {
135
+ l?.(e);
136
+ }, x = r ? 32 : 48;
137
+ return /* @__PURE__ */ h(St, { children: [
138
+ M,
139
+ /* @__PURE__ */ t(Nt, { data: b, onClick: s, selectedId: e, size: a, children: /* @__PURE__ */ t(f, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ h(f, { alignItems: "center", justifyContent: "center", minHeight: a, minWidth: a, children: [
139
140
  g && /* @__PURE__ */ h(
140
- C,
141
+ f,
141
142
  {
142
143
  alignItems: "center",
143
- gap: e === "mini" ? 0 : 8,
144
- mb: e === "mini" ? 0 : 8,
145
- mt: e === "mini" ? 0 : -16,
146
- sx: e === "mini" ? { gap: 0, mb: 0 } : { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } },
144
+ gap: o === "mini" ? 0 : 8,
145
+ mb: o === "mini" ? 0 : 8,
146
+ mt: o === "mini" ? 0 : -16,
147
+ sx: o === "mini" ? { gap: 0, mb: 0 } : { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } },
147
148
  children: [
148
149
  /* @__PURE__ */ t(
149
- yt,
150
+ Mt,
150
151
  {
151
152
  categoryGuid: d ? _.INCOME : g.guid,
152
- size: e === "mini" ? 24 : D,
153
- variant: bt.Transparent
153
+ size: o === "mini" ? 24 : x,
154
+ variant: xt.Transparent
154
155
  }
155
156
  ),
156
157
  /* @__PURE__ */ t(
157
- y,
158
+ C,
158
159
  {
159
160
  color: "secondary",
160
161
  noWrap: !0,
161
- variant: e === "mini" ? "Tiny" : "Body",
162
+ variant: o === "mini" ? "Tiny" : "Body",
162
163
  children: g ? g.name : i
163
164
  }
164
165
  )
165
166
  ]
166
167
  }
167
168
  ),
168
- !g && e === "full" && /* @__PURE__ */ t(y, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: i }),
169
- /* @__PURE__ */ t(y, { variant: e === "mini" ? "H2" : "H1", children: g ? v(g.amount, "0,0") : v(o.totalAmount, "0,0") }),
170
- !g && e === "mini" && /* @__PURE__ */ t(y, { color: "secondary", noWrap: !0, variant: "Tiny", children: i }),
171
- e === "full" && /* @__PURE__ */ t(
172
- Tt,
169
+ !g && o === "full" && /* @__PURE__ */ t(C, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: i }),
170
+ /* @__PURE__ */ t(C, { variant: o === "mini" ? "H2" : "H1", children: g ? w(g.amount, "0,0") : w(n.totalAmount, "0,0") }),
171
+ !g && o === "mini" && /* @__PURE__ */ t(C, { color: "secondary", noWrap: !0, variant: "Tiny", children: i }),
172
+ o === "full" && /* @__PURE__ */ t(
173
+ dt,
173
174
  {
174
175
  "aria-label": `View ${g?.name || ""} Transactions`,
175
- disabled: o.categoryData.length === 0,
176
- onClick: x,
176
+ disabled: n.categoryData.length === 0,
177
+ onClick: E,
177
178
  sx: { mt: { xl: 4, xs: 0 }, zIndex: 1 },
178
179
  variant: "text",
179
180
  children: c.view_transactions
@@ -181,99 +182,99 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
181
182
  )
182
183
  ] }) }) })
183
184
  ] });
184
- }, W = I(Nt), et = ({ data: o, onSelected: d, selectedId: r }) => {
185
- const l = (n, a) => {
186
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), d(a));
185
+ }, O = v(jt), it = ({ data: n, onSelected: d, selectedId: s }) => {
186
+ const l = (e, a) => {
187
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), d(a));
187
188
  };
188
- return /* @__PURE__ */ t(C, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: o.categoryData.map((n) => /* @__PURE__ */ h(
189
- C,
189
+ return /* @__PURE__ */ t(f, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: n.categoryData.map((e) => /* @__PURE__ */ h(
190
+ f,
190
191
  {
191
192
  alignItems: "center",
192
- "aria-label": n.name,
193
- "aria-pressed": n.guid === r,
193
+ "aria-label": e.name,
194
+ "aria-pressed": e.guid === s,
194
195
  direction: "row",
195
196
  gap: 8,
196
- onClick: () => d(n.guid),
197
- onKeyDown: (a) => l(a, n.guid),
197
+ onClick: () => d(e.guid),
198
+ onKeyDown: (a) => l(a, e.guid),
198
199
  role: "button",
199
200
  sx: { cursor: "pointer" },
200
201
  tabIndex: 0,
201
202
  children: [
202
- /* @__PURE__ */ t(w, { borderRadius: 4, height: 8, sx: { backgroundColor: n.color }, width: 8 }),
203
- /* @__PURE__ */ t(y, { bold: n.guid === r, variant: "XSmall", children: n.name })
203
+ /* @__PURE__ */ t(D, { borderRadius: 4, height: 8, sx: { backgroundColor: e.color }, width: 8 }),
204
+ /* @__PURE__ */ t(C, { bold: e.guid === s, variant: "XSmall", children: e.name })
204
205
  ]
205
206
  },
206
- n.guid
207
+ e.guid
207
208
  )) });
208
- }, Wt = () => {
209
- const o = ft(), { goals: d, spending: r } = E(), { selectedAccounts: l } = O(), {
210
- categories: n,
209
+ }, Bt = () => {
210
+ const n = Tt(), { goals: d, spending: s } = I(), { selectedAccounts: l } = k(), {
211
+ categories: e,
211
212
  dateRangeCategoryTotals: a,
212
213
  dataRangeTotalsLoaded: i,
213
- loadDateRangeCategoryTotals: e
214
- } = z(), c = p.useMemo(
214
+ loadDateRangeCategoryTotals: o
215
+ } = P(), c = p.useMemo(
215
216
  () => [
216
- o.palette.chartMono.chartMono5,
217
- o.palette.chartMono.chartMono4,
218
- o.palette.chartMono.chartMono3,
219
- o.palette.chartMono.chartMono2,
220
- o.palette.chartMono.chartMono1,
221
- o.palette.chartMono.chartMono6
217
+ n.palette.chartMono.chartMono5,
218
+ n.palette.chartMono.chartMono4,
219
+ n.palette.chartMono.chartMono3,
220
+ n.palette.chartMono.chartMono2,
221
+ n.palette.chartMono.chartMono1,
222
+ n.palette.chartMono.chartMono6
222
223
  ],
223
- [o]
224
+ [n]
224
225
  );
225
226
  p.useEffect(() => {
226
- e(
227
+ o(
227
228
  l,
228
- ot(/* @__PURE__ */ new Date()),
229
- at(/* @__PURE__ */ new Date())
229
+ st(/* @__PURE__ */ new Date()),
230
+ ct(/* @__PURE__ */ new Date())
230
231
  ).finally();
231
232
  }, [l]);
232
- const [u, s] = p.useState(""), [m, S] = p.useState(0), g = p.useMemo(
233
- () => dt(n, d, o, a),
234
- [n, a]
235
- ), T = p.useMemo(
236
- () => gt(n, a, c),
237
- [n, a, c]
238
- ), x = (b, R) => {
239
- S(R), s("");
240
- }, D = (b) => {
241
- s(u === b ? "" : b);
233
+ const [u, r] = p.useState(""), [m, M] = p.useState(0), g = p.useMemo(
234
+ () => mt(e, d, n, a),
235
+ [e, a]
236
+ ), b = p.useMemo(
237
+ () => ht(e, a, c),
238
+ [e, a, c]
239
+ ), E = (S, R) => {
240
+ M(R), r("");
241
+ }, x = (S) => {
242
+ r(u === S ? "" : S);
242
243
  };
243
- return i ? /* @__PURE__ */ h(w, { width: "100%", children: [
244
+ return i ? /* @__PURE__ */ h(D, { width: "100%", children: [
244
245
  /* @__PURE__ */ h(
245
- it,
246
+ lt,
246
247
  {
247
- "aria-label": r.mini_title,
248
- onChange: x,
248
+ "aria-label": s.mini_title,
249
+ onChange: E,
249
250
  value: m,
250
251
  variant: "fullWidth",
251
252
  children: [
252
253
  /* @__PURE__ */ t(
253
- L,
254
+ N,
254
255
  {
255
256
  "aria-controls": "spending-tabpanel",
256
257
  id: "spending-tab",
257
258
  label: /* @__PURE__ */ t(
258
- N,
259
+ W,
259
260
  {
260
261
  amount: g.totalAmount,
261
- label: r.spend_tab_title
262
+ label: s.spend_tab_title
262
263
  }
263
264
  ),
264
265
  tabIndex: m === 0 ? 0 : -1
265
266
  }
266
267
  ),
267
268
  /* @__PURE__ */ t(
268
- L,
269
+ N,
269
270
  {
270
271
  "aria-controls": "income-tabpanel",
271
272
  id: "income-tab",
272
273
  label: /* @__PURE__ */ t(
273
- N,
274
+ W,
274
275
  {
275
- amount: T.totalAmount,
276
- label: r.income_tab_title
276
+ amount: b.totalAmount,
277
+ label: s.income_tab_title
277
278
  }
278
279
  ),
279
280
  tabIndex: m === 1 ? 0 : -1
@@ -283,77 +284,77 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
283
284
  }
284
285
  ),
285
286
  /* @__PURE__ */ t(
286
- w,
287
+ D,
287
288
  {
288
289
  "aria-labelledby": "spending-tab",
289
290
  hidden: m !== 0,
290
291
  id: "spending-tabpanel",
291
292
  role: "tabpanel",
292
- children: /* @__PURE__ */ h(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
293
+ children: /* @__PURE__ */ h(f, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
293
294
  /* @__PURE__ */ t(
294
- W,
295
+ O,
295
296
  {
296
297
  data: g,
297
- onSelected: D,
298
+ onSelected: x,
298
299
  selectedId: u,
299
- totalLabel: r.total_spending
300
+ totalLabel: s.total_spending
300
301
  }
301
302
  ),
302
- /* @__PURE__ */ t(et, { data: g, onSelected: D, selectedId: u })
303
+ /* @__PURE__ */ t(it, { data: g, onSelected: x, selectedId: u })
303
304
  ] })
304
305
  }
305
306
  ),
306
307
  /* @__PURE__ */ t(
307
- w,
308
+ D,
308
309
  {
309
310
  "aria-labelledby": "income-tab",
310
311
  hidden: m !== 1,
311
312
  id: "income-tabpanel",
312
313
  role: "tabpanel",
313
- children: /* @__PURE__ */ h(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
314
+ children: /* @__PURE__ */ h(f, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
314
315
  /* @__PURE__ */ t(
315
- W,
316
+ O,
316
317
  {
317
- data: T,
318
+ data: b,
318
319
  isIncome: !0,
319
- onSelected: D,
320
+ onSelected: x,
320
321
  selectedId: u,
321
- totalLabel: r.total_income
322
+ totalLabel: s.total_income
322
323
  }
323
324
  ),
324
- /* @__PURE__ */ t(et, { data: T, onSelected: D, selectedId: u })
325
+ /* @__PURE__ */ t(it, { data: b, onSelected: x, selectedId: u })
325
326
  ] })
326
327
  }
327
328
  )
328
- ] }) : /* @__PURE__ */ t(F, { height: 250 });
329
- }, Ot = I(Wt), Rt = ({ onPrimaryCtaClick: o, sx: d = {} }) => {
330
- const { visibleAccounts: r } = st(), { spending: l } = E(), { isCopyLoaded: n, isInitialized: a, setSelectedAccounts: i } = O();
329
+ ] }) : /* @__PURE__ */ t(K, { height: 250 });
330
+ }, Vt = v(Bt), zt = ({ onPrimaryCtaClick: n, sx: d = {} }) => {
331
+ const { visibleAccounts: s } = ut(), { spending: l } = I(), { isCopyLoaded: e, isInitialized: a, setSelectedAccounts: i } = k();
331
332
  return p.useEffect(() => {
332
- i(r);
333
- }, [r]), !n || !a ? /* @__PURE__ */ t(F, {}) : /* @__PURE__ */ t(
334
- vt,
333
+ i(s);
334
+ }, [s]), !e || !a ? /* @__PURE__ */ t(K, {}) : /* @__PURE__ */ t(
335
+ Wt,
335
336
  {
336
337
  className: "mx-exp-spending-miniwidget",
337
- onPrimaryCtaClick: o,
338
+ onPrimaryCtaClick: n,
338
339
  primaryCtaLabel: l.primary_cta,
339
340
  sx: d,
340
341
  title: l.mini_title,
341
- children: /* @__PURE__ */ t(Ot, {})
342
+ children: /* @__PURE__ */ t(Vt, {})
342
343
  }
343
344
  );
344
- }, Ce = I(Rt), kt = ({
345
- data: o,
345
+ }, ve = v(zt), Ft = ({
346
+ data: n,
346
347
  onSelected: d,
347
- selectedId: r = "",
348
+ selectedId: s = "",
348
349
  title: l
349
350
  }) => {
350
- const { spending: n } = E(), a = o.categoryData.find((i) => i.guid === r);
351
- return /* @__PURE__ */ h(C, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
352
- /* @__PURE__ */ t(y, { bold: !0, sx: { py: 12 }, children: `${l} ${n.by_category}` }),
353
- /* @__PURE__ */ t(B, { "aria-hidden": "true" }),
354
- /* @__PURE__ */ t(J, { children: o.categoryData.map((i) => /* @__PURE__ */ h(p.Fragment, { children: [
351
+ const { spending: e } = I(), a = n.categoryData.find((i) => i.guid === s);
352
+ return /* @__PURE__ */ h(f, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
353
+ /* @__PURE__ */ t(C, { bold: !0, sx: { py: 12 }, children: `${l} ${e.by_category}` }),
354
+ /* @__PURE__ */ t(V, { "aria-hidden": "true" }),
355
+ /* @__PURE__ */ t(et, { children: n.categoryData.map((i) => /* @__PURE__ */ h(p.Fragment, { children: [
355
356
  /* @__PURE__ */ t(
356
- Q,
357
+ nt,
357
358
  {
358
359
  disableGutters: !0,
359
360
  disablePadding: !0,
@@ -361,14 +362,14 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
361
362
  minHeight: 44
362
363
  },
363
364
  children: /* @__PURE__ */ h(
364
- Et,
365
+ Rt,
365
366
  {
366
367
  "aria-expanded": a?.guid === i.guid,
367
368
  onClick: () => d(i.guid),
368
369
  sx: { minHeight: 44, px: 8, py: 0 },
369
370
  children: [
370
371
  /* @__PURE__ */ t(
371
- w,
372
+ D,
372
373
  {
373
374
  borderRadius: 4,
374
375
  flexShrink: 0,
@@ -378,15 +379,15 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
378
379
  }
379
380
  ),
380
381
  /* @__PURE__ */ h(
381
- C,
382
+ f,
382
383
  {
383
384
  alignItems: "center",
384
385
  direction: "row",
385
386
  justifyContent: "space-between",
386
387
  width: "100%",
387
388
  children: [
388
- /* @__PURE__ */ t(y, { bold: r === i.guid, children: i.name }),
389
- /* @__PURE__ */ t(y, { bold: r === i.guid, variant: "Body", children: v(i.amount, "0,0") })
389
+ /* @__PURE__ */ t(C, { bold: s === i.guid, children: i.name }),
390
+ /* @__PURE__ */ t(C, { bold: s === i.guid, variant: "Body", children: w(i.amount, "0,0") })
390
391
  ]
391
392
  }
392
393
  )
@@ -395,41 +396,41 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
395
396
  )
396
397
  }
397
398
  ),
398
- /* @__PURE__ */ t(B, {}),
399
- i.categoryTotals && i.categoryTotals.length > 0 && /* @__PURE__ */ t(It, { in: a?.guid === i.guid, unmountOnExit: !0, children: /* @__PURE__ */ h(J, { children: [
400
- a?.categoryTotals?.map((e) => /* @__PURE__ */ t(
401
- Q,
399
+ /* @__PURE__ */ t(V, {}),
400
+ i.categoryTotals && i.categoryTotals.length > 0 && /* @__PURE__ */ t(kt, { in: a?.guid === i.guid, unmountOnExit: !0, children: /* @__PURE__ */ h(et, { children: [
401
+ a?.categoryTotals?.map((o) => /* @__PURE__ */ t(
402
+ nt,
402
403
  {
403
404
  sx: {
404
405
  pl: 24,
405
406
  pr: 8,
406
407
  py: 0
407
408
  },
408
- children: /* @__PURE__ */ h(C, { direction: "row", justifyContent: "space-between", width: "100%", children: [
409
- /* @__PURE__ */ h(y, { children: [
410
- e.name,
409
+ children: /* @__PURE__ */ h(f, { direction: "row", justifyContent: "space-between", width: "100%", children: [
410
+ /* @__PURE__ */ h(C, { children: [
411
+ o.name,
411
412
  " "
412
413
  ] }),
413
- /* @__PURE__ */ t(y, { children: v(e.amount, "0,0") })
414
+ /* @__PURE__ */ t(C, { children: w(o.amount, "0,0") })
414
415
  ] })
415
416
  },
416
- e.guid
417
+ o.guid
417
418
  )),
418
- /* @__PURE__ */ t(B, {})
419
+ /* @__PURE__ */ t(V, {})
419
420
  ] }) })
420
421
  ] }, i.guid)) }),
421
- /* @__PURE__ */ t(y, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${n.total}: ${v(o.totalAmount, "0,0")}` })
422
+ /* @__PURE__ */ t(C, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${e.total}: ${w(n.totalAmount, "0,0")}` })
422
423
  ] });
423
- }, $t = I(kt), Gt = ({
424
- data: o,
424
+ }, Ht = v(Ft), Pt = ({
425
+ data: n,
425
426
  onSelected: d,
426
- onViewTransactions: r,
427
+ onViewTransactions: s,
427
428
  selectedId: l,
428
- title: n
429
+ title: e
429
430
  }) => {
430
- const { isDesktop: a, isMobile: i } = ct(), { isLoadingCategoryTotals: e } = z(), { spending: c } = E();
431
+ const { isDesktop: a, isMobile: i } = pt(), { isLoadingCategoryTotals: o } = P(), { spending: c } = I();
431
432
  return /* @__PURE__ */ h(
432
- C,
433
+ f,
433
434
  {
434
435
  alignItems: i ? "center" : "flex-start",
435
436
  direction: i ? "column" : "row",
@@ -438,8 +439,8 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
438
439
  pt: 50,
439
440
  px: 8,
440
441
  children: [
441
- e && /* @__PURE__ */ t(
442
- W,
442
+ o && /* @__PURE__ */ t(
443
+ O,
443
444
  {
444
445
  data: {
445
446
  categoryData: [],
@@ -454,170 +455,192 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
454
455
  variant: "full"
455
456
  }
456
457
  ),
457
- !e && /* @__PURE__ */ t(
458
- W,
458
+ !o && /* @__PURE__ */ t(
459
+ O,
459
460
  {
460
- data: o,
461
+ data: n,
461
462
  onSelected: d,
462
- onViewTransactions: r,
463
+ onViewTransactions: s,
463
464
  selectedId: l,
464
465
  size: a ? 400 : 300,
465
466
  totalLabel: c.total_amount,
466
467
  variant: "full"
467
468
  }
468
469
  ),
469
- /* @__PURE__ */ t($t, { data: o, onSelected: d, selectedId: l, title: n })
470
+ /* @__PURE__ */ t(Ht, { data: n, onSelected: d, selectedId: l, title: e })
470
471
  ]
471
472
  }
472
473
  );
473
- }, nt = I(Gt), Bt = (o) => [
474
- o.palette.chartMono.chartMono5,
475
- o.palette.chartMono.chartMono4,
476
- o.palette.chartMono.chartMono3,
477
- o.palette.chartMono.chartMono2,
478
- o.palette.chartMono.chartMono1,
479
- o.palette.chartMono.chartMono6
480
- ], jt = () => {
481
- const o = rt(), { onLoad: d } = Mt(), { clientConfig: r } = lt(), { categories: l, dateRangeCategoryTotals: n, loadDateRangeCategoryTotals: a } = z(), { goals: i, spending: e } = E(), { displayedDateRange: c, selectedAccounts: u, selectedAccountGuids: s } = O(), { setFilter: m, sortedTransactions: S } = Dt(), g = r?.master?.deep_link_params?.account_guids, T = r?.master?.deep_link_params?.view, [x, D] = p.useState(""), [b, R] = p.useState(T === "income" ? 1 : 0), [H, P] = p.useState(""), [ut, K] = p.useState(!1);
474
+ }, rt = v(Pt), Kt = (n) => [
475
+ n.palette.chartMono.chartMono5,
476
+ n.palette.chartMono.chartMono4,
477
+ n.palette.chartMono.chartMono3,
478
+ n.palette.chartMono.chartMono2,
479
+ n.palette.chartMono.chartMono1,
480
+ n.palette.chartMono.chartMono6
481
+ ], Xt = () => {
482
+ const n = gt(), { onLoad: d } = Et(), { is_mobile_webview: s } = H(), { clientConfig: l } = H(), { categories: e, dateRangeCategoryTotals: a, loadDateRangeCategoryTotals: i } = P(), {
483
+ goals: o,
484
+ spending: c,
485
+ transactions: u
486
+ } = I(), { displayedDateRange: r, selectedAccounts: m, selectedAccountGuids: M } = k(), {
487
+ setFilter: g,
488
+ sortedTransactions: b,
489
+ sortedTransactionsWithSplits: E,
490
+ tags: x
491
+ } = At(), S = l?.master?.deep_link_params?.account_guids, R = l?.master?.deep_link_params?.view, [$, X] = p.useState(""), [L, ft] = p.useState(R === "income" ? 1 : 0), [Y, U] = p.useState(""), [yt, q] = p.useState(!1);
482
492
  p.useEffect(() => {
483
- a(
484
- u,
485
- c.start,
486
- c.end
493
+ i(
494
+ m,
495
+ r.start,
496
+ r.end
487
497
  ).finally(() => {
488
498
  d?.("SpendingWidget");
489
499
  });
490
- }, [u, c]);
491
- const k = p.useMemo(
492
- () => dt(l, i, o, n),
493
- [l, n]
494
- ), X = p.useMemo(
495
- () => gt(l, n, Bt(o)),
496
- [l, n]
497
- ), $ = p.useMemo(
498
- () => S.find((f) => f.guid === H),
499
- [H, S]
500
- ), pt = (f, A) => {
501
- R(A), D("");
502
- }, Y = (f) => {
503
- D(x === f || f === "0" ? "" : f);
504
- }, U = (f) => {
500
+ }, [m, r]);
501
+ const G = p.useMemo(
502
+ () => mt(e, o, n, a),
503
+ [e, a]
504
+ ), J = p.useMemo(
505
+ () => ht(e, a, Kt(n)),
506
+ [e, a]
507
+ ), j = p.useMemo(
508
+ () => b.find((y) => y.guid === Y),
509
+ [Y, b]
510
+ ), Ct = (y, A) => {
511
+ ft(A), X("");
512
+ }, Q = (y) => {
513
+ X($ === y || y === "0" ? "" : y);
514
+ }, Z = (y) => {
505
515
  const A = {
506
- accounts: g || s,
507
- dateRange: c
516
+ accounts: S || M,
517
+ dateRange: r
508
518
  };
509
- if (b === 0)
510
- if (f === "other") {
511
- const M = k.categoryData.find((G) => G.guid === "other");
512
- m({
519
+ if (L === 0)
520
+ if (y === "other") {
521
+ const T = G.categoryData.find((B) => B.guid === "other");
522
+ g({
513
523
  ...A,
514
- custom: (G) => !!M?.categoryTotals?.find((mt) => mt.guid === G.top_level_category_guid)
524
+ custom: (B) => !!T?.categoryTotals?.find((_t) => _t.guid === B.top_level_category_guid)
515
525
  });
516
526
  } else
517
- m({
527
+ g({
518
528
  ...A,
519
- custom: (M) => f ? M.top_level_category_guid === f : M.top_level_category_guid !== _.INCOME && M.top_level_category_guid !== _.INVESTMENTS && M.top_level_category_guid !== _.TRANSFER,
520
- showSplits: !!f
529
+ custom: (T) => y ? T.top_level_category_guid === y : T.top_level_category_guid !== _.INCOME && T.top_level_category_guid !== _.INVESTMENTS && T.top_level_category_guid !== _.TRANSFER,
530
+ showSplits: !!y
521
531
  });
522
532
  else
523
- m({
533
+ g({
524
534
  ...A,
525
- custom: (M) => f ? M.category_guid === f : M.category_guid === _.INCOME || M.top_level_category_guid === _.INCOME
535
+ custom: (T) => y ? T.category_guid === y : T.category_guid === _.INCOME || T.top_level_category_guid === _.INCOME
526
536
  });
527
- K(!0);
537
+ q(!0);
538
+ }, bt = () => {
539
+ Ot(E, x);
528
540
  };
529
- return /* @__PURE__ */ h(w, { children: [
530
- /* @__PURE__ */ h(it, { onChange: pt, value: b, variant: "fullWidth", children: [
541
+ return /* @__PURE__ */ h(D, { children: [
542
+ /* @__PURE__ */ h(lt, { onChange: Ct, value: L, variant: "fullWidth", children: [
531
543
  /* @__PURE__ */ t(
532
- L,
544
+ N,
533
545
  {
534
546
  label: /* @__PURE__ */ t(
535
- N,
547
+ W,
536
548
  {
537
- amount: k.totalAmount,
538
- label: e.spend_tab_title
549
+ amount: G.totalAmount,
550
+ label: c.spend_tab_title
539
551
  }
540
552
  )
541
553
  }
542
554
  ),
543
555
  /* @__PURE__ */ t(
544
- L,
556
+ N,
545
557
  {
546
558
  label: /* @__PURE__ */ t(
547
- N,
559
+ W,
548
560
  {
549
- amount: X.totalAmount,
550
- label: e.income_tab_title
561
+ amount: J.totalAmount,
562
+ label: c.income_tab_title
551
563
  }
552
564
  )
553
565
  }
554
566
  )
555
567
  ] }),
556
- b === 0 && /* @__PURE__ */ t(
557
- nt,
568
+ L === 0 && /* @__PURE__ */ t(
569
+ rt,
558
570
  {
559
- data: k,
560
- onSelected: Y,
561
- onViewTransactions: U,
562
- selectedId: x,
563
- title: e.spend_tab_title
571
+ data: G,
572
+ onSelected: Q,
573
+ onViewTransactions: Z,
574
+ selectedId: $,
575
+ title: c.spend_tab_title
564
576
  }
565
577
  ),
566
- b === 1 && /* @__PURE__ */ t(
567
- nt,
578
+ L === 1 && /* @__PURE__ */ t(
579
+ rt,
568
580
  {
569
- data: X,
570
- onSelected: Y,
571
- onViewTransactions: U,
572
- selectedId: x,
573
- title: e.income_tab_title
581
+ data: J,
582
+ onSelected: Q,
583
+ onViewTransactions: Z,
584
+ selectedId: $,
585
+ title: c.income_tab_title
574
586
  }
575
587
  ),
576
588
  /* @__PURE__ */ t(
577
- Z,
589
+ ot,
578
590
  {
579
- ariaLabelClose: e.close_drawer_aria,
580
- isOpen: ut,
581
- onClose: () => K(!1),
582
- title: e.transactions_drawer_title,
583
- children: /* @__PURE__ */ t(_t, { onClick: P })
591
+ ariaLabelClose: c.close_drawer_aria,
592
+ isOpen: yt,
593
+ onClose: () => q(!1),
594
+ title: c.transactions_drawer_title,
595
+ children: /* @__PURE__ */ h(f, { children: [
596
+ !s && b.length > 0 && /* @__PURE__ */ t(f, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
597
+ dt,
598
+ {
599
+ onClick: bt,
600
+ startIcon: /* @__PURE__ */ t(Dt, { name: "ios_share" }),
601
+ variant: "text",
602
+ children: u.export_csv_btn
603
+ }
604
+ ) }),
605
+ /* @__PURE__ */ t(vt, { onClick: U })
606
+ ] })
584
607
  }
585
608
  ),
586
609
  /* @__PURE__ */ t(
587
- Z,
610
+ ot,
588
611
  {
589
- ariaLabelClose: e.close_drawer_aria,
590
- isOpen: !!$,
591
- onClose: () => P(""),
592
- title: e.transaction_details_drawer_title,
593
- children: $ && /* @__PURE__ */ t(St, { transaction: $ })
612
+ ariaLabelClose: c.close_drawer_aria,
613
+ isOpen: !!j,
614
+ onClose: () => U(""),
615
+ title: c.transaction_details_drawer_title,
616
+ children: j && /* @__PURE__ */ t(It, { transaction: j })
594
617
  }
595
618
  )
596
619
  ] });
597
- }, Vt = I(jt), zt = ({ onBackClick: o, sx: d = {} }) => {
598
- const { visibleAccounts: r } = st(), { spending: l } = E(), { isCopyLoaded: n, isInitialized: a, setDisplayedDate: i, setSelectedAccounts: e } = O(), { onEvent: c } = xt(), { clientConfig: u } = lt(), s = u?.master?.deep_link_params?.date_range, [m, S] = p.useState(!1);
620
+ }, Yt = v(Xt), Ut = ({ onBackClick: n, sx: d = {} }) => {
621
+ const { visibleAccounts: s } = ut(), { spending: l } = I(), { isCopyLoaded: e, isInitialized: a, setDisplayedDate: i, setSelectedAccounts: o } = k(), { onEvent: c } = Lt(), { clientConfig: u } = H(), r = u?.master?.deep_link_params?.date_range, [m, M] = p.useState(!1);
599
622
  p.useEffect(() => {
600
- e(r);
601
- }, [r]), p.useEffect(() => {
602
- s && Array.isArray(s) && s.length === 2 ? i(s[0], s[1]) : i(ot(q()), at(q())), S(!0), c(tt.SPENDING_VIEW);
623
+ o(s);
624
+ }, [s]), p.useEffect(() => {
625
+ r && Array.isArray(r) && r.length === 2 ? i(r[0], r[1]) : i(st(tt()), ct(tt())), M(!0), c(at.SPENDING_VIEW);
603
626
  }, []);
604
- const g = (T) => {
605
- i(T[0], T[1]);
627
+ const g = (b) => {
628
+ i(b[0], b[1]);
606
629
  };
607
- return !n || !a || !m ? /* @__PURE__ */ t(F, {}) : /* @__PURE__ */ t(
608
- At,
630
+ return !e || !a || !m ? /* @__PURE__ */ t(K, {}) : /* @__PURE__ */ t(
631
+ $t,
609
632
  {
610
- accountOptions: r,
633
+ accountOptions: s,
611
634
  calendarActions: { onRangeChanged: g },
612
- onAccountsFilterClick: () => c(tt.SPENDING_CLICK_FILTER),
613
- onBackClick: o,
635
+ onAccountsFilterClick: () => c(at.SPENDING_CLICK_FILTER),
636
+ onBackClick: n,
614
637
  sx: d,
615
638
  title: l.title,
616
- children: /* @__PURE__ */ t(w, { height: "calc(100dvh - 150px)", overflow: "scroll", width: "100%", children: /* @__PURE__ */ t(Vt, {}) })
639
+ children: /* @__PURE__ */ t(D, { height: "calc(100dvh - 150px)", overflow: "scroll", width: "100%", children: /* @__PURE__ */ t(Yt, {}) })
617
640
  }
618
641
  );
619
- }, _e = I(zt);
642
+ }, Ie = v(Ut);
620
643
  export {
621
- Ce as SpendingMiniWidget,
622
- _e as SpendingWidget
644
+ ve as SpendingMiniWidget,
645
+ Ie as SpendingWidget
623
646
  };
@@ -3,10 +3,10 @@ import { u as P, C as Pe, D as $e, M as Ve, d as We, c as Ge, T as Ue, a as Fe }
3
3
  import { B as Sa, e as xa, b as wa } from "../TransactionDetails-BUoNbsu-.mjs";
4
4
  import { T as M } from "../User-Bj34_i8g.mjs";
5
5
  import { O as va } from "../User-Bj34_i8g.mjs";
6
- import { S as ae, D as ze } from "../TransactionStore-C1oyQCZK.mjs";
7
- import { T as Na } from "../TransactionStore-C1oyQCZK.mjs";
8
- import { e as Ke } from "../exportTransactionsToCSV-B8qpk5MU.mjs";
9
- import { E as Oa } from "../ExportCsvAction-DZ10CbWd.mjs";
6
+ import { S as ae, D as ze } from "../TransactionStore-CtGTg0XS.mjs";
7
+ import { T as Na } from "../TransactionStore-CtGTg0XS.mjs";
8
+ import { e as Ke } from "../exportTransactionsToCSV-C4PkIYP6.mjs";
9
+ import { E as Oa } from "../ExportCsvAction-DNSgmdyv.mjs";
10
10
  import { jsxs as _, jsx as e } from "react/jsx-runtime";
11
11
  import u from "react";
12
12
  import { observer as x } from "mobx-react-lite";
@@ -48,7 +48,7 @@ import Ut from "@mui/material/ListItemText";
48
48
  import qe from "@mui/material/styles/useTheme";
49
49
  import Xt from "@mui/material/Paper";
50
50
  import { b as Zt } from "../CategoryUtil-BR3H5i6n.mjs";
51
- import { E as qt } from "../ExportCsvAction-DZ10CbWd.mjs";
51
+ import { E as qt } from "../ExportCsvAction-DNSgmdyv.mjs";
52
52
  import { u as Qt } from "../useInsightsEnabled-BxytCjq5.mjs";
53
53
  import { E as Jt } from "../EmptyState-DA_lfRBv.mjs";
54
54
  import { l as eo } from "../ConnectDrawer-CbxHKlRv.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.3.0",
3
+ "version": "7.3.1",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -186,7 +186,7 @@
186
186
  "@mui/x-date-pickers-pro": "^7.29.4",
187
187
  "@mxenabled/cssinjs": "^0.6.0",
188
188
  "@mxenabled/mx-icons": "^1.5.1",
189
- "@mxenabled/mxui": "^1.5.6",
189
+ "@mxenabled/mxui": "^1.5.8",
190
190
  "@mxenabled/web-widget-sdk": "^0.0.13",
191
191
  "@tanstack/react-virtual": "^3.13.2",
192
192
  "bowser": "^2.11.0",
@@ -1,48 +0,0 @@
1
- import { fromUnixTime as d } from "date-fns/fromUnixTime";
2
- import { c as u } from "./Category-CevNQ03n.mjs";
3
- import { f as p, D as g } from "./Dialog-CWW597AF.mjs";
4
- import { T as m } from "./User-Bj34_i8g.mjs";
5
- function f(e) {
6
- return new Set(
7
- e.filter((n) => n.parent_guid !== void 0).map((n) => n.parent_guid)
8
- );
9
- }
10
- function T(e) {
11
- return e.reduce((n, t) => (t.parent_guid && (n[t.parent_guid] || (n[t.parent_guid] = []), n[t.parent_guid].push(t)), n), {});
12
- }
13
- function A(e, n) {
14
- const t = f(n), r = T(n), o = /* @__PURE__ */ new Set(), a = [];
15
- for (const i of e)
16
- t.has(i.guid) ? (r[i.guid] ?? []).slice().sort((s, c) => Math.abs(c.amount) - Math.abs(s.amount)).forEach((s) => {
17
- o.has(s.guid) || (a.push(s), o.add(s.guid));
18
- }) : o.has(i.guid) || (a.push(i), o.add(i.guid));
19
- return a;
20
- }
21
- const j = (e, n) => {
22
- const t = _(h(e, n)), r = encodeURIComponent(t), o = document.createElement("a");
23
- o.href = `data:attachment/csv;charset=utf-8,${r}`, o.download = "transactions.csv", document.body.appendChild(o), o.click(), document.body.removeChild(o);
24
- }, h = (e, n) => e.map((t) => ({
25
- Date: p(d(t.date), g.YEAR_MONTH_DAY),
26
- Description: C(t),
27
- "Original Description": t.feed_description,
28
- Amount: `${t.amount}`,
29
- Type: t.transaction_type === m.CREDIT ? "Credit" : "Debit",
30
- "Parent Category": u[t.top_level_category_guid || ""],
31
- Category: t.category,
32
- Account: t.account,
33
- Tags: y(t, n),
34
- Memo: t.memo,
35
- Pending: t.isPending ? "TRUE" : "FALSE"
36
- })), l = (e) => e ? /[,"\n\r]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e : "", _ = (e) => {
37
- const n = Object.keys(e[0]).join(",").concat(`\r
38
- `), t = e.map((r) => Object.values(r).map(l).join(",")).join(`\r
39
- `);
40
- return n + t;
41
- }, C = (e) => {
42
- let n = e.parent_guid ? "Split: " : "";
43
- return n += e.is_hidden ? "(Excluded) " : "", n += e.description, n;
44
- }, y = (e, n) => e.tags.map((t) => n.filter((o) => o.guid === t)[0]?.name ?? "").join(" ");
45
- export {
46
- j as e,
47
- A as f
48
- };