PageSourceSearch

https://ugearsmodels.com/cdn/shop/t/12/assets/slideshow.js?v=139425166738770354121787234643

js ugearsmodels.com collected 2026-10-03 22:10:54 UTC 9,143 bytes, 2 lines download raw bytes

1customElements.get("slideshow-component")||customElements.define("slideshow-component",class extends SliderComponent{constructor(){super(),this.waitingVideo=null,this.waitingVideoEndedHandler=null,this.waitingVideoErrorHandler=null,this.waitingVideoMetadataHandler=null,this.autoplayVideoSlide=null,this.autoplayVideo=null,this.completedAutoplayVideo=null,this.failedAutoplayVideo=null,this.videoMediaQuery=null,this.videoMediaQueryChangeHandler=null,this.slideVisibilitySlider=null,this.slideVisibilityHandler=this.setSlideVisibility.bind(this)}init(){this.removeSliderInteractionListeners(),this.resetVideoAutoplayState(),super.init(),this.setupSlideVideos(),this.sliderControlWrapper=this.querySelector(".slider-buttons"),this.enableSliderLooping=!0,this.autoplayButtonQuerySelector=".slideshow__autoplay",this.autoPlayPausedClass="slideshow__autoplay--paused",this.sliderControlWrapper&&(this.sliderItemsToShow.length>0&&(this.currentPage=1),this.slideVisibilitySlider=this.slider,this.slideVisibilitySlider.addEventListener("scroll",this.slideVisibilityHandler),this.setSlideVisibility(),this.querySelectorAll(".banner__price").forEach(ele=>{ele.innerHTML=Shopify.showPrice(ele.dataset.price*1)}))}update(){const previousPage=this.currentPage;super.update();const activeSlide=this.querySelector(".slideshow__slide.active");activeSlide&&activeSlide.classList.remove("active"),this.querySelector(`.slideshow__slide:nth-child(${this.currentPage})`).classList.add("active"),previousPage&&previousPage!==this.currentPage&&!this.autoplayButtonIsSetToPlay&&this.resetVideoAutoplayState(),this.prevButton&&this.prevButton.removeAttribute("disabled")}setupSlideVideos(){this.videoMediaQuery&&this.videoMediaQueryChangeHandler&&this.videoMediaQuery.removeEventListener("change",this.videoMediaQueryChangeHandler),this.videoMediaQuery=null,this.videoMediaQueryChangeHandler=null,this.slideVideos=this.querySelectorAll(".slideshow__video"),this.slideVideos.length&&(this.slideVideos.forEach(video=>{video.muted=!0,video.setAttribute("playsinline",""),this.playVideo(video)}),this.videoMediaQuery=window.matchMedia("(min-width: 750px)"),this.videoMediaQueryChangeHandler=this.syncVideoPlayback.bind(this),this.videoMediaQuery.addEventListener("change",this.videoMediaQueryChangeHandler))}syncVideoPlayback(){this.resetVideoAutoplayState(),this.sliderControlWrapper&&this.currentPage?this.setSlideVisibility():this.slideVideos.forEach(video=>{video.offsetParent===null?video.pause():this.playVideo(video)}),this.isAutoplay&&this.autoplayButtonIsSetToPlay&&this.play()}playVideo(video){if(video.offsetParent===null||video.paused===!1||video.ended)return null;try{const playPromise=video.play();return playPromise!==void 0&&playPromise.catch(()=>{}),playPromise}catch{return!1}}setSlideVisibility(){this.sliderItemsToShow.forEach((item,index)=>{const linkElements=item.querySelectorAll("a"),videos=item.querySelectorAll(".slideshow__video");index===this.currentPage-1?(linkElements.length&&linkElements.forEach(button=>{button.removeAttribute("tabindex")}),item.setAttribute("aria-hidden","false"),item.removeAttribute("tabindex"),videos.forEach(video=>{video.offsetParent===null?video.pause():this.playVideo(video)})):(linkElements.length&&linkElements.forEach(button=>{button.setAttribute("tabindex","-1")}),item.setAttribute("aria-hidden","true"),item.setAttribute("tabindex","-1"),videos.forEach(video=>video.pause()))})}cancelVideoWaitForNavigation(){clearTimeout(this.autoplay),this.waitingVideo&&(this.completedAutoplayVideo=this.waitingVideo,this.clearVideoEndWait(),this.pauseAutoplayProgress())}onButtonClick(event){this.cancelVideoWaitForNavigation(),super.onButtonClick(event)}linkToSlide(event){this.sliderControlLinksArray.indexOf(event.currentTarget)+1!==this.currentPage&&this.cancelVideoWaitForNavigation(),super.linkToSlide(event)}getCurrentAutoplayVideo(){const currentSlide=this.sliderItemsToShow&&this.sliderItemsToShow[this.currentPage-1];let currentVideo=null;if(currentSlide&&currentSlide.dataset.playVideoToEnd==="true"&&(currentVideo=Array.from(currentSlide.querySelectorAll(".slideshow__video")).find(video=>video.offsetParent!==null)||null),(currentSlide!==this.autoplayVideoSlide||currentVideo!==this.autoplayVideo)&&(this.clearVideoEndWait(),this.autoplayVideoSlide=currentSlide,this.autoplayVideo=currentVideo,this.completedAutoplayVideo=null,this.failedAutoplayVideo=null,currentVideo))try{currentVideo.currentTime=0}catch{}return currentVideo===this.failedAutoplayVideo?null:currentVideo}
1waitForVideoEnd(video){if(this.waitingVideo===video||this.completedAutoplayVideo===video)return;this.clearVideoEndWait(),this.waitingVideo=video,this.waitingVideoEndedHandler=()=>this.handleVideoEnded(video),this.waitingVideoErrorHandler=()=>this.handleVideoWaitFailure(video),video.addEventListener("ended",this.waitingVideoEndedHandler,{once:!0}),video.addEventListener("error",this.waitingVideoErrorHandler,{once:!0}),video.addEventListener("abort",this.waitingVideoErrorHandler,{once:!0}),this.setVideoProgressDuration(video),this.restartAutoplayProgress();const playPromise=video.paused===!1?null:this.playVideo(video);playPromise===!1?this.handleVideoWaitFailure(video):playPromise?.catch(()=>this.handleVideoWaitFailure(video)),video.error?this.handleVideoWaitFailure(video):video.ended&&Promise.resolve().then(()=>this.handleVideoEnded(video))}handleVideoEnded(video){if(this.waitingVideo!==video)return;const shouldAdvance=(this.sliderItemsToShow&&this.sliderItemsToShow[this.currentPage-1])===this.autoplayVideoSlide&&this.autoplayVideo===video&&this.autoplayButtonIsSetToPlay;this.completedAutoplayVideo=video,this.clearVideoEndWait(),this.pauseAutoplayProgress(),shouldAdvance&&this.autoRotateSlides()}handleVideoWaitFailure(video){this.waitingVideo===video&&(this.failedAutoplayVideo=video,this.clearVideoEndWait(),this.play())}clearVideoEndWait(){this.waitingVideo&&(this.waitingVideoEndedHandler&&this.waitingVideo.removeEventListener("ended",this.waitingVideoEndedHandler),this.waitingVideoErrorHandler&&(this.waitingVideo.removeEventListener("error",this.waitingVideoErrorHandler),this.waitingVideo.removeEventListener("abort",this.waitingVideoErrorHandler)),this.waitingVideoMetadataHandler&&this.waitingVideo.removeEventListener("loadedmetadata",this.waitingVideoMetadataHandler)),this.waitingVideo=null,this.waitingVideoEndedHandler=null,this.waitingVideoErrorHandler=null,this.waitingVideoMetadataHandler=null}resetVideoAutoplayState(){this.clearVideoEndWait(),this.autoplayVideoSlide=null,this.autoplayVideo=null,this.completedAutoplayVideo=null,this.failedAutoplayVideo=null}setVideoProgressDuration(video){const updateDuration=()=>{if(this.waitingVideo!==video)return;const remainingDuration=video.duration-video.currentTime;Number.isFinite(remainingDuration)&&remainingDuration>0&&(this.setAutoplayProgressDuration(remainingDuration),this.restartAutoplayProgress())};video.readyState>0?updateDuration():(this.setDefaultAutoplayProgressDuration(),this.waitingVideoMetadataHandler=updateDuration,video.addEventListener("loadedmetadata",this.waitingVideoMetadataHandler,{once:!0}))}setAutoplayProgressDuration(duration){this.sliderAutoplayButton&&this.sliderAutoplayButton.style.setProperty("--speed",`${duration}s`)}setDefaultAutoplayProgressDuration(){const duration=this.autoplaySpeed?this.autoplaySpeed/1e3:Number(this.slider.dataset.speed);Number.isFinite(duration)&&duration>0&&this.setAutoplayProgressDuration(duration)}restartAutoplayProgress(){if(!this.sliderAutoplayButton)return;this.sliderAutoplayButton.classList.remove(this.autoPlayPausedClass);const progressPath=this.sliderAutoplayButton.querySelector(".slideshow__progress__path");progressPath&&progressPath.getAnimations().forEach(animation=>{animation.cancel(),animation.play()})}pauseAutoplayProgress(){if(!this.sliderAutoplayButton)return;const progressPath=this.sliderAutoplayButton.querySelector(".slideshow__progress__path");progressPath&&progressPath.getAnimations().forEach(animation=>animation.pause())}play(){const currentVideo=this.getCurrentAutoplayVideo();currentVideo?(this.slider.setAttribute("aria-live","off"),clearTimeout(this.autoplay),this.waitForVideoEnd(currentVideo),this.sliderAutoplayButton&&this.sliderAutoplayButton.classList.remove(this.autoPlayPausedClass)):(this.clearVideoEndWait(),this.setDefaultAutoplayProgressDuration(),super.play(),this.restartAutoplayProgress())}pause(){this.clearVideoEndWait(),super.pause(),this.sliderAutoplayButton&&(this.sliderAutoplayButton.classList.add(this.autoPlayPausedClass),this.pauseAutoplayProgress())}disconnectedCallback(){this.resetVideoAutoplayState(),clearTimeout(this.autoplay),this.videoMediaQuery&&this.videoMediaQueryChangeHandler&&this.videoMediaQuery.removeEventListener("change",this.videoMediaQueryChangeHandler),this.removeSliderInteractionListeners(),super.disconnectedCallback()}removeSliderInteractionListeners(){this.slideVisibilitySlider&&(this.slideVisibilitySlider.removeEventListener("scroll",this.slideVisibilityHandler),this.slideVisibilitySlider=null)}});
2//# sourceMappingURL=/cdn/shop/t/12/assets/slideshow.js.map?v=139425166738770354121787234643

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.