@mx-cartographer/experiences 7.11.17 → 7.11.18

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.11.18] - 03-10-2026
2
+
3
+ - **FIXED** - Filter ADA bug.
4
+
1
5
  ## [7.11.17] - 03-10-2026
2
6
 
3
7
  - **FIXED** - Chart layout and spacing issues
@@ -0,0 +1,237 @@
1
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
+ import B from "react";
3
+ import { observer as I } from "mobx-react-lite";
4
+ import j from "@mui/material/Box";
5
+ import C from "@mui/material/Button";
6
+ import P from "@mui/material/Divider";
7
+ import w from "@mui/material/IconButton";
8
+ import O from "@mui/material/Popover";
9
+ import S from "@mui/material/Stack";
10
+ import D from "@mui/material/Tooltip";
11
+ import { FilterAlt as A } from "@mxenabled/mx-icons";
12
+ import F from "@mui/material/Checkbox";
13
+ import G from "@mui/material/List";
14
+ import y from "@mui/material/ListItem";
15
+ import _ from "@mui/material/ListItemButton";
16
+ import E from "@mui/material/ListItemIcon";
17
+ import v from "@mui/material/ListItemText";
18
+ import { b as z, u as M, d as L } from "./hooks-zu7yblbi.mjs";
19
+ import { u as H } from "./useScreenSize-B6JyS_Lj.mjs";
20
+ const N = I(
21
+ ({ allowedAccountTypes: a }) => {
22
+ const { accountFilterMap: s, updateAccountFilterMap: u } = z(), { accounts: g, common: x } = M(), { account_filter: c } = x, { accountsByTypeMap: n } = L(), k = B.useMemo(
23
+ () => Array.from(n.keys()).reduce((t, i) => {
24
+ if (!a || a && a.includes(i)) {
25
+ const o = n.get(i);
26
+ o && t.push(...o);
27
+ }
28
+ return t;
29
+ }, []),
30
+ [n, a]
31
+ ), p = new Map(
32
+ Array.from(s.entries()).filter(([t]) => k.some((i) => i.guid === t))
33
+ ), m = Array.from(p.values()).every((t) => t), h = Array.from(p.values()).some((t) => t), f = () => {
34
+ for (const t of p.keys())
35
+ u(t, !m);
36
+ }, b = (t) => {
37
+ const i = n.get(t);
38
+ if (!i) return;
39
+ const o = i.some((r) => s.get(r.guid));
40
+ for (const r of i)
41
+ u(r.guid, !o);
42
+ };
43
+ return /* @__PURE__ */ d(
44
+ G,
45
+ {
46
+ dense: !0,
47
+ id: "filter_accounts",
48
+ sx: { overflowY: "scroll", maxHeight: 350, minWidth: 280 },
49
+ children: [
50
+ /* @__PURE__ */ e(
51
+ y,
52
+ {
53
+ "aria-label": c.select_all_accounts,
54
+ disableGutters: !0,
55
+ disablePadding: !0,
56
+ role: "menuitem",
57
+ sx: { py: 16 },
58
+ children: /* @__PURE__ */ d(_, { disableGutters: !0, onClick: f, sx: { p: 0, px: 8 }, children: [
59
+ /* @__PURE__ */ e(
60
+ F,
61
+ {
62
+ "aria-checked": m,
63
+ checked: m,
64
+ disableRipple: !0,
65
+ indeterminate: !m && h,
66
+ inputProps: { "aria-labelledby": "label-select-all" },
67
+ size: "small",
68
+ tabIndex: -1
69
+ }
70
+ ),
71
+ /* @__PURE__ */ e(
72
+ v,
73
+ {
74
+ id: "label-select-all",
75
+ primary: c.select_all_accounts,
76
+ primaryTypographyProps: { variant: "body1" }
77
+ }
78
+ )
79
+ ] })
80
+ }
81
+ ),
82
+ Array.from(n.keys()).map((t) => {
83
+ const i = n.get(t), o = a ? !a.includes(t) : !1, r = g.account_type_accounts[t];
84
+ return (
85
+ // Account Type Header
86
+ /* @__PURE__ */ e(
87
+ y,
88
+ {
89
+ "aria-label": r,
90
+ disableGutters: !0,
91
+ disablePadding: !0,
92
+ children: /* @__PURE__ */ d(S, { sx: { pb: 8, width: "100%" }, children: [
93
+ /* @__PURE__ */ e(P, {}),
94
+ /* @__PURE__ */ e(
95
+ G,
96
+ {
97
+ dense: !0,
98
+ role: "menu",
99
+ subheader: /* @__PURE__ */ e(y, { "aria-label": r, role: "menu", children: /* @__PURE__ */ e(
100
+ _,
101
+ {
102
+ disableGutters: !0,
103
+ disabled: o,
104
+ onClick: () => b(t),
105
+ sx: { pl: 16, minHeight: 40, justifyContent: "left" },
106
+ children: /* @__PURE__ */ e(
107
+ v,
108
+ {
109
+ primary: r,
110
+ primaryTypographyProps: { variant: "body1", fontWeight: "bold" }
111
+ }
112
+ )
113
+ }
114
+ ) }),
115
+ children: i?.map((l) => (
116
+ // Account Checkbox
117
+ /* @__PURE__ */ e(y, { "aria-label": l.displayName, role: "menuitem", children: /* @__PURE__ */ d(
118
+ _,
119
+ {
120
+ disableGutters: !0,
121
+ disabled: o,
122
+ onClick: () => u(l.guid, !s.get(l.guid)),
123
+ sx: { p: 0, minHeight: 40 },
124
+ children: [
125
+ /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
126
+ F,
127
+ {
128
+ "aria-checked": s.get(l.guid),
129
+ checked: s.get(l.guid),
130
+ disableRipple: !0,
131
+ inputProps: { "aria-labelledby": `label-${l.guid}` },
132
+ size: "small",
133
+ tabIndex: -1
134
+ }
135
+ ) }),
136
+ /* @__PURE__ */ e(
137
+ v,
138
+ {
139
+ id: `label-${l.guid}`,
140
+ primary: l.displayName,
141
+ primaryTypographyProps: { variant: "body1" }
142
+ }
143
+ )
144
+ ]
145
+ }
146
+ ) }, l.guid)
147
+ ))
148
+ }
149
+ )
150
+ ] })
151
+ },
152
+ t
153
+ )
154
+ );
155
+ })
156
+ ]
157
+ }
158
+ );
159
+ }
160
+ ), ne = I(
161
+ ({
162
+ allowedAccountTypes: a,
163
+ onAccountFilterClick: s,
164
+ sx: u = {},
165
+ variant: g = "text"
166
+ }) => {
167
+ const { isDesktop: x } = H(), { common: c } = M(), { accountFilterMap: n, resetAccountFilterMap: k } = z(), { detailedAccounts: p, updateAccountFilter: m } = L(), [h, f] = B.useState(null), b = (W) => {
168
+ k(), f(W.currentTarget), s?.();
169
+ }, t = () => {
170
+ f(null);
171
+ }, i = async () => {
172
+ await m(n), f(null);
173
+ }, o = c.account_filter, r = !!h, l = p.length === 0;
174
+ return /* @__PURE__ */ d(j, { m: 4, sx: { ...u }, children: [
175
+ x ? /* @__PURE__ */ e(
176
+ C,
177
+ {
178
+ "aria-controls": r ? "filter_accounts" : void 0,
179
+ "aria-expanded": r,
180
+ "aria-haspopup": !0,
181
+ "aria-label": o.title,
182
+ disabled: l,
183
+ onClick: b,
184
+ startIcon: /* @__PURE__ */ e(A, { size: 24 }),
185
+ sx: { p: 8, whiteSpace: "nowrap", minWidth: "max-content" },
186
+ variant: g,
187
+ children: c.filter_button
188
+ }
189
+ ) : /* @__PURE__ */ e(D, { id: "filter-accounts", placement: "bottom", title: o.title, children: /* @__PURE__ */ e(
190
+ w,
191
+ {
192
+ "aria-controls": r ? "filter_accounts" : void 0,
193
+ "aria-describedby": "filter-accounts",
194
+ "aria-expanded": r,
195
+ "aria-haspopup": !0,
196
+ "aria-label": o.title,
197
+ color: "primary",
198
+ disabled: l,
199
+ onClick: b,
200
+ sx: { p: 8 },
201
+ children: /* @__PURE__ */ e(A, { size: 24 })
202
+ }
203
+ ) }),
204
+ /* @__PURE__ */ e(
205
+ O,
206
+ {
207
+ anchorEl: h,
208
+ anchorOrigin: { vertical: "bottom", horizontal: "left" },
209
+ onClose: t,
210
+ open: r,
211
+ transformOrigin: { vertical: "top", horizontal: "left" },
212
+ children: /* @__PURE__ */ d(S, { children: [
213
+ /* @__PURE__ */ e(N, { allowedAccountTypes: a }),
214
+ /* @__PURE__ */ e(P, {}),
215
+ /* @__PURE__ */ d(S, { direction: "row", justifyContent: "space-between", spacing: 16, sx: { p: 16 }, children: [
216
+ /* @__PURE__ */ e(C, { fullWidth: !0, onClick: t, variant: "text", children: c.cancel_button }),
217
+ /* @__PURE__ */ e(
218
+ C,
219
+ {
220
+ "aria-label": o.filter_button_aria,
221
+ color: "primary",
222
+ fullWidth: !0,
223
+ onClick: i,
224
+ variant: "contained",
225
+ children: c.filter_button
226
+ }
227
+ )
228
+ ] })
229
+ ] })
230
+ }
231
+ )
232
+ ] });
233
+ }
234
+ );
235
+ export {
236
+ ne as G
237
+ };
@@ -12,7 +12,7 @@ import F from "@mui/material/Stack";
12
12
  import { ChevronLeft as ie } from "@mxenabled/mx-icons";
13
13
  import { Icon as f, Text as $, DateRangePicker as q, H2 as se, H3 as le } from "@mxenabled/mxui";
14
14
  import { u as de } from "./useDimensions-CeDR9V8N.mjs";
15
- import { G as me } from "./GlobalAccountFilter-B3v8E_rC.mjs";
15
+ import { G as me } from "./GlobalAccountFilter-CbwySv6c.mjs";
16
16
  import { L as ce } from "./Loader-D3rjKx72.mjs";
17
17
  import { g as pe, b as ue, u as ge, a as he, W as fe } from "./hooks-zu7yblbi.mjs";
18
18
  import { u as te } from "./useScreenSize-B6JyS_Lj.mjs";
@@ -63,7 +63,7 @@ import { C as l3 } from "../ConnectionsDrawer-c7HaKeRj.mjs";
63
63
  import { u as H1 } from "../useScreenSize-B6JyS_Lj.mjs";
64
64
  import { u as n1 } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
65
65
  import { L as o1 } from "../Loader-D3rjKx72.mjs";
66
- import { W as r3 } from "../WidgetContainer-DaALybWB.mjs";
66
+ import { W as r3 } from "../WidgetContainer-DSs6lJbr.mjs";
67
67
  import { M as A1 } from "../MiniWidgetContainer-DhEx4qKi.mjs";
68
68
  import { A as l2 } from "../AccountApi-ChQr5PAZ.mjs";
69
69
  import { A as d2 } from "../AccountStore-Cw54qb7Y.mjs";
@@ -48,7 +48,7 @@ import { subDays as dt } from "date-fns/subDays";
48
48
  import ut from "@mui/material/IconButton";
49
49
  import { M as mt } from "../ManageIncome-_ZP3uPwX.mjs";
50
50
  import { u as Ve } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
51
- import { W as gt } from "../WidgetContainer-DaALybWB.mjs";
51
+ import { W as gt } from "../WidgetContainer-DSs6lJbr.mjs";
52
52
  import { u as pt } from "../BudgetUtil-QbRXtLKn.mjs";
53
53
  import { M as ht } from "../MiniWidgetContainer-DhEx4qKi.mjs";
54
54
  import { ChevronRight as ft } from "@mxenabled/mx-icons";
@@ -40,7 +40,7 @@ import { M as st, S as ct, i as lt, d as _e, c as dt } from "../ManageIncome-_ZP
40
40
  import { D as Ge } from "../Drawer-DV4NTsFg.mjs";
41
41
  import { subDays as Me } from "date-fns/subDays";
42
42
  import { endOfToday as mt } from "date-fns/endOfToday";
43
- import { W as ut } from "../WidgetContainer-DaALybWB.mjs";
43
+ import { W as ut } from "../WidgetContainer-DSs6lJbr.mjs";
44
44
  import { A as Ie } from "../Analytics-i5h6BxR1.mjs";
45
45
  import { A as Q } from "../Account-BiB1F8lL.mjs";
46
46
  import { formatISO as ht } from "date-fns/formatISO";
@@ -12,7 +12,7 @@ import { H } from "../Help-B8mD4aLJ.mjs";
12
12
  import { E as Ge } from "../Help-B8mD4aLJ.mjs";
13
13
  import { M as We } from "../MicroWidgetContainer-CMES42I1.mjs";
14
14
  import { M as Ye } from "../MiniWidgetContainer-DhEx4qKi.mjs";
15
- import { D as Ke, W as ze } from "../WidgetContainer-DaALybWB.mjs";
15
+ import { D as Ke, W as ze } from "../WidgetContainer-DSs6lJbr.mjs";
16
16
  import { C as Ve } from "../ConnectDrawer-CVt-8rPJ.mjs";
17
17
  import { C as Ze, a as Je, b as ts } from "../User-BIgPTsU6.mjs";
18
18
  import { C as ss } from "../CurrencyInput-bcKNJ22c.mjs";
@@ -34,7 +34,7 @@ import { L as Us } from "../ListItemAction-5YhgdUZW.mjs";
34
34
  import { T as Q } from "../TrendsStore-st6GjDtg.mjs";
35
35
  import { L as Os } from "../TrendsStore-st6GjDtg.mjs";
36
36
  import { A as Rs, B as $s, I as Fs, N as Gs, T as Hs, a as Ws } from "../Notification-CMBNDGC-.mjs";
37
- import { G as Ys } from "../GlobalAccountFilter-B3v8E_rC.mjs";
37
+ import { G as Ys } from "../GlobalAccountFilter-CbwySv6c.mjs";
38
38
  import { S as Ks } from "../StatusBar-BK_uYHAB.mjs";
39
39
  import { D as js } from "../Donut-DSGXraiS.mjs";
40
40
  import { D as Xs } from "../Dialog-DdCwLgrl.mjs";
@@ -14,7 +14,7 @@ import k from "@mui/material/Button";
14
14
  import A from "@mui/material/IconButton";
15
15
  import I from "@mui/material/Tooltip";
16
16
  import B from "@mui/material/useMediaQuery";
17
- import { G as F } from "../GlobalAccountFilter-B3v8E_rC.mjs";
17
+ import { G as F } from "../GlobalAccountFilter-CbwySv6c.mjs";
18
18
  import { u as y } from "../useScreenSize-B6JyS_Lj.mjs";
19
19
  import { C as $ } from "../ConnectDrawer-CVt-8rPJ.mjs";
20
20
  import { u as z } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
@@ -47,7 +47,7 @@ import ct from "@mui/material/Popover";
47
47
  import { C as dt } from "../ConnectDrawer-CVt-8rPJ.mjs";
48
48
  import { u as pt } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
49
49
  import { L as mt } from "../Loader-D3rjKx72.mjs";
50
- import { W as ht } from "../WidgetContainer-DaALybWB.mjs";
50
+ import { W as ht } from "../WidgetContainer-DSs6lJbr.mjs";
51
51
  import { E as ut } from "../EmptyState-DHAkGsjk.mjs";
52
52
  const bt = (a, o = 0, r = 0) => {
53
53
  if (r === 0) return 0;
@@ -72,7 +72,7 @@ import vo from "@mui/material/Accordion";
72
72
  import wo from "@mui/material/AccordionDetails";
73
73
  import ko from "@mui/material/AccordionSummary";
74
74
  import { u as Mo } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
75
- import { W as Do } from "../WidgetContainer-DaALybWB.mjs";
75
+ import { W as Do } from "../WidgetContainer-DSs6lJbr.mjs";
76
76
  const Io = ({
77
77
  dialScoreData: t,
78
78
  dataIndex: o,
@@ -51,7 +51,7 @@ import { D as _t } from "../Dialog-DdCwLgrl.mjs";
51
51
  import { u as Ke } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
52
52
  import { A as X } from "../Analytics-i5h6BxR1.mjs";
53
53
  import { L as Me } from "../Loader-D3rjKx72.mjs";
54
- import { W as ut } from "../WidgetContainer-DaALybWB.mjs";
54
+ import { W as ut } from "../WidgetContainer-DSs6lJbr.mjs";
55
55
  import { E as pt } from "../EmptyState-DHAkGsjk.mjs";
56
56
  import ht from "@mui/material/Stack/Stack";
57
57
  import bt from "@mui/material/Box";
@@ -4,7 +4,7 @@ import { H as m } from "../Help-COWDMsJq.mjs";
4
4
  import { b as s } from "../hooks-zu7yblbi.mjs";
5
5
  import { u as a } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
6
6
  import { L as p } from "../Loader-D3rjKx72.mjs";
7
- import { W as d } from "../WidgetContainer-DaALybWB.mjs";
7
+ import { W as d } from "../WidgetContainer-DSs6lJbr.mjs";
8
8
  const H = t(({ onBackClick: e, sx: i }) => {
9
9
  const { isInitialized: o } = s();
10
10
  return a({
@@ -39,7 +39,7 @@ import { DataGridPro as Xe } from "@mui/x-data-grid-pro";
39
39
  import { Stack as $e } from "@mui/material";
40
40
  import { L as Se } from "../Loader-D3rjKx72.mjs";
41
41
  import { u as qe } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
42
- import { W as Ke } from "../WidgetContainer-DaALybWB.mjs";
42
+ import { W as Ke } from "../WidgetContainer-DSs6lJbr.mjs";
43
43
  import { A as Ye } from "../Account-BiB1F8lL.mjs";
44
44
  import { E as Qe } from "../EmptyState-DHAkGsjk.mjs";
45
45
  const me = ({ sx: t = {} }) => {
@@ -35,7 +35,7 @@ import { u as ne } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
35
35
  import { L as re } from "../Loader-D3rjKx72.mjs";
36
36
  import { M as ge } from "../MicroWidgetContainer-CMES42I1.mjs";
37
37
  import { C as ye } from "../ConnectionsDrawer-c7HaKeRj.mjs";
38
- import { W as Ce } from "../WidgetContainer-DaALybWB.mjs";
38
+ import { W as Ce } from "../WidgetContainer-DSs6lJbr.mjs";
39
39
  import { E as _e } from "../EmptyState-DHAkGsjk.mjs";
40
40
  const Se = () => {
41
41
  const { isMobile: t } = q(), { availableWidth: a } = se(), i = j(), {
@@ -57,7 +57,7 @@ import { u as oe } from "../useScreenSize-B6JyS_Lj.mjs";
57
57
  import { S as Ae } from "../SkeletonLoader-BaNboJjD.mjs";
58
58
  import { u as ae } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
59
59
  import { L as se } from "../Loader-D3rjKx72.mjs";
60
- import { W as gt } from "../WidgetContainer-DaALybWB.mjs";
60
+ import { W as gt } from "../WidgetContainer-DSs6lJbr.mjs";
61
61
  import { M as ht } from "../MiniWidgetContainer-DhEx4qKi.mjs";
62
62
  import { u as ft } from "../useDimensions-CeDR9V8N.mjs";
63
63
  import { M as xt } from "../MicroWidgetContainer-CMES42I1.mjs";
@@ -43,7 +43,7 @@ import Le from "@mui/material/ListItemText";
43
43
  import { D as He } from "../Drawer-DV4NTsFg.mjs";
44
44
  import { u as ne } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
45
45
  import { H as Oe } from "../Help-COWDMsJq.mjs";
46
- import { W as X } from "../WidgetContainer-DaALybWB.mjs";
46
+ import { W as X } from "../WidgetContainer-DSs6lJbr.mjs";
47
47
  const Fe = ({ availableWidth: t, handleOnLeavClick: a }) => {
48
48
  const o = xe(), { common: i, settings: n } = D(), { isDesktop: d, isMobile: l, isSmallMobile: r, isTablet: s } = O(t), { config: b } = $(), { updateUser: _ } = A(), { user: m } = Se(), [h, S] = p.useState({
49
49
  first_name: m.first_name,
@@ -31,7 +31,7 @@ import { D as tt } from "../Drawer-DV4NTsFg.mjs";
31
31
  import { b as w } from "../Category-CevNQ03n.mjs";
32
32
  import { parseISO as et } from "date-fns/parseISO";
33
33
  import { A as nt } from "../Analytics-i5h6BxR1.mjs";
34
- import { W as It } from "../WidgetContainer-DaALybWB.mjs";
34
+ import { W as It } from "../WidgetContainer-DSs6lJbr.mjs";
35
35
  const O = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ c(C, { direction: "column", children: [
36
36
  /* @__PURE__ */ t(T, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
37
37
  /* @__PURE__ */ t(T, { variant: "XSmall", children: R(n, o === "mini" ? "0,0" : "0,0.00") })
@@ -41,7 +41,7 @@ import { u as ut } from "../useAriaLive-MkYebyUR.mjs";
41
41
  import { S as mt } from "../SkeletonLoader-BaNboJjD.mjs";
42
42
  import { u as _t } from "../useScreenSize-B6JyS_Lj.mjs";
43
43
  import { u as pt } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
44
- import { W as gt } from "../WidgetContainer-DaALybWB.mjs";
44
+ import { W as gt } from "../WidgetContainer-DSs6lJbr.mjs";
45
45
  import { A } from "../Analytics-i5h6BxR1.mjs";
46
46
  import { S as ht } from "../SearchBox-B7km148n.mjs";
47
47
  import { D as te } from "../Drawer-DV4NTsFg.mjs";
@@ -40,7 +40,7 @@ import { T as ct } from "../TransactionDetails-BEKQKH03.mjs";
40
40
  import { D as We } from "../Drawer-DV4NTsFg.mjs";
41
41
  import { u as Ie } from "../useWidgetLoadTimer-Bmgv_UeH.mjs";
42
42
  import { L as Le } from "../Loader-D3rjKx72.mjs";
43
- import { W as dt } from "../WidgetContainer-DaALybWB.mjs";
43
+ import { W as dt } from "../WidgetContainer-DSs6lJbr.mjs";
44
44
  import { L as Be } from "../LineChart-DvCvL2Ed.mjs";
45
45
  import { M as Xt } from "../MiniWidgetContainer-DhEx4qKi.mjs";
46
46
  import { subMonths as Zt } from "date-fns";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.11.17",
3
+ "version": "7.11.18",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -1,215 +0,0 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import B from "react";
3
- import { observer as I } from "mobx-react-lite";
4
- import j from "@mui/material/Box";
5
- import k from "@mui/material/Button";
6
- import P from "@mui/material/Divider";
7
- import w from "@mui/material/IconButton";
8
- import O from "@mui/material/Popover";
9
- import S from "@mui/material/Stack";
10
- import D from "@mui/material/Tooltip";
11
- import { FilterAlt as A } from "@mxenabled/mx-icons";
12
- import F from "@mui/material/Checkbox";
13
- import G from "@mui/material/List";
14
- import y from "@mui/material/ListItem";
15
- import v from "@mui/material/ListItemButton";
16
- import E from "@mui/material/ListItemIcon";
17
- import _ from "@mui/material/ListItemText";
18
- import { b as z, u as M, d as L } from "./hooks-zu7yblbi.mjs";
19
- import { u as H } from "./useScreenSize-B6JyS_Lj.mjs";
20
- const R = I(
21
- ({ allowedAccountTypes: n }) => {
22
- const { accountFilterMap: c, updateAccountFilterMap: u } = z(), { accounts: g, common: x } = M(), { account_filter: d } = x, { accountsByTypeMap: a } = L(), C = B.useMemo(
23
- () => Array.from(a.keys()).reduce((e, r) => {
24
- if (!n || n && n.includes(r)) {
25
- const i = a.get(r);
26
- i && e.push(...i);
27
- }
28
- return e;
29
- }, []),
30
- [a, n]
31
- ), m = new Map(
32
- Array.from(c.entries()).filter(([e]) => C.some((r) => r.guid === e))
33
- ), p = Array.from(m.values()).every((e) => e), h = Array.from(m.values()).some((e) => e), f = () => {
34
- for (const e of m.keys())
35
- u(e, !p);
36
- }, b = (e) => {
37
- const r = a.get(e);
38
- if (!r) return;
39
- const i = r.some((o) => c.get(o.guid));
40
- for (const o of r)
41
- u(o.guid, !i);
42
- };
43
- return /* @__PURE__ */ s(
44
- G,
45
- {
46
- dense: !0,
47
- id: "filter_accounts",
48
- sx: { overflowY: "scroll", maxHeight: 350, minWidth: 280 },
49
- children: [
50
- /* @__PURE__ */ t(y, { disableGutters: !0, disablePadding: !0, sx: { py: 16 }, children: /* @__PURE__ */ s(v, { disableGutters: !0, onClick: f, sx: { p: 0, px: 8 }, children: [
51
- /* @__PURE__ */ t(
52
- F,
53
- {
54
- checked: p,
55
- disableRipple: !0,
56
- indeterminate: !p && h,
57
- inputProps: { "aria-labelledby": "label-select-all" },
58
- size: "small",
59
- tabIndex: -1
60
- }
61
- ),
62
- /* @__PURE__ */ t(
63
- _,
64
- {
65
- id: "label-select-all",
66
- primary: d.select_all_accounts,
67
- primaryTypographyProps: { variant: "body1" }
68
- }
69
- )
70
- ] }) }),
71
- Array.from(a.keys()).map((e) => {
72
- const r = a.get(e), i = n ? !n.includes(e) : !1, o = g.account_type_accounts[e];
73
- return (
74
- // Account Type Header
75
- /* @__PURE__ */ t(y, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ s(S, { sx: { pb: 8, width: "100%" }, children: [
76
- /* @__PURE__ */ t(P, {}),
77
- /* @__PURE__ */ t(
78
- G,
79
- {
80
- dense: !0,
81
- subheader: /* @__PURE__ */ t(y, { children: /* @__PURE__ */ t(
82
- v,
83
- {
84
- disableGutters: !0,
85
- disabled: i,
86
- onClick: () => b(e),
87
- sx: { pl: 16, minHeight: 40, justifyContent: "left" },
88
- children: /* @__PURE__ */ t(
89
- _,
90
- {
91
- primary: o,
92
- primaryTypographyProps: { variant: "body1", fontWeight: "bold" }
93
- }
94
- )
95
- }
96
- ) }),
97
- children: r?.map((l) => (
98
- // Account Checkbox
99
- /* @__PURE__ */ t(y, { children: /* @__PURE__ */ s(
100
- v,
101
- {
102
- disableGutters: !0,
103
- disabled: i,
104
- onClick: () => u(l.guid, !c.get(l.guid)),
105
- sx: { p: 0, minHeight: 40 },
106
- children: [
107
- /* @__PURE__ */ t(E, { children: /* @__PURE__ */ t(
108
- F,
109
- {
110
- checked: c.get(l.guid),
111
- disableRipple: !0,
112
- inputProps: { "aria-labelledby": `label-${l.guid}` },
113
- size: "small",
114
- tabIndex: -1
115
- }
116
- ) }),
117
- /* @__PURE__ */ t(
118
- _,
119
- {
120
- id: `label-${l.guid}`,
121
- primary: l.displayName,
122
- primaryTypographyProps: { variant: "body1" }
123
- }
124
- )
125
- ]
126
- }
127
- ) }, l.guid)
128
- ))
129
- }
130
- )
131
- ] }) }, e)
132
- );
133
- })
134
- ]
135
- }
136
- );
137
- }
138
- ), at = I(
139
- ({
140
- allowedAccountTypes: n,
141
- onAccountFilterClick: c,
142
- sx: u = {},
143
- variant: g = "text"
144
- }) => {
145
- const { isDesktop: x } = H(), { common: d } = M(), { accountFilterMap: a, resetAccountFilterMap: C } = z(), { detailedAccounts: m, updateAccountFilter: p } = L(), [h, f] = B.useState(null), b = (W) => {
146
- C(), f(W.currentTarget), c?.();
147
- }, e = () => {
148
- f(null);
149
- }, r = async () => {
150
- await p(a), f(null);
151
- }, i = d.account_filter, o = !!h, l = m.length === 0;
152
- return /* @__PURE__ */ s(j, { m: 4, sx: { ...u }, children: [
153
- x ? /* @__PURE__ */ t(
154
- k,
155
- {
156
- "aria-controls": o ? "filter_accounts" : void 0,
157
- "aria-expanded": o,
158
- "aria-haspopup": !0,
159
- "aria-label": i.title,
160
- disabled: l,
161
- onClick: b,
162
- startIcon: /* @__PURE__ */ t(A, { size: 24 }),
163
- sx: { p: 8, whiteSpace: "nowrap", minWidth: "max-content" },
164
- variant: g,
165
- children: d.filter_button
166
- }
167
- ) : /* @__PURE__ */ t(D, { id: "filter-accounts", placement: "bottom", title: i.title, children: /* @__PURE__ */ t(
168
- w,
169
- {
170
- "aria-controls": o ? "filter_accounts" : void 0,
171
- "aria-describedby": "filter-accounts",
172
- "aria-expanded": o,
173
- "aria-haspopup": !0,
174
- "aria-label": i.title,
175
- color: "primary",
176
- disabled: l,
177
- onClick: b,
178
- sx: { p: 8 },
179
- children: /* @__PURE__ */ t(A, { size: 24 })
180
- }
181
- ) }),
182
- /* @__PURE__ */ t(
183
- O,
184
- {
185
- anchorEl: h,
186
- anchorOrigin: { vertical: "bottom", horizontal: "left" },
187
- onClose: e,
188
- open: o,
189
- transformOrigin: { vertical: "top", horizontal: "left" },
190
- children: /* @__PURE__ */ s(S, { children: [
191
- /* @__PURE__ */ t(R, { allowedAccountTypes: n }),
192
- /* @__PURE__ */ t(P, {}),
193
- /* @__PURE__ */ s(S, { direction: "row", justifyContent: "space-between", spacing: 16, sx: { p: 16 }, children: [
194
- /* @__PURE__ */ t(k, { fullWidth: !0, onClick: e, variant: "text", children: d.cancel_button }),
195
- /* @__PURE__ */ t(
196
- k,
197
- {
198
- "aria-label": i.filter_button_aria,
199
- color: "primary",
200
- fullWidth: !0,
201
- onClick: r,
202
- variant: "contained",
203
- children: d.filter_button
204
- }
205
- )
206
- ] })
207
- ] })
208
- }
209
- )
210
- ] });
211
- }
212
- );
213
- export {
214
- at as G
215
- };