@innovastudio/contentbox-runtime-base 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2854,7 +2854,8 @@ class Ci {
|
|
|
2854
2854
|
class ki {
|
|
2855
2855
|
constructor(t = {}) {
|
|
2856
2856
|
const i = {
|
|
2857
|
-
skin: "light"
|
|
2857
|
+
skin: "light",
|
|
2858
|
+
smoothScroll: !0
|
|
2858
2859
|
};
|
|
2859
2860
|
this.settings = Object.assign(this, i, t), window.pageReRender = () => {
|
|
2860
2861
|
this.pageReRender();
|
|
@@ -2865,7 +2866,7 @@ class ki {
|
|
|
2865
2866
|
Je.init({
|
|
2866
2867
|
duration: 1200
|
|
2867
2868
|
});
|
|
2868
|
-
}, 300), new Ci();
|
|
2869
|
+
}, 300), this.settings.smoothScroll && new Ci();
|
|
2869
2870
|
}
|
|
2870
2871
|
prepareContent() {
|
|
2871
2872
|
const t = document.querySelector(".is-wrapper");
|
|
@@ -45,4 +45,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
45
45
|
<button class="gprev gbtn" aria-label="Previous" data-taborder="2">{prevSVG}</button>
|
|
46
46
|
<button class="gnext gbtn" aria-label="Next" data-taborder="1">{nextSVG}</button>
|
|
47
47
|
</div>
|
|
48
|
-
</div>`;class Ue{constructor(t={}){this.customOptions=t,this.settings=Rt(Le,t),this.effectsClasses=this.getAnimationClasses(),this.videoPlayers={},this.apiEvents=[],this.fullElementsList=!1}init(){const t=this.getSelector();t&&(this.baseEvents=Pt("click",{onElement:t,withCallback:(i,s)=>{i.preventDefault(),this.open(s)}})),this.elements=this.getElements()}open(t=null,i=null){if(this.elements.length===0)return!1;this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null;let s=re(i)?i:this.settings.startAt;if($t(t)){const n=t.getAttribute("data-gallery");n&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,n)),zt(s)&&(s=this.getElementIndex(t),s<0&&(s=0))}re(s)||(s=0),this.build(),Qt(this.overlay,this.settings.openEffect==="none"?"none":this.settings.cssEfects.fade.in);const e=document.body,a=window.innerWidth-document.documentElement.clientWidth;if(a>0){var r=document.createElement("style");r.type="text/css",r.className="gcss-styles",r.innerText=`.gscrollbar-fixer {margin-right: ${a}px}`,document.head.appendChild(r),Y(e,"gscrollbar-fixer")}Y(e,"glightbox-open"),Y(Ie,"glightbox-open"),Fe&&(Y(document.body,"glightbox-mobile"),this.settings.slideEffect="slide"),this.showSlide(s,!0),this.elements.length===1?(Y(this.prevButton,"glightbox-button-hidden"),Y(this.nextButton,"glightbox-button-hidden")):(ft(this.prevButton,"glightbox-button-hidden"),ft(this.nextButton,"glightbox-button-hidden")),this.lightboxOpen=!0,this.trigger("open"),D(this.settings.onOpen)&&this.settings.onOpen(),Ze&&this.settings.touchNavigation&&xi(this),this.settings.keyboardNavigation&&gi(this)}openAt(t=0){this.open(null,t)}showSlide(t=0,i=!1){De(this.loader),this.index=parseInt(t);let s=this.slidesContainer.querySelector(".current");s&&ft(s,"current"),this.slideAnimateOut();let e=this.slidesContainer.querySelectorAll(".gslide")[t];if(_t(e,"loaded"))this.slideAnimateIn(e,i),je(this.loader);else{De(this.loader);const a=this.elements[t],r={index:this.index,slide:e,slideNode:e,slideConfig:a.slideConfig,slideIndex:this.index,trigger:a.node,player:null};this.trigger("slide_before_load",r),a.instance.setContent(e,()=>{je(this.loader),this.resize(),this.slideAnimateIn(e,i),this.trigger("slide_after_load",r)})}this.slideDescription=e.querySelector(".gslide-description"),this.slideDescriptionContained=this.slideDescription&&_t(this.slideDescription.parentNode,"gslide-media"),this.settings.preload&&(this.preloadSlide(t+1),this.preloadSlide(t-1)),this.updateNavigationClasses(),this.activeSlide=e}preloadSlide(t){if(t<0||t>this.elements.length-1||zt(this.elements[t]))return!1;let i=this.slidesContainer.querySelectorAll(".gslide")[t];if(_t(i,"loaded"))return!1;const s=this.elements[t],e=s.type,a={index:t,slide:i,slideNode:i,slideConfig:s.slideConfig,slideIndex:t,trigger:s.node,player:null};this.trigger("slide_before_load",a),e==="video"||e==="external"?setTimeout(()=>{s.instance.setContent(i,()=>{this.trigger("slide_after_load",a)})},200):s.instance.setContent(i,()=>{this.trigger("slide_after_load",a)})}prevSlide(){this.goToSlide(this.index-1)}nextSlide(){this.goToSlide(this.index+1)}goToSlide(t=!1){if(this.prevActiveSlide=this.activeSlide,this.prevActiveSlideIndex=this.index,!this.loop()&&(t<0||t>this.elements.length-1))return!1;t<0?t=this.elements.length-1:t>=this.elements.length&&(t=0),this.showSlide(t)}insertSlide(t={},i=-1){i<0&&(i=this.elements.length);const s=new le(t,this,i),e=s.getConfig(),a=Rt({},e),r=s.create(),n=this.elements.length-1;a.index=i,a.node=!1,a.instance=s,a.slideConfig=e,this.elements.splice(i,0,a);let h=null,d=null;if(this.slidesContainer){if(i>n)this.slidesContainer.appendChild(r);else{let g=this.slidesContainer.querySelectorAll(".gslide")[i];this.slidesContainer.insertBefore(r,g)}(this.settings.preload&&this.index==0&&i==0||this.index-1==i||this.index+1==i)&&this.preloadSlide(i),this.index===0&&i===0&&(this.index=1),this.updateNavigationClasses(),h=this.slidesContainer.querySelectorAll(".gslide")[i],d=this.getSlidePlayerInstance(i),a.slideNode=h}this.trigger("slide_inserted",{index:i,slide:h,slideNode:h,slideConfig:e,slideIndex:i,trigger:null,player:d}),D(this.settings.slideInserted)&&this.settings.slideInserted({index:i,slide:h,player:d})}removeSlide(t=-1){if(t<0||t>this.elements.length-1)return!1;const i=this.slidesContainer&&this.slidesContainer.querySelectorAll(".gslide")[t];i&&(this.getActiveSlideIndex()==t&&(t==this.elements.length-1?this.prevSlide():this.nextSlide()),i.parentNode.removeChild(i)),this.elements.splice(t,1),this.trigger("slide_removed",t),D(this.settings.slideRemoved)&&this.settings.slideRemoved(t)}slideAnimateIn(t,i){let s=t.querySelector(".gslide-media"),e=t.querySelector(".gslide-description"),a={index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlide,slideConfig:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},r={index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideConfig:this.elements[this.index].slideConfig,slideIndex:this.index,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)};if(s.offsetWidth>0&&e&&(je(e),e.style.display=""),ft(t,this.effectsClasses),i)Qt(t,this.settings.cssEfects[this.settings.openEffect].in,()=>{this.settings.autoplayVideos&&this.slidePlayerPlay(t),this.trigger("slide_changed",{prev:a,current:r}),D(this.settings.afterSlideChange)&&this.settings.afterSlideChange.apply(this,[a,r])});else{let n=this.settings.slideEffect,h=n!=="none"?this.settings.cssEfects[n].in:n;this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(h=this.settings.cssEfects.slideBack.in),Qt(t,h,()=>{this.settings.autoplayVideos&&this.slidePlayerPlay(t),this.trigger("slide_changed",{prev:a,current:r}),D(this.settings.afterSlideChange)&&this.settings.afterSlideChange.apply(this,[a,r])})}setTimeout(()=>{this.resize(t)},100),Y(t,"current")}slideAnimateOut(){if(!this.prevActiveSlide)return!1;let t=this.prevActiveSlide;ft(t,this.effectsClasses),Y(t,"prev");let i=this.settings.slideEffect,s=i!=="none"?this.settings.cssEfects[i].out:i;this.slidePlayerPause(t),this.trigger("slide_before_change",{prev:{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlideIndex,slideConfig:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},current:{index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideIndex:this.index,slideConfig:this.elements[this.index].slideConfig,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)}}),D(this.settings.beforeSlideChange)&&this.settings.beforeSlideChange.apply(this,[{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},{index:this.index,slide:this.activeSlide,player:this.getSlidePlayerInstance(this.index)}]),this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(s=this.settings.cssEfects.slideBack.out),Qt(t,s,()=>{let e=t.querySelector(".ginner-container"),a=t.querySelector(".gslide-media"),r=t.querySelector(".gslide-description");e.style.transform="",a.style.transform="",ft(a,"greset"),a.style.opacity="",r&&(r.style.opacity=""),ft(t,"prev")})}getAllPlayers(){return this.videoPlayers}getSlidePlayerInstance(t){const i="gvideo"+t,s=this.getAllPlayers();return gt(s,i)&&s[i]?s[i]:!1}stopSlideVideo(t){if($t(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}console.log("stopSlideVideo is deprecated, use slidePlayerPause");const i=this.getSlidePlayerInstance(t);i&&i.playing&&i.pause()}slidePlayerPause(t){if($t(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}const i=this.getSlidePlayerInstance(t);i&&i.playing&&i.pause()}playSlideVideo(t){if($t(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}console.log("playSlideVideo is deprecated, use slidePlayerPlay");const i=this.getSlidePlayerInstance(t);i&&!i.playing&&i.play()}slidePlayerPlay(t){if(Fe&&!this.settings.plyr.config?.muted)return;if($t(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}const i=this.getSlidePlayerInstance(t);i&&!i.playing&&(i.play(),this.settings.autofocusVideos&&i.elements.container.focus())}setElements(t){this.settings.elements=!1;const i=[];t&&t.length&&J(t,(s,e)=>{const a=new le(s,this,e),r=a.getConfig(),n=Rt({},r);n.slideConfig=r,n.instance=a,n.index=e,i.push(n)}),this.elements=i,this.lightboxOpen&&(this.slidesContainer.innerHTML="",this.elements.length&&(J(this.elements,()=>{let s=Ft(this.settings.slideHTML);this.slidesContainer.appendChild(s)}),this.showSlide(0,!0)))}getElementIndex(t){let i=!1;return J(this.elements,(s,e)=>{if(gt(s,"node")&&s.node==t)return i=e,!0}),i}getElements(){let t=[];this.elements=this.elements?this.elements:[],!zt(this.settings.elements)&&Pe(this.settings.elements)&&this.settings.elements.length&&J(this.settings.elements,(e,a)=>{const r=new le(e,this,a),n=r.getConfig(),h=Rt({},n);h.node=!1,h.index=a,h.instance=r,h.slideConfig=n,t.push(h)});let i=!1;return this.getSelector()&&(i=document.querySelectorAll(this.getSelector())),i&&J(i,(e,a)=>{const r=new le(e,this,a),n=r.getConfig(),h=Rt({},n);h.node=e,h.index=a,h.instance=r,h.slideConfig=n,h.gallery=e.getAttribute("data-gallery"),t.push(h)}),t}getGalleryElements(t,i){return t.filter(s=>s.gallery==i)}getSelector(){return this.settings.elements?!1:this.settings.selector&&this.settings.selector.substring(0,5)=="data-"?`*[${this.settings.selector}]`:this.settings.selector}getActiveSlide(){return this.slidesContainer.querySelectorAll(".gslide")[this.index]}getActiveSlideIndex(){return this.index}getAnimationClasses(){let t=[];for(let i in this.settings.cssEfects)if(this.settings.cssEfects.hasOwnProperty(i)){let s=this.settings.cssEfects[i];t.push(`g${s.in}`),t.push(`g${s.out}`)}return t.join(" ")}build(){if(this.built)return!1;const t=document.body.childNodes,i=[];J(t,d=>{d.parentNode==document.body&&d.nodeName.charAt(0)!=="#"&&d.hasAttribute&&!d.hasAttribute("aria-hidden")&&(i.push(d),d.setAttribute("aria-hidden","true"))});const s=gt(this.settings.svg,"next")?this.settings.svg.next:"",e=gt(this.settings.svg,"prev")?this.settings.svg.prev:"",a=gt(this.settings.svg,"close")?this.settings.svg.close:"";let r=this.settings.lightboxHTML;r=r.replace(/{nextSVG}/g,s),r=r.replace(/{prevSVG}/g,e),r=r.replace(/{closeSVG}/g,a),r=Ft(r),document.body.appendChild(r);const n=document.getElementById("glightbox-body");this.modal=n;let h=n.querySelector(".gclose");this.prevButton=n.querySelector(".gprev"),this.nextButton=n.querySelector(".gnext"),this.overlay=n.querySelector(".goverlay"),this.loader=n.querySelector(".gloader"),this.slidesContainer=document.getElementById("glightbox-slider"),this.bodyHiddenChildElms=i,this.events={},Y(this.modal,"glightbox-"+this.settings.skin),this.settings.closeButton&&h&&(this.events.close=Pt("click",{onElement:h,withCallback:(d,g)=>{d.preventDefault(),this.close()}})),h&&!this.settings.closeButton&&h.parentNode.removeChild(h),this.nextButton&&(this.events.next=Pt("click",{onElement:this.nextButton,withCallback:(d,g)=>{d.preventDefault(),this.nextSlide()}})),this.prevButton&&(this.events.prev=Pt("click",{onElement:this.prevButton,withCallback:(d,g)=>{d.preventDefault(),this.prevSlide()}})),this.settings.closeOnOutsideClick&&(this.events.outClose=Pt("click",{onElement:n,withCallback:(d,g)=>{!this.preventOutsideClick&&!_t(document.body,"glightbox-mobile")&&!Wt(d.target,".ginner-container")&&!Wt(d.target,".gbtn")&&!_t(d.target,"gnext")&&!_t(d.target,"gprev")&&this.close()}})),J(this.elements,(d,g)=>{this.slidesContainer.appendChild(d.instance.create()),d.slideNode=this.slidesContainer.querySelectorAll(".gslide")[g]}),Ze&&Y(document.body,"glightbox-touch"),this.events.resize=Pt("resize",{onElement:window,withCallback:()=>{this.resize()}}),this.built=!0}resize(t=null){if(t=t||this.activeSlide,!t||_t(t,"zoomed"))return;const i=ze(),s=t.querySelector(".gvideo-wrapper"),e=t.querySelector(".gslide-image"),a=this.slideDescription;let r=i.width,n=i.height;if(r<=768?Y(document.body,"glightbox-mobile"):ft(document.body,"glightbox-mobile"),!s&&!e)return;let h=!1;if(a&&(_t(a,"description-bottom")||_t(a,"description-top"))&&!_t(a,"gabsolute")&&(h=!0),e){if(r<=768)e.querySelector("img");else if(h){let d=a.offsetHeight,g=e.querySelector("img");const b=this.elements[this.index].node.getAttribute("data-height")??"100vh";g.setAttribute("style",`max-height: calc(${b} - ${d}px)`),a.setAttribute("style",`max-width: ${g.offsetWidth}px;`)}}if(s){let d=gt(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!d){const V=s.clientWidth,C=s.clientHeight,at=V/C;d=`${V/at}:${C/at}`}let g=d.split(":"),p=this.settings.videosWidth,b=this.settings.videosWidth;re(p)||p.indexOf("px")!==-1?b=parseInt(p):p.indexOf("vw")!==-1?b=r*parseInt(p)/100:p.indexOf("vh")!==-1?b=n*parseInt(p)/100:p.indexOf("%")!==-1?b=r*parseInt(p)/100:b=parseInt(s.clientWidth);let I=b/(parseInt(g[0])/parseInt(g[1]));if(I=Math.floor(I),h&&(n=n-a.offsetHeight),b>r||I>n||n<I&&r>b){let V=s.offsetWidth,C=s.offsetHeight,at=n/C,pt={width:V*at};s.parentNode.setAttribute("style",`max-width: ${pt.width}px`),h&&a.setAttribute("style",`max-width: ${pt.width}px;`)}else s.parentNode.style.maxWidth=`${p}`,h&&a.setAttribute("style",`max-width: ${p};`)}}reload(){this.init()}updateNavigationClasses(){const t=this.loop();ft(this.nextButton,"disabled"),ft(this.prevButton,"disabled"),this.index==0&&this.elements.length-1==0?(Y(this.prevButton,"disabled"),Y(this.nextButton,"disabled")):this.index===0&&!t?Y(this.prevButton,"disabled"):this.index===this.elements.length-1&&!t&&Y(this.nextButton,"disabled")}loop(){let t=gt(this.settings,"loopAtEnd")?this.settings.loopAtEnd:null;return t=gt(this.settings,"loop")?this.settings.loop:t,t}close(){if(!this.lightboxOpen){if(this.events){for(let t in this.events)this.events.hasOwnProperty(t)&&this.events[t].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slidePlayerPause(this.activeSlide),this.fullElementsList&&(this.elements=this.fullElementsList),this.bodyHiddenChildElms.length&&J(this.bodyHiddenChildElms,t=>{t.removeAttribute("aria-hidden")}),Y(this.modal,"glightbox-closing"),Qt(this.overlay,this.settings.openEffect=="none"?"none":this.settings.cssEfects.fade.out),Qt(this.activeSlide,this.settings.cssEfects[this.settings.closeEffect].out,()=>{if(this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null,this.built=!1,this.events){for(let s in this.events)this.events.hasOwnProperty(s)&&this.events[s].destroy();this.events=null}const t=document.body;ft(Ie,"glightbox-open"),ft(t,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),this.modal.parentNode.removeChild(this.modal),this.trigger("close"),D(this.settings.onClose)&&this.settings.onClose();const i=document.querySelector(".gcss-styles");i&&i.parentNode.removeChild(i),this.lightboxOpen=!1,this.closing=null})}destroy(){this.close(),this.clearAllEvents(),this.baseEvents&&this.baseEvents.destroy()}on(t,i,s=!1){if(!t||!D(i))throw new TypeError("Event name and callback must be defined");this.apiEvents.push({evt:t,once:s,callback:i})}once(t,i){this.on(t,i,!0)}trigger(t,i=null){const s=[];J(this.apiEvents,(e,a)=>{const{evt:r,once:n,callback:h}=e;r==t&&(h(i),n&&s.push(a))}),s.length&&J(s,e=>this.apiEvents.splice(e,1))}clearAllEvents(){this.apiEvents.splice(0,this.apiEvents.length)}version(){return Ti}}class Ci{constructor(t={}){this.animationTime=t.animationTime??800,this.frameRate=t.frameRate??150,this.stepSize=t.stepSize??120,this.accelerationDelta=t.accelerationDelta??300,this.accelerationMax=t.accelerationMax??2,this.pulseScale=t.pulseScale??4,this.pulseNormalize=1/this._pulseRaw(1),this.queue=[],this.pending=!1,this.lastScrollTime=0,this.direction={x:0,y:0},this._init()}_init(){window.addEventListener("wheel",this._onWheel.bind(this),{passive:!1})}destroy(){window.removeEventListener("wheel",this._onWheel.bind(this)),this.queue=[],this.pending=!1}_onWheel(t){if(t.ctrlKey||t.defaultPrevented)return;let i=t.deltaX,s=t.deltaY;!i&&!s&&(s=-t.wheelDelta||0),t.deltaMode===1&&(i*=40,s*=40),Math.abs(i)>1.2&&(i=i/120*this.stepSize),Math.abs(s)>1.2&&(s=s/120*this.stepSize);const e=t.target,a=this._findScrollableAncestor(e);if(!a)return;const r=Date.now(),n=r-this.lastScrollTime;let h=1;n<this.accelerationDelta&&(h=Math.min(1+50/n,this.accelerationMax),i*=h,s*=h),this.lastScrollTime=r;const d=Math.sign(i),g=Math.sign(s);(d!==this.direction.x||g!==this.direction.y)&&(this.direction={x:d,y:g},this.queue=[]),this._enqueueScroll(a,i,s),t.preventDefault()}_findScrollableAncestor(t){const i=document.scrollingElement||document.documentElement;let s=t;for(;s&&s!==document.body;){const a=window.getComputedStyle(s).overflowY,r=["auto","scroll"].includes(a),n=s.scrollHeight>s.clientHeight;if(r&&n)return s;if(s===i)return i;s=s.parentElement}return i}_enqueueScroll(t,i,s){this.queue.push({element:t,x:i,y:s,lastX:i<0?.99:-.99,lastY:s<0?.99:-.99,start:Date.now()}),this.pending||(this._animate(t),this.pending=!0)}_animate(t){const i=Date.now();let s=0,e=0;for(let a=this.queue.length-1;a>=0;a--){const r=this.queue[a],n=i-r.start,h=n>=this.animationTime,d=h?1:n/this.animationTime,g=this._pulse(d),p=r.x*g-r.lastX|0,b=r.y*g-r.lastY|0;s+=p,e+=b,r.lastX+=p,r.lastY+=b,h&&this.queue.splice(a,1)}t===document.scrollingElement||t===document.documentElement?window.scrollBy(s,e):(s&&(t.scrollLeft+=s),e&&(t.scrollTop+=e)),this.queue.length>0?(1e3/this.frameRate,requestAnimationFrame(()=>this._animate(t))):this.pending=!1}_pulseRaw(t){if(t*=this.pulseScale,t<1)return t-(1-Math.exp(-t));{const i=Math.exp(-1),s=1-Math.exp(-(t-1));return i+s*(1-i)}}_pulse(t){return t<=0?0:t>=1?1:this._pulseRaw(t)*this.pulseNormalize}}class Ii{constructor(t={}){const i={skin:"light"};this.settings=Object.assign(this,i,t),window.pageReRender=()=>{this.pageReRender()}}init(){this.prepareContent(),this.updateOnResize(),this.blockInit(),this.initeSkrollrr(),this.contentBoxOnRenderUpdate(),this.functionLightboxInit(),this.inViewSetup(),setTimeout(()=>{Je.init({duration:1200})},300),new Ci}prepareContent(){const t=document.querySelector(".is-wrapper");t.classList.add("box-v2");const i=function(r){let n=r.nextElementSibling;return n?n.classList.contains("is-section")?n:i(n):!1};document.querySelectorAll(".is-arrow-down a").forEach(function(r){r.addEventListener("click",function(n){let h=n.target.closest(".is-section");if(h){let d=i(h);d&&this.scrollIt(d,1e3,"easeInQuad")}n.preventDefault(),n.stopImmediatePropagation()})}),t&&(t.classList.contains("is-edit")||t.querySelectorAll("a").forEach(function(n){n.addEventListener("click",function(h){let d=n.getAttribute("href");if(d&&d.indexOf("#")===0)if(d.indexOf("#section")===0){let g=d.replace("#section","");if(!isNaN(parseInt(g))){let p=document.querySelectorAll(".is-section"),b,I=0;p.forEach(function(V){V.classList.contains("is-section-navbar")||(I===g-1&&(b=V),I++)}),b&&scrollIt(b,1e3,"easeInQuad"),h.preventDefault()}}else try{let g=document.querySelector(d);g&&(scrollIt(g,1e3,"easeInQuad"),h.preventDefault())}catch{}})})),document.querySelectorAll(".section-inview").forEach(function(r){r.classList.remove("section-inview")});let a=document.querySelectorAll(".is-animated,.is-scale-animated");a.forEach(function(r){r.classList.contains("once")?(r.removeAttribute("data-scroll",""),r.setAttribute("data-scroll-once","")):(r.removeAttribute("data-scroll-once",""),r.setAttribute("data-scroll",""))}),a=document.querySelectorAll(".is-container > div"),a.forEach(function(r){let n=r.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),h=0;n.length>1&&n.forEach(function(d){d.className.indexOf("delay-")===-1&&(h>0&&(d.style.transitionDelay=h+"s",d.style.animationDelay=h+"s"),h=h+.2)})}),this.skrollrSetup(),this.adjustBgPos()}updateOnResize(){function t(s){var e;return function(a){e&&clearTimeout(e),e=setTimeout(s,100,a)}}const i=document.querySelector(".is-wrapper");window.addEventListener("resize",t(s=>{document.body.classList.contains("data-editor")&&(i.querySelector(".pin-wrap")&&!window.noRender?this.pageReRender():window.skrollrr&&window.skrollrr.refresh(),window.noRender=!1,this.adjustBgPos())})),i.classList.contains("is-edit")&&(window.onbeforeunload=function(s){localStorage.setItem("_lastscrollpos",document.documentElement.scrollTop),window.scrollTo(0,0)},setTimeout(()=>{localStorage.getItem("_lastscrollpos")&&window.scrollTo(0,localStorage.getItem("_lastscrollpos"))},300))}initeSkrollrr(){var t=document.querySelectorAll(".is-overlay-bg");t.forEach(s=>{s.style&&s.style.filter&&s.style.filter.indexOf("grayscale")!==-1&&(s.parentNode.style.filter="grayscale(1)")});const i=new ii({transition:"all 0.3s ease-out"});i.init(),window.skrollrr=i}_scrollTo(t,i=0){const s=t.getBoundingClientRect().top+window.pageYOffset+i;window.scrollTo({top:s,behavior:"smooth"})}scrollIt(t,i=200,s="linear",e){_scrollTo(t)}skrollrSetup(){document.querySelectorAll(".pin-wrap").forEach(n=>{const h=n.firstElementChild;n.after(h),n.parentNode.removeChild(n)}),document.querySelectorAll(".is-section").forEach(n=>{n.hasAttribute("data-section-clone")&&n.parentNode.removeChild(n),n.hasAttribute("data-section-original")&&(n.style.display="",n.removeAttribute("data-section-original"))});let s=window.innerWidth;s<=760&&document.querySelectorAll(".section-wrap").forEach(h=>{h.outerHTML=h.innerHTML});const e=window.self!==window.top;let a;e?a=document.querySelectorAll(".is-wrapper .section-pin"):a=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),a.length>0&&window.scrollTo(0,0),a.forEach(function(n){s<=970&&n.querySelector(".is-box")&&(n.querySelectorAll(".is-box").forEach(d=>{const g=n.cloneNode(!1);d.getAttributeNames().map(p=>{p.indexOf("data-")!==-1&&g.setAttribute(p,d.getAttribute(p))}),g.classList.add("is-box"),d.classList.forEach(p=>{(p.indexOf("is-box-")!==-1||p.indexOf("is-content-")!==-1||p.indexOf("box-autofit")!==-1||p.indexOf("is-light-text")!==-1||p.indexOf("is-dark-text")!==-1||p.indexOf("is-align-")!==-1||p.indexOf("type-")!==-1||p.indexOf("block-click")!==-1||p.indexOf("hover-zoom")!==-1)&&g.classList.add(p)}),g.setAttribute("data-section-clone",""),g.innerHTML=d.innerHTML,n.parentNode.insertBefore(g,n)}),n.setAttribute("data-section-original",""),n.style.display="none")}),e?a=document.querySelectorAll(".is-wrapper .section-pin"):a=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),a.forEach(function(n){if(n.parentNode.closest(".section-wrap")||s<=970&&n.hasAttribute("data-section-original"))return;const h=document.createElement("div");h.classList.add("pin-wrap"),n.classList.contains("m-skrollrr-off")&&h.classList.add("m-skrollrr-off"),n.classList.contains("pin-space-lg")&&h.classList.add("pin-space-lg"),n.classList.contains("pin-space-xl")&&h.classList.add("pin-space-xl"),n.classList.contains("xs-hidden")&&h.classList.add("xs-hidden"),n.classList.contains("sm-hidden")&&h.classList.add("sm-hidden"),n.classList.contains("desktop-hidden")&&h.classList.add("desktop-hidden"),n.after(h),h.appendChild(n)});const r=n=>{document.querySelectorAll(".is-section").forEach(d=>{const g=d.getBoundingClientRect().top;let p,b;d.parentNode.classList.contains("pin-wrap")?(p=d.parentNode.nextElementSibling,b=d.parentNode.previousElementSibling):(p=d.nextElementSibling,b=d.previousElementSibling),p&&p.classList.contains("pin-wrap")&&(p=p.querySelector(".is-section")),b&&b.classList.contains("pin-wrap")&&(b=b.querySelector(".is-section")),g<=0&&((d.classList.contains("no-spacing")||d.classList.contains("pin-overlap"))&&d.classList.add("section-inview"),document.querySelectorAll(".is-section").forEach(V=>{V!==d&&V.classList.remove("section-inview")}))})};setTimeout(()=>{(!document.querySelector(".is-wrapper").classList.contains("is-edit")||e)&&!window.funcScroll&&(window.addEventListener("scroll",r),window.funcScroll=!0)},300)}adjustBgPos(){const t=a=>{const r=document.createElement("div");r.style.backgroundPositionX=a.style.backgroundPositionX,r.style.backgroundPositionY=a.style.backgroundPositionY,r.style.backgroundSize=a.style.backgroundSize,a.hasAttribute("data-bg-ori")||a.setAttribute("data-bg-ori",r.style.cssText)},i=a=>{if(a.hasAttribute("data-bg-ori")){const r=document.createElement("div");r.style.cssText=a.getAttribute("data-bg-ori"),a.style.backgroundPositionX=r.style.backgroundPositionX,a.style.backgroundPositionY=r.style.backgroundPositionY,a.style.backgroundSize=r.style.backgroundSize,a.removeAttribute("data-bg-ori")}};let s=window.innerWidth;document.querySelectorAll("[data-bg-xs],[data-bg-sm],[data-bg-md],[data-bg-lg]").forEach(a=>{t(a),s<=760&&(a.hasAttribute("data-bg-xs")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-xs"):i(a)),s>760&&s<=970&&(a.hasAttribute("data-bg-sm")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-sm"):i(a)),s>970&&s<=1280&&(a.hasAttribute("data-bg-md")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-md"):i(a)),s>1280&&(a.hasAttribute("data-bg-lg")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-lg"):i(a))})}inViewSetup(){document.querySelectorAll(".is-overlay-content").forEach(e=>{e.querySelector("video.is-video-bg")&&e.setAttribute("data-scroll","")}),document.querySelectorAll(".is-container video").forEach(e=>{e.parentNode.setAttribute("data-scroll","")});const s=new di({trigger:{once:!0,offset:{element:{x:0,y:(e,a,r)=>.1},viewport:{x:0,y:(e,a,r)=>e.visible?0:.1}},toggle:{class:{in:"is-inview",out:[""]},callback:{in:e=>{e.element.querySelectorAll("video").forEach(r=>{if(r.innerHTML.trim()==="")return;let n=r.parentNode.querySelector(".video-bg-play");r.autoplay?n?n.innerHTML.indexOf("play")===-1&&r.play():r.play():n&&n.innerHTML.indexOf("play")===-1&&r.play()})},out:e=>{e.element.querySelectorAll("video").forEach(r=>{!r.paused&&!r.closest("[data-html]")&&r.pause()})}}}}});s.add("[data-scroll-once]"),s.add("[data-scroll]",{once:!1}),window.trigger=s}contentBoxOnRenderUpdate(){try{if(window.contentbox||parent.contentbox){let t;window.contentbox?t=window.contentbox.onRender:parent.contentbox&&(t=parent.contentbox.onRender);const i=()=>{t.call(this);try{window.trigger&&window.trigger.kill()}catch{}let s=document.querySelectorAll(".is-animated,.is-scale-animated");s.forEach(function(e){e.classList.contains("once")?(e.removeAttribute("data-scroll",""),e.setAttribute("data-scroll-once","")):(e.removeAttribute("data-scroll-once",""),e.setAttribute("data-scroll",""))}),s=document.querySelectorAll(".is-container > div"),s.forEach(function(e){let a=e.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),r=0;a.length>1&&a.forEach(function(n){n.className.indexOf("delay-")===-1&&(r>0&&(n.style.transitionDelay=r+"s",n.style.animationDelay=r+"s"),r=r+.2)})}),setTimeout(()=>{this.inViewSetup()},100)};window.contentbox?window.contentbox.onRender=i:parent.contentbox&&(parent.contentbox.onRender=i)}}catch{}}functionLightboxInit(){const t={touchNavigation:!0,selector:".glightbox",loop:!0,autoplayVideos:!0,zoomable:!0,slideEffect:"slide",descPosition:"bottom",skin:this.settings.skin};this.refreshLightbox(t),document.querySelectorAll(".is-lightbox,.block-click").forEach(s=>{const e=a=>{let r=s.getAttribute("href")||s.getAttribute("data-modal-url");this.openLightbox(r,s,t),a.preventDefault(),a.stopImmediatePropagation()};s.addEventListener("click",e),s._lightboxHandler=e})}refreshLightbox(t){this.glightbox&&this.glightbox.destroy(),this.glightbox=new Ue(t),window.GLightbox=Ue.default}openLightbox(t,i,s){let e=[],a=0;if(i){const n=i.closest("[data-gallery]");let h=[];n?h=n.querySelectorAll(".is-lightbox"):document.querySelectorAll(".is-lightbox,.block-click").forEach(g=>{g.closest("[data-gallery]")||h.push(g)}),h.forEach((d,g)=>{let p=d.getAttribute("href");p||(p=d.getAttribute("data-modal-url")),e.push({href:p}),t===p&&(a=g)})}const r=document.activeElement;r?.blur(),e.length>0?(this.glightbox.setElements(e),this.glightbox.openAt(a)):(this.glightbox.setElements([{href:t}]),this.glightbox.open()),this.glightbox.on("close",()=>{this.refreshLightbox(s),r?.focus()})}blockInit(){const t={start:()=>{document.querySelectorAll(".is-block").forEach(e=>{e.hasAttribute("data--t")||e.setAttribute("data--t",e.style.top),e.hasAttribute("data--l")||e.setAttribute("data--l",e.style.left),e.hasAttribute("data--b")||e.setAttribute("data--b",e.style.bottom),e.hasAttribute("data--r")||e.setAttribute("data--r",e.style.right),e.hasAttribute("data--w")||e.setAttribute("data--w",e.style.width),e.hasAttribute("data--h")||e.setAttribute("data--h",e.style.height),e.removeAttribute("data-prev"),e.removeAttribute("data-fluid"),e.removeAttribute("data-fluid-val"),e.classList.remove("fluid"),e.style.transition=""})},apply:(e,a,r)=>{if(a&&e.getAttribute("data-prev")!==a+""){if(r||(e.style.transition="all 0.35s ease"),a!==1e4){if(e.setAttribute("data-breakpoint",a),e.hasAttribute("data--t-"+a)){let n=e.getAttribute("data--t-"+a);e.style.top=n}if(e.hasAttribute("data--l-"+a)){let n=e.getAttribute("data--l-"+a);e.style.left=n}if(e.hasAttribute("data--b-"+a)){let n=e.getAttribute("data--b-"+a);e.style.bottom=n}if(e.hasAttribute("data--r-"+a)){let n=e.getAttribute("data--r-"+a);e.style.right=n}if(e.hasAttribute("data--w-"+a)){let n=e.getAttribute("data--w-"+a);e.style.width=n}if(e.hasAttribute("data--h-"+a)){let n=e.getAttribute("data--h-"+a);e.style.height=n}if(e.hasAttribute("data--transform-"+a)){let n=e.getAttribute("data--transform-"+a);e.style.transform=n,e.setAttribute("data--transform-val",a)}}else{if(e.removeAttribute("data-breakpoint"),e.hasAttribute("data--t")){let n=e.getAttribute("data--t");e.style.top=n}if(e.hasAttribute("data--l")){let n=e.getAttribute("data--l");e.style.left=n}if(e.hasAttribute("data--b")){let n=e.getAttribute("data--b");e.style.bottom=n}if(e.hasAttribute("data--r")){let n=e.getAttribute("data--r");e.style.right=n}if(e.hasAttribute("data--w")){let n=e.getAttribute("data--w");e.style.width=n}if(e.hasAttribute("data--h")){let n=e.getAttribute("data--h");e.style.height=n}if(e.hasAttribute("data--transform")){let n=e.getAttribute("data--transform");e.style.transform=n,e.setAttribute("data--transform-val","")}}e.setAttribute("data-prev",a),setTimeout(()=>{r||(e.style.transition="")},400)}},applyFluid:(e,a)=>{e.classList.toggle("fluid",a==="yes"),e.setAttribute("data-fluid",a)},resize:e=>{const a=window.innerWidth;document.querySelectorAll(".is-box").forEach(r=>{let n=[];const h=r.attributes;for(let d=0;d<h.length;d++){let p=h[d].name.match(/^data--h-(\d+)$/);if(p){const b=parseInt(p[1],10);n.push(b)}}n=[...new Set(n)],n.sort((d,g)=>g-d);for(let d=0;d<n.length;d++){const g=n[d];if(d===0){if(a>g){let p=r.getAttribute("data--h");p?r.style.height=p:r.style.height=""}}else{const p=n[d-1];if(p>=a&&a>g){let b=r.getAttribute("data--h-"+p);b&&(r.style.height=b)}}}if(n.length>0&&n[n.length-1]>=a){const g=n[n.length-1];let p=r.getAttribute("data--h-"+g);p&&(r.style.height=p)}}),document.querySelectorAll(".is-block").forEach(r=>{if(!r.classList.contains("locked")){r.offsetWidth+0>a&&!r.classList.contains("fluid")&&(r.setAttribute("data-fluid-val",r.offsetWidth),t.applyFluid(r,"yes"));let d=r.getAttribute("data-fluid-val");d&&parseInt(d)+0<=a&&r.classList.contains("fluid")&&t.applyFluid(r,"no")}let n=[];const h=r.attributes;for(let d=0;d<h.length;d++){const g=h[d].name;let p=g.match(/^data--t-(\d+)$/);if(p){const b=parseInt(p[1],10);n.push(b)}if(p=g.match(/^data--w-(\d+)$/),p){const b=parseInt(p[1],10);n.push(b)}if(p=g.match(/^data--transform-(\d+)$/),p){const b=parseInt(p[1],10);n.push(b)}}n=[...new Set(n)],n.sort((d,g)=>g-d);for(let d=0;d<n.length;d++){const g=n[d];if(d===0)a>g&&t.apply(r,1e4,e);else{const p=n[d-1];p>=a&&a>g&&t.apply(r,p,e)}}if(n.length>0){const d=n[n.length-1];d>=a&&t.apply(r,d,e)}})},render:()=>{t.start(),t.resize(!0)}},s=((e,a)=>{let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>e(...n),a)}})(()=>{t.resize()},0);window.addEventListener("resize",s),t.start(),t.resize(!0),this.Block=t}pageReRender(){this.prepareContent(),this.contentBoxOnRenderUpdate(),window.skrollrr?window.skrollrr.refresh():this.initeSkrollrr(),this.functionLightboxInit(),this.inViewSetup(),this.Block.start(),this.Block.resize()}destroy(){this.glightbox&&(this.glightbox.destroy(),this.glightbox=null),document.querySelectorAll(".is-lightbox,.block-click").forEach(i=>{i._lightboxHandler&&(i.removeEventListener("click",i._lightboxHandler),delete i._lightboxHandler)})}}return Ii})();
|
|
48
|
+
</div>`;class Ue{constructor(t={}){this.customOptions=t,this.settings=Rt(Le,t),this.effectsClasses=this.getAnimationClasses(),this.videoPlayers={},this.apiEvents=[],this.fullElementsList=!1}init(){const t=this.getSelector();t&&(this.baseEvents=Pt("click",{onElement:t,withCallback:(i,s)=>{i.preventDefault(),this.open(s)}})),this.elements=this.getElements()}open(t=null,i=null){if(this.elements.length===0)return!1;this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null;let s=re(i)?i:this.settings.startAt;if($t(t)){const n=t.getAttribute("data-gallery");n&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,n)),zt(s)&&(s=this.getElementIndex(t),s<0&&(s=0))}re(s)||(s=0),this.build(),Qt(this.overlay,this.settings.openEffect==="none"?"none":this.settings.cssEfects.fade.in);const e=document.body,a=window.innerWidth-document.documentElement.clientWidth;if(a>0){var r=document.createElement("style");r.type="text/css",r.className="gcss-styles",r.innerText=`.gscrollbar-fixer {margin-right: ${a}px}`,document.head.appendChild(r),Y(e,"gscrollbar-fixer")}Y(e,"glightbox-open"),Y(Ie,"glightbox-open"),Fe&&(Y(document.body,"glightbox-mobile"),this.settings.slideEffect="slide"),this.showSlide(s,!0),this.elements.length===1?(Y(this.prevButton,"glightbox-button-hidden"),Y(this.nextButton,"glightbox-button-hidden")):(ft(this.prevButton,"glightbox-button-hidden"),ft(this.nextButton,"glightbox-button-hidden")),this.lightboxOpen=!0,this.trigger("open"),D(this.settings.onOpen)&&this.settings.onOpen(),Ze&&this.settings.touchNavigation&&xi(this),this.settings.keyboardNavigation&&gi(this)}openAt(t=0){this.open(null,t)}showSlide(t=0,i=!1){De(this.loader),this.index=parseInt(t);let s=this.slidesContainer.querySelector(".current");s&&ft(s,"current"),this.slideAnimateOut();let e=this.slidesContainer.querySelectorAll(".gslide")[t];if(_t(e,"loaded"))this.slideAnimateIn(e,i),je(this.loader);else{De(this.loader);const a=this.elements[t],r={index:this.index,slide:e,slideNode:e,slideConfig:a.slideConfig,slideIndex:this.index,trigger:a.node,player:null};this.trigger("slide_before_load",r),a.instance.setContent(e,()=>{je(this.loader),this.resize(),this.slideAnimateIn(e,i),this.trigger("slide_after_load",r)})}this.slideDescription=e.querySelector(".gslide-description"),this.slideDescriptionContained=this.slideDescription&&_t(this.slideDescription.parentNode,"gslide-media"),this.settings.preload&&(this.preloadSlide(t+1),this.preloadSlide(t-1)),this.updateNavigationClasses(),this.activeSlide=e}preloadSlide(t){if(t<0||t>this.elements.length-1||zt(this.elements[t]))return!1;let i=this.slidesContainer.querySelectorAll(".gslide")[t];if(_t(i,"loaded"))return!1;const s=this.elements[t],e=s.type,a={index:t,slide:i,slideNode:i,slideConfig:s.slideConfig,slideIndex:t,trigger:s.node,player:null};this.trigger("slide_before_load",a),e==="video"||e==="external"?setTimeout(()=>{s.instance.setContent(i,()=>{this.trigger("slide_after_load",a)})},200):s.instance.setContent(i,()=>{this.trigger("slide_after_load",a)})}prevSlide(){this.goToSlide(this.index-1)}nextSlide(){this.goToSlide(this.index+1)}goToSlide(t=!1){if(this.prevActiveSlide=this.activeSlide,this.prevActiveSlideIndex=this.index,!this.loop()&&(t<0||t>this.elements.length-1))return!1;t<0?t=this.elements.length-1:t>=this.elements.length&&(t=0),this.showSlide(t)}insertSlide(t={},i=-1){i<0&&(i=this.elements.length);const s=new le(t,this,i),e=s.getConfig(),a=Rt({},e),r=s.create(),n=this.elements.length-1;a.index=i,a.node=!1,a.instance=s,a.slideConfig=e,this.elements.splice(i,0,a);let h=null,d=null;if(this.slidesContainer){if(i>n)this.slidesContainer.appendChild(r);else{let g=this.slidesContainer.querySelectorAll(".gslide")[i];this.slidesContainer.insertBefore(r,g)}(this.settings.preload&&this.index==0&&i==0||this.index-1==i||this.index+1==i)&&this.preloadSlide(i),this.index===0&&i===0&&(this.index=1),this.updateNavigationClasses(),h=this.slidesContainer.querySelectorAll(".gslide")[i],d=this.getSlidePlayerInstance(i),a.slideNode=h}this.trigger("slide_inserted",{index:i,slide:h,slideNode:h,slideConfig:e,slideIndex:i,trigger:null,player:d}),D(this.settings.slideInserted)&&this.settings.slideInserted({index:i,slide:h,player:d})}removeSlide(t=-1){if(t<0||t>this.elements.length-1)return!1;const i=this.slidesContainer&&this.slidesContainer.querySelectorAll(".gslide")[t];i&&(this.getActiveSlideIndex()==t&&(t==this.elements.length-1?this.prevSlide():this.nextSlide()),i.parentNode.removeChild(i)),this.elements.splice(t,1),this.trigger("slide_removed",t),D(this.settings.slideRemoved)&&this.settings.slideRemoved(t)}slideAnimateIn(t,i){let s=t.querySelector(".gslide-media"),e=t.querySelector(".gslide-description"),a={index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlide,slideConfig:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},r={index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideConfig:this.elements[this.index].slideConfig,slideIndex:this.index,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)};if(s.offsetWidth>0&&e&&(je(e),e.style.display=""),ft(t,this.effectsClasses),i)Qt(t,this.settings.cssEfects[this.settings.openEffect].in,()=>{this.settings.autoplayVideos&&this.slidePlayerPlay(t),this.trigger("slide_changed",{prev:a,current:r}),D(this.settings.afterSlideChange)&&this.settings.afterSlideChange.apply(this,[a,r])});else{let n=this.settings.slideEffect,h=n!=="none"?this.settings.cssEfects[n].in:n;this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(h=this.settings.cssEfects.slideBack.in),Qt(t,h,()=>{this.settings.autoplayVideos&&this.slidePlayerPlay(t),this.trigger("slide_changed",{prev:a,current:r}),D(this.settings.afterSlideChange)&&this.settings.afterSlideChange.apply(this,[a,r])})}setTimeout(()=>{this.resize(t)},100),Y(t,"current")}slideAnimateOut(){if(!this.prevActiveSlide)return!1;let t=this.prevActiveSlide;ft(t,this.effectsClasses),Y(t,"prev");let i=this.settings.slideEffect,s=i!=="none"?this.settings.cssEfects[i].out:i;this.slidePlayerPause(t),this.trigger("slide_before_change",{prev:{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlideIndex,slideConfig:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},current:{index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideIndex:this.index,slideConfig:this.elements[this.index].slideConfig,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)}}),D(this.settings.beforeSlideChange)&&this.settings.beforeSlideChange.apply(this,[{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},{index:this.index,slide:this.activeSlide,player:this.getSlidePlayerInstance(this.index)}]),this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(s=this.settings.cssEfects.slideBack.out),Qt(t,s,()=>{let e=t.querySelector(".ginner-container"),a=t.querySelector(".gslide-media"),r=t.querySelector(".gslide-description");e.style.transform="",a.style.transform="",ft(a,"greset"),a.style.opacity="",r&&(r.style.opacity=""),ft(t,"prev")})}getAllPlayers(){return this.videoPlayers}getSlidePlayerInstance(t){const i="gvideo"+t,s=this.getAllPlayers();return gt(s,i)&&s[i]?s[i]:!1}stopSlideVideo(t){if($t(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}console.log("stopSlideVideo is deprecated, use slidePlayerPause");const i=this.getSlidePlayerInstance(t);i&&i.playing&&i.pause()}slidePlayerPause(t){if($t(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}const i=this.getSlidePlayerInstance(t);i&&i.playing&&i.pause()}playSlideVideo(t){if($t(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}console.log("playSlideVideo is deprecated, use slidePlayerPlay");const i=this.getSlidePlayerInstance(t);i&&!i.playing&&i.play()}slidePlayerPlay(t){if(Fe&&!this.settings.plyr.config?.muted)return;if($t(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}const i=this.getSlidePlayerInstance(t);i&&!i.playing&&(i.play(),this.settings.autofocusVideos&&i.elements.container.focus())}setElements(t){this.settings.elements=!1;const i=[];t&&t.length&&J(t,(s,e)=>{const a=new le(s,this,e),r=a.getConfig(),n=Rt({},r);n.slideConfig=r,n.instance=a,n.index=e,i.push(n)}),this.elements=i,this.lightboxOpen&&(this.slidesContainer.innerHTML="",this.elements.length&&(J(this.elements,()=>{let s=Ft(this.settings.slideHTML);this.slidesContainer.appendChild(s)}),this.showSlide(0,!0)))}getElementIndex(t){let i=!1;return J(this.elements,(s,e)=>{if(gt(s,"node")&&s.node==t)return i=e,!0}),i}getElements(){let t=[];this.elements=this.elements?this.elements:[],!zt(this.settings.elements)&&Pe(this.settings.elements)&&this.settings.elements.length&&J(this.settings.elements,(e,a)=>{const r=new le(e,this,a),n=r.getConfig(),h=Rt({},n);h.node=!1,h.index=a,h.instance=r,h.slideConfig=n,t.push(h)});let i=!1;return this.getSelector()&&(i=document.querySelectorAll(this.getSelector())),i&&J(i,(e,a)=>{const r=new le(e,this,a),n=r.getConfig(),h=Rt({},n);h.node=e,h.index=a,h.instance=r,h.slideConfig=n,h.gallery=e.getAttribute("data-gallery"),t.push(h)}),t}getGalleryElements(t,i){return t.filter(s=>s.gallery==i)}getSelector(){return this.settings.elements?!1:this.settings.selector&&this.settings.selector.substring(0,5)=="data-"?`*[${this.settings.selector}]`:this.settings.selector}getActiveSlide(){return this.slidesContainer.querySelectorAll(".gslide")[this.index]}getActiveSlideIndex(){return this.index}getAnimationClasses(){let t=[];for(let i in this.settings.cssEfects)if(this.settings.cssEfects.hasOwnProperty(i)){let s=this.settings.cssEfects[i];t.push(`g${s.in}`),t.push(`g${s.out}`)}return t.join(" ")}build(){if(this.built)return!1;const t=document.body.childNodes,i=[];J(t,d=>{d.parentNode==document.body&&d.nodeName.charAt(0)!=="#"&&d.hasAttribute&&!d.hasAttribute("aria-hidden")&&(i.push(d),d.setAttribute("aria-hidden","true"))});const s=gt(this.settings.svg,"next")?this.settings.svg.next:"",e=gt(this.settings.svg,"prev")?this.settings.svg.prev:"",a=gt(this.settings.svg,"close")?this.settings.svg.close:"";let r=this.settings.lightboxHTML;r=r.replace(/{nextSVG}/g,s),r=r.replace(/{prevSVG}/g,e),r=r.replace(/{closeSVG}/g,a),r=Ft(r),document.body.appendChild(r);const n=document.getElementById("glightbox-body");this.modal=n;let h=n.querySelector(".gclose");this.prevButton=n.querySelector(".gprev"),this.nextButton=n.querySelector(".gnext"),this.overlay=n.querySelector(".goverlay"),this.loader=n.querySelector(".gloader"),this.slidesContainer=document.getElementById("glightbox-slider"),this.bodyHiddenChildElms=i,this.events={},Y(this.modal,"glightbox-"+this.settings.skin),this.settings.closeButton&&h&&(this.events.close=Pt("click",{onElement:h,withCallback:(d,g)=>{d.preventDefault(),this.close()}})),h&&!this.settings.closeButton&&h.parentNode.removeChild(h),this.nextButton&&(this.events.next=Pt("click",{onElement:this.nextButton,withCallback:(d,g)=>{d.preventDefault(),this.nextSlide()}})),this.prevButton&&(this.events.prev=Pt("click",{onElement:this.prevButton,withCallback:(d,g)=>{d.preventDefault(),this.prevSlide()}})),this.settings.closeOnOutsideClick&&(this.events.outClose=Pt("click",{onElement:n,withCallback:(d,g)=>{!this.preventOutsideClick&&!_t(document.body,"glightbox-mobile")&&!Wt(d.target,".ginner-container")&&!Wt(d.target,".gbtn")&&!_t(d.target,"gnext")&&!_t(d.target,"gprev")&&this.close()}})),J(this.elements,(d,g)=>{this.slidesContainer.appendChild(d.instance.create()),d.slideNode=this.slidesContainer.querySelectorAll(".gslide")[g]}),Ze&&Y(document.body,"glightbox-touch"),this.events.resize=Pt("resize",{onElement:window,withCallback:()=>{this.resize()}}),this.built=!0}resize(t=null){if(t=t||this.activeSlide,!t||_t(t,"zoomed"))return;const i=ze(),s=t.querySelector(".gvideo-wrapper"),e=t.querySelector(".gslide-image"),a=this.slideDescription;let r=i.width,n=i.height;if(r<=768?Y(document.body,"glightbox-mobile"):ft(document.body,"glightbox-mobile"),!s&&!e)return;let h=!1;if(a&&(_t(a,"description-bottom")||_t(a,"description-top"))&&!_t(a,"gabsolute")&&(h=!0),e){if(r<=768)e.querySelector("img");else if(h){let d=a.offsetHeight,g=e.querySelector("img");const b=this.elements[this.index].node.getAttribute("data-height")??"100vh";g.setAttribute("style",`max-height: calc(${b} - ${d}px)`),a.setAttribute("style",`max-width: ${g.offsetWidth}px;`)}}if(s){let d=gt(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!d){const V=s.clientWidth,C=s.clientHeight,at=V/C;d=`${V/at}:${C/at}`}let g=d.split(":"),p=this.settings.videosWidth,b=this.settings.videosWidth;re(p)||p.indexOf("px")!==-1?b=parseInt(p):p.indexOf("vw")!==-1?b=r*parseInt(p)/100:p.indexOf("vh")!==-1?b=n*parseInt(p)/100:p.indexOf("%")!==-1?b=r*parseInt(p)/100:b=parseInt(s.clientWidth);let I=b/(parseInt(g[0])/parseInt(g[1]));if(I=Math.floor(I),h&&(n=n-a.offsetHeight),b>r||I>n||n<I&&r>b){let V=s.offsetWidth,C=s.offsetHeight,at=n/C,pt={width:V*at};s.parentNode.setAttribute("style",`max-width: ${pt.width}px`),h&&a.setAttribute("style",`max-width: ${pt.width}px;`)}else s.parentNode.style.maxWidth=`${p}`,h&&a.setAttribute("style",`max-width: ${p};`)}}reload(){this.init()}updateNavigationClasses(){const t=this.loop();ft(this.nextButton,"disabled"),ft(this.prevButton,"disabled"),this.index==0&&this.elements.length-1==0?(Y(this.prevButton,"disabled"),Y(this.nextButton,"disabled")):this.index===0&&!t?Y(this.prevButton,"disabled"):this.index===this.elements.length-1&&!t&&Y(this.nextButton,"disabled")}loop(){let t=gt(this.settings,"loopAtEnd")?this.settings.loopAtEnd:null;return t=gt(this.settings,"loop")?this.settings.loop:t,t}close(){if(!this.lightboxOpen){if(this.events){for(let t in this.events)this.events.hasOwnProperty(t)&&this.events[t].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slidePlayerPause(this.activeSlide),this.fullElementsList&&(this.elements=this.fullElementsList),this.bodyHiddenChildElms.length&&J(this.bodyHiddenChildElms,t=>{t.removeAttribute("aria-hidden")}),Y(this.modal,"glightbox-closing"),Qt(this.overlay,this.settings.openEffect=="none"?"none":this.settings.cssEfects.fade.out),Qt(this.activeSlide,this.settings.cssEfects[this.settings.closeEffect].out,()=>{if(this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null,this.built=!1,this.events){for(let s in this.events)this.events.hasOwnProperty(s)&&this.events[s].destroy();this.events=null}const t=document.body;ft(Ie,"glightbox-open"),ft(t,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),this.modal.parentNode.removeChild(this.modal),this.trigger("close"),D(this.settings.onClose)&&this.settings.onClose();const i=document.querySelector(".gcss-styles");i&&i.parentNode.removeChild(i),this.lightboxOpen=!1,this.closing=null})}destroy(){this.close(),this.clearAllEvents(),this.baseEvents&&this.baseEvents.destroy()}on(t,i,s=!1){if(!t||!D(i))throw new TypeError("Event name and callback must be defined");this.apiEvents.push({evt:t,once:s,callback:i})}once(t,i){this.on(t,i,!0)}trigger(t,i=null){const s=[];J(this.apiEvents,(e,a)=>{const{evt:r,once:n,callback:h}=e;r==t&&(h(i),n&&s.push(a))}),s.length&&J(s,e=>this.apiEvents.splice(e,1))}clearAllEvents(){this.apiEvents.splice(0,this.apiEvents.length)}version(){return Ti}}class Ci{constructor(t={}){this.animationTime=t.animationTime??800,this.frameRate=t.frameRate??150,this.stepSize=t.stepSize??120,this.accelerationDelta=t.accelerationDelta??300,this.accelerationMax=t.accelerationMax??2,this.pulseScale=t.pulseScale??4,this.pulseNormalize=1/this._pulseRaw(1),this.queue=[],this.pending=!1,this.lastScrollTime=0,this.direction={x:0,y:0},this._init()}_init(){window.addEventListener("wheel",this._onWheel.bind(this),{passive:!1})}destroy(){window.removeEventListener("wheel",this._onWheel.bind(this)),this.queue=[],this.pending=!1}_onWheel(t){if(t.ctrlKey||t.defaultPrevented)return;let i=t.deltaX,s=t.deltaY;!i&&!s&&(s=-t.wheelDelta||0),t.deltaMode===1&&(i*=40,s*=40),Math.abs(i)>1.2&&(i=i/120*this.stepSize),Math.abs(s)>1.2&&(s=s/120*this.stepSize);const e=t.target,a=this._findScrollableAncestor(e);if(!a)return;const r=Date.now(),n=r-this.lastScrollTime;let h=1;n<this.accelerationDelta&&(h=Math.min(1+50/n,this.accelerationMax),i*=h,s*=h),this.lastScrollTime=r;const d=Math.sign(i),g=Math.sign(s);(d!==this.direction.x||g!==this.direction.y)&&(this.direction={x:d,y:g},this.queue=[]),this._enqueueScroll(a,i,s),t.preventDefault()}_findScrollableAncestor(t){const i=document.scrollingElement||document.documentElement;let s=t;for(;s&&s!==document.body;){const a=window.getComputedStyle(s).overflowY,r=["auto","scroll"].includes(a),n=s.scrollHeight>s.clientHeight;if(r&&n)return s;if(s===i)return i;s=s.parentElement}return i}_enqueueScroll(t,i,s){this.queue.push({element:t,x:i,y:s,lastX:i<0?.99:-.99,lastY:s<0?.99:-.99,start:Date.now()}),this.pending||(this._animate(t),this.pending=!0)}_animate(t){const i=Date.now();let s=0,e=0;for(let a=this.queue.length-1;a>=0;a--){const r=this.queue[a],n=i-r.start,h=n>=this.animationTime,d=h?1:n/this.animationTime,g=this._pulse(d),p=r.x*g-r.lastX|0,b=r.y*g-r.lastY|0;s+=p,e+=b,r.lastX+=p,r.lastY+=b,h&&this.queue.splice(a,1)}t===document.scrollingElement||t===document.documentElement?window.scrollBy(s,e):(s&&(t.scrollLeft+=s),e&&(t.scrollTop+=e)),this.queue.length>0?(1e3/this.frameRate,requestAnimationFrame(()=>this._animate(t))):this.pending=!1}_pulseRaw(t){if(t*=this.pulseScale,t<1)return t-(1-Math.exp(-t));{const i=Math.exp(-1),s=1-Math.exp(-(t-1));return i+s*(1-i)}}_pulse(t){return t<=0?0:t>=1?1:this._pulseRaw(t)*this.pulseNormalize}}class Ii{constructor(t={}){const i={skin:"light",smoothScroll:!0};this.settings=Object.assign(this,i,t),window.pageReRender=()=>{this.pageReRender()}}init(){this.prepareContent(),this.updateOnResize(),this.blockInit(),this.initeSkrollrr(),this.contentBoxOnRenderUpdate(),this.functionLightboxInit(),this.inViewSetup(),setTimeout(()=>{Je.init({duration:1200})},300),this.settings.smoothScroll&&new Ci}prepareContent(){const t=document.querySelector(".is-wrapper");t.classList.add("box-v2");const i=function(r){let n=r.nextElementSibling;return n?n.classList.contains("is-section")?n:i(n):!1};document.querySelectorAll(".is-arrow-down a").forEach(function(r){r.addEventListener("click",function(n){let h=n.target.closest(".is-section");if(h){let d=i(h);d&&this.scrollIt(d,1e3,"easeInQuad")}n.preventDefault(),n.stopImmediatePropagation()})}),t&&(t.classList.contains("is-edit")||t.querySelectorAll("a").forEach(function(n){n.addEventListener("click",function(h){let d=n.getAttribute("href");if(d&&d.indexOf("#")===0)if(d.indexOf("#section")===0){let g=d.replace("#section","");if(!isNaN(parseInt(g))){let p=document.querySelectorAll(".is-section"),b,I=0;p.forEach(function(V){V.classList.contains("is-section-navbar")||(I===g-1&&(b=V),I++)}),b&&scrollIt(b,1e3,"easeInQuad"),h.preventDefault()}}else try{let g=document.querySelector(d);g&&(scrollIt(g,1e3,"easeInQuad"),h.preventDefault())}catch{}})})),document.querySelectorAll(".section-inview").forEach(function(r){r.classList.remove("section-inview")});let a=document.querySelectorAll(".is-animated,.is-scale-animated");a.forEach(function(r){r.classList.contains("once")?(r.removeAttribute("data-scroll",""),r.setAttribute("data-scroll-once","")):(r.removeAttribute("data-scroll-once",""),r.setAttribute("data-scroll",""))}),a=document.querySelectorAll(".is-container > div"),a.forEach(function(r){let n=r.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),h=0;n.length>1&&n.forEach(function(d){d.className.indexOf("delay-")===-1&&(h>0&&(d.style.transitionDelay=h+"s",d.style.animationDelay=h+"s"),h=h+.2)})}),this.skrollrSetup(),this.adjustBgPos()}updateOnResize(){function t(s){var e;return function(a){e&&clearTimeout(e),e=setTimeout(s,100,a)}}const i=document.querySelector(".is-wrapper");window.addEventListener("resize",t(s=>{document.body.classList.contains("data-editor")&&(i.querySelector(".pin-wrap")&&!window.noRender?this.pageReRender():window.skrollrr&&window.skrollrr.refresh(),window.noRender=!1,this.adjustBgPos())})),i.classList.contains("is-edit")&&(window.onbeforeunload=function(s){localStorage.setItem("_lastscrollpos",document.documentElement.scrollTop),window.scrollTo(0,0)},setTimeout(()=>{localStorage.getItem("_lastscrollpos")&&window.scrollTo(0,localStorage.getItem("_lastscrollpos"))},300))}initeSkrollrr(){var t=document.querySelectorAll(".is-overlay-bg");t.forEach(s=>{s.style&&s.style.filter&&s.style.filter.indexOf("grayscale")!==-1&&(s.parentNode.style.filter="grayscale(1)")});const i=new ii({transition:"all 0.3s ease-out"});i.init(),window.skrollrr=i}_scrollTo(t,i=0){const s=t.getBoundingClientRect().top+window.pageYOffset+i;window.scrollTo({top:s,behavior:"smooth"})}scrollIt(t,i=200,s="linear",e){_scrollTo(t)}skrollrSetup(){document.querySelectorAll(".pin-wrap").forEach(n=>{const h=n.firstElementChild;n.after(h),n.parentNode.removeChild(n)}),document.querySelectorAll(".is-section").forEach(n=>{n.hasAttribute("data-section-clone")&&n.parentNode.removeChild(n),n.hasAttribute("data-section-original")&&(n.style.display="",n.removeAttribute("data-section-original"))});let s=window.innerWidth;s<=760&&document.querySelectorAll(".section-wrap").forEach(h=>{h.outerHTML=h.innerHTML});const e=window.self!==window.top;let a;e?a=document.querySelectorAll(".is-wrapper .section-pin"):a=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),a.length>0&&window.scrollTo(0,0),a.forEach(function(n){s<=970&&n.querySelector(".is-box")&&(n.querySelectorAll(".is-box").forEach(d=>{const g=n.cloneNode(!1);d.getAttributeNames().map(p=>{p.indexOf("data-")!==-1&&g.setAttribute(p,d.getAttribute(p))}),g.classList.add("is-box"),d.classList.forEach(p=>{(p.indexOf("is-box-")!==-1||p.indexOf("is-content-")!==-1||p.indexOf("box-autofit")!==-1||p.indexOf("is-light-text")!==-1||p.indexOf("is-dark-text")!==-1||p.indexOf("is-align-")!==-1||p.indexOf("type-")!==-1||p.indexOf("block-click")!==-1||p.indexOf("hover-zoom")!==-1)&&g.classList.add(p)}),g.setAttribute("data-section-clone",""),g.innerHTML=d.innerHTML,n.parentNode.insertBefore(g,n)}),n.setAttribute("data-section-original",""),n.style.display="none")}),e?a=document.querySelectorAll(".is-wrapper .section-pin"):a=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),a.forEach(function(n){if(n.parentNode.closest(".section-wrap")||s<=970&&n.hasAttribute("data-section-original"))return;const h=document.createElement("div");h.classList.add("pin-wrap"),n.classList.contains("m-skrollrr-off")&&h.classList.add("m-skrollrr-off"),n.classList.contains("pin-space-lg")&&h.classList.add("pin-space-lg"),n.classList.contains("pin-space-xl")&&h.classList.add("pin-space-xl"),n.classList.contains("xs-hidden")&&h.classList.add("xs-hidden"),n.classList.contains("sm-hidden")&&h.classList.add("sm-hidden"),n.classList.contains("desktop-hidden")&&h.classList.add("desktop-hidden"),n.after(h),h.appendChild(n)});const r=n=>{document.querySelectorAll(".is-section").forEach(d=>{const g=d.getBoundingClientRect().top;let p,b;d.parentNode.classList.contains("pin-wrap")?(p=d.parentNode.nextElementSibling,b=d.parentNode.previousElementSibling):(p=d.nextElementSibling,b=d.previousElementSibling),p&&p.classList.contains("pin-wrap")&&(p=p.querySelector(".is-section")),b&&b.classList.contains("pin-wrap")&&(b=b.querySelector(".is-section")),g<=0&&((d.classList.contains("no-spacing")||d.classList.contains("pin-overlap"))&&d.classList.add("section-inview"),document.querySelectorAll(".is-section").forEach(V=>{V!==d&&V.classList.remove("section-inview")}))})};setTimeout(()=>{(!document.querySelector(".is-wrapper").classList.contains("is-edit")||e)&&!window.funcScroll&&(window.addEventListener("scroll",r),window.funcScroll=!0)},300)}adjustBgPos(){const t=a=>{const r=document.createElement("div");r.style.backgroundPositionX=a.style.backgroundPositionX,r.style.backgroundPositionY=a.style.backgroundPositionY,r.style.backgroundSize=a.style.backgroundSize,a.hasAttribute("data-bg-ori")||a.setAttribute("data-bg-ori",r.style.cssText)},i=a=>{if(a.hasAttribute("data-bg-ori")){const r=document.createElement("div");r.style.cssText=a.getAttribute("data-bg-ori"),a.style.backgroundPositionX=r.style.backgroundPositionX,a.style.backgroundPositionY=r.style.backgroundPositionY,a.style.backgroundSize=r.style.backgroundSize,a.removeAttribute("data-bg-ori")}};let s=window.innerWidth;document.querySelectorAll("[data-bg-xs],[data-bg-sm],[data-bg-md],[data-bg-lg]").forEach(a=>{t(a),s<=760&&(a.hasAttribute("data-bg-xs")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-xs"):i(a)),s>760&&s<=970&&(a.hasAttribute("data-bg-sm")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-sm"):i(a)),s>970&&s<=1280&&(a.hasAttribute("data-bg-md")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-md"):i(a)),s>1280&&(a.hasAttribute("data-bg-lg")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-lg"):i(a))})}inViewSetup(){document.querySelectorAll(".is-overlay-content").forEach(e=>{e.querySelector("video.is-video-bg")&&e.setAttribute("data-scroll","")}),document.querySelectorAll(".is-container video").forEach(e=>{e.parentNode.setAttribute("data-scroll","")});const s=new di({trigger:{once:!0,offset:{element:{x:0,y:(e,a,r)=>.1},viewport:{x:0,y:(e,a,r)=>e.visible?0:.1}},toggle:{class:{in:"is-inview",out:[""]},callback:{in:e=>{e.element.querySelectorAll("video").forEach(r=>{if(r.innerHTML.trim()==="")return;let n=r.parentNode.querySelector(".video-bg-play");r.autoplay?n?n.innerHTML.indexOf("play")===-1&&r.play():r.play():n&&n.innerHTML.indexOf("play")===-1&&r.play()})},out:e=>{e.element.querySelectorAll("video").forEach(r=>{!r.paused&&!r.closest("[data-html]")&&r.pause()})}}}}});s.add("[data-scroll-once]"),s.add("[data-scroll]",{once:!1}),window.trigger=s}contentBoxOnRenderUpdate(){try{if(window.contentbox||parent.contentbox){let t;window.contentbox?t=window.contentbox.onRender:parent.contentbox&&(t=parent.contentbox.onRender);const i=()=>{t.call(this);try{window.trigger&&window.trigger.kill()}catch{}let s=document.querySelectorAll(".is-animated,.is-scale-animated");s.forEach(function(e){e.classList.contains("once")?(e.removeAttribute("data-scroll",""),e.setAttribute("data-scroll-once","")):(e.removeAttribute("data-scroll-once",""),e.setAttribute("data-scroll",""))}),s=document.querySelectorAll(".is-container > div"),s.forEach(function(e){let a=e.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),r=0;a.length>1&&a.forEach(function(n){n.className.indexOf("delay-")===-1&&(r>0&&(n.style.transitionDelay=r+"s",n.style.animationDelay=r+"s"),r=r+.2)})}),setTimeout(()=>{this.inViewSetup()},100)};window.contentbox?window.contentbox.onRender=i:parent.contentbox&&(parent.contentbox.onRender=i)}}catch{}}functionLightboxInit(){const t={touchNavigation:!0,selector:".glightbox",loop:!0,autoplayVideos:!0,zoomable:!0,slideEffect:"slide",descPosition:"bottom",skin:this.settings.skin};this.refreshLightbox(t),document.querySelectorAll(".is-lightbox,.block-click").forEach(s=>{const e=a=>{let r=s.getAttribute("href")||s.getAttribute("data-modal-url");this.openLightbox(r,s,t),a.preventDefault(),a.stopImmediatePropagation()};s.addEventListener("click",e),s._lightboxHandler=e})}refreshLightbox(t){this.glightbox&&this.glightbox.destroy(),this.glightbox=new Ue(t),window.GLightbox=Ue.default}openLightbox(t,i,s){let e=[],a=0;if(i){const n=i.closest("[data-gallery]");let h=[];n?h=n.querySelectorAll(".is-lightbox"):document.querySelectorAll(".is-lightbox,.block-click").forEach(g=>{g.closest("[data-gallery]")||h.push(g)}),h.forEach((d,g)=>{let p=d.getAttribute("href");p||(p=d.getAttribute("data-modal-url")),e.push({href:p}),t===p&&(a=g)})}const r=document.activeElement;r?.blur(),e.length>0?(this.glightbox.setElements(e),this.glightbox.openAt(a)):(this.glightbox.setElements([{href:t}]),this.glightbox.open()),this.glightbox.on("close",()=>{this.refreshLightbox(s),r?.focus()})}blockInit(){const t={start:()=>{document.querySelectorAll(".is-block").forEach(e=>{e.hasAttribute("data--t")||e.setAttribute("data--t",e.style.top),e.hasAttribute("data--l")||e.setAttribute("data--l",e.style.left),e.hasAttribute("data--b")||e.setAttribute("data--b",e.style.bottom),e.hasAttribute("data--r")||e.setAttribute("data--r",e.style.right),e.hasAttribute("data--w")||e.setAttribute("data--w",e.style.width),e.hasAttribute("data--h")||e.setAttribute("data--h",e.style.height),e.removeAttribute("data-prev"),e.removeAttribute("data-fluid"),e.removeAttribute("data-fluid-val"),e.classList.remove("fluid"),e.style.transition=""})},apply:(e,a,r)=>{if(a&&e.getAttribute("data-prev")!==a+""){if(r||(e.style.transition="all 0.35s ease"),a!==1e4){if(e.setAttribute("data-breakpoint",a),e.hasAttribute("data--t-"+a)){let n=e.getAttribute("data--t-"+a);e.style.top=n}if(e.hasAttribute("data--l-"+a)){let n=e.getAttribute("data--l-"+a);e.style.left=n}if(e.hasAttribute("data--b-"+a)){let n=e.getAttribute("data--b-"+a);e.style.bottom=n}if(e.hasAttribute("data--r-"+a)){let n=e.getAttribute("data--r-"+a);e.style.right=n}if(e.hasAttribute("data--w-"+a)){let n=e.getAttribute("data--w-"+a);e.style.width=n}if(e.hasAttribute("data--h-"+a)){let n=e.getAttribute("data--h-"+a);e.style.height=n}if(e.hasAttribute("data--transform-"+a)){let n=e.getAttribute("data--transform-"+a);e.style.transform=n,e.setAttribute("data--transform-val",a)}}else{if(e.removeAttribute("data-breakpoint"),e.hasAttribute("data--t")){let n=e.getAttribute("data--t");e.style.top=n}if(e.hasAttribute("data--l")){let n=e.getAttribute("data--l");e.style.left=n}if(e.hasAttribute("data--b")){let n=e.getAttribute("data--b");e.style.bottom=n}if(e.hasAttribute("data--r")){let n=e.getAttribute("data--r");e.style.right=n}if(e.hasAttribute("data--w")){let n=e.getAttribute("data--w");e.style.width=n}if(e.hasAttribute("data--h")){let n=e.getAttribute("data--h");e.style.height=n}if(e.hasAttribute("data--transform")){let n=e.getAttribute("data--transform");e.style.transform=n,e.setAttribute("data--transform-val","")}}e.setAttribute("data-prev",a),setTimeout(()=>{r||(e.style.transition="")},400)}},applyFluid:(e,a)=>{e.classList.toggle("fluid",a==="yes"),e.setAttribute("data-fluid",a)},resize:e=>{const a=window.innerWidth;document.querySelectorAll(".is-box").forEach(r=>{let n=[];const h=r.attributes;for(let d=0;d<h.length;d++){let p=h[d].name.match(/^data--h-(\d+)$/);if(p){const b=parseInt(p[1],10);n.push(b)}}n=[...new Set(n)],n.sort((d,g)=>g-d);for(let d=0;d<n.length;d++){const g=n[d];if(d===0){if(a>g){let p=r.getAttribute("data--h");p?r.style.height=p:r.style.height=""}}else{const p=n[d-1];if(p>=a&&a>g){let b=r.getAttribute("data--h-"+p);b&&(r.style.height=b)}}}if(n.length>0&&n[n.length-1]>=a){const g=n[n.length-1];let p=r.getAttribute("data--h-"+g);p&&(r.style.height=p)}}),document.querySelectorAll(".is-block").forEach(r=>{if(!r.classList.contains("locked")){r.offsetWidth+0>a&&!r.classList.contains("fluid")&&(r.setAttribute("data-fluid-val",r.offsetWidth),t.applyFluid(r,"yes"));let d=r.getAttribute("data-fluid-val");d&&parseInt(d)+0<=a&&r.classList.contains("fluid")&&t.applyFluid(r,"no")}let n=[];const h=r.attributes;for(let d=0;d<h.length;d++){const g=h[d].name;let p=g.match(/^data--t-(\d+)$/);if(p){const b=parseInt(p[1],10);n.push(b)}if(p=g.match(/^data--w-(\d+)$/),p){const b=parseInt(p[1],10);n.push(b)}if(p=g.match(/^data--transform-(\d+)$/),p){const b=parseInt(p[1],10);n.push(b)}}n=[...new Set(n)],n.sort((d,g)=>g-d);for(let d=0;d<n.length;d++){const g=n[d];if(d===0)a>g&&t.apply(r,1e4,e);else{const p=n[d-1];p>=a&&a>g&&t.apply(r,p,e)}}if(n.length>0){const d=n[n.length-1];d>=a&&t.apply(r,d,e)}})},render:()=>{t.start(),t.resize(!0)}},s=((e,a)=>{let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>e(...n),a)}})(()=>{t.resize()},0);window.addEventListener("resize",s),t.start(),t.resize(!0),this.Block=t}pageReRender(){this.prepareContent(),this.contentBoxOnRenderUpdate(),window.skrollrr?window.skrollrr.refresh():this.initeSkrollrr(),this.functionLightboxInit(),this.inViewSetup(),this.Block.start(),this.Block.resize()}destroy(){this.glightbox&&(this.glightbox.destroy(),this.glightbox=null),document.querySelectorAll(".is-lightbox,.block-click").forEach(i=>{i._lightboxHandler&&(i.removeEventListener("click",i._lightboxHandler),delete i._lightboxHandler)})}}return Ii})();
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@innovastudio/contentbox-runtime-base",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"description": "Runtime libraries (base) for ContentBox generated content",
|
|
6
6
|
"main": "dist/contentbox-runtime-base.esm.js",
|
|
7
7
|
"module": "dist/contentbox-runtime-base.esm.js",
|