@australiangreens/ag-internal-components 0.0.71 → 0.0.72

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