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