1import noUiSlider from"nouislider";import{config}from"@archetype-themes/scripts/config";import{formatMoney}from"@archetype-themes/scripts/helpers/currency";if(typeof noUiSlider>"u")throw new Error("theme.PriceRange is missing vendor noUiSlider: // =require vendor/nouislider.js");const defaultStep=10,selectors={priceRange:".price-range",priceRangeSlider:".price-range__slider",priceRangeInputMin:".price-range__input-min",priceRangeInputMax:".price-range__input-max",priceRangeDisplayMin:".price-range__display-min",priceRangeDisplayMax:".price-range__display-max",filters:"#CollectionSidebarFilterWrap .filter-wrapper"};class PriceRange extends HTMLElement{connectedCallback(){config.filtersPrime||(config.filtersPrime=document.querySelector(selectors.filters).cloneNode(!0)),this.init()}init(){if(!this.classList.contains("price-range"))throw new Error("You must instantiate PriceRange with a valid container");return this.formEl=this.closest("form"),this.sliderEl=this.querySelector(selectors.priceRangeSlider),this.inputMinEl=this.querySelector(selectors.priceRangeInputMin),this.inputMaxEl=this.querySelector(selectors.priceRangeInputMax),this.displayMinEl=this.querySelector(selectors.priceRangeDisplayMin),this.displayMaxEl=this.querySelector(selectors.priceRangeDisplayMax),this.moneyFormat=this.dataset.moneyFormat,this.superScript=this.dataset.superScript==="true",this.minRange=parseFloat(this.dataset.min)||0,this.minValue=parseFloat(this.dataset.minValue)||0,this.maxRange=parseFloat(this.dataset.max)||100,this.maxValue=parseFloat(this.dataset.maxValue)||this.maxRange,this.createPriceRange()}createPriceRange(){this.sliderEl&&this.sliderEl.noUiSlider&&typeof this.sliderEl.noUiSlider.destroy=="function"&&this.sliderEl.noUiSlider.destroy();const slider=noUiSlider.create(this.sliderEl,{connect:!0,step:defaultStep,start:[this.minValue,this.maxValue],range:{min:this.minRange,max:this.maxRange}});return slider.on("update",values=>{this.displayMinEl.innerHTML=formatMoney(values[0],this.moneyFormat,this.superScript),this.displayMaxEl.innerHTML=formatMoney(values[1],this.moneyFormat,this.superScript),document.dispatchEvent(new CustomEvent("price-range:update",{detail:values}))}),slider.on("change",values=>{this.inputMinEl.value=values[0],this.inputMaxEl.value=values[1];const formData=new FormData(this.formEl);document.dispatchEvent(new CustomEvent("price-range:change",{detail:formData}))}),slider}}customElements.define("price-range",PriceRange); 2//# sourceMappingURL=/cdn/shop/t/93/assets/price-range.js.map?v=123052969041133689781772430034
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.