!function(){const e=document.getElementById("masthead"),t=document.getElementById("search-toggle");if(null!==t){const n=document.getElementById("header-search"),s=n.getElementsByTagName("input")[0],a=t.getElementsByTagName("span")[0],o=a.innerText;t.addEventListener("click",(function(){e.classList.toggle("hide-header-search"),o===a.innerText?(a.innerText=newspackScreenReaderText.close_search,n.setAttribute("aria-expanded","true"),t.setAttribute("aria-expanded","true"),s.focus()):(a.innerText=o,n.setAttribute("aria-expanded","false"),t.setAttribute("aria-expanded","false"),t.focus())}),!1)}const n=document.getElementsByClassName("mobile-menu-toggle"),s=document.body,a=document.getElementById("mobile-sidebar-fallback"),o=document.getElementsByClassName("desktop-menu-toggle"),d=document.getElementById("desktop-sidebar-fallback"),c=document.getElementsByClassName("subpage-toggle");function i(e){const t=document.getElementById(e);t.parentNode.removeChild(t)}function l(e,t,n){s.classList.add(e),t.focus(),function(e){const t=document.createElement("div");t.setAttribute("class","overlay-mask"),t.setAttribute("id",e),document.body.appendChild(t)}(n)}function r(e,t,n){s.classList.remove(e),t.focus(),i(n)}for(let t=0;t<n.length;t++){const o=e.querySelector(".mobile-menu-toggle"),d=a.querySelector(".mobile-menu-toggle");n[t].addEventListener("click",(function(){s.classList.contains("mobile-menu-opened")?r("mobile-menu-opened",o,"mask-mobile"):l("mobile-menu-opened",d,"mask-mobile")}),!1)}for(let t=0;t<o.length;t++){const n=e.querySelector(".desktop-menu-toggle"),a=d.querySelector(".desktop-menu-toggle");o[t].addEventListener("click",(function(){s.classList.contains("desktop-menu-opened")?r("desktop-menu-opened",n,"mask-desktop"):l("desktop-menu-opened",a,"mask-desktop")}),!1)}if(0<c.length&&e){const t=document.getElementById("subpage-sidebar-fallback"),n=e.querySelector(".subpage-toggle"),a=t.querySelector(".subpage-toggle");for(let e=0;e<c.length;e++)c[e].addEventListener("click",(function(){s.classList.contains("subpage-menu-opened")?r("subpage-menu-opened",n,"mask-subpage"):l("subpage-menu-opened",a,"mask-subpage")}),!1)}if(document.addEventListener("click",(function(e){if(e.target&&"overlay-mask"===e.target.className){const t=e.target.id,n=t.split("-");s.classList.remove(n[1]+"-menu-opened"),i(t)}})),e){const t=e.getElementsByClassName("submenu-expand");if(0<t.length)for(let e=0;e<t.length;e++){const n=t[e].querySelector("span.screen-reader-text");t[e].addEventListener("click",(function(){t[e].classList.contains("open-dropdown")?(t[e].classList.remove("open-dropdown"),t[e].setAttribute("aria-expanded","false"),n.innerText=newspackScreenReaderText.close_dropdown_menu):(t[e].classList.add("open-dropdown"),t[e].setAttribute("aria-expanded","true"),n.innerText=newspackScreenReaderText.open_dropdown_menu)}),!1)}}if(s.classList.contains("h-stk")&&s.classList.contains("h-sub")&&(s.classList.contains("single-featured-image-behind")||s.classList.contains("single-featured-image-beside"))){let t,n=0;window.onscroll=function(){!function(){const s=window.pageYOffset,a=(new Date).getTime();t||(a-n>300&&(n=a),t=setTimeout((function(){t=null,n=(new Date).getTime()}),100)),200>=s?e.classList.remove("head-scroll"):e.classList.add("head-scroll")}()}}const m=document.getElementById("comments-toggle");if(null!==m){const e=document.getElementById("comments-wrapper"),t=m.getElementsByTagName("span")[0];m.addEventListener("click",(function(){e.classList.contains("comments-hide")?(e.classList.remove("comments-hide"),t.innerText=newspackScreenReaderText.collapse_comments):(e.classList.add("comments-hide"),t.innerText=newspackScreenReaderText.expand_comments)}),!1)}const u=document.getElementById("toggle-order-details");if(null!==u){const e=document.getElementById("order-details-wrapper"),t=u.getElementsByTagName("span")[0],n=newspackScreenReaderText.hide_order_details,s=newspackScreenReaderText.show_order_details;u.addEventListener("click",(function(){e.classList.contains("order-details-hidden")?(e.classList.remove("order-details-hidden"),u.classList.remove("order-details-hidden"),t.innerText=n):(e.classList.add("order-details-hidden"),u.classList.add("order-details-hidden"),t.innerText=s)}),!1)}}();