1(()=>{var jt=Object.defineProperty,s=(d,t)=>jt(d,"name",{value:t,configurable:!0}),ht=window.VelotricBundle;if(!ht?.shell?.ready)throw new Error("vl-bundle-shell.js must execute before vl-bundle-product.js");var p=ht.shell.api;if(!p)throw new Error("Missing shell named API contract");var r=p.$el,g=p.$elParent,l=p.$list,Me=p.appendElementToBody,Ae=p.capitalize,Oe=p.createPortal,Pe=p.createPrefetchLink,ke=p.delay,ut=p.getFocusTargets,Be=p.getTargets,Re=p.isCurrentPageLink,He=p.isExternalLink,De=p.isNotIframe,O=p.isNotThemeStore,Ve=p.isSafari,mt=p.registerComponent,$e=p.removeCustomElementFromBody,_e=p.stripHtml,pt=p.transitionToPromise,Fe=p.upperCamelCaseToSnakeCase,Ne=p.viewportObserver,f=p.whenDefined,gt=window.VelotricBundle;if(!gt?.shell?.ready)throw new Error("vl-bundle-shell.js must execute before vl-bundle-product.js");var ft=gt.shell.api;if(!ft)throw new Error("Missing shell named API contract");var bt=ft.FloatElement,P=class extends bt{static{s(this,"HotspotsFloatElement")}},vt=window.VelotricBundle;if(!vt?.shell?.ready)throw new Error("vl-bundle-shell.js must execute before vl-bundle-product.js");var nt=vt.shell.api;if(!nt)throw new Error("Missing shell named API contract");var u=nt.BaseComponent,qe=nt.ShopifyEditor,qt='[id^="Deferred-Poster-"]',Zt="carousel-component",Yt="[data-media-id]",Wt="data-autoplay",k=class extends u{static{s(this,"DeferredMedia")}carousel;video;mountComponent(){this.carousel=g(Zt,this),this.carousel?.embla.on("settle",this.handleCarouselSettle),this.hasAttribute(Wt)?this.loadContent():this.addListener(this,"click",this.handlePosterClick)}unmountComponent(){this.carousel?.embla.off("settle",this.handleCarouselSettle)}handleCarouselSettle=s(()=>{if(!this.video)return;let e=g(Yt,this).className.includes("is-selected"),i=this.video.hasAttribute("autoplay");e&&i?this.video.play():e||this.video.pause()},"handleCarouselSettle");handlePosterClick=s(t=>{g(qt,t.target)&&this.loadContent()},"handlePosterClick");loadContent(){this.getAttribute("loaded")||(this.addVideo(),this.setAttribute("loaded","true"))}removeVideo(){let t=r("video, iframe",this);t&&(t.remove(),this.removeAttribute("loaded"))}addVideo(){let t=document.createElement("div"),i=r("template",this)?.content;if(!i||!i.firstElementChild)return;let o=i.firstElementChild.cloneNode(!0);t.appendChild(o);let n=r("video, model-viewer, iframe",t);n&&(this.appendChild(n),this.video=n,n.tagName==="VIDEO"&&this.video.play())}},Ct=window.VelotricBundle;if(!Ct?.shell?.ready)throw new Error("vl-bundle-shell.js must execute before vl-bundle-product.js");var E=Ct.shell.api;if(!E)throw new Error("Missing shell named API contract");var Je=E.getStylePropValue,Et=E.getTemplateContent,ti=E.getTemplateFirstChild,ei=E.hideElement,S=E.parseHTML,ii=E.removeStyleVariable,v=E.replaceNodeChildren,si=E.setStyleVariable,oi=E.showElement,ni=E.skipTransition,B=class extends u{static{s(this,"PickupAvailability")}mountComponent(){this.fetchAvailability()}fetchAvailability(){let t=`${this.dataset.baseUrl}variants/${this.dataset.variantId}/?section_id=pickup-availability`;fetch(t).then(e=>e.text()).then(e=>{let i=r(".shopify-section",S(e));this.updateSidebarFromHTML(i),this.updateContentFromHTML(i)}).catch(()=>{console.log("Error in pickup availability component")})}updateVariantId(t){this.dataset.variantId=t}updateContentFromHTML(t){let e=r("pickup-availability-content",this),i=r("pickup-availability-content",t);v(e,i)}updateSidebarFromHTML(t){let e=r("#pickup-availability-sidebar");if(!e)return;let i=r(`[data-sidebar-template="${e.id}"]`,t);i&&e.updateTemplate(i)}},Gt=".shopify-section.shopify-section-footer",Qt="product-form",R=class extends u{static{s(this,"ProductFormButton")}mountComponent(){this.addListener(window,"scroll",this.handleWindowScroll),window.visualViewport&&(window.visualViewport.addEventListener("resize",this.handleResizeVisualViewport),this.handleResizeVisualViewport())}handleWindowScroll=s(()=>{let t=g(Qt,this);if(!t)return;let e=r(Gt),i=t.offsetTop+t.offsetHeight,o=e?e.offsetTop:0,a=window.innerHeight+window.scrollY<o&&window.scrollY>i;this.classList.toggle("is-visible",a),document.body.toggleAttribute("is-product-form-button-fixed",a),document.querySelector(".call-us-container-mb")?.classList.toggle("is-top",a)},"handleWindowScroll");handleResizeVisualViewport=s(()=>
1{if(window.visualViewport){let t=Math.max(0,window.innerHeight-window.visualViewport.height-window.visualViewport.offsetTop);this.style.removeProperty("top"),this.style.bottom=`${t}px`}},"handleResizeVisualViewport")},wt=window.VelotricBundle;if(!wt?.shell?.ready)throw new Error("vl-bundle-shell.js must execute before vl-bundle-product.js");var rt=wt.shell.api;if(!rt)throw new Error("Missing shell named API contract");var fi=rt.checkAnimationReduce,C=rt.isMobile,x="tabs-component",Jt="carousel-component",H=class extends u{static{s(this,"ProductDetails")}isMobile=C();resizeObserver;activeTab;activeTabIndex;nextTargetTab;lastInnerTarget;mountComponent(){let t=r(x,this);this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this),f(x).then(()=>{t?.on("selectTab",this.handleTabSelect)})}unmountComponent(){let t=r(x,this);f(x).then(()=>{t?.off("selectTab",this.handleTabSelect)}),this.resizeObserver.disconnect()}handleTabSelect=s(({tabId:t,tab:e})=>{this.activeTab=e,this.activeTabIndex=+t-1,this.scrollToActiveTab();let i=this.getInnerTargets();i.length>0&&this.setTabContentTargets(i)},"handleTabSelect");handleResize=s(()=>{C()!==this.isMobile&&(this.isMobile=C()),C()&&this.scrollToActiveTab()},"handleResize");scrollToActiveTab=s(()=>{r(Jt,this)?.embla.scrollTo(this.activeTabIndex)},"scrollToActiveTab");getInnerTargets=s(()=>l(ut(),this.activeTab),"getInnerTargets");setTabContentTargets=s(t=>{let i=r(x,this).getNames().filter(o=>o.offsetWidth>0);this.nextTargetTab=i[this.activeTabIndex+1]??null,this.lastInnerTarget=t[t.length-1],this.addListener(this.lastInnerTarget,"blur",this.handleLastTargetBlur),t[0].focus()},"setTabContentTargets");handleLastTargetBlur=s(()=>{this.nextTargetTab.focus(),this.removeListener(this.lastInnerTarget,"blur",this.handleLastTargetBlur),this.lastInnerTarget=null,this.nextTargetTab=null},"handleLastTargetBlur")},te="[data-product-block-container]",D=class extends u{static{s(this,"ProductBlock")}updateByVariantId(t){let e=r(te,this),i=Et(r(`[data-product-block-template="${t}"]`,this));v(e,i)}},{Shopify:V}=window,ee='[id^="Deferred-Poster-"]',$=class extends u{static{s(this,"ProductModel")}modelViewerUI;mountComponent(){let t=r(ee,this);this.addListener(t,"click",this.handlePosterClick),this.carousel?.embla.on("select",this.handleCarouselSelect)}unmountComponent(){this.carousel?.embla.off("select",this.handleCarouselSelect)}handlePosterClick=s(()=>{this.loadContent()},"handlePosterClick");handleCarouselSelect=s(()=>{this.carousel&&this.setCarouselDraggable(!0)},"handleCarouselSelect");loadContent(){this.getAttribute("loaded")||(this.addModel(),this.setAttribute("loaded","true"),this.carousel&&this.setCarouselDraggable(!1)),V.loadFeatures([{name:"model-viewer-ui",version:"1.0",onLoad:this.setupModelViewerUI.bind(this)}],()=>{})}addModel(){let t=r("template",this);if(!t||!t.content)return;let e=t.content,i=document.createElement("div");i.appendChild(e.firstElementChild.cloneNode(!0));let o=r("model-viewer",i);this.appendChild(o)}setupModelViewerUI(t){t||(this.modelViewerUI=new V.ModelViewerUI(r("model-viewer",this)))}setCarouselDraggable(t){let e=r(".shopify-model-viewer-ui",this);this.carousel.dataset.draggable=t?"true":"false",this.carousel.reInit(),t&&e&&(e.remove(),this.removeAttribute("loaded"))}get carousel(){return g("carousel-component",this)}};window.ProductModel={loadShopifyXR(){V.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:this.setupShopifyXR.bind(this)}],()=>{})},setupShopifyXR(d){if(!d){if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",()=>this.setupShopifyXR());return}l('[id^="ProductJSON-"]').forEach(t=>{window.ShopifyXR.addModels(JSON.parse(t.textContent)),t.remove()}),window.ShopifyXR.setupXRElements()}}},window.addEventListener("DOMContentLoaded",()=>{V.designMode&&l("[data-shopify-xr-hidden]").forEach(d=>d.classList.add("hidden")),window.ProductModel&&window.ProductModel.loadShopifyXR()});var _=class extends u{static{s(this,"ProductContent")}variantPickerSelector;containerAttribute;visibleClass;mobileClass;variantPicker;variant;desktopContent;mobileContent;desktopContainers;mobileContainers;carousels;dots;modal;initialImagesQuantity;currentImagesQuantity;modalQuantityElement;isMobile;carouselImages;dotsImages;gridImages;modalImages;desktopImages;mobileImages;currentContainers;currentImages;currentDots;resizeObserver;constructor(){super(),this.variantPickerSelector="variant-picker",this.containerAttribute="data-container",this.visibleClass="product__image-visible",this.isMobile=C(),this.initialImagesQuantity=null,this.currentImagesQuantity=null,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this)}connectedCallback(){this.querySelector("[data-pdp-media-variant]")?(this.mediaExperimentEventHandler=this.handleMediaVariantChange,document.addEventListener("vl-abtest:change",this.mediaExperimentEventHandler),window.VLAbTest?.getGroup?.()?this.init():this.waitingForMediaGroup=!0):this.init()}disconnectedCallback(){this.variantPicker?.off("change",this.handleVariantChange),this.mediaExperimentEventHandler&&document.removeEventListener("vl-abtest:change",this.mediaExperimentEventHandler)}init=s(()=>{this.initializing||(this.initializing=!0,this.waitingForMediaGroup=!1,this.setMediaScope(),Promise.all([f("product-modal"),f("variant-picker")]).then(()=>{this.initializeMediaScope()}).catch(t=>{this.initializing=!1,console.log(t)}))},"init");setMediaScope=s(()=>
1{let t=this.getMediaVariant(),e=this.querySelector(`[data-pdp-media-variant="${t}"]`)??this;this.variantPicker=this.querySelector(this.variantPickerSelector),this.desktopContent=e.querySelector("[data-product-desktop-media]"),this.mobileContent=e.querySelector("[data-product-mobile-media]"),this.desktopContainers=[...this.desktopContent.querySelectorAll(`[${this.containerAttribute}]`)],this.mobileContainers=[...this.mobileContent.querySelectorAll(`[${this.containerAttribute}]`)],this.dots=[...e.querySelectorAll("carousel-dots")],this.carousels=[...e.querySelectorAll("carousel-component, carousel-dots")],this.modal=e.querySelector("product-modal")??this.parentElement.querySelector("product-modal"),this.activeMediaVariant=t},"setMediaScope");getMediaVariant=s(()=>window.VLAbTest?.getGroup?.()==="b"?"b":"a","getMediaVariant");initializeMediaScope=s(()=>{if(this.modal?.element){let t2=this.modal.element.querySelector(`[${this.containerAttribute}]`);t2&&(this.mobileContainers.push(t2),this.desktopContainers.push(t2)),this.modalQuantityElement=this.modal.element.querySelector("[data-product-modal-slides-total]")}this.desktopImages=this.assignImages(this.desktopContainers),this.mobileImages=this.assignImages(this.mobileContainers),this.setCurrentContainers(),this.setInitialImagesLength(),this.handleVariantChange({variant:this.variantPicker.variant}),this.variantPicker.on("change",this.handleVariantChange);let t=this.desktopContent.querySelector(".media-counter-thumb .media-counter-total"),e=this.mobileContent.querySelector(".media-counter-dot .media-counter-total");t&&(t.textContent=String(this.currentImagesQuantity)),e&&(e.textContent=String(this.currentImagesQuantity)),this.mediaScopeInitialized=!0,this.initializing=!1,this.activeMediaVariant!==this.getMediaVariant()?this.handleMediaVariantChange():this.dispatchEvent(new CustomEvent("pdp-media-ready",{bubbles:!0,detail:{experimentVariant:this.activeMediaVariant}}))},"initializeMediaScope");handleMediaVariantChange=s(()=>{if(this.waitingForMediaGroup){this.init();return}this.mediaScopeInitialized&&this.activeMediaVariant!==this.getMediaVariant()&&(this.variantPicker?.off("change",this.handleVariantChange),this.mediaScopeInitialized=!1,this.setMediaScope(),this.initializeMediaScope())},"handleMediaVariantChange");handleVariantChange=s(({variant:t})=>{if(this.currentContainers.forEach(n=>{switch(n.dataset.container){case"carousel":this.replaceCarouselSlides(n);break;case"dots":this.replaceDotsSlides(n);break;case"grid":this.replaceGridSlides(n);break;case"modal":this.replaceModalSlides(n);break;default:break}}),this.reInitCarousels(),this.scrollToVariant(t),document.querySelector("body.nomad-2x-new-pdp")&&t.name.indexOf("Velotric Nomad 2X")!==-1){let n=document.querySelectorAll("[data-show]"),a=t.option2==="Multi-Terrain Camo";document.querySelectorAll(".multicam_bundle").forEach(c=>{c.classList.toggle("hidden",!a)}),document.querySelectorAll(".origin_bundle").forEach(c=>{c.classList.toggle("hidden",a)}),n.forEach(c=>{let h=a?"Multicam":"Other";c.classList.toggle("hidden",c.getAttribute("data-show")!==h)})}this.querySelectorAll(".rider-heights").length>0&&(this.variantPicker.setAttribute("data-style-value",t.option1),document.querySelector(".n2_style")&&(this.variantPicker.setAttribute("data-size-value",t.option2),document.querySelectorAll(".n2_style")[0].textContent=t.option1),document.querySelectorAll(".rider-heights").forEach(n=>{n.classList.toggle("selected",n.getAttribute("data-value")==t.option1||n.getAttribute("data-value")==t.id)})),this.modal&&this.modal.updateModal(),this.variant=t;let i=document.getElementById("preorder-message"),o=i?.textContent?JSON.parse(i.textContent):null;if(o){let n=this.variant.options.join("/"),a=o[n]?.message||"",h=document.querySelector(".pre-order-wrap").querySelector(".pre-order-msg");h.classList.toggle("active",!!a),h.textContent=a}},"handleVariantChange");replaceCarouselSlides=s(t=>{let e=this.getImages(this.currentImages.carouselImages);e[0]&&(e[0].classList.add("is-selected"),e[0].classList.toggle("product-media-carousel-mobile__slide--alone",e.length<2)),this.pasteImages(t,e)},"replaceCarouselSlides");replaceDotsSlides=s(t=>{let e=this.getImages(this.currentImages.dotsImages);e.forEach((i,o)=>{i.setAttribute("data-dot-index",String(o))}),this.pasteImages(t,e)},"replaceDotsSlides");replaceGridSlides=s(t=>{let e=this.getImages(this.currentImages.gridImages);this.pasteImages(t,e)},"replaceGridSlides");replaceModalSlides=s(t=>{if(this.modal){let e=this.getImages(this.currentImages.modalImages);this.pasteImages(t,e),this.modalQuantityElement&&(this.modalQuantityElement.textContent=String(e.length))}},"replaceModalSlides");getImages=s(t=>{let e=t.map(s2=>s2.cloneNode(!0)),o=this.querySelector("[data-pdp-media-variant]")?this.getMediaVariant():null,n=o?e.filter(s2=>s2.dataset.mediaAb==="both"||s2.dataset.mediaAb===o):e,a=n.filter(s2=>{let d=(s2.dataset.variant||"").replace(/\s*\[poi:[^\]]+\]/g,"").replace(/\s*\[media-ab:[^\]]+\]/g,"").trim();return!d.includes("_ads")&&d.includes(String(this.variantPicker.variant.id))});return a.length>0?a:n},"getImages");pasteImages=s((t,e)=>{t.replaceChildren(...e),this.currentImagesQuantity=e.length},"pasteImages");reInitCarousels=s(()=>{this.carousels.length>
10&&this.carousels.forEach(t=>{t.reInit()})},"reInitCarousels");assignImages=s(t=>{let e=[],i=[],o=[],n=[];return t.forEach(a=>{let h=[...a.cloneNode(!0).children];switch(a.dataset.container){case"carousel":e.push(...h),e.forEach((m,b)=>{m.classList.remove("is-selected")});break;case"dots":i.push(...h),i.forEach((m,b)=>{m.classList.remove("is-primary"),m.classList.remove("is-selected"),m.classList.remove("is-in-view"),m.classList.remove("is-snapped"),m.classList.remove("is-prev-prev")});break;case"grid":o.push(...h);break;case"modal":n.push(...h);break;default:break}}),{carouselImages:e,dotsImages:i,gridImages:o,modalImages:n}},"assignImages");scrollToVariant=s(t=>{if(this.currentImagesQuantity===this.initialImagesQuantity&&t.featured_media?this.variantPicker.setFirstMediaByVariant(t):(this.carousels.forEach(e=>{e.embla.scrollTo(0)}),this.variantPicker.setFirstMediaByVariant(0)),this.currentDots){let e=[...this.currentDots.embla.slideNodes()],i=this.currentDots.carousel.embla.selectedScrollSnap();e.forEach(c=>{let h=+c.dataset.dotIndex===i;c.classList.toggle("is-primary",h)});let o=this.currentDots.closest("div[data-product-media-container]")||this,n=o.querySelector(".media-counter-thumb .media-counter-current");if(n){n.textContent=String(i+1);let c=o.querySelector(".media-counter-thumb .media-counter-total");c&&(c.textContent=String(e.length||1))}let a=o.querySelector(".media-counter-dot .media-counter-current");if(a){a.textContent=String(i+1);let c=o.querySelector(".media-counter-dot .media-counter-total");c&&(c.textContent=String(e.length||1))}}},"scrollToVariant");setCurrentContainers=s(()=>{this.currentContainers=this.isMobile?this.mobileContainers:this.desktopContainers,this.currentImages=this.isMobile?this.mobileImages:this.desktopImages,this.currentDots=this.dots.find(t=>t.offsetWidth>0)},"setCurrentContainers");setInitialImagesLength=s(()=>{let t=!!this.currentImages.carouselImages?.length;this.initialImagesQuantity=t?this.currentImages.carouselImages?.length:this.currentImages.gridImages?.length},"setInitialImagesLength");handleResize=s(()=>{this.isMobile!==C()&&(this.isMobile=C(),this.setCurrentContainers())},"handleResize")},ie=s(d=>({behavior:d?"auto":"smooth",block:"nearest"}),"scrollOptions"),F=class extends u{static{s(this,"ProductMedia")}mountComponent(){this.setReady()}updateFirstMediaByVariant(t,e=!1){O()&&t&&t.featured_media&&(r(`[data-media-id="${t.featured_media.id}"]`,this)??this).scrollIntoView(ie(e))}setReady(){this.setAttribute("ready","")}},se="[data-product-media-carousel-component]",N=class extends u{static{s(this,"ProductMediaCarousel")}mountComponent(){this.setReady()}updateFirstMediaByVariant(t,e=!1){let i=r(se,this);if(t&&t.featured_media&&i){let n=i.embla.slideNodes().findIndex(a=>a.dataset.mediaId?+a.dataset.mediaId==+t.featured_media.id:!1);i.embla.scrollTo(n,e)}}setReady(){this.setAttribute("ready","")}},St=window.VelotricBundle;if(!St?.shell?.ready)throw new Error("vl-bundle-shell.js must execute before vl-bundle-product.js");var T=St.shell.api;if(!T)throw new Error("Missing shell named API contract");var z=T.isEnterKey,Tt=T.isEscKey,at=T.isLeftKey,It=T.isRightKey,ji=T.isSpaceKey,lt=T.isTabKey,oe=["sticky-product-buy-btn","product-buy-btn","product-quantity"],ne=["product-price","product-badges","product-sku","product-stock"],re="[data-variant-picker-variants]",X="[data-variant-picker-option-inputs]",yt="[data-variant-picker-option-labels]",ae="[data-dropdown-variant-picker-label]",le=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"],ce="header-component",K=class extends u{static{s(this,"VariantPicker")}variants;variant;constructor(){super(),this.variants=JSON.parse(r(re,this).textContent)}mountComponent(){this.setVariant(),this.setOptionsAvailable(),this.hasAttribute("data-initial-selected-variant")&&this.setFirstMedia(!0),this.setListeners()}handleVariantChange=s(t=>{this.setVariant();let e=t.target.dataset.productUrl;if(e&&this.dataset.url!==e){this.swapProduct(e);return}this.setOptionsAvailable(),this.updateLabels(),this.updateStock(),this.variant&&(this.updatePickupAvailability(),this.updateURL(),this.updateV
1ariantInput(),this.updateSection(),this.hasAttribute("data-product-media-filtering-option")||this.setFirstMedia(!1),this.emit("change",{variant:this.variant,option:{name:t.target.name,value:t.target.value}}))},"handleVariantChange");toggleHeaderDynamicShow=s(t=>{r(ce).toggleLockDynamicShow(t)},"toggleHeaderDynamicShow");swapProduct(t){let e=this.closest(".shopify-section"),i=this.closest("quick-view"),n=l(X,this).map(c=>this.getCheckedInput(l("input",c)).dataset.valueId),a=this.variant?`variant=${this.variant?.id}`:`option_values=${n.join(",")}`;fetch(`${t}?section_id=${this.dataset.sectionIdWithoutPrefix}&${a}`).then(c=>c.text()).then(c=>{let h=new DOMParser().parseFromString(c,"text/html");if(e){let m=h.getElementById(`shopify-section-${this.dataset.sectionIdWithoutPrefix}`);e.innerHTML=m.innerHTML}else i&&i.setProductFromHTML(h)}),window.history.replaceState({},"",`${t}`)}updateLabels(){let t=l(X,this),e=l(yt,this);t.forEach((i,o)=>{let n=l("label",e[o]),a=l("input",i),c=this.getCheckedInput(a),h=r(ae,e[o]);h&&h.toggleAttribute("no-available",!this.variant?.available),n.forEach(m=>{let b=m.getAttribute("for")===c.id;if(h&&b){let I=g("dropdown-opener",h);v(h,m),I.trigger()}m.classList.toggle("selected",b)})})}updateURL(){!this.variant||this.dataset.updateUrl==="false"||window.history.replaceState({},"",`${this.dataset.url}?variant=${this.variant.id}`)}updateStock(){r(`#product-stock-inner-${this.dataset.productId}-${this.dataset.section}`)?.classList.toggle("hidden",!this.variant)}setVariant(){let e=l(X,this).map(i=>this.getCheckedInput(l("input",i)).value);this.variant=this.variants.find(({options:i})=>i.every((o,n)=>e[n]===o)),this.variant||f("product-form").then(()=>{this.setUnavailable()})}setUnavailable(){this.getForm()?.setDisable(!0),this.getForm()?.setButtonText(window.auroraThemeLocales.variantStrings.unavailable)}setListeners(){let e=l("float-element",this).map(n=>l("label",n.element)).flat(1),i=l("label",this),o=[...e,...i];this.addListener(this,"keydown",this.handleKeydown),o.forEach(n=>{this.addListener(n,"keydown",this.handleLabelKeydown)}),this.addListener(this,"change",this.handleVariantChange)}handleLabelKeydown=s(t=>{if(z(t)){t.preventDefault();let e=t.target,i=r(`input[id="${e.getAttribute("for")}"]`,this);i&&i.dispatchEvent(new MouseEvent("click",{button:0,which:1}))}},"handleLabelKeydown");handleKeydown=s(t=>{if(!le.includes(t.key)&&!lt(t))return;let i=t.target,o=g(yt,i);if(!o){this.removeListener(document,"keydown",this.handleLabelKeydown);return}let n=l("label",o),a=n.findIndex(A=>A===t.target),c=n[a],h=n[0],m=n[n.length-1],b=n[a+1],I=n[a-1],M=s(A=>{c?.removeAttribute("tabindex"),A.setAttribute("tabindex",0),A.focus(),t.preventDefault()},"setActiveLabel"),y=s(()=>{M(b||h)},"changeActiveLabelOnNext"),L=s(()=>{M(I||m)},"changeActiveLabelOnPrev"),Ut={ArrowLeft:L,ArrowRight:y,ArrowUp:L,ArrowDown:y}[t.key];lt(t)?I&&t.shiftKey?L():b&&!t.shiftKey&&y():Ut()},"handleKeydown");getVariantsByOption(t){let e=this.variants.filter(i=>i.available).map(i=>i.options);return t?e.filter(i=>t.every(o=>i.includes(o.value))):e}async getDropdownElementBySelector(t){let e=l("float-element",this),i;return await f("float-element").then(()=>{i=r(t,e.find(o=>r(t,o.element)).element)}),i}async setOptions(t,e){for(let i of t){let o=e.some(c=>c.includes(i.value)),n=`label[for="${i.id}"]`;(r(n,this)||await this.getDropdownElementBySelector(n)).toggleAttribute("no-available",!o)}}setOptionsAvailable(){let t=l(X,this),e=t[0]&&l("input",t[0]),i=this.getCheckedInput(e);this.setOptions(e,this.getVariantsByOption([]));let o=t[1]&&l("input",t[1]);if(o){let n=this.getCheckedInput(o);this.setOptions(o,this.getVariantsByOption([i]));let a=t[2]&&l("input",t[2]);a&&this.setOptions(a,this.getVariantsByOption([i,n]))}}setFirstMedia(t){l(`#product-media-${this.dataset.productId}-${this.dataset.section}`).forEach(i=>i.updateFirstMediaByVariant(this.variant,t))}setFirstMediaByVariant(t){l(`#product-media-${this.dataset.productId}-${this.dataset.section}`).forEach(i=>i.updateFirstMediaByVariant(t))}updateVariantInput(){let t=r(`#product-form-component-${this.dataset.productId}-${this.dataset.section}`);t&&(t.getVeriantInput().setAttribute("value",String(this.variant.id)),t.getVeriantInput().dispatchEvent(new Event("change",{bubbles:!0})))}updatePickupAvailability(){let t=r(`#product-pickup-availability-${this.dataset.productId}-${this.dataset.section}`);t&&(t.updateVariantId(this.variant.id),t.fetchAvailability())}updateSection(){this.toggleHeaderDynamicShow(!0);let t=r(`#product-form-component-${this.dataset.productId}-${this.dataset.section}`);this.updateBlocks(),t?.setDisable(!0),t?.setLoading(!0),fetch(`${this.dataset.url}?variant=${this.variant.id}§ion_id=${this.dataset.sectionIdWithoutPrefix}`).then(e=>e.text()).then(e=>{t?.setDisable(!this.variant.available),t?.setLoading(!1),this.updateElements(S(e))}).catch(()=>{console.log("Error in variant picker component")}).finally(()=>{this.toggleHeaderDynamicShow(!1)})}
1updateElements(t){oe.forEach(e=>{let i=`${e}-${this.dataset.productId}-${this.dataset.section}`,o=r(`#${i}`),n=r(`#${i}`,t);v(o,n)})}updateBlocks(){ne.forEach(t=>{r(`#${t}-${this.dataset.productId}-${this.dataset.section}`)?.updateByVariantId(this.variant.id)})}getCheckedInput(t){return t.find(({checked:e})=>e)}getForm(){return r(`#product-form-component-${this.dataset.productId}-${this.dataset.section}`)}},Lt=s((d,t)=>{let e=d.find(({options:o})=>o.every((n,a)=>t[a]===n)),i=e||d.find(o=>o.option1===t[0]);return{variant:i,selectedOptions:i?[...i.options]:[...t],usedFallback:!e&&!!i}},"selectVariantWithFallback"),xt=s((d,t,e)=>{let i=t.some(n=>n.includes(d)),o=e.some(n=>n.includes(d));return{disabled:!i,outOfStock:o&&!i,noExist:!o}},"getOptionState"),Mt=s((d,t,e)=>d&&t?`${d} ${t}${e?", selected":""}`:null,"buildVariantLabelAria"),At=s(d=>d.key==="Enter"||d.code==="Space"||d.key===" ","isVariantActivationKey"),ct="[data-variant-picker-option-inputs]",de="[data-variant-picker-option-labels]",he="[data-dropdown-variant-picker-label]",U=class extends K{static{s(this,"VariantPicker")}updateLabels(){let t=l(ct,this),e=l(de,this);t.forEach((i,o)=>{let n=l("label",e[o]),a=l("input",i),c=this.getCheckedInput(a),h=r(he,e[o]);h&&h.toggleAttribute("no-available",!this.variant?.available),n.forEach(m=>{let b=m.getAttribute("for")===c.id;if(h&&b){let L=g("dropdown-opener",h);v(h,m),L.trigger()}m.classList.toggle("selected",b),m.setAttribute("aria-checked",b?"true":"false");let I=e[o]?.getAttribute("option-picker-name"),M=m.getAttribute("data-value")||m.textContent?.trim(),y=Mt(I,M,b);y&&m.setAttribute("aria-label",y)})})}setVariant(){let t=l(ct,this),e=t.map(o=>this.getCheckedInput(l("input",o)).value),i=Lt(this.variants,e);this.variant=i.variant,i.usedFallback&&t.forEach((o,n)=>{let a=r(`input[value="${i.selectedOptions[n]}"]`,o);a&&(a.checked=!0)}),this.variant||f("product-form").then(()=>this.setUnavailable())}handleLabelKeydown=s(t=>{if(!At(t))return;t.preventDefault();let e=t.target,i=r(`input[id="${e.getAttribute("for")}"]`,this);i&&i.dispatchEvent(new MouseEvent("click",{button:0,which:1}))},"handleLabelKeydown");getAllVariantsByOption(t){let e=this.variants.map(i=>i.options);return t?e.filter(i=>t.every(o=>i.includes(o.value))):e}async setOptions(t,e,i){for(let o of t){let n=xt(o.value,e,i),a=`label[for="${o.id}"]`,c=r(a,this)||await this.getDropdownElementBySelector(a);c&&(c.toggleAttribute("no-available",n.disabled),c.toggleAttribute("out-of-stock",n.outOfStock),c.toggleAttribute("no-exist",n.noExist),c.setAttribute("aria-disabled",n.disabled?"true":"false"))}}setOptionsAvailable(){let t=l(ct,this),e=t[0]&&l("input",t[0]);if(!e?.length)return;let i=this.getCheckedInput(e);this.setOptions(e,this.getVariantsByOption([]),this.getAllVariantsByOption([]));let o=t[1]&&l("input",t[1]);if(!o)return;let n=this.getCheckedInput(o);this.setOptions(o,this.getVariantsByOption([i]),this.getAllVariantsByOption([i]));let a=t[2]&&l("input",t[2]);a&&this.setOptions(a,this.getVariantsByOption([i,n]),this.getAllVariantsByOption([i,n]))}},ue="[data-color-swatches-picker-active-value]",Ot="[data-color-swatches-picker-label]",j=class extends u{static{s(this,"ColorSwatchesPicker")}mountComponent(){let t=l(Ot,this),e=g("variant-picker",this)?.getForm();e&&this.addListener(e,"change",this.handleFormChange),t.forEach(i=>{this.addListener(i,"mouseenter",this.handleMouseEnter),this.addListener(i,"mouseleave",this.handleMouseLeave)})}handleFormChange=s(()=>{this.setSelected()},"handleFormChange");handleMouseEnter=s(t=>{t.preventDefault();let e=t.target;this.setHovered(e.dataset.value)},"handleMouseEnter");handleMouseLeave=s(t=>{t.preventDefault(),this.setSelected()},"handleMouseLeave");setSelected(){let t=r(`${Ot}.selected`,this);this.setHovered(t?.getAttribute("data-value")||"")}setHovered(t){let e=r(ue,this);e&&(e.textContent=t)}},Pt=window.VelotricBundle;if(!Pt?.shell?.ready)throw new Error("vl-bundle-shell.js must execute before vl-bundle-product.js");var kt=Pt.shell.api;if(!kt)throw new Error("Missing shell named API contract");var Bt=kt.ModalComponent,me="[data-product-modal-carousel]",pe="[data-product-modal-carousel-button]",ge="[data-product-modal-slide]",fe="[data-product-modal-selected-slide-number]",be="zoom-cursor",q=class extends Bt{static{s(this,"ProductModal")}carousel;mediaIndexMap;isZoomed=!1;zoomedImage;opener;handleKeydown=s(t=>{Tt(t)&&(t.preventDefault(),this.isZoomed?this.zoomedImage?.reset():this.hide())},"handleKeydown");handleCarouselInit=s(()=>{this.updateCarouselDraggableState()},"handleCarouselInit");handleCarouselSelect=s(()=>{this.updateSelectedSlideNumber()},"handleCarouselSelect");async openAndShowMediaById(t,e){if(this.opener=e??null,await this.show(),!this.carousel)return;let i=this.mediaIndexMap[t];this.carousel.embla.scrollTo(i,!0);let o=l(pe,this.carousel);o[0]&&o[0].focus(),this.updateSelectedSlideNumber()}initCarousel(){this.mediaIndexMap=this.createMediaIndexMap(),this.element&&(this.carousel=r(me,this.element)),this.carousel?.embla.on("select",this.handleCarouselSelect),this.carousel?.embla.on("init",this.handleCarouselInit)}resetCarousel(){this.carousel?.embla.off("select",this.handleCarouselSelect),this.carousel?.embla.off("init",this.handleCarouselInit)}async hide(){this.resetCarousel(),this.isZoomed=!1,this.zoomedImage=null,this.updateModal(),await super.hide(),this.restoreOpenerFocus()}async show(){await super.show(),this.initCarousel()}restoreOpenerFocus(){let t=this.opener;this.opener=null,t?.isConnected&&requestAnimationFrame(()=>t.focus({preventScroll:!0}))}updateSelectedSlideNumber(){let t=r(fe,this.element);!t||!this.carousel||(t.textContent=String(this.carousel.embla.selectedScrollSnap()+1))}updateModal(){this.updateCarouselDraggableState(),this.updateZoomCursorState(),this.updateZoomState()}createMediaIndexMap(){return l(ge,this.element).reduce((e,i,o)=>i.dataset.mediaId?{...e,[i.dataset.mediaId]:o}:e,{})}updateCarouselDraggableState(){if(this.carousel){if(!C()){this.carousel.reInit({watchDrag:!1});return}this.carousel.reInit({watchDrag:!this.isZoomed})}}updateZoomCursorState(){r(be)?.updateState(this.isZoomed)}updateZoomState(){this.toggleAttribute("zoom-enabled",this.isZoomed)}},Z=class extends u{static{s(this,"ProductModalImageWrap")}image;modal;carousel;preloader;currentSettedScale;isDragging;offsetX;offsetY;startDragPoint;maxScale;minScale;isTapped;tapTimeout;lastGesture;zoomTimeoutId;isTappedTimeout;isDoubleTapped;firstMove;fingers;startMoveTouches;lastDistanceBetweenTouches;dragStartPointY;dragStartPointX;isPinchScaling;constructor(){super(),this.image=r("img",this),this.modal=g("product-modal",this),this.preloader=r("[data-product-modal-image-preloader]",this),this.currentSettedScale=1,this.isDragging=!1,this.offsetX=0,this.offsetY=0,this.startDragPoint={x:0,y:0},this.maxScale=3,this.minScale=1,this.isTapped=!1,this.tapTimeout=300,this.lastGesture=null,this.setZoomCursorVisible(!0)}mountComponent(){this.carousel=this.modal.carousel,this.addListener(this.image,"mousedown",this.handleMouseDown),this.addListener(this.image,"mouseup",this.handleMouseUp),this.addListener(this.image,"mousemove",this.handleMouseMove),this.addListener(this.image,"touchstart",this.handleTouchStart),this.addListener(this.image,"touchend",this.handleTouchEnd),this.addListener(this.image,"touchmove",this.handleTouchMove),this.addListener(this.image,"load",this.handleImageLoad),f("product-modal").then(()=>{this.modal.on("hide",this.handleModalHide)}),this.carousel?.embla.on("select",this.handleCarouselSelect)}
1unmountComponent(){this.modal?.off("hide",this.handleModalHide),this.carousel?.embla.off("select",this.handleCarouselSelect),clearTimeout(this.zoomTimeoutId),clearTimeout(this.isTappedTimeout)}handleImageLoad=s(()=>{this.setPreloaderVisible(!1)},"handleImageLoad");handleModalHide=s(()=>{this.reset()},"handleModalHide");handleCarouselSelect=s(()=>{this.reset()},"handleCarouselSelect");handleTouchStart=s(t=>{t.preventDefault(),this.fingers=t.touches.length,this.firstMove=!0,this.detectDoubleTap(t)},"handleTouchStart");handleTouchMove=s(t=>{if(t.preventDefault(),!this.isDoubleTapped){if(this.firstMove)this.updateGesture(t),this.startMoveTouches=t.touches.length;else if(this.lastGesture)switch(this.lastGesture){case"zoom":this.startMoveTouches===2&&t.touches.length===2&&this.pinch(t);break;case"drag":if(this.startMoveTouches===1&&t.touches.length===1){let{clientX:e,clientY:i}=t.targetTouches[0];this.drag(e,i)}break}else this.setGesture("none",t);this.firstMove=!1}},"handleTouchMove");handleTouchEnd=s(t=>{t.preventDefault(),this.fingers=t.touches.length,this.updateGesture(t)},"handleTouchEnd");handleMouseDown=s(t=>{t.preventDefault(),this.startDrag(t.clientX,t.clientY),this.setDragging(!0)},"handleMouseDown");handleMouseUp=s(t=>{this.setDragging(!1);let e=this.modal.isZoomed?75:0;this.zoomTimeoutId=setTimeout(()=>{this.touchZoom(t.clientX,t.clientY)},e)},"handleMouseUp");handleMouseMove=s(t=>{if(t.preventDefault(),clearTimeout(this.zoomTimeoutId),this.isDragging&&this.modal.isZoomed){let{clientX:e,clientY:i}=t;this.drag(e,i)}},"handleMouseMove");detectDoubleTap(t){if(this.isTappedTimeout&&this.fingers===1)switch(clearTimeout(this.isTappedTimeout),this.isTappedTimeout=null,this.isDoubleTapped=!0,this.touchZoom(t.changedTouches[0].clientX,t.changedTouches[0].clientY),this.lastGesture){case"zoom":this.setPinchScaling(!1);break;case"drag":this.setDragging(!1);break}else this.isTappedTimeout=setTimeout(()=>{this.isTappedTimeout=null,this.isDoubleTapped=!1},this.tapTimeout)}updateGesture(t){this.fingers===2?this.setGesture("zoom",t):this.fingers===1?this.setGesture("drag",t):this.setGesture("none",t)}setGesture(t,e){if(this.lastGesture!==t){if(this.lastGesture&&!t)switch(this.lastGesture){case"zoom":this.setPinchScaling(!1);break;case"drag":this.setDragging(!1);break}switch(t){case"zoom":this.setPinchScaling(!0);break;case"drag":this.startDrag(e.changedTouches[0].clientX,e.changedTouches[0].clientY),this.setDragging(!0);break;case"none":this.setDragging(!1),this.setPinchScaling(!1);break}}this.lastGesture=t}pinch(t){let e=this.getDistanceBetweenTouches(t),i=e>this.lastDistanceBetweenTouches,o=i?.125:-.125,n=this.getNewScale(this.currentScale+o),a=this.getTouchCenter(t),c=(a.x-this.offsetX)/this.currentScale,h=(a.y-this.offsetY)/this.currentScale;if(this.lastDistanceBetweenTouches=e,!i&&n===1){this.reset();return}this.setTransform({scale:n,offsetX:a.x-c*n,offsetY:a.y-h*n})}getDistanceBetweenTouches(t){return Math.hypot(t.touches[0].pageX-t.touches[1].pageX,t.touches[0].pageY-t.touches[1].pageY)}startDrag(t,e){this.startDragPoint={x:t-this.offsetX,y:e-this.offsetY},this.dragStartPointX=t,this.dragStartPointY=e}drag(t,e){let i=this.dragStartPointX>t,o=this.dragStartPointY>e,n=this.getNewScale(this.currentScale),a=t-this.startDragPoint.x,c=e-this.startDragPoint.y,h=this.getIntersectBounds({isRightDrag:i,isBottomDrag:o});(h.right||h.left)&&(a=this.offsetX),(h.bottom||h.top)&&(c=this.offsetY),this.setTransform({scale:n,offsetX:a,offsetY:c})}getIntersectBounds({isRightDrag:t,isBottomDrag:e}){let i=this.image.getBoundingClientRect(),o=8,n=t?-1*o:o,a=e?-1*o:o,c=t&&i.right+n<window.innerWidth,h=!t&&i.left+n>0,m=e&&i.bottom+a<window.innerHeight,b=!e&&i.top+a>0;return{right:c,left:h,bottom:m,top:b}}getTouchCenter(t){let e=s((n,a)=>n+a,"sum"),i=[...t.touches],o=i.length;return{x:i.map(n=>n.pageX).reduce(e)/o,y:i.map(n=>n.pageY).reduce(e)/o}}setTransform({offsetX:t,offsetY:e,scale:i}){this.style.transform=`translate3d(${t}px, ${e}px, 0) scale3d(${i}, ${i}, 1)`,this.offsetX=t,this.offsetY=e,this.currentScale=i}touchZoom(t,e){let i=(t-this.offsetX)/this.currentScale,o=(e-this.offsetY)/this.currentScale,n,a,c;this.modal.isZoomed?(n=this.getNewScale(1),a=0,c=0):(n=this.getNewScale(3),a=t-i*n,c=e-o*n),this.style.cursor=this.modal.isZoomed?"":"grab",this.setZoomCursorVisible(this.modal.isZoomed),this.setTransform({scale:n,offsetX:a,offsetY:c})}reset(){this.setTransform({scale:1,offsetX:0,offsetY:0})}getNewScale(t){return Math.max(this.minScale,Math.min(this.maxScale,t))}setPinchScaling(t){this.toggleAttribute("is-pinch-scaling",t),this.isPinchScaling=t}setDragging(t){this.toggleAttribute("is-dragging",t),this.isDragging=t}setZoomCursorVisible(t){this.image?.toggleAttribute("data-zoom-cursor-target",t)}setModalZoom(t){this.modal.isZoomed=t,this.modal.isZoomed&&(this.modal.zoomedImage=this),this.modal.updateModal()}setPreloaderVisible(t){this.preloader.classList.toggle("hidden",!t),this.image?.toggleAttribute("is-loaded",!t)}set currentScale(t){this.currentSettedScale!==t&&(this.setModalZoom(t>1),this.currentSettedScale=t)}get currentScale(){return this.currentSettedScale}},Rt=window.VelotricBundle;if(!Rt?.shell?.ready)throw new Error("vl-bundle-shell.js must execute before vl-bundle-product.js");var Ht=Rt.shell.api;if(!Ht)throw new Error("Missing shell named API contract");var Dt=Ht.ModalButton,Y=class extends Dt{static{s(this,"ProductModalButton")}trigger(){let t=r(this.dataset.modal);if(this.dataset.action==="open"&&t){t.openAndShowMediaById(this.dataset.mediaId,this);return}super.trigger()}},W=class extends u{static{s(this,"ProductRecommendations")}mountComponent(){this.update()}update=s(()=>{let t=this.dataset.url;t&&fetch(t).then(e=>e.text()).then(e=>{this.updateByHTML(S(e))}).catch(()=>{console.log("Error in product recommendations component")})},"update");updateByHTML(t){let e=r(`product-recommendations[id="${this.id}"]`,t);v(this,e)}},G=class extends u{static{s(this,"ProductRelatedBlock")}mountComponent(){this.loadProducts()}loadProducts(){return this.setAttribute("is-loading",""),fetch(this.dataset.url).then(t=>t.text()).then(t=>{this.updateByHTML(S(t)),this.removeAttribute("is-loading")}).catch(()=>{console.log("Error in product recommendations component")})}updateByHTML(t){let e=r(`#${this.id}`,t);v(this,e),this.toggleAttribute("is-ready",this.hasChildNodes())}},Vt="[data-before-after-images-button]",$t=20,ve="before-after--with-transition",Ce="[data-before-after-images-separator]",Q=class extends u{static{s(this,"BeforeAfterImages")}isMoving=!1;intersectionObserver;mountComponent(){let t=r(Vt,this);this.addListener(t,"keyup",this.handleButtonKeyUp),this.addListener(t,"mousedown",this.handleButtonMouseDown),this.addListener(document,"mouseup",this.handleButtonMouseUp),this.addListener(document,"mousemove",this.handleMouseMove),this.addListener(t,"touchstart",this.handleTouchStart),this.addListener(this,"touchmove",this.handleTouchMove),this.addListener(document,"touchend",this.handleTouchEnd),this.intersectionObserver=new IntersectionObserver(this.handleInViewport,{rootMargin:"0px"}),this.intersectionObserver.observe(this)}unmountComponent(){this.intersectionObserver?.disconnect()}setInitialPosition=s(async()=>{let t=r(Ce,this);this.setPosition(Number(this.dataset.initialDragPosition)),await pt(t),this.classList.remove(ve)},"setInitialPosition");handleInViewport=s(t=>{t.some(e=>e.isIntersecting)&&(this.intersectionObserver.disconnect(),this.setInitialPosition())},"handleInViewport");handleButtonMouseDown=s(t=>{t.preventDefault(),this.startMove()},"handleButtonMouseDown");handleButtonMouseUp=s(()=>{this.endMove()},"handleButtonMouseUp");handleMouseMove=s(t=>{this.isMoving&&this.move(t.pageX)},"handleMouseMove");handleButtonKeyUp=s(t=>{let e=r(Vt,this);if(!e||!at(t)&&!It(t))return;let i=e.getBoundingClientRect(),o=i.right-i.width/2,n=at(t)?o-$t:o+$t;this.move(n)},"handleButtonKeyUp");handleTouchStart=s(()=>{this.startMove()},"handleTouchStart");handleTouchEnd=s(()=>{this.endMove()},"handleTouchEnd");handleTouchMove=s(t=>{this.isMoving&&(t.preventDefault(),this.move(t.targetTouches[0].clientX))},"handleTouchMove");startMove(){this.isMoving=!0}endMove(){this.isMoving=!1}setPosition(t){this.style.setProperty("--gsc-drag-position",`${t}%`),this.setAttribute("data-position-active",t>50?"before":"after")}move(t){let e=this.getBoundingClientRect();if(t<=e.left)this.setPosition(0);else if(t>=e.right)this.setPosition(100);else{let i=Math.floor((t-e.left)/this.offsetWidth*1e3)/10;this.setPosition(i)}}},_t="[data-recipient-form-checkbox]",dt="[data-recipient-form-timezone-input]",Ft="[data-recipient-form-input]",Ee="[data-recipient-form-fields]",J=class extends u{static{s(this,"RecipientForm")}mountComponent(){this.addListener(this,"change",this.handleChange)}handleChange(){let t=r(_t,this);this.updateHeight(t.checked),this.updateDisable(!t.checked),t.checked||this.clearInputs()}clearInputs(){l(`${Ft}, ${dt}
1`,this).forEach(e=>{e.value=""})}updateDisable(t){l(`${Ft}, ${dt}`,this).forEach(i=>{i.disabled=t})}reset(){let t=r(_t,this);t.checked=!1,this.clearInputs()}updateHeight(t){let e=r(Ee,this);e&&(e.style.maxHeight=`${t?e.scrollHeight:0}px`)}setTimezone(){let t=r(dt,this);t.value=String(new Date().getTimezoneOffset())}},Nt="modal-component",tt="hotspots-float-element",zt="float-element-btn",et=class extends u{static{s(this,"HotspotsComponent")}hasOpenFloatElement;mountComponent(){let t=l(Nt,this),e=l(tt,this),i=l(zt,this);t.forEach(o=>{f("modal-component").then(()=>{o.on("show",this.handleModalOpen),o.on("hide",this.handleModalHide)})}),e.forEach(o=>{f("hotspots-float-element").then(()=>{o.on("hide",this.handleFloatElementHide),o.on("show",this.handleFloatElementShow)})}),i.forEach(o=>{this.addListener(o,"mouseenter",this.handlePinBtnEnter),this.addListener(o,"mouseleave",this.handlePinBtnLeave),this.addListener(o,"click",this.handlePinBtnClick)}),this.isEditor&&this.addListener(window,"click",this.handleEditorClick)}unmountComponent(){let t=l(Nt,this),e=l(tt,this);t.forEach(i=>{f("modal-component").then(()=>{i.off("show",this.handleModalOpen),i.off("hide",this.handleModalHide)})}),e.forEach(i=>{f("hotspots-float-element").then(()=>{i.off("hide",this.handleFloatElementHide),i.off("show",this.handleFloatElementShow)})})}handlePinBtnClick=s(t=>{t.preventDefault(),this.setAttribute("animation-state","pause")},"handlePinBtnClick");handlePinBtnEnter=s(t=>{t.preventDefault(),this.setAttribute("animation-state","pause")},"handlePinBtnEnter");handlePinBtnLeave=s(t=>{t.preventDefault(),!this.hasOpenFloatElement&&this.removeAttribute("animation-state")},"handlePinBtnLeave");handleFloatElementShow=s(()=>{this.hasOpenFloatElement=!0},"handleFloatElementShow");handleFloatElementHide=s(()=>{this.hasOpenFloatElement=!1,this.removeAttribute("animation-state")},"handleFloatElementHide");handleModalOpen=s(()=>{this.setAttribute("animation-state","pause")},"handleModalOpen");handleModalHide=s(()=>{this.removeAttribute("animation-state")},"handleModalHide");handleEditorClick=s(t=>{let e=g(zt,t.target),i=g(tt,t.target),o=l(tt,this);e||i||o.forEach(n=>{n.hide()})},"handleEditorClick")},Xt=window.VelotricBundle;if(!Xt?.shell?.ready)throw new Error("vl-bundle-shell.js must execute before vl-bundle-product.js");var Kt=Xt.shell.api;if(!Kt)throw new Error("Missing shell named API contract");var it=Kt.debounce,st=class extends u{static{s(this,"ImageSlider")}withProgressBar;withRotateImages;withVerticalScrollText;withVerticalScrollImage;carousel;progressBar;progressBarIndicator;progressDots;images;captions;arrows;dots;length;imagesLength;captionsLength;activeIndex;imagesContainer;captionHeight;touchStartX;intersectionObserver;resizeObserver;isMobile;windowClientHeight;scrollTriggerTop;scrollTriggerBottom;scrollDirection;lastScroll;constructor(){super(),this.withProgressBar=this.hasAttribute("with-progress-bar"),this.withRotateImages=this.hasAttribute("with-rotate-images"),this.withVerticalScrollText=this.hasAttribute("with-vertical-scroll"),this.withVerticalScrollImage=this.hasAttribute("with-vertical-scroll-image"),this.carousel=r("carousel-component",this),this.withRotateImages&&(this.images=l("[data-image-slider-image]",this),this.captions=l("[data-image-slider-caption]",this),this.arrows=l("[data-direction]",this),this.dots=l("[data-progress-dot]",this),this.length=this.images.length-1,this.activeIndex=0),this.withRotateImages||(this.images=l("[data-image-slider-image]",this),this.captions=l(".image-slider__slide",this),this.activeIndex=0,this.length=this.images.length-1),this.withProgressBar&&(this.progressBar=r("carousel-progress",this),this.progressBarIndicator=this.querySelector("[data-carousel-progress-indicator]"),this.progressDots=l("[data-progress-dot]",this)),(this.withVerticalScrollText||this.withVerticalScrollImage)&&(this.imagesContainer=this.querySelector("[data-carousel-viewport]"),this.images=l("[data-image-slider-image]",this),this.captions=l("[data-image-slider-caption]",this),this.captionHeight=this.images[0].offsetHeight,this.imagesLength=this.images.filter(t=>t.firstElementChild.tagName!=="svg").length,this.captionsLength=this.captions.length,this.activeIndex=0)}mountComponent(){this.withProgressBar&&!this.withRotateImages&&f("carousel-component").then(()=>{this.carousel?.on("carouselSelect",this.handleCarouselScroll)}),this.withRotateImages&&(this.withVerticalScrollText||this.stackImages(),this.arrows?.forEach(t=>{t.addEventListener("click",this.handleArrowClick),t.addEventListener("keydown",this.handleArrowKeydown)}),this.dots?.forEach(t=>{t.addEventListener("click",this.handleDotClick)}),this.rotateImages(),this.toggleArrowsDisabled()),this.setAttribute("draggable","true"),this.addEventListener("dragstart",this.handleDragStart),this.addEventListener("mousedown",this.handleTouchStart),this.addEventListener("touchstart",this.handleTouchStart),this.addEventListener("mouseup",this.handleTouchEnd),this.addEventListener("touchend",this.handleTouchEnd),this.withVerticalScrollText&&(this.stackImagesForVerticalScroll(),this.setObserversForVerticalScroll()),this.withVerticalScrollImage&&(this.setObserversForVerticalScrollImage(),this.addListener(this,"focusout",this.handleVerticalImageFocusout)),this.carousel?.embla?.on("select",this.handleCarouselSelect),this.setComponentVisible()}handleCarouselSelect=s(t=>{let e=t.selectedScrollSnap();this.activeIndex=e},"handleCarouselSelect");unmountComponent(){this.withProgressBar&&!this.withRotateImages&&this.carousel?.off("carouselSelect",this.handleCarouselScroll),this.withRotateImages&&(this.arrows?.forEach(t=>{t.removeEventListener("click",this.handleArrowClick),t.removeEventListener("keydown",this.handleArrowKeydown)}),this.withProgressBar&&this.dots?.forEach(t=>{t.removeEventListener("click",this.handleDotClick)})),this.removeEventListener("dragstart",this.handleTouchStart),this.removeEventListener("mousedown",this.handleTouchStart),this.removeEventListener("touchstart",this.handleTouchStart),this.removeEventListener("mouseup",this.handleTouchEnd),this.removeEventListener("touchend",this.handleTouchEnd),this.withVerticalScrollText&&(this.intersectionObserver.disconnect(),this.resizeObserver.disconnect()),window.removeEventListener("scroll",this.handleChangeOpacity)}handleVerticalImageFocusout=s(t=>{let e=t.relatedTarget;if(this.contains(e)){let o=e.closest("[data-image-slider-caption]").getAttribute("data-image-slider-caption"),n=r(`[data-image-slider-image="${o}"]`);n&&O()&&n.scrollIntoView({behavior:"smooth",block:"start"})}},"handleVerticalImageFocusout");handleVerticalScroll=s(t=>
1{t.forEach(e=>{if(e.isIntersecting){let i=Number(e.target.parentElement.getAttribute("data-image-slider-caption"));if(i===this.activeIndex)return;if(this.imagesLength===1){this.activeIndex=i;return}if(this.withRotateImages){let o=i>this.activeIndex?"next":"prev";this.changeSlides(o,i)}else this.images.forEach((o,n)=>{n===i?(o.setAttribute("visible",""),o.removeAttribute("prev"),o.removeAttribute("next")):n<i?(o.setAttribute("prev",""),o.removeAttribute("visible"),o.removeAttribute("next")):n>i&&(o.setAttribute("next",""),o.removeAttribute("visible"),o.removeAttribute("prev"))});this.activeIndex=i}})},"handleVerticalScroll");setObserversForVerticalScroll=s(()=>{let t=this.imagesContainer.getBoundingClientRect().height;this.windowClientHeight=document.documentElement.clientHeight,t>this.windowClientHeight&&(this.images.forEach(i=>{i.style.maxHeight=`${this.windowClientHeight-30}px`}),t=this.imagesContainer.getBoundingClientRect().height);let e=(this.windowClientHeight-t)/2;this.imagesContainer.style.top=`${e}px`,this.scrollTriggerTop=e,this.scrollTriggerBottom=this.windowClientHeight-this.scrollTriggerTop-t,this.intersectionObserver=new IntersectionObserver(this.handleVerticalScroll,{rootMargin:`0px 0px -${this.scrollTriggerBottom+30}px 0px`}),this.captions.forEach(i=>{i.style.minHeight=`${this.captionHeight}px`,i.firstElementChild&&this.intersectionObserver.observe(i.firstElementChild)}),this.imagesLength===1&&this.images.forEach((i,o)=>{i.firstElementChild.tagName!=="svg"?(i.setAttribute("visible",""),i.removeAttribute("prev"),i.removeAttribute("next")):(i.removeAttribute("next"),i.removeAttribute("visible"),i.removeAttribute("prev"),i.style.opacity="0")}),this.resizeObserver=new ResizeObserver(this.handleResizeVerticalScroll),this.resizeObserver.observe(this),this.setObserveScroll()},"setObserversForVerticalScroll");setObserveScroll=s(()=>{this.lastScroll=0,window.addEventListener("scroll",this.handleChangeOpacity)},"setObserveScroll");handleChangeOpacity=s(()=>{let t=document.documentElement.scrollTop,e=this.lastScroll>t?"up":"down";this.lastScroll=t,this.captions.forEach((i,o)=>{let n=i.lastElementChild.getBoundingClientRect().bottom,a=i.firstElementChild.getBoundingClientRect().top;if(n<0||a>this.windowClientHeight||o===this.captions.length-1&&this.windowClientHeight-n>this.scrollTriggerBottom&&e==="down"){i.setAttribute("dont-set-opacity",""),i.style.opacity="1";return}let c=n-a,h=(n-this.scrollTriggerTop)/c,m=(this.windowClientHeight-a-this.scrollTriggerBottom)/c;i.hasAttribute("dont-set-opacity")||(i.style.opacity=a<this.scrollTriggerTop?`${h}`:`${m}`);let b=i.getBoundingClientRect().height<this.imagesContainer.getBoundingClientRect().height?this.scrollTriggerBottom:this.scrollTriggerBottom-(i.getBoundingClientRect().height-this.imagesContainer.getBoundingClientRect().height+20);i.hasAttribute("dont-set-opacity")&&this.windowClientHeight-n>b&&a>this.scrollTriggerTop&&i.removeAttribute("dont-set-opacity")})},"handleChangeOpacity");handleVerticalScrollImage=s(t=>{t.forEach(e=>{if(e.isIntersecting){let i=Number(e.target.getAttribute("data-image-slider-image"));if(i===this.activeIndex)return;this.images[i].setAttribute("visible",""),this.images[this.activeIndex].removeAttribute("visible"),this.captionsLength>1&&(this.captions[i].setAttribute("visible",""),this.captions[this.activeIndex].removeAttribute("visible")),this.activeIndex=i}})},"handleVerticalScrollImage");setObserversForVerticalScrollImage=s(()=>{let t=document.documentElement.clientHeight;this.intersectionObserver=new IntersectionObserver(this.handleVerticalScrollImage,{rootMargin:"-40% 0% -50% 0%"});let e=0;this.captions.forEach((n,a)=>{let c=n.firstElementChild.getBoundingClientRect().top,m=n.lastElementChild.getBoundingClientRect().bottom-c;e<m&&(e=m),m<this.images[a].getBoundingClientRect().height&&(n.style.height=this.images[a].getBoundingClientRect().height+"px")}),this.images.find(n=>n.getBoundingClientRect().height<e)&&(this.imagesContainer.style.gap=(e-this.images[0].getBoundingClientRect().height)*2+"px");let o=this.captions[0].parentElement;if(e<t){let n=o.getBoundingClientRect().height,a=(t-n)/2;o.style.top=`${a}px`}else o.style.top="0px";
1this.images.forEach(n=>{this.intersectionObserver.observe(n)}),this.captionsLength===1&&this.captions[0].setAttribute("visible","")},"setObserversForVerticalScrollImage");handleArrowClick=s(t=>{let e=t.currentTarget.getAttribute("data-direction");this.arrowMove(e),this.withProgressBar||this.toogleProgressDotActive()},"handleArrowClick");handleArrowKeydown=s(t=>{let e=t.currentTarget.getAttribute("data-direction");z(t)&&this.arrowMove(e)},"handleArrowKeydown");arrowMove(t){let e;t==="next"?e=this.activeIndex===this.length?0:this.activeIndex+1:e=this.activeIndex-1<0?this.length:this.activeIndex-1,this.changeSlides(t,e),this.withRotateImages&&this.toggleArrowsDisabled(),this.withProgressBar&&this.withRotateImages&&(this.toogleProgressDotActive(),this.setProgressIndicator())}toggleArrowsDisabled=s(()=>{this.arrows?.forEach(t=>{t.getAttribute("data-direction")==="prev"?t.toggleAttribute("disabled",this.activeIndex===0):t.toggleAttribute("disabled",this.activeIndex===this.length)})},"toggleArrowsDisabled");handleDotClick=s(t=>{let e=t.currentTarget.hasAttribute("data-dot-index")?+t.currentTarget.getAttribute("data-dot-index"):+t.target.closest("[data-progress-dot]").getAttribute("data-dot-index");if(e===this.activeIndex)return;let i=e>this.activeIndex?"next":"prev";this.activeIndex===0&&e===this.length&&(i="prev"),e-this.activeIndex>1&&(i="prev"),this.activeIndex===this.length&&e===0&&(i="next"),this.changeSlides(i,e)},"handleDotClick");changeNoRotateSlides=s((t,e)=>{this.carousel.embla.scrollTo(e),this.activeIndex=e},"changeNoRotateSlides");changeSlides=s((t,e)=>{let i=this.captions[this.activeIndex];i.addEventListener("transitionend",this.animationCaptionEnd),i.removeAttribute("visible");let o=t==="next"?this.images[this.activeIndex]:this.images[e];o.addEventListener("animationend",this.animationImageEnd),t==="next"?o.setAttribute("animating-forward",""):o.setAttribute("animating-backward",""),this.activeIndex=e,this.toogleProgressDotActive(),this.setProgressIndicator(),this.toggleArrowsDisabled()},"changeSlides");animationCaptionEnd=s(t=>{let e=t.currentTarget;this.captions[this.activeIndex].setAttribute("visible",""),e.removeEventListener("transitionend",this.animationCaptionEnd)},"animationCaptionEnd");animationImageEnd=s(t=>{let e=t.currentTarget;e.removeAttribute("animating-forward"),e.removeAttribute("animating-backward"),e.removeEventListener("animationend",this.animationImageEnd),this.stackImages()},"animationImageEnd");stackImages=s(()=>{this.images.forEach((t,e)=>{e===this.activeIndex?t.style.zIndex=String(0):e>this.activeIndex?t.style.zIndex=String(this.activeIndex-e):e<this.activeIndex&&(t.style.zIndex=String(-this.length-e+1))})},"stackImages");stackImagesForVerticalScroll=s(()=>{this.images.forEach((t,e)=>{t.style.zIndex=this.withRotateImages?`-${e}`:`${e}`})},"stackImagesForVerticalScroll");handleResizeVerticalScroll=it(()=>{this.captionHeight=this.images[0].offsetHeight,this.captions.forEach(t=>{t.style.minHeight=`${this.captionHeight}px`})},300);rotateImages=s(()=>{if(this.withVerticalScrollImage)this.images.forEach((t,e)=>{t.style.transform=e%2===0?`rotate(${1.7}deg)`:`rotate(-${1.7}deg)`});else{let t=0,e=0;this.images.forEach((i,o)=>{if((o+1)%3===0){let n=t+2.5;i.style.transform=`rotate(${n}deg)`,t=n}else{let n=e-1.5;i.style.transform=`rotate(${n}deg)`,e=n}})}},"rotateImages");handleCarouselScroll=s(t=>{this.withProgressBar&&!this.withRotateImages&&this.toogleProgressDotActive()},"handleCarouselScroll");toogleProgressDotActive=s(()=>{let t=this.getSelectedScrollSnap();(this.withProgressBar?this.progressDots:this.dots)?.forEach((i,o)=>{i.classList.toggle("image-slider__progress-bar-dot--passed",o<t),i.classList.toggle("is-primary",o===this.activeIndex)}),this.toogleProgressCounterActive(this.activeIndex)},"toogleProgressDotActive");toogleProgressCounterActive=s(t=>{let e=this.closest("div[data-product-media-container]");if(!e)return;let o=(this.withProgressBar?this.progressDots:this.dots)?.length||1,n=e.querySelector(".media-counter-thumb .media-counter-current");if(n){n.textContent=String(t+1);let c=e.querySelector(".media-counter-thumb .media-counter-total");c&&(c.textContent=String(o))}let a=e.querySelector(".media-counter-dot .media-counter-current");
1if(a){a.textContent=String(t+1);let c=e.querySelector(".media-counter-dot .media-counter-total");c&&(c.textContent=String(o))}},"toogleProgressCounterActive");setProgressIndicator=s(()=>{if(this.progressBarIndicator){let e=this.getSelectedScrollSnap()/this.length*100;this.progressBarIndicator.style.transform=`translate3d(${e}%, 0, 0)`}},"setProgressIndicator");getSelectedScrollSnap=s(()=>this.carousel?.embla.selectedScrollSnap()??this.activeIndex,"getSelectedScrollSnap");setComponentVisible=s(()=>{this.setAttribute("visible","")},"setComponentVisible");handleDragStart=s(t=>(t.preventDefault(),!1),"handleDragStart");handleTouchStart=s(t=>{this.touchStartX=t.clientX??t.touches[0].clientX},"handleTouchStart");handleTouchEnd=s(t=>{if(t.target.closest("[data-progress-dot]")){this.handleDotClick(t);return}if(this.touchStartX===0)return;let e=t.clientX??t.changedTouches[0].clientX,i=e-this.touchStartX<-20,o=e-this.touchStartX>20;i&&this.activeIndex!==this.length&&this.handleSwipe("next"),o&&this.activeIndex!==0&&this.handleSwipe("prev"),this.touchStartX=0},"handleTouchEnd");handleSwipe=s(t=>{let e;t==="next"?e=this.activeIndex===this.length?0:this.activeIndex+1:e=this.activeIndex-1<0?this.length:this.activeIndex-1,this.withRotateImages||this.changeNoRotateSlides(t,e),this.withRotateImages&&(this.changeSlides(t,e),this.toggleArrowsDisabled()),this.withProgressBar&&this.withRotateImages&&(this.toogleProgressDotActive(),this.setProgressIndicator())},"handleSwipe")},we="data-with-scrolltrack",Se="header-component",Te="product__info-wrapper--small",Ie="product__info-wrapper--wide",ye="product__info-wrapper--wide-plus",ot=class extends u{static{s(this,"ProductInfo")}headerHeight;defaultTopSpace;infoHeight;isToSetMoreHeight;resizeObserver;mountComponent(){this.hasAttribute(we)&&(customElements.whenDefined("header-component").then(()=>{this.setDimentions(),this.addListener(window,"scroll",this.handleScroll)}),this.isEditor&&this.editor.on("SECTION_LOAD",this.handleSectionLoad)),this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this)}setDimentions=s(()=>{this.defaultTopSpace=16,this.infoHeight=this.getBoundingClientRect().height;let t=r(Se),e=t.section;this.headerHeight=e.offsetHeight,this.isToSetMoreHeight=t.getAttribute("is-sticky")==="static"},"setDimentions");handleScroll=s(()=>{let t=this.isToSetMoreHeight?this.defaultTopSpace+this.headerHeight:this.defaultTopSpace,e=window.innerHeight-t;window.scrollY>0&&this.infoHeight>e?this.style.top=`${e-this.infoHeight}px`:this.style.top=`${t}px`},"handleScroll");handleSectionLoad=s(()=>{this.setDimentions()},"handleSectionLoad");handleResize=it(()=>{C()||this.toggleWidthClasses()},50);toggleWidthClasses=s(()=>{let t=this.getBoundingClientRect().width;this.classList.toggle(Te,t<380),this.classList.toggle(Ie,t>480),this.classList.toggle(ye,t>740)},"toggleWidthClasses")},w=window.VelotricBundle||(window.VelotricBundle={});if(!w.common?.ready)throw new Error("vl-bundle-common.js must execute before vl-bundle-product.js");if(!w.shell?.ready)throw new Error("vl-bundle-shell.js must execute before vl-bundle-product.js");if(!w.zoom?.ready)throw new Error("vl-bundle-zoom.js must execute before vl-bundle-product.js");if(!w.carousel?.ready)throw new Error("vl-bundle-carousel.js must execute before vl-bundle-product.js");if(!w.cards?.ready)throw new Error("vl-bundle-cards.js must execute before vl-bundle-product.js");if(!w.content?.ready)throw new Error("vl-bundle-content.js must execute before vl-bundle-product.js");if(!w.clipboard?.ready)throw new Error("vl-bundle-clipboard.js must execute before vl-bundle-product.js");if(!w.modal?.ready)throw new Error("vl-bundle-modal.js must execute before vl-bundle-product.js");if(w.product?.ready)throw new Error("vl-bundle-product.js executed more than once");w.product={version:1,ready:!0,api:{}};var Le=[P,k,B,R,H,D,$,_,F,N,U,j,q,Z,Y,W,G,Q,J,et,st,ot];Le.forEach(mt)})(); 2//# sourceMappingURL=/cdn/shop/t/644/assets/vl-bundle-product.js.map?v=61626558930012501901789470657
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.