@australiangreens/ag-internal-components 0.3.18 → 0.3.19

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