1class StickyBuyButton extends HTMLElement{constructor(){super(),this.activeClass="wt-product__sticky-buy--show"}connectedCallback(){this.initialize()}initialize(){const addToCartModule=document.querySelector(".wt-product__add-to-cart"),btn=this.querySelector("button"),addToCart=this.dataset.addToCart==="",forObserver=document.querySelectorAll(".wt-product__add-to-cart, .wt-footer, .wt-product__name");let intersected=[];btn.addEventListener("click",e=>{addToCart||e.preventDefault(),addToCartModule.scrollIntoView({behavior:"smooth",block:"center"})});const observer=new IntersectionObserver(entries=>{entries.forEach(({isIntersecting,target})=>{isIntersecting?intersected.push(target):intersected=intersected.filter(item=>item!==target)}),intersected.length?this.classList.remove(this.activeClass):this.classList.add(this.activeClass)});forObserver.forEach(item=>{observer.observe(item)})}}customElements.define("sticky-buy-button",StickyBuyButton),customElements.get("gallery-fashion")||customElements.define("gallery-fashion",class extends HTMLElement{constructor(){super(),this.section=this.closest("section"),this.logoBanner=this}connectedCallback(){this.init()}disconnectedCallback(){this.removeEventsWhenDesignMode()}addEventsWhenDesignMode(){Shopify.designMode&&(document.addEventListener("shopify:section:load",this.reinitAfterDelay),document.addEventListener("shopify:section:unload",this.reinitAfterDelay))}removeEventsWhenDesignMode(){Shopify.designMode&&(document.removeEventListener("shopify:section:load",this.reinitAfterDelay),document.removeEventListener("shopify:section:unload",this.reinitAfterDelay))}reinitAfterDelay(){setTimeout(()=>this.reinit(),0)}isFirstSection(){const firstSection=document.querySelector("#root").querySelector("section");this.section=this.closest("section");const currentSection=this.section;return firstSection===currentSection}handleResize(){this.setTopMargin(),this.positioningProductInfo()}observeHeader(){const header=document.querySelector(".wt-header"),activeTransparentClass="wt-header--fashion-transparent";new IntersectionObserver(entries=>{entries.forEach(entry=>
1{entry.isIntersecting?header.classList.add(activeTransparentClass):header.classList.remove(activeTransparentClass)})},{root:null,threshold:.05}).observe(this.querySelector(".wt-product__gallery"))}calculateOffset(){const headerHeight=document.querySelector("header").offsetHeight;return this.isTransparentHeaderEnabled()&&this.isFirstSection()?headerHeight:0}setTopMargin(){const offset=this.calculateOffset();offset?this.section.style.marginTop=`-${offset}px`:this.section.style.marginTop=0}isTransparentHeaderEnabled(){const header=document.querySelector(".wt-header");return header.dataset.transparent&&header.classList.contains("wt-header--v3")}renderProgressBar(){const thumbsGallery=this.querySelector("[data-thumbs]"),progressBarElement=document.createElement("div");progressBarElement.classList.add("gallery-fashion__progress-bar");const progressBarIndicatorElement=document.createElement("div");progressBarIndicatorElement.classList.add("gallery-fashion__progress-bar-indicator"),progressBarElement.appendChild(progressBarIndicatorElement),thumbsGallery.appendChild(progressBarElement);function updateProgressBar(){const images=this.querySelector("gallery-section"),progressBar=progressBarIndicatorElement,scrolled=window.scrollY,maxHeight=images.clientHeight-window.innerHeight,scrollPercentage=scrolled/maxHeight*100,progressBarHeight=progressBarElement.clientHeight,progressHeight=progressBar.clientHeight,maxProgressTop=progressBarHeight-progressHeight,progressTop=Math.min(scrollPercentage/100*maxProgressTop,maxProgressTop);progressBar.style.top=`${progressTop}px`,progressTop===maxProgressTop?thumbsGallery.classList.add("finished"):thumbsGallery.classList.remove("finished")}window.addEventListener("scroll",updateProgressBar.bind(this));function handleThumbsClick(event){if(event.target.closest(".thumbs-list-item")){const thumbnails=Array.from(event.currentTarget.querySelectorAll(".wt-product__img")),targetImage=event.target.closest(".thumbs-list-item").querySelector(".wt-product__img"),index=thumbnails.indexOf(targetImage);this.querySelectorAll(".wt-masonry__wrapper .wt-product__img, .wt-masonry__wrapper .wt-product__thumbnail-video")[index].scrollIntoView({behavior:"smooth",block:"start"})}}thumbsGallery.addEventListener("click",handleThumbsClick.bind(this))}positioningProductInfo(){const productInfo=this.querySelector(".wt-product__main"),mediaDesktop=window.matchMedia("(min-width: 1200px)");mediaDesktop.matches&&(productInfo.style.top=`${Math.max((window.innerHeight-productInfo.offsetHeight)/2,0)}px`);const resizeObserver=new ResizeObserver(entries=>{for(let entry of entries)mediaDesktop.matches&&(productInfo.style.top=`${Math.max((window.innerHeight-productInfo.offsetHeight)/2,0)}px`)}),observedElement=productInfo;resizeObserver.observe(observedElement)}attachEvents(){window.addEventListener("resize",this.handleResize.bind(this))}waitForMasonryImages(callback){const masonry=this.querySelector(".swiper-wrapper--masonry");if(!masonry)return;const images=masonry.querySelectorAll("img");if(images.length===0){callback();return}let loaded=0;const checkDone=()=>{loaded++,loaded===images.length&&callback()};images.forEach(img=>{img.complete?checkDone():(img.addEventListener("load",checkDone,{once:!0}),img.addEventListener("error",checkDone,{once:!0}))})}init(){if(this.reinitAfterDelay=this.reinitAfterDelay.bind(this),this.isTransparentHeaderEnabled()){const stickyHeaderThreshold=document.querySelector(".sticky-header__threshold");document.body.classList.contains("page-header-sticky")&&this.waitForMasonryImages(()=>{const masonry=this.querySelector(".swiper-wrapper--masonry");masonry&&(stickyHeaderThreshold.style.height=`${masonry.offsetHeight}px`)}),this.setTopMargin(),this.observeHeader(),this.attachEvents()}this.renderProgressBar(),this.positioningProductInfo(),this.addEventsWhenDesignMode()}reinit(){if(this.isTransparentHeaderEnabled()){const stickyHeaderThreshold=document.querySelector(".sticky-header__threshold");document.body.classList.contains("page-header-sticky")&&(stickyHeaderThreshold.style.height=`${this.querySelector(".swiper-wrapper--masonry").offsetHeight}px`),this.setTopMargin(),this.observeHeader()}this.positioningProductInfo()}}); 2//# sourceMappingURL=/cdn/shop/t/161/assets/pdp.js.map?v=1505174611193691031761565450
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.