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