!function(){"use strict";function e(){document.querySelectorAll(".eryndo-responsive-nav-menu").forEach(t)}function t(e){const t=e.querySelector(".menu-title"),i=e.querySelector(".menu-toggle"),o=e.querySelector(".menu-items");if(!t||!o)return;const a="true"===e.dataset.enableAccordion,d=(e.dataset.togglePosition,e.dataset.desktopDirection||"horizontal"),r=e.dataset.tabletDirection||"vertical",s=e.dataset.mobileDirection||"vertical",u=e.id||`nav-menu-${Date.now()}-${Math.floor(1e3*Math.random())}`;e.id=u;const c=`menu-${u}`;o.id=c,o.classList.remove("expanded");const l=window.eryndoA11yStrings||{},m=l.menuExpanded||"Menu expanded",p=l.menuCollapsed||"Menu collapsed";function b(e){if(!y())return t.removeAttribute("role"),t.removeAttribute("tabindex"),t.removeAttribute("aria-expanded"),void t.removeAttribute("aria-controls");t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-controls",c),t.setAttribute("aria-expanded",e?"true":"false")}t.addEventListener("keydown",(function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),y()&&h()):"Escape"===e.key&&x()})),t.addEventListener("click",(function(e){e.preventDefault(),y()&&h()}));let f,v=0;function y(){return a&&window.innerWidth<1024}function A(){(function(){const t=window.innerWidth<1024?"mobile":"desktop";e.setAttribute("data-mobile-direction",s),e.setAttribute("data-tablet-direction",r),e.setAttribute("data-desktop-direction",d),e.setAttribute("data-current-breakpoint",t)})(),e.setAttribute("data-enable-accordion",a.toString()),y()?(e.classList.add("accordion-mode"),i&&(i.style.display="block"),o.setAttribute("aria-hidden","true"),o.classList.remove("expanded"),b(!1)):(e.classList.remove("accordion-mode"),i&&(i.style.display="none"),o.removeAttribute("aria-hidden"),o.classList.add("expanded"),b(!1))}function h(){y()&&("true"===t.getAttribute("aria-expanded")?x():function(){b(!0),o.removeAttribute("aria-hidden"),o.classList.add("expanded"),e.classList.add("menu-expanded"),i&&(i.classList.add("expanded"),i.setAttribute("aria-expanded","true")),n(m);const t=o.querySelector(".menu-item a, .menu-item button");t&&setTimeout((()=>{t.focus()}),300)}())}function x(){b(!1),o.setAttribute("aria-hidden","true"),o.classList.remove("expanded"),e.classList.remove("menu-expanded"),i&&(i.classList.remove("expanded"),i.setAttribute("aria-expanded","false")),n(p)}t.addEventListener("touchstart",(function(e){v=e.touches[0].clientY}),{passive:!0}),t.addEventListener("touchend",(function(e){const t=e.changedTouches[0].clientY;Math.abs(t-v)<10&&y()&&(e.preventDefault(),h())}),{passive:!1}),window.addEventListener("resize",(function(){clearTimeout(f),f=setTimeout((function(){A()}),250)})),A();const L=o.querySelectorAll(".menu-item a, .menu-item button");L.forEach(((e,n)=>{e.addEventListener("keydown",(function(e){if("Escape"===e.key&&y())x(),t.focus();else if(y()&&"ArrowDown"===e.key){e.preventDefault();const t=L[n+1];t&&t.focus()}else if(y()&&"ArrowUp"===e.key){e.preventDefault();const i=L[n-1];i?i.focus():t.focus()}}))})),document.addEventListener("click",(function(n){!e.contains(n.target)&&y()&&"true"===t.getAttribute("aria-expanded")&&x()}))}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()}();