{"version":3,"file":"/scripts/slider.js","mappings":"yIAEAA,EAAAA,GAAAA,IAAW,CAAC,EAAD,kBAAXA,EAAAA,KAMA,MAAMC,EAAcC,IAElB,WAA4B,CAC1BC,SAAU,CACRC,SADQ,EAERC,QAAQ,GAEVC,cAL0B,OAM1BC,WAAY,CACVC,gBADU,EAEVC,aAAa,GAEfC,aAV0B,EAW1BC,uBAX0B,EAY1BC,YAZ0B,EAa1BC,aAb0B,EAc1BC,UAAW,CACTC,GADS,oBAETC,MAFS,EAGTC,WAAW,MAKXC,EAAqBC,IAEzB,WAAmC,CACjCC,MADiC,EAEjCd,cAFiC,EAGjCC,WAAY,CACVC,gBADU,EAEVC,aAAa,GAEfC,aAPiC,EAQjCG,aARiC,EASjCQ,WAAY,CACVN,GAAI,sBAENH,WAAY,CACVU,OADU,sBAEVC,OAAQ,0BAMRC,EAA0B,CAACC,EAA8BC,EAAUC,KAEvE,WAAyC,CACvCC,WADuC,iBAEvCR,MAFuC,EAGvCM,WAAUA,GAAW,CAAEG,MAAF,EAAuBC,sBAAsB,GAClExB,cAJuC,EAKvCC,WAAY,CACVC,gBADU,EAEVC,aAAa,GAEfC,aATuC,EAUvCW,WAAY,CACVN,GAAI,sBAENH,WAAY,CACVU,OADU,sBAEVC,OAAQ,0BAKd,SAASQ,IACP,MAAMC,EAAmBC,SAAAA,iBAAzB,WACA,IAAK,MAAL,OACEhC,EAAAA,GAEF,MAAMiC,EAA0BD,SAAAA,iBAAhC,mBACA,IAAK,MAAL,OACEf,EAAAA,GAEF,MAAMiB,EAAgCF,SAAAA,iBAAtC,0BACA,IAAK,MAAL,OAA0E,CACxE,MAAMP,EAAN,SAAiBD,EAAAA,aAAAA,iBACXE,EAAeS,SAASX,EAAAA,aAA9B,uBAEAD,EAAwBC,EAA8BC,EAAtDF,IAIJ,aAAIS,SAAAA,WACFF,IAEAM,OAAAA,iBAAAA,OAAAA,I","sources":["webpack://sage/./resources/scripts/components/slider.js"],"sourcesContent":["import Swiper, { Autoplay, Scrollbar, Mousewheel, Navigation, Pagination } from 'swiper/core';\n// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\nSwiper.use([ Autoplay, Scrollbar, Mousewheel, Navigation, Pagination]);\nimport 'swiper/scss';\nimport 'swiper/scss/scrollbar';\nimport 'swiper/scss/navigation';\nimport 'swiper/scss/pagination';\n\nconst initSwiper = (sliderContainer) => {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n  new Swiper(sliderContainer, {\n    freeMode: {\n      enabled: true,\n      sticky: false,\n    },\n    slidesPerView: 'auto',\n    mousewheel: {\n      releaseOnEdges: true,\n      forceToAxis: true,\n    },\n    spaceBetween: 0,\n    watchSlidesVisibility: true,\n    navigation: false,\n    initialSlide: 0,\n    scrollbar: {\n      el: '.swiper-scrollbar',\n      hide: false,\n      draggable: true,\n    },\n  });\n};\n\nconst initSwiperProduct = (sliderProductContainer) => {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n  new Swiper(sliderProductContainer, {\n    lazy: true,\n    slidesPerView: 1,\n    mousewheel: {\n      releaseOnEdges: true,\n      forceToAxis: true,\n    },\n    spaceBetween: 0,\n    initialSlide: 0,\n    pagination: {\n      el: '.swiper-pagination',\n    },\n    navigation: {\n      prevEl: '.swiper-button-prev',\n      nextEl: '.swiper-button-next',\n    },  \n  });\n};\n\n\nconst initSwiperImageCarousel = (sliderimageCarouselContainer, autoplay, autoplayTime) => {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n  new Swiper(sliderimageCarouselContainer, {\n    slideClass: 'wp-block-image',\n    lazy: true,\n    autoplay: autoplay ? { delay: autoplayTime, disableOnInteraction: false } : false,\n    slidesPerView: 1,\n    mousewheel: {\n      releaseOnEdges: true,\n      forceToAxis: true,\n    },\n    spaceBetween: 0,\n    pagination: {\n      el: '.swiper-pagination',\n    },\n    navigation: {\n      prevEl: '.swiper-button-prev',\n      nextEl: '.swiper-button-next',\n    },  \n  });\n};\n\nfunction initSliders() {\n  const sliderContainers = document.querySelectorAll('.swiper');\n  for (const sliderContainer of sliderContainers) {\n    initSwiper(sliderContainer);\n  }\n  const sliderProductContainers = document.querySelectorAll('.swiper-product');\n  for (const sliderProductContainer of sliderProductContainers) {\n    initSwiperProduct(sliderProductContainer);\n  }\n  const sliderimageCarouselContainers = document.querySelectorAll('.swiper-image-carousel');\n  for (const sliderimageCarouselContainer of sliderimageCarouselContainers) {\n    const autoplay = sliderimageCarouselContainer.getAttribute('data-autoplay') === 'true';\n    const autoplayTime = parseInt(sliderimageCarouselContainer.getAttribute('data-autoplay-time'));\n\n    initSwiperImageCarousel(sliderimageCarouselContainer, autoplay, autoplayTime);\n  }\n}\n\nif (document.readyState === 'complete') {\n  initSliders();\n} else {\n  window.addEventListener('load', initSliders);\n}\n"],"names":["Swiper","initSwiper","sliderContainer","freeMode","enabled","sticky","slidesPerView","mousewheel","releaseOnEdges","forceToAxis","spaceBetween","watchSlidesVisibility","navigation","initialSlide","scrollbar","el","hide","draggable","initSwiperProduct","sliderProductContainer","lazy","pagination","prevEl","nextEl","initSwiperImageCarousel","sliderimageCarouselContainer","autoplay","autoplayTime","slideClass","delay","disableOnInteraction","initSliders","sliderContainers","document","sliderProductContainers","sliderimageCarouselContainers","parseInt","window"],"sourceRoot":""}