1class Countdown extends HTMLElement{constructor(){if(super(),this.enableMockTimer=this.getAttribute("data-enable-mock-timer")==="true",!this.enableMockTimer)this.userDate=this.getAttribute("data-date"),this.userTime=this.getAttribute("data-time");else{const INFINITE_DAYS=this.getAttribute("data-enable-mock-picker-day")?Number(this.getAttribute("data-enable-mock-picker-day")):2,DIFF_HOURS=this.getAttribute("data-enable-mock-picker-hours")?Number(this.getAttribute("data-enable-mock-picker-hours")):3,now=new Date,futureDate=new Date(now.getTime()+(INFINITE_DAYS*24+DIFF_HOURS)*60*60*1e3),year=futureDate.getFullYear(),month=String(futureDate.getMonth()+1).padStart(2,"0"),day=String(futureDate.getDate()).padStart(2,"0"),hours=String(futureDate.getHours()).padStart(2,"0"),minutes=String(futureDate.getMinutes()).padStart(2,"0");this.userDate=`${year}-${month}-${day}`,this.userTime=`${hours}:${minutes}`}this.interval,this.setInterval(this.userDate,this.userTime),this.initSection()}onInit(userDate,userTime){this.completedCountdown=this.getAttribute("data-completed"),this.countdown=this.querySelector(".countdown__main"),this.countdownHeading=this.querySelector(".countdown__end-info"),this.daysEl=this.querySelector(".countdown_block_days"),this.hoursEl=this.querySelector(".countdown_block_hours"),this.minutesEl=this.querySelector(".countdown_block_minutes"),this.secondsEl=this.querySelector(".countdown_block_seconds"),this.section=this.closest(".countdown-section");const countdownDate=new Date(`${userDate}T${userTime}`),now=new Date,distance=countdownDate.getTime()-now.getTime(),days=Math.floor(distance/(1e3*60*60*24)),hours=Math.floor(distance%(1e3*60*60*24)/(1e3*60*60)),minutes=Math.floor(distance%(1e3*60*60)/(1e3*60)),seconds=Math.floor(distance%(1e3*60)/1e3);distance<0&&this.completedCountdown==="hide_section"?(clearInterval(this.interval),this.section.style.display="none"):distance<0&&this.completedCountdown==="show_text"?(clearInterval(this.interval),this.countdown.style.display="none",this.countdownHeading.style.display="flex"):(String(days).length===1?this.daysEl.textContent="0"+days:this.daysEl.textContent=days,String(hours).length===1?this.hoursEl.textContent="0"+hours:this.hoursEl.textContent=hours,String(minutes).length===1?this.minutesEl.textContent="0"+minutes:this.minutesEl.textContent=minutes,String(seconds).length===1?this.secondsEl.textContent="0"+seconds:this.secondsEl.textContent=seconds)}setInterval(userDate,userTime){clearInterval(this.interval),this.interval=setInterval(this.onInit.bind(this,userDate,userTime),1e3)}playVideo(section){const video=section.querySelector("video");video&&video.play()}stopVideo(section){const video=section.querySelector("video");video&&video.pause()}initSection(){const sections=document.querySelectorAll(".countdown-section"),sectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting?this.playVideo(entry.target):this.stopVideo(entry.target)})}),sectionResizeObserver=new ResizeObserver(entries=>{const[entry]=entries;this.playVideo(entry.target)});sections.forEach(section=>{sectionObserver.observe(section),sectionResizeObserver.observe(section)})}}customElements.define("countdown-timer",Countdown),(function(){const mediaBanner=()=>{document.querySelectorAll(".countdown").forEach(block=>{let box=block.closest("section"),id=box.getAttribute("id");if(block=$(block),block.data("sticky-effect")){var normalElement=document.querySelector(`#${id} + .sticky-section`);if(normalElement==null)return;var isSticky=!1;window.addEventListener("scroll",function(){var stickyTop=box.getBoundingClientRect().top,normalElementTop=normalElement.getBoundingClientRect().top;stickyTop<=0&&!isSticky&&(box.classList.add("sticky-active"),isSticky=!0),normalElementTop<=0&&isSticky&&(box.classList.remove("sticky-active"),isSticky=!1)})}})};document.addEventListener("DOMContentLoaded",function(){mediaBanner(),document.addEventListener("shopify:section:load",function(){mediaBanner()})})})(); 2//# sourceMappingURL=/cdn/shop/t/7/assets/countdown.js.map?v=173339808955512915161760366738
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.