@australiangreens/ag-internal-components 0.0.88 → 0.0.89

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
@@ -37,25 +37,24 @@ var N = (e, t, n) => new Promise((i, r) => {
37
37
  d((n = n.apply(e, t)).next());
38
38
  });
39
39
  import { jsxs as p, Fragment as M, jsx as o } from "react/jsx-runtime";
40
- import { useState as E, createContext as Qe, useCallback as ne, useContext as Ye, createElement as Ce, useEffect as oe, useRef as he } from "react";
41
- import { Typography as P, Button as ie, Paper as Ke, Box as $, Drawer as ve, Dialog as Je, LinearProgress as Ze, DialogTitle as je, DialogContent as et, DialogActions as tt, Autocomplete as we, TextField as Ae, CircularProgress as be, Chip as _t, Tooltip as Mt, Stack as Rt, styled as Se, IconButton as Y, Container as nt, useTheme as ae, useMediaQuery as Ht, Collapse as Wt, Avatar as Fe, Fade as zt, Skeleton as Pe, Toolbar as Ut, Divider as Ne, CssBaseline as Gt, Snackbar as Vt, Alert as qt, FormHelperText as Xt } from "@mui/material";
40
+ import { useState as E, createContext as Qe, useCallback as ne, useContext as Ye, useEffect as oe, createElement as Ce, useRef as he } from "react";
41
+ import { Typography as P, Button as ie, Paper as Ke, Box as $, Drawer as ve, styled as we, IconButton as Y, Container as Je, useTheme as ae, useMediaQuery as _t, Collapse as Mt, Avatar as Fe, Fade as Rt, Skeleton as Pe, Toolbar as Ht, Divider as Ne, CssBaseline as Wt, Dialog as Ze, LinearProgress as je, DialogTitle as et, DialogContent as tt, DialogActions as nt, Autocomplete as Ae, TextField as be, CircularProgress as Se, Chip as zt, Tooltip as Ut, Stack as Gt, Snackbar as Vt, Alert as qt, FormHelperText as Xt } from "@mui/material";
42
42
  import Qt from "@mui/material/CssBaseline";
43
43
  import { styled as H, createTheme as ot, alpha as ge } from "@mui/material/styles";
44
44
  import { AgError as Yt } from "@australiangreens/ag-error";
45
45
  import { createHelper as X } from "souvlaki";
46
46
  import { BrowserRouter as Kt } from "react-router-dom";
47
47
  import it from "@mui/material/List";
48
- import { Cancel as Jt, ArrowDropDown as Zt, ArrowForward as rt, ArrowBack as at, ViewHeadline as jt } from "@mui/icons-material";
48
+ import { ArrowForward as rt, ArrowBack as at, ViewHeadline as Jt, Cancel as Zt, ArrowDropDown as jt } from "@mui/icons-material";
49
49
  import { atom as R, useSetAtom as st, useAtomValue as Le, useAtom as V, getDefaultStore as en, Provider as lt } from "jotai";
50
- import "src/layouts";
50
+ import { useHydrateAtoms as ct } from "jotai/utils";
51
51
  import tn from "autosuggest-highlight/match";
52
52
  import nn from "autosuggest-highlight/parse";
53
53
  import { useQuery as on, QueryClient as rn, QueryClientProvider as an } from "@tanstack/react-query";
54
- import { useAuth0 as ct } from "@auth0/auth0-react";
54
+ import { useAuth0 as dt } from "@auth0/auth0-react";
55
55
  import { Buffer as sn } from "buffer";
56
56
  import ln from "@mui/material/Skeleton";
57
- import { useHydrateAtoms as dt } from "jotai/utils";
58
- function Io({ text: e }) {
57
+ function $o({ text: e }) {
59
58
  const [t, n] = E(0);
60
59
  return /* @__PURE__ */ p(M, { children: [
61
60
  /* @__PURE__ */ o(P, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
@@ -158,9 +157,9 @@ const gt = Qe(null), hn = {}, gn = {}, fn = ({
158
157
  return e;
159
158
  }, Cn = (e = {}) => s({
160
159
  open: !0
161
- }, e), To = X(
160
+ }, e), Io = X(
162
161
  (e = Cn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(fn, { overrideState: e, overrideActions: t, children: n })
163
- ), Oo = X(() => ({ children: e }) => /* @__PURE__ */ o(Kt, { children: e })), _e = 7, Bo = H(it)(({ theme: e }) => ({
162
+ ), To = X(() => ({ children: e }) => /* @__PURE__ */ o(Kt, { children: e })), _e = 7, Oo = H(it)(({ theme: e }) => ({
164
163
  backgroundColor: "black",
165
164
  color: "white",
166
165
  "& .MuiListItem-root": {
@@ -198,7 +197,7 @@ const gt = Qe(null), hn = {}, gn = {}, fn = ({
198
197
  // '&.Mui-selected.Mui-focusVisible:hover': {
199
198
  // },
200
199
  }
201
- })), Me = 7, Eo = H(it)(({ theme: e }) => ({
200
+ })), Me = 7, Bo = H(it)(({ theme: e }) => ({
202
201
  backgroundColor: "#e8e8e8",
203
202
  color: "inherit",
204
203
  "& .MuiListItem-root": {
@@ -237,7 +236,7 @@ const gt = Qe(null), hn = {}, gn = {}, fn = ({
237
236
  // },
238
237
  }
239
238
  }));
240
- function Fo({
239
+ function Eo({
241
240
  "data-testid": e,
242
241
  children: t
243
242
  }) {
@@ -256,591 +255,212 @@ function Fo({
256
255
  )
257
256
  ] });
258
257
  }
259
- const ft = ({
260
- isOpen: e,
261
- dialogTitle: t,
262
- children: n,
263
- maxWidth: i,
264
- primaryButton: r,
265
- secondaryButton: a,
266
- onClose: c,
267
- sx: d,
268
- "data-testid": l,
269
- disableCloseOnBackdropOrEscape: u = !1,
270
- isLoading: v = !1
271
- }) => {
272
- var g, D;
273
- const [C, w] = E(!1);
258
+ const xn = 24, vn = 64, G = "TopBar", B = {
259
+ topStripe: `${G}-topStripe`,
260
+ titleBar: `${G}-titleBar`,
261
+ titleSlider: `${G}-titleSlider`,
262
+ titleText: `${G}-titleText`,
263
+ leftPanelButton: `${G}-leftPanelButton`,
264
+ rightPanelButton: `${G}-leftPanelButton`
265
+ }, wn = we("div", {
266
+ shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
267
+ name: G
268
+ })(({ theme: e, leftPanel: t, rightPanel: n }) => {
269
+ var i, r;
270
+ return {
271
+ width: "100%",
272
+ [`& .${B.topStripe}`]: {
273
+ width: "100%",
274
+ height: `${xn}px`,
275
+ backgroundColor: e.palette.primary.main
276
+ },
277
+ [`& .${B.titleBar}`]: {
278
+ backgroundColor: e.palette.primary.light,
279
+ height: `${vn}px`,
280
+ padding: e.spacing(0, 3),
281
+ width: "100%"
282
+ },
283
+ [`& .${B.titleSlider}`]: s(s({
284
+ height: "100%",
285
+ display: "flex",
286
+ alignItems: "center",
287
+ color: "white",
288
+ transition: e.transitions.create("margin", {
289
+ easing: e.transitions.easing.sharp,
290
+ duration: e.transitions.duration.leavingScreen
291
+ }),
292
+ [`& .${B.leftPanelButton}`]: {
293
+ marginRight: e.spacing(2),
294
+ flexGrow: 0
295
+ },
296
+ [`& .${B.titleText}`]: {
297
+ flexGrow: 1
298
+ },
299
+ [`& .${B.rightPanelButton}`]: {
300
+ flexGrow: 0
301
+ }
302
+ }, (t == null ? void 0 : t.open) && {
303
+ transition: e.transitions.create("margin", {
304
+ easing: e.transitions.easing.easeOut,
305
+ duration: e.transitions.duration.enteringScreen
306
+ }),
307
+ marginLeft: `${(i = t == null ? void 0 : t.width) != null ? i : 0}px`
308
+ }), (n == null ? void 0 : n.open) && {
309
+ transition: e.transitions.create("margin", {
310
+ easing: e.transitions.easing.easeOut,
311
+ duration: e.transitions.duration.enteringScreen
312
+ }),
313
+ marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
314
+ })
315
+ };
316
+ });
317
+ function An({
318
+ titleText: e = "",
319
+ leftPanel: t,
320
+ rightPanel: n,
321
+ "data-testid": i
322
+ }) {
323
+ return /* @__PURE__ */ p(wn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
324
+ /* @__PURE__ */ o("div", { className: B.topStripe }),
325
+ /* @__PURE__ */ o("div", { className: B.titleBar, children: /* @__PURE__ */ p($, { className: B.titleSlider, children: [
326
+ t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ p(
327
+ Y,
328
+ {
329
+ className: B.leftPanelButton,
330
+ color: "inherit",
331
+ "aria-label": "Open left side panel",
332
+ onClick: t == null ? void 0 : t.onOpen,
333
+ edge: "start",
334
+ size: "large",
335
+ children: [
336
+ " ",
337
+ /* @__PURE__ */ o(rt, {})
338
+ ]
339
+ }
340
+ ),
341
+ /* @__PURE__ */ o(P, { className: B.titleText, variant: "h6", noWrap: !0, children: e }),
342
+ n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ p(
343
+ Y,
344
+ {
345
+ className: B.rightPanelButton,
346
+ color: "inherit",
347
+ "aria-label": "Open right side panel",
348
+ onClick: n == null ? void 0 : n.onOpen,
349
+ edge: "end",
350
+ size: "large",
351
+ children: [
352
+ " ",
353
+ /* @__PURE__ */ o(at, {})
354
+ ]
355
+ }
356
+ )
357
+ ] }) })
358
+ ] });
359
+ }
360
+ const ft = 400, bn = we(ve, {
361
+ shouldForwardProp: (e) => (
362
+ // Note we do want anchor to be forwarded to the Drawer component
363
+ ![
364
+ "width",
365
+ "debug",
366
+ "debugOpacity",
367
+ "navBarOpen",
368
+ "navBarWidthOpen",
369
+ "navBarWidthClosed"
370
+ ].includes(e)
371
+ ),
372
+ name: "SidePanelDrawer"
373
+ })(
374
+ ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: i, navBarWidthOpen: r, navBarWidthClosed: a }) => ({
375
+ width: e,
376
+ "& .MuiDrawer-paper": s(s({
377
+ position: "absolute",
378
+ width: e,
379
+ boxSizing: "border-box",
380
+ border: "unset",
381
+ boxShadow: "0px 4px 5px rgba(0, 0, 0, 0.14), 0px 1px 10px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2)"
382
+ }, t && {
383
+ opacity: "50%"
384
+ }), n === "left" && s({
385
+ marginLeft: `${a}px`
386
+ }, i && {
387
+ marginLeft: `${r}px`
388
+ }))
389
+ })
390
+ ), Sn = we($, {
391
+ shouldForwardProp: (e) => !["anchor"].includes(e)
392
+ })(({ theme: e, anchor: t }) => S(s({
393
+ display: "flex",
394
+ alignItems: "center",
395
+ padding: e.spacing(2)
396
+ }, e.mixins.toolbar), {
397
+ justifyContent: t === "left" ? "space-between" : "flex-start",
398
+ backgroundColor: e.palette.primary.light,
399
+ height: "88px",
400
+ "&,*": {
401
+ color: "white"
402
+ },
403
+ " .MuiTypography-root": {
404
+ fontSize: "22px"
405
+ },
406
+ " .MuiButtonBase-root": {
407
+ marginRight: t === "right" ? e.spacing(2) : 0
408
+ }
409
+ }));
410
+ function Re({
411
+ children: e,
412
+ anchor: t = "left",
413
+ open: n,
414
+ onClose: i = () => {
415
+ },
416
+ titleText: r = "",
417
+ width: a = ft,
418
+ showCloseArrow: c = !0,
419
+ debugOpacity: d = !1,
420
+ headerBoxProps: l = {},
421
+ onOpened: u,
422
+ onClosed: v,
423
+ "data-testid": C,
424
+ navBarOpen: w = !1,
425
+ navBarWidthOpen: g = 0,
426
+ navBarWidthClosed: D = 0
427
+ }) {
274
428
  return /* @__PURE__ */ p(
275
- Je,
429
+ bn,
276
430
  {
277
- open: e,
278
- onClose: (A, k) => N(void 0, null, function* () {
279
- u && (k === "backdropClick" || k === "escapeKeyDown") || C || (a != null && a.onClick ? yield a.onClick() : c());
280
- }),
281
- fullWidth: !0,
282
- maxWidth: i != null ? i : "xs",
283
- "data-testid": l,
284
- sx: d,
431
+ SlideProps: {
432
+ onEntered: () => u == null ? void 0 : u(),
433
+ onExited: () => v == null ? void 0 : v()
434
+ },
435
+ variant: "persistent",
436
+ anchor: t,
437
+ open: n,
438
+ width: a,
439
+ debugOpacity: d,
440
+ "data-testid": C,
441
+ navBarOpen: w,
442
+ navBarWidthOpen: g,
443
+ navBarWidthClosed: D,
285
444
  children: [
286
- v && /* @__PURE__ */ o(Ze, { sx: { height: "4px", marginBottom: "-4px" } }),
287
- /* @__PURE__ */ o(je, { children: t }),
288
- /* @__PURE__ */ o(et, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
289
- /* @__PURE__ */ p(tt, { children: [
290
- /* @__PURE__ */ o(
291
- ie,
292
- {
293
- onClick: (g = a == null ? void 0 : a.onClick) != null ? g : c,
294
- "data-testid": a == null ? void 0 : a.testId,
295
- disabled: (a == null ? void 0 : a.disabled) || C,
296
- color: a == null ? void 0 : a.buttonColor,
297
- children: (D = a == null ? void 0 : a.text) != null ? D : "Cancel"
298
- }
299
- ),
300
- r && /* @__PURE__ */ o(
301
- ie,
302
- {
303
- onClick: () => N(void 0, null, function* () {
304
- var A;
305
- w(!0), yield (A = r.onClick) == null ? void 0 : A.call(r), w(!1);
306
- }),
307
- "data-testid": r.testId,
308
- disabled: r.disabled || C,
309
- color: r == null ? void 0 : r.buttonColor,
310
- children: r.text
311
- }
312
- )
313
- ] })
314
- ]
315
- }
316
- );
317
- }, mt = ({
318
- minLength: e,
319
- preLoadedOptions: t,
320
- lookup: n,
321
- label: i,
322
- inputValue: r
323
- }) => on({
324
- queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
325
- (a) => a.label.toLowerCase().includes(r.toLowerCase())
326
- ) : n(r),
327
- queryKey: ["autocomplete", i, r]
328
- });
329
- function Po({
330
- lookup: e = () => N(this, null, function* () {
331
- }),
332
- enableHighlighting: t = !0,
333
- onChange: n,
334
- minLength: i = 0,
335
- label: r,
336
- value: a,
337
- "data-testid": c,
338
- sx: d,
339
- boxSx: l,
340
- textFieldColor: u,
341
- textFieldVariant: v = "filled",
342
- loadingText: C = "Loading...",
343
- noOptionsText: w = "No options",
344
- popupIcon: g = /* @__PURE__ */ o(Zt, {}),
345
- error: D = !1,
346
- helperText: A = "",
347
- preLoadedOptions: k = void 0,
348
- disablePortal: I = !1
349
- }) {
350
- const [T, b] = E(""), y = (h, f) => {
351
- const F = a.filter((m) => m.id !== f);
352
- n(F, "delete", h);
353
- }, { data: L, isLoading: O } = mt({
354
- inputValue: T,
355
- label: r,
356
- lookup: e,
357
- minLength: i,
358
- preLoadedOptions: k
359
- }), W = T.length >= i;
360
- return /* @__PURE__ */ p("div", { "data-testid": c, children: [
361
- /* @__PURE__ */ o(
362
- we,
363
- {
364
- sx: d,
365
- "data-testid": c ? `${c}:Autocomplete` : void 0,
366
- disablePortal: I,
367
- multiple: !0,
368
- getOptionLabel: (h) => typeof h == "string" ? h : h.label,
369
- loading: W ? O : !1,
370
- options: [...a, ...L != null ? L : []],
371
- filterSelectedOptions: !0,
372
- includeInputInList: !0,
373
- value: a,
374
- onChange: (h, f, F) => {
375
- n(f, F, h);
376
- },
377
- onInputChange: (h, f) => b(f),
378
- noOptionsText: W ? w : "Start typing to search",
379
- loadingText: C,
380
- popupIcon: g,
381
- renderInput: (h) => /* @__PURE__ */ o(
382
- Ae,
383
- S(s({}, h), {
384
- label: r,
385
- fullWidth: !0,
386
- variant: v,
387
- error: D,
388
- helperText: A,
389
- InputProps: S(s({}, h.InputProps), {
390
- endAdornment: /* @__PURE__ */ p(M, { children: [
391
- O ? /* @__PURE__ */ o(be, { color: "inherit", size: 20 }) : null,
392
- h.InputProps.endAdornment
393
- ] })
394
- }),
395
- "data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
396
- onKeyDown: (f) => {
397
- (f.key === "Backspace" || f.key === "Delete") && f.stopPropagation();
398
- },
399
- color: u
400
- })
401
- ),
402
- renderTags: () => null,
403
- isOptionEqualToValue: (h, f) => h.id === f.id,
404
- renderOption: (h, f, F) => {
405
- if (t) {
406
- const m = tn(f.label, F.inputValue, {
407
- insideWords: !0,
408
- findAllOccurrences: !0
409
- }), x = nn(f.label, m);
410
- return /* @__PURE__ */ Ce(
411
- "li",
412
- S(s({}, h), {
413
- key: f.id,
414
- "data-testid": c ? `${c}:Autocomplete:option(${f.id.toString()})` : void 0
415
- }),
416
- /* @__PURE__ */ o("div", { children: x.map((_, se) => /* @__PURE__ */ o(
417
- "span",
418
- {
419
- style: {
420
- fontWeight: _.highlight ? 700 : 400
421
- },
422
- children: _.text
423
- },
424
- se
425
- )) })
426
- );
427
- } else
428
- return /* @__PURE__ */ Ce(
429
- "li",
430
- S(s({}, h), {
431
- key: f.id,
432
- "data-testid": c ? `${c}:option(${f.id.toString()})` : void 0
433
- }),
434
- f.label
435
- );
436
- }
437
- }
438
- ),
439
- a.length > 0 && /* @__PURE__ */ o($, { sx: l, children: a.map((h) => /* @__PURE__ */ o(
440
- _t,
441
- {
442
- sx: {
443
- marginTop: 1,
444
- marginRight: 1,
445
- height: "auto"
446
- },
447
- label: /* @__PURE__ */ o(
448
- Mt,
449
- {
450
- title: h.tooltipContent || "",
451
- placement: "bottom-start",
452
- PopperProps: {
453
- modifiers: [
454
- {
455
- name: "offset",
456
- options: {
457
- offset: [115, -15]
458
- }
459
- }
460
- ]
461
- },
462
- children: /* @__PURE__ */ o(P, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
463
- }
464
- ),
465
- "data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
466
- onDelete: (f) => y(f, h.id),
467
- deleteIcon: /* @__PURE__ */ o(
468
- Jt,
469
- {
470
- "data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
471
- }
472
- )
473
- },
474
- h.id
475
- )) })
476
- ] });
477
- }
478
- const No = ({
479
- lookup: e = () => N(void 0, null, function* () {
480
- }),
481
- onChange: t,
482
- label: n,
483
- value: i,
484
- sx: r,
485
- textFieldColor: a,
486
- textFieldVariant: c = "filled",
487
- "data-testid": d,
488
- noOptionsText: l = "No options",
489
- minLength: u = 3,
490
- disablePortal: v = !1,
491
- preLoadedOptions: C,
492
- helperText: w = "",
493
- disabled: g
494
- }) => {
495
- const [D, A] = E(""), { data: k, isLoading: I } = mt({
496
- inputValue: D,
497
- label: n,
498
- lookup: e,
499
- minLength: u != null ? u : 0,
500
- preLoadedOptions: C
501
- }), T = D.length >= u;
502
- return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(Rt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
503
- we,
504
- {
505
- sx: r,
506
- "data-testid": d ? `${d}:Autocomplete` : void 0,
507
- loading: T ? I : !1,
508
- options: k != null ? k : [],
509
- onChange: (b, y) => {
510
- t(b, y);
511
- },
512
- disablePortal: v,
513
- filterOptions: (b) => b,
514
- value: i,
515
- noOptionsText: T ? l : "Start typing to search",
516
- getOptionLabel: (b) => b.label,
517
- renderInput: (b) => /* @__PURE__ */ o(
518
- Ae,
519
- S(s({
520
- "data-testid": d ? `${d}:Autocomplete:TextField` : void 0
521
- }, b), {
522
- variant: c,
523
- label: n,
524
- color: a,
525
- helperText: w
526
- })
527
- ),
528
- isOptionEqualToValue: (b, y) => b.id === y.id,
529
- onInputChange: (b, y) => {
530
- A(y);
531
- },
532
- renderOption: (b, y) => /* @__PURE__ */ Ce(
533
- "li",
534
- S(s({}, b), {
535
- key: y.id,
536
- "data-testid": d ? `${d}:Autocomplete:option(${y.id.toString()})` : void 0
537
- }),
538
- y.label
539
- ),
540
- disabled: g
541
- }
542
- ) }) });
543
- }, xn = (e) => {
544
- if (!e)
545
- return -1;
546
- try {
547
- const n = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
548
- sn.from(n, "base64").toString("utf8").split("").map(function(a) {
549
- return "%" + ("00" + a.charCodeAt(0).toString(16)).slice(-2);
550
- }).join("")
551
- ), r = JSON.parse(i);
552
- return r != null && r.exp ? r.exp : -1;
553
- } catch (t) {
554
- return -1;
555
- }
556
- }, Lo = ({
557
- open: e = !1,
558
- closeHandler: t,
559
- setAuth0ExpiryTime: n
560
- }) => {
561
- const { logout: i, getAccessTokenSilently: r } = ct(), [a, c] = E(0), d = () => N(void 0, null, function* () {
562
- i({ logoutParams: { returnTo: `${window.location.origin}` } });
563
- }), l = () => N(void 0, null, function* () {
564
- c(a + 1), t();
565
- });
566
- return oe(() => {
567
- (() => N(void 0, null, function* () {
568
- if (a > 0) {
569
- const w = yield r({ cacheMode: "off" }), g = xn(w) * 1e3;
570
- n(g);
571
- }
572
- }))();
573
- }, [a, r, n]), /* @__PURE__ */ o(
574
- ft,
575
- {
576
- isOpen: e,
577
- primaryButton: {
578
- text: "Continue",
579
- onClick: l,
580
- disabled: !1,
581
- testId: "PreferencesDialog",
582
- buttonColor: "secondary"
583
- },
584
- secondaryButton: {
585
- text: "Log out",
586
- onClick: d,
587
- disabled: !1,
588
- testId: "PreferencesDialog",
589
- buttonColor: "secondary"
590
- },
591
- onClose: t,
592
- dialogTitle: "Session expiry",
593
- disableCloseOnBackdropOrEscape: !0,
594
- children: /* @__PURE__ */ o("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
595
- }
596
- );
597
- };
598
- function vn(e) {
599
- return "error" in e;
600
- }
601
- function wn(e) {
602
- return e.error === "access_denied";
603
- }
604
- function An(e) {
605
- var i;
606
- const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
607
- return t === "access_denied" && n.startsWith("You do not have the required authorization");
608
- }
609
- function bn(e) {
610
- var i;
611
- const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
612
- return t === "access_denied" && n.startsWith("User did not authorize the request");
613
- }
614
- function _o({
615
- children: e,
616
- appName: t = "the app"
617
- }) {
618
- const { isAuthenticated: n, isLoading: i, error: r, loginWithRedirect: a, logout: c } = ct();
619
- if (oe(() => {
620
- if (i || n || r)
621
- return;
622
- const d = {
623
- appState: {
624
- returnTo: `${window.location.pathname}${window.location.search}`
625
- }
626
- };
627
- a(d);
628
- }, [i, n, r, a]), r && vn(r)) {
629
- let d = "Auth error", l = "An unknown Auth0 error occurred.";
630
- return An(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : bn(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : wn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ p(Je, { open: !0, children: [
631
- /* @__PURE__ */ o(je, { children: d }),
632
- /* @__PURE__ */ o(et, { children: /* @__PURE__ */ o(P, { children: l }) }),
633
- /* @__PURE__ */ o(tt, { children: /* @__PURE__ */ o(ie, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
634
- ] });
635
- }
636
- return n ? /* @__PURE__ */ o(M, { children: e }) : /* @__PURE__ */ o(ln, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
637
- }
638
- const Sn = 24, kn = 64, G = "TopBar", B = {
639
- topStripe: `${G}-topStripe`,
640
- titleBar: `${G}-titleBar`,
641
- titleSlider: `${G}-titleSlider`,
642
- titleText: `${G}-titleText`,
643
- leftPanelButton: `${G}-leftPanelButton`,
644
- rightPanelButton: `${G}-leftPanelButton`
645
- }, Dn = Se("div", {
646
- shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
647
- name: G
648
- })(({ theme: e, leftPanel: t, rightPanel: n }) => {
649
- var i, r;
650
- return {
651
- width: "100%",
652
- [`& .${B.topStripe}`]: {
653
- width: "100%",
654
- height: `${Sn}px`,
655
- backgroundColor: e.palette.primary.main
656
- },
657
- [`& .${B.titleBar}`]: {
658
- backgroundColor: e.palette.primary.light,
659
- height: `${kn}px`,
660
- padding: e.spacing(0, 3),
661
- width: "100%"
662
- },
663
- [`& .${B.titleSlider}`]: s(s({
664
- height: "100%",
665
- display: "flex",
666
- alignItems: "center",
667
- color: "white",
668
- transition: e.transitions.create("margin", {
669
- easing: e.transitions.easing.sharp,
670
- duration: e.transitions.duration.leavingScreen
671
- }),
672
- [`& .${B.leftPanelButton}`]: {
673
- marginRight: e.spacing(2),
674
- flexGrow: 0
675
- },
676
- [`& .${B.titleText}`]: {
677
- flexGrow: 1
678
- },
679
- [`& .${B.rightPanelButton}`]: {
680
- flexGrow: 0
681
- }
682
- }, (t == null ? void 0 : t.open) && {
683
- transition: e.transitions.create("margin", {
684
- easing: e.transitions.easing.easeOut,
685
- duration: e.transitions.duration.enteringScreen
686
- }),
687
- marginLeft: `${(i = t == null ? void 0 : t.width) != null ? i : 0}px`
688
- }), (n == null ? void 0 : n.open) && {
689
- transition: e.transitions.create("margin", {
690
- easing: e.transitions.easing.easeOut,
691
- duration: e.transitions.duration.enteringScreen
692
- }),
693
- marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
694
- })
695
- };
696
- });
697
- function yn({
698
- titleText: e = "",
699
- leftPanel: t,
700
- rightPanel: n,
701
- "data-testid": i
702
- }) {
703
- return /* @__PURE__ */ p(Dn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
704
- /* @__PURE__ */ o("div", { className: B.topStripe }),
705
- /* @__PURE__ */ o("div", { className: B.titleBar, children: /* @__PURE__ */ p($, { className: B.titleSlider, children: [
706
- t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ p(
707
- Y,
708
- {
709
- className: B.leftPanelButton,
710
- color: "inherit",
711
- "aria-label": "Open left side panel",
712
- onClick: t == null ? void 0 : t.onOpen,
713
- edge: "start",
714
- size: "large",
715
- children: [
716
- " ",
717
- /* @__PURE__ */ o(rt, {})
718
- ]
719
- }
720
- ),
721
- /* @__PURE__ */ o(P, { className: B.titleText, variant: "h6", noWrap: !0, children: e }),
722
- n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ p(
723
- Y,
724
- {
725
- className: B.rightPanelButton,
726
- color: "inherit",
727
- "aria-label": "Open right side panel",
728
- onClick: n == null ? void 0 : n.onOpen,
729
- edge: "end",
730
- size: "large",
731
- children: [
732
- " ",
733
- /* @__PURE__ */ o(at, {})
734
- ]
735
- }
736
- )
737
- ] }) })
738
- ] });
739
- }
740
- const Ct = 400, $n = Se(ve, {
741
- shouldForwardProp: (e) => (
742
- // Note we do want anchor to be forwarded to the Drawer component
743
- ![
744
- "width",
745
- "debug",
746
- "debugOpacity",
747
- "navBarOpen",
748
- "navBarWidthOpen",
749
- "navBarWidthClosed"
750
- ].includes(e)
751
- ),
752
- name: "SidePanelDrawer"
753
- })(
754
- ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: i, navBarWidthOpen: r, navBarWidthClosed: a }) => ({
755
- width: e,
756
- "& .MuiDrawer-paper": s(s({
757
- position: "absolute",
758
- width: e,
759
- boxSizing: "border-box",
760
- border: "unset",
761
- boxShadow: "0px 4px 5px rgba(0, 0, 0, 0.14), 0px 1px 10px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2)"
762
- }, t && {
763
- opacity: "50%"
764
- }), n === "left" && s({
765
- marginLeft: `${a}px`
766
- }, i && {
767
- marginLeft: `${r}px`
768
- }))
769
- })
770
- ), In = Se($, {
771
- shouldForwardProp: (e) => !["anchor"].includes(e)
772
- })(({ theme: e, anchor: t }) => S(s({
773
- display: "flex",
774
- alignItems: "center",
775
- padding: e.spacing(2)
776
- }, e.mixins.toolbar), {
777
- justifyContent: t === "left" ? "space-between" : "flex-start",
778
- backgroundColor: e.palette.primary.light,
779
- height: "88px",
780
- "&,*": {
781
- color: "white"
782
- },
783
- " .MuiTypography-root": {
784
- fontSize: "22px"
785
- },
786
- " .MuiButtonBase-root": {
787
- marginRight: t === "right" ? e.spacing(2) : 0
788
- }
789
- }));
790
- function Re({
791
- children: e,
792
- anchor: t = "left",
793
- open: n,
794
- onClose: i = () => {
795
- },
796
- titleText: r = "",
797
- width: a = Ct,
798
- showCloseArrow: c = !0,
799
- debugOpacity: d = !1,
800
- headerBoxProps: l = {},
801
- onOpened: u,
802
- onClosed: v,
803
- "data-testid": C,
804
- navBarOpen: w = !1,
805
- navBarWidthOpen: g = 0,
806
- navBarWidthClosed: D = 0
807
- }) {
808
- return /* @__PURE__ */ p(
809
- $n,
810
- {
811
- SlideProps: {
812
- onEntered: () => u == null ? void 0 : u(),
813
- onExited: () => v == null ? void 0 : v()
814
- },
815
- variant: "persistent",
816
- anchor: t,
817
- open: n,
818
- width: a,
819
- debugOpacity: d,
820
- "data-testid": C,
821
- navBarOpen: w,
822
- navBarWidthOpen: g,
823
- navBarWidthClosed: D,
824
- children: [
825
- /* @__PURE__ */ o(In, S(s({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ p(M, { children: [
826
- /* @__PURE__ */ o(P, { variant: "h6", color: "inherit", component: "div", children: r }),
827
- c && /* @__PURE__ */ p(Y, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
828
- /* @__PURE__ */ o(at, { "data-testid": "arrowbackicon" }),
829
- " "
830
- ] })
831
- ] }) : /* @__PURE__ */ p(M, { children: [
832
- c && /* @__PURE__ */ p(Y, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
833
- /* @__PURE__ */ o(rt, {}),
834
- " "
835
- ] }),
836
- /* @__PURE__ */ o(P, { variant: "h6", color: "inherit", component: "div", children: r })
837
- ] }) })),
838
- e
445
+ /* @__PURE__ */ o(Sn, S(s({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ p(M, { children: [
446
+ /* @__PURE__ */ o(P, { variant: "h6", color: "inherit", component: "div", children: r }),
447
+ c && /* @__PURE__ */ p(Y, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
448
+ /* @__PURE__ */ o(at, { "data-testid": "arrowbackicon" }),
449
+ " "
450
+ ] })
451
+ ] }) : /* @__PURE__ */ p(M, { children: [
452
+ c && /* @__PURE__ */ p(Y, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
453
+ /* @__PURE__ */ o(rt, {}),
454
+ " "
455
+ ] }),
456
+ /* @__PURE__ */ o(P, { variant: "h6", color: "inherit", component: "div", children: r })
457
+ ] }) })),
458
+ e
839
459
  ]
840
460
  }
841
461
  );
842
462
  }
843
- const Tn = H($, {
463
+ const kn = H($, {
844
464
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
845
465
  name: "PanelAwareMargins"
846
466
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -863,7 +483,7 @@ const Tn = H($, {
863
483
  }),
864
484
  marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
865
485
  });
866
- }), On = H(nt, {
486
+ }), Dn = H(Je, {
867
487
  name: "PageContainer"
868
488
  })(({ theme: e }) => ({
869
489
  // Horizontal padding comes from the Container's gutter
@@ -873,7 +493,7 @@ const Tn = H($, {
873
493
  })), fe = !1, me = !1, ee = {
874
494
  titleText: "",
875
495
  flavour: "push",
876
- width: Ct,
496
+ width: ft,
877
497
  arrowButtons: "both",
878
498
  startOpen: !1,
879
499
  open: void 0,
@@ -883,7 +503,7 @@ const Tn = H($, {
883
503
  onClosed: void 0,
884
504
  dataTestId: void 0
885
505
  };
886
- function Mo({
506
+ function Fo({
887
507
  children: e,
888
508
  titleText: t = "",
889
509
  leftPanel: n,
@@ -972,7 +592,7 @@ function Mo({
972
592
  }
973
593
  ),
974
594
  /* @__PURE__ */ o(
975
- yn,
595
+ An,
976
596
  s(s({
977
597
  titleText: t,
978
598
  "data-testid": l
@@ -993,7 +613,7 @@ function Mo({
993
613
  } : {})
994
614
  ),
995
615
  /* @__PURE__ */ o(
996
- Tn,
616
+ kn,
997
617
  S(s(s({}, h === "push" ? {
998
618
  leftPanel: {
999
619
  open: de,
@@ -1005,16 +625,16 @@ function Mo({
1005
625
  width: ce
1006
626
  }
1007
627
  } : {}), {
1008
- children: /* @__PURE__ */ o(On, S(s({ "data-testid": d }, c), { children: e }))
628
+ children: /* @__PURE__ */ o(Dn, S(s({ "data-testid": d }, c), { children: e }))
1009
629
  })
1010
630
  )
1011
631
  ] });
1012
632
  }
1013
- const xt = () => {
633
+ const mt = () => {
1014
634
  const e = ae();
1015
- return Ht(e.breakpoints.down("sm"));
1016
- }, Bn = 64, En = 72, Fn = 256, K = R(!0), vt = R(Fn), wt = R(En), xe = R(""), Pn = R(void 0), At = R(Bn), bt = R(void 0);
1017
- function Nn({ links: e }) {
635
+ return _t(e.breakpoints.down("sm"));
636
+ }, yn = 64, $n = 72, In = 256, K = R(!0), Ct = R(In), xt = R($n), xe = R(""), Tn = R(void 0), vt = R(yn), wt = R(void 0);
637
+ function On({ links: e }) {
1018
638
  return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
1019
639
  }
1020
640
  const te = "Navbar", Q = {
@@ -1025,7 +645,7 @@ const te = "Navbar", Q = {
1025
645
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
1026
646
  // settings: `${PREFIX}-settings`,
1027
647
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
1028
- }, Ln = H($, { name: "NavBar" })(({ theme: e }) => ({
648
+ }, Bn = H($, { name: "NavBar" })(({ theme: e }) => ({
1029
649
  [`&.${Q.root}`]: {
1030
650
  display: "flex"
1031
651
  },
@@ -1047,10 +667,10 @@ const te = "Navbar", Q = {
1047
667
  })), re = (e, t, n) => e.transitions.create(t, {
1048
668
  easing: e.transitions.easing.sharp,
1049
669
  duration: n === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
1050
- }), _n = (e) => {
670
+ }), En = (e) => {
1051
671
  const t = ae();
1052
672
  return /* @__PURE__ */ o(
1053
- Wt,
673
+ Mt,
1054
674
  s({
1055
675
  easing: t.transitions.easing.sharp,
1056
676
  timeout: {
@@ -1059,7 +679,7 @@ const te = "Navbar", Q = {
1059
679
  }
1060
680
  }, e)
1061
681
  );
1062
- }, St = (e) => {
682
+ }, At = (e) => {
1063
683
  var t, n;
1064
684
  return {
1065
685
  overflowX: "hidden",
@@ -1070,10 +690,10 @@ const te = "Navbar", Q = {
1070
690
  }, He = (e, t) => s({
1071
691
  width: t,
1072
692
  transition: re(e, "width", "entering")
1073
- }, St(e)), We = (e, t) => s({
693
+ }, At(e)), We = (e, t) => s({
1074
694
  width: t,
1075
695
  transition: re(e, "width", "leaving")
1076
- }, St(e)), Mn = H(ve, {
696
+ }, At(e)), Fn = H(ve, {
1077
697
  shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
1078
698
  })(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => s(s({
1079
699
  flexShrink: 0,
@@ -1088,7 +708,7 @@ const te = "Navbar", Q = {
1088
708
  backgroundColor: "",
1089
709
  "& .MuiDrawer-paper": We(e, r ? n : i)
1090
710
  })));
1091
- function Rn(e) {
711
+ function Pn(e) {
1092
712
  let t = 0;
1093
713
  for (let n = 0, i = e.length; n < i; n++) {
1094
714
  const r = e.charCodeAt(n);
@@ -1096,222 +716,601 @@ function Rn(e) {
1096
716
  }
1097
717
  return t;
1098
718
  }
1099
- const ze = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Hn = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
1100
- function Wn({ user: e, domainCode: t, open: n }) {
1101
- const i = ae();
719
+ const ze = ["#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();
720
+ function Ln({ user: e, domainCode: t, open: n }) {
721
+ const i = ae();
722
+ return /* @__PURE__ */ p(
723
+ $,
724
+ {
725
+ sx: {
726
+ paddingTop: 3,
727
+ display: "flex",
728
+ alignItems: "center",
729
+ flexDirection: "column",
730
+ gap: "0.5rem"
731
+ },
732
+ children: [
733
+ /* @__PURE__ */ o(
734
+ $,
735
+ {
736
+ sx: {
737
+ width: n ? "5rem" : "2rem",
738
+ transition: n ? re(i, ["width", "height"], "entering") : re(i, ["width", "height"], "leaving"),
739
+ aspectRatio: 1
740
+ },
741
+ children: e != null && e.name ? /* @__PURE__ */ o(
742
+ Fe,
743
+ {
744
+ src: e == null ? void 0 : e.picture,
745
+ sx: {
746
+ width: "100%",
747
+ height: "100%",
748
+ bgcolor: ze[Math.abs(Pn(e.name)) % ze.length]
749
+ },
750
+ children: Nn(e.name)
751
+ }
752
+ ) : /* @__PURE__ */ o(Fe, { sx: { width: "100%", height: "100%" } })
753
+ }
754
+ ),
755
+ /* @__PURE__ */ o(En, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Rt, { in: n, children: /* @__PURE__ */ p($, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
756
+ e != null && e.name ? /* @__PURE__ */ o(P, { children: e.name }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "50%" }),
757
+ t ? /* @__PURE__ */ o(P, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "25%" })
758
+ ] }) }) })
759
+ ]
760
+ }
761
+ );
762
+ }
763
+ function _n({
764
+ open: e,
765
+ widthClosed: t,
766
+ widthOpen: n,
767
+ "data-testid": i,
768
+ top: r,
769
+ middle: a,
770
+ bottom: c,
771
+ user: d,
772
+ domainCode: l
773
+ }) {
774
+ const u = mt(), v = st(K);
775
+ return /* @__PURE__ */ o(Bn, { className: Q.root, "data-testid": i, children: /* @__PURE__ */ p(
776
+ Fn,
777
+ {
778
+ open: e,
779
+ widthOpen: n,
780
+ widthClosed: t,
781
+ anchor: "left",
782
+ variant: u ? "temporary" : "permanent",
783
+ PaperProps: {
784
+ component: "nav"
785
+ },
786
+ onClose: () => {
787
+ v(!1);
788
+ },
789
+ isSmallScreen: u,
790
+ children: [
791
+ !u && /* @__PURE__ */ o(Ht, {}),
792
+ r && /* @__PURE__ */ p($, { flexGrow: "0", children: [
793
+ r,
794
+ /* @__PURE__ */ o(Ne, { variant: "middle", sx: { marginY: "0.5rem" } })
795
+ ] }),
796
+ /* @__PURE__ */ o($, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ o(On, { links: a }) : a }),
797
+ /* @__PURE__ */ p($, { flexGrow: "0", children: [
798
+ /* @__PURE__ */ o(Ne, { variant: "middle", sx: { marginY: "0.5rem" } }),
799
+ /* @__PURE__ */ o(Ln, { user: d, domainCode: l, open: e }),
800
+ c && /* @__PURE__ */ o(M, { children: c })
801
+ ] })
802
+ ]
803
+ }
804
+ ) });
805
+ }
806
+ function Mn({
807
+ children: e,
808
+ topBarHeight: t,
809
+ maxWidth: n = !1,
810
+ noPadding: i
811
+ }) {
812
+ return /* @__PURE__ */ o(
813
+ $,
814
+ {
815
+ sx: {
816
+ overflow: "auto",
817
+ height: `calc(100vh - ${t}px)`,
818
+ scrollbarGutter: "stable",
819
+ // scrollbarGutter: 'stable both-edges',
820
+ flexGrow: 1
821
+ },
822
+ children: i ? /* @__PURE__ */ o($, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ o(
823
+ Je,
824
+ {
825
+ component: "main",
826
+ id: "main-content",
827
+ maxWidth: n,
828
+ sx: { paddingTop: 3, paddingBottom: 3, flexGrow: 1 },
829
+ children: e
830
+ }
831
+ )
832
+ }
833
+ );
834
+ }
835
+ const Rn = "TopBar", Hn = {
836
+ titleText: `${Rn}-titleText`
837
+ };
838
+ function Wn({
839
+ titleText: e = "",
840
+ height: t,
841
+ "data-testid": n,
842
+ middle: i
843
+ }) {
844
+ const r = st(K), a = () => r((l) => !l), c = ae(), d = mt();
845
+ return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ p(
846
+ Ke,
847
+ {
848
+ square: !0,
849
+ elevation: 0,
850
+ sx: {
851
+ width: "100%",
852
+ position: "sticky",
853
+ color: "primary.contrastText",
854
+ backgroundColor: "primary.main",
855
+ display: "flex",
856
+ alignItems: "center",
857
+ gap: 2,
858
+ flexShrink: 0,
859
+ height: t,
860
+ zIndex: d ? 0 : c.zIndex.drawer + 1
861
+ },
862
+ children: [
863
+ /* @__PURE__ */ o(
864
+ Y,
865
+ {
866
+ size: "medium",
867
+ color: "inherit",
868
+ sx: { padding: 1.5, marginLeft: "12px" },
869
+ onClick: a,
870
+ children: /* @__PURE__ */ o(Jt, { fontSize: "medium" })
871
+ }
872
+ ),
873
+ /* @__PURE__ */ o(P, { className: Hn.titleText, variant: "h6", children: e }),
874
+ i
875
+ ]
876
+ }
877
+ ) });
878
+ }
879
+ function Po({
880
+ children: e,
881
+ initialTitleText: t,
882
+ initialNavBarOpen: n,
883
+ pageContainerProps: i,
884
+ pageContentDataTestId: r,
885
+ topBarDataTestId: a,
886
+ navBarDataTestId: c,
887
+ navBarMiddle: d,
888
+ navBarBottom: l,
889
+ user: u,
890
+ domainCode: v
891
+ }) {
892
+ ct([
893
+ [K, n != null ? n : !0],
894
+ [xe, t != null ? t : ""]
895
+ ]);
896
+ const C = Le(K), [w] = V(Ct), [g] = V(xt), D = Le(xe), [A] = V(vt), [k] = V(Tn), [I] = V(wt);
897
+ return /* @__PURE__ */ p($, { children: [
898
+ /* @__PURE__ */ o(Wt, {}),
899
+ /* @__PURE__ */ o(
900
+ Wn,
901
+ {
902
+ titleText: D,
903
+ "data-testid": a,
904
+ height: A,
905
+ middle: k
906
+ }
907
+ ),
908
+ /* @__PURE__ */ p($, { sx: { display: "flex" }, children: [
909
+ /* @__PURE__ */ o(
910
+ _n,
911
+ {
912
+ open: C,
913
+ top: I,
914
+ middle: d,
915
+ bottom: l,
916
+ user: u,
917
+ domainCode: v,
918
+ widthOpen: w,
919
+ widthClosed: g,
920
+ offsetTop: A,
921
+ "data-testid": c
922
+ }
923
+ ),
924
+ /* @__PURE__ */ o(
925
+ Mn,
926
+ S(s({
927
+ "data-testid": r,
928
+ topBarHeight: A
929
+ }, i), {
930
+ children: e
931
+ })
932
+ )
933
+ ] })
934
+ ] });
935
+ }
936
+ const bt = ({
937
+ isOpen: e,
938
+ dialogTitle: t,
939
+ children: n,
940
+ maxWidth: i,
941
+ primaryButton: r,
942
+ secondaryButton: a,
943
+ onClose: c,
944
+ sx: d,
945
+ "data-testid": l,
946
+ disableCloseOnBackdropOrEscape: u = !1,
947
+ isLoading: v = !1
948
+ }) => {
949
+ var g, D;
950
+ const [C, w] = E(!1);
1102
951
  return /* @__PURE__ */ p(
1103
- $,
952
+ Ze,
1104
953
  {
1105
- sx: {
1106
- paddingTop: 3,
1107
- display: "flex",
1108
- alignItems: "center",
1109
- flexDirection: "column",
1110
- gap: "0.5rem"
1111
- },
954
+ open: e,
955
+ onClose: (A, k) => N(void 0, null, function* () {
956
+ u && (k === "backdropClick" || k === "escapeKeyDown") || C || (a != null && a.onClick ? yield a.onClick() : c());
957
+ }),
958
+ fullWidth: !0,
959
+ maxWidth: i != null ? i : "xs",
960
+ "data-testid": l,
961
+ sx: d,
1112
962
  children: [
1113
- /* @__PURE__ */ o(
1114
- $,
1115
- {
1116
- sx: {
1117
- width: n ? "5rem" : "2rem",
1118
- transition: n ? re(i, ["width", "height"], "entering") : re(i, ["width", "height"], "leaving"),
1119
- aspectRatio: 1
1120
- },
1121
- children: e != null && e.name ? /* @__PURE__ */ o(
1122
- Fe,
1123
- {
1124
- src: e == null ? void 0 : e.picture,
1125
- sx: {
1126
- width: "100%",
1127
- height: "100%",
1128
- bgcolor: ze[Math.abs(Rn(e.name)) % ze.length]
1129
- },
1130
- children: Hn(e.name)
1131
- }
1132
- ) : /* @__PURE__ */ o(Fe, { sx: { width: "100%", height: "100%" } })
1133
- }
1134
- ),
1135
- /* @__PURE__ */ o(_n, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(zt, { in: n, children: /* @__PURE__ */ p($, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
1136
- e != null && e.name ? /* @__PURE__ */ o(P, { children: e.name }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "50%" }),
1137
- t ? /* @__PURE__ */ o(P, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "25%" })
1138
- ] }) }) })
963
+ v && /* @__PURE__ */ o(je, { sx: { height: "4px", marginBottom: "-4px" } }),
964
+ /* @__PURE__ */ o(et, { children: t }),
965
+ /* @__PURE__ */ o(tt, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
966
+ /* @__PURE__ */ p(nt, { children: [
967
+ /* @__PURE__ */ o(
968
+ ie,
969
+ {
970
+ onClick: (g = a == null ? void 0 : a.onClick) != null ? g : c,
971
+ "data-testid": a == null ? void 0 : a.testId,
972
+ disabled: (a == null ? void 0 : a.disabled) || C,
973
+ color: a == null ? void 0 : a.buttonColor,
974
+ children: (D = a == null ? void 0 : a.text) != null ? D : "Cancel"
975
+ }
976
+ ),
977
+ r && /* @__PURE__ */ o(
978
+ ie,
979
+ {
980
+ onClick: () => N(void 0, null, function* () {
981
+ var A;
982
+ w(!0), yield (A = r.onClick) == null ? void 0 : A.call(r), w(!1);
983
+ }),
984
+ "data-testid": r.testId,
985
+ disabled: r.disabled || C,
986
+ color: r == null ? void 0 : r.buttonColor,
987
+ children: r.text
988
+ }
989
+ )
990
+ ] })
1139
991
  ]
1140
992
  }
1141
993
  );
1142
- }
1143
- function zn({
1144
- open: e,
1145
- widthClosed: t,
1146
- widthOpen: n,
1147
- "data-testid": i,
1148
- top: r,
1149
- middle: a,
1150
- bottom: c,
1151
- user: d,
1152
- domainCode: l
994
+ }, St = ({
995
+ minLength: e,
996
+ preLoadedOptions: t,
997
+ lookup: n,
998
+ label: i,
999
+ inputValue: r
1000
+ }) => on({
1001
+ queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
1002
+ (a) => a.label.toLowerCase().includes(r.toLowerCase())
1003
+ ) : n(r),
1004
+ queryKey: ["autocomplete", i, r]
1005
+ });
1006
+ function No({
1007
+ lookup: e = () => N(this, null, function* () {
1008
+ }),
1009
+ enableHighlighting: t = !0,
1010
+ onChange: n,
1011
+ minLength: i = 0,
1012
+ label: r,
1013
+ value: a,
1014
+ "data-testid": c,
1015
+ sx: d,
1016
+ boxSx: l,
1017
+ textFieldColor: u,
1018
+ textFieldVariant: v = "filled",
1019
+ loadingText: C = "Loading...",
1020
+ noOptionsText: w = "No options",
1021
+ popupIcon: g = /* @__PURE__ */ o(jt, {}),
1022
+ error: D = !1,
1023
+ helperText: A = "",
1024
+ preLoadedOptions: k = void 0,
1025
+ disablePortal: I = !1
1153
1026
  }) {
1154
- const u = xt(), v = st(K);
1155
- return /* @__PURE__ */ o(Ln, { className: Q.root, "data-testid": i, children: /* @__PURE__ */ p(
1156
- Mn,
1027
+ const [T, b] = E(""), y = (h, f) => {
1028
+ const F = a.filter((m) => m.id !== f);
1029
+ n(F, "delete", h);
1030
+ }, { data: L, isLoading: O } = St({
1031
+ inputValue: T,
1032
+ label: r,
1033
+ lookup: e,
1034
+ minLength: i,
1035
+ preLoadedOptions: k
1036
+ }), W = T.length >= i;
1037
+ return /* @__PURE__ */ p("div", { "data-testid": c, children: [
1038
+ /* @__PURE__ */ o(
1039
+ Ae,
1040
+ {
1041
+ sx: d,
1042
+ "data-testid": c ? `${c}:Autocomplete` : void 0,
1043
+ disablePortal: I,
1044
+ multiple: !0,
1045
+ getOptionLabel: (h) => typeof h == "string" ? h : h.label,
1046
+ loading: W ? O : !1,
1047
+ options: [...a, ...L != null ? L : []],
1048
+ filterSelectedOptions: !0,
1049
+ includeInputInList: !0,
1050
+ value: a,
1051
+ onChange: (h, f, F) => {
1052
+ n(f, F, h);
1053
+ },
1054
+ onInputChange: (h, f) => b(f),
1055
+ noOptionsText: W ? w : "Start typing to search",
1056
+ loadingText: C,
1057
+ popupIcon: g,
1058
+ renderInput: (h) => /* @__PURE__ */ o(
1059
+ be,
1060
+ S(s({}, h), {
1061
+ label: r,
1062
+ fullWidth: !0,
1063
+ variant: v,
1064
+ error: D,
1065
+ helperText: A,
1066
+ InputProps: S(s({}, h.InputProps), {
1067
+ endAdornment: /* @__PURE__ */ p(M, { children: [
1068
+ O ? /* @__PURE__ */ o(Se, { color: "inherit", size: 20 }) : null,
1069
+ h.InputProps.endAdornment
1070
+ ] })
1071
+ }),
1072
+ "data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
1073
+ onKeyDown: (f) => {
1074
+ (f.key === "Backspace" || f.key === "Delete") && f.stopPropagation();
1075
+ },
1076
+ color: u
1077
+ })
1078
+ ),
1079
+ renderTags: () => null,
1080
+ isOptionEqualToValue: (h, f) => h.id === f.id,
1081
+ renderOption: (h, f, F) => {
1082
+ if (t) {
1083
+ const m = tn(f.label, F.inputValue, {
1084
+ insideWords: !0,
1085
+ findAllOccurrences: !0
1086
+ }), x = nn(f.label, m);
1087
+ return /* @__PURE__ */ Ce(
1088
+ "li",
1089
+ S(s({}, h), {
1090
+ key: f.id,
1091
+ "data-testid": c ? `${c}:Autocomplete:option(${f.id.toString()})` : void 0
1092
+ }),
1093
+ /* @__PURE__ */ o("div", { children: x.map((_, se) => /* @__PURE__ */ o(
1094
+ "span",
1095
+ {
1096
+ style: {
1097
+ fontWeight: _.highlight ? 700 : 400
1098
+ },
1099
+ children: _.text
1100
+ },
1101
+ se
1102
+ )) })
1103
+ );
1104
+ } else
1105
+ return /* @__PURE__ */ Ce(
1106
+ "li",
1107
+ S(s({}, h), {
1108
+ key: f.id,
1109
+ "data-testid": c ? `${c}:option(${f.id.toString()})` : void 0
1110
+ }),
1111
+ f.label
1112
+ );
1113
+ }
1114
+ }
1115
+ ),
1116
+ a.length > 0 && /* @__PURE__ */ o($, { sx: l, children: a.map((h) => /* @__PURE__ */ o(
1117
+ zt,
1118
+ {
1119
+ sx: {
1120
+ marginTop: 1,
1121
+ marginRight: 1,
1122
+ height: "auto"
1123
+ },
1124
+ label: /* @__PURE__ */ o(
1125
+ Ut,
1126
+ {
1127
+ title: h.tooltipContent || "",
1128
+ placement: "bottom-start",
1129
+ PopperProps: {
1130
+ modifiers: [
1131
+ {
1132
+ name: "offset",
1133
+ options: {
1134
+ offset: [115, -15]
1135
+ }
1136
+ }
1137
+ ]
1138
+ },
1139
+ children: /* @__PURE__ */ o(P, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
1140
+ }
1141
+ ),
1142
+ "data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
1143
+ onDelete: (f) => y(f, h.id),
1144
+ deleteIcon: /* @__PURE__ */ o(
1145
+ Zt,
1146
+ {
1147
+ "data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
1148
+ }
1149
+ )
1150
+ },
1151
+ h.id
1152
+ )) })
1153
+ ] });
1154
+ }
1155
+ const Lo = ({
1156
+ lookup: e = () => N(void 0, null, function* () {
1157
+ }),
1158
+ onChange: t,
1159
+ label: n,
1160
+ value: i,
1161
+ sx: r,
1162
+ textFieldColor: a,
1163
+ textFieldVariant: c = "filled",
1164
+ "data-testid": d,
1165
+ noOptionsText: l = "No options",
1166
+ minLength: u = 3,
1167
+ disablePortal: v = !1,
1168
+ preLoadedOptions: C,
1169
+ helperText: w = "",
1170
+ disabled: g
1171
+ }) => {
1172
+ const [D, A] = E(""), { data: k, isLoading: I } = St({
1173
+ inputValue: D,
1174
+ label: n,
1175
+ lookup: e,
1176
+ minLength: u != null ? u : 0,
1177
+ preLoadedOptions: C
1178
+ }), T = D.length >= u;
1179
+ return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(Gt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
1180
+ Ae,
1157
1181
  {
1158
- open: e,
1159
- widthOpen: n,
1160
- widthClosed: t,
1161
- anchor: "left",
1162
- variant: u ? "temporary" : "permanent",
1163
- PaperProps: {
1164
- component: "nav"
1182
+ sx: r,
1183
+ "data-testid": d ? `${d}:Autocomplete` : void 0,
1184
+ loading: T ? I : !1,
1185
+ options: k != null ? k : [],
1186
+ onChange: (b, y) => {
1187
+ t(b, y);
1165
1188
  },
1166
- onClose: () => {
1167
- v(!1);
1189
+ disablePortal: v,
1190
+ filterOptions: (b) => b,
1191
+ value: i,
1192
+ noOptionsText: T ? l : "Start typing to search",
1193
+ getOptionLabel: (b) => b.label,
1194
+ renderInput: (b) => /* @__PURE__ */ o(
1195
+ be,
1196
+ S(s({
1197
+ "data-testid": d ? `${d}:Autocomplete:TextField` : void 0
1198
+ }, b), {
1199
+ variant: c,
1200
+ label: n,
1201
+ color: a,
1202
+ helperText: w
1203
+ })
1204
+ ),
1205
+ isOptionEqualToValue: (b, y) => b.id === y.id,
1206
+ onInputChange: (b, y) => {
1207
+ A(y);
1168
1208
  },
1169
- isSmallScreen: u,
1170
- children: [
1171
- !u && /* @__PURE__ */ o(Ut, {}),
1172
- r && /* @__PURE__ */ p($, { flexGrow: "0", children: [
1173
- r,
1174
- /* @__PURE__ */ o(Ne, { variant: "middle", sx: { marginY: "0.5rem" } })
1175
- ] }),
1176
- /* @__PURE__ */ o($, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ o(Nn, { links: a }) : a }),
1177
- /* @__PURE__ */ p($, { flexGrow: "0", children: [
1178
- /* @__PURE__ */ o(Ne, { variant: "middle", sx: { marginY: "0.5rem" } }),
1179
- /* @__PURE__ */ o(Wn, { user: d, domainCode: l, open: e }),
1180
- c && /* @__PURE__ */ o(M, { children: c })
1181
- ] })
1182
- ]
1209
+ renderOption: (b, y) => /* @__PURE__ */ Ce(
1210
+ "li",
1211
+ S(s({}, b), {
1212
+ key: y.id,
1213
+ "data-testid": d ? `${d}:Autocomplete:option(${y.id.toString()})` : void 0
1214
+ }),
1215
+ y.label
1216
+ ),
1217
+ disabled: g
1183
1218
  }
1184
- ) });
1185
- }
1186
- function Un({
1187
- children: e,
1188
- topBarHeight: t,
1189
- maxWidth: n = !1,
1190
- noPadding: i
1191
- }) {
1192
- return /* @__PURE__ */ o(
1193
- $,
1219
+ ) }) });
1220
+ }, zn = (e) => {
1221
+ if (!e)
1222
+ return -1;
1223
+ try {
1224
+ const n = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
1225
+ sn.from(n, "base64").toString("utf8").split("").map(function(a) {
1226
+ return "%" + ("00" + a.charCodeAt(0).toString(16)).slice(-2);
1227
+ }).join("")
1228
+ ), r = JSON.parse(i);
1229
+ return r != null && r.exp ? r.exp : -1;
1230
+ } catch (t) {
1231
+ return -1;
1232
+ }
1233
+ }, _o = ({
1234
+ open: e = !1,
1235
+ closeHandler: t,
1236
+ setAuth0ExpiryTime: n
1237
+ }) => {
1238
+ const { logout: i, getAccessTokenSilently: r } = dt(), [a, c] = E(0), d = () => N(void 0, null, function* () {
1239
+ i({ logoutParams: { returnTo: `${window.location.origin}` } });
1240
+ }), l = () => N(void 0, null, function* () {
1241
+ c(a + 1), t();
1242
+ });
1243
+ return oe(() => {
1244
+ (() => N(void 0, null, function* () {
1245
+ if (a > 0) {
1246
+ const w = yield r({ cacheMode: "off" }), g = zn(w) * 1e3;
1247
+ n(g);
1248
+ }
1249
+ }))();
1250
+ }, [a, r, n]), /* @__PURE__ */ o(
1251
+ bt,
1194
1252
  {
1195
- sx: {
1196
- overflow: "auto",
1197
- height: `calc(100vh - ${t}px)`,
1198
- scrollbarGutter: "stable",
1199
- // scrollbarGutter: 'stable both-edges',
1200
- flexGrow: 1
1253
+ isOpen: e,
1254
+ primaryButton: {
1255
+ text: "Continue",
1256
+ onClick: l,
1257
+ disabled: !1,
1258
+ testId: "PreferencesDialog",
1259
+ buttonColor: "secondary"
1201
1260
  },
1202
- children: i ? /* @__PURE__ */ o($, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ o(
1203
- nt,
1204
- {
1205
- component: "main",
1206
- id: "main-content",
1207
- maxWidth: n,
1208
- sx: { paddingTop: 3, paddingBottom: 3, flexGrow: 1 },
1209
- children: e
1210
- }
1211
- )
1261
+ secondaryButton: {
1262
+ text: "Log out",
1263
+ onClick: d,
1264
+ disabled: !1,
1265
+ testId: "PreferencesDialog",
1266
+ buttonColor: "secondary"
1267
+ },
1268
+ onClose: t,
1269
+ dialogTitle: "Session expiry",
1270
+ disableCloseOnBackdropOrEscape: !0,
1271
+ children: /* @__PURE__ */ o("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
1212
1272
  }
1213
1273
  );
1214
- }
1215
- const Gn = "TopBar", Vn = {
1216
- titleText: `${Gn}-titleText`
1217
1274
  };
1218
- function qn({
1219
- titleText: e = "",
1220
- height: t,
1221
- "data-testid": n,
1222
- middle: i
1223
- }) {
1224
- const r = st(K), a = () => r((l) => !l), c = ae(), d = xt();
1225
- return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ p(
1226
- Ke,
1227
- {
1228
- square: !0,
1229
- elevation: 0,
1230
- sx: {
1231
- width: "100%",
1232
- position: "sticky",
1233
- color: "primary.contrastText",
1234
- backgroundColor: "primary.main",
1235
- display: "flex",
1236
- alignItems: "center",
1237
- gap: 2,
1238
- flexShrink: 0,
1239
- height: t,
1240
- zIndex: d ? 0 : c.zIndex.drawer + 1
1241
- },
1242
- children: [
1243
- /* @__PURE__ */ o(
1244
- Y,
1245
- {
1246
- size: "medium",
1247
- color: "inherit",
1248
- sx: { padding: 1.5, marginLeft: "12px" },
1249
- onClick: a,
1250
- children: /* @__PURE__ */ o(jt, { fontSize: "medium" })
1251
- }
1252
- ),
1253
- /* @__PURE__ */ o(P, { className: Vn.titleText, variant: "h6", children: e }),
1254
- i
1255
- ]
1256
- }
1257
- ) });
1275
+ function Un(e) {
1276
+ return "error" in e;
1277
+ }
1278
+ function Gn(e) {
1279
+ return e.error === "access_denied";
1280
+ }
1281
+ function Vn(e) {
1282
+ var i;
1283
+ const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
1284
+ return t === "access_denied" && n.startsWith("You do not have the required authorization");
1285
+ }
1286
+ function qn(e) {
1287
+ var i;
1288
+ const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
1289
+ return t === "access_denied" && n.startsWith("User did not authorize the request");
1258
1290
  }
1259
- function Ro({
1291
+ function Mo({
1260
1292
  children: e,
1261
- initialTitleText: t,
1262
- initialNavBarOpen: n,
1263
- pageContainerProps: i,
1264
- pageContentDataTestId: r,
1265
- topBarDataTestId: a,
1266
- navBarDataTestId: c,
1267
- navBarMiddle: d,
1268
- navBarBottom: l,
1269
- user: u,
1270
- domainCode: v
1293
+ appName: t = "the app"
1271
1294
  }) {
1272
- dt([
1273
- [K, n != null ? n : !0],
1274
- [xe, t != null ? t : ""]
1275
- ]);
1276
- const C = Le(K), [w] = V(vt), [g] = V(wt), D = Le(xe), [A] = V(At), [k] = V(Pn), [I] = V(bt);
1277
- return /* @__PURE__ */ p($, { children: [
1278
- /* @__PURE__ */ o(Gt, {}),
1279
- /* @__PURE__ */ o(
1280
- qn,
1281
- {
1282
- titleText: D,
1283
- "data-testid": a,
1284
- height: A,
1285
- middle: k
1295
+ const { isAuthenticated: n, isLoading: i, error: r, loginWithRedirect: a, logout: c } = dt();
1296
+ if (oe(() => {
1297
+ if (i || n || r)
1298
+ return;
1299
+ const d = {
1300
+ appState: {
1301
+ returnTo: `${window.location.pathname}${window.location.search}`
1286
1302
  }
1287
- ),
1288
- /* @__PURE__ */ p($, { sx: { display: "flex" }, children: [
1289
- /* @__PURE__ */ o(
1290
- zn,
1291
- {
1292
- open: C,
1293
- top: I,
1294
- middle: d,
1295
- bottom: l,
1296
- user: u,
1297
- domainCode: v,
1298
- widthOpen: w,
1299
- widthClosed: g,
1300
- offsetTop: A,
1301
- "data-testid": c
1302
- }
1303
- ),
1304
- /* @__PURE__ */ o(
1305
- Un,
1306
- S(s({
1307
- "data-testid": r,
1308
- topBarHeight: A
1309
- }, i), {
1310
- children: e
1311
- })
1312
- )
1313
- ] })
1314
- ] });
1303
+ };
1304
+ a(d);
1305
+ }, [i, n, r, a]), r && Un(r)) {
1306
+ let d = "Auth error", l = "An unknown Auth0 error occurred.";
1307
+ return Vn(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : qn(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : Gn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ p(Ze, { open: !0, children: [
1308
+ /* @__PURE__ */ o(et, { children: d }),
1309
+ /* @__PURE__ */ o(tt, { children: /* @__PURE__ */ o(P, { children: l }) }),
1310
+ /* @__PURE__ */ o(nt, { children: /* @__PURE__ */ o(ie, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
1311
+ ] });
1312
+ }
1313
+ return n ? /* @__PURE__ */ o(M, { children: e }) : /* @__PURE__ */ o(ln, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
1315
1314
  }
1316
1315
  const Xn = {
1317
1316
  autoHideDuration: 6e3,
@@ -1397,12 +1396,12 @@ function eo(a) {
1397
1396
  onClose: (m) => b(m, "closeAlert"),
1398
1397
  severity: O.severity,
1399
1398
  variant: "filled",
1400
- icon: O.progressIndicator === "circular" ? /* @__PURE__ */ o(be, { size: "1em" }) : void 0,
1399
+ icon: O.progressIndicator === "circular" ? /* @__PURE__ */ o(Se, { size: "1em" }) : void 0,
1401
1400
  style: O.progressIndicator === "linear" ? Jn : void 0,
1402
1401
  children: O.message
1403
1402
  }
1404
1403
  ),
1405
- O.progressIndicator === "linear" && /* @__PURE__ */ o(Ze, { color: "primary" })
1404
+ O.progressIndicator === "linear" && /* @__PURE__ */ o(je, { color: "primary" })
1406
1405
  ] })
1407
1406
  })
1408
1407
  )
@@ -1414,9 +1413,9 @@ function to() {
1414
1413
  throw new ke("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1415
1414
  return e;
1416
1415
  }
1417
- const Ho = X(
1416
+ const Ro = X(
1418
1417
  (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(eo, S(s({}, e), { overrideState: t, overrideActions: n, children: i }))
1419
- ), no = en(), Wo = ({
1418
+ ), no = en(), Ho = ({
1420
1419
  children: e,
1421
1420
  store: t
1422
1421
  }) => /* @__PURE__ */ o(lt, { store: t != null ? t : no, children: e }), Dt = "domainCode";
@@ -1443,7 +1442,7 @@ const qe = R(
1443
1442
  }, io = (e) => {
1444
1443
  var t;
1445
1444
  return e === null ? "N/A" : (t = oo[e]) != null ? t : "";
1446
- }, zo = ({
1445
+ }, Wo = ({
1447
1446
  isLoading: e,
1448
1447
  isOpen: t,
1449
1448
  onClose: n,
@@ -1458,7 +1457,7 @@ const qe = R(
1458
1457
  });
1459
1458
  let k;
1460
1459
  return C ? k = "Unable to retrieve your active organisations. Try logging in again." : w && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ p(
1461
- ft,
1460
+ bt,
1462
1461
  {
1463
1462
  isOpen: t,
1464
1463
  dialogTitle: "Select an organisation",
@@ -1481,7 +1480,7 @@ const qe = R(
1481
1480
  "."
1482
1481
  ] }),
1483
1482
  /* @__PURE__ */ o(
1484
- we,
1483
+ Ae,
1485
1484
  {
1486
1485
  loading: e,
1487
1486
  multiple: !1,
@@ -1491,13 +1490,13 @@ const qe = R(
1491
1490
  getOptionLabel: io,
1492
1491
  options: [...i],
1493
1492
  renderInput: (I) => /* @__PURE__ */ o(
1494
- Ae,
1493
+ be,
1495
1494
  S(s({}, I), {
1496
1495
  variant: "filled",
1497
1496
  label: "Select organisation",
1498
1497
  InputProps: S(s({}, I.InputProps), {
1499
1498
  endAdornment: /* @__PURE__ */ p(M, { children: [
1500
- e ? /* @__PURE__ */ o(be, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1499
+ e ? /* @__PURE__ */ o(Se, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1501
1500
  I.InputProps.endAdornment
1502
1501
  ] })
1503
1502
  })
@@ -1509,7 +1508,7 @@ const qe = R(
1509
1508
  ]
1510
1509
  }
1511
1510
  );
1512
- }, Uo = ot({
1511
+ }, zo = ot({
1513
1512
  palette: {
1514
1513
  primary: {
1515
1514
  dark: "#00A651",
@@ -1560,7 +1559,7 @@ const qe = R(
1560
1559
  navBar: {
1561
1560
  backgroundColor: "#E8E8E8"
1562
1561
  }
1563
- }), Go = ot({
1562
+ }), Uo = ot({
1564
1563
  palette: {
1565
1564
  primary: {
1566
1565
  main: "#007236",
@@ -1654,15 +1653,15 @@ const qe = R(
1654
1653
  }), ro = {
1655
1654
  domainCode: yt,
1656
1655
  navBarOpen: K,
1657
- navBarWidthOpen: vt,
1658
- navBarWidthClosed: wt,
1656
+ navBarWidthOpen: Ct,
1657
+ navBarWidthClosed: xt,
1659
1658
  titleText: xe,
1660
- topBarHeight: At,
1661
- navBarTop: bt
1662
- }, Vo = X(() => ({ children: e }) => /* @__PURE__ */ o(lt, { children: e })), ao = ({
1659
+ topBarHeight: vt,
1660
+ navBarTop: wt
1661
+ }, Go = X(() => ({ children: e }) => /* @__PURE__ */ o(lt, { children: e })), ao = ({
1663
1662
  initialValues: e,
1664
1663
  children: t
1665
- }) => (dt(e), /* @__PURE__ */ o(M, { children: t })), qo = X(
1664
+ }) => (ct(e), /* @__PURE__ */ o(M, { children: t })), Vo = X(
1666
1665
  (e) => ({ children: t }) => /* @__PURE__ */ o(
1667
1666
  ao,
1668
1667
  {
@@ -1675,53 +1674,53 @@ const qe = R(
1675
1674
  children: t
1676
1675
  }
1677
1676
  )
1678
- ), Xo = X(() => ({ children: e }) => {
1677
+ ), qo = X(() => ({ children: e }) => {
1679
1678
  const t = new rn();
1680
1679
  return /* @__PURE__ */ o(an, { client: t, children: e });
1681
1680
  });
1682
1681
  export {
1683
- ft as AgDialog,
1684
- Ro as AppLayout,
1685
- Wo as AtomProvider,
1686
- _o as AuthGuard,
1682
+ bt as AgDialog,
1683
+ Po as AppLayout,
1684
+ Ho as AtomProvider,
1685
+ Mo as AuthGuard,
1687
1686
  kt as Context,
1688
1687
  ke as ContextError,
1689
- zo as DomainCodeDialog,
1690
- Io as ExampleComponent,
1691
- Po as FetchAutocomplete,
1688
+ Wo as DomainCodeDialog,
1689
+ $o as ExampleComponent,
1690
+ No as FetchAutocomplete,
1692
1691
  ao as HydrateAtoms,
1693
1692
  pt as NAVBAR_WIDTH_CLOSED,
1694
1693
  ut as NAVBAR_WIDTH_OPENED,
1695
- Fo as NavBar,
1696
- Bo as NavBarDarkStyledList,
1697
- Eo as NavBarLightStyledList,
1694
+ Eo as NavBar,
1695
+ Oo as NavBarDarkStyledList,
1696
+ Bo as NavBarLightStyledList,
1698
1697
  fn as NavBarProvider,
1699
- Mo as PageLayout,
1698
+ Fo as PageLayout,
1700
1699
  eo as SaladBarProvider,
1701
- Lo as SessionExpiryDialog,
1702
- No as SingleAutocomplete,
1700
+ _o as SessionExpiryDialog,
1701
+ Lo as SingleAutocomplete,
1703
1702
  no as atomStore,
1704
1703
  Cn as buildNavBarState,
1705
1704
  yt as domainCodeAtom,
1706
- Uo as fed21Theme,
1707
- xn as getAuth0Expiry,
1708
- Go as internalAgSystemsTheme,
1705
+ zo as fed21Theme,
1706
+ zn as getAuth0Expiry,
1707
+ Uo as internalAgSystemsTheme,
1709
1708
  q as navBarClasses,
1710
1709
  K as navBarOpenAtom,
1711
- bt as navBarTopAtom,
1712
- wt as navBarWidthClosedAtom,
1713
- vt as navBarWidthOpenAtom,
1710
+ wt as navBarTopAtom,
1711
+ xt as navBarWidthClosedAtom,
1712
+ Ct as navBarWidthOpenAtom,
1714
1713
  xe as titleTextAtom,
1715
- At as topBarHeightAtom,
1716
- Pn as topBarMiddleAtom,
1717
- mt as useAutocompleteOptions,
1714
+ vt as topBarHeightAtom,
1715
+ Tn as topBarMiddleAtom,
1716
+ St as useAutocompleteOptions,
1718
1717
  mn as useNavBar,
1719
1718
  to as useSaladBar,
1720
- Vo as withAtomProvider,
1721
- Oo as withBrowserRouter,
1722
- To as withNavBarProvider,
1723
- qo as withOverrideDefaults,
1724
- Xo as withQueryClient,
1725
- Ho as withSaladBarProvider
1719
+ Go as withAtomProvider,
1720
+ To as withBrowserRouter,
1721
+ Io as withNavBarProvider,
1722
+ Vo as withOverrideDefaults,
1723
+ qo as withQueryClient,
1724
+ Ro as withSaladBarProvider
1726
1725
  };
1727
1726
  //# sourceMappingURL=index.js.map