1/* 2* @license 3* Palo Alto Theme (c) 4* 5* This file is included for advanced development by 6* Shopify Agencies. Modified versions of the theme 7* code are not supported by Shopify or Presidio Creative. 8* 9* In order to use this file you will need to change 10* theme.js to theme.dev.js in /layout/theme.liquid 11* 12*/(function(scrollLock,Flickity,themeCurrency,Ajaxinate,AOS){"use strict";window.theme=window.theme||{},window.theme.sizes={mobile:480,small:768,large:1024,widescreen:1440},window.theme.keyboardKeys={TAB:"Tab",ENTER:"Enter",NUMPADENTER:"NumpadEnter",ESCAPE:"Escape",SPACE:"Space",LEFTARROW:"ArrowLeft",RIGHTARROW:"ArrowRight"},window.theme.focusable='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function debounce(fn,time){let timeout;return function(){if(fn){const functionCall=()=>fn.apply(this,arguments);clearTimeout(timeout),timeout=setTimeout(functionCall,time)}}}const selectors$18={body:"body",main:"[data-main]",header:"[data-site-header]",preventTransparentHeader:"[data-prevent-transparent-header]"},classes$X={supportsTransparentHeader:"supports-transparent-header",siteHeaderTransparent:"site-header--transparent",isFirstSectionTransparent:"is-first-section-transparent"},attributes$J={transparent:"data-transparent"},initTransparentHeader=()=>{const body=document.querySelector(selectors$18.body),header=body.querySelector(selectors$18.header);if(!header)return;const headerTransparent=header.getAttribute(attributes$J.transparent)==="true",firstSection=body.querySelector(selectors$18.main).children[0];if(!firstSection)return;const preventTransparentHeader=firstSection.querySelector(`${selectors$18.preventTransparentHeader}:first-of-type`);window.isHeaderTransparent=headerTransparent&&firstSection.classList.contains(classes$X.supportsTransparentHeader)&&!preventTransparentHeader,CSS.supports("(selector(:has(*)))")||(body.classList.toggle(classes$X.isFirstSectionTransparent,window.isHeaderTransparent),header.classList.toggle(classes$X.siteHeaderTransparent,window.isHeaderTransparent))};let screenOrientation=getScreenOrientation();const selectors$17={body:"body",main:"[data-main]",collectionFilters:"[data-collection-filters]",footer:'[data-section-type*="footer"]',header:"[data-header-height]",stickyHeader:'[data-site-header][data-position="fixed"]',announcementBar:"[data-announcement-bar]",collectionStickyBar:"[data-collection-sticky-bar]",logoTextLink:"[data-logo-text-link]"},classes$W={templateCollection:"template-collection",templateSearch:"template-search",supportsTransparentHeader:"supports-transparent-header"};function readHeights(){const h={};return h.windowHeight=Math.min(window.screen.height,window.innerHeight),h.footerHeight=getHeight(selectors$17.footer),h.headerHeight=getHeight(selectors$17.header),h.headerInitialHeight=parseInt(document.querySelector(selectors$17.header)?.dataset.height||document.querySelector(selectors$17.header)?.offsetHeight)||0,h.announcementBarHeight=getHeight(selectors$17.announcementBar),h.collectionStickyBarHeight=getHeight(selectors$17.collectionStickyBar),h}function setVarsOnResize(){document.addEventListener("theme:resize",resizeVars),setVars(),document.dispatchEvent(new CustomEvent("theme:vars"),{bubbles:!1})}function setVars(){calcVars()}function resizeVars(){calcVars(!0)}function calcVars(checkOrientation=!1){const body=document.querySelector(selectors$17.body),hasCollectionFilters=document.querySelector(selectors$17.collectionFilters),hasLogoTextLink=document.querySelector(selectors$17.logoTextLink)!==null;let{windowHeight,headerHeight,headerInitialHeight,announcementBarHeight,footerHeight,collectionStickyBarHeight}=readHeights();hasLogoTextLink&&(headerHeight=recalcHeaderHeight());const contentFullHeight=window.isHeaderTransparent&&checkFirstSectionTransparency()?windowHeight-announcementBarHeight:windowHeight-headerInitialHeight-announcementBarHeight;let fullHeight=isHeaderSticky()?windowHeight-window.stickyHeaderHeight:windowHeight;const isCollectionPage=body.classList.contains(classes$W.templateCollection),isSearchPage=body.classList.contains(classe
12s$W.templateSearch),isPageWithFilters=isCollectionPage&&hasCollectionFilters||isSearchPage&&hasCollectionFilters;if(document.documentElement.style.setProperty("--footer-height",`${footerHeight}px`),document.documentElement.style.setProperty("--content-full",`${contentFullHeight}px`),document.documentElement.style.setProperty("--content-min",`${windowHeight-headerHeight-footerHeight}px`),document.documentElement.style.setProperty("--collection-sticky-bar-height",`${collectionStickyBarHeight}px`),isPageWithFilters&&(fullHeight=windowHeight),!checkOrientation){document.documentElement.style.setProperty("--full-height",`${fullHeight}px`);return}const currentScreenOrientation=getScreenOrientation();currentScreenOrientation!==screenOrientation&&(document.documentElement.style.setProperty("--full-height",`${fullHeight}px`),screenOrientation=currentScreenOrientation)}function getHeight(selector){const el=document.querySelector(selector);return el?el.clientHeight:0}function checkFirstSectionTransparency(){return document.querySelector(selectors$17.main).firstElementChild.classList.contains(classes$W.supportsTransparentHeader)}function isHeaderSticky(){return document.querySelector(selectors$17.stickyHeader)}function getScreenOrientation(){if(window.matchMedia("(orientation: portrait)").matches)return"portrait";if(window.matchMedia("(orientation: landscape)").matches)return"landscape"}function recalcHeaderHeight(){document.documentElement.style.setProperty("--header-height","auto"),document.documentElement.style.setProperty("--header-sticky-height","auto");const resetHeight=document.querySelector(selectors$17.header).offsetHeight;return requestAnimationFrame(()=>{document.documentElement.style.setProperty("--header-height",`${resetHeight}px`),document.documentElement.style.setProperty("--header-sticky-height",`${resetHeight}px`)}),resetHeight}let isCompleted=!1,docComplete=!1;function preloadImages(){document.onreadystatechange=()=>{document.readyState==="complete"&&(docComplete=!0,initImagesPreloader())},requestIdleCallback(initImagesPreloader)}function initImagesPreloader(){setTimeout(()=>{if(isCompleted)return;if(!docComplete){initImagesPreloader();return}const lazyImages=document.querySelectorAll('img[loading="lazy"]');lazyImages.length&&lazyImages.forEach(image=>{image.setAttribute("loading","eager")}),isCompleted=!0},3e3)}const selectors$16={overflowBackground:"[data-overflow-background]",overflowFrame:"[data-overflow-frame]",overflowContent:"[data-overflow-content]",overflowContainer:"[data-overflow-container]",overflowWrapper:"[data-overflow-wrapper]"};function singles(frame,wrappers){let tallest=0;wrappers.forEach(wrap2=>{tallest=wrap2.offsetHeight>tallest?wrap2.offsetHeight:tallest});const images=frame.querySelectorAll(selectors$16.overflowBackground);[frame,...images].forEach(el=>{el.style.setProperty("min-height",`calc(${tallest}px + var(--header-height))`)})}function doubles(section){if(window.innerWidth<window.theme.sizes.small){section.querySelectorAll(selectors$16.overflowFrame).forEach(singleframe=>{const wrappers=singleframe.querySelectorAll(selectors$16.overflowContent);singles(singleframe,wrappers)});return}let tallest=0;const frames=section.querySelectorAll(selectors$16.overflowFrame);section.querySelectorAll(selectors$16.overflowContent).forEach(content=>{content.offsetHeight>tallest&&(tallest=content.offsetHeight)});const images=section.querySelectorAll(selectors$16.overflowBackground);[...frames,...images].forEach(el=>{el.style.setProperty("min-height",`${tallest}px`)}),section.style.setProperty("min-height",`${tallest}px`)}function preventOverflow(container){const singleFrames=container.querySelectorAll(selectors$16.overflowContainer);singleFrames&&singleFrames.forEach(frame=>{const wrappers=frame.querySelectorAll(selectors$16.overflowContent);singles(frame,wrappers),document.addEventListener("theme:resize",()=>{singles(frame,wrappers)})});const doubleSections=container.querySelectorAll(selectors$16.overflowWrapper);doubleSections&&doubleSections.forEach(section=>{doubles(section),document.addEventListener("theme:resize",()=>{doubles(section)})})}window.lastWindowWidth=window.innerWidth;function dispatchResizeEvent(){document.dispatchEvent(new CustomEvent("theme:resize",{bubbles:!0})),window.lastWindowWidth!==window.innerWidth&&(document.dispatchEvent(new CustomEvent("theme:resize:width",{bubbles:!0})),window.lastWindowWidth=window.innerWidth)}function resizeListener(){window.addEventListener("resize",debounce(dispatchResizeEvent,50))}let prev=window.pageYOffset,up=null,down=null,wasUp=null,wasDown=null,scrollLockTimer$1=0;const classes$V={quickViewVisible:"js-quick-view-visible",cartDrawerOpen:"js-drawer-open-cart"};function dispatchScrollEvent(){const position=window.pageYOffset;position>prev?(down=!0,up=!1):position<prev?(down=!1,up=!0):(up=null,down=null),prev=position,document.dispatchEvent(new CustomEvent("theme:scroll",{detail:{up,down,position},bubbles:!1})),up&&!wasUp&&document.dispatchEvent(new CustomEvent("theme:scroll:up",{detail:{position},bubbles:!1})),down&&!wasDown&&document.dispatchEvent(new CustomEvent("theme:scroll:down",{detail:{position},bubbles:!1})),wasDown=down,wasUp=up}function lock(e){setTimeout(()=>{scrollLockTimer$1&&clearTimeout(scrollLockTimer$1),scrollLock.disablePageScroll(e.detail,{allowTouchMove:el=>el.tagName==="TEXTAREA"}),document.documentElement.setAttribute("data-scroll-locked","")})}function unlock(e){const timeout=e.detail;timeout?scrollLockTimer$1=setTimeout(removeScrollLock,timeout):removeScrollLock()}function removeScrollLock(){document.body.classList.contains(classe
12s$V.quickViewVisible)||document.body.classList.contains(classes$V.cartDrawerOpen)||(scrollLock.clearQueueScrollLocks(),scrollLock.enablePageScroll(),document.documentElement.removeAttribute("data-scroll-locked"))}function scrollListener(){let timeout;window.addEventListener("scroll",function(){timeout&&window.cancelAnimationFrame(timeout),timeout=window.requestAnimationFrame(function(){dispatchScrollEvent()})},{passive:!0}),window.addEventListener("theme:scroll:lock",lock),window.addEventListener("theme:scroll:unlock",unlock)}const wrap=(toWrap,wrapperClass="",wrapperOption)=>{const wrapper=wrapperOption||document.createElement("div");return wrapper.classList.add(wrapperClass),wrapper.setAttribute("data-scroll-lock-scrollable",""),toWrap.parentNode.insertBefore(wrapper,toWrap),wrapper.appendChild(toWrap)};function wrapElements(container){container.querySelectorAll("table").forEach(table=>{wrap(table,"table-wrapper")})}function isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function isTouch(){isTouchDevice()?(document.documentElement.className=document.documentElement.className.replace("no-touch","supports-touch"),window.theme.touch=!0):window.theme.touch=!1}function loading(){document.documentElement.classList.remove("is-loading"),document.documentElement.classList.add("is-loaded")}const classes$U={loading:"is-loading"},selectors$15={img:"img.is-loading"};function loadedImagesEventHook(){document.addEventListener("load",e=>{e.target.tagName=="IMG"&&e.target.classList.contains(classes$U.loading)&&(e.target.classList.remove(classes$U.loading),e.target.parentNode.classList.remove(classes$U.loading))},!0)}function removeLoadingClassFromLoadedImages(container){container.querySelectorAll(selectors$15.img).forEach(img=>{img.complete&&(img.classList.remove(classes$U.loading),img.parentNode.classList.remove(classes$U.loading))})}const selectors$14={inputSearch:'input[type="search"]',inputType:'input[name="type"]',form:"form",allVisibleElements:'[role="option"]',ariaSelected:'[aria-selected="true"]',selectedOption:'[aria-selected="true"] a, button[aria-selected="true"]',popularSearches:"[data-popular-searches]",popdownBody:"[data-popdown-body]",mainInputSearch:"[data-main-input-search]",predictiveSearchResults:"[data-predictive-search-results]",predictiveSearch:"predictive-search",searchForm:"search-form"},classes$T={isSearched:"is-searched",templateSearch:"template-search"};class SearchForm extends HTMLElement{constructor(){super(),this.input=this.querySelector(selectors$14.inputSearch),this.form=this.querySelector(selectors$14.form),this.popdownBody=this.closest(selectors$14.popdownBody),this.popularSearches=this.popdownBody?.querySelector(selectors$14.popularSearches),this.predictiveSearchResults=this.querySelector(selectors$14.predictiveSearchResults),this.predictiveSearch=this.matches(selectors$14.predictiveSearch),this.searchForm=this.matches(selectors$14.searchForm),this.selectedElement=null,this.activeElement=null,this.searchTerm="",this.currentSearchTerm="",this.isSearchPage=document.body.classList.contains(classes$T.templateSearch),this.input.addEventListener("input",debounce(event=>{this.onChange(event)},300).bind(this)),this.input.addEventListener("focus",this.onFocus.bind(this)),this.input.form.addEventListener("submit",this.onFormSubmit.bind(this)),this.addEventListener("keyup",this.onKeyup.bind(this)),this.addEventListener("keydown",this.onKeydown.bind(this)),this.isSearchPage&&(this.mainInputType=document.querySelector(`${selectors$14.mainInputSearch} ${selectors$14.inputType}`),this.inputType=this.querySelector(selectors$14.inputType),this.inputType.value=this.mainInputType.value)}getQuery(){return this.input.value.trim()}onFocus(){this.currentSearchTerm=this.getQuery()}onChange(){this.classList.toggle(classes$T.isSearched,!this.isFormCleared()),this.searchTerm=this.getQuery()}isFormCleared(){return this.input.value.length===0}submit(){this.form.submit()}reset(){this.input.val=""}onFormSubmit(event){(!this.getQuery().length||this.querySelector(selectors$14.selectedLink))&&event.preventDefault()}onKeydown(event){(event.code==="ArrowUp"||event.code==="ArrowDown")&&event.preventDefault()}onKeyup(event){switch(!this.getQuery().length&&this.predictiveSearch&&this.close(!0),event.preventDefault(),event.code){case"ArrowUp":this.switchOption("up");break;case"ArrowDown":this.switchOption("down");break;case"Enter":this.selectOption();break}}switchOption(direction){const moveUp=direction==="up",visibleElementsContainer=this.classList.contains(classe
12s$T.isSearched)&&this.predictiveSearchResults?this.predictiveSearchResults:this.popularSearches;if(!visibleElementsContainer)return;this.selectedElement=visibleElementsContainer.querySelector(selectors$14.ariaSelected);const allVisibleElements=Array.from(visibleElementsContainer.querySelectorAll(selectors$14.allVisibleElements)).filter(element=>element.offsetParent!==null);let activeElementIndex=0;if(moveUp&&!this.selectedElement)return;let selectedElementIndex=-1,i=0;for(;selectedElementIndex===-1&&i<=allVisibleElements.length;)allVisibleElements[i]===this.selectedElement&&(selectedElementIndex=i),i++;!moveUp&&this.selectedElement?activeElementIndex=selectedElementIndex===allVisibleElements.length-1?0:selectedElementIndex+1:moveUp&&(activeElementIndex=selectedElementIndex===0?allVisibleElements.length-1:selectedElementIndex-1),activeElementIndex!==selectedElementIndex&&(this.activeElement=allVisibleElements[activeElementIndex],this.handleFocusableDescendants())}selectOption(){const selectedOption=this.querySelector(selectors$14.selectedOption);selectedOption&&selectedOption.click()}handleFocusableDescendants(reset=!1){const selected=this.selectedElement?this.selectedElement:this.querySelector(selectors$14.ariaSelected);if(selected&&selected.setAttribute("aria-selected",!1),!this.activeElement||reset){this.selectedElement=null,this.activeElement?.setAttribute("aria-selected",!1),this.input.setAttribute("aria-expanded",!1),this.input.setAttribute("aria-activedescendant","");return}this.activeElement.setAttribute("aria-selected",!0),this.input.setAttribute("aria-activedescendant",this.activeElement.id)}}customElements.define("search-form",SearchForm);const selectors$13={predictiveSearch:"predictive-search",sectionPredictiveSearch:"#shopify-section-api-predictive-search",predictiveSearchResults:"[data-predictive-search-results]",predictiveSearchStatus:"[data-predictive-search-status]",searchResultsLiveRegion:"[data-predictive-search-live-region-count-value]",searchResultsWrapper:"[data-search-results-wrapper]"},classes$S={reset:"reset"};class PredictiveSearch extends SearchForm{constructor(){super(),this.abortController=new AbortController,this.allPredictiveSearchInstances=document.querySelectorAll(selectors$13.predictiveSearch),this.predictiveSearchResults=this.querySelector(selectors$13.predictiveSearchResults),this.cachedResults={}}connectedCallback(){this.predictiveSearchResults.addEventListener("transitionend",event=>{event.target===this.predictiveSearchResults&&!this.getQuery().length&&(this.classList.remove(classes$S.reset),requestAnimationFrame(()=>this.clearResultsHTML()))})}onChange(){if(super.onChange(),this.classList.remove(classes$S.reset),!this.searchTerm.length){this.classList.add(classes$S.reset);return}requestAnimationFrame(()=>this.getSearchResults(this.searchTerm))}onFocus(){super.onFocus(),this.currentSearchTerm.length&&(this.searchTerm!==this.currentSearchTerm?this.onChange():this.getAttribute("results")==="true"?this.open():this.getSearchResults(this.searchTerm))}getSearchResults(searchTerm){const queryKey=searchTerm.replace(" ","-").toLowerCase(),suggestionsResultsLimit=parseInt(window.theme.settings.suggestionsResultsLimit);let resources="query";if(resources+=window.theme.settings.suggestArticles?",article":"",resources+=window.theme.settings.suggestCollections?",collection":"",resources+=window.theme.settings.suggestProducts?",product":"",resources+=window.theme.settings.suggestPages?",page":"",this.setLiveRegionLoadingState(),this.cachedResults[queryKey]){this.renderSearchResults(this.cachedResults[queryKey]);return}fetch(`${theme.routes.predictiveSearchUrl}?q=${encodeURIComponent(searchTerm)}&resources[type]=${resources}&resources[limit]=${suggestionsResultsLimit}§ion_id=api-predictive-search`,{signal:this.abortController.signal}).then(response=>{if(!response.ok){var error=new Error(response.status);throw this.close(),error}return response.text()}).then(text=>{const resultsMarkup=new DOMParser().parseFromString(text,"text/html").querySelector(selectors$13.sectionPredictiveSearch).innerHTML;
12this.allPredictiveSearchInstances.forEach(predictiveSearchInstance=>{predictiveSearchInstance.cachedResults[queryKey]=resultsMarkup}),this.renderSearchResults(resultsMarkup)}).catch(error=>{if(error?.code!==20)throw this.close(),error})}switchOption(direction){super.switchOption(direction),this.statusElement&&(this.statusElement.textContent="")}setLiveRegionLoadingState(){this.statusElement=this.statusElement||this.querySelector(selectors$13.predictiveSearchStatus),this.loadingText=this.loadingText||this.getAttribute("data-loading-text"),this.setLiveRegionText(this.loadingText),this.setAttribute("loading",!0)}setLiveRegionText(statusText){this.statusElement.setAttribute("aria-hidden","false"),this.statusElement.textContent=statusText,setTimeout(()=>{this.statusElement.setAttribute("aria-hidden","true")},1e3)}renderSearchResults(resultsMarkup){this.predictiveSearchResults.innerHTML=resultsMarkup,this.setAttribute("results",!0),this.setLiveRegionResults(),this.open()}setLiveRegionResults(){this.removeAttribute("loading"),this.setLiveRegionText(this.querySelector(selectors$13.searchResultsLiveRegion).textContent)}open(){this.setAttribute("open",!0)}close(clearSearchTerm=!1){this.closeResults(clearSearchTerm)}closeResults(clearSearchTerm=!1){clearSearchTerm&&(this.reset(),this.removeAttribute("results"),this.classList.remove(classes$S.reset)),this.removeAttribute("loading"),this.removeAttribute("open")}clearResultsHTML(){this.predictiveSearchResults.innerHTML=""}}customElements.define("predictive-search",PredictiveSearch),window.requestIdleCallback=window.requestIdleCallback||function(cb){var start=Date.now();return setTimeout(function(){cb({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-start))}})},1)},window.cancelIdleCallback=window.cancelIdleCallback||function(id){clearTimeout(id)},resizeListener(),scrollListener(),isTouch(),loadedImagesEventHook();const headerFunctions=debounce(()=>{initTransparentHeader()},300);window.addEventListener("DOMContentLoaded",()=>{setVarsOnResize(),preventOverflow(document),wrapElements(document),removeLoadingClassFromLoadedImages(document),loading(),window.fastNetworkAndCPU&&preloadImages()}),document.addEventListener("shopify:section:load",e=>{const container=e.target;window.dispatchEvent(new Event("resize"),{bubbles:!0}),preventOverflow(container),wrapElements(container),setVarsOnResize(),headerFunctions()}),document.addEventListener("shopify:section:reorder",()=>{headerFunctions()}),document.addEventListener("shopify:section:unload",()=>{headerFunctions()}),(function(){function n(n2){var i2=window.innerWidth||document.documentElement.clientWidth,r2=window.innerHeight||document.documentElement.clientHeight,t2=n2.getBoundingClientRect();return t2.top>=0&&t2.bottom<=r2&&t2.left>=0&&t2.right<=i2}function t(n2){var i2=window.innerWidth||document.documentElement.clientWidth,r2=window.innerHeight||document.documentElement.clientHeight,t2=n2.getBoundingClientRect(),u=t2.left>=0&&t2.left<=i2||t2.right>=0&&t2.right<=i2,f=t2.top>=0&&t2.top<=r2||t2.bottom>=0&&t2.bottom<=r2;return u&&f}function i(n2,i2){function r2(){var r3=t(n2);r3!=u&&(u=r3,typeof i2=="function"&&i2(r3,n2))}var u=t(n2);window.addEventListener("load",r2),window.addEventListener("resize",r2),window.addEventListener("scroll",r2)}function r(t2,i2){function r2(){var r3=n(t2);r3!=u&&(u=r3,typeof i2=="function"&&i2(r3,t2))}var u=n(t2);window.addEventListener("load",r2),window.addEventListener("resize",r2),window.addEventListener("scroll",r2)}window.visibilityHelper={isElementTotallyVisible:n,isElementPartiallyVisible:t,inViewportPartially:i,inViewportTotally:r}})(),window.Shopify=window.Shopify||{},window.Shopify.theme=window.Shopify.theme||{},window.Shopify.theme.sections=window.Shopify.theme.sections||{},window.Shopify.theme.sections.registered=window.Shopify.theme.sections.registered||{},window.Shopify.theme.sections.instances=window.Shopify.theme.sections.instances||[];const registered=window.Shopify.theme.sections.registered,instances=window.Shopify.theme.sections.instances,attributes$I={id:"data-section-id",type:"data-section-type"};class Registration{constructor(type=null,components=[]){this.type=type,this.components=validateComponentsArray(components),this.callStack={onLoad:[],onUnload:[],onSelect:[],onDeselect:[],onBlockSelect:[],onBlockDeselect:[],onReorder:[]}
12,components.forEach(comp=>{for(const[key,value]of Object.entries(comp)){const arr=this.callStack[key];Array.isArray(arr)&&typeof value=="function"?arr.push(value):(console.warn(`Unregisted function: '${key}' in component: '${this.type}'`),console.warn(value))}})}getStack(){return this.callStack}}class Section{constructor(container,registration){this.container=validateContainerElement(container),this.id=container.getAttribute(attributes$I.id),this.type=registration.type,this.callStack=registration.getStack();try{this.onLoad()}catch(e){console.warn(`Error in section: ${this.id}`),console.warn(this),console.warn(e)}}callFunctions(key,e=null){this.callStack[key].forEach(func=>{const props={id:this.id,type:this.type,container:this.container};e?func.call(props,e):func.call(props)})}onLoad(){this.callFunctions("onLoad")}onUnload(){this.callFunctions("onUnload")}onSelect(e){this.callFunctions("onSelect",e)}onDeselect(e){this.callFunctions("onDeselect",e)}onBlockSelect(e){this.callFunctions("onBlockSelect",e)}onBlockDeselect(e){this.callFunctions("onBlockDeselect",e)}onReorder(e){this.callFunctions("onReorder",e)}}function validateContainerElement(container){if(!(container instanceof Element))throw new TypeError("Theme Sections: Attempted to load section. The section container provided is not a DOM element.");if(container.getAttribute(attributes$I.id)===null)throw new Error("Theme Sections: The section container provided does not have an id assigned to the "+attributes$I.id+" attribute.");return container}function validateComponentsArray(value){if(typeof value<"u"&&typeof value!="object"||value===null)throw new TypeError("Theme Sections: The components object provided is not a valid");return value}function register(type,components){if(typeof type!="string")throw new TypeError("Theme Sections: The first argument for .register must be a string that specifies the type of the section being registered");if(typeof registered[type]<"u")throw new Error('Theme Sections: A section of type "'+type+'" has already been registered. You cannot register the same section type twice');Array.isArray(components)||(components=[components]);const section=new Registration(type,components);return registered[type]=section,registered}function load(types,containers){types=normalizeType(types),typeof containers>"u"&&(containers=document.querySelectorAll("["+attributes$I.type+"]")),containers=normalizeContainers(containers),types.forEach(function(type){const registration=registered[type];typeof registration>"u"||(containers=containers.filter(function(container){return isInstance(container)||container.getAttribute(attributes$I.type)===null?!1:container.getAttribute(attributes$I.type)!==type?!0:(instances.push(new Section(container,registration)),!1)}))})}function reorder(selector){var instancesToReorder=getInstances(selector);instancesToReorder.forEach(function(instance){instance.onReorder()})}function unload(selector){var instancesToUnload=getInstances(selector);instancesToUnload.forEach(function(instance){var index=instances.map(function(e){return e.id}).indexOf(instance.id);instances.splice(index,1),instance.onUnload()})}function getInstances(selector){var filteredInstances=[];if(NodeList.prototype.isPrototypeOf(selector)||Array.isArray(selector))var firstElement=selector[0];if(selector instanceof Element||firstElement instanceof Element){var containers=normalizeContainers(selector);containers.forEach(function(container){filteredInstances=filteredInstances.concat(instances.filter(function(instance){return instance.container===container}))})}else if(typeof selector=="string"||typeof firstElement=="string"){var types=normalizeType(selector);types.forEach(function(type){filteredInstances=filteredInstances.concat(instances.filter(function(instance){return instance.type===type}))})}return filteredInstances}function getInstanceById(id){for(var instance,i=0;i<instances.length;i++)if(instances[i].id===id){instance=instances[i];break}return instance}function isInstance(selector){return getInstances(selector).length>0}function normalizeType(types){return types==="*"?types=Object.keys(registered):typeof types=="string"?types=[types]:types.constructor===Section?types=[types.prototype.type]:Array.isArray(types)&&types[0].c
12onstructor===Section&&(types=types.map(function(Section2){return Section2.type})),types=types.map(function(type){return type.toLowerCase()}),types}function normalizeContainers(containers){return NodeList.prototype.isPrototypeOf(containers)&&containers.length>0?containers=Array.prototype.slice.call(containers):NodeList.prototype.isPrototypeOf(containers)&&containers.length===0?containers=[]:containers===null?containers=[]:!Array.isArray(containers)&&containers instanceof Element&&(containers=[containers]),containers}window.Shopify.designMode&&(document.addEventListener("shopify:section:load",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+attributes$I.id+'="'+id+'"]');window.Shopify.visualPreviewMode===!0&&container===null&&(container=event.target.querySelector(`[${attributes$I.id}]`)),container!==null&&load(container.getAttribute(attributes$I.type),container)}),document.addEventListener("shopify:section:reorder",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+attributes$I.id+'="'+id+'"]'),instance=getInstances(container)[0];typeof instance=="object"&&reorder(container)}),document.addEventListener("shopify:section:unload",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+attributes$I.id+'="'+id+'"]'),instance=getInstances(container)[0];typeof instance=="object"&&unload(container)}),document.addEventListener("shopify:section:select",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onSelect(event)}),document.addEventListener("shopify:section:deselect",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onDeselect(event)}),document.addEventListener("shopify:block:select",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onBlockSelect(event)}),document.addEventListener("shopify:block:deselect",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onBlockDeselect(event)}));const throttle=(fn,wait)=>{let prev2,next;return function invokeFn(...args){const now=Date.now();next=clearTimeout(next),!prev2||now-prev2>=wait?(fn.apply(null,args),prev2=now):next=setTimeout(invokeFn.bind(null,...args),wait-(now-prev2))}};function FetchError(object){this.status=object.status||null,this.headers=object.headers||null,this.json=object.json||null,this.body=object.body||null}FetchError.prototype=Error.prototype;const selectors$12={single:"[data-collapsible-single]",trigger:"[data-collapsible-trigger]",content:"[data-collapsible-content]"},classes$R={isExpanded:"is-expanded"},attributes$H={expanded:"aria-expanded",controls:"aria-controls",triggerMobile:"data-collapsible-trigger-mobile",transitionOverride:"data-collapsible-transition-override"},settings$7={animationDelay:500},sections$A={};class Collapsible{constructor(container){this.container=container,this.single=this.container.querySelector(selectors$12.single),this.triggers=this.container.querySelectorAll(selectors$12.trigger),this.resetHeightTimer=0,this.isTransitioning=!1,this.transitionOverride=this.container.hasAttribute(attributes$H.transitionOverride),this.collapsibleToggleEvent=event=>throttle(this.collapsibleToggle(event),1250),this.init()}init(){this.triggers.forEach(trigger=>{trigger.addEventListener("click",this.collapsibleToggleEvent),trigger.addEventListener("keyup",this.collapsibleToggleEvent)})}collapsibleToggle(e){e.preventDefault();const trigger=e.target.matches(selectors$12.trigger)?e.target:e.target.closest(selectors$12.trigger),dropdownId=trigger.getAttribute(attributes$H.controls),dropdown=document.getElementById(dropdownId),triggerMobile=trigger.hasAttribute(attributes$H.triggerMobile),isExpanded=trigger.classList.contains(classes$R.isExpanded),isSpace=e.code===theme.keyboardKeys.SPACE,isEscape=e.code===theme.keyboardKeys.ESCAPE,isMobile=window.innerWidth<theme.sizes.small;this.isTransitioning&&!this.transitionOverride||e.code&&!isSpace&&!isEscape||!isExpanded&&isEscape||triggerMobile&&!isMobile||(this.isTransitioning=!0,trigger.disabled=!0,this.single&&this.triggers.forEac
12h(otherTrigger=>{const isExpanded2=otherTrigger.classList.contains(classes$R.isExpanded);if(trigger==otherTrigger||!isExpanded2)return;const dropdownId2=otherTrigger.getAttribute(attributes$H.controls),dropdown2=document.getElementById(dropdownId2);requestAnimationFrame(()=>{this.closeItem(dropdown2,otherTrigger)})}),requestAnimationFrame(isExpanded?()=>{this.closeItem(dropdown,trigger)}:()=>{this.openItem(dropdown,trigger)}))}openItem(dropdown,trigger){let dropdownHeight=dropdown.querySelector(selectors$12.content).offsetHeight;this.setDropdownHeight(dropdown,dropdownHeight,trigger,!0),trigger.classList.add(classes$R.isExpanded),trigger.setAttribute(attributes$H.expanded,!0),trigger.dispatchEvent(new CustomEvent("theme:form:sticky",{bubbles:!0,detail:{element:"accordion"}}))}closeItem(dropdown,trigger){let dropdownHeight=dropdown.querySelector(selectors$12.content).offsetHeight;requestAnimationFrame(()=>{dropdownHeight=0,this.setDropdownHeight(dropdown,dropdownHeight,trigger,!1),trigger.classList.remove(classes$R.isExpanded)}),this.setDropdownHeight(dropdown,dropdownHeight,trigger,!1),trigger.classList.remove(classes$R.isExpanded),trigger.setAttribute(attributes$H.expanded,!1)}setDropdownHeight(dropdown,dropdownHeight,trigger,isExpanded){dropdown.style.height=`${dropdownHeight}px`,dropdown.setAttribute(attributes$H.expanded,isExpanded),dropdown.classList.toggle(classes$R.isExpanded,isExpanded),this.resetHeightTimer&&clearTimeout(this.resetHeightTimer),dropdownHeight==0&&(this.resetHeightTimer=setTimeout(()=>{dropdown.style.height=""},settings$7.animationDelay)),isExpanded?this.resetHeightTimer=setTimeout(()=>{dropdown.style.height="auto",this.isTransitioning=!1},settings$7.animationDelay):this.isTransitioning=!1,setTimeout(()=>{trigger.disabled=!1},settings$7.animationDelay)}onUnload(){this.triggers.forEach(trigger=>{trigger.removeEventListener("click",this.collapsibleToggleEvent),trigger.removeEventListener("keyup",this.collapsibleToggleEvent)})}}const collapsible={onLoad(){sections$A[this.id]=new Collapsible(this.container)},onUnload(){sections$A[this.id].onUnload()}},selectors$11={quantityHolder:"[data-quantity-holder]",quantityField:"[data-quantity-field]",quantityButton:"[data-quantity-button]",quantityMinusButton:"[data-quantity-minus]",quantityPlusButton:"[data-quantity-plus]"},classes$Q={quantityReadOnly:"read-only",isDisabled:"is-disabled"};class QuantityCounter{constructor(holder,inCart=!1){this.holder=holder,this.quantityUpdateCart=inCart}init(){this.quantity=this.holder.querySelector(selectors$11.quantityHolder),this.quantity&&(this.field=this.quantity.querySelector(selectors$11.quantityField),this.buttons=this.quantity.querySelectorAll(selectors$11.quantityButton),this.increaseButton=this.quantity.querySelector(selectors$11.quantityPlusButton),this.quantityValue=Number(this.field.value||0),this.cartItemID=this.field.getAttribute("data-id"),this.maxValue=Number(this.field.getAttribute("max"))>0?Number(this.field.getAttribute("max")):null,this.minValue=Number(this.field.getAttribute("min"))>0?Number(this.field.getAttribute("min")):0,this.disableIncrease=this.disableIncrease.bind(this),this.emptyField=!1,this.updateQuantity=this.updateQuantity.bind(this),this.decrease=this.decrease.bind(this),this.increase=this.increase.bind(this),this.disableIncrease(),this.quantity.classList.contains(classes$Q.quantityReadOnly)||(this.changeValueOnClick(),this.changeValueOnInput()))}changeValueOnClick(){this.buttons.forEach(element=>{element.addEventListener("click",event=>{event.preventDefault(),this.quantityValue=Number(this.field.value||0);const clickedElement=event.target,isDescrease=clickedElement.matches(selectors$11.quantityMinusButton)||clickedElement.closest(selectors$11.quantityMinusButton),isIncrease=clickedElement.matches(selectors$11.quantityPlusButton)||clickedElement.closest(selectors$11.quantityPlusButton);isDescrease&&this.decrease(),isIncrease&&this.increase(),this.updateQuantity()})})}changeValueOnInput(){this.field.addEventListener("input",()=>{this.quantityValue=this.field.value,this.updateQuantity()})}updateQuantity(){this.maxValue<this.quantityValue&&this.maxValue!==null&&(this.quantityValue=this.maxValue),this.minValue>this.quantityValue&&(this.quantityValue=this.minValue),this.field.value=this.quantityValue,this.disableIncrease(),document.dispatchEvent(new CustomEvent("theme:cart:update")),this.quantityUpdateCart&&this.updateCart()}decrease(){if(this.quantityValue>this.minValue){this.quantityValue--;return}this.quantityValue=0}increase(){this.quantityValue++}disableIncrease(){this.increaseButton.classList.toggle(classes$Q.isDisabled,this.quantityValue>=this.maxValue&&this.maxValue!==null)}updateCart(){if(this.quantityValue==="")return;const event=new CustomEvent("theme:cart:update",{bubbles:!0,detail:{id:this.cartItemID,quantity:this.quantityValue}});
12this.holder.dispatchEvent(event)}}const a11y={state:{firstFocusable:null,lastFocusable:null,trigger:null},trapFocus:function(options2){var focusableElements=Array.from(options2.container.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex^="-"])')).filter(function(element){var width=element.offsetWidth,height=element.offsetHeight;return width!==0&&height!==0&&getComputedStyle(element).getPropertyValue("display")!=="none"});focusableElements=focusableElements.filter(function(element){return!element.classList.contains("deferred-media__poster")}),this.state.firstFocusable=focusableElements[0],this.state.lastFocusable=focusableElements[focusableElements.length-1],options2.elementToFocus||(options2.elementToFocus=this.state.firstFocusable||options2.container),this._setupHandlers(),document.addEventListener("focusin",this._onFocusInHandler),document.addEventListener("focusout",this._onFocusOutHandler),options2.container.setAttribute("tabindex","-1"),options2.elementToFocus.focus()},removeTrapFocus:function(options2){const focusVisible=!document.body.classList.contains("no-outline");options2&&options2.container&&options2.container.removeAttribute("tabindex"),document.removeEventListener("focusin",this._onFocusInHandler),this.state.trigger&&focusVisible&&this.state.trigger.focus()},_manageFocus:function(evt){evt.code===theme.keyboardKeys.TAB&&(evt.target===this.state.lastFocusable&&!evt.shiftKey&&(evt.preventDefault(),this.state.firstFocusable.focus()),evt.target===this.state.firstFocusable&&evt.shiftKey&&(evt.preventDefault(),this.state.lastFocusable.focus()))},_onFocusOut:function(){document.removeEventListener("keydown",this._manageFocusHandler)},_onFocusIn:function(evt){evt.target!==this.state.lastFocusable&&evt.target!==this.state.firstFocusable||document.addEventListener("keydown",this._manageFocusHandler)},_setupHandlers:function(){this._onFocusInHandler||(this._onFocusInHandler=this._onFocusIn.bind(this)),this._onFocusOutHandler||(this._onFocusOutHandler=this._onFocusIn.bind(this)),this._manageFocusHandler||(this._manageFocusHandler=this._manageFocus.bind(this))}};function getScript(url,callback,callbackError){let head=document.getElementsByTagName("head")[0],done=!1,script=document.createElement("script");script.src=url,script.onload=script.onreadystatechange=function(){!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")?(done=!0,callback()):callbackError()},head.appendChild(script)}const loaders={};window.isYoutubeAPILoaded=!1,window.isVimeoAPILoaded=!1;function loadScript(options2={}){if(options2.type||(options2.type="json"),options2.url)return loaders[options2.url]?loaders[options2.url]:getScriptWithPromise(options2.url,options2.type);if(options2.json)return loaders[options2.json]?Promise.resolve(loaders[options2.json]):window.fetch(options2.json).then(response=>response.json()).then(response=>(loaders[options2.json]=response,response));if(options2.name){const key="".concat(options2.name,options2.version);return loaders[key]?loaders[key]:loadShopifyWithPromise(options2)}else return Promise.reject()}function getScriptWithPromise(url,type){const loader=new Promise((resolve,reject)=>{type==="text"?fetch(url).then(response=>response.text()).then(data=>{resolve(data)}).catch(error=>{reject(error)}):getScript(url,function(){resolve()},function(){reject()})});return loaders[url]=loader,loader}function loadShopifyWithPromise(options2){const key="".concat(options2.name,options2.version),loader=new Promise((resolve,reject)=>{try{window.Shopify.loadFeatures([{name:options2.name,version:options2.version,onLoad:err=>{onLoadFromShopify(resolve,reject,err)}}])}catch(err){reject(err)}});return loaders[key]=loader,loader}function onLoadFromShopify(resolve,reject,err){return err?reject(err):resolve()}const selectors$10={videoIframe:"[data-video-id]"},classes$P={loaded:"loaded"},attributes$G={dataEnableSound:"data-enable-sound",dataEnableBackground:"data-enable-background",dataEnableAutoplay:"data-enable-autoplay",dataEnableLoop:"data-enable-loop",dataVideoId:"data-video-id",dataVideoType:"data-video-type"};class LoadVideoVimeo{constructor(container){this.container=container,this.player=this.container.querySelector(selectors$10.videoIframe),this.player&&(this.videoID=this.player.getAttribute(attributes$G.dataVideoId),this.videoType=this.player.getAttribute(attributes$G.dataVideoType),this.enableBackgroun
12d=this.player.getAttribute(attributes$G.dataEnableBackground)==="true",this.disableSound=this.player.getAttribute(attributes$G.dataEnableSound)==="false",this.enableAutoplay=this.player.getAttribute(attributes$G.dataEnableAutoplay)!=="false",this.enableLoop=this.player.getAttribute(attributes$G.dataEnableLoop)!=="false",this.videoType=="vimeo"&&this.init())}init(){this.loadVimeoPlayer()}loadVimeoPlayer(){const oembedUrl="https://vimeo.com/api/oembed.json",vimeoUrl="https://vimeo.com/"+this.videoID;let paramsString="";const state=this.player,params={url:vimeoUrl,background:this.enableBackground,muted:this.disableSound,autoplay:this.enableAutoplay,loop:this.enableLoop};for(let key in params)paramsString+=encodeURIComponent(key)+"="+encodeURIComponent(params[key])+"&";fetch(`${oembedUrl}?${paramsString}`).then(response=>response.json()).then(function(data){state.innerHTML=data.html,setTimeout(function(){state.parentElement.classList.add(classes$P.loaded)},1e3)}).catch(function(){console.log("error")})}}const selectors$$={videoIframe:"[data-video-id]",videoWrapper:".video-wrapper",youtubeWrapper:"[data-youtube-wrapper]"},attributes$F={dataSectionId:"data-section-id",dataEnableSound:"data-enable-sound",dataHideOptions:"data-hide-options",dataCheckPlayerVisibility:"data-check-player-visibility",dataVideoId:"data-video-id",dataVideoType:"data-video-type"},classes$O={loaded:"loaded"},players=[];class LoadVideoYT{constructor(container){this.container=container,this.player=this.container.querySelector(selectors$$.videoIframe),this.player&&(this.videoOptionsVars={},this.videoID=this.player.getAttribute(attributes$F.dataVideoId),this.videoType=this.player.getAttribute(attributes$F.dataVideoType),this.videoType=="youtube"&&(this.checkPlayerVisibilityFlag=this.player.getAttribute(attributes$F.dataCheckPlayerVisibility)==="true",this.playerID=this.player.querySelector(selectors$$.youtubeWrapper)?this.player.querySelector(selectors$$.youtubeWrapper).id:this.player.id,this.player.hasAttribute(selectors$$.dataHideOptions)&&(this.videoOptionsVars={cc_load_policy:0,iv_load_policy:3,modestbranding:1,playsinline:1,autohide:0,controls:0,branding:0,showinfo:0,rel:0,fs:0,wmode:"opaque"}),this.init(),this.container.addEventListener("touchstart",function(e){if(e.target.matches(selectors$$.videoWrapper)||e.target.closest(selectors$$.videoWrapper)){const playerID=e.target.querySelector(selectors$$.videoIframe).id;players[playerID].playVideo()}},{passive:!0})))}init(){window.isYoutubeAPILoaded?this.loadYoutubePlayer():loadScript({url:"https://www.youtube.com/iframe_api"}).then(()=>this.loadYoutubePlayer())}loadYoutubePlayer(){const currentYoutubeOptions={...{height:"720",width:"1280",playerVars:this.videoOptionsVars,events:{onReady:event=>{const eventIframe=event.target.getIframe(),id=eventIframe.id,enableSound=document.querySelector(`#${id}`).getAttribute(attributes$F.dataEnableSound)==="true";eventIframe.setAttribute("tabindex","-1"),enableSound?event.target.unMute():event.target.mute(),event.target.playVideo(),this.checkPlayerVisibilityFlag&&(this.checkPlayerVisibility(id),window.addEventListener("scroll",throttle(()=>{this.checkPlayerVisibility(id)},150)))},onStateChange:event=>{event.data==0&&event.target.playVideo(),event.data==1&&event.target.getIframe().parentElement.classList.add(classes$O.loaded)}}}};currentYoutubeOptions.videoId=this.videoID,this.videoID.length&&YT.ready(()=>{players[this.playerID]=new YT.Player(this.playerID,currentYoutubeOptions)}),window.isYoutubeAPILoaded=!0}checkPlayerVisibility(id){let playerID;if(typeof id=="string")playerID=id;else if(id.data!=null)playerID=id.data.id;else return;const playerElement=document.getElementById(playerID+"-container");if(!playerElement)return;const player=players[playerID],box=playerElement.getBoundingClientRect();let isVisible=visibilityHelper.isElementPartiallyVisible(playerElement)||visibilityHelper.isElementTotallyVisible(playerElement);box.top<0&&playerElement.clientHeight+box.top>=0&&(isVisible=!0),isVisible&&player&&typeof player.playVideo=="function"?player.playVideo():!isVisible&&player&&typeof player.pauseVideo=="function"&&player.pauseVideo()}onUnload(){const playerID="youtube-"+this.container.getAttribute(attributes$F.dataSectionId);players[playerID]&&players[playerID].destroy()}}const selectors$_={notificationForm:"[data-notification-form]",notification:"[data-notification]",popupClose:"[data-popup-close]"},classes$N={popupSuccess:"pswp--success",notificationPopupVisible:"notification-popup-visible"};class LoadNotification{constructor(popup,pswpElement){this.popup=popup,this.pswpElement=pswpElement,this.notificationForm=null,this.notificationStopSubmit=!0,this.sessionStorage=window.sessionStorage;const notificationWrapper=this.pswpElement.querySelector(selectors$_.notification);this.outerCloseEvent=e=>{notificationWrapper.contains(e.target)||this.popup.close()},this.init()}init(){this.popup.listen("preventDragEvent",(e,isDown,preventObj)=>{preventObj.prevent=!1});const notificationFormSuccess=window.location.search.indexOf("?customer_posted=true")!==-1;this.notificationForm=this.pswpElement.querySelector(selectors$_.notificationForm);const closeBtn=this.pswpElement.querySelector(selectors$_.popupClose);document.body.classList.add(classes$N.notificationPopupVisible),this.pswpElement.addEventListener("mousedown",()=>{this.popup.framework.unbind(window,"pointermove pointerup pointercancel",this.popup)}),notificationFormSuccess&&this.pswpElement.classList.add(classes$N.popupSuccess),this.notificationForm.addEventListener("submit",e=>this.notificationSubmitEvent(e)),this.pswpElement.addEventListener("click",this.outerCloseEvent),closeBtn.addEventListener("click",()=>{this.popup.close()}),this.popup.listen("destroy",()=>{this.notificationRemoveStorage(),this.pswpElement.removeEventListener("click",this.outerCloseEvent),document.body.classList.remove(classes$N.notificationPopupVisible)})}notificationSubmitEvent(e){this.notificationStopSubmit&&(e.preventDefault(),this.notificationRemoveStorage(),this.notificationWriteStorage(),this.notificationStopSubmit=!1,this.notificationForm.submit())}notificationWriteStorage(){this.sessionStorage!==void 0&&this.sessionStorage.setItem("notification_form_id",this.notificationForm.id)}notificationRemoveStorage(){this.sessionStorage.removeItem("notification_form_id")}}function flickitySmoothScrolling(slider2){const flkty=Flickity.data(slider2);flkty&&(flkty.on("dragStart",(event,pointer)=>{document.ontouchmove=function(e){e.preventDefault()}}),flkty.on("dragEnd",(event,pointer)=>{document.ontouchmove=function(e){return!0}}))}const hosts={html5:"html5",youtube:"youtube",vimeo:"vimeo"},selectors$Z={deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]",productMediaWrapper:"[data-product-single-media-wrapper]",mediaContainer:"[data-vi
12deo]",mediaHidden:".media--hidden"},classes$M={mediaHidden:"media--hidden"},attributes$E={loaded:"loaded",sectionId:"data-section-id",dataAutoplayVideo:"data-autoplay-video",mediaId:"data-media-id"};class ProductVideo{constructor(container){this.container=container,this.id=this.container.getAttribute(attributes$E.sectionId),this.autoplayVideo=this.container.getAttribute(attributes$E.dataAutoplayVideo)==="true",this.players={},this.pauseContainerMedia=(mediaId,container2=this.container)=>this.pauseOtherMedia(mediaId,container2),this.init()}init(){this.container.querySelectorAll(selectors$Z.mediaContainer).forEach(mediaContainer=>{const deferredMediaButton=mediaContainer.querySelector(selectors$Z.deferredMediaButton);deferredMediaButton&&deferredMediaButton.addEventListener("click",this.loadContent.bind(this,mediaContainer)),this.autoplayVideo&&this.loadContent(mediaContainer)})}loadContent(mediaContainer){if(mediaContainer.querySelector(selectors$Z.deferredMedia).getAttribute(attributes$E.loaded))return;const content=document.createElement("div");content.appendChild(mediaContainer.querySelector("template").content.firstElementChild.cloneNode(!0));const mediaId=mediaContainer.dataset.mediaId,element=content.querySelector("video, iframe"),host=this.hostFromVideoElement(element),deferredMedia=mediaContainer.querySelector(selectors$Z.deferredMedia);deferredMedia.appendChild(element),deferredMedia.setAttribute("loaded",!0),this.players[mediaId]={mediaId,sectionId:this.id,c
12ontainer:mediaContainer,element,host,ready:()=>{this.createPlayer(mediaId)}};const video=this.players[mediaId];switch(video.host){case hosts.html5:this.loadVideo(video,hosts.html5);break;case hosts.vimeo:window.isVimeoAPILoaded?this.loadVideo(video,hosts.vimeo):loadScript({url:"https://player.vimeo.com/api/player.js"}).then(()=>this.loadVideo(video,hosts.vimeo));break;case hosts.youtube:window.isYoutubeAPILoaded?this.loadVideo(video,hosts.youtube):loadScript({url:"https://www.youtube.com/iframe_api"}).then(()=>this.loadVideo(video,hosts.youtube));break}}hostFromVideoElement(video){if(video.tagName==="VIDEO")return hosts.html5;if(video.tagName==="IFRAME"){if(/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(video.src))return hosts.youtube;if(video.src.includes("vimeo.com"))return hosts.vimeo}return null}loadVideo(video,host){video.host===host&&video.ready()}createPlayer(mediaId){const video=this.players[mediaId];switch(video.host){case hosts.html5:video.element.addEventListener("play",()=>{video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})}),video.element.addEventListener("pause",()=>{video.container.dispatchEvent(new CustomEvent("theme:media:pause"),{bubbles:!0})}),this.autoplayVideo&&this.observeVideo(video,mediaId);break;case hosts.vimeo:video.player=new Vimeo.Player(video.element),video.player.play(),video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0}),window.isVimeoAPILoaded=!0,video.player.on("play",()=>{video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})}),video.player.on("pause",()=>{video.container.dispatchEvent(new CustomEvent("theme:media:pause"),{bubbles:!0})}),this.autoplayVideo&&this.observeVideo(video,mediaId);break;case hosts.youtube:if(video.host==hosts.youtube&&video.player)return;YT.ready(()=>{const videoId=video.container.dataset.videoId;video.player=new YT.Player(video.element,{videoId,events:{onReady:event=>{event.target.playVideo(),video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})},onStateChange:event=>{event.data==1&&video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0}),event.data==2&&video.container.dispatchEvent(new CustomEvent("theme:media:pause"),{bubbles:!0}),event.data==0&&video.container.dispatchEvent(new CustomEvent("theme:media:pause"),{bubbles:!0})}}}),window.isYoutubeAPILoaded=!0,this.autoplayVideo&&this.observeVideo(video,mediaId)});break}video.container.addEventListener("theme:media:visible",event=>this.onVisible(event)),video.container.addEventListener("theme:media:hidden",event=>this.onHidden(event)),video.container.addEventListener("xrLaunch",event=>this.onHidden(event))}observeVideo(video){new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{const outsideViewport=entry.intersectionRatio==0,isVisible=!video.element.closest(selectors$Z.mediaHidden);outsideViewport?this.pauseVideo(video):isVisible&&this.playVideo(video)})},{rootMargin:"200px",threshold:[0,.25,.75,1]}).observe(video.element)}playVideo(video){video.player&&video.player.playVideo?video.player.playVideo():video.element&&video.element.play?video.element.play():video.player&&video.player.play&&video.player.play(),video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})}pauseVideo(video){video.player&&video.player.pauseVideo?video.player.playerInfo.playerState=="1"&&video.player.pauseVideo():video.player&&video.player.pause?video.player.pause():video.element&&!video.element.paused&&video.element?.pause()}onHidden(event){if(typeof event.target.dataset.mediaId<"u"){const mediaId=event.target.dataset.mediaId,video=this.players[mediaId];this.pauseVideo(video)}}onVisible(event){if(typeof event.target.dataset.mediaId<"u"){const mediaId=event.target.dataset.mediaId,video=this.players[mediaId];setTimeout(()=>{this.playVideo(video)},50),this.pauseContainerMedia(mediaId)}}pauseOtherMedia(mediaId,container){const currentMedia=`[${attributes$E.mediaId}="${mediaId}"]`,otherMedia=container.querySelectorAll(`${selectors$Z.productMediaWrapper}:not(${currentMedia})`);
12otherMedia.length&&otherMedia.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes$M.mediaHidden)})}}function getSearchParams(searchForm,filtersForm,deleteParams=[],type=!1){const searchFormData=new FormData(searchForm),searchFormParams=new URLSearchParams(searchFormData);if(!filtersForm)return searchFormParams.toString();const filtersFormData=new FormData(filtersForm),filtersFormParams=new URLSearchParams(filtersFormData),emptyParams=[];for(const pair of searchFormData.entries())pair[1]===""&&emptyParams.push(pair[0]);for(const pair of filtersFormData.entries())pair[1]===""&&emptyParams.push(pair[0]);for(let index=0;index<emptyParams.length;index++){const param=emptyParams[index];searchFormParams.has(param)&&searchFormParams.delete(param),filtersFormParams.has(param)&&filtersFormParams.delete(param)}for(const key of searchFormParams.keys())filtersFormParams.has(key)&&filtersFormParams.delete(key);if(deleteParams.length>0)for(let index=0;index<deleteParams.length;index++){const param=deleteParams[index];searchFormParams.has(param)&&searchFormParams.delete(param),filtersFormParams.has(param)&&filtersFormParams.delete(param)}return type&&(filtersFormParams.has("type")&&filtersFormParams.delete("type"),searchFormParams.set("type",type)),`${searchFormParams.toString()}&${filtersFormParams.toString()}`}const selectors$Y={scrollbar:"[data-custom-scrollbar]",scrollbarItems:"[data-custom-scrollbar-items]",scrollbarThumb:"[data-custom-scrollbar-thumb]",current:".current"};class CustomScrollbar{constructor(container){this.container=container,this.scrollbarItems=container.querySelector(selectors$Y.scrollbarItems),this.scrollbar=container.querySelector(selectors$Y.scrollbar),this.scrollbarThumb=container.querySelector(selectors$Y.scrollbarThumb),this.trackWidth=0,this.calcScrollbarEvent=()=>this.calculateScrollbar(),this.onScrollbarChangeEvent=e=>this.onScrollbarChange(e),this.scrollbar&&this.scrollbarItems&&(this.events(),this.calculateScrollbar(),this.scrollbarItems.children.length&&this.calculateTrack(this.scrollbarItems.querySelector(selectors$Y.current)))}calculateTrack(element){if(!element){this.scrollbar.style.setProperty("--thumb-scale",0),this.scrollbar.style.setProperty("--thumb-position","0px");return}const thumbScale=element.clientWidth/this.scrollbarThumb.parentElement.clientWidth,thumbPosition=element.offsetLeft/this.scrollbarThumb.parentElement.clientWidth;this.scrollbar.style.setProperty("--thumb-scale",thumbScale),this.scrollbar.style.setProperty("--thumb-position",`${this.trackWidth*thumbPosition}px`)}calculateScrollbar(){if(this.scrollbarItems.children.length){const childrenArr=[...this.scrollbarItems.children];this.trackWidth=0,childrenArr.forEach(element=>{this.trackWidth+=element.getBoundingClientRect().width+parseInt(window.getComputedStyle(element).marginRight)}),this.scrollbar.style.setProperty("--track-width",`${this.trackWidth}px`)}}onScrollbarChange(e){e&&e.detail&&e.detail.element&&this.container.contains(e.detail.element)&&this.calculateTrack(e.detail.element)}events(){document.addEventListener("theme:resize:width",this.calcScrollbarEvent),document.addEventListener("theme:custom-scrollbar:change",this.onScrollbarChangeEvent)}unload(){document.removeEventListener("theme:resize:width",this.calcScrollbarEvent),document.removeEventListener("theme:custom-scrollbar:change",this.onScrollbarChangeEvent)}}const selectors$X={tooltip:"[data-tooltip]",tooltipContainer:"[data-tooltip-container]",tooltipArrow:"[data-tooltip-arrow]",aos:"[data-aos]"},classes$L={root:"tooltip-default",isAnimating:"is-animating",visible:"is-visible",hiding:"is-hiding"},attributes$D={tooltip:"data-tooltip",tooltipContainer:"data-tooltip-container",tooltipStopMouseEnter:"data-tooltip-stop-mouseenter"},sections$z={};class Tooltip{constructor(el){this.tooltip=el,this.tooltip.hasAttribute(attributes$D.tooltip)&&(this.rootClass=classes$L.root,this.isAnimatingClass=classes$L.isAnimating,this.label=this.tooltip.getAttribute(attributes$D.tooltip),this.transitionSpeed=200,this.hideTransitionTimeout=0,this.animatedContainer=this.tooltip.closest(selectors$X.aos),this.addPinEvent=()=>this.addPin(),this.addPinMouseEvent=()=>this.addPin(!0),this.removePinEvent=event=>throttle(this.removePin(event),50),this.removePinMouseEvent=event=>this.removePin(event,!0,!0),this.init())}init(){if(!document.querySelector(selectors$X.tooltipContainer)){const tooltipTemplate=`<div class="${this.rootClass}__inner"><div class="${this.rootClass}__arrow" data-tooltip-arrow></div><div class="${this.rootClass}__text"></div></div>`,tooltipElement=document.createElement("div");tooltipElement.className=`${this.rootClass} ${this.isAnimatingClass}`,tooltipElement.setAttribute(attributes$D.tooltipContainer,""),tooltipElement.innerHTML=tooltipTemplate,document.body.appendChild(tooltipElement)}this.tooltip.addEventListener("mouseenter",this.addPinMouseEvent),this.tooltip.addEventListener("mouseleave",this.removePinMouseEvent),this.tooltip.addEventListener("theme:tooltip:init",this.addPinEvent),document.addEventListener("theme:tooltip:close",this.removePinEvent);const tooltipTarget=document.querySelector(selectors$X.tooltipContainer);theme.settings.animations&&this.animatedContainer&&this.animatedContainer.addEventListener("transitionend",event=>{event.propertyName==="transform"&&tooltipTarget.classList.remove(classes$L.isAnimating)})}addPin(stopMouseEnter=!1){const tooltipTarget=document.querySelector(selectors$X.tooltipContainer),tooltipTargetArrow=tooltipTarget.querySelector(selectors$X.tooltipArrow);if(tooltipTarget&&(stopMouseEnter&&!this.tooltip.hasAttribute(attributes$D.tooltipStopMouseEnter)||!stopMouseEnter)){const tooltipTargetInner=tooltipTarget.querySelector(`.${this.rootClass}__inner`),tooltipTargetText=tooltipTarget.querySelector(`.${this.rootClass}__text`);tooltipTargetText.textContent=this.label;const tooltipTargetWidth=tooltipTargetInner.offsetWidth,tooltipRect=this.tooltip.getBoundingClientRect(),tooltipTop=tooltipRect.top,tooltipWidth=tooltipRect.width,tooltipHeight=tooltipRect.height,tooltipTargetPositionTop=tooltipTop+tooltipHeight+window.scrollY;let tooltipTargetPositionLeft=tooltipRect.left-tooltipTargetWidth/2+tooltipWidth/2,tooltipArrowPositionLeft="50%";const tooltipTargetWindowDifference=tooltipTargetPositionLeft+tooltipTargetWidth-window.innerWidth;tooltipTargetWindowDifference>0&&(tooltipTargetPositionLeft-=tooltipTargetWindowDifference),tooltipTargetPositionLeft<0&&(tooltipArrowPositionLeft=`calc(50% + ${tooltipTargetPositionLeft}px)`,tooltipTargetPositionLeft=0),tooltipTargetArrow.style.left=tooltipArrowPositionLeft,tooltipTarget.style.transform=`translate(${tooltipTargetPositionLeft}px, ${tooltipTargetPositionTop}px)`,tooltipTarget.classList.remove(classes$L.hiding),tooltipTarget.classList.add(classes$L.visible),document.addEventListener("theme:scroll",this.removePinEvent)}}removePin(event,stopMouseEnter=!1,hideTransition=!1){const tooltipTarget=document.querySelector(selectors$X.tooltipContainer),tooltipVisible=tooltipTarget.classList.contains(classe
12s$L.visible);tooltipTarget&&(stopMouseEnter&&!this.tooltip.hasAttribute(attributes$D.tooltipStopMouseEnter)||!stopMouseEnter)&&(tooltipVisible&&(hideTransition||event.detail.hideTransition)&&(tooltipTarget.classList.add(classes$L.hiding),this.hideTransitionTimeout&&clearTimeout(this.hideTransitionTimeout),this.hideTransitionTimeout=setTimeout(()=>{tooltipTarget.classList.remove(classes$L.hiding)},this.transitionSpeed)),tooltipTarget.classList.remove(classes$L.visible),document.removeEventListener("theme:scroll",this.removePinEvent))}unload(){this.tooltip.removeEventListener("mouseenter",this.addPinMouseEvent),this.tooltip.removeEventListener("mouseleave",this.removePinMouseEvent),this.tooltip.removeEventListener("theme:tooltip:init",this.addPinEvent),document.removeEventListener("theme:tooltip:close",this.removePinEvent),document.removeEventListener("theme:scroll",this.removePinEvent)}}const tooltip={onLoad(){sections$z[this.id]=[],this.container.querySelectorAll(selectors$X.tooltip).forEach(tooltip2=>{sections$z[this.id].push(new Tooltip(tooltip2))})},onUnload(){sections$z[this.id].forEach(tooltip2=>{typeof tooltip2.unload=="function"&&tooltip2.unload()})}},selectors$W={rangeSlider:"[data-range-slider]",rangeDotLeft:"[data-range-left]",rangeDotRight:"[data-range-right]",rangeLine:"[data-range-line]",rangeHolder:"[data-range-holder]",dataMin:"data-se-min",dataMax:"data-se-max",dataMinValue:"data-se-min-value",dataMaxValue:"data-se-max-value",dataStep:"data-se-step",dataFilterUpdate:"data-range-filter-update",priceMin:"[data-field-price-min]",priceMax:"[data-field-price-max]"},classes$K={isInitialized:"is-initialized"};class RangeSlider{constructor(container){this.container=container,this.init(),this.initListener=()=>this.init(),document.addEventListener("theme:filters:init",this.initListener)}init(){if(this.slider=this.container.querySelector(selectors$W.rangeSlider),!this.slider)return;this.resizeFilters=debounce(this.reset.bind(this),50),this.onMoveEvent=event=>this.onMove(event),this.onStopEvent=event=>this.onStop(event),this.onStartEvent=event=>this.onStart(event),this.startX=0,this.x=0,this.touchLeft=this.slider.querySelector(selectors$W.rangeDotLeft),this.touchRight=this.slider.querySelector(selectors$W.rangeDotRight),this.lineSpan=this.slider.querySelector(selectors$W.rangeLine),this.min=parseFloat(this.slider.getAttribute(selectors$W.dataMin)),this.max=parseFloat(this.slider.getAttribute(selectors$W.dataMax)),this.step=0,this.normalizeFact=20;let defaultMinValue=this.min;this.slider.hasAttribute(selectors$W.dataMinValue)&&(defaultMinValue=parseFloat(this.slider.getAttribute(selectors$W.dataMinValue)));let defaultMaxValue=this.max;this.slider.hasAttribute(selectors$W.dataMaxValue)&&(defaultMaxValue=parseFloat(this.slider.getAttribute(selectors$W.dataMaxValue))),defaultMinValue<this.min&&(defaultMinValue=this.min),defaultMaxValue>this.max&&(defaultMaxValue=this.max),defaultMinValue>defaultMaxValue&&(defaultMinValue=defaultMaxValue),this.slider.getAttribute(selectors$W.dataStep)&&(this.step=Math.abs(parseFloat(this.slider.getAttribute(selectors$W.dataStep)))),this.reset(),window.addEventListener("theme:resize",this.resizeFilters),this.maxX=this.slider.offsetWidth-this.touchRight.offsetWidth,this.selectedTouch=null,this.initialValue=this.lineSpan.offsetWidth-this.normalizeFact,this.setMinValue(defaultMinValue),this.setMaxValue(defaultMaxValue),this.touchLeft.addEventListener("mousedown",this.onStartEvent),this.touchRight.addEventListener("mousedown",this.onStartEvent),this.touchLeft.addEventListener("touchstart",this.onStartEvent,{passive:!0}),this.touchRight.addEventListener("touchstart",this.onStartEvent,{passive:!0}),this.slider.classList.add(classes$K.isInitialized)}reset(){this.touchLeft.style.left="0px",this.touchRight.style.left=this.slider.offsetWidth-this.touchLeft.offsetWidth+"px",this.lineSpan.style.marginLeft="0px",this.lineSpan.style.width=this.slider.offsetWidth-this.touchLeft.offsetWidth+"px",this.startX=0,this.x=0,this.maxX=this.slider.offsetWidth-this.touchRight.offsetWidth,this.initialValue=this.lineSpan.offsetWidth-this.normalizeFact}setMinValue(minValue){const ratio=(minValue-this.min)/(this.max-this.min);this.touchLeft.style.left=Math.ceil(ratio*(this.slider.offsetWidth-(this.touchLeft.offsetWidth+this.normalizeFact)))+"px",this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.slider.setAttribute(selectors$W.dataMinValue,minValue)}setMaxValue(maxValue){const ratio=(maxValue-this.min)/(this.max-this.min);this.touchRight.style.left=Math.ceil(ratio*(this.slider.offsetWidth-(this.touchLeft.offsetWidth+this.normalizeFact))+this.normalizeFact)+"px",this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.slider.setAttribute(selectors$W.dataMaxValue,maxValue)}onStart(event){event.preventDefault();let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),event.currentTarget===this.touchLeft?this.x=this.touchLeft.offsetLeft:event.currentTarget===this.touchRight&&(this.x=this.touchRight.offsetLeft),this.startX=eventTouch.pageX-this.x,this.selectedTouch=event.currentTarget,document.addEventListener("mousemove",this.onMoveEvent),document.addEventListener("mouseup",this.onStopEvent),document.addEventListener("touchmove",this.onMoveEvent,{passive:!0}),document.addEventListener("touchend",this.onStopEvent,{passive:!0})}onMove(event){let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),this.x=eventTouch.pageX-this.startX,this.selectedTouch===this.touchLeft?(this.x>this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10?this.x=this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10:this.x<0&&(this.x=0),this.selectedTouch.style.left=this.x+"px"):this.selectedTouch===this.touchRight&&(this.x<this.touchLeft.offsetLeft+this.touchLeft.offsetWidth-10?this.x=this.touchLeft.offsetLeft+this.touchLeft.offsetWidth-10:this.x>this.maxX&&(this.x=this.maxX),this.selectedTouch.style.left=this.x+"px"),this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.calculateValue(),this.slider.getAttribute("on-change")&&new Function("min, max",this.slider.getAttribute("on-change"))(this.slider.getAttribute(selectors$W.dataMinValue),this.slider.getAttribute(selectors$W.dataMaxValue)),this.onChange(this.slider.getAttribute(selectors$W.dataMinValue),this.slider.getAttribute(selectors$W.dataMaxValue))}onStop(event){document.removeEventListener("mousemove",this.onMoveEvent),document.removeEventListener("mouseup",this.onStopEvent),document.removeEventListener("touchmove",this.onMoveEvent,{passive:!0}),document.removeEventListener("touchend",this.onStopEvent,{passive:!0}),this.selectedTouch=null,this.calculateValue(),this.onChanged(this.slider.getAttribute(selectors$W.dataMinValue),this.slider.getAttribute(selectors$W.dataMaxValue))}onChange(min,max){const rangeHolder=this.slider.closest(selectors$W.rangeHolder);if(rangeHolder){const priceMin=rangeHolder.querySelector(selectors$W.priceMin),priceMax=rangeHolder.querySelector(selectors$W.priceMax);priceMin&&priceMax&&(priceMin.value=parseInt(min),priceMax.value=parseInt(max))}}onChanged(min,max){this.slider.hasAttribute(selectors$W.dataFilterUpdate)&&this.slider.dispatchEvent(new CustomEvent("theme:filter:range-update",{bubbles:!0}))}calculateValue(){const newValue=(this.lineSpan.offsetWidth-this.normalizeFact)/this.initialValue;let minValue=this.lineSpan.offsetLeft/this.initialValue,maxValue=minValue+newValue;if(minValue=minValue*(this.max-this.min)+this.min,maxValue=maxValue*(this.max-this.min)+this.min,this.step!==0){let multi=Math.floor(minValue/this.step);minValue=this.step*multi,multi=Math.floor(maxValue/this.step),maxValue=this.step*multi}this.selectedTouch===this.touchLeft&&this.slider.setAttribute(selectors$W.dataMinValue,minValue),this.selectedTouch===this.touchRight&&this.slider.setAttribute(selectors$W.dataMaxValue,maxValue)}unload(){document.removeEventListener("theme:filters:init",this.initListener),window.removeEventListener("theme:resize",this.resizeFilters)}}function getSizedImageUrl(src,size){if(size===null)return src;if((typeof src>"u"||src===null)&&(src=window.theme.assets.noImage),size==="master")return removeProtocol(src);const match=src.match(/\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif|webp)(\?v=\d+)?$/i);if(match){const prefix=src.split(match[0]),suffix=match[0];return removeProtocol(`${prefix[0]}_${size}${suffix}`)}else return null}function removeProtocol(path){return path.replace(/http(s)?:/,"")}function Listeners(){this.entries=[]}Listeners.prototype.add=function(element,event,fn){this.entries.push({element,event,fn}),element.addEventListener(event,fn)},Listeners.prototype.removeAll=function(){this.entries=this.entries.filter(function(listener){return listener.element.removeEventListener(listener.event,listener.fn),!1})};function getVariantFromSerializedArray(product,collection){_validateProductStructure(product);var optionArray=_createOptionArrayFromOptionCollection(product,collection);return getVariantFromOptionArray(product,optionArray)}function getVariantFromOptionArray(product,options2){_validateProductStructure(product),_val
12idateOptionsArray(options2);var result=product.variants.filter(function(variant){return options2.every(function(option,index){return variant.options[index]===option})});return result[0]||null}function _createOptionArrayFromOptionCollection(product,collection){_validateProductStructure(product),_validateSerializedArray(collection);var optionArray=[];return collection.forEach(function(option){for(var i=0;i<product.options.length;i++){var name=product.options[i].name||product.options[i];if(name.toLowerCase()===option.name.toLowerCase()){optionArray[i]=option.value;break}}}),optionArray}function _validateProductStructure(product){if(typeof product!="object")throw new TypeError(product+" is not an object.");if(Object.keys(product).length===0&&product.constructor===Object)throw new Error(product+" is empty.")}function _validateSerializedArray(collection){if(!Array.isArray(collection))throw new TypeError(collection+" is not an array.");if(collection.length===0)throw new Error(collection+" is empty.");if(collection[0].hasOwnProperty("name")){if(typeof collection[0].name!="string")throw new TypeError("Invalid value type passed for name of option "+collection[0].name+". Value should be string.")}else throw new Error(collection[0]+"does not contain name key.")}function _validateOptionsArray(options2){if(Array.isArray(options2)&&typeof options2[0]=="object")throw new Error(options2+"is not a valid array of options.")}var selectors$V={idInput:'[name="id"]',planInput:'[name="selling_plan"]',optionInput:'[name^="options"]',quantityInput:'[name="quantity"]',propertyInput:'[name^="properties"]'};function getUrlWithVariant(url,id){return/variant=/.test(url)?url.replace(/(variant=)[^&]+/,"$1"+id):/\?/.test(url)?url.concat("&variant=").concat(id):url.concat("?variant=").concat(id)}class ProductForm{constructor(element,product,options2){this.element=element,this.form=this.element.tagName=="FORM"?this.element:this.element.querySelector("form"),this.product=this._validateProductObject(product),this.variantElement=this.element.querySelector(selectors$V.idInput),options2=options2||{},this._listeners=new Listeners,this._listeners.add(this.element,"submit",this._onSubmit.bind(this,options2)),this.optionInputs=this._initInputs(selectors$V.optionInput,options2.onOptionChange),this.planInputs=this._initInputs(selectors$V.planInput,options2.onPlanChange),this.quantityInputs=this._initInputs(selectors$V.quantityInput,options2.onQuantityChange),this.propertyInputs=this._initInputs(selectors$V.propertyInput,options2.onPropertyChange)}destroy(){this._listeners.removeAll()}options(){return this._serializeInputValues(this.optionInputs,function(item){var regex=/(?:^(options\[))(.*?)(?:\])/;return item.name=regex.exec(item.name)[2],item})}variant(){const opts=this.options();return opts.length?getVariantFromSerializedArray(this.product,opts):this.product.variants[0]}plan(variant){let plan={allocation:null,group:null,detail:null};const id=new FormData(this.form).get("selling_plan");return id&&variant&&(plan.allocation=variant.selling_plan_allocations.find(function(item){return item.selling_plan_id.toString()===id.toString()})),plan.allocation&&(plan.group=this.product.selling_plan_groups.find(function(item){return item.id.toString()===plan.allocation.selling_plan_group_id.toString()})),plan.group&&(plan.detail=plan.group.selling_plans.find(function(item){return item.id.toString()===id.toString()})),plan&&plan.allocation&&plan.detail&&plan.allocation?plan:null}properties(){return this._serializeInputValues(this.propertyInputs,function(item){var regex=/(?:^(properties\[))(.*?)(?:\])/;return item.name=regex.exec(item.name)[2],item})}quantity(){return this.quantityInputs[0]?Number.parseInt(this.quantityInputs[0].value,10):1}getFormState(){const variant=this.variant();return{options:this.options(),variant,properties:this.properties(),quantity:this.quantity(),plan:this.plan(variant)}}_setIdInputValue(variant){variant&&variant.id?this.variantElement.value=variant.id.toString():this.variantElement.value="",this.variantElement.dispatchEvent(new Event("change"))}_onSubmit(options2,event){event.dataset=this.getFormState(),options2.onFormSubmit&&options2.onFormSubmit(event)}_onOptionChange(event){this._setIdInputValue(event.dataset.variant)}_onFormEvent(cb){return typeof cb>"u"?Function.prototype.bind():function(event){event.dataset=this.getFormState(),this._setIdInputValue(event.dataset.variant),cb(event)}.bind(this)}_initInputs(selector,cb){var elements=Array.prototype.slice.call(this.element.querySelectorAll(selector));return elements.map(function(element){return this._listeners.add(element,"change",this._onFormEvent(cb)),element}.bind(this))}
12_serializeInputValues(inputs,transform){return inputs.reduce(function(options2,input){return(input.checked||input.type!=="radio"&&input.type!=="checkbox")&&options2.push(transform({name:input.name,value:input.value})),options2},[])}_validateProductObject(product){if(typeof product!="object")throw new TypeError(product+" is not an object.");if(typeof product.variants[0].options>"u")throw new TypeError("Product object is invalid. Make sure you use the product object that is output from {{ product | json }} or from the http://[your-product-url].js route");return product}}function fetchProduct(handle){const requestRoute=`${theme.routes.root}products/${handle}.js`;return window.fetch(requestRoute).then(response=>response.json()).catch(e=>{console.error(e)})}const defaults$1={color:"ash"},selectors$U={swatch:"[data-swatch]",swatchColor:"[data-swatch-color]",productBlock:"[data-product-block]",productImage:"[data-product-image]",productImageSecondary:"[data-product-image-secondary]",productImageHover:"[data-product-image-hover]",quickView:"[data-button-quick-view]",gridImage:"[data-grid-image]",link:"[data-grid-link]",loadHovers:"[data-load-hovers]",swatchesMore:"[data-swatches-more]",sectionType:"[data-section-type]",swatchesContainer:"[data-swatches-container]",swatchesLabel:"[data-swatches-label]",swatchesButton:"[data-swatches-button]",selectorWrapper:"[data-option-position]",slider:"[data-slider]"},classes$J={mediaVisible:"product__media--featured-visible",mediaHoverVisible:"product__media__hover-img--visible",noImage:"swatch__link--no-image",noOutline:"no-outline",isVisible:"is-visible",selectorLarge:"selector-wrapper--large"},attributes$C={swatch:"data-swatch",handle:"data-swatch-handle",label:"data-swatch-label",image:"data-swatch-image",imageId:"data-swatch-image-id",variant:"data-swatch-variant",index:"data-swatch-index",swatchVariant:"data-swatch-variant",variandId:"data-variant-id",loaded:"data-loaded",href:"href",bgSet:"data-bgset",aspectRatio:"data-aspectratio",dataFetchedImage:"data-fetched-image",dataFetchedImageIndex:"data-fetched-image-index",dataGridImageDefault:"data-grid-image-default",dataGridImageTarget:"data-grid-image-target",dataGridImageTargetDefault:"data-grid-image-target-default"};let swatches={};const sections$y={};class ColorMatch{constructor(options2={}){this.settings={...defaults$1,...options2},this.match=this.init()}getColor(){return this.match}init(){return loadScript({json:theme.assets.swatches}).then(colors=>this.matchColors(colors,this.settings.color)).catch(e=>{console.log("failed to load swatch colors script"),console.log(e)})}matchColors(colors,name){let bg="#E5E5E5",img=null;const path=theme.assets.base||"/",comparisonName=name.toLowerCase().replace(/\s/g,""),array=colors.colors;if(array){let indexArray=null;if(array.filter((colorObj,index)=>{if(Object.keys(colorObj).toString().toLowerCase().replace(/\s/g,"")===comparisonName)return indexArray=index,colorObj}).length&&indexArray!==null){const value=Object.values(array[indexArray])[0];bg=value,(value.includes(".jpg")||value.includes(".jpeg")||value.includes(".png")||value.includes(".svg"))&&(img=`${path}${value}`,bg="#888888")}}return{color:this.settings.color,path:img,hex:bg}}}class Swatch{constructor(element){this.element=element,this.swatchLink=this.element.nextElementSibling,this.colorString=element.getAttribute(attributes$C.swatch),this.image=this.element.getAttribute(attributes$C.image),this.imageId=this.element.getAttribute(attributes$C.imageId),this.variant=this.element.getAttribute(attributes$C.variant),this.outer=this.element.closest(selectors$U.productBlock),this.gridImage=null,this.imageDefault=null,this.hoverImages=[],this.loadHovers=null,new ColorMatch({color:this.colorString}).getColor().then(result=>{this.colorMatch=result,this.init()})}init(){this.setStyles(),this.variant&&this.outer&&(this.handleHovers(),this.handleClicks()),!this.image&&this.swatchLink&&this.swatchLink.classList.add(classes$J.noImage)}setStyles(){this.colorMatch&&this.colorMatch.hex&&this.element.style.setProperty("--swatch",`${this.colorMatch.hex}`),this.colorMatch&&this.colorMatch.path&&this.element.style.setProperty("background-image",`url(${this.colorMatch.path})`)}handleHovers(){this.swatchLink.addEventListener("mouseenter",()=>{if(this.imageReplace=null,this.imageId&&!this.outer.querySelector(`[${attributes$C.dataGridImageTarget}="${this.imageId}"]`)&&(this.gridImage=this.outer.querySelector(selectors$U.gridImage),this.image&&this.gridImage)){const ratio=window.devicePixelRatio||1,pixels=this.gridImage.offsetWidth*ratio,widthRounded=Math.ceil(pixels/180)*180;if((this.gridImage.hasAttribute(attributes$C.dataGridImageTargetDefault)?this.gridImage.getAttribute(attributes$C.dataGridImageTargetDefault):"")===this.imageId&&this.gridImage.hasAttribute(attributes$C.dataGridImageDefault)){this.imageReplace=this.gridImage.getAttribute(attributes$C.dataGridImageDefault);return}if(this.element.hasAttribute(attributes$C.dataFetchedImage))this.imageReplace=this.element.getAttribute(attributes$C.dataFetchedImage);else{const sizedImage=getSizedImageUrl(this.image,`${widthRounded}x`);window.fetch(sizedImage).then(response=>response.blob()).then(blob=>{const objectURL=URL.createObjectURL(blob);this.imageReplace=`url("${objectURL}")`,this.element.setAttribute(attributes$C.dataFetchedImage,this.imageReplace),this.element.hasAttribute(attributes$C.index)&&this.outer.hasAttribute(attributes$C.dataFetchedImageIndex)&&parseInt(this.element.getAttribute(attributes$C.index))===parseInt(this.outer.getAttribute(attributes$C.dataFetchedImageIndex))&&(this.replaceImages(),this.outer.removeAttribute(attributes$C.dataFetchedImageIndex))}).catch(error=>{console.log(`Error: ${error}`)})}}if(this.loadHovers=this.outer.querySelector(selectors$U.loadHovers),this.loadHovers&&!this.loadHovers?.hasAttribute(attributes$C.loaded)){const content=document.createElement("div");content.appendChild(this.loadHovers.querySelector("template").content.firstElementChild.cloneNode(!0)),this.loadHovers.appendChild(content),this.loadHovers.setAttribute(attributes$C.loaded,!0)}})}handleClicks(){this.swatchLink.addEventListener("click",event=>
12{!document.body.classList.contains(classes$J.noOutline)||(event.preventDefault(),this.updateImagesAndLinksOnEvent())}),this.swatchLink.addEventListener("keyup",event=>{const isFocusEnabled=!document.body.classList.contains(classes$J.noOutline);event.code!==theme.keyboardKeys.ENTER&&event.code!==theme.keyboardKeys.NUMPADENTER||isFocusEnabled||(event.preventDefault(),this.swatchLink.dispatchEvent(new Event("mouseenter",{bubbles:!0})),this.updateImagesAndLinksOnEvent())})}updateImagesAndLinksOnEvent(){this.updateLinks(),this.replaceImages()}updateLinks(){this.linkElements=this.outer.querySelectorAll(selectors$U.link),this.quickView=this.outer.querySelector(selectors$U.quickView),this.linkElements.length&&this.linkElements.forEach(element=>{const destination=getUrlWithVariant(element.getAttribute("href"),this.variant);element.setAttribute("href",destination)}),this.quickView&&theme.settings.quickBuy==="quick_buy"&&this.quickView.setAttribute(attributes$C.variandId,this.variant)}replaceImages(){if(this.imageSecondary=this.outer.querySelector(selectors$U.productImageSecondary),this.outer.removeAttribute(attributes$C.dataFetchedImageIndex),!this.imageReplace&&this.element.hasAttribute(attributes$C.index)&&this.outer.setAttribute(attributes$C.dataFetchedImageIndex,parseInt(this.element.getAttribute(attributes$C.index))),this.imageReplace&&this.gridImage&&this.imageId){this.gridImage.setAttribute(attributes$C.dataGridImageTarget,this.imageId),this.gridImage.hasAttribute(attributes$C.dataGridImageDefault)||this.gridImage.setAttribute(attributes$C.dataGridImageDefault,window.getComputedStyle(this.gridImage).backgroundImage);const onAnimationEnd=()=>{requestAnimationFrame(()=>{this.gridImage.style.setProperty("background-image",this.imageReplace),requestAnimationFrame(()=>{this.imageSecondary.classList.remove(classes$J.mediaVisible)})}),this.imageSecondary.removeEventListener("animationend",onAnimationEnd)};requestAnimationFrame(()=>{this.imageSecondary.classList.add(classes$J.mediaVisible),this.imageSecondary.style.setProperty("background-image",this.imageReplace)}),this.imageSecondary.addEventListener("animationend",onAnimationEnd)}theme.settings.productGridHover==="image"&&(this.hoverImages=this.outer.querySelectorAll(selectors$U.productImageHover)),this.hoverImages.length>1&&this.hoverImages.forEach(hoverImage=>{hoverImage.classList.remove(classes$J.mediaHoverVisible),hoverImage.getAttribute(attributes$C.variandId)===this.variant?hoverImage.classList.add(classes$J.mediaHoverVisible):this.hoverImages[0].classList.add(classes$J.mediaHoverVisible)})}}class GridSwatch extends HTMLElement{constructor(){super(),this.handle=this.getAttribute(attributes$C.handle),this.label=this.getAttribute(attributes$C.label).trim().toLowerCase(),fetchProduct(this.handle).then(product=>{this.product=product,this.colorOption=product.options.find(element=>element.name.toLowerCase()===this.label||null),this.colorOption&&(this.swatches=this.colorOption.values,this.init())})}init(){this.swatchElements=this.querySelectorAll(selectors$U.swatch),this.swatchElements.forEach(el=>{new Swatch(el)}),this.handleShowMore()}handleShowMore(){this.initialHeight=this.offsetHeight,this.expandedHeight=this.initialHeight;const section=this.closest(selectors$U.sectionType),moreLink=this.querySelector(selectors$U.swatchesMore);moreLink&&(moreLink?.addEventListener("click",()=>{this.classList.add(classes$J.isVisible)}),section?.addEventListener("touchstart",e=>{this.contains(e.target)||(this.classList.remove(classes$J.isVisible),this.dispatchEvent(new Event("mouseleave",{bubbles:!0})))}),this.addEventListener("mouseenter",()=>{const onAnimationStart=event=>{this.expandedHeight=this.offsetHeight;const slider2=event.target.closest(selectors$U.slider);this.expandedHeight>this.initialHeight&&slider2&&requestAnimationFrame(()=>slider2.dispatchEvent(new CustomEvent("theme:slider:resize",{bubbles:!1}))),this.removeEventListener("animationstart",onAnimationStart)};this.addEventListener("animationstart",onAnimationStart)}),this.addEventListener("mouseleave",()=>{const onAnimationStart=event=>{const slider2=event.target.closest(selectors$U.slider);this.expandedHeight>this.initialHeight&&slider2&&requestAnimationFrame(()=>slider2.dispatchEvent(new CustomEvent("theme:slider:resize",{bubbles:!1}))),this.removeEventListener("animationstart",onAnimationStart)};this.addEventListener("animationstart",onAnimationStart)}))}}
12class SwatchesContainer{constructor(container){this.container=container,this.swatchesContainers=this.container.querySelectorAll(selectors$U.swatchesContainer),this.swatchesContainers.forEach(swatchesContainer2=>{this.checkSwatchesHeightOnResize=()=>this.checkSwatchesHeight(swatchesContainer2),this.checkSwatchesHeight(swatchesContainer2),document.addEventListener("theme:resize:width",this.checkSwatchesHeightOnResize)})}checkSwatchesHeight(swatchesContainer2){const label=swatchesContainer2.querySelector(selectors$U.swatchesLabel),swatch=swatchesContainer2.querySelector(selectors$U.swatchesButton),containerPaddingTop=parseInt(window.getComputedStyle(swatchesContainer2).getPropertyValue("padding-top")),labelMargin=parseInt(window.getComputedStyle(label).getPropertyValue("margin-bottom")),swatchMargin=parseInt(window.getComputedStyle(swatch).getPropertyValue("margin-bottom")),selectorWrapper=swatchesContainer2.closest(selectors$U.selectorWrapper);selectorWrapper.classList.remove(classes$J.selectorLarge),swatchesContainer2.offsetHeight-containerPaddingTop>label.offsetHeight+labelMargin+swatch.offsetHeight*2+swatchMargin*2&&(swatchesContainer2.style.setProperty("--swatches-max-height",`${swatchesContainer2.offsetHeight}px`),selectorWrapper.classList.add(classes$J.selectorLarge))}onUnload(){this.swatchesContainers.forEach(swatchesContainer2=>{document.removeEventListener("theme:resize:width",this.checkSwatchesHeightOnResize)})}}const makeSwatches=container=>{swatches=[],container.querySelectorAll(selectors$U.swatch).forEach(el=>{swatches.push(new Swatch(el))})},swatchSection={onLoad(){makeSwatches(this.container)}},swatchesContainer={onLoad(){sections$y[this.id]=new SwatchesContainer(this.container)},onUnload(){sections$y[this.id].onUnload()}},selectors$T={slider:"[data-slider]",productMediaContainer:"[data-product-media-container]",productMediaSlider:"[data-product-media-slideshow]",productMediaSlide:"[data-product-media-slideshow-slide]",progressBar:"[data-product-slideshow-progress]",flickityButton:".flickity-button",popupProduct:"[data-product]",popupClose:"[data-popup-close]"},classes$I={fill:"fill",quickViewVisible:"js-quick-view-visible"},sections$x={};class ProductGrid{constructor(container){this.container=container,this.body=document.body,this.sliders=this.container.querySelectorAll(selectors$T.slider),theme.settings.productGridHover==="slideshow"&&!window.theme.touch&&this.productGridSlideshow(),new QuickViewPopup(this.container)}productGridSlideshow(){const productMediaSlider=this.container.querySelectorAll(selectors$T.productMediaSlider),linkedImages=this.container.querySelectorAll(selectors$T.productMediaContainer);productMediaSlider.length&&productMediaSlider.forEach(slider2=>{const mediaContainer=slider2.closest(selectors$T.productMediaContainer),progressBar=mediaContainer.querySelector(selectors$T.progressBar),countImages=slider2.querySelectorAll(selectors$T.productMediaSlide).length,autoplaySpeed=2200,draggable=!this.sliders.length;let flkty=new Flickity.data(slider2),timer=0,cellSelector=selectors$T.productMediaSlide;!flkty.isActive&&countImages>1&&(flkty=new Flickity(slider2,{draggable,cellSelector,contain:!0,wrapAround:!0,imagesLoaded:!0,lazyLoad:!0,pageDots:!1,prevNextButtons:!1,adaptiveHeight:!1,pauseAutoPlayOnHover:!1,selectedAttraction:.2,friction:1,on:{ready:()=>{this.container.style.setProperty("--autoplay-speed",`${autoplaySpeed}ms`)},change:()=>{timer&&clearTimeout(timer),progressBar.classList.remove(classes$I.fill),requestAnimationFrame(()=>{progressBar.classList.add(classes$I.fill)}),timer=setTimeout(()=>{progressBar.classList.remove(classes$I.fill)},autoplaySpeed)},dragEnd:()=>{flkty.playPlayer()}}}),window.theme.touch||(mediaContainer.addEventListener("mouseenter",()=>{progressBar.classList.add(classes$I.fill),timer&&clearTimeout(timer),timer=setTimeout(()=>{progressBar.classList.remove(classes$I.fill)},autoplaySpeed),flkty.options.autoPlay=autoplaySpeed,flkty.playPlayer()}),mediaContainer.addEventListener("mouseleave",()=>{flkty.stopPlayer(),timer&&clearTimeout(timer),progressBar.classList.remove(classes$I.fill)})))}
12),linkedImages.length&&linkedImages.forEach(item=>{item.addEventListener("click",e=>{e.target.matches(selectors$T.flickityButton)&&e.preventDefault()})})}popupClose(){const popupProduct=document.querySelector(selectors$T.popupProduct);popupProduct&&popupProduct.querySelector(selectors$T.popupClose).dispatchEvent(new Event("click"))}onBlockSelect(){this.body.classList.contains(classes$I.quickViewVisible)&&this.popupClose()}onDeselect(){this.body.classList.contains(classes$I.quickViewVisible)&&this.popupClose()}onUnload(){this.body.classList.contains(classes$I.quickViewVisible)&&this.popupClose()}}const productGrid={onLoad(){sections$x[this.id]=new ProductGrid(this.container)},onBlockSelect(){sections$x[this.id].onBlockSelect()},onDeselect(){sections$x[this.id].onDeselect()},onUnload(){sections$x[this.id].onUnload()}},selectors$S={ajaxinateContainer:"#AjaxinateLoop",ajaxinatePagination:"#AjaxinatePagination"},attributes$B={ajaxinateId:"data-ajaxinate-id"},classes$H={isLoaded:"is-loaded"};let sections$w={};class Ajaxify{constructor(container){this.container=container,this.endlessScroll=[],theme.settings.enableInfinityScroll&&this.init()}init(){this.loadMoreFix(),this.ajaxinateContainer=this.container.querySelectorAll(selectors$S.ajaxinateContainer),this.ajaxinateContainer.forEach(element=>{const ajaxinateContainer=`${selectors$S.ajaxinateContainer}[${attributes$B.ajaxinateId}="${element.dataset.ajaxinateId}"]`,ajaxinatePagination=`${selectors$S.ajaxinatePagination}[${attributes$B.ajaxinateId}="${element.dataset.ajaxinateId}"]`;if(element.children.length>0){const endlessScroll=new Ajaxinate({container:ajaxinateContainer,pagination:ajaxinatePagination,method:"scroll"});element.classList.add(classes$H.isLoaded),this.endlessScroll.push(endlessScroll)}})}update(id){this.ajaxinateContainer=this.container.querySelectorAll(selectors$S.ajaxinateContainer);const instanceIDMatch=instance=>instance.settings.container===id,elementIDMatch=element2=>`${selectors$S.ajaxinateContainer}[${attributes$B.ajaxinateId}="${element2.dataset.ajaxinateId}"]`===id,instanceExists=this.endlessScroll.find(instanceIDMatch);if(instanceExists){const index=this.endlessScroll.findIndex(instanceIDMatch);this.endlessScroll.splice(index,1),instanceExists.settings.method="scroll",instanceExists.destroy()}const element=[...this.ajaxinateContainer].find(elementIDMatch);if(!element)return;const ajaxinateContainer=`${selectors$S.ajaxinateContainer}[${attributes$B.ajaxinateId}="${element.dataset.ajaxinateId}"]`,ajaxinatePagination=`${selectors$S.ajaxinatePagination}[${attributes$B.ajaxinateId}="${element.dataset.ajaxinateId}"]`;if(!(element.children.length>0))return;const endlessScroll=new Ajaxinate({container:ajaxinateContainer,pagination:ajaxinatePagination,method:"scroll"});element.classList.add(classes$H.isLoaded),this.endlessScroll.push(endlessScroll)}loadMoreFix(){const originalAddScrollListeners=Ajaxinate.prototype.addScrollListeners,originalRemoveScrollListener=Ajaxinate.prototype.removeScrollListener;Ajaxinate.prototype.addScrollListeners=function(){this.paginationElement&&("IntersectionObserver"in window?(this.intersectionObserver&&this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting&&!this.loading){const nextPageLink=this.paginationElement.querySelector("a");nextPageLink&&(this.nextPageLinkElement=nextPageLink,this.nextPageUrl=nextPageLink.href,this.loadMore())}})},{rootMargin:"200px"}),this.intersectionObserver.observe(this.paginationElement),this.prefetchObserver=new IntersectionObserver(entries=>{if(entries[0].isIntersecting&&!this.prefetched&&!this.loading){const nextPageLink=this.paginationElement.querySelector("a");nextPageLink&&(this.nextPageUrl=nextPageLink.href,this.prefetchNextPage())}},{rootMargin:"300px"}),this.prefetchObserver.observe(this.paginationElement)):originalAddScrollListeners.call(this))},Ajaxinate.prototype.removeScrollListener=function(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.prefetchObserver&&(this.prefetchObserver.disconnect(),this.prefetchObserver=null),originalRemoveScrollListener.call(this)};const originalRemovePaginationElement=Ajaxinate.prototype.removePaginationElement;Ajaxinate.prototype.removePaginationElement=function(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.prefetchObserver&&(this.prefetchObserver.disconnect(),this.prefetchObserver=null),this.paginationElement&&(this.paginationElement.style.height="0",this.paginationElement.style.overflow="hidden",this.paginationElement.style.minHeight="0"),originalRemovePaginationElement.call(this)},Ajaxinate.prototype.prefetchNextPage=function(){if(this.prefetched||this.loading||!this.nextPageUrl)return;this.prefetched=!0;const link=document.createElement("link");link.rel="prefetch",link.href=this.nextPageUrl,document.head.appendChild(link)},Ajaxinate.prototype.loadMore=function(){if(!this.loading){if(!this.nextPageUrl&&this.paginationElement){const nextPageLink=this.paginationElement.querySelector("a");if(nextPageLink)this.nextPageLinkElement=nextPageLink,this.nextPageUrl=nextPageLink.href,this.settings.loadingText&&(nextPageLink.innerText=this.settings.loadingText);else return}this.nextPageUrl&&(this.loading=!0,this.request&&this.request.abort(),this.request=new XMLHttpRequest,this.request.onreadystatechange=function(){if(this.request.readyState===4)try{if(this.request.status!==200||!this.request.responseXML)throw new Error("Invalid response");const newContainer=this.request.responseXML.querySelector(this.settings.container),newPagination=this.request.responseXML.querySelector(this.settings.pagination);if(!newContainer)return console.warn("\u26A0\uFE0F Container not found in responseXML. Falling back to section fetch..."),this.loading=!1,this.fetchSectionFallback();requestAnimationFrame(()=>{if(this.containerElement.insertAdjacentHTML("beforeend",newContainer.innerHTML),!newPagination)this.removePaginationElement(),this.loading=!1;else{this.paginationElement.innerHTML=newPagination.innerHTML,this.nextPageUrl=null,this.nextPageLinkElement=null;const executeCallback=()=>{typeof this.settings.callback=="function"&&this.settings.callback(this.request.responseXML),this.intersectionObserver&&this.paginationElement&&(this.intersectionObserver.disconnect(),this.prefetchObserver?.disconnect(),this.addScrollListeners()),this.loading=!1,this.prefetched=!1};"requestIdleCallback"in window?requestIdleCallback(executeCallback.bind(this),{timeout:1e3}):setTimeout(executeCallback.bind(this),0)}})}catch(error){console.error("Error in loadMore:",error),this.loading=!1,this.fetchSectionFallback()}}.bind(this),this.request.open("GET",this.nextPageUrl,!0),this.request.responseType="document",this.request.send())}},Ajaxinate.prototype.fetchSectionFallback=function(){const sectionUrl=new URL(this.nextPageUrl);sectionUrl.searchParams.set("section_id",this.settings.container.split('data-ajaxinate-id="')[1].replace('"]',"")),fetch(sectionUrl.toString(),{method:"GET",headers:{Accept:"text/html","Content-Type":"text/html"},credentials:"same-origin"}).then(res=>res.text()).then(htmlText=>{const doc=new DOMParser().parseFromString(htmlText,"text/html"),fallbackContainer=doc.querySelector(this.settings.container),fallbackPagination=doc.querySelector(this.settings.pagination);if(!fallbackContainer)throw new Error("Fallback container still not found.");requestAnimationFrame(()=>{if(this.containerElement.insertAdjacentHTML("beforeend",fallbackContainer.innerHTML),!fallbackPagination)this.removePaginationElement(),this.loading=!1;else{this.paginationElement.innerHTML=fallbackPagination.innerHTML,this.nextPageUrl=null,this.nextPageLinkElement=null;const executeCallback=()=>{typeof this.settings.callback=="function"&&this.settings.callback(doc),this.intersectionObserver&&this.paginationElement&&(this.intersectionObserver.disconnect(),this.prefetchObserver?.disconnect(),this.addScrollListeners()),this.loading=!1,this.prefetched=!1};"requestIdleCallback"in window?requestIdleCallback(executeCallback.bind(this),{timeout:1e3}):setTimeout(executeCallback.bind(this),0)}})}).catch(err=>{console.error("Section fetch fallback failed:",err),this.loading=!1;const paginateionEl=document.querySelector("#AjaxinatePagination");paginateionEl&&(paginateionEl.style.height="0",paginateionEl.style.overflow="hidden")})}}unload(){this.endlessScroll.length>0&&(this.endlessScroll.forEach(instance=>{instance.settings.method="scroll",instance.destroy()}),this.ajaxinateContainer.forEach(element=>element.classList.remove(classes$H.isLoaded)))}}const ajaxify={onLoad(){sections$w=new Ajaxify(this.container)},onUnload:function(){typeof sections$w.unload=="function"&§ions$w.unload()}},settings$6={loadingTimeout:300},selectors$R={buttons:"button",toggleFilters:"[data-toggle-filters]",closeFilters:"[data-close-filters]",openFilters:"[data-open-filters]",collectionWrapper:"[data-collection-wrapper]",collapsibleTrigger:"[data-collapsible-trigger]",
12sortToggle:"[data-sort-toggle]",collectionSortOptions:"[data-collection-sort-options]",inputs:"input, select, label, textarea",inputSort:"[data-input-sort]",filters:"[data-collection-filters]",filtersWrapper:"[data-collection-filters-wrapper]",filtersList:"[data-collection-filters-list]",filtersStickyBar:"[data-collection-sticky-bar]",filter:"[data-collection-filter]",filterTag:"[data-collection-filter-tag]",filterTagButton:"[data-collection-filter-tag-button]",filtersForm:"[data-collection-filters-form]",filterResetButton:"[data-filter-reset-button]",filterTagClearButton:"[data-filter-tag-reset-button]",popupsSection:'[data-section-type="popups"]',productGrid:"[data-collection-products]",productsCount:"[data-products-count]",priceMin:"[data-field-price-min]",priceMax:"[data-field-price-max]",rangeMin:"[data-se-min-value]",rangeMax:"[data-se-max-value]",rangeMinValue:"data-se-min-value",rangeMaxValue:"data-se-max-value",rangeMinDefault:"data-se-min",rangeMaxDefault:"data-se-max",tooltip:"[data-tooltip]",tooltipContainer:"[data-tooltip-container]",showMore:"[data-show-more]",showMoreActions:"[data-show-more-actions]",showMoreContainer:"[data-show-more-container]",showMoreTrigger:"[data-show-more-trigger]",searchPerformed:"[data-search-performed]",searchForm:"[data-search-form]",scrollable:"[data-custom-scrollbar]"},classes$G={isActive:"is-active",isExpanded:"is-expanded",isVisible:"is-visible",isLoading:"is-loading",popupVisible:"popup--visible",collectionFiltersVisible:"collection__filters--visible",collectionSortOptionWrapperVisible:"collection__sort__option-wrapper--visible",hidden:"is-hidden"},attributes$A={filterActive:"data-filter-active",preventScrollLock:"data-prevent-scroll-lock",filtersDefaultState:"data-filters-default-state",tabIndex:"tabindex",ariaExpanded:"aria-expanded",currentType:"data-current-type"},sections$v={};class Filters{constructor(container){this.container=container,this.sectionId=container.dataset.sectionId,this.enableFilters=container.dataset.enableFilters==="true",this.enableSorting=container.dataset.enableSorting==="true",this.filterMode=container.dataset.filterMode,this.collectionHandle=this.container.dataset.collection,this.isSearchPage=container.closest(selectors$R.searchPerformed)!=null,this.productGrid=this.container.querySelector(selectors$R.productGrid),this.productsCount=this.container.querySelector(selectors$R.productsCount),this.groupTagFilters=this.container.querySelectorAll(selectors$R.filter),this.filters=this.container.querySelector(selectors$R.filters),this.filterTriggers=this.container.querySelectorAll(selectors$R.collapsibleTrigger),this.filtersStickyBar=this.container.querySelector(selectors$R.filtersStickyBar),this.filtersForm=this.container.querySelector(selectors$R.filtersForm),this.inputSort=this.container.querySelectorAll(selectors$R.inputSort),this.sortToggle=this.container.querySelector(selectors$R.sortToggle),this.collectionSortOptions=this.container.querySelector(selectors$R.collectionSortOptions),this.a11y=a11y,this.filterData=[],this.rangeSlider=null,this.sortDropdownEvent=()=>this.sortDropdownToggle(),this.onTabHandlerEvent=event=>this.onTabHandler(event),this.updateCollectionFormSortEvent=event=>this.updateCollectionFormSort(event),this.bodyClickEvent=event=>this.bodyClick(event),this.onFilterResetClick=this.onFilterResetClick.bind(this),this.onFilterTagResetClick=this.onFilterTagResetClick.bind(this),this.onFilterTagClearClick=this.onFilterTagClearClick.bind(this),this.onFilterToggleClick=this.onFilterToggleClick.bind(this),this.onKeyUpHandler=this.onKeyUpHandler.bind(this),this.updateRangeEvent=this.updateRange.bind(this),this.debouncedSubmitEvent=debounce(event=>{this.onSubmitHandler(event)},500),this.debouncedSortEvent=debounce(event=>{this.onSortChange(event)},500),this.productGridEvents={},this.filters&&(this.hideFiltersDrawer=this.hideFiltersDrawer.bind(this),this.showFiltersDrawer=this.show
12FiltersDrawer.bind(this),this.resizeEvent=debounce(()=>{this.filtersResizeEvents()},500),this.filtersResizeEvents(),document.addEventListener("theme:resize:width",this.resizeEvent)),this.initTagFilters(),this.initFacetedFilters(),this.bindToggleButtonsEvents(),this.bindFilterButtonsEvents(),this.initProductGridEvents(theme.settings.enableInfinityScroll),makeSwatches(this.container),this.collapsible=new Collapsible(this.container),setVars(),window.addEventListener("popstate",this.onHistoryChange.bind(this)),this.sortToggle?.addEventListener("click",this.sortDropdownEvent),document.addEventListener("click",this.bodyClickEvent),this.filterShowMore()}initFacetedFilters(){this.filterMode=="tag"||this.filterMode=="group"||!this.enableFilters||(this.rangeSlider=new RangeSlider(this.container))}initTooltips(){this.tooltips=this.container.querySelectorAll(selectors$R.tooltip),window.innerWidth<theme.sizes.small&&(this.tooltips=this.productGrid?.querySelectorAll(selectors$R.tooltip)),this.tooltips?.forEach(tooltip2=>{new Tooltip(tooltip2)}),this.handleVisibleTooltips()}handleVisibleTooltips(){if(this.tooltips.length>0){const tooltipTarget=document.querySelector(selectors$R.tooltipContainer);tooltipTarget.classList.contains(classes$G.isVisible)&&tooltipTarget.classList.remove(classes$G.isVisible)}}updateRange(){const rangeMin=this.filtersForm.querySelector(selectors$R.rangeMin),rangeMax=this.filtersForm.querySelector(selectors$R.rangeMax),priceMin=this.filtersForm.querySelector(selectors$R.priceMin),priceMax=this.filtersForm.querySelector(selectors$R.priceMax);if(rangeMin.hasAttribute(selectors$R.rangeMinValue)&&rangeMax.hasAttribute(selectors$R.rangeMaxValue)){const priceMinValue=parseFloat(priceMin.placeholder,10),priceMaxValue=parseFloat(priceMax.placeholder,10),rangeMinValue=parseFloat(rangeMin.getAttribute(selectors$R.rangeMinValue),10),rangeMaxValue=parseFloat(rangeMax.getAttribute(selectors$R.rangeMaxValue),10);(priceMinValue!==rangeMinValue||priceMaxValue!==rangeMaxValue)&&(priceMin.value=parseInt(rangeMinValue),priceMax.value=parseInt(rangeMaxValue),this.filtersForm.dispatchEvent(new Event("input",{bubbles:!0})))}}onSubmitHandler(event){event.preventDefault();const formData=new FormData(this.filtersForm),searchParams=new URLSearchParams(formData),deleteParams=[];let searchParamsString="";this.isSearchPage&&(this.searchForm=this.container.querySelector(selectors$R.searchForm),this.currentType=this.container.getAttribute(attributes$A.currentType));const rangeMin=this.filtersForm.querySelector(selectors$R.rangeMin),rangeMax=this.filtersForm.querySelector(selectors$R.rangeMax),priceMin=this.filtersForm.querySelector(selectors$R.priceMin),priceMax=this.filtersForm.querySelector(selectors$R.priceMax);if(rangeMin&&rangeMax&&priceMin&&priceMax&&rangeMin.hasAttribute(selectors$R.rangeMinDefault)&&rangeMax.hasAttribute(selectors$R.rangeMaxDefault)){const rangeMinDefault=parseFloat(rangeMin.getAttribute(selectors$R.rangeMinDefault),10),rangeMaxDefault=parseFloat(rangeMax.getAttribute(selectors$R.rangeMaxDefault),10),priceMinValue=priceMin.value?parseFloat(priceMin.value,10):rangeMinDefault,priceMaxValue=priceMax.value?parseFloat(priceMax.value,10):rangeMaxDefault;priceMinValue<=rangeMinDefault&&priceMaxValue>=rangeMaxDefault&&(deleteParams.push("filter.v.price.gte"),deleteParams.push("filter.v.price.lte"),searchParams.delete("filter.v.price.gte"),searchParams.delete("filter.v.price.lte"))}if(searchParamsString=searchParams.toString(),this.isSearchPage){searchParamsString=getSearchParams(this.searchForm,this.filtersForm,deleteParams);let typeString="";this.currentType==="all"&&(typeString="&type=product"),searchParamsString.indexOf("&type=product")>-1&&(typeString=""),searchParamsString+=typeString}this.renderSection(searchParamsString,event)}onHistoryChange(event){if(!this.filters)return;let searchParams=event.state?.searchParams||"";this.isSearchPage&&(event.state||(searchParams=window.location.search),!(searchParams.indexOf("type=product")>-1))||this.renderSection(searchParams,null,!1)}renderSection(searchParams,event,updateURLHash=!0){this.startLoading();const url=`${window.location.pathname}?section_id=${this.sectionId}&${searchParams}`,filterDataUrl=element=>element.url===url;
12this.filterData.some(filterDataUrl)?this.renderSectionFromCache(filterDataUrl,event):this.renderSectionFromFetch(url,event),updateURLHash&&this.updateURLHash(searchParams)}renderSectionFromFetch(url){fetch(url).then(response=>response.text()).then(responseText=>{const html=responseText;this.filterData=[...this.filterData,{html,url}],this.inputSort=this.container.querySelectorAll(selectors$R.inputSort),this.renderFilters(html),this.bindFilterButtonsEvents(),this.hideFiltersOnMobile(),this.renderProductGrid(html),this.updateProductsCount(html),this.finishLoading(),this.mobileFiltersScrollLock(),this.handleSearchPageActiveTab()})}renderSectionFromCache(filterDataUrl,event){const html=this.filterData.find(filterDataUrl).html;this.renderFilters(html,event),this.hideFiltersOnMobile(),this.renderProductGrid(html),this.updateProductsCount(html),this.finishLoading(),this.mobileFiltersScrollLock(),this.handleSearchPageActiveTab()}handleSearchPageActiveTab(){this.isSearchPage&&(this.scrollable=this.container.querySelector(selectors$R.scrollable),!(!this.scrollable||this.customScrollbar)&&(this.customScrollbar=new CustomScrollbar(this.container)))}renderProductGrid(html){const newProductGrid=new DOMParser().parseFromString(html,"text/html").querySelector(selectors$R.productGrid);newProductGrid&&(this.productGrid.innerHTML=newProductGrid.innerHTML,this.initProductGridEvents(theme.settings.enableInfinityScroll),this.filterShowMore())}updateProductsCount(html){const newProductsCount=new DOMParser().parseFromString(html,"text/html").querySelector(selectors$R.productsCount);newProductsCount&&(this.productsCount.innerHTML=newProductsCount.innerHTML)}renderFilters(html){const newFilters=new DOMParser().parseFromString(html,"text/html").querySelector(selectors$R.filters);newFilters&&(this.filters.innerHTML=newFilters.innerHTML,this.filtersForm=document.querySelector(selectors$R.filtersForm),this.bindFilterButtonsEvents(),this.bindToggleButtonsEvents(),makeSwatches(this.container),this.collapsible=new Collapsible(this.container),document.dispatchEvent(new CustomEvent("theme:filters:init",{bubbles:!0})))}updateURLHash(searchParams){history.pushState({searchParams},"",`${window.location.pathname}${searchParams&&"?".concat(searchParams)}`)}bindFilterButtonsEvents(){this.inputSort.length>0&&this.inputSort.forEach(input=>{input.addEventListener("change",this.updateCollectionFormSortEvent)}),this.filtersForm&&(this.filtersForm.addEventListener("input",this.debouncedSubmitEvent.bind(this)),this.filtersForm.addEventListener("theme:filter:range-update",this.updateRangeEvent)),this.collectionSortOptions&&this.collectionSortOptions.addEventListener("keyup",this.onTabHandlerEvent),!(this.filterMode=="tag"||this.filterMode=="group"||!this.enableFilters)&&this.container.querySelectorAll(selectors$R.filterResetButton).forEach(button=>{button.addEventListener("click",this.onFilterResetClick,{once:!0})})}onFilterResetClick(event){event.preventDefault(),this.renderSection(new URL(event.currentTarget.href).searchParams.toString())}bindToggleButtonsEvents(){this.container.querySelectorAll(selectors$R.toggleFilters).forEach(button=>{button.addEventListener("click",this.onFilterToggleClick)}),this.container.querySelectorAll(selectors$R.closeFilters).forEach(button=>{button.addEventListener("click",this.hideFiltersDrawer)}),this.container.querySelectorAll(selectors$R.openFilters).forEach(button=>{button.addEventListener("click",this.showFiltersDrawer)}),this.container.querySelector(selectors$R.collectionWrapper)?.addEventListener("keyup",this.onKeyUpHandler)}onTabHandler(event){if(event.code===theme.keyboardKeys.SPACE||event.code===theme.keyboardKeys.ENTER||event.code===theme.keyboardKeys.NUMPADENTER){const newSortValue=event.target.previousElementSibling.value;this.filtersForm.querySelectorAll(selectors$R.inputSort).forEach(input=>{input.checked&&(input.checked=!1),input.value===newSortValue&&(input.checked=!0)}),this.filtersForm.dispatchEvent(new Event("input",{bubbles:!0})),event.target.dispatchEvent(new Event("click",{bubbles:!0}))}}onKeyUpHandler(event){event.code===theme.keyboardKeys.ESCAPE&&this.hideFiltersDrawer()}onFilterToggleClick(event){event.preventDefault(),setVars(),this.filters.classList.contains(classe
12s$G.collectionFiltersVisible)?this.hideFiltersDrawer():this.showFiltersDrawer()}sortDropdownToggle(){this.collectionSortOptions&&this.collectionSortOptions.classList.toggle(classes$G.collectionSortOptionWrapperVisible)}bodyClick(event){if(!this.collectionSortOptions)return;const isSortBar=this.sortToggle.contains(event.target);this.collectionSortOptions.classList.contains(classes$G.collectionSortOptionWrapperVisible)&&!isSortBar&&this.sortDropdownToggle()}updateCollectionFormSort(event){const target=event.target,newSortValue=target.value,secondarySortBy=target.closest(selectors$R.collectionSortOptions);this.container.querySelectorAll(selectors$R.inputSort).forEach(input=>{input.value===newSortValue&&(input.checked=!0)}),secondarySortBy!==null&&this.filtersForm.dispatchEvent(new Event("input",{bubbles:!0}))}showFiltersDrawer(){const instance=this;this.a11y.state.trigger=document.querySelector(selectors$R.toggleFilters),this.a11y.trapFocus({container:instance.filters}),this.mobileFiltersScrollLock()}mobileFiltersScrollLock(){if(window.innerWidth<theme.sizes.small){const scrollableElement=document.querySelector(selectors$R.filtersList);this.filters.classList.contains(classes$G.collectionFiltersVisible)||this.filters.classList.add(classes$G.collectionFiltersVisible),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:scrollableElement}))}}hideFiltersOnMobile(){const filterTriggers=this.container.querySelectorAll(`${selectors$R.collapsibleTrigger}:not(${selectors$R.showMoreTrigger})`);window.innerWidth<theme.sizes.small&&requestAnimationFrame(()=>{filterTriggers.forEach(element=>{const isFilterActive=element.getAttribute(attributes$A.filterActive)==="true";element.classList.contains(classes$G.isExpanded)&&!isFilterActive&&element.dispatchEvent(new Event("click"))})})}showFiltersOnDesktop(){const filterTriggers=this.container.querySelectorAll(`${selectors$R.collapsibleTrigger}:not(${selectors$R.showMoreTrigger})`),filtersDefaultState=this.container.getAttribute(attributes$A.filtersDefaultState),openFirstFilterOnly=filtersDefaultState==="first-open",openAllFilters=filtersDefaultState==="open",closeAllFilters=filtersDefaultState==="closed",firstTriggerIndex=this.enableSorting?1:0;filterTriggers.forEach((element,index)=>{const isCurrentFilterExpanded=element.classList.contains(classes$G.isExpanded),isCurrentFilterActive=element.getAttribute(attributes$A.filterActive)==="true",isFirstClosed=!isCurrentFilterExpanded&&index===firstTriggerIndex,allElseExpanded=isCurrentFilterExpanded&&index!==firstTriggerIndex,shouldOpenFirst=openFirstFilterOnly&&isFirstClosed,shouldCloseAllExceptFirst=openFirstFilterOnly&&allElseExpanded,shouldOpenAllClosedOnes=openAllFilters&&!isCurrentFilterExpanded,shouldOpenActiveOnes=isCurrentFilterActive&&!isCurrentFilterExpanded&&openAllFilters,shouldCloseExpandedOnes=closeAllFilters&&isCurrentFilterExpanded;isCurrentFilterActive&&!shouldOpenActiveOnes||(shouldCloseExpandedOnes||shouldOpenFirst||shouldCloseAllExceptFirst||shouldOpenAllClosedOnes||shouldOpenActiveOnes)&&element.dispatchEvent(new Event("click"))})}hideFiltersDrawer(){let filtersVisible=this.filters.classList.contains(classes$G.collectionFiltersVisible),loading2=this.container.classList.contains(classes$G.isLoading);filtersVisible&&(this.filters.classList.remove(classes$G.collectionFiltersVisible),this.a11y.removeTrapFocus()),loading2||document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:settings$6.loadingTimeout}))}filtersResizeEvents(){window.innerWidth>
12=theme.sizes.small?(this.showFiltersOnDesktop(),this.hideFiltersDrawer()):this.hideFiltersOnMobile()}filterShowMore(){this.showMore=this.container.querySelectorAll(selectors$R.showMore),this.showMore.length!==0&&this.showMore.forEach(element=>{const filterCollapsibleTrigger=element.querySelector(selectors$R.collapsibleTrigger),showMoreActions=element.querySelector(selectors$R.showMoreActions);if(!showMoreActions)return;const showMoreTrigger=showMoreActions.querySelector(selectors$R.showMoreTrigger),showMoreContainer=showMoreActions.querySelector(selectors$R.showMoreContainer),focusable=showMoreContainer.querySelectorAll(window.theme.focusable);showMoreContainer.getAttribute(attributes$A.ariaExpanded)==="true"||focusable.forEach(item=>{item.setAttribute(attributes$A.tabIndex,"-1")}),showMoreTrigger.addEventListener("keyup",event=>{(event.code===theme.keyboardKeys.SPACE||event.code===theme.keyboardKeys.ENTER||event.code===theme.keyboardKeys.NUMPADENTER)&&this.updateShowMoreFocusableElements(event,focusable)}),showMoreTrigger.addEventListener("click",event=>{this.updateShowMoreFocusableElements(event,focusable)}),filterCollapsibleTrigger.addEventListener("keyup",event=>{(event.code===theme.keyboardKeys.SPACE||event.code===theme.keyboardKeys.ENTER||event.code===theme.keyboardKeys.NUMPADENTER)&&this.updateCollapsedContainerFocusableElements(filterCollapsibleTrigger,showMoreTrigger,focusable)}),filterCollapsibleTrigger.addEventListener("click",()=>{this.updateCollapsedContainerFocusableElements(filterCollapsibleTrigger,showMoreTrigger,focusable)})})}updateCollapsedContainerFocusableElements(filterCollapsibleTrigger,showMoreTrigger,focusable){requestAnimationFrame(()=>{const isFilterExpanded=filterCollapsibleTrigger.getAttribute(attributes$A.ariaExpanded)==="true",isShowMoreExpanded=showMoreTrigger.getAttribute(attributes$A.ariaExpanded)==="true";focusable.forEach(item=>{!isFilterExpanded&&isShowMoreExpanded&&item.setAttribute(attributes$A.tabIndex,"-1"),isFilterExpanded&&isShowMoreExpanded&&item.removeAttribute(attributes$A.tabIndex)})})}updateShowMoreFocusableElements(event,focusable){requestAnimationFrame(()=>{requestAnimationFrame(()=>{const isExpanded=event.target.getAttribute(attributes$A.ariaExpanded)==="true";focusable.forEach((item,index)=>{if(isExpanded){item.removeAttribute(attributes$A.tabIndex),index===0&&item.focus();return}item.setAttribute(attributes$A.tabIndex,"-1")})})})}initTagFilters(){this.filterMode!="tag"&&this.filterMode!="group"||!this.enableFilters||(this.tags=this.container.dataset.tags.split("+").filter(item=>item),this.bindFilterTagButtonsEvents(),this.bindSortChangeEvent())}renderTagFiltersProducts(url){this.startLoading(),typeof this.endlessCollection=="object"&&this.endlessCollection.unload(),fetch(url).then(response=>response.text()).then(responseText=>{const html=responseText,parsedData=new DOMParser().parseFromString(html,"text/html"),productsHTML=parsedData.querySelector(selectors$R.productGrid).innerHTML,filtersHTML=parsedData.querySelector(selectors$R.filters).innerHTML;this.productGrid.innerHTML=productsHTML,this.filters.innerHTML=filtersHTML,this.inputSort=this.container.querySelectorAll(selectors$R.inputSort),this.filtersForm=document.querySelector(selectors$R.filtersForm),this.filterData=[...this.filterData,{html,url}],this.alreadyClicked=!1,this.bindFilterTagButtonsEvents(),this.bindFilterButtonsEvents(),this.bindSortChangeEvent(),this.bindToggleButtonsEvents(),this.initProductGridEvents(theme.settings.enableInfinityScroll),this.updateProductsCount(html),this.mobileFiltersScrollLock(),this.hideFiltersOnMobile(),makeSwatches(this.container),this.collapsible=new Collapsible(this.container),this.filterShowMore(),history.replaceState&&window.history.pushState({path:url},"",url)}).catch(error=>{this.finishLoading(),console.log(`Error: ${error}`)})}bindFilterTagButtonsEvents(){this.container.querySelectorAll(selectors$R.filterTagButton).forEach(button=>{button.addEventListener("click",this.onFilterTagButtonClick.bind(this))}),this.container.querySelectorAll(selectors$R.filterTagClearButton).forEac
12h(button=>{button.addEventListener("click",this.onFilterTagClearClick)}),this.container.querySelectorAll(selectors$R.filterResetButton).forEach(button=>{button.addEventListener("click",this.onFilterTagResetClick)})}bindSortChangeEvent(){this.container.querySelectorAll(selectors$R.inputSort).forEach(input=>{input.addEventListener("input",this.debouncedSortEvent.bind(this))})}onFilterTagButtonClick(event){if(event.preventDefault(),this.alreadyClicked)return;this.alreadyClicked=!0;const button=event.currentTarget,selectedTag=button.dataset.tag;if(button.parentNode.classList.contains(classes$G.isActive)){let tagIndex=this.tags.indexOf(selectedTag);button.parentNode.classList.remove(classes$G.isActive),tagIndex>-1&&this.tags.splice(tagIndex,1)}else button.parentNode.classList.add(classes$G.isActive),this.tags.push(selectedTag);let url=this.collectionHandle+"/"+this.tags.join("+")+"?sort_by="+this.getSortValue();this.container.querySelector(selectors$R.filter).classList.remove(classes$G.isExpanded),this.container.querySelector(selectors$R.filter).setAttribute(attributes$A.ariaExpanded,!1),this.container.setAttribute("data-tags","["+this.tags+"]"),this.renderTagFiltersProducts(url)}onFilterTagClearClick(event){if(event.preventDefault(),this.alreadyClicked)return;this.alreadyClicked=!0;const selectedTag=event.currentTarget.dataset.tag,tagIndex=this.tags.indexOf(selectedTag);tagIndex>-1&&this.tags.splice(tagIndex,1);const url=this.collectionHandle+"/"+this.tags.join("+")+"?sort_by="+this.getSortValue();this.container.setAttribute("data-tags","["+this.tags+"]"),this.renderTagFiltersProducts(url)}onSortChange(){let url=this.collectionHandle+"/"+this.tags.join("+")+"?sort_by="+this.getSortValue();this.renderTagFiltersProducts(url)}getSortValue(){let sortValue="";return this.inputSort.forEach(input=>{input.checked&&(sortValue=input.value)}),sortValue}onFilterTagResetClick(event){if(event?.preventDefault(),this.alreadyClicked)return;this.alreadyClicked=!0,this.container.querySelectorAll(selectors$R.filterTag).forEach(element=>{element.classList.remove(classes$G.isActive)}),this.container.querySelectorAll(selectors$R.filter).forEach(element=>{element.classList.remove(classes$G.isExpanded),element.setAttribute(attributes$A.ariaExpanded,!1)}),this.tags=[],this.container.setAttribute("data-tags","");let url=this.collectionHandle+"/?sort_by="+this.getSortValue();this.renderTagFiltersProducts(url)}getProductsOffsetTop(){return this.productGrid.getBoundingClientRect().top-document.body.getBoundingClientRect().top-this.filtersStickyBar.offsetHeight}getStickyBarOffsetTop(){return this.filtersStickyBar.getBoundingClientRect().top-document.body.getBoundingClientRect().top}initProductGridEvents(infinityScroll){if(infinityScroll){this.initInfinityScroll(),this.initProductGridEvents(!1);return}this.productGridEvents=new ProductGrid(this.container),this.initTooltips(),setTimeout(()=>{this.finishLoading()},settings$6.loadingTimeout*1.5)}initInfinityScroll(){const callback=()=>this.initProductGridEvents(!1);if(this.isSearchPage){if(!this.enableFilters)return;document.dispatchEvent(new CustomEvent("theme:tab:ajaxinate",{bubbles:!0,detail:"product"}));return}typeof this.endlessCollection=="object"&&this.endlessCollection.unload(),this.endlessCollection=new Ajaxify(this.container),this.endlessCollection.endlessScroll.length!==0&&(this.endlessCollection.endlessScroll[0].settings.callback=callback)}initYotpoWidgets(){console.log("[Yotpo Debug] initYotpoWidgets() called"),console.log("[Yotpo Debug] Container:",this.container);const yotpoScript=document.querySelector('script[src*="widgetsrepository.yotpo.com"]');console.log("[Yotpo Debug] Yotpo script tag found:",!!yotpoScript),yotpoScript&&(console.log("[Yotpo Debug] Yotpo script src:",yotpoScript.src),console.log("[Yotpo Debug] Yotpo script loaded:",yotpoScript.complete||yotpoScript.readyState==="complete")),setTimeout(()=>{console.log("[Yotpo Debug] Starting Yotpo widget initialization after timeout");const yotpoElements=this.container.querySelectorAll(".yotpo.bottomLine[data-product-id]");if(console.log("[Yotpo Debug] Found",yotpoElements.length,"yotpo bottomLine elements"),yotpoElements.length===0){console.log("[Yotpo Debug] No yotpo elements found, exiting");return}const convertedIds=[];
12yotpoElements.forEach((element,index)=>{const productId=element.getAttribute("data-product-id");console.log(`[Yotpo Debug] Converting element ${index+1}: productId=${productId}`),element.className="yotpo-widget-instance",element.setAttribute("data-yotpo-instance-id","547925"),element.setAttribute("data-yotpo-product-id",productId),element.removeAttribute("data-product-id"),convertedIds.push(productId),console.log(`[Yotpo Debug] Element ${index+1} converted. New className:`,element.className,"New attributes:",{"data-yotpo-instance-id":element.getAttribute("data-yotpo-instance-id"),"data-yotpo-product-id":element.getAttribute("data-yotpo-product-id")})}),console.log("[Yotpo Debug] Converted",convertedIds.length,"elements. Product IDs:",convertedIds);const waitForYotpoScript=()=>new Promise(resolve=>{if(!yotpoScript){console.log("[Yotpo Debug] No Yotpo script tag found"),resolve(!1);return}if(yotpoScript.readyState==="complete"||yotpoScript.readyState==="loaded"||yotpoScript.readyState==="interactive"){console.log("[Yotpo Debug] Yotpo script already loaded, readyState:",yotpoScript.readyState),setTimeout(()=>resolve(!0),1e3);return}console.log("[Yotpo Debug] Waiting for Yotpo script to load, current readyState:",yotpoScript.readyState),yotpoScript.onload=()=>{console.log("[Yotpo Debug] Yotpo script onload event fired"),setTimeout(()=>resolve(!0),1e3)},yotpoScript.onerror=()=>{console.error("[Yotpo Debug] Yotpo script failed to load"),resolve(!1)};let checkCount=0;const checkInterval=setInterval(()=>{checkCount++,yotpoScript.readyState==="complete"||yotpoScript.readyState==="loaded"||yotpoScript.readyState==="interactive"?(console.log("[Yotpo Debug] Yotpo script loaded (periodic check), readyState:",yotpoScript.readyState),clearInterval(checkInterval),setTimeout(()=>resolve(!0),1e3)):checkCount>50&&(console.warn("[Yotpo Debug] Yotpo script load timeout"),clearInterval(checkInterval),resolve(!1))},100)}),checkYotpoWidgetAPI=()=>{console.log("[Yotpo Debug] Checking Yotpo widget API...");const found={};return["yotpo","Yotpo","yotpoWidgets","YotpoWidgets","yotpoReviews"].forEach(global=>{if(window[global]&&(found[global]=window[global],console.log(`[Yotpo Debug] Found window.${global}:`,window[global]),typeof window[global]=="object")){const keys=Object.keys(window[global]||{});console.log(`[Yotpo Debug] window.${global} keys:`,keys);const widgetMethods=keys.filter(k=>k.toLowerCase().includes("widget")||k.toLowerCase().includes("init")||k.toLowerCase().includes("refresh"));widgetMethods.length>0&&console.log(`[Yotpo Debug] Found widget methods in window.${global}:`,widgetMethods)}}),found};(async()=>{console.log("[Yotpo Debug] initYotpo() called");const scriptLoaded=await waitForYotpoScript();console.log("[Yotpo Debug] Script loaded status:",scriptLoaded);const foundGlobals=checkYotpoWidgetAPI();let initialized=!1;if(window.yotpo&&typeof window.yotpo.refreshWidgets=="function")try{console.log("[Yotpo Debug] Method 1: Calling window.yotpo.refreshWidgets()"),window.yotpo.refreshWidgets(),initialized=!0,console.log("[Yotpo Debug] refreshWidgets() called successfully")}catch(error){console.error("[Yotpo Debug] Error calling refreshWidgets():",error)}if(window.yotpo&&typeof window.yotpo.initWidgets=="function")try{console.log("[Yotpo Debug] Method 2: Calling window.yotpo.initWidgets()"),window.yotpo.initWidgets(),initialized=!0}catch(error){console.error("[Yotpo Debug] Error calling initWidgets():",error)}if(window.Yotpo&&typeof window.Yotpo.initWidgets=="function")try{console.log("[Yotpo Debug] Method 3: Calling window.Yotpo.initWidgets()"),window.Yotpo.initWidgets(),initialized=!0}catch(error){console.error("[Yotpo Debug] Error calling window.Yotpo.initWidgets():",error)}try{console.log("[Yotpo Debug] Method 4: Dispatching DOMContentLoaded event");const event=new Event("DOMContentLoaded",{bubbles:!0});document.dispatchEvent(event),initialized=!0}catch(error){console.error("[Yotpo Debug] Error dispatching event:",error)}try{console.log("[Yotpo Debug] Method 5: Dispatching yotpo:ready event");const yotpoEvent=new CustomEvent("yotpo:ready",{bubbles:!0});document.dispatchEvent(yotpoEvent),initialized=!0}catch(error){console.error("[Yotpo Debug] Error dispatching yotpo:ready:",error)}console.log("[Yotpo Debug] Method 6: Checking if widgets auto-initialize..."),setTimeout(()=>{const initializedWidgets=this.container.querySelectorAll(".yotpo-widget-instance .yotpo-reviews-star-ratings-widget");console.log("[Yotpo Debug] Found",initializedWidgets.length,"initialized widgets after conversion"),initializedWidgets.length>0?console.log("[Yotpo Debug] SUCCESS: Widgets initialized automatically!"):console.warn("[Yotpo Debug] No widgets initialized automatically")},2e3),initialized||console.warn("[Yotpo Debug] None of the initialization methods worked, but widgets may auto-initialize")})()},200)}
12startLoading(){this.container.classList.add(classes$G.isLoading),window.innerWidth>=theme.sizes.small&&document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0}));let productsTop=this.getProductsOffsetTop();window.scrollTo({top:productsTop,left:0,behavior:"smooth"})}finishLoading(){const popups2=document.querySelectorAll(`${selectors$R.popupsSection} .${classes$G.popupVisible}`),isPopupActive=popups2.length>0;if(this.container.classList.remove(classes$G.isLoading),isPopupActive){let preventScrollPopupsCount=0;[...popups2].forEach(popup=>{popup.hasAttribute(attributes$A.preventScrollLock)&&(preventScrollPopupsCount+=1)}),preventScrollPopupsCount===popups2.length&&document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:settings$6.loadingTimeout}))}else window.innerWidth>=theme.sizes.small&&document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:settings$6.loadingTimeout}))}onDeselect(){this.productGridEvents&&this.productGridEvents.onDeselect()}onUnload(){typeof this.endlessCollection=="object"&&this.endlessCollection.unload(),this.productGridEvents&&this.productGridEvents.onUnload(),this.collapsible&&this.collapsible.onUnload(),this.rangeSlider&&this.rangeSlider.unload(),this.filters&&document.removeEventListener("theme:resize:width",this.resizeEvent),document.removeEventListener("click",this.bodyClickEvent),this.groupTagFilters.length>0&&this.onFilterTagResetClick(),this.finishLoading()}}const filters={onLoad(){sections$v[this.id]=new Filters(this.container)},onDeselect(){sections$v[this.id].onDeselect()},onUnload(){sections$v[this.id].onUnload()}},selectors$Q={tabsLink:"[data-tabs-link]",tab:"[data-tab]",tabRef:"[data-tab-ref]",scrollable:"[data-custom-scrollbar]",scrollableHolder:"[data-custom-scrollbar-holder]",slider:"[data-slider]",tabsContents:"[data-tabs-contents]",searchForm:"[data-search-form]",allTypesContainer:"[data-all-types-container]",filtersForm:"[data-collection-filters-form]",currentPage:"[data-current-page]",tooltip:"[data-tooltip]",productGrid:"[data-collection-products]",ajaxinateContainer:"#AjaxinateLoop",ajaxinatePagination:"#AjaxinatePagination"},classes$F={current:"current",hide:"hide",alt:"alt",aosAnimate:"aos-animate",aosInit:"aos-init",isLoaded:"is-loaded"},attributes$z={tabsLink:"data-tabs-link",tab:"data-tab",tabRef:"data-tab-ref",tabStartIndex:"data-start-index",searchPerformed:"data-search-performed",type:"data-type",currentType:"data-current-type",allTypes:"data-all-types",currentPage:"data-current-page",ajaxinateId:"data-ajaxinate-id"},sections$u={};class Tabs{constructor(container){this.container=container,this.tabsContents=container.querySelector(selectors$Q.tabsContents),this.animateElementsTimer=null,this.isSearchPage=container.closest(`[${attributes$z.searchPerformed}="true"]`)!=null,this.container&&(this.scrollable=this.container.querySelector(selectors$Q.scrollable),this.tabRef=this.container.querySelectorAll(selectors$Q.tabRef),this.tabsLink=this.container.querySelectorAll(selectors$Q.tabsLink),this.tab=this.container.querySelectorAll(selectors$Q.tab),this.assignSearchPageArguments(),this.init(),this.initCustomScrollbar())}assignSearchPageArguments(){this.isSearchPage&&(this.searchForm=this.container.querySelector(selectors$Q.searchForm),this.searchFormData=new FormData(this.searchForm),this.searchTerm=encodeURIComponent(this.searchFormData.get("q")),this.currentType=this.container.getAttribute(attributes$z.currentType),this.sectionId=this.container.dataset.sectionId,this.searchForAllTypes=this.container.getAttribute(attributes$z.allTypes)==="true",this.fetchURL="",this.searchParams="",this.cachedResults={},this.handleTabsHistory(),this.infiniteScrollListener(),this.initInfinityScroll(this.currentType))}init(){const tabsNavList=this.container.querySelectorAll(selectors$Q.tabsLink),firstTabsLink=this.container.querySelector(`[${attributes$z.tabsLink}="${this.container.hasAttribute(attributes$z.tabStartIndex)?this.container.getAttribute(attributes$z.tabStartIndex):0}"]`);this.container.querySelector(`[${attributes$z.tab}="${this.container.hasAttribute(attributes$z.tabStartIndex)?this.container.getAttribute(attributes$z.tabStartIndex):0}"]`)?.classList.add(classes$F.current),firstTabsLink?.classList.add(classes$F.current),this.checkVisibleTabsLinks(),tabsNavList.forEach(element=>{this.handleTabsNavListeners(element)})}handleTabsHistory(){window.addEventListener("popstate",this.onHistoryChange.bind(this)),this.openTabFromHistoryEvent=event=>this.openTabFromHistory(event),this.tabsLink.forEach(element=>{element.addEventListener("theme:tab:open-from-history",this.openTabFromHistoryEvent)})}handleTabsNavListeners(element){const tabId=element.getAttribute(attributes$z.tabsLink),tab=this.container.querySelector(`[${attributes$z.tab}="${tabId}"]`);tab&&(element.addEventListener("click",event=>{this.isSearchPage&&this.handleURLSearchParams(event,!0),this.tabChange(element,tab)}),element.addEventListener("keyup",event=>{(event.code===theme.keyboardKeys.SPACE||event.code===theme.keyboardKeys.ENTER||event.code===theme.keyboardKeys.NUMPADENTER)&&(this.isSearchPage&&this.handleURLSearchParams(event,!0),this.tabChange(element,tab))}))}openTabFromHistory(event){const target=event.target,tabId=this.container.querySelector(event.detail.element).getAttribute(attributes$z.tabsLink),tab=this.container.querySelector(`[${attributes$z.tab}="${tabId}"]`);tab&&(this.handleURLSearchParams(event,!1),this.tabChange(target,tab))}handleURLSearchParams(event,updateHistory=!0){const target=event.target.matches(selectors$Q.tabsLink)?event.target:event.target.closest(selectors$Q.tabsLink),type=target.getAttribute(attributes$z.type),tabId=target.getAttribute(attributes$z.tabsLink),currentPage=this.container.querySelector(`[${attributes$z.tab}="${tabId}"]`).querySelector(selectors$Q.currentPage),filtersForm=document.querySelector(selectors$Q.filtersForm);let currentPageStr=currentPage?`&page=${currentPage.getAttribute(attributes$z.currentPage)}`:"";if(this.searchParams=getSearchParams(this.searchForm,filtersForm,[],type),type==="product"){const sanitized=this.searchParams.replace("&type=product","");this.searchParams=`${sanitized}&type=product`}else this.searchParams=`q=${this.searchTerm}&type=${type}`;!theme.settings.enableInfinityScroll&¤tPageStr!==""&&(this.searchParams+=currentPageStr),this.fetchURL=`${theme.routes.searchUrl}?${this.searchParams}§ion_id=${this.sectionId}`,updateHistory&&history.pushState({searchParams:this.searchParams},"",`${window.location.pathname}${this.searchParams&&"?".concat(this.searchParams)}`)}tabChangeFetchContent(element,tab){const type=element.getAttribute(attributes$z.type),tabId=element.getAttribute(attributes$z.tabsLink),tabContainer=this.container.querySelector(`[${attributes$z.tab}="${tabId}"]`),typeRendered=this.currentType===type;if(this.cachedResults[tabId]||typeRendered){type==="product"&&!this.searchFilters&&
12(this.searchFilters=new Filters(this.container)),requestAnimationFrame(()=>{this.handleActiveTabClasses(element,tab),this.scrollToCurrentTabLink(element),this.triggerTabAnimations(tab),this.checkVisibleTabsLinks(),this.updateAjaxify(tab,type)});return}fetch(this.fetchURL).then(response=>{if(!response.ok)throw new Error(response.status);return response.text()}).then(text=>{const resultsMarkup=new DOMParser().parseFromString(text,"text/html").querySelector(`[${attributes$z.tab}="${tabId}"]`).innerHTML;this.searchForAllTypes&&this.container.querySelector(selectors$Q.allTypesContainer)?.remove(),this.cachedResults[tabId]=resultsMarkup,tabContainer.innerHTML=resultsMarkup,type==="product"&&!this.searchFilters&&(this.searchFilters=new Filters(this.container)),requestAnimationFrame(()=>{this.handleActiveTabClasses(element,tab),this.scrollToCurrentTabLink(element),this.triggerTabAnimations(tab),this.checkVisibleTabsLinks(),this.initInfinityScroll(type)})}).catch(error=>{throw error})}onHistoryChange(event){const searchParams=event.state?.searchParams||window.location.search,productResults=searchParams.indexOf("type=product")>-1,articleResults=searchParams.indexOf("type=article")>-1,pageResults=searchParams.indexOf("type=page")>-1,shouldOpenTab=productResults||articleResults||pageResults,typeProduct=this.container.querySelector(`${selectors$Q.tabsLink}[${attributes$z.type}="product"]`),typeArticle=this.container.querySelector(`${selectors$Q.tabsLink}[${attributes$z.type}="article"]`),typePage=this.container.querySelector(`${selectors$Q.tabsLink}[${attributes$z.type}="page"]`);if(!shouldOpenTab){window.location=searchParams;return}productResults&&typeProduct?.dispatchEvent(new CustomEvent("theme:tab:open-from-history",{bubbles:!0,detail:{element:`[${attributes$z.type}="product"]`}})),articleResults&&typeArticle?.dispatchEvent(new CustomEvent("theme:tab:open-from-history",{bubbles:!0,detail:{element:`[${attributes$z.type}="article"]`}})),pageResults&&typePage?.dispatchEvent(new CustomEvent("theme:tab:open-from-history",{bubbles:!0,detail:{element:`[${attributes$z.type}="page"]`}}))}initCustomScrollbar(){!this.scrollable||this.customScrollbar||(this.customScrollbar=new CustomScrollbar(this.container))}infiniteScrollListener(){theme.settings.enableInfinityScroll&&(this.ajaxifyFromFiltersEvent=event=>this.ajaxifyFromFilters(event),document.addEventListener("theme:tab:ajaxinate",this.ajaxifyFromFiltersEvent))}ajaxifyFromFilters(event){this.initInfinityScroll(event.detail)}initInfinityScroll(type){if(!theme.settings.enableInfinityScroll||this.container.querySelectorAll(selectors$Q.ajaxinateContainer).length===0)return;const activeTab=this.container.querySelector(`${selectors$Q.tab}.${classes$F.current}`),tabAjaxinateContainer=activeTab?.querySelector(selectors$Q.ajaxinateContainer),isLoaded=tabAjaxinateContainer?.classList.contains(classes$F.isLoaded);if(!activeTab){this.initAjaxyfy(type);return}!tabAjaxinateContainer&&this.endlessCollection&&this.updateAjaxinateInstancesSettings(type),!(!tabAjaxinateContainer||isLoaded)&&this.initAjaxyfy(type)}updateAjaxinateInstancesSettings(type){setTimeout(()=>{if(this.endlessCollection.endlessScroll.length===0)return;[...this.endlessCollection.endlessScroll].forEach(instance=>{const containerElement=instance.containerElement,activeTabPresent=[...this.tab].find(tab=>tab.classList.contains(classes$F.current));!(containerElement.closest(`${selectors$Q.tab}.${classes$F.current}`)!==null)&&activeTabPresent&&(instance.settings.method="click")});const callback=()=>this.initProductGridEvents();if(type==="product"||type==="all"){const instanceIDCheck=instance=>instance.settings.container.indexOf("resultsProducts")>-1||instance.settings.container.indexOf("allTypes")>-1,productAjaxinateInstance=[...this.endlessCollection.endlessScroll].find(instanceIDCheck);if(!productAjaxinateInstance)return;productAjaxinateInstance.settings.callback=callback}})}initAjaxyfy(type){if(typeof this.endlessCollection!="object"){this.endlessCollection=new Ajaxify(this.container),this.updateAjaxinateInstancesSettings(type);return}this.endlessCollection.endlessScroll.length>0&&(this.endlessCollection.unload(),this.endlessCollection=new Ajaxify(this.container),this.updateAjaxinateInstancesSettings(type))}updateAjaxify(tab,type){if(this.endlessCollection?.endlessScroll.length===0)return;const ajaxinateContainer=tab.querySelector(selectors$Q.ajaxinateContainer),id=`${selectors$Q.ajaxinateContainer}[${attributes$z.ajaxinateId}="${ajaxinateContainer?.dataset.ajaxinateId}"]`;ajaxinateContainer&&(this.endlessCollection.update(id),this.updateAjaxinateInstancesSettings(type))}initProductGridEvents(){this.productGridEvents=new ProductGrid(this.container),this.initTooltips()}initYotpoWidgets(){setTimeout(()=>{const yotpoElements=this.container.querySelectorAll(".yotpo.bottomLine[data-product-id]");if(yotpoElements.length===0)return;
12yotpoElements.forEach(element=>{const productId=element.getAttribute("data-product-id");element.className="yotpo-widget-instance",element.setAttribute("data-yotpo-instance-id","547925"),element.setAttribute("data-yotpo-product-id",productId),element.removeAttribute("data-product-id")});const initYotpo=()=>{window.yotpo&&window.yotpo.refreshWidgets&&window.yotpo.refreshWidgets()};if(window.yotpo&&window.yotpo.refreshWidgets)initYotpo();else{const checkYotpo=setInterval(()=>{window.yotpo&&window.yotpo.refreshWidgets&&(clearInterval(checkYotpo),initYotpo())},100);setTimeout(()=>clearInterval(checkYotpo),5e3)}},200)}initTooltips(){this.tooltips=this.container.querySelectorAll(selectors$Q.tooltip),this.productGrid=this.container.querySelector(selectors$Q.productGrid),window.innerWidth<theme.sizes.small&&(this.tooltips=this.productGrid?.querySelectorAll(selectors$Q.tooltip)),this.tooltips?.forEach(tooltip2=>{new Tooltip(tooltip2)})}tabChange(element,tab){if(!element.classList.contains(classes$F.current)){if(this.isSearchPage){this.tabChangeFetchContent(element,tab);return}this.handleActiveTabClasses(element,tab),this.scrollToCurrentTabLink(element),this.triggerTabAnimations(tab),this.handleTabSliders(tab),this.checkVisibleTabsLinks()}}handleActiveTabClasses(element,tab){const lastActiveTab=this.container.querySelector(`${selectors$Q.tab}.${classes$F.current}`),lastActiveTabsLink=this.container.querySelector(`${selectors$Q.tabsLink}.${classes$F.current}`);lastActiveTab?.classList.remove(classes$F.current),lastActiveTabsLink?.classList.remove(classes$F.current),element.classList.add(classes$F.current),tab.classList.add(classes$F.current),element.classList.contains(classes$F.hide)&&tab.classList.add(classes$F.hide),this.tabRef?.forEach(refElement=>{const isActive=refElement.classList.contains(classes$F.current),shouldBeActive=refElement.getAttribute(attributes$z.tabRef)===tab.getAttribute(attributes$z.tab);refElement.classList.toggle(classes$F.current,!isActive&&shouldBeActive)})}scrollToCurrentTabLink(element){const parent=element.closest(selectors$Q.scrollableHolder)?element.closest(selectors$Q.scrollableHolder):element.parentElement,parentPadding=parseInt(window.getComputedStyle(parent).getPropertyValue("padding-left"));parent.scrollTo({top:0,left:element.offsetLeft-parent.offsetWidth/2+element.offsetWidth/2+parentPadding,behavior:"smooth"}),element.dispatchEvent(new CustomEvent("theme:custom-scrollbar:change",{bubbles:!0,detail:{element}}))}triggerTabAnimations(tab){theme.settings.animations!="false"&&(this.tabsContents.querySelectorAll(`.${classes$F.aosInit}`).forEach(element=>{element.classList.remove(classes$F.aosAnimate)}),this.animateElementsTimer&&clearTimeout(this.animateElementsTimer),this.animateElementsTimer=setTimeout(()=>{tab.querySelectorAll(`.${classes$F.aosInit}`).forEach(element=>{element.classList.add(classes$F.aosAnimate)})},150))}handleTabSliders(tab){const slider2=tab.querySelector(selectors$Q.slider);slider2&&slider2.dispatchEvent(new CustomEvent("theme:tab:change",{bubbles:!1}))}checkVisibleTabsLinks(){const tabsNavList=this.container.querySelectorAll(selectors$Q.tabsLink),tabsNavListHidden=this.container.querySelectorAll(`${selectors$Q.tabsLink}.${classes$F.hide}`);tabsNavList.length-tabsNavListHidden.length<2?this.container.classList.add(classes$F.alt):this.container.classList.remove(classes$F.alt)}onBlockSelect(event){const element=event.target;element&&(element.dispatchEvent(new Event("click")),element.parentNode.scrollTo({top:0,left:element.offsetLeft-element.clientWidth,behavior:"smooth"}))}onUnload(){this.customScrollbar&&this.customScrollbar.unload(),this.isSearchPage&&theme.settings.enableInfinityScroll&&document.removeEventListener("theme:tab:ajaxinate",this.ajaxifyFromFiltersEvent)}}const tabs={onLoad(){sections$u[this.id]=new Tabs(this.container)},onBlockSelect(e){sections$u[this.id].onBlockSelect(e)},onUnload(){sections$u[this.id].onUnload()}},selectors$P={drawer:"[data-drawer]",drawerToggle:"[data-drawer-toggle]",scroller:"[data-scroll]",quickviewItem:"[data-quick-view-item]",tabsLink:"[data-tabs-link]"},classes$E={open:"is-open",drawerOpen:"js-drawer-open",contentVisibilityHidden:"cv-h",header:"site-header"}
12,attributes$y={ariaExpanded:"aria-expanded",ariaControls:"aria-controls"};let sections$t={};class Drawer{constructor(container){this.container=container,this.drawers=this.container.querySelectorAll(selectors$P.drawer),this.drawerToggleButtons=this.container.querySelectorAll(selectors$P.drawerToggle),this.a11y=a11y,this.drawerToggleEvent=throttle(event=>{this.toggle(event)},150),this.keyPressCloseEvent=throttle(event=>{event.code===theme.keyboardKeys.ESCAPE&&this.close(event)},150),this.drawerCloseEvent=event=>{const activeDrawer=document.querySelector(`${selectors$P.drawer}.${classes$E.open}`);let isDrawerToggle=!1;if(!activeDrawer)return;event.type==="click"&&(isDrawerToggle=event.target.matches(selectors$P.drawerToggle));const isDrawerChild=activeDrawer?activeDrawer.contains(event.target):!1,quickviewItem=activeDrawer.closest(selectors$P.quickviewItem),isQuickviewChild=quickviewItem?quickviewItem.contains(event.target):!1;!isDrawerToggle&&!isDrawerChild&&!isQuickviewChild&&this.close()},this.initListeners()}initListeners(){this.drawerToggleButtons.forEach(button=>{button.addEventListener("click",this.drawerToggleEvent)}),this.drawers.forEach(drawer2=>{drawer2.addEventListener("keyup",this.keyPressCloseEvent),this.collapsible=new Collapsible(drawer2),this.tabs=new Tabs(drawer2)}),document.addEventListener("click",this.drawerCloseEvent),document.addEventListener("theme:drawer:closing",this.drawerCloseEvent)}toggle(e){e.preventDefault();const drawer2=document.querySelector(`#${e.target.getAttribute(attributes$y.ariaControls)}`);if(!drawer2)return;drawer2.classList.contains(classes$E.open)?this.close():this.open(e)}open(e){const drawerOpenButton=e.target,drawer2=document.querySelector(`#${e.target.getAttribute(attributes$y.ariaControls)}`);if(!drawer2)return;const drawerScroller=drawer2.querySelector(selectors$P.scroller)||drawer2;document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:drawerScroller})),document.dispatchEvent(new CustomEvent("theme:drawer:open"),{bubbles:!0}),document.body.classList.add(classes$E.drawerOpen),drawer2.classList.add(classes$E.open),drawer2.classList.remove(classes$E.contentVisibilityHidden),drawerOpenButton.setAttribute(attributes$y.ariaExpanded,!0),setTimeout(()=>{this.a11y.state.trigger=drawerOpenButton,this.a11y.trapFocus({container:drawer2})})}close(){if(!document.body.classList.contains(classes$E.drawerOpen))return;const drawer2=document.querySelector(`${selectors$P.drawer}.${classes$E.open}`);this.drawerToggleButtons.forEach(button=>{button.setAttribute(attributes$y.ariaExpanded,!1)}),this.a11y.removeTrapFocus({container:drawer2}),drawer2.classList.remove(classes$E.open);const onDrawerTransitionEnd=event=>{event.target===drawer2&&(requestAnimationFrame(()=>{drawer2.classList.add(classes$E.contentVisibilityHidden),document.dispatchEvent(new CustomEvent("theme:drawer:close"),{bubbles:!0}),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}),drawer2.removeEventListener("transitionend",onDrawerTransitionEnd))};drawer2.addEventListener("transitionend",onDrawerTransitionEnd),document.body.classList.remove(classes$E.drawerOpen)}onUnload(){this.close(),this.drawerToggleButtons.forEach(button=>{button.removeEventListener("click",this.drawerToggleEvent)}),this.drawers.forEach(drawer2=>{drawer2.removeEventListener("keyup",this.keyPressCloseEvent)}),document.removeEventListener("click",this.drawerCloseEvent),document.removeEventListener("theme:drawer:closing",this.drawerCloseEvent),this.collapsible&&this.collapsible.onUnload(),this.tabs&&this.tabs.onUnload()}}const drawer={onLoad(){this.container.classList.contains(classes$E.header)&&(this.container=this.container.parentNode),sections$t[this.id]=new Drawer(this.container)},onUnload(){sections$t[this.id].onUnload()}},showElement=(elem,removeProp=!1,prop="block")=>{elem&&(removeProp?elem.style.removeProperty("display"):elem.style.display=prop)},hideElement=elem=>{elem&&(elem.style.display="none")},selectors$O={headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]"},scrollTo=elementTop=>{const headerHeight=document.querySelector(selectors$O.headerSticky)&&document.querySelector(selectors$O.headerHeight)?document.querySelector(selectors$O.headerHeight).getBoundingClientRect().height:0;window.scrollTo({top:elementTop+window.scrollY-headerHeight,left:0,behavior:"smooth"})},selectors$N={list:"[data-store-availability-list]"},defaults={close:".js-modal-close",open:".js-modal-open-store-availability-modal",openClass:"modal--is-active",openBodyClass:"modal--is-visible",closeModalOnClick:!1,scrollIntoView:!1};class Modals{constructor(id,options2){if(this.modal=document.getElementById(id),!this.modal)return!1;this.nodes={parents:[document.querySelector("html"),document.body]},this.config=Object.assign(defaults,options2),this.modalIsOpen=!1,this.focusOnOpen=this.config.focusOnOpen?document.getElementById(this.config.focusOnOpen):this.modal,this.openElement=document.querySelector(this.config.open),this.a11y=a11y,this.init()}init(){this.openElement.addEventListener("click",this.open.bind(this)),this.modal.querySelector(this.config.close).addEventListener("click",this.closeModal.bind(this))}open(evt){let externalCall=!1;if(evt?evt.preventDefault():externalCall=!0,this.modalIsOpen&&!externalCall){this.closeModal();return}this.modal.classList.add(this.config.openClass),this.nodes.parents.forEac
12h(node=>{node.classList.add(this.config.openBodyClass)}),this.modalIsOpen=!0;const scrollableElement=document.querySelector(selectors$N.list);document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:scrollableElement})),this.config.scrollIntoView&&this.scrollIntoView(),this.bindEvents(),this.a11y.trapFocus({container:this.modal})}closeModal(){if(!this.modalIsOpen)return;document.activeElement.blur(),this.modal.classList.remove(this.config.openClass);var self=this;this.nodes.parents.forEach(function(node){node.classList.remove(self.config.openBodyClass)}),this.modalIsOpen=!1,this.openElement.focus(),this.unbindEvents(),this.a11y.removeTrapFocus({container:this.modal});const timeout=400;document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:timeout}))}bindEvents(){this.keyupHandler=this.keyupHandler.bind(this),this.clickHandler=this.clickHandler.bind(this),document.body.addEventListener("keyup",this.keyupHandler),document.body.addEventListener("click",this.clickHandler)}unbindEvents(){document.body.removeEventListener("keyup",this.keyupHandler),document.body.removeEventListener("click",this.clickHandler)}keyupHandler(event){event.code===theme.keyboardKeys.ESCAPE&&this.closeModal()}clickHandler(event){this.config.closeModalOnClick&&!this.modal.contains(event.target)&&!event.target.matches(this.config.open)&&this.closeModal()}scrollIntoView(){this.focusOnOpen.scrollIntoView({behavior:"smooth"})}}const selectors$M={body:"body",storeAvailabilityModal:"[data-store-availability-modal]",storeAvailabilityModalOpen:"[data-store-availability-modal-open]",storeAvailabilityModalClose:"[data-store-availability-modal-close]",storeAvailabilityModalProductTitle:"[data-store-availability-modal-product__title]"},classes$D={openClass:"store-availabilities-modal--active"};class StoreAvailability{constructor(container){this.container=container}updateContent(variantId,productTitle){this._fetchStoreAvailabilities(variantId,productTitle)}clearContent(){this.container.innerHTML=""}_initModal(){return new Modals("StoreAvailabilityModal",{close:selectors$M.storeAvailabilityModalClose,open:selectors$M.storeAvailabilityModalOpen,closeModalOnClick:!0,openClass:classes$D.openClass,scrollIntoView:!1})}_fetchStoreAvailabilities(variantId,productTitle){const variantSectionUrl="/variants/"+variantId+"/?section_id=store-availability";this.clearContent();const self=this;fetch(variantSectionUrl).then(function(response){return response.text()}).then(function(storeAvailabilityHTML){const body=document.querySelector(selectors$M.body);let storeAvailabilityModal=body.querySelector(selectors$M.storeAvailabilityModal);if(storeAvailabilityModal&&storeAvailabilityModal.remove(),self.container.innerHTML=storeAvailabilityHTML,self.container.innerHTML=self.container.firstElementChild.innerHTML,self.container.firstElementChild.innerHTML.trim()===""){self.clearContent();return}self.container.querySelector(selectors$M.storeAvailabilityModalOpen)&&(self.modal=self._initModal(),self._updateProductTitle(productTitle),storeAvailabilityModal=self.container.querySelector(selectors$M.storeAvailabilityModal),storeAvailabilityModal&&body.appendChild(storeAvailabilityModal))})}_updateProductTitle(productTitle){const storeAvailabilityModalProductTitle=this.container.querySelector(selectors$M.storeAvailabilityModalProductTitle);storeAvailabilityModalProductTitle.textContent=productTitle}}const selectors$L={form:"[data-product-form]",optionPosition:"[data-option-position]",optionInput:'[name^="options"], [data-popout-option]'},classes$C={soldOut:"sold-out",unavailable:"unavailable"},attributes$x={optionPosition:"data-option-position",selectOptionValue:"data-value"};class SelloutVariants{constructor(container,productJSON){this.container=container,this.productJSON=productJSON,this.form=this.container.querySelector(selectors$L.form),this.formData=new FormData(this.form),this.optionElements=this.container.querySelectorAll(selectors$L.optionInput),this.productJSON&&this.form&&this.init()}init(){this.update()}
12update(){this.getCurrentState(),this.optionElements.forEach(el=>{const val=el.value||el.getAttribute(attributes$x.selectOptionValue),optionSelector=el.closest(selectors$L.optionPosition);if(!optionSelector)return;const positionString=optionSelector.getAttribute(attributes$x.optionPosition),position=parseInt(positionString,10)-1;let newVals=[...this.selections];newVals[position]=val;const found=this.productJSON.variants.find(element=>{let perfectMatch=!0;for(let index=0;index<newVals.length;index++)element.options[index]!==newVals[index]&&(perfectMatch=!1);return perfectMatch});el.parentElement.classList.remove(classes$C.soldOut,classes$C.unavailable),typeof found>"u"?el.parentElement.classList.add(classes$C.unavailable):found?.available===!1&&el.parentElement.classList.add(classes$C.soldOut)})}getCurrentState(){this.formData=new FormData(this.form),this.selections=[];for(var value of this.formData.entries())value[0].includes("options[")&&this.selections.push(value[1])}}const settings$5={templateIndex:1},classes$B={popupNotification:"pswp--notification pswp--not-close-btn"},attributes$w={notificationPopup:"data-notification-popup"},options$1={history:!1,focus:!1,mainClass:classes$B.popupNotification,closeOnVerticalDrag:!1};class NotificationPopup{constructor(button){this.button=button,this.a11y=a11y,this.notificationPopupHtml=this.button.getAttribute(attributes$w.notificationPopup),this.notificationPopupHtml.trim()!==""&&this.init()}init(){const items=[{html:this.notificationPopupHtml}];this.a11y.state.trigger=this.button,new LoadPhotoswipe(items,options$1,settings$5.templateIndex)}}const selectors$K={product:"[data-product]",productForm:"[data-product-form]",addToCart:"[data-add-to-cart]",addToCartText:"[data-add-to-cart-text]",buyItNow:"[data-buy-it-now]",comparePrice:"[data-compare-price]",formWrapper:"[data-form-wrapper]",header:"[data-site-header]",originalSelectorId:"[data-product-select]",preOrderTag:"_preorder",priceWrapper:"[data-price-wrapper]",priceOffWrap:"[data-price-off]",priceOffType:"[data-price-off-type]",priceOffAmount:"[data-price-off-amount]",productSlide:"[data-product-slide]",productImage:"[data-product-image]",productMediaSlider:"[data-product-single-media-slider]",productJson:"[data-product-json]",productPrice:"[data-product-price]",unitPrice:"[data-product-unit-price]",unitBase:"[data-product-base]",unitWrapper:"[data-product-unit]",subPrices:"[data-subscription-watch-price]",subSelectors:"[data-subscription-selectors]",subsToggle:"[data-toggles-group]",subsChild:"data-group-toggle",subDescription:"[data-plan-description]",remainingCount:"[data-remaining-count]",remainingWrapper:"[data-remaining-wrapper]",remainingJSON:"[data-product-remaining-json]",idInput:'[name="id"]',storeAvailabilityContainer:"[data-store-availability-container]",upsellButton:"[data-upsell-btn]",sectionNode:".shopify-section",quickViewItem:"[data-quick-view-item]",notificationButtonText:"[data-notification-button-text]",swatchesContainer:"[data-swatches-container]",swatchesMore:"[data-swatches-more]",selectorWrapper:"[data-option-position]"},classes$A={hidden:"hidden",variantSoldOut:"variant--soldout",variantUnavailable:"variant--unavailabe",productPriceSale:"product__price--sale",priceWrapperHidden:"product__price--hidden",remainingLow:"count-is-low",remainingIn:"count-is-in",remainingOut:"count-is-out",remainingUnavailable:"count-is-unavailable",selectorVisible:"selector-wrapper--visible"},attributes$v={productImageId:"data-image-id",tallLayout:"data-tall-layout",dataEnableHistoryState:"data-enable-history-state",notificationPopup:"data-notification-popup",swatchVariant:"data-swatch-variant"};class ProductAddForm{constructor(container){if(this.container=container,this.product=this.container.querySelector(selectors$K.product),this.productForm=this.container.querySelector(selectors$K.productForm),this.tallLayout=this.container.getAttribute(attributes$v.tallLayout)==="true",!this.product||!this.productForm){new QuantityCounter(this.container).init();return}this.storeAvailabilityContainer=this.container.querySelector(selectors$K.storeAvailabilityContainer),this.enableHistoryState=this.container.getAttribute(attributes$v.dataEnableHistoryState)==="true",this.hasUnitPricing=this.container.querySelector(selectors$K.unitWrapper),this.subSelectors=this.container.querySelector(selectors$K.subSelectors),this.subPrices=this.container.querySelector(selectors$K.subPrices),this.priceOffWrap=this.container.querySelector(selectors$K.priceOffWrap),this.priceOffAmount=this.container.querySelector(selectors$K.priceOffAmount),this.priceOffType=this.container.querySelector(selectors$K.priceOffType),this.planDecription=this.container.querySelector(selectors$K.subDescription),this.swatchesContainer=this.container.querySelector(selectors$K.swatchesContainer),this.latestVariantId="",this.latestVariantTitle="",this.sellout=null,this.sessionStorage=window.sessionStorage,this.remainingWrapper=this.container.querySelector(selectors$K.remainingWrapper),this.remainingWrapper&&(this.remainingMaxInt=parseInt(this.remainingWrapper.dataset.remainingMax,10),this.remainingCount=this.container.querySelector(selectors$K.remainingCount),this.remainingJSONWrapper=this.container.querySelector(selectors$K.remainingJSON),this.remainingJSON=null,this.remainingJSONWrapper&&this.remainingJSONWrapper.innerHTML!==""&&(this.remainingJSON=JSON.parse(this.remainingJSONWrapper.innerHTML))),this.storeAvailabilityContainer&&(this.storeAvailability=new StoreAvailability(this.storeAvailabilityContainer)),new QuantityCounter(this.container).init(),this.init()}init(){let productJSON=null;const productElemJSON=this.container.querySelector(selectors$K.productJson);productElemJSON&&(productJSON=productElemJSON.innerHTML),productJSON?(this.productJSON=JSON.parse(productJSON),this.linkForm(),this.sellout=new SelloutVariants(this.container,this.productJSON)):console.error("Missing product JSON")}destroy(){this.productForm.destroy()}linkForm(){this.productForm=new ProductForm(this.productForm,this.productJSON,{onOptionChange:this.onOptionChange.bind(this),onPlanChange:this.onPlanChange.bind(this)});const formState=this.productForm.getFormState();if(this.pushState(formState,!0),this.subsToggleListeners(),this.swatchesContainer){this.observeSwatch(formState);const selectorWrapper=this.swatchesContainer.closest(selectors$K.selectorWrapper);selectorWrapper.querySelector(selectors$K.swatchesMore)?.addEventListener("click",event=>{event.preventDefault(),selectorWrapper.classList.contains(classe
12s$A.selectorVisible)?selectorWrapper.classList.remove(classes$A.selectorVisible):selectorWrapper.classList.add(classes$A.selectorVisible)})}}onOptionChange(evt){this.pushState(evt.dataset),this.updateProductImage(evt)}onPlanChange(evt){this.subPrices&&this.pushState(evt.dataset)}pushState(formState,init=!1){this.productState=this.setProductState(formState),this.updateAddToCartState(formState),this.updateProductPrices(formState),this.updateSaleText(formState),this.updateSubscriptionText(formState),this.fireHookEvent(formState),this.updateRemaining(formState),this.sellout?.update(formState),this.enableHistoryState&&!init&&this.updateHistoryState(formState),this.storeAvailability&&(formState.variant?this.storeAvailability.updateContent(formState.variant.id,this.productForm.product.title):this.storeAvailability.clearContent())}updateAddToCartState(formState){const variant=formState.variant,priceWrapper=this.container.querySelectorAll(selectors$K.priceWrapper),addToCart=this.container.querySelectorAll(selectors$K.addToCart),addToCartText=this.container.querySelectorAll(selectors$K.addToCartText),formWrapper=this.container.querySelectorAll(selectors$K.formWrapper),buyItNow=this.container.querySelector(selectors$K.buyItNow);let addText=theme.strings.add_to_cart;this.productJSON.tags.includes(selectors$K.preOrderTag)&&(addText=theme.strings.preorder),priceWrapper?.forEach(element=>{element.classList.toggle(classes$A.priceWrapperHidden,!variant)}),addToCart?.forEach(element=>{if(element.matches(selectors$K.upsellButton)||(element.disabled=!0,buyItNow?.classList.add(classes$A.hidden),!variant)||(element.disabled=!1,variant.available&&buyItNow?.classList.remove(classes$A.hidden),!element.hasAttribute(attributes$v.notificationPopup)))return;
12const notificationFormId=element.id.replace("AddToCart","NotificationForm"),formID=this.sessionStorage.getItem("notification_form_id");let notificationFormSubmitted=!1,variantId=variant.id,variantTitle=variant.title;if(formID){const sessionId=formID.substring(0,formID.lastIndexOf("--")),sessionVariantId=formID.split("--").slice(-1)[0];notificationFormSubmitted=notificationFormId===sessionId,notificationFormSubmitted&&(this.latestVariantId=variantId,this.latestVariantTitle=variantTitle,variantId=Number(sessionVariantId),this.productJSON.variants.forEach(variant2=>{variant2.id===variantId&&(variantTitle=variant2.title)}))}let notificationPopupHtml=element.getAttribute(attributes$v.notificationPopup);const notificationButtonText=new DOMParser().parseFromString(notificationPopupHtml,"text/html").querySelector(selectors$K.notificationButtonText)?.innerHTML;if(this.latestVariantId!=""&&this.latestVariantTitle!=""){notificationPopupHtml=notificationPopupHtml.replaceAll(this.latestVariantId,variantId),notificationPopupHtml=notificationPopupHtml.replaceAll(this.latestVariantTitle,variantTitle);const updatedNotificationButtonText=new DOMParser().parseFromString(notificationPopupHtml,"text/html").querySelector(selectors$K.notificationButtonText)?.innerHTML;notificationPopupHtml=notificationPopupHtml.replace(updatedNotificationButtonText,notificationButtonText)}element.setAttribute(attributes$v.notificationPopup,notificationPopupHtml),notificationFormSubmitted&&(this.scrollToForm(this.product.closest(selectors$K.sectionNode)),new NotificationPopup(element)),this.latestVariantId=variantId,this.latestVariantTitle=variantTitle}),addToCartText?.forEach(element=>{if(!variant){element.innerHTML=theme.strings.unavailable;return}if(!variant.available){if(element.innerHTML=theme.strings.sold_out,element.parentNode.hasAttribute(attributes$v.notificationPopup)){if(element.closest(selectors$K.quickViewItem))return;element.innerHTML=`${theme.strings.sold_out} - ${theme.strings.newsletter_product_availability}`}return}let labelText=addText;if(element.closest(selectors$K.quickViewItem)){const priceText=this.getVariantDisplayPriceForButton(formState);priceText&&(labelText=`${addText} \u2014 ${priceText}`)}element.innerHTML=labelText}),formWrapper?.forEach(element=>{if(!variant){element.classList.add(classes$A.variantUnavailable),element.classList.remove(classes$A.variantSoldOut);return}const formSelect=element.querySelector(selectors$K.originalSelectorId);if(formSelect&&(formSelect.value=variant.id),!variant.available){element.classList.add(classes$A.variantSoldOut),element.classList.remove(classes$A.variantUnavailable);return}element.classList.remove(classes$A.variantSoldOut,classes$A.variantUnavailable)})}updateHistoryState(formState){const variant=formState.variant,plan=formState.plan,location2=window.location.href;if(variant&&location2.includes("/product")){const url=new window.URL(location2),params=url.searchParams;params.set("variant",variant.id),plan&&plan.detail&&plan.detail.id&&this.productState.hasPlan?params.set("selling_plan",plan.detail.id):params.delete("selling_plan"),url.search=params.toString();const urlString=url.toString();window.history.replaceState({path:urlString},"",urlString)}}updateRemaining(formState){const variant=formState.variant,remainingClasses=[classes$A.remainingIn,classes$A.remainingOut,classes$A.remainingUnavailable,classes$A.remainingLow];if(variant&&this.remainingWrapper&&this.remainingJSON){const remaining=this.remainingJSON[variant.id];(remaining==="out"||remaining<1)&&(this.remainingWrapper.classList.remove(...remainingClasses),this.remainingWrapper.classList.add(classes$A.remainingOut)),(remaining==="in"||remaining>=this.remainingMaxInt)&&(this.remainingWrapper.classList.remove(...remainingClasses),this.remainingWrapper.classList.add(classes$A.remainingIn)),(remaining==="low"||remaining>0&&remaining<this.remainingMaxInt)&&(this.remainingWrapper.classList.remove(...remainingClasses),this.remainingWrapper.classList.add(classes$A.remainingLow),this.remainingCount&&(this.remainingCount.innerHTML=remaining))}else!variant&&this.remainingWrapper&&(this.remainingWrapper.classList.remove(...remainingClasses),this.remainingWrapper.classList.add(classes$A.remainingUnavailable))}getBaseUnit(variant){return variant.unit_price_measurement.reference_value===1?variant.unit_price_measurement.reference_unit:variant.unit_price_measurement.reference_value+variant.unit_price_measurement.reference_unit}subsToggleListeners(){this.container.querySelectorAll(selectors$K.subsToggle).forEach(toggle=>{toggle.addEventListener("change",function(e){const val=e.target.value.toString(),selected=this.container.querySelector(`[${selectors$K.subsChild}="${val}"]`),groups=this.container.querySelectorAll(`[${selectors$K.subsChild}]`);if(selected){selected.classList.remove(classes$A.hidden);const first=selected.querySelector('[name="selling_plan"]');first.checked=!0,first.dispatchEvent(new Event("change"))}groups.forEach(group=>{group!==selected&&(group.classList.add(classes$A.hidden),group.querySelectorAll('[name="selling_plan"]').forEach(plan=>{plan.checked=!1,plan.dispatchEvent(new Event("change"))}))})}.bind(this))})}parseActiveSellingPlanGroupIdsFromProduct(){if(!this.product)return[];const raw=this.product.getAttribute("data-active-selling-plan-group-ids");return!raw||!String(raw).trim()?[]:String(raw).split(",").map(s=>
12s.trim()).filter(Boolean)}getActiveSellingPlanGroupIdsFromProductJson(){if(!this.product||!this.productJSON||!Array.isArray(this.productJSON.selling_plan_groups))return[];const raw=this.product.getAttribute("data-active-app-id");if(!raw||!String(raw).trim())return[];const appId=String(raw).trim();return this.productJSON.selling_plan_groups.filter(g=>g&&g.app_id!=null&&String(g.app_id)===appId).map(g=>String(g.id)).filter(Boolean)}getActiveSellingPlanGroupIds(){const fromAttr=this.parseActiveSellingPlanGroupIdsFromProduct();let ids2=fromAttr;if(!fromAttr.length){const groups=(this.subSelectors||this.container).querySelectorAll(`[${selectors$K.subsChild}]`),fromDom=Array.from(groups).map(group=>group.getAttribute(selectors$K.subsChild)).filter(Boolean);fromDom.length?ids2=fromDom:ids2=this.getActiveSellingPlanGroupIdsFromProductJson()}return ids2}getActiveAllocationForVariant(variant){let picked=null;if(!variant||!variant.selling_plan_allocations||!variant.selling_plan_allocations.length)return picked;const allocs=variant.selling_plan_allocations,activeGroupIds=this.getActiveSellingPlanGroupIds();if(activeGroupIds.length)picked=allocs.find(item=>activeGroupIds.includes(item.selling_plan_group_id?.toString()))||null;else if(allocs.length===1)picked=allocs[0];else{const firstGroup=allocs[0].selling_plan_group_id;picked=allocs.every(a=>String(a.selling_plan_group_id)===String(firstGroup))?allocs[0]:null}return picked}updateSaleText(formState){this.productState.planSale||(this.productState.onSale?this.updateSaleTextStandard(formState):this.priceOffWrap&&this.priceOffWrap.classList.add(classes$A.hidden))}updateSaleTextStandard(formState){if(!this.priceOffType)return;this.priceOffType.innerHTML=window.theme.strings.sale_badge_text||"sale";const variant=formState.variant;if(window.theme.settings.savingBadgeType&&window.theme.settings.savingBadgeType==="percentage"){const discountFloat=(variant.compare_at_price-variant.price)/variant.compare_at_price,discountInt=Math.floor(discountFloat*100);this.priceOffAmount.innerHTML=`${discountInt}%`}else{const discount=variant.compare_at_price-variant.price;this.priceOffAmount.innerHTML=themeCurrency.formatMoney(discount,theme.moneyFormat)}this.priceOffWrap.classList.remove(classes$A.hidden)}updateSaleTextSubscription(formState){const variant=formState.variant,variantFirstPlan=this.productForm.product.selling_plan_groups.find(plan=>plan.id===variant.selling_plan_allocations[0].selling_plan_group_id),adjustment=formState.plan?formState.plan.detail.price_adjustments[0]:variantFirstPlan.selling_plans[0].price_adjustments[0],discount=adjustment.value||0,saleText=adjustment.value_type==="percentage"?`${discount}%`:themeCurrency.formatMoney(variant.price-discount,theme.moneyFormat);this.priceOffType.innerHTML=window.theme.strings.subscription||"subscripton",this.priceOffAmount.innerHTML=saleText,this.priceOffWrap.classList.remove(classes$A.hidden)}updateSubscriptionText(formState){formState.plan&&this.planDecription&&formState.plan.detail.description!==null?(this.planDecription.innerHTML=formState.plan.detail.description,this.planDecription.classList.remove(classes$A.hidden)):this.planDecription&&this.planDecription.classList.add(classes$A.hidden)}updateProductPrices(formState){const variant=formState.variant,plan=formState.plan,activeAllocation=this.getActiveAllocationForVariant(variant);this.container.querySelectorAll(selectors$K.priceWrapper).forEach(wrap2=>{const comparePriceEl=wrap2.querySelector(selectors$K.comparePrice),productPriceEl=wrap2.querySelector(selectors$K.productPrice);if(!productPriceEl)return;let comparePrice="",price="";if(this.productState.available&&(comparePrice=variant.compare_at_price,price=variant.price),this.productState.hasPlan&&(price=plan?plan.allocation.price:activeAllocation?.per_delivery_price),this.productState.planSale){const allocationPrice=plan?plan.allocation.price:activeAllocation?.per_delivery_price;comparePrice=plan?plan.allocation.compare_at_price:activeAllocation?.compare_at_price,price=allocationPrice}let compareHtmlWritten=null;comparePriceEl&&(this.productState.onSale||this.productState.planSale?(comparePriceEl.classList.remove(classes$A.hidden),productPriceEl.classList.add(classes$A.productPriceSale)):(comparePriceEl.classList.add(classes$A.hidden),productPriceEl.classList.remove(classes$A.productPriceSale)),compareHtmlWritten=theme.settings.currency_code_enable?theme
12Currency.formatMoney(comparePrice,theme.moneyWithCurrencyFormat):themeCurrency.formatMoney(comparePrice,theme.moneyFormat),comparePriceEl.innerHTML=compareHtmlWritten);const productHtmlWritten=price===0?window.theme.strings.free:theme.settings.currency_code_enable?themeCurrency.formatMoney(price,theme.moneyWithCurrencyFormat):themeCurrency.formatMoney(price,theme.moneyFormat);productPriceEl.innerHTML=productHtmlWritten}),this.hasUnitPricing&&this.updateProductUnits(formState)}getVariantDisplayPriceForButton(formState){const variant=formState.variant,plan=formState.plan,activeAllocation=this.getActiveAllocationForVariant(variant);if(!variant||!this.productState.available)return"";let price=variant.price;return this.productState.hasPlan&&(price=plan?plan.allocation.price:activeAllocation?.per_delivery_price),this.productState.planSale&&(price=plan?plan.allocation.price:activeAllocation?.per_delivery_price),price===0?window.theme.strings.free:theme.settings.currency_code_enable?themeCurrency.formatMoney(price,theme.moneyWithCurrencyFormat):themeCurrency.formatMoney(price,theme.moneyFormat)}updateProductUnits(formState){const variant=formState.variant,plan=formState.plan,activeAllocation=this.getActiveAllocationForVariant(variant);let unitPrice=null;if(variant&&variant.unit_price&&(unitPrice=variant.unit_price),plan&&plan?.allocation&&plan?.allocation.unit_price&&(unitPrice=plan.allocation.unit_price),!plan&&activeAllocation?.unit_price&&(unitPrice=activeAllocation.unit_price),unitPrice){const base=this.getBaseUnit(variant),formattedPrice=unitPrice===0?window.theme.strings.free:themeCurrency.formatMoney(unitPrice,theme.moneyFormat);this.container.querySelector(selectors$K.unitPrice).innerHTML=formattedPrice,this.container.querySelector(selectors$K.unitBase).innerHTML=base,showElement(this.container.querySelector(selectors$K.unitWrapper))}else hideElement(this.container.querySelector(selectors$K.unitWrapper))}fireHookEvent(formState){const variant=formState.variant;this.container.dispatchEvent(new CustomEvent("theme:variant:change",{detail:{variant},bubbles:!0}))}setProductState(dataset){const variant=dataset.variant,plan=dataset.plan,activeAllocation=this.getActiveAllocationForVariant(variant),productState={available:!0,soldOut:!1,onSale:!1,showUnitPrice:!1,requiresPlan:!1,hasPlan:!1,planPerDelivery:!1,planSale:!1};if(!variant)productState.available=!1;else{const requiresPlan=variant.requires_selling_plan||!1;variant.available||(productState.soldOut=!0),variant.compare_at_price>variant.price&&(productState.onSale=!0),variant.unit_price&&(productState.showUnitPrice=!0),this.product&&this.product.requires_selling_plan&&(productState.requiresPlan=!0),plan&&this.subPrices&&(productState.hasPlan=!0,plan.allocation.per_delivery_price!==plan.allocation.price&&(productState.planPerDelivery=!0),variant.price>plan.allocation.price&&(productState.planSale=!0)),!plan&&requiresPlan&&(productState.hasPlan=!0,activeAllocation&&activeAllocation.per_delivery_price!==activeAllocation.price&&(productState.planPerDelivery=!0),activeAllocation&&variant.price>activeAllocation.price&&(productState.planSale=!0))}return productState}updateProductImage(evt){const variant=evt.dataset.variant;if(!variant||!variant?.featured_media)return;const newImg=this.container.querySelector(`${selectors$K.productImage}[${attributes$v.productImageId}="${variant.featured_media.id}"]`),newImageParent=newImg?.closest(selectors$K.productSlide);if(newImageParent){const newImagePos=parseInt([...newImageParent.parentElement.children].indexOf(newImageParent)),imgSlider=this.container.querySelector(selectors$K.productMediaSlider),flkty=Flickity.data(imgSlider);if(flkty&&flkty.isActive){const variantSlide=imgSlider.querySelector(`[data-id="${variant.featured_media.id}"]`);if(variantSlide){const slideIndex=parseInt([...variantSlide.parentNode.children].indexOf(variantSlide));flkty.select(slideIndex)}return}if(this.tallLayout){const newImgTop=newImg.getBoundingClientRect().top;if(newImagePos===0&&newImgTop+window.scrollY>window.pageYOffset)return;document.dispatchEvent(new CustomEvent("theme:tooltip:close",{bubbles:!1,detail:{hideTransition:!1}})),scrollTo(newImgTop)}}}observeSwatch(formState){const swatch=this.swatchesContainer.querySelector(`[${attributes$v.swatchVariant}*="${formState.variant.id}"]`);this.swatchesContainer.closest(selectors$K.selectorWrapper).classList.remove(classes$A.selectorVisible),new IntersectionObserver((entries,observer2)=>
12{entries.forEach(entry=>{entry.intersectionRatio==0&&this.swatchesContainer.closest(selectors$K.selectorWrapper).classList.add(classes$A.selectorVisible)})},{root:this.container,threshold:[.95,1]}).observe(swatch)}scrollToForm(section){const headerHeight=document.querySelector(selectors$K.header)?.dataset.height;visibilityHelper.isElementPartiallyVisible(section)||visibilityHelper.isElementTotallyVisible(section)||setTimeout(()=>{const sectionTop=section.getBoundingClientRect().top-headerHeight;window.scrollTo({top:sectionTop,left:0,behavior:"smooth"})},400)}}const productFormSection={onLoad(){this.section=new ProductAddForm(this.container)}},selectors$J={form:"form",popoutWrapper:"[data-popout]",popoutList:"[data-popout-list]",popoutToggle:"[data-popout-toggle]",popoutInput:"[data-popout-input]",popoutOptions:"[data-popout-option]",popoutText:"[data-popout-text]",ariaCurrent:"[aria-current]",productGridImage:"[data-product-image]",productGrid:"[data-product-grid-item]"},classes$z={listVisible:"select-popout__list--visible",popoutAlternative:"select-popout--alt",currentSuffix:"--current",visible:"is-visible"},attributes$u={ariaCurrent:"aria-current",ariaExpanded:"aria-expanded",dataValue:"data-value",popoutPrevent:"data-popout-prevent",popoutQuantity:"data-quantity-field",quickViewItem:"data-quick-view-item"};let sections$s={};class Popout{constructor(popout){this.popout=popout,this.popoutList=this.popout.querySelector(selectors$J.popoutList),this.popoutToggle=this.popout.querySelector(selectors$J.popoutToggle),this.popoutText=this.popout.querySelector(selectors$J.popoutText),this.popoutInput=this.popout.querySelector(selectors$J.popoutInput),this.popoutOptions=this.popout.querySelectorAll(selectors$J.popoutOptions),this.popoutPrevent=this.popout.getAttribute(attributes$u.popoutPrevent)==="true",this.popupToggleFocusoutEvent=evt=>this.popupToggleFocusout(evt),this.popupListFocusoutEvent=evt=>this.popupListFocusout(evt),this.popupToggleClickEvent=evt=>this.popupToggleClick(evt),this.popoutKeyupEvent=evt=>this.popoutKeyup(evt),this.popupOptionsClickEvent=evt=>this.popupOptionsClick(evt),this._connectOptionsDispatchEvent=evt=>this._connectOptionsDispatch(evt),this.bodyClick=this.bodyClick.bind(this),this.updatePopout=this.updatePopout.bind(this),this._connectOptions(),this._connectToggle(),this._onFocusOut(),this.popoutInput&&this.popoutInput.hasAttribute(attributes$u.popoutQuantity)&&document.addEventListener("theme:cart:update",this.updatePopout)}unload(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.removeEventListener("theme:popout:click",this.popupOptionsClickEvent),element.removeEventListener("click",this._connectOptionsDispatchEvent)}),this.popoutToggle.removeEventListener("click",this.popupToggleClickEvent),this.popoutToggle.removeEventListener("focusout",this.popupToggleFocusoutEvent),this.popoutList.removeEventListener("focusout",this.popupListFocusoutEvent),this.popout.removeEventListener("keyup",this.popoutKeyupEvent),document.removeEventListener("theme:cart:update",this.updatePopout),document.body.removeEventListener("click",this.bodyClick)}popupToggleClick(evt){const ariaExpanded=evt.currentTarget.getAttribute(attributes$u.ariaExpanded)==="true";
12if(this.popoutList.closest(selectors$J.productGrid)){const productGridItemImage=this.popoutList.closest(selectors$J.productGrid).querySelector(selectors$J.productGridImage);productGridItemImage&&productGridItemImage.classList.toggle(classes$z.visible,!ariaExpanded)}evt.currentTarget.setAttribute(attributes$u.ariaExpanded,!ariaExpanded),this.popoutList.classList.toggle(classes$z.listVisible)}popupToggleFocusout(evt){if(!evt.relatedTarget)return;const popoutLostFocus=this.popout.contains(evt.relatedTarget),popoutFromQuickView=evt.relatedTarget.hasAttribute(attributes$u.quickViewItem);!popoutLostFocus&&!popoutFromQuickView&&this._hideList()}popupListFocusout(evt){const childInFocus=evt.currentTarget.contains(evt.relatedTarget);this.popoutList.classList.contains(classes$z.listVisible)&&!childInFocus&&this._hideList()}popupOptionsClick(evt){if(evt.target.closest(selectors$J.popoutOptions).attributes.href.value==="#"){evt.preventDefault();let attrValue="";if(evt.currentTarget.getAttribute(attributes$u.dataValue)&&(attrValue=evt.currentTarget.getAttribute(attributes$u.dataValue)),this.popoutInput.value=attrValue,this.popoutPrevent){this.popoutInput.dispatchEvent(new Event("change")),!evt.detail.preventTrigger&&this.popoutInput.hasAttribute(attributes$u.popoutQuantity)&&this.popoutInput.dispatchEvent(new Event("input"));
12const currentElement=this.popoutList.querySelector(`[class*="${classes$z.currentSuffix}"]`);let targetClass=classes$z.currentSuffix;if(currentElement&¤tElement.classList.length){for(const currentElementClass of currentElement.classList)if(currentElementClass.includes(classes$z.currentSuffix)){targetClass=currentElementClass;break}}const listTargetElement=this.popoutList.querySelector(`.${targetClass}`);listTargetElement&&(listTargetElement.classList.remove(`${targetClass}`),evt.currentTarget.parentElement.classList.add(`${targetClass}`));const targetAttribute=this.popoutList.querySelector(selectors$J.ariaCurrent);targetAttribute&&(targetAttribute.removeAttribute(attributes$u.ariaCurrent),evt.currentTarget.setAttribute(attributes$u.ariaCurrent,"true")),attrValue!==""&&(this.popoutText.textContent=attrValue),this.popupToggleFocusout(evt),this.popupListFocusout(evt)}else this._submitForm(attrValue)}}updatePopout(){const targetElement=this.popoutList.querySelector(`[${attributes$u.dataValue}="${this.popoutInput.value}"]`);targetElement?(targetElement.dispatchEvent(new CustomEvent("theme:popout:click",{cancelable:!0,bubbles:!0,detail:{preventTrigger:!0}})),targetElement.parentElement.nextSibling||this.popout.classList.add(classes$z.popoutAlternative)):this.popout.classList.add(classes$z.popoutAlternative)}popoutKeyup(event){event.code===theme.keyboardKeys.ESCAPE&&(this._hideList(),this.popoutToggle.focus())}bodyClick(event){const isOption=this.popout.contains(event.target);this.popoutList.classList.contains(classes$z.listVisible)&&!isOption&&this._hideList()}_connectToggle(){this.popoutToggle.addEventListener("click",this.popupToggleClickEvent)}_connectOptions(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.addEventListener("theme:popout:click",this.popupOptionsClickEvent),element.addEventListener("click",this._connectOptionsDispatchEvent)})}_connectOptionsDispatch(evt){const event=new CustomEvent("theme:popout:click",{cancelable:!0,bubbles:!0,detail:{preventTrigger:!1}});evt.target.dispatchEvent(event)||evt.preventDefault()}_onFocusOut(){this.popoutToggle.addEventListener("focusout",this.popupToggleFocusoutEvent),this.popoutList.addEventListener("focusout",this.popupListFocusoutEvent),this.popout.addEventListener("keyup",this.popoutKeyupEvent),document.body.addEventListener("click",this.bodyClick)}_submitForm(){const form=this.popout.closest(selectors$J.form);form&&form.submit()}_hideList(){this.popoutList.classList.remove(classes$z.listVisible),this.popoutToggle.setAttribute(attributes$u.ariaExpanded,!1)}}const popoutSection={onLoad(){sections$s[this.id]=[],this.container.querySelectorAll(selectors$J.popoutWrapper).forEach(wrapper=>{sections$s[this.id].push(new Popout(wrapper))})},onUnload(){sections$s[this.id].forEach(popout=>{typeof popout.unload=="function"&&popout.unload()})}},selectors$I={addToCart:"[data-add-to-cart]",deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]",popupClose:"[data-popup-close]",popout:"[data-popout]",quickViewInner:"[data-quick-view-inner]",quickViewItemHolder:"[data-quick-view-item-holder]",product:"[data-product]",productForm:"[data-product-form]",productMediaSlider:"[data-product-single-media-slider]",productMediaWrapper:"[data-product-single-media-wrapper]",productModel:"[data-model]",productJSON:"[data-product-json]",quickViewFootInner:"[data-quick-view-foot-inner]",shopTheLookThumb:"[data-shop-the-look-thumb]",tooltip:"[data-tooltip]",drawerToggle:"[data-drawer-toggle]"},classes$y={hasMediaActive:"has-media-active",isActive:"is-active",isLoading:"is-loading",mediaHidden:"media--hidden",noOutline:"no-outline",notificationPopupVisible:"notification-popup-visible",popupQuickViewAnimateIn:"popup-quick-view--animate-in",popupQuickViewAnimateOut:"popup-quick-view--animate-out",popupQuickViewAnimated:"popup-quick-view--animated",popupQuickView:"popup-quick-view",jsQuickViewVisible:"js-quick-view-visible",jsQuickViewFromCart:"js-quick-view-from-cart",drawerOpen:"js-drawer-open"},attributes$t={id:"id",mediaId:"data-media-id",sectionId:"data-section-id",handle:"data-handle",loaded:"loaded",tabindex:"tabindex",quickViewOnboarding:"data-quick-view-onboarding",hotspot:"data-hotspot",hotspotRef:"data-hotspot-ref"},ids={addToCartFormId:"AddToCartForm--",addToCartId:"AddToCart--"};class LoadQuickview{constructor(popup,pswpElement){this.popup=popup,this.pswpElement=pswpElement,this.quickViewFoot=this.pswpElement.querySelector(selectors$I.quickViewFootInner),this.quickViewInner=this.pswpElement.querySelector(selectors$I.quickViewInner),this.product=this.pswpElement.querySelectorAll(selectors$I.product),this.flkty=[],this.videos=[],this.productForms=[],this.deferredMedias=this.pswpElement.querySelectorAll(selectors$I.deferredMedia),this.buttonsShopTheLookThumb=this.pswpElement.querySelectorAll(selectors$I.shopTheLookThumb),this.quickViewItemHolders=this.pswpElement.querySelectorAll(selectors$I.quickViewItemHolder),this.popupCloseButtons=this.quickViewInner.querySelectorAll(selectors$I.popupClose),this.a11y=a11y,this.prevent3dModelSubmitEvent=event=>this.prevent3dModelSubmit(event),this.closeOnAnimationEndEvent=event=>this.closeOnAnimationEnd(event),this.closeOnEscapeEvent=event=>this.closeOnEscape(event),this.outerCloseEvent=event=>
12{if(!this.quickViewInner.contains(event.target)){const drawer2=this.quickViewInner.nextElementSibling;if(drawer2&&drawer2.contains(event.target))return;this.closePopup(event)}},this.product.forEach((item,index)=>{item.hasAttribute(attributes$t.quickViewOnboarding)||this.initItems(item,index)}),this.init(),this.initTooltips(),this.initPopouts(),this.swatchesContainer=new SwatchesContainer(this.pswpElement)}initTooltips(){this.tooltips=this.pswpElement.querySelectorAll(selectors$I.tooltip),this.tooltips.forEach(tooltip2=>{new Tooltip(tooltip2)})}initPopouts(){this.popoutElements=this.pswpElement.querySelectorAll(selectors$I.popout),this.popouts={},this.popoutElements?.forEach((popout,index)=>{this.popouts[index]=new Popout(popout)})}handleDraggable(slider2,draggableStatus){slider2&&(slider2.options.draggable=!!draggableStatus,slider2.updateDraggable())}initItems(item,index){this.addFormSuffix(item),this.initProductSlider(item,index),this.initProductVideo(item),this.initProductModel(item),this.initShopifyXrLaunch(item),makeSwatches(item),this.pswpElement.querySelectorAll(selectors$I.drawerToggle).length&&new Drawer(item),wrapElements(item);const productForm=new ProductAddForm(item.parentNode);this.productForms.push(productForm),Shopify.PaymentButton&&Shopify.PaymentButton.init(),item.classList.remove(classes$y.isLoading)}init(){document.addEventListener("submit",this.prevent3dModelSubmitEvent),this.popupCloseButtons.forEach(popupClose=>{popupClose.addEventListener("keyup",event=>{(event.code===theme.keyboardKeys.ENTER||event.code===theme.keyboardKeys.NUMPADENTER||event.code===theme.keyboardKeys.SPACE)&&this.closePopup(event)}),popupClose.addEventListener("click",event=>{this.closePopup(event)})}),this.pswpElement.addEventListener("click",this.outerCloseEvent),document.dispatchEvent(new CustomEvent("theme:popup:open",{bubbles:!0})),this.popup.listen("preventDragEvent",(e,isDown,preventObj)=>{preventObj.prevent=!1}),this.pswpElement.addEventListener("mousedown",()=>{this.popup.framework.unbind(window,"pointermove pointerup pointercancel",this.popup)}),this.popup.listen("initialZoomInEnd",()=>{document.body.classList.add(classes$y.jsQuickViewVisible),this.a11y.trapFocus({container:this.quickViewInner})}),this.pswpElement.addEventListener("animationend",this.closeOnAnimationEndEvent),this.popup.listen("destroy",()=>{this.flkty.length>0&&requestAnimationFrame(()=>
12{this.flkty.forEach(slider2=>slider2.pausePlayer())}),document.body.classList.remove(classes$y.jsQuickViewVisible),document.removeEventListener("keyup",this.closeOnEscapeEvent),document.addEventListener("keyup",this.closeOnEscapeEvent),this.pswpElement.removeEventListener("click",this.outerCloseEvent),this.pswpElement.removeEventListener("animationend",this.closeOnAnimationEndEvent),document.removeEventListener("submit",this.prevent3dModelSubmitEvent),this.deferredMedias.forEach(deferredMedia=>{deferredMedia.removeAttribute(attributes$t.loaded)})}),document.addEventListener("keyup",this.closeOnEscapeEvent),document.addEventListener("theme:cart:added",()=>{this.pswpElement.classList.contains(classes$y.popupQuickView)&&this.pswpElement.classList.add(classes$y.popupQuickViewAnimateOut)}),this.animateInQuickview(),this.initShopTheLookListeners()}initShopTheLookListeners(){this.buttonsShopTheLookThumb?.forEach(button=>{button.addEventListener("click",event=>{event.preventDefault();const thumb=event.target.matches(selectors$I.shopTheLookThumb)?event.target:event.target.closest(selectors$I.shopTheLookThumb),holder=this.pswpElement.querySelector(`[${attributes$t.hotspot}="${thumb.getAttribute(attributes$t.hotspotRef)}"]`);thumb.classList.contains(classes$y.isActive)||!holder||(this.flkty.length>0&&requestAnimationFrame(()=>
12{this.flkty.forEach(slider2=>{slider2.resize();const allMediaItems=this.quickViewInner.querySelectorAll(selectors$I.productMediaWrapper);allMediaItems.length&&allMediaItems.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes$y.mediaHidden)})})}),holder.classList.add(classes$y.isActive),this.quickViewItemHolders.forEach(element=>{element!==holder&&element.classList.remove(classes$y.isActive)}))})})}prevent3dModelSubmit(event){event.submitter.closest(selectors$I.deferredMedia)&&event.submitter.closest(selectors$I.productForm)&&event.preventDefault()}closeQuickviewOnMobile(){window.innerWidth<window.theme.sizes.large&&document.body.classList.contains(classes$y.jsQuickViewVisible)&&this.popup.close()}animateInQuickview(){this.pswpElement.classList.add(classes$y.popupQuickViewAnimateIn),this.quickViewFoot.addEventListener("animationend",event=>{this.handleAnimatedState(event)}),this.pswpElement.addEventListener("animationend",event=>{this.handleAnimatedState(event,!0)})}handleAnimatedState(event,isMobileAnimation=!1){if(event.animationName=="quickViewAnimateInUp"){if(isMobileAnimation&&window.innerWidth>=window.theme.sizes.small)return;this.pswpElement.classList.add(classes$y.popupQuickViewAnimated),this.pswpElement.classList.remove(classes$y.popupQuickViewAnimateIn),document.body.classList.remove(classes$y.jsQuickViewFromCart),removeLoadingClassFromLoadedImages(this.pswpElement)}}closePopup(event){event?.preventDefault(),document.body.classList.contains(classes$y.drawerOpen)&&document.dispatchEvent(new CustomEvent("theme:drawer:closing",{bubbles:!0})),this.pswpElement.classList.add(classes$y.popupQuickViewAnimateOut),this.productForms.length>0&&this.productForms.forEach(form=>{form.destroy()}),this.swatchesContainer.onUnload()}closeOnAnimationEnd(event){(event.animationName=="quickViewAnimateOutRight"||event.animationName=="quickViewAnimateOutDown")&&(this.popup.template.classList.remove(classes$y.popupQuickViewAnimateOut,classes$y.popupQuickViewAnimated),this.popup.close())}closeOnEscape(event){const isQuickViewVisible=document.body.classList.contains(classes$y.jsQuickViewVisible),isNotificationVisible=document.body.classList.contains(classes$y.notificationPopupVisible);event.code===theme.keyboardKeys.ESCAPE&&isQuickViewVisible&&!isNotificationVisible&&this.closePopup(event)}initProductSlider(item,index){const slider2=item.querySelector(selectors$I.productMediaSlider),mediaItems=item.querySelectorAll(selectors$I.productMediaWrapper);if(mediaItems.length>1){const itemSlider=new Flickity(slider2,{wrapAround:!0,cellAlign:"left",pageDots:!1,prevNextButtons:!0,adaptiveHeight:!1,pauseAutoPlayOnHover:!1,selectedAttraction:.2,friction:1,autoPlay:!1,on:{ready:()=>{slider2.setAttribute(attributes$t.tabindex,"-1"),requestAnimationFrame(()=>{itemSlider.resize()})},settle:()=>{const currentSlide=itemSlider.selectedElement,mediaId=currentSlide.getAttribute(attributes$t.mediaId);currentSlide.setAttribute(attributes$t.tabindex,"0"),itemSlider.cells.forEach(sli
12de=>{slide.element!==currentSlide&&slide.element.setAttribute(attributes$t.tabindex,"-1")}),this.switchMedia(item,mediaId)}}});this.flkty.push(itemSlider),mediaItems.length&&mediaItems.forEach(element=>{element.addEventListener("theme:media:play",()=>{this.handleDraggable(this.flkty[index],!1),element.closest(selectors$I.productMediaSlider).classList.add(classes$y.hasMediaActive)}),element.addEventListener("theme:media:pause",()=>{this.handleDraggable(this.flkty[index],!0),element.closest(selectors$I.productMediaSlider).classList.remove(classes$y.hasMediaActive)})}),flickitySmoothScrolling(slider2)}}switchMedia(item,mediaId){const allMediaItems=this.quickViewInner.querySelectorAll(selectors$I.productMediaWrapper),selectedMedia=item.querySelector(`${selectors$I.productMediaWrapper}[${attributes$t.mediaId}="${mediaId}"]`),isFocusEnabled=!document.body.classList.contains(classes$y.noOutline);allMediaItems.length&&allMediaItems.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes$y.mediaHidden)}),isFocusEnabled&&selectedMedia.focus(),selectedMedia.closest(selectors$I.productMediaSlider).classList.remove(classes$y.hasMediaActive),selectedMedia.classList.remove(classes$y.mediaHidden),selectedMedia.dispatchEvent(new CustomEvent("theme:media:visible"),{bubbles:!0});const deferredMedia=selectedMedia.querySelector(selectors$I.deferredMedia);deferredMedia&&deferredMedia.getAttribute(attributes$t.loaded)!=="true"&&selectedMedia.querySelector(selectors$I.deferredMediaButton).dispatchEvent(new Event("click"))}initProductVideo(item){const videos=new ProductVideo(item);this.videos.push(videos)}initProductModel(item){const sectionId=item.getAttribute(attributes$t.sectionId),modelItems=item.querySelectorAll(selectors$I.productModel);modelItems.length&&modelItems.forEach(element=>{theme.ProductModel.init(element,sectionId)})}initShopifyXrLaunch(item){document.addEventListener("shopify_xr_launch",()=>{item.querySelector(`${selectors$I.productModel}:not(.${classes$y.mediaHidden})`).dispatchEvent(new CustomEvent("xrLaunch"))})}addFormSuffix(item){const sectionId=item.getAttribute(attributes$t.sectionId),productObject=JSON.parse(item.querySelector(selectors$I.productJSON).innerHTML),formSuffix=`${sectionId}-${productObject.handle}`,productForm=item.querySelector(selectors$I.productForm),addToCart=item.querySelector(selectors$I.addToCart);productForm.setAttribute(attributes$t.id,ids.addToCartFormId+formSuffix),addToCart.setAttribute(attributes$t.id,ids.addToCartId+formSuffix)}}const settings$4={unlockScrollDelay:400},selectors$H={popupContainer:".pswp",popupCloseBtn:".pswp__custom-close",popupIframe:"iframe, video",popupCustomIframe:".pswp__custom-iframe",popupThumbs:".pswp__thumbs",popupButtons:".pswp__button, .pswp__caption-close",product:"[data-product]",productJSON:"[data-product-json]"},classes$x={current:"is-current",customLoader:"pswp--custom-loader",customOpen:"pswp--custom-opening",loader:"pswp__loader",opened:"pswp--open",popupCloseButton:"pswp__button--close",notificationPopup:"pswp--notification",quickviewPopup:"popup-quick-view",isCartDrawerOpen:"js-drawer-open-cart",quickViewAnimateOut:"popup-quick-view--animate-out"},attributes$s={dataOptionClasses:"data-pswp-option-classes",dataVideoType:"data-video-type"},loaderHTML=`<div class="${classes$x.loader}"><div class="loader loader--image"><div class="loader__image"></div></div></div>`;class LoadPhotoswipe{constructor(items,options2="",templateIndex=0,triggerButton=null){this.items=items,this.triggerBtn=triggerButton,this.pswpElements=document.querySelectorAll(selectors$H.popupContainer),this.pswpElement=this.pswpElements[templateIndex],this.popup=null,this.popupThumbs=null,this.popupThumbsContainer=this.pswpElement.querySelector(selectors$H.popupThumbs),this.closeBtn=this.pswpElement.querySelector(selectors$H.popupCloseBtn);const defaultOptions={history:!1,focus:!1,mainClass:""};this.options=options2!==""?options2:defaultOptions,this.onCloseCallback=()=>this.onClose(),this.dispatchPopupInitEventCallback=()=>this.dispatchPopupInitEvent(),this.setCurrentThumbCallback=()=>this.setCurrentThumb(),this.a11y=a11y,this.init()}init(){document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})),this.pswpElement.classList.add(classes$x.customOpen),this.initLoader(),loadScript({url:window.theme.assets.photoswipe}).then(()=>this.loadPopup()).catch(e=>console.error(e))}
12initLoader(){if(this.pswpElement.classList.contains(classes$x.customLoader)&&this.options!==""&&this.options.mainClass){this.pswpElement.setAttribute(attributes$s.dataOptionClasses,this.options.mainClass);let loaderElem=document.createElement("div");loaderElem.innerHTML=loaderHTML,loaderElem=loaderElem.firstChild,this.pswpElement.appendChild(loaderElem)}else this.pswpElement.setAttribute(attributes$s.dataOptionClasses,"")}loadPopup(){const PhotoSwipe=window.themePhotoswipe.PhotoSwipe.default,PhotoSwipeUI=window.themePhotoswipe.PhotoSwipeUI.default;this.pswpElement.classList.contains(classes$x.customLoader)&&this.pswpElement.classList.remove(classes$x.customLoader),this.pswpElement.classList.remove(classes$x.customOpen),this.popup=new PhotoSwipe(this.pswpElement,PhotoSwipeUI,this.items,this.options),this.popup.listen("afterInit",this.dispatchPopupInitEventCallback),this.popup.listen("imageLoadComplete",this.setCurrentThumbCallback),this.popup.listen("beforeChange",this.setCurrentThumbCallback),this.popup.listen("close",this.onCloseCallback),this.popup.init(),this.initPopupCallback()}initPopupCallback(){this.isVideo&&this.hideUnusedButtons(),this.initVideo(),this.thumbsActions(),this.a11y.trapFocus({container:this.pswpElement}),this.pswpElement.classList.contains(classes$x.quickviewPopup)&&new LoadQuickview(this.popup,this.pswpElement),this.pswpElement.classList.contains(classes$x.notificationPopup)&&new LoadNotification(this.popup,this.pswpElement),this.closePopup=()=>{this.pswpElement.classList.contains(classes$x.quickviewPopup)?this.pswpElement.classList.add(classes$x.quickViewAnimateOut):this.popup.close()},this.closeBtn&&this.closeBtn.addEventListener("click",this.closePopup),this.nativeCartHandoff=event=>{event.detail?.source&&this.pswpElement.contains(event.detail.source)&&this.popup.close()},document.addEventListener("caffeine:cart:handoff",this.nativeCartHandoff),this.popup.listen("destroy",()=>{document.removeEventListener("caffeine:cart:handoff",this.nativeCartHandoff),document.removeEventListener("theme:cart:added",this.closePopup)}),document.addEventListener("theme:cart:added",this.closePopup)}dispatchPopupInitEvent(){this.triggerBtn&&this.triggerBtn.dispatchEvent(new CustomEvent("theme:popup:init",{bubbles:!0}))}initVideo(){const videoContainer=this.pswpElement.querySelector(selectors$H.popupCustomIframe);if(videoContainer){const videoType=videoContainer.getAttribute(attributes$s.dataVideoType);this.isVideo=!0,videoType=="youtube"?new LoadVideoYT(videoContainer.parentElement):videoType=="vimeo"&&new LoadVideoVimeo(videoContainer.parentElement)}}thumbsActions(){this.popupThumbsContainer&&this.popupThumbsContainer.firstChild&&(this.popupThumbsContainer.addEventListener("wheel",e=>this.stopDisabledScroll(e)),this.popupThumbsContainer.addEventListener("mousewheel",e=>this.stopDisabledScroll(e)),this.popupThumbsContainer.addEventListener("DOMMouseScroll",e=>this.stopDisabledScroll(e)),this.popupThumbs=this.pswpElement.querySelectorAll(`${selectors$H.popupThumbs} > *`),this.popupThumbs.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault(),element.parentElement.querySelector(`.${classes$x.current}`).classList.remove(classes$x.current),element.classList.add(classes$x.current),this.popup.goTo(i)})}))}hideUnusedButtons(){this.pswpElement.querySelectorAll(selectors$H.popupButtons).forEach(element=>{element.classList.contains(classes$x.popupCloseButton)||(element.style.display="none")})}stopDisabledScroll(e){e.stopPropagation()}onClose(){const popupIframe=this.pswpElement.querySelector(selectors$H.popupIframe);if(popupIframe&&popupIframe.parentNode.removeChild(popupIframe),this.popupThumbsContainer&&this.popupThumbsContainer.firstChild)for(;this.popupThumbsContainer.firstChild;)this.popupThumbsContainer.removeChild(this.popupThumbsContainer.firstChild);this.pswpElement.setAttribute(attributes$s.dataOptionClasses,"");const loaderElem=this.pswpElement.querySelector(`.${classes$x.loader}`);loaderElem&&this.pswpElement.removeChild(loaderElem),document.body.classList.contains(classes$x.isCartDrawerOpen)||this.a11y.removeTrapFocus(),document.removeEventListener("theme:cart:added",this.closePopup),setTimeout(()=>{const recentlyOpenedPopups=this.recentlyOpenedPopupsCount(),isCartDrawerOpen=document.body.classList.contains(classe
12s$x.isCartDrawerOpen);recentlyOpenedPopups===0&&!isCartDrawerOpen&&document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))},settings$4.unlockScrollDelay)}recentlyOpenedPopupsCount(){let count=0;return this.pswpElements.forEach(popup=>{popup.classList.contains(classes$x.opened)&&(count+=1)}),count}setCurrentThumb(){if(this.popupThumbsContainer&&this.popupThumbsContainer.firstChild)return;const lastCurrentThumb=this.pswpElement.querySelector(`${selectors$H.popupThumbs} > .${classes$x.current}`);if(lastCurrentThumb&&lastCurrentThumb.classList.remove(classes$x.current),!this.popupThumbs)return;const currentThumb=this.popupThumbs[this.popup.getCurrentIndex()];currentThumb.classList.add(classes$x.current),this.scrollThumbs(currentThumb)}scrollThumbs(currentThumb){const thumbsContainerLeft=this.popupThumbsContainer.scrollLeft,thumbsContainerWidth=this.popupThumbsContainer.offsetWidth,thumbsContainerPos=thumbsContainerLeft+thumbsContainerWidth,currentThumbLeft=currentThumb.offsetLeft,currentThumbWidth=currentThumb.offsetWidth,currentThumbPos=currentThumbLeft+currentThumbWidth;if(thumbsContainerPos<=currentThumbPos||thumbsContainerPos>currentThumbLeft){const currentThumbMarginLeft=parseInt(window.getComputedStyle(currentThumb).marginLeft);this.popupThumbsContainer.scrollTo({top:0,left:currentThumbLeft-currentThumbMarginLeft,behavior:"smooth"})}}}const settings$3={templateIndex:0},selectors$G={buttonQuickView:"[data-button-quick-view]",quickViewItemsTemplate:"[data-quick-view-items-template]",cartDrawer:"[data-cart-drawer]",shopTheLookQuickViewButton:"[data-shop-the-look-quick-view-button]",shopTheLookThumb:"[data-shop-the-look-thumb]",quickViewItemHolder:"[data-quick-view-item-holder]"},classes$w={loading:"is-loading",isActive:"is-active",quickViewFromCart:"js-quick-view-from-cart",mainClass:"popup-quick-view pswp--not-close-btn",shopTheLookPopupClass:"popup-quick-view popup-quick-view--shop-the-look pswp--not-close-btn"},attributes$r={loaded:"data-loaded",handle:"data-handle",variantId:"data-variant-id",shopTheLookQuickView:"data-shop-the-look-quick-view",hotspot:"data-hotspot",quickButtonInit:"data-initialized"},options={history:!1,focus:!1,mainClass:classes$w.mainClass,showHideOpacity:!1,closeOnVerticalDrag:!1,closeOnScroll:!1,modal:!1,escKey:!1};class QuickViewPopup{constructor(container){this.container=container,this.a11y=a11y,this.buttonsQuickView=this.container.querySelectorAll(selectors$G.buttonQuickView),this.buttonsShopTheLookQuickView=this.container.querySelectorAll(selectors$G.shopTheLookQuickViewButton),this.popupInitCallback=trigger=>this.popupInit(trigger),this.buttonsQuickView?.forEach(button=>{button.hasAttribute(attributes$r.quickButtonInit)||(button.addEventListener("click",event=>this.initPhotoswipe(event)),button.addEventListener("theme:popup:init",()=>{button.classList.remove(classes$w.loading),button.hasAttribute(attributes$r.shopTheLookQuickView)&&this.popupInitCallback(button)}),button.setAttribute(attributes$r.quickButtonInit,""))}),this.buttonsShopTheLookQuickView?.forEach(button=>{button.addEventListener("click",()=>{this.buttonsQuickView[0]?.dispatchEvent(new Event("click"))})})}popupInit(trigger){const holder=this.loadPhotoswipe.pswpElement.querySelector(`[${attributes$r.hotspot}="${trigger.getAttribute(attributes$r.hotspot)}"]`),quickViewItemHolders=this.loadPhotoswipe.pswpElement.querySelectorAll(selectors$G.quickViewItemHolder);holder.classList.add(classes$w.isActive),quickViewItemHolders.forEach(element=>{element!==holder&&element.classList.remove(classes$w.isActive)}),this.toggleQuickViewButtonsLoadingClasses(!0),this.toggleQuickViewThumbsLoadingClasses(!0);const onAnimationInEnd=event=>{event.animationName==="quickViewAnimateInUp"&&requestAnimationFrame(()=>{this.toggleQuickViewThumbsLoadingClasses(!1)}),event.animationName==="quickViewAnimateOutDown"&&this.loadPhotoswipe.pswpElement.removeEventListener("animationend",onAnimationInEnd)};this.loadPhotoswipe.pswpElement.addEventListener("animationend",onAnimationInEnd),this.loadPhotoswipe?.popup?.listen("destroy",()=>
12{this.toggleQuickViewButtonsLoadingClasses(!1),this.toggleQuickViewThumbsLoadingClasses(!1)})}toggleQuickViewButtonsLoadingClasses(isLoading=!0){if(isLoading){this.buttonsQuickView?.forEach(element=>{element.classList.add(classes$w.loading)});return}this.buttonsQuickView?.forEach(element=>{element.classList.remove(classes$w.loading)})}toggleQuickViewThumbsLoadingClasses(isLoading=!0){if(this.buttonsShopTheLookThumb=this.loadPhotoswipe?.pswpElement.querySelectorAll(selectors$G.shopTheLookThumb),isLoading){this.buttonsShopTheLookThumb?.forEach(element=>{element.classList.add(classes$w.loading)});return}this.buttonsShopTheLookThumb?.forEach(element=>{element.classList.remove(classes$w.loading)})}initPhotoswipe(event){event.preventDefault();const button=event.target.matches(selectors$G.buttonQuickView)?event.target:event.target.closest(selectors$G.buttonQuickView),isMobile=window.innerWidth<theme.sizes.small;let quickViewVariant="",isShopTheLookPopupTrigger=!1;if(button.hasAttribute(attributes$r.shopTheLookQuickView)){if(!isMobile)return;isShopTheLookPopupTrigger=!0}options.mainClass=classes$w.mainClass,button.classList.add(classes$w.loading),button.closest(selectors$G.cartDrawer)&&document.body.classList.add(classes$w.quickViewFromCart),this.a11y.state.trigger=button,button.hasAttribute(attributes$r.variantId)&&(quickViewVariant=`&variant=${button.getAttribute(attributes$r.variantId)}`);const productUrl=`${theme.routes.root}products/${button.getAttribute(attributes$r.handle)}?section_id=api-quickview${quickViewVariant}`;if(isShopTheLookPopupTrigger){options.mainClass=classes$w.shopTheLookPopupClass,this.buttonsQuickView.forEach(element=>{element.classList.add(classes$w.loading)});const XMLS=new XMLSerializer,quickViewItemsTemplate=this.container.querySelector(selectors$G.quickViewItemsTemplate).content.firstElementChild.cloneNode(!0),itemsData=XMLS.serializeToString(quickViewItemsTemplate);this.loadPhotoswipeWithTemplate(itemsData,button)}else this.loadPhotoswipeFromFetch(productUrl,button)}loadPhotoswipeWithTemplate(data,button){const items=[{html:data}];this.loadPhotoswipe=new LoadPhotoswipe(items,options,settings$3.templateIndex,button)}loadPhotoswipeFromFetch(url,button){fetch(url).then(response=>response.text()).then(data=>{const items=[{html:data}];this.loadPhotoswipe=new LoadPhotoswipe(items,options,settings$3.templateIndex,button)}).catch(error=>console.log("error: ",error))}}const settings$2={cartDrawerEnabled:window.theme.settings.cartType==="drawer",timers:{addProductTimeout:1e3},animations:{data:"data-aos",method:"fade-up"}},selectors$F={outerSection:"[data-section-id]",aos:"[data-aos]",additionalCheckoutButtons:"[data-additional-checkout-button]",apiContent:"[data-api-content]",apiLineItems:"[data-api-line-items]",apiUpsellItems:"[data-api-upsell-items]",apiCartPrice:"[data-api-cart-price]",buttonAddToCart:"[data-add-to-cart]",upsellButtonByHandle:"[data-handle]",cartCloseError:"[data-cart-error-close]",cartDrawer:"[data-cart-drawer]",cartDrawerTemplate:"[data-cart-drawer-template]",cartDrawerToggle:"[data-cart-drawer-toggle]",cartDrawerBody:"[data-cart-drawer-body]",cartErrors:"[data-cart-errors]",cartForm:"[data-cart-form]",cartTermsCheckbox:"[data-cart-acceptance-checkbox]",cartCheckoutButtonWrapper:"[data-cart-checkout-buttons]",cartCheckoutButton:"[data-cart-checkout-button]",cartItemRemove:"[data-item-remove]",cartItemsQty:"[data-cart-items-qty]",cartTotal:"[data-cart-total]",cartTotalPrice:"[data-cart-total-price]",cartMessage:"[data-cart-message]",cartMessageDefault:"[data-message-default]",cartPage:"[data-cart-page]",cartProgress:"[data-cart-message-progress]",emptyMessage:"[data-empty-message]",buttonHolder:"[data-foot-holder]",item:"[data-cart-item]",itemsHolder:"[data-items-holder]",itemsWrapper:"[data-items-wrapper]",formCloseError:"[data-close-error]",formErrorsContainer:"[data-cart-errors-container]",upsellHolder:"[data-upsell-holder]",errorMessage:"[data-error-message]",termsErrorMessage:"[data-terms-error-message]",pairProductsHolder:"[data-pair-products-holder]",pairProducts:"[data-pair-products]",priceHolder:"[data-cart-price-holder]",leftToSpend:"[data-left-to-spend]",quickBuyForm:"[data-quickbuy-form]",qtyInput:"[data-quantity-field]",productMediaContainer:"[data-product-media-container]",formWrapper:"[data-form-wrapper]",productForm:"[data-product-form]",popupQuickView:".popup-quick-view",popupClose:"[data-popup-close]",error:"[data-error]",quickViewOnboarding:"[data-quick-view-onboarding]",flickityEnabled:".flickity-enabled"},classes$v={hidden:"hidden",added:"is-added",isHidden:"is-hidden",cartDrawerOpen:"js-drawer-open-cart",open:"is-open",visible:"is-visible",expanded:"is-expanded",loading:"is-loading",disabled:"is-disabled",success:"is-success",error:"has-error",cartItems:"cart__toggle--has-items",variantSoldOut:"variant--soldout",removed:"is-removed",aosAnimate:"aos-animate",updated:"is-updated",noOutline:"no-outline",productGridImageError:"product-grid-item__image--error",contentVisibilityHidden:"cv-h"},attributes$q={shippingMessageLimit:"data-limit",cartMessageValue:"data-cart-message",cartTotal:"data-cart-total",ariaExpanded:"aria-expanded",disabled:"disabled",value:"value",dataId:"data-id",item:"data-item",itemIndex:"data-item-index",itemTitle:"data-item-title",atcTrigger:"data-atc-trigger",upsellButton:"data-upsell-btn",notificationPopup:"data-notification-popup",sectionId:"data-section-id",recipientError:"data-recipient-errors"};let sections$r={};class CartDrawer{constructor(){window.location.pathname!=="/password"&&this.init()}init(){this.cartToggleButtons=document.querySelectorAll(selectors$F.cartDrawerToggle),this.cartPage=document.querySelector(selectors$F.cartPage),this.cartDrawer=document.querySelector(selectors$F.cartDrawer),this.cart=this.cartDrawer||this.cartPage,this.cartCount=this.getCartItemCount(),this.assignArguments(),this.recipientErrors=this.form?.getAttribute(attributes$q.recipientError)==="true",this.flktyUpsell=null,this.form=null,this.collapsible=null,this.a11y=a11y,this.build=this.build.bind(this),this.addToCart=this.addToCart.bind(this),this.updateCart=this.updateCart.bind(this),this.openCartDrawer=this.openCartDrawer.bind(this),this.closeCartDrawer=this.closeCartDrawer.bind(this),this.toggleCartDrawer=this.toggleCartDrawer.bind(this),this.formSubmitHandler=throttle(this.formSubmitHandler.bind(this),50),this.closeCartError=()=>{this.cartErrorHolder.classList.remove(classes$v.expanded)},this.cartDrawerCloseEvent=null,this.hasItemsInCart=this.hasItemsInCart.bind(this),this.isCartPage=!!(this.cart&&this.cartDrawer===null),this.showAnimations=document.body.dataset.animations==="true",this.toggleClassesOnContainers=this.toggleClassesOnContainers.bind(this),this.totalItems=0,this.isCartDrawerOpen=!1,this.isCartDrawerLoaded=!1,this.cartDiscounts=0,this.cartDrawerEnabled=settings$2.cartDrawerEnabled,this.cartAnimationTimer=0,this.cartUpdateFailed=!1,this.cartEvents(),this.cartAddEvent(),this.cartDrawerToggleEvents(),this.initQuantity(),this.buttonHolder&&(this.collapsible=new Collapsible(this.buttonHolder)),this.isCartPage&&this.renderPairProducts(),document.addEventListener("theme:popup:open",this.closeCartDrawer)}assignArguments(){this.cartDrawerBody=document.querySelector(selectors$F.cartDrawerBody),this.emptyMessage=document.querySelector(selectors$F.emptyMessage),this.buttonHolder=document.querySelector(selectors$F.buttonHolder),this.itemsHolder=document.querySelector(selectors$F.itemsHolder),this.cartItemsQty=document.querySelector(selectors$F.cartItemsQty),this.itemsWrapper=document.querySelector(selectors$F.itemsWrapper),this.items=document.querySelectorAll(selectors$F.item),this.cartTotal=document.querySelector(selectors$F.cartTotal),this.cartTotalPrice=document.querySelector(selectors$F.cartTotalPrice),this.cartMessage=document.querySelectorAll(selectors$F.cartMessage),this.cartOriginalTotal=document.querySelector(selectors$F.cartOriginalTotal),this.cartErrorHolder=document.querySelector(selectors$F.cartErrors),this.cartCloseErrorMessage=document.querySelector(selectors$F.cartCloseError),this.pairProductsHolder=document.querySelector(selectors$F.pairProductsHolder),this.pairProducts=document.querySelector(selectors$F.pairProducts),this.priceHolder=document.querySelector(selectors$F.priceHolder),this.upsellHolders=document.querySelectorAll(selectors$F.upsellHolder),this.cartTermsCheckbox=document.querySelector(selectors$F.cartTermsCheckbox),this.cartCheckoutButtonWrapper=document.querySelector(selectors$F.cartCheckoutButtonWrapper),this.cartCheckoutButton=document.querySelector(selectors$F.cartCheckoutButton),this.cartForm=document.querySelector(selectors$F.cartForm),this.cartItemCount=0,this.subtotal=window.theme.subtotal,this.button=null,this.cartMessage.length>0&&(this.cartFreeLimitShipping=Number(this.cartMessage[0].getAttribute(attributes$q.shippingMessageLimit))*100*window.Shopify.currency.rate),this.updateProgress()}initQuantity(){this.items=document.querySelectorAll(selectors$F.item),this.items?.forEach(item=>{new QuantityCounter(item,!0).init(),this.cartUpdateEvent(item)})}cartUpdateEvent(item){item.addEventListener("theme:cart:update",event=>{this.updateCart({id:event.detail.id,quantity:event.detail.quantity},item)})}cartEvents(){const cartItemRemove=document.querySelectorAll(selectors$F.cartItemRemove);this.totalItems=cartItemRemove.length,cartItemRemove?.forEach(button=>{const item=button.closest(selectors$F.item);button.addEventListener("click",event=>
12{event.preventDefault(),!button.classList.contains(classes$v.disabled)&&this.updateCart({id:item.getAttribute(attributes$q.dataId),quantity:0},item)})}),this.cartCloseErrorMessage&&(this.cartCloseErrorMessage.removeEventListener("click",this.closeCartError),this.cartCloseErrorMessage.addEventListener("click",this.closeCartError)),this.cartTermsCheckbox&&(this.cartTermsCheckbox.removeEventListener("change",this.formSubmitHandler),this.cartCheckoutButtonWrapper.removeEventListener("click",this.formSubmitHandler),this.cartForm.removeEventListener("submit",this.formSubmitHandler),this.cartTermsCheckbox.addEventListener("change",this.formSubmitHandler),this.cartCheckoutButtonWrapper.addEventListener("click",this.formSubmitHandler),this.cartForm.addEventListener("submit",this.formSubmitHandler))}cartAddEvent(){document.addEventListener("click",event=>{const clickedElement=event.target,isButtonATC=clickedElement?.matches(selectors$F.buttonAddToCart),getButtonATC=clickedElement?.closest(selectors$F.buttonAddToCart);if(isButtonATC||getButtonATC){event.preventDefault(),this.button=isButtonATC?clickedElement:getButtonATC,this.form=clickedElement.closest("form"),this.recipientErrors=this.form?.getAttribute(attributes$q.recipientError)==="true",this.formWrapper=this.button.closest(selectors$F.formWrapper);const isVariantSoldOut=this.formWrapper?.classList.contains(classes$v.variantSoldOut),isButtonDisabled=this.button.hasAttribute(attributes$q.disabled),isQuickViewOnboarding=this.button.closest(selectors$F.quickViewOnboarding),hasDataAtcTrigger=this.button.hasAttribute(attributes$q.atcTrigger),hasNotificationPopup=this.button.hasAttribute(attributes$q.notificationPopup),hasFileInput=this.form?.querySelector('[type="file"]');
12if(isButtonDisabled||hasFileInput||isQuickViewOnboarding)return;if(isVariantSoldOut&&hasNotificationPopup){new NotificationPopup(this.button);return}hasDataAtcTrigger&&(this.a11y.state.trigger=this.button);const formData=new FormData(this.form);this.addToCart(formData),document.dispatchEvent(new CustomEvent("theme:cart:add",{bubbles:!0,detail:{selector:clickedElement}}))}})}getCart(){this.cartDrawer&&!this.isCartDrawerLoaded&&this.renderCartDrawer(!1),fetch(theme.routes.cart_url+"?section_id=api-cart-items").then(this.handleErrors).then(response=>response.text()).then(response=>{const element=document.createElement("div");element.innerHTML=response;const cleanResponse=element.querySelector(selectors$F.apiContent);this.build(cleanResponse)}).catch(error=>console.log(error))}addToCart(data){this.cartDrawerEnabled&&this.button&&(this.button.classList.add(classes$v.loading),this.button.disabled=!0),fetch(theme.routes.cart_add_url,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/javascript"},body:data}).then(response=>response.json()).then(response=>{this.button.classList.remove(classes$v.loading),this.button.disabled=!1,this.cartDrawerEnabled?this.getCart():window.location=theme.routes.cart_url}).catch(error=>console.log(error))}updateCart(updateData={},currentItem=null){let updatedQuantity=updateData.quantity;currentItem!==null&&(updatedQuantity?currentItem.classList.add(classes$v.loading):currentItem.classList.add(classes$v.removed)),this.disableCartButtons(),this.addLoadingClass();const newItem=this.cart.querySelector(`[${attributes$q.item}="${updateData.id}"]`)||currentItem,lineIndex=newItem?.hasAttribute(attributes$q.itemIndex)?parseInt(newItem.getAttribute(attributes$q.itemIndex)):0,itemTitle=newItem?.hasAttribute(attributes$q.itemTitle)?newItem.getAttribute(attributes$q.itemTitle):null;if(lineIndex===0)return;const data={line:lineIndex,quantity:updatedQuantity};fetch(theme.routes.cart_change_url,{method:"post",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(data)}).then(response=>{if(response.status===400){const error=new Error(response.status);throw this.cartDrawerEnabled?this.getCart():window.location=theme.routes.cart_url,error}return response.text()}).then(state=>{if(JSON.parse(state).errors){this.cartUpdateFailed=!0,this.updateErrorText(itemTitle),this.toggleErrorMessage(),this.resetLineItem(currentItem),this.enableCartButtons(),this.removeLoadingClass();return}this.getCart()}).catch(error=>{console.log(error),this.enableCartButtons(),this.removeLoadingClass()})}
12resetLineItem(item){const qtyInput=item.querySelector(selectors$F.qtyInput),qty=qtyInput.getAttribute("value");qtyInput.value=qty,item.classList.remove(classes$v.loading)}disableCartButtons(){const inputs=this.cart.querySelectorAll("input"),buttons=this.cart.querySelectorAll(`button, ${selectors$F.cartItemRemove}`);inputs.length&&inputs.forEach(item=>{item.classList.add(classes$v.disabled),item.blur(),item.disabled=!0}),buttons.length&&buttons.forEach(item=>{item.setAttribute(attributes$q.disabled,!0)})}enableCartButtons(){const inputs=this.cart.querySelectorAll("input"),buttons=this.cart.querySelectorAll(`button, ${selectors$F.cartItemRemove}`);inputs.length&&inputs.forEach(item=>{item.classList.remove(classes$v.disabled),item.disabled=!1}),buttons.length&&buttons.forEach(item=>{item.removeAttribute(attributes$q.disabled)})}updateErrorText(itemTitle){this.cartErrorHolder.querySelector(selectors$F.errorMessage).innerText=itemTitle}toggleErrorMessage(){if(this.cartErrorHolder){if(this.cartErrorHolder.classList.toggle(classes$v.expanded,this.cartUpdateFailed),this.cartUpdateFailed){const cartCloseError=this.cartErrorHolder.querySelector(selectors$F.cartCloseError);this.focusOnErrorMessage(this.cartErrorHolder,cartCloseError)}this.cartUpdateFailed=!1}}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}addToCartError(data){const buttonQuickBuyForm=this.button.closest(selectors$F.quickBuyForm),buttonUpsellHolder=this.button.closest(selectors$F.upsellHolder),isFocusEnabled=!document.body.classList.contains(classes$v.noOutline);let errorContainer=(this.button.closest(selectors$F.productForm)?this.button.closest(selectors$F.productForm):this.button.closest(selectors$F.upsellHolder)).querySelector(selectors$F.formErrorsContainer);buttonUpsellHolder&&(errorContainer=buttonUpsellHolder.querySelector(selectors$F.formErrorsContainer)),this.cartDrawerEnabled&&this.button&&this.button.closest(selectors$F.cartDrawer)!==null&&!this.button.closest(selectors$F.cartDrawer)&&this.closeCartDrawer(),this.button.classList.remove(classes$v.loading),this.button.removeAttribute(attributes$q.disabled);const closeErrorButton=buttonQuickBuyForm?"":` 13 <button type="button" class="errors__button-close" data-close-error> 14 ${theme.icons.close} 15 </button> 16 `;let errorMessages=`${data.message}: ${data.description}`;if(this.recipientErrors&&data.description&&typeof data.description=="object"&&(errorMessages=Object.entries(data.description).map(([key,value])=>`${value}`).join("<br>")),errorContainer.innerHTML=` 17 <div class="errors" data-error autofocus> 18 ${errorMessages} 19 ${closeErrorButton} 20 </div> 21 `,buttonQuickBuyForm){const productMediaContainer=errorContainer.closest(selectors$F.productMediaContainer);productMediaContainer.classList.add(classes$v.productGridImageError),errorContainer.querySelector(selectors$F.error).addEventListener("animationend",()=>{productMediaContainer.classList.remove(classes$v.productGridImageError),errorContainer.innerHTML="",isFocusEnabled||document.activeElement.blur()})}else errorContainer.classList.add(classes$v.visible),errorContainer.addEventListener("transitionend",()=>{this.resizeSliders(errorContainer)}),this.handleCloseErrorMessages(errorContainer)}handleCloseErrorMessages(container){const formErrorClose=container.querySelector(selectors$F.formCloseError);formErrorClose?.addEventListener("click",event=>{const clickedElement=event.target;(clickedElement.matches(selectors$F.formCloseError)||clickedElement.closest(selectors$F.formCloseError))&&(event.preventDefault(),container.classList.remove(classes$v.visible),container.querySelector(selectors$F.error).addEventListener("transitionend",()=>{container.innerHTML="",this.resizeSliders(clickedElement)}))}),this.focusOnErrorMessage(container,formErrorClose)}focusOnErrorMessage(container,button){document.body.classList.contains(classes$v.noOutline)||container.addEventListener("transitionend",()=>{requestAnimationFrame(()=>button?.focus({focusVisible:!0}))})}hideAddToCartErrorMessage(){(this.button.closest(selectors$F.upsellHolder)?this.button.closest(selectors$F.upsellHolder):this.button.closest(selectors$F.productForm))?.querySelector(selectors$F.formErrorsContainer)?.classList.remove(classes$v.visible)}resizeSliders(element){const slider2=element.closest(selectors$F.flickityEnabled);if(!slider2)return;const flkty=Flickity.data(slider2);requestAnimationFrame(()=>flkty.resize())}renderCartDrawer(alwaysOpen=!0){const cartDrawerTemplate=document.querySelector(selectors$F.cartDrawerTemplate);cartDrawerTemplate&&(this.cartDrawer.innerHTML=cartDrawerTemplate.innerHTML,this.assignArguments(),this.initQuantity(),this.cartEvents(),this.buttonHolder&&(this.collapsible=new Collapsible(this.buttonHolder)),this.cartDrawerToggle=this.cartDrawer.querySelector(selectors$F.cartDrawerToggle),this.cartDrawerToggle.addEventListener("click",this.cartDrawerToggleClickEvent),this.isCartDrawerLoaded=!0,this.renderPairProducts(),document.dispatchEvent(new CustomEvent("theme:cart:loaded",{bubbles:!0})),alwaysOpen&&this.openCartDrawer())}openCartDrawer(){if(!this.isCartDrawerOpen){if(!this.isCartDrawerLoaded){this.renderCartDrawer();return}document.dispatchEvent(new CustomEvent("theme:cart:open",{bubbles:!0})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.cartDrawer})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.cartDrawerBody})),document.body.classList.add(classes$v.cartDrawerOpen),this.cartDrawer.classList.add(classes$v.open),this.cartDrawer.classList.remove(classes$v.contentVisibilityHidden),this.cartDrawer.querySelectorAll(selectors$F.aos).forEac
21h(item=>{requestAnimationFrame(()=>{item.classList.add(classes$v.aosAnimate)})}),this.cartToggleButtons.forEach(button=>{button.setAttribute(attributes$q.ariaExpanded,!0)}),this.a11y.trapFocus({container:this.cartDrawer}),this.observeAdditionalCheckoutButtons(),this.isCartDrawerOpen=!0}}closeCartDrawer(){if(!this.isCartDrawerOpen)return;document.dispatchEvent(new CustomEvent("theme:cart:close",{bubbles:!0})),this.cartAnimationTimer&&clearTimeout(this.cartAnimationTimer),this.cartAnimationTimer=setTimeout(()=>{this.cartDrawer.querySelectorAll(selectors$F.aos).forEach(item=>{item.classList.remove(classes$v.aosAnimate)})},300),this.cartErrorHolder.classList.remove(classes$v.expanded),this.a11y.removeTrapFocus(),this.cartToggleButtons.forEach(button=>{button.setAttribute(attributes$q.ariaExpanded,!1)}),document.body.classList.remove(classes$v.cartDrawerOpen),this.cartDrawer.classList.remove(classes$v.open),this.itemsHolder.classList.remove(classes$v.updated);const onCartDrawerTransitionEnd=event=>{event.target===this.cartDrawer&&(requestAnimationFrame(()=>{this.cartDrawer.classList.add(classes$v.contentVisibilityHidden)}),this.cartDrawer.removeEventListener("transitionend",onCartDrawerTransitionEnd))};this.cartDrawer.addEventListener("transitionend",onCartDrawerTransitionEnd),!document.body.classList.contains(classes$v.noOutline)||requestAnimationFrame(()=>{document.activeElement.blur()});const timeout=400;document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:timeout})),this.isCartDrawerOpen=!1}toggleCartDrawer(){this.isCartDrawerOpen?this.closeCartDrawer():this.openCartDrawer()}cartDrawerToggleEvents(){this.cartDrawer&&(this.cartDrawer.addEventListener("keyup",event=>{event.code===theme.keyboardKeys.ESCAPE&&this.closeCartDrawer()}),this.cartDrawerToggleClickEvent=event=>{event.preventDefault();const button=event.target;button.getAttribute(attributes$q.ariaExpanded)==="false"&&(this.a11y.state.trigger=button),this.toggleCartDrawer()},this.cartDrawerCloseEvent=event=>{const isCartDrawerToggle=event.target.matches(selectors$F.cartDrawerToggle),isCartDrawerChild=document.querySelector(selectors$F.cartDrawer).contains(event.target),isPopupQuickView=event.target.closest(selectors$F.popupQuickView);!isCartDrawerToggle&&!isCartDrawerChild&&!isPopupQuickView&&this.closeCartDrawer()},this.cartToggleButtons.forEach(button=>{button.addEventListener("click",this.cartDrawerToggleClickEvent)}),document.addEventListener("mousedown",this.cartDrawerCloseEvent))}toggleClassesOnContainers(){const that=this;this.emptyMessage.classList.toggle(classes$v.hidden,that.hasItemsInCart()),this.buttonHolder.classList.toggle(classes$v.hidden,!that.hasItemsInCart()),this.itemsHolder.classList.toggle(classes$v.hidden,!that.hasItemsInCart()),this.cartItemsQty.classList.toggle(classes$v.hidden,!that.hasItemsInCart())}build(data){if(!data)return;if(!this.itemsHolder){this.resetButtonClasses(),this.removeLoadingClass();return}const cartItemsData=data.querySelector(selectors$F.apiLineItems),upsellItemsData=data.querySelector(selectors$F.apiUpsellItems),cartEmptyData=cartItemsData===null&&upsellItemsData===null,priceData=data.querySelector(selectors$F.apiCartPrice),cartTotal=data.querySelector(selectors$F.cartTotal);this.priceHolder&&priceData&&(this.priceHolder.innerHTML=priceData.innerHTML),this.emptyMessage&&this.emptyMessage.querySelectorAll(selectors$F.aos).forEach(item=>{item.classList.remove(classes$v.aosAnimate)}),this.itemsHolder&&(cartEmptyData?(this.itemsHolder.innerHTML="",this.pairProductsHolder&&(this.pairProductsHolder.innerHTML="")):(this.itemsHolder.innerHTML=cartItemsData?cartItemsData.innerHTML:"",this.pairProductsHolder&&upsellItemsData&&(this.pairProductsHolder.innerHTML=upsellItemsData.innerHTML),this.renderPairProducts())),this.newTotalItems=cartItemsData&&cartItemsData.querySelectorAll(selectors$F.item).length?cartItemsData.querySelectorAll(selectors$F.item).length:0,this.subtotal=cartTotal&&cartTotal.hasAttribute(attributes$q.cartTotal)?parseInt(cartTotal.getAttribute(attributes$q.cartTotal)):0,this.cartCount=this.getCartItemCount(),this.cartMessage.length>0&&this.updateProgress(),this.cartToggleButtons.forEach(button=>{button.classList.remove(classes$v.cartItems),this.newTotalItems>0&&button.classList.add(classes$v.cartItems)}),this.toggleErrorMessage(),this.updateItemsQuantity(this.cartCount),this.cartTotalPrice.innerHTML=this.subtotal===0?window.theme.strings.free:themeCurrency.formatMoney(this.subtotal,theme.moneyWithCurrencyFormat),this.totalItems!==this.newTotalItems&&(this.totalItems=this.newTotalItems,this.toggleClassesOnContainers()),this.isCartDrawerOpen&&this.itemsHolder.classList.add(classes$v.updated),this.cartEvents(),this.initQuantity(),this.enableCartButtons(),this.resetButtonClasse
21s(),this.removeLoadingClass(),document.dispatchEvent(new CustomEvent("theme:cart:added",{bubbles:!0})),this.cartDrawer&&this.openCartDrawer()}getCartItemCount(){return this.cart?Array.from(this.cart.querySelectorAll(selectors$F.qtyInput)).reduce((total,quantityInput)=>total+parseInt(quantityInput.value),0):0}hasItemsInCart(){return this.totalItems>0}freeShippingMessageHandle(total){this.cartMessage.length>0&&document.querySelectorAll(selectors$F.cartMessage).forEach(message=>{const hasFreeShipping=message.hasAttribute(attributes$q.cartMessageValue)&&message.getAttribute(attributes$q.cartMessageValue)==="true"&&total!==0,cartMessageDefault=message.querySelector(selectors$F.cartMessageDefault);message.classList.toggle(classes$v.success,total>=this.cartFreeLimitShipping&&hasFreeShipping),message.classList.toggle(classes$v.isHidden,total===0),cartMessageDefault.classList.toggle(classes$v.isHidden,total>=this.cartFreeLimitShipping)})}updateProgress(){const newPercentValue=this.subtotal/this.cartFreeLimitShipping*100,leftToSpend=theme.settings.currency_code_enable?themeCurrency.formatMoney(this.cartFreeLimitShipping-this.subtotal,theme.moneyWithCurrencyFormat):themeCurrency.formatMoney(this.cartFreeLimitShipping-this.subtotal,theme.moneyFormat);this.cartMessage.length>0&&document.querySelectorAll(selectors$F.cartMessage).forEach(message=>{const cartMessageProgressItems=message.querySelectorAll(selectors$F.cartProgress),leftToSpendMessage=message.querySelector(selectors$F.leftToSpend);leftToSpendMessage&&(leftToSpendMessage.innerHTML=leftToSpend.replace(".00","").replace(",00","")),cartMessageProgressItems.length&&cartMessageProgressItems.forEach((cartMessageProgress,index)=>{cartMessageProgress.classList.toggle(classes$v.isHidden,this.subtotal/this.cartFreeLimitShipping>=1),cartMessageProgress.style.setProperty("--progress-width",`${newPercentValue}%`),index===0&&cartMessageProgress.setAttribute(attributes$q.value,newPercentValue)}),this.freeShippingMessageHandle(this.subtotal)})}renderPairProducts(){if(this.flktyUpsell=null,this.pairProductsHolder=document.querySelector(selectors$F.pairProductsHolder),this.pairProducts=document.querySelector(selectors$F.pairProducts),this.upsellHolders=document.querySelectorAll(selectors$F.upsellHolder),this.pairProductsHolder===null||this.pairProductsHolder===void 0)return;const that=this;if(this.upsellHolders.length>1){this.flktyUpsell=new Flickity(this.pairProducts,{wrapAround:!0,pageDots:!0,adaptiveHeight:!0,prevNextButtons:!1,on:{ready:function(){new QuickViewPopup(that.cart),this.reloadCells(),requestAnimationFrame(()=>this.resize())}}});return}new QuickViewPopup(this.cart)}updateItemsQuantity(itemsQty){let oneItemText=theme.strings.cart_items_one,manyItemsText=theme.strings.cart_items_many;oneItemText=oneItemText.split("}}")[1],manyItemsText=manyItemsText.split("}}")[1],this.cartItemsQty&&(this.cartItemsQty.textContent=itemsQty===1?`${itemsQty} ${oneItemText}`:`${itemsQty} ${manyItemsText}`)}observeAdditionalCheckoutButtons(){const additionalCheckoutButtons=this.cart.querySelector(selectors$F.additionalCheckoutButtons);if(additionalCheckoutButtons){const observer=new MutationObserver(()=>{this.a11y.removeTrapFocus(),this.a11y.trapFocus({container:this.cart}),observer.disconnect()});observer.observe(additionalCheckoutButtons,{subtree:!0,childList:!0})}}formSubmitHandler(){const termsAccepted=document.querySelector(selectors$F.cartTermsCheckbox).checked,termsError=document.querySelector(selectors$F.termsErrorMessage);if(termsAccepted)termsError.classList.remove(classes$v.expanded),this.cartCheckoutButton.removeAttribute(attributes$q.disabled);else{if(document.querySelector(selectors$F.termsErrorMessage).length>0)return;termsError.innerText=theme.strings.cart_acceptance_error,this.cartCheckoutButton.setAttribute(attributes$q.disabled,!0),termsError.classList.add(classes$v.expanded)}}resetButtonClasses(){const buttons=document.querySelectorAll(selectors$F.buttonAddToCart);buttons&&buttons.forEach(button=>{button.classList.contains(classes$v.loading)&&(button.classList.remove(classes$v.loading),button.classList.add(classes$v.success),setTimeout(()=>{button.removeAttribute(attributes$q.disabled),button.classList.remove(classes$v.success)},settings$2.timers.addProductTimeout))})}addLoadingClass(){this.cartDrawer?this.cartDrawer.classList.add(classes$v.loading):this.itemsWrapper&&this.itemsWrapper.classList.add(classes$v.loading)}removeLoadingClass(){this.cartDrawer?this.cartDrawer.classList.remove(classes$v.loading):this.itemsWrapper&&this.itemsWrapper.classList.remove(classes$v.loading)}unload(){this.cartDrawerToggle&&this.cartDrawerToggle.removeEventListener("click",this.cartDrawerToggleClickEvent),this.cartToggleButtons.forEach(button=>{button.removeEventListener("click",this.cartDrawerToggleClickEvent)}),document.removeEventListener("mousedown",this.cartDrawerCloseEvent),this.collapsible!==null&&this.collapsible.onUnload()}}register("cart-template",{onLoad(){sections$r[this.id]=new CartDrawer},onUnload(){typeof sections$r[this.id].unload=="function"&§ions$r[this.id].unload()}});const selectors$E={scrollToTop:"[data-scroll-top-button]"},classes$u={isVisible:"is-visible"},scrollTopButton=document.querySelector(selectors$E.scrollToTop);scrollTopButton&&(scrollTopButton.addEventListener("click",()=>{window.scrollTo({top:0,left:0,behavior:"smooth"})}),document.addEventListener("scroll",throttle(()=>{scrollTopButton.classList.toggle(classes$u.isVisible,window.pageYOffset>window.innerHeight)},150)));
21const selectors$D={details:"details",popdownBody:"[data-popdown-body]",popdownClose:"[data-popdown-close]",popdownToggle:"[data-popdown-toggle]",searchFormInner:"[data-search-form-inner]",input:'input:not([type="hidden"])',popularSearchesLink:"[data-popular-searches-link]",header:"[data-site-header]",nav:"[data-nav]",navItemsCompress:"[data-nav-items-compress]",navIcons:"[data-nav-icons]",mobileMenu:"[data-mobile-menu]",predictiveSearch:"predictive-search",searchForm:"search-form"},attributes$p={popdownInHeader:"data-popdown-in-header",popdownInPage:"data-popdown-in-page",searchPerformed:"data-search-performed"},classes$t={searchOpened:"search-opened",headerMenuOpened:"site-header--menu-opened",navCompress:"nav--compress"};class SearchPopdown extends HTMLElement{constructor(){super(),this.isPopdownInHeader=this.hasAttribute(attributes$p.popdownInHeader),this.isPopdownInPage=this.hasAttribute(attributes$p.popdownInPage),this.popdownBody=this.querySelector(selectors$D.popdownBody),this.popdownClose=this.querySelector(selectors$D.popdownClose),this.searchFormInner=this.querySelector(selectors$D.searchFormInner),this.popularSearchesLink=this.querySelectorAll(selectors$D.popularSearchesLink),this.searchFormWrapper=this.querySelector(selectors$D.searchForm)?this.querySelector(selectors$D.searchForm):this.querySelector(selectors$D.predictiveSearch),this.predictiveSearch=this.searchFormWrapper.matches(selectors$D.predictiveSearch),this.header=document.querySelector(selectors$D.header),this.headerSection=this.header?.parentNode,this.nav=this.header?.querySelector(selectors$D.nav),this.mobileMenu=this.headerSection?.querySelector(selectors$D.mobileMenu),this.a11y=a11y,this.ensureClosingOnResizeEvent=()=>this.ensureClosingOnResize(),this.isPopdownInHeader&&(this.details=this.querySelector(selectors$D.details),this.popdownToggle=this.querySelector(selectors$D.popdownToggle))}connectedCallback(){this.isPopdownInHeader&&(this.details.addEventListener("keyup",event=>event.code.toUpperCase()==="ESCAPE"&&this.close()),this.popdownClose.addEventListener("click",()=>this.close()),this.popdownToggle.addEventListener("click",event=>this.onPopdownToggleClick(event))),this.isPopdownInPage&&(this.popdownClose.addEventListener("click",()=>this.triggerPopdownClose()),this.searchFormWrapper.addEventListener("focusout",()=>this.onFocusOut()),this.searchFormWrapper.input.addEventListener("click",event=>this.triggerPopdownOpen(event))),this.searchFormInner.addEventListener("transitionend",event=>{event.target===this.searchFormInner&&this.details.hasAttribute("open")&&this.details.getAttribute("open")=="false"&&this.onClose()}),this.popularSearchesLink.forEach(element=>{element.addEventListener("click",event=>{event.preventDefault();const popularSearchText=event.target.textContent;this.searchFormWrapper.input.value=popularSearchText,this.searchFormWrapper.submit()})})}onPopdownToggleClick(event){event.preventDefault(),event.target.closest(selectors$D.details).hasAttribute("open")?this.close():this.open(event)}onBodyClick(event){const isTargetInPopdown=this.contains(event.target);this.header?.classList.contains(classes$t.headerMenuOpened)||isTargetInPopdown||isTargetInPopdown||this.close()}onFocusOut(){this.predictiveSearch&&requestAnimationFrame(()=>{this.searchFormWrapper.contains(document.activeElement)||this.searchFormWrapper.close()})}triggerPopdownOpen(event){const isSearchPageWithoutTerms=this.closest(`[${attributes$p.searchPerformed}="false"]`),isTouch2=matchMedia("(pointer:coarse)").matches,viewportMobile=window.innerWidth<theme.sizes.small,shouldOpenPopdownOnTouchDevice=isTouch2||viewportMobile,shouldOpenPopdownOnNoTerms=isSearchPageWithoutTerms!=null;if(!(!this.nav||!this.mobileMenu)&&(shouldOpenPopdownOnTouchDevice||shouldOpenPopdownOnNoTerms)){event.preventDefault();const isNavCompressed=this.nav.classList.contains(classes$t.navCompress);let popdownToggle=this.mobileMenu.querySelector(selectors$D.popdownToggle);isTouch2||(popdownToggle=isNavCompressed?this.nav.querySelector(`${selectors$D.navItemsCompress} ${selectors$D.popdownToggle}`):this.nav.querySelector(`${selectors$D.navIcons} ${selectors$D.popdownToggle}`)),setTimeout(()=>{popdownToggle?.dispatchEvent(new Event("click",{bubbles:!0}))},300)}}open(event){this.onBodyClickEvent=event2=>this.onBodyClick(event2),event.target.closest(selectors$D.details).setAttribute("open",""),this.searchFormWrapper.input.setAttribute("aria-expanded",!0),document.body.classList.add(classes$t.searchOpened),document.body.addEventListener("click",this.onBodyClickEvent),document.addEventListener("theme:resize",this.ensureClosingOnResizeEvent),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})),this.a11y.state.trigger=event.target,requestAnimationFrame(()=>{requestAnimationFrame(()=>{event.target.closest(selectors$D.details).setAttribute("open","true"),this.a11y.trapFocus({container:this.searchFormInner})})})}close(){this.a11y.removeTrapFocus(),this.details.setAttribute("open","false"),this.predictiveSearch&&this.searchFormWrapper.close(),this.searchFormWrapper.handleFocusableDescendants(!0)}triggerPopdownClose(){this.predictiveSearch&&this.searchFormWrapper.close(),this.searchFormWrapper.popularSearches&&requestAnimationFrame(()=>document.activeElement.blur())}onClose(){this.details.removeAttribute("open"),document.dispatchEvent(new CustomEvent("theme:search:close",{bubbles:!0})),document.body.classList.remove(classes$t.searchOpened),document.body.removeEventListener("click",this.onBodyClickEvent),document.removeEventListener("theme:resize",this.ensureClosingOnResizeEvent),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}ensureClosingOnResize(){this.offsetParent===null&&this.onClose()}}customElements.define("search-popdown",SearchPopdown),theme.ProductModel=(function(){let modelJsonSections={},models={},xrButtons={};const selectors2={productMediaWrapper:"[data-product-single-media-wrapper]",mediaGroup:"[data-product-single-media-group]",productXr:"[data-shopify-xr]",mediaId:"data-media-id",model3d:"data-shopify-model3d-id",modelViewer:"model-viewer",modelJson:"#ModelJson-",deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]"},classes2={isLoading:"is-loading",mediaHidden:"media--hidden"};function init(mediaContainer,sectionId){modelJsonSections[sectionId]={loaded:!1};const deferredMediaButton=mediaContainer.querySelector(selectors2.deferredMediaButton);deferredMediaButton&&deferredMediaButton.addEventListener("click",loadContent.bind(this,mediaContainer,sectionId))}function loadContent(mediaContainer,sectionId){if(mediaContainer.querySelector(selectors2.deferredMedia).getAttribute("loaded"))return;mediaContainer.classList.add(classes2.isLoading);const content=document.createElement("div");content.appendChild(mediaContainer.querySelector("template").content.firstElementChild.cloneNode(!0));const modelViewerElement=content.querySelector("model-viewer"),deferredMedia=mediaContainer.querySelector(selectors2.deferredMedia);deferredMedia.appendChild(modelViewerElement),deferredMedia.setAttribute("loaded",!0);const mediaId=mediaContainer.dataset.mediaId,modelId=modelViewerElement.dataset.modelId,xrButton=mediaContainer.closest(selectors2.mediaGroup).parentElement.querySelector(selectors2.productXr);xrButtons[sectionId]={element:xrButton,defaultId:modelId},models[mediaId]={modelId,mediaId,sectionId,container:mediaContainer,element:modelViewerElement},window.ShopifyXR?setupModelViewerUi():window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:setupShopifyXr}
21,{name:"model-viewer-ui",version:"1.0",onLoad:setupModelViewerUi}])}function setupShopifyXr(errors){if(errors){console.warn(errors);return}if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",function(){setupShopifyXr()});return}for(const sectionId in modelJsonSections)if(modelJsonSections.hasOwnProperty(sectionId)){const modelSection=modelJsonSections[sectionId];if(modelSection.loaded)continue;const modelJson=document.querySelector(`${selectors2.modelJson}${sectionId}`);modelJson&&(window.ShopifyXR.addModels(JSON.parse(modelJson.innerHTML)),modelSection.loaded=!0)}window.ShopifyXR.setupXRElements()}function setupModelViewerUi(errors){if(errors){console.warn(errors);return}for(const key in models)if(models.hasOwnProperty(key)){const model=models[key];model.modelViewerUi||(model.modelViewerUi=new Shopify.ModelViewerUI(model.element),setupModelViewerListeners(model))}}function setupModelViewerListeners(model){const xrButton=xrButtons[model.sectionId];model.container.addEventListener("theme:media:visible",function(){xrButton.element.setAttribute(selectors2.model3d,model.modelId),!window.theme.touch&&(model.modelViewerUi.play(),model.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0}))}),model.container.addEventListener("theme:media:hidden",function(){model.modelViewerUi.pause()}),model.container.addEventListener("xrLaunch",function(){model.modelViewerUi.pause()}),model.element.addEventListener("load",()=>{xrButton.element.setAttribute(selectors2.model3d,model.modelId),model.container.classList.remove(classes2.isLoading),model.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})}),model.element.addEventListener("shopify_model_viewer_ui_toggle_play",function(){pauseOtherMedia(model.mediaId),setTimeout(()=>{model.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})},50)}),model.element.addEventListener("shopify_model_viewer_ui_toggle_pause",function(){model.container.dispatchEvent(new CustomEvent("theme:media:pause"),{bubbles:!0})}),pauseOtherMedia(model.mediaId)}function pauseOtherMedia(mediaId){const currentMedia=`[${selectors2.mediaId}="${mediaId}"]`,otherMedia=document.querySelectorAll(`${selectors2.productMediaWrapper}:not(${currentMedia})`);otherMedia.length&&otherMedia.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes2.mediaHidden)})}function removeSectionModels(sectionId){for(const key in models)models.hasOwnProperty(key)&&models[key].sectionId===sectionId&&delete models[key];delete modelJsonSections[sectionId],delete theme.mediaInstances[sectionId]}return{init,loadContent,removeSectionModels}})(),register("collection-template",filters);const selectors$C={templateAddresses:".template-customers-addresses",accountForm:"[data-form]",addressNewForm:"[data-form-new]",btnNew:"[data-button-new]",btnEdit:"[data-button-edit]",btnDelete:"[data-button-delete]",btnCancel:"[data-button-cancel]",editAddress:"data-form-edit",addressCountryNew:"AddressCountryNew",addressProvinceNew:"AddressProvinceNew",addressProvinceContainerNew:"AddressProvinceContainerNew",addressCountryOption:"[data-country-option]",addressCountry:"AddressCountry",addressProvince:"AddressProvince",addressProvinceContainer:"AddressProvinceContainer",requiredInputs:'input[type="text"]:not(.optional)'},attributes$o={dataFormId:"data-form-id"},classes$s={hidden:"is-hidden",validation:"validation--showup"};class Addresses{constructor(section){this.section=section,this.addressNewForm=this.section.querySelector(selectors$C.addressNewForm),this.accountForms=this.section.querySelectorAll(selectors$C.accountForm),this.init(),this.validate()}init(){if(this.addressNewForm){const section=this.section,newAddressForm=this.addressNewForm;this.customerAddresses();const newButtons=section.querySelectorAll(selectors$C.btnNew);newButtons.length&&newButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault(),button.classList.add(classes$s.hidden),newAddressForm.classList.remove(classes$s.hidden)})});const editButtons=section.querySelectorAll(selectors$C.btnEdit);editButtons.length&&editButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault();const formId=this.getAttribute(attributes$o.dataFormId);section.querySelector(`[${selectors$C.editAddress}="${formId}"]`).classList.toggle(classes$s.hidden)})});const deleteButtons=section.querySelectorAll(selectors$C.btnDelete);deleteButtons.length&&deleteButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault();const formId=this.getAttribute(attributes$o.dataFormId);confirm(theme.strings.delete_confirm)&&Shopify.postLink("/account/addresses/"+formId,{parameters:{_method:"delete"}})})});const cancelButtons=section.querySelectorAll(selectors$C.btnCancel);cancelButtons.length&&cancelButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault(),this.closest(selectors$C.accountForm).classList.add(classes$s.hidden),document.querySelector(selectors$C.btnNew).classList.remove(classes$s.hidden)})})}}customerAddresses(){Shopify.CountryProvinceSelector&&new Shopify.CountryProvinceSelector(selectors$C.addressCountryNew,selectors$C.addressProvinceNew,{hideElement:selectors$C.addressProvinceContainerNew}),this.section.querySelectorAll(selectors$C.addressCountryOption).forEac
21h(element=>{const formId=element.getAttribute(attributes$o.dataFormId),countrySelector=`${selectors$C.addressCountry}_${formId}`,provinceSelector=`${selectors$C.addressProvince}_${formId}`,containerSelector=`${selectors$C.addressProvinceContainer}_${formId}`;new Shopify.CountryProvinceSelector(countrySelector,provinceSelector,{hideElement:containerSelector})})}validate(){this.accountForms.forEach(accountForm=>{const form=accountForm.querySelector("form"),inputs=form.querySelectorAll(selectors$C.requiredInputs);form.addEventListener("submit",event=>{let isEmpty=!1;inputs.forEach(input=>{input.value?input.nextElementSibling.classList.remove(classes$s.validation):(input.nextElementSibling.classList.add(classes$s.validation),isEmpty=!0)}),isEmpty&&event.preventDefault()})})}}const template=document.querySelector(selectors$C.templateAddresses);template&&new Addresses(template);const selectors$B={form:"[data-account-form]",showReset:"[data-show-reset]",hideReset:"[data-hide-reset]",recover:"[data-recover-password]",login:"[data-login-form]",recoverSuccess:"[data-recover-success]",recoverSuccessText:"[data-recover-success-text]",recoverHash:"#recover"},classes$r={hidden:"is-hidden"};class Login{constructor(form){this.form=form,this.showButton=form.querySelector(selectors$B.showReset),this.hideButton=form.querySelector(selectors$B.hideReset),this.recover=form.querySelector(selectors$B.recover),this.login=form.querySelector(selectors$B.login),this.success=form.querySelector(selectors$B.recoverSuccess),this.successText=form.querySelector(selectors$B.recoverSuccessText),this.init()}init(){window.location.hash==selectors$B.recoverHash?this.showRecoverPasswordForm():this.hideRecoverPasswordForm(),this.success&&this.successText.classList.remove(classes$r.hidden),this.showButton.addEventListener("click",e=>{e.preventDefault(),this.showRecoverPasswordForm()},!1),this.hideButton.addEventListener("click",e=>{e.preventDefault(),this.hideRecoverPasswordForm()},!1)}showRecoverPasswordForm(){return this.recover.classList.remove(classes$r.hidden),this.login.classList.add(classes$r.hidden),window.location.hash=selectors$B.recoverHash,!1}hideRecoverPasswordForm(){return this.login.classList.remove(classes$r.hidden),this.recover.classList.add(classes$r.hidden),window.location.hash="",!1}}const loginForm=document.querySelector(selectors$B.form);loginForm&&new Login(loginForm),register("search-template",[filters,tabs]);const selectors$A={frame:"[data-ticker-frame]",scale:"[data-ticker-scale]",text:"[data-ticker-text]",clone:"data-clone"},attributes$n={speed:"data-marquee-speed"},classes$q={animationClass:"ticker--animated",unloadedClass:"ticker--unloaded",comparitorClass:"ticker__comparitor"},settings$1={moveTime:1.63,space:100};class Ticker{constructor(el,stopClone=!1){this.frame=el,this.stopClone=stopClone,this.scale=this.frame.querySelector(selectors$A.scale),this.text=this.frame.querySelector(selectors$A.text),this.comparitor=this.text.cloneNode(!0),this.comparitor.classList.add(classes$q.comparitorClass),this.frame.appendChild(this.comparitor),this.scale.classList.remove(classes$q.unloadedClass),this.resizeEvent=debounce(()=>this.checkWidth(),100),this.listen()}listen(){document.addEventListener("theme:resize:width",this.resizeEvent),this.checkWidth()}checkWidth(){const padding=window.getComputedStyle(this.frame).paddingLeft.replace("px","")*2;if(this.frame.clientWidth-padding<this.comparitor.clientWidth||this.stopClone){if(this.scale.childElementCount===1){if(this.text.classList.add(classes$q.animationClass),this.clone=this.text.cloneNode(!0),this.clone.setAttribute(selectors$A.clone,""),this.scale.appendChild(this.clone),this.stopClone)for(let index=0;index<10;index++){const cloneSecond=this.text.cloneNode(!0);cloneSecond.setAttribute(selectors$A.clone,""),this.scale.appendChild(cloneSecond)}let frameSpeed=this.frame.getAttribute(attributes$n.speed);frameSpeed===null&&(frameSpeed=100);const speed=settings$1.moveTime*(100/parseInt(frameSpeed,10)),animationTimeFrame=this.text.clientWidth/settings$1.space*speed;this.scale.style.setProperty("--animation-time",`${animationTimeFrame}s`)}}else{this.text.classList.add(classes$q.animationClass);let clone=this.scale.querySelector(`[${selectors$A.clone}]`);clone&&this.scale.removeChild(clone),this.text.classList.remove(classes$q.animationClass)}}unload(){document.removeEventListener("theme:resize:width",this.resizeEvent)}}
21const selectors$z={bar:"[data-bar]",barSlide:"[data-slide]",topBarSlide:"[data-top-bar-slide]",frame:"[data-ticker-frame]",slider:"[data-slider]",tickerScale:"[data-ticker-scale]",tickerText:"[data-ticker-text]"},attributes$m={slide:"data-slide",speed:"data-slider-speed",stop:"data-stop",style:"style",dataTargetReferrer:"data-target-referrer"},classes$p={desktop:"desktop",mobile:"mobile",tickerAnimated:"ticker--animated"},sections$q={};class AnnouncementBar{constructor(container){this.barHolder=container,this.locationPath=location.href,this.slides=this.barHolder.querySelectorAll(selectors$z.barSlide),this.slider=this.barHolder.querySelector(selectors$z.slider),this.tickers=[],this.flkty=null,this.init()}init(){this.removeAnnouncement(),this.slider&&(this.initSlider(),document.addEventListener("theme:resize:width",this.initSlider.bind(this))),this.slider||(this.initTickers(!0),this.tickerAnimationPause())}removeAnnouncement(){for(let i=0;i<this.slides.length;i++){const element=this.slides[i];element.hasAttribute(attributes$m.dataTargetReferrer)&&this.locationPath.indexOf(element.getAttribute(attributes$m.dataTargetReferrer))===-1&&!window.Shopify.designMode&&element.parentNode.removeChild(element)}}initSlider(){if(this.slider.querySelectorAll(selectors$z.barSlide)){let slideSelector=`${selectors$z.barSlide}`;window.innerWidth<theme.sizes.small?slideSelector=`${selectors$z.barSlide}:not(.${classes$p.desktop})`:slideSelector=`${selectors$z.barSlide}:not(.${classes$p.mobile})`,this.flkty!=null&&this.flkty.destroy(),this.flkty=new Flickity(this.slider,{cellSelector:slideSelector,pageDots:!1,prevNextButtons:!1,wrapAround:!0,autoPlay:parseInt(this.slider.getAttribute(attributes$m.speed),10),on:{ready:()=>{setTimeout(()=>{this.slider.dispatchEvent(new CustomEvent("slider-is-loaded",{bubbles:!0,detail:{slider:this}}))},10)}}}),this.flkty.reposition()}this.slider.addEventListener("slider-is-loaded",()=>{this.initTickers()})}initTickers(stopClone=!1){this.barHolder.querySelectorAll(selectors$z.frame).forEach(element=>{const ticker=new Ticker(element,stopClone);this.tickers.push(ticker);const slides=element.querySelectorAll(selectors$z.barSlide);if(slides.length!==0){const slidesMobile=element.querySelectorAll(`${selectors$z.barSlide}.${classes$p.mobile}`),slidesDesktop=element.querySelectorAll(`${selectors$z.barSlide}.${classes$p.desktop}`);slides.length===slidesMobile.length?element.parentNode.classList.add(classes$p.mobile):slides.length===slidesDesktop.length&&element.parentNode.classList.add(classes$p.desktop)}})}toggleTicker(e,isStopped){const tickerScale=e.target.closest(selectors$z.tickerScale),element=document.querySelector(`[${attributes$m.slide}="${e.detail.blockId}"]`);isStopped&&element&&(tickerScale.setAttribute(attributes$m.stop,""),tickerScale.querySelectorAll(selectors$z.tickerText).forEach(textHolder=>{textHolder.classList.remove(classes$p.tickerAnimated),textHolder.style.transform=`translate3d(${-(element.offsetLeft-parseInt(getComputedStyle(element).marginLeft,10))}px, 0, 0)`})),!isStopped&&element&&(tickerScale.querySelectorAll(selectors$z.tickerText).forEach(textHolder=>{textHolder.classList.add(classes$p.tickerAnimated),textHolder.removeAttribute(attributes$m.style)}),tickerScale.removeAttribute(attributes$m.stop))}tickerAnimationPause(){let hoverTimer=0,isHovered=!1;const tickerContainer=this.barHolder.querySelector(selectors$z.topBarSlide);tickerContainer.addEventListener("mouseenter",()=>{isHovered=!0,hoverTimer=setTimeout(()=>{isHovered&&tickerContainer.querySelectorAll(selectors$z.tickerText).forEach(element=>{element.style.animationPlayState="paused"}),clearTimeout(hoverTimer)},500)}),tickerContainer.addEventListener("mouseleave",()=>{isHovered=!1,tickerContainer.querySelectorAll(selectors$z.tickerText).forEach(element=>{element.style.animationPlayState="running"})})}onBlockSelect(evt){const index=parseInt([...evt.target.parentNode.children].indexOf(evt.target));this.slider&&this.flkty!==null&&(this.flkty.select(index),this.flkty.pausePlayer()),this.slider||this.toggleTicker(evt,!0)}onBlockDeselect(evt){this.slider&&this.flkty!==null&&this.flkty.unpausePlayer(),this.slider||this.toggleTicker(evt,!1)}onUnload(){document.removeEventListener("theme:resize:width",this.initSlider.bind(this)),this.tickers.length>
210&&this.tickers.forEach(ticker=>{ticker.unload()})}}const bar={onLoad(){sections$q[this.id]=[];const element=this.container.querySelector(selectors$z.bar);element&§ions$q[this.id].push(new AnnouncementBar(element))},onBlockSelect(e){sections$q[this.id].length&§ions$q[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})},onBlockDeselect(e){sections$q[this.id].length&§ions$q[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockDeselect(e)})},onUnload(){sections$q[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})}};register("announcement-bar",bar),register("marquee",bar);const selectors$y={trigger:"[data-collapsible-trigger]"},classes$o={isExpanded:"is-expanded"};register("accordions",[{onBlockSelect(e){const trigger=e.target.querySelector(selectors$y.trigger);requestAnimationFrame(()=>{trigger.classList.contains(classes$o.isExpanded)||trigger.dispatchEvent(new Event("click"))})}},collapsible]);const selectors$x={button:"[data-share-button]",tooltip:"[data-share-button-tooltip]"},classes$n={visible:"is-visible",hiding:"is-hiding"},sections$p={};class ShareButton{constructor(container){this.container=container,this.button=this.container.querySelector(selectors$x.button),this.tooltip=this.container.querySelector(selectors$x.tooltip),this.transitionSpeed=200,this.hideTransitionTimeout=0,this.init()}init(){this.button&&this.button.addEventListener("click",()=>{let targetUrl=window.location.href;this.button.dataset.shareLink&&(targetUrl=this.button.dataset.shareLink),this.tooltip.classList.contains(classes$n.visible)||navigator.clipboard.writeText(targetUrl).then(()=>{this.tooltip.classList.add(classes$n.visible),setTimeout(()=>{this.tooltip.classList.add(classes$n.hiding),this.tooltip.classList.remove(classes$n.visible),this.hideTransitionTimeout&&clearTimeout(this.hideTransitionTimeout),this.hideTransitionTimeout=setTimeout(()=>{this.tooltip.classList.remove(classes$n.hiding)},this.transitionSpeed)},1500)})})}}const shareButton={onLoad(){sections$p[this.id]=new ShareButton(this.container)}};register("article",[shareButton]);const selectors$w={videoPlay:"[data-video-play]"},attributes$l={videoPlayValue:"data-video-play"};class VideoPlay{constructor(container){this.container=container,this.videoPlay=this.container.querySelectorAll(selectors$w.videoPlay),this.a11y=a11y,this.init()}init(){this.videoPlay.length&&this.videoPlay.forEach(element=>{element.addEventListener("click",e=>{if(element.hasAttribute(attributes$l.videoPlayValue)&&element.getAttribute(attributes$l.videoPlayValue).trim()!==""){e.preventDefault();const items=[{html:element.getAttribute(attributes$l.videoPlayValue)}];this.a11y.state.trigger=element,new LoadPhotoswipe(items)}})})}}const videoPlay={onLoad(){new VideoPlay(this.container)}},selectors$v={header:"[data-site-header]",main:"[data-main]"};let sections$o={};class ZoomAnimation{constructor(container){this.container=container,this.header=document.querySelector(selectors$v.header),this.init()}init(){if(this.container.dataset.zoomAnimation!=="true")return;const observedElement=this.container,firstSection=document.body.querySelector(selectors$v.main).children[0],isFirstSection=this.container.parentNode===firstSection,hasTransparentHeader=this.header?.dataset.transparent=="true",renderZoomEffect=()=>{const headerHeight=isFirstSection&hasTransparentHeader?0:parseInt(this.header?.dataset.height||this.header?.offsetHeight),rect=observedElement.getBoundingClientRect(),sectionHeight=observedElement.offsetHeight,scrolledPercentage=(isFirstSection?headerHeight-rect.top:headerHeight-rect.top+window.innerHeight)/sectionHeight;let transitionSpeed=.1;isFirstSection&&(transitionSpeed*=1.5);let scale=1+scrolledPercentage*transitionSpeed;scale=scale>1?scale:1,observedElement.style.setProperty("--scale",scale)};renderZoomEffect(),this.zoomOnScrollEvent=throttle(renderZoomEffect,5);const observerOptions={root:null,rootMargin:"0px",threshold:0},intersectionCallback=entry=>{entry[0].isIntersecting?window.addEventListener("scroll",this.zoomOnScrollEvent):window.removeEventListener("scroll",this.zoomOnScrollEvent)};new IntersectionObserver(intersectionCallback,observerOptions).observe(observedElement)}onUnload(){this.zoomOnScrollEvent!==null&&window.removeEventListener("scroll",this.zoomOnScrollEvent)}}const zoomAnimation={onLoad(){sections$o[this.id]=new ZoomAnimation(this.container)},onUnload(){sections$o[this.id].onUnload()}};register("banner-image",[zoomAnimation,videoPlay]);
21const selectors$u={banner:"[data-banner]",slider:"[data-slider]",sliderMedia:"[data-banners-media]",links:"a, button"},attributes$k={index:"data-index",singleImage:"data-slider-single-image",tabIndex:"tabindex"},classes$m={isSelected:"is-selected"};let sections$n={};class BannerWithTextColumns{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$u.slider),this.singleImageEnabled=this.slider?.hasAttribute(attributes$k.singleImage),this.banners=this.container.querySelectorAll(selectors$u.banner),this.links=this.container.querySelectorAll("a"),this.sliderMedia=this.container.querySelector(selectors$u.sliderMedia),this.flkty=null,this.flktyMedia=null,this.sliderResizeEvent=()=>this.resizeSlider(),this.slider&&(this.initSliders(),document.addEventListener("theme:resize:width",this.sliderResizeEvent))}initSliders(){if(this.slider.children.length<=1)return;let isDraggable=window.innerWidth<window.theme.sizes.small;this.sliderMedia.children.length>1&&(this.flktyMedia=new Flickity(this.sliderMedia,{draggable:!1,wrapAround:!1,fade:!0,prevNextButtons:!1,adaptiveHeight:!1,pageDots:!1,setGallerySize:!1}),flickitySmoothScrolling(this.sliderMedia)),this.flkty=new Flickity(this.slider,{draggable:isDraggable,prevNextButtons:!1,pageDots:!0,cellAlign:"left",adaptiveHeight:!1,imagesLoaded:!0,lazyLoad:!0,on:{ready:()=>{this.links.forEach(link=>{link.addEventListener("focus",()=>{const selectedIndex=Number(link.closest(selectors$u.banner).getAttribute(attributes$k.index));window.innerWidth>=theme.sizes.small&&this.syncContent(selectedIndex)})}
21),this.banners.forEach(slide=>{slide.addEventListener("mouseenter",()=>{const selectedIndex=Number(slide.getAttribute(attributes$k.index));window.innerWidth>=theme.sizes.small&&!window.theme.touch&&this.syncContent(selectedIndex)}),slide.addEventListener("pointerup",()=>{const selectedIndex=Number(slide.getAttribute(attributes$k.index));window.innerWidth>=theme.sizes.small&&window.theme.touch&&this.syncContent(selectedIndex)})}),this.slidesTabIndex()},change:index=>{window.innerWidth<theme.sizes.small&&!this.singleImageEnabled&&this.flktyMedia.select(index),this.slidesTabIndex()}}}),flickitySmoothScrolling(this.slider)}slidesTabIndex(){Flickity.data(this.slider).cells.forEach(slide=>{let tabIndex="-1";slide.element.classList.contains(classes$m.isSelected)&&(tabIndex="0"),slide.element.querySelectorAll(selectors$u.links).forEach(link=>{link.setAttribute(attributes$k.tabIndex,tabIndex)})})}syncContent(index=0){this.flkty.selectCell(index),this.flktyMedia&&this.flktyMedia.selectCell(index)}resizeSlider(){this.flkty&&(this.flkty.resize(),this.toggleDraggable()),this.flktyMedia&&this.flktyMedia.resize()}toggleDraggable(){this.flkty.options.draggable=window.innerWidth<window.theme.sizes.small,this.flkty.updateDraggable()}onBlockSelect(evt){const selectedIndex=parseInt([...evt.target.parentNode.children].indexOf(evt.target));this.flktyMedia&&this.flktyMedia.selectCell(selectedIndex)}onUnload(){document.removeEventListener("theme:resize:width",this.sliderResizeEvent)}}register("banner-with-text-columns",{onLoad(){sections$n[this.id]=new BannerWithTextColumns(this)},onBlockSelect(e){sections$n[this.id].onBlockSelect(e)}}),register("blog-posts",ajaxify);const selectors$t={slider:"[data-slider]",sliderItem:"[data-slider-item]",sliderItemImage:"[data-media-container]",links:"a, button",flickityButton:".flickity-button"},classes$l={carouselInactive:"carousel--inactive"},attributes$j={tabIndex:"tabindex"},sections$m={};class ColumnsWithImage{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$t.slider),this.flkty=null,this.gutter=0,this.checkSlidesSizeOnResize=()=>this.checkSlidesSize(),this.listen()}initSlider(){this.slider.classList.remove(classes$l.carouselInactive),this.flkty=new Flickity(this.slider,{pageDots:!1,cellAlign:"left",groupCells:!0,contain:!0,on:{ready:()=>{this.setSliderArrowsPosition(this.slider),setTimeout(()=>{this.changeTabIndex()},0)},change:()=>{this.changeTabIndex()}}})}destroySlider(){this.slider.classList.add(classes$l.carouselInactive),this.flkty!==null&&(this.flkty.destroy(),this.flkty=null)}checkSlidesSize(){const sliderItemStyle=this.container.querySelector(selectors$t.sliderItem).currentStyle||window.getComputedStyle(this.container.querySelector(selectors$t.sliderItem));this.gutter=parseInt(sliderItemStyle.marginRight);const containerWidth=this.slider.offsetWidth,itemsWidth=this.getItemsWidth(),itemsOverflowViewport=containerWidth<itemsWidth;window.innerWidth>=theme.sizes.small&&itemsOverflowViewport?this.initSlider():this.destroySlider()}changeTabIndex(){const selectedElementsIndex=this.flkty.selectedIndex;this.flkty.slides.forEach((slide,index)=>{slide.cells.forEach(cell=>
21{cell.element.querySelectorAll(selectors$t.links).forEach(link=>{link.setAttribute(attributes$j.tabIndex,selectedElementsIndex===index?"0":"-1")})})})}getItemsWidth(){let itemsWidth=0;const slides=this.slider.querySelectorAll(selectors$t.sliderItem);return slides.length&&slides.forEach(item=>{itemsWidth+=item.offsetWidth+this.gutter}),itemsWidth}listen(){this.slider&&(this.checkSlidesSize(),document.addEventListener("theme:resize:width",this.checkSlidesSizeOnResize))}setSliderArrowsPosition(slider2){const arrows=slider2.querySelectorAll(selectors$t.flickityButton),image=slider2.querySelector(selectors$t.sliderItemImage);arrows.length&&image&&arrows.forEach(arrow=>{arrow.style.top=`${image.offsetHeight/2}px`})}onBlockSelect(evt){if(this.flkty!==null){const index=parseInt([...evt.target.parentNode.children].indexOf(evt.target)),slidesPerPage=parseInt(this.flkty.slides[0].cells.length),groupIndex=Math.floor(index/slidesPerPage);this.flkty.select(groupIndex)}else{const sliderStyle=this.slider.currentStyle||window.getComputedStyle(this.slider),sliderPadding=parseInt(sliderStyle.paddingLeft),blockPositionLeft=evt.target.offsetLeft-sliderPadding;this.slider.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}onUnload(){document.removeEventListener("theme:resize:width",this.checkSlidesSizeOnResize)}}register("columns-with-image",[{onLoad(){sections$m[this.id]=new ColumnsWithImage(this)},onUnload(e){sections$m[this.id].onUnload(e)},onBlockSelect(e){sections$m[this.id].onBlockSelect(e)}},videoPlay]);const selectors$s={formMessageClose:"[data-form-message-close]",formMessageWrapper:"[data-form-message]"},classes$k={hideDown:"hide-down",notificationVisible:"notification-visible"};let sections$l={};class ContactForm{constructor(section){this.container=section.container,this.closeButton=this.container.querySelector(selectors$s.formMessageClose),this.messageWrapper=this.container.querySelector(selectors$s.formMessageWrapper),this.messageWrapper&&(this.hidePopups(),this.closeFormMessage(),this.autoHideMessage())}hidePopups(){document.body.classList.add(classes$k.notificationVisible)}showPopups(){document.body.classList.remove(classes$k.notificationVisible)}closeFormMessage(){this.closeButton.addEventListener("click",this.closeMessage.bind(this))}closeMessage(e){e.preventDefault(),this.messageWrapper.classList.add(classes$k.hideDown),this.showPopups()}autoHideMessage(){setTimeout(()=>{this.messageWrapper.classList.add(classes$k.hideDown),this.showPopups()},1e4)}}register("contact-form",{onLoad(){sections$l[this.id]=new ContactForm(this)}});const selectors$r={time:"time",days:"[data-days]",hours:"[data-hours]",minutes:"[data-minutes]",seconds:"[data-seconds]",sectionType:"[data-section-type]",shopifySection:".shopify-section"},classes$j={countdownLoading:"countdown--loading",countdownLoaded:"countdown--loaded",countdownTimerShowMessage:"countdown-timer--show-message",hideCountdown:"hide-countdown"},attributes$i={expirationBehavior:"data-expiration-behavior"},settings={hide:"hide",showMessage:"show-message"};class CountdownTimer extends HTMLElement{constructor(){super(),this.section=this.closest(selectors$r.sectionType),this.shopifySection=this.closest(selectors$r.shopifySection),this.expirationBehavior=this.getAttribute(attributes$i.expirationBehavior),this.time=this.querySelector(selectors$r.time),this.endDate=Date.parse(this.time.dateTime),this.days=this.querySelector(selectors$r.days),this.hours=this.querySelector(selectors$r.hours),this.minutes=this.querySelector(selectors$r.minutes),this.seconds=this.querySelector(selectors$r.seconds),this.daysInMs=1e3*60*60*24,this.hoursInMs=this.daysInMs/24,this.minutesInMs=this.hoursInMs/60,this.secondsInMs=this.minutesInMs/60,this.isLoading=!0,this.shouldHideOnComplete=this.expirationBehavior===settings.hide,this.shouldShowMessage=this.expirationBehavior===settings.showMessage,this.update=this.update.bind(this)}connectedCallback(){this.init()}disconnectedCallback(){this.stopTimer()}init(){if(isNaN(this.endDate)){this.onComplete();return}if(this.endDate<=Date.now()){this.onComplete();return}this.onLoad(!0),this.interval=setInterval(this.update,1e3)}
21stopTimer(){clearInterval(this.interval)}convertTime(timeInMs){const days=parseInt(timeInMs/this.daysInMs,10);timeInMs-=days*this.daysInMs;const hours=parseInt(timeInMs/this.hoursInMs,10);timeInMs-=hours*this.hoursInMs;const minutes=parseInt(timeInMs/this.minutesInMs,10);timeInMs-=minutes*this.minutesInMs;const seconds=parseInt(timeInMs/this.secondsInMs,10);return{days,hours,minutes,seconds}}render(timer){this.days.textContent=timer.days,this.hours.textContent=timer.hours,this.minutes.textContent=timer.minutes,this.seconds.textContent=timer.seconds}onComplete(){this.render({days:0,hours:0,minutes:0,seconds:0}),this.shouldHideOnComplete&&this.shopifySection.classList.add(classes$j.hideCountdown),this.shouldShowMessage&&this.classList.add(classes$j.countdownTimerShowMessage)}onLoad(init){if(init){this.section.classList.add(classes$j.countdownLoading);return}this.section.classList.add(classes$j.countdownLoaded),this.isLoading=!1}update(){const currentDate=Date.now(),timeDiff=this.endDate-currentDate;if(timeDiff<=0){this.stopTimer(),this.onComplete();return}const remainingTime=this.convertTime(timeDiff);this.render(remainingTime),this.isLoading&&this.onLoad(!1)}}register("countdown",[zoomAnimation,videoPlay]),customElements.get("countdown-timer")||customElements.define("countdown-timer",CountdownTimer);const selectors$q={videoId:"[data-video-id]",videoPlayer:"[data-video-player]",videoTemplate:"[data-video-template]",videoAutoplay:"[data-video-autoplay]",videoWrapper:"[data-video-wrapper]",videoPlayButton:"[data-video-bg-play]"},classes$i={loading:"is-loading",paused:"is-paused"},sections$k={};class VideoBackground{constructor(container){this.container=container,this.videoId=this.container.querySelector(selectors$q.videoId),this.videoPlayer=this.container.querySelector(selectors$q.videoPlayer),this.videoTemplate=this.container.querySelector(selectors$q.videoTemplate),this.videoPlayButton=this.container.querySelector(selectors$q.videoPlayButton),this.init()}init(){if(!this.videoId)return;new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{if(entry.isIntersecting){const videoMarkup=this.videoTemplate.innerHTML;this.videoPlayer.innerHTML=videoMarkup,this.video=this.container.querySelector(selectors$q.videoAutoplay),this.videoPlayer.classList.remove(classes$i.loading),this.container.classList.add(classes$i.paused),this.listen(),observer.unobserve(entry.target)}})},{root:null,rootMargin:"300px",threshold:[0,.1,.25,.5,.75,1]}).observe(this.videoPlayer),this.videoPlayButton.addEventListener("click",event=>{event.preventDefault(),this.video?.play()})}listen(){this.video.addEventListener("play",()=>{this.container.classList.remove(classes$i.paused)}),this.container.addEventListener("touchstart",()=>{this.video.play()},{passive:!0})}}const videoBackground={onLoad(){sections$k[this.id]=[],this.container.querySelectorAll(selectors$q.videoWrapper).forEach(videoWrapper=>{sections$k[this.id].push(new VideoBackground(videoWrapper))})}};class PopupCookie{constructor(name,value){this.configuration={expires:null,path:"/",domain:window.location.hostname,sameSite:"none",secure:!0},this.name=name,this.value=value}write(){(document.cookie.indexOf("; ")!==-1&&!document.cookie.split("; ").find(row=>row.startsWith(this.name))||document.cookie.indexOf("; ")===-1)&&(document.cookie=`${this.name}=${this.value}; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}; sameSite=${this.configuration.sameSite}; secure=${this.configuration.secure}`)}read(){return document.cookie.indexOf("; ")!==-1&&document.cookie.split("; ").find(row=>row.startsWith(this.name))?document.cookie.split("; ").find(row=>row.startsWith(this.name)).split("=")[1]:!1}destroy(){document.cookie.split("; ").find(row=>row.startsWith(this.name))&&(document.cookie=`${this.name}=null; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}; sameSite=${this.configuration.sameSite}; secure=${this.configuration.secure}`)}}const selectors$p={newsletterForm:"[data-newsletter-form]",popup:"[data-popup]"},classes$h={success:"has-success",error:"has-error"},attributes$h={storageNewsletterFormId:"newsletter_form_id"},sections$j={};class Newsletter{constructor(newsletter){this.newsletter=newsletter,this.sessionStorage=window.sessionStorage,this.popup=this.newsletter.closest(selectors$p.popup),this.stopSubmit=!0,this.isChallengePage=!1,this.formID=null,this.formIdSuccess=null,this.checkForChallengePage(),this.newsletterSubmit=e=>this.newsletterSubmitEvent(e),this.isChallengePage||this.init()}init(){this.newsletter.addEventListener("submit",this.newsletterSubmit),this.showMessage()}newsletterSubmitEvent(e){this.stopSubmit&&(e.preventDefault(),this.removeStorage(),this.writeStorage(),this.stopSubmit=!1,this.newsletter.submit())}checkForChallengePage(){this.isChallengePage=window.location.pathname===theme.routes.root+"challenge"}writeStorage(){this.sessionStorage!==void 0&&this.sessionStorage.setItem(attributes$h.storageNewsletterFormId,this.newsletter.id)}readStorage(){this.formID=this.sessionStorage.getItem(attributes$h.storageNewsletterFormId)}removeStorage(){this.sessionStorage.removeItem(attributes$h.storageNewsletterFormId)}showMessage(){if(this.readStorage(),this.newsletter.id===this.formID){const newsletter=document.getElementById(this.formID),submissionSuccess=window.location.search.indexOf("?customer_posted=true")!==-1,submissionFailure=window.location.search.indexOf("accepts_marketing")!==-1;submissionSuccess?(newsletter.classList.remove(classes$h.error),newsletter.classList.add(classes$h.success),this.popup&&(this.cookie=new PopupCookie(this.popup.dataset.cookieName,"user_has_closed"),this.cookie.write())):submissionFailure&&(newsletter.classList.remove(classes$h.success),newsletter.classList.add(classes$h.error)),(submissionSuccess||submissionFailure)&&this.scrollToForm(newsletter)}}scrollToForm(newsletter){const rect=newsletter.getBoundingClientRect();visibilityHelper.isElementPartiallyVisible(newsletter)||visibilityHelper.isElementTotallyVisible(newsletter)||setTimeout(()=>
21{window.scrollTo({top:rect.top,left:0,behavior:"smooth"})},400)}onUnload(){this.newsletter.removeEventListener("submit",this.newsletterSubmit)}}const newsletterSection={onLoad(){sections$j[this.id]=[],this.container.querySelectorAll(selectors$p.newsletterForm).forEach(form=>{sections$j[this.id].push(new Newsletter(form))})},onUnload(){sections$j[this.id].forEach(form=>{typeof form.onUnload=="function"&&form.onUnload()})}},selectors$o={product:"[data-product]",productSlider:"[data-slider]",productSlide:"[data-slide]",productGridItemImage:"[data-product-media-container]",flickityButton:".flickity-button",item:"[data-slide]",links:"a, button"},attributes$g={tabIndex:"tabindex"},sections$i={};class CustomContent{constructor(container){this.container=container,this.product=this.container.querySelectorAll(selectors$o.product),this.productSlider=this.container.querySelectorAll(selectors$o.productSlider),this.checkSliderOnResize=()=>this.checkSlider(),this.resizeSliderEvent=event=>this.resizeSlider(event),this.flkty=[],this.videoObj=[],this.quickViewObj=[],this.listen()}checkSlider(){window.innerWidth>=theme.sizes.small?this.productSlider.forEach(slider2=>{this.initProductSlider(slider2)}):this.productSlider.forEach(slider2=>{this.destroyProductSlider(slider2)})}initProductSlider(slider2){const slidesCount=slider2.querySelectorAll(selectors$o.productSlide).length,sliderId=slider2.dataset.slider;slidesCount>1&&(this.flkty[sliderId]===void 0||!this.flkty[sliderId].isActive?this.flkty[sliderId]=new Flickity(slider2,{prevNextButtons:!0,adaptiveHeight:!0,pageDots:!0,wrapAround:!0,on:{ready:()=>{this.setSliderArrowsPosition(slider2)},change:index=>{this.flkty[sliderId].cells.forEach((slide,i)=>
21{slide.element.querySelectorAll(selectors$o.links).forEach(link=>{link.setAttribute(attributes$g.tabIndex,i===index?"0":"-1")})})}}}):this.setSliderArrowsPosition(slider2))}destroyProductSlider(slider2){const sliderId=slider2.dataset.slider;typeof this.flkty[sliderId]=="object"&&this.flkty[sliderId].destroy()}setSliderArrowsPosition(slider2){const arrows=slider2.querySelectorAll(selectors$o.flickityButton),image=slider2.querySelector(selectors$o.productGridItemImage);arrows.length&&image&&arrows.forEach(arrow=>{arrow.style.top=`${image.offsetHeight/2}px`})}resizeSlider(event){const slider2=event.target,flkty=Flickity.data(slider2)||null;flkty&&flkty.resize()}listen(){this.checkSlider(),document.addEventListener("theme:resize:width",this.checkSliderOnResize),this.productSlider.forEach(slider2=>{slider2.addEventListener("theme:slider:resize",this.resizeSliderEvent)})}onUnload(){if(this.flkty)for(const key in this.flkty)this.flkty.hasOwnProperty(key)&&this.flkty[key].destroy();document.removeEventListener("theme:resize:width",this.checkSliderOnResize),this.productSlider.forEach(slider2=>{slider2.removeEventListener("theme:slider:resize",this.resizeSliderEvent)})}}register("custom-content",[{onLoad(){sections$i[this.id]=new CustomContent(this.container)},onUnload(e){sections$i[this.id].onUnload(e)}},newsletterSection,videoPlay,videoBackground,productGrid]);const selectors$n={slider:"[data-slider]",sliderItem:"[data-slide]",productGridItemImage:"[data-product-media-container]",links:"a, button",flickityButton:".flickity-button",promo:"[data-promo]"},classes$g={carousel:"carousel",carouselInactive:"carousel--inactive",isLastSlideVisible:"is-last-slide-visible",featuredCollection:"featured-collection",promoFullWidth:"collection-promo--full",promoTwoItemsWidth:"collection-promo--two-columns"}
21,attributes$f={sliderId:"data-slider-id",showImage:"data-slider-show-image",tabIndex:"tabindex"},sections$h={};class GridSlider{constructor(container){this.container=container,this.columns=parseInt(this.container.dataset.columns),this.sliders=this.container.querySelectorAll(selectors$n.slider),this.checkSlidesSizeOnResize=()=>this.checkSlidesSize(),this.resetSliderEvent=e=>this.resetSlider(e),this.resizeSliderEvent=event=>this.resizeSlider(event),this.flkty=[],this.listen(),this.handleLastSlideOverlayOnMobile()}initSlider(slider2){const sliderId=slider2.getAttribute(attributes$f.sliderId);slider2.classList.remove(classes$g.carouselInactive),this.flkty[sliderId]===void 0||!this.flkty[sliderId].isActive?(this.flkty[sliderId]=new Flickity(slider2,{pageDots:!1,cellSelector:selectors$n.sliderItem,cellAlign:"left",groupCells:!0,contain:!0,wrapAround:!1,adaptiveHeight:!1,on:{ready:()=>{this.setSliderArrowsPosition(slider2),setTimeout(()=>{this.changeTabIndex(slider2)},0)},change:()=>{this.changeTabIndex(slider2)}}}),this.handleLastSlideOverlayOnTablet(slider2)):this.setSliderArrowsPosition(slider2)}destroySlider(slider2){const sliderId=slider2.getAttribute(attributes$f.sliderId);slider2.classList.contains(classes$g.carousel)&&slider2.classList.add(classes$g.carouselInactive),typeof this.flkty[sliderId]=="object"&&this.flkty[sliderId].destroy()}resetSlider(e){const slider2=e.target,sliderId=slider2.getAttribute(attributes$f.sliderId);typeof this.flkty[sliderId]=="object"?this.flkty[sliderId].select(0,!1,!0):slider2.scrollTo({left:0,behavior:"instant"})}resizeSlider(event){const slider2=event.target,flkty=Flickity.data(slider2)||null;flkty&&flkty.resize()}
21checkSlidesSize(){this.sliders.length&&this.sliders.forEach(slider2=>{const columns=this.columns,isDesktop=window.innerWidth>=theme.sizes.large,isTablet=window.innerWidth>=theme.sizes.small&&window.innerWidth<theme.sizes.large;let itemsCount=slider2.querySelectorAll(selectors$n.sliderItem).length;const promos=slider2.querySelectorAll(selectors$n.promo);promos.length&&isDesktop&&promos.forEach(promo=>{promo.classList.contains(classes$g.promoFullWidth)?itemsCount+=columns-1:promo.classList.contains(classes$g.promoTwoItemsWidth)&&(itemsCount+=1)}),slider2.hasAttribute(attributes$f.showImage)&&(itemsCount+=1),isDesktop&&itemsCount>columns||isTablet&&itemsCount>2?this.initSlider(slider2):this.destroySlider(slider2)})}changeTabIndex(slider2){const sliderId=slider2.getAttribute(attributes$f.sliderId),selectedElementsIndex=this.flkty[sliderId].selectedIndex;this.flkty[sliderId].slides.forEach((slide,index)=>{slide.cells.forEach(cell=>{cell.element.querySelectorAll(selectors$n.links).forEach(link=>{link.setAttribute(attributes$f.tabIndex,selectedElementsIndex===index?"0":"-1")})})})}setSliderArrowsPosition(slider2){const arrows=slider2.querySelectorAll(selectors$n.flickityButton),image=slider2.querySelector(selectors$n.productGridItemImage);arrows.length&&image&&arrows.forEach(arrow=>{arrow.style.top=`${image.offsetHeight/2}px`})}handleLastSlideOverlayOnTablet(slider2){const sliderId=slider2.getAttribute(attributes$f.sliderId);this.flkty[sliderId].on("select",()=>{if(!(window.innerWidth>=theme.sizes.small&&window.innerWidth<theme.sizes.large))return;const selectedIndex=this.flkty[sliderId].selectedIndex,isLastSliderGroup=this.flkty[sliderId].slides.length-1===selectedIndex;slider2.parentNode.classList.toggle(classes$g.isLastSlideVisible,isLastSliderGroup)})}
21handleLastSlideOverlayOnMobile(){this.sliders.forEach(slider2=>{slider2.addEventListener("scroll",event=>{if(!(window.innerWidth<theme.sizes.small))return;const offsetWidth=event.target.offsetWidth,isLastSlideVisible=Array.from(slider2.children).pop().getBoundingClientRect().left+80<offsetWidth;slider2.parentNode.classList.toggle(classes$g.isLastSlideVisible,isLastSlideVisible)})})}listen(){this.sliders.length&&(this.checkSlidesSize(),document.addEventListener("theme:resize:width",this.checkSlidesSizeOnResize),this.sliders.forEach(slider2=>{slider2.addEventListener("theme:tab:change",this.resetSliderEvent),slider2.addEventListener("theme:slider:resize",this.resizeSliderEvent)}))}onBlockSelect(evt){const slider2=evt.target.closest(selectors$n.slider),flkty=Flickity.data(slider2)||null;if(!slider2)return;let parent=evt.target.parentNode,target=evt.target;if(this.container.classList.contains(classes$g.featuredCollection)&&(parent=parent.parentNode,target=target.parentNode),flkty!==null&&flkty.isActive){const index=parseInt([...parent.children].indexOf(target)),slidesPerPage=parseInt(flkty.slides[0].cells.length),groupIndex=Math.floor(index/slidesPerPage);flkty.select(groupIndex)}else{const sliderStyle=slider2.currentStyle||window.getComputedStyle(slider2),sliderPadding=parseInt(sliderStyle.paddingLeft),blockPositionLeft=target.offsetLeft-sliderPadding;slider2.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}onUnload(){if(this.flkty)for(const key in this.flkty)this.flkty.hasOwnProperty(key)&&this.flkty[key].destroy();document.removeEventListener("theme:resize:width",this.checkSlidesSizeOnResize),this.sliders.length&&this.sliders.forEach(sli
21der2=>{slider2.removeEventListener("theme:tab:change",this.resetSliderEvent),slider2.removeEventListener("theme:slider:resize",this.resizeSliderEvent)})}}const gridSlider={onLoad(){sections$h[this.id]=[],this.container.querySelectorAll(selectors$n.slider).forEach(el=>{sections$h[this.id].push(new GridSlider(this.container))})},onUnload(){sections$h[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})},onBlockSelect(e){sections$h[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})}};register("featured-collection",[productGrid,tooltip,gridSlider]),register("caffeine-discovery",[productGrid,tooltip]),register("featured-video",[videoPlay,videoBackground]);const selectors$m={shopPayWrapper:"[data-shop-pay-wrapper]",shopLoginButton:"shop-login-button",shopFollowButton:"shop-follow-button",followOnShopButton:"follow-on-shop-button",heartIcon:"heart-icon",shopLogo:"shop-logo"},sections$g={};class ShopPayLink{constructor(container){this.container=container,this.shopPayWrapper=document.querySelector(selectors$m.shopPayWrapper),this.shopLoginButton=document.querySelector(selectors$m.shopLoginButton),this.init()}init(){if(!this.shopLoginButton||!this.shopPayWrapper)return;const bgColor=this.shopPayWrapper.dataset.bg||"transparent",textColor=this.shopPayWrapper.dataset.text||"#fff",hoverColor=this.shopPayWrapper.dataset.hover||"#fff";this.mainButtonStyles=` 22 :host { 23 --bg-color: ${bgColor}; 24 --text-color: ${textColor}; 25 --hover-color: ${hoverColor}; 26 } 27 28 .follow-icon-wrapper:before { 29 background: var(--bg-color); 30 border-color: var(--text-color); 31 transition: border 0.3s ease; 32 } 33 34 .button:not(.button--following):focus-visible .follow-icon-wrapper:before, 35 .button:not(.button--following):hover .follow-icon-wrapper:before { 36 background: var(--bg-color); 37 border-color: var(--hover-color); 38 } 39 40 .button { 41 background: transparent; 42 color: var(--text-color); 43 } 44 45 .following-text { 46 color: var(--text-color); 47 } 48 49 .button--following:focus-visible, 50 .button--following:hover { 51 background: var(--bg-color); 52 } 53 54 .button:not(.button--following):focus-visible .follow-icon-wrapper:before, 55 .button:not(.button--following):hover .follow-icon-wrapper:before { 56 background: var(--bg-color); 57 border-color: var(--hover-color); 58 } 59 `,this.svgIconsStyles=` 60 :host { 61 color: ${textColor}; 62 } 63 `,customElements.whenDefined(selectors$m.shopLoginButton).then(res=>{requestAnimationFrame(()=>{const shadowRoot3=this.shopLoginButton.shadowRoot?.querySelector(selectors$m.shopFollowButton)?.shadowRoot?.querySelector(selectors$m.followOnShopButton)?.shadowRoot;shadowRoot3&&this.overwriteStyles(shadowRoot3.host.shadowRoot,this.mainButtonStyles);const shadowRoot4=shadowRoot3.querySelector(selectors$m.heartIcon)?.shadowRoot,shadowRoot5=shadowRoot3.querySelector(selectors$m.shopLogo)?.shadowRoot;shadowRoot4&&this.overwriteStyles(shadowRoot4.host.shadowRoot,this.svgIconsStyles),shadowRoot5&&this.overwriteStyles(shadowRoot5.host.shadowRoot,this.svgIconsStyles)})})}overwriteStyles(element,styles){let style=document.createElement("style");style.innerHTML=styles,element.appendChild(style)}}const shopPayLink={onLoad(){sections$g[this.id]=new ShopPayLink(this.container)}},selectors$l={trigger:"[data-collapsible-trigger-mobile]"},classes$f={isExpanded:"is-expanded"};register("footer",[popoutSection,newsletterSection,collapsible,{onBlockSelect(e){const trigger=e.target.querySelector(selectors$l.trigger);requestAnimationFrame(()=>{trigger&&!trigger.classList.contains(classes$f.isExpanded)&&trigger.dispatchEvent(new Event("click"))})},onBlockDeselect(e){const trigger=e.target.querySelector(selectors$l.trigger);requestAnimationFrame(()=>{trigger&&trigger.classList.contains(classes$f.isExpanded)&&trigger.dispatchEvent(new Event("click"))})}},shopPayLink]);const selectors$k={disclosureWrappper:"[data-hover-disclosure]",header:"[data-site-header]",link:"[data-top-link]",headerBackgroun
63d:"[data-header-background]",navItem:"[data-nav-item]"},classes$e={isVisible:"is-visible",grandparent:"grandparent",headerMenuOpened:"site-header--menu-opened",hasScrolled:"has-scrolled",headerHovered:"site-header--hovered",searchOpened:"search-opened"},attributes$e={disclosureToggle:"data-hover-disclosure-toggle",ariaHasPopup:"aria-haspopup",ariaControls:"aria-controls"};let sections$f={};class HoverDisclosure{constructor(el){this.disclosure=el,this.header=el.closest(selectors$k.header),this.key=this.disclosure.id,this.trigger=document.querySelector(`[${attributes$e.disclosureToggle}='${this.key}']`),this.link=this.trigger.querySelector(selectors$k.link),this.grandparent=this.trigger.classList.contains(classes$e.grandparent),this.background=document.querySelector(selectors$k.headerBackground),this.trigger.setAttribute(attributes$e.ariaHasPopup,!0),this.trigger.setAttribute(attributes$e.ariaExpanded,!1),this.trigger.setAttribute(attributes$e.ariaControls,this.key),this.dropdown=this.trigger.querySelector(selectors$k.disclosureWrappper),this.connectHoverToggle(),this.handleTablets()}showDisclosure(){this.hasScrolled=document.body.classList.contains(classes$e.hasScrolled),this.headerHeight=this.hasScrolled?window.stickyHeaderHeight:this.header.offsetHeight,this.grandparent?(this.dropdown.style.height="auto",this.dropdownHeight=this.dropdown.offsetHeight+this.headerHeight):this.dropdownHeight=this.headerHeight,this.background.style.setProperty("--header-background-height",`${this.dropdownHeight}px`),this.trigger.setAttribute(attributes$e.ariaExpanded,!0),this.trigger.classList.add(classes$e.isVisible),this.header.classList.add(classes$e.headerMenuOpened),this.trigger.classList.contains(classes$e.grandparent)&&document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.header})),this.updateHeaderHover()}hideDisclosure(){this.background.style.removeProperty("--header-background-height"),this.trigger.classList.remove(classes$e.isVisible),this.trigger.setAttribute(attributes$e.ariaExpanded,!1),this.header.classList.remove(classes$e.headerMenuOpened),document.body.classList.contains(classes$e.searchOpened)||document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}updateHeaderHover(){requestAnimationFrame(()=>{const isHovered=this.header.matches(":hover"),hasHoveredClass=this.header.classList.contains(classes$e.headerHovered);isHovered&&!hasHoveredClass&&this.header.classList.add(classes$e.headerHovered)})}handleTablets(){this.trigger.addEventListener("touchstart",e=>{if(!this.trigger.classList.contains(classes$e.isVisible)){e.preventDefault();const activeNavItems=this.header.querySelectorAll(`.${classes$e.isVisible}${selectors$k.navItem}`);if(activeNavItems.length>0){activeNavItems.forEach(item=>{if(item!==this.trigger){item.dispatchEvent(new Event("mouseleave",{bubbles:!0}));const onTransitionEnd=()=>{requestAnimationFrame(()=>{this.showDisclosure()}),item.removeEventListener("transitionend",onTransitionEnd)};item.addEventListener("transitionend",onTransitionEnd)}});return}this.showDisclosure()}})}connectHoverToggle(){this.trigger.addEventListener("mouseenter",()=>this.showDisclosure()),this.link.addEventListener("focus",()=>this.showDisclosure()),this.trigger.addEventListener("mouseleave",()=>this.hideDisclosure()),this.trigger.addEventListener("focusout",event=>{this.trigger.contains(event.relatedTarget)||this.hideDisclosure()}),this.disclosure.addEventListener("keyup",event=>{event.code===theme.keyboardKeys.ESCAPE&&this.hideDisclosure()})}onBlockSelect(event){this.disclosure.contains(event.target)&&this.showDisclosure(event)}onBlockDeselect(event){this.disclosure.contains(event.target)&&this.hideDisclosure()}}const hoverDisclosure={onLoad(){sections$f[this.id]=[],this.container.querySelectorAll(selectors$k.disclosureWrappper).forEach(el=>{sections$f[this.id].push(new HoverDisclosure(el))})},onBlockSelect(evt){sections$f[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$f[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})}},selectors$j={header:"[data-site-header]",announcementBar:"[data-announcement-wrapper]",collectionFilters:"[data-collection-filters]",logo:"[data-logo]",logoTextLink:"[data-logo-text-link]",mobileNavDropdownTrigger:"[data-collapsible-trigger]",navDrawer:"#nav-drawer",drawer:"[data-drawer]",drawerToggle:"[data-drawer-toggle]",popdownToggle:"[data-popdown-toggle]",mobileMenu:"[data-mobile-menu]",nav:"[data-nav]",navIcons:"[data-nav-icons]",navItem:"[data-nav-item]",navLinkMobile:"[data-nav-link-mobile]",navSearchOpen:"[data-nav-search-open]",wrapper:"[data-wrapper]",headerBackgroun
63d:"[data-header-background]",cartPage:"[data-cart-page]",widthContent:"[data-takes-space]"},classes$d={jsDrawerOpenAll:["js-drawer-open","js-drawer-open-cart","js-quick-view-visible","js-quick-view-from-cart"],headerTransparent:"site-header--transparent",headerLoading:"site-header--loading",headerHovered:"site-header--hovered",headerMenuOpened:"site-header--menu-opened",hasScrolled:"has-scrolled",hideHeader:"hide-header",navCompress:"nav--compress",logoCompress:"logo--compress",isVisible:"is-visible",isOpen:"is-open",searchOpened:"search-opened",noOutline:"no-outline",cloneClass:"js__header__clone"},attributes$d={navAlignment:"data-nav-alignment"},sections$e={};class Header{constructor(container){this.container=container,this.background=document.querySelector(selectors$j.headerBackground),this.header=container,this.headerSection=container.parentNode,this.headerWrapper=container.querySelector(selectors$j.wrapper),this.logo=container.querySelector(selectors$j.logo),this.logoTextLink=container.querySelector(selectors$j.logoTextLink),this.nav=container.querySelector(selectors$j.nav),this.navIcons=container.querySelector(selectors$j.navIcons),this.headerStateEvent=event=>this.headerState(event),this.handleTouchstartEvent=event=>
63this.handleTouchstart(event),this.updateBackgroundHeightEvent=event=>this.updateBackgroundHeight(event),initTransparentHeader(),this.minWidth=this.getMinWidth(),this.checkWidthEvent=()=>this.checkWidth(),this.listenWidth(),this.initMobileNav(),this.handleTextLinkLogos(),this.initStickyHeader(),this.handleBackgroundEvents(),document.querySelector(selectors$j.cartPage)||(window.cart=new CartDrawer),document.body.addEventListener("touchstart",this.handleTouchstartEvent,{passive:!0}),this.updateHeaderHover()}updateHeaderHover(){requestAnimationFrame(()=>{const isHovered=this.header.matches(":hover"),hasHoveredClass=this.header.classList.contains(classes$d.headerHovered);isHovered&&!hasHoveredClass&&this.header.classList.add(classes$d.headerHovered)})}handleTouchstart(event){const isInHeader=this.header.contains(event.target),activeNavItem=this.header.querySelector(`.${classes$d.isVisible}${selectors$j.navItem}`);!isInHeader&&activeNavItem&&activeNavItem.dispatchEvent(new Event("mouseleave",{bubbles:!0}))}handleTextLinkLogos(){if(this.logoTextLink===null)return;const headerHeight=this.header.offsetHeight;document.documentElement.style.setProperty("--header-height",`${headerHeight}px`),document.documentElement.style.setProperty("--header-sticky-height",`${headerHeight}px`)}initStickyHeader(){if(this.hasScrolled=!1,this.hasCollectionFilters=document.querySelector(selectors$j.collectionFilters),this.position=this.header.dataset.position,this.position==="fixed"&&!this.hasCollectionFilters){this.header.classList.remove(classes$d.headerLoading),this.headerState(),document.addEventListener("theme:scroll",this.headerStateEvent);return}document.body.classList.remove(classes$d.hasScrolled),window.isHeaderTransparent&&this.header.classList.add(classes$d.headerTransparent),this.header.classList.remove(classes$d.headerLoading)}headerState(event){const headerHeight=parseInt(this.header.dataset.height||this.header.offsetHeight),announcementBar=document.querySelector(selectors$j.announcementBar),announcementHeight=announcementBar?announcementBar.offsetHeight:0,pageOffset=headerHeight+announcementHeight,currentScrollTop=window.pageYOffset||document.documentElement.scrollTop,scrollUp=event&&event.detail&&event.detail.up;this.hasScrolled=currentScrollTop>pageOffset,document.body.classList.toggle(classes$d.hasScrolled,this.hasScrolled);const hideHeaderThreshold=pageOffset+window.stickyHeaderHeight,shouldHideHeader=currentScrollTop<hideHeaderThreshold&&scrollUp;if(document.body.classList.toggle(classes$d.hideHeader,shouldHideHeader),window.isHeaderTransparent){const shouldShowTransparentHeader=!this.hasScrolled||shouldHideHeader;this.header.classList.toggle(classes$d.headerTransparent,shouldShowTransparentHeader)}if(this.header.classList.contains(classes$d.headerHovered)){const currentHeight=this.hasScrolled?window.stickyHeaderHeight:headerHeight;this.background.style.setProperty("--header-background-height",`${currentHeight}px`);const activeNavItem=this.header.querySelector(`.${classes$d.isVisible}${selectors$j.navItem}`);activeNavItem&&activeNavItem.dispatchEvent(new Event("mouseenter",{bubbles:!0}))}}handleBackgroundEvents(){this.headerWrapper.addEventListener("mouseenter",this.updateBackgroun
63dHeightEvent),this.headerWrapper.addEventListener("mouseleave",this.updateBackgroundHeightEvent),this.header.addEventListener("focusout",this.updateBackgroundHeightEvent),document.addEventListener("theme:cart:close",this.updateBackgroundHeightEvent),document.addEventListener("theme:search:close",this.updateBackgroundHeightEvent)}updateBackgroundHeight(event){const isDesktop=matchMedia("(pointer:fine)").matches,isFocusEnabled=!document.body.classList.contains(classes$d.noOutline),isNotTabbingOnDesktop=isDesktop&&!isFocusEnabled;if(!event)return;let drawersVisible=classes$d.jsDrawerOpenAll.some(popupClass=>document.body.classList.contains(popupClass));(event.type==="mouseenter"||drawersVisible)&&(this.headerHeight=this.hasScrolled?window.stickyHeaderHeight:this.header.offsetHeight,this.header.classList.add(classes$d.headerHovered),this.header.classList.contains(classes$d.headerMenuOpened)||this.background.style.setProperty("--header-background-height",`${this.headerHeight}px`)),event.type!=="mouseenter"&&requestAnimationFrame(()=>{if(drawersVisible=classes$d.jsDrawerOpenAll.some(popupClass=>document.body.classList.contains(popupClass)),drawersVisible||event.type==="focusout"&&!isDesktop||event.type==="theme:search:close"&&!isNotTabbingOnDesktop||this.hasScrolled)return;const focusOutOfHeader=document.activeElement.closest(selectors$j.header)===null,isSearchOpened=document.body.classList.contains(classes$d.searchOpened),headerMenuOpened=this.header.classList.contains(classes$d.headerMenuOpened);isSearchOpened||headerMenuOpened||event.type==="focusout"&&!focusOutOfHeader||(this.header.classList.remove(classes$d.headerHovered),this.background.style.setProperty("--header-background-height","0px"),isFocusEnabled||document.activeElement.blur())})}listenWidth(){document.addEventListener("theme:resize",this.checkWidthEvent),this.checkWidth()}checkWidth(){window.innerWidth<this.minWidth?(this.nav.classList.add(classes$d.navCompress),this.logo.classList.add(classes$d.logoCompress)):(this.nav.classList.remove(classes$d.navCompress),this.logo.classList.remove(classes$d.logoCompress))}getMinWidth(){const headerWrapperStyles=this.headerWrapper.currentStyle||window.getComputedStyle(this.headerWrapper),headerPaddings=parseInt(headerWrapperStyles.paddingLeft)*2,comparitor=this.header.cloneNode(!0);comparitor.classList.add(classes$d.cloneClass),document.body.appendChild(comparitor);const wideElements=comparitor.querySelectorAll(selectors$j.widthContent),navAlignment=this.header.getAttribute(attributes$d.navAlignment),minWidth=_sumSplitWidths(wideElements,navAlignment);return document.body.removeChild(comparitor),minWidth+wideElements.length*20+headerPaddings}initMobileNav(){if(this.mobileMenu=this.headerSection.querySelector(selectors$j.mobileMenu),this.navDrawer=this.headerSection.querySelector(selectors$j.navDrawer),this.drawerToggle=this.navDrawer.querySelector(selectors$j.drawerToggle),this.navSearchOpen=this.navDrawer.querySelectorAll(selectors$j.navSearchOpen),this.navSearchOpen?.forEach(element=>{element.addEventListener("click",event=>{event.preventDefault();const drawer2=this.drawerToggle.closest(`${selectors$j.drawer}.${classes$d.isOpen}`),popdownToggle=matchMedia("(pointer:coarse)").matches?this.mobileMenu.querySelector(selectors$j.popdownToggle):this.nav.querySelector(selectors$j.popdownToggle);this.drawerToggle.dispatchEvent(new Event("click",{bubbles:!0}));const onDrawerTransitionEnd=e=>{e.target===drawer2&&(requestAnimationFrame(()=>popdownToggle.dispatchEvent(new Event("click",{bubbles:!0}))),drawer2.removeEventListener("transitionend",onDrawerTransitionEnd))};drawer2.addEventListener("transitionend",onDrawerTransitionEnd)})}),theme.settings.mobileMenuBehaviour==="link")return;const navMobileLinks=this.headerSection.querySelectorAll(selectors$j.navLinkMobile);navMobileLinks.length&&navMobileLinks.forEach(link=>{link.addEventListener("click",e=>{const hasDropdown=link.parentNode.querySelectorAll(selectors$j.mobileNavDropdownTrigger).length,dropdownTrigger=link.nextElementSibling;hasDropdown&&(e.preventDefault(),dropdownTrigger.dispatchEvent(new Event("click"),{bubbles:!0}))})})}onUnload(){document.documentElement.style.removeProperty("--header-height"),document.documentElement.style.removeProperty("--header-sticky-height"),this.initStickyHeader(),document.body.classList.remove(...classes$d.jsDrawerOpenAll),document.removeEventListener("theme:scroll",this.headerStateEvent),document.removeEventListener("theme:resize",this.checkWidthEvent),document.removeEventListener("theme:cart:close",this.updateBackgroun
63dHeightEvent),document.removeEventListener("theme:search:close",this.updateBackgroundHeightEvent),document.body.removeEventListener("touchstart",this.handleTouchstartEvent),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),typeof window.cart.unload=="function"&&window.cart.unload()}}function _sumSplitWidths(nodes,alignment){let arr=[];nodes.forEach(el=>{arr.push(el.clientWidth)});let[logoWidth,navWidth,iconsWidth]=arr;if(alignment==="left"){const tempWidth=logoWidth;logoWidth=navWidth,navWidth=tempWidth}return alignment!=="right"&&(logoWidth>iconsWidth?iconsWidth=logoWidth:logoWidth=iconsWidth),logoWidth+navWidth+iconsWidth}register("header",[{onLoad(){sections$e[this.id]=new Header(this.container)},onUnload(){sections$e[this.id].onUnload()}},hoverDisclosure,drawer]);const selectors$i={slider:"[data-slider]"};let sections$d={};class IconsRow{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$i.slider)}onBlockSelect(evt){const sliderStyle=this.slider.currentStyle||window.getComputedStyle(this.slider),sliderPadding=parseInt(sliderStyle.paddingLeft),blockPositionLeft=evt.target.offsetLeft-sliderPadding;this.slider.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}register("icons-row",{onLoad(){sections$d[this.id]=new IconsRow(this)},onBlockSelect(e){sections$d[this.id].onBlockSelect(e)}});const selectors$h={item:"[data-accordion-item]",button:"[data-accordion-button]"},classes$c={isExpanded:"is-expanded"},sections$c={};class ImageAccordions{constructor(section){this.container=section.container,this.imageAccordionsItems=this.container.querySelectorAll(selectors$h.item),this.buttons=this.container.querySelectorAll(selectors$h.button),this.accordionExpandEvent=item=>this.accordionExpand(item),this.accordionFocusEvent=item=>this.accordionFocus(item),this.init()}init(){this.imageAccordionsItems.forEach(item=>{item.addEventListener("mouseenter",this.accordionExpandEvent.bind(this,item))}),this.buttons.forEach(button=>{button.addEventListener("focusin",this.accordionFocusEvent.bind(this,button))})}accordionExpand(item){item.classList.contains(classes$c.isExpanded)||(this.imageAccordionsItems.forEach(item2=>{item2.classList.remove(classes$c.isExpanded)}),item.classList.add(classes$c.isExpanded))}accordionFocus(button){button.closest(selectors$h.item).dispatchEvent(new Event("mouseenter"))}onBlockSelect(evt){const element=evt.target;element&&element.dispatchEvent(new Event("mouseenter"))}}register("image-accordions",{onLoad(){sections$c[this.id]=new ImageAccordions(this)},onBlockSelect(evt){sections$c[this.id].onBlockSelect(evt)}}),register("image-with-text",videoPlay),register("list-collections",gridSlider);const sections$b={},selectors$g={slider:"[data-slider-gallery]",sliderNav:"[data-slider-info]",item:"[data-slide-item]"};class Locations{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$g.slider),this.sliderNav=this.container.querySelector(selectors$g.sliderNav),this.initSlider()}initSlider(){const slidesCount=this.container.querySelectorAll(selectors$g.item).length;let flkty=Flickity.data(this.slider)||null,flktyNav=Flickity.data(this.sliderNav)||null;slidesCount<=1||(flkty=new Flickity(this.slider,{fade:!0,wrapAround:!0,adaptiveHeight:!0,prevNextButtons:!1,pageDots:!1}),flickitySmoothScrolling(this.slider),flktyNav=new Flickity(this.sliderNav,{fade:!0,wrapAround:!0,imagesLoaded:!0,lazyLoad:!0,asNavFor:this.slider,prevNextButtons:!0,pageDots:!1}),flktyNav.on("change",()=>{flkty.selectCell(flktyNav.selectedIndex)}),flkty.on("change",()=>{flktyNav.selectCell(flkty.selectedIndex)}))}onBlockSelect(evt){const flkty=Flickity.data(this.slider)||null,flktyNav=Flickity.data(this.sliderNav)||null,index=parseInt([...evt.target.parentNode.children].indexOf(evt.target));flkty!==null&&flkty.select(index),flktyNav!==null&&flktyNav.select(index)}}register("locations",{onLoad(){sections$b[this.id]=new Locations(this)},onBlockSelect(e){sections$b[this.id].onBlockSelect(e)}});const sections$a={}
63,selectors$f={slider:"[data-slider]",sliderItem:"[data-slide-item]",pointer:"[data-pointer]",productGridItemImage:"[data-product-media-container]",quickViewItemHolder:"[data-quick-view-item-holder]",flickityButton:".flickity-button",links:"a, button",tooltip:"[data-tooltip]"},attributes$c={pointer:"data-pointer",hotspot:"data-hotspot",tabIndex:"tabindex"},classes$b={productGridItemImageHover:"product-grid-item__image--hovered",pointerSelected:"pointer--selected",isSelected:"is-selected",isActive:"is-active",popupOpen:"pswp--open"};class Look{constructor(container){this.container=container,this.slider=this.container.querySelector(selectors$f.slider),this.slides=this.container.querySelectorAll(selectors$f.sliderItem),this.pointers=this.container.querySelectorAll(selectors$f.pointer),this.flkty=null,this.observer=null,this.checkSlidesSizeOnResize=()=>this.checkSlidesSize(),this.resizeSliderEvent=event=>this.resizeSlider(event),this.pointersInit=event=>this.dotPointers(event),this.pointersOver=event=>this.dotPointerIn(event),this.pointersOut=event=>this.dotPointerOut(event),this.debouncedBlockSelectCallback=debounce(event=>this.debouncedBlockSelect(event),500),this.quickViewPopup=new QuickViewPopup(this.container),this.listen()}listen(){this.slider&&(this.checkSlidesSize(),document.addEventListener("theme:resize:width",this.checkSlidesSizeOnResize),this.slider.addEventListener("theme:slider:resize",this.resizeSliderEvent)),this.pointers.length>0&&this.pointers.forEach(pointer=>{pointer.addEventListener("click",this.pointersInit),pointer.addEventListener("mouseover",this.pointersOver),pointer.addEventListener("mouseleave",this.pointersOut)})}checkSlidesSize(){const isDesktop=window.innerWidth>=theme.sizes.small;if(this.initTooltips(),isDesktop){this.slides.length>2?this.initSlider():(this.destroySlider(),this.slidesTabIndex());return}if(!isDesktop&&this.slides.length>1){this.initSlider();return}this.destroySlider()}initTooltips(){this.tooltips=this.container.querySelectorAll(selectors$f.tooltip),this.tooltips.forEach(tooltip2=>{new Tooltip(tooltip2)})}initSlider(){if(this.flkty===null){this.flkty=new Flickity(this.slider,{prevNextButtons:!0,wrapAround:!0,adaptiveHeight:!1,cellAlign:"left",groupCells:!1,contain:!0,on:{ready:()=>{this.slidesTabIndex(),this.setSliderArrowsPosition(),this.dotPointers()},change:()=>{this.slidesTabIndex(),this.dotPointers()}}});return}this.setSliderArrowsPosition()}setSliderArrowsPosition(){if(!(window.innerWidth>=theme.sizes.small))return;const arrows=this.slider.querySelectorAll(selectors$f.flickityButton),image=this.slider.querySelector(selectors$f.productGridItemImage);arrows.length&&image&&arrows.forEach(arrow=>{arrow.style.top=`${image.offsetHeight/2}px`})}slidesTabIndex(){if(this.slides.length<3){this.slider.querySelectorAll(selectors$f.links).forEac
63h(link=>{link.setAttribute(attributes$c.tabIndex,"0")});return}Flickity.data(this.slider).cells.forEach(slide=>{let tabIndex="-1";slide.element.classList.contains(classes$b.isSelected)&&(tabIndex="0"),slide.element.querySelectorAll(selectors$f.links).forEach(link=>{link.setAttribute(attributes$c.tabIndex,tabIndex)})})}destroySlider(){typeof this.flkty=="object"&&this.flkty!==null&&(this.flkty.destroy(),this.flkty=null)}resizeSlider(event){const slider2=event.target,flkty=Flickity.data(slider2)||null;flkty&&flkty.resize()}dotPointers(event){if(this.pointers.length===0)return;if(this.pointers.forEach(button=>{button.classList.remove(classes$b.pointerSelected)}),event){const dotIndex=event.target.getAttribute(attributes$c.pointer);this.flkty?.select(dotIndex);return}const slideIndex=this.flkty==null?0:this.flkty.selectedIndex;slideIndex>=0&&this.pointers[slideIndex].classList.add(classes$b.pointerSelected)}dotPointerIn(event){const dotIndex=event.target.getAttribute(attributes$c.pointer),image=this.slides[dotIndex].querySelector(selectors$f.productGridItemImage),isTouch2=matchMedia("(pointer:coarse)").matches;!(window.innerWidth<theme.sizes.small)&&!isTouch2&&this.observeImage(image),this.pointers.forEach(pointer=>{pointer.style.setProperty("--look-animation","none")})}dotPointerOut(event){const dotIndex=event.target.getAttribute(attributes$c.pointer),image=this.slides[dotIndex].querySelector(selectors$f.productGridItemImage);image.classList.remove(classes$b.productGridItemImageHover),image.dispatchEvent(new Event("mouseleave")),this.observer&&this.observer.disconnect(),this.pointers.forEach(pointer=>{pointer.style.removeProperty("--look-animation")})}observeImage(image){this.observer=new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{const target=entry.target;entry.intersectionRatio==0||(target.dispatchEvent(new Event("mouseenter")),target.classList.add(classes$b.productGridItemImageHover))})},{root:this.slider,threshold:[.95,1]}),this.observer.observe(image)}triggerClick(target){requestAnimationFrame(()=>target.dispatchEvent(new Event("click")))}destroyQuickViewPopup(){const pswpElement=this.quickViewPopup?.loadPhotoswipe?.pswpElement;pswpElement&&pswpElement.classList.contains(classes$b.popupOpen)&&this.quickViewPopup.loadPhotoswipe.popup.close()}onBlockSelect(event){this.debouncedBlockSelectCallback(event)}debouncedBlockSelect(event){const pswpElement=this.quickViewPopup?.loadPhotoswipe?.pswpElement;if(!pswpElement){setTimeout(()=>this.triggerClick(event.target),400);return}setTimeout(()=>{if(pswpElement.classList.contains(classes$b.popupOpen)){const holder=this.quickViewPopup.loadPhotoswipe.pswpElement.querySelector(`[${attributes$c.hotspot}="${event.target.getAttribute(attributes$c.hotspot)}"]`),quickViewItemHolders=this.quickViewPopup.loadPhotoswipe.pswpElement.querySelectorAll(selectors$f.quickViewItemHolder);holder.classList.add(classes$b.isActive),quickViewItemHolders.forEach(element=>{element!==holder&&element.classList.remove(classes$b.isActive)})}else this.triggerClick(event.target)})}onUnload(){this.destroyQuickViewPopup(),document.removeEventListener("theme:resize:width",this.checkSlidesSizeOnResize),this.slider&&this.slider.removeEventListener("theme:slider:resize",this.resizeSliderEvent)}onDeselect(){this.destroyQuickViewPopup()}}register("look",[{onLoad(){sections$a[this.id]=new Look(this.container)},onUnload(){sections$a[this.id].onUnload()},onBlockSelect(event){sections$a[this.id].onBlockSelect(event)},onDeselect(){sections$a[this.id].onDeselect()}}]);const selectors$e={grid:"[data-grid]"};register("mosaic",{onBlockSelect(e){const grid=e.target.closest(selectors$e.grid),wrapperStyle=grid.currentStyle||window.getComputedStyle(grid),wrapperPadding=parseInt(wrapperStyle.paddingLeft),blockPositionLeft=e.target.offsetLeft-wrapperPadding;grid.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}),register("newsletter",newsletterSection),register("overlapping-images",videoPlay);const selectors$d={toggleAdmin:"[data-toggle-admin]",toggleNewsletter:"[data-toggle-newsletter]",adminForm:"[data-form-admin]",newsletterForm:"[data-form-newsletter]"};let sections$9={};class Password{constructor(section){this.container=section.container,this.toggleAdmin=this.container.querySelector(selectors$d.toggleAdmin),this.toggleNewsletter=this.container.querySelector(selectors$d.toggleNewsletter),this.adminForm=this.container.querySelector(selectors$d.adminForm),this.newsletterForm=this.container.querySelector(selectors$d.newsletterForm),this.adminErrors=this.adminForm.querySelector(".errors"),this.newsletterErrors=this.newsletterForm.querySelector(".errors"),this.init()}init(){this.toggleAdmin.addEventListener("click",e=>{e.preventDefault(),this.showPasswordForm()}),this.toggleNewsletter.addEventListener("click",e=>{e.preventDefault(),this.hidePasswordForm()}),window.location.hash=="#login"||this.adminErrors?this.showPasswordForm():this.hidePasswordForm()}
63showPasswordForm(){showElement(this.adminForm),hideElement(this.newsletterForm),window.location.hash="#login"}hidePasswordForm(){showElement(this.newsletterForm),hideElement(this.adminForm),window.location.hash=""}}register("password-template",{onLoad(){sections$9[this.id]=new Password(this)}});const selectors$c={largePromo:"[data-large-promo]",largePromoInner:"[data-large-promo-inner]",tracking:"[data-tracking-consent]",trackingInner:"[data-tracking-consent-inner]",trackingAccept:"[data-confirm-cookies]",popupBar:"[data-popup-bar]",popupBarHolder:"[data-popup-bar-holder]",popupBarToggle:"[data-popup-bar-toggle]",popupBody:"[data-popup-body]",popupClose:"[data-popup-close]",popupUnderlay:"[data-popup-underlay]",newsletterForm:"[data-newsletter-form]"},attributes$b={cookieName:"data-cookie-name",targetReferrer:"data-target-referrer",preventScrollLock:"data-prevent-scroll-lock"},classes$a={success:"has-success",error:"has-error",selected:"selected",hasBlockSelected:"has-block-selected",expanded:"popup--expanded",visible:"popup--visible",mobile:"mobile",desktop:"desktop",popupBar:"popup--bar",barIsVisible:"popup-bar-is-visible"};let sections$8={},scrollLockTimer=0,activePopups=0,popups=[];class DelayShow{constructor(popupContainer,popup){if(this.popupContainer=popupContainer,this.popup=popup,this.popupBody=popup.querySelector(selectors$c.popupBody),this.delay=popupContainer.dataset.popupDelay,this.isSubmitted=window.location.href.indexOf("accepts_marketing")!==-1||window.location.href.indexOf("customer_posted=true")!==-1,this.a11y=a11y,this.showPopupOnScrollEvent=()=>this.showPopupOnScroll(),(this.delay==="always"||this.isSubmitted)&&this.always(),this.delay&&this.delay.includes("delayed")&&!this.isSubmitted){const seconds=this.delay.includes("_")?parseInt(this.delay.split("_")[1]):10;this.delayed(seconds)}this.delay==="bottom"&&!this.isSubmitted&&this.bottom(),this.delay==="idle"&&!this.isSubmitted&&this.idle()}always(){this.showPopup()}delayed(seconds=10){setTimeout(()=>{this.showPopup()},seconds*1e3)}bottom(){document.addEventListener("theme:scroll",this.showPopupOnScrollEvent)}idle(){if(!(this.checkPopupTarget()===!0))return;let timer=0,idleTime=6e4;const documentEvents=["mousemove","mousedown","click","touchmove","touchstart","touchend","keydown","keypress"],windowEvents=["load","resize","scroll"],startTimer=()=>{timer=setTimeout(()=>{timer=0,this.showPopup()},idleTime),documentEvents.forEach(eventType=>{document.addEventListener(eventType,resetTimer)}),windowEvents.forEach(eventType=>{window.addEventListener(eventType,resetTimer)})},resetTimer=()=>{timer&&clearTimeout(timer),documentEvents.forEach(eventType=>{document.removeEventListener(eventType,resetTimer)}),windowEvents.forEach(eventType=>{window.removeEventListener(eventType,resetTimer)}),startTimer()};startTimer()}showPopup(){const popupElement={id:this.popup.id,body:this.popupBody};if(popups.push(popupElement),this.checkPopupTarget()===!0){if(activePopups+=1,this.popup.classList.add(classes$a.visible),this.popup.classList.contains(classes$a.popupBar)&&document.body.classList.add(classes$a.barIsVisible),this.a11y.trapFocus({container:this.popupBody}),this.popup.hasAttribute(attributes$b.preventScrollLock))return!1;this.scrollLock()}}checkPopupTarget(){const targetMobile=this.popup.parentNode.classList.contains(classes$a.mobile),targetDesktop=this.popup.parentNode.classList.contains(classes$a.desktop);return!(targetMobile&&window.innerWidth>=theme.sizes.small||targetDesktop&&window.innerWidth<theme.sizes.small)}scrollLock(){document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.popupBody}))}showPopupOnScroll(){window.scrollY+window.innerHeight>=document.body.clientHeight&&(this.showPopup(),document.removeEventListener("theme:scroll",this.showPopupOnScrollEvent))}onUnload(){document.removeEventListener("theme:scroll",this.showPopupOnScrollEvent)}}class TargetReferrer{constructor(el){if(this.popupContainer=el,this.locationPath=location.href,!this.popupContainer.hasAttribute(attributes$b.targetReferrer))return!1;this.locationPath.indexOf(this.popupContainer.getAttribute(attributes$b.targetReferrer))===-1&&!window.Shopify.designMode&&this.popupContainer.parentNode.removeChild(this.popupContainer)}}class LargePopup{constructor(el){this.popupContainer=el,this.popup=this.popupContainer.querySelector(selectors$c.largePromoInner),this.popupBody=this.popup.querySelector(selectors$c.popupBody),this.popupId=this.popup.id,this.close=this.popup.querySelector(selectors$c.popupClose),this.underlay=this.popup.querySelector(selectors$c.popupUnderlay),this.form=this.popup.querySelector(selectors$c.newsletterForm),this.cookie=new PopupCookie(this.popupContainer.dataset.cookieName,"user_has_closed"),this.isTargeted=new TargetReferrer(this.popupContainer),this.a11y=a11y,this.init()}init(){(!(this.cookie.read()!==!1)||window.Shopify.designMode)&&(window.Shopify.designMode?this.showPopup():new DelayShow(this.popupContainer,this.popup),this.form&&setTimeout(()=>
63{this.form.classList.contains(classes$a.success)&&(this.showPopupIfNoCookie(),activePopups-=1)}),this.initClosers())}checkPopupTarget(){const targetMobile=this.popup.parentNode.classList.contains(classes$a.mobile),targetDesktop=this.popup.parentNode.classList.contains(classes$a.desktop);return!(targetMobile&&window.innerWidth>=theme.sizes.small||targetDesktop&&window.innerWidth<theme.sizes.small)}showPopupIfNoCookie(){this.showPopup()}initClosers(){this.close.addEventListener("click",this.closePopup.bind(this)),this.underlay.addEventListener("click",this.closePopup.bind(this)),this.popupContainer.addEventListener("keyup",event=>{event.code===theme.keyboardKeys.ESCAPE&&this.closePopup(event)})}closePopup(event){event.preventDefault(),this.hidePopup(),this.cookie.write()}scrollLock(){this.resetScrollUnlock(),this.a11y.trapFocus({container:this.popupBody}),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.popupBody}))}scrollUnlock(){this.resetScrollUnlock(),scrollLockTimer=setTimeout(()=>{document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))},300)}resetScrollUnlock(){scrollLockTimer&&clearTimeout(scrollLockTimer)}showPopup(){const isTargetValid=this.checkPopupTarget()===!0,popupElement={id:this.popupId,body:this.popup};popups.push(popupElement),isTargetValid&&(activePopups+=1,this.popup.classList.add(classes$a.visible),this.scrollLock())}hidePopup(){this.popup.classList.remove(classes$a.visible);const popupIndex=popups.findIndex(x=>x.id===this.popupId);if(activePopups-=1,popups.splice(popupIndex,1),activePopups==1&&document.body.classList.contains(classes$a.barIsVisible))this.scrollUnlock();else if(activePopups<1)this.scrollUnlock(),this.a11y.removeTrapFocus();else if(popups.length>0){const nextPopup=popups[popups.length-1].body;this.a11y.trapFocus({container:nextPopup})}}onBlockSelect(evt){this.popupContainer.contains(evt.target)&&!this.popup.classList.contains(classes$a.visible)&&(this.popup.classList.add(classes$a.selected),this.popupContainer.classList.add(classes$a.hasBlockSelected),this.showPopup())}onBlockDeselect(evt){this.popupContainer.contains(evt.target)&&(this.popup.classList.remove(classes$a.selected),this.popupContainer.classList.remove(classes$a.hasBlockSelected),this.hidePopup())}onUnload(){this.scrollUnlock()}onDeselect(){this.popup.classList.remove(classes$a.selected),this.popupContainer.classList.remove(classes$a.hasBlockSelected),this.hidePopup()}}class Tracking{constructor(el){this.popupContainer=el,this.popup=this.popupContainer.querySelector(selectors$c.trackingInner),this.popupId=this.popup.id,this.close=this.popup.querySelector(selectors$c.popupClose),this.acceptButton=this.popup.querySelector(selectors$c.trackingAccept),this.enable=this.popupContainer.dataset.enable==="true",this.a11y=a11y,window.Shopify.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],error=>{if(error)throw error;const userCanBeTracked=window.Shopify.customerPrivacy.userCanBeTracked(),userTrackingConsent=window.Shopify.customerPrivacy.getTrackingConsent();this.enableTracking=!userCanBeTracked&&userTrackingConsent==="no_interaction"&&this.enable,window.Shopify.designMode&&(this.enableTracking=!0),this.init()})}init(){this.enableTracking&&this.showPopup(),this.clickEvents()}clickEvents(){this.close.addEventListener("click",event=>{event.preventDefault(),window.Shopify.customerPrivacy.setTrackingConsent(!1,()=>this.hidePopup())}),this.acceptButton.addEventListener("click",event=>{event.preventDefault(),window.Shopify.customerPrivacy.setTrackingConsent(!0,()=>this.hidePopup())}),document.addEventListener("trackingConsentAccepted",()=>{console.log("trackingConsentAccepted event fired")})}showPopup(){const popupElement={id:this.popupId,body:this.popup};popups.push(popupElement),this.popup.classList.add(classes$a.visible),this.a11y.trapFocus({container:this.popup})}hidePopup(){this.popup.classList.remove(classes$a.visible);const popupIndex=popups.findIndex(x=>x.id===this.popupId);if(popups.splice(popupIndex,1),activePopups<1)this.a11y.removeTrapFocus();else if(popups.length>0){const nextPopup=popups[popups.length-1].body;this.a11y.trapFocus({container:nextPopup})}}onBlockSelect(evt){this.popupContainer.contains(evt.target)&&this.enableTracking&&!this.popup.classList.contains(classe
63s$a.visible)&&(this.showPopup(),this.popup.classList.add(classes$a.selected),this.popup.parentNode.classList.add(classes$a.hasBlockSelected))}onBlockDeselect(evt){this.popupContainer.contains(evt.target)&&(this.popup.classList.remove(classes$a.selected),this.popupContainer.classList.remove(classes$a.hasBlockSelected),this.hidePopup())}onDeselect(){this.popup.classList.remove(classes$a.selected),this.popupContainer.classList.remove(classes$a.hasBlockSelected),this.hidePopup()}}class PopupBar{constructor(el){this.popupContainer=el,this.popup=this.popupContainer.querySelector(selectors$c.popupBarHolder),this.popupBody=this.popup.querySelector(selectors$c.popupBody),this.popupId=this.popup.id,this.close=this.popup.querySelector(selectors$c.popupClose),this.underlay=this.popup.querySelector(selectors$c.popupUnderlay),this.toggle=this.popup.querySelector(selectors$c.popupBarToggle),this.cookie=new PopupCookie(this.popupContainer.dataset.cookieName,"user_has_closed"),this.form=this.popup.querySelector(selectors$c.newsletterForm),this.isTargeted=new TargetReferrer(this.popupContainer),this.a11y=a11y,this.init()}init(){(!(this.cookie.read()!==!1)||window.Shopify.designMode)&&(window.Shopify.designMode?this.showPopup():new DelayShow(this.popupContainer,this.popup),this.initPopupToggleButton(),this.initClosers(),this.form&&setTimeout(()=>{this.form.classList.contains(classes$a.success)&&this.showPopupIfNoCookie(),this.form.classList.contains(classes$a.error)&&this.toggle.dispatchEvent(new Event("click"))}))}checkPopupTarget(){const targetMobile=this.popup.parentNode.classList.contains(classes$a.mobile),targetDesktop=this.popup.parentNode.classList.contains(classes$a.desktop);return!(targetMobile&&window.innerWidth>=theme.sizes.small||targetDesktop&&window.innerWidth<theme.sizes.small)}showPopupIfNoCookie(){this.showPopup(),this.toggle.dispatchEvent(new Event("click"))}initPopupToggleButton(){this.toggle.addEventListener("click",event=>{event.preventDefault(),this.popup.classList.toggle(classes$a.expanded),this.popup.classList.contains(classes$a.expanded)?this.scrollLock():this.scrollUnlock()})}showPopup(){const popupElement={id:this.popupId,body:this.popup};popups.push(popupElement),this.a11y.trapFocus({container:this.popupBody}),this.checkPopupTarget()===!0&&(activePopups+=1,document.body.classList.add(classes$a.barIsVisible),this.popup.classList.add(classes$a.visible))}hidePopup(){this.popup.classList.remove(classes$a.visible),document.body.classList.remove(classes$a.barIsVisible);const popupIndex=popups.findIndex(x=>x.id===this.popupId);if(popups.splice(popupIndex,1),activePopups>=1&&(activePopups-=1),activePopups<1)this.scrollUnlock(),this.a11y.removeTrapFocus();else if(popups.length>0){const nextPopup=popups[popups.length-1].body;this.a11y.trapFocus({container:nextPopup})}}initClosers(){this.close.addEventListener("click",this.closePopup.bind(this)),this.underlay.addEventListener("click",()=>this.toggle.dispatchEvent(new Event("click"))),this.popupContainer.addEventListener("keyup",event=>{event.code===theme.keyboardKeys.ESCAPE&&(this.popup.classList.remove(classes$a.expanded),this.scrollUnlock())})}closePopup(event){event.preventDefault(),this.cookie.write(),this.hidePopup()}scrollLock(){document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.popupBody}))}scrollUnlock(){this.resetScrollUnlock(),scrollLockTimer=setTimeout(()=>{document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))},300)}resetScrollUnlock(){scrollLockTimer&&clearTimeout(scrollLockTimer)}onBlockSelect(evt){this.popupContainer.contains(evt.target)&&!this.popup.classList.contains(classes$a.visible)&&(this.showPopup(),this.popup.classList.add(classes$a.expanded),this.popup.classList.add(classes$a.selected),this.popup.parentNode.classList.add(classes$a.hasBlockSelected),this.resetScrollUnlock(),this.scrollLock())}onBlockDeselect(evt){this.popupContainer.contains(evt.target)&&(this.popup.classList.remove(classes$a.expanded),this.popup.classList.remove(classes$a.selected),this.popup.parentNode.classList.remove(classes$a.hasBlockSelected),this.hidePopup())}onUnload(){this.scrollUnlock()}onDeselect(){this.popup.classList.remove(classes$a.expanded),this.popup.classList.remove(classes$a.selected),this.popup.parentNode.classList.remove(classes$a.hasBlockSelected),this.hidePopup()}}register("popups",[{onLoad(){sections$8[this.id]=[],window.Shopify.designMode&&(activePopups=0);const popupsLarge=this.container.querySelectorAll(selectors$c.largePromo);popupsLarge.length&&popupsLarge.forEach(el=>{sections$8[this.id].push(new LargePopup(el))});const popupBars=this.container.querySelectorAll(selectors$c.popupBar);
63popupBars.length&&popupBars.forEach(el=>{sections$8[this.id].push(new PopupBar(el))});const cookiesPopups=this.container.querySelectorAll(selectors$c.tracking);cookiesPopups.length&&cookiesPopups.forEach(el=>{sections$8[this.id].push(new Tracking(el))})},onDeselect(){sections$8[this.id].forEach(el=>{typeof el.onDeselect=="function"&&el.onDeselect()})},onBlockSelect(evt){sections$8[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$8[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})},onUnload(evt){sections$8[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload(evt)})}},newsletterSection]);const selectors$b={pressItems:"[data-press-items]",logoSlider:"[data-logo-slider]",logoSlide:"[data-logo-slide]",links:"a, button"},attributes$a={logoSlide:"data-logo-index",tabIndex:"tabindex"};let sections$7={};class Press{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$b.pressItems),this.sliderNav=this.container.querySelector(selectors$b.logoSlider),this.sliderResizeEvent=()=>this.checkSlides(),this.initSlider(),this.checkSlides(),window.addEventListener("load",this.resizeSlider.bind(this)),document.addEventListener("theme:resize:width",this.sliderResizeEvent)}checkSlides(){const containerWidth=this.container.offsetWidth,slides=this.container.querySelectorAll(selectors$b.logoSlide),sliderNav=Flickity.data(this.sliderNav)||null;sliderNav!==null&&(sliderNav.options.draggable=!1,sliderNav.options.wrapAround=!1,sliderNav.options.contain=!0,this.getSlidesWidth()>containerWidth&&slides.length>2&&(sliderNav.options.draggable=!0,sliderNav.options.wrapAround=!0,sliderNav.options.contain=!1),sliderNav.resize(),sliderNav.updateDraggable())}getSlidesWidth(){const slides=this.container.querySelectorAll(selectors$b.logoSlide);let slidesTotalWidth=0;
63return slides.length&&slides.forEach(slide=>{slidesTotalWidth+=slide.offsetWidth}),slidesTotalWidth}initSlider(){let flkty=Flickity.data(this.slider)||null,flktyNav=Flickity.data(this.sliderNav)||null;const duration=parseInt(this.container.dataset.duration),autoplay=this.container.dataset.autoplay==="true"?duration:!1;flkty=new Flickity(this.slider,{fade:!0,wrapAround:!0,adaptiveHeight:!0,prevNextButtons:!1,pageDots:!1,autoPlay:autoplay}),flktyNav=new Flickity(this.sliderNav,{draggable:!1,wrapAround:!1,contain:!0,imagesLoaded:!0,lazyLoad:!0,asNavFor:this.slider,prevNextButtons:!1,adaptiveHeight:!1,pageDots:!1,on:{ready:()=>{this.container.querySelectorAll(selectors$b.logoSlide).forEach(slide=>{slide.addEventListener("keyup",event=>{if(event.code===theme.keyboardKeys.ENTER||event.code===theme.keyboardKeys.NUMPADENTER||event.code===theme.keyboardKeys.SPACE){const selectedIndex=Number(slide.getAttribute(attributes$a.logoSlide));flkty.selectCell(selectedIndex)}})})}}}),flickitySmoothScrolling(this.slider),flickitySmoothScrolling(this.sliderNav),flktyNav.on("change",index=>{flkty.selectCell(index)}),flkty.on("change",index=>{flktyNav.selectCell(index),flkty.cells.forEach((slide,i)=>
63{slide.element.querySelectorAll(selectors$b.links).forEach(link=>{link.setAttribute(attributes$a.tabIndex,i===index?"0":"-1")})})})}resizeSlider(){const hasSlider=Flickity.data(this.slider);hasSlider&&hasSlider.resize()}onBlockSelect(event){const slider2=Flickity.data(this.slider)||null,sliderNav=Flickity.data(this.sliderNav)||null,index=parseInt([...event.target.parentNode.children].indexOf(event.target));slider2!==null&&(slider2.select(index),slider2.pausePlayer()),sliderNav!==null&&sliderNav.select(index)}onBlockDeselect(){const slider2=Flickity.data(this.slider)||null;this.container.dataset.autoplay==="true"&&slider2!==null&&slider2.playPlayer()}onUnload(){document.removeEventListener("theme:resize:width",this.sliderResizeEvent)}}register("press",{onLoad(){sections$7[this.id]=new Press(this)},onUnload(e){sections$7[this.id].onUnload(e)},onBlockSelect(e){sections$7[this.id].onBlockSelect(e)},onBlockDeselect(){sections$7[this.id].onBlockDeselect()}});const selectors$a={slideshow:"[data-product-single-media-slider]",productInfo:"[data-product-info]",headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]"},classes$9={sticky:"is-sticky"},attributes$9={stickyEnabled:"data-sticky-enabled"};window.theme.variables={productPageSticky:!1};const sections$6={};class ProductSticky{constructor(section){this.container=section.container,this.stickyEnabled=this.container.getAttribute(attributes$9.stickyEnabled)==="true",this.productInfo=this.container.querySelector(selectors$a.productInfo),this.stickyScrollTop=0,this.scrollLastPosition=0,this.stickyDefaultTop=0,this.currentPoint=0,this.defaultTopBottomSpacings=30,this.scrollTop=window.scrollY,this.scrollDirectionDown=!0,this.requestAnimationSticky=null,this.stickyFormLoad=!0,this.stickyFormLastHeight=null,this.onChangeCounter=0,this.scrollEvent=e=>this.scrollEvents(e),this.resizeEvent=e=>this.resizeEvents(e),this.init()}init(){this.stickyEnabled&&(this.stickyScrollCheck(),document.addEventListener("theme:resize",this.resizeEvent)),this.initSticky()}initSticky(){theme.variables.productPageSticky&&(this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition()),this.productInfo.addEventListener("theme:form:sticky",e=>{this.removeAnimationFrame(),this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition(e))}),document.addEventListener("theme:scroll",this.scrollEvent))}scrollEvents(e){e.detail!==null&&(this.scrollTop=e.detail.position,this.scrollDirectionDown=e.detail.down),this.requestAnimationSticky||(this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition()))}resizeEvents(){this.stickyScrollCheck(),document.removeEventListener("theme:scroll",this.scrollEvent),this.initSticky()}stickyScrollCheck(){const isDesktop=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>=window.theme.sizes.large,targetProductInfo=this.container.querySelector(selectors$a.productInfo);if(targetProductInfo)if(isDesktop){const productInfo=this.container.querySelector(selectors$a.productInfo),slideshow=this.container.querySelector(selectors$a.slideshow);if(!productInfo||!slideshow)return;const productCopyHeight=productInfo.offsetHeight,productImagesHeight=slideshow.offsetHeight;productCopyHeight<productImagesHeight?(theme.variables.productPageSticky=!0,targetProductInfo.classList.add(classes$9.sticky)):(theme.variables.productPageSticky=!1,targetProductInfo.classList.remove(classes$9.sticky))}else theme.variables.productPageSticky=!1,targetProductInfo.classList.remove(classes$9.sticky)}calculateStickyPosition(e=null){const isAccordion=!!(!!(e&&e.detail)&&e.detail.element&&e.detail.element==="accordion"),productInfoHeight=this.productInfo.offsetHeight,heightDifference=window.innerHeight-productInfoHeight-this.defaultTopBottomSpacings,scrollDifference=Math.abs(this.scrollTop-this.scrollLastPosition);this.scrollDirectionDown?this.stickyScrollTop-=scrollDifference:this.stickyScrollTop+=scrollDifference,this.stickyFormLoad&&(document.querySelector(selectors$a.headerSticky)&&document.querySelector(selectors$a.headerHeight)?this.stickyDefaultTop=parseInt(document.querySelector(selectors$a.headerHeight).getBoundingClientRect().height):this.stickyDefaultTop=this.defaultTopBottomSpacings,this.stickyScrollTop=this.stickyDefaultTop),this.stickyScrollTop=Math.min(Math.max(this.stickyScrollTop,heightDifference),this.stickyDefaultTop);const differencePoint=this.stickyScrollTop-this.currentPoint;this.currentPoint=this.stickyFormLoad?this.stickyScrollTop:this.currentPoint+differencePoint*.5,this.productInfo.style.setProperty("--sticky-top",`${this.currentPoint}px`),this.scrollLastPosition=this.scrollTop,this.stickyFormLoad=!1,isAccordion&&this.onChangeCounter<=10||isAccordion&&this.stickyFormLastHeight!==productInfoHeight||this.stickyScrollTop!==this.currentPoint&&this.requestAnimationSticky?(isAccordion&&(this.onChangeCounter+=1),isAccordion&&this.stickyFormLastHeight!==productInfoHeight&&(this.onChangeCounter=11),this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition(e))):this.requestAnimationSticky&&this.removeAnimationFrame(),this.stickyFormLastHeight=productInfoHeight}removeAnimationFrame(){this.requestAnimationSticky&&(cancelAnimationFrame(this.requestAnimationSticky),this.requestAnimationSticky=null,this.onChangeCounter=0)}onUnload(){this.stickyEnabled&&document.removeEventListener("theme:resize",this.resizeEvent),theme.variables.productPageSticky&&document.removeEventListener("theme:scroll",this.scrollEvent)}}const productStickySection={onLoad(){sections$6[this.id]=new ProductSticky(this)},onUnload(){sections$6[this.id].onUnload()}},selectors$9={mediaContainer:"[data-product-single-media-group]",productMediaSlider:"[data-product-single-media-slider]",zoomWrapper:"[data-zoom-wrapper]"},classes$8={popupClass:"pswp-zoom-gallery",popupClassNoThumbs:"pswp-zoom-gallery--single",isMoving:"is-moving"},attributes$8={dataImageWidth:"data-image-width",dataImageHeight:"data-image-height"};class Zoom{constructor(container){this.container=container,this.mediaContainer=this.container.querySelector(selectors$9.mediaContainer),this.slider=this.container.querySelector(selectors$9.productMediaSlider),this.zoomWrappers=this.container.querySelectorAll(selectors$9.zoomWrapper),this.zoomEnable=this.mediaContainer.dataset.gallery==="true",this.a11y=a11y,this.zoomEnable&&this.init()}
63init(){this.zoomWrappers.length&&this.zoomWrappers.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault(),this.slider&&this.slider.classList.contains(classes$8.isMoving)||(this.a11y.state.trigger=element,this.createZoom(i))})})}createZoom(indexImage){const instance=this;let items=[],counter=0;this.zoomWrappers.forEach(elementImage=>{const imgSrc=elementImage.getAttribute("href"),imgWidth=parseInt(elementImage.getAttribute(attributes$8.dataImageWidth)),imgHeight=parseInt(elementImage.getAttribute(attributes$8.dataImageHeight));if(items.push({src:imgSrc,w:imgWidth,h:imgHeight,msrc:imgSrc}),counter+=1,instance.zoomWrappers.length===counter){let popupClass=`${classes$8.popupClass}`;counter===1&&(popupClass=`${classes$8.popupClass} ${classes$8.popupClassNoThumbs}`);const options2={barsSize:{top:60,bottom:60},history:!1,focus:!1,index:indexImage,mainClass:popupClass,showHideOpacity:!0,showAnimationDuration:250,hideAnimationDuration:250,closeOnScroll:!1,closeOnVerticalDrag:!1,captionEl:!1,closeEl:!0,closeElClasses:["caption-close"],tapToClose:!1,clickToCloseNonZoomable:!1,maxSpreadZoom:2,loop:!0,spacing:0,allowPanToNext:!0,pinchToClose:!1};new LoadPhotoswipe(items,options2)}})}}const selectors$8={complementaryProducts:"[data-complementary-products]",buttonQuickView:"[data-button-quick-view]"},attributes$7={url:"data-url"};class ComplementaryProducts extends HTMLElement{constructor(){super()}connectedCallback(){const handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),this.hasAttribute(attributes$7.url)&&this.getAttribute(attributes$7.url)!==""&&fetch(this.getAttribute(attributes$7.url)).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector(selectors$8.complementaryProducts);recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML),html.querySelector(selectors$8.buttonQuickView)&&new QuickViewPopup(this)}).catch(e=>{console.error(e)}))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}const selectors$7={recipientCheckbox:"[data-recipient-checkbox]",recipientEmail:"[data-recipient-email]",recipientName:"[data-recipient-name]",recipientMessage:"[data-recipient-message]",recipientSendOn:"[data-recipient-send-on]",recipientControl:"[data-recipient-control]",recipientOffset:"[data-recipient-offset]",productForm:"[data-product-form]",cartDrawer:"[data-cart-drawer]"},classes$7={quickViewVisible:"js-quick-view-visible"};class RecipientForm extends HTMLElement{constructor(){super(),this.recipientCheckbox=this.querySelector(selectors$7.recipientCheckbox),this.recipientControl=this.querySelector(selectors$7.recipientControl),this.recipientControl.disabled=!0,this.recipientEmail=this.querySelector(selectors$7.recipientEmail),this.recipientName=this.querySelector(selectors$7.recipientName),this.recipientMessage=this.querySelector(selectors$7.recipientMessage),this.recipientSendOn=this.querySelector(selectors$7.recipientSendOn),this.recipientOffset=this.querySelector(selectors$7.recipientOffset),this.recipientOffset&&(this.recipientOffset.value=new Date().getTimezoneOffset()),this.cartDrawer=document.querySelector(selectors$7.cartDrawer),this.onChangeEvent=event=>this.onChange(event),this.onCartAddedEvent=()=>this.onCartAdded()}connectedCallback(){this.recipientCheckbox&&(this.disableInputFields(),this.recipientCheckbox.addEventListener("change",this.onChangeEvent),document.addEventListener("theme:cart:added",this.onCartAddedEvent))}onChange(event){if(!event.target.checked){this.clearInputFields(),this.disableInputFields();return}this.enableInputFields()}onCartAdded(){const scrollToPosition=this.closest(selectors$7.productForm).offsetTop,isQuickBuyForm=document.body.classList.contains(classes$7.quickViewVisible);if(!(this.recipientCheckbox.checked===!0))return;isQuickBuyForm||window.scrollTo({top:scrollToPosition,left:0,behavior:"smooth"});const onCartDrawerTransitionEnd=event=>{event.target===this.cartDrawer&&(requestAnimationFrame(()=>{this.recipientCheckbox.checked=!1,this.recipientCheckbox.dispatchEvent(new Event("change"))}),this.cartDrawer.removeEventListener("transitionend",onCartDrawerTransitionEnd))};this.cartDrawer.addEventListener("transitionend",onCartDrawerTransitionEnd)}inputFields(){return[this.recipientEmail,this.recipientName,this.recipientMessage,this.recipientSendOn]}disableableFields(){return[...this.inputFields(),this.recipientOff
63set]}clearInputFields(){this.inputFields().forEach(field=>field.value="")}enableInputFields(){this.disableableFields().forEach(field=>field.disabled=!1)}disableInputFields(){this.disableableFields().forEach(field=>field.disabled=!0)}disconnectedCallback(){this.recipientCheckbox.removeEventListener("change",this.onChangeEvent),document.removeEventListener("theme:cart:added",this.onCartAddedEvent)}}const selectors$6={option:"[data-option]",popout:"[data-popout]",productMediaSlider:"[data-product-single-media-slider]",productMediaThumb:"[data-thumbnail-id]",productMediaThumbs:"[data-product-single-media-thumbs]",productMediaWrapper:"[data-product-single-media-wrapper]",productModel:"[data-model]",productSingleThumbnailLink:".product-single__thumbnail-link",deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]",modalScrollContainer:"[data-tabs-holder]",tooltip:"[data-tooltip]",productRating:"[data-product-rating]",productReviews:"#shopify-product-reviews",links:"a, button",upsellProduct:"[data-upsell-holder]",upsellProductSlider:"[data-upsell-slider]",featureSlider:"[data-slider]"},classes$6={featuredProduct:"featured-product",featuredProductOnboarding:"featured-product--onboarding",hasMediaActive:"has-media-active",isSelected:"is-selected",mediaHidden:"media--hidden",noOutline:"no-outline",hasPopup:"has-popup",isMoving:"is-moving"},attributes$6={mediaId:"data-media-id",sectionId:"data-section-id",thumbId:"data-thumbnail-id",dataTallLayout:"data-tall-layout",loaded:"loaded",tabindex:"tabindex"},sections$5={};class Product{constructor(section){this.container=section.container,this.sectionId=this.container.getAttribute(attributes$6.sectionId),this.tallLayout=this.container.getAttribute(attributes$6.dataTallLayout)==="true",this.featureSliders=this.container.querySelectorAll(selectors$6.featureSlider),this.flkty=null,this.flktyNav=null,this.isFlickityDragging=!1,this.enableHistoryState=!this.container.classList.contains(classes$6.featuredProduct),this.checkSliderOnResize=()=>this.checkSlider(),this.flktyNavOnResize=()=>this.resizeFlickityNav(),this.scrollToReviews(),this.initUpsellSlider(),this.initFeatureSlider(),new QuickViewPopup(this.container),!this.container.classList.contains(classes$6.featuredProductOnboarding)&&(new Zoom(this.container),this.productSlider(),this.initMediaSwitch(),this.initProductVideo(),this.initProductModel(),this.initShopifyXrLaunch())}productSlider(){this.checkSlider(),document.addEventListener("theme:resize:width",this.checkSliderOnResize)}
63checkSlider(){if(!this.tallLayout||window.innerWidth<theme.sizes.large){this.initProductSlider();return}this.destroyProductSlider()}resizeFlickityNav(){this.flktyNav!==null&&this.flktyNav.resize()}initProductSlider(){const slider2=this.container.querySelector(selectors$6.productMediaSlider),thumbs=this.container.querySelector(selectors$6.productMediaThumbs),media=this.container.querySelectorAll(selectors$6.productMediaWrapper);if(media.length>1&&(this.flkty=new Flickity(slider2,{wrapAround:!0,pageDots:!1,adaptiveHeight:!0,on:{ready:()=>{slider2.setAttribute(attributes$6.tabindex,"-1"),media.forEach(item=>{if(!item.classList.contains(classes$6.isSelected)){const links=item.querySelectorAll(selectors$6.links);links.length&&links.forEach(link=>{link.setAttribute(attributes$6.tabindex,"-1")})}})},dragStart:()=>{slider2.classList.add(classes$6.isMoving)},dragMove:()=>{this.isFlickityDragging=!0},staticClick:()=>{this.isFlickityDragging=!1},settle:index=>{const mediaId=this.flkty.selectedElement.getAttribute(attributes$6.mediaId);this.flkty.cells.forEach((slide,i)=>{const links=slide.element.querySelectorAll(selectors$6.links);links.length&&links.forEach(link=>{link.setAttribute(attributes$6.tabindex,i===index?"0":"-1")})}),this.switchMedia(mediaId),slider2.classList.remove(classes$6.isMoving)}}}),media.length&&media.forEach(el=>{el.addEventListener("theme:media:play",()=>{this.flkty.options.draggable=!1,this.flkty.updateDraggable(),el.closest(selectors$6.productMediaSlider).classList.add(classes$6.hasMediaActive)}),el.addEventListener("theme:media:pause",()=>{this.flkty.options.draggable=!0,this.flkty.updateDraggable(),el.closest(selectors$6.productMediaSlider).classList.remove(classes$6.hasMediaActive)})}),flickitySmoothScrolling(slider2),thumbs!==null)){this.flktyNav=new Flickity(thumbs,{asNavFor:slider2,contain:!0,pageDots:!1,prevNextButtons:!1,resize:!0,on:{ready:()=>{thumbs.setAttribute(attributes$6.tabindex,"-1")}}}),this.flktyNav!==null&&document.addEventListener("theme:resize:width",this.flktyNavOnResize),flickitySmoothScrolling(thumbs);const thumbLinks=this.container.querySelectorAll(selectors$6.productSingleThumbnailLink);thumbLinks.length&&thumbLinks.forEach(el=>{el.addEventListener("click",e=>{e.preventDefault()})})}}destroyProductSlider(){this.flkty!==null&&(this.flkty.destroy(),this.flktyNav.destroy(),this.flkty=null,this.flktyNav=null)}initUpsellSlider(){const slider2=this.container.querySelector(selectors$6.upsellProductSlider);if(this.container.querySelectorAll(selectors$6.upsellProduct).length>1){const flktyUpsell=new Flickity(slider2,{wrapAround:!0,pageDots:!0,adaptiveHeight:!0,prevNextButtons:!1});flktyUpsell.on("change",index=>{flktyUpsell.cells.forEach((slide,i)=>{const links=slide.element.querySelectorAll(selectors$6.links);links.length&&links.forEach(link=>{link.setAttribute(attributes$6.tabindex,i===index?"0":"-1")})})})}}initFeatureSlider(){this.featureSliders.forEach(featureSliders=>{Array.from(featureSliders.children).length>1&&(this.flktyFeature=new Flickity(featureSliders,{wrapAround:!0,pageDots:!0,adaptiveHeight:!0,prevNextButtons:!1}))})}handleMediaFocus(event){if(event.code!==theme.keyboardKeys.ENTER&&event.code!==theme.keyboardKeys.TAB)return;const mediaId=event.currentTarget.getAttribute(attributes$6.thumbId),activeSlide=this.container.querySelector(`[${attributes$6.mediaId}="${mediaId}"]`),slideIndex=parseInt([...activeSlide.parentNode.children].indexOf(activeSlide)),slider2=this.container.querySelector(selectors$6.productMediaSlider),sliderNav=this.container.querySelector(selectors$6.productMediaThumbs),flkty=Flickity.data(slider2)||null,flktyNav=Flickity.data(sliderNav)||null;flkty&&flkty.isActive&&slideIndex>-1&&(event.code===theme.keyboardKeys.ENTER||event.code===theme.keyboardKeys.NUMPADENTER)&&flkty.select(slideIndex),flktyNav&&flktyNav.isActive&&slideIndex>-1&&flktyNav.select(slideIndex)}switchMedia(mediaId){const mediaItems=document.querySelectorAll(`${selectors$6.productMediaWrapper}`),selectedMedia=this.container.querySelector(`${selectors$6.productMediaWrapper}[${attributes$6.mediaId}="${mediaId}
63"]`),isFocusEnabled=!document.body.classList.contains(classes$6.noOutline);mediaItems.length&&mediaItems.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes$6.mediaHidden)}),isFocusEnabled&&selectedMedia.focus(),selectedMedia.closest(selectors$6.productMediaSlider).classList.remove(classes$6.hasMediaActive),selectedMedia.classList.remove(classes$6.mediaHidden),selectedMedia.dispatchEvent(new CustomEvent("theme:media:visible"),{bubbles:!0});const deferredMedia=selectedMedia.querySelector(selectors$6.deferredMedia);deferredMedia&&deferredMedia.getAttribute(attributes$6.loaded)!=="true"&&selectedMedia.querySelector(selectors$6.deferredMediaButton).dispatchEvent(new Event("click"))}initMediaSwitch(){const productThumbImages=this.container.querySelectorAll(selectors$6.productMediaThumb);productThumbImages.length&&productThumbImages.forEach(el=>{el.addEventListener("keyup",this.handleMediaFocus.bind(this)),el.addEventListener("click",e=>{e.preventDefault()})})}initProductVideo(){this.videos=new ProductVideo(this.container)}initProductModel(){const modelItems=this.container.querySelectorAll(selectors$6.productModel);modelItems.length&&modelItems.forEach(element=>{theme.ProductModel.init(element,this.sectionId)})}initShopifyXrLaunch(){document.addEventListener("shopify_xr_launch",()=>{this.container.querySelector(`${selectors$6.productModel}:not(.${classes$6.mediaHidden})`).dispatchEvent(new CustomEvent("xrLaunch"))})}onUnload(){this.flktyNav!==null&&document.removeEventListener("theme:resize:width",this.flktyNavOnResize),document.removeEventListener("theme:resize:width",this.checkSliderOnResize)}scrollToReviews(){const productRating=this.container.querySelector(selectors$6.productRating),events=["click","keydown"];productRating&&events.forEach(eventName=>{productRating.addEventListener(eventName,event=>{if(event.code!==theme.keyboardKeys.ENTER&&event.code!==theme.keyboardKeys.NUMPADENTER||event.type!="click"){const reviewsContainer=document.querySelector(selectors$6.productReviews);if(!reviewsContainer)return;reviewsContainer.scrollIntoView({behavior:"smooth"})}})})}onBlockSelect(event){const flkty=Flickity.data(event.target.closest(selectors$6.featureSlider)),index=parseInt([...event.target.parentNode.children].indexOf(event.target));flkty&&flkty.select(index)}}const productSection={onLoad(){sections$5[this.id]=new Product(this)},onUnload:function(){sections$5[this.id].onUnload()},onBlockSelect(event){sections$5[this.id].onBlockSelect(event)}};register("product-template",[productFormSection,productSection,swatchSection,swatchesContainer,shareButton,collapsible,tooltip,popoutSection,drawer,productStickySection]),register("featured-product",[productFormSection,productSection,swatchSection,swatchesContainer,shareButton,collapsible,tooltip,popoutSection,drawer,productStickySection]),customElements.get("complementary-products")||customElements.define("complementary-products",ComplementaryProducts),customElements.get("recipient-form")||customElements.define("recipient-form",RecipientForm);const classes$5={isDisabled:"is-disabled"},attributes$5={circleTextParallax:"data-circle-text-parallax"};class CircleText{constructor(el){this.circleText=el,this.rotateDegree=70,this.adjustRotateDegree=this.rotateDegree/2,this.scrollEvent=()=>this.updateParallax(),this.init()}init(){this.circleText.hasAttribute(attributes$5.circleTextParallax)&&document.addEventListener("theme:scroll",this.scrollEvent)}updateParallax(){if(this.circleText.classList.contains(classes$5.isDisabled))return;const windowHeight=Math.round(window.innerHeight),scrollTop=Math.round(window.scrollY),scrollBottom=scrollTop+windowHeight,elementOffsetTopPoint=Math.round(this.circleText.getBoundingClientRect().top+scrollTop),elementHeight=this.circleText.offsetHeight,isBottomOfElementPassed=elementOffsetTopPoint+elementHeight<scrollTop;if(elementOffsetTopPoint<scrollBottom&&!isBottomOfElementPassed){const percentage=(scrollBottom-elementOffsetTopPoint-elementHeight/2)*100/windowHeight;let angle=this.rotateDegree*percentage/100*-1;percentage>0&&(this.circleText.style.transform=`rotate(${this.adjustRotateDegree+angle}deg)`)}}unload(){document.removeEventListener("theme:scroll",this.scrollEvent)}}const attributes$4={href:"href",mediaId:"data-media-id",deferredMediaLoaded:"data-deferred-media-loaded"},selectors$5={deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]",productC
63ontentWrapper:"[data-product-content-wrapper]",productMediaWrapper:"[data-product-single-media-wrapper]",productModel:"[data-model]",productLink:"[data-product-link]",productSingleMediaImage:"[data-product-single-media-image]",sliderContents:"[data-slider-contents]",sliderImages:"[data-slider-images]",tabButton:"[data-tab-button]",tabItem:"[data-tab-item]",circleText:"[data-circle-text]"},classes$4={aosAnimate:"aos-animate",tabButtonActive:"products-list__nav__button--active",tabItemActive:"products-list__item--active",mediaHidden:"media--hidden",isDisabled:"is-disabled"},sections$4={};class ProductsList{constructor(section){this.container=section.container,this.sectionId=this.container.dataset.sectionId,this.tabButtons=this.container.querySelectorAll(selectors$5.tabButton),this.tabItems=this.container.querySelectorAll(selectors$5.tabItem),this.slidersImages=this.container.querySelectorAll(selectors$5.sliderImages),this.slidersContents=this.container.querySelectorAll(selectors$5.sliderContents),this.videos=[],this.flktyImages=[],this.flktyContent=[],this.sliderResizeEvent=()=>this.resizeSlider(),this.initButtons(),this.initSliders(),this.initProductVideos(),this.initProductModel(),this.initShopifyXrLaunch(),this.initCircleText(),this.listen()}listen(){(this.slidersImages.length>0||this.slidersContents.length>0)&&document.addEventListener("theme:resize",this.sliderResizeEvent)}resizeSlider(){this.flktyImages.length>0&&requestAnimationFrame(()=>{this.flktyImages.forEach(flktyImages=>flktyImages.resize())}),this.flktyContent.length>0&&requestAnimationFrame(()=>{this.flktyContent.forEach(flktyContent=>flktyContent.resize())})}initButtons(){this.tabButtons.length&&this.tabButtons.forEach(tabButton=>{tabButton.addEventListener("click",e=>{if(tabButton.classList.contains(classes$4.tabButtonActive))return;const currentTabAnchor=tabButton.getAttribute(attributes$4.href),currentTab=this.container.querySelector(currentTabAnchor),currentMedia=currentTab.querySelector(selectors$5.productMediaWrapper),mediaId=currentMedia?currentMedia.dataset.mediaId:null,currentCircleText=currentTab.querySelector(selectors$5.circleText);this.tabButtons.forEach(button=>{button.classList.remove(classes$4.tabButtonActive)}),this.tabItems.forEach(item=>{const circleText=item.querySelector(selectors$5.circleText);item.classList.remove(classes$4.tabItemActive),circleText?.classList.add(classes$4.isDisabled),theme.settings.animations&&item.querySelectorAll(`.${classes$4.aosAnimate}`).forEach(element=>{element.classList.remove(classes$4.aosAnimate),setTimeout(()=>{element.classList.add(classes$4.aosAnimate)})})}),tabButton.classList.add(classes$4.tabButtonActive),currentTab.classList.add(classes$4.tabItemActive),document.dispatchEvent(new Event("theme:resize")),currentCircleText&&(currentCircleText.classList.remove(classes$4.isDisabled),document.dispatchEvent(new Event("theme:scroll"))),this.handleProductVideos(currentTab,mediaId),e.preventDefault()})})}initSliders(){this.slidersImages.forEach((sliderImages,idx)=>{const contentsElement=sliderImages.closest(selectors$5.tabItem).querySelector(selectors$5.sliderContents),flktyImages=new Flickity(sliderImages,{fade:!0,pageDots:!1,prevNextButtons:!0,wrapAround:!0,adaptiveHeight:!0,asNavFor:contentsElement,on:{change:index=>{this.flktyContent.length>0&&this.flktyContent[idx].select(index)}}});flktyImages.on("settle",index=>{const elements=sliderImages.querySelectorAll(selectors$5.productMediaWrapper);for(let i=0;i<elements.length;i++)i===index?elements[i].querySelector(selectors$5.productSingleMediaImage).removeAttribute("tabindex"):elements[i].querySelector(selectors$5.productSingleMediaImage).setAttribute("tabindex","-1")}),this.flktyImages.push(flktyImages)}
63),this.slidersContents.forEach(sliderContent=>{const flktyContent=new Flickity(sliderContent,{fade:!0,pageDots:!1,prevNextButtons:!1,wrapAround:!0,adaptiveHeight:!0});flktyContent.on("settle",index=>{const elements=sliderContent.querySelectorAll(selectors$5.productContentWrapper);for(let i=0;i<elements.length;i++)i===index?elements[i].querySelectorAll(selectors$5.productLink).forEach(element=>{element.removeAttribute("tabindex")}):elements[i].querySelectorAll(selectors$5.productLink).forEach(element=>{element.setAttribute("tabindex","-1")})}),this.flktyContent.push(flktyContent)})}initProductVideos(){this.tabItems.forEach(item=>{item.classList.contains(classes$4.tabItemActive)&&this.handleProductVideos(item)})}loadVideos(container,mediaId=null){new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{if(entry.isIntersecting){const productVideo=new ProductVideo(container);this.videos.push(productVideo),container.setAttribute(attributes$4.deferredMediaLoaded,""),this.playToggle(mediaId),observer.unobserve(entry.target)}})},{root:null,rootMargin:"300px",threshold:[0,.1,.25,.5,.75,1]}).observe(container)}handleProductVideos(container,mediaId=null){if(!container.hasAttribute(attributes$4.deferredMediaLoaded)){this.loadVideos(container,mediaId);return}this.playToggle(mediaId)}playToggle(mediaId){this.videos.forEach(element=>{typeof element.pauseContainerMedia=="function"&&mediaId&&(element.pauseContainerMedia(mediaId,this.container),this.switchMedia(mediaId)),!mediaId&&Object.keys(element.players).length===0&&this.pauseContainerMedia(this.container)})}switchMedia(mediaId){const selectedMedia=this.container.querySelector(`${selectors$5.productMediaWrapper}[${attributes$4.mediaId}="${mediaId}"]`);!document.body.classList.contains(classes$4.noOutline)&&selectedMedia.focus(),selectedMedia.classList.remove(classes$4.mediaHidden),selectedMedia.dispatchEvent(new CustomEvent("theme:media:visible"),{bubbles:!0})}pauseContainerMedia(container){const mediaItems=container.querySelectorAll(selectors$5.productMediaWrapper);mediaItems.length!==0&&mediaItems.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes$4.mediaHidden)})}initProductModel(){const modelItems=this.container.querySelectorAll(selectors$5.productModel);modelItems.length&&modelItems.forEach(element=>{theme.ProductModel.init(element,this.sectionId)})}initShopifyXrLaunch(){document.addEventListener("shopify_xr_launch",()=>{this.container.querySelector(`${selectors$5.productModel}:not(.${classes$4.mediaHidden})`).dispatchEvent(new CustomEvent("xrLaunch"))})}initCircleText(){this.container.querySelectorAll(selectors$5.circleText).forEach(circleText=>{new CircleText(circleText)})}onBlockSelect(evt){evt.target.dispatchEvent(new Event("click"))}onUnload(){(this.slidersImages.length>0||this.slidersContents.length>0)&&document.removeEventListener("theme:resize",this.sliderResizeEvent)}}register("products-list",{onLoad(){sections$4[this.id]=new ProductsList(this)},onUnload(){sections$4[this.id].onUnload()},onBlockSelect(e){sections$4[this.id].onBlockSelect(e)}});const selectors$4={product:"[data-product-block]",relatedProducts:"[data-related-products]"},attributes$3={sectionId:"data-section-id",productId:"data-product-id",limit:"data-limit"},sections$3={};class RelatedProducts{constructor(container){this.container=container,this.relatedProducts=this.container.querySelector(selectors$4.relatedProducts),this.init()}init(){const sectionId=this.container.getAttribute(attributes$3.sectionId),productId=this.container.getAttribute(attributes$3.productId),limit=this.container.getAttribute(attributes$3.limit),requestUrl=`${theme.routes.product_recommendations_url}?section_id=${sectionId}&limit=${limit}&product_id=${productId}`;fetch(requestUrl).then(response=>response.text()).then(data=>{const createdElement=document.createElement("div");createdElement.innerHTML=data;const inner=createdElement.querySelector(selectors$4.relatedProducts);inner.querySelectorAll(selectors$4.product).length&&(this.relatedProducts.innerHTML=inner.innerHTML,this.productGrid=new ProductGrid(this.container),this.gridSlider=new GridSlider(this.container))})}onDeselect(){this.productGrid&&this.productGrid.onDeselect()}onUnload(){this.productGrid&&this.productGrid.onUnload(),this.gridSlider&&this.gridSlider.onUnload()}}register("related-products",{onLoad(){sections$3[this.id]=new RelatedProducts(this.container)},onDeselect(){sections$3[this.id].onDeselect()},onUnload(){sections$3[this.id].onUnload()}});const sections$2={}
63,selectors$3={slider:"[data-slider]",sliderItem:"[data-item]",buttonProductsShow:"[data-button-show]",buttonProductsHide:"[data-button-hide]",itemProducts:"[data-item-products]",itemProductSlider:"[data-item-products-slider]",itemProduct:"[data-item-product]",links:"a, button"},classes$3={itemActive:"blog-item--active",itemProductsVisible:"blog-item__products--visible",featuredBlogSlider:"shoppable-blog__slider",flickityEnabled:"flickity-enabled",isSelected:"is-selected"},attributes$2={slider:"data-slider",slidePosition:"data-slide-position",sectionId:"data-section-id",tabIndex:"tabindex"};class ShoppableBlog{constructor(section){this.container=section.container,this.flkty=null,this.slider=this.container.querySelector(selectors$3.slider),this.checkSlidesSizeOnResize=()=>this.checkSlidesSize(),this.isFullWidth=this.container.hasAttribute(attributes$2.fullWidth),this.gutter=0,this.a11y=a11y,this.clickOutsideItemEvent=e=>{if(!(e.target.matches(selectors$3.sliderItem)||e.target.closest(selectors$3.sliderItem))){const sliderItem=this.container.querySelectorAll(selectors$3.sliderItem);sliderItem.length&&sliderItem.forEach(item=>{const itemProducts=item.querySelector(selectors$3.itemProducts);itemProducts&&(itemProducts.classList.remove(classes$3.itemProductsVisible),this.changeTabIndex(itemProducts)),item.classList.remove(classes$3.itemActive)})}},this.bindButtons(),this.listen()}initSlider(){this.flkty=new Flickity(this.slider,{prevNextButtons:!0,pageDots:!1,cellAlign:"left",wrapAround:!1,groupCells:!0,contain:!0,on:{ready:()=>{this.handleFocus()}}}),this.flkty.on("change",()=>{const slides=this.container.querySelectorAll(selectors$3.sliderItem);this.handleFocus(),slides.length&&slides.forEach(el=>{const itemProducts=el.querySelector(selectors$3.itemProducts);el.classList.remove(classes$3.itemActive),itemProducts&&el.querySelector(selectors$3.itemProducts).classList.remove(classes$3.itemProductsVisible)}),this.flkty&&!this.flkty.options.draggable&&(this.flkty.options.draggable=!0,this.flkty.updateDraggable())})}destroySlider(){this.flkty!==null&&(this.flkty.destroy(),this.flkty=null)}checkSlidesSize(){const sliderItemStyle=this.container.querySelector(selectors$3.sliderItem).currentStyle||window.getComputedStyle(this.container.querySelector(selectors$3.sliderItem));this.gutter=parseInt(sliderItemStyle.marginRight);const containerWidth=this.slider.offsetWidth+this.gutter,itemsWidth=this.getItemsWidth(),itemsOverflowViewport=containerWidth<itemsWidth;window.innerWidth>=theme.sizes.small&&itemsOverflowViewport?this.initSlider():this.destroySlider()}getItemsWidth(){let itemsWidth=0;const slides=this.slider.querySelectorAll(selectors$3.sliderItem);return slides.length&&slides.forEach(item=>{itemsWidth+=item.offsetWidth+this.gutter}),itemsWidth}bindButtons(){const itemProductSlider=this.container.querySelectorAll(selectors$3.itemProductSlider),buttonProductsShow=this.container.querySelectorAll(selectors$3.buttonProductsShow),buttonProductsHide=this.container.querySelectorAll(selectors$3.buttonProductsHide);buttonProductsShow.length&&buttonProductsShow.forEach(button=>{button.addEventListener("click",e=>{e.preventDefault(),this.container.querySelectorAll(selectors$3.sliderItem).forEach(item2=>{const itemProducts2=item2.querySelector(selectors$3.itemProducts);item2.classList.remove(classes$3.itemActive),itemProducts2&&(itemProducts2.classList.remove(classes$3.itemProductsVisible),this.changeTabIndex(itemProducts2))});const item=button.closest(selectors$3.sliderItem),itemProducts=item.querySelector(selectors$3.itemProducts);if(item.classList.add(classes$3.itemActive),itemProducts){itemProducts.classList.add(classes$3.itemProductsVisible),this.changeTabIndex(itemProducts,"enable");const itemProductsSlider=itemProducts.querySelector(selectors$3.itemProductSlider),allSlides=itemProductsSlider.querySelectorAll(selectors$3.itemProduct);if(itemProductsSlider.classList.contains(classes$3.flickityEnabled)){const currentSlideIndex=itemProductsSlider.querySelector(`.${classes$3.isSelected}`).getAttribute(attributes$2.slidePosition);
63allSlides.forEach((slide,i)=>{slide.setAttribute(attributes$2.tabIndex,i===currentSlideIndex?"0":"-1")})}}this.flkty!==null&&(this.flkty.options.draggable=!1,this.flkty.updateDraggable()),this.a11y.state.trigger=button})}),buttonProductsHide.length&&buttonProductsHide.forEach(button=>{button.addEventListener("click",e=>{e.preventDefault();const item=button.closest(selectors$3.sliderItem),itemProducts=item.querySelector(selectors$3.itemProducts);item.classList.remove(classes$3.itemActive),itemProducts&&(itemProducts.classList.remove(classes$3.itemProductsVisible),this.changeTabIndex(itemProducts)),this.flkty!==null&&(this.flkty.options.draggable=!0,this.flkty.updateDraggable()),this.a11y.state.trigger.focus()})}),itemProductSlider.length&&itemProductSlider.forEach(slider2=>{if(slider2.querySelectorAll(selectors$3.itemProduct).length>1){const flktyProducts=new Flickity(slider2,{prevNextButtons:!0,contain:!0,pageDots:!1,wrapAround:!0,on:{change:index=>{flktyProducts.cells.forEach((slide,i)=>{slide.element.querySelectorAll(selectors$3.links).forEac
63h(link=>{link.setAttribute(attributes$2.tabIndex,i===index?"0":"-1")})})}}})}}),this.slider.addEventListener("keyup",event=>{if(event.code===theme.keyboardKeys.ESCAPE){const sliderItem=event.target.hasAttribute(attributes$2.slider)?event.target.querySelectorAll(selectors$3.sliderItem):event.target.closest(selectors$3.slider).querySelectorAll(selectors$3.sliderItem);sliderItem.length&&(sliderItem.forEach(item=>{const itemProducts=item.querySelector(selectors$3.itemProducts);item.classList.remove(classes$3.itemActive),itemProducts&&(itemProducts.classList.remove(classes$3.itemProductsVisible),this.changeTabIndex(itemProducts))}),this.flkty&&(this.flkty.options.draggable=!0,this.flkty.updateDraggable())),this.a11y.state.trigger.focus()}})}handleFocus(){const sliderItems=this.container.querySelectorAll(selectors$3.sliderItem);sliderItems.length&&sliderItems.forEach(item=>{const selected=item.classList.contains(classes$3.isSelected),itemProducts=item.querySelector(selectors$3.itemProducts);selected?(this.changeTabIndex(item,"enable"),itemProducts&&this.changeTabIndex(itemProducts)):(this.changeTabIndex(item),itemProducts&&itemProducts.classList.remove(classes$3.itemProductsVisible))})}listen(){this.slider&&(this.checkSlidesSize(),document.addEventListener("theme:resize:width",this.checkSlidesSizeOnResize)),document.addEventListener("mousedown",this.clickOutsideItemEvent)}changeTabIndex(items,state=""){const tabIndex=state==="enable"?"0":"-1";
63items.querySelectorAll(selectors$3.links).forEach(link=>{link.setAttribute(attributes$2.tabIndex,tabIndex)})}onBlockSelect(evt){if(this.flkty!==null){const index=parseInt([...evt.target.parentNode.children].indexOf(evt.target)),slidesPerPage=parseInt(this.flkty.slides[0].cells.length),groupIndex=Math.floor(index/slidesPerPage);this.flkty.select(groupIndex)}else{const sliderStyle=this.slider.currentStyle||window.getComputedStyle(this.slider),sliderPadding=parseInt(sliderStyle.paddingLeft),blockPositionLeft=evt.target.offsetLeft-sliderPadding;this.slider.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}onUnload(){document.removeEventListener("theme:resize:width",this.checkSlidesSizeOnResize),document.removeEventListener("mousedown",this.clickOutsideItemEvent)}}register("shoppable-blog",{onLoad(){sections$2[this.id]=new ShoppableBlog(this)},onUnload(e){sections$2[this.id].onUnload(e)},onBlockSelect(e){sections$2[this.id].onBlockSelect(e)}});const selectors$2={arrowScrollDown:"[data-scroll-down]",header:"[data-site-header]",item:"[data-slide]",links:"a, button",slider:"[data-slider]"},attributes$1={style:"data-style",currentStyle:"data-current-style",tabIndex:"tabindex",slidePosition:"data-slide-position"},classes$2={headerFixed:"site-header--fixed"},sections$1={};class Slider{constructor(section){this.container=section.container,this.header=document.querySelector(selectors$2.header),this.flkty=null,this.resizeEvent=()=>{this.flkty&&this.flkty.resize()},window.Shopify&&window.Shopify.designMode||this.initSlider(),this.bindScrollButton()}initSlider(){const slidesCount=this.container.querySelectorAll(selectors$2.item).length,duration=parseInt(this.container.dataset.duration),pageDots=this.container.dataset.pageDots==="true"&&slidesCount>1,prevNextButtons=this.container.dataset.navArrows==="true"&&slidesCount>1;let autoplay=this.container.dataset.autoplay==="true";if(autoplay&&(autoplay=duration),slidesCount>1)this.flkty=new Flickity(this.container,{fade:!0,cellSelector:selectors$2.item,autoPlay:autoplay,wrapAround:!0,adaptiveHeight:!0,setGallerySize:!0,imagesLoaded:!0,pageDots,prevNextButtons,on:{ready:()=>{const currentStyle=this.container.querySelector(`${selectors$2.item}[${attributes$1.slidePosition}="1"]`).getAttribute(attributes$1.style);this.container.setAttribute(attributes$1.currentStyle,currentStyle),requestAnimationFrame(this.resizeEvent),document.addEventListener("theme:vars",this.resizeEvent)},change:index=>{const currentStyle=this.flkty.selectedElement.getAttribute(attributes$1.style);this.container.setAttribute(attributes$1.currentStyle,currentStyle),this.flkty.cells.forEach((slide,i)=>
63{slide.element.querySelectorAll(selectors$2.links).forEach(link=>{link.setAttribute(attributes$1.tabIndex,i===index?"0":"-1")})})}}}),flickitySmoothScrolling(this.container);else if(slidesCount===1){const currentStyle=this.container.querySelector(selectors$2.item).getAttribute(attributes$1.style);this.container.setAttribute(attributes$1.currentStyle,currentStyle)}}bindScrollButton(){const arrowDown=this.container.querySelector(selectors$2.arrowScrollDown);arrowDown&&arrowDown.addEventListener("click",e=>{e.preventDefault();const headerHeight=this.header.classList.contains(classes$2.headerFixed)?60:0,scrollToPosition=parseInt(Math.ceil(this.container.offsetTop+this.container.offsetHeight-headerHeight));window.scrollTo({top:scrollToPosition,left:0,behavior:"smooth"})})}onBlockSelect(evt){const slide=evt.target.closest(selectors$2.item);if(!slide||!this.container.contains(slide))return;const index=parseInt(slide.getAttribute(attributes$1.slidePosition),10)-1;if(this.flkty!==null&&index>=0){this.flkty.select(index),this.flkty.pausePlayer();return}this.container.querySelectorAll(selectors$2.item).forEach(item=>{const selected=item===slide;item.classList.toggle("is-selected",selected),item.style.visibility=selected?"visible":"hidden"});const style=slide.getAttribute(attributes$1.style);style&&this.container.setAttribute(attributes$1.currentStyle,style)}onBlockDeselect(evt){evt.target.closest(selectors$2.slider).dataset.autoplay==="true"&&this.flkty!==null&&this.flkty.playPlayer()}onReorder(){this.flkty!==null&&this.flkty.resize()}onUnload(){this.flkty!==null&&(document.removeEventListener("theme:vars",this.resizeEvent),this.flkty.destroy(),this.flkty=null)}}register("slider",[{onLoad(){sections$1[this.id]=new Slider(this)},onReorder(e){sections$1[this.id].onReorder(e)},onUnload(e){sections$1[this.id].onUnload(e)},onBlockSelect(e){sections$1[this.id].onBlockSelect(e)},onBlockDeselect(e){sections$1[this.id].onBlockDeselect(e)}},videoPlay,zoomAnimation]),register("subcollections",gridSlider),register("tab-collections",[productGrid,gridSlider,tabs]);const sections={},selectors$1={slider:"[data-slider]",item:"[data-item]"},classes$1={flickityEnabled:"flickity-enabled"},attributes={sectionId:"data-section-id"};class Testimonials{constructor(section){this.container=section.container,this.sectionId=this.container.getAttribute(attributes.sectionId),this.slider=this.container.querySelector(selectors$1.slider),this.sliderResizeEvent=()=>this.initSlider(),this.flkty=null,this.customReviews=[],reviewType=="both"||reviewType=="yotpo"?this.getReviews():this.initSlider(),document.addEventListener("theme:resize:width",this.sliderResizeEvent)}getReviews(){const self=this,url="https://api-cdn.yotpo.com/v1/widget/8ucu7fKpnSCnDRGNuR8e56FHREBFpvZZW4NcW75H/products/9066459070775/reviews.json",requests=reviewProducts.map(id=>fetch(`https://api-cdn.yotpo.com/v1/widget/8ucu7fKpnSCnDRGNuR8e56FHREBFpvZZW4NcW75H/products/${id}/reviews.json`).then(response=>{if(response.ok)return response.json();throw new Error(`Failed to fetch data for URL: ${url}. Status code: ${response.status}`)}).catch(error=>(console.error(error),null)));Promise.all(requests).then(responses=>{responses.forEach(data=>{data!==null&&data?.response?.reviews?.forEach(function(review){const template2=document.getElementById("review-template"),parent=self.slider,content=document.importNode(template2.content,!0),style=content.querySelector("style"),elementToCopy=content.querySelector(".testimonial__item");let fullStar="",emptyStar="";for(let i=0;i<review.score;i++)fullStar+='<svg width="25px" height="25px" style="margin-right: 10px" viewBox="0 0 25 25" class="icon icon-star icon-star--full"><polygon fill-rule="nonzero" points="16.2212909 8.77064179 12.5128412 0.870224269 8.80343056 8.77064179 0.512841234 10.0374085 6.51243703 16.1862739 5.09643337 24.8702243 12.5128412 20.7696377 19.9292491 24.8702243 18.5122845 16.1862739 24.5128412 10.0374085"></polygon></svg>';for(let i=0;i<5-review.score;i++)emptyStar+='<svg width="25px" height="25px" style="margin-right: 10px" viewBox="0 0 25 25" class="icon icon-star icon-star--empty">
63<polygon fill-rule="nonzero" points="16.2212909 8.77064179 12.5128412 0.870224269 8.80343056 8.77064179 0.512841234 10.0374085 6.51243703 16.1862739 5.09643337 24.8702243 12.5128412 20.7696377 19.9292491 24.8702243 18.5122845 16.1862739 24.5128412 10.0374085"></polygon></svg>';function truncateString(inputString){const words=inputString.split(" ");return words.length>25?words.slice(0,30).join(" ")+"...":inputString}elementToCopy.querySelector(".rating__star").style.display="flex",elementToCopy.querySelector(".rating__star").innerHTML=fullStar+emptyStar,elementToCopy.querySelector(".testimonial__text").innerHTML=truncateString(review.content),elementToCopy.querySelector(".testimonial__user__name").innerHTML=review.user.display_name,parent.insertBefore(style,parent.firstChild),parent.insertBefore(elementToCopy,parent.firstChild)})}),self.initSlider()}).catch(error=>{console.error(error)})}initSlider(){const slidesCount=this.slider.querySelectorAll(selectors$1.item).length;let flickityEnabled=this.slider.classList.contains(classes$1.flickityEnabled);if(slidesCount==2&&window.innerWidth>=theme.sizes.small||slidesCount==1||window.innerWidth<theme.sizes.small){flickityEnabled&&this.flkty.destroy();return}this.flkty=new Flickity(this.slider,{cellSelector:selectors$1.item,prevNextButtons:!0,pageDots:!1,groupCells:!0,cellAlign:"left",contain:!0,adaptiveHeight:!1}),this.flkty.resize(),this.flkty.slideableWidth>this.flkty.size.width||this.flkty.destroy()}onBlockSelect(evt){if(this.flkty!==null){const index=parseInt([...evt.target.parentNode.children].indexOf(evt.target)),slidesPerPage=parseInt(this.flkty.slides[0].cells.length),groupIndex=Math.floor(index/slidesPerPage);this.flkty.select(groupIndex)}else{const sliderStyle=this.slider.currentStyle||window.getComputedStyle(this.slider),sliderPadding=parseInt(sliderStyle.paddingLeft),blockPositionLeft=evt.target.offsetLeft-sliderPadding;this.slider.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}onUnload(){document.removeEventListener("theme:resize:width",this.sliderResizeEvent)}}register("testimonials",{onLoad(){sections[this.id]=new Testimonials(this)},onUnload(e){sections[this.id].onUnload(e)},onBlockSelect(e){sections[this.id].onBlockSelect(e)}});const classes={noOutline:"no-outline"},selectors={inPageLink:"[data-skip-content]",linkesWithOnlyHash:'a[href="#"]'};class Accessibility{constructor(){this.init()}init(){this.body=document.body,this.inPageLink=document.querySelector(selectors.inPageLink),this.linkesWithOnlyHash=document.querySelectorAll(selectors.linkesWithOnlyHash),this.isFocused=!1,this.focusHash(),this.bindInPageLinks(),this.clickEvents(),this.focusEvents(),this.focusEventsOff()}clickEvents(){this.inPageLink&&this.inPageLink.addEventListener("click",event=>{event.preventDefault()}),this.linkesWithOnlyHash&&this.linkesWithOnlyHash.forEach(item=>{item.addEventListener("click",event=>{event.preventDefault()})})}focusEvents(){document.addEventListener("keyup",event=>{event.code===theme.keyboardKeys.TAB&&(this.body.classList.remove(classes.noOutline),this.isFocused=!0)})}focusEventsOff(){document.addEventListener("mousedown",()=>{this.body.classList.add(classes.noOutline),this.isFocused=!1})}forceFocus(element,options2){options2=options2||{};var savedTabIndex=element.tabIndex;element.tabIndex=-1,element.dataset.tabIndex=savedTabIndex,element.focus(),typeof options2.className<"u"&&element.classList.add(options2.className),element.addEventListener("blur",callback);function callback(event){event.target.removeEventListener(event.type,callback),element.tabIndex=savedTabIndex,delete element.dataset.tabIndex,typeof options2.className<"u"&&element.classList.remove(options2.className)}}focusHash(options2){options2=options2||{};let hash=window.location.hash;typeof theme.settings.newHash<"u"&&(hash=theme.settings.newHash,window.location.hash=`#${hash}`);const element=document.getElementById(hash.slice(1));if(element&&options2.ignore&&element.matches(options2.ignore))return!1;hash&&element&&this.forceFocus(element,options2)}bindInPageLinks(options2){options2=options2||{};const links=Array.prototype.slice.call(document.querySelectorAll('a[href^="#"]'));function queryCheck(selector){return document.getElementById(selector)!==null}return links.filter(link=>{if(link.hash==="#"||link.hash===""||options2.ignore&&link.matches(options2.ignore)||!queryCheck(link.hash.substr(1)))return!1;var element=document.querySelector(link.hash);return element?(link.addEventListener("click",()=>{this.forceFocus(element,options2)}),!0):!1})}}const getScrollbarWidth=()=>{const outer=document.createElement("div");outer.style.visibility="hidden",outer.style.overflow="scroll",outer.style.msOverflowStyle="scrollbar",document.body.appendChild(outer);const inner=document.createElement("div");outer.appendChild(inner);const scrollbarWidth=outer.offsetWidth-inner.offsetWidth;return outer.parentNode.removeChild(outer),scrollbarWidth};document.documentElement.style.setProperty("--scrollbar-width",`${getScrollbarWidth()}px`),document.addEventListener("DOMContentLoaded",function(){load("*"),document.body.dataset.animations==="true"&&AOS.init({once:!0,offset:50,duration:600,startEvent:"load"}),new Accessibility,!customElements.get("product-grid-item-swatch")&&window.theme.settings.enableColorSwatchesCollection&&customElements.define("product-grid-item-swatch",GridSwatch),"scrollBehavior"in document.documentElement.style||loadScript({url:theme.assets.smoothscroll})})})(themeVendor.ScrollLock,themeVendor.Flickity,themeVendor.themeCurrency,themeVendor.ajaxinate,themeVendor.AOS); 64//# sourceMappingURL=/cdn/shop/t/112/assets/theme.dev.js.map?v=3020917931916742931790093384
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.