UNPKG

730 kBSource Map (JSON)View Raw
1{"version":3,"file":"vis-data.js","sources":["../../node_modules/core-js-pure/internals/global.js","../../node_modules/core-js-pure/internals/fails.js","../../node_modules/core-js-pure/internals/descriptors.js","../../node_modules/core-js-pure/internals/object-property-is-enumerable.js","../../node_modules/core-js-pure/internals/create-property-descriptor.js","../../node_modules/core-js-pure/internals/classof-raw.js","../../node_modules/core-js-pure/internals/indexed-object.js","../../node_modules/core-js-pure/internals/require-object-coercible.js","../../node_modules/core-js-pure/internals/to-indexed-object.js","../../node_modules/core-js-pure/internals/is-object.js","../../node_modules/core-js-pure/internals/to-primitive.js","../../node_modules/core-js-pure/internals/has.js","../../node_modules/core-js-pure/internals/document-create-element.js","../../node_modules/core-js-pure/internals/ie8-dom-define.js","../../node_modules/core-js-pure/internals/object-get-own-property-descriptor.js","../../node_modules/core-js-pure/internals/is-forced.js","../../node_modules/core-js-pure/internals/path.js","../../node_modules/core-js-pure/internals/a-function.js","../../node_modules/core-js-pure/internals/function-bind-context.js","../../node_modules/core-js-pure/internals/an-object.js","../../node_modules/core-js-pure/internals/object-define-property.js","../../node_modules/core-js-pure/internals/create-non-enumerable-property.js","../../node_modules/core-js-pure/internals/export.js","../../node_modules/core-js-pure/internals/is-array.js","../../node_modules/core-js-pure/internals/to-integer.js","../../node_modules/core-js-pure/internals/to-length.js","../../node_modules/core-js-pure/internals/flatten-into-array.js","../../node_modules/core-js-pure/internals/to-object.js","../../node_modules/core-js-pure/internals/set-global.js","../../node_modules/core-js-pure/internals/shared-store.js","../../node_modules/core-js-pure/internals/shared.js","../../node_modules/core-js-pure/internals/uid.js","../../node_modules/core-js-pure/internals/native-symbol.js","../../node_modules/core-js-pure/internals/use-symbol-as-uid.js","../../node_modules/core-js-pure/internals/well-known-symbol.js","../../node_modules/core-js-pure/internals/array-species-create.js","../../node_modules/core-js-pure/modules/es.array.flat-map.js","../../node_modules/core-js-pure/internals/entry-virtual.js","../../node_modules/core-js-pure/es/array/virtual/flat-map.js","../../node_modules/core-js-pure/es/instance/flat-map.js","../../node_modules/core-js-pure/stable/instance/flat-map.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/flat-map.js","../../node_modules/core-js-pure/internals/array-iteration.js","../../node_modules/core-js-pure/internals/get-built-in.js","../../node_modules/core-js-pure/internals/engine-user-agent.js","../../node_modules/core-js-pure/internals/engine-v8-version.js","../../node_modules/core-js-pure/internals/array-method-has-species-support.js","../../node_modules/core-js-pure/internals/array-method-uses-to-length.js","../../node_modules/core-js-pure/modules/es.array.map.js","../../node_modules/core-js-pure/es/array/virtual/map.js","../../node_modules/core-js-pure/es/instance/map.js","../../node_modules/core-js-pure/stable/instance/map.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","../../node_modules/core-js-pure/modules/es.array.filter.js","../../node_modules/core-js-pure/es/array/virtual/filter.js","../../node_modules/core-js-pure/es/instance/filter.js","../../node_modules/core-js-pure/stable/instance/filter.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js","../../node_modules/core-js-pure/internals/array-reduce.js","../../node_modules/core-js-pure/internals/array-method-is-strict.js","../../node_modules/core-js-pure/internals/engine-is-node.js","../../node_modules/core-js-pure/modules/es.array.reduce.js","../../node_modules/core-js-pure/es/array/virtual/reduce.js","../../node_modules/core-js-pure/es/instance/reduce.js","../../node_modules/core-js-pure/stable/instance/reduce.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js","../../node_modules/core-js-pure/internals/function-bind.js","../../node_modules/core-js-pure/modules/es.function.bind.js","../../node_modules/core-js-pure/es/function/virtual/bind.js","../../node_modules/core-js-pure/es/instance/bind.js","../../node_modules/core-js-pure/stable/instance/bind.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/bind.js","../../node_modules/@babel/runtime-corejs3/helpers/classCallCheck.js","../../node_modules/core-js-pure/modules/es.object.define-property.js","../../node_modules/core-js-pure/es/object/define-property.js","../../node_modules/core-js-pure/features/object/define-property.js","../../node_modules/@babel/runtime-corejs3/core-js/object/define-property.js","../../node_modules/@babel/runtime-corejs3/helpers/createClass.js","../../src/data-pipe.ts","../../node_modules/core-js-pure/stable/object/define-property.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js","../../node_modules/core-js-pure/internals/to-absolute-index.js","../../node_modules/core-js-pure/internals/array-includes.js","../../node_modules/core-js-pure/internals/hidden-keys.js","../../node_modules/core-js-pure/internals/object-keys-internal.js","../../node_modules/core-js-pure/internals/enum-bug-keys.js","../../node_modules/core-js-pure/internals/object-keys.js","../../node_modules/core-js-pure/internals/object-define-properties.js","../../node_modules/core-js-pure/modules/es.object.define-properties.js","../../node_modules/core-js-pure/es/object/define-properties.js","../../node_modules/core-js-pure/stable/object/define-properties.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-properties.js","../../node_modules/core-js-pure/internals/object-get-own-property-names.js","../../node_modules/core-js-pure/internals/object-get-own-property-symbols.js","../../node_modules/core-js-pure/internals/own-keys.js","../../node_modules/core-js-pure/internals/create-property.js","../../node_modules/core-js-pure/modules/es.object.get-own-property-descriptors.js","../../node_modules/core-js-pure/es/object/get-own-property-descriptors.js","../../node_modules/core-js-pure/stable/object/get-own-property-descriptors.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors.js","../../node_modules/core-js-pure/modules/es.object.get-own-property-descriptor.js","../../node_modules/core-js-pure/es/object/get-own-property-descriptor.js","../../node_modules/core-js-pure/stable/object/get-own-property-descriptor.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor.js","../../node_modules/core-js-pure/internals/html.js","../../node_modules/core-js-pure/internals/shared-key.js","../../node_modules/core-js-pure/internals/object-create.js","../../node_modules/core-js-pure/internals/object-get-own-property-names-external.js","../../node_modules/core-js-pure/internals/redefine.js","../../node_modules/core-js-pure/internals/well-known-symbol-wrapped.js","../../node_modules/core-js-pure/internals/define-well-known-symbol.js","../../node_modules/core-js-pure/internals/to-string-tag-support.js","../../node_modules/core-js-pure/internals/classof.js","../../node_modules/core-js-pure/internals/object-to-string.js","../../node_modules/core-js-pure/internals/set-to-string-tag.js","../../node_modules/core-js-pure/internals/inspect-source.js","../../node_modules/core-js-pure/internals/native-weak-map.js","../../node_modules/core-js-pure/internals/internal-state.js","../../node_modules/core-js-pure/modules/es.symbol.js","../../node_modules/core-js-pure/es/object/get-own-property-symbols.js","../../node_modules/core-js-pure/stable/object/get-own-property-symbols.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols.js","../../node_modules/core-js-pure/internals/iterators.js","../../node_modules/core-js-pure/internals/correct-prototype-getter.js","../../node_modules/core-js-pure/internals/object-get-prototype-of.js","../../node_modules/core-js-pure/internals/iterators-core.js","../../node_modules/core-js-pure/internals/create-iterator-constructor.js","../../node_modules/core-js-pure/internals/a-possible-prototype.js","../../node_modules/core-js-pure/internals/object-set-prototype-of.js","../../node_modules/core-js-pure/internals/define-iterator.js","../../node_modules/core-js-pure/modules/es.array.iterator.js","../../node_modules/core-js-pure/internals/dom-iterables.js","../../node_modules/core-js-pure/modules/web.dom-collections.iterator.js","../../node_modules/core-js-pure/internals/string-multibyte.js","../../node_modules/core-js-pure/modules/es.string.iterator.js","../../node_modules/core-js-pure/internals/get-iterator-method.js","../../node_modules/core-js-pure/internals/get-iterator.js","../../node_modules/core-js-pure/features/get-iterator.js","../../node_modules/@babel/runtime-corejs3/core-js/get-iterator.js","../../node_modules/core-js-pure/features/get-iterator-method.js","../../node_modules/@babel/runtime-corejs3/core-js/get-iterator-method.js","../../node_modules/core-js-pure/internals/iterator-close.js","../../node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js","../../node_modules/core-js-pure/internals/is-array-iterator-method.js","../../node_modules/core-js-pure/internals/array-from.js","../../node_modules/core-js-pure/internals/check-correctness-of-iteration.js","../../node_modules/core-js-pure/modules/es.array.from.js","../../node_modules/core-js-pure/es/array/from.js","../../node_modules/core-js-pure/stable/array/from.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/array/from.js","../../node_modules/core-js-pure/internals/array-fill.js","../../node_modules/core-js-pure/modules/es.array.fill.js","../../node_modules/core-js-pure/es/array/virtual/fill.js","../../node_modules/core-js-pure/modules/web.timers.js","../../node_modules/core-js-pure/stable/set-timeout.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/set-timeout.js","../../node_modules/core-js-pure/modules/es.json.stringify.js","../../node_modules/core-js-pure/es/json/stringify.js","../../node_modules/core-js-pure/stable/json/stringify.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/json/stringify.js","../../node_modules/core-js-pure/modules/es.object.create.js","../../node_modules/core-js-pure/es/object/create.js","../../node_modules/core-js-pure/stable/object/create.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/object/create.js","../../node_modules/@babel/runtime-corejs3/helpers/defineProperty.js","../../node_modules/core-js-pure/internals/whitespaces.js","../../node_modules/core-js-pure/internals/string-trim.js","../../node_modules/core-js-pure/internals/string-trim-forced.js","../../node_modules/core-js-pure/modules/es.string.trim.js","../../node_modules/core-js-pure/es/string/virtual/trim.js","../../node_modules/core-js-pure/modules/es.array.index-of.js","../../node_modules/core-js-pure/es/array/virtual/index-of.js","../../node_modules/core-js-pure/internals/number-parse-int.js","../../node_modules/core-js-pure/modules/es.parse-int.js","../../node_modules/core-js-pure/internals/object-to-array.js","../../node_modules/core-js-pure/modules/es.object.values.js","../../node_modules/core-js-pure/es/object/values.js","../../node_modules/core-js-pure/modules/es.object.get-prototype-of.js","../../node_modules/core-js-pure/es/object/get-prototype-of.js","../../node_modules/core-js-pure/modules/es.array.includes.js","../../node_modules/core-js-pure/es/array/virtual/includes.js","../../node_modules/core-js-pure/internals/is-regexp.js","../../node_modules/core-js-pure/internals/not-a-regexp.js","../../node_modules/core-js-pure/internals/correct-is-regexp-logic.js","../../node_modules/core-js-pure/modules/es.string.includes.js","../../node_modules/core-js-pure/es/string/virtual/includes.js","../../node_modules/core-js-pure/internals/object-assign.js","../../node_modules/core-js-pure/modules/es.object.assign.js","../../node_modules/core-js-pure/es/object/assign.js","../../node_modules/core-js-pure/stable/object/assign.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/object/assign.js","../../node_modules/core-js-pure/modules/es.array.splice.js","../../node_modules/core-js-pure/es/array/virtual/splice.js","../../node_modules/core-js-pure/es/instance/splice.js","../../node_modules/core-js-pure/stable/instance/splice.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/splice.js","../../node_modules/core-js-pure/modules/es.array.reverse.js","../../node_modules/core-js-pure/es/array/virtual/reverse.js","../../node_modules/core-js-pure/es/instance/reverse.js","../../node_modules/core-js-pure/stable/instance/reverse.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/reverse.js","../../node_modules/core-js-pure/internals/array-for-each.js","../../node_modules/core-js-pure/modules/es.array.for-each.js","../../node_modules/core-js-pure/es/array/virtual/for-each.js","../../node_modules/core-js-pure/stable/array/virtual/for-each.js","../../node_modules/core-js-pure/stable/instance/for-each.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js","../../node_modules/core-js-pure/modules/es.array.is-array.js","../../node_modules/core-js-pure/es/array/is-array.js","../../node_modules/core-js-pure/features/array/is-array.js","../../node_modules/@babel/runtime-corejs3/core-js/array/is-array.js","../../node_modules/@babel/runtime-corejs3/helpers/arrayWithHoles.js","../../node_modules/core-js-pure/internals/is-iterable.js","../../node_modules/core-js-pure/features/is-iterable.js","../../node_modules/@babel/runtime-corejs3/core-js/is-iterable.js","../../node_modules/core-js-pure/modules/es.array.concat.js","../../node_modules/core-js-pure/modules/es.symbol.async-iterator.js","../../node_modules/core-js-pure/modules/es.symbol.has-instance.js","../../node_modules/core-js-pure/modules/es.symbol.is-concat-spreadable.js","../../node_modules/core-js-pure/modules/es.symbol.iterator.js","../../node_modules/core-js-pure/modules/es.symbol.match.js","../../node_modules/core-js-pure/modules/es.symbol.match-all.js","../../node_modules/core-js-pure/modules/es.symbol.replace.js","../../node_modules/core-js-pure/modules/es.symbol.search.js","../../node_modules/core-js-pure/modules/es.symbol.species.js","../../node_modules/core-js-pure/modules/es.symbol.split.js","../../node_modules/core-js-pure/modules/es.symbol.to-primitive.js","../../node_modules/core-js-pure/modules/es.symbol.to-string-tag.js","../../node_modules/core-js-pure/modules/es.symbol.unscopables.js","../../node_modules/core-js-pure/modules/es.json.to-string-tag.js","../../node_modules/core-js-pure/es/symbol/index.js","../../node_modules/core-js-pure/modules/esnext.symbol.async-dispose.js","../../node_modules/core-js-pure/modules/esnext.symbol.dispose.js","../../node_modules/core-js-pure/modules/esnext.symbol.observable.js","../../node_modules/core-js-pure/modules/esnext.symbol.pattern-match.js","../../node_modules/core-js-pure/modules/esnext.symbol.replace-all.js","../../node_modules/core-js-pure/features/symbol/index.js","../../node_modules/@babel/runtime-corejs3/core-js/symbol.js","../../node_modules/@babel/runtime-corejs3/helpers/iterableToArrayLimit.js","../../node_modules/core-js-pure/features/array/from.js","../../node_modules/@babel/runtime-corejs3/core-js/array/from.js","../../node_modules/core-js-pure/modules/es.array.slice.js","../../node_modules/core-js-pure/es/array/virtual/slice.js","../../node_modules/core-js-pure/es/instance/slice.js","../../node_modules/core-js-pure/features/instance/slice.js","../../node_modules/@babel/runtime-corejs3/core-js/instance/slice.js","../../node_modules/@babel/runtime-corejs3/helpers/arrayLikeToArray.js","../../node_modules/@babel/runtime-corejs3/helpers/unsupportedIterableToArray.js","../../node_modules/@babel/runtime-corejs3/helpers/nonIterableRest.js","../../node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js","../../node_modules/core-js-pure/modules/es.date.now.js","../../node_modules/core-js-pure/es/date/now.js","../../node_modules/core-js-pure/modules/es.object.keys.js","../../node_modules/core-js-pure/es/object/keys.js","../../node_modules/core-js-pure/stable/object/keys.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js","../../node_modules/core-js-pure/stable/array/is-array.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js","../../node_modules/core-js-pure/es/symbol/iterator.js","../../node_modules/core-js-pure/features/symbol/iterator.js","../../node_modules/@babel/runtime-corejs3/core-js/symbol/iterator.js","../../node_modules/@babel/runtime-corejs3/helpers/typeof.js","../../node_modules/core-js-pure/modules/es.reflect.own-keys.js","../../node_modules/core-js-pure/es/reflect/own-keys.js","../../node_modules/core-js-pure/stable/reflect/own-keys.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/reflect/own-keys.js","../../node_modules/core-js-pure/stable/instance/slice.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js","../../node_modules/@babel/runtime-corejs3/helpers/arrayWithoutHoles.js","../../node_modules/@babel/runtime-corejs3/helpers/iterableToArray.js","../../node_modules/@babel/runtime-corejs3/helpers/nonIterableSpread.js","../../node_modules/@babel/runtime-corejs3/helpers/toConsumableArray.js","../../node_modules/core-js-pure/es/array/virtual/concat.js","../../node_modules/core-js-pure/es/instance/concat.js","../../node_modules/core-js-pure/stable/instance/concat.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","../../node_modules/core-js-pure/stable/symbol/index.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/symbol.js","../../node_modules/component-emitter/index.js","../../node_modules/@egjs/hammerjs/dist/hammer.esm.js","../../node_modules/vis-util/esnext/esm/vis-util.js","../../node_modules/core-js-pure/modules/es.reflect.construct.js","../../node_modules/core-js-pure/es/reflect/construct.js","../../node_modules/core-js-pure/stable/reflect/construct.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/reflect/construct.js","../../node_modules/core-js-pure/es/array/virtual/entries.js","../../node_modules/core-js-pure/stable/array/virtual/entries.js","../../node_modules/core-js-pure/stable/instance/entries.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/entries.js","../../node_modules/regenerator-runtime/runtime.js","../../node_modules/@babel/runtime-corejs3/regenerator/index.js","../../node_modules/core-js-pure/stable/symbol/iterator.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/symbol/iterator.js","../../node_modules/core-js-pure/es/array/virtual/values.js","../../node_modules/core-js-pure/stable/array/virtual/values.js","../../node_modules/core-js-pure/stable/instance/values.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/values.js","../../node_modules/core-js-pure/modules/es.array.sort.js","../../node_modules/core-js-pure/es/array/virtual/sort.js","../../node_modules/core-js-pure/es/instance/sort.js","../../node_modules/core-js-pure/stable/instance/sort.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/sort.js","../../node_modules/core-js-pure/es/array/virtual/keys.js","../../node_modules/core-js-pure/stable/array/virtual/keys.js","../../node_modules/core-js-pure/stable/instance/keys.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/keys.js","../../node_modules/core-js-pure/modules/es.array.some.js","../../node_modules/core-js-pure/es/array/virtual/some.js","../../node_modules/core-js-pure/es/instance/some.js","../../node_modules/core-js-pure/stable/instance/some.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/some.js","../../node_modules/core-js-pure/internals/freezing.js","../../node_modules/core-js-pure/internals/internal-metadata.js","../../node_modules/core-js-pure/internals/iterate.js","../../node_modules/core-js-pure/internals/an-instance.js","../../node_modules/core-js-pure/internals/collection.js","../../node_modules/core-js-pure/internals/redefine-all.js","../../node_modules/core-js-pure/internals/set-species.js","../../node_modules/core-js-pure/internals/collection-strong.js","../../node_modules/core-js-pure/modules/es.map.js","../../node_modules/core-js-pure/es/map/index.js","../../node_modules/core-js-pure/stable/map/index.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/map.js","../../node_modules/core-js-pure/features/object/create.js","../../node_modules/@babel/runtime-corejs3/core-js/object/create.js","../../node_modules/core-js-pure/modules/es.object.set-prototype-of.js","../../node_modules/core-js-pure/es/object/set-prototype-of.js","../../node_modules/core-js-pure/features/object/set-prototype-of.js","../../node_modules/@babel/runtime-corejs3/core-js/object/set-prototype-of.js","../../node_modules/@babel/runtime-corejs3/helpers/setPrototypeOf.js","../../node_modules/@babel/runtime-corejs3/helpers/inherits.js","../../node_modules/@babel/runtime-corejs3/helpers/assertThisInitialized.js","../../node_modules/@babel/runtime-corejs3/helpers/possibleConstructorReturn.js","../../node_modules/core-js-pure/features/object/get-prototype-of.js","../../node_modules/@babel/runtime-corejs3/core-js/object/get-prototype-of.js","../../node_modules/@babel/runtime-corejs3/helpers/getPrototypeOf.js","../../node_modules/uuid/dist/esm-browser/rng.js","../../node_modules/uuid/dist/esm-browser/regex.js","../../node_modules/uuid/dist/esm-browser/validate.js","../../node_modules/uuid/dist/esm-browser/stringify.js","../../node_modules/uuid/dist/esm-browser/v4.js","../../src/data-interface.ts","../../src/queue.ts","../../src/data-set-part.ts","../../node_modules/core-js-pure/modules/es.set.js","../../node_modules/core-js-pure/es/set/index.js","../../node_modules/core-js-pure/stable/set/index.js","../../node_modules/@babel/runtime-corejs3/core-js-stable/set.js","../../src/data-stream.ts","../../src/data-set.ts","../../src/data-view.ts","../../src/data-set-check.ts","../../src/data-view-check.ts"],"sourcesContent":["var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line no-undef\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func\n (function () { return this; })() || Function('return this')();\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var fails = require('../internals/fails');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !fails(function () {\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","'use strict';\nvar nativePropertyIsEnumerable = {}.propertyIsEnumerable;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : nativePropertyIsEnumerable;\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar split = ''.split;\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split.call(it, '') : Object(it);\n} : Object;\n","// `RequireObjectCoercible` abstract operation\n// https://tc39.github.io/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('../internals/is-object');\n\n// `ToPrimitive` abstract operation\n// https://tc39.github.io/ecma262/#sec-toprimitive\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (input, PREFERRED_STRING) {\n if (!isObject(input)) return input;\n var fn, val;\n if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var DESCRIPTORS = require('../internals/descriptors');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar has = require('../internals/has');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\nvar nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return nativeGetOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);\n};\n","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","module.exports = {};\n","module.exports = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n};\n","var aFunction = require('../internals/a-function');\n\n// optional / simple context binding\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 0: return function () {\n return fn.call(that);\n };\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nvar nativeDefineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return nativeDefineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","'use strict';\nvar global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar isForced = require('../internals/is-forced');\nvar path = require('../internals/path');\nvar bind = require('../internals/function-bind-context');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof NativeConstructor) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return NativeConstructor.apply(this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;\n\n var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {});\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue;\n\n // bind timers to global for call from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changs in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && typeof sourceProperty == 'function') resultProperty = bind(Function.call, sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n target[key] = resultProperty;\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!has(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n path[VIRTUAL_PROTOTYPE][key] = sourceProperty;\n // export real prototype methods\n if (options.real && targetPrototype && !targetPrototype[key]) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n","var classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.github.io/ecma262/#sec-isarray\nmodule.exports = Array.isArray || function isArray(arg) {\n return classof(arg) == 'Array';\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.github.io/ecma262/#sec-tointeger\nmodule.exports = function (argument) {\n return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);\n};\n","var toInteger = require('../internals/to-integer');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.github.io/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","'use strict';\nvar isArray = require('../internals/is-array');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/function-bind-context');\n\n// `FlattenIntoArray` abstract operation\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? bind(mapper, thisArg, 3) : false;\n var element;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n if (depth > 0 && isArray(element)) {\n targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n};\n\nmodule.exports = flattenIntoArray;\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `ToObject` abstract operation\n// https://tc39.github.io/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (key, value) {\n try {\n createNonEnumerableProperty(global, key, value);\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.7.0',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2020 Denis Pushkarev (zloirock.ru)'\n});\n","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n // Chrome 38 Symbol has incorrect toString conversion\n // eslint-disable-next-line no-undef\n return !String(Symbol());\n});\n","var NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n // eslint-disable-next-line no-undef\n && !Symbol.sham\n // eslint-disable-next-line no-undef\n && typeof Symbol.iterator == 'symbol';\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar has = require('../internals/has');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!has(WellKnownSymbolsStore, name)) {\n if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];\n else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","var isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `ArraySpeciesCreate` abstract operation\n// https://tc39.github.io/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray, length) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar flattenIntoArray = require('../internals/flatten-into-array');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar aFunction = require('../internals/a-function');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\n// `Array.prototype.flatMap` method\n// https://github.com/tc39/proposal-flatMap\n$({ target: 'Array', proto: true }, {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen = toLength(O.length);\n var A;\n aFunction(callbackfn);\n A = arraySpeciesCreate(O, 0);\n A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return A;\n }\n});\n","var path = require('../internals/path');\n\nmodule.exports = function (CONSTRUCTOR) {\n return path[CONSTRUCTOR + 'Prototype'];\n};\n","require('../../../modules/es.array.flat-map');\nrequire('../../../modules/es.array.unscopables.flat-map');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').flatMap;\n","var flatMap = require('../array/virtual/flat-map');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.flatMap;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.flatMap) ? flatMap : own;\n};\n","var parent = require('../../es/instance/flat-map');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/flat-map\");","var bind = require('../internals/function-bind-context');\nvar IndexedObject = require('../internals/indexed-object');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\nvar push = [].push;\n\n// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation\nvar createMethod = function (TYPE) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n return function ($this, callbackfn, that, specificCreate) {\n var O = toObject($this);\n var self = IndexedObject(O);\n var boundFunction = bind(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var create = specificCreate || arraySpeciesCreate;\n var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var value, result;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n value = self[index];\n result = boundFunction(value, index, O);\n if (TYPE) {\n if (IS_MAP) target[index] = result; // map\n else if (result) switch (TYPE) {\n case 3: return true; // some\n case 5: return value; // find\n case 6: return index; // findIndex\n case 2: push.call(target, value); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.forEach` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.foreach\n forEach: createMethod(0),\n // `Array.prototype.map` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.map\n map: createMethod(1),\n // `Array.prototype.filter` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.filter\n filter: createMethod(2),\n // `Array.prototype.some` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.some\n some: createMethod(3),\n // `Array.prototype.every` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.every\n every: createMethod(4),\n // `Array.prototype.find` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.find\n find: createMethod(5),\n // `Array.prototype.findIndex` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex\n findIndex: createMethod(6)\n};\n","var path = require('../internals/path');\nvar global = require('../internals/global');\n\nvar aFunction = function (variable) {\n return typeof variable == 'function' ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n version = match[0] + match[1];\n} else if (userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = match[1];\n }\n}\n\nmodule.exports = version && +version;\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (METHOD_NAME) {\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/677\n return V8_VERSION >= 51 || !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar has = require('../internals/has');\n\nvar defineProperty = Object.defineProperty;\nvar cache = {};\n\nvar thrower = function (it) { throw it; };\n\nmodule.exports = function (METHOD_NAME, options) {\n if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];\n if (!options) options = {};\n var method = [][METHOD_NAME];\n var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;\n var argument0 = has(options, 0) ? options[0] : thrower;\n var argument1 = has(options, 1) ? options[1] : undefined;\n\n return cache[METHOD_NAME] = !!method && !fails(function () {\n if (ACCESSORS && !DESCRIPTORS) return true;\n var O = { length: -1 };\n\n if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });\n else O[1] = 1;\n\n method.call(O, argument0, argument1);\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $map = require('../internals/array-iteration').map;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');\n// FF49- issue\nvar USES_TO_LENGTH = arrayMethodUsesToLength('map');\n\n// `Array.prototype.map` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.map\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.map');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').map;\n","var map = require('../array/virtual/map');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.map;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.map) ? map : own;\n};\n","var parent = require('../../es/instance/map');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/map\");","'use strict';\nvar $ = require('../internals/export');\nvar $filter = require('../internals/array-iteration').filter;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');\n// Edge 14- issue\nvar USES_TO_LENGTH = arrayMethodUsesToLength('filter');\n\n// `Array.prototype.filter` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.filter\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.filter');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').filter;\n","var filter = require('../array/virtual/filter');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.filter;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.filter) ? filter : own;\n};\n","var parent = require('../../es/instance/filter');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/filter\");","var aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\nvar toLength = require('../internals/to-length');\n\n// `Array.prototype.{ reduce, reduceRight }` methods implementation\nvar createMethod = function (IS_RIGHT) {\n return function (that, callbackfn, argumentsLength, memo) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IndexedObject(O);\n var length = toLength(O.length);\n var index = IS_RIGHT ? length - 1 : 0;\n var i = IS_RIGHT ? -1 : 1;\n if (argumentsLength < 2) while (true) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (IS_RIGHT ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.reduce` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call,no-throw-literal\n method.call(null, argument || function () { throw 1; }, 1);\n });\n};\n","var classof = require('../internals/classof-raw');\nvar global = require('../internals/global');\n\nmodule.exports = classof(global.process) == 'process';\n","'use strict';\nvar $ = require('../internals/export');\nvar $reduce = require('../internals/array-reduce').left;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\nvar CHROME_VERSION = require('../internals/engine-v8-version');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar STRICT_METHOD = arrayMethodIsStrict('reduce');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });\n// Chrome 80-82 has a critical bug\n// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982\nvar CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;\n\n// `Array.prototype.reduce` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.reduce\n$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH || CHROME_BUG }, {\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.reduce');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').reduce;\n","var reduce = require('../array/virtual/reduce');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.reduce;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.reduce) ? reduce : own;\n};\n","var parent = require('../../es/instance/reduce');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/reduce\");","'use strict';\nvar aFunction = require('../internals/a-function');\nvar isObject = require('../internals/is-object');\n\nvar slice = [].slice;\nvar factories = {};\n\nvar construct = function (C, argsLength, args) {\n if (!(argsLength in factories)) {\n for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');\n } return factories[argsLength](C, args);\n};\n\n// `Function.prototype.bind` method implementation\n// https://tc39.github.io/ecma262/#sec-function.prototype.bind\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = slice.call(arguments, 1);\n var boundFunction = function bound(/* args... */) {\n var args = partArgs.concat(slice.call(arguments));\n return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args);\n };\n if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype;\n return boundFunction;\n};\n","var $ = require('../internals/export');\nvar bind = require('../internals/function-bind');\n\n// `Function.prototype.bind` method\n// https://tc39.github.io/ecma262/#sec-function.prototype.bind\n$({ target: 'Function', proto: true }, {\n bind: bind\n});\n","require('../../../modules/es.function.bind');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Function').bind;\n","var bind = require('../function/virtual/bind');\n\nvar FunctionPrototype = Function.prototype;\n\nmodule.exports = function (it) {\n var own = it.bind;\n return it === FunctionPrototype || (it instanceof Function && own === FunctionPrototype.bind) ? bind : own;\n};\n","var parent = require('../../es/instance/bind');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/bind\");","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar objectDefinePropertyModile = require('../internals/object-define-property');\n\n// `Object.defineProperty` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperty\n$({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, {\n defineProperty: objectDefinePropertyModile.f\n});\n","require('../../modules/es.object.define-property');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nvar defineProperty = module.exports = function defineProperty(it, key, desc) {\n return Object.defineProperty(it, key, desc);\n};\n\nif (Object.defineProperty.sham) defineProperty.sham = true;\n","var parent = require('../../es/object/define-property');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/object/define-property\");","var _Object$defineProperty = require(\"@babel/runtime-corejs3/core-js/object/define-property\");\n\nfunction _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\n _Object$defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","import { DataInterface, EventCallbacks, PartItem } from \"./data-interface\";\nimport { DataSet } from \"./data-set\";\n\n/**\n * This interface is used to control the pipe.\n */\nexport interface DataPipe {\n /**\n * Take all items from the source data set or data view, transform them as\n * configured and update the target data set.\n */\n all(): this;\n\n /**\n * Start observing the source data set or data view, transforming the items\n * and updating the target data set.\n *\n * @remarks\n * The current content of the source data set will be ignored. If you for\n * example want to process all the items that are already there use:\n * `pipe.all().start()`.\n */\n start(): this;\n\n /**\n * Stop observing the source data set or data view, transforming the items\n * and updating the target data set.\n */\n stop(): this;\n}\n\n/**\n * This interface is used to construct the pipe.\n */\nexport type DataPipeFactory = InstanceType<typeof DataPipeUnderConstruction>;\n\n/**\n * Create new data pipe.\n *\n * @param from - The source data set or data view.\n *\n * @remarks\n * Example usage:\n * ```typescript\n * interface AppItem {\n * whoami: string;\n * appData: unknown;\n * visData: VisItem;\n * }\n * interface VisItem {\n * id: number;\n * label: string;\n * color: string;\n * x: number;\n * y: number;\n * }\n *\n * const ds1 = new DataSet<AppItem, \"whoami\">([], { fieldId: \"whoami\" });\n * const ds2 = new DataSet<VisItem, \"id\">();\n *\n * const pipe = createNewDataPipeFrom(ds1)\n * .filter((item): boolean => item.enabled === true)\n * .map<VisItem, \"id\">((item): VisItem => item.visData)\n * .to(ds2);\n *\n * pipe.start();\n * ```\n *\n * @returns A factory whose methods can be used to configure the pipe.\n */\nexport function createNewDataPipeFrom<\n SI extends PartItem<SP>,\n SP extends string = \"id\"\n>(from: DataInterface<SI, SP>): DataPipeUnderConstruction<SI, SP> {\n return new DataPipeUnderConstruction(from);\n}\n\ntype Transformer<T> = (input: T[]) => T[];\n\n/**\n * Internal implementation of the pipe. This should be accessible only through\n * `createNewDataPipeFrom` from the outside.\n *\n * @typeParam SI - Source item type.\n * @typeParam SP - Source item type's id property name.\n * @typeParam TI - Target item type.\n * @typeParam TP - Target item type's id property name.\n */\nclass SimpleDataPipe<\n SI extends PartItem<SP>,\n SP extends string,\n TI extends PartItem<TP>,\n TP extends string\n> implements DataPipe {\n /**\n * Bound listeners for use with `DataInterface['on' | 'off']`.\n */\n private readonly _listeners: EventCallbacks<SI, SP> = {\n add: this._add.bind(this),\n remove: this._remove.bind(this),\n update: this._update.bind(this),\n };\n\n /**\n * Create a new data pipe.\n *\n * @param _source - The data set or data view that will be observed.\n * @param _transformers - An array of transforming functions to be used to\n * filter or transform the items in the pipe.\n * @param _target - The data set or data view that will receive the items.\n */\n public constructor(\n private readonly _source: DataInterface<SI, SP>,\n private readonly _transformers: readonly Transformer<unknown>[],\n private readonly _target: DataSet<TI, TP>\n ) {}\n\n /** @inheritDoc */\n public all(): this {\n this._target.update(this._transformItems(this._source.get()));\n return this;\n }\n\n /** @inheritDoc */\n public start(): this {\n this._source.on(\"add\", this._listeners.add);\n this._source.on(\"remove\", this._listeners.remove);\n this._source.on(\"update\", this._listeners.update);\n\n return this;\n }\n\n /** @inheritDoc */\n public stop(): this {\n this._source.off(\"add\", this._listeners.add);\n this._source.off(\"remove\", this._listeners.remove);\n this._source.off(\"update\", this._listeners.update);\n\n return this;\n }\n\n /**\n * Apply the transformers to the items.\n *\n * @param items - The items to be transformed.\n *\n * @returns The transformed items.\n */\n private _transformItems(items: unknown[]): any[] {\n return this._transformers.reduce((items, transform): unknown[] => {\n return transform(items);\n }, items);\n }\n\n /**\n * Handle an add event.\n *\n * @param _name - Ignored.\n * @param payload - The payload containing the ids of the added items.\n */\n private _add(\n _name: Parameters<EventCallbacks<SI, SP>[\"add\"]>[0],\n payload: Parameters<EventCallbacks<SI, SP>[\"add\"]>[1]\n ): void {\n if (payload == null) {\n return;\n }\n\n this._target.add(this._transformItems(this._source.get(payload.items)));\n }\n\n /**\n * Handle an update event.\n *\n * @param _name - Ignored.\n * @param payload - The payload containing the ids of the updated items.\n */\n private _update(\n _name: Parameters<EventCallbacks<SI, SP>[\"update\"]>[0],\n payload: Parameters<EventCallbacks<SI, SP>[\"update\"]>[1]\n ): void {\n if (payload == null) {\n return;\n }\n\n this._target.update(this._transformItems(this._source.get(payload.items)));\n }\n\n /**\n * Handle a remove event.\n *\n * @param _name - Ignored.\n * @param payload - The payload containing the data of the removed items.\n */\n private _remove(\n _name: Parameters<EventCallbacks<SI, SP>[\"remove\"]>[0],\n payload: Parameters<EventCallbacks<SI, SP>[\"remove\"]>[1]\n ): void {\n if (payload == null) {\n return;\n }\n\n this._target.remove(this._transformItems(payload.oldData));\n }\n}\n\n/**\n * Internal implementation of the pipe factory. This should be accessible\n * only through `createNewDataPipeFrom` from the outside.\n *\n * @typeParam TI - Target item type.\n * @typeParam TP - Target item type's id property name.\n */\nclass DataPipeUnderConstruction<\n SI extends PartItem<SP>,\n SP extends string = \"id\"\n> {\n /**\n * Array transformers used to transform items within the pipe. This is typed\n * as any for the sake of simplicity.\n */\n private readonly _transformers: Transformer<any>[] = [];\n\n /**\n * Create a new data pipe factory. This is an internal constructor that\n * should never be called from outside of this file.\n *\n * @param _source - The source data set or data view for this pipe.\n */\n public constructor(private readonly _source: DataInterface<SI, SP>) {}\n\n /**\n * Filter the items.\n *\n * @param callback - A filtering function that returns true if given item\n * should be piped and false if not.\n *\n * @returns This factory for further configuration.\n */\n public filter(\n callback: (item: SI) => boolean\n ): DataPipeUnderConstruction<SI, SP> {\n this._transformers.push((input): unknown[] => input.filter(callback));\n return this;\n }\n\n /**\n * Map each source item to a new type.\n *\n * @param callback - A mapping function that takes a source item and returns\n * corresponding mapped item.\n *\n * @typeParam TI - Target item type.\n * @typeParam TP - Target item type's id property name.\n *\n * @returns This factory for further configuration.\n */\n public map<TI extends PartItem<TP>, TP extends string = \"id\">(\n callback: (item: SI) => TI\n ): DataPipeUnderConstruction<TI, TP> {\n this._transformers.push((input): unknown[] => input.map(callback));\n return (this as unknown) as DataPipeUnderConstruction<TI, TP>;\n }\n\n /**\n * Map each source item to zero or more items of a new type.\n *\n * @param callback - A mapping function that takes a source item and returns\n * an array of corresponding mapped items.\n *\n * @typeParam TI - Target item type.\n * @typeParam TP - Target item type's id property name.\n *\n * @returns This factory for further configuration.\n */\n public flatMap<TI extends PartItem<TP>, TP extends string = \"id\">(\n callback: (item: SI) => TI[]\n ): DataPipeUnderConstruction<TI, TP> {\n this._transformers.push((input): unknown[] => input.flatMap(callback));\n return (this as unknown) as DataPipeUnderConstruction<TI, TP>;\n }\n\n /**\n * Connect this pipe to given data set.\n *\n * @param target - The data set that will receive the items from this pipe.\n *\n * @returns The pipe connected between given data sets and performing\n * configured transformation on the processed items.\n */\n public to(target: DataSet<SI, SP>): DataPipe {\n return new SimpleDataPipe(this._source, this._transformers, target);\n }\n}\n","var parent = require('../../es/object/define-property');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/object/define-property\");","var toInteger = require('../internals/to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toInteger(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","module.exports = {};\n","var has = require('../internals/has');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~indexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.github.io/ecma262/#sec-object.keys\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperties\nmodule.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);\n return O;\n};\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar defineProperties = require('../internals/object-define-properties');\n\n// `Object.defineProperties` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperties\n$({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, {\n defineProperties: defineProperties\n});\n","require('../../modules/es.object.define-properties');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nvar defineProperties = module.exports = function defineProperties(T, D) {\n return Object.defineProperties(T, D);\n};\n\nif (Object.defineProperties.sham) defineProperties.sham = true;\n","var parent = require('../../es/object/define-properties');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/object/define-properties\");","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertynames\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","exports.f = Object.getOwnPropertySymbols;\n","var getBuiltIn = require('../internals/get-built-in');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPrimitive(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar ownKeys = require('../internals/own-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar createProperty = require('../internals/create-property');\n\n// `Object.getOwnPropertyDescriptors` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors\n$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIndexedObject(object);\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n var keys = ownKeys(O);\n var result = {};\n var index = 0;\n var key, descriptor;\n while (keys.length > index) {\n descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);\n if (descriptor !== undefined) createProperty(result, key, descriptor);\n }\n return result;\n }\n});\n","require('../../modules/es.object.get-own-property-descriptors');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.getOwnPropertyDescriptors;\n","var parent = require('../../es/object/get-own-property-descriptors');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/object/get-own-property-descriptors\");","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });\nvar FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor\n$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {\n return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);\n }\n});\n","require('../../modules/es.object.get-own-property-descriptor');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nvar getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {\n return Object.getOwnPropertyDescriptor(it, key);\n};\n\nif (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;\n","var parent = require('../../es/object/get-own-property-descriptor');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/object/get-own-property-descriptor\");","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","var anObject = require('../internals/an-object');\nvar defineProperties = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n /* global ActiveXObject */\n activeXDocument = document.domain && new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.github.io/ecma262/#sec-object.create\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : defineProperties(result, Properties);\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar nativeGetOwnPropertyNames = require('../internals/object-get-own-property-names').f;\n\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return nativeGetOwnPropertyNames(it);\n } catch (error) {\n return windowNames.slice();\n }\n};\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]'\n ? getWindowNames(it)\n : nativeGetOwnPropertyNames(toIndexedObject(it));\n};\n","var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (target, key, value, options) {\n if (options && options.enumerable) target[key] = value;\n else createNonEnumerableProperty(target, key, value);\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nexports.f = wellKnownSymbol;\n","var path = require('../internals/path');\nvar has = require('../internals/has');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (NAME) {\n var Symbol = path.Symbol || (path.Symbol = {});\n if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {\n value: wrappedWellKnownSymbolModule.f(NAME)\n });\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;\n};\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classof = require('../internals/classof');\n\n// `Object.prototype.toString` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar defineProperty = require('../internals/object-define-property').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar toString = require('../internals/object-to-string');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (it, TAG, STATIC, SET_METHOD) {\n if (it) {\n var target = STATIC ? it : it.prototype;\n if (!has(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {\n createNonEnumerableProperty(target, 'toString', toString);\n }\n }\n};\n","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper\nif (typeof store.inspectSource != 'function') {\n store.inspectSource = function (it) {\n return functionToString.call(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var global = require('../internals/global');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar objectHas = require('../internals/has');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = store.get;\n var wmhas = store.has;\n var wmset = store.set;\n set = function (it, metadata) {\n metadata.facade = it;\n wmset.call(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget.call(store, it) || {};\n };\n has = function (it) {\n return wmhas.call(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return objectHas(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return objectHas(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\nvar fails = require('../internals/fails');\nvar has = require('../internals/has');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar anObject = require('../internals/an-object');\nvar toObject = require('../internals/to-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar nativeObjectCreate = require('../internals/object-create');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar shared = require('../internals/shared');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar uid = require('../internals/uid');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineWellKnownSymbol = require('../internals/define-well-known-symbol');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar HIDDEN = sharedKey('hidden');\nvar SYMBOL = 'Symbol';\nvar PROTOTYPE = 'prototype';\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(SYMBOL);\nvar ObjectPrototype = Object[PROTOTYPE];\nvar $Symbol = global.Symbol;\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;\nvar nativePropertyIsEnumerable = propertyIsEnumerableModule.f;\nvar AllSymbols = shared('symbols');\nvar ObjectPrototypeSymbols = shared('op-symbols');\nvar StringToSymbolRegistry = shared('string-to-symbol-registry');\nvar SymbolToStringRegistry = shared('symbol-to-string-registry');\nvar WellKnownSymbolsStore = shared('wks');\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDescriptor = DESCRIPTORS && fails(function () {\n return nativeObjectCreate(nativeDefineProperty({}, 'a', {\n get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (O, P, Attributes) {\n var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);\n if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];\n nativeDefineProperty(O, P, Attributes);\n if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {\n nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);\n }\n} : nativeDefineProperty;\n\nvar wrap = function (tag, description) {\n var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);\n setInternalState(symbol, {\n type: SYMBOL,\n tag: tag,\n description: description\n });\n if (!DESCRIPTORS) symbol.description = description;\n return symbol;\n};\n\nvar isSymbol = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return Object(it) instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(O, P, Attributes) {\n if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);\n anObject(O);\n var key = toPrimitive(P, true);\n anObject(Attributes);\n if (has(AllSymbols, key)) {\n if (!Attributes.enumerable) {\n if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));\n O[HIDDEN][key] = true;\n } else {\n if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;\n Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });\n } return setSymbolDescriptor(O, key, Attributes);\n } return nativeDefineProperty(O, key, Attributes);\n};\n\nvar $defineProperties = function defineProperties(O, Properties) {\n anObject(O);\n var properties = toIndexedObject(Properties);\n var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));\n $forEach(keys, function (key) {\n if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);\n });\n return O;\n};\n\nvar $create = function create(O, Properties) {\n return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);\n};\n\nvar $propertyIsEnumerable = function propertyIsEnumerable(V) {\n var P = toPrimitive(V, true);\n var enumerable = nativePropertyIsEnumerable.call(this, P);\n if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;\n return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;\n};\n\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {\n var it = toIndexedObject(O);\n var key = toPrimitive(P, true);\n if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;\n var descriptor = nativeGetOwnPropertyDescriptor(it, key);\n if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {\n descriptor.enumerable = true;\n }\n return descriptor;\n};\n\nvar $getOwnPropertyNames = function getOwnPropertyNames(O) {\n var names = nativeGetOwnPropertyNames(toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);\n });\n return result;\n};\n\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(O) {\n var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;\n var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {\n result.push(AllSymbols[key]);\n }\n });\n return result;\n};\n\n// `Symbol` constructor\n// https://tc39.github.io/ecma262/#sec-symbol-constructor\nif (!NATIVE_SYMBOL) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');\n var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);\n var tag = uid(description);\n var setter = function (value) {\n if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));\n };\n if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });\n return wrap(tag, description);\n };\n\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return getInternalState(this).tag;\n });\n\n redefine($Symbol, 'withoutSetter', function (description) {\n return wrap(uid(description), description);\n });\n\n propertyIsEnumerableModule.f = $propertyIsEnumerable;\n definePropertyModule.f = $defineProperty;\n getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;\n getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;\n getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;\n\n wrappedWellKnownSymbolModule.f = function (name) {\n return wrap(wellKnownSymbol(name), name);\n };\n\n if (DESCRIPTORS) {\n // https://github.com/tc39/proposal-Symbol-description\n nativeDefineProperty($Symbol[PROTOTYPE], 'description', {\n configurable: true,\n get: function description() {\n return getInternalState(this).description;\n }\n });\n if (!IS_PURE) {\n redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });\n }\n }\n}\n\n$({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {\n Symbol: $Symbol\n});\n\n$forEach(objectKeys(WellKnownSymbolsStore), function (name) {\n defineWellKnownSymbol(name);\n});\n\n$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {\n // `Symbol.for` method\n // https://tc39.github.io/ecma262/#sec-symbol.for\n 'for': function (key) {\n var string = String(key);\n if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];\n var symbol = $Symbol(string);\n StringToSymbolRegistry[string] = symbol;\n SymbolToStringRegistry[symbol] = string;\n return symbol;\n },\n // `Symbol.keyFor` method\n // https://tc39.github.io/ecma262/#sec-symbol.keyfor\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');\n if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];\n },\n useSetter: function () { USE_SETTER = true; },\n useSimple: function () { USE_SETTER = false; }\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {\n // `Object.create` method\n // https://tc39.github.io/ecma262/#sec-object.create\n create: $create,\n // `Object.defineProperty` method\n // https://tc39.github.io/ecma262/#sec-object.defineproperty\n defineProperty: $defineProperty,\n // `Object.defineProperties` method\n // https://tc39.github.io/ecma262/#sec-object.defineproperties\n defineProperties: $defineProperties,\n // `Object.getOwnPropertyDescriptor` method\n // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {\n // `Object.getOwnPropertyNames` method\n // https://tc39.github.io/ecma262/#sec-object.getownpropertynames\n getOwnPropertyNames: $getOwnPropertyNames,\n // `Object.getOwnPropertySymbols` method\n // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\n$({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n return getOwnPropertySymbolsModule.f(toObject(it));\n }\n});\n\n// `JSON.stringify` method behavior with symbols\n// https://tc39.github.io/ecma262/#sec-json.stringify\nif ($stringify) {\n var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {\n var symbol = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n return $stringify([symbol]) != '[null]'\n // WebKit converts symbol values to JSON as null\n || $stringify({ a: symbol }) != '{}'\n // V8 throws on boxed symbols\n || $stringify(Object(symbol)) != '{}';\n });\n\n $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {\n // eslint-disable-next-line no-unused-vars\n stringify: function stringify(it, replacer, space) {\n var args = [it];\n var index = 1;\n var $replacer;\n while (arguments.length > index) args.push(arguments[index++]);\n $replacer = replacer;\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return $stringify.apply(null, args);\n }\n });\n}\n\n// `Symbol.prototype[@@toPrimitive]` method\n// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive\nif (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {\n createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n}\n// `Symbol.prototype[@@toStringTag]` property\n// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag\nsetToStringTag($Symbol, SYMBOL);\n\nhiddenKeys[HIDDEN] = true;\n","require('../../modules/es.symbol');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.getOwnPropertySymbols;\n","var parent = require('../../es/object/get-own-property-symbols');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/object/get-own-property-symbols\");","module.exports = {};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","var has = require('../internals/has');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar ObjectPrototype = Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectPrototype : null;\n};\n","'use strict';\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\nvar returnThis = function () { return this; };\n\n// `%IteratorPrototype%` object\n// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nif (IteratorPrototype == undefined) IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nif (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {\n createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it) && it !== null) {\n throw TypeError(\"Can't set \" + String(it) + ' as a prototype');\n } return it;\n};\n","var anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;\n setter.call(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter.call(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {\n createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return nativeIterator.call(this); };\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);\n }\n Iterators[NAME] = defaultIterator;\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n redefine(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n return methods;\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.github.io/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject\nIterators.Arguments = Iterators.Array;\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n","require('./es.array.iterator');\nvar DOMIterables = require('../internals/dom-iterables');\nvar global = require('../internals/global');\nvar classof = require('../internals/classof');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n Iterators[COLLECTION_NAME] = Iterators.Array;\n}\n","var toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.{ codePointAt, at }` methods implementation\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = String(requireObjectCoercible($this));\n var position = toInteger(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = S.charCodeAt(position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING ? S.charAt(position) : first\n : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: String(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return { value: undefined, done: true };\n point = charAt(string, index);\n state.index += point.length;\n return { value: point, done: false };\n});\n","var classof = require('../internals/classof');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var anObject = require('../internals/an-object');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nmodule.exports = function (it) {\n var iteratorMethod = getIteratorMethod(it);\n if (typeof iteratorMethod != 'function') {\n throw TypeError(String(it) + ' is not iterable');\n } return anObject(iteratorMethod.call(it));\n};\n","require('../modules/web.dom-collections.iterator');\nrequire('../modules/es.string.iterator');\nvar getIterator = require('../internals/get-iterator');\n\nmodule.exports = getIterator;\n","module.exports = require(\"core-js-pure/features/get-iterator\");","require('../modules/web.dom-collections.iterator');\nrequire('../modules/es.string.iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nmodule.exports = getIteratorMethod;\n","module.exports = require(\"core-js-pure/features/get-iterator-method\");","var anObject = require('../internals/an-object');\n\nmodule.exports = function (iterator) {\n var returnMethod = iterator['return'];\n if (returnMethod !== undefined) {\n return anObject(returnMethod.call(iterator)).value;\n }\n};\n","var anObject = require('../internals/an-object');\nvar iteratorClose = require('../internals/iterator-close');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (error) {\n iteratorClose(iterator);\n throw error;\n }\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar toObject = require('../internals/to-object');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar createProperty = require('../internals/create-property');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\n// `Array.from` method implementation\n// https://tc39.github.io/ecma262/#sec-array.from\nmodule.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iteratorMethod = getIteratorMethod(O);\n var index = 0;\n var length, result, step, iterator, next, value;\n if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);\n // if the target is not iterable or it's an array with the default iterator - use a simple case\n if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {\n iterator = iteratorMethod.call(O);\n next = iterator.next;\n result = new C();\n for (;!(step = next.call(iterator)).done; index++) {\n value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;\n createProperty(result, index, value);\n }\n } else {\n length = toLength(O.length);\n result = new C(length);\n for (;length > index; index++) {\n value = mapping ? mapfn(O[index], index) : O[index];\n createProperty(result, index, value);\n }\n }\n result.length = index;\n return result;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line no-throw-literal\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","var $ = require('../internals/export');\nvar from = require('../internals/array-from');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\n\nvar INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {\n Array.from(iterable);\n});\n\n// `Array.from` method\n// https://tc39.github.io/ecma262/#sec-array.from\n$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {\n from: from\n});\n","require('../../modules/es.string.iterator');\nrequire('../../modules/es.array.from');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Array.from;\n","var parent = require('../../es/array/from');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/array/from\");","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\n\n// `Array.prototype.fill` method implementation\n// https://tc39.github.io/ecma262/#sec-array.prototype.fill\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var argumentsLength = arguments.length;\n var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);\n var end = argumentsLength > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","var $ = require('../internals/export');\nvar fill = require('../internals/array-fill');\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// `Array.prototype.fill` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.fill\n$({ target: 'Array', proto: true }, {\n fill: fill\n});\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('fill');\n","require('../../../modules/es.array.fill');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').fill;\n","var $ = require('../internals/export');\nvar global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar slice = [].slice;\nvar MSIE = /MSIE .\\./.test(userAgent); // <- dirty ie9- check\n\nvar wrap = function (scheduler) {\n return function (handler, timeout /* , ...arguments */) {\n var boundArgs = arguments.length > 2;\n var args = boundArgs ? slice.call(arguments, 2) : undefined;\n return scheduler(boundArgs ? function () {\n // eslint-disable-next-line no-new-func\n (typeof handler == 'function' ? handler : Function(handler)).apply(this, args);\n } : handler, timeout);\n };\n};\n\n// ie9- setTimeout & setInterval additional parameters fix\n// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers\n$({ global: true, bind: true, forced: MSIE }, {\n // `setTimeout` method\n // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout\n setTimeout: wrap(global.setTimeout),\n // `setInterval` method\n // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval\n setInterval: wrap(global.setInterval)\n});\n","require('../modules/web.timers');\nvar path = require('../internals/path');\n\nmodule.exports = path.setTimeout;\n","module.exports = require(\"core-js-pure/stable/set-timeout\");","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar fails = require('../internals/fails');\n\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar re = /[\\uD800-\\uDFFF]/g;\nvar low = /^[\\uD800-\\uDBFF]$/;\nvar hi = /^[\\uDC00-\\uDFFF]$/;\n\nvar fix = function (match, offset, string) {\n var prev = string.charAt(offset - 1);\n var next = string.charAt(offset + 1);\n if ((low.test(match) && !hi.test(next)) || (hi.test(match) && !low.test(prev))) {\n return '\\\\u' + match.charCodeAt(0).toString(16);\n } return match;\n};\n\nvar FORCED = fails(function () {\n return $stringify('\\uDF06\\uD834') !== '\"\\\\udf06\\\\ud834\"'\n || $stringify('\\uDEAD') !== '\"\\\\udead\"';\n});\n\nif ($stringify) {\n // https://github.com/tc39/proposal-well-formed-stringify\n $({ target: 'JSON', stat: true, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars\n stringify: function stringify(it, replacer, space) {\n var result = $stringify.apply(null, arguments);\n return typeof result == 'string' ? result.replace(re, fix) : result;\n }\n });\n}\n","require('../../modules/es.json.stringify');\nvar core = require('../../internals/path');\n\nif (!core.JSON) core.JSON = { stringify: JSON.stringify };\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function stringify(it, replacer, space) {\n return core.JSON.stringify.apply(null, arguments);\n};\n","var parent = require('../../es/json/stringify');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/json/stringify\");","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar create = require('../internals/object-create');\n\n// `Object.create` method\n// https://tc39.github.io/ecma262/#sec-object.create\n$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {\n create: create\n});\n","require('../../modules/es.object.create');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nmodule.exports = function create(P, D) {\n return Object.create(P, D);\n};\n","var parent = require('../../es/object/create');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/object/create\");","var _Object$defineProperty = require(\"@babel/runtime-corejs3/core-js/object/define-property\");\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n _Object$defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","// a string of all valid unicode whitespaces\n// eslint-disable-next-line max-len\nmodule.exports = '\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u00A0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","var requireObjectCoercible = require('../internals/require-object-coercible');\nvar whitespaces = require('../internals/whitespaces');\n\nvar whitespace = '[' + whitespaces + ']';\nvar ltrim = RegExp('^' + whitespace + whitespace + '*');\nvar rtrim = RegExp(whitespace + whitespace + '*$');\n\n// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation\nvar createMethod = function (TYPE) {\n return function ($this) {\n var string = String(requireObjectCoercible($this));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n };\n};\n\nmodule.exports = {\n // `String.prototype.{ trimLeft, trimStart }` methods\n // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.github.io/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n","var fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n","require('../../../modules/es.string.trim');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('String').trim;\n","'use strict';\nvar $ = require('../internals/export');\nvar $indexOf = require('../internals/array-includes').indexOf;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar nativeIndexOf = [].indexOf;\n\nvar NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;\nvar STRICT_METHOD = arrayMethodIsStrict('indexOf');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });\n\n// `Array.prototype.indexOf` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.indexof\n$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? nativeIndexOf.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.index-of');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').indexOf;\n","var global = require('../internals/global');\nvar trim = require('../internals/string-trim').trim;\nvar whitespaces = require('../internals/whitespaces');\n\nvar $parseInt = global.parseInt;\nvar hex = /^[+-]?0[Xx]/;\nvar FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;\n\n// `parseInt` method\n// https://tc39.github.io/ecma262/#sec-parseint-string-radix\nmodule.exports = FORCED ? function parseInt(string, radix) {\n var S = trim(String(string));\n return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));\n} : $parseInt;\n","var $ = require('../internals/export');\nvar parseIntImplementation = require('../internals/number-parse-int');\n\n// `parseInt` method\n// https://tc39.github.io/ecma262/#sec-parseint-string-radix\n$({ global: true, forced: parseInt != parseIntImplementation }, {\n parseInt: parseIntImplementation\n});\n","var DESCRIPTORS = require('../internals/descriptors');\nvar objectKeys = require('../internals/object-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;\n\n// `Object.{ entries, values }` methods implementation\nvar createMethod = function (TO_ENTRIES) {\n return function (it) {\n var O = toIndexedObject(it);\n var keys = objectKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {\n result.push(TO_ENTRIES ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n\nmodule.exports = {\n // `Object.entries` method\n // https://tc39.github.io/ecma262/#sec-object.entries\n entries: createMethod(true),\n // `Object.values` method\n // https://tc39.github.io/ecma262/#sec-object.values\n values: createMethod(false)\n};\n","var $ = require('../internals/export');\nvar $values = require('../internals/object-to-array').values;\n\n// `Object.values` method\n// https://tc39.github.io/ecma262/#sec-object.values\n$({ target: 'Object', stat: true }, {\n values: function values(O) {\n return $values(O);\n }\n});\n","require('../../modules/es.object.values');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.values;\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toObject = require('../internals/to-object');\nvar nativeGetPrototypeOf = require('../internals/object-get-prototype-of');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {\n getPrototypeOf: function getPrototypeOf(it) {\n return nativeGetPrototypeOf(toObject(it));\n }\n});\n\n","require('../../modules/es.object.get-prototype-of');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.getPrototypeOf;\n","'use strict';\nvar $ = require('../internals/export');\nvar $includes = require('../internals/array-includes').includes;\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });\n\n// `Array.prototype.includes` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.includes\n$({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('includes');\n","require('../../../modules/es.array.includes');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').includes;\n","var isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\n// `IsRegExp` abstract operation\n// https://tc39.github.io/ecma262/#sec-isregexp\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');\n};\n","var isRegExp = require('../internals/is-regexp');\n\nmodule.exports = function (it) {\n if (isRegExp(it)) {\n throw TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\nmodule.exports = function (METHOD_NAME) {\n var regexp = /./;\n try {\n '/./'[METHOD_NAME](regexp);\n } catch (error1) {\n try {\n regexp[MATCH] = false;\n return '/./'[METHOD_NAME](regexp);\n } catch (error2) { /* empty */ }\n } return false;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\n\n// `String.prototype.includes` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.includes\n$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~String(requireObjectCoercible(this))\n .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.string.includes');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('String').includes;\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\n\nvar nativeAssign = Object.assign;\nvar defineProperty = Object.defineProperty;\n\n// `Object.assign` method\n// https://tc39.github.io/ecma262/#sec-object.assign\nmodule.exports = !nativeAssign || fails(function () {\n // should have correct order of operations (Edge bug)\n if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {\n enumerable: true,\n get: function () {\n defineProperty(this, 'b', {\n value: 3,\n enumerable: false\n });\n }\n }), { b: 2 })).b !== 1) return true;\n // should work with symbols and should have deterministic property order (V8 bug)\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var symbol = Symbol();\n var alphabet = 'abcdefghijklmnopqrst';\n A[symbol] = 7;\n alphabet.split('').forEach(function (chr) { B[chr] = chr; });\n return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var argumentsLength = arguments.length;\n var index = 1;\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n var propertyIsEnumerable = propertyIsEnumerableModule.f;\n while (argumentsLength > index) {\n var S = IndexedObject(arguments[index++]);\n var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : nativeAssign;\n","var $ = require('../internals/export');\nvar assign = require('../internals/object-assign');\n\n// `Object.assign` method\n// https://tc39.github.io/ecma262/#sec-object.assign\n$({ target: 'Object', stat: true, forced: Object.assign !== assign }, {\n assign: assign\n});\n","require('../../modules/es.object.assign');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.assign;\n","var parent = require('../../es/object/assign');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/object/assign\");","'use strict';\nvar $ = require('../internals/export');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\nvar toObject = require('../internals/to-object');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar createProperty = require('../internals/create-property');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });\n\nvar max = Math.max;\nvar min = Math.min;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;\nvar MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';\n\n// `Array.prototype.splice` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.splice\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {\n splice: function splice(start, deleteCount /* , ...items */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var actualStart = toAbsoluteIndex(start, len);\n var argumentsLength = arguments.length;\n var insertCount, actualDeleteCount, A, k, from, to;\n if (argumentsLength === 0) {\n insertCount = actualDeleteCount = 0;\n } else if (argumentsLength === 1) {\n insertCount = 0;\n actualDeleteCount = len - actualStart;\n } else {\n insertCount = argumentsLength - 2;\n actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);\n }\n if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {\n throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);\n }\n A = arraySpeciesCreate(O, actualDeleteCount);\n for (k = 0; k < actualDeleteCount; k++) {\n from = actualStart + k;\n if (from in O) createProperty(A, k, O[from]);\n }\n A.length = actualDeleteCount;\n if (insertCount < actualDeleteCount) {\n for (k = actualStart; k < len - actualDeleteCount; k++) {\n from = k + actualDeleteCount;\n to = k + insertCount;\n if (from in O) O[to] = O[from];\n else delete O[to];\n }\n for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];\n } else if (insertCount > actualDeleteCount) {\n for (k = len - actualDeleteCount; k > actualStart; k--) {\n from = k + actualDeleteCount - 1;\n to = k + insertCount - 1;\n if (from in O) O[to] = O[from];\n else delete O[to];\n }\n }\n for (k = 0; k < insertCount; k++) {\n O[k + actualStart] = arguments[k + 2];\n }\n O.length = len - actualDeleteCount + insertCount;\n return A;\n }\n});\n","require('../../../modules/es.array.splice');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').splice;\n","var splice = require('../array/virtual/splice');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.splice;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.splice) ? splice : own;\n};\n","var parent = require('../../es/instance/splice');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/splice\");","'use strict';\nvar $ = require('../internals/export');\nvar isArray = require('../internals/is-array');\n\nvar nativeReverse = [].reverse;\nvar test = [1, 2];\n\n// `Array.prototype.reverse` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.reverse\n// fix for Safari 12.0 bug\n// https://bugs.webkit.org/show_bug.cgi?id=188794\n$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {\n reverse: function reverse() {\n // eslint-disable-next-line no-self-assign\n if (isArray(this)) this.length = this.length;\n return nativeReverse.call(this);\n }\n});\n","require('../../../modules/es.array.reverse');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').reverse;\n","var reverse = require('../array/virtual/reverse');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.reverse;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.reverse) ? reverse : own;\n};\n","var parent = require('../../es/instance/reverse');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/reverse\");","'use strict';\nvar $forEach = require('../internals/array-iteration').forEach;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar STRICT_METHOD = arrayMethodIsStrict('forEach');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('forEach');\n\n// `Array.prototype.forEach` method implementation\n// https://tc39.github.io/ecma262/#sec-array.prototype.foreach\nmodule.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n} : [].forEach;\n","'use strict';\nvar $ = require('../internals/export');\nvar forEach = require('../internals/array-for-each');\n\n// `Array.prototype.forEach` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.foreach\n$({ target: 'Array', proto: true, forced: [].forEach != forEach }, {\n forEach: forEach\n});\n","require('../../../modules/es.array.for-each');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').forEach;\n","var parent = require('../../../es/array/virtual/for-each');\n\nmodule.exports = parent;\n","require('../../modules/web.dom-collections.iterator');\nvar forEach = require('../array/virtual/for-each');\nvar classof = require('../../internals/classof');\nvar ArrayPrototype = Array.prototype;\n\nvar DOMIterables = {\n DOMTokenList: true,\n NodeList: true\n};\n\nmodule.exports = function (it) {\n var own = it.forEach;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.forEach)\n // eslint-disable-next-line no-prototype-builtins\n || DOMIterables.hasOwnProperty(classof(it)) ? forEach : own;\n};\n","module.exports = require(\"core-js-pure/stable/instance/for-each\");","var $ = require('../internals/export');\nvar isArray = require('../internals/is-array');\n\n// `Array.isArray` method\n// https://tc39.github.io/ecma262/#sec-array.isarray\n$({ target: 'Array', stat: true }, {\n isArray: isArray\n});\n","require('../../modules/es.array.is-array');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Array.isArray;\n","var parent = require('../../es/array/is-array');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/array/is-array\");","var _Array$isArray = require(\"@babel/runtime-corejs3/core-js/array/is-array\");\n\nfunction _arrayWithHoles(arr) {\n if (_Array$isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","var classof = require('../internals/classof');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n var O = Object(it);\n return O[ITERATOR] !== undefined\n || '@@iterator' in O\n // eslint-disable-next-line no-prototype-builtins\n || Iterators.hasOwnProperty(classof(O));\n};\n","require('../modules/web.dom-collections.iterator');\nrequire('../modules/es.string.iterator');\nvar isIterable = require('../internals/is-iterable');\n\nmodule.exports = isIterable;\n","module.exports = require(\"core-js-pure/features/is-iterable\");","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar createProperty = require('../internals/create-property');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;\nvar MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';\n\n// We can't use this feature detection in V8 since it causes\n// deoptimization and serious performance degradation\n// https://github.com/zloirock/core-js/issues/679\nvar IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;\n\n// `Array.prototype.concat` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, forced: FORCED }, {\n concat: function concat(arg) { // eslint-disable-line no-unused-vars\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = toLength(E.length);\n if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.asyncIterator` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.asynciterator\ndefineWellKnownSymbol('asyncIterator');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.hasInstance` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.hasinstance\ndefineWellKnownSymbol('hasInstance');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.isConcatSpreadable` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.isconcatspreadable\ndefineWellKnownSymbol('isConcatSpreadable');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.iterator` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.iterator\ndefineWellKnownSymbol('iterator');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.match` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.match\ndefineWellKnownSymbol('match');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.matchAll` well-known symbol\ndefineWellKnownSymbol('matchAll');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.replace` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.replace\ndefineWellKnownSymbol('replace');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.search` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.search\ndefineWellKnownSymbol('search');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.species` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.species\ndefineWellKnownSymbol('species');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.split` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.split\ndefineWellKnownSymbol('split');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.toPrimitive` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.toprimitive\ndefineWellKnownSymbol('toPrimitive');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.toStringTag` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.tostringtag\ndefineWellKnownSymbol('toStringTag');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.unscopables` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.unscopables\ndefineWellKnownSymbol('unscopables');\n","var global = require('../internals/global');\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// JSON[@@toStringTag] property\n// https://tc39.github.io/ecma262/#sec-json-@@tostringtag\nsetToStringTag(global.JSON, 'JSON', true);\n","require('../../modules/es.array.concat');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.symbol');\nrequire('../../modules/es.symbol.async-iterator');\nrequire('../../modules/es.symbol.description');\nrequire('../../modules/es.symbol.has-instance');\nrequire('../../modules/es.symbol.is-concat-spreadable');\nrequire('../../modules/es.symbol.iterator');\nrequire('../../modules/es.symbol.match');\nrequire('../../modules/es.symbol.match-all');\nrequire('../../modules/es.symbol.replace');\nrequire('../../modules/es.symbol.search');\nrequire('../../modules/es.symbol.species');\nrequire('../../modules/es.symbol.split');\nrequire('../../modules/es.symbol.to-primitive');\nrequire('../../modules/es.symbol.to-string-tag');\nrequire('../../modules/es.symbol.unscopables');\nrequire('../../modules/es.json.to-string-tag');\nrequire('../../modules/es.math.to-string-tag');\nrequire('../../modules/es.reflect.to-string-tag');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Symbol;\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.asyncDispose` well-known symbol\n// https://github.com/tc39/proposal-using-statement\ndefineWellKnownSymbol('asyncDispose');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.dispose` well-known symbol\n// https://github.com/tc39/proposal-using-statement\ndefineWellKnownSymbol('dispose');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.observable` well-known symbol\n// https://github.com/tc39/proposal-observable\ndefineWellKnownSymbol('observable');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.patternMatch` well-known symbol\n// https://github.com/tc39/proposal-pattern-matching\ndefineWellKnownSymbol('patternMatch');\n","// TODO: remove from `core-js@4`\nvar defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\ndefineWellKnownSymbol('replaceAll');\n","var parent = require('../../es/symbol');\nrequire('../../modules/esnext.symbol.async-dispose');\nrequire('../../modules/esnext.symbol.dispose');\nrequire('../../modules/esnext.symbol.observable');\nrequire('../../modules/esnext.symbol.pattern-match');\n// TODO: Remove from `core-js@4`\nrequire('../../modules/esnext.symbol.replace-all');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/symbol\");","var _getIterator = require(\"@babel/runtime-corejs3/core-js/get-iterator\");\n\nvar _isIterable = require(\"@babel/runtime-corejs3/core-js/is-iterable\");\n\nvar _Symbol = require(\"@babel/runtime-corejs3/core-js/symbol\");\n\nfunction _iterableToArrayLimit(arr, i) {\n if (typeof _Symbol === \"undefined\" || !_isIterable(Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = _getIterator(arr), _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}\n\nmodule.exports = _iterableToArrayLimit;","var parent = require('../../es/array/from');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/array/from\");","'use strict';\nvar $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar createProperty = require('../internals/create-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });\n\nvar SPECIES = wellKnownSymbol('species');\nvar nativeSlice = [].slice;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === Array || Constructor === undefined) {\n return nativeSlice.call(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n","require('../../../modules/es.array.slice');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').slice;\n","var slice = require('../array/virtual/slice');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.slice;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.slice) ? slice : own;\n};\n","var parent = require('../../es/instance/slice');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/instance/slice\");","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","var _Array$from = require(\"@babel/runtime-corejs3/core-js/array/from\");\n\nvar _sliceInstanceProperty = require(\"@babel/runtime-corejs3/core-js/instance/slice\");\n\nvar arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n var _context;\n\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n\n var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);\n\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return _Array$from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","var $ = require('../internals/export');\n\n// `Date.now` method\n// https://tc39.github.io/ecma262/#sec-date.now\n$({ target: 'Date', stat: true }, {\n now: function now() {\n return new Date().getTime();\n }\n});\n","require('../../modules/es.date.now');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Date.now;\n","var $ = require('../internals/export');\nvar toObject = require('../internals/to-object');\nvar nativeKeys = require('../internals/object-keys');\nvar fails = require('../internals/fails');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });\n\n// `Object.keys` method\n// https://tc39.github.io/ecma262/#sec-object.keys\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n keys: function keys(it) {\n return nativeKeys(toObject(it));\n }\n});\n","require('../../modules/es.object.keys');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.keys;\n","var parent = require('../../es/object/keys');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/object/keys\");","var parent = require('../../es/array/is-array');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/array/is-array\");","require('../../modules/es.symbol.iterator');\nrequire('../../modules/es.string.iterator');\nrequire('../../modules/web.dom-collections.iterator');\nvar WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');\n\nmodule.exports = WrappedWellKnownSymbolModule.f('iterator');\n","var parent = require('../../es/symbol/iterator');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/symbol/iterator\");","var _Symbol$iterator = require(\"@babel/runtime-corejs3/core-js/symbol/iterator\");\n\nvar _Symbol = require(\"@babel/runtime-corejs3/core-js/symbol\");\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof _Symbol === \"function\" && typeof _Symbol$iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof _Symbol === \"function\" && obj.constructor === _Symbol && obj !== _Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","var $ = require('../internals/export');\nvar ownKeys = require('../internals/own-keys');\n\n// `Reflect.ownKeys` method\n// https://tc39.github.io/ecma262/#sec-reflect.ownkeys\n$({ target: 'Reflect', stat: true }, {\n ownKeys: ownKeys\n});\n","require('../../modules/es.reflect.own-keys');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Reflect.ownKeys;\n","var parent = require('../../es/reflect/own-keys');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/reflect/own-keys\");","var parent = require('../../es/instance/slice');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/slice\");","var _Array$isArray = require(\"@babel/runtime-corejs3/core-js/array/is-array\");\n\nvar arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _arrayWithoutHoles(arr) {\n if (_Array$isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;","var _Array$from = require(\"@babel/runtime-corejs3/core-js/array/from\");\n\nvar _isIterable = require(\"@babel/runtime-corejs3/core-js/is-iterable\");\n\nvar _Symbol = require(\"@babel/runtime-corejs3/core-js/symbol\");\n\nfunction _iterableToArray(iter) {\n if (typeof _Symbol !== \"undefined\" && _isIterable(Object(iter))) return _Array$from(iter);\n}\n\nmodule.exports = _iterableToArray;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","require('../../../modules/es.array.concat');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').concat;\n","var concat = require('../array/virtual/concat');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.concat;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.concat) ? concat : own;\n};\n","var parent = require('../../es/instance/concat');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/concat\");","var parent = require('../../es/symbol');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/symbol\");","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n // Remove event specific arrays for event types that no\r\n // one is subscribed for to avoid memory leak.\r\n if (callbacks.length === 0) {\r\n delete this._callbacks['$' + event];\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n\r\n var args = new Array(arguments.length - 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n for (var i = 1; i < arguments.length; i++) {\r\n args[i - 1] = arguments[i];\r\n }\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n","/*! Hammer.JS - v2.0.17-rc - 2019-12-16\n * http://naver.github.io/egjs\n *\n * Forked By Naver egjs\n * Copyright (c) hammerjs\n * Licensed under the MIT license */\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _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}\n\n/**\n * @private\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} target\n * @param {...Object} objects_to_assign\n * @returns {Object} target\n */\nvar assign;\n\nif (typeof Object.assign !== 'function') {\n assign = function assign(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var output = Object(target);\n\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n\n if (source !== undefined && source !== null) {\n for (var nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n\n return output;\n };\n} else {\n assign = Object.assign;\n}\n\nvar assign$1 = assign;\n\nvar VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\nvar TEST_ELEMENT = typeof document === \"undefined\" ? {\n style: {}\n} : document.createElement('div');\nvar TYPE_FUNCTION = 'function';\nvar round = Math.round,\n abs = Math.abs;\nvar now = Date.now;\n\n/**\n * @private\n * get the prefixed property\n * @param {Object} obj\n * @param {String} property\n * @returns {String|Undefined} prefixed\n */\n\nfunction prefixed(obj, property) {\n var prefix;\n var prop;\n var camelProp = property[0].toUpperCase() + property.slice(1);\n var i = 0;\n\n while (i < VENDOR_PREFIXES.length) {\n prefix = VENDOR_PREFIXES[i];\n prop = prefix ? prefix + camelProp : property;\n\n if (prop in obj) {\n return prop;\n }\n\n i++;\n }\n\n return undefined;\n}\n\n/* eslint-disable no-new-func, no-nested-ternary */\nvar win;\n\nif (typeof window === \"undefined\") {\n // window is undefined in node.js\n win = {};\n} else {\n win = window;\n}\n\nvar PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');\nvar NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;\nfunction getTouchActionProps() {\n if (!NATIVE_TOUCH_ACTION) {\n return false;\n }\n\n var touchMap = {};\n var cssSupports = win.CSS && win.CSS.supports;\n ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function (val) {\n // If css.supports is not supported but there is native touch-action assume it supports\n // all values. This is the case for IE 10 and 11.\n return touchMap[val] = cssSupports ? win.CSS.supports('touch-action', val) : true;\n });\n return touchMap;\n}\n\nvar TOUCH_ACTION_COMPUTE = 'compute';\nvar TOUCH_ACTION_AUTO = 'auto';\nvar TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\n\nvar TOUCH_ACTION_NONE = 'none';\nvar TOUCH_ACTION_PAN_X = 'pan-x';\nvar TOUCH_ACTION_PAN_Y = 'pan-y';\nvar TOUCH_ACTION_MAP = getTouchActionProps();\n\nvar MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\nvar SUPPORT_TOUCH = 'ontouchstart' in win;\nvar SUPPORT_POINTER_EVENTS = prefixed(win, 'PointerEvent') !== undefined;\nvar SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\nvar INPUT_TYPE_TOUCH = 'touch';\nvar INPUT_TYPE_PEN = 'pen';\nvar INPUT_TYPE_MOUSE = 'mouse';\nvar INPUT_TYPE_KINECT = 'kinect';\nvar COMPUTE_INTERVAL = 25;\nvar INPUT_START = 1;\nvar INPUT_MOVE = 2;\nvar INPUT_END = 4;\nvar INPUT_CANCEL = 8;\nvar DIRECTION_NONE = 1;\nvar DIRECTION_LEFT = 2;\nvar DIRECTION_RIGHT = 4;\nvar DIRECTION_UP = 8;\nvar DIRECTION_DOWN = 16;\nvar DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;\nvar DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;\nvar DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;\nvar PROPS_XY = ['x', 'y'];\nvar PROPS_CLIENT_XY = ['clientX', 'clientY'];\n\n/**\n * @private\n * walk objects and arrays\n * @param {Object} obj\n * @param {Function} iterator\n * @param {Object} context\n */\nfunction each(obj, iterator, context) {\n var i;\n\n if (!obj) {\n return;\n }\n\n if (obj.forEach) {\n obj.forEach(iterator, context);\n } else if (obj.length !== undefined) {\n i = 0;\n\n while (i < obj.length) {\n iterator.call(context, obj[i], i, obj);\n i++;\n }\n } else {\n for (i in obj) {\n obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);\n }\n }\n}\n\n/**\n * @private\n * let a boolean value also be a function that must return a boolean\n * this first item in args will be used as the context\n * @param {Boolean|Function} val\n * @param {Array} [args]\n * @returns {Boolean}\n */\n\nfunction boolOrFn(val, args) {\n if (typeof val === TYPE_FUNCTION) {\n return val.apply(args ? args[0] || undefined : undefined, args);\n }\n\n return val;\n}\n\n/**\n * @private\n * small indexOf wrapper\n * @param {String} str\n * @param {String} find\n * @returns {Boolean} found\n */\nfunction inStr(str, find) {\n return str.indexOf(find) > -1;\n}\n\n/**\n * @private\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\n * @param {String} actions\n * @returns {*}\n */\n\nfunction cleanTouchActions(actions) {\n // none\n if (inStr(actions, TOUCH_ACTION_NONE)) {\n return TOUCH_ACTION_NONE;\n }\n\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); // if both pan-x and pan-y are set (different recognizers\n // for different directions, e.g. horizontal pan but vertical swipe?)\n // we need none (as otherwise with pan-x pan-y combined none of these\n // recognizers will work, since the browser would handle all panning\n\n if (hasPanX && hasPanY) {\n return TOUCH_ACTION_NONE;\n } // pan-x OR pan-y\n\n\n if (hasPanX || hasPanY) {\n return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\n } // manipulation\n\n\n if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {\n return TOUCH_ACTION_MANIPULATION;\n }\n\n return TOUCH_ACTION_AUTO;\n}\n\n/**\n * @private\n * Touch Action\n * sets the touchAction property or uses the js alternative\n * @param {Manager} manager\n * @param {String} value\n * @constructor\n */\n\nvar TouchAction =\n/*#__PURE__*/\nfunction () {\n function TouchAction(manager, value) {\n this.manager = manager;\n this.set(value);\n }\n /**\n * @private\n * set the touchAction value on the element or enable the polyfill\n * @param {String} value\n */\n\n\n var _proto = TouchAction.prototype;\n\n _proto.set = function set(value) {\n // find out the touch-action by the event handlers\n if (value === TOUCH_ACTION_COMPUTE) {\n value = this.compute();\n }\n\n if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {\n this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;\n }\n\n this.actions = value.toLowerCase().trim();\n };\n /**\n * @private\n * just re-set the touchAction value\n */\n\n\n _proto.update = function update() {\n this.set(this.manager.options.touchAction);\n };\n /**\n * @private\n * compute the value for the touchAction property based on the recognizer's settings\n * @returns {String} value\n */\n\n\n _proto.compute = function compute() {\n var actions = [];\n each(this.manager.recognizers, function (recognizer) {\n if (boolOrFn(recognizer.options.enable, [recognizer])) {\n actions = actions.concat(recognizer.getTouchAction());\n }\n });\n return cleanTouchActions(actions.join(' '));\n };\n /**\n * @private\n * this method is called on each input cycle and provides the preventing of the browser behavior\n * @param {Object} input\n */\n\n\n _proto.preventDefaults = function preventDefaults(input) {\n var srcEvent = input.srcEvent;\n var direction = input.offsetDirection; // if the touch action did prevented once this session\n\n if (this.manager.session.prevented) {\n srcEvent.preventDefault();\n return;\n }\n\n var actions = this.actions;\n var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];\n\n if (hasNone) {\n // do not prevent defaults if this is a tap gesture\n var isTapPointer = input.pointers.length === 1;\n var isTapMovement = input.distance < 2;\n var isTapTouchTime = input.deltaTime < 250;\n\n if (isTapPointer && isTapMovement && isTapTouchTime) {\n return;\n }\n }\n\n if (hasPanX && hasPanY) {\n // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent\n return;\n }\n\n if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL || hasPanX && direction & DIRECTION_VERTICAL) {\n return this.preventSrc(srcEvent);\n }\n };\n /**\n * @private\n * call preventDefault to prevent the browser's default behavior (scrolling in most cases)\n * @param {Object} srcEvent\n */\n\n\n _proto.preventSrc = function preventSrc(srcEvent) {\n this.manager.session.prevented = true;\n srcEvent.preventDefault();\n };\n\n return TouchAction;\n}();\n\n/**\n * @private\n * find if a node is in the given parent\n * @method hasParent\n * @param {HTMLElement} node\n * @param {HTMLElement} parent\n * @return {Boolean} found\n */\nfunction hasParent(node, parent) {\n while (node) {\n if (node === parent) {\n return true;\n }\n\n node = node.parentNode;\n }\n\n return false;\n}\n\n/**\n * @private\n * get the center of all the pointers\n * @param {Array} pointers\n * @return {Object} center contains `x` and `y` properties\n */\n\nfunction getCenter(pointers) {\n var pointersLength = pointers.length; // no need to loop when only one touch\n\n if (pointersLength === 1) {\n return {\n x: round(pointers[0].clientX),\n y: round(pointers[0].clientY)\n };\n }\n\n var x = 0;\n var y = 0;\n var i = 0;\n\n while (i < pointersLength) {\n x += pointers[i].clientX;\n y += pointers[i].clientY;\n i++;\n }\n\n return {\n x: round(x / pointersLength),\n y: round(y / pointersLength)\n };\n}\n\n/**\n * @private\n * create a simple clone from the input used for storage of firstInput and firstMultiple\n * @param {Object} input\n * @returns {Object} clonedInputData\n */\n\nfunction simpleCloneInputData(input) {\n // make a simple copy of the pointers because we will get a reference if we don't\n // we only need clientXY for the calculations\n var pointers = [];\n var i = 0;\n\n while (i < input.pointers.length) {\n pointers[i] = {\n clientX: round(input.pointers[i].clientX),\n clientY: round(input.pointers[i].clientY)\n };\n i++;\n }\n\n return {\n timeStamp: now(),\n pointers: pointers,\n center: getCenter(pointers),\n deltaX: input.deltaX,\n deltaY: input.deltaY\n };\n}\n\n/**\n * @private\n * calculate the absolute distance between two points\n * @param {Object} p1 {x, y}\n * @param {Object} p2 {x, y}\n * @param {Array} [props] containing x and y keys\n * @return {Number} distance\n */\n\nfunction getDistance(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n\n var x = p2[props[0]] - p1[props[0]];\n var y = p2[props[1]] - p1[props[1]];\n return Math.sqrt(x * x + y * y);\n}\n\n/**\n * @private\n * calculate the angle between two coordinates\n * @param {Object} p1\n * @param {Object} p2\n * @param {Array} [props] containing x and y keys\n * @return {Number} angle\n */\n\nfunction getAngle(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n\n var x = p2[props[0]] - p1[props[0]];\n var y = p2[props[1]] - p1[props[1]];\n return Math.atan2(y, x) * 180 / Math.PI;\n}\n\n/**\n * @private\n * get the direction between two points\n * @param {Number} x\n * @param {Number} y\n * @return {Number} direction\n */\n\nfunction getDirection(x, y) {\n if (x === y) {\n return DIRECTION_NONE;\n }\n\n if (abs(x) >= abs(y)) {\n return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n\n return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n}\n\nfunction computeDeltaXY(session, input) {\n var center = input.center; // let { offsetDelta:offset = {}, prevDelta = {}, prevInput = {} } = session;\n // jscs throwing error on defalut destructured values and without defaults tests fail\n\n var offset = session.offsetDelta || {};\n var prevDelta = session.prevDelta || {};\n var prevInput = session.prevInput || {};\n\n if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {\n prevDelta = session.prevDelta = {\n x: prevInput.deltaX || 0,\n y: prevInput.deltaY || 0\n };\n offset = session.offsetDelta = {\n x: center.x,\n y: center.y\n };\n }\n\n input.deltaX = prevDelta.x + (center.x - offset.x);\n input.deltaY = prevDelta.y + (center.y - offset.y);\n}\n\n/**\n * @private\n * calculate the velocity between two points. unit is in px per ms.\n * @param {Number} deltaTime\n * @param {Number} x\n * @param {Number} y\n * @return {Object} velocity `x` and `y`\n */\nfunction getVelocity(deltaTime, x, y) {\n return {\n x: x / deltaTime || 0,\n y: y / deltaTime || 0\n };\n}\n\n/**\n * @private\n * calculate the scale factor between two pointersets\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} scale\n */\n\nfunction getScale(start, end) {\n return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);\n}\n\n/**\n * @private\n * calculate the rotation degrees between two pointersets\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} rotation\n */\n\nfunction getRotation(start, end) {\n return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);\n}\n\n/**\n * @private\n * velocity is calculated every x ms\n * @param {Object} session\n * @param {Object} input\n */\n\nfunction computeIntervalInputData(session, input) {\n var last = session.lastInterval || input;\n var deltaTime = input.timeStamp - last.timeStamp;\n var velocity;\n var velocityX;\n var velocityY;\n var direction;\n\n if (input.eventType !== INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\n var deltaX = input.deltaX - last.deltaX;\n var deltaY = input.deltaY - last.deltaY;\n var v = getVelocity(deltaTime, deltaX, deltaY);\n velocityX = v.x;\n velocityY = v.y;\n velocity = abs(v.x) > abs(v.y) ? v.x : v.y;\n direction = getDirection(deltaX, deltaY);\n session.lastInterval = input;\n } else {\n // use latest velocity info if it doesn't overtake a minimum period\n velocity = last.velocity;\n velocityX = last.velocityX;\n velocityY = last.velocityY;\n direction = last.direction;\n }\n\n input.velocity = velocity;\n input.velocityX = velocityX;\n input.velocityY = velocityY;\n input.direction = direction;\n}\n\n/**\n* @private\n * extend the data with some usable properties like scale, rotate, velocity etc\n * @param {Object} manager\n * @param {Object} input\n */\n\nfunction computeInputData(manager, input) {\n var session = manager.session;\n var pointers = input.pointers;\n var pointersLength = pointers.length; // store the first input to calculate the distance and direction\n\n if (!session.firstInput) {\n session.firstInput = simpleCloneInputData(input);\n } // to compute scale and rotation we need to store the multiple touches\n\n\n if (pointersLength > 1 && !session.firstMultiple) {\n session.firstMultiple = simpleCloneInputData(input);\n } else if (pointersLength === 1) {\n session.firstMultiple = false;\n }\n\n var firstInput = session.firstInput,\n firstMultiple = session.firstMultiple;\n var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\n var center = input.center = getCenter(pointers);\n input.timeStamp = now();\n input.deltaTime = input.timeStamp - firstInput.timeStamp;\n input.angle = getAngle(offsetCenter, center);\n input.distance = getDistance(offsetCenter, center);\n computeDeltaXY(session, input);\n input.offsetDirection = getDirection(input.deltaX, input.deltaY);\n var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);\n input.overallVelocityX = overallVelocity.x;\n input.overallVelocityY = overallVelocity.y;\n input.overallVelocity = abs(overallVelocity.x) > abs(overallVelocity.y) ? overallVelocity.x : overallVelocity.y;\n input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\n input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\n input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers;\n computeIntervalInputData(session, input); // find the correct target\n\n var target = manager.element;\n var srcEvent = input.srcEvent;\n var srcEventTarget;\n\n if (srcEvent.composedPath) {\n srcEventTarget = srcEvent.composedPath()[0];\n } else if (srcEvent.path) {\n srcEventTarget = srcEvent.path[0];\n } else {\n srcEventTarget = srcEvent.target;\n }\n\n if (hasParent(srcEventTarget, target)) {\n target = srcEventTarget;\n }\n\n input.target = target;\n}\n\n/**\n * @private\n * handle input events\n * @param {Manager} manager\n * @param {String} eventType\n * @param {Object} input\n */\n\nfunction inputHandler(manager, eventType, input) {\n var pointersLen = input.pointers.length;\n var changedPointersLen = input.changedPointers.length;\n var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;\n var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;\n input.isFirst = !!isFirst;\n input.isFinal = !!isFinal;\n\n if (isFirst) {\n manager.session = {};\n } // source event is the normalized value of the domEvents\n // like 'touchstart, mouseup, pointerdown'\n\n\n input.eventType = eventType; // compute scale, rotation etc\n\n computeInputData(manager, input); // emit secret event\n\n manager.emit('hammer.input', input);\n manager.recognize(input);\n manager.session.prevInput = input;\n}\n\n/**\n * @private\n * split string on whitespace\n * @param {String} str\n * @returns {Array} words\n */\nfunction splitStr(str) {\n return str.trim().split(/\\s+/g);\n}\n\n/**\n * @private\n * addEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\n\nfunction addEventListeners(target, types, handler) {\n each(splitStr(types), function (type) {\n target.addEventListener(type, handler, false);\n });\n}\n\n/**\n * @private\n * removeEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\n\nfunction removeEventListeners(target, types, handler) {\n each(splitStr(types), function (type) {\n target.removeEventListener(type, handler, false);\n });\n}\n\n/**\n * @private\n * get the window object of an element\n * @param {HTMLElement} element\n * @returns {DocumentView|Window}\n */\nfunction getWindowForElement(element) {\n var doc = element.ownerDocument || element;\n return doc.defaultView || doc.parentWindow || window;\n}\n\n/**\n * @private\n * create new input type manager\n * @param {Manager} manager\n * @param {Function} callback\n * @returns {Input}\n * @constructor\n */\n\nvar Input =\n/*#__PURE__*/\nfunction () {\n function Input(manager, callback) {\n var self = this;\n this.manager = manager;\n this.callback = callback;\n this.element = manager.element;\n this.target = manager.options.inputTarget; // smaller wrapper around the handler, for the scope and the enabled state of the manager,\n // so when disabled the input events are completely bypassed.\n\n this.domHandler = function (ev) {\n if (boolOrFn(manager.options.enable, [manager])) {\n self.handler(ev);\n }\n };\n\n this.init();\n }\n /**\n * @private\n * should handle the inputEvent data and trigger the callback\n * @virtual\n */\n\n\n var _proto = Input.prototype;\n\n _proto.handler = function handler() {};\n /**\n * @private\n * bind the events\n */\n\n\n _proto.init = function init() {\n this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n };\n /**\n * @private\n * unbind the events\n */\n\n\n _proto.destroy = function destroy() {\n this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n };\n\n return Input;\n}();\n\n/**\n * @private\n * find if a array contains the object using indexOf or a simple polyFill\n * @param {Array} src\n * @param {String} find\n * @param {String} [findByKey]\n * @return {Boolean|Number} false when not found, or the index\n */\nfunction inArray(src, find, findByKey) {\n if (src.indexOf && !findByKey) {\n return src.indexOf(find);\n } else {\n var i = 0;\n\n while (i < src.length) {\n if (findByKey && src[i][findByKey] == find || !findByKey && src[i] === find) {\n // do not use === here, test fails\n return i;\n }\n\n i++;\n }\n\n return -1;\n }\n}\n\nvar POINTER_INPUT_MAP = {\n pointerdown: INPUT_START,\n pointermove: INPUT_MOVE,\n pointerup: INPUT_END,\n pointercancel: INPUT_CANCEL,\n pointerout: INPUT_CANCEL\n}; // in IE10 the pointer types is defined as an enum\n\nvar IE10_POINTER_TYPE_ENUM = {\n 2: INPUT_TYPE_TOUCH,\n 3: INPUT_TYPE_PEN,\n 4: INPUT_TYPE_MOUSE,\n 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816\n\n};\nvar POINTER_ELEMENT_EVENTS = 'pointerdown';\nvar POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; // IE10 has prefixed support, and case-sensitive\n\nif (win.MSPointerEvent && !win.PointerEvent) {\n POINTER_ELEMENT_EVENTS = 'MSPointerDown';\n POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';\n}\n/**\n * @private\n * Pointer events input\n * @constructor\n * @extends Input\n */\n\n\nvar PointerEventInput =\n/*#__PURE__*/\nfunction (_Input) {\n _inheritsLoose(PointerEventInput, _Input);\n\n function PointerEventInput() {\n var _this;\n\n var proto = PointerEventInput.prototype;\n proto.evEl = POINTER_ELEMENT_EVENTS;\n proto.evWin = POINTER_WINDOW_EVENTS;\n _this = _Input.apply(this, arguments) || this;\n _this.store = _this.manager.session.pointerEvents = [];\n return _this;\n }\n /**\n * @private\n * handle mouse events\n * @param {Object} ev\n */\n\n\n var _proto = PointerEventInput.prototype;\n\n _proto.handler = function handler(ev) {\n var store = this.store;\n var removePointer = false;\n var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');\n var eventType = POINTER_INPUT_MAP[eventTypeNormalized];\n var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;\n var isTouch = pointerType === INPUT_TYPE_TOUCH; // get index of the event in the store\n\n var storeIndex = inArray(store, ev.pointerId, 'pointerId'); // start and mouse must be down\n\n if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {\n if (storeIndex < 0) {\n store.push(ev);\n storeIndex = store.length - 1;\n }\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n removePointer = true;\n } // it not found, so the pointer hasn't been down (so it's probably a hover)\n\n\n if (storeIndex < 0) {\n return;\n } // update the event in the store\n\n\n store[storeIndex] = ev;\n this.callback(this.manager, eventType, {\n pointers: store,\n changedPointers: [ev],\n pointerType: pointerType,\n srcEvent: ev\n });\n\n if (removePointer) {\n // remove from the store\n store.splice(storeIndex, 1);\n }\n };\n\n return PointerEventInput;\n}(Input);\n\n/**\n * @private\n * convert array-like objects to real arrays\n * @param {Object} obj\n * @returns {Array}\n */\nfunction toArray(obj) {\n return Array.prototype.slice.call(obj, 0);\n}\n\n/**\n * @private\n * unique array with objects based on a key (like 'id') or just by the array's value\n * @param {Array} src [{id:1},{id:2},{id:1}]\n * @param {String} [key]\n * @param {Boolean} [sort=False]\n * @returns {Array} [{id:1},{id:2}]\n */\n\nfunction uniqueArray(src, key, sort) {\n var results = [];\n var values = [];\n var i = 0;\n\n while (i < src.length) {\n var val = key ? src[i][key] : src[i];\n\n if (inArray(values, val) < 0) {\n results.push(src[i]);\n }\n\n values[i] = val;\n i++;\n }\n\n if (sort) {\n if (!key) {\n results = results.sort();\n } else {\n results = results.sort(function (a, b) {\n return a[key] > b[key];\n });\n }\n }\n\n return results;\n}\n\nvar TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\nvar TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';\n/**\n * @private\n * Multi-user touch events input\n * @constructor\n * @extends Input\n */\n\nvar TouchInput =\n/*#__PURE__*/\nfunction (_Input) {\n _inheritsLoose(TouchInput, _Input);\n\n function TouchInput() {\n var _this;\n\n TouchInput.prototype.evTarget = TOUCH_TARGET_EVENTS;\n _this = _Input.apply(this, arguments) || this;\n _this.targetIds = {}; // this.evTarget = TOUCH_TARGET_EVENTS;\n\n return _this;\n }\n\n var _proto = TouchInput.prototype;\n\n _proto.handler = function handler(ev) {\n var type = TOUCH_INPUT_MAP[ev.type];\n var touches = getTouches.call(this, ev, type);\n\n if (!touches) {\n return;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n };\n\n return TouchInput;\n}(Input);\n\nfunction getTouches(ev, type) {\n var allTouches = toArray(ev.touches);\n var targetIds = this.targetIds; // when there is only one touch, the process can be simplified\n\n if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {\n targetIds[allTouches[0].identifier] = true;\n return [allTouches, allTouches];\n }\n\n var i;\n var targetTouches;\n var changedTouches = toArray(ev.changedTouches);\n var changedTargetTouches = [];\n var target = this.target; // get target touches from touches\n\n targetTouches = allTouches.filter(function (touch) {\n return hasParent(touch.target, target);\n }); // collect touches\n\n if (type === INPUT_START) {\n i = 0;\n\n while (i < targetTouches.length) {\n targetIds[targetTouches[i].identifier] = true;\n i++;\n }\n } // filter changed touches to only contain touches that exist in the collected target ids\n\n\n i = 0;\n\n while (i < changedTouches.length) {\n if (targetIds[changedTouches[i].identifier]) {\n changedTargetTouches.push(changedTouches[i]);\n } // cleanup removed touches\n\n\n if (type & (INPUT_END | INPUT_CANCEL)) {\n delete targetIds[changedTouches[i].identifier];\n }\n\n i++;\n }\n\n if (!changedTargetTouches.length) {\n return;\n }\n\n return [// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'\n uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), changedTargetTouches];\n}\n\nvar MOUSE_INPUT_MAP = {\n mousedown: INPUT_START,\n mousemove: INPUT_MOVE,\n mouseup: INPUT_END\n};\nvar MOUSE_ELEMENT_EVENTS = 'mousedown';\nvar MOUSE_WINDOW_EVENTS = 'mousemove mouseup';\n/**\n * @private\n * Mouse events input\n * @constructor\n * @extends Input\n */\n\nvar MouseInput =\n/*#__PURE__*/\nfunction (_Input) {\n _inheritsLoose(MouseInput, _Input);\n\n function MouseInput() {\n var _this;\n\n var proto = MouseInput.prototype;\n proto.evEl = MOUSE_ELEMENT_EVENTS;\n proto.evWin = MOUSE_WINDOW_EVENTS;\n _this = _Input.apply(this, arguments) || this;\n _this.pressed = false; // mousedown state\n\n return _this;\n }\n /**\n * @private\n * handle mouse events\n * @param {Object} ev\n */\n\n\n var _proto = MouseInput.prototype;\n\n _proto.handler = function handler(ev) {\n var eventType = MOUSE_INPUT_MAP[ev.type]; // on start we want to have the left mouse button down\n\n if (eventType & INPUT_START && ev.button === 0) {\n this.pressed = true;\n }\n\n if (eventType & INPUT_MOVE && ev.which !== 1) {\n eventType = INPUT_END;\n } // mouse must be down\n\n\n if (!this.pressed) {\n return;\n }\n\n if (eventType & INPUT_END) {\n this.pressed = false;\n }\n\n this.callback(this.manager, eventType, {\n pointers: [ev],\n changedPointers: [ev],\n pointerType: INPUT_TYPE_MOUSE,\n srcEvent: ev\n });\n };\n\n return MouseInput;\n}(Input);\n\n/**\n * @private\n * Combined touch and mouse input\n *\n * Touch has a higher priority then mouse, and while touching no mouse events are allowed.\n * This because touch devices also emit mouse events while doing a touch.\n *\n * @constructor\n * @extends Input\n */\n\nvar DEDUP_TIMEOUT = 2500;\nvar DEDUP_DISTANCE = 25;\n\nfunction setLastTouch(eventData) {\n var _eventData$changedPoi = eventData.changedPointers,\n touch = _eventData$changedPoi[0];\n\n if (touch.identifier === this.primaryTouch) {\n var lastTouch = {\n x: touch.clientX,\n y: touch.clientY\n };\n var lts = this.lastTouches;\n this.lastTouches.push(lastTouch);\n\n var removeLastTouch = function removeLastTouch() {\n var i = lts.indexOf(lastTouch);\n\n if (i > -1) {\n lts.splice(i, 1);\n }\n };\n\n setTimeout(removeLastTouch, DEDUP_TIMEOUT);\n }\n}\n\nfunction recordTouches(eventType, eventData) {\n if (eventType & INPUT_START) {\n this.primaryTouch = eventData.changedPointers[0].identifier;\n setLastTouch.call(this, eventData);\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n setLastTouch.call(this, eventData);\n }\n}\n\nfunction isSyntheticEvent(eventData) {\n var x = eventData.srcEvent.clientX;\n var y = eventData.srcEvent.clientY;\n\n for (var i = 0; i < this.lastTouches.length; i++) {\n var t = this.lastTouches[i];\n var dx = Math.abs(x - t.x);\n var dy = Math.abs(y - t.y);\n\n if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {\n return true;\n }\n }\n\n return false;\n}\n\nvar TouchMouseInput =\n/*#__PURE__*/\nfunction () {\n var TouchMouseInput =\n /*#__PURE__*/\n function (_Input) {\n _inheritsLoose(TouchMouseInput, _Input);\n\n function TouchMouseInput(_manager, callback) {\n var _this;\n\n _this = _Input.call(this, _manager, callback) || this;\n\n _this.handler = function (manager, inputEvent, inputData) {\n var isTouch = inputData.pointerType === INPUT_TYPE_TOUCH;\n var isMouse = inputData.pointerType === INPUT_TYPE_MOUSE;\n\n if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {\n return;\n } // when we're in a touch event, record touches to de-dupe synthetic mouse event\n\n\n if (isTouch) {\n recordTouches.call(_assertThisInitialized(_assertThisInitialized(_this)), inputEvent, inputData);\n } else if (isMouse && isSyntheticEvent.call(_assertThisInitialized(_assertThisInitialized(_this)), inputData)) {\n return;\n }\n\n _this.callback(manager, inputEvent, inputData);\n };\n\n _this.touch = new TouchInput(_this.manager, _this.handler);\n _this.mouse = new MouseInput(_this.manager, _this.handler);\n _this.primaryTouch = null;\n _this.lastTouches = [];\n return _this;\n }\n /**\n * @private\n * handle mouse and touch events\n * @param {Hammer} manager\n * @param {String} inputEvent\n * @param {Object} inputData\n */\n\n\n var _proto = TouchMouseInput.prototype;\n\n /**\n * @private\n * remove the event listeners\n */\n _proto.destroy = function destroy() {\n this.touch.destroy();\n this.mouse.destroy();\n };\n\n return TouchMouseInput;\n }(Input);\n\n return TouchMouseInput;\n}();\n\n/**\n * @private\n * create new input type manager\n * called by the Manager constructor\n * @param {Hammer} manager\n * @returns {Input}\n */\n\nfunction createInputInstance(manager) {\n var Type; // let inputClass = manager.options.inputClass;\n\n var inputClass = manager.options.inputClass;\n\n if (inputClass) {\n Type = inputClass;\n } else if (SUPPORT_POINTER_EVENTS) {\n Type = PointerEventInput;\n } else if (SUPPORT_ONLY_TOUCH) {\n Type = TouchInput;\n } else if (!SUPPORT_TOUCH) {\n Type = MouseInput;\n } else {\n Type = TouchMouseInput;\n }\n\n return new Type(manager, inputHandler);\n}\n\n/**\n * @private\n * if the argument is an array, we want to execute the fn on each entry\n * if it aint an array we don't want to do a thing.\n * this is used by all the methods that accept a single and array argument.\n * @param {*|Array} arg\n * @param {String} fn\n * @param {Object} [context]\n * @returns {Boolean}\n */\n\nfunction invokeArrayArg(arg, fn, context) {\n if (Array.isArray(arg)) {\n each(arg, context[fn], context);\n return true;\n }\n\n return false;\n}\n\nvar STATE_POSSIBLE = 1;\nvar STATE_BEGAN = 2;\nvar STATE_CHANGED = 4;\nvar STATE_ENDED = 8;\nvar STATE_RECOGNIZED = STATE_ENDED;\nvar STATE_CANCELLED = 16;\nvar STATE_FAILED = 32;\n\n/**\n * @private\n * get a unique id\n * @returns {number} uniqueId\n */\nvar _uniqueId = 1;\nfunction uniqueId() {\n return _uniqueId++;\n}\n\n/**\n * @private\n * get a recognizer by name if it is bound to a manager\n * @param {Recognizer|String} otherRecognizer\n * @param {Recognizer} recognizer\n * @returns {Recognizer}\n */\nfunction getRecognizerByNameIfManager(otherRecognizer, recognizer) {\n var manager = recognizer.manager;\n\n if (manager) {\n return manager.get(otherRecognizer);\n }\n\n return otherRecognizer;\n}\n\n/**\n * @private\n * get a usable string, used as event postfix\n * @param {constant} state\n * @returns {String} state\n */\n\nfunction stateStr(state) {\n if (state & STATE_CANCELLED) {\n return 'cancel';\n } else if (state & STATE_ENDED) {\n return 'end';\n } else if (state & STATE_CHANGED) {\n return 'move';\n } else if (state & STATE_BEGAN) {\n return 'start';\n }\n\n return '';\n}\n\n/**\n * @private\n * Recognizer flow explained; *\n * All recognizers have the initial state of POSSIBLE when a input session starts.\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\n *\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\n * which determines with state it should be.\n *\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\n * POSSIBLE to give it another change on the next cycle.\n *\n * Possible\n * |\n * +-----+---------------+\n * | |\n * +-----+-----+ |\n * | | |\n * Failed Cancelled |\n * +-------+------+\n * | |\n * Recognized Began\n * |\n * Changed\n * |\n * Ended/Recognized\n */\n\n/**\n * @private\n * Recognizer\n * Every recognizer needs to extend from this class.\n * @constructor\n * @param {Object} options\n */\n\nvar Recognizer =\n/*#__PURE__*/\nfunction () {\n function Recognizer(options) {\n if (options === void 0) {\n options = {};\n }\n\n this.options = _extends({\n enable: true\n }, options);\n this.id = uniqueId();\n this.manager = null; // default is enable true\n\n this.state = STATE_POSSIBLE;\n this.simultaneous = {};\n this.requireFail = [];\n }\n /**\n * @private\n * set options\n * @param {Object} options\n * @return {Recognizer}\n */\n\n\n var _proto = Recognizer.prototype;\n\n _proto.set = function set(options) {\n assign$1(this.options, options); // also update the touchAction, in case something changed about the directions/enabled state\n\n this.manager && this.manager.touchAction.update();\n return this;\n };\n /**\n * @private\n * recognize simultaneous with an other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n\n\n _proto.recognizeWith = function recognizeWith(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {\n return this;\n }\n\n var simultaneous = this.simultaneous;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n\n if (!simultaneous[otherRecognizer.id]) {\n simultaneous[otherRecognizer.id] = otherRecognizer;\n otherRecognizer.recognizeWith(this);\n }\n\n return this;\n };\n /**\n * @private\n * drop the simultaneous link. it doesnt remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n\n\n _proto.dropRecognizeWith = function dropRecognizeWith(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n delete this.simultaneous[otherRecognizer.id];\n return this;\n };\n /**\n * @private\n * recognizer can only run when an other is failing\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n\n\n _proto.requireFailure = function requireFailure(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {\n return this;\n }\n\n var requireFail = this.requireFail;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n\n if (inArray(requireFail, otherRecognizer) === -1) {\n requireFail.push(otherRecognizer);\n otherRecognizer.requireFailure(this);\n }\n\n return this;\n };\n /**\n * @private\n * drop the requireFailure link. it does not remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n\n\n _proto.dropRequireFailure = function dropRequireFailure(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n var index = inArray(this.requireFail, otherRecognizer);\n\n if (index > -1) {\n this.requireFail.splice(index, 1);\n }\n\n return this;\n };\n /**\n * @private\n * has require failures boolean\n * @returns {boolean}\n */\n\n\n _proto.hasRequireFailures = function hasRequireFailures() {\n return this.requireFail.length > 0;\n };\n /**\n * @private\n * if the recognizer can recognize simultaneous with an other recognizer\n * @param {Recognizer} otherRecognizer\n * @returns {Boolean}\n */\n\n\n _proto.canRecognizeWith = function canRecognizeWith(otherRecognizer) {\n return !!this.simultaneous[otherRecognizer.id];\n };\n /**\n * @private\n * You should use `tryEmit` instead of `emit` directly to check\n * that all the needed recognizers has failed before emitting.\n * @param {Object} input\n */\n\n\n _proto.emit = function emit(input) {\n var self = this;\n var state = this.state;\n\n function emit(event) {\n self.manager.emit(event, input);\n } // 'panstart' and 'panmove'\n\n\n if (state < STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n\n emit(self.options.event); // simple 'eventName' events\n\n if (input.additionalEvent) {\n // additional event(panleft, panright, pinchin, pinchout...)\n emit(input.additionalEvent);\n } // panend and pancancel\n\n\n if (state >= STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n };\n /**\n * @private\n * Check that all the require failure recognizers has failed,\n * if true, it emits a gesture event,\n * otherwise, setup the state to FAILED.\n * @param {Object} input\n */\n\n\n _proto.tryEmit = function tryEmit(input) {\n if (this.canEmit()) {\n return this.emit(input);\n } // it's failing anyway\n\n\n this.state = STATE_FAILED;\n };\n /**\n * @private\n * can we emit?\n * @returns {boolean}\n */\n\n\n _proto.canEmit = function canEmit() {\n var i = 0;\n\n while (i < this.requireFail.length) {\n if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {\n return false;\n }\n\n i++;\n }\n\n return true;\n };\n /**\n * @private\n * update the recognizer\n * @param {Object} inputData\n */\n\n\n _proto.recognize = function recognize(inputData) {\n // make a new copy of the inputData\n // so we can change the inputData without messing up the other recognizers\n var inputDataClone = assign$1({}, inputData); // is is enabled and allow recognizing?\n\n if (!boolOrFn(this.options.enable, [this, inputDataClone])) {\n this.reset();\n this.state = STATE_FAILED;\n return;\n } // reset when we've reached the end\n\n\n if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {\n this.state = STATE_POSSIBLE;\n }\n\n this.state = this.process(inputDataClone); // the recognizer has recognized a gesture\n // so trigger an event\n\n if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {\n this.tryEmit(inputDataClone);\n }\n };\n /**\n * @private\n * return the state of the recognizer\n * the actual recognizing happens in this method\n * @virtual\n * @param {Object} inputData\n * @returns {constant} STATE\n */\n\n /* jshint ignore:start */\n\n\n _proto.process = function process(inputData) {};\n /* jshint ignore:end */\n\n /**\n * @private\n * return the preferred touch-action\n * @virtual\n * @returns {Array}\n */\n\n\n _proto.getTouchAction = function getTouchAction() {};\n /**\n * @private\n * called when the gesture isn't allowed to recognize\n * like when another is being recognized or it is disabled\n * @virtual\n */\n\n\n _proto.reset = function reset() {};\n\n return Recognizer;\n}();\n\n/**\n * @private\n * A tap is recognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\n * a single tap.\n *\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\n * multi-taps being recognized.\n * @constructor\n * @extends Recognizer\n */\n\nvar TapRecognizer =\n/*#__PURE__*/\nfunction (_Recognizer) {\n _inheritsLoose(TapRecognizer, _Recognizer);\n\n function TapRecognizer(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _Recognizer.call(this, _extends({\n event: 'tap',\n pointers: 1,\n taps: 1,\n interval: 300,\n // max time between the multi-tap taps\n time: 250,\n // max time of the pointer to be down (like finger on the screen)\n threshold: 9,\n // a minimal movement is ok, but keep it low\n posThreshold: 10\n }, options)) || this; // previous time and center,\n // used for tap counting\n\n _this.pTime = false;\n _this.pCenter = false;\n _this._timer = null;\n _this._input = null;\n _this.count = 0;\n return _this;\n }\n\n var _proto = TapRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n return [TOUCH_ACTION_MANIPULATION];\n };\n\n _proto.process = function process(input) {\n var _this2 = this;\n\n var options = this.options;\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTouchTime = input.deltaTime < options.time;\n this.reset();\n\n if (input.eventType & INPUT_START && this.count === 0) {\n return this.failTimeout();\n } // we only allow little movement\n // and we've reached an end event, so a tap is possible\n\n\n if (validMovement && validTouchTime && validPointers) {\n if (input.eventType !== INPUT_END) {\n return this.failTimeout();\n }\n\n var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;\n var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;\n this.pTime = input.timeStamp;\n this.pCenter = input.center;\n\n if (!validMultiTap || !validInterval) {\n this.count = 1;\n } else {\n this.count += 1;\n }\n\n this._input = input; // if tap count matches we have recognized it,\n // else it has began recognizing...\n\n var tapCount = this.count % options.taps;\n\n if (tapCount === 0) {\n // no failing requirements, immediately trigger the tap event\n // or wait as long as the multitap interval to trigger\n if (!this.hasRequireFailures()) {\n return STATE_RECOGNIZED;\n } else {\n this._timer = setTimeout(function () {\n _this2.state = STATE_RECOGNIZED;\n\n _this2.tryEmit();\n }, options.interval);\n return STATE_BEGAN;\n }\n }\n }\n\n return STATE_FAILED;\n };\n\n _proto.failTimeout = function failTimeout() {\n var _this3 = this;\n\n this._timer = setTimeout(function () {\n _this3.state = STATE_FAILED;\n }, this.options.interval);\n return STATE_FAILED;\n };\n\n _proto.reset = function reset() {\n clearTimeout(this._timer);\n };\n\n _proto.emit = function emit() {\n if (this.state === STATE_RECOGNIZED) {\n this._input.tapCount = this.count;\n this.manager.emit(this.options.event, this._input);\n }\n };\n\n return TapRecognizer;\n}(Recognizer);\n\n/**\n * @private\n * This recognizer is just used as a base for the simple attribute recognizers.\n * @constructor\n * @extends Recognizer\n */\n\nvar AttrRecognizer =\n/*#__PURE__*/\nfunction (_Recognizer) {\n _inheritsLoose(AttrRecognizer, _Recognizer);\n\n function AttrRecognizer(options) {\n if (options === void 0) {\n options = {};\n }\n\n return _Recognizer.call(this, _extends({\n pointers: 1\n }, options)) || this;\n }\n /**\n * @private\n * Used to check if it the recognizer receives valid input, like input.distance > 10.\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {Boolean} recognized\n */\n\n\n var _proto = AttrRecognizer.prototype;\n\n _proto.attrTest = function attrTest(input) {\n var optionPointers = this.options.pointers;\n return optionPointers === 0 || input.pointers.length === optionPointers;\n };\n /**\n * @private\n * Process the input and return the state for the recognizer\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {*} State\n */\n\n\n _proto.process = function process(input) {\n var state = this.state;\n var eventType = input.eventType;\n var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);\n var isValid = this.attrTest(input); // on cancel input and we've recognized before, return STATE_CANCELLED\n\n if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {\n return state | STATE_CANCELLED;\n } else if (isRecognized || isValid) {\n if (eventType & INPUT_END) {\n return state | STATE_ENDED;\n } else if (!(state & STATE_BEGAN)) {\n return STATE_BEGAN;\n }\n\n return state | STATE_CHANGED;\n }\n\n return STATE_FAILED;\n };\n\n return AttrRecognizer;\n}(Recognizer);\n\n/**\n * @private\n * direction cons to string\n * @param {constant} direction\n * @returns {String}\n */\n\nfunction directionStr(direction) {\n if (direction === DIRECTION_DOWN) {\n return 'down';\n } else if (direction === DIRECTION_UP) {\n return 'up';\n } else if (direction === DIRECTION_LEFT) {\n return 'left';\n } else if (direction === DIRECTION_RIGHT) {\n return 'right';\n }\n\n return '';\n}\n\n/**\n * @private\n * Pan\n * Recognized when the pointer is down and moved in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\n\nvar PanRecognizer =\n/*#__PURE__*/\nfunction (_AttrRecognizer) {\n _inheritsLoose(PanRecognizer, _AttrRecognizer);\n\n function PanRecognizer(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _AttrRecognizer.call(this, _extends({\n event: 'pan',\n threshold: 10,\n pointers: 1,\n direction: DIRECTION_ALL\n }, options)) || this;\n _this.pX = null;\n _this.pY = null;\n return _this;\n }\n\n var _proto = PanRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n var direction = this.options.direction;\n var actions = [];\n\n if (direction & DIRECTION_HORIZONTAL) {\n actions.push(TOUCH_ACTION_PAN_Y);\n }\n\n if (direction & DIRECTION_VERTICAL) {\n actions.push(TOUCH_ACTION_PAN_X);\n }\n\n return actions;\n };\n\n _proto.directionTest = function directionTest(input) {\n var options = this.options;\n var hasMoved = true;\n var distance = input.distance;\n var direction = input.direction;\n var x = input.deltaX;\n var y = input.deltaY; // lock to axis?\n\n if (!(direction & options.direction)) {\n if (options.direction & DIRECTION_HORIZONTAL) {\n direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n hasMoved = x !== this.pX;\n distance = Math.abs(input.deltaX);\n } else {\n direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n hasMoved = y !== this.pY;\n distance = Math.abs(input.deltaY);\n }\n }\n\n input.direction = direction;\n return hasMoved && distance > options.threshold && direction & options.direction;\n };\n\n _proto.attrTest = function attrTest(input) {\n return AttrRecognizer.prototype.attrTest.call(this, input) && ( // replace with a super call\n this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input));\n };\n\n _proto.emit = function emit(input) {\n this.pX = input.deltaX;\n this.pY = input.deltaY;\n var direction = directionStr(input.direction);\n\n if (direction) {\n input.additionalEvent = this.options.event + direction;\n }\n\n _AttrRecognizer.prototype.emit.call(this, input);\n };\n\n return PanRecognizer;\n}(AttrRecognizer);\n\n/**\n * @private\n * Swipe\n * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\n\nvar SwipeRecognizer =\n/*#__PURE__*/\nfunction (_AttrRecognizer) {\n _inheritsLoose(SwipeRecognizer, _AttrRecognizer);\n\n function SwipeRecognizer(options) {\n if (options === void 0) {\n options = {};\n }\n\n return _AttrRecognizer.call(this, _extends({\n event: 'swipe',\n threshold: 10,\n velocity: 0.3,\n direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,\n pointers: 1\n }, options)) || this;\n }\n\n var _proto = SwipeRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n return PanRecognizer.prototype.getTouchAction.call(this);\n };\n\n _proto.attrTest = function attrTest(input) {\n var direction = this.options.direction;\n var velocity;\n\n if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {\n velocity = input.overallVelocity;\n } else if (direction & DIRECTION_HORIZONTAL) {\n velocity = input.overallVelocityX;\n } else if (direction & DIRECTION_VERTICAL) {\n velocity = input.overallVelocityY;\n }\n\n return _AttrRecognizer.prototype.attrTest.call(this, input) && direction & input.offsetDirection && input.distance > this.options.threshold && input.maxPointers === this.options.pointers && abs(velocity) > this.options.velocity && input.eventType & INPUT_END;\n };\n\n _proto.emit = function emit(input) {\n var direction = directionStr(input.offsetDirection);\n\n if (direction) {\n this.manager.emit(this.options.event + direction, input);\n }\n\n this.manager.emit(this.options.event, input);\n };\n\n return SwipeRecognizer;\n}(AttrRecognizer);\n\n/**\n * @private\n * Pinch\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * @constructor\n * @extends AttrRecognizer\n */\n\nvar PinchRecognizer =\n/*#__PURE__*/\nfunction (_AttrRecognizer) {\n _inheritsLoose(PinchRecognizer, _AttrRecognizer);\n\n function PinchRecognizer(options) {\n if (options === void 0) {\n options = {};\n }\n\n return _AttrRecognizer.call(this, _extends({\n event: 'pinch',\n threshold: 0,\n pointers: 2\n }, options)) || this;\n }\n\n var _proto = PinchRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n return [TOUCH_ACTION_NONE];\n };\n\n _proto.attrTest = function attrTest(input) {\n return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\n };\n\n _proto.emit = function emit(input) {\n if (input.scale !== 1) {\n var inOut = input.scale < 1 ? 'in' : 'out';\n input.additionalEvent = this.options.event + inOut;\n }\n\n _AttrRecognizer.prototype.emit.call(this, input);\n };\n\n return PinchRecognizer;\n}(AttrRecognizer);\n\n/**\n * @private\n * Rotate\n * Recognized when two or more pointer are moving in a circular motion.\n * @constructor\n * @extends AttrRecognizer\n */\n\nvar RotateRecognizer =\n/*#__PURE__*/\nfunction (_AttrRecognizer) {\n _inheritsLoose(RotateRecognizer, _AttrRecognizer);\n\n function RotateRecognizer(options) {\n if (options === void 0) {\n options = {};\n }\n\n return _AttrRecognizer.call(this, _extends({\n event: 'rotate',\n threshold: 0,\n pointers: 2\n }, options)) || this;\n }\n\n var _proto = RotateRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n return [TOUCH_ACTION_NONE];\n };\n\n _proto.attrTest = function attrTest(input) {\n return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);\n };\n\n return RotateRecognizer;\n}(AttrRecognizer);\n\n/**\n * @private\n * Press\n * Recognized when the pointer is down for x ms without any movement.\n * @constructor\n * @extends Recognizer\n */\n\nvar PressRecognizer =\n/*#__PURE__*/\nfunction (_Recognizer) {\n _inheritsLoose(PressRecognizer, _Recognizer);\n\n function PressRecognizer(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _Recognizer.call(this, _extends({\n event: 'press',\n pointers: 1,\n time: 251,\n // minimal time of the pointer to be pressed\n threshold: 9\n }, options)) || this;\n _this._timer = null;\n _this._input = null;\n return _this;\n }\n\n var _proto = PressRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n return [TOUCH_ACTION_AUTO];\n };\n\n _proto.process = function process(input) {\n var _this2 = this;\n\n var options = this.options;\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTime = input.deltaTime > options.time;\n this._input = input; // we only allow little movement\n // and we've reached an end event, so a tap is possible\n\n if (!validMovement || !validPointers || input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) {\n this.reset();\n } else if (input.eventType & INPUT_START) {\n this.reset();\n this._timer = setTimeout(function () {\n _this2.state = STATE_RECOGNIZED;\n\n _this2.tryEmit();\n }, options.time);\n } else if (input.eventType & INPUT_END) {\n return STATE_RECOGNIZED;\n }\n\n return STATE_FAILED;\n };\n\n _proto.reset = function reset() {\n clearTimeout(this._timer);\n };\n\n _proto.emit = function emit(input) {\n if (this.state !== STATE_RECOGNIZED) {\n return;\n }\n\n if (input && input.eventType & INPUT_END) {\n this.manager.emit(this.options.event + \"up\", input);\n } else {\n this._input.timeStamp = now();\n this.manager.emit(this.options.event, this._input);\n }\n };\n\n return PressRecognizer;\n}(Recognizer);\n\nvar defaults = {\n /**\n * @private\n * set if DOM events are being triggered.\n * But this is slower and unused by simple implementations, so disabled by default.\n * @type {Boolean}\n * @default false\n */\n domEvents: false,\n\n /**\n * @private\n * The value for the touchAction property/fallback.\n * When set to `compute` it will magically set the correct value based on the added recognizers.\n * @type {String}\n * @default compute\n */\n touchAction: TOUCH_ACTION_COMPUTE,\n\n /**\n * @private\n * @type {Boolean}\n * @default true\n */\n enable: true,\n\n /**\n * @private\n * EXPERIMENTAL FEATURE -- can be removed/changed\n * Change the parent input target element.\n * If Null, then it is being set the to main element.\n * @type {Null|EventTarget}\n * @default null\n */\n inputTarget: null,\n\n /**\n * @private\n * force an input class\n * @type {Null|Function}\n * @default null\n */\n inputClass: null,\n\n /**\n * @private\n * Some CSS properties can be used to improve the working of Hammer.\n * Add them to this method and they will be set when creating a new Manager.\n * @namespace\n */\n cssProps: {\n /**\n * @private\n * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userSelect: \"none\",\n\n /**\n * @private\n * Disable the Windows Phone grippers when pressing an element.\n * @type {String}\n * @default 'none'\n */\n touchSelect: \"none\",\n\n /**\n * @private\n * Disables the default callout shown when you touch and hold a touch target.\n * On iOS, when you touch and hold a touch target such as a link, Safari displays\n * a callout containing information about the link. This property allows you to disable that callout.\n * @type {String}\n * @default 'none'\n */\n touchCallout: \"none\",\n\n /**\n * @private\n * Specifies whether zooming is enabled. Used by IE10>\n * @type {String}\n * @default 'none'\n */\n contentZooming: \"none\",\n\n /**\n * @private\n * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userDrag: \"none\",\n\n /**\n * @private\n * Overrides the highlight color shown when the user taps a link or a JavaScript\n * clickable element in iOS. This property obeys the alpha value, if specified.\n * @type {String}\n * @default 'rgba(0,0,0,0)'\n */\n tapHighlightColor: \"rgba(0,0,0,0)\"\n }\n};\n/**\n * @private\n * Default recognizer setup when calling `Hammer()`\n * When creating a new Manager these will be skipped.\n * This is separated with other defaults because of tree-shaking.\n * @type {Array}\n */\n\nvar preset = [[RotateRecognizer, {\n enable: false\n}], [PinchRecognizer, {\n enable: false\n}, ['rotate']], [SwipeRecognizer, {\n direction: DIRECTION_HORIZONTAL\n}], [PanRecognizer, {\n direction: DIRECTION_HORIZONTAL\n}, ['swipe']], [TapRecognizer], [TapRecognizer, {\n event: 'doubletap',\n taps: 2\n}, ['tap']], [PressRecognizer]];\n\nvar STOP = 1;\nvar FORCED_STOP = 2;\n/**\n * @private\n * add/remove the css properties as defined in manager.options.cssProps\n * @param {Manager} manager\n * @param {Boolean} add\n */\n\nfunction toggleCssProps(manager, add) {\n var element = manager.element;\n\n if (!element.style) {\n return;\n }\n\n var prop;\n each(manager.options.cssProps, function (value, name) {\n prop = prefixed(element.style, name);\n\n if (add) {\n manager.oldCssProps[prop] = element.style[prop];\n element.style[prop] = value;\n } else {\n element.style[prop] = manager.oldCssProps[prop] || \"\";\n }\n });\n\n if (!add) {\n manager.oldCssProps = {};\n }\n}\n/**\n * @private\n * trigger dom event\n * @param {String} event\n * @param {Object} data\n */\n\n\nfunction triggerDomEvent(event, data) {\n var gestureEvent = document.createEvent(\"Event\");\n gestureEvent.initEvent(event, true, true);\n gestureEvent.gesture = data;\n data.target.dispatchEvent(gestureEvent);\n}\n/**\n* @private\n * Manager\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\n\n\nvar Manager =\n/*#__PURE__*/\nfunction () {\n function Manager(element, options) {\n var _this = this;\n\n this.options = assign$1({}, defaults, options || {});\n this.options.inputTarget = this.options.inputTarget || element;\n this.handlers = {};\n this.session = {};\n this.recognizers = [];\n this.oldCssProps = {};\n this.element = element;\n this.input = createInputInstance(this);\n this.touchAction = new TouchAction(this, this.options.touchAction);\n toggleCssProps(this, true);\n each(this.options.recognizers, function (item) {\n var recognizer = _this.add(new item[0](item[1]));\n\n item[2] && recognizer.recognizeWith(item[2]);\n item[3] && recognizer.requireFailure(item[3]);\n }, this);\n }\n /**\n * @private\n * set options\n * @param {Object} options\n * @returns {Manager}\n */\n\n\n var _proto = Manager.prototype;\n\n _proto.set = function set(options) {\n assign$1(this.options, options); // Options that need a little more setup\n\n if (options.touchAction) {\n this.touchAction.update();\n }\n\n if (options.inputTarget) {\n // Clean up existing event listeners and reinitialize\n this.input.destroy();\n this.input.target = options.inputTarget;\n this.input.init();\n }\n\n return this;\n };\n /**\n * @private\n * stop recognizing for this session.\n * This session will be discarded, when a new [input]start event is fired.\n * When forced, the recognizer cycle is stopped immediately.\n * @param {Boolean} [force]\n */\n\n\n _proto.stop = function stop(force) {\n this.session.stopped = force ? FORCED_STOP : STOP;\n };\n /**\n * @private\n * run the recognizers!\n * called by the inputHandler function on every movement of the pointers (touches)\n * it walks through all the recognizers and tries to detect the gesture that is being made\n * @param {Object} inputData\n */\n\n\n _proto.recognize = function recognize(inputData) {\n var session = this.session;\n\n if (session.stopped) {\n return;\n } // run the touch-action polyfill\n\n\n this.touchAction.preventDefaults(inputData);\n var recognizer;\n var recognizers = this.recognizers; // this holds the recognizer that is being recognized.\n // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\n // if no recognizer is detecting a thing, it is set to `null`\n\n var curRecognizer = session.curRecognizer; // reset when the last recognizer is recognized\n // or when we're in a new session\n\n if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED) {\n session.curRecognizer = null;\n curRecognizer = null;\n }\n\n var i = 0;\n\n while (i < recognizers.length) {\n recognizer = recognizers[i]; // find out if we are allowed try to recognize the input for this one.\n // 1. allow if the session is NOT forced stopped (see the .stop() method)\n // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\n // that is being recognized.\n // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\n // this can be setup with the `recognizeWith()` method on the recognizer.\n\n if (session.stopped !== FORCED_STOP && ( // 1\n !curRecognizer || recognizer === curRecognizer || // 2\n recognizer.canRecognizeWith(curRecognizer))) {\n // 3\n recognizer.recognize(inputData);\n } else {\n recognizer.reset();\n } // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\n // current active recognizer. but only if we don't already have an active recognizer\n\n\n if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {\n session.curRecognizer = recognizer;\n curRecognizer = recognizer;\n }\n\n i++;\n }\n };\n /**\n * @private\n * get a recognizer by its event name.\n * @param {Recognizer|String} recognizer\n * @returns {Recognizer|Null}\n */\n\n\n _proto.get = function get(recognizer) {\n if (recognizer instanceof Recognizer) {\n return recognizer;\n }\n\n var recognizers = this.recognizers;\n\n for (var i = 0; i < recognizers.length; i++) {\n if (recognizers[i].options.event === recognizer) {\n return recognizers[i];\n }\n }\n\n return null;\n };\n /**\n * @private add a recognizer to the manager\n * existing recognizers with the same event name will be removed\n * @param {Recognizer} recognizer\n * @returns {Recognizer|Manager}\n */\n\n\n _proto.add = function add(recognizer) {\n if (invokeArrayArg(recognizer, \"add\", this)) {\n return this;\n } // remove existing\n\n\n var existing = this.get(recognizer.options.event);\n\n if (existing) {\n this.remove(existing);\n }\n\n this.recognizers.push(recognizer);\n recognizer.manager = this;\n this.touchAction.update();\n return recognizer;\n };\n /**\n * @private\n * remove a recognizer by name or instance\n * @param {Recognizer|String} recognizer\n * @returns {Manager}\n */\n\n\n _proto.remove = function remove(recognizer) {\n if (invokeArrayArg(recognizer, \"remove\", this)) {\n return this;\n }\n\n var targetRecognizer = this.get(recognizer); // let's make sure this recognizer exists\n\n if (recognizer) {\n var recognizers = this.recognizers;\n var index = inArray(recognizers, targetRecognizer);\n\n if (index !== -1) {\n recognizers.splice(index, 1);\n this.touchAction.update();\n }\n }\n\n return this;\n };\n /**\n * @private\n * bind event\n * @param {String} events\n * @param {Function} handler\n * @returns {EventEmitter} this\n */\n\n\n _proto.on = function on(events, handler) {\n if (events === undefined || handler === undefined) {\n return this;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function (event) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n });\n return this;\n };\n /**\n * @private unbind event, leave emit blank to remove all handlers\n * @param {String} events\n * @param {Function} [handler]\n * @returns {EventEmitter} this\n */\n\n\n _proto.off = function off(events, handler) {\n if (events === undefined) {\n return this;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function (event) {\n if (!handler) {\n delete handlers[event];\n } else {\n handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);\n }\n });\n return this;\n };\n /**\n * @private emit event to the listeners\n * @param {String} event\n * @param {Object} data\n */\n\n\n _proto.emit = function emit(event, data) {\n // we also want to trigger dom events\n if (this.options.domEvents) {\n triggerDomEvent(event, data);\n } // no handlers, so skip it all\n\n\n var handlers = this.handlers[event] && this.handlers[event].slice();\n\n if (!handlers || !handlers.length) {\n return;\n }\n\n data.type = event;\n\n data.preventDefault = function () {\n data.srcEvent.preventDefault();\n };\n\n var i = 0;\n\n while (i < handlers.length) {\n handlers[i](data);\n i++;\n }\n };\n /**\n * @private\n * destroy the manager and unbinds all events\n * it doesn't unbind dom events, that is the user own responsibility\n */\n\n\n _proto.destroy = function destroy() {\n this.element && toggleCssProps(this, false);\n this.handlers = {};\n this.session = {};\n this.input.destroy();\n this.element = null;\n };\n\n return Manager;\n}();\n\nvar SINGLE_TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\nvar SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';\nvar SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';\n/**\n * @private\n * Touch events input\n * @constructor\n * @extends Input\n */\n\nvar SingleTouchInput =\n/*#__PURE__*/\nfunction (_Input) {\n _inheritsLoose(SingleTouchInput, _Input);\n\n function SingleTouchInput() {\n var _this;\n\n var proto = SingleTouchInput.prototype;\n proto.evTarget = SINGLE_TOUCH_TARGET_EVENTS;\n proto.evWin = SINGLE_TOUCH_WINDOW_EVENTS;\n _this = _Input.apply(this, arguments) || this;\n _this.started = false;\n return _this;\n }\n\n var _proto = SingleTouchInput.prototype;\n\n _proto.handler = function handler(ev) {\n var type = SINGLE_TOUCH_INPUT_MAP[ev.type]; // should we handle the touch events?\n\n if (type === INPUT_START) {\n this.started = true;\n }\n\n if (!this.started) {\n return;\n }\n\n var touches = normalizeSingleTouches.call(this, ev, type); // when done, reset the started state\n\n if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {\n this.started = false;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n };\n\n return SingleTouchInput;\n}(Input);\n\nfunction normalizeSingleTouches(ev, type) {\n var all = toArray(ev.touches);\n var changed = toArray(ev.changedTouches);\n\n if (type & (INPUT_END | INPUT_CANCEL)) {\n all = uniqueArray(all.concat(changed), 'identifier', true);\n }\n\n return [all, changed];\n}\n\n/**\n * @private\n * wrap a method with a deprecation warning and stack trace\n * @param {Function} method\n * @param {String} name\n * @param {String} message\n * @returns {Function} A new function wrapping the supplied method.\n */\nfunction deprecate(method, name, message) {\n var deprecationMessage = \"DEPRECATED METHOD: \" + name + \"\\n\" + message + \" AT \\n\";\n return function () {\n var e = new Error('get-stack-trace');\n var stack = e && e.stack ? e.stack.replace(/^[^\\(]+?[\\n$]/gm, '').replace(/^\\s+at\\s+/gm, '').replace(/^Object.<anonymous>\\s*\\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';\n var log = window.console && (window.console.warn || window.console.log);\n\n if (log) {\n log.call(window.console, deprecationMessage, stack);\n }\n\n return method.apply(this, arguments);\n };\n}\n\n/**\n * @private\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} dest\n * @param {Object} src\n * @param {Boolean} [merge=false]\n * @returns {Object} dest\n */\n\nvar extend = deprecate(function (dest, src, merge) {\n var keys = Object.keys(src);\n var i = 0;\n\n while (i < keys.length) {\n if (!merge || merge && dest[keys[i]] === undefined) {\n dest[keys[i]] = src[keys[i]];\n }\n\n i++;\n }\n\n return dest;\n}, 'extend', 'Use `assign`.');\n\n/**\n * @private\n * merge the values from src in the dest.\n * means that properties that exist in dest will not be overwritten by src\n * @param {Object} dest\n * @param {Object} src\n * @returns {Object} dest\n */\n\nvar merge = deprecate(function (dest, src) {\n return extend(dest, src, true);\n}, 'merge', 'Use `assign`.');\n\n/**\n * @private\n * simple class inheritance\n * @param {Function} child\n * @param {Function} base\n * @param {Object} [properties]\n */\n\nfunction inherit(child, base, properties) {\n var baseP = base.prototype;\n var childP;\n childP = child.prototype = Object.create(baseP);\n childP.constructor = child;\n childP._super = baseP;\n\n if (properties) {\n assign$1(childP, properties);\n }\n}\n\n/**\n * @private\n * simple function bind\n * @param {Function} fn\n * @param {Object} context\n * @returns {Function}\n */\nfunction bindFn(fn, context) {\n return function boundFn() {\n return fn.apply(context, arguments);\n };\n}\n\n/**\n * @private\n * Simple way to create a manager with a default set of recognizers.\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\n\nvar Hammer =\n/*#__PURE__*/\nfunction () {\n var Hammer =\n /**\n * @private\n * @const {string}\n */\n function Hammer(element, options) {\n if (options === void 0) {\n options = {};\n }\n\n return new Manager(element, _extends({\n recognizers: preset.concat()\n }, options));\n };\n\n Hammer.VERSION = \"2.0.17-rc\";\n Hammer.DIRECTION_ALL = DIRECTION_ALL;\n Hammer.DIRECTION_DOWN = DIRECTION_DOWN;\n Hammer.DIRECTION_LEFT = DIRECTION_LEFT;\n Hammer.DIRECTION_RIGHT = DIRECTION_RIGHT;\n Hammer.DIRECTION_UP = DIRECTION_UP;\n Hammer.DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;\n Hammer.DIRECTION_VERTICAL = DIRECTION_VERTICAL;\n Hammer.DIRECTION_NONE = DIRECTION_NONE;\n Hammer.DIRECTION_DOWN = DIRECTION_DOWN;\n Hammer.INPUT_START = INPUT_START;\n Hammer.INPUT_MOVE = INPUT_MOVE;\n Hammer.INPUT_END = INPUT_END;\n Hammer.INPUT_CANCEL = INPUT_CANCEL;\n Hammer.STATE_POSSIBLE = STATE_POSSIBLE;\n Hammer.STATE_BEGAN = STATE_BEGAN;\n Hammer.STATE_CHANGED = STATE_CHANGED;\n Hammer.STATE_ENDED = STATE_ENDED;\n Hammer.STATE_RECOGNIZED = STATE_RECOGNIZED;\n Hammer.STATE_CANCELLED = STATE_CANCELLED;\n Hammer.STATE_FAILED = STATE_FAILED;\n Hammer.Manager = Manager;\n Hammer.Input = Input;\n Hammer.TouchAction = TouchAction;\n Hammer.TouchInput = TouchInput;\n Hammer.MouseInput = MouseInput;\n Hammer.PointerEventInput = PointerEventInput;\n Hammer.TouchMouseInput = TouchMouseInput;\n Hammer.SingleTouchInput = SingleTouchInput;\n Hammer.Recognizer = Recognizer;\n Hammer.AttrRecognizer = AttrRecognizer;\n Hammer.Tap = TapRecognizer;\n Hammer.Pan = PanRecognizer;\n Hammer.Swipe = SwipeRecognizer;\n Hammer.Pinch = PinchRecognizer;\n Hammer.Rotate = RotateRecognizer;\n Hammer.Press = PressRecognizer;\n Hammer.on = addEventListeners;\n Hammer.off = removeEventListeners;\n Hammer.each = each;\n Hammer.merge = merge;\n Hammer.extend = extend;\n Hammer.bindFn = bindFn;\n Hammer.assign = assign$1;\n Hammer.inherit = inherit;\n Hammer.bindFn = bindFn;\n Hammer.prefixed = prefixed;\n Hammer.toArray = toArray;\n Hammer.inArray = inArray;\n Hammer.uniqueArray = uniqueArray;\n Hammer.splitStr = splitStr;\n Hammer.boolOrFn = boolOrFn;\n Hammer.hasParent = hasParent;\n Hammer.addEventListeners = addEventListeners;\n Hammer.removeEventListeners = removeEventListeners;\n Hammer.defaults = assign$1({}, defaults, {\n preset: preset\n });\n return Hammer;\n}();\n\n// style loader but by script tag, not by the loader.\n\nvar defaults$1 = Hammer.defaults;\n\nexport default Hammer;\nexport { INPUT_START, INPUT_MOVE, INPUT_END, INPUT_CANCEL, STATE_POSSIBLE, STATE_BEGAN, STATE_CHANGED, STATE_ENDED, STATE_RECOGNIZED, STATE_CANCELLED, STATE_FAILED, DIRECTION_NONE, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DIRECTION_DOWN, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL, DIRECTION_ALL, Manager, Input, TouchAction, TouchInput, MouseInput, PointerEventInput, TouchMouseInput, SingleTouchInput, Recognizer, AttrRecognizer, TapRecognizer as Tap, PanRecognizer as Pan, SwipeRecognizer as Swipe, PinchRecognizer as Pinch, RotateRecognizer as Rotate, PressRecognizer as Press, addEventListeners as on, removeEventListeners as off, each, merge, extend, assign$1 as assign, inherit, bindFn, prefixed, toArray, inArray, uniqueArray, splitStr, boolOrFn, hasParent, addEventListeners, removeEventListeners, defaults$1 as defaults };\n//# sourceMappingURL=hammer.esm.js.map\n","/**\n * vis-util\n * https://github.com/visjs/vis-util\n *\n * utilitie collection for visjs\n *\n * @version 5.0.1\n * @date 2021-01-08T16:32:03.971Z\n *\n * @copyright (c) 2011-2017 Almende B.V, http://almende.com\n * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs\n *\n * @license\n * vis.js is dual licensed under both\n *\n * 1. The Apache 2.0 License\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * and\n *\n * 2. The MIT License\n * http://opensource.org/licenses/MIT\n *\n * vis.js may be distributed under either license.\n */\n\nimport Emitter from 'component-emitter';\nimport RealHammer from '@egjs/hammerjs';\n\n/**\r\n * Use this symbol to delete properies in deepObjectAssign.\r\n */\r\nconst DELETE = Symbol(\"DELETE\");\r\n/**\r\n * Pure version of deepObjectAssign, it doesn't modify any of it's arguments.\r\n *\r\n * @param base - The base object that fullfils the whole interface T.\r\n * @param updates - Updates that may change or delete props.\r\n *\r\n * @returns A brand new instance with all the supplied objects deeply merged.\r\n */\r\nfunction pureDeepObjectAssign(base, ...updates) {\r\n return deepObjectAssign({}, base, ...updates);\r\n}\r\n/**\r\n * Deep version of object assign with additional deleting by the DELETE symbol.\r\n *\r\n * @param values - Objects to be deeply merged.\r\n *\r\n * @returns The first object from values.\r\n */\r\nfunction deepObjectAssign(...values) {\r\n const merged = deepObjectAssignNonentry(...values);\r\n stripDelete(merged);\r\n return merged;\r\n}\r\n/**\r\n * Deep version of object assign with additional deleting by the DELETE symbol.\r\n *\r\n * @remarks\r\n * This doesn't strip the DELETE symbols so they may end up in the final object.\r\n *\r\n * @param values - Objects to be deeply merged.\r\n *\r\n * @returns The first object from values.\r\n */\r\nfunction deepObjectAssignNonentry(...values) {\r\n if (values.length < 2) {\r\n return values[0];\r\n }\r\n else if (values.length > 2) {\r\n return deepObjectAssignNonentry(deepObjectAssign(values[0], values[1]), ...values.slice(2));\r\n }\r\n const a = values[0];\r\n const b = values[1];\r\n for (const prop of Reflect.ownKeys(b)) {\r\n if (!Object.prototype.propertyIsEnumerable.call(b, prop)) ;\r\n else if (b[prop] === DELETE) {\r\n delete a[prop];\r\n }\r\n else if (a[prop] !== null &&\r\n b[prop] !== null &&\r\n typeof a[prop] === \"object\" &&\r\n typeof b[prop] === \"object\" &&\r\n !Array.isArray(a[prop]) &&\r\n !Array.isArray(b[prop])) {\r\n a[prop] = deepObjectAssignNonentry(a[prop], b[prop]);\r\n }\r\n else {\r\n a[prop] = clone(b[prop]);\r\n }\r\n }\r\n return a;\r\n}\r\n/**\r\n * Deep clone given object or array. In case of primitive simply return.\r\n *\r\n * @param a - Anything.\r\n *\r\n * @returns Deep cloned object/array or unchanged a.\r\n */\r\nfunction clone(a) {\r\n if (Array.isArray(a)) {\r\n return a.map((value) => clone(value));\r\n }\r\n else if (typeof a === \"object\" && a !== null) {\r\n return deepObjectAssignNonentry({}, a);\r\n }\r\n else {\r\n return a;\r\n }\r\n}\r\n/**\r\n * Strip DELETE from given object.\r\n *\r\n * @param a - Object which may contain DELETE but won't after this is executed.\r\n */\r\nfunction stripDelete(a) {\r\n for (const prop of Object.keys(a)) {\r\n if (a[prop] === DELETE) {\r\n delete a[prop];\r\n }\r\n else if (typeof a[prop] === \"object\" && a[prop] !== null) {\r\n stripDelete(a[prop]);\r\n }\r\n }\r\n}\n\n/**\r\n * Seedable, fast and reasonably good (not crypto but more than okay for our\r\n * needs) random number generator.\r\n *\r\n * @remarks\r\n * Adapted from {@link https://web.archive.org/web/20110429100736/http://baagoe.com:80/en/RandomMusings/javascript}.\r\n * Original algorithm created by Johannes Baagøe \\<baagoe\\@baagoe.com\\> in 2010.\r\n */\r\n/**\r\n * Create a seeded pseudo random generator based on Alea by Johannes Baagøe.\r\n *\r\n * @param seed - All supplied arguments will be used as a seed. In case nothing\r\n * is supplied the current time will be used to seed the generator.\r\n *\r\n * @returns A ready to use seeded generator.\r\n */\r\nfunction Alea(...seed) {\r\n return AleaImplementation(seed.length ? seed : [Date.now()]);\r\n}\r\n/**\r\n * An implementation of [[Alea]] without user input validation.\r\n *\r\n * @param seed - The data that will be used to seed the generator.\r\n *\r\n * @returns A ready to use seeded generator.\r\n */\r\nfunction AleaImplementation(seed) {\r\n let [s0, s1, s2] = mashSeed(seed);\r\n let c = 1;\r\n const random = () => {\r\n const t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32\r\n s0 = s1;\r\n s1 = s2;\r\n return (s2 = t - (c = t | 0));\r\n };\r\n random.uint32 = () => random() * 0x100000000; // 2^32\r\n random.fract53 = () => random() + ((random() * 0x200000) | 0) * 1.1102230246251565e-16; // 2^-53\r\n random.algorithm = \"Alea\";\r\n random.seed = seed;\r\n random.version = \"0.9\";\r\n return random;\r\n}\r\n/**\r\n * Turn arbitrary data into values [[AleaImplementation]] can use to generate\r\n * random numbers.\r\n *\r\n * @param seed - Arbitrary data that will be used as the seed.\r\n *\r\n * @returns Three numbers to use as initial values for [[AleaImplementation]].\r\n */\r\nfunction mashSeed(...seed) {\r\n const mash = Mash();\r\n let s0 = mash(\" \");\r\n let s1 = mash(\" \");\r\n let s2 = mash(\" \");\r\n for (let i = 0; i < seed.length; i++) {\r\n s0 -= mash(seed[i]);\r\n if (s0 < 0) {\r\n s0 += 1;\r\n }\r\n s1 -= mash(seed[i]);\r\n if (s1 < 0) {\r\n s1 += 1;\r\n }\r\n s2 -= mash(seed[i]);\r\n if (s2 < 0) {\r\n s2 += 1;\r\n }\r\n }\r\n return [s0, s1, s2];\r\n}\r\n/**\r\n * Create a new mash function.\r\n *\r\n * @returns A nonpure function that takes arbitrary [[Mashable]] data and turns\r\n * them into numbers.\r\n */\r\nfunction Mash() {\r\n let n = 0xefc8249d;\r\n return function (data) {\r\n const string = data.toString();\r\n for (let i = 0; i < string.length; i++) {\r\n n += string.charCodeAt(i);\r\n let h = 0.02519603282416938 * n;\r\n n = h >>> 0;\r\n h -= n;\r\n h *= n;\r\n n = h >>> 0;\r\n h -= n;\r\n n += h * 0x100000000; // 2^32\r\n }\r\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\r\n };\r\n}\n\n/**\n * Setup a mock hammer.js object, for unit testing.\n *\n * Inspiration: https://github.com/uber/deck.gl/pull/658\n *\n * @returns {{on: noop, off: noop, destroy: noop, emit: noop, get: get}}\n */\nfunction hammerMock() {\n const noop = () => {};\n\n return {\n on: noop,\n off: noop,\n destroy: noop,\n emit: noop,\n\n get() {\n return {\n set: noop,\n };\n },\n };\n}\n\nconst Hammer =\n typeof window !== \"undefined\"\n ? window.Hammer || RealHammer\n : function () {\n // hammer.js is only available in a browser, not in node.js. Replacing it with a mock object.\n return hammerMock();\n };\n\n/**\n * Turn an element into an clickToUse element.\n * When not active, the element has a transparent overlay. When the overlay is\n * clicked, the mode is changed to active.\n * When active, the element is displayed with a blue border around it, and\n * the interactive contents of the element can be used. When clicked outside\n * the element, the elements mode is changed to inactive.\n *\n * @param {Element} container\n * @class Activator\n */\nfunction Activator(container) {\n this._cleanupQueue = [];\n\n this.active = false;\n\n this._dom = {\n container,\n overlay: document.createElement(\"div\"),\n };\n\n this._dom.overlay.classList.add(\"vis-overlay\");\n\n this._dom.container.appendChild(this._dom.overlay);\n this._cleanupQueue.push(() => {\n this._dom.overlay.parentNode.removeChild(this._dom.overlay);\n });\n\n const hammer = Hammer(this._dom.overlay);\n hammer.on(\"tap\", this._onTapOverlay.bind(this));\n this._cleanupQueue.push(() => {\n hammer.destroy();\n // FIXME: cleaning up hammer instances doesn't work (Timeline not removed\n // from memory)\n });\n\n // block all touch events (except tap)\n const events = [\n \"tap\",\n \"doubletap\",\n \"press\",\n \"pinch\",\n \"pan\",\n \"panstart\",\n \"panmove\",\n \"panend\",\n ];\n events.forEach((event) => {\n hammer.on(event, (event) => {\n event.srcEvent.stopPropagation();\n });\n });\n\n // attach a click event to the window, in order to deactivate when clicking outside the timeline\n if (document && document.body) {\n this._onClick = (event) => {\n if (!_hasParent(event.target, container)) {\n this.deactivate();\n }\n };\n document.body.addEventListener(\"click\", this._onClick);\n this._cleanupQueue.push(() => {\n document.body.removeEventListener(\"click\", this._onClick);\n });\n }\n\n // prepare escape key listener for deactivating when active\n this._escListener = (event) => {\n if (\n \"key\" in event\n ? event.key === \"Escape\"\n : event.keyCode === 27 /* the keyCode is for IE11 */\n ) {\n this.deactivate();\n }\n };\n}\n\n// turn into an event emitter\nEmitter(Activator.prototype);\n\n// The currently active activator\nActivator.current = null;\n\n/**\n * Destroy the activator. Cleans up all created DOM and event listeners\n */\nActivator.prototype.destroy = function () {\n this.deactivate();\n\n for (const callback of this._cleanupQueue.splice(0).reverse()) {\n callback();\n }\n};\n\n/**\n * Activate the element\n * Overlay is hidden, element is decorated with a blue shadow border\n */\nActivator.prototype.activate = function () {\n // we allow only one active activator at a time\n if (Activator.current) {\n Activator.current.deactivate();\n }\n Activator.current = this;\n\n this.active = true;\n this._dom.overlay.style.display = \"none\";\n this._dom.container.classList.add(\"vis-active\");\n\n this.emit(\"change\");\n this.emit(\"activate\");\n\n // ugly hack: bind ESC after emitting the events, as the Network rebinds all\n // keyboard events on a 'change' event\n document.body.addEventListener(\"keydown\", this._escListener);\n};\n\n/**\n * Deactivate the element\n * Overlay is displayed on top of the element\n */\nActivator.prototype.deactivate = function () {\n this.active = false;\n this._dom.overlay.style.display = \"block\";\n this._dom.container.classList.remove(\"vis-active\");\n document.body.removeEventListener(\"keydown\", this._escListener);\n\n this.emit(\"change\");\n this.emit(\"deactivate\");\n};\n\n/**\n * Handle a tap event: activate the container\n *\n * @param {Event} event The event\n * @private\n */\nActivator.prototype._onTapOverlay = function (event) {\n // activate the container\n this.activate();\n event.srcEvent.stopPropagation();\n};\n\n/**\n * Test whether the element has the requested parent element somewhere in\n * its chain of parent nodes.\n *\n * @param {HTMLElement} element\n * @param {HTMLElement} parent\n * @returns {boolean} Returns true when the parent is found somewhere in the\n * chain of parent nodes.\n * @private\n */\nfunction _hasParent(element, parent) {\n while (element) {\n if (element === parent) {\n return true;\n }\n element = element.parentNode;\n }\n return false;\n}\n\n// utility functions\r\n// parse ASP.Net Date pattern,\r\n// for example '/Date(1198908717056)/' or '/Date(1198908717056-0700)/'\r\n// code from http://momentjs.com/\r\nconst ASPDateRegex = /^\\/?Date\\((-?\\d+)/i;\r\n// Color REs\r\nconst fullHexRE = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i;\r\nconst shortHexRE = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\r\nconst rgbRE = /^rgb\\( *(1?\\d{1,2}|2[0-4]\\d|25[0-5]) *, *(1?\\d{1,2}|2[0-4]\\d|25[0-5]) *, *(1?\\d{1,2}|2[0-4]\\d|25[0-5]) *\\)$/i;\r\nconst rgbaRE = /^rgba\\( *(1?\\d{1,2}|2[0-4]\\d|25[0-5]) *, *(1?\\d{1,2}|2[0-4]\\d|25[0-5]) *, *(1?\\d{1,2}|2[0-4]\\d|25[0-5]) *, *([01]|0?\\.\\d+) *\\)$/i;\r\n/**\r\n * Test whether given object is a number.\r\n *\r\n * @param value - Input value of unknown type.\r\n *\r\n * @returns True if number, false otherwise.\r\n */\r\nfunction isNumber(value) {\r\n return value instanceof Number || typeof value === \"number\";\r\n}\r\n/**\r\n * Remove everything in the DOM object.\r\n *\r\n * @param DOMobject - Node whose child nodes will be recursively deleted.\r\n */\r\nfunction recursiveDOMDelete(DOMobject) {\r\n if (DOMobject) {\r\n while (DOMobject.hasChildNodes() === true) {\r\n const child = DOMobject.firstChild;\r\n if (child) {\r\n recursiveDOMDelete(child);\r\n DOMobject.removeChild(child);\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Test whether given object is a string.\r\n *\r\n * @param value - Input value of unknown type.\r\n *\r\n * @returns True if string, false otherwise.\r\n */\r\nfunction isString(value) {\r\n return value instanceof String || typeof value === \"string\";\r\n}\r\n/**\r\n * Test whether given object is a object (not primitive or null).\r\n *\r\n * @param value - Input value of unknown type.\r\n *\r\n * @returns True if not null object, false otherwise.\r\n */\r\nfunction isObject(value) {\r\n return typeof value === \"object\" && value !== null;\r\n}\r\n/**\r\n * Test whether given object is a Date, or a String containing a Date.\r\n *\r\n * @param value - Input value of unknown type.\r\n *\r\n * @returns True if Date instance or string date representation, false otherwise.\r\n */\r\nfunction isDate(value) {\r\n if (value instanceof Date) {\r\n return true;\r\n }\r\n else if (isString(value)) {\r\n // test whether this string contains a date\r\n const match = ASPDateRegex.exec(value);\r\n if (match) {\r\n return true;\r\n }\r\n else if (!isNaN(Date.parse(value))) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Copy property from b to a if property present in a.\r\n * If property in b explicitly set to null, delete it if `allowDeletion` set.\r\n *\r\n * Internal helper routine, should not be exported. Not added to `exports` for that reason.\r\n *\r\n * @param a - Target object.\r\n * @param b - Source object.\r\n * @param prop - Name of property to copy from b to a.\r\n * @param allowDeletion - If true, delete property in a if explicitly set to null in b.\r\n */\r\nfunction copyOrDelete(a, b, prop, allowDeletion) {\r\n let doDeletion = false;\r\n if (allowDeletion === true) {\r\n doDeletion = b[prop] === null && a[prop] !== undefined;\r\n }\r\n if (doDeletion) {\r\n delete a[prop];\r\n }\r\n else {\r\n a[prop] = b[prop]; // Remember, this is a reference copy!\r\n }\r\n}\r\n/**\r\n * Fill an object with a possibly partially defined other object.\r\n *\r\n * Only copies values for the properties already present in a.\r\n * That means an object is not created on a property if only the b object has it.\r\n *\r\n * @param a - The object that will have it's properties updated.\r\n * @param b - The object with property updates.\r\n * @param allowDeletion - If true, delete properties in a that are explicitly set to null in b.\r\n */\r\nfunction fillIfDefined(a, b, allowDeletion = false) {\r\n // NOTE: iteration of properties of a\r\n // NOTE: prototype properties iterated over as well\r\n for (const prop in a) {\r\n if (b[prop] !== undefined) {\r\n if (b[prop] === null || typeof b[prop] !== \"object\") {\r\n // Note: typeof null === 'object'\r\n copyOrDelete(a, b, prop, allowDeletion);\r\n }\r\n else {\r\n const aProp = a[prop];\r\n const bProp = b[prop];\r\n if (isObject(aProp) && isObject(bProp)) {\r\n fillIfDefined(aProp, bProp, allowDeletion);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Copy the values of all of the enumerable own properties from one or more source objects to a\r\n * target object. Returns the target object.\r\n *\r\n * @param target - The target object to copy to.\r\n * @param source - The source object from which to copy properties.\r\n *\r\n * @returns The target object.\r\n */\r\nconst extend = Object.assign;\r\n/**\r\n * Extend object a with selected properties of object b or a series of objects.\r\n *\r\n * @remarks\r\n * Only properties with defined values are copied.\r\n *\r\n * @param props - Properties to be copied to a.\r\n * @param a - The target.\r\n * @param others - The sources.\r\n *\r\n * @returns Argument a.\r\n */\r\nfunction selectiveExtend(props, a, ...others) {\r\n if (!Array.isArray(props)) {\r\n throw new Error(\"Array with property names expected as first argument\");\r\n }\r\n for (const other of others) {\r\n for (let p = 0; p < props.length; p++) {\r\n const prop = props[p];\r\n if (other && Object.prototype.hasOwnProperty.call(other, prop)) {\r\n a[prop] = other[prop];\r\n }\r\n }\r\n }\r\n return a;\r\n}\r\n/**\r\n * Extend object a with selected properties of object b.\r\n * Only properties with defined values are copied.\r\n *\r\n * @remarks\r\n * Previous version of this routine implied that multiple source objects could\r\n * be used; however, the implementation was **wrong**. Since multiple (\\>1)\r\n * sources weren't used anywhere in the `vis.js` code, this has been removed\r\n *\r\n * @param props - Names of first-level properties to copy over.\r\n * @param a - Target object.\r\n * @param b - Source object.\r\n * @param allowDeletion - If true, delete property in a if explicitly set to null in b.\r\n *\r\n * @returns Argument a.\r\n */\r\nfunction selectiveDeepExtend(props, a, b, allowDeletion = false) {\r\n // TODO: add support for Arrays to deepExtend\r\n if (Array.isArray(b)) {\r\n throw new TypeError(\"Arrays are not supported by deepExtend\");\r\n }\r\n for (let p = 0; p < props.length; p++) {\r\n const prop = props[p];\r\n if (Object.prototype.hasOwnProperty.call(b, prop)) {\r\n if (b[prop] && b[prop].constructor === Object) {\r\n if (a[prop] === undefined) {\r\n a[prop] = {};\r\n }\r\n if (a[prop].constructor === Object) {\r\n deepExtend(a[prop], b[prop], false, allowDeletion);\r\n }\r\n else {\r\n copyOrDelete(a, b, prop, allowDeletion);\r\n }\r\n }\r\n else if (Array.isArray(b[prop])) {\r\n throw new TypeError(\"Arrays are not supported by deepExtend\");\r\n }\r\n else {\r\n copyOrDelete(a, b, prop, allowDeletion);\r\n }\r\n }\r\n }\r\n return a;\r\n}\r\n/**\r\n * Extend object `a` with properties of object `b`, ignoring properties which\r\n * are explicitly specified to be excluded.\r\n *\r\n * @remarks\r\n * The properties of `b` are considered for copying. Properties which are\r\n * themselves objects are are also extended. Only properties with defined\r\n * values are copied.\r\n *\r\n * @param propsToExclude - Names of properties which should *not* be copied.\r\n * @param a - Object to extend.\r\n * @param b - Object to take properties from for extension.\r\n * @param allowDeletion - If true, delete properties in a that are explicitly\r\n * set to null in b.\r\n *\r\n * @returns Argument a.\r\n */\r\nfunction selectiveNotDeepExtend(propsToExclude, a, b, allowDeletion = false) {\r\n // TODO: add support for Arrays to deepExtend\r\n // NOTE: array properties have an else-below; apparently, there is a problem here.\r\n if (Array.isArray(b)) {\r\n throw new TypeError(\"Arrays are not supported by deepExtend\");\r\n }\r\n for (const prop in b) {\r\n if (!Object.prototype.hasOwnProperty.call(b, prop)) {\r\n continue;\r\n } // Handle local properties only\r\n if (propsToExclude.includes(prop)) {\r\n continue;\r\n } // In exclusion list, skip\r\n if (b[prop] && b[prop].constructor === Object) {\r\n if (a[prop] === undefined) {\r\n a[prop] = {};\r\n }\r\n if (a[prop].constructor === Object) {\r\n deepExtend(a[prop], b[prop]); // NOTE: allowDeletion not propagated!\r\n }\r\n else {\r\n copyOrDelete(a, b, prop, allowDeletion);\r\n }\r\n }\r\n else if (Array.isArray(b[prop])) {\r\n a[prop] = [];\r\n for (let i = 0; i < b[prop].length; i++) {\r\n a[prop].push(b[prop][i]);\r\n }\r\n }\r\n else {\r\n copyOrDelete(a, b, prop, allowDeletion);\r\n }\r\n }\r\n return a;\r\n}\r\n/**\r\n * Deep extend an object a with the properties of object b.\r\n *\r\n * @param a - Target object.\r\n * @param b - Source object.\r\n * @param protoExtend - If true, the prototype values will also be extended.\r\n * (That is the options objects that inherit from others will also get the\r\n * inherited options).\r\n * @param allowDeletion - If true, the values of fields that are null will be deleted.\r\n *\r\n * @returns Argument a.\r\n */\r\nfunction deepExtend(a, b, protoExtend = false, allowDeletion = false) {\r\n for (const prop in b) {\r\n if (Object.prototype.hasOwnProperty.call(b, prop) || protoExtend === true) {\r\n if (typeof b[prop] === \"object\" &&\r\n b[prop] !== null &&\r\n Object.getPrototypeOf(b[prop]) === Object.prototype) {\r\n if (a[prop] === undefined) {\r\n a[prop] = deepExtend({}, b[prop], protoExtend); // NOTE: allowDeletion not propagated!\r\n }\r\n else if (typeof a[prop] === \"object\" &&\r\n a[prop] !== null &&\r\n Object.getPrototypeOf(a[prop]) === Object.prototype) {\r\n deepExtend(a[prop], b[prop], protoExtend); // NOTE: allowDeletion not propagated!\r\n }\r\n else {\r\n copyOrDelete(a, b, prop, allowDeletion);\r\n }\r\n }\r\n else if (Array.isArray(b[prop])) {\r\n a[prop] = b[prop].slice();\r\n }\r\n else {\r\n copyOrDelete(a, b, prop, allowDeletion);\r\n }\r\n }\r\n }\r\n return a;\r\n}\r\n/**\r\n * Test whether all elements in two arrays are equal.\r\n *\r\n * @param a - First array.\r\n * @param b - Second array.\r\n *\r\n * @returns True if both arrays have the same length and same elements (1 = '1').\r\n */\r\nfunction equalArray(a, b) {\r\n if (a.length !== b.length) {\r\n return false;\r\n }\r\n for (let i = 0, len = a.length; i < len; i++) {\r\n if (a[i] != b[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n/**\r\n * Get the type of an object, for example exports.getType([]) returns 'Array'.\r\n *\r\n * @param object - Input value of unknown type.\r\n *\r\n * @returns Detected type.\r\n */\r\nfunction getType(object) {\r\n const type = typeof object;\r\n if (type === \"object\") {\r\n if (object === null) {\r\n return \"null\";\r\n }\r\n if (object instanceof Boolean) {\r\n return \"Boolean\";\r\n }\r\n if (object instanceof Number) {\r\n return \"Number\";\r\n }\r\n if (object instanceof String) {\r\n return \"String\";\r\n }\r\n if (Array.isArray(object)) {\r\n return \"Array\";\r\n }\r\n if (object instanceof Date) {\r\n return \"Date\";\r\n }\r\n return \"Object\";\r\n }\r\n if (type === \"number\") {\r\n return \"Number\";\r\n }\r\n if (type === \"boolean\") {\r\n return \"Boolean\";\r\n }\r\n if (type === \"string\") {\r\n return \"String\";\r\n }\r\n if (type === undefined) {\r\n return \"undefined\";\r\n }\r\n return type;\r\n}\r\n/**\r\n * Used to extend an array and copy it. This is used to propagate paths recursively.\r\n *\r\n * @param arr - First part.\r\n * @param newValue - The value to be aadded into the array.\r\n *\r\n * @returns A new array with all items from arr and newValue (which is last).\r\n */\r\nfunction copyAndExtendArray(arr, newValue) {\r\n return [...arr, newValue];\r\n}\r\n/**\r\n * Used to extend an array and copy it. This is used to propagate paths recursively.\r\n *\r\n * @param arr - The array to be copied.\r\n *\r\n * @returns Shallow copy of arr.\r\n */\r\nfunction copyArray(arr) {\r\n return arr.slice();\r\n}\r\n/**\r\n * Retrieve the absolute left value of a DOM element.\r\n *\r\n * @param elem - A dom element, for example a div.\r\n *\r\n * @returns The absolute left position of this element in the browser page.\r\n */\r\nfunction getAbsoluteLeft(elem) {\r\n return elem.getBoundingClientRect().left;\r\n}\r\n/**\r\n * Retrieve the absolute right value of a DOM element.\r\n *\r\n * @param elem - A dom element, for example a div.\r\n *\r\n * @returns The absolute right position of this element in the browser page.\r\n */\r\nfunction getAbsoluteRight(elem) {\r\n return elem.getBoundingClientRect().right;\r\n}\r\n/**\r\n * Retrieve the absolute top value of a DOM element.\r\n *\r\n * @param elem - A dom element, for example a div.\r\n *\r\n * @returns The absolute top position of this element in the browser page.\r\n */\r\nfunction getAbsoluteTop(elem) {\r\n return elem.getBoundingClientRect().top;\r\n}\r\n/**\r\n * Add a className to the given elements style.\r\n *\r\n * @param elem - The element to which the classes will be added.\r\n * @param classNames - Space separated list of classes.\r\n */\r\nfunction addClassName(elem, classNames) {\r\n let classes = elem.className.split(\" \");\r\n const newClasses = classNames.split(\" \");\r\n classes = classes.concat(newClasses.filter(function (className) {\r\n return !classes.includes(className);\r\n }));\r\n elem.className = classes.join(\" \");\r\n}\r\n/**\r\n * Remove a className from the given elements style.\r\n *\r\n * @param elem - The element from which the classes will be removed.\r\n * @param classNames - Space separated list of classes.\r\n */\r\nfunction removeClassName(elem, classNames) {\r\n let classes = elem.className.split(\" \");\r\n const oldClasses = classNames.split(\" \");\r\n classes = classes.filter(function (className) {\r\n return !oldClasses.includes(className);\r\n });\r\n elem.className = classes.join(\" \");\r\n}\r\n/**\r\n * For each method for both arrays and objects.\r\n * In case of an array, the built-in Array.forEach() is applied (**No, it's not!**).\r\n * In case of an Object, the method loops over all properties of the object.\r\n *\r\n * @param object - An Object or Array to be iterated over.\r\n * @param callback - Array.forEach-like callback.\r\n */\r\nfunction forEach(object, callback) {\r\n if (Array.isArray(object)) {\r\n // array\r\n const len = object.length;\r\n for (let i = 0; i < len; i++) {\r\n callback(object[i], i, object);\r\n }\r\n }\r\n else {\r\n // object\r\n for (const key in object) {\r\n if (Object.prototype.hasOwnProperty.call(object, key)) {\r\n callback(object[key], key, object);\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Convert an object into an array: all objects properties are put into the array. The resulting array is unordered.\r\n *\r\n * @param o - Object that contains the properties and methods.\r\n *\r\n * @returns An array of unordered values.\r\n */\r\nconst toArray = Object.values;\r\n/**\r\n * Update a property in an object.\r\n *\r\n * @param object - The object whose property will be updated.\r\n * @param key - Name of the property to be updated.\r\n * @param value - The new value to be assigned.\r\n *\r\n * @returns Whether the value was updated (true) or already strictly the same in the original object (false).\r\n */\r\nfunction updateProperty(object, key, value) {\r\n if (object[key] !== value) {\r\n object[key] = value;\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n/**\r\n * Throttle the given function to be only executed once per animation frame.\r\n *\r\n * @param fn - The original function.\r\n *\r\n * @returns The throttled function.\r\n */\r\nfunction throttle(fn) {\r\n let scheduled = false;\r\n return () => {\r\n if (!scheduled) {\r\n scheduled = true;\r\n requestAnimationFrame(() => {\r\n scheduled = false;\r\n fn();\r\n });\r\n }\r\n };\r\n}\r\n/**\r\n * Add and event listener. Works for all browsers.\r\n *\r\n * @param element - The element to bind the event listener to.\r\n * @param action - Same as Element.addEventListener(action, —, —).\r\n * @param listener - Same as Element.addEventListener(—, listener, —).\r\n * @param useCapture - Same as Element.addEventListener(—, —, useCapture).\r\n */\r\nfunction addEventListener(element, action, listener, useCapture) {\r\n if (element.addEventListener) {\r\n if (useCapture === undefined) {\r\n useCapture = false;\r\n }\r\n if (action === \"mousewheel\" && navigator.userAgent.includes(\"Firefox\")) {\r\n action = \"DOMMouseScroll\"; // For Firefox\r\n }\r\n element.addEventListener(action, listener, useCapture);\r\n }\r\n else {\r\n // @TODO: IE types? Does anyone care?\r\n element.attachEvent(\"on\" + action, listener); // IE browsers\r\n }\r\n}\r\n/**\r\n * Remove an event listener from an element.\r\n *\r\n * @param element - The element to bind the event listener to.\r\n * @param action - Same as Element.removeEventListener(action, —, —).\r\n * @param listener - Same as Element.removeEventListener(—, listener, —).\r\n * @param useCapture - Same as Element.removeEventListener(—, —, useCapture).\r\n */\r\nfunction removeEventListener(element, action, listener, useCapture) {\r\n if (element.removeEventListener) {\r\n // non-IE browsers\r\n if (useCapture === undefined) {\r\n useCapture = false;\r\n }\r\n if (action === \"mousewheel\" && navigator.userAgent.includes(\"Firefox\")) {\r\n action = \"DOMMouseScroll\"; // For Firefox\r\n }\r\n element.removeEventListener(action, listener, useCapture);\r\n }\r\n else {\r\n // @TODO: IE types? Does anyone care?\r\n element.detachEvent(\"on\" + action, listener); // IE browsers\r\n }\r\n}\r\n/**\r\n * Cancels the event's default action if it is cancelable, without stopping further propagation of the event.\r\n *\r\n * @param event - The event whose default action should be prevented.\r\n */\r\nfunction preventDefault(event) {\r\n if (!event) {\r\n event = window.event;\r\n }\r\n if (!event) ;\r\n else if (event.preventDefault) {\r\n event.preventDefault(); // non-IE browsers\r\n }\r\n else {\r\n // @TODO: IE types? Does anyone care?\r\n event.returnValue = false; // IE browsers\r\n }\r\n}\r\n/**\r\n * Get HTML element which is the target of the event.\r\n *\r\n * @param event - The event.\r\n *\r\n * @returns The element or null if not obtainable.\r\n */\r\nfunction getTarget(event = window.event) {\r\n // code from http://www.quirksmode.org/js/events_properties.html\r\n // @TODO: EventTarget can be almost anything, is it okay to return only Elements?\r\n let target = null;\r\n if (!event) ;\r\n else if (event.target) {\r\n target = event.target;\r\n }\r\n else if (event.srcElement) {\r\n target = event.srcElement;\r\n }\r\n if (!(target instanceof Element)) {\r\n return null;\r\n }\r\n if (target.nodeType != null && target.nodeType == 3) {\r\n // defeat Safari bug\r\n target = target.parentNode;\r\n if (!(target instanceof Element)) {\r\n return null;\r\n }\r\n }\r\n return target;\r\n}\r\n/**\r\n * Check if given element contains given parent somewhere in the DOM tree.\r\n *\r\n * @param element - The element to be tested.\r\n * @param parent - The ancestor (not necessarily parent) of the element.\r\n *\r\n * @returns True if parent is an ancestor of the element, false otherwise.\r\n */\r\nfunction hasParent(element, parent) {\r\n let elem = element;\r\n while (elem) {\r\n if (elem === parent) {\r\n return true;\r\n }\r\n else if (elem.parentNode) {\r\n elem = elem.parentNode;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n return false;\r\n}\r\nconst option = {\r\n /**\r\n * Convert a value into a boolean.\r\n *\r\n * @param value - Value to be converted intoboolean, a function will be executed as `(() => unknown)`.\r\n * @param defaultValue - If the value or the return value of the function == null then this will be returned.\r\n *\r\n * @returns Corresponding boolean value, if none then the default value, if none then null.\r\n */\r\n asBoolean(value, defaultValue) {\r\n if (typeof value == \"function\") {\r\n value = value();\r\n }\r\n if (value != null) {\r\n return value != false;\r\n }\r\n return defaultValue || null;\r\n },\r\n /**\r\n * Convert a value into a number.\r\n *\r\n * @param value - Value to be converted intonumber, a function will be executed as `(() => unknown)`.\r\n * @param defaultValue - If the value or the return value of the function == null then this will be returned.\r\n *\r\n * @returns Corresponding **boxed** number value, if none then the default value, if none then null.\r\n */\r\n asNumber(value, defaultValue) {\r\n if (typeof value == \"function\") {\r\n value = value();\r\n }\r\n if (value != null) {\r\n return Number(value) || defaultValue || null;\r\n }\r\n return defaultValue || null;\r\n },\r\n /**\r\n * Convert a value into a string.\r\n *\r\n * @param value - Value to be converted intostring, a function will be executed as `(() => unknown)`.\r\n * @param defaultValue - If the value or the return value of the function == null then this will be returned.\r\n *\r\n * @returns Corresponding **boxed** string value, if none then the default value, if none then null.\r\n */\r\n asString(value, defaultValue) {\r\n if (typeof value == \"function\") {\r\n value = value();\r\n }\r\n if (value != null) {\r\n return String(value);\r\n }\r\n return defaultValue || null;\r\n },\r\n /**\r\n * Convert a value into a size.\r\n *\r\n * @param value - Value to be converted intosize, a function will be executed as `(() => unknown)`.\r\n * @param defaultValue - If the value or the return value of the function == null then this will be returned.\r\n *\r\n * @returns Corresponding string value (number + 'px'), if none then the default value, if none then null.\r\n */\r\n asSize(value, defaultValue) {\r\n if (typeof value == \"function\") {\r\n value = value();\r\n }\r\n if (isString(value)) {\r\n return value;\r\n }\r\n else if (isNumber(value)) {\r\n return value + \"px\";\r\n }\r\n else {\r\n return defaultValue || null;\r\n }\r\n },\r\n /**\r\n * Convert a value into a DOM Element.\r\n *\r\n * @param value - Value to be converted into DOM Element, a function will be executed as `(() => unknown)`.\r\n * @param defaultValue - If the value or the return value of the function == null then this will be returned.\r\n *\r\n * @returns The DOM Element, if none then the default value, if none then null.\r\n */\r\n asElement(value, defaultValue) {\r\n if (typeof value == \"function\") {\r\n value = value();\r\n }\r\n return value || defaultValue || null;\r\n },\r\n};\r\n/**\r\n * Convert hex color string into RGB color object.\r\n *\r\n * @remarks\r\n * {@link http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb}\r\n *\r\n * @param hex - Hex color string (3 or 6 digits, with or without #).\r\n *\r\n * @returns RGB color object.\r\n */\r\nfunction hexToRGB(hex) {\r\n let result;\r\n switch (hex.length) {\r\n case 3:\r\n case 4:\r\n result = shortHexRE.exec(hex);\r\n return result\r\n ? {\r\n r: parseInt(result[1] + result[1], 16),\r\n g: parseInt(result[2] + result[2], 16),\r\n b: parseInt(result[3] + result[3], 16),\r\n }\r\n : null;\r\n case 6:\r\n case 7:\r\n result = fullHexRE.exec(hex);\r\n return result\r\n ? {\r\n r: parseInt(result[1], 16),\r\n g: parseInt(result[2], 16),\r\n b: parseInt(result[3], 16),\r\n }\r\n : null;\r\n default:\r\n return null;\r\n }\r\n}\r\n/**\r\n * This function takes string color in hex or RGB format and adds the opacity, RGBA is passed through unchanged.\r\n *\r\n * @param color - The color string (hex, RGB, RGBA).\r\n * @param opacity - The new opacity.\r\n *\r\n * @returns RGBA string, for example 'rgba(255, 0, 127, 0.3)'.\r\n */\r\nfunction overrideOpacity(color, opacity) {\r\n if (color.includes(\"rgba\")) {\r\n return color;\r\n }\r\n else if (color.includes(\"rgb\")) {\r\n const rgb = color\r\n .substr(color.indexOf(\"(\") + 1)\r\n .replace(\")\", \"\")\r\n .split(\",\");\r\n return \"rgba(\" + rgb[0] + \",\" + rgb[1] + \",\" + rgb[2] + \",\" + opacity + \")\";\r\n }\r\n else {\r\n const rgb = hexToRGB(color);\r\n if (rgb == null) {\r\n return color;\r\n }\r\n else {\r\n return \"rgba(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \",\" + opacity + \")\";\r\n }\r\n }\r\n}\r\n/**\r\n * Convert RGB \\<0, 255\\> into hex color string.\r\n *\r\n * @param red - Red channel.\r\n * @param green - Green channel.\r\n * @param blue - Blue channel.\r\n *\r\n * @returns Hex color string (for example: '#0acdc0').\r\n */\r\nfunction RGBToHex(red, green, blue) {\r\n return (\"#\" + ((1 << 24) + (red << 16) + (green << 8) + blue).toString(16).slice(1));\r\n}\r\n/**\r\n * Parse a color property into an object with border, background, and highlight colors.\r\n *\r\n * @param inputColor - Shorthand color string or input color object.\r\n * @param defaultColor - Full color object to fill in missing values in inputColor.\r\n *\r\n * @returns Color object.\r\n */\r\nfunction parseColor(inputColor, defaultColor) {\r\n if (isString(inputColor)) {\r\n let colorStr = inputColor;\r\n if (isValidRGB(colorStr)) {\r\n const rgb = colorStr\r\n .substr(4)\r\n .substr(0, colorStr.length - 5)\r\n .split(\",\")\r\n .map(function (value) {\r\n return parseInt(value);\r\n });\r\n colorStr = RGBToHex(rgb[0], rgb[1], rgb[2]);\r\n }\r\n if (isValidHex(colorStr) === true) {\r\n const hsv = hexToHSV(colorStr);\r\n const lighterColorHSV = {\r\n h: hsv.h,\r\n s: hsv.s * 0.8,\r\n v: Math.min(1, hsv.v * 1.02),\r\n };\r\n const darkerColorHSV = {\r\n h: hsv.h,\r\n s: Math.min(1, hsv.s * 1.25),\r\n v: hsv.v * 0.8,\r\n };\r\n const darkerColorHex = HSVToHex(darkerColorHSV.h, darkerColorHSV.s, darkerColorHSV.v);\r\n const lighterColorHex = HSVToHex(lighterColorHSV.h, lighterColorHSV.s, lighterColorHSV.v);\r\n return {\r\n background: colorStr,\r\n border: darkerColorHex,\r\n highlight: {\r\n background: lighterColorHex,\r\n border: darkerColorHex,\r\n },\r\n hover: {\r\n background: lighterColorHex,\r\n border: darkerColorHex,\r\n },\r\n };\r\n }\r\n else {\r\n return {\r\n background: colorStr,\r\n border: colorStr,\r\n highlight: {\r\n background: colorStr,\r\n border: colorStr,\r\n },\r\n hover: {\r\n background: colorStr,\r\n border: colorStr,\r\n },\r\n };\r\n }\r\n }\r\n else {\r\n if (defaultColor) {\r\n const color = {\r\n background: inputColor.background || defaultColor.background,\r\n border: inputColor.border || defaultColor.border,\r\n highlight: isString(inputColor.highlight)\r\n ? {\r\n border: inputColor.highlight,\r\n background: inputColor.highlight,\r\n }\r\n : {\r\n background: (inputColor.highlight && inputColor.highlight.background) ||\r\n defaultColor.highlight.background,\r\n border: (inputColor.highlight && inputColor.highlight.border) ||\r\n defaultColor.highlight.border,\r\n },\r\n hover: isString(inputColor.hover)\r\n ? {\r\n border: inputColor.hover,\r\n background: inputColor.hover,\r\n }\r\n : {\r\n border: (inputColor.hover && inputColor.hover.border) ||\r\n defaultColor.hover.border,\r\n background: (inputColor.hover && inputColor.hover.background) ||\r\n defaultColor.hover.background,\r\n },\r\n };\r\n return color;\r\n }\r\n else {\r\n const color = {\r\n background: inputColor.background || undefined,\r\n border: inputColor.border || undefined,\r\n highlight: isString(inputColor.highlight)\r\n ? {\r\n border: inputColor.highlight,\r\n background: inputColor.highlight,\r\n }\r\n : {\r\n background: (inputColor.highlight && inputColor.highlight.background) ||\r\n undefined,\r\n border: (inputColor.highlight && inputColor.highlight.border) ||\r\n undefined,\r\n },\r\n hover: isString(inputColor.hover)\r\n ? {\r\n border: inputColor.hover,\r\n background: inputColor.hover,\r\n }\r\n : {\r\n border: (inputColor.hover && inputColor.hover.border) || undefined,\r\n background: (inputColor.hover && inputColor.hover.background) || undefined,\r\n },\r\n };\r\n return color;\r\n }\r\n }\r\n}\r\n/**\r\n * Convert RGB \\<0, 255\\> into HSV object.\r\n *\r\n * @remarks\r\n * {@link http://www.javascripter.net/faq/rgb2hsv.htm}\r\n *\r\n * @param red - Red channel.\r\n * @param green - Green channel.\r\n * @param blue - Blue channel.\r\n *\r\n * @returns HSV color object.\r\n */\r\nfunction RGBToHSV(red, green, blue) {\r\n red = red / 255;\r\n green = green / 255;\r\n blue = blue / 255;\r\n const minRGB = Math.min(red, Math.min(green, blue));\r\n const maxRGB = Math.max(red, Math.max(green, blue));\r\n // Black-gray-white\r\n if (minRGB === maxRGB) {\r\n return { h: 0, s: 0, v: minRGB };\r\n }\r\n // Colors other than black-gray-white:\r\n const d = red === minRGB ? green - blue : blue === minRGB ? red - green : blue - red;\r\n const h = red === minRGB ? 3 : blue === minRGB ? 1 : 5;\r\n const hue = (60 * (h - d / (maxRGB - minRGB))) / 360;\r\n const saturation = (maxRGB - minRGB) / maxRGB;\r\n const value = maxRGB;\r\n return { h: hue, s: saturation, v: value };\r\n}\r\nconst cssUtil = {\r\n // split a string with css styles into an object with key/values\r\n split(cssText) {\r\n const styles = {};\r\n cssText.split(\";\").forEach((style) => {\r\n if (style.trim() != \"\") {\r\n const parts = style.split(\":\");\r\n const key = parts[0].trim();\r\n const value = parts[1].trim();\r\n styles[key] = value;\r\n }\r\n });\r\n return styles;\r\n },\r\n // build a css text string from an object with key/values\r\n join(styles) {\r\n return Object.keys(styles)\r\n .map(function (key) {\r\n return key + \": \" + styles[key];\r\n })\r\n .join(\"; \");\r\n },\r\n};\r\n/**\r\n * Append a string with css styles to an element.\r\n *\r\n * @param element - The element that will receive new styles.\r\n * @param cssText - The styles to be appended.\r\n */\r\nfunction addCssText(element, cssText) {\r\n const currentStyles = cssUtil.split(element.style.cssText);\r\n const newStyles = cssUtil.split(cssText);\r\n const styles = {\r\n ...currentStyles,\r\n ...newStyles,\r\n };\r\n element.style.cssText = cssUtil.join(styles);\r\n}\r\n/**\r\n * Remove a string with css styles from an element.\r\n *\r\n * @param element - The element from which styles should be removed.\r\n * @param cssText - The styles to be removed.\r\n */\r\nfunction removeCssText(element, cssText) {\r\n const styles = cssUtil.split(element.style.cssText);\r\n const removeStyles = cssUtil.split(cssText);\r\n for (const key in removeStyles) {\r\n if (Object.prototype.hasOwnProperty.call(removeStyles, key)) {\r\n delete styles[key];\r\n }\r\n }\r\n element.style.cssText = cssUtil.join(styles);\r\n}\r\n/**\r\n * Convert HSV \\<0, 1\\> into RGB color object.\r\n *\r\n * @remarks\r\n * {@link https://gist.github.com/mjijackson/5311256}\r\n *\r\n * @param h - Hue.\r\n * @param s - Saturation.\r\n * @param v - Value.\r\n *\r\n * @returns RGB color object.\r\n */\r\nfunction HSVToRGB(h, s, v) {\r\n let r;\r\n let g;\r\n let b;\r\n const i = Math.floor(h * 6);\r\n const f = h * 6 - i;\r\n const p = v * (1 - s);\r\n const q = v * (1 - f * s);\r\n const t = v * (1 - (1 - f) * s);\r\n switch (i % 6) {\r\n case 0:\r\n (r = v), (g = t), (b = p);\r\n break;\r\n case 1:\r\n (r = q), (g = v), (b = p);\r\n break;\r\n case 2:\r\n (r = p), (g = v), (b = t);\r\n break;\r\n case 3:\r\n (r = p), (g = q), (b = v);\r\n break;\r\n case 4:\r\n (r = t), (g = p), (b = v);\r\n break;\r\n case 5:\r\n (r = v), (g = p), (b = q);\r\n break;\r\n }\r\n return {\r\n r: Math.floor(r * 255),\r\n g: Math.floor(g * 255),\r\n b: Math.floor(b * 255),\r\n };\r\n}\r\n/**\r\n * Convert HSV \\<0, 1\\> into hex color string.\r\n *\r\n * @param h - Hue.\r\n * @param s - Saturation.\r\n * @param v - Value.\r\n *\r\n * @returns Hex color string.\r\n */\r\nfunction HSVToHex(h, s, v) {\r\n const rgb = HSVToRGB(h, s, v);\r\n return RGBToHex(rgb.r, rgb.g, rgb.b);\r\n}\r\n/**\r\n * Convert hex color string into HSV \\<0, 1\\>.\r\n *\r\n * @param hex - Hex color string.\r\n *\r\n * @returns HSV color object.\r\n */\r\nfunction hexToHSV(hex) {\r\n const rgb = hexToRGB(hex);\r\n if (!rgb) {\r\n throw new TypeError(`'${hex}' is not a valid color.`);\r\n }\r\n return RGBToHSV(rgb.r, rgb.g, rgb.b);\r\n}\r\n/**\r\n * Validate hex color string.\r\n *\r\n * @param hex - Unknown string that may contain a color.\r\n *\r\n * @returns True if the string is valid, false otherwise.\r\n */\r\nfunction isValidHex(hex) {\r\n const isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex);\r\n return isOk;\r\n}\r\n/**\r\n * Validate RGB color string.\r\n *\r\n * @param rgb - Unknown string that may contain a color.\r\n *\r\n * @returns True if the string is valid, false otherwise.\r\n */\r\nfunction isValidRGB(rgb) {\r\n return rgbRE.test(rgb);\r\n}\r\n/**\r\n * Validate RGBA color string.\r\n *\r\n * @param rgba - Unknown string that may contain a color.\r\n *\r\n * @returns True if the string is valid, false otherwise.\r\n */\r\nfunction isValidRGBA(rgba) {\r\n return rgbaRE.test(rgba);\r\n}\r\n/**\r\n * This recursively redirects the prototype of JSON objects to the referenceObject.\r\n * This is used for default options.\r\n *\r\n * @param fields - Names of properties to be bridged.\r\n * @param referenceObject - The original object.\r\n *\r\n * @returns A new object inheriting from the referenceObject.\r\n */\r\nfunction selectiveBridgeObject(fields, referenceObject) {\r\n if (referenceObject !== null && typeof referenceObject === \"object\") {\r\n // !!! typeof null === 'object'\r\n const objectTo = Object.create(referenceObject);\r\n for (let i = 0; i < fields.length; i++) {\r\n if (Object.prototype.hasOwnProperty.call(referenceObject, fields[i])) {\r\n if (typeof referenceObject[fields[i]] == \"object\") {\r\n objectTo[fields[i]] = bridgeObject(referenceObject[fields[i]]);\r\n }\r\n }\r\n }\r\n return objectTo;\r\n }\r\n else {\r\n return null;\r\n }\r\n}\r\n/**\r\n * This recursively redirects the prototype of JSON objects to the referenceObject.\r\n * This is used for default options.\r\n *\r\n * @param referenceObject - The original object.\r\n *\r\n * @returns The Element if the referenceObject is an Element, or a new object inheriting from the referenceObject.\r\n */\r\nfunction bridgeObject(referenceObject) {\r\n if (referenceObject === null || typeof referenceObject !== \"object\") {\r\n return null;\r\n }\r\n if (referenceObject instanceof Element) {\r\n // Avoid bridging DOM objects\r\n return referenceObject;\r\n }\r\n const objectTo = Object.create(referenceObject);\r\n for (const i in referenceObject) {\r\n if (Object.prototype.hasOwnProperty.call(referenceObject, i)) {\r\n if (typeof referenceObject[i] == \"object\") {\r\n objectTo[i] = bridgeObject(referenceObject[i]);\r\n }\r\n }\r\n }\r\n return objectTo;\r\n}\r\n/**\r\n * This method provides a stable sort implementation, very fast for presorted data.\r\n *\r\n * @param a - The array to be sorted (in-place).\r\n * @param compare - An order comparator.\r\n *\r\n * @returns The argument a.\r\n */\r\nfunction insertSort(a, compare) {\r\n for (let i = 0; i < a.length; i++) {\r\n const k = a[i];\r\n let j;\r\n for (j = i; j > 0 && compare(k, a[j - 1]) < 0; j--) {\r\n a[j] = a[j - 1];\r\n }\r\n a[j] = k;\r\n }\r\n return a;\r\n}\r\n/**\r\n * This is used to set the options of subobjects in the options object.\r\n *\r\n * A requirement of these subobjects is that they have an 'enabled' element\r\n * which is optional for the user but mandatory for the program.\r\n *\r\n * The added value here of the merge is that option 'enabled' is set as required.\r\n *\r\n * @param mergeTarget - Either this.options or the options used for the groups.\r\n * @param options - Options.\r\n * @param option - Option key in the options argument.\r\n * @param globalOptions - Global options, passed in to determine value of option 'enabled'.\r\n */\r\nfunction mergeOptions(mergeTarget, options, option, globalOptions = {}) {\r\n // Local helpers\r\n const isPresent = function (obj) {\r\n return obj !== null && obj !== undefined;\r\n };\r\n const isObject = function (obj) {\r\n return obj !== null && typeof obj === \"object\";\r\n };\r\n // https://stackoverflow.com/a/34491287/1223531\r\n const isEmpty = function (obj) {\r\n for (const x in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, x)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n // Guards\r\n if (!isObject(mergeTarget)) {\r\n throw new Error(\"Parameter mergeTarget must be an object\");\r\n }\r\n if (!isObject(options)) {\r\n throw new Error(\"Parameter options must be an object\");\r\n }\r\n if (!isPresent(option)) {\r\n throw new Error(\"Parameter option must have a value\");\r\n }\r\n if (!isObject(globalOptions)) {\r\n throw new Error(\"Parameter globalOptions must be an object\");\r\n }\r\n //\r\n // Actual merge routine, separated from main logic\r\n // Only a single level of options is merged. Deeper levels are ref'd. This may actually be an issue.\r\n //\r\n const doMerge = function (target, options, option) {\r\n if (!isObject(target[option])) {\r\n target[option] = {};\r\n }\r\n const src = options[option];\r\n const dst = target[option];\r\n for (const prop in src) {\r\n if (Object.prototype.hasOwnProperty.call(src, prop)) {\r\n dst[prop] = src[prop];\r\n }\r\n }\r\n };\r\n // Local initialization\r\n const srcOption = options[option];\r\n const globalPassed = isObject(globalOptions) && !isEmpty(globalOptions);\r\n const globalOption = globalPassed ? globalOptions[option] : undefined;\r\n const globalEnabled = globalOption ? globalOption.enabled : undefined;\r\n /////////////////////////////////////////\r\n // Main routine\r\n /////////////////////////////////////////\r\n if (srcOption === undefined) {\r\n return; // Nothing to do\r\n }\r\n if (typeof srcOption === \"boolean\") {\r\n if (!isObject(mergeTarget[option])) {\r\n mergeTarget[option] = {};\r\n }\r\n mergeTarget[option].enabled = srcOption;\r\n return;\r\n }\r\n if (srcOption === null && !isObject(mergeTarget[option])) {\r\n // If possible, explicit copy from globals\r\n if (isPresent(globalOption)) {\r\n mergeTarget[option] = Object.create(globalOption);\r\n }\r\n else {\r\n return; // Nothing to do\r\n }\r\n }\r\n if (!isObject(srcOption)) {\r\n return;\r\n }\r\n //\r\n // Ensure that 'enabled' is properly set. It is required internally\r\n // Note that the value from options will always overwrite the existing value\r\n //\r\n let enabled = true; // default value\r\n if (srcOption.enabled !== undefined) {\r\n enabled = srcOption.enabled;\r\n }\r\n else {\r\n // Take from globals, if present\r\n if (globalEnabled !== undefined) {\r\n enabled = globalOption.enabled;\r\n }\r\n }\r\n doMerge(mergeTarget, options, option);\r\n mergeTarget[option].enabled = enabled;\r\n}\r\n/**\r\n * This function does a binary search for a visible item in a sorted list. If we find a visible item, the code that uses\r\n * this function will then iterate in both directions over this sorted list to find all visible items.\r\n *\r\n * @param orderedItems - Items ordered by start.\r\n * @param comparator - -1 is lower, 0 is equal, 1 is higher.\r\n * @param field - Property name on an item (That is item[field]).\r\n * @param field2 - Second property name on an item (That is item[field][field2]).\r\n *\r\n * @returns Index of the found item or -1 if nothing was found.\r\n */\r\nfunction binarySearchCustom(orderedItems, comparator, field, field2) {\r\n const maxIterations = 10000;\r\n let iteration = 0;\r\n let low = 0;\r\n let high = orderedItems.length - 1;\r\n while (low <= high && iteration < maxIterations) {\r\n const middle = Math.floor((low + high) / 2);\r\n const item = orderedItems[middle];\r\n const value = field2 === undefined ? item[field] : item[field][field2];\r\n const searchResult = comparator(value);\r\n if (searchResult == 0) {\r\n // jihaa, found a visible item!\r\n return middle;\r\n }\r\n else if (searchResult == -1) {\r\n // it is too small --> increase low\r\n low = middle + 1;\r\n }\r\n else {\r\n // it is too big --> decrease high\r\n high = middle - 1;\r\n }\r\n iteration++;\r\n }\r\n return -1;\r\n}\r\n/**\r\n * This function does a binary search for a specific value in a sorted array.\r\n * If it does not exist but is in between of two values, we return either the\r\n * one before or the one after, depending on user input If it is found, we\r\n * return the index, else -1.\r\n *\r\n * @param orderedItems - Sorted array.\r\n * @param target - The searched value.\r\n * @param field - Name of the property in items to be searched.\r\n * @param sidePreference - If the target is between two values, should the index of the before or the after be returned?\r\n * @param comparator - An optional comparator, returning -1, 0, 1 for \\<, ===, \\>.\r\n *\r\n * @returns The index of found value or -1 if nothing was found.\r\n */\r\nfunction binarySearchValue(orderedItems, target, field, sidePreference, comparator) {\r\n const maxIterations = 10000;\r\n let iteration = 0;\r\n let low = 0;\r\n let high = orderedItems.length - 1;\r\n let prevValue;\r\n let value;\r\n let nextValue;\r\n let middle;\r\n comparator =\r\n comparator != undefined\r\n ? comparator\r\n : function (a, b) {\r\n return a == b ? 0 : a < b ? -1 : 1;\r\n };\r\n while (low <= high && iteration < maxIterations) {\r\n // get a new guess\r\n middle = Math.floor(0.5 * (high + low));\r\n prevValue = orderedItems[Math.max(0, middle - 1)][field];\r\n value = orderedItems[middle][field];\r\n nextValue =\r\n orderedItems[Math.min(orderedItems.length - 1, middle + 1)][field];\r\n if (comparator(value, target) == 0) {\r\n // we found the target\r\n return middle;\r\n }\r\n else if (comparator(prevValue, target) < 0 &&\r\n comparator(value, target) > 0) {\r\n // target is in between of the previous and the current\r\n return sidePreference == \"before\" ? Math.max(0, middle - 1) : middle;\r\n }\r\n else if (comparator(value, target) < 0 &&\r\n comparator(nextValue, target) > 0) {\r\n // target is in between of the current and the next\r\n return sidePreference == \"before\"\r\n ? middle\r\n : Math.min(orderedItems.length - 1, middle + 1);\r\n }\r\n else {\r\n // didnt find the target, we need to change our boundaries.\r\n if (comparator(value, target) < 0) {\r\n // it is too small --> increase low\r\n low = middle + 1;\r\n }\r\n else {\r\n // it is too big --> decrease high\r\n high = middle - 1;\r\n }\r\n }\r\n iteration++;\r\n }\r\n // didnt find anything. Return -1.\r\n return -1;\r\n}\r\n/*\r\n * Easing Functions.\r\n * Only considering the t value for the range [0, 1] => [0, 1].\r\n *\r\n * Inspiration: from http://gizma.com/easing/\r\n * https://gist.github.com/gre/1650294\r\n */\r\nconst easingFunctions = {\r\n /**\r\n * Provides no easing and no acceleration.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n linear(t) {\r\n return t;\r\n },\r\n /**\r\n * Accelerate from zero velocity.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeInQuad(t) {\r\n return t * t;\r\n },\r\n /**\r\n * Decelerate to zero velocity.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeOutQuad(t) {\r\n return t * (2 - t);\r\n },\r\n /**\r\n * Accelerate until halfway, then decelerate.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeInOutQuad(t) {\r\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\r\n },\r\n /**\r\n * Accelerate from zero velocity.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeInCubic(t) {\r\n return t * t * t;\r\n },\r\n /**\r\n * Decelerate to zero velocity.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeOutCubic(t) {\r\n return --t * t * t + 1;\r\n },\r\n /**\r\n * Accelerate until halfway, then decelerate.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeInOutCubic(t) {\r\n return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\r\n },\r\n /**\r\n * Accelerate from zero velocity.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeInQuart(t) {\r\n return t * t * t * t;\r\n },\r\n /**\r\n * Decelerate to zero velocity.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeOutQuart(t) {\r\n return 1 - --t * t * t * t;\r\n },\r\n /**\r\n * Accelerate until halfway, then decelerate.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeInOutQuart(t) {\r\n return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;\r\n },\r\n /**\r\n * Accelerate from zero velocity.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeInQuint(t) {\r\n return t * t * t * t * t;\r\n },\r\n /**\r\n * Decelerate to zero velocity.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeOutQuint(t) {\r\n return 1 + --t * t * t * t * t;\r\n },\r\n /**\r\n * Accelerate until halfway, then decelerate.\r\n *\r\n * @param t - Time.\r\n *\r\n * @returns Value at time t.\r\n */\r\n easeInOutQuint(t) {\r\n return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;\r\n },\r\n};\r\n/**\r\n * Experimentaly compute the width of the scrollbar for this browser.\r\n *\r\n * @returns The width in pixels.\r\n */\r\nfunction getScrollBarWidth() {\r\n const inner = document.createElement(\"p\");\r\n inner.style.width = \"100%\";\r\n inner.style.height = \"200px\";\r\n const outer = document.createElement(\"div\");\r\n outer.style.position = \"absolute\";\r\n outer.style.top = \"0px\";\r\n outer.style.left = \"0px\";\r\n outer.style.visibility = \"hidden\";\r\n outer.style.width = \"200px\";\r\n outer.style.height = \"150px\";\r\n outer.style.overflow = \"hidden\";\r\n outer.appendChild(inner);\r\n document.body.appendChild(outer);\r\n const w1 = inner.offsetWidth;\r\n outer.style.overflow = \"scroll\";\r\n let w2 = inner.offsetWidth;\r\n if (w1 == w2) {\r\n w2 = outer.clientWidth;\r\n }\r\n document.body.removeChild(outer);\r\n return w1 - w2;\r\n}\r\n// @TODO: This doesn't work properly.\r\n// It works only for single property objects,\r\n// otherwise it combines all of the types in a union.\r\n// export function topMost<K1 extends string, V1> (\r\n// pile: Record<K1, undefined | V1>[],\r\n// accessors: K1 | [K1]\r\n// ): undefined | V1\r\n// export function topMost<K1 extends string, K2 extends string, V1, V2> (\r\n// pile: Record<K1, undefined | V1 | Record<K2, undefined | V2>>[],\r\n// accessors: [K1, K2]\r\n// ): undefined | V1 | V2\r\n// export function topMost<K1 extends string, K2 extends string, K3 extends string, V1, V2, V3> (\r\n// pile: Record<K1, undefined | V1 | Record<K2, undefined | V2 | Record<K3, undefined | V3>>>[],\r\n// accessors: [K1, K2, K3]\r\n// ): undefined | V1 | V2 | V3\r\n/**\r\n * Get the top most property value from a pile of objects.\r\n *\r\n * @param pile - Array of objects, no required format.\r\n * @param accessors - Array of property names.\r\n * For example `object['foo']['bar']` → `['foo', 'bar']`.\r\n *\r\n * @returns Value of the property with given accessors path from the first pile item where it's not undefined.\r\n */\r\nfunction topMost(pile, accessors) {\r\n let candidate;\r\n if (!Array.isArray(accessors)) {\r\n accessors = [accessors];\r\n }\r\n for (const member of pile) {\r\n if (member) {\r\n candidate = member[accessors[0]];\r\n for (let i = 1; i < accessors.length; i++) {\r\n if (candidate) {\r\n candidate = candidate[accessors[i]];\r\n }\r\n }\r\n if (typeof candidate !== \"undefined\") {\r\n break;\r\n }\r\n }\r\n }\r\n return candidate;\r\n}\n\nconst htmlColors = {\n black: \"#000000\",\n navy: \"#000080\",\n darkblue: \"#00008B\",\n mediumblue: \"#0000CD\",\n blue: \"#0000FF\",\n darkgreen: \"#006400\",\n green: \"#008000\",\n teal: \"#008080\",\n darkcyan: \"#008B8B\",\n deepskyblue: \"#00BFFF\",\n darkturquoise: \"#00CED1\",\n mediumspringgreen: \"#00FA9A\",\n lime: \"#00FF00\",\n springgreen: \"#00FF7F\",\n aqua: \"#00FFFF\",\n cyan: \"#00FFFF\",\n midnightblue: \"#191970\",\n dodgerblue: \"#1E90FF\",\n lightseagreen: \"#20B2AA\",\n forestgreen: \"#228B22\",\n seagreen: \"#2E8B57\",\n darkslategray: \"#2F4F4F\",\n limegreen: \"#32CD32\",\n mediumseagreen: \"#3CB371\",\n turquoise: \"#40E0D0\",\n royalblue: \"#4169E1\",\n steelblue: \"#4682B4\",\n darkslateblue: \"#483D8B\",\n mediumturquoise: \"#48D1CC\",\n indigo: \"#4B0082\",\n darkolivegreen: \"#556B2F\",\n cadetblue: \"#5F9EA0\",\n cornflowerblue: \"#6495ED\",\n mediumaquamarine: \"#66CDAA\",\n dimgray: \"#696969\",\n slateblue: \"#6A5ACD\",\n olivedrab: \"#6B8E23\",\n slategray: \"#708090\",\n lightslategray: \"#778899\",\n mediumslateblue: \"#7B68EE\",\n lawngreen: \"#7CFC00\",\n chartreuse: \"#7FFF00\",\n aquamarine: \"#7FFFD4\",\n maroon: \"#800000\",\n purple: \"#800080\",\n olive: \"#808000\",\n gray: \"#808080\",\n skyblue: \"#87CEEB\",\n lightskyblue: \"#87CEFA\",\n blueviolet: \"#8A2BE2\",\n darkred: \"#8B0000\",\n darkmagenta: \"#8B008B\",\n saddlebrown: \"#8B4513\",\n darkseagreen: \"#8FBC8F\",\n lightgreen: \"#90EE90\",\n mediumpurple: \"#9370D8\",\n darkviolet: \"#9400D3\",\n palegreen: \"#98FB98\",\n darkorchid: \"#9932CC\",\n yellowgreen: \"#9ACD32\",\n sienna: \"#A0522D\",\n brown: \"#A52A2A\",\n darkgray: \"#A9A9A9\",\n lightblue: \"#ADD8E6\",\n greenyellow: \"#ADFF2F\",\n paleturquoise: \"#AFEEEE\",\n lightsteelblue: \"#B0C4DE\",\n powderblue: \"#B0E0E6\",\n firebrick: \"#B22222\",\n darkgoldenrod: \"#B8860B\",\n mediumorchid: \"#BA55D3\",\n rosybrown: \"#BC8F8F\",\n darkkhaki: \"#BDB76B\",\n silver: \"#C0C0C0\",\n mediumvioletred: \"#C71585\",\n indianred: \"#CD5C5C\",\n peru: \"#CD853F\",\n chocolate: \"#D2691E\",\n tan: \"#D2B48C\",\n lightgrey: \"#D3D3D3\",\n palevioletred: \"#D87093\",\n thistle: \"#D8BFD8\",\n orchid: \"#DA70D6\",\n goldenrod: \"#DAA520\",\n crimson: \"#DC143C\",\n gainsboro: \"#DCDCDC\",\n plum: \"#DDA0DD\",\n burlywood: \"#DEB887\",\n lightcyan: \"#E0FFFF\",\n lavender: \"#E6E6FA\",\n darksalmon: \"#E9967A\",\n violet: \"#EE82EE\",\n palegoldenrod: \"#EEE8AA\",\n lightcoral: \"#F08080\",\n khaki: \"#F0E68C\",\n aliceblue: \"#F0F8FF\",\n honeydew: \"#F0FFF0\",\n azure: \"#F0FFFF\",\n sandybrown: \"#F4A460\",\n wheat: \"#F5DEB3\",\n beige: \"#F5F5DC\",\n whitesmoke: \"#F5F5F5\",\n mintcream: \"#F5FFFA\",\n ghostwhite: \"#F8F8FF\",\n salmon: \"#FA8072\",\n antiquewhite: \"#FAEBD7\",\n linen: \"#FAF0E6\",\n lightgoldenrodyellow: \"#FAFAD2\",\n oldlace: \"#FDF5E6\",\n red: \"#FF0000\",\n fuchsia: \"#FF00FF\",\n magenta: \"#FF00FF\",\n deeppink: \"#FF1493\",\n orangered: \"#FF4500\",\n tomato: \"#FF6347\",\n hotpink: \"#FF69B4\",\n coral: \"#FF7F50\",\n darkorange: \"#FF8C00\",\n lightsalmon: \"#FFA07A\",\n orange: \"#FFA500\",\n lightpink: \"#FFB6C1\",\n pink: \"#FFC0CB\",\n gold: \"#FFD700\",\n peachpuff: \"#FFDAB9\",\n navajowhite: \"#FFDEAD\",\n moccasin: \"#FFE4B5\",\n bisque: \"#FFE4C4\",\n mistyrose: \"#FFE4E1\",\n blanchedalmond: \"#FFEBCD\",\n papayawhip: \"#FFEFD5\",\n lavenderblush: \"#FFF0F5\",\n seashell: \"#FFF5EE\",\n cornsilk: \"#FFF8DC\",\n lemonchiffon: \"#FFFACD\",\n floralwhite: \"#FFFAF0\",\n snow: \"#FFFAFA\",\n yellow: \"#FFFF00\",\n lightyellow: \"#FFFFE0\",\n ivory: \"#FFFFF0\",\n white: \"#FFFFFF\",\n};\n\n/**\n * @param {number} [pixelRatio=1]\n */\nclass ColorPicker {\n /**\n * @param {number} [pixelRatio=1]\n */\n constructor(pixelRatio = 1) {\n this.pixelRatio = pixelRatio;\n this.generated = false;\n this.centerCoordinates = { x: 289 / 2, y: 289 / 2 };\n this.r = 289 * 0.49;\n this.color = { r: 255, g: 255, b: 255, a: 1.0 };\n this.hueCircle = undefined;\n this.initialColor = { r: 255, g: 255, b: 255, a: 1.0 };\n this.previousColor = undefined;\n this.applied = false;\n\n // bound by\n this.updateCallback = () => {};\n this.closeCallback = () => {};\n\n // create all DOM elements\n this._create();\n }\n\n /**\n * this inserts the colorPicker into a div from the DOM\n *\n * @param {Element} container\n */\n insertTo(container) {\n if (this.hammer !== undefined) {\n this.hammer.destroy();\n this.hammer = undefined;\n }\n this.container = container;\n this.container.appendChild(this.frame);\n this._bindHammer();\n\n this._setSize();\n }\n\n /**\n * the callback is executed on apply and save. Bind it to the application\n *\n * @param {Function} callback\n */\n setUpdateCallback(callback) {\n if (typeof callback === \"function\") {\n this.updateCallback = callback;\n } else {\n throw new Error(\n \"Function attempted to set as colorPicker update callback is not a function.\"\n );\n }\n }\n\n /**\n * the callback is executed on apply and save. Bind it to the application\n *\n * @param {Function} callback\n */\n setCloseCallback(callback) {\n if (typeof callback === \"function\") {\n this.closeCallback = callback;\n } else {\n throw new Error(\n \"Function attempted to set as colorPicker closing callback is not a function.\"\n );\n }\n }\n\n /**\n *\n * @param {string} color\n * @returns {string}\n * @private\n */\n _isColorString(color) {\n if (typeof color === \"string\") {\n return htmlColors[color];\n }\n }\n\n /**\n * Set the color of the colorPicker\n * Supported formats:\n * 'red' --> HTML color string\n * '#ffffff' --> hex string\n * 'rgb(255,255,255)' --> rgb string\n * 'rgba(255,255,255,1.0)' --> rgba string\n * {r:255,g:255,b:255} --> rgb object\n * {r:255,g:255,b:255,a:1.0} --> rgba object\n *\n * @param {string | object} color\n * @param {boolean} [setInitial=true]\n */\n setColor(color, setInitial = true) {\n if (color === \"none\") {\n return;\n }\n\n let rgba;\n\n // if a html color shorthand is used, convert to hex\n const htmlColor = this._isColorString(color);\n if (htmlColor !== undefined) {\n color = htmlColor;\n }\n\n // check format\n if (isString(color) === true) {\n if (isValidRGB(color) === true) {\n const rgbaArray = color\n .substr(4)\n .substr(0, color.length - 5)\n .split(\",\");\n rgba = { r: rgbaArray[0], g: rgbaArray[1], b: rgbaArray[2], a: 1.0 };\n } else if (isValidRGBA(color) === true) {\n const rgbaArray = color\n .substr(5)\n .substr(0, color.length - 6)\n .split(\",\");\n rgba = {\n r: rgbaArray[0],\n g: rgbaArray[1],\n b: rgbaArray[2],\n a: rgbaArray[3],\n };\n } else if (isValidHex(color) === true) {\n const rgbObj = hexToRGB(color);\n rgba = { r: rgbObj.r, g: rgbObj.g, b: rgbObj.b, a: 1.0 };\n }\n } else {\n if (color instanceof Object) {\n if (\n color.r !== undefined &&\n color.g !== undefined &&\n color.b !== undefined\n ) {\n const alpha = color.a !== undefined ? color.a : \"1.0\";\n rgba = { r: color.r, g: color.g, b: color.b, a: alpha };\n }\n }\n }\n\n // set color\n if (rgba === undefined) {\n throw new Error(\n \"Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: \" +\n JSON.stringify(color)\n );\n } else {\n this._setColor(rgba, setInitial);\n }\n }\n\n /**\n * this shows the color picker.\n * The hue circle is constructed once and stored.\n */\n show() {\n if (this.closeCallback !== undefined) {\n this.closeCallback();\n this.closeCallback = undefined;\n }\n\n this.applied = false;\n this.frame.style.display = \"block\";\n this._generateHueCircle();\n }\n\n // ------------------------------------------ PRIVATE ----------------------------- //\n\n /**\n * Hide the picker. Is called by the cancel button.\n * Optional boolean to store the previous color for easy access later on.\n *\n * @param {boolean} [storePrevious=true]\n * @private\n */\n _hide(storePrevious = true) {\n // store the previous color for next time;\n if (storePrevious === true) {\n this.previousColor = Object.assign({}, this.color);\n }\n\n if (this.applied === true) {\n this.updateCallback(this.initialColor);\n }\n\n this.frame.style.display = \"none\";\n\n // call the closing callback, restoring the onclick method.\n // this is in a setTimeout because it will trigger the show again before the click is done.\n setTimeout(() => {\n if (this.closeCallback !== undefined) {\n this.closeCallback();\n this.closeCallback = undefined;\n }\n }, 0);\n }\n\n /**\n * bound to the save button. Saves and hides.\n *\n * @private\n */\n _save() {\n this.updateCallback(this.color);\n this.applied = false;\n this._hide();\n }\n\n /**\n * Bound to apply button. Saves but does not close. Is undone by the cancel button.\n *\n * @private\n */\n _apply() {\n this.applied = true;\n this.updateCallback(this.color);\n this._updatePicker(this.color);\n }\n\n /**\n * load the color from the previous session.\n *\n * @private\n */\n _loadLast() {\n if (this.previousColor !== undefined) {\n this.setColor(this.previousColor, false);\n } else {\n alert(\"There is no last color to load...\");\n }\n }\n\n /**\n * set the color, place the picker\n *\n * @param {object} rgba\n * @param {boolean} [setInitial=true]\n * @private\n */\n _setColor(rgba, setInitial = true) {\n // store the initial color\n if (setInitial === true) {\n this.initialColor = Object.assign({}, rgba);\n }\n\n this.color = rgba;\n const hsv = RGBToHSV(rgba.r, rgba.g, rgba.b);\n\n const angleConvert = 2 * Math.PI;\n const radius = this.r * hsv.s;\n const x =\n this.centerCoordinates.x + radius * Math.sin(angleConvert * hsv.h);\n const y =\n this.centerCoordinates.y + radius * Math.cos(angleConvert * hsv.h);\n\n this.colorPickerSelector.style.left =\n x - 0.5 * this.colorPickerSelector.clientWidth + \"px\";\n this.colorPickerSelector.style.top =\n y - 0.5 * this.colorPickerSelector.clientHeight + \"px\";\n\n this._updatePicker(rgba);\n }\n\n /**\n * bound to opacity control\n *\n * @param {number} value\n * @private\n */\n _setOpacity(value) {\n this.color.a = value / 100;\n this._updatePicker(this.color);\n }\n\n /**\n * bound to brightness control\n *\n * @param {number} value\n * @private\n */\n _setBrightness(value) {\n const hsv = RGBToHSV(this.color.r, this.color.g, this.color.b);\n hsv.v = value / 100;\n const rgba = HSVToRGB(hsv.h, hsv.s, hsv.v);\n rgba[\"a\"] = this.color.a;\n this.color = rgba;\n this._updatePicker();\n }\n\n /**\n * update the color picker. A black circle overlays the hue circle to mimic the brightness decreasing.\n *\n * @param {object} rgba\n * @private\n */\n _updatePicker(rgba = this.color) {\n const hsv = RGBToHSV(rgba.r, rgba.g, rgba.b);\n const ctx = this.colorPickerCanvas.getContext(\"2d\");\n if (this.pixelRation === undefined) {\n this.pixelRatio =\n (window.devicePixelRatio || 1) /\n (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio ||\n 1);\n }\n ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\n // clear the canvas\n const w = this.colorPickerCanvas.clientWidth;\n const h = this.colorPickerCanvas.clientHeight;\n ctx.clearRect(0, 0, w, h);\n\n ctx.putImageData(this.hueCircle, 0, 0);\n ctx.fillStyle = \"rgba(0,0,0,\" + (1 - hsv.v) + \")\";\n ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);\n ctx.fill();\n\n this.brightnessRange.value = 100 * hsv.v;\n this.opacityRange.value = 100 * rgba.a;\n\n this.initialColorDiv.style.backgroundColor =\n \"rgba(\" +\n this.initialColor.r +\n \",\" +\n this.initialColor.g +\n \",\" +\n this.initialColor.b +\n \",\" +\n this.initialColor.a +\n \")\";\n this.newColorDiv.style.backgroundColor =\n \"rgba(\" +\n this.color.r +\n \",\" +\n this.color.g +\n \",\" +\n this.color.b +\n \",\" +\n this.color.a +\n \")\";\n }\n\n /**\n * used by create to set the size of the canvas.\n *\n * @private\n */\n _setSize() {\n this.colorPickerCanvas.style.width = \"100%\";\n this.colorPickerCanvas.style.height = \"100%\";\n\n this.colorPickerCanvas.width = 289 * this.pixelRatio;\n this.colorPickerCanvas.height = 289 * this.pixelRatio;\n }\n\n /**\n * create all dom elements\n * TODO: cleanup, lots of similar dom elements\n *\n * @private\n */\n _create() {\n this.frame = document.createElement(\"div\");\n this.frame.className = \"vis-color-picker\";\n\n this.colorPickerDiv = document.createElement(\"div\");\n this.colorPickerSelector = document.createElement(\"div\");\n this.colorPickerSelector.className = \"vis-selector\";\n this.colorPickerDiv.appendChild(this.colorPickerSelector);\n\n this.colorPickerCanvas = document.createElement(\"canvas\");\n this.colorPickerDiv.appendChild(this.colorPickerCanvas);\n\n if (!this.colorPickerCanvas.getContext) {\n const noCanvas = document.createElement(\"DIV\");\n noCanvas.style.color = \"red\";\n noCanvas.style.fontWeight = \"bold\";\n noCanvas.style.padding = \"10px\";\n noCanvas.innerText = \"Error: your browser does not support HTML canvas\";\n this.colorPickerCanvas.appendChild(noCanvas);\n } else {\n const ctx = this.colorPickerCanvas.getContext(\"2d\");\n this.pixelRatio =\n (window.devicePixelRatio || 1) /\n (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio ||\n 1);\n this.colorPickerCanvas\n .getContext(\"2d\")\n .setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n }\n\n this.colorPickerDiv.className = \"vis-color\";\n\n this.opacityDiv = document.createElement(\"div\");\n this.opacityDiv.className = \"vis-opacity\";\n\n this.brightnessDiv = document.createElement(\"div\");\n this.brightnessDiv.className = \"vis-brightness\";\n\n this.arrowDiv = document.createElement(\"div\");\n this.arrowDiv.className = \"vis-arrow\";\n\n this.opacityRange = document.createElement(\"input\");\n try {\n this.opacityRange.type = \"range\"; // Not supported on IE9\n this.opacityRange.min = \"0\";\n this.opacityRange.max = \"100\";\n } catch (err) {\n // TODO: Add some error handling.\n }\n this.opacityRange.value = \"100\";\n this.opacityRange.className = \"vis-range\";\n\n this.brightnessRange = document.createElement(\"input\");\n try {\n this.brightnessRange.type = \"range\"; // Not supported on IE9\n this.brightnessRange.min = \"0\";\n this.brightnessRange.max = \"100\";\n } catch (err) {\n // TODO: Add some error handling.\n }\n this.brightnessRange.value = \"100\";\n this.brightnessRange.className = \"vis-range\";\n\n this.opacityDiv.appendChild(this.opacityRange);\n this.brightnessDiv.appendChild(this.brightnessRange);\n\n const me = this;\n this.opacityRange.onchange = function () {\n me._setOpacity(this.value);\n };\n this.opacityRange.oninput = function () {\n me._setOpacity(this.value);\n };\n this.brightnessRange.onchange = function () {\n me._setBrightness(this.value);\n };\n this.brightnessRange.oninput = function () {\n me._setBrightness(this.value);\n };\n\n this.brightnessLabel = document.createElement(\"div\");\n this.brightnessLabel.className = \"vis-label vis-brightness\";\n this.brightnessLabel.innerText = \"brightness:\";\n\n this.opacityLabel = document.createElement(\"div\");\n this.opacityLabel.className = \"vis-label vis-opacity\";\n this.opacityLabel.innerText = \"opacity:\";\n\n this.newColorDiv = document.createElement(\"div\");\n this.newColorDiv.className = \"vis-new-color\";\n this.newColorDiv.innerText = \"new\";\n\n this.initialColorDiv = document.createElement(\"div\");\n this.initialColorDiv.className = \"vis-initial-color\";\n this.initialColorDiv.innerText = \"initial\";\n\n this.cancelButton = document.createElement(\"div\");\n this.cancelButton.className = \"vis-button vis-cancel\";\n this.cancelButton.innerText = \"cancel\";\n this.cancelButton.onclick = this._hide.bind(this, false);\n\n this.applyButton = document.createElement(\"div\");\n this.applyButton.className = \"vis-button vis-apply\";\n this.applyButton.innerText = \"apply\";\n this.applyButton.onclick = this._apply.bind(this);\n\n this.saveButton = document.createElement(\"div\");\n this.saveButton.className = \"vis-button vis-save\";\n this.saveButton.innerText = \"save\";\n this.saveButton.onclick = this._save.bind(this);\n\n this.loadButton = document.createElement(\"div\");\n this.loadButton.className = \"vis-button vis-load\";\n this.loadButton.innerText = \"load last\";\n this.loadButton.onclick = this._loadLast.bind(this);\n\n this.frame.appendChild(this.colorPickerDiv);\n this.frame.appendChild(this.arrowDiv);\n this.frame.appendChild(this.brightnessLabel);\n this.frame.appendChild(this.brightnessDiv);\n this.frame.appendChild(this.opacityLabel);\n this.frame.appendChild(this.opacityDiv);\n this.frame.appendChild(this.newColorDiv);\n this.frame.appendChild(this.initialColorDiv);\n\n this.frame.appendChild(this.cancelButton);\n this.frame.appendChild(this.applyButton);\n this.frame.appendChild(this.saveButton);\n this.frame.appendChild(this.loadButton);\n }\n\n /**\n * bind hammer to the color picker\n *\n * @private\n */\n _bindHammer() {\n this.drag = {};\n this.pinch = {};\n this.hammer = new Hammer(this.colorPickerCanvas);\n this.hammer.get(\"pinch\").set({ enable: true });\n\n this.hammer.on(\"hammer.input\", (event) => {\n if (event.isFirst) {\n this._moveSelector(event);\n }\n });\n this.hammer.on(\"tap\", (event) => {\n this._moveSelector(event);\n });\n this.hammer.on(\"panstart\", (event) => {\n this._moveSelector(event);\n });\n this.hammer.on(\"panmove\", (event) => {\n this._moveSelector(event);\n });\n this.hammer.on(\"panend\", (event) => {\n this._moveSelector(event);\n });\n }\n\n /**\n * generate the hue circle. This is relatively heavy (200ms) and is done only once on the first time it is shown.\n *\n * @private\n */\n _generateHueCircle() {\n if (this.generated === false) {\n const ctx = this.colorPickerCanvas.getContext(\"2d\");\n if (this.pixelRation === undefined) {\n this.pixelRatio =\n (window.devicePixelRatio || 1) /\n (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio ||\n 1);\n }\n ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\n // clear the canvas\n const w = this.colorPickerCanvas.clientWidth;\n const h = this.colorPickerCanvas.clientHeight;\n ctx.clearRect(0, 0, w, h);\n\n // draw hue circle\n let x, y, hue, sat;\n this.centerCoordinates = { x: w * 0.5, y: h * 0.5 };\n this.r = 0.49 * w;\n const angleConvert = (2 * Math.PI) / 360;\n const hfac = 1 / 360;\n const sfac = 1 / this.r;\n let rgb;\n for (hue = 0; hue < 360; hue++) {\n for (sat = 0; sat < this.r; sat++) {\n x = this.centerCoordinates.x + sat * Math.sin(angleConvert * hue);\n y = this.centerCoordinates.y + sat * Math.cos(angleConvert * hue);\n rgb = HSVToRGB(hue * hfac, sat * sfac, 1);\n ctx.fillStyle = \"rgb(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \")\";\n ctx.fillRect(x - 0.5, y - 0.5, 2, 2);\n }\n }\n ctx.strokeStyle = \"rgba(0,0,0,1)\";\n ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);\n ctx.stroke();\n\n this.hueCircle = ctx.getImageData(0, 0, w, h);\n }\n this.generated = true;\n }\n\n /**\n * move the selector. This is called by hammer functions.\n *\n * @param {Event} event The event\n * @private\n */\n _moveSelector(event) {\n const rect = this.colorPickerDiv.getBoundingClientRect();\n const left = event.center.x - rect.left;\n const top = event.center.y - rect.top;\n\n const centerY = 0.5 * this.colorPickerDiv.clientHeight;\n const centerX = 0.5 * this.colorPickerDiv.clientWidth;\n\n const x = left - centerX;\n const y = top - centerY;\n\n const angle = Math.atan2(x, y);\n const radius = 0.98 * Math.min(Math.sqrt(x * x + y * y), centerX);\n\n const newTop = Math.cos(angle) * radius + centerY;\n const newLeft = Math.sin(angle) * radius + centerX;\n\n this.colorPickerSelector.style.top =\n newTop - 0.5 * this.colorPickerSelector.clientHeight + \"px\";\n this.colorPickerSelector.style.left =\n newLeft - 0.5 * this.colorPickerSelector.clientWidth + \"px\";\n\n // set color\n let h = angle / (2 * Math.PI);\n h = h < 0 ? h + 1 : h;\n const s = radius / this.r;\n const hsv = RGBToHSV(this.color.r, this.color.g, this.color.b);\n hsv.h = h;\n hsv.s = s;\n const rgba = HSVToRGB(hsv.h, hsv.s, hsv.v);\n rgba[\"a\"] = this.color.a;\n this.color = rgba;\n\n // update previews\n this.initialColorDiv.style.backgroundColor =\n \"rgba(\" +\n this.initialColor.r +\n \",\" +\n this.initialColor.g +\n \",\" +\n this.initialColor.b +\n \",\" +\n this.initialColor.a +\n \")\";\n this.newColorDiv.style.backgroundColor =\n \"rgba(\" +\n this.color.r +\n \",\" +\n this.color.g +\n \",\" +\n this.color.b +\n \",\" +\n this.color.a +\n \")\";\n }\n}\n\n/**\n * Wrap given text (last argument) in HTML elements (all preceding arguments).\n *\n * @param {...any} rest - List of tag names followed by inner text.\n *\n * @returns An element or a text node.\n */\nfunction wrapInTag(...rest) {\n if (rest.length < 1) {\n throw new TypeError(\"Invalid arguments.\");\n } else if (rest.length === 1) {\n return document.createTextNode(rest[0]);\n } else {\n const element = document.createElement(rest[0]);\n element.appendChild(wrapInTag(...rest.slice(1)));\n return element;\n }\n}\n\n/**\n * The way this works is for all properties of this.possible options, you can supply the property name in any form to list the options.\n * Boolean options are recognised as Boolean\n * Number options should be written as array: [default value, min value, max value, stepsize]\n * Colors should be written as array: ['color', '#ffffff']\n * Strings with should be written as array: [option1, option2, option3, ..]\n *\n * The options are matched with their counterparts in each of the modules and the values used in the configuration are\n */\nclass Configurator {\n /**\n * @param {object} parentModule | the location where parentModule.setOptions() can be called\n * @param {object} defaultContainer | the default container of the module\n * @param {object} configureOptions | the fully configured and predefined options set found in allOptions.js\n * @param {number} pixelRatio | canvas pixel ratio\n * @param {Function} hideOption | custom logic to dynamically hide options\n */\n constructor(\n parentModule,\n defaultContainer,\n configureOptions,\n pixelRatio = 1,\n hideOption = () => false\n ) {\n this.parent = parentModule;\n this.changedOptions = [];\n this.container = defaultContainer;\n this.allowCreation = false;\n this.hideOption = hideOption;\n\n this.options = {};\n this.initialized = false;\n this.popupCounter = 0;\n this.defaultOptions = {\n enabled: false,\n filter: true,\n container: undefined,\n showButton: true,\n };\n Object.assign(this.options, this.defaultOptions);\n\n this.configureOptions = configureOptions;\n this.moduleOptions = {};\n this.domElements = [];\n this.popupDiv = {};\n this.popupLimit = 5;\n this.popupHistory = {};\n this.colorPicker = new ColorPicker(pixelRatio);\n this.wrapper = undefined;\n }\n\n /**\n * refresh all options.\n * Because all modules parse their options by themselves, we just use their options. We copy them here.\n *\n * @param {object} options\n */\n setOptions(options) {\n if (options !== undefined) {\n // reset the popup history because the indices may have been changed.\n this.popupHistory = {};\n this._removePopup();\n\n let enabled = true;\n if (typeof options === \"string\") {\n this.options.filter = options;\n } else if (Array.isArray(options)) {\n this.options.filter = options.join();\n } else if (typeof options === \"object\") {\n if (options == null) {\n throw new TypeError(\"options cannot be null\");\n }\n if (options.container !== undefined) {\n this.options.container = options.container;\n }\n if (options.filter !== undefined) {\n this.options.filter = options.filter;\n }\n if (options.showButton !== undefined) {\n this.options.showButton = options.showButton;\n }\n if (options.enabled !== undefined) {\n enabled = options.enabled;\n }\n } else if (typeof options === \"boolean\") {\n this.options.filter = true;\n enabled = options;\n } else if (typeof options === \"function\") {\n this.options.filter = options;\n enabled = true;\n }\n if (this.options.filter === false) {\n enabled = false;\n }\n\n this.options.enabled = enabled;\n }\n this._clean();\n }\n\n /**\n *\n * @param {object} moduleOptions\n */\n setModuleOptions(moduleOptions) {\n this.moduleOptions = moduleOptions;\n if (this.options.enabled === true) {\n this._clean();\n if (this.options.container !== undefined) {\n this.container = this.options.container;\n }\n this._create();\n }\n }\n\n /**\n * Create all DOM elements\n *\n * @private\n */\n _create() {\n this._clean();\n this.changedOptions = [];\n\n const filter = this.options.filter;\n let counter = 0;\n let show = false;\n for (const option in this.configureOptions) {\n if (Object.prototype.hasOwnProperty.call(this.configureOptions, option)) {\n this.allowCreation = false;\n show = false;\n if (typeof filter === \"function\") {\n show = filter(option, []);\n show =\n show ||\n this._handleObject(this.configureOptions[option], [option], true);\n } else if (filter === true || filter.indexOf(option) !== -1) {\n show = true;\n }\n\n if (show !== false) {\n this.allowCreation = true;\n\n // linebreak between categories\n if (counter > 0) {\n this._makeItem([]);\n }\n // a header for the category\n this._makeHeader(option);\n\n // get the sub options\n this._handleObject(this.configureOptions[option], [option]);\n }\n counter++;\n }\n }\n this._makeButton();\n this._push();\n //~ this.colorPicker.insertTo(this.container);\n }\n\n /**\n * draw all DOM elements on the screen\n *\n * @private\n */\n _push() {\n this.wrapper = document.createElement(\"div\");\n this.wrapper.className = \"vis-configuration-wrapper\";\n this.container.appendChild(this.wrapper);\n for (let i = 0; i < this.domElements.length; i++) {\n this.wrapper.appendChild(this.domElements[i]);\n }\n\n this._showPopupIfNeeded();\n }\n\n /**\n * delete all DOM elements\n *\n * @private\n */\n _clean() {\n for (let i = 0; i < this.domElements.length; i++) {\n this.wrapper.removeChild(this.domElements[i]);\n }\n\n if (this.wrapper !== undefined) {\n this.container.removeChild(this.wrapper);\n this.wrapper = undefined;\n }\n this.domElements = [];\n\n this._removePopup();\n }\n\n /**\n * get the value from the actualOptions if it exists\n *\n * @param {Array} path | where to look for the actual option\n * @returns {*}\n * @private\n */\n _getValue(path) {\n let base = this.moduleOptions;\n for (let i = 0; i < path.length; i++) {\n if (base[path[i]] !== undefined) {\n base = base[path[i]];\n } else {\n base = undefined;\n break;\n }\n }\n return base;\n }\n\n /**\n * all option elements are wrapped in an item\n *\n * @param {Array} path | where to look for the actual option\n * @param {Array.<Element>} domElements\n * @returns {number}\n * @private\n */\n _makeItem(path, ...domElements) {\n if (this.allowCreation === true) {\n const item = document.createElement(\"div\");\n item.className =\n \"vis-configuration vis-config-item vis-config-s\" + path.length;\n domElements.forEach((element) => {\n item.appendChild(element);\n });\n this.domElements.push(item);\n return this.domElements.length;\n }\n return 0;\n }\n\n /**\n * header for major subjects\n *\n * @param {string} name\n * @private\n */\n _makeHeader(name) {\n const div = document.createElement(\"div\");\n div.className = \"vis-configuration vis-config-header\";\n div.innerText = name;\n this._makeItem([], div);\n }\n\n /**\n * make a label, if it is an object label, it gets different styling.\n *\n * @param {string} name\n * @param {Array} path | where to look for the actual option\n * @param {string} objectLabel\n * @returns {HTMLElement}\n * @private\n */\n _makeLabel(name, path, objectLabel = false) {\n const div = document.createElement(\"div\");\n div.className =\n \"vis-configuration vis-config-label vis-config-s\" + path.length;\n if (objectLabel === true) {\n while (div.firstChild) {\n div.removeChild(div.firstChild);\n }\n div.appendChild(wrapInTag(\"i\", \"b\", name));\n } else {\n div.innerText = name + \":\";\n }\n return div;\n }\n\n /**\n * make a dropdown list for multiple possible string optoins\n *\n * @param {Array.<number>} arr\n * @param {number} value\n * @param {Array} path | where to look for the actual option\n * @private\n */\n _makeDropdown(arr, value, path) {\n const select = document.createElement(\"select\");\n select.className = \"vis-configuration vis-config-select\";\n let selectedValue = 0;\n if (value !== undefined) {\n if (arr.indexOf(value) !== -1) {\n selectedValue = arr.indexOf(value);\n }\n }\n\n for (let i = 0; i < arr.length; i++) {\n const option = document.createElement(\"option\");\n option.value = arr[i];\n if (i === selectedValue) {\n option.selected = \"selected\";\n }\n option.innerText = arr[i];\n select.appendChild(option);\n }\n\n const me = this;\n select.onchange = function () {\n me._update(this.value, path);\n };\n\n const label = this._makeLabel(path[path.length - 1], path);\n this._makeItem(path, label, select);\n }\n\n /**\n * make a range object for numeric options\n *\n * @param {Array.<number>} arr\n * @param {number} value\n * @param {Array} path | where to look for the actual option\n * @private\n */\n _makeRange(arr, value, path) {\n const defaultValue = arr[0];\n const min = arr[1];\n const max = arr[2];\n const step = arr[3];\n const range = document.createElement(\"input\");\n range.className = \"vis-configuration vis-config-range\";\n try {\n range.type = \"range\"; // not supported on IE9\n range.min = min;\n range.max = max;\n } catch (err) {\n // TODO: Add some error handling.\n }\n range.step = step;\n\n // set up the popup settings in case they are needed.\n let popupString = \"\";\n let popupValue = 0;\n\n if (value !== undefined) {\n const factor = 1.2;\n if (value < 0 && value * factor < min) {\n range.min = Math.ceil(value * factor);\n popupValue = range.min;\n popupString = \"range increased\";\n } else if (value / factor < min) {\n range.min = Math.ceil(value / factor);\n popupValue = range.min;\n popupString = \"range increased\";\n }\n if (value * factor > max && max !== 1) {\n range.max = Math.ceil(value * factor);\n popupValue = range.max;\n popupString = \"range increased\";\n }\n range.value = value;\n } else {\n range.value = defaultValue;\n }\n\n const input = document.createElement(\"input\");\n input.className = \"vis-configuration vis-config-rangeinput\";\n input.value = range.value;\n\n const me = this;\n range.onchange = function () {\n input.value = this.value;\n me._update(Number(this.value), path);\n };\n range.oninput = function () {\n input.value = this.value;\n };\n\n const label = this._makeLabel(path[path.length - 1], path);\n const itemIndex = this._makeItem(path, label, range, input);\n\n // if a popup is needed AND it has not been shown for this value, show it.\n if (popupString !== \"\" && this.popupHistory[itemIndex] !== popupValue) {\n this.popupHistory[itemIndex] = popupValue;\n this._setupPopup(popupString, itemIndex);\n }\n }\n\n /**\n * make a button object\n *\n * @private\n */\n _makeButton() {\n if (this.options.showButton === true) {\n const generateButton = document.createElement(\"div\");\n generateButton.className = \"vis-configuration vis-config-button\";\n generateButton.innerText = \"generate options\";\n generateButton.onclick = () => {\n this._printOptions();\n };\n generateButton.onmouseover = () => {\n generateButton.className = \"vis-configuration vis-config-button hover\";\n };\n generateButton.onmouseout = () => {\n generateButton.className = \"vis-configuration vis-config-button\";\n };\n\n this.optionsContainer = document.createElement(\"div\");\n this.optionsContainer.className =\n \"vis-configuration vis-config-option-container\";\n\n this.domElements.push(this.optionsContainer);\n this.domElements.push(generateButton);\n }\n }\n\n /**\n * prepare the popup\n *\n * @param {string} string\n * @param {number} index\n * @private\n */\n _setupPopup(string, index) {\n if (\n this.initialized === true &&\n this.allowCreation === true &&\n this.popupCounter < this.popupLimit\n ) {\n const div = document.createElement(\"div\");\n div.id = \"vis-configuration-popup\";\n div.className = \"vis-configuration-popup\";\n div.innerText = string;\n div.onclick = () => {\n this._removePopup();\n };\n this.popupCounter += 1;\n this.popupDiv = { html: div, index: index };\n }\n }\n\n /**\n * remove the popup from the dom\n *\n * @private\n */\n _removePopup() {\n if (this.popupDiv.html !== undefined) {\n this.popupDiv.html.parentNode.removeChild(this.popupDiv.html);\n clearTimeout(this.popupDiv.hideTimeout);\n clearTimeout(this.popupDiv.deleteTimeout);\n this.popupDiv = {};\n }\n }\n\n /**\n * Show the popup if it is needed.\n *\n * @private\n */\n _showPopupIfNeeded() {\n if (this.popupDiv.html !== undefined) {\n const correspondingElement = this.domElements[this.popupDiv.index];\n const rect = correspondingElement.getBoundingClientRect();\n this.popupDiv.html.style.left = rect.left + \"px\";\n this.popupDiv.html.style.top = rect.top - 30 + \"px\"; // 30 is the height;\n document.body.appendChild(this.popupDiv.html);\n this.popupDiv.hideTimeout = setTimeout(() => {\n this.popupDiv.html.style.opacity = 0;\n }, 1500);\n this.popupDiv.deleteTimeout = setTimeout(() => {\n this._removePopup();\n }, 1800);\n }\n }\n\n /**\n * make a checkbox for boolean options.\n *\n * @param {number} defaultValue\n * @param {number} value\n * @param {Array} path | where to look for the actual option\n * @private\n */\n _makeCheckbox(defaultValue, value, path) {\n const checkbox = document.createElement(\"input\");\n checkbox.type = \"checkbox\";\n checkbox.className = \"vis-configuration vis-config-checkbox\";\n checkbox.checked = defaultValue;\n if (value !== undefined) {\n checkbox.checked = value;\n if (value !== defaultValue) {\n if (typeof defaultValue === \"object\") {\n if (value !== defaultValue.enabled) {\n this.changedOptions.push({ path: path, value: value });\n }\n } else {\n this.changedOptions.push({ path: path, value: value });\n }\n }\n }\n\n const me = this;\n checkbox.onchange = function () {\n me._update(this.checked, path);\n };\n\n const label = this._makeLabel(path[path.length - 1], path);\n this._makeItem(path, label, checkbox);\n }\n\n /**\n * make a text input field for string options.\n *\n * @param {number} defaultValue\n * @param {number} value\n * @param {Array} path | where to look for the actual option\n * @private\n */\n _makeTextInput(defaultValue, value, path) {\n const checkbox = document.createElement(\"input\");\n checkbox.type = \"text\";\n checkbox.className = \"vis-configuration vis-config-text\";\n checkbox.value = value;\n if (value !== defaultValue) {\n this.changedOptions.push({ path: path, value: value });\n }\n\n const me = this;\n checkbox.onchange = function () {\n me._update(this.value, path);\n };\n\n const label = this._makeLabel(path[path.length - 1], path);\n this._makeItem(path, label, checkbox);\n }\n\n /**\n * make a color field with a color picker for color fields\n *\n * @param {Array.<number>} arr\n * @param {number} value\n * @param {Array} path | where to look for the actual option\n * @private\n */\n _makeColorField(arr, value, path) {\n const defaultColor = arr[1];\n const div = document.createElement(\"div\");\n value = value === undefined ? defaultColor : value;\n\n if (value !== \"none\") {\n div.className = \"vis-configuration vis-config-colorBlock\";\n div.style.backgroundColor = value;\n } else {\n div.className = \"vis-configuration vis-config-colorBlock none\";\n }\n\n value = value === undefined ? defaultColor : value;\n div.onclick = () => {\n this._showColorPicker(value, div, path);\n };\n\n const label = this._makeLabel(path[path.length - 1], path);\n this._makeItem(path, label, div);\n }\n\n /**\n * used by the color buttons to call the color picker.\n *\n * @param {number} value\n * @param {HTMLElement} div\n * @param {Array} path | where to look for the actual option\n * @private\n */\n _showColorPicker(value, div, path) {\n // clear the callback from this div\n div.onclick = function () {};\n\n this.colorPicker.insertTo(div);\n this.colorPicker.show();\n\n this.colorPicker.setColor(value);\n this.colorPicker.setUpdateCallback((color) => {\n const colorString =\n \"rgba(\" + color.r + \",\" + color.g + \",\" + color.b + \",\" + color.a + \")\";\n div.style.backgroundColor = colorString;\n this._update(colorString, path);\n });\n\n // on close of the colorpicker, restore the callback.\n this.colorPicker.setCloseCallback(() => {\n div.onclick = () => {\n this._showColorPicker(value, div, path);\n };\n });\n }\n\n /**\n * parse an object and draw the correct items\n *\n * @param {object} obj\n * @param {Array} [path=[]] | where to look for the actual option\n * @param {boolean} [checkOnly=false]\n * @returns {boolean}\n * @private\n */\n _handleObject(obj, path = [], checkOnly = false) {\n let show = false;\n const filter = this.options.filter;\n let visibleInSet = false;\n for (const subObj in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, subObj)) {\n show = true;\n const item = obj[subObj];\n const newPath = copyAndExtendArray(path, subObj);\n if (typeof filter === \"function\") {\n show = filter(subObj, path);\n\n // if needed we must go deeper into the object.\n if (show === false) {\n if (\n !Array.isArray(item) &&\n typeof item !== \"string\" &&\n typeof item !== \"boolean\" &&\n item instanceof Object\n ) {\n this.allowCreation = false;\n show = this._handleObject(item, newPath, true);\n this.allowCreation = checkOnly === false;\n }\n }\n }\n\n if (show !== false) {\n visibleInSet = true;\n const value = this._getValue(newPath);\n\n if (Array.isArray(item)) {\n this._handleArray(item, value, newPath);\n } else if (typeof item === \"string\") {\n this._makeTextInput(item, value, newPath);\n } else if (typeof item === \"boolean\") {\n this._makeCheckbox(item, value, newPath);\n } else if (item instanceof Object) {\n // skip the options that are not enabled\n if (!this.hideOption(path, subObj, this.moduleOptions)) {\n // initially collapse options with an disabled enabled option.\n if (item.enabled !== undefined) {\n const enabledPath = copyAndExtendArray(newPath, \"enabled\");\n const enabledValue = this._getValue(enabledPath);\n if (enabledValue === true) {\n const label = this._makeLabel(subObj, newPath, true);\n this._makeItem(newPath, label);\n visibleInSet =\n this._handleObject(item, newPath) || visibleInSet;\n } else {\n this._makeCheckbox(item, enabledValue, newPath);\n }\n } else {\n const label = this._makeLabel(subObj, newPath, true);\n this._makeItem(newPath, label);\n visibleInSet =\n this._handleObject(item, newPath) || visibleInSet;\n }\n }\n } else {\n console.error(\"dont know how to handle\", item, subObj, newPath);\n }\n }\n }\n }\n return visibleInSet;\n }\n\n /**\n * handle the array type of option\n *\n * @param {Array.<number>} arr\n * @param {number} value\n * @param {Array} path | where to look for the actual option\n * @private\n */\n _handleArray(arr, value, path) {\n if (typeof arr[0] === \"string\" && arr[0] === \"color\") {\n this._makeColorField(arr, value, path);\n if (arr[1] !== value) {\n this.changedOptions.push({ path: path, value: value });\n }\n } else if (typeof arr[0] === \"string\") {\n this._makeDropdown(arr, value, path);\n if (arr[0] !== value) {\n this.changedOptions.push({ path: path, value: value });\n }\n } else if (typeof arr[0] === \"number\") {\n this._makeRange(arr, value, path);\n if (arr[0] !== value) {\n this.changedOptions.push({ path: path, value: Number(value) });\n }\n }\n }\n\n /**\n * called to update the network with the new settings.\n *\n * @param {number} value\n * @param {Array} path | where to look for the actual option\n * @private\n */\n _update(value, path) {\n const options = this._constructOptions(value, path);\n\n if (\n this.parent.body &&\n this.parent.body.emitter &&\n this.parent.body.emitter.emit\n ) {\n this.parent.body.emitter.emit(\"configChange\", options);\n }\n this.initialized = true;\n this.parent.setOptions(options);\n }\n\n /**\n *\n * @param {string | boolean} value\n * @param {Array.<string>} path\n * @param {{}} optionsObj\n * @returns {{}}\n * @private\n */\n _constructOptions(value, path, optionsObj = {}) {\n let pointer = optionsObj;\n\n // when dropdown boxes can be string or boolean, we typecast it into correct types\n value = value === \"true\" ? true : value;\n value = value === \"false\" ? false : value;\n\n for (let i = 0; i < path.length; i++) {\n if (path[i] !== \"global\") {\n if (pointer[path[i]] === undefined) {\n pointer[path[i]] = {};\n }\n if (i !== path.length - 1) {\n pointer = pointer[path[i]];\n } else {\n pointer[path[i]] = value;\n }\n }\n }\n return optionsObj;\n }\n\n /**\n * @private\n */\n _printOptions() {\n const options = this.getOptions();\n\n while (this.optionsContainer.firstChild) {\n this.optionsContainer.removeChild(this.optionsContainer.firstChild);\n }\n this.optionsContainer.appendChild(\n wrapInTag(\"pre\", \"const options = \" + JSON.stringify(options, null, 2))\n );\n }\n\n /**\n *\n * @returns {{}} options\n */\n getOptions() {\n const options = {};\n for (let i = 0; i < this.changedOptions.length; i++) {\n this._constructOptions(\n this.changedOptions[i].value,\n this.changedOptions[i].path,\n options\n );\n }\n return options;\n }\n}\n\n/**\n * Popup is a class to create a popup window with some text\n */\nclass Popup {\n /**\n * @param {Element} container The container object.\n * @param {string} overflowMethod How the popup should act to overflowing ('flip' or 'cap')\n */\n constructor(container, overflowMethod) {\n this.container = container;\n this.overflowMethod = overflowMethod || \"cap\";\n\n this.x = 0;\n this.y = 0;\n this.padding = 5;\n this.hidden = false;\n\n // create the frame\n this.frame = document.createElement(\"div\");\n this.frame.className = \"vis-tooltip\";\n this.container.appendChild(this.frame);\n }\n\n /**\n * @param {number} x Horizontal position of the popup window\n * @param {number} y Vertical position of the popup window\n */\n setPosition(x, y) {\n this.x = parseInt(x);\n this.y = parseInt(y);\n }\n\n /**\n * Set the content for the popup window. This can be HTML code or text.\n *\n * @param {string | Element} content\n */\n setText(content) {\n if (content instanceof Element) {\n while (this.frame.firstChild) {\n this.frame.removeChild(this.frame.firstChild);\n }\n this.frame.appendChild(content);\n } else {\n // String containing literal text, element has to be used for HTML due to\n // XSS risks associated with innerHTML (i.e. prevent XSS by accident).\n this.frame.innerText = content;\n }\n }\n\n /**\n * Show the popup window\n *\n * @param {boolean} [doShow] Show or hide the window\n */\n show(doShow) {\n if (doShow === undefined) {\n doShow = true;\n }\n\n if (doShow === true) {\n const height = this.frame.clientHeight;\n const width = this.frame.clientWidth;\n const maxHeight = this.frame.parentNode.clientHeight;\n const maxWidth = this.frame.parentNode.clientWidth;\n\n let left = 0,\n top = 0;\n\n if (this.overflowMethod == \"flip\") {\n let isLeft = false,\n isTop = true; // Where around the position it's located\n\n if (this.y - height < this.padding) {\n isTop = false;\n }\n\n if (this.x + width > maxWidth - this.padding) {\n isLeft = true;\n }\n\n if (isLeft) {\n left = this.x - width;\n } else {\n left = this.x;\n }\n\n if (isTop) {\n top = this.y - height;\n } else {\n top = this.y;\n }\n } else {\n top = this.y - height;\n if (top + height + this.padding > maxHeight) {\n top = maxHeight - height - this.padding;\n }\n if (top < this.padding) {\n top = this.padding;\n }\n\n left = this.x;\n if (left + width + this.padding > maxWidth) {\n left = maxWidth - width - this.padding;\n }\n if (left < this.padding) {\n left = this.padding;\n }\n }\n\n this.frame.style.left = left + \"px\";\n this.frame.style.top = top + \"px\";\n this.frame.style.visibility = \"visible\";\n this.hidden = false;\n } else {\n this.hide();\n }\n }\n\n /**\n * Hide the popup window\n */\n hide() {\n this.hidden = true;\n this.frame.style.left = \"0\";\n this.frame.style.top = \"0\";\n this.frame.style.visibility = \"hidden\";\n }\n\n /**\n * Remove the popup window\n */\n destroy() {\n this.frame.parentNode.removeChild(this.frame); // Remove element from DOM\n }\n}\n\nlet errorFound = false;\nlet allOptions;\n\nconst VALIDATOR_PRINT_STYLE = \"background: #FFeeee; color: #dd0000\";\n\n/**\n * Used to validate options.\n */\nclass Validator {\n /**\n * Main function to be called\n *\n * @param {object} options\n * @param {object} referenceOptions\n * @param {object} subObject\n * @returns {boolean}\n * @static\n */\n static validate(options, referenceOptions, subObject) {\n errorFound = false;\n allOptions = referenceOptions;\n let usedOptions = referenceOptions;\n if (subObject !== undefined) {\n usedOptions = referenceOptions[subObject];\n }\n Validator.parse(options, usedOptions, []);\n return errorFound;\n }\n\n /**\n * Will traverse an object recursively and check every value\n *\n * @param {object} options\n * @param {object} referenceOptions\n * @param {Array} path | where to look for the actual option\n * @static\n */\n static parse(options, referenceOptions, path) {\n for (const option in options) {\n if (Object.prototype.hasOwnProperty.call(options, option)) {\n Validator.check(option, options, referenceOptions, path);\n }\n }\n }\n\n /**\n * Check every value. If the value is an object, call the parse function on that object.\n *\n * @param {string} option\n * @param {object} options\n * @param {object} referenceOptions\n * @param {Array} path | where to look for the actual option\n * @static\n */\n static check(option, options, referenceOptions, path) {\n if (\n referenceOptions[option] === undefined &&\n referenceOptions.__any__ === undefined\n ) {\n Validator.getSuggestion(option, referenceOptions, path);\n return;\n }\n\n let referenceOption = option;\n let is_object = true;\n\n if (\n referenceOptions[option] === undefined &&\n referenceOptions.__any__ !== undefined\n ) {\n // NOTE: This only triggers if the __any__ is in the top level of the options object.\n // THAT'S A REALLY BAD PLACE TO ALLOW IT!!!!\n // TODO: Examine if needed, remove if possible\n\n // __any__ is a wildcard. Any value is accepted and will be further analysed by reference.\n referenceOption = \"__any__\";\n\n // if the any-subgroup is not a predefined object in the configurator,\n // we do not look deeper into the object.\n is_object = Validator.getType(options[option]) === \"object\";\n }\n\n let refOptionObj = referenceOptions[referenceOption];\n if (is_object && refOptionObj.__type__ !== undefined) {\n refOptionObj = refOptionObj.__type__;\n }\n\n Validator.checkFields(\n option,\n options,\n referenceOptions,\n referenceOption,\n refOptionObj,\n path\n );\n }\n\n /**\n *\n * @param {string} option | the option property\n * @param {object} options | The supplied options object\n * @param {object} referenceOptions | The reference options containing all options and their allowed formats\n * @param {string} referenceOption | Usually this is the same as option, except when handling an __any__ tag.\n * @param {string} refOptionObj | This is the type object from the reference options\n * @param {Array} path | where in the object is the option\n * @static\n */\n static checkFields(\n option,\n options,\n referenceOptions,\n referenceOption,\n refOptionObj,\n path\n ) {\n const log = function (message) {\n console.error(\n \"%c\" + message + Validator.printLocation(path, option),\n VALIDATOR_PRINT_STYLE\n );\n };\n\n const optionType = Validator.getType(options[option]);\n const refOptionType = refOptionObj[optionType];\n\n if (refOptionType !== undefined) {\n // if the type is correct, we check if it is supposed to be one of a few select values\n if (\n Validator.getType(refOptionType) === \"array\" &&\n refOptionType.indexOf(options[option]) === -1\n ) {\n log(\n 'Invalid option detected in \"' +\n option +\n '\".' +\n \" Allowed values are:\" +\n Validator.print(refOptionType) +\n ' not \"' +\n options[option] +\n '\". '\n );\n errorFound = true;\n } else if (optionType === \"object\" && referenceOption !== \"__any__\") {\n path = copyAndExtendArray(path, option);\n Validator.parse(\n options[option],\n referenceOptions[referenceOption],\n path\n );\n }\n } else if (refOptionObj[\"any\"] === undefined) {\n // type of the field is incorrect and the field cannot be any\n log(\n 'Invalid type received for \"' +\n option +\n '\". Expected: ' +\n Validator.print(Object.keys(refOptionObj)) +\n \". Received [\" +\n optionType +\n '] \"' +\n options[option] +\n '\"'\n );\n errorFound = true;\n }\n }\n\n /**\n *\n * @param {object | boolean | number | string | Array.<number> | Date | Node | Moment | undefined | null} object\n * @returns {string}\n * @static\n */\n static getType(object) {\n const type = typeof object;\n\n if (type === \"object\") {\n if (object === null) {\n return \"null\";\n }\n if (object instanceof Boolean) {\n return \"boolean\";\n }\n if (object instanceof Number) {\n return \"number\";\n }\n if (object instanceof String) {\n return \"string\";\n }\n if (Array.isArray(object)) {\n return \"array\";\n }\n if (object instanceof Date) {\n return \"date\";\n }\n if (object.nodeType !== undefined) {\n return \"dom\";\n }\n if (object._isAMomentObject === true) {\n return \"moment\";\n }\n return \"object\";\n } else if (type === \"number\") {\n return \"number\";\n } else if (type === \"boolean\") {\n return \"boolean\";\n } else if (type === \"string\") {\n return \"string\";\n } else if (type === undefined) {\n return \"undefined\";\n }\n return type;\n }\n\n /**\n * @param {string} option\n * @param {object} options\n * @param {Array.<string>} path\n * @static\n */\n static getSuggestion(option, options, path) {\n const localSearch = Validator.findInOptions(option, options, path, false);\n const globalSearch = Validator.findInOptions(option, allOptions, [], true);\n\n const localSearchThreshold = 8;\n const globalSearchThreshold = 4;\n\n let msg;\n if (localSearch.indexMatch !== undefined) {\n msg =\n \" in \" +\n Validator.printLocation(localSearch.path, option, \"\") +\n 'Perhaps it was incomplete? Did you mean: \"' +\n localSearch.indexMatch +\n '\"?\\n\\n';\n } else if (\n globalSearch.distance <= globalSearchThreshold &&\n localSearch.distance > globalSearch.distance\n ) {\n msg =\n \" in \" +\n Validator.printLocation(localSearch.path, option, \"\") +\n \"Perhaps it was misplaced? Matching option found at: \" +\n Validator.printLocation(\n globalSearch.path,\n globalSearch.closestMatch,\n \"\"\n );\n } else if (localSearch.distance <= localSearchThreshold) {\n msg =\n '. Did you mean \"' +\n localSearch.closestMatch +\n '\"?' +\n Validator.printLocation(localSearch.path, option);\n } else {\n msg =\n \". Did you mean one of these: \" +\n Validator.print(Object.keys(options)) +\n Validator.printLocation(path, option);\n }\n\n console.error(\n '%cUnknown option detected: \"' + option + '\"' + msg,\n VALIDATOR_PRINT_STYLE\n );\n errorFound = true;\n }\n\n /**\n * traverse the options in search for a match.\n *\n * @param {string} option\n * @param {object} options\n * @param {Array} path | where to look for the actual option\n * @param {boolean} [recursive=false]\n * @returns {{closestMatch: string, path: Array, distance: number}}\n * @static\n */\n static findInOptions(option, options, path, recursive = false) {\n let min = 1e9;\n let closestMatch = \"\";\n let closestMatchPath = [];\n const lowerCaseOption = option.toLowerCase();\n let indexMatch = undefined;\n for (const op in options) {\n let distance;\n if (options[op].__type__ !== undefined && recursive === true) {\n const result = Validator.findInOptions(\n option,\n options[op],\n copyAndExtendArray(path, op)\n );\n if (min > result.distance) {\n closestMatch = result.closestMatch;\n closestMatchPath = result.path;\n min = result.distance;\n indexMatch = result.indexMatch;\n }\n } else {\n if (op.toLowerCase().indexOf(lowerCaseOption) !== -1) {\n indexMatch = op;\n }\n distance = Validator.levenshteinDistance(option, op);\n if (min > distance) {\n closestMatch = op;\n closestMatchPath = copyArray(path);\n min = distance;\n }\n }\n }\n return {\n closestMatch: closestMatch,\n path: closestMatchPath,\n distance: min,\n indexMatch: indexMatch,\n };\n }\n\n /**\n * @param {Array.<string>} path\n * @param {object} option\n * @param {string} prefix\n * @returns {string}\n * @static\n */\n static printLocation(path, option, prefix = \"Problem value found at: \\n\") {\n let str = \"\\n\\n\" + prefix + \"options = {\\n\";\n for (let i = 0; i < path.length; i++) {\n for (let j = 0; j < i + 1; j++) {\n str += \" \";\n }\n str += path[i] + \": {\\n\";\n }\n for (let j = 0; j < path.length + 1; j++) {\n str += \" \";\n }\n str += option + \"\\n\";\n for (let i = 0; i < path.length + 1; i++) {\n for (let j = 0; j < path.length - i; j++) {\n str += \" \";\n }\n str += \"}\\n\";\n }\n return str + \"\\n\\n\";\n }\n\n /**\n * @param {object} options\n * @returns {string}\n * @static\n */\n static print(options) {\n return JSON.stringify(options)\n .replace(/(\")|(\\[)|(\\])|(,\"__type__\")/g, \"\")\n .replace(/(,)/g, \", \");\n }\n\n /**\n * Compute the edit distance between the two given strings\n * http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#JavaScript\n *\n * Copyright (c) 2011 Andrei Mackenzie\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * @param {string} a\n * @param {string} b\n * @returns {Array.<Array.<number>>}}\n * @static\n */\n static levenshteinDistance(a, b) {\n if (a.length === 0) return b.length;\n if (b.length === 0) return a.length;\n\n const matrix = [];\n\n // increment along the first column of each row\n let i;\n for (i = 0; i <= b.length; i++) {\n matrix[i] = [i];\n }\n\n // increment each column in the first row\n let j;\n for (j = 0; j <= a.length; j++) {\n matrix[0][j] = j;\n }\n\n // Fill in the rest of the matrix\n for (i = 1; i <= b.length; i++) {\n for (j = 1; j <= a.length; j++) {\n if (b.charAt(i - 1) == a.charAt(j - 1)) {\n matrix[i][j] = matrix[i - 1][j - 1];\n } else {\n matrix[i][j] = Math.min(\n matrix[i - 1][j - 1] + 1, // substitution\n Math.min(\n matrix[i][j - 1] + 1, // insertion\n matrix[i - 1][j] + 1\n )\n ); // deletion\n }\n }\n }\n\n return matrix[b.length][a.length];\n }\n}\n\nconst Activator$1 = Activator;\r\nconst ColorPicker$1 = ColorPicker;\r\nconst Configurator$1 = Configurator;\r\nconst Hammer$1 = Hammer;\r\nconst Popup$1 = Popup;\r\nconst VALIDATOR_PRINT_STYLE$1 = VALIDATOR_PRINT_STYLE;\r\nconst Validator$1 = Validator;\n\nexport { Activator$1 as Activator, Alea, ColorPicker$1 as ColorPicker, Configurator$1 as Configurator, DELETE, HSVToHex, HSVToRGB, Hammer$1 as Hammer, Popup$1 as Popup, RGBToHSV, RGBToHex, VALIDATOR_PRINT_STYLE$1 as VALIDATOR_PRINT_STYLE, Validator$1 as Validator, addClassName, addCssText, addEventListener, binarySearchCustom, binarySearchValue, bridgeObject, copyAndExtendArray, copyArray, deepExtend, deepObjectAssign, easingFunctions, equalArray, extend, fillIfDefined, forEach, getAbsoluteLeft, getAbsoluteRight, getAbsoluteTop, getScrollBarWidth, getTarget, getType, hasParent, hexToHSV, hexToRGB, insertSort, isDate, isNumber, isObject, isString, isValidHex, isValidRGB, isValidRGBA, mergeOptions, option, overrideOpacity, parseColor, preventDefault, pureDeepObjectAssign, recursiveDOMDelete, removeClassName, removeCssText, removeEventListener, selectiveBridgeObject, selectiveDeepExtend, selectiveExtend, selectiveNotDeepExtend, throttle, toArray, topMost, updateProperty };\n//# sourceMappingURL=vis-util.js.map\n","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar aFunction = require('../internals/a-function');\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar bind = require('../internals/function-bind');\nvar fails = require('../internals/fails');\n\nvar nativeConstruct = getBuiltIn('Reflect', 'construct');\n\n// `Reflect.construct` method\n// https://tc39.github.io/ecma262/#sec-reflect.construct\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n nativeConstruct(function () { /* empty */ });\n});\nvar FORCED = NEW_TARGET_BUG || ARGS_BUG;\n\n$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n","require('../../modules/es.reflect.construct');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Reflect.construct;\n","var parent = require('../../es/reflect/construct');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/reflect/construct\");","require('../../../modules/es.array.iterator');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').entries;\n","var parent = require('../../../es/array/virtual/entries');\n\nmodule.exports = parent;\n","require('../../modules/web.dom-collections.iterator');\nvar entries = require('../array/virtual/entries');\nvar classof = require('../../internals/classof');\nvar ArrayPrototype = Array.prototype;\n\nvar DOMIterables = {\n DOMTokenList: true,\n NodeList: true\n};\n\nmodule.exports = function (it) {\n var own = it.entries;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.entries)\n // eslint-disable-next-line no-prototype-builtins\n || DOMIterables.hasOwnProperty(classof(it)) ? entries : own;\n};\n","module.exports = require(\"core-js-pure/stable/instance/entries\");","/**\n * Copyright (c) 2014-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\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","module.exports = require(\"regenerator-runtime\");\n","var parent = require('../../es/symbol/iterator');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/symbol/iterator\");","require('../../../modules/es.array.iterator');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').values;\n","var parent = require('../../../es/array/virtual/values');\n\nmodule.exports = parent;\n","require('../../modules/web.dom-collections.iterator');\nvar values = require('../array/virtual/values');\nvar classof = require('../../internals/classof');\nvar ArrayPrototype = Array.prototype;\n\nvar DOMIterables = {\n DOMTokenList: true,\n NodeList: true\n};\n\nmodule.exports = function (it) {\n var own = it.values;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.values)\n // eslint-disable-next-line no-prototype-builtins\n || DOMIterables.hasOwnProperty(classof(it)) ? values : own;\n};\n","module.exports = require(\"core-js-pure/stable/instance/values\");","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar fails = require('../internals/fails');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar test = [];\nvar nativeSort = test.sort;\n\n// IE8-\nvar FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n});\n// V8 bug\nvar FAILS_ON_NULL = fails(function () {\n test.sort(null);\n});\n// Old WebKit\nvar STRICT_METHOD = arrayMethodIsStrict('sort');\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD;\n\n// `Array.prototype.sort` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? nativeSort.call(toObject(this))\n : nativeSort.call(toObject(this), aFunction(comparefn));\n }\n});\n","require('../../../modules/es.array.sort');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').sort;\n","var sort = require('../array/virtual/sort');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.sort;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.sort) ? sort : own;\n};\n","var parent = require('../../es/instance/sort');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/sort\");","require('../../../modules/es.array.iterator');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').keys;\n","var parent = require('../../../es/array/virtual/keys');\n\nmodule.exports = parent;\n","require('../../modules/web.dom-collections.iterator');\nvar keys = require('../array/virtual/keys');\nvar classof = require('../../internals/classof');\nvar ArrayPrototype = Array.prototype;\n\nvar DOMIterables = {\n DOMTokenList: true,\n NodeList: true\n};\n\nmodule.exports = function (it) {\n var own = it.keys;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.keys)\n // eslint-disable-next-line no-prototype-builtins\n || DOMIterables.hasOwnProperty(classof(it)) ? keys : own;\n};\n","module.exports = require(\"core-js-pure/stable/instance/keys\");","'use strict';\nvar $ = require('../internals/export');\nvar $some = require('../internals/array-iteration').some;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar STRICT_METHOD = arrayMethodIsStrict('some');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('some');\n\n// `Array.prototype.some` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.some\n$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.some');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').some;\n","var some = require('../array/virtual/some');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.some;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.some) ? some : own;\n};\n","var parent = require('../../es/instance/some');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/some\");","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n return Object.isExtensible(Object.preventExtensions({}));\n});\n","var hiddenKeys = require('../internals/hidden-keys');\nvar isObject = require('../internals/is-object');\nvar has = require('../internals/has');\nvar defineProperty = require('../internals/object-define-property').f;\nvar uid = require('../internals/uid');\nvar FREEZING = require('../internals/freezing');\n\nvar METADATA = uid('meta');\nvar id = 0;\n\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\n\nvar setMetadata = function (it) {\n defineProperty(it, METADATA, { value: {\n objectID: 'O' + ++id, // object ID\n weakData: {} // weak collections IDs\n } });\n};\n\nvar fastKey = function (it, create) {\n // return a primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMetadata(it);\n // return object ID\n } return it[METADATA].objectID;\n};\n\nvar getWeakData = function (it, create) {\n if (!has(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMetadata(it);\n // return the store of weak collections IDs\n } return it[METADATA].weakData;\n};\n\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);\n return it;\n};\n\nvar meta = module.exports = {\n REQUIRED: false,\n fastKey: fastKey,\n getWeakData: getWeakData,\n onFreeze: onFreeze\n};\n\nhiddenKeys[METADATA] = true;\n","var anObject = require('../internals/an-object');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/function-bind-context');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar iteratorClose = require('../internals/iterator-close');\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (typeof iterFn != 'function') throw TypeError('Target is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = toLength(iterable.length); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && result instanceof Result) return result;\n } return new Result(false);\n }\n iterator = iterFn.call(iterable);\n }\n\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator);\n throw error;\n }\n if (typeof result == 'object' && result && result instanceof Result) return result;\n } return new Result(false);\n};\n","module.exports = function (it, Constructor, name) {\n if (!(it instanceof Constructor)) {\n throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');\n } return it;\n};\n","'use strict';\nvar $ = require('./export');\nvar global = require('../internals/global');\nvar InternalMetadataModule = require('../internals/internal-metadata');\nvar fails = require('../internals/fails');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar iterate = require('../internals/iterate');\nvar anInstance = require('../internals/an-instance');\nvar isObject = require('../internals/is-object');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar defineProperty = require('../internals/object-define-property').f;\nvar forEach = require('../internals/array-iteration').forEach;\nvar DESCRIPTORS = require('../internals/descriptors');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = function (CONSTRUCTOR_NAME, wrapper, common) {\n var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;\n var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;\n var ADDER = IS_MAP ? 'set' : 'add';\n var NativeConstructor = global[CONSTRUCTOR_NAME];\n var NativePrototype = NativeConstructor && NativeConstructor.prototype;\n var exported = {};\n var Constructor;\n\n if (!DESCRIPTORS || typeof NativeConstructor != 'function'\n || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))\n ) {\n // create collection constructor\n Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);\n InternalMetadataModule.REQUIRED = true;\n } else {\n Constructor = wrapper(function (target, iterable) {\n setInternalState(anInstance(target, Constructor, CONSTRUCTOR_NAME), {\n type: CONSTRUCTOR_NAME,\n collection: new NativeConstructor()\n });\n if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });\n });\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {\n var IS_ADDER = KEY == 'add' || KEY == 'set';\n if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {\n createNonEnumerableProperty(Constructor.prototype, KEY, function (a, b) {\n var collection = getInternalState(this).collection;\n if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;\n var result = collection[KEY](a === 0 ? 0 : a, b);\n return IS_ADDER ? this : result;\n });\n }\n });\n\n IS_WEAK || defineProperty(Constructor.prototype, 'size', {\n configurable: true,\n get: function () {\n return getInternalState(this).collection.size;\n }\n });\n }\n\n setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);\n\n exported[CONSTRUCTOR_NAME] = Constructor;\n $({ global: true, forced: true }, exported);\n\n if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);\n\n return Constructor;\n};\n","var redefine = require('../internals/redefine');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) {\n if (options && options.unsafe && target[key]) target[key] = src[key];\n else redefine(target, key, src[key], options);\n } return target;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar definePropertyModule = require('../internals/object-define-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","'use strict';\nvar defineProperty = require('../internals/object-define-property').f;\nvar create = require('../internals/object-create');\nvar redefineAll = require('../internals/redefine-all');\nvar bind = require('../internals/function-bind-context');\nvar anInstance = require('../internals/an-instance');\nvar iterate = require('../internals/iterate');\nvar defineIterator = require('../internals/define-iterator');\nvar setSpecies = require('../internals/set-species');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fastKey = require('../internals/internal-metadata').fastKey;\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = {\n getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, CONSTRUCTOR_NAME);\n setInternalState(that, {\n type: CONSTRUCTOR_NAME,\n index: create(null),\n first: undefined,\n last: undefined,\n size: 0\n });\n if (!DESCRIPTORS) that.size = 0;\n if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });\n });\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n var define = function (that, key, value) {\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n var previous, index;\n // change existing entry\n if (entry) {\n entry.value = value;\n // create new entry\n } else {\n state.last = entry = {\n index: index = fastKey(key, true),\n key: key,\n value: value,\n previous: previous = state.last,\n next: undefined,\n removed: false\n };\n if (!state.first) state.first = entry;\n if (previous) previous.next = entry;\n if (DESCRIPTORS) state.size++;\n else that.size++;\n // add to index\n if (index !== 'F') state.index[index] = entry;\n } return that;\n };\n\n var getEntry = function (that, key) {\n var state = getInternalState(that);\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return state.index[index];\n // frozen object case\n for (entry = state.first; entry; entry = entry.next) {\n if (entry.key == key) return entry;\n }\n };\n\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n var that = this;\n var state = getInternalState(that);\n var data = state.index;\n var entry = state.first;\n while (entry) {\n entry.removed = true;\n if (entry.previous) entry.previous = entry.previous.next = undefined;\n delete data[entry.index];\n entry = entry.next;\n }\n state.first = state.last = undefined;\n if (DESCRIPTORS) state.size = 0;\n else that.size = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = this;\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.next;\n var prev = entry.previous;\n delete state.index[entry.index];\n entry.removed = true;\n if (prev) prev.next = next;\n if (next) next.previous = prev;\n if (state.first == entry) state.first = next;\n if (state.last == entry) state.last = prev;\n if (DESCRIPTORS) state.size--;\n else that.size--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n var state = getInternalState(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.next : state.first) {\n boundFunction(entry.value, entry.key, this);\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(this, key);\n }\n });\n\n redefineAll(C.prototype, IS_MAP ? {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return define(this, key === 0 ? 0 : key, value);\n }\n } : {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return define(this, value = value === 0 ? 0 : value, value);\n }\n });\n if (DESCRIPTORS) defineProperty(C.prototype, 'size', {\n get: function () {\n return getInternalState(this).size;\n }\n });\n return C;\n },\n setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {\n var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';\n var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);\n var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {\n setInternalState(this, {\n type: ITERATOR_NAME,\n target: iterated,\n state: getInternalCollectionState(iterated),\n kind: kind,\n last: undefined\n });\n }, function () {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var entry = state.last;\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n // get next entry\n if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {\n // or finish the iteration\n state.target = undefined;\n return { value: undefined, done: true };\n }\n // return step by kind\n if (kind == 'keys') return { value: entry.key, done: false };\n if (kind == 'values') return { value: entry.value, done: false };\n return { value: [entry.key, entry.value], done: false };\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(CONSTRUCTOR_NAME);\n }\n};\n","'use strict';\nvar collection = require('../internals/collection');\nvar collectionStrong = require('../internals/collection-strong');\n\n// `Map` constructor\n// https://tc39.github.io/ecma262/#sec-map-objects\nmodule.exports = collection('Map', function (init) {\n return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };\n}, collectionStrong);\n","require('../../modules/es.map');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nrequire('../../modules/web.dom-collections.iterator');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Map;\n","var parent = require('../../es/map');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/map\");","var parent = require('../../es/object/create');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/object/create\");","var $ = require('../internals/export');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n$({ target: 'Object', stat: true }, {\n setPrototypeOf: setPrototypeOf\n});\n","require('../../modules/es.object.set-prototype-of');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.setPrototypeOf;\n","var parent = require('../../es/object/set-prototype-of');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/object/set-prototype-of\");","var _Object$setPrototypeOf = require(\"@babel/runtime-corejs3/core-js/object/set-prototype-of\");\n\nfunction _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = _Object$setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var _Object$create = require(\"@babel/runtime-corejs3/core-js/object/create\");\n\nvar setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _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}\n\nmodule.exports = _inherits;","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}\n\nmodule.exports = _assertThisInitialized;","var _typeof = require(\"@babel/runtime-corejs3/helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","var parent = require('../../es/object/get-prototype-of');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/object/get-prototype-of\");","var _Object$getPrototypeOf = require(\"@babel/runtime-corejs3/core-js/object/get-prototype-of\");\n\nvar _Object$setPrototypeOf = require(\"@babel/runtime-corejs3/core-js/object/set-prototype-of\");\n\nfunction _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _Object$getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || _Object$getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import { Assignable } from \"vis-util/esnext\";\nimport { DataSet } from \"./data-set\";\nimport { DataStream } from \"./data-stream\";\n\ntype ValueOf<T> = T[keyof T];\n\n/** Valid id type. */\nexport type Id = number | string;\n/** Nullable id type. */\nexport type OptId = undefined | null | Id;\n/**\n * Determine whether a value can be used as an id.\n *\n * @param value - Input value of unknown type.\n *\n * @returns True if the value is valid id, false otherwise.\n */\nexport function isId(value: unknown): value is Id {\n return typeof value === \"string\" || typeof value === \"number\";\n}\n\n/**\n * Make an object deeply partial.\n */\nexport type DeepPartial<T> = T extends any[] | Function | Node\n ? T\n : T extends object\n ? { [key in keyof T]?: DeepPartial<T[key]> }\n : T;\n\n/**\n * An item that may ([[Id]]) or may not (absent, undefined or null) have an id property.\n *\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport type PartItem<IdProp extends string> = Partial<Record<IdProp, OptId>>;\n/**\n * An item that has a property containing an id and all other required properties of given item type.\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport type FullItem<\n Item extends PartItem<IdProp>,\n IdProp extends string\n> = Item & Record<IdProp, Id>;\n/**\n * An item that has a property containing an id and optionally other properties of given item type.\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport type UpdateItem<\n Item extends PartItem<IdProp>,\n IdProp extends string\n> = Assignable<FullItem<Item, IdProp>> & Record<IdProp, Id>;\n\n/**\n * Test whether an item has an id (is a [[FullItem]]).\n *\n * @param item - The item to be tested.\n * @param idProp - Name of the id property.\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n *\n * @returns True if this value is a [[FullItem]], false otherwise.\n */\nexport function isFullItem<\n Item extends PartItem<IdProp>,\n IdProp extends string\n>(item: Item, idProp: IdProp): item is FullItem<Item, IdProp> {\n return item[idProp] != null;\n}\n\n/** Add event payload. */\nexport interface AddEventPayload {\n /** Ids of added items. */\n items: Id[];\n}\n/** Update event payload. */\nexport interface UpdateEventPayload<Item, IdProp extends string> {\n /** Ids of updated items. */\n items: Id[];\n /** Items as they were before this update. */\n oldData: FullItem<Item, IdProp>[];\n /**\n * Items as they are now.\n *\n * @deprecated Just get the data from the data set or data view.\n */\n data: FullItem<Item, IdProp>[];\n}\n/** Remove event payload. */\nexport interface RemoveEventPayload<Item, IdProp extends string> {\n /** Ids of removed items. */\n items: Id[];\n /** Items as they were before their removal. */\n oldData: FullItem<Item, IdProp>[];\n}\n\n/**\n * Map of event payload types (event name → payload).\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport interface EventPayloads<Item, IdProp extends string> {\n add: AddEventPayload;\n update: UpdateEventPayload<Item, IdProp>;\n remove: RemoveEventPayload<Item, IdProp>;\n}\n/**\n * Map of event payload types including any event (event name → payload).\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport interface EventPayloadsWithAny<Item, IdProp extends string>\n extends EventPayloads<Item, IdProp> {\n \"*\": ValueOf<EventPayloads<Item, IdProp>>;\n}\n\n/**\n * Map of event callback types (event name → callback).\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport interface EventCallbacks<Item, IdProp extends string> {\n /**\n * @param name - The name of the event ([[EventName]]).\n * @param payload - Data about the items affected by this event.\n * @param senderId - A senderId, optionally provided by the application code which triggered the event. If senderId is not provided, the argument will be `null`.\n */\n add(name: \"add\", payload: AddEventPayload | null, senderId?: Id | null): void;\n /**\n * @param name - The name of the event ([[EventName]]).\n * @param payload - Data about the items affected by this event.\n * @param senderId - A senderId, optionally provided by the application code which triggered the event. If senderId is not provided, the argument will be `null`.\n */\n update(\n name: \"update\",\n payload: UpdateEventPayload<Item, IdProp> | null,\n senderId?: Id | null\n ): void;\n /**\n * @param name - The name of the event ([[EventName]]).\n * @param payload - Data about the items affected by this event.\n * @param senderId - A senderId, optionally provided by the application code which triggered the event. If senderId is not provided, the argument will be `null`.\n */\n remove(\n name: \"remove\",\n payload: RemoveEventPayload<Item, IdProp> | null,\n senderId?: Id | null\n ): void;\n}\n/**\n * Map of event callback types including any event (event name → callback).\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport interface EventCallbacksWithAny<Item, IdProp extends string>\n extends EventCallbacks<Item, IdProp> {\n /**\n * @param name - The name of the event ([[EventName]]).\n * @param payload - Data about the items affected by this event.\n * @param senderId - A senderId, optionally provided by the application code which triggered the event. If senderId is not provided, the argument will be `null`.\n */\n \"*\"<N extends keyof EventCallbacks<Item, IdProp>>(\n name: N,\n payload: EventPayloads<Item, IdProp>[N],\n senderId?: Id | null\n ): void;\n}\n\n/** Available event names. */\nexport type EventName = keyof EventPayloads<never, \"\">;\n/** Available event names and '*' to listen for all. */\nexport type EventNameWithAny = keyof EventPayloadsWithAny<never, \"\">;\n\n/**\n * Data interface order parameter.\n * - A string value determines which property will be used for sorting (using < and > operators for numeric comparison).\n * - A function will be used the same way as in Array.sort.\n *\n * @typeParam Item - Item type that may or may not have an id.\n */\nexport type DataInterfaceOrder<Item> =\n | keyof Item\n | ((a: Item, b: Item) => number);\n\n/**\n * Data interface get options (return type independent).\n *\n * @typeParam Item - Item type that may or may not have an id.\n */\nexport interface DataInterfaceGetOptionsBase<Item> {\n /**\n * An array with field names, or an object with current field name and new field name that the field is returned as. By default, all properties of the items are emitted. When fields is defined, only the properties whose name is specified in fields will be included in the returned items.\n *\n * @remarks\n * **Warning**: There is no TypeScript support for this.\n */\n fields?: string[] | Record<string, string>;\n /** Items can be filtered on specific properties by providing a filter function. A filter function is executed for each of the items in the DataSet, and is called with the item as parameter. The function must return a boolean. All items for which the filter function returns true will be emitted. */\n filter?: (item: Item) => boolean;\n /** Order the items by a field name or custom sort function. */\n order?: DataInterfaceOrder<Item>;\n}\n\n/**\n * Data interface get options (returns a single item or an array).\n *\n * @remarks\n * Whether an item or and array of items is returned is determined by the type of the id(s) argument.\n * If an array of ids is requested an array of items will be returned.\n * If a single id is requested a single item (or null if the id doesn't correspond to any item) will be returned.\n *\n * @typeParam Item - Item type that may or may not have an id.\n */\nexport interface DataInterfaceGetOptionsArray<Item>\n extends DataInterfaceGetOptionsBase<Item> {\n /** Items will be returned as a single item (if invoked with an id) or an array of items (if invoked with an array of ids). */\n returnType?: undefined | \"Array\";\n}\n/**\n * Data interface get options (returns an object).\n *\n * @remarks\n * The returned object has ids as keys and items as values of corresponding ids.\n *\n * @typeParam Item - Item type that may or may not have an id.\n */\nexport interface DataInterfaceGetOptionsObject<Item>\n extends DataInterfaceGetOptionsBase<Item> {\n /** Items will be returned as an object map (id → item). */\n returnType: \"Object\";\n}\n/**\n * Data interface get options (returns single item, an array or object).\n *\n * @typeParam Item - Item type that may or may not have an id.\n */\nexport type DataInterfaceGetOptions<Item> =\n | DataInterfaceGetOptionsArray<Item>\n | DataInterfaceGetOptionsObject<Item>;\n\n/**\n * Data interface get ids options.\n *\n * @typeParam Item - Item type that may or may not have an id.\n */\nexport interface DataInterfaceGetIdsOptions<Item> {\n /** Items can be filtered on specific properties by providing a filter function. A filter function is executed for each of the items in the DataSet, and is called with the item as parameter. The function must return a boolean. All items for which the filter function returns true will be emitted. */\n filter?: (item: Item) => boolean;\n /** Order the items by a field name or custom sort function. */\n order?: DataInterfaceOrder<Item>;\n}\n\n/**\n * Data interface for each options.\n *\n * @typeParam Item - Item type that may or may not have an id.\n */\nexport interface DataInterfaceForEachOptions<Item> {\n /** An array with field names, or an object with current field name and new field name that the field is returned as. By default, all properties of the items are emitted. When fields is defined, only the properties whose name is specified in fields will be included in the returned items. */\n fields?: string[] | Record<string, string>;\n /** Items can be filtered on specific properties by providing a filter function. A filter function is executed for each of the items in the DataSet, and is called with the item as parameter. The function must return a boolean. All items for which the filter function returns true will be emitted. */\n filter?: (item: Item) => boolean;\n /** Order the items by a field name or custom sort function. */\n order?: DataInterfaceOrder<Item>;\n}\n\n/**\n * Data interface map oprions.\n *\n * @typeParam Original - The original item type in the data.\n * @typeParam Mapped - The type after mapping.\n */\nexport interface DataInterfaceMapOptions<Original, Mapped> {\n /** An array with field names, or an object with current field name and new field name that the field is returned as. By default, all properties of the items are emitted. When fields is defined, only the properties whose name is specified in fields will be included in the returned items. */\n fields?: string[] | Record<string, string>;\n /** Items can be filtered on specific properties by providing a filter function. A filter function is executed for each of the items in the DataSet, and is called with the item as parameter. The function must return a boolean. All items for which the filter function returns true will be emitted. */\n filter?: (item: Original) => boolean;\n /** Order the items by a field name or custom sort function. */\n order?: DataInterfaceOrder<Mapped>;\n}\n\n/**\n * Common interface for data sets and data view.\n *\n * @typeParam Item - Item type that may or may not have an id (missing ids will be generated upon insertion).\n * @typeParam IdProp - Name of the property on the Item type that contains the id.\n */\nexport interface DataInterface<\n Item extends PartItem<IdProp>,\n IdProp extends string = \"id\"\n> {\n /** The number of items. */\n length: number;\n\n /** The key of id property. */\n idProp: IdProp;\n\n /**\n * Add a universal event listener.\n *\n * @remarks The `*` event is triggered when any of the events `add`, `update`, and `remove` occurs.\n *\n * @param event - Event name.\n * @param callback - Callback function.\n */\n on(event: \"*\", callback: EventCallbacksWithAny<Item, IdProp>[\"*\"]): void;\n /**\n * Add an `add` event listener.\n *\n * @remarks The `add` event is triggered when an item or a set of items is added, or when an item is updated while not yet existing.\n *\n * @param event - Event name.\n * @param callback - Callback function.\n */\n on(event: \"add\", callback: EventCallbacksWithAny<Item, IdProp>[\"add\"]): void;\n /**\n * Add a `remove` event listener.\n *\n * @remarks The `remove` event is triggered when an item or a set of items is removed.\n *\n * @param event - Event name.\n * @param callback - Callback function.\n */\n on(\n event: \"remove\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"remove\"]\n ): void;\n /**\n * Add an `update` event listener.\n *\n * @remarks The `update` event is triggered when an existing item or a set of existing items is updated.\n *\n * @param event - Event name.\n * @param callback - Callback function.\n */\n on(\n event: \"update\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"update\"]\n ): void;\n\n /**\n * Remove a universal event listener.\n *\n * @param event - Event name.\n * @param callback - Callback function.\n */\n off(event: \"*\", callback: EventCallbacksWithAny<Item, IdProp>[\"*\"]): void;\n /**\n * Remove an `add` event listener.\n *\n * @param event - Event name.\n * @param callback - Callback function.\n */\n off(event: \"add\", callback: EventCallbacksWithAny<Item, IdProp>[\"add\"]): void;\n /**\n * Remove a `remove` event listener.\n *\n * @param event - Event name.\n * @param callback - Callback function.\n */\n off(\n event: \"remove\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"remove\"]\n ): void;\n /**\n * Remove an `update` event listener.\n *\n * @param event - Event name.\n * @param callback - Callback function.\n */\n off(\n event: \"update\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"update\"]\n ): void;\n\n /**\n * Get all the items.\n *\n * @returns An array containing all the items.\n */\n get(): FullItem<Item, IdProp>[];\n /**\n * Get all the items.\n *\n * @param options - Additional options.\n *\n * @returns An array containing requested items.\n */\n get(options: DataInterfaceGetOptionsArray<Item>): FullItem<Item, IdProp>[];\n /**\n * Get all the items.\n *\n * @param options - Additional options.\n *\n * @returns An object map of items (may be an empty object if there are no items).\n */\n get(\n options: DataInterfaceGetOptionsObject<Item>\n ): Record<Id, FullItem<Item, IdProp>>;\n /**\n * Get all the items.\n *\n * @param options - Additional options.\n *\n * @returns An array containing requested items or if requested an object map of items (may be an empty object if there are no items).\n */\n get(\n options: DataInterfaceGetOptions<Item>\n ): FullItem<Item, IdProp>[] | Record<Id, FullItem<Item, IdProp>>;\n /**\n * Get one item.\n *\n * @param id - The id of the item.\n *\n * @returns The item or null if the id doesn't correspond to any item.\n */\n get(id: Id): null | FullItem<Item, IdProp>;\n /**\n * Get one item.\n *\n * @param id - The id of the item.\n * @param options - Additional options.\n *\n * @returns The item or null if the id doesn't correspond to any item.\n */\n get(\n id: Id,\n options: DataInterfaceGetOptionsArray<Item>\n ): null | FullItem<Item, IdProp>;\n /**\n * Get one item.\n *\n * @param id - The id of the item.\n * @param options - Additional options.\n *\n * @returns An object map of items (may be an empty object if no item was found).\n */\n get(\n id: Id,\n options: DataInterfaceGetOptionsObject<Item>\n ): Record<Id, FullItem<Item, IdProp>>;\n /**\n * Get one item.\n *\n * @param id - The id of the item.\n * @param options - Additional options.\n *\n * @returns The item if found or null otherwise. If requested an object map with 0 to 1 items.\n */\n get(\n id: Id,\n options: DataInterfaceGetOptions<Item>\n ): null | FullItem<Item, IdProp> | Record<Id, FullItem<Item, IdProp>>;\n /**\n * Get multiple items.\n *\n * @param ids - An array of requested ids.\n *\n * @returns An array of found items (ids that do not correspond to any item are omitted).\n */\n get(ids: Id[]): FullItem<Item, IdProp>[];\n /**\n * Get multiple items.\n *\n * @param ids - An array of requested ids.\n * @param options - Additional options.\n *\n * @returns An array of found items (ids that do not correspond to any item are omitted).\n */\n get(\n ids: Id[],\n options: DataInterfaceGetOptionsArray<Item>\n ): FullItem<Item, IdProp>[];\n /**\n * Get multiple items.\n *\n * @param ids - An array of requested ids.\n * @param options - Additional options.\n *\n * @returns An object map of items (may be an empty object if no item was found).\n */\n get(\n ids: Id[],\n options: DataInterfaceGetOptionsObject<Item>\n ): Record<Id, FullItem<Item, IdProp>>;\n /**\n * Get multiple items.\n *\n * @param ids - An array of requested ids.\n * @param options - Additional options.\n *\n * @returns An array of found items (ids that do not correspond to any item are omitted).\n * If requested an object map of items (may be an empty object if no item was found).\n */\n get(\n ids: Id[],\n options: DataInterfaceGetOptions<Item>\n ): FullItem<Item, IdProp>[] | Record<Id, FullItem<Item, IdProp>>;\n /**\n * Get items.\n *\n * @param ids - Id or ids to be returned.\n * @param options - Options to specify iteration details.\n *\n * @returns The items (format is determined by ids (single or array) and the options.\n */\n get(\n ids: Id | Id[],\n options?: DataInterfaceGetOptions<Item>\n ):\n | null\n | FullItem<Item, IdProp>\n | FullItem<Item, IdProp>[]\n | Record<Id, FullItem<Item, IdProp>>;\n\n /**\n * Get the DataSet to which the instance implementing this interface is connected.\n * In case there is a chain of multiple DataViews, the root DataSet of this chain is returned.\n *\n * @returns The data set that actually contains the data.\n */\n getDataSet(): DataSet<Item, IdProp>;\n\n /**\n * Get ids of items.\n *\n * @remarks\n * No guarantee is given about the order of returned ids unless an ordering function is supplied.\n *\n * @param options - Additional configuration.\n *\n * @returns An array of requested ids.\n */\n getIds(options?: DataInterfaceGetIdsOptions<Item>): Id[];\n\n /**\n * Execute a callback function for each item.\n *\n * @remarks\n * No guarantee is given about the order of iteration unless an ordering function is supplied.\n *\n * @param callback - Executed in similar fashion to Array.forEach callback, but instead of item, index, array receives item, id.\n * @param options - Options to specify iteration details.\n */\n forEach(\n callback: (item: Item, id: Id) => void,\n options?: DataInterfaceForEachOptions<Item>\n ): void;\n\n /**\n * Map each item into different item and return them as an array.\n *\n * @remarks\n * No guarantee is given about the order of iteration even if ordering function is supplied (the items are sorted after the mapping).\n *\n * @param callback - Array.map-like callback, but only with the first two params.\n * @param options - Options to specify iteration details.\n *\n * @returns The mapped items.\n */\n map<T>(\n callback: (item: Item, id: Id) => T,\n options?: DataInterfaceMapOptions<Item, T>\n ): T[];\n\n /**\n * Stream.\n *\n * @param ids - Ids of the items to be included in this stream (missing are ignored), all if omitted.\n *\n * @returns The data stream for this data set.\n */\n stream(ids?: Iterable<Id>): DataStream<Item>;\n}\n","/** Queue configuration object. */\nexport interface QueueOptions {\n /** The queue will be flushed automatically after an inactivity of this delay in milliseconds. By default there is no automatic flushing (`null`). */\n delay?: null | number;\n /** When the queue exceeds the given maximum number of entries, the queue is flushed automatically. Default value is `Infinity`. */\n max?: number;\n}\n/**\n * Queue extending options.\n *\n * @typeParam T - The type of method names to be replaced by queued versions.\n */\nexport interface QueueExtendOptions<T> {\n /** A list with method names of the methods on the object to be replaced with queued ones. */\n replace: T[];\n /** When provided, the queue will be flushed automatically after an inactivity of this delay in milliseconds. Default value is null. */\n delay?: number;\n /** When the queue exceeds the given maximum number of entries, the queue is flushed automatically. Default value of max is Infinity. */\n max?: number;\n}\n/**\n * Queue call entry.\n * - A function to be executed.\n * - An object with function, args, context (like function.bind(context, ...args)).\n */\ntype QueueCallEntry =\n | Function\n | {\n fn: Function;\n args: unknown[];\n }\n | {\n fn: Function;\n args: unknown[];\n context: unknown;\n };\n\ninterface QueueExtended<O> {\n object: O;\n methods: {\n name: string;\n original: unknown;\n }[];\n}\n\n/**\n * A queue.\n *\n * @typeParam T - The type of method names to be replaced by queued versions.\n */\nexport class Queue<T = never> {\n /** Delay in milliseconds. If defined the queue will be periodically flushed. */\n public delay: null | number;\n /** Maximum number of entries in the queue before it will be flushed. */\n public max: number;\n\n private readonly _queue: {\n fn: Function;\n args?: unknown[];\n context?: unknown;\n }[] = [];\n\n private _timeout: ReturnType<typeof setTimeout> | null = null;\n private _extended: null | QueueExtended<T> = null;\n\n /**\n * Construct a new Queue.\n *\n * @param options - Queue configuration.\n */\n public constructor(options?: QueueOptions) {\n // options\n this.delay = null;\n this.max = Infinity;\n\n this.setOptions(options);\n }\n\n /**\n * Update the configuration of the queue.\n *\n * @param options - Queue configuration.\n */\n public setOptions(options?: QueueOptions): void {\n if (options && typeof options.delay !== \"undefined\") {\n this.delay = options.delay;\n }\n if (options && typeof options.max !== \"undefined\") {\n this.max = options.max;\n }\n\n this._flushIfNeeded();\n }\n\n /**\n * Extend an object with queuing functionality.\n * The object will be extended with a function flush, and the methods provided in options.replace will be replaced with queued ones.\n *\n * @param object - The object to be extended.\n * @param options - Additional options.\n *\n * @returns The created queue.\n */\n public static extend<O extends { flush?: () => void }, K extends string>(\n object: O,\n options: QueueExtendOptions<K>\n ): Queue<O> {\n const queue = new Queue<O>(options);\n\n if (object.flush !== undefined) {\n throw new Error(\"Target object already has a property flush\");\n }\n object.flush = (): void => {\n queue.flush();\n };\n\n const methods: QueueExtended<O>[\"methods\"] = [\n {\n name: \"flush\",\n original: undefined,\n },\n ];\n\n if (options && options.replace) {\n for (let i = 0; i < options.replace.length; i++) {\n const name = options.replace[i];\n methods.push({\n name: name,\n // @TODO: better solution?\n original: ((object as unknown) as Record<K, () => void>)[name],\n });\n // @TODO: better solution?\n queue.replace((object as unknown) as Record<K, () => void>, name);\n }\n }\n\n queue._extended = {\n object: object,\n methods: methods,\n };\n\n return queue;\n }\n\n /**\n * Destroy the queue. The queue will first flush all queued actions, and in case it has extended an object, will restore the original object.\n */\n public destroy(): void {\n this.flush();\n\n if (this._extended) {\n const object = this._extended.object;\n const methods = this._extended.methods;\n for (let i = 0; i < methods.length; i++) {\n const method = methods[i];\n if (method.original) {\n // @TODO: better solution?\n (object as any)[method.name] = method.original;\n } else {\n // @TODO: better solution?\n delete (object as any)[method.name];\n }\n }\n this._extended = null;\n }\n }\n\n /**\n * Replace a method on an object with a queued version.\n *\n * @param object - Object having the method.\n * @param method - The method name.\n */\n public replace<M extends string>(\n object: Record<M, () => void>,\n method: M\n ): void {\n /* eslint-disable-next-line @typescript-eslint/no-this-alias -- Function this is necessary in the function bellow, so class this has to be saved into a variable here. */\n const me = this;\n const original = object[method];\n if (!original) {\n throw new Error(\"Method \" + method + \" undefined\");\n }\n\n object[method] = function (...args: unknown[]): void {\n // add this call to the queue\n me.queue({\n args: args,\n fn: original,\n context: this,\n });\n };\n }\n\n /**\n * Queue a call.\n *\n * @param entry - The function or entry to be queued.\n */\n public queue(entry: QueueCallEntry): void {\n if (typeof entry === \"function\") {\n this._queue.push({ fn: entry });\n } else {\n this._queue.push(entry);\n }\n\n this._flushIfNeeded();\n }\n\n /**\n * Check whether the queue needs to be flushed.\n */\n private _flushIfNeeded(): void {\n // flush when the maximum is exceeded.\n if (this._queue.length > this.max) {\n this.flush();\n }\n\n // flush after a period of inactivity when a delay is configured\n if (this._timeout != null) {\n clearTimeout(this._timeout);\n this._timeout = null;\n }\n if (this.queue.length > 0 && typeof this.delay === \"number\") {\n this._timeout = setTimeout((): void => {\n this.flush();\n }, this.delay);\n }\n }\n\n /**\n * Flush all queued calls\n */\n public flush(): void {\n this._queue.splice(0).forEach((entry): void => {\n entry.fn.apply(entry.context || entry.fn, entry.args || []);\n });\n }\n}\n","import {\n DataInterface,\n EventCallbacksWithAny,\n EventName,\n EventNameWithAny,\n EventPayloads,\n Id,\n} from \"./data-interface\";\n\ntype EventSubscribers<Item, IdProp extends string> = {\n [Name in keyof EventCallbacksWithAny<Item, IdProp>]: (...args: any[]) => void;\n};\n\n/**\n * [[DataSet]] code that can be reused in [[DataView]] or other similar implementations of [[DataInterface]].\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport abstract class DataSetPart<Item, IdProp extends string>\n implements Pick<DataInterface<Item, IdProp>, \"on\" | \"off\"> {\n private readonly _subscribers: {\n [Name in EventNameWithAny]: EventSubscribers<Item, IdProp>[Name][];\n } = {\n \"*\": [],\n add: [],\n remove: [],\n update: [],\n };\n\n protected _trigger(\n event: \"add\",\n payload: EventPayloads<Item, IdProp>[\"add\"],\n senderId?: Id | null\n ): void;\n protected _trigger(\n event: \"update\",\n payload: EventPayloads<Item, IdProp>[\"update\"],\n senderId?: Id | null\n ): void;\n protected _trigger(\n event: \"remove\",\n payload: EventPayloads<Item, IdProp>[\"remove\"],\n senderId?: Id | null\n ): void;\n /**\n * Trigger an event\n *\n * @param event - Event name.\n * @param payload - Event payload.\n * @param senderId - Id of the sender.\n */\n protected _trigger<Name extends EventName>(\n event: Name,\n payload: EventPayloads<Item, IdProp>[Name],\n senderId?: Id | null\n ): void {\n if ((event as string) === \"*\") {\n throw new Error(\"Cannot trigger event *\");\n }\n\n [...this._subscribers[event], ...this._subscribers[\"*\"]].forEach(\n (subscriber): void => {\n subscriber(event, payload, senderId != null ? senderId : null);\n }\n );\n }\n\n /** @inheritDoc */\n public on(\n event: \"*\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"*\"]\n ): void;\n /** @inheritDoc */\n public on(\n event: \"add\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"add\"]\n ): void;\n /** @inheritDoc */\n public on(\n event: \"remove\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"remove\"]\n ): void;\n /** @inheritDoc */\n public on(\n event: \"update\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"update\"]\n ): void;\n /**\n * Subscribe to an event, add an event listener.\n *\n * @remarks Non-function callbacks are ignored.\n *\n * @param event - Event name.\n * @param callback - Callback method.\n */\n public on<Name extends EventNameWithAny>(\n event: Name,\n callback: EventCallbacksWithAny<Item, IdProp>[Name]\n ): void {\n if (typeof callback === \"function\") {\n this._subscribers[event].push(callback);\n }\n // @TODO: Maybe throw for invalid callbacks?\n }\n\n /** @inheritDoc */\n public off(\n event: \"*\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"*\"]\n ): void;\n /** @inheritDoc */\n public off(\n event: \"add\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"add\"]\n ): void;\n /** @inheritDoc */\n public off(\n event: \"remove\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"remove\"]\n ): void;\n /** @inheritDoc */\n public off(\n event: \"update\",\n callback: EventCallbacksWithAny<Item, IdProp>[\"update\"]\n ): void;\n /**\n * Unsubscribe from an event, remove an event listener.\n *\n * @remarks If the same callback was subscribed more than once **all** occurences will be removed.\n *\n * @param event - Event name.\n * @param callback - Callback method.\n */\n public off<Name extends EventNameWithAny>(\n event: Name,\n callback: EventCallbacksWithAny<Item, IdProp>[Name]\n ): void {\n this._subscribers[event] = this._subscribers[event].filter(\n (subscriber): boolean => subscriber !== callback\n );\n }\n\n /**\n * @deprecated Use on instead (PS: DataView.subscribe === DataView.on).\n */\n public subscribe: DataSetPart<Item, IdProp>[\"on\"] = DataSetPart.prototype.on;\n /**\n * @deprecated Use off instead (PS: DataView.unsubscribe === DataView.off).\n */\n public unsubscribe: DataSetPart<Item, IdProp>[\"off\"] =\n DataSetPart.prototype.off;\n\n /* develblock:start */\n public get testLeakSubscribers(): any {\n return this._subscribers;\n }\n /* develblock:end */\n}\n","'use strict';\nvar collection = require('../internals/collection');\nvar collectionStrong = require('../internals/collection-strong');\n\n// `Set` constructor\n// https://tc39.github.io/ecma262/#sec-set-objects\nmodule.exports = collection('Set', function (init) {\n return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };\n}, collectionStrong);\n","require('../../modules/es.set');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nrequire('../../modules/web.dom-collections.iterator');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Set;\n","var parent = require('../../es/set');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/set\");","import { Id } from \"./data-interface\";\n\n/**\n * Data stream\n *\n * @remarks\n * [[DataStream]] offers an always up to date stream of items from a [[DataSet]] or [[DataView]].\n * That means that the stream is evaluated at the time of iteration, conversion to another data type or when [[cache]] is called, not when the [[DataStream]] was created.\n * Multiple invocations of for example [[toItemArray]] may yield different results (if the data source like for example [[DataSet]] gets modified).\n *\n * @typeParam Item - The item type this stream is going to work with.\n */\nexport class DataStream<Item> implements Iterable<[Id, Item]> {\n private readonly _pairs: Iterable<[Id, Item]>;\n\n /**\n * Create a new data stream.\n *\n * @param pairs - The id, item pairs.\n */\n public constructor(pairs: Iterable<[Id, Item]>) {\n this._pairs = pairs;\n }\n\n /**\n * Return an iterable of key, value pairs for every entry in the stream.\n */\n public *[Symbol.iterator](): IterableIterator<[Id, Item]> {\n for (const [id, item] of this._pairs) {\n yield [id, item];\n }\n }\n\n /**\n * Return an iterable of key, value pairs for every entry in the stream.\n */\n public *entries(): IterableIterator<[Id, Item]> {\n for (const [id, item] of this._pairs) {\n yield [id, item];\n }\n }\n\n /**\n * Return an iterable of keys in the stream.\n */\n public *keys(): IterableIterator<Id> {\n for (const [id] of this._pairs) {\n yield id;\n }\n }\n\n /**\n * Return an iterable of values in the stream.\n */\n public *values(): IterableIterator<Item> {\n for (const [, item] of this._pairs) {\n yield item;\n }\n }\n\n /**\n * Return an array containing all the ids in this stream.\n *\n * @remarks\n * The array may contain duplicities.\n *\n * @returns The array with all ids from this stream.\n */\n public toIdArray(): Id[] {\n return [...this._pairs].map((pair): Id => pair[0]);\n }\n\n /**\n * Return an array containing all the items in this stream.\n *\n * @remarks\n * The array may contain duplicities.\n *\n * @returns The array with all items from this stream.\n */\n public toItemArray(): Item[] {\n return [...this._pairs].map((pair): Item => pair[1]);\n }\n\n /**\n * Return an array containing all the entries in this stream.\n *\n * @remarks\n * The array may contain duplicities.\n *\n * @returns The array with all entries from this stream.\n */\n public toEntryArray(): [Id, Item][] {\n return [...this._pairs];\n }\n\n /**\n * Return an object map containing all the items in this stream accessible by ids.\n *\n * @remarks\n * In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.\n *\n * @returns The object map of all id → item pairs from this stream.\n */\n public toObjectMap(): Record<Id, Item> {\n const map: Record<Id, Item> = Object.create(null);\n for (const [id, item] of this._pairs) {\n map[id] = item;\n }\n return map;\n }\n\n /**\n * Return a map containing all the items in this stream accessible by ids.\n *\n * @returns The map of all id → item pairs from this stream.\n */\n public toMap(): Map<Id, Item> {\n return new Map(this._pairs);\n }\n\n /**\n * Return a set containing all the (unique) ids in this stream.\n *\n * @returns The set of all ids from this stream.\n */\n public toIdSet(): Set<Id> {\n return new Set(this.toIdArray());\n }\n\n /**\n * Return a set containing all the (unique) items in this stream.\n *\n * @returns The set of all items from this stream.\n */\n public toItemSet(): Set<Item> {\n return new Set(this.toItemArray());\n }\n\n /**\n * Cache the items from this stream.\n *\n * @remarks\n * This method allows for items to be fetched immediatelly and used (possibly multiple times) later.\n * It can also be used to optimize performance as [[DataStream]] would otherwise reevaluate everything upon each iteration.\n *\n * ## Example\n * ```javascript\n * const ds = new DataSet([…])\n *\n * const cachedStream = ds.stream()\n * .filter(…)\n * .sort(…)\n * .map(…)\n * .cached(…) // Data are fetched, processed and cached here.\n *\n * ds.clear()\n * chachedStream // Still has all the items.\n * ```\n *\n * @returns A new [[DataStream]] with cached items (detached from the original [[DataSet]]).\n */\n public cache(): DataStream<Item> {\n return new DataStream([...this._pairs]);\n }\n\n /**\n * Get the distinct values of given property.\n *\n * @param callback - The function that picks and possibly converts the property.\n *\n * @typeParam T - The type of the distinct value.\n *\n * @returns A set of all distinct properties.\n */\n public distinct<T>(callback: (item: Item, id: Id) => T): Set<T> {\n const set = new Set<T>();\n\n for (const [id, item] of this._pairs) {\n set.add(callback(item, id));\n }\n\n return set;\n }\n\n /**\n * Filter the items of the stream.\n *\n * @param callback - The function that decides whether an item will be included.\n *\n * @returns A new data stream with the filtered items.\n */\n public filter(callback: (item: Item, id: Id) => boolean): DataStream<Item> {\n const pairs = this._pairs;\n return new DataStream<Item>({\n *[Symbol.iterator](): IterableIterator<[Id, Item]> {\n for (const [id, item] of pairs) {\n if (callback(item, id)) {\n yield [id, item];\n }\n }\n },\n });\n }\n\n /**\n * Execute a callback for each item of the stream.\n *\n * @param callback - The function that will be invoked for each item.\n */\n public forEach(callback: (item: Item, id: Id) => boolean): void {\n for (const [id, item] of this._pairs) {\n callback(item, id);\n }\n }\n\n /**\n * Map the items into a different type.\n *\n * @param callback - The function that does the conversion.\n *\n * @typeParam Mapped - The type of the item after mapping.\n *\n * @returns A new data stream with the mapped items.\n */\n public map<Mapped>(\n callback: (item: Item, id: Id) => Mapped\n ): DataStream<Mapped> {\n const pairs = this._pairs;\n return new DataStream<Mapped>({\n *[Symbol.iterator](): IterableIterator<[Id, Mapped]> {\n for (const [id, item] of pairs) {\n yield [id, callback(item, id)];\n }\n },\n });\n }\n\n /**\n * Get the item with the maximum value of given property.\n *\n * @param callback - The function that picks and possibly converts the property.\n *\n * @returns The item with the maximum if found otherwise null.\n */\n public max(callback: (item: Item, id: Id) => number): Item | null {\n const iter = this._pairs[Symbol.iterator]();\n let curr = iter.next();\n if (curr.done) {\n return null;\n }\n\n let maxItem: Item = curr.value[1];\n let maxValue: number = callback(curr.value[1], curr.value[0]);\n while (!(curr = iter.next()).done) {\n const [id, item] = curr.value;\n const value = callback(item, id);\n if (value > maxValue) {\n maxValue = value;\n maxItem = item;\n }\n }\n\n return maxItem;\n }\n\n /**\n * Get the item with the minimum value of given property.\n *\n * @param callback - The function that picks and possibly converts the property.\n *\n * @returns The item with the minimum if found otherwise null.\n */\n public min(callback: (item: Item, id: Id) => number): Item | null {\n const iter = this._pairs[Symbol.iterator]();\n let curr = iter.next();\n if (curr.done) {\n return null;\n }\n\n let minItem: Item = curr.value[1];\n let minValue: number = callback(curr.value[1], curr.value[0]);\n while (!(curr = iter.next()).done) {\n const [id, item] = curr.value;\n const value = callback(item, id);\n if (value < minValue) {\n minValue = value;\n minItem = item;\n }\n }\n\n return minItem;\n }\n\n /**\n * Reduce the items into a single value.\n *\n * @param callback - The function that does the reduction.\n * @param accumulator - The initial value of the accumulator.\n *\n * @typeParam T - The type of the accumulated value.\n *\n * @returns The reduced value.\n */\n public reduce<T>(\n callback: (accumulator: T, item: Item, id: Id) => T,\n accumulator: T\n ): T {\n for (const [id, item] of this._pairs) {\n accumulator = callback(accumulator, item, id);\n }\n return accumulator;\n }\n\n /**\n * Sort the items.\n *\n * @param callback - Item comparator.\n *\n * @returns A new stream with sorted items.\n */\n public sort(\n callback: (itemA: Item, itemB: Item, idA: Id, idB: Id) => number\n ): DataStream<Item> {\n return new DataStream({\n [Symbol.iterator]: (): IterableIterator<[Id, Item]> =>\n [...this._pairs]\n .sort(([idA, itemA], [idB, itemB]): number =>\n callback(itemA, itemB, idA, idB)\n )\n [Symbol.iterator](),\n });\n }\n}\n","import { v4 as uuid4 } from \"uuid\";\nimport { pureDeepObjectAssign } from \"vis-util/esnext\";\n\nimport {\n DataInterface,\n DataInterfaceForEachOptions,\n DataInterfaceGetIdsOptions,\n DataInterfaceGetOptions,\n DataInterfaceGetOptionsArray,\n DataInterfaceGetOptionsObject,\n DataInterfaceMapOptions,\n DataInterfaceOrder,\n DeepPartial,\n EventPayloads,\n FullItem,\n Id,\n OptId,\n PartItem,\n UpdateItem,\n isId,\n} from \"./data-interface\";\n\nimport { Queue, QueueOptions } from \"./queue\";\nimport { DataSetPart } from \"./data-set-part\";\nimport { DataStream } from \"./data-stream\";\n\n/**\n * Initial DataSet configuration object.\n *\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport interface DataSetInitialOptions<IdProp extends string> {\n /**\n * The name of the field containing the id of the items. When data is fetched from a server which uses some specific field to identify items, this field name can be specified in the DataSet using the option `fieldId`. For example [CouchDB](http://couchdb.apache.org/) uses the field `'_id'` to identify documents.\n */\n fieldId?: IdProp;\n /**\n * Queue data changes ('add', 'update', 'remove') and flush them at once. The queue can be flushed manually by calling `DataSet.flush()`, or can be flushed after a configured delay or maximum number of entries.\n *\n * When queue is true, a queue is created with default options. Options can be specified by providing an object.\n */\n queue?: QueueOptions | false;\n}\n/** DataSet configuration object. */\nexport interface DataSetOptions {\n /**\n * Queue configuration object or false if no queue should be used.\n *\n * - If false and there was a queue before it will be flushed and then removed.\n * - If [[QueueOptions]] the existing queue will be reconfigured or a new queue will be created.\n */\n queue?: Queue | QueueOptions | false;\n}\n\n/**\n * Add an id to given item if it doesn't have one already.\n *\n * @remarks\n * The item will be modified.\n *\n * @param item - The item that will have an id after a call to this function.\n * @param idProp - The key of the id property.\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n *\n * @returns true\n */\nfunction ensureFullItem<Item extends PartItem<IdProp>, IdProp extends string>(\n item: Item,\n idProp: IdProp\n): FullItem<Item, IdProp> {\n if (item[idProp] == null) {\n // generate an id\n item[idProp] = uuid4() as any;\n }\n\n return item as FullItem<Item, IdProp>;\n}\n\n/**\n * # DataSet\n *\n * Vis.js comes with a flexible DataSet, which can be used to hold and\n * manipulate unstructured data and listen for changes in the data. The DataSet\n * is key/value based. Data items can be added, updated and removed from the\n * DataSet, and one can subscribe to changes in the DataSet. The data in the\n * DataSet can be filtered and ordered. Data can be normalized when appending it\n * to the DataSet as well.\n *\n * ## Example\n *\n * The following example shows how to use a DataSet.\n *\n * ```javascript\n * // create a DataSet\n * var options = {};\n * var data = new vis.DataSet(options);\n *\n * // add items\n * // note that the data items can contain different properties and data formats\n * data.add([\n * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},\n * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},\n * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},\n * {id: 4, text: 'item 4'}\n * ]);\n *\n * // subscribe to any change in the DataSet\n * data.on('*', function (event, properties, senderId) {\n * console.log('event', event, properties);\n * });\n *\n * // update an existing item\n * data.update({id: 2, group: 1});\n *\n * // remove an item\n * data.remove(4);\n *\n * // get all ids\n * var ids = data.getIds();\n * console.log('ids', ids);\n *\n * // get a specific item\n * var item1 = data.get(1);\n * console.log('item1', item1);\n *\n * // retrieve a filtered subset of the data\n * var items = data.get({\n * filter: function (item) {\n * return item.group == 1;\n * }\n * });\n * console.log('filtered items', items);\n * ```\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport class DataSet<\n Item extends PartItem<IdProp>,\n IdProp extends string = \"id\"\n >\n extends DataSetPart<Item, IdProp>\n implements DataInterface<Item, IdProp> {\n /** Flush all queued calls. */\n public flush?: () => void;\n /** @inheritDoc */\n public length: number;\n /** @inheritDoc */\n public get idProp(): IdProp {\n return this._idProp;\n }\n\n private readonly _options: DataSetInitialOptions<IdProp>;\n private readonly _data: Map<Id, FullItem<Item, IdProp>>;\n private readonly _idProp: IdProp;\n private _queue: Queue<this> | null = null;\n\n /**\n * @param options - DataSet configuration.\n */\n public constructor(options?: DataSetInitialOptions<IdProp>);\n /**\n * @param data - An initial set of items for the new instance.\n * @param options - DataSet configuration.\n */\n public constructor(data: Item[], options?: DataSetInitialOptions<IdProp>);\n /**\n * Construct a new DataSet.\n *\n * @param data - Initial data or options.\n * @param options - Options (type error if data is also options).\n */\n public constructor(\n data?: Item[] | DataSetInitialOptions<IdProp>,\n options?: DataSetInitialOptions<IdProp>\n ) {\n super();\n\n // correctly read optional arguments\n if (data && !Array.isArray(data)) {\n options = data;\n data = [];\n }\n\n this._options = options || {};\n this._data = new Map(); // map with data indexed by id\n this.length = 0; // number of items in the DataSet\n this._idProp = this._options.fieldId || (\"id\" as IdProp); // name of the field containing id\n\n // add initial data when provided\n if (data && data.length) {\n this.add(data);\n }\n\n this.setOptions(options);\n }\n\n /**\n * Set new options.\n *\n * @param options - The new options.\n */\n public setOptions(options?: DataSetOptions): void {\n if (options && options.queue !== undefined) {\n if (options.queue === false) {\n // delete queue if loaded\n if (this._queue) {\n this._queue.destroy();\n this._queue = null;\n }\n } else {\n // create queue and update its options\n if (!this._queue) {\n this._queue = Queue.extend(this, {\n replace: [\"add\", \"update\", \"remove\"],\n });\n }\n\n if (options.queue && typeof options.queue === \"object\") {\n this._queue.setOptions(options.queue);\n }\n }\n }\n }\n\n /**\n * Add a data item or an array with items.\n *\n * After the items are added to the DataSet, the DataSet will trigger an event `add`. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.\n *\n * ## Example\n *\n * ```javascript\n * // create a DataSet\n * const data = new vis.DataSet()\n *\n * // add items\n * const ids = data.add([\n * { id: 1, text: 'item 1' },\n * { id: 2, text: 'item 2' },\n * { text: 'item without an id' }\n * ])\n *\n * console.log(ids) // [1, 2, '<UUIDv4>']\n * ```\n *\n * @param data - Items to be added (ids will be generated if missing).\n * @param senderId - Sender id.\n *\n * @returns addedIds - Array with the ids (generated if not present) of the added items.\n *\n * @throws When an item with the same id as any of the added items already exists.\n */\n public add(data: Item | Item[], senderId?: Id | null): (string | number)[] {\n const addedIds: Id[] = [];\n let id: Id;\n\n if (Array.isArray(data)) {\n // Array\n const idsToAdd: Id[] = data.map((d) => d[this._idProp] as Id);\n if (idsToAdd.some((id) => this._data.has(id))) {\n throw new Error(\"A duplicate id was found in the parameter array.\");\n }\n for (let i = 0, len = data.length; i < len; i++) {\n id = this._addItem(data[i]);\n addedIds.push(id);\n }\n } else if (data && typeof data === \"object\") {\n // Single item\n id = this._addItem(data);\n addedIds.push(id);\n } else {\n throw new Error(\"Unknown dataType\");\n }\n\n if (addedIds.length) {\n this._trigger(\"add\", { items: addedIds }, senderId);\n }\n\n return addedIds;\n }\n\n /**\n * Update existing items. When an item does not exist, it will be created.\n *\n * @remarks\n * The provided properties will be merged in the existing item. When an item does not exist, it will be created.\n *\n * After the items are updated, the DataSet will trigger an event `add` for the added items, and an event `update`. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.\n *\n * ## Example\n *\n * ```javascript\n * // create a DataSet\n * const data = new vis.DataSet([\n * { id: 1, text: 'item 1' },\n * { id: 2, text: 'item 2' },\n * { id: 3, text: 'item 3' }\n * ])\n *\n * // update items\n * const ids = data.update([\n * { id: 2, text: 'item 2 (updated)' },\n * { id: 4, text: 'item 4 (new)' }\n * ])\n *\n * console.log(ids) // [2, 4]\n * ```\n *\n * ## Warning for TypeScript users\n * This method may introduce partial items into the data set. Use add or updateOnly instead for better type safety.\n *\n * @param data - Items to be updated (if the id is already present) or added (if the id is missing).\n * @param senderId - Sender id.\n *\n * @returns updatedIds - The ids of the added (these may be newly generated if there was no id in the item from the data) or updated items.\n *\n * @throws When the supplied data is neither an item nor an array of items.\n */\n public update(\n data: DeepPartial<Item> | DeepPartial<Item>[],\n senderId?: Id | null\n ): Id[] {\n const addedIds: Id[] = [];\n const updatedIds: Id[] = [];\n const oldData: FullItem<Item, IdProp>[] = [];\n const updatedData: FullItem<Item, IdProp>[] = [];\n const idProp = this._idProp;\n\n const addOrUpdate = (item: DeepPartial<Item>): void => {\n const origId: OptId = item[idProp];\n if (origId != null && this._data.has(origId)) {\n const fullItem = item as FullItem<Item, IdProp>; // it has an id, therefore it is a fullitem\n const oldItem = Object.assign({}, this._data.get(origId));\n // update item\n const id = this._updateItem(fullItem);\n updatedIds.push(id);\n updatedData.push(fullItem);\n oldData.push(oldItem);\n } else {\n // add new item\n const id = this._addItem(item as any);\n addedIds.push(id);\n }\n };\n\n if (Array.isArray(data)) {\n // Array\n for (let i = 0, len = data.length; i < len; i++) {\n if (data[i] && typeof data[i] === \"object\") {\n addOrUpdate(data[i]);\n } else {\n console.warn(\n \"Ignoring input item, which is not an object at index \" + i\n );\n }\n }\n } else if (data && typeof data === \"object\") {\n // Single item\n addOrUpdate(data);\n } else {\n throw new Error(\"Unknown dataType\");\n }\n\n if (addedIds.length) {\n this._trigger(\"add\", { items: addedIds }, senderId);\n }\n if (updatedIds.length) {\n const props = { items: updatedIds, oldData: oldData, data: updatedData };\n // TODO: remove deprecated property 'data' some day\n //Object.defineProperty(props, 'data', {\n // 'get': (function() {\n // console.warn('Property data is deprecated. Use DataSet.get(ids) to retrieve the new data, use the oldData property on this object to get the old data');\n // return updatedData;\n // }).bind(this)\n //});\n this._trigger(\"update\", props, senderId);\n }\n\n return addedIds.concat(updatedIds);\n }\n\n /**\n * Update existing items. When an item does not exist, an error will be thrown.\n *\n * @remarks\n * The provided properties will be deeply merged into the existing item.\n * When an item does not exist (id not present in the data set or absent), an error will be thrown and nothing will be changed.\n *\n * After the items are updated, the DataSet will trigger an event `update`.\n * When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.\n *\n * ## Example\n *\n * ```javascript\n * // create a DataSet\n * const data = new vis.DataSet([\n * { id: 1, text: 'item 1' },\n * { id: 2, text: 'item 2' },\n * { id: 3, text: 'item 3' },\n * ])\n *\n * // update items\n * const ids = data.update([\n * { id: 2, text: 'item 2 (updated)' }, // works\n * // { id: 4, text: 'item 4 (new)' }, // would throw\n * // { text: 'item 4 (new)' }, // would also throw\n * ])\n *\n * console.log(ids) // [2]\n * ```\n *\n * @param data - Updates (the id and optionally other props) to the items in this data set.\n * @param senderId - Sender id.\n *\n * @returns updatedIds - The ids of the updated items.\n *\n * @throws When the supplied data is neither an item nor an array of items, when the ids are missing.\n */\n public updateOnly(\n data: UpdateItem<Item, IdProp> | UpdateItem<Item, IdProp>[],\n senderId?: Id | null\n ): Id[] {\n if (!Array.isArray(data)) {\n data = [data];\n }\n\n const updateEventData = data\n .map((update): {\n oldData: FullItem<Item, IdProp>;\n update: UpdateItem<Item, IdProp>;\n } => {\n const oldData = this._data.get(update[this._idProp]);\n if (oldData == null) {\n throw new Error(\"Updating non-existent items is not allowed.\");\n }\n return { oldData, update };\n })\n .map(({ oldData, update }): {\n id: Id;\n oldData: FullItem<Item, IdProp>;\n updatedData: FullItem<Item, IdProp>;\n } => {\n const id = oldData[this._idProp];\n const updatedData = pureDeepObjectAssign(oldData, update);\n\n this._data.set(id, updatedData);\n\n return {\n id,\n oldData: oldData,\n updatedData,\n };\n });\n\n if (updateEventData.length) {\n const props: EventPayloads<Item, IdProp>[\"update\"] = {\n items: updateEventData.map((value): Id => value.id),\n oldData: updateEventData.map(\n (value): FullItem<Item, IdProp> => value.oldData\n ),\n data: updateEventData.map(\n (value): FullItem<Item, IdProp> => value.updatedData\n ),\n };\n // TODO: remove deprecated property 'data' some day\n //Object.defineProperty(props, 'data', {\n // 'get': (function() {\n // console.warn('Property data is deprecated. Use DataSet.get(ids) to retrieve the new data, use the oldData property on this object to get the old data');\n // return updatedData;\n // }).bind(this)\n //});\n this._trigger(\"update\", props, senderId);\n\n return props.items;\n } else {\n return [];\n }\n }\n\n /** @inheritDoc */\n public get(): FullItem<Item, IdProp>[];\n /** @inheritDoc */\n public get(\n options: DataInterfaceGetOptionsArray<Item>\n ): FullItem<Item, IdProp>[];\n /** @inheritDoc */\n public get(\n options: DataInterfaceGetOptionsObject<Item>\n ): Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(\n options: DataInterfaceGetOptions<Item>\n ): FullItem<Item, IdProp>[] | Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(id: Id): null | FullItem<Item, IdProp>;\n /** @inheritDoc */\n public get(\n id: Id,\n options: DataInterfaceGetOptionsArray<Item>\n ): null | FullItem<Item, IdProp>;\n /** @inheritDoc */\n public get(\n id: Id,\n options: DataInterfaceGetOptionsObject<Item>\n ): Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(\n id: Id,\n options: DataInterfaceGetOptions<Item>\n ): null | FullItem<Item, IdProp> | Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(ids: Id[]): FullItem<Item, IdProp>[];\n /** @inheritDoc */\n public get(\n ids: Id[],\n options: DataInterfaceGetOptionsArray<Item>\n ): FullItem<Item, IdProp>[];\n /** @inheritDoc */\n public get(\n ids: Id[],\n options: DataInterfaceGetOptionsObject<Item>\n ): Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(\n ids: Id[],\n options: DataInterfaceGetOptions<Item>\n ): FullItem<Item, IdProp>[] | Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(\n ids: Id | Id[],\n options?: DataInterfaceGetOptions<Item>\n ):\n | null\n | FullItem<Item, IdProp>\n | FullItem<Item, IdProp>[]\n | Record<Id, FullItem<Item, IdProp>>;\n\n /** @inheritDoc */\n public get(\n first?: DataInterfaceGetOptions<Item> | Id | Id[],\n second?: DataInterfaceGetOptions<Item>\n ):\n | null\n | FullItem<Item, IdProp>\n | FullItem<Item, IdProp>[]\n | Record<Id, FullItem<Item, IdProp>> {\n // @TODO: Woudn't it be better to split this into multiple methods?\n\n // parse the arguments\n let id: Id | undefined = undefined;\n let ids: Id[] | undefined = undefined;\n let options: DataInterfaceGetOptions<Item> | undefined = undefined;\n if (isId(first)) {\n // get(id [, options])\n id = first;\n options = second;\n } else if (Array.isArray(first)) {\n // get(ids [, options])\n ids = first;\n options = second;\n } else {\n // get([, options])\n options = first;\n }\n\n // determine the return type\n const returnType =\n options && options.returnType === \"Object\" ? \"Object\" : \"Array\";\n // @TODO: WTF is this? Or am I missing something?\n // var returnType\n // if (options && options.returnType) {\n // var allowedValues = ['Array', 'Object']\n // returnType =\n // allowedValues.indexOf(options.returnType) == -1\n // ? 'Array'\n // : options.returnType\n // } else {\n // returnType = 'Array'\n // }\n\n // build options\n const filter = options && options.filter;\n const items: FullItem<Item, IdProp>[] = [];\n let item: undefined | FullItem<Item, IdProp> = undefined;\n let itemIds: undefined | Id[] = undefined;\n let itemId: undefined | Id = undefined;\n\n // convert items\n if (id != null) {\n // return a single item\n item = this._data.get(id);\n if (item && filter && !filter(item)) {\n item = undefined;\n }\n } else if (ids != null) {\n // return a subset of items\n for (let i = 0, len = ids.length; i < len; i++) {\n item = this._data.get(ids[i]);\n if (item != null && (!filter || filter(item))) {\n items.push(item);\n }\n }\n } else {\n // return all items\n itemIds = [...this._data.keys()];\n for (let i = 0, len = itemIds.length; i < len; i++) {\n itemId = itemIds[i];\n item = this._data.get(itemId);\n if (item != null && (!filter || filter(item))) {\n items.push(item);\n }\n }\n }\n\n // order the results\n if (options && options.order && id == undefined) {\n this._sort(items, options.order);\n }\n\n // filter fields of the items\n if (options && options.fields) {\n const fields = options.fields;\n if (id != undefined && item != null) {\n item = this._filterFields(item, fields) as FullItem<Item, IdProp>;\n } else {\n for (let i = 0, len = items.length; i < len; i++) {\n items[i] = this._filterFields(items[i], fields) as FullItem<\n Item,\n IdProp\n >;\n }\n }\n }\n\n // return the results\n if (returnType == \"Object\") {\n const result: Record<string, FullItem<Item, IdProp>> = {};\n for (let i = 0, len = items.length; i < len; i++) {\n const resultant = items[i];\n // @TODO: Shoudn't this be this._fieldId?\n // result[resultant.id] = resultant\n const id: Id = resultant[this._idProp];\n result[id] = resultant;\n }\n return result;\n } else {\n if (id != null) {\n // a single item\n return item ?? null;\n } else {\n // just return our array\n return items;\n }\n }\n }\n\n /** @inheritDoc */\n public getIds(options?: DataInterfaceGetIdsOptions<Item>): Id[] {\n const data = this._data;\n const filter = options && options.filter;\n const order = options && options.order;\n const itemIds = [...data.keys()];\n const ids: Id[] = [];\n\n if (filter) {\n // get filtered items\n if (order) {\n // create ordered list\n const items = [];\n for (let i = 0, len = itemIds.length; i < len; i++) {\n const id = itemIds[i];\n const item = this._data.get(id);\n if (item != null && filter(item)) {\n items.push(item);\n }\n }\n\n this._sort(items, order);\n\n for (let i = 0, len = items.length; i < len; i++) {\n ids.push(items[i][this._idProp]);\n }\n } else {\n // create unordered list\n for (let i = 0, len = itemIds.length; i < len; i++) {\n const id = itemIds[i];\n const item = this._data.get(id);\n if (item != null && filter(item)) {\n ids.push(item[this._idProp]);\n }\n }\n }\n } else {\n // get all items\n if (order) {\n // create an ordered list\n const items = [];\n for (let i = 0, len = itemIds.length; i < len; i++) {\n const id = itemIds[i];\n items.push(data.get(id)!);\n }\n\n this._sort(items, order);\n\n for (let i = 0, len = items.length; i < len; i++) {\n ids.push(items[i][this._idProp]);\n }\n } else {\n // create unordered list\n for (let i = 0, len = itemIds.length; i < len; i++) {\n const id = itemIds[i];\n const item = data.get(id);\n if (item != null) {\n ids.push(item[this._idProp]);\n }\n }\n }\n }\n\n return ids;\n }\n\n /** @inheritDoc */\n public getDataSet(): DataSet<Item, IdProp> {\n return this;\n }\n\n /** @inheritDoc */\n public forEach(\n callback: (item: Item, id: Id) => void,\n options?: DataInterfaceForEachOptions<Item>\n ): void {\n const filter = options && options.filter;\n const data = this._data;\n const itemIds = [...data.keys()];\n\n if (options && options.order) {\n // execute forEach on ordered list\n const items: FullItem<Item, IdProp>[] = this.get(options);\n\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const id = item[this._idProp];\n callback(item, id);\n }\n } else {\n // unordered\n for (let i = 0, len = itemIds.length; i < len; i++) {\n const id = itemIds[i];\n const item = this._data.get(id);\n if (item != null && (!filter || filter(item))) {\n callback(item, id);\n }\n }\n }\n }\n\n /** @inheritDoc */\n public map<T>(\n callback: (item: Item, id: Id) => T,\n options?: DataInterfaceMapOptions<Item, T>\n ): T[] {\n const filter = options && options.filter;\n const mappedItems: T[] = [];\n const data = this._data;\n const itemIds = [...data.keys()];\n\n // convert and filter items\n for (let i = 0, len = itemIds.length; i < len; i++) {\n const id = itemIds[i];\n const item = this._data.get(id);\n if (item != null && (!filter || filter(item))) {\n mappedItems.push(callback(item, id));\n }\n }\n\n // order items\n if (options && options.order) {\n this._sort(mappedItems, options.order);\n }\n\n return mappedItems;\n }\n\n private _filterFields<K extends string>(item: null, fields: K[]): null;\n private _filterFields<K extends string>(\n item: Record<K, unknown>,\n fields: K[]\n ): Record<K, unknown>;\n private _filterFields<K extends string>(\n item: Record<K, unknown>,\n fields: K[] | Record<K, string>\n ): any;\n /**\n * Filter the fields of an item.\n *\n * @param item - The item whose fields should be filtered.\n * @param fields - The names of the fields that will be kept.\n *\n * @typeParam K - Field name type.\n *\n * @returns The item without any additional fields.\n */\n private _filterFields<K extends string>(\n item: Record<K, unknown> | null,\n fields: K[] | Record<K, unknown>\n ): Record<K, unknown> | null {\n if (!item) {\n // item is null\n return item;\n }\n\n return (Array.isArray(fields)\n ? // Use the supplied array\n fields\n : // Use the keys of the supplied object\n (Object.keys(fields) as K[])\n ).reduce<Record<string, unknown>>((filteredItem, field): Record<\n string,\n unknown\n > => {\n filteredItem[field] = item[field];\n return filteredItem;\n }, {});\n }\n\n /**\n * Sort the provided array with items.\n *\n * @param items - Items to be sorted in place.\n * @param order - A field name or custom sort function.\n *\n * @typeParam T - The type of the items in the items array.\n */\n private _sort<T>(items: T[], order: DataInterfaceOrder<T>): void {\n if (typeof order === \"string\") {\n // order by provided field name\n const name = order; // field name\n items.sort((a, b): -1 | 0 | 1 => {\n // @TODO: How to treat missing properties?\n const av = (a as any)[name];\n const bv = (b as any)[name];\n return av > bv ? 1 : av < bv ? -1 : 0;\n });\n } else if (typeof order === \"function\") {\n // order by sort function\n items.sort(order);\n } else {\n // TODO: extend order by an Object {field:string, direction:string}\n // where direction can be 'asc' or 'desc'\n throw new TypeError(\"Order must be a function or a string\");\n }\n }\n\n /**\n * Remove an item or multiple items by “reference” (only the id is used) or by id.\n *\n * The method ignores removal of non-existing items, and returns an array containing the ids of the items which are actually removed from the DataSet.\n *\n * After the items are removed, the DataSet will trigger an event `remove` for the removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.\n *\n * ## Example\n * ```javascript\n * // create a DataSet\n * const data = new vis.DataSet([\n * { id: 1, text: 'item 1' },\n * { id: 2, text: 'item 2' },\n * { id: 3, text: 'item 3' }\n * ])\n *\n * // remove items\n * const ids = data.remove([2, { id: 3 }, 4])\n *\n * console.log(ids) // [2, 3]\n * ```\n *\n * @param id - One or more items or ids of items to be removed.\n * @param senderId - Sender id.\n *\n * @returns The ids of the removed items.\n */\n public remove(id: Id | Item | (Id | Item)[], senderId?: Id | null): Id[] {\n const removedIds: Id[] = [];\n const removedItems: FullItem<Item, IdProp>[] = [];\n\n // force everything to be an array for simplicity\n const ids = Array.isArray(id) ? id : [id];\n\n for (let i = 0, len = ids.length; i < len; i++) {\n const item = this._remove(ids[i]);\n if (item) {\n const itemId: OptId = item[this._idProp];\n if (itemId != null) {\n removedIds.push(itemId);\n removedItems.push(item);\n }\n }\n }\n\n if (removedIds.length) {\n this._trigger(\n \"remove\",\n { items: removedIds, oldData: removedItems },\n senderId\n );\n }\n\n return removedIds;\n }\n\n /**\n * Remove an item by its id or reference.\n *\n * @param id - Id of an item or the item itself.\n *\n * @returns The removed item if removed, null otherwise.\n */\n private _remove(id: Id | Item): FullItem<Item, IdProp> | null {\n // @TODO: It origianlly returned the item although the docs say id.\n // The code expects the item, so probably an error in the docs.\n let ident: OptId;\n\n // confirm the id to use based on the args type\n if (isId(id)) {\n ident = id;\n } else if (id && typeof id === \"object\") {\n ident = id[this._idProp]; // look for the identifier field using ._idProp\n }\n\n // do the removing if the item is found\n if (ident != null && this._data.has(ident)) {\n const item = this._data.get(ident) || null;\n this._data.delete(ident);\n --this.length;\n return item;\n }\n\n return null;\n }\n\n /**\n * Clear the entire data set.\n *\n * After the items are removed, the [[DataSet]] will trigger an event `remove` for all removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.\n *\n * @param senderId - Sender id.\n *\n * @returns removedIds - The ids of all removed items.\n */\n public clear(senderId?: Id | null): Id[] {\n const ids = [...this._data.keys()];\n const items: FullItem<Item, IdProp>[] = [];\n\n for (let i = 0, len = ids.length; i < len; i++) {\n items.push(this._data.get(ids[i])!);\n }\n\n this._data.clear();\n this.length = 0;\n\n this._trigger(\"remove\", { items: ids, oldData: items }, senderId);\n\n return ids;\n }\n\n /**\n * Find the item with maximum value of a specified field.\n *\n * @param field - Name of the property that should be searched for max value.\n *\n * @returns Item containing max value, or null if no items.\n */\n public max(field: keyof Item): Item | null {\n let max = null;\n let maxField = null;\n\n for (const item of this._data.values()) {\n const itemField = item[field];\n if (\n typeof itemField === \"number\" &&\n (maxField == null || itemField > maxField)\n ) {\n max = item;\n maxField = itemField;\n }\n }\n\n return max || null;\n }\n\n /**\n * Find the item with minimum value of a specified field.\n *\n * @param field - Name of the property that should be searched for min value.\n *\n * @returns Item containing min value, or null if no items.\n */\n public min(field: keyof Item): Item | null {\n let min = null;\n let minField = null;\n\n for (const item of this._data.values()) {\n const itemField = item[field];\n if (\n typeof itemField === \"number\" &&\n (minField == null || itemField < minField)\n ) {\n min = item;\n minField = itemField;\n }\n }\n\n return min || null;\n }\n\n public distinct<T extends keyof Item>(prop: T): Item[T][];\n public distinct(prop: string): unknown[];\n /**\n * Find all distinct values of a specified field\n *\n * @param prop - The property name whose distinct values should be returned.\n *\n * @returns Unordered array containing all distinct values. Items without specified property are ignored.\n */\n public distinct<T extends string>(prop: T): unknown[] {\n const data = this._data;\n const itemIds = [...data.keys()];\n const values: unknown[] = [];\n let count = 0;\n\n for (let i = 0, len = itemIds.length; i < len; i++) {\n const id = itemIds[i];\n const item = data.get(id);\n const value = (item as any)[prop];\n let exists = false;\n for (let j = 0; j < count; j++) {\n if (values[j] == value) {\n exists = true;\n break;\n }\n }\n if (!exists && value !== undefined) {\n values[count] = value;\n count++;\n }\n }\n\n return values;\n }\n\n /**\n * Add a single item. Will fail when an item with the same id already exists.\n *\n * @param item - A new item to be added.\n *\n * @returns Added item's id. An id is generated when it is not present in the item.\n */\n private _addItem(item: Item): Id {\n const fullItem = ensureFullItem(item, this._idProp);\n const id = fullItem[this._idProp];\n\n // check whether this id is already taken\n if (this._data.has(id)) {\n // item already exists\n throw new Error(\n \"Cannot add item: item with id \" + id + \" already exists\"\n );\n }\n\n this._data.set(id, fullItem);\n ++this.length;\n\n return id;\n }\n\n /**\n * Update a single item: merge with existing item.\n * Will fail when the item has no id, or when there does not exist an item with the same id.\n *\n * @param update - The new item\n *\n * @returns The id of the updated item.\n */\n private _updateItem(update: FullItem<Item, IdProp>): Id {\n const id: OptId = update[this._idProp];\n if (id == null) {\n throw new Error(\n \"Cannot update item: item has no id (item: \" +\n JSON.stringify(update) +\n \")\"\n );\n }\n const item = this._data.get(id);\n if (!item) {\n // item doesn't exist\n throw new Error(\"Cannot update item: no item with id \" + id + \" found\");\n }\n\n this._data.set(id, { ...item, ...update });\n\n return id;\n }\n\n /** @inheritDoc */\n public stream(ids?: Iterable<Id>): DataStream<Item> {\n if (ids) {\n const data = this._data;\n\n return new DataStream<Item>({\n *[Symbol.iterator](): IterableIterator<[Id, Item]> {\n for (const id of ids) {\n const item = data.get(id);\n if (item != null) {\n yield [id, item];\n }\n }\n },\n });\n } else {\n return new DataStream({\n [Symbol.iterator]: this._data.entries.bind(this._data),\n });\n }\n }\n\n /* develblock:start */\n public get testLeakData(): Map<Id, FullItem<Item, IdProp>> {\n return this._data;\n }\n public get testLeakIdProp(): IdProp {\n return this._idProp;\n }\n public get testLeakOptions(): DataSetInitialOptions<IdProp> {\n return this._options;\n }\n public get testLeakQueue(): Queue<this> | null {\n return this._queue;\n }\n public set testLeakQueue(v: Queue<this> | null) {\n this._queue = v;\n }\n /* develblock:end */\n}\n","import {\n DataInterface,\n DataInterfaceForEachOptions,\n DataInterfaceGetIdsOptions,\n DataInterfaceGetOptions,\n DataInterfaceGetOptionsArray,\n DataInterfaceGetOptionsObject,\n DataInterfaceMapOptions,\n EventCallbacksWithAny,\n EventName,\n EventPayloads,\n FullItem,\n Id,\n PartItem,\n RemoveEventPayload,\n UpdateEventPayload,\n isId,\n} from \"./data-interface\";\n\nimport { DataSet } from \"./data-set\";\nimport { DataSetPart } from \"./data-set-part\";\nimport { DataStream } from \"./data-stream\";\n\n/**\n * Data view options.\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport interface DataViewOptions<Item, IdProp extends string> {\n /**\n * The name of the field containing the id of the items. When data is fetched from a server which uses some specific field to identify items, this field name can be specified in the DataSet using the option `fieldId`. For example [CouchDB](http://couchdb.apache.org/) uses the field `'_id'` to identify documents.\n */\n fieldId?: IdProp;\n /** Items can be filtered on specific properties by providing a filter function. A filter function is executed for each of the items in the DataSet, and is called with the item as parameter. The function must return a boolean. All items for which the filter function returns true will be emitted. */\n filter?: (item: Item) => boolean;\n}\n\n/**\n * DataView\n *\n * A DataView offers a filtered and/or formatted view on a DataSet. One can subscribe to changes in a DataView, and easily get filtered or formatted data without having to specify filters and field types all the time.\n *\n * ## Example\n * ```javascript\n * // create a DataSet\n * var data = new vis.DataSet();\n * data.add([\n * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},\n * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},\n * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},\n * {id: 4, text: 'item 4'}\n * ]);\n *\n * // create a DataView\n * // the view will only contain items having a property group with value 1,\n * // and will only output fields id, text, and date.\n * var view = new vis.DataView(data, {\n * filter: function (item) {\n * return (item.group == 1);\n * },\n * fields: ['id', 'text', 'date']\n * });\n *\n * // subscribe to any change in the DataView\n * view.on('*', function (event, properties, senderId) {\n * console.log('event', event, properties);\n * });\n *\n * // update an item in the data set\n * data.update({id: 2, group: 1});\n *\n * // get all ids in the view\n * var ids = view.getIds();\n * console.log('ids', ids); // will output [1, 2]\n *\n * // get all items in the view\n * var items = view.get();\n * ```\n *\n * @typeParam Item - Item type that may or may not have an id.\n * @typeParam IdProp - Name of the property that contains the id.\n */\nexport class DataView<\n Item extends PartItem<IdProp>,\n IdProp extends string = \"id\"\n >\n extends DataSetPart<Item, IdProp>\n implements DataInterface<Item, IdProp> {\n /** @inheritDoc */\n public length = 0;\n /** @inheritDoc */\n public get idProp(): IdProp {\n return this.getDataSet().idProp;\n }\n\n private readonly _listener: EventCallbacksWithAny<Item, IdProp>[\"*\"];\n private _data!: DataInterface<Item, IdProp>; // constructor → setData\n private readonly _ids: Set<Id> = new Set(); // ids of the items currently in memory (just contains a boolean true)\n private readonly _options: DataViewOptions<Item, IdProp>;\n\n /**\n * Create a DataView.\n *\n * @param data - The instance containing data (directly or indirectly).\n * @param options - Options to configure this data view.\n */\n public constructor(\n data: DataInterface<Item, IdProp>,\n options?: DataViewOptions<Item, IdProp>\n ) {\n super();\n\n this._options = options || {};\n\n this._listener = this._onEvent.bind(this);\n\n this.setData(data);\n }\n\n // TODO: implement a function .config() to dynamically update things like configured filter\n // and trigger changes accordingly\n\n /**\n * Set a data source for the view.\n *\n * @param data - The instance containing data (directly or indirectly).\n *\n * @remarks\n * Note that when the data view is bound to a data set it won't be garbage\n * collected unless the data set is too. Use `dataView.setData(null)` or\n * `dataView.dispose()` to enable garbage collection before you lose the last\n * reference.\n */\n public setData(data: DataInterface<Item, IdProp>): void {\n if (this._data) {\n // unsubscribe from current dataset\n if (this._data.off) {\n this._data.off(\"*\", this._listener);\n }\n\n // trigger a remove of all items in memory\n const ids = this._data.getIds({ filter: this._options.filter });\n const items = this._data.get(ids);\n\n this._ids.clear();\n this.length = 0;\n this._trigger(\"remove\", { items: ids, oldData: items });\n }\n\n if (data != null) {\n this._data = data;\n\n // trigger an add of all added items\n const ids = this._data.getIds({ filter: this._options.filter });\n for (let i = 0, len = ids.length; i < len; i++) {\n const id = ids[i];\n this._ids.add(id);\n }\n this.length = ids.length;\n this._trigger(\"add\", { items: ids });\n } else {\n this._data = new DataSet<Item, IdProp>();\n }\n\n // subscribe to new dataset\n if (this._data.on) {\n this._data.on(\"*\", this._listener);\n }\n }\n\n /**\n * Refresh the DataView.\n * Useful when the DataView has a filter function containing a variable parameter.\n */\n public refresh(): void {\n const ids = this._data.getIds({\n filter: this._options.filter,\n });\n const oldIds = [...this._ids];\n const newIds: Record<Id, boolean> = {};\n const addedIds: Id[] = [];\n const removedIds: Id[] = [];\n const removedItems: FullItem<Item, IdProp>[] = [];\n\n // check for additions\n for (let i = 0, len = ids.length; i < len; i++) {\n const id = ids[i];\n newIds[id] = true;\n if (!this._ids.has(id)) {\n addedIds.push(id);\n this._ids.add(id);\n }\n }\n\n // check for removals\n for (let i = 0, len = oldIds.length; i < len; i++) {\n const id = oldIds[i];\n const item = this._data.get(id);\n if (item == null) {\n // @TODO: Investigate.\n // Doesn't happen during tests or examples.\n // Is it really impossible or could it eventually happen?\n // How to handle it if it does? The types guarantee non-nullable items.\n console.error(\"If you see this, report it please.\");\n } else if (!newIds[id]) {\n removedIds.push(id);\n removedItems.push(item);\n this._ids.delete(id);\n }\n }\n\n this.length += addedIds.length - removedIds.length;\n\n // trigger events\n if (addedIds.length) {\n this._trigger(\"add\", { items: addedIds });\n }\n if (removedIds.length) {\n this._trigger(\"remove\", { items: removedIds, oldData: removedItems });\n }\n }\n\n /** @inheritDoc */\n public get(): FullItem<Item, IdProp>[];\n /** @inheritDoc */\n public get(\n options: DataInterfaceGetOptionsArray<Item>\n ): FullItem<Item, IdProp>[];\n /** @inheritDoc */\n public get(\n options: DataInterfaceGetOptionsObject<Item>\n ): Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(\n options: DataInterfaceGetOptions<Item>\n ): FullItem<Item, IdProp>[] | Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(id: Id): null | FullItem<Item, IdProp>;\n /** @inheritDoc */\n public get(\n id: Id,\n options: DataInterfaceGetOptionsArray<Item>\n ): null | FullItem<Item, IdProp>;\n /** @inheritDoc */\n public get(\n id: Id,\n options: DataInterfaceGetOptionsObject<Item>\n ): Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(\n id: Id,\n options: DataInterfaceGetOptions<Item>\n ): null | FullItem<Item, IdProp> | Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(ids: Id[]): FullItem<Item, IdProp>[];\n /** @inheritDoc */\n public get(\n ids: Id[],\n options: DataInterfaceGetOptionsArray<Item>\n ): FullItem<Item, IdProp>[];\n /** @inheritDoc */\n public get(\n ids: Id[],\n options: DataInterfaceGetOptionsObject<Item>\n ): Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(\n ids: Id[],\n options: DataInterfaceGetOptions<Item>\n ): FullItem<Item, IdProp>[] | Record<Id, FullItem<Item, IdProp>>;\n /** @inheritDoc */\n public get(\n ids: Id | Id[],\n options?: DataInterfaceGetOptions<Item>\n ):\n | null\n | FullItem<Item, IdProp>\n | FullItem<Item, IdProp>[]\n | Record<Id, FullItem<Item, IdProp>>;\n\n /** @inheritDoc */\n public get(\n first?: DataInterfaceGetOptions<Item> | Id | Id[],\n second?: DataInterfaceGetOptions<Item>\n ):\n | null\n | FullItem<Item, IdProp>\n | FullItem<Item, IdProp>[]\n | Record<string, FullItem<Item, IdProp>> {\n if (this._data == null) {\n return null;\n }\n\n // parse the arguments\n let ids: Id | Id[] | null = null;\n let options: any;\n if (isId(first) || Array.isArray(first)) {\n ids = first;\n options = second;\n } else {\n options = first;\n }\n\n // extend the options with the default options and provided options\n const viewOptions: DataInterfaceGetOptions<Item> = Object.assign(\n {},\n this._options,\n options\n );\n\n // create a combined filter method when needed\n const thisFilter = this._options.filter;\n const optionsFilter = options && options.filter;\n if (thisFilter && optionsFilter) {\n viewOptions.filter = (item): boolean => {\n return thisFilter(item) && optionsFilter(item);\n };\n }\n\n if (ids == null) {\n return this._data.get(viewOptions);\n } else {\n return this._data.get(ids, viewOptions);\n }\n }\n\n /** @inheritDoc */\n public getIds(options?: DataInterfaceGetIdsOptions<Item>): Id[] {\n if (this._data.length) {\n const defaultFilter = this._options.filter;\n const optionsFilter = options != null ? options.filter : null;\n let filter: DataInterfaceGetIdsOptions<Item>[\"filter\"];\n\n if (optionsFilter) {\n if (defaultFilter) {\n filter = (item): boolean => {\n return defaultFilter(item) && optionsFilter(item);\n };\n } else {\n filter = optionsFilter;\n }\n } else {\n filter = defaultFilter;\n }\n\n return this._data.getIds({\n filter: filter,\n order: options && options.order,\n });\n } else {\n return [];\n }\n }\n\n /** @inheritDoc */\n public forEach(\n callback: (item: Item, id: Id) => void,\n options?: DataInterfaceForEachOptions<Item>\n ): void {\n if (this._data) {\n const defaultFilter = this._options.filter;\n const optionsFilter = options && options.filter;\n let filter: undefined | ((item: Item) => boolean);\n\n if (optionsFilter) {\n if (defaultFilter) {\n filter = function (item: Item): boolean {\n return defaultFilter(item) && optionsFilter(item);\n };\n } else {\n filter = optionsFilter;\n }\n } else {\n filter = defaultFilter;\n }\n\n this._data.forEach(callback, {\n filter: filter,\n order: options && options.order,\n });\n }\n }\n\n /** @inheritDoc */\n public map<T>(\n callback: (item: Item, id: Id) => T,\n options?: DataInterfaceMapOptions<Item, T>\n ): T[] {\n type Filter = NonNullable<DataInterfaceMapOptions<Item, T>[\"filter\"]>;\n\n if (this._data) {\n const defaultFilter = this._options.filter;\n const optionsFilter = options && options.filter;\n let filter: undefined | Filter;\n\n if (optionsFilter) {\n if (defaultFilter) {\n filter = (item): ReturnType<Filter> => {\n return defaultFilter(item) && optionsFilter(item);\n };\n } else {\n filter = optionsFilter;\n }\n } else {\n filter = defaultFilter;\n }\n\n return this._data.map(callback, {\n filter: filter,\n order: options && options.order,\n });\n } else {\n return [];\n }\n }\n\n /** @inheritDoc */\n public getDataSet(): DataSet<Item, IdProp> {\n return this._data.getDataSet();\n }\n\n /** @inheritDoc */\n public stream(ids?: Iterable<Id>): DataStream<Item> {\n return this._data.stream(\n ids || {\n [Symbol.iterator]: this._ids.keys.bind(this._ids),\n }\n );\n }\n\n /**\n * Render the instance unusable prior to garbage collection.\n *\n * @remarks\n * The intention of this method is to help discover scenarios where the data\n * view is being used when the programmer thinks it has been garbage collected\n * already. It's stricter version of `dataView.setData(null)`.\n */\n public dispose(): void {\n if (this._data?.off) {\n this._data.off(\"*\", this._listener);\n }\n\n const message = \"This data view has already been disposed of.\";\n const replacement = {\n get: (): void => {\n throw new Error(message);\n },\n set: (): void => {\n throw new Error(message);\n },\n\n configurable: false,\n };\n for (const key of Reflect.ownKeys(DataView.prototype)) {\n Object.defineProperty(this, key, replacement);\n }\n }\n\n /**\n * Event listener. Will propagate all events from the connected data set to the subscribers of the DataView, but will filter the items and only trigger when there are changes in the filtered data set.\n *\n * @param event - The name of the event.\n * @param params - Parameters of the event.\n * @param senderId - Id supplied by the sender.\n */\n private _onEvent<EN extends EventName>(\n event: EN,\n params: EventPayloads<Item, IdProp>[EN],\n senderId?: Id | null\n ): void {\n if (!params || !params.items || !this._data) {\n return;\n }\n\n const ids = params.items;\n const addedIds: Id[] = [];\n const updatedIds: Id[] = [];\n const removedIds: Id[] = [];\n const oldItems: FullItem<Item, IdProp>[] = [];\n const updatedItems: FullItem<Item, IdProp>[] = [];\n const removedItems: FullItem<Item, IdProp>[] = [];\n\n switch (event) {\n case \"add\":\n // filter the ids of the added items\n for (let i = 0, len = ids.length; i < len; i++) {\n const id = ids[i];\n const item = this.get(id);\n if (item) {\n this._ids.add(id);\n addedIds.push(id);\n }\n }\n\n break;\n\n case \"update\":\n // determine the event from the views viewpoint: an updated\n // item can be added, updated, or removed from this view.\n for (let i = 0, len = ids.length; i < len; i++) {\n const id = ids[i];\n const item = this.get(id);\n\n if (item) {\n if (this._ids.has(id)) {\n updatedIds.push(id);\n updatedItems.push(\n (params as UpdateEventPayload<Item, IdProp>).data[i]\n );\n oldItems.push(\n (params as UpdateEventPayload<Item, IdProp>).oldData[i]\n );\n } else {\n this._ids.add(id);\n addedIds.push(id);\n }\n } else {\n if (this._ids.has(id)) {\n this._ids.delete(id);\n removedIds.push(id);\n removedItems.push(\n (params as UpdateEventPayload<Item, IdProp>).oldData[i]\n );\n } else {\n // nothing interesting for me :-(\n }\n }\n }\n\n break;\n\n case \"remove\":\n // filter the ids of the removed items\n for (let i = 0, len = ids.length; i < len; i++) {\n const id = ids[i];\n if (this._ids.has(id)) {\n this._ids.delete(id);\n removedIds.push(id);\n removedItems.push(\n (params as RemoveEventPayload<Item, IdProp>).oldData[i]\n );\n }\n }\n\n break;\n }\n\n this.length += addedIds.length - removedIds.length;\n\n if (addedIds.length) {\n this._trigger(\"add\", { items: addedIds }, senderId);\n }\n if (updatedIds.length) {\n this._trigger(\n \"update\",\n { items: updatedIds, oldData: oldItems, data: updatedItems },\n senderId\n );\n }\n if (removedIds.length) {\n this._trigger(\n \"remove\",\n { items: removedIds, oldData: removedItems },\n senderId\n );\n }\n }\n}\n","import { PartItem } from \"./data-interface\";\nimport { DataSet } from \"./data-set\";\n\n/**\n * Check that given value is compatible with Vis Data Set interface.\n *\n * @param idProp - The expected property to contain item id.\n * @param v - The value to be tested.\n *\n * @returns True if all expected values and methods match, false otherwise.\n */\nexport function isDataSetLike<\n Item extends PartItem<IdProp>,\n IdProp extends string = \"id\"\n>(idProp: IdProp, v: any): v is DataSet<Item, IdProp> {\n return (\n typeof v === \"object\" &&\n v !== null &&\n idProp === v.idProp &&\n typeof v.add === \"function\" &&\n typeof v.clear === \"function\" &&\n typeof v.distinct === \"function\" &&\n typeof v.forEach === \"function\" &&\n typeof v.get === \"function\" &&\n typeof v.getDataSet === \"function\" &&\n typeof v.getIds === \"function\" &&\n typeof v.length === \"number\" &&\n typeof v.map === \"function\" &&\n typeof v.max === \"function\" &&\n typeof v.min === \"function\" &&\n typeof v.off === \"function\" &&\n typeof v.on === \"function\" &&\n typeof v.remove === \"function\" &&\n typeof v.setOptions === \"function\" &&\n typeof v.stream === \"function\" &&\n typeof v.update === \"function\" &&\n typeof v.updateOnly === \"function\"\n );\n}\n","import { DataView } from \"./data-view\";\nimport { PartItem } from \"./data-interface\";\nimport { isDataSetLike } from \"./data-set-check\";\n\n/**\n * Check that given value is compatible with Vis Data View interface.\n *\n * @param idProp - The expected property to contain item id.\n * @param v - The value to be tested.\n *\n * @returns True if all expected values and methods match, false otherwise.\n */\nexport function isDataViewLike<\n Item extends PartItem<IdProp>,\n IdProp extends string = \"id\"\n>(idProp: IdProp, v: any): v is DataView<Item, IdProp> {\n return (\n typeof v === \"object\" &&\n v !== null &&\n idProp === v.idProp &&\n typeof v.forEach === \"function\" &&\n typeof v.get === \"function\" &&\n typeof v.getDataSet === \"function\" &&\n typeof v.getIds === \"function\" &&\n typeof v.length === \"number\" &&\n typeof v.map === \"function\" &&\n typeof v.off === \"function\" &&\n typeof v.on === \"function\" &&\n typeof v.stream === \"function\" &&\n isDataSetLike(idProp, v.getDataSet())\n );\n}\n"],"names":["check","it","Math","globalThis","window","self","global","Function","exec","error","fails","Object","defineProperty","get","nativePropertyIsEnumerable","propertyIsEnumerable","getOwnPropertyDescriptor","NASHORN_BUG","call","V","descriptor","enumerable","bitmap","value","configurable","writable","toString","slice","split","classof","undefined","TypeError","IndexedObject","requireObjectCoercible","input","PREFERRED_STRING","isObject","fn","val","valueOf","hasOwnProperty","key","document","EXISTS","createElement","DESCRIPTORS","a","nativeGetOwnPropertyDescriptor","O","P","toIndexedObject","toPrimitive","IE8_DOM_DEFINE","has","createPropertyDescriptor","propertyIsEnumerableModule","f","replacement","isForced","feature","detection","data","normalize","POLYFILL","NATIVE","string","String","replace","toLowerCase","that","length","aFunction","b","c","apply","arguments","nativeDefineProperty","Attributes","anObject","object","definePropertyModule","require$$0","wrapConstructor","NativeConstructor","Wrapper","prototype","options","source","TARGET","target","GLOBAL","STATIC","stat","PROTO","proto","nativeSource","path","targetPrototype","FORCED","USE_NATIVE","VIRTUAL_PROTOTYPE","sourceProperty","targetProperty","nativeProperty","resultProperty","forced","noTargetGet","bind","wrap","sham","createNonEnumerableProperty","real","Array","isArray","arg","ceil","floor","argument","isNaN","min","toInteger","flattenIntoArray","original","sourceLen","start","depth","mapper","thisArg","targetIndex","sourceIndex","mapFn","element","toLength","SHARED","store","setGlobal","module","push","version","mode","copyright","id","postfix","random","getOwnPropertySymbols","Symbol","NATIVE_SYMBOL","iterator","WellKnownSymbolsStore","shared","createWellKnownSymbol","USE_SYMBOL_AS_UID","withoutSetter","uid","name","SPECIES","wellKnownSymbol","originalArray","C","constructor","$","flatMap","callbackfn","toObject","A","arraySpeciesCreate","CONSTRUCTOR","entryVirtual","ArrayPrototype","own","parent","createMethod","TYPE","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","$this","specificCreate","boundFunction","index","create","result","forEach","map","filter","some","every","find","findIndex","variable","namespace","method","getBuiltIn","process","versions","v8","match","userAgent","METHOD_NAME","V8_VERSION","array","foo","Boolean","cache","thrower","ACCESSORS","argument0","argument1","$map","HAS_SPECIES_SUPPORT","arrayMethodHasSpeciesSupport","USES_TO_LENGTH","arrayMethodUsesToLength","$filter","IS_RIGHT","argumentsLength","memo","i","left","right","$reduce","STRICT_METHOD","arrayMethodIsStrict","CHROME_BUG","IS_NODE","CHROME_VERSION","reduce","factories","construct","argsLength","args","list","join","partArgs","bound","concat","FunctionPrototype","_classCallCheck","instance","Constructor","objectDefinePropertyModile","desc","_defineProperties","props","_Object$defineProperty","_createClass","protoProps","staticProps","createNewDataPipeFrom","from","DataPipeUnderConstruction","SimpleDataPipe","_source","_transformers","_target","add","_bindInstanceProperty","_add","remove","_remove","update","_update","_transformItems","on","_listeners","off","items","_reduceInstanceProperty","transform","_name","payload","oldData","callback","_filterInstanceProperty","_mapInstanceProperty","_flatMapInstanceProperty","max","integer","IS_INCLUDES","el","fromIndex","toAbsoluteIndex","includes","indexOf","names","hiddenKeys","keys","internalObjectKeys","enumBugKeys","defineProperties","Properties","objectKeys","T","D","getOwnPropertyNames","ownKeys","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","propertyKey","getOwnPropertyDescriptors","getOwnPropertyDescriptorModule","createProperty","FAILS_ON_PRIMITIVES","GT","LT","PROTOTYPE","SCRIPT","IE_PROTO","sharedKey","EmptyConstructor","scriptTag","content","NullProtoObjectViaActiveX","activeXDocument","write","close","temp","parentWindow","NullProtoObjectViaIFrame","iframe","documentCreateElement","JS","iframeDocument","style","display","html","appendChild","src","contentWindow","open","F","NullProtoObject","domain","ActiveXObject","nativeGetOwnPropertyNames","windowNames","getWindowNames","NAME","wrappedWellKnownSymbolModule","TO_STRING_TAG","test","CORRECT_ARGUMENTS","classofRaw","tryGet","TO_STRING_TAG_SUPPORT","tag","callee","TAG","SET_METHOD","functionToString","inspectSource","WeakMap","set","enforce","getterFor","state","type","NATIVE_WEAK_MAP","wmget","wmhas","wmset","metadata","facade","STATE","objectHas","$forEach","HIDDEN","SYMBOL","TO_PRIMITIVE","setInternalState","InternalStateModule","getInternalState","ObjectPrototype","$Symbol","$stringify","getOwnPropertyNamesExternal","AllSymbols","ObjectPrototypeSymbols","StringToSymbolRegistry","SymbolToStringRegistry","QObject","USE_SETTER","findChild","setSymbolDescriptor","nativeObjectCreate","ObjectPrototypeDescriptor","description","symbol","isSymbol","$defineProperty","$defineProperties","properties","$getOwnPropertySymbols","$propertyIsEnumerable","$create","$getOwnPropertyDescriptor","$getOwnPropertyNames","IS_OBJECT_PROTOTYPE","setter","redefine","defineWellKnownSymbol","keyFor","sym","useSetter","useSimple","FORCED_JSON_STRINGIFY","stringify","replacer","space","$replacer","setToStringTag","getPrototypeOf","CORRECT_PROTOTYPE_GETTER","ITERATOR","BUGGY_SAFARI_ITERATORS","IteratorPrototype","PrototypeOfArrayIteratorPrototype","arrayIterator","returnThis","IteratorConstructor","next","Iterators","setPrototypeOf","CORRECT_SETTER","aPossiblePrototype","__proto__","IteratorsCore","KEYS","VALUES","ENTRIES","Iterable","DEFAULT","IS_SET","createIteratorConstructor","getIterationMethod","KIND","defaultIterator","IterablePrototype","values","entries","INCORRECT_VALUES_NAME","nativeIterator","anyNativeIterator","CurrentIteratorPrototype","methods","KEY","ARRAY_ITERATOR","defineIterator","iterated","kind","done","Arguments","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","COLLECTION_NAME","DOMIterables","Collection","CollectionPrototype","CONVERT_TO_STRING","pos","S","position","size","first","second","charCodeAt","charAt","codeAt","STRING_ITERATOR","point","iteratorMethod","getIteratorMethod","getIterator","returnMethod","iteratorClose","arrayLike","mapfn","mapping","step","isArrayIteratorMethod","callWithSafeIterationClosing","SAFE_CLOSING","called","iteratorWithReturn","SKIP_CLOSING","ITERATION_SUPPORT","INCORRECT_ITERATION","checkCorrectnessOfIteration","iterable","fill","end","endPos","MSIE","scheduler","handler","timeout","boundArgs","setTimeout","setInterval","re","low","hi","fix","offset","prev","core","JSON","_defineProperty","obj","whitespace","whitespaces","ltrim","RegExp","rtrim","trim","non","$trim","forcedStringTrimMethod","$indexOf","nativeIndexOf","NEGATIVE_ZERO","searchElement","$parseInt","parseInt","hex","radix","parseIntImplementation","TO_ENTRIES","$values","nativeGetPrototypeOf","$includes","MATCH","isRegExp","regexp","error1","error2","correctIsRegExpLogic","searchString","notARegExp","nativeAssign","assign","B","alphabet","chr","j","MAX_SAFE_INTEGER","MAXIMUM_ALLOWED_LENGTH_EXCEEDED","splice","deleteCount","len","actualStart","insertCount","actualDeleteCount","k","to","nativeReverse","reverse","_arrayWithHoles","arr","_Array$isArray","isIterable","IS_CONCAT_SPREADABLE","MAXIMUM_ALLOWED_INDEX_EXCEEDED","IS_CONCAT_SPREADABLE_SUPPORT","SPECIES_SUPPORT","isConcatSpreadable","spreadable","n","E","_iterableToArrayLimit","_Symbol","_isIterable","_arr","_n","_d","_e","_i","_getIterator","_s","err","nativeSlice","fin","_arrayLikeToArray","arr2","_unsupportedIterableToArray","o","minLen","_context","arrayLikeToArray","_sliceInstanceProperty","_Array$from","_nonIterableRest","_slicedToArray","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","now","Date","getTime","nativeKeys","WrappedWellKnownSymbolModule","_typeof","_Symbol$iterator","Reflect","_arrayWithoutHoles","_iterableToArray","iter","_nonIterableSpread","_toConsumableArray","arrayWithoutHoles","iterableToArray","nonIterableSpread","Emitter","mixin","addEventListener","event","_callbacks","once","removeListener","removeAllListeners","removeEventListener","callbacks","cb","emit","listeners","hasListeners","output","assign$1","_Reflect$ownKeys","nativeConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","runtime","exports","Op","hasOwn","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","makeInvokeMethod","tryCatch","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","getProto","NativeIteratorPrototype","Gp","displayName","defineIteratorMethods","isGeneratorFunction","genFun","ctor","mark","awrap","__await","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","then","unwrapped","previousPromise","enqueue","callInvokeWithMethodAndArg","async","Promise","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","info","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","pop","skipTempReset","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","nativeSort","sort","FAILS_ON_UNDEFINED","FAILS_ON_NULL","comparefn","$some","isExtensible","preventExtensions","METADATA","setMetadata","objectID","weakData","fastKey","getWeakData","onFreeze","FREEZING","meta","REQUIRED","Result","stopped","unboundFunction","AS_ENTRIES","IS_ITERATOR","INTERRUPTED","iterFn","condition","callFn","require$$1","internalStateGetterFor","CONSTRUCTOR_NAME","wrapper","common","IS_WEAK","ADDER","NativePrototype","exported","getConstructor","InternalMetadataModule","anInstance","collection","iterate","IS_ADDER","setStrong","unsafe","last","getEntry","previous","removed","redefineAll","clear","ITERATOR_NAME","getInternalCollectionState","getInternalIteratorState","setSpecies","init","Map","collectionStrong","_setPrototypeOf","p","_Object$setPrototypeOf","_inherits","subClass","superClass","_Object$create","_assertThisInitialized","ReferenceError","_possibleConstructorReturn","assertThisInitialized","_getPrototypeOf","_Object$getPrototypeOf","getRandomValues","rnds8","Uint8Array","rng","crypto","msCrypto","validate","uuid","REGEX","byteToHex","substr","v4","buf","rnds","isId","Queue","delay","Infinity","setOptions","_flushIfNeeded","flush","_extended","me","queue","_queue","_timeout","clearTimeout","_setTimeout","DataSetPart","senderId","_subscribers","subscriber","Set","DataStream","pairs","_pairs","item","pair","toIdArray","toItemArray","curr","maxItem","maxValue","minItem","minValue","accumulator","_sortInstanceProperty","idA","itemA","idB","itemB","ensureFullItem","idProp","uuid4","DataSet","_options","_data","_idProp","fieldId","destroy","extend","addedIds","idsToAdd","d","_someInstanceProperty","_addItem","_trigger","updatedIds","updatedData","addOrUpdate","origId","fullItem","oldItem","_Object$assign","_updateItem","console","warn","_concatInstanceProperty","updateEventData","pureDeepObjectAssign","ids","returnType","itemIds","itemId","_keysInstanceProperty","order","_sort","fields","_filterFields","resultant","mappedItems","filteredItem","field","av","bv","removedIds","removedItems","ident","delete","maxField","_valuesInstanceProperty","itemField","minField","prop","count","exists","_JSON$stringify","DataView","_listener","_onEvent","setData","getIds","_ids","oldIds","newIds","viewOptions","thisFilter","optionsFilter","defaultFilter","getDataSet","stream","message","params","oldItems","updatedItems","isDataSetLike","v","distinct","updateOnly","isDataViewLike"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAIA,KAAK,GAAG,UAAUC,EAAV,EAAc;AACxB,SAAOA,EAAE,IAAIA,EAAE,CAACC,IAAH,IAAWA,IAAjB,IAAyBD,EAAhC;AACD,CAFD;;;AAKA,YAAc;AAEZD,KAAK,CAAC,OAAOG,UAAP,IAAqB,QAArB,IAAiCA,UAAlC,CAAL,IACAH,KAAK,CAAC,OAAOI,MAAP,IAAiB,QAAjB,IAA6BA,MAA9B,CADL,IAEAJ,KAAK,CAAC,OAAOK,IAAP,IAAe,QAAf,IAA2BA,IAA5B,CAFL,IAGAL,KAAK,CAAC,OAAOM,cAAP,IAAiB,QAAjB,IAA6BA,cAA9B,CAHL;AAKC,YAAY;AAAE,SAAO,IAAP;AAAc,CAA7B,EALA,IAKoCC,QAAQ,CAAC,aAAD,CAAR,EAPtC;;ACLA,SAAc,GAAG,UAAUC,IAAV,EAAgB;AAC/B,MAAI;AACF,WAAO,CAAC,CAACA,IAAI,EAAb;AACD,GAFD,CAEE,OAAOC,KAAP,EAAc;AACd,WAAO,IAAP;AACD;AACF,CAND;;ACGA,eAAc,GAAG,CAACC,KAAK,CAAC,YAAY;AAClC,SAAOC,MAAM,CAACC,cAAP,CAAsB,EAAtB,E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