https://takelsc.com/cdn/shop/t/92/assets/modules-slideshow.bundle.js?v=47425279959070991671789964621
vendor: 4,234 bytes, lines 1-6
1import{S as Splide}from"./shared-import-splide.esm.bundle.js";/*! 2 * @splidejs/splide-extension-auto-scroll 3 * Version : 0.5.3 4 * License : MIT 5 * Copyright: 2022 Naotoshi Fujita 6 */function empty(array){array.length=0}function slice$1(arrayLike,start,end){return Array.prototype.slice.call(arrayLike,start,end)}function apply$1(func){return func.bind.apply(func,[null].concat(slice$1(arguments,1)))}function raf(func){return requestAnimationFrame(func)}function typeOf$1(type,subject){return typeof subject===type}var isArray$1=Array.isArray;apply$1(typeOf$1,"function"),apply$1(typeOf$1,"string"),apply$1(typeOf$1,"undefined");function toArray$1(value){return isArray$1(value)?value:[value]}function forEach$1(values,iteratee){toArray$1(values).forEach(iteratee)}var ownKeys$1=Object.keys;function forOwn$1(object,iteratee,right){if(object){var keys=ownKeys$1(object);keys=right?keys.reverse():keys;for(var i=0;i<keys.length;i++){var key=keys[i];if(key!=="__proto__"&&iteratee(object[key],key)===!1)break}}return object}function assign$1(object){return slice$1(arguments,1).forEach(function(source){forOwn$1(source,function(value,key){object[key]=source[key]})}),object}var min$1=Math.min;function EventBinder(){var listeners=[];function bind(targets,events,callback,options){forEachEvent(targets,events,function(target,event,namespace){var isEventTarget="addEventListener"in target,remover=isEventTarget?target.removeEventListener.bind(target,event,callback,options):target.removeListener.bind(target,callback);isEventTarget?target.addEventListener(event,callback,options):target.addListener(callback),listeners.push([target,event,namespace,callback,remover])})}function unbind(targets,events,callback){forEachEvent(targets,events,function(target,event,namespace){listeners=listeners.filter(function(listener){return listener[0]===target&&listener[1]===event&&listener[2]===namespace&&(!callback||listener[3]===callback)?(listener[4](),!1):!0})})}function dispatch(target,type,detail){var e,bubbles=!0;return typeof CustomEvent=="function"?e=new CustomEvent(type,{bubbles,detail}):(e=document.createEvent("CustomEvent"),e.initCustomEvent(type,bubbles,!1,detail)),target.dispatchEvent(e),e}function forEachEvent(targets,events,iteratee){forEach$1(targets,function(target){target&&forEach$1(events,function(events2){events2.split(" ").forEach(function(eventNS){var fragment=eventNS.split(".");iteratee(target,fragment[0],fragment[1])})})})}function destroy(){listeners.forEach(function(data){data[4]()}),empty(listeners)}return{bind,unbind,dispatch,destroy}}var EVENT_MOVE="move",EVENT_MOVED="moved",EVENT_UPDATED="updated",EVENT_DRAG="drag",EVENT_DRAGGED="dragged",EVENT_SCROLL="scroll",EVENT_SCROLLED="scrolled",EVENT_DESTROY="destroy";function EventInterface(Splide2){var bus=Splide2?Splide2.event.bus:document.createDocumentFragment(),binder=EventBinder();function on(events,callback){binder.bind(bus,toArray$1(events).join(" "),function(e){callback.apply(callback,isArray$1(e.detail)?e.detail:[])})}function emit(event){binder.dispatch(bus,event,slice$1(arguments,1))}return Splide2&&Splide2.event.on(EVENT_DESTROY,binder.destroy),assign$1(binder,{bus,on,off:apply$1(binder.unbind,bus),emit})}function RequestInterval(interval,onInterval,onUpdate,limit){var now=Date.now,startTime,rate=0,id,paused=!0,count=0;function update(){if(!paused){if(rate=interval?min$1((now()-startTime)/interval,1):1,onUpdate&&onUpdate(rate),rate>=1&&(onInterval(),startTime=now(),limit&&++count>=limit))return pause();raf(update)}}function start(resume){!resume&&cancel(),startTime=now()-(resume?rate*interval:0),paused=!1,raf(update)}function pause(){paused=!0}function rewind(){startTime=now(),rate=0,onUpdate&&onUpdate(rate)}function cancel(){id&&cancelAnimationFrame(id),rate=0,id=0,paused=!0}function set(time){interval=time}function isPaused(){return paused}return{start,rewind,pause,cancel,set,isPaused}}function Throttle(func,duration){var interval;function throttled(){interval||(interval=RequestInterval(duration||0,function(){func(),interval=null},null,1),interval.start())}return throttled}var CLASS_ACTIVE="is-active",SLIDE="slide",FADE="fade";function slice(arrayLike,start,end){return Array.prototype.slice.call(arrayLike,start,end)}
6function apply(func){return func.bind(null,...slice(arguments,1))}function typeOf(type,subject){return typeof subject===type}function isObject(subject){return!isNull(subject)&&typeOf("object",subject)}const isArray=Array.isArray;apply(typeOf,"function"),apply(typeOf,"string");const isUndefined=apply(typeOf,"undefined");function isNull(subject){return subject===null}function toArray(value){return isArray(value)?value:[value]}function forEach(values,iteratee){toArray(values).forEach(iteratee)}function toggleClass(elm,classes,add){elm&&forEach(classes,name=>{name&&elm.classList[add?"add":"remove"](name)})}const ownKeys=Object.keys;function forOwn(object,iteratee,right){if(object){let keys=ownKeys(object);keys=right?keys.reverse():keys;for(let i=0;i<keys.length;i++){const key=keys[i];if(key!=="__proto__"&&iteratee(object[key],key)===!1)break}}return object}function assign(object){return slice(arguments,1).forEach(source=>{forOwn(source,(value,key)=>{object[key]=source[key]})}),object}function removeAttribute(elms,attrs){forEach(elms,elm=>{forEach(attrs,attr=>{elm&&elm.removeAttribute(attr)})})}function setAttribute(elms,attrs,value){isObject(attrs)?forOwn(attrs,(value2,name)=>{setAttribute(elms,name,value2)}):forEach(elms,elm=>{isNull(value)||value===""?removeAttribute(elm,attrs):elm.setAttribute(attrs,String(value))})}const{min,max,floor,ceil,abs}=Math;function clamp(number,x,y){const minimum=min(x,y),maximum=max(x,y);return min(max(minimum,number),maximum)}const DEFAULTS={speed:1,autoStart:!0,pauseOnHover:!0,pauseOnFocus:!0},I18N={startScroll:"Start auto scroll",pauseScroll:"Pause auto scroll"};function AutoScroll(Splide2,Components2,options){const{on,off,bind,unbind}=EventInterface(Splide2),{translate,getPosition,toIndex,getLimit}=Components2.Move,{setIndex,getIndex}=Components2.Controller,{orient}=Components2.Direction,{toggle}=Components2.Elements,{Live}=Components2,{root}=Splide2,throttledUpdateArrows=Throttle(Components2.Arrows.update,500);let autoScrollOptions={},interval,stopped,hovered,focused,busy,currPosition;function setup(){const{autoScroll}=options;autoScrollOptions=assign({},DEFAULTS,isObject(autoScroll)?autoScroll:{})}function mount(){Splide2.is(FADE)||!interval&&options.autoScroll!==!1&&(interval=RequestInterval(0,move),listen(),autoStart())}function destroy(){interval&&(interval.cancel(),interval=null,currPosition=void 0,off([EVENT_MOVE,EVENT_DRAG,EVENT_SCROLL,EVENT_MOVED,EVENT_SCROLLED]),unbind(root,"mouseenter mouseleave focusin focusout"),unbind(toggle,"click"))}function listen(){autoScrollOptions.pauseOnHover&&bind(root,"mouseenter mouseleave",e=>{hovered=e.type==="mouseenter",autoToggle()}),autoScrollOptions.pauseOnFocus&&bind(root,"focusin focusout",e=>{focused=e.type==="focusin",autoToggle()}),autoScrollOptions.useToggleButton&&bind(toggle,"click",()=>{stopped?play():pause()}),on(EVENT_UPDATED,update),on([EVENT_MOVE,EVENT_DRAG,EVENT_SCROLL],()=>{busy=!0,pause(!1)}),on([EVENT_MOVED,EVENT_DRAGGED,EVENT_SCROLLED],()=>{busy=!1,autoToggle()})}function update(){const{autoScroll}=options;autoScroll!==!1?(autoScrollOptions=assign({},autoScrollOptions,isObject(autoScroll)?autoScroll:{}),mount()):destroy(),interval&&!isUndefined(currPosition)&&translate(currPosition)}function autoStart(){autoScrollOptions.autoStart&&(document.readyState==="complete"?play():bind(window,"load",play))}function play(){isPaused()&&(interval.start(!0),Live.disable(!0),focused=hovered=stopped=!1,updateButton())}function pause(){let stop=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;stopped||(stopped=stop,updateButton(),isPaused()||(interval.pause(),Live.disable(!1)))}function autoToggle(){stopped||(hovered||focused||busy?pause(!1):play())}function move(){const position=getPosition(),destination=computeDestination(position);position!==destination?(translate(destination),updateIndex(currPosition=getPosition())):(pause(!1),autoScrollOptions.rewind&&Splide2.go(autoScrollOptions.speed>0?0:Components2.Controller.getEnd())),throttledUpdateArrows()}function computeDestination(position){const speed=autoScrollOptions.speed||1;return position+=orient(speed),Splide2.is(SLIDE)&&(position=clamp(position,getLimit(!1),getLimit(!0))),position}function updateIndex(position){const{length}=Splide2,index=(toIndex(position)+length)%length;index!==getIndex()&&(setIndex(index),Components2.Slides.update(),Components2.Pagination.update(),options.lazyLoad==="nearby"&&Components2.LazyLoad.check())}function updateButton(){if(toggle){const key=stopped?"startScroll":"pauseScroll";toggleClass(toggle,CLASS_ACTIVE,!stopped),setAttribute(toggle,"aria-label",options.i18n[key]||I18N[key])}}
6function isPaused(){return!interval||interval.isPaused()}return{setup,mount,destroy,play,pause,isPaused}}window.Splide=Splide,window.slideshows={};const _createSplideInstance=(splideRoot,options,extensions)=>{if(splideRoot.hasAttribute("data-thumbnails")){const thumbsRoot=document.getElementById(splideRoot.getAttribute("data-thumbnails"));window.slideshows[thumbsRoot.id]=new Splide(`#${thumbsRoot.id}`,{direction:"ttb",height:"var(--thumbnails-height)",autoHeight:!0,arrows:!1,pagination:!1,isNavigation:!0,focus:"left",gap:"0.625rem",slideFocus:!1}),window.slideshows[splideRoot.id]=new Splide(`#${splideRoot.id}`,options);const mainSplide=window.slideshows[splideRoot.id],thumbsSplide=window.slideshows[thumbsRoot.id];mainSplide.mount(extensions),document.addEventListener("shapes:product:arrow-change",e=>{e.detail.direction=="prev"?thumbsSplide.go("<"):thumbsSplide.go(">"),thumbsSplide.Components.Slides.getAt(thumbsSplide.index).slide.querySelector(".media-thumbnail").click()}),document.addEventListener("shapes:product:variantchange",e=>{if(!e.target.contains(splideRoot))return;const mediaId=e.detail.variant.featured_media.id,targetSlides=thumbsSplide.Components.Slides.filter(slide=>slide.slide.dataset.mediaId===mediaId.toString());targetSlides.length&&thumbsSplide.go(targetSlides[0].index)}),thumbsSplide.mount()}else window.slideshows[splideRoot.id]=new Splide(`#${splideRoot.id}`,options),window.slideshows[splideRoot.id].on("mounted",e=>{const clones=window.slideshows[splideRoot.id].root.querySelectorAll(".splide__slide--clone");for(let i=0;i<clones.length;i++){let elements=clones[i].getElementsByTagName("*");for(let j=0;j<elements.length;j++){let el=elements[j];if(el.hasAttribute("id")&&(el.id=el.getAttribute("id")+"-"+i),el.hasAttribute("for")){let newForAttr=el.getAttribute("for")+"-"+i;el.setAttribute("for",newForAttr)}}}}),splideRoot.dataset.autoRotate==="true"&&_setUpAutoPlay(splideRoot),window.slideshows[splideRoot.id].mount(extensions)};window.destroySlideshow=splideRoot=>{window.slideshows[splideRoot.id].destroy(),delete window.slideshows[splideRoot.id]},window.makeSlideshow=splideRoot=>{if(splideRoot.matches(".splide--thumbnails"))return;if(!splideRoot.id){console.error("Shapes Theme: makeSlideshow requires a unique ID on the slideshow root");return}if(window.slideshows[splideRoot.id])return;const mobileOnly=splideRoot.matches(".splide--mobile");let options={mediaQuery:"min",perPage:1,perMove:1,autoWidth:!0,arrows:!0,pagination:!1,rewind:!0,autoScroll:{autoStart:!1},breakpoints:mobileOnly?{990:{destroy:!0}}:{}};if(splideRoot.querySelector(".slideshow-options")!==null&&(options=JSON.parse(splideRoot.querySelector(".slideshow-options").textContent)),splideRoot.matches(".splide--product")){const productOptions={type:"slide",perPage:1,perMove:1,autoWidth:!0,pagination:!0,arrows:!0,rewind:!0,drag:splideRoot.dataset.dragDisabled!=="true",autoScroll:{autoStart:!1},breakpoints:{990:{}}};import("./components-splide-product.bundle.js").then(_ref=>{let{default:SplideProductModule,SplideProduct}=_ref;_createSplideInstance(splideRoot,productOptions,{SplideProduct})})}else{splideRoot.dataset.autoRotate==="true"&&(options.drag=!1,options.pauseOnHover=!0,options.pauseOnFocus=!0);let extensions={};options.autoScroll&&options.autoScroll.autoStart===!0&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(extensions={AutoScroll}),_createSplideInstance(splideRoot,options,extensions)}},window.discoverNewSlideshows=function(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:document).querySelectorAll(".splide").forEach(splideRoot=>{makeSlideshow(splideRoot)})},window.destroySlideshowsIn=function(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:document).querySelectorAll(".splide").forEach(splideRoot=>{destroySlideshow(splideRoot)})},document.addEventListener("DOMContentLoaded",()=>{discoverNewSlideshows()}),document.addEventListener("shapes:productquickbuy:added",()=>{discoverNewSlideshows()}),document.addEventListener("shapes:productquickbuy:willremove",e=>{e.detail.container&&destroySlideshowsIn(e.detail.container)}),document.addEventListener("shapes:product:mediachange",e=>{const splideInstance=window.slideshows[e.detail.slideshow_id];if(!splideInstance)return;const slideIndex=splideInstance.Components.Elements.slides.findIndex(slide=>Number(slide.dataset.mediaId)===e.detail.media_id);slideIndex>-1&&splideInstance.go(slideIndex)});const _setUpAutoPlay=splideRoot=>
6{const autoplayControl=splideRoot.querySelector(".splide__toggle"),playText=autoplayControl.dataset.play,pauseText=autoplayControl.dataset.pause;window.slideshows[splideRoot.id].on("autoplay:play",()=>{autoplayControl.setAttribute("aria-label",pauseText)}),window.slideshows[splideRoot.id].on("autoplay:pause",event=>{autoplayControl.setAttribute("aria-label",playText)})};function progressBar(Splide2,Components,options){const bar=Splide2.root.querySelector(".splide__progress-bar");function mount(){bar&&Splide2.on("mounted move",onMountedMove)}function onMountedMove(){const end=Splide2.Components.Controller.getEnd()+1;bar.style.width=String(100*(Splide2.index+1)/end)+"%"}return{mount}}export{progressBar}; 7//# sourceMappingURL=/cdn/shop/t/92/assets/modules-slideshow.bundle.js.map?v=47425279959070991671789964621
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.