1function getFocusableElements(container){return Array.from(container.querySelectorAll("summary, a[href], button:enabled, [tabindex]:not([tabindex^='-']), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe"))}const trapFocusHandlers={};function trapFocus(container,elementToFocus=container){var elements=getFocusableElements(container),first=elements[0],last=elements[elements.length-1];removeTrapFocus(),trapFocusHandlers.focusin=event=>{event.target!==container&&event.target!==last&&event.target!==first||document.addEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.keydown=function(event){event.code.toUpperCase()==="TAB"&&(event.target===last&&!event.shiftKey&&(event.preventDefault(),first.focus()),(event.target===container||event.target===first)&&event.shiftKey&&(event.preventDefault(),last.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),elementToFocus.focus()}try{document.querySelector(":focus-visible")}catch{focusVisiblePolyfill()}function focusVisiblePolyfill(){const navKeys=["ARROWUP","ARROWDOWN","ARROWLEFT","ARROWRIGHT","TAB","ENTER","SPACE","ESCAPE","HOME","END","PAGEUP","PAGEDOWN"];let currentFocusedElement=null,mouseClick=null;window.addEventListener("keydown",event=>{navKeys.includes(event.code.toUpperCase())&&(mouseClick=!1)}),window.addEventListener("mousedown",event=>{mouseClick=!0}),window.addEventListener("focus",()=>{currentFocusedElement&¤tFocusedElement.classList.remove("focused"),!mouseClick&&(currentFocusedElement=document.activeElement,currentFocusedElement.classList.add("focused"))},!0)}function pauseAllMedia(){document.querySelectorAll(".js-youtube").forEach(video=>{video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),document.querySelectorAll(".js-vimeo").forEach(video=>{video.contentWindow.postMessage('{"method":"pause"}',"*")}),document.querySelectorAll("video").forEach(video=>video.pause()),document.querySelectorAll("product-model").forEach(model=>{model.modelViewerUI&&modelViewerUI.pause()})}function removeTrapFocus(elementToFocus=null){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown),elementToFocus&&elementToFocus.focus()}function onKeyUpEscape(event){if(event.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event.target.closest("details[open]");if(!openDetailsElement)return;const summaryElement=openDetailsElement.querySelector("summary");openDetailsElement.removeAttribute("open"),summaryElement.focus()}class QuantityInput extends HTMLElement{constructor(){super(),this.input=this.querySelector("input"),this.changeEvent=ne
1w Event("change",{bubbles:!0}),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)))}getLimitData(){if(this.dataset.productQty&&this.dataset.productId)return{productQty:this.dataset.productQty,productId:this.dataset.productId};const productForm=this.closest("[id^='ProductInfo-']")?.querySelector("product-form");return productForm?.dataset.productQty&&productForm?.dataset.productId?{productQty:productForm.dataset.productQty,productId:productForm.dataset.productId}:null}getVariantId(){if(this.dataset.variantId)return parseInt(this.dataset.variantId,10);const formId=this.dataset.formId||this.input?.getAttribute("form"),variantInput=(formId?document.getElementById(formId):null)?.querySelector('[name="id"]');if(variantInput)return parseInt(variantInput.value,10);const productInfo=this.closest("[id^='ProductInfo-']");return parseInt(productInfo?.querySelector('form[data-type="add-to-cart-form"] [name="id"]')?.value,10)}getCartContents(){return fetch(`${routes.cart_url}.js`,{method:"GET",headers:{Accept:"application/json"}}).then(response=>{if(!response.ok)throw new Error(`Cart fetch failed: ${response.status}`);return response.json()})}async wouldExceedLimit(newQty){const limitData=this.getLimitData();if(!limitData)return!1;const limit=parseInt(limitData.productQty,10),productId=parseInt(limitData.productId,10),matchingItems=(await this.getCartContents()).items.filter(item=>item.product_id===productId),cartQty=matchingItems.reduce((total,item)=>total+item.quantity,0);if(this.dataset.variantId&&!this.dataset.formId){const currentLineQty=parseInt(this.input.value||0,10),projectedCartQty=cartQty-currentLineQty+newQty;return newQty>limit||projectedCartQty>limit}if(newQty>limit||cartQty>limit)return!0;const variantId=this.getVariantId(),isNewVariant=!matchingItems.some(item=>item.variant_id===variantId);return cartQty+newQty>limit?!(cartQty===limit&&isNewVariant):!1}async onButtonClick(event){event.preventDefault();const previousValue=this.input.value;if(event.target.name==="plus"){const newQty=parseInt(this.input.value||1,10)+1;try{if(await this.wouldExceedLimit(newQty))return}catch(e){console.error(e);return}this.input.stepUp()}else this.input.stepDown();previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent)}}customElements.define("quantity-input",QuantityInput);function debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}const serializeForm=form=>{const obj={},formData=new FormData(form);for(const key of formData.keys()){const regex=/(?:^(properties\[))(.*?)(?:\]$)/;regex.test(key)?(obj.properties=obj.properties||{},obj.properties[regex.exec(key)[2]]=formData.get(key)):obj[key]=formData.get(key)}return JSON.stringify(obj)};function getCartUpdatesToRemoveQuantity(items,quantityToRemove){let remaining=quantityToRemove;const updates={};for(const item of items){if(remaining<=0)break;const removeFromLine=Math.min(item.quantity,remaining);updates[item.key]=item.quantity-removeFromLine,remaining-=removeFromLine}return updates}async function getCartContents(){const response=await fetch(`${routes.cart_url}.js`,{method:"GET",headers:{Accept:"application/json"}});if(!response.ok)throw new Error(`Cart fetch failed: ${response.status}`);return response.json()}async function prepareCartForAdd({productId,productQty,variantId,quantity=1}){const cart=await getCartContents(),limit=parseInt(productQty,10),parsedProductId=parseInt(productId,10),addQty=parseInt(quantity,10),matchingItems=cart.items.filter(item=>item.product_id===parsedProductId),cartQty=matchingItems.reduce((total,item)=>total+item.quantity,0);if(addQty>limit||cartQty>limit)return!1;const parsedVariantId=parseInt(variantId,10),isNewVariant=!matchingItems.some(item=>item.variant_id===parsedVariantId);if(cartQty+addQty>limit){if(cartQty===limit&&isNewVariant){const existingItems=matchingItems.filter(item=>item.variant_id!==parsedVariantId),updates=getCartUpdatesToRemoveQuantity(existingItems,addQty),response=await fetch(`${routes.cart_update_url}`,{...fetchConfig("javascript"),body:JSON.stringify({updates})});if(!response.ok)throw new Error(`Cart update failed: ${response.status}`);return await response.json(),!0}return!1}return!0}function fetchConfig(type="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}function formatAsCurrency(num){return numbro(num).formatCurrency({thousandSeparated:!0,mantissa:2})}Premier={},Premier.syncProductTiles=function(){var tiles=document.querySelectorAll(".card--product"),arr=$.makeArray(tiles);arr.sort(function(a,b){return $(a).outerHeight()-$(b).outerHeight()}
1).reverse(),tiles.forEach(tile=>{$(tile).outerHeight($(arr[0]).outerHeight(!0))})},$(window).on("resize, load",function(){Premier.syncProductTiles()}),typeof window.Shopify>"u"&&(window.Shopify={}),Shopify.bind=function(fn,scope){return function(){return fn.apply(scope,arguments)}},Shopify.setSelectorByValue=function(selector,value){for(var i=0,count=selector.options.length;i<count;i++){var option=selector.options[i];if(value==option.value||value==option.innerHTML)return selector.selectedIndex=i,i}},Shopify.addListener=function(target,eventName,callback){target.addEventListener?target.addEventListener(eventName,callback,!1):target.attachEvent("on"+eventName,callback)},Shopify.postLink=function(path,options){options=options||{};var method=options.method||"post",params=options.parameters||{},form=document.createElement("form");form.setAttribute("method",method),form.setAttribute("action",path);for(var key in params){var hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden"),hiddenField.setAttribute("name",key),hiddenField.setAttribute("value",params[key]),form.appendChild(hiddenField)}document.body.appendChild(form),form.submit(),document.body.removeChild(form)},Shopify.CountryProvinceSelector=function(country_domid,province_domid,options){this.countryEl=document.getElementById(country_domid),this.provinceEl=document.getElementById(province_domid),this.provinceContainer=document.getElementById(options.hideElement||province_domid),Shopify.addListener(this.countryEl,"change",Shopify.bind(this.countryHandler,this)),this.initCountry(),this.initProvince()},Shopify.CountryProvinceSelector.prototype={initCountry:function(){var value=this.countryEl.getAttribute("data-default");Shopify.setSelectorByValue(this.countryEl,value),this.countryHandler()},initProvince:function(){var value=this.provinceEl.getAttribute("data-default");value&&this.provinceEl.options.length>0&&Shopify.setSelectorByValue(this.provinceEl,value)},countryHandler:function(e){var opt=this.countryEl.options[this.countryEl.selectedIndex],raw=opt.getAttribute("data-provinces"),provinces=JSON.parse(raw);if(this.clearOptions(this.provinceEl),provinces&&provinces.length==0)this.provinceContainer.style.display="none";else{for(var i=0;i<provinces.length;i++){var opt=document.createElement("option");opt.value=provinces[i][0],opt.innerHTML=provinces[i][1],this.provinceEl.appendChild(opt)}this.provinceContainer.style.display=""}},clearOptions:function(selector){for(;selector.firstChild;)selector.removeChild(selector.firstChild)},setOptions:function(selector,values){for(var i=0,count=values.length;i<values.length;i++){var opt=document.createElement("option");opt.value=values[i],opt.innerHTML=values[i],selector.appendChild(opt)}}};class MenuDrawer extends HTMLElement{constructor(){super(),this.mainDetailsToggle=this.querySelector("details");const summaryElements=this.querySelectorAll("summary");this.addAccessibilityAttributes(summaryElements),navigator.platform==="iPhone"&&document.documentElement.style.setProperty("--viewport-height",`${window.innerHeight}px`),this.addEventListener("keyup",this.onKeyUp.bind(this)),this.addEventListener("focusout",this.onFocusOut.bind(this)),this.bindEvents()}bindEvents(){this.querySelectorAll("summary").forEach(summary=>summary.addEventListener("click",this.onSummaryClick.bind(this))),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onCloseButtonClick.bind(this)))}addAccessibilityAttributes(summaryElements){summaryElements.forEach(element=>{element.setAttribute("role","button"),element.setAttribute("aria-expanded",!1),element.setAttribute("aria-controls",element.nextElementSibling.id)})}onKeyUp(event){if(event.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event.target.closest("details[open]");openDetailsElement&&(openDetailsElement===this.mainDetailsToggle?this.closeMenuDrawer(this.mainDetailsToggle.querySelector("summary")):this.closeSubmenu(openDetailsElement))}onSummaryClick(event){const summaryElement=event.currentTarget,detailsElement=summaryElement.parentNode,isOpen=detailsElement.hasAttribute("open");detailsElement===this.mainDetailsToggle?(isOpen&&event.preventDefault(),isOpen?this.closeMenuDrawer(summaryElement):this.openMenuDrawer(summaryElement)):(trapFocus(summaryElement.nextElementSibling,detailsElement.querySelector("button")),setTimeout(()=>{detailsElement.classList.add("menu-opening")}))}openMenuDrawer(summaryElement){setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`)}closeMenuDrawer(event,elementToFocus=!1){event!==void 0&&(this.mainDetailsToggle.classList.remove("menu-opening"),this.mainDetailsToggle.querySelectorAll("details").forEach(detail
1s=>{details.removeAttribute("open"),details.classList.remove("menu-opening")}),this.mainDetailsToggle.querySelector("summary").setAttribute("aria-expanded",!1),document.body.classList.remove(`overflow-hidden-${this.dataset.breakpoint}`),removeTrapFocus(elementToFocus),this.closeAnimation(this.mainDetailsToggle))}onFocusOut(event){setTimeout(()=>{this.mainDetailsToggle.hasAttribute("open")&&!this.mainDetailsToggle.contains(document.activeElement)&&this.closeMenuDrawer()})}onCloseButtonClick(event){const detailsElement=event.currentTarget.closest("details");this.closeSubmenu(detailsElement)}closeSubmenu(detailsElement){detailsElement.classList.remove("menu-opening"),removeTrapFocus(),this.closeAnimation(detailsElement)}closeAnimation(detailsElement){let animationStart;const handleAnimation=time=>{animationStart===void 0&&(animationStart=time),time-animationStart<400?window.requestAnimationFrame(handleAnimation):(detailsElement.removeAttribute("open"),detailsElement.closest("details[open]")&&trapFocus(detailsElement.closest("details[open]"),detailsElement.querySelector("summary")))};window.requestAnimationFrame(handleAnimation)}}customElements.define("menu-drawer",MenuDrawer);class HeaderDrawer extends MenuDrawer{constructor(){super()}openMenuDrawer(summaryElement){this.header=this.header||document.getElementById("shopify-section-header"),this.borderOffset=this.borderOffset||this.closest(".header-wrapper").classList.contains("header-wrapper--border-bottom")?1:0,document.documentElement.style.setProperty("--header-bottom-position",`${parseInt(this.header.getBoundingClientRect().bottom-this.borderOffset)}px`),setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`)}}customElements.define("header-drawer",HeaderDrawer);class ModalDialog extends HTMLElement{constructor(){super(),this.querySelector('[id^="ModalClose-"]').addEventListener("click",this.hide.bind(this)),this.addEventListener("keyup",event=>{event.code.toUpperCase()==="ESCAPE"&&this.hide()}),this.classList.contains("media-modal")?this.addEventListener("pointerup",event=>{event.pointerType==="mouse"&&!event.target.closest("deferred-media, product-model")&&this.hide()}):this.addEventListener("click",event=>{event.target.nodeName==="MODAL-DIALOG"&&this.hide()})}show(opener){this.openedBy=opener;const popup=this.querySelector(".template-popup");document.body.classList.add("overflow-hidden"),this.setAttribute("open",""),popup&&popup.loadContent(),trapFocus(this,this.querySelector('[role="dialog"]'))}hide(){document.body.classList.remove("overflow-hidden"),this.removeAttribute("open"),removeTrapFocus(this.openedBy),window.pauseAllMedia()}}customElements.define("modal-dialog",ModalDialog);class ModalOpener extends HTMLElement{constructor(){super();const button=this.querySelector("button");button&&button.addEventListener("click",()=>{const modal=document.querySelector(this.getAttribute("data-modal"));modal&&modal.show(button)})}}customElements.define("modal-opener",ModalOpener);class DeferredMedia extends HTMLElement{constructor(){super();const poster=this.querySelector('[id^="Deferred-Poster-"]');poster&&poster.addEventListener("click",this.loadContent.bind(this))}loadContent(){if(window.pauseAllMedia(),!this.getAttribute("loaded")){const content=document.createElement("div");content.appendChild(this.querySelector("template").content.firstElementChild.cloneNode(!0)),this.setAttribute("loaded",!0),this.appendChild(content.querySelector("video, model-viewer, iframe")).focus()}}}customElements.define("deferred-media",DeferredMedia);class SliderComponent extends HTMLElement{constructor(){if(super(),this.slider=this.querySelector("ul"),this.sliderItems=this.querySelectorAll("li"),this.pageCount=this.querySelector(".slider-counter--current"),this.pageTotal=this.querySelector(".slider-counter--total"),this.sliderBullets=this.querySelectorAll(".slider-bullet"),this.currentIndex=0,!this.slider)return;new ResizeObserver(entries=>this.initPages()).observe(this.slider),this.slider.addEventListener("scroll",this.update.bind(this))}initPages(){const sliderItemsToShow=Array.from(this.sliderItems).filter(element=>element.clientWidth>0);this.sliderLastItem=sliderItemsToShow[sliderItemsToShow.length-1],sliderItemsToShow.length!==0&&(this.slidesPerPage=Math.floor(this.slider.clientWidth/sliderItemsToShow[0].clientWidth),this.totalPages=sliderItemsToShow.length-this.slidesPerPage+1,this.update())}update(){!this.pageCount||!this.pageTotal||(this.sliderBullets[this.currentIndex].classList.remove("active"),this.currentIndex=Math.round(this.slider.scrollLeft/this.sliderLastItem.clientWidth),this.sliderBullets[this.currentIndex].classList.add("active"))}onButtonClick(event){event.preventDefault();const slideScrollPosition=event.currentTarget.name==="next"?this.slider.scrollLeft+this.sliderLastItem.clientWidth:this.slider.scrollLeft-this.sliderLastItem.clientWidth;this.slider.scrollTo({left:slideScrollPosition})}}customElements.define("slider-component",SliderComponent);class VariantSelects extends HTMLElement{constructor(){super(),this.addEventListener("change",this.onVariantChange)}onVariantChange(){this.updateOptions(),this.updateMasterId(),this.toggleAddButton(!0,"",!1),this.updatePickupAvailability(),this.currentVariant?(this.updateMedia(),this.updateURL(),this.updateV
1ariantInput(),this.renderProductInfo()):(this.toggleAddButton(!0,"",!0),this.setUnavailable())}updateOptions(){this.options=Array.from(this.querySelectorAll("select"),select=>select.value)}updateMasterId(){this.currentVariant=this.getVariantData().find(variant=>!variant.options.map((option,index)=>this.options[index]===option).includes(!1))}updateMedia(){if(!this.currentVariant||!this.currentVariant.featured_media)return;const newMedia=document.querySelector(`[data-media-id="${this.dataset.section}-${this.currentVariant.featured_media.id}"]`);if(!newMedia)return;const modalContent=document.querySelector(`#ProductModal-${this.dataset.section} .product-media-modal__content`),newMediaModal=modalContent.querySelector(`[data-media-id="${this.currentVariant.featured_media.id}"]`),parent=newMedia.parentElement;parent.firstChild!=newMedia&&(modalContent.prepend(newMediaModal),parent.prepend(newMedia),this.stickyHeader=this.stickyHeader||document.querySelector("sticky-header"),this.stickyHeader&&this.stickyHeader.dispatchEvent(new Event("preventHeaderReveal")),window.setTimeout(()=>{parent.querySelector("li.product__media-item").scrollIntoView({behavior:"smooth"})}))}updateURL(){!this.currentVariant||this.dataset.updateUrl==="false"||window.history.replaceState({},"",`${this.dataset.url}?variant=${this.currentVariant.id}`)}updateVariantInput(){document.querySelectorAll(`#product-form-${this.dataset.section}, #product-form-installment`).forEach(productForm=>{const input=productForm.querySelector('input[name="id"]');input.value=this.currentVariant.id,input.dispatchEvent(new Event("change",{bubbles:!0}))})}updatePickupAvailability(){const pickUpAvailability=document.querySelector("pickup-availability");pickUpAvailability&&(this.currentVariant&&this.currentVariant.available?pickUpAvailability.fetchAvailability(this.currentVariant.id):(pickUpAvailability.removeAttribute("available"),pickUpAvailability.innerHTML=""))}renderProductInfo(){fetch(`${this.dataset.url}?variant=${this.currentVariant.id}§ion_id=${this.dataset.section}`).then(response=>response.text()).then(responseText=>{const id=`price-${this.dataset.section}`,html=new DOMParser().parseFromString(responseText,"text/html"),destination=document.getElementById(id),source=html.getElementById(id);source&&destination&&(destination.innerHTML=source.innerHTML);const price=document.getElementById(`price-${this.dataset.section}`);price&&price.classList.remove("visibility-hidden"),this.toggleAddButton(!this.currentVariant.available,window.variantStrings.soldOut)})}toggleAddButton(disable=!0,text,modifyClass=!0){const productForm=document.getElementById(`product-form-${this.dataset.section}`);if(!productForm)return;const addButton=productForm.querySelector('[name="add"]');addButton&&(disable?(addButton.setAttribute("disabled",!0),text&&(addButton.textContent=text)):(addButton.removeAttribute("disabled"),addButton.textContent=window.variantStrings.addToCart))}setUnavailable(){const addButton=document.getElementById(`product-form-${this.dataset.section}`).querySelector('[name="add"]'),price=document.getElementById(`price-${this.dataset.section}`);addButton&&(addButton.textContent=window.variantStrings.unavailable,price&&price.classList.add("visibility-hidden"))}getVariantData(){return this.variantData=this.variantData||JSON.parse(this.querySelector('[type="application/json"]').textContent),this.variantData}}customElements.define("variant-selects",VariantSelects);class VariantRadios extends VariantSelects{constructor(){super(),this.updateOptionInventoryLabels()}updateOptionInventoryLabels(){const options=Array.from(this.querySelectorAll('input[type="radio"]'),input=>input.value),variantData=JSON.parse(this.querySelector('[type="application/json"]').textContent);options.forEach(option=>{variantData.forEach(variant=>{if(variant.option1==option){const optRadio=this.querySelector(`input[type="radio"][value="${option}"]`);if(variant.inventory_quantity<1&&variant.inventory_policy=="deny")optRadio.setAttribute("disabled",!0);else if(variant.inventory_quantity==1){var optLabel=this.querySelector(`label[for="${optRadio.id}"]`),spanTag=document.createElement("span");spanTag.innerText="1 left",optLabel.appendChild(spanTag)}}})})}updateOptions(){const fieldsets=Array.from(this.querySelectorAll("fieldset"));this.options=fieldsets.map(fieldset=>Array.from(fieldset.querySelectorAll("input")).find(radio=>radio.checked).value)}}customElements.define("variant-radios",VariantRadios);class CartIcon extends HTMLElement{constructor(){super(),this.iconButton=document.getElementById("cart-icon-bubble"),this.iconButton.addEventListener("click",this.onClickHandler.bind(this)),this.cartNotification=document.querySelector("cart-notification")}onClickHandler(evt){evt.preventDefault(),this.cartNotification.setActiveElement(document.activeElement),document.getElementById("cart-notification").classList.contains("active")?this.cartNotification.close():this.cartNotification.renderContents()}}customElements.define("cart-icon",CartIcon); 2//# sourceMappingURL=/cdn/shop/t/54/assets/global.js.map?v=124361963557872532131781539515
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.