{"version":3,"file":"Dom.min.js","sources":["../../../../node_modules/@babel/runtime/helpers/esm/extends.js","../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../../../node_modules/@babel/runtime/helpers/esm/objectSpread.js","../../../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../../../node_modules/@babel/runtime/helpers/esm/createClass.js","../../../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../../../node_modules/@babel/runtime/helpers/esm/inherits.js","../../../../node_modules/fast-deep-equal/index.js","../../../react-instantsearch-core/dist/es/core/utils.js","../../../react-instantsearch-core/dist/es/core/context.js","../../../react-instantsearch-core/dist/es/core/createConnector.js","../../../react-instantsearch-core/dist/es/core/highlight.js","../../../react-instantsearch-core/dist/es/core/version.js","../../../react-instantsearch-core/dist/es/core/translatable.js","../../../react-instantsearch-core/dist/es/core/indexUtils.js","../../../react-instantsearch-core/dist/es/connectors/connectConfigure.js","../../../react-instantsearch-core/dist/es/widgets/Configure.js","../../../../node_modules/rollup-plugin-node-globals/src/global.js","../../../../node_modules/process-es6/browser.js","../../../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../../../node_modules/object-assign/index.js","../../../../node_modules/prop-types/factoryWithThrowingShims.js","../../../../node_modules/prop-types/index.js","../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../../react-instantsearch-core/dist/es/widgets/Index.js","../../../../node_modules/algoliasearch-helper/src/functions/merge.js","../../../../node_modules/algoliasearch-helper/src/functions/defaultsPure.js","../../../../node_modules/algoliasearch-helper/src/functions/intersection.js","../../../../node_modules/algoliasearch-helper/src/functions/find.js","../../../../node_modules/algoliasearch-helper/src/functions/valToNumber.js","../../../../node_modules/algoliasearch-helper/src/functions/omit.js","../../../../node_modules/algoliasearch-helper/src/functions/objectHasKeys.js","../../../../node_modules/algoliasearch-helper/src/SearchParameters/RefinementList.js","../../../../node_modules/algoliasearch-helper/src/SearchParameters/index.js","../../../../node_modules/algoliasearch-helper/src/functions/orderBy.js","../../../../node_modules/algoliasearch-helper/src/functions/compact.js","../../../../node_modules/algoliasearch-helper/src/functions/findIndex.js","../../../../node_modules/algoliasearch-helper/src/functions/formatSort.js","../../../../node_modules/algoliasearch-helper/src/SearchResults/generate-hierarchical-tree.js","../../../../node_modules/algoliasearch-helper/src/SearchResults/index.js","../../../../node_modules/events/events.js","../../../../node_modules/algoliasearch-helper/src/functions/inherits.js","../../../../node_modules/algoliasearch-helper/src/DerivedHelper/index.js","../../../../node_modules/algoliasearch-helper/src/requestBuilder.js","../../../../node_modules/algoliasearch-helper/src/version.js","../../../../node_modules/algoliasearch-helper/src/algoliasearch.helper.js","../../../../node_modules/algoliasearch-helper/index.js","../../../react-instantsearch-core/dist/es/core/createInstantSearchManager.js","../../../react-instantsearch-core/dist/es/core/createWidgetsManager.js","../../../react-instantsearch-core/dist/es/core/createStore.js","../../../react-instantsearch-core/dist/es/widgets/InstantSearch.js","../../../react-instantsearch-core/dist/es/connectors/connectBreadcrumb.js","../../../react-instantsearch-core/dist/es/connectors/connectCurrentRefinements.js","../../../react-instantsearch-core/dist/es/connectors/connectHierarchicalMenu.js","../../../react-instantsearch-core/dist/es/connectors/connectHighlight.js","../../../react-instantsearch-core/dist/es/connectors/connectHits.js","../../../react-instantsearch-core/dist/es/connectors/connectHitsPerPage.js","../../../react-instantsearch-core/dist/es/connectors/connectInfiniteHits.js","../../../react-instantsearch-core/dist/es/connectors/connectMenu.js","../../../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../../react-instantsearch-core/dist/es/connectors/connectNumericMenu.js","../../../react-instantsearch-core/dist/es/connectors/connectPagination.js","../../../react-instantsearch-core/dist/es/connectors/connectPoweredBy.js","../../../react-instantsearch-core/dist/es/connectors/connectRange.js","../../../react-instantsearch-core/dist/es/connectors/connectRefinementList.js","../../../react-instantsearch-core/dist/es/connectors/connectScrollTo.js","../../../react-instantsearch-core/dist/es/connectors/connectSearchBox.js","../../../react-instantsearch-core/dist/es/connectors/connectSortBy.js","../../../react-instantsearch-core/dist/es/connectors/connectStats.js","../../../react-instantsearch-core/dist/es/connectors/connectToggleRefinement.js","../../../../node_modules/classnames/index.js","../../../react-instantsearch-dom/dist/es/core/utils.js","../../../react-instantsearch-dom/dist/es/components/Panel.js","../../../react-instantsearch-dom/dist/es/components/PanelCallbackHandler.js","../../../react-instantsearch-dom/dist/es/components/Link.js","../../../react-instantsearch-dom/dist/es/components/Breadcrumb.js","../../../react-instantsearch-dom/dist/es/widgets/Breadcrumb.js","../../../react-instantsearch-dom/dist/es/components/ClearRefinements.js","../../../react-instantsearch-dom/dist/es/widgets/ClearRefinements.js","../../../react-instantsearch-dom/dist/es/components/CurrentRefinements.js","../../../react-instantsearch-dom/dist/es/widgets/CurrentRefinements.js","../../../react-instantsearch-dom/dist/es/components/SearchBox.js","../../../react-instantsearch-dom/dist/es/components/List.js","../../../react-instantsearch-dom/dist/es/components/HierarchicalMenu.js","../../../react-instantsearch-dom/dist/es/widgets/HierarchicalMenu.js","../../../react-instantsearch-dom/dist/es/components/Highlighter.js","../../../react-instantsearch-dom/dist/es/components/Highlight.js","../../../react-instantsearch-dom/dist/es/widgets/Highlight.js","../../../react-instantsearch-dom/dist/es/components/Hits.js","../../../react-instantsearch-dom/dist/es/widgets/Hits.js","../../../react-instantsearch-dom/dist/es/components/Select.js","../../../react-instantsearch-dom/dist/es/components/HitsPerPage.js","../../../react-instantsearch-dom/dist/es/widgets/HitsPerPage.js","../../../react-instantsearch-dom/dist/es/components/InfiniteHits.js","../../../react-instantsearch-dom/dist/es/widgets/InfiniteHits.js","../../../react-instantsearch-dom/dist/es/components/Menu.js","../../../react-instantsearch-dom/dist/es/widgets/Menu.js","../../../react-instantsearch-dom/dist/es/components/MenuSelect.js","../../../react-instantsearch-dom/dist/es/widgets/MenuSelect.js","../../../react-instantsearch-dom/dist/es/components/NumericMenu.js","../../../react-instantsearch-dom/dist/es/widgets/NumericMenu.js","../../../react-instantsearch-dom/dist/es/components/LinkList.js","../../../react-instantsearch-dom/dist/es/components/Pagination.js","../../../react-instantsearch-dom/dist/es/widgets/Pagination.js","../../../react-instantsearch-dom/dist/es/components/PoweredBy.js","../../../react-instantsearch-dom/dist/es/widgets/PoweredBy.js","../../../react-instantsearch-dom/dist/es/components/RangeInput.js","../../../react-instantsearch-dom/dist/es/widgets/RangeInput.js","../../../react-instantsearch-dom/dist/es/components/RatingMenu.js","../../../react-instantsearch-dom/dist/es/widgets/RatingMenu.js","../../../react-instantsearch-dom/dist/es/components/RefinementList.js","../../../react-instantsearch-dom/dist/es/widgets/RefinementList.js","../../../react-instantsearch-dom/dist/es/components/ScrollTo.js","../../../react-instantsearch-dom/dist/es/widgets/ScrollTo.js","../../../react-instantsearch-dom/dist/es/widgets/SearchBox.js","../../../react-instantsearch-dom/dist/es/components/Snippet.js","../../../react-instantsearch-dom/dist/es/widgets/Snippet.js","../../../react-instantsearch-dom/dist/es/components/SortBy.js","../../../react-instantsearch-dom/dist/es/widgets/SortBy.js","../../../react-instantsearch-dom/dist/es/components/Stats.js","../../../react-instantsearch-dom/dist/es/widgets/Stats.js","../../../react-instantsearch-dom/dist/es/components/ToggleRefinement.js","../../../react-instantsearch-dom/dist/es/widgets/ToggleRefinement.js","../../../react-instantsearch-dom/dist/es/widgets/RangeSlider.js"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nexport default function _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import _typeof from \"../../helpers/esm/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","'use strict';\n\nvar isArray = Array.isArray;\nvar keyList = Object.keys;\nvar hasProp = Object.prototype.hasOwnProperty;\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = isArray(a)\n , arrB = isArray(b)\n , i\n , length\n , key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n if (arrA != arrB) return false;\n\n var dateA = a instanceof Date\n , dateB = b instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return a.getTime() == b.getTime();\n\n var regexpA = a instanceof RegExp\n , regexpB = b instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return a.toString() == b.toString();\n\n var keys = keyList(a);\n length = keys.length;\n\n if (length !== keyList(b).length)\n return false;\n\n for (i = length; i-- !== 0;)\n if (!hasProp.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n return a!==a && b!==b;\n};\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\n// From https://github.com/reactjs/react-redux/blob/master/src/utils/shallowEqual.js\nexport var shallowEqual = function shallowEqual(objA, objB) {\n if (objA === objB) {\n return true;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n } // Test for A's keys different from B.\n\n\n var hasOwn = Object.prototype.hasOwnProperty;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {\n return false;\n }\n }\n\n return true;\n};\nexport var getDisplayName = function getDisplayName(Component) {\n return Component.displayName || Component.name || 'UnknownComponent';\n};\nvar resolved = Promise.resolve();\nexport var defer = function defer(f) {\n resolved.then(f);\n};\n\nvar isPlainObject = function isPlainObject(value) {\n return _typeof(value) === 'object' && value !== null && !Array.isArray(value);\n};\n\nexport var removeEmptyKey = function removeEmptyKey(obj) {\n Object.keys(obj).forEach(function (key) {\n var value = obj[key];\n\n if (!isPlainObject(value)) {\n return;\n }\n\n if (!objectHasKeys(value)) {\n delete obj[key];\n } else {\n removeEmptyKey(value);\n }\n });\n return obj;\n};\nexport function addAbsolutePositions(hits, hitsPerPage, page) {\n return hits.map(function (hit, index) {\n return _objectSpread({}, hit, {\n __position: hitsPerPage * page + index + 1\n });\n });\n}\nexport function addQueryID(hits, queryID) {\n if (!queryID) {\n return hits;\n }\n\n return hits.map(function (hit) {\n return _objectSpread({}, hit, {\n __queryID: queryID\n });\n });\n}\nexport function find(array, comparator) {\n if (!Array.isArray(array)) {\n return undefined;\n }\n\n for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return array[i];\n }\n }\n\n return undefined;\n}\nexport function objectHasKeys(object) {\n return object && Object.keys(object).length > 0;\n} // https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620\n\nexport function omit(source, excluded) {\n if (source === null || source === undefined) {\n return {};\n }\n\n var target = {};\n var sourceKeys = Object.keys(source);\n\n for (var i = 0; i < sourceKeys.length; i++) {\n var _key = sourceKeys[i];\n\n if (excluded.indexOf(_key) >= 0) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n target[_key] = source[_key];\n }\n\n return target;\n}\n/**\n * Retrieve the value at a path of the object:\n *\n * @example\n * getPropertyByPath(\n * { test: { this: { function: [{ now: { everyone: true } }] } } },\n * 'test.this.function[0].now.everyone'\n * ); // true\n *\n * getPropertyByPath(\n * { test: { this: { function: [{ now: { everyone: true } }] } } },\n * ['test', 'this', 'function', 0, 'now', 'everyone']\n * ); // true\n *\n * @param object Source object to query\n * @param path either an array of properties, or a string form of the properties, separated by .\n */\n\nexport var getPropertyByPath = function getPropertyByPath(object, path) {\n return (Array.isArray(path) ? path : path.replace(/\\[(\\d+)]/g, '.$1').split('.')).reduce(function (current, key) {\n return current ? current[key] : undefined;\n }, object);\n};","import { createContext } from 'react';\n\nvar _createContext = createContext({\n onInternalStateUpdate: function onInternalStateUpdate() {\n return undefined;\n },\n createHrefForState: function createHrefForState() {\n return '#';\n },\n onSearchForFacetValues: function onSearchForFacetValues() {\n return undefined;\n },\n onSearchStateChange: function onSearchStateChange() {\n return undefined;\n },\n onSearchParameters: function onSearchParameters() {\n return undefined;\n },\n store: {},\n widgetsManager: {},\n mainTargetedIndex: ''\n}),\n InstantSearchConsumer = _createContext.Consumer,\n InstantSearchProvider = _createContext.Provider;\n\nexport { InstantSearchConsumer, InstantSearchProvider };\n\nvar _createContext2 = createContext(undefined),\n IndexConsumer = _createContext2.Consumer,\n IndexProvider = _createContext2.Provider;\n\nexport { IndexConsumer, IndexProvider };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport isEqual from 'fast-deep-equal';\nimport { shallowEqual, getDisplayName, removeEmptyKey } from './utils';\nimport { InstantSearchConsumer, IndexConsumer } from './context';\n\n/**\n * Connectors are the HOC used to transform React components\n * into InstantSearch widgets.\n * In order to simplify the construction of such connectors\n * `createConnector` takes a description and transform it into\n * a connector.\n * @param {ConnectorDescription} connectorDesc the description of the connector\n * @return {Connector} a function that wraps a component into\n * an instantsearch connected one.\n */\nexport function createConnectorWithoutContext(connectorDesc) {\n if (!connectorDesc.displayName) {\n throw new Error('`createConnector` requires you to provide a `displayName` property.');\n }\n\n var isWidget = typeof connectorDesc.getSearchParameters === 'function' || typeof connectorDesc.getMetadata === 'function' || typeof connectorDesc.transitionState === 'function';\n return function (Composed) {\n var Connector =\n /*#__PURE__*/\n function (_Component) {\n _inherits(Connector, _Component);\n\n function Connector(props) {\n var _this;\n\n _classCallCheck(this, Connector);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Connector).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"unsubscribe\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"unregisterWidget\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"isUnmounting\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n providedProps: _this.getProvidedProps(_this.props)\n });\n\n _defineProperty(_assertThisInitialized(_this), \"refine\", function () {\n var _ref;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this.props.contextValue.onInternalStateUpdate( // refine will always be defined here because the prop is only given conditionally\n (_ref = connectorDesc.refine).call.apply(_ref, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args)));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"createURL\", function () {\n var _ref2;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _this.props.contextValue.createHrefForState( // refine will always be defined here because the prop is only given conditionally\n (_ref2 = connectorDesc.refine).call.apply(_ref2, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args)));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"searchForFacetValues\", function () {\n var _ref3;\n\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n _this.props.contextValue.onSearchForFacetValues( // searchForFacetValues will always be defined here because the prop is only given conditionally\n (_ref3 = connectorDesc.searchForFacetValues).call.apply(_ref3, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args)));\n });\n\n if (connectorDesc.getSearchParameters) {\n _this.props.contextValue.onSearchParameters(connectorDesc.getSearchParameters.bind(_assertThisInitialized(_this)), {\n ais: _this.props.contextValue,\n multiIndexContext: _this.props.indexContextValue\n }, _this.props);\n }\n\n return _this;\n }\n\n _createClass(Connector, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n this.unsubscribe = this.props.contextValue.store.subscribe(function () {\n if (!_this2.isUnmounting) {\n _this2.setState({\n providedProps: _this2.getProvidedProps(_this2.props)\n });\n }\n });\n\n if (isWidget) {\n this.unregisterWidget = this.props.contextValue.widgetsManager.registerWidget(this);\n }\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n if (typeof connectorDesc.shouldComponentUpdate === 'function') {\n return connectorDesc.shouldComponentUpdate.call(this, this.props, nextProps, this.state, nextState);\n }\n\n var propsEqual = shallowEqual(this.props, nextProps);\n\n if (this.state.providedProps === null || nextState.providedProps === null) {\n if (this.state.providedProps === nextState.providedProps) {\n return !propsEqual;\n }\n\n return true;\n }\n\n return !propsEqual || !shallowEqual(this.state.providedProps, nextState.providedProps);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (!isEqual(prevProps, this.props)) {\n this.setState({\n providedProps: this.getProvidedProps(this.props)\n });\n\n if (isWidget) {\n this.props.contextValue.widgetsManager.update();\n\n if (typeof connectorDesc.transitionState === 'function') {\n this.props.contextValue.onSearchStateChange(connectorDesc.transitionState.call(this, this.props, this.props.contextValue.store.getState().widgets, this.props.contextValue.store.getState().widgets));\n }\n }\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.isUnmounting = true;\n\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n\n if (this.unregisterWidget) {\n this.unregisterWidget();\n\n if (typeof connectorDesc.cleanUp === 'function') {\n var nextState = connectorDesc.cleanUp.call(this, this.props, this.props.contextValue.store.getState().widgets);\n this.props.contextValue.store.setState(_objectSpread({}, this.props.contextValue.store.getState(), {\n widgets: nextState\n }));\n this.props.contextValue.onSearchStateChange(removeEmptyKey(nextState));\n }\n }\n }\n }, {\n key: \"getProvidedProps\",\n value: function getProvidedProps(props) {\n var _this$props$contextVa = this.props.contextValue.store.getState(),\n widgets = _this$props$contextVa.widgets,\n results = _this$props$contextVa.results,\n resultsFacetValues = _this$props$contextVa.resultsFacetValues,\n searching = _this$props$contextVa.searching,\n searchingForFacetValues = _this$props$contextVa.searchingForFacetValues,\n isSearchStalled = _this$props$contextVa.isSearchStalled,\n metadata = _this$props$contextVa.metadata,\n error = _this$props$contextVa.error;\n\n var searchResults = {\n results: results,\n searching: searching,\n searchingForFacetValues: searchingForFacetValues,\n isSearchStalled: isSearchStalled,\n error: error\n };\n return connectorDesc.getProvidedProps.call(this, props, widgets, searchResults, metadata, // @MAJOR: move this attribute on the `searchResults` it doesn't\n // makes sense to have it into a separate argument. The search\n // flags are on the object why not the results?\n resultsFacetValues);\n }\n }, {\n key: \"getSearchParameters\",\n value: function getSearchParameters(searchParameters) {\n if (typeof connectorDesc.getSearchParameters === 'function') {\n return connectorDesc.getSearchParameters.call(this, searchParameters, this.props, this.props.contextValue.store.getState().widgets);\n }\n\n return null;\n }\n }, {\n key: \"getMetadata\",\n value: function getMetadata(nextWidgetsState) {\n if (typeof connectorDesc.getMetadata === 'function') {\n return connectorDesc.getMetadata.call(this, this.props, nextWidgetsState);\n }\n\n return {};\n }\n }, {\n key: \"transitionState\",\n value: function transitionState(prevWidgetsState, nextWidgetsState) {\n if (typeof connectorDesc.transitionState === 'function') {\n return connectorDesc.transitionState.call(this, this.props, prevWidgetsState, nextWidgetsState);\n }\n\n return nextWidgetsState;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n contextValue = _this$props.contextValue,\n props = _objectWithoutProperties(_this$props, [\"contextValue\"]);\n\n var providedProps = this.state.providedProps;\n\n if (providedProps === null) {\n return null;\n }\n\n var refineProps = typeof connectorDesc.refine === 'function' ? {\n refine: this.refine,\n createURL: this.createURL\n } : {};\n var searchForFacetValuesProps = typeof connectorDesc.searchForFacetValues === 'function' ? {\n searchForItems: this.searchForFacetValues\n } : {};\n return React.createElement(Composed, _extends({}, props, providedProps, refineProps, searchForFacetValuesProps));\n }\n }]);\n\n return Connector;\n }(Component);\n\n _defineProperty(Connector, \"displayName\", \"\".concat(connectorDesc.displayName, \"(\").concat(getDisplayName(Composed), \")\"));\n\n _defineProperty(Connector, \"propTypes\", connectorDesc.propTypes);\n\n _defineProperty(Connector, \"defaultProps\", connectorDesc.defaultProps);\n\n return Connector;\n };\n}\n\nvar createConnectorWithContext = function createConnectorWithContext(connectorDesc) {\n return function (Composed) {\n var Connector = createConnectorWithoutContext(connectorDesc)(Composed);\n\n var ConnectorWrapper = function ConnectorWrapper(props) {\n return React.createElement(InstantSearchConsumer, null, function (contextValue) {\n return React.createElement(IndexConsumer, null, function (indexContextValue) {\n return React.createElement(Connector, _extends({\n contextValue: contextValue,\n indexContextValue: indexContextValue\n }, props));\n });\n });\n };\n\n return ConnectorWrapper;\n };\n};\n\nexport default createConnectorWithContext;","import { getPropertyByPath } from './utils';\nexport var HIGHLIGHT_TAGS = {\n highlightPreTag: \"<ais-highlight-0000000000>\",\n highlightPostTag: \"</ais-highlight-0000000000>\"\n};\n/**\n * Parses an highlighted attribute into an array of objects with the string value, and\n * a boolean that indicated if this part is highlighted.\n *\n * @param {string} preTag - string used to identify the start of an highlighted value\n * @param {string} postTag - string used to identify the end of an highlighted value\n * @param {string} highlightedValue - highlighted attribute as returned by Algolia highlight feature\n * @return {object[]} - An array of {value: string, isHighlighted: boolean}.\n */\n\nfunction parseHighlightedAttribute(_ref) {\n var preTag = _ref.preTag,\n postTag = _ref.postTag,\n _ref$highlightedValue = _ref.highlightedValue,\n highlightedValue = _ref$highlightedValue === void 0 ? '' : _ref$highlightedValue;\n var splitByPreTag = highlightedValue.split(preTag);\n var firstValue = splitByPreTag.shift();\n var elements = firstValue === '' ? [] : [{\n value: firstValue,\n isHighlighted: false\n }];\n\n if (postTag === preTag) {\n var isHighlighted = true;\n splitByPreTag.forEach(function (split) {\n elements.push({\n value: split,\n isHighlighted: isHighlighted\n });\n isHighlighted = !isHighlighted;\n });\n } else {\n splitByPreTag.forEach(function (split) {\n var splitByPostTag = split.split(postTag);\n elements.push({\n value: splitByPostTag[0],\n isHighlighted: true\n });\n\n if (splitByPostTag[1] !== '') {\n elements.push({\n value: splitByPostTag[1],\n isHighlighted: false\n });\n }\n });\n }\n\n return elements;\n}\n/**\n * Find an highlighted attribute given an `attribute` and an `highlightProperty`, parses it,\n * and provided an array of objects with the string value and a boolean if this\n * value is highlighted.\n *\n * In order to use this feature, highlight must be activated in the configuration of\n * the index. The `preTag` and `postTag` attributes are respectively highlightPreTag and\n * highlightPostTag in Algolia configuration.\n *\n * @param {string} preTag - string used to identify the start of an highlighted value\n * @param {string} postTag - string used to identify the end of an highlighted value\n * @param {string} highlightProperty - the property that contains the highlight structure in the results\n * @param {string} attribute - the highlighted attribute to look for\n * @param {object} hit - the actual hit returned by Algolia.\n * @return {object[]} - An array of {value: string, isHighlighted: boolean}.\n */\n\n\nexport function parseAlgoliaHit(_ref2) {\n var _ref2$preTag = _ref2.preTag,\n preTag = _ref2$preTag === void 0 ? '<em>' : _ref2$preTag,\n _ref2$postTag = _ref2.postTag,\n postTag = _ref2$postTag === void 0 ? '</em>' : _ref2$postTag,\n highlightProperty = _ref2.highlightProperty,\n attribute = _ref2.attribute,\n hit = _ref2.hit;\n if (!hit) throw new Error('`hit`, the matching record, must be provided');\n var highlightObject = getPropertyByPath(hit[highlightProperty], attribute) || {};\n\n if (Array.isArray(highlightObject)) {\n return highlightObject.map(function (item) {\n return parseHighlightedAttribute({\n preTag: preTag,\n postTag: postTag,\n highlightedValue: item.value\n });\n });\n }\n\n return parseHighlightedAttribute({\n preTag: preTag,\n postTag: postTag,\n highlightedValue: highlightObject.value\n });\n}","export default '6.1.0';","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\n\nvar withKeysPropType = function withKeysPropType(keys) {\n return function (props, propName, componentName) {\n var prop = props[propName];\n\n if (prop) {\n for (var _i = 0, _Object$keys = Object.keys(prop); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n\n if (keys.indexOf(key) === -1) {\n return new Error(\"Unknown `\".concat(propName, \"` key `\").concat(key, \"`. Check the render method \") + \"of `\".concat(componentName, \"`.\"));\n }\n }\n }\n\n return undefined;\n };\n};\n\nexport default function translatable(defaultTranslations) {\n return function (Composed) {\n var Translatable =\n /*#__PURE__*/\n function (_Component) {\n _inherits(Translatable, _Component);\n\n function Translatable() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Translatable);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Translatable)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"translate\", function (key) {\n var translations = _this.props.translations;\n var translation = translations && translations.hasOwnProperty(key) ? translations[key] : defaultTranslations[key];\n\n if (typeof translation === 'function') {\n for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n params[_key2 - 1] = arguments[_key2];\n }\n\n return translation.apply(void 0, params);\n }\n\n return translation;\n });\n\n return _this;\n }\n\n _createClass(Translatable, [{\n key: \"render\",\n value: function render() {\n return React.createElement(Composed, _extends({\n translate: this.translate\n }, this.props));\n }\n }]);\n\n return Translatable;\n }(Component);\n\n var name = Composed.displayName || Composed.name || 'UnknownComponent';\n Translatable.displayName = \"Translatable(\".concat(name, \")\");\n Translatable.propTypes = {\n translations: withKeysPropType(Object.keys(defaultTranslations))\n };\n return Translatable;\n };\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport { omit } from './utils';\nexport function getIndexId(context) {\n return hasMultipleIndices(context) ? context.multiIndexContext.targetedIndex : context.ais.mainTargetedIndex;\n}\nexport function getResults(searchResults, context) {\n if (searchResults.results) {\n if (searchResults.results.hits) {\n return searchResults.results;\n }\n\n var indexId = getIndexId(context);\n\n if (searchResults.results[indexId]) {\n return searchResults.results[indexId];\n }\n }\n\n return null;\n}\nexport function hasMultipleIndices(context) {\n return context && context.multiIndexContext;\n} // eslint-disable-next-line max-params\n\nexport function refineValue(searchState, nextRefinement, context, resetPage, namespace) {\n if (hasMultipleIndices(context)) {\n var indexId = getIndexId(context);\n return namespace ? refineMultiIndexWithNamespace(searchState, nextRefinement, indexId, resetPage, namespace) : refineMultiIndex(searchState, nextRefinement, indexId, resetPage);\n } else {\n // When we have a multi index page with shared widgets we should also\n // reset their page to 1 if the resetPage is provided. Otherwise the\n // indices will always be reset\n // see: https://github.com/algolia/react-instantsearch/issues/310\n // see: https://github.com/algolia/react-instantsearch/issues/637\n if (searchState.indices && resetPage) {\n Object.keys(searchState.indices).forEach(function (targetedIndex) {\n searchState = refineValue(searchState, {\n page: 1\n }, {\n multiIndexContext: {\n targetedIndex: targetedIndex\n }\n }, true, namespace);\n });\n }\n\n return namespace ? refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) : refineSingleIndex(searchState, nextRefinement, resetPage);\n }\n}\n\nfunction refineMultiIndex(searchState, nextRefinement, indexId, resetPage) {\n var page = resetPage ? {\n page: 1\n } : undefined;\n var state = searchState.indices && searchState.indices[indexId] ? _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, searchState.indices[indexId], nextRefinement, page))) : _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, nextRefinement, page)));\n return _objectSpread({}, searchState, {\n indices: state\n });\n}\n\nfunction refineSingleIndex(searchState, nextRefinement, resetPage) {\n var page = resetPage ? {\n page: 1\n } : undefined;\n return _objectSpread({}, searchState, nextRefinement, page);\n} // eslint-disable-next-line max-params\n\n\nfunction refineMultiIndexWithNamespace(searchState, nextRefinement, indexId, resetPage, namespace) {\n var _objectSpread4;\n\n var page = resetPage ? {\n page: 1\n } : undefined;\n var state = searchState.indices && searchState.indices[indexId] ? _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, searchState.indices[indexId], (_objectSpread4 = {}, _defineProperty(_objectSpread4, namespace, _objectSpread({}, searchState.indices[indexId][namespace], nextRefinement)), _defineProperty(_objectSpread4, \"page\", 1), _objectSpread4)))) : _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread(_defineProperty({}, namespace, nextRefinement), page)));\n return _objectSpread({}, searchState, {\n indices: state\n });\n}\n\nfunction refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) {\n var page = resetPage ? {\n page: 1\n } : undefined;\n return _objectSpread({}, searchState, _defineProperty({}, namespace, _objectSpread({}, searchState[namespace], nextRefinement)), page);\n}\n\nfunction getNamespaceAndAttributeName(id) {\n var parts = id.match(/^([^.]*)\\.(.*)/);\n var namespace = parts && parts[1];\n var attributeName = parts && parts[2];\n return {\n namespace: namespace,\n attributeName: attributeName\n };\n}\n\nfunction hasRefinements(_ref) {\n var multiIndex = _ref.multiIndex,\n indexId = _ref.indexId,\n namespace = _ref.namespace,\n attributeName = _ref.attributeName,\n id = _ref.id,\n searchState = _ref.searchState;\n\n if (multiIndex && namespace) {\n return searchState.indices && searchState.indices[indexId] && searchState.indices[indexId][namespace] && Object.hasOwnProperty.call(searchState.indices[indexId][namespace], attributeName);\n }\n\n if (multiIndex) {\n return searchState.indices && searchState.indices[indexId] && Object.hasOwnProperty.call(searchState.indices[indexId], id);\n }\n\n if (namespace) {\n return searchState[namespace] && Object.hasOwnProperty.call(searchState[namespace], attributeName);\n }\n\n return Object.hasOwnProperty.call(searchState, id);\n}\n\nfunction getRefinements(_ref2) {\n var multiIndex = _ref2.multiIndex,\n indexId = _ref2.indexId,\n namespace = _ref2.namespace,\n attributeName = _ref2.attributeName,\n id = _ref2.id,\n searchState = _ref2.searchState;\n\n if (multiIndex && namespace) {\n return searchState.indices[indexId][namespace][attributeName];\n }\n\n if (multiIndex) {\n return searchState.indices[indexId][id];\n }\n\n if (namespace) {\n return searchState[namespace][attributeName];\n }\n\n return searchState[id];\n}\n\nexport function getCurrentRefinementValue(props, searchState, context, id, defaultValue) {\n var indexId = getIndexId(context);\n\n var _getNamespaceAndAttri = getNamespaceAndAttributeName(id),\n namespace = _getNamespaceAndAttri.namespace,\n attributeName = _getNamespaceAndAttri.attributeName;\n\n var multiIndex = hasMultipleIndices(context);\n var args = {\n multiIndex: multiIndex,\n indexId: indexId,\n namespace: namespace,\n attributeName: attributeName,\n id: id,\n searchState: searchState\n };\n var hasRefinementsValue = hasRefinements(args);\n\n if (hasRefinementsValue) {\n return getRefinements(args);\n }\n\n if (props.defaultRefinement) {\n return props.defaultRefinement;\n }\n\n return defaultValue;\n}\nexport function cleanUpValue(searchState, context, id) {\n var indexId = getIndexId(context);\n\n var _getNamespaceAndAttri2 = getNamespaceAndAttributeName(id),\n namespace = _getNamespaceAndAttri2.namespace,\n attributeName = _getNamespaceAndAttri2.attributeName;\n\n if (hasMultipleIndices(context) && Boolean(searchState.indices)) {\n return cleanUpValueWithMultiIndex({\n attribute: attributeName,\n searchState: searchState,\n indexId: indexId,\n id: id,\n namespace: namespace\n });\n }\n\n return cleanUpValueWithSingleIndex({\n attribute: attributeName,\n searchState: searchState,\n id: id,\n namespace: namespace\n });\n}\n\nfunction cleanUpValueWithSingleIndex(_ref3) {\n var searchState = _ref3.searchState,\n id = _ref3.id,\n namespace = _ref3.namespace,\n attribute = _ref3.attribute;\n\n if (namespace) {\n return _objectSpread({}, searchState, _defineProperty({}, namespace, omit(searchState[namespace], [attribute])));\n }\n\n return omit(searchState, [id]);\n}\n\nfunction cleanUpValueWithMultiIndex(_ref4) {\n var searchState = _ref4.searchState,\n indexId = _ref4.indexId,\n id = _ref4.id,\n namespace = _ref4.namespace,\n attribute = _ref4.attribute;\n var indexSearchState = searchState.indices[indexId];\n\n if (namespace && indexSearchState) {\n return _objectSpread({}, searchState, {\n indices: _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, indexSearchState, _defineProperty({}, namespace, omit(indexSearchState[namespace], [attribute])))))\n });\n }\n\n if (indexSearchState) {\n return _objectSpread({}, searchState, {\n indices: _objectSpread({}, searchState.indices, _defineProperty({}, indexId, omit(indexSearchState, [id])))\n });\n }\n\n return searchState;\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport { omit } from '../core/utils';\nimport createConnector from '../core/createConnector';\nimport { refineValue, getIndexId, hasMultipleIndices } from '../core/indexUtils';\n\nfunction getId() {\n return 'configure';\n}\n\nexport default createConnector({\n displayName: 'AlgoliaConfigure',\n getProvidedProps: function getProvidedProps() {\n return {};\n },\n getSearchParameters: function getSearchParameters(searchParameters, props) {\n var children = props.children,\n contextValue = props.contextValue,\n indexContextValue = props.indexContextValue,\n items = _objectWithoutProperties(props, [\"children\", \"contextValue\", \"indexContextValue\"]);\n\n return searchParameters.setQueryParameters(items);\n },\n transitionState: function transitionState(props, prevSearchState, nextSearchState) {\n var id = getId();\n\n var children = props.children,\n contextValue = props.contextValue,\n indexContextValue = props.indexContextValue,\n items = _objectWithoutProperties(props, [\"children\", \"contextValue\", \"indexContextValue\"]);\n\n var propKeys = Object.keys(props);\n var nonPresentKeys = this._props ? Object.keys(this._props).filter(function (prop) {\n return propKeys.indexOf(prop) === -1;\n }) : [];\n this._props = props;\n\n var nextValue = _defineProperty({}, id, _objectSpread({}, omit(nextSearchState[id], nonPresentKeys), items));\n\n return refineValue(nextSearchState, nextValue, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n cleanUp: function cleanUp(props, searchState) {\n var id = getId();\n var indexId = getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var subState = hasMultipleIndices({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }) && searchState.indices ? searchState.indices[indexId] : searchState;\n var configureKeys = subState && subState[id] ? Object.keys(subState[id]) : [];\n var configureState = configureKeys.reduce(function (acc, item) {\n if (!props[item]) {\n acc[item] = subState[id][item];\n }\n\n return acc;\n }, {});\n\n var nextValue = _defineProperty({}, id, configureState);\n\n return refineValue(searchState, nextValue, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n }\n});","import connectConfigure from '../connectors/connectConfigure';\n/**\n * Configure is a widget that lets you provide raw search parameters\n * to the Algolia API.\n *\n * Any of the props added to this widget will be forwarded to Algolia. For more information\n * on the different parameters that can be set, have a look at the\n * [reference](https://www.algolia.com/doc/api-client/javascript/search#search-parameters).\n *\n * This widget can be used either with react-dom and react-native. It will not render anything\n * on screen, only configure some parameters.\n *\n * Read more in the [Search parameters](guide/Search_parameters.html) guide.\n * @name Configure\n * @kind widget\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Configure, Hits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <Configure hitsPerPage={5} />\n * <Hits />\n * </InstantSearch>\n * );\n */\n\nexport default connectConfigure(function Configure() {\n return null;\n});","export default (typeof global !== \"undefined\" ? global :\n typeof self !== \"undefined\" ? self :\n typeof window !== \"undefined\" ? window : {});\n","// shim for using process in browser\n// based off https://github.com/defunctzombie/node-process/blob/master/browser.js\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\nvar cachedSetTimeout = defaultSetTimout;\nvar cachedClearTimeout = defaultClearTimeout;\nif (typeof global.setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n}\nif (typeof global.clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n}\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\nexport function nextTick(fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nexport var title = 'browser';\nexport var platform = 'browser';\nexport var browser = true;\nexport var env = {};\nexport var argv = [];\nexport var version = ''; // empty string to avoid regexp issues\nexport var versions = {};\nexport var release = {};\nexport var config = {};\n\nfunction noop() {}\n\nexport var on = noop;\nexport var addListener = noop;\nexport var once = noop;\nexport var off = noop;\nexport var removeListener = noop;\nexport var removeAllListeners = noop;\nexport var emit = noop;\n\nexport function binding(name) {\n throw new Error('process.binding is not supported');\n}\n\nexport function cwd () { return '/' }\nexport function chdir (dir) {\n throw new Error('process.chdir is not supported');\n};\nexport function umask() { return 0; }\n\n// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js\nvar performance = global.performance || {}\nvar performanceNow =\n performance.now ||\n performance.mozNow ||\n performance.msNow ||\n performance.oNow ||\n performance.webkitNow ||\n function(){ return (new Date()).getTime() }\n\n// generate timestamp or delta\n// see http://nodejs.org/api/process.html#process_process_hrtime\nexport function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3\n var seconds = Math.floor(clocktime)\n var nanoseconds = Math.floor((clocktime%1)*1e9)\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0]\n nanoseconds = nanoseconds - previousTimestamp[1]\n if (nanoseconds<0) {\n seconds--\n nanoseconds += 1e9\n }\n }\n return [seconds,nanoseconds]\n}\n\nvar startTime = new Date();\nexport function uptime() {\n var currentTime = new Date();\n var dif = currentTime - startTime;\n return dif / 1000;\n}\n\nexport default {\n nextTick: nextTick,\n title: title,\n browser: browser,\n env: env,\n argv: argv,\n version: version,\n versions: versions,\n on: on,\n addListener: addListener,\n once: once,\n off: off,\n removeListener: removeListener,\n removeAllListeners: removeAllListeners,\n emit: emit,\n binding: binding,\n cwd: cwd,\n chdir: chdir,\n umask: umask,\n hrtime: hrtime,\n platform: platform,\n release: release,\n config: config,\n uptime: uptime\n};\n","import arrayWithoutHoles from \"./arrayWithoutHoles\";\nimport iterableToArray from \"./iterableToArray\";\nimport nonIterableSpread from \"./nonIterableSpread\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}","export default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}","export default function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component, Children } from 'react';\nimport PropTypes from 'prop-types';\nimport { InstantSearchConsumer, IndexProvider } from '../core/context';\n\nfunction getIndexContext(props) {\n return {\n targetedIndex: props.indexId\n };\n}\n\n/**\n * The component that allows you to apply widgets to a dedicated index. It's\n * useful if you want to build an interface that targets multiple indices.\n *\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Index, SearchBox, Hits, Configure } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <Configure hitsPerPage={5} />\n * <SearchBox />\n * <Index indexName=\"instant_search\">\n * <Hits />\n * </Index>\n * <Index indexName=\"bestbuy\">\n * <Hits />\n * </Index>\n * </InstantSearch>\n * );\n */\nvar Index =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Index, _Component);\n\n _createClass(Index, null, [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props) {\n return {\n indexContext: getIndexContext(props)\n };\n }\n }]);\n\n function Index(props) {\n var _this;\n\n _classCallCheck(this, Index);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Index).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n indexContext: getIndexContext(_this.props)\n });\n\n _defineProperty(_assertThisInitialized(_this), \"unregisterWidget\", void 0);\n\n _this.props.contextValue.onSearchParameters(_this.getSearchParameters.bind(_assertThisInitialized(_this)), {\n ais: _this.props.contextValue,\n multiIndexContext: _this.state.indexContext\n }, _this.props);\n\n return _this;\n }\n\n _createClass(Index, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.unregisterWidget = this.props.contextValue.widgetsManager.registerWidget(this);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (this.props.indexName !== prevProps.indexName) {\n this.props.contextValue.widgetsManager.update();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (typeof this.unregisterWidget === 'function') {\n this.unregisterWidget();\n }\n }\n }, {\n key: \"getSearchParameters\",\n value: function getSearchParameters(searchParameters, props) {\n return searchParameters.setIndex(this.props ? this.props.indexName : props.indexName);\n }\n }, {\n key: \"render\",\n value: function render() {\n var childrenCount = Children.count(this.props.children);\n\n if (childrenCount === 0) {\n return null;\n }\n\n return React.createElement(IndexProvider, {\n value: this.state.indexContext\n }, this.props.children);\n }\n }]);\n\n return Index;\n}(Component);\n\n_defineProperty(Index, \"propTypes\", {\n indexName: PropTypes.string.isRequired,\n indexId: PropTypes.string.isRequired,\n children: PropTypes.node\n});\n\nvar IndexWrapper = function IndexWrapper(props) {\n var inferredIndexId = props.indexName;\n return React.createElement(InstantSearchConsumer, null, function (contextValue) {\n return React.createElement(Index, _extends({\n contextValue: contextValue,\n indexId: inferredIndexId\n }, props));\n });\n};\n\nIndexWrapper.propTypes = {\n indexName: PropTypes.string.isRequired,\n indexId: PropTypes.string\n};\nexport var IndexComponentWithoutContext = Index;\nexport default IndexWrapper;","'use strict';\n\nfunction clone(value) {\n if (typeof value === 'object' && value !== null) {\n return _merge(Array.isArray(value) ? [] : {}, value);\n }\n return value;\n}\n\nfunction isObjectOrArrayOrFunction(value) {\n return (\n typeof value === 'function' ||\n Array.isArray(value) ||\n Object.prototype.toString.call(value) === '[object Object]'\n );\n}\n\nfunction _merge(target, source) {\n if (target === source) {\n return target;\n }\n\n for (var key in source) {\n if (!Object.prototype.hasOwnProperty.call(source, key)) {\n continue;\n }\n\n var sourceVal = source[key];\n var targetVal = target[key];\n\n if (typeof targetVal !== 'undefined' && typeof sourceVal === 'undefined') {\n continue;\n }\n\n if (isObjectOrArrayOrFunction(targetVal) && isObjectOrArrayOrFunction(sourceVal)) {\n target[key] = _merge(targetVal, sourceVal);\n } else {\n target[key] = clone(sourceVal);\n }\n }\n return target;\n}\n\n/**\n * This method is like Object.assign, but recursively merges own and inherited\n * enumerable keyed properties of source objects into the destination object.\n *\n * NOTE: this behaves like lodash/merge, but:\n * - does mutate functions if they are a source\n * - treats non-plain objects as plain\n * - does not work for circular objects\n * - treats sparse arrays as sparse\n * - does not convert Array-like objects (Arguments, NodeLists, etc.) to arrays\n *\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n */\n\nfunction merge(target) {\n if (!isObjectOrArrayOrFunction(target)) {\n target = {};\n }\n\n for (var i = 1, l = arguments.length; i < l; i++) {\n var source = arguments[i];\n\n if (isObjectOrArrayOrFunction(source)) {\n _merge(target, source);\n }\n }\n return target;\n}\n\nmodule.exports = merge;\n","'use strict';\n\n// NOTE: this behaves like lodash/defaults, but doesn't mutate the target\nmodule.exports = function defaultsPure() {\n var sources = Array.prototype.slice.call(arguments);\n return sources.reduceRight(function(acc, source) {\n Object.keys(Object(source)).forEach(function(key) {\n if (source[key] !== undefined) {\n acc[key] = source[key];\n }\n });\n return acc;\n }, {});\n};\n","'use strict';\n\nfunction intersection(arr1, arr2) {\n return arr1.filter(function(value, index) {\n return (\n arr2.indexOf(value) > -1 &&\n arr1.indexOf(value) === index /* skips duplicates */\n );\n });\n}\n\nmodule.exports = intersection;\n","'use strict';\n\n// @MAJOR can be replaced by native Array#find when we change support\nmodule.exports = function find(array, comparator) {\n if (!Array.isArray(array)) {\n return undefined;\n }\n\n for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return array[i];\n }\n }\n};\n","'use strict';\n\nfunction valToNumber(v) {\n if (typeof v === 'number') {\n return v;\n } else if (typeof v === 'string') {\n return parseFloat(v);\n } else if (Array.isArray(v)) {\n return v.map(valToNumber);\n }\n\n throw new Error('The value should be a number, a parsable string or an array of those.');\n}\n\nmodule.exports = valToNumber;\n","'use strict';\n\n// https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source === null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key;\n var i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;\n","'use strict';\n\nfunction objectHasKeys(obj) {\n return obj && Object.keys(obj).length > 0;\n}\n\nmodule.exports = objectHasKeys;\n","'use strict';\n\n/**\n * Functions to manipulate refinement lists\n *\n * The RefinementList is not formally defined through a prototype but is based\n * on a specific structure.\n *\n * @module SearchParameters.refinementList\n *\n * @typedef {string[]} SearchParameters.refinementList.Refinements\n * @typedef {Object.<string, SearchParameters.refinementList.Refinements>} SearchParameters.refinementList.RefinementList\n */\n\nvar defaultsPure = require('../functions/defaultsPure');\nvar omit = require('../functions/omit');\nvar objectHasKeys = require('../functions/objectHasKeys');\n\nvar lib = {\n /**\n * Adds a refinement to a RefinementList\n * @param {RefinementList} refinementList the initial list\n * @param {string} attribute the attribute to refine\n * @param {string} value the value of the refinement, if the value is not a string it will be converted\n * @return {RefinementList} a new and updated refinement list\n */\n addRefinement: function addRefinement(refinementList, attribute, value) {\n if (lib.isRefined(refinementList, attribute, value)) {\n return refinementList;\n }\n\n var valueAsString = '' + value;\n\n var facetRefinement = !refinementList[attribute] ?\n [valueAsString] :\n refinementList[attribute].concat(valueAsString);\n\n var mod = {};\n\n mod[attribute] = facetRefinement;\n\n return defaultsPure({}, mod, refinementList);\n },\n /**\n * Removes refinement(s) for an attribute:\n * - if the value is specified removes the refinement for the value on the attribute\n * - if no value is specified removes all the refinements for this attribute\n * @param {RefinementList} refinementList the initial list\n * @param {string} attribute the attribute to refine\n * @param {string} [value] the value of the refinement\n * @return {RefinementList} a new and updated refinement lst\n */\n removeRefinement: function removeRefinement(refinementList, attribute, value) {\n if (value === undefined) {\n // we use the \"filter\" form of clearRefinement, since it leaves empty values as-is\n // the form with a string will remove the attribute completely\n return lib.clearRefinement(refinementList, function(v, f) {\n return attribute === f;\n });\n }\n\n var valueAsString = '' + value;\n\n return lib.clearRefinement(refinementList, function(v, f) {\n return attribute === f && valueAsString === v;\n });\n },\n /**\n * Toggles the refinement value for an attribute.\n * @param {RefinementList} refinementList the initial list\n * @param {string} attribute the attribute to refine\n * @param {string} value the value of the refinement\n * @return {RefinementList} a new and updated list\n */\n toggleRefinement: function toggleRefinement(refinementList, attribute, value) {\n if (value === undefined) throw new Error('toggleRefinement should be used with a value');\n\n if (lib.isRefined(refinementList, attribute, value)) {\n return lib.removeRefinement(refinementList, attribute, value);\n }\n\n return lib.addRefinement(refinementList, attribute, value);\n },\n /**\n * Clear all or parts of a RefinementList. Depending on the arguments, three\n * kinds of behavior can happen:\n * - if no attribute is provided: clears the whole list\n * - if an attribute is provided as a string: clears the list for the specific attribute\n * - if an attribute is provided as a function: discards the elements for which the function returns true\n * @param {RefinementList} refinementList the initial list\n * @param {string} [attribute] the attribute or function to discard\n * @param {string} [refinementType] optional parameter to give more context to the attribute function\n * @return {RefinementList} a new and updated refinement list\n */\n clearRefinement: function clearRefinement(refinementList, attribute, refinementType) {\n if (attribute === undefined) {\n if (!objectHasKeys(refinementList)) {\n return refinementList;\n }\n return {};\n } else if (typeof attribute === 'string') {\n return omit(refinementList, attribute);\n } else if (typeof attribute === 'function') {\n var hasChanged = false;\n\n var newRefinementList = Object.keys(refinementList).reduce(function(memo, key) {\n var values = refinementList[key] || [];\n var facetList = values.filter(function(value) {\n return !attribute(value, key, refinementType);\n });\n\n if (facetList.length !== values.length) {\n hasChanged = true;\n }\n memo[key] = facetList;\n\n return memo;\n }, {});\n\n if (hasChanged) return newRefinementList;\n return refinementList;\n }\n },\n /**\n * Test if the refinement value is used for the attribute. If no refinement value\n * is provided, test if the refinementList contains any refinement for the\n * given attribute.\n * @param {RefinementList} refinementList the list of refinement\n * @param {string} attribute name of the attribute\n * @param {string} [refinementValue] value of the filter/refinement\n * @return {boolean}\n */\n isRefined: function isRefined(refinementList, attribute, refinementValue) {\n var containsRefinements = !!refinementList[attribute] &&\n refinementList[attribute].length > 0;\n\n if (refinementValue === undefined || !containsRefinements) {\n return containsRefinements;\n }\n\n var refinementValueAsString = '' + refinementValue;\n\n return refinementList[attribute].indexOf(refinementValueAsString) !== -1;\n }\n};\n\nmodule.exports = lib;\n","'use strict';\n\nvar merge = require('../functions/merge');\nvar defaultsPure = require('../functions/defaultsPure');\nvar intersection = require('../functions/intersection');\nvar find = require('../functions/find');\nvar valToNumber = require('../functions/valToNumber');\nvar omit = require('../functions/omit');\nvar objectHasKeys = require('../functions/objectHasKeys');\n\nvar RefinementList = require('./RefinementList');\n\n/**\n * isEqual, but only for numeric refinement values, possible values:\n * - 5\n * - [5]\n * - [[5]]\n * - [[5,5],[4]]\n */\nfunction isEqualNumericRefinement(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n return (\n a.length === b.length &&\n a.every(function(el, i) {\n return isEqualNumericRefinement(b[i], el);\n })\n );\n }\n return a === b;\n}\n\n/**\n * like _.find but using deep equality to be able to use it\n * to find arrays.\n * @private\n * @param {any[]} array array to search into (elements are base or array of base)\n * @param {any} searchedValue the value we're looking for (base or array of base)\n * @return {any} the searched value or undefined\n */\nfunction findArray(array, searchedValue) {\n return find(array, function(currentValue) {\n return isEqualNumericRefinement(currentValue, searchedValue);\n });\n}\n\n/**\n * The facet list is the structure used to store the list of values used to\n * filter a single attribute.\n * @typedef {string[]} SearchParameters.FacetList\n */\n\n/**\n * Structure to store numeric filters with the operator as the key. The supported operators\n * are `=`, `>`, `<`, `>=`, `<=` and `!=`.\n * @typedef {Object.<string, Array.<number|number[]>>} SearchParameters.OperatorList\n */\n\n/**\n * SearchParameters is the data structure that contains all the information\n * usable for making a search to Algolia API. It doesn't do the search itself,\n * nor does it contains logic about the parameters.\n * It is an immutable object, therefore it has been created in a way that each\n * changes does not change the object itself but returns a copy with the\n * modification.\n * This object should probably not be instantiated outside of the helper. It will\n * be provided when needed. This object is documented for reference as you'll\n * get it from events generated by the {@link AlgoliaSearchHelper}.\n * If need be, instantiate the Helper from the factory function {@link SearchParameters.make}\n * @constructor\n * @classdesc contains all the parameters of a search\n * @param {object|SearchParameters} newParameters existing parameters or partial object\n * for the properties of a new SearchParameters\n * @see SearchParameters.make\n * @example <caption>SearchParameters of the first query in\n * <a href=\"http://demos.algolia.com/instant-search-demo/\">the instant search demo</a></caption>\n{\n \"query\": \"\",\n \"disjunctiveFacets\": [\n \"customerReviewCount\",\n \"category\",\n \"salePrice_range\",\n \"manufacturer\"\n ],\n \"maxValuesPerFacet\": 30,\n \"page\": 0,\n \"hitsPerPage\": 10,\n \"facets\": [\n \"type\",\n \"shipping\"\n ]\n}\n */\nfunction SearchParameters(newParameters) {\n var params = newParameters ? SearchParameters._parseNumbers(newParameters) : {};\n\n /**\n * This attribute contains the list of all the conjunctive facets\n * used. This list will be added to requested facets in the\n * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.\n * @member {string[]}\n */\n this.facets = params.facets || [];\n /**\n * This attribute contains the list of all the disjunctive facets\n * used. This list will be added to requested facets in the\n * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.\n * @member {string[]}\n */\n this.disjunctiveFacets = params.disjunctiveFacets || [];\n /**\n * This attribute contains the list of all the hierarchical facets\n * used. This list will be added to requested facets in the\n * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.\n * Hierarchical facets are a sub type of disjunctive facets that\n * let you filter faceted attributes hierarchically.\n * @member {string[]|object[]}\n */\n this.hierarchicalFacets = params.hierarchicalFacets || [];\n\n // Refinements\n /**\n * This attribute contains all the filters that need to be\n * applied on the conjunctive facets. Each facet must be properly\n * defined in the `facets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters selected for the associated facet name.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.<string, SearchParameters.FacetList>}\n */\n this.facetsRefinements = params.facetsRefinements || {};\n /**\n * This attribute contains all the filters that need to be\n * excluded from the conjunctive facets. Each facet must be properly\n * defined in the `facets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters excluded for the associated facet name.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.<string, SearchParameters.FacetList>}\n */\n this.facetsExcludes = params.facetsExcludes || {};\n /**\n * This attribute contains all the filters that need to be\n * applied on the disjunctive facets. Each facet must be properly\n * defined in the `disjunctiveFacets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters selected for the associated facet name.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.<string, SearchParameters.FacetList>}\n */\n this.disjunctiveFacetsRefinements = params.disjunctiveFacetsRefinements || {};\n /**\n * This attribute contains all the filters that need to be\n * applied on the numeric attributes.\n *\n * The key is the name of the attribute, and the value is the\n * filters to apply to this attribute.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `numericFilters` attribute.\n * @member {Object.<string, SearchParameters.OperatorList>}\n */\n this.numericRefinements = params.numericRefinements || {};\n /**\n * This attribute contains all the tags used to refine the query.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `tagFilters` attribute.\n * @member {string[]}\n */\n this.tagRefinements = params.tagRefinements || [];\n /**\n * This attribute contains all the filters that need to be\n * applied on the hierarchical facets. Each facet must be properly\n * defined in the `hierarchicalFacets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters selected for the associated facet name. The FacetList values\n * are structured as a string that contain the values for each level\n * separated by the configured separator.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.<string, SearchParameters.FacetList>}\n */\n this.hierarchicalFacetsRefinements = params.hierarchicalFacetsRefinements || {};\n\n var self = this;\n Object.keys(params).forEach(function(paramName) {\n var isKeyKnown = SearchParameters.PARAMETERS.indexOf(paramName) !== -1;\n var isValueDefined = params[paramName] !== undefined;\n\n if (!isKeyKnown && isValueDefined) {\n self[paramName] = params[paramName];\n }\n });\n}\n\n/**\n * List all the properties in SearchParameters and therefore all the known Algolia properties\n * This doesn't contain any beta/hidden features.\n * @private\n */\nSearchParameters.PARAMETERS = Object.keys(new SearchParameters());\n\n/**\n * @private\n * @param {object} partialState full or part of a state\n * @return {object} a new object with the number keys as number\n */\nSearchParameters._parseNumbers = function(partialState) {\n // Do not reparse numbers in SearchParameters, they ought to be parsed already\n if (partialState instanceof SearchParameters) return partialState;\n\n var numbers = {};\n\n var numberKeys = [\n 'aroundPrecision',\n 'aroundRadius',\n 'getRankingInfo',\n 'minWordSizefor2Typos',\n 'minWordSizefor1Typo',\n 'page',\n 'maxValuesPerFacet',\n 'distinct',\n 'minimumAroundRadius',\n 'hitsPerPage',\n 'minProximity'\n ];\n\n numberKeys.forEach(function(k) {\n var value = partialState[k];\n if (typeof value === 'string') {\n var parsedValue = parseFloat(value);\n // global isNaN is ok to use here, value is only number or NaN\n numbers[k] = isNaN(parsedValue) ? value : parsedValue;\n }\n });\n\n // there's two formats of insideBoundingBox, we need to parse\n // the one which is an array of float geo rectangles\n if (Array.isArray(partialState.insideBoundingBox)) {\n numbers.insideBoundingBox = partialState.insideBoundingBox.map(function(geoRect) {\n return geoRect.map(function(value) {\n return parseFloat(value);\n });\n });\n }\n\n if (partialState.numericRefinements) {\n var numericRefinements = {};\n Object.keys(partialState.numericRefinements).forEach(function(attribute) {\n var operators = partialState.numericRefinements[attribute] || {};\n numericRefinements[attribute] = {};\n Object.keys(operators).forEach(function(operator) {\n var values = operators[operator];\n var parsedValues = values.map(function(v) {\n if (Array.isArray(v)) {\n return v.map(function(vPrime) {\n if (typeof vPrime === 'string') {\n return parseFloat(vPrime);\n }\n return vPrime;\n });\n } else if (typeof v === 'string') {\n return parseFloat(v);\n }\n return v;\n });\n numericRefinements[attribute][operator] = parsedValues;\n });\n });\n numbers.numericRefinements = numericRefinements;\n }\n\n return merge({}, partialState, numbers);\n};\n\n/**\n * Factory for SearchParameters\n * @param {object|SearchParameters} newParameters existing parameters or partial\n * object for the properties of a new SearchParameters\n * @return {SearchParameters} frozen instance of SearchParameters\n */\nSearchParameters.make = function makeSearchParameters(newParameters) {\n var instance = new SearchParameters(newParameters);\n\n var hierarchicalFacets = newParameters.hierarchicalFacets || [];\n hierarchicalFacets.forEach(function(facet) {\n if (facet.rootPath) {\n var currentRefinement = instance.getHierarchicalRefinement(facet.name);\n\n if (currentRefinement.length > 0 && currentRefinement[0].indexOf(facet.rootPath) !== 0) {\n instance = instance.clearRefinements(facet.name);\n }\n\n // get it again in case it has been cleared\n currentRefinement = instance.getHierarchicalRefinement(facet.name);\n if (currentRefinement.length === 0) {\n instance = instance.toggleHierarchicalFacetRefinement(facet.name, facet.rootPath);\n }\n }\n });\n\n return instance;\n};\n\n/**\n * Validates the new parameters based on the previous state\n * @param {SearchParameters} currentState the current state\n * @param {object|SearchParameters} parameters the new parameters to set\n * @return {Error|null} Error if the modification is invalid, null otherwise\n */\nSearchParameters.validate = function(currentState, parameters) {\n var params = parameters || {};\n\n if (currentState.tagFilters && params.tagRefinements && params.tagRefinements.length > 0) {\n return new Error(\n '[Tags] Cannot switch from the managed tag API to the advanced API. It is probably ' +\n 'an error, if it is really what you want, you should first clear the tags with clearTags method.');\n }\n\n if (currentState.tagRefinements.length > 0 && params.tagFilters) {\n return new Error(\n '[Tags] Cannot switch from the advanced tag API to the managed API. It is probably ' +\n 'an error, if it is not, you should first clear the tags with clearTags method.');\n }\n\n if (\n currentState.numericFilters &&\n params.numericRefinements &&\n objectHasKeys(params.numericRefinements)\n ) {\n return new Error(\n \"[Numeric filters] Can't switch from the advanced to the managed API. It\" +\n ' is probably an error, if this is really what you want, you have to first' +\n ' clear the numeric filters.'\n );\n }\n\n if (objectHasKeys(currentState.numericRefinements) && params.numericFilters) {\n return new Error(\n \"[Numeric filters] Can't switch from the managed API to the advanced. It\" +\n ' is probably an error, if this is really what you want, you have to first' +\n ' clear the numeric filters.');\n }\n\n return null;\n};\n\nSearchParameters.prototype = {\n constructor: SearchParameters,\n\n /**\n * Remove all refinements (disjunctive + conjunctive + excludes + numeric filters)\n * @method\n * @param {undefined|string|SearchParameters.clearCallback} [attribute] optional string or function\n * - If not given, means to clear all the filters.\n * - If `string`, means to clear all refinements for the `attribute` named filter.\n * - If `function`, means to clear all the refinements that return truthy values.\n * @return {SearchParameters}\n */\n clearRefinements: function clearRefinements(attribute) {\n var patch = {\n numericRefinements: this._clearNumericRefinements(attribute),\n facetsRefinements: RefinementList.clearRefinement(\n this.facetsRefinements,\n attribute,\n 'conjunctiveFacet'\n ),\n facetsExcludes: RefinementList.clearRefinement(\n this.facetsExcludes,\n attribute,\n 'exclude'\n ),\n disjunctiveFacetsRefinements: RefinementList.clearRefinement(\n this.disjunctiveFacetsRefinements,\n attribute,\n 'disjunctiveFacet'\n ),\n hierarchicalFacetsRefinements: RefinementList.clearRefinement(\n this.hierarchicalFacetsRefinements,\n attribute,\n 'hierarchicalFacet'\n )\n };\n if (\n patch.numericRefinements === this.numericRefinements &&\n patch.facetsRefinements === this.facetsRefinements &&\n patch.facetsExcludes === this.facetsExcludes &&\n patch.disjunctiveFacetsRefinements === this.disjunctiveFacetsRefinements &&\n patch.hierarchicalFacetsRefinements === this.hierarchicalFacetsRefinements\n ) {\n return this;\n }\n return this.setQueryParameters(patch);\n },\n /**\n * Remove all the refined tags from the SearchParameters\n * @method\n * @return {SearchParameters}\n */\n clearTags: function clearTags() {\n if (this.tagFilters === undefined && this.tagRefinements.length === 0) return this;\n\n return this.setQueryParameters({\n tagFilters: undefined,\n tagRefinements: []\n });\n },\n /**\n * Set the index.\n * @method\n * @param {string} index the index name\n * @return {SearchParameters}\n */\n setIndex: function setIndex(index) {\n if (index === this.index) return this;\n\n return this.setQueryParameters({\n index: index\n });\n },\n /**\n * Query setter\n * @method\n * @param {string} newQuery value for the new query\n * @return {SearchParameters}\n */\n setQuery: function setQuery(newQuery) {\n if (newQuery === this.query) return this;\n\n return this.setQueryParameters({\n query: newQuery\n });\n },\n /**\n * Page setter\n * @method\n * @param {number} newPage new page number\n * @return {SearchParameters}\n */\n setPage: function setPage(newPage) {\n if (newPage === this.page) return this;\n\n return this.setQueryParameters({\n page: newPage\n });\n },\n /**\n * Facets setter\n * The facets are the simple facets, used for conjunctive (and) faceting.\n * @method\n * @param {string[]} facets all the attributes of the algolia records used for conjunctive faceting\n * @return {SearchParameters}\n */\n setFacets: function setFacets(facets) {\n return this.setQueryParameters({\n facets: facets\n });\n },\n /**\n * Disjunctive facets setter\n * Change the list of disjunctive (or) facets the helper chan handle.\n * @method\n * @param {string[]} facets all the attributes of the algolia records used for disjunctive faceting\n * @return {SearchParameters}\n */\n setDisjunctiveFacets: function setDisjunctiveFacets(facets) {\n return this.setQueryParameters({\n disjunctiveFacets: facets\n });\n },\n /**\n * HitsPerPage setter\n * Hits per page represents the number of hits retrieved for this query\n * @method\n * @param {number} n number of hits retrieved per page of results\n * @return {SearchParameters}\n */\n setHitsPerPage: function setHitsPerPage(n) {\n if (this.hitsPerPage === n) return this;\n\n return this.setQueryParameters({\n hitsPerPage: n\n });\n },\n /**\n * typoTolerance setter\n * Set the value of typoTolerance\n * @method\n * @param {string} typoTolerance new value of typoTolerance (\"true\", \"false\", \"min\" or \"strict\")\n * @return {SearchParameters}\n */\n setTypoTolerance: function setTypoTolerance(typoTolerance) {\n if (this.typoTolerance === typoTolerance) return this;\n\n return this.setQueryParameters({\n typoTolerance: typoTolerance\n });\n },\n /**\n * Add a numeric filter for a given attribute\n * When value is an array, they are combined with OR\n * When value is a single value, it will combined with AND\n * @method\n * @param {string} attribute attribute to set the filter on\n * @param {string} operator operator of the filter (possible values: =, >, >=, <, <=, !=)\n * @param {number | number[]} value value of the filter\n * @return {SearchParameters}\n * @example\n * // for price = 50 or 40\n * searchparameter.addNumericRefinement('price', '=', [50, 40]);\n * @example\n * // for size = 38 and 40\n * searchparameter.addNumericRefinement('size', '=', 38);\n * searchparameter.addNumericRefinement('size', '=', 40);\n */\n addNumericRefinement: function(attribute, operator, v) {\n var value = valToNumber(v);\n\n if (this.isNumericRefined(attribute, operator, value)) return this;\n\n var mod = merge({}, this.numericRefinements);\n\n mod[attribute] = merge({}, mod[attribute]);\n\n if (mod[attribute][operator]) {\n // Array copy\n mod[attribute][operator] = mod[attribute][operator].slice();\n // Add the element. Concat can't be used here because value can be an array.\n mod[attribute][operator].push(value);\n } else {\n mod[attribute][operator] = [value];\n }\n\n return this.setQueryParameters({\n numericRefinements: mod\n });\n },\n /**\n * Get the list of conjunctive refinements for a single facet\n * @param {string} facetName name of the attribute used for faceting\n * @return {string[]} list of refinements\n */\n getConjunctiveRefinements: function(facetName) {\n if (!this.isConjunctiveFacet(facetName)) {\n return [];\n }\n return this.facetsRefinements[facetName] || [];\n },\n /**\n * Get the list of disjunctive refinements for a single facet\n * @param {string} facetName name of the attribute used for faceting\n * @return {string[]} list of refinements\n */\n getDisjunctiveRefinements: function(facetName) {\n if (!this.isDisjunctiveFacet(facetName)) {\n return [];\n }\n return this.disjunctiveFacetsRefinements[facetName] || [];\n },\n /**\n * Get the list of hierarchical refinements for a single facet\n * @param {string} facetName name of the attribute used for faceting\n * @return {string[]} list of refinements\n */\n getHierarchicalRefinement: function(facetName) {\n // we send an array but we currently do not support multiple\n // hierarchicalRefinements for a hierarchicalFacet\n return this.hierarchicalFacetsRefinements[facetName] || [];\n },\n /**\n * Get the list of exclude refinements for a single facet\n * @param {string} facetName name of the attribute used for faceting\n * @return {string[]} list of refinements\n */\n getExcludeRefinements: function(facetName) {\n if (!this.isConjunctiveFacet(facetName)) {\n return [];\n }\n return this.facetsExcludes[facetName] || [];\n },\n\n /**\n * Remove all the numeric filter for a given (attribute, operator)\n * @method\n * @param {string} attribute attribute to set the filter on\n * @param {string} [operator] operator of the filter (possible values: =, >, >=, <, <=, !=)\n * @param {number} [number] the value to be removed\n * @return {SearchParameters}\n */\n removeNumericRefinement: function(attribute, operator, paramValue) {\n if (paramValue !== undefined) {\n if (!this.isNumericRefined(attribute, operator, paramValue)) {\n return this;\n }\n return this.setQueryParameters({\n numericRefinements: this._clearNumericRefinements(function(value, key) {\n return (\n key === attribute &&\n value.op === operator &&\n isEqualNumericRefinement(value.val, valToNumber(paramValue))\n );\n })\n });\n } else if (operator !== undefined) {\n if (!this.isNumericRefined(attribute, operator)) return this;\n return this.setQueryParameters({\n numericRefinements: this._clearNumericRefinements(function(value, key) {\n return key === attribute && value.op === operator;\n })\n });\n }\n\n if (!this.isNumericRefined(attribute)) return this;\n return this.setQueryParameters({\n numericRefinements: this._clearNumericRefinements(function(value, key) {\n return key === attribute;\n })\n });\n },\n /**\n * Get the list of numeric refinements for a single facet\n * @param {string} facetName name of the attribute used for faceting\n * @return {SearchParameters.OperatorList[]} list of refinements\n */\n getNumericRefinements: function(facetName) {\n return this.numericRefinements[facetName] || {};\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.<number|number[]>} refined values\n */\n getNumericRefinement: function(attribute, operator) {\n return this.numericRefinements[attribute] && this.numericRefinements[attribute][operator];\n },\n /**\n * Clear numeric filters.\n * @method\n * @private\n * @param {string|SearchParameters.clearCallback} [attribute] optional string or function\n * - If not given, means to clear all the filters.\n * - If `string`, means to clear all refinements for the `attribute` named filter.\n * - If `function`, means to clear all the refinements that return truthy values.\n * @return {Object.<string, OperatorList>}\n */\n _clearNumericRefinements: function _clearNumericRefinements(attribute) {\n if (attribute === undefined) {\n if (!objectHasKeys(this.numericRefinements)) {\n return this.numericRefinements;\n }\n return {};\n } else if (typeof attribute === 'string') {\n if (!objectHasKeys(this.numericRefinements[attribute])) {\n return this.numericRefinements;\n }\n return omit(this.numericRefinements, attribute);\n } else if (typeof attribute === 'function') {\n var hasChanged = false;\n var numericRefinements = this.numericRefinements;\n var newNumericRefinements = Object.keys(numericRefinements).reduce(function(memo, key) {\n var operators = numericRefinements[key];\n var operatorList = {};\n\n operators = operators || {};\n Object.keys(operators).forEach(function(operator) {\n var values = operators[operator] || [];\n var outValues = [];\n values.forEach(function(value) {\n var predicateResult = attribute({val: value, op: operator}, key, 'numeric');\n if (!predicateResult) outValues.push(value);\n });\n if (outValues.length !== values.length) {\n hasChanged = true;\n }\n operatorList[operator] = outValues;\n });\n\n memo[key] = operatorList;\n\n return memo;\n }, {});\n\n if (hasChanged) return newNumericRefinements;\n return this.numericRefinements;\n }\n },\n /**\n * Add a facet to the facets attribute of the helper configuration, if it\n * isn't already present.\n * @method\n * @param {string} facet facet name to add\n * @return {SearchParameters}\n */\n addFacet: function addFacet(facet) {\n if (this.isConjunctiveFacet(facet)) {\n return this;\n }\n\n return this.setQueryParameters({\n facets: this.facets.concat([facet])\n });\n },\n /**\n * Add a disjunctive facet to the disjunctiveFacets attribute of the helper\n * configuration, if it isn't already present.\n * @method\n * @param {string} facet disjunctive facet name to add\n * @return {SearchParameters}\n */\n addDisjunctiveFacet: function addDisjunctiveFacet(facet) {\n if (this.isDisjunctiveFacet(facet)) {\n return this;\n }\n\n return this.setQueryParameters({\n disjunctiveFacets: this.disjunctiveFacets.concat([facet])\n });\n },\n /**\n * Add a hierarchical facet to the hierarchicalFacets attribute of the helper\n * configuration.\n * @method\n * @param {object} hierarchicalFacet hierarchical facet to add\n * @return {SearchParameters}\n * @throws will throw an error if a hierarchical facet with the same name was already declared\n */\n addHierarchicalFacet: function addHierarchicalFacet(hierarchicalFacet) {\n if (this.isHierarchicalFacet(hierarchicalFacet.name)) {\n throw new Error(\n 'Cannot declare two hierarchical facets with the same name: `' + hierarchicalFacet.name + '`');\n }\n\n return this.setQueryParameters({\n hierarchicalFacets: this.hierarchicalFacets.concat([hierarchicalFacet])\n });\n },\n /**\n * Add a refinement on a \"normal\" facet\n * @method\n * @param {string} facet attribute to apply the faceting on\n * @param {string} value value of the attribute (will be converted to string)\n * @return {SearchParameters}\n */\n addFacetRefinement: function addFacetRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n if (RefinementList.isRefined(this.facetsRefinements, facet, value)) return this;\n\n return this.setQueryParameters({\n facetsRefinements: RefinementList.addRefinement(this.facetsRefinements, facet, value)\n });\n },\n /**\n * Exclude a value from a \"normal\" facet\n * @method\n * @param {string} facet attribute to apply the exclusion on\n * @param {string} value value of the attribute (will be converted to string)\n * @return {SearchParameters}\n */\n addExcludeRefinement: function addExcludeRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n if (RefinementList.isRefined(this.facetsExcludes, facet, value)) return this;\n\n return this.setQueryParameters({\n facetsExcludes: RefinementList.addRefinement(this.facetsExcludes, facet, value)\n });\n },\n /**\n * Adds a refinement on a disjunctive facet.\n * @method\n * @param {string} facet attribute to apply the faceting on\n * @param {string} value value of the attribute (will be converted to string)\n * @return {SearchParameters}\n */\n addDisjunctiveFacetRefinement: function addDisjunctiveFacetRefinement(facet, value) {\n if (!this.isDisjunctiveFacet(facet)) {\n throw new Error(\n facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration');\n }\n\n if (RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this;\n\n return this.setQueryParameters({\n disjunctiveFacetsRefinements: RefinementList.addRefinement(\n this.disjunctiveFacetsRefinements, facet, value)\n });\n },\n /**\n * addTagRefinement adds a tag to the list used to filter the results\n * @param {string} tag tag to be added\n * @return {SearchParameters}\n */\n addTagRefinement: function addTagRefinement(tag) {\n if (this.isTagRefined(tag)) return this;\n\n var modification = {\n tagRefinements: this.tagRefinements.concat(tag)\n };\n\n return this.setQueryParameters(modification);\n },\n /**\n * Remove a facet from the facets attribute of the helper configuration, if it\n * is present.\n * @method\n * @param {string} facet facet name to remove\n * @return {SearchParameters}\n */\n removeFacet: function removeFacet(facet) {\n if (!this.isConjunctiveFacet(facet)) {\n return this;\n }\n\n return this.clearRefinements(facet).setQueryParameters({\n facets: this.facets.filter(function(f) {\n return f !== facet;\n })\n });\n },\n /**\n * Remove a disjunctive facet from the disjunctiveFacets attribute of the\n * helper configuration, if it is present.\n * @method\n * @param {string} facet disjunctive facet name to remove\n * @return {SearchParameters}\n */\n removeDisjunctiveFacet: function removeDisjunctiveFacet(facet) {\n if (!this.isDisjunctiveFacet(facet)) {\n return this;\n }\n\n return this.clearRefinements(facet).setQueryParameters({\n disjunctiveFacets: this.disjunctiveFacets.filter(function(f) {\n return f !== facet;\n })\n });\n },\n /**\n * Remove a hierarchical facet from the hierarchicalFacets attribute of the\n * helper configuration, if it is present.\n * @method\n * @param {string} facet hierarchical facet name to remove\n * @return {SearchParameters}\n */\n removeHierarchicalFacet: function removeHierarchicalFacet(facet) {\n if (!this.isHierarchicalFacet(facet)) {\n return this;\n }\n\n return this.clearRefinements(facet).setQueryParameters({\n hierarchicalFacets: this.hierarchicalFacets.filter(function(f) {\n return f.name !== facet;\n })\n });\n },\n /**\n * Remove a refinement set on facet. If a value is provided, it will clear the\n * refinement for the given value, otherwise it will clear all the refinement\n * values for the faceted attribute.\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {string} [value] value used to filter\n * @return {SearchParameters}\n */\n removeFacetRefinement: function removeFacetRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n if (!RefinementList.isRefined(this.facetsRefinements, facet, value)) return this;\n\n return this.setQueryParameters({\n facetsRefinements: RefinementList.removeRefinement(this.facetsRefinements, facet, value)\n });\n },\n /**\n * Remove a negative refinement on a facet\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {string} value value used to filter\n * @return {SearchParameters}\n */\n removeExcludeRefinement: function removeExcludeRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n if (!RefinementList.isRefined(this.facetsExcludes, facet, value)) return this;\n\n return this.setQueryParameters({\n facetsExcludes: RefinementList.removeRefinement(this.facetsExcludes, facet, value)\n });\n },\n /**\n * Remove a refinement on a disjunctive facet\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {string} value value used to filter\n * @return {SearchParameters}\n */\n removeDisjunctiveFacetRefinement: function removeDisjunctiveFacetRefinement(facet, value) {\n if (!this.isDisjunctiveFacet(facet)) {\n throw new Error(\n facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration');\n }\n if (!RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this;\n\n return this.setQueryParameters({\n disjunctiveFacetsRefinements: RefinementList.removeRefinement(\n this.disjunctiveFacetsRefinements, facet, value)\n });\n },\n /**\n * Remove a tag from the list of tag refinements\n * @method\n * @param {string} tag the tag to remove\n * @return {SearchParameters}\n */\n removeTagRefinement: function removeTagRefinement(tag) {\n if (!this.isTagRefined(tag)) return this;\n\n var modification = {\n tagRefinements: this.tagRefinements.filter(function(t) {\n return t !== tag;\n })\n };\n\n return this.setQueryParameters(modification);\n },\n /**\n * Generic toggle refinement method to use with facet, disjunctive facets\n * and hierarchical facets\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {SearchParameters}\n * @throws will throw an error if the facet is not declared in the settings of the helper\n * @deprecated since version 2.19.0, see {@link SearchParameters#toggleFacetRefinement}\n */\n toggleRefinement: function toggleRefinement(facet, value) {\n return this.toggleFacetRefinement(facet, value);\n },\n /**\n * Generic toggle refinement method to use with facet, disjunctive facets\n * and hierarchical facets\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {SearchParameters}\n * @throws will throw an error if the facet is not declared in the settings of the helper\n */\n toggleFacetRefinement: function toggleFacetRefinement(facet, value) {\n if (this.isHierarchicalFacet(facet)) {\n return this.toggleHierarchicalFacetRefinement(facet, value);\n } else if (this.isConjunctiveFacet(facet)) {\n return this.toggleConjunctiveFacetRefinement(facet, value);\n } else if (this.isDisjunctiveFacet(facet)) {\n return this.toggleDisjunctiveFacetRefinement(facet, value);\n }\n\n throw new Error('Cannot refine the undeclared facet ' + facet +\n '; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets');\n },\n /**\n * Switch the refinement applied over a facet/value\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {SearchParameters}\n */\n toggleConjunctiveFacetRefinement: function toggleConjunctiveFacetRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n\n return this.setQueryParameters({\n facetsRefinements: RefinementList.toggleRefinement(this.facetsRefinements, facet, value)\n });\n },\n /**\n * Switch the refinement applied over a facet/value\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {SearchParameters}\n */\n toggleExcludeFacetRefinement: function toggleExcludeFacetRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n\n return this.setQueryParameters({\n facetsExcludes: RefinementList.toggleRefinement(this.facetsExcludes, facet, value)\n });\n },\n /**\n * Switch the refinement applied over a facet/value\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {SearchParameters}\n */\n toggleDisjunctiveFacetRefinement: function toggleDisjunctiveFacetRefinement(facet, value) {\n if (!this.isDisjunctiveFacet(facet)) {\n throw new Error(\n facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration');\n }\n\n return this.setQueryParameters({\n disjunctiveFacetsRefinements: RefinementList.toggleRefinement(\n this.disjunctiveFacetsRefinements, facet, value)\n });\n },\n /**\n * Switch the refinement applied over a facet/value\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {SearchParameters}\n */\n toggleHierarchicalFacetRefinement: function toggleHierarchicalFacetRefinement(facet, value) {\n if (!this.isHierarchicalFacet(facet)) {\n throw new Error(\n facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration');\n }\n\n var separator = this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(facet));\n\n var mod = {};\n\n var upOneOrMultipleLevel = this.hierarchicalFacetsRefinements[facet] !== undefined &&\n this.hierarchicalFacetsRefinements[facet].length > 0 && (\n // remove current refinement:\n // refinement was 'beer > IPA', call is toggleRefine('beer > IPA'), refinement should be `beer`\n this.hierarchicalFacetsRefinements[facet][0] === value ||\n // remove a parent refinement of the current refinement:\n // - refinement was 'beer > IPA > Flying dog'\n // - call is toggleRefine('beer > IPA')\n // - refinement should be `beer`\n this.hierarchicalFacetsRefinements[facet][0].indexOf(value + separator) === 0\n );\n\n if (upOneOrMultipleLevel) {\n if (value.indexOf(separator) === -1) {\n // go back to root level\n mod[facet] = [];\n } else {\n mod[facet] = [value.slice(0, value.lastIndexOf(separator))];\n }\n } else {\n mod[facet] = [value];\n }\n\n return this.setQueryParameters({\n hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements)\n });\n },\n\n /**\n * Adds a refinement on a hierarchical facet.\n * @param {string} facet the facet name\n * @param {string} path the hierarchical facet path\n * @return {SearchParameter} the new state\n * @throws Error if the facet is not defined or if the facet is refined\n */\n addHierarchicalFacetRefinement: function(facet, path) {\n if (this.isHierarchicalFacetRefined(facet)) {\n throw new Error(facet + ' is already refined.');\n }\n if (!this.isHierarchicalFacet(facet)) {\n throw new Error(facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration.');\n }\n var mod = {};\n mod[facet] = [path];\n return this.setQueryParameters({\n hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements)\n });\n },\n\n /**\n * Removes the refinement set on a hierarchical facet.\n * @param {string} facet the facet name\n * @return {SearchParameter} the new state\n * @throws Error if the facet is not defined or if the facet is not refined\n */\n removeHierarchicalFacetRefinement: function(facet) {\n if (!this.isHierarchicalFacetRefined(facet)) {\n return this;\n }\n var mod = {};\n mod[facet] = [];\n return this.setQueryParameters({\n hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements)\n });\n },\n /**\n * Switch the tag refinement\n * @method\n * @param {string} tag the tag to remove or add\n * @return {SearchParameters}\n */\n toggleTagRefinement: function toggleTagRefinement(tag) {\n if (this.isTagRefined(tag)) {\n return this.removeTagRefinement(tag);\n }\n\n return this.addTagRefinement(tag);\n },\n /**\n * Test if the facet name is from one of the disjunctive facets\n * @method\n * @param {string} facet facet name to test\n * @return {boolean}\n */\n isDisjunctiveFacet: function(facet) {\n return this.disjunctiveFacets.indexOf(facet) > -1;\n },\n /**\n * Test if the facet name is from one of the hierarchical facets\n * @method\n * @param {string} facetName facet name to test\n * @return {boolean}\n */\n isHierarchicalFacet: function(facetName) {\n return this.getHierarchicalFacetByName(facetName) !== undefined;\n },\n /**\n * Test if the facet name is from one of the conjunctive/normal facets\n * @method\n * @param {string} facet facet name to test\n * @return {boolean}\n */\n isConjunctiveFacet: function(facet) {\n return this.facets.indexOf(facet) > -1;\n },\n /**\n * Returns true if the facet is refined, either for a specific value or in\n * general.\n * @method\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} returns true if refined\n */\n isFacetRefined: function isFacetRefined(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n return false;\n }\n return RefinementList.isRefined(this.facetsRefinements, facet, value);\n },\n /**\n * Returns true if the facet contains exclusions or if a specific value is\n * excluded.\n *\n * @method\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} returns true if refined\n */\n isExcludeRefined: function isExcludeRefined(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n return false;\n }\n return RefinementList.isRefined(this.facetsExcludes, facet, value);\n },\n /**\n * Returns true if the facet contains a refinement, or if a value passed is a\n * refinement for the facet.\n * @method\n * @param {string} facet name of the attribute for used for faceting\n * @param {string} value optional, will test if the value is used for refinement\n * if there is one, otherwise will test if the facet contains any refinement\n * @return {boolean}\n */\n isDisjunctiveFacetRefined: function isDisjunctiveFacetRefined(facet, value) {\n if (!this.isDisjunctiveFacet(facet)) {\n return false;\n }\n return RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value);\n },\n /**\n * Returns true if the facet contains a refinement, or if a value passed is a\n * refinement for the facet.\n * @method\n * @param {string} facet name of the attribute for used for faceting\n * @param {string} value optional, will test if the value is used for refinement\n * if there is one, otherwise will test if the facet contains any refinement\n * @return {boolean}\n */\n isHierarchicalFacetRefined: function isHierarchicalFacetRefined(facet, value) {\n if (!this.isHierarchicalFacet(facet)) {\n return false;\n }\n\n var refinements = this.getHierarchicalRefinement(facet);\n\n if (!value) {\n return refinements.length > 0;\n }\n\n return refinements.indexOf(value) !== -1;\n },\n /**\n * Test if the triple (attribute, operator, value) is already refined.\n * If only the attribute and the operator are provided, it tests if the\n * contains any refinement value.\n * @method\n * @param {string} attribute attribute for which the refinement is applied\n * @param {string} [operator] operator of the refinement\n * @param {string} [value] value of the refinement\n * @return {boolean} true if it is refined\n */\n isNumericRefined: function isNumericRefined(attribute, operator, value) {\n if (value === undefined && operator === undefined) {\n return !!this.numericRefinements[attribute];\n }\n\n var isOperatorDefined =\n this.numericRefinements[attribute] &&\n this.numericRefinements[attribute][operator] !== undefined;\n\n if (value === undefined || !isOperatorDefined) {\n return isOperatorDefined;\n }\n\n var parsedValue = valToNumber(value);\n var isAttributeValueDefined =\n findArray(this.numericRefinements[attribute][operator], parsedValue) !==\n undefined;\n\n return isOperatorDefined && isAttributeValueDefined;\n },\n /**\n * Returns true if the tag refined, false otherwise\n * @method\n * @param {string} tag the tag to check\n * @return {boolean}\n */\n isTagRefined: function isTagRefined(tag) {\n return this.tagRefinements.indexOf(tag) !== -1;\n },\n /**\n * Returns the list of all disjunctive facets refined\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {string[]}\n */\n getRefinedDisjunctiveFacets: function getRefinedDisjunctiveFacets() {\n var self = this;\n\n // attributes used for numeric filter can also be disjunctive\n var disjunctiveNumericRefinedFacets = intersection(\n Object.keys(this.numericRefinements).filter(function(facet) {\n return Object.keys(self.numericRefinements[facet]).length > 0;\n }),\n this.disjunctiveFacets\n );\n\n return Object.keys(this.disjunctiveFacetsRefinements).filter(function(facet) {\n return self.disjunctiveFacetsRefinements[facet].length > 0;\n })\n .concat(disjunctiveNumericRefinedFacets)\n .concat(this.getRefinedHierarchicalFacets());\n },\n /**\n * Returns the list of all disjunctive facets refined\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {string[]}\n */\n getRefinedHierarchicalFacets: function getRefinedHierarchicalFacets() {\n var self = this;\n return intersection(\n // enforce the order between the two arrays,\n // so that refinement name index === hierarchical facet index\n this.hierarchicalFacets.map(function(facet) { return facet.name; }),\n Object.keys(this.hierarchicalFacetsRefinements).filter(function(facet) {\n return self.hierarchicalFacetsRefinements[facet].length > 0;\n })\n );\n },\n /**\n * Returned the list of all disjunctive facets not refined\n * @method\n * @return {string[]}\n */\n getUnrefinedDisjunctiveFacets: function() {\n var refinedFacets = this.getRefinedDisjunctiveFacets();\n\n return this.disjunctiveFacets.filter(function(f) {\n return refinedFacets.indexOf(f) === -1;\n });\n },\n\n managedParameters: [\n 'index',\n 'facets', 'disjunctiveFacets', 'facetsRefinements',\n 'facetsExcludes', 'disjunctiveFacetsRefinements',\n 'numericRefinements', 'tagRefinements', 'hierarchicalFacets', 'hierarchicalFacetsRefinements'\n ],\n getQueryParams: function getQueryParams() {\n var managedParameters = this.managedParameters;\n\n var queryParams = {};\n\n var self = this;\n Object.keys(this).forEach(function(paramName) {\n var paramValue = self[paramName];\n if (managedParameters.indexOf(paramName) === -1 && paramValue !== undefined) {\n queryParams[paramName] = paramValue;\n }\n });\n\n return queryParams;\n },\n /**\n * Let the user set a specific value for a given parameter. Will return the\n * same instance if the parameter is invalid or if the value is the same as the\n * previous one.\n * @method\n * @param {string} parameter the parameter name\n * @param {any} value the value to be set, must be compliant with the definition\n * of the attribute on the object\n * @return {SearchParameters} the updated state\n */\n setQueryParameter: function setParameter(parameter, value) {\n if (this[parameter] === value) return this;\n\n var modification = {};\n\n modification[parameter] = value;\n\n return this.setQueryParameters(modification);\n },\n /**\n * Let the user set any of the parameters with a plain object.\n * @method\n * @param {object} params all the keys and the values to be updated\n * @return {SearchParameters} a new updated instance\n */\n setQueryParameters: function setQueryParameters(params) {\n if (!params) return this;\n\n var error = SearchParameters.validate(this, params);\n\n if (error) {\n throw error;\n }\n\n var self = this;\n var nextWithNumbers = SearchParameters._parseNumbers(params);\n var previousPlainObject = Object.keys(this).reduce(function(acc, key) {\n acc[key] = self[key];\n return acc;\n }, {});\n\n var nextPlainObject = Object.keys(nextWithNumbers).reduce(\n function(previous, key) {\n var isPreviousValueDefined = previous[key] !== undefined;\n var isNextValueDefined = nextWithNumbers[key] !== undefined;\n\n if (isPreviousValueDefined && !isNextValueDefined) {\n return omit(previous, [key]);\n }\n\n if (isNextValueDefined) {\n previous[key] = nextWithNumbers[key];\n }\n\n return previous;\n },\n previousPlainObject\n );\n\n return new this.constructor(nextPlainObject);\n },\n\n /**\n * Returns a new instance with the page reset. Two scenarios possible:\n * the page is omitted -> return the given instance\n * the page is set -> return a new instance with a page of 0\n * @return {SearchParameters} a new updated instance\n */\n resetPage: function() {\n if (this.page === undefined) {\n return this;\n }\n\n return this.setPage(0);\n },\n\n /**\n * Helper function to get the hierarchicalFacet separator or the default one (`>`)\n * @param {object} hierarchicalFacet\n * @return {string} returns the hierarchicalFacet.separator or `>` as default\n */\n _getHierarchicalFacetSortBy: function(hierarchicalFacet) {\n return hierarchicalFacet.sortBy || ['isRefined:desc', 'name:asc'];\n },\n\n /**\n * Helper function to get the hierarchicalFacet separator or the default one (`>`)\n * @private\n * @param {object} hierarchicalFacet\n * @return {string} returns the hierarchicalFacet.separator or `>` as default\n */\n _getHierarchicalFacetSeparator: function(hierarchicalFacet) {\n return hierarchicalFacet.separator || ' > ';\n },\n\n /**\n * Helper function to get the hierarchicalFacet prefix path or null\n * @private\n * @param {object} hierarchicalFacet\n * @return {string} returns the hierarchicalFacet.rootPath or null as default\n */\n _getHierarchicalRootPath: function(hierarchicalFacet) {\n return hierarchicalFacet.rootPath || null;\n },\n\n /**\n * Helper function to check if we show the parent level of the hierarchicalFacet\n * @private\n * @param {object} hierarchicalFacet\n * @return {string} returns the hierarchicalFacet.showParentLevel or true as default\n */\n _getHierarchicalShowParentLevel: function(hierarchicalFacet) {\n if (typeof hierarchicalFacet.showParentLevel === 'boolean') {\n return hierarchicalFacet.showParentLevel;\n }\n return true;\n },\n\n /**\n * Helper function to get the hierarchicalFacet by it's name\n * @param {string} hierarchicalFacetName\n * @return {object} a hierarchicalFacet\n */\n getHierarchicalFacetByName: function(hierarchicalFacetName) {\n return find(\n this.hierarchicalFacets,\n function(f) {\n return f.name === hierarchicalFacetName;\n }\n );\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.<string>} the path as an array of string\n */\n getHierarchicalFacetBreadcrumb: function(facetName) {\n if (!this.isHierarchicalFacet(facetName)) {\n return [];\n }\n\n var refinement = this.getHierarchicalRefinement(facetName)[0];\n if (!refinement) return [];\n\n var separator = this._getHierarchicalFacetSeparator(\n this.getHierarchicalFacetByName(facetName)\n );\n var path = refinement.split(separator);\n return path.map(function(part) {\n return part.trim();\n });\n },\n\n toString: function() {\n return JSON.stringify(this, null, 2);\n }\n};\n\n/**\n * Callback used for clearRefinement method\n * @callback SearchParameters.clearCallback\n * @param {OperatorList|FacetList} value the value of the filter\n * @param {string} key the current attribute name\n * @param {string} type `numeric`, `disjunctiveFacet`, `conjunctiveFacet`, `hierarchicalFacet` or `exclude`\n * depending on the type of facet\n * @return {boolean} `true` if the element should be removed. `false` otherwise.\n */\nmodule.exports = SearchParameters;\n","'use strict';\n\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined;\n var valIsNull = value === null;\n\n var othIsDefined = other !== undefined;\n var othIsNull = other === null;\n\n if (\n (!othIsNull && value > other) ||\n (valIsNull && othIsDefined) ||\n !valIsDefined\n ) {\n return 1;\n }\n if (\n (!valIsNull && value < other) ||\n (othIsNull && valIsDefined) ||\n !othIsDefined\n ) {\n return -1;\n }\n }\n return 0;\n}\n\n/**\n * @param {Array<object>} collection object with keys in attributes\n * @param {Array<string>} iteratees attributes\n * @param {Array<string>} orders asc | desc\n */\nfunction orderBy(collection, iteratees, orders) {\n if (!Array.isArray(collection)) {\n return [];\n }\n\n if (!Array.isArray(orders)) {\n orders = [];\n }\n\n var result = collection.map(function(value, index) {\n return {\n criteria: iteratees.map(function(iteratee) {\n return value[iteratee];\n }),\n index: index,\n value: value\n };\n });\n\n result.sort(function comparer(object, other) {\n var index = -1;\n\n while (++index < object.criteria.length) {\n var res = compareAscending(object.criteria[index], other.criteria[index]);\n if (res) {\n if (index >= orders.length) {\n return res;\n }\n if (orders[index] === 'desc') {\n return -res;\n }\n return res;\n }\n }\n\n // This ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n });\n\n return result.map(function(res) {\n return res.value;\n });\n}\n\nmodule.exports = orderBy;\n","'use strict';\n\nmodule.exports = function compact(array) {\n if (!Array.isArray(array)) {\n return [];\n }\n\n return array.filter(Boolean);\n};\n","'use strict';\n\n// @MAJOR can be replaced by native Array#findIndex when we change support\nmodule.exports = function find(array, comparator) {\n if (!Array.isArray(array)) {\n return -1;\n }\n\n for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return i;\n }\n }\n return -1;\n};\n","'use strict';\n\nvar find = require('./find');\n\n/**\n * Transform sort format from user friendly notation to lodash format\n * @param {string[]} sortBy array of predicate of the form \"attribute:order\"\n * @param {string[]} [defaults] array of predicate of the form \"attribute:order\"\n * @return {array.<string[]>} array containing 2 elements : attributes, orders\n */\nmodule.exports = function formatSort(sortBy, defaults) {\n var defaultInstructions = (defaults || []).map(function(sort) {\n return sort.split(':');\n });\n\n return sortBy.reduce(\n function preparePredicate(out, sort) {\n var sortInstruction = sort.split(':');\n\n var matchingDefault = find(defaultInstructions, function(\n defaultInstruction\n ) {\n return defaultInstruction[0] === sortInstruction[0];\n });\n\n if (sortInstruction.length > 1 || !matchingDefault) {\n out[0].push(sortInstruction[0]);\n out[1].push(sortInstruction[1]);\n return out;\n }\n\n out[0].push(matchingDefault[0]);\n out[1].push(matchingDefault[1]);\n return out;\n },\n [[], []]\n );\n};\n","'use strict';\n\nmodule.exports = generateTrees;\n\nvar orderBy = require('../functions/orderBy');\nvar find = require('../functions/find');\nvar prepareHierarchicalFacetSortBy = require('../functions/formatSort');\n\nfunction generateTrees(state) {\n return function generate(hierarchicalFacetResult, hierarchicalFacetIndex) {\n var hierarchicalFacet = state.hierarchicalFacets[hierarchicalFacetIndex];\n var hierarchicalFacetRefinement =\n (state.hierarchicalFacetsRefinements[hierarchicalFacet.name] &&\n state.hierarchicalFacetsRefinements[hierarchicalFacet.name][0]) ||\n '';\n var hierarchicalSeparator = state._getHierarchicalFacetSeparator(\n hierarchicalFacet\n );\n var hierarchicalRootPath = state._getHierarchicalRootPath(\n hierarchicalFacet\n );\n var hierarchicalShowParentLevel = state._getHierarchicalShowParentLevel(\n hierarchicalFacet\n );\n var sortBy = prepareHierarchicalFacetSortBy(\n state._getHierarchicalFacetSortBy(hierarchicalFacet)\n );\n\n var rootExhaustive = hierarchicalFacetResult.every(function(facetResult) {\n return facetResult.exhaustive;\n });\n\n var generateTreeFn = generateHierarchicalTree(\n sortBy,\n hierarchicalSeparator,\n hierarchicalRootPath,\n hierarchicalShowParentLevel,\n hierarchicalFacetRefinement\n );\n\n var results = hierarchicalFacetResult;\n\n if (hierarchicalRootPath) {\n results = hierarchicalFacetResult.slice(\n hierarchicalRootPath.split(hierarchicalSeparator).length\n );\n }\n\n return results.reduce(generateTreeFn, {\n name: state.hierarchicalFacets[hierarchicalFacetIndex].name,\n count: null, // root level, no count\n isRefined: true, // root level, always refined\n path: null, // root level, no path\n exhaustive: rootExhaustive,\n data: null\n });\n };\n}\n\nfunction generateHierarchicalTree(\n sortBy,\n hierarchicalSeparator,\n hierarchicalRootPath,\n hierarchicalShowParentLevel,\n currentRefinement\n) {\n return function generateTree(\n hierarchicalTree,\n hierarchicalFacetResult,\n currentHierarchicalLevel\n ) {\n var parent = hierarchicalTree;\n\n if (currentHierarchicalLevel > 0) {\n var level = 0;\n\n parent = hierarchicalTree;\n\n while (level < currentHierarchicalLevel) {\n /**\n * @type {object[]]} hierarchical data\n */\n var data = parent && Array.isArray(parent.data) ? parent.data : [];\n parent = find(data, function(subtree) {\n return subtree.isRefined;\n });\n level++;\n }\n }\n\n // we found a refined parent, let's add current level data under it\n if (parent) {\n // filter values in case an object has multiple categories:\n // {\n // categories: {\n // level0: ['beers', 'bières'],\n // level1: ['beers > IPA', 'bières > Belges']\n // }\n // }\n //\n // If parent refinement is `beers`, then we do not want to have `bières > Belges`\n // showing up\n\n var picked = Object.keys(hierarchicalFacetResult.data)\n .map(function(facetValue) {\n return [facetValue, hierarchicalFacetResult.data[facetValue]];\n })\n .filter(function(tuple) {\n var facetValue = tuple[0];\n return onlyMatchingTree(\n facetValue,\n parent.path || hierarchicalRootPath,\n currentRefinement,\n hierarchicalSeparator,\n hierarchicalRootPath,\n hierarchicalShowParentLevel\n );\n });\n\n parent.data = orderBy(\n picked.map(function(tuple) {\n var facetValue = tuple[0];\n var facetCount = tuple[1];\n\n return format(\n facetCount,\n facetValue,\n hierarchicalSeparator,\n currentRefinement,\n hierarchicalFacetResult.exhaustive\n );\n }),\n sortBy[0],\n sortBy[1]\n );\n }\n\n return hierarchicalTree;\n };\n}\n\nfunction onlyMatchingTree(\n facetValue,\n parentPath,\n currentRefinement,\n hierarchicalSeparator,\n hierarchicalRootPath,\n hierarchicalShowParentLevel\n) {\n // we want the facetValue is a child of hierarchicalRootPath\n if (\n hierarchicalRootPath &&\n (facetValue.indexOf(hierarchicalRootPath) !== 0 ||\n hierarchicalRootPath === facetValue)\n ) {\n return false;\n }\n\n // we always want root levels (only when there is no prefix path)\n return (\n (!hierarchicalRootPath &&\n facetValue.indexOf(hierarchicalSeparator) === -1) ||\n // if there is a rootPath, being root level mean 1 level under rootPath\n (hierarchicalRootPath &&\n facetValue.split(hierarchicalSeparator).length -\n hierarchicalRootPath.split(hierarchicalSeparator).length ===\n 1) ||\n // if current refinement is a root level and current facetValue is a root level,\n // keep the facetValue\n (facetValue.indexOf(hierarchicalSeparator) === -1 &&\n currentRefinement.indexOf(hierarchicalSeparator) === -1) ||\n // currentRefinement is a child of the facet value\n currentRefinement.indexOf(facetValue) === 0 ||\n // facetValue is a child of the current parent, add it\n (facetValue.indexOf(parentPath + hierarchicalSeparator) === 0 &&\n (hierarchicalShowParentLevel ||\n facetValue.indexOf(currentRefinement) === 0))\n );\n}\n\nfunction format(\n facetCount,\n facetValue,\n hierarchicalSeparator,\n currentRefinement,\n exhaustive\n) {\n var parts = facetValue.split(hierarchicalSeparator);\n return {\n name: parts[parts.length - 1].trim(),\n path: facetValue,\n count: facetCount,\n isRefined:\n currentRefinement === facetValue ||\n currentRefinement.indexOf(facetValue + hierarchicalSeparator) === 0,\n exhaustive: exhaustive,\n data: null\n };\n}\n","'use strict';\n\nvar merge = require('../functions/merge');\nvar defaultsPure = require('../functions/defaultsPure');\nvar orderBy = require('../functions/orderBy');\nvar compact = require('../functions/compact');\nvar find = require('../functions/find');\nvar findIndex = require('../functions/findIndex');\nvar formatSort = require('../functions/formatSort');\n\nvar generateHierarchicalTree = require('./generate-hierarchical-tree');\n\n/**\n * @typedef SearchResults.Facet\n * @type {object}\n * @property {string} name name of the attribute in the record\n * @property {object} data the faceting data: value, number of entries\n * @property {object} stats undefined unless facet_stats is retrieved from algolia\n */\n\n/**\n * @typedef SearchResults.HierarchicalFacet\n * @type {object}\n * @property {string} name name of the current value given the hierarchical level, trimmed.\n * If root node, you get the facet name\n * @property {number} count number of objects matching this hierarchical value\n * @property {string} path the current hierarchical value full path\n * @property {boolean} isRefined `true` if the current value was refined, `false` otherwise\n * @property {HierarchicalFacet[]} data sub values for the current level\n */\n\n/**\n * @typedef SearchResults.FacetValue\n * @type {object}\n * @property {string} name the facet value itself\n * @property {number} count times this facet appears in the results\n * @property {boolean} isRefined is the facet currently selected\n * @property {boolean} isExcluded is the facet currently excluded (only for conjunctive facets)\n */\n\n/**\n * @typedef Refinement\n * @type {object}\n * @property {string} type the type of filter used:\n * `numeric`, `facet`, `exclude`, `disjunctive`, `hierarchical`\n * @property {string} attributeName name of the attribute used for filtering\n * @property {string} name the value of the filter\n * @property {number} numericValue the value as a number. Only for numeric filters.\n * @property {string} operator the operator used. Only for numeric filters.\n * @property {number} count the number of computed hits for this filter. Only on facets.\n * @property {boolean} exhaustive if the count is exhaustive\n */\n\n/**\n * @param {string[]} attributes\n */\nfunction getIndices(attributes) {\n var indices = {};\n\n attributes.forEach(function(val, idx) {\n indices[val] = idx;\n });\n\n return indices;\n}\n\nfunction assignFacetStats(dest, facetStats, key) {\n if (facetStats && facetStats[key]) {\n dest.stats = facetStats[key];\n }\n}\n\n/**\n * @typedef {Object} HierarchicalFacet\n * @property {string} name\n * @property {string[]} attributes\n */\n\n/**\n * @param {HierarchicalFacet[]} hierarchicalFacets\n * @param {string} hierarchicalAttributeName\n */\nfunction findMatchingHierarchicalFacetFromAttributeName(\n hierarchicalFacets,\n hierarchicalAttributeName\n) {\n return find(hierarchicalFacets, function facetKeyMatchesAttribute(\n hierarchicalFacet\n ) {\n var facetNames = hierarchicalFacet.attributes || [];\n return facetNames.indexOf(hierarchicalAttributeName) > -1;\n });\n}\n\n/*eslint-disable */\n/**\n * Constructor for SearchResults\n * @class\n * @classdesc SearchResults contains the results of a query to Algolia using the\n * {@link AlgoliaSearchHelper}.\n * @param {SearchParameters} state state that led to the response\n * @param {array.<object>} results the results from algolia client\n * @example <caption>SearchResults of the first query in\n * <a href=\"http://demos.algolia.com/instant-search-demo\">the instant search demo</a></caption>\n{\n \"hitsPerPage\": 10,\n \"processingTimeMS\": 2,\n \"facets\": [\n {\n \"name\": \"type\",\n \"data\": {\n \"HardGood\": 6627,\n \"BlackTie\": 550,\n \"Music\": 665,\n \"Software\": 131,\n \"Game\": 456,\n \"Movie\": 1571\n },\n \"exhaustive\": false\n },\n {\n \"exhaustive\": false,\n \"data\": {\n \"Free shipping\": 5507\n },\n \"name\": \"shipping\"\n }\n ],\n \"hits\": [\n {\n \"thumbnailImage\": \"http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_54x108_s.gif\",\n \"_highlightResult\": {\n \"shortDescription\": {\n \"matchLevel\": \"none\",\n \"value\": \"Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection\",\n \"matchedWords\": []\n },\n \"category\": {\n \"matchLevel\": \"none\",\n \"value\": \"Computer Security Software\",\n \"matchedWords\": []\n },\n \"manufacturer\": {\n \"matchedWords\": [],\n \"value\": \"Webroot\",\n \"matchLevel\": \"none\"\n },\n \"name\": {\n \"value\": \"Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows\",\n \"matchedWords\": [],\n \"matchLevel\": \"none\"\n }\n },\n \"image\": \"http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_105x210_sc.jpg\",\n \"shipping\": \"Free shipping\",\n \"bestSellingRank\": 4,\n \"shortDescription\": \"Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection\",\n \"url\": \"http://www.bestbuy.com/site/webroot-secureanywhere-internet-security-3-devi…d=1219060687969&skuId=1688832&cmp=RMX&ky=2d3GfEmNIzjA0vkzveHdZEBgpPCyMnLTJ\",\n \"name\": \"Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows\",\n \"category\": \"Computer Security Software\",\n \"salePrice_range\": \"1 - 50\",\n \"objectID\": \"1688832\",\n \"type\": \"Software\",\n \"customerReviewCount\": 5980,\n \"salePrice\": 49.99,\n \"manufacturer\": \"Webroot\"\n },\n ....\n ],\n \"nbHits\": 10000,\n \"disjunctiveFacets\": [\n {\n \"exhaustive\": false,\n \"data\": {\n \"5\": 183,\n \"12\": 112,\n \"7\": 149,\n ...\n },\n \"name\": \"customerReviewCount\",\n \"stats\": {\n \"max\": 7461,\n \"avg\": 157.939,\n \"min\": 1\n }\n },\n {\n \"data\": {\n \"Printer Ink\": 142,\n \"Wireless Speakers\": 60,\n \"Point & Shoot Cameras\": 48,\n ...\n },\n \"name\": \"category\",\n \"exhaustive\": false\n },\n {\n \"exhaustive\": false,\n \"data\": {\n \"> 5000\": 2,\n \"1 - 50\": 6524,\n \"501 - 2000\": 566,\n \"201 - 500\": 1501,\n \"101 - 200\": 1360,\n \"2001 - 5000\": 47\n },\n \"name\": \"salePrice_range\"\n },\n {\n \"data\": {\n \"Dynexâ„¢\": 202,\n \"Insigniaâ„¢\": 230,\n \"PNY\": 72,\n ...\n },\n \"name\": \"manufacturer\",\n \"exhaustive\": false\n }\n ],\n \"query\": \"\",\n \"nbPages\": 100,\n \"page\": 0,\n \"index\": \"bestbuy\"\n}\n **/\n/*eslint-enable */\nfunction SearchResults(state, results) {\n var mainSubResponse = results[0];\n\n this._rawResults = results;\n\n /**\n * query used to generate the results\n * @member {string}\n */\n this.query = mainSubResponse.query;\n /**\n * The query as parsed by the engine given all the rules.\n * @member {string}\n */\n this.parsedQuery = mainSubResponse.parsedQuery;\n /**\n * all the records that match the search parameters. Each record is\n * augmented with a new attribute `_highlightResult`\n * which is an object keyed by attribute and with the following properties:\n * - `value` : the value of the facet highlighted (html)\n * - `matchLevel`: full, partial or none depending on how the query terms match\n * @member {object[]}\n */\n this.hits = mainSubResponse.hits;\n /**\n * index where the results come from\n * @member {string}\n */\n this.index = mainSubResponse.index;\n /**\n * number of hits per page requested\n * @member {number}\n */\n this.hitsPerPage = mainSubResponse.hitsPerPage;\n /**\n * total number of hits of this query on the index\n * @member {number}\n */\n this.nbHits = mainSubResponse.nbHits;\n /**\n * total number of pages with respect to the number of hits per page and the total number of hits\n * @member {number}\n */\n this.nbPages = mainSubResponse.nbPages;\n /**\n * current page\n * @member {number}\n */\n this.page = mainSubResponse.page;\n /**\n * sum of the processing time of all the queries\n * @member {number}\n */\n this.processingTimeMS = results.reduce(function(sum, result) {\n return result.processingTimeMS === undefined\n ? sum\n : sum + result.processingTimeMS;\n }, 0);\n /**\n * The position if the position was guessed by IP.\n * @member {string}\n * @example \"48.8637,2.3615\",\n */\n this.aroundLatLng = mainSubResponse.aroundLatLng;\n /**\n * The radius computed by Algolia.\n * @member {string}\n * @example \"126792922\",\n */\n this.automaticRadius = mainSubResponse.automaticRadius;\n /**\n * String identifying the server used to serve this request.\n *\n * getRankingInfo needs to be set to `true` for this to be returned\n *\n * @member {string}\n * @example \"c7-use-2.algolia.net\",\n */\n this.serverUsed = mainSubResponse.serverUsed;\n /**\n * Boolean that indicates if the computation of the counts did time out.\n * @deprecated\n * @member {boolean}\n */\n this.timeoutCounts = mainSubResponse.timeoutCounts;\n /**\n * Boolean that indicates if the computation of the hits did time out.\n * @deprecated\n * @member {boolean}\n */\n this.timeoutHits = mainSubResponse.timeoutHits;\n\n /**\n * True if the counts of the facets is exhaustive\n * @member {boolean}\n */\n this.exhaustiveFacetsCount = mainSubResponse.exhaustiveFacetsCount;\n\n /**\n * True if the number of hits is exhaustive\n * @member {boolean}\n */\n this.exhaustiveNbHits = mainSubResponse.exhaustiveNbHits;\n\n\n /**\n * Contains the userData if they are set by a [query rule](https://www.algolia.com/doc/guides/query-rules/query-rules-overview/).\n * @member {object[]}\n */\n this.userData = mainSubResponse.userData;\n\n /**\n * queryID is the unique identifier of the query used to generate the current search results.\n * This value is only available if the `clickAnalytics` search parameter is set to `true`.\n * @member {string}\n */\n this.queryID = mainSubResponse.queryID;\n\n /**\n * disjunctive facets results\n * @member {SearchResults.Facet[]}\n */\n this.disjunctiveFacets = [];\n /**\n * disjunctive facets results\n * @member {SearchResults.HierarchicalFacet[]}\n */\n this.hierarchicalFacets = state.hierarchicalFacets.map(function initFutureTree() {\n return [];\n });\n /**\n * other facets results\n * @member {SearchResults.Facet[]}\n */\n this.facets = [];\n\n var disjunctiveFacets = state.getRefinedDisjunctiveFacets();\n\n var facetsIndices = getIndices(state.facets);\n var disjunctiveFacetsIndices = getIndices(state.disjunctiveFacets);\n var nextDisjunctiveResult = 1;\n\n var self = this;\n // Since we send request only for disjunctive facets that have been refined,\n // we get the facets information from the first, general, response.\n\n var mainFacets = mainSubResponse.facets || {};\n\n Object.keys(mainFacets).forEach(function(facetKey) {\n var facetValueObject = mainFacets[facetKey];\n\n var hierarchicalFacet = findMatchingHierarchicalFacetFromAttributeName(\n state.hierarchicalFacets,\n facetKey\n );\n\n if (hierarchicalFacet) {\n // Place the hierarchicalFacet data at the correct index depending on\n // the attributes order that was defined at the helper initialization\n var facetIndex = hierarchicalFacet.attributes.indexOf(facetKey);\n var idxAttributeName = findIndex(state.hierarchicalFacets, function(f) {\n return f.name === hierarchicalFacet.name;\n });\n self.hierarchicalFacets[idxAttributeName][facetIndex] = {\n attribute: facetKey,\n data: facetValueObject,\n exhaustive: mainSubResponse.exhaustiveFacetsCount\n };\n } else {\n var isFacetDisjunctive = state.disjunctiveFacets.indexOf(facetKey) !== -1;\n var isFacetConjunctive = state.facets.indexOf(facetKey) !== -1;\n var position;\n\n if (isFacetDisjunctive) {\n position = disjunctiveFacetsIndices[facetKey];\n self.disjunctiveFacets[position] = {\n name: facetKey,\n data: facetValueObject,\n exhaustive: mainSubResponse.exhaustiveFacetsCount\n };\n assignFacetStats(self.disjunctiveFacets[position], mainSubResponse.facets_stats, facetKey);\n }\n if (isFacetConjunctive) {\n position = facetsIndices[facetKey];\n self.facets[position] = {\n name: facetKey,\n data: facetValueObject,\n exhaustive: mainSubResponse.exhaustiveFacetsCount\n };\n assignFacetStats(self.facets[position], mainSubResponse.facets_stats, facetKey);\n }\n }\n });\n\n // Make sure we do not keep holes within the hierarchical facets\n this.hierarchicalFacets = compact(this.hierarchicalFacets);\n\n // aggregate the refined disjunctive facets\n disjunctiveFacets.forEach(function(disjunctiveFacet) {\n var result = results[nextDisjunctiveResult];\n var facets = result && result.facets ? result.facets : {};\n var hierarchicalFacet = state.getHierarchicalFacetByName(disjunctiveFacet);\n\n // There should be only item in facets.\n Object.keys(facets).forEach(function(dfacet) {\n var facetResults = facets[dfacet];\n\n var position;\n\n if (hierarchicalFacet) {\n position = findIndex(state.hierarchicalFacets, function(f) {\n return f.name === hierarchicalFacet.name;\n });\n var attributeIndex = findIndex(self.hierarchicalFacets[position], function(f) {\n return f.attribute === dfacet;\n });\n\n // previous refinements and no results so not able to find it\n if (attributeIndex === -1) {\n return;\n }\n\n self.hierarchicalFacets[position][attributeIndex].data = merge(\n {},\n self.hierarchicalFacets[position][attributeIndex].data,\n facetResults\n );\n } else {\n position = disjunctiveFacetsIndices[dfacet];\n\n var dataFromMainRequest = mainSubResponse.facets && mainSubResponse.facets[dfacet] || {};\n\n self.disjunctiveFacets[position] = {\n name: dfacet,\n data: defaultsPure({}, facetResults, dataFromMainRequest),\n exhaustive: result.exhaustiveFacetsCount\n };\n assignFacetStats(self.disjunctiveFacets[position], result.facets_stats, dfacet);\n\n if (state.disjunctiveFacetsRefinements[dfacet]) {\n state.disjunctiveFacetsRefinements[dfacet].forEach(function(refinementValue) {\n // add the disjunctive refinements if it is no more retrieved\n if (!self.disjunctiveFacets[position].data[refinementValue] &&\n state.disjunctiveFacetsRefinements[dfacet].indexOf(refinementValue) > -1) {\n self.disjunctiveFacets[position].data[refinementValue] = 0;\n }\n });\n }\n }\n });\n nextDisjunctiveResult++;\n });\n\n // if we have some root level values for hierarchical facets, merge them\n state.getRefinedHierarchicalFacets().forEach(function(refinedFacet) {\n var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet);\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n var currentRefinement = state.getHierarchicalRefinement(refinedFacet);\n // if we are already at a root refinement (or no refinement at all), there is no\n // root level values request\n if (currentRefinement.length === 0 || currentRefinement[0].split(separator).length < 2) {\n return;\n }\n\n var result = results[nextDisjunctiveResult];\n var facets = result && result.facets\n ? result.facets\n : {};\n Object.keys(facets).forEach(function(dfacet) {\n var facetResults = facets[dfacet];\n var position = findIndex(state.hierarchicalFacets, function(f) {\n return f.name === hierarchicalFacet.name;\n });\n var attributeIndex = findIndex(self.hierarchicalFacets[position], function(f) {\n return f.attribute === dfacet;\n });\n\n // previous refinements and no results so not able to find it\n if (attributeIndex === -1) {\n return;\n }\n\n // when we always get root levels, if the hits refinement is `beers > IPA` (count: 5),\n // then the disjunctive values will be `beers` (count: 100),\n // but we do not want to display\n // | beers (100)\n // > IPA (5)\n // We want\n // | beers (5)\n // > IPA (5)\n var defaultData = {};\n\n if (currentRefinement.length > 0) {\n var root = currentRefinement[0].split(separator)[0];\n defaultData[root] = self.hierarchicalFacets[position][attributeIndex].data[root];\n }\n\n self.hierarchicalFacets[position][attributeIndex].data = defaultsPure(\n defaultData,\n facetResults,\n self.hierarchicalFacets[position][attributeIndex].data\n );\n });\n\n nextDisjunctiveResult++;\n });\n\n // add the excludes\n Object.keys(state.facetsExcludes).forEach(function(facetName) {\n var excludes = state.facetsExcludes[facetName];\n var position = facetsIndices[facetName];\n\n self.facets[position] = {\n name: facetName,\n data: mainSubResponse.facets[facetName],\n exhaustive: mainSubResponse.exhaustiveFacetsCount\n };\n excludes.forEach(function(facetValue) {\n self.facets[position] = self.facets[position] || {name: facetName};\n self.facets[position].data = self.facets[position].data || {};\n self.facets[position].data[facetValue] = 0;\n });\n });\n\n /**\n * @type {Array}\n */\n this.hierarchicalFacets = this.hierarchicalFacets.map(generateHierarchicalTree(state));\n\n /**\n * @type {Array}\n */\n this.facets = compact(this.facets);\n /**\n * @type {Array}\n */\n this.disjunctiveFacets = compact(this.disjunctiveFacets);\n\n this._state = state;\n}\n\n/**\n * Get a facet object with its name\n * @deprecated\n * @param {string} name name of the faceted attribute\n * @return {SearchResults.Facet} the facet object\n */\nSearchResults.prototype.getFacetByName = function(name) {\n function predicate(facet) {\n return facet.name === name;\n }\n\n return find(this.facets, predicate) ||\n find(this.disjunctiveFacets, predicate) ||\n find(this.hierarchicalFacets, predicate);\n};\n\n/**\n * Get the facet values of a specified attribute from a SearchResults object.\n * @private\n * @param {SearchResults} results the search results to search in\n * @param {string} attribute name of the faceted attribute to search for\n * @return {array|object} facet values. For the hierarchical facets it is an object.\n */\nfunction extractNormalizedFacetValues(results, attribute) {\n function predicate(facet) {\n return facet.name === attribute;\n }\n\n if (results._state.isConjunctiveFacet(attribute)) {\n var facet = find(results.facets, predicate);\n if (!facet) return [];\n\n return Object.keys(facet.data).map(function(name) {\n return {\n name: name,\n count: facet.data[name],\n isRefined: results._state.isFacetRefined(attribute, name),\n isExcluded: results._state.isExcludeRefined(attribute, name)\n };\n });\n } else if (results._state.isDisjunctiveFacet(attribute)) {\n var disjunctiveFacet = find(results.disjunctiveFacets, predicate);\n if (!disjunctiveFacet) return [];\n\n return Object.keys(disjunctiveFacet.data).map(function(name) {\n return {\n name: name,\n count: disjunctiveFacet.data[name],\n isRefined: results._state.isDisjunctiveFacetRefined(attribute, name)\n };\n });\n } else if (results._state.isHierarchicalFacet(attribute)) {\n return find(results.hierarchicalFacets, predicate);\n }\n}\n\n/**\n * Sort nodes of a hierarchical facet results\n * @private\n * @param {HierarchicalFacet} node node to upon which we want to apply the sort\n */\nfunction recSort(sortFn, node) {\n if (!node.data || node.data.length === 0) {\n return node;\n }\n\n var children = node.data.map(function(childNode) {\n return recSort(sortFn, childNode);\n });\n var sortedChildren = sortFn(children);\n var newNode = merge({}, node, {data: sortedChildren});\n return newNode;\n}\n\nSearchResults.DEFAULT_SORT = ['isRefined:desc', 'count:desc', 'name:asc'];\n\nfunction vanillaSortFn(order, data) {\n return data.sort(order);\n}\n\n/**\n * Get a the list of values for a given facet attribute. Those values are sorted\n * refinement first, descending count (bigger value on top), and name ascending\n * (alphabetical order). The sort formula can overridden using either string based\n * predicates or a function.\n *\n * This method will return all the values returned by the Algolia engine plus all\n * the values already refined. This means that it can happen that the\n * `maxValuesPerFacet` [configuration](https://www.algolia.com/doc/rest-api/search#param-maxValuesPerFacet)\n * might not be respected if you have facet values that are already refined.\n * @param {string} attribute attribute name\n * @param {object} opts configuration options.\n * @param {Array.<string> | function} opts.sortBy\n * When using strings, it consists of\n * the name of the [FacetValue](#SearchResults.FacetValue) or the\n * [HierarchicalFacet](#SearchResults.HierarchicalFacet) attributes with the\n * order (`asc` or `desc`). For example to order the value by count, the\n * argument would be `['count:asc']`.\n *\n * If only the attribute name is specified, the ordering defaults to the one\n * specified in the default value for this attribute.\n *\n * When not specified, the order is\n * ascending. This parameter can also be a function which takes two facet\n * values and should return a number, 0 if equal, 1 if the first argument is\n * bigger or -1 otherwise.\n *\n * The default value for this attribute `['isRefined:desc', 'count:desc', 'name:asc']`\n * @return {FacetValue[]|HierarchicalFacet|undefined} depending on the type of facet of\n * the attribute requested (hierarchical, disjunctive or conjunctive)\n * @example\n * helper.on('result', function(event){\n * //get values ordered only by name ascending using the string predicate\n * event.results.getFacetValues('city', {sortBy: ['name:asc']});\n * //get values ordered only by count ascending using a function\n * event.results.getFacetValues('city', {\n * // this is equivalent to ['count:asc']\n * sortBy: function(a, b) {\n * if (a.count === b.count) return 0;\n * if (a.count > b.count) return 1;\n * if (b.count > a.count) return -1;\n * }\n * });\n * });\n */\nSearchResults.prototype.getFacetValues = function(attribute, opts) {\n var facetValues = extractNormalizedFacetValues(this, attribute);\n if (!facetValues) {\n return undefined;\n }\n\n var options = defaultsPure({}, opts, {sortBy: SearchResults.DEFAULT_SORT});\n\n if (Array.isArray(options.sortBy)) {\n var order = formatSort(options.sortBy, SearchResults.DEFAULT_SORT);\n if (Array.isArray(facetValues)) {\n return orderBy(facetValues, order[0], order[1]);\n }\n // If facetValues is not an array, it's an object thus a hierarchical facet object\n return recSort(function(hierarchicalFacetValues) {\n return orderBy(hierarchicalFacetValues, order[0], order[1]);\n }, facetValues);\n } else if (typeof options.sortBy === 'function') {\n if (Array.isArray(facetValues)) {\n return facetValues.sort(options.sortBy);\n }\n // If facetValues is not an array, it's an object thus a hierarchical facet object\n return recSort(function(data) {\n return vanillaSortFn(options.sortBy, data);\n }, facetValues);\n }\n throw new Error(\n 'options.sortBy is optional but if defined it must be ' +\n 'either an array of string (predicates) or a sorting function'\n );\n};\n\n/**\n * Returns the facet stats if attribute is defined and the facet contains some.\n * Otherwise returns undefined.\n * @param {string} attribute name of the faceted attribute\n * @return {object} The stats of the facet\n */\nSearchResults.prototype.getFacetStats = function(attribute) {\n if (this._state.isConjunctiveFacet(attribute)) {\n return getFacetStatsIfAvailable(this.facets, attribute);\n } else if (this._state.isDisjunctiveFacet(attribute)) {\n return getFacetStatsIfAvailable(this.disjunctiveFacets, attribute);\n }\n\n return undefined;\n};\n\n/**\n * @typedef {Object} FacetListItem\n * @property {string} name\n */\n\n/**\n * @param {FacetListItem[]} facetList (has more items, but enough for here)\n * @param {string} facetName\n */\nfunction getFacetStatsIfAvailable(facetList, facetName) {\n var data = find(facetList, function(facet) {\n return facet.name === facetName;\n });\n return data && data.stats;\n}\n\n/**\n * Returns all refinements for all filters + tags. It also provides\n * additional information: count and exhaustiveness for each filter.\n *\n * See the [refinement type](#Refinement) for an exhaustive view of the available\n * data.\n *\n * Note that for a numeric refinement, results are grouped per operator, this\n * means that it will return responses for operators which are empty.\n *\n * @return {Array.<Refinement>} all the refinements\n */\nSearchResults.prototype.getRefinements = function() {\n var state = this._state;\n var results = this;\n var res = [];\n\n Object.keys(state.facetsRefinements).forEach(function(attributeName) {\n state.facetsRefinements[attributeName].forEach(function(name) {\n res.push(getRefinement(state, 'facet', attributeName, name, results.facets));\n });\n });\n\n Object.keys(state.facetsExcludes).forEach(function(attributeName) {\n state.facetsExcludes[attributeName].forEach(function(name) {\n res.push(getRefinement(state, 'exclude', attributeName, name, results.facets));\n });\n });\n\n Object.keys(state.disjunctiveFacetsRefinements).forEach(function(attributeName) {\n state.disjunctiveFacetsRefinements[attributeName].forEach(function(name) {\n res.push(getRefinement(state, 'disjunctive', attributeName, name, results.disjunctiveFacets));\n });\n });\n\n Object.keys(state.hierarchicalFacetsRefinements).forEach(function(attributeName) {\n state.hierarchicalFacetsRefinements[attributeName].forEach(function(name) {\n res.push(getHierarchicalRefinement(state, attributeName, name, results.hierarchicalFacets));\n });\n });\n\n\n Object.keys(state.numericRefinements).forEach(function(attributeName) {\n var operators = state.numericRefinements[attributeName];\n Object.keys(operators).forEach(function(operator) {\n operators[operator].forEach(function(value) {\n res.push({\n type: 'numeric',\n attributeName: attributeName,\n name: value,\n numericValue: value,\n operator: operator\n });\n });\n });\n });\n\n state.tagRefinements.forEach(function(name) {\n res.push({type: 'tag', attributeName: '_tags', name: name});\n });\n\n return res;\n};\n\n/**\n * @typedef {Object} Facet\n * @property {string} name\n * @property {Object} data\n * @property {boolean} exhaustive\n */\n\n/**\n * @param {*} state\n * @param {*} type\n * @param {string} attributeName\n * @param {*} name\n * @param {Facet[]} resultsFacets\n */\nfunction getRefinement(state, type, attributeName, name, resultsFacets) {\n var facet = find(resultsFacets, function(f) {\n return f.name === attributeName;\n });\n var count = facet && facet.data && facet.data[name] ? facet.data[name] : 0;\n var exhaustive = (facet && facet.exhaustive) || false;\n\n return {\n type: type,\n attributeName: attributeName,\n name: name,\n count: count,\n exhaustive: exhaustive\n };\n}\n\n/**\n * @param {*} state\n * @param {string} attributeName\n * @param {*} name\n * @param {Facet[]} resultsFacets\n */\nfunction getHierarchicalRefinement(state, attributeName, name, resultsFacets) {\n var facetDeclaration = state.getHierarchicalFacetByName(attributeName);\n var separator = state._getHierarchicalFacetSeparator(facetDeclaration);\n var split = name.split(separator);\n var rootFacet = find(resultsFacets, function(facet) {\n return facet.name === attributeName;\n });\n\n var facet = split.reduce(function(intermediateFacet, part) {\n var newFacet =\n intermediateFacet && find(intermediateFacet.data, function(f) {\n return f.name === part;\n });\n return newFacet !== undefined ? newFacet : intermediateFacet;\n }, rootFacet);\n\n var count = (facet && facet.count) || 0;\n var exhaustive = (facet && facet.exhaustive) || false;\n var path = (facet && facet.path) || '';\n\n return {\n type: 'hierarchical',\n attributeName: attributeName,\n name: path,\n count: count,\n exhaustive: exhaustive\n };\n}\n\nmodule.exports = SearchResults;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n","'use strict';\n\nfunction inherits(ctor, superCtor) {\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n}\n\nmodule.exports = inherits;\n","'use strict';\n\nvar events = require('events');\nvar inherits = require('../functions/inherits');\n\n/**\n * A DerivedHelper is a way to create sub requests to\n * Algolia from a main helper.\n * @class\n * @classdesc The DerivedHelper provides an event based interface for search callbacks:\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 */\nfunction DerivedHelper(mainHelper, fn) {\n this.main = mainHelper;\n this.fn = fn;\n this.lastResults = null;\n}\n\ninherits(DerivedHelper, events.EventEmitter);\n\n/**\n * Detach this helper from the main helper\n * @return {undefined}\n * @throws Error if the derived helper is already detached\n */\nDerivedHelper.prototype.detach = function() {\n this.removeAllListeners();\n this.main.detachDerivedHelper(this);\n};\n\nDerivedHelper.prototype.getModifiedState = function(parameters) {\n return this.fn(parameters);\n};\n\nmodule.exports = DerivedHelper;\n","'use strict';\n\nvar merge = require('./functions/merge');\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 * @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(state, refinedFacet)\n });\n });\n\n // maybe more to get the root level of hierarchical facets when activated\n state.getRefinedHierarchicalFacets().forEach(function(refinedFacet) {\n var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet);\n\n var currentRefinement = state.getHierarchicalRefinement(refinedFacet);\n // if we are deeper than level 0 (starting from `beer > IPA`)\n // we want to get the root values\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n if (currentRefinement.length > 0 && currentRefinement[0].split(separator).length > 1) {\n queries.push({\n indexName: index,\n params: requestBuilder._getDisjunctiveFacetSearchParams(state, refinedFacet, true)\n });\n }\n });\n\n return queries;\n },\n\n /**\n * Build search parameters used to fetch hits\n * @private\n * @return {object.<string, any>}\n */\n _getHitsSearchParams: function(state) {\n var facets = state.facets\n .concat(state.disjunctiveFacets)\n .concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state));\n\n\n var facetFilters = requestBuilder._getFacetFilters(state);\n var numericFilters = requestBuilder._getNumericFilters(state);\n var tagFilters = requestBuilder._getTagFilters(state);\n var additionalParams = {\n facets: facets,\n 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 merge({}, state.getQueryParams(), additionalParams);\n },\n\n /**\n * Build search parameters used to fetch a disjunctive facet\n * @private\n * @param {string} facet the associated facet name\n * @param {boolean} hierarchicalRootLevel ?? FIXME\n * @return {object}\n */\n _getDisjunctiveFacetSearchParams: function(state, facet, hierarchicalRootLevel) {\n var facetFilters = requestBuilder._getFacetFilters(state, facet, hierarchicalRootLevel);\n var numericFilters = requestBuilder._getNumericFilters(state, facet);\n var tagFilters = requestBuilder._getTagFilters(state);\n var additionalParams = {\n hitsPerPage: 1,\n page: 0,\n attributesToRetrieve: [],\n attributesToHighlight: [],\n attributesToSnippet: [],\n tagFilters: tagFilters,\n analytics: false,\n clickAnalytics: false\n };\n\n var hierarchicalFacet = state.getHierarchicalFacetByName(facet);\n\n if (hierarchicalFacet) {\n additionalParams.facets = 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 merge({}, state.getQueryParams(), additionalParams);\n },\n\n /**\n * Return the numeric filters in an algolia request fashion\n * @private\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\n * @private\n * @return {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 /**\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 {string} [facet] if set, the current disjunctive facet\n * @return {array.<string>}\n */\n _getFacetFilters: function(state, facet, hierarchicalRootLevel) {\n var facetFilters = [];\n\n var facetsRefinements = state.facetsRefinements || {};\n Object.keys(facetsRefinements).forEach(function(facetName) {\n var facetValues = facetsRefinements[facetName] || [];\n facetValues.forEach(function(facetValue) {\n facetFilters.push(facetName + ':' + facetValue);\n });\n });\n\n var facetsExcludes = state.facetsExcludes || {};\n Object.keys(facetsExcludes).forEach(function(facetName) {\n var facetValues = facetsExcludes[facetName] || [];\n facetValues.forEach(function(facetValue) {\n facetFilters.push(facetName + ':-' + facetValue);\n });\n });\n\n var disjunctiveFacetsRefinements = state.disjunctiveFacetsRefinements || {};\n Object.keys(disjunctiveFacetsRefinements).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.forEach(function(facetValue) {\n orFilters.push(facetName + ':' + facetValue);\n });\n\n facetFilters.push(orFilters);\n });\n\n var hierarchicalFacetsRefinements = state.hierarchicalFacetsRefinements || {};\n Object.keys(hierarchicalFacetsRefinements).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 (facetValue.indexOf(separator) === -1 || (!rootPath && hierarchicalRootLevel === true) ||\n (rootPath && rootPath.split(separator).length === facetValue.split(separator).length)) {\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(allAttributes, hierarchicalFacet) {\n var hierarchicalRefinement = state.getHierarchicalRefinement(hierarchicalFacet.name)[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 }, out);\n },\n\n _getDisjunctiveHierarchicalFacetAttribute: function(state, hierarchicalFacet, rootLevel) {\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 = 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 merge(\n {},\n requestBuilder._getHitsSearchParams(stateForSearchForFacetValues),\n searchForFacetSearchParameters\n );\n }\n};\n\nmodule.exports = requestBuilder;\n","'use strict';\n\nmodule.exports = '3.0.0';\n","'use strict';\n\nvar SearchParameters = require('./SearchParameters');\nvar SearchResults = require('./SearchResults');\nvar DerivedHelper = require('./DerivedHelper');\nvar requestBuilder = require('./requestBuilder');\n\nvar events = require('events');\nvar inherits = require('./functions/inherits');\nvar objectHasKeys = require('./functions/objectHasKeys');\n\nvar version = require('./version');\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 */\nfunction AlgoliaSearchHelper(client, index, options) {\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.lastResults = null;\n this._queryId = 0;\n this._lastQueryIdReceived = -1;\n this.derivedHelpers = [];\n this._currentNbQueries = 0;\n}\n\ninherits(AlgoliaSearchHelper, events.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}\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 * 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} [callback] 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 ? this.state : this.state.setQueryParameters(options);\n var queries = requestBuilder._getQueries(tempState.index, tempState);\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(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 }, function(e) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n throw e;\n });\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.<FacetSearchResult>} the results of the search\n */\nAlgoliaSearchHelper.prototype.searchForFacetValues = function(facet, query, maxFacetHits, userState) {\n var clientHasSFFV = typeof this.client.searchForFacetValues === 'function';\n if (\n !clientHasSFFV &&\n typeof this.client.initIndex !== '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 var state = this.state.setQueryParameters(userState || {});\n var isDisjunctive = state.isDisjunctiveFacet(facet);\n var algoliaQuery = requestBuilder.getSearchForFacetQuery(facet, query, maxFacetHits, state);\n\n this._currentNbQueries++;\n var self = this;\n\n this.emit('searchForFacetValues', {\n state: state,\n facet: facet,\n query: query\n });\n\n var searchForFacetValuesPromise = clientHasSFFV\n ? this.client.searchForFacetValues([{indexName: state.index, params: algoliaQuery}])\n : this.client.initIndex(state.index).searchForFacetValues(algoliaQuery);\n\n return searchForFacetValuesPromise.then(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.isRefined = isDisjunctive\n ? state.isDisjunctiveFacetRefined(facet, f.value)\n : state.isFacetRefined(facet, f.value);\n });\n\n return content;\n }, function(e) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n throw e;\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}\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}\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}\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}\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addDisjunctiveFacetRefinement = function(facet, value) {\n this._change({\n state: this.state.resetPage().addDisjunctiveFacetRefinement(facet, value),\n isPageReset: true\n });\n\n return this;\n};\n\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}\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(facet, value) {\n this._change({\n state: this.state.resetPage().addHierarchicalFacetRefinement(facet, value),\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}\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addNumericRefinement = function(attribute, operator, value) {\n this._change({\n state: this.state.resetPage().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}\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/**\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/**\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}\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/**\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}\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 * 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}\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeNumericRefinement = function(attribute, operator, value) {\n this._change({\n state: this.state.resetPage().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}\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeDisjunctiveFacetRefinement = function(facet, value) {\n this._change({\n state: this.state.resetPage().removeDisjunctiveFacetRefinement(facet, value),\n isPageReset: true\n });\n\n return this;\n};\n\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}\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(facet) {\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}\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/**\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}\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/**\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}\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 * 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}\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/**\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}\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}\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/**\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}\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}\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}\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 */\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}\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}\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}\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}\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}\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}\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 = 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/**\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}\n */\nAlgoliaSearchHelper.prototype.hasTag = function(tag) {\n return this.state.isTagRefined(tag);\n};\n\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/**\n * Get the name of the currently used index.\n * @return {string}\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.<FacetRefinement|NumericRefinement>} 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 disjRefinements = this.state.getDisjunctiveRefinements(facetName);\n\n disjRefinements.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.<number|number[]>} refined values\n */\nAlgoliaSearchHelper.prototype.getNumericRefinement = function(attribute, operator) {\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.<string>} the path as an array of string\n */\nAlgoliaSearchHelper.prototype.getHierarchicalFacetBreadcrumb = function(facetName) {\n return this.state.getHierarchicalFacetBreadcrumb(facetName);\n};\n\n// /////////// PRIVATE\n\n/**\n * Perform the underlying queries\n * @private\n * @return {undefined}\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 = requestBuilder._getQueries(derivedState.index, derivedState);\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 var queryId = this._queryId++;\n\n this._currentNbQueries++;\n\n try {\n this.client.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\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}>}\n * state state used for 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(states, queryId, content) {\n // FIXME 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 var formattedResponse = helper.lastResults = new SearchResults(state, specificResults);\n\n helper.emit('result', {\n results: formattedResponse,\n state: state\n });\n });\n};\n\nAlgoliaSearchHelper.prototype._dispatchAlgoliaError = function(queryId, error) {\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.containsRefinement = function(query, facetFilters, numericFilters, tagFilters) {\n return query ||\n facetFilters.length !== 0 ||\n numericFilters.length !== 0 ||\n tagFilters.length !== 0;\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}\n */\nAlgoliaSearchHelper.prototype._hasDisjunctiveRefinements = function(facet) {\n return this.state.disjunctiveRefinements[facet] &&\n this.state.disjunctiveRefinements[facet].length > 0;\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\n/**\n * Clears the cache of the underlying Algolia client.\n * @return {AlgoliaSearchHelper}\n */\nAlgoliaSearchHelper.prototype.clearCache = function() {\n 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}\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}\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 * @return {DerivedHelper}\n */\nAlgoliaSearchHelper.prototype.derive = function(fn) {\n var derivedHelper = new DerivedHelper(this, fn);\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 * @return {undefined}\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","'use strict';\n\nvar AlgoliaSearchHelper = require('./src/algoliasearch.helper');\n\nvar SearchParameters = require('./src/SearchParameters');\nvar SearchResults = require('./src/SearchResults');\n\n/**\n * The algoliasearchHelper module is the function that will let its\n * contains everything needed to use the Algoliasearch\n * Helper. It is a also a function that instanciate the helper.\n * To use the helper, you also need the Algolia JS client v3.\n * @example\n * //using the UMD build\n * var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76');\n * var helper = algoliasearchHelper(client, 'bestbuy', {\n * facets: ['shipping'],\n * disjunctiveFacets: ['category']\n * });\n * helper.on('result', function(event) {\n * console.log(event.results);\n * });\n * helper\n * .toggleFacetRefinement('category', 'Movies & TV Shows')\n * .toggleFacetRefinement('shipping', 'Free shipping')\n * .search();\n * @example\n * // The helper is an event emitter using the node API\n * helper.on('result', updateTheResults);\n * helper.once('result', updateTheResults);\n * helper.removeListener('result', updateTheResults);\n * helper.removeAllListeners('result');\n * @module algoliasearchHelper\n * @param {AlgoliaSearch} client an AlgoliaSearch client\n * @param {string} index the name of the index to query\n * @param {SearchParameters|object} opts an object defining the initial config of the search. It doesn't have to be a {SearchParameters}, just an object containing the properties you need from it.\n * @return {AlgoliaSearchHelper}\n */\nfunction algoliasearchHelper(client, index, opts) {\n return new AlgoliaSearchHelper(client, index, opts);\n}\n\n/**\n * The version currently used\n * @member module:algoliasearchHelper.version\n * @type {number}\n */\nalgoliasearchHelper.version = require('./src/version.js');\n\n/**\n * Constructor for the Helper.\n * @member module:algoliasearchHelper.AlgoliaSearchHelper\n * @type {AlgoliaSearchHelper}\n */\nalgoliasearchHelper.AlgoliaSearchHelper = AlgoliaSearchHelper;\n\n/**\n * Constructor for the object containing all the parameters of the search.\n * @member module:algoliasearchHelper.SearchParameters\n * @type {SearchParameters}\n */\nalgoliasearchHelper.SearchParameters = SearchParameters;\n\n/**\n * Constructor for the object containing the results of the search.\n * @member module:algoliasearchHelper.SearchResults\n * @type {SearchResults}\n */\nalgoliasearchHelper.SearchResults = SearchResults;\n\nmodule.exports = algoliasearchHelper;\n","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport algoliasearchHelper from 'algoliasearch-helper';\nimport createWidgetsManager from './createWidgetsManager';\nimport createStore from './createStore';\nimport { HIGHLIGHT_TAGS } from './highlight';\nimport { hasMultipleIndices } from './indexUtils';\nimport { version as ReactVersion } from 'react';\nimport version from './version';\n\nfunction addAlgoliaAgents(searchClient) {\n if (typeof searchClient.addAlgoliaAgent === 'function') {\n searchClient.addAlgoliaAgent(\"react (\".concat(ReactVersion, \")\"));\n searchClient.addAlgoliaAgent(\"react-instantsearch (\".concat(version, \")\"));\n }\n}\n\nvar isMultiIndexContext = function isMultiIndexContext(widget) {\n return hasMultipleIndices({\n ais: widget.props.contextValue,\n multiIndexContext: widget.props.indexContextValue\n });\n};\n\nvar isTargetedIndexEqualIndex = function isTargetedIndexEqualIndex(widget, indexId) {\n return widget.props.indexContextValue.targetedIndex === indexId;\n}; // Relying on the `indexId` is a bit brittle to detect the `Index` widget.\n// Since it's a class we could rely on `instanceof` or similar. We never\n// had an issue though. Works for now.\n\n\nvar isIndexWidget = function isIndexWidget(widget) {\n return Boolean(widget.props.indexId);\n};\n\nvar isIndexWidgetEqualIndex = function isIndexWidgetEqualIndex(widget, indexId) {\n return widget.props.indexId === indexId;\n};\n\nvar sortIndexWidgetsFirst = function sortIndexWidgetsFirst(firstWidget, secondWidget) {\n if (isIndexWidget(firstWidget)) {\n return -1;\n }\n\n if (isIndexWidget(secondWidget)) {\n return 1;\n }\n\n return 0;\n};\n/**\n * Creates a new instance of the InstantSearchManager which controls the widgets and\n * trigger the search when the widgets are updated.\n * @param {string} indexName - the main index name\n * @param {object} initialState - initial widget state\n * @param {object} SearchParameters - optional additional parameters to send to the algolia API\n * @param {number} stalledSearchDelay - time (in ms) after the search is stalled\n * @return {InstantSearchManager} a new instance of InstantSearchManager\n */\n\n\nexport default function createInstantSearchManager(_ref) {\n var indexName = _ref.indexName,\n _ref$initialState = _ref.initialState,\n initialState = _ref$initialState === void 0 ? {} : _ref$initialState,\n searchClient = _ref.searchClient,\n resultsState = _ref.resultsState,\n stalledSearchDelay = _ref.stalledSearchDelay;\n var helper = algoliasearchHelper(searchClient, indexName, _objectSpread({}, HIGHLIGHT_TAGS));\n addAlgoliaAgents(searchClient);\n helper.on('search', handleNewSearch).on('result', handleSearchSuccess({\n indexId: indexName\n })).on('error', handleSearchError);\n var skip = false;\n var stalledSearchTimer = null;\n var initialSearchParameters = helper.state;\n var widgetsManager = createWidgetsManager(onWidgetsUpdate);\n hydrateSearchClient(searchClient, resultsState);\n var store = createStore({\n widgets: initialState,\n metadata: [],\n results: hydrateResultsState(resultsState),\n error: null,\n searching: false,\n isSearchStalled: true,\n searchingForFacetValues: false\n });\n\n function skipSearch() {\n skip = true;\n }\n\n function updateClient(client) {\n addAlgoliaAgents(client);\n helper.setClient(client);\n search();\n }\n\n function clearCache() {\n helper.clearCache();\n search();\n }\n\n function getMetadata(state) {\n return widgetsManager.getWidgets().filter(function (widget) {\n return Boolean(widget.getMetadata);\n }).map(function (widget) {\n return widget.getMetadata(state);\n });\n }\n\n function getSearchParameters() {\n var sharedParameters = widgetsManager.getWidgets().filter(function (widget) {\n return Boolean(widget.getSearchParameters);\n }).filter(function (widget) {\n return !isMultiIndexContext(widget) && !isIndexWidget(widget);\n }).reduce(function (res, widget) {\n return widget.getSearchParameters(res);\n }, initialSearchParameters);\n var mainParameters = widgetsManager.getWidgets().filter(function (widget) {\n return Boolean(widget.getSearchParameters);\n }).filter(function (widget) {\n var targetedIndexEqualMainIndex = isMultiIndexContext(widget) && isTargetedIndexEqualIndex(widget, indexName);\n var subIndexEqualMainIndex = isIndexWidget(widget) && isIndexWidgetEqualIndex(widget, indexName);\n return targetedIndexEqualMainIndex || subIndexEqualMainIndex;\n }) // We have to sort the `Index` widgets first so the `index` parameter\n // is correctly set in the `reduce` function for the following widgets\n .sort(sortIndexWidgetsFirst).reduce(function (res, widget) {\n return widget.getSearchParameters(res);\n }, sharedParameters);\n var derivedIndices = widgetsManager.getWidgets().filter(function (widget) {\n return Boolean(widget.getSearchParameters);\n }).filter(function (widget) {\n var targetedIndexNotEqualMainIndex = isMultiIndexContext(widget) && !isTargetedIndexEqualIndex(widget, indexName);\n var subIndexNotEqualMainIndex = isIndexWidget(widget) && !isIndexWidgetEqualIndex(widget, indexName);\n return targetedIndexNotEqualMainIndex || subIndexNotEqualMainIndex;\n }) // We have to sort the `Index` widgets first so the `index` parameter\n // is correctly set in the `reduce` function for the following widgets\n .sort(sortIndexWidgetsFirst).reduce(function (indices, widget) {\n var indexId = isMultiIndexContext(widget) ? widget.props.indexContextValue.targetedIndex : widget.props.indexId;\n var widgets = indices[indexId] || [];\n return _objectSpread({}, indices, _defineProperty({}, indexId, widgets.concat(widget)));\n }, {});\n var derivedParameters = Object.keys(derivedIndices).map(function (indexId) {\n return {\n parameters: derivedIndices[indexId].reduce(function (res, widget) {\n return widget.getSearchParameters(res);\n }, sharedParameters),\n indexId: indexId\n };\n });\n return {\n mainParameters: mainParameters,\n derivedParameters: derivedParameters\n };\n }\n\n function search() {\n if (!skip) {\n var _getSearchParameters = getSearchParameters(helper.state),\n mainParameters = _getSearchParameters.mainParameters,\n derivedParameters = _getSearchParameters.derivedParameters; // We have to call `slice` because the method `detach` on the derived\n // helpers mutates the value `derivedHelpers`. The `forEach` loop does\n // not iterate on each value and we're not able to correctly clear the\n // previous derived helpers (memory leak + useless requests).\n\n\n helper.derivedHelpers.slice().forEach(function (derivedHelper) {\n // Since we detach the derived helpers on **every** new search they\n // won't receive intermediate results in case of a stalled search.\n // Only the last result is dispatched by the derived helper because\n // they are not detached yet:\n //\n // - a -> main helper receives results\n // - ap -> main helper receives results\n // - app -> main helper + derived helpers receive results\n //\n // The quick fix is to avoid to detatch them on search but only once they\n // received the results. But it means that in case of a stalled search\n // all the derived helpers not detached yet register a new search inside\n // the helper. The number grows fast in case of a bad network and it's\n // not deterministic.\n derivedHelper.detach();\n });\n derivedParameters.forEach(function (_ref2) {\n var indexId = _ref2.indexId,\n parameters = _ref2.parameters;\n var derivedHelper = helper.derive(function () {\n return parameters;\n });\n derivedHelper.on('result', handleSearchSuccess({\n indexId: indexId\n })).on('error', handleSearchError);\n });\n helper.setState(mainParameters);\n helper.search();\n }\n }\n\n function handleSearchSuccess(_ref3) {\n var indexId = _ref3.indexId;\n return function (event) {\n var state = store.getState();\n var isDerivedHelpersEmpty = !helper.derivedHelpers.length;\n var results = state.results ? state.results : {}; // Switching from mono index to multi index and vice versa must reset the\n // results to an empty object, otherwise we keep reference of stalled and\n // unused results.\n\n results = !isDerivedHelpersEmpty && results.getFacetByName ? {} : results;\n\n if (!isDerivedHelpersEmpty) {\n results[indexId] = event.results;\n } else {\n results = event.results;\n }\n\n var currentState = store.getState();\n var nextIsSearchStalled = currentState.isSearchStalled;\n\n if (!helper.hasPendingRequests()) {\n clearTimeout(stalledSearchTimer);\n stalledSearchTimer = null;\n nextIsSearchStalled = false;\n }\n\n var resultsFacetValues = currentState.resultsFacetValues,\n partialState = _objectWithoutProperties(currentState, [\"resultsFacetValues\"]);\n\n store.setState(_objectSpread({}, partialState, {\n results: results,\n isSearchStalled: nextIsSearchStalled,\n searching: false,\n error: null\n }));\n };\n }\n\n function handleSearchError(_ref4) {\n var error = _ref4.error;\n var currentState = store.getState();\n var nextIsSearchStalled = currentState.isSearchStalled;\n\n if (!helper.hasPendingRequests()) {\n clearTimeout(stalledSearchTimer);\n nextIsSearchStalled = false;\n }\n\n var resultsFacetValues = currentState.resultsFacetValues,\n partialState = _objectWithoutProperties(currentState, [\"resultsFacetValues\"]);\n\n store.setState(_objectSpread({}, partialState, {\n isSearchStalled: nextIsSearchStalled,\n error: error,\n searching: false\n }));\n }\n\n function handleNewSearch() {\n if (!stalledSearchTimer) {\n stalledSearchTimer = setTimeout(function () {\n var _store$getState = store.getState(),\n resultsFacetValues = _store$getState.resultsFacetValues,\n partialState = _objectWithoutProperties(_store$getState, [\"resultsFacetValues\"]);\n\n store.setState(_objectSpread({}, partialState, {\n isSearchStalled: true\n }));\n }, stalledSearchDelay);\n }\n }\n\n function hydrateSearchClient(client, results) {\n if (!results) {\n return;\n }\n\n if (!client._useCache || typeof client.addAlgoliaAgent !== 'function') {\n // This condition avoids hydrating a `searchClient` different from the\n // Algolia one. We also avoid to hydrate the client when the cache is\n // disabled. The implementation is brittle but we don't have a proper way\n // to detect the Algolia client at the moment.\n return;\n }\n\n if (Array.isArray(results)) {\n hydrateSearchClientWithMultiIndexRequest(client, results);\n return;\n }\n\n hydrateSearchClientWithSingleIndexRequest(client, results);\n }\n\n function hydrateSearchClientWithMultiIndexRequest(client, results) {\n // At the moment we don't have a proper API to hydrate the client cache from\n // the outside (it should come with the V4). The following code populates the\n // cache with a multi-index results. 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 var key = \"/1/indexes/*/queries_body_\".concat(JSON.stringify({\n requests: results.reduce(function (acc, result) {\n return acc.concat(result.rawResults.map(function (request) {\n return {\n indexName: request.index,\n params: request.params\n };\n }));\n }, [])\n }));\n client.cache = _objectSpread({}, client.cache, _defineProperty({}, key, JSON.stringify({\n results: results.reduce(function (acc, result) {\n return acc.concat(result.rawResults);\n }, [])\n })));\n }\n\n function hydrateSearchClientWithSingleIndexRequest(client, results) {\n // At the moment we don't have a proper API to hydrate the client cache from\n // the outside (it should come with the V4). The following code populates the\n // cache with 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 var key = \"/1/indexes/*/queries_body_\".concat(JSON.stringify({\n requests: results.rawResults.map(function (request) {\n return {\n indexName: request.index,\n params: request.params\n };\n })\n }));\n client.cache = _objectSpread({}, client.cache, _defineProperty({}, key, JSON.stringify({\n results: results.rawResults\n })));\n }\n\n function hydrateResultsState(results) {\n if (!results) {\n return null;\n }\n\n if (Array.isArray(results)) {\n return results.reduce(function (acc, result) {\n return _objectSpread({}, acc, _defineProperty({}, result._internalIndexId, new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(result.state), result.rawResults)));\n }, {});\n }\n\n return new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(results.state), results.rawResults);\n } // Called whenever a widget has been rendered with new props.\n\n\n function onWidgetsUpdate() {\n var metadata = getMetadata(store.getState().widgets);\n store.setState(_objectSpread({}, store.getState(), {\n metadata: metadata,\n searching: true\n })); // Since the `getSearchParameters` method of widgets also depends on props,\n // the result search parameters might have changed.\n\n search();\n }\n\n function transitionState(nextSearchState) {\n var searchState = store.getState().widgets;\n return widgetsManager.getWidgets().filter(function (widget) {\n return Boolean(widget.transitionState);\n }).reduce(function (res, widget) {\n return widget.transitionState(searchState, res);\n }, nextSearchState);\n }\n\n function onExternalStateUpdate(nextSearchState) {\n var metadata = getMetadata(nextSearchState);\n store.setState(_objectSpread({}, store.getState(), {\n widgets: nextSearchState,\n metadata: metadata,\n searching: true\n }));\n search();\n }\n\n function onSearchForFacetValues(_ref5) {\n var facetName = _ref5.facetName,\n query = _ref5.query,\n _ref5$maxFacetHits = _ref5.maxFacetHits,\n maxFacetHits = _ref5$maxFacetHits === void 0 ? 10 : _ref5$maxFacetHits;\n // The values 1, 100 are the min / max values that the engine accepts.\n // see: https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits\n var maxFacetHitsWithinRange = Math.max(1, Math.min(maxFacetHits, 100));\n store.setState(_objectSpread({}, store.getState(), {\n searchingForFacetValues: true\n }));\n helper.searchForFacetValues(facetName, query, maxFacetHitsWithinRange).then(function (content) {\n var _objectSpread6;\n\n store.setState(_objectSpread({}, store.getState(), {\n error: null,\n searchingForFacetValues: false,\n resultsFacetValues: _objectSpread({}, store.getState().resultsFacetValues, (_objectSpread6 = {}, _defineProperty(_objectSpread6, facetName, content.facetHits), _defineProperty(_objectSpread6, \"query\", query), _objectSpread6))\n }));\n }, function (error) {\n store.setState(_objectSpread({}, store.getState(), {\n searchingForFacetValues: false,\n error: error\n }));\n }).catch(function (error) {\n // Since setState is synchronous, any error that occurs in the render of a\n // component will be swallowed by this promise.\n // This is a trick to make the error show up correctly in the console.\n // See http://stackoverflow.com/a/30741722/969302\n setTimeout(function () {\n throw error;\n });\n });\n }\n\n function updateIndex(newIndex) {\n initialSearchParameters = initialSearchParameters.setIndex(newIndex); // No need to trigger a new search here as the widgets will also update and trigger it if needed.\n }\n\n function getWidgetsIds() {\n return store.getState().metadata.reduce(function (res, meta) {\n return typeof meta.id !== 'undefined' ? res.concat(meta.id) : res;\n }, []);\n }\n\n return {\n store: store,\n widgetsManager: widgetsManager,\n getWidgetsIds: getWidgetsIds,\n getSearchParameters: getSearchParameters,\n onSearchForFacetValues: onSearchForFacetValues,\n onExternalStateUpdate: onExternalStateUpdate,\n transitionState: transitionState,\n updateClient: updateClient,\n updateIndex: updateIndex,\n clearCache: clearCache,\n skipSearch: skipSearch\n };\n}","import { defer } from './utils';\nexport default function createWidgetsManager(onWidgetsUpdate) {\n var widgets = []; // Is an update scheduled?\n\n var scheduled = false; // The state manager's updates need to be batched since more than one\n // component can register or unregister widgets during the same tick.\n\n function scheduleUpdate() {\n if (scheduled) {\n return;\n }\n\n scheduled = true;\n defer(function () {\n scheduled = false;\n onWidgetsUpdate();\n });\n }\n\n return {\n registerWidget: function registerWidget(widget) {\n widgets.push(widget);\n scheduleUpdate();\n return function unregisterWidget() {\n widgets.splice(widgets.indexOf(widget), 1);\n scheduleUpdate();\n };\n },\n update: scheduleUpdate,\n getWidgets: function getWidgets() {\n return widgets;\n }\n };\n}","export default function createStore(initialState) {\n var state = initialState;\n var listeners = [];\n return {\n getState: function getState() {\n return state;\n },\n setState: function setState(nextState) {\n state = nextState;\n listeners.forEach(function (listener) {\n return listener();\n });\n },\n subscribe: function subscribe(listener) {\n listeners.push(listener);\n return function unsubscribe() {\n listeners.splice(listeners.indexOf(listener), 1);\n };\n }\n };\n}","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component, Children } from 'react';\nimport isEqual from 'fast-deep-equal';\nimport PropTypes from 'prop-types';\nimport createInstantSearchManager from '../core/createInstantSearchManager';\nimport { InstantSearchProvider } from '../core/context';\n\nfunction isControlled(props) {\n return Boolean(props.searchState);\n}\n/**\n * @description\n * `<InstantSearch>` is the root component of all React InstantSearch implementations.\n * It provides all the connected components (aka widgets) a means to interact\n * with the searchState.\n * @kind widget\n * @name <InstantSearch>\n * @requirements You will need to have an Algolia account to be able to use this widget.\n * [Create one now](https://www.algolia.com/users/sign_up).\n * @propType {string} indexName - Main index in which to search.\n * @propType {boolean} [refresh=false] - Flag to activate when the cache needs to be cleared so that the front-end is updated when a change occurs in the index.\n * @propType {object} [searchClient] - Provide a custom search client.\n * @propType {func} [onSearchStateChange] - Function to be called everytime a new search is done. Useful for [URL Routing](guide/Routing.html).\n * @propType {object} [searchState] - Object to inject some search state. Switches the InstantSearch component in controlled mode. Useful for [URL Routing](guide/Routing.html).\n * @propType {func} [createURL] - Function to call when creating links, useful for [URL Routing](guide/Routing.html).\n * @propType {SearchResults|SearchResults[]} [resultsState] - Use this to inject the results that will be used at first rendering. Those results are found by using the `findResultsState` function. Useful for [Server Side Rendering](guide/Server-side_rendering.html).\n * @propType {number} [stalledSearchDelay=200] - The amount of time before considering that the search takes too much time. The time is expressed in milliseconds.\n * @propType {{ Root: string|function, props: object }} [root] - Use this to customize the root element. Default value: `{ Root: 'div' }`\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox />\n * <Hits />\n * </InstantSearch>\n * );\n */\n\n\nvar InstantSearch =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(InstantSearch, _Component);\n\n _createClass(InstantSearch, null, [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var nextIsControlled = isControlled(nextProps);\n var previousSearchState = prevState.instantSearchManager.store.getState().widgets;\n var nextSearchState = nextProps.searchState;\n\n if (nextIsControlled && !isEqual(previousSearchState, nextSearchState)) {\n prevState.instantSearchManager.onExternalStateUpdate(nextProps.searchState);\n }\n\n return {\n isControlled: nextIsControlled,\n contextValue: _objectSpread({}, prevState.contextValue, {\n mainTargetedIndex: nextProps.indexName\n })\n };\n }\n }]);\n\n function InstantSearch(props) {\n var _this;\n\n _classCallCheck(this, InstantSearch);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(InstantSearch).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"isUnmounting\", false);\n\n var instantSearchManager = createInstantSearchManager({\n indexName: _this.props.indexName,\n searchClient: _this.props.searchClient,\n initialState: _this.props.searchState || {},\n resultsState: _this.props.resultsState,\n stalledSearchDelay: _this.props.stalledSearchDelay\n });\n var contextValue = {\n store: instantSearchManager.store,\n widgetsManager: instantSearchManager.widgetsManager,\n mainTargetedIndex: _this.props.indexName,\n onInternalStateUpdate: _this.onWidgetsInternalStateUpdate.bind(_assertThisInitialized(_this)),\n createHrefForState: _this.createHrefForState.bind(_assertThisInitialized(_this)),\n onSearchForFacetValues: _this.onSearchForFacetValues.bind(_assertThisInitialized(_this)),\n onSearchStateChange: _this.onSearchStateChange.bind(_assertThisInitialized(_this)),\n onSearchParameters: _this.onSearchParameters.bind(_assertThisInitialized(_this))\n };\n _this.state = {\n isControlled: isControlled(_this.props),\n instantSearchManager: instantSearchManager,\n contextValue: contextValue\n };\n return _this;\n }\n\n _createClass(InstantSearch, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var prevIsControlled = isControlled(prevProps);\n\n if (prevIsControlled && !this.state.isControlled) {\n throw new Error(\"You can't switch <InstantSearch> from being controlled to uncontrolled\");\n }\n\n if (!prevIsControlled && this.state.isControlled) {\n throw new Error(\"You can't switch <InstantSearch> from being uncontrolled to controlled\");\n }\n\n if (this.props.refresh !== prevProps.refresh && this.props.refresh) {\n this.state.instantSearchManager.clearCache();\n }\n\n if (prevProps.indexName !== this.props.indexName) {\n this.state.instantSearchManager.updateIndex(this.props.indexName);\n }\n\n if (prevProps.searchClient !== this.props.searchClient) {\n this.state.instantSearchManager.updateClient(this.props.searchClient);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.isUnmounting = true;\n this.state.instantSearchManager.skipSearch();\n }\n }, {\n key: \"createHrefForState\",\n value: function createHrefForState(searchState) {\n searchState = this.state.instantSearchManager.transitionState(searchState);\n return this.state.isControlled && this.props.createURL ? this.props.createURL(searchState, this.getKnownKeys()) : '#';\n }\n }, {\n key: \"onWidgetsInternalStateUpdate\",\n value: function onWidgetsInternalStateUpdate(searchState) {\n searchState = this.state.instantSearchManager.transitionState(searchState);\n this.onSearchStateChange(searchState);\n\n if (!this.state.isControlled) {\n this.state.instantSearchManager.onExternalStateUpdate(searchState);\n }\n }\n }, {\n key: \"onSearchStateChange\",\n value: function onSearchStateChange(searchState) {\n if (this.props.onSearchStateChange && !this.isUnmounting) {\n this.props.onSearchStateChange(searchState);\n }\n }\n }, {\n key: \"onSearchParameters\",\n value: function onSearchParameters(getSearchParameters, context, props) {\n if (this.props.onSearchParameters) {\n var _searchState = this.props.searchState ? this.props.searchState : {};\n\n this.props.onSearchParameters(getSearchParameters, context, props, _searchState);\n }\n }\n }, {\n key: \"onSearchForFacetValues\",\n value: function onSearchForFacetValues(searchState) {\n this.state.instantSearchManager.onSearchForFacetValues(searchState);\n }\n }, {\n key: \"getKnownKeys\",\n value: function getKnownKeys() {\n return this.state.instantSearchManager.getWidgetsIds();\n }\n }, {\n key: \"render\",\n value: function render() {\n if (Children.count(this.props.children) === 0) {\n return null;\n }\n\n return React.createElement(InstantSearchProvider, {\n value: this.state.contextValue\n }, this.props.children);\n }\n }]);\n\n return InstantSearch;\n}(Component);\n\n_defineProperty(InstantSearch, \"defaultProps\", {\n stalledSearchDelay: 200,\n refresh: false\n});\n\n_defineProperty(InstantSearch, \"propTypes\", {\n // @TODO: These props are currently constant.\n indexName: PropTypes.string.isRequired,\n searchClient: PropTypes.shape({\n search: PropTypes.func.isRequired,\n searchForFacetValues: PropTypes.func,\n addAlgoliaAgent: PropTypes.func,\n clearCache: PropTypes.func\n }).isRequired,\n createURL: PropTypes.func,\n refresh: PropTypes.bool,\n searchState: PropTypes.object,\n onSearchStateChange: PropTypes.func,\n onSearchParameters: PropTypes.func,\n resultsState: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\n children: PropTypes.node,\n stalledSearchDelay: PropTypes.number\n});\n\nexport default InstantSearch;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\nimport { refineValue, getResults } from '../core/indexUtils';\nexport var getId = function getId(props) {\n return props.attributes[0];\n};\nvar namespace = 'hierarchicalMenu';\n\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId(props);\n\n var nextValue = _defineProperty({}, id, nextRefinement || '');\n\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage, namespace);\n}\n\nfunction transformValue(values) {\n return values.reduce(function (acc, item) {\n if (item.isRefined) {\n acc.push({\n label: item.name,\n // If dealing with a nested \"items\", \"value\" is equal to the previous value concatenated with the current label\n // If dealing with the first level, \"value\" is equal to the current label\n value: item.path\n }); // Create a variable in order to keep the same acc for the recursion, otherwise \"reduce\" returns a new one\n\n if (item.data) {\n acc = acc.concat(transformValue(item.data, acc));\n }\n }\n\n return acc;\n }, []);\n}\n/**\n * The breadcrumb component is s a type of secondary navigation scheme that\n * reveals the user’s location in a website or web application.\n *\n * @name connectBreadcrumb\n * @requirements To use this widget, your attributes must be formatted in a specific way.\n * If you want for example to have a Breadcrumb of categories, objects in your index\n * should be formatted this way:\n *\n * ```json\n * {\n * \"categories.lvl0\": \"products\",\n * \"categories.lvl1\": \"products > fruits\",\n * \"categories.lvl2\": \"products > fruits > citrus\"\n * }\n * ```\n *\n * It's also possible to provide more than one path for each level:\n *\n * ```json\n * {\n * \"categories.lvl0\": [\"products\", \"goods\"],\n * \"categories.lvl1\": [\"products > fruits\", \"goods > to eat\"]\n * }\n * ```\n *\n * All attributes passed to the `attributes` prop must be present in \"attributes for faceting\"\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n *\n * @kind connector\n * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow.\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @providedPropType {function} refine - a function to toggle a refinement\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n * @providedPropType {array.<{items: object, count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the Breadcrumb can display.\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaBreadcrumb',\n propTypes: {\n attributes: function attributes(props, propName, componentName) {\n var isNotString = function isNotString(val) {\n return typeof val !== 'string';\n };\n\n if (!Array.isArray(props[propName]) || props[propName].some(isNotString) || props[propName].length < 1) {\n return new Error(\"Invalid prop \".concat(propName, \" supplied to \").concat(componentName, \". Expected an Array of Strings\"));\n }\n\n return undefined;\n },\n transformItems: PropTypes.func\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var id = getId(props);\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var isFacetPresent = Boolean(results) && Boolean(results.getFacetByName(id));\n\n if (!isFacetPresent) {\n return {\n items: [],\n canRefine: false\n };\n }\n\n var values = results.getFacetValues(id);\n var items = values.data ? transformValue(values.data) : [];\n var transformedItems = props.transformItems ? props.transformItems(items) : items;\n return {\n canRefine: transformedItems.length > 0,\n items: transformedItems\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n return _refine(props, searchState, nextRefinement, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n }\n});","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\n/**\n * connectCurrentRefinements connector provides the logic to build a widget that will\n * give the user the ability to remove all or some of the filters that were\n * set.\n * @name connectCurrentRefinements\n * @kind connector\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @propType {function} [clearsQuery=false] - Pass true to also clear the search query\n * @providedPropType {function} refine - a function to remove a single filter\n * @providedPropType {array.<{label: string, attribute: string, currentRefinement: string || object, items: array, value: function}>} items - all the filters, the `value` is to pass to the `refine` function for removing all currentrefinements, `label` is for the display. When existing several refinements for the same atribute name, then you get a nested `items` object that contains a `label` and a `value` function to use to remove a single filter. `attribute` and `currentRefinement` are metadata containing row values.\n * @providedPropType {string} query - the search query\n */\n\nexport default createConnector({\n displayName: 'AlgoliaCurrentRefinements',\n propTypes: {\n transformItems: PropTypes.func\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata) {\n var items = metadata.reduce(function (res, meta) {\n if (typeof meta.items !== 'undefined') {\n if (!props.clearsQuery && meta.id === 'query') {\n return res;\n } else {\n if (props.clearsQuery && meta.id === 'query' && meta.items[0].currentRefinement === '') {\n return res;\n }\n\n return res.concat(meta.items.map(function (item) {\n return _objectSpread({}, item, {\n id: meta.id,\n index: meta.index\n });\n }));\n }\n }\n\n return res;\n }, []);\n var transformedItems = props.transformItems ? props.transformItems(items) : items;\n return {\n items: transformedItems,\n canRefine: transformedItems.length > 0\n };\n },\n refine: function refine(props, searchState, items) {\n // `value` corresponds to our internal clear function computed in each connector metadata.\n var refinementsToClear = items instanceof Array ? items.map(function (item) {\n return item.value;\n }) : [items];\n return refinementsToClear.reduce(function (res, clear) {\n return clear(res);\n }, searchState);\n }\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport PropTypes from 'prop-types';\nimport algoliasearchHelper from 'algoliasearch-helper';\nimport createConnector from '../core/createConnector';\nimport { cleanUpValue, getIndexId, refineValue, getCurrentRefinementValue, getResults } from '../core/indexUtils';\nexport var getId = function getId(props) {\n return props.attributes[0];\n};\nvar namespace = 'hierarchicalMenu';\n\nfunction getCurrentRefinement(props, searchState, context) {\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, \"\".concat(namespace, \".\").concat(getId(props)), null);\n\n if (currentRefinement === '') {\n return null;\n }\n\n return currentRefinement;\n}\n\nfunction getValue(path, props, searchState, context) {\n var id = props.id,\n attributes = props.attributes,\n separator = props.separator,\n rootPath = props.rootPath,\n showParentLevel = props.showParentLevel;\n var currentRefinement = getCurrentRefinement(props, searchState, context);\n var nextRefinement;\n\n if (currentRefinement === null) {\n nextRefinement = path;\n } else {\n var tmpSearchParameters = new algoliasearchHelper.SearchParameters({\n hierarchicalFacets: [{\n name: id,\n attributes: attributes,\n separator: separator,\n rootPath: rootPath,\n showParentLevel: showParentLevel\n }]\n });\n nextRefinement = tmpSearchParameters.toggleHierarchicalFacetRefinement(id, currentRefinement).toggleHierarchicalFacetRefinement(id, path).getHierarchicalRefinement(id)[0];\n }\n\n return nextRefinement;\n}\n\nfunction transformValue(value, props, searchState, context) {\n return value.map(function (v) {\n return {\n label: v.name,\n value: getValue(v.path, props, searchState, context),\n count: v.count,\n isRefined: v.isRefined,\n items: v.data && transformValue(v.data, props, searchState, context)\n };\n });\n}\n\nvar truncate = function truncate() {\n var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;\n return items.slice(0, limit).map(function () {\n var item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return Array.isArray(item.items) ? _objectSpread({}, item, {\n items: truncate(item.items, limit)\n }) : item;\n });\n};\n\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId(props);\n\n var nextValue = _defineProperty({}, id, nextRefinement || '');\n\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage, namespace);\n}\n\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, \"\".concat(namespace, \".\").concat(getId(props)));\n}\n\nvar sortBy = ['name:asc'];\n/**\n * connectHierarchicalMenu connector provides the logic to build a widget that will\n * give the user the ability to explore a tree-like structure.\n * This is commonly used for multi-level categorization of products on e-commerce\n * websites. From a UX point of view, we suggest not displaying more than two levels deep.\n * @name connectHierarchicalMenu\n * @requirements To use this widget, your attributes must be formatted in a specific way.\n * If you want for example to have a hiearchical menu of categories, objects in your index\n * should be formatted this way:\n *\n * ```json\n * {\n * \"categories.lvl0\": \"products\",\n * \"categories.lvl1\": \"products > fruits\",\n * \"categories.lvl2\": \"products > fruits > citrus\"\n * }\n * ```\n *\n * It's also possible to provide more than one path for each level:\n *\n * ```json\n * {\n * \"categories.lvl0\": [\"products\", \"goods\"],\n * \"categories.lvl1\": [\"products > fruits\", \"goods > to eat\"]\n * }\n * ```\n *\n * All attributes passed to the `attributes` prop must be present in \"attributes for faceting\"\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n *\n * @kind connector\n * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow.\n * @propType {string} [defaultRefinement] - the item value selected by default\n * @propType {boolean} [showMore=false] - Flag to activate the show more button, for toggling the number of items between limit and showMoreLimit.\n * @propType {number} [limit=10] - The maximum number of items displayed.\n * @propType {number} [showMoreLimit=20] - The maximum number of items displayed when the user triggers the show more. Not considered if `showMore` is false.\n * @propType {string} [separator='>'] - Specifies the level separator used in the data.\n * @propType {string} [rootPath=null] - The path to use if the first level is not the root level.\n * @propType {boolean} [showParentLevel=true] - Flag to set if the parent level should be displayed.\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @providedPropType {function} refine - a function to toggle a refinement\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n * @providedPropType {string} currentRefinement - the refinement currently applied\n * @providedPropType {array.<{items: object, count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the HierarchicalMenu can display. items has the same shape as parent items.\n */\n\nexport default createConnector({\n displayName: 'AlgoliaHierarchicalMenu',\n propTypes: {\n attributes: function attributes(props, propName, componentName) {\n var isNotString = function isNotString(val) {\n return typeof val !== 'string';\n };\n\n if (!Array.isArray(props[propName]) || props[propName].some(isNotString) || props[propName].length < 1) {\n return new Error(\"Invalid prop \".concat(propName, \" supplied to \").concat(componentName, \". Expected an Array of Strings\"));\n }\n\n return undefined;\n },\n separator: PropTypes.string,\n rootPath: PropTypes.string,\n showParentLevel: PropTypes.bool,\n defaultRefinement: PropTypes.string,\n showMore: PropTypes.bool,\n limit: PropTypes.number,\n showMoreLimit: PropTypes.number,\n transformItems: PropTypes.func\n },\n defaultProps: {\n showMore: false,\n limit: 10,\n showMoreLimit: 20,\n separator: ' > ',\n rootPath: null,\n showParentLevel: true\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var showMore = props.showMore,\n limit = props.limit,\n showMoreLimit = props.showMoreLimit;\n var id = getId(props);\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var isFacetPresent = Boolean(results) && Boolean(results.getFacetByName(id));\n\n if (!isFacetPresent) {\n return {\n items: [],\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n canRefine: false\n };\n }\n\n var itemsLimit = showMore ? showMoreLimit : limit;\n var value = results.getFacetValues(id, {\n sortBy: sortBy\n });\n var items = value.data ? transformValue(value.data, props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }) : [];\n var transformedItems = props.transformItems ? props.transformItems(items) : items;\n return {\n items: truncate(transformedItems, itemsLimit),\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n canRefine: transformedItems.length > 0\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n return _refine(props, searchState, nextRefinement, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n cleanUp: function cleanUp(props, searchState) {\n return _cleanUp(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n var attributes = props.attributes,\n separator = props.separator,\n rootPath = props.rootPath,\n showParentLevel = props.showParentLevel,\n showMore = props.showMore,\n limit = props.limit,\n showMoreLimit = props.showMoreLimit,\n contextValue = props.contextValue;\n var id = getId(props);\n var itemsLimit = showMore ? showMoreLimit : limit;\n searchParameters = searchParameters.addHierarchicalFacet({\n name: id,\n attributes: attributes,\n separator: separator,\n rootPath: rootPath,\n showParentLevel: showParentLevel\n }).setQueryParameters({\n maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, itemsLimit)\n });\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: contextValue,\n multiIndexContext: props.indexContextValue\n });\n\n if (currentRefinement !== null) {\n searchParameters = searchParameters.toggleHierarchicalFacetRefinement(id, currentRefinement);\n }\n\n return searchParameters;\n },\n getMetadata: function getMetadata(props, searchState) {\n var rootAttribute = props.attributes[0];\n var id = getId(props);\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var items = !currentRefinement ? [] : [{\n label: \"\".concat(rootAttribute, \": \").concat(currentRefinement),\n attribute: rootAttribute,\n value: function value(nextState) {\n return _refine(props, nextState, '', {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n currentRefinement: currentRefinement\n }];\n return {\n id: id,\n index: getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n items: items\n };\n }\n});","import createConnector from '../core/createConnector';\nimport { HIGHLIGHT_TAGS, parseAlgoliaHit } from '../core/highlight';\n\nvar highlight = function highlight(_ref) {\n var attribute = _ref.attribute,\n hit = _ref.hit,\n highlightProperty = _ref.highlightProperty,\n _ref$preTag = _ref.preTag,\n preTag = _ref$preTag === void 0 ? HIGHLIGHT_TAGS.highlightPreTag : _ref$preTag,\n _ref$postTag = _ref.postTag,\n postTag = _ref$postTag === void 0 ? HIGHLIGHT_TAGS.highlightPostTag : _ref$postTag;\n return parseAlgoliaHit({\n attribute: attribute,\n highlightProperty: highlightProperty,\n hit: hit,\n preTag: preTag,\n postTag: postTag\n });\n};\n/**\n * connectHighlight connector provides the logic to create an highlighter\n * component that will retrieve, parse and render an highlighted attribute\n * from an Algolia hit.\n * @name connectHighlight\n * @kind connector\n * @category connector\n * @providedPropType {function} highlight - function to retrieve and parse an attribute from a hit. It takes a configuration object with 3 attributes: `highlightProperty` which is the property that contains the highlight structure from the records, `attribute` which is the name of the attribute (it can be either a string or an array of strings) to look for and `hit` which is the hit from Algolia. It returns an array of objects `{value: string, isHighlighted: boolean}`. If the element that corresponds to the attribute is an array of strings, it will return a nested array of objects.\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, connectHighlight } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const CustomHighlight = connectHighlight(\n * ({ highlight, attribute, hit, highlightProperty }) => {\n * const highlights = highlight({\n * highlightProperty: '_highlightResult',\n * attribute,\n * hit\n * });\n *\n * return highlights.map(part => part.isHighlighted ? (\n * <mark>{part.value}</mark>\n * ) : (\n * <span>{part.value}</span>\n * ));\n * }\n * );\n *\n * const Hit = ({ hit }) => (\n * <p>\n * <CustomHighlight attribute=\"name\" hit={hit} />\n * </p>\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox defaultRefinement=\"pho\" />\n * <Hits hitComponent={Hit} />\n * </InstantSearch>\n * );\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaHighlighter',\n propTypes: {},\n getProvidedProps: function getProvidedProps() {\n return {\n highlight: highlight\n };\n }\n});","import createConnector from '../core/createConnector';\nimport { getResults } from '../core/indexUtils';\nimport { addAbsolutePositions, addQueryID } from '../core/utils';\n/**\n * connectHits connector provides the logic to create connected\n * components that will render the results retrieved from\n * Algolia.\n *\n * To configure the number of hits retrieved, use [HitsPerPage widget](widgets/HitsPerPage.html),\n * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or pass the hitsPerPage\n * prop to a [Configure](guide/Search_parameters.html) widget.\n *\n * **Warning:** you will need to use the **objectID** property available on every hit as a key\n * when iterating over them. This will ensure you have the best possible UI experience\n * especially on slow networks.\n * @name connectHits\n * @kind connector\n * @providedPropType {array.<object>} hits - the records that matched the search state\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Highlight, connectHits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n * const CustomHits = connectHits(({ hits }) => (\n * <div>\n * {hits.map(hit =>\n * <p key={hit.objectID}>\n * <Highlight attribute=\"name\" hit={hit} />\n * </p>\n * )}\n * </div>\n * ));\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <CustomHits />\n * </InstantSearch>\n * );\n */\n\nexport default createConnector({\n displayName: 'AlgoliaHits',\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n\n if (!results) {\n return {\n hits: []\n };\n }\n\n var hitsWithPositions = addAbsolutePositions(results.hits, results.hitsPerPage, results.page);\n var hitsWithPositionsAndQueryID = addQueryID(hitsWithPositions, results.queryID);\n return {\n hits: hitsWithPositionsAndQueryID\n };\n },\n\n /**\n * Hits needs to be considered as a widget to trigger a search,\n * even if no other widgets are used.\n *\n * To be considered as a widget you need either:\n * - getSearchParameters\n * - getMetadata\n * - transitionState\n *\n * See: createConnector.tsx\n */\n getSearchParameters: function getSearchParameters(searchParameters) {\n return searchParameters;\n }\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\nimport { cleanUpValue, refineValue, getCurrentRefinementValue } from '../core/indexUtils';\n\nfunction getId() {\n return 'hitsPerPage';\n}\n\nfunction getCurrentRefinement(props, searchState, context) {\n var id = getId();\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, null);\n\n if (typeof currentRefinement === 'string') {\n return parseInt(currentRefinement, 10);\n }\n\n return currentRefinement;\n}\n/**\n * connectHitsPerPage connector provides the logic to create connected\n * components that will allow a user to choose to display more or less results from Algolia.\n * @name connectHitsPerPage\n * @kind connector\n * @propType {number} defaultRefinement - The number of items selected by default\n * @propType {{value: number, label: string}[]} items - List of hits per page options.\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @providedPropType {function} refine - a function to remove a single filter\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n * @providedPropType {string} currentRefinement - the refinement currently applied\n * @providedPropType {array.<{isRefined: boolean, label?: string, value: number}>} items - the list of items the HitsPerPage can display. If no label provided, the value will be displayed.\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaHitsPerPage',\n propTypes: {\n defaultRefinement: PropTypes.number.isRequired,\n items: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.number.isRequired\n })).isRequired,\n transformItems: PropTypes.func\n },\n getProvidedProps: function getProvidedProps(props, searchState) {\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var items = props.items.map(function (item) {\n return item.value === currentRefinement ? _objectSpread({}, item, {\n isRefined: true\n }) : _objectSpread({}, item, {\n isRefined: false\n });\n });\n return {\n items: props.transformItems ? props.transformItems(items) : items,\n currentRefinement: currentRefinement\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n var id = getId();\n\n var nextValue = _defineProperty({}, id, nextRefinement);\n\n var resetPage = true;\n return refineValue(searchState, nextValue, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }, resetPage);\n },\n cleanUp: function cleanUp(props, searchState) {\n return cleanUpValue(searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }, getId());\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n return searchParameters.setHitsPerPage(getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }));\n },\n getMetadata: function getMetadata() {\n return {\n id: getId()\n };\n }\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport isEqual from 'fast-deep-equal';\nimport createConnector from '../core/createConnector';\nimport { getCurrentRefinementValue, refineValue, getResults } from '../core/indexUtils';\nimport { addAbsolutePositions, addQueryID } from '../core/utils';\n\nfunction getId() {\n return 'page';\n}\n\nfunction getCurrentRefinement(props, searchState, context) {\n var id = getId();\n var page = 1;\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, page);\n\n if (typeof currentRefinement === 'string') {\n return parseInt(currentRefinement, 10);\n }\n\n return currentRefinement;\n}\n/**\n * InfiniteHits connector provides the logic to create connected\n * components that will render an continuous list of results retrieved from\n * Algolia. This connector provides a function to load more results.\n * @name connectInfiniteHits\n * @kind connector\n * @providedPropType {array.<object>} hits - the records that matched the search state\n * @providedPropType {boolean} hasMore - indicates if there are more pages to load\n * @providedPropType {function} refine - call to load more results\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaInfiniteHits',\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var _this = this;\n\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n this._allResults = this._allResults || [];\n this._prevState = this._prevState || {};\n\n if (!results) {\n return {\n hits: [],\n hasPrevious: false,\n hasMore: false,\n refine: function refine() {},\n refinePrevious: function refinePrevious() {},\n refineNext: function refineNext() {}\n };\n }\n\n var page = results.page,\n hits = results.hits,\n hitsPerPage = results.hitsPerPage,\n nbPages = results.nbPages,\n _results$_state = results._state;\n _results$_state = _results$_state === void 0 ? {} : _results$_state;\n\n var p = _results$_state.page,\n currentState = _objectWithoutProperties(_results$_state, [\"page\"]);\n\n var hitsWithPositions = addAbsolutePositions(hits, hitsPerPage, page);\n var hitsWithPositionsAndQueryID = addQueryID(hitsWithPositions, results.queryID);\n\n if (this._firstReceivedPage === undefined || !isEqual(currentState, this._prevState)) {\n this._allResults = _toConsumableArray(hitsWithPositionsAndQueryID);\n this._firstReceivedPage = page;\n this._lastReceivedPage = page;\n } else if (this._lastReceivedPage < page) {\n this._allResults = [].concat(_toConsumableArray(this._allResults), _toConsumableArray(hitsWithPositionsAndQueryID));\n this._lastReceivedPage = page;\n } else if (this._firstReceivedPage > page) {\n this._allResults = [].concat(_toConsumableArray(hitsWithPositionsAndQueryID), _toConsumableArray(this._allResults));\n this._firstReceivedPage = page;\n }\n\n this._prevState = currentState;\n var hasPrevious = this._firstReceivedPage > 0;\n var lastPageIndex = nbPages - 1;\n var hasMore = page < lastPageIndex;\n\n var refinePrevious = function refinePrevious(event) {\n return _this.refine(event, _this._firstReceivedPage - 1);\n };\n\n var refineNext = function refineNext(event) {\n return _this.refine(event, _this._lastReceivedPage + 1);\n };\n\n return {\n hits: this._allResults,\n hasPrevious: hasPrevious,\n hasMore: hasMore,\n refinePrevious: refinePrevious,\n refineNext: refineNext\n };\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n return searchParameters.setQueryParameters({\n page: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }) - 1\n });\n },\n refine: function refine(props, searchState, event, index) {\n if (index === undefined && this._lastReceivedPage !== undefined) {\n index = this._lastReceivedPage + 1;\n } else if (index === undefined) {\n index = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n }\n\n var id = getId();\n\n var nextValue = _defineProperty({}, id, index + 1);\n\n var resetPage = false;\n return refineValue(searchState, nextValue, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }, resetPage);\n }\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\nimport { getIndexId, cleanUpValue, refineValue, getCurrentRefinementValue, getResults } from '../core/indexUtils';\nvar namespace = 'menu';\n\nfunction getId(props) {\n return props.attribute;\n}\n\nfunction getCurrentRefinement(props, searchState, context) {\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, \"\".concat(namespace, \".\").concat(getId(props)), null);\n\n if (currentRefinement === '') {\n return null;\n }\n\n return currentRefinement;\n}\n\nfunction getValue(name, props, searchState, context) {\n var currentRefinement = getCurrentRefinement(props, searchState, context);\n return name === currentRefinement ? '' : name;\n}\n\nfunction getLimit(_ref) {\n var showMore = _ref.showMore,\n limit = _ref.limit,\n showMoreLimit = _ref.showMoreLimit;\n return showMore ? showMoreLimit : limit;\n}\n\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId(props);\n\n var nextValue = _defineProperty({}, id, nextRefinement ? nextRefinement : '');\n\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage, namespace);\n}\n\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, \"\".concat(namespace, \".\").concat(getId(props)));\n}\n\nvar defaultSortBy = ['count:desc', 'name:asc'];\n/**\n * connectMenu connector provides the logic to build a widget that will\n * give the user the ability to choose a single value for a specific facet.\n * @name connectMenu\n * @requirements The attribute passed to the `attribute` prop must be present in \"attributes for faceting\"\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n * @kind connector\n * @propType {string} attribute - the name of the attribute in the record\n * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items\n * @propType {number} [limit=10] - the minimum number of diplayed items\n * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true`\n * @propType {string} [defaultRefinement] - the value of the item selected by default\n * @propType {boolean} [searchable=false] - allow search inside values\n * @providedPropType {function} refine - a function to toggle a refinement\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n * @providedPropType {string} currentRefinement - the refinement currently applied\n * @providedPropType {array.<{count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the Menu can display.\n * @providedPropType {function} searchForItems - a function to toggle a search inside items values\n * @providedPropType {boolean} isFromSearch - a boolean that says if the `items` props contains facet values from the global search or from the search inside items.\n */\n\nexport default createConnector({\n displayName: 'AlgoliaMenu',\n propTypes: {\n attribute: PropTypes.string.isRequired,\n showMore: PropTypes.bool,\n limit: PropTypes.number,\n showMoreLimit: PropTypes.number,\n defaultRefinement: PropTypes.string,\n transformItems: PropTypes.func,\n searchable: PropTypes.bool\n },\n defaultProps: {\n showMore: false,\n limit: 10,\n showMoreLimit: 20\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults, meta, searchForFacetValuesResults) {\n var attribute = props.attribute,\n searchable = props.searchable,\n indexContextValue = props.indexContextValue;\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var canRefine = Boolean(results) && Boolean(results.getFacetByName(attribute));\n var isFromSearch = Boolean(searchForFacetValuesResults && searchForFacetValuesResults[attribute] && searchForFacetValuesResults.query !== ''); // Search For Facet Values is not available with derived helper (used for multi index search)\n\n if (searchable && indexContextValue) {\n throw new Error('react-instantsearch: searching in *List is not available when used inside a' + ' multi index context');\n }\n\n if (!canRefine) {\n return {\n items: [],\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n isFromSearch: isFromSearch,\n searchable: searchable,\n canRefine: canRefine\n };\n }\n\n var items;\n\n if (isFromSearch) {\n items = searchForFacetValuesResults[attribute].map(function (v) {\n return {\n label: v.value,\n value: getValue(v.value, props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n _highlightResult: {\n label: {\n value: v.highlighted\n }\n },\n count: v.count,\n isRefined: v.isRefined\n };\n });\n } else {\n items = results.getFacetValues(attribute, {\n sortBy: searchable ? undefined : defaultSortBy\n }).map(function (v) {\n return {\n label: v.name,\n value: getValue(v.name, props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n count: v.count,\n isRefined: v.isRefined\n };\n });\n }\n\n var transformedItems = props.transformItems ? props.transformItems(items) : items;\n return {\n items: transformedItems.slice(0, getLimit(props)),\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n isFromSearch: isFromSearch,\n searchable: searchable,\n canRefine: transformedItems.length > 0\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n return _refine(props, searchState, nextRefinement, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n searchForFacetValues: function searchForFacetValues(props, searchState, nextRefinement) {\n return {\n facetName: props.attribute,\n query: nextRefinement,\n maxFacetHits: getLimit(props)\n };\n },\n cleanUp: function cleanUp(props, searchState) {\n return _cleanUp(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n var attribute = props.attribute;\n searchParameters = searchParameters.setQueryParameters({\n maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, getLimit(props))\n });\n searchParameters = searchParameters.addDisjunctiveFacet(attribute);\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n\n if (currentRefinement !== null) {\n searchParameters = searchParameters.addDisjunctiveFacetRefinement(attribute, currentRefinement);\n }\n\n return searchParameters;\n },\n getMetadata: function getMetadata(props, searchState) {\n var id = getId(props);\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n return {\n id: id,\n index: getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n items: currentRefinement === null ? [] : [{\n label: \"\".concat(props.attribute, \": \").concat(currentRefinement),\n attribute: props.attribute,\n value: function value(nextState) {\n return _refine(props, nextState, '', {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n currentRefinement: currentRefinement\n }]\n };\n }\n});","import arrayWithHoles from \"./arrayWithHoles\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit\";\nimport nonIterableRest from \"./nonIterableRest\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\nimport { find } from '../core/utils';\nimport { cleanUpValue, refineValue, getCurrentRefinementValue, getResults, getIndexId } from '../core/indexUtils';\n\nfunction stringifyItem(item) {\n if (typeof item.start === 'undefined' && typeof item.end === 'undefined') {\n return '';\n }\n\n var start = typeof item.start !== 'undefined' ? item.start : '';\n var end = typeof item.end !== 'undefined' ? item.end : '';\n return \"\".concat(start, \":\").concat(end);\n}\n\nfunction parseItem(value) {\n if (value.length === 0) {\n return {\n start: null,\n end: null\n };\n }\n\n var _value$split = value.split(':'),\n _value$split2 = _slicedToArray(_value$split, 2),\n startStr = _value$split2[0],\n endStr = _value$split2[1];\n\n return {\n start: startStr.length > 0 ? parseInt(startStr, 10) : null,\n end: endStr.length > 0 ? parseInt(endStr, 10) : null\n };\n}\n\nvar namespace = 'multiRange';\n\nfunction getId(props) {\n return props.attribute;\n}\n\nfunction getCurrentRefinement(props, searchState, context) {\n return getCurrentRefinementValue(props, searchState, context, \"\".concat(namespace, \".\").concat(getId(props)), '', function (currentRefinement) {\n if (currentRefinement === '') {\n return '';\n }\n\n return currentRefinement;\n });\n}\n\nfunction isRefinementsRangeIncludesInsideItemRange(stats, start, end) {\n return stats.min > start && stats.min < end || stats.max > start && stats.max < end;\n}\n\nfunction isItemRangeIncludedInsideRefinementsRange(stats, start, end) {\n return start > stats.min && start < stats.max || end > stats.min && end < stats.max;\n}\n\nfunction itemHasRefinement(attribute, results, value) {\n var stats = results.getFacetByName(attribute) ? results.getFacetStats(attribute) : null;\n var range = value.split(':');\n var start = Number(range[0]) === 0 || value === '' ? Number.NEGATIVE_INFINITY : Number(range[0]);\n var end = Number(range[1]) === 0 || value === '' ? Number.POSITIVE_INFINITY : Number(range[1]);\n return !(Boolean(stats) && (isRefinementsRangeIncludesInsideItemRange(stats, start, end) || isItemRangeIncludedInsideRefinementsRange(stats, start, end)));\n}\n\nfunction _refine(props, searchState, nextRefinement, context) {\n var nextValue = _defineProperty({}, getId(props, searchState), nextRefinement);\n\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage, namespace);\n}\n\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, \"\".concat(namespace, \".\").concat(getId(props)));\n}\n/**\n * connectNumericMenu connector provides the logic to build a widget that will\n * give the user the ability to select a range value for a numeric attribute.\n * Ranges are defined statically.\n * @name connectNumericMenu\n * @requirements The attribute passed to the `attribute` prop must be holding numerical values.\n * @kind connector\n * @propType {string} attribute - the name of the attribute in the records\n * @propType {{label: string, start: number, end: number}[]} items - List of options. With a text label, and upper and lower bounds.\n * @propType {string} [defaultRefinement] - the value of the item selected by default, follow the shape of a `string` with a pattern of `'{start}:{end}'`.\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @providedPropType {function} refine - a function to select a range.\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n * @providedPropType {string} currentRefinement - the refinement currently applied. follow the shape of a `string` with a pattern of `'{start}:{end}'` which corresponds to the current selected item. For instance, when the selected item is `{start: 10, end: 20}`, the searchState of the widget is `'10:20'`. When `start` isn't defined, the searchState of the widget is `':{end}'`, and the same way around when `end` isn't defined. However, when neither `start` nor `end` are defined, the searchState is an empty string.\n * @providedPropType {array.<{isRefined: boolean, label: string, value: string, isRefined: boolean, noRefinement: boolean}>} items - the list of ranges the NumericMenu can display.\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaNumericMenu',\n propTypes: {\n id: PropTypes.string,\n attribute: PropTypes.string.isRequired,\n items: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.node,\n start: PropTypes.number,\n end: PropTypes.number\n })).isRequired,\n transformItems: PropTypes.func\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var attribute = props.attribute;\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var items = props.items.map(function (item) {\n var value = stringifyItem(item);\n return {\n label: item.label,\n value: value,\n isRefined: value === currentRefinement,\n noRefinement: results ? itemHasRefinement(getId(props), results, value) : false\n };\n });\n var stats = results && results.getFacetByName(attribute) ? results.getFacetStats(attribute) : null;\n var refinedItem = find(items, function (item) {\n return item.isRefined === true;\n });\n\n if (!items.some(function (item) {\n return item.value === '';\n })) {\n items.push({\n value: '',\n isRefined: refinedItem === undefined,\n noRefinement: !stats,\n label: 'All'\n });\n }\n\n var transformedItems = props.transformItems ? props.transformItems(items) : items;\n return {\n items: transformedItems,\n currentRefinement: currentRefinement,\n canRefine: transformedItems.length > 0 && transformedItems.some(function (item) {\n return item.noRefinement === false;\n })\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n return _refine(props, searchState, nextRefinement, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n cleanUp: function cleanUp(props, searchState) {\n return _cleanUp(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n var attribute = props.attribute;\n\n var _parseItem = parseItem(getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n })),\n start = _parseItem.start,\n end = _parseItem.end;\n\n searchParameters = searchParameters.addDisjunctiveFacet(attribute);\n\n if (typeof start === 'number') {\n searchParameters = searchParameters.addNumericRefinement(attribute, '>=', start);\n }\n\n if (typeof end === 'number') {\n searchParameters = searchParameters.addNumericRefinement(attribute, '<=', end);\n }\n\n return searchParameters;\n },\n getMetadata: function getMetadata(props, searchState) {\n var id = getId(props);\n var value = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var items = [];\n var index = getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n\n if (value !== '') {\n var _find = find(props.items, function (item) {\n return stringifyItem(item) === value;\n }),\n label = _find.label;\n\n items.push({\n label: \"\".concat(props.attribute, \": \").concat(label),\n attribute: props.attribute,\n currentRefinement: label,\n value: function value(nextState) {\n return _refine(props, nextState, '', {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n }\n });\n }\n\n return {\n id: id,\n index: index,\n items: items\n };\n }\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport createConnector from '../core/createConnector';\nimport { cleanUpValue, refineValue, getCurrentRefinementValue, getResults } from '../core/indexUtils';\n\nfunction getId() {\n return 'page';\n}\n\nfunction getCurrentRefinement(props, searchState, context) {\n var id = getId();\n var page = 1;\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, page);\n\n if (typeof currentRefinement === 'string') {\n return parseInt(currentRefinement, 10);\n }\n\n return currentRefinement;\n}\n\nfunction _refine(props, searchState, nextPage, context) {\n var id = getId();\n\n var nextValue = _defineProperty({}, id, nextPage);\n\n var resetPage = false;\n return refineValue(searchState, nextValue, context, resetPage);\n}\n/**\n * connectPagination connector provides the logic to build a widget that will\n * let the user displays hits corresponding to a certain page.\n * @name connectPagination\n * @kind connector\n * @propType {boolean} [showFirst=true] - Display the first page link.\n * @propType {boolean} [showLast=false] - Display the last page link.\n * @propType {boolean} [showPrevious=true] - Display the previous page link.\n * @propType {boolean} [showNext=true] - Display the next page link.\n * @propType {number} [padding=3] - How many page links to display around the current page.\n * @propType {number} [totalPages=Infinity] - Maximum number of pages to display.\n * @providedPropType {function} refine - a function to remove a single filter\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n * @providedPropType {number} nbPages - the total of existing pages\n * @providedPropType {number} currentRefinement - the page refinement currently applied\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaPagination',\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n\n if (!results) {\n return null;\n }\n\n var nbPages = results.nbPages;\n return {\n nbPages: nbPages,\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n canRefine: nbPages > 1\n };\n },\n refine: function refine(props, searchState, nextPage) {\n return _refine(props, searchState, nextPage, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n cleanUp: function cleanUp(props, searchState) {\n return cleanUpValue(searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }, getId());\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n return searchParameters.setPage(getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }) - 1);\n },\n getMetadata: function getMetadata() {\n return {\n id: getId()\n };\n }\n});","import createConnector from '../core/createConnector';\n/**\n * connectPoweredBy connector provides the logic to build a widget that\n * will display a link to algolia.\n * @name connectPoweredBy\n * @kind connector\n * @providedPropType {string} url - the url to redirect to algolia\n */\n\nexport default createConnector({\n displayName: 'AlgoliaPoweredBy',\n getProvidedProps: function getProvidedProps() {\n var hostname = typeof window === 'undefined' ? '' : window.location.hostname;\n var url = 'https://www.algolia.com/?' + 'utm_source=react-instantsearch&' + 'utm_medium=website&' + \"utm_content=\".concat(hostname, \"&\") + 'utm_campaign=poweredby';\n return {\n url: url\n };\n }\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\nimport { cleanUpValue, getIndexId, refineValue, getCurrentRefinementValue, getResults } from '../core/indexUtils';\n/**\n * connectRange connector provides the logic to create connected\n * components that will give the ability for a user to refine results using\n * a numeric range.\n * @name connectRange\n * @kind connector\n * @requirements The attribute passed to the `attribute` prop must be present in “attributes for facetingâ€\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n * The values inside the attribute must be JavaScript numbers (not strings).\n * @propType {string} attribute - Name of the attribute for faceting\n * @propType {{min?: number, max?: number}} [defaultRefinement] - Default searchState of the widget containing the start and the end of the range.\n * @propType {number} [min] - Minimum value. When this isn't set, the minimum value will be automatically computed by Algolia using the data in the index.\n * @propType {number} [max] - Maximum value. When this isn't set, the maximum value will be automatically computed by Algolia using the data in the index.\n * @propType {number} [precision=0] - Number of digits after decimal point to use.\n * @providedPropType {function} refine - a function to select a range.\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n * @providedPropType {string} currentRefinement - the refinement currently applied\n * @providedPropType {number} min - the minimum value available.\n * @providedPropType {number} max - the maximum value available.\n * @providedPropType {number} precision - Number of digits after decimal point to use.\n */\n\nfunction getId(props) {\n return props.attribute;\n}\n\nvar namespace = 'range';\n\nfunction getCurrentRange(boundaries, stats, precision) {\n var pow = Math.pow(10, precision);\n var min;\n\n if (typeof boundaries.min === 'number' && isFinite(boundaries.min)) {\n min = boundaries.min;\n } else if (typeof stats.min === 'number' && isFinite(stats.min)) {\n min = stats.min;\n } else {\n min = undefined;\n }\n\n var max;\n\n if (typeof boundaries.max === 'number' && isFinite(boundaries.max)) {\n max = boundaries.max;\n } else if (typeof stats.max === 'number' && isFinite(stats.max)) {\n max = stats.max;\n } else {\n max = undefined;\n }\n\n return {\n min: min !== undefined ? Math.floor(min * pow) / pow : min,\n max: max !== undefined ? Math.ceil(max * pow) / pow : max\n };\n}\n\nfunction getCurrentRefinement(props, searchState, currentRange, context) {\n var _getCurrentRefinement = getCurrentRefinementValue(props, searchState, context, \"\".concat(namespace, \".\").concat(getId(props)), {}),\n min = _getCurrentRefinement.min,\n max = _getCurrentRefinement.max;\n\n var isFloatPrecision = Boolean(props.precision);\n var nextMin = min;\n\n if (typeof nextMin === 'string') {\n nextMin = isFloatPrecision ? parseFloat(nextMin) : parseInt(nextMin, 10);\n }\n\n var nextMax = max;\n\n if (typeof nextMax === 'string') {\n nextMax = isFloatPrecision ? parseFloat(nextMax) : parseInt(nextMax, 10);\n }\n\n var refinement = {\n min: nextMin,\n max: nextMax\n };\n var hasMinBound = props.min !== undefined;\n var hasMaxBound = props.max !== undefined;\n var hasMinRefinment = refinement.min !== undefined;\n var hasMaxRefinment = refinement.max !== undefined;\n\n if (hasMinBound && hasMinRefinment && refinement.min < currentRange.min) {\n throw Error(\"You can't provide min value lower than range.\");\n }\n\n if (hasMaxBound && hasMaxRefinment && refinement.max > currentRange.max) {\n throw Error(\"You can't provide max value greater than range.\");\n }\n\n if (hasMinBound && !hasMinRefinment) {\n refinement.min = currentRange.min;\n }\n\n if (hasMaxBound && !hasMaxRefinment) {\n refinement.max = currentRange.max;\n }\n\n return refinement;\n}\n\nfunction getCurrentRefinementWithRange(refinement, range) {\n return {\n min: refinement.min !== undefined ? refinement.min : range.min,\n max: refinement.max !== undefined ? refinement.max : range.max\n };\n}\n\nfunction nextValueForRefinement(hasBound, isReset, range, value) {\n var next;\n\n if (!hasBound && range === value) {\n next = undefined;\n } else if (hasBound && isReset) {\n next = range;\n } else {\n next = value;\n }\n\n return next;\n}\n\nfunction _refine(props, searchState, nextRefinement, currentRange, context) {\n var nextMin = nextRefinement.min,\n nextMax = nextRefinement.max;\n var currentMinRange = currentRange.min,\n currentMaxRange = currentRange.max;\n var isMinReset = nextMin === undefined || nextMin === '';\n var isMaxReset = nextMax === undefined || nextMax === '';\n var nextMinAsNumber = !isMinReset ? parseFloat(nextMin) : undefined;\n var nextMaxAsNumber = !isMaxReset ? parseFloat(nextMax) : undefined;\n var isNextMinValid = isMinReset || isFinite(nextMinAsNumber);\n var isNextMaxValid = isMaxReset || isFinite(nextMaxAsNumber);\n\n if (!isNextMinValid || !isNextMaxValid) {\n throw Error(\"You can't provide non finite values to the range connector.\");\n }\n\n if (nextMinAsNumber < currentMinRange) {\n throw Error(\"You can't provide min value lower than range.\");\n }\n\n if (nextMaxAsNumber > currentMaxRange) {\n throw Error(\"You can't provide max value greater than range.\");\n }\n\n var id = getId(props);\n var resetPage = true;\n\n var nextValue = _defineProperty({}, id, {\n min: nextValueForRefinement(props.min !== undefined, isMinReset, currentMinRange, nextMinAsNumber),\n max: nextValueForRefinement(props.max !== undefined, isMaxReset, currentMaxRange, nextMaxAsNumber)\n });\n\n return refineValue(searchState, nextValue, context, resetPage, namespace);\n}\n\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, \"\".concat(namespace, \".\").concat(getId(props)));\n}\n\nexport default createConnector({\n displayName: 'AlgoliaRange',\n propTypes: {\n id: PropTypes.string,\n attribute: PropTypes.string.isRequired,\n defaultRefinement: PropTypes.shape({\n min: PropTypes.number,\n max: PropTypes.number\n }),\n min: PropTypes.number,\n max: PropTypes.number,\n precision: PropTypes.number,\n header: PropTypes.node,\n footer: PropTypes.node\n },\n defaultProps: {\n precision: 0\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var attribute = props.attribute,\n precision = props.precision,\n minBound = props.min,\n maxBound = props.max;\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var hasFacet = results && results.getFacetByName(attribute);\n var stats = hasFacet ? results.getFacetStats(attribute) || {} : {};\n var facetValues = hasFacet ? results.getFacetValues(attribute) : [];\n var count = facetValues.map(function (v) {\n return {\n value: v.name,\n count: v.count\n };\n });\n\n var _getCurrentRange = getCurrentRange({\n min: minBound,\n max: maxBound\n }, stats, precision),\n rangeMin = _getCurrentRange.min,\n rangeMax = _getCurrentRange.max; // The searchState is not always in sync with the helper state. For example\n // when we set boundaries on the first render the searchState don't have\n // the correct refinement. If this behavior change in the upcoming version\n // we could store the range inside the searchState instead of rely on `this`.\n\n\n this._currentRange = {\n min: rangeMin,\n max: rangeMax\n };\n var currentRefinement = getCurrentRefinement(props, searchState, this._currentRange, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n return {\n min: rangeMin,\n max: rangeMax,\n canRefine: count.length > 0,\n currentRefinement: getCurrentRefinementWithRange(currentRefinement, this._currentRange),\n count: count,\n precision: precision\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n return _refine(props, searchState, nextRefinement, this._currentRange, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n cleanUp: function cleanUp(props, searchState) {\n return _cleanUp(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n getSearchParameters: function getSearchParameters(params, props, searchState) {\n var attribute = props.attribute;\n\n var _getCurrentRefinement2 = getCurrentRefinement(props, searchState, this._currentRange, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n min = _getCurrentRefinement2.min,\n max = _getCurrentRefinement2.max;\n\n params = params.addDisjunctiveFacet(attribute);\n\n if (min !== undefined) {\n params = params.addNumericRefinement(attribute, '>=', min);\n }\n\n if (max !== undefined) {\n params = params.addNumericRefinement(attribute, '<=', max);\n }\n\n return params;\n },\n getMetadata: function getMetadata(props, searchState) {\n var _this = this;\n\n var _this$_currentRange = this._currentRange,\n minRange = _this$_currentRange.min,\n maxRange = _this$_currentRange.max;\n\n var _getCurrentRefinement3 = getCurrentRefinement(props, searchState, this._currentRange, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n minValue = _getCurrentRefinement3.min,\n maxValue = _getCurrentRefinement3.max;\n\n var items = [];\n var hasMin = minValue !== undefined;\n var hasMax = maxValue !== undefined;\n var shouldDisplayMinLabel = hasMin && minValue !== minRange;\n var shouldDisplayMaxLabel = hasMax && maxValue !== maxRange;\n\n if (shouldDisplayMinLabel || shouldDisplayMaxLabel) {\n var fragments = [hasMin ? \"\".concat(minValue, \" <= \") : '', props.attribute, hasMax ? \" <= \".concat(maxValue) : ''];\n items.push({\n label: fragments.join(''),\n attribute: props.attribute,\n value: function value(nextState) {\n return _refine(props, nextState, {}, _this._currentRange, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n currentRefinement: getCurrentRefinementWithRange({\n min: minValue,\n max: maxValue\n }, {\n min: minRange,\n max: maxRange\n })\n });\n }\n\n return {\n id: getId(props),\n index: getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n items: items\n };\n }\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\nimport { cleanUpValue, getIndexId, refineValue, getCurrentRefinementValue, getResults } from '../core/indexUtils';\nvar namespace = 'refinementList';\n\nfunction getId(props) {\n return props.attribute;\n}\n\nfunction getCurrentRefinement(props, searchState, context) {\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, \"\".concat(namespace, \".\").concat(getId(props)), []);\n\n if (typeof currentRefinement !== 'string') {\n return currentRefinement;\n }\n\n if (currentRefinement) {\n return [currentRefinement];\n }\n\n return [];\n}\n\nfunction getValue(name, props, searchState, context) {\n var currentRefinement = getCurrentRefinement(props, searchState, context);\n var isAnewValue = currentRefinement.indexOf(name) === -1;\n var nextRefinement = isAnewValue ? currentRefinement.concat([name]) // cannot use .push(), it mutates\n : currentRefinement.filter(function (selectedValue) {\n return selectedValue !== name;\n }); // cannot use .splice(), it mutates\n\n return nextRefinement;\n}\n\nfunction getLimit(_ref) {\n var showMore = _ref.showMore,\n limit = _ref.limit,\n showMoreLimit = _ref.showMoreLimit;\n return showMore ? showMoreLimit : limit;\n}\n\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId(props); // Setting the value to an empty string ensures that it is persisted in\n // the URL as an empty value.\n // This is necessary in the case where `defaultRefinement` contains one\n // item and we try to deselect it. `nextSelected` would be an empty array,\n // which would not be persisted to the URL.\n // {foo: ['bar']} => \"foo[0]=bar\"\n // {foo: []} => \"\"\n\n var nextValue = _defineProperty({}, id, nextRefinement.length > 0 ? nextRefinement : '');\n\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage, namespace);\n}\n\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, \"\".concat(namespace, \".\").concat(getId(props)));\n}\n/**\n * connectRefinementList connector provides the logic to build a widget that will\n * give the user the ability to choose multiple values for a specific facet.\n * @name connectRefinementList\n * @kind connector\n * @requirements The attribute passed to the `attribute` prop must be present in \"attributes for faceting\"\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n * @propType {string} attribute - the name of the attribute in the record\n * @propType {boolean} [searchable=false] - allow search inside values\n * @propType {string} [operator=or] - How to apply the refinements. Possible values: 'or' or 'and'.\n * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items\n * @propType {number} [limit=10] - the minimum number of displayed items\n * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true`\n * @propType {string[]} defaultRefinement - the values of the items selected by default. The searchState of this widget takes the form of a list of `string`s, which correspond to the values of all selected refinements. However, when there are no refinements selected, the value of the searchState is an empty string.\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @providedPropType {function} refine - a function to toggle a refinement\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n * @providedPropType {string[]} currentRefinement - the refinement currently applied\n * @providedPropType {array.<{count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the RefinementList can display.\n * @providedPropType {function} searchForItems - a function to toggle a search inside items values\n * @providedPropType {boolean} isFromSearch - a boolean that says if the `items` props contains facet values from the global search or from the search inside items.\n * @providedPropType {boolean} canRefine - a boolean that says whether you can refine\n */\n\n\nvar sortBy = ['isRefined', 'count:desc', 'name:asc'];\nexport default createConnector({\n displayName: 'AlgoliaRefinementList',\n propTypes: {\n id: PropTypes.string,\n attribute: PropTypes.string.isRequired,\n operator: PropTypes.oneOf(['and', 'or']),\n showMore: PropTypes.bool,\n limit: PropTypes.number,\n showMoreLimit: PropTypes.number,\n defaultRefinement: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n searchable: PropTypes.bool,\n transformItems: PropTypes.func\n },\n defaultProps: {\n operator: 'or',\n showMore: false,\n limit: 10,\n showMoreLimit: 20\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata, searchForFacetValuesResults) {\n var attribute = props.attribute,\n searchable = props.searchable,\n indexContextValue = props.indexContextValue;\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var canRefine = Boolean(results) && Boolean(results.getFacetByName(attribute));\n var isFromSearch = Boolean(searchForFacetValuesResults && searchForFacetValuesResults[attribute] && searchForFacetValuesResults.query !== ''); // Search For Facet Values is not available with derived helper (used for multi index search)\n\n if (searchable && indexContextValue) {\n throw new Error('react-instantsearch: searching in *List is not available when used inside a' + ' multi index context');\n }\n\n if (!canRefine) {\n return {\n items: [],\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n canRefine: canRefine,\n isFromSearch: isFromSearch,\n searchable: searchable\n };\n }\n\n var items = isFromSearch ? searchForFacetValuesResults[attribute].map(function (v) {\n return {\n label: v.value,\n value: getValue(v.value, props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n _highlightResult: {\n label: {\n value: v.highlighted\n }\n },\n count: v.count,\n isRefined: v.isRefined\n };\n }) : results.getFacetValues(attribute, {\n sortBy: sortBy\n }).map(function (v) {\n return {\n label: v.name,\n value: getValue(v.name, props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n count: v.count,\n isRefined: v.isRefined\n };\n });\n var transformedItems = props.transformItems ? props.transformItems(items) : items;\n return {\n items: transformedItems.slice(0, getLimit(props)),\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n isFromSearch: isFromSearch,\n searchable: searchable,\n canRefine: transformedItems.length > 0\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n return _refine(props, searchState, nextRefinement, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n searchForFacetValues: function searchForFacetValues(props, searchState, nextRefinement) {\n return {\n facetName: props.attribute,\n query: nextRefinement,\n maxFacetHits: getLimit(props)\n };\n },\n cleanUp: function cleanUp(props, searchState) {\n return _cleanUp(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n var attribute = props.attribute,\n operator = props.operator;\n var addKey = operator === 'and' ? 'addFacet' : 'addDisjunctiveFacet';\n var addRefinementKey = \"\".concat(addKey, \"Refinement\");\n searchParameters = searchParameters.setQueryParameters({\n maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, getLimit(props))\n });\n searchParameters = searchParameters[addKey](attribute);\n return getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }).reduce(function (res, val) {\n return res[addRefinementKey](attribute, val);\n }, searchParameters);\n },\n getMetadata: function getMetadata(props, searchState) {\n var id = getId(props);\n var context = {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n };\n return {\n id: id,\n index: getIndexId(context),\n items: getCurrentRefinement(props, searchState, context).length > 0 ? [{\n attribute: props.attribute,\n label: \"\".concat(props.attribute, \": \"),\n currentRefinement: getCurrentRefinement(props, searchState, context),\n value: function value(nextState) {\n return _refine(props, nextState, [], context);\n },\n items: getCurrentRefinement(props, searchState, context).map(function (item) {\n return {\n label: \"\".concat(item),\n value: function value(nextState) {\n var nextSelectedItems = getCurrentRefinement(props, nextState, context).filter(function (other) {\n return other !== item;\n });\n return _refine(props, searchState, nextSelectedItems, context);\n }\n };\n })\n }] : []\n };\n }\n});","import PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\nimport { getCurrentRefinementValue, hasMultipleIndices, getIndexId } from '../core/indexUtils';\nimport { shallowEqual, omit } from '../core/utils';\n/**\n * connectScrollTo connector provides the logic to build a widget that will\n * let the page scroll to a certain point.\n * @name connectScrollTo\n * @kind connector\n * @propType {string} [scrollOn=\"page\"] - Widget searchState key on which to listen for changes, default to the pagination widget.\n * @providedPropType {any} value - the current refinement applied to the widget listened by scrollTo\n * @providedPropType {boolean} hasNotChanged - indicates whether the refinement came from the scrollOn argument (for instance page by default)\n */\n\nexport default createConnector({\n displayName: 'AlgoliaScrollTo',\n propTypes: {\n scrollOn: PropTypes.string\n },\n defaultProps: {\n scrollOn: 'page'\n },\n getProvidedProps: function getProvidedProps(props, searchState) {\n var id = props.scrollOn;\n var value = getCurrentRefinementValue(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }, id, null);\n\n if (!this._prevSearchState) {\n this._prevSearchState = {};\n } // Get the subpart of the state that interest us\n\n\n if (hasMultipleIndices({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n })) {\n searchState = searchState.indices ? searchState.indices[getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n })] : {};\n } // if there is a change in the app that has been triggered by another element\n // than \"props.scrollOn (id) or the Configure widget, we need to keep track of\n // the search state to know if there's a change in the app that was not triggered\n // by the props.scrollOn (id) or the Configure widget. This is useful when\n // using ScrollTo in combination of Pagination. As pagination can be change\n // by every widget, we want to scroll only if it cames from the pagination\n // widget itself. We also remove the configure key from the search state to\n // do this comparison because for now configure values are not present in the\n // search state before a first refinement has been made and will false the results.\n // See: https://github.com/algolia/react-instantsearch/issues/164\n\n\n var cleanedSearchState = omit(searchState, ['configure', id]);\n var hasNotChanged = shallowEqual(this._prevSearchState, cleanedSearchState);\n this._prevSearchState = cleanedSearchState;\n return {\n value: value,\n hasNotChanged: hasNotChanged\n };\n }\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\nimport { cleanUpValue, refineValue, getCurrentRefinementValue, getIndexId } from '../core/indexUtils';\n\nfunction getId() {\n return 'query';\n}\n\nfunction getCurrentRefinement(props, searchState, context) {\n var id = getId(props);\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, '');\n\n if (currentRefinement) {\n return currentRefinement;\n }\n\n return '';\n}\n\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId();\n\n var nextValue = _defineProperty({}, id, nextRefinement);\n\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage);\n}\n\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, getId());\n}\n/**\n * connectSearchBox connector provides the logic to build a widget that will\n * let the user search for a query\n * @name connectSearchBox\n * @kind connector\n * @propType {string} [defaultRefinement] - Provide a default value for the query\n * @providedPropType {function} refine - a function to change the current query\n * @providedPropType {string} currentRefinement - the current query used\n * @providedPropType {boolean} isSearchStalled - a flag that indicates if InstantSearch has detected that searches are stalled\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaSearchBox',\n propTypes: {\n defaultRefinement: PropTypes.string\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n return {\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n isSearchStalled: searchResults.isSearchStalled\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n return _refine(props, searchState, nextRefinement, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n cleanUp: function cleanUp(props, searchState) {\n return _cleanUp(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n return searchParameters.setQuery(getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }));\n },\n getMetadata: function getMetadata(props, searchState) {\n var id = getId(props);\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n return {\n id: id,\n index: getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n items: currentRefinement === null ? [] : [{\n label: \"\".concat(id, \": \").concat(currentRefinement),\n value: function value(nextState) {\n return _refine(props, nextState, '', {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n currentRefinement: currentRefinement\n }]\n };\n }\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\nimport { cleanUpValue, refineValue, getCurrentRefinementValue } from '../core/indexUtils';\n\nfunction getId() {\n return 'sortBy';\n}\n\nfunction getCurrentRefinement(props, searchState, context) {\n var id = getId(props);\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, null);\n\n if (currentRefinement) {\n return currentRefinement;\n }\n\n return null;\n}\n/**\n * The connectSortBy connector provides the logic to build a widget that will\n * display a list of indices. This allows a user to change how the hits are being sorted.\n * @name connectSortBy\n * @requirements Algolia handles sorting by creating replica indices. [Read more about sorting](https://www.algolia.com/doc/guides/relevance/sorting/) on\n * the Algolia website.\n * @kind connector\n * @propType {string} defaultRefinement - The default selected index.\n * @propType {{value: string, label: string}[]} items - The list of indexes to search in.\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @providedPropType {function} refine - a function to remove a single filter\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n * @providedPropType {string[]} currentRefinement - the refinement currently applied\n * @providedPropType {array.<{isRefined: boolean, label?: string, value: string}>} items - the list of items the HitsPerPage can display. If no label provided, the value will be displayed.\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaSortBy',\n propTypes: {\n defaultRefinement: PropTypes.string,\n items: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string.isRequired\n })).isRequired,\n transformItems: PropTypes.func\n },\n getProvidedProps: function getProvidedProps(props, searchState) {\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var items = props.items.map(function (item) {\n return item.value === currentRefinement ? _objectSpread({}, item, {\n isRefined: true\n }) : _objectSpread({}, item, {\n isRefined: false\n });\n });\n return {\n items: props.transformItems ? props.transformItems(items) : items,\n currentRefinement: currentRefinement\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n var id = getId();\n\n var nextValue = _defineProperty({}, id, nextRefinement);\n\n var resetPage = true;\n return refineValue(searchState, nextValue, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }, resetPage);\n },\n cleanUp: function cleanUp(props, searchState) {\n return cleanUpValue(searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }, getId());\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n var selectedIndex = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n return searchParameters.setIndex(selectedIndex);\n },\n getMetadata: function getMetadata() {\n return {\n id: getId()\n };\n }\n});","import createConnector from '../core/createConnector';\nimport { getResults } from '../core/indexUtils';\n/**\n * connectStats connector provides the logic to build a widget that will\n * displays algolia search statistics (hits number and processing time).\n * @name connectStats\n * @kind connector\n * @providedPropType {number} nbHits - number of hits returned by Algolia.\n * @providedPropType {number} processingTimeMS - the time in ms took by Algolia to search for results.\n */\n\nexport default createConnector({\n displayName: 'AlgoliaStats',\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n\n if (!results) {\n return null;\n }\n\n return {\n nbHits: results.nbHits,\n processingTimeMS: results.processingTimeMS\n };\n }\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport PropTypes from 'prop-types';\nimport { find } from '../core/utils';\nimport createConnector from '../core/createConnector';\nimport { cleanUpValue, getIndexId, getResults, refineValue, getCurrentRefinementValue } from '../core/indexUtils';\n\nfunction getId(props) {\n return props.attribute;\n}\n\nvar namespace = 'toggle';\nvar falsyStrings = ['0', 'false', 'null', 'undefined'];\n\nfunction getCurrentRefinement(props, searchState, context) {\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, \"\".concat(namespace, \".\").concat(getId(props)), false);\n\n if (falsyStrings.indexOf(currentRefinement) !== -1) {\n return false;\n }\n\n return Boolean(currentRefinement);\n}\n\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId(props);\n\n var nextValue = _defineProperty({}, id, nextRefinement ? nextRefinement : false);\n\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage, namespace);\n}\n\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, \"\".concat(namespace, \".\").concat(getId(props)));\n}\n/**\n * connectToggleRefinement connector provides the logic to build a widget that will\n * provides an on/off filtering feature based on an attribute value.\n * @name connectToggleRefinement\n * @kind connector\n * @requirements To use this widget, you'll need an attribute to toggle on.\n *\n * You can't toggle on null or not-null values. If you want to address this particular use-case you'll need to compute an\n * extra boolean attribute saying if the value exists or not. See this [thread](https://discourse.algolia.com/t/how-to-create-a-toggle-for-the-absence-of-a-string-attribute/2460) for more details.\n *\n * @propType {string} attribute - Name of the attribute on which to apply the `value` refinement. Required when `value` is present.\n * @propType {string} label - Label for the toggle.\n * @propType {string} value - Value of the refinement to apply on `attribute`.\n * @propType {boolean} [defaultRefinement=false] - Default searchState of the widget. Should the toggle be checked by default?\n * @providedPropType {boolean} currentRefinement - `true` when the refinement is applied, `false` otherwise\n * @providedPropType {object} count - an object that contains the count for `checked` and `unchecked` state\n * @providedPropType {function} refine - a function to toggle a refinement\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaToggle',\n propTypes: {\n label: PropTypes.string.isRequired,\n attribute: PropTypes.string.isRequired,\n value: PropTypes.any.isRequired,\n filter: PropTypes.func,\n defaultRefinement: PropTypes.bool\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var attribute = props.attribute,\n value = props.value;\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var allFacetValues = results && results.getFacetByName(attribute) ? results.getFacetValues(attribute) : null;\n var facetValue = // Use null to always be consistent with type of the value\n // count: number | null\n allFacetValues && allFacetValues.length ? find(allFacetValues, function (item) {\n return item.name === value.toString();\n }) : null;\n var facetValueCount = facetValue && facetValue.count;\n var allFacetValuesCount = // Use null to always be consistent with type of the value\n // count: number | null\n allFacetValues && allFacetValues.length ? allFacetValues.reduce(function (acc, item) {\n return acc + item.count;\n }, 0) : null;\n var canRefine = currentRefinement ? allFacetValuesCount !== null && allFacetValuesCount > 0 : facetValueCount !== null && facetValueCount > 0;\n var count = {\n checked: allFacetValuesCount,\n unchecked: facetValueCount\n };\n return {\n currentRefinement: currentRefinement,\n canRefine: canRefine,\n count: count\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n return _refine(props, searchState, nextRefinement, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n cleanUp: function cleanUp(props, searchState) {\n return _cleanUp(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n var attribute = props.attribute,\n value = props.value,\n filter = props.filter;\n var checked = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var nextSearchParameters = searchParameters.addDisjunctiveFacet(attribute);\n\n if (checked) {\n nextSearchParameters = nextSearchParameters.addDisjunctiveFacetRefinement(attribute, value);\n\n if (filter) {\n nextSearchParameters = filter(nextSearchParameters);\n }\n }\n\n return nextSearchParameters;\n },\n getMetadata: function getMetadata(props, searchState) {\n var id = getId(props);\n var checked = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var items = [];\n var index = getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n\n if (checked) {\n items.push({\n label: props.label,\n currentRefinement: checked,\n attribute: props.attribute,\n value: function value(nextState) {\n return _refine(props, nextState, false, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n }\n });\n }\n\n return {\n id: id,\n index: index,\n items: items\n };\n }\n});","/*!\n Copyright (c) 2016 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses.push(classNames.apply(null, arg));\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport cx from 'classnames';\nexport var createClassNames = function createClassNames(block) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ais';\n return function () {\n for (var _len = arguments.length, elements = new Array(_len), _key = 0; _key < _len; _key++) {\n elements[_key] = arguments[_key];\n }\n\n var suitElements = elements.filter(function (element) {\n return element || element === '';\n }).map(function (element) {\n var baseClassName = \"\".concat(prefix, \"-\").concat(block);\n return element ? \"\".concat(baseClassName, \"-\").concat(element) : baseClassName;\n });\n return cx(suitElements);\n };\n};\nexport var isSpecialClick = function isSpecialClick(event) {\n var isMiddleClick = event.button === 1;\n return Boolean(isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);\n};\nexport var capitalize = function capitalize(key) {\n return key.length === 0 ? '' : \"\".concat(key[0].toUpperCase()).concat(key.slice(1));\n};\n// taken from InstantSearch.js/utils\nexport function range(_ref) {\n var _ref$start = _ref.start,\n start = _ref$start === void 0 ? 0 : _ref$start,\n end = _ref.end,\n _ref$step = _ref.step,\n step = _ref$step === void 0 ? 1 : _ref$step;\n // We can't divide by 0 so we re-assign the step to 1 if it happens.\n var limitStep = step === 0 ? 1 : step; // In some cases the array to create has a decimal length.\n // We therefore need to round the value.\n // Example:\n // { start: 1, end: 5000, step: 500 }\n // => Array length = (5000 - 1) / 500 = 9.998\n\n var arrayLength = Math.round((end - start) / limitStep);\n return _toConsumableArray(Array(arrayLength)).map(function (_, current) {\n return (start + current) * limitStep;\n });\n}\nexport function find(array, comparator) {\n if (!Array.isArray(array)) {\n return undefined;\n }\n\n for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return array[i];\n }\n }\n\n return undefined;\n}","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component, createContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('Panel');\n\nvar _createContext = createContext(function setCanRefine() {}),\n PanelConsumer = _createContext.Consumer,\n PanelProvider = _createContext.Provider;\n\nexport { PanelConsumer, PanelProvider };\n\nvar Panel =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Panel, _Component);\n\n function Panel() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Panel);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Panel)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n canRefine: true\n });\n\n _defineProperty(_assertThisInitialized(_this), \"setCanRefine\", function (nextCanRefine) {\n _this.setState({\n canRefine: nextCanRefine\n });\n });\n\n return _this;\n }\n\n _createClass(Panel, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n className = _this$props.className,\n header = _this$props.header,\n footer = _this$props.footer;\n var canRefine = this.state.canRefine;\n return React.createElement(\"div\", {\n className: classNames(cx('', !canRefine && '-noRefinement'), className)\n }, header && React.createElement(\"div\", {\n className: cx('header')\n }, header), React.createElement(\"div\", {\n className: cx('body')\n }, React.createElement(PanelProvider, {\n value: this.setCanRefine\n }, children)), footer && React.createElement(\"div\", {\n className: cx('footer')\n }, footer));\n }\n }]);\n\n return Panel;\n}(Component);\n\n_defineProperty(Panel, \"propTypes\", {\n children: PropTypes.node.isRequired,\n className: PropTypes.string,\n header: PropTypes.node,\n footer: PropTypes.node\n});\n\n_defineProperty(Panel, \"defaultProps\", {\n className: '',\n header: null,\n footer: null\n});\n\nexport default Panel;","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { PanelConsumer } from './Panel';\n\nvar PanelCallbackHandler =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(PanelCallbackHandler, _Component);\n\n function PanelCallbackHandler() {\n _classCallCheck(this, PanelCallbackHandler);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PanelCallbackHandler).apply(this, arguments));\n }\n\n _createClass(PanelCallbackHandler, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.props.setCanRefine(this.props.canRefine);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (prevProps.canRefine !== this.props.canRefine) {\n this.props.setCanRefine(this.props.canRefine);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return this.props.children;\n }\n }]);\n\n return PanelCallbackHandler;\n}(Component);\n\n_defineProperty(PanelCallbackHandler, \"propTypes\", {\n children: PropTypes.node.isRequired,\n canRefine: PropTypes.bool.isRequired,\n setCanRefine: PropTypes.func.isRequired\n});\n\nvar PanelWrapper = function PanelWrapper(_ref) {\n var canRefine = _ref.canRefine,\n children = _ref.children;\n return React.createElement(PanelConsumer, null, function (setCanRefine) {\n return React.createElement(PanelCallbackHandler, {\n setCanRefine: setCanRefine,\n canRefine: canRefine\n }, children);\n });\n};\n\nPanelWrapper.propTypes = {\n canRefine: PropTypes.bool.isRequired,\n children: PropTypes.node.isRequired\n};\nexport default PanelWrapper;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { isSpecialClick } from '../core/utils';\n\nvar Link =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Link, _Component);\n\n function Link() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Link);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Link)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"onClick\", function (e) {\n if (isSpecialClick(e)) {\n return;\n }\n\n _this.props.onClick();\n\n e.preventDefault();\n });\n\n return _this;\n }\n\n _createClass(Link, [{\n key: \"render\",\n value: function render() {\n return React.createElement(\"a\", _extends({}, this.props, {\n onClick: this.onClick\n }));\n }\n }]);\n\n return Link;\n}(Component);\n\n_defineProperty(Link, \"propTypes\", {\n onClick: PropTypes.func.isRequired\n});\n\nexport { Link as default };","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nimport Link from './Link';\nvar cx = createClassNames('Breadcrumb');\nvar itemsPropType = PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string.isRequired,\n value: PropTypes.string.isRequired\n}));\n\nvar Breadcrumb =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Breadcrumb, _Component);\n\n function Breadcrumb() {\n _classCallCheck(this, Breadcrumb);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Breadcrumb).apply(this, arguments));\n }\n\n _createClass(Breadcrumb, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n canRefine = _this$props.canRefine,\n createURL = _this$props.createURL,\n items = _this$props.items,\n refine = _this$props.refine,\n rootURL = _this$props.rootURL,\n separator = _this$props.separator,\n translate = _this$props.translate,\n className = _this$props.className;\n var rootPath = canRefine ? React.createElement(\"li\", {\n className: cx('item')\n }, React.createElement(Link, {\n className: cx('link'),\n onClick: function onClick() {\n return !rootURL ? refine() : null;\n },\n href: rootURL ? rootURL : createURL()\n }, translate('rootLabel'))) : null;\n var breadcrumb = items.map(function (item, idx) {\n var isLast = idx === items.length - 1;\n return React.createElement(\"li\", {\n className: cx('item', isLast && 'item--selected'),\n key: idx\n }, React.createElement(\"span\", {\n className: cx('separator')\n }, separator), !isLast ? React.createElement(Link, {\n className: cx('link'),\n onClick: function onClick() {\n return refine(item.value);\n },\n href: createURL(item.value)\n }, item.label) : item.label);\n });\n return React.createElement(\"div\", {\n className: classNames(cx('', !canRefine && '-noRefinement'), className)\n }, React.createElement(\"ul\", {\n className: cx('list')\n }, rootPath, breadcrumb));\n }\n }]);\n\n return Breadcrumb;\n}(Component);\n\n_defineProperty(Breadcrumb, \"propTypes\", {\n canRefine: PropTypes.bool.isRequired,\n createURL: PropTypes.func.isRequired,\n items: itemsPropType,\n refine: PropTypes.func.isRequired,\n rootURL: PropTypes.string,\n separator: PropTypes.node,\n translate: PropTypes.func.isRequired,\n className: PropTypes.string\n});\n\n_defineProperty(Breadcrumb, \"defaultProps\", {\n rootURL: null,\n separator: ' > ',\n className: ''\n});\n\nexport default translatable({\n rootLabel: 'Home'\n})(Breadcrumb);","import React from 'react';\nimport { connectBreadcrumb } from 'react-instantsearch-core';\nimport PanelCallbackHandler from '../components/PanelCallbackHandler';\nimport Breadcrumb from '../components/Breadcrumb';\n/**\n * A breadcrumb is a secondary navigation scheme that allows the user to see where the current page\n * is in relation to the website or web application’s hierarchy.\n * In terms of usability, using a breadcrumb reduces the number of actions a visitor needs to take in\n * order to get to a higher-level page.\n *\n * If you want to select a specific refinement for your Breadcrumb component, you will need to\n * use a [Virtual Hierarchical Menu](https://community.algolia.com/react-instantsearch/guide/Virtual_widgets.html)\n * and set its defaultRefinement that will be then used by the Breadcrumb.\n *\n * @name Breadcrumb\n * @kind widget\n * @requirements Breadcrumbs are used for websites with a large amount of content organised in a hierarchical manner.\n * The typical example is an e-commerce website which has a large variety of products grouped into logical categories\n * (with categories, subcategories which also have subcategories).To use this widget, your attributes must be formatted in a specific way.\n *\n * Keep in mind that breadcrumbs shouldn’t replace effective primary navigation menus:\n * it is only an alternative way to navigate around the website.\n *\n * If, for instance, you would like to have a breadcrumb of categories, objects in your index\n * should be formatted this way:\n *\n * ```json\n * {\n * \"categories.lvl0\": \"products\",\n * \"categories.lvl1\": \"products > fruits\",\n * \"categories.lvl2\": \"products > fruits > citrus\"\n * }\n * ```\n *\n * It's also possible to provide more than one path for each level:\n *\n * ```json\n * {\n * \"categories.lvl0\": [\"products\", \"goods\"],\n * \"categories.lvl1\": [\"products > fruits\", \"goods > to eat\"]\n * }\n * ```\n *\n * All attributes passed to the `attributes` prop must be present in \"attributes for faceting\"\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n *\n * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow\n * @propType {node} [separator='>'] - Symbol used for separating hyperlinks\n * @propType {string} [rootURL=null] - The originating page (homepage)\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return\n * @themeKey ais-Breadcrumb - the root div of the widget\n * @themeKey ais-Breadcrumb--noRefinement - the root div of the widget when there is no refinement\n * @themeKey ais-Breadcrumb-list - the list of all breadcrumb items\n * @themeKey ais-Breadcrumb-item - the breadcrumb navigation item\n * @themeKey ais-Breadcrumb-item--selected - the selected breadcrumb item\n * @themeKey ais-Breadcrumb-separator - the separator of each breadcrumb item\n * @themeKey ais-Breadcrumb-link - the clickable breadcrumb element\n * @translationKey rootLabel - The root's label. Accepts a string\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { Breadcrumb, InstantSearch, HierarchicalMenu } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <Breadcrumb\n * attributes={[\n * 'hierarchicalCategories.lvl0',\n * 'hierarchicalCategories.lvl1',\n * 'hierarchicalCategories.lvl2',\n * ]}\n * />\n * <HierarchicalMenu\n * defaultRefinement=\"Cameras & Camcorders\"\n * attributes={[\n * 'hierarchicalCategories.lvl0',\n * 'hierarchicalCategories.lvl1',\n * 'hierarchicalCategories.lvl2',\n * ]}\n * />\n * </InstantSearch>\n * );\n */\n\nvar BreadcrumbWidget = function BreadcrumbWidget(props) {\n return React.createElement(PanelCallbackHandler, props, React.createElement(Breadcrumb, props));\n};\n\nexport default connectBreadcrumb(BreadcrumbWidget);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('ClearRefinements');\n\nvar ClearRefinements =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(ClearRefinements, _Component);\n\n function ClearRefinements() {\n _classCallCheck(this, ClearRefinements);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ClearRefinements).apply(this, arguments));\n }\n\n _createClass(ClearRefinements, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n items = _this$props.items,\n canRefine = _this$props.canRefine,\n refine = _this$props.refine,\n translate = _this$props.translate,\n className = _this$props.className;\n return React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, React.createElement(\"button\", {\n className: cx('button', !canRefine && 'button--disabled'),\n onClick: function onClick() {\n return refine(items);\n },\n disabled: !canRefine\n }, translate('reset')));\n }\n }]);\n\n return ClearRefinements;\n}(Component);\n\n_defineProperty(ClearRefinements, \"propTypes\", {\n items: PropTypes.arrayOf(PropTypes.object).isRequired,\n canRefine: PropTypes.bool.isRequired,\n refine: PropTypes.func.isRequired,\n translate: PropTypes.func.isRequired,\n className: PropTypes.string\n});\n\n_defineProperty(ClearRefinements, \"defaultProps\", {\n className: ''\n});\n\nexport default translatable({\n reset: 'Clear all filters'\n})(ClearRefinements);","import React from 'react';\nimport { connectCurrentRefinements } from 'react-instantsearch-core';\nimport PanelCallbackHandler from '../components/PanelCallbackHandler';\nimport ClearRefinements from '../components/ClearRefinements';\n/**\n * The ClearRefinements widget displays a button that lets the user clean every refinement applied\n * to the search.\n * @name ClearRefinements\n * @kind widget\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @propType {boolean} [clearsQuery=false] - Pass true to also clear the search query\n * @themeKey ais-ClearRefinements - the root div of the widget\n * @themeKey ais-ClearRefinements-button - the clickable button\n * @themeKey ais-ClearRefinements-button--disabled - the disabled clickable button\n * @translationKey reset - the clear all button value\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, ClearRefinements, RefinementList } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <ClearRefinements />\n * <RefinementList\n * attribute=\"brand\"\n * defaultRefinement={['Apple']}\n * />\n * </InstantSearch>\n * );\n */\n\nvar ClearRefinementsWidget = function ClearRefinementsWidget(props) {\n return React.createElement(PanelCallbackHandler, props, React.createElement(ClearRefinements, props));\n};\n\nexport default connectCurrentRefinements(ClearRefinementsWidget);","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('CurrentRefinements');\nexport var CurrentRefinements = function CurrentRefinements(_ref) {\n var items = _ref.items,\n canRefine = _ref.canRefine,\n refine = _ref.refine,\n translate = _ref.translate,\n className = _ref.className;\n return React.createElement(\"div\", {\n className: classNames(cx('', !canRefine && '-noRefinement'), className)\n }, React.createElement(\"ul\", {\n className: cx('list', !canRefine && 'list--noRefinement')\n }, items.map(function (item) {\n return React.createElement(\"li\", {\n key: item.label,\n className: cx('item')\n }, React.createElement(\"span\", {\n className: cx('label')\n }, item.label), item.items ? item.items.map(function (nest) {\n return React.createElement(\"span\", {\n key: nest.label,\n className: cx('category')\n }, React.createElement(\"span\", {\n className: cx('categoryLabel')\n }, nest.label), React.createElement(\"button\", {\n className: cx('delete'),\n onClick: function onClick() {\n return refine(nest.value);\n }\n }, translate('clearFilter', nest)));\n }) : React.createElement(\"span\", {\n className: cx('category')\n }, React.createElement(\"button\", {\n className: cx('delete'),\n onClick: function onClick() {\n return refine(item.value);\n }\n }, translate('clearFilter', item))));\n })));\n};\nvar itemPropTypes = PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string.isRequired,\n value: PropTypes.func.isRequired,\n items: function items() {\n return itemPropTypes.apply(void 0, arguments);\n }\n}));\nCurrentRefinements.propTypes = {\n items: itemPropTypes.isRequired,\n canRefine: PropTypes.bool.isRequired,\n refine: PropTypes.func.isRequired,\n translate: PropTypes.func.isRequired,\n className: PropTypes.string\n};\nCurrentRefinements.defaultProps = {\n className: ''\n};\nexport default translatable({\n clearFilter: '✕'\n})(CurrentRefinements);","import React from 'react';\nimport { connectCurrentRefinements } from 'react-instantsearch-core';\nimport PanelCallbackHandler from '../components/PanelCallbackHandler';\nimport CurrentRefinements from '../components/CurrentRefinements';\n/**\n * The CurrentRefinements widget displays the list of currently applied filters.\n *\n * It allows the user to selectively remove them.\n * @name CurrentRefinements\n * @kind widget\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @themeKey ais-CurrentRefinements - the root div of the widget\n * @themeKey ais-CurrentRefinements--noRefinement - the root div of the widget when there is no refinement\n * @themeKey ais-CurrentRefinements-list - the list of all refined items\n * @themeKey ais-CurrentRefinements-list--noRefinement - the list of all refined items when there is no refinement\n * @themeKey ais-CurrentRefinements-item - the refined list item\n * @themeKey ais-CurrentRefinements-button - the button of each refined list item\n * @themeKey ais-CurrentRefinements-label - the refined list label\n * @themeKey ais-CurrentRefinements-category - the category of each item\n * @themeKey ais-CurrentRefinements-categoryLabel - the label of each catgory\n * @themeKey ais-CurrentRefinements-delete - the delete button of each label\n * @translationKey clearFilter - the remove filter button label\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, CurrentRefinements, RefinementList } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <CurrentRefinements />\n * <RefinementList\n * attribute=\"brand\"\n * defaultRefinement={['Colors']}\n * />\n * </InstantSearch>\n * );\n */\n\nvar CurrentRefinementsWidget = function CurrentRefinementsWidget(props) {\n return React.createElement(PanelCallbackHandler, props, React.createElement(CurrentRefinements, props));\n};\n\nexport default connectCurrentRefinements(CurrentRefinementsWidget);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('SearchBox');\nvar defaultLoadingIndicator = React.createElement(\"svg\", {\n width: \"18\",\n height: \"18\",\n viewBox: \"0 0 38 38\",\n xmlns: \"http://www.w3.org/2000/svg\",\n stroke: \"#444\",\n className: cx('loadingIcon')\n}, React.createElement(\"g\", {\n fill: \"none\",\n fillRule: \"evenodd\"\n}, React.createElement(\"g\", {\n transform: \"translate(1 1)\",\n strokeWidth: \"2\"\n}, React.createElement(\"circle\", {\n strokeOpacity: \".5\",\n cx: \"18\",\n cy: \"18\",\n r: \"18\"\n}), React.createElement(\"path\", {\n d: \"M36 18c0-9.94-8.06-18-18-18\"\n}, React.createElement(\"animateTransform\", {\n attributeName: \"transform\",\n type: \"rotate\",\n from: \"0 18 18\",\n to: \"360 18 18\",\n dur: \"1s\",\n repeatCount: \"indefinite\"\n})))));\nvar defaultReset = React.createElement(\"svg\", {\n className: cx('resetIcon'),\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n width: \"10\",\n height: \"10\"\n}, React.createElement(\"path\", {\n d: \"M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z\"\n}));\nvar defaultSubmit = React.createElement(\"svg\", {\n className: cx('submitIcon'),\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"10\",\n height: \"10\",\n viewBox: \"0 0 40 40\"\n}, React.createElement(\"path\", {\n d: \"M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z\"\n}));\n\nvar SearchBox =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(SearchBox, _Component);\n\n function SearchBox(props) {\n var _this;\n\n _classCallCheck(this, SearchBox);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SearchBox).call(this));\n\n _defineProperty(_assertThisInitialized(_this), \"getQuery\", function () {\n return _this.props.searchAsYouType ? _this.props.currentRefinement : _this.state.query;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onInputMount\", function (input) {\n _this.input = input;\n\n if (_this.props.__inputRef) {\n _this.props.__inputRef(input);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onKeyDown\", function (e) {\n if (!_this.props.focusShortcuts) {\n return;\n }\n\n var shortcuts = _this.props.focusShortcuts.map(function (key) {\n return typeof key === 'string' ? key.toUpperCase().charCodeAt(0) : key;\n });\n\n var elt = e.target || e.srcElement;\n var tagName = elt.tagName;\n\n if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {\n // already in an input\n return;\n }\n\n var which = e.which || e.keyCode;\n\n if (shortcuts.indexOf(which) === -1) {\n // not the right shortcut\n return;\n }\n\n _this.input.focus();\n\n e.stopPropagation();\n e.preventDefault();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSubmit\", function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n _this.input.blur();\n\n var _this$props = _this.props,\n refine = _this$props.refine,\n searchAsYouType = _this$props.searchAsYouType;\n\n if (!searchAsYouType) {\n refine(_this.getQuery());\n }\n\n return false;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onChange\", function (event) {\n var _this$props2 = _this.props,\n searchAsYouType = _this$props2.searchAsYouType,\n refine = _this$props2.refine,\n onChange = _this$props2.onChange;\n var value = event.target.value;\n\n if (searchAsYouType) {\n refine(value);\n } else {\n _this.setState({\n query: value\n });\n }\n\n if (onChange) {\n onChange(event);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onReset\", function (event) {\n var _this$props3 = _this.props,\n searchAsYouType = _this$props3.searchAsYouType,\n refine = _this$props3.refine,\n onReset = _this$props3.onReset;\n refine('');\n\n _this.input.focus();\n\n if (!searchAsYouType) {\n _this.setState({\n query: ''\n });\n }\n\n if (onReset) {\n onReset(event);\n }\n });\n\n _this.state = {\n query: props.searchAsYouType ? null : props.currentRefinement\n };\n return _this;\n }\n\n _createClass(SearchBox, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n document.addEventListener('keydown', this.onKeyDown);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n document.removeEventListener('keydown', this.onKeyDown);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (!this.props.searchAsYouType && prevProps.currentRefinement !== this.props.currentRefinement) {\n this.setState({\n query: this.props.currentRefinement\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props4 = this.props,\n className = _this$props4.className,\n translate = _this$props4.translate,\n autoFocus = _this$props4.autoFocus,\n loadingIndicator = _this$props4.loadingIndicator,\n submit = _this$props4.submit,\n reset = _this$props4.reset;\n var query = this.getQuery();\n var searchInputEvents = Object.keys(this.props).reduce(function (props, prop) {\n if (['onsubmit', 'onreset', 'onchange'].indexOf(prop.toLowerCase()) === -1 && prop.indexOf('on') === 0) {\n return _objectSpread({}, props, _defineProperty({}, prop, _this2.props[prop]));\n }\n\n return props;\n }, {});\n var isSearchStalled = this.props.showLoadingIndicator && this.props.isSearchStalled;\n /* eslint-disable max-len */\n\n return React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, React.createElement(\"form\", {\n noValidate: true,\n onSubmit: this.props.onSubmit ? this.props.onSubmit : this.onSubmit,\n onReset: this.onReset,\n className: cx('form', isSearchStalled && 'form--stalledSearch'),\n action: \"\",\n role: \"search\"\n }, React.createElement(\"input\", _extends({\n ref: this.onInputMount,\n type: \"search\",\n placeholder: translate('placeholder'),\n autoFocus: autoFocus,\n autoComplete: \"off\",\n autoCorrect: \"off\",\n autoCapitalize: \"off\",\n spellCheck: \"false\",\n required: true,\n maxLength: \"512\",\n value: query,\n onChange: this.onChange\n }, searchInputEvents, {\n className: cx('input')\n })), React.createElement(\"button\", {\n type: \"submit\",\n title: translate('submitTitle'),\n className: cx('submit')\n }, submit), React.createElement(\"button\", {\n type: \"reset\",\n title: translate('resetTitle'),\n className: cx('reset'),\n hidden: !query || isSearchStalled\n }, reset), this.props.showLoadingIndicator && React.createElement(\"span\", {\n hidden: !isSearchStalled,\n className: cx('loadingIndicator')\n }, loadingIndicator)));\n /* eslint-enable */\n }\n }]);\n\n return SearchBox;\n}(Component);\n\n_defineProperty(SearchBox, \"propTypes\", {\n currentRefinement: PropTypes.string,\n className: PropTypes.string,\n refine: PropTypes.func.isRequired,\n translate: PropTypes.func.isRequired,\n loadingIndicator: PropTypes.node,\n reset: PropTypes.node,\n submit: PropTypes.node,\n focusShortcuts: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n autoFocus: PropTypes.bool,\n searchAsYouType: PropTypes.bool,\n onSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onChange: PropTypes.func,\n isSearchStalled: PropTypes.bool,\n showLoadingIndicator: PropTypes.bool,\n // For testing purposes\n __inputRef: PropTypes.func\n});\n\n_defineProperty(SearchBox, \"defaultProps\", {\n currentRefinement: '',\n className: '',\n focusShortcuts: ['s', '/'],\n autoFocus: false,\n searchAsYouType: true,\n showLoadingIndicator: false,\n isSearchStalled: false,\n loadingIndicator: defaultLoadingIndicator,\n reset: defaultReset,\n submit: defaultSubmit\n});\n\nexport default translatable({\n resetTitle: 'Clear the search query.',\n submitTitle: 'Submit your search query.',\n placeholder: 'Search here…'\n})(SearchBox);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport SearchBox from '../components/SearchBox';\nvar itemsPropType = PropTypes.arrayOf(PropTypes.shape({\n value: PropTypes.any,\n label: PropTypes.node.isRequired,\n items: function items() {\n return itemsPropType.apply(void 0, arguments);\n }\n}));\n\nvar List =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(List, _Component);\n\n function List() {\n var _this;\n\n _classCallCheck(this, List);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(List).call(this));\n\n _defineProperty(_assertThisInitialized(_this), \"onShowMoreClick\", function () {\n _this.setState(function (state) {\n return {\n extended: !state.extended\n };\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getLimit\", function () {\n var _this$props = _this.props,\n limit = _this$props.limit,\n showMoreLimit = _this$props.showMoreLimit;\n var extended = _this.state.extended;\n return extended ? showMoreLimit : limit;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"resetQuery\", function () {\n _this.setState({\n query: ''\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderItem\", function (item, resetQuery) {\n var itemHasChildren = item.items && Boolean(item.items.length);\n return React.createElement(\"li\", {\n key: item.key || item.label,\n className: _this.props.cx('item', item.isRefined && 'item--selected', item.noRefinement && 'item--noRefinement', itemHasChildren && 'item--parent')\n }, _this.props.renderItem(item, resetQuery), itemHasChildren && React.createElement(\"ul\", {\n className: _this.props.cx('list', 'list--child')\n }, item.items.slice(0, _this.getLimit()).map(function (child) {\n return _this.renderItem(child, item);\n })));\n });\n\n _this.state = {\n extended: false,\n query: ''\n };\n return _this;\n }\n\n _createClass(List, [{\n key: \"renderShowMore\",\n value: function renderShowMore() {\n var _this$props2 = this.props,\n showMore = _this$props2.showMore,\n translate = _this$props2.translate,\n cx = _this$props2.cx;\n var extended = this.state.extended;\n var disabled = this.props.limit >= this.props.items.length;\n\n if (!showMore) {\n return null;\n }\n\n return React.createElement(\"button\", {\n disabled: disabled,\n className: cx('showMore', disabled && 'showMore--disabled'),\n onClick: this.onShowMoreClick\n }, translate('showMore', extended));\n }\n }, {\n key: \"renderSearchBox\",\n value: function renderSearchBox() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n cx = _this$props3.cx,\n searchForItems = _this$props3.searchForItems,\n isFromSearch = _this$props3.isFromSearch,\n translate = _this$props3.translate,\n items = _this$props3.items,\n selectItem = _this$props3.selectItem;\n var noResults = items.length === 0 && this.state.query !== '' ? React.createElement(\"div\", {\n className: cx('noResults')\n }, translate('noResults')) : null;\n return React.createElement(\"div\", {\n className: cx('searchBox')\n }, React.createElement(SearchBox, {\n currentRefinement: this.state.query,\n refine: function refine(value) {\n _this2.setState({\n query: value\n });\n\n searchForItems(value);\n },\n focusShortcuts: [],\n translate: translate,\n onSubmit: function onSubmit(e) {\n e.preventDefault();\n e.stopPropagation();\n\n if (isFromSearch) {\n selectItem(items[0], _this2.resetQuery);\n }\n }\n }), noResults);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var _this$props4 = this.props,\n cx = _this$props4.cx,\n items = _this$props4.items,\n className = _this$props4.className,\n searchable = _this$props4.searchable,\n canRefine = _this$props4.canRefine;\n var searchBox = searchable ? this.renderSearchBox() : null;\n var rootClassName = classNames(cx('', !canRefine && '-noRefinement'), className);\n\n if (items.length === 0) {\n return React.createElement(\"div\", {\n className: rootClassName\n }, searchBox);\n } // Always limit the number of items we show on screen, since the actual\n // number of retrieved items might vary with the `maxValuesPerFacet` config\n // option.\n\n\n return React.createElement(\"div\", {\n className: rootClassName\n }, searchBox, React.createElement(\"ul\", {\n className: cx('list', !canRefine && 'list--noRefinement')\n }, items.slice(0, this.getLimit()).map(function (item) {\n return _this3.renderItem(item, _this3.resetQuery);\n })), this.renderShowMore());\n }\n }]);\n\n return List;\n}(Component);\n\n_defineProperty(List, \"propTypes\", {\n cx: PropTypes.func.isRequired,\n // Only required with showMore.\n translate: PropTypes.func,\n items: itemsPropType,\n renderItem: PropTypes.func.isRequired,\n selectItem: PropTypes.func,\n className: PropTypes.string,\n showMore: PropTypes.bool,\n limit: PropTypes.number,\n showMoreLimit: PropTypes.number,\n show: PropTypes.func,\n searchForItems: PropTypes.func,\n searchable: PropTypes.bool,\n isFromSearch: PropTypes.bool,\n canRefine: PropTypes.bool\n});\n\n_defineProperty(List, \"defaultProps\", {\n className: '',\n isFromSearch: false\n});\n\nexport default List;","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nimport List from './List';\nimport Link from './Link';\nvar cx = createClassNames('HierarchicalMenu');\nvar itemsPropType = PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string.isRequired,\n value: PropTypes.string,\n count: PropTypes.number.isRequired,\n items: function items() {\n return itemsPropType.apply(void 0, arguments);\n }\n}));\n\nvar HierarchicalMenu =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(HierarchicalMenu, _Component);\n\n function HierarchicalMenu() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, HierarchicalMenu);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(HierarchicalMenu)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"renderItem\", function (item) {\n var _this$props = _this.props,\n createURL = _this$props.createURL,\n refine = _this$props.refine;\n return React.createElement(Link, {\n className: cx('link'),\n onClick: function onClick() {\n return refine(item.value);\n },\n href: createURL(item.value)\n }, React.createElement(\"span\", {\n className: cx('label')\n }, item.label), ' ', React.createElement(\"span\", {\n className: cx('count')\n }, item.count));\n });\n\n return _this;\n }\n\n _createClass(HierarchicalMenu, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n translate = _this$props2.translate,\n items = _this$props2.items,\n showMore = _this$props2.showMore,\n limit = _this$props2.limit,\n showMoreLimit = _this$props2.showMoreLimit,\n canRefine = _this$props2.canRefine,\n className = _this$props2.className;\n return React.createElement(List, {\n renderItem: this.renderItem,\n cx: cx,\n translate: translate,\n items: items,\n showMore: showMore,\n limit: limit,\n showMoreLimit: showMoreLimit,\n canRefine: canRefine,\n className: className\n });\n }\n }]);\n\n return HierarchicalMenu;\n}(Component);\n\n_defineProperty(HierarchicalMenu, \"propTypes\", {\n translate: PropTypes.func.isRequired,\n refine: PropTypes.func.isRequired,\n createURL: PropTypes.func.isRequired,\n canRefine: PropTypes.bool.isRequired,\n items: itemsPropType,\n showMore: PropTypes.bool,\n className: PropTypes.string,\n limit: PropTypes.number,\n showMoreLimit: PropTypes.number,\n transformItems: PropTypes.func\n});\n\n_defineProperty(HierarchicalMenu, \"defaultProps\", {\n className: ''\n});\n\nexport default translatable({\n showMore: function showMore(extended) {\n return extended ? 'Show less' : 'Show more';\n }\n})(HierarchicalMenu);","import React from 'react';\nimport { connectHierarchicalMenu } from 'react-instantsearch-core';\nimport PanelCallbackHandler from '../components/PanelCallbackHandler';\nimport HierarchicalMenu from '../components/HierarchicalMenu';\n/**\n * The hierarchical menu lets the user browse attributes using a tree-like structure.\n *\n * This is commonly used for multi-level categorization of products on e-commerce\n * websites. From a UX point of view, we suggest not displaying more than two levels deep.\n *\n * @name HierarchicalMenu\n * @kind widget\n * @requirements To use this widget, your attributes must be formatted in a specific way.\n * If you want for example to have a hiearchical menu of categories, objects in your index\n * should be formatted this way:\n *\n * ```json\n * [{\n * \"objectID\": \"321432\",\n * \"name\": \"lemon\",\n * \"categories.lvl0\": \"products\",\n * \"categories.lvl1\": \"products > fruits\",\n * },\n * {\n * \"objectID\": \"8976987\",\n * \"name\": \"orange\",\n * \"categories.lvl0\": \"products\",\n * \"categories.lvl1\": \"products > fruits\",\n * }]\n * ```\n *\n * It's also possible to provide more than one path for each level:\n *\n * ```json\n * {\n * \"objectID\": \"321432\",\n * \"name\": \"lemon\",\n * \"categories.lvl0\": [\"products\", \"goods\"],\n * \"categories.lvl1\": [\"products > fruits\", \"goods > to eat\"]\n * }\n * ```\n *\n * All attributes passed to the `attributes` prop must be present in \"attributes for faceting\"\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n *\n * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow.\n * @propType {boolean} [showMore=false] - Flag to activate the show more button, for toggling the number of items between limit and showMoreLimit.\n * @propType {number} [limit=10] - The maximum number of items displayed.\n * @propType {number} [showMoreLimit=20] - The maximum number of items displayed when the user triggers the show more. Not considered if `showMore` is false.\n * @propType {string} [separator='>'] - Specifies the level separator used in the data.\n * @propType {string} [rootPath=null] - The path to use if the first level is not the root level.\n * @propType {boolean} [showParentLevel=true] - Flag to set if the parent level should be displayed.\n * @propType {string} [defaultRefinement] - the item value selected by default\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @themeKey ais-HierarchicalMenu - the root div of the widget\n * @themeKey ais-HierarchicalMenu-noRefinement - the root div of the widget when there is no refinement\n * @themeKey ais-HierarchicalMenu-searchBox - the search box of the widget. See [the SearchBox documentation](widgets/SearchBox.html#classnames) for the classnames and translation keys of the SearchBox.\n * @themeKey ais-HierarchicalMenu-list - the list of menu items\n * @themeKey ais-HierarchicalMenu-list--child - the child list of menu items\n * @themeKey ais-HierarchicalMenu-item - the menu list item\n * @themeKey ais-HierarchicalMenu-item--selected - the selected menu list item\n * @themeKey ais-HierarchicalMenu-item--parent - the menu list item containing children\n * @themeKey ais-HierarchicalMenu-link - the clickable menu element\n * @themeKey ais-HierarchicalMenu-label - the label of each item\n * @themeKey ais-HierarchicalMenu-count - the count of values for each item\n * @themeKey ais-HierarchicalMenu-showMore - the button used to display more categories\n * @themeKey ais-HierarchicalMenu-showMore--disabled - the disabled button used to display more categories\n * @translationKey showMore - The label of the show more button. Accepts one parameter, a boolean that is true if the values are expanded\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, HierarchicalMenu } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <HierarchicalMenu\n * attributes={[\n * 'hierarchicalCategories.lvl0',\n * 'hierarchicalCategories.lvl1',\n * 'hierarchicalCategories.lvl2',\n * ]}\n * />\n * </InstantSearch>\n * );\n */\n\nvar HierarchicalMenuWidget = function HierarchicalMenuWidget(props) {\n return React.createElement(PanelCallbackHandler, props, React.createElement(HierarchicalMenu, props));\n};\n\nexport default connectHierarchicalMenu(HierarchicalMenuWidget);","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nexport var Highlight = function Highlight(_ref) {\n var cx = _ref.cx,\n value = _ref.value,\n highlightedTagName = _ref.highlightedTagName,\n isHighlighted = _ref.isHighlighted,\n nonHighlightedTagName = _ref.nonHighlightedTagName;\n var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;\n var className = isHighlighted ? 'highlighted' : 'nonHighlighted';\n return React.createElement(TagName, {\n className: cx(className)\n }, value);\n};\nHighlight.propTypes = {\n cx: PropTypes.func.isRequired,\n value: PropTypes.string.isRequired,\n isHighlighted: PropTypes.bool.isRequired,\n highlightedTagName: PropTypes.string.isRequired,\n nonHighlightedTagName: PropTypes.string.isRequired\n};\n\nvar Highlighter = function Highlighter(_ref2) {\n var cx = _ref2.cx,\n hit = _ref2.hit,\n attribute = _ref2.attribute,\n highlight = _ref2.highlight,\n highlightProperty = _ref2.highlightProperty,\n tagName = _ref2.tagName,\n nonHighlightedTagName = _ref2.nonHighlightedTagName,\n separator = _ref2.separator,\n className = _ref2.className;\n var parsedHighlightedValue = highlight({\n hit: hit,\n attribute: attribute,\n highlightProperty: highlightProperty\n });\n return React.createElement(\"span\", {\n className: classNames(cx(''), className)\n }, parsedHighlightedValue.map(function (item, i) {\n if (Array.isArray(item)) {\n var isLast = i === parsedHighlightedValue.length - 1;\n return React.createElement(\"span\", {\n key: i\n }, item.map(function (element, index) {\n return React.createElement(Highlight, {\n cx: cx,\n key: index,\n value: element.value,\n highlightedTagName: tagName,\n nonHighlightedTagName: nonHighlightedTagName,\n isHighlighted: element.isHighlighted\n });\n }), !isLast && React.createElement(\"span\", {\n className: cx('separator')\n }, separator));\n }\n\n return React.createElement(Highlight, {\n cx: cx,\n key: i,\n value: item.value,\n highlightedTagName: tagName,\n nonHighlightedTagName: nonHighlightedTagName,\n isHighlighted: item.isHighlighted\n });\n }));\n};\n\nHighlighter.propTypes = {\n cx: PropTypes.func.isRequired,\n hit: PropTypes.object.isRequired,\n attribute: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.string]).isRequired,\n highlight: PropTypes.func.isRequired,\n highlightProperty: PropTypes.string.isRequired,\n tagName: PropTypes.string,\n nonHighlightedTagName: PropTypes.string,\n className: PropTypes.string,\n separator: PropTypes.node\n};\nHighlighter.defaultProps = {\n tagName: 'em',\n nonHighlightedTagName: 'span',\n className: '',\n separator: ', '\n};\nexport default Highlighter;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport { createClassNames } from '../core/utils';\nimport Highlighter from './Highlighter';\nvar cx = createClassNames('Highlight');\n\nvar Highlight = function Highlight(props) {\n return React.createElement(Highlighter, _extends({}, props, {\n highlightProperty: \"_highlightResult\",\n cx: cx\n }));\n};\n\nexport default Highlight;","import { connectHighlight } from 'react-instantsearch-core';\nimport Highlight from '../components/Highlight';\n/**\n * Renders any attribute from a hit into its highlighted form when relevant.\n *\n * Read more about it in the [Highlighting results](guide/Highlighting_results.html) guide.\n * @name Highlight\n * @kind widget\n * @propType {string} attribute - location of the highlighted attribute in the hit (the corresponding element can be either a string or an array of strings)\n * @propType {object} hit - hit object containing the highlighted attribute\n * @propType {string} [tagName='em'] - tag to be used for highlighted parts of the hit\n * @propType {string} [nonHighlightedTagName='span'] - tag to be used for the parts of the hit that are not highlighted\n * @propType {node} [separator=',<space>'] - symbol used to separate the elements of the array in case the attribute points to an array of strings.\n * @themeKey ais-Highlight - root of the component\n * @themeKey ais-Highlight-highlighted - part of the text which is highlighted\n * @themeKey ais-Highlight-nonHighlighted - part of the text that is not highlighted\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, Highlight } from 'react-instantsearch-dom';\n *\n * const Hit = ({ hit }) => (\n * <div>\n * <Highlight attribute=\"name\" hit={hit} />\n * </div>\n * );\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox defaultRefinement=\"Pho\" />\n * <Hits hitComponent={Hit} />\n * </InstantSearch>\n * );\n */\n\nexport default connectHighlight(Highlight);","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('Hits');\n\nvar DefaultHitComponent = function DefaultHitComponent(props) {\n return React.createElement(\"div\", {\n style: {\n borderBottom: '1px solid #bbb',\n paddingBottom: '5px',\n marginBottom: '5px',\n wordBreak: 'break-all'\n }\n }, JSON.stringify(props).slice(0, 100), \"...\");\n};\n\nvar Hits = function Hits(_ref) {\n var hits = _ref.hits,\n _ref$className = _ref.className,\n className = _ref$className === void 0 ? '' : _ref$className,\n _ref$hitComponent = _ref.hitComponent,\n HitComponent = _ref$hitComponent === void 0 ? DefaultHitComponent : _ref$hitComponent;\n return React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, React.createElement(\"ul\", {\n className: cx('list')\n }, hits.map(function (hit) {\n return React.createElement(\"li\", {\n className: cx('item'),\n key: hit.objectID\n }, React.createElement(HitComponent, {\n hit: hit\n }));\n })));\n};\n\nvar HitPropTypes = PropTypes.shape({\n objectID: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired\n});\nHits.propTypes = {\n hits: PropTypes.arrayOf(HitPropTypes.isRequired).isRequired,\n className: PropTypes.string,\n hitComponent: PropTypes.func\n};\nexport default Hits;","import { connectHits } from 'react-instantsearch-core';\nimport Hits from '../components/Hits';\n/**\n * Displays a list of hits.\n *\n * To configure the number of hits being shown, use the [HitsPerPage widget](widgets/HitsPerPage.html),\n * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or the [Configure widget](widgets/Configure.html).\n *\n * @name Hits\n * @kind widget\n * @propType {Component} [hitComponent] - Component used for rendering each hit from\n * the results. If it is not provided the rendering defaults to displaying the\n * hit in its JSON form. The component will be called with a `hit` prop.\n * @themeKey ais-Hits - the root div of the widget\n * @themeKey ais-Hits-list - the list of results\n * @themeKey ais-Hits-item - the hit list item\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Hits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <Hits />\n * </InstantSearch>\n * );\n */\n\nexport default connectHits(Hits);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nvar Select =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Select, _Component);\n\n function Select() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Select);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Select)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"onChange\", function (e) {\n _this.props.onSelect(e.target.value);\n });\n\n return _this;\n }\n\n _createClass(Select, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n cx = _this$props.cx,\n items = _this$props.items,\n selectedItem = _this$props.selectedItem;\n return React.createElement(\"select\", {\n className: cx('select'),\n value: selectedItem,\n onChange: this.onChange\n }, items.map(function (item) {\n return React.createElement(\"option\", {\n className: cx('option'),\n key: item.key === undefined ? item.value : item.key,\n disabled: item.disabled,\n value: item.value\n }, item.label === undefined ? item.value : item.label);\n }));\n }\n }]);\n\n return Select;\n}(Component);\n\n_defineProperty(Select, \"propTypes\", {\n cx: PropTypes.func.isRequired,\n onSelect: PropTypes.func.isRequired,\n items: PropTypes.arrayOf(PropTypes.shape({\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n label: PropTypes.string,\n disabled: PropTypes.bool\n })).isRequired,\n selectedItem: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired\n});\n\nexport { Select as default };","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { createClassNames } from '../core/utils';\nimport Select from './Select';\nvar cx = createClassNames('HitsPerPage');\n\nvar HitsPerPage =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(HitsPerPage, _Component);\n\n function HitsPerPage() {\n _classCallCheck(this, HitsPerPage);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(HitsPerPage).apply(this, arguments));\n }\n\n _createClass(HitsPerPage, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n items = _this$props.items,\n currentRefinement = _this$props.currentRefinement,\n refine = _this$props.refine,\n className = _this$props.className;\n return React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, React.createElement(Select, {\n onSelect: refine,\n selectedItem: currentRefinement,\n items: items,\n cx: cx\n }));\n }\n }]);\n\n return HitsPerPage;\n}(Component);\n\n_defineProperty(HitsPerPage, \"propTypes\", {\n items: PropTypes.arrayOf(PropTypes.shape({\n value: PropTypes.number.isRequired,\n label: PropTypes.string\n })).isRequired,\n currentRefinement: PropTypes.number.isRequired,\n refine: PropTypes.func.isRequired,\n className: PropTypes.string\n});\n\n_defineProperty(HitsPerPage, \"defaultProps\", {\n className: ''\n});\n\nexport default HitsPerPage;","import { connectHitsPerPage } from 'react-instantsearch-core';\nimport HitsPerPage from '../components/HitsPerPage';\n/**\n * The HitsPerPage widget displays a dropdown menu to let the user change the number\n * of displayed hits.\n *\n * If you only want to configure the number of hits per page without\n * displaying a widget, you should use the `<Configure hitsPerPage={20} />` widget. See [`<Configure />` documentation](widgets/Configure.html)\n *\n * @name HitsPerPage\n * @kind widget\n * @propType {{value: number, label: string}[]} items - List of available options.\n * @propType {number} defaultRefinement - The number of items selected by default\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @themeKey ais-HitsPerPage - the root div of the widget\n * @themeKey ais-HitsPerPage-select - the select\n * @themeKey ais-HitsPerPage-option - the select option\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, HitsPerPage, Hits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <HitsPerPage\n * defaultRefinement={5}\n * items={[\n * { value: 5, label: 'Show 5 hits' },\n * { value: 10, label: 'Show 10 hits' },\n * ]}\n * />\n * <Hits />\n * </InstantSearch>\n * );\n */\n\nexport default connectHitsPerPage(HitsPerPage);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('InfiniteHits');\n\nvar InfiniteHits =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(InfiniteHits, _Component);\n\n function InfiniteHits() {\n _classCallCheck(this, InfiniteHits);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InfiniteHits).apply(this, arguments));\n }\n\n _createClass(InfiniteHits, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n HitComponent = _this$props.hitComponent,\n hits = _this$props.hits,\n showPrevious = _this$props.showPrevious,\n hasPrevious = _this$props.hasPrevious,\n hasMore = _this$props.hasMore,\n refinePrevious = _this$props.refinePrevious,\n refineNext = _this$props.refineNext,\n translate = _this$props.translate,\n className = _this$props.className;\n return React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, showPrevious && React.createElement(\"button\", {\n className: cx('loadPrevious', !hasPrevious && 'loadPrevious--disabled'),\n onClick: function onClick() {\n return refinePrevious();\n },\n disabled: !hasPrevious\n }, translate('loadPrevious')), React.createElement(\"ul\", {\n className: cx('list')\n }, hits.map(function (hit) {\n return React.createElement(\"li\", {\n key: hit.objectID,\n className: cx('item')\n }, React.createElement(HitComponent, {\n hit: hit\n }));\n })), React.createElement(\"button\", {\n className: cx('loadMore', !hasMore && 'loadMore--disabled'),\n onClick: function onClick() {\n return refineNext();\n },\n disabled: !hasMore\n }, translate('loadMore')));\n }\n }]);\n\n return InfiniteHits;\n}(Component);\n\nInfiniteHits.propTypes = {\n hits: PropTypes.arrayOf(PropTypes.object).isRequired,\n showPrevious: PropTypes.bool.isRequired,\n hasPrevious: PropTypes.bool.isRequired,\n hasMore: PropTypes.bool.isRequired,\n refinePrevious: PropTypes.func.isRequired,\n refineNext: PropTypes.func.isRequired,\n translate: PropTypes.func.isRequired,\n className: PropTypes.string,\n hitComponent: PropTypes.oneOfType([PropTypes.string, PropTypes.func])\n};\nInfiniteHits.defaultProps = {\n className: '',\n showPrevious: false,\n hitComponent: function hitComponent(hit) {\n return React.createElement(\"div\", {\n style: {\n borderBottom: '1px solid #bbb',\n paddingBottom: '5px',\n marginBottom: '5px',\n wordBreak: 'break-all'\n }\n }, JSON.stringify(hit).slice(0, 100), \"...\");\n }\n};\nexport default translatable({\n loadPrevious: 'Load previous',\n loadMore: 'Load more'\n})(InfiniteHits);","import { connectInfiniteHits } from 'react-instantsearch-core';\nimport InfiniteHits from '../components/InfiniteHits';\n/**\n * Displays an infinite list of hits along with a **load more** button.\n *\n * To configure the number of hits being shown, use the [HitsPerPage widget](widgets/HitsPerPage.html),\n * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or the [Configure widget](widgets/Configure.html).\n *\n * @name InfiniteHits\n * @kind widget\n * @propType {Component} [hitComponent] - Component used for rendering each hit from\n * the results. If it is not provided the rendering defaults to displaying the\n * hit in its JSON form. The component will be called with a `hit` prop.\n * @themeKey ais-InfiniteHits - the root div of the widget\n * @themeKey ais-InfiniteHits-list - the list of hits\n * @themeKey ais-InfiniteHits-item - the hit list item\n * @themeKey ais-InfiniteHits-loadMore - the button used to display more results\n * @themeKey ais-InfiniteHits-loadMore--disabled - the disabled button used to display more results\n * @translationKey loadMore - the label of load more button\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, InfiniteHits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <InfiniteHits />\n * </InstantSearch>\n * );\n */\n\nexport default connectInfiniteHits(InfiniteHits);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nimport Highlight from '../widgets/Highlight';\nimport List from './List';\nimport Link from './Link';\nvar cx = createClassNames('Menu');\n\nvar Menu =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Menu, _Component);\n\n function Menu() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Menu);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Menu)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"renderItem\", function (item, resetQuery) {\n var createURL = _this.props.createURL;\n var label = _this.props.isFromSearch ? React.createElement(Highlight, {\n attribute: \"label\",\n hit: item\n }) : item.label;\n return React.createElement(Link, {\n className: cx('link'),\n onClick: function onClick() {\n return _this.selectItem(item, resetQuery);\n },\n href: createURL(item.value)\n }, React.createElement(\"span\", {\n className: cx('label')\n }, label), ' ', React.createElement(\"span\", {\n className: cx('count')\n }, item.count));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"selectItem\", function (item, resetQuery) {\n resetQuery();\n\n _this.props.refine(item.value);\n });\n\n return _this;\n }\n\n _createClass(Menu, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n translate = _this$props.translate,\n items = _this$props.items,\n showMore = _this$props.showMore,\n limit = _this$props.limit,\n showMoreLimit = _this$props.showMoreLimit,\n isFromSearch = _this$props.isFromSearch,\n searchForItems = _this$props.searchForItems,\n searchable = _this$props.searchable,\n canRefine = _this$props.canRefine,\n className = _this$props.className;\n return React.createElement(List, {\n renderItem: this.renderItem,\n selectItem: this.selectItem,\n cx: cx,\n translate: translate,\n items: items,\n showMore: showMore,\n limit: limit,\n showMoreLimit: showMoreLimit,\n isFromSearch: isFromSearch,\n searchForItems: searchForItems,\n searchable: searchable,\n canRefine: canRefine,\n className: className\n });\n }\n }]);\n\n return Menu;\n}(Component);\n\n_defineProperty(Menu, \"propTypes\", {\n translate: PropTypes.func.isRequired,\n refine: PropTypes.func.isRequired,\n searchForItems: PropTypes.func.isRequired,\n searchable: PropTypes.bool,\n createURL: PropTypes.func.isRequired,\n items: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string.isRequired,\n value: PropTypes.string.isRequired,\n count: PropTypes.number.isRequired,\n isRefined: PropTypes.bool.isRequired\n })),\n isFromSearch: PropTypes.bool.isRequired,\n canRefine: PropTypes.bool.isRequired,\n showMore: PropTypes.bool,\n limit: PropTypes.number,\n showMoreLimit: PropTypes.number,\n transformItems: PropTypes.func,\n className: PropTypes.string\n});\n\n_defineProperty(Menu, \"defaultProps\", {\n className: ''\n});\n\nexport default translatable({\n showMore: function showMore(extended) {\n return extended ? 'Show less' : 'Show more';\n },\n noResults: 'No results',\n submit: null,\n reset: null,\n resetTitle: 'Clear the search query.',\n submitTitle: 'Submit your search query.',\n placeholder: 'Search here…'\n})(Menu);","import React from 'react';\nimport { connectMenu } from 'react-instantsearch-core';\nimport PanelCallbackHandler from '../components/PanelCallbackHandler';\nimport Menu from '../components/Menu';\n/**\n * The Menu component displays a menu that lets the user choose a single value for a specific attribute.\n * @name Menu\n * @kind widget\n * @requirements The attribute passed to the `attribute` prop must be present in \"attributes for faceting\"\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n *\n * If you are using the `searchable` prop, you'll also need to make the attribute searchable using\n * the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values).\n * @propType {string} attribute - the name of the attribute in the record\n * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items\n * @propType {number} [limit=10] - the minimum number of diplayed items\n * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true`\n * @propType {string} [defaultRefinement] - the value of the item selected by default\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @propType {boolean} [searchable=false] - true if the component should display an input to search for facet values. <br> In order to make this feature work, you need to make the attribute searchable [using the API](https://www.algolia.com/doc/guides/searching/faceting/?language=js#declaring-a-searchable-attribute-for-faceting) or [the dashboard](https://www.algolia.com/explorer/display/).\n * @themeKey ais-Menu - the root div of the widget\n * @themeKey ais-Menu-searchBox - the search box of the widget. See [the SearchBox documentation](widgets/SearchBox.html#classnames) for the classnames and translation keys of the SearchBox.\n * @themeKey ais-Menu-list - the list of all menu items\n * @themeKey ais-Menu-item - the menu list item\n * @themeKey ais-Menu-item--selected - the selected menu list item\n * @themeKey ais-Menu-link - the clickable menu element\n * @themeKey ais-Menu-label - the label of each item\n * @themeKey ais-Menu-count - the count of values for each item\n * @themeKey ais-Menu-noResults - the div displayed when there are no results\n * @themeKey ais-Menu-showMore - the button used to display more categories\n * @themeKey ais-Menu-showMore--disabled - the disabled button used to display more categories\n * @translationkey showMore - The label of the show more button. Accepts one parameters, a boolean that is true if the values are expanded\n * @translationkey noResults - The label of the no results text when no search for facet values results are found.\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Menu } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <Menu attribute=\"categories\" />\n * </InstantSearch>\n * );\n */\n\nvar MenuWidget = function MenuWidget(props) {\n return React.createElement(PanelCallbackHandler, props, React.createElement(Menu, props));\n};\n\nexport default connectMenu(MenuWidget);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames, find } from '../core/utils';\nvar cx = createClassNames('MenuSelect');\n\nvar MenuSelect =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(MenuSelect, _Component);\n\n function MenuSelect() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, MenuSelect);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(MenuSelect)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleSelectChange\", function (_ref) {\n var value = _ref.target.value;\n\n _this.props.refine(value === 'ais__see__all__option' ? '' : value);\n });\n\n return _this;\n }\n\n _createClass(MenuSelect, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n items = _this$props.items,\n canRefine = _this$props.canRefine,\n translate = _this$props.translate,\n className = _this$props.className;\n return React.createElement(\"div\", {\n className: classNames(cx('', !canRefine && '-noRefinement'), className)\n }, React.createElement(\"select\", {\n value: this.selectedValue,\n onChange: this.handleSelectChange,\n className: cx('select')\n }, React.createElement(\"option\", {\n value: \"ais__see__all__option\",\n className: cx('option')\n }, translate('seeAllOption')), items.map(function (item) {\n return React.createElement(\"option\", {\n key: item.value,\n value: item.value,\n className: cx('option')\n }, item.label, \" (\", item.count, \")\");\n })));\n }\n }, {\n key: \"selectedValue\",\n get: function get() {\n var _ref2 = find(this.props.items, function (item) {\n return item.isRefined === true;\n }) || {\n value: 'ais__see__all__option'\n },\n value = _ref2.value;\n\n return value;\n }\n }]);\n\n return MenuSelect;\n}(Component);\n\n_defineProperty(MenuSelect, \"propTypes\", {\n items: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string.isRequired,\n value: PropTypes.string.isRequired,\n count: PropTypes.oneOfType([PropTypes.number.isRequired, PropTypes.string.isRequired]),\n isRefined: PropTypes.bool.isRequired\n })).isRequired,\n canRefine: PropTypes.bool.isRequired,\n refine: PropTypes.func.isRequired,\n translate: PropTypes.func.isRequired,\n className: PropTypes.string\n});\n\n_defineProperty(MenuSelect, \"defaultProps\", {\n className: ''\n});\n\nexport default translatable({\n seeAllOption: 'See all'\n})(MenuSelect);","import React from 'react';\nimport { connectMenu } from 'react-instantsearch-core';\nimport PanelCallbackHandler from '../components/PanelCallbackHandler';\nimport MenuSelect from '../components/MenuSelect';\n/**\n * The MenuSelect component displays a select that lets the user choose a single value for a specific attribute.\n * @name MenuSelect\n * @kind widget\n * @requirements The attribute passed to the `attribute` prop must be present in \"attributes for faceting\"\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n * @propType {string} attribute - the name of the attribute in the record\n * @propType {string} [defaultRefinement] - the value of the item selected by default\n * @propType {number} [limit=10] - the minimum number of diplayed items\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @themeKey ais-MenuSelect - the root div of the widget\n * @themeKey ais-MenuSelect-noRefinement - the root div of the widget when there is no refinement\n * @themeKey ais-MenuSelect-select - the `<select>`\n * @themeKey ais-MenuSelect-option - the select `<option>`\n * @translationkey seeAllOption - The label of the option to select to remove the refinement\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, MenuSelect } from 'react-instantsearch-dom';\n\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <MenuSelect attribute=\"categories\" />\n * </InstantSearch>\n * );\n */\n\nvar MenuSelectWidget = function MenuSelectWidget(props) {\n return React.createElement(PanelCallbackHandler, props, React.createElement(MenuSelect, props));\n};\n\nexport default connectMenu(MenuSelectWidget);","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nimport List from './List';\nvar cx = createClassNames('NumericMenu');\n\nvar NumericMenu =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(NumericMenu, _Component);\n\n function NumericMenu() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, NumericMenu);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(NumericMenu)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"renderItem\", function (item) {\n var _this$props = _this.props,\n refine = _this$props.refine,\n translate = _this$props.translate;\n return React.createElement(\"label\", {\n className: cx('label')\n }, React.createElement(\"input\", {\n className: cx('radio'),\n type: \"radio\",\n checked: item.isRefined,\n disabled: item.noRefinement,\n onChange: function onChange() {\n return refine(item.value);\n }\n }), React.createElement(\"span\", {\n className: cx('labelText')\n }, item.value === '' ? translate('all') : item.label));\n });\n\n return _this;\n }\n\n _createClass(NumericMenu, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n items = _this$props2.items,\n canRefine = _this$props2.canRefine,\n className = _this$props2.className;\n return React.createElement(List, {\n renderItem: this.renderItem,\n showMore: false,\n canRefine: canRefine,\n cx: cx,\n items: items.map(function (item) {\n return _objectSpread({}, item, {\n key: item.value\n });\n }),\n className: className\n });\n }\n }]);\n\n return NumericMenu;\n}(Component);\n\n_defineProperty(NumericMenu, \"propTypes\", {\n items: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.node.isRequired,\n value: PropTypes.string.isRequired,\n isRefined: PropTypes.bool.isRequired,\n noRefinement: PropTypes.bool.isRequired\n })).isRequired,\n canRefine: PropTypes.bool.isRequired,\n refine: PropTypes.func.isRequired,\n translate: PropTypes.func.isRequired,\n className: PropTypes.string\n});\n\n_defineProperty(NumericMenu, \"defaultProps\", {\n className: ''\n});\n\nexport default translatable({\n all: 'All'\n})(NumericMenu);","import React from 'react';\nimport { connectNumericMenu } from 'react-instantsearch-core';\nimport PanelCallbackHandler from '../components/PanelCallbackHandler';\nimport NumericMenu from '../components/NumericMenu';\n/**\n * NumericMenu is a widget used for selecting the range value of a numeric attribute.\n * @name NumericMenu\n * @kind widget\n * @requirements The attribute passed to the `attribute` prop must be holding numerical values.\n * @propType {string} attribute - the name of the attribute in the records\n * @propType {{label: string, start: number, end: number}[]} items - List of options. With a text label, and upper and lower bounds.\n * @propType {string} [defaultRefinement] - the value of the item selected by default, follow the format \"min:max\".\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @themeKey ais-NumericMenu - the root div of the widget\n * @themeKey ais-NumericMenu--noRefinement - the root div of the widget when there is no refinement\n * @themeKey ais-NumericMenu-list - the list of all refinement items\n * @themeKey ais-NumericMenu-item - the refinement list item\n * @themeKey ais-NumericMenu-item--selected - the selected refinement list item\n * @themeKey ais-NumericMenu-label - the label of each refinement item\n * @themeKey ais-NumericMenu-radio - the radio input of each refinement item\n * @themeKey ais-NumericMenu-labelText - the label text of each refinement item\n * @translationkey all - The label of the largest range added automatically by react instantsearch\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, NumericMenu } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient\n * indexName=\"instant_search\"\n * >\n * <NumericMenu\n * attribute=\"price\"\n * items={[\n * { end: 10, label: '< $10' },\n * { start: 10, end: 100, label: '$10 - $100' },\n * { start: 100, end: 500, label: '$100 - $500' },\n * { start: 500, label: '> $500' },\n * ]}\n * />\n * </InstantSearch>\n * );\n */\n\nvar NumericMenuWidget = function NumericMenuWidget(props) {\n return React.createElement(PanelCallbackHandler, props, React.createElement(NumericMenu, props));\n};\n\nexport default connectNumericMenu(NumericMenuWidget);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Link from './Link';\n\nvar LinkList =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(LinkList, _Component);\n\n function LinkList() {\n _classCallCheck(this, LinkList);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(LinkList).apply(this, arguments));\n }\n\n _createClass(LinkList, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n cx = _this$props.cx,\n createURL = _this$props.createURL,\n items = _this$props.items,\n onSelect = _this$props.onSelect,\n canRefine = _this$props.canRefine;\n return React.createElement(\"ul\", {\n className: cx('list', !canRefine && 'list--noRefinement')\n }, items.map(function (item) {\n return React.createElement(\"li\", {\n key: item.key === undefined ? item.value : item.key,\n className: cx('item', item.selected && !item.disabled && 'item--selected', item.disabled && 'item--disabled', item.modifier)\n }, item.disabled ? React.createElement(\"span\", {\n className: cx('link')\n }, item.label === undefined ? item.value : item.label) : React.createElement(Link, {\n className: cx('link', item.selected && 'link--selected'),\n \"aria-label\": item.ariaLabel,\n href: createURL(item.value),\n onClick: function onClick() {\n return onSelect(item.value);\n }\n }, item.label === undefined ? item.value : item.label));\n }));\n }\n }]);\n\n return LinkList;\n}(Component);\n\n_defineProperty(LinkList, \"propTypes\", {\n cx: PropTypes.func.isRequired,\n createURL: PropTypes.func.isRequired,\n items: PropTypes.arrayOf(PropTypes.shape({\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).isRequired,\n key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n label: PropTypes.node,\n modifier: PropTypes.string,\n ariaLabel: PropTypes.string,\n disabled: PropTypes.bool\n })),\n onSelect: PropTypes.func.isRequired,\n canRefine: PropTypes.bool.isRequired\n});\n\nexport { LinkList as default };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames, capitalize, range } from '../core/utils';\nimport LinkList from './LinkList';\nvar cx = createClassNames('Pagination'); // Determines the size of the widget (the number of pages displayed - that the user can directly click on)\n\nfunction calculateSize(padding, maxPages) {\n return Math.min(2 * padding + 1, maxPages);\n}\n\nfunction calculatePaddingLeft(currentPage, padding, maxPages, size) {\n if (currentPage <= padding) {\n return currentPage;\n }\n\n if (currentPage >= maxPages - padding) {\n return size - (maxPages - currentPage);\n }\n\n return padding + 1;\n} // Retrieve the correct page range to populate the widget\n\n\nfunction getPages(currentPage, maxPages, padding) {\n var size = calculateSize(padding, maxPages); // If the widget size is equal to the max number of pages, return the entire page range\n\n if (size === maxPages) return range({\n start: 1,\n end: maxPages + 1\n });\n var paddingLeft = calculatePaddingLeft(currentPage, padding, maxPages, size);\n var paddingRight = size - paddingLeft;\n var first = currentPage - paddingLeft;\n var last = currentPage + paddingRight;\n return range({\n start: first + 1,\n end: last + 1\n });\n}\n\nvar Pagination =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Pagination, _Component);\n\n function Pagination() {\n _classCallCheck(this, Pagination);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Pagination).apply(this, arguments));\n }\n\n _createClass(Pagination, [{\n key: \"getItem\",\n value: function getItem(modifier, translationKey, value) {\n var _this$props = this.props,\n nbPages = _this$props.nbPages,\n totalPages = _this$props.totalPages,\n translate = _this$props.translate;\n return {\n key: \"\".concat(modifier, \".\").concat(value),\n modifier: modifier,\n disabled: value < 1 || value >= Math.min(totalPages, nbPages),\n label: translate(translationKey, value),\n value: value,\n ariaLabel: translate(\"aria\".concat(capitalize(translationKey)), value)\n };\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n ListComponent = _this$props2.listComponent,\n nbPages = _this$props2.nbPages,\n totalPages = _this$props2.totalPages,\n currentRefinement = _this$props2.currentRefinement,\n padding = _this$props2.padding,\n showFirst = _this$props2.showFirst,\n showPrevious = _this$props2.showPrevious,\n showNext = _this$props2.showNext,\n showLast = _this$props2.showLast,\n refine = _this$props2.refine,\n createURL = _this$props2.createURL,\n canRefine = _this$props2.canRefine,\n translate = _this$props2.translate,\n className = _this$props2.className,\n otherProps = _objectWithoutProperties(_this$props2, [\"listComponent\", \"nbPages\", \"totalPages\", \"currentRefinement\", \"padding\", \"showFirst\", \"showPrevious\", \"showNext\", \"showLast\", \"refine\", \"createURL\", \"canRefine\", \"translate\", \"className\"]);\n\n var maxPages = Math.min(nbPages, totalPages);\n var lastPage = maxPages;\n var items = [];\n\n if (showFirst) {\n items.push({\n key: 'first',\n modifier: 'item--firstPage',\n disabled: currentRefinement === 1,\n label: translate('first'),\n value: 1,\n ariaLabel: translate('ariaFirst')\n });\n }\n\n if (showPrevious) {\n items.push({\n key: 'previous',\n modifier: 'item--previousPage',\n disabled: currentRefinement === 1,\n label: translate('previous'),\n value: currentRefinement - 1,\n ariaLabel: translate('ariaPrevious')\n });\n }\n\n items = items.concat(getPages(currentRefinement, maxPages, padding).map(function (value) {\n return {\n key: value,\n modifier: 'item--page',\n label: translate('page', value),\n value: value,\n selected: value === currentRefinement,\n ariaLabel: translate('ariaPage', value)\n };\n }));\n\n if (showNext) {\n items.push({\n key: 'next',\n modifier: 'item--nextPage',\n disabled: currentRefinement === lastPage || lastPage <= 1,\n label: translate('next'),\n value: currentRefinement + 1,\n ariaLabel: translate('ariaNext')\n });\n }\n\n if (showLast) {\n items.push({\n key: 'last',\n modifier: 'item--lastPage',\n disabled: currentRefinement === lastPage || lastPage <= 1,\n label: translate('last'),\n value: lastPage,\n ariaLabel: translate('ariaLast')\n });\n }\n\n return React.createElement(\"div\", {\n className: classNames(cx('', !canRefine && '-noRefinement'), className)\n }, React.createElement(ListComponent, _extends({}, otherProps, {\n cx: cx,\n items: items,\n onSelect: refine,\n createURL: createURL,\n canRefine: canRefine\n })));\n }\n }]);\n\n return Pagination;\n}(Component);\n\n_defineProperty(Pagination, \"propTypes\", {\n nbPages: PropTypes.number.isRequired,\n currentRefinement: PropTypes.number.isRequired,\n refine: PropTypes.func.isRequired,\n createURL: PropTypes.func.isRequired,\n canRefine: PropTypes.bool.isRequired,\n translate: PropTypes.func.isRequired,\n listComponent: PropTypes.func,\n showFirst: PropTypes.bool,\n showPrevious: PropTypes.bool,\n showNext: PropTypes.bool,\n showLast: PropTypes.bool,\n padding: PropTypes.number,\n totalPages: PropTypes.number,\n className: PropTypes.string\n});\n\n_defineProperty(Pagination, \"defaultProps\", {\n listComponent: LinkList,\n showFirst: true,\n showPrevious: true,\n showNext: true,\n showLast: false,\n padding: 3,\n totalPages: Infinity,\n className: ''\n});\n\nexport default translatable({\n previous: '‹',\n next: '›',\n first: '«',\n last: '»',\n page: function page(currentRefinement) {\n return currentRefinement.toString();\n },\n ariaPrevious: 'Previous page',\n ariaNext: 'Next page',\n ariaFirst: 'First page',\n ariaLast: 'Last page',\n ariaPage: function ariaPage(currentRefinement) {\n return \"Page \".concat(currentRefinement.toString());\n }\n})(Pagination);","import React from 'react';\nimport { connectPagination } from 'react-instantsearch-core';\nimport PanelCallbackHandler from '../components/PanelCallbackHandler';\nimport Pagination from '../components/Pagination';\n/**\n * The Pagination widget displays a simple pagination system allowing the user to\n * change the current page.\n * @name Pagination\n * @kind widget\n * @propType {boolean} [showFirst=true] - Display the first page link.\n * @propType {boolean} [showLast=false] - Display the last page link.\n * @propType {boolean} [showPrevious=true] - Display the previous page link.\n * @propType {boolean} [showNext=true] - Display the next page link.\n * @propType {number} [padding=3] - How many page links to display around the current page.\n * @propType {number} [totalPages=Infinity] - Maximum number of pages to display.\n * @themeKey ais-Pagination - the root div of the widget\n * @themeKey ais-Pagination--noRefinement - the root div of the widget when there is no refinement\n * @themeKey ais-Pagination-list - the list of all pagination items\n * @themeKey ais-Pagination-list--noRefinement - the list of all pagination items when there is no refinement\n * @themeKey ais-Pagination-item - the pagination list item\n * @themeKey ais-Pagination-item--firstPage - the \"first\" pagination list item\n * @themeKey ais-Pagination-item--lastPage - the \"last\" pagination list item\n * @themeKey ais-Pagination-item--previousPage - the \"previous\" pagination list item\n * @themeKey ais-Pagination-item--nextPage - the \"next\" pagination list item\n * @themeKey ais-Pagination-item--page - the \"page\" pagination list item\n * @themeKey ais-Pagination-item--selected - the selected pagination list item\n * @themeKey ais-Pagination-item--disabled - the disabled pagination list item\n * @themeKey ais-Pagination-link - the pagination clickable element\n * @translationKey previous - Label value for the previous page link\n * @translationKey next - Label value for the next page link\n * @translationKey first - Label value for the first page link\n * @translationKey last - Label value for the last page link\n * @translationkey page - Label value for a page item. You get function(currentRefinement) and you need to return a string\n * @translationKey ariaPrevious - Accessibility label value for the previous page link\n * @translationKey ariaNext - Accessibility label value for the next page link\n * @translationKey ariaFirst - Accessibility label value for the first page link\n * @translationKey ariaLast - Accessibility label value for the last page link\n * @translationkey ariaPage - Accessibility label value for a page item. You get function(currentRefinement) and you need to return a string\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Pagination } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <Pagination />\n * </InstantSearch>\n * );\n */\n\nvar PaginationWidget = function PaginationWidget(props) {\n return React.createElement(PanelCallbackHandler, props, React.createElement(Pagination, props));\n};\n\nexport default connectPagination(PaginationWidget);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('PoweredBy');\n/* eslint-disable max-len */\n\nvar AlgoliaLogo = function AlgoliaLogo() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n baseProfile: \"basic\",\n viewBox: \"0 0 1366 362\",\n width: \"100\",\n height: \"27\",\n className: cx('logo')\n }, React.createElement(\"linearGradient\", {\n id: \"g\",\n x1: \"428.258\",\n x2: \"434.145\",\n y1: \"404.15\",\n y2: \"409.85\",\n gradientUnits: \"userSpaceOnUse\",\n gradientTransform: \"matrix(94.045 0 0 -94.072 -40381.527 38479.52)\"\n }, React.createElement(\"stop\", {\n offset: \"0\",\n stopColor: \"#00AEFF\"\n }), React.createElement(\"stop\", {\n offset: \"1\",\n stopColor: \"#3369E7\"\n })), React.createElement(\"path\", {\n d: \"M61.8 15.4h242.8c23.9 0 43.4 19.4 43.4 43.4v242.9c0 23.9-19.4 43.4-43.4 43.4H61.8c-23.9 0-43.4-19.4-43.4-43.4v-243c0-23.9 19.4-43.3 43.4-43.3z\",\n fill: \"url(#g)\"\n }), React.createElement(\"path\", {\n d: \"M187 98.7c-51.4 0-93.1 41.7-93.1 93.2S135.6 285 187 285s93.1-41.7 93.1-93.2-41.6-93.1-93.1-93.1zm0 158.8c-36.2 0-65.6-29.4-65.6-65.6s29.4-65.6 65.6-65.6 65.6 29.4 65.6 65.6-29.3 65.6-65.6 65.6zm0-117.8v48.9c0 1.4 1.5 2.4 2.8 1.7l43.4-22.5c1-.5 1.3-1.7.8-2.7-9-15.8-25.7-26.6-45-27.3-1 0-2 .8-2 1.9zm-60.8-35.9l-5.7-5.7c-5.6-5.6-14.6-5.6-20.2 0l-6.8 6.8c-5.6 5.6-5.6 14.6 0 20.2l5.6 5.6c.9.9 2.2.7 3-.2 3.3-4.5 6.9-8.8 10.9-12.8 4.1-4.1 8.3-7.7 12.9-11 1-.6 1.1-2 .3-2.9zM217.5 89V77.7c0-7.9-6.4-14.3-14.3-14.3h-33.3c-7.9 0-14.3 6.4-14.3 14.3v11.6c0 1.3 1.2 2.2 2.5 1.9 9.3-2.7 19.1-4.1 29-4.1 9.5 0 18.9 1.3 28 3.8 1.2.3 2.4-.6 2.4-1.9z\",\n fill: \"#FFFFFF\"\n }), React.createElement(\"path\", {\n d: \"M842.5 267.6c0 26.7-6.8 46.2-20.5 58.6-13.7 12.4-34.6 18.6-62.8 18.6-10.3 0-31.7-2-48.8-5.8l6.3-31c14.3 3 33.2 3.8 43.1 3.8 15.7 0 26.9-3.2 33.6-9.6s10-15.9 10-28.5v-6.4c-3.9 1.9-9 3.8-15.3 5.8-6.3 1.9-13.6 2.9-21.8 2.9-10.8 0-20.6-1.7-29.5-5.1-8.9-3.4-16.6-8.4-22.9-15-6.3-6.6-11.3-14.9-14.8-24.8s-5.3-27.6-5.3-40.6c0-12.2 1.9-27.5 5.6-37.7 3.8-10.2 9.2-19 16.5-26.3 7.2-7.3 16-12.9 26.3-17s22.4-6.7 35.5-6.7c12.7 0 24.4 1.6 35.8 3.5 11.4 1.9 21.1 3.9 29 6.1v155.2zm-108.7-77.2c0 16.4 3.6 34.6 10.8 42.2 7.2 7.6 16.5 11.4 27.9 11.4 6.2 0 12.1-.9 17.6-2.6 5.5-1.7 9.9-3.7 13.4-6.1v-97.1c-2.8-.6-14.5-3-25.8-3.3-14.2-.4-25 5.4-32.6 14.7-7.5 9.3-11.3 25.6-11.3 40.8zm294.3 0c0 13.2-1.9 23.2-5.8 34.1s-9.4 20.2-16.5 27.9c-7.1 7.7-15.6 13.7-25.6 17.9s-25.4 6.6-33.1 6.6c-7.7-.1-23-2.3-32.9-6.6-9.9-4.3-18.4-10.2-25.5-17.9-7.1-7.7-12.6-17-16.6-27.9s-6-20.9-6-34.1c0-13.2 1.8-25.9 5.8-36.7 4-10.8 9.6-20 16.8-27.7s15.8-13.6 25.6-17.8c9.9-4.2 20.8-6.2 32.6-6.2s22.7 2.1 32.7 6.2c10 4.2 18.6 10.1 25.6 17.8 7.1 7.7 12.6 16.9 16.6 27.7 4.2 10.8 6.3 23.5 6.3 36.7zm-40 .1c0-16.9-3.7-31-10.9-40.8-7.2-9.9-17.3-14.8-30.2-14.8-12.9 0-23 4.9-30.2 14.8-7.2 9.9-10.7 23.9-10.7 40.8 0 17.1 3.6 28.6 10.8 38.5 7.2 10 17.3 14.9 30.2 14.9 12.9 0 23-5 30.2-14.9 7.2-10 10.8-21.4 10.8-38.5zm127.1 86.4c-64.1.3-64.1-51.8-64.1-60.1L1051 32l39.1-6.2v183.6c0 4.7 0 34.5 25.1 34.6v32.9zm68.9 0h-39.3V108.1l39.3-6.2v175zm-19.7-193.5c13.1 0 23.8-10.6 23.8-23.7S1177.6 36 1164.4 36s-23.8 10.6-23.8 23.7 10.7 23.7 23.8 23.7zm117.4 18.6c12.9 0 23.8 1.6 32.6 4.8 8.8 3.2 15.9 7.7 21.1 13.4s8.9 13.5 11.1 21.7c2.3 8.2 3.4 17.2 3.4 27.1v100.6c-6 1.3-15.1 2.8-27.3 4.6s-25.9 2.7-41.1 2.7c-10.1 0-19.4-1-27.7-2.9-8.4-1.9-15.5-5-21.5-9.3-5.9-4.3-10.5-9.8-13.9-16.6-3.3-6.8-5-16.4-5-26.4 0-9.6 1.9-15.7 5.6-22.3 3.8-6.6 8.9-12 15.3-16.2 6.5-4.2 13.9-7.2 22.4-9s17.4-2.7 26.6-2.7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-8.6-1-13.6-1-4.3 0-8.7.3-13.1 1-4.4.6-8.4 1.8-11.9 3.5s-6.4 4.1-8.5 7.2c-2.2 3.1-3.2 4.9-3.2 9.6 0 9.2 3.2 14.5 9 18s13.7 5.3 23.6 5.3zm158.5 31.9c-64.1.3-64.1-51.8-64.1-60.1L610.6 32l39.1-6.2v183.6c0 4.7 0 34.5 25.1 34.6v32.9z\",\n fill: \"#182359\"\n }));\n};\n/* eslint-enable max-len */\n\n\nvar PoweredBy =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(PoweredBy, _Component);\n\n function PoweredBy() {\n _classCallCheck(this, PoweredBy);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PoweredBy).apply(this, arguments));\n }\n\n _createClass(PoweredBy, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n url = _this$props.url,\n translate = _this$props.translate,\n className = _this$props.className;\n return React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, React.createElement(\"span\", {\n className: cx('text')\n }, translate('searchBy')), ' ', React.createElement(\"a\", {\n href: url,\n target: \"_blank\",\n className: cx('link'),\n \"aria-label\": \"Algolia\",\n rel: \"noopener noreferrer\"\n }, React.createElement(AlgoliaLogo, null)));\n }\n }]);\n\n return PoweredBy;\n}(Component);\n\n_defineProperty(PoweredBy, \"propTypes\", {\n url: PropTypes.string.isRequired,\n translate: PropTypes.func.isRequired,\n className: PropTypes.string\n});\n\nexport default translatable({\n searchBy: 'Search by'\n})(PoweredBy);","import { connectPoweredBy } from 'react-instantsearch-core';\nimport PoweredBy from '../components/PoweredBy';\n/**\n * PoweredBy displays an Algolia logo.\n *\n * Algolia requires that you use this widget if you are on a [community or free plan](https://www.algolia.com/pricing).\n * @name PoweredBy\n * @kind widget\n * @themeKey ais-PoweredBy - the root div of the widget\n * @themeKey ais-PoweredBy-text - the text of the widget\n * @themeKey ais-PoweredBy-link - the link of the logo\n * @themeKey ais-PoweredBy-logo - the logo of the widget\n * @translationKey searchBy - Label value for the powered by\n * @example\n * import React from 'react';\n * import { InstantSearch, PoweredBy } from 'react-instantsearch-dom';\n * import algoliasearch from 'algoliasearch/lite';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <PoweredBy />\n * </InstantSearch>\n * );\n */\n\nexport default connectPoweredBy(PoweredBy);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('RangeInput');\nexport var RawRangeInput =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(RawRangeInput, _Component);\n\n function RawRangeInput(props) {\n var _this;\n\n _classCallCheck(this, RawRangeInput);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RawRangeInput).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"onSubmit\", function (e) {\n e.preventDefault();\n\n _this.props.refine({\n min: _this.state.from,\n max: _this.state.to\n });\n });\n\n _this.state = _this.normalizeStateForRendering(props);\n return _this;\n }\n\n _createClass(RawRangeInput, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (this.props.canRefine && (prevProps.currentRefinement.min !== this.props.currentRefinement.min || prevProps.currentRefinement.max !== this.props.currentRefinement.max)) {\n this.setState(this.normalizeStateForRendering(this.props));\n }\n }\n }, {\n key: \"normalizeStateForRendering\",\n value: function normalizeStateForRendering(props) {\n var canRefine = props.canRefine,\n rangeMin = props.min,\n rangeMax = props.max;\n var _props$currentRefinem = props.currentRefinement,\n valueMin = _props$currentRefinem.min,\n valueMax = _props$currentRefinem.max;\n return {\n from: canRefine && valueMin !== undefined && valueMin !== rangeMin ? valueMin : '',\n to: canRefine && valueMax !== undefined && valueMax !== rangeMax ? valueMax : ''\n };\n }\n }, {\n key: \"normalizeRangeForRendering\",\n value: function normalizeRangeForRendering(_ref) {\n var canRefine = _ref.canRefine,\n min = _ref.min,\n max = _ref.max;\n var hasMin = min !== undefined;\n var hasMax = max !== undefined;\n return {\n min: canRefine && hasMin && hasMax ? min : '',\n max: canRefine && hasMin && hasMax ? max : ''\n };\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$state = this.state,\n from = _this$state.from,\n to = _this$state.to;\n var _this$props = this.props,\n precision = _this$props.precision,\n translate = _this$props.translate,\n canRefine = _this$props.canRefine,\n className = _this$props.className;\n\n var _this$normalizeRangeF = this.normalizeRangeForRendering(this.props),\n min = _this$normalizeRangeF.min,\n max = _this$normalizeRangeF.max;\n\n var step = 1 / Math.pow(10, precision);\n return React.createElement(\"div\", {\n className: classNames(cx('', !canRefine && '-noRefinement'), className)\n }, React.createElement(\"form\", {\n className: cx('form'),\n onSubmit: this.onSubmit\n }, React.createElement(\"input\", {\n className: cx('input', 'input--min'),\n type: \"number\",\n min: min,\n max: max,\n value: from,\n step: step,\n placeholder: min,\n disabled: !canRefine,\n onChange: function onChange(e) {\n return _this2.setState({\n from: e.currentTarget.value\n });\n }\n }), React.createElement(\"span\", {\n className: cx('separator')\n }, translate('separator')), React.createElement(\"input\", {\n className: cx('input', 'input--max'),\n type: \"number\",\n min: min,\n max: max,\n value: to,\n step: step,\n placeholder: max,\n disabled: !canRefine,\n onChange: function onChange(e) {\n return _this2.setState({\n to: e.currentTarget.value\n });\n }\n }), React.createElement(\"button\", {\n className: cx('submit'),\n type: \"submit\"\n }, translate('submit'))));\n }\n }]);\n\n return RawRangeInput;\n}(Component);\n\n_defineProperty(RawRangeInput, \"propTypes\", {\n canRefine: PropTypes.bool.isRequired,\n precision: PropTypes.number.isRequired,\n translate: PropTypes.func.isRequired,\n refine: PropTypes.func.isRequired,\n min: PropTypes.number,\n max: PropTypes.number,\n currentRefinement: PropTypes.shape({\n min: PropTypes.number,\n max: PropTypes.number\n }),\n className: PropTypes.string\n});\n\n_defineProperty(RawRangeInput, \"defaultProps\", {\n currentRefinement: {},\n className: ''\n});\n\nexport default translatable({\n submit: 'ok',\n separator: 'to'\n})(RawRangeInput);","import React from 'react';\nimport { connectRange } from 'react-instantsearch-core';\nimport PanelCallbackHandler from '../components/PanelCallbackHandler';\nimport RangeInput from '../components/RangeInput';\n/**\n * RangeInput allows a user to select a numeric range using a minimum and maximum input.\n * @name RangeInput\n * @kind widget\n * @requirements The attribute passed to the `attribute` prop must be present in “attributes for facetingâ€\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n * The values inside the attribute must be JavaScript numbers (not strings).\n * @propType {string} attribute - the name of the attribute in the record\n * @propType {{min: number, max: number}} [defaultRefinement] - Default state of the widget containing the start and the end of the range.\n * @propType {number} [min] - Minimum value. When this isn't set, the minimum value will be automatically computed by Algolia using the data in the index.\n * @propType {number} [max] - Maximum value. When this isn't set, the maximum value will be automatically computed by Algolia using the data in the index.\n * @propType {number} [precision=0] - Number of digits after decimal point to use.\n * @themeKey ais-RangeInput - the root div of the widget\n * @themeKey ais-RangeInput-form - the wrapping form\n * @themeKey ais-RangeInput-label - the label wrapping inputs\n * @themeKey ais-RangeInput-input - the input (number)\n * @themeKey ais-RangeInput-input--min - the minimum input\n * @themeKey ais-RangeInput-input--max - the maximum input\n * @themeKey ais-RangeInput-separator - the separator word used between the two inputs\n * @themeKey ais-RangeInput-button - the submit button\n * @translationKey submit - Label value for the submit button\n * @translationKey separator - Label value for the input separator\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, RangeInput } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <RangeInput attribute=\"price\" />\n * </InstantSearch>\n * );\n */\n\nvar RangeInputWidget = function RangeInputWidget(props) {\n return React.createElement(PanelCallbackHandler, props, React.createElement(RangeInput, props));\n};\n\nexport default connectRange(RangeInputWidget);","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames, find, range } from '../core/utils';\nvar cx = createClassNames('RatingMenu');\n\nvar RatingMenu =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(RatingMenu, _Component);\n\n function RatingMenu() {\n _classCallCheck(this, RatingMenu);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(RatingMenu).apply(this, arguments));\n }\n\n _createClass(RatingMenu, [{\n key: \"onClick\",\n value: function onClick(min, max, e) {\n e.preventDefault();\n e.stopPropagation();\n\n if (min === this.props.currentRefinement.min && max === this.props.currentRefinement.max) {\n this.props.refine({\n min: this.props.min,\n max: this.props.max\n });\n } else {\n this.props.refine({\n min: min,\n max: max\n });\n }\n }\n }, {\n key: \"buildItem\",\n value: function buildItem(_ref) {\n var max = _ref.max,\n lowerBound = _ref.lowerBound,\n count = _ref.count,\n translate = _ref.translate,\n createURL = _ref.createURL,\n isLastSelectableItem = _ref.isLastSelectableItem;\n var disabled = !count;\n var isCurrentMinLower = this.props.currentRefinement.min < lowerBound;\n var selected = isLastSelectableItem && isCurrentMinLower || !disabled && lowerBound === this.props.currentRefinement.min && max === this.props.currentRefinement.max;\n var icons = [];\n var rating = 0;\n\n for (var icon = 0; icon < max; icon++) {\n if (icon < lowerBound) {\n rating++;\n }\n\n icons.push([React.createElement(\"svg\", {\n key: icon,\n className: cx('starIcon', icon >= lowerBound ? 'starIcon--empty' : 'starIcon--full'),\n \"aria-hidden\": \"true\",\n width: \"24\",\n height: \"24\"\n }, React.createElement(\"use\", {\n xlinkHref: \"#\".concat(cx(icon >= lowerBound ? 'starEmptySymbol' : 'starSymbol'))\n })), ' ']);\n } // The last item of the list (the default item), should not\n // be clickable if it is selected.\n\n\n var isLastAndSelect = isLastSelectableItem && selected;\n var onClickHandler = disabled || isLastAndSelect ? {} : {\n href: createURL({\n min: lowerBound,\n max: max\n }),\n onClick: this.onClick.bind(this, lowerBound, max)\n };\n return React.createElement(\"li\", {\n key: lowerBound,\n className: cx('item', selected && 'item--selected', disabled && 'item--disabled')\n }, React.createElement(\"a\", _extends({\n className: cx('link'),\n \"aria-label\": \"\".concat(rating).concat(translate('ratingLabel'))\n }, onClickHandler), icons, React.createElement(\"span\", {\n className: cx('label'),\n \"aria-hidden\": \"true\"\n }, translate('ratingLabel')), ' ', React.createElement(\"span\", {\n className: cx('count')\n }, count)));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this = this;\n\n var _this$props = this.props,\n min = _this$props.min,\n max = _this$props.max,\n translate = _this$props.translate,\n count = _this$props.count,\n createURL = _this$props.createURL,\n canRefine = _this$props.canRefine,\n className = _this$props.className; // min & max are always set when there is a results, otherwise it means\n // that we don't want to render anything since we don't have any values.\n\n var limitMin = min !== undefined && min >= 0 ? min : 1;\n var limitMax = max !== undefined && max >= 0 ? max : 0;\n var inclusiveLength = limitMax - limitMin + 1;\n var values = count.map(function (item) {\n return _objectSpread({}, item, {\n value: parseFloat(item.value)\n });\n }).filter(function (item) {\n return item.value >= limitMin && item.value <= limitMax;\n });\n var items = range({\n start: 0,\n end: Math.max(inclusiveLength, 0)\n }).map(function (index) {\n var element = find(values, function (item) {\n return item.value === limitMax - index;\n });\n var placeholder = {\n value: limitMax - index,\n count: 0,\n total: 0\n };\n return element || placeholder;\n }).reduce(function (acc, item, index) {\n return acc.concat(_objectSpread({}, item, {\n total: index === 0 ? item.count : acc[index - 1].total + item.count\n }));\n }, []).map(function (item, index, arr) {\n return _this.buildItem({\n lowerBound: item.value,\n count: item.total,\n isLastSelectableItem: arr.length - 1 === index,\n max: limitMax,\n translate: translate,\n createURL: createURL\n });\n });\n return React.createElement(\"div\", {\n className: classNames(cx('', !canRefine && '-noRefinement'), className)\n }, React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n style: {\n display: 'none'\n }\n }, React.createElement(\"symbol\", {\n id: cx('starSymbol'),\n viewBox: \"0 0 24 24\"\n }, React.createElement(\"path\", {\n d: \"M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z\"\n })), React.createElement(\"symbol\", {\n id: cx('starEmptySymbol'),\n viewBox: \"0 0 24 24\"\n }, React.createElement(\"path\", {\n d: \"M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z\"\n }))), React.createElement(\"ul\", {\n className: cx('list', !canRefine && 'list--noRefinement')\n }, items));\n }\n }]);\n\n return RatingMenu;\n}(Component);\n\n_defineProperty(RatingMenu, \"propTypes\", {\n translate: PropTypes.func.isRequired,\n refine: PropTypes.func.isRequired,\n createURL: PropTypes.func.isRequired,\n min: PropTypes.number,\n max: PropTypes.number,\n currentRefinement: PropTypes.shape({\n min: PropTypes.number,\n max: PropTypes.number\n }),\n count: PropTypes.arrayOf(PropTypes.shape({\n value: PropTypes.string,\n count: PropTypes.number\n })),\n canRefine: PropTypes.bool.isRequired,\n className: PropTypes.string\n});\n\n_defineProperty(RatingMenu, \"defaultProps\", {\n className: ''\n});\n\nexport default translatable({\n ratingLabel: ' & Up'\n})(RatingMenu);","import React from 'react';\nimport { connectRange } from 'react-instantsearch-core';\nimport PanelCallbackHandler from '../components/PanelCallbackHandler';\nimport RatingMenu from '../components/RatingMenu';\n/**\n * RatingMenu lets the user refine search results by clicking on stars.\n *\n * The stars are based on the selected `attribute`.\n * @requirements The attribute passed to the `attribute` prop must be holding numerical values.\n * @name RatingMenu\n * @kind widget\n * @requirements The attribute passed to the `attribute` prop must be present in “attributes for facetingâ€\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n * The values inside the attribute must be JavaScript numbers (not strings).\n * @propType {string} attribute - the name of the attribute in the record\n * @propType {number} [min] - Minimum value for the rating. When this isn't set, the minimum value will be automatically computed by Algolia using the data in the index.\n * @propType {number} [max] - Maximum value for the rating. When this isn't set, the maximum value will be automatically computed by Algolia using the data in the index.\n * @propType {{min: number, max: number}} [defaultRefinement] - Default state of the widget containing the lower bound (end) and the max for the rating.\n * @themeKey ais-RatingMenu - the root div of the widget\n * @themeKey ais-RatingMenu--noRefinement - the root div of the widget when there is no refinement\n * @themeKey ais-RatingMenu-list - the list of ratings\n * @themeKey ais-RatingMenu-list--noRefinement - the list of ratings when there is no refinement\n * @themeKey ais-RatingMenu-item - the rating list item\n * @themeKey ais-RatingMenu-item--selected - the selected rating list item\n * @themeKey ais-RatingMenu-item--disabled - the disabled rating list item\n * @themeKey ais-RatingMenu-link - the rating clickable item\n * @themeKey ais-RatingMenu-starIcon - the star icon\n * @themeKey ais-RatingMenu-starIcon--full - the filled star icon\n * @themeKey ais-RatingMenu-starIcon--empty - the empty star icon\n * @themeKey ais-RatingMenu-label - the label used after the stars\n * @themeKey ais-RatingMenu-count - the count of ratings for a specific item\n * @translationKey ratingLabel - Label value for the rating link\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, RatingMenu } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <RatingMenu attribute=\"rating\" />\n * </InstantSearch>\n * );\n */\n\nvar RatingMenuWidget = function RatingMenuWidget(props) {\n return React.createElement(PanelCallbackHandler, props, React.createElement(RatingMenu, props));\n};\n\nexport default connectRange(RatingMenuWidget);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nimport Highlight from '../widgets/Highlight';\nimport List from './List';\nvar cx = createClassNames('RefinementList');\n\nvar RefinementList =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(RefinementList, _Component);\n\n function RefinementList() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, RefinementList);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RefinementList)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n query: ''\n });\n\n _defineProperty(_assertThisInitialized(_this), \"selectItem\", function (item, resetQuery) {\n resetQuery();\n\n _this.props.refine(item.value);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderItem\", function (item, resetQuery) {\n var label = _this.props.isFromSearch ? React.createElement(Highlight, {\n attribute: \"label\",\n hit: item\n }) : item.label;\n return React.createElement(\"label\", {\n className: cx('label')\n }, React.createElement(\"input\", {\n className: cx('checkbox'),\n type: \"checkbox\",\n checked: item.isRefined,\n onChange: function onChange() {\n return _this.selectItem(item, resetQuery);\n }\n }), React.createElement(\"span\", {\n className: cx('labelText')\n }, label), ' ', React.createElement(\"span\", {\n className: cx('count')\n }, item.count.toLocaleString()));\n });\n\n return _this;\n }\n\n _createClass(RefinementList, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n translate = _this$props.translate,\n items = _this$props.items,\n showMore = _this$props.showMore,\n limit = _this$props.limit,\n showMoreLimit = _this$props.showMoreLimit,\n isFromSearch = _this$props.isFromSearch,\n searchForItems = _this$props.searchForItems,\n searchable = _this$props.searchable,\n canRefine = _this$props.canRefine,\n className = _this$props.className;\n return React.createElement(List, {\n renderItem: this.renderItem,\n selectItem: this.selectItem,\n cx: cx,\n translate: translate,\n items: items,\n showMore: showMore,\n limit: limit,\n showMoreLimit: showMoreLimit,\n isFromSearch: isFromSearch,\n searchForItems: searchForItems,\n searchable: searchable,\n canRefine: canRefine,\n className: className,\n query: this.state.query\n });\n }\n }]);\n\n return RefinementList;\n}(Component);\n\n_defineProperty(RefinementList, \"propTypes\", {\n translate: PropTypes.func.isRequired,\n refine: PropTypes.func.isRequired,\n searchForItems: PropTypes.func.isRequired,\n searchable: PropTypes.bool,\n createURL: PropTypes.func.isRequired,\n items: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string.isRequired,\n value: PropTypes.arrayOf(PropTypes.string).isRequired,\n count: PropTypes.number.isRequired,\n isRefined: PropTypes.bool.isRequired\n })),\n isFromSearch: PropTypes.bool.isRequired,\n canRefine: PropTypes.bool.isRequired,\n showMore: PropTypes.bool,\n limit: PropTypes.number,\n showMoreLimit: PropTypes.number,\n transformItems: PropTypes.func,\n className: PropTypes.string\n});\n\n_defineProperty(RefinementList, \"defaultProps\", {\n className: ''\n});\n\nexport default translatable({\n showMore: function showMore(extended) {\n return extended ? 'Show less' : 'Show more';\n },\n noResults: 'No results',\n submit: null,\n reset: null,\n resetTitle: 'Clear the search query.',\n submitTitle: 'Submit your search query.',\n placeholder: 'Search here…'\n})(RefinementList);","import React from 'react';\nimport { connectRefinementList } from 'react-instantsearch-core';\nimport PanelCallbackHandler from '../components/PanelCallbackHandler';\nimport RefinementList from '../components/RefinementList';\n/**\n * The RefinementList component displays a list that let the end user choose multiple values for a specific facet.\n * @name RefinementList\n * @kind widget\n * @propType {string} attribute - the name of the attribute in the record\n * @propType {boolean} [searchable=false] - true if the component should display an input to search for facet values. <br> In order to make this feature work, you need to make the attribute searchable [using the API](https://www.algolia.com/doc/guides/searching/faceting/?language=js#declaring-a-searchable-attribute-for-faceting) or [the dashboard](https://www.algolia.com/explorer/display/).\n * @propType {string} [operator=or] - How to apply the refinements. Possible values: 'or' or 'and'.\n * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items\n * @propType {number} [limit=10] - the minimum number of displayed items\n * @propType {number} [showMoreLimit=20] - the maximum number of displayed items. Only used when showMore is set to `true`\n * @propType {string[]} [defaultRefinement] - the values of the items selected by default\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @themeKey ais-RefinementList - the root div of the widget\n * @themeKey ais-RefinementList--noRefinement - the root div of the widget when there is no refinement\n * @themeKey ais-RefinementList-searchBox - the search box of the widget. See [the SearchBox documentation](widgets/SearchBox.html#classnames) for the classnames and translation keys of the SearchBox.\n * @themeKey ais-RefinementList-list - the list of refinement items\n * @themeKey ais-RefinementList-item - the refinement list item\n * @themeKey ais-RefinementList-item--selected - the refinement selected list item\n * @themeKey ais-RefinementList-label - the label of each refinement item\n * @themeKey ais-RefinementList-checkbox - the checkbox input of each refinement item\n * @themeKey ais-RefinementList-labelText - the label text of each refinement item\n * @themeKey ais-RefinementList-count - the count of values for each item\n * @themeKey ais-RefinementList-noResults - the div displayed when there are no results\n * @themeKey ais-RefinementList-showMore - the button used to display more categories\n * @themeKey ais-RefinementList-showMore--disabled - the disabled button used to display more categories\n * @translationkey showMore - The label of the show more button. Accepts one parameters, a boolean that is true if the values are expanded\n * @translationkey noResults - The label of the no results text when no search for facet values results are found.\n * @requirements The attribute passed to the `attribute` prop must be present in \"attributes for faceting\"\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n *\n * If you are using the `searchable` prop, you'll also need to make the attribute searchable using\n * the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values).\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, RefinementList } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <RefinementList attribute=\"brand\" />\n * </InstantSearch>\n * );\n */\n\nvar RefinementListWidget = function RefinementListWidget(props) {\n return React.createElement(PanelCallbackHandler, props, React.createElement(RefinementList, props));\n};\n\nexport default connectRefinementList(RefinementListWidget);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('ScrollTo');\n\nvar ScrollTo =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(ScrollTo, _Component);\n\n function ScrollTo() {\n _classCallCheck(this, ScrollTo);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ScrollTo).apply(this, arguments));\n }\n\n _createClass(ScrollTo, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props = this.props,\n value = _this$props.value,\n hasNotChanged = _this$props.hasNotChanged;\n\n if (value !== prevProps.value && hasNotChanged) {\n this.el.scrollIntoView();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this = this;\n\n return React.createElement(\"div\", {\n ref: function ref(_ref) {\n return _this.el = _ref;\n },\n className: cx('')\n }, this.props.children);\n }\n }]);\n\n return ScrollTo;\n}(Component);\n\n_defineProperty(ScrollTo, \"propTypes\", {\n value: PropTypes.any,\n children: PropTypes.node,\n hasNotChanged: PropTypes.bool\n});\n\nexport default ScrollTo;","import { connectScrollTo } from 'react-instantsearch-core';\nimport ScrollTo from '../components/ScrollTo';\n/**\n * The ScrollTo component will make the page scroll to the component wrapped by it when one of the\n * [search state](guide/Search_state.html) prop is updated. By default when the page number changes,\n * the scroll goes to the wrapped component.\n *\n * @name ScrollTo\n * @kind widget\n * @propType {string} [scrollOn=\"page\"] - Widget state key on which to listen for changes.\n * @themeKey ais-ScrollTo - the root div of the widget\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, ScrollTo, Hits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <ScrollTo>\n * <Hits />\n * </ScrollTo>\n * </InstantSearch>\n * );\n */\n\nexport default connectScrollTo(ScrollTo);","import { connectSearchBox } from 'react-instantsearch-core';\nimport SearchBox from '../components/SearchBox';\n/**\n * The SearchBox component displays a search box that lets the user search for a specific query.\n * @name SearchBox\n * @kind widget\n * @propType {string[]} [focusShortcuts=['s','/']] - List of keyboard shortcuts that focus the search box. Accepts key names and key codes.\n * @propType {boolean} [autoFocus=false] - Should the search box be focused on render?\n * @propType {boolean} [searchAsYouType=true] - Should we search on every change to the query? If you disable this option, new searches will only be triggered by clicking the search button or by pressing the enter key while the search box is focused.\n * @propType {function} [onSubmit] - Intercept submit event sent from the SearchBox form container.\n * @propType {function} [onReset] - Listen to `reset` event sent from the SearchBox form container.\n * @propType {function} [on*] - Listen to any events sent from the search input itself.\n * @propType {node} [submit] - Change the apparence of the default submit button (magnifying glass).\n * @propType {node} [reset] - Change the apparence of the default reset button (cross).\n * @propType {node} [loadingIndicator] - Change the apparence of the default loading indicator (spinning circle).\n * @propType {string} [defaultRefinement] - Provide default refinement value when component is mounted.\n * @propType {boolean} [showLoadingIndicator=false] - Display that the search is loading. This only happens after a certain amount of time to avoid a blinking effect. This timer can be configured with `stalledSearchDelay` props on <InstantSearch>. By default, the value is 200ms.\n * @themeKey ais-SearchBox - the root div of the widget\n * @themeKey ais-SearchBox-form - the wrapping form\n * @themeKey ais-SearchBox-input - the search input\n * @themeKey ais-SearchBox-submit - the submit button\n * @themeKey ais-SearchBox-submitIcon - the default magnifier icon used with the search input\n * @themeKey ais-SearchBox-reset - the reset button used to clear the content of the input\n * @themeKey ais-SearchBox-resetIcon - the default reset icon used inside the reset button\n * @themeKey ais-SearchBox-loadingIndicator - the loading indicator container\n * @themeKey ais-SearchBox-loadingIcon - the default loading icon\n * @translationkey submitTitle - The submit button title\n * @translationkey resetTitle - The reset button title\n * @translationkey placeholder - The label of the input placeholder\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox />\n * </InstantSearch>\n * );\n */\n\nexport default connectSearchBox(SearchBox);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport { createClassNames } from '../core/utils';\nimport Highlighter from './Highlighter';\nvar cx = createClassNames('Snippet');\n\nvar Snippet = function Snippet(props) {\n return React.createElement(Highlighter, _extends({}, props, {\n highlightProperty: \"_snippetResult\",\n cx: cx\n }));\n};\n\nexport default Snippet;","import { connectHighlight } from 'react-instantsearch-core';\nimport Snippet from '../components/Snippet';\n/**\n * Renders any attribute from an hit into its highlighted snippet form when relevant.\n *\n * Read more about it in the [Highlighting results](guide/Highlighting_results.html) guide.\n * @name Snippet\n * @kind widget\n * @requirements To use this widget, the attribute name passed to the `attribute` prop must be\n * present in \"Attributes to snippet\" on the Algolia dashboard or configured as `attributesToSnippet`\n * via a set settings call to the Algolia API.\n * @propType {string} attribute - location of the highlighted snippet attribute in the hit (the corresponding element can be either a string or an array of strings)\n * @propType {object} hit - hit object containing the highlighted snippet attribute\n * @propType {string} [tagName='em'] - tag to be used for highlighted parts of the attribute\n * @propType {string} [nonHighlightedTagName='span'] - tag to be used for the parts of the hit that are not highlighted\n * @propType {node} [separator=',<space>'] - symbol used to separate the elements of the array in case the attribute points to an array of strings.\n * @themeKey ais-Snippet - the root span of the widget\n * @themeKey ais-Snippet-highlighted - the highlighted text\n * @themeKey ais-Snippet-nonHighlighted - the normal text\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, Snippet } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const Hit = ({ hit }) => (\n * <div>\n * <Snippet attribute=\"description\" hit={hit} />\n * </div>\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox defaultRefinement=\"adjustable\" />\n * <Hits hitComponent={Hit} />\n * </InstantSearch>\n * );\n */\n\nexport default connectHighlight(Snippet);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { createClassNames } from '../core/utils';\nimport Select from './Select';\nvar cx = createClassNames('SortBy');\n\nvar SortBy =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(SortBy, _Component);\n\n function SortBy() {\n _classCallCheck(this, SortBy);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(SortBy).apply(this, arguments));\n }\n\n _createClass(SortBy, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n items = _this$props.items,\n currentRefinement = _this$props.currentRefinement,\n refine = _this$props.refine,\n className = _this$props.className;\n return React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, React.createElement(Select, {\n cx: cx,\n items: items,\n selectedItem: currentRefinement,\n onSelect: refine\n }));\n }\n }]);\n\n return SortBy;\n}(Component);\n\n_defineProperty(SortBy, \"propTypes\", {\n items: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string.isRequired\n })).isRequired,\n currentRefinement: PropTypes.string.isRequired,\n refine: PropTypes.func.isRequired,\n className: PropTypes.string\n});\n\n_defineProperty(SortBy, \"defaultProps\", {\n className: ''\n});\n\nexport default SortBy;","import { connectSortBy } from 'react-instantsearch-core';\nimport SortBy from '../components/SortBy';\n/**\n * The SortBy component displays a list of indexes allowing a user to change the hits are sorting.\n * @name SortBy\n * @requirements Algolia handles sorting by creating replica indices. [Read more about sorting](https://www.algolia.com/doc/guides/relevance/sorting/) on\n * the Algolia website.\n * @kind widget\n * @propType {{value: string, label: string}[]} items - The list of indexes to search in.\n * @propType {string} defaultRefinement - The default selected index.\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @themeKey ais-SortBy - the root div of the widget\n * @themeKey ais-SortBy-select - the select\n * @themeKey ais-SortBy-option - the select option\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SortBy } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SortBy\n * defaultRefinement=\"instant_search\"\n * items={[\n * { value: 'instant_search', label: 'Featured' },\n * { value: 'instant_search_price_asc', label: 'Price asc.' },\n * { value: 'instant_search_price_desc', label: 'Price desc.' },\n * ]}\n * />\n * </InstantSearch>\n * );\n */\n\nexport default connectSortBy(SortBy);","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('Stats');\n\nvar Stats =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Stats, _Component);\n\n function Stats() {\n _classCallCheck(this, Stats);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Stats).apply(this, arguments));\n }\n\n _createClass(Stats, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n translate = _this$props.translate,\n nbHits = _this$props.nbHits,\n processingTimeMS = _this$props.processingTimeMS,\n className = _this$props.className;\n return React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, React.createElement(\"span\", {\n className: cx('text')\n }, translate('stats', nbHits, processingTimeMS)));\n }\n }]);\n\n return Stats;\n}(Component);\n\n_defineProperty(Stats, \"propTypes\", {\n translate: PropTypes.func.isRequired,\n nbHits: PropTypes.number.isRequired,\n processingTimeMS: PropTypes.number.isRequired,\n className: PropTypes.string\n});\n\n_defineProperty(Stats, \"defaultProps\", {\n className: ''\n});\n\nexport default translatable({\n stats: function stats(n, ms) {\n return \"\".concat(n.toLocaleString(), \" results found in \").concat(ms.toLocaleString(), \"ms\");\n }\n})(Stats);","import { connectStats } from 'react-instantsearch-core';\nimport Stats from '../components/Stats';\n/**\n * The Stats component displays the total number of matching hits and the time it took to get them (time spent in the Algolia server).\n * @name Stats\n * @kind widget\n * @themeKey ais-Stats - the root div of the widget\n * @themeKey ais-Stats-text - the text of the widget - the count of items for each item\n * @translationkey stats - The string displayed by the stats widget. You get function(n, ms) and you need to return a string. n is a number of hits retrieved, ms is a processed time.\n * @example\n * import React from 'react';\n * import { InstantSearch, Stats, Hits } from 'react-instantsearch-dom';\n * import algoliasearch from 'algoliasearch/lite';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <Stats />\n * <Hits />\n * </InstantSearch>\n * );\n */\n\nexport default connectStats(Stats);","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('ToggleRefinement');\n\nvar ToggleRefinement = function ToggleRefinement(_ref) {\n var currentRefinement = _ref.currentRefinement,\n label = _ref.label,\n canRefine = _ref.canRefine,\n refine = _ref.refine,\n className = _ref.className;\n return React.createElement(\"div\", {\n className: classNames(cx('', !canRefine && '-noRefinement'), className)\n }, React.createElement(\"label\", {\n className: cx('label')\n }, React.createElement(\"input\", {\n className: cx('checkbox'),\n type: \"checkbox\",\n checked: currentRefinement,\n onChange: function onChange(event) {\n return refine(event.target.checked);\n }\n }), React.createElement(\"span\", {\n className: cx('labelText')\n }, label)));\n};\n\nToggleRefinement.propTypes = {\n currentRefinement: PropTypes.bool.isRequired,\n label: PropTypes.string.isRequired,\n canRefine: PropTypes.bool.isRequired,\n refine: PropTypes.func.isRequired,\n className: PropTypes.string\n};\nToggleRefinement.defaultProps = {\n className: ''\n};\nexport default ToggleRefinement;","import { connectToggleRefinement } from 'react-instantsearch-core';\nimport ToggleRefinement from '../components/ToggleRefinement';\n/**\n * The ToggleRefinement provides an on/off filtering feature based on an attribute value.\n * @name ToggleRefinement\n * @kind widget\n * @requirements To use this widget, you'll need an attribute to toggle on.\n *\n * You can't toggle on null or not-null values. If you want to address this particular use-case you'll need to compute an\n * extra boolean attribute saying if the value exists or not. See this [thread](https://discourse.algolia.com/t/how-to-create-a-toggle-for-the-absence-of-a-string-attribute/2460) for more details.\n *\n * @propType {string} attribute - Name of the attribute on which to apply the `value` refinement. Required when `value` is present.\n * @propType {string} label - Label for the toggle.\n * @propType {any} value - Value of the refinement to apply on `attribute` when checked.\n * @propType {boolean} [defaultRefinement=false] - Default state of the widget. Should the toggle be checked by default?\n * @themeKey ais-ToggleRefinement - the root div of the widget\n * @themeKey ais-ToggleRefinement-list - the list of toggles\n * @themeKey ais-ToggleRefinement-item - the toggle list item\n * @themeKey ais-ToggleRefinement-label - the label of each toggle item\n * @themeKey ais-ToggleRefinement-checkbox - the checkbox input of each toggle item\n * @themeKey ais-ToggleRefinement-labelText - the label text of each toggle item\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, ToggleRefinement } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <ToggleRefinement\n * attribute=\"free_shipping\"\n * label=\"Free Shipping\"\n * value={true}\n * />\n * </InstantSearch>\n * );\n */\n\nexport default connectToggleRefinement(ToggleRefinement);","import React from 'react';\n/**\n * Since a lot of sliders already exist, we did not include one by default.\n * However you can easily connect React InstantSearch to an existing one\n * using the [connectRange connector](connectors/connectRange.html).\n *\n * @name RangeSlider\n * @requirements To connect any slider to Algolia, the underlying attribute used must be holding numerical values.\n * @kind widget\n * @example\n *\n * // Here's an example showing how to connect the AirBnb Rheostat Slider to React InstantSearch\n * // using the range connector. âš ï¸ This example only works with the version 2.x of Rheostat.\n\nimport React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport Rheostat from 'rheostat';\nimport { connectRange } from 'react-instantsearch-dom';\n\nclass Range extends React.Component {\n static propTypes = {\n min: PropTypes.number,\n max: PropTypes.number,\n currentRefinement: PropTypes.object,\n refine: PropTypes.func.isRequired,\n canRefine: PropTypes.bool.isRequired\n };\n\n state = { currentValues: { min: this.props.min, max: this.props.max } };\n\n componentDidUpdate(prevProps) {\n if (\n this.props.canRefine &&\n (prevProps.currentRefinement.min !== this.props.currentRefinement.min ||\n prevProps.currentRefinement.max !== this.props.currentRefinement.max)\n ) {\n this.setState({\n currentValues: {\n min: this.props.currentRefinement.min,\n max: this.props.currentRefinement.max,\n },\n });\n }\n }\n\n onValuesUpdated = sliderState => {\n this.setState({\n currentValues: { min: sliderState.values[0], max: sliderState.values[1] }\n });\n };\n\n onChange = sliderState => {\n if (\n this.props.currentRefinement.min !== sliderState.values[0] ||\n this.props.currentRefinement.max !== sliderState.values[1]\n ) {\n this.props.refine({\n min: sliderState.values[0],\n max: sliderState.values[1]\n });\n }\n };\n\n render() {\n const { min, max, currentRefinement } = this.props;\n const { currentValues } = this.state;\n return min !== max ? (\n <div>\n <Rheostat\n className=\"ais-RangeSlider\"\n min={min}\n max={max}\n values={[currentRefinement.min, currentRefinement.max]}\n onChange={this.onChange}\n onValuesUpdated={this.onValuesUpdated}\n />\n <div style={{ display: \"flex\", justifyContent: \"space-between\" }}>\n <div>{currentValues.min}</div>\n <div>{currentValues.max}</div>\n </div>\n </div>\n ) : null;\n }\n}\n\nconst ConnectedRange = connectRange(Range);\n*/\n\nexport default (function () {\n return React.createElement(\"div\", null, \"We do not provide any Slider, see the documentation to learn how to connect one easily:\", React.createElement(\"a\", {\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n href: \"https://www.algolia.com/doc/api-reference/widgets/range-slider/react/\"\n }, \"https://www.algolia.com/doc/api-reference/widgets/range-slider/react/\"));\n});"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","_objectWithoutProperties","excluded","sourceKeys","keys","indexOf","objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","_defineProperty","obj","value","defineProperty","enumerable","configurable","writable","_objectSpread","ownKeys","concat","filter","sym","getOwnPropertyDescriptor","forEach","_classCallCheck","instance","Constructor","TypeError","_defineProperties","props","descriptor","_createClass","protoProps","staticProps","_typeof2","Symbol","iterator","constructor","_typeof","_assertThisInitialized","self","ReferenceError","_possibleConstructorReturn","assertThisInitialized","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","__proto__","_setPrototypeOf","p","_inherits","subClass","superClass","create","isArray","Array","keyList","hasProp","equal","a","b","arrA","arrB","dateA","Date","dateB","getTime","regexpA","RegExp","regexpB","toString","shallowEqual","objA","objB","keysA","keysB","hasOwn","resolved","Promise","resolve","defer","f","then","removeEmptyKey","object","addAbsolutePositions","hits","hitsPerPage","page","map","hit","index","__position","addQueryID","queryID","__queryID","find","array","comparator","omit","_key","_createContext","createContext","onInternalStateUpdate","createHrefForState","onSearchForFacetValues","onSearchStateChange","onSearchParameters","store","widgetsManager","mainTargetedIndex","InstantSearchConsumer","Consumer","InstantSearchProvider","Provider","_createContext2","undefined","IndexConsumer","IndexProvider","createConnectorWithContext","connectorDesc","Composed","Connector","displayName","Error","isWidget","getSearchParameters","getMetadata","transitionState","Component","_Component","_this","providedProps","getProvidedProps","_ref","_len","args","contextValue","refine","getState","widgets","_ref2","_len2","_key2","_ref3","_len3","_key3","searchForFacetValues","bind","ais","multiIndexContext","indexContextValue","_this2","unsubscribe","subscribe","isUnmounting","setState","unregisterWidget","registerWidget","nextProps","nextState","shouldComponentUpdate","state","propsEqual","prevProps","isEqual","update","cleanUp","_this$props$contextVa","results","resultsFacetValues","searching","searchingForFacetValues","isSearchStalled","metadata","searchResults","error","searchParameters","nextWidgetsState","prevWidgetsState","_this$props","refineProps","createURL","searchForFacetValuesProps","searchForItems","React","createElement","name","propTypes","defaultProps","createConnectorWithoutContext","HIGHLIGHT_TAGS","highlightPreTag","highlightPostTag","parseHighlightedAttribute","preTag","postTag","_ref$highlightedValue","highlightedValue","splitByPreTag","split","firstValue","shift","elements","isHighlighted","push","splitByPostTag","parseAlgoliaHit","_ref2$preTag","_ref2$postTag","highlightProperty","attribute","path","highlightObject","replace","reduce","current","item","translatable","defaultTranslations","Translatable","_getPrototypeOf2","translations","translation","params","translate","getIndexId","context","hasMultipleIndices","targetedIndex","getResults","indexId","refineValue","searchState","nextRefinement","resetPage","namespace","indices","_objectSpread4","getNamespaceAndAttributeName","id","parts","match","attributeName","getCurrentRefinementValue","defaultValue","multiIndex","_getNamespaceAndAttri","defaultRefinement","cleanUpValue","_getNamespaceAndAttri2","Boolean","_ref4","indexSearchState","cleanUpValueWithMultiIndex","cleanUpValueWithSingleIndex","createConnector","children","items","setQueryParameters","prevSearchState","nextSearchState","propKeys","nonPresentKeys","_props","prop","subState","configureState","acc","connectConfigure","global","window","setTimeout","clearTimeout","performance","now","mozNow","msNow","oNow","webkitNow","_toConsumableArray","arr","arr2","arrayWithoutHoles","iter","from","iterableToArray","nonIterableSpread","propIsEnumerable","test1","String","getOwnPropertyNames","test2","fromCharCode","n","join","test3","letter","err","shouldUseNative","emptyFunction","module","shim","propName","componentName","location","propFullName","secret","getShim","ReactPropTypes","isRequired","bool","func","number","string","symbol","any","arrayOf","element","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","require$$1","getIndexContext","Index","indexContext","indexName","setIndex","Children","count","isObjectOrArrayOrFunction","_merge","sourceVal","targetVal","l","slice","reduceRight","arr1","valToNumber","v","parseFloat","lib","addRefinement","refinementList","isRefined","valueAsString","facetRefinement","mod","defaultsPure","removeRefinement","clearRefinement","toggleRefinement","refinementType","objectHasKeys","hasChanged","newRefinementList","memo","values","facetList","refinementValue","containsRefinements","refinementValueAsString","isEqualNumericRefinement","every","el","SearchParameters","newParameters","_parseNumbers","facets","disjunctiveFacets","hierarchicalFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements","paramName","isKeyKnown","PARAMETERS","isValueDefined","partialState","numbers","k","parsedValue","isNaN","insideBoundingBox","geoRect","operators","operator","parsedValues","vPrime","merge","make","facet","rootPath","currentRefinement","getHierarchicalRefinement","clearRefinements","toggleHierarchicalFacetRefinement","validate","currentState","parameters","tagFilters","numericFilters","patch","_clearNumericRefinements","RefinementList","clearTags","setQuery","newQuery","query","setPage","newPage","setFacets","setDisjunctiveFacets","setHitsPerPage","setTypoTolerance","typoTolerance","addNumericRefinement","isNumericRefined","getConjunctiveRefinements","facetName","isConjunctiveFacet","getDisjunctiveRefinements","isDisjunctiveFacet","getExcludeRefinements","removeNumericRefinement","paramValue","op","val","getNumericRefinements","getNumericRefinement","newNumericRefinements","operatorList","outValues","addFacet","addDisjunctiveFacet","addHierarchicalFacet","hierarchicalFacet","isHierarchicalFacet","addFacetRefinement","addExcludeRefinement","addDisjunctiveFacetRefinement","addTagRefinement","tag","isTagRefined","modification","removeFacet","removeDisjunctiveFacet","removeHierarchicalFacet","removeFacetRefinement","removeExcludeRefinement","removeDisjunctiveFacetRefinement","removeTagRefinement","t","toggleFacetRefinement","toggleConjunctiveFacetRefinement","toggleDisjunctiveFacetRefinement","toggleExcludeFacetRefinement","separator","_getHierarchicalFacetSeparator","getHierarchicalFacetByName","lastIndexOf","addHierarchicalFacetRefinement","isHierarchicalFacetRefined","removeHierarchicalFacetRefinement","toggleTagRefinement","isFacetRefined","isExcludeRefined","isDisjunctiveFacetRefined","refinements","isOperatorDefined","searchedValue","isAttributeValueDefined","currentValue","getRefinedDisjunctiveFacets","disjunctiveNumericRefinedFacets","intersection","getRefinedHierarchicalFacets","getUnrefinedDisjunctiveFacets","refinedFacets","managedParameters","getQueryParams","queryParams","setQueryParameter","parameter","nextWithNumbers","previousPlainObject","nextPlainObject","previous","isPreviousValueDefined","isNextValueDefined","_getHierarchicalFacetSortBy","sortBy","_getHierarchicalRootPath","_getHierarchicalShowParentLevel","showParentLevel","hierarchicalFacetName","getHierarchicalFacetBreadcrumb","refinement","part","trim","JSON","stringify","compareAscending","other","valIsDefined","valIsNull","othIsDefined","othIsNull","collection","iteratees","orders","result","criteria","iteratee","sort","res","defaults","defaultInstructions","out","sortInstruction","matchingDefault","defaultInstruction","hierarchicalFacetResult","hierarchicalFacetIndex","hierarchicalSeparator","hierarchicalRootPath","hierarchicalShowParentLevel","hierarchicalFacetRefinement","prepareHierarchicalFacetSortBy","rootExhaustive","facetResult","exhaustive","generateTreeFn","hierarchicalTree","currentHierarchicalLevel","parent","level","data","subtree","picked","facetValue","tuple","parentPath","orderBy","facetCount","getIndices","attributes","idx","assignFacetStats","dest","facetStats","stats","SearchResults","mainSubResponse","_rawResults","parsedQuery","nbHits","nbPages","processingTimeMS","sum","aroundLatLng","automaticRadius","serverUsed","timeoutCounts","timeoutHits","exhaustiveFacetsCount","exhaustiveNbHits","userData","facetsIndices","disjunctiveFacetsIndices","nextDisjunctiveResult","mainFacets","facetKey","hierarchicalAttributeName","facetValueObject","facetIndex","idxAttributeName","findIndex","position","isFacetDisjunctive","isFacetConjunctive","facets_stats","compact","disjunctiveFacet","dfacet","facetResults","attributeIndex","dataFromMainRequest","refinedFacet","defaultData","root","excludes","generateHierarchicalTree","_state","recSort","sortFn","childNode","sortedChildren","getFacetStatsIfAvailable","getRefinement","type","resultsFacets","getFacetByName","predicate","DEFAULT_SORT","getFacetValues","opts","facetValues","isExcluded","extractNormalizedFacetValues","options","order","formatSort","hierarchicalFacetValues","getFacetStats","getRefinements","facetDeclaration","rootFacet","intermediateFacet","newFacet","numericValue","EventEmitter","_events","_maxListeners","isFunction","arg","isObject","isUndefined","defaultMaxListeners","setMaxListeners","emit","er","handler","len","listeners","on","addListener","listener","m","newListener","warned","console","trace","once","fired","g","removeListener","list","splice","removeAllListeners","listenerCount","evlistener","emitter","ctor","superCtor","DerivedHelper","mainHelper","fn","main","lastResults","events","detach","detachDerivedHelper","getModifiedState","requestBuilder","_getQueries","queries","_getHitsSearchParams","_getDisjunctiveFacetSearchParams","_getHitsHierarchicalFacetsAttributes","facetFilters","_getFacetFilters","_getNumericFilters","additionalParams","_getTagFilters","hierarchicalRootLevel","attributesToRetrieve","attributesToHighlight","attributesToSnippet","analytics","clickAnalytics","_getDisjunctiveHierarchicalFacetAttribute","vs","orFilters","attributeToRefine","attributesIndex","allAttributes","hierarchicalRefinement","newAttributes","rootLevel","parentLevel","getSearchForFacetQuery","maxFacetHits","stateForSearchForFacetValues","searchForFacetSearchParameters","facetQuery","AlgoliaSearchHelper","client","addAlgoliaAgent","setClient","_queryId","_lastQueryIdReceived","derivedHelpers","_currentNbQueries","setCurrentPage","_change","isPageReset","getCurrentPage","search","_search","onlyWithDerivedHelpers","searchOnlyWithDerivedHelpers","getQuery","searchOnce","cb","tempState","content","_originalResponse","e","catch","userState","clientHasSFFV","initIndex","isDisjunctive","algoliaQuery","facetHits","q","addDisjunctiveRefine","addRefine","addFacetExclusion","addExclude","addTag","removeDisjunctiveRefine","removeRefine","removeFacetExclusion","removeExclude","removeTag","toggleFacetExclusion","toggleExclude","toggleRefine","toggleTag","nextPage","previousPage","newState","overrideStateWithoutTriggeringChangeEvent","hasRefinements","isDisjunctiveRefined","hasTag","hasTagRefinements","getIndex","getPage","getTags","r","states","mainQueries","queriesCount","helper","derivedQueries","derivedHelper","derivedState","derivedStateQueries","queryId","_dispatchAlgoliaResponse","_dispatchAlgoliaError","s","specificResults","formattedResponse","containsRefinement","_hasDisjunctiveRefinements","disjunctiveRefinements","event","clearCache","newClient","getClient","derive","pos","hasPendingRequests","algoliasearchHelper","version","require$$0","addAlgoliaAgents","searchClient","ReactVersion","isMultiIndexContext","widget","isTargetedIndexEqualIndex","isIndexWidget","isIndexWidgetEqualIndex","sortIndexWidgetsFirst","firstWidget","secondWidget","createInstantSearchManager","_ref$initialState","initialState","resultsState","stalledSearchDelay","stalledSearchTimer","_store$getState","handleSearchSuccess","handleSearchError","skip","initialSearchParameters","onWidgetsUpdate","scheduled","scheduleUpdate","getWidgets","createWidgetsManager","_useCache","requests","rawResults","request","cache","hydrateSearchClient","_internalIndexId","hydrateResultsState","sharedParameters","mainParameters","targetedIndexEqualMainIndex","subIndexEqualMainIndex","derivedIndices","targetedIndexNotEqualMainIndex","subIndexNotEqualMainIndex","derivedParameters","_getSearchParameters","isDerivedHelpersEmpty","nextIsSearchStalled","getWidgetsIds","meta","_ref5","_ref5$maxFacetHits","maxFacetHitsWithinRange","Math","max","min","_objectSpread6","onExternalStateUpdate","updateClient","updateIndex","newIndex","skipSearch","isControlled","InstantSearch","instantSearchManager","onWidgetsInternalStateUpdate","prevState","nextIsControlled","previousSearchState","prevIsControlled","refresh","getKnownKeys","_searchState","getId","some","transformItems","canRefine","transformValue","label","transformedItems","clearsQuery","clear","getCurrentRefinement","_refine","showMore","limit","showMoreLimit","itemsLimit","truncate","maxValuesPerFacet","rootAttribute","highlight","_ref$preTag","_ref$postTag","parseInt","_allResults","_prevState","hasPrevious","hasMore","refinePrevious","refineNext","_results$_state","hitsWithPositionsAndQueryID","_firstReceivedPage","_lastReceivedPage","getValue","getLimit","defaultSortBy","searchable","searchForFacetValuesResults","isFromSearch","_highlightResult","highlighted","_slicedToArray","arrayWithHoles","_arr","_n","_d","_e","_s","_i","next","done","iterableToArrayLimit","nonIterableRest","stringifyItem","start","end","range","noRefinement","Number","NEGATIVE_INFINITY","POSITIVE_INFINITY","refinedItem","_parseItem","_value$split2","startStr","endStr","parseItem","hostname","url","currentRange","_getCurrentRefinement","isFloatPrecision","precision","nextMin","nextMax","hasMinBound","hasMaxBound","hasMinRefinment","hasMaxRefinment","getCurrentRefinementWithRange","nextValueForRefinement","hasBound","isReset","currentMinRange","currentMaxRange","isMinReset","isMaxReset","nextMinAsNumber","nextMaxAsNumber","isNextMinValid","isFinite","isNextMaxValid","header","footer","boundaries","pow","minBound","maxBound","hasFacet","_getCurrentRange","floor","ceil","rangeMin","rangeMax","_currentRange","_getCurrentRefinement2","_this$_currentRange","minRange","maxRange","_getCurrentRefinement3","minValue","maxValue","hasMin","hasMax","fragments","selectedValue","addKey","addRefinementKey","nextSelectedItems","scrollOn","_prevSearchState","cleanedSearchState","hasNotChanged","selectedIndex","falsyStrings","allFacetValues","facetValueCount","allFacetValuesCount","checked","unchecked","nextSearchParameters","classNames","classes","argType","exports","createClassNames","block","prefix","suitElements","baseClassName","cx","_ref$start","_ref$step","step","limitStep","arrayLength","round","_","PanelConsumer","PanelProvider","Panel","nextCanRefine","className","setCanRefine","PanelCallbackHandler","PanelWrapper","Link","isMiddleClick","button","altKey","ctrlKey","metaKey","shiftKey","onClick","preventDefault","itemsPropType","Breadcrumb","rootURL","href","breadcrumb","isLast","rootLabel","connectBreadcrumb","ClearRefinements","disabled","reset","connectCurrentRefinements","CurrentRefinements","nest","itemPropTypes","clearFilter","defaultLoadingIndicator","width","height","viewBox","xmlns","stroke","fill","fillRule","transform","strokeWidth","strokeOpacity","cy","d","to","dur","repeatCount","defaultReset","defaultSubmit","SearchBox","searchAsYouType","input","__inputRef","focusShortcuts","shortcuts","toUpperCase","charCodeAt","elt","srcElement","tagName","isContentEditable","which","keyCode","focus","stopPropagation","blur","_this$props2","onChange","_this$props3","onReset","document","addEventListener","onKeyDown","removeEventListener","_this$props4","autoFocus","loadingIndicator","submit","searchInputEvents","toLowerCase","showLoadingIndicator","noValidate","onSubmit","action","role","ref","onInputMount","placeholder","autoComplete","autoCorrect","autoCapitalize","spellCheck","required","maxLength","title","hidden","resetTitle","submitTitle","List","extended","resetQuery","itemHasChildren","renderItem","child","onShowMoreClick","selectItem","noResults","_this3","searchBox","renderSearchBox","rootClassName","renderShowMore","show","HierarchicalMenu","connectHierarchicalMenu","Highlight","highlightedTagName","nonHighlightedTagName","TagName","Highlighter","parsedHighlightedValue","connectHighlight","DefaultHitComponent","style","borderBottom","paddingBottom","marginBottom","wordBreak","objectID","connectHits","_ref$className","_ref$hitComponent","hitComponent","HitComponent","Select","onSelect","selectedItem","HitsPerPage","connectHitsPerPage","InfiniteHits","showPrevious","connectInfiniteHits","loadPrevious","loadMore","Menu","connectMenu","MenuSelect","handleSelectChange","get","seeAllOption","NumericMenu","all","connectNumericMenu","LinkList","selected","modifier","ariaLabel","getPages","currentPage","maxPages","padding","size","paddingLeft","Pagination","translationKey","totalPages","ListComponent","listComponent","showFirst","showNext","showLast","otherProps","lastPage","Infinity","first","last","ariaPrevious","ariaNext","ariaFirst","ariaLast","ariaPage","connectPagination","AlgoliaLogo","baseProfile","x1","x2","y1","y2","gradientUnits","gradientTransform","offset","stopColor","PoweredBy","rel","connectPoweredBy","searchBy","RawRangeInput","normalizeStateForRendering","_props$currentRefinem","valueMin","valueMax","_this$state","_this$normalizeRangeF","normalizeRangeForRendering","currentTarget","connectRange","RangeInput","RatingMenu","lowerBound","isLastSelectableItem","isCurrentMinLower","icons","rating","icon","xlinkHref","onClickHandler","limitMin","limitMax","inclusiveLength","total","buildItem","display","ratingLabel","toLocaleString","connectRefinementList","ScrollTo","scrollIntoView","connectScrollTo","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