{"version":3,"file":"index.modern.mjs","sources":["../node_modules/react-is/cjs/react-is.production.min.js","../node_modules/react-is/cjs/react-is.development.js","../node_modules/react-is/index.js","../node_modules/object-assign/index.js","../node_modules/prop-types/lib/ReactPropTypesSecret.js","../node_modules/prop-types/checkPropTypes.js","../node_modules/prop-types/factoryWithTypeCheckers.js","../node_modules/prop-types/factoryWithThrowingShims.js","../node_modules/prop-types/index.js","../node_modules/xtend/immutable.js","../node_modules/fuzzy/lib/fuzzy.js","../node_modules/suggestions/src/list.js","../node_modules/suggestions/src/suggestions.js","../node_modules/suggestions/index.js","../node_modules/lodash.debounce/index.js","../node_modules/@mapbox/mapbox-gl-geocoder/lib/exceptions.js","../node_modules/@mapbox/mapbox-sdk/lib/helpers/parse-link-header.js","../node_modules/@mapbox/mapbox-sdk/lib/classes/mapi-response.js","../node_modules/@mapbox/mapbox-sdk/lib/constants.js","../node_modules/@mapbox/mapbox-sdk/lib/classes/mapi-error.js","../node_modules/@mapbox/mapbox-sdk/lib/browser/browser-layer.js","../node_modules/base-64/base64.js","../node_modules/@mapbox/parse-mapbox-token/index.js","../node_modules/eventemitter3/index.js","../node_modules/@mapbox/mapbox-sdk/lib/helpers/url-utils.js","../node_modules/@mapbox/mapbox-sdk/lib/classes/mapi-request.js","../node_modules/@mapbox/mapbox-sdk/lib/classes/mapi-client.js","../node_modules/@mapbox/mapbox-sdk/lib/browser/browser-client.js","../node_modules/@mapbox/mapbox-sdk/lib/helpers/parse-headers.js","../node_modules/@mapbox/mapbox-sdk/index.js","../node_modules/is-plain-obj/index.js","../node_modules/@mapbox/fusspot/lib/index.js","../node_modules/@mapbox/mapbox-sdk/services/service-helpers/validator.js","../node_modules/@mapbox/mapbox-sdk/services/service-helpers/pick.js","../node_modules/@mapbox/mapbox-sdk/services/service-helpers/stringify-booleans.js","../node_modules/@mapbox/mapbox-sdk/services/service-helpers/object-map.js","../node_modules/@mapbox/mapbox-sdk/services/geocoding.js","../node_modules/@mapbox/mapbox-sdk/services/service-helpers/create-service-factory.js","../node_modules/nanoid/index.browser.js","../node_modules/@mapbox/mapbox-gl-geocoder/lib/events.js","../node_modules/@mapbox/mapbox-gl-geocoder/lib/localization.js","../node_modules/subtag/subtag.js","../node_modules/@mapbox/mapbox-gl-geocoder/lib/index.js","../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../node_modules/@babel/runtime/helpers/esm/createClass.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../node_modules/gl-matrix/esm/common.js","../node_modules/gl-matrix/esm/vec4.js","../node_modules/viewport-mercator-project/dist/esm/math-utils.js","../node_modules/gl-matrix/esm/mat4.js","../node_modules/gl-matrix/esm/vec2.js","../node_modules/viewport-mercator-project/dist/esm/assert.js","../node_modules/gl-matrix/esm/vec3.js","../node_modules/viewport-mercator-project/dist/esm/web-mercator-utils.js","../node_modules/viewport-mercator-project/dist/esm/viewport.js","../node_modules/viewport-mercator-project/dist/esm/fit-bounds.js","../node_modules/viewport-mercator-project/dist/esm/web-mercator-viewport.js","../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../node_modules/@babel/runtime/helpers/esm/inherits.js","../src/index.js"],"sourcesContent":["/** @license React v16.8.6\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.memo\"):\n60115,r=b?Symbol.for(\"react.lazy\"):60116;function t(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 r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;\nexports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||\"object\"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k};\nexports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f};\nexports.isSuspense=function(a){return t(a)===p};\n","/** @license React v16.8.6\n * react-is.development.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';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n  (function() {\n'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\n\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\n\nfunction isValidElementType(type) {\n  return typeof type === 'string' || typeof type === 'function' ||\n  // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n  type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);\n}\n\n/**\n * Forked from fbjs/warning:\n * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js\n *\n * Only change is we use console.warn instead of console.error,\n * and do nothing when 'console' is not supported.\n * This really simplifies the code.\n * ---\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar lowPriorityWarning = function () {};\n\n{\n  var printWarning = function (format) {\n    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n\n    var argIndex = 0;\n    var message = 'Warning: ' + format.replace(/%s/g, function () {\n      return args[argIndex++];\n    });\n    if (typeof console !== 'undefined') {\n      console.warn(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  lowPriorityWarning = function (condition, format) {\n    if (format === undefined) {\n      throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');\n    }\n    if (!condition) {\n      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n        args[_key2 - 2] = arguments[_key2];\n      }\n\n      printWarning.apply(undefined, [format].concat(args));\n    }\n  };\n}\n\nvar lowPriorityWarning$1 = lowPriorityWarning;\n\nfunction typeOf(object) {\n  if (typeof object === 'object' && object !== null) {\n    var $$typeof = object.$$typeof;\n    switch ($$typeof) {\n      case REACT_ELEMENT_TYPE:\n        var type = object.type;\n\n        switch (type) {\n          case REACT_ASYNC_MODE_TYPE:\n          case REACT_CONCURRENT_MODE_TYPE:\n          case REACT_FRAGMENT_TYPE:\n          case REACT_PROFILER_TYPE:\n          case REACT_STRICT_MODE_TYPE:\n          case REACT_SUSPENSE_TYPE:\n            return type;\n          default:\n            var $$typeofType = type && type.$$typeof;\n\n            switch ($$typeofType) {\n              case REACT_CONTEXT_TYPE:\n              case REACT_FORWARD_REF_TYPE:\n              case REACT_PROVIDER_TYPE:\n                return $$typeofType;\n              default:\n                return $$typeof;\n            }\n        }\n      case REACT_LAZY_TYPE:\n      case REACT_MEMO_TYPE:\n      case REACT_PORTAL_TYPE:\n        return $$typeof;\n    }\n  }\n\n  return undefined;\n}\n\n// AsyncMode is deprecated along with isAsyncMode\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\n\nvar hasWarnedAboutDeprecatedIsAsyncMode = false;\n\n// AsyncMode should be deprecated\nfunction isAsyncMode(object) {\n  {\n    if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n      hasWarnedAboutDeprecatedIsAsyncMode = true;\n      lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n    }\n  }\n  return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n  return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n  return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n  return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n  return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n  return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n  return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n  return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n  return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n  return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n  return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n  return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.typeOf = typeOf;\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isValidElementType = isValidElementType;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\n  })();\n}\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 printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n  var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n  var loggedTypeFailures = {};\n  var has = Function.call.bind(Object.prototype.hasOwnProperty);\n\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\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n  if (process.env.NODE_ENV !== 'production') {\n    for (var typeSpecName in typeSpecs) {\n      if (has(typeSpecs, typeSpecName)) {\n        var error;\n        // Prop type validation may throw. In case they do, we don't want to\n        // fail the render phase where it didn't fail before. So we log it.\n        // After these have been cleaned up, we'll let them throw.\n        try {\n          // This is intentionally an invariant that gets caught. It's the same\n          // behavior as without this statement except with a better message.\n          if (typeof typeSpecs[typeSpecName] !== 'function') {\n            var err = Error(\n              (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n              'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'\n            );\n            err.name = 'Invariant Violation';\n            throw err;\n          }\n          error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n        } catch (ex) {\n          error = ex;\n        }\n        if (error && !(error instanceof Error)) {\n          printWarning(\n            (componentName || 'React class') + ': type specification of ' +\n            location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n            'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n            'You may have forgotten to pass an argument to the type checker ' +\n            'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n            'shape all require an argument).'\n          );\n        }\n        if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n          // Only monitor this failure once because there tends to be a lot of the\n          // same error.\n          loggedTypeFailures[error.message] = true;\n\n          var stack = getStack ? getStack() : '';\n\n          printWarning(\n            'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n          );\n        }\n      }\n    }\n  }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n  if (process.env.NODE_ENV !== 'production') {\n    loggedTypeFailures = {};\n  }\n}\n\nmodule.exports = checkPropTypes;\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","module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n    var target = {}\n\n    for (var i = 0; i < arguments.length; i++) {\n        var source = arguments[i]\n\n        for (var key in source) {\n            if (hasOwnProperty.call(source, key)) {\n                target[key] = source[key]\n            }\n        }\n    }\n\n    return target\n}\n","/*\n * Fuzzy\n * https://github.com/myork/fuzzy\n *\n * Copyright (c) 2012 Matt York\n * Licensed under the MIT license.\n */\n\n(function() {\n\nvar root = this;\n\nvar fuzzy = {};\n\n// Use in node or in browser\nif (typeof exports !== 'undefined') {\n  module.exports = fuzzy;\n} else {\n  root.fuzzy = fuzzy;\n}\n\n// Return all elements of `array` that have a fuzzy\n// match against `pattern`.\nfuzzy.simpleFilter = function(pattern, array) {\n  return array.filter(function(str) {\n    return fuzzy.test(pattern, str);\n  });\n};\n\n// Does `pattern` fuzzy match `str`?\nfuzzy.test = function(pattern, str) {\n  return fuzzy.match(pattern, str) !== null;\n};\n\n// If `pattern` matches `str`, wrap each matching character\n// in `opts.pre` and `opts.post`. If no match, return null\nfuzzy.match = function(pattern, str, opts) {\n  opts = opts || {};\n  var patternIdx = 0\n    , result = []\n    , len = str.length\n    , totalScore = 0\n    , currScore = 0\n    // prefix\n    , pre = opts.pre || ''\n    // suffix\n    , post = opts.post || ''\n    // String to compare against. This might be a lowercase version of the\n    // raw string\n    , compareString =  opts.caseSensitive && str || str.toLowerCase()\n    , ch;\n\n  pattern = opts.caseSensitive && pattern || pattern.toLowerCase();\n\n  // For each character in the string, either add it to the result\n  // or wrap in template if it's the next string in the pattern\n  for(var idx = 0; idx < len; idx++) {\n    ch = str[idx];\n    if(compareString[idx] === pattern[patternIdx]) {\n      ch = pre + ch + post;\n      patternIdx += 1;\n\n      // consecutive characters should increase the score more than linearly\n      currScore += 1 + currScore;\n    } else {\n      currScore = 0;\n    }\n    totalScore += currScore;\n    result[result.length] = ch;\n  }\n\n  // return rendered string if we have a match for every char\n  if(patternIdx === pattern.length) {\n    // if the string is an exact match with pattern, totalScore should be maxed\n    totalScore = (compareString === pattern) ? Infinity : totalScore;\n    return {rendered: result.join(''), score: totalScore};\n  }\n\n  return null;\n};\n\n// The normal entry point. Filters `arr` for matches against `pattern`.\n// It returns an array with matching values of the type:\n//\n//     [{\n//         string:   '<b>lah' // The rendered string\n//       , index:    2        // The index of the element in `arr`\n//       , original: 'blah'   // The original element in `arr`\n//     }]\n//\n// `opts` is an optional argument bag. Details:\n//\n//    opts = {\n//        // string to put before a matching character\n//        pre:     '<b>'\n//\n//        // string to put after matching character\n//      , post:    '</b>'\n//\n//        // Optional function. Input is an entry in the given arr`,\n//        // output should be the string to test `pattern` against.\n//        // In this example, if `arr = [{crying: 'koala'}]` we would return\n//        // 'koala'.\n//      , extract: function(arg) { return arg.crying; }\n//    }\nfuzzy.filter = function(pattern, arr, opts) {\n  if(!arr || arr.length === 0) {\n    return [];\n  }\n  if (typeof pattern !== 'string') {\n    return arr;\n  }\n  opts = opts || {};\n  return arr\n    .reduce(function(prev, element, idx, arr) {\n      var str = element;\n      if(opts.extract) {\n        str = opts.extract(element);\n      }\n      var rendered = fuzzy.match(pattern, str, opts);\n      if(rendered != null) {\n        prev[prev.length] = {\n            string: rendered.rendered\n          , score: rendered.score\n          , index: idx\n          , original: element\n        };\n      }\n      return prev;\n    }, [])\n\n    // Sort by score. Browsers are inconsistent wrt stable/unstable\n    // sorting, so force stable by using the index in the case of tie.\n    // See http://ofb.net/~sethml/is-sort-stable.html\n    .sort(function(a,b) {\n      var compare = b.score - a.score;\n      if(compare) return compare;\n      return a.index - b.index;\n    });\n};\n\n\n}());\n\n","'Use strict';\n\nvar List = function(component) {\n  this.component = component;\n  this.items = [];\n  this.active = 0;\n  this.wrapper = document.createElement('div');\n  this.wrapper.className = 'suggestions-wrapper';\n  this.element = document.createElement('ul');\n  this.element.className = 'suggestions';\n  this.wrapper.appendChild(this.element);\n\n  // selectingListItem is set to true in the time between the mousedown and mouseup when clicking an item in the list\n  // mousedown on a list item will cause the input to blur which normally hides the list, so this flag is used to keep\n  // the list open until the mouseup\n  this.selectingListItem = false;\n\n  component.el.parentNode.insertBefore(this.wrapper, component.el.nextSibling);\n  return this;\n};\n\nList.prototype.show = function() {\n  this.element.style.display = 'block';\n};\n\nList.prototype.hide = function() {\n  this.element.style.display = 'none';\n};\n\nList.prototype.add = function(item) {\n  this.items.push(item);\n};\n\nList.prototype.clear = function() {\n  this.items = [];\n  this.active = 0;\n};\n\nList.prototype.isEmpty = function() {\n  return !this.items.length;\n};\n\nList.prototype.isVisible = function() {\n  return this.element.style.display === 'block';\n};\n\nList.prototype.draw = function() {\n  this.element.innerHTML = '';\n\n  if (this.items.length === 0) {\n    this.hide();\n    return;\n  }\n\n  for (var i = 0; i < this.items.length; i++) {\n    this.drawItem(this.items[i], this.active === i);\n  }\n\n  this.show();\n};\n\nList.prototype.drawItem = function(item, active) {\n  var li = document.createElement('li'),\n    a = document.createElement('a');\n\n  if (active) li.className += ' active';\n\n  a.innerHTML = item.string;\n\n  li.appendChild(a);\n  this.element.appendChild(li);\n\n  li.addEventListener('mousedown', function() {\n    this.selectingListItem = true;\n  }.bind(this));\n\n  li.addEventListener('mouseup', function() {\n    this.handleMouseUp.call(this, item);\n  }.bind(this));\n};\n\nList.prototype.handleMouseUp = function(item) {\n  this.selectingListItem = false;\n  this.component.value(item.original);\n  this.clear();\n  this.draw();\n};\n\nList.prototype.move = function(index) {\n  this.active = index;\n  this.draw();\n};\n\nList.prototype.previous = function() {\n  this.move(this.active === 0 ? this.items.length - 1 : this.active - 1);\n};\n\nList.prototype.next = function() {\n  this.move(this.active === this.items.length - 1 ? 0 : this.active + 1);\n};\n\nList.prototype.drawError = function(msg){\n  var li = document.createElement('li');\n\n  li.innerHTML = msg;\n\n  this.element.appendChild(li);\n  this.show();\n}\n\nmodule.exports = List;\n","'use strict';\n\nvar extend = require('xtend');\nvar fuzzy = require('fuzzy');\nvar List = require('./list');\n\nvar Suggestions = function(el, data, options) {\n  options = options || {};\n\n  this.options = extend({\n    minLength: 2,\n    limit: 5,\n    filter: true\n  }, options);\n\n  this.el = el;\n  this.data = data || [];\n  this.list = new List(this);\n\n  this.query = '';\n  this.selected = null;\n\n  this.list.draw();\n\n  this.el.addEventListener('keyup', function(e) {\n    this.handleKeyUp(e.keyCode);\n  }.bind(this), false);\n\n  this.el.addEventListener('keydown', function(e) {\n    this.handleKeyDown(e);\n  }.bind(this));\n\n  this.el.addEventListener('focus', function() {\n    this.handleFocus();\n  }.bind(this));\n\n  this.el.addEventListener('blur', function() {\n    this.handleBlur();\n  }.bind(this));\n\n  this.el.addEventListener('paste', function(e) {\n    this.handlePaste(e);\n  }.bind(this));\n\n  // use user-provided render function if given, otherwise just use the default\n  this.render = (this.options.render) ? this.options.render.bind(this) : this.render.bind(this)\n\n  this.getItemValue = (this.options.getItemValue) ? this.options.getItemValue.bind(this) : this.getItemValue.bind(this);\n\n  return this;\n};\n\nSuggestions.prototype.handleKeyUp = function(keyCode) {\n  // 40 - DOWN\n  // 38 - UP\n  // 27 - ESC\n  // 13 - ENTER\n  // 9 - TAB\n\n  if (keyCode === 40 ||\n      keyCode === 38 ||\n      keyCode === 27 ||\n      keyCode === 13 ||\n      keyCode === 9) return;\n\n  this.handleInputChange(this.el.value);\n};\n\nSuggestions.prototype.handleKeyDown = function(e) {\n  switch (e.keyCode) {\n    case 13: // ENTER\n    case 9: // TAB\n      if (!this.list.isEmpty()) {\n        if (this.list.isVisible()) {\n          e.preventDefault();\n        }\n        this.value(this.list.items[this.list.active].original);\n        this.list.hide();\n      }\n    break;\n    case 27: // ESC\n      if (!this.list.isEmpty()) this.list.hide();\n    break;\n    case 38: // UP\n      this.list.previous();\n    break;\n    case 40: // DOWN\n      this.list.next();\n    break;\n  }\n};\n\nSuggestions.prototype.handleBlur = function() {\n  if (!this.list.selectingListItem) {\n    this.list.hide();\n  }\n};\n\nSuggestions.prototype.handlePaste = function(e) {\n  if (e.clipboardData) {\n    this.handleInputChange(e.clipboardData.getData('Text'));\n  } else {\n    var self = this;\n    setTimeout(function () {\n      self.handleInputChange(e.target.value);\n    }, 100);\n  }\n};\n\nSuggestions.prototype.handleInputChange = function(query) {\n  this.query = this.normalize(query);\n\n  this.list.clear();\n\n  if (this.query.length < this.options.minLength) {\n    this.list.draw();\n    return;\n  }\n\n  this.getCandidates(function(data) {\n    for (var i = 0; i < data.length; i++) {\n      this.list.add(data[i]);\n      if (i === (this.options.limit - 1)) break;\n    }\n    this.list.draw();\n  }.bind(this));\n};\n\nSuggestions.prototype.handleFocus = function() {\n  if (!this.list.isEmpty()) this.list.show();\n  this.list.selectingListItem = false;\n};\n\n/**\n * Update data previously passed\n *\n * @param {Array} revisedData\n */\nSuggestions.prototype.update = function(revisedData) {\n  this.data = revisedData;\n  this.handleKeyUp();\n};\n\n/**\n * Clears data\n */\nSuggestions.prototype.clear = function() {\n  this.data = [];\n  this.list.clear();\n};\n\n/**\n * Normalize the results list and input value for matching\n *\n * @param {String} value\n * @return {String}\n */\nSuggestions.prototype.normalize = function(value) {\n  value = value.toLowerCase();\n  return value;\n};\n\n/**\n * Evaluates whether an array item qualifies as a match with the current query\n *\n * @param {String} candidate a possible item from the array passed\n * @param {String} query the current query\n * @return {Boolean}\n */\nSuggestions.prototype.match = function(candidate, query) {\n  return candidate.indexOf(query) > -1;\n};\n\nSuggestions.prototype.value = function(value) {\n  this.selected = value;\n  this.el.value = this.getItemValue(value);\n\n  if (document.createEvent) {\n    var e = document.createEvent('HTMLEvents');\n    e.initEvent('change', true, false);\n    this.el.dispatchEvent(e);\n  } else {\n    this.el.fireEvent('onchange');\n  }\n};\n\nSuggestions.prototype.getCandidates = function(callback) {\n  var options = {\n    pre: '<strong>',\n    post: '</strong>',\n    extract: function(d) { return this.getItemValue(d); }.bind(this)\n  };\n  var results;\n  if(this.options.filter){\n    results = fuzzy.filter(this.query, this.data, options);\n\n    results = results.map(function(item){\n      return {\n        original: item.original,\n        string: this.render(item.original, item.string)\n      };\n    }.bind(this))\n  }else{\n    results = this.data.map(function(d) {\n      var renderedString = this.render(d);\n      return {\n        original: d,\n        string: renderedString\n      };\n    }.bind(this));\n  }\n  callback(results);\n};\n\n/**\n * For a given item in the data array, return what should be used as the candidate string\n *\n * @param {Object|String} item an item from the data array\n * @return {String} item\n */\nSuggestions.prototype.getItemValue = function(item) {\n  return item;\n};\n\n/**\n * For a given item in the data array, return a string of html that should be rendered in the dropdown\n * @param {Object|String} item an item from the data array\n * @param {String} sourceFormatting a string that has pre-formatted html that should be passed directly through the render function \n * @return {String} html\n */\nSuggestions.prototype.render = function(item, sourceFormatting) {\n  if (sourceFormatting){\n    // use existing formatting on the source string\n    return sourceFormatting;\n  }\n  var boldString = (item.original) ? this.getItemValue(item.original) : this.getItemValue(item);\n  var indexString = this.normalize(boldString);\n  var indexOfQuery = indexString.lastIndexOf(this.query);\n  while (indexOfQuery > -1) {\n    var endIndexOfQuery = indexOfQuery + this.query.length;\n    boldString = boldString.slice(0, indexOfQuery) + '<strong>' + boldString.slice(indexOfQuery, endIndexOfQuery) + '</strong>' + boldString.slice(endIndexOfQuery);\n    indexOfQuery = indexString.slice(0, indexOfQuery).lastIndexOf(this.query);\n  }\n  return boldString\n}\n\n/**\n * Render an custom error message in the suggestions list\n * @param {String} msg An html string to render as an error message\n */\nSuggestions.prototype.renderError = function(msg){\n  this.list.drawError(msg);\n}\n\nmodule.exports = Suggestions;","'use strict';\n\n/**\n * A typeahead component for inputs\n * @class Suggestions\n *\n * @param {HTMLInputElement} el A valid HTML input element\n * @param {Array} data An array of data used for results\n * @param {Object} options\n * @param {Number} [options.limit=5] Max number of results to display in the auto suggest list.\n * @param {Number} [options.minLength=2] Number of characters typed into an input to trigger suggestions.\n * @return {Suggestions} `this`\n * @example\n * // in the browser\n * var input = document.querySelector('input');\n * var data = [\n *   'Roy Eldridge',\n *   'Roy Hargrove',\n *   'Rex Stewart'\n * ];\n *\n * new Suggestions(input, data);\n *\n * // with options\n * var input = document.querySelector('input');\n * var data = [{\n *   name: 'Roy Eldridge',\n *   year: 1911\n * }, {\n *   name: 'Roy Hargrove',\n *   year: 1969\n * }, {\n *   name: 'Rex Stewart',\n *   year: 1907\n * }];\n *\n * var typeahead = new Suggestions(input, data, {\n *   filter: false, // Disable filtering\n *   minLength: 3, // Number of characters typed into an input to trigger suggestions.\n *   limit: 3 //  Max number of results to display.\n * });\n *\n * // As we're passing an object of an arrays as data, override\n * // `getItemValue` by specifying the specific property to search on.\n * typeahead.getItemValue = function(item) { return item.name };\n *\n * input.addEventListener('change', function() {\n *   console.log(typeahead.selected); // Current selected item.\n * });\n *\n * // With browserify\n * var Suggestions = require('suggestions');\n *\n * new Suggestions(input, data);\n */\nvar Suggestions = require('./src/suggestions');\nwindow.Suggestions = module.exports = Suggestions;\n","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n    nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n *   console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n  return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n *  Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n *  The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n *  Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n *   'leading': true,\n *   'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n  var lastArgs,\n      lastThis,\n      maxWait,\n      result,\n      timerId,\n      lastCallTime,\n      lastInvokeTime = 0,\n      leading = false,\n      maxing = false,\n      trailing = true;\n\n  if (typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  wait = toNumber(wait) || 0;\n  if (isObject(options)) {\n    leading = !!options.leading;\n    maxing = 'maxWait' in options;\n    maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n    trailing = 'trailing' in options ? !!options.trailing : trailing;\n  }\n\n  function invokeFunc(time) {\n    var args = lastArgs,\n        thisArg = lastThis;\n\n    lastArgs = lastThis = undefined;\n    lastInvokeTime = time;\n    result = func.apply(thisArg, args);\n    return result;\n  }\n\n  function leadingEdge(time) {\n    // Reset any `maxWait` timer.\n    lastInvokeTime = time;\n    // Start the timer for the trailing edge.\n    timerId = setTimeout(timerExpired, wait);\n    // Invoke the leading edge.\n    return leading ? invokeFunc(time) : result;\n  }\n\n  function remainingWait(time) {\n    var timeSinceLastCall = time - lastCallTime,\n        timeSinceLastInvoke = time - lastInvokeTime,\n        result = wait - timeSinceLastCall;\n\n    return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n  }\n\n  function shouldInvoke(time) {\n    var timeSinceLastCall = time - lastCallTime,\n        timeSinceLastInvoke = time - lastInvokeTime;\n\n    // Either this is the first call, activity has stopped and we're at the\n    // trailing edge, the system time has gone backwards and we're treating\n    // it as the trailing edge, or we've hit the `maxWait` limit.\n    return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n      (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n  }\n\n  function timerExpired() {\n    var time = now();\n    if (shouldInvoke(time)) {\n      return trailingEdge(time);\n    }\n    // Restart the timer.\n    timerId = setTimeout(timerExpired, remainingWait(time));\n  }\n\n  function trailingEdge(time) {\n    timerId = undefined;\n\n    // Only invoke if we have `lastArgs` which means `func` has been\n    // debounced at least once.\n    if (trailing && lastArgs) {\n      return invokeFunc(time);\n    }\n    lastArgs = lastThis = undefined;\n    return result;\n  }\n\n  function cancel() {\n    if (timerId !== undefined) {\n      clearTimeout(timerId);\n    }\n    lastInvokeTime = 0;\n    lastArgs = lastCallTime = lastThis = timerId = undefined;\n  }\n\n  function flush() {\n    return timerId === undefined ? result : trailingEdge(now());\n  }\n\n  function debounced() {\n    var time = now(),\n        isInvoking = shouldInvoke(time);\n\n    lastArgs = arguments;\n    lastThis = this;\n    lastCallTime = time;\n\n    if (isInvoking) {\n      if (timerId === undefined) {\n        return leadingEdge(lastCallTime);\n      }\n      if (maxing) {\n        // Handle invocations in a tight loop.\n        timerId = setTimeout(timerExpired, wait);\n        return invokeFunc(lastCallTime);\n      }\n    }\n    if (timerId === undefined) {\n      timerId = setTimeout(timerExpired, wait);\n    }\n    return result;\n  }\n  debounced.cancel = cancel;\n  debounced.flush = flush;\n  return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n  if (typeof value == 'number') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return NAN;\n  }\n  if (isObject(value)) {\n    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n    value = isObject(other) ? (other + '') : other;\n  }\n  if (typeof value != 'string') {\n    return value === 0 ? value : +value;\n  }\n  value = value.replace(reTrim, '');\n  var isBinary = reIsBinary.test(value);\n  return (isBinary || reIsOctal.test(value))\n    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n    : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","module.exports = {\n  'fr': {\n    'name': 'France',\n    'bbox': [[-4.59235, 41.380007], [9.560016, 51.148506]]\n  },\n  'us': {\n    'name': 'United States',\n    'bbox': [[-171.791111, 18.91619], [-66.96466, 71.357764]]\n  },\n  'ru': {\n    'name': 'Russia',\n    'bbox': [[19.66064, 41.151416], [190.10042, 81.2504]]\n  },\n  'ca': {\n    'name': 'Canada',\n    'bbox': [[-140.99778, 41.675105], [-52.648099, 83.23324]]\n  }\n};\n","'use strict';\n\n// Like https://github.com/thlorenz/lib/parse-link-header but without any\n// additional dependencies.\n\nfunction parseParam(param) {\n  var parts = param.match(/\\s*(.+)\\s*=\\s*\"?([^\"]+)\"?/);\n  if (!parts) return null;\n\n  return {\n    key: parts[1],\n    value: parts[2]\n  };\n}\n\nfunction parseLink(link) {\n  var parts = link.match(/<?([^>]*)>(.*)/);\n  if (!parts) return null;\n\n  var linkUrl = parts[1];\n  var linkParams = parts[2].split(';');\n  var rel = null;\n  var parsedLinkParams = linkParams.reduce(function(result, param) {\n    var parsed = parseParam(param);\n    if (!parsed) return result;\n    if (parsed.key === 'rel') {\n      if (!rel) {\n        rel = parsed.value;\n      }\n      return result;\n    }\n    result[parsed.key] = parsed.value;\n    return result;\n  }, {});\n  if (!rel) return null;\n\n  return {\n    url: linkUrl,\n    rel: rel,\n    params: parsedLinkParams\n  };\n}\n\n/**\n * Parse a Link header.\n *\n * @param {string} linkHeader\n * @returns {{\n *   [string]: {\n *     url: string,\n *     params: { [string]: string }\n *   }\n * }}\n */\nfunction parseLinkHeader(linkHeader) {\n  if (!linkHeader) return {};\n\n  return linkHeader.split(/,\\s*</).reduce(function(result, link) {\n    var parsed = parseLink(link);\n    if (!parsed) return result;\n    // rel value can be multiple whitespace-separated rels.\n    var splitRel = parsed.rel.split(/\\s+/);\n    splitRel.forEach(function(rel) {\n      if (!result[rel]) {\n        result[rel] = {\n          url: parsed.url,\n          params: parsed.params\n        };\n      }\n    });\n    return result;\n  }, {});\n}\n\nmodule.exports = parseLinkHeader;\n","'use strict';\n\nvar parseLinkHeader = require('../helpers/parse-link-header');\n\n/**\n * A Mapbox API response.\n *\n * @class MapiResponse\n * @property {Object} body - The response body, parsed as JSON.\n * @property {string} rawBody - The raw response body.\n * @property {number} statusCode - The response's status code.\n * @property {Object} headers - The parsed response headers.\n * @property {Object} links - The parsed response links.\n * @property {MapiRequest} request - The response's originating `MapiRequest`.\n */\n\n/**\n * @ignore\n * @param {MapiRequest} request\n * @param {Object} responseData\n * @param {Object} responseData.headers\n * @param {string} responseData.body\n * @param {number} responseData.statusCode\n */\nfunction MapiResponse(request, responseData) {\n  this.request = request;\n  this.headers = responseData.headers;\n  this.rawBody = responseData.body;\n  this.statusCode = responseData.statusCode;\n  try {\n    this.body = JSON.parse(responseData.body || '{}');\n  } catch (parseError) {\n    this.body = responseData.body;\n  }\n  this.links = parseLinkHeader(this.headers.link);\n}\n\n/**\n * Check if there is a next page that you can fetch.\n *\n * @returns {boolean}\n */\nMapiResponse.prototype.hasNextPage = function hasNextPage() {\n  return !!this.links.next;\n};\n\n/**\n * Create a request for the next page, if there is one.\n * If there is no next page, returns `null`.\n *\n * @returns {MapiRequest | null}\n */\nMapiResponse.prototype.nextPage = function nextPage() {\n  if (!this.hasNextPage()) return null;\n  return this.request._extend({\n    path: this.links.next.url\n  });\n};\n\nmodule.exports = MapiResponse;\n","'use strict';\n\nmodule.exports = {\n  API_ORIGIN: 'https://api.mapbox.com',\n  EVENT_PROGRESS_DOWNLOAD: 'downloadProgress',\n  EVENT_PROGRESS_UPLOAD: 'uploadProgress',\n  EVENT_ERROR: 'error',\n  EVENT_RESPONSE: 'response',\n  ERROR_HTTP: 'HttpError',\n  ERROR_REQUEST_ABORTED: 'RequestAbortedError'\n};\n","'use strict';\n\nvar constants = require('../constants');\n\n/**\n * A Mapbox API error.\n *\n * If there's an error during the API transaction,\n * the Promise returned by `MapiRequest`'s [`send`](#send)\n * method should reject with a `MapiError`.\n *\n * @class MapiError\n * @hideconstructor\n * @property {MapiRequest} request - The errored request.\n * @property {string} type - The type of error. Usually this is `'HttpError'`.\n *   If the request was aborted, so the error was\n *   not sent from the server, the type will be\n *   `'RequestAbortedError'`.\n * @property {number} [statusCode] - The numeric status code of\n *   the HTTP response.\n * @property {Object | string} [body] - If the server sent a response body,\n *   this property exposes that response, parsed as JSON if possible.\n * @property {string} [message] - Whatever message could be derived from the\n *   call site and HTTP response.\n *\n * @param {MapiRequest} options.request\n * @param {number} [options.statusCode]\n * @param {string} [options.body]\n * @param {string} [options.message]\n * @param {string} [options.type]\n */\nfunction MapiError(options) {\n  var errorType = options.type || constants.ERROR_HTTP;\n\n  var body;\n  if (options.body) {\n    try {\n      body = JSON.parse(options.body);\n    } catch (e) {\n      body = options.body;\n    }\n  } else {\n    body = null;\n  }\n\n  var message = options.message || null;\n  if (!message) {\n    if (typeof body === 'string') {\n      message = body;\n    } else if (body && typeof body.message === 'string') {\n      message = body.message;\n    } else if (errorType === constants.ERROR_REQUEST_ABORTED) {\n      message = 'Request aborted';\n    }\n  }\n\n  this.message = message;\n  this.type = errorType;\n  this.statusCode = options.statusCode || null;\n  this.request = options.request;\n  this.body = body;\n}\n\nmodule.exports = MapiError;\n","'use strict';\n\nvar MapiResponse = require('../classes/mapi-response');\nvar MapiError = require('../classes/mapi-error');\nvar constants = require('../constants');\nvar parseHeaders = require('../helpers/parse-headers');\n\n// Keys are request IDs, values are XHRs.\nvar requestsUnderway = {};\n\nfunction browserAbort(request) {\n  var xhr = requestsUnderway[request.id];\n  if (!xhr) return;\n  xhr.abort();\n  delete requestsUnderway[request.id];\n}\n\nfunction createResponse(request, xhr) {\n  return new MapiResponse(request, {\n    body: xhr.response,\n    headers: parseHeaders(xhr.getAllResponseHeaders()),\n    statusCode: xhr.status\n  });\n}\n\nfunction normalizeBrowserProgressEvent(event) {\n  var total = event.total;\n  var transferred = event.loaded;\n  var percent = (100 * transferred) / total;\n  return {\n    total: total,\n    transferred: transferred,\n    percent: percent\n  };\n}\n\nfunction sendRequestXhr(request, xhr) {\n  return new Promise(function(resolve, reject) {\n    xhr.onprogress = function(event) {\n      request.emitter.emit(\n        constants.EVENT_PROGRESS_DOWNLOAD,\n        normalizeBrowserProgressEvent(event)\n      );\n    };\n\n    var file = request.file;\n    if (file) {\n      xhr.upload.onprogress = function(event) {\n        request.emitter.emit(\n          constants.EVENT_PROGRESS_UPLOAD,\n          normalizeBrowserProgressEvent(event)\n        );\n      };\n    }\n\n    xhr.onerror = function(error) {\n      reject(error);\n    };\n\n    xhr.onabort = function() {\n      var mapiError = new MapiError({\n        request: request,\n        type: constants.ERROR_REQUEST_ABORTED\n      });\n      reject(mapiError);\n    };\n\n    xhr.onload = function() {\n      delete requestsUnderway[request.id];\n      if (xhr.status < 200 || xhr.status >= 400) {\n        var mapiError = new MapiError({\n          request: request,\n          body: xhr.response,\n          statusCode: xhr.status\n        });\n        reject(mapiError);\n        return;\n      }\n      resolve(xhr);\n    };\n\n    var body = request.body;\n\n    // matching service needs to send a www-form-urlencoded request\n    if (typeof body === 'string') {\n      xhr.send(body);\n    } else if (body) {\n      xhr.send(JSON.stringify(body));\n    } else if (file) {\n      xhr.send(file);\n    } else {\n      xhr.send();\n    }\n\n    requestsUnderway[request.id] = xhr;\n  }).then(function(xhr) {\n    return createResponse(request, xhr);\n  });\n}\n\n// The accessToken argument gives this function flexibility\n// for Mapbox's internal client.\nfunction createRequestXhr(request, accessToken) {\n  var url = request.url(accessToken);\n  var xhr = new window.XMLHttpRequest();\n  xhr.open(request.method, url);\n  Object.keys(request.headers).forEach(function(key) {\n    xhr.setRequestHeader(key, request.headers[key]);\n  });\n  return xhr;\n}\n\nfunction browserSend(request) {\n  return Promise.resolve().then(function() {\n    var xhr = createRequestXhr(request, request.client.accessToken);\n    return sendRequestXhr(request, xhr);\n  });\n}\n\nmodule.exports = {\n  browserAbort: browserAbort,\n  sendRequestXhr: sendRequestXhr,\n  browserSend: browserSend,\n  createRequestXhr: createRequestXhr\n};\n","/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */\n;(function(root) {\n\n\t// Detect free variables `exports`.\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`.\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code, and use\n\t// it as `root`.\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar InvalidCharacterError = function(message) {\n\t\tthis.message = message;\n\t};\n\tInvalidCharacterError.prototype = new Error;\n\tInvalidCharacterError.prototype.name = 'InvalidCharacterError';\n\n\tvar error = function(message) {\n\t\t// Note: the error messages used throughout this file match those used by\n\t\t// the native `atob`/`btoa` implementation in Chromium.\n\t\tthrow new InvalidCharacterError(message);\n\t};\n\n\tvar TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\t// http://whatwg.org/html/common-microsyntaxes.html#space-character\n\tvar REGEX_SPACE_CHARACTERS = /[\\t\\n\\f\\r ]/g;\n\n\t// `decode` is designed to be fully compatible with `atob` as described in the\n\t// HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob\n\t// The optimized base64-decoding algorithm used is based on @atk’s excellent\n\t// implementation. https://gist.github.com/atk/1020396\n\tvar decode = function(input) {\n\t\tinput = String(input)\n\t\t\t.replace(REGEX_SPACE_CHARACTERS, '');\n\t\tvar length = input.length;\n\t\tif (length % 4 == 0) {\n\t\t\tinput = input.replace(/==?$/, '');\n\t\t\tlength = input.length;\n\t\t}\n\t\tif (\n\t\t\tlength % 4 == 1 ||\n\t\t\t// http://whatwg.org/C#alphanumeric-ascii-characters\n\t\t\t/[^+a-zA-Z0-9/]/.test(input)\n\t\t) {\n\t\t\terror(\n\t\t\t\t'Invalid character: the string to be decoded is not correctly encoded.'\n\t\t\t);\n\t\t}\n\t\tvar bitCounter = 0;\n\t\tvar bitStorage;\n\t\tvar buffer;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\twhile (++position < length) {\n\t\t\tbuffer = TABLE.indexOf(input.charAt(position));\n\t\t\tbitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;\n\t\t\t// Unless this is the first of a group of 4 characters…\n\t\t\tif (bitCounter++ % 4) {\n\t\t\t\t// …convert the first 8 bits to a single ASCII character.\n\t\t\t\toutput += String.fromCharCode(\n\t\t\t\t\t0xFF & bitStorage >> (-2 * bitCounter & 6)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t};\n\n\t// `encode` is designed to be fully compatible with `btoa` as described in the\n\t// HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa\n\tvar encode = function(input) {\n\t\tinput = String(input);\n\t\tif (/[^\\0-\\xFF]/.test(input)) {\n\t\t\t// Note: no need to special-case astral symbols here, as surrogates are\n\t\t\t// matched, and the input is supposed to only contain ASCII anyway.\n\t\t\terror(\n\t\t\t\t'The string to be encoded contains characters outside of the ' +\n\t\t\t\t'Latin1 range.'\n\t\t\t);\n\t\t}\n\t\tvar padding = input.length % 3;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\tvar a;\n\t\tvar b;\n\t\tvar c;\n\t\tvar d;\n\t\tvar buffer;\n\t\t// Make sure any padding is handled outside of the loop.\n\t\tvar length = input.length - padding;\n\n\t\twhile (++position < length) {\n\t\t\t// Read three bytes, i.e. 24 bits.\n\t\t\ta = input.charCodeAt(position) << 16;\n\t\t\tb = input.charCodeAt(++position) << 8;\n\t\t\tc = input.charCodeAt(++position);\n\t\t\tbuffer = a + b + c;\n\t\t\t// Turn the 24 bits into four chunks of 6 bits each, and append the\n\t\t\t// matching character for each of them to the output.\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 18 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 12 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 6 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer & 0x3F)\n\t\t\t);\n\t\t}\n\n\t\tif (padding == 2) {\n\t\t\ta = input.charCodeAt(position) << 8;\n\t\t\tb = input.charCodeAt(++position);\n\t\t\tbuffer = a + b;\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 10) +\n\t\t\t\tTABLE.charAt((buffer >> 4) & 0x3F) +\n\t\t\t\tTABLE.charAt((buffer << 2) & 0x3F) +\n\t\t\t\t'='\n\t\t\t);\n\t\t} else if (padding == 1) {\n\t\t\tbuffer = input.charCodeAt(position);\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 2) +\n\t\t\t\tTABLE.charAt((buffer << 4) & 0x3F) +\n\t\t\t\t'=='\n\t\t\t);\n\t\t}\n\n\t\treturn output;\n\t};\n\n\tvar base64 = {\n\t\t'encode': encode,\n\t\t'decode': decode,\n\t\t'version': '0.1.0'\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn base64;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = base64;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (var key in base64) {\n\t\t\t\tbase64.hasOwnProperty(key) && (freeExports[key] = base64[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.base64 = base64;\n\t}\n\n}(this));\n","'use strict';\n\nvar base64 = require('base-64');\n\nvar tokenCache = {};\n\nfunction parseToken(token) {\n  if (tokenCache[token]) {\n    return tokenCache[token];\n  }\n\n  var parts = token.split('.');\n  var usage = parts[0];\n  var rawPayload = parts[1];\n  if (!rawPayload) {\n    throw new Error('Invalid token');\n  }\n\n  var parsedPayload = parsePaylod(rawPayload);\n\n  var result = {\n    usage: usage,\n    user: parsedPayload.u\n  };\n  if (has(parsedPayload, 'a')) result.authorization = parsedPayload.a;\n  if (has(parsedPayload, 'exp')) result.expires = parsedPayload.exp * 1000;\n  if (has(parsedPayload, 'iat')) result.created = parsedPayload.iat * 1000;\n  if (has(parsedPayload, 'scopes')) result.scopes = parsedPayload.scopes;\n  if (has(parsedPayload, 'client')) result.client = parsedPayload.client;\n  if (has(parsedPayload, 'll')) result.lastLogin = parsedPayload.ll;\n  if (has(parsedPayload, 'iu')) result.impersonator = parsedPayload.iu;\n\n  tokenCache[token] = result;\n  return result;\n}\n\nfunction parsePaylod(rawPayload) {\n  try {\n    return JSON.parse(base64.decode(rawPayload));\n  } catch (parseError) {\n    throw new Error('Invalid token');\n  }\n}\n\nfunction has(obj, key) {\n  return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nmodule.exports = parseToken;\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n  , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n  Events.prototype = Object.create(null);\n\n  //\n  // This hack is needed because the `__proto__` property is still inherited in\n  // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n  //\n  if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n  this.fn = fn;\n  this.context = context;\n  this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n  if (typeof fn !== 'function') {\n    throw new TypeError('The listener must be a function');\n  }\n\n  var listener = new EE(fn, context || emitter, once)\n    , evt = prefix ? prefix + event : event;\n\n  if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n  else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n  else emitter._events[evt] = [emitter._events[evt], listener];\n\n  return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n  if (--emitter._eventsCount === 0) emitter._events = new Events();\n  else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n  this._events = new Events();\n  this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n  var names = []\n    , events\n    , name;\n\n  if (this._eventsCount === 0) return names;\n\n  for (name in (events = this._events)) {\n    if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n  }\n\n  if (Object.getOwnPropertySymbols) {\n    return names.concat(Object.getOwnPropertySymbols(events));\n  }\n\n  return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n  var evt = prefix ? prefix + event : event\n    , handlers = this._events[evt];\n\n  if (!handlers) return [];\n  if (handlers.fn) return [handlers.fn];\n\n  for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n    ee[i] = handlers[i].fn;\n  }\n\n  return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n  var evt = prefix ? prefix + event : event\n    , listeners = this._events[evt];\n\n  if (!listeners) return 0;\n  if (listeners.fn) return 1;\n  return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n  var evt = prefix ? prefix + event : event;\n\n  if (!this._events[evt]) return false;\n\n  var listeners = this._events[evt]\n    , len = arguments.length\n    , args\n    , i;\n\n  if (listeners.fn) {\n    if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n    switch (len) {\n      case 1: return listeners.fn.call(listeners.context), true;\n      case 2: return listeners.fn.call(listeners.context, a1), true;\n      case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n      case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n      case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n      case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n    }\n\n    for (i = 1, args = new Array(len -1); i < len; i++) {\n      args[i - 1] = arguments[i];\n    }\n\n    listeners.fn.apply(listeners.context, args);\n  } else {\n    var length = listeners.length\n      , j;\n\n    for (i = 0; i < length; i++) {\n      if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n      switch (len) {\n        case 1: listeners[i].fn.call(listeners[i].context); break;\n        case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n        case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n        case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n        default:\n          if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n            args[j - 1] = arguments[j];\n          }\n\n          listeners[i].fn.apply(listeners[i].context, args);\n      }\n    }\n  }\n\n  return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n  return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n  return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n  var evt = prefix ? prefix + event : event;\n\n  if (!this._events[evt]) return this;\n  if (!fn) {\n    clearEvent(this, evt);\n    return this;\n  }\n\n  var listeners = this._events[evt];\n\n  if (listeners.fn) {\n    if (\n      listeners.fn === fn &&\n      (!once || listeners.once) &&\n      (!context || listeners.context === context)\n    ) {\n      clearEvent(this, evt);\n    }\n  } else {\n    for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n      if (\n        listeners[i].fn !== fn ||\n        (once && !listeners[i].once) ||\n        (context && listeners[i].context !== context)\n      ) {\n        events.push(listeners[i]);\n      }\n    }\n\n    //\n    // Reset the array, or remove it completely if we have no more listeners.\n    //\n    if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n    else clearEvent(this, evt);\n  }\n\n  return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n  var evt;\n\n  if (event) {\n    evt = prefix ? prefix + event : event;\n    if (this._events[evt]) clearEvent(this, evt);\n  } else {\n    this._events = new Events();\n    this._eventsCount = 0;\n  }\n\n  return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n  module.exports = EventEmitter;\n}\n","'use strict';\n\n// Encode each item of an array individually. The comma\n// delimiters should not themselves be encoded.\nfunction encodeArray(arrayValue) {\n  return arrayValue.map(encodeURIComponent).join(',');\n}\n\nfunction encodeValue(value) {\n  if (Array.isArray(value)) {\n    return encodeArray(value);\n  }\n  return encodeURIComponent(String(value));\n}\n\n/**\n * Append a query parameter to a URL.\n *\n * @param {string} url\n * @param {string} key\n * @param {string|number|boolean|Array<*>>} [value] - Provide an array\n *   if the value is a list and commas between values need to be\n *   preserved, unencoded.\n * @returns {string} - Modified URL.\n */\nfunction appendQueryParam(url, key, value) {\n  if (value === false || value === null) {\n    return url;\n  }\n  var punctuation = /\\?/.test(url) ? '&' : '?';\n  var query = encodeURIComponent(key);\n  if (value !== undefined && value !== '' && value !== true) {\n    query += '=' + encodeValue(value);\n  }\n  return '' + url + punctuation + query;\n}\n\n/**\n * Derive a query string from an object and append it\n * to a URL.\n *\n * @param {string} url\n * @param {Object} [queryObject] - Values should be primitives.\n * @returns {string} - Modified URL.\n */\nfunction appendQueryObject(url, queryObject) {\n  if (!queryObject) {\n    return url;\n  }\n\n  var result = url;\n  Object.keys(queryObject).forEach(function(key) {\n    var value = queryObject[key];\n    if (value === undefined) {\n      return;\n    }\n    if (Array.isArray(value)) {\n      value = value\n        .filter(function(v) {\n          return !!v;\n        })\n        .join(',');\n    }\n    result = appendQueryParam(result, key, value);\n  });\n  return result;\n}\n\n/**\n * Prepend an origin to a URL. If the URL already has an\n * origin, do nothing.\n *\n * @param {string} url\n * @param {string} origin\n * @returns {string} - Modified URL.\n */\nfunction prependOrigin(url, origin) {\n  if (!origin) {\n    return url;\n  }\n\n  if (url.slice(0, 4) === 'http') {\n    return url;\n  }\n\n  var delimiter = url[0] === '/' ? '' : '/';\n  return '' + origin.replace(/\\/$/, '') + delimiter + url;\n}\n\n/**\n * Interpolate values into a route with express-style,\n * colon-prefixed route parameters.\n *\n * @param {string} route\n * @param {Object} [params] - Values should be primitives\n *   or arrays of primitives. Provide an array if the value\n *   is a list and commas between values need to be\n *   preserved, unencoded.\n * @returns {string} - Modified URL.\n */\nfunction interpolateRouteParams(route, params) {\n  if (!params) {\n    return route;\n  }\n  return route.replace(/\\/:([a-zA-Z0-9]+)/g, function(_, paramId) {\n    var value = params[paramId];\n    if (value === undefined) {\n      throw new Error('Unspecified route parameter ' + paramId);\n    }\n    var preppedValue = encodeValue(value);\n    return '/' + preppedValue;\n  });\n}\n\nmodule.exports = {\n  appendQueryObject: appendQueryObject,\n  appendQueryParam: appendQueryParam,\n  prependOrigin: prependOrigin,\n  interpolateRouteParams: interpolateRouteParams\n};\n","'use strict';\n\nvar parseToken = require('@mapbox/parse-mapbox-token');\nvar xtend = require('xtend');\nvar EventEmitter = require('eventemitter3');\nvar urlUtils = require('../helpers/url-utils');\nvar constants = require('../constants');\n\nvar requestId = 1;\n\n/**\n * A Mapbox API request.\n *\n * Note that creating a `MapiRequest` does *not* send the request automatically.\n * Use the request's `send` method to send it off and get a `Promise`.\n *\n * The `emitter` property is an `EventEmitter` that emits the following events:\n *\n * - `'response'` - Listeners will be called with a `MapiResponse`.\n * - `'error'` - Listeners will be called with a `MapiError`.\n * - `'downloadProgress'` - Listeners will be called with `ProgressEvents`.\n * - `'uploadProgress'` - Listeners will be called with `ProgressEvents`.\n *   Upload events are only available when the request includes a file.\n *\n * @class MapiRequest\n * @property {EventEmitter} emitter - An event emitter. See above.\n * @property {MapiClient} client - This request's `MapiClient`.\n * @property {MapiResponse|null} response - If this request has been sent and received\n *   a response, the response is available on this property.\n * @property {MapiError|Error|null} error - If this request has been sent and\n *   received an error in response, the error is available on this property.\n * @property {boolean} aborted - If the request has been aborted\n *   (via [`abort`](#abort)), this property will be `true`.\n * @property {boolean} sent - If the request has been sent, this property will\n *   be `true`. You cannot send the same request twice, so if you need to create\n *   a new request that is the equivalent of an existing one, use\n *   [`clone`](#clone).\n * @property {string} path - The request's path, including colon-prefixed route\n *   parameters.\n * @property {string} origin - The request's origin.\n * @property {string} method - The request's HTTP method.\n * @property {Object} query - A query object, which will be transformed into\n *   a URL query string.\n * @property {Object} params - A route parameters object, whose values will\n *   be interpolated the path.\n * @property {Object} headers - The request's headers.\n * @property {Object|string|null} body - Data to send with the request.\n *   If the request has a body, it will also be sent with the header\n *   `'Content-Type: application/json'`.\n * @property {Blob|ArrayBuffer|string|ReadStream} file - A file to\n *   send with the request. The browser client accepts Blobs and ArrayBuffers;\n *   the Node client accepts strings (filepaths) and ReadStreams.\n */\n\n/**\n * @ignore\n * @param {MapiClient} client\n * @param {Object} options\n * @param {string} options.method\n * @param {string} options.path\n * @param {Object} [options.query={}]\n * @param {Object} [options.params={}]\n * @param {string} [options.origin]\n * @param {Object} [options.headers]\n * @param {Object} [options.body=null]\n * @param {Blob|ArrayBuffer|string|ReadStream} [options.file=null]\n */\nfunction MapiRequest(client, options) {\n  if (!client) {\n    throw new Error('MapiRequest requires a client');\n  }\n  if (!options || !options.path || !options.method) {\n    throw new Error(\n      'MapiRequest requires an options object with path and method properties'\n    );\n  }\n\n  var defaultHeaders = {};\n  if (options.body) {\n    defaultHeaders['content-type'] = 'application/json';\n  }\n\n  var headersWithDefaults = xtend(defaultHeaders, options.headers);\n\n  // Disallows duplicate header names of mixed case,\n  // e.g. Content-Type and content-type.\n  var headers = Object.keys(headersWithDefaults).reduce(function(memo, name) {\n    memo[name.toLowerCase()] = headersWithDefaults[name];\n    return memo;\n  }, {});\n\n  this.id = requestId++;\n  this._options = options;\n\n  this.emitter = new EventEmitter();\n  this.client = client;\n  this.response = null;\n  this.error = null;\n  this.sent = false;\n  this.aborted = false;\n  this.path = options.path;\n  this.method = options.method;\n  this.origin = options.origin || client.origin;\n  this.query = options.query || {};\n  this.params = options.params || {};\n  this.body = options.body || null;\n  this.file = options.file || null;\n  this.headers = headers;\n}\n\n/**\n * Get the URL of the request.\n *\n * @param {string} [accessToken] - By default, the access token of the request's\n *   client is used.\n * @return {string}\n */\nMapiRequest.prototype.url = function url(accessToken) {\n  var url = urlUtils.prependOrigin(this.path, this.origin);\n  url = urlUtils.appendQueryObject(url, this.query);\n  var routeParams = this.params;\n  if (accessToken) {\n    url = urlUtils.appendQueryParam(url, 'access_token', accessToken);\n    var accessTokenOwnerId = parseToken(accessToken).user;\n    routeParams = xtend({ ownerId: accessTokenOwnerId }, routeParams);\n  }\n  url = urlUtils.interpolateRouteParams(url, routeParams);\n  return url;\n};\n\n/**\n * Send the request. Returns a Promise that resolves with a `MapiResponse`.\n * You probably want to use `response.body`.\n *\n * `send` only retrieves the first page of paginated results. You can get\n * the next page by using the `MapiResponse`'s [`nextPage`](#nextpage)\n * function, or iterate through all pages using [`eachPage`](#eachpage)\n * instead of `send`.\n *\n * @returns {Promise<MapiResponse>}\n */\nMapiRequest.prototype.send = function send() {\n  var self = this;\n\n  if (self.sent) {\n    throw new Error(\n      'This request has already been sent. Check the response and error properties. Create a new request with clone().'\n    );\n  }\n  self.sent = true;\n\n  return self.client.sendRequest(self).then(\n    function(response) {\n      self.response = response;\n      self.emitter.emit(constants.EVENT_RESPONSE, response);\n      return response;\n    },\n    function(error) {\n      self.error = error;\n      self.emitter.emit(constants.EVENT_ERROR, error);\n      throw error;\n    }\n  );\n};\n\n/**\n * Abort the request.\n *\n * Any pending `Promise` returned by [`send`](#send) will be rejected with\n * an error with `type: 'RequestAbortedError'`. If you've created a request\n * that might be aborted, you need to catch and handle such errors.\n *\n * This method will also abort any requests created while fetching subsequent\n * pages via [`eachPage`](#eachpage).\n *\n * If the request has not been sent or has already been aborted, nothing\n * will happen.\n */\nMapiRequest.prototype.abort = function abort() {\n  if (this._nextPageRequest) {\n    this._nextPageRequest.abort();\n    delete this._nextPageRequest;\n  }\n\n  if (this.response || this.error || this.aborted) return;\n\n  this.aborted = true;\n  this.client.abortRequest(this);\n};\n\n/**\n * Invoke a callback for each page of a paginated API response.\n *\n * The callback should have the following signature:\n *\n * ```js\n * (\n *   error: MapiError,\n *   response: MapiResponse,\n *   next: () => void\n * ) => void\n * ```\n *\n * **The next page will not be fetched until you've invoked the\n * `next` callback**, indicating that you're ready for it.\n *\n * @param {Function} callback\n */\nMapiRequest.prototype.eachPage = function eachPage(callback) {\n  var self = this;\n\n  function handleResponse(response) {\n    function getNextPage() {\n      delete self._nextPageRequest;\n      var nextPageRequest = response.nextPage();\n      if (nextPageRequest) {\n        self._nextPageRequest = nextPageRequest;\n        getPage(nextPageRequest);\n      }\n    }\n    callback(null, response, getNextPage);\n  }\n\n  function handleError(error) {\n    callback(error, null, function() {});\n  }\n\n  function getPage(request) {\n    request.send().then(handleResponse, handleError);\n  }\n  getPage(this);\n};\n\n/**\n * Clone this request.\n *\n * Each request can only be sent *once*. So if you'd like to send the\n * same request again, clone it and send away.\n *\n * @returns {MapiRequest} - A new `MapiRequest` configured just like this one.\n */\nMapiRequest.prototype.clone = function clone() {\n  return this._extend();\n};\n\n/**\n * @ignore\n */\nMapiRequest.prototype._extend = function _extend(options) {\n  var extendedOptions = xtend(this._options, options);\n  return new MapiRequest(this.client, extendedOptions);\n};\n\nmodule.exports = MapiRequest;\n","'use strict';\n\nvar parseToken = require('@mapbox/parse-mapbox-token');\nvar MapiRequest = require('./mapi-request');\nvar constants = require('../constants');\n\n/**\n * A low-level Mapbox API client. Use it to create service clients\n * that share the same configuration.\n *\n * Services and `MapiRequest`s use the underlying `MapiClient` to\n * determine how to create, send, and abort requests in a way\n * that is appropriate to the configuration and environment\n * (Node or the browser).\n *\n * @class MapiClient\n * @property {string} accessToken - The Mapbox access token assigned\n *   to this client.\n * @property {string} [origin] - The origin\n *   to use for API requests. Defaults to https://api.mapbox.com.\n */\n\nfunction MapiClient(options) {\n  if (!options || !options.accessToken) {\n    throw new Error('Cannot create a client without an access token');\n  }\n  // Try parsing the access token to determine right away if it's valid.\n  parseToken(options.accessToken);\n\n  this.accessToken = options.accessToken;\n  this.origin = options.origin || constants.API_ORIGIN;\n}\n\nMapiClient.prototype.createRequest = function createRequest(requestOptions) {\n  return new MapiRequest(this, requestOptions);\n};\n\nmodule.exports = MapiClient;\n","'use strict';\n\nvar browser = require('./browser-layer');\nvar MapiClient = require('../classes/mapi-client');\n\nfunction BrowserClient(options) {\n  MapiClient.call(this, options);\n}\nBrowserClient.prototype = Object.create(MapiClient.prototype);\nBrowserClient.prototype.constructor = BrowserClient;\n\nBrowserClient.prototype.sendRequest = browser.browserSend;\nBrowserClient.prototype.abortRequest = browser.browserAbort;\n\n/**\n * Create a client for the browser.\n *\n * @param {Object} options\n * @param {string} options.accessToken\n * @param {string} [options.origin]\n * @returns {MapiClient}\n */\nfunction createBrowserClient(options) {\n  return new BrowserClient(options);\n}\n\nmodule.exports = createBrowserClient;\n","'use strict';\n\nfunction parseSingleHeader(raw) {\n  var boundary = raw.indexOf(':');\n  var name = raw\n    .substring(0, boundary)\n    .trim()\n    .toLowerCase();\n  var value = raw.substring(boundary + 1).trim();\n  return {\n    name: name,\n    value: value\n  };\n}\n\n/**\n * Parse raw headers into an object with lowercase properties.\n * Does not fully parse headings into more complete data structure,\n * as larger libraries might do. Also does not deal with duplicate\n * headers because Node doesn't seem to deal with those well, so\n * we shouldn't let the browser either, for consistency.\n *\n * @param {string} raw\n * @returns {Object}\n */\nfunction parseHeaders(raw) {\n  var headers = {};\n  if (!raw) {\n    return headers;\n  }\n\n  raw\n    .trim()\n    .split(/[\\r|\\n]+/)\n    .forEach(function(rawHeader) {\n      var parsed = parseSingleHeader(rawHeader);\n      headers[parsed.name] = parsed.value;\n    });\n\n  return headers;\n}\n\nmodule.exports = parseHeaders;\n","'use strict';\n\nvar client = require('./lib/client');\n\nmodule.exports = client;\n","'use strict';\nvar toString = Object.prototype.toString;\n\nmodule.exports = function (x) {\n\tvar prototype;\n\treturn toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));\n};\n","'use strict';\n/**\n * Validators are functions which assert certain type.\n * They can return a string which can then be used\n * to display a helpful error message.\n * They can also return a function for a custom error message.\n */\nvar isPlainObject = require('is-plain-obj');\nvar xtend = require('xtend');\n\nvar DEFAULT_ERROR_PATH = 'value';\nvar NEWLINE_INDENT = '\\n  ';\n\nvar v = {};\n\n/**\n * Runners\n *\n * Take root validators and run assertion\n */\nv.assert = function(rootValidator, options) {\n  options = options || {};\n  return function(value) {\n    var message = validate(rootValidator, value);\n    // all good\n    if (!message) {\n      return;\n    }\n\n    var errorMessage = processMessage(message, options);\n\n    if (options.apiName) {\n      errorMessage = options.apiName + ': ' + errorMessage;\n    }\n\n    throw new Error(errorMessage);\n  };\n};\n\n/**\n * Higher Order Validators\n *\n * validators which take other validators as input\n * and output a new validator\n */\nv.shape = function shape(validatorObj) {\n  var validators = objectEntries(validatorObj);\n  return function shapeValidator(value) {\n    var validationResult = validate(v.plainObject, value);\n\n    if (validationResult) {\n      return validationResult;\n    }\n\n    var key, validator;\n    var errorMessages = [];\n\n    for (var i = 0; i < validators.length; i++) {\n      key = validators[i].key;\n      validator = validators[i].value;\n      validationResult = validate(validator, value[key]);\n\n      if (validationResult) {\n        // return [key].concat(validationResult);\n        errorMessages.push([key].concat(validationResult));\n      }\n    }\n\n    if (errorMessages.length < 2) {\n      return errorMessages[0];\n    }\n\n    // enumerate all the error messages\n    return function(options) {\n      errorMessages = errorMessages.map(function(message) {\n        var key = message[0];\n        var renderedMessage = processMessage(message, options)\n          .split('\\n')\n          .join(NEWLINE_INDENT); // indents any inner nesting\n        return '- ' + key + ': ' + renderedMessage;\n      });\n\n      var objectId = options.path.join('.');\n      var ofPhrase = objectId === DEFAULT_ERROR_PATH ? '' : ' of ' + objectId;\n\n      return (\n        'The following properties' +\n        ofPhrase +\n        ' have invalid values:' +\n        NEWLINE_INDENT +\n        errorMessages.join(NEWLINE_INDENT)\n      );\n    };\n  };\n};\n\nv.strictShape = function strictShape(validatorObj) {\n  var shapeValidator = v.shape(validatorObj);\n  return function strictShapeValidator(value) {\n    var shapeResult = shapeValidator(value);\n    if (shapeResult) {\n      return shapeResult;\n    }\n\n    var invalidKeys = Object.keys(value).reduce(function(memo, valueKey) {\n      if (validatorObj[valueKey] === undefined) {\n        memo.push(valueKey);\n      }\n      return memo;\n    }, []);\n\n    if (invalidKeys.length !== 0) {\n      return function() {\n        return 'The following keys are invalid: ' + invalidKeys.join(', ');\n      };\n    }\n  };\n};\n\nv.arrayOf = function arrayOf(validator) {\n  return createArrayValidator(validator);\n};\n\nv.tuple = function tuple() {\n  var validators = Array.isArray(arguments[0])\n    ? arguments[0]\n    : Array.prototype.slice.call(arguments);\n  return createArrayValidator(validators);\n};\n\n// Currently array validation fails when the first invalid item is found.\nfunction createArrayValidator(validators) {\n  var validatingTuple = Array.isArray(validators);\n  var getValidator = function(index) {\n    if (validatingTuple) {\n      return validators[index];\n    }\n    return validators;\n  };\n\n  return function arrayValidator(value) {\n    var validationResult = validate(v.plainArray, value);\n    if (validationResult) {\n      return validationResult;\n    }\n\n    if (validatingTuple && value.length !== validators.length) {\n      return 'an array with ' + validators.length + ' items';\n    }\n\n    for (var i = 0; i < value.length; i++) {\n      validationResult = validate(getValidator(i), value[i]);\n      if (validationResult) {\n        return [i].concat(validationResult);\n      }\n    }\n  };\n}\n\nv.required = function required(validator) {\n  function requiredValidator(value) {\n    if (value == null) {\n      return function(options) {\n        return formatErrorMessage(\n          options,\n          isArrayCulprit(options.path)\n            ? 'cannot be undefined/null.'\n            : 'is required.'\n        );\n      };\n    }\n    return validator.apply(this, arguments);\n  }\n  requiredValidator.__required = true;\n\n  return requiredValidator;\n};\n\nv.oneOfType = function oneOfType() {\n  var validators = Array.isArray(arguments[0])\n    ? arguments[0]\n    : Array.prototype.slice.call(arguments);\n  return function oneOfTypeValidator(value) {\n    var messages = validators\n      .map(function(validator) {\n        return validate(validator, value);\n      })\n      .filter(Boolean);\n\n    // If we don't have as many messages as no. of validators,\n    // then at least one validator was ok with the value.\n    if (messages.length !== validators.length) {\n      return;\n    }\n\n    // check primitive type\n    if (\n      messages.every(function(message) {\n        return message.length === 1 && typeof message[0] === 'string';\n      })\n    ) {\n      return orList(\n        messages.map(function(m) {\n          return m[0];\n        })\n      );\n    }\n\n    // Complex oneOfTypes like\n    // `v.oneOftypes(v.shape({name: v.string})`, `v.shape({name: v.number}))`\n    // are complex ¯\\_(ツ)_/¯. For the current scope only returning the longest message.\n    return messages.reduce(function(max, arr) {\n      return arr.length > max.length ? arr : max;\n    });\n  };\n};\n\n/**\n * Meta Validators\n * which take options as argument (not validators)\n * and return a new primitive validator\n */\nv.equal = function equal(compareWith) {\n  return function equalValidator(value) {\n    if (value !== compareWith) {\n      return JSON.stringify(compareWith);\n    }\n  };\n};\n\nv.oneOf = function oneOf() {\n  var options = Array.isArray(arguments[0])\n    ? arguments[0]\n    : Array.prototype.slice.call(arguments);\n  var validators = options.map(function(value) {\n    return v.equal(value);\n  });\n\n  return v.oneOfType.apply(this, validators);\n};\n\nv.range = function range(compareWith) {\n  var min = compareWith[0];\n  var max = compareWith[1];\n  return function rangeValidator(value) {\n    var validationResult = validate(v.number, value);\n\n    if (validationResult || value < min || value > max) {\n      return 'number between ' + min + ' & ' + max + ' (inclusive)';\n    }\n  };\n};\n\n/**\n * Primitive validators\n *\n * simple validators which return a string or undefined\n */\nv.any = function any() {\n  return;\n};\n\nv.boolean = function boolean(value) {\n  if (typeof value !== 'boolean') {\n    return 'boolean';\n  }\n};\n\nv.number = function number(value) {\n  if (typeof value !== 'number') {\n    return 'number';\n  }\n};\n\nv.plainArray = function plainArray(value) {\n  if (!Array.isArray(value)) {\n    return 'array';\n  }\n};\n\nv.plainObject = function plainObject(value) {\n  if (!isPlainObject(value)) {\n    return 'object';\n  }\n};\n\nv.string = function string(value) {\n  if (typeof value !== 'string') {\n    return 'string';\n  }\n};\n\nv.func = function func(value) {\n  if (typeof value !== 'function') {\n    return 'function';\n  }\n};\n\nfunction validate(validator, value) {\n  // assertions are optional by default unless wrapped in v.require\n  if (value == null && !validator.hasOwnProperty('__required')) {\n    return;\n  }\n\n  var result = validator(value);\n\n  if (result) {\n    return Array.isArray(result) ? result : [result];\n  }\n}\n\nfunction processMessage(message, options) {\n  // message array follows the convention\n  // [...path, result]\n  // path is an array of object keys / array indices\n  // result is output of the validator\n  var len = message.length;\n\n  var result = message[len - 1];\n  var path = message.slice(0, len - 1);\n\n  if (path.length === 0) {\n    path = [DEFAULT_ERROR_PATH];\n  }\n  options = xtend(options, { path: path });\n\n  return typeof result === 'function'\n    ? result(options) // allows customization of result\n    : formatErrorMessage(options, prettifyResult(result));\n}\n\nfunction orList(list) {\n  if (list.length < 2) {\n    return list[0];\n  }\n  if (list.length === 2) {\n    return list.join(' or ');\n  }\n  return list.slice(0, -1).join(', ') + ', or ' + list.slice(-1);\n}\n\nfunction prettifyResult(result) {\n  return 'must be ' + addArticle(result) + '.';\n}\n\nfunction addArticle(nounPhrase) {\n  if (/^an? /.test(nounPhrase)) {\n    return nounPhrase;\n  }\n  if (/^[aeiou]/i.test(nounPhrase)) {\n    return 'an ' + nounPhrase;\n  }\n  if (/^[a-z]/i.test(nounPhrase)) {\n    return 'a ' + nounPhrase;\n  }\n  return nounPhrase;\n}\n\nfunction formatErrorMessage(options, prettyResult) {\n  var arrayCulprit = isArrayCulprit(options.path);\n  var output = options.path.join('.') + ' ' + prettyResult;\n  var prepend = arrayCulprit ? 'Item at position ' : '';\n\n  return prepend + output;\n}\n\nfunction isArrayCulprit(path) {\n  return typeof path[path.length - 1] == 'number' || typeof path[0] == 'number';\n}\n\nfunction objectEntries(obj) {\n  return Object.keys(obj || {}).map(function(key) {\n    return { key: key, value: obj[key] };\n  });\n}\n\nv.validate = validate;\nv.processMessage = processMessage;\n\nmodule.exports = v;\n","'use strict';\n\nvar xtend = require('xtend');\nvar v = require('@mapbox/fusspot');\n\nfunction file(value) {\n  // If we're in a browser so Blob is available, the file must be that.\n  // In Node, however, it could be a filepath or a pipeable (Readable) stream.\n  if (typeof window !== 'undefined') {\n    if (value instanceof global.Blob || value instanceof global.ArrayBuffer) {\n      return;\n    }\n    return 'Blob or ArrayBuffer';\n  }\n  if (typeof value === 'string' || value.pipe !== undefined) {\n    return;\n  }\n  return 'Filename or Readable stream';\n}\n\nfunction assertShape(validatorObj, apiName) {\n  return v.assert(v.strictShape(validatorObj), apiName);\n}\n\nfunction date(value) {\n  var msg = 'date';\n  if (typeof value === 'boolean') {\n    return msg;\n  }\n  try {\n    var date = new Date(value);\n    if (date.getTime && isNaN(date.getTime())) {\n      return msg;\n    }\n  } catch (e) {\n    return msg;\n  }\n}\n\nfunction coordinates(value) {\n  return v.tuple(v.number, v.number)(value);\n}\n\nmodule.exports = xtend(v, {\n  file: file,\n  date: date,\n  coordinates: coordinates,\n  assertShape: assertShape\n});\n","'use strict';\n\n/**\n * Create a new object by picking properties off an existing object.\n * The second param can be overloaded as a callback for\n * more fine grained picking of properties.\n * @param {Object} source\n * @param {Array<string>|function(string, Object):boolean} keys\n * @returns {Object}\n */\nfunction pick(source, keys) {\n  var filter = function(key, val) {\n    return keys.indexOf(key) !== -1 && val !== undefined;\n  };\n\n  if (typeof keys === 'function') {\n    filter = keys;\n  }\n\n  return Object.keys(source)\n    .filter(function(key) {\n      return filter(key, source[key]);\n    })\n    .reduce(function(result, key) {\n      result[key] = source[key];\n      return result;\n    }, {});\n}\n\nmodule.exports = pick;\n","'use strict';\n\nvar objectMap = require('./object-map');\n\n/**\n * Stringify all the boolean values in an object, so true becomes \"true\".\n *\n * @param {Object} obj\n * @returns {Object}\n */\nfunction stringifyBoolean(obj) {\n  return objectMap(obj, function(_, value) {\n    return typeof value === 'boolean' ? JSON.stringify(value) : value;\n  });\n}\n\nmodule.exports = stringifyBoolean;\n","'use strict';\n\nfunction objectMap(obj, cb) {\n  return Object.keys(obj).reduce(function(result, key) {\n    result[key] = cb(key, obj[key]);\n    return result;\n  }, {});\n}\n\nmodule.exports = objectMap;\n","'use strict';\n\nvar xtend = require('xtend');\nvar v = require('./service-helpers/validator');\nvar pick = require('./service-helpers/pick');\nvar stringifyBooleans = require('./service-helpers/stringify-booleans');\nvar createServiceFactory = require('./service-helpers/create-service-factory');\n\n/**\n * Geocoding API service.\n *\n * Learn more about this service and its responses in\n * [the HTTP service documentation](https://www.mapbox.com/api-documentation/#geocoding).\n */\nvar Geocoding = {};\n\nvar featureTypes = [\n  'country',\n  'region',\n  'postcode',\n  'district',\n  'place',\n  'locality',\n  'neighborhood',\n  'address',\n  'poi',\n  'poi.landmark'\n];\n\n/**\n * Search for a place.\n *\n * See the [public documentation](https://www.mapbox.com/api-documentation/#search-for-places).\n *\n * @param {Object} config\n * @param {string} config.query - A place name.\n * @param {'mapbox.places'|'mapbox.places-permanent'} [config.mode=\"mapbox.places\"] - Either `mapbox.places` for ephemeral geocoding, or `mapbox.places-permanent` for storing results and batch geocoding.\n * @param {Array<string>} [config.countries] - Limits results to the specified countries.\n *   Each item in the array should be an [ISO 3166 alpha 2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).\n * @param {Coordinates} [config.proximity] - Bias local results based on a provided location.\n * @param {Array<'country'|'region'|'postcode'|'district'|'place'|'locality'|'neighborhood'|'address'|'poi'|'poi.landmark'>} [config.types] - Filter results by feature types.\n * @param {boolean} [config.autocomplete=true] - Return autocomplete results or not.\n * @param {BoundingBox} [config.bbox] - Limit results to a bounding box.\n * @param {number} [config.limit=5] - Limit the number of results returned.\n * @param {Array<string>} [config.language] - Specify the language to use for response text and, for forward geocoding, query result weighting.\n *  Options are [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) comprised of a mandatory\n *  [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and optionally one or more IETF subtags for country or script.\n * @return {MapiRequest}\n */\nGeocoding.forwardGeocode = function(config) {\n  v.assertShape({\n    query: v.required(v.string),\n    mode: v.oneOf('mapbox.places', 'mapbox.places-permanent'),\n    countries: v.arrayOf(v.string),\n    proximity: v.coordinates,\n    types: v.arrayOf(v.oneOf(featureTypes)),\n    autocomplete: v.boolean,\n    bbox: v.arrayOf(v.number),\n    limit: v.number,\n    language: v.arrayOf(v.string)\n  })(config);\n\n  config.mode = config.mode || 'mapbox.places';\n\n  var query = stringifyBooleans(\n    xtend(\n      { country: config.countries },\n      pick(config, [\n        'proximity',\n        'types',\n        'autocomplete',\n        'bbox',\n        'limit',\n        'language'\n      ])\n    )\n  );\n\n  return this.client.createRequest({\n    method: 'GET',\n    path: '/geocoding/v5/:mode/:query.json',\n    params: pick(config, ['mode', 'query']),\n    query: query\n  });\n};\n\n/**\n * Search for places near coordinates.\n *\n * See the [public documentation](https://www.mapbox.com/api-documentation/#retrieve-places-near-a-location).\n *\n * @param {Object} config\n * @param {Coordinates} config.query - Coordinates at which features will be searched.\n * @param {'mapbox.places'|'mapbox.places-permanent'} [config.mode=\"mapbox.places\"] - Either `mapbox.places` for ephemeral geocoding, or `mapbox.places-permanent` for storing results and batch geocoding.\n * @param {Array<string>} [config.countries] - Limits results to the specified countries.\n *   Each item in the array should be an [ISO 3166 alpha 2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).\n * @param {Array<'country'|'region'|'postcode'|'district'|'place'|'locality'|'neighborhood'|'address'|'poi'|'poi.landmark'>} [config.types] - Filter results by feature types.\n * @param {BoundingBox} [config.bbox] - Limit results to a bounding box.\n * @param {number} [config.limit=1] - Limit the number of results returned. If using this option, you must provide a single item for `types`.\n * @param {Array<string>} [config.language] - Specify the language to use for response text and, for forward geocoding, query result weighting.\n *  Options are [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) comprised of a mandatory\n *  [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and optionally one or more IETF subtags for country or script.\n * @param {'distance'|'score'} [config.reverseMode='distance'] - Set the factors that are used to sort nearby results.\n * @return {MapiRequest}\n */\nGeocoding.reverseGeocode = function(config) {\n  v.assertShape({\n    query: v.required(v.coordinates),\n    mode: v.oneOf('mapbox.places', 'mapbox.places-permanent'),\n    countries: v.arrayOf(v.string),\n    types: v.arrayOf(v.oneOf(featureTypes)),\n    bbox: v.arrayOf(v.number),\n    limit: v.number,\n    language: v.arrayOf(v.string),\n    reverseMode: v.oneOf('distance', 'score')\n  })(config);\n\n  config.mode = config.mode || 'mapbox.places';\n\n  var query = stringifyBooleans(\n    xtend(\n      { country: config.countries },\n      pick(config, [\n        'country',\n        'types',\n        'bbox',\n        'limit',\n        'language',\n        'reverseMode'\n      ])\n    )\n  );\n\n  return this.client.createRequest({\n    method: 'GET',\n    path: '/geocoding/v5/:mode/:query.json',\n    params: pick(config, ['mode', 'query']),\n    query: query\n  });\n};\n\nmodule.exports = createServiceFactory(Geocoding);\n","'use strict';\n\nvar MapiClient = require('../../lib/classes/mapi-client');\n// This will create the environment-appropriate client.\nvar createClient = require('../../lib/client');\n\nfunction createServiceFactory(ServicePrototype) {\n  return function(clientOrConfig) {\n    var client;\n    if (MapiClient.prototype.isPrototypeOf(clientOrConfig)) {\n      client = clientOrConfig;\n    } else {\n      client = createClient(clientOrConfig);\n    }\n    var service = Object.create(ServicePrototype);\n    service.client = client;\n    return service;\n  };\n}\n\nmodule.exports = createServiceFactory;\n","if (process.env.NODE_ENV !== 'production') {\n  if (typeof self === 'undefined' || (!self.crypto && !self.msCrypto)) {\n    throw new Error(\n      'Your browser does not have secure random generator. ' +\n      'If you don’t need unpredictable IDs, you can use nanoid/non-secure.'\n    )\n  }\n}\n\nvar crypto = self.crypto || self.msCrypto\n\n/*\n * This alphabet uses a-z A-Z 0-9 _- symbols.\n * Symbols order was changed for better gzip compression.\n */\nvar url = 'Uint8ArdomValuesObj012345679BCDEFGHIJKLMNPQRSTWXYZ_cfghkpqvwxyz-'\n\nmodule.exports = function (size) {\n  size = size || 21\n  var id = ''\n  var bytes = crypto.getRandomValues(new Uint8Array(size))\n  while (0 < size--) {\n    id += url[bytes[size] & 63]\n  }\n  return id\n}\n","'use strict';\nvar nanoid = require('nanoid')\n\n/**\n * Construct a new mapbox event client to send interaction events to the mapbox event service\n * @param {Object} options options with which to create the service\n * @param {String} options.accessToken the mapbox access token to make requests\n * @param {Number} [options.flushInterval=1000] the number of ms after which to flush the event queue\n * @param {Number} [options.maxQueueSize=100] the number of events to queue before flushing\n * @private\n */\nfunction MapboxEventManager(options) {\n  this.origin = options.origin || 'https://api.mapbox.com';\n  this.endpoint = 'events/v2';\n  this.access_token = options.accessToken;\n  this.version = '0.2.0'\n  this.sessionID = this.generateSessionID();\n  this.userAgent = this.getUserAgent();\n\n  this.options = options;\n  this.send = this.send.bind(this);\n\n\n  // parse global options to be sent with each request\n  this.countries = (options.countries) ? options.countries.split(\",\") : null;\n  this.types = (options.types) ? options.types.split(\",\") : null;\n  this.bbox = (options.bbox) ? options.bbox : null;\n  this.language = (options.language) ? options.language.split(\",\") : null;\n  this.limit = (options.limit) ? +options.limit : null;\n  this.locale = navigator.language || null;\n  this.enableEventLogging = this.shouldEnableLogging(options);\n  this.eventQueue = new Array();\n  this.flushInterval = options.flushInterval || 1000;\n  this.maxQueueSize = options.maxQueueSize || 100;\n  this.timer = (this.flushInterval) ? setTimeout(this.flush.bind(this), this.flushInterval) : null;\n  // keep some state to deduplicate requests if necessary\n  this.lastSentInput = \"\";\n  this.lastSentIndex = 0;\n}\n\nMapboxEventManager.prototype = {\n  /**\n     * Send a search.select event to the mapbox events service\n     * This event marks the array index of the item selected by the user out of the array of possible options\n     * @private\n     * @param {Object} selected the geojson feature selected by the user\n     * @param {Object} geocoder a mapbox-gl-geocoder instance\n     * @returns {Promise}\n     */\n  select: function(selected, geocoder){\n    var resultIndex = this.getSelectedIndex(selected, geocoder);\n    var payload = this.getEventPayload('search.select', geocoder);\n    payload.resultIndex = resultIndex;\n    payload.resultPlaceName  = selected.place_name;\n    payload.resultId = selected.id;\n    if ((resultIndex === this.lastSentIndex && payload.queryString === this.lastSentInput) || resultIndex == -1) {\n      // don't log duplicate events if the user re-selected the same feature on the same search\n      return;\n    }\n    this.lastSentIndex = resultIndex;\n    this.lastSentInput = payload.queryString;\n    if (!payload.queryString) return; // will be rejected\n    return this.push(payload)\n  },\n\n  /**\n     * Send a search-start event to the mapbox events service\n     * This turnstile event marks when a user starts a new search\n     * @private\n     * @param {Object} geocoder a mapbox-gl-geocoder instance\n     * @returns {Promise}\n     */\n  start: function(geocoder){\n    var payload = this.getEventPayload('search.start', geocoder);\n    if (!payload.queryString) return; // will be rejected\n    return this.push(payload);\n  },\n\n  /**\n   * Send a search-keyevent event to the mapbox events service\n   * This event records each keypress in sequence\n   * @private\n   * @param {Object} keyEvent the keydown event to log\n   * @param {Obeject} geocoder a mapbox-gl-geocoder instance\n   * \n   */\n  keyevent: function(keyEvent, geocoder){\n    //pass invalid event\n    if (!keyEvent.key) return;\n    // don't send events for keys that don't change the input\n    // TAB, ESC, LEFT, RIGHT, ENTER, UP, DOWN\n    if (keyEvent.metaKey || [9, 27, 37, 39, 13, 38, 40].indexOf(keyEvent.keyCode) !== -1) return;\n    var payload = this.getEventPayload('search.keystroke', geocoder);\n    payload.lastAction = keyEvent.key;\n    if (!payload.queryString) return; // will be rejected\n    return this.push(payload);\n  },\n\n  /**\n   * Send an event to the events service\n   *\n   * The event is skipped if the instance is not enabled to send logging events\n   *\n   * @private\n   * @param {Object} payload the http POST body of the event\n   * @param {Function} [callback] a callback function to invoke when the send has completed\n   * @returns {Promise}\n   */\n  send: function (payload, callback) {\n    if (!this.enableEventLogging) {\n      if (callback) return callback();\n      return;\n    }\n    var options = this.getRequestOptions(payload);\n    this.request(options, function(err){\n      if (err) return this.handleError(err, callback);\n      if (callback) {\n        return callback();\n      }\n    }.bind(this))\n  },\n  /**\n   * Get http request options\n   * @private\n   * @param {*} payload\n   */\n  getRequestOptions: function(payload){\n    if (!Array.isArray(payload)) payload = [payload];\n    var options = {\n      // events must be sent with POST\n      method: \"POST\",\n      host: this.origin,\n      path: this.endpoint +  \"?access_token=\" + this.access_token,\n      headers: {\n        'Content-Type': 'application/json'\n      },\n      body:JSON.stringify(payload) //events are arrays\n    }\n    return options\n  },\n\n  /**\n   * Get the event payload to send to the events service\n   * Most payload properties are shared across all events\n   * @private\n   * @param {String} event the name of the event to send to the events service. Valid options are 'search.start', 'search.select', 'search.feedback'.\n   * @param {Object} geocoder a mapbox-gl-geocoder instance\n   * @returns {Object} an event payload\n   */\n  getEventPayload: function (event, geocoder) {\n    var proximity;\n    if (!geocoder.options.proximity) proximity = null;\n    else proximity = [geocoder.options.proximity.longitude, geocoder.options.proximity.latitude];\n\n    var zoom = (geocoder._map) ? geocoder._map.getZoom() : null;\n    var payload = {\n      event: event,\n      created: +new Date(),\n      sessionIdentifier: this.sessionID,\n      country: this.countries,\n      userAgent: this.userAgent,\n      language: this.language,\n      bbox: this.bbox,\n      types: this.types,\n      endpoint: 'mapbox.places',\n      // fuzzyMatch: search.fuzzy, //todo  --> add to plugin\n      proximity: proximity,\n      limit: geocoder.options.limit,\n      // routing: search.routing, //todo --> add to plugin\n      mapZoom: zoom,\n      keyboardLocale: this.locale\n    }\n\n    // get the text in the search bar\n    if (event === \"search.select\"){\n      payload.queryString = geocoder.inputString;\n    }else if (event != \"search.select\" && geocoder._inputEl){\n      payload.queryString = geocoder._inputEl.value;\n    }else{\n      payload.queryString = geocoder.inputString;\n    }\n    return payload;\n  },\n\n  /**\n   * Wraps the request function for easier testing\n   * Make an http request and invoke a callback\n   * @private\n   * @param {Object} opts options describing the http request to be made\n   * @param {Function} callback the callback to invoke when the http request is completed\n   */\n  request: function (opts, callback) {\n    var xhttp = new XMLHttpRequest();\n    xhttp.onreadystatechange = function() {\n      if (this.readyState == 4 ) {\n        if (this.status == 204){\n          //success\n          return callback(null);\n        }else {\n          return callback(this.statusText);\n        }\n      }\n    };\n\n    xhttp.open(opts.method, opts.host + '/' + opts.path, true);\n    for (var header in opts.headers){\n      var headerValue = opts.headers[header];\n      xhttp.setRequestHeader(header, headerValue)\n    }\n    xhttp.send(opts.body);\n  },\n\n  /**\n   * Handle an error that occurred while making a request\n   * @param {Object} err an error instance to log\n   * @private\n   */\n  handleError: function (err, callback) {\n    if (callback) return callback(err);\n  },\n\n  /**\n   * Generate a session ID to be returned with all of the searches made by this geocoder instance\n   * ID is random and cannot be tracked across sessions\n   * @private\n   */\n  generateSessionID: function () {\n    return nanoid();\n  },\n\n  /**\n   * Get a user agent string to send with the request to the events service\n   * @private\n   */\n  getUserAgent: function () {\n    return 'mapbox-gl-geocoder.' + this.version + \".\" + navigator.userAgent;\n  },\n\n  /**\n     * Get the 0-based numeric index of the item that the user selected out of the list of options\n     * @private\n     * @param {Object} selected the geojson feature selected by the user\n     * @param {Object} geocoder a Mapbox-GL-Geocoder instance\n     * @returns {Number} the index of the selected result\n     */\n  getSelectedIndex: function(selected, geocoder){\n    if (!geocoder._typeahead) return;\n    var results = geocoder._typeahead.data;\n    var selectedID = selected.id;\n    var resultIDs = results.map(function (feature) {\n      return feature.id;\n    });\n    var selectedIdx = resultIDs.indexOf(selectedID);\n    return selectedIdx;\n  },\n\n  /**\n     * Check whether events should be logged\n     * Clients using a localGeocoder or an origin other than mapbox should not have events logged\n     * @private\n     */\n  shouldEnableLogging: function(options){\n    if (options.enableEventLogging === false) return false;\n    if (options.origin && options.origin.indexOf('api.mapbox.com') == -1) return false;\n    // hard to make sense of events when a local instance is suplementing results from origin\n    if (options.localGeocoder) return false;\n    // hard to make sense of events when a custom filter is in use\n    if (options.filter) return false;\n    return true;\n  },\n\n  /**\n   * Flush out the event queue by sending events to the events service\n   * @private\n   */\n  flush: function(){\n    if (this.eventQueue.length > 0){\n      this.send(this.eventQueue);\n      this.eventQueue = new Array();\n    }\n    // //reset the timer\n    if (this.timer)  clearTimeout(this.timer);\n    if (this.flushInterval) this.timer = setTimeout(this.flush.bind(this), this.flushInterval)\n  },\n\n  /**\n   * Push event into the pending queue\n   * @param {Object} evt the event to send to the events service\n   * @param {Boolean} forceFlush indicates that the event queue should be flushed after adding this event regardless of size of the queue\n   * @private\n   */\n  push: function(evt, forceFlush){\n    this.eventQueue.push(evt);\n    if (this.eventQueue.length >= this.maxQueueSize || forceFlush){\n      this.flush();\n    }\n  },\n\n  /**\n   * Flush any remaining events from the queue before it is removed\n   * @private\n   */\n  remove: function(){\n    this.flush();\n  }\n}\n\n\n\nmodule.exports = MapboxEventManager;\n","'use strict';\n\n/**\n * Localized values for the placeholder string\n * \n * @private\n */\nvar placeholder = {\n    // list drawn from https://docs.mapbox.com/api/search/#language-coverage\n  'de': 'Suche', // german\n  'it': 'Ricerca', //italian\n  'en': 'Search', // english\n  'nl': 'Zoeken', //dutch\n  'fr': 'Chercher',  //french\n  'ca': 'Cerca', //catalan\n  'he': 'לחפש', //hebrew\n  'ja': 'サーチ',  //japanese\n  'lv': 'Meklēt', //latvian\n  'pt': 'Procurar', //portuguese \n  'sr': 'Претрага', //serbian\n  'zh': '搜索', //chinese-simplified\n  'cs': 'Vyhledávání', //czech\n  'hu': 'Keresés', //hungarian\n  'ka': 'ძიება', // georgian\n  'nb': 'Søke', //norwegian\n  'sk': 'Vyhľadávanie', //slovak\n  'th': 'ค้นหา', //thai\n  'fi': 'Hae',//finnish\n  'is': 'Leita',//icelandic\n  'ko': '수색',//korean\n  'pl':  'Szukaj', //polish\n  'sl': 'Iskanje' //slovenian\n}\n\nmodule.exports = {placeholder: placeholder};","!function(root, name, make) {\r\n  if (typeof module != 'undefined' && module.exports) module.exports = make()\r\n  else root[name] = make()\r\n}(this, 'subtag', function() {\r\n\r\n  var empty = ''\r\n  var pattern = /^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/\r\n\r\n  function match(tag) {\r\n    return tag.match(pattern) || []\r\n  }\r\n\r\n  function split(tag) {\r\n    return match(tag).filter(function(v, i) { return v && i })\r\n  }\r\n\r\n  function api(tag) {\r\n    tag = match(tag)\r\n    return {\r\n      language: tag[1] || empty,\r\n      extlang: tag[2] || empty,\r\n      script: tag[3] || empty,\r\n      region: tag[4] || empty\r\n    }\r\n  }\r\n\r\n  function expose(target, key, value) {\r\n    Object.defineProperty(target, key, {\r\n      value: value,\r\n      enumerable: true\r\n    })\r\n  }\r\n\r\n  function part(position, pattern, type) {\r\n    function method(tag) {\r\n      return match(tag)[position] || empty\r\n    }\r\n    expose(method, 'pattern', pattern)\r\n    expose(api, type, method)\r\n  }\r\n\r\n  part(1, /^[a-zA-Z]{2,3}$/, 'language')\r\n  part(2, /^[a-zA-Z]{3}$/, 'extlang')\r\n  part(3, /^[a-zA-Z]{4}$/, 'script')\r\n  part(4, /^[a-zA-Z]{2}$|^[0-9]{3}$/, 'region')\r\n\r\n  expose(api, 'split', split)\r\n\r\n  return api\r\n});\r\n","'use strict';\n\nvar Typeahead = require('suggestions');\nvar debounce = require('lodash.debounce');\nvar extend = require('xtend');\nvar EventEmitter = require('events').EventEmitter;\nvar exceptions = require('./exceptions');\nvar MapboxClient = require('@mapbox/mapbox-sdk');\nvar mbxGeocoder = require('@mapbox/mapbox-sdk/services/geocoding');\nvar MapboxEventManager = require('./events');\nvar localization = require('./localization');\nvar subtag = require('subtag');\n\n/**\n * A geocoder component using Mapbox Geocoding API\n * @class MapboxGeocoder\n * @param {Object} options\n * @param {String} options.accessToken Required.\n * @param {String} options.origin Use to set a custom API origin. Defaults to https://api.mapbox.com.\n * @param {Object} [options.mapboxgl] A [mapbox-gl](https://github.com/mapbox/mapbox-gl-js) instance to use when creating [Markers](https://docs.mapbox.com/mapbox-gl-js/api/#marker). Required if `options.marker` is true.\n * @param {Number} [options.zoom=16] On geocoded result what zoom level should the map animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`.\n * @param {Boolean|Object} [options.flyTo] If false, animating the map to a selected result is disabled. If true, animating the map will use the default animation parameters. If an object, the object will be passed to the map method to specify a custom animation when a result is selected.\n * @param {String} [options.placeholder=\"Search\"] Override the default placeholder attribute value.\n * @param {Object} [options.proximity] a proximity argument: this is\n * a geographical point given as an object with latitude and longitude\n * properties. Search results closer to this point will be given\n * higher priority.\n * @param {Boolean} [options.trackProximity=true] If true, the geocoder proximity will automatically update based on the map view.\n * @param {Boolean} [options.collapsed=false] If true, the geocoder control will collapse until hovered or in focus.\n * @param {Boolean} [options.clearAndBlurOnEsc=false] If true, the geocoder control will clear it's contents and blur when user presses the escape key.\n * @param {Boolean} [options.clearOnBlur=false] If true, the geocoder control will clear its value when the input blurs.\n * @param {Array} [options.bbox] a bounding box argument: this is\n * a bounding box given as an array in the format [minX, minY, maxX, maxY].\n * Search results will be limited to the bounding box.\n * @param {string} [options.countries] a comma separated list of country codes to\n * limit results to specified country or countries.\n * @param {string} [options.types] a comma seperated list of types that filter\n * results to match those specified. See https://docs.mapbox.com/api/search/#data-types\n * for available types.\n * If reverseGeocode is enabled, you should specify one type. If you configure more than one type, the first type will be used.\n * @param {Number} [options.minLength=2] Minimum number of characters to enter before results are shown.\n * @param {Number} [options.limit=5] Maximum number of results to show.\n * @param {string} [options.language] Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas.\n * @param {Function} [options.filter] A function which accepts a Feature in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format to filter out results from the Geocoding API response before they are included in the suggestions list. Return `true` to keep the item, `false` otherwise.\n * @param {Function} [options.localGeocoder] A function accepting the query string which performs local geocoding to supplement results from the Mapbox Geocoding API. Expected to return an Array of GeoJSON Features in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format.\n * @param {'distance'|'score'} [options.reverseMode='distance'] - Set the factors that are used to sort nearby results.\n * @param {boolean} [options.reverseGeocode] Enable reverse geocoding. Defaults to false. Expects coordinates to be lat, lon.\n * @param {Boolean} [options.enableEventLogging=true] Allow Mapbox to collect anonymous usage statistics from the plugin\n * @param {Boolean|Object} [options.marker=true]  If `true`, a [Marker](https://docs.mapbox.com/mapbox-gl-js/api/#marker) will be added to the map at the location of the user-selected result using a default set of Marker options.  If the value is an object, the marker will be constructed using these options. If `false`, no marker will be added to the map. Requires that `options.mapboxgl` also be set.\n * @param {Function} [options.render] A function that specifies how the results should be rendered in the dropdown menu. Accepts a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object  as input and return a string. Any html in the returned string will be rendered.\n * @param {Function} [options.getItemValue] A function that specifies how the selected result should be rendered in the search bar. This function should accept a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object  as input and return a string. HTML tags in the output string will not be rendered.\n * @example\n * var geocoder = new MapboxGeocoder({ accessToken: mapboxgl.accessToken });\n * map.addControl(geocoder);\n * @return {MapboxGeocoder} `this`\n *\n */\n\nfunction MapboxGeocoder(options) {\n  this._eventEmitter = new EventEmitter();\n  this.options = extend({}, this.options, options);\n  this.inputString = '';\n  this.fresh = true;\n  this.lastSelected = null;\n}\n\nMapboxGeocoder.prototype = {\n  options: {\n    zoom: 16,\n    flyTo: true,\n    trackProximity: true,\n    minLength: 2,\n    reverseGeocode: false,\n    limit: 5,\n    origin: 'https://api.mapbox.com',\n    enableEventLogging: true,\n    marker: true,\n    mapboxgl: null,\n    collapsed: false,\n    clearAndBlurOnEsc: false,\n    clearOnBlur: false,\n    getItemValue: function(item) {\n      return item.place_name\n    },\n    render: function(item) {\n      var placeName = item.place_name.split(',');\n      return '<div class=\"mapboxgl-ctrl-geocoder--suggestion\"><div class=\"mapboxgl-ctrl-geocoder--suggestion-title\">' + placeName[0]+ '</div><div class=\"mapboxgl-ctrl-geocoder--suggestion-address\">' + placeName.splice(1, placeName.length).join(',') + '</div></div>';\n    }\n  },\n\n  onAdd: function(map) {\n    this._map = map;\n\n    this.setLanguage();\n\n    this.geocoderService = mbxGeocoder(\n      MapboxClient({\n        accessToken: this.options.accessToken,\n        origin: this.options.origin\n      })\n    );\n\n    this.eventManager = new MapboxEventManager(this.options);\n\n    this._onChange = this._onChange.bind(this);\n    this._onKeyDown = this._onKeyDown.bind(this);\n    this._onBlur = this._onBlur.bind(this);\n    this._showButton = this._showButton.bind(this);\n    this._hideButton = this._hideButton.bind(this);\n    this._onQueryResult = this._onQueryResult.bind(this);\n    this.clear = this.clear.bind(this);\n    this._updateProximity = this._updateProximity.bind(this);\n    this._collapse = this._collapse.bind(this);\n    this._unCollapse = this._unCollapse.bind(this);\n    this._clear = this._clear.bind(this);\n    this._clearOnBlur = this._clearOnBlur.bind(this);\n\n    var el = (this.container = document.createElement('div'));\n    el.className = 'mapboxgl-ctrl-geocoder mapboxgl-ctrl';\n\n    var searchIcon = this.createIcon('search', '<path d=\"M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z\"/>')\n\n    this._inputEl = document.createElement('input');\n    this._inputEl.type = 'text';\n    this._inputEl.className = 'mapboxgl-ctrl-geocoder--input';\n\n    this.setPlaceholder();\n\n    if (this.options.collapsed) {\n      this._collapse();\n      this.container.addEventListener('mouseenter', this._unCollapse);\n      this.container.addEventListener('mouseleave', this._collapse);\n      this._inputEl.addEventListener('focus', this._unCollapse);\n    }\n\n    if (this.options.collapsed || this.options.clearOnBlur) {\n      this._inputEl.addEventListener('blur', this._onBlur);\n    }\n\n    this._inputEl.addEventListener('keydown', debounce(this._onKeyDown, 200));\n    this._inputEl.addEventListener('change', this._onChange);\n    this.container.addEventListener('mouseenter', this._showButton);\n    this.container.addEventListener('mouseleave', this._hideButton);\n    this._inputEl.addEventListener('keyup', function(e){\n      this.eventManager.keyevent(e, this);\n    }.bind(this));\n\n    var actions = document.createElement('div');\n    actions.classList.add('mapboxgl-ctrl-geocoder--pin-right');\n\n    this._clearEl = document.createElement('button');\n    this._clearEl.setAttribute('aria-label', 'Clear');\n    this._clearEl.addEventListener('click', this.clear);\n    this._clearEl.className = 'mapboxgl-ctrl-geocoder--button';\n\n    var buttonIcon = this.createIcon('close', '<path d=\"M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z\"/>')\n    this._clearEl.appendChild(buttonIcon);\n\n    this._loadingEl = this.createIcon('loading', '<path fill=\"#333\" d=\"M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z\"/><path opacity=\".1\" d=\"M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z\"/>');\n\n    actions.appendChild(this._clearEl);\n    actions.appendChild(this._loadingEl);\n\n    el.appendChild(searchIcon);\n    el.appendChild(this._inputEl);\n    el.appendChild(actions);\n\n    this._typeahead = new Typeahead(this._inputEl, [], {\n      filter: false,\n      minLength: this.options.minLength,\n      limit: this.options.limit\n    });\n\n    this.setRenderFunction(this.options.render);\n    this._typeahead.getItemValue = this.options.getItemValue;\n\n    if (this.options.trackProximity) {\n      this._updateProximity();\n      this._map.on('moveend', this._updateProximity);\n    }\n\n    this.mapMarker = null;\n    this._handleMarker = this._handleMarker.bind(this);\n\n    this._mapboxgl = this.options.mapboxgl;\n    if (!this._mapboxgl && this.options.marker) {\n      console.error(\"No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl.\");\n      this.options.marker = false;\n    }\n\n    return el;\n  },\n\n  createIcon: function(name, path) {\n    var icon = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n    icon.setAttribute('class', 'mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-' + name);\n    icon.setAttribute('viewBox', '0 0 18 18');\n    icon.setAttribute('xml:space','preserve');\n    icon.setAttribute('width', 18);\n    icon.setAttribute('height', 18);\n    icon.innerHTML = path;\n    return icon;\n  },\n\n  onRemove: function() {\n    this.container.parentNode.removeChild(this.container);\n\n    if (this.options.trackProximity) {\n      this._map.off('moveend', this._updateProximity);\n    }\n\n    this._removeMarker();\n\n    this._map = null;\n\n    return this;\n  },\n\n  _onKeyDown: function(e) {\n    var ESC_KEY_CODE = 27,\n      TAB_KEY_CODE = 9;\n\n    if (e.keyCode === ESC_KEY_CODE && this.options.clearAndBlurOnEsc) {\n      this._clear(e);\n      return this._inputEl.blur();\n    }\n\n    // if target has shadowRoot, then get the actual active element inside the shadowRoot\n    var target = e.target && e.target.shadowRoot\n      ? e.target.shadowRoot.activeElement\n      : e.target;\n    var value = target ? target.value : '';\n    if (!value) {\n      this.fresh = true;\n      // the user has removed all the text\n      if (e.keyCode !== TAB_KEY_CODE) this.clear(e);\n      return (this._clearEl.style.display = 'none');\n    }\n\n    // TAB, ESC, LEFT, RIGHT, ENTER, UP, DOWN\n    if (e.metaKey || [TAB_KEY_CODE, ESC_KEY_CODE, 37, 39, 13, 38, 40].indexOf(e.keyCode) !== -1)\n      return;\n\n    if (target.value.length >= this.options.minLength) {\n      this._geocode(target.value);\n    }\n  },\n\n  _showButton: function() {\n    if (this._typeahead.selected) this._clearEl.style.display = 'block';\n  },\n\n  _hideButton: function() {\n    if (this._typeahead.selected) this._clearEl.style.display = 'none';\n  },\n\n  _onBlur: function(e) {\n    if (this.options.clearOnBlur) {\n      this._clearOnBlur(e);\n    }\n    if (this.options.collapsed) {\n      this._collapse();\n    }\n  },\n  _onChange: function() {\n    var selected = this._typeahead.selected;\n    if (selected  && selected.id !== this.lastSelected) {\n      this._clearEl.style.display = 'none';\n      if (this.options.flyTo) {\n        var flyOptions;\n        if (selected.properties && !exceptions[selected.properties.short_code] && selected.bbox) {\n          var bbox = selected.bbox;\n          flyOptions = extend({}, this.options.flyTo);\n          this._map.fitBounds([[bbox[0], bbox[1]], [bbox[2], bbox[3]]], flyOptions);\n        } else if (selected.properties && exceptions[selected.properties.short_code]) {\n          // Certain geocoder search results return (and therefore zoom to fit)\n          // an unexpectedly large bounding box: for example, both Russia and the\n          // USA span both sides of -180/180, or France includes the island of\n          // Reunion in the Indian Ocean. An incomplete list of these exceptions\n          // at ./exceptions.json provides \"reasonable\" bounding boxes as a\n          // short-term solution; this may be amended as necessary.\n          flyOptions = extend({}, this.options.flyTo);\n          this._map.fitBounds(exceptions[selected.properties.short_code].bbox, flyOptions);\n        } else {\n          var defaultFlyOptions = {\n            zoom: this.options.zoom\n          }\n          flyOptions = extend({}, defaultFlyOptions, this.options.flyTo);\n          //  ensure that center is not overriden by custom options\n          flyOptions.center = selected.center;\n          this._map.flyTo(flyOptions);\n        }\n      }\n      if (this.options.marker && this._mapboxgl){\n        this._handleMarker(selected);\n      }\n\n      // After selecting a feature, re-focus the textarea and set\n      // cursor at start.\n      this._inputEl.focus();\n      this._inputEl.scrollLeft = 0;\n      this._inputEl.setSelectionRange(0, 0);\n\n      this._eventEmitter.emit('result', { result: selected });\n      this.eventManager.select(selected, this);\n      this.lastSelected = selected.id;\n    }\n  },\n\n  _geocode: function(searchInput) {\n    this._loadingEl.style.display = 'block';\n    this._eventEmitter.emit('loading', { query: searchInput });\n    this.inputString = searchInput;\n    // Possible config proprerties to pass to client\n    var keys = [\n      'bbox',\n      'limit',\n      'proximity',\n      'countries',\n      'types',\n      'language',\n      'reverseMode'\n    ];\n    var self = this;\n    // Create config object\n    var config = keys.reduce(function(config, key) {\n      if (self.options[key]) {\n        // countries, types, and language need to be passed in as arrays to client\n        // https://github.com/mapbox/mapbox-sdk-js/blob/master/services/geocoding.js#L38-L47\n        ['countries', 'types', 'language'].indexOf(key) > -1\n          ? (config[key] = self.options[key].split(/[\\s,]+/))\n          : (config[key] = self.options[key]);\n\n        if (key === 'proximity' && self.options[key] && self.options[key].longitude && self.options[key].latitude) {\n          config[key] = [self.options[key].longitude, self.options[key].latitude]\n        }\n      }\n      return config;\n    }, {});\n\n    var request;\n    // check if searchInput resembles coordinates, and if it does,\n    // make the request a reverseGeocode\n    if (\n      this.options.reverseGeocode &&\n      /(-?\\d+\\.?\\d*)[, ]+(-?\\d+\\.?\\d*)[ ]*$/.test(searchInput)\n    ) {\n      // parse coordinates\n      var coords = searchInput.split(/[\\s(,)?]+/).map(function(c) {\n        return parseFloat(c, 10);\n      }).reverse();\n\n      // client only accepts one type for reverseGeocode, so\n      // use first config type if one, if not default to poi\n      config.types ? [config.types[0]] : [\"poi\"];\n      config = extend(config, { query: coords, limit: 1 });\n      request = this.geocoderService.reverseGeocode(config).send();\n    } else {\n      config = extend(config, { query: searchInput });\n      request = this.geocoderService.forwardGeocode(config).send();\n    }\n\n    var localGeocoderRes = [];\n    if (this.options.localGeocoder) {\n      localGeocoderRes = this.options.localGeocoder(searchInput);\n      if (!localGeocoderRes) {\n        localGeocoderRes = [];\n      }\n    }\n\n    request.then(\n      function(response) {\n        this._loadingEl.style.display = 'none';\n\n        var res = {};\n\n        if (response.statusCode == '200') {\n          res = response.body;\n        }\n\n        res.config = config;\n        if (this.fresh){\n          this.eventManager.start(this);\n          this.fresh = false;\n        }\n\n        // supplement Mapbox Geocoding API results with locally populated results\n        res.features = res.features\n          ? localGeocoderRes.concat(res.features)\n          : localGeocoderRes;\n\n        // apply results filter if provided\n        if (this.options.filter && res.features.length) {\n          res.features = res.features.filter(this.options.filter);\n        }\n\n        if (res.features.length) {\n          this._clearEl.style.display = 'block';\n          this._eventEmitter.emit('results', res);\n          this._typeahead.update(res.features);\n        } else {\n          this._clearEl.style.display = 'none';\n          this._typeahead.selected = null;\n          this._renderNoResults();\n          this._eventEmitter.emit('results', res);\n        }\n\n      }.bind(this)\n    );\n\n    request.catch(\n      function(err) {\n        this._loadingEl.style.display = 'none';\n\n        // in the event of an error in the Mapbox Geocoding API still display results from the localGeocoder\n        if (localGeocoderRes.length && this.options.localGeocoder) {\n          this._clearEl.style.display = 'block';\n          this._typeahead.update(localGeocoderRes);\n        } else {\n          this._clearEl.style.display = 'none';\n          this._typeahead.selected = null;\n          this._renderError();\n        }\n\n        this._eventEmitter.emit('results', { features: localGeocoderRes });\n        this._eventEmitter.emit('error', { error: err });\n      }.bind(this)\n    );\n\n    return request;\n  },\n\n  /**\n   * Shared logic for clearing input\n   * @param {Event} [ev] the event that triggered the clear, if available\n   * @private\n   *\n   */\n  _clear: function(ev) {\n    if (ev) ev.preventDefault();\n    this._inputEl.value = '';\n    this._typeahead.selected = null;\n    this._typeahead.clear();\n    this._onChange();\n    this._clearEl.style.display = 'none';\n    this._removeMarker();\n    this.lastSelected = null;\n    this._eventEmitter.emit('clear');\n    this.fresh = true;\n  },\n\n  /**\n   * Clear and then focus the input.\n   * @param {Event} [ev] the event that triggered the clear, if available\n   *\n   */\n  clear: function(ev) {\n    this._clear(ev);\n    this._inputEl.focus();\n  },\n\n\n  /**\n   * Clear the input, without refocusing it. Used to implement clearOnBlur\n   * constructor option.\n   * @param {Event} [ev] the blur event\n   * @private\n   */\n  _clearOnBlur: function(ev) {\n    var ctx = this;\n\n    /**\n    * If relatedTarget is not found, assume user targeted the suggestions list.\n    * In that case, do not clear on blur. There are other edge cases where\n    * ev.relatedTarget could be null. Clicking on list always results in null\n    * relatedtarget because of upstream behavior in `suggestions`.\n    *\n    * The ideal solution would be to check if ev.relatedTarget is a child of\n    * the list. See issue #258 for details on why we can't do that yet.\n    */\n    if (ev.relatedTarget) {\n      ctx._clear(ev);\n    }\n  },\n\n  _onQueryResult: function(response) {\n    var results = response.body;\n    if (!results.features.length) return;\n    var result = results.features[0];\n    this._typeahead.selected = result;\n    this._inputEl.value = result.place_name;\n    this._onChange();\n  },\n\n  _updateProximity: function() {\n    // proximity is designed for local scale, if the user is looking at the whole world,\n    // it doesn't make sense to factor in the arbitrary centre of the map\n    if (this._map.getZoom() > 9) {\n      var center = this._map.getCenter().wrap();\n      this.setProximity({ longitude: center.lng, latitude: center.lat });\n    } else {\n      this.setProximity(null);\n    }\n  },\n\n  _collapse: function() {\n    // do not collapse if input is in focus\n    if (!this._inputEl.value && this._inputEl !== document.activeElement) this.container.classList.add('mapboxgl-ctrl-geocoder--collapsed');\n  },\n\n  _unCollapse: function() {\n    this.container.classList.remove('mapboxgl-ctrl-geocoder--collapsed');\n  },\n\n  /**\n   * Set & query the input\n   * @param {string} searchInput location name or other search input\n   * @returns {MapboxGeocoder} this\n   */\n  query: function(searchInput) {\n    this._geocode(searchInput).then(this._onQueryResult);\n    return this;\n  },\n\n  _renderError: function(){\n    var errorMessage = \"<div class='mapbox-gl-geocoder--error'>There was an error reaching the server</div>\"\n    this._renderMessage(errorMessage);\n  },\n\n  _renderNoResults: function(){\n    var errorMessage = \"<div class='mapbox-gl-geocoder--error mapbox-gl-geocoder--no-results'>No results found</div>\";\n    this._renderMessage(errorMessage);\n  },\n\n  _renderMessage: function(msg){\n    this._typeahead.update([]);\n    this._typeahead.selected = null;\n    this._typeahead.clear();\n    this._typeahead.renderError(msg);\n  },\n\n  /**\n   * Get the text to use as the search bar placeholder\n   *\n   * If placeholder is provided in options, then use options.placeholder\n   * Otherwise, if language is provided in options, then use the localized string of the first language if available\n   * Otherwise use the default\n   *\n   * @returns {String} the value to use as the search bar placeholder\n   * @private\n   */\n  _getPlaceholderText: function(){\n    if (this.options.placeholder) return this.options.placeholder;\n    if (this.options.language){\n      var firstLanguage = this.options.language.split(\",\")[0];\n      var language = subtag.language(firstLanguage);\n      var localizedValue = localization.placeholder[language];\n      if (localizedValue)  return localizedValue;\n    }\n    return 'Search';\n  },\n\n  /**\n   * Set input\n   * @param {string} searchInput location name or other search input\n   * @returns {MapboxGeocoder} this\n   */\n  setInput: function(searchInput) {\n    // Set input value to passed value and clear everything else.\n    this._inputEl.value = searchInput;\n    this._typeahead.selected = null;\n    this._typeahead.clear();\n    this._onChange();\n    return this;\n  },\n\n  /**\n   * Set proximity\n   * @param {Object} proximity The new options.proximity value. This is a geographical point given as an object with latitude and longitude properties.\n   * @returns {MapboxGeocoder} this\n   */\n  setProximity: function(proximity) {\n    this.options.proximity = proximity;\n    return this;\n  },\n\n  /**\n   * Get proximity\n   * @returns {Object} The geocoder proximity\n   */\n  getProximity: function() {\n    return this.options.proximity;\n  },\n\n  /**\n   * Set the render function used in the results dropdown\n   * @param {Function} fn The function to use as a render function. This function accepts a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object as input and returns a string.\n   * @returns {MapboxGeocoder} this\n   */\n  setRenderFunction: function(fn){\n    if (fn && typeof(fn) == \"function\"){\n      this._typeahead.render = fn;\n    }\n    return this;\n  },\n\n  /**\n   * Get the function used to render the results dropdown\n   *\n   * @returns {Function} the render function\n   */\n  getRenderFunction: function(){\n    return this._typeahead.render;\n  },\n\n  /**\n   * Get the language to use in UI elements and when making search requests\n   *\n   * Look first at the explicitly set options otherwise use the browser's language settings\n   * @param {String} language Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas.\n   * @returns {MapboxGeocoder} this\n   */\n  setLanguage: function(language){\n    var browserLocale = navigator.language || navigator.userLanguage || navigator.browserLanguage;\n    this.options.language = language || this.options.language || browserLocale;\n    return this;\n  },\n\n  /**\n   * Get the language to use in UI elements and when making search requests\n   * @returns {String} The language(s) used by the plugin, if any\n   */\n  getLanguage: function(){\n    return this.options.language;\n  },\n\n  /**\n   * Get the zoom level the map will move to when there is no bounding box on the selected result\n   * @returns {Number} the map zoom\n   */\n  getZoom: function(){\n    return this.options.zoom;\n  },\n\n  /**\n   * Set the zoom level\n   * @param {Number} zoom The zoom level that the map should animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`.\n   * @returns {MapboxGeocoder} this\n   */\n  setZoom: function(zoom){\n    this.options.zoom = zoom;\n    return this;\n  },\n\n  /**\n   * Get the parameters used to fly to the selected response, if any\n   * @returns {MapboxGeocoder} this\n   */\n  getFlyTo: function(){\n    return this.options.flyTo;\n  },\n\n  /**\n   * Set the flyTo options\n   * @param {Object|Boolean} flyTo  If false, animating the map to a selected result is disabled. If true, animating the map will use the default animation parameters. If an object, the object will be passed to the flyTo map method to specify a custom animation.\n   */\n  setFlyTo: function(flyTo){\n    this.options.flyTo = flyTo;\n    return this;\n  },\n\n  /**\n   * Get the value of the placeholder string\n   * @returns {String} The input element's placeholder value\n   */\n  getPlaceholder: function(){\n    return this.options.placeholder;\n  },\n\n  /**\n   * Set the value of the input element's placeholder\n   * @param {String} placeholder the text to use as the input element's placeholder\n   * @returns {MapboxGeocoder} this\n   */\n  setPlaceholder: function(placeholder){\n    this.placeholder = (placeholder) ? placeholder : this._getPlaceholderText();\n    this._inputEl.placeholder = this.placeholder;\n    return this\n  },\n\n  /**\n   * Get the bounding box used by the plugin\n   * @returns {Array<Number>} the bounding box, if any\n   */\n  getBbox: function(){\n    return this.options.bbox;\n  },\n\n  /**\n   * Set the bounding box to limit search results to\n   * @param {Array<Number>} bbox a bounding box given as an array in the format [minX, minY, maxX, maxY].\n   * @returns {MapboxGeocoder} this\n   */\n  setBbox: function(bbox){\n    this.options.bbox = bbox;\n    return this;\n  },\n\n  /**\n   * Get a list of the countries to limit search results to\n   * @returns {String} a comma separated list of countries to limit to, if any\n   */\n  getCountries: function(){\n    return this.options.countries;\n  },\n\n  /**\n   * Set the countries to limit search results to\n   * @param {String} countries a comma separated list of countries to limit to\n   * @returns {MapboxGeocoder} this\n   */\n  setCountries: function(countries){\n    this.options.countries = countries;\n    return this;\n  },\n\n  /**\n   * Get a list of the types to limit search results to\n   * @returns {String} a comma separated list of types to limit to\n   */\n  getTypes: function(){\n    return this.options.types;\n  },\n\n  /**\n   * Set the types to limit search results to\n   * @param {String} countries a comma separated list of types to limit to\n   * @returns {MapboxGeocoder} this\n   */\n  setTypes: function(types){\n    this.options.types = types;\n    return this;\n  },\n\n  /**\n   * Get the minimum number of characters typed to trigger results used in the plugin\n   * @returns {Number} The minimum length in characters before a search is triggered\n   */\n  getMinLength: function(){\n    return this.options.minLength;\n  },\n\n  /**\n   * Set the minimum number of characters typed to trigger results used by the plugin\n   * @param {Number} minLength the minimum length in characters\n   * @returns {MapboxGeocoder} this\n   */\n  setMinLength: function(minLength){\n    this.options.minLength = minLength;\n    if (this._typeahead)  this._typeahead.minLength = minLength;\n    return this;\n  },\n\n  /**\n   * Get the limit value for the number of results to display used by the plugin\n   * @returns {Number} The limit value for the number of results to display used by the plugin\n   */\n  getLimit: function(){\n    return this.options.limit;\n  },\n\n  /**\n   * Set the limit value for the number of results to display used by the plugin\n   * @param {Number} limit the number of search results to return\n   * @returns {MapboxGeocoder}\n   */\n  setLimit: function(limit){\n    this.options.limit = limit;\n    if (this._typeahead) this._typeahead.options.limit = limit;\n    return this;\n  },\n\n  /**\n   * Get the filter function used by the plugin\n   * @returns {Function} the filter function\n   */\n  getFilter: function(){\n    return this.options.filter;\n  },\n\n  /**\n   * Set the filter function used by the plugin.\n   * @param {Function} filter A function which accepts a Feature in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format to filter out results from the Geocoding API response before they are included in the suggestions list. Return `true` to keep the item, `false` otherwise.\n   * @returns {MapboxGeocoder} this\n   */\n  setFilter: function(filter){\n    this.options.filter = filter;\n    return this;\n  },\n\n  /**\n   * Handle the placement of a result marking the selected result\n   * @private\n   * @param {Object} selected the selected geojson feature\n   * @returns {MapboxGeocoder} this\n   */\n  _handleMarker: function(selected){\n    // clean up any old marker that might be present\n    this._removeMarker();\n    var defaultMarkerOptions = {\n      color: '#4668F2'\n    }\n    var markerOptions = extend({}, defaultMarkerOptions, this.options.marker)\n    this.mapMarker = new this._mapboxgl.Marker(markerOptions);\n    this.mapMarker\n      .setLngLat(selected.center)\n      .addTo(this._map);\n    return this;\n  },\n\n  /**\n   * Handle the removal of a result marker\n   * @private\n   */\n  _removeMarker: function(){\n    if (this.mapMarker){\n      this.mapMarker.remove();\n      this.mapMarker = null;\n    }\n  },\n\n  /**\n   * Subscribe to events that happen within the plugin.\n   * @param {String} type name of event. Available events and the data passed into their respective event objects are:\n   *\n   * - __clear__ `Emitted when the input is cleared`\n   * - __loading__ `{ query } Emitted when the geocoder is looking up a query`\n   * - __results__ `{ results } Fired when the geocoder returns a response`\n   * - __result__ `{ result } Fired when input is set`\n   * - __error__ `{ error } Error as string`\n   * @param {Function} fn function that's called when the event is emitted.\n   * @returns {MapboxGeocoder} this;\n   */\n  on: function(type, fn) {\n    this._eventEmitter.on(type, fn);\n    return this;\n  },\n\n  /**\n   * Remove an event\n   * @returns {MapboxGeocoder} this\n   * @param {String} type Event name.\n   * @param {Function} fn Function that should unsubscribe to the event emitted.\n   */\n  off: function(type, fn) {\n    this._eventEmitter.removeListener(type, fn);\n    this.eventManager.remove();\n    return this;\n  }\n};\n\nmodule.exports = MapboxGeocoder;\n","export default function _classCallCheck(instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n}","function _defineProperties(target, props) {\n  for (var i = 0; i < props.length; i++) {\n    var descriptor = props[i];\n    descriptor.enumerable = descriptor.enumerable || false;\n    descriptor.configurable = true;\n    if (\"value\" in descriptor) descriptor.writable = true;\n    Object.defineProperty(target, descriptor.key, descriptor);\n  }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n  if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n  if (staticProps) _defineProperties(Constructor, staticProps);\n  return Constructor;\n}","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nexport default function _typeof(obj) {\n  if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n    _typeof = function _typeof(obj) {\n      return _typeof2(obj);\n    };\n  } else {\n    _typeof = function _typeof(obj) {\n      return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n    };\n  }\n\n  return _typeof(obj);\n}","export default function _assertThisInitialized(self) {\n  if (self === void 0) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n\n  return self;\n}","export default function _getPrototypeOf(o) {\n  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n    return o.__proto__ || Object.getPrototypeOf(o);\n  };\n  return _getPrototypeOf(o);\n}","export default function _setPrototypeOf(o, p) {\n  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n    o.__proto__ = p;\n    return o;\n  };\n\n  return _setPrototypeOf(o, p);\n}","import arrayWithHoles from \"./arrayWithHoles\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit\";\nimport nonIterableRest from \"./nonIterableRest\";\nexport default function _slicedToArray(arr, i) {\n  return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n  if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n  var _arr = [];\n  var _n = true;\n  var _d = false;\n  var _e = undefined;\n\n  try {\n    for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n      _arr.push(_s.value);\n\n      if (i && _arr.length === i) break;\n    }\n  } catch (err) {\n    _d = true;\n    _e = err;\n  } finally {\n    try {\n      if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n    } finally {\n      if (_d) throw _e;\n    }\n  }\n\n  return _arr;\n}","export default function _nonIterableRest() {\n  throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}","/**\r\n * Common utilities\r\n * @module glMatrix\r\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\r\n * Sets the type of array used when creating new vectors and matrices\r\n *\r\n * @param {Type} type Array type, such as Float32Array or Array\r\n */\n\nexport function setMatrixArrayType(type) {\n  ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\r\n * Convert Degree To Radian\r\n *\r\n * @param {Number} a Angle in Degrees\r\n */\n\nexport function toRadian(a) {\n  return a * degree;\n}\n/**\r\n * Tests whether or not the arguments have approximately the same value, within an absolute\r\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\r\n * than or equal to 1.0, and a relative tolerance is used for larger values)\r\n *\r\n * @param {Number} a The first number to test.\r\n * @param {Number} b The second number to test.\r\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n  return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}","import * as glMatrix from \"./common.js\";\n/**\r\n * 4 Dimensional Vector\r\n * @module vec4\r\n */\n\n/**\r\n * Creates a new, empty vec4\r\n *\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(4);\n\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n  }\n\n  return out;\n}\n/**\r\n * Creates a new vec4 initialized with values from an existing vector\r\n *\r\n * @param {vec4} a vector to clone\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  return out;\n}\n/**\r\n * Creates a new vec4 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function fromValues(x, y, z, w) {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  out[3] = w;\n  return out;\n}\n/**\r\n * Copy the values from one vec4 to another\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the source vector\r\n * @returns {vec4} out\r\n */\n\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  return out;\n}\n/**\r\n * Set the components of a vec4 to the given values\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} out\r\n */\n\nexport function set(out, x, y, z, w) {\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  out[3] = w;\n  return out;\n}\n/**\r\n * Adds two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the first operand\r\n * @param {vec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  out[3] = a[3] + b[3];\n  return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the first operand\r\n * @param {vec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  out[3] = a[3] - b[3];\n  return out;\n}\n/**\r\n * Multiplies two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the first operand\r\n * @param {vec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function multiply(out, a, b) {\n  out[0] = a[0] * b[0];\n  out[1] = a[1] * b[1];\n  out[2] = a[2] * b[2];\n  out[3] = a[3] * b[3];\n  return out;\n}\n/**\r\n * Divides two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the first operand\r\n * @param {vec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function divide(out, a, b) {\n  out[0] = a[0] / b[0];\n  out[1] = a[1] / b[1];\n  out[2] = a[2] / b[2];\n  out[3] = a[3] / b[3];\n  return out;\n}\n/**\r\n * Math.ceil the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a vector to ceil\r\n * @returns {vec4} out\r\n */\n\nexport function ceil(out, a) {\n  out[0] = Math.ceil(a[0]);\n  out[1] = Math.ceil(a[1]);\n  out[2] = Math.ceil(a[2]);\n  out[3] = Math.ceil(a[3]);\n  return out;\n}\n/**\r\n * Math.floor the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a vector to floor\r\n * @returns {vec4} out\r\n */\n\nexport function floor(out, a) {\n  out[0] = Math.floor(a[0]);\n  out[1] = Math.floor(a[1]);\n  out[2] = Math.floor(a[2]);\n  out[3] = Math.floor(a[3]);\n  return out;\n}\n/**\r\n * Returns the minimum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the first operand\r\n * @param {vec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function min(out, a, b) {\n  out[0] = Math.min(a[0], b[0]);\n  out[1] = Math.min(a[1], b[1]);\n  out[2] = Math.min(a[2], b[2]);\n  out[3] = Math.min(a[3], b[3]);\n  return out;\n}\n/**\r\n * Returns the maximum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the first operand\r\n * @param {vec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function max(out, a, b) {\n  out[0] = Math.max(a[0], b[0]);\n  out[1] = Math.max(a[1], b[1]);\n  out[2] = Math.max(a[2], b[2]);\n  out[3] = Math.max(a[3], b[3]);\n  return out;\n}\n/**\r\n * Math.round the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a vector to round\r\n * @returns {vec4} out\r\n */\n\nexport function round(out, a) {\n  out[0] = Math.round(a[0]);\n  out[1] = Math.round(a[1]);\n  out[2] = Math.round(a[2]);\n  out[3] = Math.round(a[3]);\n  return out;\n}\n/**\r\n * Scales a vec4 by a scalar number\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec4} out\r\n */\n\nexport function scale(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  out[3] = a[3] * b;\n  return out;\n}\n/**\r\n * Adds two vec4's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the first operand\r\n * @param {vec4} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec4} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  out[3] = a[3] + b[3] * scale;\n  return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec4's\r\n *\r\n * @param {vec4} a the first operand\r\n * @param {vec4} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  var w = b[3] - a[3];\n  return Math.sqrt(x * x + y * y + z * z + w * w);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec4's\r\n *\r\n * @param {vec4} a the first operand\r\n * @param {vec4} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  var w = b[3] - a[3];\n  return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Calculates the length of a vec4\r\n *\r\n * @param {vec4} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var w = a[3];\n  return Math.sqrt(x * x + y * y + z * z + w * w);\n}\n/**\r\n * Calculates the squared length of a vec4\r\n *\r\n * @param {vec4} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var w = a[3];\n  return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Negates the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a vector to negate\r\n * @returns {vec4} out\r\n */\n\nexport function negate(out, a) {\n  out[0] = -a[0];\n  out[1] = -a[1];\n  out[2] = -a[2];\n  out[3] = -a[3];\n  return out;\n}\n/**\r\n * Returns the inverse of the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a vector to invert\r\n * @returns {vec4} out\r\n */\n\nexport function inverse(out, a) {\n  out[0] = 1.0 / a[0];\n  out[1] = 1.0 / a[1];\n  out[2] = 1.0 / a[2];\n  out[3] = 1.0 / a[3];\n  return out;\n}\n/**\r\n * Normalize a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a vector to normalize\r\n * @returns {vec4} out\r\n */\n\nexport function normalize(out, a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var w = a[3];\n  var len = x * x + y * y + z * z + w * w;\n\n  if (len > 0) {\n    len = 1 / Math.sqrt(len);\n  }\n\n  out[0] = x * len;\n  out[1] = y * len;\n  out[2] = z * len;\n  out[3] = w * len;\n  return out;\n}\n/**\r\n * Calculates the dot product of two vec4's\r\n *\r\n * @param {vec4} a the first operand\r\n * @param {vec4} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n *\r\n * @param {vec4} result the receiving vector\r\n * @param {vec4} U the first vector\r\n * @param {vec4} V the second vector\r\n * @param {vec4} W the third vector\r\n * @returns {vec4} result\r\n */\n\nexport function cross(out, u, v, w) {\n  var A = v[0] * w[1] - v[1] * w[0],\n      B = v[0] * w[2] - v[2] * w[0],\n      C = v[0] * w[3] - v[3] * w[0],\n      D = v[1] * w[2] - v[2] * w[1],\n      E = v[1] * w[3] - v[3] * w[1],\n      F = v[2] * w[3] - v[3] * w[2];\n  var G = u[0];\n  var H = u[1];\n  var I = u[2];\n  var J = u[3];\n  out[0] = H * F - I * E + J * D;\n  out[1] = -(G * F) + I * C - J * B;\n  out[2] = G * E - H * C + J * A;\n  out[3] = -(G * D) + H * B - I * A;\n  return out;\n}\n;\n/**\r\n * Performs a linear interpolation between two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the first operand\r\n * @param {vec4} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec4} out\r\n */\n\nexport function lerp(out, a, b, t) {\n  var ax = a[0];\n  var ay = a[1];\n  var az = a[2];\n  var aw = a[3];\n  out[0] = ax + t * (b[0] - ax);\n  out[1] = ay + t * (b[1] - ay);\n  out[2] = az + t * (b[2] - az);\n  out[3] = aw + t * (b[3] - aw);\n  return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec4} out\r\n */\n\nexport function random(out, scale) {\n  scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n  // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n  // http://projecteuclid.org/euclid.aoms/1177692644;\n\n  var v1, v2, v3, v4;\n  var s1, s2;\n\n  do {\n    v1 = glMatrix.RANDOM() * 2 - 1;\n    v2 = glMatrix.RANDOM() * 2 - 1;\n    s1 = v1 * v1 + v2 * v2;\n  } while (s1 >= 1);\n\n  do {\n    v3 = glMatrix.RANDOM() * 2 - 1;\n    v4 = glMatrix.RANDOM() * 2 - 1;\n    s2 = v3 * v3 + v4 * v4;\n  } while (s2 >= 1);\n\n  var d = Math.sqrt((1 - s1) / s2);\n  out[0] = scale * v1;\n  out[1] = scale * v2;\n  out[2] = scale * v3 * d;\n  out[3] = scale * v4 * d;\n  return out;\n}\n/**\r\n * Transforms the vec4 with a mat4.\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the vector to transform\r\n * @param {mat4} m matrix to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformMat4(out, a, m) {\n  var x = a[0],\n      y = a[1],\n      z = a[2],\n      w = a[3];\n  out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n  out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n  out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n  out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n  return out;\n}\n/**\r\n * Transforms the vec4 with a quat\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {vec4} a the vector to transform\r\n * @param {quat} q quaternion to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformQuat(out, a, q) {\n  var x = a[0],\n      y = a[1],\n      z = a[2];\n  var qx = q[0],\n      qy = q[1],\n      qz = q[2],\n      qw = q[3]; // calculate quat * vec\n\n  var ix = qw * x + qy * z - qz * y;\n  var iy = qw * y + qz * x - qx * z;\n  var iz = qw * z + qx * y - qy * x;\n  var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n  out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n  out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n  out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n  out[3] = a[3];\n  return out;\n}\n/**\r\n * Set the components of a vec4 to zero\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @returns {vec4} out\r\n */\n\nexport function zero(out) {\n  out[0] = 0.0;\n  out[1] = 0.0;\n  out[2] = 0.0;\n  out[3] = 0.0;\n  return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {vec4} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n  return 'vec4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {vec4} a The first vector.\r\n * @param {vec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {vec4} a The first vector.\r\n * @param {vec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2],\n      a3 = a[3];\n  var b0 = b[0],\n      b1 = b[1],\n      b2 = b[2],\n      b3 = b[3];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Alias for {@link vec4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec4.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec4.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec4.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec4.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec4.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec4s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n\n    if (!stride) {\n      stride = 4;\n    }\n\n    if (!offset) {\n      offset = 0;\n    }\n\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\n    }\n\n    for (i = offset; i < l; i += stride) {\n      vec[0] = a[i];\n      vec[1] = a[i + 1];\n      vec[2] = a[i + 2];\n      vec[3] = a[i + 3];\n      fn(vec, vec, arg);\n      a[i] = vec[0];\n      a[i + 1] = vec[1];\n      a[i + 2] = vec[2];\n      a[i + 3] = vec[3];\n    }\n\n    return a;\n  };\n}();","import * as vec4 from 'gl-matrix/vec4';\nexport function createMat4() {\n  return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\nexport function transformVector(matrix, vector) {\n  var result = vec4.transformMat4([], vector, matrix);\n  vec4.scale(result, result, 1 / result[3]);\n  return result;\n}\nexport function mod(value, divisor) {\n  var modulus = value % divisor;\n  return modulus < 0 ? divisor + modulus : modulus;\n}\nexport function lerp(start, end, step) {\n  return step * end + (1 - step) * start;\n}\n//# sourceMappingURL=math-utils.js.map","import * as glMatrix from \"./common.js\";\n/**\r\n * 4x4 Matrix<br>Format: column-major, when typed out it looks like row-major<br>The matrices are being post multiplied.\r\n * @module mat4\r\n */\n\n/**\r\n * Creates a new identity mat4\r\n *\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(16);\n\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = 0;\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n  }\n\n  out[0] = 1;\n  out[5] = 1;\n  out[10] = 1;\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Creates a new mat4 initialized with values from an existing matrix\r\n *\r\n * @param {mat4} a matrix to clone\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(16);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  out[4] = a[4];\n  out[5] = a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  out[9] = a[9];\n  out[10] = a[10];\n  out[11] = a[11];\n  out[12] = a[12];\n  out[13] = a[13];\n  out[14] = a[14];\n  out[15] = a[15];\n  return out;\n}\n/**\r\n * Copy the values from one mat4 to another\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  out[4] = a[4];\n  out[5] = a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  out[9] = a[9];\n  out[10] = a[10];\n  out[11] = a[11];\n  out[12] = a[12];\n  out[13] = a[13];\n  out[14] = a[14];\n  out[15] = a[15];\n  return out;\n}\n/**\r\n * Create a new mat4 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} A new mat4\r\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n  var out = new glMatrix.ARRAY_TYPE(16);\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m02;\n  out[3] = m03;\n  out[4] = m10;\n  out[5] = m11;\n  out[6] = m12;\n  out[7] = m13;\n  out[8] = m20;\n  out[9] = m21;\n  out[10] = m22;\n  out[11] = m23;\n  out[12] = m30;\n  out[13] = m31;\n  out[14] = m32;\n  out[15] = m33;\n  return out;\n}\n/**\r\n * Set the components of a mat4 to the given values\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} out\r\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m02;\n  out[3] = m03;\n  out[4] = m10;\n  out[5] = m11;\n  out[6] = m12;\n  out[7] = m13;\n  out[8] = m20;\n  out[9] = m21;\n  out[10] = m22;\n  out[11] = m23;\n  out[12] = m30;\n  out[13] = m31;\n  out[14] = m32;\n  out[15] = m33;\n  return out;\n}\n/**\r\n * Set a mat4 to the identity matrix\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @returns {mat4} out\r\n */\n\nexport function identity(out) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = 1;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 1;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Transpose the values of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function transpose(out, a) {\n  // If we are transposing ourselves we can skip a few steps but have to cache some values\n  if (out === a) {\n    var a01 = a[1],\n        a02 = a[2],\n        a03 = a[3];\n    var a12 = a[6],\n        a13 = a[7];\n    var a23 = a[11];\n    out[1] = a[4];\n    out[2] = a[8];\n    out[3] = a[12];\n    out[4] = a01;\n    out[6] = a[9];\n    out[7] = a[13];\n    out[8] = a02;\n    out[9] = a12;\n    out[11] = a[14];\n    out[12] = a03;\n    out[13] = a13;\n    out[14] = a23;\n  } else {\n    out[0] = a[0];\n    out[1] = a[4];\n    out[2] = a[8];\n    out[3] = a[12];\n    out[4] = a[1];\n    out[5] = a[5];\n    out[6] = a[9];\n    out[7] = a[13];\n    out[8] = a[2];\n    out[9] = a[6];\n    out[10] = a[10];\n    out[11] = a[14];\n    out[12] = a[3];\n    out[13] = a[7];\n    out[14] = a[11];\n    out[15] = a[15];\n  }\n\n  return out;\n}\n/**\r\n * Inverts a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function invert(out, a) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a03 = a[3];\n  var a10 = a[4],\n      a11 = a[5],\n      a12 = a[6],\n      a13 = a[7];\n  var a20 = a[8],\n      a21 = a[9],\n      a22 = a[10],\n      a23 = a[11];\n  var a30 = a[12],\n      a31 = a[13],\n      a32 = a[14],\n      a33 = a[15];\n  var b00 = a00 * a11 - a01 * a10;\n  var b01 = a00 * a12 - a02 * a10;\n  var b02 = a00 * a13 - a03 * a10;\n  var b03 = a01 * a12 - a02 * a11;\n  var b04 = a01 * a13 - a03 * a11;\n  var b05 = a02 * a13 - a03 * a12;\n  var b06 = a20 * a31 - a21 * a30;\n  var b07 = a20 * a32 - a22 * a30;\n  var b08 = a20 * a33 - a23 * a30;\n  var b09 = a21 * a32 - a22 * a31;\n  var b10 = a21 * a33 - a23 * a31;\n  var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n  var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n  if (!det) {\n    return null;\n  }\n\n  det = 1.0 / det;\n  out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n  out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n  out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n  out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n  out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n  out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n  out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n  out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n  out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n  out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n  out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n  out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n  out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n  out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n  out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n  out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n  return out;\n}\n/**\r\n * Calculates the adjugate of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function adjoint(out, a) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a03 = a[3];\n  var a10 = a[4],\n      a11 = a[5],\n      a12 = a[6],\n      a13 = a[7];\n  var a20 = a[8],\n      a21 = a[9],\n      a22 = a[10],\n      a23 = a[11];\n  var a30 = a[12],\n      a31 = a[13],\n      a32 = a[14],\n      a33 = a[15];\n  out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n  out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n  out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n  out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n  out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n  out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n  out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n  out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n  out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n  out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n  out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n  out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n  out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n  out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n  out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n  out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n  return out;\n}\n/**\r\n * Calculates the determinant of a mat4\r\n *\r\n * @param {mat4} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a03 = a[3];\n  var a10 = a[4],\n      a11 = a[5],\n      a12 = a[6],\n      a13 = a[7];\n  var a20 = a[8],\n      a21 = a[9],\n      a22 = a[10],\n      a23 = a[11];\n  var a30 = a[12],\n      a31 = a[13],\n      a32 = a[14],\n      a33 = a[15];\n  var b00 = a00 * a11 - a01 * a10;\n  var b01 = a00 * a12 - a02 * a10;\n  var b02 = a00 * a13 - a03 * a10;\n  var b03 = a01 * a12 - a02 * a11;\n  var b04 = a01 * a13 - a03 * a11;\n  var b05 = a02 * a13 - a03 * a12;\n  var b06 = a20 * a31 - a21 * a30;\n  var b07 = a20 * a32 - a22 * a30;\n  var b08 = a20 * a33 - a23 * a30;\n  var b09 = a21 * a32 - a22 * a31;\n  var b10 = a21 * a33 - a23 * a31;\n  var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n  return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\r\n * Multiplies two mat4s\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the first operand\r\n * @param {mat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function multiply(out, a, b) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a03 = a[3];\n  var a10 = a[4],\n      a11 = a[5],\n      a12 = a[6],\n      a13 = a[7];\n  var a20 = a[8],\n      a21 = a[9],\n      a22 = a[10],\n      a23 = a[11];\n  var a30 = a[12],\n      a31 = a[13],\n      a32 = a[14],\n      a33 = a[15]; // Cache only the current line of the second matrix\n\n  var b0 = b[0],\n      b1 = b[1],\n      b2 = b[2],\n      b3 = b[3];\n  out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  b0 = b[4];\n  b1 = b[5];\n  b2 = b[6];\n  b3 = b[7];\n  out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  b0 = b[8];\n  b1 = b[9];\n  b2 = b[10];\n  b3 = b[11];\n  out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  b0 = b[12];\n  b1 = b[13];\n  b2 = b[14];\n  b3 = b[15];\n  out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  return out;\n}\n/**\r\n * Translate a mat4 by the given vector\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the matrix to translate\r\n * @param {vec3} v vector to translate by\r\n * @returns {mat4} out\r\n */\n\nexport function translate(out, a, v) {\n  var x = v[0],\n      y = v[1],\n      z = v[2];\n  var a00, a01, a02, a03;\n  var a10, a11, a12, a13;\n  var a20, a21, a22, a23;\n\n  if (a === out) {\n    out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n    out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n    out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n    out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n  } else {\n    a00 = a[0];\n    a01 = a[1];\n    a02 = a[2];\n    a03 = a[3];\n    a10 = a[4];\n    a11 = a[5];\n    a12 = a[6];\n    a13 = a[7];\n    a20 = a[8];\n    a21 = a[9];\n    a22 = a[10];\n    a23 = a[11];\n    out[0] = a00;\n    out[1] = a01;\n    out[2] = a02;\n    out[3] = a03;\n    out[4] = a10;\n    out[5] = a11;\n    out[6] = a12;\n    out[7] = a13;\n    out[8] = a20;\n    out[9] = a21;\n    out[10] = a22;\n    out[11] = a23;\n    out[12] = a00 * x + a10 * y + a20 * z + a[12];\n    out[13] = a01 * x + a11 * y + a21 * z + a[13];\n    out[14] = a02 * x + a12 * y + a22 * z + a[14];\n    out[15] = a03 * x + a13 * y + a23 * z + a[15];\n  }\n\n  return out;\n}\n/**\r\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the matrix to scale\r\n * @param {vec3} v the vec3 to scale the matrix by\r\n * @returns {mat4} out\r\n **/\n\nexport function scale(out, a, v) {\n  var x = v[0],\n      y = v[1],\n      z = v[2];\n  out[0] = a[0] * x;\n  out[1] = a[1] * x;\n  out[2] = a[2] * x;\n  out[3] = a[3] * x;\n  out[4] = a[4] * y;\n  out[5] = a[5] * y;\n  out[6] = a[6] * y;\n  out[7] = a[7] * y;\n  out[8] = a[8] * z;\n  out[9] = a[9] * z;\n  out[10] = a[10] * z;\n  out[11] = a[11] * z;\n  out[12] = a[12];\n  out[13] = a[13];\n  out[14] = a[14];\n  out[15] = a[15];\n  return out;\n}\n/**\r\n * Rotates a mat4 by the given angle around the given axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {vec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function rotate(out, a, rad, axis) {\n  var x = axis[0],\n      y = axis[1],\n      z = axis[2];\n  var len = Math.sqrt(x * x + y * y + z * z);\n  var s, c, t;\n  var a00, a01, a02, a03;\n  var a10, a11, a12, a13;\n  var a20, a21, a22, a23;\n  var b00, b01, b02;\n  var b10, b11, b12;\n  var b20, b21, b22;\n\n  if (len < glMatrix.EPSILON) {\n    return null;\n  }\n\n  len = 1 / len;\n  x *= len;\n  y *= len;\n  z *= len;\n  s = Math.sin(rad);\n  c = Math.cos(rad);\n  t = 1 - c;\n  a00 = a[0];\n  a01 = a[1];\n  a02 = a[2];\n  a03 = a[3];\n  a10 = a[4];\n  a11 = a[5];\n  a12 = a[6];\n  a13 = a[7];\n  a20 = a[8];\n  a21 = a[9];\n  a22 = a[10];\n  a23 = a[11]; // Construct the elements of the rotation matrix\n\n  b00 = x * x * t + c;\n  b01 = y * x * t + z * s;\n  b02 = z * x * t - y * s;\n  b10 = x * y * t - z * s;\n  b11 = y * y * t + c;\n  b12 = z * y * t + x * s;\n  b20 = x * z * t + y * s;\n  b21 = y * z * t - x * s;\n  b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n  out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n  out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n  out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n  out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n  out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n  out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n  out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n  out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n  out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n  out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n  out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n  out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged last row\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  }\n\n  return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the X axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateX(out, a, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  var a10 = a[4];\n  var a11 = a[5];\n  var a12 = a[6];\n  var a13 = a[7];\n  var a20 = a[8];\n  var a21 = a[9];\n  var a22 = a[10];\n  var a23 = a[11];\n\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged rows\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  } // Perform axis-specific matrix multiplication\n\n\n  out[4] = a10 * c + a20 * s;\n  out[5] = a11 * c + a21 * s;\n  out[6] = a12 * c + a22 * s;\n  out[7] = a13 * c + a23 * s;\n  out[8] = a20 * c - a10 * s;\n  out[9] = a21 * c - a11 * s;\n  out[10] = a22 * c - a12 * s;\n  out[11] = a23 * c - a13 * s;\n  return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Y axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateY(out, a, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  var a00 = a[0];\n  var a01 = a[1];\n  var a02 = a[2];\n  var a03 = a[3];\n  var a20 = a[8];\n  var a21 = a[9];\n  var a22 = a[10];\n  var a23 = a[11];\n\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged rows\n    out[4] = a[4];\n    out[5] = a[5];\n    out[6] = a[6];\n    out[7] = a[7];\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  } // Perform axis-specific matrix multiplication\n\n\n  out[0] = a00 * c - a20 * s;\n  out[1] = a01 * c - a21 * s;\n  out[2] = a02 * c - a22 * s;\n  out[3] = a03 * c - a23 * s;\n  out[8] = a00 * s + a20 * c;\n  out[9] = a01 * s + a21 * c;\n  out[10] = a02 * s + a22 * c;\n  out[11] = a03 * s + a23 * c;\n  return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Z axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  var a00 = a[0];\n  var a01 = a[1];\n  var a02 = a[2];\n  var a03 = a[3];\n  var a10 = a[4];\n  var a11 = a[5];\n  var a12 = a[6];\n  var a13 = a[7];\n\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged last row\n    out[8] = a[8];\n    out[9] = a[9];\n    out[10] = a[10];\n    out[11] = a[11];\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  } // Perform axis-specific matrix multiplication\n\n\n  out[0] = a00 * c + a10 * s;\n  out[1] = a01 * c + a11 * s;\n  out[2] = a02 * c + a12 * s;\n  out[3] = a03 * c + a13 * s;\n  out[4] = a10 * c - a00 * s;\n  out[5] = a11 * c - a01 * s;\n  out[6] = a12 * c - a02 * s;\n  out[7] = a13 * c - a03 * s;\n  return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n *     mat4.identity(dest);\r\n *     mat4.translate(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {vec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromTranslation(out, v) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = 1;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 1;\n  out[11] = 0;\n  out[12] = v[0];\n  out[13] = v[1];\n  out[14] = v[2];\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n *     mat4.identity(dest);\r\n *     mat4.scale(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {vec3} v Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromScaling(out, v) {\n  out[0] = v[0];\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = v[1];\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = v[2];\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Creates a matrix from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n *     mat4.identity(dest);\r\n *     mat4.rotate(dest, dest, rad, axis);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {vec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotation(out, rad, axis) {\n  var x = axis[0],\n      y = axis[1],\n      z = axis[2];\n  var len = Math.sqrt(x * x + y * y + z * z);\n  var s, c, t;\n\n  if (len < glMatrix.EPSILON) {\n    return null;\n  }\n\n  len = 1 / len;\n  x *= len;\n  y *= len;\n  z *= len;\n  s = Math.sin(rad);\n  c = Math.cos(rad);\n  t = 1 - c; // Perform rotation-specific matrix multiplication\n\n  out[0] = x * x * t + c;\n  out[1] = y * x * t + z * s;\n  out[2] = z * x * t - y * s;\n  out[3] = 0;\n  out[4] = x * y * t - z * s;\n  out[5] = y * y * t + c;\n  out[6] = z * y * t + x * s;\n  out[7] = 0;\n  out[8] = x * z * t + y * s;\n  out[9] = y * z * t - x * s;\n  out[10] = z * z * t + c;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n *     mat4.identity(dest);\r\n *     mat4.rotateX(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromXRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = c;\n  out[6] = s;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = -s;\n  out[10] = c;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n *     mat4.identity(dest);\r\n *     mat4.rotateY(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromYRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n  out[0] = c;\n  out[1] = 0;\n  out[2] = -s;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = 1;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = s;\n  out[9] = 0;\n  out[10] = c;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n *     mat4.identity(dest);\r\n *     mat4.rotateZ(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromZRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n  out[0] = c;\n  out[1] = s;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = -s;\n  out[5] = c;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 1;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n *     mat4.identity(dest);\r\n *     mat4.translate(dest, vec);\r\n *     let quatMat = mat4.create();\r\n *     quat4.toMat4(quat, quatMat);\r\n *     mat4.multiply(dest, quatMat);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {vec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslation(out, q, v) {\n  // Quaternion math\n  var x = q[0],\n      y = q[1],\n      z = q[2],\n      w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var xy = x * y2;\n  var xz = x * z2;\n  var yy = y * y2;\n  var yz = y * z2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  out[0] = 1 - (yy + zz);\n  out[1] = xy + wz;\n  out[2] = xz - wy;\n  out[3] = 0;\n  out[4] = xy - wz;\n  out[5] = 1 - (xx + zz);\n  out[6] = yz + wx;\n  out[7] = 0;\n  out[8] = xz + wy;\n  out[9] = yz - wx;\n  out[10] = 1 - (xx + yy);\n  out[11] = 0;\n  out[12] = v[0];\n  out[13] = v[1];\n  out[14] = v[2];\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Creates a new mat4 from a dual quat.\r\n *\r\n * @param {mat4} out Matrix\r\n * @param {quat2} a Dual Quaternion\r\n * @returns {mat4} mat4 receiving operation result\r\n */\n\nexport function fromQuat2(out, a) {\n  var translation = new glMatrix.ARRAY_TYPE(3);\n  var bx = -a[0],\n      by = -a[1],\n      bz = -a[2],\n      bw = a[3],\n      ax = a[4],\n      ay = a[5],\n      az = a[6],\n      aw = a[7];\n  var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n  if (magnitude > 0) {\n    translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n    translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n    translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n  } else {\n    translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n    translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n    translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n  }\n\n  fromRotationTranslation(out, a, translation);\n  return out;\n}\n/**\r\n * Returns the translation vector component of a transformation\r\n *  matrix. If a matrix is built with fromRotationTranslation,\r\n *  the returned vector will be the same as the translation vector\r\n *  originally supplied.\r\n * @param  {vec3} out Vector to receive translation component\r\n * @param  {mat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getTranslation(out, mat) {\n  out[0] = mat[12];\n  out[1] = mat[13];\n  out[2] = mat[14];\n  return out;\n}\n/**\r\n * Returns the scaling factor component of a transformation\r\n *  matrix. If a matrix is built with fromRotationTranslationScale\r\n *  with a normalized Quaternion paramter, the returned vector will be\r\n *  the same as the scaling vector\r\n *  originally supplied.\r\n * @param  {vec3} out Vector to receive scaling factor component\r\n * @param  {mat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getScaling(out, mat) {\n  var m11 = mat[0];\n  var m12 = mat[1];\n  var m13 = mat[2];\n  var m21 = mat[4];\n  var m22 = mat[5];\n  var m23 = mat[6];\n  var m31 = mat[8];\n  var m32 = mat[9];\n  var m33 = mat[10];\n  out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n  out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n  out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n  return out;\n}\n/**\r\n * Returns a quaternion representing the rotational component\r\n *  of a transformation matrix. If a matrix is built with\r\n *  fromRotationTranslation, the returned quaternion will be the\r\n *  same as the quaternion originally supplied.\r\n * @param {quat} out Quaternion to receive the rotation component\r\n * @param {mat4} mat Matrix to be decomposed (input)\r\n * @return {quat} out\r\n */\n\nexport function getRotation(out, mat) {\n  // Algorithm taken from http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n  var trace = mat[0] + mat[5] + mat[10];\n  var S = 0;\n\n  if (trace > 0) {\n    S = Math.sqrt(trace + 1.0) * 2;\n    out[3] = 0.25 * S;\n    out[0] = (mat[6] - mat[9]) / S;\n    out[1] = (mat[8] - mat[2]) / S;\n    out[2] = (mat[1] - mat[4]) / S;\n  } else if (mat[0] > mat[5] && mat[0] > mat[10]) {\n    S = Math.sqrt(1.0 + mat[0] - mat[5] - mat[10]) * 2;\n    out[3] = (mat[6] - mat[9]) / S;\n    out[0] = 0.25 * S;\n    out[1] = (mat[1] + mat[4]) / S;\n    out[2] = (mat[8] + mat[2]) / S;\n  } else if (mat[5] > mat[10]) {\n    S = Math.sqrt(1.0 + mat[5] - mat[0] - mat[10]) * 2;\n    out[3] = (mat[8] - mat[2]) / S;\n    out[0] = (mat[1] + mat[4]) / S;\n    out[1] = 0.25 * S;\n    out[2] = (mat[6] + mat[9]) / S;\n  } else {\n    S = Math.sqrt(1.0 + mat[10] - mat[0] - mat[5]) * 2;\n    out[3] = (mat[1] - mat[4]) / S;\n    out[0] = (mat[8] + mat[2]) / S;\n    out[1] = (mat[6] + mat[9]) / S;\n    out[2] = 0.25 * S;\n  }\n\n  return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n *     mat4.identity(dest);\r\n *     mat4.translate(dest, vec);\r\n *     let quatMat = mat4.create();\r\n *     quat4.toMat4(quat, quatMat);\r\n *     mat4.multiply(dest, quatMat);\r\n *     mat4.scale(dest, scale)\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {vec3} v Translation vector\r\n * @param {vec3} s Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n  // Quaternion math\n  var x = q[0],\n      y = q[1],\n      z = q[2],\n      w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var xy = x * y2;\n  var xz = x * z2;\n  var yy = y * y2;\n  var yz = y * z2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  var sx = s[0];\n  var sy = s[1];\n  var sz = s[2];\n  out[0] = (1 - (yy + zz)) * sx;\n  out[1] = (xy + wz) * sx;\n  out[2] = (xz - wy) * sx;\n  out[3] = 0;\n  out[4] = (xy - wz) * sy;\n  out[5] = (1 - (xx + zz)) * sy;\n  out[6] = (yz + wx) * sy;\n  out[7] = 0;\n  out[8] = (xz + wy) * sz;\n  out[9] = (yz - wx) * sz;\n  out[10] = (1 - (xx + yy)) * sz;\n  out[11] = 0;\n  out[12] = v[0];\n  out[13] = v[1];\n  out[14] = v[2];\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n *     mat4.identity(dest);\r\n *     mat4.translate(dest, vec);\r\n *     mat4.translate(dest, origin);\r\n *     let quatMat = mat4.create();\r\n *     quat4.toMat4(quat, quatMat);\r\n *     mat4.multiply(dest, quatMat);\r\n *     mat4.scale(dest, scale)\r\n *     mat4.translate(dest, negativeOrigin);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {vec3} v Translation vector\r\n * @param {vec3} s Scaling vector\r\n * @param {vec3} o The origin vector around which to scale and rotate\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n  // Quaternion math\n  var x = q[0],\n      y = q[1],\n      z = q[2],\n      w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var xy = x * y2;\n  var xz = x * z2;\n  var yy = y * y2;\n  var yz = y * z2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  var sx = s[0];\n  var sy = s[1];\n  var sz = s[2];\n  var ox = o[0];\n  var oy = o[1];\n  var oz = o[2];\n  var out0 = (1 - (yy + zz)) * sx;\n  var out1 = (xy + wz) * sx;\n  var out2 = (xz - wy) * sx;\n  var out4 = (xy - wz) * sy;\n  var out5 = (1 - (xx + zz)) * sy;\n  var out6 = (yz + wx) * sy;\n  var out8 = (xz + wy) * sz;\n  var out9 = (yz - wx) * sz;\n  var out10 = (1 - (xx + yy)) * sz;\n  out[0] = out0;\n  out[1] = out1;\n  out[2] = out2;\n  out[3] = 0;\n  out[4] = out4;\n  out[5] = out5;\n  out[6] = out6;\n  out[7] = 0;\n  out[8] = out8;\n  out[9] = out9;\n  out[10] = out10;\n  out[11] = 0;\n  out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n  out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n  out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat4} out\r\n */\n\nexport function fromQuat(out, q) {\n  var x = q[0],\n      y = q[1],\n      z = q[2],\n      w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var yx = y * x2;\n  var yy = y * y2;\n  var zx = z * x2;\n  var zy = z * y2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  out[0] = 1 - yy - zz;\n  out[1] = yx + wz;\n  out[2] = zx - wy;\n  out[3] = 0;\n  out[4] = yx - wz;\n  out[5] = 1 - xx - zz;\n  out[6] = zy + wx;\n  out[7] = 0;\n  out[8] = zx + wy;\n  out[9] = zy - wx;\n  out[10] = 1 - xx - yy;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Generates a frustum matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Number} left Left bound of the frustum\r\n * @param {Number} right Right bound of the frustum\r\n * @param {Number} bottom Bottom bound of the frustum\r\n * @param {Number} top Top bound of the frustum\r\n * @param {Number} near Near bound of the frustum\r\n * @param {Number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n  var rl = 1 / (right - left);\n  var tb = 1 / (top - bottom);\n  var nf = 1 / (near - far);\n  out[0] = near * 2 * rl;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = near * 2 * tb;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = (right + left) * rl;\n  out[9] = (top + bottom) * tb;\n  out[10] = (far + near) * nf;\n  out[11] = -1;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = far * near * 2 * nf;\n  out[15] = 0;\n  return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} fovy Vertical field of view in radians\r\n * @param {number} aspect Aspect ratio. typically viewport width/height\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum, can be null or Infinity\r\n * @returns {mat4} out\r\n */\n\nexport function perspective(out, fovy, aspect, near, far) {\n  var f = 1.0 / Math.tan(fovy / 2),\n      nf;\n  out[0] = f / aspect;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = f;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[11] = -1;\n  out[12] = 0;\n  out[13] = 0;\n  out[15] = 0;\n\n  if (far != null && far !== Infinity) {\n    nf = 1 / (near - far);\n    out[10] = (far + near) * nf;\n    out[14] = 2 * far * near * nf;\n  } else {\n    out[10] = -1;\n    out[14] = -2 * near;\n  }\n\n  return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n  var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n  var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n  var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n  var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n  var xScale = 2.0 / (leftTan + rightTan);\n  var yScale = 2.0 / (upTan + downTan);\n  out[0] = xScale;\n  out[1] = 0.0;\n  out[2] = 0.0;\n  out[3] = 0.0;\n  out[4] = 0.0;\n  out[5] = yScale;\n  out[6] = 0.0;\n  out[7] = 0.0;\n  out[8] = -((leftTan - rightTan) * xScale * 0.5);\n  out[9] = (upTan - downTan) * yScale * 0.5;\n  out[10] = far / (near - far);\n  out[11] = -1.0;\n  out[12] = 0.0;\n  out[13] = 0.0;\n  out[14] = far * near / (near - far);\n  out[15] = 0.0;\n  return out;\n}\n/**\r\n * Generates a orthogonal projection matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} left Left bound of the frustum\r\n * @param {number} right Right bound of the frustum\r\n * @param {number} bottom Bottom bound of the frustum\r\n * @param {number} top Top bound of the frustum\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function ortho(out, left, right, bottom, top, near, far) {\n  var lr = 1 / (left - right);\n  var bt = 1 / (bottom - top);\n  var nf = 1 / (near - far);\n  out[0] = -2 * lr;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = -2 * bt;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 2 * nf;\n  out[11] = 0;\n  out[12] = (left + right) * lr;\n  out[13] = (top + bottom) * bt;\n  out[14] = (far + near) * nf;\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {vec3} eye Position of the viewer\r\n * @param {vec3} center Point the viewer is looking at\r\n * @param {vec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function lookAt(out, eye, center, up) {\n  var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n  var eyex = eye[0];\n  var eyey = eye[1];\n  var eyez = eye[2];\n  var upx = up[0];\n  var upy = up[1];\n  var upz = up[2];\n  var centerx = center[0];\n  var centery = center[1];\n  var centerz = center[2];\n\n  if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n    return identity(out);\n  }\n\n  z0 = eyex - centerx;\n  z1 = eyey - centery;\n  z2 = eyez - centerz;\n  len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n  z0 *= len;\n  z1 *= len;\n  z2 *= len;\n  x0 = upy * z2 - upz * z1;\n  x1 = upz * z0 - upx * z2;\n  x2 = upx * z1 - upy * z0;\n  len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n\n  if (!len) {\n    x0 = 0;\n    x1 = 0;\n    x2 = 0;\n  } else {\n    len = 1 / len;\n    x0 *= len;\n    x1 *= len;\n    x2 *= len;\n  }\n\n  y0 = z1 * x2 - z2 * x1;\n  y1 = z2 * x0 - z0 * x2;\n  y2 = z0 * x1 - z1 * x0;\n  len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n\n  if (!len) {\n    y0 = 0;\n    y1 = 0;\n    y2 = 0;\n  } else {\n    len = 1 / len;\n    y0 *= len;\n    y1 *= len;\n    y2 *= len;\n  }\n\n  out[0] = x0;\n  out[1] = y0;\n  out[2] = z0;\n  out[3] = 0;\n  out[4] = x1;\n  out[5] = y1;\n  out[6] = z1;\n  out[7] = 0;\n  out[8] = x2;\n  out[9] = y2;\n  out[10] = z2;\n  out[11] = 0;\n  out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n  out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n  out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n  out[15] = 1;\n  return out;\n}\n/**\r\n * Generates a matrix that makes something look at something else.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {vec3} eye Position of the viewer\r\n * @param {vec3} center Point the viewer is looking at\r\n * @param {vec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function targetTo(out, eye, target, up) {\n  var eyex = eye[0],\n      eyey = eye[1],\n      eyez = eye[2],\n      upx = up[0],\n      upy = up[1],\n      upz = up[2];\n  var z0 = eyex - target[0],\n      z1 = eyey - target[1],\n      z2 = eyez - target[2];\n  var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n  if (len > 0) {\n    len = 1 / Math.sqrt(len);\n    z0 *= len;\n    z1 *= len;\n    z2 *= len;\n  }\n\n  var x0 = upy * z2 - upz * z1,\n      x1 = upz * z0 - upx * z2,\n      x2 = upx * z1 - upy * z0;\n  len = x0 * x0 + x1 * x1 + x2 * x2;\n\n  if (len > 0) {\n    len = 1 / Math.sqrt(len);\n    x0 *= len;\n    x1 *= len;\n    x2 *= len;\n  }\n\n  out[0] = x0;\n  out[1] = x1;\n  out[2] = x2;\n  out[3] = 0;\n  out[4] = z1 * x2 - z2 * x1;\n  out[5] = z2 * x0 - z0 * x2;\n  out[6] = z0 * x1 - z1 * x0;\n  out[7] = 0;\n  out[8] = z0;\n  out[9] = z1;\n  out[10] = z2;\n  out[11] = 0;\n  out[12] = eyex;\n  out[13] = eyey;\n  out[14] = eyez;\n  out[15] = 1;\n  return out;\n}\n;\n/**\r\n * Returns a string representation of a mat4\r\n *\r\n * @param {mat4} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n  return 'mat4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ', ' + a[4] + ', ' + a[5] + ', ' + a[6] + ', ' + a[7] + ', ' + a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' + a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')';\n}\n/**\r\n * Returns Frobenius norm of a mat4\r\n *\r\n * @param {mat4} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n  return Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2) + Math.pow(a[9], 2) + Math.pow(a[10], 2) + Math.pow(a[11], 2) + Math.pow(a[12], 2) + Math.pow(a[13], 2) + Math.pow(a[14], 2) + Math.pow(a[15], 2));\n}\n/**\r\n * Adds two mat4's\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the first operand\r\n * @param {mat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  out[3] = a[3] + b[3];\n  out[4] = a[4] + b[4];\n  out[5] = a[5] + b[5];\n  out[6] = a[6] + b[6];\n  out[7] = a[7] + b[7];\n  out[8] = a[8] + b[8];\n  out[9] = a[9] + b[9];\n  out[10] = a[10] + b[10];\n  out[11] = a[11] + b[11];\n  out[12] = a[12] + b[12];\n  out[13] = a[13] + b[13];\n  out[14] = a[14] + b[14];\n  out[15] = a[15] + b[15];\n  return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the first operand\r\n * @param {mat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  out[3] = a[3] - b[3];\n  out[4] = a[4] - b[4];\n  out[5] = a[5] - b[5];\n  out[6] = a[6] - b[6];\n  out[7] = a[7] - b[7];\n  out[8] = a[8] - b[8];\n  out[9] = a[9] - b[9];\n  out[10] = a[10] - b[10];\n  out[11] = a[11] - b[11];\n  out[12] = a[12] - b[12];\n  out[13] = a[13] - b[13];\n  out[14] = a[14] - b[14];\n  out[15] = a[15] - b[15];\n  return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {mat4} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  out[3] = a[3] * b;\n  out[4] = a[4] * b;\n  out[5] = a[5] * b;\n  out[6] = a[6] * b;\n  out[7] = a[7] * b;\n  out[8] = a[8] * b;\n  out[9] = a[9] * b;\n  out[10] = a[10] * b;\n  out[11] = a[11] * b;\n  out[12] = a[12] * b;\n  out[13] = a[13] * b;\n  out[14] = a[14] * b;\n  out[15] = a[15] * b;\n  return out;\n}\n/**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat4} out the receiving vector\r\n * @param {mat4} a the first operand\r\n * @param {mat4} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  out[3] = a[3] + b[3] * scale;\n  out[4] = a[4] + b[4] * scale;\n  out[5] = a[5] + b[5] * scale;\n  out[6] = a[6] + b[6] * scale;\n  out[7] = a[7] + b[7] * scale;\n  out[8] = a[8] + b[8] * scale;\n  out[9] = a[9] + b[9] * scale;\n  out[10] = a[10] + b[10] * scale;\n  out[11] = a[11] + b[11] * scale;\n  out[12] = a[12] + b[12] * scale;\n  out[13] = a[13] + b[13] * scale;\n  out[14] = a[14] + b[14] * scale;\n  out[15] = a[15] + b[15] * scale;\n  return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {mat4} a The first matrix.\r\n * @param {mat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {mat4} a The first matrix.\r\n * @param {mat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2],\n      a3 = a[3];\n  var a4 = a[4],\n      a5 = a[5],\n      a6 = a[6],\n      a7 = a[7];\n  var a8 = a[8],\n      a9 = a[9],\n      a10 = a[10],\n      a11 = a[11];\n  var a12 = a[12],\n      a13 = a[13],\n      a14 = a[14],\n      a15 = a[15];\n  var b0 = b[0],\n      b1 = b[1],\n      b2 = b[2],\n      b3 = b[3];\n  var b4 = b[4],\n      b5 = b[5],\n      b6 = b[6],\n      b7 = b[7];\n  var b8 = b[8],\n      b9 = b[9],\n      b10 = b[10],\n      b11 = b[11];\n  var b12 = b[12],\n      b13 = b[13],\n      b14 = b[14],\n      b15 = b[15];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\r\n * Alias for {@link mat4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 2 Dimensional Vector\r\n * @module vec2\r\n */\n\n/**\r\n * Creates a new, empty vec2\r\n *\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(2);\n\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n  }\n\n  return out;\n}\n/**\r\n * Creates a new vec2 initialized with values from an existing vector\r\n *\r\n * @param {vec2} a vector to clone\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(2);\n  out[0] = a[0];\n  out[1] = a[1];\n  return out;\n}\n/**\r\n * Creates a new vec2 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function fromValues(x, y) {\n  var out = new glMatrix.ARRAY_TYPE(2);\n  out[0] = x;\n  out[1] = y;\n  return out;\n}\n/**\r\n * Copy the values from one vec2 to another\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the source vector\r\n * @returns {vec2} out\r\n */\n\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  return out;\n}\n/**\r\n * Set the components of a vec2 to the given values\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} out\r\n */\n\nexport function set(out, x, y) {\n  out[0] = x;\n  out[1] = y;\n  return out;\n}\n/**\r\n * Adds two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  return out;\n}\n/**\r\n * Multiplies two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function multiply(out, a, b) {\n  out[0] = a[0] * b[0];\n  out[1] = a[1] * b[1];\n  return out;\n}\n/**\r\n * Divides two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function divide(out, a, b) {\n  out[0] = a[0] / b[0];\n  out[1] = a[1] / b[1];\n  return out;\n}\n/**\r\n * Math.ceil the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a vector to ceil\r\n * @returns {vec2} out\r\n */\n\nexport function ceil(out, a) {\n  out[0] = Math.ceil(a[0]);\n  out[1] = Math.ceil(a[1]);\n  return out;\n}\n/**\r\n * Math.floor the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a vector to floor\r\n * @returns {vec2} out\r\n */\n\nexport function floor(out, a) {\n  out[0] = Math.floor(a[0]);\n  out[1] = Math.floor(a[1]);\n  return out;\n}\n/**\r\n * Returns the minimum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function min(out, a, b) {\n  out[0] = Math.min(a[0], b[0]);\n  out[1] = Math.min(a[1], b[1]);\n  return out;\n}\n/**\r\n * Returns the maximum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function max(out, a, b) {\n  out[0] = Math.max(a[0], b[0]);\n  out[1] = Math.max(a[1], b[1]);\n  return out;\n}\n/**\r\n * Math.round the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a vector to round\r\n * @returns {vec2} out\r\n */\n\nexport function round(out, a) {\n  out[0] = Math.round(a[0]);\n  out[1] = Math.round(a[1]);\n  return out;\n}\n/**\r\n * Scales a vec2 by a scalar number\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec2} out\r\n */\n\nexport function scale(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  return out;\n}\n/**\r\n * Adds two vec2's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec2} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec2's\r\n *\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n  var x = b[0] - a[0],\n      y = b[1] - a[1];\n  return Math.sqrt(x * x + y * y);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec2's\r\n *\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n  var x = b[0] - a[0],\n      y = b[1] - a[1];\n  return x * x + y * y;\n}\n/**\r\n * Calculates the length of a vec2\r\n *\r\n * @param {vec2} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n  var x = a[0],\n      y = a[1];\n  return Math.sqrt(x * x + y * y);\n}\n/**\r\n * Calculates the squared length of a vec2\r\n *\r\n * @param {vec2} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n  var x = a[0],\n      y = a[1];\n  return x * x + y * y;\n}\n/**\r\n * Negates the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a vector to negate\r\n * @returns {vec2} out\r\n */\n\nexport function negate(out, a) {\n  out[0] = -a[0];\n  out[1] = -a[1];\n  return out;\n}\n/**\r\n * Returns the inverse of the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a vector to invert\r\n * @returns {vec2} out\r\n */\n\nexport function inverse(out, a) {\n  out[0] = 1.0 / a[0];\n  out[1] = 1.0 / a[1];\n  return out;\n}\n/**\r\n * Normalize a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a vector to normalize\r\n * @returns {vec2} out\r\n */\n\nexport function normalize(out, a) {\n  var x = a[0],\n      y = a[1];\n  var len = x * x + y * y;\n\n  if (len > 0) {\n    //TODO: evaluate use of glm_invsqrt here?\n    len = 1 / Math.sqrt(len);\n  }\n\n  out[0] = a[0] * len;\n  out[1] = a[1] * len;\n  return out;\n}\n/**\r\n * Calculates the dot product of two vec2's\r\n *\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n  return a[0] * b[0] + a[1] * b[1];\n}\n/**\r\n * Computes the cross product of two vec2's\r\n * Note that the cross product must by definition produce a 3D vector\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n  var z = a[0] * b[1] - a[1] * b[0];\n  out[0] = out[1] = 0;\n  out[2] = z;\n  return out;\n}\n/**\r\n * Performs a linear interpolation between two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the first operand\r\n * @param {vec2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n  var ax = a[0],\n      ay = a[1];\n  out[0] = ax + t * (b[0] - ax);\n  out[1] = ay + t * (b[1] - ay);\n  return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec2} out\r\n */\n\nexport function random(out, scale) {\n  scale = scale || 1.0;\n  var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n  out[0] = Math.cos(r) * scale;\n  out[1] = Math.sin(r) * scale;\n  return out;\n}\n/**\r\n * Transforms the vec2 with a mat2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the vector to transform\r\n * @param {mat2} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2(out, a, m) {\n  var x = a[0],\n      y = a[1];\n  out[0] = m[0] * x + m[2] * y;\n  out[1] = m[1] * x + m[3] * y;\n  return out;\n}\n/**\r\n * Transforms the vec2 with a mat2d\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the vector to transform\r\n * @param {mat2d} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2d(out, a, m) {\n  var x = a[0],\n      y = a[1];\n  out[0] = m[0] * x + m[2] * y + m[4];\n  out[1] = m[1] * x + m[3] * y + m[5];\n  return out;\n}\n/**\r\n * Transforms the vec2 with a mat3\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the vector to transform\r\n * @param {mat3} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat3(out, a, m) {\n  var x = a[0],\n      y = a[1];\n  out[0] = m[0] * x + m[3] * y + m[6];\n  out[1] = m[1] * x + m[4] * y + m[7];\n  return out;\n}\n/**\r\n * Transforms the vec2 with a mat4\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {vec2} a the vector to transform\r\n * @param {mat4} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat4(out, a, m) {\n  var x = a[0];\n  var y = a[1];\n  out[0] = m[0] * x + m[4] * y + m[12];\n  out[1] = m[1] * x + m[5] * y + m[13];\n  return out;\n}\n/**\r\n * Rotate a 2D vector\r\n * @param {vec2} out The receiving vec2\r\n * @param {vec2} a The vec2 point to rotate\r\n * @param {vec2} b The origin of the rotation\r\n * @param {Number} c The angle of rotation\r\n * @returns {vec2} out\r\n */\n\nexport function rotate(out, a, b, c) {\n  //Translate point to the origin\n  var p0 = a[0] - b[0],\n      p1 = a[1] - b[1],\n      sinC = Math.sin(c),\n      cosC = Math.cos(c); //perform rotation and translate to correct position\n\n  out[0] = p0 * cosC - p1 * sinC + b[0];\n  out[1] = p0 * sinC + p1 * cosC + b[1];\n  return out;\n}\n/**\r\n * Get the angle between two 2D vectors\r\n * @param {vec2} a The first operand\r\n * @param {vec2} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n  var x1 = a[0],\n      y1 = a[1],\n      x2 = b[0],\n      y2 = b[1];\n  var len1 = x1 * x1 + y1 * y1;\n\n  if (len1 > 0) {\n    //TODO: evaluate use of glm_invsqrt here?\n    len1 = 1 / Math.sqrt(len1);\n  }\n\n  var len2 = x2 * x2 + y2 * y2;\n\n  if (len2 > 0) {\n    //TODO: evaluate use of glm_invsqrt here?\n    len2 = 1 / Math.sqrt(len2);\n  }\n\n  var cosine = (x1 * x2 + y1 * y2) * len1 * len2;\n\n  if (cosine > 1.0) {\n    return 0;\n  } else if (cosine < -1.0) {\n    return Math.PI;\n  } else {\n    return Math.acos(cosine);\n  }\n}\n/**\r\n * Set the components of a vec2 to zero\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @returns {vec2} out\r\n */\n\nexport function zero(out) {\n  out[0] = 0.0;\n  out[1] = 0.0;\n  return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {vec2} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n  return 'vec2(' + a[0] + ', ' + a[1] + ')';\n}\n/**\r\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\r\n *\r\n * @param {vec2} a The first vector.\r\n * @param {vec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {vec2} a The first vector.\r\n * @param {vec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n  var a0 = a[0],\n      a1 = a[1];\n  var b0 = b[0],\n      b1 = b[1];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\r\n * Alias for {@link vec2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec2.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec2.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec2.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec2s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n\n    if (!stride) {\n      stride = 2;\n    }\n\n    if (!offset) {\n      offset = 0;\n    }\n\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\n    }\n\n    for (i = offset; i < l; i += stride) {\n      vec[0] = a[i];\n      vec[1] = a[i + 1];\n      fn(vec, vec, arg);\n      a[i] = vec[0];\n      a[i + 1] = vec[1];\n    }\n\n    return a;\n  };\n}();","export default function assert(condition, message) {\n  if (!condition) {\n    throw new Error(message || 'viewport-mercator-project: assertion failed.');\n  }\n}\n//# sourceMappingURL=assert.js.map","import * as glMatrix from \"./common.js\";\n/**\r\n * 3 Dimensional Vector\r\n * @module vec3\r\n */\n\n/**\r\n * Creates a new, empty vec3\r\n *\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(3);\n\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n  }\n\n  return out;\n}\n/**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n *\r\n * @param {vec3} a vector to clone\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(3);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  return out;\n}\n/**\r\n * Calculates the length of a vec3\r\n *\r\n * @param {vec3} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  return Math.sqrt(x * x + y * y + z * z);\n}\n/**\r\n * Creates a new vec3 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function fromValues(x, y, z) {\n  var out = new glMatrix.ARRAY_TYPE(3);\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  return out;\n}\n/**\r\n * Copy the values from one vec3 to another\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the source vector\r\n * @returns {vec3} out\r\n */\n\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  return out;\n}\n/**\r\n * Set the components of a vec3 to the given values\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} out\r\n */\n\nexport function set(out, x, y, z) {\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  return out;\n}\n/**\r\n * Adds two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  return out;\n}\n/**\r\n * Multiplies two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function multiply(out, a, b) {\n  out[0] = a[0] * b[0];\n  out[1] = a[1] * b[1];\n  out[2] = a[2] * b[2];\n  return out;\n}\n/**\r\n * Divides two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function divide(out, a, b) {\n  out[0] = a[0] / b[0];\n  out[1] = a[1] / b[1];\n  out[2] = a[2] / b[2];\n  return out;\n}\n/**\r\n * Math.ceil the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a vector to ceil\r\n * @returns {vec3} out\r\n */\n\nexport function ceil(out, a) {\n  out[0] = Math.ceil(a[0]);\n  out[1] = Math.ceil(a[1]);\n  out[2] = Math.ceil(a[2]);\n  return out;\n}\n/**\r\n * Math.floor the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a vector to floor\r\n * @returns {vec3} out\r\n */\n\nexport function floor(out, a) {\n  out[0] = Math.floor(a[0]);\n  out[1] = Math.floor(a[1]);\n  out[2] = Math.floor(a[2]);\n  return out;\n}\n/**\r\n * Returns the minimum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function min(out, a, b) {\n  out[0] = Math.min(a[0], b[0]);\n  out[1] = Math.min(a[1], b[1]);\n  out[2] = Math.min(a[2], b[2]);\n  return out;\n}\n/**\r\n * Returns the maximum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function max(out, a, b) {\n  out[0] = Math.max(a[0], b[0]);\n  out[1] = Math.max(a[1], b[1]);\n  out[2] = Math.max(a[2], b[2]);\n  return out;\n}\n/**\r\n * Math.round the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a vector to round\r\n * @returns {vec3} out\r\n */\n\nexport function round(out, a) {\n  out[0] = Math.round(a[0]);\n  out[1] = Math.round(a[1]);\n  out[2] = Math.round(a[2]);\n  return out;\n}\n/**\r\n * Scales a vec3 by a scalar number\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec3} out\r\n */\n\nexport function scale(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  return out;\n}\n/**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec3} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec3's\r\n *\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  return Math.sqrt(x * x + y * y + z * z);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec3's\r\n *\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  return x * x + y * y + z * z;\n}\n/**\r\n * Calculates the squared length of a vec3\r\n *\r\n * @param {vec3} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  return x * x + y * y + z * z;\n}\n/**\r\n * Negates the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a vector to negate\r\n * @returns {vec3} out\r\n */\n\nexport function negate(out, a) {\n  out[0] = -a[0];\n  out[1] = -a[1];\n  out[2] = -a[2];\n  return out;\n}\n/**\r\n * Returns the inverse of the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a vector to invert\r\n * @returns {vec3} out\r\n */\n\nexport function inverse(out, a) {\n  out[0] = 1.0 / a[0];\n  out[1] = 1.0 / a[1];\n  out[2] = 1.0 / a[2];\n  return out;\n}\n/**\r\n * Normalize a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a vector to normalize\r\n * @returns {vec3} out\r\n */\n\nexport function normalize(out, a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var len = x * x + y * y + z * z;\n\n  if (len > 0) {\n    //TODO: evaluate use of glm_invsqrt here?\n    len = 1 / Math.sqrt(len);\n  }\n\n  out[0] = a[0] * len;\n  out[1] = a[1] * len;\n  out[2] = a[2] * len;\n  return out;\n}\n/**\r\n * Calculates the dot product of two vec3's\r\n *\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\r\n * Computes the cross product of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n  var ax = a[0],\n      ay = a[1],\n      az = a[2];\n  var bx = b[0],\n      by = b[1],\n      bz = b[2];\n  out[0] = ay * bz - az * by;\n  out[1] = az * bx - ax * bz;\n  out[2] = ax * by - ay * bx;\n  return out;\n}\n/**\r\n * Performs a linear interpolation between two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function lerp(out, a, b, t) {\n  var ax = a[0];\n  var ay = a[1];\n  var az = a[2];\n  out[0] = ax + t * (b[0] - ax);\n  out[1] = ay + t * (b[1] - ay);\n  out[2] = az + t * (b[2] - az);\n  return out;\n}\n/**\r\n * Performs a hermite interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @param {vec3} c the third operand\r\n * @param {vec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function hermite(out, a, b, c, d, t) {\n  var factorTimes2 = t * t;\n  var factor1 = factorTimes2 * (2 * t - 3) + 1;\n  var factor2 = factorTimes2 * (t - 2) + t;\n  var factor3 = factorTimes2 * (t - 1);\n  var factor4 = factorTimes2 * (3 - 2 * t);\n  out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n  out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n  out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n  return out;\n}\n/**\r\n * Performs a bezier interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the first operand\r\n * @param {vec3} b the second operand\r\n * @param {vec3} c the third operand\r\n * @param {vec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function bezier(out, a, b, c, d, t) {\n  var inverseFactor = 1 - t;\n  var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n  var factorTimes2 = t * t;\n  var factor1 = inverseFactorTimesTwo * inverseFactor;\n  var factor2 = 3 * t * inverseFactorTimesTwo;\n  var factor3 = 3 * factorTimes2 * inverseFactor;\n  var factor4 = factorTimes2 * t;\n  out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n  out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n  out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n  return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec3} out\r\n */\n\nexport function random(out, scale) {\n  scale = scale || 1.0;\n  var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n  var z = glMatrix.RANDOM() * 2.0 - 1.0;\n  var zScale = Math.sqrt(1.0 - z * z) * scale;\n  out[0] = Math.cos(r) * zScale;\n  out[1] = Math.sin(r) * zScale;\n  out[2] = z * scale;\n  return out;\n}\n/**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the vector to transform\r\n * @param {mat4} m matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat4(out, a, m) {\n  var x = a[0],\n      y = a[1],\n      z = a[2];\n  var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n  w = w || 1.0;\n  out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n  out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n  out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n  return out;\n}\n/**\r\n * Transforms the vec3 with a mat3.\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the vector to transform\r\n * @param {mat3} m the 3x3 matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat3(out, a, m) {\n  var x = a[0],\n      y = a[1],\n      z = a[2];\n  out[0] = x * m[0] + y * m[3] + z * m[6];\n  out[1] = x * m[1] + y * m[4] + z * m[7];\n  out[2] = x * m[2] + y * m[5] + z * m[8];\n  return out;\n}\n/**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {vec3} a the vector to transform\r\n * @param {quat} q quaternion to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformQuat(out, a, q) {\n  // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n  var qx = q[0],\n      qy = q[1],\n      qz = q[2],\n      qw = q[3];\n  var x = a[0],\n      y = a[1],\n      z = a[2]; // var qvec = [qx, qy, qz];\n  // var uv = vec3.cross([], qvec, a);\n\n  var uvx = qy * z - qz * y,\n      uvy = qz * x - qx * z,\n      uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n  var uuvx = qy * uvz - qz * uvy,\n      uuvy = qz * uvx - qx * uvz,\n      uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n  var w2 = qw * 2;\n  uvx *= w2;\n  uvy *= w2;\n  uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n  uuvx *= 2;\n  uuvy *= 2;\n  uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n  out[0] = x + uvx + uuvx;\n  out[1] = y + uvy + uuvy;\n  out[2] = z + uvz + uuvz;\n  return out;\n}\n/**\r\n * Rotate a 3D vector around the x-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {vec3} a The vec3 point to rotate\r\n * @param {vec3} b The origin of the rotation\r\n * @param {Number} c The angle of rotation\r\n * @returns {vec3} out\r\n */\n\nexport function rotateX(out, a, b, c) {\n  var p = [],\n      r = []; //Translate point to the origin\n\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2]; //perform rotation\n\n  r[0] = p[0];\n  r[1] = p[1] * Math.cos(c) - p[2] * Math.sin(c);\n  r[2] = p[1] * Math.sin(c) + p[2] * Math.cos(c); //translate to correct position\n\n  out[0] = r[0] + b[0];\n  out[1] = r[1] + b[1];\n  out[2] = r[2] + b[2];\n  return out;\n}\n/**\r\n * Rotate a 3D vector around the y-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {vec3} a The vec3 point to rotate\r\n * @param {vec3} b The origin of the rotation\r\n * @param {Number} c The angle of rotation\r\n * @returns {vec3} out\r\n */\n\nexport function rotateY(out, a, b, c) {\n  var p = [],\n      r = []; //Translate point to the origin\n\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2]; //perform rotation\n\n  r[0] = p[2] * Math.sin(c) + p[0] * Math.cos(c);\n  r[1] = p[1];\n  r[2] = p[2] * Math.cos(c) - p[0] * Math.sin(c); //translate to correct position\n\n  out[0] = r[0] + b[0];\n  out[1] = r[1] + b[1];\n  out[2] = r[2] + b[2];\n  return out;\n}\n/**\r\n * Rotate a 3D vector around the z-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {vec3} a The vec3 point to rotate\r\n * @param {vec3} b The origin of the rotation\r\n * @param {Number} c The angle of rotation\r\n * @returns {vec3} out\r\n */\n\nexport function rotateZ(out, a, b, c) {\n  var p = [],\n      r = []; //Translate point to the origin\n\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2]; //perform rotation\n\n  r[0] = p[0] * Math.cos(c) - p[1] * Math.sin(c);\n  r[1] = p[0] * Math.sin(c) + p[1] * Math.cos(c);\n  r[2] = p[2]; //translate to correct position\n\n  out[0] = r[0] + b[0];\n  out[1] = r[1] + b[1];\n  out[2] = r[2] + b[2];\n  return out;\n}\n/**\r\n * Get the angle between two 3D vectors\r\n * @param {vec3} a The first operand\r\n * @param {vec3} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n  var tempA = fromValues(a[0], a[1], a[2]);\n  var tempB = fromValues(b[0], b[1], b[2]);\n  normalize(tempA, tempA);\n  normalize(tempB, tempB);\n  var cosine = dot(tempA, tempB);\n\n  if (cosine > 1.0) {\n    return 0;\n  } else if (cosine < -1.0) {\n    return Math.PI;\n  } else {\n    return Math.acos(cosine);\n  }\n}\n/**\r\n * Set the components of a vec3 to zero\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @returns {vec3} out\r\n */\n\nexport function zero(out) {\n  out[0] = 0.0;\n  out[1] = 0.0;\n  out[2] = 0.0;\n  return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {vec3} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n  return 'vec3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ')';\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {vec3} a The first vector.\r\n * @param {vec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {vec3} a The first vector.\r\n * @param {vec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2];\n  var b0 = b[0],\n      b1 = b[1],\n      b2 = b[2];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\r\n * Alias for {@link vec3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec3.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec3.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec3.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec3.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec3.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec3s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n\n    if (!stride) {\n      stride = 3;\n    }\n\n    if (!offset) {\n      offset = 0;\n    }\n\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\n    }\n\n    for (i = offset; i < l; i += stride) {\n      vec[0] = a[i];\n      vec[1] = a[i + 1];\n      vec[2] = a[i + 2];\n      fn(vec, vec, arg);\n      a[i] = vec[0];\n      a[i + 1] = vec[1];\n      a[i + 2] = vec[2];\n    }\n\n    return a;\n  };\n}();","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { createMat4, transformVector } from './math-utils';\nimport * as mat4 from 'gl-matrix/mat4';\nimport * as vec2 from 'gl-matrix/vec2';\nimport * as vec3 from 'gl-matrix/vec3';\nimport assert from './assert';\nvar PI = Math.PI;\nvar PI_4 = PI / 4;\nvar DEGREES_TO_RADIANS = PI / 180;\nvar RADIANS_TO_DEGREES = 180 / PI;\nvar TILE_SIZE = 512;\nvar EARTH_CIRCUMFERENCE = 40.03e6;\nvar DEFAULT_ALTITUDE = 1.5;\nexport function zoomToScale(zoom) {\n  return Math.pow(2, zoom);\n}\nexport function scaleToZoom(scale) {\n  return Math.log2(scale);\n}\nexport function lngLatToWorld(_ref, scale) {\n  var _ref2 = _slicedToArray(_ref, 2),\n      lng = _ref2[0],\n      lat = _ref2[1];\n\n  assert(Number.isFinite(lng) && Number.isFinite(scale));\n  assert(Number.isFinite(lat) && lat >= -90 && lat <= 90, 'invalid latitude');\n  scale *= TILE_SIZE;\n  var lambda2 = lng * DEGREES_TO_RADIANS;\n  var phi2 = lat * DEGREES_TO_RADIANS;\n  var x = scale * (lambda2 + PI) / (2 * PI);\n  var y = scale * (PI - Math.log(Math.tan(PI_4 + phi2 * 0.5))) / (2 * PI);\n  return [x, y];\n}\nexport function worldToLngLat(_ref3, scale) {\n  var _ref4 = _slicedToArray(_ref3, 2),\n      x = _ref4[0],\n      y = _ref4[1];\n\n  scale *= TILE_SIZE;\n  var lambda2 = x / scale * (2 * PI) - PI;\n  var phi2 = 2 * (Math.atan(Math.exp(PI - y / scale * (2 * PI))) - PI_4);\n  return [lambda2 * RADIANS_TO_DEGREES, phi2 * RADIANS_TO_DEGREES];\n}\nexport function getMeterZoom(_ref5) {\n  var latitude = _ref5.latitude;\n  assert(Number.isFinite(latitude));\n  var latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n  return scaleToZoom(EARTH_CIRCUMFERENCE * latCosine) - 9;\n}\nexport function getDistanceScales(_ref6) {\n  var latitude = _ref6.latitude,\n      longitude = _ref6.longitude,\n      zoom = _ref6.zoom,\n      scale = _ref6.scale,\n      _ref6$highPrecision = _ref6.highPrecision,\n      highPrecision = _ref6$highPrecision === void 0 ? false : _ref6$highPrecision;\n  scale = scale !== undefined ? scale : zoomToScale(zoom);\n  assert(Number.isFinite(latitude) && Number.isFinite(longitude) && Number.isFinite(scale));\n  var result = {};\n  var worldSize = TILE_SIZE * scale;\n  var latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n  var pixelsPerDegreeX = worldSize / 360;\n  var pixelsPerDegreeY = pixelsPerDegreeX / latCosine;\n  var altPixelsPerMeter = worldSize / EARTH_CIRCUMFERENCE / latCosine;\n  result.pixelsPerMeter = [altPixelsPerMeter, -altPixelsPerMeter, altPixelsPerMeter];\n  result.metersPerPixel = [1 / altPixelsPerMeter, -1 / altPixelsPerMeter, 1 / altPixelsPerMeter];\n  result.pixelsPerDegree = [pixelsPerDegreeX, -pixelsPerDegreeY, altPixelsPerMeter];\n  result.degreesPerPixel = [1 / pixelsPerDegreeX, -1 / pixelsPerDegreeY, 1 / altPixelsPerMeter];\n\n  if (highPrecision) {\n    var latCosine2 = DEGREES_TO_RADIANS * Math.tan(latitude * DEGREES_TO_RADIANS) / latCosine;\n    var pixelsPerDegreeY2 = pixelsPerDegreeX * latCosine2 / 2;\n    var altPixelsPerDegree2 = worldSize / EARTH_CIRCUMFERENCE * latCosine2;\n    var altPixelsPerMeter2 = altPixelsPerDegree2 / pixelsPerDegreeY * altPixelsPerMeter;\n    result.pixelsPerDegree2 = [0, -pixelsPerDegreeY2, altPixelsPerDegree2];\n    result.pixelsPerMeter2 = [altPixelsPerMeter2, 0, altPixelsPerMeter2];\n  }\n\n  return result;\n}\nexport function addMetersToLngLat(lngLatZ, xyz) {\n  var _lngLatZ = _slicedToArray(lngLatZ, 3),\n      longitude = _lngLatZ[0],\n      latitude = _lngLatZ[1],\n      z0 = _lngLatZ[2];\n\n  var _xyz = _slicedToArray(xyz, 3),\n      x = _xyz[0],\n      y = _xyz[1],\n      z = _xyz[2];\n\n  var scale = 1;\n\n  var _getDistanceScales = getDistanceScales({\n    longitude: longitude,\n    latitude: latitude,\n    scale: scale,\n    highPrecision: true\n  }),\n      pixelsPerMeter = _getDistanceScales.pixelsPerMeter,\n      pixelsPerMeter2 = _getDistanceScales.pixelsPerMeter2;\n\n  var worldspace = lngLatToWorld(lngLatZ, scale);\n  worldspace[0] += x * (pixelsPerMeter[0] + pixelsPerMeter2[0] * y);\n  worldspace[1] += y * (pixelsPerMeter[1] + pixelsPerMeter2[1] * y);\n  var newLngLat = worldToLngLat(worldspace, scale);\n  var newZ = (z0 || 0) + (z || 0);\n  return Number.isFinite(z0) || Number.isFinite(z) ? [newLngLat[0], newLngLat[1], newZ] : newLngLat;\n}\nexport function getViewMatrix(_ref7) {\n  var height = _ref7.height,\n      pitch = _ref7.pitch,\n      bearing = _ref7.bearing,\n      altitude = _ref7.altitude,\n      _ref7$center = _ref7.center,\n      center = _ref7$center === void 0 ? null : _ref7$center,\n      _ref7$flipY = _ref7.flipY,\n      flipY = _ref7$flipY === void 0 ? false : _ref7$flipY;\n  var vm = createMat4();\n  mat4.translate(vm, vm, [0, 0, -altitude]);\n  mat4.scale(vm, vm, [1, 1, 1 / height]);\n  mat4.rotateX(vm, vm, -pitch * DEGREES_TO_RADIANS);\n  mat4.rotateZ(vm, vm, bearing * DEGREES_TO_RADIANS);\n\n  if (flipY) {\n    mat4.scale(vm, vm, [1, -1, 1]);\n  }\n\n  if (center) {\n    mat4.translate(vm, vm, vec3.negate([], center));\n  }\n\n  return vm;\n}\nexport function getProjectionParameters(_ref8) {\n  var width = _ref8.width,\n      height = _ref8.height,\n      _ref8$altitude = _ref8.altitude,\n      altitude = _ref8$altitude === void 0 ? DEFAULT_ALTITUDE : _ref8$altitude,\n      _ref8$pitch = _ref8.pitch,\n      pitch = _ref8$pitch === void 0 ? 0 : _ref8$pitch,\n      _ref8$nearZMultiplier = _ref8.nearZMultiplier,\n      nearZMultiplier = _ref8$nearZMultiplier === void 0 ? 1 : _ref8$nearZMultiplier,\n      _ref8$farZMultiplier = _ref8.farZMultiplier,\n      farZMultiplier = _ref8$farZMultiplier === void 0 ? 1 : _ref8$farZMultiplier;\n  var pitchRadians = pitch * DEGREES_TO_RADIANS;\n  var halfFov = Math.atan(0.5 / altitude);\n  var topHalfSurfaceDistance = Math.sin(halfFov) * altitude / Math.sin(Math.PI / 2 - pitchRadians - halfFov);\n  var farZ = Math.cos(Math.PI / 2 - pitchRadians) * topHalfSurfaceDistance + altitude;\n  return {\n    fov: 2 * Math.atan(height / 2 / altitude),\n    aspect: width / height,\n    focalDistance: altitude,\n    near: nearZMultiplier,\n    far: farZ * farZMultiplier\n  };\n}\nexport function getProjectionMatrix(_ref9) {\n  var width = _ref9.width,\n      height = _ref9.height,\n      pitch = _ref9.pitch,\n      altitude = _ref9.altitude,\n      nearZMultiplier = _ref9.nearZMultiplier,\n      farZMultiplier = _ref9.farZMultiplier;\n\n  var _getProjectionParamet = getProjectionParameters({\n    width: width,\n    height: height,\n    altitude: altitude,\n    pitch: pitch,\n    nearZMultiplier: nearZMultiplier,\n    farZMultiplier: farZMultiplier\n  }),\n      fov = _getProjectionParamet.fov,\n      aspect = _getProjectionParamet.aspect,\n      near = _getProjectionParamet.near,\n      far = _getProjectionParamet.far;\n\n  var projectionMatrix = mat4.perspective([], fov, aspect, near, far);\n  return projectionMatrix;\n}\nexport function worldToPixels(xyz, pixelProjectionMatrix) {\n  var _xyz2 = _slicedToArray(xyz, 3),\n      x = _xyz2[0],\n      y = _xyz2[1],\n      _xyz2$ = _xyz2[2],\n      z = _xyz2$ === void 0 ? 0 : _xyz2$;\n\n  assert(Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(z));\n  return transformVector(pixelProjectionMatrix, [x, y, z, 1]);\n}\nexport function pixelsToWorld(xyz, pixelUnprojectionMatrix) {\n  var targetZ = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n  var _xyz3 = _slicedToArray(xyz, 3),\n      x = _xyz3[0],\n      y = _xyz3[1],\n      z = _xyz3[2];\n\n  assert(Number.isFinite(x) && Number.isFinite(y), 'invalid pixel coordinate');\n\n  if (Number.isFinite(z)) {\n    var coord = transformVector(pixelUnprojectionMatrix, [x, y, z, 1]);\n    return coord;\n  }\n\n  var coord0 = transformVector(pixelUnprojectionMatrix, [x, y, 0, 1]);\n  var coord1 = transformVector(pixelUnprojectionMatrix, [x, y, 1, 1]);\n  var z0 = coord0[2];\n  var z1 = coord1[2];\n  var t = z0 === z1 ? 0 : ((targetZ || 0) - z0) / (z1 - z0);\n  return vec2.lerp([], coord0, coord1, t);\n}\n//# sourceMappingURL=web-mercator-utils.js.map","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport { createMat4 } from './math-utils';\nimport { worldToPixels, pixelsToWorld } from './web-mercator-utils';\nimport * as mat4 from 'gl-matrix/mat4';\nvar IDENTITY = createMat4();\n\nvar Viewport = function () {\n  function Viewport() {\n    var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n        width = _ref.width,\n        height = _ref.height,\n        _ref$viewMatrix = _ref.viewMatrix,\n        viewMatrix = _ref$viewMatrix === void 0 ? IDENTITY : _ref$viewMatrix,\n        _ref$projectionMatrix = _ref.projectionMatrix,\n        projectionMatrix = _ref$projectionMatrix === void 0 ? IDENTITY : _ref$projectionMatrix;\n\n    _classCallCheck(this, Viewport);\n\n    this.width = width || 1;\n    this.height = height || 1;\n    this.scale = 1;\n    this.pixelsPerMeter = 1;\n    this.viewMatrix = viewMatrix;\n    this.projectionMatrix = projectionMatrix;\n    var vpm = createMat4();\n    mat4.multiply(vpm, vpm, this.projectionMatrix);\n    mat4.multiply(vpm, vpm, this.viewMatrix);\n    this.viewProjectionMatrix = vpm;\n    var m = createMat4();\n    mat4.scale(m, m, [this.width / 2, -this.height / 2, 1]);\n    mat4.translate(m, m, [1, -1, 0]);\n    mat4.multiply(m, m, this.viewProjectionMatrix);\n    var mInverse = mat4.invert(createMat4(), m);\n\n    if (!mInverse) {\n      throw new Error('Pixel project matrix not invertible');\n    }\n\n    this.pixelProjectionMatrix = m;\n    this.pixelUnprojectionMatrix = mInverse;\n    this.equals = this.equals.bind(this);\n    this.project = this.project.bind(this);\n    this.unproject = this.unproject.bind(this);\n    this.projectPosition = this.projectPosition.bind(this);\n    this.unprojectPosition = this.unprojectPosition.bind(this);\n    this.projectFlat = this.projectFlat.bind(this);\n    this.unprojectFlat = this.unprojectFlat.bind(this);\n  }\n\n  _createClass(Viewport, [{\n    key: \"equals\",\n    value: function equals(viewport) {\n      if (!(viewport instanceof Viewport)) {\n        return false;\n      }\n\n      return viewport.width === this.width && viewport.height === this.height && mat4.equals(viewport.projectionMatrix, this.projectionMatrix) && mat4.equals(viewport.viewMatrix, this.viewMatrix);\n    }\n  }, {\n    key: \"project\",\n    value: function project(xyz) {\n      var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n          _ref2$topLeft = _ref2.topLeft,\n          topLeft = _ref2$topLeft === void 0 ? true : _ref2$topLeft;\n\n      var worldPosition = this.projectPosition(xyz);\n      var coord = worldToPixels(worldPosition, this.pixelProjectionMatrix);\n\n      var _coord = _slicedToArray(coord, 2),\n          x = _coord[0],\n          y = _coord[1];\n\n      var y2 = topLeft ? y : this.height - y;\n      return xyz.length === 2 ? [x, y2] : [x, y2, coord[2]];\n    }\n  }, {\n    key: \"unproject\",\n    value: function unproject(xyz) {\n      var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n          _ref3$topLeft = _ref3.topLeft,\n          topLeft = _ref3$topLeft === void 0 ? true : _ref3$topLeft,\n          targetZ = _ref3.targetZ;\n\n      var _xyz = _slicedToArray(xyz, 3),\n          x = _xyz[0],\n          y = _xyz[1],\n          z = _xyz[2];\n\n      var y2 = topLeft ? y : this.height - y;\n      var targetZWorld = targetZ && targetZ * this.pixelsPerMeter;\n      var coord = pixelsToWorld([x, y2, z], this.pixelUnprojectionMatrix, targetZWorld);\n\n      var _this$unprojectPositi = this.unprojectPosition(coord),\n          _this$unprojectPositi2 = _slicedToArray(_this$unprojectPositi, 3),\n          X = _this$unprojectPositi2[0],\n          Y = _this$unprojectPositi2[1],\n          Z = _this$unprojectPositi2[2];\n\n      if (Number.isFinite(z)) {\n        return [X, Y, Z];\n      }\n\n      return Number.isFinite(targetZ) ? [X, Y, targetZ] : [X, Y];\n    }\n  }, {\n    key: \"projectPosition\",\n    value: function projectPosition(xyz) {\n      var _this$projectFlat = this.projectFlat(xyz),\n          _this$projectFlat2 = _slicedToArray(_this$projectFlat, 2),\n          X = _this$projectFlat2[0],\n          Y = _this$projectFlat2[1];\n\n      var Z = (xyz[2] || 0) * this.pixelsPerMeter;\n      return [X, Y, Z];\n    }\n  }, {\n    key: \"unprojectPosition\",\n    value: function unprojectPosition(xyz) {\n      var _this$unprojectFlat = this.unprojectFlat(xyz),\n          _this$unprojectFlat2 = _slicedToArray(_this$unprojectFlat, 2),\n          X = _this$unprojectFlat2[0],\n          Y = _this$unprojectFlat2[1];\n\n      var Z = (xyz[2] || 0) / this.pixelsPerMeter;\n      return [X, Y, Z];\n    }\n  }, {\n    key: \"projectFlat\",\n    value: function projectFlat(xyz) {\n      var scale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.scale;\n      return xyz;\n    }\n  }, {\n    key: \"unprojectFlat\",\n    value: function unprojectFlat(xyz) {\n      var scale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.scale;\n      return xyz;\n    }\n  }]);\n\n  return Viewport;\n}();\n\nexport { Viewport as default };\n//# sourceMappingURL=viewport.js.map","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport WebMercatorViewport from './web-mercator-viewport';\nimport assert from './assert';\nexport default function fitBounds(_ref) {\n  var width = _ref.width,\n      height = _ref.height,\n      bounds = _ref.bounds,\n      _ref$padding = _ref.padding,\n      padding = _ref$padding === void 0 ? 0 : _ref$padding,\n      _ref$offset = _ref.offset,\n      offset = _ref$offset === void 0 ? [0, 0] : _ref$offset;\n\n  var _bounds = _slicedToArray(bounds, 2),\n      _bounds$ = _slicedToArray(_bounds[0], 2),\n      west = _bounds$[0],\n      south = _bounds$[1],\n      _bounds$2 = _slicedToArray(_bounds[1], 2),\n      east = _bounds$2[0],\n      north = _bounds$2[1];\n\n  if (Number.isFinite(padding)) {\n    var p = padding;\n    padding = {\n      top: p,\n      bottom: p,\n      left: p,\n      right: p\n    };\n  } else {\n    assert(Number.isFinite(padding.top) && Number.isFinite(padding.bottom) && Number.isFinite(padding.left) && Number.isFinite(padding.right));\n  }\n\n  var viewport = new WebMercatorViewport({\n    width: width,\n    height: height,\n    longitude: 0,\n    latitude: 0,\n    zoom: 0\n  });\n  var nw = viewport.project([west, north]);\n  var se = viewport.project([east, south]);\n  var size = [Math.abs(se[0] - nw[0]), Math.abs(se[1] - nw[1])];\n  var targetSize = [width - padding.left - padding.right - Math.abs(offset[0]) * 2, height - padding.top - padding.bottom - Math.abs(offset[1]) * 2];\n  assert(targetSize[0] > 0 && targetSize[1] > 0);\n  var scaleX = targetSize[0] / size[0];\n  var scaleY = targetSize[1] / size[1];\n  var offsetX = (padding.right - padding.left) / 2 / scaleX;\n  var offsetY = (padding.bottom - padding.top) / 2 / scaleY;\n  var center = [(se[0] + nw[0]) / 2 + offsetX, (se[1] + nw[1]) / 2 + offsetY];\n  var centerLngLat = viewport.unproject(center);\n  var zoom = viewport.zoom + Math.log2(Math.abs(Math.min(scaleX, scaleY)));\n  return {\n    longitude: centerLngLat[0],\n    latitude: centerLngLat[1],\n    zoom: zoom\n  };\n}\n//# sourceMappingURL=fit-bounds.js.map","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport Viewport from './viewport';\nimport { zoomToScale, pixelsToWorld, lngLatToWorld, worldToLngLat, getProjectionMatrix, getDistanceScales, getViewMatrix } from './web-mercator-utils';\nimport _fitBounds from './fit-bounds';\nimport * as vec2 from 'gl-matrix/vec2';\n\nvar WebMercatorViewport = function (_Viewport) {\n  _inherits(WebMercatorViewport, _Viewport);\n\n  function WebMercatorViewport() {\n    var _this;\n\n    var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n        width = _ref.width,\n        height = _ref.height,\n        _ref$latitude = _ref.latitude,\n        latitude = _ref$latitude === void 0 ? 0 : _ref$latitude,\n        _ref$longitude = _ref.longitude,\n        longitude = _ref$longitude === void 0 ? 0 : _ref$longitude,\n        _ref$zoom = _ref.zoom,\n        zoom = _ref$zoom === void 0 ? 0 : _ref$zoom,\n        _ref$pitch = _ref.pitch,\n        pitch = _ref$pitch === void 0 ? 0 : _ref$pitch,\n        _ref$bearing = _ref.bearing,\n        bearing = _ref$bearing === void 0 ? 0 : _ref$bearing,\n        _ref$altitude = _ref.altitude,\n        altitude = _ref$altitude === void 0 ? 1.5 : _ref$altitude,\n        nearZMultiplier = _ref.nearZMultiplier,\n        farZMultiplier = _ref.farZMultiplier;\n\n    _classCallCheck(this, WebMercatorViewport);\n\n    width = width || 1;\n    height = height || 1;\n    var scale = zoomToScale(zoom);\n    altitude = Math.max(0.75, altitude);\n    var center = lngLatToWorld([longitude, latitude], scale);\n    center[2] = 0;\n    var projectionMatrix = getProjectionMatrix({\n      width: width,\n      height: height,\n      pitch: pitch,\n      bearing: bearing,\n      altitude: altitude,\n      nearZMultiplier: nearZMultiplier || 1 / height,\n      farZMultiplier: farZMultiplier || 1.01\n    });\n    var viewMatrix = getViewMatrix({\n      height: height,\n      center: center,\n      pitch: pitch,\n      bearing: bearing,\n      altitude: altitude,\n      flipY: true\n    });\n    _this = _possibleConstructorReturn(this, _getPrototypeOf(WebMercatorViewport).call(this, {\n      width: width,\n      height: height,\n      viewMatrix: viewMatrix,\n      projectionMatrix: projectionMatrix\n    }));\n    _this.latitude = latitude;\n    _this.longitude = longitude;\n    _this.zoom = zoom;\n    _this.pitch = pitch;\n    _this.bearing = bearing;\n    _this.altitude = altitude;\n    _this.scale = scale;\n    _this.center = center;\n    _this.pixelsPerMeter = getDistanceScales(_assertThisInitialized(_assertThisInitialized(_this))).pixelsPerMeter[2];\n    Object.freeze(_assertThisInitialized(_assertThisInitialized(_this)));\n    return _this;\n  }\n\n  _createClass(WebMercatorViewport, [{\n    key: \"projectFlat\",\n    value: function projectFlat(lngLat) {\n      var scale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.scale;\n      return lngLatToWorld(lngLat, scale);\n    }\n  }, {\n    key: \"unprojectFlat\",\n    value: function unprojectFlat(xy) {\n      var scale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.scale;\n      return worldToLngLat(xy, scale);\n    }\n  }, {\n    key: \"getMapCenterByLngLatPosition\",\n    value: function getMapCenterByLngLatPosition(_ref2) {\n      var lngLat = _ref2.lngLat,\n          pos = _ref2.pos;\n      var fromLocation = pixelsToWorld(pos, this.pixelUnprojectionMatrix);\n      var toLocation = lngLatToWorld(lngLat, this.scale);\n      var translate = vec2.add([], toLocation, vec2.negate([], fromLocation));\n      var newCenter = vec2.add([], this.center, translate);\n      return worldToLngLat(newCenter, this.scale);\n    }\n  }, {\n    key: \"getLocationAtPoint\",\n    value: function getLocationAtPoint(_ref3) {\n      var lngLat = _ref3.lngLat,\n          pos = _ref3.pos;\n      return this.getMapCenterByLngLatPosition({\n        lngLat: lngLat,\n        pos: pos\n      });\n    }\n  }, {\n    key: \"fitBounds\",\n    value: function fitBounds(bounds) {\n      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n      var width = this.width,\n          height = this.height;\n\n      var _fitBounds2 = _fitBounds(Object.assign({\n        width: width,\n        height: height,\n        bounds: bounds\n      }, options)),\n          longitude = _fitBounds2.longitude,\n          latitude = _fitBounds2.latitude,\n          zoom = _fitBounds2.zoom;\n\n      return new WebMercatorViewport({\n        width: width,\n        height: height,\n        longitude: longitude,\n        latitude: latitude,\n        zoom: zoom\n      });\n    }\n  }]);\n\n  return WebMercatorViewport;\n}(Viewport);\n\nexport { WebMercatorViewport as default };\n//# sourceMappingURL=web-mercator-viewport.js.map","import _typeof from \"../../helpers/esm/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized\";\nexport default function _possibleConstructorReturn(self, call) {\n  if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n    return call;\n  }\n\n  return assertThisInitialized(self);\n}","import setPrototypeOf from \"./setPrototypeOf\";\nexport default function _inherits(subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\"Super expression must either be null or a function\");\n  }\n\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      writable: true,\n      configurable: true\n    }\n  });\n  if (superClass) setPrototypeOf(subClass, superClass);\n}","import { PureComponent } from 'react'\nimport PropTypes from 'prop-types'\nimport MapboxGeocoder from '@mapbox/mapbox-gl-geocoder'\nimport { FlyToInterpolator } from 'react-map-gl'\nimport WebMercatorViewport from 'viewport-mercator-project'\n\nconst VALID_POSITIONS = ['top-left', 'top-right', 'bottom-left', 'bottom-right']\n\nclass Geocoder extends PureComponent {\n  geocoder = null\n  cachedResult = null\n\n  componentDidMount() {\n    this.initializeGeocoder()\n  }\n\n  componentWillUnmount() {\n    this.removeGeocoder()\n  }\n\n  componentDidUpdate() {\n    this.removeGeocoder()\n    this.initializeGeocoder()\n  }\n\n  initializeGeocoder = () => {\n    const mapboxMap = this.getMapboxMap()\n    const containerNode = this.getContainerNode()\n    const {\n      mapboxApiAccessToken,\n      inputValue,\n      origin,\n      zoom,\n      placeholder,\n      proximity,\n      trackProximity,\n      collapsed,\n      clearAndBlurOnEsc,\n      clearOnBlur,\n      bbox,\n      types,\n      countries,\n      minLength,\n      limit,\n      language,\n      filter,\n      localGeocoder,\n      reverseGeocode,\n      enableEventLogging,\n      render,\n      getItemValue,\n      onInit,\n      position\n    } = this.props\n    const options = {\n      accessToken: mapboxApiAccessToken,\n      origin,\n      zoom,\n      flyTo: false,\n      placeholder,\n      proximity,\n      trackProximity,\n      collapsed,\n      clearAndBlurOnEsc,\n      clearOnBlur,\n      bbox,\n      types,\n      countries,\n      minLength,\n      limit,\n      language,\n      filter,\n      localGeocoder,\n      reverseGeocode,\n      enableEventLogging,\n      marker: false\n    }\n\n    if (render && typeof render === 'function') {\n      options.render = render\n    }\n\n    if (getItemValue && typeof getItemValue === 'function') {\n      options.getItemValue = getItemValue\n    }\n\n    this.geocoder = new MapboxGeocoder(options)\n    this.subscribeEvents()\n\n    if (containerNode) {\n      containerNode.appendChild(this.geocoder.onAdd(mapboxMap))\n    } else {\n      mapboxMap.addControl(this.geocoder, VALID_POSITIONS.find((_position) => position === _position))\n    }\n\n    if (inputValue !== undefined && inputValue !== null) {\n      this.geocoder.setInput(inputValue)\n    } else if (this.cachedResult) {\n      this.geocoder.setInput(this.cachedResult.place_name)\n    }\n\n    if (this.cachedResult || (inputValue !== undefined && inputValue !== null)) {\n      this.showClearIcon()\n    }\n\n    onInit(this.geocoder)\n  }\n\n  showClearIcon = () => {\n    // this is a hack to force clear icon to show if there is text in the input\n    this.geocoder._clearEl.style.display = 'block'\n  }\n\n  getMapboxMap = () => {\n    const { mapRef } = this.props\n\n    return (mapRef && mapRef.current && mapRef.current.getMap()) || null\n  }\n\n  getContainerNode = () => {\n    const { containerRef } = this.props\n\n    return (containerRef && containerRef.current) || null\n  }\n\n  subscribeEvents = () => {\n    this.geocoder.on('clear', this.handleClear)\n    this.geocoder.on('loading', this.handleLoading)\n    this.geocoder.on('results', this.handleResults)\n    this.geocoder.on('result', this.handleResult)\n    this.geocoder.on('error', this.handleError)\n  }\n\n  unsubscribeEvents = () => {\n    this.geocoder.off('clear', this.handleClear)\n    this.geocoder.off('loading', this.handleLoading)\n    this.geocoder.off('results', this.handleResults)\n    this.geocoder.off('result', this.handleResult)\n    this.geocoder.off('error', this.handleError)\n  }\n\n  removeGeocoder = () => {\n    const mapboxMap = this.getMapboxMap()\n\n    this.unsubscribeEvents()\n\n    if (mapboxMap && mapboxMap.removeControl) {\n      this.getMapboxMap().removeControl(this.geocoder)\n    }\n\n    this.geocoder = null\n  }\n\n  handleClear = () => {\n    this.cachedResult = null\n    this.props.onClear()\n  }\n\n  handleLoading = (event) => {\n    this.props.onLoading(event)\n  }\n\n  handleResults = (event) => {\n    this.props.onResults(event)\n  }\n\n  handleResult = (event) => {\n    const { result } = event\n    const { onViewportChange, onResult } = this.props\n    const { bbox, center, properties = {} } = result\n    const { short_code } = properties\n    const [longitude, latitude] = center\n    const bboxExceptions = {\n      fr: {\n        name: 'France',\n        bbox: [[-4.59235, 41.380007], [9.560016, 51.148506]]\n      },\n      us: {\n        name: 'United States',\n        bbox: [[-171.791111, 18.91619], [-66.96466, 71.357764]]\n      },\n      ru: {\n        name: 'Russia',\n        bbox: [[19.66064, 41.151416], [190.10042, 81.2504]]\n      },\n      ca: {\n        name: 'Canada',\n        bbox: [[-140.99778, 41.675105], [-52.648099, 83.23324]]\n      }\n    }\n    const { width, height } = this.getMapboxMap()\n      .getContainer()\n      .getBoundingClientRect()\n    let zoom = this.geocoder.options.zoom\n    const fitBounds = (bounds, viewport) => new WebMercatorViewport(viewport).fitBounds(bounds)\n\n    try {\n      if (!bboxExceptions[short_code] && bbox) {\n        zoom = fitBounds([[bbox[0], bbox[1]], [bbox[2], bbox[3]]], { width, height }).zoom\n      } else if (bboxExceptions[short_code]) {\n        zoom = fitBounds(bboxExceptions[short_code].bbox, { width, height }).zoom\n      }\n    } catch (e) {\n      console.warn('following result caused an error when trying to zoom to bbox: ', result) // eslint-disable-line\n      zoom = this.geocoder.options.zoom\n    }\n\n    onViewportChange({\n      longitude,\n      latitude,\n      zoom,\n      transitionInterpolator: new FlyToInterpolator(),\n      transitionDuration: 3000\n    })\n    onResult(event)\n\n    this.cachedResult = result\n    this.geocoder._typeahead.selected = null\n    this.showClearIcon()\n  }\n\n  handleError = (event) => {\n    this.props.onError(event)\n  }\n\n  getGeocoder() {\n    return this.geocoder\n  }\n\n  render() {\n    return null\n  }\n\n  static propTypes = {\n    mapRef: PropTypes.object.isRequired,\n    containerRef: PropTypes.object,\n    onViewportChange: PropTypes.func,\n    mapboxApiAccessToken: PropTypes.string.isRequired,\n    inputValue: PropTypes.string,\n    origin: PropTypes.string,\n    zoom: PropTypes.number,\n    placeholder: PropTypes.string,\n    proximity: PropTypes.object,\n    trackProximity: PropTypes.bool,\n    collapsed: PropTypes.bool,\n    clearAndBlurOnEsc: PropTypes.bool,\n    clearOnBlur: PropTypes.bool,\n    bbox: PropTypes.array,\n    types: PropTypes.string,\n    countries: PropTypes.string,\n    minLength: PropTypes.number,\n    limit: PropTypes.number,\n    language: PropTypes.string,\n    filter: PropTypes.func,\n    localGeocoder: PropTypes.func,\n    reverseGeocode: PropTypes.bool,\n    enableEventLogging: PropTypes.bool,\n    render: PropTypes.func,\n    getItemValue: PropTypes.func,\n    position: PropTypes.oneOf(VALID_POSITIONS),\n    onInit: PropTypes.func,\n    onClear: PropTypes.func,\n    onLoading: PropTypes.func,\n    onResults: PropTypes.func,\n    onResult: PropTypes.func,\n    onError: PropTypes.func\n  }\n\n  static defaultProps = {\n    onViewportChange: () => {},\n    origin: 'https://api.mapbox.com',\n    zoom: 16,\n    placeholder: 'Search',\n    trackProximity: false,\n    collapsed: false,\n    clearAndBlurOnEsc: false,\n    clearOnBlur: false,\n    minLength: 2,\n    limit: 5,\n    reverseGeocode: false,\n    enableEventLogging: true,\n    position: 'top-right',\n    onInit: () => {},\n    onClear: () => {},\n    onLoading: () => {},\n    onResults: () => {},\n    onResult: () => {},\n    onError: () => {}\n  }\n}\n\nexport default Geocoder\n"],"names":["Object","defineProperty","exports","value","b","Symbol","for","c","d","e","f","g","h","k","l","m","n","p","q","r","t","a","u","$$typeof","type","v","process","env","NODE_ENV","hasSymbol","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_ASYNC_MODE_TYPE","REACT_CONCURRENT_MODE_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","printWarning","format","_len","arguments","length","args","Array","_key","argIndex","message","replace","console","warn","Error","x","typeOf","object","$$typeofType","AsyncMode","ConcurrentMode","ContextConsumer","ContextProvider","Element","ForwardRef","Fragment","Lazy","Memo","Portal","Profiler","StrictMode","Suspense","hasWarnedAboutDeprecatedIsAsyncMode","isConcurrentMode","condition","undefined","_len2","_key2","apply","concat","lowPriorityWarning$1","module","require$$0","require$$1","getOwnPropertySymbols","hasOwnProperty","prototype","propIsEnumerable","propertyIsEnumerable","toObject","val","TypeError","assign","test1","String","getOwnPropertyNames","test2","i","fromCharCode","map","join","test3","split","forEach","letter","keys","err","shouldUseNative","target","source","from","symbols","to","s","key","call","ReactPropTypesSecret","loggedTypeFailures","has","Function","bind","text","error","checkPropTypes","typeSpecs","values","location","componentName","getStack","typeSpecName","name","ex","stack","resetWarningCache","emptyFunctionThatReturnsNull","emptyFunction","emptyFunctionWithReset","isValidElement","throwOnDirectAccess","ITERATOR_SYMBOL","iterator","FAUX_ITERATOR_SYMBOL","ANONYMOUS","ReactPropTypes","array","createPrimitiveTypeChecker","bool","func","number","string","symbol","any","createChainableTypeChecker","arrayOf","typeChecker","props","propName","propFullName","PropTypeError","propValue","isArray","getPropType","element","elementType","ReactIs","isValidElementType","instanceOf","expectedClass","constructor","node","isNode","objectOf","propType","oneOf","expectedValues","is","valuesString","JSON","stringify","getPreciseType","oneOfType","arrayOfTypeCheckers","checker","getPostfixForTypeWarning","shape","shapeTypes","exact","allKeys","y","this","validate","manualPropTypeCallCache","manualPropTypeWarningCount","checkType","isRequired","secret","cacheKey","chainedCheckType","expectedType","every","iteratorFn","maybeIterable","getIteratorFn","step","entries","next","done","entry","RegExp","isSymbol","Date","PropTypes","isElement","shim","getShim","require$$2","fuzzy","simpleFilter","pattern","filter","str","test","match","opts","ch","patternIdx","result","len","totalScore","currScore","pre","post","compareString","caseSensitive","toLowerCase","idx","Infinity","rendered","score","arr","reduce","prev","extract","index","original","sort","List","component","items","active","wrapper","document","createElement","className","appendChild","selectingListItem","el","parentNode","insertBefore","nextSibling","show","style","display","hide","add","item","push","clear","isEmpty","isVisible","draw","innerHTML","drawItem","li","addEventListener","handleMouseUp","move","previous","drawError","msg","Suggestions","data","options","extend","minLength","limit","list","query","selected","handleKeyUp","keyCode","handleKeyDown","handleFocus","handleBlur","handlePaste","render","getItemValue","handleInputChange","preventDefault","clipboardData","getData","self","setTimeout","normalize","getCandidates","update","revisedData","candidate","indexOf","createEvent","initEvent","dispatchEvent","fireEvent","callback","sourceFormatting","boldString","indexString","indexOfQuery","lastIndexOf","endIndexOfQuery","slice","renderError","window","NAN","symbolTag","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","global","freeSelf","root","objectToString","toString","nativeMax","Math","max","nativeMin","min","now","isObject","toNumber","isObjectLike","other","valueOf","isBinary","fr","bbox","us","ru","ca","linkHeader","link","parsed","parts","linkUrl","linkParams","rel","parsedLinkParams","param","parseParam","url","params","parseLink","MapiResponse","request","responseData","headers","rawBody","body","statusCode","parse","parseError","links","parseLinkHeader","hasNextPage","nextPage","_extend","path","API_ORIGIN","EVENT_PROGRESS_DOWNLOAD","EVENT_PROGRESS_UPLOAD","EVENT_ERROR","EVENT_RESPONSE","ERROR_HTTP","ERROR_REQUEST_ABORTED","errorType","constants","requestsUnderway","normalizeBrowserProgressEvent","event","total","transferred","loaded","percent","freeExports","freeModule","InvalidCharacterError","TABLE","REGEX_SPACE_CHARACTERS","base64","encode","input","buffer","padding","output","position","charCodeAt","charAt","decode","bitStorage","bitCounter","version","nodeType","tokenCache","obj","token","usage","rawPayload","parsedPayload","parsePaylod","user","authorization","expires","exp","created","iat","scopes","client","lastLogin","ll","impersonator","iu","prefix","Events","EE","fn","context","once","addListener","emitter","listener","evt","_events","_eventsCount","clearEvent","EventEmitter","create","__proto__","eventNames","events","names","listeners","handlers","ee","listenerCount","emit","a1","a2","a3","a4","a5","removeListener","j","on","removeAllListeners","off","prefixed","encodeValue","encodeURIComponent","appendQueryParam","punctuation","appendQueryObject","queryObject","prependOrigin","origin","delimiter","interpolateRouteParams","route","_","paramId","requestId","MapiRequest","method","defaultHeaders","headersWithDefaults","xtend","memo","id","_options","response","sent","aborted","file","accessToken","urlUtils","routeParams","accessTokenOwnerId","parseToken","ownerId","send","sendRequest","then","abort","_nextPageRequest","abortRequest","eachPage","handleResponse","nextPageRequest","getPage","handleError","clone","extendedOptions","MapiClient","createRequest","requestOptions","BrowserClient","Promise","resolve","xhr","XMLHttpRequest","open","setRequestHeader","createRequestXhr","reject","onprogress","upload","onerror","onabort","mapiError","MapiError","onload","status","raw","getAllResponseHeaders","trim","rawHeader","boundary","substring","parseSingleHeader","createResponse","sendRequestXhr","DEFAULT_ERROR_PATH","createArrayValidator","validators","validatingTuple","validationResult","plainArray","validator","processMessage","formatErrorMessage","nounPhrase","prettifyResult","orList","prettyResult","isArrayCulprit","assert","rootValidator","errorMessage","apiName","validatorObj","plainObject","errorMessages","objectId","strictShape","shapeValidator","shapeResult","invalidKeys","valueKey","tuple","required","requiredValidator","__required","messages","Boolean","equal","compareWith","range","boolean","getPrototypeOf","Blob","ArrayBuffer","pipe","date","getTime","isNaN","coordinates","assertShape","cb","objectMap","Geocoding","featureTypes","forwardGeocode","config","mode","countries","proximity","types","autocomplete","language","stringifyBooleans","country","pick","reverseGeocode","reverseMode","ServicePrototype","clientOrConfig","isPrototypeOf","createClient","service","crypto","msCrypto","MapboxEventManager","endpoint","access_token","sessionID","generateSessionID","userAgent","getUserAgent","locale","navigator","enableEventLogging","shouldEnableLogging","eventQueue","flushInterval","maxQueueSize","timer","flush","lastSentInput","lastSentIndex","select","geocoder","resultIndex","getSelectedIndex","payload","getEventPayload","resultPlaceName","place_name","resultId","queryString","start","keyevent","keyEvent","metaKey","lastAction","getRequestOptions","host","Content-Type","longitude","latitude","zoom","_map","getZoom","sessionIdentifier","mapZoom","keyboardLocale","inputString","_inputEl","xhttp","header","onreadystatechange","readyState","statusText","size","bytes","getRandomValues","Uint8Array","nanoid","_typeahead","selectedID","feature","localGeocoder","clearTimeout","forceFlush","remove","placeholder","de","it","en","nl","he","ja","lv","pt","sr","zh","cs","hu","ka","nb","sk","th","fi","ko","pl","sl","make","empty","tag","api","extlang","script","region","expose","enumerable","part","MapboxGeocoder","_eventEmitter","fresh","lastSelected","flyTo","trackProximity","marker","mapboxgl","collapsed","clearAndBlurOnEsc","clearOnBlur","placeName","splice","onAdd","setLanguage","geocoderService","mbxGeocoder","MapboxClient","eventManager","_onChange","_onKeyDown","_onBlur","_showButton","_hideButton","_onQueryResult","_updateProximity","_collapse","_unCollapse","_clear","_clearOnBlur","container","searchIcon","createIcon","setPlaceholder","wait","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","thisArg","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","remainingWait","debounced","isInvoking","leadingEdge","debounce","cancel","actions","classList","_clearEl","setAttribute","buttonIcon","_loadingEl","Typeahead","setRenderFunction","mapMarker","_handleMarker","_mapboxgl","icon","createElementNS","onRemove","removeChild","_removeMarker","ESC_KEY_CODE","TAB_KEY_CODE","blur","shadowRoot","activeElement","_geocode","flyOptions","properties","exceptions","short_code","fitBounds","center","focus","scrollLeft","setSelectionRange","searchInput","coords","parseFloat","reverse","localGeocoderRes","res","features","_renderNoResults","catch","_renderError","ev","relatedTarget","results","getCenter","wrap","setProximity","lng","lat","_renderMessage","_getPlaceholderText","firstLanguage","subtag","localizedValue","localization","setInput","getProximity","getRenderFunction","browserLocale","userLanguage","browserLanguage","getLanguage","setZoom","getFlyTo","setFlyTo","getPlaceholder","getBbox","setBbox","getCountries","setCountries","getTypes","setTypes","getMinLength","setMinLength","getLimit","setLimit","getFilter","setFilter","markerOptions","color","Marker","setLngLat","addTo","_classCallCheck","instance","Constructor","_defineProperties","descriptor","configurable","writable","_createClass","protoProps","staticProps","_typeof2","_typeof","_assertThisInitialized","ReferenceError","_getPrototypeOf","o","setPrototypeOf","_setPrototypeOf","_slicedToArray","arrayWithHoles","_arr","_n","_d","_e","_s","_i","iterableToArrayLimit","nonIterableRest","out","EPSILON","ARRAY_TYPE","Float32Array","transformVector","matrix","vector","z","w","vec4.transformMat4","vec4.scale","multiply","a00","a01","a02","a03","a10","a11","a12","a13","a20","a21","a22","a23","a30","a31","a32","a33","b0","b1","b2","b3","translate","scale","equals","a0","a6","a7","a8","a9","a14","a15","b4","b5","b6","b7","b8","b9","b10","b11","b12","b13","b14","b15","abs","glMatrix.EPSILON","glMatrix.ARRAY_TYPE","PI","PI_4","DEGREES_TO_RADIANS","RADIANS_TO_DEGREES","TILE_SIZE","EARTH_CIRCUMFERENCE","DEFAULT_ALTITUDE","zoomToScale","pow","lngLatToWorld","_ref","_ref2","Number","isFinite","log","tan","worldToLngLat","_ref3","_ref4","lambda2","phi2","atan","worldToPixels","xyz","pixelProjectionMatrix","_xyz2","_xyz2$","pixelsToWorld","pixelUnprojectionMatrix","targetZ","_xyz3","coord0","coord1","z0","z1","ax","ay","vec2.lerp","IDENTITY","Viewport","width","height","_ref$viewMatrix","viewMatrix","_ref$projectionMatrix","projectionMatrix","pixelsPerMeter","vpm","mat4.multiply","viewProjectionMatrix","mat4.scale","mat4.translate","mInverse","b00","b01","b02","b03","b04","b05","b06","b07","b08","b09","det","mat4.invert","project","unproject","projectPosition","unprojectPosition","projectFlat","unprojectFlat","viewport","mat4.equals","_ref2$topLeft","topLeft","worldPosition","coord","_coord","y2","_ref3$topLeft","_xyz","targetZWorld","_this$unprojectPositi","_this$unprojectPositi2","X","Y","Z","_this$projectFlat2","_this$unprojectFlat2","_ref$padding","_ref$offset","offset","_bounds","bounds","_bounds$","west","south","_bounds$2","east","north","top","bottom","left","right","WebMercatorViewport","nw","se","targetSize","scaleX","scaleY","centerLngLat","log2","_Viewport","_this","_ref$latitude","_ref$longitude","_ref$zoom","_ref$pitch","pitch","_ref$bearing","bearing","_ref$altitude","altitude","nearZMultiplier","farZMultiplier","_ref9","_getProjectionParamet","fovy","aspect","near","far","nf","fov","mat4.perspective","_ref8","_ref8$altitude","_ref8$pitch","_ref8$nearZMultiplier","_ref8$farZMultiplier","pitchRadians","halfFov","topHalfSurfaceDistance","sin","farZ","cos","focalDistance","getProjectionParameters","_ref7","_ref7$center","_ref7$flipY","flipY","vm","rad","mat4.rotateX","mat4.rotateZ","vec3.negate","getViewMatrix","assertThisInitialized","_possibleConstructorReturn","_ref6","_ref6$highPrecision","highPrecision","worldSize","latCosine","pixelsPerDegreeX","pixelsPerDegreeY","altPixelsPerMeter","metersPerPixel","pixelsPerDegree","degreesPerPixel","latCosine2","altPixelsPerDegree2","altPixelsPerMeter2","pixelsPerDegree2","pixelsPerMeter2","getDistanceScales","freeze","subClass","superClass","_inherits","lngLat","xy","fromLocation","pos","vec2.add","vec2.negate","getMapCenterByLngLatPosition","_fitBounds2","_fitBounds","VALID_POSITIONS","Geocoder","cachedResult","initializeGeocoder","mapboxMap","getMapboxMap","containerNode","getContainerNode","inputValue","onInit","mapboxApiAccessToken","subscribeEvents","addControl","find","_position","showClearIcon","mapRef","current","getMap","containerRef","handleClear","handleLoading","handleResults","handleResult","unsubscribeEvents","removeGeocoder","removeControl","onClear","onLoading","onResults","onViewportChange","onResult","bboxExceptions","getContainer","getBoundingClientRect","transitionInterpolator","FlyToInterpolator","transitionDuration","onError","componentDidM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