https://www.urbanmonkey.com/cdn/shop/t/861/assets/module-current-s…?v=122228528370344898141781497467
1export function init(obj){const item=new Promo(obj)}class Promo{constructor(obj){this.obj=obj,this.promo=obj.querySelector(".current-sales-popup__block__container"),this.start=Number(obj.getAttribute("data-start")),this.nextmin=Number(obj.getAttribute("data-min")),this.nextmax=Number(obj.getAttribute("data-max")),this.timer=!1,this.lastindexel=-1,this.lastactiveel=!1,this.init(),this.initEvents()}init(){if(window.innerWidth>576&&window.innerWidth<=1024&&this.obj.classList.contains("csld-hide-st")||window.innerWidth<=576&&this.obj.classList.contains("csld-hide-sp"))return!1;var delay=this.start=="inited"?this.getRndInteger(this.nextmin,this.nextmax):this.start;this.start="inited",clearTimeout(this.timer),this.timer=setTimeout(()=>{var index=this.getProductIndex(),nextel=this.promo.children[index];this.setInfo(nextel),this.lastactiveel&&this.lastactiveel.classList.remove("active"),this.lastactiveel=nextel,this.lastindexel=index,setTimeout(function(){nextel.classList.add("active")},300),this.init()},delay)}initEvents(){this.obj.querySelectorAll(".current-sales-popup__container__close").forEach(item=>{item.addEventListener("click",event=>{event.target.closest(".current-sales-popup__block").classList.remove("active"),this.lastindexel=-1,this.lastactiveel=!1,this.init()})})}setInfo(el){var txt=el.getAttribute("data-text"),min=Number(el.getAttribute("data-min")),max=Number(el.getAttribute("data-max")),rm=this.getRndInteger(min,max);txt.indexOf("||")>-1&&(txt=txt.split("||"),txt=txt[this.getRndInteger(0,txt.length)]),el.querySelector(".current-sales-popup__block__content__message__time").innerHTML=rm,el.querySelector(".current-sales-popup__block__content__message__text").innerHTML=txt}getProductIndex(){var min=0,max=this.promo.children.length;return this.getRndInteger(min,max)}getRndInteger(min,max){return Math.floor(Math.random()*(max-min))+min}} 2//# sourceMappingURL=/cdn/shop/t/861/assets/module-current-sales-popup.js.map?v=122228528370344898141781497467
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.