UNPKG

168 kBSource Map (JSON)View Raw
1{"version":3,"file":"downshift.umd.min.js","sources":["../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../node_modules/react-is/cjs/react-is.production.min.js","../node_modules/react-is/index.js","../node_modules/object-assign/index.js","../node_modules/prop-types/lib/ReactPropTypesSecret.js","../node_modules/prop-types/factoryWithTypeCheckers.js","../node_modules/prop-types/factoryWithThrowingShims.js","../node_modules/prop-types/index.js","../node_modules/compute-scroll-into-view/es/index.js","../src/utils.js","../src/set-a11y-status.js","../src/stateChangeTypes.js","../src/downshift.js","../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../node_modules/keyboard-key/src/keyboardKey.js","../node_modules/@reach/auto-id/es/index.js","../src/hooks/utils.js","../src/hooks/useSelect/utils.js","../src/hooks/useSelect/stateChangeTypes.js","../src/hooks/useSelect/index.js","../src/hooks/useSelect/reducer.js"],"sourcesContent":["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 _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}","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}","/** @license React v16.9.0\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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';Object.defineProperty(exports,\"__esModule\",{value:!0});\nvar b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?Symbol.for(\"react.suspense_list\"):\n60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.fundamental\"):60117,w=b?Symbol.for(\"react.responder\"):60118;function x(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case t:case r:case d:return u}}}function y(a){return x(a)===m}exports.typeOf=x;exports.AsyncMode=l;\nexports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w)};exports.isAsyncMode=function(a){return y(a)||x(a)===l};exports.isConcurrentMode=y;exports.isContextConsumer=function(a){return x(a)===k};exports.isContextProvider=function(a){return x(a)===h};\nexports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return x(a)===n};exports.isFragment=function(a){return x(a)===e};exports.isLazy=function(a){return x(a)===t};exports.isMemo=function(a){return x(a)===r};exports.isPortal=function(a){return x(a)===d};exports.isProfiler=function(a){return x(a)===g};exports.isStrictMode=function(a){return x(a)===f};exports.isSuspense=function(a){return x(a)===p};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\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 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\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 ReactIs = require('react-is');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nvar has = Function.call.bind(Object.prototype.hasOwnProperty);\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<<anonymous>>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n elementType: createElementTypeTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\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 } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!ReactIs.isValidElementType(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n if (process.env.NODE_ENV !== 'production') {\n if (arguments.length > 1) {\n printWarning(\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\n );\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\n var type = getPreciseType(value);\n if (type === 'symbol') {\n return String(value);\n }\n return value;\n });\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunctionThatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\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\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = 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 elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\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 ReactIs = require('react-is');\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')(ReactIs.isElement, 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","function isElement(el) {\n return el != null && typeof el === 'object' && el.nodeType === 1;\n}\n\nfunction canOverflow(overflow, skipOverflowHiddenElements) {\n if (skipOverflowHiddenElements && overflow === 'hidden') {\n return false;\n }\n\n return overflow !== 'visible' && overflow !== 'clip';\n}\n\nfunction isScrollable(el, skipOverflowHiddenElements) {\n if (el.clientHeight < el.scrollHeight || el.clientWidth < el.scrollWidth) {\n var style = getComputedStyle(el, null);\n return canOverflow(style.overflowY, skipOverflowHiddenElements) || canOverflow(style.overflowX, skipOverflowHiddenElements);\n }\n\n return false;\n}\n\nfunction alignNearest(scrollingEdgeStart, scrollingEdgeEnd, scrollingSize, scrollingBorderStart, scrollingBorderEnd, elementEdgeStart, elementEdgeEnd, elementSize) {\n if (elementEdgeStart < scrollingEdgeStart && elementEdgeEnd > scrollingEdgeEnd || elementEdgeStart > scrollingEdgeStart && elementEdgeEnd < scrollingEdgeEnd) {\n return 0;\n }\n\n if (elementEdgeStart <= scrollingEdgeStart && elementSize <= scrollingSize || elementEdgeEnd >= scrollingEdgeEnd && elementSize >= scrollingSize) {\n return elementEdgeStart - scrollingEdgeStart - scrollingBorderStart;\n }\n\n if (elementEdgeEnd > scrollingEdgeEnd && elementSize < scrollingSize || elementEdgeStart < scrollingEdgeStart && elementSize > scrollingSize) {\n return elementEdgeEnd - scrollingEdgeEnd + scrollingBorderEnd;\n }\n\n return 0;\n}\n\nexport default (function (target, options) {\n var scrollMode = options.scrollMode,\n block = options.block,\n inline = options.inline,\n boundary = options.boundary,\n skipOverflowHiddenElements = options.skipOverflowHiddenElements;\n var checkBoundary = typeof boundary === 'function' ? boundary : function (node) {\n return node !== boundary;\n };\n\n if (!isElement(target)) {\n throw new TypeError('Invalid target');\n }\n\n var scrollingElement = document.scrollingElement || document.documentElement;\n var frames = [];\n var cursor = target;\n\n while (isElement(cursor) && checkBoundary(cursor)) {\n cursor = cursor.parentNode;\n\n if (cursor === scrollingElement) {\n frames.push(cursor);\n break;\n }\n\n if (cursor === document.body && isScrollable(cursor) && !isScrollable(document.documentElement)) {\n continue;\n }\n\n if (isScrollable(cursor, skipOverflowHiddenElements)) {\n frames.push(cursor);\n }\n }\n\n var viewportWidth = window.visualViewport ? visualViewport.width : innerWidth;\n var viewportHeight = window.visualViewport ? visualViewport.height : innerHeight;\n var viewportX = window.scrollX || pageXOffset;\n var viewportY = window.scrollY || pageYOffset;\n\n var _target$getBoundingCl = target.getBoundingClientRect(),\n targetHeight = _target$getBoundingCl.height,\n targetWidth = _target$getBoundingCl.width,\n targetTop = _target$getBoundingCl.top,\n targetRight = _target$getBoundingCl.right,\n targetBottom = _target$getBoundingCl.bottom,\n targetLeft = _target$getBoundingCl.left;\n\n var targetBlock = block === 'start' || block === 'nearest' ? targetTop : block === 'end' ? targetBottom : targetTop + targetHeight / 2;\n var targetInline = inline === 'center' ? targetLeft + targetWidth / 2 : inline === 'end' ? targetRight : targetLeft;\n var computations = [];\n\n for (var index = 0; index < frames.length; index++) {\n var frame = frames[index];\n\n var _frame$getBoundingCli = frame.getBoundingClientRect(),\n _height = _frame$getBoundingCli.height,\n _width = _frame$getBoundingCli.width,\n _top = _frame$getBoundingCli.top,\n right = _frame$getBoundingCli.right,\n bottom = _frame$getBoundingCli.bottom,\n _left = _frame$getBoundingCli.left;\n\n if (scrollMode === 'if-needed' && targetTop >= 0 && targetLeft >= 0 && targetBottom <= viewportHeight && targetRight <= viewportWidth && targetTop >= _top && targetBottom <= bottom && targetLeft >= _left && targetRight <= right) {\n return computations;\n }\n\n var frameStyle = getComputedStyle(frame);\n var borderLeft = parseInt(frameStyle.borderLeftWidth, 10);\n var borderTop = parseInt(frameStyle.borderTopWidth, 10);\n var borderRight = parseInt(frameStyle.borderRightWidth, 10);\n var borderBottom = parseInt(frameStyle.borderBottomWidth, 10);\n var blockScroll = 0;\n var inlineScroll = 0;\n var scrollbarWidth = 'offsetWidth' in frame ? frame.offsetWidth - frame.clientWidth - borderLeft - borderRight : 0;\n var scrollbarHeight = 'offsetHeight' in frame ? frame.offsetHeight - frame.clientHeight - borderTop - borderBottom : 0;\n\n if (scrollingElement === frame) {\n if (block === 'start') {\n blockScroll = targetBlock;\n } else if (block === 'end') {\n blockScroll = targetBlock - viewportHeight;\n } else if (block === 'nearest') {\n blockScroll = alignNearest(viewportY, viewportY + viewportHeight, viewportHeight, borderTop, borderBottom, viewportY + targetBlock, viewportY + targetBlock + targetHeight, targetHeight);\n } else {\n blockScroll = targetBlock - viewportHeight / 2;\n }\n\n if (inline === 'start') {\n inlineScroll = targetInline;\n } else if (inline === 'center') {\n inlineScroll = targetInline - viewportWidth / 2;\n } else if (inline === 'end') {\n inlineScroll = targetInline - viewportWidth;\n } else {\n inlineScroll = alignNearest(viewportX, viewportX + viewportWidth, viewportWidth, borderLeft, borderRight, viewportX + targetInline, viewportX + targetInline + targetWidth, targetWidth);\n }\n\n blockScroll = Math.max(0, blockScroll + viewportY);\n inlineScroll = Math.max(0, inlineScroll + viewportX);\n } else {\n if (block === 'start') {\n blockScroll = targetBlock - _top - borderTop;\n } else if (block === 'end') {\n blockScroll = targetBlock - bottom + borderBottom + scrollbarHeight;\n } else if (block === 'nearest') {\n blockScroll = alignNearest(_top, bottom, _height, borderTop, borderBottom + scrollbarHeight, targetBlock, targetBlock + targetHeight, targetHeight);\n } else {\n blockScroll = targetBlock - (_top + _height / 2) + scrollbarHeight / 2;\n }\n\n if (inline === 'start') {\n inlineScroll = targetInline - _left - borderLeft;\n } else if (inline === 'center') {\n inlineScroll = targetInline - (_left + _width / 2) + scrollbarWidth / 2;\n } else if (inline === 'end') {\n inlineScroll = targetInline - right + borderRight + scrollbarWidth;\n } else {\n inlineScroll = alignNearest(_left, right, _width, borderLeft, borderRight + scrollbarWidth, targetInline, targetInline + targetWidth, targetWidth);\n }\n\n var scrollLeft = frame.scrollLeft,\n scrollTop = frame.scrollTop;\n blockScroll = Math.max(0, Math.min(scrollTop + blockScroll, frame.scrollHeight - _height + scrollbarHeight));\n inlineScroll = Math.max(0, Math.min(scrollLeft + inlineScroll, frame.scrollWidth - _width + scrollbarWidth));\n targetBlock += scrollTop - blockScroll;\n targetInline += scrollLeft - inlineScroll;\n }\n\n computations.push({\n el: frame,\n top: blockScroll,\n left: inlineScroll\n });\n }\n\n return computations;\n});","import computeScrollIntoView from 'compute-scroll-into-view'\nimport {isPreact} from './is.macro'\n\nlet idCounter = 0\n\n/**\n * Accepts a parameter and returns it if it's a function\n * or a noop function if it's not. This allows us to\n * accept a callback, but not worry about it if it's not\n * passed.\n * @param {Function} cb the callback\n * @return {Function} a function\n */\nfunction cbToCb(cb) {\n return typeof cb === 'function' ? cb : noop\n}\n\nfunction noop() {}\n\n/**\n * Scroll node into view if necessary\n * @param {HTMLElement} node the element that should scroll into view\n * @param {HTMLElement} menuNode the menu element of the component\n */\nfunction scrollIntoView(node, menuNode) {\n if (node === null) {\n return\n }\n\n const actions = computeScrollIntoView(node, {\n boundary: menuNode,\n block: 'nearest',\n scrollMode: 'if-needed',\n })\n actions.forEach(({el, top, left}) => {\n el.scrollTop = top\n el.scrollLeft = left\n })\n}\n\n/**\n * @param {HTMLElement} parent the parent node\n * @param {HTMLElement} child the child node\n * @return {Boolean} whether the parent is the child or the child is in the parent\n */\nfunction isOrContainsNode(parent, child) {\n return parent === child || (parent.contains && parent.contains(child))\n}\n\n/**\n * Simple debounce implementation. Will call the given\n * function once after the time given has passed since\n * it was last called.\n * @param {Function} fn the function to call after the time\n * @param {Number} time the time to wait\n * @return {Function} the debounced function\n */\nfunction debounce(fn, time) {\n let timeoutId\n\n function cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId)\n }\n }\n\n function wrapper(...args) {\n cancel()\n timeoutId = setTimeout(() => {\n timeoutId = null\n fn(...args)\n }, time)\n }\n\n wrapper.cancel = cancel\n\n return wrapper\n}\n\n/**\n * This is intended to be used to compose event handlers.\n * They are executed in order until one of them sets\n * `event.preventDownshiftDefault = true`.\n * @param {...Function} fns the event handler functions\n * @return {Function} the event handler to add to an element\n */\nfunction callAllEventHandlers(...fns) {\n return (event, ...args) =>\n fns.some(fn => {\n if (fn) {\n fn(event, ...args)\n }\n return (\n event.preventDownshiftDefault ||\n (event.hasOwnProperty('nativeEvent') &&\n event.nativeEvent.preventDownshiftDefault)\n )\n })\n}\n\n/**\n * This return a function that will call all the given functions with\n * the arguments with which it's called. It does a null-check before\n * attempting to call the functions and can take any number of functions.\n * @param {...Function} fns the functions to call\n * @return {Function} the function that calls all the functions\n */\nfunction callAll(...fns) {\n return (...args) => {\n fns.forEach(fn => {\n if (fn) {\n fn(...args)\n }\n })\n }\n}\n\n/**\n * This generates a unique ID for an instance of Downshift\n * @return {String} the unique ID\n */\nfunction generateId() {\n return String(idCounter++)\n}\n\n/**\n * This is only used in tests\n * @param {Number} num the number to set the idCounter to\n */\nfunction setIdCounter(num) {\n idCounter = num\n}\n\n/**\n * Resets idCounter to 0. Used for SSR.\n */\nfunction resetIdCounter() {\n idCounter = 0\n}\n\n/**\n * @param {Object} param the downshift state and other relevant properties\n * @return {String} the a11y status message\n */\nfunction getA11yStatusMessage({\n isOpen,\n selectedItem,\n resultCount,\n previousResultCount,\n itemToString,\n}) {\n if (!isOpen) {\n return selectedItem ? itemToString(selectedItem) : ''\n }\n if (!resultCount) {\n return 'No results are available.'\n }\n if (resultCount !== previousResultCount) {\n return `${resultCount} result${\n resultCount === 1 ? ' is' : 's are'\n } available, use up and down arrow keys to navigate. Press Enter key to select.`\n }\n return ''\n}\n\n/**\n * Takes an argument and if it's an array, returns the first item in the array\n * otherwise returns the argument\n * @param {*} arg the maybe-array\n * @param {*} defaultValue the value if arg is falsey not defined\n * @return {*} the arg or it's first item\n */\nfunction unwrapArray(arg, defaultValue) {\n arg = Array.isArray(arg) ? /* istanbul ignore next (preact) */ arg[0] : arg\n if (!arg && defaultValue) {\n return defaultValue\n } else {\n return arg\n }\n}\n\n/**\n * @param {Object} element (P)react element\n * @return {Boolean} whether it's a DOM element\n */\nfunction isDOMElement(element) {\n /* istanbul ignore if */\n if (isPreact) {\n // then this is preact\n return typeof element.nodeName === 'string'\n }\n\n // then we assume this is react\n return typeof element.type === 'string'\n}\n\n/**\n * @param {Object} element (P)react element\n * @return {Object} the props\n */\nfunction getElementProps(element) {\n // props for react, attributes for preact\n\n /* istanbul ignore if */\n if (isPreact) {\n return element.attributes\n }\n\n return element.props\n}\n\n/**\n * Throws a helpful error message for required properties. Useful\n * to be used as a default in destructuring or object params.\n * @param {String} fnName the function name\n * @param {String} propName the prop name\n */\nfunction requiredProp(fnName, propName) {\n // eslint-disable-next-line no-console\n console.error(`The property \"${propName}\" is required in \"${fnName}\"`)\n}\n\nconst stateKeys = [\n 'highlightedIndex',\n 'inputValue',\n 'isOpen',\n 'selectedItem',\n 'type',\n]\n/**\n * @param {Object} state the state object\n * @return {Object} state that is relevant to downshift\n */\nfunction pickState(state = {}) {\n const result = {}\n stateKeys.forEach(k => {\n if (state.hasOwnProperty(k)) {\n result[k] = state[k]\n }\n })\n return result\n}\n\n/**\n * Normalizes the 'key' property of a KeyboardEvent in IE/Edge\n * @param {Object} event a keyboardEvent object\n * @return {String} keyboard key\n */\nfunction normalizeArrowKey(event) {\n const {key, keyCode} = event\n /* istanbul ignore next (ie) */\n if (keyCode >= 37 && keyCode <= 40 && key.indexOf('Arrow') !== 0) {\n return `Arrow${key}`\n }\n return key\n}\n\n/**\n * Simple check if the value passed is object literal\n * @param {*} obj any things\n * @return {Boolean} whether it's object literal\n */\nfunction isPlainObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]'\n}\n\n/**\n * Returns the new index in the list, in a circular way. If next value is out of bonds from the total,\n * it will wrap to either 0 or itemCount - 1.\n *\n * @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards.\n * @param {number} baseIndex The initial position to move from.\n * @param {number} itemCount The total number of items.\n * @returns {number} The new index after the move.\n */\nfunction getNextWrappingIndex(moveAmount, baseIndex, itemCount) {\n const itemsLastIndex = itemCount - 1\n\n if (\n typeof baseIndex !== 'number' ||\n baseIndex < 0 ||\n baseIndex >= itemCount\n ) {\n baseIndex = moveAmount > 0 ? -1 : itemsLastIndex + 1\n }\n let newIndex = baseIndex + moveAmount\n if (newIndex < 0) {\n newIndex = itemsLastIndex\n } else if (newIndex > itemsLastIndex) {\n newIndex = 0\n }\n return newIndex\n}\n\nexport {\n cbToCb,\n callAllEventHandlers,\n callAll,\n debounce,\n scrollIntoView,\n generateId,\n getA11yStatusMessage,\n unwrapArray,\n isDOMElement,\n getElementProps,\n isOrContainsNode,\n noop,\n requiredProp,\n setIdCounter,\n resetIdCounter,\n pickState,\n isPlainObject,\n normalizeArrowKey,\n getNextWrappingIndex,\n}\n","import {debounce} from './utils'\n\nlet statusDiv\n\nconst cleanupStatus = debounce(() => {\n getStatusDiv().textContent = ''\n}, 500)\n\n/**\n * @param {String} status the status message\n * @param {Object} documentProp document passed by the user.\n */\nfunction setStatus(status, documentProp) {\n const div = getStatusDiv(documentProp)\n if (!status) {\n return\n }\n\n div.textContent = status\n cleanupStatus()\n}\n\n/**\n * Get the status node or create it if it does not already exist.\n * @param {Object} documentProp document passed by the user.\n * @return {HTMLElement} the status node.\n */\nfunction getStatusDiv(documentProp = document) {\n if (statusDiv) {\n return statusDiv\n }\n\n statusDiv = documentProp.createElement('div')\n statusDiv.setAttribute('id', 'a11y-status-message')\n statusDiv.setAttribute('role', 'status')\n statusDiv.setAttribute('aria-live', 'polite')\n statusDiv.setAttribute('aria-relevant', 'additions text')\n Object.assign(statusDiv.style, {\n border: '0',\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px',\n })\n documentProp.body.appendChild(statusDiv)\n return statusDiv\n}\n\nexport default setStatus\n","import productionEnum from './productionEnum.macro'\n\nexport const unknown = productionEnum('__autocomplete_unknown__')\nexport const mouseUp = productionEnum('__autocomplete_mouseup__')\nexport const itemMouseEnter = productionEnum('__autocomplete_item_mouseenter__')\nexport const keyDownArrowUp = productionEnum(\n '__autocomplete_keydown_arrow_up__',\n)\nexport const keyDownArrowDown = productionEnum(\n '__autocomplete_keydown_arrow_down__',\n)\nexport const keyDownEscape = productionEnum('__autocomplete_keydown_escape__')\nexport const keyDownEnter = productionEnum('__autocomplete_keydown_enter__')\nexport const keyDownHome = productionEnum('__autocomplete_keydown_home__')\nexport const keyDownEnd = productionEnum('__autocomplete_keydown_end__')\nexport const clickItem = productionEnum('__autocomplete_click_item__')\nexport const blurInput = productionEnum('__autocomplete_blur_input__')\nexport const changeInput = productionEnum('__autocomplete_change_input__')\nexport const keyDownSpaceButton = productionEnum(\n '__autocomplete_keydown_space_button__',\n)\nexport const clickButton = productionEnum('__autocomplete_click_button__')\nexport const blurButton = productionEnum('__autocomplete_blur_button__')\nexport const controlledPropUpdatedSelectedItem = productionEnum(\n '__autocomplete_controlled_prop_updated_selected_item__',\n)\nexport const touchEnd = productionEnum('__autocomplete_touchend__')\n","/* eslint camelcase:0 */\n\nimport PropTypes from 'prop-types'\nimport React, {Component} from 'react'\nimport {isForwardRef} from 'react-is'\nimport {isPreact, isReactNative} from './is.macro'\nimport setA11yStatus from './set-a11y-status'\nimport * as stateChangeTypes from './stateChangeTypes'\nimport {\n callAll,\n callAllEventHandlers,\n cbToCb,\n debounce,\n generateId,\n getA11yStatusMessage,\n getElementProps,\n isDOMElement,\n isOrContainsNode,\n isPlainObject,\n noop,\n normalizeArrowKey,\n pickState,\n requiredProp,\n scrollIntoView,\n unwrapArray,\n getNextWrappingIndex,\n} from './utils'\n\nclass Downshift extends Component {\n static propTypes = {\n children: PropTypes.func,\n defaultHighlightedIndex: PropTypes.number,\n defaultIsOpen: PropTypes.bool,\n initialHighlightedIndex: PropTypes.number,\n initialSelectedItem: PropTypes.any,\n initialInputValue: PropTypes.string,\n initialIsOpen: PropTypes.bool,\n getA11yStatusMessage: PropTypes.func,\n itemToString: PropTypes.func,\n onChange: PropTypes.func,\n onSelect: PropTypes.func,\n onStateChange: PropTypes.func,\n onInputValueChange: PropTypes.func,\n onUserAction: PropTypes.func,\n onOuterClick: PropTypes.func,\n selectedItemChanged: PropTypes.func,\n stateReducer: PropTypes.func,\n itemCount: PropTypes.number,\n id: PropTypes.string,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func,\n removeEventListener: PropTypes.func,\n document: PropTypes.shape({\n getElementById: PropTypes.func,\n activeElement: PropTypes.any,\n body: PropTypes.any,\n }),\n }),\n suppressRefError: PropTypes.bool,\n scrollIntoView: PropTypes.func,\n // things we keep in state for uncontrolled components\n // but can accept as props for controlled components\n /* eslint-disable react/no-unused-prop-types */\n selectedItem: PropTypes.any,\n isOpen: PropTypes.bool,\n inputValue: PropTypes.string,\n highlightedIndex: PropTypes.number,\n labelId: PropTypes.string,\n inputId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func,\n /* eslint-enable react/no-unused-prop-types */\n }\n\n static defaultProps = {\n defaultHighlightedIndex: null,\n defaultIsOpen: false,\n getA11yStatusMessage,\n itemToString: i => {\n if (i == null) {\n return ''\n }\n if (\n process.env.NODE_ENV !== 'production' &&\n isPlainObject(i) &&\n !i.hasOwnProperty('toString')\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n 'downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.',\n 'The object that was passed:',\n i,\n )\n }\n return String(i)\n },\n onStateChange: noop,\n onInputValueChange: noop,\n onUserAction: noop,\n onChange: noop,\n onSelect: noop,\n onOuterClick: noop,\n selectedItemChanged: (prevItem, item) => prevItem !== item,\n environment:\n typeof window === 'undefined' /* istanbul ignore next (ssr) */\n ? {}\n : window,\n stateReducer: (state, stateToSet) => stateToSet,\n suppressRefError: false,\n scrollIntoView,\n }\n\n static stateChangeTypes = stateChangeTypes\n\n constructor(props) {\n super(props)\n // fancy destructuring + defaults + aliases\n // this basically says each value of state should either be set to\n // the initial value or the default value if the initial value is not provided\n const {\n defaultHighlightedIndex,\n initialHighlightedIndex: highlightedIndex = defaultHighlightedIndex,\n defaultIsOpen,\n initialIsOpen: isOpen = defaultIsOpen,\n initialInputValue: inputValue = '',\n initialSelectedItem: selectedItem = null,\n } = this.props\n const state = this.getState({\n highlightedIndex,\n isOpen,\n inputValue,\n selectedItem,\n })\n if (\n state.selectedItem != null &&\n this.props.initialInputValue === undefined\n ) {\n state.inputValue = this.props.itemToString(state.selectedItem)\n }\n this.state = state\n }\n\n id = this.props.id || `downshift-${generateId()}`\n menuId = this.props.menuId || `${this.id}-menu`\n labelId = this.props.labelId || `${this.id}-label`\n inputId = this.props.inputId || `${this.id}-input`\n getItemId = this.props.getItemId || (index => `${this.id}-item-${index}`)\n\n input = null\n items = []\n // itemCount can be changed asynchronously\n // from within downshift (so it can't come from a prop)\n // this is why we store it as an instance and use\n // getItemCount rather than just use items.length\n // (to support windowing + async)\n itemCount = null\n previousResultCount = 0\n\n timeoutIds = []\n\n /**\n * @param {Function} fn the function to call after the time\n * @param {Number} time the time to wait\n */\n internalSetTimeout = (fn, time) => {\n const id = setTimeout(() => {\n this.timeoutIds = this.timeoutIds.filter(i => i !== id)\n fn()\n }, time)\n\n this.timeoutIds.push(id)\n }\n\n /**\n * Clear all running timeouts\n */\n internalClearTimeouts() {\n this.timeoutIds.forEach(id => {\n clearTimeout(id)\n })\n\n this.timeoutIds = []\n }\n\n /**\n * Gets the state based on internal state or props\n * If a state value is passed via props, then that\n * is the value given, otherwise it's retrieved from\n * stateToMerge\n *\n * This will perform a shallow merge of the given state object\n * with the state coming from props\n * (for the controlled component scenario)\n * This is used in state updater functions so they're referencing\n * the right state regardless of where it comes from.\n *\n * @param {Object} stateToMerge defaults to this.state\n * @return {Object} the state\n */\n getState(stateToMerge = this.state) {\n return Object.keys(stateToMerge).reduce((state, key) => {\n state[key] = this.isControlledProp(key)\n ? this.props[key]\n : stateToMerge[key]\n return state\n }, {})\n }\n\n /**\n * This determines whether a prop is a \"controlled prop\" meaning it is\n * state which is controlled by the outside of this component rather\n * than within this component.\n * @param {String} key the key to check\n * @return {Boolean} whether it is a controlled controlled prop\n */\n isControlledProp(key) {\n return this.props[key] !== undefined\n }\n\n getItemCount() {\n // things read better this way. They're in priority order:\n // 1. `this.itemCount`\n // 2. `this.props.itemCount`\n // 3. `this.items.length`\n let itemCount = this.items.length\n if (this.itemCount != null) {\n itemCount = this.itemCount\n } else if (this.props.itemCount !== undefined) {\n itemCount = this.props.itemCount\n }\n return itemCount\n }\n\n setItemCount = count => {\n this.itemCount = count\n }\n\n unsetItemCount = () => {\n this.itemCount = null\n }\n\n getItemNodeFromIndex(index) {\n return this.props.environment.document.getElementById(this.getItemId(index))\n }\n\n setHighlightedIndex = (\n highlightedIndex = this.props.defaultHighlightedIndex,\n otherStateToSet = {},\n ) => {\n otherStateToSet = pickState(otherStateToSet)\n this.internalSetState({highlightedIndex, ...otherStateToSet})\n }\n\n scrollHighlightedItemIntoView() {\n /* istanbul ignore else (react-native) */\n if (!isReactNative) {\n const node = this.getItemNodeFromIndex(this.getState().highlightedIndex)\n this.props.scrollIntoView(node, this._menuNode)\n }\n }\n\n moveHighlightedIndex(amount, otherStateToSet) {\n const itemCount = this.getItemCount()\n if (itemCount > 0) {\n const nextHighlightedIndex = getNextWrappingIndex(\n amount,\n this.getState().highlightedIndex,\n itemCount,\n )\n this.setHighlightedIndex(nextHighlightedIndex, otherStateToSet)\n }\n }\n\n highlightFirstOrLastIndex(event, first, otherStateToSet) {\n const itemsLastIndex = this.getItemCount() - 1\n if (itemsLastIndex < 0 || !this.getState().isOpen) {\n return\n }\n event.preventDefault()\n this.setHighlightedIndex(first ? 0 : itemsLastIndex, otherStateToSet)\n }\n\n clearSelection = cb => {\n this.internalSetState(\n {\n selectedItem: null,\n inputValue: '',\n highlightedIndex: this.props.defaultHighlightedIndex,\n isOpen: this.props.defaultIsOpen,\n },\n cb,\n )\n }\n\n selectItem = (item, otherStateToSet, cb) => {\n otherStateToSet = pickState(otherStateToSet)\n this.internalSetState(\n {\n isOpen: this.props.defaultIsOpen,\n highlightedIndex: this.props.defaultHighlightedIndex,\n selectedItem: item,\n inputValue: this.props.itemToString(item),\n ...otherStateToSet,\n },\n cb,\n )\n }\n\n selectItemAtIndex = (itemIndex, otherStateToSet, cb) => {\n const item = this.items[itemIndex]\n if (item == null) {\n return\n }\n this.selectItem(item, otherStateToSet, cb)\n }\n\n selectHighlightedItem = (otherStateToSet, cb) => {\n return this.selectItemAtIndex(\n this.getState().highlightedIndex,\n otherStateToSet,\n cb,\n )\n }\n\n // any piece of our state can live in two places:\n // 1. Uncontrolled: it's internal (this.state)\n // We will call this.setState to update that state\n // 2. Controlled: it's external (this.props)\n // We will call this.props.onStateChange to update that state\n //\n // In addition, we'll call this.props.onChange if the\n // selectedItem is changed.\n internalSetState = (stateToSet, cb) => {\n let isItemSelected, onChangeArg\n\n const onStateChangeArg = {}\n const isStateToSetFunction = typeof stateToSet === 'function'\n\n // we want to call `onInputValueChange` before the `setState` call\n // so someone controlling the `inputValue` state gets notified of\n // the input change as soon as possible. This avoids issues with\n // preserving the cursor position.\n // See https://github.com/downshift-js/downshift/issues/217 for more info.\n if (!isStateToSetFunction && stateToSet.hasOwnProperty('inputValue')) {\n this.props.onInputValueChange(stateToSet.inputValue, {\n ...this.getStateAndHelpers(),\n ...stateToSet,\n })\n }\n return this.setState(\n state => {\n state = this.getState(state)\n let newStateToSet = isStateToSetFunction\n ? stateToSet(state)\n : stateToSet\n\n // Your own function that could modify the state that will be set.\n newStateToSet = this.props.stateReducer(state, newStateToSet)\n\n // checks if an item is selected, regardless of if it's different from\n // what was selected before\n // used to determine if onSelect and onChange callbacks should be called\n isItemSelected = newStateToSet.hasOwnProperty('selectedItem')\n // this keeps track of the object we want to call with setState\n const nextState = {}\n // this is just used to tell whether the state changed\n const nextFullState = {}\n // we need to call on change if the outside world is controlling any of our state\n // and we're trying to update that state. OR if the selection has changed and we're\n // trying to update the selection\n if (\n isItemSelected &&\n newStateToSet.selectedItem !== state.selectedItem\n ) {\n onChangeArg = newStateToSet.selectedItem\n }\n newStateToSet.type = newStateToSet.type || stateChangeTypes.unknown\n\n Object.keys(newStateToSet).forEach(key => {\n // onStateChangeArg should only have the state that is\n // actually changing\n if (state[key] !== newStateToSet[key]) {\n onStateChangeArg[key] = newStateToSet[key]\n }\n // the type is useful for the onStateChangeArg\n // but we don't actually want to set it in internal state.\n // this is an undocumented feature for now... Not all internalSetState\n // calls support it and I'm not certain we want them to yet.\n // But it enables users controlling the isOpen state to know when\n // the isOpen state changes due to mouseup events which is quite handy.\n if (key === 'type') {\n return\n }\n nextFullState[key] = newStateToSet[key]\n // if it's coming from props, then we don't care to set it internally\n if (!this.isControlledProp(key)) {\n nextState[key] = newStateToSet[key]\n }\n })\n\n // if stateToSet is a function, then we weren't able to call onInputValueChange\n // earlier, so we'll call it now that we know what the inputValue state will be.\n if (\n isStateToSetFunction &&\n newStateToSet.hasOwnProperty('inputValue')\n ) {\n this.props.onInputValueChange(newStateToSet.inputValue, {\n ...this.getStateAndHelpers(),\n ...newStateToSet,\n })\n }\n\n return nextState\n },\n () => {\n // call the provided callback if it's a function\n cbToCb(cb)()\n\n // only call the onStateChange and onChange callbacks if\n // we have relevant information to pass them.\n const hasMoreStateThanType = Object.keys(onStateChangeArg).length > 1\n if (hasMoreStateThanType) {\n this.props.onStateChange(onStateChangeArg, this.getStateAndHelpers())\n }\n\n if (isItemSelected) {\n this.props.onSelect(\n stateToSet.selectedItem,\n this.getStateAndHelpers(),\n )\n }\n\n if (onChangeArg !== undefined) {\n this.props.onChange(onChangeArg, this.getStateAndHelpers())\n }\n // this is currently undocumented and therefore subject to change\n // We'll try to not break it, but just be warned.\n this.props.onUserAction(onStateChangeArg, this.getStateAndHelpers())\n },\n )\n }\n\n getStateAndHelpers() {\n const {highlightedIndex, inputValue, selectedItem, isOpen} = this.getState()\n const {itemToString} = this.props\n const {id} = this\n const {\n getRootProps,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n getInputProps,\n getItemProps,\n openMenu,\n closeMenu,\n toggleMenu,\n selectItem,\n selectItemAtIndex,\n selectHighlightedItem,\n setHighlightedIndex,\n clearSelection,\n clearItems,\n reset,\n setItemCount,\n unsetItemCount,\n internalSetState: setState,\n } = this\n return {\n // prop getters\n getRootProps,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n getInputProps,\n getItemProps,\n\n // actions\n reset,\n openMenu,\n closeMenu,\n toggleMenu,\n selectItem,\n selectItemAtIndex,\n selectHighlightedItem,\n setHighlightedIndex,\n clearSelection,\n clearItems,\n setItemCount,\n unsetItemCount,\n setState,\n\n // props\n itemToString,\n\n // derived\n id,\n\n // state\n highlightedIndex,\n inputValue,\n isOpen,\n selectedItem,\n }\n }\n\n //////////////////////////// ROOT\n\n rootRef = node => (this._rootNode = node)\n\n getRootProps = (\n {refKey = 'ref', ref, ...rest} = {},\n {suppressRefError = false} = {},\n ) => {\n // this is used in the render to know whether the user has called getRootProps.\n // It uses that to know whether to apply the props automatically\n this.getRootProps.called = true\n this.getRootProps.refKey = refKey\n this.getRootProps.suppressRefError = suppressRefError\n const {isOpen} = this.getState()\n return {\n [refKey]: callAll(ref, this.rootRef),\n role: 'combobox',\n 'aria-expanded': isOpen,\n 'aria-haspopup': 'listbox',\n 'aria-owns': isOpen ? this.menuId : null,\n 'aria-labelledby': this.labelId,\n ...rest,\n }\n }\n\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ROOT\n\n keyDownHandlers = {\n ArrowDown(event) {\n event.preventDefault()\n\n if (this.getState().isOpen) {\n const amount = event.shiftKey ? 5 : 1\n this.moveHighlightedIndex(amount, {\n type: stateChangeTypes.keyDownArrowDown,\n })\n } else {\n this.internalSetState(\n {\n isOpen: true,\n type: stateChangeTypes.keyDownArrowDown,\n },\n () => {\n const itemCount = this.getItemCount()\n if (itemCount > 0) {\n this.setHighlightedIndex(\n getNextWrappingIndex(\n 1,\n this.getState().highlightedIndex,\n itemCount,\n ),\n {type: stateChangeTypes.keyDownArrowDown},\n )\n }\n },\n )\n }\n },\n\n ArrowUp(event) {\n event.preventDefault()\n\n if (this.getState().isOpen) {\n const amount = event.shiftKey ? -5 : -1\n this.moveHighlightedIndex(amount, {\n type: stateChangeTypes.keyDownArrowUp,\n })\n } else {\n this.internalSetState(\n {\n isOpen: true,\n type: stateChangeTypes.keyDownArrowUp,\n },\n () => {\n const itemCount = this.getItemCount()\n if (itemCount > 0) {\n this.setHighlightedIndex(\n getNextWrappingIndex(\n -1,\n this.getState().highlightedIndex,\n itemCount,\n ),\n {type: stateChangeTypes.keyDownArrowDown},\n )\n }\n },\n )\n }\n },\n\n Enter(event) {\n const {isOpen, highlightedIndex} = this.getState()\n if (isOpen && highlightedIndex != null) {\n event.preventDefault()\n const item = this.items[highlightedIndex]\n const itemNode = this.getItemNodeFromIndex(highlightedIndex)\n if (item == null || (itemNode && itemNode.hasAttribute('disabled'))) {\n return\n }\n this.selectHighlightedItem({\n type: stateChangeTypes.keyDownEnter,\n })\n }\n },\n\n Escape(event) {\n event.preventDefault()\n this.reset({\n type: stateChangeTypes.keyDownEscape,\n selectedItem: null,\n inputValue: '',\n })\n },\n }\n\n //////////////////////////// BUTTON\n\n buttonKeyDownHandlers = {\n ...this.keyDownHandlers,\n\n ' '(event) {\n event.preventDefault()\n this.toggleMenu({type: stateChangeTypes.keyDownSpaceButton})\n },\n }\n\n inputKeyDownHandlers = {\n ...this.keyDownHandlers,\n Home(event) {\n this.highlightFirstOrLastIndex(event, true, {\n type: stateChangeTypes.keyDownHome,\n })\n },\n\n End(event) {\n this.highlightFirstOrLastIndex(event, false, {\n type: stateChangeTypes.keyDownEnd,\n })\n },\n }\n\n getToggleButtonProps = ({\n onClick,\n onPress,\n onKeyDown,\n onKeyUp,\n onBlur,\n ...rest\n } = {}) => {\n const {isOpen} = this.getState()\n const enabledEventHandlers = isReactNative\n ? /* istanbul ignore next (react-native) */\n {\n onPress: callAllEventHandlers(onPress, this.buttonHandleClick),\n }\n : {\n onClick: callAllEventHandlers(onClick, this.buttonHandleClick),\n onKeyDown: callAllEventHandlers(onKeyDown, this.buttonHandleKeyDown),\n onKeyUp: callAllEventHandlers(onKeyUp, this.buttonHandleKeyUp),\n onBlur: callAllEventHandlers(onBlur, this.buttonHandleBlur),\n }\n const eventHandlers = rest.disabled ? {} : enabledEventHandlers\n return {\n type: 'button',\n role: 'button',\n 'aria-label': isOpen ? 'close menu' : 'open menu',\n 'aria-haspopup': true,\n 'data-toggle': true,\n ...eventHandlers,\n ...rest,\n }\n }\n\n buttonHandleKeyUp = event => {\n // Prevent click event from emitting in Firefox\n event.preventDefault()\n }\n\n buttonHandleKeyDown = event => {\n const key = normalizeArrowKey(event)\n if (this.buttonKeyDownHandlers[key]) {\n this.buttonKeyDownHandlers[key].call(this, event)\n }\n }\n\n buttonHandleClick = event => {\n event.preventDefault()\n // handle odd case for Safari and Firefox which\n // don't give the button the focus properly.\n /* istanbul ignore if (can't reasonably test this) */\n if (\n !isReactNative &&\n this.props.environment.document.activeElement ===\n this.props.environment.document.body\n ) {\n event.target.focus()\n }\n // to simplify testing components that use downshift, we'll not wrap this in a setTimeout\n // if the NODE_ENV is test. With the proper build system, this should be dead code eliminated\n // when building for production and should therefore have no impact on production code.\n if (process.env.NODE_ENV === 'test') {\n this.toggleMenu({type: stateChangeTypes.clickButton})\n } else {\n // Ensure that toggle of menu occurs after the potential blur event in iOS\n this.internalSetTimeout(() =>\n this.toggleMenu({type: stateChangeTypes.clickButton}),\n )\n }\n }\n\n buttonHandleBlur = event => {\n const blurTarget = event.target // Save blur target for comparison with activeElement later\n // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not body element\n this.internalSetTimeout(() => {\n if (\n !this.isMouseDown &&\n (this.props.environment.document.activeElement == null ||\n this.props.environment.document.activeElement.id !== this.inputId) &&\n this.props.environment.document.activeElement !== blurTarget // Do nothing if we refocus the same element again (to solve issue in Safari on iOS)\n ) {\n this.reset({type: stateChangeTypes.blurButton})\n }\n })\n }\n\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ BUTTON\n\n /////////////////////////////// LABEL\n\n getLabelProps = props => {\n return {htmlFor: this.inputId, id: this.labelId, ...props}\n }\n\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ LABEL\n\n /////////////////////////////// INPUT\n\n getInputProps = ({\n onKeyDown,\n onBlur,\n onChange,\n onInput,\n onChangeText,\n ...rest\n } = {}) => {\n let onChangeKey\n let eventHandlers = {}\n\n /* istanbul ignore next (preact) */\n if (isPreact) {\n onChangeKey = 'onInput'\n } else {\n onChangeKey = 'onChange'\n }\n const {inputValue, isOpen, highlightedIndex} = this.getState()\n\n if (!rest.disabled) {\n eventHandlers = {\n [onChangeKey]: callAllEventHandlers(\n onChange,\n onInput,\n this.inputHandleChange,\n ),\n onKeyDown: callAllEventHandlers(onKeyDown, this.inputHandleKeyDown),\n onBlur: callAllEventHandlers(onBlur, this.inputHandleBlur),\n }\n }\n\n /* istanbul ignore if (react-native) */\n if (isReactNative) {\n eventHandlers = {\n onChange: callAllEventHandlers(\n onChange,\n onInput,\n this.inputHandleChange,\n ),\n onChangeText: callAllEventHandlers(\n onChangeText,\n onInput,\n text => this.inputHandleChange({nativeEvent: {text}}),\n this.inputHandleTextChange,\n ),\n onBlur: callAllEventHandlers(onBlur, this.inputHandleBlur),\n }\n }\n\n return {\n 'aria-autocomplete': 'list',\n 'aria-activedescendant':\n isOpen && typeof highlightedIndex === 'number' && highlightedIndex >= 0\n ? this.getItemId(highlightedIndex)\n : null,\n 'aria-controls': isOpen ? this.menuId : null,\n 'aria-labelledby': this.labelId,\n // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion\n // revert back since autocomplete=\"nope\" is ignored on latest Chrome and Opera\n autoComplete: 'off',\n value: inputValue,\n id: this.inputId,\n ...eventHandlers,\n ...rest,\n }\n }\n\n inputHandleKeyDown = event => {\n const key = normalizeArrowKey(event)\n if (key && this.inputKeyDownHandlers[key]) {\n this.inputKeyDownHandlers[key].call(this, event)\n }\n }\n\n inputHandleChange = event => {\n this.internalSetState({\n type: stateChangeTypes.changeInput,\n isOpen: true,\n inputValue: isReactNative\n ? /* istanbul ignore next (react-native) */ event.nativeEvent.text\n : event.target.value,\n highlightedIndex: this.props.defaultHighlightedIndex,\n })\n }\n\n inputHandleBlur = () => {\n // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not the body element\n this.internalSetTimeout(() => {\n const downshiftButtonIsActive =\n this.props.environment.document &&\n !!this.props.environment.document.activeElement &&\n !!this.props.environment.document.activeElement.dataset &&\n this.props.environment.document.activeElement.dataset.toggle &&\n (this._rootNode &&\n this._rootNode.contains(\n this.props.environment.document.activeElement,\n ))\n if (!this.isMouseDown && !downshiftButtonIsActive) {\n this.reset({type: stateChangeTypes.blurInput})\n }\n })\n }\n\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ INPUT\n\n /////////////////////////////// MENU\n\n menuRef = node => {\n this._menuNode = node\n }\n\n getMenuProps = (\n {refKey = 'ref', ref, ...props} = {},\n {suppressRefError = false} = {},\n ) => {\n this.getMenuProps.called = true\n this.getMenuProps.refKey = refKey\n this.getMenuProps.suppressRefError = suppressRefError\n\n return {\n [refKey]: callAll(ref, this.menuRef),\n role: 'listbox',\n 'aria-labelledby': props && props['aria-label'] ? null : this.labelId,\n id: this.menuId,\n ...props,\n }\n }\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ MENU\n\n /////////////////////////////// ITEM\n getItemProps = ({\n onMouseMove,\n onMouseDown,\n onClick,\n onPress,\n index,\n item = process.env.NODE_ENV === 'production'\n ? /* istanbul ignore next */ undefined\n : requiredProp('getItemProps', 'item'),\n ...rest\n } = {}) => {\n if (index === undefined) {\n this.items.push(item)\n index = this.items.indexOf(item)\n } else {\n this.items[index] = item\n }\n\n const onSelectKey = isReactNative\n ? /* istanbul ignore next (react-native) */ 'onPress'\n : 'onClick'\n const customClickHandler = isReactNative\n ? /* istanbul ignore next (react-native) */ onPress\n : onClick\n\n const enabledEventHandlers = {\n // onMouseMove is used over onMouseEnter here. onMouseMove\n // is only triggered on actual mouse movement while onMouseEnter\n // can fire on DOM changes, interrupting keyboard navigation\n onMouseMove: callAllEventHandlers(onMouseMove, () => {\n if (index === this.getState().highlightedIndex) {\n return\n }\n this.setHighlightedIndex(index, {\n type: stateChangeTypes.itemMouseEnter,\n })\n\n // We never want to manually scroll when changing state based\n // on `onMouseMove` because we will be moving the element out\n // from under the user which is currently scrolling/moving the\n // cursor\n this.avoidScrolling = true\n this.internalSetTimeout(() => (this.avoidScrolling = false), 250)\n }),\n onMouseDown: callAllEventHandlers(onMouseDown, event => {\n // This prevents the activeElement from being changed\n // to the item so it can remain with the current activeElement\n // which is a more common use case.\n event.preventDefault()\n }),\n [onSelectKey]: callAllEventHandlers(customClickHandler, () => {\n this.selectItemAtIndex(index, {\n type: stateChangeTypes.clickItem,\n })\n }),\n }\n\n // Passing down the onMouseDown handler to prevent redirect\n // of the activeElement if clicking on disabled items\n const eventHandlers = rest.disabled\n ? {onMouseDown: enabledEventHandlers.onMouseDown}\n : enabledEventHandlers\n\n return {\n id: this.getItemId(index),\n role: 'option',\n 'aria-selected': this.getState().highlightedIndex === index,\n ...eventHandlers,\n ...rest,\n }\n }\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ITEM\n\n clearItems = () => {\n this.items = []\n }\n\n reset = (otherStateToSet = {}, cb) => {\n otherStateToSet = pickState(otherStateToSet)\n this.internalSetState(\n ({selectedItem}) => ({\n isOpen: this.props.defaultIsOpen,\n highlightedIndex: this.props.defaultHighlightedIndex,\n inputValue: this.props.itemToString(selectedItem),\n ...otherStateToSet,\n }),\n cb,\n )\n }\n\n toggleMenu = (otherStateToSet = {}, cb) => {\n otherStateToSet = pickState(otherStateToSet)\n this.internalSetState(\n ({isOpen}) => {\n return {\n isOpen: !isOpen,\n ...(isOpen && {\n highlightedIndex: this.props.defaultHighlightedIndex,\n }),\n ...otherStateToSet,\n }\n },\n () => {\n const {isOpen, highlightedIndex} = this.getState()\n if (isOpen) {\n if (this.getItemCount() > 0 && typeof highlightedIndex === 'number') {\n this.setHighlightedIndex(highlightedIndex, otherStateToSet)\n }\n }\n cbToCb(cb)()\n },\n )\n }\n\n openMenu = cb => {\n this.internalSetState({isOpen: true}, cb)\n }\n\n closeMenu = cb => {\n this.internalSetState({isOpen: false}, cb)\n }\n\n updateStatus = debounce(() => {\n const state = this.getState()\n const item = this.items[state.highlightedIndex]\n const resultCount = this.getItemCount()\n const status = this.props.getA11yStatusMessage({\n itemToString: this.props.itemToString,\n previousResultCount: this.previousResultCount,\n resultCount,\n highlightedItem: item,\n ...state,\n })\n this.previousResultCount = resultCount\n\n setA11yStatus(status, this.props.environment.document)\n }, 200)\n\n componentDidMount() {\n /* istanbul ignore if (react-native) */\n if (\n process.env.NODE_ENV !== 'production' &&\n !isReactNative &&\n this.getMenuProps.called &&\n !this.getMenuProps.suppressRefError\n ) {\n validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps)\n }\n\n /* istanbul ignore if (react-native) */\n if (isReactNative) {\n this.cleanup = () => {\n this.internalClearTimeouts()\n }\n } else {\n const targetWithinDownshift = (target, checkActiveElement = true) => {\n const {document} = this.props.environment\n return [this._rootNode, this._menuNode].some(\n contextNode =>\n contextNode &&\n (isOrContainsNode(contextNode, target) ||\n (checkActiveElement &&\n isOrContainsNode(contextNode, document.activeElement))),\n )\n }\n // this.isMouseDown helps us track whether the mouse is currently held down.\n // This is useful when the user clicks on an item in the list, but holds the mouse\n // down long enough for the list to disappear (because the blur event fires on the input)\n // this.isMouseDown is used in the blur handler on the input to determine whether the blur event should\n // trigger hiding the menu.\n const onMouseDown = () => {\n this.isMouseDown = true\n }\n const onMouseUp = event => {\n this.isMouseDown = false\n // if the target element or the activeElement is within a downshift node\n // then we don't want to reset downshift\n const contextWithinDownshift = targetWithinDownshift(event.target)\n if (!contextWithinDownshift && this.getState().isOpen) {\n this.reset({type: stateChangeTypes.mouseUp}, () =>\n this.props.onOuterClick(this.getStateAndHelpers()),\n )\n }\n }\n // Touching an element in iOS gives focus and hover states, but touching out of\n // the element will remove hover, and persist the focus state, resulting in the\n // blur event not being triggered.\n // this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen.\n // If the user taps outside of Downshift, the component should be reset,\n // but not if the user is swiping\n const onTouchStart = () => {\n this.isTouchMove = false\n }\n\n const onTouchMove = () => {\n this.isTouchMove = true\n }\n\n const onTouchEnd = event => {\n const contextWithinDownshift = targetWithinDownshift(\n event.target,\n false,\n )\n if (\n !this.isTouchMove &&\n !contextWithinDownshift &&\n this.getState().isOpen\n ) {\n this.reset({type: stateChangeTypes.touchEnd}, () =>\n this.props.onOuterClick(this.getStateAndHelpers()),\n )\n }\n }\n const {environment} = this.props\n\n environment.addEventListener('mousedown', onMouseDown)\n environment.addEventListener('mouseup', onMouseUp)\n environment.addEventListener('touchstart', onTouchStart)\n environment.addEventListener('touchmove', onTouchMove)\n environment.addEventListener('touchend', onTouchEnd)\n\n this.cleanup = () => {\n this.internalClearTimeouts()\n this.updateStatus.cancel()\n environment.removeEventListener('mousedown', onMouseDown)\n environment.removeEventListener('mouseup', onMouseUp)\n environment.removeEventListener('touchstart', onTouchStart)\n environment.removeEventListener('touchmove', onTouchMove)\n environment.removeEventListener('touchend', onTouchEnd)\n }\n }\n }\n\n shouldScroll(prevState, prevProps) {\n const {highlightedIndex: currentHighlightedIndex} =\n this.props.highlightedIndex === undefined ? this.getState() : this.props\n const {highlightedIndex: prevHighlightedIndex} =\n prevProps.highlightedIndex === undefined ? prevState : prevProps\n const scrollWhenOpen =\n currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen\n const scrollWhenNavigating =\n currentHighlightedIndex !== prevHighlightedIndex\n\n return scrollWhenOpen || scrollWhenNavigating\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== 'production') {\n validateControlledUnchanged(prevProps, this.props)\n /* istanbul ignore if (react-native) */\n if (\n !isReactNative &&\n this.getMenuProps.called &&\n !this.getMenuProps.suppressRefError\n ) {\n validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps)\n }\n }\n\n if (\n this.isControlledProp('selectedItem') &&\n this.props.selectedItemChanged(\n prevProps.selectedItem,\n this.props.selectedItem,\n )\n ) {\n this.internalSetState({\n type: stateChangeTypes.controlledPropUpdatedSelectedItem,\n inputValue: this.props.itemToString(this.props.selectedItem),\n })\n }\n\n if (!this.avoidScrolling && this.shouldScroll(prevState, prevProps)) {\n this.scrollHighlightedItemIntoView()\n }\n\n /* istanbul ignore else (react-native) */\n if (!isReactNative) {\n this.updateStatus()\n }\n }\n\n componentWillUnmount() {\n this.cleanup() // avoids memory leak\n }\n\n render() {\n const children = unwrapArray(this.props.children, noop)\n // because the items are rerendered every time we call the children\n // we clear this out each render and it will be populated again as\n // getItemProps is called.\n this.clearItems()\n // we reset this so we know whether the user calls getRootProps during\n // this render. If they do then we don't need to do anything,\n // if they don't then we need to clone the element they return and\n // apply the props for them.\n this.getRootProps.called = false\n this.getRootProps.refKey = undefined\n this.getRootProps.suppressRefError = undefined\n // we do something similar for getMenuProps\n this.getMenuProps.called = false\n this.getMenuProps.refKey = undefined\n this.getMenuProps.suppressRefError = undefined\n // we do something similar for getLabelProps\n this.getLabelProps.called = false\n // and something similar for getInputProps\n this.getInputProps.called = false\n const element = unwrapArray(children(this.getStateAndHelpers()))\n if (!element) {\n return null\n }\n\n if (this.getRootProps.called || this.props.suppressRefError) {\n if (\n process.env.NODE_ENV !== 'production' &&\n !this.getRootProps.suppressRefError &&\n !this.props.suppressRefError\n ) {\n validateGetRootPropsCalledCorrectly(element, this.getRootProps)\n }\n return element\n } else if (isDOMElement(element)) {\n // they didn't apply the root props, but we can clone\n // this and apply the props ourselves\n return React.cloneElement(\n element,\n this.getRootProps(getElementProps(element)),\n )\n }\n\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== 'production') {\n // they didn't apply the root props, but they need to\n // otherwise we can't query around the autocomplete\n\n throw new Error(\n 'downshift: If you return a non-DOM element, you must use apply the getRootProps function',\n )\n }\n\n /* istanbul ignore next */\n return undefined\n }\n}\n\nexport default Downshift\n\nfunction validateGetMenuPropsCalledCorrectly(node, {refKey}) {\n if (!node) {\n // eslint-disable-next-line no-console\n console.error(\n `downshift: The ref prop \"${refKey}\" from getMenuProps was not applied correctly on your menu element.`,\n )\n }\n}\n\nfunction validateGetRootPropsCalledCorrectly(element, {refKey}) {\n const refKeySpecified = refKey !== 'ref'\n const isComposite = !isDOMElement(element)\n if (isComposite && !refKeySpecified && !isForwardRef(element)) {\n // eslint-disable-next-line no-console\n console.error(\n 'downshift: You returned a non-DOM element. You must specify a refKey in getRootProps',\n )\n } else if (!isComposite && refKeySpecified) {\n // eslint-disable-next-line no-console\n console.error(\n `downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified \"${refKey}\"`,\n )\n }\n if (!isForwardRef(element) && !getElementProps(element)[refKey]) {\n // eslint-disable-next-line no-console\n console.error(\n `downshift: You must apply the ref prop \"${refKey}\" from getRootProps onto your root element.`,\n )\n }\n}\n\nfunction validateControlledUnchanged(prevProps, nextProps) {\n const warningDescription = `This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props`\n ;['selectedItem', 'isOpen', 'inputValue', 'highlightedIndex'].forEach(\n propKey => {\n if (\n prevProps[propKey] !== undefined &&\n nextProps[propKey] === undefined\n ) {\n // eslint-disable-next-line no-console\n console.error(\n `downshift: A component has changed the controlled prop \"${propKey}\" to be uncontrolled. ${warningDescription}`,\n )\n } else if (\n prevProps[propKey] === undefined &&\n nextProps[propKey] !== undefined\n ) {\n // eslint-disable-next-line no-console\n console.error(\n `downshift: A component has changed the uncontrolled prop \"${propKey}\" to be controlled. ${warningDescription}`,\n )\n }\n },\n )\n}\n","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","'use strict'\n\nvar isObject = function isObject(val) {\n return val !== null && !Array.isArray(val) && typeof val === 'object'\n}\n\nvar codes = {\n // ----------------------------------------\n // By Code\n // ----------------------------------------\n 3: 'Cancel',\n 6: 'Help',\n 8: 'Backspace',\n 9: 'Tab',\n 12: 'Clear',\n 13: 'Enter',\n 16: 'Shift',\n 17: 'Control',\n 18: 'Alt',\n 19: 'Pause',\n 20: 'CapsLock',\n 27: 'Escape',\n 28: 'Convert',\n 29: 'NonConvert',\n 30: 'Accept',\n 31: 'ModeChange',\n 32: ' ',\n 33: 'PageUp',\n 34: 'PageDown',\n 35: 'End',\n 36: 'Home',\n 37: 'ArrowLeft',\n 38: 'ArrowUp',\n 39: 'ArrowRight',\n 40: 'ArrowDown',\n 41: 'Select',\n 42: 'Print',\n 43: 'Execute',\n 44: 'PrintScreen',\n 45: 'Insert',\n 46: 'Delete',\n 48: ['0', ')'],\n 49: ['1', '!'],\n 50: ['2', '@'],\n 51: ['3', '#'],\n 52: ['4', '$'],\n 53: ['5', '%'],\n 54: ['6', '^'],\n 55: ['7', '&'],\n 56: ['8', '*'],\n 57: ['9', '('],\n 91: 'OS',\n 93: 'ContextMenu',\n 144: 'NumLock',\n 145: 'ScrollLock',\n 181: 'VolumeMute',\n 182: 'VolumeDown',\n 183: 'VolumeUp',\n 186: [';', ':'],\n 187: ['=', '+'],\n 188: [',', '<'],\n 189: ['-', '_'],\n 190: ['.', '>'],\n 191: ['/', '?'],\n 192: ['`', '~'],\n 219: ['[', '{'],\n 220: ['\\\\', '|'],\n 221: [']', '}'],\n 222: [\"'\", '\"'],\n 224: 'Meta',\n 225: 'AltGraph',\n 246: 'Attn',\n 247: 'CrSel',\n 248: 'ExSel',\n 249: 'EraseEof',\n 250: 'Play',\n 251: 'ZoomOut',\n}\n\n// Function Keys (F1-24)\nfor (var i = 0; i < 24; i += 1) {\n codes[112 + i] = 'F' + (i + 1)\n}\n\n// Alphabet (a-Z)\nfor (var j = 0; j < 26; j += 1) {\n var n = j + 65\n codes[n] = [String.fromCharCode(n + 32), String.fromCharCode(n)]\n}\n\nvar keyboardKey = {\n codes: codes,\n\n /**\n * Get the `keyCode` or `which` value from a keyboard event or `key` name.\n * @param {string|object} eventOrKey A keyboard event-like object or `key` name.\n * @param {string} [eventOrKey.key] If object, it must have one of these keys.\n * @param {string} [eventOrKey.keyCode] If object, it must have one of these keys.\n * @param {string} [eventOrKey.which] If object, it must have one of these keys.\n * @returns {*}\n */\n getCode: function getCode(eventOrKey) {\n if (isObject(eventOrKey)) {\n return eventOrKey.keyCode || eventOrKey.which || this[eventOrKey.key]\n }\n return this[eventOrKey]\n },\n\n /**\n * Get the key name from a keyboard event, `keyCode`, or `which` value.\n * @param {number|object} eventOrCode A keyboard event-like object or key code.\n * @param {number} [eventOrCode.key] If object with a `key` name, it will be returned.\n * @param {number} [eventOrCode.keyCode] If object, it must have one of these keys.\n * @param {number} [eventOrCode.which] If object, it must have one of these keys.\n * @param {number} [eventOrCode.shiftKey] If object, it must have one of these keys.\n * @returns {*}\n */\n getKey: function getKey(eventOrCode) {\n var isEvent = isObject(eventOrCode)\n\n // handle events with a `key` already defined\n if (isEvent && eventOrCode.key) {\n return eventOrCode.key\n }\n\n var name = codes[isEvent ? eventOrCode.keyCode || eventOrCode.which : eventOrCode]\n\n if (Array.isArray(name)) {\n if (isEvent) {\n name = name[eventOrCode.shiftKey ? 1 : 0]\n } else {\n name = name[0]\n }\n }\n\n return name\n },\n\n // ----------------------------------------\n // By Name\n // ----------------------------------------\n // declare these manually for static analysis\n Cancel: 3,\n Help: 6,\n Backspace: 8,\n Tab: 9,\n Clear: 12,\n Enter: 13,\n Shift: 16,\n Control: 17,\n Alt: 18,\n Pause: 19,\n CapsLock: 20,\n Escape: 27,\n Convert: 28,\n NonConvert: 29,\n Accept: 30,\n ModeChange: 31,\n ' ': 32,\n PageUp: 33,\n PageDown: 34,\n End: 35,\n Home: 36,\n ArrowLeft: 37,\n ArrowUp: 38,\n ArrowRight: 39,\n ArrowDown: 40,\n Select: 41,\n Print: 42,\n Execute: 43,\n PrintScreen: 44,\n Insert: 45,\n Delete: 46,\n 0: 48,\n ')': 48,\n 1: 49,\n '!': 49,\n 2: 50,\n '@': 50,\n 3: 51,\n '#': 51,\n 4: 52,\n $: 52,\n 5: 53,\n '%': 53,\n 6: 54,\n '^': 54,\n 7: 55,\n '&': 55,\n 8: 56,\n '*': 56,\n 9: 57,\n '(': 57,\n a: 65,\n A: 65,\n b: 66,\n B: 66,\n c: 67,\n C: 67,\n d: 68,\n D: 68,\n e: 69,\n E: 69,\n f: 70,\n F: 70,\n g: 71,\n G: 71,\n h: 72,\n H: 72,\n i: 73,\n I: 73,\n j: 74,\n J: 74,\n k: 75,\n K: 75,\n l: 76,\n L: 76,\n m: 77,\n M: 77,\n n: 78,\n N: 78,\n o: 79,\n O: 79,\n p: 80,\n P: 80,\n q: 81,\n Q: 81,\n r: 82,\n R: 82,\n s: 83,\n S: 83,\n t: 84,\n T: 84,\n u: 85,\n U: 85,\n v: 86,\n V: 86,\n w: 87,\n W: 87,\n x: 88,\n X: 88,\n y: 89,\n Y: 89,\n z: 90,\n Z: 90,\n OS: 91,\n ContextMenu: 93,\n F1: 112,\n F2: 113,\n F3: 114,\n F4: 115,\n F5: 116,\n F6: 117,\n F7: 118,\n F8: 119,\n F9: 120,\n F10: 121,\n F11: 122,\n F12: 123,\n F13: 124,\n F14: 125,\n F15: 126,\n F16: 127,\n F17: 128,\n F18: 129,\n F19: 130,\n F20: 131,\n F21: 132,\n F22: 133,\n F23: 134,\n F24: 135,\n NumLock: 144,\n ScrollLock: 145,\n VolumeMute: 181,\n VolumeDown: 182,\n VolumeUp: 183,\n ';': 186,\n ':': 186,\n '=': 187,\n '+': 187,\n ',': 188,\n '<': 188,\n '-': 189,\n _: 189,\n '.': 190,\n '>': 190,\n '/': 191,\n '?': 191,\n '`': 192,\n '~': 192,\n '[': 219,\n '{': 219,\n '\\\\': 220,\n '|': 220,\n ']': 221,\n '}': 221,\n \"'\": 222,\n '\"': 222,\n Meta: 224,\n AltGraph: 225,\n Attn: 246,\n CrSel: 247,\n ExSel: 248,\n EraseEof: 249,\n Play: 250,\n ZoomOut: 251,\n}\n\n// ----------------------------------------\n// By Alias\n// ----------------------------------------\n// provide dot-notation accessible keys for all key names\nkeyboardKey.Spacebar = keyboardKey[' ']\nkeyboardKey.Digit0 = keyboardKey['0']\nkeyboardKey.Digit1 = keyboardKey['1']\nkeyboardKey.Digit2 = keyboardKey['2']\nkeyboardKey.Digit3 = keyboardKey['3']\nkeyboardKey.Digit4 = keyboardKey['4']\nkeyboardKey.Digit5 = keyboardKey['5']\nkeyboardKey.Digit6 = keyboardKey['6']\nkeyboardKey.Digit7 = keyboardKey['7']\nkeyboardKey.Digit8 = keyboardKey['8']\nkeyboardKey.Digit9 = keyboardKey['9']\nkeyboardKey.Tilde = keyboardKey['~']\nkeyboardKey.GraveAccent = keyboardKey['`']\nkeyboardKey.ExclamationPoint = keyboardKey['!']\nkeyboardKey.AtSign = keyboardKey['@']\nkeyboardKey.PoundSign = keyboardKey['#']\nkeyboardKey.PercentSign = keyboardKey['%']\nkeyboardKey.Caret = keyboardKey['^']\nkeyboardKey.Ampersand = keyboardKey['&']\nkeyboardKey.PlusSign = keyboardKey['+']\nkeyboardKey.MinusSign = keyboardKey['-']\nkeyboardKey.EqualsSign = keyboardKey['=']\nkeyboardKey.DivisionSign = keyboardKey['/']\nkeyboardKey.MultiplicationSign = keyboardKey['*']\nkeyboardKey.Comma = keyboardKey[',']\nkeyboardKey.Decimal = keyboardKey['.']\nkeyboardKey.Colon = keyboardKey[':']\nkeyboardKey.Semicolon = keyboardKey[';']\nkeyboardKey.Pipe = keyboardKey['|']\nkeyboardKey.BackSlash = keyboardKey['\\\\']\nkeyboardKey.QuestionMark = keyboardKey['?']\nkeyboardKey.SingleQuote = keyboardKey[\"'\"]\nkeyboardKey.DoubleQuote = keyboardKey['\"']\nkeyboardKey.LeftCurlyBrace = keyboardKey['{']\nkeyboardKey.RightCurlyBrace = keyboardKey['}']\nkeyboardKey.LeftParenthesis = keyboardKey['(']\nkeyboardKey.RightParenthesis = keyboardKey[')']\nkeyboardKey.LeftAngleBracket = keyboardKey['<']\nkeyboardKey.RightAngleBracket = keyboardKey['>']\nkeyboardKey.LeftSquareBracket = keyboardKey['[']\nkeyboardKey.RightSquareBracket = keyboardKey[']']\n\nmodule.exports = keyboardKey\n","import { useState, useEffect } from \"react\";\n\n// Could use UUID but if we hit 9,007,199,254,740,991 unique components over\n// the lifetime of the app before it gets reloaded, I mean ... come on.\n// I don't even know what xillion that is.\n// /me googles\n// Oh duh, quadrillion. Nine quadrillion components. I think we're okay.\nvar id = 0;\nvar genId = function genId() {\n return ++id;\n};\n\nexport var useId = function useId() {\n var _useState = useState(null),\n id = _useState[0],\n setId = _useState[1];\n\n useEffect(function () {\n return setId(genId());\n }, []);\n return id;\n};","import PropTypes from 'prop-types'\n\nfunction getElementIds(\n generateDefaultId,\n {id, labelId, menuId, getItemId, toggleButtonId} = {},\n) {\n const uniqueId = id === undefined ? `downshift-${generateDefaultId()}` : id\n\n return {\n labelId: labelId || `${uniqueId}-label`,\n menuId: menuId || `${uniqueId}-menu`,\n getItemId: getItemId || (index => `${uniqueId}-item-${index}`),\n toggleButtonId: toggleButtonId || `${uniqueId}-toggle-button`,\n }\n}\n\nfunction getNextWrappingIndex(moveAmount, baseIndex, itemsLength, circular) {\n if (baseIndex === -1) {\n return moveAmount > 0 ? 0 : itemsLength - 1\n }\n const nextIndex = baseIndex + moveAmount\n\n if (nextIndex < 0) {\n return circular ? itemsLength - 1 : 0\n }\n if (nextIndex >= itemsLength) {\n return circular ? 0 : itemsLength - 1\n }\n\n return nextIndex\n}\n\nfunction getItemIndexByCharacterKey(\n keysSoFar,\n highlightedIndex,\n items,\n itemToStringParam,\n) {\n let newHighlightedIndex = -1\n const itemStrings = items.map(item => itemToStringParam(item).toLowerCase())\n const startPosition = highlightedIndex + 1\n\n newHighlightedIndex = itemStrings\n .slice(startPosition)\n .findIndex(itemString => itemString.startsWith(keysSoFar))\n\n if (newHighlightedIndex > -1) {\n return newHighlightedIndex + startPosition\n } else {\n return itemStrings\n .slice(0, startPosition)\n .findIndex(itemString => itemString.startsWith(keysSoFar))\n }\n}\n\nfunction getState(state, props) {\n return Object.keys(state).reduce((prevState, key) => {\n // eslint-disable-next-line no-param-reassign\n prevState[key] = props[key] === undefined ? state[key] : props[key]\n return prevState\n }, {})\n}\n\nfunction getItemIndex(index, item, items) {\n if (index !== undefined) {\n return index\n }\n if (items.length === 0) {\n return -1\n }\n return items.indexOf(item)\n}\n\nfunction itemToString(item) {\n return item ? String(item) : ''\n}\n\nfunction getPropTypesValidator(caller, propTypes) {\n // istanbul ignore next\n return function validate(options = {}) {\n Object.entries(propTypes).forEach(([key]) => {\n PropTypes.checkPropTypes(propTypes, options, key, caller.name)\n })\n }\n}\n\nfunction isAcceptedCharacterKey(key) {\n return /^\\S{1}$/.test(key)\n}\n\nexport {\n getElementIds,\n getNextWrappingIndex,\n getItemIndexByCharacterKey,\n getState,\n getItemIndex,\n getPropTypesValidator,\n itemToString,\n isAcceptedCharacterKey,\n}\n","import PropTypes from 'prop-types'\nimport {getNextWrappingIndex} from '../utils'\n\nconst defaultStateValues = {\n highlightedIndex: -1,\n isOpen: false,\n selectedItem: null,\n}\n\nfunction getA11yStatusMessage({isOpen, items}) {\n if (!items) {\n return ''\n }\n const resultCount = items.length\n if (isOpen) {\n if (resultCount === 0) {\n return 'No results are available'\n }\n return `${resultCount} result${\n resultCount === 1 ? ' is' : 's are'\n } available, use up and down arrow keys to navigate. Press Enter key to select.`\n }\n return ''\n}\n\nfunction getA11ySelectionMessage({selectedItem, itemToString}) {\n return `${itemToString(selectedItem)} has been selected.`\n}\n\nfunction getHighlightedIndexOnOpen(props, state, offset) {\n const {items, initialHighlightedIndex, defaultHighlightedIndex} = props\n const {selectedItem, highlightedIndex} = state\n\n // initialHighlightedIndex will give value to highlightedIndex on initial state only.\n if (initialHighlightedIndex !== undefined && highlightedIndex > -1) {\n return initialHighlightedIndex\n }\n if (defaultHighlightedIndex !== undefined) {\n return defaultHighlightedIndex\n }\n if (selectedItem) {\n if (offset === 0) {\n return items.indexOf(selectedItem)\n }\n return getNextWrappingIndex(\n offset,\n items.indexOf(selectedItem),\n items.length,\n false,\n )\n }\n if (offset === 0) {\n return -1\n }\n return offset < 0 ? items.length - 1 : 0\n}\n\nfunction capitalizeString(string) {\n return `${string.slice(0, 1).toUpperCase()}${string.slice(1)}`\n}\n\nfunction getDefaultValue(props, propKey) {\n const defaultPropKey = `default${capitalizeString(propKey)}`\n if (props[defaultPropKey] !== undefined) {\n return props[defaultPropKey]\n }\n return defaultStateValues[propKey]\n}\n\nfunction getInitialValue(props, propKey) {\n if (props[propKey] !== undefined) {\n return props[propKey]\n }\n const initialPropKey = `initial${capitalizeString(propKey)}`\n if (props[initialPropKey] !== undefined) {\n return props[initialPropKey]\n }\n return getDefaultValue(props, propKey)\n}\n\nfunction getInitialState(props) {\n return {\n highlightedIndex: getInitialValue(props, 'highlightedIndex'),\n isOpen: getInitialValue(props, 'isOpen'),\n selectedItem: getInitialValue(props, 'selectedItem'),\n keysSoFar: '',\n }\n}\n\nfunction invokeOnChangeHandler(propKey, props, state, changes) {\n const handler = `on${capitalizeString(propKey)}Change`\n if (\n props[handler] &&\n changes[propKey] !== undefined &&\n changes[propKey] !== state[propKey]\n ) {\n props[handler](changes)\n }\n}\n\nfunction callOnChangeProps(props, state, changes) {\n ;['isOpen', 'highlightedIndex', 'selectedItem'].forEach(propKey => {\n invokeOnChangeHandler(propKey, props, state, changes)\n })\n\n if (props.onStateChange && changes !== undefined) {\n props.onStateChange(changes)\n }\n}\n\nconst propTypes = {\n items: PropTypes.array.isRequired,\n itemToString: PropTypes.func,\n getA11yStatusMessage: PropTypes.func,\n getA11ySelectionMessage: PropTypes.func,\n circularNavigation: PropTypes.bool,\n highlightedIndex: PropTypes.number,\n defaultHighlightedIndex: PropTypes.number,\n initialHighlightedIndex: PropTypes.number,\n isOpen: PropTypes.bool,\n defaultIsOpen: PropTypes.bool,\n initialIsOpen: PropTypes.bool,\n selectedItem: PropTypes.any,\n initialSelectedItem: PropTypes.any,\n defaultSelectedItem: PropTypes.any,\n id: PropTypes.string,\n labelId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func,\n toggleButtonId: PropTypes.string,\n stateReducer: PropTypes.func,\n onSelectedItemChange: PropTypes.func,\n onHighlightedIndexChange: PropTypes.func,\n onStateChange: PropTypes.func,\n onIsOpenChange: PropTypes.func,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func,\n removeEventListener: PropTypes.func,\n document: PropTypes.shape({\n getElementById: PropTypes.func,\n activeElement: PropTypes.any,\n body: PropTypes.any,\n }),\n }),\n}\n\nexport {\n getHighlightedIndexOnOpen,\n getA11yStatusMessage,\n getA11ySelectionMessage,\n getInitialState,\n defaultStateValues,\n propTypes,\n getDefaultValue,\n callOnChangeProps,\n}\n","import productionEnum from '../../productionEnum.macro'\n\nexport const MenuKeyDownArrowDown = productionEnum(\n '__menu_keydown_arrow_down__',\n)\nexport const MenuKeyDownArrowUp = productionEnum('__menu_keydown_arrow_up__')\nexport const MenuKeyDownEscape = productionEnum('__menu_keydown_escape__')\nexport const MenuKeyDownHome = productionEnum('__menu_keydown_home__')\nexport const MenuKeyDownEnd = productionEnum('__menu_keydown_end__')\nexport const MenuKeyDownEnter = productionEnum('__menu_keydown_enter__')\nexport const MenuKeyDownCharacter = productionEnum('__menu_keydown_character__')\nexport const MenuBlur = productionEnum('__menu_blur__')\nexport const ItemMouseMove = productionEnum('__item_mouse_move__')\nexport const ItemClick = productionEnum('__item_click__')\nexport const ToggleButtonKeyDownCharacter = productionEnum(\n '__togglebutton_keydown_character__',\n)\nexport const ToggleButtonKeyDownArrowDown = productionEnum(\n '__togglebutton_keydown_arrow_down__',\n)\nexport const ToggleButtonKeyDownArrowUp = productionEnum(\n '__togglebutton_keydown_arrow_up__',\n)\nexport const ToggleButtonClick = productionEnum('__togglebutton_click__')\nexport const FunctionToggleMenu = productionEnum('__function_toggle_menu__')\nexport const FunctionOpenMenu = productionEnum('__function_open_menu__')\nexport const FunctionCloseMenu = productionEnum('__function_close_menu__')\nexport const FunctionSetHighlightedIndex = productionEnum(\n '__function_set_highlighted_index__',\n)\nexport const FunctionSelectItem = productionEnum('__function_select_item__')\nexport const FunctionClearKeysSoFar = productionEnum(\n '__function_clear_keys_so_far__',\n)\nexport const FunctionReset = productionEnum('__function_reset__')\n","/* eslint-disable max-statements */\nimport {useReducer, useRef, useEffect} from 'react'\nimport keyboardKey from 'keyboard-key'\nimport {useId} from '@reach/auto-id'\nimport {\n getElementIds,\n getState,\n getItemIndex,\n getPropTypesValidator,\n itemToString as defaultItemToString,\n isAcceptedCharacterKey,\n} from '../utils'\nimport setStatus from '../../set-a11y-status'\nimport {\n callAllEventHandlers,\n callAll,\n debounce,\n scrollIntoView as defaultScrollIntoView,\n} from '../../utils'\nimport downshiftSelectReducer from './reducer'\nimport {\n getA11yStatusMessage as defaultGetA11yStatusMessage,\n getA11ySelectionMessage as defaultGetA11ySelectionMessage,\n getInitialState,\n propTypes,\n callOnChangeProps,\n} from './utils'\nimport * as stateChangeTypes from './stateChangeTypes'\n\nconst validatePropTypes = getPropTypesValidator(useSelect, propTypes)\nconst defaultProps = {\n itemToString: defaultItemToString,\n stateReducer: (s, a) => a.changes,\n getA11yStatusMessage: defaultGetA11yStatusMessage,\n getA11ySelectionMessage: defaultGetA11ySelectionMessage,\n scrollIntoView: defaultScrollIntoView,\n environment:\n typeof window === 'undefined' /* istanbul ignore next (ssr) */\n ? {}\n : window,\n}\n\nlet clearTimeout\n\nuseSelect.stateChangeTypes = stateChangeTypes\n\nfunction useSelect(userProps = {}) {\n validatePropTypes(userProps)\n // Props defaults and destructuring.\n const props = {\n ...defaultProps,\n ...userProps,\n }\n const {\n items,\n itemToString,\n getA11yStatusMessage,\n getA11ySelectionMessage,\n initialIsOpen,\n defaultIsOpen,\n stateReducer,\n scrollIntoView,\n environment,\n } = props\n // Initial state depending on controlled props.\n const initialState = getInitialState(props)\n\n // Reducer init.\n const [\n {isOpen, highlightedIndex, selectedItem, keysSoFar},\n dispatch,\n ] = useReducer((state, action) => {\n const changes = downshiftSelectReducer(state, action) // state after original reducer.\n const reducedState = stateReducer(state, {...action, changes}) // state after user reducer.\n\n callOnChangeProps(props, state, reducedState) // call onChange with state resulted.\n\n return getState(reducedState, props) // state is merged with controlled props.\n }, initialState)\n\n // IDs generation.\n const {labelId, getItemId, menuId, toggleButtonId} = getElementIds(\n useId,\n props,\n )\n\n /* Refs */\n const toggleButtonRef = useRef(null)\n const menuRef = useRef(null)\n const itemRefs = useRef()\n itemRefs.current = []\n const isInitialMount = useRef(true)\n const shouldScroll = useRef(true)\n\n /* Effects */\n /* Sets a11y status message on changes in isOpen. */\n useEffect(() => {\n if (isInitialMount.current) {\n return\n }\n setStatus(\n getA11yStatusMessage({\n isOpen,\n items,\n selectedItem,\n itemToString,\n }),\n )\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen])\n /* Sets a11y status message on changes in selectedItem. */\n useEffect(() => {\n if (isInitialMount.current) {\n return\n }\n setStatus(\n getA11ySelectionMessage({\n isOpen,\n items,\n selectedItem,\n itemToString,\n }),\n )\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedItem])\n /* Sets cleanup for the keysSoFar after 500ms. */\n useEffect(() => {\n // init the clean function here as we need access to dispatch.\n if (isInitialMount.current) {\n clearTimeout = debounce(() => {\n dispatch({\n type: stateChangeTypes.FunctionClearKeysSoFar,\n props,\n })\n }, 500)\n }\n if (!keysSoFar) {\n return\n }\n clearTimeout()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [keysSoFar])\n /* Controls the focus on the menu or the toggle button. */\n useEffect(() => {\n // Don't focus menu on first render.\n if (isInitialMount.current) {\n // Unless it was initialised as open.\n if (initialIsOpen || defaultIsOpen || isOpen) {\n menuRef.current.focus()\n }\n return\n }\n // Focus menu on open.\n // istanbul ignore next\n if (isOpen) {\n menuRef.current.focus()\n // Focus toggleButton on close.\n } else if (environment.document.activeElement === menuRef.current) {\n toggleButtonRef.current.focus()\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen])\n /* Scroll on highlighted item if change comes from keyboard. */\n useEffect(() => {\n if (highlightedIndex < 0 || !isOpen || !itemRefs.current.length) {\n return\n }\n if (shouldScroll.current === false) {\n shouldScroll.current = true\n } else {\n scrollIntoView(itemRefs.current[highlightedIndex], menuRef.current)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [highlightedIndex])\n /* Make initial ref false. */\n useEffect(() => {\n isInitialMount.current = false\n }, [])\n\n /* Event handler functions */\n const menuKeyDownHandlers = {\n ArrowDown(event) {\n event.preventDefault()\n dispatch({\n type: stateChangeTypes.MenuKeyDownArrowDown,\n props,\n shiftKey: event.shiftKey,\n })\n },\n ArrowUp(event) {\n event.preventDefault()\n dispatch({\n type: stateChangeTypes.MenuKeyDownArrowUp,\n props,\n shiftKey: event.shiftKey,\n })\n },\n Home(event) {\n event.preventDefault()\n dispatch({\n type: stateChangeTypes.MenuKeyDownHome,\n props,\n })\n },\n End(event) {\n event.preventDefault()\n dispatch({\n type: stateChangeTypes.MenuKeyDownEnd,\n props,\n })\n },\n Escape() {\n dispatch({\n type: stateChangeTypes.MenuKeyDownEscape,\n props,\n })\n },\n Enter() {\n dispatch({\n type: stateChangeTypes.MenuKeyDownEnter,\n props,\n })\n },\n Tab(event) {\n // The exception that calls MenuBlur.\n // istanbul ignore next\n if (event.shiftKey) {\n dispatch({\n type: stateChangeTypes.MenuBlur,\n props,\n })\n }\n },\n }\n const toggleButtonKeyDownHandlers = {\n ArrowDown(event) {\n event.preventDefault()\n dispatch({\n type: stateChangeTypes.ToggleButtonKeyDownArrowDown,\n props,\n })\n },\n ArrowUp(event) {\n event.preventDefault()\n dispatch({\n type: stateChangeTypes.ToggleButtonKeyDownArrowUp,\n props,\n })\n },\n }\n\n // Event handlers.\n const menuHandleKeyDown = event => {\n const key = keyboardKey.getKey(event)\n if (key && menuKeyDownHandlers[key]) {\n menuKeyDownHandlers[key](event)\n } else if (isAcceptedCharacterKey(key)) {\n dispatch({\n type: stateChangeTypes.MenuKeyDownCharacter,\n key,\n props,\n })\n }\n }\n // Focus going back to the toggleButton is something we control (Escape, Enter, Click).\n // We are toggleing special actions for these cases in reducer, not MenuBlur.\n // Since Shift-Tab also lands focus on toggleButton, we will handle it as exception and call MenuBlur.\n const menuHandleBlur = event => {\n if (event.relatedTarget !== toggleButtonRef.current) {\n dispatch({\n type: stateChangeTypes.MenuBlur,\n props,\n })\n }\n }\n const toggleButtonHandleClick = () => {\n dispatch({\n type: stateChangeTypes.ToggleButtonClick,\n props,\n })\n }\n const toggleButtonHandleKeyDown = event => {\n const key = keyboardKey.getKey(event)\n if (key && toggleButtonKeyDownHandlers[key]) {\n toggleButtonKeyDownHandlers[key](event)\n } else if (isAcceptedCharacterKey(key)) {\n dispatch({\n type: stateChangeTypes.ToggleButtonKeyDownCharacter,\n key,\n props,\n })\n }\n }\n const itemHandleMouseMove = index => {\n if (index === highlightedIndex) {\n return\n }\n shouldScroll.current = false\n dispatch({\n type: stateChangeTypes.ItemMouseMove,\n props,\n index,\n })\n }\n const itemHandleClick = index => {\n dispatch({\n type: stateChangeTypes.ItemClick,\n props,\n index,\n })\n }\n\n // returns\n const toggleMenu = () => {\n dispatch({\n type: stateChangeTypes.FunctionToggleMenu,\n props,\n })\n }\n const closeMenu = () => {\n dispatch({\n type: stateChangeTypes.FunctionCloseMenu,\n })\n }\n const openMenu = () => {\n dispatch({\n type: stateChangeTypes.FunctionOpenMenu,\n props,\n })\n }\n const setHighlightedIndex = newHighlightedIndex => {\n dispatch({\n type: stateChangeTypes.FunctionSetHighlightedIndex,\n highlightedIndex: newHighlightedIndex,\n })\n }\n const selectItem = newSelectedItem => {\n dispatch({\n type: stateChangeTypes.FunctionSelectItem,\n selectedItem: newSelectedItem,\n })\n }\n const reset = () => {\n dispatch({\n type: stateChangeTypes.FunctionReset,\n props,\n })\n }\n const getLabelProps = labelProps => ({\n id: labelId,\n ...labelProps,\n })\n const getMenuProps = ({\n onKeyDown,\n onBlur,\n refKey = 'ref',\n ref,\n ...rest\n } = {}) => ({\n [refKey]: callAll(ref, menuNode => {\n menuRef.current = menuNode\n }),\n id: menuId,\n role: 'listbox',\n 'aria-labelledby': labelId,\n tabIndex: -1,\n ...(highlightedIndex > -1 && {\n 'aria-activedescendant': getItemId(highlightedIndex),\n }),\n onKeyDown: callAllEventHandlers(onKeyDown, menuHandleKeyDown),\n onBlur: callAllEventHandlers(onBlur, menuHandleBlur),\n ...rest,\n })\n const getToggleButtonProps = ({\n onClick,\n onKeyDown,\n refKey = 'ref',\n ref,\n ...rest\n } = {}) => ({\n [refKey]: callAll(ref, toggleButtonNode => {\n toggleButtonRef.current = toggleButtonNode\n }),\n id: toggleButtonId,\n 'aria-haspopup': 'listbox',\n 'aria-expanded': isOpen,\n 'aria-labelledby': `${labelId} ${toggleButtonId}`,\n onClick: callAllEventHandlers(onClick, toggleButtonHandleClick),\n onKeyDown: callAllEventHandlers(onKeyDown, toggleButtonHandleKeyDown),\n ...rest,\n })\n const getItemProps = ({\n item,\n index,\n refKey = 'ref',\n ref,\n onMouseMove,\n onClick,\n ...rest\n } = {}) => {\n const itemIndex = getItemIndex(index, item, items)\n if (itemIndex < 0) {\n throw new Error('Pass either item or item index in getItemProps!')\n }\n return {\n [refKey]: callAll(ref, itemNode => {\n if (itemNode) {\n itemRefs.current.push(itemNode)\n }\n }),\n role: 'option',\n ...(itemIndex === highlightedIndex && {'aria-selected': true}),\n id: getItemId(itemIndex),\n onMouseMove: callAllEventHandlers(onMouseMove, () =>\n itemHandleMouseMove(itemIndex),\n ),\n onClick: callAllEventHandlers(onClick, () => itemHandleClick(itemIndex)),\n ...rest,\n }\n }\n\n return {\n // prop getters.\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n getItemProps,\n // actions.\n toggleMenu,\n openMenu,\n closeMenu,\n setHighlightedIndex,\n selectItem,\n reset,\n // state.\n highlightedIndex,\n isOpen,\n selectedItem,\n }\n}\n\nexport default useSelect\n","import {getNextWrappingIndex, getItemIndexByCharacterKey} from '../utils'\nimport {getHighlightedIndexOnOpen, getDefaultValue} from './utils'\nimport * as stateChangeTypes from './stateChangeTypes'\n\n/* eslint-disable complexity */\nexport default function downshiftSelectReducer(state, action) {\n const {type, props, shiftKey} = action\n let changes\n\n switch (type) {\n case stateChangeTypes.ItemMouseMove:\n changes = {\n highlightedIndex: action.index,\n }\n break\n case stateChangeTypes.ItemClick:\n changes = {\n isOpen: getDefaultValue(props, 'isOpen'),\n highlightedIndex: getDefaultValue(props, 'highlightedIndex'),\n selectedItem: props.items[action.index],\n }\n break\n case stateChangeTypes.MenuBlur:\n changes = {\n isOpen: false,\n highlightedIndex: -1,\n ...(state.highlightedIndex >= 0 && {\n selectedItem: props.items[state.highlightedIndex],\n }),\n }\n break\n case stateChangeTypes.MenuKeyDownArrowDown:\n changes = {\n highlightedIndex: getNextWrappingIndex(\n shiftKey ? 5 : 1,\n state.highlightedIndex,\n props.items.length,\n props.circularNavigation,\n ),\n }\n break\n case stateChangeTypes.MenuKeyDownArrowUp:\n changes = {\n highlightedIndex: getNextWrappingIndex(\n shiftKey ? -5 : -1,\n state.highlightedIndex,\n props.items.length,\n props.circularNavigation,\n ),\n }\n break\n case stateChangeTypes.MenuKeyDownHome:\n changes = {\n highlightedIndex: 0,\n }\n break\n case stateChangeTypes.MenuKeyDownEnd:\n changes = {\n highlightedIndex: props.items.length - 1,\n }\n break\n case stateChangeTypes.MenuKeyDownEscape:\n changes = {\n isOpen: false,\n highlightedIndex: -1,\n }\n break\n case stateChangeTypes.MenuKeyDownEnter:\n changes = {\n isOpen: getDefaultValue(props, 'isOpen'),\n highlightedIndex: getDefaultValue(props, 'highlightedIndex'),\n ...(state.highlightedIndex >= 0 && {\n selectedItem: props.items[state.highlightedIndex],\n }),\n }\n break\n case stateChangeTypes.MenuKeyDownCharacter:\n {\n const lowercasedKey = action.key\n const keysSoFar = `${state.keysSoFar}${lowercasedKey}`\n const highlightedIndex = getItemIndexByCharacterKey(\n keysSoFar,\n state.highlightedIndex,\n props.items,\n props.itemToString,\n )\n changes = {\n keysSoFar,\n ...(highlightedIndex >= 0 && {\n highlightedIndex,\n }),\n }\n }\n break\n case stateChangeTypes.ToggleButtonKeyDownCharacter:\n {\n const lowercasedKey = action.key\n const keysSoFar = `${state.keysSoFar}${lowercasedKey}`\n const itemIndex = getItemIndexByCharacterKey(\n keysSoFar,\n state.selectedItem ? props.items.indexOf(state.selectedItem) : -1,\n props.items,\n props.itemToString,\n )\n changes = {\n keysSoFar,\n ...(itemIndex >= 0 && {\n selectedItem: props.items[itemIndex],\n }),\n }\n }\n break\n case stateChangeTypes.ToggleButtonKeyDownArrowDown: {\n changes = {\n isOpen: true,\n highlightedIndex: getHighlightedIndexOnOpen(props, state, 1),\n }\n break\n }\n case stateChangeTypes.ToggleButtonKeyDownArrowUp:\n changes = {\n isOpen: true,\n highlightedIndex: getHighlightedIndexOnOpen(props, state, -1),\n }\n break\n case stateChangeTypes.ToggleButtonClick:\n case stateChangeTypes.FunctionToggleMenu:\n changes = {\n isOpen: !state.isOpen,\n highlightedIndex: state.isOpen\n ? -1\n : getHighlightedIndexOnOpen(props, state, 0),\n }\n break\n case stateChangeTypes.FunctionOpenMenu:\n changes = {\n isOpen: true,\n highlightedIndex: getHighlightedIndexOnOpen(props, state, 0),\n }\n break\n case stateChangeTypes.FunctionCloseMenu:\n changes = {\n isOpen: false,\n }\n break\n case stateChangeTypes.FunctionSetHighlightedIndex:\n changes = {\n highlightedIndex: action.highlightedIndex,\n }\n break\n case stateChangeTypes.FunctionSelectItem:\n changes = {\n selectedItem: action.selectedItem,\n }\n break\n case stateChangeTypes.FunctionClearKeysSoFar:\n changes = {\n keysSoFar: '',\n }\n break\n case stateChangeTypes.FunctionReset:\n changes = {\n highlightedIndex: getDefaultValue(props, 'highlightedIndex'),\n isOpen: getDefaultValue(props, 'isOpen'),\n selectedItem: getDefaultValue(props, 'selectedItem'),\n }\n break\n default:\n throw new Error('Reducer called without proper action type.')\n }\n\n return {\n ...state,\n ...changes,\n }\n}\n/* eslint-enable complexity */\n"],"names":["_objectWithoutPropertiesLoose","source","excluded","key","i","target","sourceKeys","Object","keys","length","indexOf","_extends","assign","arguments","prototype","hasOwnProperty","call","apply","this","_assertThisInitialized","self","ReferenceError","defineProperty","exports","value","b","Symbol","for","c","d","e","f","g","h","k","l","m","n","p","q","r","t","v","w","x","a","u","$$typeof","type","y","module","require$$0","getOwnPropertySymbols","propIsEnumerable","propertyIsEnumerable","toObject","val","TypeError","test1","String","getOwnPropertyNames","test2","fromCharCode","map","join","test3","split","forEach","letter","err","shouldUseNative","Function","bind","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","ReactPropTypesSecret","Error","name","getShim","isRequired","ReactPropTypes","array","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","require$$2","isElement","el","nodeType","canOverflow","overflow","skipOverflowHiddenElements","isScrollable","clientHeight","scrollHeight","clientWidth","scrollWidth","style","getComputedStyle","overflowY","overflowX","alignNearest","scrollingEdgeStart","scrollingEdgeEnd","scrollingSize","scrollingBorderStart","scrollingBorderEnd","elementEdgeStart","elementEdgeEnd","elementSize","options","scrollMode","block","inline","boundary","checkBoundary","scrollingElement","document","documentElement","frames","cursor","parentNode","push","body","viewportWidth","window","visualViewport","width","innerWidth","viewportHeight","height","innerHeight","viewportX","scrollX","pageXOffset","viewportY","scrollY","pageYOffset","_target$getBoundingCl","getBoundingClientRect","targetHeight","targetWidth","targetTop","top","targetRight","right","targetBottom","bottom","targetLeft","left","targetBlock","targetInline","computations","index","frame","_frame$getBoundingCli","_height","_width","_top","_left","frameStyle","borderLeft","parseInt","borderLeftWidth","borderTop","borderTopWidth","borderRight","borderRightWidth","borderBottom","borderBottomWidth","blockScroll","inlineScroll","scrollbarWidth","offsetWidth","scrollbarHeight","offsetHeight","Math","max","scrollLeft","scrollTop","min","idCounter","cbToCb","cb","noop","scrollIntoView","menuNode","computeScrollIntoView","isOrContainsNode","parent","child","contains","debounce","fn","time","timeoutId","cancel","clearTimeout","wrapper","args","setTimeout","callAllEventHandlers","fns","event","some","preventDownshiftDefault","nativeEvent","callAll","unwrapArray","arg","defaultValue","Array","isArray","statusDiv","stateKeys","pickState","state","result","normalizeArrowKey","keyCode","getNextWrappingIndex","moveAmount","baseIndex","itemCount","itemsLastIndex","newIndex","cleanupStatus","getStatusDiv","textContent","setStatus","status","documentProp","div","createElement","setAttribute","border","clip","margin","padding","position","appendChild","unknown","itemMouseEnter","keyDownArrowUp","keyDownArrowDown","keyDownEscape","keyDownEnter","keyDownHome","keyDownEnd","clickItem","blurInput","changeInput","keyDownSpaceButton","clickButton","blurButton","Downshift","subClass","superClass","_Component","id","_this","menuId","labelId","inputId","getItemId","input","items","previousResultCount","timeoutIds","internalSetTimeout","filter","setItemCount","count","unsetItemCount","setHighlightedIndex","highlightedIndex","otherStateToSet","defaultHighlightedIndex","internalSetState","clearSelection","selectedItem","inputValue","isOpen","defaultIsOpen","selectItem","item","itemToString","selectItemAtIndex","itemIndex","selectHighlightedItem","getState","stateToSet","isItemSelected","onChangeArg","onStateChangeArg","isStateToSetFunction","onInputValueChange","getStateAndHelpers","setState","newStateToSet","stateReducer","nextState","nextFullState","stateChangeTypes","isControlledProp","onStateChange","onSelect","undefined","onChange","onUserAction","rootRef","_rootNode","getRootProps","refKey","ref","rest","suppressRefError","called","role","keyDownHandlers","ArrowDown","preventDefault","amount","shiftKey","moveHighlightedIndex","_this2","getItemCount","ArrowUp","_this3","Enter","itemNode","getItemNodeFromIndex","hasAttribute","Escape","reset","buttonKeyDownHandlers","toggleMenu","inputKeyDownHandlers","Home","highlightFirstOrLastIndex","End","getToggleButtonProps","onClick","onKeyDown","onPress","onKeyUp","onBlur","enabledEventHandlers","buttonHandleClick","buttonHandleKeyDown","buttonHandleKeyUp","buttonHandleBlur","disabled","environment","activeElement","focus","blurTarget","isMouseDown","getLabelProps","htmlFor","getInputProps","onInput","onChangeText","eventHandlers","inputHandleChange","inputHandleKeyDown","inputHandleBlur","autoComplete","downshiftButtonIsActive","dataset","toggle","menuRef","_menuNode","getMenuProps","getItemProps","onMouseMove","onMouseDown","customClickHandler","avoidScrolling","clearItems","openMenu","closeMenu","updateStatus","resultCount","getA11yStatusMessage","highlightedItem","setA11yStatus","initialHighlightedIndex","initialIsOpen","initialInputValue","initialSelectedItem","create","constructor","__proto__","internalClearTimeouts","stateToMerge","reduce","_this4","getElementById","scrollHighlightedItemIntoView","nextHighlightedIndex","first","componentDidMount","targetWithinDownshift","checkActiveElement","_this5","contextNode","onMouseUp","onOuterClick","onTouchStart","isTouchMove","onTouchMove","onTouchEnd","contextWithinDownshift","addEventListener","cleanup","removeEventListener","shouldScroll","prevState","prevProps","currentHighlightedIndex","prevHighlightedIndex","componentDidUpdate","selectedItemChanged","componentWillUnmount","render","children","isDOMElement","React","cloneElement","getElementProps","Component","defaultProps","prevItem","isObject","codes","j","keyboardKey","getCode","eventOrKey","which","getKey","eventOrCode","isEvent","Cancel","Help","Backspace","Tab","Clear","Shift","Control","Alt","Pause","CapsLock","Convert","NonConvert","Accept","ModeChange","PageUp","PageDown","ArrowLeft","ArrowRight","Select","Print","Execute","PrintScreen","Insert","Delete","$","A","B","C","D","E","F","G","H","I","J","K","L","M","N","o","O","P","Q","R","s","S","T","U","V","W","X","Y","z","Z","OS","ContextMenu","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","F13","F14","F15","F16","F17","F18","F19","F20","F21","F22","F23","F24","NumLock","ScrollLock","VolumeMute","VolumeDown","VolumeUp","_","Meta","AltGraph","Attn","CrSel","ExSel","EraseEof","Play","ZoomOut","Spacebar","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Tilde","GraveAccent","ExclamationPoint","AtSign","PoundSign","PercentSign","Caret","Ampersand","PlusSign","MinusSign","EqualsSign","DivisionSign","MultiplicationSign","Comma","Decimal","Colon","Semicolon","Pipe","BackSlash","QuestionMark","SingleQuote","DoubleQuote","LeftCurlyBrace","RightCurlyBrace","LeftParenthesis","RightParenthesis","LeftAngleBracket","RightAngleBracket","LeftSquareBracket","RightSquareBracket","genId","useId","_useState","useState","setId","useEffect","itemsLength","circular","nextIndex","getItemIndexByCharacterKey","keysSoFar","itemToStringParam","newHighlightedIndex","itemStrings","toLowerCase","startPosition","slice","findIndex","itemString","startsWith","isAcceptedCharacterKey","test","defaultStateValues","getHighlightedIndexOnOpen","offset","capitalizeString","toUpperCase","getDefaultValue","propKey","defaultPropKey","getInitialValue","initialPropKey","callOnChangeProps","changes","handler","invokeOnChangeHandler","propTypes","getA11ySelectionMessage","circularNavigation","defaultSelectedItem","toggleButtonId","onSelectedItemChange","onHighlightedIndexChange","onIsOpenChange","MenuKeyDownArrowDown","MenuKeyDownArrowUp","MenuKeyDownEscape","MenuKeyDownHome","MenuKeyDownEnd","MenuKeyDownEnter","MenuKeyDownCharacter","MenuBlur","ItemMouseMove","ItemClick","ToggleButtonKeyDownCharacter","ToggleButtonKeyDownArrowDown","ToggleButtonKeyDownArrowUp","ToggleButtonClick","FunctionToggleMenu","FunctionOpenMenu","FunctionCloseMenu","FunctionSetHighlightedIndex","FunctionSelectItem","FunctionClearKeysSoFar","FunctionReset","validatePropTypes","caller","entries","getPropTypesValidator","useSelect","defaultScrollIntoView","userProps","initialState","getInitialState","useReducer","action","lowercasedKey","downshiftSelectReducer","reducedState","dispatch","generateDefaultId","uniqueId","getElementIds","toggleButtonRef","useRef","itemRefs","current","isInitialMount","menuKeyDownHandlers","toggleButtonKeyDownHandlers","menuHandleKeyDown","menuHandleBlur","relatedTarget","toggleButtonHandleClick","toggleButtonHandleKeyDown","toggleButtonNode","labelProps","tabIndex","getItemIndex","itemHandleMouseMove","itemHandleClick","newSelectedItem"],"mappings":"yQAAe,SAASA,EAA8BC,EAAQC,MAC9C,MAAVD,EAAgB,MAAO,OAGvBE,EAAKC,EAFLC,EAAS,GACTC,EAAaC,OAAOC,KAAKP,OAGxBG,EAAI,EA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