PageSourceSearch

https://printroom.co/cdn/shop/t/59/assets/global.bundle.js?v=149077486339995821341790734057

js printroom.co collected 2026-10-04 08:38:43 UTC 97,670 bytes, 14 lines download raw bytes

1(function(){var STORAGE_KEY="pr_attribution",MAX_AGE_MS=7776e6,PARAM_KEYS=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","gbraid","wbraid","fbclid","msclkid"];try{var existing=null;try{existing=JSON.parse(window.localStorage.getItem(STORAGE_KEY)||"null")}catch{existing=null}if(existing&&existing.capturedAt){var age=Date.now()-new Date(existing.capturedAt).getTime();if(!isNaN(age)&&age>=0&&age<MAX_AGE_MS)return}for(var params=new URLSearchParams(window.location.search),record={},i=0;i<PARAM_KEYS.length;i++)record[PARAM_KEYS[i]]=params.get(PARAM_KEYS[i])||null;var referrer=document.referrer||null;if(referrer)try{var referrerUrl=new URL(referrer);referrer=referrerUrl.hostname===window.location.hostname?null:referrerUrl.origin}catch{referrer=null}record.referrer=referrer,record.landingPath=window.location.pathname,record.capturedAt=new Date().toISOString(),window.localStorage.setItem(STORAGE_KEY,JSON.stringify(record))}catch{}})();function readAttribution(){try{var raw=window.localStorage.getItem("pr_attribution");if(!raw)return null;var parsed=JSON.parse(raw);return parsed&&typeof parsed=="object"?parsed:null}catch{return null}}var _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);
vendor: 4,497 bytes, line 1
1inertNode&&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);
1_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]"));inertElements.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(()=>
13{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();let 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)}},favorites_default={items:[],storageKey:"pr-favorites-v2",colourChoicesByHandle:{},productImagesByHandle:{},get count(){return this.items.length},normalizeItem(item){if(!item||typeof item!="object"||!item.id)return null;var artworks=Array.isArray(item.artworks)?item.artworks:[];return artworks.length===0&&item.artwork&&item.artworkFileName,{...item,key:String(item.id)+":"+(item.variantId==null?"any":String(item.variantId)),variantId:item.variantId==null?null:Number(item.variantId),colour:typeof item.colour=="string"&&item.colour?item.colour:null,hasColours:item.hasColours===!0,sizeOptions:Array.isArray(item.sizeOptions)?item.sizeOptions:[],sizeSplit:item.sizeSplit&&typeof item.sizeSplit=="object"?item.sizeSplit:null,vendor:typeof item.vendor=="string"?item.vendor:"",productImage:typeof item.productImage=="string"&&item.productImage?item.productImage:item.variantId==null&&typeof item.image=="string"?item.image:"",color:void 0,moq:parseInt(item.moq,10)||24,quantity:Math.max(1,parseInt(item.quantity,10)||parseInt(item.moq,10)||24),artworks,artwork:null,artworkFileName:null,artworkLink:typeof item.artworkLink=="string"?item.artworkLink:"",notes:typeof item.notes=="string"?item.notes:""}},init(){this.loadFromStorage()},loadFromStorage(){try{const stored=localStorage.getItem(this.storageKey);if(stored){const parsed=JSON.parse(stored);this.items=Array.isArray(parsed)?parsed.map(item=>this.normalizeItem(item)).filter(Boolean):[],this.saveToStorage()}else this.items=[]}catch(e){console.error("Error loading favorites from storage:",e),this.items=[]}},saveToStorage(){try{var serializable=this.items.map(function(item){return!item.artworks||item.artworks.length===0?item:{...item,artworks:item.artworks.map(function(aw){var copy={...aw};return delete copy._file,copy})}});localStorage.setItem(this.storageKey,JSON.stringify(serializable))}catch(e){console.error("Error saving favorites to storage:",e)}},has(productId){return this.items.some(item=>item.id===productId)},hasLine(key){return this.items.some(item=>item.key===key)},add(product){const normalizedProduct=this.normalizeItem(product);return!normalizedProduct||this.hasLine(normalizedProduct.key)?!1:(this.items=[...this.items,normalizedProduct],this.saveToStorage(),document.dispatchEvent(new CustomEvent("quote-item-added",{detail:{product:normalizedProduct,count:this.count}})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"quote_item_added",product_id:normalizedProduct.id,variant_id:normalizedProduct.variantId,colour:normalizedProduct.colour,product_title:normalizedProduct.title,quote_count:this.count,page_path:window.location.pathname}),!0)},remove(key){const removed=this.items.find(item=>item.key===key);this.items=this.items.filter(item=>item.key!==key),this.saveToStorage(),removed&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"quote_item_removed",product_id:removed.id,variant_id:removed.variantId,colour:removed.colour,product_title:removed.title,quote_count:this.count,page_path:window.location.pathname}))},toggle(product){const item=this.normalizeItem(product);item&&(this.hasLine(item.key)?this.remove(item.key):this.add(item))},rekey(key,choice){const item=this.items.find(row=>row.key===key);if(!item)return!1;const target=String(item.id)+":"+(choice.variantId==null?"any":String(choice.variantId));return target!==key&&this.hasLine(target)?!1:(item.key=target,item.variantId=choice.variantId==null?null:Number(choice.variantId),item.colour=choice.colour||choice.label||null,typeof choice.image=="string"&&choice.image?item.image=choice.image:item.variantId==null&&(item.productImage?item.image=item.productImage:Object.prototype.hasOwnProperty.call(this.productImagesByHandle,item.handle)&&(item.image=this.productImagesByHandle[item.handle]||"")),this.items=[...this.items],this.saveToStorage(),!0)},setSizeSplit(key,split){const item=this.items.find(row=>row.key===key);if(!item)return!1;const valid=split&&typeof split=="object"?Object.fromEntries(Object.entries(split).filter(([size,qty])=>item.sizeOptions.includes(size)&&Number.isInteger(qty)&&qty>=1)):null;return item.sizeSplit=split===null?null:valid,item.sizeSplit&&Object.keys(item.sizeSplit).length&&(item.quantity=Object.values(item.sizeSplit).reduce((sum,qty)=>sum+qty,0)),this.items=[...this.items],this.saveToStorage(),!0},moqShortfalls(){const totals=new Map;for(const item of this.items){const previous=totals.get(item.id)||{id:item.id,title:item.title,total:0,moq:item.moq||24};previous.total+=Math.max(1,parseInt(item.quantity,10)||1),totals.set(item.id,previous)}return[...totals.values()].filter(row=>row.total<row.moq)},async loadColourChoices(key){const item=this.items.find(row=>row.key===key);if(!item||!item.hasColours||!item.handle)return[];if(this.colourChoicesByHandle[item.handle])return this.hydrateProductImage(item,this.productImagesByHandle[item.handle]),this.colourChoicesByHandle[item.handle];try{const response=await fetch("/products/"+encodeURIComponent(item.handle)+".js");if(!response.ok)throw new Error("Colour options unavailable");const product=await response.json(),position=(product.options||[]).findIndex(option=>
13/^(color|colour)$/i.test(typeof option=="string"?option:option.name));if(position<0)throw new Error("Colour option absent");const grouped=new Map,productImage=product.featured_image&&(product.featured_image.src||product.featured_image);this.productImagesByHandle={...this.productImagesByHandle,[item.handle]:typeof productImage=="string"?productImage:""},this.hydrateProductImage(item,productImage);for(const variant of product.variants||[]){const label=variant["option"+(position+1)];if(!label||!variant.id)continue;const variantImage=variant.featured_image&&(variant.featured_image.src||variant.featured_image),list=grouped.get(label)||[];list.push({label,variantId:Number(variant.id),image:variantImage||productImage||item.productImage||item.image||""}),grouped.set(label,list)}const choices=[...grouped.values()].filter(list=>list.length===1).map(list=>list[0]);if(this.colourChoicesByHandle={...this.colourChoicesByHandle,[item.handle]:choices},item.variantId&&!choices.some(choice=>choice.variantId===item.variantId)){const byLabel=choices.filter(choice=>choice.label===item.colour);this.rekey(key,byLabel.length===1?byLabel[0]:{variantId:null,colour:null})}return choices}catch{return this.colourChoicesByHandle={...this.colourChoicesByHandle,[item.handle]:[]},[]}},colourChoiceTaken(item,choice){const target=String(item.id)+":"+(choice.variantId==null?"any":String(choice.variantId));return target!==item.key&&this.hasLine(target)},hydrateProductImage(item,productImage){!item||typeof productImage!="string"||!productImage||item.productImage===productImage||(item.productImage=productImage,this.items=[...this.items],this.saveToStorage())},canSelectTbc(item){return!item||this.colourChoiceTaken(item,{variantId:null})?!1:item.variantId==null||!!item.productImage||Object.prototype.hasOwnProperty.call(this.productImagesByHandle,item.handle)},clear(){this.items=[],this.saveToStorage()},updateItemMeta(key,field,value){const item=this.items.find(i=>i.key===key);return item?(field==="quantity"?(item.quantity=Math.max(1,parseInt(value,10)||1),item.sizeSplit=null):field==="notes"?item.notes=typeof value=="string"?value:"":field==="artworks"?item.artworks=Array.isArray(value)?value:[]:field==="artworkLink"?item.artworkLink=typeof value=="string"?value:"":item[field]=value,this.items=[...this.items],this.saveToStorage(),field!=="artworks"&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"quote_item_meta_updated",product_id:item.id,variant_id:item.variantId,colour:item.colour,field,page_path:window.location.pathname})),this.getItemMeta(key)):this.getItemMeta(key)},getItemMeta(key){const item=this.items.find(i=>i.key===key);return{quantity:item?.quantity||1,artworks:item?.artworks||[],notes:item?.notes||"",sizeSplit:item?.sizeSplit||null}},countWithText(){const count=this.count;return count===1?"1 item":`${count} items`},getProductData(){return this.items.map(item=>{var doneFiles=(item.artworks||[]).filter(function(a){return a.status==="done"&&a.storagePath});return{id:item.id,handle:item.handle,title:item.title,price:item.price,url:item.url,quantity:item.quantity||item.moq||24,variantId:item.variantId,colour:item.colour||(item.hasColours?"TBC":null),sizeSplit:item.sizeSplit&&Object.keys(item.sizeSplit).length?Object.entries(item.sizeSplit).map(([size,qty])=>({size,qty})):null,sizesTbc:item.sizeOptions.length>0&&(!item.sizeSplit||!Object.keys(item.sizeSplit).length),artworkFiles:doneFiles.map(function(a){return{storagePath:a.storagePath,fileName:a.fileName,placement:a.placement||""}}),artworkLink:item.artworkLink||null,notes:item.notes||""}})}},favorites_drawer_default=()=>({init(){Alpine.store("modals").register("favorites","rightDrawer"),document.addEventListener("favorites-will-open",()=>{document.body.classList.add("favorites-drawer-open")}),document.addEventListener("favorites-will-close",()=>{document.body.classList.remove("favorites-drawer-open")})},formatMoney(cents){return window.theme&&window.theme.Shopify&&window.theme.Shopify.formatMoney?window.theme.Shopify.formatMoney(cents):(cents/100).toLocaleString("en-US",{style:"currency",currency:window.theme?.currency||"USD"})}}),chat_quote_default={items:[],summary:"",company:"",timeline:"",location:"",estimatedBudget:null,sessionId:null,active:!1,get count(){return this.items.length},get hasData(){return this.items.length>0||this.summary.length>0},setFromChatData(quoteData,sessionId){this.items=(quoteData.items||[]).map(function(item){return{id:item.id||"custom-"+Date.now()+"-"+Math.random().toString(36).substr(2,5),title:item.title||"Custom Item",description:item.description||"",quantity:item.quantity||null,sizes:item.sizes||[],colors:item.colors||[],decorationMethod:item.decorationMethod||"",isCustom:item.isCustom!==!1,catalogProductId:item.catalogProductId||null,catalogProductHandle:item.catalogProductHandle||null,image:item.image||null}}),this.summary=quoteData.summary||"",this.company=quoteData.company||"",this.timeline=quoteData.timeline||"",this.location=quoteData.location||"",this.estimatedBudget=quoteData.estimatedBudget||null,this.sessionId=sessionId||null,this.active=!0},clear(){this.items=[],this.summary="",this.company="",this.timeline="",this.location="",this.estimatedBudget=null,this.sessionId=null,this.active=!1},getProductData(){return this.items.map(function(item){return{id:item.catalogProductId||item.id,handle:item.catalogProductHandle||null,title:item.title,isCustom:item.isCustom,description:item.description,quantity:item.quantity,sizes:item.sizes,colors:item.colors,decorationMethod:item.decorationMethod}})}},TURNSTILE_SCRIPT_URL="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",TURNSTILE_TIMEOUT_MS=15e3,TURNSTILE_INTERACTIVE_TIMEOUT_MS=12e4,turnstileState={scriptPromise:null,widgets:{},lastFailure:{}};function loadTurnstileScript(){return turnstileState.scriptPromise||(turnstileState.scriptPromise=new Promise(function(resolve){try{if(window.turnstile)return resolve(!0);var script=document.createElement("script");script.src=TURNSTILE_SCRIPT_URL,script.async=!0,script.defer=!0,script.onload=function(){resolve(!0)},script.onerror=function(){resolve(!1)},document.head.appendChild(script)}catch{resolve(!1)}})),turnstileState.scriptPromise}function preloadTurnstile(siteKey){siteKey&&loadTurnstileScript()}function recordTurnstileFailure(action,reason){return turnstileState.lastFailure[action]=reason,""}function getTurnstileFailure(action){return turnstileState.lastFailure[action]||""}function buildTurnstileOverlay(){var overlay=document.createElement("div");overlay.setAttribute("data-turnstile-overlay",""),overlay.style.display="none",overlay.style.position="fixed",overlay.style.top="0",overlay.style.left="0",overlay.style.right="0",overlay.style.bottom="0",overlay.style.zIndex="2147483000",overlay.style.alignItems="center",overlay.style.justifyContent="center",overlay.style.background="rgba(0, 0, 0, 0.45)";var card=document.createElement("div");
13card.style.background="#FBFBF6",card.style.border="2px solid black",card.style.borderRadius="27px",card.style.boxShadow="0 4px 13px 2px rgba(0, 0, 0, 0.1)",card.style.padding="28px 32px",card.style.maxWidth="90vw",card.style.textAlign="center";var label=document.createElement("div");label.textContent="One quick check before we send your request.",label.style.color="black",label.style.fontSize="15px",label.style.marginBottom="16px";var host=document.createElement("div");return host.style.display="flex",host.style.justifyContent="center",card.appendChild(label),card.appendChild(host),overlay.appendChild(card),document.body.appendChild(overlay),{overlay,host}}function revealTurnstile(entry){try{if(!entry||!entry.overlay)return;entry.overlay.removeAttribute&&entry.overlay.removeAttribute("inert"),entry.overlay.style.display="flex"}catch{}}function hideTurnstile(entry){try{entry&&entry.overlay&&(entry.overlay.style.display="none")}catch{}}function destroyTurnstileWidget(action){var entry=turnstileState.widgets[action];entry&&(delete turnstileState.widgets[action],setTimeout(function(){try{entry.id&&window.turnstile&&window.turnstile.remove&&window.turnstile.remove(entry.id)}catch{}try{entry.overlay&&entry.overlay.parentNode&&entry.overlay.parentNode.removeChild(entry.overlay)}catch{}},0))}function createTurnstileWidget(siteKey,action){try{var parts=buildTurnstileOverlay(),entry={id:null,finish:null,extend:null,overlay:parts.overlay};return entry.id=window.turnstile.render(parts.host,{sitekey:siteKey,action,execution:"execute",appearance:"interaction-only",callback:function(token){entry.finish&&entry.finish(token,"")},"error-callback":function(){entry.finish&&entry.finish("","render-error")},"timeout-callback":function(){entry.finish&&entry.finish("","challenge-timeout")},"expired-callback":function(){entry.finish&&entry.finish("","token-expired")},"before-interactive-callback":function(){revealTurnstile(entry),entry.extend&&entry.extend()},"after-interactive-callback":function(){hideTurnstile(entry)}}),turnstileState.widgets[action]=entry,entry}catch{return null}}async function getTurnstileToken(siteKey,action){if(turnstileState.lastFailure[action]="",!siteKey)return recordTurnstileFailure(action,"no-site-key");try{var loaded=await loadTurnstileScript();if(!loaded||!window.turnstile)return recordTurnstileFailure(action,"script-blocked");var entry=turnstileState.widgets[action];if(entry)window.turnstile.reset(entry.id);else if(entry=createTurnstileWidget(siteKey,action),!entry)return recordTurnstileFailure(action,"render-error");return await new Promise(function(resolve){var settled=!1,timer=null,arm=function(ms,reason){timer&&clearTimeout(timer),timer=setTimeout(function(){finish("",reason)},ms)},finish=function(token,reason){if(!settled){settled=!0,entry.finish=null,entry.extend=null,timer&&clearTimeout(timer),hideTurnstile(entry);var value=typeof token=="string"?token:"";value||(destroyTurnstileWidget(action),recordTurnstileFailure(action,reason||"unknown")),resolve(value)}};entry.finish=finish,entry.extend=function(){settled||arm(TURNSTILE_INTERACTIVE_TIMEOUT_MS,"interaction-timeout")},arm(TURNSTILE_TIMEOUT_MS,"challenge-timeout");try{window.turnstile.execute(entry.id)}catch{finish("","execute-error")}})}catch{return recordTurnstileFailure(action,"unexpected-error")}}window.PrintRoomTurnstile=Object.freeze({preload:preloadTurnstile,getToken:getTurnstileToken,lastFailure:getTurnstileFailure});var quote_request_form_default=()=>({formData:{name:"",email:"",phone:"",company:"",description:"",budget:500,inHandDate:"",location:"",heardAbout:"",heardAboutDetail:""},uploadedFile:null,uploadedFileName:"",submitting:!1,successMessage:"",errorMessage:"",webhookUrl:"",uploadApiUrl:"",quoteSessionId:"",turnstileSiteKey:"",init(){Alpine.store("modals").register("quoteRequest","modal");const container=this.$root;this.webhookUrl=container.dataset.webhookUrl||"https://print-room-chatbot-api.vercel.app/api/quote-request";var baseUrl=this.webhookUrl.replace(/\/api\/quote-request\/?$/,"");this.uploadApiUrl=baseUrl+"/api/quote-artwork-upload",this.turnstileSiteKey=container.dataset.turnstileSiteKey||"",document.body.addEventListener("quote-request-will-open",()=>
13{preloadTurnstile(this.turnstileSiteKey),this.quoteSessionId||(this.quoteSessionId=crypto.randomUUID?crypto.randomUUID():Date.now().toString(36)+Math.random().toString(36).substr(2)),this.prefillFromChatQuote(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"quote_request_started",quote_count:Alpine.store("favorites").count,page_path:window.location.pathname})}),this.$watch("formData.heardAbout",value=>{value!=="Referral or word of mouth"&&value!=="Other"&&(this.formData.heardAboutDetail="")})},prefillFromChatQuote(){const chatQuote=Alpine.store("chatQuote");if(!(!chatQuote||!chatQuote.active)){if(chatQuote.summary&&!this.formData.description&&(this.formData.description=chatQuote.summary),chatQuote.company&&!this.formData.company&&(this.formData.company=chatQuote.company),chatQuote.timeline&&!this.formData.inHandDate){var parsed=new Date(chatQuote.timeline);isNaN(parsed.getTime())||(this.formData.inHandDate=parsed.toISOString().split("T")[0])}if(chatQuote.location&&!this.formData.location){var locationMap={"new zealand":"New Zealand",nz:"New Zealand",australia:"Australia",au:"Australia",international:"International"},mapped=locationMap[chatQuote.location.toLowerCase()];mapped&&(this.formData.location=mapped)}if(chatQuote.estimatedBudget){var budget=Number(chatQuote.estimatedBudget);budget>=500&&budget<=1e4&&(this.formData.budget=Math.round(budget/500)*500)}}},handleFileUpload(event){const file=event.target.files[0];if(file){if(file.size>10*1024*1024){this.uploadedFile=null,this.uploadedFileName="",this.errorMessage="File size must be under 10MB",event.target.value="";return}this.uploadedFile=file,this.uploadedFileName=file.name,this.errorMessage=""}},async handlePerProductFileUpload(event,productId){const files=Array.from(event.target.files||[]);if(files.length===0)return;const favorites=Alpine.store("favorites"),item=favorites.items.find(function(i2){return i2.key===productId});if(item){var currentArtworks=item.artworks||[],remaining=5-currentArtworks.length,filesToProcess=files.slice(0,remaining);files.length>remaining?this.errorMessage="Maximum 5 files per product. Only the first "+remaining+" were added.":this.errorMessage="";for(var i=0;i<filesToProcess.length;i++){var file=filesToProcess[i];if(file.size>10*1024*1024){this.errorMessage=file.name+" exceeds 10MB limit.";continue}var artworkEntry={fileName:file.name,fileSize:file.size,mimeType:file.type||"application/octet-stream",storagePath:null,status:"uploading",placement:"",_file:file};currentArtworks=[...currentArtworks,artworkEntry],favorites.updateItemMeta(productId,"artworks",currentArtworks),this._uploadSingleFile(productId,currentArtworks.length-1,file)}event.target.value=""}},async _uploadSingleFile(productId,artworkIndex,file){var favorites=Alpine.store("favorites"),item=favorites.items.find(function(i){return i.key===productId});if(item)try{var signedRes=await fetch(this.uploadApiUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileName:file.name,mimeType:file.type||"application/octet-stream",quoteSessionId:this.quoteSessionId,productHandle:item.handle||null,fileSize:file.size})});if(!signedRes.ok){var errData=await signedRes.json().catch(function(){return{}});throw new Error(errData.error||"Failed to get upload URL")}var signed=await signedRes.json(),uploadRes=await fetch(signed.signedUrl,{method:"PUT",headers:{"Content-Type":file.type||"application/octet-stream"},body:file});if(!uploadRes.ok)throw new Error("Storage upload failed: "+uploadRes.status);var artworks=[...item.artworks||[]];artworks[artworkIndex]&&(artworks[artworkIndex]={...artworks[artworkIndex],storagePath:signed.storagePath,status:"done",_file:null},favorites.updateItemMeta(productId,"artworks",artworks))}catch(err){console.error("Artwork upload failed:",err);var artworks2=[...item.artworks||[]];artworks2[artworkIndex]&&(artworks2[artworkIndex]={...artworks2[artworkIndex],status:"error",_file:file},favorites.updateItemMeta(productId,"artworks",artworks2))}},async retryArtworkUpload(productId,artworkIndex){var favorites=Alpine.store("favorites"),item=favorites.items.find(function(i){return i.key===productId});if(!(!item||!item.artworks||!item.artworks[artworkIndex])){var aw=item.artworks[artworkIndex];if(aw.status!=="error"||!aw._file){this.errorMessage="Cannot retry \u2014 original file not available. Please re-select the file.";return}var artworks=[...item.artworks];artworks[artworkIndex]={...artworks[artworkIndex],status:"uploading"},favorites.updateItemMeta(productId,"artworks",artworks),await this._uploadSingleFile(productId,artworkIndex,aw._file)}},async removeArtwork(productId,artworkIndex){var favorites=Alpine.store("favorites"),item=favorites.items.find(function(i){return i.key===productId});if(!(!item||!item.artworks)){var aw=item.artworks[artworkIndex],artworks=item.artworks.filter(function(_,idx){return idx!==artworkIndex});favorites.updateItemMeta(productId,"artworks",artworks),aw.storagePath&&this.uploadApiUrl}},updateArtworkPlacement(productId,artworkIndex,placement){var favorites=Alpine.store("favorites"),item=favorites.items.find(function(i){return i.key===productId});if(!(!item||!item.artworks||!item.artworks[artworkIndex])){var artworks=[...item.artworks];artworks[artworkIndex]={...artworks[artworkIndex],placement},favorites.updateItemMeta(productId,"artworks",artworks)}},async submitQuote(){this.submitting=!0,this.errorMessage="",this.successMessage="";try{const favorites=Alpine.store("favorites"),chatQuote=Alpine.store("chatQuote");let products,source="Quote List";if(chatQuote&&chatQuote.active&&chatQuote.count>0?(products=chatQuote.getProductData(),source="Chatbot"):chatQuote&&chatQuote.active?(products=[],source="Chatbot"):products=favorites.getProductData(),products.find(p=>p.handle==="mystery-product"&&(!p.notes||!p.notes.trim()))){this.errorMessage="Please add notes for the Mystery Product \u2014 include the brand, product name or SKU you require.",this.submitting=!1;return}if(source==="Quote List"){const shortfall=favorites.moqShortfalls()[0];if(shortfall){this.errorMessage=shortfall.title+" total "+shortfall.total+" \u2014 minimum "+sh
13ortfall.moq,this.submitting=!1;return}}for(var allItems=source==="Chatbot"?[]:favorites.items,i=0;i<allItems.length;i++){var itm=allItems[i];if(itm.artworks&&itm.artworks.length>0){var uploading=itm.artworks.filter(function(a){return a.status==="uploading"}),errored=itm.artworks.filter(function(a){return a.status==="error"});if(uploading.length>0){this.errorMessage="Please wait for uploads to finish before submitting.",this.submitting=!1;return}if(errored.length>0){this.errorMessage="Some artwork files failed to upload. Please retry or remove them before submitting.",this.submitting=!1;return}}}const turnstileToken=await getTurnstileToken(this.turnstileSiteKey,"quote-request"),turnstileFailure=turnstileToken?"":getTurnstileFailure("quote-request"),result=await(await fetch(this.webhookUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({turnstileToken,turnstileFailure,name:this.formData.name,email:this.formData.email,phone:this.formData.phone,company:this.formData.company,description:this.formData.description,budget:this.formData.budget,inHandDate:this.formData.inHandDate,location:this.formData.location,heardAbout:this.formData.heardAbout,heardAboutDetail:this.formData.heardAboutDetail,attribution:readAttribution(),products,quoteSessionId:this.quoteSessionId,source,chatSessionId:chatQuote&&chatQuote.active?chatQuote.sessionId:null,chatSummary:chatQuote&&chatQuote.active?chatQuote.summary:null})})).json();if(result.success)result.artworkFailures&&result.artworkFailures.length>0?this.successMessage="Quote submitted! Note: some artwork files could not be synced to our system. Our team has been notified.":this.successMessage="Quote request submitted successfully!",window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"quote_request_submitted",quote_count:products.length,page_path:window.location.pathname,has_chat_quote:!!(chatQuote&&chatQuote.active),source}),window.dataLayer.push({event:"generate_lead",lead_type:"quote_request",quote_count:products.length,page_path:window.location.pathname,has_chat_quote:!!(chatQuote&&chatQuote.active),source,heard_about_us:this.formData.heardAbout,user_data:{email:this.formData.email,phone_number:this.formData.phone}}),this.resetForm(),favorites.clear(),chatQuote&&chatQuote.clear();else{console.error("Webhook error:",result);const submitError=new Error(result.error||"Submission failed");throw submitError.serverMessage=typeof result.error=="string"?result.error:"",submitError}}catch(error){console.error("Quote submission error:",error),this.errorMessage=error&&error.serverMessage||"There was an error submitting your request. Please try again or contact us directly."}finally{this.submitting=!1}},selectHeardAbout(value){this.formData.heardAbout=value,value!=="Referral or word of mouth"&&value!=="Other"&&(this.formData.heardAboutDetail="")},resetForm(){this.formData={name:"",email:"",phone:"",company:"",description:"",budget:500,inHandDate:"",location:"",heardAbout:"",heardAboutDetail:""},this.uploadedFile=null,this.uploadedFileName="",this.quoteSessionId=""}}),book_request_form_default=()=>({formData:{name:"",email:"",phone:"",company:"",projectType:"",quantityBand:"",timeline:"",brief:"",preferredTime:"",heardAbout:"",heardAboutDetail:""},turnstileSiteKey:"",submitting:!1,submitted:!1,errorMessage:"",endpointUrl:"",stepError:"",copied:!1,artworks:[],artworkError:"",uploadApiUrl:"",artworkMaxFiles:5,artworkMaxBytes:10*1024*1024,artworkAllowedTypes:["image/png","image/jpeg","image/svg+xml","application/pdf","application/postscript","application/illustrator","application/x-eps"],artworkSessionId:(()=>{try{return crypto.randomUUID()}catch{}return"bac-art-"+Math.random().toString(36).slice(2,10)+Date.now().toString(36)})(),formVersion:"2026-07-24",attemptId:(()=>{try{return crypto.randomUUID()}catch{}return"bac-"+Math.random().toString(36).slice(2,10)+Date.now().toString(36)})(),startedAt:null,started:!1,_seq:0,get firstName(){return(this.formData.name||"").trim().split(/\s+/)[0]||""},_now(){return Date.now()},_elapsed(from){return from?Math.max(0,Math.round((this._now()-from)/1e3)):0},track(event,params){try{(window.dataLayer=window.dataLayer||[]).push(Object.assign({event,form_id:"book_a_call",form_version:this.formVersion,attempt_id:this.attemptId,event_seq:++this._seq},params||{}))}catch{}},markStarted(){if(this.started)return;this.started=!0,this.startedAt=this._now(),preloadTurnstile(this.turnstileSiteKey);const a=(typeof readAttribution=="function"?readAttribution():null)||{};this.track("book_a_call_start",{source:a.utm_source||null,medium:a.utm_medium||null,campaign:a.utm_campaign||null})},init(){this.endpointUrl=this.$root.dataset.endpointUrl||"https://print-room-chatbot-api.vercel.app/api/book-a-call",this.uploadApiUrl=this.$root.dataset.uploadApiUrl||this.endpointUrl.replace(/\/api\/book-a-call\/?$/,"")+"/api/quote-artwork-upload",this.turnstileSiteKey=this.$root.dataset.turnstileSiteKey||"",this.$watch("formData.heardAbout",value=>{value!=="Referral or word of mouth"&&value!=="Other"&&(this.formData.heardAboutDetail="")})},validateStep(step){const d=this.formData;
13switch(step){case 1:return d.name.trim()?"":"Please tell us your name.";case 2:return!d.email.trim()||!/.+@.+\..+/.test(d.email)?"Please enter a valid email address.":d.phone.trim()?"":"Please enter your phone number.";case 5:return d.heardAbout?d.heardAbout==="Other"&&!d.heardAboutDetail.trim()?"Please tell us how you found us.":"":"Please pick an option.";case 6:return d.brief.trim()?"":"Please tell us a little about your brief.";default:return""}},_requiredGroups:[1,2,5,6],validateAll(){for(const step of this._requiredGroups)if(this.validateStep(step))return step;return 0},submitFlat(){const bad=this.validateAll();if(bad){this.stepError=this.validateStep(bad);const focusFirst=()=>{let sel={1:"#bc-name",2:"#bc-email",5:"[name=bc-heard]",6:"#bc-brief"}[bad];bad===2&&this.formData.email.trim()&&/.+@.+\..+/.test(this.formData.email)&&(sel="#bc-phone");const el=sel&&this.$root&&this.$root.querySelector(sel);el&&el.focus&&(el.focus(),el.scrollIntoView&&el.scrollIntoView({block:"center"}))};typeof this.$nextTick=="function"?this.$nextTick(focusFirst):focusFirst();return}this.stepError="",this.submitBooking()},async copyEmail(){try{await navigator.clipboard.writeText("[email protected]"),this.copied=!0,setTimeout(()=>{this.copied=!1},1500)}catch{}},handleArtworkFiles(event){const input=event&&event.target,files=Array.from(input&&input.files||[]);if(input&&(input.value=""),files.length===0)return;this.artworkError="";const remaining=this.artworkMaxFiles-this.artworks.length;if(remaining<=0){this.artworkError="You can attach up to "+this.artworkMaxFiles+" files.";return}let accepted=0;for(const file of files){if(accepted>=remaining)break;if(file.size>this.artworkMaxBytes){this.artworkError="\u201C"+file.name+"\u201D is over 10MB.";continue}if(file.type&&this.artworkAllowedTypes.indexOf(file.type)===-1){this.artworkError="\u201C"+file.name+"\u201D isn\u2019t a supported file type (PNG, JPG, SVG, PDF, AI or EPS).";continue}const id=(()=>{try{return crypto.randomUUID()}catch{}
13return"aw-"+Math.random().toString(36).slice(2)+Date.now().toString(36)})();this.artworks.push({id,fileName:file.name,fileSize:file.size,mimeType:file.type||"application/octet-stream",storagePath:null,status:"uploading",_file:file}),accepted++,this._uploadArtwork(id,file)}files.length>remaining&&(this.artworkError="You can attach up to "+this.artworkMaxFiles+" files \u2014 extras were skipped.")},_patchArtwork(id,fields){const i=this.artworks.findIndex(a=>a.id===id);i!==-1&&(this.artworks[i]=Object.assign({},this.artworks[i],fields))},async _uploadArtwork(id,file){try{const signedRes=await fetch(this.uploadApiUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileName:file.name,mimeType:file.type||"application/octet-stream",quoteSessionId:this.artworkSessionId,productHandle:null,fileSize:file.size})});if(!signedRes.ok){const errData=await signedRes.json().catch(()=>({}));throw new Error(errData.error||"Failed to get upload URL")}const signed=await signedRes.json(),uploadRes=await fetch(signed.signedUrl,{method:"PUT",headers:{"Content-Type":file.type||"application/octet-stream"},body:file});if(!uploadRes.ok)throw new Error("Storage upload failed: "+uploadRes.status);this._patchArtwork(id,{storagePath:signed.storagePath,status:"done",_file:null})}catch(err){console.error("Book-a-call artwork upload failed:",err),this._patchArtwork(id,{status:"error"})}},removeArtwork(index){this.artworks.splice(index,1)},retryArtwork(index){const entry=this.artworks[index];if(!entry||entry.status!=="error"||!entry._file){this.artworkError="Please re-select the file to retry.";return}const file=entry._file;this.artworks[index]=Object.assign({},entry,{status:"uploading"}),this._uploadArtwork(entry.id,file)},async submitBooking(){this.submitting=!0,this.errorMessage="";try{const turnstileToken=await getTurnstileToken(this.turnstileSiteKey,"book-a-call"),turnstileFailure=turnstileToken?"":getTurnstileFailure("book-a-call"),result=await(await fetch(this.endpointUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({turnstileToken,turnstileFailure,name:this.formData.name,email:this.formData.email,phone:this.formData.phone,company:this.formData.company,projectType:this.formData.projectType,quantityBand:this.formData.quantityBand,timeline:this.formData.timeline,brief:this.formData.brief,preferredTime:this.formData.preferredTime,heardAbout:this.formData.heardAbout,heardAboutDetail:this.formData.heardAboutDetail,attribution:readAttribution(),artworkFiles:this.artworks.filter(a=>a.status==="done"&&a.storagePath).map(a=>({storagePath:a.storagePath,fileName:a.fileName}))})})).json();if(result.success)this.submitted=!0,this.track("book_a_call_submit_success",{seconds_total:this._elapsed(this.startedAt)}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"generate_lead",lead_type:"book_a_call",form:"book-a-call",page_path:window.location.pathname,heard_about_us:this.formData.heardAbout,user_data:{email:this.formData.email,phone_number:this.formData.phone}});else{const submitError=new Error(result.error||"Submission failed");throw submitError.serverMessage=typeof result.error=="string"?result.error:"",submitError}}catch(error){this.track("book_a_call_submit_error",{seconds_total:this._elapsed(this.startedAt)}),console.error("Book-a-call submission error:",error),this.errorMessage=error&&error.serverMessage||"There was an error submitting your request. Please try again or email [email protected]."}finally{this.submitting=!1}}}),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}
13,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.id}));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.ke
13y}"]`)||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;console.log("adjustQuantity called, before:",quantityBeforeAdjustment),adjustCb(),console.log("After adjustCb, input value:",this.$refs.quantityInput.value),this.quantity=parseInt(this.$refs.quantityInput.value)||1,console.log("After sync, quantity:",this.quantity),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:1,init(){const inputValue=parseInt(this.$refs.quantityInput.value);if(!isNaN(inputValue)&&inputValue>0&&(this.quantity=inputValue),console.log("Quantity component initialized:",this.quantity,"Input value:",this.$refs.quantityInput.value),this.$watch("quantity",value=>{console.log("Quantity changed to:",value,"Input value:",this.$refs.quantityInput.value),this.$refs.quantityInput&&this.$refs.quantityInput.value!=value&&(this.$refs.quantityInput.value=value,console.log("Synced input value to:",value))}),this.$refs.quantityInput.getAttribute("name")==="quantity"){const resetHandler=()=>{this.quantity=1,this.$refs.quantityInput.value=1};document.body.addEventListener("baseline:productform:success",resetHandler)}},...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.store("favorites",favorites_default),Alpine2.store("chatQuote",chat_quote_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),Alpine2.data("FavoritesDrawer",favorites_drawer_default),Alpine2.data("QuoteRequestForm",quote_request_form_default),Alpine2.data("BookRequestForm",book_request_form_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.1) by SWITCH | Make the switch: https://switchthemes.co");var links=document.links;for(let i=0,linksLength=links.length;i<linksLength;i++)links[i].hostname!==window.location.hostname&&(links[i].target="_blank",links[i].rel="noreferrer noopener");
14//# sourceMappingURL=/cdn/shop/t/59/assets/global.bundle.js.map?v=149077486339995821341790734057

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.