{"version":3,"file":"themes/buildforce/assets/js/dist/theme.min.js","sources":["node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","node_modules/@babel/runtime/helpers/esm/slicedToArray.js","node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","node_modules/clipboard/dist/clipboard.js","themes/buildforce/assets/js/src/theme/delegate-event.js","themes/buildforce/assets/js/src/theme/determine-target.js","node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","node_modules/@babel/runtime/helpers/esm/iterableToArray.js","node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","themes/buildforce/assets/js/src/theme/is-focusable.js","themes/buildforce/assets/js/src/theme/toggle-element.js","themes/buildforce/assets/js/src/theme/get-new-index.js","themes/buildforce/assets/js/src/theme/focus-trap.js","node_modules/@babel/runtime/helpers/esm/typeof.js","node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","node_modules/@babel/runtime/helpers/esm/toPrimitive.js","node_modules/@babel/runtime/helpers/esm/defineProperty.js","node_modules/@babel/runtime/helpers/esm/classCallCheck.js","node_modules/@babel/runtime/helpers/esm/createClass.js","themes/buildforce/assets/js/src/theme/history-storage.js","themes/buildforce/assets/js/src/theme/modals.js","themes/buildforce/assets/js/src/theme/element-animation.js","themes/buildforce/assets/js/src/theme/carousels.js","themes/buildforce/assets/js/src/theme/dropdown.js","themes/buildforce/assets/js/src/theme/autocomplete-dropdown.js","themes/buildforce/assets/js/src/theme/share-button.js","themes/buildforce/assets/js/src/theme/ajax-directory.js","themes/buildforce/assets/js/src/theme.js","themes/buildforce/assets/js/src/theme/tabs.js","themes/buildforce/assets/js/src/theme/accordions.js"],"sourcesContent":["export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","/*!\n * clipboard.js v2.0.11\n * https://clipboardjs.com/\n *\n * Licensed MIT © Zeno Rocha\n */\n(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[\"ClipboardJS\"] = factory();\n\telse\n\t\troot[\"ClipboardJS\"] = factory();\n})(this, function() {\nreturn /******/ (function() { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 686:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"default\": function() { return /* binding */ clipboard; }\n});\n\n// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js\nvar tiny_emitter = __webpack_require__(279);\nvar tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);\n// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js\nvar listen = __webpack_require__(370);\nvar listen_default = /*#__PURE__*/__webpack_require__.n(listen);\n// EXTERNAL MODULE: ./node_modules/select/src/select.js\nvar src_select = __webpack_require__(817);\nvar select_default = /*#__PURE__*/__webpack_require__.n(src_select);\n;// CONCATENATED MODULE: ./src/common/command.js\n/**\n * Executes a given operation type.\n * @param {String} type\n * @return {Boolean}\n */\nfunction command(type) {\n try {\n return document.execCommand(type);\n } catch (err) {\n return false;\n }\n}\n;// CONCATENATED MODULE: ./src/actions/cut.js\n\n\n/**\n * Cut action wrapper.\n * @param {String|HTMLElement} target\n * @return {String}\n */\n\nvar ClipboardActionCut = function ClipboardActionCut(target) {\n var selectedText = select_default()(target);\n command('cut');\n return selectedText;\n};\n\n/* harmony default export */ var actions_cut = (ClipboardActionCut);\n;// CONCATENATED MODULE: ./src/common/create-fake-element.js\n/**\n * Creates a fake textarea element with a value.\n * @param {String} value\n * @return {HTMLElement}\n */\nfunction createFakeElement(value) {\n var isRTL = document.documentElement.getAttribute('dir') === 'rtl';\n var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS\n\n fakeElement.style.fontSize = '12pt'; // Reset box model\n\n fakeElement.style.border = '0';\n fakeElement.style.padding = '0';\n fakeElement.style.margin = '0'; // Move element out of screen horizontally\n\n fakeElement.style.position = 'absolute';\n fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically\n\n var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n fakeElement.style.top = \"\".concat(yPosition, \"px\");\n fakeElement.setAttribute('readonly', '');\n fakeElement.value = value;\n return fakeElement;\n}\n;// CONCATENATED MODULE: ./src/actions/copy.js\n\n\n\n/**\n * Create fake copy action wrapper using a fake element.\n * @param {String} target\n * @param {Object} options\n * @return {String}\n */\n\nvar fakeCopyAction = function fakeCopyAction(value, options) {\n var fakeElement = createFakeElement(value);\n options.container.appendChild(fakeElement);\n var selectedText = select_default()(fakeElement);\n command('copy');\n fakeElement.remove();\n return selectedText;\n};\n/**\n * Copy action wrapper.\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @return {String}\n */\n\n\nvar ClipboardActionCopy = function ClipboardActionCopy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n var selectedText = '';\n\n if (typeof target === 'string') {\n selectedText = fakeCopyAction(target, options);\n } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {\n // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n selectedText = fakeCopyAction(target.value, options);\n } else {\n selectedText = select_default()(target);\n command('copy');\n }\n\n return selectedText;\n};\n\n/* harmony default export */ var actions_copy = (ClipboardActionCopy);\n;// CONCATENATED MODULE: ./src/actions/default.js\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\n\n/**\n * Inner function which performs selection from either `text` or `target`\n * properties and then executes copy or cut operations.\n * @param {Object} options\n */\n\nvar ClipboardActionDefault = function ClipboardActionDefault() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Defines base properties passed from constructor.\n var _options$action = options.action,\n action = _options$action === void 0 ? 'copy' : _options$action,\n container = options.container,\n target = options.target,\n text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.\n\n if (action !== 'copy' && action !== 'cut') {\n throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n } // Sets the `target` property using an element that will be have its content copied.\n\n\n if (target !== undefined) {\n if (target && _typeof(target) === 'object' && target.nodeType === 1) {\n if (action === 'copy' && target.hasAttribute('disabled')) {\n throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n }\n\n if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n }\n } else {\n throw new Error('Invalid \"target\" value, use a valid Element');\n }\n } // Define selection strategy based on `text` property.\n\n\n if (text) {\n return actions_copy(text, {\n container: container\n });\n } // Defines which selection strategy based on `target` property.\n\n\n if (target) {\n return action === 'cut' ? actions_cut(target) : actions_copy(target, {\n container: container\n });\n }\n};\n\n/* harmony default export */ var actions_default = (ClipboardActionDefault);\n;// CONCATENATED MODULE: ./src/clipboard.js\nfunction clipboard_typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return clipboard_typeof(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\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n/**\n * Helper function to retrieve attribute value.\n * @param {String} suffix\n * @param {Element} element\n */\n\nfunction getAttributeValue(suffix, element) {\n var attribute = \"data-clipboard-\".concat(suffix);\n\n if (!element.hasAttribute(attribute)) {\n return;\n }\n\n return element.getAttribute(attribute);\n}\n/**\n * Base class which takes one or more elements, adds event listeners to them,\n * and instantiates a new `ClipboardAction` on each click.\n */\n\n\nvar Clipboard = /*#__PURE__*/function (_Emitter) {\n _inherits(Clipboard, _Emitter);\n\n var _super = _createSuper(Clipboard);\n\n /**\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n * @param {Object} options\n */\n function Clipboard(trigger, options) {\n var _this;\n\n _classCallCheck(this, Clipboard);\n\n _this = _super.call(this);\n\n _this.resolveOptions(options);\n\n _this.listenClick(trigger);\n\n return _this;\n }\n /**\n * Defines if attributes would be resolved using internal setter functions\n * or custom functions that were passed in the constructor.\n * @param {Object} options\n */\n\n\n _createClass(Clipboard, [{\n key: \"resolveOptions\",\n value: function resolveOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;\n }\n /**\n * Adds a click event listener to the passed trigger.\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n */\n\n }, {\n key: \"listenClick\",\n value: function listenClick(trigger) {\n var _this2 = this;\n\n this.listener = listen_default()(trigger, 'click', function (e) {\n return _this2.onClick(e);\n });\n }\n /**\n * Defines a new `ClipboardAction` on each click event.\n * @param {Event} e\n */\n\n }, {\n key: \"onClick\",\n value: function onClick(e) {\n var trigger = e.delegateTarget || e.currentTarget;\n var action = this.action(trigger) || 'copy';\n var text = actions_default({\n action: action,\n container: this.container,\n target: this.target(trigger),\n text: this.text(trigger)\n }); // Fires an event based on the copy operation result.\n\n this.emit(text ? 'success' : 'error', {\n action: action,\n text: text,\n trigger: trigger,\n clearSelection: function clearSelection() {\n if (trigger) {\n trigger.focus();\n }\n\n window.getSelection().removeAllRanges();\n }\n });\n }\n /**\n * Default `action` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultAction\",\n value: function defaultAction(trigger) {\n return getAttributeValue('action', trigger);\n }\n /**\n * Default `target` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultTarget\",\n value: function defaultTarget(trigger) {\n var selector = getAttributeValue('target', trigger);\n\n if (selector) {\n return document.querySelector(selector);\n }\n }\n /**\n * Allow fire programmatically a copy action\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @returns Text copied.\n */\n\n }, {\n key: \"defaultText\",\n\n /**\n * Default `text` lookup function.\n * @param {Element} trigger\n */\n value: function defaultText(trigger) {\n return getAttributeValue('text', trigger);\n }\n /**\n * Destroy lifecycle.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.listener.destroy();\n }\n }], [{\n key: \"copy\",\n value: function copy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n return actions_copy(target, options);\n }\n /**\n * Allow fire programmatically a cut action\n * @param {String|HTMLElement} target\n * @returns Text cutted.\n */\n\n }, {\n key: \"cut\",\n value: function cut(target) {\n return actions_cut(target);\n }\n /**\n * Returns the support of the given action, or all actions if no action is\n * given.\n * @param {String} [action]\n */\n\n }, {\n key: \"isSupported\",\n value: function isSupported() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n var actions = typeof action === 'string' ? [action] : action;\n var support = !!document.queryCommandSupported;\n actions.forEach(function (action) {\n support = support && !!document.queryCommandSupported(action);\n });\n return support;\n }\n }]);\n\n return Clipboard;\n}((tiny_emitter_default()));\n\n/* harmony default export */ var clipboard = (Clipboard);\n\n/***/ }),\n\n/***/ 828:\n/***/ (function(module) {\n\nvar DOCUMENT_NODE_TYPE = 9;\n\n/**\n * A polyfill for Element.matches()\n */\nif (typeof Element !== 'undefined' && !Element.prototype.matches) {\n var proto = Element.prototype;\n\n proto.matches = proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector;\n}\n\n/**\n * Finds the closest parent that matches a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @return {Function}\n */\nfunction closest (element, selector) {\n while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {\n if (typeof element.matches === 'function' &&\n element.matches(selector)) {\n return element;\n }\n element = element.parentNode;\n }\n}\n\nmodule.exports = closest;\n\n\n/***/ }),\n\n/***/ 438:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar closest = __webpack_require__(828);\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction _delegate(element, selector, type, callback, useCapture) {\n var listenerFn = listener.apply(this, arguments);\n\n element.addEventListener(type, listenerFn, useCapture);\n\n return {\n destroy: function() {\n element.removeEventListener(type, listenerFn, useCapture);\n }\n }\n}\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element|String|Array} [elements]\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(elements, selector, type, callback, useCapture) {\n // Handle the regular Element usage\n if (typeof elements.addEventListener === 'function') {\n return _delegate.apply(null, arguments);\n }\n\n // Handle Element-less usage, it defaults to global delegation\n if (typeof type === 'function') {\n // Use `document` as the first parameter, then apply arguments\n // This is a short way to .unshift `arguments` without running into deoptimizations\n return _delegate.bind(null, document).apply(null, arguments);\n }\n\n // Handle Selector-based usage\n if (typeof elements === 'string') {\n elements = document.querySelectorAll(elements);\n }\n\n // Handle Array-like based usage\n return Array.prototype.map.call(elements, function (element) {\n return _delegate(element, selector, type, callback, useCapture);\n });\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n return function(e) {\n e.delegateTarget = closest(e.target, selector);\n\n if (e.delegateTarget) {\n callback.call(element, e);\n }\n }\n}\n\nmodule.exports = delegate;\n\n\n/***/ }),\n\n/***/ 879:\n/***/ (function(__unused_webpack_module, exports) {\n\n/**\n * Check if argument is a HTML element.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.node = function(value) {\n return value !== undefined\n && value instanceof HTMLElement\n && value.nodeType === 1;\n};\n\n/**\n * Check if argument is a list of HTML elements.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.nodeList = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return value !== undefined\n && (type === '[object NodeList]' || type === '[object HTMLCollection]')\n && ('length' in value)\n && (value.length === 0 || exports.node(value[0]));\n};\n\n/**\n * Check if argument is a string.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.string = function(value) {\n return typeof value === 'string'\n || value instanceof String;\n};\n\n/**\n * Check if argument is a function.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.fn = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return type === '[object Function]';\n};\n\n\n/***/ }),\n\n/***/ 370:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar is = __webpack_require__(879);\nvar delegate = __webpack_require__(438);\n\n/**\n * Validates all params and calls the right\n * listener function based on its target type.\n *\n * @param {String|HTMLElement|HTMLCollection|NodeList} target\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listen(target, type, callback) {\n if (!target && !type && !callback) {\n throw new Error('Missing required arguments');\n }\n\n if (!is.string(type)) {\n throw new TypeError('Second argument must be a String');\n }\n\n if (!is.fn(callback)) {\n throw new TypeError('Third argument must be a Function');\n }\n\n if (is.node(target)) {\n return listenNode(target, type, callback);\n }\n else if (is.nodeList(target)) {\n return listenNodeList(target, type, callback);\n }\n else if (is.string(target)) {\n return listenSelector(target, type, callback);\n }\n else {\n throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');\n }\n}\n\n/**\n * Adds an event listener to a HTML element\n * and returns a remove listener function.\n *\n * @param {HTMLElement} node\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNode(node, type, callback) {\n node.addEventListener(type, callback);\n\n return {\n destroy: function() {\n node.removeEventListener(type, callback);\n }\n }\n}\n\n/**\n * Add an event listener to a list of HTML elements\n * and returns a remove listener function.\n *\n * @param {NodeList|HTMLCollection} nodeList\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNodeList(nodeList, type, callback) {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.addEventListener(type, callback);\n });\n\n return {\n destroy: function() {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.removeEventListener(type, callback);\n });\n }\n }\n}\n\n/**\n * Add an event listener to a selector\n * and returns a remove listener function.\n *\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenSelector(selector, type, callback) {\n return delegate(document.body, selector, type, callback);\n}\n\nmodule.exports = listen;\n\n\n/***/ }),\n\n/***/ 817:\n/***/ (function(module) {\n\nfunction select(element) {\n var selectedText;\n\n if (element.nodeName === 'SELECT') {\n element.focus();\n\n selectedText = element.value;\n }\n else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {\n var isReadOnly = element.hasAttribute('readonly');\n\n if (!isReadOnly) {\n element.setAttribute('readonly', '');\n }\n\n element.select();\n element.setSelectionRange(0, element.value.length);\n\n if (!isReadOnly) {\n element.removeAttribute('readonly');\n }\n\n selectedText = element.value;\n }\n else {\n if (element.hasAttribute('contenteditable')) {\n element.focus();\n }\n\n var selection = window.getSelection();\n var range = document.createRange();\n\n range.selectNodeContents(element);\n selection.removeAllRanges();\n selection.addRange(range);\n\n selectedText = selection.toString();\n }\n\n return selectedText;\n}\n\nmodule.exports = select;\n\n\n/***/ }),\n\n/***/ 279:\n/***/ (function(module) {\n\nfunction E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(__webpack_module_cache__[moduleId]) {\n/******/ \t\t\treturn __webpack_module_cache__[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/compat get default export */\n/******/ \t!function() {\n/******/ \t\t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t\t__webpack_require__.n = function(module) {\n/******/ \t\t\tvar getter = module && module.__esModule ?\n/******/ \t\t\t\tfunction() { return module['default']; } :\n/******/ \t\t\t\tfunction() { return module; };\n/******/ \t\t\t__webpack_require__.d(getter, { a: getter });\n/******/ \t\t\treturn getter;\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t!function() {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = function(exports, definition) {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t!function() {\n/******/ \t\t__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }\n/******/ \t}();\n/******/ \t\n/************************************************************************/\n/******/ \t// module exports must be returned from runtime so entry inlining is disabled\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(686);\n/******/ })()\n.default;\n});","export default function delegateEventListener( eventName, selector, callback ) {\n\tdocument.addEventListener( eventName, event => {\n\t\tlet trigger = event.target;\n\t\tif ( ! trigger.matches( selector ) ) {\n\t\t\ttrigger = trigger.closest( selector );\n\t\t}\n\n\t\tif ( ! trigger ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcallback( event, trigger );\n\t} );\n}\n","export default function determineTarget( element ) {\n\tconst target = element.dataset.target ?? element.getAttribute( 'aria-controls' );\n\treturn document.getElementById( target );\n}\n","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","const computedElementStyles = new WeakMap();\n\nexport const FOCUSABLES_SELECTOR = 'a[href], button, input, select, textarea, details, [tabindex]';\n\nexport function isElementFocusable( element ) {\n\tif ( element.disabled ) {\n\t\treturn false;\n\t}\n\n\tif ( element.tabIndex < 0 ) {\n\t\treturn false;\n\t}\n\n\tif ( element.getAttribute( 'aria-selected' ) === 'false' ) {\n\t\treturn false;\n\t}\n\n\tif ( element.style.display === 'none' ) {\n\t\treturn false;\n\t}\n\n\tif ( element.style.visibility === 'hidden' ) {\n\t\treturn false;\n\t}\n\n\tif ( element.style.position !== 'fixed' && ! element.offsetParent ) {\n\t\treturn false;\n\t}\n\n\t// Last check, visibility\n\tlet computedStyle = computedElementStyles.get( element );\n\tif ( ! computedStyle ) {\n\t\tcomputedStyle = getComputedStyle( element );\n\t\t// Cache the computed style, since it's live and\n\t\t// getComputedStyle returns a new object each time\n\t\tcomputedElementStyles.set( element, computedStyle );\n\t}\n\n\tif ( computedStyle.visibility === 'hidden' ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n","import { FOCUSABLES_SELECTOR, isElementFocusable } from './is-focusable';\n\nlet modalIndex = 10;\nexport default function toggleElement( elementOrId, show, focus ) {\n\tif ( ! elementOrId ) {\n\t\treturn;\n\t}\n\n\tlet target, targetId;\n\tif ( typeof elementOrId === 'string' ) {\n\t\ttargetId = elementOrId;\n\t\ttarget = document.getElementById( targetId );\n\t} else {\n\t\ttarget = elementOrId;\n\t\ttargetId = target.id;\n\t}\n\n\tif ( ! target ) {\n\t\treturn;\n\t}\n\n\t// Get the controls for this element\n\tconst controls = document.querySelectorAll( `[aria-controls=\"${ targetId }\"], [data-target=\"${ targetId }\"]` );\n\n\tif ( typeof show === 'undefined' || show === null ) {\n\t\t// Toggle based on target's hidden status\n\t\tshow = target.getAttribute( 'aria-hidden' ) === 'true';\n\t}\n\n\t// Update the controls if applicable\n\tcontrols.forEach( control => {\n\t\tif ( control.hasAttribute( 'aria-expanded' ) ) {\n\t\t\tcontrol.setAttribute( 'aria-expanded', show );\n\t\t}\n\t\tif ( control.hasAttribute( 'aria-selected' ) ) {\n\t\t\tcontrol.tabIndex = show ? null : -1;\n\t\t\tcontrol.setAttribute( 'aria-selected', show );\n\t\t}\n\t} );\n\n\t// Hide/show the target\n\ttarget.setAttribute( 'aria-hidden', ! show );\n\tif ( show && focus ) {\n\t\tif ( target.getAttribute( 'role' ) === 'dialog' ) {\n\t\t\t// If it's a modal, update the z-index to the next level up\n\t\t\ttarget.style.zIndex = ++modalIndex;\n\t\t}\n\n\t\tconst autofocus = [ ...target.querySelectorAll( '[autofocus]' ) ].find( isElementFocusable );\n\n\t\t// If target contains an autofocus element, focus that\n\t\tif ( autofocus ) {\n\t\t\tautofocus.focus();\n\n\t\t\t// If target itself is meant to be focused (is tabble or has explicit tabindex)\n\t\t} else if ( target.tabIndex > 0 || target.hasAttribute( 'tabindex' ) ) {\n\t\t\ttarget.focus();\n\t\t} else {\n\t\t\t// Find the first focusable element within and focus that\n\t\t\tconst focusable = [ ...target.querySelectorAll( FOCUSABLES_SELECTOR ) ].find( isElementFocusable );\n\t\t\tif ( focusable ) {\n\t\t\t\tfocusable.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// Trigger event for target ID\n\tconst event = new CustomEvent( `toggle-${ show ? 'on' : 'off' }`, {\n\t\tbubbles: true,\n\t} );\n\ttarget.dispatchEvent( event );\n\n\treturn show;\n}\n","export default function getNewIndex( current, total, delta ) {\n\tif ( typeof delta === 'boolean' ) {\n\t\tdelta = delta ? 1 : -1;\n\t}\n\n\tcurrent += delta;\n\tif ( delta > 0 && current > total - 1 ) {\n\t\tcurrent = 0;\n\t}\n\tif ( delta < 0 && current < 0 ) {\n\t\tcurrent = total - 1;\n\t}\n\n\treturn current;\n}\n","import { FOCUSABLES_SELECTOR, isElementFocusable } from './is-focusable';\nimport getNewIndex from './get-new-index';\n\nexport default function setupFocusTrap(\n\tcontainer,\n\tfocusables = FOCUSABLES_SELECTOR,\n\toptions = {},\n\tcallback = null,\n) {\n\tif ( typeof focusables === 'boolean' ) {\n\t\toptions = focusables;\n\t\tfocusables = FOCUSABLES_SELECTOR;\n\t}\n\tif ( typeof focusables === 'function' ) {\n\t\tcallback = focusables;\n\t\tfocusables = FOCUSABLES_SELECTOR;\n\t}\n\tif ( typeof options === 'function' ) {\n\t\tcallback = options;\n\t\toptions = false;\n\t}\n\n\tif ( focusables instanceof NodeList ) {\n\t\tfocusables = [ ...focusables ];\n\t}\n\n\tfunction handleFocus( target, event, possibleTargets ) {\n\t\t// Allow trap to be only active sometimes\n\t\tif ( typeof options.ignoreCondition === 'function' &&\n\t\t\toptions.ignoreCondition( event, target, possibleTargets ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst index = possibleTargets.indexOf( target );\n\n\t\tlet newIndex;\n\t\tif ( options.arrowKeys ) {\n\t\t\tswitch ( event.key ) {\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tif ( ! options.leftRightOnly ) {\n\t\t\t\t\t\tnewIndex = getNewIndex( index, possibleTargets.length, -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ArrowLeft':\n\t\t\t\t\tif ( ! options.upDownOnly ) {\n\t\t\t\t\t\tnewIndex = getNewIndex( index, possibleTargets.length, -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tif ( ! options.leftRightOnly ) {\n\t\t\t\t\t\tnewIndex = getNewIndex( index, possibleTargets.length, 1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ArrowRight':\n\t\t\t\t\tif ( ! options.upDownOnly ) {\n\t\t\t\t\t\tnewIndex = getNewIndex( index, possibleTargets.length, 1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Home':\n\t\t\t\t\tnewIndex = 0;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'End':\n\t\t\t\t\tnewIndex = possibleTargets.length - 1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if ( event.key === 'Tab' ) {\n\t\t\tnewIndex = getNewIndex( index, possibleTargets.length, ! event.shiftKey );\n\t\t}\n\n\t\tif ( typeof newIndex !== 'undefined' ) {\n\t\t\tevent.preventDefault();\n\t\t\tpossibleTargets[ newIndex ].focus();\n\t\t\tif ( typeof callback === 'function' ) {\n\t\t\t\tcallback( possibleTargets[ newIndex ] );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( typeof focusables === 'string' ) {\n\t\tcontainer.addEventListener( 'keydown', event => {\n\t\t\t// Check that target is a focusable element within the container\n\t\t\tif ( event.target !== container && event.target.matches( focusables ) ) {\n\t\t\t\tlet elements = [ ...container.querySelectorAll( focusables ) ];\n\t\t\t\tif ( ! options.assumeFocusable ) {\n\t\t\t\t\telements = elements.filter( isElementFocusable );\n\t\t\t\t}\n\n\t\t\t\thandleFocus( event.target, event, elements );\n\t\t\t}\n\t\t} );\n\t} else {\n\t\tfocusables.forEach( element => {\n\t\t\telement.addEventListener( 'keydown', event => {\n\t\t\t\tlet elements = focusables;\n\t\t\t\tif ( ! options.assumeFocusable ) {\n\t\t\t\t\telements = elements.filter( isElementFocusable );\n\t\t\t\t}\n\n\t\t\t\thandleFocus( event.target, event, elements );\n\t\t\t} );\n\t\t} );\n\t}\n}\n","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : String(i);\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","class HistoryStorage {\n\t#state = {}\n\n\tconstructor() {\n\t\tthis.state = history.state || {};\n\t}\n\n\tgetItem( key ) {\n\t\treturn this.state[ key ] ?? null;\n\t}\n\n\tsetItem( key, value ) {\n\t\tthis.state = {\n\t\t\t...history.state,\n\t\t\t[ key ]: value,\n\t\t};\n\n\t\tconst uri = location.href.substring( location.origin.length );\n\n\t\thistory.replaceState( this.state, '', uri );\n\t}\n}\n\nexport default new HistoryStorage();\n","import determineTarget from './determine-target';\nimport setupFocusTrap from './focus-trap';\nimport toggleElement from './toggle-element';\n\nconst modalTriggers = new WeakMap();\n\nexport default function setupModals() {\n\t// Initialize all dialog elements\n\tdocument.querySelectorAll( '.js-modal' ).forEach( dialog => {\n\t\t// Set necessary attributes\n\t\tdialog.tabIndex = -1;\n\t\tdialog.setAttribute( 'role', 'dialog' );\n\t\tdialog.setAttribute( 'aria-hidden', true );\n\n\t\t// Trap focus within\n\t\tsetupFocusTrap( dialog );\n\t} );\n\n\t// Handle opening the modal from a button that controls it\n\tdocument.addEventListener( 'click', event => {\n\t\tconst toggle = event.target.closest( '[aria-controls], [data-target]' );\n\n\t\t// Skip if it doesn't control anything\n\t\tif ( ! toggle || ( ! toggle.hasAttribute( 'aria-controls' ) && ! toggle.dataset.target ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Skip if the target isn't a dialog\n\t\tconst target = determineTarget( toggle );\n\t\tif ( ! target || ! target.classList.contains( 'js-modal' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\t// Open and focus the dialog\n\t\ttoggleElement( target, true, 'focus' );\n\n\t\t// Record the trigger for refocusing later\n\t\tmodalTriggers.set( target, toggle );\n\t} );\n\n\t// Handle closing the modal, by clicking the close button or backdrop\n\tdocument.addEventListener( 'click', ( { target } ) => {\n\t\tif ( ! target.classList.contains( 'js-modal-close' ) && ! target.classList.contains( 'js-modal-backdrop' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Find the parent dialog\n\t\tconst modal = target.closest( '.js-modal' );\n\t\tif ( ! modal ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Close the dialog\n\t\ttoggleElement( modal, false );\n\n\t\t// Refocus the trigger if found\n\t\tif ( modalTriggers.has( modal ) ) {\n\t\t\tmodalTriggers.get( modal ).focus();\n\t\t}\n\t} );\n\n\t// Handle closing the modal via ESC key\n\tdocument.addEventListener( 'keyup', ( { key, target } ) => {\n\t\tif ( key !== 'Escape' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Find the parent dialog\n\t\tconst modal = target.closest( '.js-modal' );\n\t\tif ( ! modal ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Close the dialog\n\t\ttoggleElement( modal, false );\n\n\t\t// Refocus the trigger if found\n\t\tif ( modalTriggers.has( modal ) ) {\n\t\t\tmodalTriggers.get( modal ).focus();\n\t\t}\n\t} );\n}\n","export default function setupElementAnimation( element, visible, isPrev ) {\n\t// Skip if animation end event not supported\n\tif ( ! element || typeof element.onanimationend === 'undefined' ) {\n\t\treturn;\n\t}\n\n\tconst animationClass = `animating-${ visible ? 'in' : 'out' }`;\n\tconst directionClass = `${ animationClass }--${ isPrev ? 'prev' : 'next' }`;\n\n\t// Add classes to dictate animation, remove when complete\n\telement.classList.add( animationClass, directionClass );\n\telement.addEventListener( 'animationend', () => {\n\t\telement.classList.remove( animationClass, directionClass );\n\t}, { once: true } );\n}\n","import setupFocusTrap from './focus-trap';\nimport getNewIndex from './get-new-index';\nimport setupElementAnimation from './element-animation';\nimport historyStorage from './history-storage';\n\nlet carouselCount = 0;\n\nexport function setupCarousel( carousel, options = {} ) {\n\t// Set role description\n\tcarousel.setAttribute( 'role', 'region' );\n\tcarousel.setAttribute( 'aria-roledescription', 'carousel' );\n\n\t// Slides, abort if only 1 item\n\tconst slides = carousel.querySelectorAll( '.js-carousel-slide' );\n\tif ( slides.length < 2 ) {\n\t\tcarousel.classList.add( 'no-controls' );\n\t\treturn;\n\t}\n\n\t// Required elements\n\tconst track = carousel.querySelector( '.js-carousel-track' );\n\n\t// Optional elements\n\tconst prevButton = carousel.querySelector( '.js-carousel-prev' );\n\tconst nextButton = carousel.querySelector( '.js-carousel-next' );\n\tconst pagination = carousel.querySelector( '.js-carousel-pagination' );\n\tconst captionBox = carousel.querySelector( '.js-carousel-caption' );\n\tconst indicator = carousel.querySelector( '.js-carousel-indicator' );\n\tconst currentIndicator = carousel.querySelector( '.js-carousel-current' );\n\tconst totalIndicator = carousel.querySelector( '.js-carousel-total' );\n\tlet paginationButtons, slideCaptions;\n\n\tcarouselCount++;\n\tconst idPrefix = `carousel-${ carouselCount }`;\n\n\tlet currentIndex = historyStorage.getItem( carousel.id ) ?? 0;\n\n\t// Get ID for the track\n\tlet trackId = track.id;\n\tif ( ! trackId ) {\n\t\ttrackId = `${ idPrefix }-track`;\n\t\ttrack.id = trackId;\n\t}\n\n\t// Setup indicator as a progress bar\n\tif ( indicator ) {\n\t\tindicator.setAttribute( 'role', 'progressbar' );\n\t\tindicator.setAttribute( 'aria-label', 'Slide Progress' );\n\t\tindicator.setAttribute( 'aria-valuenow', currentIndex + 1 );\n\t\tindicator.setAttribute( 'aria-valuetext', currentIndex + 1 );\n\t\tindicator.setAttribute( 'aria-valuemax', slides.length );\n\t}\n\tif ( currentIndicator ) {\n\t\tcurrentIndicator.innerText = currentIndex;\n\t}\n\tif ( totalIndicator ) {\n\t\ttotalIndicator.innerText = slides.length;\n\t}\n\n\tslides.forEach( ( slide, index ) => {\n\t\tslide.setAttribute( 'role', 'group' );\n\t\tslide.setAttribute( 'aria-roledescription', 'slide' );\n\t\tslide.setAttribute( 'aria-hidden', true );\n\n\t\tlet slideId = slide.id;\n\t\tif ( ! slideId ) {\n\t\t\tslideId = `${ idPrefix }-slide-${ index + 1 }`;\n\t\t\tslide.id = slideId;\n\t\t}\n\n\t\t// Add pagination dot for slide if applicable\n\t\tif ( pagination ) {\n\t\t\t// Pagination is treated as tabs\n\t\t\tslide.setAttribute( 'role', 'tabpanel' );\n\n\t\t\tconst button = document.createElement( 'button' );\n\t\t\tbutton.type = 'button';\n\t\t\tbutton.tabIndex = -1;\n\t\t\tbutton.setAttribute( 'role', 'tab' );\n\t\t\tbutton.setAttribute( 'aria-controls', slideId );\n\t\t\tbutton.setAttribute( 'aria-selected', false );\n\t\t\tbutton.classList.add( 'js-carousel-pagination-button' );\n\t\t\tbutton.innerText = index + 1;\n\n\t\t\tpagination.append( button );\n\t\t}\n\n\t\t// Add caption entry for slide if applicable\n\t\tconst slideCaption = slide.querySelector( '.js-slide-caption' );\n\t\tif ( captionBox && slideCaption ) {\n\t\t\tlet captionId = slideCaption.id;\n\t\t\tif ( ! captionId ) {\n\t\t\t\tcaptionId = `${ slideId }-caption`;\n\t\t\t\tslideCaption.id = captionId;\n\t\t\t}\n\n\t\t\tslide.setAttribute( 'aria-labelledby', captionId );\n\t\t\tslideCaption.setAttribute( 'aria-hidden', true );\n\t\t\tcaptionBox.append( slideCaption );\n\t\t}\n\t} );\n\n\t// Get pagination buttons\n\tif ( pagination ) {\n\t\ttrack.setAttribute( 'role', 'tablist' );\n\t\tpaginationButtons = pagination.querySelectorAll( '.js-carousel-pagination-button' );\n\t}\n\t// Get captions\n\tif ( captionBox ) {\n\t\tslideCaptions = captionBox.querySelectorAll( '.js-slide-caption' );\n\t}\n\n\tfunction goToSlide( newIndex ) {\n\t\t// Get the new index if just next/prev boolean\n\t\tif ( typeof newIndex !== 'number' ) {\n\t\t\tnewIndex = getNewIndex( currentIndex, slides.length, newIndex );\n\t\t}\n\n\t\t// Determine direction\n\t\tlet backward = newIndex < currentIndex;\n\t\t// last > first = forward\n\t\tif ( newIndex === 0 && currentIndex === slides.length - 1 ) {\n\t\t\tbackward = false;\n\t\t}\n\t\t// first > last = backward\n\t\tif ( newIndex === slides.length - 1 && currentIndex === 0 ) {\n\t\t\tbackward = true;\n\t\t}\n\n\t\t// Update slides\n\t\tconst currentSlide = slides.item( currentIndex );\n\t\tconst newSlide = slides.item( newIndex );\n\t\tif ( options.animate ) {\n\t\t\tsetupElementAnimation( slides.item( newIndex ), true, backward );\n\t\t\tsetupElementAnimation( slides.item( currentIndex ), false, backward );\n\t\t}\n\t\tcurrentSlide.setAttribute( 'aria-hidden', true );\n\t\tnewSlide.setAttribute( 'aria-hidden', false );\n\n\t\t// Update buttons if present\n\t\tif ( paginationButtons ) {\n\t\t\tconst currentTab = paginationButtons.item( currentIndex );\n\t\t\tcurrentTab.tabIndex = -1;\n\t\t\tcurrentTab.setAttribute( 'aria-selected', false );\n\n\t\t\tconst newTab = paginationButtons.item( newIndex );\n\t\t\tnewTab.tabIndex = 0;\n\t\t\tnewTab.setAttribute( 'aria-selected', true );\n\t\t}\n\n\t\t// Update caption if present\n\t\tif ( slideCaptions ) {\n\t\t\tconst currentCaption = slideCaptions.item( currentIndex );\n\t\t\tconst newCaption = slideCaptions.item( newIndex );\n\t\t\tif ( options.animate ) {\n\t\t\t\tsetupElementAnimation( slideCaptions.item( newIndex ), true, backward );\n\t\t\t\tsetupElementAnimation( slideCaptions.item( currentIndex ), false, backward );\n\t\t\t}\n\t\t\tcurrentCaption.setAttribute( 'aria-hidden', true );\n\t\t\tnewCaption.setAttribute( 'aria-hidden', false );\n\t\t}\n\n\t\t// Fire callback if provided\n\t\tif ( typeof options.onSlideChange === 'function' ) {\n\t\t\toptions.onSlideChange( {\n\t\t\t\tcarousel,\n\t\t\t\tslides,\n\t\t\t\ttrack,\n\t\t\t\tprevButton,\n\t\t\t\tnextButton,\n\t\t\t\tpagination,\n\t\t\t\tpaginationButtons,\n\t\t\t\tcaptionBox,\n\t\t\t\tslideCaptions,\n\t\t\t\tindicator,\n\t\t\t\tcurrentIndicator,\n\t\t\t\ttotalIndicator,\n\t\t\t\tcurrentIndex: newIndex,\n\t\t\t\tprevIndex: currentIndex,\n\t\t\t} );\n\t\t}\n\n\t\t// Update current index\n\t\tcurrentIndex = newIndex;\n\n\t\t// Update the indicator\n\t\tif ( indicator ) {\n\t\t\tindicator.setAttribute( 'aria-valuenow', currentIndex + 1 );\n\t\t\tindicator.setAttribute( 'aria-valuetext', currentIndex + 1 );\n\t\t}\n\t\tif ( currentIndicator ) {\n\t\t\tcurrentIndicator.innerText = currentIndex;\n\t\t}\n\n\t\thistoryStorage.setItem( carousel.id, currentIndex );\n\t}\n\n\t// Next/Prev button functionality\n\tif ( nextButton ) {\n\t\tnextButton.setAttribute( 'aria-controls', trackId );\n\t\tnextButton.addEventListener( 'click', event => {\n\t\t\tevent.preventDefault();\n\t\t\tgoToSlide( true );\n\t\t} );\n\t}\n\tif ( prevButton ) {\n\t\tprevButton.setAttribute( 'aria-controls', trackId );\n\t\tprevButton.addEventListener( 'click', event => {\n\t\t\tevent.preventDefault();\n\t\t\tgoToSlide( false );\n\t\t} );\n\t}\n\n\t// Pagination button functionality\n\tif ( paginationButtons ) {\n\t\tconst buttons = [ ...paginationButtons ];\n\n\t\tpagination.addEventListener( 'click', event => {\n\t\t\tconst index = buttons.indexOf( event.target );\n\t\t\tif ( index >= 0 ) {\n\t\t\t\tgoToSlide( index );\n\t\t\t}\n\t\t} );\n\n\t\t// Allow navigation pagination buttons with arrow keys\n\t\tsetupFocusTrap( pagination, paginationButtons, {\n\t\t\tarrowKeys: true,\n\t\t\tassumeFocusable: true,\n\t\t}, function( button ) {\n\t\t\tgoToSlide( buttons.indexOf( button ) );\n\t\t} );\n\t}\n\n\t// Initialize current slide\n\tslides.item( currentIndex ).setAttribute( 'aria-hidden', false );\n\tif ( paginationButtons ) {\n\t\tpaginationButtons.item( currentIndex ).tabIndex = 0;\n\t\tpaginationButtons.item( currentIndex ).setAttribute( 'aria-selected', true );\n\t}\n\tif ( slideCaptions ) {\n\t\tslideCaptions.item( currentIndex ).setAttribute( 'aria-hidden', false );\n\t}\n\n\t// Fire callback if provided, pass component objects + prev/new indexes\n\tif ( typeof options.onReady === 'function' ) {\n\t\toptions.onReady( {\n\t\t\tcarousel,\n\t\t\tslides,\n\t\t\ttrack,\n\t\t\tprevButton,\n\t\t\tnextButton,\n\t\t\tpagination,\n\t\t\tpaginationButtons,\n\t\t\tcaptionBox,\n\t\t\tslideCaptions,\n\t\t\tindicator,\n\t\t\tcurrentIndicator,\n\t\t\ttotalIndicator,\n\t\t} );\n\t}\n}\n\nexport default function setupCarousels( options ) {\n\tdocument.querySelectorAll( '.js-carousel' ).forEach( carousel => setupCarousel( carousel, options ) );\n}\n","// Derived from https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\n\n// Save a list of named combobox actions, for future readability\nconst SelectActions = {\n\tClose: 0,\n\tCloseSelect: 1,\n\tFirst: 2,\n\tLast: 3,\n\tNext: 4,\n\tOpen: 5,\n\tPageDown: 6,\n\tPageUp: 7,\n\tPrevious: 8,\n\tSelect: 9,\n\tType: 10,\n};\n\n/*\n * Helper functions\n */\n\n// filter an array of options against an input string\n// returns an array of options that begin with the filter string, case-independent\nfunction filterOptions( options = [], filter, exclude = [] ) {\n\treturn options.filter( option => {\n\t\tconst matches = option.toLowerCase().indexOf( filter.toLowerCase() ) === 0;\n\t\treturn matches && exclude.indexOf( option ) < 0;\n\t} );\n}\n\n// map a key press to an action\nfunction getActionFromKey( event, menuOpen ) {\n\tconst { key, altKey, ctrlKey, metaKey } = event;\n\tconst openKeys = [ 'ArrowDown', 'ArrowUp', 'Enter', ' ' ]; // all keys that will do the default open action\n\n\t// handle opening when closed\n\tif ( ! menuOpen && openKeys.includes( key ) ) {\n\t\treturn SelectActions.Open;\n\t}\n\n\t// home and end move the selected option when open or closed\n\tif ( key === 'Home' ) {\n\t\treturn SelectActions.First;\n\t}\n\tif ( key === 'End' ) {\n\t\treturn SelectActions.Last;\n\t}\n\n\t// handle typing characters when open or closed\n\tif (\n\t\tkey === 'Backspace' ||\n\t\tkey === 'Clear' ||\n\t\t( key.length === 1 && key !== ' ' && ! altKey && ! ctrlKey && ! metaKey )\n\t) {\n\t\treturn SelectActions.Type;\n\t}\n\n\t// handle keys when open\n\tif ( menuOpen ) {\n\t\tif ( key === 'ArrowUp' && altKey ) {\n\t\t\treturn SelectActions.CloseSelect;\n\t\t} else\n\t\tif ( key === 'ArrowDown' && ! altKey ) {\n\t\t\treturn SelectActions.Next;\n\t\t} else\n\t\tif ( key === 'ArrowUp' ) {\n\t\t\treturn SelectActions.Previous;\n\t\t} else\n\t\tif ( key === 'PageUp' ) {\n\t\t\treturn SelectActions.PageUp;\n\t\t} else\n\t\tif ( key === 'PageDown' ) {\n\t\t\treturn SelectActions.PageDown;\n\t\t} else\n\t\tif ( key === 'Escape' ) {\n\t\t\treturn SelectActions.Close;\n\t\t} else\n\t\tif ( key === 'Enter' || key === ' ' ) {\n\t\t\treturn SelectActions.CloseSelect;\n\t\t}\n\t}\n}\n\n// return the index of an option from an array of options, based on a search string\n// if the filter is multiple iterations of the same letter (e.g \"aaa\"), then cycle through first-letter matches\nfunction getIndexByLetter( options, filter, startIndex = 0 ) {\n\tconst orderedOptions = [\n\t\t...options.slice( startIndex ),\n\t\t...options.slice( 0, startIndex ),\n\t];\n\tconst firstMatch = filterOptions( orderedOptions, filter )[ 0 ];\n\tconst allSameLetter = array => array.every( letter => letter === array[ 0 ] );\n\n\t// first check if there is an exact match for the typed string\n\t// else if the same letter is being repeated, cycle through first-letter matches\n\tif ( firstMatch ) {\n\t\treturn options.indexOf( firstMatch );\n\t} else if ( allSameLetter( filter.split( '' ) ) ) {\n\t\tconst matches = filterOptions( orderedOptions, filter[ 0 ] );\n\t\treturn options.indexOf( matches[ 0 ] );\n\t}\n\n\t// if no matches, return -1\n\treturn -1;\n}\n\n// get an updated option index after performing an action\nfunction getUpdatedIndex( currentIndex, maxIndex, action ) {\n\tconst pageSize = 10; // used for pageup/pagedown\n\n\tswitch ( action ) {\n\t\tcase SelectActions.First:\n\t\t\treturn 0;\n\n\t\tcase SelectActions.Last:\n\t\t\treturn maxIndex;\n\n\t\tcase SelectActions.Previous:\n\t\t\treturn Math.max( 0, currentIndex - 1 );\n\n\t\tcase SelectActions.Next:\n\t\t\treturn Math.min( maxIndex, currentIndex + 1 );\n\n\t\tcase SelectActions.PageUp:\n\t\t\treturn Math.max( 0, currentIndex - pageSize );\n\n\t\tcase SelectActions.PageDown:\n\t\t\treturn Math.min( maxIndex, currentIndex + pageSize );\n\n\t\tdefault:\n\t\t\treturn currentIndex;\n\t}\n}\n\n// check if element is visible in browser view port\nfunction isElementInView( element ) {\n\tconst bounding = element.getBoundingClientRect();\n\n\treturn (\n\t\tbounding.top >= 0 &&\n\t\tbounding.left >= 0 &&\n\t\tbounding.bottom <=\n\t\t\t( window.innerHeight || document.documentElement.clientHeight ) &&\n\t\tbounding.right <=\n\t\t\t( window.innerWidth || document.documentElement.clientWidth )\n\t);\n}\n\n// check if an element is currently scrollable\nfunction isScrollable( element ) {\n\treturn element && element.clientHeight < element.scrollHeight;\n}\n\n// ensure a given child element is within the parent's visible scroll area\n// if the child is not visible, scroll the parent\nfunction maintainScrollVisibility( activeElement, scrollParent ) {\n\tconst { offsetHeight, offsetTop } = activeElement;\n\tconst { offsetHeight: parentOffsetHeight, scrollTop } = scrollParent;\n\n\tconst isAbove = offsetTop < scrollTop;\n\tconst isBelow = offsetTop + offsetHeight > scrollTop + parentOffsetHeight;\n\n\tif ( isAbove ) {\n\t\tscrollParent.scrollTo( 0, offsetTop );\n\t} else if ( isBelow ) {\n\t\tscrollParent.scrollTo( 0, offsetTop - parentOffsetHeight + offsetHeight );\n\t}\n}\n\n/*\n * Select Component\n * Accepts a combobox element and an array of string options\n */\nlet instanceCount = 1;\nclass Combobox {\n\tconstructor( container ) {\n\t\tthis.selectElement = container.querySelector( 'select' );\n\t\tthis.selectElement.setAttribute( 'aria-hidden', this.selectElement.hidden = true );\n\n\t\tconst label = container.querySelector( 'label' );\n\t\tif ( ! label.id ) {\n\t\t\tlabel.id = `combobox${ instanceCount }-label`;\n\t\t}\n\n\t\tconst wrapper = document.createElement( 'div' );\n\t\twrapper.setAttribute( 'class', 'combobox js-select' );\n\t\tthis.wrapperElement = wrapper;\n\n\t\tconst combobox = document.createElement( 'div' );\n\t\tcombobox.setAttribute( 'class', 'combobox__input' );\n\t\tcombobox.setAttribute( 'role', 'combobox' );\n\t\tcombobox.setAttribute( 'id', `combobox${ instanceCount }` );\n\t\tcombobox.setAttribute( 'aria-labelledby', label.id );\n\t\tcombobox.setAttribute( 'aria-haspopup', 'listbox' );\n\t\tcombobox.setAttribute( 'aria-controls', `listbox${ instanceCount }` );\n\t\tcombobox.setAttribute( 'aria-expanded', 'false' );\n\t\tcombobox.setAttribute( 'tabindex', '0' );\n\t\tthis.comboboxElement = combobox;\n\n\t\tconst listbox = document.createElement( 'div' );\n\t\tlistbox.setAttribute( 'class', 'combobox__menu' );\n\t\tlistbox.setAttribute( 'role', 'listbox' );\n\t\tlistbox.setAttribute( 'id', `listbox${ instanceCount }` );\n\t\tlistbox.setAttribute( 'aria-labelledby', label.id );\n\t\tlistbox.setAttribute( 'tabindex', '-1' );\n\t\tthis.listboxElement = listbox;\n\n\t\tlabel.htmlFor = combobox.id;\n\t\twrapper.append( combobox );\n\t\twrapper.append( listbox );\n\t\tthis.selectElement.parentNode.insertBefore( wrapper, this.selectElement );\n\n\t\tthis.optionStrings = [];\n\t\tthis.optionElements = [];\n\t\tthis.selectElement.querySelectorAll( 'option' ).forEach( ( option, index ) => {\n\t\t\tthis.optionStrings.push( option.textContent );\n\n\t\t\tconst optionElement = this.createOption( option, index );\n\t\t\tthis.optionElements.push( optionElement );\n\t\t\tthis.listboxElement.appendChild( optionElement );\n\t\t} );\n\n\t\t// Initialize\n\t\tthis.activeIndex = 0;\n\t\tthis.isOpen = false;\n\t\tthis.searchString = '';\n\t\tthis.searchTimeout = null;\n\t\tthis.ignoreChangeEvent = false;\n\t\tthis.selectOption( this.selectElement.selectedIndex );\n\n\t\t// add event listeners\n\t\tthis.comboboxElement.addEventListener( 'blur', this.onComboboxBlur.bind( this ) );\n\t\tthis.comboboxElement.addEventListener( 'click', this.onComboboxClick.bind( this ) );\n\t\tthis.comboboxElement.addEventListener( 'keydown', this.onComboboxKeyDown.bind( this ) );\n\t\tthis.selectElement.addEventListener( 'change', () => {\n\t\t\tif ( ! this.ignoreChangeEvent ) {\n\t\t\t\tthis.selectOption( this.selectElement.selectedIndex );\n\t\t\t}\n\t\t} );\n\n\t\tinstanceCount++;\n\t}\n\n\tcreateOption( option, index ) {\n\t\tconst optionElement = document.createElement( 'div' );\n\t\toptionElement.setAttribute( 'role', 'option' );\n\t\toptionElement.id = `${ this.listboxElement.id }-option${ index }`;\n\t\toptionElement.className = 'combobox__option';\n\t\toptionElement.innerText = option.innerText;\n\t\toptionElement.dataset.value = option.value;\n\n\t\toptionElement.addEventListener( 'click', event => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis.onOptionClick( index );\n\t\t} );\n\n\t\toptionElement.addEventListener( 'mousedown', this.onOptionMouseDown.bind( this ) );\n\n\t\treturn optionElement;\n\t}\n\n\tgetSearchString( char ) {\n\t\t// reset typing timeout and start new timeout\n\t\t// this allows us to make multiple-letter matches, like a native select\n\t\tif ( typeof this.searchTimeout === 'number' ) {\n\t\t\twindow.clearTimeout( this.searchTimeout );\n\t\t}\n\n\t\tthis.searchTimeout = window.setTimeout( () => {\n\t\t\tthis.searchString = '';\n\t\t}, 500 );\n\n\t\t// add most recent letter to saved search string\n\t\tthis.searchString += char;\n\t\treturn this.searchString;\n\t}\n\n\tonComboboxBlur() {\n\t\t// do not do blur action if ignoreBlur flag has been set\n\t\tif ( this.ignoreBlur ) {\n\t\t\tthis.ignoreBlur = false;\n\t\t\treturn;\n\t\t}\n\n\t\t// select current option and close\n\t\tif ( this.isOpen ) {\n\t\t\tthis.selectOption( this.activeIndex, 'silent' );\n\t\t\tthis.updateMenuState( false, false );\n\t\t}\n\t}\n\n\tonComboboxClick() {\n\t\tthis.updateMenuState( ! this.isOpen, false );\n\t}\n\n\tonComboboxKeyDown( event ) {\n\t\tconst { key } = event;\n\t\tconst max = this.optionElements.length - 1;\n\n\t\tconst action = getActionFromKey( event, this.isOpen );\n\n\t\tswitch ( action ) {\n\t\t\tcase SelectActions.Last:\n\t\t\tcase SelectActions.First:\n\t\t\t\tthis.updateMenuState( true );\n\n\t\t\t// intentional fallthrough\n\t\t\tcase SelectActions.Next:\n\t\t\tcase SelectActions.Previous:\n\t\t\tcase SelectActions.PageUp:\n\t\t\tcase SelectActions.PageDown:\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn this.onOptionChange(\n\t\t\t\t\tgetUpdatedIndex( this.activeIndex, max, action ),\n\t\t\t\t);\n\n\t\t\tcase SelectActions.CloseSelect:\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.selectOption( this.activeIndex );\n\n\t\t\t// intentional fallthrough\n\t\t\tcase SelectActions.Close:\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn this.updateMenuState( false );\n\n\t\t\tcase SelectActions.Type:\n\t\t\t\treturn this.onComboboxType( key );\n\n\t\t\tcase SelectActions.Open:\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn this.updateMenuState( true );\n\t\t}\n\t}\n\n\tonComboboxType( letter ) {\n\t\t// open the listbox if it is closed\n\t\tthis.updateMenuState( true );\n\n\t\t// find the index of the first matching option\n\t\tconst searchString = this.getSearchString( letter );\n\t\tconst searchIndex = getIndexByLetter(\n\t\t\tthis.optionStrings,\n\t\t\tsearchString,\n\t\t\tthis.activeIndex + 1,\n\t\t);\n\n\t\t// if a match was found, go to it\n\t\t// if no matches, clear the timeout and search string\n\t\tif ( searchIndex >= 0 ) {\n\t\t\tthis.onOptionChange( searchIndex );\n\t\t} else {\n\t\t\twindow.clearTimeout( this.searchTimeout );\n\t\t\tthis.searchString = '';\n\t\t}\n\t}\n\n\tonOptionChange( index ) {\n\t\t// update state\n\t\tthis.activeIndex = index;\n\n\t\t// update current option\n\t\tthis.highlightOption( index );\n\n\t\t// update aria-activedescendant\n\t\tthis.comboboxElement.setAttribute( 'aria-activedescendant', this.optionElements[ index ].id );\n\n\t\t// ensure the new option is visible on screen\n\t\tif ( isScrollable( this.listboxElement ) ) {\n\t\t\tmaintainScrollVisibility( this.optionElements[ index ], this.listboxElement );\n\t\t}\n\n\t\t// ensure the new option is in view\n\t\tif ( ! isElementInView( this.optionElements[ index ] ) ) {\n\t\t\tthis.optionElements[ index ].scrollIntoView( { block: 'nearest' } );\n\t\t}\n\t}\n\n\tonOptionClick( index ) {\n\t\tthis.onOptionChange( index );\n\t\tthis.selectOption( index );\n\t\tthis.updateMenuState( false );\n\t}\n\n\tonOptionMouseDown() {\n\t\t// Clicking an option will cause a blur event,\n\t\t// but we don't want to perform the default keyboard blur action\n\t\tthis.ignoreBlur = true;\n\t}\n\n\thighlightOption( index ) {\n\t\tthis.optionElements.forEach( ( optionElement, i ) => {\n\t\t\tif ( i === index ) {\n\t\t\t\toptionElement.classList.add( 'is-current' );\n\t\t\t} else {\n\t\t\t\toptionElement.classList.remove( 'is-current' );\n\t\t\t}\n\t\t} );\n\t}\n\n\tselectOption( index, silent = false ) {\n\t\t// update state\n\t\tthis.activeIndex = index;\n\n\t\t// update displayed value\n\t\tthis.comboboxElement.textContent = this.optionElements[ index ].textContent;\n\n\t\t// update aria-selected\n\t\tthis.optionElements.forEach( ( optionElement, i ) => {\n\t\t\toptionElement.setAttribute( 'aria-selected', i === index ? 'true' : 'false' );\n\t\t} );\n\n\t\t// ensure option is highlighted\n\t\tthis.highlightOption( index );\n\n\t\t// update the original