File: /var/www/html/wpdehaus/wp-content/themes/salient/js/build/nectar-delay-javascript.js
!function(e,t,a){"use strict";function i(){this.scripts=[],this.eventListeners=["click","scroll","touchstart","touchmove","keydown","mousemove"],this.noClick=this.preventClick.bind(this),this.load=this.triggerLoad.bind(this),this.lazyLoadCriticalMedia(),this.loadCritialAnimations(),this.gatherElements(),this.addEvents()}const r=i.prototype;r.gatherElements=function(){a.querySelectorAll('script[type="salientlazyscript"]').forEach(e=>{this.scripts.push(e)})},r.aboveTheFoldElements=function(e){let t=[];a.querySelectorAll(".vc_row:not(.inner_row)").forEach((a,i)=>{if(i<2){a.querySelectorAll(e).forEach(e=>{t.push(e)})}});const i=a.querySelectorAll(".woocommerce.archive .products, .archive .posts-container");return i&&i.forEach((a,i)=>{a.querySelectorAll(e).forEach(e=>{t.push(e)})}),t},r.loadCritialAnimations=function(){if(t.NectarBoxRollHelper&&a.querySelector(".nectar-box-roll")){(new NectarBoxRollHelper).setInitialSize(),a.querySelectorAll("body, html, #ajax-content-wrap, .container-wrap, .blurred-wrap").forEach(e=>{e.classList.add("no-scroll")})}const i=a.querySelector("#page-header-bg .nectar-particles .inner-wrap >*:not(.top-heading)");if(i&&(i.style.transform="translate3d(0,0,0)",i.style.opacity="1"),setTimeout(()=>{const e=a.querySelector(".widget_shopping_cart .cart_list .empty"),t=a.querySelector(".widget_shopping_cart .cart_list"),i=a.querySelector("#mobile-cart-link"),r=a.querySelector(".cart-menu-wrap.static");!e&&!r&&i&&t&&i.classList.add("first-load")},80),this.aboveTheFoldElements('.img-with-aniamtion-wrap:not([data-animation="none"])').forEach(e=>{const t=e.querySelector(".hover-wrap"),a=e.querySelector(".inner"),i=e.querySelector(".img-with-animation");[e,a,t,i].forEach(e=>{e&&(e.style.opacity="1",e.style.transform="translate3d(0,0,0)")}),i&&i.classList.add("animated-in")}),this.aboveTheFoldElements('.wpb_column.has-animation:not([data-animation*="reveal"]), .nectar-fancy-box.has-animation').forEach(e=>{e.style.transform="translate3d(0,0,0)",e.style.opacity="1",e.classList.add("animated-in")}),this.aboveTheFoldElements('.wpb_column.has-animation[data-animation*="reveal"]').forEach(e=>{[e,e.querySelector(".vc_column-inner")].forEach(e=>{e&&(e.style.opacity="1",e.style.transform="translate3d(0,0,0)")}),e.classList.add("animated-in")}),this.aboveTheFoldElements(".nectar_cascading_images").forEach(e=>{e.querySelectorAll(".inner-wrap, .inner-wrap img").forEach(e=>{e.style.transition="none",e.style.transform="translate3d(0,0,0)",e.style.opacity="1"})}),this.aboveTheFoldElements('.row-bg-wrap[data-bg-animation]:not([data-bg-animation="none"])').forEach(e=>{e.parentElement.classList.add("animated-in"),e.classList.add("animated-in"),e.querySelectorAll(".row-bg, .inner-wrap").forEach(e=>{e.classList.add("animated-in")})}),this.aboveTheFoldElements('.column-image-bg-wrap[data-bg-animation]:not([data-bg-animation="none"])').forEach(e=>{e.parentElement.classList.add("revealed-bg"),e.classList.add("animated-in"),e.parentElement.querySelectorAll(".column-bg-layer").forEach(e=>{e.classList.add("animated-in")}),e.querySelectorAll(".column-image-bg, .inner-wrap").forEach(e=>{e.classList.add("animated-in")})}),this.aboveTheFoldElements('.nectar-post-grid[data-animation="fade-in-from-bottom"] .nectar-post-grid-item').forEach(e=>{e.classList.add("animated-in")}),this.aboveTheFoldElements(".wpb_animate_when_almost_visible").forEach(e=>{e.classList.add("wpb_start_animation"),e.classList.add("animated")}),this.aboveTheFoldElements(".nectar-waypoint-el").forEach(e=>{e.classList.add("animated-in")}),this.aboveTheFoldElements(".nectar-split-heading").forEach(e=>{e.setAttribute("data-text-effect","none"),e.classList.add("animated-in","markup-generated"),e.querySelectorAll(".heading-line > div").forEach(e=>{e.style.transform="translate3d(0,0,0)"})}),this.aboveTheFoldElements(".nectar-text-inline-images__marker").forEach(e=>{e.classList.add("animated-in")}),this.aboveTheFoldElements(".nectar-highlighted-text em").forEach(e=>{e.classList.add("animated")}),this.aboveTheFoldElements(".nectar-animated-title").forEach(e=>{e.classList.add("completed")}),this.aboveTheFoldElements('.nectar-icon-list[data-animate="true"]').forEach(e=>{e.classList.add("completed"),e.querySelectorAll(".nectar-icon-list-item").forEach(e=>{e.classList.add("animated")})}),this.aboveTheFoldElements('.nectar-fancy-ul[data-animation="true"]').forEach(e=>{e.classList.add("animated-in");const t=e.getAttribute("data-list-icon"),i=t.split(" "),r=e.getAttribute("data-color");e.querySelectorAll("ul li").forEach(e=>{const n=a.createElement("i");t&&r&&(n.classList.add("icon-default-style",r),i.forEach(e=>{n.classList.add(e)})),e.style.left="0",e.style.opacity="1",e.prepend(n)})}),this.aboveTheFoldElements('.divider-border[data-animate="yes"], .divider-small-border[data-animate="yes"]').forEach(e=>{e.style.visibility="visible",e.classList.add("completed")}),this.aboveTheFoldElements(".nectar-rotating-words-title").forEach(e=>{e.style.opacity="1",e.classList.add("animated-in"),e.querySelectorAll(".text-wrap > span").forEach(e=>{e.style.transform="translate3d(0,0,0)"})}),"undefined"!=typeof SalientRecentProjectsFullScreen){this.aboveTheFoldElements(".nectar_fullscreen_zoom_recent_projects").forEach(t=>{new SalientRecentProjectsFullScreen(e(t))})}this.aboveTheFoldElements(".wpb_gallery_slidesflickity_static_height_style .item-meta").forEach(e=>{const t=e.parentElement.querySelector("img");t&&(e.style.width=t.offsetWidth+"px")}),this.aboveTheFoldElements('.nectar-woo-flickity[data-animation*="fade"]').forEach(e=>{e.classList.add("animated-in"),e.querySelectorAll(".product").forEach(e=>{e.style.opacity="1",e.style.transform="translate3d(0,0,0)"})});const r=a.querySelectorAll(".vc_row-o-full-height:not(.top-level)"),n=t.innerHeight;r.forEach(e=>{e.style.minHeight=parseInt(n)+"px";const t=e.querySelector(".col.span_12");t&&(t.style.minHeight=parseInt(n)+"px")});const o=a.querySelectorAll('.row > .top-level:not(.has-global-section) .wpb_wrapper > .nectar-slider-wrap[data-full-width="true"], .row > .top-level:not(.has-global-section) .portfolio-items[data-col-num="elastic"]'),s=a.querySelectorAll('#page-header-bg, .page-header-no-bg, .project-title, .body[data-bg-header="true"], body.single'),l=a.querySelectorAll("#portfolio-extra"),c=a.querySelectorAll("#full_width_portfolio"),d=l.length>0&&0==c.length;if(o.length>0&&0==s.length&&!1===d){const e=a.querySelector(".container-wrap");e&&(e.style.paddingTop="0px")}const h=a.querySelector(".blog-fullwidth-wrap");if(!!(h&&h.querySelectorAll(".span_12.masonry.meta_overlaid").length>0)){h.classList.add("meta-overlaid");const e=a.querySelector(".container-wrap");e&&e.classList.add("meta_overlaid_blog")}t.innerWidth>470&&setTimeout(()=>{const e=function(){};a.querySelectorAll(".portfolio-items:not(.carousel)").forEach(t=>{"undefined"!=typeof SalientPortfolio&&"undefined"!=typeof jQuery&&new SalientPortfolio(jQuery(t),e,"",e)}),a.querySelectorAll(".masonry:not(.auto_meta_overlaid_spaced) > .posts-container").forEach(t=>{if("undefined"!=typeof NectarMasonryBlog&&"undefined"!=typeof jQuery){new NectarMasonryBlog(jQuery(t),e,e),t.querySelectorAll(".masonry-blog-item").forEach(e=>{e.classList.add("animated-in")})}})},200);const m=a.querySelector("body.material #slide-out-widget-area.slide-out-from-right .slide_out_area_close");m&&m.classList.add("hide_until_rendered")},r.lazyLoadCriticalMedia=function(){this.aboveTheFoldElements("[data-nectar-img-src]").forEach(e=>{var t=e.getAttribute("data-nectar-img-src");if(t)if(e.classList.contains("nectar-lazy")){e.addEventListener("load",function(){e.classList.add("loaded"),e.removeAttribute("data-nectar-img-src")}),e.src=t;var a=e.getAttribute("data-nectar-img-srcset");a&&(e.setAttribute("srcset",a),e.removeAttribute("data-nectar-img-srcset")),e.parentNode.classList.add("img-loaded")}else e.style.backgroundImage="url('"+t+"')",e.classList.add("loaded"),e.removeAttribute("data-nectar-img-src")}),a.querySelectorAll(".vc_row.top-level .nectar-lazy-video").forEach(e=>{for(var t in e.children){const a=e.children[t];"string"==typeof a.tagName&&"SOURCE"===a.tagName&&(a.src=a.dataset.nectarVideoSrc)}e.load(),e.classList.remove("lazy")})},r.addEvents=function(){setTimeout(()=>{this.linksToPrevent=a.querySelectorAll("a.nectar_video_lightbox, a.pp, a[data-fancybox], a.pretty_photo, .wpb_gallery_slidesflickity_style .cell > a:not(.ext-url-link), .wpb_gallery_slidesflickity_static_height_style .cell > a:not(.ext-url-link), .slide-out-widget-area-toggle a, #mobile-cart-link, .mobile-search");let e=this;this.eventListeners.forEach(a=>{t.addEventListener(a,e.load)}),this.linksToPrevent&&this.linksToPrevent.forEach(t=>{t.addEventListener("click",e.noClick)})},80)},r.preventClick=function(e){if(!a.body.classList.contains("nectar-delay-js-loaded"))return e.preventDefault(),!1},r.removeEvents=function(){let e=this;this.eventListeners.forEach(a=>{t.removeEventListener(a,e.load)})},r.triggerLoad=async function(e){var t=this;this.removeEvents(),this.preloadScripts(),await this.sequentialScripts(),this.dispatchEvents(),"click"!==e.type&&"touchstart"!==e.type||(e.target&&e.target.matches("a")||e.target.closest("a"))&&setTimeout(()=>{this.linksToPrevent&&this.linksToPrevent.forEach(a=>{if(a.removeEventListener("click",t.noClick),a===e.target||a.contains(e.target)){"absolute"!==getComputedStyle(e.target).position&&e.target.click()}})},140),a.body.classList.add("nectar-delay-js-loaded")},r.preloadScripts=function(){this.scripts.forEach(function(e){const t=e.getAttribute("src");if(t){const e=a.createElement("link");e.href=t,e.rel="preload",e.as="script",a.head.appendChild(e)}})},r.sequentialScripts=async function(){const e=this.scripts.shift();return e?(await this.loadScript(e),this.sequentialScripts(e)):Promise.resolve()},r.loadScript=async function(e){if(e.hasAttribute("src"))return new Promise(function(t,i){const r=a.createElement("script");[...e.attributes].forEach(e=>{const t=e.nodeName,a=e.nodeValue;"type"!==t?"data-salient-lazy-type"!==t?"data-nowprocket"!==t&&"data-pagespeed-no-defer"!==t&&r.setAttribute(t,a):r.setAttribute("type",a):r.setAttribute("data-salient-delayed-js-loaded","true")}),r.addEventListener("load",()=>{t()}),r.addEventListener("error",()=>{t()}),e.parentNode.replaceChild(r,e)})},r.dispatchEvents=function(){t.dispatchEvent(new Event("DOMContentLoaded")),a.dispatchEvent(new Event("DOMContentLoaded")),t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("salient-delayed-js-loaded"))},new i}(window.jQuery,window,document);