@australiangreens/ag-internal-components 0.3.3 → 0.3.4

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,156 +1,156 @@
1
- var je = Object.defineProperty, et = Object.defineProperties;
2
- var tt = Object.getOwnPropertyDescriptors;
3
- var K = Object.getOwnPropertySymbols;
4
- var le = Object.prototype.hasOwnProperty, ce = Object.prototype.propertyIsEnumerable;
5
- var j = (e, t, o) => t in e ? je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, p = (e, t) => {
1
+ var et = Object.defineProperty, tt = Object.defineProperties;
2
+ var ot = Object.getOwnPropertyDescriptors;
3
+ var X = Object.getOwnPropertySymbols;
4
+ var ce = Object.prototype.hasOwnProperty, de = Object.prototype.propertyIsEnumerable;
5
+ var ee = (e, t, o) => t in e ? et(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, u = (e, t) => {
6
6
  for (var o in t || (t = {}))
7
- le.call(t, o) && j(e, o, t[o]);
8
- if (K)
9
- for (var o of K(t))
10
- ce.call(t, o) && j(e, o, t[o]);
7
+ ce.call(t, o) && ee(e, o, t[o]);
8
+ if (X)
9
+ for (var o of X(t))
10
+ de.call(t, o) && ee(e, o, t[o]);
11
11
  return e;
12
- }, b = (e, t) => et(e, tt(t));
13
- var de = (e, t) => {
12
+ }, F = (e, t) => tt(e, ot(t));
13
+ var ue = (e, t) => {
14
14
  var o = {};
15
- for (var i in e)
16
- le.call(e, i) && t.indexOf(i) < 0 && (o[i] = e[i]);
17
- if (e != null && K)
18
- for (var i of K(e))
19
- t.indexOf(i) < 0 && ce.call(e, i) && (o[i] = e[i]);
15
+ for (var n in e)
16
+ ce.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
17
+ if (e != null && X)
18
+ for (var n of X(e))
19
+ t.indexOf(n) < 0 && de.call(e, n) && (o[n] = e[n]);
20
20
  return o;
21
21
  };
22
- var ue = (e, t, o) => j(e, typeof t != "symbol" ? t + "" : t, o);
23
- var M = (e, t, o) => new Promise((i, r) => {
24
- var s = (l) => {
22
+ var pe = (e, t, o) => ee(e, typeof t != "symbol" ? t + "" : t, o);
23
+ var P = (e, t, o) => new Promise((n, s) => {
24
+ var a = (c) => {
25
25
  try {
26
- a(o.next(l));
27
- } catch (u) {
28
- r(u);
26
+ r(o.next(c));
27
+ } catch (l) {
28
+ s(l);
29
29
  }
30
- }, c = (l) => {
30
+ }, p = (c) => {
31
31
  try {
32
- a(o.throw(l));
33
- } catch (u) {
34
- r(u);
32
+ r(o.throw(c));
33
+ } catch (l) {
34
+ s(l);
35
35
  }
36
- }, a = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(s, c);
37
- a((o = o.apply(e, t)).next());
36
+ }, r = (c) => c.done ? n(c.value) : Promise.resolve(c.value).then(a, p);
37
+ r((o = o.apply(e, t)).next());
38
38
  });
39
- import { jsxs as x, Fragment as N, jsx as n } from "react/jsx-runtime";
40
- import { useState as V, createElement as oe, useEffect as pe, useMemo as ot, createContext as nt, useRef as ee, useCallback as he, useContext as it } from "react";
41
- import { Typography as E, Button as z, Paper as _e, Dialog as Me, LinearProgress as Te, DialogTitle as Pe, DialogContent as Ne, DialogActions as $e, Autocomplete as ne, TextField as ie, CircularProgress as re, Box as I, Chip as rt, Tooltip as at, Stack as st, Snackbar as lt, Alert as ct, FormHelperText as dt, useTheme as J, useMediaQuery as ut, Drawer as pt, Collapse as ht, Avatar as fe, Fade as ft, Skeleton as me, Toolbar as mt, Divider as ge, Container as gt, IconButton as xt } from "@mui/material";
42
- import { Cancel as At, ArrowDropDown as Ct, ViewHeadline as St } from "@mui/icons-material";
43
- import vt from "autosuggest-highlight/match";
44
- import wt from "autosuggest-highlight/parse";
45
- import { useQuery as Le } from "@tanstack/react-query";
39
+ import { jsxs as m, Fragment as O, jsx as i } from "react/jsx-runtime";
40
+ import { useState as G, createElement as ne, useEffect as he, useMemo as nt, createContext as it, useRef as te, useCallback as fe, useContext as rt } from "react";
41
+ import { Typography as _, Button as z, Paper as Me, Dialog as Pe, LinearProgress as Ne, DialogTitle as Te, DialogContent as $e, DialogActions as Le, Autocomplete as ie, TextField as re, CircularProgress as se, Box as M, Chip as st, Tooltip as at, Stack as lt, Snackbar as ct, Alert as dt, FormHelperText as ut, useTheme as Z, useMediaQuery as pt, Drawer as ht, Collapse as ft, Avatar as me, Fade as mt, Skeleton as ge, Toolbar as gt, Divider as xe, Container as xt, IconButton as At } from "@mui/material";
42
+ import { Cancel as Ct, ArrowDropDown as St, ViewHeadline as vt } from "@mui/icons-material";
43
+ import wt from "autosuggest-highlight/match";
44
+ import kt from "autosuggest-highlight/parse";
45
+ import { useQuery as Oe } from "@tanstack/react-query";
46
46
  import { useAuth0 as ae } from "@auth0/auth0-react";
47
- import { Buffer as kt } from "buffer";
48
- import Dt from "@mui/material/Skeleton";
49
- import { atom as P, useAtom as W, useSetAtom as Oe, useAtomValue as xe } from "jotai";
50
- import { createHelper as yt } from "souvlaki";
51
- import bt from "@mui/material/CssBaseline";
52
- import Ae from "@mui/material/Box";
53
- import { useHydrateAtoms as Ft } from "jotai/utils";
54
- import { styled as Re, createTheme as Ue, alpha as te } from "@mui/material/styles";
55
- import Ce from "react-avatar";
56
- function Io({ text: e }) {
57
- const [t, o] = V(0);
58
- return /* @__PURE__ */ x(N, { children: [
59
- /* @__PURE__ */ n(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
60
- /* @__PURE__ */ n(E, { variant: "caption", display: "block", children: /* @__PURE__ */ n("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
61
- /* @__PURE__ */ n(
47
+ import { Buffer as Dt } from "buffer";
48
+ import yt from "@mui/material/Skeleton";
49
+ import { atom as $, useAtom as W, useSetAtom as Re, useAtomValue as Ae } from "jotai";
50
+ import { createHelper as bt } from "souvlaki";
51
+ import Ft from "@mui/material/CssBaseline";
52
+ import Ce from "@mui/material/Box";
53
+ import { useHydrateAtoms as Et } from "jotai/utils";
54
+ import { styled as Ue, createTheme as Be, alpha as oe } from "@mui/material/styles";
55
+ import Se from "react-avatar";
56
+ function _o({ text: e }) {
57
+ const [t, o] = G(0);
58
+ return /* @__PURE__ */ m(O, { children: [
59
+ /* @__PURE__ */ i(_, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
60
+ /* @__PURE__ */ i(_, { variant: "caption", display: "block", children: /* @__PURE__ */ i("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
61
+ /* @__PURE__ */ i(
62
62
  z,
63
63
  {
64
64
  variant: "outlined",
65
- onClick: () => o((i) => i + 1),
65
+ onClick: () => o((n) => n + 1),
66
66
  "aria-label": "Increment",
67
67
  children: "Hello I am a button"
68
68
  }
69
69
  ),
70
- /* @__PURE__ */ x("p", { children: [
70
+ /* @__PURE__ */ m("p", { children: [
71
71
  "This is some text: ",
72
- /* @__PURE__ */ n("span", { children: e })
72
+ /* @__PURE__ */ i("span", { children: e })
73
73
  ] }),
74
- /* @__PURE__ */ x(_e, { children: [
74
+ /* @__PURE__ */ m(Me, { children: [
75
75
  "This number will incremember when button pressed: ",
76
76
  t
77
77
  ] })
78
78
  ] });
79
79
  }
80
- const Be = ({
80
+ const He = ({
81
81
  isOpen: e,
82
82
  dialogTitle: t,
83
83
  children: o,
84
- maxWidth: i,
85
- primaryButton: r,
86
- secondaryButton: s,
87
- additionalButtons: c,
88
- onClose: a,
89
- sx: l,
90
- "data-testid": u,
91
- disableCloseOnBackdropOrEscape: g = !1,
92
- isLoading: w = !1
84
+ maxWidth: n,
85
+ primaryButton: s,
86
+ secondaryButton: a,
87
+ additionalButtons: p,
88
+ onClose: r,
89
+ sx: c,
90
+ "data-testid": l,
91
+ disableCloseOnBackdropOrEscape: x = !1,
92
+ isLoading: C = !1
93
93
  }) => {
94
- var v, D;
95
- const [S, A] = V(!1);
96
- return /* @__PURE__ */ x(
97
- Me,
94
+ var w, D;
95
+ const [v, g] = G(!1);
96
+ return /* @__PURE__ */ m(
97
+ Pe,
98
98
  {
99
99
  open: e,
100
- onClose: (f, k) => M(null, null, function* () {
101
- g && (k === "backdropClick" || k === "escapeKeyDown") || S || (s != null && s.onClick ? yield s.onClick() : a());
100
+ onClose: (f, k) => P(null, null, function* () {
101
+ x && (k === "backdropClick" || k === "escapeKeyDown") || v || (a != null && a.onClick ? yield a.onClick() : r());
102
102
  }),
103
103
  fullWidth: !0,
104
- maxWidth: i != null ? i : "xs",
105
- "data-testid": u,
106
- sx: l,
104
+ maxWidth: n != null ? n : "xs",
105
+ "data-testid": l,
106
+ sx: c,
107
107
  children: [
108
- w && /* @__PURE__ */ n(Te, { sx: { height: "4px", marginBottom: "-4px" } }),
109
- /* @__PURE__ */ n(Pe, { children: t }),
110
- /* @__PURE__ */ n(Ne, { sx: { "& > :last-child": { marginBottom: 0 } }, children: o }),
111
- /* @__PURE__ */ x($e, { children: [
112
- /* @__PURE__ */ n(
108
+ C && /* @__PURE__ */ i(Ne, { sx: { height: "4px", marginBottom: "-4px" } }),
109
+ /* @__PURE__ */ i(Te, { children: t }),
110
+ /* @__PURE__ */ i($e, { sx: { "& > :last-child": { marginBottom: 0 } }, children: o }),
111
+ /* @__PURE__ */ m(Le, { children: [
112
+ /* @__PURE__ */ i(
113
113
  z,
114
114
  {
115
- onClick: (v = s == null ? void 0 : s.onClick) != null ? v : a,
116
- "data-testid": s == null ? void 0 : s.testId,
117
- disabled: (s == null ? void 0 : s.disabled) || S,
118
- color: s == null ? void 0 : s.buttonColor,
119
- children: (D = s == null ? void 0 : s.text) != null ? D : "Cancel"
115
+ onClick: (w = a == null ? void 0 : a.onClick) != null ? w : r,
116
+ "data-testid": a == null ? void 0 : a.testId,
117
+ disabled: (a == null ? void 0 : a.disabled) || v,
118
+ color: a == null ? void 0 : a.buttonColor,
119
+ children: (D = a == null ? void 0 : a.text) != null ? D : "Cancel"
120
120
  }
121
121
  ),
122
- c && c.map((f, k) => {
122
+ p && p.map((f, k) => {
123
123
  var y;
124
- return /* @__PURE__ */ n(
124
+ return /* @__PURE__ */ i(
125
125
  z,
126
126
  {
127
127
  onClick: f == null ? void 0 : f.onClick,
128
128
  "data-testid": f == null ? void 0 : f.testId,
129
- disabled: (f == null ? void 0 : f.disabled) || S,
129
+ disabled: (f == null ? void 0 : f.disabled) || v,
130
130
  color: f == null ? void 0 : f.buttonColor,
131
131
  children: (y = f.text) != null ? y : `Button ${k}`
132
132
  },
133
133
  k
134
134
  );
135
135
  }),
136
- r && /* @__PURE__ */ n(
136
+ s && /* @__PURE__ */ i(
137
137
  z,
138
138
  {
139
- onClick: () => M(null, null, function* () {
139
+ onClick: () => P(null, null, function* () {
140
140
  var f;
141
- A(!0), yield (f = r.onClick) == null ? void 0 : f.call(r), A(!1);
141
+ g(!0), yield (f = s.onClick) == null ? void 0 : f.call(s), g(!1);
142
142
  }),
143
- "data-testid": r.testId,
144
- disabled: r.disabled || S,
145
- color: r == null ? void 0 : r.buttonColor,
146
- children: r.text
143
+ "data-testid": s.testId,
144
+ disabled: s.disabled || v,
145
+ color: s == null ? void 0 : s.buttonColor,
146
+ children: s.text
147
147
  }
148
148
  )
149
149
  ] })
150
150
  ]
151
151
  }
152
152
  );
153
- }, Et = {
153
+ }, It = {
154
154
  popper: {
155
155
  modifiers: [
156
156
  {
@@ -161,58 +161,59 @@ const Be = ({
161
161
  }
162
162
  ]
163
163
  }
164
- }, He = {
164
+ }, We = {
165
165
  right: 2
166
- }, We = ({
166
+ }, qe = ({
167
167
  minLength: e,
168
168
  preLoadedOptions: t,
169
169
  lookup: o,
170
- label: i,
171
- inputValue: r
172
- }) => Le({
173
- queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
174
- (s) => s.label.toLowerCase().includes(r.toLowerCase())
175
- ) : o(r),
176
- queryKey: ["autocomplete", i, r]
170
+ label: n,
171
+ inputValue: s
172
+ }) => Oe({
173
+ queryFn: () => e && s.length < e ? t != null ? t : [] : t ? t.filter(
174
+ (a) => a.label.toLowerCase().includes(s.toLowerCase())
175
+ ) : o(s),
176
+ queryKey: ["autocomplete", n, s]
177
177
  });
178
- function _o({
179
- lookup: e = () => M(null, null, function* () {
178
+ function Mo({
179
+ lookup: e = () => P(null, null, function* () {
180
180
  }),
181
181
  enableHighlighting: t = !0,
182
182
  onChange: o,
183
- minLength: i = 0,
184
- label: r,
185
- value: s,
186
- "data-testid": c,
187
- sx: a,
183
+ onInputChange: n,
184
+ minLength: s = 0,
185
+ label: a,
186
+ value: p,
187
+ "data-testid": r,
188
+ sx: c,
188
189
  boxSx: l,
189
- textFieldColor: u,
190
- textFieldVariant: g = "filled",
191
- loadingText: w = "Loading...",
192
- noOptionsText: S = "No options",
193
- popupIcon: A = /* @__PURE__ */ n(Ct, {}),
194
- error: v = !1,
195
- helperText: D = "",
196
- preLoadedOptions: f = void 0,
197
- disablePortal: k = !1,
198
- disableIconFlip: y = !1,
199
- chipToolTipSlotProps: _ = Et,
200
- isPlaceholder: L = !1,
201
- placeHolderText: O = void 0,
202
- onRightClick: F = () => {
190
+ textFieldColor: x,
191
+ textFieldVariant: C = "filled",
192
+ loadingText: v = "Loading...",
193
+ noOptionsText: g = "No options",
194
+ popupIcon: w = /* @__PURE__ */ i(St, {}),
195
+ error: D = !1,
196
+ helperText: f = "",
197
+ preLoadedOptions: k = void 0,
198
+ disablePortal: y = !1,
199
+ disableIconFlip: I = !1,
200
+ chipToolTipSlotProps: V = It,
201
+ isPlaceholder: N = !1,
202
+ placeholderText: E = void 0,
203
+ onRightClick: U = () => {
203
204
  },
204
- disableDefaultRightClickBehaviour: T = !1
205
+ disableDefaultRightClickBehaviour: L = !1
205
206
  }) {
206
- const [R, U] = V(""), B = (h, C) => {
207
- const $ = s.filter((Z) => Z.id !== C);
208
- o($, "delete", h);
209
- }, { data: d, isLoading: m } = We({
210
- inputValue: R,
211
- label: r,
207
+ const [B, R] = G(""), S = (h, A) => {
208
+ const T = p.filter((j) => j.id !== A);
209
+ o(T, "delete", h);
210
+ }, { data: d, isLoading: b } = qe({
211
+ inputValue: B,
212
+ label: a,
212
213
  lookup: e,
213
- minLength: i,
214
- preLoadedOptions: f
215
- }), H = R.length >= i, Qe = L ? {
214
+ minLength: s,
215
+ preLoadedOptions: k
216
+ }), H = B.length >= s, Je = N ? {
216
217
  sx: {
217
218
  "& .MuiFilledInput-root.Mui-focused": {
218
219
  backgroundColor: "hsla(201, 98%, 41%, 0.08)"
@@ -223,120 +224,122 @@ function _o({
223
224
  },
224
225
  focused: !0
225
226
  } : {};
226
- return /* @__PURE__ */ x("div", { "data-testid": c, children: [
227
- /* @__PURE__ */ n(
228
- ne,
227
+ return /* @__PURE__ */ m("div", { "data-testid": r, children: [
228
+ /* @__PURE__ */ i(
229
+ ie,
229
230
  {
230
- sx: p(p({}, a), y ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
231
- "data-testid": c ? `${c}:Autocomplete` : void 0,
232
- disablePortal: k,
231
+ sx: u(u({}, c), I ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
232
+ "data-testid": r ? `${r}:Autocomplete` : void 0,
233
+ disablePortal: y,
233
234
  multiple: !0,
234
235
  getOptionLabel: (h) => typeof h == "string" ? h : h.label,
235
- loading: H ? m : !1,
236
- options: [...s, ...d != null ? d : []],
236
+ loading: H ? b : !1,
237
+ options: [...p, ...d != null ? d : []],
237
238
  filterSelectedOptions: !0,
238
239
  includeInputInList: !0,
239
- value: s,
240
- onChange: (h, C, $) => {
241
- o(C, $, h);
240
+ value: p,
241
+ onChange: (h, A, T) => {
242
+ o(A, T, h);
242
243
  },
243
- onInputChange: (h, C) => U(C),
244
- noOptionsText: H ? S : "Start typing to search",
245
- loadingText: w,
246
- popupIcon: A,
247
- renderInput: (h) => /* @__PURE__ */ n(
248
- ie,
249
- p(b(p({}, h), {
250
- label: r,
244
+ onInputChange: (h, A, T) => {
245
+ R(A), n && n(p, T, h);
246
+ },
247
+ noOptionsText: H ? g : "Start typing to search",
248
+ loadingText: v,
249
+ popupIcon: w,
250
+ renderInput: (h) => /* @__PURE__ */ i(
251
+ re,
252
+ u(F(u({}, h), {
253
+ label: a,
251
254
  fullWidth: !0,
252
- variant: g,
253
- error: v,
254
- helperText: D,
255
+ variant: C,
256
+ error: D,
257
+ helperText: f,
255
258
  slotProps: {
256
- input: b(p({}, h.InputProps), {
257
- endAdornment: /* @__PURE__ */ x(N, { children: [
258
- m ? /* @__PURE__ */ n(re, { color: "inherit", size: 20 }) : null,
259
+ input: F(u({}, h.InputProps), {
260
+ endAdornment: N ? void 0 : /* @__PURE__ */ m(O, { children: [
261
+ b ? /* @__PURE__ */ i(se, { color: "inherit", size: 20 }) : null,
259
262
  h.InputProps.endAdornment
260
263
  ] })
261
264
  })
262
265
  },
263
- "data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
264
- onKeyDown: (C) => {
265
- (C.key === "Backspace" || C.key === "Delete") && C.stopPropagation();
266
+ "data-testid": r ? `${r}:Autocomplete:TextField` : void 0,
267
+ onKeyDown: (A) => {
268
+ (A.key === "Backspace" || A.key === "Delete") && A.stopPropagation();
266
269
  },
267
- color: u,
268
- placeholder: O
269
- }), Qe)
270
+ color: x,
271
+ placeholder: E != null ? E : N ? "Placeholder field" : void 0
272
+ }), Je)
270
273
  ),
271
274
  renderValue: () => null,
272
- isOptionEqualToValue: (h, C) => h.id === C.id,
273
- renderOption: (h, C, $) => {
275
+ isOptionEqualToValue: (h, A) => h.id === A.id,
276
+ renderOption: (h, A, T) => {
274
277
  if (t) {
275
- const Z = vt(C.label, $.inputValue, {
278
+ const j = wt(A.label, T.inputValue, {
276
279
  insideWords: !0,
277
280
  findAllOccurrences: !0
278
- }), Je = wt(C.label, Z);
279
- return /* @__PURE__ */ oe(
281
+ }), Ze = kt(A.label, j);
282
+ return /* @__PURE__ */ ne(
280
283
  "li",
281
- b(p({}, h), {
282
- key: C.id,
283
- "data-testid": c ? `${c}:Autocomplete:option(${C.id.toString()})` : void 0
284
+ F(u({}, h), {
285
+ key: A.id,
286
+ "data-testid": r ? `${r}:Autocomplete:option(${A.id.toString()})` : void 0
284
287
  }),
285
- /* @__PURE__ */ n("div", { children: Je.map((se, Ze) => /* @__PURE__ */ n(
288
+ /* @__PURE__ */ i("div", { children: Ze.map((le, je) => /* @__PURE__ */ i(
286
289
  "span",
287
290
  {
288
291
  style: {
289
- fontWeight: se.highlight ? 700 : 400
292
+ fontWeight: le.highlight ? 700 : 400
290
293
  },
291
- children: se.text
294
+ children: le.text
292
295
  },
293
- Ze
296
+ je
294
297
  )) })
295
298
  );
296
299
  } else
297
- return /* @__PURE__ */ oe(
300
+ return /* @__PURE__ */ ne(
298
301
  "li",
299
- b(p({}, h), {
300
- key: C.id,
301
- "data-testid": c ? `${c}:option(${C.id.toString()})` : void 0
302
+ F(u({}, h), {
303
+ key: A.id,
304
+ "data-testid": r ? `${r}:option(${A.id.toString()})` : void 0
302
305
  }),
303
- C.label
306
+ A.label
304
307
  );
305
308
  },
306
- onContextMenu: F,
307
309
  onMouseDownCapture: (h) => {
308
- h.button === He.right && T && (h.preventDefault(), h.stopPropagation());
310
+ h.button === We.right && L && (h.preventDefault(), h.stopPropagation());
309
311
  },
310
312
  onContextMenuCapture: (h) => {
311
- T && (h.preventDefault(), h.stopPropagation());
312
- }
313
+ L && (h.preventDefault(), h.stopPropagation()), U(h);
314
+ },
315
+ readOnly: N
313
316
  }
314
317
  ),
315
- s.length > 0 && /* @__PURE__ */ n(I, { sx: l, children: s.map((h) => {
316
- var C;
317
- return /* @__PURE__ */ n(
318
- rt,
318
+ p.length > 0 && /* @__PURE__ */ i(M, { sx: l, children: p.map((h) => {
319
+ var A;
320
+ return /* @__PURE__ */ i(
321
+ st,
319
322
  {
320
323
  sx: {
321
324
  marginTop: 1,
322
325
  marginRight: 1,
323
326
  height: "auto"
324
327
  },
325
- label: /* @__PURE__ */ n(
328
+ label: /* @__PURE__ */ i(
326
329
  at,
327
330
  {
328
- title: (C = h.tooltipContent) != null ? C : "",
331
+ title: (A = h.tooltipContent) != null ? A : "",
329
332
  placement: "bottom-start",
330
- slotProps: _,
331
- children: /* @__PURE__ */ n(E, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
333
+ slotProps: V,
334
+ children: /* @__PURE__ */ i(_, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
332
335
  }
333
336
  ),
334
- "data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
335
- onDelete: ($) => B($, h.id),
336
- deleteIcon: /* @__PURE__ */ n(
337
- At,
337
+ "data-testid": r ? `${r}:Chip(${h.id.toString()})` : void 0,
338
+ onDelete: (T) => S(T, h.id),
339
+ deleteIcon: /* @__PURE__ */ i(
340
+ Ct,
338
341
  {
339
- "data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
342
+ "data-testid": r ? `${r}:Chip(${h.id.toString()}):deleteIcon` : void 0
340
343
  }
341
344
  )
342
345
  },
@@ -345,38 +348,39 @@ function _o({
345
348
  }) })
346
349
  ] });
347
350
  }
348
- const Mo = /MUI: The value provided to.*is invalid/i, To = ({
349
- lookup: e = () => M(null, null, function* () {
351
+ const Po = /MUI: The value provided to.*is invalid/i, No = ({
352
+ lookup: e = () => P(null, null, function* () {
350
353
  }),
351
354
  onChange: t,
352
- label: o,
353
- value: i,
354
- sx: r,
355
- textFieldColor: s,
356
- textFieldVariant: c = "filled",
357
- error: a = !1,
355
+ onInputChange: o,
356
+ label: n,
357
+ value: s,
358
+ sx: a,
359
+ textFieldColor: p,
360
+ textFieldVariant: r = "filled",
361
+ error: c = !1,
358
362
  "data-testid": l,
359
- noOptionsText: u = "No options",
360
- minLength: g = 3,
361
- disablePortal: w = !1,
362
- preLoadedOptions: S,
363
- helperText: A = "",
364
- disabled: v,
365
- popupIcon: D,
366
- disableIconFlip: f,
367
- isPlaceholder: k = !1,
368
- placeHolderText: y = void 0,
369
- onRightClick: _ = () => {
363
+ noOptionsText: x = "No options",
364
+ minLength: C = 3,
365
+ disablePortal: v = !1,
366
+ preLoadedOptions: g,
367
+ helperText: w = "",
368
+ disabled: D,
369
+ popupIcon: f,
370
+ disableIconFlip: k,
371
+ isPlaceholder: y = !1,
372
+ placeholderText: I = void 0,
373
+ onRightClick: V = () => {
370
374
  },
371
- disableDefaultRightClickBehaviour: L = !1
375
+ disableDefaultRightClickBehaviour: N = !1
372
376
  }) => {
373
- const [O, F] = V(""), { data: T, isLoading: R } = We({
374
- inputValue: O,
375
- label: o,
377
+ const [E, U] = G(""), { data: L, isLoading: B } = qe({
378
+ inputValue: E,
379
+ label: n,
376
380
  lookup: e,
377
- minLength: g != null ? g : 0,
378
- preLoadedOptions: S
379
- }), U = O.length >= g, B = k ? {
381
+ minLength: C != null ? C : 0,
382
+ preLoadedOptions: g
383
+ }), R = E.length >= C, S = y ? {
380
384
  sx: {
381
385
  "& .MuiFilledInput-root.Mui-focused": {
382
386
  backgroundColor: "hsla(201, 98%, 41%, 0.08)"
@@ -385,94 +389,95 @@ const Mo = /MUI: The value provided to.*is invalid/i, To = ({
385
389
  backgroundColor: "hsla(201, 98%, 41%, 0.08)"
386
390
  }
387
391
  },
388
- focused: !0
392
+ focused: !0,
393
+ slotProps: { input: { endAdornment: void 0 } }
389
394
  } : {};
390
- return /* @__PURE__ */ n("div", { "data-testid": l, children: /* @__PURE__ */ n(
391
- st,
395
+ return /* @__PURE__ */ i("div", { "data-testid": l, children: /* @__PURE__ */ i(
396
+ lt,
392
397
  {
393
398
  direction: "row",
394
399
  spacing: 1,
395
- onContextMenu: _,
396
400
  onMouseDownCapture: (d) => {
397
- d.button === He.right && L && (d.preventDefault(), d.stopPropagation());
401
+ d.button === We.right && N && (d.preventDefault(), d.stopPropagation());
398
402
  },
399
403
  onContextMenuCapture: (d) => {
400
- L && (d.preventDefault(), d.stopPropagation());
404
+ N && (d.preventDefault(), d.stopPropagation()), V(d);
401
405
  },
402
- children: /* @__PURE__ */ n(
403
- ne,
406
+ children: /* @__PURE__ */ i(
407
+ ie,
404
408
  {
405
- sx: p(p({}, r), f ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
409
+ sx: u(u({}, a), k ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
406
410
  "data-testid": l ? `${l}:Autocomplete` : void 0,
407
- loading: U ? R : !1,
408
- options: T != null ? T : [],
409
- onChange: (d, m, H) => {
410
- t(d, m, H);
411
+ loading: R ? B : !1,
412
+ options: L != null ? L : [],
413
+ onChange: (d, b, H) => {
414
+ t(d, b, H);
411
415
  },
412
- disablePortal: w,
416
+ disablePortal: v,
413
417
  filterOptions: (d) => d,
414
- value: i,
415
- noOptionsText: U ? u : "Start typing to search",
418
+ value: s,
419
+ noOptionsText: R ? x : "Start typing to search",
416
420
  getOptionLabel: (d) => d.label,
417
- popupIcon: D,
418
- renderInput: (d) => /* @__PURE__ */ n(
419
- ie,
420
- p(b(p({
421
+ popupIcon: f,
422
+ renderInput: (d) => /* @__PURE__ */ i(
423
+ re,
424
+ u(F(u({
421
425
  "data-testid": l ? `${l}:Autocomplete:TextField` : void 0
422
426
  }, d), {
423
- variant: c,
424
- label: o,
425
- color: s,
426
- error: a,
427
- helperText: A,
428
- placeholder: y
429
- }), B)
427
+ variant: r,
428
+ label: n,
429
+ color: p,
430
+ error: c,
431
+ helperText: w,
432
+ placeholder: I != null ? I : y ? "Placeholder field" : void 0
433
+ }), S)
430
434
  ),
431
- isOptionEqualToValue: (d, m) => d.id === m.id,
432
- onInputChange: (d, m) => {
433
- F(m);
435
+ isOptionEqualToValue: (d, b) => d.id === b.id,
436
+ onInputChange: (d, b, H) => {
437
+ U(b), o && o(b, H, d);
434
438
  },
435
- renderOption: (d, m) => /* @__PURE__ */ oe(
439
+ renderOption: (d, b) => /* @__PURE__ */ ne(
436
440
  "li",
437
- b(p({}, d), {
438
- key: m.id,
439
- "data-testid": l ? `${l}:Autocomplete:option(${m.id.toString()})` : void 0
441
+ F(u({}, d), {
442
+ key: b.id,
443
+ "data-testid": l ? `${l}:Autocomplete:option(${b.id.toString()})` : void 0
440
444
  }),
441
- m.label
445
+ b.label
442
446
  ),
443
- disabled: v
447
+ disabled: D,
448
+ readOnly: y
444
449
  }
445
450
  )
446
451
  }
447
452
  ) });
448
- }, It = (e) => {
453
+ }, _t = (e) => {
449
454
  if (!e)
450
455
  return -1;
451
456
  try {
452
- const o = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
453
- kt.from(o, "base64").toString("utf8").split("").map(function(s) {
454
- return "%" + ("00" + s.charCodeAt(0).toString(16)).slice(-2);
457
+ const o = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), n = decodeURIComponent(
458
+ Dt.from(o, "base64").toString("utf8").split("").map(function(a) {
459
+ return "%" + ("00" + a.charCodeAt(0).toString(16)).slice(-2);
455
460
  }).join("")
456
- ), r = JSON.parse(i);
457
- return r != null && r.exp ? r.exp : -1;
461
+ ), s = JSON.parse(n);
462
+ return s != null && s.exp ? s.exp : -1;
458
463
  } catch (t) {
459
464
  return -1;
460
465
  }
461
- }, Po = ({
466
+ }, To = ({
462
467
  open: e = !1,
463
468
  closeHandler: t,
464
469
  setAuth0ExpiryTime: o
465
470
  }) => {
466
- const { logout: i, getAccessTokenSilently: r } = ae();
467
- return /* @__PURE__ */ n(
468
- Be,
471
+ const { logout: n, getAccessTokenSilently: s } = ae();
472
+ return /* @__PURE__ */ i(
473
+ He,
469
474
  {
470
475
  isOpen: e,
471
476
  primaryButton: {
472
477
  text: "Continue",
473
- onClick: () => M(null, null, function* () {
474
- const u = yield r({ cacheMode: "off" }), g = It(u) * 1e3;
475
- o(g), t();
478
+ onClick: () => P(null, null, function* () {
479
+ const l = yield s({ cacheMode: "off" }), x = _t(l) * 1e3;
480
+ o(x), t();
476
481
  }),
477
482
  disabled: !1,
478
483
  testId: "PreferencesDialog",
@@ -480,8 +485,8 @@ const Mo = /MUI: The value provided to.*is invalid/i, To = ({
480
485
  },
481
486
  secondaryButton: {
482
487
  text: "Log out",
483
- onClick: () => M(null, null, function* () {
484
- i({ logoutParams: { returnTo: `${window.location.origin}` } });
488
+ onClick: () => P(null, null, function* () {
489
+ n({ logoutParams: { returnTo: `${window.location.origin}` } });
485
490
  }),
486
491
  disabled: !1,
487
492
  testId: "PreferencesDialog",
@@ -490,42 +495,42 @@ const Mo = /MUI: The value provided to.*is invalid/i, To = ({
490
495
  onClose: t,
491
496
  dialogTitle: "Session expiry",
492
497
  disableCloseOnBackdropOrEscape: !0,
493
- children: /* @__PURE__ */ n("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
498
+ children: /* @__PURE__ */ i("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
494
499
  }
495
500
  );
496
501
  };
497
- function _t(e) {
502
+ function Mt(e) {
498
503
  return "error" in e;
499
504
  }
500
- function Mt(e) {
501
- var i;
502
- const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
505
+ function Pt(e) {
506
+ var n;
507
+ const t = e.error, o = (n = e == null ? void 0 : e.error_description) != null ? n : "";
503
508
  return t === "access_denied" && o.startsWith("You do not have the required authorization");
504
509
  }
505
- function Tt(e) {
506
- var i;
507
- const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
510
+ function Nt(e) {
511
+ var n;
512
+ const t = e.error, o = (n = e == null ? void 0 : e.error_description) != null ? n : "";
508
513
  return t === "access_denied" && o.startsWith("User did not authorize the request");
509
514
  }
510
- function Pt(e) {
511
- var i;
512
- const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
515
+ function Tt(e) {
516
+ var n;
517
+ const t = e.error, o = (n = e == null ? void 0 : e.error_description) != null ? n : "";
513
518
  return t === "access_denied" && o.match(/Script.*time.*exceeded/);
514
519
  }
515
- function No({
520
+ function $o({
516
521
  children: e,
517
522
  appName: t = "the app",
518
523
  throwErrors: o = "none",
519
- disableConsoleLogging: i = !1,
520
- onError: r = () => {
524
+ disableConsoleLogging: n = !1,
525
+ onError: s = () => {
521
526
  }
522
527
  }) {
523
- var w, S;
524
- const { isAuthenticated: s, isLoading: c, error: a, loginWithRedirect: l, logout: u } = ae();
525
- pe(() => {
526
- a && r(a);
527
- }, [a, r]);
528
- const g = ot(
528
+ var C, v;
529
+ const { isAuthenticated: a, isLoading: p, error: r, loginWithRedirect: c, logout: l } = ae();
530
+ he(() => {
531
+ r && s(r);
532
+ }, [r, s]);
533
+ const x = nt(
529
534
  () => ({
530
535
  appState: {
531
536
  returnTo: `${window.location.pathname}${window.location.search}`
@@ -533,166 +538,166 @@ function No({
533
538
  }),
534
539
  []
535
540
  );
536
- if (pe(() => {
537
- c || s || a || l(g);
538
- }, [c, s, a, l, r, g]), a) {
539
- if (i || console.error(
540
- `Error detected in AuthGuard [isAuthenticated=${s},isLoading=${c}]`,
541
- a
541
+ if (he(() => {
542
+ p || a || r || c(x);
543
+ }, [p, a, r, c, s, x]), r) {
544
+ if (n || console.error(
545
+ `Error detected in AuthGuard [isAuthenticated=${a},isLoading=${p}]`,
546
+ r
542
547
  ), o === "all")
543
- throw a;
544
- if (_t(a)) {
545
- let A = "Auth error", v = "An unknown Auth0 error occurred.";
546
- if (Mt(a))
547
- A = "Unauthorised", v = `You are not authorised to access ${t}.`;
548
- else if (Tt(a))
549
- A = "App not authorised", v = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
550
- else if (Pt(a))
551
- A = "Auth0 script execution time exceeded", v = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";
552
- else if (a.message === "Invalid state") {
548
+ throw r;
549
+ if (Mt(r)) {
550
+ let g = "Auth error", w = "An unknown Auth0 error occurred.";
551
+ if (Pt(r))
552
+ g = "Unauthorised", w = `You are not authorised to access ${t}.`;
553
+ else if (Nt(r))
554
+ g = "App not authorised", w = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
555
+ else if (Tt(r))
556
+ g = "Auth0 script execution time exceeded", w = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";
557
+ else if (r.message === "Invalid state") {
553
558
  const D = localStorage.getItem("auth0_redirect_count");
554
- D ? D && parseInt(D) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(D) + 1)), l(g)) : (localStorage.setItem("auth0_redirect_count", "1"), l(g));
555
- } else if (o === "unknown") throw a;
556
- return /* @__PURE__ */ x(Me, { open: !0, children: [
557
- /* @__PURE__ */ n(Pe, { children: A }),
558
- /* @__PURE__ */ x(Ne, { children: [
559
- /* @__PURE__ */ n(E, { children: v }),
560
- /* @__PURE__ */ n("br", {}),
561
- /* @__PURE__ */ n(E, { variant: "subtitle2", children: "Details from Auth0" }),
562
- /* @__PURE__ */ x(E, { variant: "body2", children: [
559
+ D ? D && parseInt(D) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(D) + 1)), c(x)) : (localStorage.setItem("auth0_redirect_count", "1"), c(x));
560
+ } else if (o === "unknown") throw r;
561
+ return /* @__PURE__ */ m(Pe, { open: !0, children: [
562
+ /* @__PURE__ */ i(Te, { children: g }),
563
+ /* @__PURE__ */ m($e, { children: [
564
+ /* @__PURE__ */ i(_, { children: w }),
565
+ /* @__PURE__ */ i("br", {}),
566
+ /* @__PURE__ */ i(_, { variant: "subtitle2", children: "Details from Auth0" }),
567
+ /* @__PURE__ */ m(_, { variant: "body2", children: [
563
568
  "error: ",
564
- (w = a == null ? void 0 : a.error) != null ? w : "N/A"
569
+ (C = r == null ? void 0 : r.error) != null ? C : "N/A"
565
570
  ] }),
566
- /* @__PURE__ */ x(E, { variant: "body2", children: [
571
+ /* @__PURE__ */ m(_, { variant: "body2", children: [
567
572
  "description: ",
568
- (S = a == null ? void 0 : a.error_description) != null ? S : "N/A"
573
+ (v = r == null ? void 0 : r.error_description) != null ? v : "N/A"
569
574
  ] })
570
575
  ] }),
571
- /* @__PURE__ */ x($e, { children: [
572
- A === "Auth0 script execution time exceeded" && /* @__PURE__ */ n(z, { href: window.location.origin + window.location.pathname, children: "Reload" }),
573
- /* @__PURE__ */ n(z, { onClick: () => u({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
576
+ /* @__PURE__ */ m(Le, { children: [
577
+ g === "Auth0 script execution time exceeded" && /* @__PURE__ */ i(z, { href: window.location.origin + window.location.pathname, children: "Reload" }),
578
+ /* @__PURE__ */ i(z, { onClick: () => l({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
574
579
  ] })
575
580
  ] });
576
- } else if (o === "unknown") throw a;
581
+ } else if (o === "unknown") throw r;
577
582
  }
578
- return s ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ n(N, { children: e })) : /* @__PURE__ */ n(Dt, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
583
+ return a ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ i(O, { children: e })) : /* @__PURE__ */ i(yt, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
579
584
  }
580
- const Nt = {
585
+ const $t = {
581
586
  autoHideDuration: 6e3,
582
587
  anchorOrigin: { vertical: "top", horizontal: "center" },
583
588
  // The default is false. If we prefer timer to continue when window loses
584
589
  // focus, change to true
585
590
  disableWindowBlurListener: !1
586
- }, $t = {
591
+ }, Lt = {
587
592
  shouldClose: (e, t) => t !== "clickaway"
588
- }, Se = {
593
+ }, ve = {
589
594
  message: "",
590
595
  severity: "info",
591
596
  variant: "standard",
592
597
  progressIndicator: void 0
593
598
  // Can use 'circular' or 'linear'
594
- }, ve = 100, we = 2e3, Lt = 2e3, Ot = /* @__PURE__ */ (() => {
599
+ }, we = 100, ke = 2e3, Ot = 2e3, Rt = /* @__PURE__ */ (() => {
595
600
  let e = 0;
596
601
  return () => (e += 1, e);
597
- })(), Rt = {
602
+ })(), Ut = {
598
603
  borderBottomLeftRadius: "0px",
599
604
  borderBottomRightRadius: "0px"
600
- }, Ut = {}, Bt = {}, qe = nt(null);
601
- function Ht(s) {
602
- var c = s, {
603
- overrideState: e = Ut,
604
- overrideActions: t = Bt,
605
- shouldClose: o = $t.shouldClose,
606
- children: i
607
- } = c, r = de(c, [
605
+ }, Bt = {}, Ht = {}, ze = it(null);
606
+ function Wt(a) {
607
+ var p = a, {
608
+ overrideState: e = Bt,
609
+ overrideActions: t = Ht,
610
+ shouldClose: o = Lt.shouldClose,
611
+ children: n
612
+ } = p, s = ue(p, [
608
613
  "overrideState",
609
614
  "overrideActions",
610
615
  "shouldClose",
611
616
  "children"
612
617
  ]);
613
- var B;
614
- const [{ open: a }, l] = V({ open: !1 }), u = ee([]), g = ee(Date.now()), w = ee(0), S = he((d) => {
615
- l({ open: d });
616
- }, []), A = he((d = {}) => {
617
- w.current += 1, u.current.length >= ve && Date.now() - g.current >= we && (g.current = Date.now(), console.error(
618
- `SaladBarProvider: MAX_QUEUE_LENGTH (${ve}) hit ${w.current} times in last ${we}ms)`
619
- ), w.current = 0);
620
- const m = p(b(p({}, Se), {
621
- key: Ot()
622
- }), d);
623
- return u.current.push(m), u.current.length === 1 && l({ open: !0 }), m.key;
624
- }, []), v = (d = "", m = {}) => A(p({ message: d, severity: "success" }, m)), D = (d = "", m = {}) => A(p({ message: d, severity: "info" }, m)), f = (d = "", m = {}) => A(p({ message: d, severity: "warning" }, m)), k = (d = "", m = {}) => A(p({ message: d, severity: "error" }, m)), y = (d) => {
625
- const m = u.current.findIndex((H) => H.key === d);
626
- if (m !== -1)
627
- return m === 0 ? (l({ open: !1 }), u.current[0]) : u.current.splice(m, 1);
628
- }, _ = (d, m) => {
629
- o(d, m) && l({ open: !1 });
630
- }, L = () => {
631
- }, O = () => {
632
- u.current.shift(), u.current.length > 0 && l({ open: !0 });
633
- }, F = (B = u.current[0]) != null ? B : p({}, Se), T = {};
634
- "autoHideDuration" in F && (T.autoHideDuration = F.autoHideDuration);
635
- const R = p(p({}, Nt), r), U = p(p({
636
- open: a,
637
- setOpen: S,
638
- enqueueNotification: A,
639
- enqueueSuccessNotification: v,
618
+ var R;
619
+ const [{ open: r }, c] = G({ open: !1 }), l = te([]), x = te(Date.now()), C = te(0), v = fe((S) => {
620
+ c({ open: S });
621
+ }, []), g = fe((S = {}) => {
622
+ C.current += 1, l.current.length >= we && Date.now() - x.current >= ke && (x.current = Date.now(), console.error(
623
+ `SaladBarProvider: MAX_QUEUE_LENGTH (${we}) hit ${C.current} times in last ${ke}ms)`
624
+ ), C.current = 0);
625
+ const d = u(F(u({}, ve), {
626
+ key: Rt()
627
+ }), S);
628
+ return l.current.push(d), l.current.length === 1 && c({ open: !0 }), d.key;
629
+ }, []), w = (S = "", d = {}) => g(u({ message: S, severity: "success" }, d)), D = (S = "", d = {}) => g(u({ message: S, severity: "info" }, d)), f = (S = "", d = {}) => g(u({ message: S, severity: "warning" }, d)), k = (S = "", d = {}) => g(u({ message: S, severity: "error" }, d)), y = (S) => {
630
+ const d = l.current.findIndex((b) => b.key === S);
631
+ if (d !== -1)
632
+ return d === 0 ? (c({ open: !1 }), l.current[0]) : l.current.splice(d, 1);
633
+ }, I = (S, d) => {
634
+ o(S, d) && c({ open: !1 });
635
+ }, V = () => {
636
+ }, N = () => {
637
+ l.current.shift(), l.current.length > 0 && c({ open: !0 });
638
+ }, E = (R = l.current[0]) != null ? R : u({}, ve), U = {};
639
+ "autoHideDuration" in E && (U.autoHideDuration = E.autoHideDuration);
640
+ const L = u(u({}, $t), s), B = u(u({
641
+ open: r,
642
+ setOpen: v,
643
+ enqueueNotification: g,
644
+ enqueueSuccessNotification: w,
640
645
  enqueueInfoNotification: D,
641
646
  enqueueWarningNotification: f,
642
647
  enqueueErrorNotification: k,
643
648
  removeNotification: y
644
649
  }, e), t);
645
- return /* @__PURE__ */ x(qe.Provider, { value: U, children: [
646
- i,
647
- /* @__PURE__ */ n(
648
- lt,
649
- b(p(p({}, R), T), {
650
- open: a,
651
- onClose: _,
650
+ return /* @__PURE__ */ m(ze.Provider, { value: B, children: [
651
+ n,
652
+ /* @__PURE__ */ i(
653
+ ct,
654
+ F(u(u({}, L), U), {
655
+ open: r,
656
+ onClose: I,
652
657
  TransitionProps: {
653
- onExited: O,
654
- onExit: L
658
+ onExited: N,
659
+ onExit: V
655
660
  },
656
- sx: { zIndex: Lt },
657
- children: /* @__PURE__ */ x("div", { children: [
658
- /* @__PURE__ */ n(
659
- ct,
661
+ sx: { zIndex: Ot },
662
+ children: /* @__PURE__ */ m("div", { children: [
663
+ /* @__PURE__ */ i(
664
+ dt,
660
665
  {
661
- onClose: (d) => _(d, "closeAlert"),
662
- severity: F.severity,
666
+ onClose: (S) => I(S, "closeAlert"),
667
+ severity: E.severity,
663
668
  variant: "filled",
664
- icon: F.progressIndicator === "circular" ? /* @__PURE__ */ n(re, { size: "1em" }) : void 0,
665
- style: F.progressIndicator === "linear" ? Rt : void 0,
666
- children: F.message
669
+ icon: E.progressIndicator === "circular" ? /* @__PURE__ */ i(se, { size: "1em" }) : void 0,
670
+ style: E.progressIndicator === "linear" ? Ut : void 0,
671
+ children: E.message
667
672
  }
668
673
  ),
669
- F.progressIndicator === "linear" && /* @__PURE__ */ n(Te, { color: "primary" })
674
+ E.progressIndicator === "linear" && /* @__PURE__ */ i(Ne, { color: "primary" })
670
675
  ] })
671
676
  })
672
677
  )
673
678
  ] });
674
679
  }
675
- class ze extends Error {
680
+ class Ge extends Error {
676
681
  }
677
- ue(ze, "errorName", "ContextError");
678
- function Wt() {
679
- const e = it(qe);
682
+ pe(Ge, "errorName", "ContextError");
683
+ function qt() {
684
+ const e = rt(ze);
680
685
  if (e === null)
681
- throw new ze("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
686
+ throw new Ge("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
682
687
  return e;
683
688
  }
684
- const $o = yt(
685
- (e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children: i }) => /* @__PURE__ */ n(Ht, b(p({}, e), { overrideState: t, overrideActions: o, children: /* @__PURE__ */ n(N, { children: i }) }))
689
+ const Lo = bt(
690
+ (e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children: n }) => /* @__PURE__ */ i(Wt, F(u({}, e), { overrideState: t, overrideActions: o, children: /* @__PURE__ */ i(O, { children: n }) }))
686
691
  ), Ve = "domainCode";
687
- var Ie;
688
- const ke = P(
689
- JSON.parse((Ie = localStorage.getItem(Ve)) != null ? Ie : '{"domainCode": ""}').domainCode
690
- ), qt = P(
691
- (e) => e(ke),
692
+ var _e;
693
+ const De = $(
694
+ JSON.parse((_e = localStorage.getItem(Ve)) != null ? _e : '{"domainCode": ""}').domainCode
695
+ ), zt = $(
696
+ (e) => e(De),
692
697
  (e, t, o) => {
693
- t(ke, o), localStorage.setItem(Ve, JSON.stringify({ domainCode: o }));
698
+ t(De, o), localStorage.setItem(Ve, JSON.stringify({ domainCode: o }));
694
699
  }
695
- ), zt = {
700
+ ), Gt = {
696
701
  act: "ACT",
697
702
  nsw: "NSW",
698
703
  nt: "NT",
@@ -704,65 +709,65 @@ const ke = P(
704
709
  ag: "AG",
705
710
  fedmps: "FedMPs",
706
711
  "": ""
707
- }, Ge = (e) => {
712
+ }, Ke = (e) => {
708
713
  var t;
709
- return e === null ? "N/A" : (t = zt[e]) != null ? t : "";
710
- }, Lo = ({
714
+ return e === null ? "N/A" : (t = Gt[e]) != null ? t : "";
715
+ }, Oo = ({
711
716
  isLoading: e,
712
717
  isOpen: t,
713
718
  onClose: o,
714
- onDomainChange: i,
715
- domainOptions: r,
716
- applicationName: s,
717
- handleLogout: c
719
+ onDomainChange: n,
720
+ domainOptions: s,
721
+ applicationName: a,
722
+ handleLogout: p
718
723
  }) => {
719
- const [a, l] = W(qt), [u, g] = V(a), { enqueueSuccessNotification: w } = Wt(), S = r.length === 0, A = !!a && !r.includes(a) && !r.includes(u), v = !a || S || A, D = () => M(null, null, function* () {
720
- u ? (l(u), i == null || i(u), w(`Set organisation to ${u}`), o()) : (l(""), i == null || i(""));
721
- }), f = () => M(null, null, function* () {
722
- a && !S && !A ? (g(a), o()) : v && c();
724
+ const [r, c] = W(zt), [l, x] = G(r), { enqueueSuccessNotification: C } = qt(), v = s.length === 0, g = !!r && !s.includes(r) && !s.includes(l), w = !r || v || g, D = () => P(null, null, function* () {
725
+ l ? (c(l), n == null || n(l), C(`Set organisation to ${l}`), o()) : (c(""), n == null || n(""));
726
+ }), f = () => P(null, null, function* () {
727
+ r && !v && !g ? (x(r), o()) : w && p();
723
728
  });
724
729
  let k;
725
- return S ? k = "Unable to retrieve your active organisations. Try logging in again." : A && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ x(
726
- Be,
730
+ return v ? k = "Unable to retrieve your active organisations. Try logging in again." : g && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ m(
731
+ He,
727
732
  {
728
733
  isOpen: t,
729
734
  dialogTitle: "Select an organisation",
730
735
  primaryButton: {
731
736
  text: "Confirm",
732
737
  onClick: D,
733
- disabled: !u || S || A,
738
+ disabled: !l || v || g,
734
739
  buttonColor: "primary"
735
740
  },
736
741
  secondaryButton: {
737
- text: v ? "Logout" : "Cancel",
742
+ text: w ? "Logout" : "Cancel",
738
743
  onClick: f
739
744
  },
740
- onClose: v ? () => {
745
+ onClose: w ? () => {
741
746
  } : o,
742
747
  children: [
743
- /* @__PURE__ */ x(E, { marginBottom: 2, children: [
748
+ /* @__PURE__ */ m(_, { marginBottom: 2, children: [
744
749
  "Select the default organisation that you want to use with the ",
745
- s,
750
+ a,
746
751
  "."
747
752
  ] }),
748
- /* @__PURE__ */ n(
749
- ne,
753
+ /* @__PURE__ */ i(
754
+ ie,
750
755
  {
751
756
  loading: e,
752
757
  multiple: !1,
753
758
  disableClearable: !1,
754
- value: u !== "" ? u : null,
755
- onChange: (y, _) => g(_ != null ? _ : ""),
756
- getOptionLabel: Ge,
757
- options: [...r.toSorted()],
758
- renderInput: (y) => /* @__PURE__ */ n(
759
- ie,
760
- b(p({}, y), {
759
+ value: l !== "" ? l : null,
760
+ onChange: (y, I) => x(I != null ? I : ""),
761
+ getOptionLabel: Ke,
762
+ options: [...s.toSorted()],
763
+ renderInput: (y) => /* @__PURE__ */ i(
764
+ re,
765
+ F(u({}, y), {
761
766
  variant: "filled",
762
767
  label: "Select organisation",
763
- InputProps: b(p({}, y.InputProps), {
764
- endAdornment: /* @__PURE__ */ x(N, { children: [
765
- e ? /* @__PURE__ */ n(re, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
768
+ InputProps: F(u({}, y.InputProps), {
769
+ endAdornment: /* @__PURE__ */ m(O, { children: [
770
+ e ? /* @__PURE__ */ i(se, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
766
771
  y.InputProps.endAdornment
767
772
  ] })
768
773
  })
@@ -770,36 +775,36 @@ const ke = P(
770
775
  )
771
776
  }
772
777
  ),
773
- k && /* @__PURE__ */ n(dt, { error: !0, children: k })
778
+ k && /* @__PURE__ */ i(ut, { error: !0, children: k })
774
779
  ]
775
780
  }
776
781
  );
777
- }, Ke = () => {
778
- const e = J();
779
- return ut(e.breakpoints.down("sm"));
780
- }, Vt = 64, Gt = 72, Kt = 256, Q = P(!0), Xt = P(Kt), Yt = P(Gt), De = P(""), Qt = P(void 0), Jt = P(Vt), Zt = P(void 0);
781
- function jt({ links: e }) {
782
- return /* @__PURE__ */ n("div", { children: "LinksMenu not implemented yet" });
782
+ }, Xe = () => {
783
+ const e = Z();
784
+ return pt(e.breakpoints.down("sm"));
785
+ }, Vt = 64, Kt = 72, Xt = 256, J = $(!0), Yt = $(Xt), Qt = $(Kt), ye = $(""), Jt = $(void 0), Zt = $(Vt), jt = $(void 0);
786
+ function eo({ links: e }) {
787
+ return /* @__PURE__ */ i("div", { children: "LinksMenu not implemented yet" });
783
788
  }
784
- const X = "Navbar", G = {
785
- root: `${X}-root`,
786
- menuButton: `${X}-menuButton`,
787
- hide: `${X}-hide`,
788
- content: `${X}-content`
789
+ const Y = "Navbar", K = {
790
+ root: `${Y}-root`,
791
+ menuButton: `${Y}-menuButton`,
792
+ hide: `${Y}-hide`,
793
+ content: `${Y}-content`
789
794
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
790
795
  // settings: `${PREFIX}-settings`,
791
796
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
792
- }, eo = Re(I, { name: "NavBar" })(({ theme: e }) => ({
793
- [`&.${G.root}`]: {
797
+ }, to = Ue(M, { name: "NavBar" })(({ theme: e }) => ({
798
+ [`&.${K.root}`]: {
794
799
  display: "flex"
795
800
  },
796
- [`& .${G.menuButton}`]: {
801
+ [`& .${K.menuButton}`]: {
797
802
  marginRight: 36
798
803
  },
799
- [`& .${G.hide}`]: {
804
+ [`& .${K.hide}`]: {
800
805
  display: "none"
801
806
  },
802
- [`& .${G.content}`]: {
807
+ [`& .${K.content}`]: {
803
808
  flexGrow: 1,
804
809
  padding: e.spacing(3)
805
810
  }
@@ -811,11 +816,11 @@ const X = "Navbar", G = {
811
816
  })), q = (e, t, o) => e.transitions.create(t, {
812
817
  easing: e.transitions.easing.sharp,
813
818
  duration: o === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
814
- }), to = (e) => {
815
- const t = J();
816
- return /* @__PURE__ */ n(
817
- ht,
818
- p({
819
+ }), oo = (e) => {
820
+ const t = Z();
821
+ return /* @__PURE__ */ i(
822
+ ft,
823
+ u({
819
824
  easing: t.transitions.easing.sharp,
820
825
  timeout: {
821
826
  enter: t.transitions.duration.enteringScreen,
@@ -823,7 +828,7 @@ const X = "Navbar", G = {
823
828
  }
824
829
  }, e)
825
830
  );
826
- }, Xe = (e) => {
831
+ }, Ye = (e) => {
827
832
  var t, o;
828
833
  return {
829
834
  overflowX: "hidden",
@@ -831,104 +836,104 @@ const X = "Navbar", G = {
831
836
  backgroundColor: (o = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? o : "white"
832
837
  // Provide default so tests don't need to wrap theme provider
833
838
  };
834
- }, ye = (e, t) => p({
839
+ }, be = (e, t) => u({
835
840
  width: t,
836
841
  transition: q(e, "width", "entering")
837
- }, Xe(e)), be = (e, t) => p({
842
+ }, Ye(e)), Fe = (e, t) => u({
838
843
  width: t,
839
844
  transition: q(e, "width", "leaving")
840
- }, Xe(e)), oo = Re(pt, {
845
+ }, Ye(e)), no = Ue(ht, {
841
846
  shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
842
- })(({ theme: e, open: t, widthOpen: o, widthClosed: i, isSmallScreen: r }) => p(p({
847
+ })(({ theme: e, open: t, widthOpen: o, widthClosed: n, isSmallScreen: s }) => u(u({
843
848
  flexShrink: 0,
844
849
  whiteSpace: "nowrap",
845
850
  boxSizing: "border-box",
846
851
  display: "flex",
847
852
  flexDirection: "column"
848
- }, t && b(p({}, ye(e, o)), {
853
+ }, t && F(u({}, be(e, o)), {
849
854
  backgroundColor: "",
850
- "& .MuiDrawer-paper": ye(e, o)
851
- })), !t && b(p({}, be(e, r ? o : i)), {
855
+ "& .MuiDrawer-paper": be(e, o)
856
+ })), !t && F(u({}, Fe(e, s ? o : n)), {
852
857
  backgroundColor: "",
853
- "& .MuiDrawer-paper": be(e, r ? o : i)
858
+ "& .MuiDrawer-paper": Fe(e, s ? o : n)
854
859
  })));
855
- function Ye(e) {
860
+ function Qe(e) {
856
861
  return e.replace(
857
862
  /(^|-)([a-z])/g,
858
- (t, o, i) => o === "-" ? " " + i.toUpperCase() : i.toUpperCase()
863
+ (t, o, n) => o === "-" ? " " + n.toUpperCase() : n.toUpperCase()
859
864
  );
860
865
  }
861
- function Oo(e, t, o, i) {
862
- var c;
866
+ function Ro(e, t, o, n) {
867
+ var p;
863
868
  if (!e) return "None";
864
- const s = Object.entries(e).filter(
865
- ([a, l]) => a.startsWith("https://greens.org.au/roles/") && l.includes(t)
869
+ const a = Object.entries(e).filter(
870
+ ([r, c]) => r.startsWith("https://greens.org.au/roles/") && c.includes(t)
866
871
  ).map(
867
- ([a]) => {
868
- var l;
869
- return Ye((l = a.split("/").at(-1)) != null ? l : "");
872
+ ([r]) => {
873
+ var c;
874
+ return Qe((c = r.split("/").at(-1)) != null ? c : "");
870
875
  }
871
876
  );
872
- return (c = i.find(
873
- (a) => o[a].some((l) => s.includes(l))
874
- )) != null ? c : "None";
877
+ return (p = n.find(
878
+ (r) => o[r].some((c) => a.includes(c))
879
+ )) != null ? p : "None";
875
880
  }
876
- const Ro = (e) => {
881
+ const Uo = (e) => {
877
882
  const { getIdTokenClaims: t, user: o } = ae();
878
- return Le({
883
+ return Oe({
879
884
  queryKey: ["availableDomains", o == null ? void 0 : o.sub],
880
- queryFn: () => M(null, null, function* () {
881
- const i = yield t();
882
- return i ? Object.entries(i).reduce((r, [s, c]) => {
883
- var u;
884
- const a = Ye((u = s.split("/").at(-1)) != null ? u : ""), l = s.startsWith("https://greens.org.au/roles/") && e.includes(a) ? c : [];
885
- return [.../* @__PURE__ */ new Set([...r, ...l])];
885
+ queryFn: () => P(null, null, function* () {
886
+ const n = yield t();
887
+ return n ? Object.entries(n).reduce((s, [a, p]) => {
888
+ var l;
889
+ const r = Qe((l = a.split("/").at(-1)) != null ? l : ""), c = a.startsWith("https://greens.org.au/roles/") && e.includes(r) ? p : [];
890
+ return [.../* @__PURE__ */ new Set([...s, ...c])];
886
891
  }, []) : [];
887
892
  })
888
893
  });
889
- }, Uo = (e) => Object.values(e).reduce(
894
+ }, Bo = (e) => Object.values(e).reduce(
890
895
  (t, o) => [.../* @__PURE__ */ new Set([...t, ...o])],
891
896
  []
892
- ), Y = {
897
+ ), Q = {
893
898
  log: console.warn.bind(console),
894
899
  error: console.error.bind(console),
895
900
  warn: console.warn.bind(console),
896
901
  info: console.info.bind(console),
897
902
  debug: console.debug.bind(console)
898
903
  };
899
- function Bo(e, t) {
904
+ function Ho(e, t) {
900
905
  console[e] = (...o) => {
901
- for (const i of t)
902
- if (typeof i == "function") {
903
- if (i(...o)) return;
904
- } else if (i instanceof RegExp && o.length > 0) {
905
- for (const r of o)
906
- if (typeof r == "string" && i.test(r))
906
+ for (const n of t)
907
+ if (typeof n == "function") {
908
+ if (n(...o)) return;
909
+ } else if (n instanceof RegExp && o.length > 0) {
910
+ for (const s of o)
911
+ if (typeof s == "string" && n.test(s))
907
912
  return;
908
913
  }
909
- Y[e](o);
914
+ Q[e](o);
910
915
  };
911
916
  }
912
- function Ho(e) {
917
+ function Wo(e) {
913
918
  if (e)
914
- console[e] = Y[e];
919
+ console[e] = Q[e];
915
920
  else
916
- for (const t of Object.keys(Y))
917
- console[t] = Y[t];
921
+ for (const t of Object.keys(Q))
922
+ console[t] = Q[t];
918
923
  }
919
- function no(e) {
924
+ function io(e) {
920
925
  let t = 0;
921
- for (let o = 0, i = e.length; o < i; o++) {
922
- const r = e.charCodeAt(o);
923
- t = (t << 5) - t + r, t |= 0;
926
+ for (let o = 0, n = e.length; o < n; o++) {
927
+ const s = e.charCodeAt(o);
928
+ t = (t << 5) - t + s, t |= 0;
924
929
  }
925
930
  return t;
926
931
  }
927
- const Fe = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Ee = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
928
- function io({ user: e, domainCode: t, open: o, useNewAvatar: i = !1 }) {
929
- const r = J();
930
- return /* @__PURE__ */ x(
931
- I,
932
+ const Ee = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Ie = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
933
+ function ro({ user: e, domainCode: t, open: o, useNewAvatar: n = !1 }) {
934
+ const s = Z();
935
+ return /* @__PURE__ */ m(
936
+ M,
932
937
  {
933
938
  sx: {
934
939
  paddingTop: 3,
@@ -938,91 +943,91 @@ function io({ user: e, domainCode: t, open: o, useNewAvatar: i = !1 }) {
938
943
  gap: "0.5rem"
939
944
  },
940
945
  children: [
941
- !i && /* @__PURE__ */ n(
942
- I,
946
+ !n && /* @__PURE__ */ i(
947
+ M,
943
948
  {
944
949
  sx: {
945
950
  width: o ? "5rem" : "2rem",
946
- transition: o ? q(r, ["width", "height"], "entering") : q(r, ["width", "height"], "leaving"),
951
+ transition: o ? q(s, ["width", "height"], "entering") : q(s, ["width", "height"], "leaving"),
947
952
  aspectRatio: 1
948
953
  },
949
- children: e != null && e.name ? /* @__PURE__ */ n(N, { children: /* @__PURE__ */ n(
950
- fe,
954
+ children: e != null && e.name ? /* @__PURE__ */ i(O, { children: /* @__PURE__ */ i(
955
+ me,
951
956
  {
952
957
  src: e == null ? void 0 : e.picture,
953
958
  sx: {
954
959
  width: "100%",
955
960
  height: "100%",
956
- bgcolor: Fe[Math.abs(no(e == null ? void 0 : e.name)) % Fe.length]
961
+ bgcolor: Ee[Math.abs(io(e == null ? void 0 : e.name)) % Ee.length]
957
962
  },
958
- children: Ee(e == null ? void 0 : e.name)
963
+ children: Ie(e == null ? void 0 : e.name)
959
964
  }
960
- ) }) : /* @__PURE__ */ n(fe, { sx: { width: "100%", height: "100%" } })
965
+ ) }) : /* @__PURE__ */ i(me, { sx: { width: "100%", height: "100%" } })
961
966
  }
962
967
  ),
963
- i && /* @__PURE__ */ n(
964
- I,
968
+ n && /* @__PURE__ */ i(
969
+ M,
965
970
  {
966
971
  sx: {
967
972
  width: o ? "5rem" : "2rem",
968
- transition: o ? q(r, ["width", "height"], "entering") : q(r, ["width", "height"], "leaving"),
973
+ transition: o ? q(s, ["width", "height"], "entering") : q(s, ["width", "height"], "leaving"),
969
974
  aspectRatio: 1
970
975
  },
971
- children: e != null && e.name ? /* @__PURE__ */ n(N, { children: /* @__PURE__ */ x(Ce, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: o ? "80" : "32", children: [
976
+ children: e != null && e.name ? /* @__PURE__ */ i(O, { children: /* @__PURE__ */ m(Se, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: o ? "80" : "32", children: [
972
977
  " ",
973
- Ee(e == null ? void 0 : e.name),
978
+ Ie(e == null ? void 0 : e.name),
974
979
  " ",
975
980
  "ab"
976
- ] }) }) : /* @__PURE__ */ n(Ce, {})
981
+ ] }) }) : /* @__PURE__ */ i(Se, {})
977
982
  }
978
983
  ),
979
- /* @__PURE__ */ n(to, { sx: { width: "100%" }, in: o, children: /* @__PURE__ */ n(ft, { in: o, children: /* @__PURE__ */ x(I, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
980
- e != null && e.name ? /* @__PURE__ */ n(E, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ n(me, { animation: !1, width: "50%" }),
981
- t ? /* @__PURE__ */ n(E, { children: Ge(t) }) : /* @__PURE__ */ n(me, { animation: !1, width: "25%" })
984
+ /* @__PURE__ */ i(oo, { sx: { width: "100%" }, in: o, children: /* @__PURE__ */ i(mt, { in: o, children: /* @__PURE__ */ m(M, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
985
+ e != null && e.name ? /* @__PURE__ */ i(_, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ i(ge, { animation: !1, width: "50%" }),
986
+ t ? /* @__PURE__ */ i(_, { children: Ke(t) }) : /* @__PURE__ */ i(ge, { animation: !1, width: "25%" })
982
987
  ] }) }) })
983
988
  ]
984
989
  }
985
990
  );
986
991
  }
987
- function ro({
992
+ function so({
988
993
  open: e,
989
994
  widthClosed: t,
990
995
  widthOpen: o,
991
- "data-testid": i,
992
- top: r,
993
- middle: s,
994
- bottom: c,
995
- user: a,
996
- domainCode: l,
997
- useNewAvatar: u = !1
996
+ "data-testid": n,
997
+ top: s,
998
+ middle: a,
999
+ bottom: p,
1000
+ user: r,
1001
+ domainCode: c,
1002
+ useNewAvatar: l = !1
998
1003
  }) {
999
- const g = Ke(), w = Oe(Q);
1000
- return /* @__PURE__ */ n(eo, { className: G.root, "data-testid": i, children: /* @__PURE__ */ x(
1001
- oo,
1004
+ const x = Xe(), C = Re(J);
1005
+ return /* @__PURE__ */ i(to, { className: K.root, "data-testid": n, children: /* @__PURE__ */ m(
1006
+ no,
1002
1007
  {
1003
1008
  open: e,
1004
1009
  widthOpen: o,
1005
1010
  widthClosed: t,
1006
1011
  anchor: "left",
1007
- variant: g ? "temporary" : "permanent",
1012
+ variant: x ? "temporary" : "permanent",
1008
1013
  PaperProps: {
1009
1014
  component: "nav"
1010
1015
  },
1011
1016
  onClose: () => {
1012
- w(!1);
1017
+ C(!1);
1013
1018
  },
1014
- isSmallScreen: g,
1019
+ isSmallScreen: x,
1015
1020
  children: [
1016
- !g && /* @__PURE__ */ n(mt, {}),
1017
- r && /* @__PURE__ */ x(I, { flexGrow: "0", children: [
1018
- r,
1019
- /* @__PURE__ */ n(ge, { variant: "middle", sx: { marginY: "0.5rem" } })
1021
+ !x && /* @__PURE__ */ i(gt, {}),
1022
+ s && /* @__PURE__ */ m(M, { flexGrow: "0", children: [
1023
+ s,
1024
+ /* @__PURE__ */ i(xe, { variant: "middle", sx: { marginY: "0.5rem" } })
1020
1025
  ] }),
1021
- /* @__PURE__ */ n(I, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ n(jt, { links: s }) : s }),
1022
- /* @__PURE__ */ x(I, { flexGrow: "0", children: [
1023
- /* @__PURE__ */ n(ge, { variant: "middle", sx: { marginY: "0.5rem" } }),
1024
- /* @__PURE__ */ n(io, { user: a, domainCode: l, open: e, useNewAvatar: u }),
1025
- c && /* @__PURE__ */ n(N, { children: c })
1026
+ /* @__PURE__ */ i(M, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ i(eo, { links: a }) : a }),
1027
+ /* @__PURE__ */ m(M, { flexGrow: "0", children: [
1028
+ /* @__PURE__ */ i(xe, { variant: "middle", sx: { marginY: "0.5rem" } }),
1029
+ /* @__PURE__ */ i(ro, { user: r, domainCode: c, open: e, useNewAvatar: l }),
1030
+ p && /* @__PURE__ */ i(O, { children: p })
1026
1031
  ] })
1027
1032
  ]
1028
1033
  }
@@ -1032,18 +1037,18 @@ function ao({
1032
1037
  children: e,
1033
1038
  topBarHeight: t,
1034
1039
  maxWidth: o = !1,
1035
- noPadding: i
1040
+ noPadding: n
1036
1041
  }) {
1037
- return /* @__PURE__ */ n(
1038
- I,
1042
+ return /* @__PURE__ */ i(
1043
+ M,
1039
1044
  {
1040
1045
  sx: {
1041
1046
  overflow: "auto",
1042
1047
  height: `calc(100vh - ${t}px)`,
1043
1048
  flexGrow: 1
1044
1049
  },
1045
- children: i ? /* @__PURE__ */ n(I, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ n(
1046
- gt,
1050
+ children: n ? /* @__PURE__ */ i(M, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ i(
1051
+ xt,
1047
1052
  {
1048
1053
  component: "main",
1049
1054
  id: "main-content",
@@ -1055,18 +1060,18 @@ function ao({
1055
1060
  }
1056
1061
  );
1057
1062
  }
1058
- const so = "TopBar", lo = {
1059
- titleText: `${so}-titleText`
1063
+ const lo = "TopBar", co = {
1064
+ titleText: `${lo}-titleText`
1060
1065
  };
1061
- function co({
1066
+ function uo({
1062
1067
  titleText: e = "",
1063
1068
  height: t,
1064
1069
  "data-testid": o,
1065
- middle: i
1070
+ middle: n
1066
1071
  }) {
1067
- const r = Oe(Q), s = () => r((l) => !l), c = J(), a = Ke();
1068
- return /* @__PURE__ */ n("header", { "data-testid": o, children: /* @__PURE__ */ x(
1069
- _e,
1072
+ const s = Re(J), a = () => s((c) => !c), p = Z(), r = Xe();
1073
+ return /* @__PURE__ */ i("header", { "data-testid": o, children: /* @__PURE__ */ m(
1074
+ Me,
1070
1075
  {
1071
1076
  square: !0,
1072
1077
  elevation: 0,
@@ -1080,85 +1085,85 @@ function co({
1080
1085
  gap: 2,
1081
1086
  flexShrink: 0,
1082
1087
  height: t,
1083
- zIndex: a ? 0 : c.zIndex.drawer + 101
1088
+ zIndex: r ? 0 : p.zIndex.drawer + 101
1084
1089
  },
1085
1090
  children: [
1086
- /* @__PURE__ */ n(
1087
- xt,
1091
+ /* @__PURE__ */ i(
1092
+ At,
1088
1093
  {
1089
1094
  size: "medium",
1090
1095
  color: "inherit",
1091
1096
  sx: { padding: 1.5, marginLeft: "12px" },
1092
- onClick: s,
1093
- children: /* @__PURE__ */ n(St, { fontSize: "medium" })
1097
+ onClick: a,
1098
+ children: /* @__PURE__ */ i(vt, { fontSize: "medium" })
1094
1099
  }
1095
1100
  ),
1096
- /* @__PURE__ */ n(E, { className: lo.titleText, variant: "h6", component: "h1", children: e }),
1097
- i
1101
+ /* @__PURE__ */ i(_, { className: co.titleText, variant: "h6", component: "h1", children: e }),
1102
+ n
1098
1103
  ]
1099
1104
  }
1100
1105
  ) });
1101
1106
  }
1102
- function Wo({
1107
+ function qo({
1103
1108
  children: e,
1104
1109
  initialTitleText: t,
1105
1110
  initialNavBarOpen: o,
1106
- pageContainerProps: i,
1107
- pageContentDataTestId: r,
1108
- topBarDataTestId: s,
1109
- navBarDataTestId: c,
1110
- navBarMiddle: a,
1111
- navBarBottom: l,
1112
- user: u,
1113
- domainCode: g,
1114
- useNewAvatar: w = !1
1111
+ pageContainerProps: n,
1112
+ pageContentDataTestId: s,
1113
+ topBarDataTestId: a,
1114
+ navBarDataTestId: p,
1115
+ navBarMiddle: r,
1116
+ navBarBottom: c,
1117
+ user: l,
1118
+ domainCode: x,
1119
+ useNewAvatar: C = !1
1115
1120
  }) {
1116
- Ft([
1117
- [Q, o != null ? o : !0],
1118
- [De, t != null ? t : ""]
1121
+ Et([
1122
+ [J, o != null ? o : !0],
1123
+ [ye, t != null ? t : ""]
1119
1124
  ]);
1120
- const S = xe(Q), [A] = W(Xt), [v] = W(Yt), D = xe(De), [f] = W(Jt), [k] = W(Qt), [y] = W(Zt);
1121
- return /* @__PURE__ */ x(Ae, { children: [
1122
- /* @__PURE__ */ n(bt, {}),
1123
- /* @__PURE__ */ n(
1124
- co,
1125
+ const v = Ae(J), [g] = W(Yt), [w] = W(Qt), D = Ae(ye), [f] = W(Zt), [k] = W(Jt), [y] = W(jt);
1126
+ return /* @__PURE__ */ m(Ce, { children: [
1127
+ /* @__PURE__ */ i(Ft, {}),
1128
+ /* @__PURE__ */ i(
1129
+ uo,
1125
1130
  {
1126
1131
  titleText: D,
1127
- "data-testid": s,
1132
+ "data-testid": a,
1128
1133
  height: f,
1129
1134
  middle: k
1130
1135
  }
1131
1136
  ),
1132
- /* @__PURE__ */ x(Ae, { sx: { display: "flex" }, children: [
1133
- /* @__PURE__ */ n(
1134
- ro,
1137
+ /* @__PURE__ */ m(Ce, { sx: { display: "flex" }, children: [
1138
+ /* @__PURE__ */ i(
1139
+ so,
1135
1140
  {
1136
- open: S,
1141
+ open: v,
1137
1142
  top: y,
1138
- middle: a,
1139
- bottom: l,
1140
- user: u,
1141
- domainCode: g,
1142
- widthOpen: A,
1143
- widthClosed: v,
1143
+ middle: r,
1144
+ bottom: c,
1145
+ user: l,
1146
+ domainCode: x,
1147
+ widthOpen: g,
1148
+ widthClosed: w,
1144
1149
  offsetTop: f,
1145
- "data-testid": c,
1146
- useNewAvatar: w
1150
+ "data-testid": p,
1151
+ useNewAvatar: C
1147
1152
  }
1148
1153
  ),
1149
- /* @__PURE__ */ n(
1154
+ /* @__PURE__ */ i(
1150
1155
  ao,
1151
- b(p({
1152
- "data-testid": r,
1156
+ F(u({
1157
+ "data-testid": s,
1153
1158
  topBarHeight: f
1154
- }, i), {
1159
+ }, n), {
1155
1160
  children: e
1156
1161
  })
1157
1162
  )
1158
1163
  ] })
1159
1164
  ] });
1160
1165
  }
1161
- const qo = Ue({
1166
+ const zo = Be({
1162
1167
  palette: {
1163
1168
  primary: {
1164
1169
  dark: "#00A651",
@@ -1209,7 +1214,7 @@ const qo = Ue({
1209
1214
  navBar: {
1210
1215
  backgroundColor: "#E8E8E8"
1211
1216
  }
1212
- }), zo = Ue({
1217
+ }), Go = Be({
1213
1218
  palette: {
1214
1219
  primary: {
1215
1220
  main: "#007236",
@@ -1263,18 +1268,18 @@ const qo = Ue({
1263
1268
  styleOverrides: {
1264
1269
  root: ({ theme: e }) => ({
1265
1270
  "&.Mui-selected": {
1266
- backgroundColor: te(
1271
+ backgroundColor: oe(
1267
1272
  e.palette.secondary.main,
1268
1273
  e.palette.action.selectedOpacity
1269
1274
  ),
1270
1275
  "&:hover": {
1271
- backgroundColor: te(
1276
+ backgroundColor: oe(
1272
1277
  e.palette.secondary.main,
1273
1278
  e.palette.action.selectedOpacity
1274
1279
  )
1275
1280
  },
1276
1281
  "&.Mui-focusVisible": {
1277
- backgroundColor: te(
1282
+ backgroundColor: oe(
1278
1283
  e.palette.secondary.main,
1279
1284
  e.palette.action.focusOpacity
1280
1285
  )
@@ -1305,39 +1310,39 @@ const qo = Ue({
1305
1310
  }
1306
1311
  });
1307
1312
  export {
1308
- Be as AgDialog,
1309
- Wo as AppLayout,
1310
- No as AuthGuard,
1311
- qe as Context,
1312
- ze as ContextError,
1313
- zt as DOMAIN_CODE_LABELS,
1314
- Lo as DomainCodeDialog,
1315
- Io as ExampleComponent,
1316
- _o as FetchAutocomplete,
1317
- Mo as MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX,
1318
- Ht as SaladBarProvider,
1319
- Po as SessionExpiryDialog,
1320
- To as SingleAutocomplete,
1321
- Oo as determineUserLevelFromClaims,
1322
- qt as domainCodeAtom,
1323
- qo as fed21Theme,
1324
- It as getAuth0Expiry,
1325
- Ge as getDomainOptionLabel,
1326
- Uo as getValidBusinessRoles,
1327
- zo as internalAgSystemsTheme,
1328
- Q as navBarOpenAtom,
1329
- Zt as navBarTopAtom,
1330
- Yt as navBarWidthClosedAtom,
1331
- Xt as navBarWidthOpenAtom,
1332
- no as simpleHashCode,
1333
- Bo as suppressConsole,
1334
- De as titleTextAtom,
1335
- Jt as topBarHeightAtom,
1336
- Qt as topBarMiddleAtom,
1337
- Ho as unsuppressConsole,
1338
- We as useAutocompleteOptions,
1339
- Wt as useSaladBar,
1340
- Ro as useValidDomains,
1341
- $o as withSaladBarProvider
1313
+ He as AgDialog,
1314
+ qo as AppLayout,
1315
+ $o as AuthGuard,
1316
+ ze as Context,
1317
+ Ge as ContextError,
1318
+ Gt as DOMAIN_CODE_LABELS,
1319
+ Oo as DomainCodeDialog,
1320
+ _o as ExampleComponent,
1321
+ Mo as FetchAutocomplete,
1322
+ Po as MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX,
1323
+ Wt as SaladBarProvider,
1324
+ To as SessionExpiryDialog,
1325
+ No as SingleAutocomplete,
1326
+ Ro as determineUserLevelFromClaims,
1327
+ zt as domainCodeAtom,
1328
+ zo as fed21Theme,
1329
+ _t as getAuth0Expiry,
1330
+ Ke as getDomainOptionLabel,
1331
+ Bo as getValidBusinessRoles,
1332
+ Go as internalAgSystemsTheme,
1333
+ J as navBarOpenAtom,
1334
+ jt as navBarTopAtom,
1335
+ Qt as navBarWidthClosedAtom,
1336
+ Yt as navBarWidthOpenAtom,
1337
+ io as simpleHashCode,
1338
+ Ho as suppressConsole,
1339
+ ye as titleTextAtom,
1340
+ Zt as topBarHeightAtom,
1341
+ Jt as topBarMiddleAtom,
1342
+ Wo as unsuppressConsole,
1343
+ qe as useAutocompleteOptions,
1344
+ qt as useSaladBar,
1345
+ Uo as useValidDomains,
1346
+ Lo as withSaladBarProvider
1342
1347
  };
1343
1348
  //# sourceMappingURL=index.js.map