{"version":3,"file":"webshop-navigation.js?v=9.1.8","mappings":";yGAAe,SAASA,IACtB,MAAMC,EAAM,UACNC,EAAYC,SAASC,cAA8B,oDACzD,IAAIC,EAAaC,OAAOC,QAoBxBD,OAAOE,iBAAiB,UAAU,KAChC,MAAM,QAAED,GAAYD,OAnBtB,IAAgBG,IAqBPF,EApBFL,IAoBWG,EAhBJI,EACVP,EAAUQ,UAAUC,IAAIV,GAItBQ,EAAWP,EAAUU,aACvBV,EAAUQ,UAAUG,OAAOZ,GAI7BC,EAAUQ,UAAUC,IAAIV,IAOxBI,EAAaE,CAAO,GAExB","sources":["webpack://empori-base/./src/controls/webshop-navigation.ts"],"sourcesContent":["export default function WebshopNavigation() {\r\n const cls = 'visible';\r\n const searchBar = document.querySelector('.empori-primeflow-header-search-fullwidth.mobile');\r\n let lastScroll = window.scrollY;\r\n \r\n function setCls(currentY: number, lastY: number) {\r\n if (!searchBar) {\r\n return;\r\n }\r\n \r\n if (lastY > currentY) {\r\n searchBar.classList.add(cls);\r\n return;\r\n }\r\n\r\n if (currentY > searchBar.clientHeight) {\r\n searchBar.classList.remove(cls);\r\n return;\r\n }\r\n\r\n searchBar.classList.add(cls);\r\n }\r\n\r\n window.addEventListener('scroll', () => {\r\n const { scrollY } = window;\r\n\r\n setCls(scrollY, lastScroll);\r\n lastScroll = scrollY;\r\n });\r\n}"],"names":["WebshopNavigation","cls","searchBar","document","querySelector","lastScroll","window","scrollY","addEventListener","currentY","classList","add","clientHeight","remove"],"sourceRoot":""}