!function(){"use strict";window.kadence={initOutlineToggle:function(){document.body.addEventListener("keydown",(function(){document.body.classList.remove("hide-focus-outline")})),document.body.addEventListener("mousedown",(function(){document.body.classList.add("hide-focus-outline")}))},getOffset:function(e){if(e instanceof HTMLElement){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}return{top:null,left:null}},findParents:function(e,t){var o=[];return function e(n){var i=n.parentNode;i instanceof HTMLElement&&(i.matches(t)&&o.push(i),e(i))}(e),o},toggleAttribute:function(e,t,o,n){void 0===o&&(o=!0),void 0===n&&(n=!1),e.getAttribute(t)!==o?e.setAttribute(t,o):e.setAttribute(t,n)},initNavToggleSubmenus:function(){var e=document.querySelectorAll(".nav--toggle-sub");if(e.length)for(let t=0;t li > a, ul.toggle-show > li > .dropdown-nav-special-toggle";t[a].parentNode.classList.contains("kadence-menu-mega-enabled")&&(o='a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]'),e.shiftKey?window.kadence.isfirstFocusableElement(t[a],document.activeElement,o)&&window.kadence.toggleSubMenu(t[a].parentNode,!1):window.kadence.islastFocusableElement(t[a],document.activeElement,o)&&window.kadence.toggleSubMenu(t[a].parentNode,!1)}27===e.keyCode&&(window.kadence.toggleSubMenu(t[a].parentNode,!1),t[a].parentNode.querySelector(".dropdown-nav-special-toggle").focus())})),t[a].parentNode.classList.add("menu-item--has-toggle")}}},initEachNavToggleSubmenuInside:function(e){var t=e.querySelectorAll(".menu-item-has-children");if(t.length)for(let o=0;o0&&(c-=w.offsetHeight)}if(l=kadenceConfig.breakPoints.desktop<=window.innerWidth?e:t){kadenceConfig.breakPoints.desktop<=window.innerWidth?"mobile"===a?(s=window.kadence.getOffset(l).top,a="desktop"):d&&"updateActive"===d&&(l.style.top="auto",s=window.kadence.getOffset(l).top,a="desktop"):"desktop"===a?(s=window.kadence.getOffset(l).top,a="mobile"):d&&"updateActive"===d&&(l.style.top="auto",s=window.kadence.getOffset(l).top,a="mobile");var h=l.parentNode,m=l.getAttribute("data-shrink"),p=l.getAttribute("data-reveal-scroll-up"),v=parseInt(l.getAttribute("data-start-height"));if((!v||d&&void 0!==d.type&&"orientationchange"===d.type)&&(l.setAttribute("data-start-height",l.offsetHeight),v=l.offsetHeight,h.classList.contains("site-header-upper-inner-wrap")?(h.style.height=null,d&&void 0!==d.type&&"orientationchange"===d.type?l.classList.contains("item-is-fixed")?setTimeout((function(){h.style.height=Math.floor(h.offsetHeight+l.offsetHeight)+"px"}),21):setTimeout((function(){h.style.height=h.offsetHeight+"px"}),21):h.style.height=h.offsetHeight+"px"):h.classList.contains("site-header-inner-wrap")?(h.style.height=null,h.style.height=h.offsetHeight+"px"):h.style.height=l.offsetHeight+"px"),"true"===m){var y=l.getAttribute("data-shrink-height");if(y){if("true"===p)if(window.scrollY>r)var b=Math.floor(Math.floor(s)-Math.floor(c)+Math.floor(v));else b=Math.floor(s-c);else b=Math.floor(s-c);var k=l.querySelectorAll(".custom-logo"),L=l.querySelector(".site-main-header-inner-wrap"),S=parseInt(L.getAttribute("data-start-height"));if(S||(L.setAttribute("data-start-height",L.offsetHeight),S=L.offsetHeight),window.scrollY<=b){if(L.style.height=S+"px",L.style.minHeight=S+"px",L.style.maxHeight=S+"px",k)for(let e=0;eb){var A=Math.max(y,S-(window.scrollY-(s-c)));if(L.style.height=A+"px",L.style.minHeight=A+"px",L.style.maxHeight=A+"px",k)for(let e=0;er;if(E<=x)l.style.transform="translateY(0px)";else if(H)l.classList.add("item-hidden-above"),l.style.transform="translateY("+(Math.abs(C)>q?-q:C)+"px)";else{x=Math.floor(s-c);l.style.transform="translateY("+(C>0?0:C)+"px)",l.classList.remove("item-hidden-above")}r=E}else x=Math.floor(s-c);window.scrollY==x?(l.style.top=c+"px",l.classList.add("item-is-fixed"),l.classList.add("item-at-start"),l.classList.remove("item-is-stuck"),h.classList.add("child-is-fixed"),document.body.classList.add("header-is-fixed")):window.scrollY>x?"true"===p?window.scrollY{u("updateActive")},c={root:document.documentElement},new IntersectionObserver(((e,t)=>{e.forEach((e=>{l(e.intersectionRatio>0)}))}),c).observe(d)}},getTopOffset:function(e="scroll"){if("load"===e)var t=document.querySelector("#main-header .kadence-sticky-header"),o=document.querySelector("#mobile-header .kadence-sticky-header");else t=document.querySelector('#main-header .kadence-sticky-header:not([data-reveal-scroll-up="true"])'),o=document.querySelector('#mobile-header .kadence-sticky-header:not([data-reveal-scroll-up="true"])');var n=0,i=0;if(kadenceConfig.breakPoints.desktop<=window.innerWidth){if(t)n="true"!==t.getAttribute("data-shrink")||t.classList.contains("site-header-inner-wrap")?Math.floor(t.offsetHeight):Math.floor(t.getAttribute("data-shrink-height"));else n=0;document.body.classList.contains("admin-bar")&&(i=32)}else{if(o)n="true"===o.getAttribute("data-shrink")?Math.floor(o.getAttribute("data-shrink-height")):Math.floor(o.offsetHeight);else n=0;document.body.classList.contains("admin-bar")&&(i=46)}return Math.floor(n+i+Math.floor(kadenceConfig.scrollOffset))},scrollToElement:function(e,t,o="scroll"){t=void 0===t||t;var n=window.kadence.getTopOffset(o),i=Math.floor(e.getBoundingClientRect().top)-n;window.scrollBy({top:i,left:0,behavior:"smooth"}),e.tabIndex="-1",e.focus({preventScroll:!0}),e.classList.contains("kt-title-item")&&e.firstElementChild.click(),t&&window.history.pushState("","","#"+e.id)},anchorScrollToCheck:function(e,t){if(t=void 0!==t?t:null,e.target.getAttribute("href"))var o=e.target;else{if(!(o=e.target.closest("a")))return;if(!o.getAttribute("href"))return}if(!(o.parentNode&&o.parentNode.hasAttribute("role")&&"tab"===o.parentNode.getAttribute("role")||o.closest(".woocommerce-tabs ul.tabs"))){var n;n=t?t.getAttribute("href").substring(t.getAttribute("href").indexOf("#")):o.getAttribute("href").substring(o.getAttribute("href").indexOf("#"));var i=document.getElementById(n.replace("#",""));i&&(i?.classList?.contains("kt-accordion-pane")||(e.preventDefault(),window.kadence.scrollToElement(i),window.kadence.updateActiveAnchors()))}},initStickySidebarWidget:function(){if(document.body.classList.contains("has-sticky-sidebar-widget")){var e=window.kadence.getTopOffset(),t=document.querySelector("#secondary .sidebar-inner-wrap .widget:last-child");t&&(t.style.top=Math.floor(e+20)+"px",t.style.maxHeight="calc( 100vh - "+Math.floor(e+20)+"px )")}},initStickySidebar:function(){if(document.body.classList.contains("has-sticky-sidebar")){var e=window.kadence.getTopOffset(),t=document.querySelector("#secondary .sidebar-inner-wrap");t&&(t.style.top=Math.floor(e+20)+"px",t.style.maxHeight="calc( 100vh - "+Math.floor(e+20)+"px )")}},initActiveAnchors:function(){""!=window.location.hash&&window.kadence.updateActiveAnchors(),window.onhashchange=function(){window.kadence.updateActiveAnchors()}},updateActiveAnchors:function(){document.querySelectorAll(".menu-item").forEach((function(e){const t=e.querySelector("a");t?.href&&t.href.includes("#")&&(window.location.href==t.href?e.classList.add("current-menu-item"):e.classList.remove("current-menu-item"))}))},initAnchorScrollTo:function(){if(!document.body.classList.contains("no-anchor-scroll")){if(window.onhashchange=function(){""===window.location.hash&&(window.scrollTo({top:0,behavior:"smooth"}),document.activeElement.blur())},""!=window.location.hash){var e,t=location.hash.substring(1);if(!/^[A-z0-9_-]+$/.test(t))return;(e=document.getElementById(t))&&window.setTimeout((function(){window.kadence.scrollToElement(e,!1,"load")}),100)}var o=document.querySelectorAll("a[href*=\\#]:not([href=\\#]):not(.scroll-ignore):not([data-tab]):not([data-toggle]):not(.woocommerce-tabs a):not(.tabs a)");o.length&&o.forEach((function(e){try{new URL(e.href).pathname===window.location.pathname&&e.addEventListener("click",(function(e){window.kadence.anchorScrollToCheck(e)}))}catch(t){console.log("ClassList: "+e.classList,"Invalid URL")}}))}},initScrollToTop:function(){var e=document.getElementById("kt-scroll-up");if(e){var t=function(){window.scrollY>100?(e.classList.add("scroll-visible"),e.setAttribute("aria-hidden",!1)):(e.classList.remove("scroll-visible"),e.setAttribute("aria-hidden",!0))};window.addEventListener("scroll",t),t(),e.addEventListener("click",(function(e){e.preventDefault(),window.scrollTo({top:0,behavior:"smooth"}),document.querySelector(".skip-link").focus({preventScroll:!0}),document.activeElement.blur()}))}var o=document.getElementById("kt-scroll-up-reader");o&&o.addEventListener("click",(function(e){e.preventDefault(),window.scrollTo({top:0,behavior:"smooth"}),document.querySelector(".skip-link").focus()}))},initClickToOpen:function(){document.querySelectorAll(".header-navigation.click-to-open li.menu-item--has-toggle").forEach((function(e){[e.querySelector("a"),e.querySelector('button[class="dropdown-nav*"]')].forEach((function(t){t&&t.addEventListener("click",(function(t){t.preventDefault();const o=e.querySelector("ul.sub-menu");if(o){const t=o.classList.contains("opened");o.classList.toggle("opened",!t);if(Array.from(e.parentNode.children).filter((t=>t!==e)).forEach((function(e){const t=e.querySelector(":scope > ul.sub-menu");t&&t.classList.remove("opened")})),!t){const t=n=>{e.contains(n.target)||(o.classList.remove("opened"),document.removeEventListener("click",t))};document.addEventListener("click",t)}}}))}))}))},init:function(){window.kadence.initNavToggleSubmenus(),window.kadence.initToggleDrawer(),window.kadence.initMobileToggleAnchor(),window.kadence.initMobileToggleSub(),window.kadence.initOutlineToggle(),window.kadence.initStickyHeader(),window.kadence.initStickySidebar(),window.kadence.initStickySidebarWidget(),window.kadence.initTransHeaderPadding(),window.kadence.initAnchorScrollTo(),window.kadence.initScrollToTop(),window.kadence.initActiveAnchors(),window.kadence.initClickToOpen()}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",window.kadence.init):window.kadence.init()}();