@australiangreens/ag-internal-components 0.3.6 → 0.3.8
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 +5 -10
- package/dist/components/FetchAutocomplete/FetchAutocomplete.d.ts.map +1 -1
- package/dist/components/SingleAutocomplete/index.d.ts +6 -10
- package/dist/components/SingleAutocomplete/index.d.ts.map +1 -1
- package/dist/esm/index.js +627 -628
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var ot = Object.defineProperty, nt = Object.defineProperties;
|
|
2
|
+
var it = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var J = Object.getOwnPropertySymbols;
|
|
4
|
+
var pe = Object.prototype.hasOwnProperty, he = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var ie = (e, t, o) => t in e ? ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, d = (e, t) => {
|
|
6
6
|
for (var o in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var o of
|
|
10
|
-
|
|
7
|
+
pe.call(t, o) && ie(e, o, t[o]);
|
|
8
|
+
if (J)
|
|
9
|
+
for (var o of J(t))
|
|
10
|
+
he.call(t, o) && ie(e, o, t[o]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, b = (e, t) => nt(e, it(t));
|
|
13
|
+
var fe = (e, t) => {
|
|
14
14
|
var o = {};
|
|
15
|
-
for (var
|
|
16
|
-
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var
|
|
19
|
-
t.indexOf(
|
|
15
|
+
for (var i in e)
|
|
16
|
+
pe.call(e, i) && t.indexOf(i) < 0 && (o[i] = e[i]);
|
|
17
|
+
if (e != null && J)
|
|
18
|
+
for (var i of J(e))
|
|
19
|
+
t.indexOf(i) < 0 && he.call(e, i) && (o[i] = e[i]);
|
|
20
20
|
return o;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var a = (
|
|
22
|
+
var me = (e, t, o) => ie(e, typeof t != "symbol" ? t + "" : t, o);
|
|
23
|
+
var N = (e, t, o) => new Promise((i, s) => {
|
|
24
|
+
var a = (l) => {
|
|
25
25
|
try {
|
|
26
|
-
r(o.next(
|
|
27
|
-
} catch (
|
|
28
|
-
s(
|
|
26
|
+
r(o.next(l));
|
|
27
|
+
} catch (c) {
|
|
28
|
+
s(c);
|
|
29
29
|
}
|
|
30
|
-
},
|
|
30
|
+
}, u = (l) => {
|
|
31
31
|
try {
|
|
32
|
-
r(o.throw(
|
|
33
|
-
} catch (
|
|
34
|
-
s(
|
|
32
|
+
r(o.throw(l));
|
|
33
|
+
} catch (c) {
|
|
34
|
+
s(c);
|
|
35
35
|
}
|
|
36
|
-
}, r = (
|
|
36
|
+
}, r = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(a, u);
|
|
37
37
|
r((o = o.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { jsxs as m, Fragment as
|
|
40
|
-
import { useState as G, createElement as
|
|
41
|
-
import { Typography as
|
|
42
|
-
import { Cancel as
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import { useQuery as
|
|
46
|
-
import { useAuth0 as
|
|
47
|
-
import { Buffer as
|
|
48
|
-
import
|
|
49
|
-
import { atom as
|
|
50
|
-
import { createHelper as
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import { useHydrateAtoms as
|
|
54
|
-
import { styled as
|
|
55
|
-
import
|
|
56
|
-
function
|
|
39
|
+
import { jsxs as m, Fragment as M, jsx as n } from "react/jsx-runtime";
|
|
40
|
+
import { useState as G, createElement as ae, useEffect as ge, useMemo as rt, createContext as st, useRef as re, useCallback as xe, useContext as at } from "react";
|
|
41
|
+
import { Typography as I, Button as q, Paper as $e, Dialog as Me, LinearProgress as Le, DialogTitle as Oe, DialogContent as Re, DialogActions as Ue, Autocomplete as le, TextField as ce, CircularProgress as te, Box as P, Chip as lt, Tooltip as ct, Stack as dt, Snackbar as ut, Alert as pt, FormHelperText as ht, useTheme as oe, useMediaQuery as ft, Drawer as mt, Collapse as gt, Avatar as Ae, Fade as xt, Skeleton as Ce, Toolbar as At, Divider as Se, Container as Ct, IconButton as St } from "@mui/material";
|
|
42
|
+
import { Cancel as wt, ArrowDropDown as vt, ViewHeadline as Dt } from "@mui/icons-material";
|
|
43
|
+
import kt from "autosuggest-highlight/match";
|
|
44
|
+
import yt from "autosuggest-highlight/parse";
|
|
45
|
+
import { useQuery as Be } from "@tanstack/react-query";
|
|
46
|
+
import { useAuth0 as de } from "@auth0/auth0-react";
|
|
47
|
+
import { Buffer as bt } from "buffer";
|
|
48
|
+
import Ft from "@mui/material/Skeleton";
|
|
49
|
+
import { atom as L, useAtom as W, useSetAtom as He, useAtomValue as we } from "jotai";
|
|
50
|
+
import { createHelper as Et } from "souvlaki";
|
|
51
|
+
import _t from "@mui/material/CssBaseline";
|
|
52
|
+
import ve from "@mui/material/Box";
|
|
53
|
+
import { useHydrateAtoms as It } from "jotai/utils";
|
|
54
|
+
import { styled as We, createTheme as ze, alpha as se } from "@mui/material/styles";
|
|
55
|
+
import De from "react-avatar";
|
|
56
|
+
function To({ text: e }) {
|
|
57
57
|
const [t, o] = G(0);
|
|
58
|
-
return /* @__PURE__ */ m(
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
58
|
+
return /* @__PURE__ */ m(M, { children: [
|
|
59
|
+
/* @__PURE__ */ n(I, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
60
|
+
/* @__PURE__ */ n(I, { variant: "caption", display: "block", children: /* @__PURE__ */ n("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
61
|
+
/* @__PURE__ */ n(
|
|
62
|
+
q,
|
|
63
63
|
{
|
|
64
64
|
variant: "outlined",
|
|
65
|
-
onClick: () => o((
|
|
65
|
+
onClick: () => o((i) => i + 1),
|
|
66
66
|
"aria-label": "Increment",
|
|
67
67
|
children: "Hello I am a button"
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
70
|
/* @__PURE__ */ m("p", { children: [
|
|
71
71
|
"This is some text: ",
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ n("span", { children: e })
|
|
73
73
|
] }),
|
|
74
|
-
/* @__PURE__ */ m(
|
|
74
|
+
/* @__PURE__ */ m($e, { children: [
|
|
75
75
|
"This number will incremember when button pressed: ",
|
|
76
76
|
t
|
|
77
77
|
] })
|
|
78
78
|
] });
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const qe = ({
|
|
81
81
|
isOpen: e,
|
|
82
82
|
dialogTitle: t,
|
|
83
83
|
children: o,
|
|
84
|
-
maxWidth:
|
|
84
|
+
maxWidth: i,
|
|
85
85
|
primaryButton: s,
|
|
86
86
|
secondaryButton: a,
|
|
87
|
-
additionalButtons:
|
|
87
|
+
additionalButtons: u,
|
|
88
88
|
onClose: r,
|
|
89
|
-
sx:
|
|
90
|
-
"data-testid":
|
|
89
|
+
sx: l,
|
|
90
|
+
"data-testid": c,
|
|
91
91
|
disableCloseOnBackdropOrEscape: x = !1,
|
|
92
|
-
isLoading:
|
|
92
|
+
isLoading: A = !1
|
|
93
93
|
}) => {
|
|
94
|
-
var
|
|
95
|
-
const [
|
|
94
|
+
var S, y;
|
|
95
|
+
const [D, g] = G(!1);
|
|
96
96
|
return /* @__PURE__ */ m(
|
|
97
|
-
|
|
97
|
+
Me,
|
|
98
98
|
{
|
|
99
99
|
open: e,
|
|
100
|
-
onClose: (
|
|
101
|
-
x && (k === "backdropClick" || k === "escapeKeyDown") ||
|
|
100
|
+
onClose: (h, k) => N(null, null, function* () {
|
|
101
|
+
x && (k === "backdropClick" || k === "escapeKeyDown") || D || (a != null && a.onClick ? yield a.onClick() : r());
|
|
102
102
|
}),
|
|
103
103
|
fullWidth: !0,
|
|
104
|
-
maxWidth:
|
|
105
|
-
"data-testid":
|
|
106
|
-
sx:
|
|
104
|
+
maxWidth: i != null ? i : "xs",
|
|
105
|
+
"data-testid": c,
|
|
106
|
+
sx: l,
|
|
107
107
|
children: [
|
|
108
|
-
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */ m(
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
|
|
108
|
+
A && /* @__PURE__ */ n(Le, { sx: { height: "4px", marginBottom: "-4px" } }),
|
|
109
|
+
/* @__PURE__ */ n(Oe, { children: t }),
|
|
110
|
+
/* @__PURE__ */ n(Re, { sx: { "& > :last-child": { marginBottom: 0 } }, children: o }),
|
|
111
|
+
/* @__PURE__ */ m(Ue, { children: [
|
|
112
|
+
/* @__PURE__ */ n(
|
|
113
|
+
q,
|
|
114
114
|
{
|
|
115
|
-
onClick: (
|
|
115
|
+
onClick: (S = a == null ? void 0 : a.onClick) != null ? S : r,
|
|
116
116
|
"data-testid": a == null ? void 0 : a.testId,
|
|
117
|
-
disabled: (a == null ? void 0 : a.disabled) ||
|
|
117
|
+
disabled: (a == null ? void 0 : a.disabled) || D,
|
|
118
118
|
color: a == null ? void 0 : a.buttonColor,
|
|
119
|
-
children: (
|
|
119
|
+
children: (y = a == null ? void 0 : a.text) != null ? y : "Cancel"
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
|
-
|
|
123
|
-
var
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
|
|
122
|
+
u && u.map((h, k) => {
|
|
123
|
+
var F;
|
|
124
|
+
return /* @__PURE__ */ n(
|
|
125
|
+
q,
|
|
126
126
|
{
|
|
127
|
-
onClick:
|
|
128
|
-
"data-testid":
|
|
129
|
-
disabled: (
|
|
130
|
-
color:
|
|
131
|
-
children: (
|
|
127
|
+
onClick: h == null ? void 0 : h.onClick,
|
|
128
|
+
"data-testid": h == null ? void 0 : h.testId,
|
|
129
|
+
disabled: (h == null ? void 0 : h.disabled) || D,
|
|
130
|
+
color: h == null ? void 0 : h.buttonColor,
|
|
131
|
+
children: (F = h.text) != null ? F : `Button ${k}`
|
|
132
132
|
},
|
|
133
133
|
k
|
|
134
134
|
);
|
|
135
135
|
}),
|
|
136
|
-
s && /* @__PURE__ */
|
|
137
|
-
|
|
136
|
+
s && /* @__PURE__ */ n(
|
|
137
|
+
q,
|
|
138
138
|
{
|
|
139
|
-
onClick: () =>
|
|
140
|
-
var
|
|
141
|
-
g(!0), yield (
|
|
139
|
+
onClick: () => N(null, null, function* () {
|
|
140
|
+
var h;
|
|
141
|
+
g(!0), yield (h = s.onClick) == null ? void 0 : h.call(s), g(!1);
|
|
142
142
|
}),
|
|
143
143
|
"data-testid": s.testId,
|
|
144
|
-
disabled: s.disabled ||
|
|
144
|
+
disabled: s.disabled || D,
|
|
145
145
|
color: s == null ? void 0 : s.buttonColor,
|
|
146
146
|
children: s.text
|
|
147
147
|
}
|
|
@@ -150,7 +150,7 @@ const He = ({
|
|
|
150
150
|
]
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
|
-
},
|
|
153
|
+
}, Pt = {
|
|
154
154
|
popper: {
|
|
155
155
|
modifiers: [
|
|
156
156
|
{
|
|
@@ -161,322 +161,321 @@ const He = ({
|
|
|
161
161
|
}
|
|
162
162
|
]
|
|
163
163
|
}
|
|
164
|
-
},
|
|
164
|
+
}, Ge = {
|
|
165
165
|
right: 2
|
|
166
|
-
},
|
|
166
|
+
}, Ve = ({
|
|
167
167
|
minLength: e,
|
|
168
168
|
preLoadedOptions: t,
|
|
169
169
|
lookup: o,
|
|
170
|
-
label:
|
|
170
|
+
label: i,
|
|
171
171
|
inputValue: s
|
|
172
|
-
}) =>
|
|
172
|
+
}) => Be({
|
|
173
173
|
queryFn: () => e && s.length < e ? t != null ? t : [] : t ? t.filter(
|
|
174
174
|
(a) => a.label.toLowerCase().includes(s.toLowerCase())
|
|
175
175
|
) : o(s),
|
|
176
|
-
queryKey: ["autocomplete",
|
|
176
|
+
queryKey: ["autocomplete", i, s]
|
|
177
177
|
});
|
|
178
|
-
function
|
|
179
|
-
lookup: e = () =>
|
|
178
|
+
function No({
|
|
179
|
+
lookup: e = () => N(null, null, function* () {
|
|
180
180
|
}),
|
|
181
181
|
enableHighlighting: t = !0,
|
|
182
182
|
onChange: o,
|
|
183
|
-
onInputChange:
|
|
183
|
+
onInputChange: i,
|
|
184
184
|
minLength: s = 0,
|
|
185
185
|
label: a,
|
|
186
|
-
value:
|
|
186
|
+
value: u,
|
|
187
187
|
"data-testid": r,
|
|
188
|
-
sx:
|
|
189
|
-
boxSx:
|
|
188
|
+
sx: l,
|
|
189
|
+
boxSx: c,
|
|
190
190
|
textFieldColor: x,
|
|
191
|
-
textFieldVariant:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
191
|
+
textFieldVariant: A = "filled",
|
|
192
|
+
textFieldFocused: D,
|
|
193
|
+
textFieldSx: g,
|
|
194
|
+
loadingText: S = "Loading...",
|
|
195
|
+
noOptionsText: y = "No options",
|
|
196
|
+
popupIcon: h = /* @__PURE__ */ n(vt, {}),
|
|
197
|
+
error: k = !1,
|
|
198
|
+
helperText: F = "",
|
|
199
|
+
preLoadedOptions: T = void 0,
|
|
200
|
+
disablePortal: V = !1,
|
|
201
|
+
disableIconFlip: K = !1,
|
|
202
|
+
chipToolTipSlotProps: _ = Pt,
|
|
203
|
+
placeholderText: O = void 0,
|
|
204
|
+
onRightClick: X = () => {
|
|
204
205
|
},
|
|
205
|
-
disableDefaultRightClickBehaviour:
|
|
206
|
+
disableDefaultRightClickBehaviour: U = !1,
|
|
207
|
+
readOnly: R,
|
|
208
|
+
hideInputEndAdornment: v
|
|
206
209
|
}) {
|
|
207
|
-
const [
|
|
208
|
-
const $ =
|
|
209
|
-
o($, "delete",
|
|
210
|
-
}, { data:
|
|
211
|
-
inputValue:
|
|
210
|
+
const [C, B] = G(""), Q = (p, w) => {
|
|
211
|
+
const $ = u.filter((ne) => ne.id !== w);
|
|
212
|
+
o($, "delete", p);
|
|
213
|
+
}, { data: f, isLoading: E } = Ve({
|
|
214
|
+
inputValue: C,
|
|
212
215
|
label: a,
|
|
213
216
|
lookup: e,
|
|
214
217
|
minLength: s,
|
|
215
|
-
preLoadedOptions:
|
|
216
|
-
}), H =
|
|
217
|
-
sx: {
|
|
218
|
-
"& .MuiFilledInput-root.Mui-focused": {
|
|
219
|
-
backgroundColor: "hsla(201, 98%, 41%, 0.08)"
|
|
220
|
-
},
|
|
221
|
-
"& .MuiOutlinedInput-root.Mui-focused": {
|
|
222
|
-
backgroundColor: "hsla(201, 98%, 41%, 0.08)"
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
focused: !0
|
|
226
|
-
} : {};
|
|
218
|
+
preLoadedOptions: T
|
|
219
|
+
}), H = C.length >= s;
|
|
227
220
|
return /* @__PURE__ */ m("div", { "data-testid": r, children: [
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
|
|
221
|
+
/* @__PURE__ */ n(
|
|
222
|
+
le,
|
|
230
223
|
{
|
|
231
|
-
sx:
|
|
224
|
+
sx: d(d({}, l), K ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
232
225
|
"data-testid": r ? `${r}:Autocomplete` : void 0,
|
|
233
|
-
disablePortal:
|
|
226
|
+
disablePortal: V,
|
|
234
227
|
multiple: !0,
|
|
235
|
-
getOptionLabel: (
|
|
236
|
-
loading: H ?
|
|
237
|
-
options: [...
|
|
228
|
+
getOptionLabel: (p) => typeof p == "string" ? p : p.label,
|
|
229
|
+
loading: H ? E : !1,
|
|
230
|
+
options: [...u, ...f != null ? f : []],
|
|
238
231
|
filterSelectedOptions: !0,
|
|
239
232
|
includeInputInList: !0,
|
|
240
|
-
value:
|
|
241
|
-
onChange: (
|
|
242
|
-
o(
|
|
233
|
+
value: u,
|
|
234
|
+
onChange: (p, w, $) => {
|
|
235
|
+
o(w, $, p);
|
|
243
236
|
},
|
|
244
|
-
onInputChange: (
|
|
245
|
-
|
|
237
|
+
onInputChange: (p, w, $) => {
|
|
238
|
+
B(w), i && i(u, $, p);
|
|
246
239
|
},
|
|
247
|
-
noOptionsText: H ?
|
|
248
|
-
loadingText:
|
|
249
|
-
popupIcon:
|
|
250
|
-
renderInput: (
|
|
251
|
-
|
|
252
|
-
|
|
240
|
+
noOptionsText: H ? y : "Start typing to search",
|
|
241
|
+
loadingText: S,
|
|
242
|
+
popupIcon: h,
|
|
243
|
+
renderInput: (p) => /* @__PURE__ */ n(
|
|
244
|
+
ce,
|
|
245
|
+
b(d({}, p), {
|
|
253
246
|
label: a,
|
|
254
247
|
fullWidth: !0,
|
|
255
|
-
variant:
|
|
256
|
-
error:
|
|
257
|
-
helperText:
|
|
248
|
+
variant: A,
|
|
249
|
+
error: k,
|
|
250
|
+
helperText: F,
|
|
258
251
|
slotProps: {
|
|
259
|
-
input:
|
|
260
|
-
endAdornment:
|
|
261
|
-
|
|
262
|
-
|
|
252
|
+
input: b(d({}, p.InputProps), {
|
|
253
|
+
endAdornment: v ? void 0 : /* @__PURE__ */ m(M, { children: [
|
|
254
|
+
E ? /* @__PURE__ */ n(te, { color: "inherit", size: 20 }) : null,
|
|
255
|
+
p.InputProps.endAdornment
|
|
263
256
|
] })
|
|
264
257
|
})
|
|
265
258
|
},
|
|
266
259
|
"data-testid": r ? `${r}:Autocomplete:TextField` : void 0,
|
|
267
|
-
onKeyDown: (
|
|
268
|
-
(
|
|
260
|
+
onKeyDown: (w) => {
|
|
261
|
+
(w.key === "Backspace" || w.key === "Delete") && w.stopPropagation();
|
|
269
262
|
},
|
|
270
263
|
color: x,
|
|
271
|
-
placeholder:
|
|
272
|
-
|
|
264
|
+
placeholder: O,
|
|
265
|
+
sx: g,
|
|
266
|
+
focused: D
|
|
267
|
+
})
|
|
273
268
|
),
|
|
274
269
|
renderValue: () => null,
|
|
275
|
-
isOptionEqualToValue: (
|
|
276
|
-
renderOption: (
|
|
270
|
+
isOptionEqualToValue: (p, w) => p.id === w.id,
|
|
271
|
+
renderOption: (p, w, $) => {
|
|
277
272
|
if (t) {
|
|
278
|
-
const
|
|
273
|
+
const ne = kt(w.label, $.inputValue, {
|
|
279
274
|
insideWords: !0,
|
|
280
275
|
findAllOccurrences: !0
|
|
281
|
-
}),
|
|
282
|
-
return /* @__PURE__ */
|
|
276
|
+
}), et = yt(w.label, ne);
|
|
277
|
+
return /* @__PURE__ */ ae(
|
|
283
278
|
"li",
|
|
284
|
-
|
|
285
|
-
key:
|
|
286
|
-
"data-testid": r ? `${r}:Autocomplete:option(${
|
|
279
|
+
b(d({}, p), {
|
|
280
|
+
key: w.id,
|
|
281
|
+
"data-testid": r ? `${r}:Autocomplete:option(${w.id.toString()})` : void 0
|
|
287
282
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ n("div", { children: et.map((ue, tt) => /* @__PURE__ */ n(
|
|
289
284
|
"span",
|
|
290
285
|
{
|
|
291
286
|
style: {
|
|
292
|
-
fontWeight:
|
|
287
|
+
fontWeight: ue.highlight ? 700 : 400
|
|
293
288
|
},
|
|
294
|
-
children:
|
|
289
|
+
children: ue.text
|
|
295
290
|
},
|
|
296
|
-
|
|
291
|
+
tt
|
|
297
292
|
)) })
|
|
298
293
|
);
|
|
299
294
|
} else
|
|
300
|
-
return /* @__PURE__ */
|
|
295
|
+
return /* @__PURE__ */ ae(
|
|
301
296
|
"li",
|
|
302
|
-
|
|
303
|
-
key:
|
|
304
|
-
"data-testid": r ? `${r}:option(${
|
|
297
|
+
b(d({}, p), {
|
|
298
|
+
key: w.id,
|
|
299
|
+
"data-testid": r ? `${r}:option(${w.id.toString()})` : void 0
|
|
305
300
|
}),
|
|
306
|
-
|
|
301
|
+
w.label
|
|
307
302
|
);
|
|
308
303
|
},
|
|
309
|
-
onMouseDownCapture: (
|
|
310
|
-
|
|
304
|
+
onMouseDownCapture: (p) => {
|
|
305
|
+
p.button === Ge.right && U && (p.preventDefault(), p.stopPropagation());
|
|
311
306
|
},
|
|
312
|
-
onContextMenuCapture: (
|
|
313
|
-
|
|
307
|
+
onContextMenuCapture: (p) => {
|
|
308
|
+
U && (p.preventDefault(), p.stopPropagation()), X(p);
|
|
314
309
|
},
|
|
315
|
-
readOnly:
|
|
310
|
+
readOnly: R
|
|
316
311
|
}
|
|
317
312
|
),
|
|
318
|
-
|
|
319
|
-
var
|
|
320
|
-
return /* @__PURE__ */
|
|
321
|
-
|
|
313
|
+
u.length > 0 && /* @__PURE__ */ n(P, { sx: c, children: u.map((p) => {
|
|
314
|
+
var w;
|
|
315
|
+
return /* @__PURE__ */ n(
|
|
316
|
+
lt,
|
|
322
317
|
{
|
|
323
318
|
sx: {
|
|
324
319
|
marginTop: 1,
|
|
325
320
|
marginRight: 1,
|
|
326
321
|
height: "auto"
|
|
327
322
|
},
|
|
328
|
-
label: /* @__PURE__ */
|
|
329
|
-
|
|
323
|
+
label: /* @__PURE__ */ n(
|
|
324
|
+
ct,
|
|
330
325
|
{
|
|
331
|
-
title: (
|
|
326
|
+
title: (w = p.tooltipContent) != null ? w : "",
|
|
332
327
|
placement: "bottom-start",
|
|
333
|
-
slotProps:
|
|
334
|
-
children: /* @__PURE__ */
|
|
328
|
+
slotProps: _,
|
|
329
|
+
children: /* @__PURE__ */ n(I, { style: { whiteSpace: "normal" }, children: p.chipLabel ? p.chipLabel : p.label })
|
|
335
330
|
}
|
|
336
331
|
),
|
|
337
|
-
"data-testid": r ? `${r}:Chip(${
|
|
338
|
-
onDelete: ($) =>
|
|
339
|
-
deleteIcon: /* @__PURE__ */
|
|
340
|
-
|
|
332
|
+
"data-testid": r ? `${r}:Chip(${p.id.toString()})` : void 0,
|
|
333
|
+
onDelete: ($) => Q($, p.id),
|
|
334
|
+
deleteIcon: /* @__PURE__ */ n(
|
|
335
|
+
wt,
|
|
341
336
|
{
|
|
342
|
-
"data-testid": r ? `${r}:Chip(${
|
|
337
|
+
"data-testid": r ? `${r}:Chip(${p.id.toString()}):deleteIcon` : void 0
|
|
343
338
|
}
|
|
344
339
|
)
|
|
345
340
|
},
|
|
346
|
-
|
|
341
|
+
p.id
|
|
347
342
|
);
|
|
348
343
|
}) })
|
|
349
344
|
] });
|
|
350
345
|
}
|
|
351
|
-
const
|
|
352
|
-
lookup: e = () =>
|
|
346
|
+
const $o = /MUI: The value provided to.*is invalid/i, Mo = ({
|
|
347
|
+
lookup: e = () => N(null, null, function* () {
|
|
353
348
|
}),
|
|
354
349
|
onChange: t,
|
|
355
350
|
onInputChange: o,
|
|
356
|
-
label:
|
|
351
|
+
label: i,
|
|
357
352
|
value: s,
|
|
358
353
|
sx: a,
|
|
359
|
-
textFieldColor:
|
|
354
|
+
textFieldColor: u,
|
|
360
355
|
textFieldVariant: r = "filled",
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
356
|
+
textFieldFocused: l,
|
|
357
|
+
textFieldSx: c,
|
|
358
|
+
error: x = !1,
|
|
359
|
+
"data-testid": A,
|
|
360
|
+
loadingText: D = "Loading...",
|
|
361
|
+
noOptionsText: g = "No options",
|
|
362
|
+
minLength: S = 3,
|
|
363
|
+
disablePortal: y = !1,
|
|
364
|
+
preLoadedOptions: h,
|
|
365
|
+
helperText: k = "",
|
|
366
|
+
disabled: F,
|
|
367
|
+
popupIcon: T,
|
|
368
|
+
disableIconFlip: V,
|
|
369
|
+
placeholderText: K = void 0,
|
|
370
|
+
onRightClick: _ = () => {
|
|
374
371
|
},
|
|
375
|
-
disableDefaultRightClickBehaviour:
|
|
372
|
+
disableDefaultRightClickBehaviour: O = !1,
|
|
373
|
+
readOnly: X,
|
|
374
|
+
hideInputEndAdornment: U
|
|
376
375
|
}) => {
|
|
377
|
-
const [
|
|
378
|
-
inputValue:
|
|
379
|
-
label:
|
|
376
|
+
const [R, v] = G(""), { data: C, isLoading: B } = Ve({
|
|
377
|
+
inputValue: R,
|
|
378
|
+
label: i,
|
|
380
379
|
lookup: e,
|
|
381
|
-
minLength:
|
|
382
|
-
preLoadedOptions:
|
|
383
|
-
}),
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
backgroundColor: "hsla(201, 98%, 41%, 0.08)"
|
|
387
|
-
},
|
|
388
|
-
"& .MuiOutlinedInput-root.Mui-focused": {
|
|
389
|
-
backgroundColor: "hsla(201, 98%, 41%, 0.08)"
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
focused: !0,
|
|
393
|
-
slotProps: { input: { endAdornment: void 0 } }
|
|
394
|
-
} : {};
|
|
395
|
-
return /* @__PURE__ */ i("div", { "data-testid": l, children: /* @__PURE__ */ i(
|
|
396
|
-
lt,
|
|
380
|
+
minLength: S != null ? S : 0,
|
|
381
|
+
preLoadedOptions: h
|
|
382
|
+
}), Q = R.length >= S;
|
|
383
|
+
return /* @__PURE__ */ n("div", { "data-testid": A, children: /* @__PURE__ */ n(
|
|
384
|
+
dt,
|
|
397
385
|
{
|
|
398
386
|
direction: "row",
|
|
399
387
|
spacing: 1,
|
|
400
|
-
onMouseDownCapture: (
|
|
401
|
-
|
|
388
|
+
onMouseDownCapture: (f) => {
|
|
389
|
+
f.button === Ge.right && O && (f.preventDefault(), f.stopPropagation());
|
|
402
390
|
},
|
|
403
|
-
onContextMenuCapture: (
|
|
404
|
-
|
|
391
|
+
onContextMenuCapture: (f) => {
|
|
392
|
+
O && (f.preventDefault(), f.stopPropagation()), _(f);
|
|
405
393
|
},
|
|
406
|
-
children: /* @__PURE__ */
|
|
407
|
-
|
|
394
|
+
children: /* @__PURE__ */ n(
|
|
395
|
+
le,
|
|
408
396
|
{
|
|
409
|
-
sx:
|
|
410
|
-
"data-testid":
|
|
411
|
-
loading:
|
|
412
|
-
options:
|
|
413
|
-
onChange: (
|
|
414
|
-
t(
|
|
397
|
+
sx: d(d({}, a), V ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
398
|
+
"data-testid": A ? `${A}:Autocomplete` : void 0,
|
|
399
|
+
loading: Q ? B : !1,
|
|
400
|
+
options: C != null ? C : [],
|
|
401
|
+
onChange: (f, E, H) => {
|
|
402
|
+
t(f, E, H);
|
|
415
403
|
},
|
|
416
|
-
disablePortal:
|
|
417
|
-
filterOptions: (
|
|
404
|
+
disablePortal: y,
|
|
405
|
+
filterOptions: (f) => f,
|
|
418
406
|
value: s,
|
|
419
|
-
noOptionsText:
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
407
|
+
noOptionsText: Q ? g : "Start typing to search",
|
|
408
|
+
loadingText: D,
|
|
409
|
+
getOptionLabel: (f) => f.label,
|
|
410
|
+
popupIcon: T,
|
|
411
|
+
renderInput: (f) => /* @__PURE__ */ n(
|
|
412
|
+
ce,
|
|
413
|
+
b(d({
|
|
414
|
+
"data-testid": A ? `${A}:Autocomplete:TextField` : void 0
|
|
415
|
+
}, f), {
|
|
427
416
|
variant: r,
|
|
428
|
-
label:
|
|
429
|
-
color:
|
|
430
|
-
error:
|
|
431
|
-
helperText:
|
|
432
|
-
|
|
433
|
-
|
|
417
|
+
label: i,
|
|
418
|
+
color: u,
|
|
419
|
+
error: x,
|
|
420
|
+
helperText: k,
|
|
421
|
+
slotProps: {
|
|
422
|
+
input: b(d({}, f.InputProps), {
|
|
423
|
+
endAdornment: U ? void 0 : /* @__PURE__ */ m(M, { children: [
|
|
424
|
+
B ? /* @__PURE__ */ n(te, { color: "inherit", size: 20 }) : null,
|
|
425
|
+
f.InputProps.endAdornment
|
|
426
|
+
] })
|
|
427
|
+
})
|
|
428
|
+
},
|
|
429
|
+
placeholder: K,
|
|
430
|
+
sx: c,
|
|
431
|
+
focused: l
|
|
432
|
+
})
|
|
434
433
|
),
|
|
435
|
-
isOptionEqualToValue: (
|
|
436
|
-
onInputChange: (
|
|
437
|
-
|
|
434
|
+
isOptionEqualToValue: (f, E) => f.id === E.id,
|
|
435
|
+
onInputChange: (f, E, H) => {
|
|
436
|
+
v(E), o && o(E, H, f);
|
|
438
437
|
},
|
|
439
|
-
renderOption: (
|
|
438
|
+
renderOption: (f, E) => /* @__PURE__ */ ae(
|
|
440
439
|
"li",
|
|
441
|
-
|
|
442
|
-
key:
|
|
443
|
-
"data-testid":
|
|
440
|
+
b(d({}, f), {
|
|
441
|
+
key: E.id,
|
|
442
|
+
"data-testid": A ? `${A}:Autocomplete:option(${E.id.toString()})` : void 0
|
|
444
443
|
}),
|
|
445
|
-
|
|
444
|
+
E.label
|
|
446
445
|
),
|
|
447
|
-
disabled:
|
|
448
|
-
readOnly:
|
|
446
|
+
disabled: F,
|
|
447
|
+
readOnly: X
|
|
449
448
|
}
|
|
450
449
|
)
|
|
451
450
|
}
|
|
452
451
|
) });
|
|
453
|
-
},
|
|
452
|
+
}, Tt = (e) => {
|
|
454
453
|
if (!e)
|
|
455
454
|
return -1;
|
|
456
455
|
try {
|
|
457
|
-
const o = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"),
|
|
458
|
-
|
|
456
|
+
const o = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
|
|
457
|
+
bt.from(o, "base64").toString("utf8").split("").map(function(a) {
|
|
459
458
|
return "%" + ("00" + a.charCodeAt(0).toString(16)).slice(-2);
|
|
460
459
|
}).join("")
|
|
461
|
-
), s = JSON.parse(
|
|
460
|
+
), s = JSON.parse(i);
|
|
462
461
|
return s != null && s.exp ? s.exp : -1;
|
|
463
462
|
} catch (t) {
|
|
464
463
|
return -1;
|
|
465
464
|
}
|
|
466
|
-
},
|
|
465
|
+
}, Lo = ({
|
|
467
466
|
open: e = !1,
|
|
468
467
|
closeHandler: t,
|
|
469
468
|
setAuth0ExpiryTime: o
|
|
470
469
|
}) => {
|
|
471
|
-
const { logout:
|
|
472
|
-
return /* @__PURE__ */
|
|
473
|
-
|
|
470
|
+
const { logout: i, getAccessTokenSilently: s } = de();
|
|
471
|
+
return /* @__PURE__ */ n(
|
|
472
|
+
qe,
|
|
474
473
|
{
|
|
475
474
|
isOpen: e,
|
|
476
475
|
primaryButton: {
|
|
477
476
|
text: "Continue",
|
|
478
|
-
onClick: () =>
|
|
479
|
-
const
|
|
477
|
+
onClick: () => N(null, null, function* () {
|
|
478
|
+
const c = yield s({ cacheMode: "off" }), x = Tt(c) * 1e3;
|
|
480
479
|
o(x), t();
|
|
481
480
|
}),
|
|
482
481
|
disabled: !1,
|
|
@@ -485,8 +484,8 @@ const Po = /MUI: The value provided to.*is invalid/i, No = ({
|
|
|
485
484
|
},
|
|
486
485
|
secondaryButton: {
|
|
487
486
|
text: "Log out",
|
|
488
|
-
onClick: () =>
|
|
489
|
-
|
|
487
|
+
onClick: () => N(null, null, function* () {
|
|
488
|
+
i({ logoutParams: { returnTo: `${window.location.origin}` } });
|
|
490
489
|
}),
|
|
491
490
|
disabled: !1,
|
|
492
491
|
testId: "PreferencesDialog",
|
|
@@ -495,42 +494,42 @@ const Po = /MUI: The value provided to.*is invalid/i, No = ({
|
|
|
495
494
|
onClose: t,
|
|
496
495
|
dialogTitle: "Session expiry",
|
|
497
496
|
disableCloseOnBackdropOrEscape: !0,
|
|
498
|
-
children: /* @__PURE__ */
|
|
497
|
+
children: /* @__PURE__ */ n("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
|
|
499
498
|
}
|
|
500
499
|
);
|
|
501
500
|
};
|
|
502
|
-
function
|
|
501
|
+
function Nt(e) {
|
|
503
502
|
return "error" in e;
|
|
504
503
|
}
|
|
505
|
-
function
|
|
506
|
-
var
|
|
507
|
-
const t = e.error, o = (
|
|
504
|
+
function $t(e) {
|
|
505
|
+
var i;
|
|
506
|
+
const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
508
507
|
return t === "access_denied" && o.startsWith("You do not have the required authorization");
|
|
509
508
|
}
|
|
510
|
-
function
|
|
511
|
-
var
|
|
512
|
-
const t = e.error, o = (
|
|
509
|
+
function Mt(e) {
|
|
510
|
+
var i;
|
|
511
|
+
const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
513
512
|
return t === "access_denied" && o.startsWith("User did not authorize the request");
|
|
514
513
|
}
|
|
515
|
-
function
|
|
516
|
-
var
|
|
517
|
-
const t = e.error, o = (
|
|
514
|
+
function Lt(e) {
|
|
515
|
+
var i;
|
|
516
|
+
const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
518
517
|
return t === "access_denied" && o.match(/Script.*time.*exceeded/);
|
|
519
518
|
}
|
|
520
|
-
function
|
|
519
|
+
function Oo({
|
|
521
520
|
children: e,
|
|
522
521
|
appName: t = "the app",
|
|
523
522
|
throwErrors: o = "none",
|
|
524
|
-
disableConsoleLogging:
|
|
523
|
+
disableConsoleLogging: i = !1,
|
|
525
524
|
onError: s = () => {
|
|
526
525
|
}
|
|
527
526
|
}) {
|
|
528
|
-
var
|
|
529
|
-
const { isAuthenticated: a, isLoading:
|
|
530
|
-
|
|
527
|
+
var A, D;
|
|
528
|
+
const { isAuthenticated: a, isLoading: u, error: r, loginWithRedirect: l, logout: c } = de();
|
|
529
|
+
ge(() => {
|
|
531
530
|
r && s(r);
|
|
532
531
|
}, [r, s]);
|
|
533
|
-
const x =
|
|
532
|
+
const x = rt(
|
|
534
533
|
() => ({
|
|
535
534
|
appState: {
|
|
536
535
|
returnTo: `${window.location.pathname}${window.location.search}`
|
|
@@ -538,166 +537,166 @@ function To({
|
|
|
538
537
|
}),
|
|
539
538
|
[]
|
|
540
539
|
);
|
|
541
|
-
if (
|
|
542
|
-
|
|
543
|
-
}, [
|
|
544
|
-
if (
|
|
545
|
-
`Error detected in AuthGuard [isAuthenticated=${a},isLoading=${
|
|
540
|
+
if (ge(() => {
|
|
541
|
+
u || a || r || l(x);
|
|
542
|
+
}, [u, a, r, l, s, x]), r) {
|
|
543
|
+
if (i || console.error(
|
|
544
|
+
`Error detected in AuthGuard [isAuthenticated=${a},isLoading=${u}]`,
|
|
546
545
|
r
|
|
547
546
|
), o === "all")
|
|
548
547
|
throw r;
|
|
549
|
-
if (
|
|
550
|
-
let g = "Auth error",
|
|
551
|
-
if (
|
|
552
|
-
g = "Unauthorised",
|
|
553
|
-
else if (
|
|
554
|
-
g = "App not authorised",
|
|
555
|
-
else if (
|
|
556
|
-
g = "Auth0 script execution time exceeded",
|
|
548
|
+
if (Nt(r)) {
|
|
549
|
+
let g = "Auth error", S = "An unknown Auth0 error occurred.";
|
|
550
|
+
if ($t(r))
|
|
551
|
+
g = "Unauthorised", S = `You are not authorised to access ${t}.`;
|
|
552
|
+
else if (Mt(r))
|
|
553
|
+
g = "App not authorised", S = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
|
|
554
|
+
else if (Lt(r))
|
|
555
|
+
g = "Auth0 script execution time exceeded", S = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";
|
|
557
556
|
else if (r.message === "Invalid state") {
|
|
558
|
-
const
|
|
559
|
-
|
|
557
|
+
const y = localStorage.getItem("auth0_redirect_count");
|
|
558
|
+
y ? y && parseInt(y) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(y) + 1)), l(x)) : (localStorage.setItem("auth0_redirect_count", "1"), l(x));
|
|
560
559
|
} else if (o === "unknown") throw r;
|
|
561
|
-
return /* @__PURE__ */ m(
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
-
/* @__PURE__ */ m(
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
/* @__PURE__ */ m(
|
|
560
|
+
return /* @__PURE__ */ m(Me, { open: !0, children: [
|
|
561
|
+
/* @__PURE__ */ n(Oe, { children: g }),
|
|
562
|
+
/* @__PURE__ */ m(Re, { children: [
|
|
563
|
+
/* @__PURE__ */ n(I, { children: S }),
|
|
564
|
+
/* @__PURE__ */ n("br", {}),
|
|
565
|
+
/* @__PURE__ */ n(I, { variant: "subtitle2", children: "Details from Auth0" }),
|
|
566
|
+
/* @__PURE__ */ m(I, { variant: "body2", children: [
|
|
568
567
|
"error: ",
|
|
569
|
-
(
|
|
568
|
+
(A = r == null ? void 0 : r.error) != null ? A : "N/A"
|
|
570
569
|
] }),
|
|
571
|
-
/* @__PURE__ */ m(
|
|
570
|
+
/* @__PURE__ */ m(I, { variant: "body2", children: [
|
|
572
571
|
"description: ",
|
|
573
|
-
(
|
|
572
|
+
(D = r == null ? void 0 : r.error_description) != null ? D : "N/A"
|
|
574
573
|
] })
|
|
575
574
|
] }),
|
|
576
|
-
/* @__PURE__ */ m(
|
|
577
|
-
g === "Auth0 script execution time exceeded" && /* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ m(Ue, { children: [
|
|
576
|
+
g === "Auth0 script execution time exceeded" && /* @__PURE__ */ n(q, { href: window.location.origin + window.location.pathname, children: "Reload" }),
|
|
577
|
+
/* @__PURE__ */ n(q, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
|
|
579
578
|
] })
|
|
580
579
|
] });
|
|
581
580
|
} else if (o === "unknown") throw r;
|
|
582
581
|
}
|
|
583
|
-
return a ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */
|
|
582
|
+
return a ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ n(M, { children: e })) : /* @__PURE__ */ n(Ft, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
584
583
|
}
|
|
585
|
-
const
|
|
584
|
+
const Ot = {
|
|
586
585
|
autoHideDuration: 6e3,
|
|
587
586
|
anchorOrigin: { vertical: "top", horizontal: "center" },
|
|
588
587
|
// The default is false. If we prefer timer to continue when window loses
|
|
589
588
|
// focus, change to true
|
|
590
589
|
disableWindowBlurListener: !1
|
|
591
|
-
},
|
|
590
|
+
}, Rt = {
|
|
592
591
|
shouldClose: (e, t) => t !== "clickaway"
|
|
593
|
-
},
|
|
592
|
+
}, ke = {
|
|
594
593
|
message: "",
|
|
595
594
|
severity: "info",
|
|
596
595
|
variant: "standard",
|
|
597
596
|
progressIndicator: void 0
|
|
598
597
|
// Can use 'circular' or 'linear'
|
|
599
|
-
},
|
|
598
|
+
}, ye = 100, be = 2e3, Ut = 2e3, Bt = /* @__PURE__ */ (() => {
|
|
600
599
|
let e = 0;
|
|
601
600
|
return () => (e += 1, e);
|
|
602
|
-
})(),
|
|
601
|
+
})(), Ht = {
|
|
603
602
|
borderBottomLeftRadius: "0px",
|
|
604
603
|
borderBottomRightRadius: "0px"
|
|
605
|
-
},
|
|
606
|
-
function
|
|
607
|
-
var
|
|
608
|
-
overrideState: e =
|
|
609
|
-
overrideActions: t =
|
|
610
|
-
shouldClose: o =
|
|
611
|
-
children:
|
|
612
|
-
} =
|
|
604
|
+
}, Wt = {}, zt = {}, Ke = st(null);
|
|
605
|
+
function qt(a) {
|
|
606
|
+
var u = a, {
|
|
607
|
+
overrideState: e = Wt,
|
|
608
|
+
overrideActions: t = zt,
|
|
609
|
+
shouldClose: o = Rt.shouldClose,
|
|
610
|
+
children: i
|
|
611
|
+
} = u, s = fe(u, [
|
|
613
612
|
"overrideState",
|
|
614
613
|
"overrideActions",
|
|
615
614
|
"shouldClose",
|
|
616
615
|
"children"
|
|
617
616
|
]);
|
|
618
617
|
var R;
|
|
619
|
-
const [{ open: r },
|
|
620
|
-
|
|
621
|
-
}, []), g =
|
|
622
|
-
|
|
623
|
-
`SaladBarProvider: MAX_QUEUE_LENGTH (${
|
|
624
|
-
),
|
|
625
|
-
const
|
|
626
|
-
key:
|
|
627
|
-
}),
|
|
628
|
-
return
|
|
629
|
-
}, []),
|
|
630
|
-
const
|
|
631
|
-
if (
|
|
632
|
-
return
|
|
633
|
-
},
|
|
634
|
-
o(
|
|
618
|
+
const [{ open: r }, l] = G({ open: !1 }), c = re([]), x = re(Date.now()), A = re(0), D = xe((v) => {
|
|
619
|
+
l({ open: v });
|
|
620
|
+
}, []), g = xe((v = {}) => {
|
|
621
|
+
A.current += 1, c.current.length >= ye && Date.now() - x.current >= be && (x.current = Date.now(), console.error(
|
|
622
|
+
`SaladBarProvider: MAX_QUEUE_LENGTH (${ye}) hit ${A.current} times in last ${be}ms)`
|
|
623
|
+
), A.current = 0);
|
|
624
|
+
const C = d(b(d({}, ke), {
|
|
625
|
+
key: Bt()
|
|
626
|
+
}), v);
|
|
627
|
+
return c.current.push(C), c.current.length === 1 && l({ open: !0 }), C.key;
|
|
628
|
+
}, []), S = (v = "", C = {}) => g(d({ message: v, severity: "success" }, C)), y = (v = "", C = {}) => g(d({ message: v, severity: "info" }, C)), h = (v = "", C = {}) => g(d({ message: v, severity: "warning" }, C)), k = (v = "", C = {}) => g(d({ message: v, severity: "error" }, C)), F = (v) => {
|
|
629
|
+
const C = c.current.findIndex((B) => B.key === v);
|
|
630
|
+
if (C !== -1)
|
|
631
|
+
return C === 0 ? (l({ open: !1 }), c.current[0]) : c.current.splice(C, 1);
|
|
632
|
+
}, T = (v, C) => {
|
|
633
|
+
o(v, C) && l({ open: !1 });
|
|
635
634
|
}, V = () => {
|
|
636
|
-
},
|
|
637
|
-
|
|
638
|
-
},
|
|
639
|
-
"autoHideDuration" in
|
|
640
|
-
const
|
|
635
|
+
}, K = () => {
|
|
636
|
+
c.current.shift(), c.current.length > 0 && l({ open: !0 });
|
|
637
|
+
}, _ = (R = c.current[0]) != null ? R : d({}, ke), O = {};
|
|
638
|
+
"autoHideDuration" in _ && (O.autoHideDuration = _.autoHideDuration);
|
|
639
|
+
const X = d(d({}, Ot), s), U = d(d({
|
|
641
640
|
open: r,
|
|
642
|
-
setOpen:
|
|
641
|
+
setOpen: D,
|
|
643
642
|
enqueueNotification: g,
|
|
644
|
-
enqueueSuccessNotification:
|
|
645
|
-
enqueueInfoNotification:
|
|
646
|
-
enqueueWarningNotification:
|
|
643
|
+
enqueueSuccessNotification: S,
|
|
644
|
+
enqueueInfoNotification: y,
|
|
645
|
+
enqueueWarningNotification: h,
|
|
647
646
|
enqueueErrorNotification: k,
|
|
648
|
-
removeNotification:
|
|
647
|
+
removeNotification: F
|
|
649
648
|
}, e), t);
|
|
650
|
-
return /* @__PURE__ */ m(
|
|
651
|
-
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
-
|
|
654
|
-
|
|
649
|
+
return /* @__PURE__ */ m(Ke.Provider, { value: U, children: [
|
|
650
|
+
i,
|
|
651
|
+
/* @__PURE__ */ n(
|
|
652
|
+
ut,
|
|
653
|
+
b(d(d({}, X), O), {
|
|
655
654
|
open: r,
|
|
656
|
-
onClose:
|
|
655
|
+
onClose: T,
|
|
657
656
|
TransitionProps: {
|
|
658
|
-
onExited:
|
|
657
|
+
onExited: K,
|
|
659
658
|
onExit: V
|
|
660
659
|
},
|
|
661
|
-
sx: { zIndex:
|
|
660
|
+
sx: { zIndex: Ut },
|
|
662
661
|
children: /* @__PURE__ */ m("div", { children: [
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
|
|
662
|
+
/* @__PURE__ */ n(
|
|
663
|
+
pt,
|
|
665
664
|
{
|
|
666
|
-
onClose: (
|
|
667
|
-
severity:
|
|
665
|
+
onClose: (v) => T(v, "closeAlert"),
|
|
666
|
+
severity: _.severity,
|
|
668
667
|
variant: "filled",
|
|
669
|
-
icon:
|
|
670
|
-
style:
|
|
671
|
-
children:
|
|
668
|
+
icon: _.progressIndicator === "circular" ? /* @__PURE__ */ n(te, { size: "1em" }) : void 0,
|
|
669
|
+
style: _.progressIndicator === "linear" ? Ht : void 0,
|
|
670
|
+
children: _.message
|
|
672
671
|
}
|
|
673
672
|
),
|
|
674
|
-
|
|
673
|
+
_.progressIndicator === "linear" && /* @__PURE__ */ n(Le, { color: "primary" })
|
|
675
674
|
] })
|
|
676
675
|
})
|
|
677
676
|
)
|
|
678
677
|
] });
|
|
679
678
|
}
|
|
680
|
-
class
|
|
679
|
+
class Xe extends Error {
|
|
681
680
|
}
|
|
682
|
-
|
|
683
|
-
function
|
|
684
|
-
const e =
|
|
681
|
+
me(Xe, "errorName", "ContextError");
|
|
682
|
+
function Gt() {
|
|
683
|
+
const e = at(Ke);
|
|
685
684
|
if (e === null)
|
|
686
|
-
throw new
|
|
685
|
+
throw new Xe("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
|
|
687
686
|
return e;
|
|
688
687
|
}
|
|
689
|
-
const
|
|
690
|
-
(e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children:
|
|
691
|
-
),
|
|
692
|
-
var
|
|
693
|
-
const
|
|
694
|
-
JSON.parse((
|
|
695
|
-
),
|
|
696
|
-
(e) => e(
|
|
688
|
+
const Ro = Et(
|
|
689
|
+
(e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children: i }) => /* @__PURE__ */ n(qt, b(d({}, e), { overrideState: t, overrideActions: o, children: /* @__PURE__ */ n(M, { children: i }) }))
|
|
690
|
+
), Ye = "domainCode";
|
|
691
|
+
var Ne;
|
|
692
|
+
const Fe = L(
|
|
693
|
+
JSON.parse((Ne = localStorage.getItem(Ye)) != null ? Ne : '{"domainCode": ""}').domainCode
|
|
694
|
+
), Vt = L(
|
|
695
|
+
(e) => e(Fe),
|
|
697
696
|
(e, t, o) => {
|
|
698
|
-
t(
|
|
697
|
+
t(Fe, o), localStorage.setItem(Ye, JSON.stringify({ domainCode: o }));
|
|
699
698
|
}
|
|
700
|
-
),
|
|
699
|
+
), Kt = {
|
|
701
700
|
act: "ACT",
|
|
702
701
|
nsw: "NSW",
|
|
703
702
|
nt: "NT",
|
|
@@ -709,102 +708,102 @@ const De = T(
|
|
|
709
708
|
ag: "AG",
|
|
710
709
|
fedmps: "FedMPs",
|
|
711
710
|
"": ""
|
|
712
|
-
},
|
|
711
|
+
}, Qe = (e) => {
|
|
713
712
|
var t;
|
|
714
|
-
return e === null ? "N/A" : (t =
|
|
715
|
-
},
|
|
713
|
+
return e === null ? "N/A" : (t = Kt[e]) != null ? t : "";
|
|
714
|
+
}, Uo = ({
|
|
716
715
|
isLoading: e,
|
|
717
716
|
isOpen: t,
|
|
718
717
|
onClose: o,
|
|
719
|
-
onDomainChange:
|
|
718
|
+
onDomainChange: i,
|
|
720
719
|
domainOptions: s,
|
|
721
720
|
applicationName: a,
|
|
722
|
-
handleLogout:
|
|
721
|
+
handleLogout: u
|
|
723
722
|
}) => {
|
|
724
|
-
const [r,
|
|
725
|
-
|
|
726
|
-
}),
|
|
727
|
-
r && !
|
|
723
|
+
const [r, l] = W(Vt), [c, x] = G(r), { enqueueSuccessNotification: A } = Gt(), D = s.length === 0, g = !!r && !s.includes(r) && !s.includes(c), S = !r || D || g, y = () => N(null, null, function* () {
|
|
724
|
+
c ? (l(c), i == null || i(c), A(`Set organisation to ${c}`), o()) : (l(""), i == null || i(""));
|
|
725
|
+
}), h = () => N(null, null, function* () {
|
|
726
|
+
r && !D && !g ? (x(r), o()) : S && u();
|
|
728
727
|
});
|
|
729
728
|
let k;
|
|
730
|
-
return
|
|
731
|
-
|
|
729
|
+
return D ? k = "Unable to retrieve your active organisations. Try logging in again." : g && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ m(
|
|
730
|
+
qe,
|
|
732
731
|
{
|
|
733
732
|
isOpen: t,
|
|
734
733
|
dialogTitle: "Select an organisation",
|
|
735
734
|
primaryButton: {
|
|
736
735
|
text: "Confirm",
|
|
737
|
-
onClick:
|
|
738
|
-
disabled: !
|
|
736
|
+
onClick: y,
|
|
737
|
+
disabled: !c || D || g,
|
|
739
738
|
buttonColor: "primary"
|
|
740
739
|
},
|
|
741
740
|
secondaryButton: {
|
|
742
|
-
text:
|
|
743
|
-
onClick:
|
|
741
|
+
text: S ? "Logout" : "Cancel",
|
|
742
|
+
onClick: h
|
|
744
743
|
},
|
|
745
|
-
onClose:
|
|
744
|
+
onClose: S ? () => {
|
|
746
745
|
} : o,
|
|
747
746
|
children: [
|
|
748
|
-
/* @__PURE__ */ m(
|
|
747
|
+
/* @__PURE__ */ m(I, { marginBottom: 2, children: [
|
|
749
748
|
"Select the default organisation that you want to use with the ",
|
|
750
749
|
a,
|
|
751
750
|
"."
|
|
752
751
|
] }),
|
|
753
|
-
/* @__PURE__ */
|
|
754
|
-
|
|
752
|
+
/* @__PURE__ */ n(
|
|
753
|
+
le,
|
|
755
754
|
{
|
|
756
755
|
loading: e,
|
|
757
756
|
multiple: !1,
|
|
758
757
|
disableClearable: !1,
|
|
759
|
-
value:
|
|
760
|
-
onChange: (
|
|
761
|
-
getOptionLabel:
|
|
758
|
+
value: c !== "" ? c : null,
|
|
759
|
+
onChange: (F, T) => x(T != null ? T : ""),
|
|
760
|
+
getOptionLabel: Qe,
|
|
762
761
|
options: [...s.toSorted()],
|
|
763
|
-
renderInput: (
|
|
764
|
-
|
|
765
|
-
|
|
762
|
+
renderInput: (F) => /* @__PURE__ */ n(
|
|
763
|
+
ce,
|
|
764
|
+
b(d({}, F), {
|
|
766
765
|
variant: "filled",
|
|
767
766
|
label: "Select organisation",
|
|
768
|
-
InputProps:
|
|
769
|
-
endAdornment: /* @__PURE__ */ m(
|
|
770
|
-
e ? /* @__PURE__ */
|
|
771
|
-
|
|
767
|
+
InputProps: b(d({}, F.InputProps), {
|
|
768
|
+
endAdornment: /* @__PURE__ */ m(M, { children: [
|
|
769
|
+
e ? /* @__PURE__ */ n(te, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
|
|
770
|
+
F.InputProps.endAdornment
|
|
772
771
|
] })
|
|
773
772
|
})
|
|
774
773
|
})
|
|
775
774
|
)
|
|
776
775
|
}
|
|
777
776
|
),
|
|
778
|
-
k && /* @__PURE__ */
|
|
777
|
+
k && /* @__PURE__ */ n(ht, { error: !0, children: k })
|
|
779
778
|
]
|
|
780
779
|
}
|
|
781
780
|
);
|
|
782
|
-
},
|
|
783
|
-
const e =
|
|
784
|
-
return
|
|
785
|
-
},
|
|
786
|
-
function
|
|
787
|
-
return /* @__PURE__ */
|
|
781
|
+
}, Je = () => {
|
|
782
|
+
const e = oe();
|
|
783
|
+
return ft(e.breakpoints.down("sm"));
|
|
784
|
+
}, Xt = 64, Yt = 72, Qt = 256, ee = L(!0), Jt = L(Qt), Zt = L(Yt), Ee = L(""), jt = L(void 0), eo = L(Xt), to = L(void 0);
|
|
785
|
+
function oo({ links: e }) {
|
|
786
|
+
return /* @__PURE__ */ n("div", { children: "LinksMenu not implemented yet" });
|
|
788
787
|
}
|
|
789
|
-
const
|
|
790
|
-
root: `${
|
|
791
|
-
menuButton: `${
|
|
792
|
-
hide: `${
|
|
793
|
-
content: `${
|
|
788
|
+
const Z = "Navbar", Y = {
|
|
789
|
+
root: `${Z}-root`,
|
|
790
|
+
menuButton: `${Z}-menuButton`,
|
|
791
|
+
hide: `${Z}-hide`,
|
|
792
|
+
content: `${Z}-content`
|
|
794
793
|
// userInfoHolder: `${PREFIX}-userInfoHolder`,
|
|
795
794
|
// settings: `${PREFIX}-settings`,
|
|
796
795
|
// pieChartIcon: `${PREFIX}-pieChartIcon`,
|
|
797
|
-
},
|
|
798
|
-
[`&.${
|
|
796
|
+
}, no = We(P, { name: "NavBar" })(({ theme: e }) => ({
|
|
797
|
+
[`&.${Y.root}`]: {
|
|
799
798
|
display: "flex"
|
|
800
799
|
},
|
|
801
|
-
[`& .${
|
|
800
|
+
[`& .${Y.menuButton}`]: {
|
|
802
801
|
marginRight: 36
|
|
803
802
|
},
|
|
804
|
-
[`& .${
|
|
803
|
+
[`& .${Y.hide}`]: {
|
|
805
804
|
display: "none"
|
|
806
805
|
},
|
|
807
|
-
[`& .${
|
|
806
|
+
[`& .${Y.content}`]: {
|
|
808
807
|
flexGrow: 1,
|
|
809
808
|
padding: e.spacing(3)
|
|
810
809
|
}
|
|
@@ -813,14 +812,14 @@ const Y = "Navbar", K = {
|
|
|
813
812
|
// marginTop: '64px',
|
|
814
813
|
// marginBottom: '16px',
|
|
815
814
|
// },
|
|
816
|
-
})),
|
|
815
|
+
})), z = (e, t, o) => e.transitions.create(t, {
|
|
817
816
|
easing: e.transitions.easing.sharp,
|
|
818
817
|
duration: o === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
|
|
819
|
-
}),
|
|
820
|
-
const t =
|
|
821
|
-
return /* @__PURE__ */
|
|
822
|
-
|
|
823
|
-
|
|
818
|
+
}), io = (e) => {
|
|
819
|
+
const t = oe();
|
|
820
|
+
return /* @__PURE__ */ n(
|
|
821
|
+
gt,
|
|
822
|
+
d({
|
|
824
823
|
easing: t.transitions.easing.sharp,
|
|
825
824
|
timeout: {
|
|
826
825
|
enter: t.transitions.duration.enteringScreen,
|
|
@@ -828,7 +827,7 @@ const Y = "Navbar", K = {
|
|
|
828
827
|
}
|
|
829
828
|
}, e)
|
|
830
829
|
);
|
|
831
|
-
},
|
|
830
|
+
}, Ze = (e) => {
|
|
832
831
|
var t, o;
|
|
833
832
|
return {
|
|
834
833
|
overflowX: "hidden",
|
|
@@ -836,104 +835,104 @@ const Y = "Navbar", K = {
|
|
|
836
835
|
backgroundColor: (o = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? o : "white"
|
|
837
836
|
// Provide default so tests don't need to wrap theme provider
|
|
838
837
|
};
|
|
839
|
-
},
|
|
838
|
+
}, _e = (e, t) => d({
|
|
840
839
|
width: t,
|
|
841
|
-
transition:
|
|
842
|
-
},
|
|
840
|
+
transition: z(e, "width", "entering")
|
|
841
|
+
}, Ze(e)), Ie = (e, t) => d({
|
|
843
842
|
width: t,
|
|
844
|
-
transition:
|
|
845
|
-
},
|
|
843
|
+
transition: z(e, "width", "leaving")
|
|
844
|
+
}, Ze(e)), ro = We(mt, {
|
|
846
845
|
shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
|
|
847
|
-
})(({ theme: e, open: t, widthOpen: o, widthClosed:
|
|
846
|
+
})(({ theme: e, open: t, widthOpen: o, widthClosed: i, isSmallScreen: s }) => d(d({
|
|
848
847
|
flexShrink: 0,
|
|
849
848
|
whiteSpace: "nowrap",
|
|
850
849
|
boxSizing: "border-box",
|
|
851
850
|
display: "flex",
|
|
852
851
|
flexDirection: "column"
|
|
853
|
-
}, t &&
|
|
852
|
+
}, t && b(d({}, _e(e, o)), {
|
|
854
853
|
backgroundColor: "",
|
|
855
|
-
"& .MuiDrawer-paper":
|
|
856
|
-
})), !t &&
|
|
854
|
+
"& .MuiDrawer-paper": _e(e, o)
|
|
855
|
+
})), !t && b(d({}, Ie(e, s ? o : i)), {
|
|
857
856
|
backgroundColor: "",
|
|
858
|
-
"& .MuiDrawer-paper":
|
|
857
|
+
"& .MuiDrawer-paper": Ie(e, s ? o : i)
|
|
859
858
|
})));
|
|
860
|
-
function
|
|
859
|
+
function je(e) {
|
|
861
860
|
return e.replace(
|
|
862
861
|
/(^|-)([a-z])/g,
|
|
863
|
-
(t, o,
|
|
862
|
+
(t, o, i) => o === "-" ? " " + i.toUpperCase() : i.toUpperCase()
|
|
864
863
|
);
|
|
865
864
|
}
|
|
866
|
-
function
|
|
867
|
-
var
|
|
865
|
+
function Bo(e, t, o, i) {
|
|
866
|
+
var u;
|
|
868
867
|
if (!e) return "None";
|
|
869
868
|
const a = Object.entries(e).filter(
|
|
870
|
-
([r,
|
|
869
|
+
([r, l]) => r.startsWith("https://greens.org.au/roles/") && l.includes(t)
|
|
871
870
|
).map(
|
|
872
871
|
([r]) => {
|
|
873
|
-
var
|
|
874
|
-
return
|
|
872
|
+
var l;
|
|
873
|
+
return je((l = r.split("/").at(-1)) != null ? l : "");
|
|
875
874
|
}
|
|
876
875
|
);
|
|
877
|
-
return (
|
|
878
|
-
(r) => o[r].some((
|
|
879
|
-
)) != null ?
|
|
876
|
+
return (u = i.find(
|
|
877
|
+
(r) => o[r].some((l) => a.includes(l))
|
|
878
|
+
)) != null ? u : "None";
|
|
880
879
|
}
|
|
881
|
-
const
|
|
882
|
-
const { getIdTokenClaims: t, user: o } =
|
|
883
|
-
return
|
|
880
|
+
const Ho = (e) => {
|
|
881
|
+
const { getIdTokenClaims: t, user: o } = de();
|
|
882
|
+
return Be({
|
|
884
883
|
queryKey: ["availableDomains", o == null ? void 0 : o.sub],
|
|
885
|
-
queryFn: () =>
|
|
886
|
-
const
|
|
887
|
-
return
|
|
888
|
-
var
|
|
889
|
-
const r =
|
|
890
|
-
return [.../* @__PURE__ */ new Set([...s, ...
|
|
884
|
+
queryFn: () => N(null, null, function* () {
|
|
885
|
+
const i = yield t();
|
|
886
|
+
return i ? Object.entries(i).reduce((s, [a, u]) => {
|
|
887
|
+
var c;
|
|
888
|
+
const r = je((c = a.split("/").at(-1)) != null ? c : ""), l = a.startsWith("https://greens.org.au/roles/") && e.includes(r) ? u : [];
|
|
889
|
+
return [.../* @__PURE__ */ new Set([...s, ...l])];
|
|
891
890
|
}, []) : [];
|
|
892
891
|
})
|
|
893
892
|
});
|
|
894
|
-
},
|
|
893
|
+
}, Wo = (e) => Object.values(e).reduce(
|
|
895
894
|
(t, o) => [.../* @__PURE__ */ new Set([...t, ...o])],
|
|
896
895
|
[]
|
|
897
|
-
),
|
|
896
|
+
), j = {
|
|
898
897
|
log: console.warn.bind(console),
|
|
899
898
|
error: console.error.bind(console),
|
|
900
899
|
warn: console.warn.bind(console),
|
|
901
900
|
info: console.info.bind(console),
|
|
902
901
|
debug: console.debug.bind(console)
|
|
903
902
|
};
|
|
904
|
-
function
|
|
903
|
+
function zo(e, t) {
|
|
905
904
|
console[e] = (...o) => {
|
|
906
|
-
for (const
|
|
907
|
-
if (typeof
|
|
908
|
-
if (
|
|
909
|
-
} else if (
|
|
905
|
+
for (const i of t)
|
|
906
|
+
if (typeof i == "function") {
|
|
907
|
+
if (i(...o)) return;
|
|
908
|
+
} else if (i instanceof RegExp && o.length > 0) {
|
|
910
909
|
for (const s of o)
|
|
911
|
-
if (typeof s == "string" &&
|
|
910
|
+
if (typeof s == "string" && i.test(s))
|
|
912
911
|
return;
|
|
913
912
|
}
|
|
914
|
-
|
|
913
|
+
j[e](o);
|
|
915
914
|
};
|
|
916
915
|
}
|
|
917
|
-
function
|
|
916
|
+
function qo(e) {
|
|
918
917
|
if (e)
|
|
919
|
-
console[e] =
|
|
918
|
+
console[e] = j[e];
|
|
920
919
|
else
|
|
921
|
-
for (const t of Object.keys(
|
|
922
|
-
console[t] =
|
|
920
|
+
for (const t of Object.keys(j))
|
|
921
|
+
console[t] = j[t];
|
|
923
922
|
}
|
|
924
|
-
function
|
|
923
|
+
function so(e) {
|
|
925
924
|
let t = 0;
|
|
926
|
-
for (let o = 0,
|
|
925
|
+
for (let o = 0, i = e.length; o < i; o++) {
|
|
927
926
|
const s = e.charCodeAt(o);
|
|
928
927
|
t = (t << 5) - t + s, t |= 0;
|
|
929
928
|
}
|
|
930
929
|
return t;
|
|
931
930
|
}
|
|
932
|
-
const
|
|
933
|
-
function
|
|
934
|
-
const s =
|
|
931
|
+
const Pe = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Te = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
|
|
932
|
+
function ao({ user: e, domainCode: t, open: o, useNewAvatar: i = !1 }) {
|
|
933
|
+
const s = oe();
|
|
935
934
|
return /* @__PURE__ */ m(
|
|
936
|
-
|
|
935
|
+
P,
|
|
937
936
|
{
|
|
938
937
|
sx: {
|
|
939
938
|
paddingTop: 3,
|
|
@@ -943,67 +942,67 @@ function ro({ user: e, domainCode: t, open: o, useNewAvatar: n = !1 }) {
|
|
|
943
942
|
gap: "0.5rem"
|
|
944
943
|
},
|
|
945
944
|
children: [
|
|
946
|
-
!
|
|
947
|
-
|
|
945
|
+
!i && /* @__PURE__ */ n(
|
|
946
|
+
P,
|
|
948
947
|
{
|
|
949
948
|
sx: {
|
|
950
949
|
width: o ? "5rem" : "2rem",
|
|
951
|
-
transition: o ?
|
|
950
|
+
transition: o ? z(s, ["width", "height"], "entering") : z(s, ["width", "height"], "leaving"),
|
|
952
951
|
aspectRatio: 1
|
|
953
952
|
},
|
|
954
|
-
children: e != null && e.name ? /* @__PURE__ */
|
|
955
|
-
|
|
953
|
+
children: e != null && e.name ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(
|
|
954
|
+
Ae,
|
|
956
955
|
{
|
|
957
956
|
src: e == null ? void 0 : e.picture,
|
|
958
957
|
sx: {
|
|
959
958
|
width: "100%",
|
|
960
959
|
height: "100%",
|
|
961
|
-
bgcolor:
|
|
960
|
+
bgcolor: Pe[Math.abs(so(e == null ? void 0 : e.name)) % Pe.length]
|
|
962
961
|
},
|
|
963
|
-
children:
|
|
962
|
+
children: Te(e == null ? void 0 : e.name)
|
|
964
963
|
}
|
|
965
|
-
) }) : /* @__PURE__ */
|
|
964
|
+
) }) : /* @__PURE__ */ n(Ae, { sx: { width: "100%", height: "100%" } })
|
|
966
965
|
}
|
|
967
966
|
),
|
|
968
|
-
|
|
969
|
-
|
|
967
|
+
i && /* @__PURE__ */ n(
|
|
968
|
+
P,
|
|
970
969
|
{
|
|
971
970
|
sx: {
|
|
972
971
|
width: o ? "5rem" : "2rem",
|
|
973
|
-
transition: o ?
|
|
972
|
+
transition: o ? z(s, ["width", "height"], "entering") : z(s, ["width", "height"], "leaving"),
|
|
974
973
|
aspectRatio: 1
|
|
975
974
|
},
|
|
976
|
-
children: e != null && e.name ? /* @__PURE__ */
|
|
975
|
+
children: e != null && e.name ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ m(De, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: o ? "80" : "32", children: [
|
|
977
976
|
" ",
|
|
978
|
-
|
|
977
|
+
Te(e == null ? void 0 : e.name),
|
|
979
978
|
" ",
|
|
980
979
|
"ab"
|
|
981
|
-
] }) }) : /* @__PURE__ */
|
|
980
|
+
] }) }) : /* @__PURE__ */ n(De, {})
|
|
982
981
|
}
|
|
983
982
|
),
|
|
984
|
-
/* @__PURE__ */
|
|
985
|
-
e != null && e.name ? /* @__PURE__ */
|
|
986
|
-
t ? /* @__PURE__ */
|
|
983
|
+
/* @__PURE__ */ n(io, { sx: { width: "100%" }, in: o, children: /* @__PURE__ */ n(xt, { in: o, children: /* @__PURE__ */ m(P, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
984
|
+
e != null && e.name ? /* @__PURE__ */ n(I, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ n(Ce, { animation: !1, width: "50%" }),
|
|
985
|
+
t ? /* @__PURE__ */ n(I, { children: Qe(t) }) : /* @__PURE__ */ n(Ce, { animation: !1, width: "25%" })
|
|
987
986
|
] }) }) })
|
|
988
987
|
]
|
|
989
988
|
}
|
|
990
989
|
);
|
|
991
990
|
}
|
|
992
|
-
function
|
|
991
|
+
function lo({
|
|
993
992
|
open: e,
|
|
994
993
|
widthClosed: t,
|
|
995
994
|
widthOpen: o,
|
|
996
|
-
"data-testid":
|
|
995
|
+
"data-testid": i,
|
|
997
996
|
top: s,
|
|
998
997
|
middle: a,
|
|
999
|
-
bottom:
|
|
998
|
+
bottom: u,
|
|
1000
999
|
user: r,
|
|
1001
|
-
domainCode:
|
|
1002
|
-
useNewAvatar:
|
|
1000
|
+
domainCode: l,
|
|
1001
|
+
useNewAvatar: c = !1
|
|
1003
1002
|
}) {
|
|
1004
|
-
const x =
|
|
1005
|
-
return /* @__PURE__ */
|
|
1006
|
-
|
|
1003
|
+
const x = Je(), A = He(ee);
|
|
1004
|
+
return /* @__PURE__ */ n(no, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ m(
|
|
1005
|
+
ro,
|
|
1007
1006
|
{
|
|
1008
1007
|
open: e,
|
|
1009
1008
|
widthOpen: o,
|
|
@@ -1014,41 +1013,41 @@ function so({
|
|
|
1014
1013
|
component: "nav"
|
|
1015
1014
|
},
|
|
1016
1015
|
onClose: () => {
|
|
1017
|
-
|
|
1016
|
+
A(!1);
|
|
1018
1017
|
},
|
|
1019
1018
|
isSmallScreen: x,
|
|
1020
1019
|
children: [
|
|
1021
|
-
!x && /* @__PURE__ */
|
|
1022
|
-
s && /* @__PURE__ */ m(
|
|
1020
|
+
!x && /* @__PURE__ */ n(At, {}),
|
|
1021
|
+
s && /* @__PURE__ */ m(P, { flexGrow: "0", children: [
|
|
1023
1022
|
s,
|
|
1024
|
-
/* @__PURE__ */
|
|
1023
|
+
/* @__PURE__ */ n(Se, { variant: "middle", sx: { marginY: "0.5rem" } })
|
|
1025
1024
|
] }),
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
/* @__PURE__ */ m(
|
|
1028
|
-
/* @__PURE__ */
|
|
1029
|
-
/* @__PURE__ */
|
|
1030
|
-
|
|
1025
|
+
/* @__PURE__ */ n(P, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ n(oo, { links: a }) : a }),
|
|
1026
|
+
/* @__PURE__ */ m(P, { flexGrow: "0", children: [
|
|
1027
|
+
/* @__PURE__ */ n(Se, { variant: "middle", sx: { marginY: "0.5rem" } }),
|
|
1028
|
+
/* @__PURE__ */ n(ao, { user: r, domainCode: l, open: e, useNewAvatar: c }),
|
|
1029
|
+
u && /* @__PURE__ */ n(M, { children: u })
|
|
1031
1030
|
] })
|
|
1032
1031
|
]
|
|
1033
1032
|
}
|
|
1034
1033
|
) });
|
|
1035
1034
|
}
|
|
1036
|
-
function
|
|
1035
|
+
function co({
|
|
1037
1036
|
children: e,
|
|
1038
1037
|
topBarHeight: t,
|
|
1039
1038
|
maxWidth: o = !1,
|
|
1040
|
-
noPadding:
|
|
1039
|
+
noPadding: i
|
|
1041
1040
|
}) {
|
|
1042
|
-
return /* @__PURE__ */
|
|
1043
|
-
|
|
1041
|
+
return /* @__PURE__ */ n(
|
|
1042
|
+
P,
|
|
1044
1043
|
{
|
|
1045
1044
|
sx: {
|
|
1046
1045
|
overflow: "auto",
|
|
1047
1046
|
height: `calc(100vh - ${t}px)`,
|
|
1048
1047
|
flexGrow: 1
|
|
1049
1048
|
},
|
|
1050
|
-
children:
|
|
1051
|
-
|
|
1049
|
+
children: i ? /* @__PURE__ */ n(P, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ n(
|
|
1050
|
+
Ct,
|
|
1052
1051
|
{
|
|
1053
1052
|
component: "main",
|
|
1054
1053
|
id: "main-content",
|
|
@@ -1060,18 +1059,18 @@ function ao({
|
|
|
1060
1059
|
}
|
|
1061
1060
|
);
|
|
1062
1061
|
}
|
|
1063
|
-
const
|
|
1064
|
-
titleText: `${
|
|
1062
|
+
const uo = "TopBar", po = {
|
|
1063
|
+
titleText: `${uo}-titleText`
|
|
1065
1064
|
};
|
|
1066
|
-
function
|
|
1065
|
+
function ho({
|
|
1067
1066
|
titleText: e = "",
|
|
1068
1067
|
height: t,
|
|
1069
1068
|
"data-testid": o,
|
|
1070
|
-
middle:
|
|
1069
|
+
middle: i
|
|
1071
1070
|
}) {
|
|
1072
|
-
const s =
|
|
1073
|
-
return /* @__PURE__ */
|
|
1074
|
-
|
|
1071
|
+
const s = He(ee), a = () => s((l) => !l), u = oe(), r = Je();
|
|
1072
|
+
return /* @__PURE__ */ n("header", { "data-testid": o, children: /* @__PURE__ */ m(
|
|
1073
|
+
$e,
|
|
1075
1074
|
{
|
|
1076
1075
|
square: !0,
|
|
1077
1076
|
elevation: 0,
|
|
@@ -1085,85 +1084,85 @@ function uo({
|
|
|
1085
1084
|
gap: 2,
|
|
1086
1085
|
flexShrink: 0,
|
|
1087
1086
|
height: t,
|
|
1088
|
-
zIndex: r ? 0 :
|
|
1087
|
+
zIndex: r ? 0 : u.zIndex.drawer + 101
|
|
1089
1088
|
},
|
|
1090
1089
|
children: [
|
|
1091
|
-
/* @__PURE__ */
|
|
1092
|
-
|
|
1090
|
+
/* @__PURE__ */ n(
|
|
1091
|
+
St,
|
|
1093
1092
|
{
|
|
1094
1093
|
size: "medium",
|
|
1095
1094
|
color: "inherit",
|
|
1096
1095
|
sx: { padding: 1.5, marginLeft: "12px" },
|
|
1097
1096
|
onClick: a,
|
|
1098
|
-
children: /* @__PURE__ */
|
|
1097
|
+
children: /* @__PURE__ */ n(Dt, { fontSize: "medium" })
|
|
1099
1098
|
}
|
|
1100
1099
|
),
|
|
1101
|
-
/* @__PURE__ */
|
|
1102
|
-
|
|
1100
|
+
/* @__PURE__ */ n(I, { className: po.titleText, variant: "h6", component: "h1", children: e }),
|
|
1101
|
+
i
|
|
1103
1102
|
]
|
|
1104
1103
|
}
|
|
1105
1104
|
) });
|
|
1106
1105
|
}
|
|
1107
|
-
function
|
|
1106
|
+
function Go({
|
|
1108
1107
|
children: e,
|
|
1109
1108
|
initialTitleText: t,
|
|
1110
1109
|
initialNavBarOpen: o,
|
|
1111
|
-
pageContainerProps:
|
|
1110
|
+
pageContainerProps: i,
|
|
1112
1111
|
pageContentDataTestId: s,
|
|
1113
1112
|
topBarDataTestId: a,
|
|
1114
|
-
navBarDataTestId:
|
|
1113
|
+
navBarDataTestId: u,
|
|
1115
1114
|
navBarMiddle: r,
|
|
1116
|
-
navBarBottom:
|
|
1117
|
-
user:
|
|
1115
|
+
navBarBottom: l,
|
|
1116
|
+
user: c,
|
|
1118
1117
|
domainCode: x,
|
|
1119
|
-
useNewAvatar:
|
|
1118
|
+
useNewAvatar: A = !1
|
|
1120
1119
|
}) {
|
|
1121
|
-
|
|
1122
|
-
[
|
|
1123
|
-
[
|
|
1120
|
+
It([
|
|
1121
|
+
[ee, o != null ? o : !0],
|
|
1122
|
+
[Ee, t != null ? t : ""]
|
|
1124
1123
|
]);
|
|
1125
|
-
const
|
|
1126
|
-
return /* @__PURE__ */ m(
|
|
1127
|
-
/* @__PURE__ */
|
|
1128
|
-
/* @__PURE__ */
|
|
1129
|
-
|
|
1124
|
+
const D = we(ee), [g] = W(Jt), [S] = W(Zt), y = we(Ee), [h] = W(eo), [k] = W(jt), [F] = W(to);
|
|
1125
|
+
return /* @__PURE__ */ m(ve, { children: [
|
|
1126
|
+
/* @__PURE__ */ n(_t, {}),
|
|
1127
|
+
/* @__PURE__ */ n(
|
|
1128
|
+
ho,
|
|
1130
1129
|
{
|
|
1131
|
-
titleText:
|
|
1130
|
+
titleText: y,
|
|
1132
1131
|
"data-testid": a,
|
|
1133
|
-
height:
|
|
1132
|
+
height: h,
|
|
1134
1133
|
middle: k
|
|
1135
1134
|
}
|
|
1136
1135
|
),
|
|
1137
|
-
/* @__PURE__ */ m(
|
|
1138
|
-
/* @__PURE__ */
|
|
1139
|
-
|
|
1136
|
+
/* @__PURE__ */ m(ve, { sx: { display: "flex" }, children: [
|
|
1137
|
+
/* @__PURE__ */ n(
|
|
1138
|
+
lo,
|
|
1140
1139
|
{
|
|
1141
|
-
open:
|
|
1142
|
-
top:
|
|
1140
|
+
open: D,
|
|
1141
|
+
top: F,
|
|
1143
1142
|
middle: r,
|
|
1144
|
-
bottom:
|
|
1145
|
-
user:
|
|
1143
|
+
bottom: l,
|
|
1144
|
+
user: c,
|
|
1146
1145
|
domainCode: x,
|
|
1147
1146
|
widthOpen: g,
|
|
1148
|
-
widthClosed:
|
|
1149
|
-
offsetTop:
|
|
1150
|
-
"data-testid":
|
|
1151
|
-
useNewAvatar:
|
|
1147
|
+
widthClosed: S,
|
|
1148
|
+
offsetTop: h,
|
|
1149
|
+
"data-testid": u,
|
|
1150
|
+
useNewAvatar: A
|
|
1152
1151
|
}
|
|
1153
1152
|
),
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
-
|
|
1156
|
-
|
|
1153
|
+
/* @__PURE__ */ n(
|
|
1154
|
+
co,
|
|
1155
|
+
b(d({
|
|
1157
1156
|
"data-testid": s,
|
|
1158
|
-
topBarHeight:
|
|
1159
|
-
},
|
|
1157
|
+
topBarHeight: h
|
|
1158
|
+
}, i), {
|
|
1160
1159
|
children: e
|
|
1161
1160
|
})
|
|
1162
1161
|
)
|
|
1163
1162
|
] })
|
|
1164
1163
|
] });
|
|
1165
1164
|
}
|
|
1166
|
-
const
|
|
1165
|
+
const Vo = ze({
|
|
1167
1166
|
palette: {
|
|
1168
1167
|
primary: {
|
|
1169
1168
|
dark: "#00A651",
|
|
@@ -1214,7 +1213,7 @@ const zo = Be({
|
|
|
1214
1213
|
navBar: {
|
|
1215
1214
|
backgroundColor: "#E8E8E8"
|
|
1216
1215
|
}
|
|
1217
|
-
}),
|
|
1216
|
+
}), Ko = ze({
|
|
1218
1217
|
palette: {
|
|
1219
1218
|
primary: {
|
|
1220
1219
|
main: "#007236",
|
|
@@ -1268,18 +1267,18 @@ const zo = Be({
|
|
|
1268
1267
|
styleOverrides: {
|
|
1269
1268
|
root: ({ theme: e }) => ({
|
|
1270
1269
|
"&.Mui-selected": {
|
|
1271
|
-
backgroundColor:
|
|
1270
|
+
backgroundColor: se(
|
|
1272
1271
|
e.palette.secondary.main,
|
|
1273
1272
|
e.palette.action.selectedOpacity
|
|
1274
1273
|
),
|
|
1275
1274
|
"&:hover": {
|
|
1276
|
-
backgroundColor:
|
|
1275
|
+
backgroundColor: se(
|
|
1277
1276
|
e.palette.secondary.main,
|
|
1278
1277
|
e.palette.action.selectedOpacity
|
|
1279
1278
|
)
|
|
1280
1279
|
},
|
|
1281
1280
|
"&.Mui-focusVisible": {
|
|
1282
|
-
backgroundColor:
|
|
1281
|
+
backgroundColor: se(
|
|
1283
1282
|
e.palette.secondary.main,
|
|
1284
1283
|
e.palette.action.focusOpacity
|
|
1285
1284
|
)
|
|
@@ -1310,39 +1309,39 @@ const zo = Be({
|
|
|
1310
1309
|
}
|
|
1311
1310
|
});
|
|
1312
1311
|
export {
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1312
|
+
qe as AgDialog,
|
|
1313
|
+
Go as AppLayout,
|
|
1314
|
+
Oo as AuthGuard,
|
|
1315
|
+
Ke as Context,
|
|
1316
|
+
Xe as ContextError,
|
|
1317
|
+
Kt as DOMAIN_CODE_LABELS,
|
|
1318
|
+
Uo as DomainCodeDialog,
|
|
1319
|
+
To as ExampleComponent,
|
|
1320
|
+
No as FetchAutocomplete,
|
|
1321
|
+
$o as MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX,
|
|
1322
|
+
qt as SaladBarProvider,
|
|
1323
|
+
Lo as SessionExpiryDialog,
|
|
1324
|
+
Mo as SingleAutocomplete,
|
|
1325
|
+
Bo as determineUserLevelFromClaims,
|
|
1326
|
+
Vt as domainCodeAtom,
|
|
1327
|
+
Vo as fed21Theme,
|
|
1328
|
+
Tt as getAuth0Expiry,
|
|
1329
|
+
Qe as getDomainOptionLabel,
|
|
1330
|
+
Wo as getValidBusinessRoles,
|
|
1331
|
+
Ko as internalAgSystemsTheme,
|
|
1332
|
+
ee as navBarOpenAtom,
|
|
1333
|
+
to as navBarTopAtom,
|
|
1334
|
+
Zt as navBarWidthClosedAtom,
|
|
1335
|
+
Jt as navBarWidthOpenAtom,
|
|
1336
|
+
so as simpleHashCode,
|
|
1337
|
+
zo as suppressConsole,
|
|
1338
|
+
Ee as titleTextAtom,
|
|
1339
|
+
eo as topBarHeightAtom,
|
|
1340
|
+
jt as topBarMiddleAtom,
|
|
1341
|
+
qo as unsuppressConsole,
|
|
1342
|
+
Ve as useAutocompleteOptions,
|
|
1343
|
+
Gt as useSaladBar,
|
|
1344
|
+
Ho as useValidDomains,
|
|
1345
|
+
Ro as withSaladBarProvider
|
|
1347
1346
|
};
|
|
1348
1347
|
//# sourceMappingURL=index.js.map
|