PageSourceSearch

https://5element.by/local/templates/html/assets/components-template/index/sl-hero/script.min.js?17902545905013

js 5element.by collected 2026-09-24 17:53:32 UTC 5,013 bytes, 1 lines download raw bytes

1(function(){"use strict";class a{constructor(){this.queue=[],this.processing=!1,this.pendingTasks=new Set}enqueue(a,b=null){return b&&this.pendingTasks.has(b)?Promise.reject():new Promise((c,d)=>{this.queue.push({task:a,resolve:c,reject:d,taskId:b}),this.processing||this.processQueue()})}async processQueue(){if(!(this.processing||0===this.queue.length)){for(this.processing=!0;0<this.queue.length;){const{task:a,resolve:b,reject:c,taskId:d}=this.queue.shift();d&&this.pendingTasks.add(d);try{const c=await a();b(c)}catch(a){c(a)}finally{d&&this.pendingTasks.delete(d)}}this.processing=!1}}clear(){this.queue=[],this.pendingTasks.clear()}size(){return this.queue.length}}new a,(()=>{const b=function(b){this.sentBannerIds=new Set,this.sentPromotionIds=new Set,this.analyticsQueue=new a,this.getPromotionPayload=a=>{const b=a?.dataset?.promotion;try{return b?JSON.parse(b):null}catch(a){return null}},this.trackItemSelection=a=>{"1"!==a?.items[0]?.id&&a?.items[0]?.price&&window.GtagService.trackSelectItem("\u0413\u043B\u0430\u0432\u043D\u044B\u0439 \u0431\u0430\u043D\u043D\u0435\u0440",a?.items)},this.loadSlide=function(){const a=b.querySelectorAll(".swiper-slide-prev, .swiper-slide-next, .swiper-slide-visible");a.forEach(a=>{const b=a.querySelectorAll("source[data-srcset]"),c=a.querySelectorAll("img[data-src]:not(.loaded)");b.forEach(a=>{const b=a.getAttribute("data-srcset");a.setAttribute("srcset",b),a.removeAttribute("data-srcset")}),c.forEach(a=>{const b=a.getAttribute("data-src");a.setAttribute("src",b),a.classList.add("loaded"),a.removeAttribute("data-src")})})},this.sendAnalytics=(a,b)=>{const c=a.filter(a=>!this.sentBannerIds.has(a));if(0===c.length)return Promise.resolve();const d=c.sort().join("_");return this.analyticsQueue.enqueue((async()=>{const a=await fetch("/api/v1/banners/show",{method:"POST",cache:"no-cache",headers:{[b.header]:b.token},body:JSON.stringify({ids:c})});return a.ok?(c.forEach(a=>this.sentBannerIds.add(a)),{success:!0,ids:c}):void console.error("Main (hero) banner show analytics error")}).bind(this),d)},this.initClickAnalytics=(a,b,c)=>{a.addEventListener("click",()=>{const d=a.closest(".swiper-slide"),e=this.getPromotionPayload(d),f=e?.promotion_id||b;e&&f&&window.GtagService&&(window.GtagService.trackSelectPromotion(e),this.trackItemSelection(e)),fetch(`/api/v1/banners/${b}/click`,{method:"POST",cache:"no-cache",headers:{[c.header]:c.token}}).then(a=>{a.ok||console.error("Main (hero) banner click analytics error")})})},this.sendVisibleSlidesAnalytics=()=>{if(!this._data.banners||!window.APP?.stateStore?.csrf||!this.observer||!this._data.isIntersect)return;const a=window.APP.stateStore.csrf,b=[],c=this._data.slider?.slides?.length?[this._data.slider.slides[this._data.slider.activeIndex]]:this._data.container.querySelectorAll(".swiper-slide-active");c.forEach(a=>{const c=a.querySelector("[data-banner-id]");if(c){const{bannerId:d}=c.dataset,e=this.getPromotionPayload(a),f=e?.promotion_id||d;e&&f&&!this.sentPromotionIds.has(f)&&(this.sentPromotionIds.add(f),window.GtagService&&window.GtagService.trackViewPromotion(e)),d&&!this.sentBannerIds.has(d)&&b.push(d)}}),b.length&&this.sendAnalytics(b,a);const d=this._data.container.querySelectorAll(".swiper-slide");this.observer&&this.sentBannerIds.size>=d.length&&(this.observer.disconnect(),this.observer=null,this._data.isIntersect=!0)},this.initAnalytics=()=>{this._data.banners=this._data.container.querySelectorAll("[data-banner-id]");const a=window.APP?.stateStore?.csrf;this._data.banners?.length&&a?.token&&this._data.banners.forEach(b=>{const{bannerId:c}=b.dataset;c&&this.initClickAnalytics(b,c,a)})},this.initSlider=function(){this.loadSlide(),this._data.slider=new Swiper(this._data.container,{autoplay:!0,spaceBetween:24,speed:600,loop:!0,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},pagination:{el:".swiper-pagination",clickable:!0},breakpoints:{575:{pagination:{dynamicBullets:!1}},0:{pagination:{dynamicBullets:!0,dynamicMainBullets:1}}},on:{slideChange:()=>{this.loadSlide()},slideChangeTransitionEnd:()=>{this.sendVisibleSlidesAnalytics()},init:()=>{this.loadSlide(),this.sendVisibleSlidesAnalytics()}}}),this.initAnalytics(),this.setInitialMaxHeight()},this.initParams=function(){this._data={container:b,slider:null,banners:null,isIntersect:!1}},this.initObserver=function(){this.observer=new IntersectionObserver(a=>{a.forEach(a=>{this._data.isIntersect=a.isIntersecting,a.isIntersecting&&this.sendVisibleSlidesAnalytics()})},{rootMargin:"10px"}),this.observer.observe(this._data.container)},this.init=function(){this.initParams(),this.initObserver(),this.initSlider()},this.setInitialMaxHeight=function(){const a=window.innerWidth,b=this._data.container.querySelector(".swiper-wrapper");if(a<=1144&&a>=690&&b){const{clientHeight:a}=b;this._data.container.style.maxHeight=`${a+17}px`}}};window.addEventListener("global-state-mounted",()=>{const a=document.getElementsByClassName("js-sl-hero");for(let c=0;c<a.length;c++)new b(a[c]).init()})})()})();

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.