1/* 2@license 3 Concept by RoarTheme (https://roartheme.co) 4 Access unminified JS in assets/theme.js 5 6 Use this event listener to run your own JS outside of this file. 7 Documentation - https://roartheme.co/blogs/concept/javascript-events-for-developers 8 9 document.addEventListener('page:loaded', function() { 10 // Page has loaded and theme assets are ready 11 }); 12*/window.theme=window.theme||{},window.Shopify=window.Shopify||{},theme.config={hasSessionStorage:!0,hasLocalStorage:!0,mqlSmall:!1,mediaQuerySmall:"screen and (max-width: 767px)",motionReduced:window.matchMedia("(prefers-reduced-motion: reduce)").matches,isTouch:"ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0,rtl:document.documentElement.getAttribute("dir")==="rtl"},theme.supportsPassive=!1;try{const opts=Object.defineProperty({},"passive",{get:function(){theme.supportsPassive=!0}});window.addEventListener("testPassive",null,opts),window.removeEventListener("testPassive",null,opts)}catch{}document.documentElement.classList.add(theme.config.isTouch?"touch":"no-touch"),console.log(theme.settings.themeName+" theme ("+theme.settings.themeVersion+") by RoarTheme | Learn more at https://roartheme.co"),(function(){theme.DOMready=function(callback){document.readyState!="loading"?callback():document.addEventListener("DOMContentLoaded",callback)},theme.headerGroup={rounded:()=>Array.from(document.querySelectorAll(".shopify-section-group-header-group .section--rounded")),sections:()=>Array.from(document.querySelectorAll(".shopify-section-group-header-group")),init:()=>{let previousSection=null;const rounded=theme.headerGroup.rounded(),sections=theme.headerGroup.sections();sections.forEach((shopifySection,index)=>{const section=shopifySection.querySelector(".section");if(section){if(section.classList.remove("section--next-rounded"),section.classList.remove("section--first-rounded"),section.classList.remove("section--last-rounded"),section.classList.contains("section--rounded")&&(index===0&§ion.classList.add("section--first-rounded"),index===rounded.length-1&§ion.classList.add("section--last-rounded"),previousSection&&previousSection.classList.contains("section--rounded")&&previousSection.classList.add("section--next-rounded")),index===sections.length-1){const nextSection=document.querySelector(".main-content .shopify-section:first-child .section");nextSection&&nextSection.classList.contains("section--rounded")&§ion.classList.add("section--next-rounded")}previousSection=section}})}},theme.a11y={trapFocusHandlers:{},getFocusableElements:container=>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')),trapFocus:(container,elementToFocus=container)=>{const elements=theme.a11y.getFocusableElements(container),first=elements[0],last=elements[elements.length-1];theme.a11y.removeTrapFocus(),theme.a11y.trapFocusHandlers.focusin=event=>{event.target!==container&&event.target!==last&&event.target!==first||document.addEventListener("keydown",theme.a11y.trapFocusHandlers.keydown)},theme.a11y.trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",theme.a11y.trapFocusHandlers.keydown)},theme.a11y.trapFocusHandlers.keydown=function(event){event.code.toUpperCase()==="TAB"&&(event.target===last&&!event.shiftKey&&(event.preventDefault(),first.focus()),(event.target===container||event.target===first)&&event.shiftKey&&(event.preventDefault(),last.focus()))},document.addEventListener("focusout",theme.a11y.trapFocusHandlers.focusout),document.addEventListener("focusin",theme.a11y.trapFocusHandlers.focusin),elementToFocus.focus(),elementToFocus.tagName==="INPUT"&&["search","text","email","url"].includes(elementToFocus.type)&&elementToFocus.value&&elementToFocus.setSelectionRange(0,elementToFocus.value.length)},removeTrapFocus:(elementToFocus=null)=>{document.removeEventListener("focusin",theme.a11y.trapFocusHandlers.focusin),document.removeEventListener("focusout",theme.a11y.trapFocusHandlers.focusout),document.removeEventListener("keydown",theme.a11y.trapFocusHandlers.keydown),elementToFocus&&typeof elementToFocus.focus=="function"&&elementToFocus.focus()}},theme.utils={throttle: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},debounce:(fn,wait)=>{let timer;return(...args)=>{clearTimeout(timer),timer=setTimeout(()=>fn.apply(this,args),wait)}},waitForEvent:(element,eventName)=>new Promise(resolve=>{const done=event=>{event.target===element&&(element.removeEventListener(eventName,done),resolve(event))};element.addEventListener(eventName,done)}),fetchConfig:(type="json")=>({method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}),postLink:(path,options)=>{options=options||{};const method=options.method||"post",params=options.parameters||{},form=document.createElement("form");form.setAttribute("method",method),form.setAttribute("action",path);for(const key in params){const 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)},sectionId:element=>element.hasAttribute("data-section-id")?element.dataset.sectionId:(element=element.classList.contains("shopify-section")?element:element.closest(".shopify-section"),element.i
12d.replace("shopify-section-","")),imageLoaded:imageOrArray=>imageOrArray?(imageOrArray=imageOrArray instanceof Element?[imageOrArray]:Array.from(imageOrArray),Promise.all(imageOrArray.map(image=>new Promise(resolve=>{image.tagName==="IMG"&&image.complete||!image.offsetParent?resolve():image.onload=()=>resolve()})))):Promise.resolve(),visibleMedia:media=>Array.from(media).find(item=>window.getComputedStyle(item).display!=="none"),setScrollbarWidth:()=>{const scrollbarWidth=window.innerWidth-document.body.clientWidth;scrollbarWidth>0&&document.documentElement.style.setProperty("--scrollbar-width",`${scrollbarWidth}px`)}},theme.pubsub={PUB_SUB_EVENTS:{cartUpdate:"cartUpdate",quantityUpdate:"quantityUpdate",variantChange:"variantChange",cartError:"cartError",facetUpdate:"facetUpdate"},subscribers:{},subscribe:(eventName,callback)=>(theme.pubsub.subscribers[eventName]===void 0&&(theme.pubsub.subscribers[eventName]=[]),theme.pubsub.subscribers[eventName]=[...theme.pubsub.subscribers[eventName],callback],function(){theme.pubsub.subscribers[eventName]=theme.pubsub.subscribers[eventName].filter(cb=>cb!==callback)}),publish:(eventName,data)=>{theme.pubsub.subscribers[eventName]&&theme.pubsub.subscribers[eventName].forEach(callback=>{callback(data)})}},theme.scrollShadow={Updater:(function(){class Updater{constructor(targetElement){this.cb=()=>this.update(targetElement),this.rO=new ResizeObserver(this.cb),this.mO=new MutationObserver(()=>this.on(this.el))}on(element){this.el&&(this.el.removeEventListener("scroll",this.cb),this.rO.disconnect(),this.mO.disconnect()),element&&(element.nodeName==="TABLE"&&!/scroll|auto/.test(getComputedStyle(element).getPropertyValue("overflow"))&&(this.rO.observe(element),element=element.tBodies[0]),element.addEventListener("scroll",this.cb),[element,...element.children].forEach(el=>this.rO.observe(el)),this.mO.observe(element,{childList:!0}),this.el=element)}update(targetElement){const scrollTop=this.el.scrollTop,scrollBottom=this.el.scrollHeight-this.el.offsetHeight-this.el.scrollTop,scrollLeft=this.el.scrollLeft,scrollRight=this.el.scrollWidth-this.el.offsetWidth-this.el.scrollLeft*(theme.config.rtl?-1:1);let cssText=`--t: ${scrollTop>0?1:0}; --b: ${scrollBottom>0?1:0}; --l: ${scrollLeft>0?1:0}; --r: ${scrollRight>0?1:0};`;if(this.el.nodeName==="TBODY"){const clientRect=this.el.getBoundingClientRect(),rootClientRect=this.el.parentElement.getBoundingClientRect();cssText+=`top: ${clientRect.top-rootClientRect.top}px; bottom: ${rootClientRect.bottom-clientRect.bottom}px; left: ${clientRect.left-rootClientRect.left}px; right: ${rootClientRect.right-clientRect.right}px;`}requestAnimationFrame(()=>{targetElement.style.cssText=cssText})}}return Updater})()},theme.cookiesEnabled=function(){let cookieEnabled=navigator.cookieEnabled;return cookieEnabled||(document.cookie="testcookie",cookieEnabled=document.cookie.indexOf("testcookie")!==-1),cookieEnabled},theme.isStorageSupported=function(type){if(window.self!==window.top)return!1;const testKey="test";let storage;type==="session"&&(storage=window.sessionStorage),type==="local"&&(storage=window.localStorage);try{return storage.setItem(testKey,"1"),storage.removeItem(testKey),!0}catch{return!1}},theme.getElementWidth=function(element,value){const style=window.getComputedStyle(element),text=document.createElement("span");text.style.fontFamily=style.fontFamily,text.style.fontSize=style.fontSize,text.style.fontWeight=style.fontWeight,text.style.visibility="hidden",text.style.position="absolute",text.innerHTML=value,document.body.appendChild(text);const width=text.getBoundingClientRect().width;return text.remove(),width},theme.HoverButton=(function(){class HoverButton2{constructor(container){this.container=container}load(){theme.config.isTouch||document.body.getAttribute("data-button_hover")==="none"||(this.container.addEventListener("mouseenter",this.onEnterHandler.bind(this)),this.container.addEventListener("mouseleave",this.onLeaveHandler.bind(this)))}onEnterHandler(event){const btnFill=event.currentTarget.querySelector("[data-fill]");btnFill&&Motion.animate(btnFill,{y:["76%","0%"]},{duration:.6})}onLeaveHandler(event){const btnFill=event.currentTarget.querySelector("[data-fill]");btnFill&&Motion.animate(btnFill,{y:"-76%"},{duration:.6})}unload(){}}return HoverButton2})(),theme.MagnetButton=(function(){const config={magnet:10};class MagnetButton2{constructor(container){this.container=container,this.magnet=container.dataset.magnet?parseInt(container.dataset.magnet):config.magnet}load(){theme.config.isTouch||document.body.getAttribute("data-button_hover")==="none"||(this.container.addEventListener("mousemove",this.onMoveHandler.bind(this)),this.container.addEventListener("mouseleave",this.onLeaveHandler.bind(this)))}onMoveHandler(event){if(theme.config.motionReduced||this.magnet===0)return;const target=event.currentTarget,btnText=target.querySelector("[data-text]"),bounding=target.getBoundingClientRect();btnText?Motion.animate(btnText,{x:((event.clientX-bounding.left)/target.offsetWidth-.5)*this.magnet,y:((event.clientY-bounding.top)/target.offsetHeight-.5)*this.magnet},{duration:1.5,easing:Motion.spring()}):Motion.animate(target,{x:((event.clientX-bounding.left)/target.offsetWidth-.5)*this.magnet,y:((event.clientY-bounding.top)/target.offsetHeight-.5)*this.magnet},{duration:1.5,easing:Motion.spring()})}onLeaveHandler(event){if(theme.config.motionReduced||this.magnet===0)return;const target=event.currentTarget,btnText=target.querySelector("[data-text]");btnText?Motion.animate(btnText,{x:0,y:0},{duration:1.5,easing:Motion.spring()}):Motion.animate(target,{x:0,y:0},{duration:1.5,easing:Motion.spring()})}unload(){}}return MagnetButton2})(),theme.RevealButton=(function(){const config={magnet:25};class RevealButton{constructor(container){this.container=container,this.magnet=container.dataset.magnet?parseInt(container.dataset.magnet):config.magnet}load(){theme.config.isTouch||(this.container.addEventListener("mousemove",this.onMoveHandler.bind(this)),this.container.addEventListener("mouseleave",this.onLeaveHandler.bind(this)))}onMoveHandler(event){const target=event.currentTarget,bounding=target.getBoundingClientRect(),btnReveal=target.querySelector("[data-reveal]");btnReveal&&Motion.animate(btnReveal,{opacity:1,x:((event.clientX-bounding.left)/target.offsetWidth-.5)*this.magnet,y:((event.clientY-bounding.top)/target.offsetHeight-.5)*this.magnet},{duration:.2,easing:"steps(2, start)"})}onLeaveHandler(event){const btnReveal=event.currentTarget.querySelector("[data-reveal]");btnReveal&&Motion.animate(btnReveal,{x:0,y:0,opacity:0}
12,{duration:.2,easing:[.61,1,.88,1]})}unload(){}}return RevealButton})(),theme.Carousel=(function(){class Carousel{constructor(container,options,navigation){this.container=container,this.options=options,this.prevButton=navigation.previous,this.nextButton=navigation.next}load(){this.slider=new Flickity(this.container,this.options),this.prevButton.addEventListener("click",this.onPrevButtonClick.bind(this)),this.nextButton.addEventListener("click",this.onNextButtonClick.bind(this)),this.slider.on("dragStart",this.onDragStartHandler.bind(this)),this.slider.on("select",this.onSelectHandler.bind(this))}onDragStartHandler(){this.prevRemoveTransform(),this.nextRemoveTransform()}onSelectHandler(){this.slider.slides[this.slider.selectedIndex-1]?this.slider.slides[this.slider.selectedIndex+1]?(this.prevButton.disabled=!1,this.nextButton.disabled=!1):(this.prevButton.disabled=!1,this.nextButton.disabled=!0):(this.prevButton.disabled=!0,this.nextButton.disabled=!1)}onPrevButtonClick(event){event.preventDefault(),this.slider.previous(),this.nextRemoveTransform()}onNextButtonClick(event){event.preventDefault(),this.slider.next(),this.prevRemoveTransform()}prevRemoveTransform(){this.prevButton.style.transform=null,this.prevButton.querySelector("[data-fill]").style.transform=null}nextRemoveTransform(){this.nextButton.style.transform=null,this.nextButton.querySelector("[data-fill]").style.transform=null}unload(){}}return Carousel})(),theme.initWhenVisible=(function(){class ScriptLoader{constructor(callback,delay=5e3){this.loadScriptTimer=setTimeout(callback,delay),this.userInteractionEvents=["mouseover","mousemove","keydown","touchstart","touchend","touchmove","wheel"],this.onScriptLoader=this.triggerScriptLoader.bind(this,callback),this.userInteractionEvents.forEach(event=>{window.addEventListener(event,this.onScriptLoader,{passive:!0})})}triggerScriptLoader(callback){callback(),clearTimeout(this.loadScriptTimer),this.userInteractionEvents.forEach(event=>{window.removeEventListener(event,this.onScriptLoader,{passive:!0})})}}return ScriptLoader})(),new theme.initWhenVisible(()=>{document.body.removeAttribute("data-page-rendering")}),theme.DOMready(theme.headerGroup.init),theme.DOMready(theme.utils.setScrollbarWidth),window.addEventListener("resize",theme.utils.throttle(theme.utils.setScrollbarWidth)),theme.config.hasSessionStorage=theme.isStorageSupported("session"),theme.config.hasLocalStorage=theme.isStorageSupported("local");const mql=window.matchMedia(theme.config.mediaQuerySmall);theme.config.mqlSmall=mql.matches,mql.onchange=mql2=>{mql2.matches?(theme.config.mqlSmall=!0,document.dispatchEvent(new CustomEvent("matchSmall"))):(theme.config.mqlSmall=!1,document.dispatchEvent(new CustomEvent("unmatchSmall")))}})(),new theme.initWhenVisible(()=>{var e=!1,t;document.body.addEventListener("touchstart",function(i){if(!i.target.closest(".flickity-slider"))return e=!1;e=!0,t={x:i.touches[0].pageX,y:i.touches[0].pageY}},theme.supportsPassive?{passive:!0}:!1),document.body.addEventListener("touchmove",function(i){if(e&&i.cancelable){var n={x:i.touches[0].pageX-t.x,y:i.touches[0].pageY-t.y};Math.abs(n.x)>Flickity.defaults.dragThreshold&&i.preventDefault()}},theme.supportsPassive?{passive:!1}:!1)});class LoadingBar extends HTMLElement{constructor(){super(),window.addEventListener("beforeunload",()=>{document.body.classList.add("unloading")}),window.addEventListener("DOMContentLoaded",()=>{Motion.animate(this,{opacity:0,visibility:"hidden"},{duration:1}),document.body.classList.add("loaded"),document.dispatchEvent(new CustomEvent("page:loaded"))}),window.addEventListener("pageshow",event=>{event.persisted&&document.body.classList.remove("unloading")})}}customElements.define("loading-bar",LoadingBar);class CustomHeader extends HTMLElement{constructor(){super()}get allowTransparent(){return!!(document.querySelector(".shopify-section:first-child [allow-transparent-header]")&&!document.querySelector(".header-promo-bar"))}get headerSection(){return document.querySelector(".header-section")}connectedCallback(){if(this.init(),window.ResizeObserver&&new ResizeObserver(this.setHeight.bind(this)).observe(this),Shopify.designMode){const section=this.closest(".shopify-section");section.addEventListener("shopify:section:load",this.init.bind(this)),section.addEventListener("shopify:section:unload",this.init.bind(this)),section.addEventListener("shopify:section:reorder",this.init.bind(this))}}init(){new theme.initWhenVisible(this.setHeight.bind(this)),this.allowTransparent?(this.headerSection.classList.add("header-transparent"),this.headerSection.classList.add("no-animate"),setTimeout(()=>{this.headerSection.classList.remove("no-animate")},500)):this.headerSection.classList.remove("header-transparent")}setHeight(){requestAnimationFrame(()=>{document.documentElement.style.setProperty("--header-height",Math.round(this.clientHeight)+"px"),this.classList.contains("header--center")&&document.documentElement.style.setProperty("--header-nav-height",Math.round(document.getElementById("MenuToggle")?.clientHeight)+"px")})}}customElements.define("custom-header",CustomHeader,{extends:"header"});const stickyButton=document.querySelector(".description-container");let isStuck=!1;const checkSticky=()=>
12{if(stickyButton!=null){const stickyBottom=stickyButton.getBoundingClientRect().bottom,viewportHeight=window.innerHeight;stickyBottom>=viewportHeight&&!isStuck?(stickyButton.classList.add("stuck"),isStuck=!0):stickyBottom<viewportHeight&&isStuck&&(stickyButton.classList.remove("stuck"),isStuck=!1)}};document.addEventListener("DOMContentLoaded",checkSticky);class StickyHeader extends CustomHeader{constructor(){super()}get isAlwaysSticky(){return this.dataset.stickyType==="always"}connectedCallback(){super.connectedCallback(),this.currentScrollTop=0,this.firstScrollTop=window.scrollY,this.headerBounds=this.headerSection.getBoundingClientRect(),this.beforeInit()}beforeInit(){this.headerSection.classList.add("header-sticky"),this.headerSection.dataset.stickyType=this.dataset.stickyType,this.isAlwaysSticky&&this.headerSection.classList.add("header-sticky");let $this=this;document.querySelector(".collection.with-drawer .collection__topbar")!=null?setTimeout(function(){$this.headerSection.dataset.scrollHeight=document.querySelector(".collection.with-drawer .collection__topbar").getBoundingClientRect().top+window.scrollY},500):this.headerSection.dataset.scrollHeight="unset",window.addEventListener("scroll",theme.utils.throttle(this.onScrollHandler.bind(this)),!1)}onScrollHandler(){const scrollTop=window.scrollY;if(scrollTop>this.headerBounds.top+this.firstScrollTop+this.headerBounds.height?(this.headerSection.classList.add("header-scrolled"),document.documentElement.style.setProperty("--sticky-header-height",Math.round(this.clientHeight)+"px")):this.headerSection.classList.remove("header-scrolled"),this.headerSection.dataset.scrollHeight=="unset")var scrollBottomDistance=this.headerBounds.bottom+this.firstScrollTop+100;else var scrollBottomDistance=this.headerSection.dataset.scrollHeight;let stickyCollectionBar=document.querySelector(".sticky-collection-bar");scrollTop>scrollBottomDistance?(stickyCollectionBar&&stickyCollectionBar.classList.add("visible"),scrollTop>this.currentScrollTop||this.headerSection.classList.remove("header-hidden")):(stickyCollectionBar&&stickyCollectionBar.classList.remove("visible"),this.headerSection.classList.remove("header-hidden")),this.currentScrollTop=scrollTop,checkSticky()}}customElements.define("sticky-header",StickyHeader,{extends:"header"});class RevealLink extends HTMLAnchorElement{constructor(){super(),this.revealButton=new theme.RevealButton(this),this.revealButton.load()}}customElements.define("reveal-link",RevealLink,{extends:"a"});class HoverLink extends HTMLAnchorElement{constructor(){super(),this.hoverButton=new theme.HoverButton(this),this.hoverButton.load()}}customElements.define("hover-link",HoverLink,{extends:"a"});class MagnetLink extends HoverLink{constructor(){super(),this.magnetButton=new theme.MagnetButton(this),this.magnetButton.load()}}customElements.define("magnet-link",MagnetLink,{extends:"a"});class HoverButton extends HTMLButtonElement{constructor(){super(),this.hoverButton=new theme.HoverButton(this),this.hoverButton.load(),this.type==="submit"&&this.form&&this.form.addEventListener("submit",()=>this.setAttribute("aria-busy","true")),window.addEventListener("pageshow",()=>this.removeAttribute("aria-busy")),this.append(this.animationElement)}static get observedAttributes(){return["aria-busy"]}get contentElement(){return this._contentElement=this._contentElement||this.querySelector(".btn-text")}get animationElement(){return this._animationElement=this._animationElement||document.createRange().createContextualFragment(`
13 <span class="btn-loader"> 14 <span></span> 15 <span></span> 16 <span></span> 17 </span> 18 `).firstElementChild}async attributeChangedCallback(name,oldValue,newValue){theme.config.isTouch||document.body.getAttribute("data-button_hover")==="none"||(newValue==="true"?(Motion.timeline([[this.contentElement,{opacity:0},{duration:.15}],[this.animationElement,{opacity:1},{duration:.15}]]),Motion.animate(this.animationElement.children,{transform:["scale(1.6)","scale(0.6)"]},{duration:.35,delay:Motion.stagger(.35/2),direction:"alternate",repeat:1/0})):Motion.timeline([[this.animationElement,{opacity:0},{duration:.15}],[this.contentElement,{opacity:1},{duration:.15}]]))}}customElements.define("hover-button",HoverButton,{extends:"button"});class MagnetButton extends HoverButton{constructor(){super(),this.magnetButton=new theme.MagnetButton(this),this.magnetButton.load()}}customElements.define("magnet-button",MagnetButton,{extends:"button"});class HoverElement extends HTMLElement{constructor(){super(),this.hoverButton=new theme.HoverButton(this),this.hoverButton.load()}}customElements.define("hover-element",HoverElement);class MagnetElement extends HoverElement{constructor(){super(),this.magnetButton=new theme.MagnetButton(this),this.magnetButton.load()}}customElements.define("magnet-element",MagnetElement);class AnnouncementBar extends HTMLElement{constructor(){super(),theme.config.isTouch?new theme.initWhenVisible(this.init.bind(this)):Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get items(){return this._items=this._items||Array.from(this.children)}get autoplay(){return this.hasAttribute("autoplay")}get speed(){return this.hasAttribute("autoplay")?parseInt(this.getAttribute("autoplay-speed"))*1e3:5e3}init(){this.items.length>1&&(this.slider=new Flickity(this,{accessibility:!1,fade:!0,pageDots:!1,prevNextButtons:!1,wrapAround:!0,rightToLeft:theme.config.rtl,autoPlay:this.autoplay?this.speed:!1,on:{ready:function(){setTimeout(()=>this.element.setAttribute("loaded",""))}}}),this.slider.on("change",this.onChange.bind(this)),this.addEventListener("slider:previous",()=>this.slider.previous()),this.addEventListener("slider:next",()=>this.slider.next()),this.addEventListener("slider:play",()=>this.slider.playPlayer()),this.addEventListener("slider:pause",()=>this.slider.pausePlayer()),Shopify.designMode&&this.addEventListener("shopify:block:select",event=>this.slider.select(this.items.indexOf(event.target))))}disconnectedCallback(){this.slider&&this.slider.destroy()}onChange(){this.dispatchEvent(new CustomEvent("slider:change",{bubbles:!0,detail:{currentPage:this.slider.selectedIndex}}))}}customElements.define("announcement-bar",AnnouncementBar);class AccordionsDetails extends HTMLElement{constructor(){super(),this.addEventListener("toggle",this.onToggle)}get items(){return this._items=this._items||Array.from(this.querySelectorAll('details[is="accordion-details"]'))}onToggle(event){this.items.forEach(item=>{item!==event.detail.current&&item.close()})}}customElements.define("accordions-details",AccordionsDetails);class AccordionDetails extends HTMLDetailsElement{constructor(){super(),this._open=this.hasAttribute("open"),this.summaryElement=this.querySelector("summary"),this.contentElement=this.querySelector("summary + *"),this.setAttribute("aria-expanded",this._open?"true":"false"),this.summaryElement.addEventListener("click",this.onSummaryClick.bind(this)),Shopify.designMode&&(this.addEventListener("shopify:block:select",()=>{this.designModeActive&&(this.open=!0)}),this.addEventListener("shopify:block:deselect",()=>{this.designModeActive&&(this.open=!1)}))}get designModeActive(){return!0}get controlledElement(){return this.closest("accordions-details")}static get observedAttributes(){return["open"]}attributeChangedCallback(name,oldValue,newValue){name==="open"&&this.setAttribute("aria-expanded",newValue===""?"true":"false")}get open(){return this._open}set open(value){value!==this._open&&(this._open=value,this.isConnected?this.transition(value):value?this.setAttribute("open",""):this.removeAttribute("open")),this.setAttribute("aria-expanded",value?"true":"false"),this.dispatchEventHandler()}onSummaryClick(event){event.preventDefault(),this.open=!this.open}close(){this._open=!1,this.transition(!1)}async transition(value){this.style.overflow="hidden",value?(this.setAttribute("open",""),await Motion.timeline([[this,{height:[`${this.summaryElement.clientHeight}px`,`${this.scrollHeight}px`]},{duration:.25,easing:"ease"}],[this.contentElement,{opacity:[0,1],transform:["translateY(10px)","translateY(0)"]},{duration:.15,at:"-0.1"}]]).finished):(await Motion.timeline([[this.contentElement,{opacity:0}
18,{duration:.15}],[this,{height:[`${this.clientHeight}px`,`${this.summaryElement.clientHeight}px`]},{duration:.25,at:"<",easing:"ease"}]]).finished,this.removeAttribute("open")),this.style.height="auto",this.style.overflow="visible"}dispatchEventHandler(){(this.controlledElement??this).dispatchEvent(new CustomEvent("toggle",{bubbles:!0,detail:{current:this}}))}}customElements.define("accordion-details",AccordionDetails,{extends:"details"});class FooterDetails extends AccordionDetails{constructor(){super(),this.load(),window.addEventListener("resize",this.load.bind(this)),document.addEventListener("unmatchSmall",this.load.bind(this))}get designModeActive(){return theme.config.mqlSmall}load(){theme.config.mqlSmall?this.open&&(this._open=!1,this.removeAttribute("open"),this.setAttribute("aria-expanded","false"),this.classList.remove("active")):(this._open=!0,this.setAttribute("open",""),this.setAttribute("aria-expanded","true"),this.classList.add("active"))}}customElements.define("footer-details",FooterDetails,{extends:"details"});class GestureElement extends HTMLElement{constructor(){super(),this.config={thresholdY:Math.max(25,Math.floor(.15*window.innerHeight)),velocityThreshold:10,disregardVelocityThresholdY:Math.floor(.5*this.clientHeight),pressThreshold:8,diagonalSwipes:!1,diagonalLimit:Math.tan(45*1.5/180*Math.PI),longPressTime:500},this.handlers={panstart:[],panmove:[],panend:[],swipeup:[],swipedown:[],longpress:[]},this.addEventListener("touchstart",this.onTouchStart.bind(this),theme.supportsPassive?{passive:!0}:!1),this.addEventListener("touchmove",this.onTouchMove.bind(this),theme.supportsPassive?{passive:!0}:!1),this.addEventListener("touchend",this.onTouchEnd.bind(this),theme.supportsPassive?{passive:!0}:!1)}on(type,fn){if(this.handlers[type])return this.handlers[type].push(fn),{type,fn,cancel:()=>this.off(type,fn)}}off(type,fn){if(this.handlers[type]){const idx=this.handlers[type].indexOf(fn);idx!==-1&&this.handlers[type].splice(idx,1)}}fire(type,event){for(let i=0;i<this.handlers[type].length;i++)this.handlers[type][i](event)}onTouchStart(event){this.thresholdY=this.config.thresholdY,this.disregardVelocityThresholdY=this.config.disregardVelocityThresholdY,this.touchStartY=event.changedTouches[0].screenY,this.touchMoveY=null,this.touchEndY=null,this.swipingDirection=null,this.longPressTimer=setTimeout(()=>this.fire("longpress",event),this.config.longPressTime),this.fire("panstart",event)}onTouchMove(event){const touchMoveY=event.changedTouches[0].screenY-(this.touchStartY??0);this.velocityY=touchMoveY-(this.touchMoveY??0),this.touchMoveY=touchMoveY;const absTouchMoveY=Math.abs(this.touchMoveY);this.swipingVertical=absTouchMoveY>this.thresholdY,this.swipingDirection=this.swipingVertical?"vertical":"pre-vertical",absTouchMoveY>this.config.pressThreshold&&clearTimeout(this.longPressTimer??void 0),this.fire("panmove",event)}onTouchEnd(event){this.touchEndY=event.changedTouches[0].screenY,this.fire("panend",event),clearTimeout(this.longPressTimer??void 0);const y=this.touchEndY-(this.touchStartY??0),absY=Math.abs(y);absY>this.thresholdY&&(this.swipedVertical=this.config.diagonalSwipes?y<=this.config.diagonalLimit:absY>this.thresholdY,this.swipedVertical&&(y<0?((this.velocityY??0)<-this.config.velocityThreshold||y<-this.disregardVelocityThresholdY)&&this.fire("swipeup",event):((this.velocityY??0)>this.config.velocityThreshold||y>this.disregardVelocityThresholdY)&&this.fire("swipedown",event)))}}customElements.define("gesture-element",GestureElement);class OverlayElement extends HTMLElement{constructor(){super()}}customElements.define("overlay-element",OverlayElement);const lockLayerCount=new WeakMap;class ModalElement extends HTMLElement{constructor(){super(),this.events={afterHide:"modal:afterHide",afterShow:"modal:afterShow"},this.classes={open:"has-modal-open",opening:"has-modal-opening"}}static get observedAttributes(){return["id","open"]}get shouldLock(){return!1}get shouldAppendToBody(){return!1}get open(){return this.hasAttribute("open")}get controls(){return Array.from(document.querySelectorAll(`[aria-controls="${this.id}"]`))}get overlay(){return this._overlay=this._overlay||this.querySelector(".fixed-modal")}get gesture(){return this._gesture=this._gesture||this.querySelector("gesture-element")}get designMode(){return this.hasAttribute("shopify-design-mode")}get focusElement(){return this.querySelector("button")}connectedCallback(){this.abortController=new AbortController,this.controls.forEac
18h(button=>button.addEventListener("click",this.onButtonClick.bind(this),{signal:this.abortController.signal})),document.addEventListener("keyup",event=>event.code==="Escape"&&this.hide(),{signal:this.abortController.signal}),this.gesture&&(this.gestureConfig={animationFrame:null,moveY:0,maxGestureDistance:0,endPoint:0,layerHeight:null},this.gestureWrap=this.gesture.parentElement,setTimeout(()=>{this.gesture.on("panstart",this.onPanStart.bind(this)),this.gesture.on("panmove",this.onPanMove.bind(this)),this.gesture.on("panend",this.onPanEnd.bind(this))},75))}disconnectedCallback(){this.abortController?.abort()}attributeChangedCallback(name,oldValue,newValue){name==="open"&&(this.controls.forEach(button=>button.setAttribute("aria-expanded",newValue===null?"false":"true")),oldValue===null&&(newValue===""||newValue==="immediate")?(this.hidden=!1,this.removeAttribute("inert"),this.originalParentBeforeAppend=null,this.shouldAppendToBody&&this.parentElement!==document.body&&(this.originalParentBeforeAppend=this.parentElement,document.body.append(this)),(this.showTransition(newValue!=="immediate")||Promise.resolve()).then(()=>{this.afterShow(),this.dispatchEvent(new CustomEvent(this.events.afterShow,{bubbles:!0}))})):oldValue!==null&&newValue===null&&(this.setAttribute("inert",""),(this.hideTransition()||Promise.resolve()).then(()=>{this.afterHide(),this.hasAttribute("inert")&&(this.parentElement===document.body&&this.originalParentBeforeAppend&&(this.originalParentBeforeAppend.appendChild(this),this.originalParentBeforeAppend=null),this.dispatchEvent(new CustomEvent(this.events.afterHide,{bubbles:!0})),this.hidden=!0)})),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0})))}onButtonClick(event){event.preventDefault(),this.open?this.hide():this.show(event.currentTarget)}hide(){if(this.open)return this.beforeHide(),this.resetGesture(),this.removeAttribute("open"),theme.utils.waitForEvent(this,this.events.afterHide)}show(activeElement=null,animate=!0){if(!this.open)return this.beforeShow(),this.activeElement=activeElement,this.setAttribute("open",animate?"":"immediate"),this.id=="CartDrawer"&&setTimeout(function(){document.dispatchEvent(new CustomEvent("cart:open",{bubbles:!0}))},300),this.shouldLock&&document.body.classList.add(this.classes.opening),theme.utils.waitForEvent(this,this.events.afterShow)}beforeHide(){}beforeShow(){}afterHide(){setTimeout(()=>{this.shouldLock&&(lockLayerCount.set(ModalElement,lockLayerCount.get(ModalElement)-1),document.body.classList.toggle(this.classes.open,lockLayerCount.get(ModalElement)>0))})}afterShow(){theme.a11y.trapFocus(this,this.focusElement),this.shouldLock&&(lockLayerCount.set(ModalElement,lockLayerCount.get(ModalElement)+1),document.body.classList.remove(this.classes.opening),document.body.classList.add(this.classes.open))}showTransition(){return setTimeout(()=>{this.setAttribute("active","")},75),new Promise(resolve=>{this.overlay.addEventListener("transitionend",resolve,{once:!0})})}hideTransition(){return this.removeAttribute("active"),new Promise(resolve=>{this.overlay.addEventListener("transitionend",resolve,{once:!0})})}resetGesture(){this.gesture&&(this.gestureWrap.style.transform="",this.gestureWrap.style.transition="",this.overlay.style.opacity="",this.overlay.style.transition="")}onPanStart(){this.removeTransition(this.gestureWrap,"transform"),this.hasAttribute("open")&&(this.gestureConfig.layerHeight===null&&(this.gestureConfig.layerHeight=this.gestureWrap.getBoundingClientRect().height),this.gestureConfig.maxGestureDistance=this.gestureConfig.layerHeight-50,this.gestureConfig.endPoint=this.gestureConfig.layerHeight*.3)}onPanMove(){this.gestureConfig.animationFrame||(this.gestureConfig.animationFrame=requestAnimationFrame(()=>{const clamp=(a,min=0,max=1)=>Math.min(max,Math.max(min,a)),invlerp=(x,y,a)=>clamp((a-x)/(y-x));this.gestureWrap.style.transition="transform .1s linear",this.overlay.style.transition="opacity .1s linear",this.hasAttribute("open")&&(this.gestureConfig.layerHeight===null&&(this.gestureConfig.layerHeight=this.gestureWrap.getBoundingClientRect().height),this.gestureConfig.moveY=this.gesture.touchMoveY,this.gestureConfig.maxGestureDistance=this.gestureConfig.layerHeight-50,this.gestureConfig.moveY>=0?(this.gestureWrap.style.transform=`translateY(${Math.min(this.gestureConfig.moveY,this.gestureConfig.maxGestureDistance)}px)`,this.overlay.style.opacity=invlerp(this.gestureConfig.layerHeight,0,this.gestureConfig.moveY)):(this.gestureWrap.style.transform="translateY(0)",this.gestureWrap.style.transition="",this.overlay.style.opacity="1")),this.gestureConfig.animationFrame=null}))}onPanEnd(){this.gestureConfig.animationFrame===null||cancelAnimationFrame(this.gestureConfig.animationFrame),this.gestureConfig.animationFrame=null,this.gestureWrap.style.transition="transform .1s linear",this.gestureConfig.layerHeight===null&&(this.gestureConfig.layerHeight=this.gestureWrap.getBoundingClientRect().height),this.gestureConfig.endPoint=this.gestureConfig.layerHeight*.3,this.hasAttribute("open")&&(this.gestureConfig.moveY=this.gesture.touchMoveY,this.gestureConfig.moveY<this.gestureConfig.endPoint?this.gestureWrap.style.transform="translateY(0)":(this.gestureWrap.style.transform=`translateY(${this.gestureConfig.layerHeight}px)`,this.gestureWrap.addEventListener(this.whichTransitionEvent(),()=>{this.hide()},{once:!0})))}removeTransition(node,transition){const match=node.style.transition.match(new RegExp("(?:^|,)\\s*"+transition+"(?:$|\\s|,)[^,]*","i"));if(match){const transitionArray=node.style.transition.split("");transitionArray.splice(match.index,match[0].length),node.style.transition=transitionArray.join("")}}whichTransitionEvent(){let t;const el=document.createElement("fakeelement"),transitions={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",MSTransition:"msTransitionEnd",OTransition:"oTransitionEnd",transition:"transitionEnd"};for(t in transitions)if(el.style[t]!==void 0)return transitions[t]}}customElements.define("modal-element",ModalElement),lockLayerCount.set(Mo
18dalElement,0);class DrawerElement extends ModalElement{constructor(){super(),this.events={afterHide:"drawer:afterHide",afterShow:"drawer:afterShow"}}get shouldLock(){return!0}get shouldAppendToBody(){return!0}}customElements.define("drawer-element",DrawerElement);class MenuDrawer extends DrawerElement{constructor(){super()}get menuItems(){return this._menuItems=this._menuItems||this.querySelectorAll(".drawer__menu:not(.active)>li")}beforeShow(){super.beforeShow(),setTimeout(()=>{Motion.animate(this.menuItems,{transform:["translateX(-20px)","translateX(0)"],opacity:[0,1]},{duration:.6,easing:[.075,.82,.165,1],delay:Motion.stagger(.1)}).finished.then(()=>{this.menuItems.forEach(item=>item.removeAttribute("style"))})},300)}afterHide(){super.afterHide(),setTimeout(()=>{this.querySelectorAll("details[is=menu-details]").forEach(subMenu=>{subMenu.onCloseButtonClick()})})}}customElements.define("menu-drawer",MenuDrawer);class ShareDrawer extends DrawerElement{constructor(){super()}get menuItems(){return this._menuItems=this._menuItems||this.querySelectorAll(".share-buttons>li")}get urlToShare(){const urlInput=this.querySelector("input[type=hidden]");return urlInput?urlInput.value:document.location.href}connectedCallback(){navigator.share?this.controls.forEach(button=>button.addEventListener("click",this.shareTo.bind(this))):super.connectedCallback()}shareTo(event){event.preventDefault(),navigator.share({url:this.urlToShare,title:document.title})}beforeShow(){super.beforeShow(),setTimeout(()=>{Motion.animate(this.menuItems,{transform:["translateY(2.5rem)","translateY(0)"],opacity:[0,1]},{duration:.6,easing:[.075,.82,.165,1],delay:Motion.stagger(.1)}).finished.then(()=>{this.menuItems.forEach(item=>item.removeAttribute("style"))})},300)}}customElements.define("share-drawer",ShareDrawer);class MenuDetails extends HTMLDetailsElement{constructor(){super(),this.summary.addEventListener("click",this.onSummaryClick.bind(this)),this.closeButton.addEventListener("click",this.onCloseButtonClick.bind(this))}get parent(){return this.closest("[data-parent]")}get summary(){return this.querySelector("summary")}get closeButton(){return this.querySelector("button")}onSummaryClick(){setTimeout(()=>{this.parent.classList.add("active"),this.classList.add("active"),this.summary.setAttribute("aria-expanded",!0)},100)}onCloseButtonClick(){this.parent.classList.remove("active"),this.classList.remove("active"),this.summary.setAttribute("aria-expanded",!1),this.closeAnimation()}closeAnimation(){let animationStart;const handleAnimation=time=>{animationStart===void 0&&(animationStart=time),time-animationStart<400?requestAnimationFrame(handleAnimation):this.removeAttribute("open")};requestAnimationFrame(handleAnimation)}}customElements.define("menu-details",MenuDetails,{extends:"details"});class QuantitySelector extends HTMLElement{constructor(){super()}connectedCallback(){this.abortController=new AbortController,this.input=this.querySelector("input"),this.buttons=Array.from(this.querySelectorAll("button")),this.changeEvent=ne
18w Event("change",{bubbles:!0}),this.buttons.forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)),{signal:this.abortController.signal})}disconnectedCallback(){this.abortController.abort()}onButtonClick(event){event.preventDefault();const previousValue=this.input.value;event.currentTarget.name==="plus"?this.input.quantity=this.input.quantity+1:this.input.quantity=this.input.quantity-1,previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent)}}customElements.define("quantity-selector",QuantitySelector);class QuantityInput extends HTMLInputElement{constructor(){super(),this.addEventListener("input",this.onValueInput),this.addEventListener("change",this.onValueChanged),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("focus",this.select)}get quantity(){return parseInt(this.value)}set quantity(quantity){const isNumeric=(typeof quantity=="number"||typeof quantity=="string"&&quantity.trim()!=="")&&!isNaN(quantity);quantity!==""&&((!isNumeric||quantity<0)&&(quantity=parseInt(quantity)||1),this.value=Math.max(this.min||1,Math.min(quantity,this.max||Number.MAX_VALUE)).toString(),this.size=Math.max(this.value.length+1,2))}onValueInput(){this.quantity=this.value}onValueChanged(){this.value===""&&(this.quantity=1)}onKeyDown(event){event.stopPropagation();const quantity=this.quantity;event.key==="ArrowUp"?this.quantity=this.quantity+1:event.key==="ArrowDown"&&(this.quantity=this.quantity-1)}}customElements.define("quantity-input",QuantityInput,{extends:"input"});class CartCount extends HTMLElement{constructor(){super()}cartUpdateUnsubscriber=void 0;connectedCallback(){this.cartUpdateUnsubscriber=theme.pubsub.subscribe(theme.pubsub.PUB_SUB_EVENTS.cartUpdate,this.onCartUpdate.bind(this))}disconnectedCallback(){this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber()}get itemCount(){return parseInt(this.innerText)}onCartUpdate(event){event.cart.errors||(this.innerText=event.cart.item_count,this.hidden=this.itemCount===0)}}customElements.define("cart-count",CartCount);class RecentlyViewed extends HTMLElement{constructor(){if(super(),theme.config.hasLocalStorage===!1){this.hidden=!0;return}"requestIdleCallback"in window?requestIdleCallback(this.init.bind(this),{timeout:1500}):Motion.inView(this,this.init.bind(this),{margin:"600px 0px 600px 0px"})}init(){fetch(this.dataset.url+this.getQueryString()).then(response=>response.text()).then(responseText=>{const recommendations=new DOMParser().parseFromString(responseText,"text/html").querySelector(".shopify-section").querySelector("recently-viewed");recommendations&&recommendations.innerHTML.trim().length?(this.innerHTML=recommendations.innerHTML,this.dispatchEvent(new CustomEvent("recentlyViewed:loaded")),document.dispatchEvent(new CustomEvent("recentlyViewed:loaded"))):(this.closest(".recently-section")?.remove(),this.dispatchEvent(new CustomEvent("is-empty")))}).catch(e=>{console.error(e)})}getQueryString(){let recentlyViewed="[]";theme.config.hasLocalStorage&&(recentlyViewed=window.localStorage.getItem(`${theme.settings.themeName}:recently-viewed`)||"[]");const items=new Set(JSON.parse(recentlyViewed));return this.dataset.productId&&items.delete(parseInt(this.dataset.productId)),Array.from(items.values(),item=>`id:${item}`).slice(0,parseInt(this.dataset.limit||4)).join(" OR ")}}customElements.define("recently-viewed",RecentlyViewed);class ProductRecommendations extends HTMLElement{constructor(){super(),"requestIdleCallback"in window?requestIdleCallback(this.init.bind(this),{timeout:1500}):Motion.inView(this,this.init.bind(this),{margin:"600px 0px 600px 0px"})}init(){fetch(this.dataset.url).then(response=>response.text()).then(responseText=>{const sectionInnerHTML=new DOMParser().parseFromString(responseText,"text/html").querySelector(".shopify-section");if(sectionInnerHTML===null)return;const recommendations=sectionInnerHTML.querySelector("product-recommendations");recommendations&&recommendations.innerHTML.trim().length?(this.innerHTML=recommendations.innerHTML,this.dispatchEvent(new CustomEvent("recommendations:loaded")),document.dispatchEvent(new CustomEvent("recommendations:loaded"))):(this.closest(".shopify-section").remove(),this.dispatchEvent(new CustomEvent("is-empty")))}).catch(e=>{console.error(e)})}}customElements.define("product-recommendations",ProductRecommendations);class ProductComplementary extends HTMLElement{constructor(){super()}get container(){return this.closest("product-recommendations")}get prevButton(){return this.container.querySelector("[data-prev-button]")}get nextButton(){return this.container.querySelector("[data-next-button]")}connectedCallback(){this.innerHTML.trim().length?this.classList.contains("flickity")&&(this.carousel=new theme.Carousel(this,{prevNextButtons:!1,adaptiveHeight:!0,pageDots:!1,contain:!0,cellAlign:"center",rightToLeft:theme.config.rtl},{previous:this.prevButton,next:this.nextButton}),this.carousel.load()):this.container.hidden=!0}disconnectedCallback(){this.carousel&&this.carousel.unload()}}customElements.define("product-complementary",ProductComplementary);class AnimateElement extends HTMLElement{constructor(){super()}connectedCallback(){theme.config.motionReduced||(this.beforeInit(),Motion.inView(this,async()=>{!this.immediate&&this.media&&await theme.utils.imageLoaded(this.media),this.init()}))}get immediate(){return this.hasAttribute("data-immediate")}get media(){return Array.from(this.querySelectorAll("img, iframe, svg, g-map"))}get type(){return this.dataset.animate||"fade-up"}get delay(){return parseInt(this.dataset.animateDelay||0)/1e3}get paused(){return this.hasAttribute("paused")}beforeInit(){if(!this.paused)switch(this.type){case"fade-in":Motion.animate(this,{opacity:0}
18,{duration:0});break;case"fade-up":Motion.animate(this,{transform:"translateY(min(2rem, 90%))",opacity:0},{duration:0});break;case"fade-up-large":Motion.animate(this,{transform:"translateY(90%)",opacity:0},{duration:0});break;case"zoom-out":Motion.animate(this,{transform:"scale(1.3)"},{duration:0});break}}async init(){if(!this.paused){switch(this.type){case"fade-in":await Motion.animate(this,{opacity:1},{duration:1.5,delay:this.delay,easing:[.16,1,.3,1]}).finished;break;case"fade-up":await Motion.animate(this,{transform:"none",opacity:1},{duration:1.5,delay:this.delay,easing:[.16,1,.3,1]}).finished;break;case"fade-up-large":await Motion.animate(this,{transform:"translateY(0)",opacity:1},{duration:1,delay:this.delay,easing:[.16,1,.3,1]}).finished;break;case"zoom-out":await Motion.animate(this,{transform:"scale(1)"},{duration:1.3,delay:this.delay,easing:[.16,1,.3,1]}).finished;break}this.classList.add("animate")}}async reset(duration){switch(this.type){case"fade-in":await Motion.animate(this,{opacity:0},{duration:duration||1.5,delay:this.delay,easing:duration?"none":[.16,1,.3,1]}).finished;break;case"fade-up":await Motion.animate(this,{transform:"translateY(max(-2rem, -90%))",opacity:0},{duration:duration||1.5,delay:this.delay,easing:duration?"none":[.16,1,.3,1]}).finished;break;case"fade-up-large":await Motion.animate(this,{transform:"translateY(-90%)",opacity:0},{duration:duration||1,delay:this.delay,easing:duration?"none":[.16,1,.3,1]}).finished;break;case"zoom-out":await Motion.animate(this,{transform:"scale(0)"},{duration:duration||1.3,delay:this.delay,easing:duration?"none":[.16,1,.3,1]}).finished;break}this.classList.remove("animate")}refresh(){this.removeAttribute("paused"),this.beforeInit(),this.init()}}customElements.define("animate-element",AnimateElement);class MediaElement extends HTMLElement{constructor(){super()}get parallax(){return this.dataset.parallax?parseFloat(this.dataset.parallax):!1}get direction(){return this.dataset.parallaxDir||"vertical"}get media(){return Array.from(this.querySelectorAll("img, video, iframe, svg, video-media, g-map"))}connectedCallback(){theme.config.motionReduced||!this.parallax||this.setupParallax()}setupParallax(){const[scale,translate]=[1+this.parallax,this.parallax*100/(1+this.parallax)];this.direction==="vertical"?Motion.scroll(Motion.animate(this.media,{transform:[`scale(${scale}) translateY(0)`,`scale(${scale}) translateY(${translate}%)`],transformOrigin:["bottom","bottom"]},{easing:"linear"}),{target:this,offset:["start end","end start"]}):this.direction==="horizontal"?Motion.scroll(Motion.animate(this.media,{transform:[`scale(${scale}) translateX(0)`,`scale(${scale}) translateX(${translate}%)`],transformOrigin:["right","right"]},{easing:"linear"}),{target:this,offset:["start end","end start"]}):Motion.scroll(Motion.animate(this.media,{transform:["scale(1)",`scale(${scale})`],transformOrigin:["center","center"]},{easing:"linear"}),{target:this,offset:["start end","end start"]})}}customElements.define("media-element",MediaElement);class SplitWords extends HTMLElement{constructor(){super()}connectedCallback(){document.body.hasAttribute("data-title-animation")&&(new SplitType(this,{types:"words",wordClass:"single-word"}),Array.from(this.querySelectorAll(".single-word")).forEach((item,index)=>{const wrapper=document.createElement("animate-element");wrapper.className="block",wrapper.dataset.animate=this.dataset.animate,wrapper.dataset.animateDelay=parseInt(this.dataset.animateDelay||0)+index*30;for(const itemContent of item.childNodes)wrapper.appendChild(itemContent);item.appendChild(wrapper)}))}}customElements.define("split-words",SplitWords);class HighlightedText extends HTMLElement{constructor(){super(),Motion.inView(this,this.init.bind(this))}init(){this.classList.add("animate")}}customElements.define("highlighted-text",HighlightedText,{extends:"em"});class MarqueeElement extends HTMLElement{constructor(){super(),!theme.config.motionReduced&&Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get childElement(){return this.firstElementChild}get speed(){return parseInt(this.dataset.speed||16)}get maximum(){return parseInt(this.dataset.maximum||Math.ceil(this.parentWidth/this.childElementWidth)+2)}get direction(){return this.dataset.direction||"left"}get parallax(){return!theme.config.isTouch&&this.dataset.parallax?parseFloat(this.dataset.parallax):!1}get parentWidth(){return this.getWidth(this)}get childElementWidth(){return this.getWidth(this.childElement)}init(){if(this.childElementCount===1){this.childElement.classList.add("animate");for(let index=0;
18index<this.maximum;index++)this.clone=this.childElement.cloneNode(!0),this.clone.setAttribute("aria-hidden",!0),this.appendChild(this.clone),this.clone.querySelectorAll(".media").forEach(media=>media.classList.remove("loading"));this.style.setProperty("--duration",`${(33-this.speed)*Math.min(2.5,Math.ceil(this.childElementWidth/this.parentWidth))}s`)}if(this.parallax){let translate=this.parallax*100/(1+this.parallax);this.direction==="right"&&(translate=translate*-1),theme.config.rtl&&(translate=translate*-1),Motion.scroll(Motion.animate(this,{transform:[`translateX(${translate}%)`,"translateX(0)"]},{easing:"linear"}),{target:this,offset:["start end","end start"]})}else new IntersectionObserver((entries,_observer)=>{entries.forEach(entry=>{entry.isIntersecting?this.classList.remove("paused"):this.classList.add("paused")})},{rootMargin:"0px 0px 50px 0px"}).observe(this)}getWidth(element){const rect=element.getBoundingClientRect();return rect.right-rect.left}}customElements.define("marquee-element",MarqueeElement);class ScrolledImages extends HTMLElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get parallax(){return this.dataset.parallax?parseFloat(this.dataset.parallax):!1}get template(){return this.querySelector("template")}get images(){return Array.from(this.template.content.querySelectorAll(".scrolled-images__item"))}init(){this.beforeInit(),!(theme.config.motionReduced||!this.parallax)&&this.setupParallax()}beforeInit(){const main=this.querySelector(".scrolled-images__main");for(let i=0;i<3;i++){let images=this.shuffle(this.images);if(images.length<8){let start=0;for(;images.length<8;)images.push(images[start].cloneNode(!0)),start++}const row=document.createElement("div");row.classList="scrolled-images__row",images.forEach(item=>row.appendChild(item.cloneNode(!0))),main.appendChild(row)}}setupParallax(){Array.from(this.querySelectorAll(".scrolled-images__row")).forEach((element,index)=>{let translate=-1*this.parallax*100/(1+this.parallax);theme.config.rtl&&(translate=translate*-1),index%2===0?Motion.scroll(Motion.animate(element,{transform:[`translateX(${translate}%)`,"translateX(0)"]},{easing:"linear"}),{target:this,offset:Motion.ScrollOffset.Any}):Motion.scroll(Motion.animate(element,{transform:["translateX(0)",`translateX(${translate}%)`]},{easing:"linear"}),{target:this,offset:Motion.ScrollOffset.Any})})}shuffle(arr){return arr.sort(()=>Math.random()-.5)}}customElements.define("scrolled-images",ScrolledImages);class DropdownElement extends HTMLElement{constructor(){super(),this.classes={bodyClass:"has-dropdown"},this.events={afterHide:"dropdown:afterHide",afterShow:"dropdown:afterShow"},this.detectHoverListener=this.detectHover.bind(this),this.controls.forEach(button=>{button.addEventListener("click",this.onToggleClicked.bind(this)),button.addEventListener("mouseenter",this.detectHoverListener.bind(this)),button.addEventListener("mouseleave",this.detectHoverListener.bind(this))}),this.detectClickOutsideListener=this.detectClickOutside.bind(this),this.detectEscKeyboardListener=this.detectEscKeyboard.bind(this),this.detectFocusOutListener=this.detectFocusOut.bind(this)}static get observedAttributes(){return["id","open"]}get open(){return this.hasAttribute("open")}get controls(){return Array.from(document.querySelectorAll(`[aria-controls="${this.id}"]`))}get container(){return this.querySelector("*:first-child")}attributeChangedCallback(name,oldValue,newValue){name==="open"&&this.controls.forEach(button=>button.setAttribute("aria-expanded",newValue===null?"false":"true"))}show(){return document.body.classList.add(this.classes.bodyClass),this.setAttribute("open",""),document.addEventListener("click",this.detectClickOutsideListener),document.addEventListener("keydown",this.detectEscKeyboardListener),document.addEventListener("focusout",this.detectFocusOutListener),this.afterShow(),theme.utils.waitForEvent(this,this.events.afterShow)}hide(){return document.body.classList.remove(this.classes.bodyClass),this.removeAttribute("open"),document.removeEventListener("click",this.detectClickOutsideListener),document.removeEventListener("keydown",this.detectEscKeyboardListener),document.removeEventListener("focusout",this.detectFocusOutListener),this.afterHide(),theme.utils.waitForEvent(this,this.events.afterHide)}onToggleClicked(event){console.log(this),event?.preventDefault(),this.open?this.hide():this.show()}afterShow(){Motion.animate(this,{opacity:[0,1],visibility:"visible"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]}),Motion.animate(this.container,{transform:["translateY(-105%)","translateY(0)"]},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]})}afterHide(){Motion.animate(this,{opacity:0,visibility:"hidden"},{duration:theme.config.motionReduced?0:.3,easing:[.7,0,.2,1]}),Motion.animate(this.container,{transform:"translateY(-105%)"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]})}detectClickOutside(event){this.parentElement.contains(event.target)||this.hide()}detectEscKeyboard(event){event.code==="Escape"&&this.hide()}detectFocusOut(event){event.relatedTarget&&!this.contains(event.relatedTarget)&&this.hide()}detectHover(event){theme.config.isTouch||(event.type==="mouseenter"?this.show():this.hide())}}customElements.define("dropdown-element",DropdownElement);class DropdownLocalization extends DropdownElement{constructor(){super()}afterShow(){Motion.animate(this,{opacity:[0,1],visibility:"visible"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]})}afterHide(){Motion.animate(this,{opacity:0,visibility:"hidden"},{duration:theme.config.motionReduced?0:.3,easing:[.7,0,.2,1]})}}customElements.define("dropdown-localization",DropdownLocalization);class DropdownHelpElement extends HTMLElement{constructor(){super(),this.classes={bodyClass:"has-dropdown"},this.events={afterHide:"dropdown:afterHide",afterShow:"dropdown:afterShow"},this.detectHoverListener=this.detectHover.bind(this),this.controls.forEac
18h(button=>{button.addEventListener("click",this.onToggleClicked.bind(this)),button.addEventListener("mouseenter",this.detectHoverListener.bind(this)),button.addEventListener("mouseleave",this.detectHoverListener.bind(this))}),this.detectClickOutsideListener=this.detectClickOutside.bind(this),this.detectEscKeyboardListener=this.detectEscKeyboard.bind(this),this.detectFocusOutListener=this.detectFocusOut.bind(this)}static get observedAttributes(){return["id","open"]}get open(){return this.hasAttribute("open")}get controls(){return Array.from(document.querySelectorAll(`[aria-controls="${this.id}"]`))}get container(){return this.querySelector("*:first-child")}attributeChangedCallback(name,oldValue,newValue){name==="open"&&this.controls.forEach(button=>button.setAttribute("aria-expanded",newValue===null?"false":"true"))}show(){return document.body.classList.add(this.classes.bodyClass),this.setAttribute("open",""),document.addEventListener("click",this.detectClickOutsideListener),document.addEventListener("keydown",this.detectEscKeyboardListener),document.addEventListener("focusout",this.detectFocusOutListener),this.afterShow(),theme.utils.waitForEvent(this,this.events.afterShow)}hide(){return document.body.classList.remove(this.classes.bodyClass),this.removeAttribute("open"),document.removeEventListener("click",this.detectClickOutsideListener),document.removeEventListener("keydown",this.detectEscKeyboardListener),document.removeEventListener("focusout",this.detectFocusOutListener),this.afterHide(),theme.utils.waitForEvent(this,this.events.afterHide)}onToggleClicked(event){}afterShow(){Motion.animate(this,{opacity:[0,1],visibility:"visible"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]}),Motion.animate(this.container,{transform:["translateY(-105%)","translateY(0)"]},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]})}afterHide(){Motion.animate(this,{opacity:0,visibility:"hidden"},{duration:theme.config.motionReduced?0:.3,easing:[.7,0,.2,1]}),Motion.animate(this.container,{transform:"translateY(-105%)"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]})}detectClickOutside(event){this.parentElement.contains(event.target)||this.hide()}detectEscKeyboard(event){event.code==="Escape"&&this.hide()}detectFocusOut(event){event.relatedTarget&&!this.contains(event.relatedTarget)&&this.hide()}detectHover(event){theme.config.isTouch||(event.type==="mouseenter"?this.show():this.hide())}}customElements.define("dropdown-help-element",DropdownHelpElement);class DropdownHelp extends DropdownHelpElement{constructor(){super()}afterShow(){Motion.animate(this,{opacity:[0,1],visibility:"visible"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]})}afterHide(){Motion.animate(this,{opacity:0,visibility:"hidden"},{duration:theme.config.motionReduced?0:.3,easing:[.7,0,.2,1]})}}customElements.define("dropdown-help",DropdownHelp);const lockDropdownCount=new WeakMap;class DetailsDropdown extends HTMLDetailsElement{constructor(){super(),this.classes={bodyClass:"has-dropdown-menu"},this.events={afterHide:"menu:afterHide",afterShow:"menu:afterShow"},this.summaryElement=this.firstElementChild,this.contentElement=this.lastElementChild,this._open=this.hasAttribute("open"),this.summaryElement.addEventListener("click",this.onSummaryClicked.bind(this)),this.detectClickOutsideListener=this.detectClickOutside.bind(this),this.detectEscKeyboardListener=this.detectEscKeyboard.bind(this),this.detectFocusOutListener=this.detectFocusOut.bind(this),this.hoverTimer=null,this.detectHoverListener=this.detectHover.bind(this),this.addEventListener("mouseenter",this.detectHoverListener.bind(this)),this.addEventListener("mouseleave",this.detectHoverListener.bind(this))}set open(value){value!==this._open&&(this._open=value,this.isConnected?this.transition(value):value?this.setAttribute("open",""):this.removeAttribute("open"))}get open(){return this._open}get trigger(){return this.hasAttribute("trigger")?this.getAttribute("trigger"):"click"}get level(){return this.hasAttribute("level")?this.getAttribute("level"):"top"}onSummaryClicked(event){event.preventDefault(),!theme.config.isTouch&&this.trigger==="hover"&&this.summaryElement.hasAttribute("data-link")?window.location.href=this.summaryElement.getAttribute("data-link"):this.open=!this.open}async transition(value){return value?(lockDropdownCount.set(DetailsDropdown,lockDropdownCount.get(DetailsDropdown)+1),document.body.classList.add(this.classes.bodyClass),this.setAttribute("open",""),this.summaryElement.setAttribute("open",""),setTimeout(()=>this.contentElement.setAttribute("open",""),100),document.addEventListener("click",this.detectClickOutsideListener),document.addEventListener("keydown",this.detectEscKeyboardListener),document.addEventListener("focusout",this.detectFocusOutListener),await this.transitionIn(),this.shouldReverse(),theme.utils.waitForEvent(this,this.events.afterShow)):(lockDropdownCount.set(DetailsDropdown,lockDropdownCount.get(DetailsDropdown)-1),document.body.classList.toggle(this.classes.bodyClass,lockDropdownCount.get(DetailsDropdown)>0),this.summaryElement.removeAttribute("open"),this.contentElement.removeAttribute("open"),document.removeEventListener("click",this.detectClickOutsideListener),document.removeEventListener("keydown",this.detectEscKeyboardListener),document.removeEventListener("focusout",this.detectFocusOutListener),await this.transitionOut(),this.open||this.removeAttribute("open"),theme.utils.waitForEvent(this,this.events.afterHide))}async transitionIn(){Motion.animate(this.contentElement,{opacity:[0,1],visibility:"visible"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1],delay:theme.config.motionReduced?0:.2});const translateY=this.level==="top"?"-105%":"2rem";return Motion.animate(this.contentElement.firstElementChild,{transform:[`translateY(${translateY})`,"translateY(0)"]},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]}).finished}async transitionOut(){Motion.animate(this.contentElement,{opacity:0,visibility:"hidden"},{duration:theme.config.motionReduced?0:.3,easing:[.7,0,.2,1]});const translateY=this.level==="top"?"-105%":"2rem";return Motion.animate(this.contentElement.firstElementChild,{transform:`translateY(${translateY})`},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]}).finished}detectClickOutside(event){!this.contains(event.target)&&!(event.target.closest("details")instanceof DetailsDropdown)&&(this.open=!1)}detectEscKeyboard(event){if(event.code==="Escape"){const targetMenu=event.target.closest("details[open]");targetMenu&&(targetMenu.open=!1)}}detectFocusOut(event){event.relatedTarget&&!this.contains(event.relatedTarget)&&(this.open=!1)}detectHover(event){this.trigger!=="hover"||theme.config.isTouch||(event.type==="mouseenter"?this.open=!0:this.open=!1)}shouldReverse(){this.contentElement.offsetLeft+this.contentElement.clientWidth*2>window.innerWidth&&this.contentElement.classList.add("should-reverse")}}customElements.define("details-dropdown",DetailsDropdown,{extends:"details"}),lockDropdownCount.set(DetailsDropdown,0);class DetailsMega extends DetailsDropdown{constructor(){super(),Shopify.designMode&&(this.addEventListener("shopify:block:select",()=>this.open=!0),this.addEventListener("shopify:block:deselect",()=>this.open=!1))}async transitionIn(){return document.body.classList.add("with-mega"),Motion.animate(this.contentElement.firstElementChild,{visibility:"visible",transform:["translateY(-105%)","translateY(0)"]},{duration:(theme.config.motionReduced,0),easing:[.7,0,.2,1]}).finished}async transitionOut(){return document.body.classList.remove("with-mega"),Motion.animate(this.contentElement.firstElementChild,{visibility:"hidden",transform:"translateY(-105%)"},{duration:(theme.config.motionReduced,0),easing:[.7,0,.2,1]}).finished}}customElements.define("details-mega",DetailsMega,{extends:"details"});class LocalizationListbox extends HTMLFormElement{constructor(){super(),this.items.forEac
18h(item=>item.addEventListener("click",this.onItemClick.bind(this)))}get items(){return this._items=this._items||Array.from(this.querySelectorAll("a"))}get input(){return this.querySelector('input[name="locale_code"], input[name="country_code"]')}onItemClick(event){event.preventDefault(),this.input.value=event.currentTarget.dataset.value,this.submit()}}customElements.define("localization-listbox",LocalizationListbox,{extends:"form"});class LocalizationForm extends HTMLFormElement{constructor(){super(),theme.config.isTouch?new theme.initWhenVisible(this.init.bind(this)):Motion.inView(this,this.init.bind(this))}get select(){return this.querySelector("select")}beforeInit(){const value=this.select.options[this.select.selectedIndex].text,width=theme.getElementWidth(this.select,value);this.select.style.setProperty("--width",`${width}px`)}init(){this.beforeInit(),this.addEventListener("change",this.submit)}}customElements.define("localization-form",LocalizationForm,{extends:"form"});class StickyElement extends HTMLElement{constructor(){super(),this.endScroll=window.innerHeight-this.offsetHeight-500,this.currPos=window.scrollY,this.screenHeight=window.innerHeight,this.stickyElementHeight=this.offsetHeight,this.bottomGap=20,window.addEventListener("scroll",theme.utils.throttle(this.onScrollHandler.bind(this)),{capture:!0,passive:!0})}get headerHeight(){const header=document.querySelector('.header-section header[is="sticky-header"]');return header?Math.round(header.clientHeight)+20:20}onScrollHandler(){this.screenHeight=window.innerHeight,this.stickyElementHeight=this.offsetHeight,this.positionStickySidebar()}positionStickySidebar(){this.endScroll=window.innerHeight-this.offsetHeight-this.bottomGap;const style=window.getComputedStyle(this),stickyElementTop=parseInt(style.insetBlockStart.replace("px",""));this.stickyElementHeight+this.headerHeight+this.bottomGap>this.screenHeight?window.scrollY<this.currPos?stickyElementTop<this.headerHeight?(this.style.insetBlockStart=`${stickyElementTop+this.currPos-window.scrollY}px`,this.style.setProperty("--inset",`${stickyElementTop+this.currPos-window.scrollY}px`)):stickyElementTop>=this.headerHeight&&stickyElementTop!==this.headerHeight&&(this.style.insetBlockStart=`${this.headerHeight}px`,this.style.setProperty("--inset",`${this.headerHeight}px`)):stickyElementTop>this.endScroll?(this.style.insetBlockStart=`${stickyElementTop+this.currPos-window.scrollY}px`,this.style.setProperty("--inset",`${stickyElementTop+this.currPos-window.scrollY}px`)):stickyElementTop<this.endScroll&&stickyElementTop!==this.endScroll&&(this.style.insetBlockStart=`${this.endScroll}px`,this.style.setProperty("--inset",`${this.endScroll}px`)):(this.style.insetBlockStart=`${this.headerHeight}px`,this.style.setProperty("--inset",`${this.headerHeight}px`)),this.currPos=window.scrollY}}customElements.define("sticky-element",StickyElement);class ParallaxElement extends HTMLDivElement{constructor(){super(),this.load()}get mobileDisabled(){return!1}load(){theme.config.motionReduced||this.mobileDisabled&&(theme.config.isTouch||theme.config.mqlSmall)||this.motion()}motion(){this.animation=Motion.scroll(Motion.animate(this,{transform:[`translateY(${this.dataset.start})`,`translateY(${this.dataset.stop})`]}),{target:this,offset:Motion.ScrollOffset.Any})}}customElements.define("parallax-element",ParallaxElement,{extends:"div"});class ParallaxOverlay extends HTMLElement{constructor(){super(),this.load(),Shopify.designMode&&document.addEventListener("shopify:section:unload",this.refresh.bind(this))}refresh(){let options={};options[this.dataset.target]=this.dataset.stop,Motion.animate(this,options,{duration:0})}load(){let options={};options[this.dataset.target]=[this.dataset.start,this.dataset.stop],this.animation=Motion.scroll(Motion.animate(this,options),{target:this.parentElement,offset:Motion.ScrollOffset.Enter})}}customElements.define("parallax-overlay",ParallaxOverlay);class FooterParallax extends ParallaxElement{constructor(){super(),document.addEventListener("matchSmall",this.unload.bind(this)),document.addEventListener("unmatchSmall",this.load.bind(this)),Shopify.designMode&&document.addEventListener("shopify:section:unload",this.refresh.bind(this))}get mobileDisabled(){return!0}motion(){this.animation=Motion.scroll(Motion.animate(this,{transform:["translateY(-50%)","translateY(0)"]}),{target:this,offset:Motion.ScrollOffset.Enter})}refresh(){theme.config.motionReduced||this.mobileDisabled&&(theme.config.isTouch||theme.config.mqlSmall)||setTimeout(()=>{Motion.animate(this,{transform:"translateY(0)"},{duration:0})})}unload(){this.animation&&(this.animation(),this.style.transform=null)}}customElements.define("footer-parallax",FooterParallax,{extends:"div"});class FooterGroup extends HTMLElement{constructor(){super(),this.init(),Shopify.designMode&&document.addEventListener("shopify:section:load",this.init.bind(this))}get rounded(){return Array.from(this.querySelectorAll(".section--rounded"))}get sections(){return Array.from(this.querySelectorAll(".shopify-section"))}init(){this.sections.forEach((shopifySection,index)=>{const section=shopifySection.querySelector(".section");section&&(section.classList.remove("section--next-rounded"),section.style.zIndex=this.sections.length-index)}),this.rounded.forEach(section=>{let previousShopifySection=section.closest(".shopify-section").previousElementSibling;if(previousShopifySection===null&&(previousShopifySection=document.querySelector(".main-content .shopify-section:last-child")),previousShopifySection){const previousSection=previousShopifySection.querySelector(".section");previousSection&&previousSection.classList.add("section--next-rounded")}})}}customElements.define("footer-group",FooterGroup);class CarouselElement extends HTMLElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get items(){return this._items=this._items||Array.from(this.children)}get watchCSS(){return this.hasAttribute("watch-css")}get prevNextButtons(){return this.hasAttribute("prev-next-buttons")}get initialIndex(){return parseInt(this.getAttribute("initial-index")||0)}init(){this.items.length>1&&(this.carousel=new Flickity(this,{watchCSS:this.watchCSS,prevNextButtons:this.prevNextButtons,adaptiveHeight:!0,wrapAround:!0,rightToLeft:theme.config.rtl,initialIndex:this.initialIndex}),this.addEventListener("control:select",event=>this.select(event.detail.index)),this.carousel.on("change",this.onChange.bind(this)),Shopify.designMode&&this.addEventListener("shopify:block:select",event=>this.carousel.select(this.items.indexOf(event.target))))}disconnectedCallback(){this.carousel&&this.carousel.destroy()}select(index=0,immediate=!1){if(!immediate){const{selectedIndex,slides}=this.carousel;immediate=Math.abs(index-selectedIndex)>
183,index===0&&selectedIndex===slides.length-1&&(immediate=!1),index===slides.length-1&&selectedIndex===0&&(immediate=!1)}this.carousel.select(index,!1,immediate)}onChange(index){this.dispatchEvent(new CustomEvent("carousel:change",{bubbles:!0,detail:{index}}))}}customElements.define("carousel-element",CarouselElement);class TestimonialsElement extends CarouselElement{constructor(){super(),Motion.inView(this,()=>{setTimeout(()=>this.update(),600)})}update(){this.carousel&&this.carousel.select(0)}}customElements.define("testimonials-element",TestimonialsElement);class SecondaryMedia extends HTMLElement{constructor(){super(),Motion.inView(this,()=>{setTimeout(()=>this.init())},{margin:"200px 0px 200px 0px"});let $this=this;window.addEventListener("resize",function(){$this.reinitialize()})}get template(){return this.previousElementSibling}disconnectedCallback(){this.carousel&&this.carousel.destroy()}init(){if(this.appendChild(this.template.content.cloneNode(!0)),this.mediaCount=this.querySelectorAll(".media").length,!(window.innerWidth<768)&&this.mediaCount>1){this.carousel=new Flickity(this,{accessibility:!1,draggable:!0,pageDots:!1,prevNextButtons:!0,wrapAround:!0,rightToLeft:theme.config.rtl,fade:!0});let progressBar=this.nextElementSibling;progressBar.classList.add("visible"),setTimeout(function(){progressBar.classList.remove("visible")},2500),this.carousel.on("scroll",function(progress){progress=Math.max(0,Math.min(1,progress)),progressBar.style.left=progress*100*.75+"%",progressBar.classList.add("visible"),setTimeout(function(){progressBar.classList.remove("visible")},2500)}),window.innerWidth>=768&&(this.addEventListener("mouseleave",this.onLeaveHandler),this.addEventListener("mouseenter",this.onMoveHandler)),this.addEventListener("layout-change",function(){this.carousel.destroy(),this.carousel=new Flickity(this,{accessibility:!1,draggable:!0,pageDots:!1,prevNextButtons:!0,wrapAround:!0,rightToLeft:theme.config.rtl,fade:!0});let progressBar2=this.nextElementSibling;progressBar2.classList.add("visible"),setTimeout(function(){progressBar2.classList.remove("visible")},2500),this.carousel.on("scroll",function(progress){progress=Math.max(0,Math.min(1,progress)),progressBar2.style.left=progress*100*.75+"%",progressBar2.classList.add("visible"),setTimeout(function(){progressBar2.classList.remove("visible")},2500)}),window.innerWidth>=768&&(this.addEventListener("mouseleave",this.onLeaveHandler),this.addEventListener("mouseenter",this.onMoveHandler))})}}reinitialize(){this.carousel&&this.carousel.destroy(),this.innerHTML="",this.init(),console.log("Reinitialized with DOM clearing")}onMoveHandler(event){if(this.mediaCount>1)return this.carousel.select(1)}onLeaveHandler(){this.carousel.select(0)}}customElements.define("secondary-media",SecondaryMedia);class MotionList extends HTMLElement{constructor(){super(),!(theme.config.motionReduced||this.hasAttribute("motion-reduced"))&&(this.unload(),Motion.inView(this,this.load.bind(this)))}get items(){return this.querySelectorAll(".card")}get itemsToShow(){return this.querySelectorAll(".card:not([style])")}unload(){Motion.animate(this.items,{y:50,opacity:0,visibility:"hidden"},{duration:0})}load(){Motion.animate(this.items,{y:[50,0],opacity:[0,1],visibility:["hidden","visible"]},{duration:.5,delay:theme.config.motionReduced?0:Motion.stagger(.1)})}reload(){Motion.animate(this.itemsToShow,{y:[50,0],opacity:[0,1],visibility:["hidden","visible"]},{duration:.5,delay:theme.config.motionReduced?0:Motion.stagger(.1)})}}customElements.define("motion-list",MotionList);class LazyBackground extends HTMLElement{constructor(){super(),this.init()}get image(){const style=window.getComputedStyle(this);return style.backgroundImage?style.backgroundImage.slice(5,-2).replace("width=1","width=720"):!1}
18async init(){if(!this.image)return;const img=document.createElement("img");img.src=this.image,img.style.visibility="hidden",img.style.position="absolute",await theme.utils.imageLoaded(img),this.style.backgroundImage=`url(${this.image})`,img.remove()}}customElements.define("lazy-background",LazyBackground);class MenuToggle extends MagnetButton{constructor(){super(),this.addEventListener("click",this.onClick)}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get expanded(){return this.getAttribute("aria-expanded")==="true"}onClick(){this.setAttribute("aria-expanded",this.expanded?"false":"true"),this.controlledElement&&this.controlledElement.classList.toggle("active")}}customElements.define("menu-toogle",MenuToggle,{extends:"button"});class ScrollShadow extends HTMLElement{constructor(){super(),theme.config.isTouch?new theme.initWhenVisible(this.init.bind(this)):Motion.inView(this,this.init.bind(this))}get template(){return this.querySelector("template")}init(){this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(this.template.content.cloneNode(!0)),this.shadowRoot.addEventListener("slotchange",()=>this.load()),this.updater=new theme.scrollShadow.Updater(this.shadowRoot.children[1]),this.load()}load(){this.updater.on(this.children[0])}disconnectedCallback(){this.updater?.on()}}customElements.define("scroll-shadow",ScrollShadow);class CustomSelect extends HTMLSelectElement{constructor(){super(),this.onChange(),this.addEventListener("change",this.onChange)}onChange(){this.value!==""||this.selectedIndex===-1?this.setAttribute("selected",""):this.removeAttribute("selected")}}customElements.define("custom-select",CustomSelect,{extends:"select"});class GMap extends HTMLElement{constructor(){super(),!(!this.dataset.apiKey||!this.dataset.mapAddress)&&(Motion.inView(this,this.prepMapApi.bind(this),{margin:"600px 0px 600px 0px"}),window.gm_authFailure=()=>{Shopify.designMode&&window.mapError(theme.strings.authError)},window.mapError=(error,element)=>{const container=element?element.closest(".shopify-section"):document;container.querySelectorAll(".gmap--error").forEach(error2=>{error2.remove()}),container.querySelectorAll("g-map").forEach(map=>{const message=document.createElement("div");message.classList.add("rte","alert","alert--error","gmap--error"),message.innerHTML=error,map.closest(".with-map").prepend(message)})},window.gmNoop=()=>{})}prepMapApi(){this.loadScript().then(this.initMap.bind(this)).then(()=>{setTimeout(()=>{const container=this.closest(".banner__map");container&&container.previousElementSibling&&container.previousElementSibling.classList.remove("opacity-0")},1e3)})}loadScript(){return new Promise((resolve,reject)=>{const script=document.createElement("script");document.body.appendChild(script),script.onload=resolve,script.onerror=reject,script.async=!0,script.src=`https://maps.googleapis.com/maps/api/js?key=${this.dataset.apiKey}&callback=gmNoop`})}initMap(){new google.maps.Geocoder().geocode({address:this.dataset.mapAddress},(results,status)=>{if(status!==google.maps.GeocoderStatus.OK){if(Shopify.designMode){let errorMessage;switch(status){case"ZERO_RESULTS":errorMessage=theme.strings.addressNoResults;break;case"OVER_QUERY_LIMIT":errorMessage=theme.strings.addressQueryLimit;break;case"REQUEST_DENIED":errorMessage=theme.strings.authError;break;default:errorMessage=theme.strings.addressError;break}window.mapError(errorMessage,this)}}else{const mapOptions={zoom:parseInt(this.dataset.zoom),center:results[0].geometry.location,draggable:!0,clickableIcons:!1,scrollwheel:!1,disableDoubleClickZoom:!0,disableDefaultUI:!0},map=new google.maps.Map(this,mapOptions),center=map.getCenter();map.setCenter(center);const icon={path:"M22.6746 0C10.2174 0 0 8.79169 0 21.5118C0 31.2116 4.33864 38.333 9.26606 42.998C11.7232 45.3243 14.3387 47.0534 16.6674 48.2077C18.9384 49.3333 21.1148 50 22.6746 50C24.2345 50 26.4108 49.3333 28.6818 48.2077C31.0105 47.0534 33.626 45.3243 36.0832 42.998C41.0106 38.333 45.3492 31.2116 45.3492 21.5118C45.3492 8.79169 35.1318 0 22.6746 0ZM29.6514 22.6746C29.6514 26.5278 26.5278 29.6514 22.6746 29.6514C18.8214 29.6514 15.6978 26.5278 15.6978 22.6746C15.6978 18.8214 18.8214 15.6978 22.6746 15.6978C26.5278 15.6978 29.6514 18.8214 29.6514 22.6746Z",fillColor:this.dataset.markerColor,fillOpacity:1,anchor:new google.maps.Point(15,55),strokeWeight:0,scale:.7};new google.maps.Marker({map,position:map.getCenter(),icon});const styledMapType=new google.maps.StyledMapType(JSON.parse(this.parentNode.querySelector("[data-gmap-style]").innerHTML));map.mapTypes.set("styled_map",styledMapType),map.setMapTypeId("styled_map"),window.addEventListener("resize",()=>{google.maps.event.trigger(map,"resize"),map.setCenter(center)})}})}}customElements.define("g-map",GMap);class PreviousButton extends HoverButton{constructor(){super(),this.addEventListener("click",this.onClick),this.controlledElement&&this.controlledElement.addEventListener("slider:previousStatus",this.updateStatus.bind(this))}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}
18onClick(){(this.controlledElement??this).dispatchEvent(new CustomEvent("slider:previous",{bubbles:!0,cancelable:!0}))}updateStatus(event){switch(event.detail.status){case"hidden":this.hidden=!0;break;case"disabled":this.disabled=!0;break;default:this.hidden=!1,this.disabled=!1}}}customElements.define("previous-button",PreviousButton,{extends:"button"});class NextButton extends HoverButton{constructor(){super(),this.addEventListener("click",this.onClick),this.controlledElement&&this.controlledElement.addEventListener("slider:nextStatus",this.updateStatus.bind(this))}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}onClick(){(this.controlledElement??this).dispatchEvent(new CustomEvent("slider:next",{bubbles:!0,cancelable:!0}))}updateStatus(event){switch(event.detail.status){case"hidden":this.hidden=!0;break;case"disabled":this.disabled=!0;break;default:this.hidden=!1,this.disabled=!1}}}customElements.define("next-button",NextButton,{extends:"button"});class SliderElement extends HTMLElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get looping(){return!1}get items(){return this._items=this._items||Array.from(this.hasAttribute("selector")?this.querySelectorAll(this.getAttribute("selector")):this.children)}get itemsToShow(){return Array.from(this.items).filter(element=>element.clientWidth>0)}get itemOffset(){return theme.config.rtl?this.itemsToShow.length>1?this.itemsToShow[0].offsetLeft-this.itemsToShow[1].offsetLeft:0:this.itemsToShow.length>1?this.itemsToShow[1].offsetLeft-this.itemsToShow[0].offsetLeft:0}get perPage(){let elementWidth=this.clientWidth;if(window.matchMedia("screen and (min-width: 1280px)").matches){const styles=window.getComputedStyle(this);elementWidth=this.clientWidth-parseFloat(styles.paddingLeft)-parseFloat(styles.paddingRight)}return Math.floor(elementWidth/this.itemOffset)}get totalPages(){return this.itemsToShow.length-this.perPage+1}reset(){this._items=Array.from(this.hasAttribute("selector")?this.querySelectorAll(this.getAttribute("selector")):this.children)}init(){this.hasPendingOnScroll=!1,this.currentPage=1,this.updateButtons(),this.addEventListener("scroll",theme.utils.throttle(this.update.bind(this))),this.addEventListener("scrollend",this.scrollend),this.addEventListener("slider:previous",this.previous),this.addEventListener("slider:next",this.next),Shopify.designMode&&this.addEventListener("shopify:block:select",event=>event.target.scrollIntoView({behavior:"smooth"}))}previous(){this.scrollPosition=this.scrollLeft-this.perPage*this.itemOffset*(theme.config.rtl?-1:1),this.scrollToPosition(this.scrollPosition)}next(){this.scrollPosition=this.scrollLeft+this.perPage*this.itemOffset*(theme.config.rtl?-1:1),this.scrollToPosition(this.scrollPosition)}select(selectedIndex,immediate=!1){this.scrollPosition=this.scrollLeft-(this.currentPage-selectedIndex)*this.itemOffset*(theme.config.rtl?-1:1),this.scrollToPosition(this.scrollPosition,immediate)}selected(selectedIndex){return this.itemsToShow[selectedIndex]}scrollend(){this.hasPendingOnScroll=!1,this.dispatchEventHandler()}update(){window.onscrollend===void 0&&clearTimeout(this.scrollendTimeout);const previousPage=this.currentPage;this.currentPage=Math.round(Math.abs(this.scrollLeft)/this.itemOffset)+1,this.currentPage!==previousPage&&(this.hasPendingOnScroll||this.dispatchEventHandler(),this.itemsToShow.forEach((sliderItem,index)=>{sliderItem.classList.toggle("selected",index+1===this.currentPage)})),window.onscrollend===void 0&&(this.scrollendTimeout=setTimeout(()=>{this.dispatchEvent(new CustomEvent("scrollend",{bubbles:!0,composed:!0}))},75)),!this.looping&&this.updateButtons()}updateButtons(){let previousDisabled=this.currentPage===1,nextDisabled=this.currentPage===this.itemsToShow.length;this.perPage>1&&(previousDisabled=previousDisabled||this.itemsToShow.length>0&&this.isVisible(this.itemsToShow[0])&&this.scrollLeft===0,nextDisabled=nextDisabled||this.itemsToShow.length>0&&this.isVisible(this.itemsToShow[this.itemsToShow.length-1])),this.dispatchEvent(new CustomEvent("slider:previousStatus",{bubbles:!0,detail:{status:previousDisabled?nextDisabled?"hidden":"disabled":"visible"}})),this.dispatchEvent(new CustomEvent("slider:nextStatus",{bubbles:!0,detail:{status:nextDisabled?previousDisabled?"hidden":"disabled":"visible"}}))}isVisible(element,offset=0){const lastVisibleSlide=this.clientWidth+this.scrollLeft-offset;return element.offsetLeft+element.clientWidth<=lastVisibleSlide&&element.offsetLeft>=this.scrollLeft}scrollToPosition(position,immediate=!1){this.hasPendingOnScroll=!immediate,this.scrollTo({left:position,behavior:immediate?"instant":theme.config.motionReduced?"auto":"smooth"})}dispatchEventHandler(){this.dispatchEvent(new CustomEvent("slider:change",{detail:{currentPage:this.currentPage,currentElement:this.itemsToShow[this.currentPage-1]}}))}}customElements.define("slider-element",SliderElement);class SliderDots extends HTMLElement{constructor(){super(),new theme.initWhenVisible(()=>{this.controlledElement&&(this.controlledElement.addEventListener("slider:change",this.onChange.bind(this)),this.items.forEac
18h(item=>{item.addEventListener("click",this.onButtonClick.bind(this))}))})}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get items(){return this._items=this._items||Array.from(this.children)}get itemsToShow(){return Array.from(this.items).filter(element=>element.clientWidth>0)}reset(){this._items=Array.from(this.children)}onChange(event){this.transitionTo(parseInt(event.detail.currentPage)-1),this.itemsToShow.forEach(item=>{item.setAttribute("aria-current",parseInt(item.getAttribute("data-index"))===parseInt(event.detail.currentPage)?"true":"false")})}transitionTo(selectedIndex,immediate=!1){if(this.itemsToShow[selectedIndex]){const scrollElement=this.hasAttribute("align-selected")?this.closest(this.getAttribute("align-selected")):this;scrollElement.scrollTo({left:this.itemsToShow[selectedIndex].offsetLeft-scrollElement.clientWidth/2+this.itemsToShow[selectedIndex].clientWidth/2,top:this.itemsToShow[selectedIndex].offsetTop-scrollElement.clientHeight/2-this.itemsToShow[selectedIndex].clientHeight/2,behavior:immediate?"instant":theme.config.motionReduced?"auto":"smooth"})}}onButtonClick(event){event.preventDefault();const target=event.currentTarget;this.itemsToShow.forEach(item=>{item.setAttribute("aria-current",item.getAttribute("data-index")===target.getAttribute("data-index")?"true":"false")}),this.controlledElement.select(parseInt(target.getAttribute("data-index")))}}customElements.define("slider-dots",SliderDots);class ProgressBar extends HTMLElement{constructor(){super(),!this.hasAttribute("style")&&Motion.inView(this,this.init.bind(this))}init(){this.style.setProperty("--progress",`${parseInt(this.dataset.value)*.75*100/parseInt(this.dataset.max)}%`)}}customElements.define("progress-bar",ProgressBar);const onYouTubePromise=new Promise(resolve=>{window.onYouTubeIframeAPIReady=()=>resolve()});class DeferredMedia extends HTMLElement{constructor(){super(),this.posterElement&&this.posterElement.addEventListener("click",this.onPosterClick.bind(this)),this.autoplay&&Motion.inView(this,()=>(this.paused||this.play(),()=>{this.pause()}))}get posterElement(){return this.querySelector('[id^="DeferredPoster-"]')}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get autoplay(){return this.hasAttribute("autoplay")}get playing(){return this.hasAttribute("playing")}get player(){return this.playerProxy=this.playerProxy||new Proxy(this.playerTarget(),{get:(target,prop)=>async()=>{target=await target,this.playerHandler(target,prop)}})}static get observedAttributes(){return["playing"]}onPosterClick(event){event.preventDefault(),event.stopPropagation(),this.playing?(this.paused=!0,this.pause()):(this.paused=!1,this.play())}play(){this.playing||this.player.play()}pause(){this.playing&&this.player.pause()}attributeChangedCallback(name,oldValue,newValue){if(name==="playing"){if(oldValue===null&&newValue==="")return this.dispatchEvent(new CustomEvent("video:play",{bubbles:!0}));if(newValue===null)return this.dispatchEvent(new CustomEvent("video:pause",{bubbles:!0}))}}}class VideoMedia extends DeferredMedia{constructor(){super()}playerTarget(){if(this.hasAttribute("host"))return this.closest(".media")?.classList.remove("loading"),new Promise(async resolve=>{const templateElement=this.querySelector("template");templateElement&&templateElement.replaceWith(templateElement.content.firstElementChild.cloneNode(!0));const muteVideo=this.hasAttribute("autoplay"),script=document.createElement("script");if(script.type="text/javascript",this.getAttribute("host")==="youtube"){(!window.YT||!window.YT.Player)&&(script.src="https://www.youtube.com/iframe_api",document.head.appendChild(script),await new Promise(resolve2=>{script.onload=resolve2})),await onYouTubePromise;const player=new YT.Player(this.querySelector("iframe"),{events:{onReady:()=>{muteVideo&&(player.mute(),this.setAttribute("muted",""));const muteButton=this.querySelector(".mute-toggle");if(muteButton){const isMuted=player.isMuted();muteButton.dataset.sound=isMuted?"muted":"unmuted",muteButton.addEventListener("click",()=>{player.isMuted()?(player.unMute(),this.removeAttribute("muted"),muteButton.dataset.sound="unmuted"):(player.mute(),this.setAttribute("muted",""),muteButton.dataset.sound="muted")})}resolve(player)},onStateChange:event=>{event.data===YT.PlayerState.PLAYING?(this.setAttribute("playing",""),this.setAttribute("loaded","")):(event.data===YT.PlayerState.ENDED||event.data===YT.PlayerState.PAUSED)&&this.removeAttribute("playing")}}})}if(this.getAttribute("host")==="vimeo"){(!window.Vimeo||!window.Vimeo.Player)&&(script.src="https://player.vimeo.com/api/player.js",document.head.appendChild(script),await new Promise(resolve2=>{script.onload=resolve2}));const player=new Vimeo.Player(this.querySelector("iframe"));muteVideo&&(player.setMuted(!0),this.setAttribute("muted",""));const muteButton=this.querySelector(".mute-toggle");muteButton&&(player.getMuted().then(muted=>{muteButton.dataset.sound=muted?"Unmute":"Mute"}),muteButton.addEventListener("click",async()=>{await player.getMuted()?(await player.setMuted(!1),this.removeAttribute("muted"),muteButton.dataset.sound="muted"):(await player.setMuted(!0),this.setAttribute("muted",""),muteButton.dataset.sound="unmuted")})),player.on("loaded",()=>{console.log("vimeo loaded");let that=this;setTimeout(function(){that.setAttribute("loaded","")},300)}),player.on("play",()=>{this.setAttribute("playing",""),this.setAttribute("loaded","")}),player.on("pause",()=>this.removeAttribute("playing")),player.on("ended",()=>this.removeAttribute("playing")),resolve(player)}});{this.appendChild(this.querySelector("template").content.firstElementChild.cloneNode(!0)),this.closest(".media")?.classList.remove("loading");const player=this.querySelector("video");player.addEventListener("loadeddata",()=>{console.log("mp4 loaded"),this.setAttribute("loaded","")}),player.addEventListener("play",()=>{this.setAttribute("playing",""),this.removeAttribute("suspended")}),player.addEventListener("pause",()=>{!player.seeking&&player.paused&&this.removeAttribute("playing")});const muteButtons=this.querySelectorAll(".mute-toggle-html");return muteButtons.length&&(muteButtons.forEach(btn=>{btn.dataset.sound=player.muted?"muted":"unmuted"}),muteButtons.forEach(btn=>{btn.addEventListener("click",()=>{player.muted=!player.muted,muteButtons.forEach(button=>{button.dataset.sound=player.muted?"muted":"unmuted"}),player.muted?this.setAttribute("muted",""):this.removeAttribute("muted")})}
18)),player}}playerHandler(target,prop){this.getAttribute("host")==="youtube"?prop==="play"?target.playVideo():target.pauseVideo():prop==="play"&&!this.hasAttribute("host")?target.play().catch(error=>{if(error.name==="NotAllowedError"){this.setAttribute("suspended",""),target.controls=!0;const replacementImageSrc=target.previousElementSibling?.currentSrc;replacementImageSrc&&(target.poster=replacementImageSrc)}}):target[prop]()}}customElements.define("video-media",VideoMedia);class ModelMedia extends DeferredMedia{constructor(){super(),this.player,this.closeElement&&this.closeElement.addEventListener("click",this.onCloseClick.bind(this))}get closeElement(){return this.querySelector('[id^="DeferredPosterClose-"]')}onCloseClick(event){event.preventDefault(),event.stopPropagation(),this.modelViewerUI&&this.modelViewerUI.pause()}playerTarget(){return new Promise(()=>{this.setAttribute("loaded",""),Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:this.setupShopifyXR.bind(this)},{name:"model-viewer-ui",version:"1.0",onLoad:this.setupModelViewerUI.bind(this)}])})}playerHandler(target,prop){target[prop]()}async setupShopifyXR(){if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",this.setupShopifyXR.bind(this));return}document.querySelectorAll('[id^="ProductJSON-"]').forEach(modelJSON=>{window.ShopifyXR.addModels(JSON.parse(modelJSON.textContent)),modelJSON.remove()}),window.ShopifyXR.setupXRElements()}setupModelViewerUI(errors){if(errors)return;const modelViewer=this.querySelector("model-viewer");modelViewer&&!modelViewer.hasAttribute("loaded")&&(modelViewer.setAttribute("loaded",""),modelViewer.addEventListener("shopify_model_viewer_ui_toggle_play",this.modelViewerPlayed.bind(this)),modelViewer.addEventListener("shopify_model_viewer_ui_toggle_pause",this.modelViewerPaused.bind(this)),this.modelViewerUI=new Shopify.ModelViewerUI(modelViewer))}modelViewerPlayed(){this.setAttribute("playing",""),this.closeElement.removeAttribute("hidden"),(this.controlledElement??this).dispatchEvent(new CustomEvent("modelViewer:play",{bubbles:!0}))}modelViewerPaused(){this.removeAttribute("playing"),this.closeElement.setAttribute("hidden",""),(this.controlledElement??this).dispatchEvent(new CustomEvent("modelViewer:pause",{bubbles:!0}))}}customElements.define("model-media",ModelMedia);class VariantSelects extends HTMLElement{constructor(){super(),this.addEventListener("change",this.onVariantChange)}get productForm(){return document.forms[this.getAttribute("form")]}onVariantChange(event){const fieldsets=Array.from(this.querySelectorAll("fieldset")),uncheckedFieldsets=fieldsets.filter(fieldset=>!fieldset.querySelector('input[type="radio"]:checked')&&fieldset.dataset.optionName!=="Color").map(fieldset=>fieldset.dataset.optionName);if(uncheckedFieldsets.length>0){const variants=this.getVariantData();uncheckedFieldsets.forEach(optionName=>{const fieldset=document.querySelector(`fieldset[data-option-name="${optionName}"]`),isOption1=fieldset.dataset.optionIndex==="option1";fieldset.querySelectorAll('input[type="radio"]').forEach(input=>{const option1=isOption1?input.value:event.target.value,option2=isOption1?event.target.value:input.value;variants.some(variant=>variant.option1===option1&&variant.option2===option2&&variant.available)?input.classList.remove("disabled"):input.classList.add("disabled")})});const formattedOptions=uncheckedFieldsets.join(" and "),defaultATC=document.querySelector(".product-form__submit .btn-text"),stickyATC=document.querySelector(".sticky-atc");defaultATC!=null&&(defaultATC.innerHTML=`Select ${formattedOptions}`),stickyATC!=null&&(stickyATC.innerHTML=`Select ${formattedOptions}`,document.querySelectorAll("sticky-variant-title div").forEach(div=>{const option=div.dataset.option;if(!uncheckedFieldsets.includes(option)){div.classList.remove("hidden");const checkedInput=document.querySelector(`.product-form__input[data-option-name="${option}"] input:checked`);console.log(checkedInput);const stickyOptionValue=checkedInput?checkedInput.value:"",stickyOptionValueEl=div.querySelector("span.color-light");stickyOptionValueEl&&(stickyOptionValueEl.textContent=stickyOptionValue)}}))}else this.options=fieldsets.map(fieldset=>Array.from(fieldset.querySelectorAll("input")).find(radio=>radio.checked).value),this.updateOptions(),this.updateMasterId(),this.toggleBuyButton(!0,"",!1),this.updatePickupAvailability(),this.removeErrorMessage(),this.currentVariant?(this.updateURL(),this.updateV
18ariantInput(),this.updateOptionValue(),this.renderProductInfo(),this.setAvailability(),(this.productForm??document).dispatchEvent(new CustomEvent("variant:change",{detail:{variant:this.currentVariant}}))):(this.toggleBuyButton(!0,"",!0),this.setUnavailable(),this.setAvailabilityInUnavailable())}updateOptions(){this.options=Array.from(this.querySelectorAll("select"),select=>select.value)}updateMasterId(){this.currentVariant=this.getVariantData()?.find(variant=>!variant.options.map((option,index)=>this.options[index]===option).includes(!1))}getSlug(someString){return someString.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-$/,"").replace(/^-/,"")}updateURL(){!this.currentVariant||this.dataset.updateUrl==="false"||window.history.replaceState({},"",`${this.dataset.url}?variant=${this.currentVariant.id}`)}updateVariantInput(){document.querySelectorAll(`#ProductForm-${this.dataset.section}, #ProductFormInstallment-${this.dataset.section}`).forEach(productForm=>{const input=productForm.querySelector('input[name="id"]');input.value=this.currentVariant.id,input.dispatchEvent(new Event("change",{bubbles:!0}))})}updatePickupAvailability(){const pickUpAvailability=document.querySelector("pickup-availability");pickUpAvailability&&(this.currentVariant?pickUpAvailability.fetchAvailability(this.currentVariant.id):(pickUpAvailability.setAttribute("hidden",""),pickUpAvailability.innerHTML=""))}updateOptionValue(){for(let index=1;index<=3;index++){const option=`option${index}`,id=`${this.dataset.section}-${option}`,destination=document.getElementById(id),source=this.currentVariant[option];source&&destination&&(destination.innerHTML=source)}}removeErrorMessage(){const section=this.closest("section");if(!section)return;const productForm=section.querySelector('form[is="product-form"]');productForm&&productForm.handleErrorMessage()}renderProductInfo(){fetch(`${this.dataset.url}?variant=${this.currentVariant.id}§ion_id=${this.dataset.section}`).then(response=>response.text()).then(responseText=>{this.updateSKU(responseText),this.updatePrice(responseText),this.updateStickyPrice(responseText),this.updateInventoryStatus(responseText),this.currentVariant&&this.toggleBuyButton(!this.currentVariant.available,theme.variantStrings.soldOut),document.dispatchEvent(new CustomEvent("productInfo:loaded"))}).catch(e=>{console.error(e)})}updateSKU(responseText){const id=`Sku-${this.dataset.section}`,parsedHTML=new DOMParser().parseFromString(responseText,"text/html"),destination=document.getElementById(id),source=parsedHTML.getElementById(id);source&&destination&&(destination.innerHTML=source.innerHTML),destination&&destination.classList.remove("invisible")}updatePrice(responseText){const id=`Price-${this.dataset.section}`,parsedHTML=new DOMParser().parseFromString(responseText,"text/html"),destination=document.getElementById(id),source=parsedHTML.getElementById(id);source&&destination&&(destination.innerHTML=source.innerHTML),destination&&destination.classList.remove("invisible")}updateStickyPrice(responseText){const id=`StickyPrice-${this.dataset.section}`,parsedHTML=new DOMParser().parseFromString(responseText,"text/html"),destination=document.getElementById(id),source=parsedHTML.getElementById(id);source&&destination&&(destination.innerHTML=source.innerHTML),destination&&destination.classList.remove("invisible")}updateInventoryStatus(responseText){const id=`Inventory-${this.dataset.section}`,parsedHTML=new DOMParser().parseFromString(responseText,"text/html"),destination=document.getElementById(id),source=parsedHTML.getElementById(id);source&&destination&&(destination.innerHTML=source.innerHTML),destination&&destination.classList.remove("invisible")}toggleBuyButton(disable=!0,text,modifyClass=!0){document.querySelectorAll(`#ProductForm-${this.dataset.section}, #StickyProductForm-${this.dataset.section}`).forEach(productForm=>{const buyButton=productForm.querySelector('[name="add"]'),buyButtonText=productForm.querySelector('[name="add"] > .btn-text'),buyButtonTextChild=productForm.querySelector('[name="add"] > .btn-text span'),notifyMeBtn=productForm.querySelector("#notify-me-btn");if(!buyButton)return;console.log(text),disable?(buyButton.setAttribute("disabled",""),buyButton.parentNode.classList.contains("bis-hidden")||notifyMeBtn&&text==theme.variantStrings.soldOut&&(buyButton.parentNode.classList.add("out-of-stock"),notifyMeBtn.style.display="block"),text&&((buyButtonTextChild||buyButtonText).innerText=text)):(buyButton.removeAttribute("disabled"),buyButton.parentNode.classList.remove("out-of-stock"),notifyMeBtn&&(notifyMeBtn.style.display="none"),(buyButtonTextChild||buyButtonText).innerText=buyButton.dataset.preOrder==="true"?theme.variantStrings.preOrder:theme.variantStrings.addToCart);const stickyATC=document.querySelector(".sticky-atc");stickyATC!=null&&(stickyATC.innerHTML=document.querySelector(".product-form__submit").innerText)})}setUnavailable(){document.querySelectorAll(`#ProductForm-${this.dataset.section}`,`#StickyProductForm-${this.dataset.section}`).forEach(productForm=>{const buyButton=productForm.querySelector('[name="add"]'),buyButtonText=buyButton.querySelector('[name="add"] > .btn-text'),buyButtonTextChild=productForm.querySelector('[name="add"] > .btn-text span');if(!buyButton)return;(buyButtonTextChild||buyButtonText).innerText=theme.variantStrings.unavailable;const price=document.getElementById(`Price-${this.dataset.section}`);price&&price.classList.add("invisible");const stickyPrice=document.getElementById(`StickyPrice-${this.dataset.section}`);stickyPrice&&stickyPrice.classList.add("invisible");const inventory=document.getElementById(`Inventory-${this.dataset.section}`);inventory&&inventory.classList.add("invisible")})}getVariantData(){return this.variantData=this.variantData||JSON.parse(this.querySelector('[type="application/json"]').textContent),this.variantData}setAvailability(){if(!this.currentVariant)return;this.querySelectorAll(".variant-input-wrapper").forEach(group=>{this.disableVariantGroup(group)});const currentlySelectedValues=this.currentVariant.options.map((value,index)=>({value,index:`option${index+1}`})),initialOptions=this.createAvailableOptionsTree(this.variantData,currentlySelectedValues,this.currentVariant);for(var[option,values]of Object.entries(initialOptions))this.manageOptionState(option,values)}setAvailabilityInUnavailable(){this.querySelectorAll(".variant-input-wrapper").forEach(group=>{this.disableVariantGroup(group)});const currentlySelectedValues=this.options.map((value,index)=>({value,index:`option${index+1}`})),initialOptions=this.createAvailableOptionsTree(this.variantData,currentlySelectedValues,this.currentVariant);for(var[option,values]of Object.entries(initialOptions))this.manageOptionState(option,values)}enableVariantOption(group,obj){const value=obj.value.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g,"\\$1");group.querySelector('option[value="'+value+'"]').disabled=!1}disableVariantGroup(group){group.querySelectorAll("option").forEach(option=>{option.disabled=!0})}manageOptionState(option,values){const group=this.querySelector('.variant-input-wrapper[data-option-index="'+option+'"]');
18values.forEach(obj=>{this.enableVariantOption(group,obj)})}createAvailableOptionsTree(variants,currentlySelectedValues){return variants.reduce((options,variant)=>(Object.keys(options).forEach(index=>{if(variant[index]===null)return;let entry=options[index].find(option=>option.value===variant[index]);typeof entry>"u"&&(entry={value:variant[index],soldOut:!0},options[index].push(entry));const currentOption1=currentlySelectedValues.find(({value,index:index2})=>index2==="option1"),currentOption2=currentlySelectedValues.find(({value,index:index2})=>index2==="option2");switch(index){case"option1":entry.soldOut=entry.soldOut&&variant.available?!1:entry.soldOut;break;case"option2":currentOption1&&variant.option1===currentOption1.value&&(entry.soldOut=entry.soldOut&&variant.available?!1:entry.soldOut);case"option3":currentOption1&&variant.option1===currentOption1.value&¤tOption2&&variant.option2===currentOption2.value&&(entry.soldOut=entry.soldOut&&variant.available?!1:entry.soldOut)}}),options),{option1:[],option2:[],option3:[]})}}customElements.define("variant-selects",VariantSelects);class VariantRadios extends VariantSelects{constructor(){super()}updateOptions(){const fieldsets=Array.from(this.querySelectorAll("fieldset"));this.options=fieldsets.map(fieldset=>Array.from(fieldset.querySelectorAll("input")).find(radio=>radio.checked).value)}enableVariantOption(group,obj){const value=obj.value.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g,"\\$1"),input=group.querySelector('input[data-option-value="'+value+'"]');input.classList.remove("disabled"),obj.soldOut&&input.classList.add("disabled")}disableVariantGroup(group){group.querySelectorAll("input").forEach(input=>{input.classList.add("disabled")})}}customElements.define("variant-radios",VariantRadios);class ProductForm extends HTMLFormElement{constructor(){super(),this.querySelector("[name=id]").disabled=!1,this.addEventListener("submit",this.onSubmitHandler)}get cartDrawer(){return document.querySelector("cart-drawer")}get submitButton(){return this._submitButton=this._submitButton||this.querySelector('[type="submit"]')}get submitButtons(){return this._submitButtons=this._submitButtons||document.querySelectorAll(`[type="submit"][form="${this.getAttribute("id")}"]`)}get hideErrors(){return this.dataset.hideErrors==="true"}onSubmitHandler(event){if(document.body.classList.contains("template-cart")||theme.settings.cartType==="page"||(event.preventDefault(),this.submitButton.hasAttribute("aria-disabled")))return;this.activeElement=event.submitter||event.currentTarget,this.handleErrorMessage();let sectionsToBundle=[];document.documentElement.dispatchEvent(new CustomEvent("cart:bundled-sections",{bubbles:!0,detail:{sections:sectionsToBundle}}));const config=theme.utils.fetchConfig("javascript");config.headers["X-Requested-With"]="XMLHttpRequest",delete config.headers["Content-Type"];const formData=new FormData(this);formData.append("sections",sectionsToBundle),formData.append("sections_url",window.location.pathname),config.body=formData,this.submitButton.setAttribute("aria-disabled","true"),this.submitButton.setAttribute("aria-busy","true"),fetch(`${theme.routes.cart_add_url}`,config).then(response=>response.json()).then(async parsedState=>{if(parsedState.status){theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.cartError,{source:"product-form",productVariantId:formData.get("id"),errors:parsedState.errors||parsedState.description,message:parsedState.message}),this.handleErrorMessage(parsedState.description),document.dispatchEvent(new CustomEvent("ajaxProduct:error",{detail:{errorMessage:parsedState.description}}));const submitButtonText=this.submitButton.querySelector(".btn-text span");if(!submitButtonText||!submitButtonText.hasAttribute("data-sold-out"))return;submitButtonText.innerText=submitButtonText.getAttribute("data-sold-out"),this.submitButton.setAttribute("aria-disabled","true"),this.error=!0;return}const cartJson=await(await fetch(`${theme.routes.cart_url}`,{...theme.utils.fetchConfig()})).json();cartJson.sections=parsedState.sections,theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.cartUpdate,{cart:cartJson}),document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product:parsedState}}));const quickViewModal=this.closest("quick-view");
18quickViewModal?(document.body.addEventListener("modal:afterHide",()=>{setTimeout(()=>{this.cartDrawer?.show(this.activeElement)})},{once:!0}),quickViewModal.hide(!0)):this.cartDrawer?.show(this.activeElement)}).catch(error=>{console.log(error)}).finally(()=>{this.submitButton.removeAttribute("aria-busy"),this.submitButtons.forEach(submitButton=>{submitButton.removeAttribute("aria-busy"),submitButton.querySelector(".btn-text").innerText="Added",setTimeout(function(){submitButton.querySelector(".btn-text").innerText="Add to Cart"},3e3)}),this.error||(this.submitButton.removeAttribute("aria-disabled"),this.submitButtons.forEach(submitButton=>submitButton.removeAttribute("aria-disabled")))})}handleErrorMessage(errorMessage=!1){this.hideErrors||(this.errorMessage=this.errorMessage||this.querySelector(".product-form__error-message"),this.errorMessage&&(this.errorMessage.toggleAttribute("hidden",!errorMessage),this.errorMessage.innerText=errorMessage))}}customElements.define("product-form",ProductForm,{extends:"form"});class MediaGallery extends HTMLElement{constructor(){super(),Motion.inView(this,()=>{setTimeout(()=>this.pauseAllMedia(),500)}),(this.productForm??document).addEventListener("variant:change",this.onVariantChanged.bind(this)),this.addEventListener("lightbox:open",event=>this.openZoom(event.detail.index)),this.sliderGallery.addEventListener("slider:change",this.onSlideChange.bind(this)),this.countMediaGallery()}get viewInSpaceButton(){return this.querySelector("[data-shopify-xr]")}get productForm(){return document.forms[this.getAttribute("form")]}get sliderGallery(){return this.querySelector("slider-element")}get sliderDots(){return this.querySelector("media-dots")}get mediaPreview(){return this.querySelector(".product__preview .product__media")}get hideVariants(){return this._hideVariants=this._hideVariants||this.querySelectorAll(".product__media--variant").length>0}get gangOption(){if(this._gangOption)return this._gangOption;const mediaItemWithGang=this.sliderGallery.querySelector("[data-gang-option]");return mediaItemWithGang?this._gangOption=mediaItemWithGang.dataset.gangOption:!1}get photoswipe(){if(this._photoswipe)return this._photoswipe;const lightbox=new PhotoSwipeLightbox({arrowPrevSVG:'<svg class="pswp__icn icon" stroke="currentColor" fill="none" viewBox="0 0 30 30"><path d="M17.5 7.5L10 15L17.5 22.5"/></svg>',arrowNextSVG:'<svg class="pswp__icn icon" stroke="currentColor" fill="none" viewBox="0 0 30 30"><path d="M17.5 7.5L10 15L17.5 22.5"/></svg>',closeSVG:'<svg class="pswp__icn icon" stroke="currentColor" fill="none" viewBox="0 0 30 30"><path d="m7.5 22.5 15-15m-15 0 15 15"/></svg>',bgOpacity:1,pswpModule:()=>import(theme.settings.pswpModule),arrowPrevTitle:theme.strings.previous,arrowNextTitle:theme.strings.next,closeTitle:theme.strings.close,allowPanToNext:!1,allowMouseDrag:!0,wheelToZoom:!1,returnFocus:!0,zoom:!1});return lightbox.addFilter("thumbEl",(_thumbEl,data)=>data.thumbnailElement),lightbox.on("contentLoad",event=>{const{content}=event;console.log(event),(content.type==="video"||content.type==="external_video"||content.type==="model")&&(event.preventDefault(),content.element=document.createElement("div"),content.element.className="pswp__video-container",content.element.appendChild(content.data.domElement.cloneNode(!0)))}),lightbox.on("change",()=>{this.sliderGallery.select(lightbox.pswp.currIndex+1,!0)}),lightbox.on("close",()=>{const slideSelected=this.sliderGallery.selected(lightbox.pswp.currIndex);lightbox.pswp._lastActiveElement=slideSelected?slideSelected.querySelector("button"):document.activeElement}),lightbox.init(),this._photoswipe=lightbox}onVariantChanged(event){const currentVariant=event.detail.variant;if(!currentVariant.featured_media)return;const newMedia=this.sliderGallery.querySelector(`[data-media-id="${currentVariant.featured_media.id}"]`);newMedia!==null&&(this.gangOption&&(this.sliderGallery.items.forEach(item=>item.hidden=item.dataset.gangConnect!==newMedia.dataset.gangConnect),this.sliderGallery.reset(),this.sliderDots&&(this.sliderDots.items.forEach(item=>item.hidden=item.dataset.gangConnect!==newMedia.dataset.gangConnect),this.sliderDots.reset(),this.sliderDots.resetIndexe
18s(),this.sliderDots.transitionTo(1,!0))),this.setActiveMedia(currentVariant.featured_media.id,this.hideVariants),this.mediaPreview&&(this.sliderGallery.querySelectorAll("[data-media-id]").forEach(media=>media.classList.remove("xl:hidden")),this.mediaPreview.parentNode.replaceChild(newMedia.cloneNode(!0),this.mediaPreview),newMedia.classList.add("xl:hidden")),this.countMediaGallery())}onSlideChange(event){const activeMedia=event.detail.currentElement;this.playActiveMedia(activeMedia),this.viewInSpaceButton&&(activeMedia.getAttribute("data-media-type")==="model"?this.viewInSpaceButton.setAttribute("data-shopify-model3d-id",activeMedia.getAttribute("data-media-id")):this.viewInSpaceButton.setAttribute("data-shopify-model3d-id",this.viewInSpaceButton.getAttribute("data-shopify-model3d-default-id")))}setActiveMedia(mediaId,prepend){const activeMedia=this.sliderGallery.querySelector(`[data-media-id="${mediaId}"]`);if(prepend){if(activeMedia.parentElement.prepend(activeMedia),this.sliderGallery.reset(),this.sliderDots){const activeThumbnail=this.sliderDots.querySelector(`[data-media-id="${mediaId}"]`);activeThumbnail.parentElement.prepend(activeThumbnail),this.sliderDots.reset(),this.sliderDots.resetIndexes()}}else this.sliderGallery.select(this.sliderGallery.itemsToShow.indexOf(activeMedia)+1,!0);this.gangOption&&this.sliderGallery.select(1,!0)}playActiveMedia(activeMedia){if(typeof activeMedia>"u")return;const deferredMedia=activeMedia.querySelector(".deferred-media");this.sliderGallery.querySelectorAll(".deferred-media").forEach(media=>{deferredMedia===media?media.play():media.pause()})}pauseAllMedia(){this.sliderGallery.querySelectorAll("[data-media-id]").forEach((media,index)=>{if(index>0){const deferredMedia=media.querySelector(".deferred-media");deferredMedia&&typeof deferredMedia.pause=="function"&&deferredMedia.pause()}})}openZoom(index=0){let dataSource=this.sliderGallery.itemsToShow.map(media=>{const image=media.querySelector("img");if(media.dataset.mediaType==="image")return{thumbnailElement:image,src:image.src,srcset:image.srcset,msrc:image.currentSrc||image.src,width:parseInt(image.getAttribute("width")),height:parseInt(image.getAttribute("height")),alt:image.alt,thumbCropped:!0};if(media.dataset.mediaType==="video"||media.dataset.mediaType==="external_video"||media.dataset.mediaType==="model"){const video=media.querySelector(".deferred-media");return{thumbnailElement:image,domElement:video,type:media.dataset.mediaType,src:image.src,srcset:image.srcset,msrc:image.currentSrc||image.src,width:800,height:800/video.dataset.aspectRatio,alt:image.alt,thumbCropped:!0}}});if(this.mediaPreview&&this.mediaPreview.offsetParent&&this.mediaPreview.dataset.mediaType==="image"){const image=this.mediaPreview.querySelector("img");dataSource.push({thumbnailElement:image,src:image.src,srcset:image.srcset,msrc:image.currentSrc||image.src,width:parseInt(image.getAttribute("width")),height:parseInt(image.getAttribute("height")),alt:image.alt,thumbCropped:!0}),index===-1&&(index=dataSource.length-1)}this.photoswipe.loadAndOpen(index,dataSource)}countMediaGallery(){let mediaCount=0;this.sliderGallery.querySelectorAll("[data-media-id]").forEach(media=>{!media.classList.contains("xl:hidden")&&!media.hasAttribute("hidden")&&mediaCount++}),this.mediaPreview&&mediaCount++,mediaCount>1?this.classList.remove("with-only1"):this.classList.add("with-only1")}}customElements.define("media-gallery",MediaGallery);class MediaLightboxButton extends HTMLButtonElement{constructor(){super(),this.addEventListener("click",this.onButtonClick)}onButtonClick(){const media=this.closest("[data-media-id]"),sliderGallery=this.closest("slider-element"),openIndex=sliderGallery?sliderGallery.itemsToShow.indexOf(media):-1;this.dispatchEvent(new CustomEvent("lightbox:open",{bubbles:!0,detail:{index:openIndex}}))}}customElements.define("media-lightbox-button",MediaLightboxButton,{extends:"button"});class MediaHoverButton extends MediaLightboxButton{constructor(){super()}get zoomRatio(){return 2}onButtonClick(event){if(theme.config.isTouch)super.onButtonClick();else{const media=this.closest('[data-media-type="image"]');if(media){const image=media.querySelector("img");this.gallery=this.closest("slider-element"),this.magnify(image),this.moveWithHover(image,event)}}}createOverlay(image){const overlayImage=document.createElement("img");overlayImage.setAttribute("src",`${image.src}`);const overlay=document.createElement("media-hover-overlay");return this.prepareOverlay(overlay,overlayImage),this.toggleLoadingSpinner(image),overlayImage.onload=()=>{this.toggleLoadingSpinner(image),image.parentElement.insertBefore(overlay,image)},this.gallery&&this.gallery.classList.add("magnify"),overlay}prepareOverlay(container,image){container.setAttribute("class","media z-10 absolute top-0 left-0 w-full h-full"),container.setAttribute("aria-hidden","true"),container.style.backgroundImage=`url('${image.src}')`,container.style.cursor="zoom-out"}toggleLoadingSpinner(image){const loadingSpinner=image.parentElement;loadingSpinner.classList.toggle("loading"),loadingSpinner.classList.toggle("pointer-events-none")}moveWithHover(image,event){const ratio=image.height/image.width,container=event.target.getBoundingClientRect(),xPosition=event.clientX-container.left,yPosition=event.clientY-container.top,xPercent=`${xPosition/(image.clientWidth/100)}%`,yPercent=`${yPosition/(image.clientWidth*ratio/100)}%`;this.overlay.style.backgroundPosition=`${xPercent} ${yPercent}`,this.overlay.style.backgroundSize=`${image.width*this.zoomRatio}px`}magnify(image){this.overlay=this.createOverlay(image),this.overlay.onclick=()=>this.reset(),this.overlay.onmousemove=event=>this.moveWithHover(image,event),this.overlay.onmouseleave=()=>this.reset()}reset(){this.overlay.remove(),this.gallery&&this.gallery.classList.remove("magnify")}}customElements.define("media-hover-button",MediaHoverButton,{extends:"button"});class MediaDots extends SliderDots{constructor(){super(),theme.config.isTouch?new theme.initWhenVisible(this.resetIndexe
18s.bind(this)):Motion.inView(this,this.resetIndexes.bind(this))}resetIndexes(){let newIndex=1;this.itemsToShow.forEach((item,index)=>{item.setAttribute("data-index",newIndex),item.setAttribute("aria-current",index===0?"true":"false"),newIndex++})}}customElements.define("media-dots",MediaDots);class XModal extends ModalElement{constructor(){super()}get shouldLock(){return!0}get shouldAppendToBody(){return!0}}customElements.define("x-modal",XModal);class LogoList extends HTMLElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get childElement(){return this.firstElementChild}get speed(){return parseInt(this.dataset.speed||16)}get maximum(){return parseInt(this.dataset.maximum||Math.ceil(this.parentWidth/this.childElementWidth)+2)}get direction(){return this.dataset.direction||"left"}get parentWidth(){return this.getWidth(this)}get childElementWidth(){return this.getWidth(this.childElement)}disconnectedCallback(){this.marquee&&(this.pause(),this.marquee.destroy())}init(){if(this.childElementCount===1){this.childElement.classList.add("animate");for(let index=0;index<this.maximum;index++)this.clone=this.childElement.cloneNode(!0),this.clone.setAttribute("aria-hidden",!0),this.appendChild(this.clone),this.clone.querySelectorAll(".media").forEach(media=>media.classList.remove("loading"));theme.config.isTouch?this.style.setProperty("--duration",`${33-this.speed}s`):(this.marquee=new Flickity(this,{prevNextButtons:!1,pageDots:!1,wrapAround:!0,freeScroll:!0,rightToLeft:this.direction==="right"}),this.marquee.x=0,this.play(),this.addEventListener("mouseenter",this.pause),this.addEventListener("mouseleave",this.play))}}play(){this.marquee.x-=this.speed*.1,this.marquee.settle(this.marquee.x),this.requestId=requestAnimationFrame(this.play.bind(this))}pause(){this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=void 0)}getWidth(element){const rect=element.getBoundingClientRect();return rect.right-rect.left}}customElements.define("logo-list",LogoList);class TextScrolling extends HTMLElement{constructor(){super(),this.items.forEach(item=>{const header=item.querySelector(".heading");Motion.scroll(Motion.animate(header,{opacity:[0,0,1,1,1,0,0]}),{target:header,offsets:["33vh","66vh"]})})}get items(){return this._items=this._items||Array.from(this.children)}}customElements.define("text-scrolling",TextScrolling);class TabsElement extends HTMLElement{constructor(){super(),this.selectedIndex=this.selectedIndex,this.buttons.forEach((button,index)=>button.addEventListener("click",()=>this.selectedIndex=index)),Shopify.designMode&&this.addEventListener("shopify:block:select",event=>this.selectedIndex=this.buttons.indexOf(event.target))}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",Math.min(Math.max(index,0),this.buttons.length-1).toString())}get buttons(){return this._buttons=this._buttons||Array.from(this.querySelectorAll('button[role="tab"]'))}get indicators(){return this._indicators=this._indicators||Array.from(this.querySelectorAll(".indicators"))}attributeChangedCallback(name,oldValue,newValue){if(this.buttons.forEach((button,index)=>{button.classList.toggle("button--primary",index===parseInt(newValue)),button.classList.toggle("button--secondary",index!==parseInt(newValue)),button.disabled=index===parseInt(newValue)}),this.indicators.forEach((button,index)=>{button.hidden=index!==parseInt(newValue)}),name==="selected-index"&&oldValue!==null&&oldValue!==newValue){const fromButton=this.buttons[parseInt(oldValue)],toButton=this.buttons[parseInt(newValue)];this.transition(document.getElementById(fromButton.getAttribute("aria-controls")),document.getElementById(toButton.getAttribute("aria-controls")))}}async transition(fromPanel,toPanel){await Motion.animate(fromPanel,{transform:["translateY(0)","translateY(2rem)"],opacity:[1,0]},{duration:.15}).finished,fromPanel.hidden=!0,toPanel.hidden=!1,Motion.animate(toPanel,{transform:["translateY(2rem)","translateY(0)"],opacity:[0,1]},{duration:.15}).finished,toPanel.querySelector("motion-list")?.load()}}customElements.define("tabs-element",TabsElement);class CountdownTimer extends HTMLElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get date(){return this._date=this._date||new Date(`${this.dataset.month}/${this.dataset.day}/${this.dataset.year} ${this.dataset.hour}:${this.dataset.minute}:00 -04:00`)}get isCompact(){return this.dataset.compact==="true"||this.dataset.compact==="mobile"&&theme.config.mqlSmall}init(){this.calculate(),this.timerInterval=setInterval(this.calculate.bind(this),1e3)}calculate(){const now=new Date,countTo=new Date(this.date),timeDifference=countTo-now;if(timeDifference<0){this.complete();return}const secondsInADay=3600*1e3*24,secondsInAHour=3600*1e3,days=Math.floor(timeDifference/secondsInADay*1),hours=Math.floor(timeDifference%secondsInADay/secondsInAHour*1),mins=Math.floor(timeDifference%secondsInADay%secondsInAHour/(60*1e3)*1),secs=Math.floor(timeDifference%secondsInADay%secondsInAHour%(60*1e3)/1e3*1);if(this.isCompact){const dayHTML=days>0?`<div class="countdown__item"><p>${days}${theme.dateStrings.d}</p></div>`:"",hourHTML=`<div class="countdown__item"><p>${hours}${theme.dateStrings.h}</p></div>`,minHTML=`<div class="countdown__item"><p>${mins}${theme.dateStrings.m}</p></div>`,secHTML=`<div class="countdown__item"><p>${secs}${theme.dateStrings.s}</p></div>`;this.innerHTML=dayHTML+hourHTML+minHTML+secHTML}else{const dayHTML=days>0?`<div class="countdown__item"><p>${days}</p><span>${days===1?theme.dateStrings.day:theme.dateStrings.days}</span></div>`:"",hourHTML=`<div class="countdown__item"><p>${hours}</p><span>${hours===1?theme.dateStrings.hour:theme.dateStrings.hours}</span></div>`,minHTML=`<div class="countdown__item"><p>${mins}</p><span>${mins===1?theme.dateStrings.minute:theme.dateStrings.minutes}</span></div>`,secHTML=`<div class="countdown__item"><p>${secs}</p><span>${secs===1?theme.dateStrings.second:theme.dateStrings.seconds}</span></div>`;this.innerHTML=dayHTML+hourHTML+minHTML+secHTML}}complete(){this.timerInterval&&clearInterval(this.timerInterval),this.hidden=!0}}customElements.define("countdown-timer",CountdownTimer);class ImageComparison extends HTMLElement{constructor(){super(),this.isInitialized=!1,Motion.inView(this,async()=>{await theme.utils.imageLoaded(this.media),this.init()})}get button(){return this.querySelector("button")}get bounding(){return this.getBoundingClientRect()}get horizontal(){return this.dataset.layout==="horizontal"}get media(){return Array.from(this.querySelectorAll("img, svg"))}init(){this.isInitialized||(this.isInitialized=!0,this.active=!1,this.button.addEventListener("touchstart",this.startHandler.bind(this),theme.supportsPassive?{passive:!0}:!1),document.body.addEventListener("touchend",this.endHandler.bind(this),theme.supportsPassive?{passive:!0}:!1),document.body.addEventListener("touchmove",this.onHandler.bind(this),theme.supportsPassive?{passive:!0}:!1),this.button.addEventListener("mousedown",this.startHandler.bind(this)),document.body.addEventListener("mouseup",this.endHandler.bind(this)),document.body.addEventListener("mousemove",this.onHandler.bind(this)),setTimeout(()=>this.animate(),1e3))}reinit(){this.isInitialized=!1,this.init()}animate(){this.setAttribute("animate",""),this.classList.add("animating"),setTimeout(()=>{this.classList.remove("animating")},1e3)}startHandler(){this.active=!0,this.classList.add("scrolling")}endHandler(){this.active=!1,this.classList.remove("scrolling")}onHandler(e){if(!this.active)return;const event=e.touches&&e.touches[0]||e;let x=this.horizontal?event.pageX-(this.bounding.left+window.scrollX):event.pageY-(this.bounding.top+window.scrollY);this.scrollIt(x)}scrollIt(x){const distance=this.horizontal?this.clientWidth:this.clientHeight,max=distance-20,mousePercent=Math.max(20,Math.min(x,max))*100/distance;this.style.setProperty("--percent",mousePercent+"%")}}customElements.define("image-comparison",ImageComparison);class LookbookElement extends HTMLElement{constructor(){super(),Motion.inView(this,async()=>{await theme.utils.imageLoaded(this.media),this.init()})}get media(){return Array.from(this.querySelectorAll("img, svg"))}get items(){return this._items=this._items||Array.from(this.querySelectorAll(".hotspot"))}
18init(){if(this.items.forEach(item=>item.addEventListener("mouseenter",event=>this.select(this.items.indexOf(event.target)))),Shopify.designMode){const section=this.closest(".shopify-section");section.addEventListener("shopify:section:select",this.animate.bind(this)),section.addEventListener("shopify:section:deselect",this.closeAll.bind(this)),this.addEventListener("shopify:block:select",event=>this.open(this.items.indexOf(event.target)))}setTimeout(()=>this.animate(),1e3)}animate(){this.openAll(),setTimeout(()=>this.closeAll(),3e3)}open(selectedIndex){this.items.forEach((item,index)=>item.classList.toggle("active",selectedIndex===index))}openAll(){this.items.forEach(item=>item.classList.add("active"))}closeAll(){this.items.forEach(item=>item.classList.remove("active"))}select(selectedIndex){this.items.forEach((item,index)=>item.setAttribute("aria-current",selectedIndex===index?"true":"false")),this.dispatchEvent(new CustomEvent("lookbook:change",{bubbles:!0,detail:{index:selectedIndex}}))}}customElements.define("lookbook-element",LookbookElement);class ShopTheLook extends HTMLElement{constructor(){super(),this.lookbook.addEventListener("lookbook:change",event=>this.carousel.select(event.detail.index)),this.carousel.addEventListener("carousel:change",event=>this.lookbook.select(event.detail.index))}get lookbook(){return this.querySelector("lookbook-element")}get carousel(){return this.querySelector("carousel-element")}}customElements.define("shop-the-look",ShopTheLook);class SpinningText extends HTMLElement{constructor(){super(),theme.config.isTouch?new theme.initWhenVisible(this.init.bind(this)):Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get string(){let string=this.dataset.string;return string=string.replace(/ +/g," "),"\u2022"+string.replace(/ +/g,"\u2022")}init(){const canTrig=CSS.supports("(top: calc(sin(1) * 1px))"),OPTIONS={TEXT:this.string,SIZE:2,SPACING:2},HEADING=document.createElement("div"),chars=OPTIONS.TEXT.split("");this.style.setProperty("--char-count",chars.length);for(let c=0;c<chars.length;c++)HEADING.innerHTML+=`<span aria-hidden="true" class="split-char" style="--char-index: ${c};">${chars[c]}</span>`;HEADING.innerHTML+=`<span class="sr-only">${OPTIONS.TEXT}</span>`,HEADING.classList="split-chars",this.style.setProperty("--font-size",OPTIONS.SIZE),this.style.setProperty("--character-width",OPTIONS.SPACING),this.style.setProperty("--radius",canTrig?"calc((var(--character-width) / sin(var(--inner-angle))) * -1ch)":`calc( 19 (${OPTIONS.SPACING} / ${Math.sin(360/this.children.length/(180/Math.PI))}) 20 * -1ch 21 )`),this.appendChild(HEADING)}}customElements.define("spinning-text",SpinningText);class SlideshowElement extends HTMLElement{constructor(){super(),this.selectedIndex=this.selectedIndex,theme.config.isTouch?new theme.initWhenVisible(this.init.bind(this)):Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",Math.min(Math.max(index,0),this.items.length-1).toString())}get items(){return this._items=this._items||Array.from(this.children)}get autoplay(){return this.hasAttribute("autoplay")}get draggable(){return this.hasAttribute("draggable")}get speed(){return this.hasAttribute("autoplay")?parseInt(this.getAttribute("autoplay-speed"))*1e3:5e3}init(){const that=this;if(this.items.length>1){this.slider=new Flickity(this,{accessibility:!1,pageDots:!1,prevNextButtons:!1,fade:!0,wrapAround:!0,rightToLeft:theme.config.rtl,autoPlay:!1,draggable:this.draggable?">1":!1,on:{ready:function(){const{selectedElement}=this;that.onReady(selectedElement)}}});const slideDurations=Array.from(this.querySelectorAll(".banner")).map(cell=>parseInt(cell.getAttribute("data-duration"),10));let currentSlideIndex=0,autoplayTimer=null,remainingTime=null,isPaused=!1,startTime=null;if(this.autoplay){let startAutoplay2=function(){that.classList.remove("slideshow-paused"),clearTimeout(autoplayTimer);const duration=remainingTime!==null?remainingTime:slideDurations[currentSlideIndex];startTime=Date.now(),autoplayTimer=setTimeout(()=>
21{that.slider.next(),currentSlideIndex=that.slider.selectedIndex,remainingTime=null,startAutoplay2()},duration),isPaused=!1},stopAutoplay2=function(){if(that.classList.add("slideshow-paused"),!isPaused){if(clearTimeout(autoplayTimer),startTime){const elapsed=Date.now()-startTime;remainingTime=slideDurations[currentSlideIndex]-elapsed}isPaused=!0}};var startAutoplay=startAutoplay2,stopAutoplay=stopAutoplay2;this.slider.on("change",index=>{currentSlideIndex=index,remainingTime=null,startAutoplay2()}),that.addEventListener("mouseenter",stopAutoplay2),that.addEventListener("mouseleave",startAutoplay2),startAutoplay2()}this.slider.on("change",this.onChange.bind(this)),this.addEventListener("slider:previous",()=>this.slider.previous()),this.addEventListener("slider:next",()=>this.slider.next()),this.addEventListener("slider:play",()=>this.slider.playPlayer()),this.addEventListener("slider:pause",()=>this.slider.pausePlayer()),Shopify.designMode&&this.addEventListener("shopify:block:select",event=>this.slider.select(this.items.indexOf(event.target)))}else if(this.items.length===1){const selectedElement=this.firstChild;that.onReady(selectedElement)}that.items.forEach(item=>{let doubleImageNav=item.querySelectorAll(".banner__double-image .banner__double-image-navigation div");doubleImageNav.length>0&&doubleImageNav.forEach(nav=>{nav.addEventListener("click",function(){nav.parentElement.children.forEach(sib=>sib.classList.remove("active")),nav.classList.add("active");let index=parseInt(nav.dataset.index),side=nav.dataset.side;item.querySelectorAll(`.banner__double-image picture[data-index="${index}"]`).forEach(image=>{image.dataset.side==side?image.classList.add("active"):image.classList.remove("active")}),item.closest(".slideshow-container").children.forEach(sib=>{sib.classList.contains("slideshow-content")&&sib.querySelectorAll(".slideshow-word").forEach(word=>{console.log(parseInt(word.dataset.index)+" "+index),parseInt(word.dataset.index)===index&&(console.log("test"),word.children.forEach(sideword=>{sideword.dataset.side==side?sideword.classList.add("active"):sideword.classList.remove("active")}))})})})})})}disconnectedCallback(){this.slider&&this.slider.destroy()}attributeChangedCallback(name,oldValue,newValue){if(name==="selected-index"&&oldValue!==null&&oldValue!==newValue){const fromElement=this.items[parseInt(oldValue)],toElement=this.items[parseInt(newValue)];if(fromElement.dataset.type==="video"&&theme.utils.visibleMedia(fromElement.querySelectorAll("video-media"))?.pause(),toElement.dataset.type==="image-comparison"){toElement.querySelector("animate-element")?.refresh();const imageComparison=toElement.querySelector("image-comparison");imageComparison&&imageComparison.reinit()}toElement.dataset.type==="image"?toElement.querySelector("animate-element")?.refresh():theme.utils.visibleMedia(toElement.querySelectorAll("video-media"))?.play()}}onChange(){this.selectedIndex=this.slider.selectedIndex,this.dispatchEvent(new CustomEvent("slider:change",{bubbles:!0,detail:{currentPage:this.slider.selectedIndex}}))}select(selectedIndex){this.slider.select(selectedIndex)}onReady(selectedElement){if(!this.classList.contains("loaded")){this.classList.add("loaded");return}selectedElement.dataset.type==="video"&&theme.utils.visibleMedia(selectedElement.querySelectorAll("video-media"))?.play(),theme.config.isTouch||selectedElement.querySelector("animate-element")?.refresh()}}customElements.define("slideshow-element",SlideshowElement);class SlideshowWords extends HTMLElement{constructor(){super(),this.selectedIndex=this.selectedIndex,this.controlledElement&&this.controlledElement.addEventListener("slider:change",event=>this.selectedIndex=event.detail.currentPage)}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",Math.min(Math.max(index,0),this.items.length-1).toString())}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get items(){return this._items=this._items||Array.from(this.children)}attributeChangedCallback(name,oldValue,newValue){name==="selected-index"&&oldValue!==null&&oldValue!==newValue&&this.transition(this.items[parseInt(oldValue)],this.items[parseInt(newValue)])}
21transition(fromElement,toElement){this.items.forEach(item=>{item.setAttribute("aria-current",parseInt(item.dataset.index)===parseInt(this.selectedIndex)?"true":"false"),Motion.animate(item.children,{y:[50,0],opacity:[0,1],visibility:["hidden","visible"]},{duration:.5})})}}customElements.define("slideshow-words",SlideshowWords);class ControlButton extends HTMLButtonElement{constructor(){super(),this.addEventListener("click",this.onClick)}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get paused(){return this.hasAttribute("paused")}static get observedAttributes(){return["paused"]}attributeChangedCallback(name,oldValue,newValue){if(name==="paused"){if(oldValue===null&&newValue==="")return(this.controlledElement??this).dispatchEvent(new CustomEvent("slider:pause",{bubbles:!0}));if(newValue===null)return(this.controlledElement??this).dispatchEvent(new CustomEvent("slider:play",{bubbles:!0}))}}onClick(){this.paused?this.removeAttribute("paused"):this.setAttribute("paused","")}}customElements.define("control-button",ControlButton,{extends:"button"});class QuickView extends XModal{constructor(){super()}get selector(){return".quick-view__content"}beforeShow(){super.beforeShow(),this.quickview()}afterShow(){super.afterShow(),document.dispatchEvent(new CustomEvent("quickview:open",{detail:{productUrl:this.dataset.productUrl}}))}afterHide(){super.afterHide();const drawerContent=this.querySelector(this.selector);drawerContent.innerHTML=""}quickview(){const drawerContent=this.querySelector(this.selector),sectionUrl=`${this.dataset.productUrl.split("?")[0]}?view=modal`;fetch(sectionUrl).then(response=>response.text()).then(responseText=>{setTimeout(()=>{const productElement=new DOMParser().parseFromString(responseText,"text/html").querySelector(this.selector);this.setInnerHTML(drawerContent,productElement.innerHTML),theme.a11y.trapFocus(this,this.focusElement),window.Shopify&&Shopify.PaymentButton&&Shopify.PaymentButton.init(),document.dispatchEvent(new CustomEvent("quickview:loaded",{detail:{productUrl:this.dataset.productUrl}}))},200)}).catch(e=>{console.error(e)})}setInnerHTML(element,innerHTML){element.innerHTML=innerHTML,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)})}}customElements.define("quick-view",QuickView);class StickyBuyButton extends HTMLElement{constructor(){if(super(),this.scopeFrom=document.getElementById(this.getAttribute("form")),this.scopeTo=document.querySelector(".footer_bottom"),!this.scopeFrom||!this.scopeTo)return;const intersectionObserver=new IntersectionObserver(this.handleIntersection.bind(this));intersectionObserver.observe(this.scopeFrom),intersectionObserver.observe(this.scopeTo)}handleIntersection(entries){entries.forEach(entry=>{entry.target===this.scopeFrom&&(this.scopeFromPassed=entry.boundingClientRect.bottom<0),entry.target===this.scopeTo&&(this.scopeToReached=entry.isIntersecting)}),this.scopeFromPassed&&!this.scopeToReached?Motion.animate(this,{opacity:1,visibility:"visible",transform:["translateY(15px)","translateY(0)"]},{duration:1,easing:[.16,1,.3,1]}):Motion.animate(this,{opacity:0,visibility:"hidden",transform:["translateY(0)","translateY(15px)"]},{duration:1,easing:[.16,1,.3,1]})}}customElements.define("sticky-buy-button",StickyBuyButton);class StickyVariantMedia extends HTMLElement{constructor(){super(),this.onVariantChangedListener=this.onVariantChanged.bind(this)}get productForm(){return document.forms[this.getAttribute("form")]}get image(){return this._image=this._image||this.querySelector("img")}get widths(){return this.getAttribute("widths").split(",").map(width=>parseInt(width))}connectedCallback(){(this.productForm??document).addEventListener("variant:change",this.onVariantChangedListener)}disconnectedCallback(){(this.productForm??document).removeEventListener("variant:change",this.onVariantChangedListener)}onVariantChanged(event){const currentVariant=event.detail.variant;if(!currentVariant.featured_media)return;const image=new Image(currentVariant.featured_media.preview_image.width,currentVariant.featured_media.preview_image.height);image.alt=currentVariant.featured_media.alt,image.src=currentVariant.featured_media.preview_image.src,image.srcset=this.generateSrcset(currentVariant.featured_media.preview_image),image.sizes=this.image.sizes,this.replaceChildren(image)}generateSrcset(image){return this.widths.filter(width=>width<=image.width).map(width=>`${image.src}&width=${width} ${width}w`).join(", ")}}customElements.define("sticky-variant-media",StickyVariantMedia);class StickyVariantTitle extends HTMLElement{constructor(){super(),this.onVariantChangedListener=this.onVariantChanged.bind(this)}
21get productForm(){return document.forms[this.getAttribute("form")]}connectedCallback(){(this.productForm??document).addEventListener("variant:change",this.onVariantChangedListener)}disconnectedCallback(){(this.productForm??document).removeEventListener("variant:change",this.onVariantChangedListener)}onVariantChanged(event){const currentOptions=this.dataset.options,currentVariant=event.detail.variant.title,parts1=currentOptions.split("/").map(s=>s.trim()),parts2=currentVariant.split("/").map(s=>s.trim());let html="";for(let i=0;i<parts1.length;i++){const className=`sticky-option-${parts1[i].toLowerCase()}`;html+=`<div class="${className} flex gap-1"><span>${parts1[i]}:</span><span class="color-light">${parts2[i]}</span></div>`}this.innerHTML=html,document.querySelector("sticky-buy-button").classList.add("variant-selected")}}customElements.define("sticky-variant-title",StickyVariantTitle);class FiltersToggle extends HoverButton{constructor(){if(super(),this.addEventListener("click",this.onClick),theme.config.hasLocalStorage){const expanded=window.localStorage.getItem(`${theme.settings.themeName}:filters-toogle`)||"false";this.onToggle(expanded==="true")}}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get expanded(){return this.getAttribute("aria-expanded")==="true"}onClick(){this.onToggle(this.expanded)}onToggle(expanded){this.setAttribute("aria-expanded",expanded?"false":"true"),this.controlledElement&&this.controlledElement.classList.toggle("xl:block",!expanded),theme.config.hasLocalStorage&&window.localStorage.setItem(`${theme.settings.themeName}:filters-toogle`,expanded)}}customElements.define("filters-toogle",FiltersToggle,{extends:"button"}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".enhanced-collections-section").forEach(section=>{const slider=section.querySelector(".enhanced-collections-slider"),btnPrev=section.querySelector(".enhanced-collections-arrow-left"),btnNext=section.querySelector(".enhanced-collections-arrow-right");if(!slider||!btnPrev||!btnNext)return;const updateArrows=()=>{const maxScroll=slider.scrollWidth-slider.clientWidth;if(maxScroll<=0){btnPrev.style.display="none",btnNext.style.display="none";return}btnPrev.style.display="flex",btnNext.style.display="flex",btnPrev.style.opacity=slider.scrollLeft<=0?"0.3":"1",btnNext.style.opacity=slider.scrollLeft>=maxScroll-2?"0.3":"1"},scrollAmount=()=>{const item=slider.querySelector(".enhanced-collections-item");return item?item.offsetWidth*2:200};btnPrev.addEventListener("click",()=>{slider.scrollLeft-=scrollAmount()}),btnNext.addEventListener("click",()=>{slider.scrollLeft+=scrollAmount()}),slider.addEventListener("scroll",updateArrows),window.addEventListener("resize",updateArrows),updateArrows();const active=slider.querySelector(".active-collection-item");if(active){const left=active.offsetLeft-slider.offsetLeft*2;slider.scrollLeft=left}})}),document.addEventListener("DOMContentLoaded",function(){window.location.href.indexOf("cart-drawer-open")>0&&document.querySelector(".cart-drawer-button").click()}),document.addEventListener("DOMContentLoaded",function(){var homepageCallouts=document.querySelectorAll(".callouts-section .callouts");homepageCallouts.forEach(callouts=>{callouts!=null&&(homepageCalloutsSlider=new Flickity(callouts,{pageDots:!0,prevNextButtons:!1,watchCSS:!0,wrapAround:!0,autoPlay:3e3,cellAlign:"left",on:{ready:function(){setTimeout(()=>this.element.setAttribute("loaded",""))}}}))})}),document.addEventListener("DOMContentLoaded",function(){var contentBlocksContainers=document.querySelectorAll(".content-blocks-container");contentBlocksContainers.forEach(contentBlocks=>{let options={pageDots:!1,prevNextButtons:!1,cellAlign:window.innerWidth>767?"center":"left",wrapAround:window.innerWidth>767,contain:window.innerWidth<=767,on:{ready:function(){setTimeout(()=>this.element.setAttribute("loaded",""))}}};new Flickity(contentBlocks,options)})});function rivoReload(){let rivoAccountWidget=document.getElementById("rivo-account-slideout");rivoAccountWidget&&RivoProfileAlpine.$data(rivoAccountWidget).initializeFavoriteButtons()}function collectionColorSwatches(el){document.querySelectorAll(el).forEach(swatches=>{const swatchList=swatches,colorSwatches=swatches.querySelectorAll(".color-swatch-custom"),activeSwatch=swatches.querySelector(".color-swatch-custom.active-swatch"),activeIndex=Array.from(colorSwatches).indexOf(activeSwatch),leftArrow=swatches.previousElementSibling,rightArrow=swatches.nextElementSibling,visibleSwatches=6,scrollStep=150;function easeOutQuad(t){return t*(2-t)}
21function smoothScroll(targetScrollLeft){const startScrollLeft=swatches.scrollLeft,distance=targetScrollLeft-startScrollLeft,duration=500;let startTime=null;function step(timestamp){startTime||(startTime=timestamp);const elapsed=timestamp-startTime,progress=Math.min(elapsed/duration,1),easedProgress=easeOutQuad(progress);swatches.scrollLeft=startScrollLeft+distance*easedProgress,progress<1&&requestAnimationFrame(step)}requestAnimationFrame(step)}function updateArrows(){const maxScrollLeft=swatches.scrollWidth-swatches.clientWidth;leftArrow.disabled=swatches.scrollLeft<=0,rightArrow.disabled=swatches.scrollLeft>=maxScrollLeft}leftArrow.addEventListener("click",()=>{const targetScrollLeft=swatches.scrollLeft-scrollStep;smoothScroll(targetScrollLeft)}),rightArrow.addEventListener("click",()=>{const targetScrollLeft=swatches.scrollLeft+scrollStep;smoothScroll(targetScrollLeft)}),swatches.addEventListener("scroll",updateArrows),updateArrows(),colorSwatches.forEach(swatch=>{swatch.addEventListener("mouseenter",()=>{swatch.closest(".color-swatches").classList.contains("ajax-updated")?swatch.classList.contains("ajax-active")||(swatch.style.width="26px",swatch.style.borderRadius="14px",swatch.closest(".color-swatches").querySelector(".ajax-active").style.width="14px",swatch.closest(".color-swatches").querySelector(".ajax-active").style.borderRadius="50%"):swatch!==activeSwatch&&(swatch.style.width="26px",swatch.style.borderRadius="14px",activeSwatch.style.width="14px",activeSwatch.style.borderRadius="50%")}),swatch.addEventListener("mouseleave",()=>{swatch.closest(".color-swatches").classList.contains("ajax-updated")?swatch.classList.contains("ajax-active")||(swatch.style.width="14px",swatch.style.borderRadius="50%",swatch.closest(".color-swatches").querySelector(".ajax-active").style.width="26px",swatch.closest(".color-swatches").querySelector(".ajax-active").style.borderRadius="14px"):swatch!==activeSwatch&&(swatch.style.width="14px",swatch.style.borderRadius="50%",activeSwatch.style.width="26px",activeSwatch.style.borderRadius="14px")}),swatch.addEventListener("click",()=>{colorSwatches.forEach(swatch2=>{swatch2.classList.remove("ajax-active")}),swatch.classList.add("ajax-active"),swatch.closest(".color-swatches").classList.add("ajax-updated");var url=swatch.getAttribute("data-url").split("?")[0]+"?view=grid-ajax",product=swatch.closest(".product-card"),swatchesSelector=`.product-card[data-product-id="${product.dataset.productId}"] .color-swatches`,xhr=new XMLHttpRequest;xhr.open("GET",url,!0),xhr.onload=function(){if(xhr.status>=200&&xhr.status<400){var data=xhr.responseText,tempDiv=document.createElement("div");tempDiv.innerHTML=data;var newMedia=tempDiv.querySelector(".product-card__media"),newTitle=tempDiv.querySelector(".product-card__content .product-card__title"),newSwatchTitle=tempDiv.querySelector(".product-card__content .color-swatches-title"),newRivoBtn=tempDiv.querySelector(".product-card__content rivo-favorite-button"),newMobileQuickAddTrigger=tempDiv.querySelector(".product-card__content .mobile-quick-view-trigger"),newPrice=tempDiv.querySelector(".product-card__content .price"),productMedia=product.querySelector(".product-card__media"),productTitle=product.querySelector(".product-card__content .product-card__title"),swatchTitle=product.querySelector(".product-card__content .color-swatches-title"),rivoBtn=product.querySelector(".product-card__content rivo-favorite-button"),mobileQuickAddTrigger=product.querySelector(".product-card__content .mobile-quick-view-trigger"),price=product.querySelector(".product-card__content .price");newMedia&&productMedia&&(productMedia.innerHTML=newMedia.innerHTML),newPrice&&price&&(price.innerHTML=newPrice.innerHTML),newTitle&&productTitle&&(productTitle.innerHTML=newTitle.innerHTML),newRivoBtn&&rivoBtn&&rivoBtn.setAttribute("data-product-id",newRivoBtn.getAttribute("data-product-id")),newMobileQuickAddTrigger&&mobileQuickAddTrigger&&mobileQuickAddTrigger.setAttribute("aria-controls-trigger",newMobileQuickAddTrigger.getAttribute("aria-controls-trigger")),newSwatchTitle&&swatchTitle&&(swatchTitle.innerHTML=newSwatchTitle.innerHTML),productCardAtc(),rivoReload()}},xhr.send()})})})}collectionColorSwatches(".color-swatches"),document.addEventListener("click",function(e){const trigger=e.target.closest(".mobile-quick-view-trigger");if(!trigger)return;const controlsValue=trigger.getAttribute("aria-controls-trigger");if(!controlsValue)return;const productCard=trigger.closest(".product-card");if(!productCard)return;const matchingButton=productCard.querySelector(`.quick-view__button[aria-controls="${controlsValue}"]`);matchingButton&&matchingButton.click()});
21function stylesColorwaysToggle(){const stylesColorwaysFilter=document.querySelector(".filter-type-main-style-color input");if(!stylesColorwaysFilter)return;let container=document.querySelector(".styles-colorways-toggle-container");if(container){const clonedContainer=container.cloneNode(!0);container.parentNode.replaceChild(clonedContainer,container),container=clonedContainer,container.addEventListener("click",()=>{const isNowStyles=!container.classList.contains("toggle-active-styles");applyToggle(isNowStyles)})}const toggleGroups=document.querySelectorAll(".styles-colorways-toggle");toggleGroups.forEach(group=>{group.querySelectorAll("[data-toggle]").forEach(button=>{const clonedButton=button.cloneNode(!0);button.parentNode.replaceChild(clonedButton,button),clonedButton.addEventListener("click",()=>{const isStyles=clonedButton.getAttribute("data-toggle")==="styles";applyToggle(isStyles)})})});function applyToggle(isStyles){container&&container.classList.toggle("toggle-active-styles",isStyles),toggleGroups.forEach(group=>{group.classList.toggle("toggle-active-styles",isStyles)}),stylesColorwaysFilter.checked!==isStyles&&stylesColorwaysFilter.click()}const sortItems=document.querySelectorAll(".sort-dropdown li[data-value]");if(!sortItems.length)return;sortItems.forEach(item=>{item.addEventListener("click",()=>{const selectedValue=item.getAttribute("data-value"),input=document.querySelector(`#SortBy-${selectedValue}`);input&&!input.checked&&(input.checked=!0,input.dispatchEvent(new Event("change",{bubbles:!0}))),sortItems.forEach(i=>{i.classList.toggle("active",i.getAttribute("data-value")===selectedValue)})})});const sortMobileDrawerItems=document.querySelectorAll("#SortDrawer .sort-listbox input");sortMobileDrawerItems.length>0&&sortMobileDrawerItems.forEach(item=>{item.addEventListener("change",()=>{document.querySelector('button[aria-controls="SortDrawer"]').click()})})}stylesColorwaysToggle();var layoutButtons=document.querySelectorAll(".collection__layout-button");if(layoutButtons.length){let layoutButtonsMobile=document.querySelectorAll(".collection__layout-button-mobile");layoutButtons.forEach(function(button){button.addEventListener("click",function(){var newLayoutMode=this.getAttribute("data-layout-mode");document.getElementById("ProductGridContainer").setAttribute("data-grid-layout",newLayoutMode);let event=new Event("layout-change");document.dispatchEvent(event),document.querySelectorAll("secondary-media").forEach(function(el){el.dispatchEvent(event)});const scrollTarget=document.querySelector(".collection__content");scrollTarget&&scrollTarget.scrollIntoView({behavior:"smooth",block:"start"}),Motion.animate(document.getElementById("ProductGridContainer").querySelectorAll(".grid"),{y:[50,0],opacity:[0,1],visibility:["hidden","visible"]},{duration:.5,delay:theme.config.motionReduced?0:Motion.stagger(.01)}),layoutButtons.forEach(function(btn){btn.classList.remove("is-selected")}),this.classList.add("is-selected"),layoutButtonsMobile.forEach(function(btn){newLayoutMode==btn.dataset.layoutMode?btn.classList.add("is-selected"):btn.classList.remove("is-selected")})})}),layoutButtonsMobile.forEach(function(btn){btn.addEventListener("click",function(){let target=btn.dataset.target;console.log(target),document.querySelector(`.collection__layout-button[data-layout-mode="${target}"]`).click()})})}function productCardAtc(){document.addEventListener("click",function(event){const productInput=event.target.closest(".product-grid-option input"),gridInput
21=event.target.closest(".product-grid-option-values input");if(productInput){checkOptionsSelected(productInput);const wrapper=productInput.closest(".collection-variants"),optionName=productInput.getAttribute("name").split("-")[0],optionValue=productInput.value;updateAvailableOptions(wrapper,optionName,optionValue)}if(gridInput){const form=gridInput.closest(".collection-variants"),mainSelector=form.querySelector(".product-grid-main-selector"),atcButton=form.querySelector("button");let currentValue="";const radioSelectors=form.querySelectorAll(".product-grid-option-values");radioSelectors.forEach((selector,index)=>{if(selector.dataset.optionName==="color"){const firstInput=selector.querySelector("input:first-child");firstInput&&(firstInput.checked=!0)}const checkedInput=selector.querySelector("input:checked");checkedInput&&(currentValue+=checkedInput.value),index!==radioSelectors.length-1&&(currentValue+=" / ")});const selectedOption=mainSelector.querySelector(`option[data-title="${currentValue}"]`);updateAtcButton(selectedOption,atcButton)}});function checkOptionsSelected(element){const wrapper=element.closest(".collection-variants"),atcContainer=wrapper.querySelector(".product-atc-container"),productInputs=wrapper.querySelectorAll(".product-grid-option");let unselectedOptions;productInputs.forEach(inputContainer=>{const checkedOption=inputContainer.querySelector("input:checked"),optionName=inputContainer.dataset.option;checkedOption||(wrapper.querySelector(".collection-atc-submit").innerHTML=="Select "+optionName,wrapper.querySelector(".collection-atc-submit").classList.add(optionName))})}function updateAvailableOptions(wrapper,optionName,optionValue){const availableOptions=wrapper.querySelector(".product-atc-container").dataset.options.split(","),inputSelector=optionName==="Size"?'input[name^="Length"]':'input[name^="Size"]';wrapper.querySelectorAll(`.product-grid-option ${inputSelector}`).forEach(input=>{const option=optionName==="Size"?`${optionValue} - ${input.value}`:`${input.value} - ${optionValue}`;input.classList.toggle("disabled",!availableOptions.includes(option))})}function updateAtcButton(selectedOption,atcButton){const wrapper=atcButton.closest(".collection-variants"),atcContainer=wrapper.querySelector(".product-atc-container"),productInputs=wrapper.querySelectorAll(".product-grid-option");let buttonText="",unselectedVariants=0;productInputs.forEach(inputContainer=>{const checkedOption=inputContainer.querySelector("input:checked"),optionName=inputContainer.dataset.option;checkedOption||(unselectedVariants++,buttonText="Select "+optionName)}),unselectedVariants>0&&buttonText!=""?(atcButton.textContent=buttonText,atcButton.disabled=!0):selectedOption?(atcButton.dataset.variantId=selectedOption.value,atcButton.nextElementSibling.value=selectedOption.value,selectedOption.selected=!0,selectedOption.dataset.availability==="true"?(atcButton.textContent="Add to Cart",atcButton.disabled=!1):(atcButton.textContent="Sold Out",atcButton.disabled=!0)):(atcButton.textContent="Unavailable",atcButton.disabled=!0)}var collectionAtcBlock=document.querySelectorAll(".collection-atc");collectionAtcBlock.forEach(el=>{el.addEventListener("mouseover",()=>{el.closest(".product-card").classList.add("atc-form-visible")}),el.addEventListener("mouseleave",()=>{el.closest(".product-card").classList.remove("atc-form-visible")})})}productCardAtc(),document.addEventListener("collection:reloaded",function(){productCardAtc(),stylesColorwaysToggle(),collectionColorSwatches(".color-swatches")}),document.addEventListener("recentlyViewed:loaded",function(){productCardAtc(),collectionColorSwatches(".color-swatches"),rivoReload()}),document.addEventListener("recommendations:loaded",function(){productCardAtc(),collectionColorSwatches(".color-swatches"),rivoReload()}),document.addEventListener("status:loaded",event=>{var statusCollections=window.StatusAccounts.collections;for(const[key,value]of Object.entries(statusCollections)){var widgetId=key,statusWidget=document.querySelector(`.status-shopping-block[type="${key}"]`);if(statusWidget!==null){let statusProducts=value.map(item=>item.productId);if(statusProducts.length>0){var statusText={recentlyViewed:"Recently Viewed Products",popularToday:"Popular Products",savedFromCart:"Products Saved From Cart",wishlist:"Wishlist Products"},statusProductsHeading=document.createElement("div");statusProductsHeading.className="status-products-heading status-products-heading title-wrapper leading-none heading title-lg",statusProductsHeading.innerHTML=statusText[key],document.querySelector(`.status-shopping-block[type="${key}"]`).parentNode.appendChild(statusProductsHeading);let statusProductsContainer=document.createElement("div");statusProductsContainer.className=`card-grid card-grid--4 mobile:card-grid--2 grid relative status-widget-${key}`,document.querySelector(`.status-shopping-block[type="${key}"]`).parentNode.appendChild(statusProductsContainer);async function getProductsByIds(ids){const search=encodeURI(ids.map(id=>`id:${id}`).join(" OR "));await fetch(`/search?q=${search}&type=product&view=grid-ajax`).then(response=>response.text()).then(html=>{statusProductsContainer.innerHTML=html;var statusProductIndex=0;statusProductsContainer.querySelectorAll(".product-card").forEach(product=>{for(var index=statusProductIndex++,statusProductInputs=product.querySelectorAll(".product-grid-option-values input"),statusProductLabels=product.querySelectorAll(".product-grid-option-values label"),totalItems=Math.min(statusProductInputs.length,statusProductLabels.length),i=0;i<totalItems;i++){var input=statusProductInputs[i],label=statusProductLabels[i],suffix="-"+widgetId+"-"+index;input.setAttribute("name",(input.getAttribute("name")||"")+suffix),input.setAttribute("id",(input.getAttribute("id")||"")+suffix),label.setAttribute("for",(label.getAttribute("for")||"")+suffix)}})}).then(html=>{collectionColorSwatches(".status-shopping-block-section .color-swatches"),productCardAtc()})}getProductsByIds(statusProducts)}}}});let init=()=>{var statusButton=document.querySelectorAll(".status-favorite-button");console.log(window.StatusAccounts.wishlist),statusButton.forEach(button=>{let productId=button.dataset.productId,productTitle=button.dataset.productTitle;const productIds=window.StatusAccounts.wishlist,productIdSet=new Set(productIds);let isActive=window.StatusAccounts.wishlist.includes(productId);productIdSet.has(productId)?button.classList.add("active"):button.classList.remove("active")}),statusButton.forEach(button=>{button.addEventListener("click",()=>{let favorites=window.StatusAccounts.wishlist,productId=button.dataset.productId;if(button.classList.contains("active")){button.classList.remove("active");
21let browserEvent=new CustomEvent("status:item:remove",{detail:{productId,triggerToast:!0}});document.dispatchEvent(browserEvent)}else{button.classList.add("active");let browserEvent=new CustomEvent("status:item:save",{detail:{productId,triggerToast:!0}});document.dispatchEvent(browserEvent)}})})};window.StatusAccounts?.customer?init():document.addEventListener("status:loaded",event=>{init()});let additionalDetailsTrigger=document.querySelectorAll(".additional-details-trigger");additionalDetailsTrigger.length>0&&additionalDetailsTrigger.forEach(trigger=>{trigger.addEventListener("click",()=>{trigger.closest(".additional-details-container").classList.toggle("active")})});let filterTrigger=document.querySelectorAll(".collection__topbar .filter-trigger");filterTrigger.length>0&&filterTrigger.forEach(trigger=>{trigger.addEventListener("click",()=>{document.querySelectorAll(".facet-form .details").forEach(filter2=>{filter2.open=!1});let filter=trigger.dataset.filter;setTimeout(function(){let filterDropdown=document.querySelector(`.facet-form .filter-type-${filter}`);filterDropdown!==null&&(document.querySelector(".facet-drawer .drawer__scrollable").scrollTo({top:filterDropdown.offsetTop,behavior:"instant"}),filterDropdown.open=!0)},400)})});function stickyAtcAnchor(){let stickyATC=document.querySelector(".sticky-atc");stickyATC?.addEventListener("click",()=>{const scrollTarget=document.querySelector(".product-content-form");scrollTarget&&scrollTarget.scrollIntoView({behavior:"smooth",block:"start"})})}document.addEventListener("DOMContentLoaded",()=>{stickyAtcAnchor()});function productDescription(){let descriptionTrigger=document.querySelector(".description-trigger-desktop");descriptionTrigger!=null&&(descriptionTrigger.addEventListener("click",()=>{descriptionTrigger.closest(".product__info").classList.toggle("description-modal-active"),document.querySelector("body").classList.toggle("has-modal-open")}),document.querySelector(".desktop-description-overlay").addEventListener("click",function(){descriptionTrigger.closest(".product__info").classList.remove("description-modal-active"),document.querySelector("body").classList.remove("has-modal-open")}));const descriptionBlocks=document.querySelectorAll(".description-block-trigger details");descriptionBlocks.length>0&&descriptionBlocks.forEach(detail=>{detail.addEventListener("click",()=>{detail.open&&descriptionBlocks.forEach(other=>{other!==detail&&(other.open=!1)}),setTimeout(()=>{const container=detail.closest(".product-content-description-info");Array.from(container.querySelectorAll(".description-block-trigger details")).some(d=>d.open)?container.classList.add("accordion-open"):container.classList.remove("accordion-open")},0)})})}document.addEventListener("DOMContentLoaded",()=>{productDescription()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".pillars-inner-nav .pillars-nav-button").forEach(button=>{button.addEventListener("click",()=>{const parentContainer=button.closest(".slideshow-container"),heading=button.dataset.heading||"",subheading=button.dataset.subheading||"",buttonText=button.dataset.btn||"",buttonUrl=button.dataset.url||"",videoUrl=button.dataset.video||"",index=button.closest(".banner").getAttribute("data-index"),windowWidth=window.innerWidth;let imageUrl=button.dataset.image||"",imageLeftUrl=button.dataset.imageLeft||"",imageRightUrl=button.dataset.imageRight||"";window.innerWidth<500&&(imageUrl=imageUrl.replace("_1000x","_500x"),imageLeftUrl=imageLeftUrl.replace("_1000x","_500x"),imageRightUrl=imageRightUrl.replace("_1000x","_500x"));const wordElement=parentContainer.querySelector(`.slideshow-word[data-index="${index}"]`),drawerContainer=parentContainer.querySelector(`.pillars-modal[data-index="${index}"]`),drawerTrigger=parentContainer.querySelector(`.pillars-modal-button[data-index="${index}"]`);if(button.classList.contains("pillars-size-trigger")){const size=button.dataset.size,imageWithSizesContainer=button.closest(".image-with-sizes");if(button.classList.contains("active")?(button.classList.remove("active"),imageWithSizesContainer.classList.remove("size-active"),imageWithSizesContainer.dataset.size=""):(parentContainer.querySelectorAll(".banner .pillars-size-trigger").forEach(btn=>{btn.classList.remove("active")}),imageWithSizesContainer.classList.add("size-active"),imageWithSizesContainer.dataset.size=button.dataset.size,button.classList.add("active")),wordElement){if(heading||subheading){const textAnimateEl=wordElement.closest("slideshow-words");Motion.animate(textAnimateEl,{y:[50,0],opacity:[0,1],visibility:["hidden","visible"]},{duration:.5})}const headingElement=wordElement.querySelector(".heading");headingElement&&heading&&(headingElement.innerHTML=heading);const subheadingElement=wordElement.querySelector(".subheading");subheadingElement&&subheading&&(subheadingElement.innerHTML=subheading);const buttonElement=wordElement.querySelector(".button .btn-text");buttonElement&&buttonText&&(buttonElement.innerHTML=buttonText);const buttonLink=wordElement.querySelector(".button");buttonLink&&buttonUrl&&(buttonLink.setAttribute("href",buttonUrl),buttonText==""?buttonLink.classList.add("hide-button"):buttonLink.classList.remove("hide-button"))}}else{if(parentContainer.querySelectorAll(".banner .pillars-drawer-trigger").forEach(btn=>{btn.classList.remove("active")}),button.classList.contains("pillars-gender-toggle")&&(parentContainer.querySelectorAll(".banner .pillars-nav-button").forEach(btn=>{btn.classList.remove("active")}),button.classList.contains("pillars-gender-women")?button.closest(".pillars-inner-nav").classList.add("gender-active-women"):button.closest(".pillars-inner-nav").classList.remove("gender-active-women"),button.classList.contains("pillars-gender-toggle-size-block")&&(button.closest(".image-with-sizes").classList.remove("size-active"),button.closest(".image-with-sizes").dataset.size="")),button.classList.add("active"),wordElement){if(heading||subheading){const textAnimateEl=wordElement.closest("slideshow-words");Motion.animate(textAnimateEl,{y:[50,0],opacity:[0,1],visibility:["hidden","visible"]},{duration:.5})}const headingElement=wordElement.querySelector(".heading");headingElement&&heading&&(headingElement.innerHTML=heading);const subheadingElement=wordElement.querySelector(".subheading");subheadingElement&&subheading&&(subheadingElement.innerHTML=subheading);const buttonElement=wordElement.querySelector(".button .btn-text");buttonElement&&buttonText&&(buttonElement.innerHTML=buttonText);const buttonLink=wordElement.querySelector(".button");buttonLink&&buttonUrl&&(buttonLink.setAttribute("href",buttonUrl),buttonText==""?buttonLink.classList.add("hide-button"):buttonLink.classList.remove("hide-button"))}const videoMediaElement=parentContainer.querySelector(".pillars-video video-media"),videoMediaElementIframe=videoMediaElement.querySelector("iframe");
21if(videoUrl!="")videoMediaElementIframe&&(videoMediaElementIframe.src=`https://player.vimeo.com/video/${videoUrl}?autopause=1&background=1&autoplay=1&muted=1&loop=1&transparent=0&responsive=1&portrait=0&title=0&byline=0`,videoMediaElement.playerTarget().then(player=>{parentContainer.classList.add("pillars-video-active")}));else if(imageLeftUrl!=""&&imageRightUrl!=""){parentContainer.classList.remove("pillars-video-active");const mediaElementLeft=parentContainer.querySelector(".comparison__before img"),mediaElementRight=parentContainer.querySelector(".comparison__after img");if(mediaElementLeft&&mediaElementRight){const imageAnimateEl=mediaElementLeft.closest("animate-element"),newImageLeft=new Image;newImageLeft.src=imageLeftUrl;const newImageRight=new Image;newImageRight.src=imageRightUrl,newImageRight.onload=()=>{mediaElementLeft.setAttribute("src",imageLeftUrl),mediaElementLeft.setAttribute("srcset",imageLeftUrl),mediaElementRight.setAttribute("src",imageRightUrl),mediaElementRight.setAttribute("srcset",imageRightUrl),Motion.animate(imageAnimateEl,{transform:"scale(1.3)"},{duration:0}),setTimeout(function(){Motion.animate(imageAnimateEl,{transform:"scale(1)"},{duration:1.3,delay:0,easing:[.16,1,.3,1]}).finished},10)}}}else if(parentContainer.classList.remove("pillars-video-active"),videoMediaElementIframe.src="",imageUrl){const mediaElement=parentContainer.querySelector(".pillars-image .banner__image");if(mediaElement){const imageAnimateEl=mediaElement.closest("animate-element"),newImage=new Image;newImage.src=imageUrl,newImage.onload=()=>{mediaElement.setAttribute("src",imageUrl),mediaElement.setAttribute("srcset",imageUrl),Motion.animate(imageAnimateEl,{transform:"scale(1.3)"},{duration:0}),setTimeout(function(){Motion.animate(imageAnimateEl,{transform:"scale(1)"},{duration:1.3,delay:0,easing:[.16,1,.3,1]}).finished},10)}}}}})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".hotspot-product").forEach(element=>{element.addEventListener("click",()=>{const productsData=JSON.parse(element.dataset.products),drawerTrigger=document.querySelector(".hotspot-modal-button"),outputContainer=document.querySelector(".hotspot-drawer-content");outputContainer.innerHTML="",productsData.forEach(product=>{const productBlock=document.createElement("a");productBlock.href=product.url,productBlock.classList.add("product-block");const img=document.createElement("img");img.src=product.image;const contentDiv=document.createElement("div"),title=document.createElement("div");title.textContent=product.title;const price=document.createElement("div");price.innerHTML=product.price;const color=document.createElement("div");color.classList.add("text-title"),color.textContent=product.color,contentDiv.appendChild(title),contentDiv.appendChild(price),contentDiv.appendChild(color),productBlock.appendChild(img),productBlock.appendChild(contentDiv),outputContainer.appendChild(productBlock)}),drawerTrigger.click()})})}),document.addEventListener("DOMContentLoaded",function(){const sizeChartModal=document.querySelector(".sizechart-tables"),tableCells=document.querySelectorAll(".sizechart-tables td"),unitElements=document.querySelectorAll(".sizechart-units a"),sizeChartRows=document.querySelectorAll(".sizechart-tables tr");let unit="unit-us";unitElements.forEach(element=>{element.addEventListener("click",e=>{e.preventDefault();const isUS=element.classList.contains("unit-us"),isMetric=element.classList.contains("unit-metric");isUS&&unit!=="unit-us"?setUnit("unit-us"):isMetric&&unit!=="unit-metric"&&setUnit("unit-metric")})});function setUnit(newUnit){unitElements.forEach(element=>{element.classList.contains(newUnit)?element.classList.add("active"):element.classList.remove("active")}),sizeChartRows.forEach((row,rowIndex)=>{rowIndex!==0&&Array.from(row.children).slice(1).forEach(cell=>{if(cell.tagName==="TH")return;const text=cell.textContent.trim();let convertedValue;if(newUnit==="unit-us")if(cell.dataset.us)cell.textContent=cell.dataset.us;else{const value=parseFloat(text);isNaN(value)||(convertedValue=(Math.floor(value/2.54*2)/2).toString(),cell.dataset.cm=text,cell.textContent=convertedValue)}else if(newUnit==="unit-metric")if(cell.dataset.cm)cell.textContent=cell.dataset.cm;else{if(text.includes("-")){const[val1,val2]=text.split("-").map(Number);convertedValue=`${Math.floor(val1*2.54)}-${Math.floor(val2*2.54)}`}else{const value=parseFloat(text);isNaN(value)||(convertedValue=Math.floor(value*2.54).toString())}cell.dataset.us=text,cell.textContent=convertedValue||""}})}),unit=newUnit}});function localization(){const form=document.getElementById("localization_form"),countries=form.querySelectorAll(".localization-country"),formInput=form.querySelector('input[name="country_code"]');
21countries.forEach(country=>{country.addEventListener("click",function(){formInput.value=country.dataset.value,form.submit()})})}localization();function localizationSearch(){let input=document.getElementById("localization-search").value.toUpperCase();const container=document.getElementById("CountryList"),continents=container.querySelectorAll("details");container.querySelectorAll(".localization-country").forEach(country=>{country.textContent.toUpperCase().indexOf(input)>=0?country.classList.remove("hidden"):country.classList.add("hidden"),continents.forEach(continent=>{const countriesFound=continent.querySelectorAll(".localization-country:not(.hidden)").length;input.length==0?continent.open=!1:countriesFound>0?continent.open=!0:continent.open=!1})})}document.addEventListener("DOMContentLoaded",()=>{const container=document.querySelector(".blog-lookbook");if(container){const heading=container.querySelector("h2");container.querySelectorAll(".tab__item").forEach(button=>{button.addEventListener("click",()=>{heading.innerHTML=button.dataset.heading})}),Motion.inView(container,({target})=>{target.classList.add("hovered")},{amount:.5})}});function attachKlaviyoForm(formId){var formElement=document.getElementById(formId);if(formElement!=null){var selectedGender=formElement.querySelector("input.klaviyo_form_actions_gender:checked").value;setTimeout(function(){KlaviyoSubscribe.attachToForms(formElement,{hide_form_on_success:!0,extra_properties:{$source:"$embed",$method_type:"Klaviyo Form",$method_id:"embed",$gender:selectedGender,$consent_version:"Embed default text"},success:function(){formElement.querySelector(".custom_success_message").classList.remove("hidden")}})},2e3)}}attachKlaviyoForm("email_signup_footer"),attachKlaviyoForm("email_signup"),(function(){let currentURL=window.location.href,breadcrumbContainer=document.querySelector("nav.breadcrumb"),storedBreadcrumbs;if(currentURL=currentURL.split("?")[0].split("#")[0],currentURL.includes("/collections/")&&breadcrumbContainer!=null){const breadcrumbsHTML=breadcrumbContainer.innerHTML;sessionStorage.setItem("breadcrumbHTML",breadcrumbsHTML)}storedBreadcrumbs=sessionStorage.getItem("breadcrumbHTML"),currentURL.includes("/products/")&&breadcrumbContainer!=null&&(storedBreadcrumbs!=null&&storedBreadcrumbs!=""?breadcrumbContainer.innerHTML=storedBreadcrumbs:breadcrumbContainer.innerHTML=`<ul class="inline-flex gap-4 md:gap-6 text-title"> 22 <li class="flex items-center gap-4 md:gap-6"> 23 <a class="block" href="/" is="magnet-link">Home</a> 24 </li> 25 </ul>`),currentURL.includes("/search")&&storedBreadcrumbs!=null&&sessionStorage.setItem("breadcrumbHTML","")})(),document.addEventListener("bmi_selected_size",e=>{var size=e.detail.size,optionSize=size.substring(0,size.indexOf(" ")),optionLength=size.substring(size.indexOf(" ")+1);const selectedSize=document.querySelector(`.variant-picker .product-form__input label[title="${optionSize}"]`),selectedLength=document.querySelector(`.variant-picker .product-form__input label[title="${optionLength}"]`);selectedLength&&selectedLength.click(),selectedSize&&selectedSize.click()}),document.addEventListener("bmi_ssc_loaded",e=>{document.querySelector(".boldmetrics-container").classList.add("loaded"),document.querySelector(".boldmetrics-container .bm-button-label").classList.add("reversed-link")}),document.addEventListener("bmi_reload",e=>{document.querySelector(".boldmetrics-container").classList.add("loaded")});function boldmetricsReload(){document.dispatchEvent(new CustomEvent("bmi_reload",{bubbles:!0}))}function customZoom(){const galleryImages=document.querySelectorAll(".product__media[data-zoom-type='custom'] img"),lightbox=document.createElement("div");lightbox.id="zoom-lightbox",lightbox.innerHTML=`<div class="zoom-lightbox-content"> 26 <button class="zoom-close-btn"> 27 <svg class="icon icon-close icon-sm" viewBox="0 0 20 20" stroke="currentColor" fill="none" xmlns="http://www.w3.org/2000/svg"> 28 <path stroke-linecap="round" stroke-linejoin="round" d="M5 15L15 5M5 5L15 15"></path> 29 </svg> 30 </button>
31 <div class="zoom-lightbox-thumbnails"></div> 32 <div class="zoom-lightbox-images"></div> 33 </div>`,document.body.appendChild(lightbox);const lightboxThumbnails=lightbox.querySelector(".zoom-lightbox-thumbnails"),lightboxImages=lightbox.querySelector(".zoom-lightbox-images"),closeBtn=lightbox.querySelector(".zoom-close-btn");galleryImages.forEach((img,index)=>{const thumb=document.createElement("img");thumb.src=img.src,thumb.dataset.index=index,thumb.classList.add("zoom-lightbox-thumb"),lightboxThumbnails.appendChild(thumb);const fullImgWrapper=document.createElement("div");fullImgWrapper.classList.add("zoom-lightbox-img-wrapper");const counter=document.createElement("span");counter.classList.add("zoom-image-counter"),counter.textContent=`${index+1} / ${galleryImages.length}`;const fullImg=document.createElement("img");fullImg.src=img.src,fullImg.classList.add("zoom-lightbox-img"),fullImg.dataset.index=index,fullImgWrapper.appendChild(counter),fullImgWrapper.appendChild(fullImg),lightboxImages.appendChild(fullImgWrapper),img.addEventListener("click",function(){lightbox.style.display="flex",setTimeout(()=>lightbox.classList.add("fade-in"),10),setTimeout(()=>lightbox.classList.add("active"),20),document.body.classList.add("has-modal-open"),scrollToImageInstantly(index)})});function scrollToImageInstantly(index){const targetImage=lightboxImages.querySelector(`[data-index='${index}']`);targetImage&&(targetImage.scrollIntoView({behavior:"instant",block:"start"}),updateActiveThumbnail(index))}function scrollToImage(index){const targetImage=lightboxImages.querySelector(`[data-index='${index}']`);targetImage&&targetImage.scrollIntoView({behavior:"smooth",block:"start"})}function updateActiveThumbnail(index){lightboxThumbnails.querySelectorAll(".zoom-lightbox-thumb").forEach(thumb=>{thumb.classList.remove("active")}),lightboxThumbnails.querySelector(`[data-index='${index}']`).classList.add("active")}lightboxThumbnails.addEventListener("click",function(e){e.target.classList.contains("zoom-lightbox-thumb")&&scrollToImage(e.target.dataset.index)});function closeModal(){lightbox.classList.remove("fade-in"),lightbox.classList.add("fade-out"),setTimeout(()=>{lightbox.classList.remove("active","fade-out"),document.body.classList.remove("has-modal-open")},300)}closeBtn.addEventListener("click",closeModal),document.addEventListener("keydown",function(e){e.key==="Escape"&&closeModal()}),lightbox.addEventListener("click",function(e){e.target===lightbox&&closeModal()}),lightboxImages.addEventListener("scroll",function(){let activeIndex=null,maxCoverage=0;lightboxImages.querySelectorAll(".zoom-lightbox-img").forEach(img=>{const rect=img.getBoundingClientRect(),coveragePercentage=(Math.min(rect.bottom,window.innerHeight)-Math.max(rect.top,0))/window.innerHeight;coveragePercentage>.5&&coveragePercentage>maxCoverage&&(maxCoverage=coveragePercentage,activeIndex=img.dataset.index)}),activeIndex!==null&&updateActiveThumbnail(activeIndex)})}document.addEventListener("DOMContentLoaded",function(){customZoom()});function disabledAtcFeedback(){const atcButton=document.querySelector(".product-form .product-form__submit");atcButton?.addEventListener("click",function(e){let isValid=!0;document.querySelectorAll(".product-form__input.variant-input-wrapper").forEach(function(optionGroup){optionGroup.querySelector("input[type='radio']:checked")?optionGroup.classList.remove("not-selected"):(optionGroup.classList.add("not-selected"),isValid=!1)}),isValid||e.preventDefault()}),document.querySelectorAll(".product-form__input input[type='radio']").forEach(function(radio){radio.addEventListener("change",function(){this.closest(".product-form__input").classList.remove("not-selected")})})}document.addEventListener("DOMContentLoaded",function(){disabledAtcFeedback()});function updateReviews(){const targetNode=document.querySelector(".ruk_rating_snippet"),descriptionReviewsBlock=document.querySelector(".description-block-reviews-text"),descriptionReviewsBlockScore=document.querySelector(".description-block-reviews-score");if(!targetNode||!descriptionReviewsBlock||!descriptionReviewsBlockScore)return;const applyUpdates=()=>{const countEl=targetNode.querySelector(".ruk-rating-snippet-count"),reviewsDrawer=document.querySelector("#ProductReviewsDrawer");if(countEl&&reviewsDrawer){countEl.innerHTML=countEl.innerHTML.replace(/\sReviews?/,"");const leftGroup=reviewsDrawer.querySelector(".header__group.header__group--left"),centerGroup=reviewsDrawer.querySelector(".header__group.header__group--center .R-SliderIndicator-group");leftGroup&&(descriptionReviewsBlock.innerHTML=leftGroup.innerHTML),centerGroup&&(descriptionReviewsBlockScore.innerHTML=centerGroup.innerHTML,descriptionReviewsBlockScore.nextElementSibling.innerHTML="View All Reviews")}};if(targetNode.querySelector(".ruk-rating-snippet-count")){applyUpdates();return}new MutationObserver((mutationsList,observer2)=>{for(const mutation of mutationsList)if(mutation.type==="childList"&&mutation.addedNodes.length>0){applyUpdates(),observer2.disconnect();break}}).observe(targetNode,{childList:!0,subtree:!0})}document.addEventListener("DOMContentLoaded",updateReviews);function homepageReviewsBlock(){const targetNode=document.querySelector("#ReviewsWidgetHomepage"),descriptionReviewsBlock=document.querySelector(".description-block-reviews-text"),descriptionReviewsBlockScore=document.querySelector(".description-block-reviews-score");if(!targetNode)return;const applyUpdates=()=>{const reviewsContent=targetNode.querySelector(".R-ContentList");reviewsContent&&reviewsContent.insertAdjacentHTML("beforeend",'<div class="R-ContentList__item u-textLeft--all reviews-link-block"><a class="button button--primary" href="/pages/testimonials-1">View All Reviews</div>')};if(targetNode.querySelector(".R-ContentList")){applyUpdates();return}new MutationObserver((mutationsList,observer2)=>{for(const mutation of mutationsList)if(mutation.type==="childList"&&mutation.addedNodes.length>0){applyUpdates(),observer2.disconnect();break}}).observe(targetNode,{childList:!0,subtree:!0})}document.addEventListener("DOMContentLoaded",homepageReviewsBlock);function stoqBiS(){let notifyMeBtn=document.getElementById("notify-me-btn"),atcButtonContainer=document.querySelector(".product-form__atc-wishlist");if(atcButtonContainer){let productData=atcButtonContainer.dataset.product,parsedProduct=JSON.parse(productData);var variantSelector=document.querySelector('.product-form [name="id"]');notifyMeBtn&¬ifyMeBtn.addEventListener("click",function(){const variantId=parseInt(variantSelector.value);console.log("variant ID: "+variantId),window._RestockRocket.openModal(parsedProduct,variantId)})}}document.addEventListener("DOMContentLoaded",stoqBiS);function getShopifySectionId(element){const sectionWrapper=element?.closest('[id^="shopify-section-"]');return sectionWrapper?sectionWrapper.id.replace("shopify-section-",""):null}async function swatchClickHandler(e){const swatch=e.target.closest(".color-swatch-custom");if(!swatch)return;e.preventDefault();const productHandle=swatch.dataset.handle,mainSectionId=swatch.dataset.sectionId,howToWearElement=document.querySelector(".product-how-to-wear-it"),enhancementsElement=document.querySelector(".product-enhancements"),howToWearSectionId=getShopifySectionId(howToWearElement),enhancementsSectionId=getShopifySectionId(e
33nhancementsElement),sectionIds=[mainSectionId,howToWearSectionId,enhancementsSectionId].filter(Boolean),newUrl=`/products/${productHandle}`;window.history.replaceState({path:newUrl},"",newUrl);try{const response=await fetch(`${newUrl}?sections=${encodeURIComponent(sectionIds.join(","))}`);if(!response.ok)throw new Error("Failed to fetch section content");const sections=await response.json(),parser=new DOMParser,mainSectionHtml=sections[mainSectionId];if(mainSectionHtml){const newMainDocument=parser.parseFromString(mainSectionHtml,"text/html");[".product-form-wrapper",".product__gallery",".product__price",".description-container",".product__badge-message",".product-info-message-metafield",".swatches-group-limited",".swatches-group-core",".variant-picker","noscript","style[data-product-style]",".product-content-description","sticky-buy-button","#product-styled-with",'script[type="application/ld+json"]',"script[data-boldmetrics-script]"].forEach(selector=>{const newElement=newMainDocument.querySelector(selector),currentElement=document.querySelector(selector);newElement&¤tElement&¤tElement.replaceWith(newElement)})}if(howToWearSectionId&§ions[howToWearSectionId]){const newElement=parser.parseFromString(sections[howToWearSectionId],"text/html").querySelector(".product-how-to-wear-it"),currentElement=document.querySelector(".product-how-to-wear-it");newElement&¤tElement&¤tElement.replaceWith(newElement)}if(enhancementsSectionId&§ions[enhancementsSectionId]){const newElement=parser.parseFromString(sections[enhancementsSectionId],"text/html").querySelector(".product-enhancements"),currentElement=document.querySelector(".product-enhancements");newElement&¤tElement&¤tElement.replaceWith(newElement)}const updatedSwatchesContainer=document.querySelector(".product-page-color-swatches");updatedSwatchesContainer&&updatedSwatchesContainer.querySelectorAll(".color-swatch-custom").forEach(element=>{element.classList.toggle("active-swatch",element.dataset.handle===productHandle)}),document.querySelectorAll("variant-radios").forEach(element=>{new VariantRadios(element)}),productDescription(),boldmetricsReload(),disabledAtcFeedback(),customZoom(),rivoReload(),updateReviews(),stickyAtcAnchor(),stoqBiS()}catch(error){console.error("Error updating product sections:",error)}}document.addEventListener("click",swatchClickHandler),document.addEventListener("quickview:loaded",function(){rivoReload(),disabledAtcFeedback(),stoqBiS()});function keyCallouts(){let callouts=document.querySelectorAll(".product-key-callouts button");callouts?.forEach(callout=>{callout.addEventListener("click",function(){let tabTarget=callout.dataset.tab,tabTargetEl=document.querySelector(`#ProductCalloutsDrawer .tab__item[data-tab="${tabTarget}"]`);tabTargetEl?.click()})})}keyCallouts();function anchorLinkScroll(selector='a[href^="#"]'){document.addEventListener("click",function(e){const link=e.target.closest(selector);if(!link)return;const href=link.getAttribute("href");if(!href||href.length<=1||!href.startsWith("#"))return;const targetId=href.slice(1),targetEl=document.getElementById(targetId);targetEl&&(e.preventDefault(),targetEl.scrollIntoView({behavior:"smooth"}))})}anchorLinkScroll(),document.addEventListener("DOMContentLoaded",()=>{const container=document.querySelector(".sticky-nav-gender-toggle"),sections=document.querySelectorAll("#MainContent .shopify-section");container?.addEventListener("click",e=>{const button=e.target.closest(".gender-toggle-button");if(!button)return;const gender=button.getAttribute("data-gender"),otherGender=gender==="men"?"women":"men";container.setAttribute("data-active-gender",gender);const url=new URL(window.location);url.searchParams.set("gender",gender),history.pushState({},"",url);const showSections=button.getAttribute("data-sections").split(",").map(i=>parseInt(i.trim(),10)-1),hideSections=container.querySelector(`.gender-toggle-button[data-gender="${otherGender}"]`).getAttribute("data-sections").split(",").map(i=>parseInt(i.trim(),10)-1);showSections.forEach(i=>{sections[i]&&(sections[i].classList.remove("hide-section"),sections[i].classList.add("show-section","section--padding"))}),hideSections.forEach(i=>
33{sections[i]&&(sections[i].classList.add("hide-section"),sections[i].classList.remove("show-section","section--padding"))})})}),document.addEventListener("DOMContentLoaded",()=>{if(window.innerWidth>767)return;const carouselEls=document.querySelectorAll(".card-grid .product-card:first-child .product-card__carousel");if(!carouselEls.length)return;function triggerScrollAnimation(el){const scrollDistance=el.scrollWidth*.2;el.scrollTo({left:0,behavior:"auto"}),setTimeout(()=>{el.scrollTo({left:scrollDistance,behavior:"smooth"}),setTimeout(()=>{el.scrollTo({left:0,behavior:"smooth"})},1e3)},300)}if("IntersectionObserver"in window){const io=new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{entry.isIntersecting&&(triggerScrollAnimation(entry.target),observer.unobserve(entry.target))})},{root:null,rootMargin:"0px 0px -50% 0px",threshold:0});carouselEls.forEach(el=>io.observe(el))}else carouselEls.forEach(el=>triggerScrollAnimation(el))});function pathToDots(path,dotSpacing=10,dotRadius=1){const totalLength=path.getTotalLength(),svg=path.ownerSVGElement,group=document.createElementNS("http://www.w3.org/2000/svg","g");group.classList.add("dot-group");for(let dist=0;dist<=totalLength;dist+=dotSpacing){const point=path.getPointAtLength(dist),circle=document.createElementNS("http://www.w3.org/2000/svg","circle");circle.setAttribute("cx",point.x),circle.setAttribute("cy",point.y),circle.setAttribute("r",dotRadius),circle.setAttribute("fill",path.getAttribute("stroke")||"#000"),circle.setAttribute("opacity","0"),group.appendChild(circle)}svg.appendChild(group),path.remove()}function animateDots(group){group.querySelectorAll("circle").forEach((dot,i)=>{setTimeout(()=>{dot.style.transition="opacity 0.3s",dot.style.opacity=1},i*30)})}document.addEventListener("DOMContentLoaded",()=>{const maskSvg=document.querySelector("#image-with-mask svg");if(maskSvg){maskSvg.querySelectorAll("path").forEach(path=>pathToDots(path,10,1));const observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting){const el=entry.target;el.matches("g.dot-group")?animateDots(el):el.matches(".image-with-mask-desktop-hotspot, .image-with-mask-mobile-hotspot")&&el.classList.add("visible"),observer.unobserve(el)}})},{root:null,threshold:0,rootMargin:"-30% 0px -30% 0px"});document.querySelectorAll("g.dot-group, .image-with-mask-desktop-hotspot, .image-with-mask-mobile-hotspot").forEach(el=>observer.observe(el));let mobileHotspotTrigger=document.querySelectorAll(".image-with-mask-mobile-hotspot");mobileHotspotTrigger.length>0&&mobileHotspotTrigger.forEach(trigger=>{trigger.addEventListener("click",()=>{let index=trigger.dataset.hotspot;console.log("test: "+index);let targetEl=document.querySelector(`.image-with-mask-mobile-drawer-element[data-hotspot="${index}"]`);document.querySelectorAll(".image-with-mask-mobile-hotspot").forEach(el=>{el.classList.remove("active")}),document.querySelectorAll(".image-with-mask-mobile-drawer-element").forEach(el=>{el.classList.remove("active")}),trigger.classList.add("active"),targetEl.classList.add("active"),setTimeout(function(){let offset=targetEl.offsetTop-80;console.log(offset),document.querySelector("#image-with-mask-drawer .drawer__scrollable").scrollTo({top:offset,behavior:"instant"})},400)})})}}),document.body.addEventListener("click",function(e){e.target.closest('[rivo-ax-on\\:click^="addToCartFromButton"]')&&setTimeout(async()=>{const cartDrawer=document.querySelector("#CartDrawer");if(!cartDrawer)return;const sectionID=cartDrawer.getAttribute("data-section-id"),parsedState=await fetch(`/?sections[]=${encodeURIComponent(sectionID)}`).then(res=>res.json()),cartJson=await fetch(`${theme.routes.cart_url}`,{...theme.utils.fetchConfig()}).then(res=>res.json());cartJson.sections=parsedState,theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.cartUpdate,{cart:cartJson}),document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product:parsedState}}))},2e3)});function aboutHeightToggle(){let aboutHeightBtn=document.querySelectorAll(".about-heights-nav-button");
33aboutHeightBtn&&aboutHeightBtn.forEach(button=>{let aboutHeightContainer=button.closest(".about-height-container");button.addEventListener("click",()=>{button.classList.contains("active")?(button.classList.remove("active"),aboutHeightContainer.dataset.size=""):(aboutHeightContainer.querySelectorAll(".about-heights-nav-button").forEach(btn=>{btn.classList.remove("active")}),aboutHeightContainer.dataset.size=button.dataset.size,button.classList.add("active"))})})}document.addEventListener("DOMContentLoaded",()=>{aboutHeightToggle()}),document.addEventListener("click",function(e){const swatch=e.target.closest("quick-view[open] .color-swatch-custom");if(swatch){e.preventDefault();const quickViewModal=swatch.closest("quick-view"),productUrl=swatch.getAttribute("href");quickViewModal.dataset.productUrl=productUrl,quickViewModal.querySelector(quickViewModal.selector).classList.add("loading"),quickViewModal.quickview()}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".product-trigger").forEach(element=>{element.addEventListener("click",()=>{let drawerTrigger=document.querySelector(".lookbook-drawer-button"),outputContainer=document.querySelector("#slideshow-products-lookbook .slideshow-drawer-content"),productIdsData=element.closest(".product-drawer-container").dataset.productIds,productIds=productIdsData?String(productIdsData).split(","):[];outputContainer.innerHTML="";async function getProductsByIds(ids){const search=encodeURI(ids.map(id=>`id:${id}`).join(" OR "));await fetch(`/search?q=${search}&type=product&view=grid-ajax-lookbook`).then(response=>response.text()).then(html=>{console.log(html),outputContainer.innerHTML=html})}getProductsByIds(productIds),drawerTrigger.click()})})});let multicolumnSliderEl=document.querySelectorAll(".multicolumn-slider");multicolumnSliderEl&&multicolumnSliderEl.forEach(slider=>{multicolumnSlider=new Flickity(slider,{pageDots:!1,prevNextButtons:!0,freeScroll:!0,wrapAround:!1,cellAlign:"center",contain:!0,arrowShape:{x0:15,x1:60,y1:40,x2:65,y2:35,x3:25},on:{ready:function(){setTimeout(()=>this.element.setAttribute("loaded",""))}}});function toggleArrows(){var carouselWidth=multicolumnSlider.viewport.offsetWidth,cellsWidth=0;multicolumnSlider.cells.forEach(function(cell){cellsWidth+=cell.size.width}),cellsWidth<=carouselWidth?slider.classList.add("hide-arrows"):slider.classList.remove("hide-arrows")}toggleArrows(),window.addEventListener("resize",toggleArrows)}),document.addEventListener("DOMContentLoaded",function(){const links=document.querySelectorAll(".enhanced-collections-item-title.button");if(!links.length)return;const currentUrl=window.location.pathname+window.location.search;links.forEach(link=>{const linkUrl=new URL(link.href);linkUrl.pathname+linkUrl.search===currentUrl?(link.classList.add("button--primary"),link.classList.remove("button--secondary")):(link.classList.add("button--secondary"),link.classList.remove("button--primary"))})}),document.addEventListener("DOMContentLoaded",function(){const nav=document.querySelector(".anchor-nav");if(!nav)return;const carouselEl=nav.querySelector(".anchor-nav__carousel"),flkty=new Flickity(carouselEl,{cellAlign:"left",contain:!0,prevNextButtons:!0,pageDots:!1,draggable:!0}),items=nav.querySelectorAll(".anchor-nav__item");function smoothScrollTo(targetEl){if(!targetEl)return;const y=targetEl.getBoundingClientRect().top+window.scrollY-60;window.scrollTo({top:y,behavior:"smooth"})}function getSectionByIndex(index){return document.querySelectorAll("#MainContent .shopify-section")[index-1]}items.forEach(item=>{item.addEventListener("click",function(){const type=this.dataset.type;if(type==="anchor"){const id=this.dataset.anchor,el=document.getElementById(id);smoothScrollTo(el)}if(type==="section"){const index=parseInt(this.dataset.sectionIndex,10),el=getSectionByIndex(index);smoothScrollTo(el)}})})});function initRebuyWidgetCarousel(wrapperSelector,scrollAmount=250){const initialized=new WeakSet;function setupCarousel(wrapper){if(!wrapper||initialized.has(wrapper))return;const container=wrapper.querySelector(".rebuy-widget-products-primary, .rebuy-widget-carousel"),prevBtn=wrapper.querySelector(".rebuy-widget-primary-nav-prev"),nextBtn=wrapper.querySelector(".rebuy-widget-primary-nav-next");
33if(!container||!prevBtn||!nextBtn)return;initialized.add(wrapper);function updateArrowStates(){const maxScrollLeft=container.scrollWidth-container.clientWidth;prevBtn.classList.toggle("disabled",container.scrollLeft<=2),nextBtn.classList.toggle("disabled",container.scrollLeft>=maxScrollLeft-2),wrapper.classList.toggle("is-scrollable",maxScrollLeft>0)}function scroll(direction){container.scrollBy({left:direction*scrollAmount,behavior:"smooth"})}prevBtn.addEventListener("click",()=>{scroll(-1)}),nextBtn.addEventListener("click",()=>{scroll(1)}),container.addEventListener("scroll",updateArrowStates),window.addEventListener("resize",updateArrowStates),new ResizeObserver(updateArrowStates).observe(container),new MutationObserver(()=>{requestAnimationFrame(updateArrowStates)}).observe(container,{childList:!0,subtree:!0}),requestAnimationFrame(updateArrowStates)}function initAll(){document.querySelectorAll(wrapperSelector).forEach(setupCarousel)}initAll(),new MutationObserver(()=>{initAll()}).observe(document.body,{childList:!0,subtree:!0})}initRebuyWidgetCarousel(".rebuy-widget-primary");function initHowToWearItPopup(){const section=document.querySelector("#product-how-to-wear-it"),popup=document.querySelector(".how-to-wear-it-notice-popup");!section||!popup||(popup.classList.add("opacity-0"),new IntersectionObserver(([entry],observer)=>{entry.isIntersecting&&(popup.classList.remove("opacity-0"),setTimeout(()=>popup.classList.add("opacity-0"),4e3),observer.disconnect())},{threshold:.3}).observe(section))}initHowToWearItPopup(); 34//# sourceMappingURL=/cdn/shop/t/810/assets/theme.js.map?v=131530614919237867581790023111
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.