1(function () { 2 "use strict"; 3 4 function hasLiveSwiper(root) { 5 return !!( 6 root 7 && root.swiper 8 && !root.swiper.destroyed 9 && typeof root.swiper.slideTo === "function" 10 ); 11 } 12 13 function getDirectChild(root, className) { 14 var children = root.children; 15 16 for (var i = 0; i < children.length; i++) { 17 if (children[i].classList.contains(className)) { 18 return children[i]; 19 } 20 } 21 22 return null; 23 } 24 25 function initHomeSliderCards(root) { 26 if (!root) { 27 return null; 28 } 29 30 /* 31 * Swiper 5/6 ÑÐ¾Ñ ÑанÑÐµÑ ÑкземплÑÑ Ð² element.swiper и иÑполÑзÑÐµÑ ÐºÐ»Ð°ÑÑ 32 * swiper-container-initialized. ÐовÑе веÑÑии иÑполÑзÑÑÑ swiper-initialized. 33 * ÐÑовеÑÑем оба ваÑианÑа до ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð½Ð¾Ð²Ð¾Ð³Ð¾ ÑкземплÑÑа. 34 */ 35 if (hasLiveSwiper(root)) { 36 root.dataset.cardsSwiperState = "ready"; 37 return root.swiper; 38 } 39 40 if ( 41 root.dataset.cardsSwiperState === "initializing" 42 || root.dataset.cardsSwiperState === "ready" 43 || root.classList.contains("swiper-container-initialized") 44 || root.classList.contains("swiper-initialized") 45 ) { 46 return root.swiper || null; 47 } 48 49 if (typeof window.Swiper !== "function") { 50 return null; 51 } 52 53 /* Swiper Ð¾Ð¶Ð¸Ð´Ð°ÐµÑ .swiper-wrapper непоÑÑедÑÑвеннÑм ÑебÑнком конÑейнеÑа. */ 54 var wrapper = getDirectChild(root, "swiper-wrapper"); 55 if (!wrapper) { 56 return null; 57 } 58 59 var slides = []; 60 for (var i = 0; i < wrapper.children.length; i++) { 61 if (wrapper.children[i].classList.contains("swiper-slide")) { 62 slides.push(wrapper.children[i]); 63 } 64 } 65 66 if (!slides.length) { 67 return null; 68 } 69 70 var nextButton = getDirectChild(root, "home-slider-cards-next"); 71 var prevButton = getDirectChild(root, "home-slider-cards-prev"); 72 var pagination = getDirectChild(root, "home-slider-cards-pagination"); 73 var useLoop = slides.length > 1; 74 75 root.dataset.cardsSwiperState = "initializing"; 76 77 try { 78 var slider = new window.Swiper(root, { 79 direction: "horizontal", 80 watchOverflow: !useLoop, 81 loop: useLoop, 82 loopedSlides: slides.length, 83 loopAdditionalSlides: 3, 84 loopPreventsSliding: false, 85 navigation: { 86 nextEl: nextButton, 87 prevEl: prevButton 88 }, 89 pagination: { 90 el: pagination, 91 clickable: true, 92 dynamicBullets: true 93 }, 94 breakpoints: { 95 0: { 96 slidesPerView: 1, 97 spaceBetween: 16 98 }, 99 768: { 100 slidesPerView: 2, 101 spaceBetween: 20 102 }, 103 1200: { 104 slidesPerView: 3, 105 spaceBetween: 24 106 } 107 }, 108 autoplay: slides.length > 1 ? { 109 delay: 5000, 110 disableOnInteraction: false 111 } : false, 112 on: { 113 init: function () { 114 updateNavigationColor(this); 115 }, 116 slideChangeTransitionStart: function () { 117 updateNavigationColor(this); 118 } 119 } 120 }); 121 122 root.dataset.cardsSwiperState = "ready"; 123 root.cardsSwiperInstance = slider; 124 125 return slider; 126 } catch (error) { 127 delete root.dataset.cardsSwiperState; 128 129 if (window.console && typeof window.console.error === "function") { 130 window.console.error("Ðе ÑдалоÑÑ Ð¸Ð½Ð¸ÑиализиÑоваÑÑ ÐºÐ°ÑÑоÑнÑй Swiper", root, error); 131 } 132 133 return null; 134 } 135 136 function updateNavigationColor(instance) { 137 var activeSlide = instance.slides && instance.slides[instance.activeIndex] 138 ? instance.slides[instance.activeIndex] 139 : null; 140 141 root.classList.toggle( 142 "black-nav", 143 !!activeSlide && activeSlide.classList.contains("swiper-slide_white") 144 ); 145 } 146 } 147 148 function initAll() { 149 var sliders = document.querySelectorAll(".js-home-slider-cards"); 150 151 for (var i = 0; i < sliders.length; i++) { 152 initHomeSliderCards(sliders[i]); 153 } 154 } 155 156 if (document.readyState === "loading") { 157 document.addEventListener("DOMContentLoaded", initAll); 158 } else { 159 initAll(); 160 } 161 162 /* ÐовÑоÑнÑй вÑзов безопаÑен благодаÑÑ root.swiper и cardsSwiperState. */ 163 window.addEventListener("load", initAll); 164}());
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.