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