/* @license Streamline by Archetype Themes (https://archetypethemes.co) Access unminified JS in assets/theme.js Use our custom event listeners to tap into common functions. Documentation - https://archetypethemes.co/blogs/streamline/javascript-events-for-developers document.addEventListener('page:loaded', function() { // Stylesheet and theme scripts have loaded }); */window.theme=window.theme||{},window.Shopify=window.Shopify||{},theme.bp={},theme.config={cssLoaded:!1,bpSmall:!1,hasSessionStorage:!0,mediaQuerySmall:"screen and (max-width: 768px)",youTubeReady:!1,vimeoReady:!1,vimeoLoading:!1,isSafari:!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/),isTouch:!!("ontouchstart"in window||window.DocumentTouch&&window.document instanceof DocumentTouch||window.navigator.maxTouchPoints||window.navigator.msMaxTouchPoints),rtl:document.documentElement.getAttribute("dir")=="rtl"},console&&console.log&&console.log("Streamline theme ("+theme.settings.themeVersion+") by ARCH\u039ETYPE | Learn more at https://archetypethemes.co"),window.lazySizesConfig=window.lazySizesConfig||{},lazySizesConfig.expFactor=4,theme.config.bpSmall=matchMedia(theme.config.mediaQuerySmall).matches,matchMedia(theme.config.mediaQuerySmall).addListener(function(mql){mql.matches?(theme.config.bpSmall=!0,document.dispatchEvent(new CustomEvent("matchSmall"))):(theme.config.bpSmall=!1,document.dispatchEvent(new CustomEvent("unmatchSmall")))}),function(){"use strict";theme.delegate={on:function(event2,callback,options){return this.namespaces||(this.namespaces={}),this.namespaces[event2]=callback,options=options||!1,this.addEventListener(event2.split(".")[0],callback,options),this},off:function(event2){if(this.namespaces)return this.removeEventListener(event2.split(".")[0],this.namespaces[event2]),delete this.namespaces[event2],this}},window.on=Element.prototype.on=theme.delegate.on,window.off=Element.prototype.off=theme.delegate.off,theme.utils={defaultTo:function(value,defaultValue){return value==null||value!==value?defaultValue:value},wrap:function(el,wrapper){el.parentNode.insertBefore(wrapper,el),wrapper.appendChild(el)},debounce:function(wait,callback,immediate){var timeout;return function(){var context=this,args=arguments,later=function(){timeout=null,immediate||callback.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&callback.apply(context,args)}},throttle:function(limit,callback){var waiting=!1;return function(){waiting||(callback.apply(this,arguments),waiting=!0,setTimeout(function(){waiting=!1},limit))}},prepareTransition:function(el,callback){el.addEventListener("transitionend",removeClass);function removeClass(evt){el.classList.remove("is-transitioning"),el.removeEventListener("transitionend",removeClass)}el.classList.add("is-transitioning"),el.offsetWidth,typeof callback=="function"&&callback()},compact:function(array){for(var index=-1,length=array==null?0:array.length,resIndex=0,result=[];++index-1)){if(field.type==="select-multiple"){Array.prototype.slice.call(field.options).forEach(function(option){option.selected&&arr.push(encodeURIComponent(field.name)+"="+encodeURIComponent(option.value))});return}["checkbox","radio"].indexOf(field.type)>-1&&!field.checked||arr.push(encodeURIComponent(field.name)+"="+encodeURIComponent(field.value))}}),arr.join("&")}},theme.a11y={trapFocus:function(options){var eventsName={focusin:options.namespace?"focusin."+options.namespace:"focusin",focusout:options.namespace?"focusout."+options.namespace:"focusout",keydown:options.namespace?"keydown."+options.namespace:"keydown.handleFocus"},focusableEls=options.container.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex^="-"])'),elArray=[].slice.call(focusableEls),focusableElements=elArray.filter(el=>el.offsetParent!==null),firstFocusable=focusableElements[0],lastFocusable=focusableElements[focusableElements.length-1];options.elementToFocus||(options.elementToFocus=options.container),options.container.setAttribute("tabindex","-1"),options.elementToFocus.focus(),document.documentElement.off("focusin"),document.documentElement.on(eventsName.focusout,function(){document.documentElement.off(eventsName.keydown)}),document.documentElement.on(eventsName.focusin,function(evt){evt.target!==lastFocusable&&evt.target!==firstFocusable||document.documentElement.on(eventsName.keydown,function(evt2){_manageFocus(evt2)})});function _manageFocus(evt){evt.keyCode===9&&evt.target===firstFocusable&&evt.shiftKey&&(evt.preventDefault(),lastFocusable.focus())}},removeTrapFocus:function(options){var eventName=options.namespace?"focusin."+options.namespace:"focusin";options.container&&options.container.removeAttribute("tabindex"),document.documentElement.off(eventName)},lockMobileScrolling:function(namespace,element){var el=element||document.documentElement;document.documentElement.classList.add("lock-scroll"),el.on("touchmove"+namespace,function(){return!0})},unlockMobileScrolling:function(namespace,element){document.documentElement.classList.remove("lock-scroll");var el=element||document.documentElement;el.off("touchmove"+namespace)}},document.documentElement.on("keyup.tab",function(evt){evt.keyCode===9&&(document.documentElement.classList.add("tab-outline"),document.documentElement.off("keyup.tab"))}),theme.Sections=function(){this.constructors={},this.instances=[],document.addEventListener("shopify:section:load",this._onSectionLoad.bind(this)),document.addEventListener("shopify:section:unload",this._onSectionUnload.bind(this)),document.addEventListener("shopify:section:select",this._onSelect.bind(this)),document.addEventListener("shopify:section:deselect",this._onDeselect.bind(this)),document.addEventListener("shopify:block:select",this._onBlockSelect.bind(this)),document.addEventListener("shopify:block:deselect",this._onBlockDeselect.bind(this))},theme.Sections.prototype=Object.assign({},theme.Sections.prototype,{_createInstance:function(container,constructor,scope){var id=container.getAttribute("data-section-id"),type=container.getAttribute("data-section-type");if(constructor=constructor||this.constructors[type],!(typeof constructor>"u")){if(scope){var instanceExists=this._findInstance(id);instanceExists&&this._removeInstance(id)}try{var instance=Object.assign(new constructor(container),{id,type,container});this.instances.push(instance)}catch(e){console.error(e)}}},_findInstance:function(id){for(var i=0;i{this._onSectionLoad(null,el,el.dataset.sectionId)})}},_onSelect:function(evt){var instance=this._findInstance(evt.detail.sectionId);typeof instance<"u"&&typeof instance.onSelect=="function"&&instance.onSelect(evt)},_onDeselect:function(evt){var instance=this._findInstance(evt.detail.sectionId);typeof instance<"u"&&typeof instance.onDeselect=="function"&&instance.onDeselect(evt)},_onBlockSelect:function(evt){var instance=this._findInstance(evt.detail.sectionId);typeof instance<"u"&&typeof instance.onBlockSelect=="function"&&instance.onBlockSelect(evt)},_onBlockDeselect:function(evt){var instance=this._findInstance(evt.detail.sectionId);typeof instance<"u"&&typeof instance.onBlockDeselect=="function"&&instance.onBlockDeselect(evt)},register:function(type,constructor,scope){this.constructors[type]=constructor;var sections2=document.querySelectorAll('[data-section-type="'+type+'"]');scope&&(sections2=scope.querySelectorAll('[data-section-type="'+type+'"]')),sections2.forEach(function(container){this._createInstance(container,constructor,scope)}.bind(this))},reinit:function(section){for(var i=0;i")+"");break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",","),superScript&&value&&value.includes(".")&&(value=value.replace(",","")+"");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break;case"amount_no_decimals_with_space_separator":value=formatWithDelimiters(cents,0," ");break}return formatString.replace(placeholderRegex,value)}function getBaseUnit(variant){if(variant&&!(!variant.unit_price_measurement||!variant.unit_price_measurement.reference_value))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}return{formatMoney,getBaseUnit}}(),theme.Images=function(){function imageSize(src){if(!src)return"620x";var match=src.match(/.+_((?:pico|icon|thumb|small|compact|medium|large|grande)|\d{1,4}x\d{0,4}|x\d{1,4})[_\.@]/);return match!==null?match[1]:null}function getSizedImageUrl(src,size){if(!src||size==null)return src;if(size==="master")return this.removeProtocol(src);var match=src.match(/\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?$/i);if(match!=null){var prefix=src.split(match[0]),suffix=match[0];return this.removeProtocol(prefix[0]+"_"+size+suffix)}return null}function removeProtocol(path){return path.replace(/http(s)?:/,"")}function lazyloadImagePath(string){var image;return string!==null&&(image=string.replace(/(\.[^.]*)$/,"_{width}x$1")),image}return{imageSize,getSizedImageUrl,removeProtocol,lazyloadImagePath}}(),theme.loadImageSection=function(container){function setAsLoaded(){container.classList.remove("loading","loading--delayed"),container.classList.add("loaded")}function checkForLazyloadedImage(){return container.querySelector(".lazyloaded")}if(container.querySelector("svg")){setAsLoaded();return}if(checkForLazyloadedImage()){setAsLoaded();return}var interval=setInterval(function(){checkForLazyloadedImage()&&(clearInterval(interval),setAsLoaded())},25)},theme.initWhenVisible=function(options){var threshold=options.threshold?options.threshold:0,observer=new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{entry.isIntersecting&&typeof options.callback=="function"&&(options.callback(),observer2.unobserve(entry.target))})},{rootMargin:"0px 0px "+threshold+"px 0px"});observer.observe(options.element)},theme.Variants=function(){function Variants(options){this.container=options.container,this.variants=options.variants,this.singleOptionSelector=options.singleOptionSelector,this.originalSelectorId=options.originalSelectorId,this.enableHistoryState=options.enableHistoryState,this.currentVariant=this._getVariantFromOptions(),this.container.querySelectorAll(this.singleOptionSelector).forEach(el=>{el.addEventListener("change",this._onSelectChange.bind(this))})}return Variants.prototype=Object.assign({},Variants.prototype,{_getCurrentOptions:function(){var result=[];return this.container.querySelectorAll(this.singleOptionSelector).forEach(el=>{var type=el.getAttribute("type");type==="radio"||type==="checkbox"?el.checked&&result.push({value:el.value,index:el.dataset.index}):result.push({value:el.value,index:el.dataset.index})}),result=theme.utils.compact(result),result},_getVariantFromOptions:function(){var selectedValues=this._getCurrentOptions(),variants=this.variants,found=!1;return variants.forEach(function(variant){var match=!0,options=variant.options;selectedValues.forEach(function(option){match&&(match=variant[option.index]===option.value)}),match&&(found=variant)}),found||null},_onSelectChange:function(){var variant=this._getVariantFromOptions();this.container.dispatchEvent(new CustomEvent("variantChange",{detail:{variant}})),document.dispatchEvent(new CustomEvent("variant:change",{detail:{variant}})),variant&&(this._updateMasterSelect(variant),this._updateImages(variant),this._updatePrice(variant),this._updateUnitPrice(variant),this._updateSKU(variant),this.currentVariant=variant,this.enableHistoryState&&this._updateHistoryState(variant))},_updateImages:function(variant){var variantImage=variant.featured_image||{},currentVariantImage=this.currentVariant.featured_image||{};!variant.featured_image||variantImage.src===currentVariantImage.src||this.container.dispatchEvent(new CustomEvent("variantImageChange",{detail:{variant}}))},_updatePrice:function(variant){variant.price===this.currentVariant.price&&variant.compare_at_price===this.currentVariant.compare_at_price||this.container.dispatchEvent(new CustomEvent("variantPriceChange",{detail:{variant}}))},_updateUnitPrice:function(variant){variant.unit_price!==this.currentVariant.unit_price&&this.container.dispatchEvent(new CustomEvent("variantUnitPriceChange",{detail:{variant}}))},_updateSKU:function(variant){variant.sku!==this.currentVariant.sku&&this.container.dispatchEvent(new CustomEvent("variantSKUChange",{detail:{variant}}))},_updateHistoryState:function(variant){if(!(!history.replaceState||!variant)){var newurl=window.location.protocol+"//"+window.location.host+window.location.pathname+"?variant="+variant.id;window.history.replaceState({path:newurl},"",newurl)}},_updateMasterSelect:function(variant){this.container.querySelector(this.originalSelectorId).value=variant.id,this.container.querySelector(this.originalSelectorId).dispatchEvent(new Event("change",{bubbles:!0}))}}),Variants}(),theme.rteInit=function(){document.querySelectorAll(".rte table").forEach(table=>{var wrapWith=document.createElement("div");wrapWith.classList.add("table-wrapper"),theme.utils.wrap(table,wrapWith)}),document.querySelectorAll('.rte iframe[src*="youtube.com/embed"]').forEach(iframe=>{wrapVideo(iframe)}),document.querySelectorAll('.rte iframe[src*="player.vimeo"]').forEach(iframe=>{wrapVideo(iframe)});function wrapVideo(iframe){iframe.src=iframe.src;var wrapWith=document.createElement("div");wrapWith.classList.add("video-wrapper"),theme.utils.wrap(iframe,wrapWith)}document.querySelectorAll(".rte a img").forEach(img=>{img.parentNode.classList.add("rte__image")})},theme.LibraryLoader=function(){var types={link:"link",script:"script"},status={requested:"requested",loaded:"loaded"},cloudCdn="https://cdn.shopify.com/shopifycloud/",libraries={youtubeSdk:{tagId:"youtube-sdk",src:"https://www.youtube.com/iframe_api",type:types.script},vimeo:{tagId:"vimeo-api",src:"https://player.vimeo.com/api/player.js",type:types.script},shopifyXr:{tagId:"shopify-model-viewer-xr",src:cloudCdn+"shopify-xr-js/assets/v1.0/shopify-xr.en.js",type:types.script},modelViewerUi:{tagId:"shopify-model-viewer-ui",src:cloudCdn+"model-viewer-ui/assets/v1.0/model-viewer-ui.en.js",type:types.script},modelViewerUiStyles:{tagId:"shopify-model-viewer-ui-styles",src:cloudCdn+"model-viewer-ui/assets/v1.0/model-viewer-ui.css",type:types.link}};function load(libraryName,callback){var library=libraries[libraryName];if(library&&library.status!==status.requested){if(callback=callback||function(){},library.status===status.loaded){callback();return}library.status=status.requested;var tag;switch(library.type){case types.script:tag=createScriptTag(library,callback);break;case types.link:tag=createLinkTag(library,callback);break}tag.id=library.tagId,library.element=tag;var firstScriptTag=document.getElementsByTagName(library.type)[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}}function createScriptTag(library,callback){var tag=document.createElement("script");return tag.src=library.src,tag.addEventListener("load",function(){library.status=status.loaded,callback()}),tag}function createLinkTag(library,callback){var tag=document.createElement("link");return tag.href=library.src,tag.rel="stylesheet",tag.type="text/css",tag.addEventListener("load",function(){library.status=status.loaded,callback()}),tag}return{load}}(),window.vimeoApiReady=function(){theme.config.vimeoLoading=!0,checkIfVimeoIsReady().then(function(){theme.config.vimeoReady=!0,theme.config.vimeoLoading=!1,document.dispatchEvent(new CustomEvent("vimeoReady"))})};function checkIfVimeoIsReady(){var wait,timeout,deferred=new Promise((resolve,reject)=>{wait=setInterval(function(){Vimeo&&(clearInterval(wait),clearTimeout(timeout),resolve())},500),timeout=setTimeout(function(){clearInterval(wait),reject()},4e3)});return deferred}if(theme.VimeoPlayer=function(){var classes={loading:"loading",loaded:"loaded",interactable:"video-interactable"},defaults={background:!0,byline:!1,controls:!1,loop:!0,muted:!0,playsinline:!0,portrait:!1,title:!1};function VimeoPlayer(divId,videoId,options){this.divId=divId,this.el=document.getElementById(divId),this.videoId=videoId,this.iframe=null,this.options=options,this.options&&this.options.videoParent&&(this.parent=this.el.closest(this.options.videoParent)),this.setAsLoading(),theme.config.vimeoReady?this.init():(theme.LibraryLoader.load("vimeo",window.vimeoApiReady),document.addEventListener("vimeoReady",this.init.bind(this)))}return VimeoPlayer.prototype=Object.assign({},VimeoPlayer.prototype,{init:function(){var args=defaults;args.id=this.videoId,this.videoPlayer=new Vimeo.Player(this.el,args),this.videoPlayer.ready().then(this.playerReady.bind(this))},playerReady:function(){this.iframe=this.el.querySelector("iframe"),this.iframe.setAttribute("tabindex","-1"),this.videoPlayer.setMuted(!0),this.setAsLoaded();var observer=new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{entry.isIntersecting?this.play():this.pause()})},{rootMargin:"0px 0px 50px 0px"});observer.observe(this.iframe)},setAsLoading:function(){this.parent&&this.parent.classList.add(classes.loading)},setAsLoaded:function(){this.parent&&(this.parent.classList.remove(classes.loading),this.parent.classList.add(classes.loaded),Shopify&&Shopify.designMode&&window.AOS&&AOS.refreshHard())},enableInteraction:function(){this.parent&&this.parent.classList.add(classes.interactable)},play:function(){this.videoPlayer&&typeof this.videoPlayer.play=="function"&&this.videoPlayer.play()},pause:function(){this.videoPlayer&&typeof this.videoPlayer.pause=="function"&&this.videoPlayer.pause()},destroy:function(){this.videoPlayer&&typeof this.videoPlayer.destroy=="function"&&this.videoPlayer.destroy()}}),VimeoPlayer}(),window.onYouTubeIframeAPIReady=function(){theme.config.youTubeReady=!0,document.dispatchEvent(new CustomEvent("youTubeReady"))},theme.YouTube=function(){var classes={loading:"loading",loaded:"loaded",interactable:"video-interactable"},defaults={width:1280,height:720,playerVars:{autohide:0,autoplay:1,cc_load_policy:0,controls:0,fs:0,iv_load_policy:3,modestbranding:1,playsinline:1,rel:0}};function YouTube(divId,options){this.divId=divId,this.iframe=null,this.attemptedToPlay=!1,defaults.events={onReady:this.onVideoPlayerReady.bind(this),onStateChange:this.onVideoStateChange.bind(this)},this.options=Object.assign({},defaults,options),this.options&&(this.options.videoParent&&(this.parent=document.getElementById(this.divId).closest(this.options.videoParent)),this.options.autoplay||(this.options.playerVars.autoplay=this.options.autoplay),this.options.style==="sound"&&(this.options.playerVars.controls=1,this.options.playerVars.autoplay=0)),this.setAsLoading(),theme.config.youTubeReady?this.init():(theme.LibraryLoader.load("youtubeSdk"),document.addEventListener("youTubeReady",this.init.bind(this)))}return YouTube.prototype=Object.assign({},YouTube.prototype,{init:function(){this.videoPlayer=new YT.Player(this.divId,this.options)},onVideoPlayerReady:function(evt){this.iframe=document.getElementById(this.divId),this.iframe.setAttribute("tabindex","-1"),this.options.style!=="sound"&&evt.target.mute();var observer=new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{entry.isIntersecting?this.play():this.pause()})},{rootMargin:"0px 0px 50px 0px"});observer.observe(this.iframe)},onVideoStateChange:function(evt){switch(evt.data){case-1:this.attemptedToPlay&&(this.setAsLoaded(),this.enableInteraction());break;case 0:this.play(evt);break;case 1:this.setAsLoaded();break;case 3:this.attemptedToPlay=!0;break}},setAsLoading:function(){this.parent&&this.parent.classList.add(classes.loading)},setAsLoaded:function(){this.parent&&(this.parent.classList.remove(classes.loading),this.parent.classList.add(classes.loaded),Shopify&&Shopify.designMode&&window.AOS&&AOS.refreshHard())},enableInteraction:function(){this.parent&&this.parent.classList.add(classes.interactable)},play:function(){this.videoPlayer&&typeof this.videoPlayer.playVideo=="function"&&this.videoPlayer.playVideo()},pause:function(){this.videoPlayer&&typeof this.videoPlayer.pauseVideo=="function"&&this.videoPlayer.pauseVideo()},destroy:function(){this.videoPlayer&&typeof this.videoPlayer.destroy=="function"&&this.videoPlayer.destroy()}}),YouTube}(),function(){var originalResizeMethod=Flickity.prototype.resize,lastWidth=window.innerWidth;Flickity.prototype.resize=function(){window.innerWidth!==lastWidth&&(lastWidth=window.innerWidth,originalResizeMethod.apply(this,arguments))}}(),function(){var e=!1,t;document.body.addEventListener("touchstart",function(i){if(!i.target.closest(".flickity-slider"))return e=!1;e=!0,t={x:i.touches[0].pageX,y:i.touches[0].pageY}}),document.body.addEventListener("touchmove",function(i){if(e&&i.cancelable){var n={x:i.touches[0].pageX-t.x,y:i.touches[0].pageY-t.y};Math.abs(n.x)>Flickity.defaults.dragThreshold&&i.preventDefault()}},{passive:!1})}(),theme.AjaxRenderer=function(){function AjaxRenderer({sections:sections2,preserveParams,onReplace,debug}={}){this.sections=sections2||[],this.preserveParams=preserveParams||[],this.cachedSections=[],this.onReplace=onReplace,this.debug=!!debug}return AjaxRenderer.prototype=Object.assign({},AjaxRenderer.prototype,{renderPage:function(basePath,searchParams,updateURLHash=!0){searchParams&&this.appendPreservedParams(searchParams);const sectionRenders=this.sections.map(section=>{const url=`${basePath}?section_id=${section.sectionId}&${searchParams}`,cachedSectionUrl=cachedSection=>cachedSection.url===url;return this.cachedSections.some(cachedSectionUrl)?this.renderSectionFromCache(cachedSectionUrl,section):this.renderSectionFromFetch(url,section)});return updateURLHash&&this.updateURLHash(searchParams),Promise.all(sectionRenders)},renderSectionFromCache:function(url,section){const cachedSection=this.cachedSections.find(url);return this.log(`[AjaxRenderer] rendering from cache: url=${cachedSection.url}`),this.renderSection(cachedSection.html,section),Promise.resolve(section)},renderSectionFromFetch:function(url,section){return this.log(`[AjaxRenderer] redering from fetch: url=${url}`),new Promise((resolve,reject)=>{fetch(url).then(response=>response.text()).then(responseText=>{const html=responseText;this.cachedSections=[...this.cachedSections,{html,url}],this.renderSection(html,section),resolve(section)}).catch(err=>reject(err))})},renderSection:function(html,section){this.log(`[AjaxRenderer] rendering section: section=${JSON.stringify(section)}`);const newDom=new DOMParser().parseFromString(html,"text/html");return this.onReplace?this.onReplace(newDom,section):typeof section.nodeId=="string"?document.getElementById(section.nodeId).innerHTML=newDom.getElementById(section.nodeId).innerHTML:section.nodeId.forEach(id=>{document.getElementById(id).innerHTML=newDom.getElementById(id).innerHTML}),section},appendPreservedParams:function(searchParams){this.preserveParams.forEach(paramName=>{const param=new URLSearchParams(window.location.search).get(paramName);param&&(this.log(`[AjaxRenderer] Preserving ${paramName} param`),searchParams.append(paramName,param))})},updateURLHash:function(searchParams){history.pushState({},"",`${window.location.pathname}${searchParams&&"?".concat(searchParams)}`)},log:function(...args){this.debug&&console.log(...args)}}),AjaxRenderer}(),theme.cart={getCart:function(){var url="".concat(theme.routes.cart,"?t=").concat(Date.now());return fetch(url,{credentials:"same-origin",method:"GET"}).then(response=>response.json())},getCartProductMarkup:function(){var url="".concat(theme.routes.cartPage,"?t=").concat(Date.now());return url=url.indexOf("?")===-1?url+"?view=ajax":url+"&view=ajax",fetch(url,{credentials:"same-origin",method:"GET"}).then(function(response){return response.text()})},changeItem:function(key,qty){return this._updateCart({url:"".concat(theme.routes.cartChange,"?t=").concat(Date.now()),data:JSON.stringify({id:key,quantity:qty})})},_updateCart:function(params){return fetch(params.url,{method:"POST",body:params.data,credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(response=>response.json()).then(function(cart){return cart})},updateAttribute:function(key,value){return this._updateCart({url:"/cart/update.js",data:JSON.stringify({attributes:{[key]:theme.cart.attributeToString(value)}})})},updateNote:function(note){return this._updateCart({url:"/cart/update.js",data:JSON.stringify({note:theme.cart.attributeToString(note)})})},attributeToString:function(attribute){return typeof attribute!="string"&&(attribute+="",attribute==="undefined"&&(attribute="")),attribute.trim()}},theme.CartForm=function(){var selectors={products:"[data-products]",qtySelector:".js-qty__wrapper",discounts:"[data-discounts]",savings:"[data-savings]",subTotal:"[data-subtotal]",cartBubble:".cart-link__bubble",cartNote:'[name="note"]',termsCheckbox:".cart__terms-checkbox",checkoutBtn:".cart__checkout"},classes={btnLoading:"btn--loading"},config={requiresTerms:!1};function CartForm(form){form&&(this.form=form,this.wrapper=form.parentNode,this.location=form.dataset.location,this.namespace=".cart-"+this.location,this.products=form.querySelector(selectors.products),this.submitBtn=form.querySelector(selectors.checkoutBtn),this.discounts=form.querySelector(selectors.discounts),this.savings=form.querySelector(selectors.savings),this.subtotal=form.querySelector(selectors.subTotal),this.termsCheckbox=form.querySelector(selectors.termsCheckbox),this.noteInput=form.querySelector(selectors.cartNote),this.termsCheckbox&&(config.requiresTerms=!0),this.init())}return CartForm.prototype=Object.assign({},CartForm.prototype,{init:function(){this.initQtySelectors(),document.addEventListener("cart:quantity"+this.namespace,this.quantityChanged.bind(this)),this.form.on("submit"+this.namespace,this.onSubmit.bind(this)),this.noteInput&&this.noteInput.addEventListener("change",function(){var newNote=this.value;theme.cart.updateNote(newNote)}),document.addEventListener("cart:build",function(){this.buildCart()}.bind(this))},reInit:function(){this.initQtySelectors()},onSubmit:function(evt){if(this.submitBtn.classList.add(classes.btnLoading),config.requiresTerms&&!this.termsCheckbox.checked)return alert(theme.strings.cartTermsConfirmation),this.submitBtn.classList.remove(classes.btnLoading),evt.preventDefault(),!1},_parseProductHTML:function(html){var parser=new DOMParser,doc=parser.parseFromString(html,"text/html");return{items:doc.querySelector(".cart__items"),discounts:doc.querySelector(".cart__discounts")}},buildCart:function(){theme.cart.getCartProductMarkup().then(this.cartMarkup.bind(this))},cartMarkup:function(html){var markup=this._parseProductHTML(html),items=markup.items,count=parseInt(items.dataset.count),subtotal=items.dataset.cartSubtotal,savings=items.dataset.cartSavings;this.updateCartDiscounts(markup.discounts),this.updateSavings(savings),count>0?this.wrapper.classList.remove("is-empty"):this.wrapper.classList.add("is-empty"),this.updateCount(count),this.products.innerHTML="",this.products.append(items),this.subtotal.innerHTML=theme.Currency.formatMoney(subtotal,theme.settings.moneyFormat),this.reInit(),window.AOS&&AOS.refreshHard(),Shopify&&Shopify.StorefrontExpressButtons&&Shopify.StorefrontExpressButtons.initialize()},updateCartDiscounts:function(markup){this.discounts&&(this.discounts.innerHTML="",this.discounts.append(markup))},initQtySelectors:function(){this.form.querySelectorAll(selectors.qtySelector).forEach(el=>{var selector=new theme.QtySelector(el,{namespace:this.namespace,isCart:!0})})},quantityChanged:function(evt){var key=evt.detail[0],qty=evt.detail[1],el=evt.detail[2];!key||!qty||(el&&el.classList.add("is-loading"),theme.cart.changeItem(key,qty).then(function(cart){cart.item_count>0?this.wrapper.classList.remove("is-empty"):this.wrapper.classList.add("is-empty"),this.buildCart(),document.dispatchEvent(new CustomEvent("cart:updated",{detail:{cart}}))}.bind(this)).catch(function(XMLHttpRequest){}))},updateSubtotal:function(subtotal){this.form.querySelector(selectors.subTotal).innerHTML=theme.Currency.formatMoney(subtotal,theme.settings.moneyFormat)},updateSavings:function(savings){if(this.savings)if(savings>0){var amount=theme.Currency.formatMoney(savings,theme.settings.moneyFormat);this.savings.classList.remove("hide"),this.savings.innerHTML=theme.strings.cartSavings.replace("[savings]",amount)}else this.savings.classList.add("hide")},updateCount:function(count){var countEls=document.querySelectorAll(".cart-link__bubble-num");countEls.length&&countEls.forEach(el=>{el.innerText=count});var bubbles=document.querySelectorAll(selectors.cartBubble);bubbles.length&&(count>0?bubbles.forEach(b=>{b.classList.add("cart-link__bubble--visible")}):bubbles.forEach(b=>{b.classList.remove("cart-link__bubble--visible")}))}}),CartForm}(),theme.collapsibles=function(){var selectors={trigger:".collapsible-trigger",module:".collapsible-content",moduleInner:".collapsible-content__inner",tabs:".collapsible-trigger--tab"},classes={hide:"hide",open:"is-open",autoHeight:"collapsible--auto-height",tabs:"collapsible-trigger--tab"},namespace=".collapsible",isTransitioning=!1;function init(scope){var el=scope||document;el.querySelectorAll(selectors.trigger).forEach(trigger=>{var state=trigger.classList.contains(classes.open);trigger.setAttribute("aria-expanded",state),trigger.off("click"+namespace),trigger.on("click"+namespace,toggle)})}function toggle(evt){if(!isTransitioning){isTransitioning=!0;var el=evt.currentTarget,isOpen=el.classList.contains(classes.open),isTab=el.classList.contains(classes.tabs),moduleId=el.getAttribute("aria-controls"),container=document.getElementById(moduleId);if(moduleId||(moduleId=el.dataset.controls),!!moduleId){if(!container){var multipleMatches=document.querySelectorAll('[data-id="'+moduleId+'"]');multipleMatches.length>0&&(container=el.parentNode.querySelector('[data-id="'+moduleId+'"]'))}if(!container){isTransitioning=!1;return}var height=container.querySelector(selectors.moduleInner).offsetHeight,isAutoHeight=container.classList.contains(classes.autoHeight),parentCollapsibleEl=container.parentNode.closest(selectors.module),childHeight=height;if(isTab){if(isOpen){isTransitioning=!1;return}var newModule;document.querySelectorAll(selectors.tabs+'[data-id="'+el.dataset.id+'"]').forEach(el2=>{el2.classList.remove(classes.open),newModule=document.querySelector("#"+el2.getAttribute("aria-controls")),setTransitionHeight(newModule,0,!0)})}if(isOpen&&isAutoHeight&&setTimeout(function(){height=0,setTransitionHeight(container,height,isOpen,isAutoHeight)},0),isOpen&&!isAutoHeight&&(height=0),el.setAttribute("aria-expanded",!isOpen),isOpen?el.classList.remove(classes.open):el.classList.add(classes.open),setTransitionHeight(container,height,isOpen,isAutoHeight),parentCollapsibleEl){var totalHeight=isOpen?parentCollapsibleEl.offsetHeight-childHeight:height+parentCollapsibleEl.offsetHeight;setTransitionHeight(parentCollapsibleEl,totalHeight,!1,!1)}if(window.SPR){var btn=container.querySelector(".spr-summary-actions-newreview");if(!btn)return;btn.off("click"+namespace),btn.on("click"+namespace,function(){height=container.querySelector(selectors.moduleInner).offsetHeight,setTransitionHeight(container,height,isOpen,isAutoHeight)})}}}}function setTransitionHeight(container,height,isOpen,isAutoHeight){if(container.classList.remove(classes.hide),theme.utils.prepareTransition(container,function(){container.style.height=height+"px",isOpen?container.classList.remove(classes.open):container.classList.add(classes.open)}),!isOpen&&isAutoHeight){var o=container;window.setTimeout(function(){o.css("height","auto"),isTransitioning=!1},500)}else isTransitioning=!1}return{init}}(),theme.Disclosure=function(){var selectors={disclosureForm:"[data-disclosure-form]",disclosureList:"[data-disclosure-list]",disclosureToggle:"[data-disclosure-toggle]",disclosureInput:"[data-disclosure-input]",disclosureOptions:"[data-disclosure-option]"},classes={listVisible:"disclosure-list--visible"};function Disclosure(disclosure){this.container=disclosure,this._cacheSelectors(),this._setupListeners()}return Disclosure.prototype=Object.assign({},Disclosure.prototype,{_cacheSelectors:function(){this.cache={disclosureForm:this.container.closest(selectors.disclosureForm),disclosureList:this.container.querySelector(selectors.disclosureList),disclosureToggle:this.container.querySelector(selectors.disclosureToggle),disclosureInput:this.container.querySelector(selectors.disclosureInput),disclosureOptions:this.container.querySelectorAll(selectors.disclosureOptions)}},_setupListeners:function(){this.eventHandlers=this._setupEventHandlers(),this.cache.disclosureToggle.addEventListener("click",this.eventHandlers.toggleList),this.cache.disclosureOptions.forEach(function(disclosureOption){disclosureOption.addEventListener("click",this.eventHandlers.connectOptions)},this),this.container.addEventListener("keyup",this.eventHandlers.onDisclosureKeyUp),this.cache.disclosureList.addEventListener("focusout",this.eventHandlers.onDisclosureListFocusOut),this.cache.disclosureToggle.addEventListener("focusout",this.eventHandlers.onDisclosureToggleFocusOut),document.body.addEventListener("click",this.eventHandlers.onBodyClick)},_setupEventHandlers:function(){return{connectOptions:this._connectOptions.bind(this),toggleList:this._toggleList.bind(this),onBodyClick:this._onBodyClick.bind(this),onDisclosureKeyUp:this._onDisclosureKeyUp.bind(this),onDisclosureListFocusOut:this._onDisclosureListFocusOut.bind(this),onDisclosureToggleFocusOut:this._onDisclosureToggleFocusOut.bind(this)}},_connectOptions:function(event2){event2.preventDefault(),this._submitForm(event2.currentTarget.dataset.value)},_onDisclosureToggleFocusOut:function(event2){var disclosureLostFocus=this.container.contains(event2.relatedTarget)===!1;disclosureLostFocus&&this._hideList()},_onDisclosureListFocusOut:function(event2){var childInFocus=event2.currentTarget.contains(event2.relatedTarget),isVisible=this.cache.disclosureList.classList.contains(classes.listVisible);isVisible&&!childInFocus&&this._hideList()},_onDisclosureKeyUp:function(event2){event2.which===27&&(this._hideList(),this.cache.disclosureToggle.focus())},_onBodyClick:function(event2){var isOption=this.container.contains(event2.target),isVisible=this.cache.disclosureList.classList.contains(classes.listVisible);isVisible&&!isOption&&this._hideList()},_submitForm:function(value){this.cache.disclosureInput.value=value,this.cache.disclosureForm.submit()},_hideList:function(){this.cache.disclosureList.classList.remove(classes.listVisible),this.cache.disclosureToggle.setAttribute("aria-expanded",!1)},_toggleList:function(){var ariaExpanded=this.cache.disclosureToggle.getAttribute("aria-expanded")==="true";this.cache.disclosureList.classList.toggle(classes.listVisible),this.cache.disclosureToggle.setAttribute("aria-expanded",!ariaExpanded)},destroy:function(){this.cache.disclosureToggle.removeEventListener("click",this.eventHandlers.toggleList),this.cache.disclosureOptions.forEach(function(disclosureOption){disclosureOption.removeEventListener("click",this.eventHandlers.connectOptions)},this),this.container.removeEventListener("keyup",this.eventHandlers.onDisclosureKeyUp),this.cache.disclosureList.removeEventListener("focusout",this.eventHandlers.onDisclosureListFocusOut),this.cache.disclosureToggle.removeEventListener("focusout",this.eventHandlers.onDisclosureToggleFocusOut),document.body.removeEventListener("click",this.eventHandlers.onBodyClick)}}),Disclosure}(),theme.Drawers=function(){function Drawers(id,name){this.config={id,close:".js-drawer-close",open:".js-drawer-open-"+name,openClass:"js-drawer-open",closingClass:"js-drawer-closing",activeDrawer:"drawer--is-open",namespace:".drawer-"+name},this.nodes={page:document.querySelector("#MainContent")},this.drawer=document.querySelector("#"+id),this.isOpen=!1,this.drawer&&this.init()}return Drawers.prototype=Object.assign({},Drawers.prototype,{init:function(){document.querySelectorAll(this.config.open).forEach(openBtn=>{openBtn.setAttribute("aria-expanded","false"),openBtn.addEventListener("click",this.open.bind(this))}),this.drawer.querySelector(this.config.close).addEventListener("click",this.close.bind(this)),document.addEventListener("modalOpen",function(){this.close()}.bind(this))},open:function(evt,returnFocusEl){evt&&evt.preventDefault(),!this.isOpen&&(evt&&evt.stopPropagation?(evt.stopPropagation(),evt.currentTarget.setAttribute("aria-expanded","true"),this.activeSource=evt.currentTarget):returnFocusEl&&(returnFocusEl.setAttribute("aria-expanded","true"),this.activeSource=returnFocusEl),theme.utils.prepareTransition(this.drawer,function(){this.drawer.classList.add(this.config.activeDrawer)}.bind(this)),document.documentElement.classList.add(this.config.openClass),this.isOpen=!0,theme.a11y.trapFocus({container:this.drawer,namespace:"drawer_focus"}),document.dispatchEvent(new CustomEvent("drawerOpen")),document.dispatchEvent(new CustomEvent("drawerOpen."+this.config.id)),this.bindEvents())},close:function(evt){if(this.isOpen){if(evt&&!evt.target.closest(".js-drawer-close")){if(evt.target.closest(".drawer"))return}document.activeElement.blur(),theme.utils.prepareTransition(this.drawer,function(){this.drawer.classList.remove(this.config.activeDrawer)}.bind(this)),document.documentElement.classList.remove(this.config.openClass),document.documentElement.classList.add(this.config.closingClass),window.setTimeout(function(){document.documentElement.classList.remove(this.config.closingClass),this.activeSource&&this.activeSource.getAttribute("aria-expanded")&&(this.activeSource.setAttribute("aria-expanded","false"),this.activeSource.focus())}.bind(this),500),this.isOpen=!1,theme.a11y.removeTrapFocus({container:this.drawer,namespace:"drawer_focus"}),this.unbindEvents()}},bindEvents:function(){window.on("click"+this.config.namespace,function(evt){this.close(evt)}.bind(this)),window.on("keyup"+this.config.namespace,function(evt){evt.keyCode===27&&this.close()}.bind(this)),theme.a11y.lockMobileScrolling(this.config.namespace,this.nodes.page)},unbindEvents:function(){window.off("click"+this.config.namespace),window.off("keyup"+this.config.namespace),theme.a11y.unlockMobileScrolling(this.config.namespace,this.nodes.page)}}),Drawers}(),theme.Modals=function(){function Modal(id,name,options){var defaults={close:".js-modal-close",open:".js-modal-open-"+name,openClass:"modal--is-active",closingClass:"modal--is-closing",bodyOpenClass:["modal-open"],bodyOpenSolidClass:"modal-open--solid",bodyClosingClass:"modal-closing",closeOffContentClick:!0};if(this.id=id,this.modal=document.getElementById(id),!this.modal)return!1;this.modalContent=this.modal.querySelector(".modal__inner"),this.config=Object.assign(defaults,options),this.modalIsOpen=!1,this.focusOnOpen=this.config.focusIdOnOpen?document.getElementById(this.config.focusIdOnOpen):this.modal,this.isSolid=this.config.solid,this.init()}return Modal.prototype.init=function(){document.querySelectorAll(this.config.open).forEach(btn=>{btn.setAttribute("aria-expanded","false"),btn.addEventListener("click",this.open.bind(this))}),this.modal.querySelectorAll(this.config.close).forEach(btn=>{btn.addEventListener("click",this.close.bind(this))}),document.addEventListener("drawerOpen",function(){this.close()}.bind(this))},Modal.prototype.open=function(evt){var externalCall=!1;this.modalIsOpen||(evt?evt.preventDefault():externalCall=!0,evt&&evt.stopPropagation&&(evt.stopPropagation(),this.activeSource=evt.currentTarget.setAttribute("aria-expanded","true")),this.modalIsOpen&&!externalCall&&this.close(),this.modal.classList.add(this.config.openClass),document.documentElement.classList.add(...this.config.bodyOpenClass),this.isSolid&&document.documentElement.classList.add(this.config.bodyOpenSolidClass),this.modalIsOpen=!0,theme.a11y.trapFocus({container:this.modal,elementToFocus:this.focusOnOpen,namespace:"modal_focus"}),document.dispatchEvent(new CustomEvent("modalOpen")),document.dispatchEvent(new CustomEvent("modalOpen."+this.id)),this.bindEvents())},Modal.prototype.close=function(evt){if(this.modalIsOpen){if(evt&&!evt.target.closest(".js-modal-close")){if(evt.target.closest(".modal__inner"))return}document.activeElement.blur(),this.modal.classList.remove(this.config.openClass),this.modal.classList.add(this.config.closingClass),document.documentElement.classList.remove(...this.config.bodyOpenClass),document.documentElement.classList.add(this.config.bodyClosingClass),window.setTimeout(function(){document.documentElement.classList.remove(this.config.bodyClosingClass),this.modal.classList.remove(this.config.closingClass),this.activeSource&&this.activeSource.getAttribute("aria-expanded")&&this.activeSource.setAttribute("aria-expanded","false").focus()}.bind(this),500),this.isSolid&&document.documentElement.classList.remove(this.config.bodyOpenSolidClass),this.modalIsOpen=!1,theme.a11y.removeTrapFocus({container:this.modal,namespace:"modal_focus"}),document.dispatchEvent(new CustomEvent("modalClose."+this.id)),this.unbindEvents()}},Modal.prototype.bindEvents=function(){window.on("keyup.modal",function(evt){evt.keyCode===27&&this.close()}.bind(this)),this.config.closeOffContentClick&&this.modal.on("click.modal",this.close.bind(this))},Modal.prototype.unbindEvents=function(){document.documentElement.off(".modal"),this.config.closeOffContentClick&&this.modal.off(".modal")},Modal}(),typeof window.noUiSlider>"u")throw new Error("theme.PriceRange is missing vendor noUiSlider: // =require vendor/nouislider.js");theme.PriceRange=function(){var defaultStep=10,selectors={priceRange:".price-range",priceRangeSlider:".price-range__slider",priceRangeInputMin:".price-range__input-min",priceRangeInputMax:".price-range__input-max",priceRangeDisplayMin:".price-range__display-min",priceRangeDisplayMax:".price-range__display-max"};function PriceRange(container,{onChange,onUpdate,...sliderOptions}={}){return this.container=container,this.onChange=onChange,this.onUpdate=onUpdate,this.sliderOptions=sliderOptions||{},this.init()}return PriceRange.prototype=Object.assign({},PriceRange.prototype,{init:function(){if(!this.container.classList.contains("price-range"))throw new Error("You must instantiate PriceRange with a valid container");return this.formEl=this.container.closest("form"),this.sliderEl=this.container.querySelector(selectors.priceRangeSlider),this.inputMinEl=this.container.querySelector(selectors.priceRangeInputMin),this.inputMaxEl=this.container.querySelector(selectors.priceRangeInputMax),this.displayMinEl=this.container.querySelector(selectors.priceRangeDisplayMin),this.displayMaxEl=this.container.querySelector(selectors.priceRangeDisplayMax),this.minRange=parseFloat(this.container.dataset.min)||0,this.minValue=parseFloat(this.container.dataset.minValue)||0,this.maxRange=parseFloat(this.container.dataset.max)||100,this.maxValue=parseFloat(this.container.dataset.maxValue)||this.maxRange,this.createPriceRange()},createPriceRange:function(){this.sliderEl&&this.sliderEl.noUiSlider&&typeof this.sliderEl.noUiSlider.destroy=="function"&&this.sliderEl.noUiSlider.destroy();var slider=noUiSlider.create(this.sliderEl,{connect:!0,step:defaultStep,...this.sliderOptions,start:[this.minValue,this.maxValue],range:{min:this.minRange,max:this.maxRange}});return slider.on("update",values=>{this.displayMinEl.innerHTML=theme.Currency.formatMoney(values[0],theme.settings.moneyFormat),this.displayMaxEl.innerHTML=theme.Currency.formatMoney(values[1],theme.settings.moneyFormat),this.onUpdate&&this.onUpdate(values)}),slider.on("change",values=>{if(this.inputMinEl.value=values[0],this.inputMaxEl.value=values[1],this.onChange){const formData=new FormData(this.formEl);this.onChange(formData)}}),slider}}),PriceRange}(),theme.AjaxProduct=function(){var status={loading:!1};function ProductForm(form,submit,args){this.form=form,this.args=args;var submitSelector=submit||".add-to-cart";this.form&&(this.addToCart=form.querySelector(submitSelector),this.form.addEventListener("submit",this.addItemFromForm.bind(this)))}return ProductForm.prototype=Object.assign({},ProductForm.prototype,{addItemFromForm:function(evt,callback){if(evt.preventDefault(),!status.loading){this.addToCart.classList.add("btn--loading"),status.loading=!0;var data=theme.utils.serialize(this.form);fetch(theme.routes.cartAdd,{method:"POST",body:data,credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"}}).then(response=>response.json()).then(function(data2){if(data2.status===422)this.error(data2);else{var product=data2;this.success(product)}status.loading=!1,this.addToCart.classList.remove("btn--loading"),document.body.classList.contains("template-cart")&&(window.scrollTo(0,0),location.reload())}.bind(this))}},success:function(product){var errors=this.form.querySelector(".errors");errors&&errors.remove(),document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product,addToCartBtn:this.addToCart}})),this.args&&this.args.scopedEventId&&document.dispatchEvent(new CustomEvent("ajaxProduct:added:"+this.args.scopedEventId,{detail:{product,addToCartBtn:this.addToCart}}))},error:function(error){if(!error.description){console.warn(error);return}var errors=this.form.querySelector(".errors");errors&&errors.remove();var errorDiv=document.createElement("div");errorDiv.classList.add("errors","text-center"),errorDiv.textContent=error.description,this.form.append(errorDiv),document.dispatchEvent(new CustomEvent("ajaxProduct:error",{detail:{errorMessage:error.description}})),this.args&&this.args.scopedEventId&&document.dispatchEvent(new CustomEvent("ajaxProduct:error:"+this.args.scopedEventId,{detail:{errorMessage:error.description}}))}}),$(document).ready(function(){$(document).on("click",".js-collection-grid-form",function(e){e.preventDefault();var $button=$(this),$form=$button.parents("form"),formData=$form.serialize();$.ajax({url:"/cart/add.js",type:"POST",dataType:"json",data:formData,success:function(product){$form.find("[js-errorproductcard]").css("display","none"),document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product,addToCartBtn:$button}}))},error:function(error){$form.find("[js-errorproductcard]").css("display","block").html("Tu carrito contiene")}})})}),ProductForm}(),theme.ProductMedia=function(){var modelJsonSections={},models={},xrButtons={},selectors={mediaGroup:"[data-product-single-media-group]",xrButton:"[data-shopify-xr]"};function init(modelViewerContainers,sectionId){modelJsonSections[sectionId]={loaded:!1},modelViewerContainers.forEach(function(container,index){var mediaId=container.dataset.mediaId,modelViewerElement=container.querySelector("model-viewer"),modelId=modelViewerElement.dataset.modelId;if(index===0){var mediaGroup=container.closest(selectors.mediaGroup),xrButton=mediaGroup.querySelector(selectors.xrButton);xrButtons[sectionId]={element:xrButton,defaultId:modelId}}models[mediaId]={modelId,sectionId,container,element:modelViewerElement}}),window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:setupShopifyXr},{name:"model-viewer-ui",version:"1.0",onLoad:setupModelViewerUi}]),theme.LibraryLoader.load("modelViewerUiStyles")}function setupShopifyXr(errors){if(!errors){if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",function(){setupShopifyXr()});return}for(var sectionId in modelJsonSections)if(modelJsonSections.hasOwnProperty(sectionId)){var modelSection=modelJsonSections[sectionId];if(modelSection.loaded)continue;var modelJson=document.querySelector("#ModelJson-"+sectionId);window.ShopifyXR.addModels(JSON.parse(modelJson.innerHTML)),modelSection.loaded=!0}window.ShopifyXR.setupXRElements()}}function setupModelViewerUi(errors){if(!errors){for(var key in models)if(models.hasOwnProperty(key)){var model=models[key];!model.modelViewerUi&&Shopify&&(model.modelViewerUi=new Shopify.ModelViewerUI(model.element)),setupModelViewerListeners(model)}}}function setupModelViewerListeners(model){var xrButton=xrButtons[model.sectionId];model.container.addEventListener("mediaVisible",function(){xrButton.element.setAttribute("data-shopify-model3d-id",model.modelId),!theme.config.isTouch&&model.modelViewerUi.play()}),model.container.addEventListener("mediaHidden",function(){xrButton.element.setAttribute("data-shopify-model3d-id",xrButton.defaultId),model.modelViewerUi.pause()}),model.container.addEventListener("xrLaunch",function(){model.modelViewerUi.pause()})}function removeSectionModels(sectionId){for(var key in models)if(models.hasOwnProperty(key)){var model=models[key];model.sectionId===sectionId&&delete models[key]}delete modelJsonSections[sectionId]}return{init,removeSectionModels}}(),theme.QtySelector=function(){var selectors={input:".js-qty__num",plus:".js-qty__adjust--plus",minus:".js-qty__adjust--minus"};function QtySelector(el,options){this.wrapper=el,this.plus=el.querySelector(selectors.plus),this.minus=el.querySelector(selectors.minus),this.input=el.querySelector(selectors.input),this.minValue=this.input.getAttribute("min")||1;var defaults={namespace:null,isCart:!1,key:this.input.dataset.id};this.options=Object.assign({},defaults,options),this.init()}return QtySelector.prototype=Object.assign({},QtySelector.prototype,{init:function(){this.plus.addEventListener("click",function(){var qty=this._getQty();this._change(qty+1)}.bind(this)),this.minus.addEventListener("click",function(){var qty=this._getQty();this._change(qty-1)}.bind(this)),this.input.addEventListener("change",function(evt){this._change(this._getQty())}.bind(this))},_getQty:function(){var qty=this.input.value;return parseFloat(qty)==parseInt(qty)&&!isNaN(qty)||(qty=1),parseInt(qty)},_change:function(qty){qty<=this.minValue&&(qty=this.minValue),this.input.value=qty,this.options.isCart&&document.dispatchEvent(new CustomEvent("cart:quantity"+this.options.namespace,{detail:[this.options.key,qty,this.wrapper]}))}}),QtySelector}(),theme.Slideshow=function(){var classes={animateOut:"animate-out",isPaused:"is-paused",isActive:"is-active"},selectors={allSlides:".slideshow__slide",currentSlide:".is-selected",wrapper:".slideshow-wrapper",pauseButton:".slideshow__pause"},productSelectors={thumb:".product__thumb-item:not(.hide)",links:".product__thumb-item:not(.hide) a",arrow:".product__thumb-arrow"},defaults={adaptiveHeight:!1,autoPlay:!1,avoidReflow:!1,childNav:null,childNavScroller:null,childVertical:!1,dragThreshold:7,fade:!1,friction:.8,initialIndex:0,pageDots:!1,pauseAutoPlayOnHover:!1,prevNextButtons:!1,rightToLeft:theme.config.rtl,selectedAttraction:.14,setGallerySize:!0,wrapAround:!0};function slideshow(el,args){if(this.el=el,this.args=Object.assign({},defaults,args),this.args.on={ready:this.init.bind(this),change:this.slideChange.bind(this),settle:this.afterChange.bind(this)},this.args.childNav&&(this.childNavEls=this.args.childNav.querySelectorAll(productSelectors.thumb),this.childNavLinks=this.args.childNav.querySelectorAll(productSelectors.links),this.arrows=this.args.childNav.querySelectorAll(productSelectors.arrow),this.childNavLinks.length&&this.initChildNav()),this.args.avoidReflow&&avoidReflow(el),this.slideshow=new Flickity(el,this.args),this.args.autoPlay){var wrapper=el.closest(selectors.wrapper);this.pauseBtn=wrapper.querySelector(selectors.pauseButton),this.pauseBtn&&this.pauseBtn.addEventListener("click",this._togglePause.bind(this))}window.on("resize",theme.utils.debounce(300,function(){this.resize()}.bind(this)));function avoidReflow(el2){if(el2.id){for(var firstChild=el2.firstChild;firstChild!=null&&firstChild.nodeType==3;)firstChild=firstChild.nextSibling;var style=document.createElement("style");style.innerHTML=`#${el2.id} .flickity-viewport{height:${firstChild.offsetHeight}px}`,document.head.appendChild(style)}}}return slideshow.prototype=Object.assign({},slideshow.prototype,{init:function(el){this.currentSlide=this.el.querySelector(selectors.currentSlide),this.args.callbacks&&this.args.callbacks.onInit&&typeof this.args.callbacks.onInit=="function"&&this.args.callbacks.onInit(this.currentSlide),window.AOS&&AOS.refresh()},slideChange:function(index){this.args.fade&&this.currentSlide&&(this.currentSlide.classList.add(classes.animateOut),this.currentSlide.addEventListener("transitionend",function(){this.currentSlide.classList.remove(classes.animateOut)}.bind(this))),this.args.childNav&&this.childNavGoTo(index),this.args.callbacks&&this.args.callbacks.onChange&&typeof this.args.callbacks.onChange=="function"&&this.args.callbacks.onChange(index),this.arrows&&this.arrows.length&&(this.arrows[0].classList.toggle("hide",index===0),this.arrows[1].classList.toggle("hide",index===this.childNavLinks.length-1))},afterChange:function(index){this.args.fade&&this.el.querySelectorAll(selectors.allSlides).forEach(slide=>{slide.classList.remove(classes.animateOut)}),this.currentSlide=this.el.querySelector(selectors.currentSlide),this.args.childNav&&this.childNavGoTo(this.slideshow.selectedIndex)},destroy:function(){this.args.childNav&&this.childNavLinks.length&&this.childNavLinks.forEach(a=>{a.classList.remove(classes.isActive)}),this.slideshow.destroy()},_togglePause:function(){this.pauseBtn.classList.contains(classes.isPaused)?(this.pauseBtn.classList.remove(classes.isPaused),this.slideshow.playPlayer()):(this.pauseBtn.classList.add(classes.isPaused),this.slideshow.pausePlayer())},resize:function(){this.slideshow.resize()},play:function(){this.slideshow.playPlayer()},pause:function(){this.slideshow.pausePlayer()},goToSlide:function(i){this.slideshow.select(i)},setDraggable:function(enable){this.slideshow.options.draggable=enable,this.slideshow.updateDraggable()},initChildNav:function(){this.childNavLinks[this.args.initialIndex].classList.add("is-active"),this.childNavLinks.forEach((link,i)=>{link.setAttribute("data-index",i),link.addEventListener("click",function(evt){evt.preventDefault(),this.goToSlide(this.getChildIndex(evt.currentTarget))}.bind(this)),link.addEventListener("focus",function(evt){this.goToSlide(this.getChildIndex(evt.currentTarget))}.bind(this)),link.addEventListener("keydown",function(evt){evt.keyCode===13&&this.goToSlide(this.getChildIndex(evt.currentTarget))}.bind(this))}),this.arrows.length&&this.arrows.forEach(arrow=>{arrow.addEventListener("click",this.arrowClick.bind(this))})},getChildIndex:function(target){return parseInt(target.dataset.index)},childNavGoTo:function(index){this.childNavLinks.forEach(a=>{a.classList.remove(classes.isActive)});var el=this.childNavLinks[index];if(el.classList.add(classes.isActive),!!this.args.childNavScroller)if(this.args.childVertical){var elTop=el.offsetTop;this.args.childNavScroller.scrollTop=elTop-100}else{var elLeft=el.offsetLeft;this.args.childNavScroller.scrollLeft=elLeft-100}},arrowClick:function(evt){evt.currentTarget.classList.contains("product__thumb-arrow--prev")?this.slideshow.previous():this.slideshow.next()}}),slideshow}(),theme.VariantAvailability=function(){var classes={disabled:"disabled"};function availability(args){this.type=args.type,this.variantsObject=args.variantsObject,this.currentVariantObject=args.currentVariantObject,this.container=args.container,this.namespace=args.namespace,this.init()}return availability.prototype=Object.assign({},availability.prototype,{init:function(){this.container.on("variantChange"+this.namespace,this.setAvailability.bind(this)),this.setAvailability(null,this.currentVariantObject)},setAvailability:function(evt,variant){if(evt)var variant=evt.detail.variant;var valuesToManage={option1:[],option2:[],option3:[]},ignoreIndex=null,availableVariants=this.variantsObject.filter(function(el){if(!variant||variant.id===el.id)return!1;if(variant.option2===el.option2&&variant.option3===el.option3||variant.option1===el.option1&&variant.option3===el.option3||variant.option1===el.option1&&variant.option2===el.option2)return!0}),variantObject={variant},variants=Object.assign({},{variant},availableVariants);this.container.querySelectorAll(".variant-input-wrap").forEach(group=>{this.disableVariantGroup(group)});for(var property in variants)if(variants.hasOwnProperty(property)){var item=variants[property];if(!item)return;var value1=item.option1,value2=item.option2,value3=item.option3,soldOut=item.available===!1;value1&&ignoreIndex!=="option1"&&valuesToManage.option1.push({value:value1,soldOut}),value2&&ignoreIndex!=="option2"&&valuesToManage.option2.push({value:value2,soldOut}),value3&&ignoreIndex!=="option3"&&valuesToManage.option3.push({value:value3,soldOut})}for(var[option,values]of Object.entries(valuesToManage))this.manageOptionState(option,values)},manageOptionState:function(option,values){var group=this.container.querySelector('.variant-input-wrap[data-index="'+option+'"]');values.forEach(obj=>{this.enableVariantOption(group,obj)})},enableVariantOptionByValue:function(array,index){for(var group=this.container.querySelector('.variant-input-wrap[data-index="'+index+'"]'),i=0;i|\/@])/g,"\\$1");if(this.type==="dropdown")group.querySelector('option[value="'+value+'"]').disabled=!1;else{var buttonGroup=group.querySelector('.variant-input[data-value="'+value+'"]'),input=buttonGroup.querySelector("input"),label=buttonGroup.querySelector("label");input.classList.remove(classes.disabled),label.classList.remove(classes.disabled),obj.soldOut&&(input.classList.add(classes.disabled),label.classList.add(classes.disabled))}},disableVariantGroup:function(group){this.type==="dropdown"?group.querySelectorAll("option").forEach(option=>{option.disabled=!0}):(group.querySelectorAll("input").forEach(input=>{input.classList.add(classes.disabled)}),group.querySelectorAll("label").forEach(label=>{label.classList.add(classes.disabled)}))}}),availability}(),theme.videoModal=function(){var youtubePlayer,videoHolderId="VideoHolder",selectors={youtube:'a[href*="youtube.com/watch"], a[href*="youtu.be/"]',mp4Trigger:".product-video-trigger--mp4",mp4Player:".product-video-mp4-sound"},youtubeTriggers=document.querySelectorAll(selectors.youtube),mp4Triggers=document.querySelectorAll(selectors.mp4Trigger);if(!youtubeTriggers.length&&!mp4Triggers.length)return;var videoHolderDiv=document.getElementById(videoHolderId);youtubeTriggers.length&&theme.LibraryLoader.load("youtubeSdk");var modal=new theme.Modals("VideoModal","video-modal",{closeOffContentClick:!0,bodyOpenClass:["modal-open","video-modal-open"],solid:!0});youtubeTriggers.forEach(btn=>{btn.addEventListener("click",triggerYouTubeModal)}),mp4Triggers.forEach(btn=>{btn.addEventListener("click",triggerMp4Modal)}),document.addEventListener("modalClose.VideoModal",closeVideoModal);function triggerYouTubeModal(evt){if(theme.config.youTubeReady){evt.preventDefault(),emptyVideoHolder(),modal.open(evt);var videoId=getYoutubeVideoId(evt.currentTarget.getAttribute("href"));youtubePlayer=new theme.YouTube(videoHolderId,{videoId,style:"sound",events:{onReady:onYoutubeReady}})}}function triggerMp4Modal(evt){emptyVideoHolder();var el=evt.currentTarget,player=el.parentNode.querySelector(selectors.mp4Player),playerClone=player.cloneNode(!0);playerClone.classList.remove("hide"),videoHolderDiv.append(playerClone),modal.open(evt),videoHolderDiv.querySelector("video").play()}function onYoutubeReady(evt){evt.target.unMute(),evt.target.playVideo()}function getYoutubeVideoId(url){var regExp=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/,match=url.match(regExp);return match&&match[7].length==11?match[7]:!1}function emptyVideoHolder(){videoHolderDiv.innerHTML=""}function closeVideoModal(){youtubePlayer&&typeof youtubePlayer.destroy=="function"?youtubePlayer.destroy():emptyVideoHolder()}},theme.ProductScreen=function(){var originalTitle=document.title,namespace="productscreen",windowPosition=0,page=document.getElementById("MainContent"),config={close:".js-screen-close",openClass:"screen-layer--is-active",closeSlideAnimate:["screen-layer--is-sliding"],bodyOpenClass:"screen-layer-open",bodyClosingClass:["screen-layer-closing"],bodyCloseAnimate:["screen-layer-closing","screen-layer-animating"],loaderStart:200,pullToCloseThreshold:-100};function ProductScreen(id,name){this.id=id,this.screen=document.getElementById(id),this.screen&&(this.nodes={loader:document.getElementById("OverscrollLoader").querySelector(".icon-loader__path"),screenContent:this.screen.querySelector(".screen-layer__inner"),photoswipe:document.querySelector(".pswp")},this.title=this.screen.dataset.productTitle,this.openBtnClass=".js-screen-open-"+name,this.initialized=!1,this.isOpen=!1,this.focusOnOpen=config.focusOnOpen?this.screen.querySelector(config.focusOnOpen):this.screen,this.init())}return ProductScreen.prototype=Object.assign({},ProductScreen.prototype,{init:function(){var openBtns=document.querySelectorAll(this.openBtnClass);openBtns.forEach(btn=>{btn.setAttribute("aria-expanded","false"),btn.addEventListener("click",this.open.bind(this))});var closeBtns=this.screen.querySelectorAll(config.close);closeBtns.forEach(btn=>{btn.on("click."+namespace,function(evt){this.close(!1,{noAnimate:!0,back:!0})}.bind(this))}),theme.settings.cartType==="sticky"&&(document.addEventListener("ajaxProduct:added:"+this.id,function(){theme.headerNav.toggleThumbMenu(!1,!0);var args={back:!0};this.close(!1,args)}.bind(this)),document.addEventListener("ajaxProduct:error:"+this.id,function(){this.initialized&&this.open()}.bind(this)))},open:function(evt,data){this.screen=document.getElementById(this.id);var externalCall=!1,args={updateCurrentPath:data?data.updateCurrentPath:!0};if(!this.isOpen){evt?evt.preventDefault():externalCall=!0,evt&&evt.stopPropagation&&(evt.stopPropagation(),this.activeSource=evt.currentTarget),this.isOpen&&!externalCall&&this.close(),windowPosition=window.scrollY,theme.utils.prepareTransition(this.screen,function(){this.screen.classList.add(config.openClass)}.bind(this)),document.documentElement.classList.add(config.bodyOpenClass),document.body.classList.add(config.bodyOpenClass),this.nodes.screenContent.scrollTo(0,0),window.scrollTo(0,0),theme.a11y.trapFocus({container:this.screen,elementToFocus:this.focusOnOpen,namespace}),this.activeSource&&this.activeSource.hasAttribute("aria-expanded")&&this.activeSource.setAttribute("aria-expanded","true");var newUrl=this.activeSource.dataset.url;document.dispatchEvent(new CustomEvent("productModalOpen."+this.id)),document.dispatchEvent(new CustomEvent("newPopstate",{detail:{screen:this,url:newUrl,updateCurrentPath:args.updateCurrentPath}})),this.initialized=!0,this.isOpen=!0,document.title=this.title,window.ga&&ga("send","pageview",{page:newUrl}),this.bindEvents()}},close:function(evt,args){var evtData=args||(evt?evt.data:null),goBack=evtData?evtData.back:!1,noAnimate=!!(evtData&&evtData.noAnimate);document.body.removeAttribute("style"),this.nodes.loader.style.strokeDashoffset=config.loaderStart,goBack&&document.dispatchEvent(new CustomEvent("newPopstate",{detail:{screen:this,back:!0}}));var closeClass=noAnimate?[]:config.closeSlideAnimate,bodyCloseClass=noAnimate?config.bodyClosingClass:config.bodyCloseAnimate;this.isOpen&&(document.activeElement.blur(),theme.utils.prepareTransition(this.screen,function(){this.screen.classList.remove(config.openClass),this.screen.classList.add(...closeClass),this.screen.classList.remove("is-transitioning")}.bind(this)),document.documentElement.classList.remove(config.bodyOpenClass),document.body.classList.remove(config.bodyOpenClass),document.documentElement.classList.add(...bodyCloseClass),document.body.classList.add(...bodyCloseClass),window.setTimeout(function(){this.screen.classList.remove(...closeClass),document.documentElement.classList.remove(...bodyCloseClass),document.body.classList.remove(...bodyCloseClass),window.scrollTo(0,windowPosition)}.bind(this),500),theme.a11y.removeTrapFocus({container:this.screen,namespace}),this.activeSource&&this.activeSource.hasAttribute("aria-expanded")&&(this.activeSource.setAttribute("aria-expanded","false"),this.activeSource.focus()),document.body.dispatchEvent(new CustomEvent("productModalClose")),document.body.dispatchEvent(new CustomEvent("productModalClose."+this.id)),window.scrollTo(0,windowPosition),this.isOpen=!1,document.title=originalTitle,window.ga&&ga("send","pageview"),this.unbindEvents())},bindEvents:function(){window.on("keyup."+namespace,function(evt){if(evt.keyCode===27){if(this.nodes.photoswipe.classList.contains("pswp--open")||document.body.classList.contains("js-drawer-open"))return;this.close(!1,{back:!0})}}.bind(this));var bgAmount=0,loaderAmount=0;window.on("touchmove."+namespace,theme.utils.throttle(15,function(){var pos=window.scrollY;pos>=0||(bgAmount=-(pos/100),document.body.style.background="rgba(0,0,0,"+bgAmount+")",loaderAmount=config.loaderStart+pos*2,pos<=config.pullToCloseThreshold&&(loaderAmount=0),this.nodes.loader.style.strokeDashoffset=loaderAmount)}.bind(this))),window.on("touchend."+namespace,function(){var pos=window.scrollY;if(pos{var id=trigger.dataset.productId;if(ids.indexOf(id)>-1){var duplicate=document.querySelector('.screen-layer--product[data-product-id="'+id+'"]');duplicate&&duplicate.parentNode.removeChild(duplicate);return}ids.push(id)}),ids}function getIdsFromTriggers(triggers){var ids=[];return triggers.forEach(trigger=>{var id=trigger.dataset.productId;ids.push(id)}),ids}function initProductScreens(ids){for(var screenId,screenLayer,screens=document.createDocumentFragment(),i=0;i{prod.off("mouseenter"+this.namespace),prod.off("mouseout"+this.namespace)}),window.off("scroll"+this.namespace),theme.config.bpSmall?this.slidersMobile&&this.inViewSliderInit():this.mouseSliderInit()},listnerSetup:function(){document.addEventListener("matchSmall",function(){this.destroyAllSliders(),this.setupEventType()}.bind(this)),document.addEventListener("unmatchSmall",function(){this.destroyAllSliders(),this.setupEventType()}.bind(this))},inViewSliderInit:function(){this.products.forEach(prod=>{var observer=new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{var slider=prod.querySelector(selectors.slider);theme.config.bpSmall&&(entry.isIntersecting?this.initSlider(slider):this.destroySlider(slider))})},{threshold:1});observer.observe(prod)})},mouseSliderInit:function(){this.products.forEach(prod=>{var slider=prod.querySelector(selectors.slider);prod.on("mouseenter"+this.namespace,function(){this.initSlider(slider)}.bind(this)),prod.on("mouseleave"+this.namespace,function(evt){this.destroySlider(slider)}.bind(this))})},initSlider:function(slider){!slider.dataset||slider.dataset.imageCount<2||this.activeIds.indexOf(slider.dataset.id)===-1&&(slider.classList.add("product-slider--init"),this.allSliders[slider.dataset.id]=new theme.Slideshow(slider,{autoPlay:1050,fade:!0,avoidReflow:!0}),this.activeIds.push(slider.dataset.id))},destroySlider:function(slider){if(!(!slider.dataset||slider.dataset.imageCount<2)){var alreadyActive=this.activeIds.indexOf(slider.dataset.id);if(alreadyActive!==-1){this.activeIds.splice(alreadyActive,1);var flickity=this.allSliders[slider.dataset.id];flickity&&typeof flickity.destroy=="function"&&flickity.destroy()}}},destroyAllSliders:function(){this.products.forEach(prod=>{var slider=prod.querySelector(selectors.slider);this.destroySlider(slider)})}}),HoverProductGrid}(),theme.slideNav=function(){var selectors={container:"#PageContainer",navWrapper:".slide-nav__overflow",nav:"#SlideNav",toggleBtn:".js-toggle-slide-nav",subNavToggleBtn:".js-toggle-submenu",thumbNavToggle:".site-nav__thumb-button"},classes={subNavLink:"slide-nav__sublist-link",return:"slide-nav__return-btn",isActive:"is-active",isOpen:"js-menu--is-open",subNavShowing:"sub-nav--is-open",thirdNavShowing:"third-nav--is-open"},namespace=".slideNav",isTransitioning,activeSubNav,activeTrigger,pageSlide=!0,menuLevel=1,container,navWrapper,toggleBtns,subNavToggleBtns,activeMenuToggle=null;function init(){var thumbNavToggle=document.querySelector(selectors.thumbNavToggle);thumbNavToggle&&(pageSlide=!1),container=document.querySelector(selectors.container),navWrapper=document.querySelector(selectors.navWrapper),toggleBtns=document.querySelectorAll(selectors.toggleBtn),subNavToggleBtns=document.querySelectorAll(selectors.subNavToggleBtn),toggleBtns.forEach(btn=>{btn.on("click"+namespace,toggleNav)}),subNavToggleBtns.forEach(btn=>{btn.on("click"+namespace,toggleSubNav)})}function toggleNav(evt){activeMenuToggle=evt.currentTarget,activeMenuToggle.classList.contains(classes.isActive)?closeNav():openNav()}function openNav(evt){if(toggleBtns.forEach(btn=>{btn.classList.add(classes.isActive)}),theme.utils.prepareTransition(navWrapper,function(){navWrapper.classList.add(classes.isOpen)}),pageSlide){var navWrapperHeight=document.querySelector(selectors.navWrapper).clientHeight;container.style.transform="translate3d(0, "+navWrapperHeight+"px, 0)"}navWrapper.setAttribute("tabindex","-1"),navWrapper.focus(),window.on("keyup"+namespace,function(evt2){evt2.keyCode===27&&closeNav()})}function closeNav(){toggleBtns.forEach(btn=>{btn.classList.remove(classes.isActive)}),theme.utils.prepareTransition(navWrapper,function(){navWrapper.classList.remove(classes.isOpen)}),pageSlide&&container.removeAttribute("style"),activeMenuToggle.focus(),activeMenuToggle=null,window.off("keyup"+namespace)}function toggleSubNav(evt){if(!isTransitioning){var toggleBtn=evt.currentTarget,isReturn=toggleBtn.classList.contains(classes.return);if(isTransitioning=!0,isReturn){var btns=document.querySelectorAll(selectors.subNavToggleBtn+'[data-level="'+(menuLevel-1)+'"]');btns.forEach(btn=>{btn.classList.remove(classes.isActive)});var menus=document.querySelectorAll('.slide-nav__dropdown[data-level="'+menuLevel+'"]');menus.forEach(menu=>{theme.utils.prepareTransition(menu,function(){menu.classList.remove(classes.isActive)})}),activeTrigger&&activeTrigger.classList.remove(classes.isActive)}else{toggleBtn.classList.add(classes.isActive);var dropdown=toggleBtn.nextElementSibling;theme.utils.prepareTransition(dropdown,function(){dropdown.classList.add(classes.isActive)})}activeTrigger=toggleBtn,goToSubnav(toggleBtn.dataset.target)}}function goToSubnav(target){var targetMenu=target?document.querySelector('.slide-nav__dropdown[data-parent="'+target+'"]'):document.querySelector(selectors.nav);menuLevel=targetMenu.dataset.level?parseInt(targetMenu.dataset.level):1,activeSubNav=targetMenu;var translateMenuHeight=targetMenu.clientHeight,openNavClass=menuLevel>2?classes.thirdNavShowing:classes.subNavShowing;navWrapper.style.height=translateMenuHeight+"px",navWrapper.classList.remove(classes.thirdNavShowing),navWrapper.classList.add(openNavClass),target||(navWrapper.classList.remove(classes.thirdNavShowing),navWrapper.classList.remove(classes.subNavShowing)),isTransitioning=!1,pageSlide&&(container.style.transform="translate3d(0, "+translateMenuHeight+"px, 0)")}function unload(){window.off(namespace)}return{init,unload}}(),theme.promiseStylesheet=function(stylesheet){var stylesheetUrl=stylesheet||theme.stylesheet;return typeof this.stylesheetPromise>"u"&&(this.stylesheetPromise=new Promise(function(resolve){var link=document.querySelector('link[href="'+stylesheetUrl+'"]');if(link.loaded){resolve();return}link.addEventListener("load",function(){setTimeout(resolve,0)}),setTimeout(resolve,1)})),this.stylesheetPromise},window.onpageshow=function(evt){evt.persisted&&(document.body.classList.remove("unloading"),document.querySelectorAll(".cart__checkout").forEach(el=>{el.classList.remove("btn--loading")}),document.querySelectorAll("#StickySubmit").forEach(btn=>{btn.classList.remove("btn--loading")}));var historyPage=event.persisted||typeof window.performance<"u"&&window.performance.navigation&&window.performance.navigation.type===2;historyPage&&theme.resetScrollPosition()},theme.resetScrollPosition=function(){if(theme.config.hasSessionStorage){var pathName=document.location.pathname;sessionStorage["scrollPosition_"+pathName]&&window.scrollTo(0,sessionStorage.getItem("scrollPosition_"+pathName))}},theme.storeScrollPositionOnUnload=function(){if(theme.config.hasSessionStorage){var eventName=theme.config.isSafari?"pagehide":"beforeunload";window.addEventListener(eventName,function(event2){var pos=window.scrollY;sessionStorage.setItem("scrollPosition_"+document.location.pathname,pos.toString())})}},theme.pageTransitions=function(){document.body.dataset.transitions==="true"&&(theme.config.isSafari&&document.querySelectorAll("a").forEach(a=>{window.setTimeout(function(){document.body.classList.remove("unloading")},1200)}),document.querySelectorAll('a[href^="mailto:"], a[href^="#"], a[target="_blank"], a[href*="youtube.com/watch"], a[href*="youtu.be/"], a[download]').forEach(el=>{el.classList.add("js-no-transition")}),document.querySelectorAll("a:not(.js-no-transition)").forEach(el=>{el.addEventListener("click",function(evt){if(evt.metaKey)return!0;var src=el.getAttribute("href");if(src.indexOf(location.pathname)>=0&&src.indexOf("#")>=0)return!0;evt.preventDefault(),document.body.classList.add("unloading"),window.setTimeout(function(){location.href=src},50)})}))},theme.headerNav=function(){var selectors={wrapper:".header-wrapper",siteHeader:".site-header",logo:".site-header__logo img",navItems:".site-nav__item",navLinks:".site-nav__link",navLinksWithDropdown:".site-nav__link--has-dropdown",navDropdownLinks:".site-nav__dropdown-link--second-level",thumbMenu:".site-nav__thumb-menu"},classes={hasDropdownClass:"site-nav--has-dropdown",hasSubDropdownClass:"site-nav__deep-dropdown-trigger",dropdownActive:"is-focused",stickyCartActive:"body--sticky-cart-open",overlayEnabledClass:"header-wrapper--overlay",overlayedClass:"is-light",thumbMenuInactive:"site-nav__thumb-menu--inactive",stickyClass:"site-header--sticky",overlayStickyClass:"header-wrapper--sticky",openTransitionClass:"site-header--opening"},config={namespace:".siteNav",overlayHeader:!1,stickyActive:!1,forceStickyOnMobile:!1,forceCloseThumbNav:!1},wrapper,siteHeader;function init(){wrapper=document.querySelector(selectors.wrapper),siteHeader=document.querySelector(selectors.siteHeader),theme.settings.overlayHeader=siteHeader.dataset.overlay==="true",config.stickyActive=!1,accessibleDropdowns();var searchModal=new theme.Modals("SearchModal","search-modal",{closeOffContentClick:!1,focusIdOnOpen:"SearchModalInput"});window.on("resize"+config.namespace,theme.utils.debounce(150,headerResize)),window.on("load"+config.namespace,headerLoad),setHeaderStyle(),window.on("scroll"+config.namespace,theme.utils.throttle(150,stickyMenuOnScroll)),window.on("scroll"+config.namespace,theme.utils.debounce(150,stickyMenuOnScroll)),Shopify.designMode&&window.dispatchEvent(new Event("resize"))}function headerLoad(){resizeLogo(),initStickyThumbMenu(),config.headerStyle==="bar"&&initStickyBarMenu()}function headerResize(){resizeLogo(),setHeaderStyle(),config.headerStyle==="bar"&&stickyHeaderHeight()}function setHeaderStyle(){theme.config.bpSmall?config.headerStyle="button":config.headerStyle=wrapper.dataset.headerStyle,config.stickyThreshold=config.headerStyle==="button"?100:250,config.headerStyle!=="button"&&toggleThumbMenu(!1)}function resizeLogo(){document.querySelectorAll(selectors.logo).forEach(logo=>{var logoWidthOnScreen=logo.clientWidth,containerWidth=logo.closest(".header-item").clientWidth;logoWidthOnScreen>containerWidth?logo.style.maxWidth=containerWidth:logo.removeAttribute("style")})}function accessibleDropdowns(){var hasActiveDropdown=!1,hasActiveSubDropdown=!1,closeOnClickActive=!1;theme.config.isTouch&&document.querySelectorAll(selectors.navLinksWithDropdown).forEach(el=>{el.on("touchend"+config.namespace,function(evt){var parent=evt.currentTarget.parentNode;parent.classList.contains(classes.dropdownActive)?window.location.replace(evt.currentTarget.getAttribute("href")):(evt.preventDefault(),closeDropdowns(),openFirstLevelDropdown(evt.currentTarget))})}),document.querySelectorAll(selectors.navLinks).forEach(el=>{el.on("focusin"+config.namespace,accessibleMouseEvent),el.on("mouseover"+config.namespace,accessibleMouseEvent),el.on("mouseleave"+config.namespace,closeDropdowns)}),document.querySelectorAll(selectors.navDropdownLinks).forEach(el=>{theme.config.isTouch&&el.on("touchend"+config.namespace,function(evt){var parent=evt.currentTarget.parentNode;parent.classList.contains(classes.hasSubDropdownClass)?parent.classList.contains(classes.dropdownActive)?window.location.replace(evt.currentTarget.getAttribute("href")):(evt.preventDefault(),closeThirdLevelDropdown(),openSecondLevelDropdown(evt.currentTarget)):window.location.replace(evt.currentTarget.getAttribute("href"))}),el.on("focusin"+config.namespace,function(evt){closeThirdLevelDropdown(),openSecondLevelDropdown(evt.currentTarget,!0)})});function accessibleMouseEvent(evt){hasActiveDropdown&&closeSecondLevelDropdown(),hasActiveSubDropdown&&closeThirdLevelDropdown(),openFirstLevelDropdown(evt.currentTarget)}function openFirstLevelDropdown(el){var parent=el.parentNode;if(parent.classList.contains(classes.hasDropdownClass)&&(parent.classList.add(classes.dropdownActive),hasActiveDropdown=!0),!theme.config.isTouch&&!closeOnClickActive){var eventType=theme.config.isTouch?"touchend":"click";closeOnClickActive=!0,document.documentElement.on(eventType+config.namespace,function(){closeDropdowns(),document.documentElement.off(eventType+config.namespace),closeOnClickActive=!1}.bind(this))}}function openSecondLevelDropdown(el,skipCheck){var parent=el.parentNode;(parent.classList.contains(classes.hasSubDropdownClass)||skipCheck)&&(parent.classList.add(classes.dropdownActive),hasActiveSubDropdown=!0)}function closeDropdowns(){closeSecondLevelDropdown(),closeThirdLevelDropdown()}function closeSecondLevelDropdown(){document.querySelectorAll(selectors.navItems).forEach(el=>{el.classList.remove(classes.dropdownActive)})}function closeThirdLevelDropdown(){document.querySelectorAll(selectors.navDropdownLinks).forEach(el=>{el.parentNode.classList.remove(classes.dropdownActive)})}}function initStickyBarMenu(){var wrapWith=document.createElement("div");wrapWith.classList.add("site-header-sticky"),theme.utils.wrap(siteHeader,wrapWith),!theme.settings.overlayHeader&&(stickyHeaderHeight(),setTimeout(function(){stickyHeaderHeight();var stickyHeader=document.querySelector(".site-header-sticky");stickyHeader.offsetHeight===0&&setTimeout(function(){window.dispatchEvent(new Event("resize"))},500)},200))}function stickyHeaderHeight(){var stickyHeader=document.querySelector(".site-header-sticky");if(stickyHeader){var h=siteHeader.offsetHeight;stickyHeader.style.height=h+"px"}}function initStickyThumbMenu(){document.body.classList.contains(classes.stickyCartActive)||theme.config.bpSmall&&theme.template!=="product"&&setTimeout(function(){config.forceStickyOnMobile=!0,toggleThumbMenu(!0)},25)}function stickyMenuOnScroll(evt){if(window.scrollY>config.stickyThreshold){if(config.forceStickyOnMobile&&(config.forceStickyOnMobile=!1),config.stickyActive)return;config.headerStyle==="button"?toggleThumbMenu(!0):config.headerStyle==="bar"&&toggleBarMenu(!0)}else{if(config.forceStickyOnMobile||!config.stickyActive)return;config.headerStyle==="button"?theme.config.bpSmall||toggleThumbMenu(!1):config.headerStyle==="bar"&&toggleBarMenu(!1),theme.settings.overlayHeader||stickyHeaderHeight()}}function toggleThumbMenu(active,forceClose){if(config.forceCloseThumbNav)return;var thumbBtn=document.querySelector(".slide-nav__overflow--thumb");if(thumbBtn.classList.contains("js-menu--is-open"))return;const menuElement=document.querySelector(selectors.thumbMenu);menuElement&&menuElement.classList.toggle(classes.thumbMenuInactive,!active),config.stickyActive=active,config.forceCloseThumbNav=forceClose}function toggleBarMenu(active){config.headerStyle==="bar"&&(active?(siteHeader.classList.add(classes.stickyClass),theme.settings.overlayHeader&&(wrapper.classList.remove(classes.overlayedClass),wrapper.classList.add(classes.overlayStickyClass)),setTimeout(function(){siteHeader.classList.add(classes.openTransitionClass)},100)):(siteHeader.classList.remove(classes.openTransitionClass),siteHeader.classList.remove(classes.stickyClass),theme.settings.overlayHeader&&(wrapper.classList.add(classes.overlayedClass),wrapper.classList.remove(classes.overlayStickyClass))),config.stickyActive=active)}function disableOverlayHeader(){wrapper.classList.remove(config.overlayEnabledClass),wrapper.classList.remove(config.overlayedClass),theme.settings.overlayHeader=!1}function unload(){window.off(config.namespace)}return{init,disableOverlayHeader,toggleThumbMenu,unload}}(),theme.articleImages=function(){var wrappers=document.querySelectorAll(".rte--indented-images");wrappers.length&&wrappers.forEach(wrapper=>{wrapper.querySelectorAll("img").forEach(image=>{var attr=image.getAttribute("style");(!attr||attr=="float: none;")&&image.width{var countryId=el.dataset.countryId,provinceId=el.dataset.provinceId,provinceContainerId=el.dataset.provinceContainerId;new Shopify.CountryProvinceSelector(countryId,provinceId,{hideElement:provinceContainerId})})},1e3),document.querySelectorAll(".address-new-toggle").forEach(el=>{el.addEventListener("click",function(){newAddressForm.classList.toggle("hide")})}),document.querySelectorAll(".address-edit-toggle").forEach(el=>{el.addEventListener("click",function(evt){var formId=evt.currentTarget.dataset.formId;document.getElementById("EditAddress_"+formId).classList.toggle("hide")})}),document.querySelectorAll(".address-delete").forEach(el=>{el.addEventListener("click",function(evt){var formId=evt.currentTarget.dataset.formId,confirmMessage=evt.currentTarget.dataset.confirmMessage;confirm(confirmMessage||"Are you sure you wish to delete this address?")&&Shopify&&Shopify.postLink("/account/addresses/"+formId,{parameters:{_method:"delete"}})})}))}},theme.CartDrawer=function(){var selectors={drawer:"#CartDrawer",form:"#CartDrawerForm"};function CartDrawer(){this.form=document.querySelector(selectors.form),this.drawer=new theme.Drawers("CartDrawer","cart"),this.init()}return CartDrawer.prototype=Object.assign({},CartDrawer.prototype,{init:function(){this.cartForm=new theme.CartForm(this.form),this.cartForm.buildCart(),document.addEventListener("ajaxProduct:added",function(evt){document.body.classList.add("cart-has-items"),this.cartForm.buildCart(),this.open()}.bind(this)),document.addEventListener("cart:open",this.open.bind(this)),document.addEventListener("cart:close",this.close.bind(this))},open:function(){this.drawer.open()},close:function(){this.drawer.close()}}),CartDrawer}(),theme.refreshCart=function(){theme.settings.cartType==="sticky"&&theme.StickyCart&&theme.cart.getCart().then(function(cart){theme.StickyCart.refresh(cart)})},theme.StickyCart=function(){var config={namespace:".ajaxcart"},selectors={cart:"#StickyCart",items:"#StickyItems",subtotal:"#StickySubtotal",submit:"#StickySubmit"},classes={cartTemplate:"template-cart",active:"sticky-cart--open",activeBodyClass:"body--sticky-cart-open"};function StickyCart(){this.status={loaded:!1,loading:!1,open:document.body.classList.contains(classes.activeBodyClass)},document.querySelector(selectors.cart)&&this.initEventListeners()}function refresh(cart){document.body.classList.contains(classes.cartTemplate)||(cart.item_count>0?(document.body.classList.add(classes.activeBodyClass),document.querySelector(selectors.cart).classList.add(classes.active)):(document.body.classList.remove(classes.activeBodyClass),document.querySelector(selectors.cart).classList.remove(classes.active)),document.querySelector(selectors.items).innerText=theme.strings.cartItems.replace("[count]",cart.item_count),document.querySelector(selectors.subtotal).innerHTML=theme.Currency.formatMoney(cart.total_price,theme.settings.moneyFormat))}return StickyCart.prototype=Object.assign({},StickyCart.prototype,{initEventListeners:function(){var submitBtn=document.querySelector(selectors.submit);submitBtn.addEventListener("click",function(){submitBtn.classList.add("btn--loading")}),document.addEventListener("ajaxProduct:added",function(){this.hideCart(),theme.cart.getCart().then(function(cart){this.buildCart(cart,!0)}.bind(this))}.bind(this))},hideCart:function(){document.body.classList.remove(classes.activeBodyClass),document.querySelector(selectors.cart).classList.remove(classes.active)},showCart:function(count,subtotal){count&&(document.querySelector(selectors.items).innerText=theme.strings.cartItems.replace("[count]",count)),subtotal&&(document.querySelector(selectors.subtotal).innerHTML=theme.Currency.formatMoney(subtotal,theme.settings.moneyFormat)),document.body.classList.add(classes.activeBodyClass),document.querySelector(selectors.cart).classList.add(classes.active),this.status.open=!0},buildCart:function(cart,open){this.loading(!0),this.status.loaded=!0,this.loading(!1),open===!0&&this.showCart(cart.item_count,cart.total_price)},loading:function(state){this.status.loading=state,state?document.querySelector(selectors.cart).classList.add("is-loading"):document.querySelector(selectors.cart).classList.remove("is-loading")},updateError:function(XMLHttpRequest){XMLHttpRequest.responseJSON&&XMLHttpRequest.responseJSON.description&&console.warn(XMLHttpRequest.responseJSON.description)}}),{init:StickyCart,refresh}}(),theme.Product=function(){var videoObjects={},classes={onSale:"sale-price",disabled:"disabled",isModal:"is-modal",loading:"loading",loaded:"loaded",hidden:"hide",visuallyHide:"visually-invisible",thumbActive:"thumb--current"},selectors={variantsJson:"[data-variant-json]",currentVariantJson:"[data-current-variant-json]",imageContainer:"[data-product-images]",mainSlider:"[data-product-photos]",thumbSlider:"[data-product-thumbs]",thumbScroller:"[data-product-thumbs-scroller]",photo:"[data-product-photo]",photoThumbs:"[data-product-thumb]",photoThumbItem:"[data-product-thumb-item]",zoomButton:".product__photo-zoom",priceWrapper:"[data-price-wrapper]",price:"[data-product-price]",comparePrice:"[data-product-price-compare]",priceA11y:"[data-price-a11y]",comparePriceA11y:"[data-compare-a11y]",sku:"[data-sku]",inventory:"[data-product-inventory]",incomingInventory:"[data-product-incoming-inventory]",unitWrapper:"[data-product-unit-wrapper]",addToCart:"[data-add-to-cart]",addToCartText:"[data-add-to-cart-text]",variantType:".variant-wrapper",originalSelectorId:"[data-product-select]",singleOptionSelector:"[data-variant-input]",variantColorSwatch:"[data-color-swatch]",productImageMain:".product-image-main",productVideo:"[data-product-video]",videoParent:".product__video-wrapper",slide:".product-main-slide",currentSlide:".is-selected",startingSlide:".starting-slide",media:"[data-product-media-type-model]",closeMedia:".product-single__close-media",blocks:"[data-product-blocks]",blocksHolder:"[data-blocks-holder]",formContainer:".product-single__form",availabilityContainer:"[data-store-availability]"};function Product(container){this.container=container,this.sectionId=container.getAttribute("data-section-id"),this.productId=container.getAttribute("data-product-id"),this.inModal=container.dataset.modal==="true",this.modal,this.namespace=".product-"+this.sectionId,this.namespaceImages=".product-image-"+this.sectionId,this.settings={enableHistoryState:container.dataset.history==="true"||!1,namespace:".product-"+this.sectionId,inventory:!1,inventoryThreshold:10,modalInit:!1,hasImages:!0,hasVideos:container.querySelectorAll(selectors.productVideo).length||!1,videoStyle:container.dataset.videoStyle,has3d:!1,imageSetName:null,imageSetIndex:null,currentImageSet:null,stackedImages:container.dataset.imagesStacked||!1,stackedCurrent:0,stackedImagePositions:[],imageSize:"620x",currentSlideIndex:0,videoLooping:container.dataset.videoLooping},this.videos={},this.inModal&&(this.settings.enableHistoryState=!1,this.namespace=".product-"+this.sectionId+"-modal",this.modal=document.getElementById("ProductScreen-"+this.sectionId)),this.init()}return Product.prototype=Object.assign({},Product.prototype,{init:function(){this.mainSlider=this.container.querySelector(selectors.mainSlider),this.thumbSlider=this.container.querySelector(selectors.thumbSlider),this.firstProductImage=this.mainSlider.querySelector("img"),this.firstProductImage||(this.settings.hasImages=!1);var dataSetEl=this.mainSlider.querySelector("[data-set-name]");this.settings.imageSetName=dataSetEl?dataSetEl.dataset.setName:!1,this.inModal&&(this.container.classList.add(classes.isModal),document.removeEventListener("productModalOpen.ProductScreen-"+this.sectionId,this.openModalProduct.bind(this)),document.removeEventListener("productModalClose.ProductScreen-"+this.sectionId,this.openModalProduct.bind(this)),document.addEventListener("productModalOpen.ProductScreen-"+this.sectionId,this.openModalProduct.bind(this)),document.addEventListener("productModalClose.ProductScreen-"+this.sectionId,this.closeModalProduct.bind(this))),this.inModal||(this.formSetup(),this.preImageSetup(),this.videoSetup(),this.initProductSlider())},formSetup:function(){this.initAjaxProductForm(),this.availabilitySetup(),this.initVariants(),this.settings.imageSetName&&this.updateImageSet()},availabilitySetup:function(){var container=this.container.querySelector(selectors.availabilityContainer);container&&(this.storeAvailability=new theme.StoreAvailability(container))},initVariants:function(){var variantJson=this.container.querySelector(selectors.variantsJson);if(variantJson){this.variantsObject=JSON.parse(variantJson.innerHTML);var options={container:this.container,enableHistoryState:this.settings.enableHistoryState,singleOptionSelector:selectors.singleOptionSelector,originalSelectorId:selectors.originalSelectorId,variants:this.variantsObject},swatches=this.container.querySelectorAll(selectors.variantColorSwatch);if(swatches.length&&swatches.forEach(swatch=>{swatch.addEventListener("change",function(evt){var color=swatch.dataset.colorName,index=swatch.dataset.colorIndex;this.updateColorName(color,index)}.bind(this))}),this.variants=new theme.Variants(options),this.storeAvailability){var variant_id=this.variants.currentVariant?this.variants.currentVariant.id:this.variants.variants[0].id;this.storeAvailability.updateContent(variant_id),this.container.on("variantChange"+this.settings.namespace,this.updateAvailability.bind(this))}this.container.on("variantChange"+this.namespace,this.updateCartButton.bind(this)),this.container.on("variantImageChange"+this.settings.namespace,this.updateVariantImage.bind(this)),this.container.on("variantPriceChange"+this.settings.namespace,this.updatePrice.bind(this)),this.container.on("variantUnitPriceChange"+this.settings.namespace,this.updateUnitPrice.bind(this)),this.container.querySelectorAll(selectors.sku).length&&this.container.on("variantSKUChange"+this.settings.namespace,this.updateSku.bind(this));var inventoryEl=this.container.querySelector(selectors.inventory);if(inventoryEl&&(this.settings.inventory=!0,this.settings.inventoryThreshold=inventoryEl.dataset.threshold,this.container.on("variantChange"+this.settings.namespace,this.updateInventory.bind(this))),theme.settings.dynamicVariantsEnable){var currentVariantJson=this.container.querySelector(selectors.currentVariantJson);if(currentVariantJson){var variantType=this.container.querySelector(selectors.variantType);variantType&&new theme.VariantAvailability({container:this.container,namespace:this.settings.namespace,type:variantType.dataset.type,variantsObject:this.variantsObject,currentVariantObject:JSON.parse(currentVariantJson.innerHTML),form:this.container.querySelector(selectors.formContainer)})}}if(this.settings.imageSetName){var variantWrapper=this.container.querySelector('.variant-input-wrap[data-handle="'+this.settings.imageSetName+'"]');variantWrapper?(this.settings.imageSetIndex=variantWrapper.dataset.index,this.container.on("variantChange"+this.settings.namespace,this.updateImageSet.bind(this))):this.settings.imageSetName=null}}},initAjaxProductForm:function(){if(theme.settings.cartType==="drawer"||theme.settings.cartType==="sticky"){var form=this.container.querySelector(selectors.formContainer);new theme.AjaxProduct(form,selectors.addToCart,{scopedEventId:"ProductScreen-"+this.sectionId})}},updateColorName:function(color,index){var label=this.container.querySelector('[data-color-label][data-color-label-index="'+index+'"]');label&&(label.textContent=color)},updateCartButton:function(evt){var variant=evt.detail.variant,cartBtn=this.container.querySelector(selectors.addToCart),cartBtnText=this.container.querySelector(selectors.addToCartText);if(variant)if(variant.available){cartBtn.classList.remove(classes.disabled),cartBtn.disabled=!1;var defaultText=cartBtnText.dataset.defaultText;cartBtnText.textContent=defaultText}else cartBtn.classList.add(classes.disabled),cartBtn.disabled=!0,cartBtnText.textContent=theme.strings.soldOut;else cartBtn.classList.add(classes.disabled),cartBtn.disabled=!0,cartBtnText.textContent=theme.strings.unavailable},updatePrice:function(evt){var variant=evt.detail.variant;variant&&(this.container.querySelector(selectors.price).innerHTML=theme.Currency.formatMoney(variant.price,theme.settings.moneyFormat),variant.compare_at_price>variant.price?(this.container.querySelector(selectors.comparePrice).innerHTML=theme.Currency.formatMoney(variant.compare_at_price,theme.settings.moneyFormat),this.container.querySelector(selectors.priceWrapper).classList.remove(classes.hidden),this.container.querySelector(selectors.price).classList.add(classes.onSale),this.container.querySelector(selectors.comparePriceA11y).setAttribute("aria-hidden","false"),this.container.querySelector(selectors.priceA11y).setAttribute("aria-hidden","false")):(this.container.querySelector(selectors.priceWrapper).classList.add(classes.hidden),this.container.querySelector(selectors.price).classList.remove(classes.onSale),this.container.querySelector(selectors.comparePriceA11y).setAttribute("aria-hidden","true"),this.container.querySelector(selectors.priceA11y).setAttribute("aria-hidden","true")))},updateUnitPrice:function(evt){var variant=evt.detail.variant;if(variant&&variant.unit_price){var price=theme.Currency.formatMoney(variant.unit_price,theme.settings.moneyFormat),base=theme.Currency.getBaseUnit(variant),el=this.container.querySelector(selectors.unitWrapper);el.innerHTML=price+"/"+base,el.classList.remove(classes.hidden,classes.visuallyHide)}else this.container.querySelector(selectors.unitWrapper).classList.add(classes.visuallyHide)},imageSetArguments:function(variant){var variant=variant||(this.variants?this.variants.currentVariant:null);if(variant){var setValue=this.settings.currentImageSet=this.getImageSetName(variant[this.settings.imageSetIndex]),set=this.settings.imageSetName+"_"+setValue;return this.settings.currentSlideIndex=0,{cellSelector:'[data-group="'+set+'"]',imageSet:set,initialIndex:this.settings.currentSlideIndex}}},updateImageSet:function(evt,reload){var variant=evt?evt.detail.variant:this.variants?this.variants.currentVariant:null;if(variant){var setValue=this.getImageSetName(variant[this.settings.imageSetIndex]),set=this.settings.imageSetName+"_"+setValue;if(this.settings.currentImageSet!==setValue)if(!theme.config.bpSmall&&this.settings.stackedImages){this.container.querySelectorAll("[data-group]").forEach(el=>{el.classList.add(classes.hidden),el.dataset.group&&el.dataset.group===set&&el.classList.remove(classes.hidden)}),this.stackedImagePositions(),AOS.refresh(),this.settings.currentImageSet=setValue;return}else theme.config.bpSmall&&this.settings.stackedImages&&this.container.querySelectorAll("[data-group]").forEach(el=>{el.classList.remove(classes.hidden)}),this.initProductSlider(variant)}},updateImageSetThumbs:function(set){this.settings.stackedImages||this.thumbSlider.querySelectorAll(".product__thumb-item").forEach(thumb=>{thumb.classList.toggle(classes.hidden,thumb.dataset.group!==set)})},getImageSetName:function(string){return string.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-$/,"").replace(/^-/,"")},updateSku:function(evt){var variant=evt.detail.variant,newSku="",hideSku=!0;variant&&(variant.sku&&(newSku=variant.sku,hideSku=!1),this.container.querySelectorAll(selectors.sku).forEach(el=>{el.classList.toggle(classes.hidden,hideSku),el.textContent=newSku}))},updateInventory:function(evt){var variant=evt.detail.variant;if(!variant||!variant.inventory_management||variant.inventory_policy==="continue"){this.toggleInventoryQuantity(variant,!1),this.toggleIncomingInventory(!1);return}if(variant.inventory_management==="shopify"&&window.inventories&&window.inventories[this.productId]){var variantInventoryObject=window.inventories[this.productId][variant.id];if(variantInventoryObject.policy==="continue"){this.toggleInventoryQuantity(variant,!1),this.toggleIncomingInventory(!1);return}var quantity=variantInventoryObject.quantity,showInventory=!0,showIncomingInventory=!1;(quantity<=0||quantity>this.settings.inventoryThreshold)&&(showInventory=!1),this.toggleInventoryQuantity(variant,showInventory,quantity),!showInventory&&variantInventoryObject.incoming==="true"&&quantity<=this.settings.inventoryThreshold&&(showIncomingInventory=!0),this.toggleIncomingInventory(showIncomingInventory,variant.available,variantInventoryObject.next_incoming_date)}},updateAvailability:function(evt){var variant=evt.detail.variant;variant&&this.storeAvailability.updateContent(variant.id)},toggleInventoryQuantity:function(variant,show,qty){this.settings.inventory||(show=!1);var el=this.container.querySelector(selectors.inventory),salesPoint=el.closest(".product-block");parseInt(qty)<=parseInt(this.settings.inventoryThreshold)?(el.parentNode.classList.add("inventory--low"),el.textContent=theme.strings.stockLabel.replace("[count]",qty)):(el.parentNode.classList.remove("inventory--low"),el.textContent=theme.strings.inStockLabel),variant&&variant.available?(el.parentNode.classList.remove(classes.hidden),salesPoint&&salesPoint.classList.remove(classes.hidden)):(el.parentNode.classList.add(classes.hidden),salesPoint&&salesPoint.classList.add(classes.hidden))},toggleIncomingInventory:function(show,available,date){var el=this.container.querySelector(selectors.incomingInventory),salesPoint=el.closest(".product-block");if(el){var textEl=el.querySelector(".js-incoming-text");if(show){var string=available?theme.strings.willNotShipUntil.replace("[date]",date):theme.strings.willBeInStockAfter.replace("[date]",date);date||(string=theme.strings.waitingForStock),el.classList.remove(classes.hidden),salesPoint&&salesPoint.classList.remove(classes.hidden),textEl.textContent=string}else el.classList.add(classes.hidden)}},videoSetup:function(){var productVideos=this.mainSlider.querySelectorAll(selectors.productVideo);if(!productVideos.length)return!1;productVideos.forEach(vid=>{var type=vid.dataset.videoType;type==="youtube"?this.initYoutubeVideo(vid):type==="mp4"&&this.initMp4Video(vid)})},initYoutubeVideo:function(div){videoObjects[div.id]=new theme.YouTube(div.id,{videoId:div.dataset.youtubeId,videoParent:selectors.videoParent,autoplay:!1,style:div.dataset.videoStyle,loop:div.dataset.videoLoop,events:{onReady:this.youtubePlayerReady.bind(this),onStateChange:this.youtubePlayerStateChange.bind(this)}})},youtubePlayerReady:function(evt){var iframeId=evt.target.getIframe().id;if(videoObjects[iframeId]){var obj=videoObjects[iframeId],player=obj.videoPlayer;obj.options.style!=="sound"&&player.mute(),obj.parent.classList.remove("loading"),obj.parent.classList.add("loaded"),this._isFirstSlide(iframeId)&&obj.options.style!=="sound"&&player.playVideo()}},_isFirstSlide:function(id){return this.mainSlider.querySelector(selectors.startingSlide+" #"+id)},youtubePlayerStateChange:function(evt){var iframeId=evt.target.getIframe().id,obj=videoObjects[iframeId];switch(evt.data){case-1:obj.attemptedToPlay&&obj.parent.classList.add("video-interactable");break;case 0:obj&&obj.options.loop==="true"&&obj.videoPlayer.playVideo();break;case 3:obj.attemptedToPlay=!0;break}},initMp4Video:function(div){videoObjects[div.id]={id:div.id,type:"mp4"},this._isFirstSlide(div.id)&&this.playMp4Video(div.id)},stopVideos:function(){for(var[id,vid]of Object.entries(videoObjects))vid.videoPlayer?typeof vid.videoPlayer.stopVideo=="function"&&vid.videoPlayer.stopVideo():vid.type==="mp4"&&this.stopMp4Video(vid.id)},_getVideoType:function(video){return video.getAttribute("data-video-type")},_getVideoDivId:function(video){return video.id},playMp4Video:function(id){var player=this.container.querySelector("#"+id),playPromise=player.play();player.setAttribute("controls",""),player.focus(),player.addEventListener("focusout",this.returnFocusToThumbnail.bind(this)),playPromise!==void 0&&playPromise.then(function(){}).catch(function(error){player.setAttribute("controls",""),player.closest(selectors.videoParent).setAttribute("data-video-style","unmuted")})},stopMp4Video:function(id){var player=this.container.querySelector("#"+id);player.removeEventListener("focusout",this.returnFocusToThumbnail.bind(this)),player&&typeof player.pause=="function"&&(player.removeAttribute("controls"),player.pause())},returnFocusToThumbnail:function(){var thumb=this.container.querySelector('.product__thumb-item[data-index="'+this.settings.currentSlideIndex+'"] a');thumb&&thumb.focus()},preImageSetup:function(){this.setImageSizes(),this.initImageSwitch(),this.initImageZoom(),this.customMediaListners(),this.initModelViewerLibraries(),this.initShopifyXrLaunch(),theme.collapsibles.init(this.container),window.SPR&&(SPR.initDomEls(),SPR.loadBadges())},initProductSlider:function(variant){if(this.mainSlider.querySelectorAll(selectors.slide).length<=1){var slide=this.mainSlider.querySelector(selectors.slide);slide&&slide.classList.add("is-selected");return}if(this.settings.has3d=this.container.querySelectorAll(selectors.media).length,this.settings.videoStyle!=="muted"&&theme.videoModal(!0),!variant){var activeSlide=this.mainSlider.querySelector(selectors.startingSlide);this.settings.currentSlideIndex=this._slideIndex(activeSlide)}var mainSliderArgs={adaptiveHeight:!0,avoidReflow:!0,initialIndex:this.settings.currentSlideIndex,childNav:this.thumbSlider,childNavScroller:this.container.querySelector(selectors.thumbScroller),childVertical:this.thumbSlider.dataset.position==="beside",fade:!this.settings.stackedImages,pageDots:!0,wrapAround:!0,callbacks:{onInit:this.onSliderInit.bind(this),onChange:this.onSlideChange.bind(this)}};if(this.settings.imageSetName){var imageSetArgs=this.imageSetArguments(variant);mainSliderArgs=Object.assign({},mainSliderArgs,imageSetArgs),this.updateImageSetThumbs(mainSliderArgs.imageSet)}this.initSliders(mainSliderArgs),document.addEventListener("matchSmall",function(){this.initSliders(mainSliderArgs,!0)}.bind(this)),document.addEventListener("unmatchSmall",function(){this.initSliders(mainSliderArgs,!0)}.bind(this))},onSliderInit:function(slide){this.settings.imageSetName&&this.prepMediaOnSlide(slide);var height=this.mainSlider.offsetHeight;height===0&&setTimeout(function(){window.dispatchEvent(new Event("resize"))},250)},onSlideChange:function(index){if(this.flickity){var prevSlide=this.mainSlider.querySelector('.product-main-slide[data-index="'+this.settings.currentSlideIndex+'"]'),nextSlide=this.settings.imageSetName?this.mainSlider.querySelectorAll(".flickity-slider .product-main-slide")[index]:this.mainSlider.querySelector('.product-main-slide[data-index="'+index+'"]');prevSlide.setAttribute("tabindex","-1"),nextSlide.setAttribute("tabindex",0),this.stopMediaOnSlide(prevSlide),this.prepMediaOnSlide(nextSlide),this.settings.currentSlideIndex=index}},stopMediaOnSlide(slide){var video=slide.querySelector(selectors.productVideo);if(video){var videoType=this._getVideoType(video),videoId=this._getVideoDivId(video);if(videoType==="youtube"){if(videoObjects[videoId].videoPlayer){videoObjects[videoId].videoPlayer.stopVideo();return}}else if(videoType==="mp4"){this.stopMp4Video(videoId);return}}var currentMedia=slide.querySelector(selectors.media);currentMedia&¤tMedia.dispatchEvent(new CustomEvent("mediaHidden",{bubbles:!0,cancelable:!0}))},prepMediaOnSlide(slide){var video=slide.querySelector(selectors.productVideo);if(video){var videoType=this._getVideoType(video),videoId=this._getVideoDivId(video);if(videoType==="youtube"){if(videoObjects[videoId].videoPlayer&&videoObjects[videoId].options.style!=="sound"){videoObjects[videoId].videoPlayer.playVideo();return}}else videoType==="mp4"&&this.playMp4Video(videoId)}var nextMedia=slide.querySelector(selectors.media);nextMedia&&(nextMedia.dispatchEvent(new CustomEvent("mediaVisible",{bubbles:!0,cancelable:!0})),slide.querySelector(".shopify-model-viewer-ui__button").setAttribute("tabindex",0),slide.querySelector(".product-single__close-media").setAttribute("tabindex",0)),this.hideZoomOverlay(nextMedia)},_slideIndex:function(el){return el.getAttribute("data-index")},initImageZoom:function(){var container=this.container.querySelector(selectors.imageContainer);if(container){var imageZoom=new theme.Photoswipe(container,this.sectionId);container.addEventListener("photoswipe:afterChange",function(evt){this.flickity&&this.flickity.goToSlide(evt.detail.index)}.bind(this))}},getThumbIndex:function(target){return target.dataset.index},setImageSizes:function(){if(this.settings.hasImages){var currentImage=this.firstProductImage.currentSrc;currentImage&&(this.settings.imageSize=theme.Images.imageSize(currentImage))}},updateVariantImage:function(evt){var variant=evt.detail.variant,sizedImgUrl=theme.Images.getSizedImageUrl(variant.featured_media.preview_image.src,this.settings.imageSize),newImage=this.container.querySelector('.product-main-slide[data-id="'+variant.featured_media.id+'"]'),imageIndex=this.getThumbIndex(newImage);typeof imageIndex>"u"||(!theme.config.bpSmall&&this.settings.stackedImages?this.stackedScrollTo(imageIndex):this.flickity&&this.flickity.goToSlide(imageIndex))},initImageSwitch:function(){var thumbs=this.container.querySelectorAll(selectors.photoThumbs);thumbs.length&&thumbs.forEach(thumb=>{thumb.addEventListener("click",function(evt){if(evt.preventDefault(),!theme.config.bpSmall&&this.settings.stackedImages){var index=this.getThumbIndex(thumb);this.stackedScrollTo(index)}}.bind(this)),thumb.addEventListener("focus",function(evt){var index=this.getThumbIndex(thumb);theme.config.bpSmall||(this.settings.stackedImages?(this.container.querySelectorAll(selectors.photoThumbItem).forEach(el=>{el.classList.remove(classes.thumbActive)}),this.stackedScrollTo(index)):this.flickity&&this.flickity.goToSlide(index))}.bind(this)),thumb.addEventListener("keydown",function(evt){evt.keyCode===13&&this.container.querySelector(selectors.currentSlide).focus()}.bind(this))})},stackedImagesInit:function(){window.off(this.namespaceImages),this.stackedImagePositions(),this.inModal?setTimeout(function(){this.stackedActive(this.settings.stackedCurrent)}.bind(this),1e3):this.stackedActive(this.settings.stackedCurrent),window.on("resize"+this.namespaceImages,theme.utils.debounce(200,this.stackedImagePositions.bind(this))),window.on("scroll"+this.namespaceImages,theme.utils.throttle(200,function(){var goal=window.scrollY,closest=this.settings.stackedImagePositions.reduce(function(prev,curr){return Math.abs(curr-goal){positions.push(Math.round(el.offsetTop))}),this.settings.stackedImagePositions=positions},stackedScrollTo:function(index){var img=this.container.querySelectorAll(selectors.photo)[index];if(img){var pos=img.offsetTop;window.scroll({top:pos,behavior:"smooth"})}},stackedActive:function(index){this.container.querySelectorAll(selectors.photoThumbItem).forEach(el=>{el.classList.remove(classes.thumbActive),el.classList.remove("is-active")});var thumb=this.container.querySelectorAll(selectors.photoThumbItem)[index];if(thumb&&(thumb.classList.add(classes.thumbActive),this.settings.currentSlideIndex=thumb.dataset.index),this.settings.hasVideos){this.stopVideos();var video=this.container.querySelectorAll(selectors.photo)[index].querySelector(".product__video");if(video){var videoType=this._getVideoType(video),videoId=this._getVideoDivId(video);if(videoType==="youtube"){if(videoObjects[videoId].videoPlayer&&videoObjects[videoId].options.style!=="sound"){videoObjects[videoId].videoPlayer.playVideo();return}}else videoType==="mp4"&&this.playMp4Video(videoId)}}if(this.settings.has3d){var allMedia=this.container.querySelectorAll(selectors.media);allMedia.length&&allMedia.forEach(el=>{el.dispatchEvent(new CustomEvent("mediaHidden"))});var media=this.container.querySelectorAll(selectors.photo)[index].querySelector(selectors.media);media&&media.dispatchEvent(new CustomEvent("mediaVisible"))}this.settings.stackedCurrent=index},initSliders:function(args,reload){this.destroyImageCarousels(),!theme.config.bpSmall&&this.settings.stackedImages?this.stackedImagesInit():theme.promiseStylesheet().then(function(){this.flickity=new theme.Slideshow(this.mainSlider,args)}.bind(this))},destroyImageCarousels:function(){this.flickity&&typeof this.flickity.destroy=="function"&&this.flickity.destroy()},hideZoomOverlay:function(hide){var btn=this.container.querySelector(selectors.zoomButton);hide?btn&&btn.classList.add(classes.hidden):btn&&btn.classList.remove(classes.hidden)},openModalProduct:function(){var initialized=!1;if(this.settings.modalInit)initialized=!0,!theme.config.bpSmall&&this.settings.stackedImages&&this.stackedActive(0);else{this.blocksHolder=this.container.querySelector(selectors.blocksHolder);var url=this.blocksHolder.dataset.url;fetch(url).then(function(response){return response.text()}).then(function(html){var parser=new DOMParser,doc=parser.parseFromString(html,"text/html"),blocks=doc.querySelector(selectors.blocks);blocks.querySelectorAll("[id]").forEach(el=>{var val=el.getAttribute("id");el.setAttribute("id",val+"-modal");var label=blocks.querySelector(`[for="${val}"]`);label&&label.setAttribute("for",val+"-modal");var collapsibleTrigger=blocks.querySelector(`[aria-controls="${val}"]`);collapsibleTrigger&&collapsibleTrigger.setAttribute("aria-controls",val+"-modal")});var form=blocks.querySelector(selectors.formContainer),formId=form.getAttribute("id");blocks.querySelectorAll("[form]").forEach(el=>{el.setAttribute("form",formId)}),this.blocksHolder.innerHTML="",this.blocksHolder.append(blocks),this.formSetup(),this.updateModalProductInventory(),Shopify&&Shopify.PaymentButton&&Shopify.PaymentButton.init(),theme.collapsibles.init(this.container);var allSections=doc.querySelectorAll("#MainContent .shopify-section:not(.shopify-section__product)");allSections.length&&this.loadProductSections(allSections);var socialDiv=doc.querySelector(".index-section.social-section");socialDiv&&this.loadSocialSection(socialDiv),window.SPR&&(SPR.initDomEls(),SPR.loadBadges()),theme.sections.loadSubSections(this.modal),document.dispatchEvent(new CustomEvent("quickview:loaded",{detail:{productId:this.sectionId}})),this.preImageSetup(),this.initProductSlider(),this.settings.modalInit=!0}.bind(this))}document.dispatchEvent(new CustomEvent("quickview:open",{detail:{initialized,productId:this.sectionId}}))},updateModalProductInventory:function(){window.inventories=window.inventories||{},this.container.querySelectorAll(".js-product-inventory-data").forEach(el=>{var productId=el.dataset.productId;window.inventories[productId]={},el.querySelectorAll(".js-variant-inventory-data").forEach(el2=>{window.inventories[productId][el2.dataset.id]={quantity:el2.dataset.quantity,policy:el2.dataset.policy,incoming:el2.dataset.incoming,next_incoming_date:el2.dataset.date}})})},closeModalProduct:function(){this.stopVideos(),window.off(this.namespace)},loadProductSections:function(content){var holder=document.querySelector("#ProductSectionsHolder-"+this.productId);holder&&(holder.innerHTML="",holder.append(...content),theme.collapsibles.init(holder))},loadSocialSection:function(content){var holder=document.querySelector("#SocialSectionHolder-"+this.productId);holder&&holder.replaceWith(content)},initModelViewerLibraries:function(){var modelViewerElements=this.container.querySelectorAll(selectors.media);modelViewerElements.length<1||theme.ProductMedia.init(modelViewerElements,this.sectionId)},initShopifyXrLaunch:function(){document.addEventListener("shopify_xr_launch",function(){var currentMedia=this.container.querySelector(selectors.productMediaWrapper+":not(."+self.classes.hidden+")");currentMedia.dispatchEvent(new CustomEvent("xrLaunch",{bubbles:!0,cancelable:!0}))}.bind(this))},customMediaListners:function(){this.container.querySelectorAll(selectors.closeMedia).forEach(el=>{el.addEventListener("click",function(){if(this.settings.stackedImages)var slide=this.mainSlider.querySelector('.product-main-slide[data-index="'+this.settings.currentSlideIndex+'"]');else var slide=this.mainSlider.querySelector(selectors.currentSlide);var media=slide.querySelector(selectors.media);media&&media.dispatchEvent(new CustomEvent("mediaHidden",{bubbles:!0,cancelable:!0}))}.bind(this))});var modelViewers=this.container.querySelectorAll("model-viewer");modelViewers.length&&modelViewers.forEach(el=>{el.addEventListener("shopify_model_viewer_ui_toggle_play",function(evt){this.mediaLoaded(evt)}.bind(this)),el.addEventListener("shopify_model_viewer_ui_toggle_pause",function(evt){this.mediaUnloaded(evt)}.bind(this))})},mediaLoaded:function(evt){this.container.querySelectorAll(selectors.closeMedia).forEach(el=>{el.classList.remove(classes.hidden)}),this.flickity&&this.flickity.setDraggable(!1)},mediaUnloaded:function(evt){this.container.querySelectorAll(selectors.closeMedia).forEach(el=>{el.classList.add(classes.hidden)}),this.flickity&&this.flickity.setDraggable(!0)},onUnload:function(){window.off(this.namespace),this.container.off(this.namespace),this.destroyImageCarousels(),theme.ProductMedia.removeSectionModels(this.sectionId),AOS&&AOS.refresh()}}),Product}(),theme.Blog=function(){function Blog(container){this.tagFilters()}return Blog.prototype=Object.assign({},Blog.prototype,{tagFilters:function(){var filterBy=document.getElementById("BlogTagFilter");filterBy&&filterBy.addEventListener("change",function(){location.href=filterBy.value})}}),Blog}(),theme.HeaderSection=function(){function HeaderSection(container){this.initDrawers(),theme.headerNav.init(),theme.slideNav.init(),Shopify&&Shopify.designMode&&(theme.sections.reinit("slideshow-section"),setTimeout(function(){window.dispatchEvent(new Event("resize"))},500))}return HeaderSection.prototype=Object.assign({},HeaderSection.prototype,{initDrawers:function(){theme.settings.cartType==="drawer"&&(document.body.classList.contains("template-cart")||new theme.CartDrawer)},onUnload:function(){theme.headerNav.unload(),theme.slideNav.unload()}}),HeaderSection}(),theme.FooterSection=function(){var selectors={locale:"[data-disclosure-locale]",currency:"[data-disclosure-currency]"};function FooterSection(container){this.container=container,this.localeDisclosure=null,this.currencyDisclosure=null,theme.initWhenVisible({element:this.container,callback:this.init.bind(this),threshold:1e3})}return FooterSection.prototype=Object.assign({},FooterSection.prototype,{init:function(){var localeEl=this.container.querySelector(selectors.locale),currencyEl=this.container.querySelector(selectors.currency);localeEl&&(this.localeDisclosure=new theme.Disclosure(localeEl)),currencyEl&&(this.currencyDisclosure=new theme.Disclosure(currencyEl))},onUnload:function(){this.localeDisclosure&&this.localeDisclosure.destroy(),this.currencyDisclosure&&this.currencyDisclosure.destroy()}}),FooterSection}(),theme.Collection=function(){var isAnimating=!1,selectors={sortSelect:"#SortBy"};function Collection(container){this.container=container,this.sectionId=container.getAttribute("data-section-id"),this.namespace=".collection-"+this.sectionId;var hasHeroImage=document.querySelector(".collection-hero");hasHeroImage?this.checkIfNeedReload():theme.settings.overlayHeader&&theme.headerNav.disableOverlayHeader(),this.init()}return Collection.prototype=Object.assign({},Collection.prototype,{init:function(){this.container=this.container,this.sectionId=this.container.getAttribute("data-section-id"),this.sortSelect=document.querySelector(selectors.sortSelect),this.sortSelect&&(this.sortSelect.on("change",this.onSortChange.bind(this)),this.defaultSort=this.getDefaultSortValue()),new theme.HoverProductGrid(this.container),this.initParams(),this.sortTags(),this.bindBackButton()},initParams:function(){if(this.queryParams={},location.search.length)for(var aKeyValue,aCouples=location.search.substr(1).split("&"),i=0;i1&&(this.queryParams[decodeURIComponent(aKeyValue[0])]=decodeURIComponent(aKeyValue[1]))},getSortValue:function(){return this.sortSelect.value||this.defaultSort},getDefaultSortValue:function(){return this.sortSelect.dataset.sortBy},onSortChange:function(){this.queryParams.sort_by=this.getSortValue(),this.queryParams.page&&delete this.queryParams.page,window.location.search=decodeURIComponent(new URLSearchParams(Object.entries(this.queryParams)))},sortTags:function(){var sortTags=document.getElementById("SortTags");sortTags&&sortTags.on("change",function(evt){location.href=sortTags.value})},bindBackButton:function(){window.off("popstate"+this.namespace),window.on("popstate"+this.namespace,state=>{if(state){if(location.href.indexOf(location.pathname)>=0)return!0;const newUrl=new URL(window.location.href);theme.CollectionAjaxFilter(newUrl,!1).then(()=>{isAnimating=!1,this.initPriceRange()})}})},checkIfNeedReload:function(){if(Shopify.designMode&&theme.settings.overlayHeader){var headerWrapper=document.querySelector(".header-wrapper");headerWrapper.classList.contains("header-wrapper--overlay")||location.reload()}},forceReload:function(){this.onUnload(),this.init()},onUnload:function(){window.off(this.namespace),this.container.off(this.namespace)}}),Collection}(),theme.CollectionFilter=function(){var isAnimating=!1,selectors={activeTagList:".tag-list--active-tags",activeTags:".tag-list a",filters:".collection-filter",priceRange:".price-range",tags:".tag-list input",tagsForm:".filter-form"},classes={activeTag:"tag--active",removeTagParent:"tag--remove"};function CollectionFilter(container){this.container=container,this.sectionId=container.getAttribute("data-section-id"),this.namespace=".collection-filter-"+this.sectionId,this.init()}return CollectionFilter.prototype=Object.assign({},CollectionFilter.prototype,{init:function(){document.querySelectorAll(selectors.activeTags).forEach(tag=>{tag.on("click"+this.namespace,this.onTagClick.bind(this))}),document.querySelectorAll(selectors.tagsForm).forEach(form=>{form.addEventListener("input",this.onFormSubmit.bind(this))}),this.initPriceRange()},initPriceRange:function(){document.querySelectorAll(selectors.priceRange).forEach(el=>new theme.PriceRange(el,{onChange:this.renderFromFormData.bind(this)}))},onTagClick:function(evt){var tag=evt.currentTarget;if(tag.classList.contains("no-ajax")||(evt.preventDefault(),isAnimating))return;isAnimating=!0;const parent=tag.parentNode,newUrl=new URL(tag.href);this.renderActiveTag(parent,tag),this.startLoading(),this.renderCollectionPage(newUrl.searchParams)},onFormSubmit:function(evt){const tag=evt.target;if(tag.classList.contains("no-ajax")||(evt.preventDefault(),isAnimating))return;isAnimating=!0;const parent=tag.closest("li"),formEl=tag.closest("form"),formData=new FormData(formEl);this.renderActiveTag(parent,tag),this.startLoading(),this.renderFromFormData(formData)},renderCollectionPage:function(searchParams){theme.CollectionAjaxFilter(searchParams).then(()=>{isAnimating=!1,this.initPriceRange()})},renderFromFormData:function(formData){const searchParams=new URLSearchParams(formData);this.renderCollectionPage(searchParams)},renderActiveTag:function(parent,el){const textEl=parent.querySelector(".tag__text");if(parent.classList.contains(classes.activeTag))parent.classList.remove(classes.activeTag);else{if(el.closest("li").classList.contains(classes.removeTagParent))parent.remove();else{const newTag=document.createElement("li");newTag.classList.add("tag","tag--remove");const tagLink=document.createElement("a");tagLink.classList.add("btn","btn--small","js-no-transition"),tagLink.innerText=textEl.innerText,newTag.appendChild(tagLink);const tagList=document.querySelector(selectors.activeTagList);tagList&&tagList.append(newTag)}parent.classList.add(classes.activeTag)}},startLoading:function(){document.querySelectorAll(".grid-product").forEach(el=>{el.classList.add("unload")})},forceReload:function(){this.init()}}),CollectionFilter}(),theme.CollectionAjaxFilter=function(searchParams,updateURLHash=!0){const selectors={filterWrapperId:"CollectionFiltersSection",productWrapperId:"CollectionSection",productContentId:"CollectionAjaxContent"},filterWrapper=document.getElementById(selectors.filterWrapperId),productWrapper=document.getElementById(selectors.productWrapperId);return new theme.AjaxRenderer({sections:[{sectionId:filterWrapper.dataset.sectionId,nodeId:selectors.filterWrapperId},{sectionId:productWrapper.dataset.sectionId,nodeId:selectors.productContentId}],preserveParams:["sort_by"]}).renderPage(window.location.pathname,searchParams,updateURLHash).then(()=>{theme.sections.reinit("collection-template"),theme.sections.reinit("collection-filter");const newProductContent=document.getElementById(selectors.productContentId);theme.reinitProductGridItem(newProductContent),theme.QuickShopScreens.reInit(newProductContent)})},theme.FeaturedCollection=function(){var selectors={scrollWrap:"[data-pagination-wrapper]",productContainer:"[data-product-container]",collectionProductContainer:"[data-collection-container]",product:"[data-product-grid]",arrows:"[data-arrow]"},classes={loading:"collection-loading",arrowLeft:"overflow-scroller__arrow--left",disableScrollLeft:"overflow-scroller--disable-left",disableScrollRight:"overflow-scroller--disable-right"};function FeaturedCollection(container){this.container=container,this.sectionId=this.container.getAttribute("data-section-id"),this.scrollWrap=this.container.querySelector(selectors.scrollWrap),this.scrollArrows=this.container.querySelectorAll(selectors.arrows),this.namespace=".featured-collection-"+this.sectionId,this.options={scrollable:this.container.dataset.scrollable,paginate:this.container.dataset.paginate};var paginateBy=this.container.dataset.paginateBy,productCount=this.container.dataset.collectionCount;this.settings={url:this.container.dataset.collectionUrl,page:1,pageCount:this.options.paginate?Math.ceil(productCount/paginateBy):0,itemsToScroll:3,gridItemWidth:this.container.dataset.gridItemWidth},this.state={isInit:!1,loading:!1,scrollerEnabled:!1,loadedAllProducts:!1,scrollable:this.options.scrollable,scrollInterval:null,scrollSpeed:3},this.sizing={scroller:0,itemWidth:0},theme.promiseStylesheet().then(function(){theme.initWhenVisible({element:this.container,callback:this.init.bind(this)})}.bind(this))}return FeaturedCollection.prototype=Object.assign({},FeaturedCollection.prototype,{init:function(){new theme.HoverProductGrid(this.container),this.state.scrollable&&(this.sizing=this.getScrollWidths(),window.on("resize"+this.namespace,theme.utils.debounce(200,this.handleResize.bind(this))),this.toggleScrollListener(this.state.scrollable),this.arrowListeners(this.state.scrollable),this.state.isInit=!0)},reInit:function(){new theme.HoverProductGrid(this.container),this.state.scrollable&&(this.sizing=this.getScrollWidths(),this.toggleScrollListener(this.state.scrollable)),theme.reinitProductGridItem()},loadingState:function(loading){this.state.loading=loading,this.container.classList.toggle(classes.loading,loading)},getScrollWidths:function(){var container=this.scrollWrap.offsetWidth,scroller=this.scrollWrap.scrollWidth,item=this.scrollWrap.querySelector(".grid__item"),itemWidth=item.offsetWidth;return this.state.isInit||(scroller=scroller-200),scroller<=container&&this.disableArrow(null,!0),{scroller,scrollSize:scroller-container,itemWidth}},handleResize:function(){this.state.scrollable&&(this.sizing=this.getScrollWidths()),this.toggleScrollListener(this.state.scrollable),this.arrowListeners(this.state.scrollable)},toggleScrollListener:function(enable){if(enable){if(this.state.scrollerEnabled)return;this.scrollWrap.on("scroll"+this.namespace,theme.utils.throttle(250,this.scrollCheck.bind(this))),this.state.scrollerEnabled=!0}else this.scrollWrap.off("scroll"+this.namespace),this.state.scrollerEnabled=!1},scrollCheck:function(evt){if(this.state.loading){this.toggleScrollListener(!1);return}this.sizing.scrollSize===0&&(this.sizing=this.getScrollWidths());var scrollLeft=evt.currentTarget.scrollLeft?evt.currentTarget.scrollLeft:0,percent=Math.floor(scrollLeft/this.sizing.scrollSize*100),fromEnd=this.sizing.scrollSize-scrollLeft;this.options.paginate&&!this.state.loadedAllProducts&&percent>50&&this.getNewProducts(),percent||(percent=0),this.disableArrow(percent)},arrowListeners:function(enable){this.scrollArrows.forEach(arrow=>{arrow.off("click"+this.namespace),enable?(arrow.classList.remove("hide"),arrow.on("click"+this.namespace,this.arrowScroll.bind(this))):arrow.classList.add("hide")})},arrowScroll:function(evt){var direction=evt.currentTarget.classList.contains(classes.arrowLeft)?"left":"right",iteration=theme.config.bpSmall?1:2;if(evt.type==="mouseenter")this.state.scrollInterval=setInterval(function(){var currentPos2=this.scrollWrap.scrollLeft,newPos2=direction==="left"?currentPos2-iteration:currentPos2+iteration;this.scrollWrap.scrollLeft=newPos2}.bind(this),this.state.scrollSpeed);else if(evt.type==="mouseleave")clearInterval(this.state.scrollInterval);else if(evt.type==="click"){clearInterval(this.state.scrollInterval);var currentPos=this.scrollWrap.scrollLeft,scrollAmount=this.sizing.itemWidth*this.settings.itemsToScroll,newPos=direction==="left"?currentPos-scrollAmount:currentPos+scrollAmount;this.scrollWrap.scroll({left:newPos,behavior:"smooth"})}newPos<=0&&this.disableArrow(newPos)},disableArrow:function(pos,all){this.scrollArrows.forEach(arrow=>{if(arrow.classList.remove(classes.disableScrollRight),arrow.classList.remove(classes.disableScrollLeft),all){arrow.classList.add(classes.disableScrollRight),arrow.classList.add(classes.disableScrollLeft);return}if(pos<=10){arrow.classList.add(classes.disableScrollLeft);return}if(pos>=96){arrow.classList.add(classes.disableScrollRight);return}})},getNewProducts:function(){this.loadingState(!0);var newPage=this.settings.page+1,itemWidth=this.settings.gridItemWidth;if(newPage>this.settings.pageCount){this.loadingState(!1),this.state.loadedAllProducts=!0;return}var newUrl=this.settings.url+"?page="+newPage;fetch(newUrl).then(function(response){return response.text()}).then(function(html){var parser=new DOMParser,doc=parser.parseFromString(html,"text/html"),newProducts=doc.querySelectorAll(selectors.collectionProductContainer+" .grid-product"),fragment=document.createDocumentFragment();newProducts.forEach(prod=>{prod.classList.add(itemWidth),fragment.appendChild(prod)}),this.container.querySelector(selectors.productContainer).appendChild(fragment),this.ajaxSuccess()}.bind(this))},ajaxSuccess:function(){this.loadingState(!1),this.settings.page=this.settings.page+1,this.reInit()},forceReload:function(){this.onUnload(),this.init()},onLoad:function(){theme.QuickShopScreens.reInit(this.container)},onUnload:function(){window.off(this.namespace),window.dispatchEvent(new Event("resize")),this.scrollWrap.off(this.namespace),theme.QuickShopScreens.unload(this.container)}}),FeaturedCollection}(),theme.Testimonials=function(){var defaults={adaptiveHeight:!1,avoidReflow:!0,pageDots:!0,prevNextButtons:!1,wrapAround:!0};function Testimonials(container){this.container=container;var sectionId=container.getAttribute("data-section-id");this.slideshow=container.querySelector("#Testimonials-"+sectionId),this.slideshow&&theme.promiseStylesheet().then(function(){theme.initWhenVisible({element:this.container,callback:this.init.bind(this),threshold:600})}.bind(this))}return Testimonials.prototype=Object.assign({},Testimonials.prototype,{init:function(obj,args){this.slideshow.dataset.count<=3&&(defaults.wrapAround=!1,defaults.contain=!0),this.flickity=new theme.Slideshow(this.slideshow,defaults),this.flickity.resize()},onUnload:function(){this.flickity&&typeof this.flickity.destroy=="function"&&this.flickity.destroy()},onDeselect:function(){this.flickity&&typeof this.flickity.play=="function"&&this.flickity.play()},onBlockSelect:function(evt){var slide=this.slideshow.querySelector(".testimonials-slide--"+evt.detail.blockId),index=parseInt(slide.dataset.index);clearTimeout(this.timeout),this.flickity&&typeof this.flickity.pause=="function"&&(this.flickity.goToSlide(index),this.flickity.pause())},onBlockDeselect:function(){this.flickity&&typeof this.flickity.play=="function"&&this.flickity.play()}}),Testimonials}(),theme.HeroAnimated=function(){var classes={active:"animated__slide--active",inactive:"animated__slide--inactive"};function HeroAnimated(container){this.container=container;var imageCount=container.dataset.count,imageContainer=container.querySelector(".hero");if(imageContainer&&theme.loadImageSection(imageContainer),this.allImages=container.querySelectorAll(".animated__slide"),this.state={activeIndex:0},imageCount===1){this.setFades(!0);return}this.interval,this.intervalSpeed=container.dataset.interval,this.maxIndex=imageCount-1,theme.promiseStylesheet().then(function(){theme.initWhenVisible({element:this.container,callback:this.initInterval.bind(this)})}.bind(this))}return HeroAnimated.prototype=Object.assign({},HeroAnimated.prototype,{initInterval:function(){this.setFades(!0),this.interval=setInterval(function(){this.setFades()}.bind(this),this.intervalSpeed)},setFades:function(first){var nextIndex=this.state.activeIndex===this.maxIndex?0:this.state.activeIndex+1;if(first&&(nextIndex=this.state.activeIndex),!first){var image=this.allImages[this.state.activeIndex];image.classList.remove(classes.active),image.classList.add(classes.inactive)}var nextImage=this.allImages[nextIndex];nextImage.classList.remove(classes.inactive),nextImage.classList.add(classes.active),this.state.activeIndex=nextIndex},onUnload:function(){clearInterval(this.interval)}}),HeroAnimated}(),theme.Maps=function(){var config={zoom:14},apiStatus=null,mapsToLoad=[],errors={},selectors={section:'[data-section-type="map"]',map:"[data-map]",mapOverlay:".map-section__overlay"};window.gm_authFailure=function(){Shopify.designMode&&(document.querySelectorAll(selectors.section).forEach(section=>{section.classList.add("map-section--load-error")}),document.querySelectorAll(selectors.map).forEach(map=>{map.parentNode.removeChild(map)}),window.mapError(theme.strings.authError))},window.mapError=function(error){var message=document.createElement("div");message.classList.add("map-section__error","errors","text-center"),message.innerHTML=error,document.querySelectorAll(selectors.mapOverlay).forEach(overlay=>{overlay.parentNode.prepend(message)}),document.querySelectorAll(".map-section__link").forEach(link=>{link.classList.add("hide")})};function Map(container){this.container=container,this.sectionId=this.container.getAttribute("data-section-id"),this.namespace=".map-"+this.sectionId,this.map=container.querySelector(selectors.map),this.key=this.map.dataset.apiKey,errors={addressNoResults:theme.strings.addressNoResults,addressQueryLimit:theme.strings.addressQueryLimit,addressError:theme.strings.addressError,authError:theme.strings.authError},this.key&&theme.initWhenVisible({element:this.container,callback:this.prepMapApi.bind(this),threshold:20})}function initAllMaps(){mapsToLoad.forEach(instance=>{instance.createMap()})}function geolocate(map){var geocoder=new google.maps.Geocoder;if(map){var address=map.dataset.addressSetting,deferred=new Promise((resolve,reject)=>{geocoder.geocode({address},function(results,status){status!==google.maps.GeocoderStatus.OK&&reject(status),resolve(results)})});return deferred}}return Map.prototype=Object.assign({},Map.prototype,{prepMapApi:function(){if(apiStatus==="loaded")this.createMap();else if(mapsToLoad.push(this),apiStatus!=="loading"&&(apiStatus="loading",typeof window.google>"u"||typeof window.google.maps>"u")){var script=document.createElement("script");script.onload=function(){apiStatus="loaded",initAllMaps()},script.src="https://maps.googleapis.com/maps/api/js?key="+this.key,document.head.appendChild(script)}},createMap:function(){var mapDiv=this.map;return geolocate(mapDiv).then(function(results){var mapOptions={zoom:config.zoom,backgroundColor:"none",center:results[0].geometry.location,draggable:!1,clickableIcons:!1,scrollwheel:!1,disableDoubleClickZoom:!0,disableDefaultUI:!0},map=this.map=new google.maps.Map(mapDiv,mapOptions),center=this.center=map.getCenter(),marker=new google.maps.Marker({map,position:map.getCenter()});google.maps.event.addDomListener(window,"resize",theme.utils.debounce(250,function(){google.maps.event.trigger(map,"resize"),map.setCenter(center),mapDiv.removeAttribute("style")})),Shopify.designMode&&window.AOS&&AOS.refreshHard()}.bind(this)).catch(function(status){var errorMessage;switch(status){case"ZERO_RESULTS":errorMessage=errors.addressNoResults;break;case"OVER_QUERY_LIMIT":errorMessage=errors.addressQueryLimit;break;case"REQUEST_DENIED":errorMessage=errors.authError;break;default:errorMessage=errors.addressError;break}Shopify.designMode&&window.mapError(errorMessage)})},onUnload:function(){this.map.length!==0&&google&&google.maps&&google.maps.event&&google.maps.event.clearListeners(this.map,"resize")}}),Map}(),theme.SlideshowSection=function(){var selectors={parallaxContainer:".parallax-container"};function SlideshowSection(container){this.container=container;var sectionId=container.getAttribute("data-section-id");if(this.slideshow=container.querySelector("#Slideshow-"+sectionId),this.namespace="."+sectionId,this.initialIndex=0,!!this.slideshow){var sectionEl=container.parentElement,sectionIndex=[].indexOf.call(sectionEl.parentElement.children,sectionEl);sectionIndex===0?this.init():theme.initWhenVisible({element:this.container,callback:this.init.bind(this)})}}return SlideshowSection.prototype=Object.assign({},SlideshowSection.prototype,{init:function(){var slides=this.slideshow.querySelectorAll(".slideshow__slide");if(this.container.hasAttribute("data-immediate-load")?(this.slideshow.classList.remove("loading","loading--delayed"),this.slideshow.classList.add("loaded")):theme.loadImageSection(this.slideshow),slides.length>1){var sliderArgs={prevNextButtons:this.slideshow.hasAttribute("data-arrows"),pageDots:this.slideshow.hasAttribute("data-dots"),fade:!0,setGallerySize:!1,initialIndex:this.initialIndex,autoPlay:this.slideshow.dataset.autoplay==="true"?parseInt(this.slideshow.dataset.speed):!1};this.flickity=new theme.Slideshow(this.slideshow,sliderArgs)}else slides[0].classList.add("is-selected");this.container.hasAttribute("data-parallax")&&this.container.querySelectorAll(selectors.parallaxContainer).forEach(function(el,i){new theme.Parallax(el,{namespace:this.namespace+"-parallax-"+i})}.bind(this))},forceReload:function(){this.onUnload(),this.init()},onUnload:function(){this.flickity&&typeof this.flickity.destroy=="function"&&this.flickity.destroy()},onDeselect:function(){this.flickity&&typeof this.flickity.play=="function"&&this.flickity.play()},onBlockSelect:function(evt){var slide=this.slideshow.querySelector(".slideshow__slide--"+evt.detail.blockId),index=parseInt(slide.dataset.index);this.flickity&&typeof this.flickity.pause=="function"?(this.flickity.goToSlide(index),this.flickity.pause()):(this.initialIndex=index,setTimeout(function(){this.flickity&&typeof this.flickity.pause=="function"&&this.flickity.pause()}.bind(this),1e3))},onBlockDeselect:function(){this.flickity&&typeof this.flickity.play=="function"&&this.flickity.args.autoPlay&&this.flickity.play()}}),SlideshowSection}(),theme.NewsletterPopup=function(){function NewsletterPopup(container){this.container=container;var sectionId=this.container.getAttribute("data-section-id");if(this.cookieName="newsletter-"+sectionId,!!container&&window.location.pathname!=="/challenge"&&window.location.pathname!=="/password"){if(this.data={secondsBeforeShow:container.dataset.delaySeconds,daysBeforeReappear:container.dataset.delayDays,cookie:Cookies.get(this.cookieName),testMode:container.dataset.testMode},this.modal=new theme.Modals("NewsletterPopup-"+sectionId,"newsletter-popup-modal"),(container.querySelector(".errors")||container.querySelector(".note--success"))&&this.modal.open(),container.querySelector(".note--success")){this.closePopup(!0);return}document.addEventListener("modalClose."+container.id,this.closePopup.bind(this)),(!this.data.cookie||this.data.testMode==="true")&&this.initPopupDelay()}}return NewsletterPopup.prototype=Object.assign({},NewsletterPopup.prototype,{initPopupDelay:function(){Shopify&&Shopify.designMode||setTimeout(function(){this.modal.open()}.bind(this),this.data.secondsBeforeShow*1e3)},closePopup:function(success){if(this.data.testMode==="true"){Cookies.remove(this.cookieName,{path:"/"});return}var expiry=success?200:this.data.daysBeforeReappear;Cookies.set(this.cookieName,"opened",{path:"/",expires:expiry})},onLoad:function(){this.modal.open()},onSelect:function(){this.modal.open()},onDeselect:function(){this.modal.close()}}),NewsletterPopup}(),theme.PasswordHeader=function(){function PasswordHeader(){this.init()}return PasswordHeader.prototype=Object.assign({},PasswordHeader.prototype,{init:function(){if(document.querySelector("#LoginModal")){var passwordModal=new theme.Modals("LoginModal","login-modal",{focusIdOnOpen:"password",solid:!0});document.querySelectorAll(".errors").length&&passwordModal.open()}}}),PasswordHeader}(),theme.Photoswipe=function(){var selectors={trigger:".js-photoswipe__zoom",images:".photoswipe__image",slideshowTrack:".flickity-viewport ",activeImage:".is-selected"};function Photoswipe(container,sectionId){this.container=container,this.sectionId=sectionId,this.namespace=".photoswipe-"+this.sectionId,this.gallery,this.images,this.items,this.inSlideshow=!1,!(!container||container.dataset.zoom==="false")&&(container.dataset.hasSlideshow==="true"&&(this.inSlideshow=!0),this.init())}return Photoswipe.prototype=Object.assign({},Photoswipe.prototype,{init:function(){this.container.querySelectorAll(selectors.trigger).forEach(trigger=>{trigger.on("click"+this.namespace,this.triggerClick.bind(this))})},triggerClick:function(evt){this.items=this.getImageData();var image=this.inSlideshow?this.container.querySelector(selectors.activeImage):evt.currentTarget,index=this.inSlideshow?this.getChildIndex(image):image.dataset.index;this.initGallery(this.items,index)},getChildIndex:function(el){for(var i=0;(el=el.previousSibling)!=null;)i++;return i+1},getImageData:function(){this.images=this.inSlideshow?this.container.querySelectorAll(selectors.slideshowTrack+selectors.images):this.container.querySelectorAll(selectors.images);var items=[],options={};return this.images.forEach(el=>{var item={msrc:el.currentSrc||el.src,src:el.getAttribute("data-photoswipe-src"),w:el.getAttribute("data-photoswipe-width"),h:el.getAttribute("data-photoswipe-height"),el,initialZoomLevel:.5};items.push(item)}),items},initGallery:function(items,index){var pswpElement=document.querySelectorAll(".pswp")[0],options={allowPanToNext:!1,captionEl:!1,closeOnScroll:!1,counterEl:!1,history:!1,index:index-1,pinchToClose:!1,preloaderEl:!1,scaleMode:"zoom",shareEl:!1,tapToToggleControls:!1,getThumbBoundsFn:function(index2){var pageYScroll=window.pageYOffset||document.documentElement.scrollTop,thumbnail=items[index2].el,rect=thumbnail.getBoundingClientRect();return{x:rect.left,y:rect.top+pageYScroll,w:rect.width}}};this.gallery=new PhotoSwipe(pswpElement,PhotoSwipeUI_Default,items,options),this.gallery.listen("afterChange",this.afterChange.bind(this)),this.gallery.init(),this.preventiOS15Scrolling()},afterChange:function(){var index=this.gallery.getCurrentIndex();this.container.dispatchEvent(new CustomEvent("photoswipe:afterChange",{detail:{index}}))},syncHeight:function(){document.documentElement.style.setProperty("--window-inner-height",`${window.innerHeight}px`)},preventiOS15Scrolling:function(){let initialScrollPos;/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&(this.syncHeight(),initialScrollPos=window.scrollY,document.documentElement.classList.add("pswp-open-in-ios"),window.addEventListener("resize",this.syncHeight),this.gallery.listen("destroy",()=>{document.documentElement.classList.remove("pswp-open-in-ios"),window.scrollTo(0,initialScrollPos)}))}}),Photoswipe}(),theme.Recommendations=function(){var selectors={placeholder:".product-recommendations-placeholder",sectionClass:" .product-recommendations",productResults:".grid-product"};function Recommendations(container){this.container=container,this.sectionId=container.getAttribute("data-section-id"),this.url=container.dataset.url,selectors.recommendations="Recommendations-"+this.sectionId,theme.initWhenVisible({element:container,callback:this.init.bind(this),threshold:500})}return Recommendations.prototype=Object.assign({},Recommendations.prototype,{init:function(){var section=document.getElementById(selectors.recommendations);if(!(!section||section.dataset.enable==="false")){var id=section.dataset.productId,limit=section.dataset.limit,url=this.url+"?section_id=product-recommendations&limit="+limit+"&product_id="+id;if(Shopify.designMode){var wrapper=section.querySelector(selectors.sectionClass);wrapper&&(wrapper.innerHTML="")}fetch(url).then(function(response){return response.text()}).then(function(html){var parser=new DOMParser,doc=parser.parseFromString(html,"text/html"),div=doc.querySelector(selectors.sectionClass),placeholder=section.querySelector(selectors.placeholder);if(placeholder){if(placeholder.innerHTML="",!div){this.container.classList.add("hide"),AOS&&AOS.refreshHard();return}placeholder.appendChild(div),theme.reinitProductGridItem(section),document.dispatchEvent(new CustomEvent("recommendations:loaded",{detail:{section}}));var results=div.querySelectorAll(selectors.productResults);results.length===0&&this.container.classList.add("hide")}}.bind(this))}}}),Recommendations}(),theme.StoreAvailability=function(){var selectors={drawerOpenBtn:".js-drawer-open-availability",modalOpenBtn:".js-modal-open-availability",productTitle:"[data-availability-product-title]"};function StoreAvailability(container){this.container=container,this.baseUrl=container.dataset.baseUrl,this.productTitle=container.dataset.productName}return StoreAvailability.prototype=Object.assign({},StoreAvailability.prototype,{updateContent:function(variantId){var variantSectionUrl=this.baseUrl+"/variants/"+variantId+"/?section_id=store-availability",self2=this;fetch(variantSectionUrl).then(function(response){return response.text()}).then(function(html){if(html.trim()===""){this.container.innerHTML="";return}self2.container.innerHTML=html,self2.container.innerHTML=self2.container.firstElementChild.innerHTML,self2.container.querySelector(selectors.drawerOpenBtn)&&(self2.drawer=new theme.Drawers("StoreAvailabilityDrawer","availability")),self2.container.querySelector(selectors.modalOpenBtn)&&(self2.modal=new theme.Modals("StoreAvailabilityModal","availability"));var title=self2.container.querySelector(selectors.productTitle);title&&(title.textContent=self2.productTitle)})}}),StoreAvailability}(),theme.VideoSection=function(){var selectors={videoParent:".video-parent-section"};function videoSection(container){this.container=container,this.sectionId=container.getAttribute("data-section-id"),this.namespace=".video-"+this.sectionId,this.videoObject,theme.initWhenVisible({element:this.container,callback:this.init.bind(this),threshold:500})}return videoSection.prototype=Object.assign({},videoSection.prototype,{init:function(){var dataDiv=this.container.querySelector(".video-div");if(dataDiv){var type=dataDiv.dataset.type;switch(type){case"youtube":var videoId=dataDiv.dataset.videoId;this.initYoutubeVideo(videoId);break;case"vimeo":var videoId=dataDiv.dataset.videoId;this.initVimeoVideo(videoId);break;case"mp4":this.initMp4Video();break}}},initYoutubeVideo:function(videoId){this.videoObject=new theme.YouTube("YouTubeVideo-"+this.sectionId,{videoId,videoParent:selectors.videoParent})},initVimeoVideo:function(videoId){this.videoObject=new theme.VimeoPlayer("Vimeo-"+this.sectionId,videoId,{videoParent:selectors.videoParent})},initMp4Video:function(){var mp4Video="Mp4Video-"+this.sectionId,mp4Div=document.getElementById(mp4Video),parent=mp4Div.closest(selectors.videoParent);if(mp4Div){parent.classList.add("loaded");var playPromise=document.querySelector("#"+mp4Video).play();playPromise!==void 0&&playPromise.then(function(){}).catch(function(){mp4Div.setAttribute("controls",""),parent.classList.add("video-interactable")})}},onUnload:function(evt){var sectionId=evt.target.id.replace("shopify-section-","");this.videoObject&&typeof this.videoObject.destroy=="function"&&this.videoObject.destroy()}}),videoSection}(),theme.isStorageSupported=function(type){if(window.self!==window.top)return!1;var testKey="test",storage;type==="session"&&(storage=window.sessionStorage),type==="local"&&(storage=window.localStorage);try{return storage.setItem(testKey,"1"),storage.removeItem(testKey),!0}catch{return!1}},theme.reinitProductGridItem=function(){AOS&&AOS.refreshHard(),window.SPR&&(SPR.initDomEls(),SPR.loadBadges()),theme.collapsibles.init()},theme.reviewAppLinkListener=function(){document.addEventListener("click",function(evt){if(window.SPR){var parent=evt.target.parentNode,scroller=null;(parent.matches(".spr-pagination-next")||parent.matches(".spr-pagination-page"))&&(scroller=parent.closest(".spr-reviews")),scroller&&scroller.scrollTo(0,0)}})},theme.checkForAnchorLink=function(){if(window.location.hash){var el=document.querySelector(window.location.hash);el&&window.scrollTo(0,el.offsetTop-100)}},theme.init=function(){theme.QuickShopScreens.init(),theme.rteInit(),theme.articleImages(),theme.collapsibles.init(),theme.settings.cartType==="sticky"&&new theme.StickyCart.init,theme.videoModal(),window.addEventListener("pageshow",function(evt){evt.persisted&&theme.refreshCart()}),performance&&performance.navigation.type===2&&theme.refreshCart()},theme.initSecondary=function(){document.body.classList.add("js-animate"),AOS.init({easing:"ease-out-quad",once:!1,mirror:!0,offset:100,disableMutationObserver:!0}),document.addEventListener("lazyloaded",function(evt){var img=evt.target;img&&img.parentNode.classList.add("loaded")}),theme.storeScrollPositionOnUnload(),theme.reviewAppLinkListener(),theme.checkForAnchorLink()},theme.config.hasSessionStorage=theme.isStorageSupported("session"),theme.config.hasLocalStorage=theme.isStorageSupported("local");function DOMready(callback){document.readyState!="loading"?callback():document.addEventListener("DOMContentLoaded",callback)}DOMready(function(){if(theme.promiseStylesheet().then(function(){theme.initSecondary(),document.dispatchEvent(new CustomEvent("page:loaded"))}),theme.sections=new theme.Sections,theme.init(),theme.settings.isCustomerTemplate&&theme.customerTemplates(),theme.sections.register("slideshow-section",theme.SlideshowSection),theme.sections.register("header-section",theme.HeaderSection),theme.sections.register("hero-animated",theme.HeroAnimated),theme.sections.register("video-section",theme.VideoSection),theme.sections.register("product",theme.Product),theme.sections.register("product-recommendations",theme.Recommendations),theme.sections.register("password-header",theme.PasswordHeader),theme.sections.register("product-template",theme.Product),theme.sections.register("featured-collection",theme.FeaturedCollection),theme.sections.register("collection-template",theme.Collection),theme.sections.register("collection-filter",theme.CollectionFilter),theme.sections.register("testimonials",theme.Testimonials),theme.sections.register("newsletter-popup",theme.NewsletterPopup),theme.sections.register("map",theme.Maps),theme.sections.register("blog",theme.Blog),theme.sections.register("footer-section",theme.FooterSection),theme.sections.register("store-availability",theme.StoreAvailability),document.body.classList.contains("template-cart")){var cartPageForm=document.getElementById("CartPageForm");cartPageForm&&new theme.CartForm(cartPageForm)}theme.pageTransitions()})}(); //# sourceMappingURL=/cdn/shop/t/35/assets/theme.js.map?v=86035490799962768001727814980