@australiangreens/ag-internal-components 0.0.97 → 0.0.99

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
@@ -49,14 +49,13 @@ import { ArrowForward as lt, ArrowBack as ct, ViewHeadline as jt, Cancel as en,
49
49
  import { atom as _, useSetAtom as dt, useAtomValue as _e, useAtom as V, getDefaultStore as nn, Provider as pt } from "jotai";
50
50
  import { useHydrateAtoms as ut } from "jotai/utils";
51
51
  import Me from "react-avatar";
52
- import { simpleHashCode as on } from "src/utils";
53
- import rn from "autosuggest-highlight/match";
54
- import an from "autosuggest-highlight/parse";
55
- import { useQuery as sn, QueryClient as ln, QueryClientProvider as cn } from "@tanstack/react-query";
52
+ import on from "autosuggest-highlight/match";
53
+ import rn from "autosuggest-highlight/parse";
54
+ import { useQuery as an, QueryClient as sn, QueryClientProvider as ln } from "@tanstack/react-query";
56
55
  import { useAuth0 as ht } from "@auth0/auth0-react";
57
- import { Buffer as dn } from "buffer";
58
- import pn from "@mui/material/Skeleton";
59
- function To({ text: e }) {
56
+ import { Buffer as cn } from "buffer";
57
+ import dn from "@mui/material/Skeleton";
58
+ function Oo({ text: e }) {
60
59
  const [t, n] = B(0);
61
60
  return /* @__PURE__ */ u(E, { children: [
62
61
  /* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
@@ -88,7 +87,7 @@ const gt = 330, ft = 73, U = "Navbar", q = {
88
87
  userInfoHolder: `${U}-userInfoHolder`,
89
88
  settings: `${U}-settings`,
90
89
  pieChartIcon: `${U}-pieChartIcon`
91
- }, un = R(y, {
90
+ }, pn = R(y, {
92
91
  name: "NavBar"
93
92
  })(({ theme: e }) => ({
94
93
  [`&.${q.root}`]: {
@@ -117,11 +116,11 @@ const gt = 330, ft = 73, U = "Navbar", q = {
117
116
  color: "white",
118
117
  backgroundColor: "black"
119
118
  // backgroundColor: '#e8e8e8',
120
- }), hn = () => a({
119
+ }), un = () => a({
121
120
  width: gt
122
- }, mt()), gn = () => a({
121
+ }, mt()), hn = () => a({
123
122
  width: ft
124
- }, mt()), fn = R(we, {
123
+ }, mt()), gn = R(we, {
125
124
  shouldForwardProp: (e) => e !== "open"
126
125
  })(({ theme: e, open: t }) => a(a({
127
126
  width: t ? gt : ft,
@@ -130,16 +129,16 @@ const gt = 330, ft = 73, U = "Navbar", q = {
130
129
  boxSizing: "border-box",
131
130
  zIndex: e.zIndex.drawer + 100
132
131
  }, t && {
133
- "& .MuiDrawer-paper": hn()
132
+ "& .MuiDrawer-paper": un()
134
133
  }), !t && {
135
- "& .MuiDrawer-paper": gn()
134
+ "& .MuiDrawer-paper": hn()
136
135
  }));
137
136
  class De extends Jt {
138
137
  }
139
138
  Fe(De, "errorName", "ContextError");
140
- const Ct = Je(null), mn = {}, Cn = {}, xn = ({
141
- overrideState: e = mn,
142
- overrideActions: t = Cn,
139
+ const Ct = Je(null), fn = {}, mn = {}, Cn = ({
140
+ overrideState: e = fn,
141
+ overrideActions: t = mn,
143
142
  children: n
144
143
  }) => {
145
144
  const [{ open: i }, r] = B({ open: !0 }), s = ie((l) => {
@@ -152,16 +151,16 @@ const Ct = Je(null), mn = {}, Cn = {}, xn = ({
152
151
  toggleOpen: c
153
152
  }, e), t);
154
153
  return /* @__PURE__ */ o(Ct.Provider, { value: d, children: n });
155
- }, vn = () => {
154
+ }, xn = () => {
156
155
  const e = Ze(Ct);
157
156
  if (e === null)
158
157
  throw new De("Error: Tried to useNavBar outside of a <NavBarProvider>");
159
158
  return e;
160
- }, wn = (e = {}) => a({
159
+ }, vn = (e = {}) => a({
161
160
  open: !0
162
- }, e), Bo = Q(
163
- (e = wn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(xn, { overrideState: e, overrideActions: t, children: n })
164
- ), Eo = Q(() => ({ children: e }) => /* @__PURE__ */ o(Zt, { children: e })), Re = 7, Fo = R(st)(({ theme: e }) => ({
161
+ }, e), To = Q(
162
+ (e = vn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(Cn, { overrideState: e, overrideActions: t, children: n })
163
+ ), Bo = Q(() => ({ children: e }) => /* @__PURE__ */ o(Zt, { children: e })), Re = 7, Eo = R(st)(({ theme: e }) => ({
165
164
  backgroundColor: "black",
166
165
  color: "white",
167
166
  "& .MuiListItem-root": {
@@ -199,7 +198,7 @@ const Ct = Je(null), mn = {}, Cn = {}, xn = ({
199
198
  // '&.Mui-selected.Mui-focusVisible:hover': {
200
199
  // },
201
200
  }
202
- })), He = 7, Po = R(st)(({ theme: e }) => ({
201
+ })), He = 7, Fo = R(st)(({ theme: e }) => ({
203
202
  backgroundColor: "#e8e8e8",
204
203
  color: "inherit",
205
204
  "& .MuiListItem-root": {
@@ -238,15 +237,15 @@ const Ct = Je(null), mn = {}, Cn = {}, xn = ({
238
237
  // },
239
238
  }
240
239
  }));
241
- function No({
240
+ function Po({
242
241
  "data-testid": e,
243
242
  children: t
244
243
  }) {
245
- const { open: n } = vn();
246
- return /* @__PURE__ */ u(un, { className: q.root, "data-testid": e, children: [
244
+ const { open: n } = xn();
245
+ return /* @__PURE__ */ u(pn, { className: q.root, "data-testid": e, children: [
247
246
  /* @__PURE__ */ o(Kt, {}),
248
247
  /* @__PURE__ */ o(
249
- fn,
248
+ gn,
250
249
  {
251
250
  variant: "permanent",
252
251
  anchor: "left",
@@ -257,14 +256,14 @@ function No({
257
256
  )
258
257
  ] });
259
258
  }
260
- const An = 24, bn = 64, G = "TopBar", T = {
259
+ const wn = 24, An = 64, G = "TopBar", T = {
261
260
  topStripe: `${G}-topStripe`,
262
261
  titleBar: `${G}-titleBar`,
263
262
  titleSlider: `${G}-titleSlider`,
264
263
  titleText: `${G}-titleText`,
265
264
  leftPanelButton: `${G}-leftPanelButton`,
266
265
  rightPanelButton: `${G}-leftPanelButton`
267
- }, Sn = Ae("div", {
266
+ }, bn = Ae("div", {
268
267
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
269
268
  name: G
270
269
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -273,12 +272,12 @@ const An = 24, bn = 64, G = "TopBar", T = {
273
272
  width: "100%",
274
273
  [`& .${T.topStripe}`]: {
275
274
  width: "100%",
276
- height: `${An}px`,
275
+ height: `${wn}px`,
277
276
  backgroundColor: e.palette.primary.main
278
277
  },
279
278
  [`& .${T.titleBar}`]: {
280
279
  backgroundColor: e.palette.primary.light,
281
- height: `${bn}px`,
280
+ height: `${An}px`,
282
281
  padding: e.spacing(0, 3),
283
282
  width: "100%"
284
283
  },
@@ -316,13 +315,13 @@ const An = 24, bn = 64, G = "TopBar", T = {
316
315
  })
317
316
  };
318
317
  });
319
- function kn({
318
+ function Sn({
320
319
  titleText: e = "",
321
320
  leftPanel: t,
322
321
  rightPanel: n,
323
322
  "data-testid": i
324
323
  }) {
325
- return /* @__PURE__ */ u(Sn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
324
+ return /* @__PURE__ */ u(bn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
326
325
  /* @__PURE__ */ o("div", { className: T.topStripe }),
327
326
  /* @__PURE__ */ o("div", { className: T.titleBar, children: /* @__PURE__ */ u(y, { className: T.titleSlider, children: [
328
327
  t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ u(
@@ -359,7 +358,7 @@ function kn({
359
358
  ] }) })
360
359
  ] });
361
360
  }
362
- const xt = 400, Dn = Ae(we, {
361
+ const xt = 400, kn = Ae(we, {
363
362
  shouldForwardProp: (e) => (
364
363
  // Note we do want anchor to be forwarded to the Drawer component
365
364
  ![
@@ -389,7 +388,7 @@ const xt = 400, Dn = Ae(we, {
389
388
  marginLeft: `${r}px`
390
389
  }))
391
390
  })
392
- ), yn = Ae(y, {
391
+ ), Dn = Ae(y, {
393
392
  shouldForwardProp: (e) => !["anchor"].includes(e)
394
393
  })(({ theme: e, anchor: t }) => k(a({
395
394
  display: "flex",
@@ -428,7 +427,7 @@ function We({
428
427
  navBarWidthClosed: $ = 0
429
428
  }) {
430
429
  return /* @__PURE__ */ u(
431
- Dn,
430
+ kn,
432
431
  {
433
432
  SlideProps: {
434
433
  onEntered: () => p == null ? void 0 : p(),
@@ -444,7 +443,7 @@ function We({
444
443
  navBarWidthOpen: g,
445
444
  navBarWidthClosed: $,
446
445
  children: [
447
- /* @__PURE__ */ o(yn, k(a({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ u(E, { children: [
446
+ /* @__PURE__ */ o(Dn, k(a({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ u(E, { children: [
448
447
  /* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", children: r }),
449
448
  c && /* @__PURE__ */ u(K, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
450
449
  /* @__PURE__ */ o(ct, { "data-testid": "arrowbackicon" }),
@@ -462,7 +461,7 @@ function We({
462
461
  }
463
462
  );
464
463
  }
465
- const $n = R(y, {
464
+ const yn = R(y, {
466
465
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
467
466
  name: "PanelAwareMargins"
468
467
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -485,7 +484,7 @@ const $n = R(y, {
485
484
  }),
486
485
  marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
487
486
  });
488
- }), In = R(et, {
487
+ }), $n = R(et, {
489
488
  name: "PageContainer"
490
489
  })(({ theme: e }) => ({
491
490
  // Horizontal padding comes from the Container's gutter
@@ -505,7 +504,7 @@ const $n = R(y, {
505
504
  onClosed: void 0,
506
505
  dataTestId: void 0
507
506
  };
508
- function Lo({
507
+ function No({
509
508
  children: e,
510
509
  titleText: t = "",
511
510
  leftPanel: n,
@@ -519,7 +518,7 @@ function Lo({
519
518
  navBarWidthOpen: v,
520
519
  navBarWidthClosed: C
521
520
  }) {
522
- const [A, g] = B(me), [$, b] = B(Ce), [D, I] = B(me), [O, P] = B(Ce), N = n !== void 0, S = i !== void 0, {
521
+ const [A, g] = B(me), [$, D] = B(Ce), [b, I] = B(me), [O, P] = B(Ce), N = n !== void 0, S = i !== void 0, {
523
522
  titleText: w,
524
523
  content: H,
525
524
  flavour: W,
@@ -547,12 +546,12 @@ function Lo({
547
546
  re(() => {
548
547
  M !== me && (g(M), I(M));
549
548
  }, [M]), re(() => {
550
- ee !== Ce && (b(ee), P(ee));
549
+ ee !== Ce && (D(ee), P(ee));
551
550
  }, [ee]);
552
551
  const pe = h === void 0 ? A : h, ue = ce === void 0 ? $ : ce, Ie = (z) => {
553
- h === void 0 && (g(z), r && S && (z ? (b(!1), P($)) : b(O))), f && f(z);
552
+ h === void 0 && (g(z), r && S && (z ? (D(!1), P($)) : D(O))), f && f(z);
554
553
  }, Oe = (z) => {
555
- ce === void 0 && (b(z), r && N && (z ? (g(!1), I(A)) : g(D))), $e && $e(z);
554
+ ce === void 0 && (D(z), r && N && (z ? (g(!1), I(A)) : g(b))), $e && $e(z);
556
555
  };
557
556
  return /* @__PURE__ */ u(y, { children: [
558
557
  N && /* @__PURE__ */ o(
@@ -594,7 +593,7 @@ function Lo({
594
593
  }
595
594
  ),
596
595
  /* @__PURE__ */ o(
597
- kn,
596
+ Sn,
598
597
  a(a({
599
598
  titleText: t,
600
599
  "data-testid": l
@@ -615,7 +614,7 @@ function Lo({
615
614
  } : {})
616
615
  ),
617
616
  /* @__PURE__ */ o(
618
- $n,
617
+ yn,
619
618
  k(a(a({}, W === "push" ? {
620
619
  leftPanel: {
621
620
  open: pe,
@@ -627,7 +626,7 @@ function Lo({
627
626
  width: de
628
627
  }
629
628
  } : {}), {
630
- children: /* @__PURE__ */ o(In, k(a({ "data-testid": d }, c), { children: e }))
629
+ children: /* @__PURE__ */ o($n, k(a({ "data-testid": d }, c), { children: e }))
631
630
  })
632
631
  )
633
632
  ] });
@@ -635,8 +634,8 @@ function Lo({
635
634
  const vt = () => {
636
635
  const e = se();
637
636
  return Rt(e.breakpoints.down("sm"));
638
- }, On = 64, Tn = 72, Bn = 256, J = _(!0), wt = _(Bn), At = _(Tn), ve = _(""), En = _(void 0), bt = _(On), St = _(void 0);
639
- function Fn({ links: e }) {
637
+ }, In = 64, On = 72, Tn = 256, J = _(!0), wt = _(Tn), At = _(On), ve = _(""), Bn = _(void 0), bt = _(In), St = _(void 0);
638
+ function En({ links: e }) {
640
639
  return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
641
640
  }
642
641
  const oe = "Navbar", Y = {
@@ -647,7 +646,7 @@ const oe = "Navbar", Y = {
647
646
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
648
647
  // settings: `${PREFIX}-settings`,
649
648
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
650
- }, Pn = R(y, { name: "NavBar" })(({ theme: e }) => ({
649
+ }, Fn = R(y, { name: "NavBar" })(({ theme: e }) => ({
651
650
  [`&.${Y.root}`]: {
652
651
  display: "flex"
653
652
  },
@@ -669,7 +668,7 @@ const oe = "Navbar", Y = {
669
668
  })), X = (e, t, n) => e.transitions.create(t, {
670
669
  easing: e.transitions.easing.sharp,
671
670
  duration: n === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
672
- }), Nn = (e) => {
671
+ }), Pn = (e) => {
673
672
  const t = se();
674
673
  return /* @__PURE__ */ o(
675
674
  Ht,
@@ -695,7 +694,7 @@ const oe = "Navbar", Y = {
695
694
  }, kt(e)), Ue = (e, t) => a({
696
695
  width: t,
697
696
  transition: X(e, "width", "leaving")
698
- }, kt(e)), Ln = R(we, {
697
+ }, kt(e)), Nn = R(we, {
699
698
  shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
700
699
  })(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => a(a({
701
700
  flexShrink: 0,
@@ -709,7 +708,16 @@ const oe = "Navbar", Y = {
709
708
  })), !t && k(a({}, Ue(e, r ? n : i)), {
710
709
  backgroundColor: "",
711
710
  "& .MuiDrawer-paper": Ue(e, r ? n : i)
712
- }))), Ge = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Ve = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
711
+ })));
712
+ function Ln(e) {
713
+ let t = 0;
714
+ for (let n = 0, i = e.length; n < i; n++) {
715
+ const r = e.charCodeAt(n);
716
+ t = (t << 5) - t + r, t |= 0;
717
+ }
718
+ return t;
719
+ }
720
+ const Ge = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Ve = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
713
721
  function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
714
722
  const r = se();
715
723
  return /* @__PURE__ */ u(
@@ -738,7 +746,7 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
738
746
  sx: {
739
747
  width: "100%",
740
748
  height: "100%",
741
- bgcolor: Ge[Math.abs(on(e == null ? void 0 : e.name)) % Ge.length]
749
+ bgcolor: Ge[Math.abs(Ln(e == null ? void 0 : e.name)) % Ge.length]
742
750
  },
743
751
  children: Ve(e == null ? void 0 : e.name)
744
752
  }
@@ -761,7 +769,7 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
761
769
  ] }) }) : /* @__PURE__ */ o(Me, {})
762
770
  }
763
771
  ),
764
- /* @__PURE__ */ o(Nn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Wt, { in: n, children: /* @__PURE__ */ u(y, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
772
+ /* @__PURE__ */ o(Pn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Wt, { in: n, children: /* @__PURE__ */ u(y, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
765
773
  e != null && e.name ? /* @__PURE__ */ o(F, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "50%" }),
766
774
  t ? /* @__PURE__ */ o(F, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "25%" })
767
775
  ] }) }) })
@@ -782,8 +790,8 @@ function Mn({
782
790
  useNewAvatar: p = !1
783
791
  }) {
784
792
  const v = vt(), C = dt(J);
785
- return /* @__PURE__ */ o(Pn, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ u(
786
- Ln,
793
+ return /* @__PURE__ */ o(Fn, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ u(
794
+ Nn,
787
795
  {
788
796
  open: e,
789
797
  widthOpen: n,
@@ -803,7 +811,7 @@ function Mn({
803
811
  r,
804
812
  /* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } })
805
813
  ] }),
806
- /* @__PURE__ */ o(y, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o(Fn, { links: s }) : s }),
814
+ /* @__PURE__ */ o(y, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o(En, { links: s }) : s }),
807
815
  /* @__PURE__ */ u(y, { flexGrow: "0", children: [
808
816
  /* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } }),
809
817
  /* @__PURE__ */ o(_n, { user: d, domainCode: l, open: e, useNewAvatar: p }),
@@ -884,7 +892,7 @@ function zn({
884
892
  }
885
893
  ) });
886
894
  }
887
- function _o({
895
+ function Lo({
888
896
  children: e,
889
897
  initialTitleText: t,
890
898
  initialNavBarOpen: n,
@@ -895,39 +903,40 @@ function _o({
895
903
  navBarMiddle: d,
896
904
  navBarBottom: l,
897
905
  user: p,
898
- domainCode: v
906
+ domainCode: v,
907
+ useNewAvatar: C = !1
899
908
  }) {
900
909
  ut([
901
910
  [J, n != null ? n : !0],
902
911
  [ve, t != null ? t : ""]
903
912
  ]);
904
- const C = _e(J), [A] = V(wt), [g] = V(At), $ = _e(ve), [b] = V(bt), [D] = V(En), [I] = V(St);
913
+ const A = _e(J), [g] = V(wt), [$] = V(At), D = _e(ve), [b] = V(bt), [I] = V(Bn), [O] = V(St);
905
914
  return /* @__PURE__ */ u(y, { children: [
906
915
  /* @__PURE__ */ o(Ut, {}),
907
916
  /* @__PURE__ */ o(
908
917
  zn,
909
918
  {
910
- titleText: $,
919
+ titleText: D,
911
920
  "data-testid": s,
912
921
  height: b,
913
- middle: D
922
+ middle: I
914
923
  }
915
924
  ),
916
925
  /* @__PURE__ */ u(y, { sx: { display: "flex" }, children: [
917
926
  /* @__PURE__ */ o(
918
927
  Mn,
919
928
  {
920
- open: C,
921
- top: I,
929
+ open: A,
930
+ top: O,
922
931
  middle: d,
923
932
  bottom: l,
924
933
  user: p,
925
934
  domainCode: v,
926
- widthOpen: A,
927
- widthClosed: g,
935
+ widthOpen: g,
936
+ widthClosed: $,
928
937
  offsetTop: b,
929
938
  "data-testid": c,
930
- useNewAvatar: !0
939
+ useNewAvatar: C
931
940
  }
932
941
  ),
933
942
  /* @__PURE__ */ o(
@@ -961,8 +970,8 @@ const Dt = ({
961
970
  tt,
962
971
  {
963
972
  open: e,
964
- onClose: (b, D) => L(void 0, null, function* () {
965
- p && (D === "backdropClick" || D === "escapeKeyDown") || C || (s != null && s.onClick ? yield s.onClick() : c());
973
+ onClose: (D, b) => L(void 0, null, function* () {
974
+ p && (b === "backdropClick" || b === "escapeKeyDown") || C || (s != null && s.onClick ? yield s.onClick() : c());
966
975
  }),
967
976
  fullWidth: !0,
968
977
  maxWidth: i != null ? i : "xs",
@@ -987,8 +996,8 @@ const Dt = ({
987
996
  ae,
988
997
  {
989
998
  onClick: () => L(void 0, null, function* () {
990
- var b;
991
- A(!0), yield (b = r.onClick) == null ? void 0 : b.call(r), A(!1);
999
+ var D;
1000
+ A(!0), yield (D = r.onClick) == null ? void 0 : D.call(r), A(!1);
992
1001
  }),
993
1002
  "data-testid": r.testId,
994
1003
  disabled: r.disabled || C,
@@ -1006,13 +1015,13 @@ const Dt = ({
1006
1015
  lookup: n,
1007
1016
  label: i,
1008
1017
  inputValue: r
1009
- }) => sn({
1018
+ }) => an({
1010
1019
  queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
1011
1020
  (s) => s.label.toLowerCase().includes(r.toLowerCase())
1012
1021
  ) : n(r),
1013
1022
  queryKey: ["autocomplete", i, r]
1014
1023
  });
1015
- function Mo({
1024
+ function _o({
1016
1025
  lookup: e = () => L(this, null, function* () {
1017
1026
  }),
1018
1027
  enableHighlighting: t = !0,
@@ -1029,8 +1038,8 @@ function Mo({
1029
1038
  noOptionsText: A = "No options",
1030
1039
  popupIcon: g = /* @__PURE__ */ o(tn, {}),
1031
1040
  error: $ = !1,
1032
- helperText: b = "",
1033
- preLoadedOptions: D = void 0,
1041
+ helperText: D = "",
1042
+ preLoadedOptions: b = void 0,
1034
1043
  disablePortal: I = !1,
1035
1044
  disableIconFlip: O = !1
1036
1045
  }) {
@@ -1042,7 +1051,7 @@ function Mo({
1042
1051
  label: r,
1043
1052
  lookup: e,
1044
1053
  minLength: i,
1045
- preLoadedOptions: D
1054
+ preLoadedOptions: b
1046
1055
  }), W = P.length >= i;
1047
1056
  return /* @__PURE__ */ u("div", { "data-testid": c, children: [
1048
1057
  /* @__PURE__ */ o(
@@ -1072,7 +1081,7 @@ function Mo({
1072
1081
  fullWidth: !0,
1073
1082
  variant: v,
1074
1083
  error: $,
1075
- helperText: b,
1084
+ helperText: D,
1076
1085
  InputProps: k(a({}, h.InputProps), {
1077
1086
  endAdornment: /* @__PURE__ */ u(E, { children: [
1078
1087
  H ? /* @__PURE__ */ o(ke, { color: "inherit", size: 20 }) : null,
@@ -1090,10 +1099,10 @@ function Mo({
1090
1099
  isOptionEqualToValue: (h, f) => h.id === f.id,
1091
1100
  renderOption: (h, f, m) => {
1092
1101
  if (t) {
1093
- const x = rn(f.label, m.inputValue, {
1102
+ const x = on(f.label, m.inputValue, {
1094
1103
  insideWords: !0,
1095
1104
  findAllOccurrences: !0
1096
- }), M = an(f.label, x);
1105
+ }), M = rn(f.label, x);
1097
1106
  return /* @__PURE__ */ xe(
1098
1107
  "li",
1099
1108
  k(a({}, h), {
@@ -1162,7 +1171,7 @@ function Mo({
1162
1171
  )) })
1163
1172
  ] });
1164
1173
  }
1165
- const Ro = ({
1174
+ const Mo = ({
1166
1175
  lookup: e = () => L(void 0, null, function* () {
1167
1176
  }),
1168
1177
  onChange: t,
@@ -1179,19 +1188,19 @@ const Ro = ({
1179
1188
  helperText: A = "",
1180
1189
  disabled: g,
1181
1190
  popupIcon: $,
1182
- disableIconFlip: b
1191
+ disableIconFlip: D
1183
1192
  }) => {
1184
- const [D, I] = B(""), { data: O, isLoading: P } = yt({
1185
- inputValue: D,
1193
+ const [b, I] = B(""), { data: O, isLoading: P } = yt({
1194
+ inputValue: b,
1186
1195
  label: n,
1187
1196
  lookup: e,
1188
1197
  minLength: p != null ? p : 0,
1189
1198
  preLoadedOptions: C
1190
- }), N = D.length >= p;
1199
+ }), N = b.length >= p;
1191
1200
  return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(qt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
1192
1201
  be,
1193
1202
  {
1194
- sx: a(a({}, r), b ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1203
+ sx: a(a({}, r), D ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1195
1204
  "data-testid": d ? `${d}:Autocomplete` : void 0,
1196
1205
  loading: N ? P : !1,
1197
1206
  options: O != null ? O : [],
@@ -1235,7 +1244,7 @@ const Ro = ({
1235
1244
  return -1;
1236
1245
  try {
1237
1246
  const n = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
1238
- dn.from(n, "base64").toString("utf8").split("").map(function(s) {
1247
+ cn.from(n, "base64").toString("utf8").split("").map(function(s) {
1239
1248
  return "%" + ("00" + s.charCodeAt(0).toString(16)).slice(-2);
1240
1249
  }).join("")
1241
1250
  ), r = JSON.parse(i);
@@ -1243,7 +1252,7 @@ const Ro = ({
1243
1252
  } catch (t) {
1244
1253
  return -1;
1245
1254
  }
1246
- }, Ho = ({
1255
+ }, Ro = ({
1247
1256
  open: e = !1,
1248
1257
  closeHandler: t,
1249
1258
  setAuth0ExpiryTime: n
@@ -1301,7 +1310,7 @@ function Xn(e) {
1301
1310
  const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
1302
1311
  return t === "access_denied" && n.startsWith("User did not authorize the request");
1303
1312
  }
1304
- function Wo({
1313
+ function Ho({
1305
1314
  children: e,
1306
1315
  appName: t = "the app"
1307
1316
  }) {
@@ -1323,7 +1332,7 @@ function Wo({
1323
1332
  /* @__PURE__ */ o(rt, { children: /* @__PURE__ */ o(ae, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
1324
1333
  ] });
1325
1334
  }
1326
- return n ? /* @__PURE__ */ o(E, { children: e }) : /* @__PURE__ */ o(pn, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
1335
+ return n ? /* @__PURE__ */ o(E, { children: e }) : /* @__PURE__ */ o(dn, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
1327
1336
  }
1328
1337
  const Qn = {
1329
1338
  autoHideDuration: 6e3,
@@ -1369,7 +1378,7 @@ function to(s) {
1369
1378
  key: Jn()
1370
1379
  }), m);
1371
1380
  return p.current.push(x), p.current.length === 1 && l({ open: !0 }), x.key;
1372
- }, []), $ = (m = "", x = {}) => g(a({ message: m, severity: "success" }, x)), b = (m = "", x = {}) => g(a({ message: m, severity: "info" }, x)), D = (m = "", x = {}) => g(a({ message: m, severity: "warning" }, x)), I = (m = "", x = {}) => g(a({ message: m, severity: "error" }, x)), O = (m) => {
1381
+ }, []), $ = (m = "", x = {}) => g(a({ message: m, severity: "success" }, x)), D = (m = "", x = {}) => g(a({ message: m, severity: "info" }, x)), b = (m = "", x = {}) => g(a({ message: m, severity: "warning" }, x)), I = (m = "", x = {}) => g(a({ message: m, severity: "error" }, x)), O = (m) => {
1373
1382
  const x = p.current.findIndex((M) => M.key === m);
1374
1383
  if (x !== -1)
1375
1384
  return x === 0 ? (l({ open: !1 }), p.current[0]) : p.current.splice(x, 1);
@@ -1385,8 +1394,8 @@ function to(s) {
1385
1394
  setOpen: A,
1386
1395
  enqueueNotification: g,
1387
1396
  enqueueSuccessNotification: $,
1388
- enqueueInfoNotification: b,
1389
- enqueueWarningNotification: D,
1397
+ enqueueInfoNotification: D,
1398
+ enqueueWarningNotification: b,
1390
1399
  enqueueErrorNotification: I,
1391
1400
  removeNotification: O
1392
1401
  }, e), t);
@@ -1426,9 +1435,9 @@ function no() {
1426
1435
  throw new De("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1427
1436
  return e;
1428
1437
  }
1429
- const zo = Q(
1438
+ const Wo = Q(
1430
1439
  (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(to, k(a({}, e), { overrideState: t, overrideActions: n, children: i }))
1431
- ), oo = nn(), Uo = ({
1440
+ ), oo = nn(), zo = ({
1432
1441
  children: e,
1433
1442
  store: t
1434
1443
  }) => /* @__PURE__ */ o(pt, { store: t != null ? t : oo, children: e }), It = "domainCode";
@@ -1455,7 +1464,7 @@ const Ye = _(
1455
1464
  }, ro = (e) => {
1456
1465
  var t;
1457
1466
  return e === null ? "N/A" : (t = io[e]) != null ? t : "";
1458
- }, Go = ({
1467
+ }, Uo = ({
1459
1468
  isLoading: e,
1460
1469
  isOpen: t,
1461
1470
  onClose: n,
@@ -1465,11 +1474,11 @@ const Ye = _(
1465
1474
  }) => {
1466
1475
  const [c, d] = V(Ot), [l, p] = B(c), { enqueueSuccessNotification: v } = no(), C = i.length === 0, A = !!c && !i.includes(c) && !i.includes(l), g = !c || C || A, $ = () => L(void 0, null, function* () {
1467
1476
  l ? (d(l), v(`Set domain to ${l}`), n()) : d("");
1468
- }), b = () => L(void 0, null, function* () {
1477
+ }), D = () => L(void 0, null, function* () {
1469
1478
  c && !C && !A ? (p(c), n()) : g && s();
1470
1479
  });
1471
- let D;
1472
- return C ? 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__ */ u(
1480
+ let b;
1481
+ return C ? b = "Unable to retrieve your active organisations. Try logging in again." : A && (b = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ u(
1473
1482
  Dt,
1474
1483
  {
1475
1484
  isOpen: t,
@@ -1482,7 +1491,7 @@ const Ye = _(
1482
1491
  },
1483
1492
  secondaryButton: {
1484
1493
  text: g ? "Logout" : "Cancel",
1485
- onClick: b
1494
+ onClick: D
1486
1495
  },
1487
1496
  onClose: g ? () => {
1488
1497
  } : n,
@@ -1517,11 +1526,11 @@ const Ye = _(
1517
1526
  )
1518
1527
  }
1519
1528
  ),
1520
- D && /* @__PURE__ */ o(Yt, { error: !0, children: D })
1529
+ b && /* @__PURE__ */ o(Yt, { error: !0, children: b })
1521
1530
  ]
1522
1531
  }
1523
1532
  );
1524
- }, Vo = at({
1533
+ }, Go = at({
1525
1534
  palette: {
1526
1535
  primary: {
1527
1536
  dark: "#00A651",
@@ -1572,7 +1581,7 @@ const Ye = _(
1572
1581
  navBar: {
1573
1582
  backgroundColor: "#E8E8E8"
1574
1583
  }
1575
- }), qo = at({
1584
+ }), Vo = at({
1576
1585
  palette: {
1577
1586
  primary: {
1578
1587
  main: "#007236",
@@ -1674,10 +1683,10 @@ const Ye = _(
1674
1683
  titleText: ve,
1675
1684
  topBarHeight: bt,
1676
1685
  navBarTop: St
1677
- }, Xo = Q(() => ({ children: e }) => /* @__PURE__ */ o(pt, { children: e })), so = ({
1686
+ }, qo = Q(() => ({ children: e }) => /* @__PURE__ */ o(pt, { children: e })), so = ({
1678
1687
  initialValues: e,
1679
1688
  children: t
1680
- }) => (ut(e), /* @__PURE__ */ o(E, { children: t })), Qo = Q(
1689
+ }) => (ut(e), /* @__PURE__ */ o(E, { children: t })), Xo = Q(
1681
1690
  (e) => ({ children: t }) => /* @__PURE__ */ o(
1682
1691
  so,
1683
1692
  {
@@ -1690,37 +1699,37 @@ const Ye = _(
1690
1699
  children: t
1691
1700
  }
1692
1701
  )
1693
- ), Yo = Q(() => ({ children: e }) => {
1694
- const t = new ln();
1695
- return /* @__PURE__ */ o(cn, { client: t, children: e });
1702
+ ), Qo = Q(() => ({ children: e }) => {
1703
+ const t = new sn();
1704
+ return /* @__PURE__ */ o(ln, { client: t, children: e });
1696
1705
  });
1697
1706
  export {
1698
1707
  Dt as AgDialog,
1699
- _o as AppLayout,
1700
- Uo as AtomProvider,
1701
- Wo as AuthGuard,
1708
+ Lo as AppLayout,
1709
+ zo as AtomProvider,
1710
+ Ho as AuthGuard,
1702
1711
  $t as Context,
1703
1712
  De as ContextError,
1704
- Go as DomainCodeDialog,
1705
- To as ExampleComponent,
1706
- Mo as FetchAutocomplete,
1713
+ Uo as DomainCodeDialog,
1714
+ Oo as ExampleComponent,
1715
+ _o as FetchAutocomplete,
1707
1716
  so as HydrateAtoms,
1708
1717
  ft as NAVBAR_WIDTH_CLOSED,
1709
1718
  gt as NAVBAR_WIDTH_OPENED,
1710
- No as NavBar,
1711
- Fo as NavBarDarkStyledList,
1712
- Po as NavBarLightStyledList,
1713
- xn as NavBarProvider,
1714
- Lo as PageLayout,
1719
+ Po as NavBar,
1720
+ Eo as NavBarDarkStyledList,
1721
+ Fo as NavBarLightStyledList,
1722
+ Cn as NavBarProvider,
1723
+ No as PageLayout,
1715
1724
  to as SaladBarProvider,
1716
- Ho as SessionExpiryDialog,
1717
- Ro as SingleAutocomplete,
1725
+ Ro as SessionExpiryDialog,
1726
+ Mo as SingleAutocomplete,
1718
1727
  oo as atomStore,
1719
- wn as buildNavBarState,
1728
+ vn as buildNavBarState,
1720
1729
  Ot as domainCodeAtom,
1721
- Vo as fed21Theme,
1730
+ Go as fed21Theme,
1722
1731
  Un as getAuth0Expiry,
1723
- qo as internalAgSystemsTheme,
1732
+ Vo as internalAgSystemsTheme,
1724
1733
  q as navBarClasses,
1725
1734
  J as navBarOpenAtom,
1726
1735
  St as navBarTopAtom,
@@ -1728,15 +1737,15 @@ export {
1728
1737
  wt as navBarWidthOpenAtom,
1729
1738
  ve as titleTextAtom,
1730
1739
  bt as topBarHeightAtom,
1731
- En as topBarMiddleAtom,
1740
+ Bn as topBarMiddleAtom,
1732
1741
  yt as useAutocompleteOptions,
1733
- vn as useNavBar,
1742
+ xn as useNavBar,
1734
1743
  no as useSaladBar,
1735
- Xo as withAtomProvider,
1736
- Eo as withBrowserRouter,
1737
- Bo as withNavBarProvider,
1738
- Qo as withOverrideDefaults,
1739
- Yo as withQueryClient,
1740
- zo as withSaladBarProvider
1744
+ qo as withAtomProvider,
1745
+ Bo as withBrowserRouter,
1746
+ To as withNavBarProvider,
1747
+ Xo as withOverrideDefaults,
1748
+ Qo as withQueryClient,
1749
+ Wo as withSaladBarProvider
1741
1750
  };
1742
1751
  //# sourceMappingURL=index.js.map