{ "version": 3, "sources": ["../node_modules/@tannerhodges/snap-slider/snap-slider.js", "stellar.bank/calculators.js", "../node_modules/css-has-pseudo/src/encode/decode.mjs", "../node_modules/css-has-pseudo/src/encode/extract.mjs", "../node_modules/css-has-pseudo/src/encode/encode.mjs", "../node_modules/css-has-pseudo/src/browser.js", "../node_modules/@mrhenry/core-web/modules/~element-qsa-has.js", "../modules/stellar.bank/stellarbank/site-header/default/index.js", "../modules/stellar.bank/stellarbank/tabs/default/index.js", "../modules/stellar.bank/stellarbank/carousel/default/index.js", "../modules/stellar.bank/stellarbank/Location/default/index.js", "../modules/stellar.bank/stellarbank/Location/map/index.js", "../modules/stellar.bank/stellarbank/Location/status/index.js", "../modules/stellar.bank/stellarbank/speedbump/index.js", "../modules/stellar.bank/core/search/Google-CSE/index.js", "stellar.bank/index.js", "stellar.bank/filters.js", "stellar.bank/modals.js"], "sourcesContent": ["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SnapSlider\"] = factory();\n\telse\n\t\troot[\"SnapSlider\"] = factory();\n})(window, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var element_closest__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);\n/* harmony import */ var smoothscroll_polyfill__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);\n/* harmony import */ var smoothscroll_polyfill__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(smoothscroll_polyfill__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var tabbable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);\n/* harmony import */ var tabbable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tabbable__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(19);\n/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _helpers_getClosestAttribute__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(20);\n/* harmony import */ var _helpers_getElements__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(21);\n/* harmony import */ var _helpers_getStyle__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24);\n/* harmony import */ var _helpers_hasOwnProperty__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(25);\n/* harmony import */ var _helpers_isObject__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(26);\n/* harmony import */ var _helpers_minmax__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(27);\n/* harmony import */ var _helpers_on__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(28);\n/* harmony import */ var _helpers_onReady__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(29);\n/* harmony import */ var _helpers_passive__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(30);\n/* harmony import */ var _helpers_pick__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(31);\n/* harmony import */ var _helpers_qsa__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(22);\n/* harmony import */ var _helpers_toArray__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(23);\n/* harmony import */ var _helpers_values__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(32);\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// Dependencies\n\n\n // Helpers\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n // Modules\n\nvar logger = true ? __webpack_require__(33) : undefined; // Internal Variables\n\nvar counter = 1;\n/**\n * Snap Slider.\n * @class\n */\n\nvar SnapSlider = /*#__PURE__*/function () {\n /**\n * New Snap Slider.\n *\n * See `init()` for a full breakdown of `options`.\n *\n * @param {String|Element|Array|Object} containerOrOptions\n * @param {Object} options\n * @constructor\n */\n function SnapSlider(containerOrOptions) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, SnapSlider);\n\n // Setup internal variables.\n this.terms = {\n prev: /(prev|back|before|left|up)/,\n next: /(next|forward|after|right|down)/\n };\n /* eslint-disable quote-props */\n\n this.callbacks = {\n 'load': [],\n 'change': [],\n 'change.click': [],\n 'change.scroll': [],\n 'change.keydown': [],\n 'change.focusin': [],\n 'scroll': [],\n 'scroll.start': [],\n 'scroll.end': []\n };\n /* eslint-enable quote-props */\n\n this.init(containerOrOptions, options); // Don't construct sliders with empty containers.\n\n if (!this.container) {\n return;\n }\n\n this.watchForChanges(); // Keep track of the slider so we can reference & debug it later.\n\n this.container.SnapSlider = this;\n window._SnapSliders[this.id] = this;\n }\n /**\n * Initialize this slider.\n *\n * @param {String|Element|Array|Object} containerOrOptions\n * @param {Object} options\n * @param {String|Element|Array} options.container\n * @param {String} options.id\n * @param {String|Element|Array} options.slides\n * @param {String|Number} options.start\n * @param {String|Element|Array} options.nav\n * @param {String|Element|Array} options.buttons\n * @param {String|Element|Array} options.prev\n * @param {String|Element|Array} options.next\n * @return {void}\n */\n\n\n _createClass(SnapSlider, [{\n key: \"init\",\n value: function init(containerOrOptions) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n // Allow people to quickly spin up sliders by just passing a container\n // element, or by passing in a single options object.\n if (Object(_helpers_isObject__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(containerOrOptions)) {\n options = containerOrOptions;\n } // Fill default options.\n\n\n this.options = _objectSpread({\n container: containerOrOptions,\n id: '',\n slides: '',\n nav: '',\n buttons: '',\n prev: '',\n next: '',\n start: 0,\n loop: null,\n on: {}\n }, options); // Get single element from params.\n\n var container = Object(_helpers_getElements__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.options.container).shift(); // Don't construct sliders with empty containers.\n\n if (!container) {\n if (true) {\n console.log(\"\\n\\uD83D\\uDEAB Whoops! Snap Slider can't find a container element matching \\\"\".concat(this.options.container, \"\\\".\\n\\n\\uD83D\\uDD0D Please check your selectors for typos. Make sure the element actually exists\\n in the DOM when Snap Slider tries to initialize it.\\n\\n\\uD83D\\uDC47 Here's a copy of the options you tried to initialize with for debugging:\\n\\n\"), this.options, '\\n\\n');\n }\n\n return;\n } // Great! Now let's start initializing everything.\n\n\n this.container = container; // Get selectors from JavaScript or data attributes.\n\n this.options.buttons = options.buttons || this.container.getAttribute('data-snap-slider-buttons');\n this.options.prev = options.prev || this.container.getAttribute('data-snap-slider-prev');\n this.options.next = options.next || this.container.getAttribute('data-snap-slider-next'); // Get and set persistent options in data attributes.\n\n this.id = this.getMaybeSetID(container, this.options.id);\n this.slides = this.getMaybeSetSlides(container, this.options.slides);\n this.align = this.getMaybeSetAlign(container, this.options.align);\n this.current = this.getMaybeSetStart(container, this.options.start);\n this.loop = this.getMaybeSetLoop(container, this.options.loop); // Reset internal variables.\n\n this.transition = null;\n this.scrolling = false; // Add custom callbacks.\n // eslint-disable-next-line no-restricted-syntax\n\n for (var eventName in this.options.on) {\n if (Object(_helpers_hasOwnProperty__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(this.options.on, eventName)) {\n this.on(eventName, this.options.on[eventName]);\n }\n } // Setup navigation.\n // NOTE: If left blank, `addNav()` will handle the fallbacks for button selectors.\n\n\n var navOptions = Object(_helpers_pick__WEBPACK_IMPORTED_MODULE_14__[\"default\"])(this.options, ['buttons', 'prev', 'next']); // Init custom goto buttons in the container.\n // NOTE: \"Goto\" buttons are automatically handled by delegated click\n // events on the `body`. For more details, see `handleGotoClick()`.\n\n this.addGotoButtons(_objectSpread(_objectSpread({}, navOptions), {}, {\n container: container\n })); // Init standard navs with data attributes.\n\n this.addNav(\"[data-snap-slider-nav=\\\"\".concat(this.id, \"\\\"]\"), navOptions); // Then init custom navs too.\n\n if (this.options.nav) {\n this.addNav(this.options.nav, navOptions);\n } // Go to the slide we want to start on.\n\n\n this.update();\n }\n /**\n * Get and maybe set a slider's ID on the closest container element.\n *\n * If no ID was specified, generates a fallback ID.\n *\n * @param {Element} container\n * @param {String} id\n * @return {String}\n */\n\n }, {\n key: \"getMaybeSetID\",\n value: function getMaybeSetID(container, id) {\n // Either use the ID we were given or the ID already on the container.\n id = id || container.getAttribute('data-snap-slider') || container.id; // If we don't have an ID, make one up and increment our internal\n // counter for the next slider.\n\n if (!id) {\n id = \"slider-\".concat(counter);\n counter += 1;\n } // Store value in data attribute.\n\n\n container.setAttribute('data-snap-slider', id); // Return the final ID.\n\n return id;\n }\n /**\n * Get all slide elements for a given container.\n *\n * Defaults to container's children.\n *\n * @param {Element} container\n * @param {String} selector\n * @return {Array}\n */\n\n }, {\n key: \"getMaybeSetSlides\",\n value: function getMaybeSetSlides(container, selector) {\n // Get selector from JavaScript or data attribute.\n selector = selector && typeof selector === 'string' ? selector : container.getAttribute('data-snap-slider-slides'); // Store value in data attribute.\n\n container.setAttribute('data-snap-slider-slides', selector || ''); // If selector exists, use those elements. Otherwise,\n // assume the container's immediate children are slides.\n\n var slides = selector ? Object(_helpers_getElements__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(selector, container) : Object(_helpers_toArray__WEBPACK_IMPORTED_MODULE_16__[\"default\"])(container.children); // Ensure all slides are focusable but not tabbable.\n\n slides.forEach(function (slide) {\n return slide.setAttribute('tabindex', '-1');\n }); // Return array of slides.\n\n return slides;\n }\n /**\n * Get alignment fallback for a given container.\n *\n * @param {Element} container\n * @param {String} align\n * @return {String}\n */\n\n }, {\n key: \"getMaybeSetAlign\",\n value: function getMaybeSetAlign(container, align) {\n // Get align index from JavaScript, data attribute, or leave blank.\n align = align || container.getAttribute('data-snap-slider-align') || ''; // Store value in data attribute.\n\n container.setAttribute('data-snap-slider-align', align);\n return align;\n }\n /**\n * Get start index for a given container.\n *\n * Defaults to 1.\n *\n * @param {Element} container\n * @param {String} start\n * @return {String|Number}\n */\n\n }, {\n key: \"getMaybeSetStart\",\n value: function getMaybeSetStart(container, start) {\n // Get start index from JavaScript, data attribute, or default to 1.\n if (!SnapSlider.isValidIndex(start)) {\n start = container.getAttribute('data-snap-slider-start') || 1;\n } // Store value in data attribute.\n\n\n container.setAttribute('data-snap-slider-start', start);\n return start;\n }\n /**\n * Get and maybe set a slider's `loop` option on the closest container element.\n *\n * @param {Element} container\n * @param {Boolean} loop\n * @return {String}\n */\n\n }, {\n key: \"getMaybeSetLoop\",\n value: function getMaybeSetLoop(container, loop) {\n // If we were given a Boolean value to set, use that.\n // Else check for an existing data attribute.\n // Defaults to `false`.\n loop = typeof loop === 'boolean' ? loop : container.getAttribute('data-snap-slider-loop') === 'true'; // Store value in data attribute.\n\n container.setAttribute('data-snap-slider-loop', loop); // Return the final loop value.\n\n return loop;\n }\n /**\n * Get the `scroll-snap-align` for a snap slider element.\n *\n * Falls back to `data-snap-slider-align` when no CSS\n * is detected, otherwise defaults to `start`.\n *\n * @param {Element} el\n * @return {String}\n */\n\n }, {\n key: \"getSnapAlign\",\n value: function getSnapAlign(el) {\n // Get element's CSS align value.\n var style = Object(_helpers_getStyle__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(el, 'scrollSnapAlign'); // If browser supports Scroll Snap and slide\n // has a non-empty value, return it.\n\n if (style && style.indexOf('none') < 0) {\n return style;\n } // Otherwise, fallback to the slider's align attribute.\n // Else assume \"start\" for everything.\n\n\n return Object(_helpers_getClosestAttribute__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(el, 'data-snap-slider-align') || 'start';\n }\n /**\n * Get a specific slide element. Accepts any valid goto alias.\n *\n * @param {Number} index Starts at 1.\n * @return {Element}\n */\n\n }, {\n key: \"getSlide\",\n value: function getSlide(index) {\n // Convert index aliases to numbers.\n index = this.getIndexNumber(index); // Return the slide for that numeric index.\n // NOTE: Subtract 1 because the array is 0-index, but our API is 1-index.\n\n return this.slides[index - 1];\n }\n /**\n * Get the current slide element.\n *\n * @return {Element}\n */\n\n }, {\n key: \"getCurrentSlide\",\n value: function getCurrentSlide() {\n // NOTE: Subtract 1 because the array is 0-index, but our API is 1-index.\n return this.slides[this.current - 1];\n }\n /**\n * Is this a valid index?\n *\n * - first\n * - middle\n * - last\n * - prev\n * - next\n *\n * @param {String|Number} index\n * @return {Number}\n */\n\n }, {\n key: \"getIndexNumber\",\n\n /**\n * Get the slide number for any index.\n *\n * Returns -1 if index is invalid.\n *\n * @param {String|Number} index\n * @return {Number}\n */\n value: function getIndexNumber(index) {\n var num;\n\n if (index === 'first') {\n // Get the first slide.\n num = 1;\n } else if (index === 'middle') {\n // Get the middle slide.\n num = Math.ceil(this.slides.length / 2);\n } else if (index === 'last') {\n // Get the last slide.\n num = this.slides.length;\n } else if (index === 'prev') {\n // Get the previous slide.\n num = this.current - 1;\n } else if (index === 'next') {\n // Get the next slide.\n num = this.current + 1;\n } else {\n // Try to get a number.\n num = parseInt(index, 10) || -1;\n }\n\n if (this.loop) {\n // If we're looping, send out-of-bounds requests\n // to the other end of the slider.\n if (num < 1) {\n num = this.slides.length;\n }\n\n if (num > this.slides.length) {\n num = 1;\n }\n } else if (num < 1 || num > this.slides.length) {\n // Otherwise, ignore out-of-range indexes.\n num = -1;\n } // Return numeric index. Or, if something goes wrong,\n // fallback to the first slide.\n\n\n return num || 1;\n }\n /**\n * Get the offset we should scroll to for a specific slide.\n *\n * @param {Element} slide\n * @return {Object} { top, left }\n */\n\n }, {\n key: \"getScrollOffset\",\n value: function getScrollOffset(slide) {\n var container = this.container;\n var align = this.getSnapAlign(slide); // Calculate the 'start' position by default.\n // NOTE: This forces slides with align `none` to still snap into place.\n\n var top = slide.offsetTop;\n var left = slide.offsetLeft; // NOTE: Because Safari uses the 2-value syntax, we simply check for matching\n // keywords. If this causes incorrect behavior, use the `data-snap-slider-align`\n // attribute to override our automatic CSS detection.\n\n if (align.indexOf('center') >= 0) {\n // To center a slide, start with its beginning offset (the 'start' position).\n // Then add half the slide's size minus half the container size.\n top = slide.offsetTop + slide.offsetHeight / 2 - container.offsetHeight / 2;\n left = slide.offsetLeft + slide.offsetWidth / 2 - container.offsetWidth / 2;\n } else if (align.indexOf('end') >= 0) {\n // To align the end of a slide, start with its beginning offset (the 'start' position).\n // Then subtract the size of the container, but add back the size of the slide.\n top = slide.offsetTop - container.offsetHeight + slide.offsetHeight;\n left = slide.offsetLeft - container.offsetWidth + slide.offsetWidth;\n } // Keep offsets within the scrollable area.\n\n\n top = Object(_helpers_minmax__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(top, 0, container.scrollHeight);\n left = Object(_helpers_minmax__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(left, 0, container.scrollWidth);\n return {\n top: top,\n left: left\n };\n }\n /**\n * Go to a slide.\n *\n * @param {String|Number} index Starts at 1.\n * @param {Object} options\n * @param {Boolean} options.focus\n * @param {Boolean} options.force\n * @param {Boolean} options.ignoreCallbacks\n * @param {Boolean} options.immediate\n * @param {Event} event\n * @return {Boolean}\n */\n\n }, {\n key: \"goto\",\n value: function goto(index) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var event = arguments.length > 2 ? arguments[2] : undefined;\n // Fill default options.\n options = _objectSpread({\n // By default, focus the slide we're going to.\n focus: true,\n // Force-update the scroll position, even if we're already on the current slide.\n force: false,\n // Ignore custom callbacks for events.\n ignoreCallbacks: false,\n // Immediately update position without smooth scrolling.\n immediate: false\n }, options); // Get the next slide we should go to.\n\n var next = this.getIndexNumber(index); // If nothing changed, don't do anything (as long as\n // we're not trying to force it).\n\n if (!options.force && next === this.current) {\n return false;\n } // Get the next slide.\n\n\n var slide = this.getSlide(next);\n\n if (!slide) {\n return false;\n } // Scroll to it!\n\n\n var _this$getScrollOffset = this.getScrollOffset(slide),\n top = _this$getScrollOffset.top,\n left = _this$getScrollOffset.left;\n\n if (options.immediate) {\n // Scroll immediately.\n this.container.scroll({\n top: top,\n left: left\n });\n } else {\n // Let the event handlers know we're coming, then smooth scroll.\n this.startTransition(next);\n this.container.scroll({\n top: top,\n left: left,\n behavior: 'smooth'\n });\n } // Update state.\n\n\n this.current = next; // We changed slides!\n\n this.fireEvent('change', event, options);\n return true;\n }\n /**\n * Build the `goto` attribute for a nav button.\n *\n * @param {Element|Boolean} nav\n * @param {String|Number} index\n * @return {String}\n */\n\n }, {\n key: \"buildGoto\",\n value: function buildGoto(nav) {\n var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n // Start with an empty string.\n var _goto = ''; // If this button isn't part of a nav, include the slider ID.\n\n if (!nav) {\n _goto += \"\".concat(this.id, \":\");\n } // Add the index and return.\n\n\n return _goto + index;\n }\n /**\n * Set the `goto` attribute for nav buttons.\n *\n * @param {String|Element|Array} buttons\n * @param {String} index\n * @return {void}\n */\n\n }, {\n key: \"setGoto\",\n value: function setGoto(buttons, index) {\n var _this = this;\n\n buttons = Object(_helpers_getElements__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(buttons); // If we found custom prev/next buttons, set their `goto` attributes\n // before we loop through the rest of the buttons.\n\n buttons.forEach(function (button) {\n button.setAttribute('data-snap-slider-goto', _this.buildGoto( // Don't assume this button is grouped with the others. It may\n // be somewhere else on the page, so double check for a parent\n // slider or nav container.\n button.closest('[data-snap-slider], [data-snap-slider-nav]'), index));\n });\n }\n /**\n * Get the slider ID and slide index a goto button is targeting.\n *\n * NOTE: This method is static so we can call it in the delegated body\n * click events. For more details, see `handleGotoClick()`.\n *\n * @param {String|Element|Array} button\n * @return {Object} { sliderID, index }\n */\n\n }, {\n key: \"startTransition\",\n\n /**\n * Start transitioning to another slide.\n *\n * This way when you click a nav button, the current slide updates\n * immediately but the scroll listener doesn't override it, or fire\n * extra change events.\n *\n * @param {Number} next\n * @return {void}\n */\n value: function startTransition(next) {\n var _this2 = this;\n\n // Tell the scroll listener which slide we're transitioning to.\n this.transition = {\n from: this.current,\n to: next,\n diff: Math.abs(next - this.current)\n }; // In case someone's fast enough to start scrolling again before our\n // scroll listener resolves the `transition` flag, or if the slide's\n // already visible and nothing actually has to scroll,\n // set a timeout to resolve the transition.\n\n var stuck = this.transition.to; // If there's already a check waiting, clear it to avoid accidentally\n // reverting to the wrong slide.\n\n if (this.checkTransition) {\n clearTimeout(this.checkTransition);\n } // Now make sure we don't get stuck!\n\n\n this.checkTransition = setTimeout(function () {\n if (_this2.transition.to === stuck) {\n _this2.stopTransition();\n }\n }, 1000);\n }\n /**\n * Stop the transitions! Set things back to normal.\n *\n * @return {void}\n */\n\n }, {\n key: \"stopTransition\",\n value: function stopTransition() {\n // Clear transition checks.\n this.transition = null;\n clearTimeout(this.checkTransition);\n }\n /**\n * Is this a \"previous\" button?\n *\n * @param {String|Element|Array} button\n * @return {Boolean}\n */\n\n }, {\n key: \"isPrevButton\",\n value: function isPrevButton(button) {\n button = Object(_helpers_getElements__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(button).shift(); // Ignore missing elements.\n\n if (!button) {\n return false;\n } // Check whether the `goto` attribute is \"prev\".\n // If not, check the text & class for common \"prev\" terms.\n\n\n return (button.getAttribute('data-snap-slider-goto') || '').match(/\\bprev$/) || button.textContent.toLowerCase().match(this.terms.prev) || button.className.toLowerCase().match(this.terms.prev);\n }\n /**\n * Is this a \"next\" button?\n *\n * @param {String|Element|Array} button\n * @return {Boolean}\n */\n\n }, {\n key: \"isNextButton\",\n value: function isNextButton(button) {\n button = Object(_helpers_getElements__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(button).shift(); // Ignore missing elements.\n\n if (!button) {\n return false;\n } // Check whether the `goto` attribute is \"next\".\n // If not, check the text & class for common \"next\" terms.\n\n\n return (button.getAttribute('data-snap-slider-goto') || '').match(/\\bnext$/) || button.textContent.toLowerCase().match(this.terms.next) || button.className.toLowerCase().match(this.terms.next);\n }\n /**\n * Is this index a relative term? I.e., is it `prev` or `next`?\n *\n * @param {String|Number} index\n * @return {Boolean}\n */\n\n }, {\n key: \"isCurrent\",\n\n /**\n * Does an index match the current slide?\n *\n * @param {String|Number} index\n * @return {Boolean}\n */\n value: function isCurrent(index) {\n // Ignore relative indexes (i.e., `prev` and `next`) since they\n // always refer to one more or less than the current index.\n if (SnapSlider.isRelative(index)) {\n return false;\n } // Does this numeric index match the current slide?\n\n\n return this.getIndexNumber(index) === this.current;\n }\n /**\n * Add goto buttons for the current slider.\n *\n * @param {String|Element|Array|Object} buttonsOrOptions\n * @param {Object} options\n * @param {String|Element|Array} options.container\n * @param {String|Element|Array} options.buttons\n * @param {String|Element|Array} options.prev\n * @param {String|Element|Array} options.next\n * @return {Boolean}\n */\n\n }, {\n key: \"addGotoButtons\",\n value: function addGotoButtons(buttonsOrOptions) {\n var _this3 = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n // Allow people to quickly add nav buttons by just passing the\n // selector, or by passing in a single options object.\n if (Object(_helpers_isObject__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(buttonsOrOptions)) {\n options = buttonsOrOptions;\n } // Fill default options.\n\n\n options = _objectSpread({\n container: '',\n buttons: buttonsOrOptions,\n prev: '',\n next: ''\n }, options); // Get button elements.\n // NOTE: If someone passes an overly-generic selector (e.g., `button`)\n // this will query the entire document. In general, you should either\n // specify a container element, use specific selectors, or pass\n // the elements directly.\n\n var buttons = Object(_helpers_getElements__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(options.buttons, options.container);\n var prev = Object(_helpers_getElements__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(options.prev, options.container);\n var next = Object(_helpers_getElements__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(options.next, options.container); // If we found custom prev/next buttons, set their `goto` attributes\n // before we loop through the rest of the buttons.\n\n prev.forEach(function (b) {\n return b.hasAttribute('data-snap-slider-goto') || _this3.setGoto(prev, 'prev');\n });\n next.forEach(function (b) {\n return b.hasAttribute('data-snap-slider-goto') || _this3.setGoto(next, 'next');\n }); // Keep track of the index outside of the loop so we can\n // skip prev/next buttons but still go in order.\n\n var nextIndex = 1; // Loop through the buttons and set each one's `goto` attribute.\n\n buttons.forEach(function (button) {\n // Ignore buttons that already have a `goto` attribute.\n if (button.hasAttribute('data-snap-slider-goto')) {\n return null;\n } // Previous\n\n\n if (_this3.isPrevButton(button)) {\n return _this3.setGoto(button, 'prev');\n } // Next\n\n\n if (_this3.isNextButton(button)) {\n return _this3.setGoto(button, 'next');\n } // Numeric: Check the text for a number, else fallback to the next index.\n\n\n var index = parseInt(button.textContent.replace(/.*\\b(\\d+)\\b.*/, '$1'), 10) || nextIndex; // Increment the next index.\n\n nextIndex = index + 1;\n return _this3.setGoto(button, index);\n });\n this.updateButtons();\n return true;\n }\n /**\n * Get navs for the current slider.\n *\n * @return {Array}\n */\n\n }, {\n key: \"getNavs\",\n value: function getNavs() {\n var _this4 = this;\n\n // eslint-disable-next-line arrow-body-style\n return Object(_helpers_qsa__WEBPACK_IMPORTED_MODULE_15__[\"default\"])('[data-snap-slider-nav]').filter(function (nav) {\n // Only return navs targeting the current slider.\n return nav.getAttribute('data-snap-slider-nav') === _this4.id;\n });\n }\n /**\n * Get nav buttons for the current slider.\n *\n * @return {Array}\n */\n\n }, {\n key: \"getButtons\",\n value: function getButtons() {\n var _this5 = this;\n\n return Object(_helpers_qsa__WEBPACK_IMPORTED_MODULE_15__[\"default\"])('[data-snap-slider-goto]').filter(function (button) {\n var _SnapSlider$getButton = SnapSlider.getButtonTarget(button),\n sliderID = _SnapSlider$getButton.sliderID; // Only return buttons targeting the current slider.\n\n\n return sliderID === _this5.id;\n });\n }\n /**\n * Update nav buttons for the current slider.\n *\n * @return {void}\n */\n\n }, {\n key: \"updateButtons\",\n value: function updateButtons() {\n var _this6 = this;\n\n // Wait until the slider has initialized.\n if (!this.current) {\n return;\n } // Loop through all the nav buttons.\n\n\n this.getButtons().forEach(function (button) {\n // Figure out which slide it's for...\n var _SnapSlider$getButton2 = SnapSlider.getButtonTarget(button),\n index = _SnapSlider$getButton2.index; // And update its class.\n\n\n if (_this6.isCurrent(index)) {\n button.classList.add('is-current');\n } else {\n button.classList.remove('is-current');\n } // Also, enable/disable relative buttons unless `loop` is on.\n\n\n if (!_this6.loop && SnapSlider.isRelative(index)) {\n // Disable prev button on first slide.\n // Disable next button on last slide.\n var disabled = index === 'prev' && _this6.current === 1 || index === 'next' && _this6.current === _this6.slides.length;\n\n if (disabled) {\n // button.setAttribute('disabled', '');\n button.classList.add('is-disabled');\n } else {\n // button.removeAttribute('disabled', '');\n button.classList.remove('is-disabled');\n }\n }\n });\n }\n /**\n * Update slide active states when the slider changes.\n *\n * @return {void}\n */\n\n }, {\n key: \"updateSlides\",\n value: function updateSlides() {\n var _this7 = this;\n\n this.slides.forEach(function (slide, index) {\n // NOTE: Subtract 1 because the array is 0-index, but our API is 1-index.\n if (index === _this7.current - 1) {\n slide.classList.add('is-current');\n slide.removeAttribute('aria-hidden'); // Enable tabbing for current slide\n\n Object(_helpers_qsa__WEBPACK_IMPORTED_MODULE_15__[\"default\"])('[data-snap-slider-tabindex]', slide).forEach(function (tab) {\n tab.removeAttribute('tabindex');\n });\n } else {\n slide.classList.remove('is-current');\n slide.setAttribute('aria-hidden', 'true'); // Disable tabbing for non-current slides\n\n tabbable__WEBPACK_IMPORTED_MODULE_2___default()(slide).forEach(function (tab) {\n tab.setAttribute('tabindex', '-1');\n tab.setAttribute('data-snap-slider-tabindex', '');\n });\n }\n });\n }\n /**\n * Add a nav element for the current slider. Automatically hooks up any nav\n * buttons inside the nav.\n *\n * @param {String|Element|Array|Object} containerOrOptions\n * @param {Object} options\n * @param {String|Element|Array} options.container\n * @param {String|Element|Array} options.buttons\n * @param {String|Element|Array} options.prev\n * @param {String|Element|Array} options.next\n * @return {Boolean}\n */\n\n }, {\n key: \"addNav\",\n value: function addNav(containerOrOptions) {\n var _this8 = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n // Allow people to quickly add a nav by just passing a container\n // element, or by passing in a single options object.\n if (Object(_helpers_isObject__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(containerOrOptions)) {\n options = containerOrOptions;\n } // Fill default options.\n\n\n options = _objectSpread({\n container: containerOrOptions,\n buttons: '',\n prev: '',\n next: ''\n }, options); // Get matching nav containers.\n\n var navContainers = Object(_helpers_getElements__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(options.container); // Don't add navs without container elements.\n\n if (!navContainers.length) {\n return false;\n }\n\n navContainers.forEach(function (navContainer) {\n // Set a data attribute assigning the nav to this slider.\n navContainer.setAttribute('data-snap-slider-nav', _this8.id); // Get button selectors from JavaScript, data attribute, or default to 'button'.\n // NOTE: In this case, allow the nav's data attribute to override the parent\n // container's options.\n\n var buttons = navContainer.getAttribute('data-snap-slider-buttons') || options.buttons || 'button';\n var prev = options.prev || navContainer.getAttribute('data-snap-slider-prev');\n var next = options.next || navContainer.getAttribute('data-snap-slider-next'); // And add them.\n\n _this8.addGotoButtons({\n container: navContainer,\n buttons: buttons,\n prev: prev,\n next: next\n });\n });\n return true;\n }\n /**\n * Which slide is closest to its active offset position?\n *\n * Returns an object include the slide's index, element,\n * and the diff between its active offset and our\n * current scroll position.\n *\n * @return {Object} { index, slide, diff }\n */\n\n }, {\n key: \"getClosest\",\n value: function getClosest() {\n var _this9 = this;\n\n return this.slides.reduce(function (prev, slide, index) {\n // 1-index to stay consistent with our API.\n index += 1; // How far away are we from the next slide's active offset position?\n\n var offset = _this9.getScrollOffset(slide);\n\n var diff = {\n top: Math.abs(_this9.container.scrollTop - offset.top),\n left: Math.abs(_this9.container.scrollLeft - offset.left)\n }; // Save the next slide's info to compare with other slides.\n\n var next = {\n index: index,\n slide: slide,\n diff: diff\n }; // If this is the first slide, return it and compare the next one.\n\n if (!prev) {\n return next;\n } // Compare each slide to see which one is the closest to its active offset position.\n // As soon as the next slide is at least as close as the previous one, return it.\n\n\n if (next.diff.left <= prev.diff.left && next.diff.top <= prev.diff.top) {\n return next;\n } // Otherwise, keep the last closest slide.\n\n\n return prev; // Init with `false` so the first slide gets processed just like the rest of them.\n }, false);\n }\n /**\n * Watch the container scroll for when the current slide changes.\n *\n * @return {void}\n */\n\n }, {\n key: \"watchForChanges\",\n value: function watchForChanges() {\n var _this10 = this;\n\n // Scroll listener. Save so we can remove it during `destroy()`.\n this.scrollListener = lodash_throttle__WEBPACK_IMPORTED_MODULE_4___default()(function (event) {\n // Which slide is closest to their active offset position?\n var closest = _this10.getClosest(); // If someone's passively scrolling (i.e., not in a transition),\n // then as soon as we've scrolled to another slide, mark that\n // slide as the new current one and fire a change event.\n\n\n if (!_this10.transition && closest.index !== _this10.current) {\n _this10.current = closest.index;\n\n _this10.fireEvent('change', event);\n } // If we just started scrolling, update state and\n // fire a `scroll.start` event.\n\n\n if (!_this10.scrolling) {\n _this10.scrolling = true;\n\n _this10.fireEvent('scroll.start', event);\n } // Fire a generic `scroll` event.\n\n\n _this10.fireEvent('scroll', event);\n }, 250); // Scroll end listener. Save so we can remove it during `destroy()`.\n\n this.scrollEndListener = lodash_debounce__WEBPACK_IMPORTED_MODULE_3___default()(function (event) {\n // We're done scrolling!\n _this10.scrolling = false;\n\n _this10.fireEvent('scroll.end', event); // Clear any previous transition checks.\n // NOTE: This has to happen *after* we fire the `scroll.end` event,\n // otherwise `handleFocus` won't be able to access `this.transition`.\n\n\n _this10.stopTransition();\n }, 250); // Arrow key listener. Save so we can remove it during `destroy()`.\n\n this.arrowKeyListener = lodash_throttle__WEBPACK_IMPORTED_MODULE_4___default()(function (event) {\n // Ignore events that have already been prevented.\n if (event.defaultPrevented) {\n return;\n } // Listen for arrow keys.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n\n\n var isPrev = ['Up', 'ArrowUp', 'Left', 'ArrowLeft'].indexOf(event.key) >= 0;\n var isNext = ['Down', 'ArrowDown', 'Right', 'ArrowRight'].indexOf(event.key) >= 0; // Ignore non-arrow keys.\n\n if (!isPrev && !isNext) {\n return;\n } // Go to the next or previous slide.\n\n\n _this10[\"goto\"](isNext ? 'next' : 'prev', null, event); // Prevent default browser scroll.\n\n\n event.preventDefault();\n }, 250); // Focus listener. Save so we can remove it during `destroy()`.\n\n this.focusListener = function (event) {\n // Only trigger `goto` on focus when we're not passively scrolling.\n // However, if someone manually triggered a transition then\n // allow them to click or tab away to a different slide.\n if (_this10.scrolling && !_this10.transition) {\n return;\n } // Get slide + index.\n\n\n var slide;\n var index;\n\n _this10.slides.forEach(function (s, i) {\n if (s.contains(event.target)) {\n slide = s;\n index = i + 1;\n }\n }, null); // If there's a matching slide, go to it.\n\n\n if (slide) {\n _this10[\"goto\"](index, null, event);\n }\n }; // Resize Observer. Save so we can disconnect it during `destroy()`.\n // Only init if browser supports it, else fallback to noop.\n\n\n this.resizeObserver = {\n observe: function observe() {},\n disconnect: function disconnect() {}\n };\n\n if ('ResizeObserver' in window) {\n this.resizeObserver = new ResizeObserver(this.resizeCallback.bind(this));\n } // Add all our listeners.\n // Set timeout to avoid initial `goto` event triggering a scroll listener.\n\n\n setTimeout(function () {\n _this10.container.addEventListener('scroll', _this10.scrollListener, _helpers_passive__WEBPACK_IMPORTED_MODULE_13__[\"default\"]);\n\n _this10.container.addEventListener('scroll', _this10.scrollEndListener, _helpers_passive__WEBPACK_IMPORTED_MODULE_13__[\"default\"]);\n\n _this10.container.addEventListener('keydown', _this10.arrowKeyListener);\n\n _this10.container.addEventListener('focusin', _this10.focusListener);\n\n _this10.resizeObserver.observe(_this10.container); // Done loading!\n\n\n _this10.fireEvent('load');\n }, 100);\n }\n /**\n * Update the slider on load.\n *\n * @return {void}\n */\n\n }, {\n key: \"hasLoaded\",\n value: function hasLoaded() {\n this.container.classList.add('has-loaded');\n }\n /**\n * Update this slider (e.g., on resize). Basically just repositions the\n * current slide.\n *\n * @return {void}\n */\n\n }, {\n key: \"update\",\n value: function update() {\n // Make sure we're still on the current slide.\n this[\"goto\"](this.current, {\n focus: false,\n force: true,\n ignoreCallbacks: true,\n immediate: true\n });\n }\n /**\n * Destroy this slider. Stop any active transitions, remove its event\n * listeners, and delete it from our internal array of slider instances.\n *\n * @return {void}\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n // Stop running transitions, event listeners, etc.\n this.stopTransition();\n this.container.removeEventListener('scroll', this.scrollListener);\n this.container.removeEventListener('scroll', this.scrollEndListener);\n this.container.removeEventListener('keydown', this.arrowKeyListener);\n this.resizeObserver.disconnect(); // Reset callbacks.\n // eslint-disable-next-line no-restricted-syntax\n\n for (var eventName in this.callbacks) {\n if (Object(_helpers_hasOwnProperty__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(this.callbacks, eventName)) {\n this.callbacks[eventName] = [];\n }\n } // Remove references to this slider.\n\n\n delete this.container.SnapSlider;\n delete window._SnapSliders[this.id];\n }\n /**\n * Reset this slider (e.g., after adding or removing a slide).\n *\n * See `init()` for a full breakdown of `options`.\n *\n * @param {Object} options\n * @return {void}\n */\n\n }, {\n key: \"reset\",\n value: function reset() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Copy initial options.\n var initialOptions = this.options; // Remove initial callbacks to avoid duplicating them.\n\n delete initialOptions.on; // Don't let people reset critical options during reset (e.g., slider ID).\n\n delete options.container;\n delete options.id; // Re-initialize this slider with initial options + overrides.\n\n this.init(this.container, _objectSpread(_objectSpread({}, initialOptions), options));\n }\n /**\n * Handle resize observer events.\n *\n * @return {void}\n */\n\n }, {\n key: \"resizeCallback\",\n value: function resizeCallback() {\n this.update();\n }\n /**\n * When an event happens, fire all the callback functions for that event.\n *\n * @param {String} eventName\n * @param {Event} event\n * @param {Object} options\n * @param {Boolean} options.focus\n * @param {Boolean} options.ignoreCallbacks\n * @return {void}\n */\n\n }, {\n key: \"fireEvent\",\n value: function fireEvent(eventName, event) {\n var _this11 = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n // Ignore invalid events.\n if (!Object(_helpers_hasOwnProperty__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(this.callbacks, eventName)) {\n return;\n } // Fill default options.\n\n\n options = _objectSpread({\n // By default, focus the slide we're going to.\n focus: true,\n // Ignore custom callbacks for events.\n ignoreCallbacks: false\n }, options); // Required: Update slider attributes on load.\n\n if (eventName === 'load') {\n this.hasLoaded();\n } // Required: Update buttons and slides on every change.\n\n\n if (eventName === 'change') {\n this.updateButtons();\n this.updateSlides();\n } // Allow focus events to be ignored.\n\n\n if (options.focus) {\n this.handleFocus(eventName, event);\n } // Allow callbacks to be ignored.\n\n\n if (options.ignoreCallbacks) {\n return;\n } // Fallback object for `null` events.\n\n\n event = event || {}; // Include more granular event types for easier callbacks.\n\n var events = [eventName];\n\n if (Object(_helpers_hasOwnProperty__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(this.callbacks, \"\".concat(eventName, \".\").concat(event.type))) {\n events.push(\"\".concat(eventName, \".\").concat(event.type));\n } // Fire all the callbacks for each event.\n\n\n events.forEach(function (name) {\n _this11.callbacks[name].forEach(function (callback) {\n if (typeof callback === 'function') {\n callback(_this11, event);\n }\n });\n });\n }\n /**\n * Handle focus events differently depending on whether we're manually\n * triggering changes or passively scrolling.\n *\n * @param {String} eventName\n * @param {Event} event\n * @return {void}\n */\n\n }, {\n key: \"handleFocus\",\n value: function handleFocus(eventName, event) {\n // Only handle focus for manually triggered changes (e.g., clicks and key presses).\n // Ignore passive scrolling to avoid mistakenly hijacking someone's focus.\n if (!this.transition) {\n return;\n } // Only focus the slide if we're NOT clicking a prev/next button.\n\n\n if (event && eventName === 'change') {\n // Did we click a button?\n var button = event.target.closest('[data-snap-slider-goto]');\n\n var _SnapSlider$getButton3 = SnapSlider.getButtonTarget(button),\n index = _SnapSlider$getButton3.index; // If we clicked a relative button, get out.\n\n\n if (SnapSlider.isRelative(index)) {\n return;\n }\n } // If we're only transitioning one slide over, focus immediately on change.\n\n\n if (this.transition.diff <= 1 && eventName === 'change') {\n this.getCurrentSlide().focus({\n preventScroll: true\n });\n } // If we're transitioning across multiple slides, wait until the scroll ends to focus.\n // Otherwise, we'll cause the scroll to flicker.\n\n\n if (this.transition.diff > 1 && eventName === 'scroll.end') {\n // Only focus the slide if we haven't already focused on another\n // element during the transition.\n if (!document.activeElement || document.activeElement === document.body || document.activeElement.closest('[data-snap-slider-goto]')) {\n this.getCurrentSlide().focus({\n preventScroll: true\n });\n }\n }\n }\n /**\n * Add callbacks to fire on specific events.\n *\n * @param {String} event Event name.\n * @param {Function} callback Function w/ slider and event params (e.g., `fn(slider, event)`).\n * @return {void}\n */\n\n }, {\n key: \"on\",\n value: function on(event, callback) {\n // Ignore invalid events.\n if (!Object(_helpers_hasOwnProperty__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(this.callbacks, event)) {\n if (true) {\n console.log(\"\\n\\uD83D\\uDEAB Whoops! Snap Slider can't add events for \\\"\".concat(event, \"\\\".\\n\\n\\uD83D\\uDCDD Please make sure your event matches one of the ones in this list:\\n\\n\"), Object.keys(this.callbacks), '\\n\\n');\n }\n\n return;\n } // Ignore invalid callbacks.\n\n\n if (typeof callback !== 'function') {\n if (true) {\n console.log(\"\\n \\uD83D\\uDEAB Whoops! Snap Slider can only add functions as callbacks.\\n\\n \\uD83D\\uDC40 It looks like you passed a \\\"\".concat(_typeof(callback), \"\\\" instead.\\n\\n\"), callback, '\\n\\n');\n }\n\n return;\n } // Add the callback for our event.\n\n\n this.callbacks[event].push(callback);\n }\n /**\n * Log that we couldn't find the element you're looking for.\n *\n * @param {mixed} element\n * @return {void}\n */\n\n }], [{\n key: \"isValidIndex\",\n value: function isValidIndex(index) {\n var aliases = ['first', 'middle', 'last', 'prev', 'next']; // Valid indexes are either a known alias,\n // or a positive integer.\n\n return aliases.indexOf(index) >= 0 || parseInt(index, 10) >= 1;\n }\n }, {\n key: \"getButtonTarget\",\n value: function getButtonTarget(button) {\n // Where are we going?\n var _goto2 = button ? button.getAttribute('data-snap-slider-goto') : ''; // Ignore missing buttons and attributes.\n\n\n if (!_goto2) {\n return {};\n } // Parse slide index and slider ID from `goto` attribute.\n\n\n var args = _goto2.split(':').map(function (str) {\n return str.trim();\n });\n\n var index = args.pop();\n var sliderID = args.pop(); // If the slider ID wasn't included, check for a parent nav or container element.\n\n if (!sliderID) {\n var nav = button.closest('[data-snap-slider-nav]');\n var container = button.closest('[data-snap-slider]'); // If it is in a nav or container, get the slider ID from there.\n\n if (nav) {\n sliderID = nav.getAttribute('data-snap-slider-nav');\n }\n\n if (container) {\n sliderID = container.getAttribute('data-snap-slider');\n }\n } // If there's still no slider ID, is this button already in a slider?\n\n\n if (!sliderID) {\n var slider = button.closest('data-snap-slider'); // If it is in a slider, get the slider ID from there.\n\n if (slider) {\n sliderID = slider.getAttribute('data-snap-slider');\n }\n }\n\n return {\n sliderID: sliderID,\n index: index\n };\n }\n /**\n * Handle click events for nav (aka \"goto\") buttons.\n *\n * By delegating events to the body, we can automatically\n * handle dynamic goto buttons (i.e., without having to\n * reinitialize slider events).\n *\n * @param {Event} event\n * @return {void}\n */\n\n }, {\n key: \"handleGoto\",\n value: function handleGoto(event) {\n // Get the button we clicked.\n var button = event.target.closest('[data-snap-slider-goto]'); // Get the slider we're trying to update.\n\n var _SnapSlider$getButton4 = SnapSlider.getButtonTarget(button),\n sliderID = _SnapSlider$getButton4.sliderID,\n index = _SnapSlider$getButton4.index;\n\n var slider = window._SnapSliders[sliderID]; // Make sure it actually exists.\n\n if (!slider) {\n return;\n } // Go! But only focus the slide if we're NOT clicking a prev/next button.\n\n\n slider[\"goto\"](index, null, event);\n }\n }, {\n key: \"isRelative\",\n value: function isRelative(index) {\n return index === 'prev' || index === 'next';\n }\n }, {\n key: \"notFound\",\n value: function notFound(element) {\n if (true) {\n console.log(\"\\n\\uD83D\\uDE22 Oh no! Snap Slider couldn't find a slider for \\\"\".concat(element, \"\\\".\\n\\n-------------------------------------------------------------------------------------------\\n\\u2139\\uFE0F NOTE: Make sure the elements you're trying to debug have a `data-snap-slider` attribute.\\n-------------------------------------------------------------------------------------------\\n\\n\"));\n }\n }\n /**\n * Get the `SnapSlider` object for a slider based on its ID.\n *\n * @param {String} id\n * @return {SnapSlider}\n */\n\n }, {\n key: \"get\",\n value: function get(id) {\n return window._SnapSliders[id];\n }\n /**\n * `console.log` info about a slider, its nav, or goto buttons.\n *\n * @param {String|Element|Array} idOrElements\n * @return {void}\n */\n\n }, {\n key: \"debug\",\n value: function debug(idOrElements) {\n if (true) {\n /* eslint-disable no-irregular-whitespace */\n var elements = []; // 1. Debug all sliders by default.\n\n if (arguments.length === 0) {\n idOrElements = '[data-snap-slider]';\n } // 2. Debug a slider by its ID.\n\n\n if (typeof idOrElements === 'string' && Object(_helpers_hasOwnProperty__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(window._SnapSliders, idOrElements)) {\n idOrElements = \"[data-snap-slider=\\\"\".concat(idOrElements, \"\\\"]\");\n } // 3. Debug slider elements.\n\n\n elements = Object(_helpers_getElements__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(idOrElements);\n\n if (!elements.length) {\n SnapSlider.notFound(idOrElements);\n return;\n } // Debug all the things!\n\n\n elements.forEach(function (el, i) {\n // What are we debugging? Is this a button, nav, or container?\n var button = el.closest('[data-snap-slider-goto]');\n var nav = el.closest('[data-snap-slider-nav]');\n var container = el.closest('[data-snap-slider]'); // If we're debugging more than one element at a time,\n // add the index # to each section heading.\n\n var num = elements.length > 1 ? \"#\".concat(i + 1, \" \") : ''; // 2a. Buttons\n\n if (button) {\n // Get details for the target slider & slide.\n var target = SnapSlider.getButtonTarget(button);\n var slider = window._SnapSliders[target.sliderID]; // Make sure slide index is valid.\n\n var index = target.index;\n var slideIndex = SnapSlider.isValidIndex(index) ? \"\\\"\".concat(index, \"\\\"\") : \"\\uD83D\\uDEAB \\\"\".concat(index, \"\\\" - Yikes! This index is invalid.\\n\\nUse a positive number instead, or one of the following aliases:\\n\\n \").concat(['first', 'middle', 'last', 'prev', 'next'].map(function (a) {\n return \"\\u2022\\xA0\".concat(a);\n }).join('\\n')); // \"We couldn't find anything.\"\n\n var sliderID = target.sliderID ? \"\\\"\".concat(target.sliderID, \"\\\"\") : \"\\uD83E\\uDD37\\u200D\\u2640\\uFE0F We couldn't find any.\\n\\n \\u2022\\xA0Make sure your button is inside a `data-snap-slider-nav` element, or...\\n \\u2022\\xA0Include the slider ID you want to target in your `data-snap-slider-goto` attribute.\\n \\u25E6 For example, `data-snap-slider-goto=\\\"example-slider:\".concat(target.index || 'prev', \"\\\"`.\");\n var sliderContainer = \"\\uD83E\\uDD37\\u200D\\u2640\\uFE0F We couldn't find any.\\n\\n \\u2022\\xA0Double check that your slider ID is correct (\\uD83D\\uDC46).\\n \\u2022\\xA0Make sure your slider has the same ID in its `data-snap-slider` attribute.\\n \\u25E6 For example, `data-snap-slider=\\\"example-slider\\\"`.\";\n var slideIndexNumber = \"\\uD83E\\uDD37\\u200D\\u2640\\uFE0F We couldn't find any.\\n\\n \\u2022\\xA0Double check that your index is valid (\\uD83D\\uDC46).\\n \\u2022\\xA0Make sure a slide actually exists at that index (\\uD83D\\uDC47).\";\n var slide = \"\\uD83E\\uDD37\\u200D\\u2640\\uFE0F We couldn't find any.\\n\\n \\u2022\\xA0Double check that your index is valid (\\uD83D\\uDC46).\\n \\u2022\\xA0Make sure a slide actually exists at that index.\\n \\u2022\\xA0Make sure your slider recognizes the slide element as a slide.\"; // We found it!\n\n if (slider && slider.container) {\n sliderContainer = slider.container;\n slideIndexNumber = slider.getIndexNumber(index);\n slide = slider.getSlide(index);\n } // Log 'em.\n\n\n return logger.section({\n heading: \"\\uD83D\\uDD79 Button \".concat(num),\n description: button,\n groups: [{\n heading: '1. What slider is this button targeting?',\n items: [{\n heading: 'Slider ID',\n description: sliderID\n }, {\n heading: 'Slider Element',\n description: sliderContainer\n }, {\n heading: 'Slider Object',\n description: slider || \"\uD83E\uDD37\u200D\u2640\uFE0F We couldn't find any.\"\n }]\n }, {\n heading: '2. Which slide will it go to?',\n items: [{\n heading: 'Slide Index',\n description: slideIndex\n }, {\n heading: 'Slide Index (Number)',\n description: slideIndexNumber\n }, {\n heading: 'Slide Element',\n description: slide\n }]\n }],\n collapsed: true\n });\n } // 2b. Navigation\n\n\n if (nav) {\n // Get details for the target slider\n var _sliderID = nav.getAttribute('data-snap-slider-nav');\n\n var _slider = window._SnapSliders[_sliderID];\n var buttons = Object(_helpers_qsa__WEBPACK_IMPORTED_MODULE_15__[\"default\"])('[data-snap-slider-goto]', nav); // \"We couldn't find anything.\"\n\n _sliderID = _sliderID ? \"\\\"\".concat(_sliderID, \"\\\"\") : \"\\uD83E\\uDD37\\u200D\\u2640\\uFE0F We couldn't find any.\\n\\n \\u2022\\xA0Include the slider ID you want to target in your `data-snap-slider-nav` attribute.\\n \\u25E6 For example, `data-snap-slider-nav=\\\"example-slider\\\"`.\";\n var _sliderContainer = \"\\uD83E\\uDD37\\u200D\\u2640\\uFE0F We couldn't find any.\\n\\n \\u2022\\xA0Make sure the ID in your container's `data-snap-slider` attribute and the ID in your nav's `data-snap-slider-nav` attribute both match.\";\n\n if (!buttons.length) {\n buttons = \"\\uD83E\\uDD37\\u200D\\u2640\\uFE0F We couldn't find any.\\n\\n \\u2022\\xA0Make sure your buttons have a `data-snap-slider-goto` attribute.\";\n } // We found it!\n\n\n if (_slider && _slider.container) {\n _sliderContainer = _slider.container;\n } // Log 'em.\n\n\n return logger.section({\n heading: \"\\uD83D\\uDDFA Navigation \".concat(num),\n description: nav,\n groups: [{\n heading: '1. What slider is this nav targeting?',\n items: [{\n heading: 'Slider ID',\n description: _sliderID\n }, {\n heading: 'Slider Element',\n description: _sliderContainer\n }, {\n heading: 'Slider Object',\n description: _slider || \"\uD83E\uDD37\u200D\u2640\uFE0F We couldn't find any.\"\n }]\n }, {\n heading: '2. What buttons are in this nav?',\n items: [{\n heading: 'Buttons',\n description: buttons\n }]\n }],\n collapsed: true\n });\n } // 2c. Containers (aka sliders)\n\n\n if (container) {\n // Get details for the slider.\n var _sliderID2 = container.getAttribute('data-snap-slider');\n\n var _slider2 = window._SnapSliders[_sliderID2];\n var navs = Object(_helpers_qsa__WEBPACK_IMPORTED_MODULE_15__[\"default\"])(\"[data-snap-slider-nav=\\\"\".concat(_sliderID2, \"\\\"]\"));\n\n var _buttons = _slider2 ? _slider2.getButtons() : []; // \"We couldn't find anything.\"\n\n\n _sliderID2 = _sliderID2 ? \"\\\"\".concat(_sliderID2, \"\\\"\") : \"\\uD83E\\uDD37\\u200D\\u2640\\uFE0F We couldn't find any.\\n\\n \\u2022\\xA0Include the slider ID you want in your `data-snap-slider` attribute.\\n \\u25E6 For example, `data-snap-slider=\\\"example-slider\\\"`.\";\n\n if (!navs.length) {\n navs = \"\\uD83E\\uDD37\\u200D\\u2640\\uFE0F We couldn't find any.\\n\\n \\u2022\\xA0Make sure the ID in your container's `data-snap-slider` attribute and the ID in your nav's `data-snap-slider-nav` attribute both match.\";\n }\n\n if (!_buttons.length) {\n _buttons = \"\\uD83E\\uDD37\\u200D\\u2640\\uFE0F We couldn't find any.\\n\\n \\u2022\\xA0Make sure your button is inside a `data-snap-slider-nav` element, or...\\n \\u2022\\xA0Include the slider ID you want to target in your `data-snap-slider-goto` attribute.\\n \\u25E6 For example, `data-snap-slider-goto=\\\"example-slider:prev\\\"`.\";\n } // Log 'em.\n\n\n return logger.section({\n heading: \"\\uD83E\\uDD68 Slider \".concat(num),\n description: container,\n groups: [{\n heading: '1. What slider is this?',\n items: [{\n heading: 'Slider ID',\n description: _sliderID2\n }, {\n heading: 'Slider Object',\n description: _slider2 || \"\uD83E\uDD37\u200D\u2640\uFE0F We couldn't find any.\"\n }]\n }, {\n heading: '2. What navs target this slider?',\n items: [{\n heading: 'Navs',\n description: navs\n }]\n }, {\n heading: '3. What buttons target this slider?',\n items: [{\n heading: 'Buttons',\n description: _buttons\n }]\n }],\n collapsed: true\n });\n }\n\n return SnapSlider.notFound(idOrElements);\n });\n /* eslint-enable no-irregular-whitespace */\n }\n }\n }]);\n\n return SnapSlider;\n}(); // Keep track of all the sliders on the page to reference.\n\n\nwindow._SnapSliders = []; // Make the constructor globally accessible.\n\nwindow.SnapSlider = SnapSlider; // If jQuery exists, integrate.\n\nif (typeof $ !== 'undefined') {\n // eslint-disable-next-line no-undef, func-names\n $.fn.snapSlider = function (options) {\n return new SnapSlider(this, options);\n };\n} // Auto-init once the DOM is ready.\n\n\nObject(_helpers_onReady__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(function () {\n // Init polyfills.\n Object(element_closest__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(window);\n smoothscroll_polyfill__WEBPACK_IMPORTED_MODULE_1___default.a.polyfill(); // Initialize all sliders with data attributes.\n\n Object(_helpers_qsa__WEBPACK_IMPORTED_MODULE_15__[\"default\"])('[data-snap-slider]').forEach(function (el) {\n return new SnapSlider(el);\n }); // Setup click events for *all* nav elements.\n\n Object(_helpers_on__WEBPACK_IMPORTED_MODULE_11__[\"default\"])('body', 'click', '[data-snap-slider-goto]', SnapSlider.handleGoto);\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (SnapSlider);\n\n/***/ }),\n/* 1 */\n/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\nfunction polyfill(window) {\n var ElementPrototype = window.Element.prototype;\n\n if (typeof ElementPrototype.matches !== 'function') {\n ElementPrototype.matches = ElementPrototype.msMatchesSelector || ElementPrototype.mozMatchesSelector || ElementPrototype.webkitMatchesSelector || function matches(selector) {\n var element = this;\n var elements = (element.document || element.ownerDocument).querySelectorAll(selector);\n var index = 0;\n\n while (elements[index] && elements[index] !== element) {\n ++index;\n }\n\n return Boolean(elements[index]);\n };\n }\n\n if (typeof ElementPrototype.closest !== 'function') {\n ElementPrototype.closest = function closest(selector) {\n var element = this;\n\n while (element && element.nodeType === 1) {\n if (element.matches(selector)) {\n return element;\n }\n\n element = element.parentNode;\n }\n\n return null;\n };\n }\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (polyfill);\n//# sourceMappingURL=index.mjs.map\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* smoothscroll v0.4.4 - 2019 - Dustan Kasten, Jeremias Menichelli - MIT License */\n(function () {\n 'use strict';\n\n // polyfill\n function polyfill() {\n // aliases\n var w = window;\n var d = document;\n\n // return if scroll behavior is supported and polyfill is not forced\n if (\n 'scrollBehavior' in d.documentElement.style &&\n w.__forceSmoothScrollPolyfill__ !== true\n ) {\n return;\n }\n\n // globals\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n // object gathering original scroll methods\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elementScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n // define timing method\n var now =\n w.performance && w.performance.now\n ? w.performance.now.bind(w.performance)\n : Date.now;\n\n /**\n * indicates if a the current browser is made by Microsoft\n * @method isMicrosoftBrowser\n * @param {String} userAgent\n * @returns {Boolean}\n */\n function isMicrosoftBrowser(userAgent) {\n var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/'];\n\n return new RegExp(userAgentPatterns.join('|')).test(userAgent);\n }\n\n /*\n * IE has rounding bug rounding down clientHeight and clientWidth and\n * rounding up scrollHeight and scrollWidth causing false positives\n * on hasScrollableSpace\n */\n var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} firstArg\n * @returns {Boolean}\n */\n function shouldBailOut(firstArg) {\n if (\n firstArg === null ||\n typeof firstArg !== 'object' ||\n firstArg.behavior === undefined ||\n firstArg.behavior === 'auto' ||\n firstArg.behavior === 'instant'\n ) {\n // first argument is not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError(\n 'behavior member of ScrollOptions ' +\n firstArg.behavior +\n ' is not a valid value for enumeration ScrollBehavior.'\n );\n }\n\n /**\n * indicates if an element has scrollable space in the provided axis\n * @method hasScrollableSpace\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function hasScrollableSpace(el, axis) {\n if (axis === 'Y') {\n return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight;\n }\n\n if (axis === 'X') {\n return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth;\n }\n }\n\n /**\n * indicates if an element has a scrollable overflow property in the axis\n * @method canOverflow\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function canOverflow(el, axis) {\n var overflowValue = w.getComputedStyle(el, null)['overflow' + axis];\n\n return overflowValue === 'auto' || overflowValue === 'scroll';\n }\n\n /**\n * indicates if an element can be scrolled in either axis\n * @method isScrollable\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function isScrollable(el) {\n var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y');\n var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X');\n\n return isScrollableY || isScrollableX;\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n while (el !== d.body && isScrollable(el) === false) {\n el = el.parentNode || el.host;\n }\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n * @returns {undefined}\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window or element with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n // ORIGINAL METHODS OVERRIDES\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scroll.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object'\n ? arguments[0]\n : w.scrollX || w.pageXOffset,\n // use top prop, second argument if present or fallback to scrollY\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined\n ? arguments[1]\n : w.scrollY || w.pageYOffset\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : w.scrollX || w.pageXOffset,\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : w.scrollY || w.pageYOffset\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object' ? arguments[0] : 0,\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined ? arguments[1] : 0\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n // if one number is passed, throw error to match Firefox implementation\n if (typeof arguments[0] === 'number' && arguments[1] === undefined) {\n throw new SyntaxError('Value could not be converted');\n }\n\n original.elementScroll.call(\n this,\n // use left prop, first number argument or fallback to scrollLeft\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft,\n // use top prop, second argument or fallback to scrollTop\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop\n );\n\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'undefined' ? this.scrollLeft : ~~left,\n typeof top === 'undefined' ? this.scrollTop : ~~top\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.elementScroll.call(\n this,\n arguments[0].left !== undefined\n ? ~~arguments[0].left + this.scrollLeft\n : ~~arguments[0] + this.scrollLeft,\n arguments[0].top !== undefined\n ? ~~arguments[0].top + this.scrollTop\n : ~~arguments[1] + this.scrollTop\n );\n\n return;\n }\n\n this.scroll({\n left: ~~arguments[0].left + this.scrollLeft,\n top: ~~arguments[0].top + this.scrollTop,\n behavior: arguments[0].behavior\n });\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scrollIntoView.call(\n this,\n arguments[0] === undefined ? true : arguments[0]\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n\n // reveal parent in viewport unless is fixed\n if (w.getComputedStyle(scrollableParent).position !== 'fixed') {\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n }\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }\n\n if (true) {\n // commonjs\n module.exports = { polyfill: polyfill };\n } else {}\n\n}());\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\nvar candidateSelectors = [\n 'input',\n 'select',\n 'textarea',\n 'a[href]',\n 'button',\n '[tabindex]',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n];\nvar candidateSelector = candidateSelectors.join(',');\n\nvar matches = typeof Element === 'undefined'\n ? function () {}\n : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n\nfunction tabbable(el, options) {\n options = options || {};\n\n var regularTabbables = [];\n var orderedTabbables = [];\n\n var candidates = el.querySelectorAll(candidateSelector);\n\n if (options.includeContainer) {\n if (matches.call(el, candidateSelector)) {\n candidates = Array.prototype.slice.apply(candidates);\n candidates.unshift(el);\n }\n }\n\n var i, candidate, candidateTabindex;\n for (i = 0; i < candidates.length; i++) {\n candidate = candidates[i];\n\n if (!isNodeMatchingSelectorTabbable(candidate)) continue;\n\n candidateTabindex = getTabindex(candidate);\n if (candidateTabindex === 0) {\n regularTabbables.push(candidate);\n } else {\n orderedTabbables.push({\n documentOrder: i,\n tabIndex: candidateTabindex,\n node: candidate,\n });\n }\n }\n\n var tabbableNodes = orderedTabbables\n .sort(sortOrderedTabbables)\n .map(function(a) { return a.node })\n .concat(regularTabbables);\n\n return tabbableNodes;\n}\n\ntabbable.isTabbable = isTabbable;\ntabbable.isFocusable = isFocusable;\n\nfunction isNodeMatchingSelectorTabbable(node) {\n if (\n !isNodeMatchingSelectorFocusable(node)\n || isNonTabbableRadio(node)\n || getTabindex(node) < 0\n ) {\n return false;\n }\n return true;\n}\n\nfunction isTabbable(node) {\n if (!node) throw new Error('No node provided');\n if (matches.call(node, candidateSelector) === false) return false;\n return isNodeMatchingSelectorTabbable(node);\n}\n\nfunction isNodeMatchingSelectorFocusable(node) {\n if (\n node.disabled\n || isHiddenInput(node)\n || isHidden(node)\n ) {\n return false;\n }\n return true;\n}\n\nvar focusableCandidateSelector = candidateSelectors.concat('iframe').join(',');\nfunction isFocusable(node) {\n if (!node) throw new Error('No node provided');\n if (matches.call(node, focusableCandidateSelector) === false) return false;\n return isNodeMatchingSelectorFocusable(node);\n}\n\nfunction getTabindex(node) {\n var tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);\n if (!isNaN(tabindexAttr)) return tabindexAttr;\n // Browsers do not return `tabIndex` correctly for contentEditable nodes;\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n if (isContentEditable(node)) return 0;\n return node.tabIndex;\n}\n\nfunction sortOrderedTabbables(a, b) {\n return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;\n}\n\nfunction isContentEditable(node) {\n return node.contentEditable === 'true';\n}\n\nfunction isInput(node) {\n return node.tagName === 'INPUT';\n}\n\nfunction isHiddenInput(node) {\n return isInput(node) && node.type === 'hidden';\n}\n\nfunction isRadio(node) {\n return isInput(node) && node.type === 'radio';\n}\n\nfunction isNonTabbableRadio(node) {\n return isRadio(node) && !isTabbableRadio(node);\n}\n\nfunction getCheckedRadio(nodes) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].checked) {\n return nodes[i];\n }\n }\n}\n\nfunction isTabbableRadio(node) {\n if (!node.name) return true;\n // This won't account for the edge case where you have radio groups with the same\n // in separate forms on the same page.\n var radioSet = node.ownerDocument.querySelectorAll('input[type=\"radio\"][name=\"' + node.name + '\"]');\n var checked = getCheckedRadio(radioSet);\n return !checked || checked === node;\n}\n\nfunction isHidden(node) {\n // offsetParent being null will allow detecting cases where an element is invisible or inside an invisible element,\n // as long as the element does not use position: fixed. For them, their visibility has to be checked directly as well.\n return node.offsetParent === null || getComputedStyle(node).visibility === 'hidden';\n}\n\nmodule.exports = tabbable;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(5),\n now = __webpack_require__(6),\n toNumber = __webpack_require__(10);\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar root = __webpack_require__(7);\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar freeGlobal = __webpack_require__(8);\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(9)))\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\nvar g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar baseTrim = __webpack_require__(11),\n isObject = __webpack_require__(5),\n isSymbol = __webpack_require__(13);\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar trimmedEndIndex = __webpack_require__(12);\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\n/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar baseGetTag = __webpack_require__(14),\n isObjectLike = __webpack_require__(18);\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Symbol = __webpack_require__(15),\n getRawTag = __webpack_require__(16),\n objectToString = __webpack_require__(17);\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar root = __webpack_require__(7);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Symbol = __webpack_require__(15);\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports) {\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports) {\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar debounce = __webpack_require__(4),\n isObject = __webpack_require__(5);\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getClosestAttribute; });\n/**\n * Get an attribute for the closest element with it.\n * @param {Element} el\n * @param {String} attr\n * @return {String}\n */\nfunction getClosestAttribute(el, attr) {\n // Ignore missing elements\n if (!el) {\n return '';\n } // Find the closest element with a mattring attribute\n\n\n el = el.closest(\"[\".concat(attr, \"]\")); // If we found a match, return the attribute, otherwise\n // return an empty string.\n\n return el ? el.getAttribute(attr) : '';\n}\n\n/***/ }),\n/* 21 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getElements; });\n/* harmony import */ var _qsa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);\n\n/**\n * Get an array of elements from a mixed-value parameter.\n * Accepts Strings, Elements, and Array-like values.\n * @param {String|Element|Array} elements\n * @param {Element} context\n * @return {Array}\n */\n\nfunction getElements(elements, context) {\n // 1. If value is a String, query the DOM\n if (typeof elements === 'string') {\n return Object(_qsa__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(elements, context);\n } // 2. Put single element in an Array\n\n\n if (elements instanceof Element) {\n return [elements];\n } // 3. Assume everything can be treated like an Array\n\n\n if (elements) {\n return Array.prototype.slice.call(elements);\n } // 4. Otherwise, fallback to an empty array\n\n\n return [];\n}\n\n/***/ }),\n/* 22 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return qsa; });\n/* harmony import */ var _toArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);\n\n/**\n * QSA = \"Query Selector All\" that returns an Array instead of a NodeList.\n * @param {String} selector\n * @param {Element} context\n * @return {Array}\n */\n\nfunction qsa(selector, context) {\n return selector ? Object(_toArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])((context || document).querySelectorAll(selector)) : [];\n}\n\n/***/ }),\n/* 23 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return toArray; });\n/**\n * Convert a value to an array.\n * @param {mixed} val\n * @return {Array}\n */\nfunction toArray(val) {\n return Array.prototype.slice.call(val);\n}\n\n/***/ }),\n/* 24 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getStyle; });\n/* harmony import */ var _hasOwnProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);\n\n/**\n * Get a computed style for some element.\n * @param {Element} el\n * @param {String} prop\n * @return {String}\n */\n\nfunction getStyle(el, prop) {\n var style = window.getComputedStyle(el); // Ignore mmissing elements or props\n\n if (!style || !Object(_hasOwnProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(style, prop)) {\n return '';\n }\n\n return style[prop];\n}\n\n/***/ }),\n/* 25 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return hasOwnProperty; });\n/**\n * Check whether an object actually has a property.\n * @param {Object} obj\n * @param {String} prop\n * @return {Boolean}\n */\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n/***/ }),\n/* 26 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return isObject; });\n/**\n * Strict check for Objects. Literally checks whether\n * the value's constructor is \"Object\".\n * @param {mixed} val\n * @return {String}\n */\nfunction isObject(val) {\n return val && val.constructor.name === 'Object';\n}\n\n/***/ }),\n/* 27 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return minmax; });\n/**\n * Keep a value within some minimum and maximum values.\n * @param {Number} value\n * @param {Number} min\n * @param {Number} max\n * @return {Number}\n */\nfunction minmax(value, min, max) {\n value = Math.min(max, value);\n value = Math.max(min, value);\n return value;\n}\n\n/***/ }),\n/* 28 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return on; });\n/* eslint-disable consistent-return, func-names, no-var, prefer-arrow-callback, vars-on-top */\n\n/**\n * Plain JavaScript event delegation. Add a handler for whenever an element's\n * children trigger a specified event.\n * @see https://bdadam.com/blog/plain-javascript-event-delegation.html\n * @param {String} parentSelector\n * @param {String} eventName\n * @param {String} childSelector\n * @param {Function} fn\n * @return {Boolean}\n */\nfunction on(parentSelector, eventName, childSelector, fn) {\n var parent = document.querySelector(parentSelector);\n\n if (!parent) {\n return false;\n }\n\n parent.addEventListener(eventName, function (event) {\n var possibleTargets = parent.querySelectorAll(childSelector);\n var target = event.target;\n\n for (var i = 0, l = possibleTargets.length; i < l; i += 1) {\n var el = target;\n var p = possibleTargets[i];\n\n while (el && el !== parent) {\n if (el === p) {\n return fn.call(p, event);\n }\n\n el = el.parentNode;\n }\n }\n });\n return true;\n} // Example:\n// on('body', 'click', '.product', function(e) {\n// console.log(e.target);\n// });\n\n/***/ }),\n/* 29 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return onReady; });\n/**\n * Wait to run a function on DOMContentLoaded, or fire immediately if the\n * event has already fired.\n * @param {Function} fn\n * @return {void}\n */\nfunction onReady(fn) {\n if (document.readyState !== 'loading') {\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n}\n\n/***/ }),\n/* 30 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* eslint-disable getter-return */\n\n/**\n * Passive Event Listeners.\n *\n * Pass this value as a 3rd argument to your event listeners\n * to dramatically improve performance.\n *\n * @see https://developers.google.com/web/updates/2016/06/passive-event-listeners\n * @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection\n * @type {Boolean}\n */\nvar passive = function () {\n var result = false;\n\n try {\n var opts = Object.defineProperty({}, 'passive', {\n get: function get() {\n result = {\n passive: true\n };\n }\n });\n window.addEventListener('testPassive', null, opts);\n window.removeEventListener('testPassive', null, opts);\n } catch (error) {// \uD83E\uDD2B\n }\n\n return result;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (passive);\n\n/***/ }),\n/* 31 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return pick; });\n/**\n * Pick keys from an object.\n * @param {Object} obj\n * @param {Array} keys\n * @return {Object}\n */\nfunction pick(obj, keys) {\n return keys.reduce(function (result, key) {\n result[key] = obj[key];\n return result;\n }, {});\n}\n\n/***/ }),\n/* 32 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _hasOwnProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);\n/* eslint-disable no-restricted-syntax, no-var, vars-on-top */\n\n/**\n * Helper that does the same thing as `Object.values()`. Works in IE!\n * @param {Object} obj\n * @return {Array}\n */\n\nfunction values(obj) {\n var arr = [];\n\n for (var prop in obj) {\n if (Object(_hasOwnProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj, prop)) {\n arr.push(obj[prop]);\n }\n }\n\n return arr;\n} // Use native code if supported, else return polyfill.\n// eslint-disable-next-line no-confusing-arrow\n\n\nvar fn = function () {\n return typeof Object.values === 'function' ? Object.values : values;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (fn);\n\n/***/ }),\n/* 33 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSubstitution\", function() { return getSubstitution; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"section\", function() { return section; });\n/* harmony import */ var _helpers_dashes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-disable indent */\n// Helpers\n\n/**\n * Get the substitution string for to format this value in a console.log.\n *\n * - %o = Object\n * - %d = Number (aka \"Digit\")\n * - %s = String\n * - %c = CSS\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions\n * @param {mixed} value\n * @return {String}\n */\n\nfunction getSubstitution(value) {\n // Object\n if (_typeof(value) === 'object') {\n return '%o';\n } // Number\n\n\n if (typeof value === 'number') {\n return '%d';\n } // When in doubt, assume everything else is a String.\n\n\n return '%s';\n}\n/**\n * Log a full debug section.\n *\n * @param {Object} params\n * @param {Object} params.heading\n * @return {void}\n */\n\nfunction section(params) {\n var heading = params.heading,\n description = params.description,\n groups = params.groups,\n collapsed = params.collapsed; // Allow groups to be collapsed.\n\n var method = collapsed ? 'groupCollapsed' : 'group'; // HEADING\n\n console.log(\"%c\\n\\u250F\\u2501\\u2501\".concat(Object(_helpers_dashes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(heading.length, '\u2501'), \"\\u2501\\u2501\\u2513\\n\\u2503 \").concat(heading, \" \\u2503\\n\\u2517\\u2501\\u2501\").concat(Object(_helpers_dashes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(heading.length, '\u2501'), \"\\u2501\\u2501\\u251B\"), 'font-size: 1.25em;', '\\n\\n', description, '\\n\\n'); // GROUPS\n\n groups.forEach(function (group) {\n var _console;\n\n // Heading\n console[method](\"%c\".concat(group.heading), 'font-weight: bold;'); // Build up a single console.log for all the items in the group.\n\n var args = [];\n var content = '';\n group.items.forEach(function (item) {\n // eslint-disable-next-line no-shadow\n var heading = item.heading,\n description = item.description; // Heading\n\n content += \"\\n%c\".concat(getSubstitution(heading), \"\\n\");\n args.push('text-decoration: underline;', heading); // Description\n\n content += \"\\n%c\".concat(getSubstitution(description), \"\\n\");\n args.push('text-decoration: none;', description);\n }); // Log the items!\n\n (_console = console).log.apply(_console, [content].concat(args)); // And end the group.\n\n\n console.groupEnd();\n }); // Add an empty line after the section.\n\n console.log('\\n');\n}\n\n/***/ }),\n/* 34 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return dashes; });\n/**\n * Return a string of dashes.\n *\n * @param {Number} num\n * @param {String} char\n * @return {String}\n */\nfunction dashes(num) {\n var _char = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-';\n\n var str = '';\n\n for (var i = 0; i < num; i += 1) {\n str += _char;\n }\n\n return str;\n}\n\n/***/ })\n/******/ ])[\"default\"];\n});", "window.addEventListener(\"DOMContentLoaded\", async () => {\n const calculator = document.getElementById(\"tvcMainCalculatorDivId\");\n const container = calculator.querySelector(\"#tvcInnerCalculatorDivId\");\n\n calculator.addEventListener(\"reset\", () => {\n window.history.back();\n });\n\n const BASE_URL = new URL(\"https://www.TimeValueCalculators.com/timevaluecalculators/Calculator2.aspx\");\n BASE_URL.searchParams.set(\"TEMPLATE_ID\", \"www.stellar.bank_1\");\n window.PASSTHROUGH = \"\";\n\n /**\n * Shortcut to load a remote script and \"eval\" it for the calculator HTML.\n * @param {string} url the URL to the script source\n * @returns Promise\n */\n function loadScript(url) {\n return new Promise((resolve, reject) => {\n window.tvcCalculatorHtml = \"\";\n const script = document.createElement(\"script\");\n script.src = url;\n script.onload = () => {\n container.innerHTML = tvcCalculatorHtml;\n\n script.remove();\n resolve();\n };\n script.onerror = reject;\n calculator.appendChild(script);\n });\n }\n\n /**\n * Handles form submission by AJAX.\n *\n * Because of CORS, we cannot use `fetch`. Instead, we use the `loadScript`\n * above to eval to the new HTML.\n */\n function formHandler() {\n const form = calculator.querySelector(\"form\");\n // Keeps the original TVC URL so we can put it back after submitting.\n const originalTVC = form.getAttribute(\"data-original-tvc\");\n\n form.addEventListener(\"submit\", (event) => {\n event.preventDefault();\n const submitter = event.submitter;\n\n const formData = new FormData(form);\n const url = new URL(originalTVC, BASE_URL);\n for (const [key, value] of formData.entries()) {\n url.searchParams.set(key, value);\n }\n\n if (submitter.name) {\n url.searchParams.set(submitter.name, submitter.value);\n }\n\n loadScript(url).then(() => {\n const form = calculator.querySelector(\"form\");\n form.setAttribute(\"data-original-tvc\", originalTVC);\n formHandler();\n });\n }, {\n once: true,\n });\n }\n\n function load(calculatorID = (new URL(document.location)).searchParams.get(\"CALCULATORID\")) {\n if (!calculatorID) return;\n\n BASE_URL.searchParams.set(\"version\", Math.random());\n\n loadScript(BASE_URL.toString() + \"&\" + createQueryString())\n .then(() => {\n // Stores the original TVC URL for future AJAX calls.\n const form = calculator.querySelector(\"form\");\n form.setAttribute(\"data-original-tvc\", form.getAttribute(\"data-tvc\"));\n calculator.showModal();\n formHandler();\n });\n }\n\n load();\n\n document.querySelectorAll(`a[href*=\"CALCULATORID=\"][rel~=\"lightbox\"]`).forEach((trigger) => {\n // Handles `?` and `&` in querystring.\n const href = trigger.getAttribute(\"href\").replace(/\\/([\\d]+)&/, \"/$1?\");\n trigger.addEventListener(\"click\", (event) => {\n if (history.pushState) {\n event.preventDefault();\n window.history.pushState(null, \"\", href);\n load();\n }\n });\n });\n});\n", "\n/** Decodes an identifier back into a CSS selector */\nexport default function decodeCSS(value) {\n\tif (value.slice(0, 13) !== 'csstools-has-') {\n\t\treturn '';\n\t}\n\n\tvalue = value.slice(13);\n\tlet values = value.split('-');\n\n\tlet result = '';\n\tfor (let i = 0; i < values.length; i++) {\n\t\tresult += String.fromCharCode(parseInt(values[i], 36));\n\t}\n\n\treturn result;\n}\n", "import decodeCSS from './decode.mjs';\n\n/** Extract encoded selectors out of attribute selectors */\nexport default function extractEncodedSelectors(value) {\n\tlet out = [];\n\n\tlet depth = 0;\n\tlet candidate;\n\n\tlet quoted = false;\n\tlet quotedMark;\n\n\tlet containsUnescapedUnquotedHasAtDepth1 = false;\n\n\t// Stryker disable next-line EqualityOperator\n\tfor (let i = 0; i < value.length; i++) {\n\t\tconst char = value[i];\n\n\t\tswitch (char) {\n\t\t\tcase '[':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (depth === 0) {\n\t\t\t\t\tcandidate = '';\n\t\t\t\t} else {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t}\n\n\t\t\t\tdepth++;\n\t\t\t\tcontinue;\n\t\t\tcase ']':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\tdepth--;\n\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\tconst decoded = decodeCSS(candidate);\n\t\t\t\t\t\tif (containsUnescapedUnquotedHasAtDepth1) {\n\t\t\t\t\t\t\tout.push(decoded);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcandidate += char;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\tcase '\\\\':\n\t\t\t\tcandidate += value[i];\n\t\t\t\tcandidate += value[i+1];\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\n\t\t\tcase '\"':\n\t\t\tcase '\\'':\n\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tquoted = true;\n\t\t\t\tquotedMark = char;\n\t\t\t\tcontinue;\n\n\t\t\tdefault:\n\t\t\t\tif (candidate === '' && depth === 1 && (value.slice(i, i + 13) === 'csstools-has-')) {\n\t\t\t\t\tcontainsUnescapedUnquotedHasAtDepth1 = true;\n\t\t\t\t}\n\n\t\t\t\tcandidate += char;\n\t\t\t\tcontinue;\n\t\t}\n\t}\n\n\tconst unique = [];\n\tfor (let i = 0; i < out.length; i++) {\n\t\tif (unique.indexOf(out[i]) === -1) {\n\t\t\tunique.push(out[i]);\n\t\t}\n\t}\n\n\treturn unique;\n}\n", "\n/** Returns the string as an encoded CSS identifier. */\nexport default function encodeCSS(value) {\n\tif (value === '') {\n\t\treturn '';\n\t}\n\n\tlet hex;\n\tlet result = '';\n\tfor (let i = 0; i < value.length; i++) {\n\t\thex = value.charCodeAt(i).toString(36);\n\t\tif (i === 0) {\n\t\t\tresult += hex;\n\t\t} else {\n\t\t\tresult += '-' + hex;\n\t\t}\n\t}\n\n\treturn 'csstools-has-' + result;\n}\n", "/* global MutationObserver,requestAnimationFrame,cancelAnimationFrame,self,HTMLElement */\n\nimport '@mrhenry/core-web/modules/~element-qsa-has.js';\nimport extractEncodedSelectors from './encode/extract.mjs';\nimport encodeCSS from './encode/encode.mjs';\n\nfunction hasNativeSupport() {\n\ttry {\n\t\tif (!('CSS' in self) || !('supports' in self.CSS) || !self.CSS.supports('selector(:has(div))')) {\n\t\t\treturn false;\n\t\t}\n\n\t} catch (_) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport default function cssHasPseudo(document, options) {\n\t// OPTIONS\n\t{\n\t\tif (!options) {\n\t\t\toptions = {};\n\t\t}\n\n\t\toptions = {\n\t\t\thover: (!!options.hover) || false,\n\t\t\tdebug: (!!options.debug) || false,\n\t\t\tobservedAttributes: options.observedAttributes || [],\n\t\t\tforcePolyfill: (!!options.forcePolyfill) || false,\n\t\t};\n\n\t\toptions.mustPolyfill = options.forcePolyfill || !hasNativeSupport();\n\n\t\tif (!Array.isArray(options.observedAttributes)) {\n\t\t\toptions.observedAttributes = [];\n\t\t}\n\n\t\toptions.observedAttributes = options.observedAttributes.filter((x) => {\n\t\t\treturn (typeof x === 'string');\n\t\t});\n\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\n\t\t// `data-*` and `style` were omitted\n\t\toptions.observedAttributes = options.observedAttributes.concat(['accept', 'accept-charset', 'accesskey', 'action', 'align', 'allow', 'alt', 'async', 'autocapitalize', 'autocomplete', 'autofocus', 'autoplay', 'buffered', 'capture', 'challenge', 'charset', 'checked', 'cite', 'class', 'code', 'codebase', 'cols', 'colspan', 'content', 'contenteditable', 'contextmenu', 'controls', 'coords', 'crossorigin', 'csp', 'data', 'datetime', 'decoding', 'default', 'defer', 'dir', 'dirname', 'disabled', 'download', 'draggable', 'enctype', 'enterkeyhint', 'for', 'form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'headers', 'hidden', 'high', 'href', 'hreflang', 'http-equiv', 'icon', 'id', 'importance', 'integrity', 'intrinsicsize', 'inputmode', 'ismap', 'itemprop', 'keytype', 'kind', 'label', 'lang', 'language', 'list', 'loop', 'low', 'manifest', 'max', 'maxlength', 'minlength', 'media', 'method', 'min', 'multiple', 'muted', 'name', 'novalidate', 'open', 'optimum', 'pattern', 'ping', 'placeholder', 'poster', 'preload', 'radiogroup', 'readonly', 'referrerpolicy', 'rel', 'required', 'reversed', 'rows', 'rowspan', 'sandbox', 'scope', 'scoped', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'spellcheck', 'src', 'srcdoc', 'srclang', 'srcset', 'start', 'step', 'summary', 'tabindex', 'target', 'title', 'translate', 'type', 'usemap', 'value', 'width', 'wrap']);\n\t}\n\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\tif (!options.mustPolyfill) {\n\t\t// Cleanup of rules will have happened in `walkStyleSheet`\n\t\t// Native support will take over from here\n\t\treturn;\n\t}\n\n\ttransformObservedItemsThrottled();\n\n\t// observe DOM modifications that affect selectors\n\tif ('MutationObserver' in self) {\n\t\tconst mutationObserver = new MutationObserver((mutationsList) => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// transform observed css rules\n\t\t\t\tcleanupObservedCssRules();\n\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t});\n\t\t});\n\n\t\tmutationObserver.observe(document, { childList: true, subtree: true, attributes: true, attributeFilter: options.observedAttributes });\n\t}\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('blur', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('input', transformObservedItemsThrottled);\n\tdocument.addEventListener('change', transformObservedItemsThrottled, true);\n\n\tif (options.hover) {\n\t\tif ('onpointerenter' in document) {\n\t\t\tdocument.addEventListener('pointerenter', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('pointerleave', transformObservedItemsThrottled, true);\n\t\t} else {\n\t\t\tdocument.addEventListener('mouseover', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('mouseout', transformObservedItemsThrottled, true);\n\t\t}\n\t}\n\n\t// observe Javascript setters that effect pseudo-selectors\n\tif ('defineProperty' in Object && 'getOwnPropertyDescriptor' in Object && 'hasOwnProperty' in Object) {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction observeProperty(proto, property) {\n\t\t\t\t// eslint-disable-next-line no-prototype-builtins\n\t\t\t\tif (proto.hasOwnProperty(property)) {\n\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(proto, property);\n\t\t\t\t\tif (descriptor && descriptor.configurable && 'set' in descriptor) {\n\t\t\t\t\t\tObject.defineProperty(proto, property, {\n\t\t\t\t\t\t\tconfigurable: descriptor.configurable,\n\t\t\t\t\t\t\tenumerable: descriptor.enumerable,\n\t\t\t\t\t\t\tget: function () {\n\t\t\t\t\t\t\t\treturn descriptor.get.apply(this, arguments);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tset: function () {\n\t\t\t\t\t\t\t\tdescriptor.set.apply(this, arguments);\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t\t\t\t\t\t} catch (_) {\n\t\t\t\t\t\t\t\t\t// should never happen as there is an inner try/catch\n\t\t\t\t\t\t\t\t\t// but just in case\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ('HTMLElement' in self && HTMLElement.prototype) {\n\t\t\t\tobserveProperty(HTMLElement.prototype, 'disabled');\n\t\t\t}\n\n\t\t\t// Not all of these elements have all of these properties.\n\t\t\t// But the code above checks if they exist first.\n\t\t\t['checked', 'selected', 'readOnly', 'required'].forEach((property) => {\n\t\t\t\t[\n\t\t\t\t\t'HTMLButtonElement',\n\t\t\t\t\t'HTMLFieldSetElement',\n\t\t\t\t\t'HTMLInputElement',\n\t\t\t\t\t'HTMLMeterElement',\n\t\t\t\t\t'HTMLOptGroupElement',\n\t\t\t\t\t'HTMLOptionElement',\n\t\t\t\t\t'HTMLOutputElement',\n\t\t\t\t\t'HTMLProgressElement',\n\t\t\t\t\t'HTMLSelectElement',\n\t\t\t\t\t'HTMLTextAreaElement',\n\t\t\t\t].forEach((elementName) => {\n\t\t\t\t\tif (elementName in self && self[elementName].prototype) {\n\t\t\t\t\t\tobserveProperty(self[elementName].prototype, property);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet transformObservedItemsThrottledBusy = false;\n\tfunction transformObservedItemsThrottled() {\n\t\tif (transformObservedItemsThrottledBusy) {\n\t\t\tcancelAnimationFrame(transformObservedItemsThrottledBusy);\n\t\t}\n\n\t\ttransformObservedItemsThrottledBusy = requestAnimationFrame(() => {\n\t\t\ttransformObservedItems();\n\t\t});\n\t}\n\n\t// transform observed css rules\n\tfunction transformObservedItems() {\n\t\tobservedItems.forEach((item) => {\n\t\t\tconst nodes = [];\n\n\t\t\tlet matches = [];\n\t\t\ttry {\n\t\t\t\tmatches = document.querySelectorAll(item.selector);\n\t\t\t} catch (e) {\n\t\t\t\tif (options.debug) {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t[].forEach.call(matches, (element) => {\n\t\t\t\t// memorize the node\n\t\t\t\tnodes.push(element);\n\n\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\tattributeElement.innerHTML = '';\n\n\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t});\n\n\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\titem.nodes.forEach(node => {\n\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// update the\n\t\t\titem.nodes = nodes;\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules() {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter((item) => {\n\t\t\t\treturn item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet(styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], (rule, index) => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\trule.selectorText = rule.selectorText.replace(/\\.js-has-pseudo\\s/g, '');\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t\tconst hasSelectors = extractEncodedSelectors(rule.selectorText.toString());\n\t\t\t\t\t\tif (hasSelectors.length === 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!options.mustPolyfill) {\n\t\t\t\t\t\t\tstyleSheet.deleteRule(index);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let i = 0; i < hasSelectors.length; i++) {\n\t\t\t\t\t\t\tconst hasSelector = hasSelectors[i];\n\t\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\t\trule: rule,\n\t\t\t\t\t\t\t\tselector: hasSelector,\n\t\t\t\t\t\t\t\tattributeName: encodeCSS(hasSelector),\n\t\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n}\n", "/* eslint-disable */\n(function (global) {\n\ttry {\n\t\t// test for has support\n\t\tglobal.document.querySelector(':has(*, :does-not-exist, > *)');\n\n\t\tif (\n\t\t\t!global.document.querySelector(':has(:scope *)') &&\n\t\t\tCSS.supports('selector(:has(div))')\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t} catch (_) { }\n\n\t// ELEMENT\n\t// polyfill Element#querySelector\n\tvar querySelectorWithHasElement = polyfill(global.Element.prototype.querySelector);\n\n\tglobal.Element.prototype.querySelector = function querySelector(selectors) {\n\t\treturn querySelectorWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#querySelectorAll\n\tvar querySelectorAllWithHasElement = polyfill(global.Element.prototype.querySelectorAll);\n\n\tglobal.Element.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\treturn querySelectorAllWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#matches\n\tif (global.Element.prototype.matches) {\n\t\tvar matchesWithHasElement = polyfill(global.Element.prototype.matches);\n\n\t\tglobal.Element.prototype.matches = function matches(selectors) {\n\t\t\treturn matchesWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// polyfill Element#closest\n\tif (global.Element.prototype.closest) {\n\t\tvar closestWithHasElement = polyfill(global.Element.prototype.closest);\n\n\t\tglobal.Element.prototype.closest = function closest(selectors) {\n\t\t\treturn closestWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// DOCUMENT\n\tif ('Document' in global && 'prototype' in global.Document) {\n\t\t// polyfill Document#querySelector\n\t\tvar querySelectorWithHasDocument = polyfill(global.Document.prototype.querySelector);\n\n\t\tglobal.Document.prototype.querySelector = function querySelector(selectors) {\n\t\t\treturn querySelectorWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#querySelectorAll\n\t\tvar querySelectorAllWithHasDocument = polyfill(global.Document.prototype.querySelectorAll);\n\n\t\tglobal.Document.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\t\treturn querySelectorAllWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#matches\n\t\tif (global.Document.prototype.matches) {\n\t\t\tvar matchesWithHasDocument = polyfill(global.Document.prototype.matches);\n\n\t\t\tglobal.Document.prototype.matches = function matches(selectors) {\n\t\t\t\treturn matchesWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\n\t\t// polyfill Document#closest\n\t\tif (global.Document.prototype.closest) {\n\t\t\tvar closestWithHasDocument = polyfill(global.Document.prototype.closest);\n\n\t\t\tglobal.Document.prototype.closest = function closest(selectors) {\n\t\t\t\treturn closestWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\t}\n\n\tfunction pseudoClassHasInnerQuery(query) {\n\t\tvar current = '';\n\t\tvar start = 0;\n\t\tvar depth = 0;\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar inHas = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':has(' && !inHas) {\n\t\t\t\tinHas = true;\n\t\t\t\tstart = i;\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tif (!inHas) {\n\t\t\t\t\t\tcurrent = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tdepth++;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase ')':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tinnerQuery: current,\n\t\t\t\t\t\t\t\tstart: start,\n\t\t\t\t\t\t\t\tend: i-1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdepth--;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction replaceScopeWithAttr(query, attr) {\n\t\tvar parts = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':scope' && !bracketed && (/^[\\[\\.\\:\\\\\"\\s|+>~#&,)]/.test(char || ''))) {\n\t\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\t\tparts.push('[' + attr + ']');\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tparts.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (current.toLowerCase() === ':scope') {\n\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\tparts.push('[' + attr + ']');\n\t\t\tcurrent = '';\n\t\t}\n\n\t\tif (parts.length === 0) {\n\t\t\treturn query;\n\t\t}\n\n\t\treturn parts.join('') + current;\n\t}\n\n\tfunction charIsNestedMarkMirror(char, mark) {\n\t\tif (mark === '(' && char === ')') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (mark === '[' && char === ']') {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction splitSelector(query) {\n\t\tvar selectors = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar nestedMark = false;\n\t\tvar nestedDepth = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ',':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (nestedDepth > 0) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tselectors.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tquoted = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\tcase ')':\n\t\t\t\tcase '[':\n\t\t\t\tcase ']':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (charIsNestedMarkMirror(char, nestedMark)) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth--;\n\n\t\t\t\t\t\tif (nestedDepth === 0) {\n\t\t\t\t\t\t\tnestedMark = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (char === nestedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tnestedDepth++;\n\t\t\t\t\tnestedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t}\n\n\t\tselectors.push(current);\n\n\t\treturn selectors;\n\t}\n\n\tfunction replaceAllWithTempAttr(query, nested, callback) {\n\t\tvar inner = pseudoClassHasInnerQuery(query);\n\t\tif (!inner) {\n\t\t\treturn query;\n\t\t}\n\n\t\tif (nested) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar innerQuery = inner.innerQuery;\n\t\tvar attr = 'q-has' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\tvar innerReplacement = '[' + attr + ']';\n\n\t\tvar x = query;\n\n\t\tif (inner.innerQuery.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar innerParts = splitSelector(inner.innerQuery);\n\t\t\tvar newInnerParts = [];\n\t\t\tfor (var i = 0; i < innerParts.length; i++) {\n\t\t\t\tvar innerPart = innerParts[i];\n\n\t\t\t\t// Nested has is not supported.\n\t\t\t\t// If a recursive/nested call returns \"false\" we throw\n\t\t\t\tvar innerPartReplaced = replaceAllWithTempAttr(innerPart, true, function () { });\n\t\t\t\tif (!innerPartReplaced) {\n\t\t\t\t\tthrow new Error(\"Nested :has() is not supported\")\n\t\t\t\t} else {\n\t\t\t\t\tnewInnerParts.push(innerPart);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\t\treturn _prefix + newInnerParts.join(', ') + _suffix;\n\t\t}\n\n\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\tx = _prefix + innerReplacement + _suffix;\n\n\t\tcallback(innerQuery, attr);\n\t\tif (x.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar y = replaceAllWithTempAttr(x, false, callback);\n\t\t\tif (y) {\n\t\t\t\treturn y;\n\t\t\t}\n\t\t}\n\n\t\treturn x;\n\t}\n\n\tfunction walkNode(rootNode, callback) {\n\t\tif (('setAttribute' in (rootNode)) && ('querySelector' in (rootNode))) {\n\t\t\tcallback(rootNode);\n\t\t}\n\n\t\tif (rootNode.hasChildNodes()) {\n\t\t\tvar nodes = rootNode.childNodes;\n\t\t\tfor (var i = 0; i < nodes.length; ++i) {\n\t\t\t\twalkNode(nodes[i], callback);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction polyfill(qsa) {\n\t\treturn function (selectors) {\n\t\t\tif ((selectors.toLowerCase().indexOf(':has(') === -1) || !pseudoClassHasInnerQuery(selectors)) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar rootNode;\n\t\t\tif ('getRootNode' in this) {\n\t\t\t\trootNode = this.getRootNode();\n\t\t\t} else {\n\t\t\t\tvar r = this;\n\t\t\t\twhile (r) {\n\t\t\t\t\trootNode = r;\n\t\t\t\t\tr = r.parentNode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _focus = this;\n\t\t\tif (_focus === global.document) {\n\t\t\t\t_focus = global.document.documentElement;\n\t\t\t}\n\n\t\t\tvar scopeAttr = 'q-has-scope' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t_focus.setAttribute(scopeAttr, '');\n\n\t\t\ttry {\n\t\t\t\tselectors = replaceScopeWithAttr(selectors, scopeAttr);\n\n\t\t\t\tvar attrs = [scopeAttr];\n\t\t\t\tvar newQuery = replaceAllWithTempAttr(selectors, false, function (inner, attr) {\n\t\t\t\t\tattrs.push(attr);\n\n\t\t\t\t\tvar selectorParts = splitSelector(inner);\n\t\t\t\t\tfor (var x = 0; x < selectorParts.length; x++) {\n\t\t\t\t\t\tvar selectorPart = selectorParts[x].trim();\n\t\t\t\t\t\tvar absoluteSelectorPart = selectorPart;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tselectorPart[0] === '>' ||\n\t\t\t\t\t\t\tselectorPart[0] === '+' ||\n\t\t\t\t\t\t\tselectorPart[0] === '~'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tabsoluteSelectorPart = selectorPart.slice(1).trim();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteSelectorPart = ':scope ' + selectorPart;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twalkNode(rootNode, function (node) {\n\t\t\t\t\t\t\tif (!(node.querySelector(absoluteSelectorPart))) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch (selectorPart[0]) {\n\t\t\t\t\t\t\t\tcase '~':\n\t\t\t\t\t\t\t\tcase '+':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar siblings = node.childNodes;\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < siblings.length; i++) {\n\t\t\t\t\t\t\t\t\t\t\tvar sibling = siblings[i];\n\t\t\t\t\t\t\t\t\t\t\tif (!('setAttribute' in sibling)) {\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope [' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tsibling.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\tnode.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope[' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tnode.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\targuments[0] = newQuery;\n\n\t\t\t\t// results of the qsa\n\t\t\t\tvar elementOrNodeList = qsa.apply(this, arguments);\n\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// return the results of the qsa\n\t\t\t\treturn elementOrNodeList;\n\t\t\t} catch (err) {\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar errorMessage = '';\n\t\t\t\ttry {\n\t\t\t\t\tqsa.apply(this, [':core-web-does-not-exist']);\n\t\t\t\t} catch (dummyError) {\n\t\t\t\t\terrorMessage = dummyError.message;\n\t\t\t\t\tif (errorMessage) {\n\t\t\t\t\t\terrorMessage = errorMessage.replace(':core-web-does-not-exist', selectors);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!errorMessage) {\n\t\t\t\t\terrorMessage = \"Failed to execute 'querySelector' on 'Document': '\" + selectors + \"' is not a valid selector.\";\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tthrow new DOMException(errorMessage);\n\t\t\t\t} catch (_) {\n\t\t\t\t\tthrow new Error(errorMessage);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n})(self);\n", "const $ = (selector, parent = document) => parent.querySelector(selector);\nconst $$ = (selector, parent = document) => parent.querySelectorAll(selector);\n\nconst $body = $(\"body\");\nconst $siteHeader = $(`header[role=\"banner\"]`);\n\n// Observes the site header, which should have `top: -1px`, and toggles\n// the `stuck` class when it hits the top of the page.\nnew IntersectionObserver(\n ([e]) => e.target.classList.toggle(\"stuck\", e.intersectionRatio < 1),\n { threshold: [1] }\n).observe($siteHeader);\n\n// Toggles state of the site header when the menu button is clicked.\ndocument.addEventListener(\"click\", function(event) {\n const menu = event.target.closest(`[aria-controls=\"menu\"]`);\n\n if (menu) {\n const state = menu.getAttribute(\"aria-expanded\");\n const isOpen = state === \"true\";\n\n menu.setAttribute(\"aria-expanded\", isOpen ? \"false\" : \"true\");\n menu.innerText = isOpen ? \"Menu\" : \"Close\";\n $siteHeader.classList.toggle(\"menu-open\");\n $body.classList.toggle(\"overflow-hidden\");\n }\n\n // On mobile, clicking a primary menu item will close the branch.\n if (event.target.matches(`li.open>button`)) {\n event.target.closest(`li`).classList.toggle(\"open\");\n }\n});\n\n/**\n * Toggles a variant on an element.\n * @param {HTMLElement} navItem\n * @param {boolean} force whether to force open\n * @param {string} variant the variant to toggle.\n */\nfunction toggle(navItem, force, variant = \"hover:\") {\n const classList = navItem.classList;\n classList.forEach(function(className) {\n if (className.indexOf(variant) > -1) {\n classList.toggle(className.replace(variant, \"\"), force);\n }\n });\n\n if (classList.contains(\"group\")) {\n const descendants = navItem.querySelectorAll(`[class*=\"group-${variant}\"]`);\n Array.from(descendants).forEach(function(item) {\n toggle(item, force, `group-${variant}`);\n });\n }\n\n if (classList.contains(\"peer\")) {\n const peers = navItem.querySelectorAll(`:scope+[class*=\"peer-${variant}\"]`);\n Array.from(peers).forEach(function(item) {\n toggle(item, force, `peer-${variant}`);\n });\n }\n}\n\nconst $primary = document.querySelector(`nav[aria-label=\"Primary\"]`);\nconst $parents = $primary.querySelectorAll(\".isParent\");\n\nArray.from($parents).forEach(function($parent) {\n // Handles ARIA for buttons and menus.\n const $toggle = $parent.querySelector(\":scope > button\");\n if (!$toggle) return;\n\n $parent.addEventListener(\"mouseover\", function(event) {\n toggle(this, true);\n $toggle.setAttribute(\"aria-expanded\", `true`);\n });\n\n $parent.addEventListener(\"mouseout\", function(event) {\n toggle(this, false);\n $toggle.setAttribute(\"aria-expanded\", `false`);\n });\n\n $toggle.addEventListener(\"click\", function(event) {\n const expanded = ($toggle.getAttribute(\"aria-expanded\") === \"true\");\n $toggle.setAttribute(\"aria-expanded\", `${!expanded}`);\n\n toggle($parent, !expanded)\n });\n});\n", "const BACKSPACE = 8;\nconst TAB = 9;\nconst ENTER = 13;\nconst SHIFT = 16;\nconst ESCAPE = 27;\nconst SPACE = 32;\nconst PAGE_UP = 33;\nconst PAGE_DOWN = 34;\nconst END = 35;\nconst HOME = 36;\nconst ARROW_LEFT = 37;\nconst ARROW_UP = 38;\nconst ARROW_RIGHT = 39;\nconst ARROW_DOWN = 40;\nconst DELETE = 46;\n\nconst direction = {\n 37: -1,\n 38: -1,\n 39: 1,\n 40: 1,\n};\n\n// Tabs with Automatic Activation\n// https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-1/tabs.html\nclass A11yTab {\n constructor(tablist, options = {}) {\n this.tablist = tablist;\n this.orientation = tablist.getAttribute(\"aria-orientation\") || \"horizontal\";\n const tabs = this.tabs = [];\n const panels = this.panels = [];\n\n // Bind.\n this.onKeydown = this.onKeydown.bind(this);\n this.onKeyup = this.onKeyup.bind(this);\n this.onClick = this.onClick.bind(this);\n this.focusEventHandler = this.focusEventHandler.bind(this);\n\n // Determine whether there should be a delay when user navigates with\n // the arrow keys, default is\n this.delay = tablist.getAttribute(\"data-delay\") || 0;\n\n const hash = window.location.hash;\n\n let activeTab;\n tablist.querySelectorAll(`[role=\"tab\"]`).forEach((tab, index) => {\n tabs.push(tab);\n const panelId = tab.getAttribute(\"aria-controls\");\n panels.push(document.getElementById(panelId));\n\n const active = hash === `#${ panelId }`;\n if (active) {\n activeTab = tab;\n }\n\n tab.addEventListener(\"click\", this.onClick, false);\n tab.addEventListener(\"keydown\", this.onKeydown, false);\n tab.addEventListener(\"keyup\", this.onKeyup, false);\n });\n\n if (activeTab) {\n this.activateTab(activeTab);\n }\n }\n\n /**\n * Click event listener\n *\n * When a tab is clicked, activateTab is fired to activate it\n *\n * @param {object} event\n * @return void\n */\n onClick(event) {\n const tab = event.target;\n this.activateTab(tab, false);\n\n const href = tab.getAttribute(\"href\");\n if (href) {\n event.preventDefault();\n }\n }\n\n /**\n * Keydown event listener\n *\n * Handle keydown on tabs\n *\n * @param {object} event\n * @return void\n */\n onKeydown(event) {\n const { keyCode: key } = event;\n\n const codes = {\n [END]: () => {\n event.preventDefault();\n this.activateTab(this.tabs[this.tabs.length - 1]);\n },\n [HOME]: () => {\n event.preventDefault();\n this.activateTab(this.tabs[0]);\n },\n [PAGE_UP]: () => this.determineOrientation(event),\n [PAGE_DOWN]: () => this.determineOrientation(event),\n // Up and down are in keydown because we need to prevent page scroll >:)\n [ARROW_UP]: () => this.determineOrientation(event),\n [ARROW_DOWN]: () => this.determineOrientation(event),\n default: () => false,\n };\n\n return (codes[key] || codes.default)();\n }\n\n /**\n * Keyup event listener\n *\n * Handle keyup on tabs\n *\n * @param {object} event\n * @return void\n */\n onKeyup(event) {\n const { keyCode: key, target } = event;\n // const selected = target.getAttribute(\"aria-selected\") === \"true\";\n\n const codes = {\n [ARROW_LEFT]: () => this.determineOrientation(event),\n [ARROW_RIGHT]: () => this.determineOrientation(event),\n // [DELETE]: () => selected && this.determineDeletable(event),\n // [BACKSPACE]: () => selected && this.determineDeletable(event),\n default: () => false,\n };\n\n return (codes[key] || codes.default)();\n }\n\n /**\n * Determine orientation\n *\n * When a tablist's aria-orientation is set to vertical, only up and down\n * arrow should function. In all other cases only left and right arrow\n * function.\n *\n * @param {object} event\n */\n determineOrientation(event) {\n const { keyCode: key } = event;\n const vertical = \"vertical\" === this.orientation;\n let proceed = false;\n\n if (vertical && (key === PAGE_UP || key === PAGE_DOWN || key === ARROW_UP || key === ARROW_DOWN)) {\n event.preventDefault();\n proceed = true;\n } else if (key === ARROW_LEFT || key === ARROW_RIGHT) {\n proceed = true;\n }\n\n if (proceed) {\n this.switchTabOnArrowPress(event);\n }\n }\n\n /**\n * Switch tab on arrow press\n *\n * Either focus the next, previous, first, or last tab depening on key\n * pressed\n *\n * @param {object} event\n * @return void\n */\n switchTabOnArrowPress(event) {\n const { target, keyCode: key } = event;\n const tabs = this.tabs;\n\n tabs.forEach(tab => tab.addEventListener(\"focus\", this.focusEventHandler));\n\n if (direction[key]) {\n const index = this.tabs.indexOf(target);\n if (index !== undefined) {\n if (this.tabs[index + direction[key]]) {\n this.tabs[index + direction[key]].focus();\n } else if (key === ARROW_LEFT || key === PAGE_UP || key === ARROW_UP) {\n this.focusLastTab();\n } else if (key === ARROW_RIGHT || key === PAGE_DOWN || key === ARROW_DOWN) {\n this.focusFirstTab();\n }\n }\n }\n }\n\n /**\n * Activate tab\n *\n * Activates any given tab panel\n *\n * @param {object} tab\n * @param {boolean} [setFocus=true]\n * @return void\n */\n activateTab(tab, setFocus = true) {\n // Deactivate all other tabs\n this.deactivateTabs();\n\n tab.setAttribute(\"tabindex\", 0);\n // Set the tab as selected\n tab.setAttribute(\"aria-selected\", \"true\");\n // Get the value of aria-controls (which is an ID)\n const panelId = tab.getAttribute(\"aria-controls\");\n const panel = document.getElementById(panelId);\n\n // Remove hidden attribute from tab panel to make it visible\n // panel.removeAttribute(\"aria-hidden\");\n panel.setAttribute(\"open\",\"open\");\n\n // Set focus when required\n if (setFocus) {\n tab.click();\n } else {\n history.replaceState(null, null, `#${ panel.id}`);\n }\n\n const event = new CustomEvent(\"change\", {\n detail: {\n currentTab: tab,\n currentIndex: this.tabs.indexOf(tab),\n }\n });\n this.tablist.dispatchEvent(event);\n\n // Dispatches a \"resize\" event so content inside tabs can redraw if needs.\n window.dispatchEvent(new Event(\"resize\"));\n }\n\n /**\n * Deactivate tabs\n *\n * Deactivate all tabs and tab panels\n *\n * @return void\n */\n deactivateTabs() {\n this.tabs.forEach(tab => {\n tab.setAttribute(\"tabindex\", -1);\n tab.setAttribute(\"aria-selected\", \"false\");\n tab.removeEventListener(\"focus\", this.focusEventHandler);\n });\n\n this.panels.forEach(panel => {\n // panel.setAttribute(\"aria-hidden\", \"true\");\n panel.removeAttribute(\"open\");\n });\n }\n\n /**\n * Focus first tab\n *\n * @return\n */\n focusFirstTab() {\n return this.tabs[0].focus();\n }\n\n\n /**\n * Focus last tab\n *\n * @return\n */\n focusLastTab() {\n return this.tabs[this.tabs.length - 1].focus();\n }\n\n /**\n * Focus event handler\n *\n * @param {object} event\n * @return void\n */\n focusEventHandler(event) {\n const { target } = event;\n\n setTimeout(() => {\n this.checkTabFocus(target);\n }, this.delay);\n }\n\n /**\n * Check tab focus\n *\n * Only activate tab on focus if it still has focus after the delay\n *\n * @param {object} target\n * @return void\n */\n checkTabFocus(target) {\n const focused = document.activeElement;\n\n if (target === focused) {\n this.activateTab(target, false);\n }\n }\n}\n\n/** @type {NodeListOf} */\nconst tabsCollections = document.querySelectorAll(\"[role=\\\"tablist\\\"\");\nfor (let i = 0, count = tabsCollections.length; i < count; i++) {\n new A11yTab(tabsCollections[i], {\n\n });\n}\n\nexport default A11yTab;\n", "import Slider from \"../../../../../node_modules/@tannerhodges/snap-slider/snap-slider.js\";\n\n// Handles advancing the How To carousel slides when clicking on the\n// anchor links. We don't want the page to scroll down to the element.\ndocument.addEventListener(\"click\", function(event) {\n if (!event.target.matches(`[data-snap-slider] a[href^=\"#\"]`)) {\n return;\n }\n\n event.preventDefault(); // Note: this stops the hash change.\n const target = document.querySelector(event.target.getAttribute(\"href\"));\n if (target) {\n target.scrollIntoView({\n block: \"nearest\", // Do not scroll down to the element\n inline: \"nearest\",\n behavior: \"smooth\",\n });\n }\n});\n", "if (document.querySelector(\"[data-location]\")) {\n const script = document.createElement(\"script\");\n script.src = \"https://apis.google.com/js/api.js\";\n script.async = true;\n script.defer = true;\n script.onload = () => {\n gapi.load(\"client\", getSheetData)\n };\n document.head.appendChild(script);\n\n function getSheetData() {\n const SHEETAPIKEY = \"AIzaSyAE-7Nmyo9EpqeXTAT0becj7wGI-sc7b_g\";\n const SHEETID = \"1u25CPlFZDkUxVXueS6isB8wIJWHbgBY_cnZMePy9gJg\";\n\n let sheetData = {};\n\n gapi.client.init({\n \"apiKey\": SHEETAPIKEY\n }).then(() => {\n return gapi.client.request({\n \"path\": \"https://sheets.googleapis.com/v4/spreadsheets/\" + SHEETID + \"/values/Locations!A2:Z\"\n });\n }).then(response => {\n if (response.result?.values.length > 0) {\n response.result.values.forEach(sheetLocation => {\n sheetData[sheetLocation[0]] = {\n \"phone\": sheetLocation[1],\n \"lobbyHours\": sheetLocation[2],\n \"driveThruHours\": sheetLocation[3],\n \"status\": sheetLocation[4]\n }\n });\n }\n }, reason => {\n if (typeof reason === \"object\" && reason.result) {\n console.error && console.error(\"Error: \" + reason.result.error.message);\n } else {\n console.error && console.error(reason);\n }\n }).then(() => {\n document.querySelectorAll(\"[data-location]\").forEach(pageLocation => {\n let bank = pageLocation.getAttribute(\"data-location\");\n let key = pageLocation.getAttribute(\"data-key\");\n if (!sheetData[bank] || !sheetData[bank][key]) {\n return;\n }\n let value = sheetData[bank][key]?.replaceAll(\"\\n\", \"
\");\n let element = pageLocation.getAttribute(\"data-element\")\n ? pageLocation.querySelector(pageLocation.getAttribute(\"data-element\"))\n : pageLocation\n\n if (value) {\n element.innerHTML = value;\n pageLocation.classList.remove(\"hidden\");\n } else {\n pageLocation.classList.add(\"hidden\");\n }\n\n if (key === \"status\") {\n switch (value) {\n case \"Closed\":\n element.classList.add(\"bg-tertiary-4\");\n element.classList.add(\"text-white\"); // text-white\");\n break;\n case \"Limited Hours\":\n case \"Lobby: Appt Only\":\n case \"Drive-Thru Only\":\n element.classList.add(\"bg-secondary-2\");\n break;\n default:\n element.classList.add(\"bg-secondary-1\");\n }\n }\n\n if (key === \"phone\" && element.tagName === \"A\") {\n element.setAttribute(\"href\", `tel:${value}`);\n }\n });\n });\n }\n}\n", "\nwindow.params = new Proxy(new URLSearchParams(window.location.search), {\n get: (searchParams, prop) => searchParams.get(prop),\n});\n\nif (document.querySelector(\"#location-map\")) {\n let map, infoWindow, myPosition, bounds, activeMarker, options, icons;\n let markers = [];\n let APIKey = document.querySelector(\"#location-map\").getAttribute(\"data-api\");\n\n options = {\n // mapId: \"73d4cc3fd1732f66\",\n zoom: 4,\n lat: 29,\n long: -95,\n disableDefaultUI: true,\n zoomControl: true,\n minZoom: 4,\n restriction: {\n latLngBounds: {\n north: 56,\n south: 24,\n east: -65,\n west: -126\n }\n },\n styles: [\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n },\n {\n \"lightness\": 33\n },\n {\n \"saturation\": \"0\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n },\n {\n \"weight\": \"0.25\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n }]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n }]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#ffffff\"\n },\n {\n \"visibility\": \"simplified\"\n },\n {\n \"lightness\": \"6\"\n },\n {\n \"saturation\": \"0\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n },\n {\n \"weight\": \"0.25\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#e3eed3\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels\",\n \"stylers\": [{\n \"visibility\": \"on\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"lightness\": 20\n },\n {\n \"weight\": \"0.25\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#19294c\"\n },\n {\n \"visibility\": \"on\"\n },\n {\n \"weight\": \"0.25\"\n },\n {\n \"lightness\": \"80\"\n },\n {\n \"saturation\": \"10\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#bdcdd3\"\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#ffffff\"\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#39b6d3\"\n },\n {\n \"saturation\": \"-1\"\n },\n {\n \"lightness\": \"50\"\n }\n ]\n }\n ]\n };\n\n icons = {\n default: {\n url: \"/images/stellar.bank/marker.svg\",\n labelOrigin: {\n x: 9,\n y: 10\n }\n },\n active: {\n url: \"/images/stellar.bank/marker-active.svg\",\n labelOrigin: {\n x: 14,\n y: 16\n }\n },\n mine: {\n url: \"/images/stellar.bank/marker-start.svg\",\n labelOrigin: {\n x: 23,\n y: 22\n }\n }\n }\n\n // document.querySelector(\".map-display\")?.addEventListener(\"click\", toggleMapDisplay);\n document.querySelector(\".search-map\")?.addEventListener(\"submit\", submitForm);\n document.querySelector(\"#locate-me\")?.addEventListener(\"click\", htmlLocate);\n document.getElementById(\"map-inspector\")?.addEventListener(\"click\", mapInspectorClick);\n\n loadGapi();\n\n window.initMap = initMap;\n\n function loadMap() {\n const script = document.createElement(\"script\");\n script.src = `https://maps.googleapis.com/maps/api/js?key=${APIKey}&libraries=geometry&callback=initMap`;\n script.defer = true;\n document.head.appendChild(script);\n }\n\n function initMap() {\n infoWindow = new google.maps.InfoWindow();\n\n map = new google.maps.Map(document.getElementById(\"location-map\"), options);\n bounds = new google.maps.LatLngBounds();\n\n if (typeof myLocations === \"object\" && myLocations.length > 0) {\n let id = 0;\n myLocations.forEach((loc) => {\n if (!loc.latitude || !loc.longitude) return;\n\n addMarker(loc, id++, bounds);\n });\n\n setTimeout(() => {\n map.fitBounds(bounds);\n map.setCenter(bounds.getCenter());\n }, 250);\n }\n\n if (params.zip) {\n document.querySelector(\".search-map input\").value = params.zip;\n setTimeout(() => {\n submitForm();\n document.getElementById(\"location-map\").scrollIntoView(true);\n }, 400);\n } else {\n apiLocate();\n }\n\n }\n\n function addMarker(loc, id, bounds) {\n const marker = new google.maps.Marker({\n position: new google.maps.LatLng(loc.latitude, loc.longitude),\n map,\n title: loc.name,\n id: id,\n icon: icons.default,\n zIndex: 1,\n active: true\n });\n\n marker.locationInfo = {\n name: loc.name,\n address: loc.address,\n city: loc.city,\n state: loc.state,\n postal: loc.postalCode,\n phone: loc.phone,\n email: loc.email,\n link: loc.link,\n lobbyHours: loc.lobbyHours,\n driveThruHours: loc.driveThruHours,\n bankServices: loc.bankServices.split(\",\").map(v => v.trim()),\n atmServices: loc.atmServices.split(\",\").map(v => v.trim()),\n status: loc.status\n };\n\n const infoString = `\n
\n

${loc.name}

\n

${loc.address}
\n ${loc.city}, ${loc.state} ${loc.postalCode}

\n

\n More Details\n

\n
\n`;\n\n marker.addListener(\"click\", () => {\n infoWindow.close();\n infoWindow.setContent(infoString);\n infoWindow.open({\n anchor: marker,\n map: map,\n shouldFocus: true\n });\n setActiveMarker(marker);\n setInspectorBox(marker);\n });\n\n bounds.extend(marker.position);\n markers.push(marker);\n }\n\n function htmlLocate() {\n if (navigator.geolocation) {\n // Try HTML5 geolocation.\n navigator.geolocation.getCurrentPosition(\n function positionFound(position) {\n let pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n setZip(pos);\n setUserLocation(pos, true);\n },\n function positionError(error) {\n console?.log(error);\n apiLocate();\n });\n } else {\n // Browser doesn't support Geolocation\n apiLocate();\n }\n }\n\n function apiLocate() {\n fetch(`https://www.googleapis.com/geolocation/v1/geolocate?key=${APIKey}`, {\n method: \"POST\",\n headers: {\n \"Content-type\": \"application/json\"\n }\n })\n .then(response => response.json())\n .then(data => {\n let pos = new google.maps.LatLng(data.location);\n setZip(pos);\n setUserLocation(pos, true);\n })\n }\n\n function findNearest(pos) {\n markers.forEach(function setMarkerDistance(marker) {\n var markerDistance = google.maps.geometry.spherical.computeDistanceBetween(pos, marker.getPosition());\n marker.locationInfo.distance = getMiles(markerDistance);\n });\n markers.sort(function sortMarkers(a, b) {\n return a.locationInfo.distance - b.locationInfo.distance;\n });\n populateNearest();\n }\n\n function populateNearest(start) {\n const numberLocations = parseInt(document.querySelector(\"#location-map\").getAttribute(\"data-count\"));\n const results = isNaN(numberLocations) ? 10 : numberLocations;\n const mapInspector = document.getElementById(\"map-inspector\");\n const locationBoxes = mapInspector.querySelector(\".location-boxes\");\n const enabledMarkers = markers.filter(marker => marker.active);\n\n let nearbyMarkers, end;\n let html = \"\";\n\n infoWindow.close();\n\n if (isNaN(parseInt(start))) {\n start = 0;\n } else {\n start = parseInt(start);\n }\n\n if (start === 0) {\n bounds = new google.maps.LatLngBounds();\n markers.forEach(marker => {\n marker.setLabel(null);\n })\n }\n\n end = (start + results);\n\n if (end > enabledMarkers.length) {\n end = markers.length;\n }\n\n nearbyMarkers = enabledMarkers.slice(start, end);\n nearbyMarkers.forEach(function addVisibleMarkersToMap(marker, index) {\n marker.setLabel({\n text: String(start + index + 1),\n color: \"white\",\n fontSize: \"14px\",\n fontWeight: \"bold\"\n });\n bounds.extend(marker.position);\n });\n\n bounds.extend(myPosition.position);\n\n setTimeout(() => {\n map.fitBounds(bounds);\n }, 1);\n\n document.querySelector(\".no-results\")?.classList.remove(\"no-results\");\n\n if (nearbyMarkers.length > 0) {\n nearbyMarkers.forEach(function renderNearbyMarkerList(marker, index) {\n let info = marker.locationInfo;\n let displayNumber = start + index + 1;\n let statusClasses;\n\n switch (info.status) {\n case \"Open\":\n break;\n case \"Closed\":\n statusClasses = \"closed\";\n break;\n default:\n statusClasses = \"limited\";\n }\n\n let lobbyHours = info.lobbyHours ? (\"Lobby: \" + info.lobbyHours) : \"\";\n let driveThruHours = info.driveThruHours ? (\"Drive-Thru: \" + info.driveThruHours) : \"\";\n\n if (info.lobbyHours && info.driveThruHours) lobbyHours += \"
\"\n\n html += `\n
\n
\n ${displayNumber}\n
\n
\n
\n

${info.name}

\n
${info.distance.toFixed(1)} miles
\n
\n\n
\n

${info.address}
\n ${info.city}, ${info.state} ${info.postal}
\n Get Directions\n

\n
${info.status}
\n
\n\n

Hours of Operation

\n

\n ${lobbyHours}\n ${driveThruHours}\n

\n\n

\n Message Us\n ${info.phone}\n More Details\n

\n\n
\n
\n `;\n });\n\n if (end < enabledMarkers.length) {\n html += `\n
\n \n
\n `;\n }\n } else {\n html = `\n
No results
\n `;\n map.setZoom(9);\n }\n\n if (start === 0) {\n locationBoxes.innerHTML = html;\n } else {\n locationBoxes.innerHTML = locationBoxes.innerHTML + html;\n locationBoxes.scrollBy({\n top: 100,\n left: 0,\n behavior: 'smooth'\n });\n }\n\n }\n\n function setUserLocation(pos, isGeo, term) {\n map.setCenter(pos);\n\n if (myPosition) {\n myPosition.setPosition(pos);\n myPosition.setMap(map);\n } else {\n myPosition = new google.maps.Marker({\n position: pos,\n map: map,\n id: \"my-position\",\n icon: icons.mine,\n zIndex: 0\n });\n }\n\n if (term) {\n myPosition.term = term;\n }\n\n map.setZoom(12);\n findNearest(pos);\n }\n\n function setZip(pos) {\n var geocoder = new google.maps.Geocoder();\n\n geocoder.geocode({ \"location\": pos }, function geocodePosition(results, status) {\n if (status === \"OK\") {\n if (results[0]) {\n results[0].address_components.forEach(function eachAddressComponent(comp) {\n if (comp.types[0] === \"postal_code\") {\n document.querySelector(\".search-map input\").value = comp.long_name;\n document.getElementById(\"reset-map\").classList.remove(\"hidden\");\n }\n });\n } else {\n console?.log(\"Could not geocode coordinates.\");\n }\n } else {\n console?.log(\"Geocoder failed due to: \" + status);\n }\n });\n }\n\n function getMiles(meters) {\n return Number(meters) * 0.000621371192;\n }\n\n function getDirectionsLink(li) {\n var url = \"https://www.google.com/maps/dir/?api=1&destination=\";\n\n url += encodeURIComponent(li.address + \", \" + li.city + \", \" + li.state + \", \" + li.postal);\n url += \"&origin=\";\n if (myPosition.term) {\n url += encodeURIComponent(myPosition.term)\n } else if (myPosition) {\n url += encodeURIComponent(myPosition.getPosition().lat() + \",\" + myPosition.getPosition().lng());\n }\n return url;\n }\n\n function submitForm(e) {\n var geocoder = new google.maps.Geocoder();\n var address = document.querySelector(\".search-map input\").value;\n\n if (typeof e === \"object\") {\n e.preventDefault();\n }\n\n if (infoWindow) {\n infoWindow.close();\n }\n\n resetActiveMarker();\n\n if (address !== \"\") {\n geocoder.geocode({\n \"address\": address,\n \"componentRestrictions\": {\n \"country\": \"US\"\n }}, function gcc(results, status) {\n let errorMsg = document.getElementById(\"error-msg\");\n if (status == google.maps.GeocoderStatus.OK) {\n setUserLocation(results[0].geometry.location, false, address);\n errorMsg.textContent = \"\";\n errorMsg.classList.add(\"hidden\");\n } else if (status == google.maps.GeocoderStatus.ZERO_RESULTS) {\n errorMsg.textContent = \"No results found. Please try again.\";\n errorMsg.classList.remove(\"hidden\");\n } else {\n errorMsg.textContent = \"An error has occurred. Please try a different value.\";\n errorMsg.classList.remove(\"hidden\");\n console?.log(`Geocode Status: ${status}`);\n }\n });\n } else {\n map.setZoom(options.zoom);\n map.setCenter(new google.maps.LatLng(options.lat, options.long));\n }\n\n document.getElementById(\"reset-map\").classList.remove(\"hidden\");\n }\n\n/* function toggleMapDisplay(event) {\n event.preventDefault();\n if (event.target.tagName !== \"BUTTON\") return;\n\n let button = event.target;\n\n if (!button.classList.contains(\"active\")) {\n let sibling = button.nextElementSibling ? button.nextElementSibling : button.previousElementSibling;\n button.classList.add(\"active\");\n sibling.classList.remove(\"active\");\n\n let el = document.getElementById(event.target.getAttribute(\"rel\"));\n sibling = el.nextElementSibling ? el.nextElementSibling : el.previousElementSibling;\n el.classList.remove(\"hidden\");\n sibling.classList.add(\"hidden\");\n }\n } */\n\n function mapInspectorClick(event) {\n let el = event.target;\n let bounds = new google.maps.LatLngBounds();\n\n if (el.tagName === \"A\") return;\n\n if (el.id === \"loadMore\") {\n let start = el.getAttribute(\"data-start\");\n el.parentNode.remove();\n populateNearest(start);\n return;\n }\n\n if (!el.matches('.location-box')) {\n el = el.closest(\".location-box\");\n }\n\n if (!el || el.classList.contains(\"active\")) return;\n\n event.preventDefault();\n\n let markerId = parseInt(el.getAttribute(\"data-id\"));\n\n let chosenMarker = markers.find(obj => { return obj.id === markerId });\n\n bounds.extend(chosenMarker.position);\n bounds.extend(myPosition.position);\n\n map.fitBounds(bounds);\n\n google.maps.event.trigger(chosenMarker, 'click', {\n latLng: new google.maps.LatLng(0, 0)\n });\n }\n\n function setActiveMarker(marker) {\n if (activeMarker && activeMarker !== marker) {\n activeMarker.setIcon(icons.default);\n activeMarker.setZIndex(1);\n changeMarkerFontSize(activeMarker, \"14px\");\n }\n\n activeMarker = marker;\n\n activeMarker.setIcon(icons.active);\n activeMarker.setZIndex(10);\n changeMarkerFontSize(activeMarker, \"18px\");\n }\n\n function setInspectorBox(marker) {\n let box = document.querySelector(`.location-box[data-id=\"${marker.id}\"]`);\n\n if (!box) return;\n\n if (!box.classList.contains(\"active\")) {\n document.querySelectorAll(\".location-box.active\").forEach((box) => box.classList.remove(\"active\"));\n box.classList.add(\"active\");\n document.querySelector(\"#map-inspector\").scrollTo({\n top: box.offsetTop,\n behavior: \"smooth\"\n });\n }\n }\n\n function changeMarkerFontSize(marker, size) {\n if (!marker.getLabel()) return;\n\n let label = marker.getLabel();\n label.fontSize = size;\n marker.setLabel(label);\n }\n\n function resetActiveMarker() {\n if (activeMarker) {\n activeMarker.setIcon(icons.default);\n activeMarker.setZIndex(1);\n changeMarkerFontSize(activeMarker, \"14px\");\n }\n }\n\n /* Filter */\n if (document.querySelector(\".map-controls\")) {\n document.querySelectorAll(\".fake-select\")?.forEach((fakeSelect) => {\n fakeSelect.addEventListener(\"click\", openFilterBox);\n });\n document.querySelectorAll(\".filter-close\")?.forEach((fakeSelect) => {\n fakeSelect.addEventListener(\"click\", closeFilterBox);\n });\n document.getElementById(\"reset-map\")?.addEventListener(\"click\", resetMap);\n document.querySelectorAll(\"form.map-controls\").forEach((form) => {\n form.addEventListener(\"reset\", (event) => {\n setTimeout(() => {\n form.querySelectorAll(\".fake-select .count\").forEach(el => el.innerText = \"\");\n applyFilters(form);\n }, 0);\n });\n });\n }\n\n function openFilterBox(event) {\n event.preventDefault();\n let filterBox = this.parentElement.querySelector(\".filters-box\");\n document.querySelectorAll(\".filters-box\").forEach((element) => { element.classList.add(\"hidden\") });\n filterBox.classList.remove(\"hidden\");\n filterBox.querySelectorAll(\"input[type='checkbox']\")?.forEach(checkBox => {\n checkBox.prevState = checkBox.checked;\n });\n }\n\n function closeFilterBox(event) {\n event.preventDefault();\n let button = this;\n let box = button.closest(\".filters-box\");\n let select = box.parentNode.querySelector(\".fake-select\");\n let selectedCheckboxes = box.querySelectorAll(\"input:checked\");\n\n if (button.classList.contains(\"cancel\")) {\n box.querySelectorAll(\"input[type='checkbox']\")?.forEach(checkBox => {\n checkBox.checked = checkBox.prevState;\n delete checkBox.prevState;\n });\n box.classList.add(\"hidden\");\n return;\n }\n\n if (selectedCheckboxes.length > 0) {\n select.querySelector(\".count\").innerText = `(${selectedCheckboxes.length})`;\n } else {\n select.querySelector(\".count\").innerText = \"\";\n }\n applyFilters(this.closest(\"form\"));\n box.classList.add(\"hidden\");\n }\n\n function applyFilters(form) {\n let formData = new FormData(form);\n let formObj = serialize(formData);\n\n markers.map(marker => marker.active = true);\n\n if (Object.keys(formObj).length) {\n markers.map(marker => {\n let active = false;\n for (key in formObj) {\n if (marker?.locationInfo[key] && marker.locationInfo[key].some(v => formObj[key].includes(v))) {\n active = true;\n return; // Exit the loop if even one is active\n }\n }\n marker.active = active;\n return marker;\n });\n }\n\n populateNearest();\n }\n\n function resetMap(event) {\n let button = event.target;\n event.preventDefault();\n document.querySelector(\".location-boxes\").innerHTML = \"\";\n document.getElementById(\"map-container\")?.classList.add(\"no-results\");\n button.closest(\"form\").reset();\n button.classList.add(\"hidden\");\n infoWindow?.close();\n }\n\n function serialize(data) {\n let obj = {};\n for (let [key, value] of data) {\n if (obj[key] !== undefined) {\n obj[key].push(value);\n } else {\n obj[key] = [value];\n }\n }\n return obj;\n }\n\n /* Location data from google sheets */\n function loadGapi() {\n const script = document.createElement(\"script\");\n script.src = \"https://apis.google.com/js/api.js\";\n script.async = true;\n // script.defer = true;\n script.onload = () => {\n gapi.load(\"client\", getSheetData)\n };\n document.head.appendChild(script);\n }\n\n function getSheetData() {\n const SHEETAPIKEY = \"AIzaSyAE-7Nmyo9EpqeXTAT0becj7wGI-sc7b_g\";\n const SHEETID = \"1u25CPlFZDkUxVXueS6isB8wIJWHbgBY_cnZMePy9gJg\";\n\n gapi.client.init({\n \"apiKey\": SHEETAPIKEY\n }).then(() => {\n return gapi.client.request({\n \"path\": \"https://sheets.googleapis.com/v4/spreadsheets/\" + SHEETID + \"/values/Locations!A2:Z\"\n });\n }).then(response => {\n if (response.result?.values.length > 0) {\n response.result.values.forEach(location => {\n let thisLocation = myLocations.find(m => m.name.includes(location[0]));\n if (thisLocation) {\n thisLocation.phone = location[1];\n thisLocation.lobbyHours = shortenHours(location[2]);\n thisLocation.driveThruHours = shortenHours(location[3]);\n thisLocation.status = location[4];\n }\n });\n loadMap();\n }\n }, reason => {\n if (typeof reason === \"object\" && reason.result) {\n console.error && console.error(\"Error: \" + reason.result.error.message);\n } else {\n console.error && console.error(reason);\n }\n });\n }\n\n function shortenHours(hours) {\n let newHours;\n newHours = hours.replaceAll(\"Monday\",\"Mon\");\n newHours = newHours.replaceAll(\"Tuesday\", \"Tue\");\n newHours = newHours.replaceAll(\"Wednesday\", \"Wed\");\n newHours = newHours.replaceAll(\"Thursday\", \"Thu\");\n newHours = newHours.replaceAll(\"Friday\", \"Fri\");\n newHours = newHours.replaceAll(\"Saturday\", \"Sat\");\n newHours = newHours.replaceAll(\"Sunday\", \"Sun\");\n newHours = newHours.replaceAll(\":00 \", \"\");\n newHours = newHours.replaceAll(\":30 \", \":30\");\n return newHours;\n }\n}\n", "if (document.querySelector(\"[data-locations='status']\")) {\n const script = document.createElement(\"script\");\n script.src = \"https://apis.google.com/js/api.js\";\n script.async = true;\n script.defer = true;\n script.onload = () => {\n gapi.load(\"client\", getSheetData)\n };\n document.head.appendChild(script);\n\n function getSheetData() {\n const SHEETAPIKEY = \"AIzaSyAE-7Nmyo9EpqeXTAT0becj7wGI-sc7b_g\";\n const SHEETID = \"1u25CPlFZDkUxVXueS6isB8wIJWHbgBY_cnZMePy9gJg\";\n\n let sheetData = [];\n\n gapi.client.init({\n \"apiKey\": SHEETAPIKEY\n }).then(() => {\n return gapi.client.request({\n \"path\": \"https://sheets.googleapis.com/v4/spreadsheets/\" + SHEETID + \"/values/Locations!A2:Z\"\n });\n }).then(response => {\n if (response.result?.values.length > 0) {\n response.result.values.forEach(sheetLocation => {\n sheetData.push([sheetLocation[0], sheetLocation[4]]);\n });\n }\n }, reason => {\n if (typeof reason === \"object\" && reason.result) {\n console.error && console.error(\"Error: \" + reason.result.error.message);\n } else {\n console.error && console.error(reason);\n }\n }).then(() => {\n let tables = document.querySelectorAll(\"[data-locations='status'] tbody\");\n let split = Math.ceil(sheetData.length / tables.length);\n\n tables.forEach((locationsTable, idx) => {\n let start = split * idx;\n let end = split * (idx + 1);\n\n for (let i = start; i < end; i++) {\n if (!sheetData[i]) return;\n\n let bankName = sheetData[i][0];\n let bankStatus = sheetData[i][1]\n let statusClass;\n\n switch (bankStatus) {\n case \"Closed\":\n statusClass = \"bg-tertiary-4 text-white\";\n break;\n case \"Open\":\n statusClass = \"bg-secondary-1 bg-opacity-30\";\n break;\n default:\n statusClass = \"bg-secondary-2\";\n }\n\n locationsTable.innerHTML += `\n \n ${bankName}\n ${bankStatus}\n \n `;\n }\n });\n });\n }\n}\n", "const isExternalURL = (url) => {\n if (url.startsWith(\"javascript:\")) {\n return false;\n }\n\n if (url.startsWith(\"tel:\")) {\n return false;\n }\n\n if (url.startsWith(\"mailto:\")) {\n return false;\n }\n\n const origin = new URL(url).origin;\n if (origin === \"https://onlinebanking.stellar.bank\") {\n return false;\n }\n\n return origin !== location.origin;\n};\n\nwindow.addEventListener(\"DOMContentLoaded\", () => {\n const speedbump = document.getElementById(\"speedbump\");\n const confirmButton = speedbump.querySelector(`button[type=\"submit\"]`);\n const safeLink = speedbump.querySelector(`.safe`);\n\n // Intercepts clicks on external links and shows the speedbump modal.\n window.addEventListener(\"click\", function(event) {\n const link = event.target;\n const { href } = link;\n if (!href) return true;\n if (link.closest(\".mce-content-body\")) return true;\n if (!isExternalURL(href)) return true;\n if (link.classList.contains(\"safe\")) return true;\n\n event.preventDefault();\n\n confirmButton.value = href;\n // Hides submit button and shows safe link.\n confirmButton.classList.add(\"hidden\");\n safeLink.href = href;\n safeLink.setAttribute(\"target\", link.getAttribute(\"target\"));\n safeLink.setAttribute(\"rel\", link.getAttribute(\"rel\"));\n safeLink.classList.remove(\"hidden\");\n\n speedbump.showModal();\n });\n\n safeLink.addEventListener(\"click\", function(event) {\n confirmButton.form.submit();\n });\n\n // \"Confirm\" button of form triggers \"close\" on dialog because of [method=\"dialog\"]\n speedbump.addEventListener(\"close\", () => {\n const value = speedbump.returnValue;\n confirmButton.value = \"\";\n\n // Hides safe link and shows submit button.\n safeLink.classList.add(\"hidden\");\n safeLink.href = \"\";\n safeLink.removeAttribute(\"target\");\n safeLink.removeAttribute(\"rel\");\n\n confirmButton.classList.remove(\"hidden\");\n });\n\n});\n", "function getUrlParameter(name) {\n name = name.replace(/[\\[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\n const regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');\n const results = regex.exec(location.search);\n return results === null ? '' : results[1];\n};\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n const q = getUrlParameter(\"q\").replace(\" \", \"+\");\n let start = getUrlParameter(\"start\");\n if (start === \"\") start = \"1\";\n\n const resultsDiv = document.getElementById(\"searchResults\");\n if (!resultsDiv) return;\n\n fetch(\"https://icctemzx4l.execute-api.us-west-2.amazonaws.com/default/GoogleCSEGateway?q=\"+q+\"&start=\"+start+\"&s=stellar\")\n .then(function (response) {\n return response.text();\n })\n .then(function(response) {\n console.log(response);\n resultsDiv.innerHTML = response;\n })\n .catch(function (err) {\n // If an error occured, you will catch it here\n });\n\n});", "import cssHasPseudo from \"../../node_modules/css-has-pseudo/dist/browser.mjs\";\nimport \"./imports.js\";\nimport \"./calculators.js\";\nimport \"./filters.js\";\nimport \"./modals.js\";\n\ncssHasPseudo(document);\n", "const $ = (selector, parent = document) => parent.querySelector(selector);\nconst $$ = (selector, parent = document) => parent.querySelectorAll(selector);\n\n/**\n * This module provides a generic approach to filtering items based on\n * form submissions, specifially the querystring.\n *\n * Instead of listening to \"change\" event on various inputs to try to\n * figure out the filters, we let the form submit and use the resulting\n * querystring as filter. The querystring provides an \"AND\" filter, so\n * we can just check for items against all the filters.\n *\n * This is also more flexible, as it can also let the user bookmark the\n * URL for specific filters. The form can also has \"dialog\" `method` that\n * only saves the form data without sending, so we can listen to \"submit\"\n * event to filter when we want to avoid page reload.\n */\n\n/**\n * Filters an item list based on the current URL search parameters.\n *\n * This assumes that the items have a `data-` attribute for each search\n * parameter, and they are siblings of each other.\n *\n * The search parameters can be set either by a GET form submission, or\n * by converting FormData to URLSearchParams.\n * @param {URLSearchParams} searchParams\n */\nfunction filter(searchParams = new URL(location.href).searchParams) {\n let itemSelector = \"\", filterSelector = \"\";\n for (const [name, value] of searchParams) {\n if (itemSelector) itemSelector += \",\";\n itemSelector += `[data-${name}]`;\n if (value) {\n filterSelector += `[data-${name}*=\"${value}\"]`;\n }\n\n // Sets selected value for matching inputs, including `