1customElements.get("product-card-image-slider")||customElements.whenDefined("carousel-slider").then(()=>{class ProductCardImageSlider extends CarouselSlider{constructor(){super(),this.productCard=this.closest("product-card"),this.productCardSwatches=this.productCard.querySelectorAll(".card__swatches .opt-btn"),this.slides=this.querySelectorAll(".slider__item"),this.productCard.addEventListener("change",this.handleSwatchChange.bind(this))}init(){if(super.init(),this.slider.addEventListener("scroll",this.scrollInProgress.bind(this)),this.productCardSwatches){const activeSlide=this.querySelector(".slider__item[aria-current]"),activeSwatchId=this.productCard.querySelector(".card__swatches .opt-btn:checked")?.dataset.mediaId||activeSlide?.dataset.mediaId;let activeSwatchSlide;activeSwatchId&&this.productCardSwatches.forEach(swatch=>{const swatchSlide=this.querySelector(`[data-media-id="${swatch.dataset.mediaId}"]`);swatchSlide&&(swatchSlide.setAttribute("data-swatch-anchor","true"),swatchSlide.dataset.mediaId===activeSwatchId&&(activeSlide.removeAttribute("aria-current"),swatchSlide.setAttribute("aria-current","true"),activeSwatchSlide=swatchSlide))}),activeSwatchSlide&&this.handleSwatchChange(null,activeSwatchSlide.dataset.mediaId)}else{const activeSlide=this.querySelector(".slider__item[aria-current]");activeSlide?this.handleSwatchChange(null,activeSlide.dataset.mediaId):this.slider.slides[1]?.setAttribute("aria-current","true")}}updateSlideVisibility(mediaId){let hideSlide=!0,foundMediaId=!1;
1this.slides.forEach(slide=>{!foundMediaId&&slide.getAttribute("data-media-id")===mediaId?(hideSlide=!1,foundMediaId=!0):foundMediaId&&slide.hasAttribute("data-swatch-anchor")&&(hideSlide=!0),slide.toggleAttribute("hidden",hideSlide)}),this.setButtonStates()}handleSwatchChange(evt,mediaId){const swatchMediaId=evt?.target.dataset.mediaId||mediaId;if(swatchMediaId){this.updateSlideVisibility(swatchMediaId);const variantMedia=this.querySelector(`[data-media-id="${swatchMediaId}"]`);if(variantMedia){const left=variantMedia.closest(".slider__item").offsetLeft;this.slider.scrollTo({left,behavior:"instant"})}}}setButtonStates(){if(!this.prevBtn&&!this.nextBtn)return;const currentSlideIndex=Math.round(this.slider.scrollLeft/this.slideSpan)+1,visibleSlideCount=this.slides.filter(slide=>slide.hidden!==!0).length;this.prevBtn.disabled=currentSlideIndex===1||this.getSlideVisibility(this.slides[0])&&this.slider.scrollLeft===0,this.nextBtn.disabled=visibleSlideCount===currentSlideIndex||this.getSlideVisibility(this.slides[this.slides.length-1])}scrollInProgress(){this.slider.querySelector("[aria-current]")?.removeAttribute("aria-current")}handleScroll(){super.handleScroll(),this.slides[this.currentIndex].setAttribute("aria-current","true")}}customElements.define("product-card-image-slider",ProductCardImageSlider)}); 2//# sourceMappingURL=/cdn/shop/t/29/assets/product-card-image-slider.js.map?v=154565535323743282431788176887
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.