(function(){"use strict";var kadenceBlocksGLight={carouselCache:{},carouselItem:{},lightboxes:{},foundClasses:{},simulateClick:function(a){var b=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});!a.dispatchEvent(b)},handleClones:function(a){var b=a.querySelectorAll(".kb-slide-item.splide__slide--clone a.kb-gallery-item-link"),c=a.querySelectorAll(".kb-slide-item:not(.splide__slide--clone) a.kb-gallery-item-link");for(let d=0;d<b.length;d++)b[d].addEventListener("click",function(a){a.preventDefault();var e=b[d].getAttribute("href");for(let d=0;d<c.length;d++)if(e===c[d].getAttribute("href")){kadenceBlocksGLight.simulateClick(c[d]);break}})},findGalleries:function(){let a=document.querySelectorAll(".kb-gallery-magnific-init");if(a.length&&a)for(let e=0;e<a.length;e++){let f=a[e].classList,g=a[e].getAttribute("data-image-filter");const h=g?"kadence-dark kb-gal-light-filter-"+g:"kadence-dark";var b=a[e].getAttribute("data-lightbox-caption");let i=a[e].querySelectorAll("a.kb-gallery-item-link");for(let a=0;a<i.length;a++)i[a].setAttribute("aria-label",kb_glightbox.lightBoxAriaLabel);kadenceBlocksGLight.foundClasses[e]=!1;for(let b=0;b<f.length;b++)if(-1!==f[b].indexOf("kb-gallery-id")){a[e].classList.add("kb-light-gallery-"+e),kadenceBlocksGLight.foundClasses[e]="kb-light-gallery-"+e;break}if("true"==b&&!a[e].classList.contains("kb-gallery-non-static")){var c=a[e].querySelectorAll("a.kb-gallery-item-link");for(let a=0;a<c.length;a++){var d=c[a].querySelector(".kadence-blocks-gallery-item__caption");d&&c[a].setAttribute("data-description",d.innerText)}}kadenceBlocksGLight.carouselItem[e]=a[e].querySelector(".kt-blocks-carousel-init"),kadenceBlocksGLight.carouselItem[e]?kadenceBlocksGLight.carouselItem[e].classList.contains("is-initialized")?(kadenceBlocksGLight.handleClones(kadenceBlocksGLight.carouselItem[e]),kadenceBlocksGLight.foundClasses[e]&&(kadenceBlocksGLight.lightboxes[e]=new GLightbox({selector:"."+kadenceBlocksGLight.foundClasses[e]+" .kb-slide-item:not(.splide__slide--clone) a.kb-gallery-item-link:not([target=\"_blank\"])",touchNavigation:!0,skin:h,loop:!0,openEffect:"fade",closeEffect:"fade",moreText:kb_glightbox.moreText}))):kadenceBlocksGLight.carouselCache[e]=setInterval(function(){kadenceBlocksGLight.carouselItem[e].classList.contains("is-initialized")?(kadenceBlocksGLight.handleClones(kadenceBlocksGLight.carouselItem[e]),kadenceBlocksGLight.lightboxes[e]=new GLightbox({selector:"."+kadenceBlocksGLight.foundClasses[e]+" .kb-slide-item:not(.splide__slide--clone) a.kb-gallery-item-link:not([target=\"_blank\"])",touchNavigation:!0,skin:h,loop:!0,openEffect:"fade",closeEffect:"fade",moreText:kb_glightbox.moreText}),clearInterval(kadenceBlocksGLight.carouselCache[e])):console.log("waiting to initialize galllery lightbox")},200):kadenceBlocksGLight.foundClasses[e]&&(kadenceBlocksGLight.lightboxes[e]=new GLightbox({selector:"."+kadenceBlocksGLight.foundClasses[e]+" a.kb-gallery-item-link:not([target=\"_blank\"])",touchNavigation:!0,skin:h,loop:!0,openEffect:"fade",closeEffect:"fade",moreText:kb_glightbox.moreText}))}},initAll:function(){kadenceBlocksGLight.findGalleries()},init:function(){if("function"==typeof GLightbox)kadenceBlocksGLight.initAll();else var a=setInterval(function(){"function"==typeof GLightbox&&(kadenceBlocksGLight.initAll(),clearInterval(a))},200)}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",kadenceBlocksGLight.init):kadenceBlocksGLight.init()})();