@australiangreens/ag-internal-components 0.1.23 → 0.1.25

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