(()=>{"use strict";var t=document.querySelectorAll("[data-menu-expand-trigger]"),e=document.querySelector(".menu-background"),a=!1;function n(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;arguments.length>2&&void 0!==arguments[2]&&!arguments[2]?e.classList.add("no-transition"):e.classList.remove("no-transition"),setTimeout((function(){if(t){document.body.classList.add("active-menu-backdrop");var n=document.querySelector('[data-menu-expand-content="'+t+'"]'),o=n.offsetHeight+n.getBoundingClientRect().top;e.style.height=o+"px",a=!1}else setTimeout((function(){document.body.classList.remove("active-menu-backdrop"),a=!1}),300),e.style.height=0}),n)}t&&(t.forEach((function(e){e.addEventListener("click",(function(o){if(o.preventDefault(),!a){a=!0;var c=e.getAttribute("data-menu-expand-trigger"),i=document.querySelectorAll('[data-menu-expand-trigger="'+c+'"]'),r=document.querySelectorAll('[data-menu-expand-content="'+c+'"]');if("navSearch"===c&&!e.classList.contains("active")){var s=document.querySelector('#navSearch input[type="search"]');s&&setTimeout((function(){s.focus()}),600)}if(e.closest("#topNavMenu")&&window.matchMedia("screen and (max-width: 1200px)").matches)i.forEach((function(t){t.setAttribute("aria-expanded","true"),t.classList.add("active"),setTimeout((function(){t.classList.add("show")}),1)})),r.forEach((function(t){t.classList.add("active"),setTimeout((function(){t.classList.add("show")}),1)})),setTimeout((function(){a=!1}),300);else if(e.classList.contains("active"))i.forEach((function(t){t.setAttribute("aria-expanded","false"),t.classList.remove("show"),setTimeout((function(){t.classList.remove("active")}),1)})),r.forEach((function(t){t.classList.remove("show"),setTimeout((function(){t.classList.remove("active")}),300)})),n(!1,300);else{t.forEach((function(t){t.setAttribute("aria-expanded","false"),t.classList.remove("show","active")})),document.querySelectorAll("[data-menu-expand-content]").forEach((function(t){t.classList.remove("show","active")})),i.forEach((function(t){t.setAttribute("aria-expanded","true"),t.classList.add("active"),setTimeout((function(){t.classList.add("show")}),1)}));var u=document.querySelector("body").classList.contains("active-menu-backdrop")||e.hasAttribute("data-overlay")?400:1;r.forEach((function(t){t.classList.add("active"),setTimeout((function(){t.classList.add("show")}),u)})),e.hasAttribute("data-overlay")&&"true"===e.getAttribute("data-overlay")?n(c):(a=!1,n(!1,u))}}}))})),document.body.addEventListener("click",(function(e){if(!e.target.hasAttribute("data-menu-expand-trigger")&&!e.target.hasAttribute("data-menu-expand-content")&&!e.target.closest("[data-menu-expand-trigger], [data-menu-expand-content]")){if(a)return;a=!0,n(!1,300),t.forEach((function(t){t.setAttribute("aria-expanded","false"),t.classList.remove("show"),setTimeout((function(){t.classList.remove("active")}),1)})),document.querySelectorAll("[data-menu-expand-content]").forEach((function(t){t.classList.remove("show"),setTimeout((function(){t.classList.remove("active")}),300)}))}})));var o=document.querySelectorAll(".menu-item__dropdown-close > a");o&&o.forEach((function(t){t.addEventListener("click",(function(e){e.preventDefault();var a=t.getAttribute("aria-controls"),n=document.querySelectorAll('[data-menu-expand-trigger="'+a+'"]');n&&n.forEach((function(t){t.setAttribute("aria-expanded","false"),t.classList.remove("active","show")}));var o=document.querySelectorAll('[data-menu-expand-content="'+a+'"]');o&&o.forEach((function(t){t.classList.remove("show"),setTimeout((function(){t.classList.remove("active")}),300)}))}))}));var c=document.querySelectorAll("[data-tab-group]");c&&c.forEach((function(t){t.dataset.tabGroup,t.querySelectorAll("[data-tab-group-item]").forEach((function(e){e.addEventListener("click",(function(a){if(!e.classList.contains("active")){t.querySelectorAll("[data-tab-group-item]").forEach((function(t){var e=t.getAttribute("aria-controls");document.querySelector('[data-tab-group-content="'+e+'"]').classList.remove("active","show"),t.classList.remove("active"),t.setAttribute("aria-selected","false")}));var o=e.getAttribute("aria-controls"),c=document.querySelector('[data-tab-group-content="'+o+'"]');c.classList.add("active"),setTimeout((function(){c.classList.add("show")}),1),e.classList.add("active"),e.setAttribute("aria-selected","true")}window.matchMedia("screen and (min-width: 1200px)").matches&&n(e.closest("[data-menu-expand-content]").getAttribute("data-menu-expand-content"),0,!1)}))}))}));var i=document.querySelectorAll(".menu-item__tab-close a");function r(){var t=document.querySelectorAll("[data-tab-group-item]");if(t){var e=window.matchMedia("screen and (max-width: 1200px)").matches;t.forEach((function(t){t.classList.remove("active"),t.setAttribute("aria-selected","false");var a=t.getAttribute("aria-controls");if(document.querySelector('[data-tab-group-content="'+a+'"]').classList.remove("active","show"),!e&&t.hasAttribute("data-tab-default")){t.classList.add("active"),t.setAttribute("aria-selected","true");var n=t.getAttribute("aria-controls");document.querySelector('[data-tab-group-content="'+n+'"]').classList.add("active","show")}}))}}function s(){var t=parseFloat(getComputedStyle(document.documentElement).zoom)||1,e=window.innerWidth-document.body.clientWidth*t;document.body.style.setProperty("--scrollbar-width","".concat(e,"px"))}i&&i.forEach((function(t){t.addEventListener("click",(function(e){e.preventDefault();var a=t.getAttribute("aria-controls");document.querySelector('[data-tab-group-content="'+a+'"]').classList.remove("show"),setTimeout((function(){document.querySelector('[data-tab-group-content="'+a+'"]').classList.remove("active")}),300),document.querySelector('[data-tab-group-item="'+a+'"]').classList.remove("active"),document.querySelector('[data-tab-group-item="'+a+'"]').setAttribute("aria-selected","false")}))})),document.addEventListener("DOMContentLoaded",(function(){r(),s()})),window.addEventListener("load",(function(){r(),s()})),window.addEventListener("resize",(function(){if(r(),document.querySelector("body").classList.contains("active-menu-backdrop")||s(),window.matchMedia("screen and (min-width: 1200px)").matches){var t=document.querySelector('[data-overlay="true"][data-menu-expand-trigger][aria-expanded="true"]');t&&n(t.getAttribute("data-menu-expand-trigger"),0,!1)}}))})();