window.Foxtheme=window.Foxtheme||{};function generateDomFromString(value,tagName="div"){const d=document.createElement(tagName);return d.innerHTML=value,d}function getScrollbarWidth(){const outer=document.createElement("div");outer.style.visibility="hidden",outer.style.overflow="scroll",outer.style.msOverflowStyle="scrollbar",document.body.appendChild(outer);const inner=document.createElement("div");outer.appendChild(inner);const scrollbarWidth=outer.offsetWidth-inner.offsetWidth;return outer.parentNode.removeChild(outer),scrollbarWidth}const sectionCache=new Map;function fetchSection(sectionId,options={}){const{url:_url,fromCache=!1,params={}}=options;return new Promise((resolve,reject)=>{const url=new URL(_url||window.location.href);if(url.searchParams.set("section_id",sectionId),Object.entries(params).forEach(([k,v])=>url.searchParams.set(k,v)),fromCache){const cached=sectionCache.get(url);if(cached)return resolve(cached)}fetch(url,{headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/json"}}).then(res=>{if(res.ok)return res.text();reject(`Failed to load section: ${sectionId}`)}).then(html=>{const div=generateDomFromString(html);sectionCache.set(url,div),resolve(div)}).catch(reject)})}function loadAssets(files=[],id,callback=()=>{},options={}){const unique=id||Math.random().toString(36).slice(2);window.FoxTheme.loadjs.isDefined(id)||window.FoxTheme.loadjs(files,unique),window.FoxTheme.loadjs.ready(unique,callback)}function queryDomNodes(selectors={},context=document){return Object.entries(selectors).reduce((acc,[name,selector])=>{const findOne=typeof selector=="string",queryMethod=findOne?"querySelector":"querySelectorAll",sl=findOne?selector:selector[0];return acc[name]=context?.[queryMethod]?.(sl),!findOne&&acc[name]&&(acc[name]=[...acc[name]]),acc},{})}function addEventDelegate({context=document.documentElement,event="click",selector,handler,capture=!1}){const listener=function(e){for(let target=e.target;target&&target!==this;target=target.parentNode)if(target.matches(selector)){handler.call(target,e,target);break}};return context.addEventListener(event,listener,capture),()=>{context.removeEventListener(event,listener,capture)}}const moneyFormat="${{amount}}";function formatMoney(cents,format){typeof cents=="string"&&(cents=cents.replace(".",""));let value="";const placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||moneyFormat;function formatWithDelimiters(number,precision=2,thousands=",",decimal="."){if(isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);const parts=number.split("."),dollarsAmount=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1${thousands}`),centsAmount=parts[1]?decimal+parts[1]:"";return dollarsAmount+centsAmount}switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break}return formatString.replace(placeholderRegex,value)}function intersecting(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)}class AnimateComponent extends HTMLElement{constructor(){super(),intersecting({element:this,callback:this.init.bind(this),threshold:0})}init(){this.setAttribute("is-visible",!0)}}customElements.define("animate-component",AnimateComponent);function getFocusableElements(container){return Array.from(container.querySelectorAll("summary, a[href], button:enabled, [tabindex]:not([tabindex^='-']), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe"))}document.querySelectorAll('[id^="Details-"] summary').forEach(summary=>{summary.setAttribute("role","button"),summary.setAttribute("aria-expanded","false"),summary.nextElementSibling.getAttribute("id")&&summary.setAttribute("aria-controls",summary.nextElementSibling.id),summary.addEventListener("click",event=>{event.currentTarget.setAttribute("aria-expanded",!event.currentTarget.closest("details").hasAttribute("open"))}),summary.parentElement.addEventListener("keyup",onKeyUpEscape)});const trapFocusHandlers={};function trapFocus(container,elementToFocus=container){var elements=getFocusableElements(container),first=elements[0],last=elements[elements.length-1];removeTrapFocus(),trapFocusHandlers.focusin=event=>{event.target!==container&&event.target!==last&&event.target!==first||document.addEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.keydown=function(event){event.code.toUpperCase()==="TAB"&&(event.target===last&&!event.shiftKey&&(event.preventDefault(),first.focus()),(event.target===container||event.target===first)&&event.shiftKey&&(event.preventDefault(),last.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),elementToFocus.focus()}try{document.querySelector(":focus-visible")}catch{focusVisiblePolyfill()}function focusVisiblePolyfill(){const navKeys=["ARROWUP","ARROWDOWN","ARROWLEFT","ARROWRIGHT","TAB","ENTER","SPACE","ESCAPE","HOME","END","PAGEUP","PAGEDOWN"];let currentFocusedElement=null,mouseClick=null;window.addEventListener("keydown",event=>{navKeys.includes(event.code.toUpperCase())&&(mouseClick=!1)}),window.addEventListener("mousedown",event=>{mouseClick=!0}),window.addEventListener("focus",()=>{currentFocusedElement&¤tFocusedElement.classList.remove("focused"),!mouseClick&&(currentFocusedElement=document.activeElement,currentFocusedElement.classList.add("focused"))},!0)}function pauseAllMedia(){document.querySelectorAll(".js-youtube").forEach(video=>{video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),document.querySelectorAll(".js-vimeo").forEach(video=>{video.contentWindow.postMessage('{"method":"pause"}',"*")}),document.querySelectorAll("video").forEach(video=>{video.classList.contains("video-playsinline")||video.pause()}),document.querySelectorAll("product-model").forEach(model=>{model.modelViewerUI&&model.modelViewerUI.pause()})}function removeTrapFocus(elementToFocus=null){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown),elementToFocus&&elementToFocus.focus()}function onKeyUpEscape(event){if(event.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event.target.closest("details[open]");if(!openDetailsElement)return;const summaryElement=openDetailsElement.querySelector("summary");openDetailsElement.removeAttribute("open"),summaryElement.setAttribute("aria-expanded",!1),summaryElement.focus()}function debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}function cookiesEnabled(){let cookieEnabled=navigator.cookieEnabled;return cookieEnabled||(document.cookie="testcookie",cookieEnabled=document.cookie.indexOf("testcookie")!==-1),cookieEnabled}function setCookie(cname,cvalue,exdays){var d=new Date;d.setTime(d.getTime()+exdays*24*60*60*1e3);var expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/"}function getCookie(cname){for(var name=cname+"=",decodedCookie=decodeURIComponent(document.cookie),ca=decodedCookie.split(";"),i=0;i`${getSizedImageUrl(src,size+"x")} ${size}w`),sizes.join(", ")}function removeProtocol(path){return path.replace(/http(s)?:/,"")}function getSizedImageUrl(src,size){if(size===null)return src;if(size==="master")return removeProtocol(src);const match=src.match(/\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif|webp)(\?v=\d+)?$/i);if(match){const prefix=src.split(match[0]),suffix=match[0];return removeProtocol(`${prefix[0]}_${size}${suffix}`)}else return null}typeof window.Shopify>"u"&&(window.Shopify={}),Shopify.bind=function(fn,scope){return function(){return fn.apply(scope,arguments)}},Shopify.setSelectorByValue=function(selector,value){for(var i=0,count=selector.options.length;i0&&Shopify.setSelectorByValue(this.provinceEl,value)},countryHandler:function(e){var opt=this.countryEl.options[this.countryEl.selectedIndex],raw=opt.getAttribute("data-provinces"),provinces=JSON.parse(raw);if(this.clearOptions(this.provinceEl),provinces&&provinces.length===0)this.provinceContainer.style.display="none";else{for(var i=0;isliderColumns&&this.initSlider())}initSlider(){this.slider=new window.FoxTheme.Slider(this),this.disablePointerMove=this.dataset.disablePointerMove||!0,this.slider&&this.slider.instance&&this.dataset.disablePointerMove!=="false"&&(this.slider.instance.on("pointerMove",()=>{this.classList.add("is-pointer-move")}),this.slider.instance.on("pointerUp",()=>{this.classList.remove("is-pointer-move")})),this.slider&&this.slider.instance&&(this.initialized=!0)}update(){this.slider&&this.slider.instance&&this.slider.instance.resize()}destroy(){typeof this.slider.instance=="object"&&(this.slider.instance.destroy(),this.classList.add("flickity-destroyed"),this.slider.instance.off("pointerMove"),this.slider.instance.off("pointerUp"))}select(index,isWrapped=!1,isInstant=!1){this.slider&&this.slider.instance.select(index,isWrapped,isInstant)}toggleFade(isFade=!1){const method=isFade?"add":"remove";this.slider.instance.options.fade=isFade,this.classList[method]("is-fade"),this.update()}}customElements.define("flickity-component",SliderComponent);class DeferredMedia extends HTMLElement{constructor(){super();const poster=this.querySelector('[id^="Deferred-Poster-"]');poster&&poster.addEventListener("click",this.loadContent.bind(this))}loadContent(focus=!0){if(!this.getAttribute("loaded")){const content=document.createElement("div");content.appendChild(this.querySelector("template").content.firstElementChild.cloneNode(!0)),this.setAttribute("loaded",!0);const deferredElement=this.appendChild(content.querySelector("video, model-viewer, iframe"));focus&&deferredElement.focus()}}}customElements.define("deferred-media",DeferredMedia);class ModalDialog extends HTMLElement{constructor(){super(),this.closeEvent=new Event("close"),this.openEvent=new Event("open"),this.querySelector('[id^="ModalClose-"]')?.addEventListener("click",this.hide.bind(this)),this.addEventListener("keyup",e=>{e.code.toUpperCase()==="ESCAPE"&&this.hide()}),this.classList.contains("media-modal")?this.addEventListener("pointerup",event=>{}):this.addEventListener("click",event=>{event.target.nodeName==="MODAL-DIALOG"&&this.hide()}),this.scrollbarWidth=getScrollbarWidth()}connectedCallback(){this.moved||(this.moved=!0,document.body.appendChild(this))}show(opener){const popup=this.querySelector(".template-popup");this.openedBy=opener,document.body.classList.add("prevent-scroll"),this.setAttribute("open",""),popup&&popup.loadContent(),trapFocus(this,this.querySelector('[role="dialog"]')),window.pauseAllMedia(),this.dispatchEvent(this.openEvent),document.body.style.paddingRight=this.scrollbarWidth+"px"}hide(){removeTrapFocus(this.openedBy),window.pauseAllMedia(),this.setAttribute("closing","true"),setTimeout(()=>{this.removeAttribute("open"),this.removeAttribute("closing"),document.body.classList.remove("prevent-scroll"),this.dispatchEvent(this.closeEvent),document.body.style.paddingRight=""},300)}}customElements.define("modal-dialog",ModalDialog);class ModalOpener extends HTMLElement{constructor(){super();const button=this.querySelector("button");button&&button.addEventListener("click",()=>{const modal=document.querySelector(this.dataset.modal);modal&&modal.show(button)})}}customElements.define("modal-opener",ModalOpener);class QuantityInput extends HTMLElement{constructor(){super(),this.input=this.querySelector("input"),this.changeEvent=new Event("change",{bubbles:!0}),this.productId=this.dataset.productId,this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this))),this.input.addEventListener("change",()=>{window.FoxThemeEvents.emit(`${this.productId}__QUANTITY_CHANGE`,this.input.value,this)})}onButtonClick(event){event.preventDefault();const previousValue=this.input.value;event.target.name==="plus"?this.input.stepUp():this.input.stepDown(),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent)}}customElements.define("quantity-input",QuantityInput);class Drawer extends HTMLElement{constructor(){super(),this.closeEvent=new Event("close"),this.openEvent=new Event("open"),this.querySelector('[id^="DrawerClose-"]')?.addEventListener("click",e=>{e.preventDefault(),this.closeDrawer()}),this.addEventListener("keyup",e=>{e.code.toUpperCase()==="ESCAPE"&&this.closeDrawer()}),this.elementToFocus=this.querySelector('[tabindex="-1"]')||this.querySelector('input:not([type="hidden"])'),this.dataset.elementToFocus&&(this.elementToFocus=this.querySelector(this.dataset.elementToFocus)),this.scrollbarWidth=getScrollbarWidth()}connectedCallback(){if(this.moved)return;const canMove=this.dataset.canMove;(!canMove||canMove!=="false")&&(this.moved=!0,document.body.appendChild(this))}isOpen(){return this.hasAttribute("open")}onBodyClick(e){e.target.classList.contains("f-drawer__overlay")&&this.closeDrawer(!1)}openDrawer(opener){this.openedBy=opener,this.onBodyClickEvent=this.onBodyClickEvent||this.onBodyClick.bind(this),document.body.addEventListener("click",this.onBodyClickEvent),document.body.classList.add("prevent-scroll"),this.setAttribute("open",""),trapFocus(this,this.elementToFocus),this.dispatchEvent(this.openEvent),document.body.style.paddingRight=this.scrollbarWidth+"px"}closeDrawer(focusToggle=!0){focusToggle&&removeTrapFocus(this.openedBy),this.removeAttribute("open"),document.body.removeEventListener("click",this.onBodyClickEvent),document.body.classList.remove("prevent-scroll"),this.dispatchEvent(this.closeEvent),document.body.style.paddingRight=""}}customElements.define("drawer-component",Drawer),customElements.define("drawer-opener",class extends HTMLElement{constructor(){if(super(),this.dataset.disabled==="true")return;const button=this.querySelector("button")||this.querySelector("[data-opener]");button&&button.addEventListener("click",e=>{e.preventDefault();const drawer=document.querySelector(this.dataset.drawer);drawer&&drawer.openDrawer(button)})}}),customElements.define("drawer-closer",class extends HTMLElement{constructor(){super();const drawer=this.closest("drawer-component");drawer&&this.addEventListener("click",e=>{e.preventDefault(),drawer.closeDrawer()})}}),customElements.define("cart-note",class extends HTMLElement{constructor(){super(),this.addEventListener("change",debounce(event=>{const body=JSON.stringify({note:event.target.value});fetch(`${FoxThemeSettings.routes.cart_update_url}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body})},300)),this.collapsible=this.querySelector("collapsible-tab"),this.querySelector(".btn-cancel").addEventListener("click",this.handleClose.bind(this))}handleClose(e){e.preventDefault(),this.collapsible&&this.collapsible.close()}}),customElements.define("cart-remove-button",class extends HTMLElement{constructor(){super(),this.addEventListener("click",event=>{event.preventDefault();const lineItem=this.closest("[data-cart-item]"),cart=this.closest("cart-items")||this.closest("cart-drawer");cart.loading.start(),cart.updateQuantity(0,lineItem)})}}),customElements.define("product-modal",class extends ModalDialog{constructor(){super()}connectedCallback(){this.slider=this.querySelector("flickity-component")}hide(){super.hide()}show(opener){super.show(opener),this.slider&&(this.slider.update(),this.showActiveMedia(),this.slider.focus())}showActiveMedia(){const activeMedia=this.querySelector(`[data-media-id="${this.openedBy.getAttribute("data-media-id")}"]`);if(activeMedia){const activeIndex=Number(activeMedia.dataset.index);this.slider.select(activeIndex,!1,!0)}}});class DetailsDisclosure extends HTMLElement{constructor(){super(),this.mainDetailsToggle=this.querySelector("details"),this.content=this.mainDetailsToggle.querySelector("summary").nextElementSibling,this.mainDetailsToggle.addEventListener("focusout",this.onFocusOut.bind(this)),this.mainDetailsToggle.addEventListener("toggle",this.onToggle.bind(this))}onFocusOut(){setTimeout(()=>{this.contains(document.activeElement)||this.close()})}onToggle(){this.animations||(this.animations=this.content.getAnimations()),this.mainDetailsToggle.hasAttribute("open")?this.animations.forEach(animation=>animation.play()):this.animations.forEach(animation=>animation.cancel())}close(){this.mainDetailsToggle.removeAttribute("open"),this.mainDetailsToggle.querySelector("summary").setAttribute("aria-expanded",!1)}}class ProductRecommendations extends HTMLElement{constructor(){super()}connectedCallback(){const handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),fetch(this.dataset.url).then(response=>response.text()).then(text=>{const html=generateDomFromString(text),recommendations=html.querySelector("product-recommendations");recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML),html.querySelector(".product-card")?this.classList.add("product-recommendations--loaded"):this.classList.add("f-hidden")}).catch(e=>{console.error(e)}))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}customElements.define("product-recommendations",ProductRecommendations);class FProgressBar extends HTMLElement{constructor(){super()}connectedCallback(){this.init()}init(){setTimeout(()=>{const quantity=parseInt(this.dataset.quantity);this.style.setProperty("--progress-bar-width",`${quantity*100/50}%`)},1e3)}}customElements.define("f-progress-bar",FProgressBar);class VideoComponent extends HTMLElement{constructor(){super()}connectedCallback(){this.init()}init(){switch(this.parentSelector=this.dataset.parent||".f-video-wrapper",this.parent=this.closest(this.parentSelector),this.dataset.type){case"youtube":this.initYoutubeVideo();break;case"vimeo":this.initVimeoVideo();break;case"mp4":this.initMp4Video();break}}initYoutubeVideo(){this.setAsLoading(),this.loadScript("youtube").then(this.setupYoutubePlayer.bind(this))}initVimeoVideo(){this.setAsLoading(),this.loadScript("vimeo").then(this.setupVimeoPlayer.bind(this))}initMp4Video(){const player=this.querySelector("video");if(player){const promise=player.play();typeof promise<"u"&&promise.then(function(){}).catch(function(){player.setAttribute("controls","")})}}loadScript(videoType){return new Promise((resolve,reject)=>{const script=document.createElement("script");document.body.appendChild(script),script.onload=resolve,script.onerror=reject,script.async=!0,script.src=videoType==="youtube"?"//www.youtube.com/iframe_api":"//player.vimeo.com/api/player.js"})}setAsLoading(){this.parent.setAttribute("loading",!0)}setAsLoaded(){this.parent.removeAttribute("loading"),this.parent.setAttribute("loaded",!0)}setupYoutubePlayer(){const videoId=this.dataset.videoId,playerInterval=setInterval(()=>{window.YT&&window.YT.ready(()=>{const element=document.createElement("div");this.appendChild(element),this.player=new YT.Player(element,{videoId,playerVars:{showinfo:0,controls:!1,fs:0,rel:0,height:"100%",width:"100%",iv_load_policy:3,html5:1,loop:1,playsinline:1,modestbranding:1,disablekb:1},events:{onReady:this.onYoutubeReady.bind(this),onStateChange:this.onYoutubeStateChange.bind(this)}}),clearInterval(playerInterval)})},50)}onYoutubeReady(){this.iframe=this.querySelector("iframe"),this.iframe.setAttribute("tabindex","-1"),this.player.mute(),typeof this.player.playVideo=="function"&&this.player.playVideo(),this.setAsLoaded(),new IntersectionObserver((entries,_observer)=>{entries.forEach(entry=>{entry.isIntersecting?this.youtubePlay():this.youtubePause()})},{rootMargin:"0px 0px 50px 0px"}).observe(this.iframe)}onYoutubeStateChange(event){switch(event.data){case-1:this.attemptedToPlay&&this.setAsLoaded();break;case 0:this.youtubePlay();break;case 1:this.setAsLoaded();break;case 3:this.attemptedToPlay=!0;break}}youtubePlay(){this.player&&typeof this.player.playVideo=="function"&&this.player.playVideo()}youtubePause(){this.player&&typeof this.player.pauseVideo=="function"&&this.player.pauseVideo()}setupVimeoPlayer(){const videoId=this.dataset.videoId,playerInterval=setInterval(()=>{window.Vimeo&&(this.player=new Vimeo.Player(this,{id:videoId,autoplay:!0,autopause:!1,background:!1,controls:!1,loop:!0,height:"100%",width:"100%"}),this.player.ready().then(this.onVimeoReady.bind(this)),clearInterval(playerInterval))},50)}onVimeoReady(){this.iframe=this.querySelector("iframe"),this.iframe.setAttribute("tabindex","-1"),this.player.setMuted(!0),this.setAsLoaded(),new IntersectionObserver((entries,_observer)=>{entries.forEach(entry=>{entry.isIntersecting?this.vimeoPlay():this.vimeoPause()})},{rootMargin:"0px 0px 50px 0px"}).observe(this.iframe)}vimeoPlay(){this.player&&typeof this.player.play=="function"&&this.player.play()}vimeoPause(){this.player&&typeof this.player.pause=="function"&&this.player.pause()}}if(customElements.define("video-component",VideoComponent),!customElements.get("f-scrolling-promotion")){class FScrollingPromotion extends HTMLElement{constructor(){super()}connectedCallback(){this.promotion=this.querySelector(".f-promotion"),this.init()}init(){if(this.childElementCount===1){this.promotion.classList.add("f-promotion--animated");for(let index=0;index<10;index++)this.clone=this.promotion.cloneNode(!0),this.clone.setAttribute("aria-hidden",!0),this.appendChild(this.clone);new IntersectionObserver((entries,_observer)=>{entries.forEach(entry=>{entry.isIntersecting?this.scrollingPlay():this.scrollingPause()})},{rootMargin:"0px 0px 50px 0px"}).observe(this)}}scrollingPlay(){this.classList.remove("f-scrolling-promotion--paused")}scrollingPause(){this.classList.add("f-scrolling-promotion--paused")}}customElements.define("f-scrolling-promotion",FScrollingPromotion)}class ImageComparisonSlider extends HTMLElement{constructor(){super(),this.active=!1,this.button=this.querySelector("button"),this.horizontal=this.dataset.layout==="horizontal",this.init()}init(){this.button.addEventListener("touchstart",this.handleTouchStart.bind(this)),document.body.addEventListener("touchend",this.handleTouchEnd.bind(this)),document.body.addEventListener("touchmove",this.handleMouseMove.bind(this)),this.button.addEventListener("mousedown",this.handleTouchStart.bind(this)),document.body.addEventListener("mouseup",this.handleTouchEnd.bind(this)),document.body.addEventListener("mousemove",this.handleMouseMove.bind(this))}handleTouchStart(){document.body.style.overflow="hidden",this.active=!0,this.classList.add("dragging")}handleTouchEnd(){this.active=!1,this.classList.remove("dragging"),document.body.style.overflow=""}handleMouseMove(e){if(!this.active)return;const event=e.touches&&e.touches[0]||e,x=this.horizontal?event.pageX-this.offsetLeft:event.pageY-this.offsetTop;this.handleChange(x)}handleChange(x){const distance=this.horizontal?this.clientWidth:this.clientHeight,max=distance-20,mousePercent=Math.max(20,Math.min(x,max))*100/distance;this.style.setProperty("--percent",mousePercent+"%")}}if(customElements.define("f-image-comparison-slider",ImageComparisonSlider),!customElements.get("component-inventory-status")){class InventoryStatus extends HTMLElement{constructor(){super(),this.selectors={inventory:"[data-product-inventory]",incomingInventory:"[data-incoming-inventory]"}}connectedCallback(){this.productId=this.dataset.productId;let inventoryEl=this.querySelector(this.selectors.inventory);inventoryEl&&(this.inventory=!0,this.inventoryThreshold=inventoryEl.dataset.threshold,window.FoxThemeEvents.subscribe(`${this.productId}__VARIANT_CHANGE`,async variant=>{this.updateInventoryStatus(variant)}))}updateInventoryStatus(variant){if(!variant||!variant.inventory_management||variant.inventory_policy==="continue"){this.toggleInventoryQuantity(variant,!1),this.toggleIncomingInventory(!1);return}if(variant.inventory_management==="shopify"&&window.FoxInventories&&window.FoxInventories[this.productId]){let variantInventoryObject=window.FoxInventories[this.productId][variant.id];if(variantInventoryObject.policy==="continue"){this.toggleInventoryQuantity(variant,!1),this.toggleIncomingInventory(!1);return}let quantity=variantInventoryObject.quantity,showInventory=!0,showIncomingInventory=!1;(quantity<=0||quantity>this.inventoryThreshold)&&(showInventory=!1),this.toggleInventoryQuantity(variant,showInventory,quantity),variantInventoryObject.incoming==="true"&&quantity<=this.inventoryThreshold&&(showIncomingInventory=!0),this.toggleIncomingInventory(showIncomingInventory,variant.available,variantInventoryObject.next_incoming_date)}}toggleInventoryQuantity(variant,show,qty){this.inventory||(show=!1);const el=document.querySelector(this.selectors.inventory),fInventory=el.closest(".f-product-single__block-inventory-status"),progressEl=document.querySelector("f-progress-bar"),showProgress=progressEl.dataset.show==="true";parseInt(qty)<=parseInt(this.inventoryThreshold)?(el.parentNode.classList.add("f-inventory--low"),el.textContent=window.FoxThemeStrings.stockLabel.replace("[count]",qty),showProgress&&(el.parentNode.querySelector(".f-inventory--icon").classList.add("hidden"),progressEl.style.display="block",progressEl.dataset.quantity=qty,progressEl.init())):(el.parentNode.classList.remove("f-inventory--low"),el.textContent=window.FoxThemeStrings.inStockLabel,showProgress&&(progressEl.style.display="none",el.parentNode.querySelector(".f-inventory--icon").classList.remove("hidden"))),variant&&variant.available?(el.parentNode.classList.remove("hidden"),fInventory&&fInventory.classList.remove("hidden")):(el.parentNode.classList.add("hidden"),showProgress&&(progressEl.style.display="none"),fInventory&&fInventory.classList.add("hidden"))}toggleIncomingInventory(show,available,date){const el=document.querySelector(this.selectors.incomingInventory),fInventory=el.closest(".f-product-single__block-inventory-status");if(!fInventory)return;const textEl=el.querySelector(".f-js-incoming-text");if(show){let string=available?window.FoxThemeStrings.willNotShipUntil.replace("[date]",date):window.FoxThemeStrings.willBeInStockAfter.replace("[date]",date);date||(string=window.FoxThemeStrings.waitingForStock),el.classList.remove("hidden"),fInventory&&fInventory.classList.remove("hidden"),textEl.textContent=string}else el.classList.add("hidden")}}customElements.define("component-inventory-status",InventoryStatus)} //# sourceMappingURL=/cdn/shop/t/3/assets/global.js.map?v=170887407385201007061673541598