{"version":3,"sources":["webpack://frontendplaceholder/./Src/Scripts/components/mobile-slider.js"],"names":["Swiper","use","Scrollbar","constructor","elm","scrollBar","querySelector","slidePerViewMobile","dataset","slidesPerViewMobile","breakpointPx","breakpoint","parentNode","window","matchMedia","options","loop","slidesPerView","spaceBetween","observer","observeParents","watchSlidesVisibility","watchOverflow","scrollbar","el","draggable","snapOnRelease","breakpointPxAsInt","swiper","enableSwiper","breakpointChecker","matches","undefined","destroy","addListener"],"mappings":"sMAAA,M,wbAAA,U,+HACAA,UAAOC,IAAI,CAACC,c,UAEG,MACXC,YAAYC,GACR,IAAIC,EAAYD,EAAIE,cAAc,qBAClC,MAAMC,EAAqBH,EAAII,QAAQC,qBAAuB,OACxDC,EAAeN,EAAII,QAAQG,YAAc,MAE1CN,IACDA,EAAYD,EAAIQ,WAAWN,cAAc,sBAE7C,MAAMK,EAAaE,OAAOC,WAAY,cAAaJ,QAC7CK,EAAU,CACZC,MAAM,EACNC,cAAeV,EACfW,aAAc,GACdC,UAAU,EACVC,gBAAgB,EAChBC,uBAAuB,EACvBC,eAAe,EACfC,UAAW,CACPC,GAAInB,EACJoB,WAAW,EACXC,eAAe,GAEnBf,WAAY,CACRgB,kBAAmB,CACfV,cAAe,OAK3B,IAAIW,EAEJ,SAASC,IACLD,EAAS,IAAI5B,UAAOI,EAAKW,GAE7B,SAASe,KACsB,IAAvBnB,EAAWoB,SAGmB,IAAvBpB,EAAWoB,SAClBF,SAHeG,IAAXJ,GAAwBA,EAAOK,SAAQ,GAAM,GAOpDtB,EAAWoB,SACZF,IAGJlB,EAAWuB,YAAYJ,GAEvBA","file":"610.110a62d87119ff97f7ea.js","sourcesContent":["import Swiper, { Scrollbar } from 'swiper/core';\nSwiper.use([Scrollbar]);\n\nexport default class MobileSlider {\n constructor(elm) {\n let scrollBar = elm.querySelector('.swiper-scrollbar');\n const slidePerViewMobile = elm.dataset.slidesPerViewMobile || 'auto';\n const breakpointPx = elm.dataset.breakpoint ?? '576';\n\n if (!scrollBar) {\n scrollBar = elm.parentNode.querySelector('.swiper-scrollbar');\n }\n const breakpoint = window.matchMedia(`(min-width:${breakpointPx}px)`);\n const options = {\n loop: false,\n slidesPerView: slidePerViewMobile,\n spaceBetween: 15,\n observer: true,\n observeParents: true,\n watchSlidesVisibility: true,\n watchOverflow: true,\n scrollbar: {\n el: scrollBar,\n draggable: true,\n snapOnRelease: true,\n },\n breakpoint: {\n breakpointPxAsInt: {\n slidesPerView: 1.4,\n },\n },\n };\n\n let swiper = undefined;\n\n function enableSwiper() {\n swiper = new Swiper(elm, options);\n }\n function breakpointChecker() {\n if (breakpoint.matches === true) {\n if (swiper !== undefined) { swiper.destroy(true, true); }\n return;\n } else if (breakpoint.matches === false) {\n enableSwiper();\n }\n }\n\n if (!breakpoint.matches) {\n enableSwiper();\n }\n // keep an eye on viewport size changes\n breakpoint.addListener(breakpointChecker);\n // kickstart\n breakpointChecker();\n\n\n }\n}\n"],"sourceRoot":""}