const header=document.querySelector('.js-header');const stickyClass='sticky';let lastScrollTop=0;let isWaiting=false;window.addEventListener('scroll',()=>{if(!isWaiting){window.requestAnimationFrame(()=>{let currentScroll=window.scrollY||window.pageYOffset||document.documentElement.scrollTop;if(currentScroll>lastScrollTop){header.classList.remove(stickyClass);}else if(currentScroll0){header.classList.add(stickyClass);}else if(currentScroll<=0){header.classList.remove(stickyClass);} lastScrollTop=currentScroll;isWaiting=false;});isWaiting=true;}},false);(function(menuConfig){var defaultConfig={mobileMenuMode:'overlay',animationSpeed:300,submenuWidth:300,doubleClickTime:500,mobileMenuExpandableSubmenus:false,isHoverMenu:true,wrapperSelector:'.navbar',buttonSelector:'.navbar__toggle',menuSelector:'.navbar__menu',submenuSelector:'.navbar__submenu',mobileMenuSidebarLogoSelector:null,mobileMenuSidebarLogoUrl:null,relatedContainerForOverlayMenuSelector:null,ariaButtonAttribute:'aria-haspopup',separatorItemClass:'is-separator',parentItemClass:'has-submenu',submenuLeftPositionClass:'is-left-submenu',submenuRightPositionClass:'is-right-submenu',mobileMenuOverlayClass:'navbar_mobile_overlay',mobileMenuSubmenuWrapperClass:'navbar__submenu_wrapper',mobileMenuSidebarClass:'navbar_mobile_sidebar',mobileMenuSidebarOverlayClass:'navbar_mobile_sidebar__overlay',hiddenElementClass:'is-hidden',openedMenuClass:'is-active',noScrollClass:'no-scroll',relatedContainerForOverlayMenuClass:'is-visible'};var config={};Object.keys(defaultConfig).forEach(function(key){config[key]=defaultConfig[key];});if(typeof menuConfig==='object'){Object.keys(menuConfig).forEach(function(key){config[key]=menuConfig[key];});} function init(){if(!document.querySelectorAll(config.wrapperSelector).length){return;} initSubmenuPositions();if(config.mobileMenuMode==='overlay'){initMobileMenuOverlay();}else if(config.mobileMenuMode==='sidebar'){initMobileMenuSidebar();} initClosingMenuOnClickLink();if(!config.isHoverMenu){initAriaAttributes();}};function initSubmenuPositions(){var submenuParents=document.querySelectorAll(config.wrapperSelector+' .'+config.parentItemClass);for(var i=0;i';} menuContentHTML+=document.querySelector(config.menuSelector).outerHTML;menuWrapper.innerHTML=menuContentHTML;var menuOverlay=document.createElement('div');menuOverlay.classList.add(config.mobileMenuSidebarOverlayClass);menuOverlay.classList.add(config.hiddenElementClass);document.body.appendChild(menuOverlay);document.body.appendChild(menuWrapper);if(config.mobileMenuExpandableSubmenus){wrapSubmenusIntoContainer(menuWrapper);initToggleSubmenu(menuWrapper);}else{setAriaForSubmenus(menuWrapper);} menuWrapper.addEventListener('click',function(e){e.stopPropagation();});menuOverlay.addEventListener('click',function(){menuWrapper.classList.add(config.hiddenElementClass);menuOverlay.classList.add(config.hiddenElementClass);button.classList.remove(config.openedMenuClass);button.setAttribute(config.ariaButtonAttribute,false);document.documentElement.classList.remove(config.noScrollClass);});var button=document.querySelector(config.buttonSelector);button.addEventListener('click',function(){menuWrapper.classList.toggle(config.hiddenElementClass);menuOverlay.classList.toggle(config.hiddenElementClass);button.classList.toggle(config.openedMenuClass);button.setAttribute(config.ariaButtonAttribute,button.classList.contains(config.openedMenuClass));document.documentElement.classList.toggle(config.noScrollClass);});} function setAriaForSubmenus(menuWrapper){var submenus=menuWrapper.querySelectorAll(config.submenuSelector);for(var i=0;icurrentTime){e.stopPropagation();closeMenu(this,true);}});}}}} function initAriaAttributes(){var allAriaElements=document.querySelectorAll(config.wrapperSelector+' '+'*[aria-hidden]');for(var i=0;i{event.stopPropagation();searchOverlay.classList.toggle('expanded');if(searchOverlay.classList.contains('expanded')){setTimeout(()=>{searchInput.focus();},60);}});searchOverlay.addEventListener('click',(event)=>{event.stopPropagation();});document.body.addEventListener('click',()=>{searchOverlay.classList.remove('expanded');});} (function(){const shareButton=document.querySelector('.js-content__share-button');const sharePopup=document.querySelector('.js-content__share-popup');if(shareButton&&sharePopup){sharePopup.addEventListener('click',function(e){e.stopPropagation();});shareButton.addEventListener('click',function(e){e.preventDefault();e.stopPropagation();sharePopup.classList.toggle('is-visible');});document.body.addEventListener('click',function(){sharePopup.classList.remove('is-visible');});} const Config={Link:".js-share",Width:500,Height:500};const shareLinks=document.querySelectorAll(Config.Link);shareLinks.forEach(link=>{link.addEventListener('click',PopupHandler);});function PopupHandler(e){e.preventDefault();const target=e.target.closest(Config.Link);if(!target)return;if(sharePopup){sharePopup.classList.remove('is-visible');} const px=Math.floor((window.innerWidth-Config.Width)/2);const py=Math.floor((window.innerHeight-Config.Height)/2);const linkHref=target.href;const popup=window.open(linkHref,"social",`width=${Config.Width},height=${Config.Height},left=${px},top=${py},location=0,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1`);if(popup){popup.focus();}}})();document.addEventListener('DOMContentLoaded',()=>{const backToTopButton=document.getElementById('backToTop');if(backToTopButton){const backToTopScrollFunction=()=>{if(document.body.scrollTop>400||document.documentElement.scrollTop>400){backToTopButton.classList.add('is-visible');}else{backToTopButton.classList.remove('is-visible');}};const backToTopFunction=()=>{window.scrollTo({top:0,behavior:'smooth'});};window.addEventListener('scroll',backToTopScrollFunction);backToTopButton.addEventListener('click',backToTopFunction);}});(function(){let wrappers=document.querySelectorAll('.post__video, .post__iframe');for(let i=0;i-1&&h.indexOf('%')>-1){w=parseFloat(w.replace('%',''));h=parseFloat(h.replace('%',''));ratio=h/w;}else if(w.indexOf('%')===-1&&h.indexOf('%')===-1){w=parseInt(w,10);h=parseInt(h,10);ratio=h/w;} if(ratio!==false){let ratioValue=(ratio*100)+'%';wrappers[i].setAttribute('style','--embed-aspect-ratio:'+ratioValue);}}})();