(function(){"use strict";var kadenceBlocksGLight={carouselCache:{},carouselItem:{},lightboxes:{},foundClasses:{},simulateClick(a){const b=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});!a.dispatchEvent(b)},handleClones(a){const 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();const e=b[d].getAttribute("href");for(let d=0;d<c.length;d++)if(e===c[d].getAttribute("href")){kadenceBlocksGLight.simulateClick(c[d]);break}})},strip_tags(a,b){b=(((b||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");return a.replace(/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi,"").replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,function(a,c){return-1<b.indexOf("<"+c.toLowerCase()+">")?a:""})},findGalleries(){const a=document.querySelectorAll(".kb-gallery-magnific-init");if(a.length&&a)for(let b=0;b<a.length;b++){const c=a[b].classList,d=a[b].getAttribute("data-image-filter"),e=d?"kadence-dark kb-gal-light-filter-"+d:"kadence-dark",f=a[b].getAttribute("data-lightbox-caption"),g=a[b].querySelectorAll("a.kb-gallery-item-link");for(let a=0;a<g.length;a++)g[a].setAttribute("aria-label",kb_glightbox.lightBoxAriaLabel);kadenceBlocksGLight.foundClasses[b]=!1;for(let d=0;d<c.length;d++)if(-1!==c[d].indexOf("kb-gallery-id")){a[b].classList.add("kb-light-gallery-"+b),kadenceBlocksGLight.foundClasses[b]="kb-light-gallery-"+b;break}if("true"==f&&!a[b].classList.contains("kb-gallery-non-static")){const c=a[b].querySelectorAll("a.kb-gallery-item-link");for(let a=0;a<c.length;a++){const b=c[a].querySelector(".kadence-blocks-gallery-item__caption");b&&c[a].setAttribute("data-description",kadenceBlocksGLight.strip_tags(b.innerText,"<a><br><b><i><u><p><ol><ul><li><strong><small>"))}}kadenceBlocksGLight.carouselItem[b]=a[b].querySelector(".kt-blocks-carousel-init"),kadenceBlocksGLight.carouselItem[b]?kadenceBlocksGLight.carouselItem[b].classList.contains("is-initialized")?(kadenceBlocksGLight.handleClones(kadenceBlocksGLight.carouselItem[b]),kadenceBlocksGLight.foundClasses[b]&&(kadenceBlocksGLight.lightboxes[b]=new GLightbox({selector:"."+kadenceBlocksGLight.foundClasses[b]+" .kb-slide-item:not(.splide__slide--clone) a.kb-gallery-item-link:not([target=\"_blank\"])",touchNavigation:!0,skin:e,loop:!0,openEffect:"fade",closeEffect:"fade",moreText:kb_glightbox.moreText}))):kadenceBlocksGLight.carouselCache[b]=setInterval(function(){kadenceBlocksGLight.carouselItem[b].classList.contains("is-initialized")?(kadenceBlocksGLight.handleClones(kadenceBlocksGLight.carouselItem[b]),kadenceBlocksGLight.lightboxes[b]=new GLightbox({selector:"."+kadenceBlocksGLight.foundClasses[b]+" .kb-slide-item:not(.splide__slide--clone) a.kb-gallery-item-link:not([target=\"_blank\"])",touchNavigation:!0,skin:e,loop:!0,openEffect:"fade",closeEffect:"fade",moreText:kb_glightbox.moreText}),clearInterval(kadenceBlocksGLight.carouselCache[b])):console.log("waiting to initialize galllery lightbox")},200):kadenceBlocksGLight.foundClasses[b]&&(kadenceBlocksGLight.lightboxes[b]=new GLightbox({selector:"."+kadenceBlocksGLight.foundClasses[b]+" a.kb-gallery-item-link:not([target=\"_blank\"])",touchNavigation:!0,skin:e,loop:!0,openEffect:"fade",closeEffect:"fade",moreText:kb_glightbox.moreText}))}},initAll(){kadenceBlocksGLight.findGalleries()},init(){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()})();