{"version":3,"sources":["webpack://@verndale/toolkit/./src/js/helpers/index.js","webpack://@verndale/toolkit/./src/js/modules/bicentennial/StatisticsRow.js"],"names":[],"mappings":"sRAIO,KAAM,GAAW,CAAC,EAAU,IAAS,CAC1C,GAAI,GACJ,MAAO,IAAI,IAAS,CAClB,aAAa,GACb,EAAU,WAAW,IAAM,CACzB,EAAS,GAAG,IACX,KAIM,EAAW,CAAC,EAAU,IAAS,CAC1C,GAAI,GACJ,MAAO,IAAI,IAAS,CAClB,GACE,GAAS,GAAG,GACZ,EAAa,GACb,WAAW,IAAM,CACf,EAAa,IACZ,MASI,EAAc,GAAM,CAC/B,GACE,EAAG,SAAW,GACb,EAAG,WAAa,GAAK,EAAG,aAAa,cAAgB,KAEtD,MAAO,GAGT,GAAI,EAAG,SACL,MAAO,GAIT,OAAQ,EAAG,cACJ,IACH,MAAO,CAAC,CAAC,EAAG,MAAQ,EAAG,MAAQ,aAC5B,QACH,MAAO,GAAG,OAAS,UAAY,EAAG,OAAS,WACxC,aACA,aACA,WACH,MAAO,WAEP,MAAO,KAQA,EAAU,CACrB,IAAK,EACL,OAAQ,GACR,IAAK,GACL,MAAO,GACP,OAAQ,GACR,SAAU,GACV,IAAK,GACL,KAAM,GACN,KAAM,GACN,GAAI,GACJ,MAAO,GACP,KAAM,IAMK,EAAc,CACzB,OAAQ,IACR,OAAQ,IACR,gBAAiB,KACjB,QAAS,KACT,KAAM,MAOK,EAA2B,CACtC,eAAgB,GAChB,WAAY,GACZ,OAAQ,GACR,cAAe,EACf,aAAc,EACd,MAAO,IACP,cAAe,GACf,oBAAqB,IAOV,EAAiB,GACxB,MAAO,IAAU,SACZ,EAAM,QAAQ,wBAAyB,CAAC,EAAG,IAChD,OAAO,aAAa,SAAS,EAAG,MAE7B,G,kEC5GT,SAAW,CAAC,KAAY,KAAY,OAEpC,eAA4B,KAAU,CACpC,eAAgB,CACd,KAAK,IAAM,CACT,gBAAiB,KAAK,GAAG,cACvB,qBAEF,aAAc,KAAK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AK,OAAO,GAAG,YAAa,OAAO,cAAc,GAAI,OAAM,aAI/D,UAAe","file":"scripts/8822.732f8437e77471fc6fb5.js","sourcesContent":["// /**\n// * debounce function\n// * Delays the processing of the event\n// */\nexport const debounce = (callback, wait) => {\n let timerId;\n return (...args) => {\n clearTimeout(timerId);\n timerId = setTimeout(() => {\n callback(...args);\n }, wait);\n };\n};\n\nexport const throttle = (callback, wait) => {\n let inThrottle;\n return (...args) => {\n if (!inThrottle) {\n callback(...args);\n inThrottle = true;\n setTimeout(() => {\n inThrottle = false;\n }, wait);\n }\n };\n};\n// /**\n// * Checks if an element is focusable\n// *\n// * @param {Object} el - HTML element you want to check if it's focusable\n// */\nexport const isFocusable = el => {\n if (\n el.tabIndex > 0 ||\n (el.tabIndex === 0 && el.getAttribute('tabIndex') !== null)\n ) {\n return true;\n }\n\n if (el.disabled) {\n return false;\n }\n\n /* eslint-disable indent */\n switch (el.nodeName) {\n case 'A':\n return !!el.href && el.rel !== 'ignore';\n case 'INPUT':\n return el.type !== 'hidden' && el.type !== 'file';\n case 'BUTTON':\n case 'SELECT':\n case 'TEXTAREA':\n return true;\n default:\n return false;\n }\n /* eslint-enable indent */\n};\n\n// /**\n// * Key code list object\n// */\nexport const keyCode = {\n TAB: 9,\n RETURN: 13,\n ESC: 27,\n SPACE: 32,\n PAGEUP: 33,\n PAGEDOWN: 34,\n END: 35,\n HOME: 36,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n};\n\n// /**\n// * Breakpoints list object\n// */\nexport const breakpoints = {\n mobile: 360,\n tablet: 768,\n tabletLandscape: 1024,\n desktop: 1280,\n wide: 1600\n};\n\n// /**\n// * Bicentennial Swiper Object\n// */\n\nexport const bicentennialSwiperConfig = {\n allowTouchMove: false,\n autoHeight: false,\n rewind: true,\n slidesPerView: 1,\n spaceBetween: 0,\n speed: 1000,\n watchOverflow: true,\n watchSlidesProgress: true\n}\n\n// /**\n// * Convert Unicode characters inside a string to their actual characters\n// */\n\nexport const convertUnicode = (input) => {\n if (typeof input === 'string') {\n return input.replace(/\\\\+u([0-9a-fA-F]{4})/g, (a, b) =>\n String.fromCharCode(parseInt(b, 16)))\n }\n return input;\n};\n","import { Component } from '@verndale/core';\nimport Swiper, { Navigation, Pagination, A11y } from 'swiper';\nimport { breakpoints, debounce, bicentennialSwiperConfig } from '../../helpers/index';\n\nSwiper.use([Navigation, Pagination, A11y]);\n\nclass StatisticsRow extends Component {\n setupDefaults() {\n this.dom = {\n swiperContainer: this.el.querySelector(\n '.swiper-container'\n ),\n swiperSlides: this.el.querySelectorAll(\n '.swiper-slide'\n ),\n swiperPagination: this.el.querySelector(\n '.swiper-pagination'\n ),\n swiperButtonPrev: this.el.querySelector(\n '.swiper-btn-prev'\n ),\n swiperButtonNext: this.el.querySelector(\n '.swiper-btn-next'\n ),\n swiperControls: this.el.querySelector(\n '.swiper-controls'\n )\n };\n\n this.columns = parseInt(this.el.dataset.columns, 10);\n\n if (this.el.classList.contains('bicentennial-content-carousel')) {\n this.extraConfig = {\n spaceBetween: 135\n }\n }\n\n if (this.el.classList.contains('bicentennial-content-carousel--related-content')) {\n this.extraConfig = {\n spaceBetween: 30\n }\n }\n\n if (this.el.classList.contains('bicentennial-content-card-row')) {\n this.extraConfig = {\n spaceBetween: 0\n }\n\n this.isDesktopMultiRow = true;\n }\n\n if (this.el.classList.contains('bicentennial-statistics-row')) {\n this.isDesktopMultiRow = true;\n }\n\n this.initSlider();\n }\n\n resetSlide() {\n if (window.matchMedia(`(min-width: ${breakpoints.tabletLandscape}px)`).matches) {\n this.swiper.slideTo(0);\n }\n }\n\n handleSwiperResize(swiper) {\n if (swiper.isLocked) {\n this.dom.swiperControls.style.visibility = 'hidden';\n } else {\n this.dom.swiperControls.style.removeProperty('visibility');\n }\n\n if (this.isDesktopMultiRow) {\n this.resetSlide();\n }\n }\n\n initSlider() {\n const totalPanels = this.dom.swiperSlides.length;\n const config = { ...bicentennialSwiperConfig, ...this.extraConfig };\n\n this.swiper = new Swiper(this.dom.swiperContainer, {\n ...config,\n breakpoints: {\n [breakpoints.tablet]: {\n slidesPerView: totalPanels > 2 ? 2 : totalPanels,\n },\n [breakpoints.tabletLandscape]: {\n slidesPerView: totalPanels > this.columns ? this.columns : totalPanels,\n speed: this.isDesktopMultiRow ? 0 : config.speed\n }\n },\n navigation: {\n prevEl: this.dom.swiperButtonPrev,\n nextEl: this.dom.swiperButtonNext\n },\n a11y: {\n prevSlideMessage: this.el.dataset.previousSlideAriaLabel,\n nextSlideMessage: this.el.dataset.nextSlideAriaLabel\n },\n pagination: {\n el: this.dom.swiperPagination,\n clickable: true,\n }\n });\n\n this.swiper.on('resize', debounce(this.handleSwiperResize.bind(this), 100));\n this.swiper.on('afterInit', window.dispatchEvent(new Event('resize')));\n }\n}\n\nexport default StatisticsRow;\n"],"sourceRoot":""}