@australiangreens/ag-internal-components 0.0.90 → 0.0.91
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/dist/esm/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var he = (e, t, n) => t in e ? Pt(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
9
9
|
for (var n of ee(t))
|
|
10
10
|
Be.call(t, n) && he(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
12
|
+
}, k = (e, t) => Nt(e, Lt(t));
|
|
13
13
|
var Ee = (e, t) => {
|
|
14
14
|
var n = {};
|
|
15
15
|
for (var i in e)
|
|
@@ -20,7 +20,7 @@ var Ee = (e, t) => {
|
|
|
20
20
|
return n;
|
|
21
21
|
};
|
|
22
22
|
var Fe = (e, t, n) => (he(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
23
|
-
var
|
|
23
|
+
var N = (e, t, n) => new Promise((i, r) => {
|
|
24
24
|
var s = (l) => {
|
|
25
25
|
try {
|
|
26
26
|
d(n.next(l));
|
|
@@ -36,17 +36,17 @@ var P = (e, t, n) => new Promise((i, r) => {
|
|
|
36
36
|
}, d = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(s, c);
|
|
37
37
|
d((n = n.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { jsxs as h, Fragment as
|
|
40
|
-
import { useState as
|
|
41
|
-
import { Typography as
|
|
39
|
+
import { jsxs as h, Fragment as L, jsx as o } from "react/jsx-runtime";
|
|
40
|
+
import { useState as B, createContext as Ye, useCallback as oe, useContext as Ke, useEffect as ie, createElement as xe, useRef as ge } from "react";
|
|
41
|
+
import { Typography as E, Button as re, Paper as Je, Box as $, Drawer as we, styled as Ae, IconButton as Y, Container as Ze, useTheme as se, useMediaQuery as _t, Collapse as Mt, Avatar as Pe, Fade as Rt, Skeleton as Ne, Toolbar as Ht, Divider as Le, CssBaseline as Wt, Dialog as je, LinearProgress as et, DialogTitle as tt, DialogContent as nt, DialogActions as ot, Autocomplete as be, TextField as Se, CircularProgress as ke, Chip as zt, Tooltip as Ut, Stack as Gt, Snackbar as Vt, Alert as qt, FormHelperText as Xt } from "@mui/material";
|
|
42
42
|
import Qt from "@mui/material/CssBaseline";
|
|
43
|
-
import { styled as
|
|
43
|
+
import { styled as R, createTheme as it, alpha as fe } from "@mui/material/styles";
|
|
44
44
|
import { AgError as Yt } from "@australiangreens/ag-error";
|
|
45
45
|
import { createHelper as X } from "souvlaki";
|
|
46
46
|
import { BrowserRouter as Kt } from "react-router-dom";
|
|
47
47
|
import rt from "@mui/material/List";
|
|
48
48
|
import { ArrowForward as at, ArrowBack as st, ViewHeadline as Jt, Cancel as Zt, ArrowDropDown as jt } from "@mui/icons-material";
|
|
49
|
-
import { atom as
|
|
49
|
+
import { atom as _, useSetAtom as lt, useAtomValue as _e, useAtom as V, getDefaultStore as en, Provider as ct } from "jotai";
|
|
50
50
|
import { useHydrateAtoms as dt } from "jotai/utils";
|
|
51
51
|
import tn from "autosuggest-highlight/match";
|
|
52
52
|
import nn from "autosuggest-highlight/parse";
|
|
@@ -55,10 +55,10 @@ import { useAuth0 as ut } from "@auth0/auth0-react";
|
|
|
55
55
|
import { Buffer as sn } from "buffer";
|
|
56
56
|
import ln from "@mui/material/Skeleton";
|
|
57
57
|
function $o({ text: e }) {
|
|
58
|
-
const [t, n] =
|
|
59
|
-
return /* @__PURE__ */ h(
|
|
60
|
-
/* @__PURE__ */ o(
|
|
61
|
-
/* @__PURE__ */ o(
|
|
58
|
+
const [t, n] = B(0);
|
|
59
|
+
return /* @__PURE__ */ h(L, { children: [
|
|
60
|
+
/* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
61
|
+
/* @__PURE__ */ o(E, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
62
62
|
/* @__PURE__ */ o(
|
|
63
63
|
re,
|
|
64
64
|
{
|
|
@@ -86,7 +86,7 @@ const pt = 330, ht = 73, U = "Navbar", q = {
|
|
|
86
86
|
userInfoHolder: `${U}-userInfoHolder`,
|
|
87
87
|
settings: `${U}-settings`,
|
|
88
88
|
pieChartIcon: `${U}-pieChartIcon`
|
|
89
|
-
}, cn =
|
|
89
|
+
}, cn = R($, {
|
|
90
90
|
name: "NavBar"
|
|
91
91
|
})(({ theme: e }) => ({
|
|
92
92
|
[`&.${q.root}`]: {
|
|
@@ -119,7 +119,7 @@ const pt = 330, ht = 73, U = "Navbar", q = {
|
|
|
119
119
|
width: pt
|
|
120
120
|
}, gt()), un = () => a({
|
|
121
121
|
width: ht
|
|
122
|
-
}, gt()), pn =
|
|
122
|
+
}, gt()), pn = R(we, {
|
|
123
123
|
shouldForwardProp: (e) => e !== "open"
|
|
124
124
|
})(({ theme: e, open: t }) => a(a({
|
|
125
125
|
width: t ? pt : ht,
|
|
@@ -140,10 +140,10 @@ const ft = Ye(null), hn = {}, gn = {}, fn = ({
|
|
|
140
140
|
overrideActions: t = gn,
|
|
141
141
|
children: n
|
|
142
142
|
}) => {
|
|
143
|
-
const [{ open: i }, r] =
|
|
143
|
+
const [{ open: i }, r] = B({ open: !0 }), s = oe((l) => {
|
|
144
144
|
r({ open: l });
|
|
145
145
|
}, []), c = oe(() => {
|
|
146
|
-
r((l) =>
|
|
146
|
+
r((l) => k(a({}, l), { open: !l.open }));
|
|
147
147
|
}, []), d = a(a({
|
|
148
148
|
open: i,
|
|
149
149
|
setOpen: s,
|
|
@@ -159,7 +159,7 @@ const ft = Ye(null), hn = {}, gn = {}, fn = ({
|
|
|
159
159
|
open: !0
|
|
160
160
|
}, e), Io = X(
|
|
161
161
|
(e = Cn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(fn, { overrideState: e, overrideActions: t, children: n })
|
|
162
|
-
), Oo = X(() => ({ children: e }) => /* @__PURE__ */ o(Kt, { children: e })), Me = 7, To =
|
|
162
|
+
), Oo = X(() => ({ children: e }) => /* @__PURE__ */ o(Kt, { children: e })), Me = 7, To = R(rt)(({ theme: e }) => ({
|
|
163
163
|
backgroundColor: "black",
|
|
164
164
|
color: "white",
|
|
165
165
|
"& .MuiListItem-root": {
|
|
@@ -197,7 +197,7 @@ const ft = Ye(null), hn = {}, gn = {}, fn = ({
|
|
|
197
197
|
// '&.Mui-selected.Mui-focusVisible:hover': {
|
|
198
198
|
// },
|
|
199
199
|
}
|
|
200
|
-
})), Re = 7, Bo =
|
|
200
|
+
})), Re = 7, Bo = R(rt)(({ theme: e }) => ({
|
|
201
201
|
backgroundColor: "#e8e8e8",
|
|
202
202
|
color: "inherit",
|
|
203
203
|
"& .MuiListItem-root": {
|
|
@@ -255,7 +255,7 @@ function Eo({
|
|
|
255
255
|
)
|
|
256
256
|
] });
|
|
257
257
|
}
|
|
258
|
-
const xn = 24, vn = 64, G = "TopBar",
|
|
258
|
+
const xn = 24, vn = 64, G = "TopBar", T = {
|
|
259
259
|
topStripe: `${G}-topStripe`,
|
|
260
260
|
titleBar: `${G}-titleBar`,
|
|
261
261
|
titleSlider: `${G}-titleSlider`,
|
|
@@ -269,18 +269,18 @@ const xn = 24, vn = 64, G = "TopBar", B = {
|
|
|
269
269
|
var i, r;
|
|
270
270
|
return {
|
|
271
271
|
width: "100%",
|
|
272
|
-
[`& .${
|
|
272
|
+
[`& .${T.topStripe}`]: {
|
|
273
273
|
width: "100%",
|
|
274
274
|
height: `${xn}px`,
|
|
275
275
|
backgroundColor: e.palette.primary.main
|
|
276
276
|
},
|
|
277
|
-
[`& .${
|
|
277
|
+
[`& .${T.titleBar}`]: {
|
|
278
278
|
backgroundColor: e.palette.primary.light,
|
|
279
279
|
height: `${vn}px`,
|
|
280
280
|
padding: e.spacing(0, 3),
|
|
281
281
|
width: "100%"
|
|
282
282
|
},
|
|
283
|
-
[`& .${
|
|
283
|
+
[`& .${T.titleSlider}`]: a(a({
|
|
284
284
|
height: "100%",
|
|
285
285
|
display: "flex",
|
|
286
286
|
alignItems: "center",
|
|
@@ -289,14 +289,14 @@ const xn = 24, vn = 64, G = "TopBar", B = {
|
|
|
289
289
|
easing: e.transitions.easing.sharp,
|
|
290
290
|
duration: e.transitions.duration.leavingScreen
|
|
291
291
|
}),
|
|
292
|
-
[`& .${
|
|
292
|
+
[`& .${T.leftPanelButton}`]: {
|
|
293
293
|
marginRight: e.spacing(2),
|
|
294
294
|
flexGrow: 0
|
|
295
295
|
},
|
|
296
|
-
[`& .${
|
|
296
|
+
[`& .${T.titleText}`]: {
|
|
297
297
|
flexGrow: 1
|
|
298
298
|
},
|
|
299
|
-
[`& .${
|
|
299
|
+
[`& .${T.rightPanelButton}`]: {
|
|
300
300
|
flexGrow: 0
|
|
301
301
|
}
|
|
302
302
|
}, (t == null ? void 0 : t.open) && {
|
|
@@ -321,12 +321,12 @@ function An({
|
|
|
321
321
|
"data-testid": i
|
|
322
322
|
}) {
|
|
323
323
|
return /* @__PURE__ */ h(wn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
|
|
324
|
-
/* @__PURE__ */ o("div", { className:
|
|
325
|
-
/* @__PURE__ */ o("div", { className:
|
|
324
|
+
/* @__PURE__ */ o("div", { className: T.topStripe }),
|
|
325
|
+
/* @__PURE__ */ o("div", { className: T.titleBar, children: /* @__PURE__ */ h($, { className: T.titleSlider, children: [
|
|
326
326
|
t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ h(
|
|
327
327
|
Y,
|
|
328
328
|
{
|
|
329
|
-
className:
|
|
329
|
+
className: T.leftPanelButton,
|
|
330
330
|
color: "inherit",
|
|
331
331
|
"aria-label": "Open left side panel",
|
|
332
332
|
onClick: t == null ? void 0 : t.onOpen,
|
|
@@ -338,11 +338,11 @@ function An({
|
|
|
338
338
|
]
|
|
339
339
|
}
|
|
340
340
|
),
|
|
341
|
-
/* @__PURE__ */ o(
|
|
341
|
+
/* @__PURE__ */ o(E, { className: T.titleText, variant: "h6", noWrap: !0, children: e }),
|
|
342
342
|
n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ h(
|
|
343
343
|
Y,
|
|
344
344
|
{
|
|
345
|
-
className:
|
|
345
|
+
className: T.rightPanelButton,
|
|
346
346
|
color: "inherit",
|
|
347
347
|
"aria-label": "Open right side panel",
|
|
348
348
|
onClick: n == null ? void 0 : n.onOpen,
|
|
@@ -389,7 +389,7 @@ const mt = 400, bn = Ae(we, {
|
|
|
389
389
|
})
|
|
390
390
|
), Sn = Ae($, {
|
|
391
391
|
shouldForwardProp: (e) => !["anchor"].includes(e)
|
|
392
|
-
})(({ theme: e, anchor: t }) =>
|
|
392
|
+
})(({ theme: e, anchor: t }) => k(a({
|
|
393
393
|
display: "flex",
|
|
394
394
|
alignItems: "center",
|
|
395
395
|
padding: e.spacing(2)
|
|
@@ -419,18 +419,18 @@ function He({
|
|
|
419
419
|
debugOpacity: d = !1,
|
|
420
420
|
headerBoxProps: l = {},
|
|
421
421
|
onOpened: u,
|
|
422
|
-
onClosed:
|
|
422
|
+
onClosed: w,
|
|
423
423
|
"data-testid": x,
|
|
424
|
-
navBarOpen:
|
|
424
|
+
navBarOpen: A = !1,
|
|
425
425
|
navBarWidthOpen: g = 0,
|
|
426
|
-
navBarWidthClosed:
|
|
426
|
+
navBarWidthClosed: y = 0
|
|
427
427
|
}) {
|
|
428
428
|
return /* @__PURE__ */ h(
|
|
429
429
|
bn,
|
|
430
430
|
{
|
|
431
431
|
SlideProps: {
|
|
432
432
|
onEntered: () => u == null ? void 0 : u(),
|
|
433
|
-
onExited: () =>
|
|
433
|
+
onExited: () => w == null ? void 0 : w()
|
|
434
434
|
},
|
|
435
435
|
variant: "persistent",
|
|
436
436
|
anchor: t,
|
|
@@ -438,29 +438,29 @@ function He({
|
|
|
438
438
|
width: s,
|
|
439
439
|
debugOpacity: d,
|
|
440
440
|
"data-testid": x,
|
|
441
|
-
navBarOpen:
|
|
441
|
+
navBarOpen: A,
|
|
442
442
|
navBarWidthOpen: g,
|
|
443
|
-
navBarWidthClosed:
|
|
443
|
+
navBarWidthClosed: y,
|
|
444
444
|
children: [
|
|
445
|
-
/* @__PURE__ */ o(Sn,
|
|
446
|
-
/* @__PURE__ */ o(
|
|
445
|
+
/* @__PURE__ */ o(Sn, k(a({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ h(L, { children: [
|
|
446
|
+
/* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", children: r }),
|
|
447
447
|
c && /* @__PURE__ */ h(Y, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
|
|
448
448
|
/* @__PURE__ */ o(st, { "data-testid": "arrowbackicon" }),
|
|
449
449
|
" "
|
|
450
450
|
] })
|
|
451
|
-
] }) : /* @__PURE__ */ h(
|
|
451
|
+
] }) : /* @__PURE__ */ h(L, { children: [
|
|
452
452
|
c && /* @__PURE__ */ h(Y, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
|
|
453
453
|
/* @__PURE__ */ o(at, {}),
|
|
454
454
|
" "
|
|
455
455
|
] }),
|
|
456
|
-
/* @__PURE__ */ o(
|
|
456
|
+
/* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", children: r })
|
|
457
457
|
] }) })),
|
|
458
458
|
e
|
|
459
459
|
]
|
|
460
460
|
}
|
|
461
461
|
);
|
|
462
462
|
}
|
|
463
|
-
const kn =
|
|
463
|
+
const kn = R($, {
|
|
464
464
|
shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
|
|
465
465
|
name: "PanelAwareMargins"
|
|
466
466
|
})(({ theme: e, leftPanel: t, rightPanel: n }) => {
|
|
@@ -483,7 +483,7 @@ const kn = M($, {
|
|
|
483
483
|
}),
|
|
484
484
|
marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
|
|
485
485
|
});
|
|
486
|
-
}), Dn =
|
|
486
|
+
}), Dn = R(Ze, {
|
|
487
487
|
name: "PageContainer"
|
|
488
488
|
})(({ theme: e }) => ({
|
|
489
489
|
// Horizontal padding comes from the Container's gutter
|
|
@@ -498,7 +498,7 @@ const kn = M($, {
|
|
|
498
498
|
startOpen: !1,
|
|
499
499
|
open: void 0,
|
|
500
500
|
onChangeOpen: void 0,
|
|
501
|
-
content: /* @__PURE__ */ o(
|
|
501
|
+
content: /* @__PURE__ */ o(L, {}),
|
|
502
502
|
onOpened: void 0,
|
|
503
503
|
onClosed: void 0,
|
|
504
504
|
dataTestId: void 0
|
|
@@ -514,18 +514,18 @@ function Fo({
|
|
|
514
514
|
pageContentDataTestId: d,
|
|
515
515
|
topBarDataTestId: l,
|
|
516
516
|
navBarOpen: u,
|
|
517
|
-
navBarWidthOpen:
|
|
517
|
+
navBarWidthOpen: w,
|
|
518
518
|
navBarWidthClosed: x
|
|
519
519
|
}) {
|
|
520
|
-
const [
|
|
521
|
-
titleText:
|
|
520
|
+
const [A, g] = B(me), [y, b] = B(Ce), [D, I] = B(me), [O, F] = B(Ce), P = n !== void 0, S = i !== void 0, {
|
|
521
|
+
titleText: v,
|
|
522
522
|
content: H,
|
|
523
523
|
flavour: W,
|
|
524
524
|
open: p,
|
|
525
525
|
onChangeOpen: f,
|
|
526
526
|
width: m,
|
|
527
527
|
arrowButtons: C,
|
|
528
|
-
startOpen:
|
|
528
|
+
startOpen: M,
|
|
529
529
|
onOpened: J,
|
|
530
530
|
onClosed: le,
|
|
531
531
|
dataTestId: It
|
|
@@ -543,17 +543,17 @@ function Fo({
|
|
|
543
543
|
dataTestId: Ft
|
|
544
544
|
} = i ? a(a({}, te), i) : a({}, te);
|
|
545
545
|
ie(() => {
|
|
546
|
-
|
|
547
|
-
}, [
|
|
548
|
-
j !== Ce && (b(j),
|
|
546
|
+
M !== me && (g(M), I(M));
|
|
547
|
+
}, [M]), ie(() => {
|
|
548
|
+
j !== Ce && (b(j), F(j));
|
|
549
549
|
}, [j]);
|
|
550
|
-
const ue = p === void 0 ?
|
|
551
|
-
p === void 0 && (g(z), r &&
|
|
550
|
+
const ue = p === void 0 ? A : p, pe = ce === void 0 ? y : ce, Ie = (z) => {
|
|
551
|
+
p === void 0 && (g(z), r && S && (z ? (b(!1), F(y)) : b(O))), f && f(z);
|
|
552
552
|
}, Oe = (z) => {
|
|
553
|
-
ce === void 0 && (b(z), r &&
|
|
553
|
+
ce === void 0 && (b(z), r && P && (z ? (g(!1), I(A)) : g(D))), $e && $e(z);
|
|
554
554
|
};
|
|
555
555
|
return /* @__PURE__ */ h($, { children: [
|
|
556
|
-
|
|
556
|
+
P && /* @__PURE__ */ o(
|
|
557
557
|
He,
|
|
558
558
|
{
|
|
559
559
|
"data-testid": It,
|
|
@@ -561,18 +561,18 @@ function Fo({
|
|
|
561
561
|
open: ue,
|
|
562
562
|
onClose: () => Ie(!1),
|
|
563
563
|
width: m,
|
|
564
|
-
titleText:
|
|
564
|
+
titleText: v,
|
|
565
565
|
debugOpacity: s,
|
|
566
566
|
showCloseArrow: C === "both" || C === "close",
|
|
567
567
|
onOpened: J,
|
|
568
568
|
onClosed: le,
|
|
569
569
|
navBarOpen: u,
|
|
570
|
-
navBarWidthOpen:
|
|
570
|
+
navBarWidthOpen: w,
|
|
571
571
|
navBarWidthClosed: x,
|
|
572
572
|
children: H
|
|
573
573
|
}
|
|
574
574
|
),
|
|
575
|
-
|
|
575
|
+
S && /* @__PURE__ */ o(
|
|
576
576
|
He,
|
|
577
577
|
{
|
|
578
578
|
"data-testid": Ft,
|
|
@@ -586,7 +586,7 @@ function Fo({
|
|
|
586
586
|
onOpened: Bt,
|
|
587
587
|
onClosed: Et,
|
|
588
588
|
navBarOpen: u,
|
|
589
|
-
navBarWidthOpen:
|
|
589
|
+
navBarWidthOpen: w,
|
|
590
590
|
navBarWidthClosed: x,
|
|
591
591
|
children: Tt
|
|
592
592
|
}
|
|
@@ -596,14 +596,14 @@ function Fo({
|
|
|
596
596
|
a(a({
|
|
597
597
|
titleText: t,
|
|
598
598
|
"data-testid": l
|
|
599
|
-
},
|
|
599
|
+
}, P && W === "push" ? {
|
|
600
600
|
leftPanel: {
|
|
601
601
|
open: ue,
|
|
602
602
|
width: m,
|
|
603
603
|
onOpen: () => Ie(!0),
|
|
604
604
|
showOpenArrow: C === "both" || C === "open"
|
|
605
605
|
}
|
|
606
|
-
} : {}),
|
|
606
|
+
} : {}), S && ye === "push" ? {
|
|
607
607
|
rightPanel: {
|
|
608
608
|
open: pe,
|
|
609
609
|
width: de,
|
|
@@ -614,7 +614,7 @@ function Fo({
|
|
|
614
614
|
),
|
|
615
615
|
/* @__PURE__ */ o(
|
|
616
616
|
kn,
|
|
617
|
-
|
|
617
|
+
k(a(a({}, W === "push" ? {
|
|
618
618
|
leftPanel: {
|
|
619
619
|
open: ue,
|
|
620
620
|
width: m
|
|
@@ -625,7 +625,7 @@ function Fo({
|
|
|
625
625
|
width: de
|
|
626
626
|
}
|
|
627
627
|
} : {}), {
|
|
628
|
-
children: /* @__PURE__ */ o(Dn,
|
|
628
|
+
children: /* @__PURE__ */ o(Dn, k(a({ "data-testid": d }, c), { children: e }))
|
|
629
629
|
})
|
|
630
630
|
)
|
|
631
631
|
] });
|
|
@@ -633,7 +633,7 @@ function Fo({
|
|
|
633
633
|
const Ct = () => {
|
|
634
634
|
const e = se();
|
|
635
635
|
return _t(e.breakpoints.down("sm"));
|
|
636
|
-
}, yn = 64, $n = 72, In = 256, K =
|
|
636
|
+
}, yn = 64, $n = 72, In = 256, K = _(!0), xt = _(In), vt = _($n), ve = _(""), On = _(void 0), wt = _(yn), At = _(void 0);
|
|
637
637
|
function Tn({ links: e }) {
|
|
638
638
|
return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
|
|
639
639
|
}
|
|
@@ -645,7 +645,7 @@ const ne = "Navbar", Q = {
|
|
|
645
645
|
// userInfoHolder: `${PREFIX}-userInfoHolder`,
|
|
646
646
|
// settings: `${PREFIX}-settings`,
|
|
647
647
|
// pieChartIcon: `${PREFIX}-pieChartIcon`,
|
|
648
|
-
}, Bn =
|
|
648
|
+
}, Bn = R($, { name: "NavBar" })(({ theme: e }) => ({
|
|
649
649
|
[`&.${Q.root}`]: {
|
|
650
650
|
display: "flex"
|
|
651
651
|
},
|
|
@@ -693,7 +693,7 @@ const ne = "Navbar", Q = {
|
|
|
693
693
|
}, bt(e)), ze = (e, t) => a({
|
|
694
694
|
width: t,
|
|
695
695
|
transition: ae(e, "width", "leaving")
|
|
696
|
-
}, bt(e)), Fn =
|
|
696
|
+
}, bt(e)), Fn = R(we, {
|
|
697
697
|
shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
|
|
698
698
|
})(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => a(a({
|
|
699
699
|
flexShrink: 0,
|
|
@@ -701,10 +701,10 @@ const ne = "Navbar", Q = {
|
|
|
701
701
|
boxSizing: "border-box",
|
|
702
702
|
display: "flex",
|
|
703
703
|
flexDirection: "column"
|
|
704
|
-
}, t &&
|
|
704
|
+
}, t && k(a({}, We(e, n)), {
|
|
705
705
|
backgroundColor: "",
|
|
706
706
|
"& .MuiDrawer-paper": We(e, n)
|
|
707
|
-
})), !t &&
|
|
707
|
+
})), !t && k(a({}, ze(e, r ? n : i)), {
|
|
708
708
|
backgroundColor: "",
|
|
709
709
|
"& .MuiDrawer-paper": ze(e, r ? n : i)
|
|
710
710
|
})));
|
|
@@ -753,8 +753,8 @@ function Ln({ user: e, domainCode: t, open: n }) {
|
|
|
753
753
|
}
|
|
754
754
|
),
|
|
755
755
|
/* @__PURE__ */ o(En, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Rt, { in: n, children: /* @__PURE__ */ h($, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
756
|
-
e != null && e.name ? /* @__PURE__ */ o(
|
|
757
|
-
t ? /* @__PURE__ */ o(
|
|
756
|
+
e != null && e.name ? /* @__PURE__ */ o(E, { children: e.name }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "50%" }),
|
|
757
|
+
t ? /* @__PURE__ */ o(E, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "25%" })
|
|
758
758
|
] }) }) })
|
|
759
759
|
]
|
|
760
760
|
}
|
|
@@ -771,7 +771,7 @@ function _n({
|
|
|
771
771
|
user: d,
|
|
772
772
|
domainCode: l
|
|
773
773
|
}) {
|
|
774
|
-
const u = Ct(),
|
|
774
|
+
const u = Ct(), w = lt(K);
|
|
775
775
|
return /* @__PURE__ */ o(Bn, { className: Q.root, "data-testid": i, children: /* @__PURE__ */ h(
|
|
776
776
|
Fn,
|
|
777
777
|
{
|
|
@@ -784,7 +784,7 @@ function _n({
|
|
|
784
784
|
component: "nav"
|
|
785
785
|
},
|
|
786
786
|
onClose: () => {
|
|
787
|
-
|
|
787
|
+
w(!1);
|
|
788
788
|
},
|
|
789
789
|
isSmallScreen: u,
|
|
790
790
|
children: [
|
|
@@ -797,7 +797,7 @@ function _n({
|
|
|
797
797
|
/* @__PURE__ */ h($, { flexGrow: "0", children: [
|
|
798
798
|
/* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } }),
|
|
799
799
|
/* @__PURE__ */ o(Ln, { user: d, domainCode: l, open: e }),
|
|
800
|
-
c && /* @__PURE__ */ o(
|
|
800
|
+
c && /* @__PURE__ */ o(L, { children: c })
|
|
801
801
|
] })
|
|
802
802
|
]
|
|
803
803
|
}
|
|
@@ -870,7 +870,7 @@ function Wn({
|
|
|
870
870
|
children: /* @__PURE__ */ o(Jt, { fontSize: "medium" })
|
|
871
871
|
}
|
|
872
872
|
),
|
|
873
|
-
/* @__PURE__ */ o(
|
|
873
|
+
/* @__PURE__ */ o(E, { className: Hn.titleText, variant: "h6", children: e }),
|
|
874
874
|
i
|
|
875
875
|
]
|
|
876
876
|
}
|
|
@@ -887,22 +887,22 @@ function Po({
|
|
|
887
887
|
navBarMiddle: d,
|
|
888
888
|
navBarBottom: l,
|
|
889
889
|
user: u,
|
|
890
|
-
domainCode:
|
|
890
|
+
domainCode: w
|
|
891
891
|
}) {
|
|
892
892
|
dt([
|
|
893
893
|
[K, n != null ? n : !0],
|
|
894
894
|
[ve, t != null ? t : ""]
|
|
895
895
|
]);
|
|
896
|
-
const x = _e(K), [
|
|
896
|
+
const x = _e(K), [A] = V(xt), [g] = V(vt), y = _e(ve), [b] = V(wt), [D] = V(On), [I] = V(At);
|
|
897
897
|
return /* @__PURE__ */ h($, { children: [
|
|
898
898
|
/* @__PURE__ */ o(Wt, {}),
|
|
899
899
|
/* @__PURE__ */ o(
|
|
900
900
|
Wn,
|
|
901
901
|
{
|
|
902
|
-
titleText:
|
|
902
|
+
titleText: y,
|
|
903
903
|
"data-testid": s,
|
|
904
904
|
height: b,
|
|
905
|
-
middle:
|
|
905
|
+
middle: D
|
|
906
906
|
}
|
|
907
907
|
),
|
|
908
908
|
/* @__PURE__ */ h($, { sx: { display: "flex" }, children: [
|
|
@@ -914,8 +914,8 @@ function Po({
|
|
|
914
914
|
middle: d,
|
|
915
915
|
bottom: l,
|
|
916
916
|
user: u,
|
|
917
|
-
domainCode:
|
|
918
|
-
widthOpen:
|
|
917
|
+
domainCode: w,
|
|
918
|
+
widthOpen: A,
|
|
919
919
|
widthClosed: g,
|
|
920
920
|
offsetTop: b,
|
|
921
921
|
"data-testid": c
|
|
@@ -923,7 +923,7 @@ function Po({
|
|
|
923
923
|
),
|
|
924
924
|
/* @__PURE__ */ o(
|
|
925
925
|
Mn,
|
|
926
|
-
|
|
926
|
+
k(a({
|
|
927
927
|
"data-testid": r,
|
|
928
928
|
topBarHeight: b
|
|
929
929
|
}, i), {
|
|
@@ -944,23 +944,23 @@ const St = ({
|
|
|
944
944
|
sx: d,
|
|
945
945
|
"data-testid": l,
|
|
946
946
|
disableCloseOnBackdropOrEscape: u = !1,
|
|
947
|
-
isLoading:
|
|
947
|
+
isLoading: w = !1
|
|
948
948
|
}) => {
|
|
949
|
-
var g,
|
|
950
|
-
const [x,
|
|
949
|
+
var g, y;
|
|
950
|
+
const [x, A] = B(!1);
|
|
951
951
|
return /* @__PURE__ */ h(
|
|
952
952
|
je,
|
|
953
953
|
{
|
|
954
954
|
open: e,
|
|
955
|
-
onClose: (b,
|
|
956
|
-
u && (
|
|
955
|
+
onClose: (b, D) => N(void 0, null, function* () {
|
|
956
|
+
u && (D === "backdropClick" || D === "escapeKeyDown") || x || (s != null && s.onClick ? yield s.onClick() : c());
|
|
957
957
|
}),
|
|
958
958
|
fullWidth: !0,
|
|
959
959
|
maxWidth: i != null ? i : "xs",
|
|
960
960
|
"data-testid": l,
|
|
961
961
|
sx: d,
|
|
962
962
|
children: [
|
|
963
|
-
|
|
963
|
+
w && /* @__PURE__ */ o(et, { sx: { height: "4px", marginBottom: "-4px" } }),
|
|
964
964
|
/* @__PURE__ */ o(tt, { children: t }),
|
|
965
965
|
/* @__PURE__ */ o(nt, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
|
|
966
966
|
/* @__PURE__ */ h(ot, { children: [
|
|
@@ -971,15 +971,15 @@ const St = ({
|
|
|
971
971
|
"data-testid": s == null ? void 0 : s.testId,
|
|
972
972
|
disabled: (s == null ? void 0 : s.disabled) || x,
|
|
973
973
|
color: s == null ? void 0 : s.buttonColor,
|
|
974
|
-
children: (
|
|
974
|
+
children: (y = s == null ? void 0 : s.text) != null ? y : "Cancel"
|
|
975
975
|
}
|
|
976
976
|
),
|
|
977
977
|
r && /* @__PURE__ */ o(
|
|
978
978
|
re,
|
|
979
979
|
{
|
|
980
|
-
onClick: () =>
|
|
980
|
+
onClick: () => N(void 0, null, function* () {
|
|
981
981
|
var b;
|
|
982
|
-
|
|
982
|
+
A(!0), yield (b = r.onClick) == null ? void 0 : b.call(r), A(!1);
|
|
983
983
|
}),
|
|
984
984
|
"data-testid": r.testId,
|
|
985
985
|
disabled: r.disabled || x,
|
|
@@ -1004,7 +1004,7 @@ const St = ({
|
|
|
1004
1004
|
queryKey: ["autocomplete", i, r]
|
|
1005
1005
|
});
|
|
1006
1006
|
function No({
|
|
1007
|
-
lookup: e = () =>
|
|
1007
|
+
lookup: e = () => N(this, null, function* () {
|
|
1008
1008
|
}),
|
|
1009
1009
|
enableHighlighting: t = !0,
|
|
1010
1010
|
onChange: n,
|
|
@@ -1015,57 +1015,57 @@ function No({
|
|
|
1015
1015
|
sx: d,
|
|
1016
1016
|
boxSx: l,
|
|
1017
1017
|
textFieldColor: u,
|
|
1018
|
-
textFieldVariant:
|
|
1018
|
+
textFieldVariant: w = "filled",
|
|
1019
1019
|
loadingText: x = "Loading...",
|
|
1020
|
-
noOptionsText:
|
|
1020
|
+
noOptionsText: A = "No options",
|
|
1021
1021
|
popupIcon: g = /* @__PURE__ */ o(jt, {}),
|
|
1022
|
-
error:
|
|
1022
|
+
error: y = !1,
|
|
1023
1023
|
helperText: b = "",
|
|
1024
|
-
preLoadedOptions:
|
|
1024
|
+
preLoadedOptions: D = void 0,
|
|
1025
1025
|
disablePortal: I = !1,
|
|
1026
|
-
disableIconFlip:
|
|
1026
|
+
disableIconFlip: O = !1
|
|
1027
1027
|
}) {
|
|
1028
|
-
const [
|
|
1028
|
+
const [F, P] = B(""), S = (p, f) => {
|
|
1029
1029
|
const m = s.filter((C) => C.id !== f);
|
|
1030
1030
|
n(m, "delete", p);
|
|
1031
|
-
}, { data:
|
|
1032
|
-
inputValue:
|
|
1031
|
+
}, { data: v, isLoading: H } = kt({
|
|
1032
|
+
inputValue: F,
|
|
1033
1033
|
label: r,
|
|
1034
1034
|
lookup: e,
|
|
1035
1035
|
minLength: i,
|
|
1036
|
-
preLoadedOptions:
|
|
1037
|
-
}), W =
|
|
1036
|
+
preLoadedOptions: D
|
|
1037
|
+
}), W = F.length >= i;
|
|
1038
1038
|
return /* @__PURE__ */ h("div", { "data-testid": c, children: [
|
|
1039
1039
|
/* @__PURE__ */ o(
|
|
1040
1040
|
be,
|
|
1041
1041
|
{
|
|
1042
|
-
sx: a(a({}, d),
|
|
1042
|
+
sx: a(a({}, d), O ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
1043
1043
|
"data-testid": c ? `${c}:Autocomplete` : void 0,
|
|
1044
1044
|
disablePortal: I,
|
|
1045
1045
|
multiple: !0,
|
|
1046
1046
|
getOptionLabel: (p) => typeof p == "string" ? p : p.label,
|
|
1047
1047
|
loading: W ? H : !1,
|
|
1048
|
-
options: [...s, ...
|
|
1048
|
+
options: [...s, ...v != null ? v : []],
|
|
1049
1049
|
filterSelectedOptions: !0,
|
|
1050
1050
|
includeInputInList: !0,
|
|
1051
1051
|
value: s,
|
|
1052
1052
|
onChange: (p, f, m) => {
|
|
1053
1053
|
n(f, m, p);
|
|
1054
1054
|
},
|
|
1055
|
-
onInputChange: (p, f) =>
|
|
1056
|
-
noOptionsText: W ?
|
|
1055
|
+
onInputChange: (p, f) => P(f),
|
|
1056
|
+
noOptionsText: W ? A : "Start typing to search",
|
|
1057
1057
|
loadingText: x,
|
|
1058
1058
|
popupIcon: g,
|
|
1059
1059
|
renderInput: (p) => /* @__PURE__ */ o(
|
|
1060
1060
|
Se,
|
|
1061
|
-
|
|
1061
|
+
k(a({}, p), {
|
|
1062
1062
|
label: r,
|
|
1063
1063
|
fullWidth: !0,
|
|
1064
|
-
variant:
|
|
1065
|
-
error:
|
|
1064
|
+
variant: w,
|
|
1065
|
+
error: y,
|
|
1066
1066
|
helperText: b,
|
|
1067
|
-
InputProps:
|
|
1068
|
-
endAdornment: /* @__PURE__ */ h(
|
|
1067
|
+
InputProps: k(a({}, p.InputProps), {
|
|
1068
|
+
endAdornment: /* @__PURE__ */ h(L, { children: [
|
|
1069
1069
|
H ? /* @__PURE__ */ o(ke, { color: "inherit", size: 20 }) : null,
|
|
1070
1070
|
p.InputProps.endAdornment
|
|
1071
1071
|
] })
|
|
@@ -1084,14 +1084,14 @@ function No({
|
|
|
1084
1084
|
const C = tn(f.label, m.inputValue, {
|
|
1085
1085
|
insideWords: !0,
|
|
1086
1086
|
findAllOccurrences: !0
|
|
1087
|
-
}),
|
|
1087
|
+
}), M = nn(f.label, C);
|
|
1088
1088
|
return /* @__PURE__ */ xe(
|
|
1089
1089
|
"li",
|
|
1090
|
-
|
|
1090
|
+
k(a({}, p), {
|
|
1091
1091
|
key: f.id,
|
|
1092
1092
|
"data-testid": c ? `${c}:Autocomplete:option(${f.id.toString()})` : void 0
|
|
1093
1093
|
}),
|
|
1094
|
-
/* @__PURE__ */ o("div", { children:
|
|
1094
|
+
/* @__PURE__ */ o("div", { children: M.map((J, le) => /* @__PURE__ */ o(
|
|
1095
1095
|
"span",
|
|
1096
1096
|
{
|
|
1097
1097
|
style: {
|
|
@@ -1105,7 +1105,7 @@ function No({
|
|
|
1105
1105
|
} else
|
|
1106
1106
|
return /* @__PURE__ */ xe(
|
|
1107
1107
|
"li",
|
|
1108
|
-
|
|
1108
|
+
k(a({}, p), {
|
|
1109
1109
|
key: f.id,
|
|
1110
1110
|
"data-testid": c ? `${c}:option(${f.id.toString()})` : void 0
|
|
1111
1111
|
}),
|
|
@@ -1137,11 +1137,11 @@ function No({
|
|
|
1137
1137
|
}
|
|
1138
1138
|
]
|
|
1139
1139
|
},
|
|
1140
|
-
children: /* @__PURE__ */ o(
|
|
1140
|
+
children: /* @__PURE__ */ o(E, { style: { whiteSpace: "normal" }, children: p.chipLabel ? p.chipLabel : p.label })
|
|
1141
1141
|
}
|
|
1142
1142
|
),
|
|
1143
1143
|
"data-testid": c ? `${c}:Chip(${p.id.toString()})` : void 0,
|
|
1144
|
-
onDelete: (f) =>
|
|
1144
|
+
onDelete: (f) => S(f, p.id),
|
|
1145
1145
|
deleteIcon: /* @__PURE__ */ o(
|
|
1146
1146
|
Zt,
|
|
1147
1147
|
{
|
|
@@ -1154,7 +1154,7 @@ function No({
|
|
|
1154
1154
|
] });
|
|
1155
1155
|
}
|
|
1156
1156
|
const Lo = ({
|
|
1157
|
-
lookup: e = () =>
|
|
1157
|
+
lookup: e = () => N(void 0, null, function* () {
|
|
1158
1158
|
}),
|
|
1159
1159
|
onChange: t,
|
|
1160
1160
|
label: n,
|
|
@@ -1165,55 +1165,58 @@ const Lo = ({
|
|
|
1165
1165
|
"data-testid": d,
|
|
1166
1166
|
noOptionsText: l = "No options",
|
|
1167
1167
|
minLength: u = 3,
|
|
1168
|
-
disablePortal:
|
|
1168
|
+
disablePortal: w = !1,
|
|
1169
1169
|
preLoadedOptions: x,
|
|
1170
|
-
helperText:
|
|
1171
|
-
disabled: g
|
|
1170
|
+
helperText: A = "",
|
|
1171
|
+
disabled: g,
|
|
1172
|
+
popupIcon: y,
|
|
1173
|
+
disableIconFlip: b
|
|
1172
1174
|
}) => {
|
|
1173
|
-
const [D,
|
|
1175
|
+
const [D, I] = B(""), { data: O, isLoading: F } = kt({
|
|
1174
1176
|
inputValue: D,
|
|
1175
1177
|
label: n,
|
|
1176
1178
|
lookup: e,
|
|
1177
1179
|
minLength: u != null ? u : 0,
|
|
1178
1180
|
preLoadedOptions: x
|
|
1179
|
-
}),
|
|
1181
|
+
}), P = D.length >= u;
|
|
1180
1182
|
return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(Gt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
|
|
1181
1183
|
be,
|
|
1182
1184
|
{
|
|
1183
|
-
sx: r,
|
|
1185
|
+
sx: a(a({}, r), b ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
1184
1186
|
"data-testid": d ? `${d}:Autocomplete` : void 0,
|
|
1185
|
-
loading:
|
|
1186
|
-
options:
|
|
1187
|
-
onChange: (
|
|
1188
|
-
t(
|
|
1187
|
+
loading: P ? F : !1,
|
|
1188
|
+
options: O != null ? O : [],
|
|
1189
|
+
onChange: (S, v) => {
|
|
1190
|
+
t(S, v);
|
|
1189
1191
|
},
|
|
1190
|
-
disablePortal:
|
|
1191
|
-
filterOptions: (
|
|
1192
|
+
disablePortal: w,
|
|
1193
|
+
filterOptions: (S) => S,
|
|
1192
1194
|
value: i,
|
|
1193
|
-
noOptionsText:
|
|
1194
|
-
getOptionLabel: (
|
|
1195
|
-
|
|
1195
|
+
noOptionsText: P ? l : "Start typing to search",
|
|
1196
|
+
getOptionLabel: (S) => S.label,
|
|
1197
|
+
popupIcon: y,
|
|
1198
|
+
renderInput: (S) => /* @__PURE__ */ o(
|
|
1196
1199
|
Se,
|
|
1197
|
-
|
|
1200
|
+
k(a({
|
|
1198
1201
|
"data-testid": d ? `${d}:Autocomplete:TextField` : void 0
|
|
1199
|
-
},
|
|
1202
|
+
}, S), {
|
|
1200
1203
|
variant: c,
|
|
1201
1204
|
label: n,
|
|
1202
1205
|
color: s,
|
|
1203
|
-
helperText:
|
|
1206
|
+
helperText: A
|
|
1204
1207
|
})
|
|
1205
1208
|
),
|
|
1206
|
-
isOptionEqualToValue: (
|
|
1207
|
-
onInputChange: (
|
|
1208
|
-
|
|
1209
|
+
isOptionEqualToValue: (S, v) => S.id === v.id,
|
|
1210
|
+
onInputChange: (S, v) => {
|
|
1211
|
+
I(v);
|
|
1209
1212
|
},
|
|
1210
|
-
renderOption: (
|
|
1213
|
+
renderOption: (S, v) => /* @__PURE__ */ xe(
|
|
1211
1214
|
"li",
|
|
1212
|
-
|
|
1213
|
-
key:
|
|
1214
|
-
"data-testid": d ? `${d}:Autocomplete:option(${
|
|
1215
|
+
k(a({}, S), {
|
|
1216
|
+
key: v.id,
|
|
1217
|
+
"data-testid": d ? `${d}:Autocomplete:option(${v.id.toString()})` : void 0
|
|
1215
1218
|
}),
|
|
1216
|
-
|
|
1219
|
+
v.label
|
|
1217
1220
|
),
|
|
1218
1221
|
disabled: g
|
|
1219
1222
|
}
|
|
@@ -1236,15 +1239,15 @@ const Lo = ({
|
|
|
1236
1239
|
closeHandler: t,
|
|
1237
1240
|
setAuth0ExpiryTime: n
|
|
1238
1241
|
}) => {
|
|
1239
|
-
const { logout: i, getAccessTokenSilently: r } = ut(), [s, c] =
|
|
1242
|
+
const { logout: i, getAccessTokenSilently: r } = ut(), [s, c] = B(0), d = () => N(void 0, null, function* () {
|
|
1240
1243
|
i({ logoutParams: { returnTo: `${window.location.origin}` } });
|
|
1241
|
-
}), l = () =>
|
|
1244
|
+
}), l = () => N(void 0, null, function* () {
|
|
1242
1245
|
c(s + 1), t();
|
|
1243
1246
|
});
|
|
1244
1247
|
return ie(() => {
|
|
1245
|
-
(() =>
|
|
1248
|
+
(() => N(void 0, null, function* () {
|
|
1246
1249
|
if (s > 0) {
|
|
1247
|
-
const
|
|
1250
|
+
const A = yield r({ cacheMode: "off" }), g = zn(A) * 1e3;
|
|
1248
1251
|
n(g);
|
|
1249
1252
|
}
|
|
1250
1253
|
}))();
|
|
@@ -1307,11 +1310,11 @@ function Mo({
|
|
|
1307
1310
|
let d = "Auth error", l = "An unknown Auth0 error occurred.";
|
|
1308
1311
|
return Vn(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : qn(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : Gn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ h(je, { open: !0, children: [
|
|
1309
1312
|
/* @__PURE__ */ o(tt, { children: d }),
|
|
1310
|
-
/* @__PURE__ */ o(nt, { children: /* @__PURE__ */ o(
|
|
1313
|
+
/* @__PURE__ */ o(nt, { children: /* @__PURE__ */ o(E, { children: l }) }),
|
|
1311
1314
|
/* @__PURE__ */ o(ot, { children: /* @__PURE__ */ o(re, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
|
|
1312
1315
|
] });
|
|
1313
1316
|
}
|
|
1314
|
-
return n ? /* @__PURE__ */ o(
|
|
1317
|
+
return n ? /* @__PURE__ */ o(L, { children: e }) : /* @__PURE__ */ o(ln, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
1315
1318
|
}
|
|
1316
1319
|
const Xn = {
|
|
1317
1320
|
autoHideDuration: 6e3,
|
|
@@ -1347,62 +1350,62 @@ function eo(s) {
|
|
|
1347
1350
|
"children"
|
|
1348
1351
|
]);
|
|
1349
1352
|
var f;
|
|
1350
|
-
const [{ open: d }, l] =
|
|
1353
|
+
const [{ open: d }, l] = B({ open: !1 }), u = ge([]), w = ge(Date.now()), x = ge(0), A = oe((m) => {
|
|
1351
1354
|
l({ open: m });
|
|
1352
1355
|
}, []), g = oe((m = {}) => {
|
|
1353
|
-
x.current += 1, u.current.length >= Ve && Date.now() -
|
|
1356
|
+
x.current += 1, u.current.length >= Ve && Date.now() - w.current >= qe && (w.current = Date.now(), console.error(
|
|
1354
1357
|
`SaladBarProvider: MAX_QUEUE_LENGTH (${Ve}) hit ${x.current} times in last ${qe}ms)`
|
|
1355
1358
|
), x.current = 0);
|
|
1356
|
-
const C = a(
|
|
1359
|
+
const C = a(k(a({}, Ge), {
|
|
1357
1360
|
key: Kn()
|
|
1358
1361
|
}), m);
|
|
1359
1362
|
return u.current.push(C), u.current.length === 1 && l({ open: !0 }), C.key;
|
|
1360
|
-
}, []),
|
|
1361
|
-
const C = u.current.findIndex((
|
|
1363
|
+
}, []), y = (m = "", C = {}) => g(a({ message: m, severity: "success" }, C)), b = (m = "", C = {}) => g(a({ message: m, severity: "info" }, C)), D = (m = "", C = {}) => g(a({ message: m, severity: "warning" }, C)), I = (m = "", C = {}) => g(a({ message: m, severity: "error" }, C)), O = (m) => {
|
|
1364
|
+
const C = u.current.findIndex((M) => M.key === m);
|
|
1362
1365
|
if (C !== -1)
|
|
1363
1366
|
return C === 0 ? (l({ open: !1 }), u.current[0]) : u.current.splice(C, 1);
|
|
1364
|
-
},
|
|
1367
|
+
}, F = (m, C) => {
|
|
1365
1368
|
n(m, C) && l({ open: !1 });
|
|
1366
|
-
},
|
|
1367
|
-
},
|
|
1369
|
+
}, P = () => {
|
|
1370
|
+
}, S = () => {
|
|
1368
1371
|
u.current.shift(), u.current.length > 0 && l({ open: !0 });
|
|
1369
|
-
},
|
|
1370
|
-
"autoHideDuration" in
|
|
1372
|
+
}, v = (f = u.current[0]) != null ? f : a({}, Ge), H = {};
|
|
1373
|
+
"autoHideDuration" in v && (H.autoHideDuration = v.autoHideDuration);
|
|
1371
1374
|
const W = a(a({}, Xn), r), p = a(a({
|
|
1372
1375
|
open: d,
|
|
1373
|
-
setOpen:
|
|
1376
|
+
setOpen: A,
|
|
1374
1377
|
enqueueNotification: g,
|
|
1375
|
-
enqueueSuccessNotification:
|
|
1378
|
+
enqueueSuccessNotification: y,
|
|
1376
1379
|
enqueueInfoNotification: b,
|
|
1377
|
-
enqueueWarningNotification:
|
|
1380
|
+
enqueueWarningNotification: D,
|
|
1378
1381
|
enqueueErrorNotification: I,
|
|
1379
|
-
removeNotification:
|
|
1382
|
+
removeNotification: O
|
|
1380
1383
|
}, e), t);
|
|
1381
1384
|
return /* @__PURE__ */ h(Dt.Provider, { value: p, children: [
|
|
1382
1385
|
i,
|
|
1383
1386
|
/* @__PURE__ */ o(
|
|
1384
1387
|
Vt,
|
|
1385
|
-
|
|
1388
|
+
k(a(a({}, W), H), {
|
|
1386
1389
|
open: d,
|
|
1387
|
-
onClose:
|
|
1390
|
+
onClose: F,
|
|
1388
1391
|
TransitionProps: {
|
|
1389
|
-
onExited:
|
|
1390
|
-
onExit:
|
|
1392
|
+
onExited: S,
|
|
1393
|
+
onExit: P
|
|
1391
1394
|
},
|
|
1392
1395
|
sx: { zIndex: Yn },
|
|
1393
1396
|
children: /* @__PURE__ */ h("div", { children: [
|
|
1394
1397
|
/* @__PURE__ */ o(
|
|
1395
1398
|
qt,
|
|
1396
1399
|
{
|
|
1397
|
-
onClose: (m) =>
|
|
1398
|
-
severity:
|
|
1400
|
+
onClose: (m) => F(m, "closeAlert"),
|
|
1401
|
+
severity: v.severity,
|
|
1399
1402
|
variant: "filled",
|
|
1400
|
-
icon:
|
|
1401
|
-
style:
|
|
1402
|
-
children:
|
|
1403
|
+
icon: v.progressIndicator === "circular" ? /* @__PURE__ */ o(ke, { size: "1em" }) : void 0,
|
|
1404
|
+
style: v.progressIndicator === "linear" ? Jn : void 0,
|
|
1405
|
+
children: v.message
|
|
1403
1406
|
}
|
|
1404
1407
|
),
|
|
1405
|
-
|
|
1408
|
+
v.progressIndicator === "linear" && /* @__PURE__ */ o(et, { color: "primary" })
|
|
1406
1409
|
] })
|
|
1407
1410
|
})
|
|
1408
1411
|
)
|
|
@@ -1415,15 +1418,15 @@ function to() {
|
|
|
1415
1418
|
return e;
|
|
1416
1419
|
}
|
|
1417
1420
|
const Ro = X(
|
|
1418
|
-
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(eo,
|
|
1421
|
+
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(eo, k(a({}, e), { overrideState: t, overrideActions: n, children: i }))
|
|
1419
1422
|
), no = en(), Ho = ({
|
|
1420
1423
|
children: e,
|
|
1421
1424
|
store: t
|
|
1422
1425
|
}) => /* @__PURE__ */ o(ct, { store: t != null ? t : no, children: e }), yt = "domainCode";
|
|
1423
1426
|
var Qe;
|
|
1424
|
-
const Xe =
|
|
1427
|
+
const Xe = _(
|
|
1425
1428
|
JSON.parse((Qe = localStorage.getItem(yt)) != null ? Qe : '{"domainCode": ""}').domainCode
|
|
1426
|
-
), $t =
|
|
1429
|
+
), $t = _(
|
|
1427
1430
|
(e) => e(Xe),
|
|
1428
1431
|
(e, t, n) => {
|
|
1429
1432
|
t(Xe, n), localStorage.setItem(yt, JSON.stringify({ domainCode: n }));
|
|
@@ -1451,21 +1454,21 @@ const Xe = L(
|
|
|
1451
1454
|
applicationName: r,
|
|
1452
1455
|
handleLogout: s
|
|
1453
1456
|
}) => {
|
|
1454
|
-
const [c, d] = V($t), [l, u] =
|
|
1455
|
-
l ? (d(l),
|
|
1456
|
-
}), b = () =>
|
|
1457
|
-
c && !x && !
|
|
1457
|
+
const [c, d] = V($t), [l, u] = B(c), { enqueueSuccessNotification: w } = to(), x = i.length === 0, A = !!c && !i.includes(c) && !i.includes(l), g = !c || x || A, y = () => N(void 0, null, function* () {
|
|
1458
|
+
l ? (d(l), w(`Set domain to ${l}`), n()) : d("");
|
|
1459
|
+
}), b = () => N(void 0, null, function* () {
|
|
1460
|
+
c && !x && !A ? (u(c), n()) : g && s();
|
|
1458
1461
|
});
|
|
1459
|
-
let
|
|
1460
|
-
return x ?
|
|
1462
|
+
let D;
|
|
1463
|
+
return x ? D = "Unable to retrieve your active organisations. Try logging in again." : A && (D = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ h(
|
|
1461
1464
|
St,
|
|
1462
1465
|
{
|
|
1463
1466
|
isOpen: t,
|
|
1464
1467
|
dialogTitle: "Select an organisation",
|
|
1465
1468
|
primaryButton: {
|
|
1466
1469
|
text: "Confirm",
|
|
1467
|
-
onClick:
|
|
1468
|
-
disabled: !l || x ||
|
|
1470
|
+
onClick: y,
|
|
1471
|
+
disabled: !l || x || A,
|
|
1469
1472
|
buttonColor: "primary"
|
|
1470
1473
|
},
|
|
1471
1474
|
secondaryButton: {
|
|
@@ -1475,7 +1478,7 @@ const Xe = L(
|
|
|
1475
1478
|
onClose: g ? () => {
|
|
1476
1479
|
} : n,
|
|
1477
1480
|
children: [
|
|
1478
|
-
/* @__PURE__ */ h(
|
|
1481
|
+
/* @__PURE__ */ h(E, { marginBottom: 2, children: [
|
|
1479
1482
|
"Select the default organisation that you want to use with the ",
|
|
1480
1483
|
r,
|
|
1481
1484
|
"."
|
|
@@ -1487,16 +1490,16 @@ const Xe = L(
|
|
|
1487
1490
|
multiple: !1,
|
|
1488
1491
|
disableClearable: !1,
|
|
1489
1492
|
value: l !== "" ? l : null,
|
|
1490
|
-
onChange: (I,
|
|
1493
|
+
onChange: (I, O) => u(O != null ? O : ""),
|
|
1491
1494
|
getOptionLabel: io,
|
|
1492
1495
|
options: [...i],
|
|
1493
1496
|
renderInput: (I) => /* @__PURE__ */ o(
|
|
1494
1497
|
Se,
|
|
1495
|
-
|
|
1498
|
+
k(a({}, I), {
|
|
1496
1499
|
variant: "filled",
|
|
1497
1500
|
label: "Select organisation",
|
|
1498
|
-
InputProps:
|
|
1499
|
-
endAdornment: /* @__PURE__ */ h(
|
|
1501
|
+
InputProps: k(a({}, I.InputProps), {
|
|
1502
|
+
endAdornment: /* @__PURE__ */ h(L, { children: [
|
|
1500
1503
|
e ? /* @__PURE__ */ o(ke, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
|
|
1501
1504
|
I.InputProps.endAdornment
|
|
1502
1505
|
] })
|
|
@@ -1505,7 +1508,7 @@ const Xe = L(
|
|
|
1505
1508
|
)
|
|
1506
1509
|
}
|
|
1507
1510
|
),
|
|
1508
|
-
|
|
1511
|
+
D && /* @__PURE__ */ o(Xt, { error: !0, children: D })
|
|
1509
1512
|
]
|
|
1510
1513
|
}
|
|
1511
1514
|
);
|
|
@@ -1662,7 +1665,7 @@ const Xe = L(
|
|
|
1662
1665
|
}, Go = X(() => ({ children: e }) => /* @__PURE__ */ o(ct, { children: e })), ao = ({
|
|
1663
1666
|
initialValues: e,
|
|
1664
1667
|
children: t
|
|
1665
|
-
}) => (dt(e), /* @__PURE__ */ o(
|
|
1668
|
+
}) => (dt(e), /* @__PURE__ */ o(L, { children: t })), Vo = X(
|
|
1666
1669
|
(e) => ({ children: t }) => /* @__PURE__ */ o(
|
|
1667
1670
|
ao,
|
|
1668
1671
|
{
|