!function(){"use strict";function e(){document.querySelectorAll(".blynex-responsive-nav-menu").forEach(t)}function t(e){const t=e.querySelector(".menu-title"),i=e.querySelector(".menu-toggle"),a=e.querySelector(".menu-items");if(!t||!a)return;const s="true"===e.dataset.enableAccordion,d=(e.dataset.togglePosition,e.dataset.desktopDirection||"horizontal"),r=e.dataset.tabletDirection||"vertical",o=e.dataset.mobileDirection||"vertical",u=a.id||`menu-${Math.random().toString(36).substr(2,9)}`;a.id=u,t.setAttribute("aria-expanded","false"),t.setAttribute("aria-controls",u),a.setAttribute("aria-hidden","false"),a.classList.add("expanded"),t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.addEventListener("keydown",(function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),m()&&f()):"Escape"===e.key&&b()})),t.addEventListener("click",(function(e){e.preventDefault(),m()&&f()}));let c,l=0;function m(){return s&&window.innerWidth<782}function p(){(function(){const t=window.innerWidth<782?"mobile":"desktop";e.setAttribute("data-mobile-direction",o),e.setAttribute("data-tablet-direction",r),e.setAttribute("data-desktop-direction",d),e.setAttribute("data-current-breakpoint",t)})(),e.setAttribute("data-enable-accordion",s.toString()),m()?(e.classList.add("accordion-mode"),i&&(i.style.display="block"),a.setAttribute("aria-hidden","true"),a.classList.remove("expanded"),t.setAttribute("aria-expanded","false"),e.classList.remove("menu-expanded"),i&&(i.classList.remove("expanded"),i.setAttribute("aria-expanded","false"))):(e.classList.remove("accordion-mode"),i&&(i.style.display="none"),a.setAttribute("aria-hidden","false"),a.classList.add("expanded"),t.setAttribute("aria-expanded","true"))}function f(){m()&&("true"===t.getAttribute("aria-expanded")?b():function(){t.setAttribute("aria-expanded","true"),a.setAttribute("aria-hidden","false"),a.classList.add("expanded"),e.classList.add("menu-expanded"),i&&(i.classList.add("expanded"),i.setAttribute("aria-expanded","true")),n("Menu expanded");const s=a.querySelector(".menu-item a, .menu-item button");s&&setTimeout((()=>{s.focus()}),300)}())}function b(){t.setAttribute("aria-expanded","false"),a.setAttribute("aria-hidden","true"),a.classList.remove("expanded"),e.classList.remove("menu-expanded"),i&&(i.classList.remove("expanded"),i.setAttribute("aria-expanded","false")),n("Menu collapsed")}t.addEventListener("touchstart",(function(e){l=e.touches[0].clientY}),{passive:!0}),t.addEventListener("touchend",(function(e){const t=e.changedTouches[0].clientY;Math.abs(t-l)<10&&m()&&(e.preventDefault(),f())}),{passive:!1}),window.addEventListener("resize",(function(){clearTimeout(c),c=setTimeout((function(){p()}),250)})),p();const v=a.querySelectorAll(".menu-item a, .menu-item button");v.forEach(((e,n)=>{e.addEventListener("keydown",(function(e){if("Escape"===e.key&&m())b(),t.focus();else if(m()&&"ArrowDown"===e.key){e.preventDefault();const t=v[n+1];t&&t.focus()}else if(m()&&"ArrowUp"===e.key){e.preventDefault();const i=v[n-1];i?i.focus():t.focus()}}))}))}function n(e){const t=document.createElement("div");t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.position="absolute",t.style.left="-10000px",t.style.width="1px",t.style.height="1px",t.style.overflow="hidden",t.textContent=e,document.body.appendChild(t),setTimeout((()=>{document.body.removeChild(t)}),1e3)}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e(),document.addEventListener("click",(function(e){document.querySelectorAll(".blynex-responsive-nav-menu").forEach((function(t){const n=t.querySelector(".menu-title"),i=t.querySelector(".menu-items"),a="true"===t.dataset.enableAccordion;if(!t.contains(e.target)&&a&&window.innerWidth<=1023&&n&&i){n.setAttribute("aria-expanded","false"),i.setAttribute("aria-hidden","true"),i.classList.remove("expanded"),t.classList.remove("menu-expanded");const e=t.querySelector(".menu-toggle");e&&(e.classList.remove("expanded"),e.setAttribute("aria-expanded","false"))}}))}))}();