PageSourceSearch

https://saris.com/cdn/shop/t/118/assets/global.js?v=154771352543870999401788777983

js saris.com collected 2026-10-03 21:42:34 UTC 14,072 bytes, 2 lines download raw bytes

1let menuSlideDuration=500;function debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}function fetchConfig(type="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}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.setAttribute("aria-expanded",!1),summaryElement.focus()}for(var anchors=document.querySelectorAll("a"),i=0;i<anchors.length;i++)anchors[i].hostname!==window.location.hostname&&anchors[i].setAttribute("target","_blank");let slideUp=(target,duration=menuSlideDuration)=>{target.style.transitionProperty="height, margin, padding",target.style.transitionDuration=duration+"ms",target.style.boxSizing="border-box",target.style.height=target.offsetHeight+"px",target.offsetHeight,target.style.overflow="hidden",target.style.height=0,target.style.paddingTop=0,target.style.paddingBottom=0,target.style.marginTop=0,target.style.marginBottom=0,window.setTimeout(()=>{target.style.display="none",target.style.removeProperty("height"),target.style.removeProperty("padding-top"),target.style.removeProperty("padding-bottom"),target.style.removeProperty("margin-top"),target.style.removeProperty("margin-bottom"),target.style.removeProperty("overflow"),target.style.removeProperty("transition-duration"),target.style.removeProperty("transition-property")},duration)},slideDown=(target,duration=menuSlideDuration)=>{target.style.removeProperty("display");let display=window.getComputedStyle(target).display;display==="none"&&(display="block"),target.style.display=display;let height=target.offsetHeight;target.style.overflow="hidden",target.style.height=0,target.style.paddingTop=0,target.style.paddingBottom=0,target.style.marginTop=0,target.style.marginBottom=0,target.offsetHeight,target.style.boxSizing="border-box",target.style.transitionProperty="height, margin, padding",target.style.transitionDuration=duration+"ms",target.style.height=height+"px",target.style.removeProperty("padding-top"),target.style.removeProperty("padding-bottom"),target.style.removeProperty("margin-top"),target.style.removeProperty("margin-bottom"),window.setTimeout(()=>{target.style.removeProperty("height"),target.style.removeProperty("overflow"),target.style.removeProperty("transition-duration"),target.style.removeProperty("transition-property")},duration)};var slideToggle=(target,duration=menuSlideDuration)=>window.getComputedStyle(target).display==="none"?slideDown(target,duration):slideUp(target,duration);const isMobileDevice=/Mobi/i.test(window.navigator.userAgent);isMobileDevice&&document.body.classList.add("mobile");const mobileBreakpoint=getComputedStyle(document.documentElement).getPropertyValue("--mobileBreakpoint"),isMobile=window.innerWidth<=parseInt(mobileBreakpoint);isMobile||(document.querySelectorAll(".site-nav li.has-subnav > a").forEach(function(el){el.addEventListener("focus",function(){this.addEventListener("keydown",function(e){(e.keyCode==40||e.keyCode==13)&&(e.preventDefault(),this.parentElement.classList.add("is-focused"))}),document.addEventListener("keydown",function(e){e.keyCode==27&&document.querySelector("li.is-focused").classList.remove("is-focused")})})}),document.querySelectorAll(".site-nav > li > a, .site-nav button").forEach(function(el){el.addEventListener("focus",function(){document.querySelector("li.is-focused")&&document.querySelector("li.is-focused").classList.remove("is-focused")}),el.addEventListener("mouseenter",function(){document.querySelector("li.is-focused")&&document.querySelector("li.is-focused").classList.remove("is-focused")})}),document.querySelector(".search__input").addEventListener("focus",function(){this.addEventListener("keydown",function(e){e.keyCode==40&&document.querySelector("#predictive-search-results-list a").focus()})})),document.documentElement.className=document.documentElement.className.replace("no-js","js"),document.querySelector(".mobile-trigger:not(.animating)").addEventListener("click",function(){this.classList.add("animating"),setTimeout(()=>{this.classList.remove("animating")},menuSlideDuration);const nav=document.querySelector(".nav-bar");slideToggle(nav,menuSlideDuration)});const stickyHeader=document.getElementById("shopify-section-header"),sticky=stickyHeader.offsetTop+stickyHeader.offsetHeight;let lastScroll=0;window.addEventListener("scroll",()=>{if(!isMobile){const currentScroll=window.pageYOffset;window.pageYOffset>=sticky?(currentScroll<lastScroll?stickyHeader.classList.add("is-visible"):stickyHeader.classList.remove("is-visible"),stickyHeader.classList.add("is-sticky")):stickyHeader.classList.remove("is-sticky"),lastScroll=currentScroll}}),window.addEventListener("resize",debounce(function(){const menuBreakp
1oint=getComputedStyle(document.documentElement).getPropertyValue("--mobileBreakpoint");window.innerWidth>menuBreakpoint&&document.querySelector(".nav-bar")&&document.querySelector(".nav-bar").setAttribute("style","")}),250),isMobile&&document.querySelectorAll(".site-nav li.has-subnav > a").forEach(function(el){el.addEventListener("click",function(e){e.preventDefault();let openNav=document.querySelector(".has-subnav.is-focused");openNav&&openNav!==this.parentElement&&document.querySelector(".has-subnav.is-focused").classList.remove("is-focused"),this.parentElement.classList.toggle("is-focused"),window.scrollTo({top:this.parentElement.offsetTop,left:0,behavior:"smooth"})})});class QuantityInput extends HTMLElement{constructor(){super(),this.input=this.querySelector("input"),this.changeEvent=new Event("change",{bubbles:!0}),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)))}onButtonClick(event){event.preventDefault();const previousValue=this.input.value;event.target.name==="plus"?this.input.stepUp():this.input.stepDown(),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent)}}customElements.define("quantity-input",QuantityInput);function getFocusableElements(container){return Array.from(container.querySelectorAll("summary, a[href], button:enabled, [tabindex]:not([tabindex^='-']), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe"))}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 removeTrapFocus(elementToFocus=null){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown),elementToFocus&&elementToFocus.focus()}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&&currentFocusedElement.classList.remove("focused"),!mouseClick&&(currentFocusedElement=document.activeElement,currentFocusedElement.classList.add("focused"))},!0)}class VariantSelects extends HTMLElement{constructor(){super(),this.addEventListener("change",this.onVariantChange)}onVariantChange(){this.updateOptions(),this.updateMasterId(),this.toggleAddButton(!0,"",!1),this.updatePickupAvailability(),this.removeErrorMessage(),this.currentVariant?(this.updateURL(),this.updateVariantInput(),this.renderProductInfo(),this.updateShareUrl()):(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))}updateURL(){if(!(!this.currentVariant||this.dataset.updateUrl==="false")){if(window.history.replaceState({},"",`${this.dataset.url}?variant=${this.currentVariant.id}`),this&&this.currentVariant&&this.currentVariant.id){var get_id=this.currentVariant.id,$variantEl=$(`.variant_titles_metaf[data-id='${get_id}']`);if($variantEl.length){var get_title=$variantEl.attr("data-title");get_title&&get_title.trim()!==""&&$("h1.product__title.product_title_main").html(get_title)}}var eu_error_hide=$(".hidden_eu_select select option[data-id='"+this.currentVariant.id+"']");if(console.log(eu_error_hide),eu_error_hide.length){var get_eu_value=eu_error_hide.attr("avail-eu");get_eu_value==="true"?($(".eu-shipping-error-message").hide(),$("#buylocal").show(),$(".estimated_date_main").show(),$(".product-form__buttons button").removeClass("eu_added_to_cart22")):($(".eu-shipping-error-message").show(),$("#buylocal").hide(),$(".estimated_date_main").hide(),$(".product-form__buttons button").addClass("eu_added_to_cart22"))}}}updateShareUrl(){const shareButton=document.getElementById(`Share-${this.dataset.section}`);shareButton&&shareButton.updateUrl(`${window.shopUrl}${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=""))}removeErrorMessage(){const section=this.closest("section");if(!section)return;const productForm=section.querySelector("product-form");productForm&&productForm.handleErrorMessage()}renderProductInfo(){fetch(`${this.dataset.url}?variant=${this.currentVariant.id}&section_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 skuid=`sku-${this.dataset.section}`,skuDestination=document.getElementById(skuid),sku=html.getElementById(skuid);sku&&skuDestination&&(skuDestination.innerHTML=sku.innerHTML);let selectedVariantImage="";
1if(this.getVariantData().forEach(variant=>{variant.id===this.currentVariant.id&&variant.featured_media&&(selectedVariantImage=variant.featured_media.id)}),selectedVariantImage){const selectedSlide=document.querySelector("[data-variantid='"+selectedVariantImage+"']"),selectedSlideIndex=Array.from(selectedSlide.parentElement.children).indexOf(selectedSlide);window.swiperMain.slideTo(selectedSlideIndex)}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"]'),addButtonText=productForm.querySelector('[name="add"] > span');addButton&&(disable?(addButton.setAttribute("disabled","disabled"),text&&(addButtonText.textContent=text)):(addButton.removeAttribute("disabled"),addButtonText.textContent=window.variantStrings.addToCart))}setUnavailable(){const button=document.getElementById(`product-form-${this.dataset.section}`),addButton=button.querySelector('[name="add"]'),addButtonText=button.querySelector('[name="add"] > span'),price=document.getElementById(`price-${this.dataset.section}`);addButton&&(addButtonText.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()}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),document.addEventListener("DOMContentLoaded",function(){const btn=document.querySelector(".dealer-register-btn");btn&&btn.addEventListener("click",function(e){e.preventDefault();const target=document.querySelector(".form-out-dealer");if(target){const scrollOffset=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream?150:190;window.scrollTo({top:target.offsetTop+scrollOffset,behavior:"smooth"})}})});
2//# sourceMappingURL=/cdn/shop/t/118/assets/global.js.map?v=154771352543870999401788777983

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.