1if(!customElements.get("slide-show")){class SlideShow extends HTMLElement{constructor(){super();const slideshow=this,unveilCarouselImages=flkty2=>{typeof lazySizes>"u"||(lazySizes.loader.checkElems(),flkty2.cells.forEach(cell=>{cell.element.querySelectorAll("img.lazyload").forEach(img=>{lazySizes.loader.unveil(img)})}))};let dots=slideshow.dataset.dots==="true",slideshow_slides=Array.from(slideshow.querySelectorAll(".carousel__slide")),autoplay=slideshow.dataset.autoplay=="false"?!1:parseInt(slideshow.dataset.autoplay,10),align=slideshow.dataset.align=="center"?"center":"left",fade=slideshow.dataset.fade=="true",prev_button=slideshow.querySelector(".flickity-prev"),next_button=slideshow.querySelector(".flickity-next"),custom_dots=slideshow.querySelector(".flickity-page-dots"),progress_bar=slideshow.parentNode.querySelector(".flickity-progress--bar"),animations=[],rightToLeft=document.dir==="rtl",animations_enabled=document.body.classList.contains("animations-true")&&typeof gsap<"u",selectedIndex=0,args={wrapAround:!0,cellAlign:align,pageDots:!1,contain:!0,fade,autoPlay:autoplay,rightToLeft,prevNextButtons:!1,cellSelector:".carousel__slide",on:{}};if(window.A11y&&window.A11y.prefersReducedMotion&&window.A11y.prefersReducedMotion()&&(autoplay=!1,args.autoPlay=!1),slideshow_slides.length<1)return;if(slideshow.classList.contains("image-with-text-slideshow__image")){let main_slideshow=slideshow.parentNode.querySelector(".image-with-text-slideshow__content"),image_slideshow_slides=slideshow.querySelectorAll(".image-with-text-slideshow__image-media");args.draggable=!1,args.asNavFor=main_slideshow,image_slideshow_slides.length&&image_slideshow_slides[0].classList.contains("desktop-height-auto")&&(args.adaptiveHeight=!0)}if(slideshow.classList.contains("customer-reviews__image")){let main_slideshow=slideshow.parentNode.querySelector(".customer-reviews__content");args.draggable=!1,args.asNavFor=main_slideshow}(slideshow.classList.contains("image-with-text-slideshow__content")||slideshow.classList.contains("testimonials__carousel")||slideshow.classList.contains("customer-reviews__content")||slideshow.classList.contains("customer-reviews__image"))&&(args.adaptiveHeight=!0),slideshow.classList.contains("custom-dots")&&(animations_enabled&&slideshow.classList.contains("main-slideshow")&&!Shopify.designMode&&this.prepareAnimations(slideshow,animations),args.pauseAutoPlayOnHover=!1,args.on={staticClick:function(){this.unpausePlayer()},ready:function(){let flkty2=this;if(animations_enabled&&slideshow.classList.contains("main-slideshow")&&!Shopify.designMode&&(slideshow.animateSlides(0,animations),gsap.set(slideshow.querySelectorAll(".subheading,.split-text,.button"),{visibility:"visible"})),dots&&custom_dots){let dots2=custom_dots.querySelectorAll("li");dots2.forEach((dot,i)=>{dot.addEventListener("click",e=>{flkty2.select(i)})}),dots2[this.selectedIndex].classList.add("is-selected")}document.fonts.ready.then(function(){flkty2.resize()}),unveilCarouselImages(flkty2),slideshow.querySelectorAll(".slideshow__slide-adapt-to-image img").forEach(img=>{const resizeAfterImage=()=>flkty2.resize();img.addEventListener("lazyloaded",resizeAfterImage),img.complete&&img.naturalHeight&&resizeAfterImage()});let video_container=flkty2.cells[0].element.querySelector(".slideshow__slide-video-bg");video_container&&(video_container.querySelector("iframe")?video_container.querySelector("iframe").onload=function(){slideshow.videoPlay(video_container)}:video_container.querySelector("video")&&(video_container.querySelector("video").onloadstart=function(){slideshow.videoPlay(video_container)}))},change:function(index){let previousIndex=fizzyUIUtils.modulo(this.selectedIndex-1,this.slides.length);if(animations_enabled&&slideshow.classList.contains("main-slideshow")&&!Shopify.designMode&&(setTimeout(()=>{slideshow.animateReverse(previousIndex,animations)},300),slideshow.animateSlides(index,animations)),dots&&custom_dots){let dots2=custom_dots.querySelectorAll("li");dots2.forEach((dot,i)=>{dot.classList.remove("is-selected")}),dots2[this.selectedIndex].classList.add("is-selected")}slideshow.classList.contains("main-slideshow")||unveilCarouselImages(this),autoplay&&(this.stopPlayer(),this.playPlayer());let video_container_prev=flkty.cells[previousIndex].element.querySelector(".slideshow__slide-video-bg");video_container_prev&&slideshow.videoPause(video_container_prev);let video_container=flkty.cells[index].element.querySelector(".slideshow__slide-video-bg");video_container&&(video_container.querySelector("iframe")?video_container.querySelector("iframe").classList.contains("lazyload")?(video_container.querySelector("iframe").addEventListener("lazybeforeunveil",slideshow.videoPlay(video_container)),lazySizes.loader.checkElems()):slideshow.videoPlay(video_container):video_container.querySelector("video")&&slideshow.videoPlay(video_container))}}),slideshow.classList.contains("main-slideshow")&&!fade&&(slideshow.classList.contains("desktop-height-image")||slideshow.classList.contains("mobile-height-image"))&&(args.adaptiveHeight=!0),fade&&slideshow.classList.contains("main-slideshow")&&slideshow.classList.contains("transition--fade")&&slideshow_slides.length>1&&(args.wrapAround=!1),slideshow.classList.contains("products")&&(args.wrapAround=!1,args.on.ready=function(){var flickity=this;next_button&&window.addEventListener("resize",function(){slideshow.centerArrows(flickity,prev_button,next_button)}),window.dispatchEvent(new Event("resize"))}),progress_bar&&(args.wrapAround=!1,args.on.scroll=function(progress){progress=Math.max(0,Math.min(1,progress)),progress_bar.style.width=progress*100+"%"});const flkty=new Flickity(slideshow,args);if(selectedIndex=flkty.selectedIndex,fade&&slideshow.classList.contains("main-slideshow")&&slideshow.classList.contains("transition--fade")){const syncFadeSlideVisibility=(activeIndex,includePrevious)=>{const previousIndex=includePrevious?fizzyUIUtils.modulo(activeIndex-1,flkty.cells.length):-1;
1flkty.cells.forEach((cell,i)=>{cell.element.style.visibility=i===activeIndex||i===previousIndex?"visible":"hidden"})},lockSlideshowHeight=()=>{if(!slideshow.classList.contains("desktop-height-image")&&!slideshow.classList.contains("mobile-height-image"))return;let maxHeight=0;flkty.cells.forEach(cell=>{maxHeight=Math.max(maxHeight,cell.element.offsetHeight)}),maxHeight>0&&(flkty.viewport.style.height=maxHeight+"px")};flkty.on("change",index=>{syncFadeSlideVisibility(index,!0),unveilCarouselImages(flkty)}),flkty.on("settle",index=>{syncFadeSlideVisibility(index,!1),lockSlideshowHeight()}),syncFadeSlideVisibility(flkty.selectedIndex,!1),document.fonts.ready.then(lockSlideshowHeight),slideshow.querySelectorAll(".slideshow__slide-adapt-to-image img, .slideshow__slide-bg img").forEach(img=>{img.complete||img.addEventListener("load",lockSlideshowHeight,{once:!0})})}slideshow.dataset.initiated=!0;var slideLabelTpl=slideshow.dataset.slideLabelTpl||"Slide %n% of %m%",totalSlides=0;try{if(slideshow.setAttribute("role","region"),slideshow.setAttribute("aria-roledescription","carousel"),!slideshow.hasAttribute("aria-label")){var ariaLabelKey=slideshow.dataset.ariaLabel||"Carousel";slideshow.setAttribute("aria-label",ariaLabelKey)}totalSlides=flkty.cells.length,flkty.cells.forEach(function(cell,i){cell.element.setAttribute("role","group"),cell.element.setAttribute("aria-roledescription","slide"),cell.element.setAttribute("aria-label",slideLabelTpl.replace("%n%",i+1).replace("%m%",totalSlides))})}catch{}try{flkty.on("change",function(index){window.A11y&&typeof window.A11y.announce=="function"&&window.A11y.announce(slideLabelTpl.replace("%n%",index+1).replace("%m%",totalSlides),{politeness:"polite"})})}catch{}if(autoplay){var ppBtn=document.createElement("button");ppBtn.type="button",ppBtn.className="slideshow-pause-toggle",ppBtn.setAttribute("aria-pressed","false"),ppBtn.dataset.pauseLabel=slideshow.dataset.pauseLabel||"Pause slideshow",ppBtn.dataset.playLabel=slideshow.dataset.playLabel||"Play slideshow",ppBtn.setAttribute("aria-label",ppBtn.dataset.pauseLabel),ppBtn.innerHTML='<span class="visually-hidden">'+ppBtn.dataset.pauseLabel+'</span><span aria-hidden="true" class="slideshow-pause-toggle__icon"></span>',ppBtn.addEventListener("click",function(){var paused=ppBtn.getAttribute("aria-pressed")==="true";paused?(flkty.playPlayer(),ppBtn.setAttribute("aria-pressed","false"),ppBtn.setAttribute("aria-label",ppBtn.dataset.pauseLabel),ppBtn.querySelector(".visually-hidden").textContent=ppBtn.dataset.pauseLabel):(flkty.pausePlayer(),ppBtn.setAttribute("aria-pressed","true"),ppBtn.setAttribute("aria-label",ppBtn.dataset.playLabel),ppBtn.querySelector(".visually-hidden").textContent=ppBtn.dataset.playLabel)}),slideshow.appendChild(ppBtn)}if(prev_button){const loopWrap=!args.wrapAround;prev_button.addEventListener("click",()=>{flkty.previous(loopWrap)}),next_button.addEventListener("click",()=>{flkty.next(loopWrap)})}if(Shopify.designMode){const resetSlideshowEditorText=()=>{typeof gsap<"u"&&gsap.set(slideshow.querySelectorAll(".subheading, .split-text, .button, .slideshow__slide-split-heading, h1 .line-child div, p.split-text .line-child div"),{visibility:"visible",opacity:1,clearProps:"transform"})};let resizeEditorTimer;const resizeSlideshowEditor=()=>{resetSlideshowEditorText(),clearTimeout(resizeEditorTimer),resizeEditorTimer=setTimeout(()=>{document.fonts.ready.then(()=>{flkty.resize()})},50)};slideshow.addEventListener("shopify:block:select",event=>{let index=slideshow_slides.indexOf(event.target);flkty.select(index),resizeSlideshowEditor()}),document.addEventListener("shopify:section:load",event=>{event.target.contains(slideshow)&&resizeSlideshowEditor()}),document.addEventListener("shopify:section:select",event=>{event.target.contains(slideshow)&&resizeSlideshowEditor()}),window.addEventListener("resize",resizeSlideshowEditor),resizeSlideshowEditor()}}videoPause(video_container){setTimeout(()=>{video_container.dataset.provider==="hosted"?video_container.querySelector("video").pause():video_container.dataset.provider==="youtube"?video_container.querySelector("iframe").contentWindow.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:""}),"*"):video_container.dataset.provider==="vimeo"&&video_container.querySelector("iframe").contentWindow.postMessage(JSON.stringify({method:"pause"}),"*")},10)}videoPlay(video_container){setTimeout(()=>{video_container.dataset.provider==="hosted"?video_container.querySelector("video").play():video_container.dataset.provider==="youtube"?video_container.querySelector("iframe").contentWindow.postMessage(JSON.stringify({event:"command",func:"playVideo",args:""}),"*"):video_container.dataset.provider==="vimeo"&&video_container.querySelector("iframe").contentWindow.postMessage(JSON.stringify({method:"play"}),"*")},10)}prepareAnimations(slideshow,animations){slideshow.dataset.animationsReady||(new SplitText(slideshow.querySelectorAll("h1, p:not(.subheading)"),{type:"lines, words",linesClass:"line-child"}),slideshow.querySelectorAll(".slideshow__slide").forEach((item,i)=>{let tl=gsap.timeline({paused:!0}),button_offset=0;if(animations[i]=tl,slideshow.dataset.transition=="swipe"&&(tl.to(item,{duration:item.classList.contains("is-initial-selected")?.2:.7,clipPath:"pol
1ygon(100% 0, 0 0, 0 100%, 100% 100%)"},"start"),tl.to(item.querySelector(".slideshow__slide-bg"),{duration:1.5,scale:1},"start")),item.querySelector(".subheading")&&(tl.to(item.querySelector(".subheading"),{duration:.5,autoAlpha:1},0),button_offset+=.5),item.querySelector("h1")){let h1_duration=.5+(item.querySelectorAll("h1 .line-child div").length-1)*.05;tl.from(item.querySelectorAll("h1 .line-child div"),{duration:h1_duration,yPercent:"100",stagger:.05},0),button_offset+=h1_duration}if(item.querySelector("p:not(.subheading)")){let p_duration=.5+(item.querySelectorAll("p:not(.subheading) .line-child div").length-1)*.02;tl.from(item.querySelectorAll("p:not(.subheading) .line-child div"),{duration:p_duration,yPercent:"100",stagger:.02},0),button_offset+=p_duration}item.querySelectorAll(".button")&&tl.fromTo(item.querySelectorAll(".button"),{y:"100%"},{duration:.5,y:"0%",stagger:.1},button_offset*.2),item.dataset.timeline=tl}),slideshow.dataset.animationsReady=!0)}animateSlides(i,animations){document.fonts.ready.then(function(){animations[i].timeScale(1).restart()})}animateReverse(i,animations){animations[i].timeScale(3).reverse()}centerArrows(flickity,prev_button,next_button){let first_cell=flickity.cells[0],max_height=0,image_height=first_cell.element.querySelector(".product-featured-image").clientHeight;if(flickity.cells.forEach((item,i)=>{item.size.height>max_height&&(max_height=item.size.height)}),max_height>image_height){let difference=(max_height-image_height)/-2;prev_button.style.transform="translateY("+difference+"px)",next_button.style.transform="translateY("+difference+"px)"}}}customElements.define("slide-show",SlideShow)} 2//# sourceMappingURL=/cdn/shop/t/40/assets/slideshow.js.map?v=39041197424429704741782848116
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.