File: /home/sescorpcl/public_html/wp-content/themes/sydney/js/functions.min.js
window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window;for(var s=0;s<this.length;s++)e.call(t,this[s],s,this)});var sydney=sydney||{};function sydneyDomReady(e){if("function"==typeof e)return"interactive"===document.readyState||"complete"===document.readyState?e():void document.addEventListener("DOMContentLoaded",e,!1)}sydney.navigation={init:function(){var e,t=document.getElementById("mainnav");let i=document.getElementsByClassName("sydney-offcanvas-menu")[0];if(t=document.body.classList.contains("has-shfb-builder")?document.getElementsByClassName("main-navigation")[0]:t){for(e of t.querySelectorAll(".dropdown-symbol"))e.addEventListener("keydown",function(e){"Enter"!==e.key&&13!==e.keyCode||(e.preventDefault(),e=this.parentNode,console.log(e),e.getElementsByClassName("sub-menu")[0].classList.toggle("toggled"))});let s=document.getElementsByClassName("menu-toggle")[0];var o=document.getElementsByClassName("mobile-menu-close")[0];if(void 0!==s){var n=t.getElementsByTagName("ul")[0];t.getElementsByClassName("mobile-menu-close")[0];if(void 0===n)s.style.display="none";else{n.classList.contains("nav-menu")||n.classList.add("nav-menu");var a=(t=i.querySelectorAll("a[href]:not([disabled]):not(.mobile-menu-close)"))[0];s.addEventListener("click",function(e){var t;e.preventDefault(),s.classList.add("open"),i.classList.add("toggled"),document.body.classList.add("mobile-menu-visible");for(t of i.querySelectorAll(".dropdown-symbol"))t.addEventListener("touchstart",r),t.addEventListener("click",r),t.addEventListener("keydown",function(e){"Enter"!==e.key&&13!==e.keyCode||(e.preventDefault(),t.parentNode.parentNode.getElementsByClassName("sub-menu")[0].classList.toggle("toggled"))});a.focus()});var c,a=(t=i.querySelectorAll("a[href]:not([disabled])"))[0],t=t[t.length-1];if(t.addEventListener("keydown",function(e){"Tab"!==e.key&&9!==e.keyCode||e.shiftKey||a.focus()}),o.addEventListener("click",function(e){e.preventDefault(),s.focus(),s.classList.remove("open"),i.classList.remove("toggled"),document.body.classList.remove("mobile-menu-visible")}),i)for(c of i.querySelectorAll('a[href*="#"]'))c.addEventListener("click",m);var l,d,t=n.getElementsByTagName("a"),o=n.querySelectorAll(".menu-item-has-children > a, .page_item_has_children > a");for(l of t)l.addEventListener("focus",u,!0),l.addEventListener("blur",u,!0);for(d of o)d.addEventListener("touchstart",u,!1);document.querySelectorAll(".menu-item-has-children > a").forEach(e=>{e.addEventListener("mouseenter",function(){this.setAttribute("aria-expanded","true")}),e.addEventListener("mouseleave",function(){this.setAttribute("aria-expanded","false")})})}}function r(e){e.preventDefault(),e.target.closest("li").querySelector(".sub-menu").classList.toggle("toggled")}function m(){s&&(s.focus(),s.classList.remove("open")),i.classList.remove("toggled"),document.body.classList.remove("mobile-menu-visible")}function u(){if("focus"===event.type||"blur"===event.type){let e=this;for(;!e.classList.contains("nav-menu");)"li"===e.tagName.toLowerCase()&&e.classList.toggle("focus"),e=e.parentNode}if("touchstart"===event.type){var e,t=this.parentNode;for(e of t.parentNode.children)t!==e&&e.classList.remove("focus");t.classList.toggle("focus")}}}}},sydney.backToTop={init:function(){var e=document.getElementsByClassName("go-top")[0];void 0!==e&&null!=e&&e.addEventListener("click",function(){window.scrollTo({top:0,left:0,behavior:"smooth"})}),this.displayButton()},setup:function(){var e,t=document.getElementsByClassName("go-top")[0];void 0!==t&&null!=t&&(e=window.pageYOffset,getComputedStyle(document.documentElement).getPropertyValue("--sydney-scrolltop-distance")<e?t.classList.add("show"):t.classList.remove("show"))},displayButton:function(){this.setup(),window.addEventListener("scroll",function(){this.setup()}.bind(this))}},sydney.removePreloader={init:function(){this.remove()},remove:function(){var e=document.querySelectorAll(".preloader");0!==e.length&&e.forEach(function(e){e.classList.add("disable"),setTimeout(function(){e.style.display="none"},600)})}},sydney.stickyMenu={init:function(){this.headerClone(),window.addEventListener("resize",function(){this.headerClone()}.bind(this)),this.sticky(),window.addEventListener("scroll",function(){this.sticky()}.bind(this))},headerClone:function(){var e=document.getElementsByClassName("site-header")[0],t=document.getElementsByClassName("header-clone")[0];void 0===t&&null==t||void 0===e&&null==e||(t.style.height=e.offsetHeight+"px")},sticky:function(){var e,t=document.getElementsByClassName("site-header")[0];void 0===t&&null==t||(e=window.pageYOffset,t.offsetTop<=e?(t.classList.add("fixed"),document.body.classList.add("siteScrolled")):(t.classList.remove("fixed"),document.body.classList.remove("siteScrolled")),107<=e?t.classList.add("float-header"):t.classList.remove("float-header"))}},sydney.stickyHeader={init:function(){var e=document.getElementsByTagName("body")[0],t=document.querySelectorAll(".shfb-desktop .shfb-sticky-header"),s=document.querySelectorAll(".shfb-mobile .shfb-sticky-header"),i=document.getElementsByClassName("sticky-header")[0];0===t.length&&0===s.length&&void 0===i||(void 0!==i?this.initLegacyStickyHeader(i,e):(this.handleStickyScroll(),window.addEventListener("scroll",function(){this.handleStickyScroll()}.bind(this)),window.addEventListener("resize",function(){this.handleStickyScroll()}.bind(this))))},initLegacyStickyHeader:function(t,s){var i,o,e;t.classList.contains("sticky-scrolltop")?(i=0,o=t.offsetTop,void 0!==(e=document.getElementsByClassName("admin-bar")[0])&&null!=e&&(o+=32),window.addEventListener("scroll",function(){var e=window.pageYOffset||document.documentElement.scrollTop;e<i?(t.classList.add("is-sticky"),s.classList.add("sticky-active"),s.classList.add("sticky-header-active")):(t.classList.remove("is-sticky"),s.classList.remove("sticky-active"),s.classList.remove("sticky-header-active")),i<o&&t.classList.remove("is-sticky"),i=e<=0?0:e,0===e&&s.classList.remove("sydney-scrolling-up")},!1)):(this.applySticky(t,s),window.addEventListener("scroll",function(){this.applySticky(t,s)}.bind(this)))},handleStickyScroll:function(){var e=window.matchMedia("(max-width: 1024px)").matches,s=e?document.querySelectorAll(".shfb-mobile .shfb-sticky-header"):document.querySelectorAll(".shfb-desktop .shfb-sticky-header"),e=e?document.querySelectorAll(".shfb-desktop .shfb-sticky-header"):document.querySelectorAll(".shfb-mobile .shfb-sticky-header");if(e.forEach(function(e){e.classList.remove("sticky-active")}),0!==s.length){let t=document.getElementsByTagName("body")[0];e=s[0].closest(".shfb");e&&e.classList.contains("sticky-scrolltop")?this.handleScrollToTopHeaders(s,t):s.forEach(function(e){this.applySticky(e,t)}.bind(this))}},handleScrollToTopHeaders:function(e,t){void 0===this.lastScrollTop&&(this.lastScrollTop=0);var s=window.pageYOffset||document.documentElement.scrollTop,i=0,o=(0<e.length&&((o=e[0]).classList.contains("header_layout_1")||o.classList.contains("header_layout_2")||(i=o.offsetTop)),document.getElementsByClassName("admin-bar")[0]);void 0!==o&&null!=o&&(i+=window.matchMedia("(max-width: 1024px)").matches?46:32),s<this.lastScrollTop?(e.forEach(function(e){e.classList.add("sticky-active")}),t.classList.add("sticky-active"),t.classList.add("sticky-header-active"),t.classList.remove("sydney-scrolling-down"),this.updateBodyPaddingForScrollTop(e)):(e.forEach(function(e){e.classList.remove("sticky-active")}),t.classList.remove("sticky-active"),t.classList.remove("sticky-header-active"),t.classList.add("sydney-scrolling-down"),document.body.style.paddingTop="0px"),this.lastScrollTop<i&&(e.forEach(function(e){e.classList.remove("sticky-active")}),t.classList.remove("sticky-active"),t.classList.remove("sticky-header-active"),t.classList.remove("sydney-scrolling-down"),document.body.style.paddingTop="0px"),this.lastScrollTop=s<=0?0:s,0===s&&(e.forEach(function(e){e.classList.remove("sticky-active")}),t.classList.remove("sticky-active"),t.classList.remove("sticky-header-active"),t.classList.remove("sydney-scrolling-down"),t.classList.remove("sydney-scrolling-up"),document.body.style.paddingTop="0px")},updateBodyPaddingForScrollTop:function(e){var t=window.matchMedia("(max-width: 1024px)").matches,t=document.querySelectorAll(t?".shfb-mobile .shfb-sticky-header.sticky-active":".shfb-desktop .shfb-sticky-header.sticky-active");let s=0;t.forEach(function(e){s+=e.offsetHeight});t=document.body.classList.contains("transparent-header")&&!(document.body.classList.contains("no-transparent-header-mobile")&&window.matchMedia("(max-width: 1024px)").matches);0<s&&!t&&(document.body.style.paddingTop=s+"px")},applySticky:function(e,s){if(e){var i=window.pageYOffset,o=0,n=(e.classList.contains("header_layout_1")||e.classList.contains("header_layout_2")||(o=e.offsetTop),document.getElementsByClassName("admin-bar")[0]);if(void 0!==n&&null!=n&&(o+=32),o<i){e.classList.add("sticky-active"),s.classList.add("sticky-active"),s.classList.add("sticky-header-active");n=window.matchMedia("(max-width: 1024px)").matches,o=document.querySelectorAll(n?".shfb-mobile .shfb-sticky-header.sticky-active":".shfb-desktop .shfb-sticky-header.sticky-active");let t=0;o.forEach(function(e){t+=e.offsetHeight});i=document.body.classList.contains("transparent-header")&&!(document.body.classList.contains("no-transparent-header-mobile")&&window.matchMedia("(max-width: 1024px)").matches);0<t&&!i&&(document.body.style.paddingTop=t+"px")}else e.classList.remove("sticky-active"),s.classList.remove("sticky-active"),s.classList.remove("sticky-header-active"),document.body.style.paddingTop="0px"}}},sydney.headerSearch={init:function(){var t=this,s=document.querySelectorAll(".header-search"),i=window.matchMedia("(max-width: 1024px)").matches?document.querySelector("#masthead-mobile .header-search-form"):document.querySelector("#masthead .header-search-form");if(0!==s.length){document.body.classList.contains("has-shfb-builder")&&(i=window.matchMedia("(max-width: 1024px)").matches?document.querySelector(".shfb-mobile .header-search-form"):document.querySelector(".shfb-desktop .header-search-form")),this.updateSearchFormPosition(i),document.body.classList.contains("has-shfb-builder")&&document.body.classList.contains("transparent-header")&&window.addEventListener("scroll",()=>{this.updateSearchFormPosition(i)});var e,o=i.getElementsByClassName("search-field")[0],n=i.getElementsByClassName("search-submit")[0];for(e of s)e.addEventListener("click",function(e){if(e.preventDefault(),1<s.length)for(var t of s)t.classList.toggle("hide");i.classList.toggle("active"),e.target.closest(".header-search").getElementsByClassName("icon-search")[0].classList.toggle("active"),e.target.closest(".header-search").getElementsByClassName("icon-cancel")[0].classList.toggle("active"),e.target.closest(".header-search").classList.add("active"),e.target.closest(".header-search").classList.remove("hide"),i.classList.contains("active")&&o.focus(),null!==e.target.closest(".sydney-offcanvas-menu")&&e.target.closest(".sydney-offcanvas-menu").classList.remove("toggled")});return n.addEventListener("keydown",function(e){"Tab"!==e.key&&e.keyCode!==KEYCODE_TAB||(i.classList.remove("active"),t.backButtonsToDefaultState(s),s.focus())}),this}},updateSearchFormPosition:function(e){var t,s;document.body.classList.contains("has-shfb-builder")&&document.body.classList.contains("transparent-header")&&(s=window.matchMedia("(max-width: 1024px)").matches?document.querySelector(".shfb-mobile"):document.querySelector(".shfb-desktop"))&&e&&(s=s.querySelector(".sticky-active"))&&(t=s.offsetHeight,s=parseInt(window.getComputedStyle(s).top)||0,e.style.top=(t+=s)+"px")},backButtonsToDefaultState:function(e){for(var t of e)t.classList.remove("hide"),t.querySelector(".icon-cancel").classList.remove("active"),t.querySelector(".icon-search").classList.add("active")}},sydney.mobileMenu={init:function(){this.menu(),window.addEventListener("resize",function(){this.menu()}.bind(this))},menu:function(){if(window.matchMedia("(max-width: 1024px)").matches){var e=document.getElementsByClassName("mainnav")[0];if(void 0!==e&&null!=e){var t=document.getElementsByClassName("btn-menu")[0],s=(e.setAttribute("id","mainnav-mobi"),e.classList.add("syd-hidden"),e.querySelectorAll(".menu-item-has-children"));s.forEach(function(e,t,s){e.getElementsByTagName("ul")[0].style.display="none",e.getElementsByTagName("a")[0].insertAdjacentHTML("beforeend",'<span class="btn-submenu"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z"/></svg></span>')},"myThisArg"),this.toggle(t,e),e.querySelectorAll(".btn-submenu").forEach(function(t,e,s){t.addEventListener("click",function(e){e.preventDefault(),t.parentNode.parentNode.getElementsByClassName("sub-menu")[0].classList.toggle("toggled")})},"myThisArg")}}else{s=document.getElementById("mainnav-mobi");void 0!==s&&null!=s&&(s.setAttribute("id","mainnav"),s.classList.remove("toggled"),s.querySelectorAll(".btn-submenu").forEach(function(e,t,s){e.remove()},"myThisArg"))}},toggle:function(e,t){void 0===e&&null==e||e.addEventListener("click",function(e){e.preventDefault(),t.classList.contains("toggled")?t.classList.remove("toggled"):t.classList.add("toggled"),e.stopImmediatePropagation()})},submenuToggle:function(t){t.addEventListener("click",function(e){e.preventDefault(),t.parentNode.parentNode.getElementsByClassName("sub-menu")[0].classList.toggle("toggled")})}},sydneyDomReady(function(){sydney.backToTop.init(),sydney.removePreloader.init(),sydney.stickyMenu.init(),sydney.mobileMenu.init(),sydney.navigation.init(),sydney.stickyHeader.init(),sydney.headerSearch.init()}),window.addEventListener("load",function(){window;var e=document,t=e.querySelectorAll(['iframe[src*="youtube.com"]','iframe[src*="vimeo.com"]'].join(","));if(t.length)for(var s=0;s<t.length;s++){var i=t[s],o=i.getAttribute("width"),o=i.getAttribute("height")/o,n=i.parentNode,a=e.createElement("div");a.className="fitVids-wrapper",a.style.paddingBottom=100*o+"%",n.insertBefore(a,i),i.remove(),a.appendChild(i),i.removeAttribute("height"),i.removeAttribute("width")}}),window.addEventListener("load",function(){var e;"undefined"==typeof Isotope||"undefined"==typeof lazySizes&&"undefined"==typeof lazyLoadOptions&&"undefined"==typeof a3_lazyload_extend_params||(e=document.querySelectorAll(".isotope-container")).length&&e.forEach(function(t){var e=t.querySelectorAll(".isotope-item img[data-lazy-src], .isotope-item img[data-src]");e.length&&e.forEach(function(e){null!==e&&e.addEventListener("load",function(){jQuery(t).isotope("layout")})},"myThisArg")},"myThisArg")});