"use strict";(self.webpackChunkkcc_gem_theme=self.webpackChunkkcc_gem_theme||[]).push([[965],{965:function(e,t,n){function s(e){e.parentNode.classList.add("active"),e.insertAdjacentHTML("beforeend",' (current)')}function c(e){const t=window.location.pathname,n="#contact"===window.location.hash,c="/"===window.location.pathname;[...e].forEach((e=>{const o=e.querySelector("a"),a=o.getAttribute("href").replace(/^\/?\.\.\/(\.\.\/)?(\.\.\/)?/g,"/"),r="home"===o.textContent.toLowerCase(),l=-1!==t.indexOf(a);c||n?r&&s(o):l&&!r&&s(o)}))}n.r(t),n.d(t,{default:function(){return h}});var o=function(){const e=document.querySelectorAll(".js-nav-item");document.getElementById("subNavNav")&&c(document.querySelectorAll(".js-sub-nav-item")),c(e)};const a=document.getElementById("mainNav"),r=document.getElementById("globalNav");var l=function(){if(!document.getElementById("searchIcon"))return;const e=document.getElementById("searchIcon");document.addEventListener("click",(function(t){if(!t.target.closest("#searchIcon"))return;t.preventDefault();const n=document.getElementById("searchImg"),s=document.getElementById("searchCollapse");var c,o;-1!=n.style.backgroundImage.indexOf("assets/img/search.svg")?(o=e,(c=n).style.backgroundImage='url("/assets/img/x.svg")',c.setAttribute("alt","Close icon"),o.setAttribute("aria-label","Close search"),s.setAttribute("aria-hidden","false")):(function(e,t){e.style.backgroundImage='url("/assets/img/search.svg")',e.setAttribute("alt","Search icon"),t.setAttribute("aria-label","Open search")}(n,e),s.setAttribute("aria-hidden","true")),s.classList.toggle("nav-global__search-collapse--visible"),a.classList.toggle("nav-local__search-toggle"),r.classList.toggle("nav-global__search-toggle")}),!1)};function i(e,t){document.querySelector(".gsst_a").id="xIcon",e.disconnect(),t()}function u(){"display: none;"===document.getElementById("xIcon").getAttribute("style")?document.querySelector("button.gsc-search-button-v2").classList.remove("gsc-overrides__clear-x"):document.querySelector("button.gsc-search-button-v2").classList.add("gsc-overrides__clear-x")}var d=function(){document.getElementById("searchCollapse")&&new Promise(((e,t)=>{!function(e){const t=document.createElement("script"),n=document.getElementsByTagName("script")[0];t.type="text/javascript",t.async=!0,t.src="https://cse.google.com/cse.js?cx=006320264078644364913:sy48bet-lr8",t.onload=t=>e(),n.parentNode.insertBefore(t,n)}(e)})).then((()=>new Promise(((e,t)=>{const n=document.getElementById("searchCollapse");new MutationObserver((function(t,n){for(const s of t)"childList"==s.type&&i(n,e)})).observe(n,{attributes:!0,childList:!0,subtree:!0})})))).then((()=>{u();const e=document.getElementById("xIcon");new MutationObserver((function(e,t){for(const t of e)"attributes"==t.type&&u()})).observe(e,{attributes:!0,childList:!0,subtree:!0})}))};function g(e,t){e.classList.contains(t)&&function(e,t){e.classList.remove(t)}(e,t)}function m(){if(window.innerWidth>=992){const e=document.getElementById("searchCollapse"),t=document.getElementById("globalNav"),n=document.getElementById("mainNav"),s=document.getElementById("searchIcon");g(e,"nav-global__search-collapse--visible"),g(t,"nav-global__search-toggle"),g(n,"nav-local__search-toggle"),function(e){"Toggle Close"!==!e.getAttribute("aria-label")&&function(e){const t=e.querySelector("#searchImg");e.setAttribute("aria-label","Toggle Search"),t.setAttribute("alt","Open icon"),t.setAttribute("style",'background-image: url("/assets/img/search.svg")')}(e)}(s)}}var b=function(){window.addEventListener("resize",m)};function h(){o(),l(),d(),b()}}}]);