@australiangreens/ag-internal-components 0.3.0 → 0.3.1
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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/domainCode/DomainCodeDialog.d.ts +3 -2
- package/dist/domainCode/DomainCodeDialog.d.ts.map +1 -1
- package/dist/esm/index.js +120 -118
- package/dist/esm/index.js.map +1 -1
- package/dist/layouts/AppLayout/NavBar/UserInfo.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ve = Object.defineProperty, Ke = Object.defineProperties;
|
|
2
|
+
var Xe = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var q = Object.getOwnPropertySymbols;
|
|
4
4
|
var ie = Object.prototype.hasOwnProperty, re = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var Y = (e, t, n) => t in e ?
|
|
5
|
+
var Y = (e, t, n) => t in e ? Ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, u = (e, t) => {
|
|
6
6
|
for (var n in t || (t = {}))
|
|
7
7
|
ie.call(t, n) && Y(e, n, t[n]);
|
|
8
8
|
if (q)
|
|
9
9
|
for (var n of q(t))
|
|
10
10
|
re.call(t, n) && Y(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
|
-
}, E = (e, t) =>
|
|
12
|
+
}, E = (e, t) => Ke(e, Xe(t));
|
|
13
13
|
var ae = (e, t) => {
|
|
14
14
|
var n = {};
|
|
15
15
|
for (var i in e)
|
|
@@ -37,24 +37,24 @@ var N = (e, t, n) => new Promise((i, r) => {
|
|
|
37
37
|
a((n = n.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
39
|
import { jsxs as f, Fragment as $, jsx as o } from "react/jsx-runtime";
|
|
40
|
-
import { useState as
|
|
41
|
-
import { Typography as _, Button as U, Paper as be, Dialog as Fe, LinearProgress as Ee, DialogTitle as Ie, DialogContent as _e, DialogActions as Te, Autocomplete as j, TextField as ee, CircularProgress as te, Box as T, Chip as
|
|
42
|
-
import { Cancel as
|
|
43
|
-
import
|
|
44
|
-
import
|
|
40
|
+
import { useState as O, createElement as Z, useEffect as le, useMemo as Ye, createContext as Qe, useRef as Q, useCallback as ce, useContext as Je } from "react";
|
|
41
|
+
import { Typography as _, Button as U, Paper as be, Dialog as Fe, LinearProgress as Ee, DialogTitle as Ie, DialogContent as _e, DialogActions as Te, Autocomplete as j, TextField as ee, CircularProgress as te, Box as T, Chip as Ze, Tooltip as je, Stack as et, Snackbar as tt, Alert as nt, FormHelperText as ot, useTheme as K, useMediaQuery as it, Drawer as rt, Collapse as at, Avatar as de, Fade as st, Skeleton as ue, Toolbar as lt, Divider as pe, Container as ct, IconButton as dt } from "@mui/material";
|
|
42
|
+
import { Cancel as ut, ArrowDropDown as pt, ViewHeadline as ht } from "@mui/icons-material";
|
|
43
|
+
import mt from "autosuggest-highlight/match";
|
|
44
|
+
import ft from "autosuggest-highlight/parse";
|
|
45
45
|
import { useQuery as Ne } from "@tanstack/react-query";
|
|
46
46
|
import { useAuth0 as ne } from "@auth0/auth0-react";
|
|
47
|
-
import { Buffer as
|
|
48
|
-
import
|
|
49
|
-
import { atom as P, useAtom as
|
|
50
|
-
import { createHelper as
|
|
51
|
-
import
|
|
47
|
+
import { Buffer as gt } from "buffer";
|
|
48
|
+
import xt from "@mui/material/Skeleton";
|
|
49
|
+
import { atom as P, useAtom as R, useSetAtom as Pe, useAtomValue as he } from "jotai";
|
|
50
|
+
import { createHelper as At } from "souvlaki";
|
|
51
|
+
import Ct from "@mui/material/CssBaseline";
|
|
52
52
|
import me from "@mui/material/Box";
|
|
53
|
-
import { useHydrateAtoms as
|
|
53
|
+
import { useHydrateAtoms as vt } from "jotai/utils";
|
|
54
54
|
import { styled as $e, createTheme as Me, alpha as J } from "@mui/material/styles";
|
|
55
55
|
import fe from "react-avatar";
|
|
56
56
|
function Sn({ text: e }) {
|
|
57
|
-
const [t, n] =
|
|
57
|
+
const [t, n] = O(0);
|
|
58
58
|
return /* @__PURE__ */ f($, { children: [
|
|
59
59
|
/* @__PURE__ */ o(_, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
60
60
|
/* @__PURE__ */ o(_, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
@@ -77,7 +77,7 @@ function Sn({ text: e }) {
|
|
|
77
77
|
] })
|
|
78
78
|
] });
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const Le = ({
|
|
81
81
|
isOpen: e,
|
|
82
82
|
dialogTitle: t,
|
|
83
83
|
children: n,
|
|
@@ -92,7 +92,7 @@ const Re = ({
|
|
|
92
92
|
isLoading: y = !1
|
|
93
93
|
}) => {
|
|
94
94
|
var w, D;
|
|
95
|
-
const [v, g] =
|
|
95
|
+
const [v, g] = O(!1);
|
|
96
96
|
return /* @__PURE__ */ f(
|
|
97
97
|
Fe,
|
|
98
98
|
{
|
|
@@ -150,7 +150,7 @@ const Re = ({
|
|
|
150
150
|
]
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
|
-
},
|
|
153
|
+
}, Re = ({
|
|
154
154
|
minLength: e,
|
|
155
155
|
preLoadedOptions: t,
|
|
156
156
|
lookup: n,
|
|
@@ -177,23 +177,23 @@ function wn({
|
|
|
177
177
|
textFieldVariant: m = "filled",
|
|
178
178
|
loadingText: y = "Loading...",
|
|
179
179
|
noOptionsText: v = "No options",
|
|
180
|
-
popupIcon: g = /* @__PURE__ */ o(
|
|
180
|
+
popupIcon: g = /* @__PURE__ */ o(pt, {}),
|
|
181
181
|
error: w = !1,
|
|
182
182
|
helperText: D = "",
|
|
183
183
|
preLoadedOptions: p = void 0,
|
|
184
184
|
disablePortal: k = !1,
|
|
185
185
|
disableIconFlip: b = !1
|
|
186
186
|
}) {
|
|
187
|
-
const [I,
|
|
187
|
+
const [I, H] = O(""), M = (h, A) => {
|
|
188
188
|
const C = s.filter((S) => S.id !== A);
|
|
189
189
|
n(C, "delete", h);
|
|
190
|
-
}, { data: x, isLoading: F } =
|
|
190
|
+
}, { data: x, isLoading: F } = Re({
|
|
191
191
|
inputValue: I,
|
|
192
192
|
label: r,
|
|
193
193
|
lookup: e,
|
|
194
194
|
minLength: i,
|
|
195
195
|
preLoadedOptions: p
|
|
196
|
-
}),
|
|
196
|
+
}), L = I.length >= i;
|
|
197
197
|
return /* @__PURE__ */ f("div", { "data-testid": c, children: [
|
|
198
198
|
/* @__PURE__ */ o(
|
|
199
199
|
j,
|
|
@@ -203,7 +203,7 @@ function wn({
|
|
|
203
203
|
disablePortal: k,
|
|
204
204
|
multiple: !0,
|
|
205
205
|
getOptionLabel: (h) => typeof h == "string" ? h : h.label,
|
|
206
|
-
loading:
|
|
206
|
+
loading: L ? F : !1,
|
|
207
207
|
options: [...s, ...x != null ? x : []],
|
|
208
208
|
filterSelectedOptions: !0,
|
|
209
209
|
includeInputInList: !0,
|
|
@@ -211,8 +211,8 @@ function wn({
|
|
|
211
211
|
onChange: (h, A, C) => {
|
|
212
212
|
n(A, C, h);
|
|
213
213
|
},
|
|
214
|
-
onInputChange: (h, A) =>
|
|
215
|
-
noOptionsText:
|
|
214
|
+
onInputChange: (h, A) => H(A),
|
|
215
|
+
noOptionsText: L ? v : "Start typing to search",
|
|
216
216
|
loadingText: y,
|
|
217
217
|
popupIcon: g,
|
|
218
218
|
renderInput: (h) => /* @__PURE__ */ o(
|
|
@@ -240,17 +240,17 @@ function wn({
|
|
|
240
240
|
isOptionEqualToValue: (h, A) => h.id === A.id,
|
|
241
241
|
renderOption: (h, A, C) => {
|
|
242
242
|
if (t) {
|
|
243
|
-
const S =
|
|
243
|
+
const S = mt(A.label, C.inputValue, {
|
|
244
244
|
insideWords: !0,
|
|
245
245
|
findAllOccurrences: !0
|
|
246
|
-
}), X =
|
|
246
|
+
}), X = ft(A.label, S);
|
|
247
247
|
return /* @__PURE__ */ Z(
|
|
248
248
|
"li",
|
|
249
249
|
E(u({}, h), {
|
|
250
250
|
key: A.id,
|
|
251
251
|
"data-testid": c ? `${c}:Autocomplete:option(${A.id.toString()})` : void 0
|
|
252
252
|
}),
|
|
253
|
-
/* @__PURE__ */ o("div", { children: X.map((oe,
|
|
253
|
+
/* @__PURE__ */ o("div", { children: X.map((oe, Ge) => /* @__PURE__ */ o(
|
|
254
254
|
"span",
|
|
255
255
|
{
|
|
256
256
|
style: {
|
|
@@ -258,7 +258,7 @@ function wn({
|
|
|
258
258
|
},
|
|
259
259
|
children: oe.text
|
|
260
260
|
},
|
|
261
|
-
|
|
261
|
+
Ge
|
|
262
262
|
)) })
|
|
263
263
|
);
|
|
264
264
|
} else
|
|
@@ -274,7 +274,7 @@ function wn({
|
|
|
274
274
|
}
|
|
275
275
|
),
|
|
276
276
|
s.length > 0 && /* @__PURE__ */ o(T, { sx: l, children: s.map((h) => /* @__PURE__ */ o(
|
|
277
|
-
|
|
277
|
+
Ze,
|
|
278
278
|
{
|
|
279
279
|
sx: {
|
|
280
280
|
marginTop: 1,
|
|
@@ -282,7 +282,7 @@ function wn({
|
|
|
282
282
|
height: "auto"
|
|
283
283
|
},
|
|
284
284
|
label: /* @__PURE__ */ o(
|
|
285
|
-
|
|
285
|
+
je,
|
|
286
286
|
{
|
|
287
287
|
title: h.tooltipContent || "",
|
|
288
288
|
placement: "bottom-start",
|
|
@@ -302,7 +302,7 @@ function wn({
|
|
|
302
302
|
"data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
|
|
303
303
|
onDelete: (A) => M(A, h.id),
|
|
304
304
|
deleteIcon: /* @__PURE__ */ o(
|
|
305
|
-
|
|
305
|
+
ut,
|
|
306
306
|
{
|
|
307
307
|
"data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
|
|
308
308
|
}
|
|
@@ -332,22 +332,22 @@ const kn = /MUI: The value provided to.*is invalid/i, yn = ({
|
|
|
332
332
|
popupIcon: D,
|
|
333
333
|
disableIconFlip: p
|
|
334
334
|
}) => {
|
|
335
|
-
const [k, b] =
|
|
335
|
+
const [k, b] = O(""), { data: I, isLoading: H } = Re({
|
|
336
336
|
inputValue: k,
|
|
337
337
|
label: n,
|
|
338
338
|
lookup: e,
|
|
339
339
|
minLength: m != null ? m : 0,
|
|
340
340
|
preLoadedOptions: v
|
|
341
341
|
}), M = k.length >= m;
|
|
342
|
-
return /* @__PURE__ */ o("div", { "data-testid": l, children: /* @__PURE__ */ o(
|
|
342
|
+
return /* @__PURE__ */ o("div", { "data-testid": l, children: /* @__PURE__ */ o(et, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
|
|
343
343
|
j,
|
|
344
344
|
{
|
|
345
345
|
sx: u(u({}, r), p ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
346
346
|
"data-testid": l ? `${l}:Autocomplete` : void 0,
|
|
347
|
-
loading: M ?
|
|
347
|
+
loading: M ? H : !1,
|
|
348
348
|
options: I != null ? I : [],
|
|
349
|
-
onChange: (x, F,
|
|
350
|
-
t(x, F,
|
|
349
|
+
onChange: (x, F, L) => {
|
|
350
|
+
t(x, F, L);
|
|
351
351
|
},
|
|
352
352
|
disablePortal: y,
|
|
353
353
|
filterOptions: (x) => x,
|
|
@@ -382,12 +382,12 @@ const kn = /MUI: The value provided to.*is invalid/i, yn = ({
|
|
|
382
382
|
disabled: w
|
|
383
383
|
}
|
|
384
384
|
) }) });
|
|
385
|
-
},
|
|
385
|
+
}, St = (e) => {
|
|
386
386
|
if (!e)
|
|
387
387
|
return -1;
|
|
388
388
|
try {
|
|
389
389
|
const n = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
|
|
390
|
-
|
|
390
|
+
gt.from(n, "base64").toString("utf8").split("").map(function(s) {
|
|
391
391
|
return "%" + ("00" + s.charCodeAt(0).toString(16)).slice(-2);
|
|
392
392
|
}).join("")
|
|
393
393
|
), r = JSON.parse(i);
|
|
@@ -402,13 +402,13 @@ const kn = /MUI: The value provided to.*is invalid/i, yn = ({
|
|
|
402
402
|
}) => {
|
|
403
403
|
const { logout: i, getAccessTokenSilently: r } = ne();
|
|
404
404
|
return /* @__PURE__ */ o(
|
|
405
|
-
|
|
405
|
+
Le,
|
|
406
406
|
{
|
|
407
407
|
isOpen: e,
|
|
408
408
|
primaryButton: {
|
|
409
409
|
text: "Continue",
|
|
410
410
|
onClick: () => N(null, null, function* () {
|
|
411
|
-
const d = yield r({ cacheMode: "off" }), m =
|
|
411
|
+
const d = yield r({ cacheMode: "off" }), m = St(d) * 1e3;
|
|
412
412
|
n(m), t();
|
|
413
413
|
}),
|
|
414
414
|
disabled: !1,
|
|
@@ -431,20 +431,20 @@ const kn = /MUI: The value provided to.*is invalid/i, yn = ({
|
|
|
431
431
|
}
|
|
432
432
|
);
|
|
433
433
|
};
|
|
434
|
-
function
|
|
434
|
+
function wt(e) {
|
|
435
435
|
return "error" in e;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function kt(e) {
|
|
438
438
|
var i;
|
|
439
439
|
const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
440
440
|
return t === "access_denied" && n.startsWith("You do not have the required authorization");
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function yt(e) {
|
|
443
443
|
var i;
|
|
444
444
|
const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
445
445
|
return t === "access_denied" && n.startsWith("User did not authorize the request");
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function Dt(e) {
|
|
448
448
|
var i;
|
|
449
449
|
const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
450
450
|
return t === "access_denied" && n.match(/Script.*time.*exceeded/);
|
|
@@ -462,7 +462,7 @@ function bn({
|
|
|
462
462
|
le(() => {
|
|
463
463
|
a && r(a);
|
|
464
464
|
}, [a, r]);
|
|
465
|
-
const m =
|
|
465
|
+
const m = Ye(
|
|
466
466
|
() => ({
|
|
467
467
|
appState: {
|
|
468
468
|
returnTo: `${window.location.pathname}${window.location.search}`
|
|
@@ -478,13 +478,13 @@ function bn({
|
|
|
478
478
|
a
|
|
479
479
|
), n === "all")
|
|
480
480
|
throw a;
|
|
481
|
-
if (
|
|
481
|
+
if (wt(a)) {
|
|
482
482
|
let g = "Auth error", w = "An unknown Auth0 error occurred.";
|
|
483
|
-
if (
|
|
483
|
+
if (kt(a))
|
|
484
484
|
g = "Unauthorised", w = `You are not authorised to access ${t}.`;
|
|
485
|
-
else if (kt(a))
|
|
486
|
-
g = "App not authorised", w = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
|
|
487
485
|
else if (yt(a))
|
|
486
|
+
g = "App not authorised", w = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
|
|
487
|
+
else if (Dt(a))
|
|
488
488
|
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.";
|
|
489
489
|
else if (a.message === "Invalid state") {
|
|
490
490
|
const D = localStorage.getItem("auth0_redirect_count");
|
|
@@ -512,15 +512,15 @@ function bn({
|
|
|
512
512
|
] });
|
|
513
513
|
} else if (n === "unknown") throw a;
|
|
514
514
|
}
|
|
515
|
-
return s ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ o($, { children: e })) : /* @__PURE__ */ o(
|
|
515
|
+
return s ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ o($, { children: e })) : /* @__PURE__ */ o(xt, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
516
516
|
}
|
|
517
|
-
const
|
|
517
|
+
const bt = {
|
|
518
518
|
autoHideDuration: 6e3,
|
|
519
519
|
anchorOrigin: { vertical: "top", horizontal: "center" },
|
|
520
520
|
// The default is false. If we prefer timer to continue when window loses
|
|
521
521
|
// focus, change to true
|
|
522
522
|
disableWindowBlurListener: !1
|
|
523
|
-
},
|
|
523
|
+
}, Ft = {
|
|
524
524
|
shouldClose: (e, t) => t !== "clickaway"
|
|
525
525
|
}, ge = {
|
|
526
526
|
message: "",
|
|
@@ -528,18 +528,18 @@ const Dt = {
|
|
|
528
528
|
variant: "standard",
|
|
529
529
|
progressIndicator: void 0
|
|
530
530
|
// Can use 'circular' or 'linear'
|
|
531
|
-
}, xe = 100, Ae = 2e3,
|
|
531
|
+
}, xe = 100, Ae = 2e3, Et = 2e3, It = /* @__PURE__ */ (() => {
|
|
532
532
|
let e = 0;
|
|
533
533
|
return () => (e += 1, e);
|
|
534
|
-
})(),
|
|
534
|
+
})(), _t = {
|
|
535
535
|
borderBottomLeftRadius: "0px",
|
|
536
536
|
borderBottomRightRadius: "0px"
|
|
537
|
-
},
|
|
538
|
-
function
|
|
537
|
+
}, Tt = {}, Nt = {}, Be = Qe(null);
|
|
538
|
+
function Pt(s) {
|
|
539
539
|
var c = s, {
|
|
540
|
-
overrideState: e =
|
|
541
|
-
overrideActions: t =
|
|
542
|
-
shouldClose: n =
|
|
540
|
+
overrideState: e = Tt,
|
|
541
|
+
overrideActions: t = Nt,
|
|
542
|
+
shouldClose: n = Ft.shouldClose,
|
|
543
543
|
children: i
|
|
544
544
|
} = c, r = ae(c, [
|
|
545
545
|
"overrideState",
|
|
@@ -548,14 +548,14 @@ function Nt(s) {
|
|
|
548
548
|
"children"
|
|
549
549
|
]);
|
|
550
550
|
var A;
|
|
551
|
-
const [{ open: a }, l] =
|
|
551
|
+
const [{ open: a }, l] = O({ open: !1 }), d = Q([]), m = Q(Date.now()), y = Q(0), v = ce((C) => {
|
|
552
552
|
l({ open: C });
|
|
553
553
|
}, []), g = ce((C = {}) => {
|
|
554
554
|
y.current += 1, d.current.length >= xe && Date.now() - m.current >= Ae && (m.current = Date.now(), console.error(
|
|
555
555
|
`SaladBarProvider: MAX_QUEUE_LENGTH (${xe}) hit ${y.current} times in last ${Ae}ms)`
|
|
556
556
|
), y.current = 0);
|
|
557
557
|
const S = u(E(u({}, ge), {
|
|
558
|
-
key:
|
|
558
|
+
key: It()
|
|
559
559
|
}), C);
|
|
560
560
|
return d.current.push(S), d.current.length === 1 && l({ open: !0 }), S.key;
|
|
561
561
|
}, []), w = (C = "", S = {}) => g(u({ message: C, severity: "success" }, S)), D = (C = "", S = {}) => g(u({ message: C, severity: "info" }, S)), p = (C = "", S = {}) => g(u({ message: C, severity: "warning" }, S)), k = (C = "", S = {}) => g(u({ message: C, severity: "error" }, S)), b = (C) => {
|
|
@@ -564,12 +564,12 @@ function Nt(s) {
|
|
|
564
564
|
return S === 0 ? (l({ open: !1 }), d.current[0]) : d.current.splice(S, 1);
|
|
565
565
|
}, I = (C, S) => {
|
|
566
566
|
n(C, S) && l({ open: !1 });
|
|
567
|
-
},
|
|
567
|
+
}, H = () => {
|
|
568
568
|
}, M = () => {
|
|
569
569
|
d.current.shift(), d.current.length > 0 && l({ open: !0 });
|
|
570
570
|
}, x = (A = d.current[0]) != null ? A : u({}, ge), F = {};
|
|
571
571
|
"autoHideDuration" in x && (F.autoHideDuration = x.autoHideDuration);
|
|
572
|
-
const
|
|
572
|
+
const L = u(u({}, bt), r), h = u(u({
|
|
573
573
|
open: a,
|
|
574
574
|
setOpen: v,
|
|
575
575
|
enqueueNotification: g,
|
|
@@ -582,24 +582,24 @@ function Nt(s) {
|
|
|
582
582
|
return /* @__PURE__ */ f(Be.Provider, { value: h, children: [
|
|
583
583
|
i,
|
|
584
584
|
/* @__PURE__ */ o(
|
|
585
|
-
|
|
586
|
-
E(u(u({},
|
|
585
|
+
tt,
|
|
586
|
+
E(u(u({}, L), F), {
|
|
587
587
|
open: a,
|
|
588
588
|
onClose: I,
|
|
589
589
|
TransitionProps: {
|
|
590
590
|
onExited: M,
|
|
591
|
-
onExit:
|
|
591
|
+
onExit: H
|
|
592
592
|
},
|
|
593
|
-
sx: { zIndex:
|
|
593
|
+
sx: { zIndex: Et },
|
|
594
594
|
children: /* @__PURE__ */ f("div", { children: [
|
|
595
595
|
/* @__PURE__ */ o(
|
|
596
|
-
|
|
596
|
+
nt,
|
|
597
597
|
{
|
|
598
598
|
onClose: (C) => I(C, "closeAlert"),
|
|
599
599
|
severity: x.severity,
|
|
600
600
|
variant: "filled",
|
|
601
601
|
icon: x.progressIndicator === "circular" ? /* @__PURE__ */ o(te, { size: "1em" }) : void 0,
|
|
602
|
-
style: x.progressIndicator === "linear" ?
|
|
602
|
+
style: x.progressIndicator === "linear" ? _t : void 0,
|
|
603
603
|
children: x.message
|
|
604
604
|
}
|
|
605
605
|
),
|
|
@@ -612,24 +612,24 @@ function Nt(s) {
|
|
|
612
612
|
class Ue extends Error {
|
|
613
613
|
}
|
|
614
614
|
se(Ue, "errorName", "ContextError");
|
|
615
|
-
function
|
|
616
|
-
const e =
|
|
615
|
+
function $t() {
|
|
616
|
+
const e = Je(Be);
|
|
617
617
|
if (e === null)
|
|
618
618
|
throw new Ue("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
|
|
619
619
|
return e;
|
|
620
620
|
}
|
|
621
|
-
const Fn =
|
|
622
|
-
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(
|
|
623
|
-
),
|
|
621
|
+
const Fn = At(
|
|
622
|
+
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(Pt, E(u({}, e), { overrideState: t, overrideActions: n, children: /* @__PURE__ */ o($, { children: i }) }))
|
|
623
|
+
), Oe = "domainCode";
|
|
624
624
|
var De;
|
|
625
625
|
const Ce = P(
|
|
626
|
-
JSON.parse((De = localStorage.getItem(
|
|
627
|
-
),
|
|
626
|
+
JSON.parse((De = localStorage.getItem(Oe)) != null ? De : '{"domainCode": ""}').domainCode
|
|
627
|
+
), Mt = P(
|
|
628
628
|
(e) => e(Ce),
|
|
629
629
|
(e, t, n) => {
|
|
630
|
-
t(Ce, n), localStorage.setItem(
|
|
630
|
+
t(Ce, n), localStorage.setItem(Oe, JSON.stringify({ domainCode: n }));
|
|
631
631
|
}
|
|
632
|
-
),
|
|
632
|
+
), Lt = {
|
|
633
633
|
act: "ACT",
|
|
634
634
|
nsw: "NSW",
|
|
635
635
|
nt: "NT",
|
|
@@ -639,11 +639,11 @@ const Ce = P(
|
|
|
639
639
|
vic: "VIC",
|
|
640
640
|
wa: "WA",
|
|
641
641
|
ag: "AG",
|
|
642
|
-
fedmps: "
|
|
642
|
+
fedmps: "FedMPs",
|
|
643
643
|
"": ""
|
|
644
|
-
},
|
|
644
|
+
}, He = (e) => {
|
|
645
645
|
var t;
|
|
646
|
-
return e === null ? "N/A" : (t =
|
|
646
|
+
return e === null ? "N/A" : (t = Lt[e]) != null ? t : "";
|
|
647
647
|
}, En = ({
|
|
648
648
|
isLoading: e,
|
|
649
649
|
isOpen: t,
|
|
@@ -653,14 +653,14 @@ const Ce = P(
|
|
|
653
653
|
applicationName: s,
|
|
654
654
|
handleLogout: c
|
|
655
655
|
}) => {
|
|
656
|
-
const [a, l] =
|
|
656
|
+
const [a, l] = R(Mt), [d, m] = O(a), { enqueueSuccessNotification: y } = $t(), v = r.length === 0, g = !!a && !r.includes(a) && !r.includes(d), w = !a || v || g, D = () => N(null, null, function* () {
|
|
657
657
|
d ? (l(d), i == null || i(d), y(`Set organisation to ${d}`), n()) : (l(""), i == null || i(""));
|
|
658
658
|
}), p = () => N(null, null, function* () {
|
|
659
659
|
a && !v && !g ? (m(a), n()) : w && c();
|
|
660
660
|
});
|
|
661
661
|
let k;
|
|
662
662
|
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__ */ f(
|
|
663
|
-
|
|
663
|
+
Le,
|
|
664
664
|
{
|
|
665
665
|
isOpen: t,
|
|
666
666
|
dialogTitle: "Select an organisation",
|
|
@@ -690,7 +690,7 @@ const Ce = P(
|
|
|
690
690
|
disableClearable: !1,
|
|
691
691
|
value: d !== "" ? d : null,
|
|
692
692
|
onChange: (b, I) => m(I != null ? I : ""),
|
|
693
|
-
getOptionLabel:
|
|
693
|
+
getOptionLabel: He,
|
|
694
694
|
options: [...r.toSorted()],
|
|
695
695
|
renderInput: (b) => /* @__PURE__ */ o(
|
|
696
696
|
ee,
|
|
@@ -707,14 +707,14 @@ const Ce = P(
|
|
|
707
707
|
)
|
|
708
708
|
}
|
|
709
709
|
),
|
|
710
|
-
k && /* @__PURE__ */ o(
|
|
710
|
+
k && /* @__PURE__ */ o(ot, { error: !0, children: k })
|
|
711
711
|
]
|
|
712
712
|
}
|
|
713
713
|
);
|
|
714
|
-
},
|
|
714
|
+
}, We = () => {
|
|
715
715
|
const e = K();
|
|
716
|
-
return
|
|
717
|
-
},
|
|
716
|
+
return it(e.breakpoints.down("sm"));
|
|
717
|
+
}, Rt = 64, Bt = 72, Ut = 256, V = P(!0), Ot = P(Ut), Ht = P(Bt), ve = P(""), Wt = P(void 0), qt = P(Rt), zt = P(void 0);
|
|
718
718
|
function Gt({ links: e }) {
|
|
719
719
|
return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
|
|
720
720
|
}
|
|
@@ -751,7 +751,7 @@ const z = "Navbar", W = {
|
|
|
751
751
|
}), Kt = (e) => {
|
|
752
752
|
const t = K();
|
|
753
753
|
return /* @__PURE__ */ o(
|
|
754
|
-
|
|
754
|
+
at,
|
|
755
755
|
u({
|
|
756
756
|
easing: t.transitions.easing.sharp,
|
|
757
757
|
timeout: {
|
|
@@ -760,7 +760,7 @@ const z = "Navbar", W = {
|
|
|
760
760
|
}
|
|
761
761
|
}, e)
|
|
762
762
|
);
|
|
763
|
-
},
|
|
763
|
+
}, qe = (e) => {
|
|
764
764
|
var t, n;
|
|
765
765
|
return {
|
|
766
766
|
overflowX: "hidden",
|
|
@@ -771,10 +771,10 @@ const z = "Navbar", W = {
|
|
|
771
771
|
}, Se = (e, t) => u({
|
|
772
772
|
width: t,
|
|
773
773
|
transition: B(e, "width", "entering")
|
|
774
|
-
},
|
|
774
|
+
}, qe(e)), we = (e, t) => u({
|
|
775
775
|
width: t,
|
|
776
776
|
transition: B(e, "width", "leaving")
|
|
777
|
-
},
|
|
777
|
+
}, qe(e)), Xt = $e(rt, {
|
|
778
778
|
shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
|
|
779
779
|
})(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => u(u({
|
|
780
780
|
flexShrink: 0,
|
|
@@ -789,7 +789,7 @@ const z = "Navbar", W = {
|
|
|
789
789
|
backgroundColor: "",
|
|
790
790
|
"& .MuiDrawer-paper": we(e, r ? n : i)
|
|
791
791
|
})));
|
|
792
|
-
function
|
|
792
|
+
function ze(e) {
|
|
793
793
|
return e.replace(
|
|
794
794
|
/(^|-)([a-z])/g,
|
|
795
795
|
(t, n, i) => n === "-" ? " " + i.toUpperCase() : i.toUpperCase()
|
|
@@ -803,7 +803,7 @@ function In(e, t, n, i) {
|
|
|
803
803
|
).map(
|
|
804
804
|
([a]) => {
|
|
805
805
|
var l;
|
|
806
|
-
return
|
|
806
|
+
return ze((l = a.split("/").at(-1)) != null ? l : "");
|
|
807
807
|
}
|
|
808
808
|
);
|
|
809
809
|
return (c = i.find(
|
|
@@ -818,7 +818,7 @@ const _n = (e) => {
|
|
|
818
818
|
const i = yield t();
|
|
819
819
|
return i ? Object.entries(i).reduce((r, [s, c]) => {
|
|
820
820
|
var d;
|
|
821
|
-
const a =
|
|
821
|
+
const a = ze((d = s.split("/").at(-1)) != null ? d : ""), l = s.startsWith("https://greens.org.au/roles/") && e.includes(a) ? c : [];
|
|
822
822
|
return [.../* @__PURE__ */ new Set([...r, ...l])];
|
|
823
823
|
}, []) : [];
|
|
824
824
|
})
|
|
@@ -913,9 +913,9 @@ function Qt({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
|
|
|
913
913
|
] }) }) : /* @__PURE__ */ o(fe, {})
|
|
914
914
|
}
|
|
915
915
|
),
|
|
916
|
-
/* @__PURE__ */ o(Kt, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(
|
|
916
|
+
/* @__PURE__ */ o(Kt, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(st, { in: n, children: /* @__PURE__ */ f(T, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
917
917
|
e != null && e.name ? /* @__PURE__ */ o(_, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ o(ue, { animation: !1, width: "50%" }),
|
|
918
|
-
t ? /* @__PURE__ */ o(_, { children: t
|
|
918
|
+
t ? /* @__PURE__ */ o(_, { children: He(t) }) : /* @__PURE__ */ o(ue, { animation: !1, width: "25%" })
|
|
919
919
|
] }) }) })
|
|
920
920
|
]
|
|
921
921
|
}
|
|
@@ -933,7 +933,7 @@ function Jt({
|
|
|
933
933
|
domainCode: l,
|
|
934
934
|
useNewAvatar: d = !1
|
|
935
935
|
}) {
|
|
936
|
-
const m =
|
|
936
|
+
const m = We(), y = Pe(V);
|
|
937
937
|
return /* @__PURE__ */ o(Vt, { className: W.root, "data-testid": i, children: /* @__PURE__ */ f(
|
|
938
938
|
Xt,
|
|
939
939
|
{
|
|
@@ -950,7 +950,7 @@ function Jt({
|
|
|
950
950
|
},
|
|
951
951
|
isSmallScreen: m,
|
|
952
952
|
children: [
|
|
953
|
-
!m && /* @__PURE__ */ o(
|
|
953
|
+
!m && /* @__PURE__ */ o(lt, {}),
|
|
954
954
|
r && /* @__PURE__ */ f(T, { flexGrow: "0", children: [
|
|
955
955
|
r,
|
|
956
956
|
/* @__PURE__ */ o(pe, { variant: "middle", sx: { marginY: "0.5rem" } })
|
|
@@ -980,7 +980,7 @@ function Zt({
|
|
|
980
980
|
flexGrow: 1
|
|
981
981
|
},
|
|
982
982
|
children: i ? /* @__PURE__ */ o(T, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ o(
|
|
983
|
-
|
|
983
|
+
ct,
|
|
984
984
|
{
|
|
985
985
|
component: "main",
|
|
986
986
|
id: "main-content",
|
|
@@ -1001,7 +1001,7 @@ function tn({
|
|
|
1001
1001
|
"data-testid": n,
|
|
1002
1002
|
middle: i
|
|
1003
1003
|
}) {
|
|
1004
|
-
const r = Pe(V), s = () => r((l) => !l), c = K(), a =
|
|
1004
|
+
const r = Pe(V), s = () => r((l) => !l), c = K(), a = We();
|
|
1005
1005
|
return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ f(
|
|
1006
1006
|
be,
|
|
1007
1007
|
{
|
|
@@ -1021,13 +1021,13 @@ function tn({
|
|
|
1021
1021
|
},
|
|
1022
1022
|
children: [
|
|
1023
1023
|
/* @__PURE__ */ o(
|
|
1024
|
-
|
|
1024
|
+
dt,
|
|
1025
1025
|
{
|
|
1026
1026
|
size: "medium",
|
|
1027
1027
|
color: "inherit",
|
|
1028
1028
|
sx: { padding: 1.5, marginLeft: "12px" },
|
|
1029
1029
|
onClick: s,
|
|
1030
|
-
children: /* @__PURE__ */ o(
|
|
1030
|
+
children: /* @__PURE__ */ o(ht, { fontSize: "medium" })
|
|
1031
1031
|
}
|
|
1032
1032
|
),
|
|
1033
1033
|
/* @__PURE__ */ o(_, { className: en.titleText, variant: "h6", component: "h1", children: e }),
|
|
@@ -1050,13 +1050,13 @@ function $n({
|
|
|
1050
1050
|
domainCode: m,
|
|
1051
1051
|
useNewAvatar: y = !1
|
|
1052
1052
|
}) {
|
|
1053
|
-
|
|
1053
|
+
vt([
|
|
1054
1054
|
[V, n != null ? n : !0],
|
|
1055
1055
|
[ve, t != null ? t : ""]
|
|
1056
1056
|
]);
|
|
1057
|
-
const v = he(V), [g] =
|
|
1057
|
+
const v = he(V), [g] = R(Ot), [w] = R(Ht), D = he(ve), [p] = R(qt), [k] = R(Wt), [b] = R(zt);
|
|
1058
1058
|
return /* @__PURE__ */ f(me, { children: [
|
|
1059
|
-
/* @__PURE__ */ o(
|
|
1059
|
+
/* @__PURE__ */ o(Ct, {}),
|
|
1060
1060
|
/* @__PURE__ */ o(
|
|
1061
1061
|
tn,
|
|
1062
1062
|
{
|
|
@@ -1146,7 +1146,7 @@ const Mn = Me({
|
|
|
1146
1146
|
navBar: {
|
|
1147
1147
|
backgroundColor: "#E8E8E8"
|
|
1148
1148
|
}
|
|
1149
|
-
}),
|
|
1149
|
+
}), Ln = Me({
|
|
1150
1150
|
palette: {
|
|
1151
1151
|
primary: {
|
|
1152
1152
|
main: "#007236",
|
|
@@ -1242,36 +1242,38 @@ const Mn = Me({
|
|
|
1242
1242
|
}
|
|
1243
1243
|
});
|
|
1244
1244
|
export {
|
|
1245
|
-
|
|
1245
|
+
Le as AgDialog,
|
|
1246
1246
|
$n as AppLayout,
|
|
1247
1247
|
bn as AuthGuard,
|
|
1248
1248
|
Be as Context,
|
|
1249
1249
|
Ue as ContextError,
|
|
1250
|
+
Lt as DOMAIN_CODE_LABELS,
|
|
1250
1251
|
En as DomainCodeDialog,
|
|
1251
1252
|
Sn as ExampleComponent,
|
|
1252
1253
|
wn as FetchAutocomplete,
|
|
1253
1254
|
kn as MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX,
|
|
1254
|
-
|
|
1255
|
+
Pt as SaladBarProvider,
|
|
1255
1256
|
Dn as SessionExpiryDialog,
|
|
1256
1257
|
yn as SingleAutocomplete,
|
|
1257
1258
|
In as determineUserLevelFromClaims,
|
|
1258
|
-
|
|
1259
|
+
Mt as domainCodeAtom,
|
|
1259
1260
|
Mn as fed21Theme,
|
|
1260
|
-
|
|
1261
|
+
St as getAuth0Expiry,
|
|
1262
|
+
He as getDomainOptionLabel,
|
|
1261
1263
|
Tn as getValidBusinessRoles,
|
|
1262
|
-
|
|
1264
|
+
Ln as internalAgSystemsTheme,
|
|
1263
1265
|
V as navBarOpenAtom,
|
|
1264
1266
|
zt as navBarTopAtom,
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
+
Ht as navBarWidthClosedAtom,
|
|
1268
|
+
Ot as navBarWidthOpenAtom,
|
|
1267
1269
|
Yt as simpleHashCode,
|
|
1268
1270
|
Nn as suppressConsole,
|
|
1269
1271
|
ve as titleTextAtom,
|
|
1270
1272
|
qt as topBarHeightAtom,
|
|
1271
1273
|
Wt as topBarMiddleAtom,
|
|
1272
1274
|
Pn as unsuppressConsole,
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
+
Re as useAutocompleteOptions,
|
|
1276
|
+
$t as useSaladBar,
|
|
1275
1277
|
_n as useValidDomains,
|
|
1276
1278
|
Fn as withSaladBarProvider
|
|
1277
1279
|
};
|