PageSourceSearch

https://313designmarket.com/cdn/shop/t/45/assets/global.bundle.js?v=182511672855915948941745246894

js 313designmarket.com collected 2026-10-06 21:37:59 UTC 61,895 bytes, 14 lines download raw bytes

vendor: 8,347 bytes, line 1
1var _createClass=(function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}})();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(function(){if(typeof window>"u"||typeof Element>"u")return;var slice=Array.prototype.slice,matches=Element.prototype.matches||Element.prototype.msMatchesSelector,_focusableElementsString=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","video","[contenteditable]"].join(","),InertRoot=(function(){function InertRoot2(rootElement,inertManager2){_classCallCheck(this,InertRoot2),this._inertManager=inertManager2,this._rootElement=rootElement,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return _createClass(InertRoot2,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(this._savedAriaHidden!==null?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach(function(inertNode){this._unmanageNode(inertNode.node)},this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(startNode){var _this2=this;composedTreeWalk(startNode,function(node2){return _this2._visitNode(node2)});var activeElement=document.activeElement;if(!document.body.contains(startNode)){for(var node=startNode,root=void 0;node;){if(node.nodeType===Node.DOCUMENT_FRAGMENT_NODE){root=node;break}node=node.parentNode}root&&(activeElement=root.activeElement)}startNode.contains(activeElement)&&(activeElement.blur(),activeElement===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(node){if(node.nodeType===Node.ELEMENT_NODE){var element=node;element!==this._rootElement&&element.hasAttribute("inert")&&this._adoptInertRoot(element),(matches.call(element,_focusableElementsString)||element.hasAttribute("tabindex"))&&this._manageNode(element)}}},{key:"_manageNode",value:function(node){var inertNode=this._inertManager.register(node,this);this._managedNodes.add(inertNode)}},{key:"_unmanageNode",value:function(node){var inertNode=this._inertManager.deregister(node,this);inertNode&&this._managedNodes.delete(inertNode)}},{key:"_unmanageSubtree",value:function(startNode){var _this3=this;composedTreeWalk(startNode,function(node){return _this3._unmanageNode(node)})}},{key:"_adoptInertRoot",value:function(node){var inertSubroot=this._inertManager.getInertRoot(node);inertSubroot||(this._inertManager.setInert(node,!0),inertSubroot=this._inertManager.getInertRoot(node)),inertSubroot.managedNodes.forEach(function(savedInertNode){this._manageNode(savedInertNode.node)},this)}},{key:"_onMutation",value:function(records,self){records.forEach(function(record){var target=record.target;if(record.type==="childList")slice.call(record.addedNodes).forEach(function(node){this._makeSubtreeUnfocusable(node)},this),slice.call(record.removedNodes).forEach(function(node){this._unmanageSubtree(node)},this);else if(record.type==="attributes"){if(record.attributeName==="tabindex")this._manageNode(target);else if(target!==this._rootElement&&record.attributeName==="inert"&&target.hasAttribute("inert")){this._adoptInertRoot(target);var inertSubroot=this._inertManager.getInertRoot(target);this._managedNodes.forEach(function(managedNode){target.contains(managedNode.node)&&inertSubroot._manageNode(managedNode.node)})}}},this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return this._savedAriaHidden!==null}},{key:"savedAriaHidden",set:function(ariaHidden){this._savedAriaHidden=ariaHidden},get:function(){return this._savedAriaHidden}}]),InertRoot2})(),InertNode=(function(){function InertNode2(node,inertRoot){_classCallCheck(this,InertNode2),this._node=node,this._overrodeFocusMethod=!1,this._inertRoots=new Set([inertRoot]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}return _createClass(InertNode2,[{key:"destructor",value:function(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){var element=this._node;this._savedTabIndex!==null?element.setAttribute("tabindex",this._savedTabIndex):element.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete element.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){if(this.node.nodeType===Node.ELEMENT_NODE){var element=this.node;if(matches.call(element,_focusableElementsString)){if(element.tabIndex===-1&&this.hasSavedTabIndex)return;element.hasAttribute("tabindex")&&(this._savedTabIndex=element.tabIndex),element.setAttribute("tabindex","-1"),element.nodeType===Node.ELEMENT_NODE&&(element.focus=function(){},this._overrodeFocusMethod=!0)}else element.hasAttribute("tabindex")&&(this._savedTabIndex=element.tabIndex,element.removeAttribute("tabindex"))}}},{key:"addInertRoot",value:function(inertRoot){this._throwIfDestroyed(),this._inertRoots.add(inertRoot)}},{key:"removeInertRoot",value:function(inertRoot){this._throwIfDestroyed(),this._inertRoots.delete(inertRoot),this._inertRoots.size===0&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return this._savedTabIndex!==null}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(tabIndex){this._throwIfDestroyed(),this._savedTabIndex=tabIndex},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),InertNode2})(),InertManager=(function(){function InertManager2(document2){if(_classCallCheck(this,InertManager2),!document2)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=document2,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),addInertStyle(document2.head||document2.body||document2.documentElement),document2.readyState==="loading"?document2.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return _createClass(InertManager2,[{key:"setInert",value:function(root,inert){if(inert){if(this._inertRoots.has(root))return;var inertRoot=new InertRoot(root,this);if(root.setAttribute("inert",""),this._inertRoots.set(root,inertRoot),!this._document.body.contains(root))for(var parent=root.parentNode;parent;)parent.nodeType===11&&addInertStyle(parent),parent=parent.parentNode}else{if(!this._inertRoots.has(root))return;var _inertRoot=this._inertRoots.get(root);_inertRoot.destructor(),this._inertRoots.delete(root),root.removeAttribute("inert")}}},{key:"getInertRoot",value:function(element){return this._inertRoots.get(element)}},{key:"register",value:function(node,inertRoot){var inertNode=this._managedNodes.get(node);return inertNode!==void 0?inertNode.addInertRoot(inertRoot):inertNode=new InertNode(node,inertRoot),this._managedNodes.set(node,inertNode),inertNode}},{key:"deregister",value:function(node,inertRoot){var inertNode=this._managedNodes.get(node);return inertNode?(inertNode.removeInertRoot(inertRoot),inertNode.destroyed&&this._managedNodes.delete(node),inertNode):null}},{key:"_onDocumentLoaded",value:function(){var inertElements=slice.call(this._document.querySelectorAll("[inert]"));
1inertElements.forEach(function(inertElement){this.setInert(inertElement,!0)},this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(records,self){var _this=this;records.forEach(function(record){switch(record.type){case"childList":slice.call(record.addedNodes).forEach(function(node){if(node.nodeType===Node.ELEMENT_NODE){var inertElements=slice.call(node.querySelectorAll("[inert]"));matches.call(node,"[inert]")&&inertElements.unshift(node),inertElements.forEach(function(inertElement){this.setInert(inertElement,!0)},_this)}},_this);break;case"attributes":if(record.attributeName!=="inert")return;var target=record.target,inert=target.hasAttribute("inert");_this.setInert(target,inert);break}},this)}}]),InertManager2})();function composedTreeWalk(node,callback,shadowRootAncestor){if(node.nodeType==Node.ELEMENT_NODE){var element=node;callback&&callback(element);var shadowRoot=element.shadowRoot;if(shadowRoot){composedTreeWalk(shadowRoot,callback,shadowRoot);return}if(element.localName=="content"){for(var content=element,distributedNodes=content.getDistributedNodes?content.getDistributedNodes():[],i=0;i<distributedNodes.length;i++)composedTreeWalk(distributedNodes[i],callback,shadowRootAncestor);return}if(element.localName=="slot"){for(var slot=element,_distributedNodes=slot.assignedNodes?slot.assignedNodes({flatten:!0}):[],_i=0;_i<_distributedNodes.length;_i++)composedTreeWalk(_distributedNodes[_i],callback,shadowRootAncestor);return}}for(var child=node.firstChild;child!=null;)composedTreeWalk(child,callback,shadowRootAncestor),child=child.nextSibling}function addInertStyle(node){if(!node.querySelector("style#inert-style, link#inert-style")){var style=document.createElement("style");style.setAttribute("id","inert-style"),style.textContent=`
2[inert] {
3  pointer-events: none;
4  cursor: default;
5}
6
7[inert], [inert] * {
8  -webkit-user-select: none;
9  -moz-user-select: none;
10  -ms-user-select: none;
11  user-select: none;
12}
13`,node.appendChild(style)}}if(!HTMLElement.prototype.hasOwnProperty("inert")){var inertManager=new InertManager(document);Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(inert){inertManager.setInert(this,inert)}})}})();import{Alpine as Alpine2,AlpinePlugins}from"vendor";import{Splide as Splide2}from"vendor";function fetched_fragment_default(Alpine3){Alpine3.magic("fetchedFragment",(el,{Alpine:Alpine4,evaluateLater})=>(url,selector,loadingClasses=null)=>{let classNames;return loadingClasses&&(classNames=loadingClasses.split(/\s+/g),el.classList.add(...classNames)),async()=>{const html=await fetchHTMLFragment(url,selector);return Alpine4.$data(el).$nextTick(()=>{classNames&&el.classList.remove(...classNames)}),html}})}function html_if_set_default(Alpine3){Alpine3.directive("html-if-set",(el,{modifiers,expression},{effect,evaluateLater})=>{let evaluate=evaluateLater(expression),useEmpty=modifiers.includes("use-empty");function saveInitialHTML(){el._x_custom_initialHTML=el.innerHTML}function getInitialHTML(){return el._x_custom_initialHTML}effect(()=>{let newHTML;evaluate(value=>{value?(newHTML=value,getInitialHTML()||saveInitialHTML()):useEmpty&&value===""?newHTML=value:getInitialHTML()&&(newHTML=getInitialHTML()),(newHTML||useEmpty&&newHTML==="")&&Alpine3.mutateDom(()=>{el.innerHTML=newHTML,el._x_ignoreSelf=!0,Alpine3.initTree(el),delete el._x_ignoreSelf})})})})}function mask_default(Alpine3){Alpine3.directive("mask",(el,{value,expression},{effect,evaluateLater})=>{let templateFn=()=>expression,lastInputValue="";queueMicrotask(()=>{if(["function","dynamic"].includes(value)){let evaluator=evaluateLater(expression);effect(()=>{templateFn=input=>{let result;return Alpine3.dontAutoEvaluateFunctions(()=>{evaluator(value2=>{result=typeof value2=="function"?value2(input):value2},{scope:{$input:input,$money:formatMoney.bind({el})}})}),result},processInputValue(el,!1)})}else processInputValue(el,!1);el._x_model&&el._x_model.set(el.value)}),el.addEventListener("input",()=>processInputValue(el)),el.addEventListener("blur",()=>processInputValue(el,!1)),el.addEventListener("remask",()=>processInputValue(el,!1,!0));function processInputValue(el2,shouldRestoreCursor=!0,ignoreBackspace=!1){let input=el2.value,template=templateFn(input);if(!template||template==="false")return!1;if(ignoreBackspace===!1&&lastInputValue.length-el2.value.length===1)return lastInputValue=el2.value;let setInput=()=>{lastInputValue=el2.value=formatInput(input,template)};shouldRestoreCursor?restoreCursorPosition(el2,template,()=>{setInput()}):setInput()}function formatInput(input,template){if(input==="")return"";let strippedDownInput=stripDown(template,input);return buildUp(template,strippedDownInput)}}).before("model")}function restoreCursorPosition(el,template,callback){let cursorPosition=el.selectionStart,unformattedValue=el.value;callback();
13let beforeLeftOfCursorBeforeFormatting=unformattedValue.slice(0,cursorPosition),newPosition=buildUp(template,stripDown(template,beforeLeftOfCursorBeforeFormatting)).length;el.setSelectionRange(newPosition,newPosition)}function stripDown(template,input){let inputToBeStripped=input,output="",regexes={9:/[0-9]/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},wildcardTemplate="";for(let i=0;i<template.length;i++){if(["9","a","*"].includes(template[i])){wildcardTemplate+=template[i];continue}for(let j=0;j<inputToBeStripped.length;j++)if(inputToBeStripped[j]===template[i]){inputToBeStripped=inputToBeStripped.slice(0,j)+inputToBeStripped.slice(j+1);break}}for(let i=0;i<wildcardTemplate.length;i++){let found=!1;for(let j=0;j<inputToBeStripped.length;j++)if(regexes[wildcardTemplate[i]].test(inputToBeStripped[j])){output+=inputToBeStripped[j],inputToBeStripped=inputToBeStripped.slice(0,j)+inputToBeStripped.slice(j+1),found=!0;break}if(!found)break}return output}function buildUp(template,input){let clean=Array.from(input),output="";for(let i=0;i<template.length;i++){if(!["9","a","*"].includes(template[i])){output+=template[i];continue}if(clean.length===0)break;output+=clean.shift()}return output}function formatMoney(input,delimiter=".",thousands,precision=2){if(input==="-")return"-";if(/^\D+$/.test(input))return"9";thousands==null&&(thousands=delimiter===","?".":",");let addThousands=(input2,thousands2)=>{let output="",counter=0;for(let i=input2.length-1;i>=0;i--)input2[i]!==thousands2&&(counter===3?(output=input2[i]+thousands2+output,counter=0):output=input2[i]+output,counter++);return output},minus=input.startsWith("-")?"-":"",strippedInput=input.replaceAll(new RegExp(`[^0-9\\${delimiter}]`,"g"),""),template=Array.from({length:strippedInput.split(delimiter)[0].length}).fill("9").join("");return template=`${minus}${addThousands(template,thousands)}`,precision>0&&input.includes(delimiter)&&(template+=`${delimiter}`+"9".repeat(precision)),queueMicrotask(()=>{this.el.value.endsWith(delimiter)||this.el.value[this.el.selectionStart-1]===delimiter&&this.el.setSelectionRange(this.el.selectionStart-1,this.el.selectionStart-1)}),template}var modals_default={domContentLoaded:!1,leftDrawer:{open:!1,contents:""},rightDrawer:{open:!1,contents:""},quickBuyDrawer:{open:!1,contents:""},modal:{open:!1,contents:""},promo:{open:!1,contents:""},popup:{open:!1,contents:""},modals:{},async init(){await switchOnDOMContentLoaded(),await Alpine.nextTick(),await Alpine.nextTick();for(const slotName of["leftDrawer","rightDrawer","quickBuyDrawer","modal","promo","popup"])this.setUpShow(slotName),this.setUpHide(slotName)},register(name,slotName){this.modals[name]=slotName},open(name){if(this.modals[name]){const slotName=this.modals[name];if(this[slotName].contents===name&&this[slotName].open===!0)return;document.body.dispatchEvent(new CustomEvent(`${kebabCase(name)}-will-open`,{bubbles:!0})),document.body.dispatchEvent(new CustomEvent(`${kebabCase(slotName)}-will-open`,{bubbles:!0})),this[slotName].contents=name,this[slotName].open=!0}},close(nameOrSlotName){let name,slotName;this.modals[nameOrSlotName]?(name=nameOrSlotName,slotName=this.modals[nameOrSlotName]):(name=this[nameOrSlotName].contents,slotName=nameOrSlotName),!(this[slotName].contents!==name||this[slotName].open!==!0)&&(document.body.dispatchEvent(new CustomEvent(`${kebabCase(name)}-will-close`,{bubbles:!0})),document.body.dispatchEvent(new CustomEvent(`${kebabCase(slotName)}-will-close`,{bubbles:!0})),this[slotName].open=!1)},setUpShow(slotName){const slotEl=document.getElementById(`${kebabCase(slotName)}-slot`);slotEl._x_doShow=async()=>{const dispatchOpenEvents=()=>{const name=Alpine.store("modals")[slotName].contents;document.body.dispatchEvent(new CustomEvent(`${kebabCase(name)}-is-open`,{bubbles:!0})),document.body.dispatchEvent(new CustomEvent(`${kebabCase(slotName)}-is-open`,{bubbles:!0}))};Alpine.mutateDom(()=>{slotEl.style.length===1&&slotEl.style.display==="none"?slotEl.removeAttribute("style"):slotEl.style.removeProperty("display")}),await Alpine.nextTick();try{const transitionEl=slotEl.hasAttribute("x-show")?slotEl:slotEl.closest("[x-show]");await Promise.all(transitionEl.getAnimations().map(animation=>animation.finished)),dispatchOpenEvents()}catch{dispatchOpenEvents()}}},setUpHide(slotName){const slotEl=document.getElementById(`${kebabCase(slotName)}-slot`);slotEl._x_doHide=()=>{Alpine.mutateDom(()=>{slotEl.style.setProperty("display","none")});const name=Alpine.store("modals")[slotName].contents;Alpine.store("modals")[slotName].contents="",document.body.dispatchEvent(new CustomEvent(`${kebabCase(name)}-is-closed`,{bubbles:!0})),document.body.dispatchEvent(new CustomEvent(`${kebabCase(slotName)}-is-closed`,{bubbles:!0}))}}
13,closeAll(){Object.keys(this.modals).forEach(modal=>{Alpine.store("modals").close(modal)})},getSlotEl(slotName){return document.getElementById(`${kebabCase(slotName)}-slot`)||null},removeExistingContents(slotName,selector){const existingModalContents=this.getSlotEl(slotName)?.querySelector(selector);existingModalContents&&existingModalContents.remove()}},cart_count_default={count:window.theme&&window.theme.cartItemCount||0,init(){window.addEventListener("baseline:cart:afteradditem",e=>{this._setFromFetchedSection(e.detail.response)}),window.addEventListener("baseline:cart:cartqtychange",e=>{this._setFromFetchedSection(e.detail.response)}),window.addEventListener("baseline:cart:update",e=>{this._setFromFetchedSection(e.detail.response)})},_setFromFetchedSection(data){const countSectionHTML=data.sections["cart-item-count"];this.count=parseInt(parseDOMFromString(countSectionHTML).firstElementChild.innerText.trim(),10),window.theme.cartItemCount=this.count},countWithText(){let string=theme.strings.itemCountOther;return this.count===1&&(string=theme.strings.itemCountOne),string.replace("{{ count }}",this.count)}},age_check_default=({mode,dateFormat,minimumAge,redirectURL,enabled})=>({authenticated:!1,mode,dateFormat,minimumAge,redirectURL,month:"",day:"",year:"",date:"",enabled,sectionId:null,storageKey:null,boundOnSectionSelect:null,boundOnSectionDeselect:null,get fullDate(){return`${this.month}/${this.day}/${this.year}`},init(){this.sectionId=this.$root.id,this.storageKey=`switch-age-check-${this.sectionId}`,window.location.pathname!=="/challenge"&&(Shopify.designMode&&Alpine.store("modals").removeExistingContents("modal","#ageCheck"),initTeleport(this.$root),Alpine.store("modals").register("ageCheck","modal"),Shopify.designMode?(window.theme.designMode.selected===this.sectionId&&(this.enabled===!0?Alpine.store("modals").open("ageCheck"):Alpine.store("modals").close("ageCheck")),this.boundOnSectionSelect=this.onSectionSelect.bind(this),this.boundOnSectionDeselect=this.onSectionDeselect.bind(this),document.addEventListener("shopify:section:select",this.boundOnSectionSelect),document.addEventListener("shopify:section:deselect",this.boundOnSectionDeselect)):getExpiringStorageItem(this.storageKey)!=="approved"&&Alpine.store("modals").open("ageCheck"),this.redirectURL===null&&(this.redirectURL="https://www.google.com"),this.mode==="dob"&&(this.date=new Date,setTimeout(()=>this.setUpDOB(),100)))},onSectionSelect(e){e.target.contains(this.$root)&&this.enabled&&Alpine.store("modals").open("ageCheck")},onSectionDeselect(e){e.target.contains(this.$root)&&this.$store.modals.close("ageCheck")},approveEntry(){Alpine.store("modals").close("ageCheck"),Shopify.designMode||setExpiringStorageItem(this.storageKey,"approved",daysInMs(30))},denyEntry(){window.location=this.redirectURL},checkInput(name){switch(name){case"day":return parseInt(this.day)>0&&parseInt(this.day)<32;case"month":return parseInt(this.month)>0&&parseInt(this.month)<13;case"year":return parseInt(this.year)<this.date.getFullYear()&&parseInt(this.year)>1900}return!0},checkAge(){const currentDate=Math.round(this.date.getTime()/1e3),enteredDate=Math.round(new Date(`${this.fullDate}`).getTime()/1e3);Math.floor((currentDate-enteredDate)/31536e3)>parseInt(this.minimumAge,10)?this.approveEntry():this.denyEntry()},setUpDOB(){document.getElementById(`dob-form-${this.sectionId}`).addEventListener("input",e=>{const target=e.srcElement||e.target,maxLength=parseInt(target.attributes.maxlength.value,10),targetLength=target.value.length;if(targetLength>=maxLength){if(!this.checkInput(target.getAttribute("name")))return target.value="",!1;let next=target.closest(".input-grid-item");for(;(next=next.nextElementSibling)&&next!=null;){let input=next.querySelector("input");if(input!==null){input.focus();break}}}else if(targetLength===0){let previous=target.closest(".input-grid-item");for(;(previous=previous.previousElementSibling)&&previous!=null;){const input=previous.querySelector("input");if(input!==null){input.focus();break}}}this.checkInput("day")&&this.checkInput("month")&&this.checkInput("year")&&setTimeout(()=>this.checkAge(),500)})},destroy(){document.removeEventListener("shopify:section:select",this.boundOnSectionSelect),document.removeEventListener("shopify:section:deselect",this.boundOnSectionDeselect)}}),free_shipping_bar_default=()=>({contentHTML:null,boundOnCartUpdate:null,init(){this.boundOnCartUpdate=this.onCartUpdate.bind(this),window.addEventListener("baseline:cart:afteradditem",this.boundOnCartUpdate),window.addEventListener("baseline:cart:cartqtychange",this.boundOnCartUpdate),window.addEventListener("baseline:cart:update",this.boundOnCartUpdate)},async onCartUpdate(){const updatedSection=await freshHTML(getURLWithParams(window.theme.routes.root_url,{section_id:this.$root.i
13d}));this.contentHTML=querySelectorInHTMLString("[data-content]",updatedSection).innerHTML;const scrollingTextContainerEl=this.$root.querySelector("scrolling-items-container");scrollingTextContainerEl&&(await this.$nextTick(),scrollingTextContainerEl.dispatchEvent(new CustomEvent("scrolling-items:change")))},destroy(){window.removeEventListener("baseline:cart:afteradditem",this.boundOnCartUpdate),window.removeEventListener("baseline:cart:cartqtychange",this.boundOnCartUpdate),window.removeEventListener("baseline:cart:update",this.boundOnCartUpdate)}}),cart_items_default=()=>({itemsRoot:null,loading:null,boundOnCartQuantityChange:null,init(){this.itemsRoot=this.$root,this.boundOnCartQuantityChange=this.onCartQuantityChange.bind(this),window.addEventListener("baseline:cart:afteradditem",this.boundOnCartQuantityChange),window.addEventListener("baseline:cart:cartqtychange",this.boundOnCartQuantityChange),window.addEventListener("baseline:cart:update",this.boundOnCartQuantityChange),document.addEventListener("baseline:cart:lock",()=>{this.loading=!0}),document.addEventListener("baseline:cart:unlock",()=>{this.loading=!1})},onCartQuantityChange(e){Alpine.morph(this.itemsRoot,querySelectorInHTMLString("[data-cart-items]",e.detail.response.sections["cart-items"]).outerHTML,{updating(el,toEl,childrenOnly,skip){el.nodeType===1&&el.hasAttribute("ready")&&toEl.setAttribute("ready","")}}),this.$nextTick(()=>{this.itemsRoot.querySelectorAll("input").forEach(inputEl=>{inputEl.value=inputEl.getAttribute("value"),inputEl.dispatchEvent(new Event("input"))})}),this.updateLiveRegion(parseDOMFromString(e.detail.response.sections["cart-live-region"]).firstElementChild.textContent),e.detail.originalTarget&&this.$nextTick(()=>{if(!this.itemsRoot.contains(e.detail.originalTarget)){let focusRoot;this.itemsRoot.closest('[role="dialog"]')?focusRoot=this.itemsRoot.closest('[role="dialog"]').parentNode:focusRoot=this.itemsRoot,this.$focus.within(focusRoot).first()}});const itemsRootEl=this.itemsRoot;switch(e.type){case"baseline:cart:afteradditem":document.dispatchEvent(new CustomEvent("theme:product:add",{detail:{cartItemCount:window.theme.cartItemCount,itemsRootEl,lineItemEl:document.querySelector(`[data-line-item-key="${e.detail.response.key}"]`)||null,variantId:e.detail.response.variant_id,key:e.detail.response.key,formEl:document.getElementById(e.detail.sourceId),get cartPromise(){return fetch(window.theme.routes.cart_url,fetchConfigDefaults()).then(res=>res.json()).then(cart=>cart).catch(error=>console.error("Error fetching cart in `theme:product:add`",error))}}}));break;case"baseline:cart:cartqtychange":document.dispatchEvent(new CustomEvent("theme:line-item:change",{detail:{cartItemCount:e.detail.response.item_count,itemsRootEl,lineItemEl:document.querySelector(`[data-line-item-key="${e.detail.key}
13"]`)||null,variantId:e.detail.variantId,key:e.detail.key,quantity:e.detail.quantity,previousQuantity:e.detail.previousQuantity,cart:e.detail.response}}));break;case"baseline:cart:update":document.dispatchEvent(new CustomEvent("theme:cart:update",{detail:{cartItemCount:window.theme.cartItemCount,itemsRootEl,get cartPromise(){return fetch(window.theme.routes.cart_url,fetchConfigDefaults()).then(res=>res.json()).then(cart=>cart).catch(error=>console.error("Error fetching cart in `theme:cart:update`",error))}}}));break}},updateLiveRegion(liveRegionText){if(!liveRegionText)return;const cartStatus=document.getElementById("cart-live-region-text");cartStatus.textContent=liveRegionText,cartStatus.setAttribute("aria-hidden",!1),setTimeout(()=>{cartStatus.setAttribute("aria-hidden",!0)},1e3)},destroy(){window.removeEventListener("baseline:cart:afteradditem",this.boundOnCartQuantityChange),window.removeEventListener("baseline:cart:cartqtychange",this.boundOnCartQuantityChange),window.removeEventListener("baseline:cart:update",this.boundOnCartQuantityChange)}}),cart_item_default=key=>({quantity:null,previousQuantity:null,key,locked:!1,errorMessage:null,init(){document.addEventListener("baseline:cart:lock",()=>{this.locked=!0}),document.addEventListener("baseline:cart:unlock",()=>{this.locked=!1})},async itemQuantityChange(){if(this.locked||this.loading||this.$refs.quantityInput.hasAttribute("data-last-value")&&this.quantity===Number(this.$refs.quantityInput.dataset.lastValue))return;this.locked=!0,this.loading=!0;const request={...fetchConfigDefaults("application/javascript"),body:JSON.stringify({id:this.key,quantity:this.quantity,sections:"cart-items,cart-footer,cart-item-count,cart-live-region",sections_url:window.location.pathname})};try{const data=await(await fetch(theme.routes.cart_change_url,request)).json();data.status===422?(this.errorMessage=data.message,this.quantity=this.previousQuantity,document.dispatchEvent(new CustomEvent("theme:line-item:error",{detail:{message:this.errorMessage,itemsRootEl:this.itemsRoot,lineItemEl:document.querySelector(`[data-line-item-key="${this.key}"]`)||null,variantId:Number(this.$refs.quantityInput.dataset.variantId),key:this.key,quantity:this.quantity}}))):(this.errorMessage=null,document.body.dispatchEvent(new CustomEvent("baseline:cart:cartqtychange",{bubbles:!0,detail:{response:data,key:this.key,quantity:this.quantity,previousQuantity:this.previousQuantity,variantId:Number(this.$refs.quantityInput.dataset.variantId),originalTarget:this.$refs.quantityControl}})))}catch(e){console.error(e),document.getElementById("cart-errors").textContent=theme.strings.cartError,document.dispatchEvent(new CustomEvent("theme:cart:error:other",{detail:{message:theme.strings.cartError,error:e}}))}finally{this.locked=!1,this.loading=!1}},removeItem(){Array.from(this.$root.querySelectorAll('[x-data="CartItemQuantity"]')).filter(el=>el.offsetParent)[0].dispatchEvent(new CustomEvent("remove"))}}),quantity_default={adjustQuantity(adjustCb){typeof this.previousQuantity<"u"&&(this.previousQuantity=this.quantity);const quantityBeforeAdjustment=this.quantity;adjustCb(),this.dispatchInputEvent(),this.quantity!==quantityBeforeAdjustment&&this.$nextTick(()=>{this.dispatchChangeEvent()})},increment(){this.adjustQuantity(()=>{this.$refs.quantityInput.stepUp()})},decrement(){this.adjustQuantity(()=>{this.$refs.quantityInput.stepDown()})},dispatchInputEvent(){this.$refs.quantityInput.dispatchEvent(new Event("input"))},dispatchChangeEvent(){this.$refs.quantityInput.dispatchEvent(new Event("change"))}},cart_item_quantity_default=()=>({remove(){this.adjustQuantity(()=>{this.$refs.quantityInput.value=0})},...quantity_default}),cart_footer_default=()=>({footerRoot:null,_morphFooter(e){const newFooterSection=querySelectorInHTMLString("[data-cart-footer]",e.detail.response.sections["cart-footer"]);Alpine.morph(this.footerRoot,newFooterSection?newFooterSection.outerHTML:"",{updating(el,toEl,childrenOnly,skip){el.classList&&el.classList.contains("additional-checkout-buttons")&&skip(),el.nodeType===1&&el.hasAttribute("ready")&&toEl.setAttribute("ready","")}})},init(){this.footerRoot=this.$root,window.addEventListener("baseline:cart:afteradditem",e=>{this._morphFooter(e)}),window.addEventListener("baseline:cart:cartqtychange",e=>{this._morphFooter(e)}),window.addEventListener("baseline:cart:update",e=>{this._morphFooter(e)})}}),cart_note_default=()=>({updating:!1,note:"",init(){this.note=this.$root.value,this.$watch("note",(value,oldValue)=>{value!==oldValue&&this.updateNote()})},async updateNote(){this.updating=!0,await fetch(theme.routes.cart_update_url,{...fetchConfigDefaults(),body:JSON.stringify({note:this.$root.value})}),this.updating=!1}}),header_default=()=>({isStuck:!1,overlayHeaderWithSticky:null,overlayTextColor:null,init(){this.overlayHeaderWithSticky=this.$root.dataset.overlayHeaderWithSticky==="true",this.overlayHeaderWithSticky&&this.setUpOverlayWithSticky()},setUpOverlayWithSticky(){const positionerEl=document.createElement("div");positionerEl.id="sticky-positioner",document.body.insertBefore(positionerEl,this.$root.closest(".shopify-section")),new IntersectionObserver(([e])=>{e.intersectionRatio===0?this.isStuck=!0:this.isStuck=!1}).observe(positionerEl),this.overlayTextColor=this.$root.dataset.overlayTextColorScheme,this.updateColorScheme(this.isStuck),this.$watch("isStuck",value=>{this.updateColorScheme(value)})},updateColorScheme(isStuck){isStuck?(this.$refs.header.setAttribute("data-color-scheme",""),this.$refs.header.classList.remove("bg-transparent"),this.$refs.header.classList.add("bg-scheme-background")):(this.$refs.header.setAttribute("data-color-scheme",this.overlayTextColor),this.$refs.header.classList.remove("bg-scheme-background"),this.$refs.header.classList.add("bg-transparent"))}}),video_default=(mode="preview")=>({player:null,enabled:!1,playing:!1,id:"",playback:"inline",mode,init(){this.id=this.$root.i
13d,document.body.addEventListener("pauseAllMedia",e=>{e.detail!==null&&e.detail.id===this.$root.id||this.mode!=="autoplay"&&this.pause()}),this.$watch("enabled",value=>{value===!0&&(this.player=this.$root.querySelector("[\\@play][\\@pause]"),this.player.addEventListener("playing",()=>{this.playing=!0}),this.player.addEventListener("paused",()=>{this.playing=!1}))}),this.$watch("playing",value=>{value===!0&&this.dispatchPauseAllMediaEvent()}),this.productMediaWrapper=this.$root.closest("[data-product-single-media-wrapper]"),this.productMediaWrapper!==null&&this.setUpProductMediaListeners(),Shopify.designMode&&document.addEventListener("shopify:section:unload",e=>{e.target.contains(this.$root)&&this.player&&this.player.dispatchEvent(new CustomEvent("deinit"))}),this.mode==="autoplay"&&this.enable(),this.$nextTick(()=>{this.checkImagesLoaded()})},checkImagesLoaded(){this.$root.querySelectorAll("img.track-loaded").forEach(image=>{image.complete?image.classList.add("is-complete"):image.addEventListener("load",()=>{image.classList.add("is-complete")}
13)})},enable(){this.playback==="modal"?(this.$store.modals.modals[this.id]||this.$store.modals.register(this.id,"modal"),this.dispatchPauseAllMediaEvent(),this.$store.modals.open(this.id)):this.enabled=!0},dispatchPauseAllMediaEvent(){document.body.dispatchEvent(new CustomEvent("pauseAllMedia",{detail:{id:this.$root.id}}))},play(){this.enabled===!1||this.player===null||this.player.dispatchEvent(new CustomEvent("play"))},pause(){this.enabled===!1||this.player===null||this.player.dispatchEvent(new CustomEvent("pause"))},setUpProductMediaListeners(){this.productMediaWrapper.addEventListener("mediaHidden",()=>{this.pause()}),this.productMediaWrapper.addEventListener("mediaVisible",()=>{})}}),product_media_video_default=()=>({player:null,productMediaWrapper:null,enabled:!1,playing:!1,init(){document.body.addEventListener("pauseAllMedia",e=>{e.detail!==null&&e.detail.id===this.$root.id||this.pause()}),this.$watch("enabled",value=>{value===!0&&(this.player=this.$root.querySelector("[\\@play][\\@pause]"),this.player.addEventListener("playing",()=>{this.playing=!0}),this.player.addEventListener("paused",()=>{this.playing=!1}))}),this.$watch("playing",value=>{value===!0&&this.dispatchPauseAllMediaEvent()}),this.productMediaWrapper=this.$root.closest("[data-product-single-media-wrapper]"),this.productMediaWrapper&&this.setUpProductMediaListeners(),Shopify.designMode&&document.addEventListener("shopify:section:unload",e=>{e.target.contains(this.$root)&&this.player&&this.player.dispatchEvent(new CustomEvent("deinit"))})},setUpProductMediaListeners(){this.productMediaWrapper.addEventListener("mediaHidden",()=>{this.pause()}),this.productMediaWrapper.addEventListener("mediaVisible",()=>{this.play()})},enable(){this.enabled=!0},dispatchPauseAllMediaEvent(){document.body.dispatchEvent(new CustomEvent("pauseAllMedia",{detail:{id:this.$root.id}}))},play(){this.enabled===!1||this.player===null||this.player.dispatchEvent(new CustomEvent("play"))},pause(){this.enabled===!1||this.player===null||this.player.dispatchEvent(new CustomEvent("pause"))}}),html_video_default=()=>({init(){this.$refs.video.addEventListener("play",()=>{this.$root.dispatchEvent(new CustomEvent("playing",{bubbles:!0}))}),this.$refs.video.addEventListener("pause",()=>{this.$root.dispatchEvent(new CustomEvent("paused",{bubbles:!0}))}),this.$refs.video.autoplay&&this.$nextTick(()=>{this.$refs.video.play()})},play(){this.$refs.video.play()},pause(){this.$refs.video.pause()}}),filterable_default=()=>({filtersOpen:!1,sortOpen:!1,filtersCache:[],loading:!1,focusedBeforeUpdate:null,searchParams:null,countHTML:null,filtersFormHTML:null,resultsHTML:null,drawerToggleHTML:null,afterUpdateCallback:null,isMdBreakpoint:window.isMdBreakpoint(),mdBreakpointMQL:window.mdBreakpointMQL(),boundOnHistoryChange:null,clickOutside(event,property,sidebarOnDesktop){sidebarOnDesktop&&this.isMdBreakpoint||event.preventDefault(),!(event.target&&(event.target===this.$refs.filterDropDownToggle||event.target===this.$refs.sortDropDownToggle))&&(this[property]=!1)},focusOut(event,property){if(event.relatedTarget){if(event.relatedTarget===this.$refs.filterDropDownToggle||event.relatedTarget===this.$refs.sortDropDownToggle)return;event.relatedTarget.closest("[data-filterable-dropdown]")||(this[property]=!1)}},onEscape(){this.filtersOpen&&(this.filtersOpen=!1,this.$refs.filterDropDownToggle.focus()),this.sortOpen&&(this.sortOpen=!1,this.$refs.sortToggle.focus())},init(){this.isMdBreakpoint=this.mdBreakpointMQL.matches,this.mdBreakpointMQL.addEventListener("change",e=>{this.isMdBreakpoint=e.matches}),this.$root.addEventListener("baseline:filterable:open-filters",()=>{this.filtersOpen=!0}),this.boundOnHistoryChange=this.onHistoryChange.bind(this),window.addEventListener("popstate",this.boundOnHistoryChange),this.$watch("sortOpen",value=>{value===!0&&this.filtersOpen===!0&&(this.filtersOpen=!1)}),this.$watch("filtersOpen",value=>{value===!0&&this.sortOpen===!0&&(this.sortOpen=!1)}),this.$watch("searchParams",this.onSearchParamsUpdate.bind(this))},async onSearchParamsUpdate(value,oldValue){if(value===oldValue)return;const updatedHTML=await fetchHTML(currentURLAddingParams([...value,["section_id",getSectionId(this.$root)]],!0));this.$root.querySelector('[data-fragment-id="count"]')&&(this.countHTML=querySelectorInHTMLString('[data-fragment-id="count"]',updatedHTML).innerHTML),this.$root.querySelector('[data-fragment-id="drawer
13-toggle"]')&&(this.drawerToggleHTML=querySelectorInHTMLString('[data-fragment-id="drawer-toggle"]',updatedHTML).innerHTML);const filterFormFragmentIds=["filters-form-sidebar","filters-form-filters-drop-down","filters-form-sort-drop-down","filters-form-drawer"];for(const fragmentId of filterFormFragmentIds){let fragmentEl,updatedFormFragmentEl;if(fragmentId==="filters-form-drawer"){if(fragmentEl=document.getElementById("filters-form-drawer"),!fragmentEl||(updatedFormFragmentEl=querySelectorInHTMLString(`[data-template-fragment-id="${fragmentId}"]`,updatedHTML)?.content.firstElementChild.querySelector(`[data-fragment-id="${fragmentId}"]`),!updatedFormFragmentEl))continue}else if(fragmentEl=this.$root.querySelector(`[data-fragment-id="${fragmentId}"]`),!fragmentEl||(updatedFormFragmentEl=querySelectorInHTMLString(`[data-fragment-id="${fragmentId}"]`,updatedHTML)||null,!updatedFormFragmentEl))continue;fragmentEl.querySelectorAll("[data-filterable-filter-fragment]").forEach(filterableFragmentEl=>{const updatedFragmentEl=updatedFormFragmentEl.querySelector(`[data-filterable-filter-fragment="${filterableFragmentEl.getAttribute("data-filterable-filter-fragment")}"`);updatedFragmentEl&&(filterableFragmentEl.innerHTML=updatedFragmentEl.innerHTML)})}this.resultsHTML=querySelectorInHTMLString('[data-fragment-id="results"]',updatedHTML).innerHTML,this.afterUpdate()},afterUpdate(){if(this.focusedBeforeUpdate&&document.getElementById(this.focusedBeforeUpdate)){const target=document.getElementById(this.focusedBeforeUpdate);this.$focus.focus(target),target.tagName==="INPUT"&&target.type==="text"&&target.select(),this.focusedBeforeUpdate=null}this.historyChanged?this.historyChanged=!1:this.updateURLHash(this.searchParams),this.loading=!1,this.afterUpdateCallback&&this.$nextTick(()=>{this.afterUpdateCallback(),this.afterUpdateCallback=null})},filterFormSubmit(event){let form=event.target.closest("form");if(event.target.hasAttribute("form")){const formId=event.target.getAttribute("form");form=document.getElementById(formId)}if(this.loading||!form)return;if(this.loading=!0,document.activeElement&&this.$root.contains(document.activeElement)){const targetId=document.activeElement.getAttribute("id");targetId&&(this.focusedBeforeUpdate=targetId)}const formData=new FormData(form);this.searchParams=new URLSearchParams(formData),event.target.name&&event.target.name==="sort_by"&&(this.afterUpdateCallback=()=>{this.sortOpen=!1})},clearAllFilters(){this.searchParams=new URL(this.$event.currentTarget.href).searchParams},updateURLHash(searchParams){const searchParamsString=searchParams.toString();history.pushState({searchParamsString},"",`${window.location.pathname}${searchParamsString&&"?".concat(searchParamsString)}`)},onHistoryChange(event){this.historyChanged=!0,this.searchParams=event.state.searchParams||""},destroy(){window.removeEventListener("popstate",this.boundOnHistoryChange)}}),range_control_default=(min,max,start,end)=>({min,max,valueA:start,valueB:end,ready:!1,ignoreRangeStart:!1,ignoreRangeEnd:!1,get rangeStart(){return Math.min(this.valueA,this.valueB)},set rangeStart(value){value>=this.rangeEnd||(this.valueA<this.valueB?this.valueA=value:this.valueB=value)},get rangeEnd(){return Math.max(this.valueA,this.valueB)},set rangeEnd(value){value<=this.rangeStart||(this.valueA>this.valueB?this.valueA=value:this.valueB=value)},get rangeStartInMajorUnits(){return this.rangeStart/100},get rangeEndInMajorUnits(){return this.rangeEnd/100},get range(){return this.rangeEnd-this.rangeStart},get rangeStartInPercent(){return this.normalize(this.rangeStart)},get rangeEndInPercent(){return this.normalize(this.rangeEnd)},get rangeInPercent(){return this.rangeEndInPercent-this.rangeStartInPercent},get valueCenter(){return this.rangeStart+this.range/2},set valueCenter(value){const proposedRangeStart=Math.round((value-this.range/2)/100)*100,proposedRangeEnd=Math.round((value+this.range/2)/100)*100;proposedRangeStart<this.min||proposedRangeEnd>this.max||(this.rangeStart=proposedRangeStart,this.rangeEnd=proposedRangeEnd)},init(){this.$watch("rangeStart",(value,oldValue)=>{value===oldValue||this.ignoreRangeStart||this.updateRangeStartDirectInputField(value)}),this.$watch("rangeEnd",(value,oldValue)=>{value===oldValue||this.ignoreRangeEnd||this.updateRangeEndDirectInputField(value)}),this.$nextTick(()=>{this.ready=!0})},normalize(value){const ratio=100/(this.max-this.min);return(value-this.min)*ratio+0},updateRangeStartDirectInputField(value,triggerChange=!0){this.$refs.rangeStartDirectInputField.value=(value/100).toString(),this.$refs.rangeStartDirectInputField.dispatchEvent(new Event("remask"))},updateRangeEndDirectInputField(value,triggerChange=!0){this.$refs.rangeEndDirectInputField.value=(value/100).toString(),this.$refs.rangeEndDirectInputField.dispatchEvent(new Event("remask"))},handleRangeStartDirectInputFieldInput(){this.ignoreRangeStart=!0,this.rangeStart=this.$el.value.replaceAll(/\D/g,"")*100,this.$nextTick(()=>{this.ignoreRangeStart=!1}),this.$refs.rangeStartFormField.dispatchEvent(new CustomEvent("indirect-change"))},handleRangeEndDirectInputFieldInput(){this.ignoreRangeEnd=!0,this.rangeEnd=this.$el.value.replaceAll(/\D/g,"")*100,this.$nextTick(()=>{this.ignoreRangeEnd=!1}),this.$refs.rangeEndFormField.dispatchEvent(new CustomEvent("indirect-change"))},handleRangeStartDirectInputFieldChange(){this.$refs.rangeStartFormField.dispatchEvent(new Event("change"))},handleRangeEndDirectInputFieldChange(){this.$refs.rangeEndFormField.dispatchEvent(new Event("change"))},handleRangeStartControlChange(){this.$refs.rangeStartFormField.dispatchEvent(new Event("change"))},handleRangeEndControlChange(){this.$refs.rangeEndFormField.dispatchEvent(new Event("change"))},handleRangeCenterControlChange(){this.$refs.rangeStartFormField.dispatchEvent(new Event("change"))}}),variant_drop_down_default=()=>({expanded:!1,toggle(){if(this.expanded){this.close();return}this.$refs.button.focus(),this.expanded=!0,this.$refs.panel.style.display="";const selectedEl=this.$refs.panel.querySelector("[aria-selected]");selectedEl?this.$focus.focus(selectedEl):this.$focus.within($refs.panel).first()},close(focusAfter){this.expanded&&(this.expanded=!1,this.$refs.panel.style.display="none",focu
13sAfter&&this.$focus.focus(focusAfter))}}),quantity_default2=()=>({quantity:null,...quantity_default}),modal_cart_default=({openOnAddToCart})=>({init(){openOnAddToCart===!0&&document.body.addEventListener("baseline:cart:afteradditem",()=>{Alpine.store("modals").closeAll(),Alpine.store("modals").open("cart")}),Alpine.store("modals").register("cart","rightDrawer")}}),rte_default=()=>({init(){this.$root.querySelectorAll("table").forEach(tableEl=>{wrap(tableEl).classList.add("rte__table")}),this.$root.querySelectorAll('iframe[src*="youtube.com"],iframe[src="vimeo"]').forEach(extVideoEl=>{wrap(extVideoEl).classList.add("rte__external-video")})}}),sidebar_default=()=>({boundOnSectionSelect:null,boundOnSectionDeselect:null,init(){Shopify.designMode&&this.setUpDesignMode()},setUpDesignMode(){this.boundOnSectionSelect=this.onSectionSelect.bind(this),this.boundOnSectionDeselect=this.onSectionDeselect.bind(this),document.addEventListener("shopify:section:select",this.boundOnSectionSelect),document.addEventListener("shopify:section:deselect",this.boundOnSectionDeselect)},onSectionSelect(e){e.target.contains(this.$root)&&Alpine.store("modals").open("sidebar")},onSectionDeselect(e){e.target.contains(this.$root)&&Alpine.store("modals").close("sidebar")},destroy(){document.removeEventListener("shopify:section:select",this.boundOnSectionSelect),document.removeEventListener("shopify:section:deselect",this.boundOnSectionDeselect)}}),table_default=()=>({sortCol:0,sortOrder:"asc",sortOpen:!1,originalItems:[],mobileSortLabel:"",initialSortComplete:!1,init(){this.originalItems=[...this.$refs.tableData.children],this.mobileSortLabel=this.$refs.tableHeader.children[this.sortCol].dataset.sortLabel,this.sortItems(),this.initialSortComplete=!0},sort(colIndex){this.sortOrder=this.sortCol===colIndex&&this.sortOrder==="asc"?"desc":"asc",this.sortCol=colIndex,this.sortItems()},mobileSort(colIndex,order){this.sortOrder=order,this.sortCol=colIndex,this.sortItems(),this.mobileSortLabel=this.$refs.tableHeader.children[this.sortCol].dataset.sortLabel,this.sortOpen=!1},sortItems(){const tableContainer=this.$refs.tableData,rows=tableContainer.children,rowsArray=Array.from(rows);rowsArray.sort((a,b)=>{const aSortValue=a.querySelector(`[data-index="${this.sortCol}"]`).dataset.sortValue.toLowerCase(),bSortValue=b.querySelector(`[data-index="${this.sortCol}"]`).dataset.sortValue.toLowerCase();if(!isNaN(aSortValue)&&!isNaN(bSortValue))return this.sortOrder==="asc"?aSortValue-bSortValue:bSortValue-aSortValue;if(isBooleanString(aSortValue)&&isBooleanString(bSortValue)){const aSortBoolValue=stringToBoolean(aSortValue),bSortBoolValue=stringToBoolean(bSortValue);return aSortBoolValue===bSortBoolValue?0:aSortBoolValue?this.sortOrder==="asc"?-1:1:this.sortOrder==="asc"?1:-1}return aSortValue<bSortValue?this.sortOrder==="asc"?-1:1:aSortValue>bSortValue?this.sortOrder==="asc"?1:-1:0}),tableContainer.innerHTML="",rowsArray.forEach(row=>tableContainer.appendChild(row))},restoreOriginalItems(){const tableContainer=this.$refs.tableData;tableContainer.innerHTML="",this.originalItems.forEach(item=>tableContainer.appendChild(item))}}),slideshow_default=({autoplay=!1,autoplayInterval=null,mode="slideshow",gap=null,onlyIfNeeded=!1})=>({autoplay,autoplayInterval,playing:!1,splide:null,rate:0,mode,gap,onlyIfNeeded,maxLgBreakpointMQL:window.matchMedia("(max-width: 1023px)"),init(){if(typeof Splide>"u"){console.error("The Slideshows component requires a Splide object to be defined in the global scope");return}this.initSplide(),this.onlyIfNeeded&&(this.destroyOrInitIfNeeded(),this.maxLgBreakpointMQL.addEventListener("change",e=>{this.destroyOrInitIfNeeded()})),Shopify.designMode&&this._setUpDesignModeHandlers(),document.addEventListener("dev:hotreloadmutation",async()=>{Shopify.designMode||(this.splide.destroy(),await this.$nextTick(),this.initSplide())})},initSplide(){const options={arrows:!0,pagination:!0,rewind:!0,speed:600,start:parseInt(this.$root.dataset.start,10)-1||0,interval:this.autoplayInterval,autoplay:this.autoplay,drag:!this.autoplay};
13this.mode==="carousel"&&(options.autoWidth=!0),this.gap&&(options.gap=this.gap),this.splide=new Splide(this.$root,options),options.autoplay&&(this.splide.on("autoplay:play",()=>{this.playing=!0}),this.splide.on("autoplay:pause",()=>{this.playing=!1}),this.splide.on("autoplay:playing",rate=>{this.rate=rate})),this.splide.mount()},destroyOrInitIfNeeded(){const slideEls=Array.from(this.$root.querySelectorAll(".splide__slide")),totalSlidesWidth=slideEls.reduce((totalWidth,slideEl)=>totalWidth+slideEl.getBoundingClientRect().width,0),totalGridlinesWidth=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--gridline-width"))*(slideEls.length-1);totalSlidesWidth+totalGridlinesWidth<=this.$root.getBoundingClientRect().width?splideIsNotDestroyed(this.splide)&&this.splide.destroy():splideIsNotDestroyed(this.splide)||this.initSplide()},_setUpDesignModeHandlers(){this.$root.addEventListener("slideshow-go",e=>{e.detail&&this.splide.go(parseInt(e.detail,10))})}}),promo_popup_default=({delay,frequency,enabled})=>({delay,frequency,enabled,sectionId:null,storageKey:null,boundOnSectionSelect:null,boundOnSectionDeselect:null,async init(){if(this.sectionId=this.$root.id,this.storageKey=`switch-popup-${this.sectionId}`,window.location.pathname==="/challenge")return;this.enabled&&(Shopify.designMode&&Alpine.store("modals").removeExistingContents("promo","#promoPopup"),initTeleport(this.$root),Alpine.store("modals").register("promoPopup","promo")),document.body.addEventListener("promo-is-closed",e=>{setExpiringStorageItem(this.storageKey,"shown",daysInMs(this.frequency))});const popupContent=this.$refs.teleported.content.querySelector("template").content,hasErrors=!!popupContent.querySelector("[data-errors]");(popupContent.querySelector("[data-success-message]")||hasErrors)&&(this.open(),this.clearSuccessParams(),setExpiringStorageItem(this.storageKey,"shown",daysInMs(200))),Shopify.designMode?(window.theme.designMode.selected===this.sectionId&&(this.enabled===!0?this.open():Alpine.store("modals").close("promoPopup")),this.boundOnSectionSelect=this.onSectionSelect.bind(this),this.boundOnSectionDeselect=this.onSectionDeselect.bind(this),document.addEventListener("shopify:section:select",this.boundOnSectionSelect),document.addEventListener("shopify:section:deselect",this.boundOnSectionDeselect)):getExpiringStorageItem(this.storageKey)!=="shown"&&setTimeout(()=>{this.open();const escapeHandler=e=>{e.code==="Escape"&&(this.$store.modals.close("promoPopup"),document.body.removeEventListener("keydown",escapeHandler))};document.body.addEventListener("keydown",escapeHandler)},this.delay*1e3)},open(){this.$store.modals.open("promoPopup"),this.$focus.first()},onSectionSelect(e){e.target.contains(this.$root)&&this.enabled&&this.open()},onSectionDeselect(e){e.target.contains(this.$root)&&this.$store.modals.close("promoPopup")},clearSuccessParams(){const updatedParams=new URLSearchParams(window.location.search);updatedParams.has("customer_posted")&&updatedParams.delete("customer_posted");let newURL;updatedParams.toString().length>0?newURL=`${window.location.pathname}?${updatedParams.toString()}`:newURL=window.location.pathname,history.replaceState("",document.title,newURL)},destroy(){document.removeEventListener("shopify:section:select",this.boundOnSectionSelect),document.removeEventListener("shopify:section:deselect",this.boundOnSectionDeselect)}}),ScrollingItemsContainer=class extends HTMLElement{constructor(){super()}connectedCallback(){this.isConnected&&(this.scrollingItemsEl=this.firstElementChild,this.resizeObserver=new ResizeObserver(debounce(entries=>{const entry=entries[0];entry.contentRect.width!==this.lastWidth&&(this.lastWidth=entry.contentRect.width,this.scrollingItemsEl.adjustScrollingItemsSpeed(),this.scrollingItemsEl.makeClones())},150)),this.resizeObserver.observe(this),this.addEventListener("scrolling-items:change",()=>{this.scrollingItemsEl.adjustScrollingItemsSpeed(),this.scrollingItemsEl.makeClones()}),Shopify.designMode&&document.addEventListener("shopify:section:unload",e=>{e.target.contains(this)&&this.resizeObserver.disconnect()}))}disconnectedCallback(){this.resizeObserver.disconnect()}},ScrollingItems=class extends HTMLElement{constructor(){super()}connectedCallback(){this.isConnected&&(this.adjustScrollingItemsSpeed(),this.makeClones())}adjustScrollingItemsSpeed(){document.documentElement.style.setProperty("--global-scrolling-items-speed-multiplier",window.innerWidth/1024)}makeClones(){let i=0;this.querySelector("noscript")&&this.querySelector("noscript").remove();const scrollingItemsSurfaceEl=this.querySelector("scrolling-items-surface"),originalContentEl=this.querySelector("scrolling-items-content");
13if(!scrollingItemsSurfaceEl||!originalContentEl)return;const originalContentWidth=originalContentEl.getBoundingClientRect().width;if(originalContentWidth===0)return;const totalClonesNeeded=2*Math.ceil(window.innerWidth*2/originalContentWidth/2),addClone=()=>{const clone=originalContentEl.cloneNode(!0);scrollingItemsSurfaceEl.append(clone)};for(;scrollingItemsSurfaceEl.children.length!==totalClonesNeeded;){if(totalClonesNeeded===1/0||Number.isNaN(totalClonesNeeded)||i>1e3){console.error("Baseline: Scrolling items: Something went wrong inside the scrolling items layout function",{originalContentWidth,windowInnerWidth:window.innerWidth,totalExistingClones:scrollingItemsSurfaceEl.children.length,totalClonesNeeded});break}scrollingItemsSurfaceEl.children.length>totalClonesNeeded?scrollingItemsSurfaceEl.removeChild(scrollingItemsSurfaceEl.lastChild):addClone()}this.style.setProperty("--local-scrolling-items-speed-multiplier",this.getBoundingClientRect().width/window.innerWidth)}},moneyFormat="${{amount}}";function formatMoney2(cents,format){typeof cents=="string"&&(cents=cents.replace(".",""));let value="";const placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||moneyFormat;function formatWithDelimiters(number,precision=2,thousands=",",decimal="."){if(isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);const parts=number.split("."),dollarsAmount=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1${thousands}`),centsAmount=parts[1]?decimal+parts[1]:"";return dollarsAmount+centsAmount}switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break}return formatString.replace(placeholderRegex,value)}function liveRegion(content,clear){clearTimeout(window.liveRegionTimeout);let region=document.getElementById("screenreader-announce");region.innerHTML=content,window.liveRegionTimeout=setTimeout(()=>{region.innerHTML=""},3e3)}function cartLiveRegion(item){const templateString=theme.strings.update+": [QuantityLabel]: [Quantity], [Regular] [$$] [DiscountedPrice] [$]. [PriceInformation]";function _liveRegionContent(){let liveRegionContent=templateString;liveRegionContent=liveRegionContent.replace("[QuantityLabel]",theme.strings.quantity).replace("[Quantity]",item.quantity);let regularLabel="",regularPrice=formatMoney2(item.original_line_price,theme.moneyFormat),discountLabel="",discountPrice="",discountInformation="";return item.original_line_price>item.final_line_price&&(regularLabel=theme.strings.regularTotal,discountLabel=theme.strings.discountedTotal,discountPrice=formatMoney2(item.final_line_price,theme.moneyFormat),discountInformation=theme.strings.priceColumn),liveRegionContent=liveRegionContent.replace("[Regular]",regularLabel).replace("[$$]",regularPrice).replace("[DiscountedPrice]",discountLabel).replace("[$]",discountPrice).replace("[PriceInformation]",discountInformation).replace("  .","").trim(),liveRegionContent}liveRegion(_liveRegionContent(),!0)}function variantLiveRegion(variant){const templateString="[Availability] [Regular] [$$] [Sale] [$]. [UnitPrice] [$$$]";function _getBaseUnit(){return variant.unit_price_measurement.reference_value===1?variant.unit_price_measurement.reference_unit:variant.unit_price_measurement.reference_value+variant.unit_price_measurement.reference_unit}function _liveRegionContent(){let liveRegionContent=templateString;const availability=variant.available?"":theme.strings.soldOut+",";liveRegionContent=liveRegionContent.replace("[Availability]",availability);let regularLabel="",regularPrice=formatMoney2(variant.price,theme.moneyFormat),saleLabel="",salePrice="",unitLabel="",unitPrice="";return variant.compare_at_price>variant.price&&(regularLabel=theme.strings.regularPrice,regularPrice=formatMoney2(variant.compare_at_price,theme.moneyFormat),saleLabel=theme.strings.sale,salePrice=formatMoney2(variant.price,theme.moneyFormat)),variant.unit_price&&(unitLabel=theme.strings.unitPrice,unitPrice=formatMoney2(variant.unit_price,theme.moneyFormat)+" "+theme.strings.unitPriceSeparator+" "+_getBaseUnit()),liveRegionContent=liveRegionContent.replace("[Regular]",regularLabel).replace("[$$]",regularPrice).replace("[Sale]",saleLabel).replace("[$]",salePrice).replace("[UnitPrice]",unitLabel).replace("[$$$]",unitPrice).replace("  .","").trim(),liveRegionContent}liveRegion(_liveRegionContent(),!1)}var DataIsland=class extends HTMLElement{constructor(){super()}async connectedCallback(){if(!this.isConnected)return;this._x_ignore=!0;let onVisible=!1,onIdle=!1,onInteraction=!1,onVisibleModifier;if(this.hasAttribute("on")){const onAttribute=this.getAttribute("on");onAttribute==="idle"?onIdle=!0:onAttribute.endsWith("visible")?(onVisible=!0,onVisibleModifier=onAttribute.includes(":")?onAttribute.split(":")[0]:null):onAttribute==="interaction"&&(onInteraction=!0)}else onVisible=!0;onIdle?await this.idle():onVisible?await this.visible(onVisibleModifier):onInteraction&&await this.interaction(),this.hydrate()}idle(){return new Promise(resolve=>{requestIdleCallback(()=>{resolve()})})}interaction(){const events=["touchstart","click"];return new Promise(resolve=>{const onInteractionListener=event=>{for(const eventName of events)this.removeEventListener(eventName,onInteractionListener);resolve()};for(const eventName of events)this.addEventListener(eventName,onInteractionListener)})}visible(modifier=null){const options={rootMargin:"25%"};if(modifier)switch(modifier){case"before":options.rootMargin="125%";break;case"mostly":options.rootMargin="0px",options.threshold=.75;break;case"fully":options.rootMargin="0px",options.threshold=1;break}return new Promise(resolve=>{const io=new IntersectionObserver(entries=>
13{for(const entry of entries){if(!entry.isIntersecting)return;resolve(),io.disconnect();break}},options);if(getComputedStyle(this).display==="contents")for(const childEl of this.children)io.observe(childEl);else io.observe(this)})}async hydrate(){const componentName=this.getAttribute("x-data")?.trim().split("(")[0];componentName&&!componentName.startsWith("{")&&this.hasAttribute("src")&&await importOrImportShim(this.getAttribute("src")),await this.parentHydration(),window.Alpine||await window.alpineInitPromise(),window.alpineIsStarted||await window.alpineStartedPromise(),delete this._x_ignore,await Alpine.nextTick(),Alpine.initTree(this),this.setAttribute("ready","")}parentHydration(){const parentDeferredEl=this.parentElement.closest("data-island:not([ready])");if(parentDeferredEl)return new Promise((resolve,reject)=>{parentDeferredEl&&new MutationObserver((mutationsList,observer)=>{parentDeferredEl.hasAttribute("ready")&&(observer.disconnect(),resolve())}).observe(parentDeferredEl,{attributes:!0,attributeFilter:["ready"]})})}};function init(){HTMLScriptElement.supports&&HTMLScriptElement.supports("importmap")?window.importOrImportShim=name=>import(name):window.importOrImportShim=name=>importShim(name),window.alpineIsInitialized=!1,window.alpineIsStarted=!1,document.addEventListener("alpine:initialized",()=>{window.alpineIsInitialized=!0}),document.addEventListener("switch:alpine:started",()=>{window.alpineIsStarted=!0}),window.alpineInitPromise=()=>new Promise(resolve=>{window.alpineIsInitialized&&resolve(),document.addEventListener("alpine:initialized",()=>{resolve()})}),window.alpineStartedPromise=()=>new Promise(resolve=>{window.alpineIsStarted&&resolve(),document.addEventListener("switch:alpine:started",()=>{resolve()})}),customElements.get("data-island")||customElements.define("data-island",DataIsland)}var{intersect,focus,collapse,morph}=AlpinePlugins;Alpine2.plugin(intersect),Alpine2.plugin(focus),Alpine2.plugin(collapse),Alpine2.plugin(morph),Alpine2.plugin(fetched_fragment_default),Alpine2.plugin(html_if_set_default),Alpine2.plugin(mask_default),window.Alpine=Alpine2,window.Spruce=Alpine2,init(),window.Splide=Splide2,window.liveRegion=liveRegion,window.variantLiveRegion=variantLiveRegion,window.cartLiveRegion=cartLiveRegion,document.addEventListener("alpine:init",()=>{Alpine2.store("modals",modals_default),Alpine2.store("cartCount",cart_count_default)}),Alpine2.data("AgeCheck",age_check_default),Alpine2.data("FreeShippingBar",free_shipping_bar_default),Alpine2.data("CartItems",cart_items_default),Alpine2.data("CartItem",cart_item_default),Alpine2.data("CartItemQuantity",cart_item_quantity_default),Alpine2.data("CartFooter",cart_footer_default),Alpine2.data("CartNote",cart_note_default),Alpine2.data("Header",header_default),Alpine2.data("Video",video_default),Alpine2.data("ProductMediaVideo",product_media_video_default),Alpine2.data("HTMLVideo",html_video_default),Alpine2.data("Filterable",filterable_default),Alpine2.data("RangeControl",range_control_default),Alpine2.data("VariantDropDown",variant_drop_down_default),Alpine2.data("Quantity",quantity_default2),Alpine2.data("Sidebar",sidebar_default),Alpine2.data("Table",table_default),Alpine2.data("ModalCart",modal_cart_default),Alpine2.data("RTE",rte_default),Alpine2.data("Slideshow",slideshow_default),Alpine2.data("PromoPopup",promo_popup_default),customElements.get("scrolling-items-container")||customElements.define("scrolling-items-container",ScrollingItemsContainer),customElements.get("scrolling-items")||customElements.define("scrolling-items",ScrollingItems),setTimeout(()=>{Alpine2.start(),document.dispatchEvent(new CustomEvent("switch:alpine:started"))}),console.log("Baseline theme (3.3.4) by SWITCH | Make the switch: https://switchthemes.co");
14//# sourceMappingURL=/cdn/shop/t/45/assets/global.bundle.js.map?v=182511672855915948941745246894

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.