1window.theme=window.theme||{},theme.config={hasSessionStorage:!0,hasLocalStorage:!0,mqlSmall:!1,mql:"(min-width: 750px)",mqlMobile:"(max-width: 749px)",mqlTablet:"(max-width: 1024px)",mqlDesktop:"(min-width: 1025px)",isTouch:"ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0,rtl:document.documentElement.getAttribute("dir")==="rtl",motionReduced:window.matchMedia("(prefers-reduced-motion: reduce)").matches,easing:[.61,.22,.23,1],easingFast:[.16,1,.3,1]},typeof window.MainEvents>"u"?window.MainEvents={variantUpdate:"variant:update",mediaStartedPlaying:"media:started-playing"}:typeof window.MainEvents.variantUpdate>"u"?window.MainEvents.variantUpdate="variant:update":typeof window.MainEvents.mediaStartedPlaying>"u"&&(window.MainEvents.mediaStartedPlaying="media:started-playing"),console.log(`%c${window.info.name} %c(${window.info.version})%c by Halothemes 2%cLearn more at %chttps://halothemes.net/`,"color: #ff8800; font-weight: bold; font-size: 1.2rem;","color: #ffa733; font-style: italic; font-size: 1.1rem;","color: #ffa733; font-size: 1rem;","color: #ff8800;","color: #d35400; text-decoration: underline;");const ON_CHANGE_DEBOUNCE_TIMER=300,PUB_SUB_EVENTS={cartUpdate:"cart-update",quantityUpdate:"quantity-update",optionValueSelectionChange:"option-value-selection-change",variantChange:"variant-change",cartError:"cart-error"};let subscribers={};(function(){const interactionEvents=["pointerdown","keydown","scroll"];let deferQueue=[],activated=!1,listenersReady=!1;function runDeferredTasks(){if(activated)return;activated=!0,listenersReady&&(interactionEvents.forEach(e=>window.removeEventListener(e,runDeferredTasks)),window.removeEventListener("load",runDeferredTasks),listenersReady=!1);const tasks=deferQueue;deferQueue=[];for(const fn of tasks)try{fn()}catch(err){console.warn("[Deferred Task Error]",err)}}function setupDefers(){listenersReady||activated||(listenersReady=!0,document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",runDeferredTasks,{once:!0}),window.addEventListener("load",runDeferredTasks,{once:!0}),interactionEvents.forEach(e=>{window.addEventListener(e,runDeferredTasks,{passive:!0})}),setTimeout(()=>{!activated&&deferQueue.length&&runDeferredTasks()},3e3))}setupDefers(),window.deferUntilInteraction=function(fn){if(activated)try{fn()}catch(e){console.warn("[Deferred Task Error]",e)}else deferQueue.push(fn),setupDefers()}})(),(function(){window.addEventListener("DOMContentLoaded",()=>{const headerSection=document.querySelector(".header-section");headerSection&&headerSection.classList.add("header-group-section")})})(),(function(){if(window.CSS?.supports?.("selector(:has(*))"))return;const pending=new Set;let scheduled=!1;function update(swiper){swiper.isConnected&&(swiper.classList.toggle("has-swiper-pagination-progressbar",!!swiper.querySelector(".swiper-pagination-progressbar")),swiper.classList.toggle("has-swiper-pagination-bullets",!!swiper.querySelector(".swiper-pagination-bullets")),swiper.classList.toggle("has-swiper-pagination-lock",!!swiper.querySelector(".swiper-pagination-lock")))}function collect(node){if(!(node instanceof HTMLElement))return;const parent=node.closest(".swiper");parent&&pending.add(parent),node.querySelectorAll(".swiper").forEach(swiper=>pending.add(swiper))}function schedule(){scheduled||!pending.size||(scheduled=!0,requestAnimationFrame(()=>{scheduled=!1,pending.forEach(update),pending.clear()}))}function init(){document.querySelectorAll(".swiper").forEach(update),document.body&&new MutationObserver(records=>{records.forEach(record=>{if(record.type==="attributes"){if(record.target.matches(".swiper"))return;const swiper=record.target.closest(".swiper");swiper&&pending.add(swiper)}else{const swiper=record.target.closest?.(".swiper");swiper&&pending.add(swiper),record.addedNodes.forEach(collect)}}),schedule()}).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init,{once:!0}):init()})(),(function(){const sections=Array.from(document.querySelectorAll(".shopify-section")).filter(section=>section.querySelector(".sticky-text"));if(!sections.length)return;let hasUserInteracted=!1;const activeSections=new Set,headerEl=document.querySelector(".header-wrapper");let headerHeight=0,gap=0,ticking=!1;const updateHeaderMetrics=()=>{headerHeight=headerEl&&headerEl.offsetHeight||0,gap=headerHeight*12/100},updateSectionState=section=>{const{top,bottom}=section.getBoundingClientRect(),shouldBeActive=top<=headerHeight+gap&&bottom>headerHeight+gap;shouldBeActive&&!activeSections.has(section)&&(section.classList.add("current-sh
2ow-sticky"),activeSections.add(section)),!shouldBeActive&&activeSections.has(section)&&(section.classList.remove("current-show-sticky"),activeSections.delete(section))},onScroll=()=>{ticking||(ticking=!0,requestAnimationFrame(()=>{ticking=!1,sections.forEach(updateSectionState)}))},handleUserInteraction=()=>{hasUserInteracted||(hasUserInteracted=!0,updateHeaderMetrics(),onScroll(),window.addEventListener("scroll",onScroll,{passive:!0}),window.addEventListener("resize",()=>{updateHeaderMetrics(),onScroll()},{passive:!0}))};["scroll","mousemove","click","mouseover"].forEach(event2=>{window.addEventListener(event2,handleUserInteraction,{passive:!0,once:!0})})})();function subscribe(eventName,callback){return subscribers[eventName]===void 0&&(subscribers[eventName]=[]),subscribers[eventName]=[...subscribers[eventName],callback],function(){subscribers[eventName]=subscribers[eventName].filter(cb=>cb!==callback)}}function publish(eventName,data){subscribers[eventName]&&subscribers[eventName].forEach(callback=>{callback(data)})}const mql=window.matchMedia(theme.config.mqlMobile);theme.config.mqlSmall=mql.matches;const mqlTablet=window.matchMedia(theme.config.mqlTablet);theme.config.mqlTablet=mqlTablet.matches;const mqlDesktop=window.matchMedia(theme.config.mqlDesktop);theme.config.mqlDesktop=mqlDesktop.matches,document.documentElement.classList.add(theme.config.isTouch?"touch":"no-touch"),theme.passiveEvents=!1;try{window.addEventListener("passiveCheck",null,Object.defineProperty({},"event",{get:()=>theme.passiveEvents=!0}))}catch{}theme.utils={rafThrottle:callback=>{let requestId=null,lastArgs;const later=context=>()=>{requestId=null,callback.apply(context,lastArgs)},throttled=(...args)=>{lastArgs=args,requestId===null&&(requestId=requestAnimationFrame(later(this)))};return throttled.cancel=()=>{cancelAnimationFrame(requestId),requestId=null},throttled},waitForEvent:(element,eventName)=>new Promise(resolve=>{const done=event2=>{event2.target===element&&(element.removeEventListener(eventName,done),resolve(event2))};element.addEventListener(eventName,done)}),debounce:(fn,wait)=>{let timer;const debounced=(...args)=>{clearTimeout(timer),timer=setTimeout(()=>fn.apply(this,args),wait)};return debounced.cancel=()=>{clearTimeout(timer)},debounced},imageLoaded:imgOrArray=>imgOrArray?(imgOrArray=imgOrArray instanceof Element?[imgOrArray]:Array.from(imgOrArray),Promise.all(imgOrArray.map(image=>new Promise(resolve=>{if(image.tagName!=="IMG"||image.complete||!image.offsetParent){resolve();return}const done=()=>{image.removeEventListener("load",done),image.removeEventListener("error",done),resolve()};image.addEventListener("load",done),image.addEventListener("error",done)})))):Promise.resolve()},theme.initWhenVisible=(callback,delay=5e3)=>{const events=["mouseover","mousemove","keydown","touchstart","touchend","touchmove","wheel"];let timer;const cleanup=()=>{timer&&clearTimeout(timer),events.forEach(e=>window.removeEventListener(e,run,{passive:!0}))},run=()=>{callback(),cleanup()};return typeof delay=="number"&&(timer=setTimeout(run,delay)),events.forEach(e=>window.addEventListener(e,run,{passive:!0})),cleanup},theme.renderTemplate=template=>template?template.content.cloneNode(!0):void 0;const sectionRenderCache=new Map;class SectionFetcher extends HTMLElement{constructor(){super(),(this.dataset.activate||"inview")==="interaction"?theme.initWhenVisible(()=>this.initialize(),null):Motion.inView(this,()=>this.initialize())}get sectionId(){return this.dataset.sectionId}get targetElementId(){return this.dataset.targetId}initialize(){if(this._initialized)return;this._initialized=!0;const targetElement=document.getElementById(this.targetElementId);if(!targetElement||targetElement.hasAttribute("data-loaded"))return;const targetUrl=new URL(window.location.href);targetUrl.searchParams.set("section_id",this.sectionId);const url=targetUrl.toString();sectionRenderCache.has(url)?this.renderFromCache(url):this.fetchAndRender(url),this._cacheListener=event2=>this.onSectionCached(event2),document.addEventListener("section:cached",this._cacheListener)}renderFromCache(url){const cachedHTML=sectionRenderCache.get(url);
2cachedHTML&&this.updateDOM(cachedHTML)}async fetchAndRender(url){sectionRenderCache.set(url,"");try{const response=await fetch(url);if(!response.ok)throw new Error(`Fetch failed: ${response.status}`);const htmlText=await response.text();this.updateDOM(htmlText),sectionRenderCache.set(url,htmlText),document.dispatchEvent(new CustomEvent("section:cached",{detail:{url,sectionId:this.sectionId}}))}catch(error){console.error("[SectionFetcher]",error)}}updateDOM(htmlText){const newSection=new DOMParser().parseFromString(htmlText,"text/html").getElementById(this.targetElementId),oldSection=document.getElementById(this.targetElementId);if(!newSection){console.warn(`[SectionFetcher] Target #${this.targetElementId} not found in fetched section`);return}if(!oldSection){console.warn(`[SectionFetcher] Target #${this.targetElementId} not found in current DOM`);return}oldSection.replaceWith(newSection),newSection.setAttribute("data-loaded","true"),document.removeEventListener("section:cached",this._cacheListener)}onSectionCached(event2){const{url,sectionId}=event2.detail;sectionId===this.sectionId&&this.renderFromCache(url)}}customElements.get("section-fetcher")||customElements.define("section-fetcher",SectionFetcher);function setMeasuredStyleProperty(element,property,value){element.style.getPropertyValue(property)!==value&&element.style.setProperty(property,value)}function getScrollbarWidth(){const width=window.innerWidth-document.documentElement.clientWidth;width>18||setMeasuredStyleProperty(document.documentElement,"--scrollbar-width",`${width}px`)}getScrollbarWidth();function measureVisibleCartDrawerHeight(el){if(!el||el.classList.contains("hidden"))return 0;const style=window.getComputedStyle(el);return style.display==="none"||style.visibility==="hidden"?0:el.offsetHeight}function getHeaderCartDrawerHeight(){const cartDrawer=document.querySelector("cart-drawer");if(!cartDrawer?.classList.contains("open"))return;const isEmpty=cartDrawer.classList.contains("is-empty"),filledBlock=cartDrawer.querySelector("[data-cart-drawer-filled]"),emptyBlock=cartDrawer.querySelector("[data-cart-drawer-empty]"),cartDrawerHeader=isEmpty?emptyBlock?.querySelector(".drawer__header"):filledBlock?.querySelector(".drawer__header"),cartDrawerMessage=cartDrawer.querySelector(".previewCartMessage"),cartDrawerRecommendations=cartDrawer.querySelector(".drawer__cart-items-recommendations-wrapper"),cartDrawerFooter=cartDrawer.querySelector("cart-drawer-items .drawer__footer"),cartDrawerHeaderHeight=measureVisibleCartDrawerHeight(cartDrawerHeader)+measureVisibleCartDrawerHeight(cartDrawerMessage)+measureVisibleCartDrawerHeight(cartDrawerRecommendations)+measureVisibleCartDrawerHeight(cartDrawerFooter)+50;setMeasuredStyleProperty(cartDrawer,"--cart-drawer-header-height",`${cartDrawerHeaderHeight}px`)}let cartDrawerHeightFrame=0;function scheduleCartDrawerHeaderHeight(){cartDrawerHeightFrame||!document.querySelector("cart-drawer.open")||(cartDrawerHeightFrame=requestAnimationFrame(()=>{cartDrawerHeightFrame=requestAnimationFrame(()=>{cartDrawerHeightFrame=0,getHeaderCartDrawerHeight()})}))}function scheduleCartDrawerHeaderHeightAfterImages(){scheduleCartDrawerHeaderHeight();const cartDrawer=document.querySelector("cart-drawer");if(!cartDrawer?.classList.contains("open"))return;const pendingImages=[...cartDrawer?.querySelectorAll(".drawer__cart-items-recommendations-wrapper img")??[]].filter(img=>!img.complete);if(!pendingImages.length)return;let remaining=pendingImages.length;const finalize=()=>{remaining-=1,remaining<=0&&scheduleCartDrawerHeaderHeight()};pendingImages.forEach(img=>{img.addEventListener("load",finalize,{once:!0}),img.addEventListener("error",finalize,{once:!0})})}let cartDrawerHeaderResizeObserver=null;function observeCartDrawerHeaderHeight(){const cartDrawer=document.querySelector("cart-drawer");if(!cartDrawer||(cartDrawerHeaderResizeObserver?.disconnect(),!cartDrawer.classList.contains("open")))return;const targets=[cartDrawer.querySelector("[data-cart-drawer-filled]"),cartDrawer.querySelector("[data-cart-drawer-empty]"),cartDrawer.querySelector(".previewCartMessage"),cartDrawer.querySelector(".drawer__cart-items-recommendations-wrapper"),cartDrawer.querySelector("cart-drawer-items .drawer__footer"),cartDrawer.querySelector("cart-drawer-items")].filter(
2Boolean);targets.length&&(cartDrawerHeaderResizeObserver=new ResizeObserver(scheduleCartDrawerHeaderHeight),targets.forEach(el=>cartDrawerHeaderResizeObserver.observe(el)))}function initCartDrawerHeaderHeight(){return document.querySelector("cart-drawer")?(scheduleCartDrawerHeaderHeightAfterImages(),observeCartDrawerHeaderHeight(),!0):!1}function waitForCartDrawerHeaderHeight(){if(initCartDrawerHeaderHeight())return;const observer=new MutationObserver(()=>{initCartDrawerHeaderHeight()&&observer.disconnect()});observer.observe(document.documentElement,{childList:!0,subtree:!0})}window.getHeaderCartDrawerHeight=getHeaderCartDrawerHeight,window.scheduleCartDrawerHeaderHeight=scheduleCartDrawerHeaderHeight,window.initCartDrawerHeaderHeight=initCartDrawerHeaderHeight,document.addEventListener("cart:updated",()=>{scheduleCartDrawerHeaderHeightAfterImages(),observeCartDrawerHeaderHeight()}),waitForCartDrawerHeaderHeight(),document.addEventListener("DOMContentLoaded",initCartDrawerHeaderHeight),window.addEventListener("load",()=>{initCartDrawerHeaderHeight()});function logoReveal(preloadScreen){preloadScreen&&preloadScreen.classList.add("off--ready")}function pageReveal(preloadScreen){const body=document.body;preloadScreen&&(preloadScreen.classList.add("off"),body.classList.add("off"),setTimeout(()=>{preloadScreen.classList.add("loaded"),body.classList.add("loaded")},10))}function linkClick(){document.addEventListener("click",function(event2){const link=event2.target.closest("a[href]");if(!link)return;const href=link.getAttribute("href");if(href&&(href.startsWith("tel:")||href.startsWith("mailto:"))){const preload=document.querySelector(".preload-screen");preload&&preload.classList.remove("off","loaded")}}),window.addEventListener("beforeunload",()=>{document.querySelector(".preload-screen").classList.remove("off","loaded")})}function historyPageReveal(){window.addEventListener("pageshow",event2=>{const navEntry=performance.getEntriesByType?.("navigation")?.[0];if(!(event2.persisted||navEntry?.type==="back_forward"))return;const preload=document.querySelector(".preload-screen");preload&&(preload.classList.add("off","loaded"),document.body.classList.remove("off","loaded"),requestAnimationFrame(()=>pageReveal(preload)))})}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"))}class SectionId{static#separator="__";static parseId(qualifiedSectionId){return qualifiedSectionId.split(SectionId.#separator)[0]}static parseSectionName(qualifiedSectionId){return qualifiedSectionId.split(SectionId.#separator)[1]}static getIdForSection(sectionId,sectionName){return`${sectionId}${SectionId.#separator}${sectionName}`}}class HTMLUpdateUtility{static viewTransition(oldNode,newContent,preProcessCallbacks=[],postProcessCallbacks=[]){preProcessCallbacks?.forEach(callback=>callback(newContent));const newNodeWrapper=document.createElement("div");HTMLUpdateUtility.setInnerHTML(newNodeWrapper,newContent.outerHTML);const newNode=newNodeWrapper.firstChild,uniqueKey=Date.now();oldNode.querySelectorAll("[id], [form]").forEach(element=>{element.id&&(element.id=`${element.id}-${uniqueKey}`),element.form&&element.setAttribute("form",`${element.form.getAttribute("id")}-${uniqueKey}`)}),oldNode.parentNode.insertBefore(newNode,oldNode),oldNode.style.display="none",postProcessCallbacks?.forEach(callback=>callback(newNode)),setTimeout(()=>oldNode.remove(),500)}static setInnerHTML(element,html){element.innerHTML=html,element.querySelectorAll("script").forEach(oldScriptTag=>{const newScriptTag=document.createElement("script");Array.from(oldScriptTag.attributes).forEach(attribute=>{newScriptTag.setAttribute(attribute.name,attribute.value)}),newScriptTag.appendChild(document.createTextNode(oldScriptTag.innerHTML)),oldScriptTag.parentNode.replaceChild(newScriptTag,oldScriptTag)})}}const trapFocusHandlers={};function trapFocus(container,elementToFocus=container){var elements=getFocusableElements(container),first=elements[0],last=elements[elements.length-1];removeTrapFocus(),trapFocusHandlers.focusin=event2=>{event2.target!==container&&event2.target!==last&&event2.target!==first||document.addEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.keydown=function(event2){event2.code.toUpperCase()==="TAB"&&(event2.target===last&&!event2.shiftKey&&(event2.preventDefault(),first.focus()),(event2.target===container||event2.target===first)&&event2.shiftKey&&(event2.preventDefault(),last.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),elementToFocus?.focus(),elementToFocus?.tagName==="INPUT"&&["search","text","email","url"].includes(elementToFocus.type)&&elementToFocus.value&&elementToFocus.setSelectionRange(0,elementToFocus.value.length)}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",event2=>{navKeys.includes(event2.code.toUpperCase())&&(mouseClick=!1)}),window.addEventListener("mousedown",event2=>{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.pause();const deferredMedia=video.closest("deferred-media");deferredMedia&&(deferredMedia.isPlaying=!1,deferredMedia.updatePlayPauseHint(!1))}),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(event2){if(event2.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event2.target.closest("details[open]");if(!openDetailsElement)return;const summaryElement=openDetailsElement.querySelector("summary");openDetailsElement.removeAttribute("open"),summaryElement.setAttribute("aria-expanded",!1),summaryElement.focus()}Shopify.formatMoney=function(cents,format){typeof cents=="string"&&(cents=cents.replace(".",""));var value="",placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||this.money_format;function defaultOption(opt,def){return typeof opt>"u"?def:opt}function formatWithDelimiters(number,precision,thousands,decimal){if(precision=defaultOption(precision,2),thousands=defaultOption(thousands,","),decimal=defaultOption(decimal,"."),isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);let 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_space_separator":value=formatWithDelimiters(cents,2," ",".");break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_with_apostrophe_separator":value=formatWithDelimiters(cents,2,"'",".");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;case"amount_no_decimals_with_apostrophe_separator":value=formatWithDelimiters(cents,0,"'");break;default:value=formatWithDelimiters(cents,2);break}return formatString.indexOf("with_comma_separator")!==-1,formatString.replace(placeholderRegex,value)};function initProductSubtotal(subtotalNode){if(!subtotalNode||subtotalNode.dataset.subtotalReady==="true")return;const productForm=subtotalNode.closest("product-form-component");if(!productForm)return;const subtotalPriceEl=subtotalNode.querySelector("[data-subtotal-price]"),variantsDataNode=subtotalNode.querySelector("[data-subtotal-variants]");if(!subtotalPriceEl||!variantsDataNode)return;let variants=[];try{variants=JSON.parse(variantsDataNode.textContent||"[]")}catch{variants=[]}const sectionId=subtotalNode.dataset.sectionId||productForm.dataset.sectionId,quantityInput=productForm.querySelector(`#Quantity-${sectionId}`)||productForm.querySelector(".quantity__input"),variantInput=productForm.querySelector('input[name="id"]');if(!quantityInput||!variantInput)return;subtotalNode.dataset.subtotalReady="true";const formatMoney=cents=>
2Shopify&&typeof Shopify.formatMoney=="function"?Shopify.formatMoney(cents,window.money_format||subtotalNode.dataset.moneyFormat):null,updateSubtotal=()=>{const quantity=Math.max(1,Number(quantityInput.value)||1),selectedVariantId=String(variantInput.value||""),selectedVariant=variants.find(variant=>String(variant.id)===selectedVariantId);if(!selectedVariant)return;const formattedSubtotal=formatMoney(selectedVariant.price*quantity);formattedSubtotal&&(subtotalPriceEl.textContent=formattedSubtotal)};updateSubtotal(),quantityInput.addEventListener("input",updateSubtotal),quantityInput.addEventListener("change",updateSubtotal),variantInput.addEventListener("change",updateSubtotal),new MutationObserver(updateSubtotal).observe(variantInput,{attributes:!0,attributeFilter:["value"]})}function initProductSubtotals(root=document){(root.querySelectorAll?root:document).querySelectorAll("[data-product-subtotal]").forEach(initProductSubtotal)}window.initProductSubtotals=initProductSubtotals,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>initProductSubtotals()):initProductSubtotals(),document.addEventListener("shopify:section:load",()=>initProductSubtotals()),document.addEventListener("product-info:loaded",()=>initProductSubtotals());class QuantityInput extends HTMLElement{constructor(){super(),this.input=this.querySelector("input"),this.quantityMessage=this.querySelector(".quantity__message"),this.changeEvent=ne
2w Event("change",{bubbles:!0}),this.input.addEventListener("change",this.onInputChange.bind(this)),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)))}quantityUpdateUnsubscriber=void 0;connectedCallback(){this.validateQtyRules(),this.quantityUpdateUnsubscriber=subscribe(PUB_SUB_EVENTS.quantityUpdate,this.validateQtyRules.bind(this))}disconnectedCallback(){this.quantityUpdateUnsubscriber&&this.quantityUpdateUnsubscriber()}onInputChange(event2){this.checkQuantityRules(),this.validateQtyRules()}onButtonClick(event2){event2.preventDefault();const previousValue=this.input.value;event2.target.name==="plus"?parseInt(this.input.dataset.min)>parseInt(this.input.step)&&this.input.value==0?this.input.value=this.input.dataset.min:this.input.stepUp():this.input.stepDown(),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent),this.input.dataset.min===previousValue&&event2.target.name==="minus"&&(this.input.value=parseInt(this.input.min))}checkQuantityRules(){if(!this.input)return;const min=Number(this.input.min),maxAttr=Number(this.input.max),maxInv=Number(this.input.dataset.inventoryQuantity),newValue=Number(this.input.value),managedAttr=this.input.getAttribute("data-inventory-managed");let inventoryManaged=!1;if(managedAttr==="true")inventoryManaged=!0;else if(managedAttr==="false")inventoryManaged=!1;else{const q=this.input.getAttribute("data-inventory-quantity");inventoryManaged=q!==null&&q!==""}!isNaN(min)&&newValue<min&&(this.input.value=min);let didExceedMax=!1;inventoryManaged&&!isNaN(maxInv)&&maxInv>0&&newValue>maxInv?(this.input.value=maxInv,didExceedMax=!0):!isNaN(maxAttr)&&maxAttr&&newValue>maxAttr&&(this.input.value=maxAttr,didExceedMax=!0);const plusButton=this.querySelector(".quantity__button[name='plus']");if(didExceedMax){let inventoryQuantity=isNaN(maxInv)?0:maxInv,message=window.inventory_text&&window.inventory_text.warningQuantity?window.inventory_text.warningQuantity.replace("[inventory]",inventoryQuantity):`Only ${inventoryQuantity} in stock`;this.quantityMessage&&(this.quantityMessage.textContent=message,this.quantityMessage.style.display=""),plusButton&&plusButton.classList.add("disabled")}else this.quantityMessage&&(this.quantityMessage.textContent="",this.quantityMessage.style.display="none"),plusButton&&plusButton.classList.remove("disabled")}validateQtyRules(){const value=parseInt(this.input.value);if(this.input.min&&this.querySelector(".quantity__button[name='minus']").classList.toggle("disabled",parseInt(value)<=parseInt(this.input.min)),this.input.max){const max=parseInt(this.input.max);this.querySelector(".quantity__button[name='plus']").classList.toggle("disabled",value>=max)}}}customElements.get("quantity-input")||customElements.define("quantity-input",QuantityInput);function throttle(fn,delay){let lastCall=0;return function(...args){const now=new Date().getTime();if(!(now-lastCall<delay))return lastCall=now,fn(...args)}}const reducedMotion=matchMedia("(prefers-reduced-motion: reduce)");function prefersReducedMotion(){return reducedMotion.matches}function fetchConfig(type="json",config={}){const headers={"Content-Type":"application/json",Accept:`application/${type}`,...config.headers};return type==="javascript"&&(headers["X-Requested-With"]="XMLHttpRequest",delete headers["Content-Type"]),{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}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;i<count;i++){var option=selector.options[i];if(value==option.value||value==option.innerHTML)return selector.selectedIndex=i,i}},Shopify.addListener=function(target,eventName,callback){target.addEventListener?target.addEventListener(eventName,callback,!1):target.attachEvent("on"+eventName,callback)},Shopify.postLink=function(path,options){options=options||{};var method=options.method||"post",params=options.parameters||{},form=document.createElement("form");form.setAttribute("method",method),form.setAttribute("action",path);for(var key in params){var hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden"),hiddenField.setAttribute("name",key),hiddenField.setAttribute("value",params[key]),form.appendChild(hiddenField)}document.body.appendChild(form),form.submit(),document.body.removeChild(form)},Shopify.CountryProvinceSelector=function(country_domid,province_domid,options){this.countryEl=
2document.getElementById(country_domid),this.provinceEl=document.getElementById(province_domid),this.provinceContainer=document.getElementById(options.hideElement||province_domid),Shopify.addListener(this.countryEl,"change",Shopify.bind(this.countryHandler,this)),this.initCountry(),this.initProvince()},Shopify.CountryProvinceSelector.prototype={initCountry:function(){var value=this.countryEl.getAttribute("data-default");Shopify.setSelectorByValue(this.countryEl,value),this.countryHandler()},initProvince:function(){var value=this.provinceEl.getAttribute("data-default");value&&this.provinceEl.options.length>0&&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))for(var i=0;i<provinces.length;i++){var opt=document.createElement("option");opt.value=provinces[i][0],opt.innerHTML=provinces[i][1],this.provinceEl.appendChild(opt)}},clearOptions:function(selector){for(;selector.firstChild;)selector.removeChild(selector.firstChild)},setOptions:function(selector,values){for(var i=0,count=values.length;i<values.length;i++){var opt=document.createElement("option");opt.value=values[i],opt.innerHTML=values[i],selector.appendChild(opt)}}};class PreloadScreen extends HTMLElement{constructor(){super(),document.addEventListener("page:loaded",()=>{Motion.animate(this,{opacity:[1,0]},{duration:.35}).finished.then(()=>{this.setAttribute("loaded",!0)})});const onLoadCallback=()=>{const preloadScreenLogo=document.querySelector(".preload-screen[data-preload-screen-logo]");linkClick(),historyPageReveal(),preloadScreenLogo&&(logoReveal(preloadScreenLogo),pageReveal(preloadScreenLogo))};Shopify.designMode||document.readyState==="complete"?onLoadCallback():window.addEventListener("load",onLoadCallback)}}customElements.get("preload-screen")||customElements.define("preload-screen",PreloadScreen);function setCookie(name,value,days){let expires="";if(days){let date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3),expires="; expires="+date.toUTCString()}document.cookie=name+"="+value+"; path=/"+expires}function getCookie(name){let matches=document.cookie.match(new RegExp("(?:^|; )"+name.replace(/([.$?*|{}()\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return matches?decodeURIComponent(matches[1]):null}function calculateHeaderGroupHeight(header=document.querySelector("#header-component"),headerGroup=document.querySelector("#header-group")){if(!headerGroup)return 0;let totalHeight=0;const children=headerGroup.children;for(let i=0;i<children.length;i++){const element=children[i];element===header||!(element instanceof HTMLElement)||(totalHeight+=element.offsetHeight)}return header instanceof HTMLElement&&header.hasAttribute("transparent")&&!(header.parentElement&&header.parentElement.nextElementSibling)?totalHeight+header.offsetHeight:totalHeight}function updateHeaderHeights(){const header=document.querySelector("header-component");if(!(header instanceof HTMLElement))return;const headerGroupHeight=calculateHeaderGroupHeight(header);setMeasuredStyleProperty(document.body,"--header-group-height",`${headerGroupHeight}px`)}function setheaderRowHeight(){const headerMenu=document.querySelector(".header__row [data-main-menu]");if(!headerMenu)return;const row=headerMenu.closest(".header__row");if(!row)return;const{height}=row.getBoundingClientRect();setMeasuredStyleProperty(document.body,"--header-row-menu-height",`${height}px`)}deferUntilInteraction(()=>{const runHeaderFunctions=()=>{const header=document.querySelector("header-component"),rowHeight=document.querySelector(".header__row [data-main-menu]")?.closest(".header__row")?.getBoundingClientRect().height,groupHeight=header instanceof HTMLElement?calculateHeaderGroupHeight(header):null;rowHeight!=null&&setMeasuredStyleProperty(document.body,"--header-row-menu-height",`${rowHeight}px`),groupHeight!=null&&setMeasuredStyleProperty(document.body,"--header-group-height",`${groupHeight}px`)};document.readyState==="complete"?runHeaderFunctions():window.addEventListener("load",runHeaderFunctions,{once:!0})});class HeaderComponent extends HTMLElement{constructor(){super()}connectedCallback(){this.resizeObserver.observe(this),this.stickyMode=this.getAttribute("data-sticky-type"),this.offscreen=!1,this.menuDrawerHiddenWidth=null,this.intersectionObserver=null,this.lastScrollTop=0,this.timeout=null,this.animationDelay=0,this.stickyMode&&(this.observeStickyPosition(this.stickyMode==="always"),(this.stickyMode==="scroll-up"||this.stickyMode==="always")&&(this._onScroll=this._onScroll||this.handleWindowScroll.bind(this),document.addEventListener("scroll",this._onScroll,{passive:!0})))}disconnectedCallback(){this.resizeObserver.disconnect(),this.intersectionObserver?.disconnect(),this._onScroll&&document.removeEventListener("scroll",this._onScroll),document.body.style.setProperty("--header-height","0px")}resizeObserver=new ResizeObserver(([entry])=>{entry&&(cancelAnimationFrame(this._resizeRaf),this._resizeRaf=requestAnimationFrame(()=>{const{height}=entry.target.getBoundingClientRect();setMeasuredStyleProperty(document.body,"--header-height",`${height}px`)}))});observeStickyPosition(alwaysSticky=!0){if(this.intersectionObserver)return;const config={threshold:alwaysSticky?1:0};this.intersectionObserver=new IntersectionObserver(([entry])=>{if(!entry)return;const{isIntersecting}=entry;alwaysSticky?this.dataset.stickyState=isIntersecting?"inactive":"active":this.offscreen=!isIntersecting||this.dataset.stickyState==="active"},config),this.intersectionObserver.observe(this)}handleWindowScroll(){if(!this.offscreen&&this.stickyMode!=="always")return;const scrollTop=document.scrollingElement?.scrollTop??0,isScrollingUp=scrollTop<this.lastScrollTop;if(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.stickyMode==="always"){this.getBoundingClientRect().top>=this.getBoundingClientRect().height?this.dataset.scrollDirection="none":isScrollingUp?this.dataset.scrollDirection="up":this.dataset.scrollDirection="down",this.lastScrollTop=scrollTop;return}isScrollingUp?(this.removeAttribute("data-animating"),this.getBoundingClientRect().top>=0?(this.offscreen=!1,this.dataset.stickyState="inactive",this.dataset.scrollDirection="none"):(this.dataset.stickyState="active",this.dataset.scrollDirection="up")):this.dataset.stickyState==="active"?(this.dataset.scrollDirection="none",this.setAttribute("data-animating",""),this.timeout=setTimeout(()=>{this.dataset.stickyState="idle",this.removeAttribute("data-animating")},this.animationDelay)):(this.dataset.scrollDirection="none",this.dataset.stickyState="idle"),this.lastScrollTop=scrollTop}}customElements.get("header-component")||customElements.define("header-component",HeaderComponent);function menuTab(){if(!document.querySelector("[data-menu-tab]"))return;document.addEventListener("click",event2=>{const target=event2.target.closest("[data-menu-tab] a");if(!target)return;const activePage=target.dataset.handlePage||target.dataset.loadPage;!activePage||activePage==="undefined"||setCookie("page-url",activePage,1)});const canonical=document.querySelector("[canonical-url]")?.getAttribute("canonical-url");let handlePageUrl=getCookie("page-url"),menuTabItem,logoTabItem,menuItem;window.page_active&&document.querySelector(`[data-menu-tab] [data-handle-page='${window.page_active}']`)&&window.page_active!==handlePageUrl&&(setCookie("page-url",window.page_active,1),handlePageUrl=window.page_active),handlePageUrl?(menuTabItem=document.querySelector(`[data-handle-page='${handlePageUrl}']`),logoTabItem=document.querySelector(".header__heading-link").setAttribute("data-logo-page",`${handlePageUrl}
2`),menuItem=document.querySelector(`[data-handle-page='${handlePageUrl}']~.header__inline-menu`)?.setAttribute("data-menu-page",`${handlePageUrl}`)):(menuTabItem=document.querySelector("[data-handle-page].link--multi-site--active"),logoTabItem=document.querySelector("[data-logo-page].first"),menuItem=document.querySelector("[data-menu-page].link--multi-site--active"));const menuTab2=menuTabItem?.closest("[data-menu-tab]");menuTab2&&(menuTab2.querySelectorAll("[data-handle-page]").forEach(el=>el.classList.remove("link--multi-site--active")),logoTabItem?.parentElement?.querySelectorAll("[data-logo-page]").forEach(el=>el.classList.remove("link--multi-site--active")),menuItem?.parentElement?.querySelectorAll("[data-menu-page]").forEach(el=>el.classList.remove("link--multi-site--active"))),handlePageUrl?(logoTabItem?.classList.add("link--multi-site--active"),menuTabItem?.classList.add("link--multi-site--active"),menuItem?.classList.add("link--multi-site--active")):(document.querySelector("[data-handle-page]:nth-child(1)")?.classList.add("link--multi-site--active"),document.querySelector("[data-logo-page]:nth-child(1)")?.classList.add("link--multi-site--active"),document.querySelector("[data-menu-page]:nth-child(1)")?.classList.add("link--multi-site--active"))}deferUntilInteraction(()=>{menuTab()});function appendTabMenuToMainMenu(){const handle=getCookie("page-url")||window.page_active,mainLogoElements=document.querySelectorAll("[data-main-logo]"),mainMenu=document.querySelector("[data-main-menu]"),tabMenu=document.querySelector(`[data-menu-page='${handle}']`);if(mainMenu&&!(!handle||handle==="undefined")&&tabMenu){const menuTabTemplate=tabMenu.querySelector(".header__inline-menu-content template");if(menuTabTemplate){const menuTabTemplateContent=menuTabTemplate.content.cloneNode(!0);mainMenu.innerHTML="",mainMenu.appendChild(menuTabTemplateContent)}const logoTabTemplate=tabMenu.querySelector(".header__inline-menu-logo template");if(logoTabTemplate){const logoTabTemplateContent=logoTabTemplate.content.cloneNode(!0);mainLogoElements.length>0&&mainLogoElements.forEach(logoEl=>{logoEl.innerHTML="",logoEl.appendChild(logoTabTemplateContent.cloneNode(!0))})}}}deferUntilInteraction(()=>{appendTabMenuToMainMenu()});class MenuDrawer extends HTMLElement{constructor(){super(),this.mainDetailsToggle=this.querySelector("details"),this.addEventListener("keyup",this.onKeyUp.bind(this)),this.addEventListener("focusout",this.onFocusOut.bind(this)),this.bindEvents()}bindEvents(){this.querySelectorAll("summary").forEach(summary=>summary.addEventListener("click",this.onSummaryClick.bind(this))),this.querySelectorAll("button:not(.localization-selector):not(.selector__close-button):not(.country-filter__reset-button)").forEach(button=>button.addEventListener("click",this.onCloseButtonClick.bind(this)))}onKeyUp(event2){if(event2.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event2.target.closest("details[open]");openDetailsElement&&(openDetailsElement===this.mainDetailsToggle?this.closeMenuDrawer(event2,this.mainDetailsToggle.querySelector("summary")):this.closeSubmenu(openDetailsElement))}onSummaryClick(event2){const summaryElement=event2.currentTarget,detailsElement=summaryElement.parentNode,parentMenuElement=detailsElement.closest(".has-submenu"),isOpen=detailsElement.hasAttribute("open"),reducedMotion2=window.matchMedia("(prefers-reduced-motion: reduce)");function addTrapFocus(){trapFocus(summaryElement.nextElementSibling,detailsElement.querySelector("button")),summaryElement.nextElementSibling.removeEventListener("transitionend",addTrapFocus)}detailsElement===this.mainDetailsToggle?(isOpen&&event2.preventDefault(),isOpen?this.closeMenuDrawer(event2,summaryElement):this.openMenuDrawer(summaryElement)):setTimeout(()=>{detailsElement.classList.add("menu-opening"),summaryElement.setAttribute("aria-expanded",!0),parentMenuElement&&parentMenuElement.classList.add("submenu-open"),!reducedMotion2||reducedMotion2.matches?addTrapFocus():summaryElement.nextElementSibling.addEventListener("transitionend",addTrapFocus)},100)}openMenuDrawer(summaryElement){setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`)}closeMenuDrawer(event2,elementToFocus=!1){event2!==void 0&&(this.mainDetailsToggle.classList.remove("menu-opening"),this.mainDetailsToggle.querySelectorAll("details").forEach(detail
2s=>{details.removeAttribute("open"),details.classList.remove("menu-opening"),details.removeAttribute("style")}),this.mainDetailsToggle.querySelectorAll(".submenu-open").forEach(submenu=>{submenu.classList.remove("submenu-open")}),document.body.classList.remove(`overflow-hidden-${this.dataset.breakpoint}`),removeTrapFocus(elementToFocus),this.closeAnimation(this.mainDetailsToggle),event2 instanceof KeyboardEvent&&elementToFocus?.setAttribute("aria-expanded",!1))}onFocusOut(){setTimeout(()=>{this.mainDetailsToggle?.hasAttribute("open")&&!this.mainDetailsToggle?.contains(document.activeElement)&&this.closeMenuDrawer()})}onCloseButtonClick(event2){const detailsElement=event2.currentTarget.closest("details");detailsElement&&this.closeSubmenu(detailsElement)}closeSubmenu(detailsElement){const parentMenuElement=detailsElement.closest(".submenu-open");parentMenuElement&&parentMenuElement.classList.remove("submenu-open"),detailsElement.classList.remove("menu-opening"),detailsElement.querySelector("summary").setAttribute("aria-expanded",!1),removeTrapFocus(detail
2sElement.querySelector("summary")),this.closeAnimation(detailsElement)}closeAnimation(detailsElement){let animationStart;const handleAnimation=time=>{animationStart===void 0&&(animationStart=time),time-animationStart<400?window.requestAnimationFrame(handleAnimation):(detailsElement.removeAttribute("open"),detailsElement.closest("details[open]")&&trapFocus(detailsElement.closest("details[open]"),detailsElement.querySelector("summary")))};window.requestAnimationFrame(handleAnimation)}}customElements.get("menu-drawer")||customElements.define("menu-drawer",MenuDrawer);class HeaderDrawer extends MenuDrawer{constructor(){super()}openMenuDrawer(summaryElement){this.header=this.header||document.querySelector(".section-header-main"),this.borderOffset=this.borderOffset||this.closest(".drawer--menu").classList.contains("header-wrapper--border-bottom")?1:0,setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`)}closeMenuDrawer(event2,elementToFocus){elementToFocus&&(super.closeMenuDrawer(event2,elementToFocus),window.removeEventListener("resize",theme.utils.rafThrottle(this.onResize)))}}customElements.get("header-drawer")||customElements.define("header-drawer",HeaderDrawer);class DeferredMedia extends HTMLElement{constructor(){super();const poster=this.querySelector('[id^="Deferred-Poster-"]');poster&&poster.addEventListener("click",this.loadContent.bind(this))}connectedCallback(){this.toggleMediaButton=this.querySelector('button[data-click-handler="toggleMediaButton"]'),this.isPlaying=!1,this.abortController=new AbortController;const{signal}=this.abortController;if(this.setupEventListeners(),typeof MainEvents<"u"&&MainEvents.mediaStartedPlaying&&document.addEventListener(MainEvents.mediaStartedPlaying,this.pauseMedia.bind(this),{signal}),this.hasAttribute("autoplay")&&(this.isPlaying=!0,this.toggleMediaButton)){this.toggleMediaButton.classList.remove("hidden");const playIcon=this.toggleMediaButton.querySelector(".icon-play");playIcon&&playIcon.classList.toggle("hidden",this.isPlaying);const pauseIcon=this.toggleMediaButton.querySelector(".icon-pause");pauseIcon&&pauseIcon.classList.toggle("hidden",!this.isPlaying),this.toggleMediaButton.addEventListener("click",e=>{playIcon&&playIcon.classList.toggle("hidden",this.isPlaying),pauseIcon&&pauseIcon.classList.toggle("hidden",!this.isPlaying)})}}disconnectedCallback(){this.abortController.abort()}setupEventListeners(){this.toggleMediaButton&&this.toggleMediaButton.addEventListener("click",event2=>{event2.preventDefault(),event2.stopPropagation(),this.toggleMedia()})}updatePlayPauseHint(isPlaying){if(this.toggleMediaButton instanceof HTMLElement){this.toggleMediaButton.classList.remove("hidden");const playIcon=this.toggleMediaButton.querySelector(".icon-play");playIcon&&playIcon.classList.toggle("hidden",isPlaying);const pauseIcon=this.toggleMediaButton.querySelector(".icon-pause");pauseIcon&&pauseIcon.classList.toggle("hidden",!isPlaying)}}showDeferredMedia=()=>{this.loadContent(!0),this.isPlaying=!0,this.updatePlayPauseHint(this.isPlaying)};loadContent(focus=!0){if(this.getAttribute("data-media-loaded"))return;typeof MediaStartedPlayingEvent<"u"&&this.dispatchEvent(new MediaStartedPlayingEvent(this));const content=this.querySelector("template")?.content.firstElementChild?.cloneNode(!0);content&&(this.setAttribute("data-media-loaded",!0),this.appendChild(content),focus&&content instanceof HTMLElement&&content.focus(),this.toggleMediaButton?.classList.add("deferred-media__playing"),this.toggleMediaButton?.closest(".product-media-container")?.classList.add("has-deferred-media__playing"),content instanceof HTMLVideoElement&&(content.addEventListener("play",()=>{this.isPlaying=!0,this.updatePlayPauseHint(this.isPlaying)}),content.addEventListener("pause",()=>{this.isPlaying=!1,this.updatePlayPauseHint(this.isPlaying)}),content.getAttribute("autoplay")&&content.play().catch(()=>{})))}toggleMedia(){this.isPlaying?this.pauseMedia():this.playMedia()}
2playMedia(){const iframe=this.querySelector("iframe[data-video-type]");if(iframe)iframe.contentWindow?.postMessage(iframe.dataset.videoType==="youtube"?'{"event":"command","func":"playVideo","args":""}':'{"method":"play"}',"*"),this.isPlaying=!0,this.updatePlayPauseHint(this.isPlaying);else{const video=this.querySelector("video");video&&video.play().then(()=>{this.isPlaying=!0,this.updatePlayPauseHint(this.isPlaying)}).catch(e=>{})}}pauseMedia(){const iframe=this.querySelector("iframe[data-video-type]");if(iframe)iframe.contentWindow?.postMessage(iframe.dataset.videoType==="youtube"?'{"event":"command","func":"pauseVideo","args":""}':'{"method":"pause"}',"*"),this.isPlaying=!1;else{const video=this.querySelector("video");video&&(video.pause(),this.isPlaying=!1)}this.getAttribute("data-media-loaded")&&this.updatePlayPauseHint(this.isPlaying)}}customElements.get("deferred-media")||customElements.define("deferred-media",DeferredMedia);class CardMedia extends HTMLElement{constructor(){super(),this.deferredMedia=null,this.isHovered=!1}connectedCallback(){if(this.deferredMedia=this.querySelector("deferred-media"),this.deferredMedia){if(typeof this.deferredMedia.loadContent=="function"&&this.deferredMedia.loadContent(),typeof this.deferredMedia.pauseMedia=="function"&&this.deferredMedia.pauseMedia(),theme.config.isTouch)return;this.addEventListener("mouseenter",this.handleMouseEnter.bind(this)),this.addEventListener("mouseleave",this.handleMouseLeave.bind(this))}}handleMouseEnter(){this.deferredMedia&&!this.isHovered&&(this.isHovered=!0,this.deferredMedia.playMedia())}handleMouseLeave(){this.deferredMedia&&this.isHovered&&(this.isHovered=!1,this.deferredMedia.pauseMedia())}disconnectedCallback(){this.removeEventListener("mouseenter",this.handleMouseEnter.bind(this)),this.removeEventListener("mouseleave",this.handleMouseLeave.bind(this))}}customElements.get("card-media")||customElements.define("card-media",CardMedia),theme.loadSwiperLibrary=(()=>{const script=document.currentScript||document.querySelector('script[src*="/global.js"]'),url=script?.dataset.swiperUrl||(script?.src?new URL("lib-swiper.js",script.src).href:null);let loading=null;return()=>typeof window.Swiper=="function"?Promise.resolve(window.Swiper):loading||(url?(loading=new Promise((resolve,reject)=>{const asset=document.createElement("script");let deadline;const finish=error=>{clearTimeout(deadline),asset.onload=null,asset.onerror=null,error?(asset.remove(),reject(error)):resolve(window.Swiper)};asset.src=url,asset.async=!0,asset.onload=()=>finish(typeof window.Swiper=="function"?null:new Error("Carousel asset did not initialize")),asset.onerror=()=>finish(new Error("Carousel asset failed to load")),deadline=setTimeout(()=>finish(new Error("Carousel asset request timed out")),15e3),document.head.appendChild(asset)}).catch(error=>{throw loading=null,error}),loading):Promise.reject(new Error("Carousel asset URL unavailable")))})();function canLoopSwiper(requested,element,options){if(requested!==!0&&requested!=="true")return!1;const slides=element?.querySelector(".swiper-wrapper")?.children,count=slides?[...slides].filter(slide=>slide.classList.contains("swiper-slide")).length:0,variants=[options,...Object.values(options.breakpoints||{}).map(point=>({...options,...point}))],required=Math.max(...variants.map(point=>Math.ceil(Number(point.slidesPerView)||1)+Math.max(1,Number(point.slidesPerGroup)||1)));return count>=required}class SwiperComponent extends HTMLElement{constructor(){super(),this.isMobileOnly=this.hasAttribute("data-swiper-mobile"),this.swiperEl=null,this.initSwiper=null,this.options=null,this.breakpoint=null,this.breakpointChecker=null,this.arrowOnHeader=this.closest(".arrow-on-header:has(.swiper-btns-on-header)"),this._thumbnailSwiper=null,this._thumbsSwiper=null}get items(){return this._items=this._items||Array.from(this.querySelector(".swiper-wrapper").children)}connectedCallback(){const revision=this._connectionRevision=(this._connectionRevision||0)+1;this._onSwiperInteraction||=()=>{this.initSwiper||this.initializeSwiper()},this.addEventListener("pointerdown",this._onSwiperInteraction),this.addEventListener("keydown",this._onSwiperInteraction),deferUntilInteraction(()=>{!this.isConnected||revision!==this._connectionRevision||(this._stopInView=Motion.inView(this,()=>{if(!this.isMobileOnly){this.initializeSwiper();return}this.breakpoint=window.matchMedia(theme.config.mql),this.breakpointChecker=()=>{this.breakpoint.matches||this.initializeSwiper()},this.breakpoint.addEventListener("change",this.breakpointChecker),this.breakpointChecker()},{margin:"200px 0px 200px 0px"}))})}disconnectedCallback(){this._connectionRevision=(this._connectionRevision||0)+1,this.removeEventListener("pointerdown",this._onSwiperInteraction),this.removeEventListener("keydown",this._onSwiperInteraction),this._swiperLoadRequest=null,this._stopInView?.(),this._stopInView=null,this.breakpoint&&this.breakpointChecker&&this.breakpoint.removeEventListener("change",this.breakpointChecker),this.initSwiper&&(this.initSwiper.destroy(!0,!0),this.initSwiper=null),this._thumbsSwiper&&(this._thumbsSwiper.destroy(!0,!0),this._thumbsSwiper=null),this._thumbnailSwiper&&(this._thumbnailSwiper._swiperInitialized=!1),this.swiperEl&&(this.swiperEl._swiperInitialized=!1)}
2initializeSwiper(){if(!this.isConnected||this.isMobileOnly&&window.matchMedia(theme.config.mql).matches)return Promise.resolve(null);if(this.initSwiper&&!this.initSwiper.destroyed)return Promise.resolve(this.initSwiper);if(!this.querySelector(".swiper-wrapper")?.children.length)return Promise.resolve(null);if(typeof window.Swiper!="function"){if(this._swiperLoadRequest)return this._swiperLoadRequest;const revision=this._connectionRevision,request=theme.loadSwiperLibrary().then(()=>!this.isConnected||revision!==this._connectionRevision?null:(this._swiperLoadRequest=null,this.initializeSwiper())).catch(error=>(console.warn("Carousel unavailable",error),null)).finally(()=>{this._swiperLoadRequest===request&&(this._swiperLoadRequest=null)});return this._swiperLoadRequest=request,request}if(this._items=null,this.items.length>0){if(this.swiperEl=this.querySelector(".swiper"),!this.swiperEl)return;const nextButton=this.swiperEl.querySelector(".swiper-button-next"),prevButton=this.swiperEl.querySelector(".swiper-button-prev"),pagination=this.swiperEl.querySelector(".swiper-pagination"),arrowOnHeaderNextButton=this.arrowOnHeader?this.arrowOnHeader.querySelector(".swiper-btns-on-header .swiper-button-next"):nextButton,arrowOnHeaderPrevButton=this.arrowOnHeader?this.arrowOnHeader.querySelector(".swiper-btns-on-header .swiper-button-prev"):prevButton,getOption=(name,defaultValue=void 0)=>{const attr=this.getAttribute(`data-${name}`);if(attr===null)return defaultValue;try{return JSON.parse(attr)}catch{return attr==="true"?!0:attr==="false"?!1:isNaN(attr)?attr:Number(attr)}},baseSpaceBetween=getOption("space-between",20),baseBreakpoints=getOption("breakpoints",null),defaultSpacebetween=baseBreakpoints?baseSpaceBetween:baseSpaceBetween*.5,spaceBetweenTablet=baseBreakpoints?baseSpaceBetween:baseSpaceBetween*.75,defaultBreakpoints=baseBreakpoints||{750:{spaceBetween:spaceBetweenTablet},990:{spaceBetween:baseSpaceBetween}},fractionInNextButton=arrowOnHeaderNextButton?.querySelector(".swiper-pagination-fraction"),updateFraction=swiper=>{if(!fractionInNextButton)return;const current=swiper.realIndex+1,total=this.items.length;fractionInNextButton.innerHTML=`<span class="swiper-pagination-current">${current}</span> / <span class="swiper-pagination-total">${total}</span>`};if(this._thumbnailSwiper=this.querySelector(".swiper-controls__thumbnails-container .swiper"),this._thumbsSwiper=null,this._thumbnailSwiper&&!this._thumbnailSwiper._swiperInitialized){this._thumbnailSwiper._swiperInitialized=!0;const isVerticalThumbnails=(this.getAttribute("data-thumbnail-direction")||"horizontal")==="vertical",thumbnailPosition=this.querySelector(".swiper-controls__thumbnails-container")?.getAttribute("data-thumbnail-position")||"bottom",slidesPerView=thumbnailPosition==="left"||thumbnailPosition==="right"?"auto":4;this._thumbsSwiper=new Swiper(this._thumbnailSwiper,{direction:"horizontal",spaceBetween:8,slidesPerView:4,freeMode:!1,watchSlidesProgress:!0,allowTouchMove:!0,grabCursor:!0,slideToClickedSlide:!0,loop:canLoopSwiper(this._thumbnailSwiper.getAttribute("data-loop"),this._thumbnailSwiper,{slidesPerView:4,breakpoints:{750:{slidesPerView}}}),breakpoints:{750:{slidesPerView,spaceBetween:isVerticalThumbnails?8:16,direction:isVerticalThumbnails?"vertical":"horizontal"}},pagination:{el:".swiper-controls__thumbnails-container .swiper-pagination",type:"bullets",clickable:!0}})}const effect=getOption("effect",!1);this.options={observer:!1,observeParents:!1,resistance:!1,resistanceRatio:.85,direction:getOption("direction","horizontal"),watchSlidesProgress:getOption("watch-slides-progress",!1),loop:canLoopSwiper(getOption("loop",!1),this.swiperEl,{slidesPerView:getOption("slides-per-view",1),breakpoints:defaultBreakpoints}),speed:getOption("speed",500),parallax:getOption("parallax",!1),effect,spaceBetween:defaultSpacebetween,autoplay:{enabled:getOption("slide-autoplay",!1),delay:getOption("swiper-autoplay",3)*1e3,pauseOnMouseEnter:!0,disableOnInteraction:!1},slidesPerView:getOption("slides-per-view",1),centeredSlides:getOption("centered-slides",!1),autoHeight:getOption("auto-height",!1),allowTouchMove:!0,navigation:{nextEl:arrowOnHeaderNextButton,prevEl:arrowOnHeaderPrevButton,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden"},pagination:{el:pagination,clickable:!0,type:getOption("pagination-type","bullets"),dynamicBullets:getOption("dynamic-bullets",!1)},on:{init:swiper=>updateFraction(swiper),slideChange:swiper=>updateFraction(swiper)}
2,breakpoints:defaultBreakpoints,...this._thumbsSwiper?{thumbs:{swiper:this._thumbsSwiper}}:{thumbs:{swiper:null}}},this.options.effect==="fade"&&(this.options.fadeEffect={crossFade:!0}),this.isMobileOnly?this.initSwiperMobile():(this.initSwiper=new Swiper(this.swiperEl,this.options),this._thumbnailSwiper&&this._thumbsSwiper&&this._setupThumbnailSync())}return Promise.resolve(this.initSwiper)}_setupThumbnailSync(){const mainSwiper=this.initSwiper,thumbsSwiper=this._thumbsSwiper,thumbnailButtons=this._thumbnailSwiper.querySelectorAll(".swiper-controls__thumbnail");thumbnailButtons.forEach((button,index)=>{button._listenerAttached||(button.addEventListener("click",e=>{e.preventDefault(),mainSwiper.slideTo(index)}),button._listenerAttached=!0)}),mainSwiper.on("slideChange",()=>{const{activeIndex,realIndex}=mainSwiper;if(thumbnailButtons.forEach((button,index)=>{button.classList.toggle("active",index===activeIndex)}),!thumbsSwiper||thumbsSwiper.destroyed)return;let thumbsPerView=thumbsSwiper.params.slidesPerView;thumbsPerView==="auto"&&(thumbsPerView=thumbsSwiper.slides.filter(s=>s.classList.contains("swiper-slide-visible")).length||1);const totalSlides=thumbsSwiper.slides.length;let targetIndex=realIndex-Math.floor(thumbsPerView/2);targetIndex<0&&(targetIndex=0),targetIndex>totalSlides-thumbsPerView&&(targetIndex=totalSlides-thumbsPerView),thumbsSwiper.slideTo(targetIndex)}),thumbnailButtons.length>0&&thumbnailButtons[0].classList.add("active")}initSwiperMobile(){this.breakpoint&&this.breakpointChecker&&this.breakpoint.removeEventListener("change",this.breakpointChecker),this.breakpoint=window.matchMedia(theme.config.mql);const enableSwiper=()=>{if(!(!this.swiperEl||!this.options)){this.initSwiper&&(this.initSwiper.destroy(!0,!0),this.initSwiper=null);try{const swiperOptions={...this.options};this.initSwiper=new Swiper(this.swiperEl,swiperOptions),this._thumbnailSwiper&&this._thumbsSwiper&&this._setupThumbnailSync(),this.initSwiper&&(this.initSwiper.update(),this._thumbsSwiper&&this._thumbsSwiper.update())}catch(error){console.error("\u274C Error initializing Swiper:",error)}}};this.breakpointChecker=()=>{this.isMobileOnly?this.breakpoint.matches?this.initSwiper&&(this.initSwiper.destroy(!0,!0),this.initSwiper=null):this.initSwiper||enableSwiper():this.initSwiper||enableSwiper()},this.isMobileOnly&&this.breakpoint.addEventListener("change",this.breakpointChecker),this.breakpointChecker()}}customElements.get("swiper-component")||customElements.define("swiper-component",SwiperComponent),theme.initSectionVisible=function(options){const threshold=options.threshold?options.threshold:0;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`}).observe(options.element)};class AccountIcon extends HTMLElement{constructor(){super(),this.icon=this.querySelector(".icon")}connectedCallback(){document.addEventListener("storefront:signincompleted",this.handleStorefrontSignInCompleted.bind(this))}handleStorefrontSignInCompleted(event2){event2?.detail?.avatar&&this.icon?.replaceWith(event2.detail.avatar.cloneNode())}}customElements.get("account-icon")||customElements.define("account-icon",AccountIcon);class BulkAdd extends HTMLElement{constructor(){super(),this.queue=[],this.requestStarted=!1,this.ids=[]}startQueue(id,quantity){this.queue.push({id,quantity});const interval=setInterval(()=>{this.queue.length>0?this.requestStarted||this.sendRequest(this.queue):clearInterval(interval)},250)}sendRequest(queue){this.requestStarted=!0;const items={};queue.forEach(queueItem=>{items[parseInt(queueItem.id)]=queueItem.quantity}),this.queue=this.queue.filter(queueElement=>!queue.includes(queueElement)),(this.closest("quick-order-list")||this.closest("quick-add-bulk")).updateMultipleQty(items)}resetQuantityInput(id){const input=this.querySelector(`#Quantity-${id}`);input.value=input.getAttribute("value"),this.isEnterPressed=!1}setValidity(event2,index,message){event2.target.setCustomValidity(message),event2.target.reportValidity(),this.resetQuantityInput(index),event2.target.select()}validateQuantity(event2){const inputValue=parseInt(event2.target.value),index=event2.target.dataset.index;inputValue<event2.target.dataset.min?this.setValidity(event2,index,window.quickOrderListStrings.min_error.replace("[min]",event2.target.dataset.min)):inputValue>parseInt(event2.target.max)?this.setValidity(event2,index,window.quickOrderListStrings.max_error.replace("[max]",event2.target.max)):inputValue%parseInt(event2.target.step)!=0?this.setValidity(event2,index,window.quickOrderListStrings.step_error.replace("[step]",event2.target.step)):(event2.target.setCustomValidity(""),event2.target.reportValidity(),this.startQueue(index,inputValue))}getSectionsUrl(){return window.pageNumber?`${window.location.pathname}?page=${window.pageNumber}`:`${window.location.pathname}`}getSectionInnerHTML(html,selector){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}}
2customElements.get("bulk-add")||customElements.define("bulk-add",BulkAdd);class CartPerformance{static#metric_prefix="cart-performance";static createStartingMarker(benchmarkName){const metricName=`${CartPerformance.#metric_prefix}:${benchmarkName}`;return performance.mark(`${metricName}:start`)}static measureFromEvent(benchmarkName,event2){const metricName=`${CartPerformance.#metric_prefix}:${benchmarkName}`,startMarker=performance.mark(`${metricName}:start`,{startTime:event2.timeStamp}),endMarker=performance.mark(`${metricName}:end`);performance.measure(metricName,`${metricName}:start`,`${metricName}:end`)}static measureFromMarker(benchmarkName,startMarker){const metricName=`${CartPerformance.#metric_prefix}:${benchmarkName}`,endMarker=performance.mark(`${metricName}:end`);performance.measure(metricName,startMarker.name,`${metricName}:end`)}static measure(benchmarkName,callback){const metricName=`${CartPerformance.#metric_prefix}:${benchmarkName}`,startMarker=performance.mark(`${metricName}:start`);callback();const endMarker=performance.mark(`${metricName}:end`);performance.measure(metricName,`${metricName}:start`,`${metricName}:end`)}}class GridView extends HTMLElement{constructor(){super(),this.productGrid=null,this.mediaView=null,this.boundModeButtonHandler=this.onClickModeButtonHandler.bind(this)}connectedCallback(){this.productGrid=document.querySelector(".product-grid-container .product-grid"),this.mediaView=this.querySelector(".desktop-grid-view"),this.mediaView&&(this.mediaView.querySelectorAll(".button--grid-view").forEach(modeButton=>{modeButton.removeEventListener("click",this.boundModeButtonHandler),modeButton.addEventListener("click",this.boundModeButtonHandler)}),this.autoChangeLayout())}onClickModeButtonHandler(event2){if(event2.preventDefault(),!this.mediaView||!this.productGrid)return;const buttonElement=event2.currentTarget,viewMode=this.mediaView.querySelector(".button--grid-view.active"),column=parseInt(buttonElement.dataset.grid);buttonElement.classList.contains("active")||(viewMode?.classList.remove("active"),buttonElement.classList.add("active"),this.mediaViewMobile&&this.mediaViewMobile.querySelectorAll(".button--grid-view").forEach(element=>{var currentColumn=parseInt(element.dataset.grid);currentColumn==column?element.classList.add("active"):element.classList.remove("active")}),this.initViewModeLayout(column))}autoChangeLayout(){if(!this.mediaView||!this.productGrid)return;const getColByWidth=(col,width,isVertical)=>{if(isNaN(col))return col;if(isVertical){if(width<750&&[3,4,5].includes(col)||width<=1100&&width>=750&&[3,4,5].includes(col))return 2;if(width<1300&&width>1100&&[4,5].includes(col))return 3;if(width<1700&&width>=1300&&col==5)return 4}else{if(width<750&&[3,4,5].includes(col))return 2;if(width<990&&width>=750&&[3,4,5].includes(col))return 3;if(width<1600&&width>=990&&col==5)return 4}return col},updateViewMode=()=>{if(!this.mediaView||!this.productGrid)return;let viewMode=this.mediaView.querySelector(".button--grid-view.active"),col=parseInt(viewMode?.dataset.grid);if(!viewMode||isNaN(col))return;const width=window.innerWidth,isVertical=!!document.querySelector(".facets-vertical"),newCol=getColByWidth(col,width,isVertical);if(col!==newCol){viewMode.classList.remove("active");const newButton=this.mediaView.querySelector(`.grid-view--item.grid-view-${newCol} .button--grid-view`);newButton&&newButton.classList.add("active"),col=newCol}};window.theme&&theme.utils&&typeof theme.utils.rafThrottle=="function"?window.addEventListener("resize",theme.utils.rafThrottle(updateViewMode)):window.addEventListener("resize",updateViewMode),updateViewMode()}transitionGrid(gridView,cards){const execute=()=>{this.productGrid&&(cards||(cards=this.productGrid.querySelectorAll(".product-grid__item")),document.startViewTransition&&cards.length>0?(cards.forEach(card=>{card&&card.dataset&&card.dataset.productId&&card.style.setProperty("view-transition-name",`product-card-${card.dataset.productId}`)}),document.startViewTransition(()=>{this.productGrid.setAttribute("data-view",gridView)}).finished.finally(()=>{cards.forEach(card=>{card&&card.style.removeProperty("view-transition-name")})})):this.productGrid.setAttribute("data-view",gridView))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",execute,{once:!0}):execute()}changeLayoutGrid(event2){if(!this.productGrid)return;const gridView=event2.currentTarget.dataset.grid,parent=event2.currentTarget.closest(".grid-view--list"),cards=this.productGrid.querySelectorAll(".product-grid__item");parent&&(parent.querySelectorAll(".button--grid-view").forEach(button=>{button.classList.add("cursor-pointer"),button.classList.remove("active")}),event2.currentTarget.classList.remove("cursor-pointer"),event2.currentTarget.classList.add("active")),this.transitionGrid(gridView,cards)}initViewModeLayout(column){if(!this.productGrid)return;const cards=this.productGrid.querySelectorAll(".product-grid__item");this.transitionGrid(column,cards)}}customElements.get("grid-view")||customElements.define("grid-view",GridView);class RecentlyViewedProducts extends HTMLElement{constructor(){super()}connectedCallback(){this.init()}init(){theme.initSectionVisible({element:this,callback:this.load.bind(this),threshold:400})}load(){fetch(this.getUrl()).then(response=>response.text()).then(text=>{const recentlyViewed=new DOMParser().parseFromString(text,"text/html").querySelector("recently-viewed-products");if(!recentlyViewed)return;this.innerHTML=recentlyViewed.innerHTML;const recentlyViewedProducts=this.querySelector(".collection--grid-layout");if(recentlyViewedProducts&&recentlyViewedProducts.textContent.trim()===""&&this.classList.add("hidden"),this.querySelectorAll("card-media").forEach(cardMedia=>{this.deferredMedia=cardMedia.querySelector("deferred-media"),this.deferredMedia&&typeof this.deferredMedia.loadContent=="function"&&this.deferredMedia.loadContent(),this.deferredMedia&&typeof this.deferredMedia.pauseMedia=="function"&&this.deferredMedia.pauseMedia()}),typeof initMoreSwatchButtons=="function"){const container=document.getElementById("recently-viewed-products");initMoreSwatchButtons(container||document)}}).catch(e=>{console.error(e)})}getUrl(){const listItems=JSON.parse(localStorage.getItem("_halo_re
2cently_viewed")||"[]");return this.dataset.productId&&listItems.includes(parseInt(this.dataset.productId))&&listItems.splice(listItems.indexOf(parseInt(this.dataset.productId)),1),this.dataset.url+listItems.map(id=>"id:"+id).slice(0,parseInt(this.dataset.limit)).join("%20OR%20")}}customElements.get("recently-viewed-products")||customElements.define("recently-viewed-products",RecentlyViewedProducts);const moreButton=document.querySelectorAll(".card__swatch .item-swatch-more .number-showmore");function initMoreSwatchButtons(root=document){root.querySelectorAll(".card__swatch .item-swatch-more .number-showmore").forEach(button=>{button.dataset.moreSwatchBound!=="true"&&(button.dataset.moreSwatchBound="true",button.addEventListener("click",function(event2){const swatch=event2.target.closest(".swatch-list");span=button.querySelector("span"),groupSwatch=swatch.querySelector(".group-swatch"),groupSwatch.classList.contains("is-expanded")?(groupSwatch.classList.remove("is-expanded"),span&&(span.textContent="+")):(groupSwatch.classList.add("is-expanded"),span&&(span.textContent="-"))}))})}deferUntilInteraction(()=>{document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>initMoreSwatchButtons()):initMoreSwatchButtons()});let wishlistItemsCache=null,wishlistItemsSet=new Set,wishlistConfigCache=null;window.lcWishlistStorageError=!1;function wishlistText(key){if(!wishlistConfigCache)try{wishlistConfigCache=JSON.parse(document.getElementById("lc-wishlist-config")?.textContent||"{}")}catch{wishlistConfigCache={}}return wishlistConfigCache[key]||""}function wishlistStorageError(error){window.lcWishlistStorageError=!0,document.dispatchEvent(new CustomEvent("lc:wishlist-storage-error",{detail:{error:error.name}}))}function readWishlistItems(refresh=!1){if(!refresh&&wishlistItemsCache!==null&&!window.lcWishlistStorageError)return wishlistItemsCache;try{const stored=localStorage.getItem("wishlistItem"),parsed=stored===null?[]:JSON.parse(stored);if(!Array.isArray(parsed)||parsed.some(handle=>typeof handle!="string"||!handle))throw new TypeError("Invalid wishlist data");return wishlistItemsSet=new Set(parsed),wishlistItemsCache=[...wishlistItemsSet],window.lcWishlistStorageError=!1,wishlistItemsCache}catch(error){return wishlistStorageError(error),null}}function writeWishlistItems(items){try{return localStorage.setItem("wishlistItem",JSON.stringify(items)),wishlistItemsCache=items.slice(),wishlistItemsSet=new Set(items),window.lcWishlistStorageError=!1,!0}catch(error){return wishlistStorageError(error),!1}}function syncWishlistButtons(scope=document,items=readWishlistItems()){if(!items)return;const saved=items===wishlistItemsCache?wishlistItemsSet:new Set(items);(scope.matches?.("[data-wishlist]")?[scope]:scope.querySelectorAll("[data-wishlist]")).forEach(button=>{const selected=saved.has(button.dataset.wishlistHandle),label=selected?button.closest("wishlist-view")?window.wishlist.remove:window.wishlist.added:window.wishlist.add;button.classList.toggle("wishlist-added",selected);const text=button.querySelector(".text, .text-inner");text&&(text.textContent=label),button.tagName==="BUTTON"&&(button.setAttribute("title",label),button.setAttribute("aria-label",label),button.setAttribute("aria-pressed",String(selected)))})}function setProductForWishlistGlobal(){syncWishlistButtons()}function checkWishlistCountGlobal(items){items&&(document.querySelectorAll("[data-wishlist-count]").forEach(element=>{element.textContent=items.length}),document.querySelectorAll(".wishlist-count-bubble").forEach(element=>{element.style.display=items.length?"":"none"}))}function initWishlistFromLocalStorage(){const items=readWishlistItems();items&&(checkWishlistCountGlobal(items),syncWishlistButtons(document,items))}window.addEventListener("storage",event2=>{if(event2.key!=="wishlistItem"&&event2.key!==null)return;const items=readWishlistItems(!0);items&&(checkWishlistCountGlobal(items),syncWishlistButtons(document,items),document.dispatchEvent(new CustomEvent("lc:wishlist-changed")))});class Wishlist extends HTMLElement{constructor(){super(),this.onClick=this.onWishlistButtonClick.bind(this)}connectedCallback(){this.init()}disconnectedCallback(){this.wishlistButton?.removeEventListener("click",this.onClick)}init(){this.wishlistButton?.removeEventListener("click",this.onClick),this.wishlistButton=this.querySelector("[data-wishlist]"),this.wishlistButton&&(this.wishlistButton.addEventListener("click",this.onClick),syncWishlistButtons(this.wishlistButton))}onWishlistButtonClick(event2){event2.preventDefault(),event2.stopPropagation();const handle=event2.currentTarget.dataset.wishlistHandle;if(!handle)return;const current=readWishlistItems(!0);if(!current)return;const selected=current.includes(handle),next=selected?current.filter(item=>item!==handle):[...current,handle];writeWishlistItems(next)&&(checkWishlistCountGlobal(next),syncWishlistButtons(document,next),document.dispatchEvent(new CustomEvent(selected?"remove:wishlist-item":"add:wishlist-item",{detail:{handle,productId:event2.currentTarget.dataset.productId},bubbles:!0})),document.dispatchEvent(new CustomEvent("lc:wishlist-changed")))}setProductForWishlist(handle){setProductForWishlistGlobal(handle)}checkWishlistCount(items){checkWishlistCountGlobal(items)}}customElements.get("wish-list")||customElements.define("wish-list",Wishlist);class WishlistView extends HTMLElement{constructor(){super(),this.generation=0,this.onAdded=event2=>{this.refreshFromStorage(),event2.detail?.handle&&this.enqueue([event2.detail.handle])},this.onChanged=()=>this.refreshFromStorage(),this.onStorageError=()=>this.updateStatus(),this.onLoadMore=()=>this.loadMore(),this.onRetry=()=>this.retryFailed()}connectedCallback(){this.connected||(this.connected=!0,this.generation++,this.gridViewContainer=this.querySelector("[data-wishlist-items-grid-display]"),this.wishlistContainer=this.closest("[data-wishlist-container]"),this.wishlistFooter=this.closest('[data-section-type="wishlist"]')?.querySelector("[data-wishlist-footer]"),this.status=this.querySelector("[data-wishlist-status]"),this.errorNotice=this.querySelector("[data-wishlist-storage-error]"),this.unavailableNotice=this.querySelector("[data-wishlist-unavailable]"),this.emptyState=this.querySelector("[data-wishlist-empty]"),this.moreButton=this.querySelector("[data-wishlist-more]"),this.retryButton=this.querySelector("[data-wishlist-retry]"),this.cards=new Map,this.slots=new Map,this.requested=new Set,this.requestTokens=new Map,this.failed=new Set,this.controllers=new Map,this.queue=[],this.activeRequests=0,this.handles=[],this.handleSet=new Set,this.batchSize=window.innerWidth<750?8:12,this.gridViewContainer?.replaceChildren(),document.addEventListener("add:wishlist-item",this.onAdded),document.addEventListener("lc:wishlist-changed",this.onChanged),document.addEventListener("lc:wishlist-storage-error",this.onStorageError),this.moreButton?.addEventListener("click",this.onLoadMore),this.retryButton?.addEventListener("click",this.onRetry),this.refreshFromStorage(),this.loadMore())}disconnectedCallback(){this.connected=!1,this.generation++,document.removeEventListener("add:wishlist-item",this.onAdded),document.removeEventListener("lc:wishlist-changed",this.onChanged),document.removeEventListener("lc:wishlist-storage-error",this.onStorageError),this.moreButton?.removeEventListener("click",this.onLoadMore),this.retryButton?.removeEventListener("click",this.onRetry),this.controllers.forEac
2h(controller=>controller.abort()),this.queue=[]}refreshFromStorage(){const items=readWishlistItems();if(!items){this.updateStatus();return}this.handles=items.slice(),this.handleSet=new Set(items),this.queue=this.queue.filter(entry=>this.handleSet.has(entry.handle)),this.requested.forEach(handle=>{this.handleSet.has(handle)||(this.controllers.get(handle)?.abort(),this.slots.get(handle)?.remove(),this.cards.get(handle)?.remove(),this.slots.delete(handle),this.cards.delete(handle),this.requested.delete(handle),this.requestTokens.delete(handle),this.failed.delete(handle))}),this.updateStatus(),this.updateShareWishlistViaMail()}loadMore(){if(window.lcWishlistStorageError){if(!readWishlistItems(!0))return;this.refreshFromStorage()}this.enqueue(this.handles.filter(handle=>!this.requested.has(handle)).slice(0,this.batchSize))}retryFailed(){if(window.lcWishlistStorageError&&!readWishlistItems(!0))return;const retry=[...this.failed];retry.forEach(handle=>{this.failed.delete(handle),this.requested.delete(handle)}),this.refreshFromStorage(),this.enqueue(retry.length?retry:this.handles.filter(handle=>!this.requested.has(handle)).slice(0,this.batchSize))}enqueue(handles){!this.connected||!this.gridViewContainer||window.lcWishlistStorageError||(handles.forEach(handle=>
2{if(!this.handleSet.has(handle)||this.requested.has(handle))return;this.requested.add(handle);const token={};this.requestTokens.set(handle,token);const slot=document.createElement("div");slot.className="lc-wishlist-placeholder",slot.setAttribute("aria-hidden","true"),this.slots.set(handle,slot);const position=this.handles.indexOf(handle),nextHandle=this.handles.slice(position+1).find(item=>this.slots.has(item)||this.cards.has(item));this.gridViewContainer.insertBefore(slot,this.slots.get(nextHandle)||this.cards.get(nextHandle)||null),this.queue.push({handle,token})}),this.pump(),this.updateStatus())}pump(){if(this.connected)for(;this.activeRequests<4&&this.queue.length;){const{handle,token}=this.queue.shift();if(!this.handleSet.has(handle))continue;const generation=this.generation,controller=new AbortController;this.controllers.set(handle,controller),this.activeRequests++;const timeout=window.setTimeout(()=>controller.abort(),15e3);this.setProductForWishlistPage(handle,controller.signal).then(card=>{if(generation!==this.generation||!this.connected||this.requestTokens.get(handle)!==token||!this.handleSet.has(handle))return;const slot=this.slots.get(handle);card&&slot?(slot.replaceWith(card),this.cards.set(handle,card),this.failed.delete(handle),syncWishlistButtons(card),initMoreSwatchButtons(card)):(slot?.remove(),this.failed.add(handle)),this.slots.delete(handle)}).catch(()=>{generation!==this.generation||!this.connected||this.requestTokens.get(handle)!==token||!this.handleSet.has(handle)||(this.slots.get(handle)?.remove(),this.slots.delete(handle),this.failed.add(handle))}).finally(()=>{window.clearTimeout(timeout),generation===this.generation&&(this.controllers.get(handle)===controller&&this.controllers.delete(handle),this.activeRequests--,this.pump(),this.updateStatus(),this.updateShareWishlistViaMail())})}}async setProductForWishlistPage(handle,signal){if(typeof handle!="string"||!handle)return null;const localeRoot=window.Shopify?.routes?.root||window.routes?.root_url||"/",response=await fetch(`${localeRoot.replace(/\/$/,"")}/products/${encodeURIComponent(handle)}?view=lc_wishlist_card`,{signal});if(!response.ok)return null;const card=[...new DOMParser().parseFromString(await response.text(),"text/html").querySelectorAll(".card--block[data-product-url]")].find(item=>{try{const path=new URL(item.dataset.productUrl,window.location.origin).pathname;return path.includes("/products/")&&decodeURIComponent(path.split("/products/").pop())===handle}catch{return!1}});return card?(card.dataset.productHandle=handle,card.dataset.wishlistAdded=`wishlist-${card.dataset.productCardId}`,card.classList.add("is-in-grid"),card):null}updateStatus(){const busy=this.activeRequests>0||this.queue.length>0,storageError=!!window.lcWishlistStorageError,empty=!storageError&&this.handles.length===0;this.emptyState&&(this.emptyState.hidden=!empty),this.errorNotice&&(this.errorNotice.hidden=!storageError),this.unavailableNotice&&(this.unavailableNotice.hidden=!this.failed.size),this.gridViewContainer&&(this.gridViewContainer.hidden=empty,this.gridViewContainer.classList.add("is-loaded"),this.gridViewContainer.setAttribute("aria-busy",String(busy))),this.wishlistFooter&&(this.wishlistFooter.hidden=empty||storageError);const switcher=this.wishlistContainer?.querySelector("grid-view");switcher&&(switcher.hidden=empty);const remaining=this.handles.some(handle=>!this.requested.has(handle));this.moreButton&&(this.moreButton.hidden=!remaining||storageError,this.moreButton.disabled=busy),this.retryButton&&(this.retryButton.hidden=!this.failed.size&&!storageError,this.retryButton.disabled=busy),this.status&&(this.status.hidden=empty||storageError,this.status.textContent=busy?wishlistText("loading"):wishlistText("loaded_count").replace("__LC_LOADED__",this.cards.size).replace("__LC_TOTAL__",this.handles.length))}updateShareWishlistViaMail(){const link=this.wishlistFooter?.querySelector("[data-wishlist-share]");if(!link)return;const root=window.Shopify?.routes?.root||window.routes?.root_url||"/",body=this.handles.map(handle=>{const card=this.cards.get(handle),title=card?.dataset.productTitle||handle.replace(/-/g," "),price=card?.querySelector(".price__sale .price-item--last, .price__regular .price-item")?.textContent.trim(),url=new URL(`${root.replace(/\/$/,"")}/products/${encodeURIComponent(handle)}`,window.location.origin).href;
2return[title,price,url].filter(Boolean).join(` 3`)}).join(` 4 5`);link.href=`mailto:?subject=${encodeURIComponent(wishlistText("label"))}&body=${encodeURIComponent(body)}`}}customElements.get("wishlist-view")||customElements.define("wishlist-view",WishlistView),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initWishlistFromLocalStorage,{once:!0}):initWishlistFromLocalStorage();class CountDown extends HTMLElement{constructor(){super()}connectedCallback(){this.d=new Date(this.dataset.countdown).getTime(),this.t=this.dataset.type,this.e=this.dataset.hide,this.createObserver()}init(time,type,hide){var countdown=setInterval(()=>{let now=new Date().getTime();if(isNaN(time)&&(time=new Date(this.dataset.countdown.replace(/-/g,"/")).getTime(),isNaN(time))){clearInterval(countdown),this.parentElement.classList.add("hidden");return}let distance=time-now;if(distance<0)if(clearInterval(countdown),hide=="true")this.parentElement.classList.add("hidden");else{let content=`<span class="countdown-item inline-block v-a-top center"><span class="flex flex-column items-center justify-center countdown-digit typography-font-body font-semibold relative">0<span class="block body-sm">${window.countdown.days}</span></span></span> <span class="countdown-item inline-block v-a-top center w-auto"><span class="flex flex-column items-center justify-center countdown-digit typography-font-body font-semibold relative">0<span class="block body-sm">${window.countdown.hours}</span></span></span> <span class="countdown-item inline-block v-a-top center w-auto"><span class="flex flex-column items-center justify-center countdown-digit typography-font-body font-semibold relative">0<span class="block body-sm">${window.countdown.mins}</span></span></span> <span class="countdown-item inline-block v-a-top center w-auto"><span class="flex flex-column items-center justify-center countdown-digit typography-font-body font-semibold relative">0<span class="block body-sm">${window.countdown.secs}</span></span></span>`;this.querySelector(".countdown").innerHTML=content,this.querySelector(".countdown-expired").classList.remove("hidden")}else{let day=Math.floor(distance/864e5),hour=Math.floor(distance%(1e3*60*60*24)/(1e3*60*60)),minute=Math.floor(distance%(1e3*60*60)/(1e3*60)),second=Math.floor(distance%(1e3*60)/1e3),content;type=="sale-banner"&&(content=`<span class="countdown-item inline-block v-a-top center"><span class="flex flex-column items-center justify-center countdown-digit typography-font-body font-semibold relative">${day}<span class="block body-sm">${window.countdown.days}</span></span></span> <span class="countdown-item inline-block v-a-top center w-auto"><span class="flex flex-column items-center justify-center countdown-digit typography-font-body font-semibold relative">${hour}<span class="block body-sm">${window.countdown.hours}</span></span></span> <span class="countdown-item inline-block v-a-top center w-auto"><span class="flex flex-column items-center justify-center countdown-digit typography-font-body font-semibold relative">${minute}<span class="block body-sm">${window.countdown.mins}</span></span></span> <span class="countdown-item inline-block v-a-top center w-auto"><span class="flex flex-column items-center justify-center countdown-digit typography-font-body font-semibold relative">${second}<span class="block body-sm">${window.countdown.secs}</span></span></span>`,this.querySelector(".countdown").innerHTML=content,this.parentElement.classList.remove("hidden"))}},1e3)}createObserver(){new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{this.init(this.d,this.t,this.e),observer2.unobserve(this)})},{rootMargin:"0px 0px -200px 0px"}).observe(this)}}customElements.get("count-down")||customElements.define("count-down",CountDown);class ColorSwatch extends HTMLElement{constructor(){super()}connectedCallback(){this.init()}init(){this.swatchList=this.querySelector(".swatch-list"),this.variantSelectsSwatchList=this.querySelector("variant-selects .swatch-list"),this.swatchList?.addEventListener("click",this.handleSwatchClick.bind(this))}handleSwatchClickActive(event2){const target=event2.target;target.closest(".swatch-item")&&(this.querySelectorAll(".swatch-item").forEach(item=>{item!==target.closest(".swatch-item")&&item.classList.remove("active")}
5),target.closest(".swatch-item").classList.add("active"))}handleSwatchClick(event2){let target=event2.target,title=target.getAttribute("data-title")?.trim(),product=target.closest(".card-wrapper");if(!product)return;let template=product.querySelector("template"),fragment=template.content.cloneNode(!0),divFragment=fragment.querySelector("[data-json-product]"),jsonData=divFragment.getAttribute("data-json-product"),productJson=JSON.parse(jsonData),productTitle=product.querySelector(".card__heading > a"),variantId=Number(target.dataset.variantId),productHref=product.querySelector("a").getAttribute("href"),newImage=target.dataset.variantImg,mediaList=[];if(target.closest(".swatch-item")){this.handleSwatchClickActive(event2),title=title.replace(/-/g," ").replace(/\b\w/g,char=>char.toUpperCase()),productTitle.classList.contains("card-title-change")||productTitle.classList.add("card-title-change"),productTitle.querySelector(".text").setAttribute("data-change-title"," - "+title);const selectedVariant=productJson.variants.find(variant=>variant.id===variantId);if(selectedVariant.compare_at_price>selectedVariant.price){product.querySelector(".price").classList.add("price--on-sale"),product.querySelector(".price__sale .price-item--regular").innerHTML=Shopify.formatMoney(selectedVariant.compare_at_price,window.money_format),product.querySelector(".price__sale .price-item--sale").innerHTML=Shopify.formatMoney(selectedVariant.price,window.money_format);const labelSale=`(-${Math.round((selectedVariant.compare_at_price-selectedVariant.price)*100/selectedVariant.compare_at_price)}%)`,salePercent=product.querySelector(".price__sale .price-item--percent span");salePercent&&(salePercent.innerHTML=labelSale)}else product.querySelector(".price__regular .price-item").innerHTML=Shopify.formatMoney(selectedVariant.price,window.money_format),selectedVariant.compare_at_price==null&&(product.querySelector(".price").classList.remove("price--on-sale"),product.querySelector(".price__sale .price-item--regular").innerHTML="");if(product.querySelector(".card__heading > a").setAttribute("href",productHref.split("?variant=")[0]+"?variant="+variantId),productJson.media!=null){const mediaList2=productJson.media.filter((index,element)=>element.alt===title)}if(mediaList.length>0){if(!(mediaList.length>1)){const length2=mediaList.length}for(let i=0;i<length;i++)product.querySelector(".card__media img:eq("+i+")").setAttribute("srcset",mediaList[i].src)}else newImage&&product.querySelector(".card__media img:nth-child(1)").setAttribute("srcset",newImage)}}}customElements.get("color-swatch")||customElements.define("color-swatch",ColorSwatch);class ShowMoreGrid extends HTMLElement{constructor(){super()}connectedCallback(){this.refType=this.getAttribute("ref"),this.button=this.querySelector("button"),!(!this.button||!this.refType)&&(this.refType==="collection-grid"&&(this.itemsPerClick=parseInt(this.getAttribute("data-max-items")),this.currentIndex=0),this.button.addEventListener("click",this.handleButtonClick.bind(this)))}handleButtonClick(event2){event2.preventDefault(),this.refType==="collection-grid"?this.handleCollectionGrid():this.refType==="product-grid"&&this.handleProductGrid()}handleCollectionGrid(){const sectionContent=this.closest(".collection-list-page");if(!sectionContent)return;const template=sectionContent.querySelector("template[data-collection-card-template-showmore]");if(!template)return;const collectionListEditorial=sectionContent.querySelector(".editorial-collection__grid"),allHiddenItems=Array.from(collectionListEditorial?template.content.querySelectorAll(".editorial-collection__item"):template.content.querySelectorAll(".resource-list__item")),collectionList=collectionListEditorial||sectionContent.querySelector(".resource-list");if(!collectionList||!allHiddenItems.length)return;allHiddenItems.slice(this.currentIndex,this.currentIndex+this.itemsPerClick).forEach(item=>{const clone=item.cloneNode(!0);collectionList.appendChild(clone)}),this.currentIndex+=this.itemsPerClick,this.currentIndex>=allHiddenItems.length&&this.remove()}handleProductGrid(){const sectionContent=this.closest(".section-global__content");
5if(!sectionContent)return;const template=sectionContent.querySelector("template[data-product-grid-template-showmore]");if(!template)return;const productGrid=sectionContent.querySelector(".collection--grid-layout .grid-layout");if(!productGrid)return;const templateContent=template.content.cloneNode(!0);productGrid.appendChild(templateContent),this.remove()}}customElements.get("show-more-grid")||customElements.define("show-more-grid",ShowMoreGrid);class ParallaxImg extends HTMLElement{constructor(){super(),this.img=null,this.disableParallaxMobile=this.getAttribute("data-disable-parallax-mobile")==="true",this.isMobile=window.innerWidth<750}connectedCallback(){theme.config.motionReduced||this.getAttribute("data-parallax")==="true"&&(this.img=this.querySelector(".image-parallax--target"),this.img&&(this.disableParallaxMobile&&this.isMobile||(this.img.complete?this.setupParallax():this.img.addEventListener("load",()=>this.setupParallax(),{once:!0}))))}setupParallax(){const speed=parseFloat(this.dataset.speed)||.5,screenSpeed=window.innerWidth<750?speed*.5:speed,minExtra=parseInt(this.dataset.minExtra)||100,viewportHeight=window.innerHeight,blockHeight=this.offsetHeight;let imgHeight=this.img.getBoundingClientRect().height;imgHeight-blockHeight<minExtra&&(imgHeight=this.img.getBoundingClientRect().height+minExtra);const maxMove=(imgHeight-blockHeight)*(viewportHeight/blockHeight),startY=-maxMove*screenSpeed,endY=maxMove*screenSpeed;Motion.scroll(Motion.animate(this.img,{y:[startY,endY]},{ease:[.25,.1,.25,1],duration:.3}),{target:this,offset:["start end","end start"]})}}customElements.get("parallax-image")||customElements.define("parallax-image",ParallaxImg);class ParallaxElement extends HTMLElement{constructor(){super(),this.target=null,this.type=this.getAttribute("is")||"content",this.disableParallaxMobile=this.getAttribute("data-disable-parallax-mobile")==="true",this.isMobile=window.innerWidth<750}connectedCallback(){theme.config.motionReduced||this.getAttribute("data-parallax")==="true"&&(this.target=this.querySelector(".parallax--target")||this.firstElementChild,this.target&&(this.disableParallaxMobile&&this.isMobile||(this.type==="image"?this.target.complete?this.setupImage():this.target.addEventListener("load",()=>this.setupImage(),{once:!0}):(this.section=this.closest(".shopify-section")||this,this.setupContent()))))}setupImage(){const speed=parseFloat(this.dataset.speed)||.5,screenSpeed=window.innerWidth<750?speed*.5:speed,minExtra=parseInt(this.dataset.minExtra)||100,viewportHeight=window.innerHeight,blockHeight=this.offsetHeight;let imgHeight=this.target.getBoundingClientRect().height;imgHeight-blockHeight<minExtra&&(imgHeight+=minExtra);const maxMove=(imgHeight-blockHeight)*(viewportHeight/blockHeight),startY=-maxMove*screenSpeed,endY=maxMove*screenSpeed;Motion.scroll(Motion.animate(this.target,{y:[startY,endY]},{ease:[.25,.1,.25,1],duration:.3}),{target:this,offset:["start end","end start"]})}setupContent(){const speed=parseFloat(this.dataset.speed)||.5,screenSpeed=window.innerWidth<750?speed*.5:speed,horizontalRange=(this.dataset.horizontalPosition||"0% 0%").split(" "),verticalRange=(this.dataset.verticalPosition||"0% 0%").split(" "),startX=horizontalRange[0]||"0%",startY=verticalRange[0]||"0%",parseVal=val=>typeof val=="string"&&val.includes("%")?parseFloat(val):parseFloat(val)||0,midX=parseVal(startX),midY=parseVal(startY),reverseX=midX*-1/3,reverseY=midY*-1/3;if(midX===0&&midY===0){const startY2=-30*screenSpeed,endY=30*screenSpeed;Motion.scroll(Motion.animate(this.target,{y:[`${startY2}%`,`${endY}%`]},{ease:[.25,.1,.25,1],duration:.3}),{target:this.section,offset:["start end","end start"]});return}Motion.scroll(Motion.animate(this.target,{x:["0%",`${midX}%`,`${reverseX}%`],y:["0%",`${midY}%`,`${reverseY}%`]},{ease:[.25,.1,.25,1],duration:.3}),{target:this.section,offset:["start end","center center","end start"]})}}customElements.get("parallax-element")||customElements.define("parallax-element",ParallaxElement);class ParallaxBackground extends HTMLElement{constructor(){super(),this.image=null}connectedCallback(){theme.config.motionReduced||this.parallax()}parallax(){this.image=this.querySelector("img"),this.image&&Motion.scroll(Motion.animate(this.image,{y:["-30%","30%"]},{ease:"none",duration:1}),{target:this,offset:["start end","end start"]})}}customElements.get("parallax-background")||customElements.define("parallax-background",ParallaxBackgroun
5d);class SplitWords extends HTMLElement{constructor(){super()}connectedCallback(){if(theme.config.motionReduced)return;Splitting({target:this,by:"words"})[0].words.forEach((text,idx)=>{const wrapper=document.createElement("animated-element");wrapper.className="inline-block",wrapper.setAttribute("data-animate-type",this.getAttribute("data-animate-type")),wrapper.setAttribute("data-animate-delay",(this.hasAttribute("data-animate-delay")?parseInt(this.getAttribute("data-animate-delay")):0)+idx*20);for(const content of text.childNodes)wrapper.appendChild(content);text.appendChild(wrapper)})}}customElements.get("split-words")||customElements.define("split-words",SplitWords);class AnimatedElement extends HTMLElement{constructor(){super(),this.animationType=this.getAttribute("data-animate-type")}connectedCallback(){theme.config.motionReduced||(this.beforeLoad(),Motion.inView(this,this.afterLoad.bind(this),{margin:"20px 0px 20px 0px"}))}beforeLoad(){this.animationType==="slide-up"&&Motion.animate(this,{transform:"translateY(95%)",opacity:0},{duration:0})}async afterLoad(){this.animationType==="slide-up"&&await Motion.animate(this,{transform:"translateY(0)",opacity:1},{duration:1,easing:theme.config.easingFast}).finished}}customElements.get("animated-element")||customElements.define("animated-element",AnimatedElement);class AnimateImage extends HTMLElement{constructor(){super(),this.animationType=this.getAttribute("data-animate-type"),this.image=this.querySelector("img"),this.delay=this.getAttribute("data-delay")||0}connectedCallback(){theme.config.motionReduced||(this.beforeLoad(),Motion.inView(this,async()=>{this.media&&await theme.utils.imageLoaded(this.media),this.afterLoad()}))}beforeLoad(){switch(this.animationType){case"reveal_on_scroll":Motion.animate(this.image,{opacity:0,scale:1,clipPath:"inset(0 100% 0 0)"},{duration:0});break;case"zoom-out":Motion.animate(this.image,{transform:"scale(1.2)"},{duration:0});break;case"fade-in":Motion.animate(this.image,{opacity:0},{duration:0});break}}async afterLoad(){switch(this.animationType){case"reveal_on_scroll":await Motion.animate(this.image,{opacity:1,scale:1,clipPath:"inset(0 0 0 0)"},{duration:1,delay:this.delay,easing:theme.config.easing}).finished;break;case"zoom-out":await Motion.animate(this.image,{transform:"scale(1)"},{duration:1,delay:this.delay,easing:theme.config.easing}).finished;break;case"fade-in":await Motion.animate(this.image,{opacity:1},{duration:1,delay:this.delay,easing:theme.config.easing}).finished;break}}}customElements.get("animate-image")||customElements.define("animate-image",AnimateImage);class HighlightText extends HTMLElement{constructor(){super(),theme.config.motionReduced}connectedCallback(){theme.config.motionReduced||Motion.inView(this,this.active.bind(this),{margin:"20px 0px 20px 0px"})}disconnectedCallback(){theme.config.motionReduced||this.classList.remove("highlight_text--active")}active(){this.classList.add("highlight_text--active")}}customElements.get("highlight-text")||customElements.define("highlight-text",HighlightText);class FooterParallax extends HTMLElement{constructor(){super(),!theme.config.motionReduced&&(this.mobileDisabled&&(theme.config.isTouch||theme.config.mqlSmall)||this.parallax())}get mobileDisabled(){return!0}parallax(){Motion.scroll(Motion.animate(this,{transform:["translateY(-50%)","translateY(0)"]}),{target:this,offset:Motion.ScrollOffset.Enter})}}customElements.get("footer-parallax")||customElements.define("footer-parallax",FooterParallax);class RTEFormatter extends HTMLElement{connectedCallback(){this.querySelectorAll("table").forEach(this.#formatTable)}#formatTable(table){const wrapper=document.createElement("div");wrapper.classList.add("rte-table-wrapper");const parent=table.parentNode;parent&&(parent.insertBefore(wrapper,table),wrapper.appendChild(table))}}customElements.get("rte-formatter")||customElements.define("rte-formatter",RTEFormatter);class StrokeText extends HTMLElement{constructor(){super(),this._animation=null}connectedCallback(){theme.config.motionReduced||(this.style.backgroundSize="0% 100%",this.style.backgroundRepeat="no-repeat",this.style.transition="none",!theme.config.isTouch&&(this.addEventListener("mouseenter",e=>{this.updatePosition(e),this.play(!0)}),this.addEventListener("mouseleave",e=>{this.updatePosition(e),this.play(!1)}),this.addEventListener("mousemove",theme.utils.rafThrottle(this.updatePosition.bind(this)))))}play(toFull){this._animation&&this._animation.cancel(),this._animation=Motion.animate(this,{backgroundSize:toFull?"100% 100%":"
50% 100%"},{duration:.4,easing:theme.config.easing})}updatePosition(e){const rect=this.getBoundingClientRect(),xPercent=(e.clientX-rect.left)/rect.width*100;this.style.backgroundPosition=`${xPercent}% 50%`}}customElements.get("stroke-text")||customElements.define("stroke-text",StrokeText);class InfiniteScrolling extends HTMLElement{constructor(){super(),this.isLoading=!1,this.currentPage=1,this.hasNextPage=!0,this.productGrid=null,this.isFiltering=!1,this.requestVersion=0,this.loadAbortController=null,this.scrollHandler=theme.utils.rafThrottle(this.handleScroll.bind(this)),this.init()}disconnectedCallback(){this.cancelPendingLoad(),this.intersectionObserver?.disconnect(),window.removeEventListener("scroll",this.scrollHandler),this.scrollHandler.cancel?.()}cancelPendingLoad(){this.requestVersion+=1,this.loadAbortController?.abort(),this.loadAbortController=null,this.isLoading=!1,this.hideLoadingState()}static collectionState(url){const state=new URL(url);return state.searchParams.delete("page"),state.searchParams.sort(),state.hash="",state.toString()}init(){this.productGrid=document.querySelector("#ResultsList .product-grid"),this.productGrid&&(this.currentPage=parseInt(this.productGrid.dataset.currentPage)||1,this.hasNextPage=parseInt(this.productGrid.dataset.totalPages)>this.currentPage,this.bindEvents())}bindEvents(){const infiniteButton=this.querySelector("[data-infinite-scrolling]");infiniteButton&&this.setupIntersectionObserver(infiniteButton),window.addEventListener("scroll",this.scrollHandler)}setupIntersectionObserver(target){const options={root:null,rootMargin:"-100px",threshold:.1};this.intersectionObserver?.disconnect(),this.intersectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting&&!this.isLoading&&this.hasNextPage&&this.loadNextPage()})},options),this.intersectionObserver.observe(target)}handleScroll(){const infiniteButton=this.querySelector("[data-infinite-scrolling]");if(!infiniteButton||this.isFiltering||this.isLoading||!this.hasNextPage)return;const rect=infiniteButton.getBoundingClientRect(),height=rect.height+100;rect.top<=window.innerHeight-height&&this.loadNextPage()}async loadNextPage(){if(!this.isConnected||this.isFiltering||this.isLoading||!this.hasNextPage||!this.productGrid?.isConnected)return;this.isLoading=!0,this.showLoadingState();const requestVersion=++this.requestVersion,controller=new AbortController;this.loadAbortController=controller;const productGrid=this.productGrid,collectionState=InfiniteScrolling.collectionState(window.location.href);try{const nextPage=this.currentPage+1,currentUrl=new URL(window.location.href);currentUrl.searchParams.set("page",nextPage);const response=await fetch(currentUrl.toString(),{signal:controller.signal});if(!response.ok)throw new Error(`Unable to load next page (${response.status})`);const html=await response.text();if(controller.signal.aborted||requestVersion!==this.requestVersion||!this.isConnected||this.isFiltering||!productGrid.isConnected||this.productGrid!==productGrid||document.querySelector("#ResultsList .product-grid")!==productGrid||InfiniteScrolling.collectionState(window.location.href)!==collectionState)return;const doc=new DOMParser().parseFromString(html,"text/html"),newProducts=doc.querySelectorAll("#ResultsList .product-grid .product-grid__item");if(newProducts.length>0&&this.productGrid){newProducts.forEach(product=>{const clonedProduct=product.cloneNode(!0);clonedProduct.dataset.page=nextPage,this.productGrid.appendChild(clonedProduct)}),this.currentPage=nextPage;const pagination=doc.querySelector(".pagination");if(pagination){const nextButton=pagination.querySelector(".pagination__item--next");this.hasNextPage=!!nextButton}else this.hasNextPage=!1;if(this.productGrid.dataset.currentPage=this.currentPage,this.updatePaginationProgress(),window.history.replaceState({...window.history.state,searchParams:currentUrl.search.slice(1)},"",currentUrl.toString()),!this.hasNextPage){const infiniteButton=this.querySelector("[data-infinite-scrolling]");infiniteButton&&(infiniteButton.style.display="none")}this.reinitializeComponents(),this.dispatchProductsLoadedEvent()}else this.hasNextPage=!1}catch(error){if(error.name==="AbortError"||requestVersion!==this.requestVersion)return;console.error("Error loading next page:",error),this.hasNextPage=!1}finally{requestVersion===this.requestVersion&&(this.hideLoadingState(),this.isLoading=!1,this.loadAbortController=null)}}showLoadingState(){const infiniteButton=this.querySelector("[data-infinite-scrolling]"),spinner=infiniteButton?.querySelector(".loading__spinner");infiniteButton&&(infiniteButton.classList.add("loading"),spinner?.classList.remove("hidden"),infiniteButton.disabled=!0),this.productGrid&&this.productGrid.classList.add("loading")}hideLoadingState(){const infiniteButton=this.querySelector("[data-infinite-scrolling]"),spinner=infiniteButton?.querySelector(".loading__spinner"),text=infiniteButton?.querySelector(".text");infiniteButton&&(text&&(text.innerHTML=this.hasNextPage?window.button_load_more.default:window.button_load_more.no_more),infiniteButton.classList.remove("loading"),spinner?.classList.add("hidden"),infiniteButton.disabled=!1),this.productGrid&&this.productGrid.classList.remove("loading")}reinitializeComponents(){window.lazyLoad&&window.lazyLoad.update(),window.animateO
5nScroll&&window.animateOnScroll.init(),this.reinitializeProductCards(),typeof initMoreSwatchButtons=="function"&&initMoreSwatchButtons(this.productGrid||document)}reinitializeProductCards(){this.productGrid.querySelectorAll(`[data-page="${this.currentPage}"]`).forEach(product=>{product.querySelectorAll("[data-quick-add]").forEach(button=>{window.QuickAdd&&window.QuickAdd.initButton(button)})})}dispatchProductsLoadedEvent(){const event2=new CustomEvent("productsLoaded",{detail:{page:this.currentPage,totalPages:parseInt(this.productGrid.dataset.totalPages),hasNextPage:this.hasNextPage}});document.dispatchEvent(event2)}updatePaginationProgress(){const totalStartElement=this.querySelector("[data-total-start]"),totalEndElement=this.querySelector("[data-total-end]"),progressBar=this.querySelector(".pagination-total-item");if(totalStartElement&&totalEndElement&&progressBar){const currentPage=this.currentPage,pageSize=parseInt(this.productGrid.dataset.pageSize)||24,totalItems=parseInt(this.productGrid.dataset.totalItems)||0,newStart=(currentPage-1)*pageSize+1,newEnd=Math.min(currentPage*pageSize,totalItems);totalEndElement.textContent=newEnd;const progressPercentage=newEnd/totalItems*100;progressBar.style.width=`${Math.min(progressPercentage,100)}%`;const progressText=this.querySelector(".pagination-total-progress");progressText&&(progressText.setAttribute("aria-valuenow",newEnd),progressText.setAttribute("aria-valuemax",totalItems)),progressBar.style.transition="width 0.5s ease-in-out",this.animateProgressUpdate(totalStartElement,totalEndElement,newStart,newEnd)}}animateProgressUpdate(startElement,endElement,newStart,newEnd){startElement&&endElement&&(startElement.classList.add("updating"),endElement.classList.add("updating"),setTimeout(()=>{startElement.classList.remove("updating"),endElement.classList.remove("updating")},500))}getProgressInfo(){const currentPage=this.currentPage,pageSize=parseInt(this.productGrid.dataset.pageSize)||24,totalItems=parseInt(this.productGrid.dataset.totalItems)||0;return{currentPage,pageSize,totalItems,currentStart:(currentPage-1)*pageSize+1,currentEnd:Math.min(currentPage*pageSize,totalItems),progressPercentage:Math.min(Math.min(currentPage*pageSize,totalItems)/totalItems*100,100),hasNextPage:this.hasNextPage}}}customElements.get("infinite-scrolling")||customElements.define("infinite-scrolling",InfiniteScrolling),document.addEventListener("toggle",event2=>{if((event2.target instanceof HTMLDialogElement||event2.target instanceof HTMLDetailsElement)&&event2.target.hasAttribute("scroll-lock")){const{open}=event2.target;open?(document.body.classList.add("overflow-hidden"),document.documentElement.setAttribute("scroll-lock","")):(document.body.classList.remove("overflow-hidden"),document.documentElement.removeAttribute("scroll-lock"))}},{capture:!0});function updateClonedProductAttributes(product,count){const form=product.querySelector(".shopify-product-form");if(!form)return;const newFormId=(form.getAttribute("id")||"")+count;form.setAttribute("id",newFormId),product.querySelectorAll('input[type="radio"]').forEach(formInput=>{let formLabel=null;formInput.id&&(formLabel=form.querySelector(`label[for="${formInput.id}"]`)),!formLabel&&formInput.nextElementSibling&&formInput.nextElementSibling.tagName==="LABEL"&&(formLabel=formInput.nextElementSibling);const newId=(formInput.getAttribute("id")||"")+count,formInputName=formInput.getAttribute("name")||"";formLabel&&formLabel.setAttribute("for",newId),formInput.setAttribute("id",newId),formInput.setAttribute("name",formInputName+count)})}Shopify.removeItem=function(variant_id,index,callback){getCartUpdate(index,0,callback)},Shopify.getCart=function(callback){fetch("/cart.js",{method:"GET",credentials:"same-origin"}).then(response=>response.text()).then(data=>{const cart=JSON.parse(data);typeof callback=="function"?callback(cart):Shopify.onCartUpdate(cart)})};function getCartUpdate(line,quantity,callback){const body=JSON.stringify({line,quantity,sections_url:window.location.pathname});fetch(`${routes.cart_change_url}`,{...fetchConfig(),body}).then(response=>response.text()).then(state=>{const parsedState=JSON.parse(state);parsedState.errors||(typeof callback=="function"?callback(parsedState):Shopify.onCartUpdate(parsedState))}).catch(e=>{console.error(e)})}Shopify.onCartUpdate=function(cart){};class FilterFAQs extends HTMLElement{constructor(){super(),this.faqsPopup=document.getElementById("halo-faqs-popup"),this.filterToggle=this.querySelector("[data-faqs-filter]"),this.filterDropdown=this.querySelector(".faqs-filterDropdown-menu"),this.filterDropdownArrow=this.filterToggle?.querySelector("[data-dropdown-arrow]"),this.hasInitializedDropdown=!1,this.init()}init(){this.initDropdownItems(),this.filterToggle&&this.filterToggle.addEventListener("click",this.onClickFilterHandler.bind(this)),this.filterDropdown.querySelector(".text")&&this.filterDropdown.querySelectorAll(".text").forEach(filterButton=>{filterButton.addEventListener("click",this.onClickFilterButtonHandler.bind(this))}),this.querySelector(".faqs")&&this.querySelectorAll(".card-header").forEach(headerButton=>{headerButton.addEventListener("click",this.onClickHeaderButtonHandler.bind(this))}),document.body.classList.contains("template-index")||document.body.addEventListener("click",this.onBodyClickEvent.bind(this))}initDropdownItems(){if(this.hasInitializedDropdown)return;const existingKeys=[...this.filterDropdown.querySelectorAll("li[data-value]")].map(li=>li.getAttribute("data-value")),handles=[...this.querySelectorAll("[data-title-handle]")].map(el=>
5el.getAttribute("data-title-handle")).filter(Boolean);if(JSON.stringify(existingKeys)===JSON.stringify(handles)){this.hasInitializedDropdown=!0;return}handles.forEach(handle=>{if(!existingKeys.includes(handle)){const li=document.createElement("li");li.setAttribute("data-value",handle),li.setAttribute("tabindex","-1"),li.innerHTML=`<span class="text">${handle.replace(/-/g," ")}</span>`,this.filterDropdown.appendChild(li)}}),this.hasInitializedDropdown=!0}onClickFilterHandler(){this.filterDropdown.classList.toggle("is-show"),this.filterDropdownArrow?.classList.toggle("active")}onClickFilterButtonHandler(event2){const btn=event2.target.closest("li");if(!btn||btn.classList.contains("active"))return;const filterValue=btn.getAttribute("data-value"),filterText=event2.target.innerText;this.filterToggle.querySelector(".text").innerText=filterText,this.filterDropdown.querySelectorAll("li").forEach(el=>el.classList.remove("active")),btn.classList.add("active"),filterValue?this.querySelectorAll(".filter-faqs-item").forEach(el=>{el.getAttribute("data-title-handle")===filterValue?(el.classList.remove("hidden"),el.classList.add("active")):(el.classList.remove("active"),el.classList.add("hidden"))}):this.querySelectorAll(".filter-faqs-item").forEach(el=>{el.classList.remove("hidden","active")}),this.filterDropdown.classList.remove("is-show"),this.filterDropdownArrow?.classList.remove("active")}onClickHeaderButtonHandler(event2){const btn=event2.currentTarget,content=btn.nextElementSibling;btn.classList.toggle("collapsed"),content.style.maxHeight?content.style.maxHeight=null:content.style.maxHeight=content.scrollHeight+"px"}onBodyClickEvent(event2){event2.target.closest("[data-faqs-filter]")||this.filterDropdown.classList.contains("is-show")&&(this.filterDropdown.classList.remove("is-show"),this.filterDropdownArrow?.classList.remove("active"))}}customElements.get("filter-faqs")||customElements.define("filter-faqs",FilterFAQs);class TextLoaderComponent extends HTMLElement{spinner(){this.querySelector(".loading__spinner").classList.remove("hidden")}shimmer(){this.setAttribute("shimmer","")}}customElements.get("text-loader-component")||customElements.define("text-loader-component",TextLoaderComponent);function resetSpinner(container=document.body){container.querySelectorAll("text-loader-component").forEach(item=>{const spinner=item.querySelector(".loading__spinner");spinner&&spinner.classList.add("hidden")})}function resetShimmer(container=document.body){container.querySelectorAll("text-loader-component").forEach(item=>{item&&item.removeAttribute("shimmer")})}class SlideshowAnimated extends HTMLElement{constructor(){super(),this.image=this.querySelector("[data-image-trans] img"),this.speed=parseFloat(this.dataset.speed)||.5}connectedCallback(){theme.config.motionReduced||this.initAnimate()}initAnimate(){let n=this.image.offsetHeight-this.offsetHeight,yUp=Math.round(n*this.speed),yDown=Math.round(n*this.speed)*-1,sectionIdex=this.closest(".section")?.dataset.index,offset=["center start","end start"];Motion.scroll(Motion.animate(this.image,{y:[0,yUp]},{easing:"linear"}),{target:this,offset})}}customElements.get("slideshow-animated")||customElements.define("slideshow-animated",SlideshowAnimated);class MarqueeComponent extends HTMLElement{constructor(){super(),this.wrapper=this.querySelector(".marquee__wrapper"),this.content=this.querySelector(".marquee__content"),this.isDesktop=theme.config.mqlDesktop}connectedCallback(){theme.initSectionVisible({element:this,callback:this.init.bind(this),threshold:400})}disconnectedCallback(){this.isDesktop&&(window.removeEventListener("resize",this.#handleResize),this.removeEventListener("pointerleave",this.#speedUp))}init(){this.content.firstElementChild?.children.length!==0&&(this.#addRepeatedItems(),this.#duplicateContent(),this.#setSpeed(),this.isDesktop&&(window.addEventListener("resize",this.#handleResize),this.addEventListener("pointerleave",this.#speedUp)))}#animation=null;#duration=500;#slowDown=theme.utils.debounce(()=>{if(this.#animation)return;const animation=this.wrapper.getAnimations()[0];animation&&(this.#animation=animateValue({duration:this.#duration,from:1,to:0,onUpdate:value=>animation.updatePlaybackRate(value),onComplete:()=>{this.#animation=null}}))},this.#duration);#speedUp(){this.#slowDown.cancel();const animation=this.wrapper.getAnimations()[0];if(!animation||animation.playbackRate===1)return;const from=this.#animation?.current??0;this.#animation?.cancel(),this.#animation=animateValue({duration:this.#duration,from,to:1,onUpdate:value=>animation.updatePlaybackRate(value),onComplete:()=>{this.#animation=null}})}get clonedContent(){const lastChild=this.wrapper.lastElementChild;return this.content!==lastChild?lastChild:null}#setSpeed(value=this.#calculateSpeed()){this.style.setProperty("--marquee-speed",`${value}s`)}#calculateSpeed(){const speedFactor=Number(this.getAttribute("data-speed-factor")),marqueeWidth=this.offsetWidth;return Math.ceil(marqueeWidth/speedFactor/2)}#handleResize=theme.utils.debounce(()=>{const newNumberOfCopies=this.#calculateNumberOfCopies(),currentNumberOfCopies=this.content.children.length;newNumberOfCopies>currentNumberOfCopies?this.#addRepeatedItems(newNumberOfCopies-currentNumberOfCopies):newNumberOfCopies<currentNumberOfCopies&&this.#removeRepeatedItems(currentNumberOfCopies-newNumberOfCopies),this.#duplicateContent(),this.#setSpeed(),this.#restartAnimation()},250);#restartAnimation(){const animations=this.wrapper.getAnimations();requestAnimationFrame(()=>{for(const animation of animations)animation.currentTime=0})}#duplicateContent(){this.clonedContent?.remove();const clone=this.content.cloneNode(!0);clone.setAttribute("aria-hidden","true"),this.wrapper.appendChild(clone)}#addRepeatedItems(numberOfCopies=this.#calculateNumberOfCopies()){if(this.wrapper)for(let i=0;i<numberOfCopies-1;i++){const clone=this.wrapper.querySelector(".marquee__repeated-items").cloneNode(!0);clone.setAttribute("aria-hidden","true"),this.content.appendChild(clone)}}#removeRepeatedItems(numberOfCopies=this.#calculateNumberOfCopies()){for(let i=0;i<numberOfCopies-1;i++)this.content.lastElementChild?.remove()}#calculateNumberOfCopies(){const marqueeWidth=this.offsetWidth,marqueeRepeatedItemWidth=this.content.firstElementChild instanceof HTMLElement?this.content.firstElementChild.offsetWidth:1;return(marqueeRepeatedItemWidth===0?1:Math.ceil(marqueeWidth/marqueeRepeatedItemWidth))+1}}customElements.get("marquee-component")||customElements.define("marquee-component",MarqueeComponent);class MarqueeScroll extends HTMLElement{constructor(){super(),this.speed=parseFloat(this.dataset.speed||1.6),this.space=100,this.isDesktop=theme.config.mqlDesktop,this.isDesktop&&Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}connectedCallback(){this.isDesktop&&this.#toggleHoverEvents(!0)}disconnectedCallback(){this.isDesktop&&this.#toggleHoverEvents(!1)}get childElement(){return this.firstElementChild}get maximum(){return parseInt(this.dataset.maximum||10)}get direction(){return this.dataset.direction||"left"}get parallax(){return this.dataset.parallax?parseFloat(this.dataset.parallax):!1}init(){if(this.parallax&&this.isDesktop){let translate=this.parallax*100/(1+this.parallax);this.direction==="right"&&(translate=translate*-1),Motion.scroll(Motion.animate(this,{transform:[`translateX(${translate}%)`,"translateX(0px)"]},{ease:"linear"}),{target:this,offset:["start end","end start"]});return}new IntersectionObserver((entries,_observer)=>
5{entries.forEach(entry=>{entry.isIntersecting?this.classList.remove("paused"):this.classList.add("paused")})},{rootMargin:"0px 0px 50px 0px"}).observe(this)}#toggleHoverEvents(enable){this[enable?"addEventListener":"removeEventListener"]("pointerleave",this.#speedUp)}#animation=null;#duration=500;#slowDown=theme.utils.debounce(()=>{if(this.#animation)return;const animation=this.querySelector(".marquee__content").getAnimations()[0];animation&&(this.#animation=animateValue({duration:this.#duration,from:1,to:0,onUpdate:value=>animation.updatePlaybackRate(value),onComplete:()=>{this.#animation=null}}))},this.#duration);#speedUp(){this.#slowDown.cancel();const animation=this.querySelector(".marquee__content").getAnimations()[0];if(!animation||animation.playbackRate===1)return;const from=this.#animation?.current??0;this.#animation?.cancel(),this.#animation=animateValue({duration:this.#duration,from,to:1,onUpdate:value=>animation.updatePlaybackRate(value),onComplete:()=>{this.#animation=null}})}}customElements.get("marquee-scroll")||customElements.define("marquee-scroll",MarqueeScroll);function animateValue({from,to,duration,onUpdate,easing=t=>t*t*(3-2*t),onComplete}){const startTime=performance.now();let cancelled=!1,currentValue=from;function animate(currentTime){if(cancelled)return;const elapsed=currentTime-startTime,progress=Math.min(elapsed/duration,1),easedProgress=easing(progress);currentValue=from+(to-from)*easedProgress,onUpdate(currentValue),progress<1?requestAnimationFrame(animate):typeof onComplete=="function"&&onComplete()}return requestAnimationFrame(animate),{get current(){return currentValue},cancel(){cancelled=!0}}}if(window.dynamicBrowserTitle&&window.dynamicBrowserTitle.show&&typeof window.dynamicBrowserTitle.text=="string"&&window.dynamicBrowserTitle.text.trim()!==""){const originalTitle=document.title,customTitle=window.dynamicBrowserTitle.text;window.addEventListener("blur",function(){document.title=customTitle}),window.addEventListener("focus",function(){document.title=originalTitle})}class AccordionCustom extends HTMLElement{get details(){const details=this.querySelector("details");if(!(details instanceof HTMLDetailsElement))throw new Error("Details element not found");return details}get summary(){const summary=this.details.querySelector("summary");if(!(summary instanceof HTMLElement))throw new Error("Summary element not found");return summary}get contentElement(){const content=this.details.querySelector(".details-content");if(!(content instanceof HTMLElement))throw new Error("Content element not found");return content}get summaryElement(){return this.summary}get#disableOnMobile(){return this.dataset.disableOnMobile==="true"}get#disableOnDesktop(){return this.dataset.disableOnDesktop==="true"}get#closeWithEscape(){return this.dataset.closeWithEscape==="true"}async transition(value){value?(this.details.setAttribute("open",""),await Motion.timeline([[this.details,{height:this.contentElement.classList.contains("floating-panel-component")?`${this.summaryElement.clientHeight}px`:[`${this.summaryElement.clientHeight}px`,`${this.summaryElement.clientHeight+this.contentElement.scrollHeight}px`]},{duration:.25,easing:"ease"}],[this.contentElement,{opacity:[0,1],height:[0,`${this.contentElement.scrollHeight}px`],transform:["translateY(10px)","translateY(0)"]},{duration:.15,at:"-0.1"}]]).finished):(this.summary.focus(),await Motion.timeline([[this.contentElement,{opacity:0,height:0},{duration:.15}],[this.details,{height:[`${this.details.clientHeight}px`,`${this.summaryElement.clientHeight}px`]},{duration:.25,at:"<",easing:"ease"}]]).finished,this.details.removeAttribute("open"))}#controller=new AbortController;connectedCallback(){const{signal}=this.#controller;this.#setDefaultOpenState(),this.addEventListener("keydown",this.#handleKeyDown,{signal}),this.summary.addEventListener("click",this.handleClick,{signal}),window.matchMedia(theme.config.mql).addEventListener("change",this.#handleMediaQueryChange,{signal})}disconnectedCallback(){this.#controller.abort()}handleClick=async event2=>{const isMobile=window.matchMedia(theme.config.mqlMobile).matches,isDesktop=!isMobile;if(isMobile&&this.#disableOnMobile||isDesktop&&this.#disableOnDesktop){event2.preventDefault();return}event2.preventDefault();const isOpen=this.details.hasAttribute("open");await this.transition(!isOpen)};#handleMediaQueryChange=()=>{this.#setDefaultOpenState()};#setDefaultOpenState(){const isMobile=window.matchMedia(theme.config.mqlMobile).matches;this.details.open=isMobile&&this.hasAttribute("open-by-default-on-mobile")||!isMobile&&this.hasAttribute("open-by-default-on-desktop")}#handleKeyDown=async event2=>{event2.key==="Escape"&&this.#closeWithEscape&&(event2.preventDefault(),await this.transition(!1),this.summary.focus())}}customElements.get("accordion-custom")||customElements.define("accordion-custom",AccordionCustom);
5class VideoBackgroundComponent extends HTMLElement{requiredRefs=["videoSources","videoElement"];constructor(){super()}connectedCallback(){theme.initSectionVisible({element:this,callback:this.loadVideo.bind(this),threshold:400})}loadVideo(){if(this._hasLoadedVideo)return;this._hasLoadedVideo=!0;const videoElement=this.querySelector("video");if(!videoElement)return;const videoSources=this.querySelectorAll("[data-video]");for(let i=0;i<videoSources.length;i++){const source=videoSources[i],videoSource=source.dataset.videoSource;videoSource&&source.setAttribute("src",videoSource)}videoElement.load()}}customElements.get("video-background-component")||customElements.define("video-background-component",VideoBackgroundComponent);class VideoCarousel extends HTMLElement{constructor(){super(),this.inView=!1}connectedCallback(){this.querySelector(".video-item deferred-media")&&(this.swiperComponent=this.querySelector("swiper-component"),this.bindPosterControls(),this.observeVisibility(),this.observeActiveSlide())}getDeferredMedias(){return Array.from(this.querySelectorAll(".video-item deferred-media.video-section__media"))}observeVisibility(){new IntersectionObserver(entries=>{this.inView=entries.some(entry=>entry.isIntersecting),this.syncPlayback()},{threshold:.3}).observe(this)}observeActiveSlide(){const wrapper=this.querySelector(".swiper-wrapper");wrapper&&(this.activeObserver=new MutationObserver(()=>this.syncPlayback()),this.activeObserver.observe(wrapper,{attributes:!0,attributeFilter:["class"],subtree:!0}))}getActiveItem(){return this.querySelector(".video-item.swiper-slide-active")||this.querySelector(".video-item")}pauseAllExcept(activeItem){this.getDeferredMedias().forEach(deferredMedia=>{const item=deferredMedia.closest(".video-item");!item||item===activeItem||typeof deferredMedia.pauseMedia=="function"&&deferredMedia.pauseMedia()})}playActive(activeItem){if(!activeItem||!this.inView)return;const deferredMedia=activeItem.querySelector("deferred-media.video-section__media");deferredMedia&&(typeof deferredMedia.loadContent=="function"&&deferredMedia.loadContent(!1),!deferredMedia.isPlaying&&typeof deferredMedia.playMedia=="function"&&deferredMedia.playMedia())}syncPlayback(){const activeItem=this.getActiveItem();if(!this.inView){this.pauseAllExcept(null);return}this.pauseAllExcept(activeItem),this.playActive(activeItem)}bindPosterControls(){this.addEventListener("click",event2=>{const posterButton=event2.target.closest(".deferred-media__poster-button");if(!posterButton)return;const item=posterButton.closest(".video-item");if(!item)return;const isActive=item.classList.contains("swiper-slide-active"),swiper=this.swiperComponent&&this.swiperComponent.initSwiper;if(!isActive&&swiper){event2.preventDefault(),event2.stopPropagation();const realIndexAttr=item.getAttribute("data-swiper-slide-index"),targetIndex=Number(realIndexAttr);Number.isNaN(targetIndex)||(typeof swiper.slideToLoop=="function"?swiper.slideToLoop(targetIndex):swiper.slideTo(targetIndex));return}requestAnimationFrame(()=>this.syncPlayback())})}}customElements.get("video-carousel")||customElements.define("video-carousel",VideoCarousel);class TabsComponent extends HTMLElement{constructor(){super()}connectedCallback(){this.init(),this.observeExternalHeader(),this.initTabsHeader()}init(){this.tabs=this.querySelectorAll(".tabs-component-panel-trigger"),this.tabContents=this.querySelectorAll(".tabs-component-content"),this.initRender(),this.tabs.forEac
5h(tab=>{tab.addEventListener("click",this.handleTabClick.bind(this))})}handleTabClick(event2){event2.preventDefault();let target=event2.target.closest(".tabs-component-panel-trigger");if(!target)return;let tabId=target.getAttribute("href");tabId&&(target.classList.contains("--active")||(this.tabs.forEach(tab=>tab.classList.remove("--active")),target.classList.add("--active"),this.tabContents.forEach(content=>{if(content.classList.remove("--active"),content.id==tabId.substring(1)){const template=content.querySelector("template.tabs-component-template");if(template&&!content.hasAttribute("data-rendered")){const templateContent=template.content.cloneNode(!0);content.appendChild(templateContent),content.setAttribute("data-rendered","true")}content.classList.add("--active")}})))}initRender(){const activeTab=this.querySelector(".tabs-component-panel-trigger.--active");if(activeTab){const activeTabId=activeTab.getAttribute("href"),activeContent=document.querySelector(activeTabId);if(activeContent){const template=activeContent.querySelector("template.tabs-component-template");if(template&&!activeContent.hasAttribute("data-rendered")){const templateContent=template.content.cloneNode(!0);activeContent.appendChild(templateContent),activeContent.setAttribute("data-rendered","true")}}}this.hasInitialized=!0}observeExternalHeader(){const allHeaders=document.querySelectorAll("tabs-header");allHeaders.length&&allHeaders.forEach(header=>{const targetSelector=header.getAttribute("data-tabs-target");if((targetSelector&&document.querySelector(targetSelector)||this)===this){const headerButtons=header.querySelectorAll(".tabs-component-panel-trigger");headerButtons.forEach(btn=>{btn.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();const href=btn.getAttribute("href");if(!href)return;headerButtons.forEach(b=>b.classList.remove("--active")),btn.classList.add("--active");const internalTab=this.querySelector(`.tabs-component-panel-trigger[href="${href}"]`);internalTab&&internalTab.click()})})}})}initTabsHeader(){document.querySelectorAll(".section-global__header").forEach(header=>{const template=header.querySelector("template");if(!template)return;const tabsHeader=template.content.querySelector("tabs-header");if(!tabsHeader)return;const block=header.querySelector(".section-header--block");if(block&&!block.querySelector("tabs-header")){const clone=tabsHeader.cloneNode(!0);block.appendChild(clone),this.bindTabsEvents(clone)}})}bindTabsEvents(tabsHeader){const buttons=tabsHeader.querySelectorAll(".tabs-component-panel-trigger"),tabContents=document.querySelectorAll(".tabs-component-content");buttons.forEach(btn=>{btn.addEventListener("click",e=>{e.preventDefault();const href=btn.getAttribute("href");if(!href)return;const targetId=href.replace("#","");buttons.forEach(b=>b.classList.remove("--active","is-active")),btn.classList.add("--active","is-active"),tabContents.forEach(content=>{const isMatch=content.id===targetId;if(content.classList.toggle("--active",isMatch),content.classList.toggle("is-active",isMatch),isMatch&&!content.hasAttribute("data-rendered")){const template=content.querySelector("template.tabs-component-template");if(template){const templateContent=template.content.cloneNode(!0);content.appendChild(templateContent),content.setAttribute("data-rendered","true")}}}),document.querySelectorAll(`.tabs-component-panel-trigger[href="${href}"]`).forEach(tab=>{tab.classList.remove("--active"),tab.getAttribute("href")===href&&tab.classList.add("--active")})})})}}customElements.get("tabs-component")||customElements.define("tabs-component",TabsComponent);class HeaderMobileTabs extends HTMLElement{constructor(){super()}connectedCallback(){this.init()}init(){this.tabs=this.querySelectorAll("[data-tab-heading]"),this.tabContents=this.querySelectorAll("[data-tab-for]"),this.tabs.forEac
5h(tab=>{tab.addEventListener("click",this.handleTabClick.bind(this))}),this.tabContents[0].classList.add("active")}handleTabClick(event2){event2.preventDefault();let target=event2.target.closest("a"),tabTarget=target.getAttribute("data-tab-heading-target");target.classList.contains("active")||(this.tabs.forEach(tab=>tab.classList.remove("active")),target.classList.add("active"),this.tabContents.forEach(content=>{content.style.display="none",content.getAttribute("data-tab-for")==tabTarget&&(content.style.display="block")}))}}customElements.get("header-mobile-tabs")||customElements.define("header-mobile-tabs",HeaderMobileTabs);class HoverButton extends HTMLElement{constructor(){super()}connectedCallback(){this.addEventListener("mouseenter",this.onMouseEnter),this.addEventListener("mouseleave",this.onMouseLeave)}disconnectedCallback(){this.removeEventListener("mouseenter",this.onMouseEnter),this.removeEventListener("mouseleave",this.onMouseLeave)}onMouseEnter(){const btnFill=event.currentTarget.querySelector("[data-fill-bg]"),dir=this.classList.contains("swiper-button-prev")?"left":"right";btnFill&&Motion.animate(btnFill,{x:dir==="left"?["100%","0%"]:["-100%","0%"]},{duration:.35})}onMouseLeave(){const btnFill=event.currentTarget.querySelector("[data-fill-bg]"),dir=this.classList.contains("swiper-button-prev")?"left":"right";btnFill&&Motion.animate(btnFill,{x:dir==="left"?["-100%"]:["100%"]},{duration:.35})}}customElements.get("hover-button")||customElements.define("hover-button",HoverButton);class CollapsibleText extends HTMLElement{constructor(){super()}connectedCallback(){this.init()}init(){if(this.fullText=this.querySelector("[data-content-full]"),this.previewText=this.querySelector("[data-content-preview]"),this.buttonMore=this.querySelector("[data-collapse-button-more]"),this.buttonLess=this.querySelector("[data-collapse-button-less]"),this.heightFullText=this.fullText.offsetHeight,this.fullTextContent=this.fullText.innerHTML,this.heightPreviewText=this.previewText.scrollHeight,this.previewTextContent=this.previewText.innerHTML,this.heightPreviewText<=this.heightFullText)this.classList.add("is-collapsed"),this.previewText.dataset.contenMinHeight=this.heightPreviewText,this.previewText.dataset.contentMaxHeight=this.heightFullText,this.buttonMore.addEventListener("click",this.showMore.bind(this)),this.buttonLess.addEventListener("click",this.showLess.bind(this));else{this.classList.remove("is-collapsed");return}}showMore(){const heightFrom=this.previewText.dataset.contenMinHeight+"px",heightTo=this.previewText.dataset.contentMaxHeight+"px";this.previewText.innerHTML=this.fullTextContent,Motion.animate(this.previewText,{height:[heightFrom,heightTo],minHeight:[heightFrom,heightTo]},{duration:.35}),this.classList.add("is-expanded"),this.classList.remove("is-collapsed")}showLess(){const heightFrom=this.fullText.dataset.contentMaxHeight+"px",heightTo=this.previewText.dataset.contenMinHeight+"px";this.classList.remove("is-expanded"),this.classList.add("is-collapsed"),this.previewText.innerHTML=this.previewTextContent,Motion.animate(this.previewText,{height:[heightFrom,heightTo],minHeight:heightTo},{duration:.35})}}customElements.get("collapsible-text")||customElements.define("collapsible-text",CollapsibleText);function initPurchaseConditions(scope=document){scope.querySelectorAll("[data-purchase-conditions]").forEach(wrapper=>{const checkbox=wrapper.querySelector('[id^="agree_condition-"]');if(!checkbox)return;const checkoutButtons=wrapper.querySelectorAll('button[name="checkout"]'),dynamicCheckout=wrapper.querySelector(".cart__dynamic-checkout-buttons"),checkoutButtonsList=[...checkoutButtons],getForm=()=>{const formId=checkoutButtonsList[0]?.getAttribute("form");return formId?document.getElementById(formId):wrapper.closest("form")},isCartEmpty=()=>!!wrapper.closest("cart-drawer.is-empty, cart-drawer-items.is-empty, cart-items-component.is-empty, .cart-items-component.is-empty"),setCheckoutEnabled=enabled=>{if(isCartEmpty()){checkoutButtonsList.forEach(button=>{button.disabled=!0}),dynamicCheckout?.classList.add("disabled");return}checkoutButtonsList.forEach(button=>{button.disabled=!enabled}),dynamicCheckout?.classList.toggle("disabled",!enabled)},sync=()=>setCheckoutEnabled(checkbox.checked);wrapper.dataset.purchaseConditionsInit!=="true"&&(wrapper.dataset.purchaseConditionsInit="true",checkbox.addEventListener("change",sync),getForm()?.addEventListener("submit",event2=>{checkbox.checked||event2.preventDefault()})),sync()})}document.addEventListener("DOMContentLoaded",()=>initPurchaseConditions()),typeof subscribe=="function"&&subscribe(PUB_SUB_EVENTS.cartUpdate,()=>initPurchaseConditions());class EmailSignup extends HTMLElement{constructor(){super(),this._handleOutsideClick=this._handleOutsideClick.bind(this)}connectedCallback(){this.form=this.querySelector('[id^="EmailSignup-"]'),this.checkbox=this.form?.querySelector('[id^="agree_condition-"]'),this.submitButton=this.form?.querySelector("button[id^='EmailSignup-submit-']"),this.subscriptionForm=this.querySelector(".subscription-form"),this.emailForm=this.querySelector(".email-signup__form"),this.promoBtn=this.querySelector(".promo-btn"),this.openNewsletterPopupButton=this.querySelector(".open-newsletter-popup-button"),this.initAgreeCondition(),this.initPromoToggle(
5),this.openNewsletterPopup(),window.location.search.includes("contact_posted=true")&&this.showEmailForm(!0)}initAgreeCondition(){!this.checkbox||!this.submitButton||(this.submitButton.disabled=!0,this.checkbox.addEventListener("change",()=>{this.submitButton.disabled=!this.checkbox.checked}),this.form.addEventListener("submit",e=>{this.checkbox.checked||(e.preventDefault(),alert("Please agree to the terms and conditions before submitting."))}))}initPromoToggle(){!this.subscriptionForm||!this.emailForm||!this.promoBtn||(this.emailForm.style.display="none",this.promoBtn.addEventListener("click",()=>this.showEmailForm()))}openNewsletterPopup(){this.openNewsletterPopupButton&&this.openNewsletterPopupButton.addEventListener("click",e=>{e.preventDefault();const popup=document.querySelector(".promotionPopup");popup&&popup.setAttribute("open","");const content=document.querySelector(".promotionPopup .popup__inner");Motion.timeline([[content,{opacity:[0,1],transform:["translate(-50%, -40%)","translate(-50%, -50%)"]},{duration:.3,at:"-0.15"}]]).finished})}async showEmailForm(skipHideAnim=!1){skipHideAnim||await this._animateHide(this.subscriptionForm),this.subscriptionForm.style.display="none",this.emailForm.style.display="",await this._animateShow(this.emailForm),document.addEventListener("click",this._handleOutsideClick)}async showSubscriptionForm(){await this._animateHide(this.emailForm),this.emailForm.style.display="none",this.subscriptionForm.style.display="",await this._animateShow(this.subscriptionForm),document.removeEventListener("click",this._handleOutsideClick)}_handleOutsideClick(e){this.contains(e.target)||this.showSubscriptionForm()}async _animateShow(element){element.style.overflow="hidden",await Motion.timeline([[element,{height:["0px",`${element.scrollHeight}px`]},{duration:.15,easing:"cubic-bezier(0.7, 0, 0.3, 1)"}],[element,{opacity:[0,1],transform:["translateX(-1rem)","translateX(0)"]},{duration:.15,at:"-0.1"}]]).finished,element.style.height="auto",element.style.overflow="visible"}async _animateHide(element){element.style.overflow="hidden",await Motion.timeline([[element,{opacity:0,transform:["translateX(0)","translateX(1rem)"]},{duration:.15}],[element,{height:[`${element.clientHeight}px`,"0px"]},{duration:.15,at:"<",easing:"cubic-bezier(0.7, 0, 0.3, 1)"}]]).finished,element.style.height="auto",element.style.overflow="visible"}}customElements.get("email-signup")||customElements.define("email-signup",EmailSignup);class CollapsibleTextComponent extends HTMLElement{constructor(){super()}connectedCallback(){this.content=this.querySelector(".collapsible-text-content"),this.button=this.querySelector(".collapsible-text-button-wrapper"),this.buttonText=this.button.querySelector("button"),!(!this.button||!this.content)&&(this.showText=this.buttonText.getAttribute("data-show-text"),this.hideText=this.buttonText.getAttribute("data-hide-text"),this.isExpanded=!1,this.checkIfButtonNeeded(),this.setupEventListeners())}checkIfButtonNeeded(){const contentHeight=this.content.scrollHeight,previewHeight=this.content.getAttribute("data-content-height");contentHeight<=previewHeight&&(this.button.style.display="none",this.content.classList.remove("collapsed"))}setupEventListeners(){this.button.addEventListener("click",()=>{this.toggleContent()})}toggleContent(){this.isExpanded=!this.isExpanded,this.isExpanded?(this.content.classList.remove("collapsed"),this.content.classList.add("expanded"),this.buttonText.textContent=this.hideText,this.button.setAttribute("aria-expanded","true")):(this.content.classList.remove("expanded"),this.content.classList.add("collapsed"),this.buttonText.textContent=this.showText,this.button.setAttribute("aria-expanded","false"))}}customElements.get("collapsible-text-component")||customElements.define("collapsible-text-component",CollapsibleTextComponent);class JumboText extends HTMLElement{#initObserver;#resizeObserver;intersectionObserver;connectedCallback(){this.#initObserver=new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{entry.isIntersecting&&(this.#init(),observer.unobserve(entry.target))})},{rootMargin:"500px 0px 500px 0px"}),this.#initObserver.observe(this)}disconnectedCallback(){this.#initObserver?.disconnect(),this.#resizeObserver?.disconnect(),this.intersectionObserver?.disconnect()}#init=()=>{this.#resizeObserver=new ResizeNotifier(this.#handleResize),requestAnimationFrame(this.#handleResize),this.dataset.textEffe
5ct&&this.dataset.textEffect!=="none"&&!prefersReducedMotion()&&this.#setIntersectionObserver()};#setIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting?(this.classList.add("jumbo-text-visible"),this.dataset.animationRepeat==="false"&&this.intersectionObserver.unobserve(entry.target)):this.classList.remove("jumbo-text-visible")})},{threshold:.3}),this.intersectionObserver.observe(this)}#calculateOptimalFontSize=()=>{if(!this.textContent?.trim()||(this.classList.remove("ready"),this.offsetWidth<=0))return;this.#resizeObserver?.disconnect(),this.style.fontSize="1px";const fontSize=findOptimalFontSize(this,this.offsetWidth);this.style.fontSize=`${fontSize}px`,this.#resizeObserver?.observe(this),this.classList.add("ready")};#handleResize=()=>{this.#calculateOptimalFontSize()}}class ResizeNotifier extends ResizeObserver{#initialized=!1;constructor(callback){super(entries=>{if(this.#initialized)return callback(entries,this);this.#initialized=!0})}disconnect(){this.#initialized=!1,super.disconnect()}}function checkTextOverflow(element,containerWidth,size){return element.style.fontSize=`${size}px`,element.scrollWidth>containerWidth}function findOptimalFontSize(element,containerWidth){let minSize=1,maxSize=500;const precision=.5,textLength=element.textContent?.length||0;let fontSize=Math.min(maxSize,Math.sqrt(containerWidth)*(15/Math.sqrt(Math.max(1,textLength))));checkTextOverflow(element,containerWidth,fontSize)?maxSize=fontSize:minSize=fontSize;let iterations=0;const MAX_ITERATIONS=30;for(;maxSize-minSize>precision&&iterations<MAX_ITERATIONS;)fontSize=(minSize+maxSize)/2,checkTextOverflow(element,containerWidth,fontSize)?maxSize=fontSize:minSize=fontSize,iterations++;return minSize*.99}customElements.get("jumbo-text")||customElements.define("jumbo-text",JumboText),(function(){let PhotoSwipeLightbox=null,pswpIsLoading=!1,lightbox=null;document.addEventListener("click",event2=>{const trigger=event2.target.closest('[data-photoswipe="true"]');if(!trigger||(event2.preventDefault(),pswpIsLoading))return;const openPhotoSwipe=()=>{const galleryId=trigger.dataset.gallery,elements=Array.from(document.querySelectorAll(`[data-gallery="${galleryId}"]`)),index=elements.indexOf(trigger),items=elements.map(el=>({src:el.href,width:parseInt(el.dataset.pswpWidth,10)||1200,height:parseInt(el.dataset.pswpHeight,10)||1200,element:el}));lightbox&&lightbox.destroy(),lightbox=new PhotoSwipeLightbox({dataSource:items,pswpModule:()=>import(window.photoswipeUrls?.coreJs||"/assets/lib-photoswipe.js"),wheelToZoom:!0,maxZoomLevel:2,secondaryZoomLevel:1.5,initialZoomLevel:"fit"}),lightbox.init(),lightbox.loadAndOpen(index>-1?index:0)};if(PhotoSwipeLightbox)openPhotoSwipe();else{if(pswpIsLoading=!0,trigger.style.pointerEvents="none",!document.getElementById("photoswipe-css")){const link=document.createElement("link");link.id="photoswipe-css",link.rel="stylesheet",link.href=window.photoswipeUrls?.css||"/assets/lib-photoswipe.css",document.head.appendChild(link)}import(window.photoswipeUrls?.lightboxJs||"/assets/lib-photoswipe-lightbox.js").then(module=>{PhotoSwipeLightbox=module.default,pswpIsLoading=!1,trigger.style.pointerEvents="",openPhotoSwipe()}).catch(err=>{console.error("Failed to load PhotoSwipe",err),pswpIsLoading=!1,trigger.style.pointerEvents=""})}})})(),(()=>{const componentName="product-form-component";if(customElements.get(componentName))return;const script=document.currentScript||document.querySelector('script[src*="/global.js"]'),url=script?.dataset.productFormUrl||(script?.src?new URL("product-form.js",script.src).href:null);let initialScript=document.querySelector('script[src*="/product-form.js"]'),loading=null;const failedScripts=new WeakSet,stop=()=>{observer.disconnect(),document.removeEventListener("pointerdown",retry),document.removeEventListener("keydown",retry)},load=()=>{if(customElements.get(componentName))return stop(),Promise.resolve(customElements.get(componentName));if(loading)return loading;if(!url)return Promise.reject(new Error("Product form asset URL unavailable"));const existing=initialScript||[...document.head.querySelectorAll("script[src]")].find(asset2=>asset2.src===url&&!failedScripts.has(asset2)),asset=existing&&!failedScripts.has(existing)?existing:document.createElement("script"),owned=asset!==existing;return loading=new Promise((resolve,reject)=>{let deadline;const finish=error=>{clearTimeout(deadline),asset.removeEventListener("load",onLoad),asset.removeEventListener("error",onError),error?(failedScripts.add(asset),asset===initialScript&&(initialScript=null),owned&&asset.remove(),reject(error)):(stop(),resolve(customElements.get(componentName)))},onLoad=()=>finish(customElements.get(componentName)?null:new Error("Product form asset did not initialize")),onError=()=>finish(new Error("Product form asset failed to load"));asset.addEventListener("load",onLoad),asset.addEventListener("error",onError),deadline=setTimeout(()=>finish(new Error("Product form asset request timed out")),15e3),owned&&(asset.src=url,asset.async=!1,document.head.appendChild(asset))}).catch(error=>(console.warn("Product form unavailable",error),null)).finally(()=>{loading=null}),loading},retry=event2=>{event2.target.closest?.(componentName)&&load()},observer=new MutationObserver(records=>{if(customElements.get(componentName))return stop();for(const record of records)for(const node of record.addedNodes)if(node.nodeType===1&&(node.matches(componentName)||node.querySelector(componentName))){load();return}});theme.loadProductFormLibrary=load,customElements.whenDefined(componentName).then(stop),document.addEventListener("pointerdown",retry),document.addEventListener("keydown",retry),document.body&&observer.observe(document.body,{childList:!0,subtree:!0}),document.querySelector(componentName)&&load()})(); 6//# sourceMappingURL=/cdn/shop/t/153/assets/global.js.map?v=88228778035567995771790897714
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.