From 2e1118503170cce4ccd28a23e92bafe86c8cb2d4 Mon Sep 17 00:00:00 2001 From: kordwarshuis Date: Mon, 4 Nov 2024 10:04:26 +0000 Subject: [PATCH] deploy: 5b07371e3d570aeb208b8c273ea8ea8a0f117b60 --- additional1.bundle.js | 51 ++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/additional1.bundle.js b/additional1.bundle.js index 65f9b33..130bf0a 100644 --- a/additional1.bundle.js +++ b/additional1.bundle.js @@ -114,7 +114,7 @@ eval("\n\nvar compact = __webpack_require__(/*! ../functions/compact */ \"./node /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -eval("\n\nvar EventEmitter = __webpack_require__(/*! @algolia/events */ \"./node_modules/@algolia/events/events.js\");\n\nvar DerivedHelper = __webpack_require__(/*! ./DerivedHelper */ \"./node_modules/algoliasearch-helper/src/DerivedHelper/index.js\");\nvar escapeFacetValue = (__webpack_require__(/*! ./functions/escapeFacetValue */ \"./node_modules/algoliasearch-helper/src/functions/escapeFacetValue.js\").escapeFacetValue);\nvar inherits = __webpack_require__(/*! ./functions/inherits */ \"./node_modules/algoliasearch-helper/src/functions/inherits.js\");\nvar merge = __webpack_require__(/*! ./functions/merge */ \"./node_modules/algoliasearch-helper/src/functions/merge.js\");\nvar objectHasKeys = __webpack_require__(/*! ./functions/objectHasKeys */ \"./node_modules/algoliasearch-helper/src/functions/objectHasKeys.js\");\nvar omit = __webpack_require__(/*! ./functions/omit */ \"./node_modules/algoliasearch-helper/src/functions/omit.js\");\nvar RecommendParameters = __webpack_require__(/*! ./RecommendParameters */ \"./node_modules/algoliasearch-helper/src/RecommendParameters/index.js\");\nvar RecommendResults = __webpack_require__(/*! ./RecommendResults */ \"./node_modules/algoliasearch-helper/src/RecommendResults/index.js\");\nvar requestBuilder = __webpack_require__(/*! ./requestBuilder */ \"./node_modules/algoliasearch-helper/src/requestBuilder.js\");\nvar SearchParameters = __webpack_require__(/*! ./SearchParameters */ \"./node_modules/algoliasearch-helper/src/SearchParameters/index.js\");\nvar SearchResults = __webpack_require__(/*! ./SearchResults */ \"./node_modules/algoliasearch-helper/src/SearchResults/index.js\");\nvar sortAndMergeRecommendations = __webpack_require__(/*! ./utils/sortAndMergeRecommendations */ \"./node_modules/algoliasearch-helper/src/utils/sortAndMergeRecommendations.js\");\nvar version = __webpack_require__(/*! ./version */ \"./node_modules/algoliasearch-helper/src/version.js\");\n\n/**\n * Event triggered when a parameter is set or updated\n * @event AlgoliaSearchHelper#event:change\n * @property {object} event\n * @property {SearchParameters} event.state the current parameters with the latest changes applied\n * @property {SearchResults} event.results the previous results received from Algolia. `null` before the first request\n * @example\n * helper.on('change', function(event) {\n * console.log('The parameters have changed');\n * });\n */\n\n/**\n * Event triggered when a main search is sent to Algolia\n * @event AlgoliaSearchHelper#event:search\n * @property {object} event\n * @property {SearchParameters} event.state the parameters used for this search\n * @property {SearchResults} event.results the results from the previous search. `null` if it is the first search.\n * @example\n * helper.on('search', function(event) {\n * console.log('Search sent');\n * });\n */\n\n/**\n * Event triggered when a search using `searchForFacetValues` is sent to Algolia\n * @event AlgoliaSearchHelper#event:searchForFacetValues\n * @property {object} event\n * @property {SearchParameters} event.state the parameters used for this search it is the first search.\n * @property {string} event.facet the facet searched into\n * @property {string} event.query the query used to search in the facets\n * @example\n * helper.on('searchForFacetValues', function(event) {\n * console.log('searchForFacetValues sent');\n * });\n */\n\n/**\n * Event triggered when a search using `searchOnce` is sent to Algolia\n * @event AlgoliaSearchHelper#event:searchOnce\n * @property {object} event\n * @property {SearchParameters} event.state the parameters used for this search it is the first search.\n * @example\n * helper.on('searchOnce', function(event) {\n * console.log('searchOnce sent');\n * });\n */\n\n/**\n * Event triggered when the results are retrieved from Algolia\n * @event AlgoliaSearchHelper#event:result\n * @property {object} event\n * @property {SearchResults} event.results the results received from Algolia\n * @property {SearchParameters} event.state the parameters used to query Algolia. Those might be different from the one in the helper instance (for example if the network is unreliable).\n * @example\n * helper.on('result', function(event) {\n * console.log('Search results received');\n * });\n */\n\n/**\n * Event triggered when Algolia sends back an error. For example, if an unknown parameter is\n * used, the error can be caught using this event.\n * @event AlgoliaSearchHelper#event:error\n * @property {object} event\n * @property {Error} event.error the error returned by the Algolia.\n * @example\n * helper.on('error', function(event) {\n * console.log('Houston we got a problem.');\n * });\n */\n\n/**\n * Event triggered when the queue of queries have been depleted (with any result or outdated queries)\n * @event AlgoliaSearchHelper#event:searchQueueEmpty\n * @example\n * helper.on('searchQueueEmpty', function() {\n * console.log('No more search pending');\n * // This is received before the result event if we're not expecting new results\n * });\n *\n * helper.search();\n */\n\n/**\n * Initialize a new AlgoliaSearchHelper\n * @class\n * @classdesc The AlgoliaSearchHelper is a class that ease the management of the\n * search. It provides an event based interface for search callbacks:\n * - change: when the internal search state is changed.\n * This event contains a {@link SearchParameters} object and the\n * {@link SearchResults} of the last result if any.\n * - search: when a search is triggered using the `search()` method.\n * - result: when the response is retrieved from Algolia and is processed.\n * This event contains a {@link SearchResults} object and the\n * {@link SearchParameters} corresponding to this answer.\n * - error: when the response is an error. This event contains the error returned by the server.\n * @param {AlgoliaSearch} client an AlgoliaSearch client\n * @param {string} index the index name to query\n * @param {SearchParameters | object} options an object defining the initial\n * config of the search. It doesn't have to be a {SearchParameters},\n * just an object containing the properties you need from it.\n * @param {SearchResultsOptions|object} searchResultsOptions an object defining the options to use when creating the search results.\n */\nfunction AlgoliaSearchHelper(client, index, options, searchResultsOptions) {\n if (typeof client.addAlgoliaAgent === 'function') {\n client.addAlgoliaAgent('JS Helper (' + version + ')');\n }\n\n this.setClient(client);\n var opts = options || {};\n opts.index = index;\n this.state = SearchParameters.make(opts);\n this.recommendState = new RecommendParameters({\n params: opts.recommendState,\n });\n this.lastResults = null;\n this.lastRecommendResults = null;\n this._queryId = 0;\n this._recommendQueryId = 0;\n this._lastQueryIdReceived = -1;\n this._lastRecommendQueryIdReceived = -1;\n this.derivedHelpers = [];\n this._currentNbQueries = 0;\n this._currentNbRecommendQueries = 0;\n this._searchResultsOptions = searchResultsOptions;\n this._recommendCache = {};\n}\n\ninherits(AlgoliaSearchHelper, EventEmitter);\n\n/**\n * Start the search with the parameters set in the state. When the\n * method is called, it triggers a `search` event. The results will\n * be available through the `result` event. If an error occurs, an\n * `error` will be fired instead.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires search\n * @fires result\n * @fires error\n * @chainable\n */\nAlgoliaSearchHelper.prototype.search = function () {\n this._search({ onlyWithDerivedHelpers: false });\n return this;\n};\n\nAlgoliaSearchHelper.prototype.searchOnlyWithDerivedHelpers = function () {\n this._search({ onlyWithDerivedHelpers: true });\n return this;\n};\n\n/**\n * Sends the recommendation queries set in the state. When the method is\n * called, it triggers a `fetch` event. The results will be available through\n * the `result` event. If an error occurs, an `error` will be fired instead.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires fetch\n * @fires result\n * @fires error\n * @chainable\n */\nAlgoliaSearchHelper.prototype.recommend = function () {\n this._recommend();\n return this;\n};\n\n/**\n * Gets the search query parameters that would be sent to the Algolia Client\n * for the hits\n * @return {object} Query Parameters\n */\nAlgoliaSearchHelper.prototype.getQuery = function () {\n var state = this.state;\n return requestBuilder._getHitsSearchParams(state);\n};\n\n/**\n * Start a search using a modified version of the current state. This method does\n * not trigger the helper lifecycle and does not modify the state kept internally\n * by the helper. This second aspect means that the next search call will be the\n * same as a search call before calling searchOnce.\n * @param {object} options can contain all the parameters that can be set to SearchParameters\n * plus the index\n * @param {function} [cb] optional callback executed when the response from the\n * server is back.\n * @return {promise|undefined} if a callback is passed the method returns undefined\n * otherwise it returns a promise containing an object with two keys :\n * - content with a SearchResults\n * - state with the state used for the query as a SearchParameters\n * @example\n * // Changing the number of records returned per page to 1\n * // This example uses the callback API\n * var state = helper.searchOnce({hitsPerPage: 1},\n * function(error, content, state) {\n * // if an error occurred it will be passed in error, otherwise its value is null\n * // content contains the results formatted as a SearchResults\n * // state is the instance of SearchParameters used for this search\n * });\n * @example\n * // Changing the number of records returned per page to 1\n * // This example uses the promise API\n * var state1 = helper.searchOnce({hitsPerPage: 1})\n * .then(promiseHandler);\n *\n * function promiseHandler(res) {\n * // res contains\n * // {\n * // content : SearchResults\n * // state : SearchParameters (the one used for this specific search)\n * // }\n * }\n */\nAlgoliaSearchHelper.prototype.searchOnce = function (options, cb) {\n var tempState = !options\n ? this.state\n : this.state.setQueryParameters(options);\n var queries = requestBuilder._getQueries(tempState.index, tempState);\n // eslint-disable-next-line consistent-this\n var self = this;\n\n this._currentNbQueries++;\n\n this.emit('searchOnce', {\n state: tempState,\n });\n\n if (cb) {\n this.client\n .search(queries)\n .then(function (content) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) {\n self.emit('searchQueueEmpty');\n }\n\n cb(null, new SearchResults(tempState, content.results), tempState);\n })\n .catch(function (err) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) {\n self.emit('searchQueueEmpty');\n }\n\n cb(err, null, tempState);\n });\n\n return undefined;\n }\n\n return this.client.search(queries).then(\n function (content) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n return {\n content: new SearchResults(tempState, content.results),\n state: tempState,\n _originalResponse: content,\n };\n },\n function (e) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n throw e;\n }\n );\n};\n\n/**\n * Start the search for answers with the parameters set in the state.\n * This method returns a promise.\n * @param {Object} options - the options for answers API call\n * @param {string[]} options.attributesForPrediction - Attributes to use for predictions. If empty, `searchableAttributes` is used instead.\n * @param {string[]} options.queryLanguages - The languages in the query. Currently only supports ['en'].\n * @param {number} options.nbHits - Maximum number of answers to retrieve from the Answers Engine. Cannot be greater than 1000.\n *\n * @return {promise} the answer results\n * @deprecated answers is deprecated and will be replaced with new initiatives\n */\nAlgoliaSearchHelper.prototype.findAnswers = function (options) {\n // eslint-disable-next-line no-console\n console.warn('[algoliasearch-helper] answers is no longer supported');\n var state = this.state;\n var derivedHelper = this.derivedHelpers[0];\n if (!derivedHelper) {\n return Promise.resolve([]);\n }\n var derivedState = derivedHelper.getModifiedState(state);\n var data = merge(\n {\n attributesForPrediction: options.attributesForPrediction,\n nbHits: options.nbHits,\n },\n {\n params: omit(requestBuilder._getHitsSearchParams(derivedState), [\n 'attributesToSnippet',\n 'hitsPerPage',\n 'restrictSearchableAttributes',\n 'snippetEllipsisText',\n ]),\n }\n );\n\n var errorMessage =\n 'search for answers was called, but this client does not have a function client.initIndex(index).findAnswers';\n if (typeof this.client.initIndex !== 'function') {\n throw new Error(errorMessage);\n }\n var index = this.client.initIndex(derivedState.index);\n if (typeof index.findAnswers !== 'function') {\n throw new Error(errorMessage);\n }\n return index.findAnswers(derivedState.query, options.queryLanguages, data);\n};\n\n/**\n * Structure of each result when using\n * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues)\n * @typedef FacetSearchHit\n * @type {object}\n * @property {string} value the facet value\n * @property {string} highlighted the facet value highlighted with the query string\n * @property {number} count number of occurrence of this facet value\n * @property {boolean} isRefined true if the value is already refined\n */\n\n/**\n * Structure of the data resolved by the\n * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues)\n * promise.\n * @typedef FacetSearchResult\n * @type {object}\n * @property {FacetSearchHit} facetHits the results for this search for facet values\n * @property {number} processingTimeMS time taken by the query inside the engine\n */\n\n/**\n * Search for facet values based on an query and the name of a faceted attribute. This\n * triggers a search and will return a promise. On top of using the query, it also sends\n * the parameters from the state so that the search is narrowed down to only the possible values.\n *\n * See the description of [FacetSearchResult](reference.html#FacetSearchResult)\n * @param {string} facet the name of the faceted attribute\n * @param {string} query the string query for the search\n * @param {number} [maxFacetHits] the maximum number values returned. Should be > 0 and <= 100\n * @param {object} [userState] the set of custom parameters to use on top of the current state. Setting a property to `undefined` removes\n * it in the generated query.\n * @return {promise.} the results of the search\n */\nAlgoliaSearchHelper.prototype.searchForFacetValues = function (\n facet,\n query,\n maxFacetHits,\n userState\n) {\n var clientHasSFFV = typeof this.client.searchForFacetValues === 'function';\n var clientHasInitIndex = typeof this.client.initIndex === 'function';\n if (\n !clientHasSFFV &&\n !clientHasInitIndex &&\n typeof this.client.search !== 'function'\n ) {\n throw new Error(\n 'search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues'\n );\n }\n\n var state = this.state.setQueryParameters(userState || {});\n var isDisjunctive = state.isDisjunctiveFacet(facet);\n var algoliaQuery = requestBuilder.getSearchForFacetQuery(\n facet,\n query,\n maxFacetHits,\n state\n );\n\n this._currentNbQueries++;\n // eslint-disable-next-line consistent-this\n var self = this;\n var searchForFacetValuesPromise;\n // newer algoliasearch ^3.27.1 - ~4.0.0\n if (clientHasSFFV) {\n searchForFacetValuesPromise = this.client.searchForFacetValues([\n { indexName: state.index, params: algoliaQuery },\n ]);\n // algoliasearch < 3.27.1\n } else if (clientHasInitIndex) {\n searchForFacetValuesPromise = this.client\n .initIndex(state.index)\n .searchForFacetValues(algoliaQuery);\n // algoliasearch ~5.0.0\n } else {\n // @MAJOR only use client.search\n delete algoliaQuery.facetName;\n searchForFacetValuesPromise = this.client\n .search([\n {\n type: 'facet',\n facet: facet,\n indexName: state.index,\n params: algoliaQuery,\n },\n ])\n .then(function processResponse(response) {\n return response.results[0];\n });\n }\n\n this.emit('searchForFacetValues', {\n state: state,\n facet: facet,\n query: query,\n });\n\n return searchForFacetValuesPromise.then(\n function addIsRefined(content) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n\n content = Array.isArray(content) ? content[0] : content;\n\n content.facetHits.forEach(function (f) {\n f.escapedValue = escapeFacetValue(f.value);\n f.isRefined = isDisjunctive\n ? state.isDisjunctiveFacetRefined(facet, f.escapedValue)\n : state.isFacetRefined(facet, f.escapedValue);\n });\n\n return content;\n },\n function (e) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n throw e;\n }\n );\n};\n\n/**\n * Sets the text query used for the search.\n *\n * This method resets the current page to 0.\n * @param {string} q the user query\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setQuery = function (q) {\n this._change({\n state: this.state.resetPage().setQuery(q),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Remove all the types of refinements except tags. A string can be provided to remove\n * only the refinements of a specific attribute. For more advanced use case, you can\n * provide a function instead. This function should follow the\n * [clearCallback definition](#SearchParameters.clearCallback).\n *\n * This method resets the current page to 0.\n * @param {string} [name] optional name of the facet / attribute on which we want to remove all refinements\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n * @example\n * // Removing all the refinements\n * helper.clearRefinements().search();\n * @example\n * // Removing all the filters on a the category attribute.\n * helper.clearRefinements('category').search();\n * @example\n * // Removing only the exclude filters on the category facet.\n * helper.clearRefinements(function(value, attribute, type) {\n * return type === 'exclude' && attribute === 'category';\n * }).search();\n */\nAlgoliaSearchHelper.prototype.clearRefinements = function (name) {\n this._change({\n state: this.state.resetPage().clearRefinements(name),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Remove all the tag filters.\n *\n * This method resets the current page to 0.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.clearTags = function () {\n this._change({\n state: this.state.resetPage().clearTags(),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Adds a disjunctive filter to a faceted attribute with the `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value (will be converted to string)\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addDisjunctiveFacetRefinement = function (\n facet,\n value\n) {\n this._change({\n state: this.state.resetPage().addDisjunctiveFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addDisjunctiveFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.addDisjunctiveRefine = function () {\n return this.addDisjunctiveFacetRefinement.apply(this, arguments);\n};\n\n/**\n * Adds a refinement on a hierarchical facet. It will throw\n * an exception if the facet is not defined or if the facet\n * is already refined.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet name\n * @param {string} path the hierarchical facet path\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @throws Error if the facet is not defined or if the facet is refined\n * @chainable\n * @fires change\n */\nAlgoliaSearchHelper.prototype.addHierarchicalFacetRefinement = function (\n facet,\n path\n) {\n this._change({\n state: this.state.resetPage().addHierarchicalFacetRefinement(facet, path),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Adds a an numeric filter to an attribute with the `operator` and `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} attribute the attribute on which the numeric filter applies\n * @param {string} operator the operator of the filter\n * @param {number} value the value of the filter\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addNumericRefinement = function (\n attribute,\n operator,\n value\n) {\n this._change({\n state: this.state\n .resetPage()\n .addNumericRefinement(attribute, operator, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Adds a filter to a faceted attribute with the `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value (will be converted to string)\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().addFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.addRefine = function () {\n return this.addFacetRefinement.apply(this, arguments);\n};\n\n/**\n * Adds a an exclusion filter to a faceted attribute with the `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value (will be converted to string)\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addFacetExclusion = function (facet, value) {\n this._change({\n state: this.state.resetPage().addExcludeRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetExclusion}\n */\nAlgoliaSearchHelper.prototype.addExclude = function () {\n return this.addFacetExclusion.apply(this, arguments);\n};\n\n/**\n * Adds a tag filter with the `tag` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} tag the tag to add to the filter\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addTag = function (tag) {\n this._change({\n state: this.state.resetPage().addTagRefinement(tag),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Adds a \"frequently bought together\" recommendation query.\n *\n * @param {FrequentlyBoughtTogetherQuery} params the parameters for the recommendation\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addFrequentlyBoughtTogether = function (params) {\n this._recommendChange({\n state: this.recommendState.addFrequentlyBoughtTogether(params),\n });\n\n return this;\n};\n\n/**\n * Adds a \"related products\" recommendation query.\n *\n * @param {RelatedProductsQuery} params the parameters for the recommendation\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addRelatedProducts = function (params) {\n this._recommendChange({\n state: this.recommendState.addRelatedProducts(params),\n });\n\n return this;\n};\n\n/**\n * Adds a \"trending items\" recommendation query.\n *\n * @param {TrendingItemsQuery} params the parameters for the recommendation\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addTrendingItems = function (params) {\n this._recommendChange({\n state: this.recommendState.addTrendingItems(params),\n });\n\n return this;\n};\n\n/**\n * Adds a \"trending facets\" recommendation query.\n *\n * @param {TrendingFacetsQuery} params the parameters for the recommendation\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addTrendingFacets = function (params) {\n this._recommendChange({\n state: this.recommendState.addTrendingFacets(params),\n });\n\n return this;\n};\n\n/**\n * Adds a \"looking similar\" recommendation query.\n *\n * @param {LookingSimilarQuery} params the parameters for the recommendation\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addLookingSimilar = function (params) {\n this._recommendChange({\n state: this.recommendState.addLookingSimilar(params),\n });\n\n return this;\n};\n\n/**\n * Removes an numeric filter to an attribute with the `operator` and `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * Some parameters are optional, triggering different behavior:\n * - if the value is not provided, then all the numeric value will be removed for the\n * specified attribute/operator couple.\n * - if the operator is not provided either, then all the numeric filter on this attribute\n * will be removed.\n *\n * This method resets the current page to 0.\n * @param {string} attribute the attribute on which the numeric filter applies\n * @param {string} [operator] the operator of the filter\n * @param {number} [value] the value of the filter\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeNumericRefinement = function (\n attribute,\n operator,\n value\n) {\n this._change({\n state: this.state\n .resetPage()\n .removeNumericRefinement(attribute, operator, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Removes a disjunctive filter to a faceted attribute with the `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * If the value is omitted, then this method will remove all the filters for the\n * attribute.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} [value] the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeDisjunctiveFacetRefinement = function (\n facet,\n value\n) {\n this._change({\n state: this.state\n .resetPage()\n .removeDisjunctiveFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeDisjunctiveFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.removeDisjunctiveRefine = function () {\n return this.removeDisjunctiveFacetRefinement.apply(this, arguments);\n};\n\n/**\n * Removes the refinement set on a hierarchical facet.\n * @param {string} facet the facet name\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @throws Error if the facet is not defined or if the facet is not refined\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeHierarchicalFacetRefinement = function (\n facet\n) {\n this._change({\n state: this.state.resetPage().removeHierarchicalFacetRefinement(facet),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Removes a filter to a faceted attribute with the `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * If the value is omitted, then this method will remove all the filters for the\n * attribute.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} [value] the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().removeFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.removeRefine = function () {\n return this.removeFacetRefinement.apply(this, arguments);\n};\n\n/**\n * Removes an exclusion filter to a faceted attribute with the `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * If the value is omitted, then this method will remove all the filters for the\n * attribute.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} [value] the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeFacetExclusion = function (facet, value) {\n this._change({\n state: this.state.resetPage().removeExcludeRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetExclusion}\n */\nAlgoliaSearchHelper.prototype.removeExclude = function () {\n return this.removeFacetExclusion.apply(this, arguments);\n};\n\n/**\n * Removes a tag filter with the `tag` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} tag tag to remove from the filter\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeTag = function (tag) {\n this._change({\n state: this.state.resetPage().removeTagRefinement(tag),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Removes a \"frequently bought together\" recommendation query.\n *\n * @param {number} id identifier of the recommendation widget\n * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeFrequentlyBoughtTogether = function (id) {\n this._recommendChange({\n state: this.recommendState.removeParams(id),\n });\n\n return this;\n};\n\n/**\n * Removes a \"related products\" recommendation query.\n *\n * @param {number} id identifier of the recommendation widget\n * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeRelatedProducts = function (id) {\n this._recommendChange({\n state: this.recommendState.removeParams(id),\n });\n\n return this;\n};\n\n/**\n * Removes a \"trending items\" recommendation query.\n *\n * @param {number} id identifier of the recommendation widget\n * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeTrendingItems = function (id) {\n this._recommendChange({\n state: this.recommendState.removeParams(id),\n });\n\n return this;\n};\n\n/**\n * Removes a \"trending facets\" recommendation query.\n *\n * @param {number} id identifier of the recommendation widget\n * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeTrendingFacets = function (id) {\n this._recommendChange({\n state: this.recommendState.removeParams(id),\n });\n\n return this;\n};\n\n/**\n * Removes a \"looking similar\" recommendation query.\n *\n * @param {number} id identifier of the recommendation widget\n * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeLookingSimilar = function (id) {\n this._recommendChange({\n state: this.recommendState.removeParams(id),\n });\n\n return this;\n};\n\n/**\n * Adds or removes an exclusion filter to a faceted attribute with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.toggleFacetExclusion = function (facet, value) {\n this._change({\n state: this.state.resetPage().toggleExcludeFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetExclusion}\n */\nAlgoliaSearchHelper.prototype.toggleExclude = function () {\n return this.toggleFacetExclusion.apply(this, arguments);\n};\n\n/**\n * Adds or removes a filter to a faceted attribute with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method can be used for conjunctive, disjunctive and hierarchical filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @throws Error will throw an error if the facet is not declared in the settings of the helper\n * @fires change\n * @chainable\n * @deprecated since version 2.19.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.toggleRefinement = function (facet, value) {\n return this.toggleFacetRefinement(facet, value);\n};\n\n/**\n * Adds or removes a filter to a faceted attribute with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method can be used for conjunctive, disjunctive and hierarchical filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @throws Error will throw an error if the facet is not declared in the settings of the helper\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.toggleFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().toggleFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.toggleRefine = function () {\n return this.toggleFacetRefinement.apply(this, arguments);\n};\n\n/**\n * Adds or removes a tag filter with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method resets the current page to 0.\n * @param {string} tag tag to remove or add\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.toggleTag = function (tag) {\n this._change({\n state: this.state.resetPage().toggleTagRefinement(tag),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Increments the page number by one.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n * @example\n * helper.setPage(0).nextPage().getPage();\n * // returns 1\n */\nAlgoliaSearchHelper.prototype.nextPage = function () {\n var page = this.state.page || 0;\n return this.setPage(page + 1);\n};\n\n/**\n * Decrements the page number by one.\n * @fires change\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @chainable\n * @example\n * helper.setPage(1).previousPage().getPage();\n * // returns 0\n */\nAlgoliaSearchHelper.prototype.previousPage = function () {\n var page = this.state.page || 0;\n return this.setPage(page - 1);\n};\n\n/**\n * @private\n * @param {number} page The page number\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @chainable\n * @fires change\n */\nfunction setCurrentPage(page) {\n if (page < 0) throw new Error('Page requested below 0.');\n\n this._change({\n state: this.state.setPage(page),\n isPageReset: false,\n });\n\n return this;\n}\n\n/**\n * Change the current page\n * @deprecated\n * @param {number} page The page number\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setCurrentPage = setCurrentPage;\n\n/**\n * Updates the current page.\n * @function\n * @param {number} page The page number\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setPage = setCurrentPage;\n\n/**\n * Updates the name of the index that will be targeted by the query.\n *\n * This method resets the current page to 0.\n * @param {string} name the index name\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setIndex = function (name) {\n this._change({\n state: this.state.resetPage().setIndex(name),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Update a parameter of the search. This method reset the page\n *\n * The complete list of parameters is available on the\n * [Algolia website](https://www.algolia.com/doc/rest#query-an-index).\n * The most commonly used parameters have their own [shortcuts](#query-parameters-shortcuts)\n * or benefit from higher-level APIs (all the kind of filters and facets have their own API)\n *\n * This method resets the current page to 0.\n * @param {string} parameter name of the parameter to update\n * @param {any} value new value of the parameter\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n * @example\n * helper.setQueryParameter('hitsPerPage', 20).search();\n */\nAlgoliaSearchHelper.prototype.setQueryParameter = function (parameter, value) {\n this._change({\n state: this.state.resetPage().setQueryParameter(parameter, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Set the whole state (warning: will erase previous state)\n * @param {SearchParameters} newState the whole new state\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setState = function (newState) {\n this._change({\n state: SearchParameters.make(newState),\n isPageReset: false,\n });\n\n return this;\n};\n\n/**\n * Override the current state without triggering a change event.\n * Do not use this method unless you know what you are doing. (see the example\n * for a legit use case)\n * @param {SearchParameters} newState the whole new state\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @example\n * helper.on('change', function(state){\n * // In this function you might want to find a way to store the state in the url/history\n * updateYourURL(state)\n * })\n * window.onpopstate = function(event){\n * // This is naive though as you should check if the state is really defined etc.\n * helper.overrideStateWithoutTriggeringChangeEvent(event.state).search()\n * }\n * @chainable\n */\nAlgoliaSearchHelper.prototype.overrideStateWithoutTriggeringChangeEvent =\n function (newState) {\n this.state = new SearchParameters(newState);\n return this;\n };\n\n/**\n * Check if an attribute has any numeric, conjunctive, disjunctive or hierarchical filters.\n * @param {string} attribute the name of the attribute\n * @return {boolean} true if the attribute is filtered by at least one value\n * @example\n * // hasRefinements works with numeric, conjunctive, disjunctive and hierarchical filters\n * helper.hasRefinements('price'); // false\n * helper.addNumericRefinement('price', '>', 100);\n * helper.hasRefinements('price'); // true\n *\n * helper.hasRefinements('color'); // false\n * helper.addFacetRefinement('color', 'blue');\n * helper.hasRefinements('color'); // true\n *\n * helper.hasRefinements('material'); // false\n * helper.addDisjunctiveFacetRefinement('material', 'plastic');\n * helper.hasRefinements('material'); // true\n *\n * helper.hasRefinements('categories'); // false\n * helper.toggleFacetRefinement('categories', 'kitchen > knife');\n * helper.hasRefinements('categories'); // true\n *\n */\nAlgoliaSearchHelper.prototype.hasRefinements = function (attribute) {\n if (objectHasKeys(this.state.getNumericRefinements(attribute))) {\n return true;\n } else if (this.state.isConjunctiveFacet(attribute)) {\n return this.state.isFacetRefined(attribute);\n } else if (this.state.isDisjunctiveFacet(attribute)) {\n return this.state.isDisjunctiveFacetRefined(attribute);\n } else if (this.state.isHierarchicalFacet(attribute)) {\n return this.state.isHierarchicalFacetRefined(attribute);\n }\n\n // there's currently no way to know that the user did call `addNumericRefinement` at some point\n // thus we cannot distinguish if there once was a numeric refinement that was cleared\n // so we will return false in every other situations to be consistent\n // while what we should do here is throw because we did not find the attribute in any type\n // of refinement\n return false;\n};\n\n/**\n * Check if a value is excluded for a specific faceted attribute. If the value\n * is omitted then the function checks if there is any excluding refinements.\n *\n * @param {string} facet name of the attribute for used for faceting\n * @param {string} [value] optional value. If passed will test that this value\n * is filtering the given facet.\n * @return {boolean} true if refined\n * @example\n * helper.isExcludeRefined('color'); // false\n * helper.isExcludeRefined('color', 'blue') // false\n * helper.isExcludeRefined('color', 'red') // false\n *\n * helper.addFacetExclusion('color', 'red');\n *\n * helper.isExcludeRefined('color'); // true\n * helper.isExcludeRefined('color', 'blue') // false\n * helper.isExcludeRefined('color', 'red') // true\n */\nAlgoliaSearchHelper.prototype.isExcluded = function (facet, value) {\n return this.state.isExcludeRefined(facet, value);\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements}\n */\nAlgoliaSearchHelper.prototype.isDisjunctiveRefined = function (facet, value) {\n return this.state.isDisjunctiveFacetRefined(facet, value);\n};\n\n/**\n * Check if the string is a currently filtering tag.\n * @param {string} tag tag to check\n * @return {boolean} true if the tag is currently refined\n */\nAlgoliaSearchHelper.prototype.hasTag = function (tag) {\n return this.state.isTagRefined(tag);\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasTag}\n */\nAlgoliaSearchHelper.prototype.isTagRefined = function () {\n return this.hasTagRefinements.apply(this, arguments);\n};\n\n/**\n * Get the name of the currently used index.\n * @return {string} name of the index\n * @example\n * helper.setIndex('highestPrice_products').getIndex();\n * // returns 'highestPrice_products'\n */\nAlgoliaSearchHelper.prototype.getIndex = function () {\n return this.state.index;\n};\n\nfunction getCurrentPage() {\n return this.state.page;\n}\n\n/**\n * Get the currently selected page\n * @deprecated\n * @return {number} the current page\n */\nAlgoliaSearchHelper.prototype.getCurrentPage = getCurrentPage;\n/**\n * Get the currently selected page\n * @function\n * @return {number} the current page\n */\nAlgoliaSearchHelper.prototype.getPage = getCurrentPage;\n\n/**\n * Get all the tags currently set to filters the results.\n *\n * @return {string[]} The list of tags currently set.\n */\nAlgoliaSearchHelper.prototype.getTags = function () {\n return this.state.tagRefinements;\n};\n\n/**\n * Get the list of refinements for a given attribute. This method works with\n * conjunctive, disjunctive, excluding and numerical filters.\n *\n * See also SearchResults#getRefinements\n *\n * @param {string} facetName attribute name used for faceting\n * @return {Array.} All Refinement are objects that contain a value, and\n * a type. Numeric also contains an operator.\n * @example\n * helper.addNumericRefinement('price', '>', 100);\n * helper.getRefinements('price');\n * // [\n * // {\n * // \"value\": [\n * // 100\n * // ],\n * // \"operator\": \">\",\n * // \"type\": \"numeric\"\n * // }\n * // ]\n * @example\n * helper.addFacetRefinement('color', 'blue');\n * helper.addFacetExclusion('color', 'red');\n * helper.getRefinements('color');\n * // [\n * // {\n * // \"value\": \"blue\",\n * // \"type\": \"conjunctive\"\n * // },\n * // {\n * // \"value\": \"red\",\n * // \"type\": \"exclude\"\n * // }\n * // ]\n * @example\n * helper.addDisjunctiveFacetRefinement('material', 'plastic');\n * // [\n * // {\n * // \"value\": \"plastic\",\n * // \"type\": \"disjunctive\"\n * // }\n * // ]\n */\nAlgoliaSearchHelper.prototype.getRefinements = function (facetName) {\n var refinements = [];\n\n if (this.state.isConjunctiveFacet(facetName)) {\n var conjRefinements = this.state.getConjunctiveRefinements(facetName);\n\n conjRefinements.forEach(function (r) {\n refinements.push({\n value: r,\n type: 'conjunctive',\n });\n });\n\n var excludeRefinements = this.state.getExcludeRefinements(facetName);\n\n excludeRefinements.forEach(function (r) {\n refinements.push({\n value: r,\n type: 'exclude',\n });\n });\n } else if (this.state.isDisjunctiveFacet(facetName)) {\n var disjunctiveRefinements =\n this.state.getDisjunctiveRefinements(facetName);\n\n disjunctiveRefinements.forEach(function (r) {\n refinements.push({\n value: r,\n type: 'disjunctive',\n });\n });\n }\n\n var numericRefinements = this.state.getNumericRefinements(facetName);\n\n Object.keys(numericRefinements).forEach(function (operator) {\n var value = numericRefinements[operator];\n\n refinements.push({\n value: value,\n operator: operator,\n type: 'numeric',\n });\n });\n\n return refinements;\n};\n\n/**\n * Return the current refinement for the (attribute, operator)\n * @param {string} attribute attribute in the record\n * @param {string} operator operator applied on the refined values\n * @return {Array.} refined values\n */\nAlgoliaSearchHelper.prototype.getNumericRefinement = function (\n attribute,\n operator\n) {\n return this.state.getNumericRefinement(attribute, operator);\n};\n\n/**\n * Get the current breadcrumb for a hierarchical facet, as an array\n * @param {string} facetName Hierarchical facet name\n * @return {array.} the path as an array of string\n */\nAlgoliaSearchHelper.prototype.getHierarchicalFacetBreadcrumb = function (\n facetName\n) {\n return this.state.getHierarchicalFacetBreadcrumb(facetName);\n};\n\n// /////////// PRIVATE\n\n/**\n * Perform the underlying queries\n * @private\n * @param {object} options options for the query\n * @param {boolean} [options.onlyWithDerivedHelpers=false] if true, only the derived helpers will be queried\n * @return {undefined} does not return anything\n * @fires search\n * @fires result\n * @fires error\n */\nAlgoliaSearchHelper.prototype._search = function (options) {\n var state = this.state;\n var states = [];\n var mainQueries = [];\n\n if (!options.onlyWithDerivedHelpers) {\n mainQueries = requestBuilder._getQueries(state.index, state);\n\n states.push({\n state: state,\n queriesCount: mainQueries.length,\n helper: this,\n });\n\n this.emit('search', {\n state: state,\n results: this.lastResults,\n });\n }\n\n var derivedQueries = this.derivedHelpers.map(function (derivedHelper) {\n var derivedState = derivedHelper.getModifiedState(state);\n var derivedStateQueries = derivedState.index\n ? requestBuilder._getQueries(derivedState.index, derivedState)\n : [];\n\n states.push({\n state: derivedState,\n queriesCount: derivedStateQueries.length,\n helper: derivedHelper,\n });\n\n derivedHelper.emit('search', {\n state: derivedState,\n results: derivedHelper.lastResults,\n });\n\n return derivedStateQueries;\n });\n\n var queries = Array.prototype.concat.apply(mainQueries, derivedQueries);\n\n var queryId = this._queryId++;\n this._currentNbQueries++;\n\n if (!queries.length) {\n return Promise.resolve({ results: [] }).then(\n this._dispatchAlgoliaResponse.bind(this, states, queryId)\n );\n }\n\n try {\n this.client\n .search(queries)\n .then(this._dispatchAlgoliaResponse.bind(this, states, queryId))\n .catch(this._dispatchAlgoliaError.bind(this, queryId));\n } catch (error) {\n // If we reach this part, we're in an internal error state\n this.emit('error', {\n error: error,\n });\n }\n\n return undefined;\n};\n\nAlgoliaSearchHelper.prototype._recommend = function () {\n var searchState = this.state;\n var recommendState = this.recommendState;\n var index = this.getIndex();\n var states = [{ state: recommendState, index: index, helper: this }];\n var ids = recommendState.params.map(function (param) {\n return param.$$id;\n });\n\n this.emit('fetch', {\n recommend: {\n state: recommendState,\n results: this.lastRecommendResults,\n },\n });\n\n var cache = this._recommendCache;\n\n var derivedQueries = this.derivedHelpers.map(function (derivedHelper) {\n var derivedIndex = derivedHelper.getModifiedState(searchState).index;\n if (!derivedIndex) {\n return [];\n }\n\n // Contrary to what is done when deriving the search state, we don't want to\n // provide the current recommend state to the derived helper, as it would\n // inherit unwanted queries. We instead provide an empty recommend state.\n var derivedState = derivedHelper.getModifiedRecommendState(\n new RecommendParameters()\n );\n states.push({\n state: derivedState,\n index: derivedIndex,\n helper: derivedHelper,\n });\n\n ids = Array.prototype.concat.apply(\n ids,\n derivedState.params.map(function (param) {\n return param.$$id;\n })\n );\n\n derivedHelper.emit('fetch', {\n recommend: {\n state: derivedState,\n results: derivedHelper.lastRecommendResults,\n },\n });\n\n return derivedState._buildQueries(derivedIndex, cache);\n });\n\n var queries = Array.prototype.concat.apply(\n this.recommendState._buildQueries(index, cache),\n derivedQueries\n );\n\n if (queries.length === 0) {\n return;\n }\n\n if (\n queries.length > 0 &&\n typeof this.client.getRecommendations === 'undefined'\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n 'Please update algoliasearch/lite to the latest version in order to use recommend widgets.'\n );\n return;\n }\n\n var queryId = this._recommendQueryId++;\n this._currentNbRecommendQueries++;\n\n try {\n this.client\n .getRecommendations(queries)\n .then(this._dispatchRecommendResponse.bind(this, queryId, states, ids))\n .catch(this._dispatchRecommendError.bind(this, queryId));\n } catch (error) {\n // If we reach this part, we're in an internal error state\n this.emit('error', {\n error: error,\n });\n }\n\n return;\n};\n\n/**\n * Transform the responses as sent by the server and transform them into a user\n * usable object that merge the results of all the batch requests. It will dispatch\n * over the different helper + derived helpers (when there are some).\n * @private\n * @param {array.<{SearchParameters, AlgoliaQueries, AlgoliaSearchHelper}>} states state used to generate the request\n * @param {number} queryId id of the current request\n * @param {object} content content of the response\n * @return {undefined}\n */\nAlgoliaSearchHelper.prototype._dispatchAlgoliaResponse = function (\n states,\n queryId,\n content\n) {\n // eslint-disable-next-line consistent-this\n var self = this;\n\n // @TODO remove the number of outdated queries discarded instead of just one\n\n if (queryId < this._lastQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbQueries -= queryId - this._lastQueryIdReceived;\n this._lastQueryIdReceived = queryId;\n\n if (this._currentNbQueries === 0) this.emit('searchQueueEmpty');\n\n var results = content.results.slice();\n\n states.forEach(function (s) {\n var state = s.state;\n var queriesCount = s.queriesCount;\n var helper = s.helper;\n var specificResults = results.splice(0, queriesCount);\n\n if (!state.index) {\n helper.emit('result', {\n results: null,\n state: state,\n });\n return;\n }\n\n helper.lastResults = new SearchResults(\n state,\n specificResults,\n self._searchResultsOptions\n );\n\n helper.emit('result', {\n results: helper.lastResults,\n state: state,\n });\n });\n};\n\nAlgoliaSearchHelper.prototype._dispatchRecommendResponse = function (\n queryId,\n states,\n ids,\n content\n) {\n // @TODO remove the number of outdated queries discarded instead of just one\n\n if (queryId < this._lastRecommendQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbRecommendQueries -=\n queryId - this._lastRecommendQueryIdReceived;\n this._lastRecommendQueryIdReceived = queryId;\n\n if (this._currentNbRecommendQueries === 0) this.emit('recommendQueueEmpty');\n\n var cache = this._recommendCache;\n\n var idsMap = {};\n ids\n .filter(function (id) {\n return cache[id] === undefined;\n })\n .forEach(function (id, index) {\n if (!idsMap[id]) idsMap[id] = [];\n\n idsMap[id].push(index);\n });\n\n Object.keys(idsMap).forEach(function (id) {\n var indices = idsMap[id];\n var firstResult = content.results[indices[0]];\n if (indices.length === 1) {\n cache[id] = firstResult;\n return;\n }\n cache[id] = Object.assign({}, firstResult, {\n hits: sortAndMergeRecommendations(\n indices.map(function (idx) {\n return content.results[idx].hits;\n })\n ),\n });\n });\n\n var results = {};\n ids.forEach(function (id) {\n results[id] = cache[id];\n });\n\n states.forEach(function (s) {\n var state = s.state;\n var helper = s.helper;\n\n if (!s.index) {\n // eslint-disable-next-line no-warning-comments\n // TODO: emit \"result\" event when events for Recommend are implemented\n helper.emit('recommend:result', {\n results: null,\n state: state,\n });\n return;\n }\n\n helper.lastRecommendResults = new RecommendResults(state, results);\n\n // eslint-disable-next-line no-warning-comments\n // TODO: emit \"result\" event when events for Recommend are implemented\n helper.emit('recommend:result', {\n recommend: {\n results: helper.lastRecommendResults,\n state: state,\n },\n });\n });\n};\n\nAlgoliaSearchHelper.prototype._dispatchAlgoliaError = function (\n queryId,\n error\n) {\n if (queryId < this._lastQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbQueries -= queryId - this._lastQueryIdReceived;\n this._lastQueryIdReceived = queryId;\n\n this.emit('error', {\n error: error,\n });\n\n if (this._currentNbQueries === 0) this.emit('searchQueueEmpty');\n};\n\nAlgoliaSearchHelper.prototype._dispatchRecommendError = function (\n queryId,\n error\n) {\n if (queryId < this._lastRecommendQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbRecommendQueries -=\n queryId - this._lastRecommendQueryIdReceived;\n this._lastRecommendQueryIdReceived = queryId;\n\n this.emit('error', {\n error: error,\n });\n\n if (this._currentNbRecommendQueries === 0) this.emit('recommendQueueEmpty');\n};\n\nAlgoliaSearchHelper.prototype.containsRefinement = function (\n query,\n facetFilters,\n numericFilters,\n tagFilters\n) {\n return (\n query ||\n facetFilters.length !== 0 ||\n numericFilters.length !== 0 ||\n tagFilters.length !== 0\n );\n};\n\n/**\n * Test if there are some disjunctive refinements on the facet\n * @private\n * @param {string} facet the attribute to test\n * @return {boolean} true if there are refinements on this attribute\n */\nAlgoliaSearchHelper.prototype._hasDisjunctiveRefinements = function (facet) {\n return (\n this.state.disjunctiveRefinements[facet] &&\n this.state.disjunctiveRefinements[facet].length > 0\n );\n};\n\nAlgoliaSearchHelper.prototype._change = function (event) {\n var state = event.state;\n var isPageReset = event.isPageReset;\n\n if (state !== this.state) {\n this.state = state;\n\n this.emit('change', {\n state: this.state,\n results: this.lastResults,\n isPageReset: isPageReset,\n });\n }\n};\n\nAlgoliaSearchHelper.prototype._recommendChange = function (event) {\n var state = event.state;\n\n if (state !== this.recommendState) {\n this.recommendState = state;\n\n // eslint-disable-next-line no-warning-comments\n // TODO: emit \"change\" event when events for Recommend are implemented\n this.emit('recommend:change', {\n search: {\n results: this.lastResults,\n state: this.state,\n },\n recommend: {\n results: this.lastRecommendResults,\n state: this.recommendState,\n },\n });\n }\n};\n\n/**\n * Clears the cache of the underlying Algolia client.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n */\nAlgoliaSearchHelper.prototype.clearCache = function () {\n if (this.client.clearCache) this.client.clearCache();\n return this;\n};\n\n/**\n * Updates the internal client instance. If the reference of the clients\n * are equal then no update is actually done.\n * @param {AlgoliaSearch} newClient an AlgoliaSearch client\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n */\nAlgoliaSearchHelper.prototype.setClient = function (newClient) {\n if (this.client === newClient) return this;\n\n if (typeof newClient.addAlgoliaAgent === 'function') {\n newClient.addAlgoliaAgent('JS Helper (' + version + ')');\n }\n this.client = newClient;\n\n return this;\n};\n\n/**\n * Gets the instance of the currently used client.\n * @return {AlgoliaSearch} the currently used client\n */\nAlgoliaSearchHelper.prototype.getClient = function () {\n return this.client;\n};\n\n/**\n * Creates an derived instance of the Helper. A derived helper\n * is a way to request other indices synchronised with the lifecycle\n * of the main Helper. This mechanism uses the multiqueries feature\n * of Algolia to aggregate all the requests in a single network call.\n *\n * This method takes a function that is used to create a new SearchParameter\n * that will be used to create requests to Algolia. Those new requests\n * are created just before the `search` event. The signature of the function\n * is `SearchParameters -> SearchParameters`.\n *\n * This method returns a new DerivedHelper which is an EventEmitter\n * that fires the same `search`, `result` and `error` events. Those\n * events, however, will receive data specific to this DerivedHelper\n * and the SearchParameters that is returned by the call of the\n * parameter function.\n * @param {function} fn SearchParameters -> SearchParameters\n * @param {function} recommendFn RecommendParameters -> RecommendParameters\n * @return {DerivedHelper} a new DerivedHelper\n */\nAlgoliaSearchHelper.prototype.derive = function (fn, recommendFn) {\n var derivedHelper = new DerivedHelper(this, fn, recommendFn);\n this.derivedHelpers.push(derivedHelper);\n return derivedHelper;\n};\n\n/**\n * This method detaches a derived Helper from the main one. Prefer using the one from the\n * derived helper itself, to remove the event listeners too.\n * @private\n * @param {DerivedHelper} derivedHelper the derived helper to detach\n * @return {undefined} nothing is returned\n * @throws Error\n */\nAlgoliaSearchHelper.prototype.detachDerivedHelper = function (derivedHelper) {\n var pos = this.derivedHelpers.indexOf(derivedHelper);\n if (pos === -1) throw new Error('Derived helper already detached');\n this.derivedHelpers.splice(pos, 1);\n};\n\n/**\n * This method returns true if there is currently at least one on-going search.\n * @return {boolean} true if there is a search pending\n */\nAlgoliaSearchHelper.prototype.hasPendingRequests = function () {\n return this._currentNbQueries > 0;\n};\n\n/**\n * @typedef AlgoliaSearchHelper.NumericRefinement\n * @type {object}\n * @property {number[]} value the numbers that are used for filtering this attribute with\n * the operator specified.\n * @property {string} operator the faceting data: value, number of entries\n * @property {string} type will be 'numeric'\n */\n\n/**\n * @typedef AlgoliaSearchHelper.FacetRefinement\n * @type {object}\n * @property {string} value the string use to filter the attribute\n * @property {string} type the type of filter: 'conjunctive', 'disjunctive', 'exclude'\n */\n\nmodule.exports = AlgoliaSearchHelper;\n\n\n//# sourceURL=webpack://kerisse/./node_modules/algoliasearch-helper/src/algoliasearch.helper.js?"); +eval("\n\nvar EventEmitter = __webpack_require__(/*! @algolia/events */ \"./node_modules/@algolia/events/events.js\");\n\nvar DerivedHelper = __webpack_require__(/*! ./DerivedHelper */ \"./node_modules/algoliasearch-helper/src/DerivedHelper/index.js\");\nvar escapeFacetValue = (__webpack_require__(/*! ./functions/escapeFacetValue */ \"./node_modules/algoliasearch-helper/src/functions/escapeFacetValue.js\").escapeFacetValue);\nvar inherits = __webpack_require__(/*! ./functions/inherits */ \"./node_modules/algoliasearch-helper/src/functions/inherits.js\");\nvar merge = __webpack_require__(/*! ./functions/merge */ \"./node_modules/algoliasearch-helper/src/functions/merge.js\");\nvar objectHasKeys = __webpack_require__(/*! ./functions/objectHasKeys */ \"./node_modules/algoliasearch-helper/src/functions/objectHasKeys.js\");\nvar omit = __webpack_require__(/*! ./functions/omit */ \"./node_modules/algoliasearch-helper/src/functions/omit.js\");\nvar RecommendParameters = __webpack_require__(/*! ./RecommendParameters */ \"./node_modules/algoliasearch-helper/src/RecommendParameters/index.js\");\nvar RecommendResults = __webpack_require__(/*! ./RecommendResults */ \"./node_modules/algoliasearch-helper/src/RecommendResults/index.js\");\nvar requestBuilder = __webpack_require__(/*! ./requestBuilder */ \"./node_modules/algoliasearch-helper/src/requestBuilder.js\");\nvar SearchParameters = __webpack_require__(/*! ./SearchParameters */ \"./node_modules/algoliasearch-helper/src/SearchParameters/index.js\");\nvar SearchResults = __webpack_require__(/*! ./SearchResults */ \"./node_modules/algoliasearch-helper/src/SearchResults/index.js\");\nvar sortAndMergeRecommendations = __webpack_require__(/*! ./utils/sortAndMergeRecommendations */ \"./node_modules/algoliasearch-helper/src/utils/sortAndMergeRecommendations.js\");\nvar version = __webpack_require__(/*! ./version */ \"./node_modules/algoliasearch-helper/src/version.js\");\n\n/**\n * Event triggered when a parameter is set or updated\n * @event AlgoliaSearchHelper#event:change\n * @property {object} event\n * @property {SearchParameters} event.state the current parameters with the latest changes applied\n * @property {SearchResults} event.results the previous results received from Algolia. `null` before the first request\n * @example\n * helper.on('change', function(event) {\n * console.log('The parameters have changed');\n * });\n */\n\n/**\n * Event triggered when a main search is sent to Algolia\n * @event AlgoliaSearchHelper#event:search\n * @property {object} event\n * @property {SearchParameters} event.state the parameters used for this search\n * @property {SearchResults} event.results the results from the previous search. `null` if it is the first search.\n * @example\n * helper.on('search', function(event) {\n * console.log('Search sent');\n * });\n */\n\n/**\n * Event triggered when a search using `searchForFacetValues` is sent to Algolia\n * @event AlgoliaSearchHelper#event:searchForFacetValues\n * @property {object} event\n * @property {SearchParameters} event.state the parameters used for this search it is the first search.\n * @property {string} event.facet the facet searched into\n * @property {string} event.query the query used to search in the facets\n * @example\n * helper.on('searchForFacetValues', function(event) {\n * console.log('searchForFacetValues sent');\n * });\n */\n\n/**\n * Event triggered when a search using `searchOnce` is sent to Algolia\n * @event AlgoliaSearchHelper#event:searchOnce\n * @property {object} event\n * @property {SearchParameters} event.state the parameters used for this search it is the first search.\n * @example\n * helper.on('searchOnce', function(event) {\n * console.log('searchOnce sent');\n * });\n */\n\n/**\n * Event triggered when the results are retrieved from Algolia\n * @event AlgoliaSearchHelper#event:result\n * @property {object} event\n * @property {SearchResults} event.results the results received from Algolia\n * @property {SearchParameters} event.state the parameters used to query Algolia. Those might be different from the one in the helper instance (for example if the network is unreliable).\n * @example\n * helper.on('result', function(event) {\n * console.log('Search results received');\n * });\n */\n\n/**\n * Event triggered when Algolia sends back an error. For example, if an unknown parameter is\n * used, the error can be caught using this event.\n * @event AlgoliaSearchHelper#event:error\n * @property {object} event\n * @property {Error} event.error the error returned by the Algolia.\n * @example\n * helper.on('error', function(event) {\n * console.log('Houston we got a problem.');\n * });\n */\n\n/**\n * Event triggered when the queue of queries have been depleted (with any result or outdated queries)\n * @event AlgoliaSearchHelper#event:searchQueueEmpty\n * @example\n * helper.on('searchQueueEmpty', function() {\n * console.log('No more search pending');\n * // This is received before the result event if we're not expecting new results\n * });\n *\n * helper.search();\n */\n\n/**\n * Initialize a new AlgoliaSearchHelper\n * @class\n * @classdesc The AlgoliaSearchHelper is a class that ease the management of the\n * search. It provides an event based interface for search callbacks:\n * - change: when the internal search state is changed.\n * This event contains a {@link SearchParameters} object and the\n * {@link SearchResults} of the last result if any.\n * - search: when a search is triggered using the `search()` method.\n * - result: when the response is retrieved from Algolia and is processed.\n * This event contains a {@link SearchResults} object and the\n * {@link SearchParameters} corresponding to this answer.\n * - error: when the response is an error. This event contains the error returned by the server.\n * @param {AlgoliaSearch} client an AlgoliaSearch client\n * @param {string} index the index name to query\n * @param {SearchParameters | object} options an object defining the initial\n * config of the search. It doesn't have to be a {SearchParameters},\n * just an object containing the properties you need from it.\n * @param {SearchResultsOptions|object} searchResultsOptions an object defining the options to use when creating the search results.\n */\nfunction AlgoliaSearchHelper(client, index, options, searchResultsOptions) {\n if (typeof client.addAlgoliaAgent === 'function') {\n client.addAlgoliaAgent('JS Helper (' + version + ')');\n }\n\n this.setClient(client);\n var opts = options || {};\n opts.index = index;\n this.state = SearchParameters.make(opts);\n this.recommendState = new RecommendParameters({\n params: opts.recommendState,\n });\n this.lastResults = null;\n this.lastRecommendResults = null;\n this._queryId = 0;\n this._recommendQueryId = 0;\n this._lastQueryIdReceived = -1;\n this._lastRecommendQueryIdReceived = -1;\n this.derivedHelpers = [];\n this._currentNbQueries = 0;\n this._currentNbRecommendQueries = 0;\n this._searchResultsOptions = searchResultsOptions;\n this._recommendCache = {};\n}\n\ninherits(AlgoliaSearchHelper, EventEmitter);\n\n/**\n * Start the search with the parameters set in the state. When the\n * method is called, it triggers a `search` event. The results will\n * be available through the `result` event. If an error occurs, an\n * `error` will be fired instead.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires search\n * @fires result\n * @fires error\n * @chainable\n */\nAlgoliaSearchHelper.prototype.search = function () {\n this._search({ onlyWithDerivedHelpers: false });\n return this;\n};\n\nAlgoliaSearchHelper.prototype.searchOnlyWithDerivedHelpers = function () {\n this._search({ onlyWithDerivedHelpers: true });\n return this;\n};\n\n/**\n * Sends the recommendation queries set in the state. When the method is\n * called, it triggers a `fetch` event. The results will be available through\n * the `result` event. If an error occurs, an `error` will be fired instead.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires fetch\n * @fires result\n * @fires error\n * @chainable\n */\nAlgoliaSearchHelper.prototype.recommend = function () {\n this._recommend();\n return this;\n};\n\n/**\n * Gets the search query parameters that would be sent to the Algolia Client\n * for the hits\n * @return {object} Query Parameters\n */\nAlgoliaSearchHelper.prototype.getQuery = function () {\n var state = this.state;\n return requestBuilder._getHitsSearchParams(state);\n};\n\n/**\n * Start a search using a modified version of the current state. This method does\n * not trigger the helper lifecycle and does not modify the state kept internally\n * by the helper. This second aspect means that the next search call will be the\n * same as a search call before calling searchOnce.\n * @param {object} options can contain all the parameters that can be set to SearchParameters\n * plus the index\n * @param {function} [cb] optional callback executed when the response from the\n * server is back.\n * @return {promise|undefined} if a callback is passed the method returns undefined\n * otherwise it returns a promise containing an object with two keys :\n * - content with a SearchResults\n * - state with the state used for the query as a SearchParameters\n * @example\n * // Changing the number of records returned per page to 1\n * // This example uses the callback API\n * var state = helper.searchOnce({hitsPerPage: 1},\n * function(error, content, state) {\n * // if an error occurred it will be passed in error, otherwise its value is null\n * // content contains the results formatted as a SearchResults\n * // state is the instance of SearchParameters used for this search\n * });\n * @example\n * // Changing the number of records returned per page to 1\n * // This example uses the promise API\n * var state1 = helper.searchOnce({hitsPerPage: 1})\n * .then(promiseHandler);\n *\n * function promiseHandler(res) {\n * // res contains\n * // {\n * // content : SearchResults\n * // state : SearchParameters (the one used for this specific search)\n * // }\n * }\n */\nAlgoliaSearchHelper.prototype.searchOnce = function (options, cb) {\n var tempState = !options\n ? this.state\n : this.state.setQueryParameters(options);\n var queries = requestBuilder._getQueries(tempState.index, tempState);\n // eslint-disable-next-line consistent-this\n var self = this;\n\n this._currentNbQueries++;\n\n this.emit('searchOnce', {\n state: tempState,\n });\n\n if (cb) {\n this.client\n .search(queries)\n .then(function (content) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) {\n self.emit('searchQueueEmpty');\n }\n\n cb(null, new SearchResults(tempState, content.results), tempState);\n })\n .catch(function (err) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) {\n self.emit('searchQueueEmpty');\n }\n\n cb(err, null, tempState);\n });\n\n return undefined;\n }\n\n return this.client.search(queries).then(\n function (content) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n return {\n content: new SearchResults(tempState, content.results),\n state: tempState,\n _originalResponse: content,\n };\n },\n function (e) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n throw e;\n }\n );\n};\n\n/**\n * Start the search for answers with the parameters set in the state.\n * This method returns a promise.\n * @param {Object} options - the options for answers API call\n * @param {string[]} options.attributesForPrediction - Attributes to use for predictions. If empty, `searchableAttributes` is used instead.\n * @param {string[]} options.queryLanguages - The languages in the query. Currently only supports ['en'].\n * @param {number} options.nbHits - Maximum number of answers to retrieve from the Answers Engine. Cannot be greater than 1000.\n *\n * @return {promise} the answer results\n * @deprecated answers is deprecated and will be replaced with new initiatives\n */\nAlgoliaSearchHelper.prototype.findAnswers = function (options) {\n // eslint-disable-next-line no-console\n console.warn('[algoliasearch-helper] answers is no longer supported');\n var state = this.state;\n var derivedHelper = this.derivedHelpers[0];\n if (!derivedHelper) {\n return Promise.resolve([]);\n }\n var derivedState = derivedHelper.getModifiedState(state);\n var data = merge(\n {\n attributesForPrediction: options.attributesForPrediction,\n nbHits: options.nbHits,\n },\n {\n params: omit(requestBuilder._getHitsSearchParams(derivedState), [\n 'attributesToSnippet',\n 'hitsPerPage',\n 'restrictSearchableAttributes',\n 'snippetEllipsisText',\n ]),\n }\n );\n\n var errorMessage =\n 'search for answers was called, but this client does not have a function client.initIndex(index).findAnswers';\n if (typeof this.client.initIndex !== 'function') {\n throw new Error(errorMessage);\n }\n var index = this.client.initIndex(derivedState.index);\n if (typeof index.findAnswers !== 'function') {\n throw new Error(errorMessage);\n }\n return index.findAnswers(derivedState.query, options.queryLanguages, data);\n};\n\n/**\n * Structure of each result when using\n * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues)\n * @typedef FacetSearchHit\n * @type {object}\n * @property {string} value the facet value\n * @property {string} highlighted the facet value highlighted with the query string\n * @property {number} count number of occurrence of this facet value\n * @property {boolean} isRefined true if the value is already refined\n */\n\n/**\n * Structure of the data resolved by the\n * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues)\n * promise.\n * @typedef FacetSearchResult\n * @type {object}\n * @property {FacetSearchHit} facetHits the results for this search for facet values\n * @property {number} processingTimeMS time taken by the query inside the engine\n */\n\n/**\n * Search for facet values based on an query and the name of a faceted attribute. This\n * triggers a search and will return a promise. On top of using the query, it also sends\n * the parameters from the state so that the search is narrowed down to only the possible values.\n *\n * See the description of [FacetSearchResult](reference.html#FacetSearchResult)\n * @param {string} facet the name of the faceted attribute\n * @param {string} query the string query for the search\n * @param {number} [maxFacetHits] the maximum number values returned. Should be > 0 and <= 100\n * @param {object} [userState] the set of custom parameters to use on top of the current state. Setting a property to `undefined` removes\n * it in the generated query.\n * @return {promise.} the results of the search\n */\nAlgoliaSearchHelper.prototype.searchForFacetValues = function (\n facet,\n query,\n maxFacetHits,\n userState\n) {\n var clientHasSFFV =\n typeof this.client.searchForFacetValues === 'function' &&\n // v5 has a wrong sffv signature\n typeof this.client.searchForFacets !== 'function';\n var clientHasInitIndex = typeof this.client.initIndex === 'function';\n if (\n !clientHasSFFV &&\n !clientHasInitIndex &&\n typeof this.client.search !== 'function'\n ) {\n throw new Error(\n 'search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues'\n );\n }\n\n var state = this.state.setQueryParameters(userState || {});\n var isDisjunctive = state.isDisjunctiveFacet(facet);\n var algoliaQuery = requestBuilder.getSearchForFacetQuery(\n facet,\n query,\n maxFacetHits,\n state\n );\n\n this._currentNbQueries++;\n // eslint-disable-next-line consistent-this\n var self = this;\n var searchForFacetValuesPromise;\n // newer algoliasearch ^3.27.1 - ~4.0.0\n if (clientHasSFFV) {\n searchForFacetValuesPromise = this.client.searchForFacetValues([\n { indexName: state.index, params: algoliaQuery },\n ]);\n // algoliasearch < 3.27.1\n } else if (clientHasInitIndex) {\n searchForFacetValuesPromise = this.client\n .initIndex(state.index)\n .searchForFacetValues(algoliaQuery);\n // algoliasearch ~5.0.0\n } else {\n // @MAJOR only use client.search\n delete algoliaQuery.facetName;\n searchForFacetValuesPromise = this.client\n .search([\n {\n type: 'facet',\n facet: facet,\n indexName: state.index,\n params: algoliaQuery,\n },\n ])\n .then(function processResponse(response) {\n return response.results[0];\n });\n }\n\n this.emit('searchForFacetValues', {\n state: state,\n facet: facet,\n query: query,\n });\n\n return searchForFacetValuesPromise.then(\n function addIsRefined(content) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n\n content = Array.isArray(content) ? content[0] : content;\n\n content.facetHits.forEach(function (f) {\n f.escapedValue = escapeFacetValue(f.value);\n f.isRefined = isDisjunctive\n ? state.isDisjunctiveFacetRefined(facet, f.escapedValue)\n : state.isFacetRefined(facet, f.escapedValue);\n });\n\n return content;\n },\n function (e) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n throw e;\n }\n );\n};\n\n/**\n * Sets the text query used for the search.\n *\n * This method resets the current page to 0.\n * @param {string} q the user query\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setQuery = function (q) {\n this._change({\n state: this.state.resetPage().setQuery(q),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Remove all the types of refinements except tags. A string can be provided to remove\n * only the refinements of a specific attribute. For more advanced use case, you can\n * provide a function instead. This function should follow the\n * [clearCallback definition](#SearchParameters.clearCallback).\n *\n * This method resets the current page to 0.\n * @param {string} [name] optional name of the facet / attribute on which we want to remove all refinements\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n * @example\n * // Removing all the refinements\n * helper.clearRefinements().search();\n * @example\n * // Removing all the filters on a the category attribute.\n * helper.clearRefinements('category').search();\n * @example\n * // Removing only the exclude filters on the category facet.\n * helper.clearRefinements(function(value, attribute, type) {\n * return type === 'exclude' && attribute === 'category';\n * }).search();\n */\nAlgoliaSearchHelper.prototype.clearRefinements = function (name) {\n this._change({\n state: this.state.resetPage().clearRefinements(name),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Remove all the tag filters.\n *\n * This method resets the current page to 0.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.clearTags = function () {\n this._change({\n state: this.state.resetPage().clearTags(),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Adds a disjunctive filter to a faceted attribute with the `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value (will be converted to string)\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addDisjunctiveFacetRefinement = function (\n facet,\n value\n) {\n this._change({\n state: this.state.resetPage().addDisjunctiveFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addDisjunctiveFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.addDisjunctiveRefine = function () {\n return this.addDisjunctiveFacetRefinement.apply(this, arguments);\n};\n\n/**\n * Adds a refinement on a hierarchical facet. It will throw\n * an exception if the facet is not defined or if the facet\n * is already refined.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet name\n * @param {string} path the hierarchical facet path\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @throws Error if the facet is not defined or if the facet is refined\n * @chainable\n * @fires change\n */\nAlgoliaSearchHelper.prototype.addHierarchicalFacetRefinement = function (\n facet,\n path\n) {\n this._change({\n state: this.state.resetPage().addHierarchicalFacetRefinement(facet, path),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Adds a an numeric filter to an attribute with the `operator` and `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} attribute the attribute on which the numeric filter applies\n * @param {string} operator the operator of the filter\n * @param {number} value the value of the filter\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addNumericRefinement = function (\n attribute,\n operator,\n value\n) {\n this._change({\n state: this.state\n .resetPage()\n .addNumericRefinement(attribute, operator, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Adds a filter to a faceted attribute with the `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value (will be converted to string)\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().addFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.addRefine = function () {\n return this.addFacetRefinement.apply(this, arguments);\n};\n\n/**\n * Adds a an exclusion filter to a faceted attribute with the `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value (will be converted to string)\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addFacetExclusion = function (facet, value) {\n this._change({\n state: this.state.resetPage().addExcludeRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetExclusion}\n */\nAlgoliaSearchHelper.prototype.addExclude = function () {\n return this.addFacetExclusion.apply(this, arguments);\n};\n\n/**\n * Adds a tag filter with the `tag` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} tag the tag to add to the filter\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addTag = function (tag) {\n this._change({\n state: this.state.resetPage().addTagRefinement(tag),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Adds a \"frequently bought together\" recommendation query.\n *\n * @param {FrequentlyBoughtTogetherQuery} params the parameters for the recommendation\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addFrequentlyBoughtTogether = function (params) {\n this._recommendChange({\n state: this.recommendState.addFrequentlyBoughtTogether(params),\n });\n\n return this;\n};\n\n/**\n * Adds a \"related products\" recommendation query.\n *\n * @param {RelatedProductsQuery} params the parameters for the recommendation\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addRelatedProducts = function (params) {\n this._recommendChange({\n state: this.recommendState.addRelatedProducts(params),\n });\n\n return this;\n};\n\n/**\n * Adds a \"trending items\" recommendation query.\n *\n * @param {TrendingItemsQuery} params the parameters for the recommendation\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addTrendingItems = function (params) {\n this._recommendChange({\n state: this.recommendState.addTrendingItems(params),\n });\n\n return this;\n};\n\n/**\n * Adds a \"trending facets\" recommendation query.\n *\n * @param {TrendingFacetsQuery} params the parameters for the recommendation\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addTrendingFacets = function (params) {\n this._recommendChange({\n state: this.recommendState.addTrendingFacets(params),\n });\n\n return this;\n};\n\n/**\n * Adds a \"looking similar\" recommendation query.\n *\n * @param {LookingSimilarQuery} params the parameters for the recommendation\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addLookingSimilar = function (params) {\n this._recommendChange({\n state: this.recommendState.addLookingSimilar(params),\n });\n\n return this;\n};\n\n/**\n * Removes an numeric filter to an attribute with the `operator` and `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * Some parameters are optional, triggering different behavior:\n * - if the value is not provided, then all the numeric value will be removed for the\n * specified attribute/operator couple.\n * - if the operator is not provided either, then all the numeric filter on this attribute\n * will be removed.\n *\n * This method resets the current page to 0.\n * @param {string} attribute the attribute on which the numeric filter applies\n * @param {string} [operator] the operator of the filter\n * @param {number} [value] the value of the filter\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeNumericRefinement = function (\n attribute,\n operator,\n value\n) {\n this._change({\n state: this.state\n .resetPage()\n .removeNumericRefinement(attribute, operator, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Removes a disjunctive filter to a faceted attribute with the `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * If the value is omitted, then this method will remove all the filters for the\n * attribute.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} [value] the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeDisjunctiveFacetRefinement = function (\n facet,\n value\n) {\n this._change({\n state: this.state\n .resetPage()\n .removeDisjunctiveFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeDisjunctiveFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.removeDisjunctiveRefine = function () {\n return this.removeDisjunctiveFacetRefinement.apply(this, arguments);\n};\n\n/**\n * Removes the refinement set on a hierarchical facet.\n * @param {string} facet the facet name\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @throws Error if the facet is not defined or if the facet is not refined\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeHierarchicalFacetRefinement = function (\n facet\n) {\n this._change({\n state: this.state.resetPage().removeHierarchicalFacetRefinement(facet),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Removes a filter to a faceted attribute with the `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * If the value is omitted, then this method will remove all the filters for the\n * attribute.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} [value] the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().removeFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.removeRefine = function () {\n return this.removeFacetRefinement.apply(this, arguments);\n};\n\n/**\n * Removes an exclusion filter to a faceted attribute with the `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * If the value is omitted, then this method will remove all the filters for the\n * attribute.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} [value] the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeFacetExclusion = function (facet, value) {\n this._change({\n state: this.state.resetPage().removeExcludeRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetExclusion}\n */\nAlgoliaSearchHelper.prototype.removeExclude = function () {\n return this.removeFacetExclusion.apply(this, arguments);\n};\n\n/**\n * Removes a tag filter with the `tag` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} tag tag to remove from the filter\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeTag = function (tag) {\n this._change({\n state: this.state.resetPage().removeTagRefinement(tag),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Removes a \"frequently bought together\" recommendation query.\n *\n * @param {number} id identifier of the recommendation widget\n * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeFrequentlyBoughtTogether = function (id) {\n this._recommendChange({\n state: this.recommendState.removeParams(id),\n });\n\n return this;\n};\n\n/**\n * Removes a \"related products\" recommendation query.\n *\n * @param {number} id identifier of the recommendation widget\n * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeRelatedProducts = function (id) {\n this._recommendChange({\n state: this.recommendState.removeParams(id),\n });\n\n return this;\n};\n\n/**\n * Removes a \"trending items\" recommendation query.\n *\n * @param {number} id identifier of the recommendation widget\n * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeTrendingItems = function (id) {\n this._recommendChange({\n state: this.recommendState.removeParams(id),\n });\n\n return this;\n};\n\n/**\n * Removes a \"trending facets\" recommendation query.\n *\n * @param {number} id identifier of the recommendation widget\n * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeTrendingFacets = function (id) {\n this._recommendChange({\n state: this.recommendState.removeParams(id),\n });\n\n return this;\n};\n\n/**\n * Removes a \"looking similar\" recommendation query.\n *\n * @param {number} id identifier of the recommendation widget\n * @returns {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeLookingSimilar = function (id) {\n this._recommendChange({\n state: this.recommendState.removeParams(id),\n });\n\n return this;\n};\n\n/**\n * Adds or removes an exclusion filter to a faceted attribute with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.toggleFacetExclusion = function (facet, value) {\n this._change({\n state: this.state.resetPage().toggleExcludeFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetExclusion}\n */\nAlgoliaSearchHelper.prototype.toggleExclude = function () {\n return this.toggleFacetExclusion.apply(this, arguments);\n};\n\n/**\n * Adds or removes a filter to a faceted attribute with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method can be used for conjunctive, disjunctive and hierarchical filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @throws Error will throw an error if the facet is not declared in the settings of the helper\n * @fires change\n * @chainable\n * @deprecated since version 2.19.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.toggleRefinement = function (facet, value) {\n return this.toggleFacetRefinement(facet, value);\n};\n\n/**\n * Adds or removes a filter to a faceted attribute with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method can be used for conjunctive, disjunctive and hierarchical filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @throws Error will throw an error if the facet is not declared in the settings of the helper\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.toggleFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().toggleFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.toggleRefine = function () {\n return this.toggleFacetRefinement.apply(this, arguments);\n};\n\n/**\n * Adds or removes a tag filter with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method resets the current page to 0.\n * @param {string} tag tag to remove or add\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.toggleTag = function (tag) {\n this._change({\n state: this.state.resetPage().toggleTagRefinement(tag),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Increments the page number by one.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n * @example\n * helper.setPage(0).nextPage().getPage();\n * // returns 1\n */\nAlgoliaSearchHelper.prototype.nextPage = function () {\n var page = this.state.page || 0;\n return this.setPage(page + 1);\n};\n\n/**\n * Decrements the page number by one.\n * @fires change\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @chainable\n * @example\n * helper.setPage(1).previousPage().getPage();\n * // returns 0\n */\nAlgoliaSearchHelper.prototype.previousPage = function () {\n var page = this.state.page || 0;\n return this.setPage(page - 1);\n};\n\n/**\n * @private\n * @param {number} page The page number\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @chainable\n * @fires change\n */\nfunction setCurrentPage(page) {\n if (page < 0) throw new Error('Page requested below 0.');\n\n this._change({\n state: this.state.setPage(page),\n isPageReset: false,\n });\n\n return this;\n}\n\n/**\n * Change the current page\n * @deprecated\n * @param {number} page The page number\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setCurrentPage = setCurrentPage;\n\n/**\n * Updates the current page.\n * @function\n * @param {number} page The page number\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setPage = setCurrentPage;\n\n/**\n * Updates the name of the index that will be targeted by the query.\n *\n * This method resets the current page to 0.\n * @param {string} name the index name\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setIndex = function (name) {\n this._change({\n state: this.state.resetPage().setIndex(name),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Update a parameter of the search. This method reset the page\n *\n * The complete list of parameters is available on the\n * [Algolia website](https://www.algolia.com/doc/rest#query-an-index).\n * The most commonly used parameters have their own [shortcuts](#query-parameters-shortcuts)\n * or benefit from higher-level APIs (all the kind of filters and facets have their own API)\n *\n * This method resets the current page to 0.\n * @param {string} parameter name of the parameter to update\n * @param {any} value new value of the parameter\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n * @example\n * helper.setQueryParameter('hitsPerPage', 20).search();\n */\nAlgoliaSearchHelper.prototype.setQueryParameter = function (parameter, value) {\n this._change({\n state: this.state.resetPage().setQueryParameter(parameter, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n/**\n * Set the whole state (warning: will erase previous state)\n * @param {SearchParameters} newState the whole new state\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setState = function (newState) {\n this._change({\n state: SearchParameters.make(newState),\n isPageReset: false,\n });\n\n return this;\n};\n\n/**\n * Override the current state without triggering a change event.\n * Do not use this method unless you know what you are doing. (see the example\n * for a legit use case)\n * @param {SearchParameters} newState the whole new state\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @example\n * helper.on('change', function(state){\n * // In this function you might want to find a way to store the state in the url/history\n * updateYourURL(state)\n * })\n * window.onpopstate = function(event){\n * // This is naive though as you should check if the state is really defined etc.\n * helper.overrideStateWithoutTriggeringChangeEvent(event.state).search()\n * }\n * @chainable\n */\nAlgoliaSearchHelper.prototype.overrideStateWithoutTriggeringChangeEvent =\n function (newState) {\n this.state = new SearchParameters(newState);\n return this;\n };\n\n/**\n * Check if an attribute has any numeric, conjunctive, disjunctive or hierarchical filters.\n * @param {string} attribute the name of the attribute\n * @return {boolean} true if the attribute is filtered by at least one value\n * @example\n * // hasRefinements works with numeric, conjunctive, disjunctive and hierarchical filters\n * helper.hasRefinements('price'); // false\n * helper.addNumericRefinement('price', '>', 100);\n * helper.hasRefinements('price'); // true\n *\n * helper.hasRefinements('color'); // false\n * helper.addFacetRefinement('color', 'blue');\n * helper.hasRefinements('color'); // true\n *\n * helper.hasRefinements('material'); // false\n * helper.addDisjunctiveFacetRefinement('material', 'plastic');\n * helper.hasRefinements('material'); // true\n *\n * helper.hasRefinements('categories'); // false\n * helper.toggleFacetRefinement('categories', 'kitchen > knife');\n * helper.hasRefinements('categories'); // true\n *\n */\nAlgoliaSearchHelper.prototype.hasRefinements = function (attribute) {\n if (objectHasKeys(this.state.getNumericRefinements(attribute))) {\n return true;\n } else if (this.state.isConjunctiveFacet(attribute)) {\n return this.state.isFacetRefined(attribute);\n } else if (this.state.isDisjunctiveFacet(attribute)) {\n return this.state.isDisjunctiveFacetRefined(attribute);\n } else if (this.state.isHierarchicalFacet(attribute)) {\n return this.state.isHierarchicalFacetRefined(attribute);\n }\n\n // there's currently no way to know that the user did call `addNumericRefinement` at some point\n // thus we cannot distinguish if there once was a numeric refinement that was cleared\n // so we will return false in every other situations to be consistent\n // while what we should do here is throw because we did not find the attribute in any type\n // of refinement\n return false;\n};\n\n/**\n * Check if a value is excluded for a specific faceted attribute. If the value\n * is omitted then the function checks if there is any excluding refinements.\n *\n * @param {string} facet name of the attribute for used for faceting\n * @param {string} [value] optional value. If passed will test that this value\n * is filtering the given facet.\n * @return {boolean} true if refined\n * @example\n * helper.isExcludeRefined('color'); // false\n * helper.isExcludeRefined('color', 'blue') // false\n * helper.isExcludeRefined('color', 'red') // false\n *\n * helper.addFacetExclusion('color', 'red');\n *\n * helper.isExcludeRefined('color'); // true\n * helper.isExcludeRefined('color', 'blue') // false\n * helper.isExcludeRefined('color', 'red') // true\n */\nAlgoliaSearchHelper.prototype.isExcluded = function (facet, value) {\n return this.state.isExcludeRefined(facet, value);\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements}\n */\nAlgoliaSearchHelper.prototype.isDisjunctiveRefined = function (facet, value) {\n return this.state.isDisjunctiveFacetRefined(facet, value);\n};\n\n/**\n * Check if the string is a currently filtering tag.\n * @param {string} tag tag to check\n * @return {boolean} true if the tag is currently refined\n */\nAlgoliaSearchHelper.prototype.hasTag = function (tag) {\n return this.state.isTagRefined(tag);\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasTag}\n */\nAlgoliaSearchHelper.prototype.isTagRefined = function () {\n return this.hasTagRefinements.apply(this, arguments);\n};\n\n/**\n * Get the name of the currently used index.\n * @return {string} name of the index\n * @example\n * helper.setIndex('highestPrice_products').getIndex();\n * // returns 'highestPrice_products'\n */\nAlgoliaSearchHelper.prototype.getIndex = function () {\n return this.state.index;\n};\n\nfunction getCurrentPage() {\n return this.state.page;\n}\n\n/**\n * Get the currently selected page\n * @deprecated\n * @return {number} the current page\n */\nAlgoliaSearchHelper.prototype.getCurrentPage = getCurrentPage;\n/**\n * Get the currently selected page\n * @function\n * @return {number} the current page\n */\nAlgoliaSearchHelper.prototype.getPage = getCurrentPage;\n\n/**\n * Get all the tags currently set to filters the results.\n *\n * @return {string[]} The list of tags currently set.\n */\nAlgoliaSearchHelper.prototype.getTags = function () {\n return this.state.tagRefinements;\n};\n\n/**\n * Get the list of refinements for a given attribute. This method works with\n * conjunctive, disjunctive, excluding and numerical filters.\n *\n * See also SearchResults#getRefinements\n *\n * @param {string} facetName attribute name used for faceting\n * @return {Array.} All Refinement are objects that contain a value, and\n * a type. Numeric also contains an operator.\n * @example\n * helper.addNumericRefinement('price', '>', 100);\n * helper.getRefinements('price');\n * // [\n * // {\n * // \"value\": [\n * // 100\n * // ],\n * // \"operator\": \">\",\n * // \"type\": \"numeric\"\n * // }\n * // ]\n * @example\n * helper.addFacetRefinement('color', 'blue');\n * helper.addFacetExclusion('color', 'red');\n * helper.getRefinements('color');\n * // [\n * // {\n * // \"value\": \"blue\",\n * // \"type\": \"conjunctive\"\n * // },\n * // {\n * // \"value\": \"red\",\n * // \"type\": \"exclude\"\n * // }\n * // ]\n * @example\n * helper.addDisjunctiveFacetRefinement('material', 'plastic');\n * // [\n * // {\n * // \"value\": \"plastic\",\n * // \"type\": \"disjunctive\"\n * // }\n * // ]\n */\nAlgoliaSearchHelper.prototype.getRefinements = function (facetName) {\n var refinements = [];\n\n if (this.state.isConjunctiveFacet(facetName)) {\n var conjRefinements = this.state.getConjunctiveRefinements(facetName);\n\n conjRefinements.forEach(function (r) {\n refinements.push({\n value: r,\n type: 'conjunctive',\n });\n });\n\n var excludeRefinements = this.state.getExcludeRefinements(facetName);\n\n excludeRefinements.forEach(function (r) {\n refinements.push({\n value: r,\n type: 'exclude',\n });\n });\n } else if (this.state.isDisjunctiveFacet(facetName)) {\n var disjunctiveRefinements =\n this.state.getDisjunctiveRefinements(facetName);\n\n disjunctiveRefinements.forEach(function (r) {\n refinements.push({\n value: r,\n type: 'disjunctive',\n });\n });\n }\n\n var numericRefinements = this.state.getNumericRefinements(facetName);\n\n Object.keys(numericRefinements).forEach(function (operator) {\n var value = numericRefinements[operator];\n\n refinements.push({\n value: value,\n operator: operator,\n type: 'numeric',\n });\n });\n\n return refinements;\n};\n\n/**\n * Return the current refinement for the (attribute, operator)\n * @param {string} attribute attribute in the record\n * @param {string} operator operator applied on the refined values\n * @return {Array.} refined values\n */\nAlgoliaSearchHelper.prototype.getNumericRefinement = function (\n attribute,\n operator\n) {\n return this.state.getNumericRefinement(attribute, operator);\n};\n\n/**\n * Get the current breadcrumb for a hierarchical facet, as an array\n * @param {string} facetName Hierarchical facet name\n * @return {array.} the path as an array of string\n */\nAlgoliaSearchHelper.prototype.getHierarchicalFacetBreadcrumb = function (\n facetName\n) {\n return this.state.getHierarchicalFacetBreadcrumb(facetName);\n};\n\n// /////////// PRIVATE\n\n/**\n * Perform the underlying queries\n * @private\n * @param {object} options options for the query\n * @param {boolean} [options.onlyWithDerivedHelpers=false] if true, only the derived helpers will be queried\n * @return {undefined} does not return anything\n * @fires search\n * @fires result\n * @fires error\n */\nAlgoliaSearchHelper.prototype._search = function (options) {\n var state = this.state;\n var states = [];\n var mainQueries = [];\n\n if (!options.onlyWithDerivedHelpers) {\n mainQueries = requestBuilder._getQueries(state.index, state);\n\n states.push({\n state: state,\n queriesCount: mainQueries.length,\n helper: this,\n });\n\n this.emit('search', {\n state: state,\n results: this.lastResults,\n });\n }\n\n var derivedQueries = this.derivedHelpers.map(function (derivedHelper) {\n var derivedState = derivedHelper.getModifiedState(state);\n var derivedStateQueries = derivedState.index\n ? requestBuilder._getQueries(derivedState.index, derivedState)\n : [];\n\n states.push({\n state: derivedState,\n queriesCount: derivedStateQueries.length,\n helper: derivedHelper,\n });\n\n derivedHelper.emit('search', {\n state: derivedState,\n results: derivedHelper.lastResults,\n });\n\n return derivedStateQueries;\n });\n\n var queries = Array.prototype.concat.apply(mainQueries, derivedQueries);\n\n var queryId = this._queryId++;\n this._currentNbQueries++;\n\n if (!queries.length) {\n return Promise.resolve({ results: [] }).then(\n this._dispatchAlgoliaResponse.bind(this, states, queryId)\n );\n }\n\n try {\n this.client\n .search(queries)\n .then(this._dispatchAlgoliaResponse.bind(this, states, queryId))\n .catch(this._dispatchAlgoliaError.bind(this, queryId));\n } catch (error) {\n // If we reach this part, we're in an internal error state\n this.emit('error', {\n error: error,\n });\n }\n\n return undefined;\n};\n\nAlgoliaSearchHelper.prototype._recommend = function () {\n var searchState = this.state;\n var recommendState = this.recommendState;\n var index = this.getIndex();\n var states = [{ state: recommendState, index: index, helper: this }];\n var ids = recommendState.params.map(function (param) {\n return param.$$id;\n });\n\n this.emit('fetch', {\n recommend: {\n state: recommendState,\n results: this.lastRecommendResults,\n },\n });\n\n var cache = this._recommendCache;\n\n var derivedQueries = this.derivedHelpers.map(function (derivedHelper) {\n var derivedIndex = derivedHelper.getModifiedState(searchState).index;\n if (!derivedIndex) {\n return [];\n }\n\n // Contrary to what is done when deriving the search state, we don't want to\n // provide the current recommend state to the derived helper, as it would\n // inherit unwanted queries. We instead provide an empty recommend state.\n var derivedState = derivedHelper.getModifiedRecommendState(\n new RecommendParameters()\n );\n states.push({\n state: derivedState,\n index: derivedIndex,\n helper: derivedHelper,\n });\n\n ids = Array.prototype.concat.apply(\n ids,\n derivedState.params.map(function (param) {\n return param.$$id;\n })\n );\n\n derivedHelper.emit('fetch', {\n recommend: {\n state: derivedState,\n results: derivedHelper.lastRecommendResults,\n },\n });\n\n return derivedState._buildQueries(derivedIndex, cache);\n });\n\n var queries = Array.prototype.concat.apply(\n this.recommendState._buildQueries(index, cache),\n derivedQueries\n );\n\n if (queries.length === 0) {\n return;\n }\n\n if (\n queries.length > 0 &&\n typeof this.client.getRecommendations === 'undefined'\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n 'Please update algoliasearch/lite to the latest version in order to use recommend widgets.'\n );\n return;\n }\n\n var queryId = this._recommendQueryId++;\n this._currentNbRecommendQueries++;\n\n try {\n this.client\n .getRecommendations(queries)\n .then(this._dispatchRecommendResponse.bind(this, queryId, states, ids))\n .catch(this._dispatchRecommendError.bind(this, queryId));\n } catch (error) {\n // If we reach this part, we're in an internal error state\n this.emit('error', {\n error: error,\n });\n }\n\n return;\n};\n\n/**\n * Transform the responses as sent by the server and transform them into a user\n * usable object that merge the results of all the batch requests. It will dispatch\n * over the different helper + derived helpers (when there are some).\n * @private\n * @param {array.<{SearchParameters, AlgoliaQueries, AlgoliaSearchHelper}>} states state used to generate the request\n * @param {number} queryId id of the current request\n * @param {object} content content of the response\n * @return {undefined}\n */\nAlgoliaSearchHelper.prototype._dispatchAlgoliaResponse = function (\n states,\n queryId,\n content\n) {\n // eslint-disable-next-line consistent-this\n var self = this;\n\n // @TODO remove the number of outdated queries discarded instead of just one\n\n if (queryId < this._lastQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbQueries -= queryId - this._lastQueryIdReceived;\n this._lastQueryIdReceived = queryId;\n\n if (this._currentNbQueries === 0) this.emit('searchQueueEmpty');\n\n var results = content.results.slice();\n\n states.forEach(function (s) {\n var state = s.state;\n var queriesCount = s.queriesCount;\n var helper = s.helper;\n var specificResults = results.splice(0, queriesCount);\n\n if (!state.index) {\n helper.emit('result', {\n results: null,\n state: state,\n });\n return;\n }\n\n helper.lastResults = new SearchResults(\n state,\n specificResults,\n self._searchResultsOptions\n );\n\n helper.emit('result', {\n results: helper.lastResults,\n state: state,\n });\n });\n};\n\nAlgoliaSearchHelper.prototype._dispatchRecommendResponse = function (\n queryId,\n states,\n ids,\n content\n) {\n // @TODO remove the number of outdated queries discarded instead of just one\n\n if (queryId < this._lastRecommendQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbRecommendQueries -=\n queryId - this._lastRecommendQueryIdReceived;\n this._lastRecommendQueryIdReceived = queryId;\n\n if (this._currentNbRecommendQueries === 0) this.emit('recommendQueueEmpty');\n\n var cache = this._recommendCache;\n\n var idsMap = {};\n ids\n .filter(function (id) {\n return cache[id] === undefined;\n })\n .forEach(function (id, index) {\n if (!idsMap[id]) idsMap[id] = [];\n\n idsMap[id].push(index);\n });\n\n Object.keys(idsMap).forEach(function (id) {\n var indices = idsMap[id];\n var firstResult = content.results[indices[0]];\n if (indices.length === 1) {\n cache[id] = firstResult;\n return;\n }\n cache[id] = Object.assign({}, firstResult, {\n hits: sortAndMergeRecommendations(\n indices.map(function (idx) {\n return content.results[idx].hits;\n })\n ),\n });\n });\n\n var results = {};\n ids.forEach(function (id) {\n results[id] = cache[id];\n });\n\n states.forEach(function (s) {\n var state = s.state;\n var helper = s.helper;\n\n if (!s.index) {\n // eslint-disable-next-line no-warning-comments\n // TODO: emit \"result\" event when events for Recommend are implemented\n helper.emit('recommend:result', {\n results: null,\n state: state,\n });\n return;\n }\n\n helper.lastRecommendResults = new RecommendResults(state, results);\n\n // eslint-disable-next-line no-warning-comments\n // TODO: emit \"result\" event when events for Recommend are implemented\n helper.emit('recommend:result', {\n recommend: {\n results: helper.lastRecommendResults,\n state: state,\n },\n });\n });\n};\n\nAlgoliaSearchHelper.prototype._dispatchAlgoliaError = function (\n queryId,\n error\n) {\n if (queryId < this._lastQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbQueries -= queryId - this._lastQueryIdReceived;\n this._lastQueryIdReceived = queryId;\n\n this.emit('error', {\n error: error,\n });\n\n if (this._currentNbQueries === 0) this.emit('searchQueueEmpty');\n};\n\nAlgoliaSearchHelper.prototype._dispatchRecommendError = function (\n queryId,\n error\n) {\n if (queryId < this._lastRecommendQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbRecommendQueries -=\n queryId - this._lastRecommendQueryIdReceived;\n this._lastRecommendQueryIdReceived = queryId;\n\n this.emit('error', {\n error: error,\n });\n\n if (this._currentNbRecommendQueries === 0) this.emit('recommendQueueEmpty');\n};\n\nAlgoliaSearchHelper.prototype.containsRefinement = function (\n query,\n facetFilters,\n numericFilters,\n tagFilters\n) {\n return (\n query ||\n facetFilters.length !== 0 ||\n numericFilters.length !== 0 ||\n tagFilters.length !== 0\n );\n};\n\n/**\n * Test if there are some disjunctive refinements on the facet\n * @private\n * @param {string} facet the attribute to test\n * @return {boolean} true if there are refinements on this attribute\n */\nAlgoliaSearchHelper.prototype._hasDisjunctiveRefinements = function (facet) {\n return (\n this.state.disjunctiveRefinements[facet] &&\n this.state.disjunctiveRefinements[facet].length > 0\n );\n};\n\nAlgoliaSearchHelper.prototype._change = function (event) {\n var state = event.state;\n var isPageReset = event.isPageReset;\n\n if (state !== this.state) {\n this.state = state;\n\n this.emit('change', {\n state: this.state,\n results: this.lastResults,\n isPageReset: isPageReset,\n });\n }\n};\n\nAlgoliaSearchHelper.prototype._recommendChange = function (event) {\n var state = event.state;\n\n if (state !== this.recommendState) {\n this.recommendState = state;\n\n // eslint-disable-next-line no-warning-comments\n // TODO: emit \"change\" event when events for Recommend are implemented\n this.emit('recommend:change', {\n search: {\n results: this.lastResults,\n state: this.state,\n },\n recommend: {\n results: this.lastRecommendResults,\n state: this.recommendState,\n },\n });\n }\n};\n\n/**\n * Clears the cache of the underlying Algolia client.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n */\nAlgoliaSearchHelper.prototype.clearCache = function () {\n if (this.client.clearCache) this.client.clearCache();\n return this;\n};\n\n/**\n * Updates the internal client instance. If the reference of the clients\n * are equal then no update is actually done.\n * @param {AlgoliaSearch} newClient an AlgoliaSearch client\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n */\nAlgoliaSearchHelper.prototype.setClient = function (newClient) {\n if (this.client === newClient) return this;\n\n if (typeof newClient.addAlgoliaAgent === 'function') {\n newClient.addAlgoliaAgent('JS Helper (' + version + ')');\n }\n this.client = newClient;\n\n return this;\n};\n\n/**\n * Gets the instance of the currently used client.\n * @return {AlgoliaSearch} the currently used client\n */\nAlgoliaSearchHelper.prototype.getClient = function () {\n return this.client;\n};\n\n/**\n * Creates an derived instance of the Helper. A derived helper\n * is a way to request other indices synchronised with the lifecycle\n * of the main Helper. This mechanism uses the multiqueries feature\n * of Algolia to aggregate all the requests in a single network call.\n *\n * This method takes a function that is used to create a new SearchParameter\n * that will be used to create requests to Algolia. Those new requests\n * are created just before the `search` event. The signature of the function\n * is `SearchParameters -> SearchParameters`.\n *\n * This method returns a new DerivedHelper which is an EventEmitter\n * that fires the same `search`, `result` and `error` events. Those\n * events, however, will receive data specific to this DerivedHelper\n * and the SearchParameters that is returned by the call of the\n * parameter function.\n * @param {function} fn SearchParameters -> SearchParameters\n * @param {function} recommendFn RecommendParameters -> RecommendParameters\n * @return {DerivedHelper} a new DerivedHelper\n */\nAlgoliaSearchHelper.prototype.derive = function (fn, recommendFn) {\n var derivedHelper = new DerivedHelper(this, fn, recommendFn);\n this.derivedHelpers.push(derivedHelper);\n return derivedHelper;\n};\n\n/**\n * This method detaches a derived Helper from the main one. Prefer using the one from the\n * derived helper itself, to remove the event listeners too.\n * @private\n * @param {DerivedHelper} derivedHelper the derived helper to detach\n * @return {undefined} nothing is returned\n * @throws Error\n */\nAlgoliaSearchHelper.prototype.detachDerivedHelper = function (derivedHelper) {\n var pos = this.derivedHelpers.indexOf(derivedHelper);\n if (pos === -1) throw new Error('Derived helper already detached');\n this.derivedHelpers.splice(pos, 1);\n};\n\n/**\n * This method returns true if there is currently at least one on-going search.\n * @return {boolean} true if there is a search pending\n */\nAlgoliaSearchHelper.prototype.hasPendingRequests = function () {\n return this._currentNbQueries > 0;\n};\n\n/**\n * @typedef AlgoliaSearchHelper.NumericRefinement\n * @type {object}\n * @property {number[]} value the numbers that are used for filtering this attribute with\n * the operator specified.\n * @property {string} operator the faceting data: value, number of entries\n * @property {string} type will be 'numeric'\n */\n\n/**\n * @typedef AlgoliaSearchHelper.FacetRefinement\n * @type {object}\n * @property {string} value the string use to filter the attribute\n * @property {string} type the type of filter: 'conjunctive', 'disjunctive', 'exclude'\n */\n\nmodule.exports = AlgoliaSearchHelper;\n\n\n//# sourceURL=webpack://kerisse/./node_modules/algoliasearch-helper/src/algoliasearch.helper.js?"); /***/ }), @@ -278,7 +278,7 @@ eval("\n\nfunction valToNumber(v) {\n if (typeof v === 'number') {\n return /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -eval("\n\nvar merge = __webpack_require__(/*! ./functions/merge */ \"./node_modules/algoliasearch-helper/src/functions/merge.js\");\n\nfunction sortObject(obj) {\n return Object.keys(obj)\n .sort()\n .reduce(function (acc, curr) {\n acc[curr] = obj[curr];\n return acc;\n }, {});\n}\n\nvar requestBuilder = {\n /**\n * Get all the queries to send to the client, those queries can used directly\n * with the Algolia client.\n * @private\n * @param {string} index The name of the index\n * @param {SearchParameters} state The state from which to get the queries\n * @return {object[]} The queries\n */\n _getQueries: function getQueries(index, state) {\n var queries = [];\n\n // One query for the hits\n queries.push({\n indexName: index,\n params: requestBuilder._getHitsSearchParams(state),\n });\n\n // One for each disjunctive facets\n state.getRefinedDisjunctiveFacets().forEach(function (refinedFacet) {\n queries.push({\n indexName: index,\n params: requestBuilder._getDisjunctiveFacetSearchParams(\n state,\n refinedFacet\n ),\n });\n });\n\n // More to get the parent levels of the hierarchical facets when refined\n state.getRefinedHierarchicalFacets().forEach(function (refinedFacet) {\n var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet);\n var currentRefinement = state.getHierarchicalRefinement(refinedFacet);\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n // If we are deeper than level 0 (starting from `beer > IPA`)\n // we want to get all parent values\n if (\n currentRefinement.length > 0 &&\n currentRefinement[0].split(separator).length > 1\n ) {\n // We generate a map of the filters we will use for our facet values queries\n var filtersMap = currentRefinement[0]\n .split(separator)\n .slice(0, -1)\n .reduce(function createFiltersMap(map, segment, level) {\n return map.concat({\n attribute: hierarchicalFacet.attributes[level],\n value:\n level === 0\n ? segment\n : [map[map.length - 1].value, segment].join(separator),\n });\n }, []);\n\n filtersMap.forEach(function (filter, level) {\n var params = requestBuilder._getDisjunctiveFacetSearchParams(\n state,\n filter.attribute,\n level === 0\n );\n\n // Keep facet filters unrelated to current hierarchical attributes\n function hasHierarchicalFacetFilter(value) {\n return hierarchicalFacet.attributes.some(function (attribute) {\n return attribute === value.split(':')[0];\n });\n }\n\n var filteredFacetFilters = (params.facetFilters || []).reduce(\n function (acc, facetFilter) {\n if (Array.isArray(facetFilter)) {\n var filtered = facetFilter.filter(function (filterValue) {\n return !hasHierarchicalFacetFilter(filterValue);\n });\n\n if (filtered.length > 0) {\n acc.push(filtered);\n }\n }\n\n if (\n typeof facetFilter === 'string' &&\n !hasHierarchicalFacetFilter(facetFilter)\n ) {\n acc.push(facetFilter);\n }\n\n return acc;\n },\n []\n );\n\n var parent = filtersMap[level - 1];\n if (level > 0) {\n params.facetFilters = filteredFacetFilters.concat(\n parent.attribute + ':' + parent.value\n );\n } else {\n params.facetFilters =\n filteredFacetFilters.length > 0\n ? filteredFacetFilters\n : undefined;\n }\n\n queries.push({ indexName: index, params: params });\n });\n }\n });\n\n return queries;\n },\n\n /**\n * Build search parameters used to fetch hits\n * @private\n * @param {SearchParameters} state The state from which to get the queries\n * @return {object.} The search parameters for hits\n */\n _getHitsSearchParams: function (state) {\n var facets = state.facets\n .concat(state.disjunctiveFacets)\n .concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state))\n .sort();\n\n var facetFilters = requestBuilder._getFacetFilters(state);\n var numericFilters = requestBuilder._getNumericFilters(state);\n var tagFilters = requestBuilder._getTagFilters(state);\n var additionalParams = {};\n\n if (facets.length > 0) {\n additionalParams.facets = facets.indexOf('*') > -1 ? ['*'] : facets;\n }\n\n if (tagFilters.length > 0) {\n additionalParams.tagFilters = tagFilters;\n }\n\n if (facetFilters.length > 0) {\n additionalParams.facetFilters = facetFilters;\n }\n\n if (numericFilters.length > 0) {\n additionalParams.numericFilters = numericFilters;\n }\n\n return sortObject(merge({}, state.getQueryParams(), additionalParams));\n },\n\n /**\n * Build search parameters used to fetch a disjunctive facet\n * @private\n * @param {SearchParameters} state The state from which to get the queries\n * @param {string} facet the associated facet name\n * @param {boolean} hierarchicalRootLevel ?? FIXME\n * @return {object} The search parameters for a disjunctive facet\n */\n _getDisjunctiveFacetSearchParams: function (\n state,\n facet,\n hierarchicalRootLevel\n ) {\n var facetFilters = requestBuilder._getFacetFilters(\n state,\n facet,\n hierarchicalRootLevel\n );\n var numericFilters = requestBuilder._getNumericFilters(state, facet);\n var tagFilters = requestBuilder._getTagFilters(state);\n var additionalParams = {\n hitsPerPage: 0,\n page: 0,\n analytics: false,\n clickAnalytics: false,\n };\n\n if (tagFilters.length > 0) {\n additionalParams.tagFilters = tagFilters;\n }\n\n var hierarchicalFacet = state.getHierarchicalFacetByName(facet);\n\n if (hierarchicalFacet) {\n additionalParams.facets =\n requestBuilder._getDisjunctiveHierarchicalFacetAttribute(\n state,\n hierarchicalFacet,\n hierarchicalRootLevel\n );\n } else {\n additionalParams.facets = facet;\n }\n\n if (numericFilters.length > 0) {\n additionalParams.numericFilters = numericFilters;\n }\n\n if (facetFilters.length > 0) {\n additionalParams.facetFilters = facetFilters;\n }\n\n return sortObject(merge({}, state.getQueryParams(), additionalParams));\n },\n\n /**\n * Return the numeric filters in an algolia request fashion\n * @private\n * @param {SearchParameters} state the state from which to get the filters\n * @param {string} [facetName] the name of the attribute for which the filters should be excluded\n * @return {string[]} the numeric filters in the algolia format\n */\n _getNumericFilters: function (state, facetName) {\n if (state.numericFilters) {\n return state.numericFilters;\n }\n\n var numericFilters = [];\n\n Object.keys(state.numericRefinements).forEach(function (attribute) {\n var operators = state.numericRefinements[attribute] || {};\n Object.keys(operators).forEach(function (operator) {\n var values = operators[operator] || [];\n if (facetName !== attribute) {\n values.forEach(function (value) {\n if (Array.isArray(value)) {\n var vs = value.map(function (v) {\n return attribute + operator + v;\n });\n numericFilters.push(vs);\n } else {\n numericFilters.push(attribute + operator + value);\n }\n });\n }\n });\n });\n\n return numericFilters;\n },\n\n /**\n * Return the tags filters depending on which format is used, either tagFilters or tagRefinements\n * @private\n * @param {SearchParameters} state the state from which to get the filters\n * @return {string} Tag filters in a single string\n */\n _getTagFilters: function (state) {\n if (state.tagFilters) {\n return state.tagFilters;\n }\n\n return state.tagRefinements.join(',');\n },\n\n /**\n * Build facetFilters parameter based on current refinements. The array returned\n * contains strings representing the facet filters in the algolia format.\n * @private\n * @param {SearchParameters} state The state from which to get the queries\n * @param {string} [facet] if set, the current disjunctive facet\n * @param {boolean} [hierarchicalRootLevel] ?? FIXME\n * @return {array.} The facet filters in the algolia format\n */\n _getFacetFilters: function (state, facet, hierarchicalRootLevel) {\n var facetFilters = [];\n\n var facetsRefinements = state.facetsRefinements || {};\n Object.keys(facetsRefinements)\n .sort()\n .forEach(function (facetName) {\n var facetValues = facetsRefinements[facetName] || [];\n facetValues\n .slice()\n .sort()\n .forEach(function (facetValue) {\n facetFilters.push(facetName + ':' + facetValue);\n });\n });\n\n var facetsExcludes = state.facetsExcludes || {};\n Object.keys(facetsExcludes)\n .sort()\n .forEach(function (facetName) {\n var facetValues = facetsExcludes[facetName] || [];\n facetValues.sort().forEach(function (facetValue) {\n facetFilters.push(facetName + ':-' + facetValue);\n });\n });\n\n var disjunctiveFacetsRefinements = state.disjunctiveFacetsRefinements || {};\n Object.keys(disjunctiveFacetsRefinements)\n .sort()\n .forEach(function (facetName) {\n var facetValues = disjunctiveFacetsRefinements[facetName] || [];\n if (facetName === facet || !facetValues || facetValues.length === 0) {\n return;\n }\n var orFilters = [];\n\n facetValues\n .slice()\n .sort()\n .forEach(function (facetValue) {\n orFilters.push(facetName + ':' + facetValue);\n });\n\n facetFilters.push(orFilters);\n });\n\n var hierarchicalFacetsRefinements =\n state.hierarchicalFacetsRefinements || {};\n Object.keys(hierarchicalFacetsRefinements)\n .sort()\n .forEach(function (facetName) {\n var facetValues = hierarchicalFacetsRefinements[facetName] || [];\n var facetValue = facetValues[0];\n\n if (facetValue === undefined) {\n return;\n }\n\n var hierarchicalFacet = state.getHierarchicalFacetByName(facetName);\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n var rootPath = state._getHierarchicalRootPath(hierarchicalFacet);\n var attributeToRefine;\n var attributesIndex;\n\n // we ask for parent facet values only when the `facet` is the current hierarchical facet\n if (facet === facetName) {\n // if we are at the root level already, no need to ask for facet values, we get them from\n // the hits query\n if (\n facetValue.indexOf(separator) === -1 ||\n (!rootPath && hierarchicalRootLevel === true) ||\n (rootPath &&\n rootPath.split(separator).length ===\n facetValue.split(separator).length)\n ) {\n return;\n }\n\n if (!rootPath) {\n attributesIndex = facetValue.split(separator).length - 2;\n facetValue = facetValue.slice(0, facetValue.lastIndexOf(separator));\n } else {\n attributesIndex = rootPath.split(separator).length - 1;\n facetValue = rootPath;\n }\n\n attributeToRefine = hierarchicalFacet.attributes[attributesIndex];\n } else {\n attributesIndex = facetValue.split(separator).length - 1;\n\n attributeToRefine = hierarchicalFacet.attributes[attributesIndex];\n }\n\n if (attributeToRefine) {\n facetFilters.push([attributeToRefine + ':' + facetValue]);\n }\n });\n\n return facetFilters;\n },\n\n _getHitsHierarchicalFacetsAttributes: function (state) {\n var out = [];\n\n return state.hierarchicalFacets.reduce(\n // ask for as much levels as there's hierarchical refinements\n function getHitsAttributesForHierarchicalFacet(\n allAttributes,\n hierarchicalFacet\n ) {\n var hierarchicalRefinement = state.getHierarchicalRefinement(\n hierarchicalFacet.name\n )[0];\n\n // if no refinement, ask for root level\n if (!hierarchicalRefinement) {\n allAttributes.push(hierarchicalFacet.attributes[0]);\n return allAttributes;\n }\n\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n var level = hierarchicalRefinement.split(separator).length;\n var newAttributes = hierarchicalFacet.attributes.slice(0, level + 1);\n\n return allAttributes.concat(newAttributes);\n },\n out\n );\n },\n\n _getDisjunctiveHierarchicalFacetAttribute: function (\n state,\n hierarchicalFacet,\n rootLevel\n ) {\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n if (rootLevel === true) {\n var rootPath = state._getHierarchicalRootPath(hierarchicalFacet);\n var attributeIndex = 0;\n\n if (rootPath) {\n attributeIndex = rootPath.split(separator).length;\n }\n return [hierarchicalFacet.attributes[attributeIndex]];\n }\n\n var hierarchicalRefinement =\n state.getHierarchicalRefinement(hierarchicalFacet.name)[0] || '';\n // if refinement is 'beers > IPA > Flying dog',\n // then we want `facets: ['beers > IPA']` as disjunctive facet (parent level values)\n\n var parentLevel = hierarchicalRefinement.split(separator).length - 1;\n return hierarchicalFacet.attributes.slice(0, parentLevel + 1);\n },\n\n getSearchForFacetQuery: function (facetName, query, maxFacetHits, state) {\n var stateForSearchForFacetValues = state.isDisjunctiveFacet(facetName)\n ? state.clearRefinements(facetName)\n : state;\n var searchForFacetSearchParameters = {\n facetQuery: query,\n facetName: facetName,\n };\n if (typeof maxFacetHits === 'number') {\n searchForFacetSearchParameters.maxFacetHits = maxFacetHits;\n }\n return sortObject(\n merge(\n {},\n requestBuilder._getHitsSearchParams(stateForSearchForFacetValues),\n searchForFacetSearchParameters\n )\n );\n },\n};\n\nmodule.exports = requestBuilder;\n\n\n//# sourceURL=webpack://kerisse/./node_modules/algoliasearch-helper/src/requestBuilder.js?"); +eval("\n\nvar merge = __webpack_require__(/*! ./functions/merge */ \"./node_modules/algoliasearch-helper/src/functions/merge.js\");\n\nfunction sortObject(obj) {\n return Object.keys(obj)\n .sort()\n .reduce(function (acc, curr) {\n acc[curr] = obj[curr];\n return acc;\n }, {});\n}\n\nvar requestBuilder = {\n /**\n * Get all the queries to send to the client, those queries can used directly\n * with the Algolia client.\n * @private\n * @param {string} index The name of the index\n * @param {SearchParameters} state The state from which to get the queries\n * @return {object[]} The queries\n */\n _getQueries: function getQueries(index, state) {\n var queries = [];\n\n // One query for the hits\n queries.push({\n indexName: index,\n params: requestBuilder._getHitsSearchParams(state),\n });\n\n // One for each disjunctive facets\n state.getRefinedDisjunctiveFacets().forEach(function (refinedFacet) {\n queries.push({\n indexName: index,\n params: requestBuilder._getDisjunctiveFacetSearchParams(\n state,\n refinedFacet\n ),\n });\n });\n\n // More to get the parent levels of the hierarchical facets when refined\n state.getRefinedHierarchicalFacets().forEach(function (refinedFacet) {\n var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet);\n var currentRefinement = state.getHierarchicalRefinement(refinedFacet);\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n // If we are deeper than level 0 (starting from `beer > IPA`)\n // we want to get all parent values\n if (\n currentRefinement.length > 0 &&\n currentRefinement[0].split(separator).length > 1\n ) {\n // We generate a map of the filters we will use for our facet values queries\n var filtersMap = currentRefinement[0]\n .split(separator)\n .slice(0, -1)\n .reduce(function createFiltersMap(map, segment, level) {\n return map.concat({\n attribute: hierarchicalFacet.attributes[level],\n value:\n level === 0\n ? segment\n : [map[map.length - 1].value, segment].join(separator),\n });\n }, []);\n\n filtersMap.forEach(function (filter, level) {\n var params = requestBuilder._getDisjunctiveFacetSearchParams(\n state,\n filter.attribute,\n level === 0\n );\n\n // Keep facet filters unrelated to current hierarchical attributes\n function hasHierarchicalFacetFilter(value) {\n return hierarchicalFacet.attributes.some(function (attribute) {\n return attribute === value.split(':')[0];\n });\n }\n\n var filteredFacetFilters = (params.facetFilters || []).reduce(\n function (acc, facetFilter) {\n if (Array.isArray(facetFilter)) {\n var filtered = facetFilter.filter(function (filterValue) {\n return !hasHierarchicalFacetFilter(filterValue);\n });\n\n if (filtered.length > 0) {\n acc.push(filtered);\n }\n }\n\n if (\n typeof facetFilter === 'string' &&\n !hasHierarchicalFacetFilter(facetFilter)\n ) {\n acc.push(facetFilter);\n }\n\n return acc;\n },\n []\n );\n\n var parent = filtersMap[level - 1];\n if (level > 0) {\n params.facetFilters = filteredFacetFilters.concat(\n parent.attribute + ':' + parent.value\n );\n } else if (filteredFacetFilters.length > 0) {\n params.facetFilters = filteredFacetFilters;\n } else {\n delete params.facetFilters;\n }\n\n queries.push({ indexName: index, params: params });\n });\n }\n });\n\n return queries;\n },\n\n /**\n * Build search parameters used to fetch hits\n * @private\n * @param {SearchParameters} state The state from which to get the queries\n * @return {object.} The search parameters for hits\n */\n _getHitsSearchParams: function (state) {\n var facets = state.facets\n .concat(state.disjunctiveFacets)\n .concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state))\n .sort();\n\n var facetFilters = requestBuilder._getFacetFilters(state);\n var numericFilters = requestBuilder._getNumericFilters(state);\n var tagFilters = requestBuilder._getTagFilters(state);\n var additionalParams = {};\n\n if (facets.length > 0) {\n additionalParams.facets = facets.indexOf('*') > -1 ? ['*'] : facets;\n }\n\n if (tagFilters.length > 0) {\n additionalParams.tagFilters = tagFilters;\n }\n\n if (facetFilters.length > 0) {\n additionalParams.facetFilters = facetFilters;\n }\n\n if (numericFilters.length > 0) {\n additionalParams.numericFilters = numericFilters;\n }\n\n return sortObject(merge({}, state.getQueryParams(), additionalParams));\n },\n\n /**\n * Build search parameters used to fetch a disjunctive facet\n * @private\n * @param {SearchParameters} state The state from which to get the queries\n * @param {string} facet the associated facet name\n * @param {boolean} hierarchicalRootLevel ?? FIXME\n * @return {object} The search parameters for a disjunctive facet\n */\n _getDisjunctiveFacetSearchParams: function (\n state,\n facet,\n hierarchicalRootLevel\n ) {\n var facetFilters = requestBuilder._getFacetFilters(\n state,\n facet,\n hierarchicalRootLevel\n );\n var numericFilters = requestBuilder._getNumericFilters(state, facet);\n var tagFilters = requestBuilder._getTagFilters(state);\n var additionalParams = {\n hitsPerPage: 0,\n page: 0,\n analytics: false,\n clickAnalytics: false,\n };\n\n if (tagFilters.length > 0) {\n additionalParams.tagFilters = tagFilters;\n }\n\n var hierarchicalFacet = state.getHierarchicalFacetByName(facet);\n\n if (hierarchicalFacet) {\n additionalParams.facets =\n requestBuilder._getDisjunctiveHierarchicalFacetAttribute(\n state,\n hierarchicalFacet,\n hierarchicalRootLevel\n );\n } else {\n additionalParams.facets = facet;\n }\n\n if (numericFilters.length > 0) {\n additionalParams.numericFilters = numericFilters;\n }\n\n if (facetFilters.length > 0) {\n additionalParams.facetFilters = facetFilters;\n }\n\n return sortObject(merge({}, state.getQueryParams(), additionalParams));\n },\n\n /**\n * Return the numeric filters in an algolia request fashion\n * @private\n * @param {SearchParameters} state the state from which to get the filters\n * @param {string} [facetName] the name of the attribute for which the filters should be excluded\n * @return {string[]} the numeric filters in the algolia format\n */\n _getNumericFilters: function (state, facetName) {\n if (state.numericFilters) {\n return state.numericFilters;\n }\n\n var numericFilters = [];\n\n Object.keys(state.numericRefinements).forEach(function (attribute) {\n var operators = state.numericRefinements[attribute] || {};\n Object.keys(operators).forEach(function (operator) {\n var values = operators[operator] || [];\n if (facetName !== attribute) {\n values.forEach(function (value) {\n if (Array.isArray(value)) {\n var vs = value.map(function (v) {\n return attribute + operator + v;\n });\n numericFilters.push(vs);\n } else {\n numericFilters.push(attribute + operator + value);\n }\n });\n }\n });\n });\n\n return numericFilters;\n },\n\n /**\n * Return the tags filters depending on which format is used, either tagFilters or tagRefinements\n * @private\n * @param {SearchParameters} state the state from which to get the filters\n * @return {string} Tag filters in a single string\n */\n _getTagFilters: function (state) {\n if (state.tagFilters) {\n return state.tagFilters;\n }\n\n return state.tagRefinements.join(',');\n },\n\n /**\n * Build facetFilters parameter based on current refinements. The array returned\n * contains strings representing the facet filters in the algolia format.\n * @private\n * @param {SearchParameters} state The state from which to get the queries\n * @param {string} [facet] if set, the current disjunctive facet\n * @param {boolean} [hierarchicalRootLevel] ?? FIXME\n * @return {array.} The facet filters in the algolia format\n */\n _getFacetFilters: function (state, facet, hierarchicalRootLevel) {\n var facetFilters = [];\n\n var facetsRefinements = state.facetsRefinements || {};\n Object.keys(facetsRefinements)\n .sort()\n .forEach(function (facetName) {\n var facetValues = facetsRefinements[facetName] || [];\n facetValues\n .slice()\n .sort()\n .forEach(function (facetValue) {\n facetFilters.push(facetName + ':' + facetValue);\n });\n });\n\n var facetsExcludes = state.facetsExcludes || {};\n Object.keys(facetsExcludes)\n .sort()\n .forEach(function (facetName) {\n var facetValues = facetsExcludes[facetName] || [];\n facetValues.sort().forEach(function (facetValue) {\n facetFilters.push(facetName + ':-' + facetValue);\n });\n });\n\n var disjunctiveFacetsRefinements = state.disjunctiveFacetsRefinements || {};\n Object.keys(disjunctiveFacetsRefinements)\n .sort()\n .forEach(function (facetName) {\n var facetValues = disjunctiveFacetsRefinements[facetName] || [];\n if (facetName === facet || !facetValues || facetValues.length === 0) {\n return;\n }\n var orFilters = [];\n\n facetValues\n .slice()\n .sort()\n .forEach(function (facetValue) {\n orFilters.push(facetName + ':' + facetValue);\n });\n\n facetFilters.push(orFilters);\n });\n\n var hierarchicalFacetsRefinements =\n state.hierarchicalFacetsRefinements || {};\n Object.keys(hierarchicalFacetsRefinements)\n .sort()\n .forEach(function (facetName) {\n var facetValues = hierarchicalFacetsRefinements[facetName] || [];\n var facetValue = facetValues[0];\n\n if (facetValue === undefined) {\n return;\n }\n\n var hierarchicalFacet = state.getHierarchicalFacetByName(facetName);\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n var rootPath = state._getHierarchicalRootPath(hierarchicalFacet);\n var attributeToRefine;\n var attributesIndex;\n\n // we ask for parent facet values only when the `facet` is the current hierarchical facet\n if (facet === facetName) {\n // if we are at the root level already, no need to ask for facet values, we get them from\n // the hits query\n if (\n facetValue.indexOf(separator) === -1 ||\n (!rootPath && hierarchicalRootLevel === true) ||\n (rootPath &&\n rootPath.split(separator).length ===\n facetValue.split(separator).length)\n ) {\n return;\n }\n\n if (!rootPath) {\n attributesIndex = facetValue.split(separator).length - 2;\n facetValue = facetValue.slice(0, facetValue.lastIndexOf(separator));\n } else {\n attributesIndex = rootPath.split(separator).length - 1;\n facetValue = rootPath;\n }\n\n attributeToRefine = hierarchicalFacet.attributes[attributesIndex];\n } else {\n attributesIndex = facetValue.split(separator).length - 1;\n\n attributeToRefine = hierarchicalFacet.attributes[attributesIndex];\n }\n\n if (attributeToRefine) {\n facetFilters.push([attributeToRefine + ':' + facetValue]);\n }\n });\n\n return facetFilters;\n },\n\n _getHitsHierarchicalFacetsAttributes: function (state) {\n var out = [];\n\n return state.hierarchicalFacets.reduce(\n // ask for as much levels as there's hierarchical refinements\n function getHitsAttributesForHierarchicalFacet(\n allAttributes,\n hierarchicalFacet\n ) {\n var hierarchicalRefinement = state.getHierarchicalRefinement(\n hierarchicalFacet.name\n )[0];\n\n // if no refinement, ask for root level\n if (!hierarchicalRefinement) {\n allAttributes.push(hierarchicalFacet.attributes[0]);\n return allAttributes;\n }\n\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n var level = hierarchicalRefinement.split(separator).length;\n var newAttributes = hierarchicalFacet.attributes.slice(0, level + 1);\n\n return allAttributes.concat(newAttributes);\n },\n out\n );\n },\n\n _getDisjunctiveHierarchicalFacetAttribute: function (\n state,\n hierarchicalFacet,\n rootLevel\n ) {\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n if (rootLevel === true) {\n var rootPath = state._getHierarchicalRootPath(hierarchicalFacet);\n var attributeIndex = 0;\n\n if (rootPath) {\n attributeIndex = rootPath.split(separator).length;\n }\n return [hierarchicalFacet.attributes[attributeIndex]];\n }\n\n var hierarchicalRefinement =\n state.getHierarchicalRefinement(hierarchicalFacet.name)[0] || '';\n // if refinement is 'beers > IPA > Flying dog',\n // then we want `facets: ['beers > IPA']` as disjunctive facet (parent level values)\n\n var parentLevel = hierarchicalRefinement.split(separator).length - 1;\n return hierarchicalFacet.attributes.slice(0, parentLevel + 1);\n },\n\n getSearchForFacetQuery: function (facetName, query, maxFacetHits, state) {\n var stateForSearchForFacetValues = state.isDisjunctiveFacet(facetName)\n ? state.clearRefinements(facetName)\n : state;\n var searchForFacetSearchParameters = {\n facetQuery: query,\n facetName: facetName,\n };\n if (typeof maxFacetHits === 'number') {\n searchForFacetSearchParameters.maxFacetHits = maxFacetHits;\n }\n return sortObject(\n merge(\n {},\n requestBuilder._getHitsSearchParams(stateForSearchForFacetValues),\n searchForFacetSearchParameters\n )\n );\n },\n};\n\nmodule.exports = requestBuilder;\n\n\n//# sourceURL=webpack://kerisse/./node_modules/algoliasearch-helper/src/requestBuilder.js?"); /***/ }), @@ -311,7 +311,7 @@ eval("\n\nvar find = __webpack_require__(/*! ../functions/find */ \"./node_modul /***/ ((module) => { "use strict"; -eval("\n\nmodule.exports = '3.22.2';\n\n\n//# sourceURL=webpack://kerisse/./node_modules/algoliasearch-helper/src/version.js?"); +eval("\n\nmodule.exports = '3.22.5';\n\n\n//# sourceURL=webpack://kerisse/./node_modules/algoliasearch-helper/src/version.js?"); /***/ }), @@ -394,7 +394,7 @@ eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n* lo /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Component: () => (/* binding */ b),\n/* harmony export */ Fragment: () => (/* binding */ k),\n/* harmony export */ cloneElement: () => (/* binding */ E),\n/* harmony export */ createContext: () => (/* binding */ G),\n/* harmony export */ createElement: () => (/* binding */ _),\n/* harmony export */ createRef: () => (/* binding */ m),\n/* harmony export */ h: () => (/* binding */ _),\n/* harmony export */ hydrate: () => (/* binding */ D),\n/* harmony export */ isValidElement: () => (/* binding */ t),\n/* harmony export */ options: () => (/* binding */ l),\n/* harmony export */ render: () => (/* binding */ B),\n/* harmony export */ toChildArray: () => (/* binding */ H)\n/* harmony export */ });\nvar n,l,u,t,i,o,r,f,e,c,s,a,h={},p=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){var l=n.parentNode;l&&l.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)\"key\"==r?i=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),\"function\"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function m(){return{current:null}}function k(n){return n.children}function b(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;lu&&i.sort(f));P.__r=0}function S(n,l,u,t,i,o,r,f,e,c,s){var a,v,y,d,w,_=t&&t.__k||p,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=n,i.__b=n.__b+1,f=L(i,u,r,s),i.__i=f,o=null,-1!==f&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,\"function\"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f==r-1?a=f-r:f==r+1?a++:f>r?s>e-r?a+=f-r:a--:f(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f2&&(e.children=arguments.length>3?n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l=\"__cC\"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=p.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},b.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),\"function\"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},b.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},b.prototype.render=k,i=[],r=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,e=0,c=F(!1),s=F(!0),a=0;\n//# sourceMappingURL=preact.module.js.map\n\n\n//# sourceURL=webpack://kerisse/./node_modules/preact/dist/preact.module.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Component: () => (/* binding */ k),\n/* harmony export */ Fragment: () => (/* binding */ b),\n/* harmony export */ cloneElement: () => (/* binding */ E),\n/* harmony export */ createContext: () => (/* binding */ G),\n/* harmony export */ createElement: () => (/* binding */ _),\n/* harmony export */ createRef: () => (/* binding */ m),\n/* harmony export */ h: () => (/* binding */ _),\n/* harmony export */ hydrate: () => (/* binding */ D),\n/* harmony export */ isValidElement: () => (/* binding */ t),\n/* harmony export */ options: () => (/* binding */ l),\n/* harmony export */ render: () => (/* binding */ B),\n/* harmony export */ toChildArray: () => (/* binding */ H)\n/* harmony export */ });\nvar n,l,u,t,i,o,r,f,e,c,s,a,h={},v=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)\"key\"==r?i=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),\"function\"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function m(){return{current:null}}function b(n){return n.children}function k(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;lu&&i.sort(f));M.__r=0}function P(n,l,u,t,i,o,r,f,e,c,s){var a,p,y,d,w,_=t&&t.__k||v,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=n,i.__b=n.__b+1,o=null,-1!==(f=i.__i=L(i,u,r,s))&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,\"function\"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f==r-1?a--:f==r+1?a++:(f>r?a--:a++,i.__u|=65536))):i=n.__k[t]=null;if(s)for(t=0;t(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f2&&(e.children=arguments.length>3?n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l=\"__cC\"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.forEach(function(n){n.__e=!0,S(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),\"function\"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),S(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),S(this))},k.prototype.render=b,i=[],r=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},M.__r=0,e=0,c=F(!1),s=F(!0),a=0;\n//# sourceMappingURL=preact.module.js.map\n\n\n//# sourceURL=webpack://kerisse/./node_modules/preact/dist/preact.module.js?"); /***/ }), @@ -1233,7 +1233,7 @@ eval("var _typeof = (__webpack_require__(/*! ./typeof.js */ \"./node_modules/@ba \*******************************************************/ /***/ ((module) => { -eval("function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _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 }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://kerisse/./node_modules/@babel/runtime/helpers/typeof.js?"); +eval("function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _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 }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://kerisse/./node_modules/@babel/runtime/helpers/typeof.js?"); /***/ }), @@ -1264,7 +1264,7 @@ eval("// TODO(Babel 8): Remove this file.\n\nvar runtime = __webpack_require__(/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -eval("// Axios v1.7.2 Copyright (c) 2024 Matt Zabriskie and contributors\n\n\nfunction bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n};\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n};\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n};\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : __webpack_require__.g)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n };\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n};\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n};\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n};\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n};\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n};\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n};\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n};\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n};\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n};\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n};\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n };\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n};\n\nconst noop = () => {};\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n};\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz';\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n};\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0];\n }\n\n return str;\n};\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n };\n\n return visit(obj, 0);\n};\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nvar utils$1 = {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils$1.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils$1.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype$1 = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype$1, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype$1);\n\n utils$1.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\n// eslint-disable-next-line strict\nvar httpAdapter = null;\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils$1.isPlainObject(thing) || utils$1.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils$1.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils$1.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils$1.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils$1.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);\n\n if (!utils$1.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils$1.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils$1.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils$1.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils$1.isArray(value) && isFlatArray(value)) ||\n ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils$1.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils$1.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils$1.forEach(value, function each(el, key) {\n const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils$1.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode$1(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode$1);\n } : encode$1;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nfunction buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils$1.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils$1.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nvar InterceptorManager$1 = InterceptorManager;\n\nvar transitionalDefaults = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n\nvar URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n\nvar FormData$1 = typeof FormData !== 'undefined' ? FormData : null;\n\nvar Blob$1 = typeof Blob !== 'undefined' ? Blob : null;\n\nvar platform$1 = {\n isBrowser: true,\n classes: {\n URLSearchParams: URLSearchParams$1,\n FormData: FormData$1,\n Blob: Blob$1\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n\nconst hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nvar utils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n hasBrowserEnv: hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv: hasStandardBrowserEnv,\n origin: origin\n});\n\nvar platform = {\n ...utils,\n ...platform$1\n};\n\nfunction toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils$1.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils$1.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils$1.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils$1.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils$1.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils$1.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {\n const obj = {};\n\n utils$1.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils$1.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils$1.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils$1.isObject(data);\n\n if (isObjectPayload && utils$1.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils$1.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils$1.isArrayBuffer(data) ||\n utils$1.isBuffer(data) ||\n utils$1.isStream(data) ||\n utils$1.isFile(data) ||\n utils$1.isBlob(data) ||\n utils$1.isReadableStream(data)\n ) {\n return data;\n }\n if (utils$1.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils$1.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nvar defaults$1 = defaults;\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils$1.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nvar parseHeaders = rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils$1.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils$1.isString(value)) return;\n\n if (utils$1.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils$1.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils$1.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils$1.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils$1.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite);\n } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils$1.isHeaders(header)) {\n for (const [key, value] of header.entries()) {\n setHeader(value, key, rewrite);\n }\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils$1.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils$1.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils$1.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils$1.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils$1.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils$1.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils$1.forEach(this, (value, header) => {\n const key = utils$1.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils$1.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils$1.freezeMethods(AxiosHeaders);\n\nvar AxiosHeaders$1 = AxiosHeaders;\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nfunction transformData(fns, response) {\n const config = this || defaults$1;\n const context = response || config;\n const headers = AxiosHeaders$1.from(context.headers);\n let data = context.data;\n\n utils$1.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n\nfunction isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils$1.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nfunction settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n\nfunction parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\n/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n const threshold = 1000 / freq;\n let timer = null;\n return function throttled() {\n const force = this === true;\n\n const now = Date.now();\n if (force || now - timestamp > threshold) {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n timestamp = now;\n return fn.apply(null, arguments);\n }\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n timestamp = Date.now();\n return fn.apply(null, arguments);\n }, threshold - (now - timestamp));\n }\n };\n}\n\nvar progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n }, freq);\n};\n\nvar isURLSameOrigin = platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n\nvar cookies = platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils$1.isString(path) && cookie.push('path=' + path);\n\n utils$1.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nfunction isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nfunction combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nfunction buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nfunction mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {\n return utils$1.merge.call({caseless}, target, source);\n } else if (utils$1.isPlainObject(source)) {\n return utils$1.merge({}, source);\n } else if (utils$1.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils$1.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils$1.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n\nvar resolveConfig = (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders$1.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils$1.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n};\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nvar xhrAdapter = isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();\n let {responseType} = _config;\n let onCanceled;\n function done() {\n if (_config.cancelToken) {\n _config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (_config.signal) {\n _config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders$1.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, _config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, _config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n _config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils$1.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (typeof _config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(_config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof _config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(_config.onUploadProgress));\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n};\n\nconst composeSignals = (signals, timeout) => {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (cancel) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = cancel instanceof Error ? cancel : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n };\n\n let timer = timeout && setTimeout(() => {\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));\n }, timeout);\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal &&\n (signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));\n });\n signals = null;\n }\n };\n\n signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = unsubscribe;\n\n return [signal, () => {\n timer && clearTimeout(timer);\n timer = null;\n }];\n};\n\nvar composeSignals$1 = composeSignals;\n\nconst streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n};\n\nconst readBytes = async function* (iterable, chunkSize, encode) {\n for await (const chunk of iterable) {\n yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);\n }\n};\n\nconst trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {\n const iterator = readBytes(stream, chunkSize, encode);\n\n let bytes = 0;\n\n return new ReadableStream({\n type: 'bytes',\n\n async pull(controller) {\n const {done, value} = await iterator.next();\n\n if (done) {\n controller.close();\n onFinish();\n return;\n }\n\n let len = value.byteLength;\n onProgress && onProgress(bytes += len);\n controller.enqueue(new Uint8Array(value));\n },\n cancel(reason) {\n onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n};\n\nconst fetchProgressDecorator = (total, fn) => {\n const lengthComputable = total != null;\n return (loaded) => setTimeout(() => fn({\n lengthComputable,\n total,\n loaded\n }));\n};\n\nconst isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';\nconst isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';\n\n// used only inside the fetch adapter\nconst encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Response(str).arrayBuffer())\n);\n\nconst supportsRequestStream = isReadableStreamSupported && (() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n})();\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst supportsResponseStream = isReadableStreamSupported && !!(()=> {\n try {\n return utils$1.isReadableStream(new Response('').body);\n } catch(err) {\n // return undefined\n }\n})();\n\nconst resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n};\n\nisFetchSupported && (((res) => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :\n (_, config) => {\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n });\n });\n})(new Response));\n\nconst getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if(utils$1.isBlob(body)) {\n return body.size;\n }\n\n if(utils$1.isSpecCompliantForm(body)) {\n return (await new Request(body).arrayBuffer()).byteLength;\n }\n\n if(utils$1.isArrayBufferView(body)) {\n return body.byteLength;\n }\n\n if(utils$1.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if(utils$1.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n};\n\nconst resolveBodyLength = async (headers, body) => {\n const length = utils$1.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n};\n\nvar fetchAdapter = isFetchSupported && (async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?\n composeSignals$1([signal, cancelToken], timeout) : [];\n\n let finished, request;\n\n const onFinish = () => {\n !finished && setTimeout(() => {\n composedSignal && composedSignal.unsubscribe();\n });\n\n finished = true;\n };\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader);\n }\n\n if (_request.body) {\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, fetchProgressDecorator(\n requestContentLength,\n progressEventReducer(onUploadProgress)\n ), null, encodeText);\n }\n }\n\n if (!utils$1.isString(withCredentials)) {\n withCredentials = withCredentials ? 'cors' : 'omit';\n }\n\n request = new Request(url, {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n withCredentials\n });\n\n let response = await fetch(request);\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onDownloadProgress && fetchProgressDecorator(\n responseContentLength,\n progressEventReducer(onDownloadProgress, true)\n ), isStreamResponse && onFinish, encodeText),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && onFinish();\n\n stopTimeout && stopTimeout();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders$1.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n });\n })\n } catch (err) {\n onFinish();\n\n if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n});\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: fetchAdapter\n};\n\nutils$1.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;\n\nvar adapters = {\n getAdapter: (adapters) => {\n adapters = utils$1.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n};\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nfunction dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders$1.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders$1.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders$1.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n\nconst VERSION = \"1.7.2\";\n\nconst validators$1 = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators$1[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators$1.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nvar validator = {\n assertOptions,\n validators: validators$1\n};\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager$1(),\n response: new InterceptorManager$1()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack;\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils$1.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n };\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils$1.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils$1.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders$1.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nvar Axios$1 = Axios;\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nvar CancelToken$1 = CancelToken;\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nfunction spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nfunction isAxiosError(payload) {\n return utils$1.isObject(payload) && (payload.isAxiosError === true);\n}\n\nconst HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nvar HttpStatusCode$1 = HttpStatusCode;\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios$1(defaultConfig);\n const instance = bind(Axios$1.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils$1.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults$1);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios$1;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken$1;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders$1;\n\naxios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode$1;\n\naxios.default = axios;\n\nmodule.exports = axios;\n//# sourceMappingURL=axios.cjs.map\n\n\n//# sourceURL=webpack://kerisse/./node_modules/axios/dist/browser/axios.cjs?"); +eval("// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors\n\n\nfunction bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n};\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n};\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n};\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : __webpack_require__.g)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n };\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n};\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n};\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n};\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n};\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n};\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n};\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n};\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n};\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n};\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n};\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n };\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n};\n\nconst noop = () => {};\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n};\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz';\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n};\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0];\n }\n\n return str;\n};\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n };\n\n return visit(obj, 0);\n};\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\nvar utils$1 = {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap\n};\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils$1.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils$1.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype$1 = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype$1, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype$1);\n\n utils$1.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\n// eslint-disable-next-line strict\nvar httpAdapter = null;\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils$1.isPlainObject(thing) || utils$1.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils$1.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils$1.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils$1.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils$1.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);\n\n if (!utils$1.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils$1.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils$1.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils$1.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils$1.isArray(value) && isFlatArray(value)) ||\n ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils$1.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils$1.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils$1.forEach(value, function each(el, key) {\n const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils$1.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode$1(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode$1);\n } : encode$1;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nfunction buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils$1.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils$1.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nvar InterceptorManager$1 = InterceptorManager;\n\nvar transitionalDefaults = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n\nvar URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n\nvar FormData$1 = typeof FormData !== 'undefined' ? FormData : null;\n\nvar Blob$1 = typeof Blob !== 'undefined' ? Blob : null;\n\nvar platform$1 = {\n isBrowser: true,\n classes: {\n URLSearchParams: URLSearchParams$1,\n FormData: FormData$1,\n Blob: Blob$1\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n\nconst hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nvar utils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n hasBrowserEnv: hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv: hasStandardBrowserEnv,\n navigator: _navigator,\n origin: origin\n});\n\nvar platform = {\n ...utils,\n ...platform$1\n};\n\nfunction toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils$1.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils$1.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils$1.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils$1.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils$1.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils$1.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {\n const obj = {};\n\n utils$1.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils$1.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils$1.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils$1.isObject(data);\n\n if (isObjectPayload && utils$1.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils$1.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils$1.isArrayBuffer(data) ||\n utils$1.isBuffer(data) ||\n utils$1.isStream(data) ||\n utils$1.isFile(data) ||\n utils$1.isBlob(data) ||\n utils$1.isReadableStream(data)\n ) {\n return data;\n }\n if (utils$1.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils$1.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nvar defaults$1 = defaults;\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils$1.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nvar parseHeaders = rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils$1.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils$1.isString(value)) return;\n\n if (utils$1.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils$1.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils$1.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils$1.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils$1.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite);\n } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils$1.isHeaders(header)) {\n for (const [key, value] of header.entries()) {\n setHeader(value, key, rewrite);\n }\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils$1.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils$1.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils$1.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils$1.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils$1.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils$1.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils$1.forEach(this, (value, header) => {\n const key = utils$1.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils$1.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils$1.freezeMethods(AxiosHeaders);\n\nvar AxiosHeaders$1 = AxiosHeaders;\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nfunction transformData(fns, response) {\n const config = this || defaults$1;\n const context = response || config;\n const headers = AxiosHeaders$1.from(context.headers);\n let data = context.data;\n\n utils$1.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n\nfunction isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils$1.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nfunction settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n\nfunction parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\n/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn.apply(null, args);\n };\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs);\n }, threshold - passed);\n }\n }\n };\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nconst progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n};\n\nconst progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n};\n\nconst asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));\n\nvar isURLSameOrigin = platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n\nvar cookies = platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils$1.isString(path) && cookie.push('path=' + path);\n\n utils$1.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nfunction isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nfunction combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nfunction buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nfunction mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {\n return utils$1.merge.call({caseless}, target, source);\n } else if (utils$1.isPlainObject(source)) {\n return utils$1.merge({}, source);\n } else if (utils$1.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils$1.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils$1.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n\nvar resolveConfig = (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders$1.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils$1.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n};\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nvar xhrAdapter = isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders$1.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils$1.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n};\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n };\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));\n }, timeout);\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n };\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils$1.asap(unsubscribe);\n\n return signal;\n }\n};\n\nvar composeSignals$1 = composeSignals;\n\nconst streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n};\n\nconst readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n};\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n};\n\nconst trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n };\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n};\n\nconst isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';\nconst isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';\n\n// used only inside the fetch adapter\nconst encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Response(str).arrayBuffer())\n);\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n};\n\nconst supportsRequestStream = isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n});\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst supportsResponseStream = isReadableStreamSupported &&\n test(() => utils$1.isReadableStream(new Response('').body));\n\n\nconst resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n};\n\nisFetchSupported && (((res) => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :\n (_, config) => {\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n });\n });\n})(new Response));\n\nconst getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if(utils$1.isBlob(body)) {\n return body.size;\n }\n\n if(utils$1.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if(utils$1.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if(utils$1.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n};\n\nconst resolveBodyLength = async (headers, body) => {\n const length = utils$1.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n};\n\nvar fetchAdapter = isFetchSupported && (async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader);\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils$1.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = \"credentials\" in Request.prototype;\n request = new Request(url, {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n });\n\n let response = await fetch(request);\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders$1.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n });\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n});\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: fetchAdapter\n};\n\nutils$1.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;\n\nvar adapters = {\n getAdapter: (adapters) => {\n adapters = utils$1.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n};\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nfunction dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders$1.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders$1.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders$1.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n\nconst VERSION = \"1.7.7\";\n\nconst validators$1 = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators$1[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators$1.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nvar validator = {\n assertOptions,\n validators: validators$1\n};\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager$1(),\n response: new InterceptorManager$1()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack;\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils$1.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n };\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils$1.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils$1.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders$1.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nvar Axios$1 = Axios;\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nvar CancelToken$1 = CancelToken;\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nfunction spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nfunction isAxiosError(payload) {\n return utils$1.isObject(payload) && (payload.isAxiosError === true);\n}\n\nconst HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nvar HttpStatusCode$1 = HttpStatusCode;\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios$1(defaultConfig);\n const instance = bind(Axios$1.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils$1.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults$1);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios$1;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken$1;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders$1;\n\naxios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode$1;\n\naxios.default = axios;\n\nmodule.exports = axios;\n//# sourceMappingURL=axios.cjs.map\n\n\n//# sourceURL=webpack://kerisse/./node_modules/axios/dist/browser/axios.cjs?"); /***/ }), @@ -1286,7 +1286,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _objectWithoutProperties)\n/* harmony export */ });\n/* harmony import */ var _objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objectWithoutPropertiesLoose.js */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n\nfunction _objectWithoutProperties(e, t) {\n if (null == e) return {};\n var o,\n r,\n i = (0,_objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(e, t);\n if (Object.getOwnPropertySymbols) {\n var n = Object.getOwnPropertySymbols(e);\n for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);\n }\n return i;\n}\n\n\n//# sourceURL=webpack://kerisse/./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _objectWithoutProperties)\n/* harmony export */ });\n/* harmony import */ var _objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objectWithoutPropertiesLoose.js */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n\nfunction _objectWithoutProperties(e, t) {\n if (null == e) return {};\n var o,\n r,\n i = (0,_objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(e, t);\n if (Object.getOwnPropertySymbols) {\n var s = Object.getOwnPropertySymbols(e);\n for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);\n }\n return i;\n}\n\n\n//# sourceURL=webpack://kerisse/./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js?"); /***/ }), @@ -1297,7 +1297,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _objectWithoutPropertiesLoose)\n/* harmony export */ });\nfunction _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.indexOf(n) >= 0) continue;\n t[n] = r[n];\n }\n return t;\n}\n\n\n//# sourceURL=webpack://kerisse/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _objectWithoutPropertiesLoose)\n/* harmony export */ });\nfunction _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.includes(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\n\n\n//# sourceURL=webpack://kerisse/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js?"); /***/ }), @@ -1396,7 +1396,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var instantsearch_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! instantsearch-ui-components */ \"./node_modules/instantsearch-ui-components/dist/es/lib/cx.js\");\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.module.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/isSpecialClick.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/isEqual.js\");\n/* harmony import */ var _SearchBox_SearchBox_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../SearchBox/SearchBox.js */ \"./node_modules/instantsearch.js/es/components/SearchBox/SearchBox.js\");\n/* harmony import */ var _Template_Template_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Template/Template.js */ \"./node_modules/instantsearch.js/es/components/Template/Template.js\");\n/* harmony import */ var _RefinementListItem_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RefinementListItem.js */ \"./node_modules/instantsearch.js/es/components/RefinementList/RefinementListItem.js\");\nvar _excluded = [\"root\"];\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\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 } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\n\n\n// CSS types\n\nvar defaultProps = {\n cssClasses: {},\n depth: 0\n};\nfunction isHierarchicalMenuItem(facetValue) {\n return facetValue.data !== undefined;\n}\nvar RefinementList = /*#__PURE__*/function (_Component) {\n _inherits(RefinementList, _Component);\n var _super = _createSuper(RefinementList);\n function RefinementList() {\n var _this;\n _classCallCheck(this, RefinementList);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"searchBox\", (0,preact__WEBPACK_IMPORTED_MODULE_0__.createRef)());\n _defineProperty(_assertThisInitialized(_this), \"_generateFacetItem\", function (facetValue) {\n var subItems;\n if (isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0) {\n var _this$props$cssClasse = _this.props.cssClasses,\n root = _this$props$cssClasse.root,\n cssClasses = _objectWithoutProperties(_this$props$cssClasse, _excluded);\n subItems = (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(RefinementList, _extends({}, _this.props, {\n // We want to keep `root` required for external usage but not for the\n // sub items.\n cssClasses: cssClasses,\n depth: _this.props.depth + 1,\n facetValues: facetValue.data,\n showMore: false,\n className: _this.props.cssClasses.childList\n }));\n }\n var url = _this.props.createURL(facetValue.value);\n var templateData = _objectSpread(_objectSpread({}, facetValue), {}, {\n url: url,\n attribute: _this.props.attribute,\n cssClasses: _this.props.cssClasses,\n isFromSearch: _this.props.isFromSearch\n });\n var key = facetValue.value;\n if (facetValue.isRefined !== undefined) {\n key += \"/\".concat(facetValue.isRefined);\n }\n if (facetValue.count !== undefined) {\n key += \"/\".concat(facetValue.count);\n }\n var refinementListItemClassName = (0,instantsearch_ui_components__WEBPACK_IMPORTED_MODULE_1__.cx)(_this.props.cssClasses.item, facetValue.isRefined && _this.props.cssClasses.selectedItem, !facetValue.count && _this.props.cssClasses.disabledItem, Boolean(isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0) && _this.props.cssClasses.parentItem);\n return (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(_RefinementListItem_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n templateKey: \"item\",\n key: key,\n facetValueToRefine: facetValue.value,\n handleClick: _this.handleItemClick,\n isRefined: facetValue.isRefined,\n className: refinementListItemClassName,\n subItems: subItems,\n templateData: templateData,\n templateProps: _this.props.templateProps\n });\n });\n // Click events on DOM tree like LABEL > INPUT will result in two click events\n // instead of one.\n // No matter the framework, see https://www.google.com/search?q=click+label+twice\n //\n // Thus making it hard to distinguish activation from deactivation because both click events\n // are very close. Debounce is a solution but hacky.\n //\n // So the code here checks if the click was done on or in a LABEL. If this LABEL\n // has a checkbox inside, we ignore the first click event because we will get another one.\n //\n // We also check if the click was done inside a link and then e.preventDefault() because we already\n // handle the url\n //\n // Finally, we always stop propagation of the event to avoid multiple levels RefinementLists to fail: click\n // on child would click on parent also\n _defineProperty(_assertThisInitialized(_this), \"handleItemClick\", function (_ref) {\n var facetValueToRefine = _ref.facetValueToRefine,\n isRefined = _ref.isRefined,\n originalEvent = _ref.originalEvent;\n if ((0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.isSpecialClick)(originalEvent)) {\n // do not alter the default browser behavior\n // if one special key is down\n return;\n }\n var parent = originalEvent.target;\n if (parent === null || parent.parentNode === null) {\n return;\n }\n if (isRefined && parent.parentNode.querySelector('input[type=\"radio\"]:checked')) {\n // Prevent refinement for being reset if the user clicks on an already checked radio button\n return;\n }\n if (parent.tagName === 'INPUT') {\n _this.refine(facetValueToRefine);\n return;\n }\n while (parent !== originalEvent.currentTarget) {\n if (parent.tagName === 'LABEL' && (parent.querySelector('input[type=\"checkbox\"]') || parent.querySelector('input[type=\"radio\"]'))) {\n return;\n }\n if (parent.tagName === 'A' && parent.href) {\n originalEvent.preventDefault();\n }\n parent = parent.parentNode;\n }\n originalEvent.stopPropagation();\n _this.refine(facetValueToRefine);\n });\n return _this;\n }\n _createClass(RefinementList, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps) {\n var areFacetValuesDifferent = !(0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__.isEqual)(this.props.facetValues, nextProps.facetValues);\n return areFacetValuesDifferent;\n }\n }, {\n key: \"refine\",\n value: function refine(facetValueToRefine) {\n this.props.toggleRefinement(facetValueToRefine);\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n if (this.searchBox.current && !nextProps.isFromSearch) {\n this.searchBox.current.resetInput();\n }\n }\n }, {\n key: \"refineFirstValue\",\n value: function refineFirstValue() {\n var firstValue = this.props.facetValues && this.props.facetValues[0];\n if (firstValue) {\n var actualValue = firstValue.value;\n this.props.toggleRefinement(actualValue);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n var showMoreButtonClassName = (0,instantsearch_ui_components__WEBPACK_IMPORTED_MODULE_1__.cx)(this.props.cssClasses.showMore, !(this.props.showMore === true && this.props.canToggleShowMore) && this.props.cssClasses.disabledShowMore);\n var showMoreButton = this.props.showMore === true && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(_Template_Template_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _extends({}, this.props.templateProps, {\n templateKey: \"showMoreText\",\n rootTagName: \"button\",\n rootProps: {\n className: showMoreButtonClassName,\n disabled: !this.props.canToggleShowMore,\n onClick: this.props.toggleShowMore\n },\n data: {\n isShowingMore: this.props.isShowingMore\n }\n }));\n var shouldDisableSearchBox = this.props.searchIsAlwaysActive !== true && !(this.props.isFromSearch || !this.props.hasExhaustiveItems);\n var searchBox = this.props.searchFacetValues && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", {\n className: this.props.cssClasses.searchBox\n }, (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(_SearchBox_SearchBox_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n ref: this.searchBox,\n placeholder: this.props.searchPlaceholder,\n disabled: shouldDisableSearchBox,\n cssClasses: this.props.cssClasses.searchable,\n templates: this.props.searchBoxTemplateProps.templates,\n onChange: function onChange(event) {\n return _this2.props.searchFacetValues(event.target.value);\n },\n onReset: function onReset() {\n return _this2.props.searchFacetValues('');\n },\n onSubmit: function onSubmit() {\n return _this2.refineFirstValue();\n }\n // This sets the search box to a controlled state because\n // we don't rely on the `refine` prop but on `onChange`.\n ,\n searchAsYouType: false,\n ariaLabel: \"Search for filters\"\n }));\n var facetValues = this.props.facetValues && this.props.facetValues.length > 0 && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"ul\", {\n className: this.props.cssClasses.list\n }, this.props.facetValues.map(this._generateFacetItem, this));\n var noResults = this.props.searchFacetValues && this.props.isFromSearch && (!this.props.facetValues || this.props.facetValues.length === 0) && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(_Template_Template_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _extends({}, this.props.templateProps, {\n templateKey: \"searchableNoResults\",\n rootProps: {\n className: this.props.cssClasses.noResults\n }\n }));\n var rootClassName = (0,instantsearch_ui_components__WEBPACK_IMPORTED_MODULE_1__.cx)(this.props.cssClasses.root, (!this.props.facetValues || this.props.facetValues.length === 0) && this.props.cssClasses.noRefinementRoot, this.props.className);\n return (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", {\n className: rootClassName\n }, this.props.children, searchBox, facetValues, noResults, showMoreButton);\n }\n }]);\n return RefinementList;\n}(preact__WEBPACK_IMPORTED_MODULE_0__.Component);\n_defineProperty(RefinementList, \"defaultProps\", defaultProps);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RefinementList);\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/components/RefinementList/RefinementList.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var instantsearch_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! instantsearch-ui-components */ \"./node_modules/instantsearch-ui-components/dist/es/lib/cx.js\");\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.module.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/isSpecialClick.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/isEqual.js\");\n/* harmony import */ var _SearchBox_SearchBox_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../SearchBox/SearchBox.js */ \"./node_modules/instantsearch.js/es/components/SearchBox/SearchBox.js\");\n/* harmony import */ var _Template_Template_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Template/Template.js */ \"./node_modules/instantsearch.js/es/components/Template/Template.js\");\n/* harmony import */ var _RefinementListItem_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RefinementListItem.js */ \"./node_modules/instantsearch.js/es/components/RefinementList/RefinementListItem.js\");\nvar _excluded = [\"root\"];\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\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 } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\n\n\n// CSS types\n\nvar defaultProps = {\n cssClasses: {},\n depth: 0\n};\nfunction isHierarchicalMenuItem(facetValue) {\n return facetValue.data !== undefined;\n}\nvar RefinementList = /*#__PURE__*/function (_Component) {\n _inherits(RefinementList, _Component);\n var _super = _createSuper(RefinementList);\n function RefinementList() {\n var _this;\n _classCallCheck(this, RefinementList);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"listRef\", (0,preact__WEBPACK_IMPORTED_MODULE_0__.createRef)());\n _defineProperty(_assertThisInitialized(_this), \"searchBox\", (0,preact__WEBPACK_IMPORTED_MODULE_0__.createRef)());\n _defineProperty(_assertThisInitialized(_this), \"lastRefinedValue\", undefined);\n _defineProperty(_assertThisInitialized(_this), \"_generateFacetItem\", function (facetValue) {\n var subItems;\n if (isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0) {\n var _this$props$cssClasse = _this.props.cssClasses,\n root = _this$props$cssClasse.root,\n cssClasses = _objectWithoutProperties(_this$props$cssClasse, _excluded);\n subItems = (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(RefinementList, _extends({}, _this.props, {\n // We want to keep `root` required for external usage but not for the\n // sub items.\n cssClasses: cssClasses,\n depth: _this.props.depth + 1,\n facetValues: facetValue.data,\n showMore: false,\n className: _this.props.cssClasses.childList\n }));\n }\n var url = _this.props.createURL(facetValue.value);\n var templateData = _objectSpread(_objectSpread({}, facetValue), {}, {\n url: url,\n attribute: _this.props.attribute,\n cssClasses: _this.props.cssClasses,\n isFromSearch: _this.props.isFromSearch\n });\n var key = facetValue.value;\n if (facetValue.isRefined !== undefined) {\n key += \"/\".concat(facetValue.isRefined);\n }\n if (facetValue.count !== undefined) {\n key += \"/\".concat(facetValue.count);\n }\n var refinementListItemClassName = (0,instantsearch_ui_components__WEBPACK_IMPORTED_MODULE_1__.cx)(_this.props.cssClasses.item, facetValue.isRefined && _this.props.cssClasses.selectedItem, !facetValue.count && _this.props.cssClasses.disabledItem, Boolean(isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0) && _this.props.cssClasses.parentItem);\n return (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(_RefinementListItem_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n templateKey: \"item\",\n key: key,\n facetValueToRefine: facetValue.value,\n handleClick: _this.handleItemClick,\n isRefined: facetValue.isRefined,\n className: refinementListItemClassName,\n subItems: subItems,\n templateData: templateData,\n templateProps: _this.props.templateProps\n });\n });\n // Click events on DOM tree like LABEL > INPUT will result in two click events\n // instead of one.\n // No matter the framework, see https://www.google.com/search?q=click+label+twice\n //\n // Thus making it hard to distinguish activation from deactivation because both click events\n // are very close. Debounce is a solution but hacky.\n //\n // So the code here checks if the click was done on or in a LABEL. If this LABEL\n // has a checkbox inside, we ignore the first click event because we will get another one.\n //\n // We also check if the click was done inside a link and then e.preventDefault() because we already\n // handle the url\n //\n // Finally, we always stop propagation of the event to avoid multiple levels RefinementLists to fail: click\n // on child would click on parent also\n _defineProperty(_assertThisInitialized(_this), \"handleItemClick\", function (_ref) {\n var facetValueToRefine = _ref.facetValueToRefine,\n isRefined = _ref.isRefined,\n originalEvent = _ref.originalEvent;\n if ((0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.isSpecialClick)(originalEvent)) {\n // do not alter the default browser behavior\n // if one special key is down\n return;\n }\n var parent = originalEvent.target;\n if (parent === null || parent.parentNode === null) {\n return;\n }\n if (isRefined && parent.parentNode.querySelector('input[type=\"radio\"]:checked')) {\n // Prevent refinement for being reset if the user clicks on an already checked radio button\n return;\n }\n if (parent.tagName === 'INPUT') {\n _this.refine(facetValueToRefine);\n return;\n }\n while (parent !== originalEvent.currentTarget) {\n if (parent.tagName === 'LABEL' && (parent.querySelector('input[type=\"checkbox\"]') || parent.querySelector('input[type=\"radio\"]'))) {\n return;\n }\n if (parent.tagName === 'A' && parent.href) {\n originalEvent.preventDefault();\n }\n parent = parent.parentNode;\n }\n originalEvent.stopPropagation();\n _this.refine(facetValueToRefine);\n });\n return _this;\n }\n _createClass(RefinementList, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps) {\n var areFacetValuesDifferent = !(0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__.isEqual)(this.props.facetValues, nextProps.facetValues);\n return areFacetValuesDifferent;\n }\n }, {\n key: \"refine\",\n value: function refine(facetValueToRefine) {\n this.lastRefinedValue = facetValueToRefine;\n this.props.toggleRefinement(facetValueToRefine);\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n if (this.searchBox.current && !nextProps.isFromSearch) {\n this.searchBox.current.resetInput();\n }\n }\n\n /**\n * This sets focus on the last refined input element after a render\n * because Preact does not perform it automatically.\n * @see https://github.com/preactjs/preact/issues/3242\n */\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n var _this$listRef$current, _this$listRef$current2;\n (_this$listRef$current = this.listRef.current) === null || _this$listRef$current === void 0 ? void 0 : (_this$listRef$current2 = _this$listRef$current.querySelector(\"input[value=\\\"\".concat(this.lastRefinedValue, \"\\\"]\"))) === null || _this$listRef$current2 === void 0 ? void 0 : _this$listRef$current2.focus();\n this.lastRefinedValue = undefined;\n }\n }, {\n key: \"refineFirstValue\",\n value: function refineFirstValue() {\n var firstValue = this.props.facetValues && this.props.facetValues[0];\n if (firstValue) {\n var actualValue = firstValue.value;\n this.props.toggleRefinement(actualValue);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n var showMoreButtonClassName = (0,instantsearch_ui_components__WEBPACK_IMPORTED_MODULE_1__.cx)(this.props.cssClasses.showMore, !(this.props.showMore === true && this.props.canToggleShowMore) && this.props.cssClasses.disabledShowMore);\n var showMoreButton = this.props.showMore === true && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(_Template_Template_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _extends({}, this.props.templateProps, {\n templateKey: \"showMoreText\",\n rootTagName: \"button\",\n rootProps: {\n className: showMoreButtonClassName,\n disabled: !this.props.canToggleShowMore,\n onClick: this.props.toggleShowMore\n },\n data: {\n isShowingMore: this.props.isShowingMore\n }\n }));\n var shouldDisableSearchBox = this.props.searchIsAlwaysActive !== true && !(this.props.isFromSearch || !this.props.hasExhaustiveItems);\n var searchBox = this.props.searchFacetValues && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", {\n className: this.props.cssClasses.searchBox\n }, (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(_SearchBox_SearchBox_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n ref: this.searchBox,\n placeholder: this.props.searchPlaceholder,\n disabled: shouldDisableSearchBox,\n cssClasses: this.props.cssClasses.searchable,\n templates: this.props.searchBoxTemplateProps.templates,\n onChange: function onChange(event) {\n return _this2.props.searchFacetValues(event.target.value);\n },\n onReset: function onReset() {\n return _this2.props.searchFacetValues('');\n },\n onSubmit: function onSubmit() {\n return _this2.refineFirstValue();\n }\n // This sets the search box to a controlled state because\n // we don't rely on the `refine` prop but on `onChange`.\n ,\n searchAsYouType: false,\n ariaLabel: \"Search for filters\"\n }));\n var facetValues = this.props.facetValues && this.props.facetValues.length > 0 && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"ul\", {\n ref: this.listRef,\n className: this.props.cssClasses.list\n }, this.props.facetValues.map(this._generateFacetItem, this));\n var noResults = this.props.searchFacetValues && this.props.isFromSearch && (!this.props.facetValues || this.props.facetValues.length === 0) && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(_Template_Template_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _extends({}, this.props.templateProps, {\n templateKey: \"searchableNoResults\",\n rootProps: {\n className: this.props.cssClasses.noResults\n }\n }));\n var rootClassName = (0,instantsearch_ui_components__WEBPACK_IMPORTED_MODULE_1__.cx)(this.props.cssClasses.root, (!this.props.facetValues || this.props.facetValues.length === 0) && this.props.cssClasses.noRefinementRoot, this.props.className);\n return (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", {\n className: rootClassName\n }, this.props.children, searchBox, facetValues, noResults, showMoreButton);\n }\n }]);\n return RefinementList;\n}(preact__WEBPACK_IMPORTED_MODULE_0__.Component);\n_defineProperty(RefinementList, \"defaultProps\", defaultProps);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RefinementList);\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/components/RefinementList/RefinementList.js?"); /***/ }), @@ -1616,7 +1616,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ highlight)\n/* harmony export */ });\n/* harmony import */ var _lib_suit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/suit.js */ \"./node_modules/instantsearch.js/es/lib/suit.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getPropertyByPath.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/escape-highlight.js\");\n\n\nvar suit = (0,_lib_suit_js__WEBPACK_IMPORTED_MODULE_0__.component)('Highlight');\n\n/**\n * @deprecated use html tagged templates and the Highlight component instead\n */\nfunction highlight(_ref) {\n var attribute = _ref.attribute,\n _ref$highlightedTagNa = _ref.highlightedTagName,\n highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n hit = _ref.hit,\n _ref$cssClasses = _ref.cssClasses,\n cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(false, \"`instantsearch.highlight` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `Highlight` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : 0;\n var highlightAttributeResult = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.getPropertyByPath)(hit._highlightResult, attribute);\n\n // @MAJOR fallback to attribute value if highlight is not found\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(highlightAttributeResult, \"Could not enable highlight for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : 0;\n var _ref2 = highlightAttributeResult || {},\n _ref2$value = _ref2.value,\n attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n // cx is not used, since it would be bundled as a dependency for Vue & Angular\n var className = suit({\n descendantName: 'highlighted'\n }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n return attributeValue.replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.TAG_REPLACEMENT.highlightPostTag, 'g'), \"\"));\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/helpers/highlight.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ highlight)\n/* harmony export */ });\n/* harmony import */ var _lib_suit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/suit.js */ \"./node_modules/instantsearch.js/es/lib/suit.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getPropertyByPath.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/escape-highlight.js\");\n\n\nvar suit = (0,_lib_suit_js__WEBPACK_IMPORTED_MODULE_0__.component)('Highlight');\n\n/**\n * @deprecated use html tagged templates and the Highlight component instead\n */\nfunction highlight(_ref) {\n var attribute = _ref.attribute,\n _ref$highlightedTagNa = _ref.highlightedTagName,\n highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n hit = _ref.hit,\n _ref$cssClasses = _ref.cssClasses,\n cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(false, \"`instantsearch.highlight` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `Highlight` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : 0;\n var highlightAttributeResult = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.getPropertyByPath)(hit._highlightResult, attribute);\n\n // @MAJOR fallback to attribute value if highlight is not found\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(highlightAttributeResult, \"Could not enable highlight for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : 0;\n var _ref2 = highlightAttributeResult || {},\n _ref2$value = _ref2.value,\n attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n // cx is not used, since it would be bundled as a dependency for Vue\n var className = suit({\n descendantName: 'highlighted'\n }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n return attributeValue.replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.TAG_REPLACEMENT.highlightPostTag, 'g'), \"\"));\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/helpers/highlight.js?"); /***/ }), @@ -1638,7 +1638,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ reverseHighlight)\n/* harmony export */ });\n/* harmony import */ var _lib_suit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/suit.js */ \"./node_modules/instantsearch.js/es/lib/suit.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getPropertyByPath.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/concatHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/reverseHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/escape-highlight.js\");\n\n\nvar suit = (0,_lib_suit_js__WEBPACK_IMPORTED_MODULE_0__.component)('ReverseHighlight');\n\n/**\n * @deprecated use html tagged templates and the ReverseHighlight component instead\n */\nfunction reverseHighlight(_ref) {\n var attribute = _ref.attribute,\n _ref$highlightedTagNa = _ref.highlightedTagName,\n highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n hit = _ref.hit,\n _ref$cssClasses = _ref.cssClasses,\n cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(false, \"`instantsearch.reverseHighlight` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `ReverseHighlight` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : 0;\n var highlightAttributeResult = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.getPropertyByPath)(hit._highlightResult, attribute);\n\n // @MAJOR fallback to attribute value if highlight is not found\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(highlightAttributeResult, \"Could not enable reverse highlight for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : 0;\n var _ref2 = highlightAttributeResult || {},\n _ref2$value = _ref2.value,\n attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n // cx is not used, since it would be bundled as a dependency for Vue & Angular\n var className = suit({\n descendantName: 'highlighted'\n }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n var reverseHighlightedValue = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.concatHighlightedParts)((0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__.reverseHighlightedParts)((0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.getHighlightedParts)(attributeValue)));\n return reverseHighlightedValue.replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__.TAG_REPLACEMENT.highlightPostTag, 'g'), \"\"));\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/helpers/reverseHighlight.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ reverseHighlight)\n/* harmony export */ });\n/* harmony import */ var _lib_suit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/suit.js */ \"./node_modules/instantsearch.js/es/lib/suit.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getPropertyByPath.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/concatHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/reverseHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/escape-highlight.js\");\n\n\nvar suit = (0,_lib_suit_js__WEBPACK_IMPORTED_MODULE_0__.component)('ReverseHighlight');\n\n/**\n * @deprecated use html tagged templates and the ReverseHighlight component instead\n */\nfunction reverseHighlight(_ref) {\n var attribute = _ref.attribute,\n _ref$highlightedTagNa = _ref.highlightedTagName,\n highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n hit = _ref.hit,\n _ref$cssClasses = _ref.cssClasses,\n cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(false, \"`instantsearch.reverseHighlight` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `ReverseHighlight` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : 0;\n var highlightAttributeResult = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.getPropertyByPath)(hit._highlightResult, attribute);\n\n // @MAJOR fallback to attribute value if highlight is not found\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(highlightAttributeResult, \"Could not enable reverse highlight for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\\n\\nSee: https://alg.li/highlighting\\n\")) : 0;\n var _ref2 = highlightAttributeResult || {},\n _ref2$value = _ref2.value,\n attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n // cx is not used, since it would be bundled as a dependency for Vue\n var className = suit({\n descendantName: 'highlighted'\n }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n var reverseHighlightedValue = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.concatHighlightedParts)((0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__.reverseHighlightedParts)((0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.getHighlightedParts)(attributeValue)));\n return reverseHighlightedValue.replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__.TAG_REPLACEMENT.highlightPostTag, 'g'), \"\"));\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/helpers/reverseHighlight.js?"); /***/ }), @@ -1649,7 +1649,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ reverseSnippet)\n/* harmony export */ });\n/* harmony import */ var _lib_suit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/suit.js */ \"./node_modules/instantsearch.js/es/lib/suit.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getPropertyByPath.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/concatHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/reverseHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/escape-highlight.js\");\n\n\nvar suit = (0,_lib_suit_js__WEBPACK_IMPORTED_MODULE_0__.component)('ReverseSnippet');\n\n/**\n * @deprecated use html tagged templates and the ReverseSnippet component instead\n */\nfunction reverseSnippet(_ref) {\n var attribute = _ref.attribute,\n _ref$highlightedTagNa = _ref.highlightedTagName,\n highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n hit = _ref.hit,\n _ref$cssClasses = _ref.cssClasses,\n cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(false, \"`instantsearch.reverseSnippet` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `ReverseSnippet` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : 0;\n var snippetAttributeResult = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.getPropertyByPath)(hit._snippetResult, attribute);\n\n // @MAJOR fallback to attribute value if snippet is not found\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(snippetAttributeResult, \"Could not enable reverse snippet for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : 0;\n var _ref2 = snippetAttributeResult || {},\n _ref2$value = _ref2.value,\n attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n // cx is not used, since it would be bundled as a dependency for Vue & Angular\n var className = suit({\n descendantName: 'highlighted'\n }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n var reverseHighlightedValue = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.concatHighlightedParts)((0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__.reverseHighlightedParts)((0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.getHighlightedParts)(attributeValue)));\n return reverseHighlightedValue.replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__.TAG_REPLACEMENT.highlightPostTag, 'g'), \"\"));\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/helpers/reverseSnippet.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ reverseSnippet)\n/* harmony export */ });\n/* harmony import */ var _lib_suit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/suit.js */ \"./node_modules/instantsearch.js/es/lib/suit.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getPropertyByPath.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/concatHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/reverseHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getHighlightedParts.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/escape-highlight.js\");\n\n\nvar suit = (0,_lib_suit_js__WEBPACK_IMPORTED_MODULE_0__.component)('ReverseSnippet');\n\n/**\n * @deprecated use html tagged templates and the ReverseSnippet component instead\n */\nfunction reverseSnippet(_ref) {\n var attribute = _ref.attribute,\n _ref$highlightedTagNa = _ref.highlightedTagName,\n highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n hit = _ref.hit,\n _ref$cssClasses = _ref.cssClasses,\n cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(false, \"`instantsearch.reverseSnippet` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `ReverseSnippet` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : 0;\n var snippetAttributeResult = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.getPropertyByPath)(hit._snippetResult, attribute);\n\n // @MAJOR fallback to attribute value if snippet is not found\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(snippetAttributeResult, \"Could not enable reverse snippet for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : 0;\n var _ref2 = snippetAttributeResult || {},\n _ref2$value = _ref2.value,\n attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n // cx is not used, since it would be bundled as a dependency for Vue\n var className = suit({\n descendantName: 'highlighted'\n }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n var reverseHighlightedValue = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.concatHighlightedParts)((0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__.reverseHighlightedParts)((0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.getHighlightedParts)(attributeValue)));\n return reverseHighlightedValue.replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_6__.TAG_REPLACEMENT.highlightPostTag, 'g'), \"\"));\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/helpers/reverseSnippet.js?"); /***/ }), @@ -1660,7 +1660,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ snippet)\n/* harmony export */ });\n/* harmony import */ var _lib_suit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/suit.js */ \"./node_modules/instantsearch.js/es/lib/suit.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getPropertyByPath.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/escape-highlight.js\");\n\n\nvar suit = (0,_lib_suit_js__WEBPACK_IMPORTED_MODULE_0__.component)('Snippet');\n\n/**\n * @deprecated use html tagged templates and the Snippet component instead\n */\nfunction snippet(_ref) {\n var attribute = _ref.attribute,\n _ref$highlightedTagNa = _ref.highlightedTagName,\n highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n hit = _ref.hit,\n _ref$cssClasses = _ref.cssClasses,\n cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(false, \"`instantsearch.snippet` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `Snippet` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : 0;\n var snippetAttributeResult = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.getPropertyByPath)(hit._snippetResult, attribute);\n\n // @MAJOR fallback to attribute value if snippet is not found\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(snippetAttributeResult, \"Could not enable snippet for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : 0;\n var _ref2 = snippetAttributeResult || {},\n _ref2$value = _ref2.value,\n attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n // cx is not used, since it would be bundled as a dependency for Vue & Angular\n var className = suit({\n descendantName: 'highlighted'\n }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n return attributeValue.replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.TAG_REPLACEMENT.highlightPostTag, 'g'), \"\"));\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/helpers/snippet.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ snippet)\n/* harmony export */ });\n/* harmony import */ var _lib_suit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/suit.js */ \"./node_modules/instantsearch.js/es/lib/suit.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getPropertyByPath.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/escape-highlight.js\");\n\n\nvar suit = (0,_lib_suit_js__WEBPACK_IMPORTED_MODULE_0__.component)('Snippet');\n\n/**\n * @deprecated use html tagged templates and the Snippet component instead\n */\nfunction snippet(_ref) {\n var attribute = _ref.attribute,\n _ref$highlightedTagNa = _ref.highlightedTagName,\n highlightedTagName = _ref$highlightedTagNa === void 0 ? 'mark' : _ref$highlightedTagNa,\n hit = _ref.hit,\n _ref$cssClasses = _ref.cssClasses,\n cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(false, \"`instantsearch.snippet` function has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `Snippet` component.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/?client=html+tagged+templates#upgrade-templates\") : 0;\n var snippetAttributeResult = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.getPropertyByPath)(hit._snippetResult, attribute);\n\n // @MAJOR fallback to attribute value if snippet is not found\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.warning)(snippetAttributeResult, \"Could not enable snippet for \\\"\".concat(attribute, \"\\\", will display an empty string.\\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\\n\\nSee: https://alg.li/highlighting\\n\")) : 0;\n var _ref2 = snippetAttributeResult || {},\n _ref2$value = _ref2.value,\n attributeValue = _ref2$value === void 0 ? '' : _ref2$value;\n\n // cx is not used, since it would be bundled as a dependency for Vue\n var className = suit({\n descendantName: 'highlighted'\n }) + (cssClasses.highlighted ? \" \".concat(cssClasses.highlighted) : '');\n return attributeValue.replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.TAG_REPLACEMENT.highlightPreTag, 'g'), \"<\".concat(highlightedTagName, \" class=\\\"\").concat(className, \"\\\">\")).replace(new RegExp(_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.TAG_REPLACEMENT.highlightPostTag, 'g'), \"\"));\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/helpers/snippet.js?"); /***/ }), @@ -1671,7 +1671,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/highlight.js\");\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/reverseHighlight.js\");\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/snippet.js\");\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/reverseSnippet.js\");\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/insights.js\");\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/get-insights-anonymous-user-token.js\");\n/* harmony import */ var _lib_infiniteHitsCache_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/infiniteHitsCache/index.js */ \"./node_modules/instantsearch.js/es/lib/infiniteHitsCache/sessionStorage.js\");\n/* harmony import */ var _lib_InstantSearch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/InstantSearch.js */ \"./node_modules/instantsearch.js/es/lib/InstantSearch.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_version_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/version.js */ \"./node_modules/instantsearch.js/es/lib/version.js\");\n/* harmony import */ var _types_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./types/index.js */ \"./node_modules/instantsearch.js/es/types/index.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _types_index_js__WEBPACK_IMPORTED_MODULE_10__) if(__WEBPACK_IMPORT_KEY__ !== \"default\") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _types_index_js__WEBPACK_IMPORTED_MODULE_10__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n\n\n\n\n\n/**\n * InstantSearch is the main component of InstantSearch.js. This object\n * manages the widget and lets you add new ones.\n *\n * Two parameters are required to get you started with InstantSearch.js:\n * - `indexName`: the main index that you will use for your new search UI\n * - `searchClient`: the search client to plug to InstantSearch.js\n *\n * The [search client provided by Algolia](algolia.com/doc/api-client/getting-started/what-is-the-api-client/javascript/)\n * needs an `appId` and an `apiKey`. Those parameters can be found in your\n * [Algolia dashboard](https://www.algolia.com/api-keys).\n *\n * If you want to get up and running quickly with InstantSearch.js, have a\n * look at the [getting started](https://www.algolia.com/doc/guides/building-search-ui/getting-started/js/).\n */\nvar instantsearch = function instantsearch(options) {\n return new _lib_InstantSearch_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](options);\n};\ninstantsearch.version = _lib_version_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\ninstantsearch.createInfiniteHitsSessionStorageCache = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.deprecate)(_lib_infiniteHitsCache_index_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"], \"import { createInfiniteHitsSessionStorageCache } from 'instantsearch.js/es/lib/infiniteHitsCache'\");\ninstantsearch.highlight = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.deprecate)(_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"], \"import { highlight } from 'instantsearch.js/es/helpers'\");\ninstantsearch.reverseHighlight = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.deprecate)(_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"], \"import { reverseHighlight } from 'instantsearch.js/es/helpers'\");\ninstantsearch.snippet = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.deprecate)(_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"], \"import { snippet } from 'instantsearch.js/es/helpers'\");\ninstantsearch.reverseSnippet = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.deprecate)(_helpers_index_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"], \"import { reverseSnippet } from 'instantsearch.js/es/helpers'\");\ninstantsearch.insights = _helpers_index_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\ninstantsearch.getInsightsAnonymousUserToken = _helpers_index_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\nObject.defineProperty(instantsearch, 'widgets', {\n get: function get() {\n throw new ReferenceError(\"\\\"instantsearch.widgets\\\" are not available from the ES build.\\n\\nTo import the widgets:\\n\\nimport { searchBox } from 'instantsearch.js/es/widgets'\");\n }\n});\nObject.defineProperty(instantsearch, 'connectors', {\n get: function get() {\n throw new ReferenceError(\"\\\"instantsearch.connectors\\\" are not available from the ES build.\\n\\nTo import the connectors:\\n\\nimport { connectSearchBox } from 'instantsearch.js/es/connectors'\");\n }\n});\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (instantsearch);\n\n\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/highlight.js\");\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/reverseHighlight.js\");\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/snippet.js\");\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/reverseSnippet.js\");\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/insights.js\");\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/get-insights-anonymous-user-token.js\");\n/* harmony import */ var _lib_infiniteHitsCache_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/infiniteHitsCache/index.js */ \"./node_modules/instantsearch.js/es/lib/infiniteHitsCache/sessionStorage.js\");\n/* harmony import */ var _lib_InstantSearch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/InstantSearch.js */ \"./node_modules/instantsearch.js/es/lib/InstantSearch.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_version_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/version.js */ \"./node_modules/instantsearch.js/es/lib/version.js\");\n/* harmony import */ var _types_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./types/index.js */ \"./node_modules/instantsearch.js/es/types/index.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _types_index_js__WEBPACK_IMPORTED_MODULE_10__) if(__WEBPACK_IMPORT_KEY__ !== \"default\") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _types_index_js__WEBPACK_IMPORTED_MODULE_10__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n\n\n\n\n\n/**\n * InstantSearch is the main component of InstantSearch.js. This object\n * manages the widget and lets you add new ones.\n *\n * Two parameters are required to get you started with InstantSearch.js:\n * - `indexName`: the main index that you will use for your new search UI\n * - `searchClient`: the search client to plug to InstantSearch.js\n *\n * The [search client provided by Algolia](algolia.com/doc/api-client/getting-started/what-is-the-api-client/javascript/)\n * needs an `appId` and an `apiKey`. Those parameters can be found in your\n * [Algolia dashboard](https://www.algolia.com/api-keys).\n *\n * If you want to get up and running quickly with InstantSearch.js, have a\n * look at the [getting started](https://www.algolia.com/doc/guides/building-search-ui/getting-started/js/).\n */\nvar instantsearch = function instantsearch(options) {\n return new _lib_InstantSearch_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](options);\n};\ninstantsearch.version = _lib_version_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\ninstantsearch.createInfiniteHitsSessionStorageCache = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.deprecate)(_lib_infiniteHitsCache_index_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"], \"import { createInfiniteHitsSessionStorageCache } from 'instantsearch.js/es/lib/infiniteHitsCache'\");\ninstantsearch.highlight = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.deprecate)(_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"], \"import { highlight } from 'instantsearch.js/es/helpers'\");\ninstantsearch.reverseHighlight = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.deprecate)(_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"], \"import { reverseHighlight } from 'instantsearch.js/es/helpers'\");\ninstantsearch.snippet = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.deprecate)(_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"], \"import { snippet } from 'instantsearch.js/es/helpers'\");\ninstantsearch.reverseSnippet = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.deprecate)(_helpers_index_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"], \"import { reverseSnippet } from 'instantsearch.js/es/helpers'\");\ninstantsearch.insights = _helpers_index_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\ninstantsearch.getInsightsAnonymousUserToken = _helpers_index_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\nObject.defineProperty(instantsearch, 'widgets', {\n get: function get() {\n throw new ReferenceError(\"\\\"instantsearch.widgets\\\" are not available from the ES build.\\n\\nTo import the widgets:\\n\\nimport { searchBox } from 'instantsearch.js/es/widgets'\");\n }\n});\nObject.defineProperty(instantsearch, 'connectors', {\n get: function get() {\n throw new ReferenceError(\"\\\"instantsearch.connectors\\\" are not available from the ES build.\\n\\nTo import the connectors:\\n\\nimport { connectSearchBox } from 'instantsearch.js/es/connectors'\");\n }\n});\nObject.defineProperty(instantsearch, 'templates', {\n get: function get() {\n throw new ReferenceError(\"\\\"instantsearch.templates\\\" are not available from the ES build.\\n\\nTo import the templates:\\n\\nimport { carousel } from 'instantsearch.js/es/templates'\");\n }\n});\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (instantsearch);\n\n\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/index.js?"); /***/ }), @@ -1682,7 +1682,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ INSTANTSEARCH_FUTURE_DEFAULTS: () => (/* binding */ INSTANTSEARCH_FUTURE_DEFAULTS),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _algolia_events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @algolia/events */ \"./node_modules/@algolia/events/events.js\");\n/* harmony import */ var algoliasearch_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! algoliasearch-helper */ \"./node_modules/algoliasearch-helper/index.js\");\n/* harmony import */ var _middlewares_createInsightsMiddleware_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../middlewares/createInsightsMiddleware.js */ \"./node_modules/instantsearch.js/es/middlewares/createInsightsMiddleware.js\");\n/* harmony import */ var _middlewares_createMetadataMiddleware_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../middlewares/createMetadataMiddleware.js */ \"./node_modules/instantsearch.js/es/middlewares/createMetadataMiddleware.js\");\n/* harmony import */ var _middlewares_createRouterMiddleware_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../middlewares/createRouterMiddleware.js */ \"./node_modules/instantsearch.js/es/middlewares/createRouterMiddleware.js\");\n/* harmony import */ var _widgets_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../widgets/index.js */ \"./node_modules/instantsearch.js/es/widgets/index/index.js\");\n/* harmony import */ var _createHelpers_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./createHelpers.js */ \"./node_modules/instantsearch.js/es/lib/createHelpers.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/documentation.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/defer.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/noop.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/isIndexWidget.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/hydrateSearchClient.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/hydrateRecommendCache.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/setIndexHelperState.js\");\n/* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./version.js */ \"./node_modules/instantsearch.js/es/lib/version.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\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 } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\n\n\n\n\nvar withUsage = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.createDocumentationMessageGenerator)({\n name: 'instantsearch'\n});\nfunction defaultCreateURL() {\n return '#';\n}\n\n// this purposely breaks typescript's type inference to ensure it's not used\n// as it's used for a default parameter for example\n// source: https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-504042546\n/**\n * Global options for an InstantSearch instance.\n */\nvar INSTANTSEARCH_FUTURE_DEFAULTS = {\n preserveSharedStateOnUnmount: false,\n persistHierarchicalRootCount: false\n};\n\n/**\n * The actual implementation of the InstantSearch. This is\n * created using the `instantsearch` factory function.\n * It emits the 'render' event every time a search is done\n */\nvar InstantSearch = /*#__PURE__*/function (_EventEmitter) {\n _inherits(InstantSearch, _EventEmitter);\n var _super = _createSuper(InstantSearch);\n function InstantSearch(options) {\n var _options$future2;\n var _this;\n _classCallCheck(this, InstantSearch);\n _this = _super.call(this);\n\n // prevent `render` event listening from causing a warning\n _defineProperty(_assertThisInitialized(_this), \"client\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"indexName\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"insightsClient\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"onStateChange\", null);\n _defineProperty(_assertThisInitialized(_this), \"future\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"helper\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"mainHelper\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"mainIndex\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"started\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"templatesConfig\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"renderState\", {});\n _defineProperty(_assertThisInitialized(_this), \"_stalledSearchDelay\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_searchStalledTimer\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_initialUiState\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_initialResults\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_createURL\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_searchFunction\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_mainHelperSearch\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_hasSearchWidget\", false);\n _defineProperty(_assertThisInitialized(_this), \"_hasRecommendWidget\", false);\n _defineProperty(_assertThisInitialized(_this), \"_insights\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"middleware\", []);\n _defineProperty(_assertThisInitialized(_this), \"sendEventToInsights\", void 0);\n /**\n * The status of the search. Can be \"idle\", \"loading\", \"stalled\", or \"error\".\n */\n _defineProperty(_assertThisInitialized(_this), \"status\", 'idle');\n /**\n * The last returned error from the Search API.\n * The error gets cleared when the next valid search response is rendered.\n */\n _defineProperty(_assertThisInitialized(_this), \"error\", undefined);\n _defineProperty(_assertThisInitialized(_this), \"scheduleSearch\", (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.defer)(function () {\n if (_this.started) {\n _this.mainHelper.search();\n }\n }));\n _defineProperty(_assertThisInitialized(_this), \"scheduleRender\", (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.defer)(function () {\n var _this$mainHelper;\n var shouldResetStatus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n if (!((_this$mainHelper = _this.mainHelper) !== null && _this$mainHelper !== void 0 && _this$mainHelper.hasPendingRequests())) {\n clearTimeout(_this._searchStalledTimer);\n _this._searchStalledTimer = null;\n if (shouldResetStatus) {\n _this.status = 'idle';\n _this.error = undefined;\n }\n }\n _this.mainIndex.render({\n instantSearchInstance: _assertThisInitialized(_this)\n });\n _this.emit('render');\n }));\n _defineProperty(_assertThisInitialized(_this), \"onInternalStateChange\", (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.defer)(function () {\n var nextUiState = _this.mainIndex.getWidgetUiState({});\n _this.middleware.forEach(function (_ref) {\n var instance = _ref.instance;\n instance.onStateChange({\n uiState: nextUiState\n });\n });\n }));\n _this.setMaxListeners(100);\n var _options$indexName = options.indexName,\n indexName = _options$indexName === void 0 ? '' : _options$indexName,\n numberLocale = options.numberLocale,\n _options$initialUiSta = options.initialUiState,\n initialUiState = _options$initialUiSta === void 0 ? {} : _options$initialUiSta,\n _options$routing = options.routing,\n routing = _options$routing === void 0 ? null : _options$routing,\n _options$insights = options.insights,\n insights = _options$insights === void 0 ? undefined : _options$insights,\n searchFunction = options.searchFunction,\n _options$stalledSearc = options.stalledSearchDelay,\n stalledSearchDelay = _options$stalledSearc === void 0 ? 200 : _options$stalledSearc,\n _options$searchClient = options.searchClient,\n searchClient = _options$searchClient === void 0 ? null : _options$searchClient,\n _options$insightsClie = options.insightsClient,\n insightsClient = _options$insightsClie === void 0 ? null : _options$insightsClie,\n _options$onStateChang = options.onStateChange,\n onStateChange = _options$onStateChang === void 0 ? null : _options$onStateChang,\n _options$future = options.future,\n future = _options$future === void 0 ? _objectSpread(_objectSpread({}, INSTANTSEARCH_FUTURE_DEFAULTS), options.future || {}) : _options$future;\n if (searchClient === null) {\n throw new Error(withUsage('The `searchClient` option is required.'));\n }\n if (typeof searchClient.search !== 'function') {\n throw new Error(\"The `searchClient` must implement a `search` method.\\n\\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/\");\n }\n if (typeof searchClient.addAlgoliaAgent === 'function') {\n searchClient.addAlgoliaAgent(\"instantsearch.js (\".concat(_version_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"], \")\"));\n }\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(insightsClient === null, \"`insightsClient` property has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") : 0;\n if (insightsClient && typeof insightsClient !== 'function') {\n throw new Error(withUsage('The `insightsClient` option should be a function.'));\n }\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(!options.searchParameters, \"The `searchParameters` option is deprecated and will not be supported in InstantSearch.js 4.x.\\n\\nYou can replace it with the `configure` widget:\\n\\n```\\nsearch.addWidgets([\\n configure(\".concat(JSON.stringify(options.searchParameters, null, 2), \")\\n]);\\n```\\n\\nSee \").concat((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.createDocumentationLink)({\n name: 'configure'\n }))) : 0;\n if ( true && ((_options$future2 = options.future) === null || _options$future2 === void 0 ? void 0 : _options$future2.preserveSharedStateOnUnmount) === undefined) {\n // eslint-disable-next-line no-console\n console.info(\"Starting from the next major version, InstantSearch will change how widgets state is preserved when they are removed. InstantSearch will keep the state of unmounted widgets to be usable by other widgets with the same attribute.\\n\\nWe recommend setting `future.preserveSharedStateOnUnmount` to true to adopt this change today.\\nTo stay with the current behaviour and remove this warning, set the option to false.\\n\\nSee documentation: \".concat((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.createDocumentationLink)({\n name: 'instantsearch'\n }), \"#widget-param-future\\n \"));\n }\n _this.client = searchClient;\n _this.future = future;\n _this.insightsClient = insightsClient;\n _this.indexName = indexName;\n _this.helper = null;\n _this.mainHelper = null;\n _this.mainIndex = (0,_widgets_index_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])({\n indexName: indexName\n });\n _this.onStateChange = onStateChange;\n _this.started = false;\n _this.templatesConfig = {\n helpers: (0,_createHelpers_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])({\n numberLocale: numberLocale\n }),\n compileOptions: {}\n };\n _this._stalledSearchDelay = stalledSearchDelay;\n _this._searchStalledTimer = null;\n _this._createURL = defaultCreateURL;\n _this._initialUiState = initialUiState;\n _this._initialResults = null;\n _this._insights = insights;\n if (searchFunction) {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(false, \"The `searchFunction` option is deprecated. Use `onStateChange` instead.\") : 0;\n _this._searchFunction = searchFunction;\n }\n _this.sendEventToInsights = _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop;\n if (routing) {\n var routerOptions = typeof routing === 'boolean' ? {} : routing;\n routerOptions.$$internal = true;\n _this.use((0,_middlewares_createRouterMiddleware_js__WEBPACK_IMPORTED_MODULE_9__.createRouterMiddleware)(routerOptions));\n }\n\n // This is the default Insights middleware,\n // added when `insights` is set to true by the user.\n // Any user-provided middleware will be added later and override this one.\n if (insights) {\n var insightsOptions = typeof insights === 'boolean' ? {} : insights;\n insightsOptions.$$internal = true;\n _this.use((0,_middlewares_createInsightsMiddleware_js__WEBPACK_IMPORTED_MODULE_10__.createInsightsMiddleware)(insightsOptions));\n }\n if ((0,_middlewares_createMetadataMiddleware_js__WEBPACK_IMPORTED_MODULE_11__.isMetadataEnabled)()) {\n _this.use((0,_middlewares_createMetadataMiddleware_js__WEBPACK_IMPORTED_MODULE_11__.createMetadataMiddleware)({\n $$internal: true\n }));\n }\n return _this;\n }\n\n /**\n * Hooks a middleware into the InstantSearch lifecycle.\n */\n _createClass(InstantSearch, [{\n key: \"_isSearchStalled\",\n get:\n /**\n * @deprecated use `status === 'stalled'` instead\n */\n function get() {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(false, \"`InstantSearch._isSearchStalled` is deprecated and will be removed in InstantSearch.js 5.0.\\n\\nUse `InstantSearch.status === \\\"stalled\\\"` instead.\") : 0;\n return this.status === 'stalled';\n }\n }, {\n key: \"use\",\n value: function use() {\n var _this2 = this;\n for (var _len = arguments.length, middleware = new Array(_len), _key = 0; _key < _len; _key++) {\n middleware[_key] = arguments[_key];\n }\n var newMiddlewareList = middleware.map(function (fn) {\n var newMiddleware = _objectSpread({\n $$type: '__unknown__',\n $$internal: false,\n subscribe: _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop,\n started: _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop,\n unsubscribe: _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop,\n onStateChange: _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop\n }, fn({\n instantSearchInstance: _this2\n }));\n _this2.middleware.push({\n creator: fn,\n instance: newMiddleware\n });\n return newMiddleware;\n });\n\n // If the instance has already started, we directly subscribe the\n // middleware so they're notified of changes.\n if (this.started) {\n newMiddlewareList.forEach(function (m) {\n m.subscribe();\n m.started();\n });\n }\n return this;\n }\n\n /**\n * Removes a middleware from the InstantSearch lifecycle.\n */\n }, {\n key: \"unuse\",\n value: function unuse() {\n for (var _len2 = arguments.length, middlewareToUnuse = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n middlewareToUnuse[_key2] = arguments[_key2];\n }\n this.middleware.filter(function (m) {\n return middlewareToUnuse.includes(m.creator);\n }).forEach(function (m) {\n return m.instance.unsubscribe();\n });\n this.middleware = this.middleware.filter(function (m) {\n return !middlewareToUnuse.includes(m.creator);\n });\n return this;\n }\n\n // @major we shipped with EXPERIMENTAL_use, but have changed that to just `use` now\n }, {\n key: \"EXPERIMENTAL_use\",\n value: function EXPERIMENTAL_use() {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(false, 'The middleware API is now considered stable, so we recommend replacing `EXPERIMENTAL_use` with `use` before upgrading to the next major version.') : 0;\n return this.use.apply(this, arguments);\n }\n\n /**\n * Adds a widget to the search instance.\n * A widget can be added either before or after InstantSearch has started.\n * @param widget The widget to add to InstantSearch.\n *\n * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`.\n */\n }, {\n key: \"addWidget\",\n value: function addWidget(widget) {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(false, 'addWidget will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`') : 0;\n return this.addWidgets([widget]);\n }\n\n /**\n * Adds multiple widgets to the search instance.\n * Widgets can be added either before or after InstantSearch has started.\n * @param widgets The array of widgets to add to InstantSearch.\n */\n }, {\n key: \"addWidgets\",\n value: function addWidgets(widgets) {\n if (!Array.isArray(widgets)) {\n throw new Error(withUsage('The `addWidgets` method expects an array of widgets. Please use `addWidget`.'));\n }\n if (widgets.some(function (widget) {\n return typeof widget.init !== 'function' && typeof widget.render !== 'function';\n })) {\n throw new Error(withUsage('The widget definition expects a `render` and/or an `init` method.'));\n }\n this.mainIndex.addWidgets(widgets);\n return this;\n }\n\n /**\n * Removes a widget from the search instance.\n * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`\n * @param widget The widget instance to remove from InstantSearch.\n *\n * The widget must implement a `dispose()` method to clear its state.\n */\n }, {\n key: \"removeWidget\",\n value: function removeWidget(widget) {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(false, 'removeWidget will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`') : 0;\n return this.removeWidgets([widget]);\n }\n\n /**\n * Removes multiple widgets from the search instance.\n * @param widgets Array of widgets instances to remove from InstantSearch.\n *\n * The widgets must implement a `dispose()` method to clear their states.\n */\n }, {\n key: \"removeWidgets\",\n value: function removeWidgets(widgets) {\n if (!Array.isArray(widgets)) {\n throw new Error(withUsage('The `removeWidgets` method expects an array of widgets. Please use `removeWidget`.'));\n }\n if (widgets.some(function (widget) {\n return typeof widget.dispose !== 'function';\n })) {\n throw new Error(withUsage('The widget definition expects a `dispose` method.'));\n }\n this.mainIndex.removeWidgets(widgets);\n return this;\n }\n\n /**\n * Ends the initialization of InstantSearch.js and triggers the\n * first search.\n */\n }, {\n key: \"start\",\n value: function start() {\n var _this3 = this;\n if (this.started) {\n throw new Error(withUsage('The `start` method has already been called once.'));\n }\n\n // This Helper is used for the queries, we don't care about its state. The\n // states are managed at the `index` level. We use this Helper to create\n // DerivedHelper scoped into the `index` widgets.\n // In Vue InstantSearch' hydrate, a main helper gets set before start, so\n // we need to respect this helper as a way to keep all listeners correct.\n var mainHelper = this.mainHelper || algoliasearch_helper__WEBPACK_IMPORTED_MODULE_1__(this.client, this.indexName, undefined, {\n persistHierarchicalRootCount: this.future.persistHierarchicalRootCount\n });\n mainHelper.search = function () {\n _this3.status = 'loading';\n _this3.scheduleRender(false);\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(Boolean(_this3.indexName) || _this3.mainIndex.getWidgets().some(_utils_index_js__WEBPACK_IMPORTED_MODULE_12__.isIndexWidget), 'No indexName provided, nor an explicit index widget in the widgets tree. This is required to be able to display results.') : 0;\n\n // This solution allows us to keep the exact same API for the users but\n // under the hood, we have a different implementation. It should be\n // completely transparent for the rest of the codebase. Only this module\n // is impacted.\n if (_this3._hasSearchWidget) {\n mainHelper.searchOnlyWithDerivedHelpers();\n }\n if (_this3._hasRecommendWidget) {\n mainHelper.recommend();\n }\n return mainHelper;\n };\n if (this._searchFunction) {\n // this client isn't used to actually search, but required for the helper\n // to not throw errors\n var fakeClient = {\n search: function search() {\n return new Promise(_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop);\n }\n };\n this._mainHelperSearch = mainHelper.search.bind(mainHelper);\n mainHelper.search = function () {\n var mainIndexHelper = _this3.mainIndex.getHelper();\n var searchFunctionHelper = algoliasearch_helper__WEBPACK_IMPORTED_MODULE_1__(fakeClient, mainIndexHelper.state.index, mainIndexHelper.state);\n searchFunctionHelper.once('search', function (_ref2) {\n var state = _ref2.state;\n mainIndexHelper.overrideStateWithoutTriggeringChangeEvent(state);\n _this3._mainHelperSearch();\n });\n // Forward state changes from `searchFunctionHelper` to `mainIndexHelper`\n searchFunctionHelper.on('change', function (_ref3) {\n var state = _ref3.state;\n mainIndexHelper.setState(state);\n });\n _this3._searchFunction(searchFunctionHelper);\n return mainHelper;\n };\n }\n\n // Only the \"main\" Helper emits the `error` event vs the one for `search`\n // and `results` that are also emitted on the derived one.\n mainHelper.on('error', function (_ref4) {\n var error = _ref4.error;\n if (!(error instanceof Error)) {\n // typescript lies here, error is in some cases { name: string, message: string }\n var err = error;\n error = Object.keys(err).reduce(function (acc, key) {\n acc[key] = err[key];\n return acc;\n }, new Error(err.message));\n }\n // If an error is emitted, it is re-thrown by events. In previous versions\n // we emitted {error}, which is thrown as:\n // \"Uncaught, unspecified \\\"error\\\" event. ([object Object])\"\n // To avoid breaking changes, we make the error available in both\n // `error` and `error.error`\n // @MAJOR emit only error\n error.error = error;\n _this3.error = error;\n _this3.status = 'error';\n _this3.scheduleRender(false);\n\n // This needs to execute last because it throws the error.\n _this3.emit('error', error);\n });\n this.mainHelper = mainHelper;\n this.middleware.forEach(function (_ref5) {\n var instance = _ref5.instance;\n instance.subscribe();\n });\n this.mainIndex.init({\n instantSearchInstance: this,\n parent: null,\n uiState: this._initialUiState\n });\n if (this._initialResults) {\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_13__.hydrateSearchClient)(this.client, this._initialResults);\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_14__.hydrateRecommendCache)(this.mainHelper, this._initialResults);\n var originalScheduleSearch = this.scheduleSearch;\n // We don't schedule a first search when initial results are provided\n // because we already have the results to render. This skips the initial\n // network request on the browser on `start`.\n this.scheduleSearch = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.defer)(_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop);\n // We also skip the initial network request when widgets are dynamically\n // added in the first tick (that's the case in all the framework-based flavors).\n // When we add a widget to `index`, it calls `scheduleSearch`. We can rely\n // on our `defer` util to restore the original `scheduleSearch` value once\n // widgets are added to hook back to the regular lifecycle.\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.defer)(function () {\n _this3.scheduleSearch = originalScheduleSearch;\n })();\n }\n // We only schedule a search when widgets have been added before `start()`\n // because there are listeners that can use these results.\n // This is especially useful in framework-based flavors that wait for\n // dynamically-added widgets to trigger a network request. It avoids\n // having to batch this initial network request with the one coming from\n // `addWidgets()`.\n // Later, we could also skip `index()` widgets and widgets that don't read\n // the results, but this is an optimization that has a very low impact for now.\n else if (this.mainIndex.getWidgets().length > 0) {\n this.scheduleSearch();\n }\n\n // Keep the previous reference for legacy purpose, some pattern use\n // the direct Helper access `search.helper` (e.g multi-index).\n this.helper = this.mainIndex.getHelper();\n\n // track we started the search if we add more widgets,\n // to init them directly after add\n this.started = true;\n this.middleware.forEach(function (_ref6) {\n var instance = _ref6.instance;\n instance.started();\n });\n\n // This is the automatic Insights middleware,\n // added when `insights` is unset and the initial results possess `queryID`.\n // Any user-provided middleware will be added later and override this one.\n if (typeof this._insights === 'undefined') {\n mainHelper.derivedHelpers[0].once('result', function () {\n var hasAutomaticInsights = _this3.mainIndex.getScopedResults().some(function (_ref7) {\n var results = _ref7.results;\n return results === null || results === void 0 ? void 0 : results._automaticInsights;\n });\n if (hasAutomaticInsights) {\n _this3.use((0,_middlewares_createInsightsMiddleware_js__WEBPACK_IMPORTED_MODULE_10__.createInsightsMiddleware)({\n $$internal: true,\n $$automatic: true\n }));\n }\n });\n }\n }\n\n /**\n * Removes all widgets without triggering a search afterwards.\n * @return {undefined} This method does not return anything\n */\n }, {\n key: \"dispose\",\n value: function dispose() {\n var _this$mainHelper2;\n this.scheduleSearch.cancel();\n this.scheduleRender.cancel();\n clearTimeout(this._searchStalledTimer);\n this.removeWidgets(this.mainIndex.getWidgets());\n this.mainIndex.dispose();\n\n // You can not start an instance two times, therefore a disposed instance\n // needs to set started as false otherwise this can not be restarted at a\n // later point.\n this.started = false;\n\n // The helper needs to be reset to perform the next search from a fresh state.\n // If not reset, it would use the state stored before calling `dispose()`.\n this.removeAllListeners();\n (_this$mainHelper2 = this.mainHelper) === null || _this$mainHelper2 === void 0 ? void 0 : _this$mainHelper2.removeAllListeners();\n this.mainHelper = null;\n this.helper = null;\n this.middleware.forEach(function (_ref8) {\n var instance = _ref8.instance;\n instance.unsubscribe();\n });\n }\n }, {\n key: \"scheduleStalledRender\",\n value: function scheduleStalledRender() {\n var _this4 = this;\n if (!this._searchStalledTimer) {\n this._searchStalledTimer = setTimeout(function () {\n _this4.status = 'stalled';\n _this4.scheduleRender();\n }, this._stalledSearchDelay);\n }\n }\n\n /**\n * Set the UI state and trigger a search.\n * @param uiState The next UI state or a function computing it from the current state\n * @param callOnStateChange private parameter used to know if the method is called from a state change\n */\n }, {\n key: \"setUiState\",\n value: function setUiState(uiState) {\n var _this5 = this;\n var callOnStateChange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n if (!this.mainHelper) {\n throw new Error(withUsage('The `start` method needs to be called before `setUiState`.'));\n }\n\n // We refresh the index UI state to update the local UI state that the\n // main index passes to the function form of `setUiState`.\n this.mainIndex.refreshUiState();\n var nextUiState = typeof uiState === 'function' ? uiState(this.mainIndex.getWidgetUiState({})) : uiState;\n if (this.onStateChange && callOnStateChange) {\n this.onStateChange({\n uiState: nextUiState,\n setUiState: function setUiState(finalUiState) {\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_15__.setIndexHelperState)(typeof finalUiState === 'function' ? finalUiState(nextUiState) : finalUiState, _this5.mainIndex);\n _this5.scheduleSearch();\n _this5.onInternalStateChange();\n }\n });\n } else {\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_15__.setIndexHelperState)(nextUiState, this.mainIndex);\n this.scheduleSearch();\n this.onInternalStateChange();\n }\n }\n }, {\n key: \"getUiState\",\n value: function getUiState() {\n if (this.started) {\n // We refresh the index UI state to make sure changes from `refine` are taken in account\n this.mainIndex.refreshUiState();\n }\n return this.mainIndex.getWidgetUiState({});\n }\n }, {\n key: \"createURL\",\n value: function createURL() {\n var nextState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (!this.started) {\n throw new Error(withUsage('The `start` method needs to be called before `createURL`.'));\n }\n return this._createURL(nextState);\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n if (!this.mainHelper) {\n throw new Error(withUsage('The `start` method needs to be called before `refresh`.'));\n }\n this.mainHelper.clearCache().search();\n }\n }]);\n return InstantSearch;\n}(_algolia_events__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InstantSearch);\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/lib/InstantSearch.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ INSTANTSEARCH_FUTURE_DEFAULTS: () => (/* binding */ INSTANTSEARCH_FUTURE_DEFAULTS),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _algolia_events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @algolia/events */ \"./node_modules/@algolia/events/events.js\");\n/* harmony import */ var algoliasearch_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! algoliasearch-helper */ \"./node_modules/algoliasearch-helper/index.js\");\n/* harmony import */ var _middlewares_createInsightsMiddleware_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../middlewares/createInsightsMiddleware.js */ \"./node_modules/instantsearch.js/es/middlewares/createInsightsMiddleware.js\");\n/* harmony import */ var _middlewares_createMetadataMiddleware_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../middlewares/createMetadataMiddleware.js */ \"./node_modules/instantsearch.js/es/middlewares/createMetadataMiddleware.js\");\n/* harmony import */ var _middlewares_createRouterMiddleware_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../middlewares/createRouterMiddleware.js */ \"./node_modules/instantsearch.js/es/middlewares/createRouterMiddleware.js\");\n/* harmony import */ var _widgets_index_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../widgets/index/index.js */ \"./node_modules/instantsearch.js/es/widgets/index/index.js\");\n/* harmony import */ var _createHelpers_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./createHelpers.js */ \"./node_modules/instantsearch.js/es/lib/createHelpers.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/documentation.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/defer.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/noop.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/isIndexWidget.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/hydrateSearchClient.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/hydrateRecommendCache.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/setIndexHelperState.js\");\n/* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./version.js */ \"./node_modules/instantsearch.js/es/lib/version.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\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 } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\n\n\n\n\nvar withUsage = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.createDocumentationMessageGenerator)({\n name: 'instantsearch'\n});\nfunction defaultCreateURL() {\n return '#';\n}\n\n// this purposely breaks typescript's type inference to ensure it's not used\n// as it's used for a default parameter for example\n// source: https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-504042546\n/**\n * Global options for an InstantSearch instance.\n */\nvar INSTANTSEARCH_FUTURE_DEFAULTS = {\n preserveSharedStateOnUnmount: false,\n persistHierarchicalRootCount: false\n};\n\n/**\n * The actual implementation of the InstantSearch. This is\n * created using the `instantsearch` factory function.\n * It emits the 'render' event every time a search is done\n */\nvar InstantSearch = /*#__PURE__*/function (_EventEmitter) {\n _inherits(InstantSearch, _EventEmitter);\n var _super = _createSuper(InstantSearch);\n function InstantSearch(options) {\n var _options$future2;\n var _this;\n _classCallCheck(this, InstantSearch);\n _this = _super.call(this);\n\n // prevent `render` event listening from causing a warning\n _defineProperty(_assertThisInitialized(_this), \"client\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"indexName\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"insightsClient\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"onStateChange\", null);\n _defineProperty(_assertThisInitialized(_this), \"future\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"helper\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"mainHelper\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"mainIndex\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"started\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"templatesConfig\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"renderState\", {});\n _defineProperty(_assertThisInitialized(_this), \"_stalledSearchDelay\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_searchStalledTimer\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_initialUiState\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_initialResults\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_createURL\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_searchFunction\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_mainHelperSearch\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_hasSearchWidget\", false);\n _defineProperty(_assertThisInitialized(_this), \"_hasRecommendWidget\", false);\n _defineProperty(_assertThisInitialized(_this), \"_insights\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"middleware\", []);\n _defineProperty(_assertThisInitialized(_this), \"sendEventToInsights\", void 0);\n /**\n * The status of the search. Can be \"idle\", \"loading\", \"stalled\", or \"error\".\n */\n _defineProperty(_assertThisInitialized(_this), \"status\", 'idle');\n /**\n * The last returned error from the Search API.\n * The error gets cleared when the next valid search response is rendered.\n */\n _defineProperty(_assertThisInitialized(_this), \"error\", undefined);\n _defineProperty(_assertThisInitialized(_this), \"scheduleSearch\", (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.defer)(function () {\n if (_this.started) {\n _this.mainHelper.search();\n }\n }));\n _defineProperty(_assertThisInitialized(_this), \"scheduleRender\", (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.defer)(function () {\n var _this$mainHelper;\n var shouldResetStatus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n if (!((_this$mainHelper = _this.mainHelper) !== null && _this$mainHelper !== void 0 && _this$mainHelper.hasPendingRequests())) {\n clearTimeout(_this._searchStalledTimer);\n _this._searchStalledTimer = null;\n if (shouldResetStatus) {\n _this.status = 'idle';\n _this.error = undefined;\n }\n }\n _this.mainIndex.render({\n instantSearchInstance: _assertThisInitialized(_this)\n });\n _this.emit('render');\n }));\n _defineProperty(_assertThisInitialized(_this), \"onInternalStateChange\", (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.defer)(function () {\n var nextUiState = _this.mainIndex.getWidgetUiState({});\n _this.middleware.forEach(function (_ref) {\n var instance = _ref.instance;\n instance.onStateChange({\n uiState: nextUiState\n });\n });\n }));\n _this.setMaxListeners(100);\n var _options$indexName = options.indexName,\n indexName = _options$indexName === void 0 ? '' : _options$indexName,\n numberLocale = options.numberLocale,\n _options$initialUiSta = options.initialUiState,\n initialUiState = _options$initialUiSta === void 0 ? {} : _options$initialUiSta,\n _options$routing = options.routing,\n routing = _options$routing === void 0 ? null : _options$routing,\n _options$insights = options.insights,\n insights = _options$insights === void 0 ? undefined : _options$insights,\n searchFunction = options.searchFunction,\n _options$stalledSearc = options.stalledSearchDelay,\n stalledSearchDelay = _options$stalledSearc === void 0 ? 200 : _options$stalledSearc,\n _options$searchClient = options.searchClient,\n searchClient = _options$searchClient === void 0 ? null : _options$searchClient,\n _options$insightsClie = options.insightsClient,\n insightsClient = _options$insightsClie === void 0 ? null : _options$insightsClie,\n _options$onStateChang = options.onStateChange,\n onStateChange = _options$onStateChang === void 0 ? null : _options$onStateChang,\n _options$future = options.future,\n future = _options$future === void 0 ? _objectSpread(_objectSpread({}, INSTANTSEARCH_FUTURE_DEFAULTS), options.future || {}) : _options$future;\n if (searchClient === null) {\n throw new Error(withUsage('The `searchClient` option is required.'));\n }\n if (typeof searchClient.search !== 'function') {\n throw new Error(\"The `searchClient` must implement a `search` method.\\n\\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/\");\n }\n if (typeof searchClient.addAlgoliaAgent === 'function') {\n searchClient.addAlgoliaAgent(\"instantsearch.js (\".concat(_version_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"], \")\"));\n }\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(insightsClient === null, \"`insightsClient` property has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\\n\\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/\") : 0;\n if (insightsClient && typeof insightsClient !== 'function') {\n throw new Error(withUsage('The `insightsClient` option should be a function.'));\n }\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(!options.searchParameters, \"The `searchParameters` option is deprecated and will not be supported in InstantSearch.js 4.x.\\n\\nYou can replace it with the `configure` widget:\\n\\n```\\nsearch.addWidgets([\\n configure(\".concat(JSON.stringify(options.searchParameters, null, 2), \")\\n]);\\n```\\n\\nSee \").concat((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.createDocumentationLink)({\n name: 'configure'\n }))) : 0;\n if ( true && ((_options$future2 = options.future) === null || _options$future2 === void 0 ? void 0 : _options$future2.preserveSharedStateOnUnmount) === undefined) {\n // eslint-disable-next-line no-console\n console.info(\"Starting from the next major version, InstantSearch will change how widgets state is preserved when they are removed. InstantSearch will keep the state of unmounted widgets to be usable by other widgets with the same attribute.\\n\\nWe recommend setting `future.preserveSharedStateOnUnmount` to true to adopt this change today.\\nTo stay with the current behaviour and remove this warning, set the option to false.\\n\\nSee documentation: \".concat((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.createDocumentationLink)({\n name: 'instantsearch'\n }), \"#widget-param-future\\n \"));\n }\n _this.client = searchClient;\n _this.future = future;\n _this.insightsClient = insightsClient;\n _this.indexName = indexName;\n _this.helper = null;\n _this.mainHelper = null;\n _this.mainIndex = (0,_widgets_index_index_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])({\n indexName: indexName\n });\n _this.onStateChange = onStateChange;\n _this.started = false;\n _this.templatesConfig = {\n helpers: (0,_createHelpers_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])({\n numberLocale: numberLocale\n }),\n compileOptions: {}\n };\n _this._stalledSearchDelay = stalledSearchDelay;\n _this._searchStalledTimer = null;\n _this._createURL = defaultCreateURL;\n _this._initialUiState = initialUiState;\n _this._initialResults = null;\n _this._insights = insights;\n if (searchFunction) {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(false, \"The `searchFunction` option is deprecated. Use `onStateChange` instead.\") : 0;\n _this._searchFunction = searchFunction;\n }\n _this.sendEventToInsights = _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop;\n if (routing) {\n var routerOptions = typeof routing === 'boolean' ? {} : routing;\n routerOptions.$$internal = true;\n _this.use((0,_middlewares_createRouterMiddleware_js__WEBPACK_IMPORTED_MODULE_9__.createRouterMiddleware)(routerOptions));\n }\n\n // This is the default Insights middleware,\n // added when `insights` is set to true by the user.\n // Any user-provided middleware will be added later and override this one.\n if (insights) {\n var insightsOptions = typeof insights === 'boolean' ? {} : insights;\n insightsOptions.$$internal = true;\n _this.use((0,_middlewares_createInsightsMiddleware_js__WEBPACK_IMPORTED_MODULE_10__.createInsightsMiddleware)(insightsOptions));\n }\n if ((0,_middlewares_createMetadataMiddleware_js__WEBPACK_IMPORTED_MODULE_11__.isMetadataEnabled)()) {\n _this.use((0,_middlewares_createMetadataMiddleware_js__WEBPACK_IMPORTED_MODULE_11__.createMetadataMiddleware)({\n $$internal: true\n }));\n }\n return _this;\n }\n\n /**\n * Hooks a middleware into the InstantSearch lifecycle.\n */\n _createClass(InstantSearch, [{\n key: \"_isSearchStalled\",\n get:\n /**\n * @deprecated use `status === 'stalled'` instead\n */\n function get() {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(false, \"`InstantSearch._isSearchStalled` is deprecated and will be removed in InstantSearch.js 5.0.\\n\\nUse `InstantSearch.status === \\\"stalled\\\"` instead.\") : 0;\n return this.status === 'stalled';\n }\n }, {\n key: \"use\",\n value: function use() {\n var _this2 = this;\n for (var _len = arguments.length, middleware = new Array(_len), _key = 0; _key < _len; _key++) {\n middleware[_key] = arguments[_key];\n }\n var newMiddlewareList = middleware.map(function (fn) {\n var newMiddleware = _objectSpread({\n $$type: '__unknown__',\n $$internal: false,\n subscribe: _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop,\n started: _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop,\n unsubscribe: _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop,\n onStateChange: _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop\n }, fn({\n instantSearchInstance: _this2\n }));\n _this2.middleware.push({\n creator: fn,\n instance: newMiddleware\n });\n return newMiddleware;\n });\n\n // If the instance has already started, we directly subscribe the\n // middleware so they're notified of changes.\n if (this.started) {\n newMiddlewareList.forEach(function (m) {\n m.subscribe();\n m.started();\n });\n }\n return this;\n }\n\n /**\n * Removes a middleware from the InstantSearch lifecycle.\n */\n }, {\n key: \"unuse\",\n value: function unuse() {\n for (var _len2 = arguments.length, middlewareToUnuse = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n middlewareToUnuse[_key2] = arguments[_key2];\n }\n this.middleware.filter(function (m) {\n return middlewareToUnuse.includes(m.creator);\n }).forEach(function (m) {\n return m.instance.unsubscribe();\n });\n this.middleware = this.middleware.filter(function (m) {\n return !middlewareToUnuse.includes(m.creator);\n });\n return this;\n }\n\n // @major we shipped with EXPERIMENTAL_use, but have changed that to just `use` now\n }, {\n key: \"EXPERIMENTAL_use\",\n value: function EXPERIMENTAL_use() {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(false, 'The middleware API is now considered stable, so we recommend replacing `EXPERIMENTAL_use` with `use` before upgrading to the next major version.') : 0;\n return this.use.apply(this, arguments);\n }\n\n /**\n * Adds a widget to the search instance.\n * A widget can be added either before or after InstantSearch has started.\n * @param widget The widget to add to InstantSearch.\n *\n * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`.\n */\n }, {\n key: \"addWidget\",\n value: function addWidget(widget) {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(false, 'addWidget will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`') : 0;\n return this.addWidgets([widget]);\n }\n\n /**\n * Adds multiple widgets to the search instance.\n * Widgets can be added either before or after InstantSearch has started.\n * @param widgets The array of widgets to add to InstantSearch.\n */\n }, {\n key: \"addWidgets\",\n value: function addWidgets(widgets) {\n if (!Array.isArray(widgets)) {\n throw new Error(withUsage('The `addWidgets` method expects an array of widgets. Please use `addWidget`.'));\n }\n if (widgets.some(function (widget) {\n return typeof widget.init !== 'function' && typeof widget.render !== 'function';\n })) {\n throw new Error(withUsage('The widget definition expects a `render` and/or an `init` method.'));\n }\n this.mainIndex.addWidgets(widgets);\n return this;\n }\n\n /**\n * Removes a widget from the search instance.\n * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`\n * @param widget The widget instance to remove from InstantSearch.\n *\n * The widget must implement a `dispose()` method to clear its state.\n */\n }, {\n key: \"removeWidget\",\n value: function removeWidget(widget) {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(false, 'removeWidget will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`') : 0;\n return this.removeWidgets([widget]);\n }\n\n /**\n * Removes multiple widgets from the search instance.\n * @param widgets Array of widgets instances to remove from InstantSearch.\n *\n * The widgets must implement a `dispose()` method to clear their states.\n */\n }, {\n key: \"removeWidgets\",\n value: function removeWidgets(widgets) {\n if (!Array.isArray(widgets)) {\n throw new Error(withUsage('The `removeWidgets` method expects an array of widgets. Please use `removeWidget`.'));\n }\n if (widgets.some(function (widget) {\n return typeof widget.dispose !== 'function';\n })) {\n throw new Error(withUsage('The widget definition expects a `dispose` method.'));\n }\n this.mainIndex.removeWidgets(widgets);\n return this;\n }\n\n /**\n * Ends the initialization of InstantSearch.js and triggers the\n * first search.\n */\n }, {\n key: \"start\",\n value: function start() {\n var _this3 = this;\n if (this.started) {\n throw new Error(withUsage('The `start` method has already been called once.'));\n }\n\n // This Helper is used for the queries, we don't care about its state. The\n // states are managed at the `index` level. We use this Helper to create\n // DerivedHelper scoped into the `index` widgets.\n // In Vue InstantSearch' hydrate, a main helper gets set before start, so\n // we need to respect this helper as a way to keep all listeners correct.\n var mainHelper = this.mainHelper || algoliasearch_helper__WEBPACK_IMPORTED_MODULE_1__(this.client, this.indexName, undefined, {\n persistHierarchicalRootCount: this.future.persistHierarchicalRootCount\n });\n mainHelper.search = function () {\n _this3.status = 'loading';\n _this3.scheduleRender(false);\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_5__.warning)(Boolean(_this3.indexName) || _this3.mainIndex.getWidgets().some(_utils_index_js__WEBPACK_IMPORTED_MODULE_12__.isIndexWidget), 'No indexName provided, nor an explicit index widget in the widgets tree. This is required to be able to display results.') : 0;\n\n // This solution allows us to keep the exact same API for the users but\n // under the hood, we have a different implementation. It should be\n // completely transparent for the rest of the codebase. Only this module\n // is impacted.\n if (_this3._hasSearchWidget) {\n mainHelper.searchOnlyWithDerivedHelpers();\n }\n if (_this3._hasRecommendWidget) {\n mainHelper.recommend();\n }\n return mainHelper;\n };\n if (this._searchFunction) {\n // this client isn't used to actually search, but required for the helper\n // to not throw errors\n var fakeClient = {\n search: function search() {\n return new Promise(_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop);\n }\n };\n this._mainHelperSearch = mainHelper.search.bind(mainHelper);\n mainHelper.search = function () {\n var mainIndexHelper = _this3.mainIndex.getHelper();\n var searchFunctionHelper = algoliasearch_helper__WEBPACK_IMPORTED_MODULE_1__(fakeClient, mainIndexHelper.state.index, mainIndexHelper.state);\n searchFunctionHelper.once('search', function (_ref2) {\n var state = _ref2.state;\n mainIndexHelper.overrideStateWithoutTriggeringChangeEvent(state);\n _this3._mainHelperSearch();\n });\n // Forward state changes from `searchFunctionHelper` to `mainIndexHelper`\n searchFunctionHelper.on('change', function (_ref3) {\n var state = _ref3.state;\n mainIndexHelper.setState(state);\n });\n _this3._searchFunction(searchFunctionHelper);\n return mainHelper;\n };\n }\n\n // Only the \"main\" Helper emits the `error` event vs the one for `search`\n // and `results` that are also emitted on the derived one.\n mainHelper.on('error', function (_ref4) {\n var error = _ref4.error;\n if (!(error instanceof Error)) {\n // typescript lies here, error is in some cases { name: string, message: string }\n var err = error;\n error = Object.keys(err).reduce(function (acc, key) {\n acc[key] = err[key];\n return acc;\n }, new Error(err.message));\n }\n // If an error is emitted, it is re-thrown by events. In previous versions\n // we emitted {error}, which is thrown as:\n // \"Uncaught, unspecified \\\"error\\\" event. ([object Object])\"\n // To avoid breaking changes, we make the error available in both\n // `error` and `error.error`\n // @MAJOR emit only error\n error.error = error;\n _this3.error = error;\n _this3.status = 'error';\n _this3.scheduleRender(false);\n\n // This needs to execute last because it throws the error.\n _this3.emit('error', error);\n });\n this.mainHelper = mainHelper;\n this.middleware.forEach(function (_ref5) {\n var instance = _ref5.instance;\n instance.subscribe();\n });\n this.mainIndex.init({\n instantSearchInstance: this,\n parent: null,\n uiState: this._initialUiState\n });\n if (this._initialResults) {\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_13__.hydrateSearchClient)(this.client, this._initialResults);\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_14__.hydrateRecommendCache)(this.mainHelper, this._initialResults);\n var originalScheduleSearch = this.scheduleSearch;\n // We don't schedule a first search when initial results are provided\n // because we already have the results to render. This skips the initial\n // network request on the browser on `start`.\n this.scheduleSearch = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.defer)(_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.noop);\n // We also skip the initial network request when widgets are dynamically\n // added in the first tick (that's the case in all the framework-based flavors).\n // When we add a widget to `index`, it calls `scheduleSearch`. We can rely\n // on our `defer` util to restore the original `scheduleSearch` value once\n // widgets are added to hook back to the regular lifecycle.\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.defer)(function () {\n _this3.scheduleSearch = originalScheduleSearch;\n })();\n }\n // We only schedule a search when widgets have been added before `start()`\n // because there are listeners that can use these results.\n // This is especially useful in framework-based flavors that wait for\n // dynamically-added widgets to trigger a network request. It avoids\n // having to batch this initial network request with the one coming from\n // `addWidgets()`.\n // Later, we could also skip `index()` widgets and widgets that don't read\n // the results, but this is an optimization that has a very low impact for now.\n else if (this.mainIndex.getWidgets().length > 0) {\n this.scheduleSearch();\n }\n\n // Keep the previous reference for legacy purpose, some pattern use\n // the direct Helper access `search.helper` (e.g multi-index).\n this.helper = this.mainIndex.getHelper();\n\n // track we started the search if we add more widgets,\n // to init them directly after add\n this.started = true;\n this.middleware.forEach(function (_ref6) {\n var instance = _ref6.instance;\n instance.started();\n });\n\n // This is the automatic Insights middleware,\n // added when `insights` is unset and the initial results possess `queryID`.\n // Any user-provided middleware will be added later and override this one.\n if (typeof this._insights === 'undefined') {\n mainHelper.derivedHelpers[0].once('result', function () {\n var hasAutomaticInsights = _this3.mainIndex.getScopedResults().some(function (_ref7) {\n var results = _ref7.results;\n return results === null || results === void 0 ? void 0 : results._automaticInsights;\n });\n if (hasAutomaticInsights) {\n _this3.use((0,_middlewares_createInsightsMiddleware_js__WEBPACK_IMPORTED_MODULE_10__.createInsightsMiddleware)({\n $$internal: true,\n $$automatic: true\n }));\n }\n });\n }\n }\n\n /**\n * Removes all widgets without triggering a search afterwards.\n * @return {undefined} This method does not return anything\n */\n }, {\n key: \"dispose\",\n value: function dispose() {\n var _this$mainHelper2;\n this.scheduleSearch.cancel();\n this.scheduleRender.cancel();\n clearTimeout(this._searchStalledTimer);\n this.removeWidgets(this.mainIndex.getWidgets());\n this.mainIndex.dispose();\n\n // You can not start an instance two times, therefore a disposed instance\n // needs to set started as false otherwise this can not be restarted at a\n // later point.\n this.started = false;\n\n // The helper needs to be reset to perform the next search from a fresh state.\n // If not reset, it would use the state stored before calling `dispose()`.\n this.removeAllListeners();\n (_this$mainHelper2 = this.mainHelper) === null || _this$mainHelper2 === void 0 ? void 0 : _this$mainHelper2.removeAllListeners();\n this.mainHelper = null;\n this.helper = null;\n this.middleware.forEach(function (_ref8) {\n var instance = _ref8.instance;\n instance.unsubscribe();\n });\n }\n }, {\n key: \"scheduleStalledRender\",\n value: function scheduleStalledRender() {\n var _this4 = this;\n if (!this._searchStalledTimer) {\n this._searchStalledTimer = setTimeout(function () {\n _this4.status = 'stalled';\n _this4.scheduleRender();\n }, this._stalledSearchDelay);\n }\n }\n\n /**\n * Set the UI state and trigger a search.\n * @param uiState The next UI state or a function computing it from the current state\n * @param callOnStateChange private parameter used to know if the method is called from a state change\n */\n }, {\n key: \"setUiState\",\n value: function setUiState(uiState) {\n var _this5 = this;\n var callOnStateChange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n if (!this.mainHelper) {\n throw new Error(withUsage('The `start` method needs to be called before `setUiState`.'));\n }\n\n // We refresh the index UI state to update the local UI state that the\n // main index passes to the function form of `setUiState`.\n this.mainIndex.refreshUiState();\n var nextUiState = typeof uiState === 'function' ? uiState(this.mainIndex.getWidgetUiState({})) : uiState;\n if (this.onStateChange && callOnStateChange) {\n this.onStateChange({\n uiState: nextUiState,\n setUiState: function setUiState(finalUiState) {\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_15__.setIndexHelperState)(typeof finalUiState === 'function' ? finalUiState(nextUiState) : finalUiState, _this5.mainIndex);\n _this5.scheduleSearch();\n _this5.onInternalStateChange();\n }\n });\n } else {\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_15__.setIndexHelperState)(nextUiState, this.mainIndex);\n this.scheduleSearch();\n this.onInternalStateChange();\n }\n }\n }, {\n key: \"getUiState\",\n value: function getUiState() {\n if (this.started) {\n // We refresh the index UI state to make sure changes from `refine` are taken in account\n this.mainIndex.refreshUiState();\n }\n return this.mainIndex.getWidgetUiState({});\n }\n }, {\n key: \"createURL\",\n value: function createURL() {\n var nextState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (!this.started) {\n throw new Error(withUsage('The `start` method needs to be called before `createURL`.'));\n }\n return this._createURL(nextState);\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n if (!this.mainHelper) {\n throw new Error(withUsage('The `start` method needs to be called before `refresh`.'));\n }\n this.mainHelper.clearCache().search();\n }\n }]);\n return InstantSearch;\n}(_algolia_events__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InstantSearch);\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/lib/InstantSearch.js?"); /***/ }), @@ -1715,7 +1715,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ createInfiniteHitsSessionStorageCache)\n/* harmony export */ });\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/isEqual.js\");\nvar _excluded = [\"page\"];\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction getStateWithoutPage(state) {\n var _ref = state || {},\n page = _ref.page,\n rest = _objectWithoutProperties(_ref, _excluded);\n return rest;\n}\nvar KEY = 'ais.infiniteHits';\nfunction createInfiniteHitsSessionStorageCache() {\n return {\n read: function read(_ref2) {\n var state = _ref2.state;\n var sessionStorage = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.safelyRunOnBrowser)(function (_ref3) {\n var window = _ref3.window;\n return window.sessionStorage;\n });\n if (!sessionStorage) {\n return null;\n }\n try {\n var cache = JSON.parse(\n // @ts-expect-error JSON.parse() requires a string, but it actually accepts null, too.\n sessionStorage.getItem(KEY));\n return cache && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.isEqual)(cache.state, getStateWithoutPage(state)) ? cache.hits : null;\n } catch (error) {\n if (error instanceof SyntaxError) {\n try {\n sessionStorage.removeItem(KEY);\n } catch (err) {\n // do nothing\n }\n }\n return null;\n }\n },\n write: function write(_ref4) {\n var state = _ref4.state,\n hits = _ref4.hits;\n var sessionStorage = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.safelyRunOnBrowser)(function (_ref5) {\n var window = _ref5.window;\n return window.sessionStorage;\n });\n if (!sessionStorage) {\n return;\n }\n try {\n sessionStorage.setItem(KEY, JSON.stringify({\n state: getStateWithoutPage(state),\n hits: hits\n }));\n } catch (error) {\n // do nothing\n }\n }\n };\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/lib/infiniteHitsCache/sessionStorage.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ createInfiniteHitsSessionStorageCache)\n/* harmony export */ });\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/isEqual.js\");\nvar _excluded = [\"page\"];\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction getStateWithoutPage(state) {\n var _ref = state || {},\n page = _ref.page,\n rest = _objectWithoutProperties(_ref, _excluded);\n return rest;\n}\nfunction createInfiniteHitsSessionStorageCache() {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n key = _ref2.key;\n var KEY = ['ais.infiniteHits', key].filter(Boolean).join(':');\n return {\n read: function read(_ref3) {\n var state = _ref3.state;\n var sessionStorage = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.safelyRunOnBrowser)(function (_ref4) {\n var window = _ref4.window;\n return window.sessionStorage;\n });\n if (!sessionStorage) {\n return null;\n }\n try {\n var cache = JSON.parse(\n // @ts-expect-error JSON.parse() requires a string, but it actually accepts null, too.\n sessionStorage.getItem(KEY));\n return cache && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.isEqual)(cache.state, getStateWithoutPage(state)) ? cache.hits : null;\n } catch (error) {\n if (error instanceof SyntaxError) {\n try {\n sessionStorage.removeItem(KEY);\n } catch (err) {\n // do nothing\n }\n }\n return null;\n }\n },\n write: function write(_ref5) {\n var state = _ref5.state,\n hits = _ref5.hits;\n var sessionStorage = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.safelyRunOnBrowser)(function (_ref6) {\n var window = _ref6.window;\n return window.sessionStorage;\n });\n if (!sessionStorage) {\n return;\n }\n try {\n sessionStorage.setItem(KEY, JSON.stringify({\n state: getStateWithoutPage(state),\n hits: hits\n }));\n } catch (error) {\n // do nothing\n }\n }\n };\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/lib/infiniteHitsCache/sessionStorage.js?"); /***/ }), @@ -1748,7 +1748,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ historyRouter)\n/* harmony export */ });\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! qs */ \"./node_modules/qs/lib/index.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/documentation.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\nvar setWindowTitle = function setWindowTitle(title) {\n if (title) {\n // This function is only executed on browsers so we can disable this check.\n // eslint-disable-next-line no-restricted-globals\n window.document.title = title;\n }\n};\nvar BrowserHistory = /*#__PURE__*/function () {\n /**\n * Initializes a new storage provider that syncs the search state to the URL\n * using web APIs (`window.location.pushState` and `onpopstate` event).\n */\n function BrowserHistory(_ref) {\n var _this = this;\n var windowTitle = _ref.windowTitle,\n _ref$writeDelay = _ref.writeDelay,\n writeDelay = _ref$writeDelay === void 0 ? 400 : _ref$writeDelay,\n createURL = _ref.createURL,\n parseURL = _ref.parseURL,\n getLocation = _ref.getLocation,\n start = _ref.start,\n dispose = _ref.dispose,\n push = _ref.push,\n cleanUrlOnDispose = _ref.cleanUrlOnDispose;\n _classCallCheck(this, BrowserHistory);\n _defineProperty(this, \"$$type\", 'ais.browser');\n /**\n * Transforms a UI state into a title for the page.\n */\n _defineProperty(this, \"windowTitle\", void 0);\n /**\n * Time in milliseconds before performing a write in the history.\n * It prevents from adding too many entries in the history and\n * makes the back button more usable.\n *\n * @default 400\n */\n _defineProperty(this, \"writeDelay\", void 0);\n /**\n * Creates a full URL based on the route state.\n * The storage adaptor maps all syncable keys to the query string of the URL.\n */\n _defineProperty(this, \"_createURL\", void 0);\n /**\n * Parses the URL into a route state.\n * It should be symmetrical to `createURL`.\n */\n _defineProperty(this, \"parseURL\", void 0);\n /**\n * Returns the location to store in the history.\n * @default () => window.location\n */\n _defineProperty(this, \"getLocation\", void 0);\n _defineProperty(this, \"writeTimer\", void 0);\n _defineProperty(this, \"_onPopState\", void 0);\n /**\n * Indicates if last action was back/forward in the browser.\n */\n _defineProperty(this, \"inPopState\", false);\n /**\n * Indicates whether the history router is disposed or not.\n */\n _defineProperty(this, \"isDisposed\", false);\n /**\n * Indicates the window.history.length before the last call to\n * window.history.pushState (called in `write`).\n * It allows to determine if a `pushState` has been triggered elsewhere,\n * and thus to prevent the `write` method from calling `pushState`.\n */\n _defineProperty(this, \"latestAcknowledgedHistory\", 0);\n _defineProperty(this, \"_start\", void 0);\n _defineProperty(this, \"_dispose\", void 0);\n _defineProperty(this, \"_push\", void 0);\n _defineProperty(this, \"_cleanUrlOnDispose\", void 0);\n this.windowTitle = windowTitle;\n this.writeTimer = undefined;\n this.writeDelay = writeDelay;\n this._createURL = createURL;\n this.parseURL = parseURL;\n this.getLocation = getLocation;\n this._start = start;\n this._dispose = dispose;\n this._push = push;\n this._cleanUrlOnDispose = typeof cleanUrlOnDispose === 'undefined' ? true : cleanUrlOnDispose;\n if ( true && typeof cleanUrlOnDispose === 'undefined') {\n // eslint-disable-next-line no-console\n console.info(\"Starting from the next major version, InstantSearch will not clean up the URL from active refinements when it is disposed.\\n\\nWe recommend setting `cleanUrlOnDispose` to false to adopt this change today.\\nTo stay with the current behaviour and remove this warning, set the option to true.\\n\\nSee documentation: \".concat((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.createDocumentationLink)({\n name: 'history-router'\n }), \"#widget-param-cleanurlondispose\"));\n }\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref2) {\n var window = _ref2.window;\n var title = _this.windowTitle && _this.windowTitle(_this.read());\n setWindowTitle(title);\n _this.latestAcknowledgedHistory = window.history.length;\n });\n }\n\n /**\n * Reads the URL and returns a syncable UI search state.\n */\n _createClass(BrowserHistory, [{\n key: \"read\",\n value: function read() {\n return this.parseURL({\n qsModule: qs__WEBPACK_IMPORTED_MODULE_0__,\n location: this.getLocation()\n });\n }\n\n /**\n * Pushes a search state into the URL.\n */\n }, {\n key: \"write\",\n value: function write(routeState) {\n var _this2 = this;\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref3) {\n var window = _ref3.window;\n var url = _this2.createURL(routeState);\n var title = _this2.windowTitle && _this2.windowTitle(routeState);\n if (_this2.writeTimer) {\n clearTimeout(_this2.writeTimer);\n }\n _this2.writeTimer = setTimeout(function () {\n setWindowTitle(title);\n if (_this2.shouldWrite(url)) {\n if (_this2._push) {\n _this2._push(url);\n } else {\n window.history.pushState(routeState, title || '', url);\n }\n _this2.latestAcknowledgedHistory = window.history.length;\n }\n _this2.inPopState = false;\n _this2.writeTimer = undefined;\n }, _this2.writeDelay);\n });\n }\n\n /**\n * Sets a callback on the `onpopstate` event of the history API of the current page.\n * It enables the URL sync to keep track of the changes.\n */\n }, {\n key: \"onUpdate\",\n value: function onUpdate(callback) {\n var _this3 = this;\n if (this._start) {\n this._start(function () {\n callback(_this3.read());\n });\n }\n this._onPopState = function () {\n if (_this3.writeTimer) {\n clearTimeout(_this3.writeTimer);\n _this3.writeTimer = undefined;\n }\n _this3.inPopState = true;\n\n // We always read the state from the URL because the state of the history\n // can be incorect in some cases (e.g. using React Router).\n callback(_this3.read());\n };\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref4) {\n var window = _ref4.window;\n window.addEventListener('popstate', _this3._onPopState);\n });\n }\n\n /**\n * Creates a complete URL from a given syncable UI state.\n *\n * It always generates the full URL, not a relative one.\n * This allows to handle cases like using a .\n * See: https://github.com/algolia/instantsearch/issues/790\n */\n }, {\n key: \"createURL\",\n value: function createURL(routeState) {\n var url = this._createURL({\n qsModule: qs__WEBPACK_IMPORTED_MODULE_0__,\n routeState: routeState,\n location: this.getLocation()\n });\n if (true) {\n try {\n // We just want to check if the URL is valid.\n // eslint-disable-next-line no-new\n new URL(url);\n } catch (e) {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.warning)(false, \"The URL returned by the `createURL` function is invalid.\\nPlease make sure it returns an absolute URL to avoid issues, e.g: `https://algolia.com/search?query=iphone`.\") : 0;\n }\n }\n return url;\n }\n\n /**\n * Removes the event listener and cleans up the URL.\n */\n }, {\n key: \"dispose\",\n value: function dispose() {\n var _this4 = this;\n if (this._dispose) {\n this._dispose();\n }\n this.isDisposed = true;\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref5) {\n var window = _ref5.window;\n if (_this4._onPopState) {\n window.removeEventListener('popstate', _this4._onPopState);\n }\n });\n if (this.writeTimer) {\n clearTimeout(this.writeTimer);\n }\n if (this._cleanUrlOnDispose) {\n this.write({});\n }\n }\n }, {\n key: \"start\",\n value: function start() {\n this.isDisposed = false;\n }\n }, {\n key: \"shouldWrite\",\n value: function shouldWrite(url) {\n var _this5 = this;\n return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref6) {\n var window = _ref6.window;\n // We do want to `pushState` if:\n // - the router is not disposed, IS.js needs to update the URL\n // OR\n // - the last write was from InstantSearch.js\n // (unlike a SPA, where it would have last written)\n var lastPushWasByISAfterDispose = !(_this5.isDisposed && _this5.latestAcknowledgedHistory !== window.history.length);\n return (\n // When the last state change was through popstate, the IS.js state changes,\n // but that should not write the URL.\n !_this5.inPopState &&\n // When the previous pushState after dispose was by IS.js, we want to write the URL.\n lastPushWasByISAfterDispose &&\n // When the URL is the same as the current one, we do not want to write it.\n url !== window.location.href\n );\n });\n }\n }]);\n return BrowserHistory;\n}();\nfunction historyRouter() {\n var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref7$createURL = _ref7.createURL,\n createURL = _ref7$createURL === void 0 ? function (_ref8) {\n var qsModule = _ref8.qsModule,\n routeState = _ref8.routeState,\n location = _ref8.location;\n var protocol = location.protocol,\n hostname = location.hostname,\n _location$port = location.port,\n port = _location$port === void 0 ? '' : _location$port,\n pathname = location.pathname,\n hash = location.hash;\n var queryString = qsModule.stringify(routeState);\n var portWithPrefix = port === '' ? '' : \":\".concat(port);\n\n // IE <= 11 has no proper `location.origin` so we cannot rely on it.\n if (!queryString) {\n return \"\".concat(protocol, \"//\").concat(hostname).concat(portWithPrefix).concat(pathname).concat(hash);\n }\n return \"\".concat(protocol, \"//\").concat(hostname).concat(portWithPrefix).concat(pathname, \"?\").concat(queryString).concat(hash);\n } : _ref7$createURL,\n _ref7$parseURL = _ref7.parseURL,\n parseURL = _ref7$parseURL === void 0 ? function (_ref9) {\n var qsModule = _ref9.qsModule,\n location = _ref9.location;\n // `qs` by default converts arrays with more than 20 items to an object.\n // We want to avoid this because the data structure manipulated can therefore vary.\n // Setting the limit to `100` seems a good number because the engine's default is 100\n // (it can go up to 1000 but it is very unlikely to select more than 100 items in the UI).\n //\n // Using an `arrayLimit` of `n` allows `n + 1` items.\n //\n // See:\n // - https://github.com/ljharb/qs#parsing-arrays\n // - https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/\n return qsModule.parse(location.search.slice(1), {\n arrayLimit: 99\n });\n } : _ref7$parseURL,\n _ref7$writeDelay = _ref7.writeDelay,\n writeDelay = _ref7$writeDelay === void 0 ? 400 : _ref7$writeDelay,\n windowTitle = _ref7.windowTitle,\n _ref7$getLocation = _ref7.getLocation,\n getLocation = _ref7$getLocation === void 0 ? function () {\n return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref10) {\n var window = _ref10.window;\n return window.location;\n }, {\n fallback: function fallback() {\n throw new Error('You need to provide `getLocation` to the `history` router in environments where `window` does not exist.');\n }\n });\n } : _ref7$getLocation,\n start = _ref7.start,\n dispose = _ref7.dispose,\n push = _ref7.push,\n cleanUrlOnDispose = _ref7.cleanUrlOnDispose;\n return new BrowserHistory({\n createURL: createURL,\n parseURL: parseURL,\n writeDelay: writeDelay,\n windowTitle: windowTitle,\n getLocation: getLocation,\n start: start,\n dispose: dispose,\n push: push,\n cleanUrlOnDispose: cleanUrlOnDispose\n });\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/lib/routers/history.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ historyRouter)\n/* harmony export */ });\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! qs */ \"./node_modules/qs/lib/index.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/documentation.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\nvar setWindowTitle = function setWindowTitle(title) {\n if (title) {\n // This function is only executed on browsers so we can disable this check.\n // eslint-disable-next-line no-restricted-globals\n window.document.title = title;\n }\n};\nvar BrowserHistory = /*#__PURE__*/function () {\n /**\n * Initializes a new storage provider that syncs the search state to the URL\n * using web APIs (`window.location.pushState` and `onpopstate` event).\n */\n function BrowserHistory(_ref) {\n var _this = this;\n var windowTitle = _ref.windowTitle,\n _ref$writeDelay = _ref.writeDelay,\n writeDelay = _ref$writeDelay === void 0 ? 400 : _ref$writeDelay,\n createURL = _ref.createURL,\n parseURL = _ref.parseURL,\n getLocation = _ref.getLocation,\n start = _ref.start,\n dispose = _ref.dispose,\n push = _ref.push,\n cleanUrlOnDispose = _ref.cleanUrlOnDispose;\n _classCallCheck(this, BrowserHistory);\n _defineProperty(this, \"$$type\", 'ais.browser');\n /**\n * Transforms a UI state into a title for the page.\n */\n _defineProperty(this, \"windowTitle\", void 0);\n /**\n * Time in milliseconds before performing a write in the history.\n * It prevents from adding too many entries in the history and\n * makes the back button more usable.\n *\n * @default 400\n */\n _defineProperty(this, \"writeDelay\", void 0);\n /**\n * Creates a full URL based on the route state.\n * The storage adaptor maps all syncable keys to the query string of the URL.\n */\n _defineProperty(this, \"_createURL\", void 0);\n /**\n * Parses the URL into a route state.\n * It should be symmetrical to `createURL`.\n */\n _defineProperty(this, \"parseURL\", void 0);\n /**\n * Returns the location to store in the history.\n * @default () => window.location\n */\n _defineProperty(this, \"getLocation\", void 0);\n _defineProperty(this, \"writeTimer\", void 0);\n _defineProperty(this, \"_onPopState\", void 0);\n /**\n * Indicates if last action was back/forward in the browser.\n */\n _defineProperty(this, \"inPopState\", false);\n /**\n * Indicates whether the history router is disposed or not.\n */\n _defineProperty(this, \"isDisposed\", false);\n /**\n * Indicates the window.history.length before the last call to\n * window.history.pushState (called in `write`).\n * It allows to determine if a `pushState` has been triggered elsewhere,\n * and thus to prevent the `write` method from calling `pushState`.\n */\n _defineProperty(this, \"latestAcknowledgedHistory\", 0);\n _defineProperty(this, \"_start\", void 0);\n _defineProperty(this, \"_dispose\", void 0);\n _defineProperty(this, \"_push\", void 0);\n _defineProperty(this, \"_cleanUrlOnDispose\", void 0);\n this.windowTitle = windowTitle;\n this.writeTimer = undefined;\n this.writeDelay = writeDelay;\n this._createURL = createURL;\n this.parseURL = parseURL;\n this.getLocation = getLocation;\n this._start = start;\n this._dispose = dispose;\n this._push = push;\n this._cleanUrlOnDispose = typeof cleanUrlOnDispose === 'undefined' ? true : cleanUrlOnDispose;\n if ( true && typeof cleanUrlOnDispose === 'undefined') {\n // eslint-disable-next-line no-console\n console.info(\"Starting from the next major version, InstantSearch will not clean up the URL from active refinements when it is disposed.\\n\\nWe recommend setting `cleanUrlOnDispose` to false to adopt this change today.\\nTo stay with the current behaviour and remove this warning, set the option to true.\\n\\nSee documentation: \".concat((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.createDocumentationLink)({\n name: 'history-router'\n }), \"#widget-param-cleanurlondispose\"));\n }\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref2) {\n var window = _ref2.window;\n var title = _this.windowTitle && _this.windowTitle(_this.read());\n setWindowTitle(title);\n _this.latestAcknowledgedHistory = window.history.length;\n });\n }\n\n /**\n * Reads the URL and returns a syncable UI search state.\n */\n _createClass(BrowserHistory, [{\n key: \"read\",\n value: function read() {\n return this.parseURL({\n qsModule: qs__WEBPACK_IMPORTED_MODULE_0__,\n location: this.getLocation()\n });\n }\n\n /**\n * Pushes a search state into the URL.\n */\n }, {\n key: \"write\",\n value: function write(routeState) {\n var _this2 = this;\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref3) {\n var window = _ref3.window;\n var url = _this2.createURL(routeState);\n var title = _this2.windowTitle && _this2.windowTitle(routeState);\n if (_this2.writeTimer) {\n clearTimeout(_this2.writeTimer);\n }\n _this2.writeTimer = setTimeout(function () {\n setWindowTitle(title);\n if (_this2.shouldWrite(url)) {\n if (_this2._push) {\n _this2._push(url);\n } else {\n window.history.pushState(routeState, title || '', url);\n }\n _this2.latestAcknowledgedHistory = window.history.length;\n }\n _this2.inPopState = false;\n _this2.writeTimer = undefined;\n }, _this2.writeDelay);\n });\n }\n\n /**\n * Sets a callback on the `onpopstate` event of the history API of the current page.\n * It enables the URL sync to keep track of the changes.\n */\n }, {\n key: \"onUpdate\",\n value: function onUpdate(callback) {\n var _this3 = this;\n if (this._start) {\n this._start(function () {\n callback(_this3.read());\n });\n }\n this._onPopState = function () {\n if (_this3.writeTimer) {\n clearTimeout(_this3.writeTimer);\n _this3.writeTimer = undefined;\n }\n _this3.inPopState = true;\n\n // We always read the state from the URL because the state of the history\n // can be incorect in some cases (e.g. using React Router).\n callback(_this3.read());\n };\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref4) {\n var window = _ref4.window;\n window.addEventListener('popstate', _this3._onPopState);\n });\n }\n\n /**\n * Creates a complete URL from a given syncable UI state.\n *\n * It always generates the full URL, not a relative one.\n * This allows to handle cases like using a .\n * See: https://github.com/algolia/instantsearch/issues/790\n */\n }, {\n key: \"createURL\",\n value: function createURL(routeState) {\n var url = this._createURL({\n qsModule: qs__WEBPACK_IMPORTED_MODULE_0__,\n routeState: routeState,\n location: this.getLocation()\n });\n if (true) {\n try {\n // We just want to check if the URL is valid.\n // eslint-disable-next-line no-new\n new URL(url);\n } catch (e) {\n true ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.warning)(false, \"The URL returned by the `createURL` function is invalid.\\nPlease make sure it returns an absolute URL to avoid issues, e.g: `https://algolia.com/search?query=iphone`.\") : 0;\n }\n }\n return url;\n }\n\n /**\n * Removes the event listener and cleans up the URL.\n */\n }, {\n key: \"dispose\",\n value: function dispose() {\n var _this4 = this;\n if (this._dispose) {\n this._dispose();\n }\n this.isDisposed = true;\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref5) {\n var window = _ref5.window;\n if (_this4._onPopState) {\n window.removeEventListener('popstate', _this4._onPopState);\n }\n });\n if (this.writeTimer) {\n clearTimeout(this.writeTimer);\n }\n if (this._cleanUrlOnDispose) {\n this.write({});\n }\n }\n }, {\n key: \"start\",\n value: function start() {\n this.isDisposed = false;\n }\n }, {\n key: \"shouldWrite\",\n value: function shouldWrite(url) {\n var _this5 = this;\n return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref6) {\n var window = _ref6.window;\n // When disposed and the cleanUrlOnDispose is set to false, we do not want to write the URL.\n if (_this5.isDisposed && !_this5._cleanUrlOnDispose) {\n return false;\n }\n\n // We do want to `pushState` if:\n // - the router is not disposed, IS.js needs to update the URL\n // OR\n // - the last write was from InstantSearch.js\n // (unlike a SPA, where it would have last written)\n var lastPushWasByISAfterDispose = !(_this5.isDisposed && _this5.latestAcknowledgedHistory !== window.history.length);\n return (\n // When the last state change was through popstate, the IS.js state changes,\n // but that should not write the URL.\n !_this5.inPopState &&\n // When the previous pushState after dispose was by IS.js, we want to write the URL.\n lastPushWasByISAfterDispose &&\n // When the URL is the same as the current one, we do not want to write it.\n url !== window.location.href\n );\n });\n }\n }]);\n return BrowserHistory;\n}();\nfunction historyRouter() {\n var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref7$createURL = _ref7.createURL,\n createURL = _ref7$createURL === void 0 ? function (_ref8) {\n var qsModule = _ref8.qsModule,\n routeState = _ref8.routeState,\n location = _ref8.location;\n var protocol = location.protocol,\n hostname = location.hostname,\n _location$port = location.port,\n port = _location$port === void 0 ? '' : _location$port,\n pathname = location.pathname,\n hash = location.hash;\n var queryString = qsModule.stringify(routeState);\n var portWithPrefix = port === '' ? '' : \":\".concat(port);\n\n // IE <= 11 has no proper `location.origin` so we cannot rely on it.\n if (!queryString) {\n return \"\".concat(protocol, \"//\").concat(hostname).concat(portWithPrefix).concat(pathname).concat(hash);\n }\n return \"\".concat(protocol, \"//\").concat(hostname).concat(portWithPrefix).concat(pathname, \"?\").concat(queryString).concat(hash);\n } : _ref7$createURL,\n _ref7$parseURL = _ref7.parseURL,\n parseURL = _ref7$parseURL === void 0 ? function (_ref9) {\n var qsModule = _ref9.qsModule,\n location = _ref9.location;\n // `qs` by default converts arrays with more than 20 items to an object.\n // We want to avoid this because the data structure manipulated can therefore vary.\n // Setting the limit to `100` seems a good number because the engine's default is 100\n // (it can go up to 1000 but it is very unlikely to select more than 100 items in the UI).\n //\n // Using an `arrayLimit` of `n` allows `n + 1` items.\n //\n // See:\n // - https://github.com/ljharb/qs#parsing-arrays\n // - https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/\n return qsModule.parse(location.search.slice(1), {\n arrayLimit: 99\n });\n } : _ref7$parseURL,\n _ref7$writeDelay = _ref7.writeDelay,\n writeDelay = _ref7$writeDelay === void 0 ? 400 : _ref7$writeDelay,\n windowTitle = _ref7.windowTitle,\n _ref7$getLocation = _ref7.getLocation,\n getLocation = _ref7$getLocation === void 0 ? function () {\n return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.safelyRunOnBrowser)(function (_ref10) {\n var window = _ref10.window;\n return window.location;\n }, {\n fallback: function fallback() {\n throw new Error('You need to provide `getLocation` to the `history` router in environments where `window` does not exist.');\n }\n });\n } : _ref7$getLocation,\n start = _ref7.start,\n dispose = _ref7.dispose,\n push = _ref7.push,\n cleanUrlOnDispose = _ref7.cleanUrlOnDispose;\n return new BrowserHistory({\n createURL: createURL,\n parseURL: parseURL,\n writeDelay: writeDelay,\n windowTitle: windowTitle,\n getLocation: getLocation,\n start: start,\n dispose: dispose,\n push: push,\n cleanUrlOnDispose: cleanUrlOnDispose\n });\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/lib/routers/history.js?"); /***/ }), @@ -2078,7 +2078,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hydrateSearchClient: () => (/* binding */ hydrateSearchClient)\n/* harmony export */ });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction hydrateSearchClient(client, results) {\n if (!results) {\n return;\n }\n\n // Disable cache hydration on:\n // - Algoliasearch API Client < v4 with cache disabled\n // - Third party clients (detected by the `addAlgoliaAgent` function missing)\n\n if ((!('transporter' in client) || client._cacheHydrated) && (!client._useCache || typeof client.addAlgoliaAgent !== 'function')) {\n return;\n }\n var cachedRequest = Object.keys(results).map(function (key) {\n var _results$key = results[key],\n state = _results$key.state,\n requestParams = _results$key.requestParams,\n serverResults = _results$key.results;\n return serverResults && state ? serverResults.map(function (result) {\n return _objectSpread({\n indexName: state.index || result.index\n }, requestParams || result.params ? {\n params: serializeQueryParameters(requestParams || deserializeQueryParameters(result.params))\n } : {});\n }) : [];\n });\n var cachedResults = Object.keys(results).reduce(function (acc, key) {\n var res = results[key].results;\n if (!res) {\n return acc;\n }\n return acc.concat(res);\n }, []);\n\n // Algoliasearch API Client >= v4\n // To hydrate the client we need to populate the cache with the data from\n // the server (done in `hydrateSearchClientWithMultiIndexRequest` or\n // `hydrateSearchClientWithSingleIndexRequest`). But since there is no way\n // for us to compute the key the same way as `algoliasearch-client` we need\n // to populate it on a custom key and override the `search` method to\n // search on it first.\n if ('transporter' in client && !client._cacheHydrated) {\n client._cacheHydrated = true;\n var baseMethod = client.search;\n // @ts-ignore wanting type checks for v3 on this would make this too complex\n client.search = function (requests) {\n for (var _len = arguments.length, methodArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n methodArgs[_key - 1] = arguments[_key];\n }\n var requestsWithSerializedParams = requests.map(function (request) {\n return _objectSpread(_objectSpread({}, request), {}, {\n params: serializeQueryParameters(request.params)\n });\n });\n return client.transporter.responsesCache.get({\n method: 'search',\n args: [requestsWithSerializedParams].concat(methodArgs)\n }, function () {\n return baseMethod.apply(void 0, [requests].concat(methodArgs));\n });\n };\n client.transporter.responsesCache.set({\n method: 'search',\n args: cachedRequest\n }, {\n results: cachedResults\n });\n }\n\n // Algoliasearch API Client < v4\n // Prior to client v4 we didn't have a proper API to hydrate the client\n // cache from the outside. The following code populates the cache with\n // a single-index result. You can find more information about the\n // computation of the key inside the client (see link below).\n // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240\n if (!('transporter' in client)) {\n var cacheKey = \"/1/indexes/*/queries_body_\".concat(JSON.stringify({\n requests: cachedRequest\n }));\n client.cache = _objectSpread(_objectSpread({}, client.cache), {}, _defineProperty({}, cacheKey, JSON.stringify({\n results: Object.keys(results).map(function (key) {\n return results[key].results;\n })\n })));\n }\n}\nfunction deserializeQueryParameters(parameters) {\n return parameters.split('&').reduce(function (acc, parameter) {\n var _parameter$split = parameter.split('='),\n _parameter$split2 = _slicedToArray(_parameter$split, 2),\n key = _parameter$split2[0],\n value = _parameter$split2[1];\n acc[key] = value ? decodeURIComponent(value) : '';\n return acc;\n }, {});\n}\n\n// This function is copied from the algoliasearch v4 API Client. If modified,\n// consider updating it also in `serializeQueryParameters` from `@algolia/transporter`.\nfunction serializeQueryParameters(parameters) {\n var isObjectOrArray = function isObjectOrArray(value) {\n return Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';\n };\n var encode = function encode(format) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n var i = 0;\n return format.replace(/%s/g, function () {\n return encodeURIComponent(args[i++]);\n });\n };\n return Object.keys(parameters).map(function (key) {\n return encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]);\n }).join('&');\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/lib/utils/hydrateSearchClient.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hydrateSearchClient: () => (/* binding */ hydrateSearchClient)\n/* harmony export */ });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction hydrateSearchClient(client, results) {\n if (!results) {\n return;\n }\n\n // Disable cache hydration on:\n // - Algoliasearch API Client < v4 with cache disabled\n // - Third party clients (detected by the `addAlgoliaAgent` function missing)\n\n if ((!('transporter' in client) || client._cacheHydrated) && (!client._useCache || typeof client.addAlgoliaAgent !== 'function')) {\n return;\n }\n var cachedRequest = [Object.keys(results).reduce(function (acc, key) {\n var _results$key = results[key],\n state = _results$key.state,\n requestParams = _results$key.requestParams,\n serverResults = _results$key.results;\n var mappedResults = serverResults && state ? serverResults.map(function (result, idx) {\n return _objectSpread({\n indexName: state.index || result.index\n }, requestParams !== null && requestParams !== void 0 && requestParams[idx] || result.params ? {\n params: serializeQueryParameters((requestParams === null || requestParams === void 0 ? void 0 : requestParams[idx]) || deserializeQueryParameters(result.params))\n } : {});\n }) : [];\n return acc.concat(mappedResults);\n }, [])];\n var cachedResults = Object.keys(results).reduce(function (acc, key) {\n var res = results[key].results;\n if (!res) {\n return acc;\n }\n return acc.concat(res);\n }, []);\n\n // Algoliasearch API Client >= v4\n // To hydrate the client we need to populate the cache with the data from\n // the server (done in `hydrateSearchClientWithMultiIndexRequest` or\n // `hydrateSearchClientWithSingleIndexRequest`). But since there is no way\n // for us to compute the key the same way as `algoliasearch-client` we need\n // to populate it on a custom key and override the `search` method to\n // search on it first.\n if ('transporter' in client && !client._cacheHydrated) {\n client._cacheHydrated = true;\n var baseMethod = client.search.bind(client);\n // @ts-ignore wanting type checks for v3 on this would make this too complex\n client.search = function (requests) {\n for (var _len = arguments.length, methodArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n methodArgs[_key - 1] = arguments[_key];\n }\n var requestsWithSerializedParams = requests.map(function (request) {\n return _objectSpread(_objectSpread({}, request), {}, {\n params: serializeQueryParameters(request.params)\n });\n });\n return client.transporter.responsesCache.get({\n method: 'search',\n args: [requestsWithSerializedParams].concat(methodArgs)\n }, function () {\n return baseMethod.apply(void 0, [requests].concat(methodArgs));\n });\n };\n client.transporter.responsesCache.set({\n method: 'search',\n args: cachedRequest\n }, {\n results: cachedResults\n });\n }\n\n // Algoliasearch API Client < v4\n // Prior to client v4 we didn't have a proper API to hydrate the client\n // cache from the outside. The following code populates the cache with\n // a single-index result. You can find more information about the\n // computation of the key inside the client (see link below).\n // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240\n if (!('transporter' in client)) {\n var cacheKey = \"/1/indexes/*/queries_body_\".concat(JSON.stringify({\n requests: cachedRequest\n }));\n client.cache = _objectSpread(_objectSpread({}, client.cache), {}, _defineProperty({}, cacheKey, JSON.stringify({\n results: Object.keys(results).map(function (key) {\n return results[key].results;\n })\n })));\n }\n}\nfunction deserializeQueryParameters(parameters) {\n return parameters.split('&').reduce(function (acc, parameter) {\n var _parameter$split = parameter.split('='),\n _parameter$split2 = _slicedToArray(_parameter$split, 2),\n key = _parameter$split2[0],\n value = _parameter$split2[1];\n acc[key] = value ? decodeURIComponent(value) : '';\n return acc;\n }, {});\n}\n\n// This function is copied from the algoliasearch v4 API Client. If modified,\n// consider updating it also in `serializeQueryParameters` from `@algolia/transporter`.\nfunction serializeQueryParameters(parameters) {\n var isObjectOrArray = function isObjectOrArray(value) {\n return Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';\n };\n var encode = function encode(format) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n var i = 0;\n return format.replace(/%s/g, function () {\n return encodeURIComponent(args[i++]);\n });\n };\n return Object.keys(parameters).map(function (key) {\n return encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]);\n }).join('&');\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/lib/utils/hydrateSearchClient.js?"); /***/ }), @@ -2302,6 +2302,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ }), +/***/ "./node_modules/instantsearch.js/es/lib/utils/uuid.js": +/*!************************************************************!*\ + !*** ./node_modules/instantsearch.js/es/lib/utils/uuid.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createUUID: () => (/* binding */ createUUID)\n/* harmony export */ });\n/**\n * Create UUID according to\n * https://www.ietf.org/rfc/rfc4122.txt.\n *\n * @returns Generated UUID.\n */\nfunction createUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n /* eslint-disable no-bitwise */\n var r = Math.random() * 16 | 0;\n var v = c === 'x' ? r : r & 0x3 | 0x8;\n /* eslint-enable */\n return v.toString(16);\n });\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/lib/utils/uuid.js?"); + +/***/ }), + /***/ "./node_modules/instantsearch.js/es/lib/version.js": /*!*********************************************************!*\ !*** ./node_modules/instantsearch.js/es/lib/version.js ***! @@ -2309,7 +2320,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ('4.73.1');\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/lib/version.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ('4.75.3');\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/lib/version.js?"); /***/ }), @@ -2320,7 +2331,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createInsightsMiddleware: () => (/* binding */ createInsightsMiddleware)\n/* harmony export */ });\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/get-insights-anonymous-user-token.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/noop.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getAppIdAndApiKey.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/find.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\n\nvar ALGOLIA_INSIGHTS_VERSION = '2.15.0';\nvar ALGOLIA_INSIGHTS_SRC = \"https://cdn.jsdelivr.net/npm/search-insights@\".concat(ALGOLIA_INSIGHTS_VERSION, \"/dist/search-insights.min.js\");\nfunction createInsightsMiddleware() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _insightsClient = props.insightsClient,\n insightsInitParams = props.insightsInitParams,\n onEvent = props.onEvent,\n _props$$$internal = props.$$internal,\n $$internal = _props$$$internal === void 0 ? false : _props$$$internal,\n _props$$$automatic = props.$$automatic,\n $$automatic = _props$$$automatic === void 0 ? false : _props$$$automatic;\n var potentialInsightsClient = _insightsClient;\n if (!_insightsClient && _insightsClient !== null) {\n (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.safelyRunOnBrowser)(function (_ref) {\n var window = _ref.window;\n var pointer = window.AlgoliaAnalyticsObject || 'aa';\n if (typeof pointer === 'string') {\n potentialInsightsClient = window[pointer];\n }\n if (!potentialInsightsClient) {\n window.AlgoliaAnalyticsObject = pointer;\n if (!window[pointer]) {\n window[pointer] = function () {\n if (!window[pointer].queue) {\n window[pointer].queue = [];\n }\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n window[pointer].queue.push(args);\n };\n window[pointer].version = ALGOLIA_INSIGHTS_VERSION;\n window[pointer].shouldAddScript = true;\n }\n potentialInsightsClient = window[pointer];\n }\n });\n }\n // if still no insightsClient was found, we use a noop\n var insightsClient = potentialInsightsClient || _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.noop;\n return function (_ref2) {\n var instantSearchInstance = _ref2.instantSearchInstance;\n // remove existing default insights middleware\n // user-provided insights middleware takes precedence\n var existingInsightsMiddlewares = instantSearchInstance.middleware.filter(function (m) {\n return m.instance.$$type === 'ais.insights' && m.instance.$$internal;\n }).map(function (m) {\n return m.creator;\n });\n instantSearchInstance.unuse.apply(instantSearchInstance, _toConsumableArray(existingInsightsMiddlewares));\n var _getAppIdAndApiKey = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.getAppIdAndApiKey)(instantSearchInstance.client),\n _getAppIdAndApiKey2 = _slicedToArray(_getAppIdAndApiKey, 2),\n appId = _getAppIdAndApiKey2[0],\n apiKey = _getAppIdAndApiKey2[1];\n\n // search-insights.js also throws an error so dev-only clarification is sufficient\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.warning)(Boolean(appId && apiKey), 'could not extract Algolia credentials from searchClient in insights middleware.') : 0;\n var queuedUserToken = undefined;\n var queuedAuthenticatedUserToken = undefined;\n var userTokenBeforeInit = undefined;\n var authenticatedUserTokenBeforeInit = undefined;\n var queue = insightsClient.queue;\n if (Array.isArray(queue)) {\n // Context: The umd build of search-insights is asynchronously loaded by the snippet.\n //\n // When user calls `aa('setUserToken', 'my-user-token')` before `search-insights` is loaded,\n // ['setUserToken', 'my-user-token'] gets stored in `aa.queue`.\n // Whenever `search-insights` is finally loaded, it will process the queue.\n //\n // But here's the reason why we handle it here:\n // At this point, even though `search-insights` is not loaded yet,\n // we still want to read the token from the queue.\n // Otherwise, the first search call will be fired without the token.\n var _map = ['setUserToken', 'setAuthenticatedUserToken'].map(function (key) {\n var _ref3 = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__.find)(queue.slice().reverse(), function (_ref5) {\n var _ref6 = _slicedToArray(_ref5, 1),\n method = _ref6[0];\n return method === key;\n }) || [],\n _ref4 = _slicedToArray(_ref3, 2),\n value = _ref4[1];\n return value;\n });\n var _map2 = _slicedToArray(_map, 2);\n queuedUserToken = _map2[0];\n queuedAuthenticatedUserToken = _map2[1];\n }\n\n // If user called `aa('setUserToken')` or `aa('setAuthenticatedUserToken')`\n // before creating the Insights middleware, we temporarily store the token\n // and set it later on.\n //\n // Otherwise, the `init` call might override them with anonymous user token.\n insightsClient('getUserToken', null, function (_error, userToken) {\n userTokenBeforeInit = normalizeUserToken(userToken);\n });\n insightsClient('getAuthenticatedUserToken', null, function (_error, userToken) {\n authenticatedUserTokenBeforeInit = normalizeUserToken(userToken);\n });\n\n // Only `init` if the `insightsInitParams` option is passed or\n // if the `insightsClient` version doesn't supports optional `init` calling.\n if (insightsInitParams || !isModernInsightsClient(insightsClient)) {\n insightsClient('init', _objectSpread({\n appId: appId,\n apiKey: apiKey,\n partial: true\n }, insightsInitParams));\n }\n var initialParameters;\n var helper;\n return {\n $$type: 'ais.insights',\n $$internal: $$internal,\n $$automatic: $$automatic,\n onStateChange: function onStateChange() {},\n subscribe: function subscribe() {\n if (!insightsClient.shouldAddScript) return;\n var errorMessage = '[insights middleware]: could not load search-insights.js. Please load it manually following https://alg.li/insights-init';\n try {\n var script = document.createElement('script');\n script.async = true;\n script.src = ALGOLIA_INSIGHTS_SRC;\n script.onerror = function () {\n instantSearchInstance.emit('error', new Error(errorMessage));\n };\n document.body.appendChild(script);\n insightsClient.shouldAddScript = false;\n } catch (cause) {\n insightsClient.shouldAddScript = false;\n instantSearchInstance.emit('error', new Error(errorMessage));\n }\n },\n started: function started() {\n insightsClient('addAlgoliaAgent', 'insights-middleware');\n helper = instantSearchInstance.mainHelper;\n initialParameters = {\n userToken: helper.state.userToken,\n clickAnalytics: helper.state.clickAnalytics\n };\n\n // We don't want to force clickAnalytics when the insights is enabled from the search response.\n // This means we don't enable insights for indices that don't opt in\n if (!$$automatic) {\n helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {\n clickAnalytics: true\n }));\n }\n if (!$$internal) {\n instantSearchInstance.scheduleSearch();\n }\n var setUserTokenToSearch = function setUserTokenToSearch(userToken) {\n var immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var normalizedUserToken = normalizeUserToken(userToken);\n if (!normalizedUserToken) {\n return;\n }\n var existingToken = helper.state.userToken;\n function applyToken() {\n helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {\n userToken: normalizedUserToken\n }));\n if (existingToken && existingToken !== userToken) {\n instantSearchInstance.scheduleSearch();\n }\n }\n\n // Delay the token application to the next render cycle\n if (!immediate) {\n setTimeout(applyToken, 0);\n } else {\n applyToken();\n }\n };\n var anonymousUserToken = (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.getInsightsAnonymousUserTokenInternal)();\n if (anonymousUserToken) {\n // When `aa('init', { ... })` is called, it creates an anonymous user token in cookie.\n // We can set it as userToken.\n setUserTokenToSearch(anonymousUserToken, true);\n }\n function setUserToken(token, userToken, authenticatedUserToken) {\n setUserTokenToSearch(token, true);\n if (userToken) {\n insightsClient('setUserToken', userToken);\n }\n if (authenticatedUserToken) {\n insightsClient('setAuthenticatedUserToken', authenticatedUserToken);\n }\n }\n\n // We consider the `userToken` or `authenticatedUserToken` before an\n // `init` call of higher importance than one from the queue.\n var tokenBeforeInit = authenticatedUserTokenBeforeInit || userTokenBeforeInit;\n var queuedToken = queuedAuthenticatedUserToken || queuedUserToken;\n if (tokenBeforeInit) {\n setUserToken(tokenBeforeInit, userTokenBeforeInit, authenticatedUserTokenBeforeInit);\n } else if (queuedToken) {\n setUserToken(queuedToken, queuedUserToken, queuedAuthenticatedUserToken);\n }\n\n // This updates userToken which is set explicitly by `aa('setUserToken', userToken)`\n insightsClient('onUserTokenChange', setUserTokenToSearch, {\n immediate: true\n });\n\n // This updates userToken which is set explicitly by `aa('setAuthenticatedtUserToken', authenticatedUserToken)`\n insightsClient('onAuthenticatedUserTokenChange', function (authenticatedUserToken) {\n // If we're unsetting the `authenticatedUserToken`, we revert to the `userToken`\n if (!authenticatedUserToken) {\n insightsClient('getUserToken', null, function (_, userToken) {\n setUserTokenToSearch(userToken);\n });\n }\n setUserTokenToSearch(authenticatedUserToken);\n }, {\n immediate: true\n });\n var insightsClientWithLocalCredentials = insightsClient;\n if (isModernInsightsClient(insightsClient)) {\n insightsClientWithLocalCredentials = function insightsClientWithLocalCredentials(method, payload) {\n var extraParams = {\n headers: {\n 'X-Algolia-Application-Id': appId,\n 'X-Algolia-API-Key': apiKey\n }\n };\n\n // @ts-ignore we are calling this only when we know that the client actually is correct\n return insightsClient(method, payload, extraParams);\n };\n }\n instantSearchInstance.sendEventToInsights = function (event) {\n if (onEvent) {\n onEvent(event, insightsClientWithLocalCredentials);\n } else if (event.insightsMethod) {\n // Source is used to differentiate events sent by instantsearch from those sent manually.\n event.payload.algoliaSource = ['instantsearch'];\n if ($$automatic) {\n event.payload.algoliaSource.push('instantsearch-automatic');\n }\n if (event.eventModifier === 'internal') {\n event.payload.algoliaSource.push('instantsearch-internal');\n }\n insightsClientWithLocalCredentials(event.insightsMethod, event.payload);\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.warning)(Boolean(helper.state.userToken), \"\\nCannot send event to Algolia Insights because `userToken` is not set.\\n\\nSee documentation: https://www.algolia.com/doc/guides/building-search-ui/going-further/send-insights-events/js/#setting-the-usertoken\\n\") : 0;\n } else {\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.warning)(false, 'Cannot send event to Algolia Insights because `insightsMethod` option is missing.') : 0;\n }\n };\n },\n unsubscribe: function unsubscribe() {\n insightsClient('onUserTokenChange', undefined);\n insightsClient('onAuthenticatedUserTokenChange', undefined);\n instantSearchInstance.sendEventToInsights = _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.noop;\n if (helper && initialParameters) {\n helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), initialParameters));\n instantSearchInstance.scheduleSearch();\n }\n }\n };\n };\n}\n\n/**\n * Determines if a given insights `client` supports the optional call to `init`\n * and the ability to set credentials via extra parameters when sending events.\n */\nfunction isModernInsightsClient(client) {\n var _split$map = (client.version || '').split('.').map(Number),\n _split$map2 = _slicedToArray(_split$map, 2),\n major = _split$map2[0],\n minor = _split$map2[1];\n\n /* eslint-disable @typescript-eslint/naming-convention */\n var v3 = major >= 3;\n var v2_6 = major === 2 && minor >= 6;\n var v1_10 = major === 1 && minor >= 10;\n /* eslint-enable @typescript-eslint/naming-convention */\n\n return v3 || v2_6 || v1_10;\n}\n\n/**\n * While `search-insights` supports both string and number user tokens,\n * the Search API only accepts strings. This function normalizes the user token.\n */\nfunction normalizeUserToken(userToken) {\n if (!userToken) {\n return undefined;\n }\n return typeof userToken === 'number' ? userToken.toString() : userToken;\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/middlewares/createInsightsMiddleware.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createInsightsMiddleware: () => (/* binding */ createInsightsMiddleware)\n/* harmony export */ });\n/* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/index.js */ \"./node_modules/instantsearch.js/es/helpers/get-insights-anonymous-user-token.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/noop.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/getAppIdAndApiKey.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/logger.js\");\n/* harmony import */ var _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/utils/index.js */ \"./node_modules/instantsearch.js/es/lib/utils/find.js\");\n/* harmony import */ var _lib_utils_uuid_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/utils/uuid.js */ \"./node_modules/instantsearch.js/es/lib/utils/uuid.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\n\n\nvar ALGOLIA_INSIGHTS_VERSION = '2.15.0';\nvar ALGOLIA_INSIGHTS_SRC = \"https://cdn.jsdelivr.net/npm/search-insights@\".concat(ALGOLIA_INSIGHTS_VERSION, \"/dist/search-insights.min.js\");\nfunction createInsightsMiddleware() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _insightsClient = props.insightsClient,\n insightsInitParams = props.insightsInitParams,\n onEvent = props.onEvent,\n _props$$$internal = props.$$internal,\n $$internal = _props$$$internal === void 0 ? false : _props$$$internal,\n _props$$$automatic = props.$$automatic,\n $$automatic = _props$$$automatic === void 0 ? false : _props$$$automatic;\n var currentTokenType;\n var potentialInsightsClient = _insightsClient;\n if (!_insightsClient && _insightsClient !== null) {\n (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.safelyRunOnBrowser)(function (_ref) {\n var window = _ref.window;\n var pointer = window.AlgoliaAnalyticsObject || 'aa';\n if (typeof pointer === 'string') {\n potentialInsightsClient = window[pointer];\n }\n if (!potentialInsightsClient) {\n window.AlgoliaAnalyticsObject = pointer;\n if (!window[pointer]) {\n window[pointer] = function () {\n if (!window[pointer].queue) {\n window[pointer].queue = [];\n }\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n window[pointer].queue.push(args);\n };\n window[pointer].version = ALGOLIA_INSIGHTS_VERSION;\n window[pointer].shouldAddScript = true;\n }\n potentialInsightsClient = window[pointer];\n }\n });\n }\n // if still no insightsClient was found, we use a noop\n var insightsClient = potentialInsightsClient || _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.noop;\n return function (_ref2) {\n var instantSearchInstance = _ref2.instantSearchInstance;\n // remove existing default insights middleware\n // user-provided insights middleware takes precedence\n var existingInsightsMiddlewares = instantSearchInstance.middleware.filter(function (m) {\n return m.instance.$$type === 'ais.insights' && m.instance.$$internal;\n }).map(function (m) {\n return m.creator;\n });\n instantSearchInstance.unuse.apply(instantSearchInstance, _toConsumableArray(existingInsightsMiddlewares));\n var _getAppIdAndApiKey = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.getAppIdAndApiKey)(instantSearchInstance.client),\n _getAppIdAndApiKey2 = _slicedToArray(_getAppIdAndApiKey, 2),\n appId = _getAppIdAndApiKey2[0],\n apiKey = _getAppIdAndApiKey2[1];\n\n // search-insights.js also throws an error so dev-only clarification is sufficient\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.warning)(Boolean(appId && apiKey), 'could not extract Algolia credentials from searchClient in insights middleware.') : 0;\n var queuedInitParams = undefined;\n var queuedUserToken = undefined;\n var queuedAuthenticatedUserToken = undefined;\n var userTokenBeforeInit = undefined;\n var authenticatedUserTokenBeforeInit = undefined;\n var queue = insightsClient.queue;\n if (Array.isArray(queue)) {\n // Context: The umd build of search-insights is asynchronously loaded by the snippet.\n //\n // When user calls `aa('setUserToken', 'my-user-token')` before `search-insights` is loaded,\n // ['setUserToken', 'my-user-token'] gets stored in `aa.queue`.\n // Whenever `search-insights` is finally loaded, it will process the queue.\n //\n // But here's the reason why we handle it here:\n // At this point, even though `search-insights` is not loaded yet,\n // we still want to read the token from the queue.\n // Otherwise, the first search call will be fired without the token.\n var _map = ['setUserToken', 'setAuthenticatedUserToken', 'init'].map(function (key) {\n var _ref3 = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__.find)(queue.slice().reverse(), function (_ref5) {\n var _ref6 = _slicedToArray(_ref5, 1),\n method = _ref6[0];\n return method === key;\n }) || [],\n _ref4 = _slicedToArray(_ref3, 2),\n value = _ref4[1];\n return value;\n });\n var _map2 = _slicedToArray(_map, 3);\n queuedUserToken = _map2[0];\n queuedAuthenticatedUserToken = _map2[1];\n queuedInitParams = _map2[2];\n }\n\n // If user called `aa('setUserToken')` or `aa('setAuthenticatedUserToken')`\n // before creating the Insights middleware, we temporarily store the token\n // and set it later on.\n //\n // Otherwise, the `init` call might override them with anonymous user token.\n insightsClient('getUserToken', null, function (_error, userToken) {\n userTokenBeforeInit = normalizeUserToken(userToken);\n });\n insightsClient('getAuthenticatedUserToken', null, function (_error, userToken) {\n authenticatedUserTokenBeforeInit = normalizeUserToken(userToken);\n });\n\n // Only `init` if the `insightsInitParams` option is passed or\n // if the `insightsClient` version doesn't supports optional `init` calling.\n if (insightsInitParams || !isModernInsightsClient(insightsClient)) {\n insightsClient('init', _objectSpread({\n appId: appId,\n apiKey: apiKey,\n partial: true\n }, insightsInitParams));\n }\n var initialParameters;\n var helper;\n return {\n $$type: 'ais.insights',\n $$internal: $$internal,\n $$automatic: $$automatic,\n onStateChange: function onStateChange() {},\n subscribe: function subscribe() {\n if (!insightsClient.shouldAddScript) return;\n var errorMessage = '[insights middleware]: could not load search-insights.js. Please load it manually following https://alg.li/insights-init';\n try {\n var script = document.createElement('script');\n script.async = true;\n script.src = ALGOLIA_INSIGHTS_SRC;\n script.onerror = function () {\n instantSearchInstance.emit('error', new Error(errorMessage));\n };\n document.body.appendChild(script);\n insightsClient.shouldAddScript = false;\n } catch (cause) {\n insightsClient.shouldAddScript = false;\n instantSearchInstance.emit('error', new Error(errorMessage));\n }\n },\n started: function started() {\n insightsClient('addAlgoliaAgent', 'insights-middleware');\n helper = instantSearchInstance.mainHelper;\n var queueAtStart = insightsClient.queue;\n if (Array.isArray(queueAtStart)) {\n var _map3 = ['setUserToken', 'setAuthenticatedUserToken', 'init'].map(function (key) {\n var _ref7 = (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_4__.find)(queueAtStart.slice().reverse(), function (_ref9) {\n var _ref10 = _slicedToArray(_ref9, 1),\n method = _ref10[0];\n return method === key;\n }) || [],\n _ref8 = _slicedToArray(_ref7, 2),\n value = _ref8[1];\n return value;\n });\n var _map4 = _slicedToArray(_map3, 3);\n queuedUserToken = _map4[0];\n queuedAuthenticatedUserToken = _map4[1];\n queuedInitParams = _map4[2];\n }\n initialParameters = {\n userToken: helper.state.userToken,\n clickAnalytics: helper.state.clickAnalytics\n };\n\n // We don't want to force clickAnalytics when the insights is enabled from the search response.\n // This means we don't enable insights for indices that don't opt in\n if (!$$automatic) {\n helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {\n clickAnalytics: true\n }));\n }\n if (!$$internal) {\n instantSearchInstance.scheduleSearch();\n }\n var setUserTokenToSearch = function setUserTokenToSearch(userToken, tokenType) {\n var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var unsetAuthenticatedUserToken = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var normalizedUserToken = normalizeUserToken(userToken);\n if (!normalizedUserToken) {\n return;\n }\n var existingToken = helper.state.userToken;\n function applyToken() {\n helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {\n userToken: normalizedUserToken\n }));\n if (existingToken && existingToken !== userToken) {\n instantSearchInstance.scheduleSearch();\n }\n currentTokenType = tokenType;\n }\n\n // the authenticated user token cannot be overridden by a user or anonymous token\n // for instant search query requests\n if (currentTokenType && currentTokenType === 'authenticated' && tokenType === 'default' && !unsetAuthenticatedUserToken) {\n return;\n }\n\n // Delay the token application to the next render cycle\n if (!immediate) {\n setTimeout(applyToken, 0);\n } else {\n applyToken();\n }\n };\n function setUserToken(token, userToken, authenticatedUserToken) {\n setUserTokenToSearch(token, authenticatedUserToken ? 'authenticated' : 'default', true);\n if (userToken) {\n insightsClient('setUserToken', userToken);\n }\n if (authenticatedUserToken) {\n insightsClient('setAuthenticatedUserToken', authenticatedUserToken);\n }\n }\n var anonymousUserToken = undefined;\n var anonymousTokenFromInsights = (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.getInsightsAnonymousUserTokenInternal)();\n if (anonymousTokenFromInsights) {\n // When `aa('init', { ... })` is called, it creates an anonymous user token in cookie.\n // We can set it as userToken on instantsearch and insights. If it's not set as an insights\n // userToken before a sendEvent, insights automatically generates a new anonymous token,\n // causing a state change and an unnecessary query on instantsearch.\n anonymousUserToken = anonymousTokenFromInsights;\n } else {\n var token = \"anonymous-\".concat((0,_lib_utils_uuid_js__WEBPACK_IMPORTED_MODULE_6__.createUUID)());\n anonymousUserToken = token;\n }\n var authenticatedUserTokenFromInit;\n var userTokenFromInit;\n\n // With SSR, the token could be be set on the state. We make sure\n // that insights is in sync with that token since, there is no\n // insights lib on the server.\n var tokenFromSearchParameters = initialParameters.userToken;\n\n // When the first query is sent, the token is possibly not yet be set by\n // the insights onChange callbacks (if insights isn't yet loaded).\n // It is explicitly being set here so that the first query has the\n // initial tokens set and ensure a second query isn't automatically\n // made when the onChange callback actually changes the state.\n if (insightsInitParams) {\n if (insightsInitParams.authenticatedUserToken) {\n authenticatedUserTokenFromInit = insightsInitParams.authenticatedUserToken;\n } else if (insightsInitParams.userToken) {\n userTokenFromInit = insightsInitParams.userToken;\n }\n }\n\n // We consider the `userToken` or `authenticatedUserToken` before an\n // `init` call of higher importance than one from the queue and ones set\n // from the init props to be higher than that.\n var tokenFromInit = authenticatedUserTokenFromInit || userTokenFromInit;\n var tokenBeforeInit = authenticatedUserTokenBeforeInit || userTokenBeforeInit;\n var tokenFromQueue = queuedAuthenticatedUserToken || queuedUserToken;\n if (tokenFromInit) {\n setUserToken(tokenFromInit, userTokenFromInit, authenticatedUserTokenFromInit);\n } else if (tokenFromSearchParameters) {\n setUserToken(tokenFromSearchParameters, tokenFromSearchParameters, undefined);\n } else if (tokenBeforeInit) {\n setUserToken(tokenBeforeInit, userTokenBeforeInit, authenticatedUserTokenBeforeInit);\n } else if (tokenFromQueue) {\n setUserToken(tokenFromQueue, queuedUserToken, queuedAuthenticatedUserToken);\n } else if (anonymousUserToken) {\n var _queuedInitParams;\n setUserToken(anonymousUserToken, anonymousUserToken, undefined);\n if (insightsInitParams !== null && insightsInitParams !== void 0 && insightsInitParams.useCookie || (_queuedInitParams = queuedInitParams) !== null && _queuedInitParams !== void 0 && _queuedInitParams.useCookie) {\n var _queuedInitParams2;\n saveTokenAsCookie(anonymousUserToken, (insightsInitParams === null || insightsInitParams === void 0 ? void 0 : insightsInitParams.cookieDuration) || ((_queuedInitParams2 = queuedInitParams) === null || _queuedInitParams2 === void 0 ? void 0 : _queuedInitParams2.cookieDuration));\n }\n }\n\n // This updates userToken which is set explicitly by `aa('setUserToken', userToken)`\n insightsClient('onUserTokenChange', function (token) {\n return setUserTokenToSearch(token, 'default', true);\n }, {\n immediate: true\n });\n\n // This updates userToken which is set explicitly by `aa('setAuthenticatedtUserToken', authenticatedUserToken)`\n insightsClient('onAuthenticatedUserTokenChange', function (authenticatedUserToken) {\n // If we're unsetting the `authenticatedUserToken`, we revert to the `userToken`\n if (!authenticatedUserToken) {\n insightsClient('getUserToken', null, function (_, userToken) {\n setUserTokenToSearch(userToken, 'default', true, true);\n });\n }\n setUserTokenToSearch(authenticatedUserToken, 'authenticated', true);\n }, {\n immediate: true\n });\n var insightsClientWithLocalCredentials = insightsClient;\n if (isModernInsightsClient(insightsClient)) {\n insightsClientWithLocalCredentials = function insightsClientWithLocalCredentials(method, payload) {\n var extraParams = {\n headers: {\n 'X-Algolia-Application-Id': appId,\n 'X-Algolia-API-Key': apiKey\n }\n };\n\n // @ts-ignore we are calling this only when we know that the client actually is correct\n return insightsClient(method, payload, extraParams);\n };\n }\n instantSearchInstance.sendEventToInsights = function (event) {\n if (onEvent) {\n onEvent(event, insightsClientWithLocalCredentials);\n } else if (event.insightsMethod) {\n // Source is used to differentiate events sent by instantsearch from those sent manually.\n event.payload.algoliaSource = ['instantsearch'];\n if ($$automatic) {\n event.payload.algoliaSource.push('instantsearch-automatic');\n }\n if (event.eventModifier === 'internal') {\n event.payload.algoliaSource.push('instantsearch-internal');\n }\n insightsClientWithLocalCredentials(event.insightsMethod, event.payload);\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.warning)(Boolean(helper.state.userToken), \"\\nCannot send event to Algolia Insights because `userToken` is not set.\\n\\nSee documentation: https://www.algolia.com/doc/guides/building-search-ui/going-further/send-insights-events/js/#setting-the-usertoken\\n\") : 0;\n } else {\n true ? (0,_lib_utils_index_js__WEBPACK_IMPORTED_MODULE_3__.warning)(false, 'Cannot send event to Algolia Insights because `insightsMethod` option is missing.') : 0;\n }\n };\n },\n unsubscribe: function unsubscribe() {\n insightsClient('onUserTokenChange', undefined);\n insightsClient('onAuthenticatedUserTokenChange', undefined);\n instantSearchInstance.sendEventToInsights = _lib_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.noop;\n if (helper && initialParameters) {\n helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), initialParameters));\n instantSearchInstance.scheduleSearch();\n }\n }\n };\n };\n}\nfunction saveTokenAsCookie(token, cookieDuration) {\n var MONTH = 30 * 24 * 60 * 60 * 1000;\n var d = new Date();\n d.setTime(d.getTime() + (cookieDuration || MONTH * 6));\n var expires = \"expires=\".concat(d.toUTCString());\n document.cookie = \"_ALGOLIA=\".concat(token, \";\").concat(expires, \";path=/\");\n}\n\n/**\n * Determines if a given insights `client` supports the optional call to `init`\n * and the ability to set credentials via extra parameters when sending events.\n */\nfunction isModernInsightsClient(client) {\n var _split$map = (client.version || '').split('.').map(Number),\n _split$map2 = _slicedToArray(_split$map, 2),\n major = _split$map2[0],\n minor = _split$map2[1];\n\n /* eslint-disable @typescript-eslint/naming-convention */\n var v3 = major >= 3;\n var v2_6 = major === 2 && minor >= 6;\n var v1_10 = major === 1 && minor >= 10;\n /* eslint-enable @typescript-eslint/naming-convention */\n\n return v3 || v2_6 || v1_10;\n}\n\n/**\n * While `search-insights` supports both string and number user tokens,\n * the Search API only accepts strings. This function normalizes the user token.\n */\nfunction normalizeUserToken(userToken) {\n if (!userToken) {\n return undefined;\n }\n return typeof userToken === 'number' ? userToken.toString() : userToken;\n}\n\n//# sourceURL=webpack://kerisse/./node_modules/instantsearch.js/es/middlewares/createInsightsMiddleware.js?"); /***/ }),