@australiangreens/ag-internal-components 0.0.82 → 0.0.84
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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/FetchAutocomplete/FetchAutocomplete.d.ts +2 -1
- package/dist/components/FetchAutocomplete/FetchAutocomplete.d.ts.map +1 -1
- package/dist/components/SingleAutocomplete/index.d.ts +3 -2
- package/dist/components/SingleAutocomplete/index.d.ts.map +1 -1
- package/dist/esm/index.js +376 -373
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
var Ft = Object.defineProperty, Pt = Object.defineProperties;
|
|
2
2
|
var Nt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var j = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var Te = Object.prototype.hasOwnProperty, Oe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var pe = (e, t, n) => t in e ? Ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, s = (e, t) => {
|
|
6
6
|
for (var n in t || (t = {}))
|
|
7
|
-
|
|
7
|
+
Te.call(t, n) && pe(e, n, t[n]);
|
|
8
8
|
if (j)
|
|
9
9
|
for (var n of j(t))
|
|
10
|
-
|
|
10
|
+
Oe.call(t, n) && pe(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
12
|
}, S = (e, t) => Pt(e, Nt(t));
|
|
13
|
-
var
|
|
13
|
+
var Ee = (e, t) => {
|
|
14
14
|
var n = {};
|
|
15
15
|
for (var i in e)
|
|
16
|
-
|
|
16
|
+
Te.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
|
|
17
17
|
if (e != null && j)
|
|
18
18
|
for (var i of j(e))
|
|
19
|
-
t.indexOf(i) < 0 &&
|
|
19
|
+
t.indexOf(i) < 0 && Oe.call(e, i) && (n[i] = e[i]);
|
|
20
20
|
return n;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
var
|
|
22
|
+
var Be = (e, t, n) => (pe(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
23
|
+
var P = (e, t, n) => new Promise((i, r) => {
|
|
24
24
|
var a = (l) => {
|
|
25
25
|
try {
|
|
26
26
|
d(n.next(l));
|
|
@@ -36,28 +36,28 @@ var F = (e, t, n) => new Promise((i, r) => {
|
|
|
36
36
|
}, d = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(a, c);
|
|
37
37
|
d((n = n.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { jsxs as p, Fragment as
|
|
40
|
-
import { useState as
|
|
41
|
-
import { Typography as
|
|
39
|
+
import { jsxs as p, Fragment as _, jsx as o } from "react/jsx-runtime";
|
|
40
|
+
import { useState as E, createContext as Qe, useCallback as ne, useContext as Ye, createElement as Ce, useEffect as oe, useRef as he } from "react";
|
|
41
|
+
import { Typography as F, Button as ie, Paper as Ke, Box as $, Drawer as ve, Dialog as Je, DialogTitle as Ze, DialogContent as je, DialogActions as et, Autocomplete as we, TextField as Ae, CircularProgress as be, Chip as Lt, Tooltip as _t, Stack as Mt, styled as Se, IconButton as Q, Container as tt, useTheme as ae, useMediaQuery as Rt, Collapse as Ht, Avatar as Fe, Fade as Wt, Skeleton as Pe, Toolbar as zt, Divider as Ne, CssBaseline as Ut, Snackbar as Gt, Alert as Vt, LinearProgress 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 nt, alpha as ge } from "@mui/material/styles";
|
|
44
44
|
import { AgError as Yt } from "@australiangreens/ag-error";
|
|
45
45
|
import { createHelper as K } from "souvlaki";
|
|
46
|
-
import
|
|
47
|
-
import { Cancel as Kt, ArrowDropDown as Jt, ArrowForward as
|
|
46
|
+
import ot from "@mui/material/List";
|
|
47
|
+
import { Cancel as Kt, ArrowDropDown as Jt, ArrowForward as it, ArrowBack as rt, ViewHeadline as Zt } from "@mui/icons-material";
|
|
48
48
|
import jt from "autosuggest-highlight/match";
|
|
49
49
|
import en from "autosuggest-highlight/parse";
|
|
50
50
|
import { useQuery as tn, QueryClient as nn, QueryClientProvider as on } from "@tanstack/react-query";
|
|
51
|
-
import { useAuth0 as
|
|
51
|
+
import { useAuth0 as at } from "@auth0/auth0-react";
|
|
52
52
|
import { Buffer as rn } from "buffer";
|
|
53
53
|
import an from "@mui/material/Skeleton";
|
|
54
|
-
import { atom as
|
|
55
|
-
import { useHydrateAtoms as
|
|
54
|
+
import { atom as M, useSetAtom as st, useAtomValue as Le, useAtom as V, getDefaultStore as sn, Provider as lt } from "jotai";
|
|
55
|
+
import { useHydrateAtoms as ct } from "jotai/utils";
|
|
56
56
|
function Do({ text: e }) {
|
|
57
|
-
const [t, n] =
|
|
58
|
-
return /* @__PURE__ */ p(
|
|
59
|
-
/* @__PURE__ */ o(
|
|
60
|
-
/* @__PURE__ */ o(
|
|
57
|
+
const [t, n] = E(0);
|
|
58
|
+
return /* @__PURE__ */ p(_, { children: [
|
|
59
|
+
/* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
60
|
+
/* @__PURE__ */ o(F, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
61
61
|
/* @__PURE__ */ o(
|
|
62
62
|
ie,
|
|
63
63
|
{
|
|
@@ -71,13 +71,13 @@ function Do({ text: e }) {
|
|
|
71
71
|
"This is some text: ",
|
|
72
72
|
/* @__PURE__ */ o("span", { children: e })
|
|
73
73
|
] }),
|
|
74
|
-
/* @__PURE__ */ p(
|
|
74
|
+
/* @__PURE__ */ p(Ke, { children: [
|
|
75
75
|
"This number will incremember when button pressed: ",
|
|
76
76
|
t
|
|
77
77
|
] })
|
|
78
78
|
] });
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const dt = 330, ut = 73, U = "Navbar", q = {
|
|
81
81
|
root: `${U}-root`,
|
|
82
82
|
menuButton: `${U}-menuButton`,
|
|
83
83
|
hide: `${U}-hide`,
|
|
@@ -85,7 +85,7 @@ const ct = 330, dt = 73, U = "Navbar", q = {
|
|
|
85
85
|
userInfoHolder: `${U}-userInfoHolder`,
|
|
86
86
|
settings: `${U}-settings`,
|
|
87
87
|
pieChartIcon: `${U}-pieChartIcon`
|
|
88
|
-
}, ln =
|
|
88
|
+
}, ln = R($, {
|
|
89
89
|
name: "NavBar"
|
|
90
90
|
})(({ theme: e }) => ({
|
|
91
91
|
[`&.${q.root}`]: {
|
|
@@ -106,7 +106,7 @@ const ct = 330, dt = 73, U = "Navbar", q = {
|
|
|
106
106
|
marginTop: "64px",
|
|
107
107
|
marginBottom: "16px"
|
|
108
108
|
}
|
|
109
|
-
})),
|
|
109
|
+
})), pt = () => ({
|
|
110
110
|
position: "absolute",
|
|
111
111
|
height: "100%",
|
|
112
112
|
overflowX: "hidden",
|
|
@@ -115,13 +115,13 @@ const ct = 330, dt = 73, U = "Navbar", q = {
|
|
|
115
115
|
backgroundColor: "black"
|
|
116
116
|
// backgroundColor: '#e8e8e8',
|
|
117
117
|
}), cn = () => s({
|
|
118
|
-
width: ct
|
|
119
|
-
}, ut()), dn = () => s({
|
|
120
118
|
width: dt
|
|
121
|
-
},
|
|
119
|
+
}, pt()), dn = () => s({
|
|
120
|
+
width: ut
|
|
121
|
+
}, pt()), un = R(ve, {
|
|
122
122
|
shouldForwardProp: (e) => e !== "open"
|
|
123
123
|
})(({ theme: e, open: t }) => s(s({
|
|
124
|
-
width: t ?
|
|
124
|
+
width: t ? dt : ut,
|
|
125
125
|
flexShrink: 0,
|
|
126
126
|
whiteSpace: "nowrap",
|
|
127
127
|
boxSizing: "border-box",
|
|
@@ -131,15 +131,15 @@ const ct = 330, dt = 73, U = "Navbar", q = {
|
|
|
131
131
|
}), !t && {
|
|
132
132
|
"& .MuiDrawer-paper": dn()
|
|
133
133
|
}));
|
|
134
|
-
class
|
|
134
|
+
class ke extends Yt {
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
const
|
|
136
|
+
Be(ke, "errorName", "ContextError");
|
|
137
|
+
const ht = Qe(null), pn = {}, hn = {}, gn = ({
|
|
138
138
|
overrideState: e = pn,
|
|
139
139
|
overrideActions: t = hn,
|
|
140
140
|
children: n
|
|
141
141
|
}) => {
|
|
142
|
-
const [{ open: i }, r] =
|
|
142
|
+
const [{ open: i }, r] = E({ open: !0 }), a = ne((l) => {
|
|
143
143
|
r({ open: l });
|
|
144
144
|
}, []), c = ne(() => {
|
|
145
145
|
r((l) => S(s({}, l), { open: !l.open }));
|
|
@@ -148,17 +148,17 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
|
|
|
148
148
|
setOpen: a,
|
|
149
149
|
toggleOpen: c
|
|
150
150
|
}, e), t);
|
|
151
|
-
return /* @__PURE__ */ o(
|
|
151
|
+
return /* @__PURE__ */ o(ht.Provider, { value: d, children: n });
|
|
152
152
|
}, fn = () => {
|
|
153
|
-
const e =
|
|
153
|
+
const e = Ye(ht);
|
|
154
154
|
if (e === null)
|
|
155
|
-
throw new
|
|
155
|
+
throw new ke("Error: Tried to useNavBar outside of a <NavBarProvider>");
|
|
156
156
|
return e;
|
|
157
157
|
}, mn = (e = {}) => s({
|
|
158
158
|
open: !0
|
|
159
159
|
}, e), yo = K(
|
|
160
160
|
(e = mn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(gn, { overrideState: e, overrideActions: t, children: n })
|
|
161
|
-
),
|
|
161
|
+
), _e = 7, $o = R(ot)(({ theme: e }) => ({
|
|
162
162
|
backgroundColor: "black",
|
|
163
163
|
color: "white",
|
|
164
164
|
"& .MuiListItem-root": {
|
|
@@ -167,7 +167,7 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
|
|
|
167
167
|
"& .MuiListItemButton-root": {
|
|
168
168
|
" .MuiListItemIcon-root": {
|
|
169
169
|
color: "white",
|
|
170
|
-
padding: `${
|
|
170
|
+
padding: `${_e}px`
|
|
171
171
|
},
|
|
172
172
|
// Focus state
|
|
173
173
|
"&.Mui-focusVisible": {
|
|
@@ -178,7 +178,7 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
|
|
|
178
178
|
borderLeftStyle: "solid",
|
|
179
179
|
borderLeftWidth: "7px",
|
|
180
180
|
borderLeftColor: e.palette.primary.main,
|
|
181
|
-
paddingLeft: `calc(${e.spacing(2)} - ${
|
|
181
|
+
paddingLeft: `calc(${e.spacing(2)} - ${_e}px)`
|
|
182
182
|
},
|
|
183
183
|
// Hover state
|
|
184
184
|
"&:hover": {
|
|
@@ -196,7 +196,7 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
|
|
|
196
196
|
// '&.Mui-selected.Mui-focusVisible:hover': {
|
|
197
197
|
// },
|
|
198
198
|
}
|
|
199
|
-
})),
|
|
199
|
+
})), Me = 7, Io = R(ot)(({ theme: e }) => ({
|
|
200
200
|
backgroundColor: "#e8e8e8",
|
|
201
201
|
color: "inherit",
|
|
202
202
|
"& .MuiListItem-root": {
|
|
@@ -205,7 +205,7 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
|
|
|
205
205
|
"& .MuiListItemButton-root": {
|
|
206
206
|
" .MuiListItemIcon-root": {
|
|
207
207
|
color: "inherit",
|
|
208
|
-
padding: `${
|
|
208
|
+
padding: `${Me}px`
|
|
209
209
|
},
|
|
210
210
|
// Focus state
|
|
211
211
|
"&.Mui-focusVisible": {
|
|
@@ -216,7 +216,7 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
|
|
|
216
216
|
borderLeftStyle: "solid",
|
|
217
217
|
borderLeftWidth: "7px",
|
|
218
218
|
borderLeftColor: e.palette.primary.main,
|
|
219
|
-
paddingLeft: `calc(${e.spacing(2)} - ${
|
|
219
|
+
paddingLeft: `calc(${e.spacing(2)} - ${Me}px)`
|
|
220
220
|
},
|
|
221
221
|
// Hover state
|
|
222
222
|
"&:hover": {
|
|
@@ -254,7 +254,7 @@ function To({
|
|
|
254
254
|
)
|
|
255
255
|
] });
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const gt = ({
|
|
258
258
|
isOpen: e,
|
|
259
259
|
dialogTitle: t,
|
|
260
260
|
children: n,
|
|
@@ -266,27 +266,27 @@ const ht = ({
|
|
|
266
266
|
"data-testid": l,
|
|
267
267
|
disableCloseOnBackdropOrEscape: u = !1
|
|
268
268
|
}) => {
|
|
269
|
-
var
|
|
270
|
-
const [C,
|
|
269
|
+
var A, g;
|
|
270
|
+
const [C, x] = E(!1);
|
|
271
271
|
return /* @__PURE__ */ p(
|
|
272
|
-
|
|
272
|
+
Je,
|
|
273
273
|
{
|
|
274
274
|
open: e,
|
|
275
|
-
onClose: (
|
|
276
|
-
u && (
|
|
275
|
+
onClose: (k, b) => P(void 0, null, function* () {
|
|
276
|
+
u && (b === "backdropClick" || b === "escapeKeyDown") || C || (a != null && a.onClick ? yield a.onClick() : c());
|
|
277
277
|
}),
|
|
278
278
|
fullWidth: !0,
|
|
279
279
|
maxWidth: i != null ? i : "xs",
|
|
280
280
|
"data-testid": l,
|
|
281
281
|
sx: d,
|
|
282
282
|
children: [
|
|
283
|
-
/* @__PURE__ */ o(
|
|
284
|
-
/* @__PURE__ */ o(
|
|
285
|
-
/* @__PURE__ */ p(
|
|
283
|
+
/* @__PURE__ */ o(Ze, { children: t }),
|
|
284
|
+
/* @__PURE__ */ o(je, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
|
|
285
|
+
/* @__PURE__ */ p(et, { children: [
|
|
286
286
|
/* @__PURE__ */ o(
|
|
287
287
|
ie,
|
|
288
288
|
{
|
|
289
|
-
onClick: (
|
|
289
|
+
onClick: (A = a == null ? void 0 : a.onClick) != null ? A : c,
|
|
290
290
|
"data-testid": a == null ? void 0 : a.testId,
|
|
291
291
|
disabled: (a == null ? void 0 : a.disabled) || C,
|
|
292
292
|
color: a == null ? void 0 : a.buttonColor,
|
|
@@ -296,9 +296,9 @@ const ht = ({
|
|
|
296
296
|
r && /* @__PURE__ */ o(
|
|
297
297
|
ie,
|
|
298
298
|
{
|
|
299
|
-
onClick: () =>
|
|
300
|
-
var
|
|
301
|
-
|
|
299
|
+
onClick: () => P(void 0, null, function* () {
|
|
300
|
+
var k;
|
|
301
|
+
x(!0), yield (k = r.onClick) == null ? void 0 : k.call(r), x(!1);
|
|
302
302
|
}),
|
|
303
303
|
"data-testid": r.testId,
|
|
304
304
|
disabled: r.disabled || C,
|
|
@@ -310,7 +310,7 @@ const ht = ({
|
|
|
310
310
|
]
|
|
311
311
|
}
|
|
312
312
|
);
|
|
313
|
-
},
|
|
313
|
+
}, ft = ({
|
|
314
314
|
minLength: e,
|
|
315
315
|
preLoadedOptions: t,
|
|
316
316
|
lookup: n,
|
|
@@ -323,7 +323,7 @@ const ht = ({
|
|
|
323
323
|
queryKey: ["autocomplete", i, r]
|
|
324
324
|
});
|
|
325
325
|
function Oo({
|
|
326
|
-
lookup: e = () =>
|
|
326
|
+
lookup: e = () => P(this, null, function* () {
|
|
327
327
|
}),
|
|
328
328
|
enableHighlighting: t = !0,
|
|
329
329
|
onChange: n,
|
|
@@ -332,106 +332,107 @@ function Oo({
|
|
|
332
332
|
value: a,
|
|
333
333
|
"data-testid": c,
|
|
334
334
|
sx: d,
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
335
|
+
boxSx: l,
|
|
336
|
+
textFieldColor: u,
|
|
337
|
+
textFieldVariant: C = "filled",
|
|
338
|
+
loadingText: x = "Loading...",
|
|
339
|
+
noOptionsText: A = "No options",
|
|
340
|
+
popupIcon: g = /* @__PURE__ */ o(Jt, {}),
|
|
341
|
+
error: k = !1,
|
|
341
342
|
helperText: b = "",
|
|
342
|
-
preLoadedOptions:
|
|
343
|
-
disablePortal:
|
|
343
|
+
preLoadedOptions: I = void 0,
|
|
344
|
+
disablePortal: y = !1
|
|
344
345
|
}) {
|
|
345
|
-
const [
|
|
346
|
-
const
|
|
347
|
-
n(
|
|
348
|
-
}, { data:
|
|
349
|
-
inputValue:
|
|
346
|
+
const [v, D] = E(""), H = (h, f) => {
|
|
347
|
+
const B = a.filter((m) => m.id !== f);
|
|
348
|
+
n(B, "delete", h);
|
|
349
|
+
}, { data: N, isLoading: T } = ft({
|
|
350
|
+
inputValue: v,
|
|
350
351
|
label: r,
|
|
351
352
|
lookup: e,
|
|
352
353
|
minLength: i,
|
|
353
|
-
preLoadedOptions:
|
|
354
|
-
}),
|
|
354
|
+
preLoadedOptions: I
|
|
355
|
+
}), W = v.length >= i;
|
|
355
356
|
return /* @__PURE__ */ p("div", { "data-testid": c, children: [
|
|
356
357
|
/* @__PURE__ */ o(
|
|
357
|
-
|
|
358
|
+
we,
|
|
358
359
|
{
|
|
359
360
|
sx: d,
|
|
360
361
|
"data-testid": c ? `${c}:Autocomplete` : void 0,
|
|
361
|
-
disablePortal:
|
|
362
|
+
disablePortal: y,
|
|
362
363
|
multiple: !0,
|
|
363
364
|
getOptionLabel: (h) => typeof h == "string" ? h : h.label,
|
|
364
|
-
loading:
|
|
365
|
-
options: [...a, ...
|
|
365
|
+
loading: W ? T : !1,
|
|
366
|
+
options: [...a, ...N != null ? N : []],
|
|
366
367
|
filterSelectedOptions: !0,
|
|
367
368
|
includeInputInList: !0,
|
|
368
369
|
value: a,
|
|
369
|
-
onChange: (h,
|
|
370
|
-
n(
|
|
370
|
+
onChange: (h, f, B) => {
|
|
371
|
+
n(f, B, h);
|
|
371
372
|
},
|
|
372
|
-
onInputChange: (h,
|
|
373
|
-
noOptionsText:
|
|
374
|
-
loadingText:
|
|
375
|
-
popupIcon:
|
|
373
|
+
onInputChange: (h, f) => D(f),
|
|
374
|
+
noOptionsText: W ? A : "Start typing to search",
|
|
375
|
+
loadingText: x,
|
|
376
|
+
popupIcon: g,
|
|
376
377
|
renderInput: (h) => /* @__PURE__ */ o(
|
|
377
|
-
|
|
378
|
+
Ae,
|
|
378
379
|
S(s({}, h), {
|
|
379
380
|
label: r,
|
|
380
381
|
fullWidth: !0,
|
|
381
|
-
variant:
|
|
382
|
-
error:
|
|
382
|
+
variant: C,
|
|
383
|
+
error: k,
|
|
383
384
|
helperText: b,
|
|
384
385
|
InputProps: S(s({}, h.InputProps), {
|
|
385
|
-
endAdornment: /* @__PURE__ */ p(
|
|
386
|
-
|
|
386
|
+
endAdornment: /* @__PURE__ */ p(_, { children: [
|
|
387
|
+
T ? /* @__PURE__ */ o(be, { color: "inherit", size: 20 }) : null,
|
|
387
388
|
h.InputProps.endAdornment
|
|
388
389
|
] })
|
|
389
390
|
}),
|
|
390
391
|
"data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
|
|
391
|
-
onKeyDown: (
|
|
392
|
-
(
|
|
392
|
+
onKeyDown: (f) => {
|
|
393
|
+
(f.key === "Backspace" || f.key === "Delete") && f.stopPropagation();
|
|
393
394
|
},
|
|
394
|
-
color:
|
|
395
|
+
color: u
|
|
395
396
|
})
|
|
396
397
|
),
|
|
397
398
|
renderTags: () => null,
|
|
398
|
-
isOptionEqualToValue: (h,
|
|
399
|
-
renderOption: (h,
|
|
399
|
+
isOptionEqualToValue: (h, f) => h.id === f.id,
|
|
400
|
+
renderOption: (h, f, B) => {
|
|
400
401
|
if (t) {
|
|
401
|
-
const
|
|
402
|
+
const m = jt(f.label, B.inputValue, {
|
|
402
403
|
insideWords: !0,
|
|
403
404
|
findAllOccurrences: !0
|
|
404
|
-
}),
|
|
405
|
-
return /* @__PURE__ */
|
|
405
|
+
}), w = en(f.label, m);
|
|
406
|
+
return /* @__PURE__ */ Ce(
|
|
406
407
|
"li",
|
|
407
408
|
S(s({}, h), {
|
|
408
|
-
key:
|
|
409
|
-
"data-testid": c ? `${c}:Autocomplete:option(${
|
|
409
|
+
key: f.id,
|
|
410
|
+
"data-testid": c ? `${c}:Autocomplete:option(${f.id.toString()})` : void 0
|
|
410
411
|
}),
|
|
411
|
-
/* @__PURE__ */ o("div", { children:
|
|
412
|
+
/* @__PURE__ */ o("div", { children: w.map((L, se) => /* @__PURE__ */ o(
|
|
412
413
|
"span",
|
|
413
414
|
{
|
|
414
415
|
style: {
|
|
415
|
-
fontWeight:
|
|
416
|
+
fontWeight: L.highlight ? 700 : 400
|
|
416
417
|
},
|
|
417
|
-
children:
|
|
418
|
+
children: L.text
|
|
418
419
|
},
|
|
419
|
-
|
|
420
|
+
se
|
|
420
421
|
)) })
|
|
421
422
|
);
|
|
422
423
|
} else
|
|
423
|
-
return /* @__PURE__ */
|
|
424
|
+
return /* @__PURE__ */ Ce(
|
|
424
425
|
"li",
|
|
425
426
|
S(s({}, h), {
|
|
426
|
-
key:
|
|
427
|
-
"data-testid": c ? `${c}:option(${
|
|
427
|
+
key: f.id,
|
|
428
|
+
"data-testid": c ? `${c}:option(${f.id.toString()})` : void 0
|
|
428
429
|
}),
|
|
429
|
-
|
|
430
|
+
f.label
|
|
430
431
|
);
|
|
431
432
|
}
|
|
432
433
|
}
|
|
433
434
|
),
|
|
434
|
-
a.length > 0 && /* @__PURE__ */ o(
|
|
435
|
+
a.length > 0 && /* @__PURE__ */ o($, { sx: l, children: a.map((h) => /* @__PURE__ */ o(
|
|
435
436
|
Lt,
|
|
436
437
|
{
|
|
437
438
|
sx: {
|
|
@@ -454,11 +455,11 @@ function Oo({
|
|
|
454
455
|
}
|
|
455
456
|
]
|
|
456
457
|
},
|
|
457
|
-
children: /* @__PURE__ */ o(
|
|
458
|
+
children: /* @__PURE__ */ o(F, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
|
|
458
459
|
}
|
|
459
460
|
),
|
|
460
461
|
"data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
|
|
461
|
-
onDelete: (
|
|
462
|
+
onDelete: (f) => H(f, h.id),
|
|
462
463
|
deleteIcon: /* @__PURE__ */ o(
|
|
463
464
|
Kt,
|
|
464
465
|
{
|
|
@@ -471,7 +472,7 @@ function Oo({
|
|
|
471
472
|
] });
|
|
472
473
|
}
|
|
473
474
|
const Eo = ({
|
|
474
|
-
lookup: e = () =>
|
|
475
|
+
lookup: e = () => P(void 0, null, function* () {
|
|
475
476
|
}),
|
|
476
477
|
onChange: t,
|
|
477
478
|
label: n,
|
|
@@ -483,47 +484,49 @@ const Eo = ({
|
|
|
483
484
|
noOptionsText: l = "No options",
|
|
484
485
|
minLength: u = 3,
|
|
485
486
|
disablePortal: C = !1,
|
|
486
|
-
preLoadedOptions:
|
|
487
|
+
preLoadedOptions: x,
|
|
488
|
+
helperText: A = ""
|
|
487
489
|
}) => {
|
|
488
|
-
const [
|
|
489
|
-
inputValue:
|
|
490
|
+
const [g, k] = E(""), { data: b, isLoading: I } = ft({
|
|
491
|
+
inputValue: g,
|
|
490
492
|
label: n,
|
|
491
493
|
lookup: e,
|
|
492
494
|
minLength: u != null ? u : 0,
|
|
493
|
-
preLoadedOptions:
|
|
494
|
-
}),
|
|
495
|
+
preLoadedOptions: x
|
|
496
|
+
}), y = g.length >= u;
|
|
495
497
|
return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(Mt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
|
|
496
|
-
|
|
498
|
+
we,
|
|
497
499
|
{
|
|
498
500
|
sx: r,
|
|
499
501
|
"data-testid": d ? `${d}:Autocomplete` : void 0,
|
|
500
|
-
loading:
|
|
502
|
+
loading: y ? I : !1,
|
|
501
503
|
options: b != null ? b : [],
|
|
502
|
-
onChange: (
|
|
503
|
-
t(
|
|
504
|
+
onChange: (v, D) => {
|
|
505
|
+
t(v, D);
|
|
504
506
|
},
|
|
505
507
|
disablePortal: C,
|
|
506
|
-
filterOptions: (
|
|
508
|
+
filterOptions: (v) => v,
|
|
507
509
|
value: i,
|
|
508
|
-
noOptionsText:
|
|
509
|
-
getOptionLabel: (
|
|
510
|
-
renderInput: (
|
|
511
|
-
|
|
510
|
+
noOptionsText: y ? l : "Start typing to search",
|
|
511
|
+
getOptionLabel: (v) => v.label,
|
|
512
|
+
renderInput: (v) => /* @__PURE__ */ o(
|
|
513
|
+
Ae,
|
|
512
514
|
S(s({
|
|
513
515
|
"data-testid": d ? `${d}:Autocomplete:TextField` : void 0
|
|
514
|
-
},
|
|
516
|
+
}, v), {
|
|
515
517
|
variant: c,
|
|
516
518
|
label: n,
|
|
517
|
-
color: a
|
|
519
|
+
color: a,
|
|
520
|
+
helperText: A
|
|
518
521
|
})
|
|
519
522
|
),
|
|
520
|
-
isOptionEqualToValue: (
|
|
521
|
-
onInputChange: (
|
|
522
|
-
|
|
523
|
+
isOptionEqualToValue: (v, D) => v.id === D.id,
|
|
524
|
+
onInputChange: (v, D) => {
|
|
525
|
+
k(D);
|
|
523
526
|
},
|
|
524
|
-
renderOption: (
|
|
527
|
+
renderOption: (v, D) => /* @__PURE__ */ Ce(
|
|
525
528
|
"li",
|
|
526
|
-
S(s({},
|
|
529
|
+
S(s({}, v), {
|
|
527
530
|
key: D.id,
|
|
528
531
|
"data-testid": d ? `${d}:Autocomplete:option(${D.id.toString()})` : void 0
|
|
529
532
|
}),
|
|
@@ -549,20 +552,20 @@ const Eo = ({
|
|
|
549
552
|
closeHandler: t,
|
|
550
553
|
setAuth0ExpiryTime: n
|
|
551
554
|
}) => {
|
|
552
|
-
const { logout: i, getAccessTokenSilently: r } =
|
|
555
|
+
const { logout: i, getAccessTokenSilently: r } = at(), [a, c] = E(0), d = () => P(void 0, null, function* () {
|
|
553
556
|
i({ logoutParams: { returnTo: `${window.location.origin}` } });
|
|
554
|
-
}), l = () =>
|
|
557
|
+
}), l = () => P(void 0, null, function* () {
|
|
555
558
|
c(a + 1), t();
|
|
556
559
|
});
|
|
557
560
|
return oe(() => {
|
|
558
|
-
(() =>
|
|
561
|
+
(() => P(void 0, null, function* () {
|
|
559
562
|
if (a > 0) {
|
|
560
|
-
const
|
|
563
|
+
const A = yield r({ cacheMode: "off" }), g = Cn(A) * 1e3;
|
|
561
564
|
n(g);
|
|
562
565
|
}
|
|
563
566
|
}))();
|
|
564
567
|
}, [a, r, n]), /* @__PURE__ */ o(
|
|
565
|
-
|
|
568
|
+
gt,
|
|
566
569
|
{
|
|
567
570
|
isOpen: e,
|
|
568
571
|
primaryButton: {
|
|
@@ -606,7 +609,7 @@ function Fo({
|
|
|
606
609
|
children: e,
|
|
607
610
|
appName: t = "the app"
|
|
608
611
|
}) {
|
|
609
|
-
const { isAuthenticated: n, isLoading: i, error: r, loginWithRedirect: a, logout: c } =
|
|
612
|
+
const { isAuthenticated: n, isLoading: i, error: r, loginWithRedirect: a, logout: c } = at();
|
|
610
613
|
if (oe(() => {
|
|
611
614
|
if (i || n || r)
|
|
612
615
|
return;
|
|
@@ -618,40 +621,40 @@ function Fo({
|
|
|
618
621
|
a(d);
|
|
619
622
|
}, [i, n, r, a]), r && xn(r)) {
|
|
620
623
|
let d = "Auth error", l = "An unknown Auth0 error occurred.";
|
|
621
|
-
return wn(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : An(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : vn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ p(
|
|
622
|
-
/* @__PURE__ */ o(
|
|
623
|
-
/* @__PURE__ */ o(
|
|
624
|
-
/* @__PURE__ */ o(
|
|
624
|
+
return wn(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : An(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : vn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ p(Je, { open: !0, children: [
|
|
625
|
+
/* @__PURE__ */ o(Ze, { children: d }),
|
|
626
|
+
/* @__PURE__ */ o(je, { children: /* @__PURE__ */ o(F, { children: l }) }),
|
|
627
|
+
/* @__PURE__ */ o(et, { children: /* @__PURE__ */ o(ie, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
|
|
625
628
|
] });
|
|
626
629
|
}
|
|
627
|
-
return n ? /* @__PURE__ */ o(
|
|
630
|
+
return n ? /* @__PURE__ */ o(_, { children: e }) : /* @__PURE__ */ o(an, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
628
631
|
}
|
|
629
|
-
const bn = 24, Sn = 64, G = "TopBar",
|
|
632
|
+
const bn = 24, Sn = 64, G = "TopBar", O = {
|
|
630
633
|
topStripe: `${G}-topStripe`,
|
|
631
634
|
titleBar: `${G}-titleBar`,
|
|
632
635
|
titleSlider: `${G}-titleSlider`,
|
|
633
636
|
titleText: `${G}-titleText`,
|
|
634
637
|
leftPanelButton: `${G}-leftPanelButton`,
|
|
635
638
|
rightPanelButton: `${G}-leftPanelButton`
|
|
636
|
-
}, kn =
|
|
639
|
+
}, kn = Se("div", {
|
|
637
640
|
shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
|
|
638
641
|
name: G
|
|
639
642
|
})(({ theme: e, leftPanel: t, rightPanel: n }) => {
|
|
640
643
|
var i, r;
|
|
641
644
|
return {
|
|
642
645
|
width: "100%",
|
|
643
|
-
[`& .${
|
|
646
|
+
[`& .${O.topStripe}`]: {
|
|
644
647
|
width: "100%",
|
|
645
648
|
height: `${bn}px`,
|
|
646
649
|
backgroundColor: e.palette.primary.main
|
|
647
650
|
},
|
|
648
|
-
[`& .${
|
|
651
|
+
[`& .${O.titleBar}`]: {
|
|
649
652
|
backgroundColor: e.palette.primary.light,
|
|
650
653
|
height: `${Sn}px`,
|
|
651
654
|
padding: e.spacing(0, 3),
|
|
652
655
|
width: "100%"
|
|
653
656
|
},
|
|
654
|
-
[`& .${
|
|
657
|
+
[`& .${O.titleSlider}`]: s(s({
|
|
655
658
|
height: "100%",
|
|
656
659
|
display: "flex",
|
|
657
660
|
alignItems: "center",
|
|
@@ -660,14 +663,14 @@ const bn = 24, Sn = 64, G = "TopBar", T = {
|
|
|
660
663
|
easing: e.transitions.easing.sharp,
|
|
661
664
|
duration: e.transitions.duration.leavingScreen
|
|
662
665
|
}),
|
|
663
|
-
[`& .${
|
|
666
|
+
[`& .${O.leftPanelButton}`]: {
|
|
664
667
|
marginRight: e.spacing(2),
|
|
665
668
|
flexGrow: 0
|
|
666
669
|
},
|
|
667
|
-
[`& .${
|
|
670
|
+
[`& .${O.titleText}`]: {
|
|
668
671
|
flexGrow: 1
|
|
669
672
|
},
|
|
670
|
-
[`& .${
|
|
673
|
+
[`& .${O.rightPanelButton}`]: {
|
|
671
674
|
flexGrow: 0
|
|
672
675
|
}
|
|
673
676
|
}, (t == null ? void 0 : t.open) && {
|
|
@@ -692,12 +695,12 @@ function Dn({
|
|
|
692
695
|
"data-testid": i
|
|
693
696
|
}) {
|
|
694
697
|
return /* @__PURE__ */ p(kn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
|
|
695
|
-
/* @__PURE__ */ o("div", { className:
|
|
696
|
-
/* @__PURE__ */ o("div", { className:
|
|
698
|
+
/* @__PURE__ */ o("div", { className: O.topStripe }),
|
|
699
|
+
/* @__PURE__ */ o("div", { className: O.titleBar, children: /* @__PURE__ */ p($, { className: O.titleSlider, children: [
|
|
697
700
|
t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ p(
|
|
698
701
|
Q,
|
|
699
702
|
{
|
|
700
|
-
className:
|
|
703
|
+
className: O.leftPanelButton,
|
|
701
704
|
color: "inherit",
|
|
702
705
|
"aria-label": "Open left side panel",
|
|
703
706
|
onClick: t == null ? void 0 : t.onOpen,
|
|
@@ -705,15 +708,15 @@ function Dn({
|
|
|
705
708
|
size: "large",
|
|
706
709
|
children: [
|
|
707
710
|
" ",
|
|
708
|
-
/* @__PURE__ */ o(
|
|
711
|
+
/* @__PURE__ */ o(it, {})
|
|
709
712
|
]
|
|
710
713
|
}
|
|
711
714
|
),
|
|
712
|
-
/* @__PURE__ */ o(
|
|
715
|
+
/* @__PURE__ */ o(F, { className: O.titleText, variant: "h6", noWrap: !0, children: e }),
|
|
713
716
|
n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ p(
|
|
714
717
|
Q,
|
|
715
718
|
{
|
|
716
|
-
className:
|
|
719
|
+
className: O.rightPanelButton,
|
|
717
720
|
color: "inherit",
|
|
718
721
|
"aria-label": "Open right side panel",
|
|
719
722
|
onClick: n == null ? void 0 : n.onOpen,
|
|
@@ -721,14 +724,14 @@ function Dn({
|
|
|
721
724
|
size: "large",
|
|
722
725
|
children: [
|
|
723
726
|
" ",
|
|
724
|
-
/* @__PURE__ */ o(
|
|
727
|
+
/* @__PURE__ */ o(rt, {})
|
|
725
728
|
]
|
|
726
729
|
}
|
|
727
730
|
)
|
|
728
731
|
] }) })
|
|
729
732
|
] });
|
|
730
733
|
}
|
|
731
|
-
const
|
|
734
|
+
const mt = 400, yn = Se(ve, {
|
|
732
735
|
shouldForwardProp: (e) => (
|
|
733
736
|
// Note we do want anchor to be forwarded to the Drawer component
|
|
734
737
|
![
|
|
@@ -758,7 +761,7 @@ const ft = 400, yn = be(xe, {
|
|
|
758
761
|
marginLeft: `${r}px`
|
|
759
762
|
}))
|
|
760
763
|
})
|
|
761
|
-
), $n =
|
|
764
|
+
), $n = Se($, {
|
|
762
765
|
shouldForwardProp: (e) => !["anchor"].includes(e)
|
|
763
766
|
})(({ theme: e, anchor: t }) => S(s({
|
|
764
767
|
display: "flex",
|
|
@@ -778,23 +781,23 @@ const ft = 400, yn = be(xe, {
|
|
|
778
781
|
marginRight: t === "right" ? e.spacing(2) : 0
|
|
779
782
|
}
|
|
780
783
|
}));
|
|
781
|
-
function
|
|
784
|
+
function Re({
|
|
782
785
|
children: e,
|
|
783
786
|
anchor: t = "left",
|
|
784
787
|
open: n,
|
|
785
788
|
onClose: i = () => {
|
|
786
789
|
},
|
|
787
790
|
titleText: r = "",
|
|
788
|
-
width: a =
|
|
791
|
+
width: a = mt,
|
|
789
792
|
showCloseArrow: c = !0,
|
|
790
793
|
debugOpacity: d = !1,
|
|
791
794
|
headerBoxProps: l = {},
|
|
792
795
|
onOpened: u,
|
|
793
796
|
onClosed: C,
|
|
794
|
-
"data-testid":
|
|
795
|
-
navBarOpen:
|
|
797
|
+
"data-testid": x,
|
|
798
|
+
navBarOpen: A = !1,
|
|
796
799
|
navBarWidthOpen: g = 0,
|
|
797
|
-
navBarWidthClosed:
|
|
800
|
+
navBarWidthClosed: k = 0
|
|
798
801
|
}) {
|
|
799
802
|
return /* @__PURE__ */ p(
|
|
800
803
|
yn,
|
|
@@ -808,30 +811,30 @@ function Me({
|
|
|
808
811
|
open: n,
|
|
809
812
|
width: a,
|
|
810
813
|
debugOpacity: d,
|
|
811
|
-
"data-testid":
|
|
812
|
-
navBarOpen:
|
|
814
|
+
"data-testid": x,
|
|
815
|
+
navBarOpen: A,
|
|
813
816
|
navBarWidthOpen: g,
|
|
814
|
-
navBarWidthClosed:
|
|
817
|
+
navBarWidthClosed: k,
|
|
815
818
|
children: [
|
|
816
|
-
/* @__PURE__ */ o($n, S(s({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ p(
|
|
817
|
-
/* @__PURE__ */ o(
|
|
819
|
+
/* @__PURE__ */ o($n, S(s({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ p(_, { children: [
|
|
820
|
+
/* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", children: r }),
|
|
818
821
|
c && /* @__PURE__ */ p(Q, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
|
|
819
|
-
/* @__PURE__ */ o(
|
|
822
|
+
/* @__PURE__ */ o(rt, { "data-testid": "arrowbackicon" }),
|
|
820
823
|
" "
|
|
821
824
|
] })
|
|
822
|
-
] }) : /* @__PURE__ */ p(
|
|
825
|
+
] }) : /* @__PURE__ */ p(_, { children: [
|
|
823
826
|
c && /* @__PURE__ */ p(Q, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
|
|
824
|
-
/* @__PURE__ */ o(
|
|
827
|
+
/* @__PURE__ */ o(it, {}),
|
|
825
828
|
" "
|
|
826
829
|
] }),
|
|
827
|
-
/* @__PURE__ */ o(
|
|
830
|
+
/* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", children: r })
|
|
828
831
|
] }) })),
|
|
829
832
|
e
|
|
830
833
|
]
|
|
831
834
|
}
|
|
832
835
|
);
|
|
833
836
|
}
|
|
834
|
-
const In =
|
|
837
|
+
const In = R($, {
|
|
835
838
|
shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
|
|
836
839
|
name: "PanelAwareMargins"
|
|
837
840
|
})(({ theme: e, leftPanel: t, rightPanel: n }) => {
|
|
@@ -854,22 +857,22 @@ const In = H(y, {
|
|
|
854
857
|
}),
|
|
855
858
|
marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
|
|
856
859
|
});
|
|
857
|
-
}), Tn =
|
|
860
|
+
}), Tn = R(tt, {
|
|
858
861
|
name: "PageContainer"
|
|
859
862
|
})(({ theme: e }) => ({
|
|
860
863
|
// Horizontal padding comes from the Container's gutter
|
|
861
864
|
paddingTop: e.spacing(3),
|
|
862
865
|
paddingBottom: e.spacing(3)
|
|
863
866
|
// TODO: Remove max width
|
|
864
|
-
})),
|
|
867
|
+
})), fe = !1, me = !1, ee = {
|
|
865
868
|
titleText: "",
|
|
866
869
|
flavour: "push",
|
|
867
|
-
width:
|
|
870
|
+
width: mt,
|
|
868
871
|
arrowButtons: "both",
|
|
869
872
|
startOpen: !1,
|
|
870
873
|
open: void 0,
|
|
871
874
|
onChangeOpen: void 0,
|
|
872
|
-
content: /* @__PURE__ */ o(
|
|
875
|
+
content: /* @__PURE__ */ o(_, {}),
|
|
873
876
|
onOpened: void 0,
|
|
874
877
|
onClosed: void 0,
|
|
875
878
|
dataTestId: void 0
|
|
@@ -886,27 +889,27 @@ function Po({
|
|
|
886
889
|
topBarDataTestId: l,
|
|
887
890
|
navBarOpen: u,
|
|
888
891
|
navBarWidthOpen: C,
|
|
889
|
-
navBarWidthClosed:
|
|
892
|
+
navBarWidthClosed: x
|
|
890
893
|
}) {
|
|
891
|
-
const [
|
|
892
|
-
titleText:
|
|
893
|
-
content:
|
|
894
|
-
flavour:
|
|
895
|
-
open:
|
|
896
|
-
onChangeOpen:
|
|
897
|
-
width:
|
|
898
|
-
arrowButtons:
|
|
899
|
-
startOpen:
|
|
900
|
-
onOpened:
|
|
894
|
+
const [A, g] = E(fe), [k, b] = E(me), [I, y] = E(fe), [v, D] = E(me), H = n !== void 0, N = i !== void 0, {
|
|
895
|
+
titleText: T,
|
|
896
|
+
content: W,
|
|
897
|
+
flavour: h,
|
|
898
|
+
open: f,
|
|
899
|
+
onChangeOpen: B,
|
|
900
|
+
width: m,
|
|
901
|
+
arrowButtons: w,
|
|
902
|
+
startOpen: L,
|
|
903
|
+
onOpened: se,
|
|
901
904
|
onClosed: yt,
|
|
902
905
|
dataTestId: $t
|
|
903
906
|
} = n ? s(s({}, ee), n) : s({}, ee), {
|
|
904
907
|
titleText: It,
|
|
905
908
|
content: Tt,
|
|
906
|
-
flavour:
|
|
907
|
-
open:
|
|
908
|
-
onChangeOpen:
|
|
909
|
-
width:
|
|
909
|
+
flavour: De,
|
|
910
|
+
open: le,
|
|
911
|
+
onChangeOpen: ye,
|
|
912
|
+
width: ce,
|
|
910
913
|
arrowButtons: J,
|
|
911
914
|
startOpen: Z,
|
|
912
915
|
onOpened: Ot,
|
|
@@ -914,43 +917,43 @@ function Po({
|
|
|
914
917
|
dataTestId: Bt
|
|
915
918
|
} = i ? s(s({}, ee), i) : s({}, ee);
|
|
916
919
|
oe(() => {
|
|
917
|
-
|
|
918
|
-
}, [
|
|
919
|
-
Z !==
|
|
920
|
+
L !== fe && (g(L), y(L));
|
|
921
|
+
}, [L]), oe(() => {
|
|
922
|
+
Z !== me && (b(Z), D(Z));
|
|
920
923
|
}, [Z]);
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
},
|
|
924
|
-
|
|
924
|
+
const de = f === void 0 ? A : f, ue = le === void 0 ? k : le, $e = (z) => {
|
|
925
|
+
f === void 0 && (g(z), r && N && (z ? (b(!1), D(k)) : b(v))), B && B(z);
|
|
926
|
+
}, Ie = (z) => {
|
|
927
|
+
le === void 0 && (b(z), r && H && (z ? (g(!1), y(A)) : g(I))), ye && ye(z);
|
|
925
928
|
};
|
|
926
|
-
return /* @__PURE__ */ p(
|
|
927
|
-
|
|
928
|
-
|
|
929
|
+
return /* @__PURE__ */ p($, { children: [
|
|
930
|
+
H && /* @__PURE__ */ o(
|
|
931
|
+
Re,
|
|
929
932
|
{
|
|
930
933
|
"data-testid": $t,
|
|
931
934
|
anchor: "left",
|
|
932
|
-
open:
|
|
933
|
-
onClose: () =>
|
|
934
|
-
width:
|
|
935
|
-
titleText:
|
|
935
|
+
open: de,
|
|
936
|
+
onClose: () => $e(!1),
|
|
937
|
+
width: m,
|
|
938
|
+
titleText: T,
|
|
936
939
|
debugOpacity: a,
|
|
937
|
-
showCloseArrow:
|
|
938
|
-
onOpened:
|
|
940
|
+
showCloseArrow: w === "both" || w === "close",
|
|
941
|
+
onOpened: se,
|
|
939
942
|
onClosed: yt,
|
|
940
943
|
navBarOpen: u,
|
|
941
944
|
navBarWidthOpen: C,
|
|
942
|
-
navBarWidthClosed:
|
|
943
|
-
children:
|
|
945
|
+
navBarWidthClosed: x,
|
|
946
|
+
children: W
|
|
944
947
|
}
|
|
945
948
|
),
|
|
946
|
-
|
|
947
|
-
|
|
949
|
+
N && /* @__PURE__ */ o(
|
|
950
|
+
Re,
|
|
948
951
|
{
|
|
949
952
|
"data-testid": Bt,
|
|
950
953
|
anchor: "right",
|
|
951
|
-
open:
|
|
952
|
-
onClose: () =>
|
|
953
|
-
width:
|
|
954
|
+
open: ue,
|
|
955
|
+
onClose: () => Ie(!1),
|
|
956
|
+
width: ce,
|
|
954
957
|
titleText: It,
|
|
955
958
|
debugOpacity: a,
|
|
956
959
|
showCloseArrow: J === "both" || J === "close",
|
|
@@ -958,7 +961,7 @@ function Po({
|
|
|
958
961
|
onClosed: Et,
|
|
959
962
|
navBarOpen: u,
|
|
960
963
|
navBarWidthOpen: C,
|
|
961
|
-
navBarWidthClosed:
|
|
964
|
+
navBarWidthClosed: x,
|
|
962
965
|
children: Tt
|
|
963
966
|
}
|
|
964
967
|
),
|
|
@@ -967,33 +970,33 @@ function Po({
|
|
|
967
970
|
s(s({
|
|
968
971
|
titleText: t,
|
|
969
972
|
"data-testid": l
|
|
970
|
-
},
|
|
973
|
+
}, H && h === "push" ? {
|
|
971
974
|
leftPanel: {
|
|
972
|
-
open: ce,
|
|
973
|
-
width: A,
|
|
974
|
-
onOpen: () => ye(!0),
|
|
975
|
-
showOpenArrow: x === "both" || x === "open"
|
|
976
|
-
}
|
|
977
|
-
} : {}), M && ke === "push" ? {
|
|
978
|
-
rightPanel: {
|
|
979
975
|
open: de,
|
|
980
|
-
width:
|
|
976
|
+
width: m,
|
|
981
977
|
onOpen: () => $e(!0),
|
|
978
|
+
showOpenArrow: w === "both" || w === "open"
|
|
979
|
+
}
|
|
980
|
+
} : {}), N && De === "push" ? {
|
|
981
|
+
rightPanel: {
|
|
982
|
+
open: ue,
|
|
983
|
+
width: ce,
|
|
984
|
+
onOpen: () => Ie(!0),
|
|
982
985
|
showOpenArrow: J === "both" || J === "open"
|
|
983
986
|
}
|
|
984
987
|
} : {})
|
|
985
988
|
),
|
|
986
989
|
/* @__PURE__ */ o(
|
|
987
990
|
In,
|
|
988
|
-
S(s(s({},
|
|
991
|
+
S(s(s({}, h === "push" ? {
|
|
989
992
|
leftPanel: {
|
|
990
|
-
open:
|
|
991
|
-
width:
|
|
993
|
+
open: de,
|
|
994
|
+
width: m
|
|
992
995
|
}
|
|
993
|
-
} : {}),
|
|
996
|
+
} : {}), De === "push" ? {
|
|
994
997
|
rightPanel: {
|
|
995
|
-
open:
|
|
996
|
-
width:
|
|
998
|
+
open: ue,
|
|
999
|
+
width: ce
|
|
997
1000
|
}
|
|
998
1001
|
} : {}), {
|
|
999
1002
|
children: /* @__PURE__ */ o(Tn, S(s({ "data-testid": d }, c), { children: e }))
|
|
@@ -1001,10 +1004,10 @@ function Po({
|
|
|
1001
1004
|
)
|
|
1002
1005
|
] });
|
|
1003
1006
|
}
|
|
1004
|
-
const
|
|
1007
|
+
const Ct = () => {
|
|
1005
1008
|
const e = ae();
|
|
1006
1009
|
return Rt(e.breakpoints.down("sm"));
|
|
1007
|
-
}, On = 64, En = 72, Bn = 256, Y =
|
|
1010
|
+
}, On = 64, En = 72, Bn = 256, Y = M(!0), xt = M(Bn), vt = M(En), xe = M(""), Fn = M(void 0), wt = M(On), At = M(void 0);
|
|
1008
1011
|
function Pn({ links: e }) {
|
|
1009
1012
|
return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
|
|
1010
1013
|
}
|
|
@@ -1016,7 +1019,7 @@ const te = "Navbar", X = {
|
|
|
1016
1019
|
// userInfoHolder: `${PREFIX}-userInfoHolder`,
|
|
1017
1020
|
// settings: `${PREFIX}-settings`,
|
|
1018
1021
|
// pieChartIcon: `${PREFIX}-pieChartIcon`,
|
|
1019
|
-
}, Nn =
|
|
1022
|
+
}, Nn = R($, { name: "NavBar" })(({ theme: e }) => ({
|
|
1020
1023
|
[`&.${X.root}`]: {
|
|
1021
1024
|
display: "flex"
|
|
1022
1025
|
},
|
|
@@ -1050,7 +1053,7 @@ const te = "Navbar", X = {
|
|
|
1050
1053
|
}
|
|
1051
1054
|
}, e)
|
|
1052
1055
|
);
|
|
1053
|
-
},
|
|
1056
|
+
}, bt = (e) => {
|
|
1054
1057
|
var t, n;
|
|
1055
1058
|
return {
|
|
1056
1059
|
overflowX: "hidden",
|
|
@@ -1058,13 +1061,13 @@ const te = "Navbar", X = {
|
|
|
1058
1061
|
backgroundColor: (n = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? n : "white"
|
|
1059
1062
|
// Provide default so tests don't need to wrap theme provider
|
|
1060
1063
|
};
|
|
1061
|
-
},
|
|
1064
|
+
}, He = (e, t) => s({
|
|
1062
1065
|
width: t,
|
|
1063
1066
|
transition: re(e, "width", "entering")
|
|
1064
|
-
},
|
|
1067
|
+
}, bt(e)), We = (e, t) => s({
|
|
1065
1068
|
width: t,
|
|
1066
1069
|
transition: re(e, "width", "leaving")
|
|
1067
|
-
},
|
|
1070
|
+
}, bt(e)), _n = R(ve, {
|
|
1068
1071
|
shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
|
|
1069
1072
|
})(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => s(s({
|
|
1070
1073
|
flexShrink: 0,
|
|
@@ -1072,12 +1075,12 @@ const te = "Navbar", X = {
|
|
|
1072
1075
|
boxSizing: "border-box",
|
|
1073
1076
|
display: "flex",
|
|
1074
1077
|
flexDirection: "column"
|
|
1075
|
-
}, t && S(s({},
|
|
1078
|
+
}, t && S(s({}, He(e, n)), {
|
|
1076
1079
|
backgroundColor: "",
|
|
1077
|
-
"& .MuiDrawer-paper":
|
|
1078
|
-
})), !t && S(s({},
|
|
1080
|
+
"& .MuiDrawer-paper": He(e, n)
|
|
1081
|
+
})), !t && S(s({}, We(e, r ? n : i)), {
|
|
1079
1082
|
backgroundColor: "",
|
|
1080
|
-
"& .MuiDrawer-paper":
|
|
1083
|
+
"& .MuiDrawer-paper": We(e, r ? n : i)
|
|
1081
1084
|
})));
|
|
1082
1085
|
function Mn(e) {
|
|
1083
1086
|
let t = 0;
|
|
@@ -1087,11 +1090,11 @@ function Mn(e) {
|
|
|
1087
1090
|
}
|
|
1088
1091
|
return t;
|
|
1089
1092
|
}
|
|
1090
|
-
const
|
|
1093
|
+
const ze = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Rn = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
|
|
1091
1094
|
function Hn({ user: e, domainCode: t, open: n }) {
|
|
1092
1095
|
const i = ae();
|
|
1093
1096
|
return /* @__PURE__ */ p(
|
|
1094
|
-
|
|
1097
|
+
$,
|
|
1095
1098
|
{
|
|
1096
1099
|
sx: {
|
|
1097
1100
|
paddingTop: 3,
|
|
@@ -1102,7 +1105,7 @@ function Hn({ user: e, domainCode: t, open: n }) {
|
|
|
1102
1105
|
},
|
|
1103
1106
|
children: [
|
|
1104
1107
|
/* @__PURE__ */ o(
|
|
1105
|
-
|
|
1108
|
+
$,
|
|
1106
1109
|
{
|
|
1107
1110
|
sx: {
|
|
1108
1111
|
width: n ? "5rem" : "2rem",
|
|
@@ -1110,22 +1113,22 @@ function Hn({ user: e, domainCode: t, open: n }) {
|
|
|
1110
1113
|
aspectRatio: 1
|
|
1111
1114
|
},
|
|
1112
1115
|
children: e != null && e.name ? /* @__PURE__ */ o(
|
|
1113
|
-
|
|
1116
|
+
Fe,
|
|
1114
1117
|
{
|
|
1115
1118
|
src: e == null ? void 0 : e.picture,
|
|
1116
1119
|
sx: {
|
|
1117
1120
|
width: "100%",
|
|
1118
1121
|
height: "100%",
|
|
1119
|
-
bgcolor:
|
|
1122
|
+
bgcolor: ze[Math.abs(Mn(e.name)) % ze.length]
|
|
1120
1123
|
},
|
|
1121
1124
|
children: Rn(e.name)
|
|
1122
1125
|
}
|
|
1123
|
-
) : /* @__PURE__ */ o(
|
|
1126
|
+
) : /* @__PURE__ */ o(Fe, { sx: { width: "100%", height: "100%" } })
|
|
1124
1127
|
}
|
|
1125
1128
|
),
|
|
1126
|
-
/* @__PURE__ */ o(Ln, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Wt, { in: n, children: /* @__PURE__ */ p(
|
|
1127
|
-
e != null && e.name ? /* @__PURE__ */ o(
|
|
1128
|
-
t ? /* @__PURE__ */ o(
|
|
1129
|
+
/* @__PURE__ */ o(Ln, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Wt, { in: n, children: /* @__PURE__ */ p($, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
1130
|
+
e != null && e.name ? /* @__PURE__ */ o(F, { children: e.name }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "50%" }),
|
|
1131
|
+
t ? /* @__PURE__ */ o(F, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "25%" })
|
|
1129
1132
|
] }) }) })
|
|
1130
1133
|
]
|
|
1131
1134
|
}
|
|
@@ -1142,7 +1145,7 @@ function Wn({
|
|
|
1142
1145
|
user: d,
|
|
1143
1146
|
domainCode: l
|
|
1144
1147
|
}) {
|
|
1145
|
-
const u =
|
|
1148
|
+
const u = Ct(), C = st(Y);
|
|
1146
1149
|
return /* @__PURE__ */ o(Nn, { className: X.root, "data-testid": i, children: /* @__PURE__ */ p(
|
|
1147
1150
|
_n,
|
|
1148
1151
|
{
|
|
@@ -1160,15 +1163,15 @@ function Wn({
|
|
|
1160
1163
|
isSmallScreen: u,
|
|
1161
1164
|
children: [
|
|
1162
1165
|
!u && /* @__PURE__ */ o(zt, {}),
|
|
1163
|
-
r && /* @__PURE__ */ p(
|
|
1166
|
+
r && /* @__PURE__ */ p($, { flexGrow: "0", children: [
|
|
1164
1167
|
r,
|
|
1165
|
-
/* @__PURE__ */ o(
|
|
1168
|
+
/* @__PURE__ */ o(Ne, { variant: "middle", sx: { marginY: "0.5rem" } })
|
|
1166
1169
|
] }),
|
|
1167
|
-
/* @__PURE__ */ o(
|
|
1168
|
-
/* @__PURE__ */ p(
|
|
1169
|
-
/* @__PURE__ */ o(
|
|
1170
|
+
/* @__PURE__ */ o($, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ o(Pn, { links: a }) : a }),
|
|
1171
|
+
/* @__PURE__ */ p($, { flexGrow: "0", children: [
|
|
1172
|
+
/* @__PURE__ */ o(Ne, { variant: "middle", sx: { marginY: "0.5rem" } }),
|
|
1170
1173
|
/* @__PURE__ */ o(Hn, { user: d, domainCode: l, open: e }),
|
|
1171
|
-
c && /* @__PURE__ */ o(
|
|
1174
|
+
c && /* @__PURE__ */ o(_, { children: c })
|
|
1172
1175
|
] })
|
|
1173
1176
|
]
|
|
1174
1177
|
}
|
|
@@ -1180,7 +1183,7 @@ function zn({
|
|
|
1180
1183
|
maxWidth: n = !1
|
|
1181
1184
|
}) {
|
|
1182
1185
|
return /* @__PURE__ */ o(
|
|
1183
|
-
|
|
1186
|
+
$,
|
|
1184
1187
|
{
|
|
1185
1188
|
sx: {
|
|
1186
1189
|
overflow: "auto",
|
|
@@ -1190,7 +1193,7 @@ function zn({
|
|
|
1190
1193
|
flexGrow: 1
|
|
1191
1194
|
},
|
|
1192
1195
|
children: /* @__PURE__ */ o(
|
|
1193
|
-
|
|
1196
|
+
tt,
|
|
1194
1197
|
{
|
|
1195
1198
|
component: "main",
|
|
1196
1199
|
id: "main-content",
|
|
@@ -1211,9 +1214,9 @@ function Vn({
|
|
|
1211
1214
|
"data-testid": n,
|
|
1212
1215
|
middle: i
|
|
1213
1216
|
}) {
|
|
1214
|
-
const r =
|
|
1217
|
+
const r = st(Y), a = () => r((l) => !l), c = ae(), d = Ct();
|
|
1215
1218
|
return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ p(
|
|
1216
|
-
|
|
1219
|
+
Ke,
|
|
1217
1220
|
{
|
|
1218
1221
|
square: !0,
|
|
1219
1222
|
elevation: 0,
|
|
@@ -1240,7 +1243,7 @@ function Vn({
|
|
|
1240
1243
|
children: /* @__PURE__ */ o(Zt, { fontSize: "medium" })
|
|
1241
1244
|
}
|
|
1242
1245
|
),
|
|
1243
|
-
/* @__PURE__ */ o(
|
|
1246
|
+
/* @__PURE__ */ o(F, { className: Gn.titleText, variant: "h6", children: e }),
|
|
1244
1247
|
i
|
|
1245
1248
|
]
|
|
1246
1249
|
}
|
|
@@ -1259,35 +1262,35 @@ function No({
|
|
|
1259
1262
|
user: u,
|
|
1260
1263
|
domainCode: C
|
|
1261
1264
|
}) {
|
|
1262
|
-
|
|
1265
|
+
ct([
|
|
1263
1266
|
[Y, n != null ? n : !0],
|
|
1264
|
-
[
|
|
1267
|
+
[xe, t != null ? t : ""]
|
|
1265
1268
|
]);
|
|
1266
|
-
const
|
|
1267
|
-
return /* @__PURE__ */ p(
|
|
1269
|
+
const x = Le(Y), [A] = V(xt), [g] = V(vt), k = Le(xe), [b] = V(wt), [I] = V(Fn), [y] = V(At);
|
|
1270
|
+
return /* @__PURE__ */ p($, { children: [
|
|
1268
1271
|
/* @__PURE__ */ o(Ut, {}),
|
|
1269
1272
|
/* @__PURE__ */ o(
|
|
1270
1273
|
Vn,
|
|
1271
1274
|
{
|
|
1272
|
-
titleText:
|
|
1275
|
+
titleText: k,
|
|
1273
1276
|
"data-testid": a,
|
|
1274
|
-
height:
|
|
1275
|
-
middle:
|
|
1277
|
+
height: b,
|
|
1278
|
+
middle: I
|
|
1276
1279
|
}
|
|
1277
1280
|
),
|
|
1278
|
-
/* @__PURE__ */ p(
|
|
1281
|
+
/* @__PURE__ */ p($, { sx: { display: "flex" }, children: [
|
|
1279
1282
|
/* @__PURE__ */ o(
|
|
1280
1283
|
Wn,
|
|
1281
1284
|
{
|
|
1282
|
-
open:
|
|
1283
|
-
top:
|
|
1285
|
+
open: x,
|
|
1286
|
+
top: y,
|
|
1284
1287
|
middle: d,
|
|
1285
1288
|
bottom: l,
|
|
1286
1289
|
user: u,
|
|
1287
1290
|
domainCode: C,
|
|
1288
|
-
widthOpen:
|
|
1291
|
+
widthOpen: A,
|
|
1289
1292
|
widthClosed: g,
|
|
1290
|
-
offsetTop:
|
|
1293
|
+
offsetTop: b,
|
|
1291
1294
|
"data-testid": c
|
|
1292
1295
|
}
|
|
1293
1296
|
),
|
|
@@ -1295,7 +1298,7 @@ function No({
|
|
|
1295
1298
|
zn,
|
|
1296
1299
|
S(s({
|
|
1297
1300
|
"data-testid": r,
|
|
1298
|
-
topBarHeight:
|
|
1301
|
+
topBarHeight: b
|
|
1299
1302
|
}, i), {
|
|
1300
1303
|
children: e
|
|
1301
1304
|
})
|
|
@@ -1311,97 +1314,97 @@ const qn = {
|
|
|
1311
1314
|
disableWindowBlurListener: !1
|
|
1312
1315
|
}, Xn = {
|
|
1313
1316
|
shouldClose: (e, t) => t !== "clickaway"
|
|
1314
|
-
},
|
|
1317
|
+
}, Ue = {
|
|
1315
1318
|
message: "",
|
|
1316
1319
|
severity: "info",
|
|
1317
1320
|
variant: "standard",
|
|
1318
1321
|
progressIndicator: void 0
|
|
1319
1322
|
// Can use 'circular' or 'linear'
|
|
1320
|
-
},
|
|
1323
|
+
}, Ge = 100, Ve = 2e3, Qn = 2e3, Yn = (() => {
|
|
1321
1324
|
let e = 0;
|
|
1322
1325
|
return () => (e += 1, e);
|
|
1323
1326
|
})(), Kn = {
|
|
1324
1327
|
borderBottomLeftRadius: "0px",
|
|
1325
1328
|
borderBottomRightRadius: "0px"
|
|
1326
|
-
}, Jn = {}, Zn = {},
|
|
1329
|
+
}, Jn = {}, Zn = {}, St = Qe(null);
|
|
1327
1330
|
function jn(a) {
|
|
1328
1331
|
var c = a, {
|
|
1329
1332
|
overrideState: e = Jn,
|
|
1330
1333
|
overrideActions: t = Zn,
|
|
1331
1334
|
shouldClose: n = Xn.shouldClose,
|
|
1332
1335
|
children: i
|
|
1333
|
-
} = c, r =
|
|
1336
|
+
} = c, r = Ee(c, [
|
|
1334
1337
|
"overrideState",
|
|
1335
1338
|
"overrideActions",
|
|
1336
1339
|
"shouldClose",
|
|
1337
1340
|
"children"
|
|
1338
1341
|
]);
|
|
1339
|
-
var
|
|
1340
|
-
const [{ open: d }, l] =
|
|
1341
|
-
l({ open:
|
|
1342
|
-
}, []), g = ne((
|
|
1343
|
-
|
|
1344
|
-
`SaladBarProvider: MAX_QUEUE_LENGTH (${
|
|
1345
|
-
),
|
|
1346
|
-
const
|
|
1342
|
+
var B;
|
|
1343
|
+
const [{ open: d }, l] = E({ open: !1 }), u = he([]), C = he(Date.now()), x = he(0), A = ne((m) => {
|
|
1344
|
+
l({ open: m });
|
|
1345
|
+
}, []), g = ne((m = {}) => {
|
|
1346
|
+
x.current += 1, u.current.length >= Ge && Date.now() - C.current >= Ve && (C.current = Date.now(), console.error(
|
|
1347
|
+
`SaladBarProvider: MAX_QUEUE_LENGTH (${Ge}) hit ${x.current} times in last ${Ve}ms)`
|
|
1348
|
+
), x.current = 0);
|
|
1349
|
+
const w = s(S(s({}, Ue), {
|
|
1347
1350
|
key: Yn()
|
|
1348
|
-
}),
|
|
1349
|
-
return u.current.push(
|
|
1350
|
-
}, []),
|
|
1351
|
-
const
|
|
1352
|
-
if (
|
|
1353
|
-
return
|
|
1354
|
-
},
|
|
1355
|
-
n(
|
|
1356
|
-
},
|
|
1357
|
-
},
|
|
1351
|
+
}), m);
|
|
1352
|
+
return u.current.push(w), u.current.length === 1 && l({ open: !0 }), w.key;
|
|
1353
|
+
}, []), k = (m = "", w = {}) => g(s({ message: m, severity: "success" }, w)), b = (m = "", w = {}) => g(s({ message: m, severity: "info" }, w)), I = (m = "", w = {}) => g(s({ message: m, severity: "warning" }, w)), y = (m = "", w = {}) => g(s({ message: m, severity: "error" }, w)), v = (m) => {
|
|
1354
|
+
const w = u.current.findIndex((L) => L.key === m);
|
|
1355
|
+
if (w !== -1)
|
|
1356
|
+
return w === 0 ? (l({ open: !1 }), u.current[0]) : u.current.splice(w, 1);
|
|
1357
|
+
}, D = (m, w) => {
|
|
1358
|
+
n(m, w) && l({ open: !1 });
|
|
1359
|
+
}, H = () => {
|
|
1360
|
+
}, N = () => {
|
|
1358
1361
|
u.current.shift(), u.current.length > 0 && l({ open: !0 });
|
|
1359
|
-
},
|
|
1360
|
-
"autoHideDuration" in
|
|
1361
|
-
const
|
|
1362
|
+
}, T = (B = u.current[0]) != null ? B : s({}, Ue), W = {};
|
|
1363
|
+
"autoHideDuration" in T && (W.autoHideDuration = T.autoHideDuration);
|
|
1364
|
+
const h = s(s({}, qn), r), f = s(s({
|
|
1362
1365
|
open: d,
|
|
1363
|
-
setOpen:
|
|
1366
|
+
setOpen: A,
|
|
1364
1367
|
enqueueNotification: g,
|
|
1365
|
-
enqueueSuccessNotification:
|
|
1366
|
-
enqueueInfoNotification:
|
|
1367
|
-
enqueueWarningNotification:
|
|
1368
|
-
enqueueErrorNotification:
|
|
1369
|
-
removeNotification:
|
|
1368
|
+
enqueueSuccessNotification: k,
|
|
1369
|
+
enqueueInfoNotification: b,
|
|
1370
|
+
enqueueWarningNotification: I,
|
|
1371
|
+
enqueueErrorNotification: y,
|
|
1372
|
+
removeNotification: v
|
|
1370
1373
|
}, e), t);
|
|
1371
|
-
return /* @__PURE__ */ p(
|
|
1374
|
+
return /* @__PURE__ */ p(St.Provider, { value: f, children: [
|
|
1372
1375
|
i,
|
|
1373
1376
|
/* @__PURE__ */ o(
|
|
1374
1377
|
Gt,
|
|
1375
|
-
S(s(s({},
|
|
1378
|
+
S(s(s({}, h), W), {
|
|
1376
1379
|
open: d,
|
|
1377
|
-
onClose:
|
|
1380
|
+
onClose: D,
|
|
1378
1381
|
TransitionProps: {
|
|
1379
|
-
onExited:
|
|
1380
|
-
onExit:
|
|
1382
|
+
onExited: N,
|
|
1383
|
+
onExit: H
|
|
1381
1384
|
},
|
|
1382
1385
|
sx: { zIndex: Qn },
|
|
1383
1386
|
children: /* @__PURE__ */ p("div", { children: [
|
|
1384
1387
|
/* @__PURE__ */ o(
|
|
1385
1388
|
Vt,
|
|
1386
1389
|
{
|
|
1387
|
-
onClose: (
|
|
1388
|
-
severity:
|
|
1390
|
+
onClose: (m) => D(m, "closeAlert"),
|
|
1391
|
+
severity: T.severity,
|
|
1389
1392
|
variant: "filled",
|
|
1390
|
-
icon:
|
|
1391
|
-
style:
|
|
1392
|
-
children:
|
|
1393
|
+
icon: T.progressIndicator === "circular" ? /* @__PURE__ */ o(be, { size: "1em" }) : void 0,
|
|
1394
|
+
style: T.progressIndicator === "linear" ? Kn : void 0,
|
|
1395
|
+
children: T.message
|
|
1393
1396
|
}
|
|
1394
1397
|
),
|
|
1395
|
-
|
|
1398
|
+
T.progressIndicator === "linear" && /* @__PURE__ */ o(qt, { color: "primary" })
|
|
1396
1399
|
] })
|
|
1397
1400
|
})
|
|
1398
1401
|
)
|
|
1399
1402
|
] });
|
|
1400
1403
|
}
|
|
1401
1404
|
function eo() {
|
|
1402
|
-
const e =
|
|
1405
|
+
const e = Ye(St);
|
|
1403
1406
|
if (e === null)
|
|
1404
|
-
throw new
|
|
1407
|
+
throw new ke("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
|
|
1405
1408
|
return e;
|
|
1406
1409
|
}
|
|
1407
1410
|
const Lo = K(
|
|
@@ -1409,14 +1412,14 @@ const Lo = K(
|
|
|
1409
1412
|
), to = sn(), _o = ({
|
|
1410
1413
|
children: e,
|
|
1411
1414
|
store: t
|
|
1412
|
-
}) => /* @__PURE__ */ o(
|
|
1413
|
-
var
|
|
1414
|
-
const
|
|
1415
|
-
JSON.parse((
|
|
1416
|
-
),
|
|
1417
|
-
(e) => e(
|
|
1415
|
+
}) => /* @__PURE__ */ o(lt, { store: t != null ? t : to, children: e }), kt = "domainCode";
|
|
1416
|
+
var Xe;
|
|
1417
|
+
const qe = M(
|
|
1418
|
+
JSON.parse((Xe = localStorage.getItem(kt)) != null ? Xe : '{"domainCode": ""}').domainCode
|
|
1419
|
+
), Dt = M(
|
|
1420
|
+
(e) => e(qe),
|
|
1418
1421
|
(e, t, n) => {
|
|
1419
|
-
t(
|
|
1422
|
+
t(qe, n), localStorage.setItem(kt, JSON.stringify({ domainCode: n }));
|
|
1420
1423
|
}
|
|
1421
1424
|
), no = {
|
|
1422
1425
|
act: "ACT",
|
|
@@ -1441,65 +1444,65 @@ const Ve = _(
|
|
|
1441
1444
|
applicationName: r,
|
|
1442
1445
|
handleLogout: a
|
|
1443
1446
|
}) => {
|
|
1444
|
-
const [c, d] = V(
|
|
1447
|
+
const [c, d] = V(Dt), [l, u] = E(c), { enqueueSuccessNotification: C } = eo(), x = i.length === 0, A = !!c && !i.includes(c) && !i.includes(l), g = !c || x || A, k = () => P(void 0, null, function* () {
|
|
1445
1448
|
l ? (d(l), C(`Set domain to ${l}`), n()) : d("");
|
|
1446
|
-
}),
|
|
1447
|
-
c && !
|
|
1449
|
+
}), b = () => P(void 0, null, function* () {
|
|
1450
|
+
c && !x && !A ? (u(c), n()) : g && a();
|
|
1448
1451
|
});
|
|
1449
|
-
let
|
|
1450
|
-
return
|
|
1451
|
-
|
|
1452
|
+
let I;
|
|
1453
|
+
return x ? I = "Unable to retrieve your active organisations. Try logging in again." : A && (I = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ p(
|
|
1454
|
+
gt,
|
|
1452
1455
|
{
|
|
1453
1456
|
isOpen: t,
|
|
1454
1457
|
dialogTitle: "Select an organisation",
|
|
1455
1458
|
primaryButton: {
|
|
1456
1459
|
text: "Confirm",
|
|
1457
|
-
onClick:
|
|
1458
|
-
disabled: !l ||
|
|
1460
|
+
onClick: k,
|
|
1461
|
+
disabled: !l || x || A,
|
|
1459
1462
|
buttonColor: "primary"
|
|
1460
1463
|
},
|
|
1461
1464
|
secondaryButton: {
|
|
1462
1465
|
text: g ? "Logout" : "Cancel",
|
|
1463
|
-
onClick:
|
|
1466
|
+
onClick: b
|
|
1464
1467
|
},
|
|
1465
1468
|
onClose: g ? () => {
|
|
1466
1469
|
} : n,
|
|
1467
1470
|
children: [
|
|
1468
|
-
/* @__PURE__ */ p(
|
|
1471
|
+
/* @__PURE__ */ p(F, { marginBottom: 2, children: [
|
|
1469
1472
|
"Select the default organisation that you want to use with the ",
|
|
1470
1473
|
r,
|
|
1471
1474
|
"."
|
|
1472
1475
|
] }),
|
|
1473
1476
|
/* @__PURE__ */ o(
|
|
1474
|
-
|
|
1477
|
+
we,
|
|
1475
1478
|
{
|
|
1476
1479
|
loading: e,
|
|
1477
1480
|
multiple: !1,
|
|
1478
1481
|
disableClearable: !1,
|
|
1479
1482
|
value: l !== "" ? l : null,
|
|
1480
|
-
onChange: (
|
|
1483
|
+
onChange: (y, v) => u(v != null ? v : ""),
|
|
1481
1484
|
getOptionLabel: oo,
|
|
1482
1485
|
options: [...i],
|
|
1483
|
-
renderInput: (
|
|
1484
|
-
|
|
1485
|
-
S(s({},
|
|
1486
|
+
renderInput: (y) => /* @__PURE__ */ o(
|
|
1487
|
+
Ae,
|
|
1488
|
+
S(s({}, y), {
|
|
1486
1489
|
variant: "filled",
|
|
1487
1490
|
label: "Select organisation",
|
|
1488
|
-
InputProps: S(s({},
|
|
1489
|
-
endAdornment: /* @__PURE__ */ p(
|
|
1490
|
-
e ? /* @__PURE__ */ o(
|
|
1491
|
-
|
|
1491
|
+
InputProps: S(s({}, y.InputProps), {
|
|
1492
|
+
endAdornment: /* @__PURE__ */ p(_, { children: [
|
|
1493
|
+
e ? /* @__PURE__ */ o(be, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
|
|
1494
|
+
y.InputProps.endAdornment
|
|
1492
1495
|
] })
|
|
1493
1496
|
})
|
|
1494
1497
|
})
|
|
1495
1498
|
)
|
|
1496
1499
|
}
|
|
1497
1500
|
),
|
|
1498
|
-
|
|
1501
|
+
I && /* @__PURE__ */ o(Xt, { error: !0, children: I })
|
|
1499
1502
|
]
|
|
1500
1503
|
}
|
|
1501
1504
|
);
|
|
1502
|
-
}, Ro =
|
|
1505
|
+
}, Ro = nt({
|
|
1503
1506
|
palette: {
|
|
1504
1507
|
primary: {
|
|
1505
1508
|
dark: "#00A651",
|
|
@@ -1550,7 +1553,7 @@ const Ve = _(
|
|
|
1550
1553
|
navBar: {
|
|
1551
1554
|
backgroundColor: "#E8E8E8"
|
|
1552
1555
|
}
|
|
1553
|
-
}), Ho =
|
|
1556
|
+
}), Ho = nt({
|
|
1554
1557
|
palette: {
|
|
1555
1558
|
primary: {
|
|
1556
1559
|
main: "#007236",
|
|
@@ -1604,18 +1607,18 @@ const Ve = _(
|
|
|
1604
1607
|
styleOverrides: {
|
|
1605
1608
|
root: ({ theme: e }) => ({
|
|
1606
1609
|
"&.Mui-selected": {
|
|
1607
|
-
backgroundColor:
|
|
1610
|
+
backgroundColor: ge(
|
|
1608
1611
|
e.palette.secondary.main,
|
|
1609
1612
|
e.palette.action.selectedOpacity
|
|
1610
1613
|
),
|
|
1611
1614
|
"&:hover": {
|
|
1612
|
-
backgroundColor:
|
|
1615
|
+
backgroundColor: ge(
|
|
1613
1616
|
e.palette.secondary.main,
|
|
1614
1617
|
e.palette.action.selectedOpacity
|
|
1615
1618
|
)
|
|
1616
1619
|
},
|
|
1617
1620
|
"&.Mui-focusVisible": {
|
|
1618
|
-
backgroundColor:
|
|
1621
|
+
backgroundColor: ge(
|
|
1619
1622
|
e.palette.secondary.main,
|
|
1620
1623
|
e.palette.action.focusOpacity
|
|
1621
1624
|
)
|
|
@@ -1642,17 +1645,17 @@ const Ve = _(
|
|
|
1642
1645
|
backgroundColor: "#E8E8E8"
|
|
1643
1646
|
}
|
|
1644
1647
|
}), io = {
|
|
1645
|
-
domainCode:
|
|
1648
|
+
domainCode: Dt,
|
|
1646
1649
|
navBarOpen: Y,
|
|
1647
|
-
navBarWidthOpen:
|
|
1648
|
-
navBarWidthClosed:
|
|
1649
|
-
titleText:
|
|
1650
|
-
topBarHeight:
|
|
1651
|
-
navBarTop:
|
|
1652
|
-
}, Wo = K(() => ({ children: e }) => /* @__PURE__ */ o(
|
|
1650
|
+
navBarWidthOpen: xt,
|
|
1651
|
+
navBarWidthClosed: vt,
|
|
1652
|
+
titleText: xe,
|
|
1653
|
+
topBarHeight: wt,
|
|
1654
|
+
navBarTop: At
|
|
1655
|
+
}, Wo = K(() => ({ children: e }) => /* @__PURE__ */ o(lt, { children: e })), ro = ({
|
|
1653
1656
|
initialValues: e,
|
|
1654
1657
|
children: t
|
|
1655
|
-
}) => (
|
|
1658
|
+
}) => (ct(e), /* @__PURE__ */ o(_, { children: t })), zo = K(
|
|
1656
1659
|
(e) => ({ children: t }) => /* @__PURE__ */ o(
|
|
1657
1660
|
ro,
|
|
1658
1661
|
{
|
|
@@ -1670,18 +1673,18 @@ const Ve = _(
|
|
|
1670
1673
|
return /* @__PURE__ */ o(on, { client: t, children: e });
|
|
1671
1674
|
});
|
|
1672
1675
|
export {
|
|
1673
|
-
|
|
1676
|
+
gt as AgDialog,
|
|
1674
1677
|
No as AppLayout,
|
|
1675
1678
|
_o as AtomProvider,
|
|
1676
1679
|
Fo as AuthGuard,
|
|
1677
|
-
|
|
1678
|
-
|
|
1680
|
+
St as Context,
|
|
1681
|
+
ke as ContextError,
|
|
1679
1682
|
Mo as DomainCodeDialog,
|
|
1680
1683
|
Do as ExampleComponent,
|
|
1681
1684
|
Oo as FetchAutocomplete,
|
|
1682
1685
|
ro as HydrateAtoms,
|
|
1683
|
-
|
|
1684
|
-
|
|
1686
|
+
ut as NAVBAR_WIDTH_CLOSED,
|
|
1687
|
+
dt as NAVBAR_WIDTH_OPENED,
|
|
1685
1688
|
To as NavBar,
|
|
1686
1689
|
$o as NavBarDarkStyledList,
|
|
1687
1690
|
Io as NavBarLightStyledList,
|
|
@@ -1692,19 +1695,19 @@ export {
|
|
|
1692
1695
|
Eo as SingleAutocomplete,
|
|
1693
1696
|
to as atomStore,
|
|
1694
1697
|
mn as buildNavBarState,
|
|
1695
|
-
|
|
1698
|
+
Dt as domainCodeAtom,
|
|
1696
1699
|
Ro as fed21Theme,
|
|
1697
1700
|
Cn as getAuth0Expiry,
|
|
1698
1701
|
Ho as internalAgSystemsTheme,
|
|
1699
1702
|
q as navBarClasses,
|
|
1700
1703
|
Y as navBarOpenAtom,
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1704
|
+
At as navBarTopAtom,
|
|
1705
|
+
vt as navBarWidthClosedAtom,
|
|
1706
|
+
xt as navBarWidthOpenAtom,
|
|
1707
|
+
xe as titleTextAtom,
|
|
1708
|
+
wt as topBarHeightAtom,
|
|
1706
1709
|
Fn as topBarMiddleAtom,
|
|
1707
|
-
|
|
1710
|
+
ft as useAutocompleteOptions,
|
|
1708
1711
|
fn as useNavBar,
|
|
1709
1712
|
eo as useSaladBar,
|
|
1710
1713
|
Wo as withAtomProvider,
|