(function(){function addStaticControls(){document.querySelector(".toggle-controls")&&document.body.classList.add("has-toggle-controls")}document.addEventListener("DOMContentLoaded",addStaticControls)})();
if(!String.prototype.startsWith)Object.defineProperty(String.prototype,"startsWith",{value:function(search,rawPos){var pos=rawPos>0?rawPos|0:0;return this.substring(pos,pos+search.length)===search}});if(!Element.prototype.matches)Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;if(!Element.prototype.closest)Element.prototype.closest=function(selector){var node=this;while(node.nodeType===1){if(node.matches(selector))return node;node=node.parentNode}return null};
var supportsCSS=function(){return{objectFit:function(){return"object-fit"in document.documentElement.style}(),scrollBehavior:function(){return"scroll-behavior"in document.documentElement.style}()}}();
(function(){function smoothScroll(event){var getHeight=function(selector){var el=document.querySelector(selector);if(el)return el.getBoundingClientRect().height;return 0};var onScrollEnd=function(fn,delay=500){var timer;return function(){clearTimeout(timer);timer=setTimeout(fn,delay)}};var onSmoothScroll=function(scrollToPos,scrollDist=0,duration=250){var start;var tweened;var startPos=window.pageYOffset;var tweenAt=scrollDist>2E3?.9:.8;var step=function(timestamp){start=start||timestamp;var progress=
timestamp-start;if(progress/duration>=tweenAt&&!tweened){duration=250;startPos=window.pageYOffset;start=timestamp;window.scrollTo(0,window.pageYOffset);tweened=true;return window.requestAnimationFrame(step)}var scrollDownExpr=(scrollToPos-startPos)*(progress/duration)+startPos;var scrollUpExpr=startPos-(startPos-scrollToPos)*(progress/duration);var scrollStep=startPos>scrollToPos?scrollUpExpr:scrollDownExpr;window.scrollTo(0,scrollStep);if(progress<duration)return window.requestAnimationFrame(step);
window.scrollTo(0,scrollToPos);tweened=false};window.requestAnimationFrame(step)};var DATA_SCROLL_SMOOTH='[data-scroll\x3d"smooth"]';var DATA_SROLL_OFFSET="data-scroll-offset";var anchor=event.target.closest(DATA_SCROLL_SMOOTH);if(anchor){var href=anchor.getAttribute("href");var el=href.match(/^#$/)&&href.startsWith("#")?document.querySelector("body"):document.querySelector(href);if(el){event.preventDefault();var fixedElOffset=getHeight(".control-menu")+getHeight("#banner");var offset=anchor.getAttribute(DATA_SROLL_OFFSET)?
parseInt(anchor.getAttribute(DATA_SROLL_OFFSET),10):20;var elRelativePos=el.getBoundingClientRect().top;var windowPos=window.pageYOffset;var scrollToPos=windowPos+elRelativePos-fixedElOffset-offset;var scrollDist=windowPos-scrollToPos;if(supportsCSS.scrollBehavior)window.scrollTo(0,scrollToPos);else onSmoothScroll(scrollToPos,scrollDist)}}}document.addEventListener("click",smoothScroll,false)})();
