@axos-web-dev/shared-components 2.0.0-dev.2-nav-1 → 2.0.0-dev.3-chatbot-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.
Files changed (72) hide show
  1. package/dist/ATMLocator/ATMLocator.js +84 -14
  2. package/dist/Auth/ErrorAlert.js +88 -6
  3. package/dist/Button/Button.js +120 -6
  4. package/dist/Calculators/Calculator.d.ts +1 -1
  5. package/dist/Calculators/Calculator.js +89 -18
  6. package/dist/Calculators/MarginTradingCalculator/index.js +112 -2
  7. package/dist/Carousel/index.js +109 -4
  8. package/dist/Chevron/index.js +114 -4
  9. package/dist/Comparison/Comparison.js +121 -5
  10. package/dist/ExecutiveBio/ExecutiveBio.interface.d.ts +2 -3
  11. package/dist/ExecutiveBio/ExecutiveBio.js +126 -4
  12. package/dist/FaqAccordion/index.js +110 -7
  13. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +110 -5
  14. package/dist/Forms/ApplyNow.js +109 -4
  15. package/dist/Forms/ContactCompany.d.ts +1 -1
  16. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  17. package/dist/Forms/ContactUsBusiness.js +104 -7
  18. package/dist/Forms/ContactUsBusinessNameEmail.js +104 -8
  19. package/dist/Forms/ContactUsNMLSId.js +104 -7
  20. package/dist/Forms/CpraRequest.js +96 -2
  21. package/dist/Forms/CraPublicFile.js +104 -7
  22. package/dist/Forms/DealerServices.d.ts +1 -1
  23. package/dist/Forms/EmailOnly.js +104 -7
  24. package/dist/Forms/EmailUs.js +40 -34
  25. package/dist/Forms/Forms.css.d.ts +3 -0
  26. package/dist/Forms/Forms.css.js +39 -39
  27. package/dist/Forms/MortgageRate/MortgageRateForm.js +96 -8
  28. package/dist/Forms/MortgageRate/MortgageRateWatch.js +92 -4
  29. package/dist/Forms/MortgageWarehouseLending.js +104 -7
  30. package/dist/Forms/SuccesForm.js +91 -8
  31. package/dist/Hyperlink/index.js +110 -5
  32. package/dist/ImageLink/ImageLink.js +106 -6
  33. package/dist/ImageLink/ImageLinkSet.js +114 -6
  34. package/dist/ImageLink/index.js +105 -6
  35. package/dist/Insight/Featured/CategorySelector.d.ts +1 -1
  36. package/dist/Insight/Featured/CategorySelector.js +109 -5
  37. package/dist/Insight/Featured/Featured.js +106 -8
  38. package/dist/Insight/Featured/Header.js +109 -4
  39. package/dist/LandingPageHeader/LandingPageHeader.d.ts +1 -1
  40. package/dist/Modal/Modal.js +122 -2
  41. package/dist/NavigationMenu/AxosALTS/index.js +111 -6
  42. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.d.ts +1 -12
  43. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +268 -183
  44. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +268 -37
  45. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +492 -63
  46. package/dist/NavigationMenu/AxosBank/NavBar.module.js +39 -42
  47. package/dist/NavigationMenu/AxosBank/SubNavBar.d.ts +1 -6
  48. package/dist/NavigationMenu/AxosBank/SubNavBar.js +3187 -118
  49. package/dist/NavigationMenu/AxosBank/index.d.ts +4 -6
  50. package/dist/NavigationMenu/AxosBank/index.js +457 -83
  51. package/dist/NavigationMenu/LaVictoire/index.js +118 -5
  52. package/dist/NavigationMenu/Navbar.d.ts +1 -4
  53. package/dist/NavigationMenu/Navbar.js +114 -11
  54. package/dist/NavigationMenu/SignInNavButton.js +122 -9
  55. package/dist/SetContainer/SetContainer.js +108 -7
  56. package/dist/SocialMediaBar/iconsRepository.js +124 -0
  57. package/dist/VideoTile/VideoTile.js +106 -2
  58. package/dist/VideoWrapper/index.js +110 -7
  59. package/dist/assets/ExecutiveBio/ExecutiveBio.css +0 -2
  60. package/dist/assets/Forms/Forms.css +94 -91
  61. package/dist/assets/NavigationMenu/AxosBank/NavBar.css +87 -125
  62. package/package.json +3 -5
  63. package/dist/NavigationMenu/AxosBank/DropwdownButton.d.ts +0 -7
  64. package/dist/NavigationMenu/AxosBank/DropwdownButton.js +0 -125
  65. package/dist/NavigationMenu/AxosBank/Menu.d.ts +0 -37
  66. package/dist/NavigationMenu/AxosBank/Menu.js +0 -150
  67. package/dist/NavigationMenu/AxosBank/MobileMenu/mobileReducer.d.ts +0 -36
  68. package/dist/NavigationMenu/AxosBank/MobileMenu/mobileReducer.js +0 -105
  69. package/dist/NavigationMenu/AxosBank/SubNavItem.d.ts +0 -1
  70. package/dist/NavigationMenu/AxosBank/SubNavItem.js +0 -206
  71. package/dist/NavigationMenu/utils.d.ts +0 -465
  72. package/dist/NavigationMenu/utils.js +0 -112
@@ -1,30 +1,133 @@
1
1
  "use client";
2
2
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
- import "../../../IconBillboard/IconBillboard.css.js";
3
+ import { useState, useRef, useMemo, useEffect } from "react";
4
+ import { AnimatePresence, motion } from "framer-motion";
5
+ import { usePathname } from "next/navigation.js";
6
+ import Link from "next/link.js";
7
+ import { getMenuData, getLoginGroups, getQuickLinks } from "./MobileNavData.js";
8
+ import styles from "./MobileMenu.module.js";
9
+ import "../../../Chevron/Chevron.css.js";
10
+ import "../../../Accordion/Accordion.js";
11
+ import "../../../Accordion/Accordion.css.js";
4
12
  import "../../../icons/ArrowIcon/ArrowIcon.css.js";
5
13
  import "../../../icons/CheckIcon/CheckIcon.css.js";
6
- import '../../../assets/Modal/Modal.css';import '../../../assets/BulletItem/BulletItem.css';import '../../../assets/Typography/Typography.css';import '../../../assets/icons/FollowIcon/FollowIcon.css';import '../../../assets/icons/DownloadIcon/DownloadIcon.css';import '../../../assets/themes/victorie.css';import '../../../assets/themes/ufb.css';import '../../../assets/themes/premier.css';import '../../../assets/themes/axos.css';/* empty css */
14
+ import '../../../assets/Modal/Modal.css';import '../../../assets/VideoWrapper/VideoWrapper.css';import '../../../assets/TopicalNavSet/TopicalNavSet.css';import '../../../assets/TopicalNavItem/TopicalNavItem.css';import '../../../assets/Topic/Topic.css';import '../../../assets/TextBlock/TextBlock.css';import '../../../assets/SocialMediaBar/SocialMediaBar.css';import '../../../assets/SecondaryFooter/SecondaryFooter.css';import '../../../assets/Pagination/Pagination.css';import '../../../assets/PageNavSet/PageNavigationSet.css';import '../../../assets/NavigationMenu/LaVictoire/NavBar2.css';import '../../../assets/NavigationMenu/AxosALTS/NavBar2.css';import '../../../assets/NavigationMenu/AxosClearing/NavBar2.css';import '../../../assets/NavigationMenu/AxosBank/SubNavbar.css';import '../../../assets/NavigationMenu/AxosBank/NavBar2.css';import '../../../assets/NavigationMenu/AxosAdvisorServices/SubNavbar.css';import '../../../assets/NavigationMenu/AxosAdvisorServices/NavBar2.css';import '../../../assets/NavigationMenu/AxosAdvisor/SubNavbar.css';import '../../../assets/NavigationMenu/AxosAdvisor/NavBar2.css';import '../../../assets/Insight/Featured/Header.css';import '../../../assets/Insight/Featured/CategorySelector.css';import '../../../assets/Insight/Featured/Featured.css';import '../../../assets/ImageLink/ImageLink.css';import '../../../assets/VideoTile/VideoTile.css';import '../../../assets/HelpArticle/HelpArticle.css';import '../../../assets/FooterSiteMap/AxosBank/FooterSiteMap.css';import '../../../assets/FooterDisclosure/LVF/LaVictorieFooter.css';import '../../../assets/DownloadTile/DownloadTile.css';import '../../../assets/CollectInformationAlert/CollectInformationAlert.css';import '../../../assets/Chatbot/ChatWindow.css';import '../../../assets/Chatbot/Chatbot.css';import '../../../assets/Chatbot/Bubble.css';import '../../../assets/Chatbot/AnimatedGradientBorder.css';import '../../../assets/CallToActionBar/CallToActionBar.css';import '../../../assets/Insight/Insight.css';import '../../../assets/AwardsItem/AwardsItem.css';import '../../../assets/AwardsBanner/AwardsBanner.css';import '../../../assets/Auth/SignIn.css';import '../../../assets/Auth/ErrorAlert.css';import '../../../assets/Calculators/MarginTradingCalculator/MarginTradingCalculator.css';import '../../../assets/Forms/QuickPricer/UserInformation.css';import '../../../assets/Forms/QuickPricer/QuickPricerResults.css';import '../../../assets/BulletItem/BulletItem.css';import '../../../assets/Typography/Typography.css';import '../../../assets/icons/FollowIcon/FollowIcon.css';import '../../../assets/icons/DownloadIcon/DownloadIcon.css';import '../../../assets/themes/victorie.css';import '../../../assets/themes/ufb.css';import '../../../assets/themes/premier.css';import '../../../assets/themes/axos.css';/* empty css */
7
15
  /* empty css */
8
16
  /* empty css */
9
17
  /* empty css */
10
18
  /* empty css */
11
19
  /* empty css */
12
- import { useRef, useReducer, useState, useEffect } from "react";
13
20
  import "clsx";
21
+ import "../../../AlertBanner/AlertBanner.css.js";
22
+ import "../../../Article/Article.css.js";
23
+ import "../../../IconBillboard/IconBillboard.css.js";
14
24
  /* empty css */
15
25
  /* empty css */
16
- import "../../../Chevron/Chevron.css.js";
17
26
  import "../../../Interstitial/Interstitial-variants.css.js";
18
27
  import "../../../Button/Button.css.js";
19
- import { useClickAway } from "react-use";
20
- /* empty css */
28
+ import "react-use";
29
+ import "../../../ArticlesSet/ArticlesSet.css.js";
30
+ import "../../../Calculators/calculator.css.js";
31
+ import "../../../Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js";
21
32
  import { useGlobalContext } from "../../../Modal/contextApi/store.js";
22
- import { AnimatePresence, motion } from "framer-motion";
23
- import Link from "next/link.js";
24
- import { usePathname } from "next/navigation.js";
25
- import styles from "./MobileMenu.module.js";
26
- import { mobileData } from "./MobileNavData.js";
27
- import { MenuActions, reducer } from "./mobileReducer.js";
33
+ import "../../../Calculators/ApyCalculator/ApyCalculator.css.js";
34
+ import "../../../Table/Table.css.js";
35
+ import "../../../Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js";
36
+ import "../../../Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js";
37
+ import "@hookform/resolvers/zod";
38
+ import "../../../Input/Checkbox.js";
39
+ import "../../../Input/CurrencyInput.js";
40
+ import "../../../Input/Dropdown.js";
41
+ import "../../../Input/Dropdown.css.js";
42
+ import "../../../Input/Input.js";
43
+ import "../../../Input/Input.css.js";
44
+ import "../../../Input/InputAmount.js";
45
+ import "../../../Input/InputPhone.js";
46
+ import "../../../Input/InputTextArea.js";
47
+ import "../../../Input/DownPaymentInput.js";
48
+ import "../../../Input/RadioButton.js";
49
+ import "../../../Input/PercentageInput.js";
50
+ import "react-hook-form";
51
+ import "../../../Calculators/BuyDownCalculator/BuyDownCalculator.css.js";
52
+ import "../../../Forms/Forms.css.js";
53
+ import "../../../Forms/HoneyPot/index.js";
54
+ import "../../../Forms/SalesforceFieldsForm.js";
55
+ import "../../../Input/RadioButton.css.js";
56
+ import "../../../Input/Checkbox.css.js";
57
+ import "../../../LoadingIndicator/LoadingIndicator.css.js";
58
+ import "../../../Inputs/Input.css.js";
59
+ /* empty css */
60
+ import "../../../Hyperlink/Hyperlink.css.js";
61
+ /* empty css */
62
+ import "iframe-resizer";
63
+ /* empty css */
64
+ import "../../../Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js";
65
+ import "../../../Calculators/MonthlyPaymentLVFCalculator/MonthlyPaymentCalculator.css.js";
66
+ import "../../../Calculators/SummitApyCalculator/BalanceAPYCalculator.css.js";
67
+ /* empty css */
68
+ import "react-dom";
69
+ /* empty css */
70
+ import "../../../Auth/SignInPassword.js";
71
+ /* empty css */
72
+ /* empty css */
73
+ /* empty css */
74
+ /* empty css */
75
+ import "../../../Carousel/index.js";
76
+ /* empty css */
77
+ /* empty css */
78
+ import "../../../Chatbot/store/chat.js";
79
+ import "../../../Chatbot/authenticate.js";
80
+ /* empty css */
81
+ /* empty css */
82
+ import "../../../Chatbot/store/messages.js";
83
+ /* empty css */
84
+ import "../../../Comparison/Comparison.css.js";
85
+ import "next/image.js";
86
+ import "../../../HeroBanner/HeroBanner.css.js";
87
+ import "../../../HeroBanner/LargeBanner.css.js";
88
+ import "../../../HeroBanner/SelectionBanner.css.js";
89
+ import "../../../SetContainer/SetContainer.css.js";
90
+ import "../../../Tab/Tab.css.js";
91
+ import "../../../icons/Star/Star.css.js";
92
+ import "../../../ContentBanner/ContentBanner.css.js";
93
+ /* empty css */
94
+ import "../../../ExecutiveBio/ExecutiveBio.css.js";
95
+ import "../../../FaqAccordion/index.js";
96
+ import "../../../FooterDisclosure/FooterDisclosure.css.js";
97
+ /* empty css */
98
+ /* empty css */
99
+ /* empty css */
100
+ import "../../../ImageBillboard/ImageBillboard.css.js";
101
+ import "next/script.js";
102
+ /* empty css */
103
+ /* empty css */
104
+ /* empty css */
105
+ /* empty css */
106
+ /* empty css */
107
+ import "../../../LandingPageHeader/LandingPageHeader.css.js";
108
+ /* empty css */
109
+ /* empty css */
110
+ /* empty css */
111
+ /* empty css */
112
+ /* empty css */
113
+ /* empty css */
114
+ /* empty css */
115
+ /* empty css */
116
+ /* empty css */
117
+ import "../../../PageNavItem/PageNavItem.css.js";
118
+ import "react-slick";
119
+ /* empty css */
120
+ /* empty css */
121
+ /* empty css */
122
+ /* empty css */
123
+ import "../../../StepItem/StepItem.css.js";
124
+ import "../../../StepItemSet/StepItemSet.css.js";
125
+ /* empty css */
126
+ /* empty css */
127
+ /* empty css */
128
+ /* empty css */
129
+ /* empty css */
130
+ /* empty css */
28
131
  const slideVariants = {
29
132
  enter: (direction) => ({
30
133
  x: direction === "forward" ? "100%" : "-100%",
@@ -43,43 +146,30 @@ const slideVariants = {
43
146
  position: "absolute"
44
147
  })
45
148
  };
46
- const initialState = {
47
- direction: "forward",
48
- isMobileMenuOpen: false,
49
- hasOpenedOnce: false,
50
- prevLevel: [],
51
- currentMenuData: null,
52
- stack: [],
53
- loginDrawer: false,
54
- loginData: {}
55
- };
56
- const MobileDrawerMenu = ({ menu }) => {
57
- const { resolveUrl } = useGlobalContext();
149
+ const MobileDrawerMenu = () => {
58
150
  const pathname = usePathname();
59
- const drawerRef = useRef(null);
60
- const loginRef = useRef(null);
61
- useClickAway(drawerRef, () => {
62
- dispatch({ type: MenuActions.SET_MOBILE_MENU_CLOSED, payload: {} });
63
- });
64
- useClickAway(loginRef, () => {
65
- dispatch({ type: MenuActions.SET_LOGIN_MENU_CLOSED, payload: {} });
66
- });
151
+ const { resolveUrl } = useGlobalContext();
152
+ const menuData = getMenuData(resolveUrl);
67
153
  const [queryString, setQueryString] = useState("");
68
- const [stack, dispatch] = useReducer(reducer, initialState);
69
- useEffect(() => {
70
- const menuProcessed = mobileData(menu);
71
- dispatch({
72
- type: MenuActions.INIT,
73
- payload: {
74
- currentMenuData: menuProcessed,
75
- stack: [{ title: "Menu", items: menuProcessed }],
76
- quickLinks: menu?.quickLinks
77
- }
78
- });
79
- }, [menu]);
154
+ const [open, setOpen] = useState(false);
155
+ const [stack, setStack] = useState([
156
+ { title: "Main Menu", items: menuData }
157
+ ]);
158
+ const [hasOpenedOnce, setHasOpenedOnce] = useState(false);
159
+ const [direction, setDirection] = useState("forward");
160
+ const [quickLinks, setQuickLinks] = useState([]);
161
+ const [loginDrawerOpen, setLoginDrawerOpen] = useState(false);
162
+ const drawerRef = useRef(null);
163
+ const loginDrawerRef = useRef(null);
164
+ const loginGroups = useMemo(() => getLoginGroups(resolveUrl), [resolveUrl]);
165
+ const currentLevel = stack[stack.length - 1];
166
+ const prevLevel = stack[stack.length - 2];
80
167
  useEffect(() => {
81
168
  if (!pathname) return;
82
- }, [pathname]);
169
+ const pathnameParts = "/" + pathname.split("/")[1];
170
+ const links = getQuickLinks(pathnameParts, resolveUrl);
171
+ setQuickLinks(links);
172
+ }, [pathname, resolveUrl]);
83
173
  useEffect(() => {
84
174
  if (typeof window !== "undefined") {
85
175
  const search = window.location.search;
@@ -89,33 +179,71 @@ const MobileDrawerMenu = ({ menu }) => {
89
179
  }
90
180
  }, []);
91
181
  const handleClick = (key) => {
92
- dispatch({ type: MenuActions.ADD_TO_STACK, payload: key });
182
+ const item = currentLevel.items[key];
183
+ if (typeof item === "object") {
184
+ setDirection("forward");
185
+ setStack((prev) => [...prev, { title: key, items: item }]);
186
+ }
93
187
  };
94
188
  const handleBack = () => {
95
- if (stack.stack.length > 1) {
96
- dispatch({ type: MenuActions.REMOVE_FROM_STACK, payload: {} });
189
+ if (stack.length > 1) {
190
+ setDirection("backward");
191
+ setStack((prev) => prev.slice(0, -1));
97
192
  }
98
193
  };
99
194
  const handleToggle = () => {
100
- dispatch({ type: MenuActions.SET_HAS_OPENED_ONCE, payload: {} });
101
- dispatch({ type: MenuActions.SET_MOBILE_MENU_OPEN, payload: {} });
195
+ setOpen((prev) => {
196
+ const isOpening = !prev;
197
+ if (isOpening && !hasOpenedOnce) {
198
+ setHasOpenedOnce(true);
199
+ setStack([{ title: "Menu", items: menuData }]);
200
+ }
201
+ return isOpening;
202
+ });
102
203
  };
103
- const handleLoginDrawerOpen = () => {
104
- dispatch({ type: MenuActions.SET_LOGIN_MENU_OPEN, payload: {} });
204
+ const handleLoginDrawerOpen = () => setLoginDrawerOpen(true);
205
+ const handleLoginDrawerClose = () => setLoginDrawerOpen(false);
206
+ const handleLoginDrawerOutsideClick = (e) => {
207
+ if (loginDrawerRef.current && !loginDrawerRef.current.contains(e.target)) {
208
+ setLoginDrawerOpen(false);
209
+ }
105
210
  };
106
- const handleLoginDrawerClose = () => {
107
- dispatch({ type: MenuActions.SET_LOGIN_MENU_CLOSED, payload: {} });
211
+ const handleOutsideClick = (e) => {
212
+ if (drawerRef.current && !drawerRef.current.contains(e.target)) {
213
+ setOpen(false);
214
+ }
108
215
  };
216
+ useEffect(() => {
217
+ if (open) {
218
+ document.addEventListener("mousedown", handleOutsideClick);
219
+ } else {
220
+ document.removeEventListener("mousedown", handleOutsideClick);
221
+ }
222
+ return () => document.removeEventListener("mousedown", handleOutsideClick);
223
+ }, [open]);
109
224
  useEffect(() => {
110
225
  const onEsc = (e) => {
111
- if (e.key === "Escape")
112
- dispatch({ type: MenuActions.SET_MOBILE_MENU_CLOSED, payload: {} });
226
+ if (e.key === "Escape") setOpen(false);
113
227
  };
114
- if (stack.isMobileMenuOpen) {
228
+ if (open) {
115
229
  document.addEventListener("keydown", onEsc);
116
230
  }
117
231
  return () => document.removeEventListener("keydown", onEsc);
118
- }, [stack.isMobileMenuOpen]);
232
+ }, [open]);
233
+ useEffect(() => {
234
+ if (!loginDrawerOpen) return;
235
+ document.addEventListener("mousedown", handleLoginDrawerOutsideClick);
236
+ return () => document.removeEventListener("mousedown", handleLoginDrawerOutsideClick);
237
+ }, [loginDrawerOpen]);
238
+ useEffect(() => {
239
+ const onEsc = (e) => {
240
+ if (e.key === "Escape") setLoginDrawerOpen(false);
241
+ };
242
+ if (loginDrawerOpen) {
243
+ document.addEventListener("keydown", onEsc);
244
+ }
245
+ return () => document.removeEventListener("keydown", onEsc);
246
+ }, [loginDrawerOpen]);
119
247
  return /* @__PURE__ */ jsxs(Fragment, { children: [
120
248
  /* @__PURE__ */ jsxs("div", { className: styles.mobileNavRow, children: [
121
249
  /* @__PURE__ */ jsx(
@@ -157,7 +285,7 @@ const MobileDrawerMenu = ({ menu }) => {
157
285
  }
158
286
  )
159
287
  ] }),
160
- /* @__PURE__ */ jsx(AnimatePresence, { children: stack.isMobileMenuOpen && /* @__PURE__ */ jsx(
288
+ /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(
161
289
  motion.div,
162
290
  {
163
291
  className: styles.overlay,
@@ -180,7 +308,7 @@ const MobileDrawerMenu = ({ menu }) => {
180
308
  children: [
181
309
  /* @__PURE__ */ jsx("p", { id: "menu-description", className: styles.sr_only, children: "Use tab to navigate this menu. Press Escape to close." }),
182
310
  /* @__PURE__ */ jsxs("div", { className: styles.header, children: [
183
- stack.stack?.length > 1 ? /* @__PURE__ */ jsxs(
311
+ stack.length > 1 ? /* @__PURE__ */ jsxs(
184
312
  "button",
185
313
  {
186
314
  onClick: handleBack,
@@ -205,7 +333,7 @@ const MobileDrawerMenu = ({ menu }) => {
205
333
  )
206
334
  }
207
335
  ),
208
- /* @__PURE__ */ jsx("span", { className: styles.prevlevel, children: stack.prevLevel?.title })
336
+ /* @__PURE__ */ jsx("span", { className: styles.prevlevel, children: prevLevel.title })
209
337
  ]
210
338
  }
211
339
  ) : /* @__PURE__ */ jsx(
@@ -258,7 +386,7 @@ const MobileDrawerMenu = ({ menu }) => {
258
386
  className: `${styles.level} flex middle`,
259
387
  "aria-label": "current menu level",
260
388
  children: [
261
- /* @__PURE__ */ jsx("h2", { className: styles.levelTitle, id: "menu-level", children: stack.currentMenuData?.title }),
389
+ /* @__PURE__ */ jsx("h2", { className: styles.levelTitle, id: "menu-level", children: currentLevel.title }),
262
390
  /* @__PURE__ */ jsx(
263
391
  "svg",
264
392
  {
@@ -283,81 +411,75 @@ const MobileDrawerMenu = ({ menu }) => {
283
411
  /* @__PURE__ */ jsx("nav", { "aria-label": "main navigation menu", children: /* @__PURE__ */ jsx(
284
412
  AnimatePresence,
285
413
  {
286
- custom: stack.direction,
414
+ custom: direction,
287
415
  mode: "sync",
288
416
  initial: false,
289
- children: /* @__PURE__ */ jsxs(
417
+ children: /* @__PURE__ */ jsx(
290
418
  motion.ul,
291
419
  {
292
420
  className: styles.menu,
293
- custom: stack.direction,
421
+ custom: direction,
294
422
  variants: slideVariants,
295
423
  initial: "enter",
296
424
  animate: "center",
297
425
  exit: "exit",
298
426
  transition: { duration: 0.3, ease: "linear" },
299
- children: [
300
- stack.stack.length > 1 && !stack.currentMenuData?.dropdown && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
427
+ children: Object.entries(
428
+ stack.length === 1 ? Object.fromEntries(
429
+ Object.entries(currentLevel.items).filter(
430
+ ([k]) => k !== "Log in"
431
+ )
432
+ ) : currentLevel.items
433
+ ).map(([key, value]) => {
434
+ const hasChildren = typeof value === "object";
435
+ return /* @__PURE__ */ jsx("li", { children: hasChildren ? /* @__PURE__ */ jsxs(
436
+ "button",
437
+ {
438
+ className: styles.menuItem,
439
+ onClick: () => handleClick(key),
440
+ "aria-label": `open submenu for ${key}`,
441
+ children: [
442
+ /* @__PURE__ */ jsx("span", { children: key }),
443
+ /* @__PURE__ */ jsx("span", { className: styles.chevron, children: /* @__PURE__ */ jsx(
444
+ "svg",
445
+ {
446
+ className: styles.chevronIcon,
447
+ width: 12,
448
+ height: 20,
449
+ viewBox: "0 0 12 20",
450
+ fill: "none",
451
+ xmlns: "http://www.w3.org/2000/svg",
452
+ children: /* @__PURE__ */ jsx(
453
+ "path",
454
+ {
455
+ d: "M1.76378 0.46875L11.2941 9.99908L1.76378 19.5294L0.703125 18.4687L9.17295 9.99908L0.703125 1.52941L1.76378 0.46875Z",
456
+ fill: "#4A5560"
457
+ }
458
+ )
459
+ }
460
+ ) })
461
+ ]
462
+ }
463
+ ) : /* @__PURE__ */ jsx(
301
464
  Link,
302
465
  {
303
- href: stack.currentMenuData.url + (queryString && !stack.currentMenuData.url.includes("?") ? `?${queryString}` : ""),
466
+ href: `${value}${queryString && !value.includes("?") ? `?${queryString}` : ""}`,
304
467
  className: styles.menuItem,
305
- children: /* @__PURE__ */ jsxs("span", { children: [
306
- stack.currentMenuData.title,
307
- " Home"
308
- ] })
468
+ children: /* @__PURE__ */ jsx("span", { children: key })
309
469
  }
310
- ) }),
311
- stack?.currentMenuData?.items?.map((item) => {
312
- const hasChildren = item.items && item.items.length > 0;
313
- return hasChildren ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
314
- "button",
315
- {
316
- className: styles.menuItem,
317
- onClick: () => handleClick(item),
318
- children: [
319
- /* @__PURE__ */ jsx("span", { children: item.label }),
320
- /* @__PURE__ */ jsx("span", { className: styles.chevron, children: /* @__PURE__ */ jsx(
321
- "svg",
322
- {
323
- className: styles.chevronIcon,
324
- width: 12,
325
- height: 20,
326
- viewBox: "0 0 12 20",
327
- fill: "none",
328
- xmlns: "http://www.w3.org/2000/svg",
329
- children: /* @__PURE__ */ jsx(
330
- "path",
331
- {
332
- d: "M1.76378 0.46875L11.2941 9.99908L1.76378 19.5294L0.703125 18.4687L9.17295 9.99908L0.703125 1.52941L1.76378 0.46875Z",
333
- fill: "#4A5560"
334
- }
335
- )
336
- }
337
- ) })
338
- ]
339
- }
340
- ) }, item.id + "1") : /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
341
- Link,
342
- {
343
- href: item?.url + (queryString && !item?.url?.includes("?") ? `?${queryString}` : ""),
344
- className: styles.menuItem,
345
- children: /* @__PURE__ */ jsx("span", { children: item.label })
346
- }
347
- ) }, item.id);
348
- })
349
- ]
470
+ ) }, key);
471
+ })
350
472
  },
351
- stack.currentMenuData?.title
473
+ currentLevel.title
352
474
  )
353
475
  }
354
476
  ) }),
355
- /* @__PURE__ */ jsx("div", { className: `${styles.quickLinks} flex middle between`, children: stack.quickLinks?.map((link) => /* @__PURE__ */ jsxs(
477
+ /* @__PURE__ */ jsx("div", { className: `${styles.quickLinks} flex middle between`, children: quickLinks.map((link) => /* @__PURE__ */ jsxs(
356
478
  "a",
357
479
  {
358
- href: resolveUrl(link.url) + (queryString && !link.url.includes("?") ? `?${queryString}` : ""),
480
+ href: link.url + (queryString && !link.url.includes("?") ? `?${queryString}` : ""),
359
481
  className: `${styles.quickLink} flex_col middle`,
360
- "aria-label": link.ariaLabel,
482
+ "aria-label": `Visit ${link.title} page`,
361
483
  children: [
362
484
  /* @__PURE__ */ jsx(
363
485
  "img",
@@ -369,10 +491,10 @@ const MobileDrawerMenu = ({ menu }) => {
369
491
  loading: "lazy"
370
492
  }
371
493
  ),
372
- /* @__PURE__ */ jsx("span", { children: link.label })
494
+ /* @__PURE__ */ jsx("span", { children: link.title })
373
495
  ]
374
496
  },
375
- link.id
497
+ link.title
376
498
  )) })
377
499
  ] }) })
378
500
  ]
@@ -380,7 +502,7 @@ const MobileDrawerMenu = ({ menu }) => {
380
502
  )
381
503
  }
382
504
  ) }),
383
- /* @__PURE__ */ jsx(AnimatePresence, { children: stack.loginDrawer && /* @__PURE__ */ jsx(
505
+ /* @__PURE__ */ jsx(AnimatePresence, { children: loginDrawerOpen && /* @__PURE__ */ jsx(
384
506
  motion.div,
385
507
  {
386
508
  className: styles.overlay,
@@ -391,7 +513,7 @@ const MobileDrawerMenu = ({ menu }) => {
391
513
  motion.div,
392
514
  {
393
515
  className: `${styles.drawer} flex_col`,
394
- ref: loginRef,
516
+ ref: loginDrawerRef,
395
517
  initial: { x: "100%" },
396
518
  animate: { x: 0 },
397
519
  exit: { x: "100%" },
@@ -446,74 +568,37 @@ const MobileDrawerMenu = ({ menu }) => {
446
568
  }
447
569
  )
448
570
  ] }),
449
- /* @__PURE__ */ jsx("div", { className: styles.loginDrawerContent, children: /* @__PURE__ */ jsx("div", { className: styles.loginAccordion, children: /* @__PURE__ */ jsxs(
571
+ /* @__PURE__ */ jsx("div", { className: styles.loginDrawerContent, children: /* @__PURE__ */ jsx("div", { className: styles.loginAccordion, children: /* @__PURE__ */ jsx(
450
572
  "ul",
451
573
  {
452
574
  className: styles.loginAccordionList,
453
575
  "aria-label": "Login options",
454
- children: [
455
- stack.loginData?.items?.filter((item) => item.items)?.map((group) => {
456
- return /* @__PURE__ */ jsxs(
457
- "li",
458
- {
459
- className: styles.loginAccordionGroup,
460
- "aria-label": `${group?.label} login options`,
461
- children: [
462
- /* @__PURE__ */ jsx("span", { className: styles.loginAccordionHeading, children: group.label }),
463
- /* @__PURE__ */ jsx("ul", { className: styles.loginAccordionGroupList, children: group.items?.map((item) => /* @__PURE__ */ jsx(
464
- "li",
465
- {
466
- "aria-label": `access ${item.label}`,
467
- children: /* @__PURE__ */ jsx(
468
- "a",
469
- {
470
- href: item.url + (queryString && !item.url.includes("?") ? `?${queryString}` : ""),
471
- className: styles.menuItem,
472
- children: /* @__PURE__ */ jsx("span", { children: item.label })
473
- }
474
- )
475
- },
476
- item.id
477
- )) })
478
- ]
479
- },
480
- group?.id
481
- );
482
- }),
483
- /* @__PURE__ */ jsxs(
484
- "li",
485
- {
486
- className: styles.loginAccordionGroup,
487
- children: [
488
- /* @__PURE__ */ jsx("span", { className: styles.loginAccordionHeading }),
489
- stack.loginData?.items.filter((item) => !item.items).map((group) => {
490
- return /* @__PURE__ */ jsx(
491
- "ul",
576
+ children: loginGroups.map((group) => /* @__PURE__ */ jsxs(
577
+ "li",
578
+ {
579
+ className: styles.loginAccordionGroup,
580
+ "aria-label": `${group.heading} login options`,
581
+ children: [
582
+ /* @__PURE__ */ jsx("span", { className: styles.loginAccordionHeading, children: group.heading }),
583
+ /* @__PURE__ */ jsx("ul", { className: styles.loginAccordionGroupList, children: group.items.map((item) => /* @__PURE__ */ jsx(
584
+ "li",
585
+ {
586
+ "aria-label": `access ${item.title}`,
587
+ children: /* @__PURE__ */ jsx(
588
+ Link,
492
589
  {
493
- className: styles.loginAccordionGroupList,
494
- children: /* @__PURE__ */ jsx(
495
- "li",
496
- {
497
- "aria-label": `access ${group.label}`,
498
- children: /* @__PURE__ */ jsx(
499
- "a",
500
- {
501
- href: group.url + (queryString && !group.url.includes("?") ? `?${queryString}` : ""),
502
- className: styles.menuItem,
503
- children: /* @__PURE__ */ jsx("span", { children: group.label })
504
- }
505
- )
506
- },
507
- group.id
508
- )
509
- },
510
- group.id
511
- );
512
- })
513
- ]
514
- }
515
- )
516
- ]
590
+ href: item.url + (queryString && !item.url.includes("?") ? `?${queryString}` : ""),
591
+ className: styles.menuItem,
592
+ children: /* @__PURE__ */ jsx("span", { children: item.title })
593
+ }
594
+ )
595
+ },
596
+ item.title
597
+ )) })
598
+ ]
599
+ },
600
+ group.heading
601
+ ))
517
602
  }
518
603
  ) }) })
519
604
  ]