{"version":3,"file":"showHideNavigation.component.bundle.js","sources":["../../../../Frontend/js/components/showHideNavigation.component.ts"],"sourcesContent":["import { debounce } from \"~/utils/debounce.util\"\r\n\r\nexport const setupNavigationVisibility = (): void => {\r\n let lastScrollTop = 0\r\n const scrollThreshold = 100\r\n const mainNavigation = document.querySelector(\"#main-navigation\") as HTMLElement\r\n\r\n const handleScroll = () => {\r\n const navigationExpanded = document.querySelector('.accordion-active[aria-expanded=\"true\"]') as HTMLElement\r\n const scrollTop = window.scrollY || document.documentElement.scrollTop\r\n\r\n if (scrollTop > lastScrollTop) {\r\n if (scrollTop > scrollThreshold && !navigationExpanded) {\r\n mainNavigation.style.transform = \"translateY(-100%)\"\r\n }\r\n } else {\r\n mainNavigation.style.transform = \"translateY(0)\"\r\n }\r\n\r\n lastScrollTop = scrollTop <= 0 ? 0 : scrollTop\r\n }\r\n window.addEventListener(\r\n \"scroll\",\r\n debounce(() => {\r\n handleScroll()\r\n }, 10)\r\n )\r\n}\r\n"],"names":["setupNavigationVisibility","lastScrollTop","scrollThreshold","mainNavigation","handleScroll","navigationExpanded","scrollTop","debounce"],"mappings":"4DAEO,MAAMA,EAA4B,IAAY,CACnD,IAAIC,EAAgB,EACpB,MAAMC,EAAkB,IAClBC,EAAiB,SAAS,cAAc,kBAAkB,EAE1DC,EAAe,IAAM,CACnB,MAAAC,EAAqB,SAAS,cAAc,yCAAyC,EACrFC,EAAY,OAAO,SAAW,SAAS,gBAAgB,UAEzDA,EAAYL,EACVK,EAAYJ,GAAmB,CAACG,IAClCF,EAAe,MAAM,UAAY,qBAGnCA,EAAe,MAAM,UAAY,gBAGnBF,EAAAK,GAAa,EAAI,EAAIA,CACvC,EACO,OAAA,iBACL,SACAC,EAAS,IAAM,CACAH,EAAA,CAAA,EACZ,EAAE,CACP,CACF"}