@australiangreens/ag-internal-components 0.0.77 → 0.0.78-experiment1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,64 +1,64 @@
1
- var It = Object.defineProperty, $t = Object.defineProperties;
2
- var Tt = Object.getOwnPropertyDescriptors;
3
- var Z = Object.getOwnPropertySymbols;
4
- var Ie = Object.prototype.hasOwnProperty, $e = Object.prototype.propertyIsEnumerable;
5
- var ce = (e, t, n) => t in e ? It(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, a = (e, t) => {
1
+ var Ft = Object.defineProperty, Et = Object.defineProperties;
2
+ var Nt = Object.getOwnPropertyDescriptors;
3
+ var j = Object.getOwnPropertySymbols;
4
+ var Te = Object.prototype.hasOwnProperty, ye = Object.prototype.propertyIsEnumerable;
5
+ var de = (e, t, n) => t in e ? Ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, a = (e, t) => {
6
6
  for (var n in t || (t = {}))
7
- Ie.call(t, n) && ce(e, n, t[n]);
8
- if (Z)
9
- for (var n of Z(t))
10
- $e.call(t, n) && ce(e, n, t[n]);
7
+ Te.call(t, n) && de(e, n, t[n]);
8
+ if (j)
9
+ for (var n of j(t))
10
+ ye.call(t, n) && de(e, n, t[n]);
11
11
  return e;
12
- }, A = (e, t) => $t(e, Tt(t));
13
- var Te = (e, t) => {
12
+ }, b = (e, t) => Et(e, Nt(t));
13
+ var Oe = (e, t) => {
14
14
  var n = {};
15
15
  for (var i in e)
16
- Ie.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
17
- if (e != null && Z)
18
- for (var i of Z(e))
19
- t.indexOf(i) < 0 && $e.call(e, i) && (n[i] = e[i]);
16
+ Te.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
17
+ if (e != null && j)
18
+ for (var i of j(e))
19
+ t.indexOf(i) < 0 && ye.call(e, i) && (n[i] = e[i]);
20
20
  return n;
21
21
  };
22
- var Ee = (e, t, n) => (ce(e, typeof t != "symbol" ? t + "" : t, n), n);
23
- var B = (e, t, n) => new Promise((i, r) => {
22
+ var Fe = (e, t, n) => (de(e, typeof t != "symbol" ? t + "" : t, n), n);
23
+ var z = (e, t, n) => new Promise((i, r) => {
24
24
  var s = (c) => {
25
25
  try {
26
- u(n.next(c));
27
- } catch (d) {
28
- r(d);
26
+ d(n.next(c));
27
+ } catch (u) {
28
+ r(u);
29
29
  }
30
30
  }, l = (c) => {
31
31
  try {
32
- u(n.throw(c));
33
- } catch (d) {
34
- r(d);
32
+ d(n.throw(c));
33
+ } catch (u) {
34
+ r(u);
35
35
  }
36
- }, u = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(s, l);
37
- u((n = n.apply(e, t)).next());
36
+ }, d = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(s, l);
37
+ d((n = n.apply(e, t)).next());
38
38
  });
39
- import { jsxs as g, Fragment as R, jsx as o } from "react/jsx-runtime";
40
- import { useState as T, createContext as Xe, useCallback as ne, useContext as Qe, createElement as he, useEffect as fe, useRef as de } from "react";
41
- import { Typography as F, Button as me, Paper as je, Box as y, Drawer as xe, Dialog as Et, DialogTitle as Bt, DialogContent as Ft, DialogActions as Nt, Autocomplete as ve, TextField as we, CircularProgress as be, Chip as Pt, Tooltip as Lt, Stack as Mt, styled as Se, IconButton as Q, Container as Ke, useTheme as ie, useMediaQuery as _t, Collapse as Rt, Avatar as Be, Fade as Ht, Skeleton as Fe, Toolbar as Wt, Divider as Ne, CssBaseline as zt, Snackbar as Ut, Alert as Gt, LinearProgress as Vt, FormHelperText as qt } from "@mui/material";
42
- import Xt from "@mui/material/CssBaseline";
43
- import { styled as H, createTheme as Je, alpha as ue } from "@mui/material/styles";
44
- import { AgError as Qt } from "@australiangreens/ag-error";
45
- import { createHelper as K } from "souvlaki";
46
- import Ye from "@mui/material/List";
47
- import { Cancel as jt, ArrowDropDown as Kt, ArrowForward as Ze, ArrowBack as et, ViewHeadline as Jt } from "@mui/icons-material";
48
- import Yt from "autosuggest-highlight/match";
39
+ import { jsxs as p, Fragment as B, jsx as o } from "react/jsx-runtime";
40
+ import { useState as F, createContext as Xe, useCallback as ne, useContext as Qe, createElement as fe, useEffect as me, useRef as ue } from "react";
41
+ import { Typography as E, Button as oe, Paper as Ke, Box as $, Drawer as ve, Dialog as Ye, DialogTitle as Je, DialogContent as Ze, DialogActions as je, Autocomplete as xe, TextField as we, CircularProgress as Ae, Chip as Pt, Tooltip as Bt, Stack as Lt, styled as Se, IconButton as Q, Container as et, useTheme as re, useMediaQuery as _t, Collapse as Mt, Avatar as Ee, Fade as Rt, Skeleton as Ne, Toolbar as Ht, Divider as Pe, CssBaseline as Wt, Snackbar as zt, Alert as Ut, LinearProgress as Gt, FormHelperText as Vt } from "@mui/material";
42
+ import qt from "@mui/material/CssBaseline";
43
+ import { styled as R, createTheme as tt, alpha as pe } from "@mui/material/styles";
44
+ import { AgError as Xt } from "@australiangreens/ag-error";
45
+ import { createHelper as Y } from "souvlaki";
46
+ import nt from "@mui/material/List";
47
+ import { Cancel as Qt, ArrowDropDown as Kt, ArrowForward as ot, ArrowBack as it, ViewHeadline as Yt } from "@mui/icons-material";
48
+ import Jt from "autosuggest-highlight/match";
49
49
  import Zt from "autosuggest-highlight/parse";
50
- import { useQuery as en, QueryClient as tn, QueryClientProvider as nn } from "@tanstack/react-query";
51
- import { useAuth0 as on } from "@auth0/auth0-react";
52
- import { Buffer as rn } from "buffer";
53
- import { atom as L, useSetAtom as tt, useAtomValue as Pe, useAtom as V, getDefaultStore as an, Provider as nt } from "jotai";
54
- import { useHydrateAtoms as ot } from "jotai/utils";
55
- function vo({ text: e }) {
56
- const [t, n] = T(0);
57
- return /* @__PURE__ */ g(R, { children: [
58
- /* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
59
- /* @__PURE__ */ o(F, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
50
+ import { useQuery as jt, QueryClient as en, QueryClientProvider as tn } from "@tanstack/react-query";
51
+ import { useAuth0 as nn } from "@auth0/auth0-react";
52
+ import on from "@mui/material/Skeleton";
53
+ import { atom as L, useSetAtom as rt, useAtomValue as Be, useAtom as V, getDefaultStore as rn, Provider as at } from "jotai";
54
+ import { useHydrateAtoms as st } from "jotai/utils";
55
+ function So({ text: e }) {
56
+ const [t, n] = F(0);
57
+ return /* @__PURE__ */ p(B, { children: [
58
+ /* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
59
+ /* @__PURE__ */ o(E, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
60
60
  /* @__PURE__ */ o(
61
- me,
61
+ oe,
62
62
  {
63
63
  variant: "outlined",
64
64
  onClick: () => n((i) => i + 1),
@@ -66,17 +66,17 @@ function vo({ text: e }) {
66
66
  children: "Hello I am a button"
67
67
  }
68
68
  ),
69
- /* @__PURE__ */ g("p", { children: [
69
+ /* @__PURE__ */ p("p", { children: [
70
70
  "This is some text: ",
71
71
  /* @__PURE__ */ o("span", { children: e })
72
72
  ] }),
73
- /* @__PURE__ */ g(je, { children: [
73
+ /* @__PURE__ */ p(Ke, { children: [
74
74
  "This number will incremember when button pressed: ",
75
75
  t
76
76
  ] })
77
77
  ] });
78
78
  }
79
- const it = 330, rt = 73, U = "Navbar", q = {
79
+ const lt = 330, ct = 73, U = "Navbar", q = {
80
80
  root: `${U}-root`,
81
81
  menuButton: `${U}-menuButton`,
82
82
  hide: `${U}-hide`,
@@ -84,7 +84,7 @@ const it = 330, rt = 73, U = "Navbar", q = {
84
84
  userInfoHolder: `${U}-userInfoHolder`,
85
85
  settings: `${U}-settings`,
86
86
  pieChartIcon: `${U}-pieChartIcon`
87
- }, sn = H(y, {
87
+ }, an = R($, {
88
88
  name: "NavBar"
89
89
  })(({ theme: e }) => ({
90
90
  [`&.${q.root}`]: {
@@ -105,7 +105,7 @@ const it = 330, rt = 73, U = "Navbar", q = {
105
105
  marginTop: "64px",
106
106
  marginBottom: "16px"
107
107
  }
108
- })), at = () => ({
108
+ })), dt = () => ({
109
109
  position: "absolute",
110
110
  height: "100%",
111
111
  overflowX: "hidden",
@@ -113,51 +113,51 @@ const it = 330, rt = 73, U = "Navbar", q = {
113
113
  color: "white",
114
114
  backgroundColor: "black"
115
115
  // backgroundColor: '#e8e8e8',
116
- }), ln = () => a({
117
- width: it
118
- }, at()), cn = () => a({
119
- width: rt
120
- }, at()), dn = H(xe, {
116
+ }), sn = () => a({
117
+ width: lt
118
+ }, dt()), ln = () => a({
119
+ width: ct
120
+ }, dt()), cn = R(ve, {
121
121
  shouldForwardProp: (e) => e !== "open"
122
122
  })(({ theme: e, open: t }) => a(a({
123
- width: t ? it : rt,
123
+ width: t ? lt : ct,
124
124
  flexShrink: 0,
125
125
  whiteSpace: "nowrap",
126
126
  boxSizing: "border-box",
127
127
  zIndex: e.zIndex.drawer + 100
128
128
  }, t && {
129
- "& .MuiDrawer-paper": ln()
129
+ "& .MuiDrawer-paper": sn()
130
130
  }), !t && {
131
- "& .MuiDrawer-paper": cn()
131
+ "& .MuiDrawer-paper": ln()
132
132
  }));
133
- class Ae extends Qt {
133
+ class be extends Xt {
134
134
  }
135
- Ee(Ae, "errorName", "ContextError");
136
- const st = Xe(null), un = {}, pn = {}, gn = ({
137
- overrideState: e = un,
138
- overrideActions: t = pn,
135
+ Fe(be, "errorName", "ContextError");
136
+ const ut = Xe(null), dn = {}, un = {}, pn = ({
137
+ overrideState: e = dn,
138
+ overrideActions: t = un,
139
139
  children: n
140
140
  }) => {
141
- const [{ open: i }, r] = T({ open: !0 }), s = ne((c) => {
141
+ const [{ open: i }, r] = F({ open: !0 }), s = ne((c) => {
142
142
  r({ open: c });
143
143
  }, []), l = ne(() => {
144
- r((c) => A(a({}, c), { open: !c.open }));
145
- }, []), u = a(a({
144
+ r((c) => b(a({}, c), { open: !c.open }));
145
+ }, []), d = a(a({
146
146
  open: i,
147
147
  setOpen: s,
148
148
  toggleOpen: l
149
149
  }, e), t);
150
- return /* @__PURE__ */ o(st.Provider, { value: u, children: n });
150
+ return /* @__PURE__ */ o(ut.Provider, { value: d, children: n });
151
151
  }, hn = () => {
152
- const e = Qe(st);
152
+ const e = Qe(ut);
153
153
  if (e === null)
154
- throw new Ae("Error: Tried to useNavBar outside of a <NavBarProvider>");
154
+ throw new be("Error: Tried to useNavBar outside of a <NavBarProvider>");
155
155
  return e;
156
- }, fn = (e = {}) => a({
156
+ }, gn = (e = {}) => a({
157
157
  open: !0
158
- }, e), wo = K(
159
- (e = fn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(gn, { overrideState: e, overrideActions: t, children: n })
160
- ), Le = 7, bo = H(Ye)(({ theme: e }) => ({
158
+ }, e), bo = Y(
159
+ (e = gn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(pn, { overrideState: e, overrideActions: t, children: n })
160
+ ), Le = 7, ko = R(nt)(({ theme: e }) => ({
161
161
  backgroundColor: "black",
162
162
  color: "white",
163
163
  "& .MuiListItem-root": {
@@ -195,7 +195,7 @@ const st = Xe(null), un = {}, pn = {}, gn = ({
195
195
  // '&.Mui-selected.Mui-focusVisible:hover': {
196
196
  // },
197
197
  }
198
- })), Me = 7, So = H(Ye)(({ theme: e }) => ({
198
+ })), _e = 7, Do = R(nt)(({ theme: e }) => ({
199
199
  backgroundColor: "#e8e8e8",
200
200
  color: "inherit",
201
201
  "& .MuiListItem-root": {
@@ -204,7 +204,7 @@ const st = Xe(null), un = {}, pn = {}, gn = ({
204
204
  "& .MuiListItemButton-root": {
205
205
  " .MuiListItemIcon-root": {
206
206
  color: "inherit",
207
- padding: `${Me}px`
207
+ padding: `${_e}px`
208
208
  },
209
209
  // Focus state
210
210
  "&.Mui-focusVisible": {
@@ -215,7 +215,7 @@ const st = Xe(null), un = {}, pn = {}, gn = ({
215
215
  borderLeftStyle: "solid",
216
216
  borderLeftWidth: "7px",
217
217
  borderLeftColor: e.palette.primary.main,
218
- paddingLeft: `calc(${e.spacing(2)} - ${Me}px)`
218
+ paddingLeft: `calc(${e.spacing(2)} - ${_e}px)`
219
219
  },
220
220
  // Hover state
221
221
  "&:hover": {
@@ -234,15 +234,15 @@ const st = Xe(null), un = {}, pn = {}, gn = ({
234
234
  // },
235
235
  }
236
236
  }));
237
- function Ao({
237
+ function $o({
238
238
  "data-testid": e,
239
239
  children: t
240
240
  }) {
241
241
  const { open: n } = hn();
242
- return /* @__PURE__ */ g(sn, { className: q.root, "data-testid": e, children: [
243
- /* @__PURE__ */ o(Xt, {}),
242
+ return /* @__PURE__ */ p(an, { className: q.root, "data-testid": e, children: [
243
+ /* @__PURE__ */ o(qt, {}),
244
244
  /* @__PURE__ */ o(
245
- dn,
245
+ cn,
246
246
  {
247
247
  variant: "permanent",
248
248
  anchor: "left",
@@ -253,7 +253,7 @@ function Ao({
253
253
  )
254
254
  ] });
255
255
  }
256
- const lt = ({
256
+ const fn = ({
257
257
  isOpen: e,
258
258
  dialogTitle: t,
259
259
  children: n,
@@ -261,46 +261,46 @@ const lt = ({
261
261
  primaryButton: r,
262
262
  secondaryButton: s,
263
263
  onClose: l,
264
- sx: u,
264
+ sx: d,
265
265
  "data-testid": c,
266
- disableCloseOnBackdropOrEscape: d = !1
266
+ disableCloseOnBackdropOrEscape: u = !1
267
267
  }) => {
268
- var w, h;
269
- const [C, v] = T(!1);
270
- return /* @__PURE__ */ g(
271
- Et,
268
+ var A, m;
269
+ const [v, w] = F(!1);
270
+ return /* @__PURE__ */ p(
271
+ Ye,
272
272
  {
273
273
  open: e,
274
- onClose: (S, D) => B(void 0, null, function* () {
275
- d && (D === "backdropClick" || D === "escapeKeyDown") || C || (s != null && s.onClick ? yield s.onClick() : l());
274
+ onClose: (S, k) => z(void 0, null, function* () {
275
+ u && (k === "backdropClick" || k === "escapeKeyDown") || v || (s != null && s.onClick ? yield s.onClick() : l());
276
276
  }),
277
277
  fullWidth: !0,
278
278
  maxWidth: i != null ? i : "xs",
279
279
  "data-testid": c,
280
- sx: u,
280
+ sx: d,
281
281
  children: [
282
- /* @__PURE__ */ o(Bt, { children: t }),
283
- /* @__PURE__ */ o(Ft, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
284
- /* @__PURE__ */ g(Nt, { children: [
282
+ /* @__PURE__ */ o(Je, { children: t }),
283
+ /* @__PURE__ */ o(Ze, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
284
+ /* @__PURE__ */ p(je, { children: [
285
285
  /* @__PURE__ */ o(
286
- me,
286
+ oe,
287
287
  {
288
- onClick: (w = s == null ? void 0 : s.onClick) != null ? w : l,
288
+ onClick: (A = s == null ? void 0 : s.onClick) != null ? A : l,
289
289
  "data-testid": s == null ? void 0 : s.testId,
290
- disabled: (s == null ? void 0 : s.disabled) || C,
290
+ disabled: (s == null ? void 0 : s.disabled) || v,
291
291
  color: s == null ? void 0 : s.buttonColor,
292
- children: (h = s == null ? void 0 : s.text) != null ? h : "Cancel"
292
+ children: (m = s == null ? void 0 : s.text) != null ? m : "Cancel"
293
293
  }
294
294
  ),
295
295
  r && /* @__PURE__ */ o(
296
- me,
296
+ oe,
297
297
  {
298
- onClick: () => B(void 0, null, function* () {
298
+ onClick: () => z(void 0, null, function* () {
299
299
  var S;
300
- v(!0), yield (S = r.onClick) == null ? void 0 : S.call(r), v(!1);
300
+ w(!0), yield (S = r.onClick) == null ? void 0 : S.call(r), w(!1);
301
301
  }),
302
302
  "data-testid": r.testId,
303
- disabled: r.disabled || C,
303
+ disabled: r.disabled || v,
304
304
  color: r == null ? void 0 : r.buttonColor,
305
305
  children: r.text
306
306
  }
@@ -309,20 +309,20 @@ const lt = ({
309
309
  ]
310
310
  }
311
311
  );
312
- }, ct = ({
312
+ }, pt = ({
313
313
  minLength: e,
314
314
  preLoadedOptions: t,
315
315
  lookup: n,
316
316
  label: i,
317
317
  inputValue: r
318
- }) => en({
318
+ }) => jt({
319
319
  queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
320
320
  (s) => s.label.toLowerCase().includes(r.toLowerCase())
321
321
  ) : n(r),
322
322
  queryKey: ["autocomplete", i, r]
323
323
  });
324
- function Do({
325
- lookup: e = () => B(this, null, function* () {
324
+ function Io({
325
+ lookup: e = () => z(this, null, function* () {
326
326
  }),
327
327
  enableHighlighting: t = !0,
328
328
  onChange: n,
@@ -330,107 +330,107 @@ function Do({
330
330
  label: r,
331
331
  value: s,
332
332
  "data-testid": l,
333
- sx: u,
333
+ sx: d,
334
334
  textFieldColor: c,
335
- textFieldVariant: d = "filled",
336
- loadingText: C = "Loading...",
337
- noOptionsText: v = "No options",
338
- popupIcon: w = /* @__PURE__ */ o(Kt, {}),
339
- error: h = !1,
335
+ textFieldVariant: u = "filled",
336
+ loadingText: v = "Loading...",
337
+ noOptionsText: w = "No options",
338
+ popupIcon: A = /* @__PURE__ */ o(Kt, {}),
339
+ error: m = !1,
340
340
  helperText: S = "",
341
- preLoadedOptions: D = void 0,
342
- disablePortal: O = !1
341
+ preLoadedOptions: k = void 0,
342
+ disablePortal: I = !1
343
343
  }) {
344
- const [f, k] = T(""), W = (p, m) => {
345
- const E = s.filter((P) => P.id !== m);
346
- n(E, "delete", p);
347
- }, { data: N, isLoading: M } = ct({
348
- inputValue: f,
344
+ const [g, D] = F(""), H = (h, f) => {
345
+ const O = s.filter((P) => P.id !== f);
346
+ n(O, "delete", h);
347
+ }, { data: N, isLoading: _ } = pt({
348
+ inputValue: g,
349
349
  label: r,
350
350
  lookup: e,
351
351
  minLength: i,
352
- preLoadedOptions: D
353
- }), I = f.length >= i;
354
- return /* @__PURE__ */ g("div", { "data-testid": l, children: [
352
+ preLoadedOptions: k
353
+ }), T = g.length >= i;
354
+ return /* @__PURE__ */ p("div", { "data-testid": l, children: [
355
355
  /* @__PURE__ */ o(
356
- ve,
356
+ xe,
357
357
  {
358
- sx: u,
358
+ sx: d,
359
359
  "data-testid": l ? `${l}:Autocomplete` : void 0,
360
- disablePortal: O,
360
+ disablePortal: I,
361
361
  multiple: !0,
362
- getOptionLabel: (p) => typeof p == "string" ? p : p.label,
363
- loading: I ? M : !1,
362
+ getOptionLabel: (h) => typeof h == "string" ? h : h.label,
363
+ loading: T ? _ : !1,
364
364
  options: [...s, ...N != null ? N : []],
365
365
  filterSelectedOptions: !0,
366
366
  includeInputInList: !0,
367
367
  value: s,
368
- onChange: (p, m, E) => {
369
- n(m, E, p);
368
+ onChange: (h, f, O) => {
369
+ n(f, O, h);
370
370
  },
371
- onInputChange: (p, m) => k(m),
372
- noOptionsText: I ? v : "Start typing to search",
373
- loadingText: C,
374
- popupIcon: w,
375
- renderInput: (p) => /* @__PURE__ */ o(
371
+ onInputChange: (h, f) => D(f),
372
+ noOptionsText: T ? w : "Start typing to search",
373
+ loadingText: v,
374
+ popupIcon: A,
375
+ renderInput: (h) => /* @__PURE__ */ o(
376
376
  we,
377
- A(a({}, p), {
377
+ b(a({}, h), {
378
378
  label: r,
379
379
  fullWidth: !0,
380
- variant: d,
381
- error: h,
380
+ variant: u,
381
+ error: m,
382
382
  helperText: S,
383
- InputProps: A(a({}, p.InputProps), {
384
- endAdornment: /* @__PURE__ */ g(R, { children: [
385
- M ? /* @__PURE__ */ o(be, { color: "inherit", size: 20 }) : null,
386
- p.InputProps.endAdornment
383
+ InputProps: b(a({}, h.InputProps), {
384
+ endAdornment: /* @__PURE__ */ p(B, { children: [
385
+ _ ? /* @__PURE__ */ o(Ae, { color: "inherit", size: 20 }) : null,
386
+ h.InputProps.endAdornment
387
387
  ] })
388
388
  }),
389
389
  "data-testid": l ? `${l}:Autocomplete:TextField` : void 0,
390
- onKeyDown: (m) => {
391
- (m.key === "Backspace" || m.key === "Delete") && m.stopPropagation();
390
+ onKeyDown: (f) => {
391
+ (f.key === "Backspace" || f.key === "Delete") && f.stopPropagation();
392
392
  },
393
393
  color: c
394
394
  })
395
395
  ),
396
396
  renderTags: () => null,
397
- isOptionEqualToValue: (p, m) => p.id === m.id,
398
- renderOption: (p, m, E) => {
397
+ isOptionEqualToValue: (h, f) => h.id === f.id,
398
+ renderOption: (h, f, O) => {
399
399
  if (t) {
400
- const P = Yt(m.label, E.inputValue, {
400
+ const P = Jt(f.label, O.inputValue, {
401
401
  insideWords: !0,
402
402
  findAllOccurrences: !0
403
- }), b = Zt(m.label, P);
404
- return /* @__PURE__ */ he(
403
+ }), x = Zt(f.label, P);
404
+ return /* @__PURE__ */ fe(
405
405
  "li",
406
- A(a({}, p), {
407
- key: m.id,
408
- "data-testid": l ? `${l}:Autocomplete:option(${m.id.toString()})` : void 0
406
+ b(a({}, h), {
407
+ key: f.id,
408
+ "data-testid": l ? `${l}:Autocomplete:option(${f.id.toString()})` : void 0
409
409
  }),
410
- /* @__PURE__ */ o("div", { children: b.map((x, _) => /* @__PURE__ */ o(
410
+ /* @__PURE__ */ o("div", { children: x.map((C, M) => /* @__PURE__ */ o(
411
411
  "span",
412
412
  {
413
413
  style: {
414
- fontWeight: x.highlight ? 700 : 400
414
+ fontWeight: C.highlight ? 700 : 400
415
415
  },
416
- children: x.text
416
+ children: C.text
417
417
  },
418
- _
418
+ M
419
419
  )) })
420
420
  );
421
421
  } else
422
- return /* @__PURE__ */ he(
422
+ return /* @__PURE__ */ fe(
423
423
  "li",
424
- A(a({}, p), {
425
- key: m.id,
426
- "data-testid": l ? `${l}:option(${m.id.toString()})` : void 0
424
+ b(a({}, h), {
425
+ key: f.id,
426
+ "data-testid": l ? `${l}:option(${f.id.toString()})` : void 0
427
427
  }),
428
- m.label
428
+ f.label
429
429
  );
430
430
  }
431
431
  }
432
432
  ),
433
- s.length > 0 && /* @__PURE__ */ o(y, { children: s.map((p) => /* @__PURE__ */ o(
433
+ s.length > 0 && /* @__PURE__ */ o($, { children: s.map((h) => /* @__PURE__ */ o(
434
434
  Pt,
435
435
  {
436
436
  sx: {
@@ -439,9 +439,9 @@ function Do({
439
439
  height: "auto"
440
440
  },
441
441
  label: /* @__PURE__ */ o(
442
- Lt,
442
+ Bt,
443
443
  {
444
- title: p.tooltipContent || "",
444
+ title: h.tooltipContent || "",
445
445
  placement: "bottom-start",
446
446
  PopperProps: {
447
447
  modifiers: [
@@ -453,24 +453,24 @@ function Do({
453
453
  }
454
454
  ]
455
455
  },
456
- children: /* @__PURE__ */ o(F, { style: { whiteSpace: "normal" }, children: p.chipLabel ? p.chipLabel : p.label })
456
+ children: /* @__PURE__ */ o(E, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
457
457
  }
458
458
  ),
459
- "data-testid": l ? `${l}:Chip(${p.id.toString()})` : void 0,
460
- onDelete: (m) => W(m, p.id),
459
+ "data-testid": l ? `${l}:Chip(${h.id.toString()})` : void 0,
460
+ onDelete: (f) => H(f, h.id),
461
461
  deleteIcon: /* @__PURE__ */ o(
462
- jt,
462
+ Qt,
463
463
  {
464
- "data-testid": l ? `${l}:Chip(${p.id.toString()}):deleteIcon` : void 0
464
+ "data-testid": l ? `${l}:Chip(${h.id.toString()}):deleteIcon` : void 0
465
465
  }
466
466
  )
467
467
  },
468
- p.id
468
+ h.id
469
469
  )) })
470
470
  ] });
471
471
  }
472
- const ko = ({
473
- lookup: e = () => B(void 0, null, function* () {
472
+ const To = ({
473
+ lookup: e = () => z(void 0, null, function* () {
474
474
  }),
475
475
  onChange: t,
476
476
  label: n,
@@ -478,138 +478,122 @@ const ko = ({
478
478
  sx: r,
479
479
  textFieldColor: s,
480
480
  textFieldVariant: l = "filled",
481
- "data-testid": u,
481
+ "data-testid": d,
482
482
  noOptionsText: c = "No options",
483
- minLength: d = 3,
484
- disablePortal: C = !1,
485
- preLoadedOptions: v
483
+ minLength: u = 3,
484
+ disablePortal: v = !1,
485
+ preLoadedOptions: w
486
486
  }) => {
487
- const [w, h] = T(""), { data: S, isLoading: D } = ct({
488
- inputValue: w,
487
+ const [A, m] = F(""), { data: S, isLoading: k } = pt({
488
+ inputValue: A,
489
489
  label: n,
490
490
  lookup: e,
491
- minLength: d != null ? d : 0,
492
- preLoadedOptions: v
493
- }), O = w.length >= d;
494
- return /* @__PURE__ */ o("div", { "data-testid": u, children: /* @__PURE__ */ o(Mt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
495
- ve,
491
+ minLength: u != null ? u : 0,
492
+ preLoadedOptions: w
493
+ }), I = A.length >= u;
494
+ return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(Lt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
495
+ xe,
496
496
  {
497
497
  sx: r,
498
- "data-testid": u ? `${u}:Autocomplete` : void 0,
499
- loading: O ? D : !1,
498
+ "data-testid": d ? `${d}:Autocomplete` : void 0,
499
+ loading: I ? k : !1,
500
500
  options: S != null ? S : [],
501
- onChange: (f, k) => {
502
- t(f, k);
501
+ onChange: (g, D) => {
502
+ t(g, D);
503
503
  },
504
- disablePortal: C,
505
- filterOptions: (f) => f,
504
+ disablePortal: v,
505
+ filterOptions: (g) => g,
506
506
  value: i,
507
- noOptionsText: O ? c : "Start typing to search",
508
- getOptionLabel: (f) => f.label,
509
- renderInput: (f) => /* @__PURE__ */ o(
507
+ noOptionsText: I ? c : "Start typing to search",
508
+ getOptionLabel: (g) => g.label,
509
+ renderInput: (g) => /* @__PURE__ */ o(
510
510
  we,
511
- A(a({
512
- "data-testid": u ? `${u}:Autocomplete:TextField` : void 0
513
- }, f), {
511
+ b(a({
512
+ "data-testid": d ? `${d}:Autocomplete:TextField` : void 0
513
+ }, g), {
514
514
  variant: l,
515
515
  label: n,
516
516
  color: s
517
517
  })
518
518
  ),
519
- isOptionEqualToValue: (f, k) => f.id === k.id,
520
- onInputChange: (f, k) => {
521
- h(k);
519
+ isOptionEqualToValue: (g, D) => g.id === D.id,
520
+ onInputChange: (g, D) => {
521
+ m(D);
522
522
  },
523
- renderOption: (f, k) => /* @__PURE__ */ he(
523
+ renderOption: (g, D) => /* @__PURE__ */ fe(
524
524
  "li",
525
- A(a({}, f), {
526
- key: k.id,
527
- "data-testid": u ? `${u}:Autocomplete:option(${k.id.toString()})` : void 0
525
+ b(a({}, g), {
526
+ key: D.id,
527
+ "data-testid": d ? `${d}:Autocomplete:option(${D.id.toString()})` : void 0
528
528
  }),
529
- k.label
529
+ D.label
530
530
  )
531
531
  }
532
532
  ) }) });
533
- }, mn = (e) => {
534
- if (!e)
535
- return -1;
536
- try {
537
- const n = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
538
- rn.from(n, "base64").toString("utf8").split("").map(function(s) {
539
- return "%" + ("00" + s.charCodeAt(0).toString(16)).slice(-2);
540
- }).join("")
541
- ), r = JSON.parse(i);
542
- return r != null && r.exp ? r.exp : -1;
543
- } catch (t) {
544
- return -1;
545
- }
546
- }, yo = ({
547
- open: e = !1,
548
- closeHandler: t,
549
- setAuth0ExpiryTime: n
550
- }) => {
551
- const { logout: i, getAccessTokenSilently: r } = on(), [s, l] = T(0), u = () => B(void 0, null, function* () {
552
- i({ logoutParams: { returnTo: `${window.location.origin}` } });
553
- }), c = () => B(void 0, null, function* () {
554
- l(s + 1), t();
555
- });
556
- return fe(() => {
557
- (() => B(void 0, null, function* () {
558
- if (s > 0) {
559
- const w = yield r({ cacheMode: "off" }), h = mn(w) * 1e3;
560
- n(h);
533
+ };
534
+ function mn(e) {
535
+ return "error" in e;
536
+ }
537
+ function Cn(e) {
538
+ return e.error === "access_denied";
539
+ }
540
+ function vn(e) {
541
+ var i;
542
+ const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
543
+ return t === "access_denied" && n.startsWith("You do not have the required authorization");
544
+ }
545
+ function xn(e) {
546
+ var i;
547
+ const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
548
+ return t === "access_denied" && n.startsWith("User did not authorize the request");
549
+ }
550
+ function yo({ children: e }) {
551
+ const { isAuthenticated: t, isLoading: n, error: i, loginWithRedirect: r, logout: s } = nn();
552
+ if (me(() => {
553
+ if (n || t || i)
554
+ return;
555
+ const l = {
556
+ appState: {
557
+ returnTo: `${window.location.pathname}${window.location.search}`
561
558
  }
562
- }))();
563
- }, [s, r, n]), /* @__PURE__ */ o(
564
- lt,
565
- {
566
- isOpen: e,
567
- primaryButton: {
568
- text: "Continue",
569
- onClick: c,
570
- disabled: !1,
571
- testId: "PreferencesDialog",
572
- buttonColor: "secondary"
573
- },
574
- secondaryButton: {
575
- text: "Log out",
576
- onClick: u,
577
- disabled: !1,
578
- testId: "PreferencesDialog",
579
- buttonColor: "secondary"
580
- },
581
- onClose: t,
582
- dialogTitle: "Session expiry",
583
- disableCloseOnBackdropOrEscape: !0,
584
- children: /* @__PURE__ */ o("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
585
- }
586
- );
587
- }, Cn = 24, xn = 64, G = "TopBar", $ = {
559
+ };
560
+ r(l);
561
+ }, [n, t, i, r]), i && mn(i)) {
562
+ let l = "Auth error", d = "An unknown Auth0 error occurred.";
563
+ return vn(i) ? (l = "Unauthorised", d = "You are not authorised to access the app.") : xn(i) ? (l = "App not authorised", d = "You have not authorised the application to access your user profile. This is necessary to use the app.") : Cn(i) && (l = "Unauthorised", d = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ p(Ye, { open: !0, children: [
564
+ /* @__PURE__ */ o(Je, { children: l }),
565
+ /* @__PURE__ */ o(Ze, { children: /* @__PURE__ */ o(E, { children: d }) }),
566
+ /* @__PURE__ */ o(je, { children: /* @__PURE__ */ o(oe, { onClick: () => s({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
567
+ ] });
568
+ }
569
+ return t ? /* @__PURE__ */ o(B, { children: e }) : /* @__PURE__ */ o(on, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
570
+ }
571
+ const wn = 24, An = 64, G = "TopBar", y = {
588
572
  topStripe: `${G}-topStripe`,
589
573
  titleBar: `${G}-titleBar`,
590
574
  titleSlider: `${G}-titleSlider`,
591
575
  titleText: `${G}-titleText`,
592
576
  leftPanelButton: `${G}-leftPanelButton`,
593
577
  rightPanelButton: `${G}-leftPanelButton`
594
- }, vn = Se("div", {
578
+ }, Sn = Se("div", {
595
579
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
596
580
  name: G
597
581
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
598
582
  var i, r;
599
583
  return {
600
584
  width: "100%",
601
- [`& .${$.topStripe}`]: {
585
+ [`& .${y.topStripe}`]: {
602
586
  width: "100%",
603
- height: `${Cn}px`,
587
+ height: `${wn}px`,
604
588
  backgroundColor: e.palette.primary.main
605
589
  },
606
- [`& .${$.titleBar}`]: {
590
+ [`& .${y.titleBar}`]: {
607
591
  backgroundColor: e.palette.primary.light,
608
- height: `${xn}px`,
592
+ height: `${An}px`,
609
593
  padding: e.spacing(0, 3),
610
594
  width: "100%"
611
595
  },
612
- [`& .${$.titleSlider}`]: a(a({
596
+ [`& .${y.titleSlider}`]: a(a({
613
597
  height: "100%",
614
598
  display: "flex",
615
599
  alignItems: "center",
@@ -618,14 +602,14 @@ const ko = ({
618
602
  easing: e.transitions.easing.sharp,
619
603
  duration: e.transitions.duration.leavingScreen
620
604
  }),
621
- [`& .${$.leftPanelButton}`]: {
605
+ [`& .${y.leftPanelButton}`]: {
622
606
  marginRight: e.spacing(2),
623
607
  flexGrow: 0
624
608
  },
625
- [`& .${$.titleText}`]: {
609
+ [`& .${y.titleText}`]: {
626
610
  flexGrow: 1
627
611
  },
628
- [`& .${$.rightPanelButton}`]: {
612
+ [`& .${y.rightPanelButton}`]: {
629
613
  flexGrow: 0
630
614
  }
631
615
  }, (t == null ? void 0 : t.open) && {
@@ -643,19 +627,19 @@ const ko = ({
643
627
  })
644
628
  };
645
629
  });
646
- function wn({
630
+ function bn({
647
631
  titleText: e = "",
648
632
  leftPanel: t,
649
633
  rightPanel: n,
650
634
  "data-testid": i
651
635
  }) {
652
- return /* @__PURE__ */ g(vn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
653
- /* @__PURE__ */ o("div", { className: $.topStripe }),
654
- /* @__PURE__ */ o("div", { className: $.titleBar, children: /* @__PURE__ */ g(y, { className: $.titleSlider, children: [
655
- t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ g(
636
+ return /* @__PURE__ */ p(Sn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
637
+ /* @__PURE__ */ o("div", { className: y.topStripe }),
638
+ /* @__PURE__ */ o("div", { className: y.titleBar, children: /* @__PURE__ */ p($, { className: y.titleSlider, children: [
639
+ t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ p(
656
640
  Q,
657
641
  {
658
- className: $.leftPanelButton,
642
+ className: y.leftPanelButton,
659
643
  color: "inherit",
660
644
  "aria-label": "Open left side panel",
661
645
  onClick: t == null ? void 0 : t.onOpen,
@@ -663,15 +647,15 @@ function wn({
663
647
  size: "large",
664
648
  children: [
665
649
  " ",
666
- /* @__PURE__ */ o(Ze, {})
650
+ /* @__PURE__ */ o(ot, {})
667
651
  ]
668
652
  }
669
653
  ),
670
- /* @__PURE__ */ o(F, { className: $.titleText, variant: "h6", noWrap: !0, children: e }),
671
- n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ g(
654
+ /* @__PURE__ */ o(E, { className: y.titleText, variant: "h6", noWrap: !0, children: e }),
655
+ n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ p(
672
656
  Q,
673
657
  {
674
- className: $.rightPanelButton,
658
+ className: y.rightPanelButton,
675
659
  color: "inherit",
676
660
  "aria-label": "Open right side panel",
677
661
  onClick: n == null ? void 0 : n.onOpen,
@@ -679,14 +663,14 @@ function wn({
679
663
  size: "large",
680
664
  children: [
681
665
  " ",
682
- /* @__PURE__ */ o(et, {})
666
+ /* @__PURE__ */ o(it, {})
683
667
  ]
684
668
  }
685
669
  )
686
670
  ] }) })
687
671
  ] });
688
672
  }
689
- const dt = 400, bn = Se(xe, {
673
+ const ht = 400, kn = Se(ve, {
690
674
  shouldForwardProp: (e) => (
691
675
  // Note we do want anchor to be forwarded to the Drawer component
692
676
  ![
@@ -716,9 +700,9 @@ const dt = 400, bn = Se(xe, {
716
700
  marginLeft: `${r}px`
717
701
  }))
718
702
  })
719
- ), Sn = Se(y, {
703
+ ), Dn = Se($, {
720
704
  shouldForwardProp: (e) => !["anchor"].includes(e)
721
- })(({ theme: e, anchor: t }) => A(a({
705
+ })(({ theme: e, anchor: t }) => b(a({
722
706
  display: "flex",
723
707
  alignItems: "center",
724
708
  padding: e.spacing(2)
@@ -736,60 +720,60 @@ const dt = 400, bn = Se(xe, {
736
720
  marginRight: t === "right" ? e.spacing(2) : 0
737
721
  }
738
722
  }));
739
- function _e({
723
+ function Me({
740
724
  children: e,
741
725
  anchor: t = "left",
742
726
  open: n,
743
727
  onClose: i = () => {
744
728
  },
745
729
  titleText: r = "",
746
- width: s = dt,
730
+ width: s = ht,
747
731
  showCloseArrow: l = !0,
748
- debugOpacity: u = !1,
732
+ debugOpacity: d = !1,
749
733
  headerBoxProps: c = {},
750
- onOpened: d,
751
- onClosed: C,
752
- "data-testid": v,
753
- navBarOpen: w = !1,
754
- navBarWidthOpen: h = 0,
734
+ onOpened: u,
735
+ onClosed: v,
736
+ "data-testid": w,
737
+ navBarOpen: A = !1,
738
+ navBarWidthOpen: m = 0,
755
739
  navBarWidthClosed: S = 0
756
740
  }) {
757
- return /* @__PURE__ */ g(
758
- bn,
741
+ return /* @__PURE__ */ p(
742
+ kn,
759
743
  {
760
744
  SlideProps: {
761
- onEntered: () => d == null ? void 0 : d(),
762
- onExited: () => C == null ? void 0 : C()
745
+ onEntered: () => u == null ? void 0 : u(),
746
+ onExited: () => v == null ? void 0 : v()
763
747
  },
764
748
  variant: "persistent",
765
749
  anchor: t,
766
750
  open: n,
767
751
  width: s,
768
- debugOpacity: u,
769
- "data-testid": v,
770
- navBarOpen: w,
771
- navBarWidthOpen: h,
752
+ debugOpacity: d,
753
+ "data-testid": w,
754
+ navBarOpen: A,
755
+ navBarWidthOpen: m,
772
756
  navBarWidthClosed: S,
773
757
  children: [
774
- /* @__PURE__ */ o(Sn, A(a({ anchor: t }, c), { children: t === "left" ? /* @__PURE__ */ g(R, { children: [
775
- /* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", children: r }),
776
- l && /* @__PURE__ */ g(Q, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
777
- /* @__PURE__ */ o(et, { "data-testid": "arrowbackicon" }),
758
+ /* @__PURE__ */ o(Dn, b(a({ anchor: t }, c), { children: t === "left" ? /* @__PURE__ */ p(B, { children: [
759
+ /* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", children: r }),
760
+ l && /* @__PURE__ */ p(Q, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
761
+ /* @__PURE__ */ o(it, { "data-testid": "arrowbackicon" }),
778
762
  " "
779
763
  ] })
780
- ] }) : /* @__PURE__ */ g(R, { children: [
781
- l && /* @__PURE__ */ g(Q, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
782
- /* @__PURE__ */ o(Ze, {}),
764
+ ] }) : /* @__PURE__ */ p(B, { children: [
765
+ l && /* @__PURE__ */ p(Q, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
766
+ /* @__PURE__ */ o(ot, {}),
783
767
  " "
784
768
  ] }),
785
- /* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", children: r })
769
+ /* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", children: r })
786
770
  ] }) })),
787
771
  e
788
772
  ]
789
773
  }
790
774
  );
791
775
  }
792
- const An = H(y, {
776
+ const $n = R($, {
793
777
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
794
778
  name: "PanelAwareMargins"
795
779
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -812,22 +796,22 @@ const An = H(y, {
812
796
  }),
813
797
  marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
814
798
  });
815
- }), Dn = H(Ke, {
799
+ }), In = R(et, {
816
800
  name: "PageContainer"
817
801
  })(({ theme: e }) => ({
818
802
  // Horizontal padding comes from the Container's gutter
819
803
  paddingTop: e.spacing(3),
820
804
  paddingBottom: e.spacing(3)
821
805
  // TODO: Remove max width
822
- })), pe = !1, ge = !1, ee = {
806
+ })), he = !1, ge = !1, ee = {
823
807
  titleText: "",
824
808
  flavour: "push",
825
- width: dt,
809
+ width: ht,
826
810
  arrowButtons: "both",
827
811
  startOpen: !1,
828
812
  open: void 0,
829
813
  onChangeOpen: void 0,
830
- content: /* @__PURE__ */ o(R, {}),
814
+ content: /* @__PURE__ */ o(B, {}),
831
815
  onOpened: void 0,
832
816
  onClosed: void 0,
833
817
  dataTestId: void 0
@@ -840,130 +824,130 @@ function Oo({
840
824
  sidePanelsAreMutuallyExclusive: r = !0,
841
825
  debugOpacity: s = !1,
842
826
  pageContainerProps: l,
843
- pageContentDataTestId: u,
827
+ pageContentDataTestId: d,
844
828
  topBarDataTestId: c,
845
- navBarOpen: d,
846
- navBarWidthOpen: C,
847
- navBarWidthClosed: v
829
+ navBarOpen: u,
830
+ navBarWidthOpen: v,
831
+ navBarWidthClosed: w
848
832
  }) {
849
- const [w, h] = T(pe), [S, D] = T(ge), [O, f] = T(pe), [k, W] = T(ge), N = n !== void 0, M = i !== void 0, {
850
- titleText: I,
851
- content: p,
852
- flavour: m,
853
- open: E,
833
+ const [A, m] = F(he), [S, k] = F(ge), [I, g] = F(he), [D, H] = F(ge), N = n !== void 0, _ = i !== void 0, {
834
+ titleText: T,
835
+ content: h,
836
+ flavour: f,
837
+ open: O,
854
838
  onChangeOpen: P,
855
- width: b,
856
- arrowButtons: x,
857
- startOpen: _,
858
- onOpened: wt,
859
- onClosed: bt,
860
- dataTestId: St
839
+ width: x,
840
+ arrowButtons: C,
841
+ startOpen: M,
842
+ onOpened: bt,
843
+ onClosed: kt,
844
+ dataTestId: Dt
861
845
  } = n ? a(a({}, ee), n) : a({}, ee), {
862
- titleText: At,
863
- content: Dt,
864
- flavour: De,
865
- open: re,
866
- onChangeOpen: ke,
867
- width: ae,
846
+ titleText: $t,
847
+ content: It,
848
+ flavour: ke,
849
+ open: ae,
850
+ onChangeOpen: De,
851
+ width: se,
868
852
  arrowButtons: J,
869
- startOpen: Y,
870
- onOpened: kt,
853
+ startOpen: Z,
854
+ onOpened: Tt,
871
855
  onClosed: yt,
872
856
  dataTestId: Ot
873
857
  } = i ? a(a({}, ee), i) : a({}, ee);
874
- fe(() => {
875
- _ !== pe && (h(_), f(_));
876
- }, [_]), fe(() => {
877
- Y !== ge && (D(Y), W(Y));
878
- }, [Y]);
879
- const se = E === void 0 ? w : E, le = re === void 0 ? S : re, ye = (z) => {
880
- E === void 0 && (h(z), r && M && (z ? (D(!1), W(S)) : D(k))), P && P(z);
881
- }, Oe = (z) => {
882
- re === void 0 && (D(z), r && N && (z ? (h(!1), f(w)) : h(O))), ke && ke(z);
858
+ me(() => {
859
+ M !== he && (m(M), g(M));
860
+ }, [M]), me(() => {
861
+ Z !== ge && (k(Z), H(Z));
862
+ }, [Z]);
863
+ const le = O === void 0 ? A : O, ce = ae === void 0 ? S : ae, $e = (W) => {
864
+ O === void 0 && (m(W), r && _ && (W ? (k(!1), H(S)) : k(D))), P && P(W);
865
+ }, Ie = (W) => {
866
+ ae === void 0 && (k(W), r && N && (W ? (m(!1), g(A)) : m(I))), De && De(W);
883
867
  };
884
- return /* @__PURE__ */ g(y, { children: [
868
+ return /* @__PURE__ */ p($, { children: [
885
869
  N && /* @__PURE__ */ o(
886
- _e,
870
+ Me,
887
871
  {
888
- "data-testid": St,
872
+ "data-testid": Dt,
889
873
  anchor: "left",
890
- open: se,
891
- onClose: () => ye(!1),
892
- width: b,
893
- titleText: I,
874
+ open: le,
875
+ onClose: () => $e(!1),
876
+ width: x,
877
+ titleText: T,
894
878
  debugOpacity: s,
895
- showCloseArrow: x === "both" || x === "close",
896
- onOpened: wt,
897
- onClosed: bt,
898
- navBarOpen: d,
899
- navBarWidthOpen: C,
900
- navBarWidthClosed: v,
901
- children: p
879
+ showCloseArrow: C === "both" || C === "close",
880
+ onOpened: bt,
881
+ onClosed: kt,
882
+ navBarOpen: u,
883
+ navBarWidthOpen: v,
884
+ navBarWidthClosed: w,
885
+ children: h
902
886
  }
903
887
  ),
904
- M && /* @__PURE__ */ o(
905
- _e,
888
+ _ && /* @__PURE__ */ o(
889
+ Me,
906
890
  {
907
891
  "data-testid": Ot,
908
892
  anchor: "right",
909
- open: le,
910
- onClose: () => Oe(!1),
911
- width: ae,
912
- titleText: At,
893
+ open: ce,
894
+ onClose: () => Ie(!1),
895
+ width: se,
896
+ titleText: $t,
913
897
  debugOpacity: s,
914
898
  showCloseArrow: J === "both" || J === "close",
915
- onOpened: kt,
899
+ onOpened: Tt,
916
900
  onClosed: yt,
917
- navBarOpen: d,
918
- navBarWidthOpen: C,
919
- navBarWidthClosed: v,
920
- children: Dt
901
+ navBarOpen: u,
902
+ navBarWidthOpen: v,
903
+ navBarWidthClosed: w,
904
+ children: It
921
905
  }
922
906
  ),
923
907
  /* @__PURE__ */ o(
924
- wn,
908
+ bn,
925
909
  a(a({
926
910
  titleText: t,
927
911
  "data-testid": c
928
- }, N && m === "push" ? {
912
+ }, N && f === "push" ? {
929
913
  leftPanel: {
930
- open: se,
931
- width: b,
932
- onOpen: () => ye(!0),
933
- showOpenArrow: x === "both" || x === "open"
914
+ open: le,
915
+ width: x,
916
+ onOpen: () => $e(!0),
917
+ showOpenArrow: C === "both" || C === "open"
934
918
  }
935
- } : {}), M && De === "push" ? {
919
+ } : {}), _ && ke === "push" ? {
936
920
  rightPanel: {
937
- open: le,
938
- width: ae,
939
- onOpen: () => Oe(!0),
921
+ open: ce,
922
+ width: se,
923
+ onOpen: () => Ie(!0),
940
924
  showOpenArrow: J === "both" || J === "open"
941
925
  }
942
926
  } : {})
943
927
  ),
944
928
  /* @__PURE__ */ o(
945
- An,
946
- A(a(a({}, m === "push" ? {
929
+ $n,
930
+ b(a(a({}, f === "push" ? {
947
931
  leftPanel: {
948
- open: se,
949
- width: b
932
+ open: le,
933
+ width: x
950
934
  }
951
- } : {}), De === "push" ? {
935
+ } : {}), ke === "push" ? {
952
936
  rightPanel: {
953
- open: le,
954
- width: ae
937
+ open: ce,
938
+ width: se
955
939
  }
956
940
  } : {}), {
957
- children: /* @__PURE__ */ o(Dn, A(a({ "data-testid": u }, l), { children: e }))
941
+ children: /* @__PURE__ */ o(In, b(a({ "data-testid": d }, l), { children: e }))
958
942
  })
959
943
  )
960
944
  ] });
961
945
  }
962
- const ut = () => {
963
- const e = ie();
946
+ const gt = () => {
947
+ const e = re();
964
948
  return _t(e.breakpoints.down("sm"));
965
- }, kn = 64, yn = 64, On = 256, j = L(!0), pt = L(On), gt = L(yn), Ce = L(""), In = L(void 0), ht = L(kn), ft = L(void 0);
966
- function $n({ links: e }) {
949
+ }, Tn = 64, yn = 64, On = 256, K = L(!0), ft = L(On), mt = L(yn), Ce = L(""), Fn = L(void 0), Ct = L(Tn), vt = L(void 0);
950
+ function En({ links: e }) {
967
951
  return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
968
952
  }
969
953
  const te = "Navbar", X = {
@@ -974,7 +958,7 @@ const te = "Navbar", X = {
974
958
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
975
959
  // settings: `${PREFIX}-settings`,
976
960
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
977
- }, Tn = H(y, { name: "NavBar" })(({ theme: e }) => ({
961
+ }, Nn = R($, { name: "NavBar" })(({ theme: e }) => ({
978
962
  [`&.${X.root}`]: {
979
963
  display: "flex"
980
964
  },
@@ -993,13 +977,13 @@ const te = "Navbar", X = {
993
977
  // marginTop: '64px',
994
978
  // marginBottom: '16px',
995
979
  // },
996
- })), oe = (e, t, n) => e.transitions.create(t, {
980
+ })), ie = (e, t, n) => e.transitions.create(t, {
997
981
  easing: e.transitions.easing.sharp,
998
982
  duration: n === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
999
- }), En = (e) => {
1000
- const t = ie();
983
+ }), Pn = (e) => {
984
+ const t = re();
1001
985
  return /* @__PURE__ */ o(
1002
- Rt,
986
+ Mt,
1003
987
  a({
1004
988
  easing: t.transitions.easing.sharp,
1005
989
  timeout: {
@@ -1008,7 +992,7 @@ const te = "Navbar", X = {
1008
992
  }
1009
993
  }, e)
1010
994
  );
1011
- }, mt = (e) => {
995
+ }, xt = (e) => {
1012
996
  var t, n;
1013
997
  return {
1014
998
  overflowX: "hidden",
@@ -1018,11 +1002,11 @@ const te = "Navbar", X = {
1018
1002
  };
1019
1003
  }, Re = (e, t) => a({
1020
1004
  width: t,
1021
- transition: oe(e, "width", "entering")
1022
- }, mt(e)), He = (e, t) => a({
1005
+ transition: ie(e, "width", "entering")
1006
+ }, xt(e)), He = (e, t) => a({
1023
1007
  width: t,
1024
- transition: oe(e, "width", "leaving")
1025
- }, mt(e)), Bn = H(xe, {
1008
+ transition: ie(e, "width", "leaving")
1009
+ }, xt(e)), Bn = R(ve, {
1026
1010
  shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
1027
1011
  })(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => a(a({
1028
1012
  flexShrink: 0,
@@ -1030,14 +1014,14 @@ const te = "Navbar", X = {
1030
1014
  boxSizing: "border-box",
1031
1015
  display: "flex",
1032
1016
  flexDirection: "column"
1033
- }, t && A(a({}, Re(e, n)), {
1017
+ }, t && b(a({}, Re(e, n)), {
1034
1018
  backgroundColor: "",
1035
1019
  "& .MuiDrawer-paper": Re(e, n)
1036
- })), !t && A(a({}, He(e, r ? n : i)), {
1020
+ })), !t && b(a({}, He(e, r ? n : i)), {
1037
1021
  backgroundColor: "",
1038
1022
  "& .MuiDrawer-paper": He(e, r ? n : i)
1039
1023
  })));
1040
- function Fn(e) {
1024
+ function Ln(e) {
1041
1025
  let t = 0;
1042
1026
  for (let n = 0, i = e.length; n < i; n++) {
1043
1027
  const r = e.charCodeAt(n);
@@ -1045,11 +1029,11 @@ function Fn(e) {
1045
1029
  }
1046
1030
  return t;
1047
1031
  }
1048
- const We = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Nn = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
1049
- function Pn({ user: e, domainCode: t, open: n }) {
1050
- const i = ie();
1051
- return /* @__PURE__ */ g(
1052
- y,
1032
+ const We = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], _n = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
1033
+ function Mn({ user: e, domainCode: t, open: n }) {
1034
+ const i = re();
1035
+ return /* @__PURE__ */ p(
1036
+ $,
1053
1037
  {
1054
1038
  sx: {
1055
1039
  paddingTop: 3,
@@ -1060,36 +1044,36 @@ function Pn({ user: e, domainCode: t, open: n }) {
1060
1044
  },
1061
1045
  children: [
1062
1046
  /* @__PURE__ */ o(
1063
- y,
1047
+ $,
1064
1048
  {
1065
1049
  sx: {
1066
1050
  width: n ? "5rem" : "2rem",
1067
- transition: n ? oe(i, ["width", "height"], "entering") : oe(i, ["width", "height"], "leaving"),
1051
+ transition: n ? ie(i, ["width", "height"], "entering") : ie(i, ["width", "height"], "leaving"),
1068
1052
  aspectRatio: 1
1069
1053
  },
1070
1054
  children: e != null && e.name ? /* @__PURE__ */ o(
1071
- Be,
1055
+ Ee,
1072
1056
  {
1073
1057
  src: e == null ? void 0 : e.picture,
1074
1058
  sx: {
1075
1059
  width: "100%",
1076
1060
  height: "100%",
1077
- bgcolor: We[Math.abs(Fn(e.name)) % We.length]
1061
+ bgcolor: We[Math.abs(Ln(e.name)) % We.length]
1078
1062
  },
1079
- children: Nn(e.name)
1063
+ children: _n(e.name)
1080
1064
  }
1081
- ) : /* @__PURE__ */ o(Be, { sx: { width: "100%", height: "100%" } })
1065
+ ) : /* @__PURE__ */ o(Ee, { sx: { width: "100%", height: "100%" } })
1082
1066
  }
1083
1067
  ),
1084
- /* @__PURE__ */ o(En, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Ht, { in: n, children: /* @__PURE__ */ g(y, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
1085
- e != null && e.name ? /* @__PURE__ */ o(F, { children: e.name }) : /* @__PURE__ */ o(Fe, { animation: !1, width: "50%" }),
1086
- t ? /* @__PURE__ */ o(F, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Fe, { animation: !1, width: "25%" })
1068
+ /* @__PURE__ */ o(Pn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Rt, { in: n, children: /* @__PURE__ */ p($, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
1069
+ e != null && e.name ? /* @__PURE__ */ o(E, { children: e.name }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "50%" }),
1070
+ t ? /* @__PURE__ */ o(E, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "25%" })
1087
1071
  ] }) }) })
1088
1072
  ]
1089
1073
  }
1090
1074
  );
1091
1075
  }
1092
- function Ln({
1076
+ function Rn({
1093
1077
  open: e,
1094
1078
  widthClosed: t,
1095
1079
  widthOpen: n,
@@ -1097,48 +1081,48 @@ function Ln({
1097
1081
  top: r,
1098
1082
  middle: s,
1099
1083
  bottom: l,
1100
- user: u,
1084
+ user: d,
1101
1085
  domainCode: c
1102
1086
  }) {
1103
- const d = ut(), C = tt(j);
1104
- return /* @__PURE__ */ o(Tn, { className: X.root, "data-testid": i, children: /* @__PURE__ */ g(
1087
+ const u = gt(), v = rt(K);
1088
+ return /* @__PURE__ */ o(Nn, { className: X.root, "data-testid": i, children: /* @__PURE__ */ p(
1105
1089
  Bn,
1106
1090
  {
1107
1091
  open: e,
1108
1092
  widthOpen: n,
1109
1093
  widthClosed: t,
1110
1094
  anchor: "left",
1111
- variant: d ? "temporary" : "permanent",
1095
+ variant: u ? "temporary" : "permanent",
1112
1096
  PaperProps: {
1113
1097
  component: "nav"
1114
1098
  },
1115
1099
  onClose: () => {
1116
- C(!1);
1100
+ v(!1);
1117
1101
  },
1118
- isSmallScreen: d,
1102
+ isSmallScreen: u,
1119
1103
  children: [
1120
- !d && /* @__PURE__ */ o(Wt, {}),
1121
- r && /* @__PURE__ */ g(y, { flexGrow: "0", children: [
1104
+ !u && /* @__PURE__ */ o(Ht, {}),
1105
+ r && /* @__PURE__ */ p($, { flexGrow: "0", children: [
1122
1106
  r,
1123
- /* @__PURE__ */ o(Ne, { variant: "middle" })
1107
+ /* @__PURE__ */ o(Pe, { variant: "middle" })
1124
1108
  ] }),
1125
- /* @__PURE__ */ o(y, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o($n, { links: s }) : s }),
1126
- /* @__PURE__ */ g(y, { flexGrow: "0", children: [
1127
- /* @__PURE__ */ o(Ne, { variant: "middle" }),
1128
- /* @__PURE__ */ o(Pn, { user: u, domainCode: c, open: e }),
1129
- l && /* @__PURE__ */ o(R, { children: l })
1109
+ /* @__PURE__ */ o($, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o(En, { links: s }) : s }),
1110
+ /* @__PURE__ */ p($, { flexGrow: "0", children: [
1111
+ /* @__PURE__ */ o(Pe, { variant: "middle" }),
1112
+ /* @__PURE__ */ o(Mn, { user: d, domainCode: c, open: e }),
1113
+ l && /* @__PURE__ */ o(B, { children: l })
1130
1114
  ] })
1131
1115
  ]
1132
1116
  }
1133
1117
  ) });
1134
1118
  }
1135
- function Mn({
1119
+ function Hn({
1136
1120
  children: e,
1137
1121
  topBarHeight: t,
1138
1122
  maxWidth: n = !1
1139
1123
  }) {
1140
1124
  return /* @__PURE__ */ o(
1141
- y,
1125
+ $,
1142
1126
  {
1143
1127
  sx: {
1144
1128
  overflow: "auto",
@@ -1148,7 +1132,7 @@ function Mn({
1148
1132
  flexGrow: 1
1149
1133
  },
1150
1134
  children: /* @__PURE__ */ o(
1151
- Ke,
1135
+ et,
1152
1136
  {
1153
1137
  component: "main",
1154
1138
  id: "main-content",
@@ -1160,18 +1144,18 @@ function Mn({
1160
1144
  }
1161
1145
  );
1162
1146
  }
1163
- const _n = "TopBar", Rn = {
1164
- titleText: `${_n}-titleText`
1147
+ const Wn = "TopBar", zn = {
1148
+ titleText: `${Wn}-titleText`
1165
1149
  };
1166
- function Hn({
1150
+ function Un({
1167
1151
  titleText: e = "",
1168
1152
  height: t,
1169
1153
  "data-testid": n,
1170
1154
  middle: i
1171
1155
  }) {
1172
- const r = tt(j), s = () => r((c) => !c), l = ie(), u = ut();
1173
- return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ g(
1174
- je,
1156
+ const r = rt(K), s = () => r((c) => !c), l = re(), d = gt();
1157
+ return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ p(
1158
+ Ke,
1175
1159
  {
1176
1160
  square: !0,
1177
1161
  elevation: 0,
@@ -1185,17 +1169,17 @@ function Hn({
1185
1169
  gap: 2,
1186
1170
  flexShrink: 0,
1187
1171
  height: t,
1188
- zIndex: u ? 0 : l.zIndex.drawer + 1
1172
+ zIndex: d ? 0 : l.zIndex.drawer + 1
1189
1173
  },
1190
1174
  children: [
1191
- /* @__PURE__ */ o(Q, { size: "medium", color: "inherit", sx: { padding: 1.5 }, onClick: s, children: /* @__PURE__ */ o(Jt, { fontSize: "medium" }) }),
1192
- /* @__PURE__ */ o(F, { className: Rn.titleText, variant: "h6", children: e }),
1175
+ /* @__PURE__ */ o(Q, { size: "medium", color: "inherit", sx: { padding: 1.5 }, onClick: s, children: /* @__PURE__ */ o(Yt, { fontSize: "medium" }) }),
1176
+ /* @__PURE__ */ o(E, { className: zn.titleText, variant: "h6", children: e }),
1193
1177
  i
1194
1178
  ]
1195
1179
  }
1196
1180
  ) });
1197
1181
  }
1198
- function Io({
1182
+ function Fo({
1199
1183
  children: e,
1200
1184
  initialTitleText: t,
1201
1185
  initialNavBarOpen: n,
@@ -1203,48 +1187,48 @@ function Io({
1203
1187
  pageContentDataTestId: r,
1204
1188
  topBarDataTestId: s,
1205
1189
  navBarDataTestId: l,
1206
- navBarMiddle: u,
1190
+ navBarMiddle: d,
1207
1191
  navBarBottom: c,
1208
- user: d,
1209
- domainCode: C
1192
+ user: u,
1193
+ domainCode: v
1210
1194
  }) {
1211
- ot([
1212
- [j, n != null ? n : !0],
1195
+ st([
1196
+ [K, n != null ? n : !0],
1213
1197
  [Ce, t != null ? t : ""]
1214
1198
  ]);
1215
- const v = Pe(j), [w] = V(pt), [h] = V(gt), S = Pe(Ce), [D] = V(ht), [O] = V(In), [f] = V(ft);
1216
- return /* @__PURE__ */ g(y, { children: [
1217
- /* @__PURE__ */ o(zt, {}),
1199
+ const w = Be(K), [A] = V(ft), [m] = V(mt), S = Be(Ce), [k] = V(Ct), [I] = V(Fn), [g] = V(vt);
1200
+ return /* @__PURE__ */ p($, { children: [
1201
+ /* @__PURE__ */ o(Wt, {}),
1218
1202
  /* @__PURE__ */ o(
1219
- Hn,
1203
+ Un,
1220
1204
  {
1221
1205
  titleText: S,
1222
1206
  "data-testid": s,
1223
- height: D,
1224
- middle: O
1207
+ height: k,
1208
+ middle: I
1225
1209
  }
1226
1210
  ),
1227
- /* @__PURE__ */ g(y, { sx: { display: "flex" }, children: [
1211
+ /* @__PURE__ */ p($, { sx: { display: "flex" }, children: [
1228
1212
  /* @__PURE__ */ o(
1229
- Ln,
1213
+ Rn,
1230
1214
  {
1231
- open: v,
1232
- top: f,
1233
- middle: u,
1215
+ open: w,
1216
+ top: g,
1217
+ middle: d,
1234
1218
  bottom: c,
1235
- user: d,
1236
- domainCode: C,
1237
- widthOpen: w,
1238
- widthClosed: h,
1239
- offsetTop: D,
1219
+ user: u,
1220
+ domainCode: v,
1221
+ widthOpen: A,
1222
+ widthClosed: m,
1223
+ offsetTop: k,
1240
1224
  "data-testid": l
1241
1225
  }
1242
1226
  ),
1243
1227
  /* @__PURE__ */ o(
1244
- Mn,
1245
- A(a({
1228
+ Hn,
1229
+ b(a({
1246
1230
  "data-testid": r,
1247
- topBarHeight: D
1231
+ topBarHeight: k
1248
1232
  }, i), {
1249
1233
  children: e
1250
1234
  })
@@ -1252,13 +1236,13 @@ function Io({
1252
1236
  ] })
1253
1237
  ] });
1254
1238
  }
1255
- const Wn = {
1239
+ const Gn = {
1256
1240
  autoHideDuration: 6e3,
1257
1241
  anchorOrigin: { vertical: "top", horizontal: "center" },
1258
1242
  // The default is false. If we prefer timer to continue when window loses
1259
1243
  // focus, change to true
1260
1244
  disableWindowBlurListener: !1
1261
- }, zn = {
1245
+ }, Vn = {
1262
1246
  shouldClose: (e, t) => t !== "clickaway"
1263
1247
  }, ze = {
1264
1248
  message: "",
@@ -1266,108 +1250,108 @@ const Wn = {
1266
1250
  variant: "standard",
1267
1251
  progressIndicator: void 0
1268
1252
  // Can use 'circular' or 'linear'
1269
- }, Ue = 100, Ge = 2e3, Un = 2e3, Gn = (() => {
1253
+ }, Ue = 100, Ge = 2e3, qn = 2e3, Xn = (() => {
1270
1254
  let e = 0;
1271
1255
  return () => (e += 1, e);
1272
- })(), Vn = {
1256
+ })(), Qn = {
1273
1257
  borderBottomLeftRadius: "0px",
1274
1258
  borderBottomRightRadius: "0px"
1275
- }, qn = {}, Xn = {}, Ct = Xe(null);
1276
- function Qn(s) {
1259
+ }, Kn = {}, Yn = {}, wt = Xe(null);
1260
+ function Jn(s) {
1277
1261
  var l = s, {
1278
- overrideState: e = qn,
1279
- overrideActions: t = Xn,
1280
- shouldClose: n = zn.shouldClose,
1262
+ overrideState: e = Kn,
1263
+ overrideActions: t = Yn,
1264
+ shouldClose: n = Vn.shouldClose,
1281
1265
  children: i
1282
- } = l, r = Te(l, [
1266
+ } = l, r = Oe(l, [
1283
1267
  "overrideState",
1284
1268
  "overrideActions",
1285
1269
  "shouldClose",
1286
1270
  "children"
1287
1271
  ]);
1288
1272
  var P;
1289
- const [{ open: u }, c] = T({ open: !1 }), d = de([]), C = de(Date.now()), v = de(0), w = ne((b) => {
1290
- c({ open: b });
1291
- }, []), h = ne((b = {}) => {
1292
- v.current += 1, d.current.length >= Ue && Date.now() - C.current >= Ge && (C.current = Date.now(), console.error(
1293
- `SaladBarProvider: MAX_QUEUE_LENGTH (${Ue}) hit ${v.current} times in last ${Ge}ms)`
1294
- ), v.current = 0);
1295
- const x = a(A(a({}, ze), {
1296
- key: Gn()
1297
- }), b);
1298
- return d.current.push(x), d.current.length === 1 && c({ open: !0 }), x.key;
1299
- }, []), S = (b = "", x = {}) => h(a({ message: b, severity: "success" }, x)), D = (b = "", x = {}) => h(a({ message: b, severity: "info" }, x)), O = (b = "", x = {}) => h(a({ message: b, severity: "warning" }, x)), f = (b = "", x = {}) => h(a({ message: b, severity: "error" }, x)), k = (b) => {
1300
- const x = d.current.findIndex((_) => _.key === b);
1301
- if (x !== -1)
1302
- return x === 0 ? (c({ open: !1 }), d.current[0]) : d.current.splice(x, 1);
1303
- }, W = (b, x) => {
1304
- n(b, x) && c({ open: !1 });
1273
+ const [{ open: d }, c] = F({ open: !1 }), u = ue([]), v = ue(Date.now()), w = ue(0), A = ne((x) => {
1274
+ c({ open: x });
1275
+ }, []), m = ne((x = {}) => {
1276
+ w.current += 1, u.current.length >= Ue && Date.now() - v.current >= Ge && (v.current = Date.now(), console.error(
1277
+ `SaladBarProvider: MAX_QUEUE_LENGTH (${Ue}) hit ${w.current} times in last ${Ge}ms)`
1278
+ ), w.current = 0);
1279
+ const C = a(b(a({}, ze), {
1280
+ key: Xn()
1281
+ }), x);
1282
+ return u.current.push(C), u.current.length === 1 && c({ open: !0 }), C.key;
1283
+ }, []), S = (x = "", C = {}) => m(a({ message: x, severity: "success" }, C)), k = (x = "", C = {}) => m(a({ message: x, severity: "info" }, C)), I = (x = "", C = {}) => m(a({ message: x, severity: "warning" }, C)), g = (x = "", C = {}) => m(a({ message: x, severity: "error" }, C)), D = (x) => {
1284
+ const C = u.current.findIndex((M) => M.key === x);
1285
+ if (C !== -1)
1286
+ return C === 0 ? (c({ open: !1 }), u.current[0]) : u.current.splice(C, 1);
1287
+ }, H = (x, C) => {
1288
+ n(x, C) && c({ open: !1 });
1305
1289
  }, N = () => {
1306
- }, M = () => {
1307
- d.current.shift(), d.current.length > 0 && c({ open: !0 });
1308
- }, I = (P = d.current[0]) != null ? P : a({}, ze), p = {};
1309
- "autoHideDuration" in I && (p.autoHideDuration = I.autoHideDuration);
1310
- const m = a(a({}, Wn), r), E = a(a({
1311
- open: u,
1312
- setOpen: w,
1313
- enqueueNotification: h,
1290
+ }, _ = () => {
1291
+ u.current.shift(), u.current.length > 0 && c({ open: !0 });
1292
+ }, T = (P = u.current[0]) != null ? P : a({}, ze), h = {};
1293
+ "autoHideDuration" in T && (h.autoHideDuration = T.autoHideDuration);
1294
+ const f = a(a({}, Gn), r), O = a(a({
1295
+ open: d,
1296
+ setOpen: A,
1297
+ enqueueNotification: m,
1314
1298
  enqueueSuccessNotification: S,
1315
- enqueueInfoNotification: D,
1316
- enqueueWarningNotification: O,
1317
- enqueueErrorNotification: f,
1318
- removeNotification: k
1299
+ enqueueInfoNotification: k,
1300
+ enqueueWarningNotification: I,
1301
+ enqueueErrorNotification: g,
1302
+ removeNotification: D
1319
1303
  }, e), t);
1320
- return /* @__PURE__ */ g(Ct.Provider, { value: E, children: [
1304
+ return /* @__PURE__ */ p(wt.Provider, { value: O, children: [
1321
1305
  i,
1322
1306
  /* @__PURE__ */ o(
1323
- Ut,
1324
- A(a(a({}, m), p), {
1325
- open: u,
1326
- onClose: W,
1307
+ zt,
1308
+ b(a(a({}, f), h), {
1309
+ open: d,
1310
+ onClose: H,
1327
1311
  TransitionProps: {
1328
- onExited: M,
1312
+ onExited: _,
1329
1313
  onExit: N
1330
1314
  },
1331
- sx: { zIndex: Un },
1332
- children: /* @__PURE__ */ g("div", { children: [
1315
+ sx: { zIndex: qn },
1316
+ children: /* @__PURE__ */ p("div", { children: [
1333
1317
  /* @__PURE__ */ o(
1334
- Gt,
1318
+ Ut,
1335
1319
  {
1336
- onClose: (b) => W(b, "closeAlert"),
1337
- severity: I.severity,
1320
+ onClose: (x) => H(x, "closeAlert"),
1321
+ severity: T.severity,
1338
1322
  variant: "filled",
1339
- icon: I.progressIndicator === "circular" ? /* @__PURE__ */ o(be, { size: "1em" }) : void 0,
1340
- style: I.progressIndicator === "linear" ? Vn : void 0,
1341
- children: I.message
1323
+ icon: T.progressIndicator === "circular" ? /* @__PURE__ */ o(Ae, { size: "1em" }) : void 0,
1324
+ style: T.progressIndicator === "linear" ? Qn : void 0,
1325
+ children: T.message
1342
1326
  }
1343
1327
  ),
1344
- I.progressIndicator === "linear" && /* @__PURE__ */ o(Vt, { color: "primary" })
1328
+ T.progressIndicator === "linear" && /* @__PURE__ */ o(Gt, { color: "primary" })
1345
1329
  ] })
1346
1330
  })
1347
1331
  )
1348
1332
  ] });
1349
1333
  }
1350
- function jn() {
1351
- const e = Qe(Ct);
1334
+ function Zn() {
1335
+ const e = Qe(wt);
1352
1336
  if (e === null)
1353
- throw new Ae("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1337
+ throw new be("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1354
1338
  return e;
1355
1339
  }
1356
- const $o = K(
1357
- (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(Qn, A(a({}, e), { overrideState: t, overrideActions: n, children: i }))
1358
- ), Kn = an(), To = ({
1340
+ const Eo = Y(
1341
+ (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(Jn, b(a({}, e), { overrideState: t, overrideActions: n, children: i }))
1342
+ ), jn = rn(), No = ({
1359
1343
  children: e,
1360
1344
  store: t
1361
- }) => /* @__PURE__ */ o(nt, { store: t != null ? t : Kn, children: e }), xt = "domainCode";
1345
+ }) => /* @__PURE__ */ o(at, { store: t != null ? t : jn, children: e }), At = "domainCode";
1362
1346
  var qe;
1363
1347
  const Ve = L(
1364
- JSON.parse((qe = localStorage.getItem(xt)) != null ? qe : '{"domainCode": ""}').domainCode
1365
- ), vt = L(
1348
+ JSON.parse((qe = localStorage.getItem(At)) != null ? qe : '{"domainCode": ""}').domainCode
1349
+ ), St = L(
1366
1350
  (e) => e(Ve),
1367
1351
  (e, t, n) => {
1368
- t(Ve, n), localStorage.setItem(xt, JSON.stringify({ domainCode: n }));
1352
+ t(Ve, n), localStorage.setItem(At, JSON.stringify({ domainCode: n }));
1369
1353
  }
1370
- ), Jn = {
1354
+ ), eo = {
1371
1355
  act: "ACT",
1372
1356
  nsw: "NSW",
1373
1357
  nt: "NT",
@@ -1379,10 +1363,10 @@ const Ve = L(
1379
1363
  ag: "AG",
1380
1364
  fedmps: "Fedmps",
1381
1365
  "": ""
1382
- }, Yn = (e) => {
1366
+ }, to = (e) => {
1383
1367
  var t;
1384
- return e === null ? "N/A" : (t = Jn[e]) != null ? t : "";
1385
- }, Eo = ({
1368
+ return e === null ? "N/A" : (t = eo[e]) != null ? t : "";
1369
+ }, Po = ({
1386
1370
  isLoading: e,
1387
1371
  isOpen: t,
1388
1372
  onClose: n,
@@ -1390,65 +1374,65 @@ const Ve = L(
1390
1374
  applicationName: r,
1391
1375
  handleLogout: s
1392
1376
  }) => {
1393
- const [l, u] = V(vt), [c, d] = T(l), { enqueueSuccessNotification: C } = jn(), v = i.length === 0, w = !!l && !i.includes(l) && !i.includes(c), h = !l || v || w, S = () => B(void 0, null, function* () {
1394
- c ? (u(c), C(`Set domain to ${c}`), n()) : u("");
1395
- }), D = () => B(void 0, null, function* () {
1396
- l && !v && !w ? (d(l), n()) : h && s();
1377
+ const [l, d] = V(St), [c, u] = F(l), { enqueueSuccessNotification: v } = Zn(), w = i.length === 0, A = !!l && !i.includes(l) && !i.includes(c), m = !l || w || A, S = () => z(void 0, null, function* () {
1378
+ c ? (d(c), v(`Set domain to ${c}`), n()) : d("");
1379
+ }), k = () => z(void 0, null, function* () {
1380
+ l && !w && !A ? (u(l), n()) : m && s();
1397
1381
  });
1398
- let O;
1399
- return v ? O = "Unable to retrieve your active organisations. Try logging in again." : w && (O = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ g(
1400
- lt,
1382
+ let I;
1383
+ return w ? I = "Unable to retrieve your active organisations. Try logging in again." : A && (I = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ p(
1384
+ fn,
1401
1385
  {
1402
1386
  isOpen: t,
1403
1387
  dialogTitle: "Select an organisation",
1404
1388
  primaryButton: {
1405
1389
  text: "Confirm",
1406
1390
  onClick: S,
1407
- disabled: !c || v || w,
1391
+ disabled: !c || w || A,
1408
1392
  buttonColor: "primary"
1409
1393
  },
1410
1394
  secondaryButton: {
1411
- text: h ? "Logout" : "Cancel",
1412
- onClick: D
1395
+ text: m ? "Logout" : "Cancel",
1396
+ onClick: k
1413
1397
  },
1414
- onClose: h ? () => {
1398
+ onClose: m ? () => {
1415
1399
  } : n,
1416
1400
  children: [
1417
- /* @__PURE__ */ g(F, { marginBottom: 2, children: [
1401
+ /* @__PURE__ */ p(E, { marginBottom: 2, children: [
1418
1402
  "Select the default organisation that you want to use with the ",
1419
1403
  r,
1420
1404
  "."
1421
1405
  ] }),
1422
1406
  /* @__PURE__ */ o(
1423
- ve,
1407
+ xe,
1424
1408
  {
1425
1409
  loading: e,
1426
1410
  multiple: !1,
1427
1411
  disableClearable: !1,
1428
1412
  value: c !== "" ? c : null,
1429
- onChange: (f, k) => d(k != null ? k : ""),
1430
- getOptionLabel: Yn,
1413
+ onChange: (g, D) => u(D != null ? D : ""),
1414
+ getOptionLabel: to,
1431
1415
  options: [...i],
1432
- renderInput: (f) => /* @__PURE__ */ o(
1416
+ renderInput: (g) => /* @__PURE__ */ o(
1433
1417
  we,
1434
- A(a({}, f), {
1418
+ b(a({}, g), {
1435
1419
  variant: "filled",
1436
1420
  label: "Select organisation",
1437
- InputProps: A(a({}, f.InputProps), {
1438
- endAdornment: /* @__PURE__ */ g(R, { children: [
1439
- e ? /* @__PURE__ */ o(be, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1440
- f.InputProps.endAdornment
1421
+ InputProps: b(a({}, g.InputProps), {
1422
+ endAdornment: /* @__PURE__ */ p(B, { children: [
1423
+ e ? /* @__PURE__ */ o(Ae, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1424
+ g.InputProps.endAdornment
1441
1425
  ] })
1442
1426
  })
1443
1427
  })
1444
1428
  )
1445
1429
  }
1446
1430
  ),
1447
- O && /* @__PURE__ */ o(qt, { error: !0, children: O })
1431
+ I && /* @__PURE__ */ o(Vt, { error: !0, children: I })
1448
1432
  ]
1449
1433
  }
1450
1434
  );
1451
- }, Bo = Je({
1435
+ }, Bo = tt({
1452
1436
  palette: {
1453
1437
  primary: {
1454
1438
  dark: "#00A651",
@@ -1499,7 +1483,7 @@ const Ve = L(
1499
1483
  navBar: {
1500
1484
  backgroundColor: "#E8E8E8"
1501
1485
  }
1502
- }), Fo = Je({
1486
+ }), Lo = tt({
1503
1487
  palette: {
1504
1488
  primary: {
1505
1489
  main: "#007236",
@@ -1553,18 +1537,18 @@ const Ve = L(
1553
1537
  styleOverrides: {
1554
1538
  root: ({ theme: e }) => ({
1555
1539
  "&.Mui-selected": {
1556
- backgroundColor: ue(
1540
+ backgroundColor: pe(
1557
1541
  e.palette.secondary.main,
1558
1542
  e.palette.action.selectedOpacity
1559
1543
  ),
1560
1544
  "&:hover": {
1561
- backgroundColor: ue(
1545
+ backgroundColor: pe(
1562
1546
  e.palette.secondary.main,
1563
1547
  e.palette.action.selectedOpacity
1564
1548
  )
1565
1549
  },
1566
1550
  "&.Mui-focusVisible": {
1567
- backgroundColor: ue(
1551
+ backgroundColor: pe(
1568
1552
  e.palette.secondary.main,
1569
1553
  e.palette.action.focusOpacity
1570
1554
  )
@@ -1590,75 +1574,74 @@ const Ve = L(
1590
1574
  navBar: {
1591
1575
  backgroundColor: "#E8E8E8"
1592
1576
  }
1593
- }), Zn = {
1594
- domainCode: vt,
1595
- navBarOpen: j,
1596
- navBarWidthOpen: pt,
1597
- navBarWidthClosed: gt,
1577
+ }), no = {
1578
+ domainCode: St,
1579
+ navBarOpen: K,
1580
+ navBarWidthOpen: ft,
1581
+ navBarWidthClosed: mt,
1598
1582
  titleText: Ce,
1599
- topBarHeight: ht,
1600
- navBarTop: ft
1601
- }, No = K(() => ({ children: e }) => /* @__PURE__ */ o(nt, { children: e })), eo = ({
1583
+ topBarHeight: Ct,
1584
+ navBarTop: vt
1585
+ }, _o = Y(() => ({ children: e }) => /* @__PURE__ */ o(at, { children: e })), oo = ({
1602
1586
  initialValues: e,
1603
1587
  children: t
1604
- }) => (ot(e), /* @__PURE__ */ o(R, { children: t })), Po = K(
1588
+ }) => (st(e), /* @__PURE__ */ o(B, { children: t })), Mo = Y(
1605
1589
  (e) => ({ children: t }) => /* @__PURE__ */ o(
1606
- eo,
1590
+ oo,
1607
1591
  {
1608
1592
  initialValues: Object.entries(e).map(
1609
1593
  ([n, i]) => [
1610
- Zn[n],
1594
+ no[n],
1611
1595
  i
1612
1596
  ]
1613
1597
  ),
1614
1598
  children: t
1615
1599
  }
1616
1600
  )
1617
- ), Lo = K(() => ({ children: e }) => {
1618
- const t = new tn();
1619
- return /* @__PURE__ */ o(nn, { client: t, children: e });
1601
+ ), Ro = Y(() => ({ children: e }) => {
1602
+ const t = new en();
1603
+ return /* @__PURE__ */ o(tn, { client: t, children: e });
1620
1604
  });
1621
1605
  export {
1622
- lt as AgDialog,
1623
- Io as AppLayout,
1624
- To as AtomProvider,
1625
- Ct as Context,
1626
- Ae as ContextError,
1627
- Eo as DomainCodeDialog,
1628
- vo as ExampleComponent,
1629
- Do as FetchAutocomplete,
1630
- eo as HydrateAtoms,
1631
- rt as NAVBAR_WIDTH_CLOSED,
1632
- it as NAVBAR_WIDTH_OPENED,
1633
- Ao as NavBar,
1634
- bo as NavBarDarkStyledList,
1635
- So as NavBarLightStyledList,
1636
- gn as NavBarProvider,
1606
+ fn as AgDialog,
1607
+ Fo as AppLayout,
1608
+ No as AtomProvider,
1609
+ yo as AuthGuard,
1610
+ wt as Context,
1611
+ be as ContextError,
1612
+ Po as DomainCodeDialog,
1613
+ So as ExampleComponent,
1614
+ Io as FetchAutocomplete,
1615
+ oo as HydrateAtoms,
1616
+ ct as NAVBAR_WIDTH_CLOSED,
1617
+ lt as NAVBAR_WIDTH_OPENED,
1618
+ $o as NavBar,
1619
+ ko as NavBarDarkStyledList,
1620
+ Do as NavBarLightStyledList,
1621
+ pn as NavBarProvider,
1637
1622
  Oo as PageLayout,
1638
- Qn as SaladBarProvider,
1639
- yo as SessionExpiryDialog,
1640
- ko as SingleAutocomplete,
1641
- Kn as atomStore,
1642
- fn as buildNavBarState,
1643
- vt as domainCodeAtom,
1623
+ Jn as SaladBarProvider,
1624
+ To as SingleAutocomplete,
1625
+ jn as atomStore,
1626
+ gn as buildNavBarState,
1627
+ St as domainCodeAtom,
1644
1628
  Bo as fed21Theme,
1645
- mn as getAuth0Expiry,
1646
- Fo as internalAgSystemsTheme,
1629
+ Lo as internalAgSystemsTheme,
1647
1630
  q as navBarClasses,
1648
- j as navBarOpenAtom,
1649
- ft as navBarTopAtom,
1650
- gt as navBarWidthClosedAtom,
1651
- pt as navBarWidthOpenAtom,
1631
+ K as navBarOpenAtom,
1632
+ vt as navBarTopAtom,
1633
+ mt as navBarWidthClosedAtom,
1634
+ ft as navBarWidthOpenAtom,
1652
1635
  Ce as titleTextAtom,
1653
- ht as topBarHeightAtom,
1654
- In as topBarMiddleAtom,
1655
- ct as useAutocompleteOptions,
1636
+ Ct as topBarHeightAtom,
1637
+ Fn as topBarMiddleAtom,
1638
+ pt as useAutocompleteOptions,
1656
1639
  hn as useNavBar,
1657
- jn as useSaladBar,
1658
- No as withAtomProvider,
1659
- wo as withNavBarProvider,
1660
- Po as withOverrideDefaults,
1661
- Lo as withQueryClient,
1662
- $o as withSaladBarProvider
1640
+ Zn as useSaladBar,
1641
+ _o as withAtomProvider,
1642
+ bo as withNavBarProvider,
1643
+ Mo as withOverrideDefaults,
1644
+ Ro as withQueryClient,
1645
+ Eo as withSaladBarProvider
1663
1646
  };
1664
1647
  //# sourceMappingURL=index.js.map