{"version":3,"file":"search-module-9Bs9FbJx.js","sources":["../../../../node_modules/core-js/internals/validate-arguments-length.js","../../../../node_modules/core-js/modules/web.url-search-params.delete.js","../../../../node_modules/core-js/modules/web.url-search-params.has.js","../../../../node_modules/core-js/modules/web.url-search-params.size.js","../../../../src/main/js/navigation/global/components/search/constants.js","../../../../src/main/js/navigation/global/components/search/listboxUtil.js","../../../../src/main/js/navigation/global/components/search/search.js","../../../../src/main/js/navigation/global/components/search/filterResults.js","../../../../src/main/js/navigation/global/components/search/searchMetrics.js","../../../../src/main/js/navigation/global/components/search/suggest.js","../../../../src/main/js/navigation/global/components/search/recents.js","../../../../src/main/js/navigation/global/components/search/entry/main.js","../../../../src/main/js/navigation/global/components/search/entry/search-module.js"],"sourcesContent":["'use strict';\nvar $TypeError = TypeError;\n\nmodule.exports = function (passed, required) {\n if (passed < required) throw new $TypeError('Not enough arguments');\n return passed;\n};\n","'use strict';\nvar defineBuiltIn = require('../internals/define-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\n\nvar $URLSearchParams = URLSearchParams;\nvar URLSearchParamsPrototype = $URLSearchParams.prototype;\nvar append = uncurryThis(URLSearchParamsPrototype.append);\nvar $delete = uncurryThis(URLSearchParamsPrototype['delete']);\nvar forEach = uncurryThis(URLSearchParamsPrototype.forEach);\nvar push = uncurryThis([].push);\nvar params = new $URLSearchParams('a=1&a=2&b=3');\n\nparams['delete']('a', 1);\n// `undefined` case is a Chromium 117 bug\n// https://bugs.chromium.org/p/v8/issues/detail?id=14222\nparams['delete']('b', undefined);\n\nif (params + '' !== 'a=2') {\n defineBuiltIn(URLSearchParamsPrototype, 'delete', function (name /* , value */) {\n var length = arguments.length;\n var $value = length < 2 ? undefined : arguments[1];\n if (length && $value === undefined) return $delete(this, name);\n var entries = [];\n forEach(this, function (v, k) { // also validates `this`\n push(entries, { key: k, value: v });\n });\n validateArgumentsLength(length, 1);\n var key = toString(name);\n var value = toString($value);\n var index = 0;\n var dindex = 0;\n var found = false;\n var entriesLength = entries.length;\n var entry;\n while (index < entriesLength) {\n entry = entries[index++];\n if (found || entry.key === key) {\n found = true;\n $delete(this, entry.key);\n } else dindex++;\n }\n while (dindex < entriesLength) {\n entry = entries[dindex++];\n if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value);\n }\n }, { enumerable: true, unsafe: true });\n}\n","'use strict';\nvar defineBuiltIn = require('../internals/define-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\n\nvar $URLSearchParams = URLSearchParams;\nvar URLSearchParamsPrototype = $URLSearchParams.prototype;\nvar getAll = uncurryThis(URLSearchParamsPrototype.getAll);\nvar $has = uncurryThis(URLSearchParamsPrototype.has);\nvar params = new $URLSearchParams('a=1');\n\n// `undefined` case is a Chromium 117 bug\n// https://bugs.chromium.org/p/v8/issues/detail?id=14222\nif (params.has('a', 2) || !params.has('a', undefined)) {\n defineBuiltIn(URLSearchParamsPrototype, 'has', function has(name /* , value */) {\n var length = arguments.length;\n var $value = length < 2 ? undefined : arguments[1];\n if (length && $value === undefined) return $has(this, name);\n var values = getAll(this, name); // also validates `this`\n validateArgumentsLength(length, 1);\n var value = toString($value);\n var index = 0;\n while (index < values.length) {\n if (values[index++] === value) return true;\n } return false;\n }, { enumerable: true, unsafe: true });\n}\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\n\nvar URLSearchParamsPrototype = URLSearchParams.prototype;\nvar forEach = uncurryThis(URLSearchParamsPrototype.forEach);\n\n// `URLSearchParams.prototype.size` getter\n// https://github.com/whatwg/url/pull/734\nif (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {\n defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {\n get: function size() {\n var count = 0;\n forEach(this, function () { count++; });\n return count;\n },\n configurable: true,\n enumerable: true\n });\n}\n","const SEARCH_HISTORY = {\n LI_ID: (index) => `search-history-entry-${index}`,\n UL_ID: 'gnav-recent-search-list',\n LOCAL_STORAGE_KEY: 'savedSearches',\n SELECTOR: '[data-js=recent-search-box]',\n RECENTLY_SELECTED: 'recentSearchTermSelected',\n DELETE: {\n ID: 'search-history-delete',\n CSS: 'search-history__button',\n TEXT: 'Clear History',\n },\n TITLE: {\n CSS: 'search-history__title',\n TEXT: 'Search History',\n },\n};\n\nconst AUTOSUGGEST = {\n LI_ID: (index) => `autosuggest-result-${index}`,\n UL_ID: 'gnav-suggestion-list',\n SELECTOR: '[data-js=suggestion-box]',\n URL: {\n FALLBACK: 'https://www.rei.com/autosuggest/online/details',\n },\n};\n\nconst LISTBOX = {\n CSS: {\n VISUAL_FOCUS: 'searchbox-term',\n LIST_ITEM: 'searchbox-result',\n },\n ARIA_LIVE: {\n DIRECTIONS: 'Keyboard users, use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.',\n SELECTOR: '[data-js=\"feedback-holder\"]',\n },\n ALL_LI: {\n SELECTOR: `[id^=${AUTOSUGGEST.LI_ID('')}], [id^=${SEARCH_HISTORY.LI_ID('')}]`,\n },\n URL: {\n DOMAIN: 'https://www.rei.com/',\n },\n};\n\nexport {\n AUTOSUGGEST,\n SEARCH_HISTORY,\n};\nexport default LISTBOX;\n","/**\n * Listbox Utils | Search History & Autosuggest\n * Search History and Autosuggest are very similar in functionality, but must be able to work\n * independently of one another. This module is for methods that are used in both recents and\n * autosuggest listboxes.\n * @see [Definition of listbox]{@link https://www.w3.org/TR/wai-aria-practices/#Listbox}.\n * Used in reference to [combo box]{@link https://www.w3.org/TR/wai-aria-practices/#combobox}\n */\nimport { code, getKeyCode, keyCode } from '../../../../_shared-components/keyCode';\nimport LISTBOX from './constants';\n\n/**\n * Keys whose default action should be ignored on a keydown event.\n * @param {KeyboardEvent} e\n */\nconst preventDefaultOnKeyDown = (e) => {\n const keyCodeVal = getKeyCode(e);\n switch (keyCodeVal) {\n case code.ARROW_DOWN:\n case keyCode.ARROW_DOWN:\n case code.ARROW_UP:\n case keyCode.ARROW_UP:\n case code.END:\n case keyCode.END:\n e.preventDefault();\n break;\n default:\n break;\n }\n};\n\nconst getUpdatedIndexOnArrowDown = (currentIndex, length) => (\n (currentIndex < length - 1 && currentIndex > -1) ? currentIndex + 1 : 0\n);\n\nconst getUpdatedIndexOnArrowUp = (currentIndex, length) => (\n (currentIndex <= length && currentIndex > 0) ? currentIndex - 1 : length - 1\n);\n\n/**\n * Sets the input field with the value.\n * @param {HTMLInputElement} searchField\n * @param {string} value\n */\nconst setSearchField = (searchField, value = '') => {\n const search = searchField;\n search.value = value;\n};\n\n/**\n * Iterates through list entries and removes css indicating visual focus.\n * @param {HTMLLIElement[]} listEntries\n */\nconst cleanListEntries = (listEntries) => {\n [...listEntries].forEach((elem) => {\n elem.classList.remove(LISTBOX.CSS.VISUAL_FOCUS);\n elem.removeAttribute('aria-selected');\n });\n};\n\nconst resetListbox = (searchField, listEntries) => {\n searchField.setAttribute('aria-activedescendant', '');\n cleanListEntries(listEntries);\n};\n\n/**\n * Index for the list item element is the last substring of the id when split on '-'.\n * @param {HTMLLIElement} elem\n * @returns {number|number}\n */\nconst getIndexFromElement = (elem) => {\n const { id = null } = elem || {};\n const wordsArr = !id ? [] : id.split('-');\n return wordsArr.length < 1 ? -1 : (wordsArr[wordsArr.length - 1] * 1);\n};\n\n/**\n * Adds visual focus to a single listItem and updates aria-live region with descriptive context.\n * @param {HTMLInputElement} searchField\n * @param {HTMLLIElement} listItem - entry to add visual focus to\n * @param {HTMLLIElement[]} listEntries - button element only for clear history\n */\nconst setVisualFocus = (searchField, listItem, listEntries) => {\n cleanListEntries(listEntries);\n searchField.setAttribute('aria-activedescendant', listItem.id);\n listItem.setAttribute('aria-selected', 'true');\n listItem.classList.add(LISTBOX.CSS.VISUAL_FOCUS);\n};\n\n/**\n * @param {HTMLDivElement} listboxElem - which contains the data-visible attribute which may\n * need to be updated\n * @param {boolean} newValue - most recent result of logic determining if listbox should visible\n * (true) or hidden (false)\n * @returns {boolean} - true if a difference exists between the previous and newValue\n */\nconst shouldUpdateVisibility = (listboxElem, newValue) => {\n const { dataset: { visible: visibleValue } } = listboxElem;\n const oldValue = visibleValue === 'visible';\n return oldValue !== newValue;\n};\n\nconst addMouseMoveEventListeners = (dynamicElem, enterCallback, leaveCallback) => {\n dynamicElem.addEventListener('mouseenter', enterCallback);\n dynamicElem.addEventListener('mouseleave', leaveCallback);\n};\n\nexport {\n addMouseMoveEventListeners,\n getUpdatedIndexOnArrowDown,\n getUpdatedIndexOnArrowUp,\n getIndexFromElement,\n preventDefaultOnKeyDown,\n resetListbox,\n shouldUpdateVisibility,\n setSearchField,\n setVisualFocus,\n};\n","/** Search Form */\n\nimport { getDomElems } from '../../../../_shared-components/getDomElems';\nimport { SEARCH_HISTORY } from './constants';\nimport { setSearchField } from './listboxUtil';\n\n/* gets search param, if present */\nconst getSearchParam = (param) => {\n const params = new URLSearchParams(window.location.search);\n return params.get(param);\n};\n\nconst showClearButton = (searchField, clearButton) => {\n clearButton.removeAttribute('aria-hidden');\n clearButton.setAttribute('data-visible', 'visible');\n searchField.setAttribute('style', 'margin-right: -44px;');\n};\n\nconst hideClearButton = (searchField, clearButton) => {\n clearButton.setAttribute('aria-hidden', 'true');\n clearButton.setAttribute('data-visible', 'hidden');\n searchField.setAttribute('style', 'margin-right: 0;');\n};\n\nconst setClearButtonVisibility = (searchField, clearButton) => {\n if (!searchField.value) {\n hideClearButton(searchField, clearButton);\n } else {\n showClearButton(searchField, clearButton);\n }\n};\n\nconst enableSearchButton = (searchField, searchButton) => {\n if (searchField.value.trim().length === 0) {\n searchButton.classList.add('search__search-button--disabled');\n searchButton.setAttribute('aria-disabled', 'true');\n searchButton.setAttribute('disabled', 'disabled');\n } else if (searchField.value.trim().length > 0) {\n searchButton.classList.remove('search__search-button--disabled');\n searchButton.setAttribute('aria-disabled', 'false');\n searchButton.removeAttribute('disabled');\n }\n};\n\nconst enableSearchFormSubmit = (searchForm, searchField) => {\n const recentSearchTermSelected = localStorage.getItem(SEARCH_HISTORY.RECENTLY_SELECTED);\n const recentHistoryBox = document.querySelector(SEARCH_HISTORY.SELECTOR);\n\n if (searchField.value.trim().length === 0\n && (!recentSearchTermSelected || recentSearchTermSelected === SEARCH_HISTORY.DELETE.TEXT)) {\n searchField.setAttribute('required', 'required');\n if (recentSearchTermSelected === SEARCH_HISTORY.DELETE.TEXT) {\n localStorage.removeItem(SEARCH_HISTORY.LOCAL_STORAGE_KEY);\n setTimeout(() => {\n recentHistoryBox?.setAttribute('data-visible', 'hidden');\n recentHistoryBox?.setAttribute('style', 'display: none;');\n searchField.parentElement.setAttribute('aria-expanded', 'false');\n }, 200);\n }\n } else {\n searchField.removeAttribute('required');\n setSearchField(searchField, searchField.value || recentSearchTermSelected);\n searchForm.submit();\n }\n};\n\nconst updateSearchField = (searchField) => {\n const inputElem = searchField;\n /* clear input */\n inputElem.value = '';\n searchField.focus();\n};\n\n/* init */\nconst init = (selectors) => {\n const searchElems = getDomElems(selectors);\n if (searchElems === null) return;\n\n const {\n searchForm,\n searchField,\n clearButton,\n searchButton,\n } = searchElems;\n\n searchField.addEventListener('keyup', setClearButtonVisibility.bind(null, searchField, clearButton));\n searchField.value = getSearchParam('q');\n setClearButtonVisibility(searchField, clearButton);\n enableSearchButton(searchField, searchButton);\n clearButton.addEventListener('click', () => {\n updateSearchField(searchField);\n setClearButtonVisibility(searchField, clearButton);\n enableSearchButton(searchField, searchButton);\n });\n searchField.addEventListener('input', enableSearchButton.bind(null, searchField, searchButton));\n searchField.addEventListener('keyup', (e) => {\n if (e.key === 'Enter') {\n enableSearchFormSubmit(searchForm, searchField);\n localStorage.removeItem(SEARCH_HISTORY.RECENTLY_SELECTED);\n }\n });\n};\n\nexport default init;\n","const sliceSize = 10;\n\nexport const cleanSearchResult = (item) => item.replace(/\\s?-?'?/gi, '');\n\nexport const getStartsWithData = (data, cleanedSearchTerm) => data\n .filter((item) => cleanSearchResult(item).startsWith(cleanedSearchTerm));\n\nexport const getIncludesData = (data, cleanedSearchTerm) => data\n .filter((item) => !cleanSearchResult(item).startsWith(cleanedSearchTerm)\n && cleanSearchResult(item).includes(cleanedSearchTerm));\n\nexport const partitionData = (data, cleanSearchTerm) => data.map((term) => {\n // Build a regular expression pattern with optional special characters\n // in-between each letter of the search term\n let optionalSpecialCharacterPattern = '';\n for (let i = 0, len = cleanSearchTerm.length; i < len; i += 1) {\n optionalSpecialCharacterPattern += `${cleanSearchTerm[i]}\\\\W*`;\n }\n\n // Create the regular expression, ignoring case and matching only the first occurrence\n const optionalSpecialCharacterRegExp = new RegExp(optionalSpecialCharacterPattern, 'i');\n\n // Match the search term with optional special characters to the item in the term list\n const matches = term.match(optionalSpecialCharacterRegExp);\n\n // Define the parameters that allow search term highlighting in the term\n // list, note there should only ever be one occurrence\n const displayTerm = matches ? matches[0] : cleanSearchTerm;\n\n return {\n searchTerm: displayTerm,\n resultTitle: term,\n };\n});\n\nexport const cleanSearchTerm = (term) => {\n // Regular expression to match all non-word (special) characters\n const specialCharacterRegExp = term.length > 1 ? /\\W/g : '';\n\n return term.toLowerCase().replace(/[^a-z\\d]/gi, '').replace(specialCharacterRegExp, '');\n};\n\nexport const cleanFetchedItems = (fetchedItems) => [...fetchedItems]\n .map((item) => item.term.toLowerCase());\n\n/** @param {function} filterResults takes @param {array} fetchedItems and filters it by using\n * the current value from the input box, as well as multiple steps of regex that return\n * matched string characters to allow for dynamic styling\n */\nexport default (value = '', state = {}) => {\n const newState = state;\n /** @param {function} filterResults takes @param {array} fetchedItems and filters it by using\n * the current value from the input box, as well as multiple steps of regex that return\n * matched string characters to allow for dynamic styling\n */\n const cleanedSearchTerm = cleanSearchTerm(value);\n\n if (!newState.fetchedItems.length) return [];\n // Grab all the values from fetchedItems and map over them to produce a\n // new array that has them lowercased and with only their term\n let data = cleanFetchedItems(newState.fetchedItems);\n\n // Grabs data that starts with search term\n const startsWithData = getStartsWithData(data, cleanedSearchTerm);\n\n // Grabs data that contains, but doesn't start with search term\n const includesData = getIncludesData(data, cleanedSearchTerm);\n\n // Combines data sets, if needed\n data = (startsWithData.length < sliceSize) ? startsWithData.concat(includesData) : startsWithData;\n\n // partition search results into the entered chars and remaining chars\n data = partitionData(data, cleanedSearchTerm);\n\n newState.filteredResults = data.slice(0, sliceSize);\n return newState.filteredResults;\n};\n","import { analyticsCustomClickHandler } from '../../../../_shared-components/navigationMetrics';\n\nconst isSearchHistoryEntry = (elemId) => (elemId.startsWith('search-history'));\n\n/**\n * Determines conditional properties based on whether the resultEntry was selected from the\n * Search History (aka Recent Searches) or Autosuggest listbox. Extracts position in list\n * by parsing the element's id\n * @param elemId: should have structure of \"listboxType-...-index\", ex. \"autosuggest-result-0\"\n * @returns {{autoSuggestPosition: (string|string), recentQuery: (string), searchTermType: string}}\n */\nconst getConditionalProps = (elemId) => {\n const wordsArr = elemId.split('-');\n const autoSuggestPosition = wordsArr[wordsArr.length - 1];\n const searchTermType = `autosuggest${isSearchHistoryEntry(elemId) ? '-recentquery' : ''}`;\n const recentQuery = isSearchHistoryEntry(elemId) ? 'yes' : 'no';\n return { autoSuggestPosition, recentQuery, searchTermType };\n};\n\n/**\n * Helper method for building custom config for @rei/metrics click on an open listbox\n * (recent searches or autosuggest). May be removed in near future, as this is working\n * with legacy code.\n * @param {HTMLLIElement} resultEntry\n * @returns {{autoSuggestPosition: (string|number), recentQuery: (string),\n * searchTermType: string, searchTermClicked: string, linkName: string, events: string}}\n */\nconst buildListboxClickAnalyticsConfig = (resultEntry) => {\n const { id = '', innerText = '' } = resultEntry || {};\n return {\n ...getConditionalProps(id),\n linkName: 'searchbox-_-text-_-autosuggest',\n searchTermClicked: (innerText).trim(),\n events: 'event1',\n };\n};\n\n/**\n * Builds a click analytics config for supported elements within search form. Then triggers\n * metrics click handler with resulting config.\n * @param {HTMLLIElement} resultEntry: selected result from open listbox\n * @param {object} altConfig: optional object config to handle metrics from non-listbox\n * search elements (ex. input)\n */\nconst handleClickAnalyticsForSearch = (resultEntry, altConfig = null) => {\n const configToUse = altConfig === null\n ? buildListboxClickAnalyticsConfig(resultEntry) : altConfig;\n analyticsCustomClickHandler(configToUse);\n return configToUse;\n};\n\nexport default handleClickAnalyticsForSearch;\n","/**\n * Autosuggest\n * Contains main functionality for the search autosuggest.\n */\nimport { getDomElems } from '../../../../_shared-components/getDomElems';\nimport filterResults from './filterResults';\nimport getScriptData from '../../util/getScriptData';\nimport { getKeyCode, code, keyCode } from '../../../../_shared-components/keyCode';\nimport LISTBOX, { AUTOSUGGEST } from './constants';\nimport * as listbox from './listboxUtil';\nimport handleClickAnalyticsForSearch from './searchMetrics';\n\n/**\n * State holds the values for autosuggest and includes\n * @param {array} fetchedItems which is the result of the fetch call,\n * @param {array} filteredResults is an array of ten results,\n*/\nconst state = {\n fetchedItems: [],\n filteredResults: [],\n};\n\n/**\n * Pings an endpoint and assigns the results to state's fetchedItems property. If an error occurs,\n * it is logged to the dev console and fetchedItems is set to an empty array.\n * @param {string} fetchPoint: url to ping\n */\nexport const fetchData = (fetchPoint) => {\n fetch(fetchPoint)\n .then((response) => {\n const { ok, status, url } = response || {};\n if (!ok) {\n console.error(`url: ${url} is responding with status code: ${status}`);\n }\n return ok ? response.json() : [];\n })\n .then((response) => {\n state.fetchedItems = response;\n })\n .catch((e) => console.error(e));\n};\n\n/**\n * If resultTitle exists then returns string containing bolded substring via markup.\n * Otherwise returns unchanged searchTerm string.\n * @param {string} searchTerm\n * @param {string} resultTitle\n * @returns {*}\n */\nconst getInnerHtml = (searchTerm, resultTitle) => (\n resultTitle.replace(searchTerm, `${searchTerm}`)\n);\n\n/**\n * @param {number} resultCount - current number of available autosuggest options\n * @param {string} searchTerm - the characters contained within the search input\n * @returns {string} - description of available autosuggest options for a searchTerm,\n * including directions on how to navigation the open listbox.\n */\nconst getAriaLiveTextForResults = (resultCount, searchTerm) => (\n (resultCount === 1) ? `There is 1 result available that contains \"${searchTerm}\". ${LISTBOX.ARIA_LIVE.DIRECTIONS}`\n : `There are ${resultCount} results available that contain \"${searchTerm}\".${resultCount > 0 ? ` ${LISTBOX.ARIA_LIVE.DIRECTIONS}` : ''}`\n);\n\n/**\n * Will remove visual focus for autosuggest list item when mouse leaves element.\n * Updates aria-live text to total result count\n * @param e\n */\nconst onMouseLeave = (e) => {\n const { target } = e;\n const { suggestionBox, ariaLiveRegion, searchField } = state;\n const listEntries = suggestionBox.querySelectorAll(LISTBOX.ALL_LI.SELECTOR);\n /* only remove visual focus if target has it, otherwise do nothing */\n if (target.classList.contains(LISTBOX.CSS.VISUAL_FOCUS)) {\n listbox.resetListbox(searchField, listEntries);\n ariaLiveRegion.textContent = getAriaLiveTextForResults(\n listEntries.length,\n searchField.value.trim()\n );\n }\n};\n\n/**\n * Add visual focus to autosuggest list item.\n * @param e\n */\nconst onMouseEnter = (e) => {\n const { target } = e;\n const { suggestionBox, ariaLiveRegion, searchField } = state;\n const listEntries = suggestionBox.querySelectorAll(LISTBOX.ALL_LI.SELECTOR);\n listbox.setVisualFocus(searchField, target, listEntries);\n ariaLiveRegion.textContent = '';\n};\n\n/**\n * Creates and appends markup to the DOM containing the list of autosuggest options with the\n * relevant characters bolded.\n * @param {object[]} results Array of (at most 10) options\n *\n * About data-cnstrc-item-section and data-cnstrc-item-name attributes:\n * https://docs.constructor.com/docs/integrating-with-constructor-behavioral-tracking-data-driven-event-tracking#result-item\n * https://docs.constructor.com/docs/faq-api-what-is-a-section-as-referenced-in-the-api\n */\nexport const appendResults = (results) => {\n const { suggestionList } = state;\n /* remove contents from ul element */\n const ul = suggestionList;\n ul.innerHTML = '';\n /* add list items to ul */\n [...results].forEach(({ searchTerm, resultTitle }, index) => {\n const li = document.createElement('li');\n li.className = LISTBOX.CSS.LIST_ITEM;\n /* id with index used for tracking focus & building metrics */\n li.id = AUTOSUGGEST.LI_ID(index);\n li.innerHTML = getInnerHtml(searchTerm, resultTitle);\n li.setAttribute('role', 'option');\n li.setAttribute('aria-label', resultTitle);\n /* Add Constructor search beacon tracking attributes */\n li.setAttribute('data-cnstrc-item-section', 'Search Suggestions');\n li.setAttribute('data-cnstrc-item-name', resultTitle);\n listbox.addMouseMoveEventListeners(li, onMouseEnter, onMouseLeave);\n ul.appendChild(li);\n });\n};\n\n/**\n * Controls visibility / expand-collapse of autosuggestion listbox\n * @param {HTMLDivElement} suggestionBox - element that contains the list entries of recent\n * searches or filtered results\n * @param {HTMLInputElement} searchField - input element of search field\n * @param {boolean} isVisible - boolean used to determine state of visibility / expansion\n */\nexport const setSuggestionBoxVisibility = (suggestionBox, searchField, isVisible = false) => {\n if (!isVisible) {\n listbox.resetListbox(searchField, [...suggestionBox.querySelectorAll(LISTBOX.ALL_LI.SELECTOR)]);\n }\n searchField.parentElement.setAttribute('aria-expanded', `${isVisible}`);\n suggestionBox.setAttribute('data-visible', isVisible ? 'visible' : 'hidden');\n};\n\n/**\n * Handles the keyboard logic for list entries in SuggestionBox\n * @param e\n */\nexport const handleKeyPress = (e) => {\n const {\n ariaLiveRegion,\n suggestionBox,\n searchField,\n } = state;\n const { dataset: { visible } } = suggestionBox;\n const listEntries = suggestionBox.querySelectorAll(`.${LISTBOX.CSS.LIST_ITEM}`);\n const currentIndex = listbox.getIndexFromElement(suggestionBox.querySelector(`.${LISTBOX.CSS.VISUAL_FOCUS}`));\n const keyCodeVal = getKeyCode(e);\n const searchTerm = searchField.value.trim();\n switch (keyCodeVal) {\n case code.ARROW_DOWN:\n case keyCode.ARROW_DOWN:\n if (visible === 'visible') {\n const updatedIndex = listbox.getUpdatedIndexOnArrowDown(currentIndex, listEntries.length);\n listbox.setVisualFocus(searchField, listEntries[updatedIndex], listEntries);\n ariaLiveRegion.textContent = '';\n }\n break;\n case code.ARROW_UP:\n case keyCode.ARROW_UP:\n if (visible === 'visible') {\n const updatedIndex = listbox.getUpdatedIndexOnArrowUp(currentIndex, listEntries.length);\n listbox.setVisualFocus(searchField, listEntries[updatedIndex], listEntries);\n ariaLiveRegion.textContent = '';\n }\n break;\n case code.ESCAPE:\n case keyCode.ESCAPE:\n if (visible === 'visible') {\n listbox.setSearchField(searchField);\n searchField.focus();\n setSuggestionBoxVisibility(suggestionBox, searchField);\n ariaLiveRegion.textContent = '';\n }\n break;\n case code.END:\n case keyCode.END:\n if (visible === 'visible') {\n searchField.focus();\n /* places cursor at the end text in field (if any) */\n searchField.setSelectionRange(searchField.value.length, searchField.value.length);\n listbox.resetListbox(searchField, listEntries);\n ariaLiveRegion.textContent = getAriaLiveTextForResults(listEntries.length, searchTerm);\n }\n break;\n case code.HOME:\n case keyCode.HOME:\n if (visible === 'visible') {\n searchField.focus();\n listbox.resetListbox(searchField, listEntries);\n ariaLiveRegion.textContent = getAriaLiveTextForResults(listEntries.length, searchTerm);\n }\n break;\n case code.ARROW_LEFT:\n case keyCode.ARROW_LEFT:\n case code.ARROW_RIGHT:\n case keyCode.ARROW_RIGHT:\n if (visible === 'visible') {\n listbox.resetListbox(searchField, listEntries);\n ariaLiveRegion.textContent = getAriaLiveTextForResults(listEntries.length, searchTerm);\n }\n break;\n default:\n if (searchTerm.length > 0) {\n ariaLiveRegion.textContent = getAriaLiveTextForResults(listEntries.length, searchTerm);\n }\n break;\n }\n};\n\nconst onFocus = (suggestionBox, e) => {\n const { target: searchField } = e;\n const searchTerm = searchField.value.trim();\n if (searchTerm.length > 0) {\n /* update state */\n state.filteredResults = filterResults(searchTerm, state);\n const { ariaLiveRegion, filteredResults } = state;\n appendResults(filteredResults);\n const isVisible = (filteredResults && filteredResults.length > 0);\n if (listbox.shouldUpdateVisibility(suggestionBox, isVisible)) {\n setSuggestionBoxVisibility(suggestionBox, searchField, isVisible);\n }\n ariaLiveRegion.textContent = getAriaLiveTextForResults(filteredResults.length, searchTerm);\n }\n};\n\nconst onBlur = (suggestionBox, e) => {\n const { ariaLiveRegion } = state;\n const { target: searchField } = e;\n setSuggestionBoxVisibility(suggestionBox, searchField);\n ariaLiveRegion.textContent = '';\n};\n\n/**\n * Updates filteredResults, DOM, and/or toggles visibility as needed before invoking\n * handleKeyPress method.\n * @param {HTMLDivElement} suggestionBox\n * @param {HTMLInputElement} searchField\n * @param {KeyboardEvent} e\n */\nconst onInput = (suggestionBox, searchField, e) => {\n const searchTerm = searchField.value.trim();\n /* only update DOM when necessary */\n state.filteredResults = filterResults(searchTerm, state);\n appendResults(state.filteredResults);\n\n const isVisible = (searchTerm !== ''\n && (state.filteredResults && state.filteredResults.length > 0));\n if (listbox.shouldUpdateVisibility(suggestionBox, isVisible)) {\n setSuggestionBoxVisibility(suggestionBox, searchField, isVisible);\n }\n\n // needed to update aria live region\n handleKeyPress(e);\n};\n\nconst onFormSubmit = () => {\n const {\n suggestionBox,\n searchField,\n } = state;\n const { dataset: { visible } } = suggestionBox || {};\n const searchBoxTerm = suggestionBox.querySelector(`.${LISTBOX.CSS.VISUAL_FOCUS}`);\n if (searchBoxTerm && visible === 'visible') {\n listbox.setSearchField(searchField, searchBoxTerm.innerText.trim());\n handleClickAnalyticsForSearch(searchBoxTerm);\n } else {\n /* search term is typed by user (not a selected entry within the listbox) */\n handleClickAnalyticsForSearch(null, {\n linkName: 'rei_nav:searchbutton',\n searchTermType: 'natural',\n searchTermClicked: searchField.value,\n events: 'event1',\n });\n }\n};\n\nconst onMouseDown = (searchForm, searchField, e) => {\n const { target } = e;\n const { msMatchesSelector } = target;\n if (!target.matches) {\n /* IE11 Support */\n target.matches = msMatchesSelector;\n }\n if (target && (target.matches(`li.${LISTBOX.CSS.LIST_ITEM}`) || target.matches('span'))) {\n const resultEntry = target.matches('span') ? target.parentNode : target;\n const value = (resultEntry.innerText).trim();\n listbox.setSearchField(searchField, value);\n handleClickAnalyticsForSearch(resultEntry);\n searchForm.submit();\n }\n};\n/**\n * Grabs autoSuggestTarget from #gnav-data blob. If not found uses absolute url fallback value\n * @returns {string} url\n */\nconst getAutosuggestTarget = () => {\n const {\n autosuggestTarget: targetUrl = null,\n } = getScriptData('gnav-data') || {};\n return targetUrl === null ? AUTOSUGGEST.URL.FALLBACK : targetUrl;\n};\n\n/* init */\nconst init = (selectors) => {\n const searchElems = getDomElems(selectors);\n if (searchElems === null) return;\n /* build state */\n const {\n searchField,\n suggestionBox,\n suggestionList,\n searchForm,\n } = searchElems;\n const ariaLiveRegion = searchForm.parentElement.querySelector(LISTBOX.ARIA_LIVE.SELECTOR);\n searchField.setAttribute('aria-activedescendant', '');\n Object.assign(state, searchElems, { ariaLiveRegion });\n /* Add Event Listeners */\n searchField.addEventListener('focus', onFocus.bind(null, suggestionBox));\n searchField.addEventListener('blur', onBlur.bind(null, suggestionBox));\n searchField.addEventListener('input', onInput.bind(null, suggestionBox, searchField));\n searchField.addEventListener('keydown', listbox.preventDefaultOnKeyDown);\n searchField.addEventListener('keyup', handleKeyPress);\n searchForm.addEventListener('submit', onFormSubmit);\n suggestionList.addEventListener('mousedown', onMouseDown.bind(null, searchForm, searchField));\n fetchData(getAutosuggestTarget());\n};\n\nexport { state as suggestState };\nexport default init;\n","/**\n * Recent Searches | Search History\n * Contains main functionality for \"Recent Searches\" (aka user search history).\n * Is only visible when the input for search has focus, is empty (no text), and at least one\n * entry / previously saved search exists. The only exception is if the user presses \"escape\".\n * Only then the search field will be empty, with focus, and NOT display Recent Searches.\n *\n * NOT AVAILABLE to 3rd party sites as window.localStorage cannot cross domains (as coded).\n */\nimport { getDomElems } from '../../../../_shared-components/getDomElems';\nimport { code, getKeyCode, keyCode } from '../../../../_shared-components/keyCode';\nimport LISTBOX, { SEARCH_HISTORY } from './constants';\nimport * as listbox from './listboxUtil';\nimport getScriptData from '../../util/getScriptData';\nimport handleClickAnalyticsForSearch from './searchMetrics';\n\nconst recentSearchState = {\n maxCapacity: 10,\n recentSearches: [],\n};\n/* Resets state on init */\nconst setStateOnInit = () => {\n recentSearchState.maxCapacity = 10;\n recentSearchState.recentSearches = [];\n recentSearchState.recentHistoryBox = {};\n};\n\n/**\n * Retrieves the recentSearches from localStorage stored under the key 'savedSearches'\n * @param {Window} win\n */\nconst getRecentSearches = (win = window) => (\n JSON.parse(win.localStorage.getItem(SEARCH_HISTORY.LOCAL_STORAGE_KEY)) || []\n);\n\n/**\n * Removes the savedSearches localStorage key and data\n * @param {Window} win - global window\n */\nconst clearSearchHistory = (win = window) => {\n win.localStorage.removeItem(SEARCH_HISTORY.LOCAL_STORAGE_KEY);\n};\n\n/**\n * Sets search history to local storage.\n * @param {object[]} searchHistory - array of objects with a single property: \"searchTerm\"\n * @param win\n */\nconst setRecentSearches = (searchHistory, win = window) => {\n win.localStorage.setItem(SEARCH_HISTORY.LOCAL_STORAGE_KEY, JSON.stringify(searchHistory));\n};\n\n/**\n * Calls getRecentSearches to see if there are any recentSearches, checks to see if the current\n * searchTerm is empty, removes a recentSearch if there is are more than ten and then sets the\n * current searchTerm\n * @param {string} searchTerm\n * @param {Window} win\n */\nconst addToSearchHistory = (searchTerm = '', win = window) => {\n const { maxCapacity } = recentSearchState;\n if (searchTerm === '') {\n return;\n }\n const recentSearches = getRecentSearches(win)\n .filter((search) => search.searchTerm.toLowerCase() !== searchTerm.toLowerCase());\n\n if (recentSearches.length >= maxCapacity) {\n recentSearches.pop();\n }\n setRecentSearches([{ searchTerm }, ...recentSearches]);\n};\n\n/**\n * Checks if element is the clear search history button by id\n * @param {HTMLLIElement} elemToCheck\n * @returns {boolean} - true if element is the clear search history button\n */\nconst isDeleteSearchHistoryButton = (elemToCheck) => (\n elemToCheck && elemToCheck.firstElementChild\n && elemToCheck.firstElementChild.id === SEARCH_HISTORY.DELETE.ID\n);\n\n/**\n * @param {number} listEntryCount Current count clickable list items in recent searches.\n * Number will always be greater than one because the delete history button is included.\n * @returns {string} describing the current number of Recent Search History entries, including\n * directions on how to navigation the open listbox.\n */\nconst getAriaLiveTextForTotalResults = (listEntryCount) => (\n `Recent Search History has ${listEntryCount} options available. ${LISTBOX.ARIA_LIVE.DIRECTIONS}`\n);\n\nconst getAllListEntries = () => (\n recentSearchState.recentHistoryBox.querySelectorAll(LISTBOX.ALL_LI.SELECTOR)\n);\n\n/**\n * Creates List Entry with a child element whose tagName and properties are\n * specified in the params. Used to build the title and delete button list entries.\n * @param {string} childTagName: string tagName. Ex. 'button', 'div', 'span'.\n * @param {object} elemPropsToSet: properties to set for the child element\n * @returns {HTMLLIElement}\n */\nconst createListEntryWithChildElem = (childTagName, elemPropsToSet) => {\n const listEntry = document.createElement('li');\n listEntry.className = 'search-history__entry';\n const elem = document.createElement(childTagName);\n Object.keys(elemPropsToSet).forEach((key) => {\n elem[key] = elemPropsToSet[key];\n });\n listEntry.appendChild(elem);\n return listEntry;\n};\n\nconst onMouseLeave = (e) => {\n const { target } = e;\n const { ariaLiveRegion, searchField } = recentSearchState;\n const listEntries = getAllListEntries();\n if (target.classList.contains(LISTBOX.CSS.VISUAL_FOCUS)) {\n listbox.resetListbox(searchField, listEntries);\n ariaLiveRegion.textContent = getAriaLiveTextForTotalResults(listEntries.length);\n }\n};\n\nconst onMouseEnter = (e) => {\n const { target } = e;\n const { ariaLiveRegion, searchField } = recentSearchState;\n const listEntries = getAllListEntries();\n listbox.setVisualFocus(searchField, target, listEntries);\n ariaLiveRegion.textContent = '';\n};\n\n/**\n * Creates, adds mouseEventListeners, and appends markup to the DOM with the Search History list.\n * First entry is read-only title (unclickable, unfocusable). The last entry is a delete button\n * so user can clear their recent search history.\n * @param {HTMLDivElement} recentHistoryBox listbox and parent element of ul\n * @param {object[]} results: Array of previously saved searches\n */\nconst appendRecentSearches = (recentHistoryBox, results = []) => {\n const ul = recentHistoryBox.querySelector(`#${SEARCH_HISTORY.UL_ID}`);\n ul.innerHTML = '';\n /* First entry of recent searches results is title */\n ul.appendChild(createListEntryWithChildElem('div', {\n className: SEARCH_HISTORY.TITLE.CSS,\n textContent: SEARCH_HISTORY.TITLE.TEXT,\n }));\n\n [...results].forEach(({ searchTerm }, index) => {\n const li = document.createElement('li');\n li.className = LISTBOX.CSS.LIST_ITEM;\n li.textContent = searchTerm;\n li.setAttribute('aria-label', searchTerm);\n li.setAttribute('role', 'option');\n /* id with index used for building metrics.link config */\n li.setAttribute('id', `${SEARCH_HISTORY.LI_ID(index)}`);\n /* Add MouseEnter, MouseLeave listeners */\n listbox.addMouseMoveEventListeners(li, onMouseEnter, onMouseLeave);\n ul.appendChild(li);\n });\n /* Last entry of recent searches is clear search history button */\n const clearHistoryListItem = createListEntryWithChildElem('button', {\n className: SEARCH_HISTORY.DELETE.CSS,\n id: SEARCH_HISTORY.DELETE.ID,\n textContent: SEARCH_HISTORY.DELETE.TEXT,\n type: 'button',\n tabIndex: '-1',\n });\n clearHistoryListItem.setAttribute('role', 'option');\n clearHistoryListItem.setAttribute('id', `${SEARCH_HISTORY.LI_ID(results.length)}`);\n clearHistoryListItem.setAttribute('aria-label', `${SEARCH_HISTORY.DELETE.TEXT}, button`);\n /* add listener to button (not li) */\n listbox.addMouseMoveEventListeners(clearHistoryListItem, onMouseEnter, onMouseLeave);\n ul.appendChild(clearHistoryListItem);\n};\n\n/**\n * Controls visibility / expand-collapse of recentSearchBox for both recent searches and\n * filtered results (aka autocomplete).\n * @param {HTMLDivElement} recentHistoryBox - element that contains the list entries of recent\n * searches or filtered results\n * @param {HTMLInputElement} searchField - input element of search field\n * @param {boolean} isVisible - boolean used to determine state of visibility / expansion\n */\nconst setRecentSearchBoxVisibility = (recentHistoryBox, searchField, isVisible = false) => {\n const searchTerm = searchField.value.trim();\n if (!isVisible || searchTerm.length > 0) {\n listbox.resetListbox(searchField, [...getAllListEntries()]);\n recentHistoryBox.setAttribute('data-visible', 'hidden');\n }\n if (searchTerm.length === 0) {\n searchField.parentElement.setAttribute('aria-expanded', `${isVisible}`);\n recentHistoryBox.setAttribute('data-visible', isVisible ? 'visible' : 'hidden');\n }\n};\n\n/**\n * Resets search history state, visibility, and focus when user deletes all recent searches\n * @param {HTMLDivElement} recentHistoryBox\n * @param {HTMLInputElement} searchField\n */\nconst deleteAllRecentSearches = (recentHistoryBox, searchField) => {\n const { ariaLiveRegion } = recentSearchState;\n clearSearchHistory();\n recentSearchState.recentSearches = [];\n ariaLiveRegion.textContent = '';\n setRecentSearchBoxVisibility(recentHistoryBox, searchField);\n searchField.focus();\n};\n\n/**\n * Handles the keyboard logic for list entries in RecentSearchBox\n * @param e\n */\nconst handleKeyPress = (e) => {\n const {\n ariaLiveRegion,\n recentHistoryBox,\n searchField,\n } = recentSearchState;\n /* limit results to current list */\n const listEntries = recentHistoryBox.querySelectorAll(LISTBOX.ALL_LI.SELECTOR);\n const currentIndex = listbox.getIndexFromElement(recentHistoryBox.querySelector(`.${LISTBOX.CSS.VISUAL_FOCUS}`));\n const keyCodeVal = getKeyCode(e);\n switch (keyCodeVal) {\n case code.ARROW_DOWN:\n case keyCode.ARROW_DOWN: {\n const updatedIndex = listbox.getUpdatedIndexOnArrowDown(currentIndex, listEntries.length);\n ariaLiveRegion.textContent = '';\n listbox.setVisualFocus(searchField, listEntries[updatedIndex], listEntries);\n localStorage.setItem(\n SEARCH_HISTORY.RECENTLY_SELECTED,\n listEntries[updatedIndex]?.innerText.trim()\n );\n break;\n }\n case code.ARROW_UP:\n case keyCode.ARROW_UP: {\n const updatedIndex = listbox.getUpdatedIndexOnArrowUp(currentIndex, listEntries.length);\n listbox.setVisualFocus(searchField, listEntries[updatedIndex], listEntries);\n ariaLiveRegion.textContent = '';\n localStorage.setItem(\n SEARCH_HISTORY.RECENTLY_SELECTED,\n listEntries[updatedIndex]?.innerText.trim()\n );\n break;\n }\n case code.ESCAPE:\n case keyCode.ESCAPE:\n searchField.focus();\n /* close search history. Only case where searchField has focus and does\n * NOT display search history */\n setRecentSearchBoxVisibility(recentHistoryBox, searchField);\n ariaLiveRegion.textContent = '';\n break;\n case code.END:\n case keyCode.END:\n case code.HOME:\n case keyCode.HOME:\n searchField.focus();\n listbox.resetListbox(searchField, listEntries);\n ariaLiveRegion.textContent = getAriaLiveTextForTotalResults(listEntries.length);\n break;\n case code.ARROW_LEFT:\n case keyCode.ARROW_LEFT:\n case code.ARROW_RIGHT:\n case keyCode.ARROW_RIGHT:\n listbox.resetListbox(searchField, listEntries);\n ariaLiveRegion.textContent = getAriaLiveTextForTotalResults(listEntries.length);\n break;\n default:\n break;\n }\n};\n\nconst onKeyUp = (recentHistoryBox, e) => {\n const { recentSearches, ariaLiveRegion, searchForm } = recentSearchState;\n const { target: searchField } = e;\n const searchTerm = searchField.value.trim();\n const isVisible = (recentSearches && recentSearches.length > 0 && searchTerm.length === 0);\n const visibilityChanged = listbox.shouldUpdateVisibility(recentHistoryBox, isVisible);\n if (visibilityChanged) {\n setRecentSearchBoxVisibility(recentHistoryBox, searchField, isVisible);\n /* If autosuggest is not enabled then set aria-expanded & clear aria-live */\n if (!isVisible && searchForm.querySelectorAll('[role=\"listbox\"]').length === 1) {\n searchField.parentElement.setAttribute('aria-expanded', 'false');\n ariaLiveRegion.textContent = '';\n }\n }\n if (isVisible) {\n /* update DOM only when necessary */\n if (visibilityChanged) {\n appendRecentSearches(recentHistoryBox, recentSearches);\n /* increment length to include delete history button */\n ariaLiveRegion.textContent = getAriaLiveTextForTotalResults(recentSearches.length + 1);\n }\n handleKeyPress(e);\n }\n};\n\nconst onBlur = (ariaLiveRegion, recentHistoryBox, e) => {\n const { target: searchField } = e;\n const ariaLive = ariaLiveRegion;\n setRecentSearchBoxVisibility(recentHistoryBox, searchField);\n ariaLive.textContent = '';\n};\n\nconst onMouseDown = (searchField, searchForm, recentHistoryBox, e) => {\n const { target: mouseTrgt } = e;\n /* If LI contains BUTTON - event registers on BUTTON */\n const target = mouseTrgt.tagName === 'BUTTON' ? mouseTrgt.parentElement : mouseTrgt;\n const { msMatchesSelector, id = '' } = target;\n if (!target.matches) {\n /* IE 11 support */\n target.matches = msMatchesSelector;\n }\n if (target && target.matches(`${LISTBOX.ALL_LI.SELECTOR}`)) {\n const resultEntry = target;\n const value = (resultEntry.innerText).trim();\n if (isDeleteSearchHistoryButton(target)) {\n deleteAllRecentSearches(recentHistoryBox, searchField);\n handleClickAnalyticsForSearch(resultEntry);\n } else if (id.startsWith('autosuggest')) {\n /* Entry in autosuggest was selected */\n addToSearchHistory(value);\n } else {\n /* Entry in search history was selected */\n listbox.setSearchField(searchField, value);\n addToSearchHistory(value);\n handleClickAnalyticsForSearch(resultEntry);\n searchForm.submit();\n }\n }\n};\n\nconst onFocus = (recentHistoryBox, e) => {\n const { target: searchField } = e;\n const searchTerm = searchField.value.trim();\n const { recentSearches = [], ariaLiveRegion } = recentSearchState;\n if (recentSearches && recentSearches.length > 0 && searchTerm.length === 0) {\n setRecentSearchBoxVisibility(recentHistoryBox, searchField, true);\n appendRecentSearches(recentHistoryBox, recentSearches);\n /* increment recentSearches length to include delete history button */\n ariaLiveRegion.textContent = getAriaLiveTextForTotalResults(recentSearches.length + 1);\n }\n};\n\n/**\n * Submitter is always search button. Invoked when selecting list entries via keyboard events\n * or when text is submitted from the input element via keyboard or clicking search button\n * @param recentHistoryBox\n * @param searchField\n * @param e\n */\nconst onFormSubmit = (recentHistoryBox, searchField, e) => {\n const { target: searchForm } = e;\n const liWithVisualFocus = searchForm.querySelector(`.${LISTBOX.CSS.VISUAL_FOCUS}`);\n if (isDeleteSearchHistoryButton(liWithVisualFocus)) {\n e.preventDefault();\n deleteAllRecentSearches(recentHistoryBox, searchField);\n } else {\n if (liWithVisualFocus) {\n listbox.setSearchField(searchField, liWithVisualFocus.innerText.trim());\n handleClickAnalyticsForSearch(liWithVisualFocus);\n }\n /* Saves text submitted from input and maintains list order if entry in history was selected */\n addToSearchHistory(searchField.value.trim());\n }\n};\n\n/**\n * Helper method that retrieves the configured property for number of saved recent search entries.\n * Range of the configured value (x) is 0 < x < 26.\n * capacity cannot be set to null, 0, or > 25 entries via configuration.\n * @returns {number} Configured number within the range of . Has default value of 10\n */\nconst getCustomMaxCapacityOrDefault = () => {\n const { recentSearchMaxSize = 10 } = getScriptData('gnav-data') || {};\n const useFallback = recentSearchMaxSize === null\n || (recentSearchMaxSize * 1) < 1\n || (recentSearchMaxSize * 1) > 25;\n return useFallback ? 10 : (recentSearchMaxSize * 1);\n};\n\n/* init */\nconst init = (selectors) => {\n const searchElems = getDomElems(selectors);\n if (searchElems === null) return;\n setStateOnInit();\n /* build state */\n let recentSearches = getRecentSearches();\n const maxCapacity = getCustomMaxCapacityOrDefault();\n /* Handles edge case if the capacity is lowered, but user has previous history */\n if (recentSearches.length > maxCapacity) {\n setRecentSearches(recentSearches.slice(0, maxCapacity));\n recentSearches = getRecentSearches();\n }\n /* find and set up related elems */\n const { searchForm, recentHistoryBox } = searchElems;\n const searchField = searchForm.querySelector('[data-js=search-field]');\n searchField.setAttribute('aria-activedescendant', '');\n const ariaLiveRegion = searchForm.querySelector(`${LISTBOX.ARIA_LIVE.SELECTOR}`);\n Object.assign(recentSearchState, searchElems, {\n ariaLiveRegion, recentSearches, searchField, maxCapacity,\n });\n /* Event Listeners */\n searchField.addEventListener('focus', onFocus.bind(null, recentHistoryBox));\n searchField.addEventListener('blur', onBlur.bind(null, ariaLiveRegion, recentHistoryBox));\n searchField.addEventListener('keydown', listbox.preventDefaultOnKeyDown);\n searchField.addEventListener('keyup', onKeyUp.bind(null, recentHistoryBox));\n searchForm.addEventListener('submit', onFormSubmit.bind(null, recentHistoryBox, searchField));\n /* mousedown has slightly larger scope in order to capture selections made from autosuggest */\n searchForm.addEventListener('mousedown', onMouseDown.bind(null, searchField, searchForm, recentHistoryBox));\n};\nexport default init;\n","/**\n * Search Field in Masthead\n * Optional part of Global Navigation. Includes conditional initialization of autosuggest,\n * and recent search history.\n */\n\nimport searchInit from '../search';\nimport suggestInit from '../suggest';\nimport recentSearchInit from '../recents';\nimport getScriptData from '../../../util/getScriptData';\n\nconst {\n enableAutosuggest = false,\n enableRecentSearch = false,\n showSearch = false,\n searchAction = '',\n useConstructorAutosuggest = false,\n} = getScriptData('gnav-data') || {};\n\nexport function app(win) {\n if (showSearch) {\n /* init the search bar (expand / contract) */\n searchInit({\n masthead: '[data-js=masthead]',\n searchForm: '[data-js=search-form]',\n searchField: '[data-js=search-field]',\n clearButton: '[data-js=clear-button]',\n searchButton: '[data-js=search-button]',\n searchCancel: '[data-js=search-cancel]',\n });\n }\n if (enableAutosuggest && !(useConstructorAutosuggest && searchAction === '/search')) {\n /* init listboxes - autosuggest & recent search history */\n suggestInit({\n searchField: '[data-js=search-field]',\n suggestionBox: '[data-js=suggestion-box]',\n suggestionList: '[data-js=suggestion-list]',\n searchForm: '[data-js=search-form]',\n });\n }\n if (enableRecentSearch) {\n recentSearchInit({\n recentHistoryBox: '[data-js=recent-search-box]',\n searchForm: '[data-js=search-form]',\n });\n }\n\n return win;\n}\n\nexport function main(win = window) {\n if (win.document.readyState === 'loading') {\n // Loading hasn't finished yet\n win.document.addEventListener('DOMContentLoaded', app.bind(null, win));\n } else {\n // `DOMContentLoaded` has already fired\n app(win);\n }\n}\n","import '../../../../../util/global-shim';\nimport { main } from './main';\nimport '../../../../../../style/navigation/global/components/search/base-search.scss';\n/**\n * This is the main js entry point for search component(s)\n *\n * @param win Window object. Pass in to allow for window stubbing.\n * @returns {Window}\n */\nmain(window);\n"],"names":["$TypeError","validateArgumentsLength","passed","required","defineBuiltIn","require$$0","uncurryThis","require$$1","toString","require$$2","require$$3","$URLSearchParams","URLSearchParamsPrototype","append","$delete","forEach","push","params","name","length","$value","entries","v","k","key","value","index","dindex","found","entriesLength","entry","getAll","$has","values","DESCRIPTORS","defineBuiltInAccessor","count","SEARCH_HISTORY","LI_ID","UL_ID","LOCAL_STORAGE_KEY","SELECTOR","RECENTLY_SELECTED","DELETE","ID","CSS","TEXT","TITLE","AUTOSUGGEST","URL","FALLBACK","LISTBOX","VISUAL_FOCUS","LIST_ITEM","ARIA_LIVE","DIRECTIONS","ALL_LI","preventDefaultOnKeyDown","e","getKeyCode","code","ARROW_DOWN","keyCode","ARROW_UP","END","preventDefault","getUpdatedIndexOnArrowDown","currentIndex","getUpdatedIndexOnArrowUp","setSearchField","searchField","search","cleanListEntries","listEntries","elem","classList","remove","removeAttribute","resetListbox","setAttribute","getIndexFromElement","id","wordsArr","split","setVisualFocus","listItem","add","shouldUpdateVisibility","listboxElem","newValue","dataset","visible","visibleValue","addMouseMoveEventListeners","dynamicElem","enterCallback","leaveCallback","addEventListener","getSearchParam","param","URLSearchParams","window","location","get","showClearButton","clearButton","hideClearButton","setClearButtonVisibility","enableSearchButton","searchButton","trim","enableSearchFormSubmit","searchForm","recentSearchTermSelected","localStorage","getItem","recentHistoryBox","document","querySelector","removeItem","setTimeout","parentElement","submit","updateSearchField","inputElem","focus","init","selectors","searchElems","getDomElems","bind","sliceSize","cleanSearchResult","item","replace","getStartsWithData","data","cleanedSearchTerm","filter","startsWith","getIncludesData","includes","partitionData","cleanSearchTerm","map","term","optionalSpecialCharacterPattern","i","len","optionalSpecialCharacterRegExp","RegExp","matches","match","searchTerm","resultTitle","specialCharacterRegExp","toLowerCase","cleanFetchedItems","fetchedItems","filterResults","state","newState","startsWithData","includesData","concat","filteredResults","slice","isSearchHistoryEntry","elemId","getConditionalProps","autoSuggestPosition","searchTermType","recentQuery","buildListboxClickAnalyticsConfig","resultEntry","innerText","linkName","searchTermClicked","events","handleClickAnalyticsForSearch","altConfig","configToUse","analyticsCustomClickHandler","fetchData","fetchPoint","fetch","then","response","ok","status","url","console","error","json","catch","getInnerHtml","getAriaLiveTextForResults","resultCount","onMouseLeave","target","suggestionBox","ariaLiveRegion","querySelectorAll","contains","listbox","textContent","onMouseEnter","appendResults","results","suggestionList","ul","innerHTML","li","createElement","className","appendChild","setSuggestionBoxVisibility","isVisible","handleKeyPress","keyCodeVal","updatedIndex","ESCAPE","setSelectionRange","HOME","ARROW_LEFT","ARROW_RIGHT","onFocus","onBlur","onInput","onFormSubmit","searchBoxTerm","onMouseDown","msMatchesSelector","parentNode","getAutosuggestTarget","autosuggestTarget","targetUrl","getScriptData","Object","assign","recentSearchState","maxCapacity","recentSearches","setStateOnInit","getRecentSearches","win","JSON","parse","clearSearchHistory","setRecentSearches","searchHistory","setItem","stringify","addToSearchHistory","pop","isDeleteSearchHistoryButton","elemToCheck","firstElementChild","getAriaLiveTextForTotalResults","listEntryCount","getAllListEntries","createListEntryWithChildElem","childTagName","elemPropsToSet","listEntry","keys","appendRecentSearches","clearHistoryListItem","type","tabIndex","setRecentSearchBoxVisibility","deleteAllRecentSearches","onKeyUp","visibilityChanged","ariaLive","mouseTrgt","tagName","liWithVisualFocus","getCustomMaxCapacityOrDefault","recentSearchMaxSize","enableAutosuggest","enableRecentSearch","showSearch","searchAction","useConstructorAutosuggest","app","searchInit","masthead","searchCancel","suggestInit","recentSearchInit","main","readyState"],"mappings":"khBACA,IAAIA,GAAa,UAEjBC,GAAiB,SAAUC,EAAQC,EAAU,CAC3C,GAAID,EAASC,EAAU,MAAM,IAAIH,GAAW,sBAAsB,EAClE,OAAOE,CACT,ECLIE,GAAgBC,EAChBC,EAAcC,EACdC,EAAWC,EACXR,GAA0BS,GAE1BC,GAAmB,gBACnBC,EAA2BD,GAAiB,UAC5CE,GAASP,EAAYM,EAAyB,MAAM,EACpDE,EAAUR,EAAYM,EAAyB,MAAS,EACxDG,GAAUT,EAAYM,EAAyB,OAAO,EACtDI,GAAOV,EAAY,CAAE,EAAC,IAAI,EAC1BW,EAAS,IAAIN,GAAiB,aAAa,EAE/CM,EAAO,OAAU,IAAK,CAAC,EAGvBA,EAAO,OAAU,IAAK,MAAS,EAE3BA,EAAS,IAAO,OAClBb,GAAcQ,EAA0B,SAAU,SAAUM,EAAoB,CAC9E,IAAIC,EAAS,UAAU,OACnBC,EAASD,EAAS,EAAI,OAAY,UAAU,CAAC,EACjD,GAAIA,GAAUC,IAAW,OAAW,OAAON,EAAQ,KAAMI,CAAI,EAC7D,IAAIG,EAAU,CAAE,EAChBN,GAAQ,KAAM,SAAUO,GAAGC,GAAG,CAC5BP,GAAKK,EAAS,CAAE,IAAKE,GAAG,MAAOD,GAAG,CACxC,CAAK,EACDrB,GAAwBkB,EAAQ,CAAC,EAQjC,QAPIK,EAAMhB,EAASU,CAAI,EACnBO,EAAQjB,EAASY,CAAM,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