!function(){"use strict";function e(e,t){let n;return function(...a){clearTimeout(n),n=setTimeout(()=>{clearTimeout(n),e(...a)},t)}}function t(){document.querySelectorAll(".fb-advanced-mega-menu").forEach(function(t){const n=t.getAttribute("data-trigger"),a=t.querySelectorAll(".fb-advanced-mega-menu-item.has-mega-menu"),c=t.querySelector(".fb-advanced-mega-menu-toggle"),o=t.querySelector(".fb-advanced-mega-menu-list"),i=t.closest(".fb-advanced-mega-menu-main-wrapper");i&&i.classList.contains("fb-tablet-responsive"),i&&i.classList.contains("fb-mobile-responsive");let s=t.querySelector(".fb-advanced-mega-menu-overlay");function r(){return window.innerWidth<=1024}function d(){o.classList.remove("active"),c.classList.remove("active"),s.classList.remove("active"),a.forEach(function(e){e.classList.remove("active","hovering","keyboard-focus")}),document.body.style.overflow="",c.parentElement===o&&t.insertBefore(c,o)}function l(){const e=window.matchMedia("(max-width: 1024px)").matches||"click"===n;a.forEach(function(t){const n=t.querySelector(".fb-advanced-mega-menu-link"),c=t.querySelector(".fb-advanced-mega-menu-panel");if(!n||!c)return;const o=n.cloneNode(!0);n.parentNode.replaceChild(o,n),e?(o.addEventListener("click",function(e){t.classList.contains("has-mega-menu")&&(e.preventDefault(),e.stopPropagation(),t.classList.contains("active"),a.forEach(e=>{e!==t&&e.classList.remove("active")}),t.classList.toggle("active"))}),o.addEventListener("touchstart",function(){},{passive:!0})):(t.addEventListener("mouseenter",function(){a.forEach(e=>e.classList.remove("hovering","keyboard-focus")),t.classList.add("hovering")}),t.addEventListener("mouseleave",function(){t.classList.remove("hovering")}),o.addEventListener("focus",function(){a.forEach(e=>e.classList.remove("hovering","keyboard-focus")),t.classList.add("keyboard-focus")}),o.addEventListener("blur",function(){setTimeout(()=>{t.contains(document.activeElement)||t.classList.remove("keyboard-focus")},10)}))})}s||(s=document.createElement("div"),s.className="fb-advanced-mega-menu-overlay",t.appendChild(s)),c&&c.addEventListener("click",function(e){e.stopPropagation();const n=o.classList.toggle("active");c.classList.toggle("active"),s.classList.toggle("active"),n?o.firstChild?o.insertBefore(c,o.firstChild):o.appendChild(c):t.insertBefore(c,o),document.body.style.overflow=n?"hidden":""}),document.addEventListener("click",function(e){!r()||t.contains(e.target)||c.contains(e.target)||d()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&d()}),s.addEventListener("click",d),t.querySelectorAll(".fb-advanced-mega-menu-panel").forEach(function(e){e.querySelectorAll("a").forEach(function(e){e.addEventListener("click",function(){d()})})}),l();const u=e(function(){d(),l()},250);window.addEventListener("resize",u);const f=e(function(){r()},100);window.addEventListener("scroll",f)})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()}();