{"version":3,"file":"full-width-image-carousel-DtGTsJda.js","sources":["../../../../src/scripts/modules/full-width-image-carousel.ts"],"sourcesContent":["import { Component } from '@verndale/core';\n\nimport Swiper from 'swiper';\nimport { Navigation, Pagination, A11y, Keyboard } from 'swiper/modules';\nimport '../../scss/modules/full-width-image-carousel.scss';\nimport 'swiper/css';\n\nclass FullWidthCarousel extends Component {\n private swiper: Swiper | null = null;\n\n constructor(el: HTMLElement) {\n super(el);\n\n if (!this.swiper) {\n this.initSwiper();\n }\n }\n\n setupDefaults() {\n this.dom = {\n swiper: this.el.querySelector('.swiper'),\n slides: this.el.querySelectorAll('.swiper-slide'),\n pagination: this.el.querySelector('.swiper-pagination'),\n next: this.el.querySelector('.swiper-button-next'),\n prev: this.el.querySelector('.swiper-button-prev')\n };\n }\n\n initSwiper() {\n this.el?.classList.remove('fw-carousel__no-carousel');\n if ((this.dom.slides as NodeList).length <= 1) {\n this.el?.classList.add('fw-carousel__no-carousel');\n return;\n }\n if (!this.swiper) {\n this.swiper = new Swiper(this.dom.swiper as HTMLElement, {\n modules: [Navigation, Pagination, A11y, Keyboard],\n slidesPerView: 1,\n spaceBetween: 16,\n loop: true,\n pagination: {\n el: this.dom.pagination as HTMLElement,\n type: 'fraction',\n renderFraction: (currentClass, totalClass) => {\n return `${currentClass}/${totalClass}`;\n }\n },\n keyboard: {\n enabled: true,\n onlyInViewport: true\n },\n navigation: {\n nextEl: this.dom.next as HTMLElement,\n prevEl: this.dom.prev as HTMLElement\n }\n });\n }\n }\n}\n\nexport default FullWidthCarousel;\n"],"names":["FullWidthCarousel","Component","el","__publicField","_a","_b","Swiper","Navigation","Pagination","A11y","Keyboard","currentClass","totalClass"],"mappings":"iTAOA,MAAMA,UAA0BC,CAAU,CAGxC,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EAHFC,EAAA,cAAwB,MAKzB,KAAK,QACR,KAAK,WAAW,CAClB,CAGF,eAAgB,CACd,KAAK,IAAM,CACT,OAAQ,KAAK,GAAG,cAA8B,SAAS,EACvD,OAAQ,KAAK,GAAG,iBAAiC,eAAe,EAChE,WAAY,KAAK,GAAG,cAA8B,oBAAoB,EACtE,KAAM,KAAK,GAAG,cAA8B,qBAAqB,EACjE,KAAM,KAAK,GAAG,cAA8B,qBAAqB,CACnE,CAAA,CAGF,YAAa,SAEX,IADKC,EAAA,KAAA,KAAA,MAAAA,EAAI,UAAU,OAAO,4BACrB,KAAK,IAAI,OAAoB,QAAU,EAAG,EACxCC,EAAA,KAAA,KAAA,MAAAA,EAAI,UAAU,IAAI,4BACvB,MAAA,CAEG,KAAK,SACR,KAAK,OAAS,IAAIC,EAAO,KAAK,IAAI,OAAuB,CACvD,QAAS,CAACC,EAAYC,EAAYC,EAAMC,CAAQ,EAChD,cAAe,EACf,aAAc,GACd,KAAM,GACN,WAAY,CACV,GAAI,KAAK,IAAI,WACb,KAAM,WACN,eAAgB,CAACC,EAAcC,IACtB,2CAA2CD,CAAY,iDAAiDC,CAAU,SAE7H,EACA,SAAU,CACR,QAAS,GACT,eAAgB,EAClB,EACA,WAAY,CACV,OAAQ,KAAK,IAAI,KACjB,OAAQ,KAAK,IAAI,IAAA,CACnB,CACD,EACH,CAEJ"}