2024-02-08 12:32:18 +00:00
|
|
|
!function(){"use strict";if("querySelector"in document&&"addEventListener"in window){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(document.documentElement.contains(this))do{if(t.matches(e))return t}while(null!==(t=t.parentElement));return null});var o=function(t){return Array.prototype.filter.call(t.parentNode.children,function(e){return e!==t})},e=document.querySelectorAll(".menu-toggle"),t=document.querySelectorAll("nav .dropdown-menu-toggle"),n=document.querySelectorAll("nav .main-nav ul a"),l=document.querySelector(".mobile-menu-control-wrapper"),a=document.body,c=document.documentElement,u=function(e){if(e&&a.classList.contains("dropdown-hover")){var t=e.querySelectorAll("li.menu-item-has-children");for(f=0;f<t.length;f++)t[f].querySelector(".dropdown-menu-toggle").removeAttribute("tabindex"),t[f].querySelector(".dropdown-menu-toggle").setAttribute("role","presentation"),t[f].querySelector(".dropdown-menu-toggle").removeAttribute("aria-expanded"),t[f].querySelector(".dropdown-menu-toggle").removeAttribute("aria-label")}},r=function(e){"false"!==e.getAttribute("aria-expanded")&&e.getAttribute("aria-expanded")?(e.setAttribute("aria-expanded","false"),e.setAttribute("aria-label",generatepressMenu.openSubMenuLabel)):(e.setAttribute("aria-expanded","true"),e.setAttribute("aria-label",generatepressMenu.closeSubMenuLabel))},s=function(e,t){var n="";if(n=(t=t||this).getAttribute("data-nav")?document.getElementById(t.getAttribute("data-nav")):document.getElementById(t.closest("nav").getAttribute("id"))){var s=!1,o=(t.closest(".mobile-menu-control-wrapper")&&(s=!0),n.getElementsByTagName("ul")[0]);if(n.classList.contains("toggled"))n.classList.remove("toggled"),c.classList.remove("mobile-menu-open"),o&&o.setAttribute("aria-hidden","true"),t.setAttribute("aria-expanded","false"),(s||l&&n.classList.contains("main-navigation"))&&l.classList.remove("toggled"),u(o);else{n.classList.add("toggled"),c.classList.add("mobile-menu-open"),o&&o.setAttribute("aria-hidden","false"),t.setAttribute("aria-expanded","true"),s?(l.classList.add("toggled"),l.querySelector(".search-item")&&l.querySelector(".search-item").classList.contains("active")&&l.querySelector(".search-item").click()):l&&n.classList.contains("main-navigation")&&l.classList.add("toggled");t=o;if(t&&a.classList.contains("dropdown-hover")){var r=t.querySelectorAll("li.menu-item-has-children");for(f=0;f<r.length;f++)r[f].querySelector(".dropdown-menu-toggle").setAttribute("tabindex","0"),r[f].querySelector(".dropdown-menu-toggle").setAttribute("role","button"),r[f].querySelector(".dropdown-menu-toggle").setAttribute("aria-expanded","false"),r[f].querySelector(".dropdown-menu-toggle").setAttribute("aria-label",generatepressMenu.openSubMenuLabel)}}}};for(f=0;f<e.length;f++)e[f].addEventListener("click",s,!1);var i=function(e,t){if(((t=t||this).closest("nav").classList.contains("toggled")||c.classList.contains("slide-opened"))&&!a.classList.contains("dropdown-click")){e.preventDefault();var n,t=t.closest("li");if(r(t.querySelector(".dropdown-menu-toggle")),n=t.querySelector(".sub-menu")?t.querySelector(".sub-menu"):t.querySelector(".children"),generatepressMenu.toggleOpenedSubMenus){var s=o(t);for(f=0;f<s.length;f++)s[f].classList.contains("sfHover")&&(s[f].classList.remove("sfHover"),s[f].querySelector(".toggled-on").classList.remove("toggled-on"),r(s[f].querySelector(".dropdown-menu-toggle")))}t.classList.toggle("sfHover"),n.classList.toggle("toggled-on")}e.stopPropagation()};for(f=0;f<t.length;f++)t[f].addEventListener("click",i,!1),t[f].addEventListener("keypress",function(e){"Enter"!==e.key&&" "!==e.key||i(e,this)},!1);var d=function(){var e=document.querySelectorAll(".toggled, .has-active-search");for(f=0;f<e.length;f++){var t=e[f].querySelector(".menu-toggle");if((t=l&&!t.closest("nav").classList.contains("mobile-menu-control-wrapper")?l.querySelector(".menu-toggle"):t)&&null===t.offsetParent){if(e[f].classList
|