PageSourceSearch

https://biaggi.com/cdn/shop/t/104/assets/component-slider.js?v=182125809918835350971745337695

js biaggi.com collected 2026-09-24 09:36:50 UTC 14,653 bytes, 12 lines download raw bytes

1if(typeof CSSSlider!="function"){class CSSSlider2 extends HTMLElement{constructor(){super(),this._touchScreen="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,this._rtl=document.documentElement.getAttribute("dir")=="rtl",this.o={selector:".css-slide",snapping:!0,groupCells:!1,autoHeight:!1,navigation:!0,navigationDOM:`<span class="css-slider-button css-slider-prev" style="display:none">\u2190</span>
2            <span class="css-slider-button css-slider-next" style="display:none">\u2192</span>`,thumbnails:!0,thumbnailsDOM:'<div class="css-slider-dot-navigation" style="display:none"></div>',indexNav:!1,indexNavDOM:'<div class="css-slider-index-navigation"><span class="css-slider-current">1</span> / <span class="css-slider-total">1</span></div>',watchCSS:!1,undisplay:!1,disableSwipe:!1,listenScroll:!1,observer:!0,...JSON.parse(this.dataset.options)},this.o.watchCSS?(this.RESIZE_WATCHER=debounce(()=>{const afterContent=window.getComputedStyle(this,":after").content;afterContent.includes("css-slide")&&!this.sliderEnabled?this.initSlider():!afterContent.includes("css-slide")&&this.sliderEnabled&&this.destroySlider()},100),window.addEventListener("resize",this.RESIZE_WATCHER),this.RESIZE_WATCHER()):this.initSlider()}destroySlider(){this.innerHTML=`${this.originalHTML}`,this.classList.remove("enabled"),this.sliderEnabled=!1,window.removeEventListener("resize",this.RESIZE_EVENT),window.removeEventListener("scroll",this.SCROLL_EVENT),window.removeEventListener("scroll",this.SCROLL_EVENT_ANIMATION)}initSlider(){if(this._readyEvent=new CustomEvent("ready"),this._changeEvent=ne
2w CustomEvent("change"),this._scrollEvent=new CustomEvent("scroll"),this._navEvent=new CustomEvent("navigation"),this._pointerDownEvent=new CustomEvent("pointerDown"),this._pointerUpEvent=new CustomEvent("pointerUp"),this.classList.add("css-slider"),this.originalHTML=this.innerHTML,this.innerHTML=`<div class="css-slider-viewport">
3        <div class="css-slider-holder">
4          <div class="css-slider-container">
5            ${this.originalHTML}
6          </div>
7        </div>
8      </div>`,this.o.undisplay&&this.querySelectorAll(`${this.o.selector}`).forEach(elm=>{elm.style.display="block"}),this.o.selector!=".css-slide"&&this.querySelectorAll(`${this.o.selector}`).forEach(elm=>{elm.classList.add("css-slide")}),this.element=this.querySelector(".css-slider-holder"),this.o.groupCells&&(this.element.scrollLeft=0),this.items=this.querySelectorAll(`${this.o.selector}`),this.indexedItems=[],this.index=0,this.length=this.items.length,this.windowWidth=window.innerWidth,this.querySelector(".css-slider-container").addEventListener("mousedown",e=>{e.preventDefault()}),this.viewport=this.querySelector(".css-slider-viewport"),this.o.autoHeight&&this.viewport.classList.add("auto-height"),this.o.navigation||this.o.thumbnails||this.indexNav){let container=document.createElement("div");container.classList.add("css-slider-navigation-container"),container.innerHTML=`
9          ${this.o.navigation?this.o.navigationDOM:""}
10          ${this.o.thumbnails?this.o.thumbnailsDOM:""}
11          ${this.o.indexNav?this.o.indexNavDOM:""}`,this.o.navigation&&(this.prevEl=container.querySelector(".css-slider-prev"),this.prevEl.addEventListener("click",e=>{e.preventDefault(),this.changeSlide("prev"),this.dispatchEvent(this._navEvent)}),this.nextEl=container.querySelector(".css-slider-next"),this.nextEl.addEventListener("click",e=>{e.preventDefault(),this.changeSlide("next"),this.dispatchEvent(this._navEvent)})),this.o.thumbnails&&(this.thumbnailsEl=container.querySelector(".css-slider-dot-navigation")),this.o.indexNav&&(this.indexEl=container.querySelector(".css-slider-current"),this.lengthEl=container.querySelector(".css-slider-total")),this.append(container)}this.length>1&&(this.o.observer?this.OBSERVER=new IntersectionObserver(entries=>{this._sliderBlockScroll||entries.forEach(entry=>{entry.intersectionRatio>=.5&&(this.index=parseInt(entry.target.getAttribute("data-index"))-1,this.checkSlide(),this.dispatchEvent(this._changeEvent))})},{threshold:[0,.5]}):(this.SCROLL_EVENT=debounce(()=>{if(!this._sliderBlockScroll){const scrollItems=this.indexedItems.entries(),scrollArray=Array.from(scrollItems,elm=>Math.abs(elm[1].offsetLeft-this.element.scrollLeft)),scrollDistance=Math.min(...scrollArray),scrollIndex=scrollArray.indexOf(scrollDistance);scrollIndex!=this.index&&(this.index=scrollIndex-1,this.checkSlide(),this.dispatchEvent(this._changeEvent))}},10),this.element.addEventListener("scroll",this.SCROLL_EVENT,{passive:!0})),this.RESIZE_EVENT=debounce(()=>{this.windowWidth!=window.innerWidth&&this.o.groupCells&&this.resetSlider(),this.o.groupCells||this.checkSlide(),this.windowWidth=window.innerWidth},100),window.addEventListener("resize",this.RESIZE_EVENT),this.resetSlider(!0),this.o.listenScroll&&(this.SCROLL_EVENT_ANIMATIONS=()=>{let slidesWidth=-this.querySelector(".css-slider-container").offsetWidth;this.items.forEach(elm=>{slidesWidth+=elm.offsetWidth}),this.progress=this.element.scrollLeft/slidesWidth,this.dispatchEvent(this._scrollEvent)},this.element.addEventListener("scroll",this.SCROLL_EVENT_ANIMATIONS,{passive:!0})),!this.o.disableSwipe&&!this._touchScreen&&!this.element.classList.contains("css-slider--singular")&&(this.element.addEventListener("mousedown",e=>{this.element.classList.contains("css-slider--disable-dragging")||(this.mouseX=e.screenX,this.element.classList.add("can-drag"),this.element.classList.add("mouse-down"))}),this.element.addEventListener("mouseup",e=>{this.element.classList.remove("mouse-down"),this.element.classList.remove("can-drag"),this.element.classList.remove("pointer-events-off"),this._pot&&clearTimeout(this._pot)}),this.element.addEventListener("mouseleave",e=>{this.element.classList.remove("mouse-down"),this.element.classList.remove("can-drag"),this.element.classList.remove("pointer-events-off"),this._pot&&clearTimeout(this._pot)}),this.element.addEventListener("mousemove",e=>{if(this.element.classList.contains("can-drag")){let directionX=this.mouseX-e.screenX;Math.abs(directionX)>1&&(this.element.classList.contains("css-slider--no-drag")||this.element.classList.add("pointer-events-off"),!this._rtl&&directionX>0||this._rtl&&directionX<0?(this.changeSlide("next"),this.element.classList.remove("can-drag")):(!this._rtl&&directionX<0||this._rtl&&directionX>0)&&(this.changeSlide("prev"),this.element.classList.remove("can-drag")))}})),!("scrollBehavior"in document.documentElement.style)&&!this._touchScreen&&this.element.classList.add("force-disable-snapping"),this._touchScreen||(this.element.ondragstart=e=>{e.preventDefault()})),this.classList.add("enabled"),this.sliderEnabled=!0,this.dispatchEvent(this._readyEvent)}changeSlide(direction,behavior="smooth"){direction=="next"?this.index+1<this.length&&this.index++:direction=="prev"?this.index-1>=0&&this.index--:parseInt(direction)>=0&&(this.index=parseInt(direction)),this._sliderBlockScroll=!0,setTimeout(()=>{this._sliderBlockScroll=!1},500),this.checkSlide();const elementSelected=Array.from(this.indexedItems).find(elm=>elm.getAttribute("data-index")==this.index);this.element.scrollTo({top:0,left:this._rtl&&this.slidesPerPage>1?(this.querySelector(".css-slider-container").offsetWidth-(elementSelected.offsetLeft-parseInt(getComputedStyle(this.indexedItems[0]).marginLeft)))*-1:elementSelected.offsetLeft-parseInt(getComputedStyle(this.indexedItems[0]).marginLeft),behavior}),this.dispatchEvent(this._changeEvent)}checkSlide(){this.o.navigation&&(this.prevEl.classList.remove("disabled"),this.nextEl.classList.remove("disabled"),this.index==0&&this.prevEl.classList.add("disabled"),this.index==this.length-1&&this.nextEl.classList.add("disabled")),this.o.thumbnails&&this.thumbnails&&(this.thumbnails.forEac
11h(elm=>{elm.classList.remove("active")}),this.thumbnails[this.index]?.classList?.add("active")),this.o.indexNav&&(this.indexEl.textContent=this.index+1),this.o.autoHeight&&(this.viewport.style.height=this.indexedItems[this.index].offsetHeight+"px"),this.indexedItems.forEach((elm,i)=>{i==this.index?elm.classList.add("css-slide-active"):elm.classList.remove("css-slide-active")})}afterAppend(){this.items=this.querySelectorAll(`${this.o.selector}`)}resetSlider(nojump=!1,resetIndex=!0){let slidesWidth=0,page=0,pages=0,totalWidth=this.querySelector(".css-slider-container").offsetWidth,hideNavigation=!1;if(this.slidesPerPage=0,this.indexedItems=[],this.element.classList.add("disable-snapping"),this.OBSERVER&&this.OBSERVER.disconnect(),this.items.forEach((elm,i)=>{elm.classList.remove("css-slide--snap"),slidesWidth+=elm.offsetWidth,slidesWidth>totalWidth&&this.slidesPerPage==0&&(this.slidesPerPage=i)}),this.slidesPerPage==0&&(this.slidesPerPage=this.items.length,hideNavigation=!0),this.items.forEach((elm,i)=>{elm.setAttribute("data-index",i),i%this.slidesPerPage==0&&this.OBSERVER&&this.OBSERVER.observe(elm)}),this.indexedItems=Array.from(this.querySelectorAll(".css-slider-container "+this.o.selector)),resetIndex&&(this.index=0),this.length=Math.ceil(this.items.length/this.slidesPerPage),this.o.thumbnails){this.thumbnailsEl.innerHTML="";for(let i=0;i<this.length;i++){let dot=document.createElement("span");dot.classList.add("css-slider-dot"),dot.dataset.index=i,this.thumbnailsEl.appendChild(dot),dot.addEventListener("click",e=>{this.changeSlide(e.target.dataset.index)})}this.thumbnails=this.thumbnailsEl.querySelectorAll(".css-slider-dot")}this.o.indexNav&&(this.indexEl.textContent=this.index+1,this.lengthEl.textContent=this.length),hideNavigation?(this.element.classList.add("css-slider--no-drag"),this.o.navigation&&(this.prevEl.style.display="none",this.nextEl.style.display="none"),this.o.thumbnails&&(this.thumbnailsEl.style.display="none")):(this.element.classList.remove("css-slider--no-drag"),this.o.navigation&&(this.prevEl.style.display="block",this.nextEl.style.display="block"),this.o.thumbnails&&(this.thumbnailsEl.style.display="block")),this.checkSlide(),nojump||this.element.scrollTo({top:0,left:0,behavior:"auto"}),this.element.classList.remove("disable-snapping")}}typeof customElements.get("css-slider")>"u"&&customElements.define("css-slider",CSSSlider2),document.addEventListener("shopify:section:load",e=>{e.target.classList.contains("mount-css-slider")&&e.target.querySelector("css-slider")&&e.target.querySelectorAll("css-slider").forEach(sli
11der=>{slider.enabled&&slider.resetSlider()})})}(function(){"use strict";function o(){var o2=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&o2.__forceSmoothScrollPolyfill__!==!0)){var l,e=o2.HTMLElement||o2.Element,r=468,i={scroll:o2.scroll||o2.scrollTo,scrollBy:o2.scrollBy,elementScroll:e.prototype.scroll||n,scrollIntoView:e.prototype.scrollIntoView},s=o2.performance&&o2.performance.now?o2.performance.now.bind(o2.performance):Date.now,c=(l=o2.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(l)?1:0);o2.scroll=o2.scrollTo=function(){arguments[0]!==void 0&&(f(arguments[0])!==!0?h.call(o2,t.body,arguments[0].left!==void 0?~~arguments[0].left:o2.scrollX||o2.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:o2.scrollY||o2.pageYOffset):i.scroll.call(o2,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:o2.scrollX||o2.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:o2.scrollY||o2.pageYOffset))},o2.scrollBy=function(){arguments[0]!==void 0&&(f(arguments[0])?i.scrollBy.call(o2,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0):h.call(o2,t.body,~~arguments[0].left+(o2.scrollX||o2.pageXOffset),~~arguments[0].top+(o2.scrollY||o2.pageYOffset)))},e.prototype.scroll=e.prototype.scrollTo=function(){if(arguments[0]!==void 0)if(f(arguments[0])!==!0){var o3=arguments[0].left,t2=arguments[0].top;h.call(this,this,o3===void 0?this.scrollLeft:~~o3,t2===void 0?this.scrollTop:~~t2)}else{if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop)}},e.prototype.scrollBy=function(){arguments[0]!==void 0&&(f(arguments[0])!==!0?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},e.prototype.scrollIntoView=function(){if(f(arguments[0])!==!0){var l2=(function(o3){for(;o3!==t.body&&(e3=p(l3=o3,"Y")&&a(l3,"Y"),r3=p(l3,"X")&&a(l3,"X"),(e3||r3)===!1);)o3=o3.parentNode||o3.host;var l3,e3,r3;return o3})(this),e2=l2.getBoundingClientRect(),r2=this.getBoundingClientRect();l2!==t.body?(h.call(this,l2,l2.scrollLeft+r2.left-e2.left,l2.scrollTop+r2.top-e2.top),o2.getComputedStyle(l2).position!=="fixed"&&o2.scrollBy({left:e2.left,top:e2.top,behavior:"smooth"})):o2.scrollBy({left:r2.left,top:r2.top,behavior:"smooth"})}else i.scrollIntoView.call(this,arguments[0]===void 0||arguments[0])}}function n(o3,t2){this.scrollLeft=o3,this.scrollTop=t2}function f(o3){if(o3===null||typeof o3!="object"||o3.behavior===void 0||o3.behavior==="auto"||o3.behavior==="instant")return!0;if(typeof o3=="object"&&o3.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+o3.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(o3,t2){return t2==="Y"?o3.clientHeight+c<o3.scrollHeight:t2==="X"?o3.clientWidth+c<o3.scrollWidth:void 0}function a(t2,l2){var e2=o2.getComputedStyle(t2,null)["overflow"+l2];return e2==="auto"||e2==="scroll"}function d(t2){var l2,e2,i2,c2,n2=(s()-t2.startTime)/r;c2=n2=n2>1?1:n2,l2=.5*(1-Math.cos(Math.PI*c2)),e2=t2.startX+(t2.x-t2.startX)*l2,i2=t2.startY+(t2.y-t2.startY)*l2,t2.method.call(t2.scrollable,e2,i2),e2===t2.x&&i2===t2.y||o2.requestAnimationFrame(d.bind(o2,t2))}function h(l2,e2,r2){var c2,f2,p2,a2,h2=s();l2===t.body?(c2=o2,f2=o2.scrollX||o2.pageXOffset,p2=o2.scrollY||o2.pageYOffset,a2=i.scroll):(c2=l2,f2=l2.scrollLeft,p2=l2.scrollTop,a2=n),d({scrollable:c2,method:a2,startTime:h2,startX:f2,startY:p2,x:e2,y:r2})}}typeof exports=="object"&&typeof module<"u"?module.exports={polyfill:o}:o()})();
12//# sourceMappingURL=/cdn/shop/t/104/assets/component-slider.js.map?v=182125809918835350971745337695

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.