PageSourceSearch

https://muza.com.pl/gfx/pol/hotspots_slider.js.gzip?r=1775639368

js muza.com.pl collected 2026-09-24 21:48:52 UTC 7,275 bytes, 1 lines download raw bytes

1const HotspotSliderTXT={"To jest pierwszy produkt":"To jest pierwszy produkt","To jest ostatni produkt":"To jest ostatni produkt","Poprzedni produkt":"Poprzedni produkt","Następny produkt":"Następny produkt","Idź do produktu":"Idź do produktu"};class HotspotSlider{constructor({selector:t="",options:e={},hotspotName:s="",hotspotElement:i,callbackBefore:o=t=>{},callbackAfter:r=t=>{}}={}){this.hotspotName=s,this.hotspotElement=i,this.selector=t,this.options=e,this.slider=null,this.txt={...HotspotSliderTXT},this.settings={loop:!1,slidesPerView:1.4,spaceBetween:6,centeredSlides:!1,centeredSlidesBounds:!1,watchSlidesProgress:!0,navigation:{nextEl:`#${this.hotspotName} .swiper-button-next`,prevEl:`#${this.hotspotName} .swiper-button-prev`},pagination:!1,breakpoints:{550:{slidesPerView:2.4,centeredSlides:!1,centeredSlidesBounds:!1},757:{slidesPerView:3.5,centeredSlides:!1,centeredSlidesBounds:!1},979:{slidesPerView:4.5,centeredSlides:!1,centeredSlidesBounds:!1},1200:{slidesPerView:5.5,centeredSlides:!1,centeredSlidesBounds:!1}},...e},this.accessibilityOptions={firstSlideMessage:this.txt["To jest pierwszy produkt"],lastSlideMessage:this.txt["To jest ostatni produkt"],prevSlideMessage:this.txt["Poprzedni produkt"],nextSlideMessage:this.txt["Następny produkt"],paginationBulletMessage:`${this.txt["Idź do produktu"]} {{index}}`},this.accessibilityOptionsNamed={firstSlideMessage:this.txt["To jest pierwszy produkt"],lastSlideMessage:this.txt["To jest ostatni produkt"],prevSlideMessage:"",nextSlideMessage:"",paginationBulletMessage:`${this.txt["Idź do produktu"]} {{index}}`},this.callbackBefore=o,this.callbackAfter=r}async init(){const{Slider:t,SliderThumbnails:e}=await appModules.load("Slider");if(!t||!e)return void app_shop.vars.utils.debug("HotspotSlider","(async) init","Pobierane moduły [Slider, SliderThumbnails] nie istnieją");const s=document.querySelector(this.selector);if(!s)return void app_shop.vars.utils.debug("HotspotSlider","(async) init",`Wskazany element hotspota nie istnieje. Wybrany selektor: ${this.selector}`,s);this.slider=new t,"function"==typeof this.callbackBefore&&this.callbackBefore(this.slider);if(!await this.slider.init({options:this.settings}))return void app_shop.vars.utils.debug("HotspotSlider","(async) init","Nie udało się zainicjalizować slidera.",this.slider);await this.slider.enableA11y(this.getAccessibilityOptions()),this.attachListeners(s);await this.slider.setupSlider({element:s,customName:this.hotspotName})?(this.disableArrowsTabIndex(),this.setArrowsHeight(s,this.slider.slider),this.setHotspotClass(s),"function"==typeof this.callbackAfter&&this.callbackAfter(this.slider)):app_shop.vars.utils.debug("HotspotSlider","(async) init","Nie udało się zainstalować slidera na stronie.",this.slider)}getAccessibilityOptions(){return this.hasNamedNavigation()?this.accessibilityOptionsNamed:this.accessibilityOptions}hasNamedNavigation(){return!!this.hotspotElement&&!!this.hotspotElement.querySelector(".hotspot__arrow")}getElementSizes(t){const e=window.getComputedStyle(t),s=parseFloat(e.marginTop)||0,i=parseFloat(e.marginBottom)||0;return{marginTop:s,marginBottom:i,paddingTop:parseFloat(e.paddingTop)||0,paddingBottom:parseFloat(e.paddingBottom)||0,computedHeight:t.offsetHeight+s+i}}setHotspotClass(t){const e=t.closest(".hotspot");e&&e.classList.add("--initialized")}setArrowsHeight(t,e){const s=t?.closest(".hotspot");if(!s||s?.classList?.contains("--slider_gallery"))return;if(!Array.isArray(e.visibleSlides))return;const i=s.querySelector(".hotspot__name"),o=i?this.getElementSizes(i).computedHeight:0,r=t.closest(".hotspot__wrapper"),{marginTop:l=0,paddingTop:a=0}=r?this.getElementSizes(r):{},n=l+a,d=e.visibleSlides.map((t=>{const e=t.querySelector(".product__icon"),s=this.getElementSizes(e).computedHeight||e.height;return Number.isNaN(s)?0:s})),p=Math.max(...d);0!==p&&s?.style.setProperty("--arrows-height",`calc(${n}px + ${o}px + ((${p}px - var(--swiper-navigation-size, 40px)) / 2))`)}attachListeners(t){this.slider.watchEvent("resize",(e=>{this.setArrowsHeight(t,e)})),this.slider.watchEvent("fromEdge toEdge afterInit lock unlock",(()=>{this.disableArrowsTabIndex()}))}disableArrowsTabIndex(){this.settings.loop||this.settings.rewind||(this.slider?.slider?.navigation?.prevEl?.setAttribute?.("tabindex",-1),this.slider?.slider?.navigation?.nextEl?.setAttribute?.("tabindex",-1))}async reset(){this.slider&&this.slider.slider.destroy(!0,!1),await this.init()}destroy(){this.slider&&this.slider.slider.destroy(!0,!0)}}class HotspotSetSliderPlugin extends GetHotspots{async initSlider(t){const e=`#${this.hotspotElement?.id||"hotspotSlider"}`,s=this.productsMinHeight;app_shop.vars.hotspotSliders=app_shop.vars.hotspotSliders??{},app_shop.vars.hotspotSliders[e]=new HotspotSlider({selector:`#${this.hotspotElement?.id||""} .hotspot .swiper`,hotspotName:this.hotspotElement?.id||"custom",hotspotElement:this.hotspotElement,options:t??{},callbackAfter:t=>{s&&app_shop.fn?.setCustomHeight({selectors:[`#${this.hotspotElement?.id} .product__prices`,`#${this.hotspotElement?.id} .product__name`,`#${this.hotspotElement?.id} .product__author`],container:`#${this.hotspotElement?.id} .products`})}}),await app_shop.vars.hotspotSliders[e].init(),app_shop.fn.projectorTabs&&app_shop.fn.projectorTabs.init()}async init(t){const[e,s,i]=t;this.hotspotData=e,this.hotspotTemplate=s,this.hotspotElement=i,this.sliderGalleryOptions={loop:!1,navigation:{nextEl:`#${this.hotspotElement?.id||"custom"} .hotspot__arrow.--next`,prevEl:`#${this.hotspotElement?.id||"custom"} .hotspot__arrow.--prev`},slidesPerView:1.4,slidesPerGroup:1,centeredSlides:!0,centeredSlidesB
1ounds:!0,breakpoints:{550:{slidesPerView:2.4},757:{slidesPerView:4.5,centeredSlides:!1,centeredSlidesBounds:!1},979:{slidesPerView:5.5,centeredSlides:!1,centeredSlidesBounds:!1}}};const o=i.querySelector(".--slider");if(!o||"function"!=typeof HotspotSlider||this.hotspotData.products.length<1)return!1;i?.removeChild(o);const r=document.querySelector(`#${this.hotspotElement?.id} .hotspot.--slider_gallery`)?this.sliderGalleryOptions:{};return Object.keys(r).length||i.querySelector(".hotspot")?.classList?.add?.("--slider_standard"),await this.initSlider(r),!0}}app_shop.vars.hotspotCallbacksAfterAppend.slider=async(...t)=>{const e=new HotspotSetSliderPlugin;await e.init(t)},app_shop.fn.setCustomHeight=function(t){if(!t||!t.selectors||!t.container)return;const e=document.querySelectorAll(t.container);return 0!==e.length?(t.selectors.forEach((t=>{e.forEach((e=>{const s=e.querySelectorAll(t);if(0===s.length)return;s.forEach((t=>{t.style.minHeight="auto"}));let i=0;s.forEach((t=>{const e=t.offsetHeight;e>i&&(i=e)})),s.forEach((t=>{t.style.minHeight=`${i}px`}))}))})),{reset:function(){t.selectors.forEach((t=>{e.forEach((e=>{e.querySelectorAll(t).forEach((t=>{t.style.minHeight="auto"}))}))}))},recalculate:function(){app_shop.fn.setCustomHeight(t)}}):void 0},app_shop.fn.forceLoadVisibleImages=function(t){t.slides.filter((t=>t.classList.contains("swiper-slide-visible"))).forEach((t=>{const e=t.querySelector("img");if(e&&(e.loading="eager",!e.complete&&e.src)){const t=e.src;e.src="",e.src=t}})),t.slides.forEach((t=>{if(!t.classList.contains("swiper-slide-visible")){const e=t.querySelector("img");e&&(e.loading="lazy")}}))};

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.