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,GAAgB+B,EAAgBS,OAAS,GAAMzC,IAC/CK,IACAL,GAAY,GAGxB,CACA,MAAM0C,EA5BN,SAAkBC,EAAMC,GACpB,IAAIC,EACJ,OAAO,WACH,MAAMC,EAAUC,KACVC,EAAOC,UACbpC,aAAagC,GACbA,EAAYpB,YAAW,KACnBkB,EAAKO,MAAMJ,EAASE,EAAK,GAC1BJ,EACP,CACJ,CAkB8BO,CAASlB,EAAc,IACrDI,OAAOzB,iBAAiB,SAAU8B,GAClCT,GAAc,C","sources":["webpack:///./wwwroot/js/paragraphScroller.ts"],"sourcesContent":["import { isMediumScreen } from './utils';\nexport const paragraphScroller = () => {\n const letterButtons = document.querySelectorAll('.letter-button');\n let shouldExecuteScrollEvent = true;\n let lastIndex = false;\n let currentIndex = 0;\n let isScrolling;\n var userAgent = navigator.userAgent;\n let contentSection;\n const isElementInView = (elem) => {\n const scrollPosition = window.scrollY || window.pageYOffset;\n return (scrollPosition >= elem.offsetTop - 150 &&\n scrollPosition < elem.offsetTop + elem.offsetHeight);\n };\n const toggleClasses = (index) => {\n letterButtons.forEach((btn) => {\n btn.classList.remove('bg-primary-color', 'text-white');\n });\n // letterButtons[index].classList.add('bg-primary-color', 'text-white');\n };\n letterButtons.forEach((button, index) => {\n button.addEventListener('click', () => {\n clearTimeout(isScrolling);\n shouldExecuteScrollEvent = false;\n const contentId = button.getAttribute('data-value');\n if (contentId) {\n contentSection = document.getElementById(contentId);\n }\n else {\n const glossaryTitle = button.innerText.trim();\n contentSection = document.getElementById(glossaryTitle);\n }\n if (contentSection) {\n contentSection.scrollIntoView({\n behavior: 'smooth',\n inline: 'nearest',\n });\n const header = document.querySelector('.qq__sticky-container');\n if (isMediumScreen() && header) {\n setTimeout(() => {\n const headerStyles = getComputedStyle(header);\n if (headerStyles.position === 'fixed') {\n // Header is sticky, adjust scrolling\n const headerHeight = header.offsetHeight;\n contentSection.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n inline: 'nearest',\n offsetTop: -headerHeight,\n });\n }\n }, 500);\n }\n toggleClasses(index);\n }\n isScrolling = setTimeout(() => {\n shouldExecuteScrollEvent = true;\n }, 1000);\n });\n });\n const contentSections = document.querySelectorAll('.content-section');\n function debounce(func, delay) {\n let timeoutId;\n return function () {\n const context = this;\n const args = arguments;\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => {\n func.apply(context, args);\n }, delay);\n };\n }\n function scrollAction() {\n if (shouldExecuteScrollEvent) {\n contentSections.forEach((section, index) => {\n if (isElementInView(section)) {\n currentIndex = index;\n }\n });\n if (currentIndex < contentSections.length - 1) {\n lastIndex = false;\n toggleClasses(currentIndex);\n }\n if (currentIndex == contentSections.length - 1 && !lastIndex) {\n toggleClasses(currentIndex);\n lastIndex = true;\n }\n }\n }\n const debouncedScrollAction = debounce(scrollAction, 10);\n window.addEventListener('scroll', debouncedScrollAction);\n scrollAction();\n};\n"],"names":["paragraphScroller","letterButtons","document","querySelectorAll","isScrolling","shouldExecuteScrollEvent","lastIndex","currentIndex","navigator","userAgent","contentSection","toggleClasses","index","forEach","btn","classList","remove","button","addEventListener","clearTimeout","contentId","getAttribute","getElementById","glossaryTitle","innerText","trim","scrollIntoView","behavior","inline","header","querySelector","setTimeout","getComputedStyle","position","headerHeight","offsetHeight","block","offsetTop","contentSections","scrollAction","section","elem","scrollPosition","window","scrollY","pageYOffset","isElementInView","length","debouncedScrollAction","func","delay","timeoutId","context","this","args","arguments","apply","debounce"],"sourceRoot":""}